(function(cn){typeof define=="function"&&define.amd?define(cn):cn()})(function(){"use strict";var Rj=Object.defineProperty,Pj=Object.defineProperties;var Ij=Object.getOwnPropertyDescriptors;var Xy=Object.getOwnPropertySymbols;var uF=Object.prototype.hasOwnProperty,cF=Object.prototype.propertyIsEnumerable;var jy=Math.pow,Uw=(cn,wn,mn)=>wn in cn?Rj(cn,wn,{enumerable:!0,configurable:!0,writable:!0,value:mn}):cn[wn]=mn,ge=(cn,wn)=>{for(var mn in wn||(wn={}))uF.call(wn,mn)&&Uw(cn,mn,wn[mn]);if(Xy)for(var mn of Xy(wn))cF.call(wn,mn)&&Uw(cn,mn,wn[mn]);return cn},yt=(cn,wn)=>Pj(cn,Ij(wn));var Xn=(cn,wn)=>{var mn={};for(var ir in cn)uF.call(cn,ir)&&wn.indexOf(ir)<0&&(mn[ir]=cn[ir]);if(cn!=null&&Xy)for(var ir of Xy(cn))wn.indexOf(ir)<0&&cF.call(cn,ir)&&(mn[ir]=cn[ir]);return mn};var fF=(cn,wn,mn)=>Uw(cn,typeof wn!="symbol"?wn+"":wn,mn);var du=(cn,wn,mn)=>new Promise((ir,Ut)=>{var Xa=eo=>{try{df(mn.next(eo))}catch(hf){Ut(hf)}},Jy=eo=>{try{df(mn.throw(eo))}catch(hf){Ut(hf)}},df=eo=>eo.done?ir(eo.value):Promise.resolve(eo.value).then(Xa,Jy);df((mn=mn.apply(cn,wn)).next())});function cn(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var wn={exports:{}},mn={},ir={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 Xa=Symbol.for("react.element"),Jy=Symbol.for("react.portal"),df=Symbol.for("react.fragment"),eo=Symbol.for("react.strict_mode"),hf=Symbol.for("react.profiler"),dF=Symbol.for("react.provider"),hF=Symbol.for("react.context"),pF=Symbol.for("react.forward_ref"),mF=Symbol.for("react.suspense"),gF=Symbol.for("react.memo"),vF=Symbol.for("react.lazy"),Ow=Symbol.iterator;function yF(n){return n===null||typeof n!="object"?null:(n=Ow&&n[Ow]||n["@@iterator"],typeof n=="function"?n:null)}var kw={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},zw=Object.assign,Hw={};function hu(n,e,t){this.props=n,this.context=e,this.refs=Hw,this.updater=t||kw}hu.prototype.isReactComponent={},hu.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")},hu.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function Gw(){}Gw.prototype=hu.prototype;function Ky(n,e,t){this.props=n,this.context=e,this.refs=Hw,this.updater=t||kw}var Yy=Ky.prototype=new Gw;Yy.constructor=Ky,zw(Yy,hu.prototype),Yy.isPureReactComponent=!0;var Vw=Array.isArray,Ww=Object.prototype.hasOwnProperty,Qy={current:null},Xw={key:!0,ref:!0,__self:!0,__source:!0};function jw(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)Ww.call(e,i)&&!Xw.hasOwnProperty(i)&&(r[i]=e[i]);var a=arguments.length-2;if(a===1)r.children=t;else if(1>>1,Ce=z[de];if(0>>1;der(Me,ne))Ier(Be,Me)?(z[de]=Be,z[Ie]=ne,de=Ie):(z[de]=Me,z[re]=ne,de=re);else if(Ier(Be,ne))z[de]=Be,z[Ie]=ne,de=Ie;else break e}}return $}function r(z,$){var ne=z.sortIndex-$.sortIndex;return ne!==0?ne:z.id-$.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,_=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,x=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 $=t(u);$!==null;){if($.callback===null)i(u);else if($.startTime<=z)i(u),$.sortIndex=$.expirationTime,e(l,$);else break;$=t(u)}}function w(z){if(S=!1,A(z),!v)if(t(l)!==null)v=!0,Z(I);else{var $=t(u);$!==null&&fe(w,$.startTime-z)}}function I(z,$){v=!1,S&&(S=!1,m(N),N=-1),g=!0;var ne=p;try{for(A($),h=t(l);h!==null&&(!(h.expirationTime>$)||z&&!F());){var de=h.callback;if(typeof de=="function"){h.callback=null,p=h.priorityLevel;var Ce=de(h.expirationTime<=$);$=n.unstable_now(),typeof Ce=="function"?h.callback=Ce:h===t(l)&&i(l),A($)}else i(l);h=t(l)}if(h!==null)var ot=!0;else{var re=t(u);re!==null&&fe(w,re.startTime-$),ot=!1}return ot}finally{h=null,p=ne,g=!1}}var P=!1,D=null,N=-1,B=5,T=-1;function F(){return!(n.unstable_now()-Tz||125de?(z.sortIndex=ne,e(u,z),t(l)===null&&z===t(u)&&(S?(m(N),N=-1):S=!0,fe(w,ne-de))):(z.sortIndex=Ce,e(l,z),v||g||(v=!0,Z(I))),z},n.unstable_shouldYield=F,n.unstable_wrapCallback=function(z){var $=p;return function(){var ne=p;p=$;try{return z.apply(this,arguments)}finally{p=ne}}}})(Zw),qw.exports=Zw;var PF=qw.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 IF=me,Sr=PF;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 vi={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){vi[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];vi[e]=new Gi(e,1,!1,n[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(n){vi[n]=new Gi(n,2,!1,n.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){vi[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){vi[n]=new Gi(n,3,!1,n.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(n){vi[n]=new Gi(n,3,!0,n,null,!1,!1)}),["capture","download"].forEach(function(n){vi[n]=new Gi(n,4,!1,n,null,!1,!1)}),["cols","rows","size","span"].forEach(function(n){vi[n]=new Gi(n,6,!1,n,null,!1,!1)}),["rowSpan","start"].forEach(function(n){vi[n]=new Gi(n,5,!1,n.toLowerCase(),null,!1,!1)});var t0=/[\-:]([a-z])/g;function n0(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(t0,n0);vi[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(t0,n0);vi[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(t0,n0);vi[e]=new Gi(e,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(n){vi[n]=new Gi(n,1,!1,n.toLowerCase(),null,!1,!1)}),vi.xlinkHref=new Gi("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(n){vi[n]=new Gi(n,1,!1,n.toLowerCase(),null,!0,!0)});function i0(n,e,t,i){var r=vi.hasOwnProperty(e)?vi[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{f0=!1,Error.prepareStackTrace=t}return(n=n?n.displayName||n.name:"")?gf(n):""}function NF(n){switch(n.tag){case 5:return gf(n.type);case 16:return gf("Lazy");case 13:return gf("Suspense");case 19:return gf("SuspenseList");case 0:case 2:case 15:return n=d0(n.type,!1),n;case 11:return n=d0(n.type.render,!1),n;case 1:return n=d0(n.type,!0),n;default:return""}}function h0(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 gu:return"Fragment";case mu:return"Portal";case s0:return"Profiler";case r0:return"StrictMode";case a0:return"Suspense";case l0:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case iE:return(n.displayName||"Context")+".Consumer";case nE:return(n._context.displayName||"Context")+".Provider";case o0:var e=n.render;return n=n.displayName,n||(n=e.displayName||e.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case u0:return e=n.displayName||null,e!==null?e:h0(n.type)||"Memo";case Uo:e=n._payload,n=n._init;try{return h0(n(e))}catch(t){}}return null}function UF(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 h0(e);case 8:return e===r0?"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 oE(n){var e=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function OF(n){var e=oE(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 rp(n){n._valueTracker||(n._valueTracker=OF(n))}function aE(n){if(!n)return!1;var e=n._valueTracker;if(!e)return!0;var t=e.getValue(),i="";return n&&(i=oE(n)?n.checked?"true":"false":n.value),n=i,n!==t?(e.setValue(n),!0):!1}function sp(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 p0(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 lE(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 uE(n,e){e=e.checked,e!=null&&i0(n,"checked",e,!1)}function m0(n,e){uE(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")?g0(n,e.type,t):e.hasOwnProperty("defaultValue")&&g0(n,e.type,Oo(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(n.defaultChecked=!!e.defaultChecked)}function cE(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 g0(n,e,t){(e!=="number"||sp(n.ownerDocument)!==n)&&(t==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+t&&(n.defaultValue=""+t))}var vf=Array.isArray;function vu(n,e,t,i){if(n=n.options,e){e={};for(var r=0;r"+e.valueOf().toString()+"",e=op.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;e.firstChild;)n.appendChild(e.firstChild)}});function yf(n,e){if(e){var t=n.firstChild;if(t&&t===n.lastChild&&t.nodeType===3){t.nodeValue=e;return}}n.textContent=e}var xf={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},kF=["Webkit","ms","Moz","O"];Object.keys(xf).forEach(function(n){kF.forEach(function(e){e=e+n.charAt(0).toUpperCase()+n.substring(1),xf[e]=xf[n]})});function gE(n,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||xf.hasOwnProperty(n)&&xf[n]?(""+e).trim():e+"px"}function vE(n,e){n=n.style;for(var t in e)if(e.hasOwnProperty(t)){var i=t.indexOf("--")===0,r=gE(t,e[t],i);t==="float"&&(t="cssFloat"),i?n.setProperty(t,r):n[t]=r}}var zF=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 x0(n,e){if(e){if(zF[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 _0(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 A0=null;function S0(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var M0=null,yu=null,xu=null;function yE(n){if(n=Hf(n)){if(typeof M0!="function")throw Error(Re(280));var e=n.stateNode;e&&(e=Rp(e),M0(n.stateNode,n.type,e))}}function xE(n){yu?xu?xu.push(n):xu=[n]:yu=n}function _E(){if(yu){var n=yu,e=xu;if(xu=yu=null,yE(n),e)for(n=0;n>>=0,n===0?32:31-(qF(n)/ZF|0)|0}var fp=64,dp=4194304;function Mf(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 hp(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=Mf(a):(s&=o,s!==0&&(i=Mf(s)))}else o=t&~r,o!==0?i=Mf(o):s!==0&&(i=Mf(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 wf(n,e,t){n.pendingLanes|=e,e!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,e=31-as(e),n[e]=t}function nN(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=Bf),KE=" ",YE=!1;function QE(n,e){switch(n){case"keyup":return PN.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function qE(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Su=!1;function BN(n,e){switch(n){case"compositionend":return qE(e);case"keypress":return e.which!==32?null:(YE=!0,KE);case"textInput":return n=e.data,n===KE&&YE?null:n;default:return null}}function LN(n,e){if(Su)return n==="compositionend"||!H0&&QE(n,e)?(n=GE(),yp=F0=Vo=null,Su=!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=r1(t)}}function o1(n,e){return n&&e?n===e?!0:n&&n.nodeType===3?!1:e&&e.nodeType===3?o1(n,e.parentNode):"contains"in n?n.contains(e):n.compareDocumentPosition?!!(n.compareDocumentPosition(e)&16):!1:!1}function a1(){for(var n=window,e=sp();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=sp(n.document)}return e}function W0(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 GN(n){var e=a1(),t=n.focusedElem,i=n.selectionRange;if(e!==t&&t&&t.ownerDocument&&o1(t.ownerDocument.documentElement,t)){if(i!==null&&W0(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=s1(t,s);var o=s1(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,Mu=null,X0=null,Nf=null,j0=!1;function l1(n,e,t){var i=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;j0||Mu==null||Mu!==sp(i)||(i=Mu,"selectionStart"in i&&W0(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}),Nf&&Ff(Nf,i)||(Nf=i,i=Cp(X0,"onSelect"),0bu||(n.current=rx[bu],rx[bu]=null,bu--)}function gn(n,e){bu++,rx[bu]=n.current,n.current=e}var Jo={},wi=jo(Jo),rr=jo(!1),Ya=Jo;function Ru(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 sr(n){return n=n.childContextTypes,n!=null}function Pp(){Sn(rr),Sn(wi)}function M1(n,e,t){if(wi.current!==Jo)throw Error(Re(168));gn(wi,e),gn(rr,t)}function w1(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,UF(n)||"Unknown",r));return Pn({},t,i)}function Ip(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||Jo,Ya=wi.current,gn(wi,n),gn(rr,rr.current),!0}function E1(n,e,t){var i=n.stateNode;if(!i)throw Error(Re(169));t?(n=w1(n,e,Ya),i.__reactInternalMemoizedMergedChildContext=n,Sn(rr),Sn(wi),gn(wi,n)):Sn(rr),gn(rr,t)}var ro=null,Bp=!1,sx=!1;function C1(n){ro===null?ro=[n]:ro.push(n)}function e3(n){Bp=!0,C1(n)}function Ko(){if(!sx&&ro!==null){sx=!0;var n=0,e=an;try{var t=ro;for(an=1;n>=o,r-=o,so=1<<32-as(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),x=s(T,x,N),P===null?I=T:P.sibling=T,P=T,D=B}if(N===A.length)return t(m,D),En&&qa(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),x=s(F,x,N),P===null?I=F:P.sibling=F,P=F,D=B}if(T.done)return t(m,D),En&&qa(m,N),I;if(D===null){for(;!T.done;N++,T=A.next())T=h(m,T.value,w),T!==null&&(x=s(T,x,N),P===null?I=T:P.sibling=T,P=T);return En&&qa(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),x=s(T,x,N),P===null?I=T:P.sibling=T,P=T);return n&&D.forEach(function(X){return e(m,X)}),En&&qa(m,N),I}function _(m,x,A,w){if(typeof A=="object"&&A!==null&&A.type===gu&&A.key===null&&(A=A.props.children),typeof A=="object"&&A!==null){switch(A.$$typeof){case ip:e:{for(var I=A.key,P=x;P!==null;){if(P.key===I){if(I=A.type,I===gu){if(P.tag===7){t(m,P.sibling),x=r(P,A.props.children),x.return=m,m=x;break e}}else if(P.elementType===I||typeof I=="object"&&I!==null&&I.$$typeof===Uo&&B1(I)===P.type){t(m,P.sibling),x=r(P,A.props),x.ref=Gf(m,P,A),x.return=m,m=x;break e}t(m,P);break}else e(m,P);P=P.sibling}A.type===gu?(x=sl(A.props.children,m.mode,w,A.key),x.return=m,m=x):(w=om(A.type,A.key,A.props,null,m.mode,w),w.ref=Gf(m,x,A),w.return=m,m=w)}return o(m);case mu:e:{for(P=A.key;x!==null;){if(x.key===P)if(x.tag===4&&x.stateNode.containerInfo===A.containerInfo&&x.stateNode.implementation===A.implementation){t(m,x.sibling),x=r(x,A.children||[]),x.return=m,m=x;break e}else{t(m,x);break}else e(m,x);x=x.sibling}x=n_(A,m.mode,w),x.return=m,m=x}return o(m);case Uo:return P=A._init,_(m,x,P(A._payload),w)}if(vf(A))return v(m,x,A,w);if(mf(A))return S(m,x,A,w);Np(m,A)}return typeof A=="string"&&A!==""||typeof A=="number"?(A=""+A,x!==null&&x.tag===6?(t(m,x.sibling),x=r(x,A),x.return=m,m=x):(t(m,x),x=t_(A,m.mode,w),x.return=m,m=x),o(m)):t(m,x)}return _}var Lu=L1(!0),D1=L1(!1),Up=jo(null),Op=null,Du=null,fx=null;function dx(){fx=Du=Op=null}function hx(n){var e=Up.current;Sn(Up),n._currentValue=e}function px(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 Fu(n,e){Op=n,fx=Du=null,n=n.dependencies,n!==null&&n.firstContext!==null&&(n.lanes&e&&(or=!0),n.firstContext=null)}function Gr(n){var e=n._currentValue;if(fx!==n)if(n={context:n,memoizedValue:e,next:null},Du===null){if(Op===null)throw Error(Re(308));Du=n,Op.dependencies={lanes:0,firstContext:n}}else Du=Du.next=n;return e}var Za=null;function mx(n){Za===null?Za=[n]:Za.push(n)}function F1(n,e,t,i){var r=e.interleaved;return r===null?(t.next=t,mx(e)):(t.next=r.next,r.next=t),e.interleaved=t,ao(n,i)}function ao(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 gx(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function N1(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 lo(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,qt&2){var r=i.pending;return r===null?e.next=e:(e.next=r.next,r.next=e),i.pending=e,ao(n,t)}return r=i.interleaved,r===null?(e.next=e,mx(i)):(e.next=r.next,r.next=e),i.interleaved=e,ao(n,t)}function kp(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,P0(n,t)}}function U1(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 zp(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);tl|=o,n.lanes=o,n.memoizedState=h}}function O1(n,e,t){if(n=e.effects,e.effects=null,n!==null)for(e=0;et?t:4,n(!0);var i=Ax.transition;Ax.transition={};try{n(!1),e()}finally{an=t,Ax.transition=i}}function iC(){return Vr().memoizedState}function r3(n,e,t){var i=ea(n);if(t={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null},rC(n))sC(e,t);else if(t=F1(n,e,t,i),t!==null){var r=Wi();hs(t,n,i,r),oC(t,e,i)}}function s3(n,e,t){var i=ea(n),r={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null};if(rC(n))sC(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,ls(a,o)){var l=e.interleaved;l===null?(r.next=r,mx(e)):(r.next=l.next,l.next=r),e.interleaved=r;return}}catch(u){}finally{}t=F1(n,e,r,i),t!==null&&(r=Wi(),hs(t,n,i,r),oC(t,e,i))}}function rC(n){var e=n.alternate;return n===Bn||e!==null&&e===Bn}function sC(n,e){jf=Vp=!0;var t=n.pending;t===null?e.next=e:(e.next=t.next,t.next=e),n.pending=e}function oC(n,e,t){if(t&4194240){var i=e.lanes;i&=n.pendingLanes,t|=i,e.lanes=t,P0(n,t)}}var jp={readContext:Gr,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},o3={readContext:Gr,useCallback:function(n,e){return Fs().memoizedState=[n,e===void 0?null:e],n},useContext:Gr,useEffect:Y1,useImperativeHandle:function(n,e,t){return t=t!=null?t.concat([n]):null,Wp(4194308,4,Z1.bind(null,e,n),t)},useLayoutEffect:function(n,e){return Wp(4194308,4,n,e)},useInsertionEffect:function(n,e){return Wp(4,2,n,e)},useMemo:function(n,e){var t=Fs();return e=e===void 0?null:e,n=n(),t.memoizedState=[n,e],n},useReducer:function(n,e,t){var i=Fs();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=r3.bind(null,Bn,n),[i.memoizedState,n]},useRef:function(n){var e=Fs();return n={current:n},e.memoizedState=n},useState:J1,useDebugValue:bx,useDeferredValue:function(n){return Fs().memoizedState=n},useTransition:function(){var n=J1(!1),e=n[0];return n=i3.bind(null,n[1]),Fs().memoizedState=n,[e,n]},useMutableSource:function(){},useSyncExternalStore:function(n,e,t){var i=Bn,r=Fs();if(En){if(t===void 0)throw Error(Re(407));t=t()}else{if(t=e(),pi===null)throw Error(Re(349));el&30||G1(i,e,t)}r.memoizedState=t;var s={value:t,getSnapshot:e};return r.queue=s,Y1(W1.bind(null,i,s,n),[n]),i.flags|=2048,Yf(9,V1.bind(null,i,s,t,e),void 0,null),t},useId:function(){var n=Fs(),e=pi.identifierPrefix;if(En){var t=oo,i=so;t=(i&~(1<<32-as(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[Ls]=e,n[zf]=i,CC(n,e,!1,!1),e.stateNode=n;e:{switch(o=_0(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;rzu&&(e.flags|=128,i=!0,Qf(s,!1),e.lanes=4194304)}else{if(!i)if(n=Hp(o),n!==null){if(e.flags|=128,i=!0,t=n.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),Qf(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!En)return Ci(e),null}else 2*jn()-s.renderingStartTime>zu&&t!==1073741824&&(e.flags|=128,i=!0,Qf(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=jn(),e.sibling=null,t=In.current,gn(In,i?t&1|2:t&1),e):(Ci(e),null);case 22:case 23:return Zx(),i=e.memoizedState!==null,n!==null&&n.memoizedState!==null!==i&&(e.flags|=8192),i&&e.mode&1?Cr&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 p3(n,e){switch(ax(e),e.tag){case 1:return sr(e.type)&&Pp(),n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 3:return Nu(),Sn(rr),Sn(wi),_x(),n=e.flags,n&65536&&!(n&128)?(e.flags=n&-65537|128,e):null;case 5:return yx(e),null;case 13:if(Sn(In),n=e.memoizedState,n!==null&&n.dehydrated!==null){if(e.alternate===null)throw Error(Re(340));Bu()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 19:return Sn(In),null;case 4:return Nu(),null;case 10:return hx(e.type._context),null;case 22:case 23:return Zx(),null;case 24:return null;default:return null}}var Qp=!1,Ti=!1,m3=typeof WeakSet=="function"?WeakSet:Set,tt=null;function Ou(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 zx(n,e,t){try{t()}catch(i){Un(n,e,i)}}var RC=!1;function g3(n,e){if(Z0=gp,n=a1(),W0(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($0={focusedElem:n,selectionRange:t},gp=!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,_=v.memoizedState,m=e.stateNode,x=m.getSnapshotBeforeUpdate(e.elementType===e.type?S:cs(e.type,S),_);m.__reactInternalSnapshotBeforeUpdate=x}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=RC,RC=!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&&zx(e,t,s)}r=r.next}while(r!==i)}}function qp(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 Hx(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 PC(n){var e=n.alternate;e!==null&&(n.alternate=null,PC(e)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(e=n.stateNode,e!==null&&(delete e[Ls],delete e[zf],delete e[ix],delete e[ZN],delete e[$N])),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 IC(n){return n.tag===5||n.tag===3||n.tag===4}function BC(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||IC(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 Gx(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=bp));else if(i!==4&&(n=n.child,n!==null))for(Gx(n,e,t),n=n.sibling;n!==null;)Gx(n,e,t),n=n.sibling}function Vx(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(Vx(n,e,t),n=n.sibling;n!==null;)Vx(n,e,t),n=n.sibling}var yi=null,fs=!1;function qo(n,e,t){for(t=t.child;t!==null;)LC(n,e,t),t=t.sibling}function LC(n,e,t){if(Bs&&typeof Bs.onCommitFiberUnmount=="function")try{Bs.onCommitFiberUnmount(cp,t)}catch(a){}switch(t.tag){case 5:Ti||Ou(t,e);case 6:var i=yi,r=fs;yi=null,qo(n,e,t),yi=i,fs=r,yi!==null&&(fs?(n=yi,t=t.stateNode,n.nodeType===8?n.parentNode.removeChild(t):n.removeChild(t)):yi.removeChild(t.stateNode));break;case 18:yi!==null&&(fs?(n=yi,t=t.stateNode,n.nodeType===8?nx(n.parentNode,t):n.nodeType===1&&nx(n,t),Rf(n)):nx(yi,t.stateNode));break;case 4:i=yi,r=fs,yi=t.stateNode.containerInfo,fs=!0,qo(n,e,t),yi=i,fs=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)&&zx(t,e,o),r=r.next}while(r!==i)}qo(n,e,t);break;case 1:if(!Ti&&(Ou(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 DC(n){var e=n.updateQueue;if(e!==null){n.updateQueue=null;var t=n.stateNode;t===null&&(t=n.stateNode=new m3),e.forEach(function(i){var r=E3.bind(null,n,i);t.has(i)||(t.add(i),i.then(r,r))})}}function ds(n,e){var t=e.deletions;if(t!==null)for(var i=0;ir&&(r=o),i&=~s}if(i=r,i=jn()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*y3(i/1960))-i,10n?16:n,$o===null)var i=!1;else{if(n=$o,$o=null,nm=0,qt&6)throw Error(Re(331));var r=qt;for(qt|=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;ljn()-jx?il(n,0):Xx|=t),lr(n,e)}function JC(n,e){e===0&&(n.mode&1?(e=dp,dp<<=1,!(dp&130023424)&&(dp=4194304)):e=1);var t=Wi();n=ao(n,e),n!==null&&(wf(n,e,t),lr(n,t))}function w3(n){var e=n.memoizedState,t=0;e!==null&&(t=e.retryLane),JC(n,t)}function E3(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),JC(n,t)}var KC;KC=function(n,e,t){if(n!==null)if(n.memoizedProps!==e.pendingProps||rr.current)or=!0;else{if(!(n.lanes&t)&&!(e.flags&128))return or=!1,d3(n,e,t);or=!!(n.flags&131072)}else or=!1,En&&e.flags&1048576&&T1(e,Dp,e.index);switch(e.lanes=0,e.tag){case 2:var i=e.type;Yp(n,e),n=e.pendingProps;var r=Ru(e,wi.current);Fu(e,t),r=Mx(null,e,i,n,r,t);var s=wx();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,sr(i)?(s=!0,Ip(e)):s=!1,e.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,gx(e),r.updater=Jp,e.stateNode=r,r._reactInternals=e,Px(e,i,n,t),e=Dx(null,e,i,!0,s,t)):(e.tag=0,En&&s&&ox(e),Vi(null,e,r,t),e=e.child),e;case 16:i=e.elementType;e:{switch(Yp(n,e),n=e.pendingProps,r=i._init,i=r(i._payload),e.type=i,r=e.tag=T3(i),n=cs(i,n),r){case 0:e=Lx(null,e,i,n,t);break e;case 1:e=_C(null,e,i,n,t);break e;case 11:e=mC(null,e,i,n,t);break e;case 14:e=gC(null,e,i,cs(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:cs(i,r),Lx(n,e,i,r,t);case 1:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:cs(i,r),_C(n,e,i,r,t);case 3:e:{if(AC(e),n===null)throw Error(Re(387));i=e.pendingProps,s=e.memoizedState,r=s.element,N1(n,e),zp(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=Uu(Error(Re(423)),e),e=SC(n,e,i,t,r);break e}else if(i!==r){r=Uu(Error(Re(424)),e),e=SC(n,e,i,t,r);break e}else for(Er=Xo(e.stateNode.containerInfo.firstChild),wr=e,En=!0,us=null,t=D1(e,null,i,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(Bu(),i===r){e=uo(n,e,t);break e}Vi(n,e,i,t)}e=e.child}return e;case 5:return k1(e),n===null&&ux(e),i=e.type,r=e.pendingProps,s=n!==null?n.memoizedProps:null,o=r.children,ex(i,r)?o=null:s!==null&&ex(i,s)&&(e.flags|=32),xC(n,e),Vi(n,e,o,t),e.child;case 6:return n===null&&ux(e),null;case 13:return MC(n,e,t);case 4:return vx(e,e.stateNode.containerInfo),i=e.pendingProps,n===null?e.child=Lu(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:cs(i,r),mC(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(Up,i._currentValue),i._currentValue=o,s!==null)if(ls(s.value,o)){if(s.children===r.children&&!rr.current){e=uo(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=lo(-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),px(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),px(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,Fu(e,t),r=Gr(r),i=i(r),e.flags|=1,Vi(n,e,i,t),e.child;case 14:return i=e.type,r=cs(i,e.pendingProps),r=cs(i.type,r),gC(n,e,i,r,t);case 15:return vC(n,e,e.type,e.pendingProps,t);case 17:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:cs(i,r),Yp(n,e),e.tag=1,sr(i)?(n=!0,Ip(e)):n=!1,Fu(e,t),lC(e,i,r),Px(e,i,r,t),Dx(null,e,i,!0,n,t);case 19:return EC(n,e,t);case 22:return yC(n,e,t)}throw Error(Re(156,e.tag))};function YC(n,e){return bE(n,e)}function C3(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 Xr(n,e,t,i){return new C3(n,e,t,i)}function e_(n){return n=n.prototype,!(!n||!n.isReactComponent)}function T3(n){if(typeof n=="function")return e_(n)?1:0;if(n!=null){if(n=n.$$typeof,n===o0)return 11;if(n===u0)return 14}return 2}function na(n,e){var t=n.alternate;return t===null?(t=Xr(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 om(n,e,t,i,r,s){var o=2;if(i=n,typeof n=="function")e_(n)&&(o=1);else if(typeof n=="string")o=5;else e:switch(n){case gu:return sl(t.children,r,s,e);case r0:o=8,r|=8;break;case s0:return n=Xr(12,t,e,r|2),n.elementType=s0,n.lanes=s,n;case a0:return n=Xr(13,t,e,r),n.elementType=a0,n.lanes=s,n;case l0:return n=Xr(19,t,e,r),n.elementType=l0,n.lanes=s,n;case rE:return am(t,r,s,e);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case nE:o=10;break e;case iE:o=9;break e;case o0:o=11;break e;case u0:o=14;break e;case Uo:o=16,i=null;break e}throw Error(Re(130,n==null?n:typeof n,""))}return e=Xr(o,t,e,r),e.elementType=n,e.type=i,e.lanes=s,e}function sl(n,e,t,i){return n=Xr(7,n,i,e),n.lanes=t,n}function am(n,e,t,i){return n=Xr(22,n,i,e),n.elementType=rE,n.lanes=t,n.stateNode={isHidden:!1},n}function t_(n,e,t){return n=Xr(6,n,null,e),n.lanes=t,n}function n_(n,e,t){return e=Xr(4,n.children!==null?n.children:[],n.key,e),e.lanes=t,e.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},e}function b3(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=R0(0),this.expirationTimes=R0(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=R0(0),this.identifierPrefix=i,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function i_(n,e,t,i,r,s,o,a,l){return n=new b3(n,e,t,a,l),e===1?(e=1,s===!0&&(e|=8)):e=0,s=Xr(3,null,null,e),n.current=s,s.stateNode=n,s.memoizedState={element:i,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},gx(s),n}function R3(n,e,t){var i=3n,isStatic:!1,reducedMotion:"never"});function D3(n=!0){const e=me.useContext(a_);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:i,register:r}=e,s=me.useId();me.useEffect(()=>{n&&r(s)},[n]);const o=me.useCallback(()=>n&&i&&i(s),[s,i,n]);return!t&&i?[!1,o]:[!0]}const l_=typeof window!="undefined",gm=l_?me.useLayoutEffect:me.useEffect,Xi=n=>n;let F3=Xi,u_=Xi;function c_(n){let e;return()=>(e===void 0&&(e=n()),e)}const ol=(n,e,t)=>{const i=e-n;return i===0?1:(t-n)/i},fo=n=>n*1e3,ho=n=>n/1e3,N3={skipAnimations:!1,useManualTiming:!1};function U3(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],e.forEach(a),e.clear(),i=!1,r&&(r=!1,l.process(u))}};return l}const vm=["read","resolveKeyframes","update","preRender","render","postRender"],O3=40;function rT(n,e){let t=!1,i=!0;const r={delta:0,timestamp:0,isProcessing:!1},s=()=>t=!0,o=vm.reduce((m,x)=>(m[x]=U3(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,O3),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:vm.reduce((m,x)=>{const A=o[x];return m[x]=(w,I=!1,P=!1)=>(t||v(),A.schedule(w,I,P)),m},{}),cancel:m=>{for(let x=0;xoT[n].some(t=>!!e[t])};function k3(n){for(const e in n)Gu[e]=ge(ge({},Gu[e]),n[e])}const z3=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 ym(n){return n.startsWith("while")||n.startsWith("drag")&&n!=="draggable"||n.startsWith("layout")||n.startsWith("onTap")||n.startsWith("onPan")||n.startsWith("onLayout")||z3.has(n)}let aT=n=>!ym(n);function H3(n){n&&(aT=e=>e.startsWith("on")?!ym(e):n(e))}try{H3(require("@emotion/is-prop-valid").default)}catch(n){}function lT(n,e,t){const i={};for(const r in n)r==="values"&&typeof n.values=="object"||(aT(r)||t===!0&&ym(r)||!e&&!ym(r)||n.draggable&&r.startsWith("onDrag"))&&(i[r]=n[r]);return i}function G3(n){if(typeof Proxy=="undefined")return n;const e=new Map,t=(...i)=>n(...i);return new Proxy(t,{get:(i,r)=>r==="create"?n:(e.has(r)||e.set(r,n(r)),e.get(r))})}const xm=me.createContext({});function nd(n){return typeof n=="string"||Array.isArray(n)}function _m(n){return n!==null&&typeof n=="object"&&typeof n.start=="function"}const d_=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],h_=["initial",...d_];function Am(n){return _m(n.animate)||h_.some(e=>nd(n[e]))}function uT(n){return!!(Am(n)||n.variants)}function V3(n,e){if(Am(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 W3(n){const{initial:e,animate:t}=V3(n,me.useContext(xm));return me.useMemo(()=>({initial:e,animate:t}),[cT(e),cT(t)])}function cT(n){return Array.isArray(n)?n.join(" "):n}const X3=Symbol.for("motionComponentSymbol");function Vu(n){return n&&typeof n=="object"&&Object.prototype.hasOwnProperty.call(n,"current")}function j3(n,e,t){return me.useCallback(i=>{i&&n.onMount&&n.onMount(i),e&&(i?e.mount(i):e.unmount()),t&&(typeof t=="function"?t(i):Vu(t)&&(t.current=i))},[e])}const p_=n=>n.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),fT="data-"+p_("framerAppearId"),{schedule:m_,cancel:Lj}=rT(queueMicrotask,!1),dT=me.createContext({});function J3(n,e,t,i,r){var s,o;const{visualElement:a}=me.useContext(xm),l=me.useContext(sT),u=me.useContext(a_),d=me.useContext(mm).reducedMotion,h=me.useRef(null);i=i||l.renderer,!h.current&&i&&(h.current=i(n,{visualState:e,parent:a,props:t,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:d}));const p=h.current,g=me.useContext(dT);p&&!p.projection&&r&&(p.type==="html"||p.type==="svg")&&K3(h.current,t,r,g);const v=me.useRef(!1);me.useInsertionEffect(()=>{p&&v.current&&p.update(t,u)});const S=t[fT],_=me.useRef(!!S&&!(!((s=window.MotionHandoffIsComplete)===null||s===void 0)&&s.call(window,S))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,S)));return gm(()=>{p&&(v.current=!0,window.MotionIsMounted=!0,p.updateFeatures(),m_.render(p.render),_.current&&p.animationState&&p.animationState.animateChanges())}),me.useEffect(()=>{p&&(!_.current&&p.animationState&&p.animationState.animateChanges(),_.current&&(queueMicrotask(()=>{var m;(m=window.MotionHandoffMarkAsComplete)===null||m===void 0||m.call(window,S)}),_.current=!1))}),p}function K3(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:hT(n.parent)),n.projection.setOptions({layoutId:r,layout:s,alwaysMeasureLayout:!!o||a&&Vu(a),visualElement:n,animationType:typeof s=="string"?s:"both",initialPromotionConfig:i,layoutScroll:l,layoutRoot:u})}function hT(n){if(n)return n.options.allowProjection!==!1?n.projection:hT(n.parent)}function pT({preloadedFeatures:n,createVisualElement:e,useRender:t,useVisualState:i,Component:r}){var s,o;n&&k3(n);function a(u,d){let h;const p=yt(ge(ge({},me.useContext(mm)),u),{layoutId:Y3(u)}),{isStatic:g}=p,v=W3(u),S=i(u,g);if(!g&&l_){Q3();const _=q3(p);h=_.MeasureLayout,v.visualElement=J3(r,S,p,e,_.ProjectionNode)}return ve.jsxs(xm.Provider,{value:v,children:[h&&v.visualElement?ve.jsx(h,ge({visualElement:v.visualElement},p)):null,t(r,u,j3(S,v.visualElement,d),S,g,v.visualElement)]})}a.displayName=`motion.${typeof r=="string"?r:`create(${(o=(s=r.displayName)!==null&&s!==void 0?s:r.name)!==null&&o!==void 0?o:""})`}`;const l=me.forwardRef(a);return l[X3]=r,l}function Y3({layoutId:n}){const e=me.useContext(iT).id;return e&&n!==void 0?e+"-"+n:n}function Q3(n,e){me.useContext(sT).strict}function q3(n){const{drag:e,layout:t}=Gu;if(!e&&!t)return{};const i=ge(ge({},e),t);return{MeasureLayout:e!=null&&e.isEnabled(n)||t!=null&&t.isEnabled(n)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}const Z3=["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 g_(n){return typeof n!="string"||n.includes("-")?!1:!!(Z3.indexOf(n)>-1||/[A-Z]/u.test(n))}function mT(n){const e=[{},{}];return n==null||n.values.forEach((t,i)=>{e[0][i]=t.get(),e[1][i]=t.getVelocity()}),e}function v_(n,e,t,i){if(typeof e=="function"){const[r,s]=mT(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]=mT(i);e=e(t!==void 0?t:n.custom,r,s)}return e}const y_=n=>Array.isArray(n),$3=n=>!!(n&&typeof n=="object"&&n.mix&&n.toValue),eU=n=>y_(n)?n[n.length-1]||0:n,Cn=n=>!!(n&&n.getVelocity);function id(n){const e=Cn(n)?n.get():n;return $3(e)?e.toValue():e}function tU({scrapeMotionValuesFromProps:n,createRenderState:e,onUpdate:t},i,r,s){const o={latestValues:nU(i,r,s,n),renderState:e()};return t&&(o.onMount=a=>t(ge({props:i,current:a},o)),o.onUpdate=a=>t(a)),o}const x_=n=>(e,t)=>{const i=me.useContext(xm),r=me.useContext(a_),s=()=>tU(n,e,i,r);return t?s():pm(s)};function nU(n,e,t,i){const r={},s=i(n,{});for(const g in s)r[g]=id(s[g]);let{initial:o,animate:a}=n;const l=Am(n),u=uT(n);e&&u&&!l&&n.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let d=t?t.initial===!1:!1;d=d||o===!1;const h=d?a:o;if(h&&typeof h!="boolean"&&!_m(h)){const g=Array.isArray(h)?h:[h];for(let v=0;ve=>typeof e=="string"&&e.startsWith(n),vT=gT("--"),iU=gT("var(--"),__=n=>iU(n)?rU.test(n.split("/*")[0].trim()):!1,rU=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,yT=(n,e)=>e&&typeof n=="number"?e.transform(n):n,Us=(n,e,t)=>t>e?e:ttypeof n=="number",parse:parseFloat,transform:n=>n},rd=yt(ge({},Xu),{transform:n=>Us(0,1,n)}),Sm=yt(ge({},Xu),{default:1}),sd=n=>({test:e=>typeof e=="string"&&e.endsWith(n)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${n}`}),ia=sd("deg"),Os=sd("%"),Mt=sd("px"),sU=sd("vh"),oU=sd("vw"),xT=yt(ge({},Os),{parse:n=>Os.parse(n)/100,transform:n=>Os.transform(n*100)}),aU={borderWidth:Mt,borderTopWidth:Mt,borderRightWidth:Mt,borderBottomWidth:Mt,borderLeftWidth:Mt,borderRadius:Mt,radius:Mt,borderTopLeftRadius:Mt,borderTopRightRadius:Mt,borderBottomRightRadius:Mt,borderBottomLeftRadius:Mt,width:Mt,maxWidth:Mt,height:Mt,maxHeight:Mt,top:Mt,right:Mt,bottom:Mt,left:Mt,padding:Mt,paddingTop:Mt,paddingRight:Mt,paddingBottom:Mt,paddingLeft:Mt,margin:Mt,marginTop:Mt,marginRight:Mt,marginBottom:Mt,marginLeft:Mt,backgroundPositionX:Mt,backgroundPositionY:Mt},lU={rotate:ia,rotateX:ia,rotateY:ia,rotateZ:ia,scale:Sm,scaleX:Sm,scaleY:Sm,scaleZ:Sm,skew:ia,skewX:ia,skewY:ia,distance:Mt,translateX:Mt,translateY:Mt,translateZ:Mt,x:Mt,y:Mt,z:Mt,perspective:Mt,transformPerspective:Mt,opacity:rd,originX:xT,originY:xT,originZ:Mt},_T=yt(ge({},Xu),{transform:Math.round}),A_=yt(ge(ge({},aU),lU),{zIndex:_T,size:Mt,fillOpacity:rd,strokeOpacity:rd,numOctaves:_T}),uU={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},cU=Wu.length;function fU(n,e,t){let i="",r=!0;for(let s=0;s({style:{},transform:{},transformOrigin:{},vars:{}}),ST=()=>yt(ge({},w_()),{attrs:{}}),E_=n=>typeof n=="string"&&n.toLowerCase()==="svg";function MT(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 wT=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 ET(n,e,t,i){MT(n,e,void 0,i);for(const r in e.attrs)n.setAttribute(wT.has(r)?r:p_(r),e.attrs[r])}const Mm={};function gU(n){Object.assign(Mm,n)}function CT(n,{layout:e,layoutId:t}){return al.has(n)||n.startsWith("origin")||(e||t!==void 0)&&(!!Mm[n]||n==="opacity")}function C_(n,e,t){var i;const{style:r}=n,s={};for(const o in r)(Cn(r[o])||e.style&&Cn(e.style[o])||CT(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 s}function TT(n,e,t){const i=C_(n,e,t);for(const r in n)if(Cn(n[r])||Cn(e[r])){const s=Wu.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;i[s]=n[r]}return i}function vU(n,e){try{e.dimensions=typeof n.getBBox=="function"?n.getBBox():n.getBoundingClientRect()}catch(t){e.dimensions={x:0,y:0,width:0,height:0}}}const bT=["x","y","width","height","cx","cy","r"],yU={useVisualState:x_({scrapeMotionValuesFromProps:TT,createRenderState:ST,onUpdate:({props:n,prevProps:e,current:t,renderState:i,latestValues:r})=>{if(!t)return;let s=!!n.drag;if(!s){for(const a in r)if(al.has(a)){s=!0;break}}if(!s)return;let o=!e;if(e)for(let a=0;a{vU(t,i),en.render(()=>{M_(i,r,E_(t.tagName),n.transformTemplate),ET(t,i)})})}})},xU={useVisualState:x_({scrapeMotionValuesFromProps:C_,createRenderState:w_})};function RT(n,e,t){for(const i in e)!Cn(e[i])&&!CT(i,t)&&(n[i]=e[i])}function _U({transformTemplate:n},e){return me.useMemo(()=>{const t=w_();return S_(t,e,n),Object.assign({},t.vars,t.style)},[e])}function AU(n,e){const t=n.style||{},i={};return RT(i,t,n),Object.assign(i,_U(n,e)),i}function SU(n,e){const t={},i=AU(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}function MU(n,e,t,i){const r=me.useMemo(()=>{const s=ST();return M_(s,e,E_(i),n.transformTemplate),yt(ge({},s.attrs),{style:ge({},s.style)})},[e]);if(n.style){const s={};RT(s,n.style,n),r.style=ge(ge({},s),r.style)}return r}function wU(n=!1){return(t,i,r,{latestValues:s},o)=>{const l=(g_(t)?MU:SU)(i,s,o,t),u=lT(i,typeof t=="string",n),d=t!==me.Fragment?yt(ge(ge({},u),l),{ref:r}):{},{children:h}=i,p=me.useMemo(()=>Cn(h)?h.get():h,[h]);return me.createElement(t,yt(ge({},d),{children:p}))}}function EU(n,e){return function(i,{forwardMotionProps:r}={forwardMotionProps:!1}){const s=g_(i)?yU:xU,o=yt(ge({},s),{preloadedFeatures:n,useRender:wU(r),createVisualElement:e,Component:i});return pT(o)}}function PT(n,e){if(!Array.isArray(e))return!1;const t=e.length;if(t!==n.length)return!1;for(let i=0;iwindow.ScrollTimeline!==void 0);class CU{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>"finished"in e?e.finished:e))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let i=0;i{if(IT()&&r.attachTimeline)return r.attachTimeline(e);if(typeof t=="function")return t(r)});return()=>{i.forEach((r,s)=>{r&&r(),this.animations[s].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]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class TU extends CU{then(e,t){return Promise.all(this.animations).then(e).catch(t)}}function T_(n,e){return n?n[e]||n.default||n:void 0}const b_=2e4;function BT(n){let e=0;const t=50;let i=n.next(e);for(;!i.done&&e=b_?1/0:e}function R_(n){return typeof n=="function"}function LT(n,e){n.timeline=e,n.onfinish=null}const P_=n=>Array.isArray(n)&&typeof n[0]=="number",bU={linearEasing:void 0};function RU(n,e){const t=c_(n);return()=>{var i;return(i=bU[e])!==null&&i!==void 0?i:t()}}const Em=RU(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(n){return!1}return!0},"linearEasing"),DT=(n,e,t=10)=>{let i="";const r=Math.max(Math.round(e/t),2);for(let s=0;s`cubic-bezier(${n}, ${e}, ${t}, ${i})`,I_={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:od([0,.65,.55,1]),circOut:od([.55,0,1,.45]),backIn:od([.31,.01,.66,-.59]),backOut:od([.33,1.53,.69,.99])};function NT(n,e){if(n)return typeof n=="function"&&Em()?DT(n,e):P_(n)?od(n):Array.isArray(n)?n.map(t=>NT(t,e)||I_.easeOut):I_[n]}const ms={x:!1,y:!1};function B_(){return ms.x||ms.y}function UT(n,e,t){var i;if(n instanceof Element)return[n];if(typeof n=="string"){let r=document;const s=(i=void 0)!==null&&i!==void 0?i:r.querySelectorAll(n);return s?Array.from(s):[]}return Array.from(n)}function OT(n,e){const t=UT(n),i=new AbortController,r=yt(ge({passive:!0},e),{signal:i.signal});return[t,r,()=>i.abort()]}function kT(n){return e=>{e.pointerType==="touch"||B_()||n(e)}}function PU(n,e,t={}){const[i,r,s]=OT(n,t),o=kT(a=>{const{target:l}=a,u=e(a);if(typeof u!="function"||!l)return;const d=kT(h=>{u(h),l.removeEventListener("pointerleave",d)});l.addEventListener("pointerleave",d,r)});return i.forEach(a=>{a.addEventListener("pointerenter",o,r)}),s}const zT=(n,e)=>e?n===e?!0:zT(n,e.parentElement):!1,L_=n=>n.pointerType==="mouse"?typeof n.button!="number"||n.button<=0:n.isPrimary!==!1,IU=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function BU(n){return IU.has(n.tagName)||n.tabIndex!==-1}const ad=new WeakSet;function HT(n){return e=>{e.key==="Enter"&&n(e)}}function D_(n,e){n.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const LU=(n,e)=>{const t=n.currentTarget;if(!t)return;const i=HT(()=>{if(ad.has(t))return;D_(t,"down");const r=HT(()=>{D_(t,"up")}),s=()=>D_(t,"cancel");t.addEventListener("keyup",r,e),t.addEventListener("blur",s,e)});t.addEventListener("keydown",i,e),t.addEventListener("blur",()=>t.removeEventListener("keydown",i),e)};function GT(n){return L_(n)&&!B_()}function DU(n,e,t={}){const[i,r,s]=OT(n,t),o=a=>{const l=a.currentTarget;if(!GT(a)||ad.has(l))return;ad.add(l);const u=e(a),d=(g,v)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",p),!(!GT(g)||!ad.has(l))&&(ad.delete(l),typeof u=="function"&&u(g,{success:v}))},h=g=>{d(g,t.useGlobalTarget||zT(l,g.target))},p=g=>{d(g,!1)};window.addEventListener("pointerup",h,r),window.addEventListener("pointercancel",p,r)};return i.forEach(a=>{!BU(a)&&a.getAttribute("tabindex")===null&&(a.tabIndex=0),(t.useGlobalTarget?window:a).addEventListener("pointerdown",o,r),a.addEventListener("focus",u=>LU(u,r),r)}),s}function FU(n){return n==="x"||n==="y"?ms[n]?null:(ms[n]=!0,()=>{ms[n]=!1}):ms.x||ms.y?null:(ms.x=ms.y=!0,()=>{ms.x=ms.y=!1})}const VT=new Set(["width","height","top","left","right","bottom",...Wu]);let Cm;function NU(){Cm=void 0}const ks={now:()=>(Cm===void 0&&ks.set(si.isProcessing||N3.useManualTiming?si.timestamp:performance.now()),Cm),set:n=>{Cm=n,queueMicrotask(NU)}};function F_(n,e){n.indexOf(e)===-1&&n.push(e)}function N_(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}class U_{constructor(){this.subscriptions=[]}add(e){return F_(this.subscriptions,e),()=>N_(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)),ld={current:void 0};class OU{constructor(e,t={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(i,r=!0)=>{const s=ks.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=ks.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=UU(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 U_);const i=this.events[e].add(t);return e==="change"?()=>{i(),en.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 ld.current&&ld.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=ks.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>WT)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,WT);return O_(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 zs(n,e){return new OU(n,e)}function kU(n,e,t){n.hasValue(e)?n.getValue(e).set(t):n.addValue(e,zs(t))}function zU(n,e){let o=wm(n,e)||{},{transitionEnd:i={},transition:r={}}=o,s=Xn(o,["transitionEnd","transition"]);s=ge(ge({},s),i);for(const a in s){const l=eU(s[a]);kU(n,a,l)}}function HU(n){return!!(Cn(n)&&n.add)}function k_(n,e){const t=n.getValue("willChange");if(HU(t))return t.add(e)}function XT(n){return n.props[fT]}const jT=(n,e,t)=>(((1-3*t+3*e)*n+(3*t-6*e))*n+3*e)*n,GU=1e-7,VU=12;function WU(n,e,t,i,r){let s,o,a=0;do o=e+(t-e)/2,s=jT(o,i,r)-n,s>0?t=o:e=o;while(Math.abs(s)>GU&&++aWU(s,0,1,n,t);return s=>s===0||s===1?s:jT(r(s),e,i)}const JT=n=>e=>e<=.5?n(2*e)/2:(2-n(2*(1-e)))/2,KT=n=>e=>1-n(1-e),YT=ud(.33,1.53,.69,.99),z_=KT(YT),QT=JT(z_),qT=n=>(n*=2)<1?.5*z_(n):.5*(2-Math.pow(2,-10*(n-1))),H_=n=>1-Math.sin(Math.acos(n)),ZT=KT(H_),$T=JT(H_),eb=n=>/^0[^.\s]+$/u.test(n);function XU(n){return typeof n=="number"?n===0:n!==null?n==="none"||n==="0"||eb(n):!0}const cd=n=>Math.round(n*1e5)/1e5,G_=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function jU(n){return n==null}const JU=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,V_=(n,e)=>t=>!!(typeof t=="string"&&JU.test(t)&&t.startsWith(n)||e&&!jU(t)&&Object.prototype.hasOwnProperty.call(t,e)),tb=(n,e,t)=>i=>{if(typeof i!="string")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}},KU=n=>Us(0,255,n),W_=yt(ge({},Xu),{transform:n=>Math.round(KU(n))}),ll={test:V_("rgb","red"),parse:tb("red","green","blue"),transform:({red:n,green:e,blue:t,alpha:i=1})=>"rgba("+W_.transform(n)+", "+W_.transform(e)+", "+W_.transform(t)+", "+cd(rd.transform(i))+")"};function YU(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 X_={test:V_("#"),parse:YU,transform:ll.transform},ju={test:V_("hsl","hue"),parse:tb("hue","saturation","lightness"),transform:({hue:n,saturation:e,lightness:t,alpha:i=1})=>"hsla("+Math.round(n)+", "+Os.transform(cd(e))+", "+Os.transform(cd(t))+", "+cd(rd.transform(i))+")"},bi={test:n=>ll.test(n)||X_.test(n)||ju.test(n),parse:n=>ll.test(n)?ll.parse(n):ju.test(n)?ju.parse(n):X_.parse(n),transform:n=>typeof n=="string"?n:n.hasOwnProperty("red")?ll.transform(n):ju.transform(n)},QU=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function qU(n){var e,t;return isNaN(n)&&typeof n=="string"&&(((e=n.match(G_))===null||e===void 0?void 0:e.length)||0)+(((t=n.match(QU))===null||t===void 0?void 0:t.length)||0)>0}const nb="number",ib="color",ZU="var",$U="var(",rb="${}",eO=/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 fd(n){const e=n.toString(),t=[],i={color:[],number:[],var:[]},r=[];let s=0;const a=e.replace(eO,l=>(bi.test(l)?(i.color.push(s),r.push(ib),t.push(bi.parse(l))):l.startsWith($U)?(i.var.push(s),r.push(ZU),t.push(l)):(i.number.push(s),r.push(nb),t.push(parseFloat(l))),++s,rb)).split(rb);return{values:t,split:a,indexes:i,types:r}}function sb(n){return fd(n).values}function ob(n){const{split:e,types:t}=fd(n),i=e.length;return r=>{let s="";for(let o=0;otypeof n=="number"?0:n;function nO(n){const e=sb(n);return ob(n)(e.map(tO))}const ra={test:qU,parse:sb,createTransformer:ob,getAnimatableNone:nO},iO=new Set(["brightness","contrast","saturate","opacity"]);function rO(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=iO.has(e)?1:0;return i!==t&&(s*=100),e+"("+s+r+")"}const sO=/\b([a-z-]*)\(.*?\)/gu,j_=yt(ge({},ra),{getAnimatableNone:n=>{const e=n.match(sO);return e?e.map(rO).join(" "):n}}),oO=yt(ge({},A_),{color:bi,backgroundColor:bi,outlineColor:bi,fill:bi,stroke:bi,borderColor:bi,borderTopColor:bi,borderRightColor:bi,borderBottomColor:bi,borderLeftColor:bi,filter:j_,WebkitFilter:j_}),J_=n=>oO[n];function ab(n,e){let t=J_(n);return t!==j_&&(t=ra),t.getAnimatableNone?t.getAnimatableNone(e):void 0}const aO=new Set(["auto","none","0"]);function lO(n,e,t){let i=0,r;for(;in===Xu||n===Mt,ub=(n,e)=>parseFloat(n.split(", ")[e]),cb=(n,e)=>(t,{transform:i})=>{if(i==="none"||!i)return 0;const r=i.match(/^matrix3d\((.+)\)$/u);if(r)return ub(r[1],e);{const s=i.match(/^matrix\((.+)\)$/u);return s?ub(s[1],n):0}},uO=new Set(["x","y","z"]),cO=Wu.filter(n=>!uO.has(n));function fO(n){const e=[];return cO.forEach(t=>{const i=n.getValue(t);i!==void 0&&(e.push([t,i.get()]),i.set(t.startsWith("scale")?1:0))}),e}const Ju={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:cb(4,13),y:cb(5,14)};Ju.translateX=Ju.x,Ju.translateY=Ju.y;const ul=new Set;let K_=!1,Y_=!1;function fb(){if(Y_){const n=Array.from(ul).filter(i=>i.needsMeasurement),e=new Set(n.map(i=>i.element)),t=new Map;e.forEach(i=>{const r=fO(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,K_=!1,ul.forEach(n=>n.complete()),ul.clear()}function db(){ul.forEach(n=>{n.readKeyframes(),n.needsMeasurement&&(Y_=!0)})}function dO(){db(),fb()}class Q_{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?(ul.add(this),K_||(K_=!0,en.read(db),en.resolveKeyframes(fb))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:i,motionValue:r}=this;for(let s=0;s/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(n),hO=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function pO(n){const e=hO.exec(n);if(!e)return[,];const[,t,i,r]=e;return[`--${t!=null?t:i}`,r]}function pb(n,e,t=1){const[i,r]=pO(n);if(!i)return;const s=window.getComputedStyle(e).getPropertyValue(i);if(s){const o=s.trim();return hb(o)?parseFloat(o):o}return __(r)?pb(r,e,t+1):r}const mb=n=>e=>e.test(n),gb=[Xu,Mt,Os,ia,oU,sU,{test:n=>n==="auto",parse:n=>n}],vb=n=>gb.find(mb(n));class yb extends Q_{constructor(e,t,i,r,s){super(e,t,i,r,s,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:t,name:i}=this;if(!t||!t.current)return;super.readKeyframes();for(let l=0;l{t.getValue(l).set(u)}),this.resolveNoneKeyframes()}}const xb=(n,e)=>e==="zIndex"?!1:!!(typeof n=="number"||Array.isArray(n)||typeof n=="string"&&(ra.test(n)||n==="0")&&!n.startsWith("url("));function mO(n){const e=n[0];if(n.length===1)return!0;for(let t=0;tn!==null;function Tm(n,{repeat:e,repeatType:t="loop"},i){const r=n.filter(vO),s=e&&t!=="loop"&&e%2===1?0:r.length-1;return!s||i===void 0?r[s]:i}const yO=40;class _b{constructor(l){var u=l,{autoplay:e=!0,delay:t=0,type:i="keyframes",repeat:r=0,repeatDelay:s=0,repeatType:o="loop"}=u,a=Xn(u,["autoplay","delay","type","repeat","repeatDelay","repeatType"]);this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=ks.now(),this.options=ge({autoplay:e,delay:t,type:i,repeat:r,repeatDelay:s,repeatType:o},a),this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>yO?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&dO(),this._resolved}onKeyframesResolved(e,t){this.resolvedAt=ks.now(),this.hasAttemptedResolve=!0;const{name:i,type:r,velocity:s,delay:o,onComplete:a,onUpdate:l,isGenerator:u}=this.options;if(!u&&!gO(e,i,r,s))if(o)this.options.duration=0;else{l&&l(Tm(e,this.options,t)),a&&a(),this.resolveFinishedPromise();return}const d=this.initPlayback(e,t);d!==!1&&(this._resolved=ge({keyframes:e,finalKeyframe:t},d),this.onPostResolved())}onPostResolved(){}then(e,t){return this.currentFinishedPromise.then(e,t)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}const Ln=(n,e,t)=>n+(e-n)*t;function q_(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 xO({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=q_(l,a,n+1/3),s=q_(l,a,n),o=q_(l,a,n-1/3)}return{red:Math.round(r*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:i}}function bm(n,e){return t=>t>0?e:n}const Z_=(n,e,t)=>{const i=n*n,r=t*(e*e-i)+i;return r<0?0:Math.sqrt(r)},_O=[X_,ll,ju],AO=n=>_O.find(e=>e.test(n));function Ab(n){const e=AO(n);if(!e)return!1;let t=e.parse(n);return e===ju&&(t=xO(t)),t}const Sb=(n,e)=>{const t=Ab(n),i=Ab(e);if(!t||!i)return bm(n,e);const r=ge({},t);return s=>(r.red=Z_(t.red,i.red,s),r.green=Z_(t.green,i.green,s),r.blue=Z_(t.blue,i.blue,s),r.alpha=Ln(t.alpha,i.alpha,s),ll.transform(r))},SO=(n,e)=>t=>e(n(t)),Ku=(...n)=>n.reduce(SO),$_=new Set(["none","hidden"]);function MO(n,e){return $_.has(n)?t=>t<=0?n:e:t=>t>=1?e:n}function wO(n,e){return t=>Ln(n,e,t)}function eA(n){return typeof n=="number"?wO:typeof n=="string"?__(n)?bm:bi.test(n)?Sb:TO:Array.isArray(n)?Mb:typeof n=="object"?bi.test(n)?Sb:EO:bm}function Mb(n,e){const t=[...n],i=t.length,r=n.map((s,o)=>eA(s)(s,e[o]));return s=>{for(let o=0;o{for(const s in i)t[s]=i[s](r);return t}}function CO(n,e){var t;const i=[],r={color:0,var:0,number:0};for(let s=0;s{const t=ra.createTransformer(e),i=fd(n),r=fd(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?$_.has(n)&&!r.values.length||$_.has(e)&&!i.values.length?MO(n,e):Ku(Mb(CO(i,r),r.values),t):bm(n,e)};function wb(n,e,t){return typeof n=="number"&&typeof e=="number"&&typeof t=="number"?Ln(n,e,t):eA(n)(n,e)}const bO=5;function Eb(n,e,t){const i=Math.max(e-bO,0);return O_(t-n(i),e-i)}const On={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Cb=.001;function RO({duration:n=On.duration,bounce:e=On.bounce,velocity:t=On.velocity,mass:i=On.mass}){let r,s,o=1-e;o=Us(On.minDamping,On.maxDamping,o),n=Us(On.minDuration,On.maxDuration,ho(n)),o<1?(r=u=>{const d=u*o,h=d*n,p=d-t,g=tA(u,o),v=Math.exp(-h);return Cb-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=tA(Math.pow(u,2),o);return(-r(u)+Cb>0?-1:1)*((p-g)*v)/S}):(r=u=>{const d=Math.exp(-u*n),h=(u-t)*n+1;return-.001+d*h},s=u=>{const d=Math.exp(-u*n),h=(t-u)*(n*n);return d*h});const a=5/n,l=IO(r,s,a);if(n=fo(n),isNaN(l))return{stiffness:On.stiffness,damping:On.damping,duration:n};{const u=Math.pow(l,2)*i;return{stiffness:u,damping:o*2*Math.sqrt(i*u),duration:n}}}const PO=12;function IO(n,e,t){let i=t;for(let r=1;rn[t]!==void 0)}function DO(n){let e=ge({velocity:On.velocity,stiffness:On.stiffness,damping:On.damping,mass:On.mass,isResolvedFromDuration:!1},n);if(!Tb(n,LO)&&Tb(n,BO))if(n.visualDuration){const t=n.visualDuration,i=2*Math.PI/(t*1.2),r=i*i,s=2*Us(.05,1,1-(n.bounce||0))*Math.sqrt(r);e=yt(ge({},e),{mass:On.mass,stiffness:r,damping:s})}else{const t=RO(n);e=yt(ge(ge({},e),t),{mass:On.mass}),e.isResolvedFromDuration=!0}return e}function bb(n=On.visualDuration,e=On.bounce){const t=typeof n!="object"?{visualDuration:n,keyframes:[0,1],bounce:e}:n;let{restSpeed:i,restDelta:r}=t;const s=t.keyframes[0],o=t.keyframes[t.keyframes.length-1],a={done:!1,value:s},{stiffness:l,damping:u,mass:d,duration:h,velocity:p,isResolvedFromDuration:g}=DO(yt(ge({},t),{velocity:-ho(t.velocity||0)})),v=p||0,S=u/(2*Math.sqrt(l*d)),_=o-s,m=ho(Math.sqrt(l/d)),x=Math.abs(_)<5;i||(i=x?On.restSpeed.granular:On.restSpeed.default),r||(r=x?On.restDelta.granular:On.restDelta.default);let A;if(S<1){const I=tA(m,S);A=P=>{const D=Math.exp(-S*m*P);return o-D*((v+S*m*_)/I*Math.sin(I*P)+_*Math.cos(I*P))}}else if(S===1)A=I=>o-Math.exp(-m*I)*(_+(v+m*_)*I);else{const I=m*Math.sqrt(S*S-1);A=P=>{const D=Math.exp(-S*m*P),N=Math.min(I*P,300);return o-D*((v+S*m*_)*Math.sinh(N)+I*_*Math.cosh(N))/I}}const w={calculatedDuration:g&&h||null,next:I=>{const P=A(I);if(g)a.done=I>=h;else{let D=0;S<1&&(D=I===0?fo(v):Eb(A,I,P));const N=Math.abs(D)<=i,B=Math.abs(o-P)<=r;a.done=N&&B}return a.value=a.done?o:P,a},toString:()=>{const I=Math.min(BT(w),b_),P=DT(D=>w.next(I*D).value,I,30);return I+"ms "+P}};return w}function Rb({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+x(N),w=N=>{const B=x(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=bb({keyframes:[p.value,v(p.value)],velocity:Eb(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 FO=ud(.42,0,1,1),NO=ud(0,0,.58,1),Pb=ud(.42,0,.58,1),UO=n=>Array.isArray(n)&&typeof n[0]!="number",Ib={linear:Xi,easeIn:FO,easeInOut:Pb,easeOut:NO,circIn:H_,circInOut:$T,circOut:ZT,backIn:z_,backInOut:QT,backOut:YT,anticipate:qT},Bb=n=>{if(P_(n)){u_(n.length===4);const[e,t,i,r]=n;return ud(e,t,i,r)}else if(typeof n=="string")return u_(Ib[n]!==void 0),Ib[n];return n};function OO(n,e,t){const i=[],r=t||wb,s=n.length-1;for(let o=0;oe[0];if(s===2&&e[0]===e[1])return()=>e[1];const o=n[0]===n[1];n[0]>n[s-1]&&(n=[...n].reverse(),e=[...e].reverse());const a=OO(e,i,r),l=a.length,u=d=>{if(o&&d1)for(;hu(Us(n[0],n[s-1],d)):u}function kO(n,e){const t=n[n.length-1];for(let i=1;i<=e;i++){const r=ol(0,e,i);n.push(Ln(t,1,r))}}function Lb(n){const e=[0];return kO(e,n.length-1),e}function zO(n,e){return n.map(t=>t*e)}function HO(n,e){return n.map(()=>e||Pb).splice(0,n.length-1)}function Rm({duration:n=300,keyframes:e,times:t,ease:i="easeInOut"}){const r=UO(i)?i.map(Bb):Bb(i),s={done:!1,value:e[0]},o=zO(t&&t.length===e.length?t:Lb(e),n),a=nA(o,e,{ease:Array.isArray(r)?r:HO(e,r)});return{calculatedDuration:n,next:l=>(s.value=a(l),s.done=l>=n,s)}}const GO=n=>{const e=({timestamp:t})=>n(t);return{start:()=>en.update(e,!0),stop:()=>ps(e),now:()=>si.isProcessing?si.timestamp:ks.now()}},VO={decay:Rb,inertia:Rb,tween:Rm,keyframes:Rm,spring:bb},WO=n=>n/100;class Pm extends _b{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)||Q_,a=(l,u)=>this.onKeyframesResolved(l,u);this.resolver=new o(s,a,t,i,r),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(e){const{type:t="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:s,velocity:o=0}=this.options,a=R_(t)?t:VO[t]||Rm;let l,u;a!==Rm&&typeof e[0]!="number"&&(l=Ku(WO,wb(e[0],e[1])),e=[0,100]);const d=a(yt(ge({},this.options),{keyframes:e}));s==="mirror"&&(u=a(yt(ge({},this.options),{keyframes:[...e].reverse(),velocity:-o}))),d.calculatedDuration===null&&(d.calculatedDuration=BT(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:_}=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),x=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=Us(0,1,T)*h}const I=x?{done:!1,value:l[0]}:w.next(A);a&&(I.value=a(I.value));let{done:P}=I;!x&&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=Tm(l,this.options,r)),_&&_(I.value),D&&this.finish(),I}get duration(){const{resolved:e}=this;return e?ho(e.calculatedDuration):0}get time(){return ho(this.currentTime)}set time(e){e=fo(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=ho(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:e=GO,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 XO(n){return new Pm(n)}const jO=new Set(["opacity","clipPath","filter","transform"]);function JO(n,e,t,{delay:i=0,duration:r=300,repeat:s=0,repeatType:o="loop",ease:a="easeInOut",times:l}={}){const u={[e]:t};l&&(u.offset=l);const d=NT(a,r);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 KO=c_(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Im=10,YO=2e4;function QO(n){return R_(n.type)||n.type==="spring"||!FT(n.ease)}function qO(n,e){const t=new Pm(yt(ge({},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){let{duration:i=300,times:r,ease:s,type:o,motionValue:a,name:l,startTime:u}=this.options;if(!a.owner||!a.owner.current)return!1;if(typeof s=="string"&&Em()&&ZO(s)&&(s=Db[s]),QO(this.options)){const h=this.options,{onComplete:p,onUpdate:g,motionValue:v,element:S}=h,_=Xn(h,["onComplete","onUpdate","motionValue","element"]),m=qO(e,_);e=m.keyframes,e.length===1&&(e[1]=e[0]),i=m.duration,r=m.times,s=m.ease,o="keyframes"}const d=JO(a.owner.current,l,e,yt(ge({},this.options),{duration:i,times:r,ease:s}));return d.startTime=u!=null?u:this.calcStartTime(),this.pendingTimeline?(LT(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:p}=this.options;a.set(Tm(e,this.options,t)),p&&p(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:i,times:r,type:o,ease:s,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:t}=e;return ho(t)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:t}=e;return ho(t.currentTime||0)}set time(e){const{resolved:t}=this;if(!t)return;const{animation:i}=t;i.currentTime=fo(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;LT(i,e)}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=Xn(u,["motionValue","onUpdate","onComplete","element"]),S=new Pm(yt(ge({},v),{keyframes:i,duration:r,type:s,ease:o,times:a,isGenerator:!0})),_=fo(this.time);d.setWithVelocity(S.sample(_-Im).value,S.sample(_).value,Im)}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;if(!t||!t.owner||!(t.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=t.owner.getProps();return KO()&&i&&jO.has(i)&&!l&&!u&&!r&&s!=="mirror"&&o!==0&&a!=="inertia"}}const $O={type:"spring",stiffness:500,damping:25,restSpeed:10},ek=n=>({type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restSpeed:10}),tk={type:"keyframes",duration:.8},nk={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ik=(n,{keyframes:e})=>e.length>2?tk:al.has(n)?n.startsWith("scale")?ek(e[1]):$O:nk;function rk(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=Xn(p,["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);return!!Object.keys(d).length}const iA=(n,e,t,i={},r,s)=>o=>{const a=T_(i,n)||{},l=a.delay||i.delay||0;let{elapsed:u=0}=i;u=u-fo(l);let d=yt(ge({keyframes:Array.isArray(t)?t:[null,t],ease:"easeOut",velocity:e.getVelocity()},a),{delay:-u,onUpdate:p=>{e.set(p),a.onUpdate&&a.onUpdate(p)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:n,motionValue:e,element:s?void 0:r});rk(a)||(d=ge(ge({},d),ik(n,d))),d.duration&&(d.duration=fo(d.duration)),d.repeatDelay&&(d.repeatDelay=fo(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let h=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(d.duration=0,d.delay===0&&(h=!0)),h&&!s&&e.get()!==void 0){const p=Tm(d.keyframes,a);if(p!==void 0)return en.update(()=>{d.onUpdate(p),d.onComplete()}),new TU([])}return!s&&Fb.supports(d)?new Fb(d):new Pm(d)};function sk({protectedKeys:n,needsAnimating:e},t){const i=n.hasOwnProperty(t)&&e[t]!==!0;return e[t]=!1,i}function Nb(n,e,{delay:t=0,transitionOverride:i,type:r}={}){var s;let h=e,{transition:o=n.getDefaultTransition(),transitionEnd:a}=h,l=Xn(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&&sk(d,p))continue;const S=ge({delay:t},T_(o||{},p));let _=!1;if(window.MotionHandoffAnimation){const x=XT(n);if(x){const A=window.MotionHandoffAnimation(x,p,en);A!==null&&(S.startTime=A,_=!0)}}k_(n,p),g.start(iA(p,g,v,n.shouldReduceMotion&&VT.has(p)?{type:!1}:S,n,_));const m=g.animation;m&&u.push(m)}return a&&Promise.all(u).then(()=>{en.update(()=>{a&&zU(n,a)})}),u}function rA(n,e,t={}){var i;const r=wm(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(Nb(n,r,t)):()=>Promise.resolve(),a=n.variantChildren&&n.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:h,staggerDirection:p}=s;return ok(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 ok(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(ak).forEach((u,d)=>{u.notify("AnimationStart",e),o.push(rA(u,e,yt(ge({},s),{delay:t+l(d)})).then(()=>u.notify("AnimationComplete",e)))}),Promise.all(o)}function ak(n,e){return n.sortNodePosition(e)}function lk(n,e,t={}){n.notify("AnimationStart",e);let i;if(Array.isArray(e)){const r=e.map(s=>rA(n,s,t));i=Promise.all(r)}else if(typeof e=="string")i=rA(n,e,t);else{const r=typeof e=="function"?wm(n,e,t.custom):e;i=Promise.all(Nb(n,r,t))}return i.then(()=>{n.notify("AnimationComplete",e)})}const uk=h_.length;function Ub(n){if(!n)return;if(!n.isControllingVariants){const t=n.parent?Ub(n.parent)||{}:{};return n.props.initial!==void 0&&(t.initial=n.props.initial),t}const e={};for(let t=0;tPromise.all(e.map(({animation:t,options:i})=>lk(n,t,i)))}function hk(n){let e=dk(n),t=Ob(),i=!0;const r=l=>(u,d)=>{var h;const p=wm(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,_=Xn(g,["transition","transitionEnd"]);u=ge(ge(ge({},u),_),S)}return u};function s(l){e=l(n)}function o(l){const{props:u}=n,d=Ub(n.parent)||{},h=[],p=new Set;let g={},v=1/0;for(let _=0;_v&&w,B=!1;const T=Array.isArray(A)?A:[A];let F=T.reduce(r(m),{});I===!1&&(F={});const{prevResolvedValues:X={}}=x,J=ge(ge({},X),F),K=fe=>{N=!0,p.has(fe)&&(B=!0,p.delete(fe)),x.needsAnimating[fe]=!0;const z=n.getValue(fe);z&&(z.liveStyle=!1)};for(const fe in J){const z=F[fe],$=X[fe];if(g.hasOwnProperty(fe))continue;let ne=!1;y_(z)&&y_($)?ne=!PT(z,$):ne=z!==$,ne?z!=null?K(fe):p.add(fe):z!==void 0&&p.has(fe)?K(fe):x.protectedKeys[fe]=!0}x.prevProp=A,x.prevResolvedValues=F,x.isActive&&(g=ge(ge({},g),F)),i&&n.blockInitialAnimation&&(N=!1),N&&(!(P&&D)||B)&&h.push(...T.map(fe=>({animation:fe,options:{type:m}})))}if(p.size){const _={};p.forEach(m=>{const x=n.getBaseTarget(m),A=n.getValue(m);A&&(A.liveStyle=!0),_[m]=x!=null?x:null}),h.push({animation:_})}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=Ob(),i=!0}}}function pk(n,e){return typeof e=="string"?e!==n:Array.isArray(e)?!PT(e,n):!1}function cl(n=!1){return{isActive:n,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ob(){return{animate:cl(!0),whileInView:cl(),whileHover:cl(),whileTap:cl(),whileDrag:cl(),whileFocus:cl(),exit:cl()}}class sa{constructor(e){this.isMounted=!1,this.node=e}update(){}}class mk extends sa{constructor(e){super(e),e.animationState||(e.animationState=hk(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();_m(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 gk=0;class vk extends sa{constructor(){super(...arguments),this.id=gk++}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 kb={animation:{Feature:mk},exit:{Feature:vk}};function dd(n,e,t,i={passive:!0}){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t)}function hd(n){return{point:{x:n.pageX,y:n.pageY}}}const zb=n=>e=>L_(e)&&n(e,hd(e));function fl(n,e,t,i){return dd(n,e,zb(t),i)}const Hb=(n,e)=>Math.abs(n-e);function yk(n,e){const t=Hb(n.x,e.x),i=Hb(n.y,e.y);return Math.sqrt(jy(t,2)+jy(i,2))}class Gb{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=oA(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,g=yk(h.offset,{x:0,y:0})>=3;if(!p&&!g)return;const{point:v}=h,{timestamp:S}=si;this.history.push(yt(ge({},v),{timestamp:S}));const{onStart:_,onMove:m}=this.handlers;p||(_&&_(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),m&&m(this.lastMoveEvent,h)},this.handlePointerMove=(h,p)=>{this.lastMoveEvent=h,this.lastMoveEventInfo=sA(p,this.transformPagePoint),en.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 _=oA(h.type==="pointercancel"?this.lastMoveEventInfo:sA(p,this.transformPagePoint),this.history);this.startEvent&&g&&g(h,_),v&&v(h,_)},!L_(e))return;this.dragSnapToOrigin=s,this.handlers=t,this.transformPagePoint=i,this.contextWindow=r||window;const o=hd(e),a=sA(o,this.transformPagePoint),{point:l}=a,{timestamp:u}=si;this.history=[yt(ge({},l),{timestamp:u})];const{onSessionStart:d}=t;d&&d(e,oA(a,this.history)),this.removeListeners=Ku(fl(this.contextWindow,"pointermove",this.handlePointerMove),fl(this.contextWindow,"pointerup",this.handlePointerUp),fl(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),ps(this.updatePoint)}}function sA(n,e){return e?{point:e(n.point)}:n}function Vb(n,e){return{x:n.x-e.x,y:n.y-e.y}}function oA({point:n},e){return{point:n,delta:Vb(n,Wb(e)),offset:Vb(n,xk(e)),velocity:_k(e,.1)}}function xk(n){return n[0]}function Wb(n){return n[n.length-1]}function _k(n,e){if(n.length<2)return{x:0,y:0};let t=n.length-1,i=null;const r=Wb(n);for(;t>=0&&(i=n[t],!(r.timestamp-i.timestamp>fo(e)));)t--;if(!i)return{x:0,y:0};const s=ho(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}const Xb=1e-4,Ak=1-Xb,Sk=1+Xb,jb=.01,Mk=0-jb,wk=0+jb;function Tr(n){return n.max-n.min}function Ek(n,e,t){return Math.abs(n-e)<=t}function Jb(n,e,t,i=.5){n.origin=i,n.originPoint=Ln(e.min,e.max,n.origin),n.scale=Tr(t)/Tr(e),n.translate=Ln(t.min,t.max,n.origin)-n.originPoint,(n.scale>=Ak&&n.scale<=Sk||isNaN(n.scale))&&(n.scale=1),(n.translate>=Mk&&n.translate<=wk||isNaN(n.translate))&&(n.translate=0)}function pd(n,e,t,i){Jb(n.x,e.x,t.x,i?i.originX:void 0),Jb(n.y,e.y,t.y,i?i.originY:void 0)}function Kb(n,e,t){n.min=t.min+e.min,n.max=n.min+Tr(e)}function Ck(n,e,t){Kb(n.x,e.x,t.x),Kb(n.y,e.y,t.y)}function Yb(n,e,t){n.min=e.min-t.min,n.max=n.min+Tr(e)}function md(n,e,t){Yb(n.x,e.x,t.x),Yb(n.y,e.y,t.y)}function Tk(n,{min:e,max:t},i){return e!==void 0&&nt&&(n=i?Ln(t,n,i.max):Math.min(n,t)),n}function Qb(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 bk(n,{top:e,left:t,bottom:i,right:r}){return{x:Qb(n.x,t,r),y:Qb(n.y,e,i)}}function qb(n,e){let t=e.min-n.min,i=e.max-n.max;return e.max-e.mini?t=ol(e.min,e.max-i,n.min):i>r&&(t=ol(n.min,n.max-r,e.min)),Us(0,1,t)}function Ik(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 aA=.35;function Bk(n=aA){return n===!1?n=0:n===!0&&(n=aA),{x:Zb(n,"left","right"),y:Zb(n,"top","bottom")}}function Zb(n,e,t){return{min:$b(n,e),max:$b(n,t)}}function $b(n,e){return typeof n=="number"?n:n[e]||0}const eR=()=>({translate:0,scale:1,origin:0,originPoint:0}),Yu=()=>({x:eR(),y:eR()}),tR=()=>({min:0,max:0}),kn=()=>({x:tR(),y:tR()});function jr(n){return[n("x"),n("y")]}function nR({top:n,left:e,right:t,bottom:i}){return{x:{min:e,max:t},y:{min:n,max:i}}}function Lk({x:n,y:e}){return{top:e.min,right:n.max,bottom:e.max,left:n.min}}function Dk(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 lA(n){return n===void 0||n===1}function uA({scale:n,scaleX:e,scaleY:t}){return!lA(n)||!lA(e)||!lA(t)}function dl(n){return uA(n)||iR(n)||n.z||n.rotate||n.rotateX||n.rotateY||n.skewX||n.skewY}function iR(n){return rR(n.x)||rR(n.y)}function rR(n){return n&&n!=="0%"}function Bm(n,e,t){const i=n-t,r=e*i;return t+r}function sR(n,e,t,i,r){return r!==void 0&&(n=Bm(n,r,i)),Bm(n,t,i)+e}function cA(n,e=0,t=1,i,r){n.min=sR(n.min,e,t,i,r),n.max=sR(n.max,e,t,i,r)}function oR(n,{x:e,y:t}){cA(n.x,e.translate,e.scale,e.originPoint),cA(n.y,t.translate,t.scale,t.originPoint)}const aR=.999999999999,lR=1.0000000000001;function Fk(n,e,t,i=!1){const r=t.length;if(!r)return;e.x=e.y=1;let s,o;for(let a=0;aaR&&(e.x=1),e.yaR&&(e.y=1)}function Qu(n,e){n.min=n.min+e,n.max=n.max+e}function uR(n,e,t,i,r=.5){const s=Ln(n.min,n.max,r);cA(n,e,t,s,i)}function qu(n,e){uR(n.x,e.x,e.scaleX,e.scale,e.originX),uR(n.y,e.y,e.scaleY,e.scale,e.originY)}function cR(n,e){return nR(Dk(n.getBoundingClientRect(),e))}function Nk(n,e,t){const i=cR(n,t),{scroll:r}=e;return r&&(Qu(i.x,r.offset.x),Qu(i.y,r.offset.y)),i}const fR=({current:n})=>n?n.ownerDocument.defaultView:null,Uk=new WeakMap;class Ok{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=kn(),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(hd(d).point)},s=(d,h)=>{const{drag:p,dragPropagation:g,onDragStart:v}=this.getProps();if(p&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=FU(p),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),jr(_=>{let m=this.getAxisMotionValue(_).get()||0;if(Os.test(m)){const{projection:x}=this.visualElement;if(x&&x.layout){const A=x.layout.layoutBox[_];A&&(m=Tr(A)*(parseFloat(m)/100))}}this.originPoint[_]=m}),v&&en.postRender(()=>v(d,h)),k_(this.visualElement,"transform");const{animationState:S}=this.visualElement;S&&S.setActive("whileDrag",!0)},o=(d,h)=>{const{dragPropagation:p,dragDirectionLock:g,onDirectionLock:v,onDrag:S}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:_}=h;if(g&&this.currentDirection===null){this.currentDirection=kk(_),this.currentDirection!==null&&v&&v(this.currentDirection);return}this.updateAxis("x",h.point,_),this.updateAxis("y",h.point,_),this.visualElement.render(),S&&S(d,h)},a=(d,h)=>this.stop(d,h),l=()=>jr(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 Gb(e,{onSessionStart:r,onStart:s,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:fR(this.visualElement)})}stop(e,t){const i=this.isDragging;if(this.cancel(),!i)return;const{velocity:r}=t;this.startAnimation(r);const{onDragEnd:s}=this.getProps();s&&en.postRender(()=>s(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.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(e,t,i){const{drag:r}=this.getProps();if(!i||!Lm(e,r,this.currentDirection))return;const s=this.getAxisMotionValue(e);let o=this.originPoint[e]+i[e];this.constraints&&this.constraints[e]&&(o=Tk(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&&Vu(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=bk(r.layoutBox,t):this.constraints=!1,this.elastic=Bk(i),s!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&jr(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=Ik(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!Vu(e))return!1;const i=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const s=Nk(i,r.root,this.visualElement.getTransformPagePoint());let o=Rk(r.layout.layoutBox,s);if(t){const a=t(Lk(o));this.hasMutatedConstraints=!!a,a&&(o=nR(a))}return o}startAnimation(e){const{drag:t,dragMomentum:i,dragElastic:r,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=jr(d=>{if(!Lm(d,t,this.currentDirection))return;let h=l[d]||{};o&&(h={min:0,max:0});const p=r?200:1e6,g=r?40:1e7,v=ge(ge({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 k_(this.visualElement,e),i.start(iA(e,i,0,t,this.visualElement,!1))}stopAnimation(){jr(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){jr(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){jr(t=>{const{drag:i}=this.getProps();if(!Lm(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(!Vu(t)||!i||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};jr(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();r[o]=Pk({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(),jr(o=>{if(!Lm(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;Uk.set(this.visualElement,this);const e=this.visualElement.current,t=fl(e,"pointerdown",l=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(l)}),i=()=>{const{dragConstraints:l}=this.getProps();Vu(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()),en.read(i);const o=dd(window,"resize",()=>this.scalePositionWithinConstraints()),a=r.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(jr(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=aA,dragMomentum:a=!0}=e;return yt(ge({},e),{drag:t,dragDirectionLock:i,dragPropagation:r,dragConstraints:s,dragElastic:o,dragMomentum:a})}}function Lm(n,e,t){return(e===!0||e===n)&&(t===null||t===n)}function kk(n,e=10){let t=null;return Math.abs(n.y)>e?t="y":Math.abs(n.x)>e&&(t="x"),t}class zk extends sa{constructor(e){super(e),this.removeGroupControls=Xi,this.removeListeners=Xi,this.controls=new Ok(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 dR=n=>(e,t)=>{n&&en.postRender(()=>n(e,t))};class Hk extends sa{constructor(){super(...arguments),this.removePointerDownListener=Xi}onPointerDown(e){this.session=new Gb(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:fR(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:i,onPanEnd:r}=this.node.getProps();return{onSessionStart:dR(e),onStart:dR(t),onMove:i,onEnd:(s,o)=>{delete this.session,r&&en.postRender(()=>r(s,o))}}}mount(){this.removePointerDownListener=fl(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 Dm={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function hR(n,e){return e.max===e.min?0:n/(e.max-e.min)*100}const gd={correct:(n,e)=>{if(!e.target)return n;if(typeof n=="string")if(Mt.test(n))n=parseFloat(n);else return n;const t=hR(n,e.target.x),i=hR(n,e.target.y);return`${t}% ${i}%`}},Gk={correct:(n,{treeScale:e,projectionDelta:t})=>{const i=n,r=ra.parse(n);if(r.length>5)return i;const s=ra.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)}};class Vk extends me.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:i,layoutId:r}=this.props,{projection:s}=e;gU(Wk),s&&(t.group&&t.group.add(s),i&&i.register&&r&&i.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions(yt(ge({},s.options),{onExitComplete:()=>this.safeToRemove()}))),Dm.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()||en.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),m_.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 pR(n){const[e,t]=D3(),i=me.useContext(iT);return ve.jsx(Vk,yt(ge({},n),{layoutGroup:i,switchLayoutGroup:me.useContext(dT),isPresent:e,safeToRemove:t}))}const Wk={borderRadius:yt(ge({},gd),{applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]}),borderTopLeftRadius:gd,borderTopRightRadius:gd,borderBottomLeftRadius:gd,borderBottomRightRadius:gd,boxShadow:Gk};function Xk(n,e,t){const i=Cn(n)?n:zs(n);return i.start(iA("",i,e,t)),i.animation}function jk(n){return n instanceof SVGElement&&n.tagName!=="svg"}const Jk=(n,e)=>n.depth-e.depth;class Kk{constructor(){this.children=[],this.isDirty=!1}add(e){F_(this.children,e),this.isDirty=!0}remove(e){N_(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Jk),this.isDirty=!1,this.children.forEach(e)}}function Yk(n,e){const t=ks.now(),i=({timestamp:r})=>{const s=r-t;s>=e&&(ps(i),n(s-e))};return en.read(i,!0),()=>ps(i)}const mR=["TopLeft","TopRight","BottomLeft","BottomRight"],Qk=mR.length,gR=n=>typeof n=="string"?parseFloat(n):n,vR=n=>typeof n=="number"||Mt.test(n);function qk(n,e,t,i,r,s){r?(n.opacity=Ln(0,t.opacity!==void 0?t.opacity:1,Zk(i)),n.opacityExit=Ln(e.opacity!==void 0?e.opacity:1,0,$k(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(ol(n,e,i))}function _R(n,e){n.min=e.min,n.max=e.max}function Jr(n,e){_R(n.x,e.x),_R(n.y,e.y)}function AR(n,e){n.translate=e.translate,n.scale=e.scale,n.originPoint=e.originPoint,n.origin=e.origin}function SR(n,e,t,i,r){return n-=e,n=Bm(n,1/t,i),r!==void 0&&(n=Bm(n,1/r,i)),n}function ez(n,e=0,t=1,i=.5,r,s=n,o=n){if(Os.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=SR(n.min,e,t,a,r),n.max=SR(n.max,e,t,a,r)}function MR(n,e,[t,i,r],s,o){ez(n,e[t],e[i],e[r],e.scale,s,o)}const tz=["x","scaleX","originX"],nz=["y","scaleY","originY"];function wR(n,e,t,i){MR(n.x,e,tz,t?t.x:void 0,i?i.x:void 0),MR(n.y,e,nz,t?t.y:void 0,i?i.y:void 0)}function ER(n){return n.translate===0&&n.scale===1}function CR(n){return ER(n.x)&&ER(n.y)}function TR(n,e){return n.min===e.min&&n.max===e.max}function iz(n,e){return TR(n.x,e.x)&&TR(n.y,e.y)}function bR(n,e){return Math.round(n.min)===Math.round(e.min)&&Math.round(n.max)===Math.round(e.max)}function RR(n,e){return bR(n.x,e.x)&&bR(n.y,e.y)}function PR(n){return Tr(n.x)/Tr(n.y)}function IR(n,e){return n.translate===e.translate&&n.scale===e.scale&&n.originPoint===e.originPoint}class rz{constructor(){this.members=[]}add(e){F_(this.members,e),e.scheduleRender()}remove(e){if(N_(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 sz(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 hl={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},vd=typeof window!="undefined"&&window.MotionDebug!==void 0,fA=["","X","Y","Z"],oz={visibility:"hidden"},BR=1e3;let az=0;function dA(n,e,t,i){const{latestValues:r}=e;r[n]&&(t[n]=r[n],e.setStaticValue(n,0),i&&(i[n]=0))}function LR(n){if(n.hasCheckedOptimisedAppear=!0,n.root===n)return;const{visualElement:e}=n.options;if(!e)return;const t=XT(e);if(window.MotionHasOptimisedAnimation(t,"transform")){const{layout:r,layoutId:s}=n.options;window.MotionCancelOptimisedAnimation(t,"transform",en,!(r||s))}const{parent:i}=n;i&&!i.hasCheckedOptimisedAppear&&LR(i)}function DR({attachResizeListener:n,defaultParent:e,measureScroll:t,checkIsScrollRoot:i,resetTransform:r}){return class{constructor(o={},a=e==null?void 0:e()){this.id=az++,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,vd&&(hl.totalNodes=hl.resolvedTargetDeltas=hl.recalculatedProjection=0),this.nodes.forEach(cz),this.nodes.forEach(mz),this.nodes.forEach(gz),this.nodes.forEach(fz),vd&&window.MotionDebug.record(hl)},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=Yk(p,250),Dm.hasAnimatedSinceResize&&(Dm.hasAnimatedSinceResize=!1,this.nodes.forEach(NR))})}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()||Az,{onLayoutAnimationStart:_,onLayoutAnimationComplete:m}=d.getProps(),x=!this.targetLayout||!RR(this.targetLayout,v)||g,A=!p&&g;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||A||p&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(h,A);const w=yt(ge({},T_(S,"layout")),{onPlay:_,onComplete:m});(d.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w)}else p||NR(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,ps(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(vz),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&&LR(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;UR(h.x,o.x,I),UR(h.y,o.y,I),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(md(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),xz(this.relativeTarget,this.relativeTargetOrigin,p,I),A&&iz(this.relativeTarget,A)&&(this.isProjectionDirty=!1),A||(A=kn()),Jr(A,this.relativeTarget)),S&&(this.animationValues=d,qk(d,u,this.latestValues,I,x,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&&(ps(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=en.update(()=>{Dm.hasAnimatedSinceResize=!0,this.currentAnimation=Xk(0,BR,yt(ge({},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(BR),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&&GR(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||kn();const h=Tr(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+h;const p=Tr(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+p}Jr(a,l),qu(a,d),pd(this.projectionDeltaWithTransform,this.layoutCorrected,a,d)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new rz),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&&dA("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(FR),this.root.sharedNodes.clear()}}}function lz(n){n.updateLayout()}function uz(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"?jr(h=>{const p=o?t.measuredBox[h]:t.layoutBox[h],g=Tr(p);p.min=i[h].min,p.max=p.min+g}):GR(s,t.layoutBox,i)&&jr(h=>{const p=o?t.measuredBox[h]:t.layoutBox[h],g=Tr(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=Yu();pd(a,i,t.layoutBox);const l=Yu();o?pd(l,n.applyTransform(r,!0),t.measuredBox):pd(l,i,t.layoutBox);const u=!CR(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=kn();md(v,t.layoutBox,p.layoutBox);const S=kn();md(S,i,g.layoutBox),RR(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 cz(n){vd&&hl.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 fz(n){n.isProjectionDirty=n.isSharedProjectionDirty=n.isTransformDirty=!1}function dz(n){n.clearSnapshot()}function FR(n){n.clearMeasurements()}function hz(n){n.isLayoutDirty=!1}function pz(n){const{visualElement:e}=n.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),n.resetTransform()}function NR(n){n.finishAnimation(),n.targetDelta=n.relativeTarget=n.target=void 0,n.isProjectionDirty=!0}function mz(n){n.resolveTargetDelta()}function gz(n){n.calcProjection()}function vz(n){n.resetSkewAndRotation()}function yz(n){n.removeLeadSnapshot()}function UR(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 OR(n,e,t,i){n.min=Ln(e.min,t.min,i),n.max=Ln(e.max,t.max,i)}function xz(n,e,t,i){OR(n.x,e.x,t.x,i),OR(n.y,e.y,t.y,i)}function _z(n){return n.animationValues&&n.animationValues.opacityExit!==void 0}const Az={duration:.45,ease:[.4,0,.1,1]},kR=n=>typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(n),zR=kR("applewebkit/")&&!kR("chrome/")?Math.round:Xi;function HR(n){n.min=zR(n.min),n.max=zR(n.max)}function Sz(n){HR(n.x),HR(n.y)}function GR(n,e,t){return n==="position"||n==="preserve-aspect"&&!Ek(PR(e),PR(t),.2)}function Mz(n){var e;return n!==n.root&&((e=n.scroll)===null||e===void 0?void 0:e.wasRoot)}const wz=DR({attachResizeListener:(n,e)=>dd(n,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),hA={current:void 0},VR=DR({measureScroll:n=>({x:n.scrollLeft,y:n.scrollTop}),defaultParent:()=>{if(!hA.current){const n=new wz({});n.mount(window),n.setOptions({layoutScroll:!0}),hA.current=n}return hA.current},resetTransform:(n,e)=>{n.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:n=>window.getComputedStyle(n).position==="fixed"}),Ez={pan:{Feature:Hk},drag:{Feature:zk,ProjectionNode:VR,MeasureLayout:pR}};function WR(n,e,t){const{props:i}=n;n.animationState&&i.whileHover&&n.animationState.setActive("whileHover",t==="Start");const r="onHover"+t,s=i[r];s&&en.postRender(()=>s(e,hd(e)))}class Cz extends sa{mount(){const{current:e}=this.node;e&&(this.unmount=PU(e,t=>(WR(this.node,t,"Start"),i=>WR(this.node,i,"End"))))}unmount(){}}class Tz extends sa{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=Ku(dd(this.node.current,"focus",()=>this.onFocus()),dd(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function XR(n,e,t){const{props:i}=n;n.animationState&&i.whileTap&&n.animationState.setActive("whileTap",t==="Start");const r="onTap"+(t==="End"?"":t),s=i[r];s&&en.postRender(()=>s(e,hd(e)))}class bz extends sa{mount(){const{current:e}=this.node;e&&(this.unmount=DU(e,t=>(XR(this.node,t,"Start"),(i,{success:r})=>XR(this.node,i,r?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const pA=new WeakMap,mA=new WeakMap,Rz=n=>{const e=pA.get(n.target);e&&e(n)},Pz=n=>{n.forEach(Rz)};function Iz(t){var i=t,{root:n}=i,e=Xn(i,["root"]);const r=n||document;mA.has(r)||mA.set(r,{});const s=mA.get(r),o=JSON.stringify(e);return s[o]||(s[o]=new IntersectionObserver(Pz,ge({root:n},e))),s[o]}function Bz(n,e,t){const i=Iz(e);return pA.set(n,t),i.observe(n),()=>{pA.delete(n),i.unobserve(n)}}const Lz={some:0,all:1};class Dz extends sa{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:Lz[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 Bz(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(Fz(e,t))&&this.startObserver()}unmount(){}}function Fz({viewport:n={}},{viewport:e={}}={}){return t=>n[t]!==e[t]}const Nz={inView:{Feature:Dz},tap:{Feature:bz},focus:{Feature:Tz},hover:{Feature:Cz}},Uz={layout:{ProjectionNode:VR,MeasureLayout:pR}},gA={current:null},jR={current:!1};function Oz(){if(jR.current=!0,!!l_)if(window.matchMedia){const n=window.matchMedia("(prefers-reduced-motion)"),e=()=>gA.current=n.matches;n.addListener(e),e()}else gA.current=!1}const kz=[...gb,bi,ra],zz=n=>kz.find(mb(n)),JR=new WeakMap;function Hz(n,e,t){for(const i in e){const r=e[i],s=t[i];if(Cn(r))n.addValue(i,r);else if(Cn(s))n.addValue(i,zs(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,zs(o!==void 0?o:r,{owner:n}))}}for(const i in t)e[i]===void 0&&n.removeValue(i);return e}const KR=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class YR{scrapeMotionValuesFromProps(e,t,i){return{}}constructor({parent:e,props:t,presenceContext:i,reducedMotionConfig:r,blockInitialAnimation:s,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Q_,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const v=ks.now();this.renderScheduledAtthis.bindToMotionValue(i,t)),jR.current||Oz(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:gA.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){JR.delete(this.current),this.projection&&this.projection.unmount(),ps(this.notifyUpdate),ps(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=al.has(e),r=t.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&en.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 Gu){const t=Gu[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):kn()}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=zs(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"&&(hb(r)||eb(r))?r=parseFloat(r):!zz(r)&&ra.test(t)&&(r=ab(e,t)),this.setBaseTarget(e,Cn(r)?r.get():r)),Cn(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=v_(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&&!Cn(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 U_),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class QR extends YR{constructor(){super(...arguments),this.KeyframeResolver=yb}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]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Cn(e)&&(this.childSubscription=e.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}function Gz(n){return window.getComputedStyle(n)}class Vz extends QR{constructor(){super(...arguments),this.type="html",this.renderInstance=MT}readValueFromInstance(e,t){if(al.has(t)){const i=J_(t);return i&&i.default||0}else{const i=Gz(e),r=(vT(t)?i.getPropertyValue(t):i[t])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return cR(e,t)}build(e,t,i){S_(e,t,i.transformTemplate)}scrapeMotionValuesFromProps(e,t,i){return C_(e,t,i)}}class Wz extends QR{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=kn}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(al.has(t)){const i=J_(t);return i&&i.default||0}return t=wT.has(t)?t:p_(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,i){return TT(e,t,i)}build(e,t,i){M_(e,t,this.isSVGTag,i.transformTemplate)}renderInstance(e,t,i,r){ET(e,t,i,r)}mount(e){this.isSVGTag=E_(e.tagName),super.mount(e)}}const Xz=(n,e)=>g_(n)?new Wz(e):new Vz(e,{allowProjection:n!==me.Fragment}),jz=EU(ge(ge(ge(ge({},kb),Nz),Ez),Uz),Xz),ji=G3(jz);function qR(n,e){let t;const i=()=>{const{currentTime:r}=e,o=(r===null?0:r.value)/100;t!==o&&n(o),t=o};return en.update(i,!0),()=>ps(i)}const Fm=new WeakMap;let oa;function Jz(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 Kz({target:n,contentRect:e,borderBoxSize:t}){var i;(i=Fm.get(n))===null||i===void 0||i.forEach(r=>{r({target:n,contentSize:e,get size(){return Jz(n,t)}})})}function Yz(n){n.forEach(Kz)}function Qz(){typeof ResizeObserver!="undefined"&&(oa=new ResizeObserver(Yz))}function qz(n,e){oa||Qz();const t=UT(n);return t.forEach(i=>{let r=Fm.get(i);r||(r=new Set,Fm.set(i,r)),r.add(e),oa==null||oa.observe(i)}),()=>{t.forEach(i=>{const r=Fm.get(i);r==null||r.delete(e),r!=null&&r.size||oa==null||oa.unobserve(i)})}}const Nm=new Set;let yd;function Zz(){yd=()=>{const n={width:window.innerWidth,height:window.innerHeight},e={target:window,size:n,contentSize:n};Nm.forEach(t=>t(e))},window.addEventListener("resize",yd)}function $z(n){return Nm.add(n),yd||Zz(),()=>{Nm.delete(n),!Nm.size&&yd&&(yd=void 0)}}function eH(n,e){return typeof n=="function"?$z(n):qz(n,e)}const tH=50,ZR=()=>({current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}),nH=()=>({time:0,x:ZR(),y:ZR()}),iH={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function $R(n,e,t,i){const r=t[e],{length:s,position:o}=iH[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=ol(0,r.scrollLength,r.current);const u=i-l;r.velocity=u>tH?0:O_(r.current-a,u)}function rH(n,e,t){$R(n,"x",e,t),$R(n,"y",e,t),e.time=t}function sH(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 vA={start:0,center:.5,end:1};function eP(n,e,t=0){let i=0;if(n in vA&&(n=vA[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 oH=[0,0];function aH(n,e,t,i){let r=Array.isArray(n)?n:oH,s=0,o=0;return typeof n=="number"?r=[n,n]:typeof n=="string"&&(n=n.trim(),n.includes(" ")?r=n.split(" "):r=[n,vA[n]?n:"0"]),s=eP(r[0],t,i),o=eP(r[1],e),s-o}const lH={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},uH={x:0,y:0};function cH(n){return"getBBox"in n&&n.tagName!=="svg"?n.getBBox():{width:n.clientWidth,height:n.clientHeight}}function fH(n,e,t){const{offset:i=lH.All}=t,{target:r=n,axis:s="y"}=t,o=s==="y"?"height":"width",a=r!==n?sH(r,n):uH,l=r===n?{width:n.scrollWidth,height:n.scrollHeight}:cH(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;pdH(n,i.target,t),update:r=>{rH(n,t,r),(i.offset||i.target)&&fH(n,t,i)},notify:()=>e(t)}}const xd=new WeakMap,tP=new WeakMap,yA=new WeakMap,nP=n=>n===document.documentElement?window:n;function xA(n,i={}){var r=i,{container:e=document.documentElement}=r,t=Xn(r,["container"]);let s=yA.get(e);s||(s=new Set,yA.set(e,s));const o=nH(),a=hH(e,n,o,t);if(s.add(a),!xd.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=()=>{en.read(u,!1,!0),en.read(d,!1,!0),en.update(h,!1,!0)};xd.set(e,p);const g=nP(e);window.addEventListener("resize",p,{passive:!0}),e!==document.documentElement&&tP.set(e,eH(e,p)),g.addEventListener("scroll",p,{passive:!0})}const l=xd.get(e);return en.read(l,!1,!0),()=>{var u;ps(l);const d=yA.get(e);if(!d||(d.delete(a),d.size))return;const h=xd.get(e);xd.delete(e),h&&(nP(e).removeEventListener("scroll",h),(u=tP.get(e))===null||u===void 0||u(),window.removeEventListener("resize",h))}}function pH({source:n,container:e,axis:t="y"}){n&&(e=n);const i={value:0},r=xA(s=>{i.value=s[t].progress*100},{container:e,axis:t});return{currentTime:i,cancel:r}}const _A=new Map;function iP({source:n,container:e=document.documentElement,axis:t="y"}={}){n&&(e=n),_A.has(e)||_A.set(e,{});const i=_A.get(e);return i[t]||(i[t]=IT()?new ScrollTimeline({source:e,axis:t}):pH({source:e,axis:t})),i[t]}function mH(n){return n.length===2}function rP(n){return n&&(n.target||n.offset)}function gH(n,e){return mH(n)||rP(e)?xA(t=>{n(t[e.axis].progress,t)},e):qR(n,iP(e))}function vH(n,e){if(n.flatten(),rP(e))return n.pause(),xA(t=>{n.time=n.duration*t[e.axis].progress},e);{const t=iP(e);return n.attachTimeline?n.attachTimeline(t,i=>(i.pause(),qR(r=>{i.time=i.duration*r},t))):Xi}}function yH(n,i={}){var r=i,{axis:e="y"}=r,t=Xn(r,["axis"]);const s=ge({axis:e},t);return typeof n=="function"?gH(n,s):vH(n,s)}function sP(n,e){F3(!!(!e||e.current))}const xH=()=>({scrollX:zs(0),scrollY:zs(0),scrollXProgress:zs(0),scrollYProgress:zs(0)});function oP(r={}){var s=r,{container:n,target:e,layoutEffect:t=!0}=s,i=Xn(s,["container","target","layoutEffect"]);const o=pm(xH);return(t?gm:me.useEffect)(()=>(sP("target",e),sP("container",n),yH((l,{x:u,y:d})=>{o.scrollX.set(u.current),o.scrollXProgress.set(u.progress),o.scrollY.set(d.current),o.scrollYProgress.set(d.progress)},yt(ge({},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}function aP(n){const e=pm(()=>zs(n)),{isStatic:t}=me.useContext(mm);if(t){const[,i]=me.useState(n);me.useEffect(()=>e.on("change",i),[])}return e}function lP(n,e){const t=aP(e()),i=()=>t.set(e());return i(),gm(()=>{const r=()=>en.preRender(i,!1,!0),s=n.map(o=>o.on("change",r));return()=>{s.forEach(o=>o()),ps(i)}}),t}function uP(n){return typeof n=="number"?n:parseFloat(n)}function Um(n,e={}){const{isStatic:t}=me.useContext(mm),i=me.useRef(null),r=aP(Cn(n)?uP(n.get()):n),s=me.useRef(r.get()),o=me.useRef(()=>{}),a=()=>{const u=i.current;u&&u.time===0&&u.sample(si.delta),l(),i.current=XO(yt(ge({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 me.useInsertionEffect(()=>r.attach((u,d)=>t?d(u):(s.current=u,o.current=d,en.update(a),r.get()),l),[JSON.stringify(e)]),gm(()=>{if(Cn(n))return n.on("change",u=>r.set(uP(u)))},[r]),r}const _H=n=>n&&typeof n=="object"&&n.mix,AH=n=>_H(n)?n.mix:void 0;function SH(...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=nA(r,s,ge({mixer:AH(s[0])},o));return e?a(i):a}function MH(n){ld.current=[],n();const e=lP(ld.current,n);return ld.current=void 0,e}function ur(n,e,t,i){if(typeof n=="function")return MH(n);const r=typeof e=="function"?e:SH(e,t,i);return Array.isArray(n)?cP(n,r):cP([n],([s])=>r(s))}function cP(n,e){const t=pm(()=>[]);return lP(n,()=>{t.length=0;const i=n.length;for(let r=0;r{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(ge({},s))},fP=({position:n,x:e})=>n==="right"?ve.jsx(ji.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:ve.jsx("img",{src:"https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/07/3D-DataDust-1.png?w=100",alt:""})}):ve.jsx(ji.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:ve.jsx("img",{src:"https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/07/3D-DataDust-1.png?w=100",alt:""})});var dP={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&&(_=_.replace(/eval code/g,"eval").replace(/(\(eval at [^\()]*)|(\)\,.*$)/g,""));var m=_.replace(/^\s+/,"").replace(/\(eval code/g,"(").split(/\s+/).slice(1),x=this.extractLocation(m.pop()),A=m.join(" ")||void 0,w=["eval",""].indexOf(x[0])>-1?void 0:x[0];return new u({functionName:A,fileName:w,lineNumber:x[1],columnNumber:x[2],source:_})},this)},parseFFOrSafari:function(v){var S=v.stack.split(` `).filter(function(_){return!_.match(p)},this);return S.map(function(_){if(_.indexOf(" > eval")>-1&&(_=_.replace(/ line (\d+)(?: > eval line \d+)* > eval\:\d+\:\d+/g,":$1")),_.indexOf("@")===-1&&_.indexOf(":")===-1)return new u({functionName:_});var m=/((.*".+"[^@]*)?[^@]*)(?:@)/,x=_.match(m),A=x&&x[1]?x[1]:void 0,w=this.extractLocation(_.replace(m,""));return new u({functionName:A,fileName:w[0],lineNumber:w[1],columnNumber:w[2],source:_})},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,_=v.message.split(` `),m=[],x=2,A=_.length;x/,"$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:x[0],lineNumber:x[1],columnNumber:x[2],source:_})},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:""+Et()+b+Me,uuid:"style_"+b})})},Ct=function(b){return new u(function(C,L){return Y({error:L,success:C,url:""+Et()+b+de,uuid:"integrations_"+b})})},et=function(b){return new u(function(C,L){return Y({error:L,success:C,url:""+Et()+b+re,uuid:"details_"+b})})},Tt=function(b,C){return new u(function(L,k){var j=encodeURIComponent(C),ue=""+Et()+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,""),he=Ft({error:j,url:C,requestUuid:ue}),Fe=I(function(Je){k(Je),he.parentNode.removeChild(he)});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"}},_e=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")})},Mn=Vt,Yn=function(b){b===void 0&&(b=document.body);for(var C=0,L=Array.from(b.children);C=0}).sort(te)},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(Vn(j.querySelectorAll(nt)),j.parentNode?Vn(j.parentNode.querySelectorAll(Xe.join(","))).filter(function(ue){return ue===j}):[])},[])},ht=function(C){var L=C.querySelectorAll("["+Ta+"]");return Vn(L).map(function(k){return Ze([k])}).reduce(function(k,j){return k.concat(j)},[])},xt=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||!xt(window.getComputedStyle(C,null))&&b(C.parentNode)},Kt=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},$t=function(C,L){for(var k=ln(C),j=ln(L),ue=0;ue=0)return he}return!1},xn=function(C){return Vn(C).filter(function(L){return ft(L)}).filter(function(L){return Kt(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))},St=function(C){return C.tagName==="INPUT"&&C.type==="radio"},un=function(C,L){return L.filter(St).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&&St(C[0])&&C[0].name?un(C[0],C):C[0]},Fn=function(C,L){return C.length>1&&St(C[L])&&C[L].name?C.indexOf(un(C[L],C)):L},Qn=Ui,hn=function(C){return function(L){return!!L.autofocus||L.dataset&&!!L.dataset.autofocus||C.indexOf(L)>=0}},hr=function(C){return C&&C.dataset&&C.dataset.focusGuard},Js=function(C){return!hr(C)},fi=function(C,L,k,j,ue){var he=C.length,Fe=C[0],Je=C[he-1],gt=hr(k);if(!(C.indexOf(k)>=0)){var pt=L.indexOf(k),Nn=L.indexOf(j||pt),Wn=C.indexOf(j),Qt=pt-Nn,Is=L.indexOf(Fe),Ge=L.indexOf(Je),at=Fn(C,0),bt=Fn(C,he-1);if(pt===-1||Wn===-1)return C.indexOf(ue&&ue.length?Qn(ue):Qn(C));if(!Qt&&Wn>=0)return Wn;if(pt<=Is&>&&Math.abs(Qt)>1)return bt;if(pt>=Is&>&&Math.abs(Qt)>1)return at;if(Qt&&Math.abs(Qt)>1)return Wn;if(pt<=Is)return bt;if(pt>Ge)return at;if(Qt)return Math.abs(Qt)>1?Wn:(he+Wn+Qt)%he}},Ra=function(C,L,k){var j=Fr(C),ue=Fr(L),he=j[0],Fe=null;return ue.filter(Boolean).forEach(function(Je){Fe=$t(Fe||Je,Je)||Fe,k.filter(Boolean).forEach(function(gt){var pt=$t(he,gt);pt&&(!Fe||pt.contains(Fe)?Fe=pt:Fe=$t(pt,Fe))})}),Fe},Zi=function(C){return C.reduce(function(L,k){return L.concat(fn(k))},[])},Qc=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)},XM=function(C,L){var k=document&&document.activeElement,j=Yc(C).filter(Js),ue=Ra(k||C,C,j),he=st(j).filter(function(Nn){var Wn=Nn.node;return Js(Wn)});if(!(!he[0]&&(he=Ue(j).filter(function(Nn){var Wn=Nn.node;return Js(Wn)}),!he[0]))){var Fe=st([ue]).map(function(Nn){var Wn=Nn.node;return Wn}),Je=Qc(Fe,he),gt=Je.map(function(Nn){var Wn=Nn.node;return Wn}),pt=fi(gt,Fe,k,L,gt.filter(hn(Zi(j))));return pt===void 0?pt:Je[pt]}},jM=XM,qc=function(C){C.focus(),C.contentWindow&&C.contentWindow.focus()},Pa=0,Bo=!1,Zc=function(b,C){var L=jM(b,C);if(!Bo&&L){if(Pa>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}Pa++,qc(L.node),Pa--}},JM=Zc,Eh=0,$c=null,Ch=function(){return document&&document.activeElement===document.body},eu=function(){return Ch()||ba()},KM=function(){var C=!1;if(Eh){var L=Eh;eu()||(L&&!le(L)&&(C=JM(L,$c)),$c=document.activeElement)}return C},Th=function(C){return C.filter(function(L){return L}).slice(-1)[0]},Yt=function(C){Eh=C,C&&KM()},Ks=[],Ia=function(C){return Yt(Th(Ks))?(C&&C.preventDefault(),!0):!1},ty=function(){document.addEventListener("focusin",Ia)},YM=function(){document.removeEventListener("focusin",Ia)},QM={on:function(C){Ks.length===0&&ty(),Ks.indexOf(C)<0&&(Ks.push(C),Ia())},off:function(C){Ks=Ks.filter(function(L){return L!==C}),Ia(),Ks.length===0&&YM()}},qn=QM,bh=r(1),ny=r.n(bh);function Rh(b,C,L){var k=$M(b),j=es(L),ue=ts(C),he=document.createElement("div");return he.id="vidyard-focusable-element",he.tabIndex=0,j.popbox.appendChild(k.backerElement),j.popbox.appendChild(k.containingDiv),j.popbox.appendChild(ue),qi.ios()&&Yn(),document.body.appendChild(j.overlayWrapper),document.body.appendChild(he),j.closeContainer.focus(),qn.on(j.overlayWrapper),ny.a.trap(j.overlayWrapper),setTimeout(function(){j.overlayWrapper.style.opacity="1",j.overlayWrapper.style.filter="alpha(opacity=100)"},0),{container:k,lightbox:j}}function qM(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),ny.a.untrap(j),j.style.opacity="0",j.style.filter="alpha(opacity=0)";var he=function(){j.parentNode.removeChild(j)};qi.ios()&&jt(),setTimeout(he,Ce*1e3)}}function ef(b){b.style.opacity="1"}function es(b){var C=document.createElement("div"),L=document.createElement("div"),k=document.createElement("div"),j=document.createElement("div"),ue=ZM().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 ZM(){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 $M(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 ts(b){var C=_("vidyard-lightbox-image","img",b)[0].cloneNode();return C.className="",C.id="vidyard-popbox-constraint",C.alt="",C.setAttribute("aria-hidden","true"),C}var Nr,pr={};function Ph(b){var C=_("vidyard-lightbox-centering","div",b.container)[0];b.player.showLightbox=function(){ye.setLevel(b.player.uuid)("show lightbox"),iy({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 iy(b){if(!(!b.iframe||document.getElementById("vidyard-overlay"))){Nr=document.activeElement;var C=Rh(b.iframe,b.container,b.overlayZindex);b.player.iframe=C.container.iframe,b.player.on("metadata",function he(Fe){var Je=Fe[0];b.player.iframe.title=Je.name,b.player.off("metadata",he)});var L=b.player.uuid,k=C.container.iframe,j=tf(k,L,b.player),ue=tw(k,L);pr.iframeLoaded=d("load","onload",j,C.container.iframe),pr.messageHandler=d("message","onmessage",H(function(he){j(),ue(),ew(he,b.player)}),window),pr.overlayClick=d("click","onclick",function(){return Ai(b.player)},C.lightbox.overlayWrapper),pr.fixedClick=d("click","onclick",function(){return Ai(b.player)},C.lightbox.contentFixed),pr.closeKeyPress=d("keydown","onkeydown",P(function(){return Ai(b.player)}),C.lightbox.closeContainer),pr.responsivePlayerSize=d("resize","onresize",ry,window)}}function ry(){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 Bh=function(b){var C=b.dataParams,L=b.player,k=ye.setLevel(C.uuid);k("injecting lighbox embed"),L.placeholder.style.display="none";var j={ratio:m(L.placeholder)},ue=Pe(C,j),he={maxHeight:C.height?parseInt(C.height,10):null,maxWidth:C.width?parseInt(C.width,10):null,ratio:m(L.placeholder)};nf(L.container,C,he),Ph({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)),Ba(Fe,L.container)}).catch(function(Fe){k("getStyle failed, likely a network error")})},sy=Bh,Lh=/(vidyard|vystaging|hubspot)\.com$/,Dh=function(b,C,L){if(L===void 0&&(L=!1),!(!L&&(!C||!C.hasBacklink||Lh.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 he={data:{event:"Acquisition - Clicked the Backlink"},event:"sendMetricsEvent",uuid:b.uuid};wt(he,"https://"+$e(),b.iframe)},k),b.container.appendChild(k)}},La=Dh;function mr(b){var C=window.VidyardV4.integrations,L=ye.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(){ye.warn("Invalid Marketo cookie")})),L("getIntegrations"),Ct(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 ns(b){var C=ye.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 Ys=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},Fh=Ys,oy=function(){function b(C){var L=this;this.disable_popouts=1;var k=fe(K(C));Object.keys(k).forEach(function(he){L[he]=k[he]}),this.type!=="inline"&&this.type!=="lightbox"&&(x("Invalid Vidyard player embed type, defaulting to inline.","warn"),this.type="inline"),this.v=$,this.disable_popouts=1,this.custom_id=this.custom_id||ie("vycustom_id"),this.vyemail=this.vyemail||ie("vyemail"),this.vysfid=this.vysfid||ie("vysfid"),this.vyetoken=this.vyetoken||ie("vyetoken");var j=ie("vyac"),ue=ie("vyplayer");j&&ue&&ue===this.uuid?this.access_code=j:j&&ue&&x("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}(),is=oy;function Qs(b){b===void 0&&(b=_("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){x("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,he=C.videoIndex,Fe=C.chapterIndex,Je=C.eventId;if(!Je){x("Missing arguments. Need eventId");return}Fe>=0&&x("Parameter chapterIndex is deprecated. We recommend to use videoIndex instead.");var gt=0;gt=Fe||gt,gt=he||gt,this._message({chapterIndex:gt,duration:ue,event:"addEvent",id:Je,start:k})},b.prototype.getCurrentChapter=function(){return x("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){x("Player is not ready yet! No messages can be recieved.","error");return}wt(ay({},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,he=Math.floor(ue/1e3),Fe=k.timeWatched/he*100;Fe>=k.thresholds[k.thresholds.length-1];)k.callback({chapter:L,event:k.thresholds.pop(),player:b,videoIndex:L})}}}function hy(b,C,L){gr(b,C,L);var k=function(j){return Do(b,j)};return b.on("timeupdate",k),{player:b,removeEventListeners:function(){b.off("timeupdate",k),Ps(b)}}}function Uh(b,C,L){var k;C===void 0&&(C=[1,25,50,75,90]);var j=[],ue=L?(k={},k[L.uuid]=L,k):Oh(),he=Fa(C),Fe=function(gt){if(ue.hasOwnProperty(gt)&>.length>0&&ue[gt]!==""){var pt=hy(ue[gt],b,he);j.push(pt)}else x(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&&x(function(){return console.warn("No Vidyard Players found. (include this script below player embed codes)")}),j}function Oh(){try{return window.Vidyard.players()}catch(b){return x(function(){return console.error("The Vidyard Player API must be loaded before this script can execute")}),{}}}function $i(){for(var b=[],C=0;C=0&&p.splice(F,1)}function x(T){var F=document.createElement("style");return T.attrs.type===void 0&&(T.attrs.type="text/css"),w(F,T.attrs),_(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),_(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,K,ie;if(F.transform&&T.css)if(ie=F.transform(T.css),ie)T.css=ie;else return function(){};if(F.singleton){var Z=h++;X=d||(d=x(F)),J=D.bind(null,X,Z,!1),K=D.bind(null,X,Z,!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),K=function(){m(X),X.href&&URL.revokeObjectURL(X.href)}):(X=x(F),J=N.bind(null,X),K=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 K()}}var P=function(){var T=[];return function(F,X){return T[F]=X,T.filter(Boolean).join(` `)}}();function D(T,F,X,J){var K=X?"":J.css;if(T.styleSheet)T.styleSheet.cssText=P(F,K);else{var ie=document.createTextNode(K),Z=T.childNodes;Z[F]&&T.removeChild(Z[F]),Z.length?T.insertBefore(ie,Z[F]):T.appendChild(ie)}}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,K=X.sourceMap,ie=F.convertToAbsoluteUrls===void 0&&K;(F.convertToAbsoluteUrls||ie)&&(J=g(J)),K&&(J+=` /*# sourceMappingURL=data:application/json;base64,`+btoa(unescape(encodeURIComponent(JSON.stringify(K))))+" */");var Z=new Blob([J],{type:"text/css"}),fe=T.href;T.href=URL.createObjectURL(Z),fe&&URL.revokeObjectURL(fe)}},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]:[],_=v.previousSibling;return _?(S.push(_),l(_,S)):S}function u(v){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],_=v.nextSibling;return _?(S.push(_),u(_,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]:[],_=v.parentNode;return _?(S.push(_),h(_,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&&_())}function _(){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))}])})})(dP);var Om=dP.exports;const wH=({api:n,aspect:e,maxHeight:t,maxWidth:i,params:r,playbackUrl:s,type:o,uuid:a})=>{const[l,u]=me.useState(!1),[d,h]=me.useState(!0),p=me.useRef(null),g=me.useRef(void 0),v=me.useRef(!1);return me.useEffect(()=>{if(!(!p.current||v.current))return v.current=!0,s&&Om._debug.setPlaybackURL(s),Om.api.renderPlayer(ge({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]),ve.jsx(AA,{fallback:l,children:ve.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?ve.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})})},EH=({attributes:n,blade_id:e,blade_position:t,testHeadline:i})=>{var B,T;const{headline:r="",description:s="",link_1:o,link_2:a,media:l}=n!=null?n:{},u=me.useRef(null),{scrollYProgress:d}=oP({target:u,offset:["start start","end start"]}),h=Um(d,{stiffness:140,damping:30,restDelta:.001}),p=Um(d,{stiffness:220,damping:100,restDelta:.002}),g=Um(d,{stiffness:200,damping:30}),v=ur(d,[0,1],["0%","300%"]),S=ur(d,[0,1],["0%","100%"]),_=ur(g,[0,1],["0%","350%"]),m=ur(g,[.18,.25],["100%","0%"]),x=ur(h,[0,.6],["0px","200px"]),A=ur(h,[0,.7],["0px","400px"]),w=ur(h,[0,.5],["0px","300px"]),I=ur(p,[0,.8],["0px","-200px"]),P=ur(p,[0,.7],["0px","-400px"]),D=ur(p,[0,.5],["0px","-300px"]),N=me.lazy(()=>Promise.resolve().then(()=>qX));return ve.jsxs("div",{ref:u,className:"relative grid min-h-screen w-screen place-items-center overflow-hidden mb-16",children:[ve.jsx(ji.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:S,backgroundPosition:"bottom"},className:"bg-blur absolute inset-0 z-0 opacity-20"}),ve.jsx(ji.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:v,backgroundPosition:"bottom"},className:"bg-blur visible absolute inset-0 z-0 opacity-20 max-sm:hidden"}),ve.jsx(ji.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:S,backgroundPosition:"bottom",backgroundRepeat:"no-repeat"},className:"bg-blur z-1 visible absolute inset-0 opacity-20"}),ve.jsxs("div",{className:"container relative flex flex-col items-center justify-start gap-10",children:[ve.jsx(AA,{fallback:null,children:ve.jsxs(me.Suspense,{fallback:ve.jsx(fP,{position:"left",x:I}),children:[ve.jsx(ji.div,{style:{x:I},className:"data-dust absolute visible left-[2%] top-[20%] z-30 w-[60px] sm:w-[160px] max-sm:hidden",children:ve.jsx(N,{progress:d,direction:"left",size:"lg"})}),ve.jsx(ji.div,{style:{x:D},className:"data-dust absolute left-[-1%] top-[30%] z-30 w-[60px] sm:w-[160px] visible max-sm:hidden",children:ve.jsx(N,{progress:d,direction:"right",size:"md"})}),ve.jsx(ji.div,{style:{x:P},className:"data-dust absolute left-[5%] top-[28%] z-30 w-[60px] sm:w-[160px] visible max-sm:hidden",children:ve.jsx(N,{progress:d,direction:"right",size:"sm"})})]})}),ve.jsxs(ji.div,{className:"flex flex-col items-center justify-center max-sm:px-1",style:{y:_,opacity:m},children:[ve.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!=null?i:r}}),ve.jsx("p",{className:"mt-8 text-center font-sans text-[1rem] text-white sm:text-[1.3rem]",dangerouslySetInnerHTML:{__html:s}}),ve.jsxs("div",{className:"flex items-center justify-center gap-4 mt-10",children:[(o==null?void 0:o.label)&&ve.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-sfnavy px-[32px] py-4 font-semibold text-white antialiased hover:bg-sfprimary hover:text-white",onClick:F=>{var X,J,K;return Kr(F,e,(K=(J=n==null?void 0:n.headline)!=null?J:(X=n==null?void 0:n.link_1)==null?void 0:X.label)!=null?K:"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}),(a==null?void 0:a.label)&&ve.jsx("a",{href:a==null?void 0:a.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:F=>{var X,J,K;return Kr(F,e,(K=(J=n==null?void 0:n.headline)!=null?J:(X=n==null?void 0:n.link_1)==null?void 0:X.label)!=null?K:"missing headline",t)},target:a==null?void 0:a.target,"aria-label":a==null?void 0:a.ariaLabel,children:a==null?void 0:a.label})]})]}),ve.jsxs("div",{className:"video-wrapper w-full relative",children:[ve.jsx(AA,{children:ve.jsxs(me.Suspense,{fallback:ve.jsx(fP,{position:"right",x:w}),children:[ve.jsx(ji.div,{style:{x},className:"data-dust absolute right-[8%] top-[-8%] z-30 w-[50px] sm:w-[150px] visible max-sm:hidden",children:ve.jsx(N,{progress:d,direction:"right",size:"lg"})}),ve.jsx(ji.div,{style:{x:A},className:"data-dust absolute right-[5%] top-[10%] z-30 w-[50px] sm:w-[150px] visible max-sm:hidden",children:ve.jsx(N,{progress:d,direction:"left",size:"md"})}),ve.jsx(ji.div,{style:{x:w},className:"data-dust absolute right-[1%] top-[1%] z-30 w-[50px] sm:w-[150px] visible max-sm:hidden",children:ve.jsx(N,{progress:d,direction:"left",size:"sm"})})]})}),ve.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:((B=l==null?void 0:l.video)==null?void 0:B.uuid)!==void 0?ve.jsx(wH,{uuid:(T=l==null?void 0:l.video)==null?void 0:T.uuid,maxWidth:"940px",maxHeight:"506px",type:"inline"}):null})]})]})]})},CH=({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 ve.jsxs("section",{className:"container mx-auto px-8 mt-12 py-8 text-white rounded-2xl max-w-[1280px]",children:[ve.jsxs("div",{className:"text-center mb-12 mx-auto ",children:[ve.jsx("h2",{className:"text-3xl sm:text-5xl font-display text-white mx-0 sm:mx-6",children:n==null?void 0:n.headline}),ve.jsx("p",{className:"mt-4 text-lg font-sans",children:n==null?void 0:n.description}),(n==null?void 0:n.link_1)&&ve.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 Kr(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:ve.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)&&ve.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 Kr(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:ve.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})})]}),ve.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 ve.jsxs(ji.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:[ve.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"}),ve.jsxs("div",{className:"flex flex-col h-full gap-4 px-8 py-8",children:[ve.jsx("a",{href:u.link_1.url,"aria-label":u.headline,target:u.link_1.target,onClick:S=>Kr(S,e,u.headline,i),children:ve.jsx("h3",{className:"text-2xl font-display font-semibold mb-2 text-left text-sfnavy",children:u.headline})}),ve.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)&&ve.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=>Kr(S,e,u.headline,i),children:u.link_1.label})]})]},l)})})]})},TH=({i:n,attributes:e,progress:t,targetScale:i,range:r,id:s,blade_position:o})=>{var m,x,A,w;const a=me.useRef(null),l=s;Um(t,{stiffness:300,damping:50,restDelta:.001});const u=ur(t,r,[1,i]),{headline:d,link_1:h,link_2:p,eyebrow:g,description:v,media:S,blade_layout:_}=e||{};return ve.jsx(ji.section,{ref:a,style:{scale:u},className:"card-section relative mx-auto flex w-full",children:ve.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`} ${_==="right"?"sm:flex-row":"sm:flex-row-reverse"}`,children:[ve.jsx("div",{className:"w-full flex items-center justify-center sm:w-1/2",children:ve.jsx("img",{className:"object-contain w-full h-full max-h-[300px] sm:max-h-[500px]",src:(x=S==null?void 0:S.image)==null?void 0:x.src,alt:((A=S==null?void 0:S.image)==null?void 0:A.alt)||""})}),ve.jsxs("div",{className:"copy flex w-full flex-col items-start justify-center gap-3 sm:gap-6 sm:w-1/2",children:[ve.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:[ve.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]}),ve.jsx("h2",{className:"font-display text-2xl sm:text-clamp text-white",children:d}),ve.jsx("div",{className:"stacking-card__desc font-sans text-base text-white sm:text-[1.2rem]",dangerouslySetInnerHTML:{__html:v||""}}),ve.jsxs("div",{className:"flex w-full items-center justify-start gap-6",children:[h&&ve.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 Kr(I,l,(P=d!=null?d:h.label)!=null?P:"missing headline",o)},children:h==null?void 0:h.label}),p&&ve.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 Kr(I,l,(P=d!=null?d:p.label)!=null?P:"missing headline",o)},children:p==null?void 0:p.label})]})]})]})},n)},bH=({attributes:n,progress:e,blade_id:t,blade_position:i})=>{const{headline:r,description:s,blade_layout:o}=n||{},a=ur(e,[.67,.69],["100%","0%"]),l=ur(e,[.67,.69],["0px","-30px"]);return n?ve.jsxs(ji.div,{className:`text-${o} w-full mb-16`,style:{opacity:a,zIndex:0,y:l},children:[ve.jsx("h2",{className:"text-white text-4xl sm:text-5xl font-semibold mx-4 mb-4 font-display",children:r}),ve.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&&ve.jsx("a",{href:n.link_1.url,className:"text-white text-base font-bold font-sans leading-normal mr-4",onClick:u=>Kr(u,t,n.headline,i),"aria-label":n.link_1.ariaLabel,children:ve.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&&ve.jsx("a",{href:n.link_2.url,className:"text-white text-base font-bold font-sans leading-normal mr-4",onClick:u=>Kr(u,t,n.headline,i),"aria-label":n.link_2.ariaLabel,children:ve.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},RH=({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 ve.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:[ve.jsxs("div",{className:"max-sm:w-full sm:w-2/3 flex flex-col gap-4",children:[ve.jsx("h2",{className:"font-display text-4xl sm:text-5xl text-white",children:i}),ve.jsx("div",{className:"blade__description font-sans text-base text-white sm:text-[1.2rem]",dangerouslySetInnerHTML:{__html:o!=null?o:""}}),ve.jsxs("div",{className:"flex w-full items-center justify-start gap-6",children:[r!==void 0?ve.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=>Kr(u,e,i!=null?i:"missing headline",t),children:r==null?void 0:r.label}):null,s!==void 0?ve.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=>Kr(u,e,i!=null?i:"missing headline",t),children:s==null?void 0:s.label}):null]})]}),ve.jsx("div",{className:"max-sm:w-full sm:md:w-1/3 flex flex-col",children:ve.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})})]})},hP={uk:"en-gb",au:"en-au",jp:"ja-jp",ca:"en-ca","fr-ca":"fr-ca",de:"de-de",fr:"fr-fr",br:"pt-br",eu:"en-eu",ap:"en-ap",in:"en-in",nl:"nl-nl",it:"it-it",es:"es-es",mx:"es-mx",cn:"zh-cn",se:"sv-se","de-ch":"de-ch","fr-ch":"fr-ch",dk:"da-dk",fi:"fi-fi",kr:"ko-kr","nl-be":"nl-be",th:"th-th",tw:"zh-tw",latam:"es-latam",no:"no-no",pl:"pl-pl",tr:"tr-tr"},PH=n=>{const t=new URL(n).pathname,i=t.split("/")[1];if(i&&i in hP){const r=hP[i],s=t.replace(`/${i}`,"").replace(/\/$/,"");return`https://wp.salesforce.com/${r}/wp-json/c360/experience/v2/page?slug=${s}`}return`https://wp.salesforce.com/en-us/wp-json/c360/experience/v2/page?slug=${t.replace(/\/$/,"")}`},IH=me.lazy(()=>Promise.resolve().then(()=>ZX));function BH({bladeCount:n,testHeadline:e}){var g,v,S;const[t,i]=me.useState(),[r,s]=me.useState(!0);me.useEffect(()=>{const _=PH(window.location.href);_?fetch(_).then(m=>m.json()).then(m=>{const x=m.blades.filter(A=>A.name!=="sf/notification"&&A.name!=="sf/open").slice(0,n!=null?n:9).map((A,w)=>yt(ge({},A),{blade_position:w,blade_id:A.id}));i(x),s(!1)}):(console.error("appUrl is not defined"),s(!1))},[n]),me.useEffect(()=>{t==null||t.forEach(_=>{const m=document.getElementById(_.id);m&&(m.remove(),m.remove())})},[t]);const o=(g=t==null?void 0:t.filter(_=>_.name==="sf/oneup"))!=null?g:[],a=t==null?void 0:t.find(_=>_.name==="sf/marquee"),l=t==null?void 0:t.find(_=>_.name==="sf/promotion"),u=t==null?void 0:t.find(_=>_.name==="sf/text"),d=t==null?void 0:t.find(_=>_.name==="sf/nup"),h=me.useRef(null),{scrollYProgress:p}=oP({target:h,offset:["start start","end end"]});return ve.jsx("div",{className:"gt-dark-bg min-h-screen sm:rounded-b-[5rem] rounded-b-[3rem]",children:r?ve.jsx(IH,{}):ve.jsxs(ve.Fragment,{children:[ve.jsx(EH,{attributes:a==null?void 0:a.attributes,blade_id:a.blade_id,blade_position:a.blade_position,testHeadline:e}),ve.jsxs(me.Suspense,{fallback:ve.jsx("div",{children:"Loading..."}),children:[ve.jsx(RH,{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}),ve.jsx("div",{className:"relative pb-10",children:ve.jsx(CH,{attributes:d.attributes,blade_id:d.blade_id,media_items:d.media_items,blade_position:(S=d.blade_position)!=null?S:0})}),ve.jsxs("div",{ref:h,className:"parallax-section relative",children:[ve.jsx(bH,{attributes:u.attributes,blade_id:u.blade_id,blade_position:u.blade_position,progress:p}),o==null?void 0:o.map((_,m)=>ve.jsx(TH,{attributes:_.attributes,blade_id:_.id,i:m,range:[m*.25,1],progress:p,blade_position:_.blade_position,targetScale:1},m))]})]})]})})}const km=document.getElementById("wps-dc-overview-ws"),LH=(km==null?void 0:km.dataset)||{};$y.createRoot(km).render(ve.jsx(MF.StrictMode,{children:ve.jsx(BH,ge({},LH))}));function DH(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 FH(n,{whileTap:e,onTapStart:t,onTap:i,onTapCancel:r,onPointerDown:s},o){const a=i||t||r||e,l=me.useRef(!1),u=me.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),!B_()}function p(v,S){h()&&(i==null||i(v,S))}function g(v,S){h()&&(r==null||r(v,S))}return{onPointerDown:zb((v,S)=>{var _;if(d(),l.current)return;l.current=!0;const m={passive:!(t||i||r||s)};u.current=Ku(fl(window,"pointerup",p,m),fl(window,"pointercancel",g,m)),(_=o.animationState)===null||_===void 0||_.setActive("whileTap",!0),s==null||s(v),t==null||t(v,S)})}}const NH=(n,e,t,i,r,s)=>{const o=UH(e);return me.createElement(n,ge(ge(yt(ge(ge({ref:t},lT(e,!1,!1)),o),{onUpdate:e.onInstanceUpdate}),DH(r,e,s)),FH(r,e,s)))};function UH(n){return me.useMemo(()=>{const e={};for(const t in n){const i=n[t];Cn(i)?e[t]=i.get():Array.isArray(i)&&i.includes(Cn)&&(e[t]=i.map(id))}return e},[])}/** * @license * Copyright 2010-2024 Three.js Authors * SPDX-License-Identifier: MIT */const _d="167",OH={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},kH={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},pP=0,SA=1,mP=2,zH=3,gP=0,zm=1,Ad=2,gs=3,Hs=0,Ji=1,vs=2,po=0,pl=1,MA=2,wA=3,EA=4,vP=5,aa=100,yP=101,xP=102,_P=103,AP=104,SP=200,MP=201,wP=202,EP=203,Hm=204,Gm=205,CP=206,TP=207,bP=208,RP=209,PP=210,IP=211,BP=212,LP=213,DP=214,FP=0,NP=1,UP=2,Sd=3,OP=4,kP=5,zP=6,HP=7,Md=0,GP=1,VP=2,Gs=0,WP=1,XP=2,jP=3,CA=4,JP=5,KP=6,YP=7,TA="attached",QP="detached",Vm=300,mo=301,la=302,wd=303,Ed=304,Zu=306,ua=1e3,br=1001,$u=1002,oi=1003,Wm=1004,HH=1004,ml=1005,GH=1005,zn=1006,ec=1007,VH=1007,Yr=1008,WH=1008,ys=1009,bA=1010,RA=1011,tc=1012,Xm=1013,go=1014,cr=1015,nc=1016,jm=1017,Jm=1018,gl=1020,PA=35902,IA=1021,BA=1022,Ri=1023,LA=1024,DA=1025,vl=1026,yl=1027,Km=1028,Cd=1029,FA=1030,Ym=1031,XH=1032,Qm=1033,Td=33776,bd=33777,Rd=33778,Pd=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,Id=36492,yg=36494,xg=36495,NA=36283,_g=36284,Ag=36285,Sg=36286,qP=2200,ZP=2201,$P=2202,ic=2300,rc=2301,Mg=2302,xl=2400,_l=2401,Bd=2402,wg=2500,UA=2501,eI=0,OA=1,Eg=2,tI=3200,nI=3201,jH=3202,JH=3203,ca=0,iI=1,vo="",Qr="srgb",yo="srgb-linear",Cg="display-p3",Ld="display-p3-linear",Dd="linear",vn="srgb",Fd="rec709",Nd="p3",KH=0,Al=7680,YH=7681,QH=7682,qH=7683,ZH=34055,$H=34056,eG=5386,tG=512,nG=513,iG=514,rG=515,sG=516,oG=517,aG=518,kA=519,rI=512,sI=513,oI=514,zA=515,aI=516,lI=517,uI=518,cI=519,Ud=35044,lG=35048,uG=35040,cG=35045,fG=35049,dG=35041,hG=35046,pG=35050,mG=35042,gG="100",HA="300 es",Vs=2e3,Od=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 Hn(n,e,t){return Math.max(e,Math.min(t,n))}function GA(n,e){return(n%e+e)%e}function vG(n,e,t,i,r){return i+(n-e)*(r-i)/(t-e)}function yG(n,e,t){return n!==e?(t-n)/(e-n):0}function kd(n,e,t){return(1-t)*n+t*e}function xG(n,e,t,i){return kd(n,e,1-Math.exp(-t*i))}function _G(n,e=1){return e-Math.abs(GA(n,e*2)-e)}function AG(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function SG(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function MG(n,e){return n+Math.floor(Math.random()*(e-n+1))}function wG(n,e){return n+Math.random()*(e-n)}function EG(n){return n*(.5-Math.random())}function CG(n){n!==void 0&&(fI=n);let e=fI+=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 TG(n){return n*Sl}function bG(n){return n*sc}function RG(n){return(n&n-1)===0&&n!==0}function PG(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function IG(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function BG(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 Ki(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 Bt(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 dI={DEG2RAD:Sl,RAD2DEG:sc,generateUUID:Rr,clamp:Hn,euclideanModulo:GA,mapLinear:vG,inverseLerp:yG,lerp:kd,damp:xG,pingpong:_G,smoothstep:AG,smootherstep:SG,randInt:MG,randFloat:wG,randFloatSpread:EG,seededRandom:CG,degToRad:TG,radToDeg:bG,isPowerOfTwo:RG,ceilPowerOfTwo:PG,floorPowerOfTwo:IG,setQuaternionFromProperEuler:BG,normalize:Bt,denormalize:Ki};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(Hn(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 Lt{constructor(e,t,i,r,s,o,a,l,u){Lt.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],_=r[3],m=r[6],x=r[1],A=r[4],w=r[7],I=r[2],P=r[5],D=r[8];return s[0]=o*S+a*x+l*I,s[3]=o*_+a*A+l*P,s[6]=o*m+a*w+l*D,s[1]=u*S+d*x+h*I,s[4]=u*_+d*A+h*P,s[7]=u*m+d*w+h*D,s[2]=p*S+g*x+v*I,s[5]=p*_+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(VA.makeScale(e,t)),this}rotate(e){return this.premultiply(VA.makeRotation(-e)),this}translate(e,t){return this.premultiply(VA.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 VA=new Lt;function hI(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}const LG={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function oc(n,e){return new LG[n](e)}function zd(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function pI(){const n=zd("canvas");return n.style.display="block",n}const mI={};function ac(n){n in mI||(mI[n]=!0,console.warn(n))}function DG(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 gI=new Lt().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),vI=new Lt().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),Hd={[yo]:{transfer:Dd,primaries:Fd,luminanceCoefficients:[.2126,.7152,.0722],toReference:n=>n,fromReference:n=>n},[Qr]:{transfer:vn,primaries:Fd,luminanceCoefficients:[.2126,.7152,.0722],toReference:n=>n.convertSRGBToLinear(),fromReference:n=>n.convertLinearToSRGB()},[Ld]:{transfer:Dd,primaries:Nd,luminanceCoefficients:[.2289,.6917,.0793],toReference:n=>n.applyMatrix3(vI),fromReference:n=>n.applyMatrix3(gI)},[Cg]:{transfer:vn,primaries:Nd,luminanceCoefficients:[.2289,.6917,.0793],toReference:n=>n.convertSRGBToLinear().applyMatrix3(vI),fromReference:n=>n.applyMatrix3(gI).convertLinearToSRGB()}},FG=new Set([yo,Ld]),tn={enabled:!0,_workingColorSpace:yo,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(n){if(!FG.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=Hd[e].toReference,r=Hd[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 Hd[n].primaries},getTransfer:function(n){return n===vo?Dd:Hd[n].transfer},getLuminanceCoefficients:function(n,e=this._workingColorSpace){return n.fromArray(Hd[e].luminanceCoefficients)}};function lc(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function WA(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let uc;class yI{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement=="undefined")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{uc===void 0&&(uc=zd("canvas")),uc.width=e.width,uc.height=e.height;const i=uc.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=uc}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=zd("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 ua:e.x=e.x-Math.floor(e.x);break;case br:e.x=e.x<0?0:1;break;case $u: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 ua:e.y=e.y-Math.floor(e.y);break;case br:e.y=e.y<0?0:1;break;case $u: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++}}Tn.DEFAULT_IMAGE=null,Tn.DEFAULT_MAPPING=Vm,Tn.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],_=l[6],m=l[10];if(Math.abs(d-p)<.01&&Math.abs(h-S)<.01&&Math.abs(v-_)<.01){if(Math.abs(d+p)<.1&&Math.abs(h+S)<.1&&Math.abs(v+_)<.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+_)/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 x=Math.sqrt((_-v)*(_-v)+(h-S)*(h-S)+(p-d)*(p-d));return Math.abs(x)<.001&&(x=1),this.x=(_-v)/x,this.y=(h-S)/x,this.z=(p-d)/x,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 xI 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:zn,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},i);const s=new Tn(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(_*P)/I,a=Math.sin(a*P)/I}const w=a*x;if(l=l*_+p*w,u=u*_+g*w,d=d*_+v*w,h=h*_+S*w,_===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(Hn(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(_I.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(_I.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 JA.copy(this).projectOnVector(e),this.sub(JA)}reflect(e){return this.sub(JA.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(Hn(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 JA=new G,_I=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,_s),_s.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(Gd),Rg.subVectors(this.max,Gd),cc.subVectors(e.a,Gd),fc.subVectors(e.b,Gd),dc.subVectors(e.c,Gd),fa.subVectors(fc,cc),da.subVectors(dc,fc),wl.subVectors(cc,dc);let t=[0,-fa.z,fa.y,0,-da.z,da.y,0,-wl.z,wl.y,fa.z,0,-fa.x,da.z,0,-da.x,wl.z,0,-wl.x,-fa.y,fa.x,0,-da.y,da.x,0,-wl.y,wl.x,0];return!KA(t,cc,fc,dc,Rg)||(t=[1,0,0,0,1,0,0,0,1],!KA(t,cc,fc,dc,Rg))?!1:(Pg.crossVectors(fa,da),t=[Pg.x,Pg.y,Pg.z],KA(t,cc,fc,dc,Rg))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,_s).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(_s).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],_s=new G,bg=new Bi,cc=new G,fc=new G,dc=new G,fa=new G,da=new G,wl=new G,Gd=new G,Rg=new G,Pg=new G,El=new G;function KA(n,e,t,i,r){for(let s=0,o=n.length-3;s<=o;s+=3){El.fromArray(n,s);const a=r.x*Math.abs(El.x)+r.y*Math.abs(El.y)+r.z*Math.abs(El.z),l=e.dot(El),u=t.dot(El),d=i.dot(El);if(Math.max(-Math.max(l,u,d),Math.min(l,u,d))>a)return!1}return!0}const zG=new Bi,Vd=new G,YA=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):zG.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;Vd.subVectors(e,this.center);const t=Vd.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),r=(i-this.radius)*.5;this.center.addScaledVector(Vd,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):(YA.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Vd.copy(e.center).add(YA)),this.expandByPoint(Vd.copy(e.center).sub(YA))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Ao=new G,QA=new G,Ig=new G,ha=new G,qA=new G,Bg=new G,ZA=new G;class hc{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){QA.copy(e).add(t).multiplyScalar(.5),Ig.copy(t).sub(e).normalize(),ha.copy(this.origin).sub(QA);const s=e.distanceTo(t)*.5,o=-this.direction.dot(Ig),a=ha.dot(this.direction),l=-ha.dot(Ig),u=ha.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(QA).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){qA.subVectors(t,e),Bg.subVectors(i,e),ZA.crossVectors(qA,Bg);let o=this.direction.dot(ZA),a;if(o>0){if(r)return null;a=1}else if(o<0)a=-1,o=-o;else return null;ha.subVectors(this.origin,e);const l=a*this.direction.dot(Bg.crossVectors(ha,Bg));if(l<0)return null;const u=a*this.direction.dot(qA.cross(ha));if(u<0||l+u>o)return null;const d=-a*ha.dot(ZA);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,_){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,_)}set(e,t,i,r,s,o,a,l,u,d,h,p,g,v,S,_){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]=_,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/pc.setFromMatrixColumn(e,0).length(),s=1/pc.setFromMatrixColumn(e,1).length(),o=1/pc.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(HG,e,GG)}lookAt(e,t,i){const r=this.elements;return Pr.subVectors(e,t),Pr.lengthSq()===0&&(Pr.z=1),Pr.normalize(),pa.crossVectors(i,Pr),pa.lengthSq()===0&&(Math.abs(i.z)===1?Pr.x+=1e-4:Pr.z+=1e-4,Pr.normalize(),pa.crossVectors(i,Pr)),pa.normalize(),Lg.crossVectors(Pr,pa),r[0]=pa.x,r[4]=Lg.x,r[8]=Pr.x,r[1]=pa.y,r[5]=Lg.y,r[9]=Pr.y,r[2]=pa.z,r[6]=Lg.z,r[10]=Pr.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],_=i[10],m=i[14],x=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],K=r[2],ie=r[6],Z=r[10],fe=r[14],z=r[3],$=r[7],ne=r[11],de=r[15];return s[0]=o*P+a*T+l*K+u*z,s[4]=o*D+a*F+l*ie+u*$,s[8]=o*N+a*X+l*Z+u*ne,s[12]=o*B+a*J+l*fe+u*de,s[1]=d*P+h*T+p*K+g*z,s[5]=d*D+h*F+p*ie+g*$,s[9]=d*N+h*X+p*Z+g*ne,s[13]=d*B+h*J+p*fe+g*de,s[2]=v*P+S*T+_*K+m*z,s[6]=v*D+S*F+_*ie+m*$,s[10]=v*N+S*X+_*Z+m*ne,s[14]=v*B+S*J+_*fe+m*de,s[3]=x*P+A*T+w*K+I*z,s[7]=x*D+A*F+w*ie+I*$,s[11]=x*N+A*X+w*Z+I*ne,s[15]=x*B+A*J+w*fe+I*de,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],_=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)+_*(+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],_=e[14],m=e[15],x=h*_*u-S*p*u+S*l*g-a*_*g-h*l*m+a*p*m,A=v*p*u-d*_*u-v*l*g+o*_*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*_-o*h*_,P=t*x+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]=x*D,e[1]=(S*p*s-h*_*s-S*r*g+i*_*g+h*r*m-i*p*m)*D,e[2]=(a*_*s-S*l*s+S*r*u-i*_*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*_*s-v*p*s+v*r*g-t*_*g-d*r*m+t*p*m)*D,e[6]=(v*l*s-o*_*s-v*r*u+t*_*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*_+t*h*_)*D,e[14]=(v*a*r-o*S*r-v*i*l+t*S*l+o*i*_-t*a*_)*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,_=o*h,m=a*h,x=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=pc.set(r[0],r[1],r[2]).length();const o=pc.set(r[4],r[5],r[6]).length(),a=pc.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],As.copy(this);const u=1/s,d=1/o,h=1/a;return As.elements[0]*=u,As.elements[1]*=u,As.elements[2]*=u,As.elements[4]*=d,As.elements[5]*=d,As.elements[6]*=d,As.elements[8]*=h,As.elements[9]*=h,As.elements[10]*=h,t.setFromRotationMatrix(As),i.x=s,i.y=o,i.z=a,this}makePerspective(e,t,i,r,s,o,a=Vs){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===Vs)g=-(o+s)/(o-s),v=-2*o*s/(o-s);else if(a===Od)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=Vs){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===Vs)v=(o+s)*h,S=-2*h;else if(a===Od)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 pc=new G,As=new mt,HG=new G(0,0,0),GG=new G(1,1,1),pa=new G,Lg=new G,Pr=new G,AI=new mt,SI=new Ii;class fr{constructor(e=0,t=0,i=0,r=fr.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(Hn(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(-Hn(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(Hn(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(-Hn(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(Hn(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(-Hn(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 AI.makeRotationFromQuaternion(e),this.setFromRotationMatrix(AI,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return SI.setFromEuler(this),this.setFromQuaternion(SI,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}}fr.DEFAULT_ORDER="XYZ";class Cl{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){Ss.subVectors(r,t),Mo.subVectors(i,t),eS.subVectors(e,t);const o=Ss.dot(Ss),a=Ss.dot(Mo),l=Ss.dot(eS),u=Mo.dot(Mo),d=Mo.dot(eS),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 Ss.subVectors(i,t),Mo.subVectors(e,t),Ss.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 Ss.subVectors(this.c,this.b),Mo.subVectors(this.a,this.b),Ss.cross(Mo).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Ir.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Ir.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,r,s){return Ir.getInterpolation(e,this.a,this.b,this.c,t,i,r,s)}containsPoint(e){return Ir.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Ir.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;vc.subVectors(r,i),yc.subVectors(s,i),tS.subVectors(e,i);const l=vc.dot(tS),u=yc.dot(tS);if(l<=0&&u<=0)return t.copy(i);nS.subVectors(e,r);const d=vc.dot(nS),h=yc.dot(nS);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(vc,o);iS.subVectors(e,s);const g=vc.dot(iS),v=yc.dot(iS);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(yc,a);const _=d*v-g*h;if(_<=0&&h-d>=0&&g-v>=0)return bI.subVectors(s,r),a=(h-d)/(h-d+(g-v)),t.copy(r).addScaledVector(bI,a);const m=1/(_+S+p);return o=S*m,a=p*m,t.copy(i).addScaledVector(vc,o).addScaledVector(yc,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const RI={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},ma={h:0,s:0,l:0},Fg={h:0,s:0,l:0};function rS(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 ze{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=Qr){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=GA(e,1),t=Hn(t,0,1),i=Hn(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=rS(o,s,e+1/3),this.g=rS(o,s,e),this.b=rS(o,s,e-1/3)}return tn.toWorkingColorSpace(this,r),this}setStyle(e,t=Qr){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=Qr){const i=RI[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=lc(e.r),this.g=lc(e.g),this.b=lc(e.b),this}copyLinearToSRGB(e){return this.r=WA(e.r),this.g=WA(e.g),this.b=WA(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Qr){return tn.fromWorkingColorSpace(Li.copy(this),e),Math.round(Hn(Li.r*255,0,255))*65536+Math.round(Hn(Li.g*255,0,255))*256+Math.round(Hn(Li.b*255,0,255))}getHexString(e=Qr){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!==pl&&(i.blending=this.blending),this.side!==Hs&&(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!==aa&&(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!==Sd&&(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!==kA&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Al&&(i.stencilFail=this.stencilFail),this.stencilZFail!==Al&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==Al&&(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 Br extends ai{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new ze(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 fr,this.combine=Md,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=KG();function KG(){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 dr(n){Math.abs(n)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),n=Hn(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 Xd(n){const e=n>>10;return Eo.uint32View[0]=Eo.mantissaTable[Eo.offsetTable[e]+(n&1023)]+Eo.exponentTable[e],Eo.floatView[0]}const YG={toHalfFloat:dr,fromHalfFloat:Xd},ei=new G,Ng=new Ae;class Zt{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=Ud,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=cr,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return ac("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;sjy(e.far-e.near,2)))&&(PI.copy(s).invert(),Tl.copy(e.ray).applyMatrix4(PI),!(i.boundingBox!==null&&Tl.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,Tl)))}_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,_c),n.getVertexPosition(l,Ac),n.getVertexPosition(u,Sc);const d=i4(n,e,t,i,_c,Ac,Sc,Gg);if(d){r&&(kg.fromBufferAttribute(r,a),zg.fromBufferAttribute(r,l),Hg.fromBufferAttribute(r,u),d.uv=Ir.getInterpolation(Gg,_c,Ac,Sc,kg,zg,Hg,new Ae)),s&&(kg.fromBufferAttribute(s,a),zg.fromBufferAttribute(s,l),Hg.fromBufferAttribute(s,u),d.uv1=Ir.getInterpolation(Gg,_c,Ac,Sc,kg,zg,Hg,new Ae)),o&&(BI.fromBufferAttribute(o,a),LI.fromBufferAttribute(o,l),DI.fromBufferAttribute(o,u),d.normal=Ir.getInterpolation(Gg,_c,Ac,Sc,BI,LI,DI,new G),d.normal.dot(i.direction)>0&&d.normal.multiplyScalar(-1));const h={a,b:l,c:u,normal:new G,materialIndex:0};Ir.getNormal(_c,Ac,Sc,h.normal),d.face=h}return d}class bl extends Dt{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,_,m,x,A,w,I,P,D,N,B){const T=w/D,F=I/N,X=w/2,J=I/2,K=P/2,ie=D+1,Z=N+1;let fe=0,z=0;const $=new G;for(let ne=0;ne0?1:-1,d.push($.x,$.y,$.z),h.push(Ce/D),h.push(1-ne/N),fe+=1}}for(let ne=0;ne0&&(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 Xt{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new mt,this.projectionMatrix=new mt,this.projectionMatrixInverse=new mt,this.coordinateSystem=Vs}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 ga=new G,UI=new Ae,OI=new Ae;class li 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=sc*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Sl*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return sc*2*Math.atan(Math.tan(Sl*.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){ga.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(ga.x,ga.y).multiplyScalar(-e/ga.z),ga.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(ga.x,ga.y).multiplyScalar(-e/ga.z)}getViewSize(e,t){return this.getViewBounds(e,UI,OI),t.subVectors(OI,UI)}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(Sl*.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 wc=-90,Ec=1;class kI extends Xt{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new li(wc,Ec,e,t);r.layers=this.layers,this.add(r);const s=new li(wc,Ec,e,t);s.layers=this.layers,this.add(s);const o=new li(wc,Ec,e,t);o.layers=this.layers,this.add(o);const a=new li(wc,Ec,e,t);a.layers=this.layers,this.add(a);const l=new li(wc,Ec,e,t);l.layers=this.layers,this.add(l);const u=new li(wc,Ec,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===Vs)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===Od)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 Kd extends Tn{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 zI extends xs{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 Kd(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:zn}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 bl(5,5,5),s=new Ms({name:"CubemapFromEquirect",uniforms:Mc(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===Yr&&(t.minFilter=zn),new kI(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 uS=new G,a4=new G,l4=new Lt;class va{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=uS.subVectors(i,t).cross(a4.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(uS),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||l4.getNormalMatrix(e),r=this.coplanarPoint(uS).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 Rl=new _i,Xg=new G;class Yd{constructor(e=new va,t=new va,i=new va,r=new va,s=new va,o=new va){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=Vs){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],_=r[11],m=r[12],x=r[13],A=r[14],w=r[15];if(i[0].setComponents(l-s,p-u,_-g,w-m).normalize(),i[1].setComponents(l+s,p+u,_+g,w+m).normalize(),i[2].setComponents(l+o,p+d,_+v,w+x).normalize(),i[3].setComponents(l-o,p-d,_-v,w-x).normalize(),i[4].setComponents(l-a,p-h,_-S,w-A).normalize(),t===Vs)i[5].setComponents(l+a,p+h,_+S,w+A).normalize();else if(t===Od)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(),Rl.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Rl.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Rl)}intersectsSprite(e){return Rl.center.set(0,0,0),Rl.radius=.7071067811865476,Rl.applyMatrix4(e.matrixWorld),this.intersectsSphere(Rl)}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 HI(){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 u4(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`,C4=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; #endif`,T4=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; #endif`,b4=`#if NUM_CLIPPING_PLANES > 0 vClipPosition = - mvPosition.xyz; #endif`,R4=`#if defined( USE_COLOR_ALPHA ) diffuseColor *= vColor; #elif defined( USE_COLOR ) diffuseColor.rgb *= vColor; #endif`,P4=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) varying vec3 vColor; #endif`,I4=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) varying vec3 vColor; #endif`,B4=`#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`,L4=`#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`,D4=`#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`,F4=`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`,N4=`#ifdef USE_DISPLACEMENTMAP uniform sampler2D displacementMap; uniform float displacementScale; uniform float displacementBias; #endif`,U4=`#ifdef USE_DISPLACEMENTMAP transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); #endif`,O4=`#ifdef USE_EMISSIVEMAP vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); totalEmissiveRadiance *= emissiveColor.rgb; #endif`,k4=`#ifdef USE_EMISSIVEMAP uniform sampler2D emissiveMap; #endif`,z4="gl_FragColor = linearToOutputTexel( gl_FragColor );",H4=` 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 ); }`,G4=`#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`,V4=`#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`,W4=`#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`,X4=`#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`,j4=`#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`,J4=`#ifdef USE_FOG vFogDepth = - mvPosition.z; #endif`,K4=`#ifdef USE_FOG varying float vFogDepth; #endif`,Y4=`#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`,Q4=`#ifdef USE_FOG uniform vec3 fogColor; varying float vFogDepth; #ifdef FOG_EXP2 uniform float fogDensity; #else uniform float fogNear; uniform float fogFar; #endif #endif`,q4=`#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 }`,Z4=`#ifdef USE_LIGHTMAP uniform sampler2D lightMap; uniform float lightMapIntensity; #endif`,$4=`LambertMaterial material; material.diffuseColor = diffuseColor.rgb; material.specularStrength = specularStrength;`,eV=`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`,tV=`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`,nV=`#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`,iV=`ToonMaterial material; material.diffuseColor = diffuseColor.rgb;`,rV=`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`,sV=`BlinnPhongMaterial material; material.diffuseColor = diffuseColor.rgb; material.specularColor = specular; material.specularShininess = shininess; material.specularStrength = specularStrength;`,oV=`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`,aV=`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`,lV=`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 ); }`,uV=` 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`,cV=`#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`,fV=`#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`,dV=`#if defined( USE_LOGDEPTHBUF ) gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; #endif`,hV=`#if defined( USE_LOGDEPTHBUF ) uniform float logDepthBufFC; varying float vFragDepth; varying float vIsPerspective; #endif`,pV=`#ifdef USE_LOGDEPTHBUF varying float vFragDepth; varying float vIsPerspective; #endif`,mV=`#ifdef USE_LOGDEPTHBUF vFragDepth = 1.0 + gl_Position.w; vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); #endif`,gV=`#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`,vV=`#ifdef USE_MAP uniform sampler2D map; #endif`,yV=`#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`,xV=`#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`,_V=`float metalnessFactor = metalness; #ifdef USE_METALNESSMAP vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); metalnessFactor *= texelMetalness.b; #endif`,AV=`#ifdef USE_METALNESSMAP uniform sampler2D metalnessMap; #endif`,SV=`#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`,MV=`#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`,wV=`#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`,EV=`#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`,CV=`#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`,TV=`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;`,bV=`#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`,RV=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif #endif`,PV=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif #endif`,IV=`#ifndef FLAT_SHADED vNormal = normalize( transformedNormal ); #ifdef USE_TANGENT vTangent = normalize( transformedTangent ); vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); #endif #endif`,BV=`#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`,LV=`#ifdef USE_CLEARCOAT vec3 clearcoatNormal = nonPerturbedNormal; #endif`,DV=`#ifdef USE_CLEARCOAT_NORMALMAP vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; clearcoatMapN.xy *= clearcoatNormalScale; clearcoatNormal = normalize( tbn2 * clearcoatMapN ); #endif`,FV=`#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`,NV=`#ifdef USE_IRIDESCENCEMAP uniform sampler2D iridescenceMap; #endif #ifdef USE_IRIDESCENCE_THICKNESSMAP uniform sampler2D iridescenceThicknessMap; #endif`,UV=`#ifdef OPAQUE diffuseColor.a = 1.0; #endif #ifdef USE_TRANSMISSION diffuseColor.a *= material.transmissionAlpha; #endif gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,OV=`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 ); }`,kV=`#ifdef PREMULTIPLIED_ALPHA gl_FragColor.rgb *= gl_FragColor.a; #endif`,zV=`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;`,HV=`#ifdef DITHERING gl_FragColor.rgb = dithering( gl_FragColor.rgb ); #endif`,GV=`#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`,VV=`float roughnessFactor = roughness; #ifdef USE_ROUGHNESSMAP vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); roughnessFactor *= texelRoughness.g; #endif`,WV=`#ifdef USE_ROUGHNESSMAP uniform sampler2D roughnessMap; #endif`,XV=`#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`,jV=`#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`,JV=`#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`,KV=`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; }`,YV=`#ifdef USE_SKINNING mat4 boneMatX = getBoneMatrix( skinIndex.x ); mat4 boneMatY = getBoneMatrix( skinIndex.y ); mat4 boneMatZ = getBoneMatrix( skinIndex.z ); mat4 boneMatW = getBoneMatrix( skinIndex.w ); #endif`,QV=`#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`,qV=`#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`,ZV=`#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`,$V=`float specularStrength; #ifdef USE_SPECULARMAP vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); specularStrength = texelSpecular.r; #else specularStrength = 1.0; #endif`,e9=`#ifdef USE_SPECULARMAP uniform sampler2D specularMap; #endif`,t9=`#if defined( TONE_MAPPING ) gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); #endif`,n9=`#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; }`,i9=`#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`,r9=`#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`,s9=`#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`,o9=`#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`,a9=`#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`,l9=`#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:c4,alphahash_pars_fragment:f4,alphamap_fragment:d4,alphamap_pars_fragment:h4,alphatest_fragment:p4,alphatest_pars_fragment:m4,aomap_fragment:g4,aomap_pars_fragment:v4,batching_pars_vertex:y4,batching_vertex:x4,begin_vertex:_4,beginnormal_vertex:A4,bsdfs:S4,iridescence_fragment:M4,bumpmap_pars_fragment:w4,clipping_planes_fragment:E4,clipping_planes_pars_fragment:C4,clipping_planes_pars_vertex:T4,clipping_planes_vertex:b4,color_fragment:R4,color_pars_fragment:P4,color_pars_vertex:I4,color_vertex:B4,common:L4,cube_uv_reflection_fragment:D4,defaultnormal_vertex:F4,displacementmap_pars_vertex:N4,displacementmap_vertex:U4,emissivemap_fragment:O4,emissivemap_pars_fragment:k4,colorspace_fragment:z4,colorspace_pars_fragment:H4,envmap_fragment:G4,envmap_common_pars_fragment:V4,envmap_pars_fragment:W4,envmap_pars_vertex:X4,envmap_physical_pars_fragment:nV,envmap_vertex:j4,fog_vertex:J4,fog_pars_vertex:K4,fog_fragment:Y4,fog_pars_fragment:Q4,gradientmap_pars_fragment:q4,lightmap_pars_fragment:Z4,lights_lambert_fragment:$4,lights_lambert_pars_fragment:eV,lights_pars_begin:tV,lights_toon_fragment:iV,lights_toon_pars_fragment:rV,lights_phong_fragment:sV,lights_phong_pars_fragment:oV,lights_physical_fragment:aV,lights_physical_pars_fragment:lV,lights_fragment_begin:uV,lights_fragment_maps:cV,lights_fragment_end:fV,logdepthbuf_fragment:dV,logdepthbuf_pars_fragment:hV,logdepthbuf_pars_vertex:pV,logdepthbuf_vertex:mV,map_fragment:gV,map_pars_fragment:vV,map_particle_fragment:yV,map_particle_pars_fragment:xV,metalnessmap_fragment:_V,metalnessmap_pars_fragment:AV,morphinstance_vertex:SV,morphcolor_vertex:MV,morphnormal_vertex:wV,morphtarget_pars_vertex:EV,morphtarget_vertex:CV,normal_fragment_begin:TV,normal_fragment_maps:bV,normal_pars_fragment:RV,normal_pars_vertex:PV,normal_vertex:IV,normalmap_pars_fragment:BV,clearcoat_normal_fragment_begin:LV,clearcoat_normal_fragment_maps:DV,clearcoat_pars_fragment:FV,iridescence_pars_fragment:NV,opaque_fragment:UV,packing:OV,premultiplied_alpha_fragment:kV,project_vertex:zV,dithering_fragment:HV,dithering_pars_fragment:GV,roughnessmap_fragment:VV,roughnessmap_pars_fragment:WV,shadowmap_pars_fragment:XV,shadowmap_pars_vertex:jV,shadowmap_vertex:JV,shadowmask_pars_fragment:KV,skinbase_vertex:YV,skinning_pars_vertex:QV,skinning_vertex:qV,skinnormal_vertex:ZV,specularmap_fragment:$V,specularmap_pars_fragment:e9,tonemapping_fragment:t9,tonemapping_pars_fragment:n9,transmission_fragment:i9,transmission_pars_fragment:r9,uv_pars_fragment:s9,uv_pars_vertex:o9,uv_vertex:a9,worldpos_vertex:l9,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 ze(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Lt},alphaMap:{value:null},alphaMapTransform:{value:new Lt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Lt}},envmap:{envMap:{value:null},envMapRotation:{value:new Lt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Lt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Lt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Lt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Lt},normalScale:{value:new Ae(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Lt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Lt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Lt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Lt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new ze(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 ze(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Lt},alphaTest:{value:0},uvTransform:{value:new Lt}},sprite:{diffuse:{value:new ze(16777215)},opacity:{value:1},center:{value:new Ae(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Lt},alphaMap:{value:null},alphaMapTransform:{value:new Lt},alphaTest:{value:0}}},ws={basic:{uniforms:Yi([We.common,We.specularmap,We.envmap,We.aomap,We.lightmap,We.fog]),vertexShader:Nt.meshbasic_vert,fragmentShader:Nt.meshbasic_frag},lambert:{uniforms:Yi([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 ze(0)}}]),vertexShader:Nt.meshlambert_vert,fragmentShader:Nt.meshlambert_frag},phong:{uniforms:Yi([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 ze(0)},specular:{value:new ze(1118481)},shininess:{value:30}}]),vertexShader:Nt.meshphong_vert,fragmentShader:Nt.meshphong_frag},standard:{uniforms:Yi([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 ze(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Nt.meshphysical_vert,fragmentShader:Nt.meshphysical_frag},toon:{uniforms:Yi([We.common,We.aomap,We.lightmap,We.emissivemap,We.bumpmap,We.normalmap,We.displacementmap,We.gradientmap,We.fog,We.lights,{emissive:{value:new ze(0)}}]),vertexShader:Nt.meshtoon_vert,fragmentShader:Nt.meshtoon_frag},matcap:{uniforms:Yi([We.common,We.bumpmap,We.normalmap,We.displacementmap,We.fog,{matcap:{value:null}}]),vertexShader:Nt.meshmatcap_vert,fragmentShader:Nt.meshmatcap_frag},points:{uniforms:Yi([We.points,We.fog]),vertexShader:Nt.points_vert,fragmentShader:Nt.points_frag},dashed:{uniforms:Yi([We.common,We.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Nt.linedashed_vert,fragmentShader:Nt.linedashed_frag},depth:{uniforms:Yi([We.common,We.displacementmap]),vertexShader:Nt.depth_vert,fragmentShader:Nt.depth_frag},normal:{uniforms:Yi([We.common,We.bumpmap,We.normalmap,We.displacementmap,{opacity:{value:1}}]),vertexShader:Nt.meshnormal_vert,fragmentShader:Nt.meshnormal_frag},sprite:{uniforms:Yi([We.sprite,We.fog]),vertexShader:Nt.sprite_vert,fragmentShader:Nt.sprite_frag},background:{uniforms:{uvTransform:{value:new Lt},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 Lt}},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:Yi([We.common,We.displacementmap,{referencePosition:{value:new G},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Nt.distanceRGBA_vert,fragmentShader:Nt.distanceRGBA_frag},shadow:{uniforms:Yi([We.lights,We.fog,{color:{value:new ze(0)},opacity:{value:1}}]),vertexShader:Nt.shadow_vert,fragmentShader:Nt.shadow_frag}};ws.physical={uniforms:Yi([ws.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Lt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Lt},clearcoatNormalScale:{value:new Ae(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Lt},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Lt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Lt},sheen:{value:0},sheenColor:{value:new ze(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Lt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Lt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Lt},transmissionSamplerSize:{value:new Ae},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Lt},attenuationDistance:{value:0},attenuationColor:{value:new ze(0)},specularColor:{value:new ze(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Lt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Lt},anisotropyVector:{value:new Ae},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Lt}}]),vertexShader:Nt.meshphysical_vert,fragmentShader:Nt.meshphysical_frag};const jg={r:0,b:0,g:0},Pl=new fr,u9=new mt;function c9(n,e,t,i,r,s,o){const a=new ze(0);let l=s===!0?0:1,u,d,h=null,p=0,g=null;function v(x){let A=x.isScene===!0?x.background:null;return A&&A.isTexture&&(A=(x.backgroundBlurriness>0?t:e).get(A)),A}function S(x){let A=!1;const w=v(x);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===Zu)?(d===void 0&&(d=new Jn(new bl(1,1,1),new Ms({name:"BackgroundCubeMaterial",uniforms:Mc(ws.backgroundCube.uniforms),vertexShader:ws.backgroundCube.vertexShader,fragmentShader:ws.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)),Pl.copy(A.backgroundRotation),Pl.x*=-1,Pl.y*=-1,Pl.z*=-1,w.isCubeTexture&&w.isRenderTargetTexture===!1&&(Pl.y*=-1,Pl.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(u9.makeRotationFromEuler(Pl)),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(),x.unshift(d,d.geometry,d.material,0,0,null)):w&&w.isTexture&&(u===void 0&&(u=new Jn(new Cc(2,2),new Ms({name:"BackgroundMaterial",uniforms:Mc(ws.background.uniforms),vertexShader:ws.background.vertexShader,fragmentShader:ws.background.fragmentShader,side:Hs,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(),x.unshift(u,u.geometry,u.material,0,0,null))}function m(x,A){x.getRGB(jg,FI(n)),i.buffers.color.setClear(jg.r,jg.g,jg.b,A,o)}return{getClearColor:function(){return a},setClearColor:function(x,A=1){a.set(x),l=A,m(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(x){l=x,m(a,l)},render:S,addToRenderList:_}}function f9(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,K){let ie=!1;const Z=h(J,X,F);s!==Z&&(s=Z,u(s.object)),ie=g(T,J,X,K),ie&&v(T,J,X,K),K!==null&&e.update(K,n.ELEMENT_ARRAY_BUFFER),(ie||o)&&(o=!1,w(T,F,X,J),K!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,e.get(K).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 K=i[T.id];K===void 0&&(K={},i[T.id]=K);let ie=K[F.id];ie===void 0&&(ie={},K[F.id]=ie);let Z=ie[J];return Z===void 0&&(Z=p(l()),ie[J]=Z),Z}function p(T){const F=[],X=[],J=[];for(let K=0;K=0){const ne=K[z];let de=ie[z];if(de===void 0&&(z==="instanceMatrix"&&T.instanceMatrix&&(de=T.instanceMatrix),z==="instanceColor"&&T.instanceColor&&(de=T.instanceColor)),ne===void 0||ne.attribute!==de||de&&ne.data!==de.data)return!0;Z++}return s.attributesNum!==Z||s.index!==J}function v(T,F,X,J){const K={},ie=F.attributes;let Z=0;const fe=X.getAttributes();for(const z in fe)if(fe[z].location>=0){let ne=ie[z];ne===void 0&&(z==="instanceMatrix"&&T.instanceMatrix&&(ne=T.instanceMatrix),z==="instanceColor"&&T.instanceColor&&(ne=T.instanceColor));const de={};de.attribute=ne,ne&&ne.data&&(de.data=ne.data),K[z]=de,Z++}s.attributes=K,s.attributesNum=Z,s.index=J}function S(){const T=s.newAttributes;for(let F=0,X=T.length;F=0){let $=K[fe];if($===void 0&&(fe==="instanceMatrix"&&T.instanceMatrix&&($=T.instanceMatrix),fe==="instanceColor"&&T.instanceColor&&($=T.instanceColor)),$!==void 0){const ne=$.normalized,de=$.itemSize,Ce=e.get($);if(Ce===void 0)continue;const ot=Ce.buffer,re=Ce.type,Me=Ce.bytesPerElement,Ie=re===n.INT||re===n.UNSIGNED_INT||$.gpuType===Xm;if($.isInterleavedBufferAttribute){const Be=$.data,$e=Be.stride,Et=$.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),_=n.getParameter(n.MAX_VERTEX_ATTRIBS),m=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),x=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:_,maxVertexUniforms:m,maxVaryings:x,maxFragmentUniforms:A,vertexTextures:w,maxSamples:I}}function p9(n){const e=this;let t=null,i=0,r=!1,s=!1;const o=new va,a=new Lt,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,_=h.clipShadows,m=n.get(h);if(!r||v===null||v.length===0||s&&!_)s?d(null):u();else{const x=s?0:i,A=x*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+=x}};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 _=null;if(S!==0){if(_=l.value,v!==!0||_===null){const m=g+S*4,x=p.matrixWorldInverse;a.getNormalMatrix(x),(_===null||_.length0){const u=new zI(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 Tc 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 bc=4,GI=[.125,.215,.35,.446,.526,.582],Il=20,cS=new Tc,VI=new ze;let fS=null,dS=0,hS=0,pS=!1;const Bl=(1+Math.sqrt(5))/2,Rc=1/Bl,WI=[new G(-Bl,Rc,0),new G(Bl,Rc,0),new G(-Rc,0,Bl),new G(Rc,0,Bl),new G(0,Bl,-Rc),new G(0,Bl,Rc),new G(-1,1,-1),new G(1,1,-1),new G(-1,1,1),new G(1,1,1)];class mS{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){fS=this._renderer.getRenderTarget(),dS=this._renderer.getActiveCubeFace(),hS=this._renderer.getActiveMipmapLevel(),pS=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=JI(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=jI(),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=_}_textureToCubeUV(e,t){const i=this._renderer,r=e.mapping===mo||e.mapping===la;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=JI()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=jI());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,cS)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;const r=this._lodPlanes.length;for(let s=1;sIl&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${_} samples when the maximum is set to ${Il}`);const m=[];let x=0;for(let D=0;DA-bc?r-A+bc:0),P=4*(this._cubeSize-w);Jg(t,I,P,3*w,2*w),l.setRenderTarget(t),l.render(h,cS)}}function g9(n){const e=[],t=[],i=[];let r=n;const s=n-bc+1+GI.length;for(let o=0;on-bc?l=GI[o-n+bc-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,_=2,m=1,x=new Float32Array(S*v*g),A=new Float32Array(_*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];x.set(B,S*v*P),A.set(p,_*v*P);const T=[P,P,P,P,P,P];w.set(T,m*v*P)}const I=new Dt;I.setAttribute("position",new Zt(x,S)),I.setAttribute("uv",new Zt(A,_)),I.setAttribute("faceIndex",new Zt(w,m)),e.push(I),r>bc&&r--}return{lodPlanes:e,sizeLods:t,sigmas:i}}function XI(n,e,t){const i=new xs(n,e,t);return i.texture.mapping=Zu,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 v9(n,e,t){const i=new Float32Array(Il),r=new G(0,1,0);return new Ms({name:"SphericalGaussianBlur",defines:{n:Il,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:gS(),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 jI(){return new Ms({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:gS(),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 JI(){return new Ms({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:gS(),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 gS(){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 y9(n){let e=new WeakMap,t=null;function i(a){if(a&&a.isTexture){const l=a.mapping,u=l===wd||l===Ed,d=l===mo||l===la;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 mS(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 mS(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=cr,D.needsUpdate=!0;const N=A*4;for(let T=0;T0)return n;const r=e*t;let s=$I[r];if(s===void 0&&(s=new Float32Array(r),$I[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 ui(n,e){if(n.length!==e.length)return!1;for(let t=0,i=n.length;t":" "} ${a}: ${t[o]}`)}return i.join(` `)}function y5(n){const e=tn.getPrimaries(tn.workingColorSpace),t=tn.getPrimaries(n);let i;switch(e===t?i="":e===Nd&&t===Fd?i="LinearDisplayP3ToLinearSRGB":e===Fd&&t===Nd&&(i="LinearSRGBToLinearDisplayP3"),n){case yo:case Ld:return[i,"LinearTransferOETF"];case Qr:case Cg:return[i,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",n),[i,"LinearTransferOETF"]}}function oB(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+` `+v5(n.getShaderSource(e),o)}else return r}function x5(n,e){const t=y5(e);return`vec4 ${n}( vec4 value ) { return ${t[0]}( ${t[1]}( value ) ); }`}function _5(n,e){let t;switch(e){case WP:t="Linear";break;case XP:t="Reinhard";break;case jP:t="OptimizedCineon";break;case CA:t="ACESFilmic";break;case KP:t="AgX";break;case YP:t="Neutral";break;case JP: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 A5(){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 S5(n){return[n.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",n.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Qd).join(` `)}function M5(n){const e=[];for(const t in n){const i=n[t];i!==!1&&e.push("#define "+t+" "+i)}return e.join(` `)}function w5(n,e){const t={},i=n.getProgramParameter(e,n.ACTIVE_ATTRIBUTES);for(let r=0;r/gm;function xS(n){return n.replace(E5,T5)}const C5=new Map;function T5(n,e){let t=Nt[e];if(t===void 0){const i=C5.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 xS(t)}const b5=/#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 uB(n){return n.replace(b5,R5)}function R5(n,e,t,i){let r="";for(let s=parseInt(e);s0&&(_+=` `),m=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,v].filter(Qd).join(` `),m.length>0&&(m+=` `)):(_=[cB(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(Qd).join(` `),m=[cB(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!==Gs?"#define TONE_MAPPING":"",t.toneMapping!==Gs?Nt.tonemapping_pars_fragment:"",t.toneMapping!==Gs?_5("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",Nt.colorspace_pars_fragment,x5("linearToOutputTexel",t.outputColorSpace),A5(),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` `].filter(Qd).join(` `)),o=xS(o),o=aB(o,t),o=lB(o,t),a=xS(a),a=aB(a,t),a=lB(a,t),o=uB(o),a=uB(a),t.isRawShaderMaterial!==!0&&(x=`#version 300 es `,_=[g,"#define attribute in","#define varying out","#define texture2D texture"].join(` `)+` `+_,m=["#define varying in",t.glslVersion===HA?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===HA?"":"#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=x+m+a,I=sB(r,r.VERTEX_SHADER,A),P=sB(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(),K=r.getShaderInfoLog(P).trim();let ie=!0,Z=!0;if(r.getProgramParameter(S,r.LINK_STATUS)===!1)if(ie=!1,typeof n.debug.onShaderError=="function")n.debug.onShaderError(r,S,I,P);else{const fe=oB(r,I,"vertex"),z=oB(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+` `+fe+` `+z)}else X!==""?console.warn("THREE.WebGLProgram: Program Info Log:",X):(J===""||K==="")&&(Z=!1);Z&&(F.diagnostics={runnable:ie,programLog:X,vertexShader:{log:J,prefix:_},fragmentShader:{log:K,prefix:m}})}r.deleteShader(I),r.deleteShader(P),N=new Yg(r,S),B=w5(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,m5)),T},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(S),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=g5++,this.cacheKey=e,this.usedTimes=1,this.program=S,this.vertexShader=I,this.fragmentShader=P,this}let N5=0;class U5{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 O5(e),t.set(e,i)),i}}class O5{constructor(e){this.id=N5++,this.code=e,this.usedTimes=0}}function k5(n,e,t,i,r,s,o){const a=new Cl,l=new U5,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 _(B,T,F,X,J){const K=X.fog,ie=J.geometry,Z=B.isMeshStandardMaterial?X.environment:null,fe=(B.isMeshStandardMaterial?t:e).get(B.envMap||Z),z=fe&&fe.mapping===Zu?fe.image.height:null,$=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 ne=ie.morphAttributes.position||ie.morphAttributes.normal||ie.morphAttributes.color,de=ne!==void 0?ne.length:0;let Ce=0;ie.morphAttributes.position!==void 0&&(Ce=1),ie.morphAttributes.normal!==void 0&&(Ce=2),ie.morphAttributes.color!==void 0&&(Ce=3);let ot,re,Me,Ie;if($){const jt=ws[$];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,Et=J.isBatchedMesh===!0,vt=!!B.map,wt=!!B.matcap,H=!!fe,Te=!!B.aoMap,be=!!B.lightMap,He=!!B.bumpMap,xe=!!B.normalMap,dt=!!B.displacementMap,Ve=!!B.emissiveMap,qe=!!B.metalnessMap,W=!!B.roughnessMap,U=B.anisotropy>0,ae=B.clearcoat>0,ye=B.dispersion>0,we=B.iridescence>0,Ee=B.sheen>0,ut=B.transmission>0,ke=U&&!!B.anisotropyMap,Qe=ae&&!!B.clearcoatMap,Rt=ae&&!!B.clearcoatNormalMap,Pe=ae&&!!B.clearcoatRoughnessMap,Ke=we&&!!B.iridescenceMap,kt=we&&!!B.iridescenceThicknessMap,Ct=Ee&&!!B.sheenColorMap,et=Ee&&!!B.sheenRoughnessMap,Tt=!!B.specularMap,Ft=!!B.specularColorMap,sn=!!B.specularIntensityMap,Y=ut&&!!B.transmissionMap,Le=ut&&!!B.thicknessMap,_e=!!B.gradientMap,Se=!!B.alphaMap,Oe=B.alphaTest>0,At=!!B.alphaHash,Vt=!!B.extensions;let Mn=Gs;B.toneMapped&&(Be===null||Be.isXRRenderTarget===!0)&&(Mn=n.toneMapping);const Yn={shaderID:$,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:Et,batchingColor:Et&&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:wt,envMap:H,envMapMode:H&&fe.mapping,envMapCubeUVHeight:z,aoMap:Te,lightMap:be,bumpMap:He,normalMap:xe,displacementMap:p&&dt,emissiveMap:Ve,normalMapObjectSpace:xe&&B.normalMapType===iI,normalMapTangentSpace:xe&&B.normalMapType===ca,metalnessMap:qe,roughnessMap:W,anisotropy:U,anisotropyMap:ke,clearcoat:ae,clearcoatMap:Qe,clearcoatNormalMap:Rt,clearcoatRoughnessMap:Pe,dispersion:ye,iridescence:we,iridescenceMap:Ke,iridescenceThicknessMap:kt,sheen:Ee,sheenColorMap:Ct,sheenRoughnessMap:et,specularMap:Tt,specularColorMap:Ft,specularIntensityMap:sn,transmission:ut,transmissionMap:Y,thicknessMap:Le,gradientMap:_e,opaque:B.transparent===!1&&B.blending===pl&&B.alphaToCoverage===!1,alphaMap:Se,alphaTest:Oe,alphaHash:At,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:xe&&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:ke&&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:Ct&&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:!!ie.attributes.tangent&&(xe||U),vertexColors:B.vertexColors,vertexAlphas:B.vertexColors===!0&&!!ie.attributes.color&&ie.attributes.color.itemSize===4,pointsUvs:J.isPoints===!0&&!!ie.attributes.uv&&(vt||Se),fog:!!K,useFog:B.fog===!0,fogExp2:!!K&&K.isFogExp2,flatShading:B.flatShading===!0,sizeAttenuation:B.sizeAttenuation===!0,logarithmicDepthBuffer:h,skinning:J.isSkinnedMesh===!0,morphTargets:ie.morphAttributes.position!==void 0,morphNormals:ie.morphAttributes.normal!==void 0,morphColors:ie.morphAttributes.color!==void 0,morphTargetsCount:de,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:Mn,decodeVideoTexture:vt&&B.map.isVideoTexture===!0&&tn.getTransfer(B.map.colorSpace)===vn,premultipliedAlpha:B.premultipliedAlpha,doubleSided:B.side===vs,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||Et)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:B.customProgramCacheKey()};return Yn.vertexUv1s=u.has(1),Yn.vertexUv2s=u.has(2),Yn.vertexUv3s=u.has(3),u.clear(),Yn}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&&(x(T,B),A(T,B),T.push(n.outputColorSpace)),T.push(B.customProgramCacheKey),T.join()}function x(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=ws[T];F=NI.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,_){const m=o(h,p,g,v,S,_);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||H5),i.length>1&&i.sort(p||fB),r.length>1&&r.sort(p||fB)}function d(){for(let h=e,p=n.length;h=s.length?(o=new dB,s.push(o)):o=s[r],o}function t(){n=new WeakMap}return{get:e,dispose:t}}function V5(){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 ze};break;case"SpotLight":t={position:new G,direction:new G,color:new ze,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new G,color:new ze,distance:0,decay:0};break;case"HemisphereLight":t={direction:new G,skyColor:new ze,groundColor:new ze};break;case"RectAreaLight":t={color:new ze,position:new G,halfWidth:new G,halfHeight:new G};break}return n[e.id]=t,t}}}function W5(){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 X5=0;function j5(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function J5(n){const e=new V5,t=W5(),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,_=0,m=0,x=0,A=0,w=0,I=0,P=0,D=0;u.sort(j5);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!==_||N.hemiLength!==m||N.numDirectionalShadows!==x||N.numPointShadows!==A||N.numSpotShadows!==w||N.numSpotMaps!==I||N.numLightProbes!==D)&&(i.directional.length=g,i.spot.length=S,i.rectArea.length=_,i.point.length=v,i.hemi.length=m,i.directionalShadow.length=x,i.directionalShadowMap.length=x,i.pointShadow.length=A,i.pointShadowMap.length=A,i.spotShadow.length=w,i.spotShadowMap.length=w,i.directionalShadowMatrix.length=x,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=_,N.hemiLength=m,N.numDirectionalShadows=x,N.numPointShadows=A,N.numSpotShadows=w,N.numSpotMaps=I,N.numLightProbes=D,i.version=X5++)}function l(u,d){let h=0,p=0,g=0,v=0,S=0;const _=d.matrixWorldInverse;for(let m=0,x=u.length;m=o.length?(a=new hB(n),o.push(a)):a=o[s],a}function i(){e=new WeakMap}return{get:t,dispose:i}}class _S extends ai{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=tI,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 AS extends ai{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 Y5=`void main() { gl_Position = vec4( position, 1.0 ); }`,Q5=`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 q5(n,e,t){let i=new Yd;const r=new Ae,s=new Ae,o=new on,a=new _S({depthPacking:nI}),l=new AS,u={},d=t.maxTextureSize,h={[Hs]:Ji,[Ji]:Hs,[vs]:vs},p=new Ms({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ae},radius:{value:4}},vertexShader:Y5,fragmentShader:Q5}),g=p.clone();g.defines.HORIZONTAL_PASS=1;const v=new Dt;v.setAttribute("position",new Zt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const S=new Jn(v,p),_=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=zm;let m=this.type;this.render=function(P,D,N){if(_.enabled===!1||_.autoUpdate===!1&&_.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!==gs&&this.type===gs,K=m===gs&&this.type!==gs;for(let ie=0,Z=P.length;ied||r.y>d)&&(r.x>d&&(s.x=Math.floor(d/$.x),r.x=s.x*$.x,z.mapSize.x=s.x),r.y>d&&(s.y=Math.floor(d/$.y),r.y=s.y*$.y,z.mapSize.y=s.y)),z.map===null||J===!0||K===!0){const de=this.type!==gs?{minFilter:oi,magFilter:oi}:{};z.map!==null&&z.map.dispose(),z.map=new xs(r.x,r.y,de),z.map.texture.name=fe.name+".shadowMap",z.camera.updateProjectionMatrix()}n.setRenderTarget(z.map),n.clear();const ne=z.getViewportCount();for(let de=0;de0||D.map&&D.alphaTest>0){const X=T.uuid,J=D.uuid;let K=u[X];K===void 0&&(K={},u[X]=K);let ie=K[J];ie===void 0&&(ie=T.clone(),K[J]=ie,D.addEventListener("dispose",I)),T=ie}if(T.visible=D.visible,T.wireframe=D.wireframe,B===gs?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===gs)&&(!P.frustumCulled||i.intersectsObject(P))){P.modelViewMatrix.multiplyMatrices(N.matrixWorldInverse,P.matrixWorld);const J=e.update(P),K=P.material;if(Array.isArray(K)){const ie=J.groups;for(let Z=0,fe=ie.length;Z=1):fe.indexOf("OpenGL ES")!==-1&&(Z=parseFloat(/^OpenGL ES (\d)/.exec(fe)[1]),ie=Z>=2);let z=null,$={};const ne=n.getParameter(n.SCISSOR_BOX),de=n.getParameter(n.VIEWPORT),Ce=new on().fromArray(ne),ot=new on().fromArray(de);function re(Y,Le,_e,Se){const Oe=new Uint8Array(4),At=n.createTexture();n.bindTexture(Y,At),n.texParameteri(Y,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(Y,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let Vt=0;Vt<_e;Vt++)Y===n.TEXTURE_3D||Y===n.TEXTURE_2D_ARRAY?n.texImage3D(Le,0,n.RGBA,1,1,Se,0,n.RGBA,n.UNSIGNED_BYTE,Oe):n.texImage2D(Le+Vt,0,n.RGBA,1,1,0,n.RGBA,n.UNSIGNED_BYTE,Oe);return At}const Me={};Me[n.TEXTURE_2D]=re(n.TEXTURE_2D,n.TEXTURE_2D,1),Me[n.TEXTURE_CUBE_MAP]=re(n.TEXTURE_CUBE_MAP,n.TEXTURE_CUBE_MAP_POSITIVE_X,6),Me[n.TEXTURE_2D_ARRAY]=re(n.TEXTURE_2D_ARRAY,n.TEXTURE_2D_ARRAY,1,1),Me[n.TEXTURE_3D]=re(n.TEXTURE_3D,n.TEXTURE_3D,1,1),r.setClear(0,0,0,1),s.setClear(1),o.setClear(0),Ie(n.DEPTH_TEST),s.setFunc(Sd),He(!1),xe(SA),Ie(n.CULL_FACE),Te(po);function Ie(Y){u[Y]!==!0&&(n.enable(Y),u[Y]=!0)}function Be(Y){u[Y]!==!1&&(n.disable(Y),u[Y]=!1)}function $e(Y,Le){return d[Y]!==Le?(n.bindFramebuffer(Y,Le),d[Y]=Le,Y===n.DRAW_FRAMEBUFFER&&(d[n.FRAMEBUFFER]=Le),Y===n.FRAMEBUFFER&&(d[n.DRAW_FRAMEBUFFER]=Le),!0):!1}function Et(Y,Le){let _e=p,Se=!1;if(Y){_e=h.get(Le),_e===void 0&&(_e=[],h.set(Le,_e));const Oe=Y.textures;if(_e.length!==Oe.length||_e[0]!==n.COLOR_ATTACHMENT0){for(let At=0,Vt=Oe.length;Ate?(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 e8(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 t8(n){return n.repeat.x=1,n.repeat.y=1,n.offset.x=0,n.offset.y=0,n}function SS(n,e,t,i){const r=n8(i);switch(t){case IA:return n*e;case LA:return n*e;case DA:return n*e*2;case Km:return n*e/r.components*r.byteLength;case Cd:return n*e/r.components*r.byteLength;case FA:return n*e*2/r.components*r.byteLength;case Ym:return n*e*2/r.components*r.byteLength;case BA: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 Td:case bd:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case Rd:case Pd: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 Id:case yg:case xg:return Math.ceil(n/4)*Math.ceil(e/4)*16;case NA: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 n8(n){switch(n){case ys:case bA:return{byteLength:1,components:1};case tc:case RA:case nc:return{byteLength:2,components:1};case jm:case Jm:return{byteLength:2,components:4};case go:case Xm:case cr:return{byteLength:4,components:1};case PA:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${n}.`)}const i8={contain:$5,cover:e8,fill:t8,getByteLength:SS};function r8(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):zd("canvas")}function S(W,U,ae){let ye=1;const we=qe(W);if((we.width>ae||we.height>ae)&&(ye=ae/Math.max(we.width,we.height)),ye<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(ye*we.width),ut=Math.floor(ye*we.height);h===void 0&&(h=v(Ee,ut));const ke=U?v(Ee,ut):h;return ke.width=Ee,ke.height=ut,ke.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+")."),ke}else return"data"in W&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+we.width+"x"+we.height+")."),W;return W}function _(W){return W.generateMipmaps&&W.minFilter!==oi&&W.minFilter!==zn}function m(W){n.generateMipmap(W)}function x(W,U,ae,ye,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?Dd:tn.getTransfer(ye);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===gl?ae=n.DEPTH24_STENCIL8:U===cr?ae=n.DEPTH32F_STENCIL8:U===tc&&(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===gl?ae=n.DEPTH_COMPONENT24:U===cr?ae=n.DEPTH_COMPONENT32F:U===tc&&(ae=n.DEPTH_COMPONENT16),ae}function w(W,U){return _(W)===!0||W.isFramebufferTexture&&W.minFilter!==oi&&W.minFilter!==zn?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,ye=p.get(ae);if(ye){const we=ye[U.__cacheKey];we.usedTimes--,we.usedTimes===0&&N(W),Object.keys(ye).length===0&&p.delete(ae)}i.remove(W)}function N(W){const U=i.get(W);n.deleteTexture(U.__webglTexture);const ae=W.source,ye=p.get(ae);delete ye[U.__cacheKey],o.memory.textures--}function B(W){const U=i.get(W);if(W.depthTexture&&W.depthTexture.dispose(),W.isWebGLCubeRenderTarget)for(let ye=0;ye<6;ye++){if(Array.isArray(U.__webglFramebuffer[ye]))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 K(W,U){const ae=i.get(W);if(W.isVideoTexture&&dt(W),W.isRenderTargetTexture===!1&&W.version>0&&ae.__version!==W.version){const ye=W.image;if(ye===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(ye.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 ie(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 Z(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 fe(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={[ua]:n.REPEAT,[br]:n.CLAMP_TO_EDGE,[$u]:n.MIRRORED_REPEAT},$={[oi]:n.NEAREST,[Wm]:n.NEAREST_MIPMAP_NEAREST,[ml]:n.NEAREST_MIPMAP_LINEAR,[zn]:n.LINEAR,[ec]:n.LINEAR_MIPMAP_NEAREST,[Yr]:n.LINEAR_MIPMAP_LINEAR},ne={[rI]:n.NEVER,[cI]:n.ALWAYS,[sI]:n.LESS,[zA]:n.LEQUAL,[oI]:n.EQUAL,[uI]:n.GEQUAL,[aI]:n.GREATER,[lI]:n.NOTEQUAL};function de(W,U){if(U.type===cr&&e.has("OES_texture_float_linear")===!1&&(U.magFilter===zn||U.magFilter===ec||U.magFilter===ml||U.magFilter===Yr||U.minFilter===zn||U.minFilter===ec||U.minFilter===ml||U.minFilter===Yr)&&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,$[U.magFilter]),n.texParameteri(W,n.TEXTURE_MIN_FILTER,$[U.minFilter]),U.compareFunction&&(n.texParameteri(W,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(W,n.TEXTURE_COMPARE_FUNC,ne[U.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(U.magFilter===oi||U.minFilter!==ml&&U.minFilter!==Yr||U.type===cr&&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 ye=U.source;let we=p.get(ye);we===void 0&&(we={},p.set(ye,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 ye=n.TEXTURE_2D;(U.isDataArrayTexture||U.isCompressedArrayTexture)&&(ye=n.TEXTURE_2D_ARRAY),U.isData3DTexture&&(ye=n.TEXTURE_3D);const we=Ce(W,U),Ee=U.source;t.bindTexture(ye,W.__webglTexture,n.TEXTURE0+ae);const ut=i.get(Ee);if(Ee.version!==ut.__version||we===!0){t.activeTexture(n.TEXTURE0+ae);const ke=tn.getPrimaries(tn.workingColorSpace),Qe=U.colorSpace===vo?null:tn.getPrimaries(U.colorSpace),Rt=U.colorSpace===vo||ke===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 Ct=x(U.internalFormat,Ke,kt,U.colorSpace,U.isVideoTexture);de(ye,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)Ct=A(U.format===yl,U.type),sn&&(Ft?t.texStorage2D(n.TEXTURE_2D,1,Ct,Pe.width,Pe.height):t.texImage2D(n.TEXTURE_2D,0,Ct,Pe.width,Pe.height,0,Ke,kt,null));else if(U.isDataTexture)if(Tt.length>0){Ft&&sn&&t.texStorage2D(n.TEXTURE_2D,Le,Ct,Tt[0].width,Tt[0].height);for(let _e=0,Se=Tt.length;_e0){const Oe=SS(et.width,et.height,U.format,U.type);for(const At of U.layerUpdates){const Vt=et.data.subarray(At*Oe/et.data.BYTES_PER_ELEMENT,(At+1)*Oe/et.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,_e,0,0,At,et.width,et.height,1,Ke,Vt,0,0)}U.clearLayerUpdates()}else t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,_e,0,0,0,et.width,et.height,Pe.depth,Ke,et.data,0,0)}else t.compressedTexImage3D(n.TEXTURE_2D_ARRAY,_e,Ct,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,_e,0,0,0,et.width,et.height,Pe.depth,Ke,kt,et.data):t.texImage3D(n.TEXTURE_2D_ARRAY,_e,Ct,et.width,et.height,Pe.depth,0,Ke,kt,et.data)}else{Ft&&sn&&t.texStorage2D(n.TEXTURE_2D,Le,Ct,Tt[0].width,Tt[0].height);for(let _e=0,Se=Tt.length;_e0){const _e=SS(Pe.width,Pe.height,U.format,U.type);for(const Se of U.layerUpdates){const Oe=Pe.data.subarray(Se*_e/Pe.data.BYTES_PER_ELEMENT,(Se+1)*_e/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,Ct,Pe.width,Pe.height,Pe.depth,0,Ke,kt,Pe.data);else if(U.isData3DTexture)Ft?(sn&&t.texStorage3D(n.TEXTURE_3D,Le,Ct,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,Ct,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,Ct,Pe.width,Pe.height);else{let _e=Pe.width,Se=Pe.height;for(let Oe=0;Oe>=1,Se>>=1}}else if(Tt.length>0){if(Ft&&sn){const _e=qe(Tt[0]);t.texStorage2D(n.TEXTURE_2D,Le,Ct,_e.width,_e.height)}for(let _e=0,Se=Tt.length;_e0&&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,Ct,et,Ke[Se].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Se,0,Tt,Ke[Se].width,Ke[Se].height,0,Ct,et,Ke[Se].data);for(let Oe=0;Oe<_e.length;Oe++){const Vt=_e[Oe].image[Se].image;Ft?Y&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Se,Oe+1,0,0,Vt.width,Vt.height,Ct,et,Vt.data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Se,Oe+1,Tt,Vt.width,Vt.height,0,Ct,et,Vt.data)}}else{Ft?Y&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Se,0,0,0,Ct,et,Ke[Se]):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Se,0,Tt,Ct,et,Ke[Se]);for(let Oe=0;Oe<_e.length;Oe++){const At=_e[Oe];Ft?Y&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Se,Oe+1,0,0,Ct,et,At.image[Se]):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Se,Oe+1,Tt,Ct,et,At.image[Se])}}}_(U)&&m(n.TEXTURE_CUBE_MAP),Ee.__version=we.version,U.onUpdate&&U.onUpdate(U)}W.__version=U.version}function Me(W,U,ae,ye,we,Ee){const ut=s.convert(ae.format,ae.colorSpace),ke=s.convert(ae.type),Qe=x(ae.internalFormat,ut,ke,ae.colorSpace);if(!i.get(U).__hasExternalTextures){const Pe=Math.max(1,U.width>>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,ke,null):t.texImage2D(we,Ee,Qe,Pe,Ke,0,ut,ke,null)}t.bindFramebuffer(n.FRAMEBUFFER,W),xe(U)?a.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,ye,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,ye,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 ye=U.depthTexture,we=ye&&ye.isDepthTexture?ye.type:null,Ee=A(U.stencilBuffer,we),ut=U.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,ke=He(U);xe(U)?a.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,ke,Ee,U.width,U.height):ae?n.renderbufferStorageMultisample(n.RENDERBUFFER,ke,Ee,U.width,U.height):n.renderbufferStorage(n.RENDERBUFFER,Ee,U.width,U.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,ut,n.RENDERBUFFER,W)}else{const ye=U.textures;for(let we=0;we1;if(ut||(ye.__webglTexture===void 0&&(ye.__webglTexture=n.createTexture()),ye.__version=U.version,o.memory.textures++),Ee){ae.__webglFramebuffer=[];for(let ke=0;ke<6;ke++)if(U.mipmaps&&U.mipmaps.length>0){ae.__webglFramebuffer[ke]=[];for(let Qe=0;Qe0){ae.__webglFramebuffer=[];for(let ke=0;ke0&&xe(W)===!1){ae.__webglMultisampledFramebuffer=n.createFramebuffer(),ae.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,ae.__webglMultisampledFramebuffer);for(let ke=0;ke0)for(let Qe=0;Qe0)for(let Qe=0;Qe0){if(xe(W)===!1){const U=W.textures,ae=W.width,ye=W.height;let we=n.COLOR_BUFFER_BIT;const Ee=W.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,ut=i.get(W),ke=U.length>1;if(ke)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,ye=W.format,we=W.type;return W.isCompressedTexture===!0||W.isVideoTexture===!0||ae!==yo&&ae!==vo&&(tn.getTransfer(ae)===vn?(ye!==Ri||we!==ys)&&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=K,this.setTexture2DArray=ie,this.setTexture3D=Z,this.setTextureCube=fe,this.rebindTextures=Et,this.setupRenderTarget=vt,this.updateRenderTargetMipmap=wt,this.updateMultisampleRenderTarget=be,this.setupDepthRenderbuffer=$e,this.setupFrameBufferTexture=Me,this.useMultisampledRTT=xe}function pB(n,e){function t(i,r=vo){let s;const o=tn.getTransfer(r);if(i===ys)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===PA)return n.UNSIGNED_INT_5_9_9_9_REV;if(i===bA)return n.BYTE;if(i===RA)return n.SHORT;if(i===tc)return n.UNSIGNED_SHORT;if(i===Xm)return n.INT;if(i===go)return n.UNSIGNED_INT;if(i===cr)return n.FLOAT;if(i===nc)return n.HALF_FLOAT;if(i===IA)return n.ALPHA;if(i===BA)return n.RGB;if(i===Ri)return n.RGBA;if(i===LA)return n.LUMINANCE;if(i===DA)return n.LUMINANCE_ALPHA;if(i===vl)return n.DEPTH_COMPONENT;if(i===yl)return n.DEPTH_STENCIL;if(i===Km)return n.RED;if(i===Cd)return n.RED_INTEGER;if(i===FA)return n.RG;if(i===Ym)return n.RG_INTEGER;if(i===Qm)return n.RGBA_INTEGER;if(i===Td||i===bd||i===Rd||i===Pd)if(o===vn)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(i===Td)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===bd)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===Rd)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===Pd)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(i===Td)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===bd)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===Rd)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===Pd)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===Id||i===yg||i===xg)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(i===Id)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===NA||i===_g||i===Ag||i===Sg)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(i===Id)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===gl?n.UNSIGNED_INT_24_8:n[i]!==void 0?n[i]:null}return{convert:t}}class mB extends li{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class Co extends Xt{constructor(){super(),this.isGroup=!0,this.type="Group"}}const s8={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 _=t.getJointPose(S,i),m=this._getHandJoint(u,S);_!==null&&(m.matrix.fromArray(_.transform.matrix),m.matrix.decompose(m.position,m.rotation,m.scale),m.matrixWorldNeedsUpdate=!0,m.jointRadius=_.radius),m.visible=_!==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(s8)))}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 o8=` void main() { gl_Position = vec4( position, 1.0 ); }`,a8=` 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 l8{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,i){if(this.texture===null){const r=new Tn,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 Ms({vertexShader:o8,fragmentShader:a8,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new Jn(new Cc(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class u8 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 l8,_=t.getContextAttributes();let m=null,x=null;const A=[],w=[],I=new Ae;let P=null;const D=new li;D.layers.enable(1),D.viewport=new on;const N=new li;N.layers.enable(2),N.viewport=new on;const B=[D,N],T=new mB;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 K(){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",K),r.removeEventListener("inputsourceschange",ie);for(let re=0;re=0&&(w[Be]=null,A[Be].disconnect(Ie))}for(let Me=0;Me=w.length){w.push(Ie),Be=Et;break}else if(w[Et]===null){w[Et]=Ie,Be=Et;break}if(Be===-1)break}const $e=A[Be];$e&&$e.connect(Ie)}}const Z=new G,fe=new G;function z(re,Me,Ie){Z.setFromMatrixPosition(Me.matrixWorld),fe.setFromMatrixPosition(Ie.matrixWorld);const Be=Z.distanceTo(fe),$e=Me.projectionMatrix.elements,Et=Ie.projectionMatrix.elements,vt=$e[14]/($e[10]-1),wt=$e[14]/($e[10]+1),H=($e[9]+1)/$e[5],Te=($e[9]-1)/$e[5],be=($e[8]-1)/$e[0],He=(Et[8]+1)/Et[0],xe=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=wt+Ve,ae=xe-qe,ye=dt+(Be-qe),we=H*wt/U*W,Ee=Te*wt/U*W;re.projectionMatrix.makePerspective(ae,ye,we,Ee,W,U),re.projectionMatrixInverse.copy(re.projectionMatrix).invert()}function $(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;$(T,Me);for(let Be=0;Be0&&(_.alphaTest.value=m.alphaTest);const x=e.get(m),A=x.envMap,w=x.envMapRotation;A&&(_.envMap.value=A,Ll.copy(w),Ll.x*=-1,Ll.y*=-1,Ll.z*=-1,A.isCubeTexture&&A.isRenderTargetTexture===!1&&(Ll.y*=-1,Ll.z*=-1),_.envMapRotation.value.setFromMatrix4(c8.makeRotationFromEuler(Ll)),_.flipEnvMap.value=A.isCubeTexture&&A.isRenderTargetTexture===!1?-1:1,_.reflectivity.value=m.reflectivity,_.ior.value=m.ior,_.refractionRatio.value=m.refractionRatio),m.lightMap&&(_.lightMap.value=m.lightMap,_.lightMapIntensity.value=m.lightMapIntensity,t(m.lightMap,_.lightMapTransform)),m.aoMap&&(_.aoMap.value=m.aoMap,_.aoMapIntensity.value=m.aoMapIntensity,t(m.aoMap,_.aoMapTransform))}function o(_,m){_.diffuse.value.copy(m.color),_.opacity.value=m.opacity,m.map&&(_.map.value=m.map,t(m.map,_.mapTransform))}function a(_,m){_.dashSize.value=m.dashSize,_.totalSize.value=m.dashSize+m.gapSize,_.scale.value=m.scale}function l(_,m,x,A){_.diffuse.value.copy(m.color),_.opacity.value=m.opacity,_.size.value=m.size*x,_.scale.value=A*.5,m.map&&(_.map.value=m.map,t(m.map,_.uvTransform)),m.alphaMap&&(_.alphaMap.value=m.alphaMap,t(m.alphaMap,_.alphaMapTransform)),m.alphaTest>0&&(_.alphaTest.value=m.alphaTest)}function u(_,m){_.diffuse.value.copy(m.color),_.opacity.value=m.opacity,_.rotation.value=m.rotation,m.map&&(_.map.value=m.map,t(m.map,_.mapTransform)),m.alphaMap&&(_.alphaMap.value=m.alphaMap,t(m.alphaMap,_.alphaMapTransform)),m.alphaTest>0&&(_.alphaTest.value=m.alphaTest)}function d(_,m){_.specular.value.copy(m.specular),_.shininess.value=Math.max(m.shininess,1e-4)}function h(_,m){m.gradientMap&&(_.gradientMap.value=m.gradientMap)}function p(_,m){_.metalness.value=m.metalness,m.metalnessMap&&(_.metalnessMap.value=m.metalnessMap,t(m.metalnessMap,_.metalnessMapTransform)),_.roughness.value=m.roughness,m.roughnessMap&&(_.roughnessMap.value=m.roughnessMap,t(m.roughnessMap,_.roughnessMapTransform)),m.envMap&&(_.envMapIntensity.value=m.envMapIntensity)}function g(_,m,x){_.ior.value=m.ior,m.sheen>0&&(_.sheenColor.value.copy(m.sheenColor).multiplyScalar(m.sheen),_.sheenRoughness.value=m.sheenRoughness,m.sheenColorMap&&(_.sheenColorMap.value=m.sheenColorMap,t(m.sheenColorMap,_.sheenColorMapTransform)),m.sheenRoughnessMap&&(_.sheenRoughnessMap.value=m.sheenRoughnessMap,t(m.sheenRoughnessMap,_.sheenRoughnessMapTransform))),m.clearcoat>0&&(_.clearcoat.value=m.clearcoat,_.clearcoatRoughness.value=m.clearcoatRoughness,m.clearcoatMap&&(_.clearcoatMap.value=m.clearcoatMap,t(m.clearcoatMap,_.clearcoatMapTransform)),m.clearcoatRoughnessMap&&(_.clearcoatRoughnessMap.value=m.clearcoatRoughnessMap,t(m.clearcoatRoughnessMap,_.clearcoatRoughnessMapTransform)),m.clearcoatNormalMap&&(_.clearcoatNormalMap.value=m.clearcoatNormalMap,t(m.clearcoatNormalMap,_.clearcoatNormalMapTransform),_.clearcoatNormalScale.value.copy(m.clearcoatNormalScale),m.side===Ji&&_.clearcoatNormalScale.value.negate())),m.dispersion>0&&(_.dispersion.value=m.dispersion),m.iridescence>0&&(_.iridescence.value=m.iridescence,_.iridescenceIOR.value=m.iridescenceIOR,_.iridescenceThicknessMinimum.value=m.iridescenceThicknessRange[0],_.iridescenceThicknessMaximum.value=m.iridescenceThicknessRange[1],m.iridescenceMap&&(_.iridescenceMap.value=m.iridescenceMap,t(m.iridescenceMap,_.iridescenceMapTransform)),m.iridescenceThicknessMap&&(_.iridescenceThicknessMap.value=m.iridescenceThicknessMap,t(m.iridescenceThicknessMap,_.iridescenceThicknessMapTransform))),m.transmission>0&&(_.transmission.value=m.transmission,_.transmissionSamplerMap.value=x.texture,_.transmissionSamplerSize.value.set(x.width,x.height),m.transmissionMap&&(_.transmissionMap.value=m.transmissionMap,t(m.transmissionMap,_.transmissionMapTransform)),_.thickness.value=m.thickness,m.thicknessMap&&(_.thicknessMap.value=m.thicknessMap,t(m.thicknessMap,_.thicknessMapTransform)),_.attenuationDistance.value=m.attenuationDistance,_.attenuationColor.value.copy(m.attenuationColor)),m.anisotropy>0&&(_.anisotropyVector.value.set(m.anisotropy*Math.cos(m.anisotropyRotation),m.anisotropy*Math.sin(m.anisotropyRotation)),m.anisotropyMap&&(_.anisotropyMap.value=m.anisotropyMap,t(m.anisotropyMap,_.anisotropyMapTransform))),_.specularIntensity.value=m.specularIntensity,_.specularColor.value.copy(m.specularColor),m.specularColorMap&&(_.specularColorMap.value=m.specularColorMap,t(m.specularColorMap,_.specularColorMapTransform)),m.specularIntensityMap&&(_.specularIntensityMap.value=m.specularIntensityMap,t(m.specularIntensityMap,_.specularIntensityMapTransform))}function v(_,m){m.matcap&&(_.matcap.value=m.matcap)}function S(_,m){const x=e.get(m).light;_.referencePosition.value.setFromMatrixPosition(x.matrixWorld),_.nearDistance.value=x.shadow.camera.near,_.farDistance.value=x.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:r}}function d8(n,e,t,i){let r={},s={},o=[];const a=n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS);function l(x,A){const w=A.program;i.uniformBlockBinding(x,w)}function u(x,A){let w=r[x.id];w===void 0&&(v(x),w=d(x),r[x.id]=w,x.addEventListener("dispose",_));const I=A.program;i.updateUBOMapping(x,I);const P=e.render.frame;s[x.id]!==P&&(p(x),s[x.id]=P)}function d(x){const A=h();x.__bindingPointIndex=A;const w=n.createBuffer(),I=x.__size,P=x.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 x=0;x0&&(w+=I-P),x.__size=w,x.__cache={},this}function S(x){const A={boundary:0,storage:0};return typeof x=="number"||typeof x=="boolean"?(A.boundary=4,A.storage=4):x.isVector2?(A.boundary=8,A.storage=8):x.isVector3||x.isColor?(A.boundary=16,A.storage=12):x.isVector4?(A.boundary=16,A.storage=16):x.isMatrix3?(A.boundary=48,A.storage=48):x.isMatrix4?(A.boundary=64,A.storage=64):x.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",x),A}function _(x){const A=x.target;A.removeEventListener("dispose",_);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 x in r)n.deleteBuffer(r[x]);o=[],r={},s={}}return{bind:l,update:u,dispose:m}}class gB{constructor(e={}){const{canvas:t=pI(),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,_=null;const m=[],x=[];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=Qr,this.toneMapping=Gs,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 ze(0);let K=0,ie=t.width,Z=t.height,fe=1,z=null,$=null;const ne=new on(0,0,ie,Z),de=new on(0,0,ie,Z);let Ce=!1;const ot=new Yd;let re=!1,Me=!1;const Ie=new mt,Be=new G,$e=new on,Et={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let vt=!1;function wt(){return D===null?fe:1}let H=i;function Te(O,q){return t.getContext(O,q)}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${_d}`),t.addEventListener("webglcontextlost",_e,!1),t.addEventListener("webglcontextrestored",Se,!1),t.addEventListener("webglcontextcreationerror",Oe,!1),H===null){const q="webgl2";if(H=Te(q,O),H===null)throw Te(q)?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,xe,dt,Ve,qe,W,U,ae,ye,we,Ee,ut,ke,Qe,Rt,Pe,Ke,kt,Ct,et,Tt,Ft,sn;function Y(){be=new x9(H),be.init(),Tt=new pB(H,be),He=new h9(H,be,e,Tt),xe=new Z5(H),dt=new S9(H),Ve=new z5,qe=new r8(H,be,xe,Ve,He,Tt,dt),W=new m9(A),U=new y9(A),ae=new u4(H),Ft=new f9(H,ae),ye=new _9(H,ae,dt,Ft),we=new w9(H,ye,ae,dt),kt=new M9(H,He,qe),Rt=new p9(Ve),Ee=new k5(A,W,U,be,He,Ft,Rt),ut=new f8(A,Ve),ke=new G5,Qe=new K5(be),Ke=new c9(A,W,U,xe,we,p,l),Pe=new q5(A,we,He),sn=new d8(H,dt,He,xe),Ct=new d9(H,be,dt),et=new A9(H,be,dt),dt.programs=Ee.programs,A.capabilities=He,A.extensions=be,A.properties=Ve,A.renderLists=ke,A.shadowMap=Pe,A.state=xe,A.info=dt}Y();const Le=new u8(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 fe},this.setPixelRatio=function(O){O!==void 0&&(fe=O,this.setSize(ie,Z,!1))},this.getSize=function(O){return O.set(ie,Z)},this.setSize=function(O,q,oe=!0){if(Le.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}ie=O,Z=q,t.width=Math.floor(O*fe),t.height=Math.floor(q*fe),oe===!0&&(t.style.width=O+"px",t.style.height=q+"px"),this.setViewport(0,0,O,q)},this.getDrawingBufferSize=function(O){return O.set(ie*fe,Z*fe).floor()},this.setDrawingBufferSize=function(O,q,oe){ie=O,Z=q,fe=oe,t.width=Math.floor(O*oe),t.height=Math.floor(q*oe),this.setViewport(0,0,O,q)},this.getCurrentViewport=function(O){return O.copy(T)},this.getViewport=function(O){return O.copy(ne)},this.setViewport=function(O,q,oe,le){O.isVector4?ne.set(O.x,O.y,O.z,O.w):ne.set(O,q,oe,le),xe.viewport(T.copy(ne).multiplyScalar(fe).round())},this.getScissor=function(O){return O.copy(de)},this.setScissor=function(O,q,oe,le){O.isVector4?de.set(O.x,O.y,O.z,O.w):de.set(O,q,oe,le),xe.scissor(F.copy(de).multiplyScalar(fe).round())},this.getScissorTest=function(){return Ce},this.setScissorTest=function(O){xe.setScissorTest(Ce=O)},this.setOpaqueSort=function(O){z=O},this.setTransparentSort=function(O){$=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,q=!0,oe=!0){let le=0;if(O){let te=!1;if(D!==null){const De=D.texture.format;te=De===Qm||De===Ym||De===Cd}if(te){const De=D.texture.type,Xe=De===ys||De===go||De===tc||De===gl||De===jm||De===Jm,nt=Ke.getClearColor(),Ze=Ke.getClearAlpha(),ht=nt.r,xt=nt.g,ft=nt.b;Xe?(g[0]=ht,g[1]=xt,g[2]=ft,g[3]=Ze,H.clearBufferuiv(H.COLOR,0,g)):(v[0]=ht,v[1]=xt,v[2]=ft,v[3]=Ze,H.clearBufferiv(H.COLOR,0,v))}else le|=H.COLOR_BUFFER_BIT}q&&(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",_e,!1),t.removeEventListener("webglcontextrestored",Se,!1),t.removeEventListener("webglcontextcreationerror",Oe,!1),ke.dispose(),Qe.dispose(),Ve.dispose(),W.dispose(),U.dispose(),we.dispose(),Ft.dispose(),sn.dispose(),Ee.dispose(),Le.dispose(),Le.removeEventListener("sessionstart",Vn),Le.removeEventListener("sessionend",jc),Fr.stop()};function _e(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,q=Pe.enabled,oe=Pe.autoUpdate,le=Pe.needsUpdate,te=Pe.type;Y(),dt.autoReset=O,Pe.enabled=q,Pe.autoUpdate=oe,Pe.needsUpdate=le,Pe.type=te}function Oe(O){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",O.statusMessage)}function At(O){const q=O.target;q.removeEventListener("dispose",At),Vt(q)}function Vt(O){Mn(O),Ve.remove(O)}function Mn(O){const q=Ve.get(O).programs;q!==void 0&&(q.forEach(function(oe){Ee.releaseProgram(oe)}),O.isShaderMaterial&&Ee.releaseShaderCache(O))}this.renderBufferDirect=function(O,q,oe,le,te,De){q===null&&(q=Et);const Xe=te.isMesh&&te.matrixWorld.determinant()<0,nt=Mh(O,q,oe,le,te);xe.setMaterial(le,Xe);let Ze=oe.index,ht=1;if(le.wireframe===!0){if(Ze=ye.getWireframeAttribute(oe),Ze===void 0)return;ht=2}const xt=oe.drawRange,ft=oe.attributes.position;let Kt=xt.start*ht,ln=(xt.start+xt.count)*ht;De!==null&&(Kt=Math.max(Kt,De.start*ht),ln=Math.min(ln,(De.start+De.count)*ht)),Ze!==null?(Kt=Math.max(Kt,0),ln=Math.min(ln,Ze.count)):ft!=null&&(Kt=Math.max(Kt,0),ln=Math.min(ln,ft.count));const $t=ln-Kt;if($t<0||$t===1/0)return;Ft.setup(te,le,nt,oe,Ze);let xn,st=Ct;if(Ze!==null&&(xn=ae.get(Ze),st=et,st.setIndex(xn)),te.isMesh)le.wireframe===!0?(xe.setLineWidth(le.wireframeLinewidth*wt()),st.setMode(H.LINES)):st.setMode(H.TRIANGLES);else if(te.isLine){let Ue=le.linewidth;Ue===void 0&&(Ue=1),xe.setLineWidth(Ue*wt()),te.isLineSegments?st.setMode(H.LINES):te.isLineLoop?st.setMode(H.LINE_LOOP):st.setMode(H.LINE_STRIP)}else te.isPoints?st.setMode(H.POINTS):te.isSprite&&st.setMode(H.TRIANGLES);if(te.isBatchedMesh)if(te._multiDrawInstances!==null)st.renderMultiDrawInstances(te._multiDrawStarts,te._multiDrawCounts,te._multiDrawCount,te._multiDrawInstances);else if(be.get("WEBGL_multi_draw"))st.renderMultiDraw(te._multiDrawStarts,te._multiDrawCounts,te._multiDrawCount);else{const Ue=te._multiDrawStarts,fn=te._multiDrawCounts,St=te._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){te(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 Vn(){Fr.stop()}function jc(){Fr.start()}const Fr=new HI;Fr.setAnimationLoop(qi),typeof self!="undefined"&&Fr.setContext(self),this.setAnimationLoop=function(O){jt=O,Le.setAnimationLoop(O),O===null?Fr.stop():Fr.start()},Le.addEventListener("sessionstart",Vn),Le.addEventListener("sessionend",jc),this.render=function(O,q){if(q!==void 0&&q.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(),q.parent===null&&q.matrixWorldAutoUpdate===!0&&q.updateMatrixWorld(),Le.enabled===!0&&Le.isPresenting===!0&&(Le.cameraAutoUpdate===!0&&Le.updateCamera(q),q=Le.getCamera()),O.isScene===!0&&O.onBeforeRender(A,O,q,D),_=Qe.get(O,x.length),_.init(q),x.push(_),Ie.multiplyMatrices(q.projectionMatrix,q.matrixWorldInverse),ot.setFromProjectionMatrix(Ie),Me=this.localClippingEnabled,re=Rt.init(this.clippingPlanes,Me),S=ke.get(O,m.length),S.init(),m.push(S),Le.enabled===!0&&Le.isPresenting===!0){const De=A.xr.getDepthSensingMesh();De!==null&&Ea(De,q,-1/0,A.sortObjects)}Ea(O,q,0,A.sortObjects),S.finish(),A.sortObjects===!0&&S.sort(z,$),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=_.state.shadowsArray;Pe.render(oe,O,q),re===!0&&Rt.endShadows(),this.info.autoReset===!0&&this.info.reset();const le=S.opaque,te=S.transmissive;if(_.setupLights(),q.isArrayCamera){const De=q.cameras;if(te.length>0)for(let Xe=0,nt=De.length;Xe0&&Ca(le,te,O,q),vt&&Ke.render(O),$l(S,O,q);D!==null&&(qe.updateMultisampleRenderTarget(D),qe.updateRenderTargetMipmap(D)),O.isScene===!0&&O.onAfterRender(A,O,q),Ft.resetDefaultState(),N=-1,B=null,x.pop(),x.length>0?(_=x[x.length-1],re===!0&&Rt.setGlobalState(A.clippingPlanes,_.state.camera)):_=null,m.pop(),m.length>0?S=m[m.length-1]:S=null};function Ea(O,q,oe,le){if(O.visible===!1)return;if(O.layers.test(q.layers)){if(O.isGroup)oe=O.renderOrder;else if(O.isLOD)O.autoUpdate===!0&&O.update(q);else if(O.isLight)_.pushLight(O),O.castShadow&&_.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,xt=Ze.length;ht0&&Ta(te,q,oe),De.length>0&&Ta(De,q,oe),Xe.length>0&&Ta(Xe,q,oe),xe.buffers.depth.setTest(!0),xe.buffers.depth.setMask(!0),xe.buffers.color.setMask(!0),xe.setPolygonOffset(!1)}function Ca(O,q,oe,le){if((oe.isScene===!0?oe.overrideMaterial:null)!==null)return;_.state.transmissionRenderTarget[le.id]===void 0&&(_.state.transmissionRenderTarget[le.id]=new xs(1,1,{generateMipmaps:!0,type:be.has("EXT_color_buffer_half_float")||be.has("EXT_color_buffer_float")?nc:ys,minFilter:Yr,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:tn.workingColorSpace}));const De=_.state.transmissionRenderTarget[le.id],Xe=le.viewport||T;De.setSize(Xe.z,Xe.w);const nt=A.getRenderTarget();A.setRenderTarget(De),A.getClearColor(J),K=A.getClearAlpha(),K<1&&A.setClearColor(16777215,.5),A.clear(),vt&&Ke.render(oe);const Ze=A.toneMapping;A.toneMapping=Gs;const ht=le.viewport;if(le.viewport!==void 0&&(le.viewport=void 0),_.setupLightsView(le),re===!0&&Rt.setGlobalState(A.clippingPlanes,le),Ta(O,oe,le),qe.updateMultisampleRenderTarget(De),qe.updateRenderTargetMipmap(De),be.has("WEBGL_multisampled_render_to_texture")===!1){let xt=!1;for(let ft=0,Kt=q.length;ft0),ft=!!oe.morphAttributes.position,Kt=!!oe.morphAttributes.normal,ln=!!oe.morphAttributes.color;let $t=Gs;le.toneMapped&&(D===null||D.isXRRenderTarget===!0)&&($t=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=_.state.lights;if(re===!0&&(Me===!0||O!==B)){const fi=O===B&&le.id===N;Rt.setState(le,O,fi)}let St=!1;le.version===Ue.__version?(Ue.needsLights&&Ue.lightsStateVersion!==fn.state.version||Ue.outputColorSpace!==nt||te.isBatchedMesh&&Ue.batching===!1||!te.isBatchedMesh&&Ue.batching===!0||te.isBatchedMesh&&Ue.batchingColor===!0&&te.colorTexture===null||te.isBatchedMesh&&Ue.batchingColor===!1&&te.colorTexture!==null||te.isInstancedMesh&&Ue.instancing===!1||!te.isInstancedMesh&&Ue.instancing===!0||te.isSkinnedMesh&&Ue.skinning===!1||!te.isSkinnedMesh&&Ue.skinning===!0||te.isInstancedMesh&&Ue.instancingColor===!0&&te.instanceColor===null||te.isInstancedMesh&&Ue.instancingColor===!1&&te.instanceColor!==null||te.isInstancedMesh&&Ue.instancingMorph===!0&&te.morphTexture===null||te.isInstancedMesh&&Ue.instancingMorph===!1&&te.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!==xt||Ue.morphTargets!==ft||Ue.morphNormals!==Kt||Ue.morphColors!==ln||Ue.toneMapping!==$t||Ue.morphTargetsCount!==st)&&(St=!0):(St=!0,Ue.__version=le.version);let un=Ue.currentProgram;St===!0&&(un=ba(le,q,te));let Ui=!1,Fn=!1,Qn=!1;const hn=un.getUniforms(),hr=Ue.uniforms;if(xe.useProgram(un.program)&&(Ui=!0,Fn=!0,Qn=!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 fi=hn.map.cameraPosition;fi!==void 0&&fi.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,Qn=!0)}if(te.isSkinnedMesh){hn.setOptional(H,te,"bindMatrix"),hn.setOptional(H,te,"bindMatrixInverse");const fi=te.skeleton;fi&&(fi.boneTexture===null&&fi.computeBoneTexture(),hn.setValue(H,"boneTexture",fi.boneTexture,qe))}te.isBatchedMesh&&(hn.setOptional(H,te,"batchingTexture"),hn.setValue(H,"batchingTexture",te._matricesTexture,qe),hn.setOptional(H,te,"batchingIdTexture"),hn.setValue(H,"batchingIdTexture",te._indirectTexture,qe),hn.setOptional(H,te,"batchingColorTexture"),te._colorsTexture!==null&&hn.setValue(H,"batchingColorTexture",te._colorsTexture,qe));const Js=oe.morphAttributes;if((Js.position!==void 0||Js.normal!==void 0||Js.color!==void 0)&&kt.update(te,oe,un),(Fn||Ue.receiveShadow!==te.receiveShadow)&&(Ue.receiveShadow=te.receiveShadow,hn.setValue(H,"receiveShadow",te.receiveShadow)),le.isMeshGouraudMaterial&&le.envMap!==null&&(hr.envMap.value=Ze,hr.flipEnvMap.value=Ze.isCubeTexture&&Ze.isRenderTargetTexture===!1?-1:1),le.isMeshStandardMaterial&&le.envMap===null&&q.environment!==null&&(hr.envMapIntensity.value=q.environmentIntensity),Fn&&(hn.setValue(H,"toneMappingExposure",A.toneMappingExposure),Ue.needsLights&&wh(hr,Qn),De&&le.fog===!0&&ut.refreshFogUniforms(hr,De),ut.refreshMaterialUniforms(hr,le,fe,Z,_.state.transmissionRenderTarget[O.id]),Yg.upload(H,Jc(Ue),hr,qe)),le.isShaderMaterial&&le.uniformsNeedUpdate===!0&&(Yg.upload(H,Jc(Ue),hr,qe),le.uniformsNeedUpdate=!1),le.isSpriteMaterial&&hn.setValue(H,"center",te.center),hn.setValue(H,"modelViewMatrix",te.modelViewMatrix),hn.setValue(H,"normalMatrix",te.normalMatrix),hn.setValue(H,"modelMatrix",te.matrixWorld),le.isShaderMaterial||le.isRawShaderMaterial){const fi=le.uniformsGroups;for(let Ra=0,Zi=fi.length;Ra0&&qe.useMultisampledRTT(O)===!1?te=Ve.get(O).__webglMultisampledFramebuffer:Array.isArray(xt)?te=xt[oe]:te=xt,T.copy(O.viewport),F.copy(O.scissor),X=O.scissorTest}else T.copy(ne).multiplyScalar(fe).floor(),F.copy(de).multiplyScalar(fe).floor(),X=Ce;if(xe.bindFramebuffer(H.FRAMEBUFFER,te)&&le&&xe.drawBuffers(O,te),xe.viewport(T),xe.scissor(F),xe.setScissorTest(X),De){const Ze=Ve.get(O.texture);H.framebufferTexture2D(H.FRAMEBUFFER,H.COLOR_ATTACHMENT0,H.TEXTURE_CUBE_MAP_POSITIVE_X+q,Ze.__webglTexture,oe)}else if(Xe){const Ze=Ve.get(O.texture),ht=q||0;H.framebufferTextureLayer(H.FRAMEBUFFER,H.COLOR_ATTACHMENT0,Ze.__webglTexture,oe||0,ht)}N=-1},this.readRenderTargetPixels=function(O,q,oe,le,te,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){xe.bindFramebuffer(H.FRAMEBUFFER,nt);try{const Ze=O.texture,ht=Ze.format,xt=Ze.type;if(!He.textureFormatReadable(ht)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!He.textureTypeReadable(xt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}q>=0&&q<=O.width-le&&oe>=0&&oe<=O.height-te&&H.readPixels(q,oe,le,te,Tt.convert(ht),Tt.convert(xt),De)}finally{const Ze=D!==null?Ve.get(D).__webglFramebuffer:null;xe.bindFramebuffer(H.FRAMEBUFFER,Ze)}}},this.readRenderTargetPixelsAsync=function(O,q,oe,le,te,De,Xe){return du(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){xe.bindFramebuffer(H.FRAMEBUFFER,nt);try{const Ze=O.texture,ht=Ze.format,xt=Ze.type;if(!He.textureFormatReadable(ht))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!He.textureTypeReadable(xt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(q>=0&&q<=O.width-le&&oe>=0&&oe<=O.height-te){const ft=H.createBuffer();H.bindBuffer(H.PIXEL_PACK_BUFFER,ft),H.bufferData(H.PIXEL_PACK_BUFFER,De.byteLength,H.STREAM_READ),H.readPixels(q,oe,le,te,Tt.convert(ht),Tt.convert(xt),0),H.flush();const Kt=H.fenceSync(H.SYNC_GPU_COMMANDS_COMPLETE,0);yield DG(H,Kt,4);try{H.bindBuffer(H.PIXEL_PACK_BUFFER,ft),H.getBufferSubData(H.PIXEL_PACK_BUFFER,0,De)}finally{H.deleteBuffer(ft),H.deleteSync(Kt)}return De}}finally{const Ze=D!==null?Ve.get(D).__webglFramebuffer:null;xe.bindFramebuffer(H.FRAMEBUFFER,Ze)}}})},this.copyFramebufferToTexture=function(O,q=null,oe=0){O.isTexture!==!0&&(ac("WebGLRenderer: copyFramebufferToTexture function signature has changed."),q=arguments[0]||null,O=arguments[1]);const le=Math.pow(2,-oe),te=Math.floor(O.image.width*le),De=Math.floor(O.image.height*le),Xe=q!==null?q.x:0,nt=q!==null?q.y:0;qe.setTexture2D(O,0),H.copyTexSubImage2D(H.TEXTURE_2D,oe,0,0,Xe,nt,te,De),xe.unbindTexture()},this.copyTextureToTexture=function(O,q,oe=null,le=null,te=0){O.isTexture!==!0&&(ac("WebGLRenderer: copyTextureToTexture function signature has changed."),le=arguments[0]||null,O=arguments[1],q=arguments[2],te=arguments[3]||0,oe=null);let De,Xe,nt,Ze,ht,xt;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,xt=le.y):(ht=0,xt=0);const ft=Tt.convert(q.format),Kt=Tt.convert(q.type);qe.setTexture2D(q,0),H.pixelStorei(H.UNPACK_FLIP_Y_WEBGL,q.flipY),H.pixelStorei(H.UNPACK_PREMULTIPLY_ALPHA_WEBGL,q.premultiplyAlpha),H.pixelStorei(H.UNPACK_ALIGNMENT,q.unpackAlignment);const ln=H.getParameter(H.UNPACK_ROW_LENGTH),$t=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[te]: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,te,ht,xt,De,Xe,ft,Kt,fn.data):O.isCompressedTexture?H.compressedTexSubImage2D(H.TEXTURE_2D,te,ht,xt,fn.width,fn.height,ft,fn.data):H.texSubImage2D(H.TEXTURE_2D,te,ht,xt,De,Xe,ft,Kt,fn),H.pixelStorei(H.UNPACK_ROW_LENGTH,ln),H.pixelStorei(H.UNPACK_IMAGE_HEIGHT,$t),H.pixelStorei(H.UNPACK_SKIP_PIXELS,xn),H.pixelStorei(H.UNPACK_SKIP_ROWS,st),H.pixelStorei(H.UNPACK_SKIP_IMAGES,Ue),te===0&&q.generateMipmaps&&H.generateMipmap(H.TEXTURE_2D),xe.unbindTexture()},this.copyTextureToTexture3D=function(O,q,oe=null,le=null,te=0){O.isTexture!==!0&&(ac("WebGLRenderer: copyTextureToTexture3D function signature has changed."),oe=arguments[0]||null,le=arguments[1]||null,O=arguments[2],q=arguments[3],te=arguments[4]||0);let De,Xe,nt,Ze,ht,xt,ft,Kt,ln;const $t=O.isCompressedTexture?O.mipmaps[te]: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,xt=oe.min.z):(De=$t.width,Xe=$t.height,nt=$t.depth,Ze=0,ht=0,xt=0),le!==null?(ft=le.x,Kt=le.y,ln=le.z):(ft=0,Kt=0,ln=0);const xn=Tt.convert(q.format),st=Tt.convert(q.type);let Ue;if(q.isData3DTexture)qe.setTexture3D(q,0),Ue=H.TEXTURE_3D;else if(q.isDataArrayTexture||q.isCompressedArrayTexture)qe.setTexture2DArray(q,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,q.flipY),H.pixelStorei(H.UNPACK_PREMULTIPLY_ALPHA_WEBGL,q.premultiplyAlpha),H.pixelStorei(H.UNPACK_ALIGNMENT,q.unpackAlignment);const fn=H.getParameter(H.UNPACK_ROW_LENGTH),St=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,$t.width),H.pixelStorei(H.UNPACK_IMAGE_HEIGHT,$t.height),H.pixelStorei(H.UNPACK_SKIP_PIXELS,Ze),H.pixelStorei(H.UNPACK_SKIP_ROWS,ht),H.pixelStorei(H.UNPACK_SKIP_IMAGES,xt),O.isDataTexture||O.isData3DTexture?H.texSubImage3D(Ue,te,ft,Kt,ln,De,Xe,nt,xn,st,$t.data):q.isCompressedArrayTexture?H.compressedTexSubImage3D(Ue,te,ft,Kt,ln,De,Xe,nt,xn,$t.data):H.texSubImage3D(Ue,te,ft,Kt,ln,De,Xe,nt,xn,st,$t),H.pixelStorei(H.UNPACK_ROW_LENGTH,fn),H.pixelStorei(H.UNPACK_IMAGE_HEIGHT,St),H.pixelStorei(H.UNPACK_SKIP_PIXELS,un),H.pixelStorei(H.UNPACK_SKIP_ROWS,Ui),H.pixelStorei(H.UNPACK_SKIP_IMAGES,Fn),te===0&&q.generateMipmaps&&H.generateMipmap(Ue),xe.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),xe.unbindTexture()},this.resetState=function(){I=0,P=0,D=null,xe.reset(),Ft.reset()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Vs}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===Ld?"display-p3":"srgb"}}class qg{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new ze(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 ze(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 wS extends Xt{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 fr,this.environmentIntensity=1,this.environmentRotation=new fr,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=Ud,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=Rr()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return ac("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:Zd.clone(),uv:Ir.getInterpolation(Zd,$g,eh,ev,yB,CS,xB,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 tv(n,e,t,i,r,s){Dc.subVectors(n,t).addScalar(.5).multiply(i),r!==void 0?($d.x=s*Dc.x-r*Dc.y,$d.y=r*Dc.x+s*Dc.y):$d.copy(Dc),n.copy(e),n.x+=$d.x,n.y+=$d.y,n.applyMatrix4(vB)}const nv=new G,AB=new G;class SB extends Xt{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){nv.setFromMatrixPosition(this.matrixWorld);const r=e.ray.origin.distanceTo(nv);this.getObjectForDistance(r).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){nv.setFromMatrixPosition(e.matrixWorld),AB.setFromMatrixPosition(this.matrixWorld);const i=nv.distanceTo(AB)/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 xa=new mt,IS=new mt,x8=new mt,_8=new ze(1,1,1),IB=new mt,BS=new Yd,ov=new Bi,Fl=new _i,rh=new G,BB=new G,A8=new G,LS=new y8,Di=new Jn,av=[];function S8(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 Zt(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;x8.toArray(r,t*16),i.needsUpdate=!0;const s=this._colorsTexture;return s&&(_8.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);S8(v,S,l);const _=v.itemSize;for(let m=v.count,x=u;m=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,ov),ov.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;age({},t)),this._reservedRanges=e._reservedRanges.map(t=>ge({},t)),this._drawInfo=e._drawInfo.map(t=>ge({},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&&(IB.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse).multiply(this.matrixWorld),BS.setFromProjectionMatrix(IB,e.coordinateSystem));let S=0;if(this.sortObjects){IS.copy(this.matrixWorld).invert(),rh.setFromMatrixPosition(i.matrixWorld).applyMatrix4(IS),BB.set(0,0,-1).transformDirection(i.matrixWorld).transformDirection(IS);for(let x=0,A=l.length;x0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;si)return;DS.applyMatrix4(n.matrixWorld);const l=e.ray.origin.distanceTo(DS);if(!(le.far))return{distance:l,point:FB.clone().applyMatrix4(n.matrixWorld),index:r,face:null,faceIndex:null,object:n}}const NB=new G,UB=new G;class Es 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 M8 extends Tn{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:zn,this.magFilter=s!==void 0?s:zn,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 w8 extends Tn{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=oi,this.minFilter=oi,this.generateMipmaps=!1,this.needsUpdate=!0}}class mv extends Tn{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 E8 extends mv{constructor(e,t,i,r,s,o){super(e,t,i,s,o),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=br,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class C8 extends mv{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 T8 extends Tn{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 Cs{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(Hn(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(Hn(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 gv extends Cs{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]:(vv.subVectors(r[0],r[1]).add(r[0]),u=vv);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(GB(a,l.x,u.x,d.x,h.x),GB(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 uh extends Dt{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=Hn(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 _=0,m=0;for(let x=0;x<=e.length-1;x++)switch(x){case 0:_=e[x+1].x-e[x].x,m=e[x+1].y-e[x].y,g.x=m*1,g.y=-_,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:_=e[x+1].x-e[x].x,m=e[x+1].y-e[x].y,g.x=m*1,g.y=-_,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 x=0;x<=t;x++){const A=i+x*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=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 x=0;x0&&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 x(){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,K=J*l+a,ie=Math.sin(K),Z=Math.cos(K);I.x=F*ie,I.y=-T*i+_,I.z=F*Z,h.push(I.x,I.y,I.z),w.set(ie,D,Z).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[x+0]+=1),w<.2&&(o[x+2]+=1),I<.2&&(o[x+4]+=1))}}function p(x){s.push(x.x,x.y,x.z)}function g(x,A){const w=x*3;A.x=e[w+0],A.y=e[w+1],A.z=e[w+2]}function v(){const x=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 ch(s,o,t,a,l,g,0),o}};function JB(n,e,t,i,r){let s,o;if(r===q8(n,e,t,i)>0)for(s=e;s=e;s-=i)o=QB(s,n[s],n[s+1],o);return o&&Cv(o,o.next)&&(dh(o),o=o.next),o}function Ul(n,e){if(!n)return n;e||(e=n);let t=n,i;do if(i=!1,!t.steiner&&(Cv(t,t.next)||Dn(t.prev,t,t.next)===0)){if(dh(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function ch(n,e,t,i,r,s,o){if(!n)return;!o&&s&&X8(n,i,r,s);let a=n,l,u;for(;n.prev!==n.next;){if(l=n.prev,u=n.next,s?U8(n,i,r,s):N8(n)){e.push(l.i/t|0),e.push(n.i/t|0),e.push(u.i/t|0),dh(n),n=u.next,a=u.next;continue}if(n=u,n===a){o?o===1?(n=O8(Ul(n),e,t),ch(n,e,t,i,r,s,2)):o===2&&k8(n,e,t,i,r,s):ch(Ul(n),e,t,i,r,s,1);break}}}function N8(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&&Uc(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 U8(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,_=d>h?d>p?d:p:h>p?h:p,m=KS(g,v,e,t,i),x=KS(S,_,e,t,i);let A=n.prevZ,w=n.nextZ;for(;A&&A.z>=m&&w&&w.z<=x;){if(A.x>=g&&A.x<=S&&A.y>=v&&A.y<=_&&A!==r&&A!==o&&Uc(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<=_&&w!==r&&w!==o&&Uc(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<=_&&A!==r&&A!==o&&Uc(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<=x;){if(w.x>=g&&w.x<=S&&w.y>=v&&w.y<=_&&w!==r&&w!==o&&Uc(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 O8(n,e,t){let i=n;do{const r=i.prev,s=i.next.next;!Cv(r,s)&&KB(r,i,i.next,s)&&fh(r,s)&&fh(s,r)&&(e.push(r.i/t|0),e.push(i.i/t|0),e.push(s.i/t|0),dh(i),dh(i.next),i=n=s),i=i.next}while(i!==n);return Ul(i)}function k8(n,e,t,i,r,s){let o=n;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&K8(o,a)){let l=YB(o,a);o=Ul(o,o.next),l=Ul(l,l.next),ch(o,e,t,i,r,s,0),ch(l,e,t,i,r,s,0);return}a=a.next}o=o.next}while(o!==n)}function z8(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&&Uc(or.x||t.x===r.x&&W8(r,t)))&&(r=t,d=h)),t=t.next;while(t!==a);return r}function W8(n,e){return Dn(n.prev,n,e.prev)<0&&Dn(e.next,n,n.next)<0}function X8(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,j8(r)}function j8(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 J8(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 K8(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!Y8(n,e)&&(fh(n,e)&&fh(e,n)&&Q8(n,e)&&(Dn(n.prev,n,e.prev)||Dn(n,e.prev,e))||Cv(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 Cv(n,e){return n.x===e.x&&n.y===e.y}function KB(n,e,t,i){const r=bv(Dn(n,e,t)),s=bv(Dn(n,e,i)),o=bv(Dn(t,i,n)),a=bv(Dn(t,i,e));return!!(r!==s&&o!==a||r===0&&Tv(n,t,e)||s===0&&Tv(n,i,e)||o===0&&Tv(t,n,i)||a===0&&Tv(t,e,i))}function Tv(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 bv(n){return n>0?1:n<0?-1:0}function Y8(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&&KB(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function fh(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 Q8(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 YB(n,e){const t=new YS(n.i,n.x,n.y),i=new YS(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 QB(n,e,t,i){const r=new YS(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 dh(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 YS(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 q8(n,e,t,i){let r=0;for(let s=e,o=t-i;s2&&n[e-1].equals(n[0])&&n.pop()}function ZB(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,ke=Te.y+Ve/we,Qe=be.x-U/Ee,Rt=be.y+W/Ee,Pe=((Qe-ut)*U-(Rt-ke)*W)/(Ve*U-qe*W);He=ut+Ve*Pe-H.x,xe=ke+qe*Pe-H.y;const Ke=He*He+xe*xe;if(Ke<=2)return new Ae(He,xe);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,xe=Ve,dt=Math.sqrt(ae)):(He=Ve,xe=qe,dt=Math.sqrt(ae/2))}return new Ae(He/dt,xe/dt)}const $=[];for(let H=0,Te=K.length,be=Te-1,He=H+1;H=0;H--){const Te=H/_,be=g*Math.cos(Te*Math.PI/2),He=v*Math.sin(Te*Math.PI/2)+S;for(let xe=0,dt=K.length;xe=0;){const He=be;let xe=be-1;xe<0&&(xe=H.length-1);for(let dt=0,Ve=d+_*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 rL extends ai{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new ze(16777215),this.specular=new ze(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ze(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ca,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 fr,this.combine=Md,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 sL extends ai{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new ze(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ze(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ca,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 oL extends ai{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ca,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 aL extends ai{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new ze(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ze(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ca,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 fr,this.combine=Md,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 lL extends ai{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new ze(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ca,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 uL 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 Ol(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 cL(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function fL(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 QS(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 qS(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 tW(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,x=m+h-d;S=a.values.slice(m,x)}else{const m=a.createInterpolant(),x=d,A=h-d;m.evaluate(s),S=m.resultBuffer.slice(x,A)}l==="quaternion"&&new Ii().fromArray(S).normalize().conjugate().toArray(S);const _=u.times.length;for(let m=0;m<_;++m){const x=m*g+p;if(l==="quaternion")Ii.multiplyQuaternionsFlat(u.values,x,S,0,u.values,x);else{const A=g-p*2;for(let w=0;w=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&&cL(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}}Ts.prototype.TimeBufferType=Float32Array,Ts.prototype.ValueBufferType=Float32Array,Ts.prototype.DefaultInterpolation=rc;class kl extends Ts{constructor(e,t,i){super(e,t,i)}}kl.prototype.ValueTypeName="bool",kl.prototype.ValueBufferType=Array,kl.prototype.DefaultInterpolation=ic,kl.prototype.InterpolantFactoryMethodLinear=void 0,kl.prototype.InterpolantFactoryMethodSmooth=void 0;class $S extends Ts{}$S.prototype.ValueTypeName="color";class zl extends Ts{}zl.prototype.ValueTypeName="number";class pL extends Oc{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 Hl extends Ts{InterpolantFactoryMethodLinear(e){return new pL(this.times,this.values,this.getValueSize(),e)}}Hl.prototype.ValueTypeName="quaternion",Hl.prototype.InterpolantFactoryMethodSmooth=void 0;class Gl extends Ts{constructor(e,t,i){super(e,t,i)}}Gl.prototype.ValueTypeName="string",Gl.prototype.ValueBufferType=Array,Gl.prototype.DefaultInterpolation=ic,Gl.prototype.InterpolantFactoryMethodLinear=void 0,Gl.prototype.InterpolantFactoryMethodSmooth=void 0;class Vl extends Ts{}Vl.prototype.ValueTypeName="vector";class kc{constructor(e="",t=-1,i=[],r=wg){this.name=e,this.tracks=i,this.duration=t,this.blendMode=r,this.uuid=Rr(),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(sW(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(Ts.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 _=[],m=[];qS(g,_,m,v),_.length!==0&&S.push(new h(p,_,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 _=new ReadableStream({start(m){x();function x(){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(_)}else throw new oW(`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 aW extends Ni{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new Dr(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 ze().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 Lt().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:nL,SpriteMaterial:ES,RawShaderMaterial:iL,ShaderMaterial:Ms,PointsMaterial:dv,MeshPhysicalMaterial:Zr,MeshStandardMaterial:mh,MeshPhongMaterial:rL,MeshToonMaterial:sL,MeshNormalMaterial:oL,MeshLambertMaterial:aL,MeshDepthMaterial:_S,MeshDistanceMaterial:AS,MeshBasicMaterial:Br,MeshMatcapMaterial:lL,LineDashedMaterial:uL,LineBasicMaterial:Fi,Material:ai};return new t[e]}}class Sa{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 eM(t);s=new gh(l),s.setCrossOrigin(this.crossOrigin);for(let u=0,d=e.length;u0){r=new gh(this.manager),r.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;o{const _=new Bi;_.min.fromArray(S.boxMin),_.max.fromArray(S.boxMax);const m=new _i;return m.radius=S.sphereRadius,m.center.fromArray(S.sphereCenter),{boxInitialized:S.boxInitialized,box:_,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 SB;break;case"Line":o=new To(a(e.geometry),l(e.material));break;case"LineLoop":o=new FS(a(e.geometry),l(e.material));break;case"LineSegments":o=new Es(a(e.geometry),l(e.material));break;case"PointCloud":case"Points":o=new US(a(e.geometry),l(e.material));break;case"Sprite":o=new _B(l(e.material));break;case"Group":o=new Co;break;case"Bone":o=new rv;break;default:o=new Xt}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 Ov;class aM{static getContext(){return Ov===void 0&&(Ov=new(window.AudioContext||window.webkitAudioContext)),Ov}static setContext(e){Ov=e}}class gW extends Ni{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new Dr(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);aM.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 PL=new mt,IL=new mt,Wl=new mt;class vW{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new li,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new li,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,Wl.copy(e.projectionMatrix);const r=t.eyeSep/2,s=r*t.near/t.focus,o=t.near*Math.tan(Sl*t.fov*.5)/t.zoom;let a,l;IL.elements[12]=-r,PL.elements[12]=r,a=-o*t.aspect+s,l=o*t.aspect+s,Wl.elements[0]=2*t.near/(l-a),Wl.elements[8]=(l+a)/(l-a),this.cameraL.projectionMatrix.copy(Wl),a=-o*t.aspect-s,l=o*t.aspect-s,Wl.elements[0]=2*t.near/(l-a),Wl.elements[8]=(l+a)/(l-a),this.cameraR.projectionMatrix.copy(Wl)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(IL),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(PL)}}class lM{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=BL(),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=BL();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function BL(){return(typeof performance=="undefined"?Date:performance).now()}const Xl=new G,LL=new Ii,yW=new G,jl=new G;class xW extends Xt{constructor(){super(),this.type="AudioListener",this.context=aM.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new lM}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(Xl,LL,yW),jl.set(0,0,-1).applyQuaternion(LL),t.positionX){const r=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Xl.x,r),t.positionY.linearRampToValueAtTime(Xl.y,r),t.positionZ.linearRampToValueAtTime(Xl.z,r),t.forwardX.linearRampToValueAtTime(jl.x,r),t.forwardY.linearRampToValueAtTime(jl.y,r),t.forwardZ.linearRampToValueAtTime(jl.z,r),t.upX.linearRampToValueAtTime(i.x,r),t.upY.linearRampToValueAtTime(i.y,r),t.upZ.linearRampToValueAtTime(i.z,r)}else t.setPosition(Xl.x,Xl.y,Xl.z),t.setOrientation(jl.x,jl.y,jl.z,i.x,i.y,i.z)}}class DL extends Xt{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 uM="\\[\\]\\.:\\/",MW=new RegExp("["+uM+"]","g"),cM="[^"+uM+"]",wW="[^"+uM.replace("\\.","")+"]",EW=/((?:WC+[\/:])*)/.source.replace("WC",cM),CW=/(WCOD+)?/.source.replace("WCOD",wW),TW=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",cM),bW=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",cM),RW=new RegExp("^"+EW+CW+TW+bW+"$"),PW=["material","materials","bones","map"];class IW{constructor(e,t,i){const r=i||Jt.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 Jt{constructor(e,t,i){this.path=t,this.parsedPath=i||Jt.parseTrackName(t),this.node=Jt.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 Jt.Composite(e,t,i):new Jt(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(MW,"")}static parseTrackName(e){const t=RW.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);PW.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],_=S[h],m=S[d];S[d]=_,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 _=i[v];_[h]=_[p],_.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 Jt(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 UL{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:xl,endingEnd:xl};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=ZP,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 UA: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===$P;if(e===0)return s===-1?r:o&&(s&1)===1?t-r:r;if(i===qP){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=_l,r.endingEnd=_l):(e?r.endingStart=this.zeroSlopeAtStart?_l:xl:r.endingStart=Bd,t?r.endingEnd=this.zeroSlopeAtEnd?_l:xl:r.endingEnd=Bd)}_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 LW=new Float32Array(1);class DW 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 NL(Jt.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,HL).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 GL=new G,kv=new G;class GW{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){GL.subVectors(e,this.start),kv.subVectors(this.end,this.start);const i=kv.dot(kv);let s=kv.dot(GL)/i;return t&&(s=Hn(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 VL=new G;class VW extends Xt{constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const i=new Dt,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{YL.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(YL,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 n6 extends Es{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 Dt;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 ze,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 i6{constructor(){this.type="ShapePath",this.color=new ze,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new lh,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 x=[];for(let A=0,w=m.length;ANumber.EPSILON){if(T<0&&(D=x[P],B=-B,N=x[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=Xs.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 Nl,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,x=s.length;m1){let m=!1,x=0;for(let A=0,w=p.length;A0&&m===!1&&(g=h)}let _;for(let m=0,x=p.length;mt=>(i,r)=>{i[n]===void 0&&(i[n]=new G(e)),i[n].setComponent(t,r)},o6=(n,e)=>t=>(i,r)=>{i[n]===void 0&&(i[n]=new fr(e));const s=i[n];s[t]=r},qL=n=>(e,t)=>{e[n]===void 0&&(e[n]=new ze(t)),e[n].set(t)},gM=QL("scale",1),vM=QL("position",0),yM=o6("rotation",0),ZL={x:vM(0),y:vM(1),z:vM(2),scale:(n,e)=>{n.scale===void 0&&(n.scale=new G(1)),n.scale.set(e,e,e)},scaleX:gM(0),scaleY:gM(1),scaleZ:gM(2),rotateX:yM("x"),rotateY:yM("y"),rotateZ:yM("z"),color:qL("color"),specular:qL("specular")};function a6(n,e,t){e in ZL?ZL[e](n,t[e]):(e==="opacity"&&!n.transparent&&(n.transparent=!0),n[e]=t[e])}const xM=(n,e)=>t=>i=>{const r=i[n];return r?r[t]:e},_M=xM("position",0),Xv=xM("scale",1),AM=xM("rotation",0),$L={x:_M("x"),y:_M("y"),z:_M("z"),scale:Xv("x"),scaleX:Xv("x"),scaleY:Xv("y"),scaleZ:Xv("z"),rotateX:AM("x"),rotateY:AM("y"),rotateZ:AM("z")};function l6(n){if(n!==void 0)return n instanceof ze?n.getStyle():n}function u6(n,e){return e in $L?$L[e](n):l6(n[e])||0}const c6=["x","y","z"],e2={"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"},t2=(n,e)=>{const t={};let i;for(i in n){const r=n[i];if(Cn(r)||Cn(e[i])){const s=e2[i]||i;t[s]=r}else if(Array.isArray(r))for(let s=0;s({});class d6 extends YR{constructor(){super(...arguments),this.type="three",this.measureInstanceViewportBox=kn}readValueFromInstance(e,t){return u6(e,t)}getBaseTargetFromProps(){}sortInstanceNodePosition(e,t){return e.id-t.id}removeValueFromRenderState(){}scrapeMotionValuesFromProps(e,t){return t2(e,t)}build(e,t){for(const i in t)e[i]=t[i]}renderInstance(e,t){for(const i in t)a6(e,i,t)}}const h6=(n,e)=>new d6(e,{}),p6=x_({scrapeMotionValuesFromProps:t2,createRenderState:f6}),m6=ge({},kb);function n2(n){return pT({Component:n,preloadedFeatures:m6,useRender:NH,useVisualState:p6,createVisualElement:h6})}const SM=new Map,i2=new Proxy(n2,{get:(n,e)=>(!SM.has(e)&&SM.set(e,n2(e)),SM.get(e))});var r2={exports:{}},Yl={};/** * @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. */Yl.ConcurrentRoot=1,Yl.ContinuousEventPriority=4,Yl.DefaultEventPriority=16,Yl.DiscreteEventPriority=1,Yl.IdleEventPriority=536870912,Yl.LegacyRoot=0,r2.exports=Yl;var yh=r2.exports;function g6(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 s2=typeof window=="undefined"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent)?me.useEffect:me.useLayoutEffect;function v6(n){const e=typeof n=="function"?g6(n):n,t=(i=e.getState,r=Object.is)=>{const[,s]=me.useReducer(_=>_+1,0),o=e.getState(),a=me.useRef(o),l=me.useRef(i),u=me.useRef(r),d=me.useRef(!1),h=me.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)),s2(()=>{g&&(h.current=p),a.current=o,l.current=i,u.current=r,d.current=!1});const v=me.useRef(o);s2(()=>{const _=()=>{try{const x=e.getState(),A=l.current(x);u.current(h.current,A)||(a.current=x,h.current=A,s())}catch(x){d.current=!0,s()}},m=e.subscribe(_);return e.getState()!==v.current&&_(),m},[]);const S=g?p:h.current;return me.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 y6=n=>typeof n=="object"&&typeof n.then=="function",Ql=[];function o2(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=Ql.indexOf(r);s!==-1&&Ql.splice(s,1)},promise:(y6(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(Ql.push(r),!t)throw r.promise}const x6=(n,e,t)=>a2(n,e,!1,t),_6=(n,e,t)=>void a2(n,e,!0,t),A6=n=>{if(n===void 0||n.length===0)Ql.splice(0,Ql.length);else{const e=Ql.find(t=>o2(n,t.keys,t.equal));e&&e.remove()}};var l2={exports:{}},u2={exports:{}},c2={};/** * @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,$){var ne=z.length;z.push($);e:for(;0>>1,Ce=z[de];if(0>>1;der(Me,ne))Ier(Be,Me)?(z[de]=Be,z[Ie]=ne,de=Ie):(z[de]=Me,z[re]=ne,de=re);else if(Ier(Be,ne))z[de]=Be,z[Ie]=ne,de=Ie;else break e}}return $}function r(z,$){var ne=z.sortIndex-$.sortIndex;return ne!==0?ne:z.id-$.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,_=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,x=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 $=t(u);$!==null;){if($.callback===null)i(u);else if($.startTime<=z)i(u),$.sortIndex=$.expirationTime,e(l,$);else break;$=t(u)}}function w(z){if(S=!1,A(z),!v)if(t(l)!==null)v=!0,Z(I);else{var $=t(u);$!==null&&fe(w,$.startTime-z)}}function I(z,$){v=!1,S&&(S=!1,m(N),N=-1),g=!0;var ne=p;try{for(A($),h=t(l);h!==null&&(!(h.expirationTime>$)||z&&!F());){var de=h.callback;if(typeof de=="function"){h.callback=null,p=h.priorityLevel;var Ce=de(h.expirationTime<=$);$=n.unstable_now(),typeof Ce=="function"?h.callback=Ce:h===t(l)&&i(l),A($)}else i(l);h=t(l)}if(h!==null)var ot=!0;else{var re=t(u);re!==null&&fe(w,re.startTime-$),ot=!1}return ot}finally{h=null,p=ne,g=!1}}var P=!1,D=null,N=-1,B=5,T=-1;function F(){return!(n.unstable_now()-Tz||125de?(z.sortIndex=ne,e(u,z),t(l)===null&&z===t(u)&&(S?(m(N),N=-1):S=!0,fe(w,ne-de))):(z.sortIndex=Ce,e(l,z),v||g||(v=!0,Z(I))),z},n.unstable_shouldYield=F,n.unstable_wrapCallback=function(z){var $=p;return function(){var ne=p;p=$;try{return z.apply(this,arguments)}finally{p=ne}}}})(c2),u2.exports=c2;var MM=u2.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 S6=function(e){var t={},i=me,r=MM,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 pe=` `+E[V].replace(" at new "," at ");return c.displayName&&pe.includes("")&&(pe=pe.replace("",c.displayName)),pe}while(1<=V&&0<=Q);break}}}finally{xt=!1,Error.prepareStackTrace=y}return(c=c?c.displayName||c.name:"")?ht(c):""}var Kt=Object.prototype.hasOwnProperty,ln=[],$t=-1;function xn(c){return{current:c}}function st(c){0>$t||(c.current=ln[$t],ln[$t]=null,$t--)}function Ue(c,f){$t++,ln[$t]=c.current,c.current=f}var fn={},St=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 Qn(c){return c=c.childContextTypes,c!=null}function hn(){st(un),st(St)}function hr(c,f,y){if(St.current!==fn)throw Error(o(168));Ue(St,f),Ue(un,y)}function Js(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 fi(c){return c=(c=c.stateNode)&&c.__reactInternalMemoizedMergedChildContext||fn,Ui=St.current,Ue(St,c),Ue(un,un.current),!0}function Ra(c,f,y){var M=c.stateNode;if(!M)throw Error(o(169));y?(c=Js(c,f,Ui),M.__reactInternalMemoizedMergedChildContext=c,st(un),st(St),Ue(St,c)):st(un),Ue(un,y)}var Zi=Math.clz32?Math.clz32:jM,Qc=Math.log,XM=Math.LN2;function jM(c){return c>>>=0,c===0?32:31-(Qc(c)/XM|0)|0}var qc=64,Pa=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 Zc(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 eu(c,f,y){c.pendingLanes|=f,f!==536870912&&(c.suspendedLanes=0,c.pingedLanes=0),c=c.eventTimes,f=31-Zi(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,Rs=1<<32-Zi(f)+E|y<nn?(gi=It,It=null):gi=It.sibling;var rn=_t(se,It,ce[nn],Ye);if(rn===null){It===null&&(It=gi);break}c&&It&&rn.alternate===null&&f(se,It),ee=R(rn,ee,nn),Ot===null?lt=rn:Ot.sibling=rn,Ot=rn,It=gi}if(nn===ce.length)return y(se,It),_n&&Do(se,nn),lt;if(It===null){for(;nnnn?(gi=It,It=null):gi=It.sibling;var Wa=_t(se,It,rn.value,Ye);if(Wa===null){It===null&&(It=gi);break}c&&It&&Wa.alternate===null&&f(se,It),ee=R(Wa,ee,nn),Ot===null?lt=Wa:Ot.sibling=Wa,Ot=Wa,It=gi}if(rn.done)return y(se,It),_n&&Do(se,nn),lt;if(It===null){for(;!rn.done;nn++,rn=ce.next())rn=Pt(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(It=M(se,It);!rn.done;nn++,rn=ce.next())rn=pn(It,se,nn,rn.value,Ye),rn!==null&&(c&&rn.alternate!==null&&It.delete(rn.key===null?nn:rn.key),ee=R(rn,ee,nn),Ot===null?lt=rn:Ot.sibling=rn,Ot=rn);return c&&It.forEach(function(bj){return f(se,bj)}),_n&&Do(se,nn),lt}function os(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=iu(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=fu(ce.props.children,se.mode,Ye,ce.key),ee.return=se,se=ee):(Ye=Vy(ce.type,ce.key,ce.props,null,se.mode,Ye),Ye.ref=iu(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=Fw(ce,se.mode,Ye),ee.return=se,se=ee}return V(se);case A:return Ot=ce._init,os(se,ee,Ot(ce._payload),Ye)}if(ie(ce))return ct(se,ee,ce,Ye);if(P(ce))return zi(se,ee,ce,Ye);lf(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=Dw(ce,se.mode,Ye),ee.return=se,se=ee),V(se)):y(se,ee)}return os}var L=C(!0),k=C(!1),j={},ue=xn(j),he=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(he,c),Ue(ue,j),c=fe(f),st(ue),Ue(ue,c)}function pt(){st(ue),st(he),st(Fe)}function Nn(c){var f=Je(Fe.current),y=Je(ue.current);f=z(y,c.type,f),y!==f&&(Ue(he,c),Ue(ue,f))}function Wn(c){he.current===c&&(st(ue),st(he))}var Qt=xn(0);function Is(c){for(var f=c;f!==null;){if(f.tag===13){var y=f.memoizedState;if(y!==null&&(y=y.dehydrated,y===null||$l(y)||Ca(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{Yt=y,zt.transition=M}}function cD(){return Zs().memoizedState}function tj(c,f,y){var M=Ha(c);y={lane:M,action:y,hasEagerState:!1,eagerState:null,next:null},fD(c)?dD(f,y):(hD(c,f,y),y=nr(),c=rs(c,M,y),c!==null&&pD(c,f,M))}function nj(c,f,y){var M=Ha(c),E={lane:M,action:y,hasEagerState:!1,eagerState:null,next:null};if(fD(c))dD(f,E);else{hD(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,ts(Q,V))return}catch(pe){}finally{}y=nr(),c=rs(c,M,y),c!==null&&pD(c,f,M)}}function fD(c){var f=c.alternate;return c===Ht||f!==null&&f===Ht}function dD(c,f){ru=Oa=!0;var y=c.pending;y===null?f.next=f:(f.next=y.next,y.next=f),c.pending=f}function hD(c,f,y){ti!==null&&c.mode&1&&!(Gt&2)?(c=f.interleaved,c===null?(y.next=y,ns===null?ns=[f]:ns.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 pD(c,f,y){if(y&4194240){var M=f.lanes;M&=c.pendingLanes,y|=M,f.lanes=y,Th(c,y)}}var _y={readContext:mr,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},ij={readContext:mr,useCallback:function(c,f){return Fo().memoizedState=[c,f===void 0?null:f],c},useContext:mr,useEffect:ow,useImperativeHandle:function(c,f,y){return y=y!=null?y.concat([c]):null,yy(4194308,4,oD.bind(null,f,c),y)},useLayoutEffect:function(c,f){return yy(4194308,4,c,f)},useInsertionEffect:function(c,f){return yy(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=tj.bind(null,Ht,c),[M.memoizedState,c]},useRef:function(c){var f=Fo();return c={current:c},f.memoizedState=c},useState:sw,useDebugValue:aw,useDeferredValue:function(c){var f=sw(c),y=f[0],M=f[1];return ow(function(){var E=zt.transition;zt.transition={};try{M(c)}finally{zt.transition=E}},[c]),y},useTransition:function(){var c=sw(!1),f=c[0];return c=ej.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||$2(M,f,y)}E.memoizedState=y;var R={value:y,getSnapshot:f};return E.queue=R,ow(tD.bind(null,M,R,c),[c]),M.flags|=2048,Wh(9,eD.bind(null,M,R,y,f),void 0,null),y},useId:function(){var c=Fo(),f=ti.identifierPrefix;if(_n){var y=Ps,M=Rs;y=(M&~(1<<32-Zi(M)-1)).toString(32)+y,f=":"+f+"R"+y,y=Vh++,0Cw&&(f.flags|=128,M=!0,Kh(E,!1),f.lanes=4194304)}else{if(!M)if(c=Is(R),c!==null){if(f.flags|=128,M=!0,c=c.updateQueue,c!==null&&(f.updateQueue=c,f.flags|=4),Kh(E,!0),E.tail===null&&E.tailMode==="hidden"&&!R.alternate&&!_n)return ki(f),null}else 2*qn()-E.renderingStartTime>Cw&&y!==1073741824&&(f.flags|=128,M=!0,Kh(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 Iw(),M=f.memoizedState!==null,c!==null&&c.memoizedState!==null!==M&&(f.flags|=8192),M&&f.mode&1?kr&1073741824&&(ki(f),wt&&f.subtreeFlags&6&&(f.flags|=8192)):ki(f),null;case 24:return null;case 25:return null}throw Error(o(156,f.tag))}var lj=a.ReactCurrentOwner,Or=!1;function tr(c,f,y,M){f.child=c===null?k(f,null,y,M):L(f,c.child,y,M)}function SD(c,f,y,M,E){y=y.render;var R=f.ref;return La(f,E),M=iw(c,f,y,M,R,E),y=rw(),c!==null&&!Or?(f.updateQueue=c.updateQueue,f.flags&=-2053,c.lanes&=~E,No(c,f,E)):(_n&&y&&Uh(f),f.flags|=1,tr(c,f,M,E),f.child)}function MD(c,f,y,M,E){if(c===null){var R=y.type;return typeof R=="function"&&!Lw(R)&&R.defaultProps===void 0&&y.compare===null&&y.defaultProps===void 0?(f.tag=15,f.type=R,wD(c,f,R,M,E)):(c=Vy(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:tf,y(V,M)&&c.ref===f.ref)return No(c,f,E)}return f.flags|=1,c=Va(R,M),c.ref=f.ref,c.return=f,f.child=c}function wD(c,f,y,M,E){if(c!==null&&tf(c.memoizedProps,M)&&c.ref===f.ref)if(Or=!1,(c.lanes&E)!==0)c.flags&131072&&(Or=!0);else return f.lanes=c.lanes,No(c,f,E);return cw(c,f,y,M,E)}function ED(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(uf,kr),kr|=y;else if(y&1073741824)f.memoizedState={baseLanes:0,cachePool:null},M=R!==null?R.baseLanes:y,Ue(uf,kr),kr|=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(uf,kr),kr|=c,null;else R!==null?(M=R.baseLanes|y,f.memoizedState=null):M=y,Ue(uf,kr),kr|=M;return tr(c,f,E,y),f.child}function CD(c,f){var y=f.ref;(c===null&&y!==null||c!==null&&c.ref!==y)&&(f.flags|=512,f.flags|=2097152)}function cw(c,f,y,M,E){var R=Qn(y)?Ui:St.current;return R=Fn(f,R),La(f,E),y=iw(c,f,y,M,R,E),M=rw(),c!==null&&!Or?(f.updateQueue=c.updateQueue,f.flags&=-2053,c.lanes&=~E,No(c,f,E)):(_n&&M&&Uh(f),f.flags|=1,tr(c,f,y,E),f.child)}function TD(c,f,y,M,E){if(Qn(y)){var R=!0;fi(f)}else R=!1;if(La(f,E),f.stateNode===null)c!==null&&(c.alternate=null,f.alternate=null,f.flags|=2),fy(f,y,M),Nh(f,y,M,E),M=!0;else if(c===null){var V=f.stateNode,Q=f.memoizedProps;V.props=Q;var pe=V.context,Ne=y.contextType;typeof Ne=="object"&&Ne!==null?Ne=mr(Ne):(Ne=Qn(y)?Ui:St.current,Ne=Fn(f,Ne));var it=y.getDerivedStateFromProps,Pt=typeof it=="function"||typeof V.getSnapshotBeforeUpdate=="function";Pt||typeof V.UNSAFE_componentWillReceiveProps!="function"&&typeof V.componentWillReceiveProps!="function"||(Q!==M||pe!==Ne)&&dy(f,V,M,Ne),Ys=!1;var _t=f.memoizedState;V.state=_t,sf(f,M,V,E),pe=f.memoizedState,Q!==M||_t!==pe||un.current||Ys?(typeof it=="function"&&(of(f,y,it,M),pe=f.memoizedState),(Q=Ys||cy(f,y,Q,M,_t,pe,Ne))?(Pt||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=pe),V.props=M,V.state=pe,V.context=Ne,M=Q):(typeof V.componentDidMount=="function"&&(f.flags|=4194308),M=!1)}else{V=f.stateNode,oy(c,f),Q=f.memoizedProps,Ne=f.type===f.elementType?Q:Ur(f.type,Q),V.props=Ne,Pt=f.pendingProps,_t=V.context,pe=y.contextType,typeof pe=="object"&&pe!==null?pe=mr(pe):(pe=Qn(y)?Ui:St.current,pe=Fn(f,pe));var pn=y.getDerivedStateFromProps;(it=typeof pn=="function"||typeof V.getSnapshotBeforeUpdate=="function")||typeof V.UNSAFE_componentWillReceiveProps!="function"&&typeof V.componentWillReceiveProps!="function"||(Q!==Pt||_t!==pe)&&dy(f,V,M,pe),Ys=!1,_t=f.memoizedState,V.state=_t,sf(f,M,V,E);var ct=f.memoizedState;Q!==Pt||_t!==ct||un.current||Ys?(typeof pn=="function"&&(of(f,y,pn,M),ct=f.memoizedState),(Ne=Ys||cy(f,y,Ne,M,_t,ct,pe)||!1)?(it||typeof V.UNSAFE_componentWillUpdate!="function"&&typeof V.componentWillUpdate!="function"||(typeof V.componentWillUpdate=="function"&&V.componentWillUpdate(M,ct,pe),typeof V.UNSAFE_componentWillUpdate=="function"&&V.UNSAFE_componentWillUpdate(M,ct,pe)),typeof V.componentDidUpdate=="function"&&(f.flags|=4),typeof V.getSnapshotBeforeUpdate=="function"&&(f.flags|=1024)):(typeof V.componentDidUpdate!="function"||Q===c.memoizedProps&&_t===c.memoizedState||(f.flags|=4),typeof V.getSnapshotBeforeUpdate!="function"||Q===c.memoizedProps&&_t===c.memoizedState||(f.flags|=1024),f.memoizedProps=M,f.memoizedState=ct),V.props=M,V.state=ct,V.context=pe,M=Ne):(typeof V.componentDidUpdate!="function"||Q===c.memoizedProps&&_t===c.memoizedState||(f.flags|=4),typeof V.getSnapshotBeforeUpdate!="function"||Q===c.memoizedProps&&_t===c.memoizedState||(f.flags|=1024),M=!1)}return fw(c,f,y,M,R,E)}function fw(c,f,y,M,E,R){CD(c,f);var V=(f.flags&128)!==0;if(!M&&!V)return E&&Ra(f,y,!1),No(c,f,R);M=f.stateNode,lj.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)):tr(c,f,Q,R),f.memoizedState=M.state,E&&Ra(f,y,!0),f.child}function bD(c){var f=c.stateNode;f.pendingContext?hr(c,f.pendingContext,f.pendingContext!==f.context):f.context&&hr(c,f.context,!1),gt(c,f.containerInfo)}function RD(c,f,y,M,E){return Ua(),Gh(E),f.flags|=256,tr(c,f,y,M),f.child}var My={dehydrated:null,treeContext:null,retryLane:0};function wy(c){return{baseLanes:c,cachePool:null}}function PD(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 zh(f),c=f.memoizedState,c!==null&&(c=c.dehydrated,c!==null)?(f.mode&1?Ca(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=Wy(E,M,0,null),c=fu(c,M,y,null),R.return=f,c.return=f,R.sibling=c,f.child=R,f.child.memoizedState=wy(y),f.memoizedState=My,c):dw(f,E));if(E=c.memoizedState,E!==null){if(Q=E.dehydrated,Q!==null){if(V)return f.flags&256?(f.flags&=-257,Ey(c,f,y,Error(o(422)))):f.memoizedState!==null?(f.child=c.child,f.flags|=128,null):(R=M.fallback,E=f.mode,M=Wy({mode:"visible",children:M.children},E,0,null),R=fu(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=wy(y),f.memoizedState=My,R);if(!(f.mode&1))f=Ey(c,f,y,null);else if(Ca(Q))f=Ey(c,f,y,Error(o(419)));else if(M=(y&c.childLanes)!==0,Or||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,rs(c,M,-1))}Bw(),f=Ey(c,f,y,Error(o(421)))}else $l(Q)?(f.flags|=128,f.child=c.child,f=Aj.bind(null,c),Ta(Q,f),f=null):(y=E.treeContext,Te&&(er=Kc(Q),$i=f,_n=!0,Si=null,nu=!1,y!==null&&(gr[vr++]=Rs,gr[vr++]=Ps,gr[vr++]=Lo,Rs=y.id,Ps=y.overflow,Lo=f)),f=dw(f,f.pendingProps.children),f.flags|=4096);return f}return R?(M=BD(c,f,M.children,M.fallback,y),R=f.child,E=c.child.memoizedState,R.memoizedState=E===null?wy(y):{baseLanes:E.baseLanes|y,cachePool:null},R.childLanes=c.childLanes&~y,f.memoizedState=My,M):(y=ID(c,f,M.children,y),f.memoizedState=null,y)}return R?(M=BD(c,f,M.children,M.fallback,y),R=f.child,E=c.child.memoizedState,R.memoizedState=E===null?wy(y):{baseLanes:E.baseLanes|y,cachePool:null},R.childLanes=c.childLanes&~y,f.memoizedState=My,M):(y=ID(c,f,M.children,y),f.memoizedState=null,y)}function dw(c,f){return f=Wy({mode:"visible",children:f},c.mode,0,null),f.return=c,c.child=f}function ID(c,f,y,M){var E=c.child;return c=E.sibling,y=Va(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 BD(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=Va(c,Q),y.subtreeFlags=c.subtreeFlags&14680064),V!==null?M=Va(V,M):(M=fu(M,R,E,null),M.flags|=2),M.return=f,y.return=f,y.sibling=M,f.child=y,M}function Ey(c,f,y,M){return M!==null&&Gh(M),L(f,c.child,null,y),c=dw(f,f.pendingProps.children),c.flags|=2,f.memoizedState=null,c}function LD(c,f,y){c.lanes|=f;var M=c.alternate;M!==null&&(M.lanes|=f),Dh(c.return,f,y)}function hw(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 DD(c,f,y){var M=f.pendingProps,E=M.revealOrder,R=M.tail;if(tr(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&&LD(c,y,f);else if(c.tag===19)LD(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&&Is(c)===null&&(E=y),y=y.sibling;y=E,y===null?(E=f.child,f.child=null):(E=y.sibling,y.sibling=null),hw(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&&Is(c)===null){f.child=E;break}c=E.sibling,E.sibling=y,y=E,E=c}hw(f,!0,y,null,R);break;case"together":hw(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),cf|=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=Va(c,c.pendingProps),f.child=y,y.return=f;c.sibling!==null;)c=c.sibling,y=y.sibling=Va(c,c.pendingProps),y.return=f;y.sibling=null}return f.child}function uj(c,f,y){switch(f.tag){case 3:bD(f),Ua();break;case 5:Nn(f);break;case 1:Qn(f.type)&&fi(f);break;case 4:gt(f,f.stateNode.containerInfo);break;case 10:sy(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?PD(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 DD(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,ED(c,f,y)}return No(c,f,y)}function cj(c,f){switch(Oh(f),f.tag){case 1:return Qn(f.type)&&hn(),c=f.flags,c&65536?(f.flags=c&-65537|128,f):null;case 3:return pt(),st(un),st(St),at(),c=f.flags,c&65536&&!(c&128)?(f.flags=c&-65537|128,f):null;case 5:return Wn(f),null;case 13:if(st(Qt),c=f.memoizedState,c!==null&&c.dehydrated!==null){if(f.alternate===null)throw Error(o(340));Ua()}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 Lh(f.type._context),null;case 22:case 23:return Iw(),null;case 24:return null;default:return null}}var Cy=!1,ou=!1,fj=typeof WeakSet=="function"?WeakSet:Set,je=null;function Ty(c,f){var y=c.ref;if(y!==null)if(typeof y=="function")try{y(null)}catch(M){_r(c,f,M)}else y.current=null}function pw(c,f,y){try{y()}catch(M){_r(c,f,M)}}var FD=!1;function dj(c,f){for($(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:Ur(c.type,M),E);R.__reactInternalSnapshotBeforeUpdate=V}break;case 3:wt&&Oe(c.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(Q){_r(c,c.return,Q)}if(f=c.sibling,f!==null){f.return=c.return,je=f;break}je=c.return}return y=FD,FD=!1,y}function au(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&&pw(f,y,R)}E=E.next}while(E!==M)}}function Yh(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 mw(c){var f=c.ref;if(f!==null){var y=c.stateNode;switch(c.tag){case 5:c=Z(y);break;default:c=y}typeof f=="function"?f(c):f.current=c}}function ND(c,f,y){if(es&&typeof es.onCommitFiberUnmount=="function")try{es.onCommitFiberUnmount(ef,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)&&pw(f,y,R),M=M.next}while(M!==c)}break;case 1:if(Ty(f,y),c=f.stateNode,typeof c.componentWillUnmount=="function")try{c.props=f.memoizedProps,c.state=f.memoizedState,c.componentWillUnmount()}catch(V){_r(f,y,V)}break;case 5:Ty(f,y);break;case 4:wt?GD(c,f,y):H&&H&&(f=f.stateNode.containerInfo,y=Vt(f),jt(f,y))}}function UD(c,f,y){for(var M=f;;)if(ND(c,M,y),M.child===null||wt&&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 OD(c){var f=c.alternate;f!==null&&(c.alternate=null,OD(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 kD(c){return c.tag===5||c.tag===3||c.tag===4}function zD(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||kD(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 HD(c){if(wt){e:{for(var f=c.return;f!==null;){if(kD(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=zD(c),vw(c,y,f);break;case 3:case 4:f=y.stateNode.containerInfo,y=zD(c),gw(c,y,f);break;default:throw Error(o(161))}}}function gw(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(gw(c,f,y),c=c.sibling;c!==null;)gw(c,f,y),c=c.sibling}function vw(c,f,y){var M=c.tag;if(M===5||M===6)c=c.stateNode,f?Ct(y,c,f):Qe(y,c);else if(M!==4&&(c=c.child,c!==null))for(vw(c,f,y),c=c.sibling;c!==null;)vw(c,f,y),c=c.sibling}function GD(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)UD(c,M,y),V?Ft(R,M.stateNode):Tt(R,M.stateNode);else if(M.tag===18)V?te(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(ND(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 yw(c,f){if(wt){switch(f.tag){case 0:case 11:case 14:case 15:au(3,f,f.return),Yh(3,f),au(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&&q(f.stateNode.containerInfo);return;case 12:return;case 13:by(f);return;case 19:by(f);return;case 17:return}throw Error(o(163))}switch(f.tag){case 0:case 11:case 14:case 15:au(3,f,f.return),Yh(3,f),au(5,f,f.return);return;case 12:return;case 13:by(f);return;case 19:by(f);return;case 3:Te&&c!==null&&c.memoizedState.isDehydrated&&q(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 by(c){var f=c.updateQueue;if(f!==null){c.updateQueue=null;var y=c.stateNode;y===null&&(y=c.stateNode=new fj),f.forEach(function(M){var E=Sj.bind(null,c,M);y.has(M)||(y.add(M),M.then(E,E))})}}function hj(c,f){for(je=f;je!==null;){f=je;var y=f.deletions;if(y!==null)for(var M=0;M";case Py:return":has("+(Aw(c)||"")+")";case Iy:return'[role="'+c.value+'"]';case Ly:return'"'+c.value+'"';case By:return'[data-testname="'+c.value+'"]';default:throw Error(o(365))}}function JD(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*mj(M/1960))-M,10c?16:c,za===null)var M=!1;else{if(c=za,za=null,Oy=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 pe=0;peqn()-Ew?lu(c,0):ww|=y),xr(c,f)}function nF(c,f){f===0&&(c.mode&1?(f=Pa,Pa<<=1,!(Pa&130023424)&&(Pa=4194304)):f=1);var y=nr();c=Hy(c,f),c!==null&&(eu(c,f,y),xr(c,y))}function Aj(c){var f=c.memoizedState,y=0;f!==null&&(y=f.retryLane),nF(c,y)}function Sj(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),nF(c,y)}var iF;iF=function(c,f,y){if(c!==null)if(c.memoizedProps!==f.pendingProps||un.current)Or=!0;else{if(!(c.lanes&y)&&!(f.flags&128))return Or=!1,uj(c,f,y);Or=!!(c.flags&131072)}else Or=!1,_n&&f.flags&1048576&&hy(f,bs,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,St.current);La(f,y),E=iw(null,f,M,c,E,y);var R=rw();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,Qn(M)?(R=!0,fi(f)):R=!1,f.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,Fh(f),E.updater=af,f.stateNode=E,E._reactInternals=f,Nh(f,M,c,y),f=fw(null,f,M,!0,R,y)):(f.tag=0,_n&&R&&Uh(f),tr(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=wj(M),c=Ur(M,c),E){case 0:f=cw(null,f,M,c,y);break e;case 1:f=TD(null,f,M,c,y);break e;case 11:f=SD(null,f,M,c,y);break e;case 14:f=MD(null,f,M,Ur(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:Ur(M,E),cw(c,f,M,E,y);case 1:return M=f.type,E=f.pendingProps,E=f.elementType===M?E:Ur(M,E),TD(c,f,M,E,y);case 3:e:{if(bD(f),c===null)throw Error(o(387));M=f.pendingProps,R=f.memoizedState,E=R.element,oy(c,f),sf(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=RD(c,f,M,y,E);break e}else if(M!==E){E=Error(o(424)),f=RD(c,f,M,y,E);break e}else for(Te&&(er=Jc(f.stateNode.containerInfo),$i=f,_n=!0,Si=null,nu=!1),y=k(f,null,M,y),f.child=y;y;)y.flags=y.flags&-3|4096,y=y.sibling;else{if(Ua(),M===E){f=No(c,f,y);break e}tr(c,f,M,y)}f=f.child}return f;case 5:return Nn(f),c===null&&zh(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),CD(c,f),tr(c,f,V,y),f.child;case 6:return c===null&&zh(f),null;case 13:return PD(c,f,y);case 4:return gt(f,f.stateNode.containerInfo),M=f.pendingProps,c===null?f.child=L(f,null,M,y):tr(c,f,M,y),f.child;case 11:return M=f.type,E=f.pendingProps,E=f.elementType===M?E:Ur(M,E),SD(c,f,M,E,y);case 7:return tr(c,f,f.pendingProps,y),f.child;case 8:return tr(c,f,f.pendingProps.children,y),f.child;case 12:return tr(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,sy(f,M,V),R!==null)if(ts(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 pe=Q.firstContext;pe!==null;){if(pe.context===M){if(R.tag===1){pe=is(-1,y&-y),pe.tag=2;var Ne=R.updateQueue;if(Ne!==null){Ne=Ne.shared;var it=Ne.pending;it===null?pe.next=pe:(pe.next=it.next,it.next=pe),Ne.pending=pe}}R.lanes|=y,pe=R.alternate,pe!==null&&(pe.lanes|=y),Dh(R.return,y,f),Q.lanes|=y;break}pe=pe.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),Dh(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}tr(c,f,E.children,y),f=f.child}return f;case 9:return E=f.type,M=f.pendingProps.children,La(f,y),E=mr(E),M=M(E),f.flags|=1,tr(c,f,M,y),f.child;case 14:return M=f.type,E=Ur(M,f.pendingProps),E=Ur(M.type,E),MD(c,f,M,E,y);case 15:return wD(c,f,f.type,f.pendingProps,y);case 17:return M=f.type,E=f.pendingProps,E=f.elementType===M?E:Ur(M,E),c!==null&&(c.alternate=null,f.alternate=null,f.flags|=2),f.tag=1,Qn(M)?(c=!0,fi(f)):c=!1,La(f,y),fy(f,M,E),Nh(f,M,E,y),fw(null,f,M,!0,c,y);case 19:return DD(c,f,y);case 22:return ED(c,f,y)}throw Error(o(156,f.tag))};function rF(c,f){return Ia(c,f)}function Mj(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 ss(c,f,y,M){return new Mj(c,f,y,M)}function Lw(c){return c=c.prototype,!(!c||!c.isReactComponent)}function wj(c){if(typeof c=="function")return Lw(c)?1:0;if(c!=null){if(c=c.$$typeof,c===S)return 11;if(c===x)return 14}return 2}function Va(c,f){var y=c.alternate;return y===null?(y=ss(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 Vy(c,f,y,M,E,R){var V=2;if(M=c,typeof c=="function")Lw(c)&&(V=1);else if(typeof c=="string")V=5;else e:switch(c){case d:return fu(y.children,E,R,f);case h:V=8,E|=8;break;case p:return c=ss(12,y,f,E|2),c.elementType=p,c.lanes=R,c;case _:return c=ss(13,y,f,E),c.elementType=_,c.lanes=R,c;case m:return c=ss(19,y,f,E),c.elementType=m,c.lanes=R,c;case w:return Wy(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 x:V=14;break e;case A:V=16,M=null;break e}throw Error(o(130,c==null?c:typeof c,""))}return f=ss(V,y,f,E),f.elementType=c,f.type=M,f.lanes=R,f}function fu(c,f,y,M){return c=ss(7,c,M,f),c.lanes=y,c}function Wy(c,f,y,M){return c=ss(22,c,M,f),c.elementType=w,c.lanes=y,c.stateNode={},c}function Dw(c,f,y){return c=ss(6,c,null,f),c.lanes=y,c}function Fw(c,f,y){return f=ss(4,c.children!==null?c.children:[],c.key,f),f.lanes=y,f.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},f}function Ej(c,f,y,M,E){this.tag=f,this.containerInfo=c,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Et,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ch(0),this.expirationTimes=Ch(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ch(0),this.identifierPrefix=M,this.onRecoverableError=E,Te&&(this.mutableSourceEagerHydrationData=null)}function sF(c,f,y,M,E,R,V,Q,pe){return c=new Ej(c,f,y,Q,pe),f===1?(f=1,R===!0&&(f|=8)):f=0,R=ss(3,null,null,f),c.current=R,R.stateNode=c,R.memoizedState={element:M,isDehydrated:y,cache:null,transitions:null},Fh(R),c}function oF(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(Qn(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(Qn(y))return Js(c,y,f)}return f}function aF(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 lF(c,f){if(c=c.memoizedState,c!==null&&c.dehydrated!==null){var y=c.retryLane;c.retryLane=y!==0&&y=Ne&&R>=Pt&&E<=it&&V<=_t){c.splice(f,1);break}else if(M!==Ne||y.width!==pe.width||_tV){if(!(R!==Pt||y.height!==pe.height||itE)){Ne>M&&(pe.width+=Ne-M,pe.x=M),itR&&(pe.height+=Pt-R,pe.y=R),_ty&&(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 Z(c.child.stateNode);default:return c.child.stateNode}},t.injectIntoDevTools=function(c){if(c={bundleType:c.bundleType,version:c.version,rendererPackageName:c.rendererPackageName,rendererConfig:c.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:a.ReactCurrentDispatcher,findHostInstanceByFiber:Cj,findFiberByHostInstance:c.findFiberByHostInstance||Tj,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{ef=f.inject(c),es=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=Sw(c,f);var E=ke(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=Yt;try{return Yt=c,f()}finally{Yt=y}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(c,f,y,M){var E=f.current,R=nr(),V=Ha(E);return y=oF(y),f.context===null?f.context=y:f.pendingContext=y,f=is(R,V),f.payload={element:c},M=M===void 0?null:M,M!==null&&(f.callback=M),Qs(E,f),c=rs(E,V,R),c!==null&&rf(c,E,V),V},t};l2.exports=S6;var M6=l2.exports;const w6=cn(M6),wM={},E6=n=>void Object.assign(wM,n);function C6(n,e){function t(d,S,v){var _=S,{args:h=[],attach:p}=_,g=Xn(_,["args","attach"]);let m=`${d[0].toUpperCase()}${d.slice(1)}`,x;if(d==="primitive"){if(g.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const A=g.object;x=zc(A,{type:d,root:v,attach:p,primitive:!0})}else{const A=wM[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!");x=zc(new A(...h),{type:d,root:v,attach:p,memoizedProps:{args:h}})}return x.__r3f.attach===void 0&&(x.isBufferGeometry?x.__r3f.attach="geometry":x.isMaterial&&(x.__r3f.attach="material")),m!=="inject"&&bM(x,g),x}function i(d,h){let p=!1;if(h){var g,v;(g=h.__r3f)!=null&&g.attach?TM(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||zc(h,{}),h.__r3f.parent=d,RM(h),Hc(h)}}function r(d,h,p){let g=!1;if(h){var v,S;if((v=h.__r3f)!=null&&v.attach)TM(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 _=d.children.filter(x=>x!==h),m=_.indexOf(p);d.children=[..._.slice(0,m),h,..._.slice(m)],g=!0}g||(S=d.__r3f)==null||S.objects.push(h),h.__r3f||zc(h,{}),h.__r3f.parent=d,RM(h),Hc(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)_2(d,h,h.__r3f.attach);else if(h.isObject3D&&d.isObject3D){var _;d.remove(h),(_=h.__r3f)!=null&&_.root&&F6(Jv(h),h)}const x=(S=h.__r3f)==null?void 0:S.primitive,A=!x&&(p===void 0?h.dispose!==null:p);if(!x){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"?MM.unstable_scheduleCallback(MM.unstable_IdlePriority,w):w()}Hc(d)}}function a(d,h,p,g){var v;const S=(v=d.__r3f)==null?void 0:v.parent;if(!S)return;const _=t(h,p,d.__r3f.root);if(d.children){for(const m of d.children)m.__r3f&&i(_,m);d.children=d.children.filter(m=>!m.__r3f)}d.__r3f.objects.forEach(m=>i(_,m)),d.__r3f.objects=[],d.__r3f.autoRemovedBeforeAppend||o(S,d),_.parent&&(_.__r3f.autoRemovedBeforeAppend=!0),i(S,_),_.raycast&&_.__r3f.eventCount&&Jv(_).getState().internal.interaction.push(_),[g,g.alternate].forEach(m=>{m!==null&&(m.stateNode=_,m.ref&&(typeof m.ref=="function"?m.ref(_):m.ref.current=_))})}const l=()=>{};return{reconciler:w6({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 _=g,{args:x=[],children:A}=_,w=Xn(_,["args","children"]),m=p,{args:I=[],children:P}=m,D=Xn(m,["args","children"]);if(!Array.isArray(x))throw new Error("R3F: the args prop must be an array!");if(x.some((B,T)=>B!==I[T]))return[!0];const N=A2(d,w,D,!0);return N.changes.length?[!1,N]:null}},commitUpdate(d,[h,p],g,v,S,_){h?a(d,g,S,_):bM(d,p)},commitMount(d,h,p,g){var v;const S=(v=d.__r3f)!=null?v:{};d.raycast&&S.handlers&&S.eventCount&&Jv(d).getState().internal.interaction.push(d)},getPublicInstance:d=>d,prepareForCommit:()=>null,preparePortalMount:d=>zc(d.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(d){var h;const{attach:p,parent:g}=(h=d.__r3f)!=null?h:{};p&&g&&_2(g,d,p),d.isObject3D&&(d.visible=!1),Hc(d)},unhideInstance(d,h){var p;const{attach:g,parent:v}=(p=d.__r3f)!=null?p:{};g&&v&&TM(v,d,g),(d.isObject3D&&h.visible==null||h.visible)&&(d.visible=!0),Hc(d)},createTextInstance:l,hideTextInstance:l,unhideTextInstance:l,getCurrentEventPriority:()=>e(),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:bM}}var f2,d2;const EM=n=>"colorSpace"in n||"outputColorSpace"in n,h2=()=>{var n;return(n=wM.ColorManagement)!=null?n:null},p2=n=>n&&n.isOrthographicCamera,T6=n=>n&&n.hasOwnProperty("current"),jv=typeof window!="undefined"&&((f2=window.document)!=null&&f2.createElement||((d2=window.navigator)==null?void 0:d2.product)==="ReactNative")?me.useLayoutEffect:me.useEffect;function b6(n){const e=me.useRef(n);return jv(()=>void(e.current=n),[n]),e}function R6({set:n}){return jv(()=>(n(new Promise(()=>null)),()=>n(!1)),[n]),null}class m2 extends me.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}m2.getDerivedStateFromError=()=>({error:!0});const g2="__default",v2=new Map,P6=n=>n&&!!n.memoized&&!!n.changes;function y2(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 xh=n=>{var e;return(e=n.__r3f)==null?void 0:e.root.getState()};function Jv(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 I6(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 B6(n){n.dispose&&n.type!=="Scene"&&n.dispose();for(const e in n)e.dispose==null||e.dispose(),delete n[e]}function zc(n,e){const t=n;return t.__r3f=ge({type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null},e),n}function CM(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 x2=/-\d+$/;function TM(n,e,t){if(yn.str(t)){if(x2.test(t)){const s=t.replace(x2,""),{target:o,key:a}=CM(n,s);Array.isArray(o[a])||(o[a]=[])}const{target:i,key:r}=CM(n,t);e.__r3f.previousAttach=i[r],i[r]=e}else e.__r3f.previousAttach=t(n,e)}function _2(n,e,t){var i,r;if(yn.str(t)){const{target:s,key:o}=CM(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 A2(n,d,p={},u=!1){var h=d,{children:e,key:t,ref:i}=h,r=Xn(h,["children","key","ref"]);var g=p,{children:s,key:o,ref:a}=g,l=Xn(g,["children","key","ref"]);const v=n.__r3f,S=Object.entries(r),_=[];if(u){const x=Object.keys(l);for(let A=0;A{var w;if((w=n.__r3f)!=null&&w.primitive&&x==="object"||yn.equ(A,l[x]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(x))return _.push([x,A,!0,[]]);let I=[];x.includes("-")&&(I=x.split("-")),_.push([x,A,!1,I]);for(const P in r){const D=r[P];P.startsWith(`${x}-`)&&_.push([P,D,!1,P.split("-")])}});const m=ge({},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:_}}function bM(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}=P6(e)?e:A2(n,e),l=i==null?void 0:i.eventCount;n.__r3f&&(n.__r3f.memoizedProps=o);for(let p=0;pA[w],n),!(x&&x.set))){const[A,...w]=_.reverse();m=w.reverse().reduce((I,P)=>I[P],n),g=A}if(v===g2+"remove")if(m.constructor){let A=v2.get(m.constructor);A||(A=new m.constructor,v2.set(m.constructor,A)),v=A[g]}else v=0;if(S&&i)v?i.handlers[g]=v:delete i.handlers[g],i.eventCount=Object.keys(i.handlers).length;else if(x&&x.set&&(x.copy||x instanceof Cl)){if(Array.isArray(v))x.fromArray?x.fromArray(v):x.set(...v);else if(x.copy&&v&&v.constructor&&x.constructor===v.constructor)x.copy(v);else if(v!==void 0){var u;const A=(u=x)==null?void 0:u.isColor;!A&&x.setScalar?x.setScalar(v):x instanceof Cl&&v instanceof Cl?x.mask=v.mask:x.set(v),!h2()&&s&&!s.linear&&A&&x.convertSRGBToLinear()}}else{var d;if(m[g]=v,(d=m[g])!=null&&d.isTexture&&m[g].format===Ri&&m[g].type===ys&&s){const A=m[g];EM(A)&&EM(s.gl)?A.colorSpace=s.gl.outputColorSpace:A.encoding=s.gl.outputEncoding}}Hc(n)}if(i&&i.parent&&n.raycast&&l!==i.eventCount){const p=Jv(n).getState().internal,g=p.interaction.indexOf(n);g>-1&&p.interaction.splice(g,1),i.eventCount&&p.interaction.push(n)}return!(a.length===1&&a[0][0]==="onUpdate")&&a.length&&(t=n.__r3f)!=null&&t.parent&&RM(n),n}function Hc(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 RM(n){n.onUpdate==null||n.onUpdate(n)}function L6(n,e){n.manual||(p2(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 Kv(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 yh.DefaultEventPriority;switch((n=e.event)==null?void 0:n.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return yh.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return yh.ContinuousEventPriority;default:return yh.DefaultEventPriority}}function S2(n,e,t,i){const r=t.get(e);r&&(t.delete(e),t.size===0&&(n.delete(i),r.target.releasePointerCapture(i)))}function F6(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)=>{S2(t.capturedMap,e,i,r)})}function N6(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=xh(m.object),w=xh(x.object);return!A||!w?m.distance-x.distance:w.events.priority-A.events.priority||m.distance-x.distance}).filter(m=>{const x=Kv(m);return h.has(x)?!1:(h.add(x),!0)});d.events.filter&&(S=d.events.filter(S,d));for(const m of S){let x=m.object;for(;x;){var _;(_=x.__r3f)!=null&&_.eventCount&&p.push(yt(ge({},m),{eventObject:x})),x=x.parent}}if("pointerId"in l&&d.internal.capturedMap.has(l.pointerId))for(let m of d.internal.capturedMap.get(l.pointerId).values())h.has(Kv(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=xh(v.object)||p,{raycaster:_,pointer:m,camera:x,internal:A}=S,w=new G(m.x,m.y,0).unproject(x),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&&S2(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=yt(ge(ge({},v),N),{pointer:m,intersections:l,stopped:g.stopped,delta:d,unprojectedPoint:w,ray:_.ray,camera:x,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(Kv(d)),p!=null&&p.eventCount){const v=yt(ge({},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",_=i(d,g?t:void 0),m=v?e(d):0;l==="onPointerDown"&&(p.initialClick=[d.offsetX,d.offsetY],p.initialHits=_.map(A=>A.eventObject)),v&&!_.length&&m<=2&&(o(d,p.interaction),h&&h(d)),g&&s(_);function x(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=Kv(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(_,d,m,x)}}return{handlePointer:a}}const M2=n=>!!(n!=null&&n.render),U6=me.createContext(null),O6=(n,e)=>{const t=v6((a,l)=>{const u=new G,d=new G,h=new G;function p(m=l().camera,x=d,A=l().size){const{width:w,height:I,top:P,left:D}=A,N=w/I;x.isVector3?h.copy(x):h.set(...x);const B=m.getWorldPosition(u).distanceTo(h);if(p2(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(x=>({performance:yt(ge({},x.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,x)=>e(m,x,l()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new lM,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(x=>yt(ge({},x),{events:ge(ge({},x.events),m)})),setSize:(m,x,A,w,I)=>{const P=l().camera,D={width:m,height:x,top:w||0,left:I||0,updateStyle:A};a(N=>({size:D,viewport:ge(ge({},N.viewport),p(P,d,D))}))},setDpr:m=>a(x=>{const A=y2(m);return{viewport:yt(ge({},x.viewport),{dpr:A,initialDpr:x.viewport.initialDpr||A})}}),setFrameloop:(m="always")=>{const x=l().clock;x.stop(),x.elapsedTime=0,m!=="never"&&(x.start(),x.elapsedTime=0),a(()=>({frameloop:m}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:me.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(m,x,A)=>{const w=l().internal;return w.priority=w.priority+(x>0?1:0),w.subscribers.push({ref:m,priority:x,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-(x>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,L6(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:ge(ge({},g.viewport),g.viewport.getCurrentViewport(a))})))}),t.subscribe(a=>n(a)),t};let Yv,k6=new Set,z6=new Set,H6=new Set;function PM(n,e){if(n.size)for(const{callback:t}of n.values())t(e)}function _h(n,e){switch(n){case"before":return PM(k6,e);case"after":return PM(z6,e);case"tail":return PM(H6,e)}}let IM,BM;function LM(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),IM=e.internal.subscribers,Yv=0;Yv0)&&!((d=s.gl.xr)!=null&&d.isPresenting)&&(i+=LM(u,s))}if(t=!1,_h("after",u),i===0)return _h("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&&_h("before",u),h)LM(u,h,p);else for(const g of n.values())LM(u,g.store.getState());d&&_h("after",u)}return{loop:o,invalidate:a,advance:l}}const w2=new WeakMap;function E2(n,e){return function(t,...i){let r=w2.get(t);return r||(r=new t,w2.set(t,r)),n&&n(r),Promise.all(i.map(s=>new Promise((o,a)=>r.load(s,l=>{l.scene&&Object.assign(l,I6(l.scene)),o(l)},e,l=>a(new Error(`Could not load ${s}: ${l==null?void 0:l.message}`))))))}}function Ah(n,e,t,i){const r=Array.isArray(e)?e:[e],s=x6(E2(t,i),[n,...r],{equal:yn.equ});return Array.isArray(e)?s:s[0]}Ah.preload=function(n,e,t){const i=Array.isArray(e)?e:[e];return _6(E2(t),[n,...i])},Ah.clear=function(n,e){const t=Array.isArray(e)?e:[e];return A6([n,...t])};const Gc=new Map,{invalidate:C2,advance:T2}=G6(Gc),{reconciler:Qv,applyProps:Vc}=C6(Gc,D6),Wc={objects:"shallow",strict:!1},V6=(n,e)=>{const t=typeof n=="function"?n(e):n;return M2(t)?t:new gB(ge({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0},n))};function W6(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 X6(n){const e=Gc.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||O6(C2,T2),o=t||Qv.createContainer(s,yh.ConcurrentRoot,null,!1,null,"",r,null);e||Gc.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:_=!1,linear:m=!1,flat:x=!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=V6(h,n)});let J=F.raycaster;J||F.set({raycaster:J=new kL});const ne=N||{},{params:K}=ne,ie=Xn(ne,["params"]);if(yn.equ(ie,J,Wc)||Vc(J,ge({},ie)),yn.equ(K,J.params,Wc)||Vc(J,{params:ge(ge({},J.params),K)}),!F.camera||F.camera===u&&!yn.equ(u,B,Wc)){u=B;const de=B instanceof Jd,Ce=de?B:w?new Tc(0,0,0,0,.1,1e3):new li(75,0,.1,1e3);de||(Ce.position.z=5,B&&(Vc(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 de;g!=null&&g.isScene?de=g:(de=new wS,g&&Vc(de,g)),F.set({scene:zc(de)})}if(!F.xr){var Z;const de=(re,Me)=>{const Ie=s.getState();Ie.frameloop!=="never"&&T2(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?de:null),re.gl.xr.isPresenting||C2(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((Z=X.xr)==null?void 0:Z.addEventListener)=="function"&&ot.connect(),F.set({xr:ot})}if(X.shadowMap){const de=X.shadowMap.enabled,Ce=X.shadowMap.type;if(X.shadowMap.enabled=!!_,yn.boo(_))X.shadowMap.type=Ad;else if(yn.str(_)){var fe;const ot={basic:gP,percentage:zm,soft:Ad,variance:gs};X.shadowMap.type=(fe=ot[_])!=null?fe:Ad}else yn.obj(_)&&Object.assign(X.shadowMap,_);(de!==X.shadowMap.enabled||Ce!==X.shadowMap.type)&&(X.shadowMap.needsUpdate=!0)}const z=h2();z&&("enabled"in z?z.enabled=!A:"legacyMode"in z&&(z.legacyMode=A)),l||Vc(X,{outputEncoding:m?3e3:3001,toneMapping:x?Gs:CA}),F.legacy!==A&&F.set(()=>({legacy:A})),F.linear!==m&&F.set(()=>({linear:m})),F.flat!==x&&F.set(()=>({flat:x})),h&&!yn.fun(h)&&!M2(h)&&!yn.equ(h,X,Wc)&&Vc(X,h),v&&!F.events.handlers&&F.set({events:v(s)});const $=W6(n,p);return yn.equ($,F.size,Wc)||F.setSize($.width,$.height,$.updateStyle,$.top,$.left),P&&F.viewport.dpr!==y2(P)&&F.setDpr(P),F.frameloop!==I&&F.setFrameloop(I),F.onPointerMissed||F.set({onPointerMissed:T}),D&&!yn.equ(D,F.performance,Wc)&&F.set(de=>({performance:ge(ge({},de.performance),D)})),a=S,l=!0,this},render(d){return l||this.configure(),Qv.updateContainer(ve.jsx(j6,{store:s,children:d,onCreated:a,rootElement:n}),o,null,()=>{}),s},unmount(){b2(n)}}}function j6({store:n,children:e,onCreated:t,rootElement:i}){return jv(()=>{const r=n.getState();r.set(s=>({internal:yt(ge({},s.internal),{active:!0})})),t&&t(r),n.getState().events.connected||r.events.connect==null||r.events.connect(i)},[]),ve.jsx(U6.Provider,{value:n,children:e})}function b2(n,e){const t=Gc.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(),B6(r),Gc.delete(n)}catch(u){}},500)})}}Qv.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:me.version});const DM={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 J6(n){const{handlePointer:e}=N6(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(DM).reduce((t,i)=>yt(ge({},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:yt(ge({},o.events),{connected:t})})),Object.entries((i=s.handlers)!=null?i:[]).forEach(([o,a])=>{const[l,u]=DM[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]=DM[s];i.connected.removeEventListener(a,o)}}),t(s=>({events:yt(ge({},s.events),{connected:void 0})}))}}}}function FM(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}FM.debounce=FM;var K6=FM;const R2=cn(K6);var Y6=Object.defineProperty,Q6=Object.defineProperties,q6=Object.getOwnPropertyDescriptors,P2=Object.getOwnPropertySymbols,Z6=Object.prototype.hasOwnProperty,$6=Object.prototype.propertyIsEnumerable,I2=(n,e,t)=>e in n?Y6(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,B2=(n,e)=>{for(var t in e||(e={}))Z6.call(e,t)&&I2(n,t,e[t]);if(P2)for(var t of P2(e))$6.call(e,t)&&I2(n,t,e[t]);return n},eX=(n,e)=>Q6(n,q6(e)),L2,D2;typeof window!="undefined"&&((L2=window.document)!=null&&L2.createElement||((D2=window.navigator)==null?void 0:D2.product)==="ReactNative")?me.useLayoutEffect:me.useEffect;function F2(n,e,t){if(!n)return;if(t(n)===!0)return n;let i=n.child;for(;i;){const r=F2(i,e,t);if(r)return r;i=i.sibling}}function N2(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch(e){return n}}const U2=console.error;console.error=function(){const n=[...arguments].join("");if(n!=null&&n.startsWith("Warning:")&&n.includes("useContext")){console.error=U2;return}return U2.apply(this,arguments)};const NM=N2(me.createContext(null));class O2 extends me.Component{render(){return me.createElement(NM.Provider,{value:this._reactInternals},this.props.children)}}function tX(){const n=me.useContext(NM);if(n===null)throw new Error("its-fine: useFiber must be called within a !");const e=me.useId();return me.useMemo(()=>{for(const i of[n,n==null?void 0:n.alternate]){if(!i)continue;const r=F2(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 nX(){const n=tX(),[e]=me.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!==NM&&!e.has(r)&&e.set(r,me.useContext(N2(r)))}t=t.return}return e}function iX(){const n=nX();return me.useMemo(()=>Array.from(n.keys()).reduce((e,t)=>i=>me.createElement(e,null,me.createElement(t.Provider,eX(B2({},i),{value:n.get(t)}))),e=>me.createElement(O2,B2({},e))),[n])}function rX({debounce:n,scroll:e,polyfill:t,offsetSize:i}={debounce:0,scroll:!1,offsetSize:!1}){const r=t||typeof window!="undefined"&&window.ResizeObserver,[s,o]=me.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=me.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:s,orientationHandler:null}),l=n?typeof n=="number"?n:n.scroll:null,u=n?typeof n=="number"?n:n.resize:null,d=me.useRef(!1);me.useEffect(()=>(d.current=!0,()=>void(d.current=!1)));const[h,p,g]=me.useMemo(()=>{const m=()=>{if(!a.current.element)return;const{left:x,top:A,width:w,height:I,bottom:P,right:D,x:N,y:B}=a.current.element.getBoundingClientRect(),T={left:x,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&&!lX(a.current.lastBounds,T)&&o(a.current.lastBounds=T)};return[m,u?R2(m,u):m,l?R2(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),a.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",a.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",a.current.orientationHandler))}function S(){var m;a.current.element&&(a.current.resizeObserver=new r(p),(m=a.current.resizeObserver)==null||m.observe(a.current.element),e&&a.current.scrollContainers&&a.current.scrollContainers.forEach(x=>x.addEventListener("scroll",g,{capture:!0,passive:!0})),a.current.orientationHandler=()=>{g()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",a.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",a.current.orientationHandler))}const _=m=>{!m||m===a.current.element||(v(),a.current.element=m,a.current.scrollContainers=k2(m),S())};return oX(g,!!e),sX(p),me.useEffect(()=>{v(),S()},[e,g,p]),me.useEffect(()=>v,[]),[_,s,h]}function sX(n){me.useEffect(()=>{const e=n;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[n])}function oX(n,e){me.useEffect(()=>{if(e){const t=n;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",t,!0)}},[n,e])}function k2(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,...k2(n.parentElement)]}const aX=["x","y","top","bottom","left","right","width","height"],lX=(n,e)=>aX.every(t=>n[t]===e[t]),uX=me.forwardRef(function(N,D){var B=N,{children:e,fallback:t,resize:i,style:r,gl:s,events:o=J6,eventSource:a,eventPrefix:l,shadows:u,linear:d,flat:h,legacy:p,orthographic:g,frameloop:v,dpr:S,performance:_,raycaster:m,camera:x,scene:A,onPointerMissed:w,onCreated:I}=B,P=Xn(B,["children","fallback","resize","style","gl","events","eventSource","eventPrefix","shadows","linear","flat","legacy","orthographic","frameloop","dpr","performance","raycaster","camera","scene","onPointerMissed","onCreated"]);me.useMemo(()=>E6(s6),[]);const T=iX(),[F,X]=rX(ge({scroll:!0,debounce:{scroll:50,resize:0}},i)),J=me.useRef(null),K=me.useRef(null);me.useImperativeHandle(D,()=>J.current);const ie=b6(w),[Z,fe]=me.useState(!1),[z,$]=me.useState(!1);if(Z)throw Z;if(z)throw z;const ne=me.useRef(null);jv(()=>{const Ce=J.current;X.width>0&&X.height>0&&Ce&&(ne.current||(ne.current=X6(Ce)),ne.current.configure({gl:s,events:o,shadows:u,linear:d,flat:h,legacy:p,orthographic:g,frameloop:v,dpr:S,performance:_,raycaster:m,camera:x,scene:A,size:X,onPointerMissed:(...ot)=>ie.current==null?void 0:ie.current(...ot),onCreated:ot=>{ot.events.connect==null||ot.events.connect(a?T6(a)?a.current:a:K.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)}}),ne.current.render(ve.jsx(T,{children:ve.jsx(m2,{set:$,children:ve.jsx(me.Suspense,{fallback:ve.jsx(R6,{set:fe}),children:e})})})))}),me.useEffect(()=>{const Ce=J.current;if(Ce)return()=>b2(Ce)},[]);const de=a?"none":"auto";return ve.jsx("div",yt(ge({ref:K,style:ge({position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:de},r)},P),{children:ve.jsx("div",{ref:F,style:{width:"100%",height:"100%"},children:ve.jsx("canvas",{ref:J,style:{display:"block"},children:t})})}))}),cX=me.forwardRef(function(e,t){return ve.jsx(O2,{children:ve.jsx(uX,yt(ge({},e),{ref:t}))})}),fX=parseInt(_d.replace(/\D+/g,""));function z2(n,e){if(e===eI)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),n;if(e===Eg||e===OA){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 XX(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 hX(){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 pX{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 bX{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 RX{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 PX{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 IX{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!==$r.TRIANGLES&&u.mode!==$r.TRIANGLE_STRIP&&u.mode!==$r.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,_=new G,m=new Ii,x=new G(1,1,1),A=new PS(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"}),wa={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},OX={CUBICSPLINE:void 0,LINEAR:rc,STEP:ic},zM={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function kX(n){return n.DefaultMaterial===void 0&&(n.DefaultMaterial=new mh({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:Hs})),n.DefaultMaterial}function Zl(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 zX(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 WX=new mt;class XX{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new hX,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 gL(this.options.manager):this.textureLoader=new RL(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new Dr(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 Zl(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&&_.setY(B,P[D*l+1]),l>=3&&_.setZ(B,P[D*l+2]),l>=4&&_.setW(B,P[D*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return _})}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=X2[p.magFilter]||zn,d.minFilter=X2[p.minFilter]||Yr,d.wrapS=j2[p.wrapS]||ua,d.wrapT=j2[p.wrapT]||ua,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 _=new Tn(S);_.needsUpdate=!0,p(_)}),t.load(Sa.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||VX(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===H2?ql:Po),"colorSpace"in o?o.colorSpace=r:o.encoding=r===ql?H2:dX),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 dv,ai.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,ai.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 mh}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 ze(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=vs);const d=s.alphaMode||zM.OPAQUE;if(d===zM.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,d===zM.MASK&&(a.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==Br&&(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!==Br&&(u.push(t.assignTexture(a,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==Br){const h=s.emissiveFactor;a.emissive=new ze().setRGB(h[0],h[1],h[2],Po)}return s.emissiveTexture!==void 0&&o!==Br&&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&&Zl(r,h,s),h})}createUniqueName(e){const t=Jt.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 J2(l,a,t)})}const o=[];for(let a=0,l=e.length;a0&&HX(m,s),m.name=t.createUniqueName(s.name||"mesh_"+e),Io(m,s),_.extensions&&Zl(r,m,_),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 Xt,d!==u[0])for(let h=0,p=u.length;h{const h=new Map;for(const[p,g]of r.associations)(p instanceof ai||p instanceof Tn)&&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=[];wa[s.path]===wa.weights?e.traverse(function(p){p.morphTargetInfluences&&l.push(p.name?p.name:p.uuid)}):l.push(a);let u;switch(wa[s.path]){case wa.weights:u=zl;break;case wa.rotation:u=Hl;break;case wa.position:case wa.scale:u=Vl;break;default:switch(i.itemSize){case 1:u=zl;break;case 2:case 3:default:u=Vl;break}break}const d=r.interpolation!==void 0?OX[r.interpolation]:rc,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(VM.has(e)){const l=VM.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)}),VM.set(e,{key:i,promise:a}),a}_createGeometry(e){const t=new Dt;e.index&&t.setIndex(new Zt(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=KX.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(_=>_.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 _ in d){const m=self[h[_]];let x,A;if(u.useUniqueIDs)A=d[_],x=a.GetAttributeByUniqueId(p,A);else{if(A=a.GetAttributeId(p,o[d[_]]),A===-1)continue;x=a.GetAttribute(p,A)}S.attributes.push(r(o,a,p,_,m,x))}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,_=s(o,d),m=o._malloc(S);a.GetAttributeDataArrayForAllPoints(l,h,_,S,m);const x=new d(o.HEAPF32.buffer,m,v).slice();return o._free(m),{name:u,array:x,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 Zv;const WM=()=>{if(Zv)return Zv;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&&($v||($v=new JX),$v.setDecoderPath(typeof n=="string"?n:K2),i.setDRACOLoader($v)),e&&i.setMeshoptDecoder(typeof WM=="function"?WM():WM)}}const ey=(n,e,t,i)=>Ah(UM,n,Y2(e,t,i));ey.preload=(n,e,t,i)=>Ah.preload(UM,n,Y2(e,t,i)),ey.clear=n=>Ah.clear(UM,n),ey.setDecoderPath=n=>{K2=n};const Q2={name:"dc-overview-ws",private:!0,version:"0.2.4",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-emu/chassis-core":"^1.70.0","@sfdc-www-emu/chassis-core-types":"^1.30.0","@sfdc-www-emu/www-schemas":"1.172.0","@shared/utils":"*","@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"}}},YX=Q2.version,QX=`https://a.sfdcstatic.com/digital/@sfdc-www/open-blade-libs/${Q2.name}/v${YX}/data-dust.glb`,qX=Object.freeze(Object.defineProperty({__proto__:null,default:({progress:n,direction:e,size:t})=>{const{nodes:i}=ey(QX),r=ur(n,[0,1],[e==="left"?0:10,e==="left"?10:0]),s=[[2,2,5,.4],[8,0,4,.3]];return ve.jsx(i2.div,{initial:{opacity:0},animate:{opacity:1},children:ve.jsxs(cX,{resize:{offsetSize:!0},dpr:[1,2],camera:{position:[0,0,5.5],fov:t==="sm"?25:t==="md"?15:10},children:[ve.jsx("ambientLight",{intensity:.3,color:"#63B1F8"}),s.map(([o,a,l,u],d)=>ve.jsx("pointLight",{intensity:u,position:[o/8,a/8,l/8],color:"#63B1F8"},d)),ve.jsx("group",{dispose:null,children:ve.jsx(i2.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:ve.jsx("meshPhongMaterial",{color:"#63B1F8",emissive:"#416FB6",specular:"#89DCFA",shininess:30})})})]})})}},Symbol.toStringTag,{value:"Module"})),ZX=Object.freeze(Object.defineProperty({__proto__:null,default:()=>ve.jsx("div",{className:"flex justify-center items-center h-screen",children:ve.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:[ve.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),ve.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"}))});