@streamoji/avatar-widget 0.5.7 → 0.5.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,7 +5,7 @@ var StreamojiLeadsAvatarWidget=(function(Hy){"use strict";var bl={env:{NODE_ENV:
5
5
  `);for(A=m=0;m<re.length&&!re[m].includes("DetermineComponentFrameRoot");)m++;for(;A<Te.length&&!Te[A].includes("DetermineComponentFrameRoot");)A++;if(m===re.length||A===Te.length)for(m=re.length-1,A=Te.length-1;1<=m&&0<=A&&re[m]!==Te[A];)A--;for(;1<=m&&0<=A;m--,A--)if(re[m]!==Te[A]){if(m!==1||A!==1)do if(m--,A--,0>A||re[m]!==Te[A]){var ke=`
6
6
  `+re[m].replace(" at new "," at ");return a.displayName&&ke.includes("<anonymous>")&&(ke=ke.replace("<anonymous>",a.displayName)),ke}while(1<=m&&0<=A);break}}}finally{Le=!1,Error.prepareStackTrace=f}return(f=a?a.displayName||a.name:"")?me(f):""}function rt(a,r){switch(a.tag){case 26:case 27:case 5:return me(a.type);case 16:return me("Lazy");case 13:return a.child!==r&&r!==null?me("Suspense Fallback"):me("Suspense");case 19:return me("SuspenseList");case 0:case 15:return Ue(a.type,!1);case 11:return Ue(a.type.render,!1);case 1:return Ue(a.type,!0);case 31:return me("Activity");default:return""}}function Q(a){try{var r="",f=null;do r+=rt(a,f),f=a,a=a.return;while(a);return r}catch(m){return`
7
7
  Error generating stack: `+m.message+`
8
- `+m.stack}}var Kt=Object.prototype.hasOwnProperty,_t=s.unstable_scheduleCallback,Ft=s.unstable_cancelCallback,yt=s.unstable_shouldYield,j=s.unstable_requestPaint,I=s.unstable_now,ue=s.unstable_getCurrentPriorityLevel,Ie=s.unstable_ImmediatePriority,Xe=s.unstable_UserBlockingPriority,Oe=s.unstable_NormalPriority,Bt=s.unstable_LowPriority,gt=s.unstable_IdlePriority,Ht=s.log,Xt=s.unstable_setDisableYieldValue,ze=null,qe=null;function Tt(a){if(typeof Ht=="function"&&Xt(a),qe&&typeof qe.setStrictMode=="function")try{qe.setStrictMode(ze,a)}catch{}}var pt=Math.clz32?Math.clz32:de,st=Math.log,qt=Math.LN2;function de(a){return a>>>=0,a===0?32:31-(st(a)/qt|0)|0}var be=256,We=262144,St=4194304;function Ye(a){var r=a&42;if(r!==0)return r;switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function Ve(a,r,f){var m=a.pendingLanes;if(m===0)return 0;var A=0,E=a.suspendedLanes,U=a.pingedLanes;a=a.warmLanes;var X=m&134217727;return X!==0?(m=X&~E,m!==0?A=Ye(m):(U&=X,U!==0?A=Ye(U):f||(f=X&~a,f!==0&&(A=Ye(f))))):(X=m&~E,X!==0?A=Ye(X):U!==0?A=Ye(U):f||(f=m&~a,f!==0&&(A=Ye(f)))),A===0?0:r!==0&&r!==A&&(r&E)===0&&(E=A&-A,f=r&-r,E>=f||E===32&&(f&4194048)!==0)?r:A}function ft(a,r){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&r)===0}function jt(a,r){switch(a){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Sn(){var a=St;return St<<=1,(St&62914560)===0&&(St=4194304),a}function bt(a){for(var r=[],f=0;31>f;f++)r.push(a);return r}function Dn(a,r){a.pendingLanes|=r,r!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function Nn(a,r,f,m,A,E){var U=a.pendingLanes;a.pendingLanes=f,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=f,a.entangledLanes&=f,a.errorRecoveryDisabledLanes&=f,a.shellSuspendCounter=0;var X=a.entanglements,re=a.expirationTimes,Te=a.hiddenUpdates;for(f=U&~f;0<f;){var ke=31-pt(f),$e=1<<ke;X[ke]=0,re[ke]=-1;var De=Te[ke];if(De!==null)for(Te[ke]=null,ke=0;ke<De.length;ke++){var Ge=De[ke];Ge!==null&&(Ge.lane&=-536870913)}f&=~$e}m!==0&&Ni(a,m,0),E!==0&&A===0&&a.tag!==0&&(a.suspendedLanes|=E&~(U&~r))}function Ni(a,r,f){a.pendingLanes|=r,a.suspendedLanes&=~r;var m=31-pt(r);a.entangledLanes|=r,a.entanglements[m]=a.entanglements[m]|1073741824|f&261930}function fa(a,r){var f=a.entangledLanes|=r;for(a=a.entanglements;f;){var m=31-pt(f),A=1<<m;A&r|a[m]&r&&(a[m]|=r),f&=~A}}function Ui(a,r){var f=r&-r;return f=(f&42)!==0?1:Zi(f),(f&(a.suspendedLanes|r))!==0?0:f}function Zi(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function Ia(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function vi(){var a=Y.p;return a!==0?a:(a=window.event,a===void 0?32:mR(a.type))}function en(a,r){var f=Y.p;try{return Y.p=a,r()}finally{Y.p=f}}var ci=Math.random().toString(36).slice(2),fn="__reactFiber$"+ci,G="__reactProps$"+ci,J="__reactContainer$"+ci,oe="__reactEvents$"+ci,Re="__reactListeners$"+ci,Pe="__reactHandles$"+ci,He="__reactResources$"+ci,ot="__reactMarker$"+ci;function nt(a){delete a[fn],delete a[G],delete a[oe],delete a[Re],delete a[Pe]}function Ze(a){var r=a[fn];if(r)return r;for(var f=a.parentNode;f;){if(r=f[J]||f[fn]){if(f=r.alternate,r.child!==null||f!==null&&f.child!==null)for(a=$C(a);a!==null;){if(f=a[fn])return f;a=$C(a)}return r}a=f,f=a.parentNode}return null}function je(a){if(a=a[fn]||a[J]){var r=a.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return a}return null}function vt(a){var r=a.tag;if(r===5||r===26||r===27||r===6)return a.stateNode;throw Error(n(33))}function ht(a){var r=a[He];return r||(r=a[He]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function k(a){a[ot]=!0}var te=new Set,fe={};function ce(a,r){le(a,r),le(a+"Capture",r)}function le(a,r){for(fe[a]=r,a=0;a<r.length;a++)te.add(r[a])}var Qe=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),lt={},ct={};function Ct(a){return Kt.call(ct,a)?!0:Kt.call(lt,a)?!1:Qe.test(a)?ct[a]=!0:(lt[a]=!0,!1)}function xt(a,r,f){if(Ct(r))if(f===null)a.removeAttribute(r);else{switch(typeof f){case"undefined":case"function":case"symbol":a.removeAttribute(r);return;case"boolean":var m=r.toLowerCase().slice(0,5);if(m!=="data-"&&m!=="aria-"){a.removeAttribute(r);return}}a.setAttribute(r,""+f)}}function Yt(a,r,f){if(f===null)a.removeAttribute(r);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(r);return}a.setAttribute(r,""+f)}}function At(a,r,f,m){if(m===null)a.removeAttribute(f);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(f);return}a.setAttributeNS(r,f,""+m)}}function zt(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function mn(a){var r=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Pn(a,r,f){var m=Object.getOwnPropertyDescriptor(a.constructor.prototype,r);if(!a.hasOwnProperty(r)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var A=m.get,E=m.set;return Object.defineProperty(a,r,{configurable:!0,get:function(){return A.call(this)},set:function(U){f=""+U,E.call(this,U)}}),Object.defineProperty(a,r,{enumerable:m.enumerable}),{getValue:function(){return f},setValue:function(U){f=""+U},stopTracking:function(){a._valueTracker=null,delete a[r]}}}}function Mn(a){if(!a._valueTracker){var r=mn(a)?"checked":"value";a._valueTracker=Pn(a,r,""+a[r])}}function Qt(a){if(!a)return!1;var r=a._valueTracker;if(!r)return!0;var f=r.getValue(),m="";return a&&(m=mn(a)?a.checked?"true":"false":a.value),a=m,a!==f?(r.setValue(a),!0):!1}function Dt(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var $t=/[\n"\\]/g;function Lt(a){return a.replace($t,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function ei(a,r,f,m,A,E,U,X){a.name="",U!=null&&typeof U!="function"&&typeof U!="symbol"&&typeof U!="boolean"?a.type=U:a.removeAttribute("type"),r!=null?U==="number"?(r===0&&a.value===""||a.value!=r)&&(a.value=""+zt(r)):a.value!==""+zt(r)&&(a.value=""+zt(r)):U!=="submit"&&U!=="reset"||a.removeAttribute("value"),r!=null?Gn(a,U,zt(r)):f!=null?Gn(a,U,zt(f)):m!=null&&a.removeAttribute("value"),A==null&&E!=null&&(a.defaultChecked=!!E),A!=null&&(a.checked=A&&typeof A!="function"&&typeof A!="symbol"),X!=null&&typeof X!="function"&&typeof X!="symbol"&&typeof X!="boolean"?a.name=""+zt(X):a.removeAttribute("name")}function Qi(a,r,f,m,A,E,U,X){if(E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(a.type=E),r!=null||f!=null){if(!(E!=="submit"&&E!=="reset"||r!=null)){Mn(a);return}f=f!=null?""+zt(f):"",r=r!=null?""+zt(r):f,X||r===a.value||(a.value=r),a.defaultValue=r}m=m??A,m=typeof m!="function"&&typeof m!="symbol"&&!!m,a.checked=X?a.checked:!!m,a.defaultChecked=!!m,U!=null&&typeof U!="function"&&typeof U!="symbol"&&typeof U!="boolean"&&(a.name=U),Mn(a)}function Gn(a,r,f){r==="number"&&Dt(a.ownerDocument)===a||a.defaultValue===""+f||(a.defaultValue=""+f)}function Fi(a,r,f,m){if(a=a.options,r){r={};for(var A=0;A<f.length;A++)r["$"+f[A]]=!0;for(f=0;f<a.length;f++)A=r.hasOwnProperty("$"+a[f].value),a[f].selected!==A&&(a[f].selected=A),A&&m&&(a[f].defaultSelected=!0)}else{for(f=""+zt(f),r=null,A=0;A<a.length;A++){if(a[A].value===f){a[A].selected=!0,m&&(a[A].defaultSelected=!0);return}r!==null||a[A].disabled||(r=a[A])}r!==null&&(r.selected=!0)}}function ri(a,r,f){if(r!=null&&(r=""+zt(r),r!==a.value&&(a.value=r),f==null)){a.defaultValue!==r&&(a.defaultValue=r);return}a.defaultValue=f!=null?""+zt(f):""}function we(a,r,f,m){if(r==null){if(m!=null){if(f!=null)throw Error(n(92));if(he(m)){if(1<m.length)throw Error(n(93));m=m[0]}f=m}f==null&&(f=""),r=f}f=zt(r),a.defaultValue=f,m=a.textContent,m===f&&m!==""&&m!==null&&(a.value=m),Mn(a)}function at(a,r){if(r){var f=a.firstChild;if(f&&f===a.lastChild&&f.nodeType===3){f.nodeValue=r;return}}a.textContent=r}var ut=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Ut(a,r,f){var m=r.indexOf("--")===0;f==null||typeof f=="boolean"||f===""?m?a.setProperty(r,""):r==="float"?a.cssFloat="":a[r]="":m?a.setProperty(r,f):typeof f!="number"||f===0||ut.has(r)?r==="float"?a.cssFloat=f:a[r]=(""+f).trim():a[r]=f+"px"}function Nt(a,r,f){if(r!=null&&typeof r!="object")throw Error(n(62));if(a=a.style,f!=null){for(var m in f)!f.hasOwnProperty(m)||r!=null&&r.hasOwnProperty(m)||(m.indexOf("--")===0?a.setProperty(m,""):m==="float"?a.cssFloat="":a[m]="");for(var A in r)m=r[A],r.hasOwnProperty(A)&&f[A]!==m&&Ut(a,A,m)}else for(var E in r)r.hasOwnProperty(E)&&Ut(a,E,r[E])}function Vt(a){if(a.indexOf("-")===-1)return!1;switch(a){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ln=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Wn=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function En(a){return Wn.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function Cn(){}var ti=null;function Ci(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var _i=null,ha=null;function _a(a){var r=je(a);if(r&&(a=r.stateNode)){var f=a[G]||null;e:switch(a=r.stateNode,r.type){case"input":if(ei(a,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name),r=f.name,f.type==="radio"&&r!=null){for(f=a;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll('input[name="'+Lt(""+r)+'"][type="radio"]'),r=0;r<f.length;r++){var m=f[r];if(m!==a&&m.form===a.form){var A=m[G]||null;if(!A)throw Error(n(90));ei(m,A.value,A.defaultValue,A.defaultValue,A.checked,A.defaultChecked,A.type,A.name)}}for(r=0;r<f.length;r++)m=f[r],m.form===a.form&&Qt(m)}break e;case"textarea":ri(a,f.value,f.defaultValue);break e;case"select":r=f.value,r!=null&&Fi(a,!!f.multiple,r,!1)}}}var Wa=!1;function Ri(a,r,f){if(Wa)return a(r,f);Wa=!0;try{var m=a(r);return m}finally{if(Wa=!1,(_i!==null||ha!==null)&&(q(),_i&&(r=_i,a=ha,ha=_i=null,_a(r),a)))for(r=0;r<a.length;r++)_a(a[r])}}function ya(a,r){var f=a.stateNode;if(f===null)return null;var m=f[G]||null;if(m===null)return null;f=m[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(a=a.type,m=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!m;break e;default:a=!1}if(a)return null;if(f&&typeof f!="function")throw Error(n(231,r,typeof f));return f}var $i=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ir=!1;if($i)try{var qo={};Object.defineProperty(qo,"passive",{get:function(){ir=!0}}),window.addEventListener("test",qo,qo),window.removeEventListener("test",qo,qo)}catch{ir=!1}var xr=null,Qh=null,Ko=null;function $h(){if(Ko)return Ko;var a,r=Qh,f=r.length,m,A="value"in xr?xr.value:xr.textContent,E=A.length;for(a=0;a<f&&r[a]===A[a];a++);var U=f-a;for(m=1;m<=U&&r[f-m]===A[E-m];m++);return Ko=A.slice(a,1<m?1-m:void 0)}function kl(a){var r=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&r===13&&(a=13)):a=r,a===10&&(a=13),32<=a||a===13?a:0}function pf(){return!0}function cm(){return!1}function ja(a){function r(f,m,A,E,U){this._reactName=f,this._targetInst=A,this.type=m,this.nativeEvent=E,this.target=U,this.currentTarget=null;for(var X in a)a.hasOwnProperty(X)&&(f=a[X],this[X]=f?f(E):E[X]);return this.isDefaultPrevented=(E.defaultPrevented!=null?E.defaultPrevented:E.returnValue===!1)?pf:cm,this.isPropagationStopped=cm,this}return v(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=pf)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=pf)},persist:function(){},isPersistent:pf}),r}var Wo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},mf=ja(Wo),Ar=v({},Wo,{view:0,detail:0}),ed=ja(Ar),td,gf,zc,vf=v({},Ar,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:yf,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==zc&&(zc&&a.type==="mousemove"?(td=a.screenX-zc.screenX,gf=a.screenY-zc.screenY):gf=td=0,zc=a),td)},movementY:function(a){return"movementY"in a?a.movementY:gf}}),A_=ja(vf),Fa=v({},vf,{dataTransfer:0}),S_=ja(Fa),M_=v({},Ar,{relatedTarget:0}),nd=ja(M_),b_=v({},Wo,{animationName:0,elapsedTime:0,pseudoElement:0}),E_=ja(b_),_f=v({},Wo,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),um=ja(_f),T_=v({},Wo,{data:0}),fm=ja(T_),C_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},hm={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},dm={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function R_(a){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(a):(a=dm[a])?!!r[a]:!1}function yf(){return R_}var pm=v({},Ar,{key:function(a){if(a.key){var r=C_[a.key]||a.key;if(r!=="Unidentified")return r}return a.type==="keypress"?(a=kl(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?hm[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:yf,charCode:function(a){return a.type==="keypress"?kl(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?kl(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),mm=ja(pm),w_=v({},vf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),id=ja(w_),B_=v({},Ar,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:yf}),go=ja(B_),gm=v({},Wo,{propertyName:0,elapsedTime:0,pseudoElement:0}),JS=ja(gm),D_=v({},vf,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),jo=ja(D_),vo=v({},Wo,{newState:0,oldState:0}),vm=ja(vo),_m=[9,13,27,32],Xl=$i&&"CompositionEvent"in window,Zo=null;$i&&"documentMode"in document&&(Zo=document.documentMode);var Yl=$i&&"TextEvent"in window&&!Zo,Ha=$i&&(!Xl||Zo&&8<Zo&&11>=Zo),xf=" ",ym=!1;function ad(a,r){switch(a){case"keyup":return _m.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Vc(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Qo=!1;function sd(a,r){switch(a){case"compositionend":return Vc(r);case"keypress":return r.which!==32?null:(ym=!0,xf);case"textInput":return a=r.data,a===xf&&ym?null:a;default:return null}}function L_(a,r){if(Qo)return a==="compositionend"||!Xl&&ad(a,r)?(a=$h(),Ko=Qh=xr=null,Qo=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return Ha&&r.locale!=="ko"?null:r.data;default:return null}}var Is={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function xm(a){var r=a&&a.nodeName&&a.nodeName.toLowerCase();return r==="input"?!!Is[a.type]:r==="textarea"}function rd(a,r,f,m){_i?ha?ha.push(m):ha=[m]:_i=m,r=My(r,"onChange"),0<r.length&&(f=new mf("onChange","change",null,f,m),a.push({event:f,listeners:r}))}var kc=null,Xc=null;function Am(a){PC(a,0)}function Yc(a){var r=vt(a);if(Qt(r))return a}function Sm(a,r){if(a==="change")return r}var Af=!1;if($i){var Jl;if($i){var wi="oninput"in document;if(!wi){var N_=document.createElement("div");N_.setAttribute("oninput","return;"),wi=typeof N_.oninput=="function"}Jl=wi}else Jl=!1;Af=Jl&&(!document.documentMode||9<document.documentMode)}function U_(){kc&&(kc.detachEvent("onpropertychange",Mm),Xc=kc=null)}function Mm(a){if(a.propertyName==="value"&&Yc(Xc)){var r=[];rd(r,Xc,a,Ci(a)),Ri(Am,r)}}function Sf(a,r,f){a==="focusin"?(U_(),kc=r,Xc=f,kc.attachEvent("onpropertychange",Mm)):a==="focusout"&&U_()}function $o(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Yc(Xc)}function O_(a,r){if(a==="click")return Yc(r)}function I_(a,r){if(a==="input"||a==="change")return Yc(r)}function ql(a,r){return a===r&&(a!==0||1/a===1/r)||a!==a&&r!==r}var Bi=typeof Object.is=="function"?Object.is:ql;function Jc(a,r){if(Bi(a,r))return!0;if(typeof a!="object"||a===null||typeof r!="object"||r===null)return!1;var f=Object.keys(a),m=Object.keys(r);if(f.length!==m.length)return!1;for(m=0;m<f.length;m++){var A=f[m];if(!Kt.call(r,A)||!Bi(a[A],r[A]))return!1}return!0}function bm(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function Em(a,r){var f=bm(a);a=0;for(var m;f;){if(f.nodeType===3){if(m=a+f.textContent.length,a<=r&&m>=r)return{node:f,offset:r-a};a=m}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=bm(f)}}function od(a,r){return a&&r?a===r?!0:a&&a.nodeType===3?!1:r&&r.nodeType===3?od(a,r.parentNode):"contains"in a?a.contains(r):a.compareDocumentPosition?!!(a.compareDocumentPosition(r)&16):!1:!1}function ld(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var r=Dt(a.document);r instanceof a.HTMLIFrameElement;){try{var f=typeof r.contentWindow.location.href=="string"}catch{f=!1}if(f)a=r.contentWindow;else break;r=Dt(a.document)}return r}function qc(a){var r=a&&a.nodeName&&a.nodeName.toLowerCase();return r&&(r==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||r==="textarea"||a.contentEditable==="true")}var F_=$i&&"documentMode"in document&&11>=document.documentMode,Kc=null,cd=null,Wc=null,Fs=!1;function ud(a,r,f){var m=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;Fs||Kc==null||Kc!==Dt(m)||(m=Kc,"selectionStart"in m&&qc(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),Wc&&Jc(Wc,m)||(Wc=m,m=My(cd,"onSelect"),0<m.length&&(r=new mf("onSelect","select",null,r,f),a.push({event:r,listeners:m}),r.target=Kc)))}function el(a,r){var f={};return f[a.toLowerCase()]=r.toLowerCase(),f["Webkit"+a]="webkit"+r,f["Moz"+a]="moz"+r,f}var jc={animationend:el("Animation","AnimationEnd"),animationiteration:el("Animation","AnimationIteration"),animationstart:el("Animation","AnimationStart"),transitionrun:el("Transition","TransitionRun"),transitionstart:el("Transition","TransitionStart"),transitioncancel:el("Transition","TransitionCancel"),transitionend:el("Transition","TransitionEnd")},Mf={},rs={};$i&&(rs=document.createElement("div").style,"AnimationEvent"in window||(delete jc.animationend.animation,delete jc.animationiteration.animation,delete jc.animationstart.animation),"TransitionEvent"in window||delete jc.transitionend.transition);function tl(a){if(Mf[a])return Mf[a];if(!jc[a])return a;var r=jc[a],f;for(f in r)if(r.hasOwnProperty(f)&&f in rs)return Mf[a]=r[f];return a}var _s=tl("animationend"),Tm=tl("animationiteration"),zr=tl("animationstart"),Zc=tl("transitionrun"),nl=tl("transitionstart"),Cm=tl("transitioncancel"),fd=tl("transitionend"),_o=new Map,hd="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");hd.push("scrollEnd");function Za(a,r){_o.set(a,r),ce(r,[a])}var il=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(r))return}else if(typeof bl=="object"&&typeof bl.emit=="function"){bl.emit("uncaughtException",a);return}console.error(a)},Ta=[],Kl=0,dd=0;function al(){for(var a=Kl,r=dd=Kl=0;r<a;){var f=Ta[r];Ta[r++]=null;var m=Ta[r];Ta[r++]=null;var A=Ta[r];Ta[r++]=null;var E=Ta[r];if(Ta[r++]=null,m!==null&&A!==null){var U=m.pending;U===null?A.next=A:(A.next=U.next,U.next=A),m.pending=A}E!==0&&pd(f,A,E)}}function bf(a,r,f,m){Ta[Kl++]=a,Ta[Kl++]=r,Ta[Kl++]=f,Ta[Kl++]=m,dd|=m,a.lanes|=m,a=a.alternate,a!==null&&(a.lanes|=m)}function Qc(a,r,f,m){return bf(a,r,f,m),$c(a)}function sl(a,r){return bf(a,null,null,r),$c(a)}function pd(a,r,f){a.lanes|=f;var m=a.alternate;m!==null&&(m.lanes|=f);for(var A=!1,E=a.return;E!==null;)E.childLanes|=f,m=E.alternate,m!==null&&(m.childLanes|=f),E.tag===22&&(a=E.stateNode,a===null||a._visibility&1||(A=!0)),a=E,E=E.return;return a.tag===3?(E=a.stateNode,A&&r!==null&&(A=31-pt(f),a=E.hiddenUpdates,m=a[A],m===null?a[A]=[r]:m.push(r),r.lane=f|536870912),E):null}function $c(a){if(50<fc)throw fc=0,hc=null,Error(n(185));for(var r=a.return;r!==null;)a=r,r=a.return;return a.tag===3?a.stateNode:null}var rl={};function H_(a,r,f,m){this.tag=a,this.key=f,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,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 os(a,r,f,m){return new H_(a,r,f,m)}function ls(a){return a=a.prototype,!(!a||!a.isReactComponent)}function Vr(a,r){var f=a.alternate;return f===null?(f=os(a.tag,r,a.key,a.mode),f.elementType=a.elementType,f.type=a.type,f.stateNode=a.stateNode,f.alternate=a,a.alternate=f):(f.pendingProps=r,f.type=a.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=a.flags&65011712,f.childLanes=a.childLanes,f.lanes=a.lanes,f.child=a.child,f.memoizedProps=a.memoizedProps,f.memoizedState=a.memoizedState,f.updateQueue=a.updateQueue,r=a.dependencies,f.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},f.sibling=a.sibling,f.index=a.index,f.ref=a.ref,f.refCleanup=a.refCleanup,f}function Qa(a,r){a.flags&=65011714;var f=a.alternate;return f===null?(a.childLanes=0,a.lanes=r,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=f.childLanes,a.lanes=f.lanes,a.child=f.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=f.memoizedProps,a.memoizedState=f.memoizedState,a.updateQueue=f.updateQueue,a.type=f.type,r=f.dependencies,a.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),a}function Ef(a,r,f,m,A,E){var U=0;if(m=a,typeof a=="function")ls(a)&&(U=1);else if(typeof a=="string")U=V4(a,f,Ne.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case N:return a=os(31,f,r,A),a.elementType=N,a.lanes=E,a;case R:return yo(f.children,A,E,r);case T:U=8,A|=24;break;case M:return a=os(12,f,r,A|2),a.elementType=M,a.lanes=E,a;case P:return a=os(13,f,r,A),a.elementType=P,a.lanes=E,a;case O:return a=os(19,f,r,A),a.elementType=O,a.lanes=E,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case D:U=10;break e;case w:U=9;break e;case L:U=11;break e;case z:U=14;break e;case V:U=16,m=null;break e}U=29,f=Error(n(130,a===null?"null":typeof a,"")),m=null}return r=os(U,f,r,A),r.elementType=a,r.type=m,r.lanes=E,r}function yo(a,r,f,m){return a=os(7,a,m,r),a.lanes=f,a}function md(a,r,f){return a=os(6,a,null,r),a.lanes=f,a}function P_(a){var r=os(18,null,null,0);return r.stateNode=a,r}function Sr(a,r,f){return r=os(4,a.children!==null?a.children:[],a.key,r),r.lanes=f,r.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},r}var Rm=new WeakMap;function ys(a,r){if(typeof a=="object"&&a!==null){var f=Rm.get(a);return f!==void 0?f:(r={value:a,source:r,stack:Q(r)},Rm.set(a,r),r)}return{value:a,source:r,stack:Q(r)}}var Mr=[],Wl=0,Tf=null,eu=0,Hs=[],xs=0,kr=null,Xr=1,Yr="";function xo(a,r){Mr[Wl++]=eu,Mr[Wl++]=Tf,Tf=a,eu=r}function wm(a,r,f){Hs[xs++]=Xr,Hs[xs++]=Yr,Hs[xs++]=kr,kr=a;var m=Xr;a=Yr;var A=32-pt(m)-1;m&=~(1<<A),f+=1;var E=32-pt(r)+A;if(30<E){var U=A-A%5;E=(m&(1<<U)-1).toString(32),m>>=U,A-=U,Xr=1<<32-pt(r)+A|f<<A|m,Yr=E+a}else Xr=1<<E|f<<A|m,Yr=a}function gd(a){a.return!==null&&(xo(a,1),wm(a,1,0))}function ol(a){for(;a===Tf;)Tf=Mr[--Wl],Mr[Wl]=null,eu=Mr[--Wl],Mr[Wl]=null;for(;a===kr;)kr=Hs[--xs],Hs[xs]=null,Yr=Hs[--xs],Hs[xs]=null,Xr=Hs[--xs],Hs[xs]=null}function Cf(a,r){Hs[xs++]=Xr,Hs[xs++]=Yr,Hs[xs++]=kr,Xr=r.id,Yr=r.overflow,kr=a}var Ca=null,Si=null,Jn=!1,Ao=null,Ra=!1,vd=Error(n(519));function zn(a){var r=Error(n(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Rf(ys(r,a)),vd}function _d(a){var r=a.stateNode,f=a.type,m=a.memoizedProps;switch(r[fn]=a,r[G]=m,f){case"dialog":qn("cancel",r),qn("close",r);break;case"iframe":case"object":case"embed":qn("load",r);break;case"video":case"audio":for(f=0;f<Ag.length;f++)qn(Ag[f],r);break;case"source":qn("error",r);break;case"img":case"image":case"link":qn("error",r),qn("load",r);break;case"details":qn("toggle",r);break;case"input":qn("invalid",r),Qi(r,m.value,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name,!0);break;case"select":qn("invalid",r);break;case"textarea":qn("invalid",r),we(r,m.value,m.defaultValue,m.children)}f=m.children,typeof f!="string"&&typeof f!="number"&&typeof f!="bigint"||r.textContent===""+f||m.suppressHydrationWarning===!0||kC(r.textContent,f)?(m.popover!=null&&(qn("beforetoggle",r),qn("toggle",r)),m.onScroll!=null&&qn("scroll",r),m.onScrollEnd!=null&&qn("scrollend",r),m.onClick!=null&&(r.onclick=Cn),r=!0):r=!1,r||zn(a,!0)}function G_(a){for(Ca=a.return;Ca;)switch(Ca.tag){case 5:case 31:case 13:Ra=!1;return;case 27:case 3:Ra=!0;return;default:Ca=Ca.return}}function jl(a){if(a!==Ca)return!1;if(!Jn)return G_(a),Jn=!0,!1;var r=a.tag,f;if((f=r!==3&&r!==27)&&((f=r===5)&&(f=a.type,f=!(f!=="form"&&f!=="button")||hM(a.type,a.memoizedProps)),f=!f),f&&Si&&zn(a),G_(a),r===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(n(317));Si=QC(a)}else if(r===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(n(317));Si=QC(a)}else r===27?(r=Si,yu(a.type)?(a=vM,vM=null,Si=a):Si=r):Si=Ca?no(a.stateNode.nextSibling):null;return!0}function Zl(){Si=Ca=null,Jn=!1}function Bm(){var a=Ao;return a!==null&&(as===null?as=a:as.push.apply(as,a),Ao=null),a}function Rf(a){Ao===null?Ao=[a]:Ao.push(a)}var Dm=W(null),So=null,$a=null;function Mo(a,r,f){Me(Dm,r._currentValue),r._currentValue=f}function ar(a){a._currentValue=Dm.current,ae(Dm)}function bo(a,r,f){for(;a!==null;){var m=a.alternate;if((a.childLanes&r)!==r?(a.childLanes|=r,m!==null&&(m.childLanes|=r)):m!==null&&(m.childLanes&r)!==r&&(m.childLanes|=r),a===f)break;a=a.return}}function yd(a,r,f,m){var A=a.child;for(A!==null&&(A.return=a);A!==null;){var E=A.dependencies;if(E!==null){var U=A.child;E=E.firstContext;e:for(;E!==null;){var X=E;E=A;for(var re=0;re<r.length;re++)if(X.context===r[re]){E.lanes|=f,X=E.alternate,X!==null&&(X.lanes|=f),bo(E.return,f,a),m||(U=null);break e}E=X.next}}else if(A.tag===18){if(U=A.return,U===null)throw Error(n(341));U.lanes|=f,E=U.alternate,E!==null&&(E.lanes|=f),bo(U,f,a),U=null}else U=A.child;if(U!==null)U.return=A;else for(U=A;U!==null;){if(U===a){U=null;break}if(A=U.sibling,A!==null){A.return=U.return,U=A;break}U=U.return}A=U}}function ll(a,r,f,m){a=null;for(var A=r,E=!1;A!==null;){if(!E){if((A.flags&524288)!==0)E=!0;else if((A.flags&262144)!==0)break}if(A.tag===10){var U=A.alternate;if(U===null)throw Error(n(387));if(U=U.memoizedProps,U!==null){var X=A.type;Bi(A.pendingProps.value,U.value)||(a!==null?a.push(X):a=[X])}}else if(A===Ce.current){if(U=A.alternate,U===null)throw Error(n(387));U.memoizedState.memoizedState!==A.memoizedState.memoizedState&&(a!==null?a.push(Tg):a=[Tg])}A=A.return}a!==null&&yd(r,a,f,m),r.flags|=262144}function tu(a){for(a=a.firstContext;a!==null;){if(!Bi(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function Ql(a){So=a,$a=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function wa(a){return Lm(So,a)}function wf(a,r){return So===null&&Ql(a),Lm(a,r)}function Lm(a,r){var f=r._currentValue;if(r={context:r,memoizedValue:f,next:null},$a===null){if(a===null)throw Error(n(308));$a=r,a.dependencies={lanes:0,firstContext:r},a.flags|=524288}else $a=$a.next=r;return f}var z_=typeof AbortController<"u"?AbortController:function(){var a=[],r=this.signal={aborted:!1,addEventListener:function(f,m){a.push(m)}};this.abort=function(){r.aborted=!0,a.forEach(function(f){return f()})}},V_=s.unstable_scheduleCallback,Nm=s.unstable_NormalPriority,sn={$$typeof:D,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Um(){return{controller:new z_,data:new Map,refCount:0}}function Pa(a){a.refCount--,a.refCount===0&&V_(Nm,function(){a.controller.abort()})}var $l=null,Om=0,Eo=0,br=null;function nu(a,r){if($l===null){var f=$l=[];Om=0,Eo=iM(),br={status:"pending",value:void 0,then:function(m){f.push(m)}}}return Om++,r.then(Im,Im),r}function Im(){if(--Om===0&&$l!==null){br!==null&&(br.status="fulfilled");var a=$l;$l=null,Eo=0,br=null;for(var r=0;r<a.length;r++)(0,a[r])()}}function Fm(a,r){var f=[],m={status:"pending",value:null,reason:null,then:function(A){f.push(A)}};return a.then(function(){m.status="fulfilled",m.value=r;for(var A=0;A<f.length;A++)(0,f[A])(r)},function(A){for(m.status="rejected",m.reason=A,A=0;A<f.length;A++)(0,f[A])(void 0)}),m}var k_=H.S;H.S=function(a,r){gu=I(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&nu(a,r),k_!==null&&k_(a,r)};var cl=W(null);function Jr(){var a=cl.current;return a!==null?a:fi.pooledCache}function iu(a,r){r===null?Me(cl,cl.current):Me(cl,r.pool)}function xd(){var a=Jr();return a===null?null:{parent:sn._currentValue,pool:a}}var ul=Error(n(460)),Bf=Error(n(474)),Er=Error(n(542)),Df={then:function(){}};function X_(a){return a=a.status,a==="fulfilled"||a==="rejected"}function Hm(a,r,f){switch(f=a[f],f===void 0?a.push(r):f!==r&&(r.then(Cn,Cn),r=f),r.status){case"fulfilled":return r.value;case"rejected":throw a=r.reason,Pm(a),a;default:if(typeof r.status=="string")r.then(Cn,Cn);else{if(a=fi,a!==null&&100<a.shellSuspendCounter)throw Error(n(482));a=r,a.status="pending",a.then(function(m){if(r.status==="pending"){var A=r;A.status="fulfilled",A.value=m}},function(m){if(r.status==="pending"){var A=r;A.status="rejected",A.reason=m}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw a=r.reason,Pm(a),a}throw hn=r,ul}}function ec(a){try{var r=a._init;return r(a._payload)}catch(f){throw f!==null&&typeof f=="object"&&typeof f.then=="function"?(hn=f,ul):f}}var hn=null;function Ad(){if(hn===null)throw Error(n(459));var a=hn;return hn=null,a}function Pm(a){if(a===ul||a===Er)throw Error(n(483))}var fl=null,hl=0;function Sd(a){var r=hl;return hl+=1,fl===null&&(fl=[]),Hm(fl,a,r)}function Lf(a,r){r=r.props.ref,a.ref=r!==void 0?r:null}function Nf(a,r){throw r.$$typeof===y?Error(n(525)):(a=Object.prototype.toString.call(r),Error(n(31,a==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":a)))}function au(a){function r(Ae,pe){if(a){var Ee=Ae.deletions;Ee===null?(Ae.deletions=[pe],Ae.flags|=16):Ee.push(pe)}}function f(Ae,pe){if(!a)return null;for(;pe!==null;)r(Ae,pe),pe=pe.sibling;return null}function m(Ae){for(var pe=new Map;Ae!==null;)Ae.key!==null?pe.set(Ae.key,Ae):pe.set(Ae.index,Ae),Ae=Ae.sibling;return pe}function A(Ae,pe){return Ae=Vr(Ae,pe),Ae.index=0,Ae.sibling=null,Ae}function E(Ae,pe,Ee){return Ae.index=Ee,a?(Ee=Ae.alternate,Ee!==null?(Ee=Ee.index,Ee<pe?(Ae.flags|=67108866,pe):Ee):(Ae.flags|=67108866,pe)):(Ae.flags|=1048576,pe)}function U(Ae){return a&&Ae.alternate===null&&(Ae.flags|=67108866),Ae}function X(Ae,pe,Ee,Ke){return pe===null||pe.tag!==6?(pe=md(Ee,Ae.mode,Ke),pe.return=Ae,pe):(pe=A(pe,Ee),pe.return=Ae,pe)}function re(Ae,pe,Ee,Ke){var un=Ee.type;return un===R?ke(Ae,pe,Ee.props.children,Ke,Ee.key):pe!==null&&(pe.elementType===un||typeof un=="object"&&un!==null&&un.$$typeof===V&&ec(un)===pe.type)?(pe=A(pe,Ee.props),Lf(pe,Ee),pe.return=Ae,pe):(pe=Ef(Ee.type,Ee.key,Ee.props,null,Ae.mode,Ke),Lf(pe,Ee),pe.return=Ae,pe)}function Te(Ae,pe,Ee,Ke){return pe===null||pe.tag!==4||pe.stateNode.containerInfo!==Ee.containerInfo||pe.stateNode.implementation!==Ee.implementation?(pe=Sr(Ee,Ae.mode,Ke),pe.return=Ae,pe):(pe=A(pe,Ee.children||[]),pe.return=Ae,pe)}function ke(Ae,pe,Ee,Ke,un){return pe===null||pe.tag!==7?(pe=yo(Ee,Ae.mode,Ke,un),pe.return=Ae,pe):(pe=A(pe,Ee),pe.return=Ae,pe)}function $e(Ae,pe,Ee){if(typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint")return pe=md(""+pe,Ae.mode,Ee),pe.return=Ae,pe;if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case x:return Ee=Ef(pe.type,pe.key,pe.props,null,Ae.mode,Ee),Lf(Ee,pe),Ee.return=Ae,Ee;case b:return pe=Sr(pe,Ae.mode,Ee),pe.return=Ae,pe;case V:return pe=ec(pe),$e(Ae,pe,Ee)}if(he(pe)||ne(pe))return pe=yo(pe,Ae.mode,Ee,null),pe.return=Ae,pe;if(typeof pe.then=="function")return $e(Ae,Sd(pe),Ee);if(pe.$$typeof===D)return $e(Ae,wf(Ae,pe),Ee);Nf(Ae,pe)}return null}function De(Ae,pe,Ee,Ke){var un=pe!==null?pe.key:null;if(typeof Ee=="string"&&Ee!==""||typeof Ee=="number"||typeof Ee=="bigint")return un!==null?null:X(Ae,pe,""+Ee,Ke);if(typeof Ee=="object"&&Ee!==null){switch(Ee.$$typeof){case x:return Ee.key===un?re(Ae,pe,Ee,Ke):null;case b:return Ee.key===un?Te(Ae,pe,Ee,Ke):null;case V:return Ee=ec(Ee),De(Ae,pe,Ee,Ke)}if(he(Ee)||ne(Ee))return un!==null?null:ke(Ae,pe,Ee,Ke,null);if(typeof Ee.then=="function")return De(Ae,pe,Sd(Ee),Ke);if(Ee.$$typeof===D)return De(Ae,pe,wf(Ae,Ee),Ke);Nf(Ae,Ee)}return null}function Ge(Ae,pe,Ee,Ke,un){if(typeof Ke=="string"&&Ke!==""||typeof Ke=="number"||typeof Ke=="bigint")return Ae=Ae.get(Ee)||null,X(pe,Ae,""+Ke,un);if(typeof Ke=="object"&&Ke!==null){switch(Ke.$$typeof){case x:return Ae=Ae.get(Ke.key===null?Ee:Ke.key)||null,re(pe,Ae,Ke,un);case b:return Ae=Ae.get(Ke.key===null?Ee:Ke.key)||null,Te(pe,Ae,Ke,un);case V:return Ke=ec(Ke),Ge(Ae,pe,Ee,Ke,un)}if(he(Ke)||ne(Ke))return Ae=Ae.get(Ee)||null,ke(pe,Ae,Ke,un,null);if(typeof Ke.then=="function")return Ge(Ae,pe,Ee,Sd(Ke),un);if(Ke.$$typeof===D)return Ge(Ae,pe,Ee,wf(pe,Ke),un);Nf(pe,Ke)}return null}function Zt(Ae,pe,Ee,Ke){for(var un=null,di=null,tn=pe,On=pe=0,Qn=null;tn!==null&&On<Ee.length;On++){tn.index>On?(Qn=tn,tn=null):Qn=tn.sibling;var pi=De(Ae,tn,Ee[On],Ke);if(pi===null){tn===null&&(tn=Qn);break}a&&tn&&pi.alternate===null&&r(Ae,tn),pe=E(pi,pe,On),di===null?un=pi:di.sibling=pi,di=pi,tn=Qn}if(On===Ee.length)return f(Ae,tn),Jn&&xo(Ae,On),un;if(tn===null){for(;On<Ee.length;On++)tn=$e(Ae,Ee[On],Ke),tn!==null&&(pe=E(tn,pe,On),di===null?un=tn:di.sibling=tn,di=tn);return Jn&&xo(Ae,On),un}for(tn=m(tn);On<Ee.length;On++)Qn=Ge(tn,Ae,On,Ee[On],Ke),Qn!==null&&(a&&Qn.alternate!==null&&tn.delete(Qn.key===null?On:Qn.key),pe=E(Qn,pe,On),di===null?un=Qn:di.sibling=Qn,di=Qn);return a&&tn.forEach(function(bu){return r(Ae,bu)}),Jn&&xo(Ae,On),un}function pn(Ae,pe,Ee,Ke){if(Ee==null)throw Error(n(151));for(var un=null,di=null,tn=pe,On=pe=0,Qn=null,pi=Ee.next();tn!==null&&!pi.done;On++,pi=Ee.next()){tn.index>On?(Qn=tn,tn=null):Qn=tn.sibling;var bu=De(Ae,tn,pi.value,Ke);if(bu===null){tn===null&&(tn=Qn);break}a&&tn&&bu.alternate===null&&r(Ae,tn),pe=E(bu,pe,On),di===null?un=bu:di.sibling=bu,di=bu,tn=Qn}if(pi.done)return f(Ae,tn),Jn&&xo(Ae,On),un;if(tn===null){for(;!pi.done;On++,pi=Ee.next())pi=$e(Ae,pi.value,Ke),pi!==null&&(pe=E(pi,pe,On),di===null?un=pi:di.sibling=pi,di=pi);return Jn&&xo(Ae,On),un}for(tn=m(tn);!pi.done;On++,pi=Ee.next())pi=Ge(tn,Ae,On,pi.value,Ke),pi!==null&&(a&&pi.alternate!==null&&tn.delete(pi.key===null?On:pi.key),pe=E(pi,pe,On),di===null?un=pi:di.sibling=pi,di=pi);return a&&tn.forEach(function($4){return r(Ae,$4)}),Jn&&xo(Ae,On),un}function Ei(Ae,pe,Ee,Ke){if(typeof Ee=="object"&&Ee!==null&&Ee.type===R&&Ee.key===null&&(Ee=Ee.props.children),typeof Ee=="object"&&Ee!==null){switch(Ee.$$typeof){case x:e:{for(var un=Ee.key;pe!==null;){if(pe.key===un){if(un=Ee.type,un===R){if(pe.tag===7){f(Ae,pe.sibling),Ke=A(pe,Ee.props.children),Ke.return=Ae,Ae=Ke;break e}}else if(pe.elementType===un||typeof un=="object"&&un!==null&&un.$$typeof===V&&ec(un)===pe.type){f(Ae,pe.sibling),Ke=A(pe,Ee.props),Lf(Ke,Ee),Ke.return=Ae,Ae=Ke;break e}f(Ae,pe);break}else r(Ae,pe);pe=pe.sibling}Ee.type===R?(Ke=yo(Ee.props.children,Ae.mode,Ke,Ee.key),Ke.return=Ae,Ae=Ke):(Ke=Ef(Ee.type,Ee.key,Ee.props,null,Ae.mode,Ke),Lf(Ke,Ee),Ke.return=Ae,Ae=Ke)}return U(Ae);case b:e:{for(un=Ee.key;pe!==null;){if(pe.key===un)if(pe.tag===4&&pe.stateNode.containerInfo===Ee.containerInfo&&pe.stateNode.implementation===Ee.implementation){f(Ae,pe.sibling),Ke=A(pe,Ee.children||[]),Ke.return=Ae,Ae=Ke;break e}else{f(Ae,pe);break}else r(Ae,pe);pe=pe.sibling}Ke=Sr(Ee,Ae.mode,Ke),Ke.return=Ae,Ae=Ke}return U(Ae);case V:return Ee=ec(Ee),Ei(Ae,pe,Ee,Ke)}if(he(Ee))return Zt(Ae,pe,Ee,Ke);if(ne(Ee)){if(un=ne(Ee),typeof un!="function")throw Error(n(150));return Ee=un.call(Ee),pn(Ae,pe,Ee,Ke)}if(typeof Ee.then=="function")return Ei(Ae,pe,Sd(Ee),Ke);if(Ee.$$typeof===D)return Ei(Ae,pe,wf(Ae,Ee),Ke);Nf(Ae,Ee)}return typeof Ee=="string"&&Ee!==""||typeof Ee=="number"||typeof Ee=="bigint"?(Ee=""+Ee,pe!==null&&pe.tag===6?(f(Ae,pe.sibling),Ke=A(pe,Ee),Ke.return=Ae,Ae=Ke):(f(Ae,pe),Ke=md(Ee,Ae.mode,Ke),Ke.return=Ae,Ae=Ke),U(Ae)):f(Ae,pe)}return function(Ae,pe,Ee,Ke){try{hl=0;var un=Ei(Ae,pe,Ee,Ke);return fl=null,un}catch(tn){if(tn===ul||tn===Er)throw tn;var di=os(29,tn,null,Ae.mode);return di.lanes=Ke,di.return=Ae,di}}}var tc=au(!0),Y_=au(!1),dl=!1;function Gm(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function zm(a,r){a=a.updateQueue,r.updateQueue===a&&(r.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function qr(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function To(a,r,f){var m=a.updateQueue;if(m===null)return null;if(m=m.shared,(jn&2)!==0){var A=m.pending;return A===null?r.next=r:(r.next=A.next,A.next=r),m.pending=r,r=$c(a),pd(a,null,f),r}return bf(a,m,r,f),$c(a)}function pl(a,r,f){if(r=r.updateQueue,r!==null&&(r=r.shared,(f&4194048)!==0)){var m=r.lanes;m&=a.pendingLanes,f|=m,r.lanes=f,fa(a,f)}}function Md(a,r){var f=a.updateQueue,m=a.alternate;if(m!==null&&(m=m.updateQueue,f===m)){var A=null,E=null;if(f=f.firstBaseUpdate,f!==null){do{var U={lane:f.lane,tag:f.tag,payload:f.payload,callback:null,next:null};E===null?A=E=U:E=E.next=U,f=f.next}while(f!==null);E===null?A=E=r:E=E.next=r}else A=E=r;f={baseState:m.baseState,firstBaseUpdate:A,lastBaseUpdate:E,shared:m.shared,callbacks:m.callbacks},a.updateQueue=f;return}a=f.lastBaseUpdate,a===null?f.firstBaseUpdate=r:a.next=r,f.lastBaseUpdate=r}var Vm=!1;function Uf(){if(Vm){var a=br;if(a!==null)throw a}}function nc(a,r,f,m){Vm=!1;var A=a.updateQueue;dl=!1;var E=A.firstBaseUpdate,U=A.lastBaseUpdate,X=A.shared.pending;if(X!==null){A.shared.pending=null;var re=X,Te=re.next;re.next=null,U===null?E=Te:U.next=Te,U=re;var ke=a.alternate;ke!==null&&(ke=ke.updateQueue,X=ke.lastBaseUpdate,X!==U&&(X===null?ke.firstBaseUpdate=Te:X.next=Te,ke.lastBaseUpdate=re))}if(E!==null){var $e=A.baseState;U=0,ke=Te=re=null,X=E;do{var De=X.lane&-536870913,Ge=De!==X.lane;if(Ge?(Vn&De)===De:(m&De)===De){De!==0&&De===Eo&&(Vm=!0),ke!==null&&(ke=ke.next={lane:0,tag:X.tag,payload:X.payload,callback:null,next:null});e:{var Zt=a,pn=X;De=r;var Ei=f;switch(pn.tag){case 1:if(Zt=pn.payload,typeof Zt=="function"){$e=Zt.call(Ei,$e,De);break e}$e=Zt;break e;case 3:Zt.flags=Zt.flags&-65537|128;case 0:if(Zt=pn.payload,De=typeof Zt=="function"?Zt.call(Ei,$e,De):Zt,De==null)break e;$e=v({},$e,De);break e;case 2:dl=!0}}De=X.callback,De!==null&&(a.flags|=64,Ge&&(a.flags|=8192),Ge=A.callbacks,Ge===null?A.callbacks=[De]:Ge.push(De))}else Ge={lane:De,tag:X.tag,payload:X.payload,callback:X.callback,next:null},ke===null?(Te=ke=Ge,re=$e):ke=ke.next=Ge,U|=De;if(X=X.next,X===null){if(X=A.shared.pending,X===null)break;Ge=X,X=Ge.next,Ge.next=null,A.lastBaseUpdate=Ge,A.shared.pending=null}}while(!0);ke===null&&(re=$e),A.baseState=re,A.firstBaseUpdate=Te,A.lastBaseUpdate=ke,E===null&&(A.shared.lanes=0),Ws|=U,a.lanes=U,a.memoizedState=$e}}function Kr(a,r){if(typeof a!="function")throw Error(n(191,a));a.call(r)}function Ga(a,r){var f=a.callbacks;if(f!==null)for(a.callbacks=null,a=0;a<f.length;a++)Kr(f[a],r)}var Ps=W(null),cs=W(0);function km(a,r){a=aa,Me(cs,a),Me(Ps,r),aa=a|r.baseLanes}function Xm(){Me(cs,aa),Me(Ps,Ps.current)}function es(){aa=cs.current,ae(Ps),ae(cs)}var xa=W(null),sr=null;function ml(a){var r=a.alternate;Me(Xi,Xi.current&1),Me(xa,a),sr===null&&(r===null||Ps.current!==null||r.memoizedState!==null)&&(sr=a)}function Ym(a){Me(Xi,Xi.current),Me(xa,a),sr===null&&(sr=a)}function J_(a){a.tag===22?(Me(Xi,Xi.current),Me(xa,a),sr===null&&(sr=a)):Co()}function Co(){Me(Xi,Xi.current),Me(xa,xa.current)}function Gs(a){ae(xa),sr===a&&(sr=null),ae(Xi)}var Xi=W(0);function bd(a){for(var r=a;r!==null;){if(r.tag===13){var f=r.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||mM(f)||gM(f)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===a)break;for(;r.sibling===null;){if(r.return===null||r.return===a)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var As=0,gn=null,yi=null,da=null,Ed=!1,Wr=!1,ic=!1,Td=0,Of=0,jr=null,qS=0;function Yi(){throw Error(n(321))}function Jm(a,r){if(r===null)return!1;for(var f=0;f<r.length&&f<a.length;f++)if(!Bi(a[f],r[f]))return!1;return!0}function qm(a,r,f,m,A,E){return As=E,gn=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,H.H=a===null||a.memoizedState===null?hy:ou,ic=!1,E=f(m,A),ic=!1,Wr&&(E=K_(r,f,m,A)),q_(a),E}function q_(a){H.H=Gf;var r=yi!==null&&yi.next!==null;if(As=0,da=yi=gn=null,Ed=!1,Of=0,jr=null,r)throw Error(n(300));a===null||Di||(a=a.dependencies,a!==null&&tu(a)&&(Di=!0))}function K_(a,r,f,m){gn=a;var A=0;do{if(Wr&&(jr=null),Of=0,Wr=!1,25<=A)throw Error(n(301));if(A+=1,da=yi=null,a.updateQueue!=null){var E=a.updateQueue;E.lastEffect=null,E.events=null,E.stores=null,E.memoCache!=null&&(E.memoCache.index=0)}H.H=zf,E=r(f,m)}while(Wr);return E}function KS(){var a=H.H,r=a.useState()[0];return r=typeof r.then=="function"?Ff(r):r,a=a.useState()[0],(yi!==null?yi.memoizedState:null)!==a&&(gn.flags|=1024),r}function Km(){var a=Td!==0;return Td=0,a}function Wm(a,r,f){r.updateQueue=a.updateQueue,r.flags&=-2053,a.lanes&=~f}function jm(a){if(Ed){for(a=a.memoizedState;a!==null;){var r=a.queue;r!==null&&(r.pending=null),a=a.next}Ed=!1}As=0,da=yi=gn=null,Wr=!1,Of=Td=0,jr=null}function us(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return da===null?gn.memoizedState=da=a:da=da.next=a,da}function ea(){if(yi===null){var a=gn.alternate;a=a!==null?a.memoizedState:null}else a=yi.next;var r=da===null?gn.memoizedState:da.next;if(r!==null)da=r,yi=a;else{if(a===null)throw gn.alternate===null?Error(n(467)):Error(n(310));yi=a,a={memoizedState:yi.memoizedState,baseState:yi.baseState,baseQueue:yi.baseQueue,queue:yi.queue,next:null},da===null?gn.memoizedState=da=a:da=da.next=a}return da}function If(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ff(a){var r=Of;return Of+=1,jr===null&&(jr=[]),a=Hm(jr,a,r),r=gn,(da===null?r.memoizedState:da.next)===null&&(r=r.alternate,H.H=r===null||r.memoizedState===null?hy:ou),a}function Cd(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return Ff(a);if(a.$$typeof===D)return wa(a)}throw Error(n(438,String(a)))}function Zm(a){var r=null,f=gn.updateQueue;if(f!==null&&(r=f.memoCache),r==null){var m=gn.alternate;m!==null&&(m=m.updateQueue,m!==null&&(m=m.memoCache,m!=null&&(r={data:m.data.map(function(A){return A.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),f===null&&(f=If(),gn.updateQueue=f),f.memoCache=r,f=r.data[r.index],f===void 0)for(f=r.data[r.index]=Array(a),m=0;m<a;m++)f[m]=F;return r.index++,f}function Ro(a,r){return typeof r=="function"?r(a):r}function Rd(a){var r=ea();return Qm(r,yi,a)}function Qm(a,r,f){var m=a.queue;if(m===null)throw Error(n(311));m.lastRenderedReducer=f;var A=a.baseQueue,E=m.pending;if(E!==null){if(A!==null){var U=A.next;A.next=E.next,E.next=U}r.baseQueue=A=E,m.pending=null}if(E=a.baseState,A===null)a.memoizedState=E;else{r=A.next;var X=U=null,re=null,Te=r,ke=!1;do{var $e=Te.lane&-536870913;if($e!==Te.lane?(Vn&$e)===$e:(As&$e)===$e){var De=Te.revertLane;if(De===0)re!==null&&(re=re.next={lane:0,revertLane:0,gesture:null,action:Te.action,hasEagerState:Te.hasEagerState,eagerState:Te.eagerState,next:null}),$e===Eo&&(ke=!0);else if((As&De)===De){Te=Te.next,De===Eo&&(ke=!0);continue}else $e={lane:0,revertLane:Te.revertLane,gesture:null,action:Te.action,hasEagerState:Te.hasEagerState,eagerState:Te.eagerState,next:null},re===null?(X=re=$e,U=E):re=re.next=$e,gn.lanes|=De,Ws|=De;$e=Te.action,ic&&f(E,$e),E=Te.hasEagerState?Te.eagerState:f(E,$e)}else De={lane:$e,revertLane:Te.revertLane,gesture:Te.gesture,action:Te.action,hasEagerState:Te.hasEagerState,eagerState:Te.eagerState,next:null},re===null?(X=re=De,U=E):re=re.next=De,gn.lanes|=$e,Ws|=$e;Te=Te.next}while(Te!==null&&Te!==r);if(re===null?U=E:re.next=X,!Bi(E,a.memoizedState)&&(Di=!0,ke&&(f=br,f!==null)))throw f;a.memoizedState=E,a.baseState=U,a.baseQueue=re,m.lastRenderedState=E}return A===null&&(m.lanes=0),[a.memoizedState,m.dispatch]}function wd(a){var r=ea(),f=r.queue;if(f===null)throw Error(n(311));f.lastRenderedReducer=a;var m=f.dispatch,A=f.pending,E=r.memoizedState;if(A!==null){f.pending=null;var U=A=A.next;do E=a(E,U.action),U=U.next;while(U!==A);Bi(E,r.memoizedState)||(Di=!0),r.memoizedState=E,r.baseQueue===null&&(r.baseState=E),f.lastRenderedState=E}return[E,m]}function $m(a,r,f){var m=gn,A=ea(),E=Jn;if(E){if(f===void 0)throw Error(n(407));f=f()}else f=r();var U=!Bi((yi||A).memoizedState,f);if(U&&(A.memoizedState=f,Di=!0),A=A.queue,ag(tg.bind(null,m,A,a),[a]),A.getSnapshot!==r||U||da!==null&&da.memoizedState.tag&1){if(m.flags|=2048,su(9,{destroy:void 0},eg.bind(null,m,A,f,r),null),fi===null)throw Error(n(349));E||(As&127)!==0||W_(m,r,f)}return f}function W_(a,r,f){a.flags|=16384,a={getSnapshot:r,value:f},r=gn.updateQueue,r===null?(r=If(),gn.updateQueue=r,r.stores=[a]):(f=r.stores,f===null?r.stores=[a]:f.push(a))}function eg(a,r,f,m){r.value=f,r.getSnapshot=m,ng(r)&&Bd(a)}function tg(a,r,f){return f(function(){ng(r)&&Bd(a)})}function ng(a){var r=a.getSnapshot;a=a.value;try{var f=r();return!Bi(a,f)}catch{return!0}}function Bd(a){var r=sl(a,2);r!==null&&u(r,a,2)}function Hf(a){var r=us();if(typeof a=="function"){var f=a;if(a=f(),ic){Tt(!0);try{f()}finally{Tt(!1)}}}return r.memoizedState=r.baseState=a,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ro,lastRenderedState:a},r}function j_(a,r,f,m){return a.baseState=f,Qm(a,yi,typeof m=="function"?m:Ro)}function WS(a,r,f,m,A){if(wo(a))throw Error(n(485));if(a=r.action,a!==null){var E={payload:A,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(U){E.listeners.push(U)}};H.T!==null?f(!0):E.isTransition=!1,m(E),f=r.pending,f===null?(E.next=r.pending=E,Z_(r,E)):(E.next=f.next,r.pending=f.next=E)}}function Z_(a,r){var f=r.action,m=r.payload,A=a.state;if(r.isTransition){var E=H.T,U={};H.T=U;try{var X=f(A,m),re=H.S;re!==null&&re(U,X),Q_(a,r,X)}catch(Te){Dd(a,r,Te)}finally{E!==null&&U.types!==null&&(E.types=U.types),H.T=E}}else try{E=f(A,m),Q_(a,r,E)}catch(Te){Dd(a,r,Te)}}function Q_(a,r,f){f!==null&&typeof f=="object"&&typeof f.then=="function"?f.then(function(m){ig(a,r,m)},function(m){return Dd(a,r,m)}):ig(a,r,f)}function ig(a,r,f){r.status="fulfilled",r.value=f,$_(r),a.state=f,r=a.pending,r!==null&&(f=r.next,f===r?a.pending=null:(f=f.next,r.next=f,Z_(a,f)))}function Dd(a,r,f){var m=a.pending;if(a.pending=null,m!==null){m=m.next;do r.status="rejected",r.reason=f,$_(r),r=r.next;while(r!==m)}a.action=null}function $_(a){a=a.listeners;for(var r=0;r<a.length;r++)(0,a[r])()}function ey(a,r){return r}function ty(a,r){if(Jn){var f=fi.formState;if(f!==null){e:{var m=gn;if(Jn){if(Si){t:{for(var A=Si,E=Ra;A.nodeType!==8;){if(!E){A=null;break t}if(A=no(A.nextSibling),A===null){A=null;break t}}E=A.data,A=E==="F!"||E==="F"?A:null}if(A){Si=no(A.nextSibling),m=A.data==="F!";break e}}zn(m)}m=!1}m&&(r=f[0])}}return f=us(),f.memoizedState=f.baseState=r,m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ey,lastRenderedState:r},f.queue=m,f=fy.bind(null,gn,m),m.dispatch=f,m=Hf(!1),E=Pf.bind(null,gn,!1,m.queue),m=us(),A={state:r,dispatch:null,action:a,pending:null},m.queue=A,f=WS.bind(null,gn,A,E,f),A.dispatch=f,m.memoizedState=a,[r,f,!1]}function ny(a){var r=ea();return iy(r,yi,a)}function iy(a,r,f){if(r=Qm(a,r,ey)[0],a=Rd(Ro)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var m=Ff(r)}catch(U){throw U===ul?Er:U}else m=r;r=ea();var A=r.queue,E=A.dispatch;return f!==r.memoizedState&&(gn.flags|=2048,su(9,{destroy:void 0},jS.bind(null,A,f),null)),[m,E,a]}function jS(a,r){a.action=r}function ay(a){var r=ea(),f=yi;if(f!==null)return iy(r,f,a);ea(),r=r.memoizedState,f=ea();var m=f.queue.dispatch;return f.memoizedState=a,[r,m,!1]}function su(a,r,f,m){return a={tag:a,create:f,deps:m,inst:r,next:null},r=gn.updateQueue,r===null&&(r=If(),gn.updateQueue=r),f=r.lastEffect,f===null?r.lastEffect=a.next=a:(m=f.next,f.next=a,a.next=m,r.lastEffect=a),a}function sy(){return ea().memoizedState}function Ld(a,r,f,m){var A=us();gn.flags|=a,A.memoizedState=su(1|r,{destroy:void 0},f,m===void 0?null:m)}function Nd(a,r,f,m){var A=ea();m=m===void 0?null:m;var E=A.memoizedState.inst;yi!==null&&m!==null&&Jm(m,yi.memoizedState.deps)?A.memoizedState=su(r,E,f,m):(gn.flags|=a,A.memoizedState=su(1|r,E,f,m))}function ry(a,r){Ld(8390656,8,a,r)}function ag(a,r){Nd(2048,8,a,r)}function oy(a){gn.flags|=4;var r=gn.updateQueue;if(r===null)r=If(),gn.updateQueue=r,r.events=[a];else{var f=r.events;f===null?r.events=[a]:f.push(a)}}function ly(a){var r=ea().memoizedState;return oy({ref:r,nextImpl:a}),function(){if((jn&2)!==0)throw Error(n(440));return r.impl.apply(void 0,arguments)}}function cy(a,r){return Nd(4,2,a,r)}function zs(a,r){return Nd(4,4,a,r)}function sg(a,r){if(typeof r=="function"){a=a();var f=r(a);return function(){typeof f=="function"?f():r(null)}}if(r!=null)return a=a(),r.current=a,function(){r.current=null}}function Ud(a,r,f){f=f!=null?f.concat([a]):null,Nd(4,4,sg.bind(null,r,a),f)}function Od(){}function rg(a,r){var f=ea();r=r===void 0?null:r;var m=f.memoizedState;return r!==null&&Jm(r,m[1])?m[0]:(f.memoizedState=[a,r],a)}function og(a,r){var f=ea();r=r===void 0?null:r;var m=f.memoizedState;if(r!==null&&Jm(r,m[1]))return m[0];if(m=a(),ic){Tt(!0);try{a()}finally{Tt(!1)}}return f.memoizedState=[m,r],m}function lg(a,r,f){return f===void 0||(As&1073741824)!==0&&(Vn&261930)===0?a.memoizedState=r:(a.memoizedState=f,a=c(),gn.lanes|=a,Ws|=a,f)}function cg(a,r,f,m){return Bi(f,r)?f:Ps.current!==null?(a=lg(a,f,m),Bi(a,r)||(Di=!0),a):(As&42)===0||(As&1073741824)!==0&&(Vn&261930)===0?(Di=!0,a.memoizedState=f):(a=c(),gn.lanes|=a,Ws|=a,r)}function ug(a,r,f,m,A){var E=Y.p;Y.p=E!==0&&8>E?E:8;var U=H.T,X={};H.T=X,Pf(a,!1,r,f);try{var re=A(),Te=H.S;if(Te!==null&&Te(X,re),re!==null&&typeof re=="object"&&typeof re.then=="function"){var ke=Fm(re,m);ru(a,r,ke,hs(a))}else ru(a,r,m,hs(a))}catch($e){ru(a,r,{then:function(){},status:"rejected",reason:$e},hs())}finally{Y.p=E,U!==null&&X.types!==null&&(U.types=X.types),H.T=U}}function ZS(){}function fg(a,r,f,m){if(a.tag!==5)throw Error(n(476));var A=uy(a).queue;ug(a,A,r,$,f===null?ZS:function(){return hg(a),f(m)})}function uy(a){var r=a.memoizedState;if(r!==null)return r;r={memoizedState:$,baseState:$,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ro,lastRenderedState:$},next:null};var f={};return r.next={memoizedState:f,baseState:f,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ro,lastRenderedState:f},next:null},a.memoizedState=r,a=a.alternate,a!==null&&(a.memoizedState=r),r}function hg(a){var r=uy(a);r.next===null&&(r=a.alternate.memoizedState),ru(a,r.next.queue,{},hs())}function dg(){return wa(Tg)}function za(){return ea().memoizedState}function pg(){return ea().memoizedState}function QS(a){for(var r=a.return;r!==null;){switch(r.tag){case 24:case 3:var f=hs();a=qr(f);var m=To(r,a,f);m!==null&&(u(m,r,f),pl(m,r,f)),r={cache:Um()},a.payload=r;return}r=r.return}}function $S(a,r,f){var m=hs();f={lane:m,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},wo(a)?ac(r,f):(f=Qc(a,r,f,m),f!==null&&(u(f,a,m),Ss(f,r,m)))}function fy(a,r,f){var m=hs();ru(a,r,f,m)}function ru(a,r,f,m){var A={lane:m,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null};if(wo(a))ac(r,A);else{var E=a.alternate;if(a.lanes===0&&(E===null||E.lanes===0)&&(E=r.lastRenderedReducer,E!==null))try{var U=r.lastRenderedState,X=E(U,f);if(A.hasEagerState=!0,A.eagerState=X,Bi(X,U))return bf(a,r,A,0),fi===null&&al(),!1}catch{}if(f=Qc(a,r,A,m),f!==null)return u(f,a,m),Ss(f,r,m),!0}return!1}function Pf(a,r,f,m){if(m={lane:2,revertLane:iM(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},wo(a)){if(r)throw Error(n(479))}else r=Qc(a,f,m,2),r!==null&&u(r,a,2)}function wo(a){var r=a.alternate;return a===gn||r!==null&&r===gn}function ac(a,r){Wr=Ed=!0;var f=a.pending;f===null?r.next=r:(r.next=f.next,f.next=r),a.pending=r}function Ss(a,r,f){if((f&4194048)!==0){var m=r.lanes;m&=a.pendingLanes,f|=m,r.lanes=f,fa(a,f)}}var Gf={readContext:wa,use:Cd,useCallback:Yi,useContext:Yi,useEffect:Yi,useImperativeHandle:Yi,useLayoutEffect:Yi,useInsertionEffect:Yi,useMemo:Yi,useReducer:Yi,useRef:Yi,useState:Yi,useDebugValue:Yi,useDeferredValue:Yi,useTransition:Yi,useSyncExternalStore:Yi,useId:Yi,useHostTransitionStatus:Yi,useFormState:Yi,useActionState:Yi,useOptimistic:Yi,useMemoCache:Yi,useCacheRefresh:Yi};Gf.useEffectEvent=Yi;var hy={readContext:wa,use:Cd,useCallback:function(a,r){return us().memoizedState=[a,r===void 0?null:r],a},useContext:wa,useEffect:ry,useImperativeHandle:function(a,r,f){f=f!=null?f.concat([a]):null,Ld(4194308,4,sg.bind(null,r,a),f)},useLayoutEffect:function(a,r){return Ld(4194308,4,a,r)},useInsertionEffect:function(a,r){Ld(4,2,a,r)},useMemo:function(a,r){var f=us();r=r===void 0?null:r;var m=a();if(ic){Tt(!0);try{a()}finally{Tt(!1)}}return f.memoizedState=[m,r],m},useReducer:function(a,r,f){var m=us();if(f!==void 0){var A=f(r);if(ic){Tt(!0);try{f(r)}finally{Tt(!1)}}}else A=r;return m.memoizedState=m.baseState=A,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:A},m.queue=a,a=a.dispatch=$S.bind(null,gn,a),[m.memoizedState,a]},useRef:function(a){var r=us();return a={current:a},r.memoizedState=a},useState:function(a){a=Hf(a);var r=a.queue,f=fy.bind(null,gn,r);return r.dispatch=f,[a.memoizedState,f]},useDebugValue:Od,useDeferredValue:function(a,r){var f=us();return lg(f,a,r)},useTransition:function(){var a=Hf(!1);return a=ug.bind(null,gn,a.queue,!0,!1),us().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,r,f){var m=gn,A=us();if(Jn){if(f===void 0)throw Error(n(407));f=f()}else{if(f=r(),fi===null)throw Error(n(349));(Vn&127)!==0||W_(m,r,f)}A.memoizedState=f;var E={value:f,getSnapshot:r};return A.queue=E,ry(tg.bind(null,m,E,a),[a]),m.flags|=2048,su(9,{destroy:void 0},eg.bind(null,m,E,f,r),null),f},useId:function(){var a=us(),r=fi.identifierPrefix;if(Jn){var f=Yr,m=Xr;f=(m&~(1<<32-pt(m)-1)).toString(32)+f,r="_"+r+"R_"+f,f=Td++,0<f&&(r+="H"+f.toString(32)),r+="_"}else f=qS++,r="_"+r+"r_"+f.toString(32)+"_";return a.memoizedState=r},useHostTransitionStatus:dg,useFormState:ty,useActionState:ty,useOptimistic:function(a){var r=us();r.memoizedState=r.baseState=a;var f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=f,r=Pf.bind(null,gn,!0,f),f.dispatch=r,[a,r]},useMemoCache:Zm,useCacheRefresh:function(){return us().memoizedState=QS.bind(null,gn)},useEffectEvent:function(a){var r=us(),f={impl:a};return r.memoizedState=f,function(){if((jn&2)!==0)throw Error(n(440));return f.impl.apply(void 0,arguments)}}},ou={readContext:wa,use:Cd,useCallback:rg,useContext:wa,useEffect:ag,useImperativeHandle:Ud,useInsertionEffect:cy,useLayoutEffect:zs,useMemo:og,useReducer:Rd,useRef:sy,useState:function(){return Rd(Ro)},useDebugValue:Od,useDeferredValue:function(a,r){var f=ea();return cg(f,yi.memoizedState,a,r)},useTransition:function(){var a=Rd(Ro)[0],r=ea().memoizedState;return[typeof a=="boolean"?a:Ff(a),r]},useSyncExternalStore:$m,useId:za,useHostTransitionStatus:dg,useFormState:ny,useActionState:ny,useOptimistic:function(a,r){var f=ea();return j_(f,yi,a,r)},useMemoCache:Zm,useCacheRefresh:pg};ou.useEffectEvent=ly;var zf={readContext:wa,use:Cd,useCallback:rg,useContext:wa,useEffect:ag,useImperativeHandle:Ud,useInsertionEffect:cy,useLayoutEffect:zs,useMemo:og,useReducer:wd,useRef:sy,useState:function(){return wd(Ro)},useDebugValue:Od,useDeferredValue:function(a,r){var f=ea();return yi===null?lg(f,a,r):cg(f,yi.memoizedState,a,r)},useTransition:function(){var a=wd(Ro)[0],r=ea().memoizedState;return[typeof a=="boolean"?a:Ff(a),r]},useSyncExternalStore:$m,useId:za,useHostTransitionStatus:dg,useFormState:ay,useActionState:ay,useOptimistic:function(a,r){var f=ea();return yi!==null?j_(f,yi,a,r):(f.baseState=a,[a,f.queue.dispatch])},useMemoCache:Zm,useCacheRefresh:pg};zf.useEffectEvent=ly;function lu(a,r,f,m){r=a.memoizedState,f=f(m,r),f=f==null?r:v({},r,f),a.memoizedState=f,a.lanes===0&&(a.updateQueue.baseState=f)}var Vf={enqueueSetState:function(a,r,f){a=a._reactInternals;var m=hs(),A=qr(m);A.payload=r,f!=null&&(A.callback=f),r=To(a,A,m),r!==null&&(u(r,a,m),pl(r,a,m))},enqueueReplaceState:function(a,r,f){a=a._reactInternals;var m=hs(),A=qr(m);A.tag=1,A.payload=r,f!=null&&(A.callback=f),r=To(a,A,m),r!==null&&(u(r,a,m),pl(r,a,m))},enqueueForceUpdate:function(a,r){a=a._reactInternals;var f=hs(),m=qr(f);m.tag=2,r!=null&&(m.callback=r),r=To(a,m,f),r!==null&&(u(r,a,f),pl(r,a,f))}};function dy(a,r,f,m,A,E,U){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(m,E,U):r.prototype&&r.prototype.isPureReactComponent?!Jc(f,m)||!Jc(A,E):!0}function py(a,r,f,m){a=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(f,m),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(f,m),r.state!==a&&Vf.enqueueReplaceState(r,r.state,null)}function Va(a,r){var f=r;if("ref"in r){f={};for(var m in r)m!=="ref"&&(f[m]=r[m])}if(a=a.defaultProps){f===r&&(f=v({},f));for(var A in a)f[A]===void 0&&(f[A]=a[A])}return f}function mg(a){il(a)}function my(a){console.error(a)}function Id(a){il(a)}function Fd(a,r){try{var f=a.onUncaughtError;f(r.value,{componentStack:r.stack})}catch(m){setTimeout(function(){throw m})}}function gy(a,r,f){try{var m=a.onCaughtError;m(f.value,{componentStack:f.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(A){setTimeout(function(){throw A})}}function gg(a,r,f){return f=qr(f),f.tag=3,f.payload={element:null},f.callback=function(){Fd(a,r)},f}function cu(a){return a=qr(a),a.tag=3,a}function Ms(a,r,f,m){var A=f.type.getDerivedStateFromError;if(typeof A=="function"){var E=m.value;a.payload=function(){return A(E)},a.callback=function(){gy(r,f,m)}}var U=f.stateNode;U!==null&&typeof U.componentDidCatch=="function"&&(a.callback=function(){gy(r,f,m),typeof A!="function"&&(to===null?to=new Set([this]):to.add(this));var X=m.stack;this.componentDidCatch(m.value,{componentStack:X!==null?X:""})})}function Vs(a,r,f,m,A){if(f.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){if(r=f.alternate,r!==null&&ll(r,f,A,!0),f=xa.current,f!==null){switch(f.tag){case 31:case 13:return sr===null?xn():f.alternate===null&&hi===0&&(hi=3),f.flags&=-257,f.flags|=65536,f.lanes=A,m===Df?f.flags|=16384:(r=f.updateQueue,r===null?f.updateQueue=new Set([m]):r.add(m),eM(a,m,A)),!1;case 22:return f.flags|=65536,m===Df?f.flags|=16384:(r=f.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([m])},f.updateQueue=r):(f=r.retryQueue,f===null?r.retryQueue=new Set([m]):f.add(m)),eM(a,m,A)),!1}throw Error(n(435,f.tag))}return eM(a,m,A),xn(),!1}if(Jn)return r=xa.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=A,m!==vd&&(a=Error(n(422),{cause:m}),Rf(ys(a,f)))):(m!==vd&&(r=Error(n(423),{cause:m}),Rf(ys(r,f))),a=a.current.alternate,a.flags|=65536,A&=-A,a.lanes|=A,m=ys(m,f),A=gg(a.stateNode,m,A),Md(a,A),hi!==4&&(hi=2)),!1;var E=Error(n(520),{cause:m});if(E=ys(E,f),Br===null?Br=[E]:Br.push(E),hi!==4&&(hi=2),r===null)return!0;m=ys(m,f),f=r;do{switch(f.tag){case 3:return f.flags|=65536,a=A&-A,f.lanes|=a,a=gg(f.stateNode,m,a),Md(f,a),!1;case 1:if(r=f.type,E=f.stateNode,(f.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||E!==null&&typeof E.componentDidCatch=="function"&&(to===null||!to.has(E))))return f.flags|=65536,A&=-A,f.lanes|=A,A=cu(A),Ms(A,a,f,m),Md(f,A),!1}f=f.return}while(f!==null);return!1}var Hd=Error(n(461)),Di=!1;function Ji(a,r,f,m){r.child=a===null?Y_(r,null,f,m):tc(r,a.child,f,m)}function kf(a,r,f,m,A){f=f.render;var E=r.ref;if("ref"in m){var U={};for(var X in m)X!=="ref"&&(U[X]=m[X])}else U=m;return Ql(r),m=qm(a,r,f,U,E,A),X=Km(),a!==null&&!Di?(Wm(a,r,A),Rr(a,r,A)):(Jn&&X&&gd(r),r.flags|=1,Ji(a,r,m,A),r.child)}function Xf(a,r,f,m,A){if(a===null){var E=f.type;return typeof E=="function"&&!ls(E)&&E.defaultProps===void 0&&f.compare===null?(r.tag=15,r.type=E,ks(a,r,E,m,A)):(a=Ef(f.type,null,m,r,r.mode,A),a.ref=r.ref,a.return=r,r.child=a)}if(E=a.child,!vl(a,A)){var U=E.memoizedProps;if(f=f.compare,f=f!==null?f:Jc,f(U,m)&&a.ref===r.ref)return Rr(a,r,A)}return r.flags|=1,a=Vr(E,m),a.ref=r.ref,a.return=r,r.child=a}function ks(a,r,f,m,A){if(a!==null){var E=a.memoizedProps;if(Jc(E,m)&&a.ref===r.ref)if(Di=!1,r.pendingProps=m=E,vl(a,A))(a.flags&131072)!==0&&(Di=!0);else return r.lanes=a.lanes,Rr(a,r,A)}return uu(a,r,f,m,A)}function Xs(a,r,f,m){var A=m.children,E=a!==null?a.memoizedState:null;if(a===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),m.mode==="hidden"){if((r.flags&128)!==0){if(E=E!==null?E.baseLanes|f:f,a!==null){for(m=r.child=a.child,A=0;m!==null;)A=A|m.lanes|m.childLanes,m=m.sibling;m=A&~E}else m=0,r.child=null;return Zr(a,r,E,f,m)}if((f&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},a!==null&&iu(r,E!==null?E.cachePool:null),E!==null?km(r,E):Xm(),J_(r);else return m=r.lanes=536870912,Zr(a,r,E!==null?E.baseLanes|f:f,f,m)}else E!==null?(iu(r,E.cachePool),km(r,E),Co(),r.memoizedState=null):(a!==null&&iu(r,null),Xm(),Co());return Ji(a,r,A,f),r.child}function Tr(a,r){return a!==null&&a.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function Zr(a,r,f,m,A){var E=Jr();return E=E===null?null:{parent:sn._currentValue,pool:E},r.memoizedState={baseLanes:f,cachePool:E},a!==null&&iu(r,null),Xm(),J_(r),a!==null&&ll(a,r,m,!0),r.childLanes=A,null}function rr(a,r){return r=fu({mode:r.mode,children:r.children},a.mode),r.ref=a.ref,a.child=r,r.return=a,r}function Ba(a,r,f){return tc(r,a.child,null,f),a=rr(r,r.pendingProps),a.flags|=2,Gs(r),r.memoizedState=null,a}function Yf(a,r,f){var m=r.pendingProps,A=(r.flags&128)!==0;if(r.flags&=-129,a===null){if(Jn){if(m.mode==="hidden")return a=rr(r,m),r.lanes=536870912,Tr(null,a);if(Ym(r),(a=Si)?(a=ZC(a,Ra),a=a!==null&&a.data==="&"?a:null,a!==null&&(r.memoizedState={dehydrated:a,treeContext:kr!==null?{id:Xr,overflow:Yr}:null,retryLane:536870912,hydrationErrors:null},f=P_(a),f.return=r,r.child=f,Ca=r,Si=null)):a=null,a===null)throw zn(r);return r.lanes=536870912,null}return rr(r,m)}var E=a.memoizedState;if(E!==null){var U=E.dehydrated;if(Ym(r),A)if(r.flags&256)r.flags&=-257,r=Ba(a,r,f);else if(r.memoizedState!==null)r.child=a.child,r.flags|=128,r=null;else throw Error(n(558));else if(Di||ll(a,r,f,!1),A=(f&a.childLanes)!==0,Di||A){if(m=fi,m!==null&&(U=Ui(m,f),U!==0&&U!==E.retryLane))throw E.retryLane=U,sl(a,U),u(m,a,U),Hd;xn(),r=Ba(a,r,f)}else a=E.treeContext,Si=no(U.nextSibling),Ca=r,Jn=!0,Ao=null,Ra=!1,a!==null&&Cf(r,a),r=rr(r,m),r.flags|=4096;return r}return a=Vr(a.child,{mode:m.mode,children:m.children}),a.ref=r.ref,r.child=a,a.return=r,a}function Cr(a,r){var f=r.ref;if(f===null)a!==null&&a.ref!==null&&(r.flags|=4194816);else{if(typeof f!="function"&&typeof f!="object")throw Error(n(284));(a===null||a.ref!==f)&&(r.flags|=4194816)}}function uu(a,r,f,m,A){return Ql(r),f=qm(a,r,f,m,void 0,A),m=Km(),a!==null&&!Di?(Wm(a,r,A),Rr(a,r,A)):(Jn&&m&&gd(r),r.flags|=1,Ji(a,r,f,A),r.child)}function ts(a,r,f,m,A,E){return Ql(r),r.updateQueue=null,f=K_(r,m,f,A),q_(a),m=Km(),a!==null&&!Di?(Wm(a,r,E),Rr(a,r,E)):(Jn&&m&&gd(r),r.flags|=1,Ji(a,r,f,E),r.child)}function ka(a,r,f,m,A){if(Ql(r),r.stateNode===null){var E=rl,U=f.contextType;typeof U=="object"&&U!==null&&(E=wa(U)),E=new f(m,E),r.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,E.updater=Vf,r.stateNode=E,E._reactInternals=r,E=r.stateNode,E.props=m,E.state=r.memoizedState,E.refs={},Gm(r),U=f.contextType,E.context=typeof U=="object"&&U!==null?wa(U):rl,E.state=r.memoizedState,U=f.getDerivedStateFromProps,typeof U=="function"&&(lu(r,f,U,m),E.state=r.memoizedState),typeof f.getDerivedStateFromProps=="function"||typeof E.getSnapshotBeforeUpdate=="function"||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(U=E.state,typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount(),U!==E.state&&Vf.enqueueReplaceState(E,E.state,null),nc(r,m,E,A),Uf(),E.state=r.memoizedState),typeof E.componentDidMount=="function"&&(r.flags|=4194308),m=!0}else if(a===null){E=r.stateNode;var X=r.memoizedProps,re=Va(f,X);E.props=re;var Te=E.context,ke=f.contextType;U=rl,typeof ke=="object"&&ke!==null&&(U=wa(ke));var $e=f.getDerivedStateFromProps;ke=typeof $e=="function"||typeof E.getSnapshotBeforeUpdate=="function",X=r.pendingProps!==X,ke||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(X||Te!==U)&&py(r,E,m,U),dl=!1;var De=r.memoizedState;E.state=De,nc(r,m,E,A),Uf(),Te=r.memoizedState,X||De!==Te||dl?(typeof $e=="function"&&(lu(r,f,$e,m),Te=r.memoizedState),(re=dl||dy(r,f,re,m,De,Te,U))?(ke||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount()),typeof E.componentDidMount=="function"&&(r.flags|=4194308)):(typeof E.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=m,r.memoizedState=Te),E.props=m,E.state=Te,E.context=U,m=re):(typeof E.componentDidMount=="function"&&(r.flags|=4194308),m=!1)}else{E=r.stateNode,zm(a,r),U=r.memoizedProps,ke=Va(f,U),E.props=ke,$e=r.pendingProps,De=E.context,Te=f.contextType,re=rl,typeof Te=="object"&&Te!==null&&(re=wa(Te)),X=f.getDerivedStateFromProps,(Te=typeof X=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(U!==$e||De!==re)&&py(r,E,m,re),dl=!1,De=r.memoizedState,E.state=De,nc(r,m,E,A),Uf();var Ge=r.memoizedState;U!==$e||De!==Ge||dl||a!==null&&a.dependencies!==null&&tu(a.dependencies)?(typeof X=="function"&&(lu(r,f,X,m),Ge=r.memoizedState),(ke=dl||dy(r,f,ke,m,De,Ge,re)||a!==null&&a.dependencies!==null&&tu(a.dependencies))?(Te||typeof E.UNSAFE_componentWillUpdate!="function"&&typeof E.componentWillUpdate!="function"||(typeof E.componentWillUpdate=="function"&&E.componentWillUpdate(m,Ge,re),typeof E.UNSAFE_componentWillUpdate=="function"&&E.UNSAFE_componentWillUpdate(m,Ge,re)),typeof E.componentDidUpdate=="function"&&(r.flags|=4),typeof E.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof E.componentDidUpdate!="function"||U===a.memoizedProps&&De===a.memoizedState||(r.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||U===a.memoizedProps&&De===a.memoizedState||(r.flags|=1024),r.memoizedProps=m,r.memoizedState=Ge),E.props=m,E.state=Ge,E.context=re,m=ke):(typeof E.componentDidUpdate!="function"||U===a.memoizedProps&&De===a.memoizedState||(r.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||U===a.memoizedProps&&De===a.memoizedState||(r.flags|=1024),m=!1)}return E=m,Cr(a,r),m=(r.flags&128)!==0,E||m?(E=r.stateNode,f=m&&typeof f.getDerivedStateFromError!="function"?null:E.render(),r.flags|=1,a!==null&&m?(r.child=tc(r,a.child,null,A),r.child=tc(r,null,f,A)):Ji(a,r,f,A),r.memoizedState=E.state,a=r.child):a=Rr(a,r,A),a}function ni(a,r,f,m){return Zl(),r.flags|=256,Ji(a,r,f,m),r.child}var Ys={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function or(a){return{baseLanes:a,cachePool:xd()}}function Jf(a,r,f){return a=a!==null?a.childLanes&~f:0,r&&(a|=Zn),a}function Js(a,r,f){var m=r.pendingProps,A=!1,E=(r.flags&128)!==0,U;if((U=E)||(U=a!==null&&a.memoizedState===null?!1:(Xi.current&2)!==0),U&&(A=!0,r.flags&=-129),U=(r.flags&32)!==0,r.flags&=-33,a===null){if(Jn){if(A?ml(r):Co(),(a=Si)?(a=ZC(a,Ra),a=a!==null&&a.data!=="&"?a:null,a!==null&&(r.memoizedState={dehydrated:a,treeContext:kr!==null?{id:Xr,overflow:Yr}:null,retryLane:536870912,hydrationErrors:null},f=P_(a),f.return=r,r.child=f,Ca=r,Si=null)):a=null,a===null)throw zn(r);return gM(a)?r.lanes=32:r.lanes=536870912,null}var X=m.children;return m=m.fallback,A?(Co(),A=r.mode,X=fu({mode:"hidden",children:X},A),m=yo(m,A,f,null),X.return=r,m.return=r,X.sibling=m,r.child=X,m=r.child,m.memoizedState=or(f),m.childLanes=Jf(a,U,f),r.memoizedState=Ys,Tr(null,m)):(ml(r),gl(r,X))}var re=a.memoizedState;if(re!==null&&(X=re.dehydrated,X!==null)){if(E)r.flags&256?(ml(r),r.flags&=-257,r=hu(a,r,f)):r.memoizedState!==null?(Co(),r.child=a.child,r.flags|=128,r=null):(Co(),X=m.fallback,A=r.mode,m=fu({mode:"visible",children:m.children},A),X=yo(X,A,f,null),X.flags|=2,m.return=r,X.return=r,m.sibling=X,r.child=m,tc(r,a.child,null,f),m=r.child,m.memoizedState=or(f),m.childLanes=Jf(a,U,f),r.memoizedState=Ys,r=Tr(null,m));else if(ml(r),gM(X)){if(U=X.nextSibling&&X.nextSibling.dataset,U)var Te=U.dgst;U=Te,m=Error(n(419)),m.stack="",m.digest=U,Rf({value:m,source:null,stack:null}),r=hu(a,r,f)}else if(Di||ll(a,r,f,!1),U=(f&a.childLanes)!==0,Di||U){if(U=fi,U!==null&&(m=Ui(U,f),m!==0&&m!==re.retryLane))throw re.retryLane=m,sl(a,m),u(U,a,m),Hd;mM(X)||xn(),r=hu(a,r,f)}else mM(X)?(r.flags|=192,r.child=a.child,r=null):(a=re.treeContext,Si=no(X.nextSibling),Ca=r,Jn=!0,Ao=null,Ra=!1,a!==null&&Cf(r,a),r=gl(r,m.children),r.flags|=4096);return r}return A?(Co(),X=m.fallback,A=r.mode,re=a.child,Te=re.sibling,m=Vr(re,{mode:"hidden",children:m.children}),m.subtreeFlags=re.subtreeFlags&65011712,Te!==null?X=Vr(Te,X):(X=yo(X,A,f,null),X.flags|=2),X.return=r,m.return=r,m.sibling=X,r.child=m,Tr(null,m),m=r.child,X=a.child.memoizedState,X===null?X=or(f):(A=X.cachePool,A!==null?(re=sn._currentValue,A=A.parent!==re?{parent:re,pool:re}:A):A=xd(),X={baseLanes:X.baseLanes|f,cachePool:A}),m.memoizedState=X,m.childLanes=Jf(a,U,f),r.memoizedState=Ys,Tr(a.child,m)):(ml(r),f=a.child,a=f.sibling,f=Vr(f,{mode:"visible",children:m.children}),f.return=r,f.sibling=null,a!==null&&(U=r.deletions,U===null?(r.deletions=[a],r.flags|=16):U.push(a)),r.child=f,r.memoizedState=null,f)}function gl(a,r){return r=fu({mode:"visible",children:r},a.mode),r.return=a,a.child=r}function fu(a,r){return a=os(22,a,null,r),a.lanes=0,a}function hu(a,r,f){return tc(r,a.child,null,f),a=gl(r,r.pendingProps.children),a.flags|=2,r.memoizedState=null,a}function sc(a,r,f){a.lanes|=r;var m=a.alternate;m!==null&&(m.lanes|=r),bo(a.return,r,f)}function qf(a,r,f,m,A,E){var U=a.memoizedState;U===null?a.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:m,tail:f,tailMode:A,treeForkCount:E}:(U.isBackwards=r,U.rendering=null,U.renderingStartTime=0,U.last=m,U.tail=f,U.tailMode=A,U.treeForkCount=E)}function Kf(a,r,f){var m=r.pendingProps,A=m.revealOrder,E=m.tail;m=m.children;var U=Xi.current,X=(U&2)!==0;if(X?(U=U&1|2,r.flags|=128):U&=1,Me(Xi,U),Ji(a,r,m,f),m=Jn?eu:0,!X&&a!==null&&(a.flags&128)!==0)e:for(a=r.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&sc(a,f,r);else if(a.tag===19)sc(a,f,r);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===r)break e;for(;a.sibling===null;){if(a.return===null||a.return===r)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(A){case"forwards":for(f=r.child,A=null;f!==null;)a=f.alternate,a!==null&&bd(a)===null&&(A=f),f=f.sibling;f=A,f===null?(A=r.child,r.child=null):(A=f.sibling,f.sibling=null),qf(r,!1,A,f,E,m);break;case"backwards":case"unstable_legacy-backwards":for(f=null,A=r.child,r.child=null;A!==null;){if(a=A.alternate,a!==null&&bd(a)===null){r.child=A;break}a=A.sibling,A.sibling=f,f=A,A=a}qf(r,!0,f,null,E,m);break;case"together":qf(r,!1,null,null,void 0,m);break;default:r.memoizedState=null}return r.child}function Rr(a,r,f){if(a!==null&&(r.dependencies=a.dependencies),Ws|=r.lanes,(f&r.childLanes)===0)if(a!==null){if(ll(a,r,f,!1),(f&r.childLanes)===0)return null}else return null;if(a!==null&&r.child!==a.child)throw Error(n(153));if(r.child!==null){for(a=r.child,f=Vr(a,a.pendingProps),r.child=f,f.return=r;a.sibling!==null;)a=a.sibling,f=f.sibling=Vr(a,a.pendingProps),f.return=r;f.sibling=null}return r.child}function vl(a,r){return(a.lanes&r)!==0?!0:(a=a.dependencies,!!(a!==null&&tu(a)))}function Wf(a,r,f){switch(r.tag){case 3:tt(r,r.stateNode.containerInfo),Mo(r,sn,a.memoizedState.cache),Zl();break;case 27:case 5:wt(r);break;case 4:tt(r,r.stateNode.containerInfo);break;case 10:Mo(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,Ym(r),null;break;case 13:var m=r.memoizedState;if(m!==null)return m.dehydrated!==null?(ml(r),r.flags|=128,null):(f&r.child.childLanes)!==0?Js(a,r,f):(ml(r),a=Rr(a,r,f),a!==null?a.sibling:null);ml(r);break;case 19:var A=(a.flags&128)!==0;if(m=(f&r.childLanes)!==0,m||(ll(a,r,f,!1),m=(f&r.childLanes)!==0),A){if(m)return Kf(a,r,f);r.flags|=128}if(A=r.memoizedState,A!==null&&(A.rendering=null,A.tail=null,A.lastEffect=null),Me(Xi,Xi.current),m)break;return null;case 22:return r.lanes=0,Xs(a,r,f,r.pendingProps);case 24:Mo(r,sn,a.memoizedState.cache)}return Rr(a,r,f)}function Pd(a,r,f){if(a!==null)if(a.memoizedProps!==r.pendingProps)Di=!0;else{if(!vl(a,f)&&(r.flags&128)===0)return Di=!1,Wf(a,r,f);Di=(a.flags&131072)!==0}else Di=!1,Jn&&(r.flags&1048576)!==0&&wm(r,eu,r.index);switch(r.lanes=0,r.tag){case 16:e:{var m=r.pendingProps;if(a=ec(r.elementType),r.type=a,typeof a=="function")ls(a)?(m=Va(a,m),r.tag=1,r=ka(null,r,a,m,f)):(r.tag=0,r=uu(null,r,a,m,f));else{if(a!=null){var A=a.$$typeof;if(A===L){r.tag=11,r=kf(null,r,a,m,f);break e}else if(A===z){r.tag=14,r=Xf(null,r,a,m,f);break e}}throw r=ie(a)||a,Error(n(306,r,""))}}return r;case 0:return uu(a,r,r.type,r.pendingProps,f);case 1:return m=r.type,A=Va(m,r.pendingProps),ka(a,r,m,A,f);case 3:e:{if(tt(r,r.stateNode.containerInfo),a===null)throw Error(n(387));m=r.pendingProps;var E=r.memoizedState;A=E.element,zm(a,r),nc(r,m,null,f);var U=r.memoizedState;if(m=U.cache,Mo(r,sn,m),m!==E.cache&&yd(r,[sn],f,!0),Uf(),m=U.element,E.isDehydrated)if(E={element:m,isDehydrated:!1,cache:U.cache},r.updateQueue.baseState=E,r.memoizedState=E,r.flags&256){r=ni(a,r,m,f);break e}else if(m!==A){A=ys(Error(n(424)),r),Rf(A),r=ni(a,r,m,f);break e}else for(a=r.stateNode.containerInfo,a.nodeType===9?a=a.body:a=a.nodeName==="HTML"?a.ownerDocument.body:a,Si=no(a.firstChild),Ca=r,Jn=!0,Ao=null,Ra=!0,f=Y_(r,null,m,f),r.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling;else{if(Zl(),m===A){r=Rr(a,r,f);break e}Ji(a,r,m,f)}r=r.child}return r;case 26:return Cr(a,r),a===null?(f=iR(r.type,null,r.pendingProps,null))?r.memoizedState=f:Jn||(f=r.type,a=r.pendingProps,m=by(ve.current).createElement(f),m[fn]=r,m[G]=a,ds(m,f,a),k(m),r.stateNode=m):r.memoizedState=iR(r.type,a.memoizedProps,r.pendingProps,a.memoizedState),null;case 27:return wt(r),a===null&&Jn&&(m=r.stateNode=eR(r.type,r.pendingProps,ve.current),Ca=r,Ra=!0,A=Si,yu(r.type)?(vM=A,Si=no(m.firstChild)):Si=A),Ji(a,r,r.pendingProps.children,f),Cr(a,r),a===null&&(r.flags|=4194304),r.child;case 5:return a===null&&Jn&&((A=m=Si)&&(m=w4(m,r.type,r.pendingProps,Ra),m!==null?(r.stateNode=m,Ca=r,Si=no(m.firstChild),Ra=!1,A=!0):A=!1),A||zn(r)),wt(r),A=r.type,E=r.pendingProps,U=a!==null?a.memoizedProps:null,m=E.children,hM(A,E)?m=null:U!==null&&hM(A,U)&&(r.flags|=32),r.memoizedState!==null&&(A=qm(a,r,KS,null,null,f),Tg._currentValue=A),Cr(a,r),Ji(a,r,m,f),r.child;case 6:return a===null&&Jn&&((a=f=Si)&&(f=B4(f,r.pendingProps,Ra),f!==null?(r.stateNode=f,Ca=r,Si=null,a=!0):a=!1),a||zn(r)),null;case 13:return Js(a,r,f);case 4:return tt(r,r.stateNode.containerInfo),m=r.pendingProps,a===null?r.child=tc(r,null,m,f):Ji(a,r,m,f),r.child;case 11:return kf(a,r,r.type,r.pendingProps,f);case 7:return Ji(a,r,r.pendingProps,f),r.child;case 8:return Ji(a,r,r.pendingProps.children,f),r.child;case 12:return Ji(a,r,r.pendingProps.children,f),r.child;case 10:return m=r.pendingProps,Mo(r,r.type,m.value),Ji(a,r,m.children,f),r.child;case 9:return A=r.type._context,m=r.pendingProps.children,Ql(r),A=wa(A),m=m(A),r.flags|=1,Ji(a,r,m,f),r.child;case 14:return Xf(a,r,r.type,r.pendingProps,f);case 15:return ks(a,r,r.type,r.pendingProps,f);case 19:return Kf(a,r,f);case 31:return Yf(a,r,f);case 22:return Xs(a,r,f,r.pendingProps);case 24:return Ql(r),m=wa(sn),a===null?(A=Jr(),A===null&&(A=fi,E=Um(),A.pooledCache=E,E.refCount++,E!==null&&(A.pooledCacheLanes|=f),A=E),r.memoizedState={parent:m,cache:A},Gm(r),Mo(r,sn,A)):((a.lanes&f)!==0&&(zm(a,r),nc(r,null,null,f),Uf()),A=a.memoizedState,E=r.memoizedState,A.parent!==m?(A={parent:m,cache:m},r.memoizedState=A,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=A),Mo(r,sn,m)):(m=E.cache,Mo(r,sn,m),m!==A.cache&&yd(r,[sn],f,!0))),Ji(a,r,r.pendingProps.children,f),r.child;case 29:throw r.pendingProps}throw Error(n(156,r.tag))}function bs(a){a.flags|=4}function _l(a,r,f,m,A){if((r=(a.mode&32)!==0)&&(r=!1),r){if(a.flags|=16777216,(A&335544128)===A)if(a.stateNode.complete)a.flags|=8192;else if(Mt())a.flags|=8192;else throw hn=Df,Bf}else a.flags&=-16777217}function Bo(a,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!lR(r))if(Mt())a.flags|=8192;else throw hn=Df,Bf}function du(a,r){r!==null&&(a.flags|=4),a.flags&16384&&(r=a.tag!==22?Sn():536870912,a.lanes|=r,js|=r)}function jf(a,r){if(!Jn)switch(a.tailMode){case"hidden":r=a.tail;for(var f=null;r!==null;)r.alternate!==null&&(f=r),r=r.sibling;f===null?a.tail=null:f.sibling=null;break;case"collapsed":f=a.tail;for(var m=null;f!==null;)f.alternate!==null&&(m=f),f=f.sibling;m===null?r||a.tail===null?a.tail=null:a.tail.sibling=null:m.sibling=null}}function mi(a){var r=a.alternate!==null&&a.alternate.child===a.child,f=0,m=0;if(r)for(var A=a.child;A!==null;)f|=A.lanes|A.childLanes,m|=A.subtreeFlags&65011712,m|=A.flags&65011712,A.return=a,A=A.sibling;else for(A=a.child;A!==null;)f|=A.lanes|A.childLanes,m|=A.subtreeFlags,m|=A.flags,A.return=a,A=A.sibling;return a.subtreeFlags|=m,a.childLanes=f,r}function vg(a,r,f){var m=r.pendingProps;switch(ol(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return mi(r),null;case 1:return mi(r),null;case 3:return f=r.stateNode,m=null,a!==null&&(m=a.memoizedState.cache),r.memoizedState.cache!==m&&(r.flags|=2048),ar(sn),Et(),f.pendingContext&&(f.context=f.pendingContext,f.pendingContext=null),(a===null||a.child===null)&&(jl(r)?bs(r):a===null||a.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,Bm())),mi(r),null;case 26:var A=r.type,E=r.memoizedState;return a===null?(bs(r),E!==null?(mi(r),Bo(r,E)):(mi(r),_l(r,A,null,m,f))):E?E!==a.memoizedState?(bs(r),mi(r),Bo(r,E)):(mi(r),r.flags&=-16777217):(a=a.memoizedProps,a!==m&&bs(r),mi(r),_l(r,A,a,m,f)),null;case 27:if(on(r),f=ve.current,A=r.type,a!==null&&r.stateNode!=null)a.memoizedProps!==m&&bs(r);else{if(!m){if(r.stateNode===null)throw Error(n(166));return mi(r),null}a=Ne.current,jl(r)?_d(r):(a=eR(A,m,f),r.stateNode=a,bs(r))}return mi(r),null;case 5:if(on(r),A=r.type,a!==null&&r.stateNode!=null)a.memoizedProps!==m&&bs(r);else{if(!m){if(r.stateNode===null)throw Error(n(166));return mi(r),null}if(E=Ne.current,jl(r))_d(r);else{var U=by(ve.current);switch(E){case 1:E=U.createElementNS("http://www.w3.org/2000/svg",A);break;case 2:E=U.createElementNS("http://www.w3.org/1998/Math/MathML",A);break;default:switch(A){case"svg":E=U.createElementNS("http://www.w3.org/2000/svg",A);break;case"math":E=U.createElementNS("http://www.w3.org/1998/Math/MathML",A);break;case"script":E=U.createElement("div"),E.innerHTML="<script><\/script>",E=E.removeChild(E.firstChild);break;case"select":E=typeof m.is=="string"?U.createElement("select",{is:m.is}):U.createElement("select"),m.multiple?E.multiple=!0:m.size&&(E.size=m.size);break;default:E=typeof m.is=="string"?U.createElement(A,{is:m.is}):U.createElement(A)}}E[fn]=r,E[G]=m;e:for(U=r.child;U!==null;){if(U.tag===5||U.tag===6)E.appendChild(U.stateNode);else if(U.tag!==4&&U.tag!==27&&U.child!==null){U.child.return=U,U=U.child;continue}if(U===r)break e;for(;U.sibling===null;){if(U.return===null||U.return===r)break e;U=U.return}U.sibling.return=U.return,U=U.sibling}r.stateNode=E;e:switch(ds(E,A,m),A){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}m&&bs(r)}}return mi(r),_l(r,r.type,a===null?null:a.memoizedProps,r.pendingProps,f),null;case 6:if(a&&r.stateNode!=null)a.memoizedProps!==m&&bs(r);else{if(typeof m!="string"&&r.stateNode===null)throw Error(n(166));if(a=ve.current,jl(r)){if(a=r.stateNode,f=r.memoizedProps,m=null,A=Ca,A!==null)switch(A.tag){case 27:case 5:m=A.memoizedProps}a[fn]=r,a=!!(a.nodeValue===f||m!==null&&m.suppressHydrationWarning===!0||kC(a.nodeValue,f)),a||zn(r,!0)}else a=by(a).createTextNode(m),a[fn]=r,r.stateNode=a}return mi(r),null;case 31:if(f=r.memoizedState,a===null||a.memoizedState!==null){if(m=jl(r),f!==null){if(a===null){if(!m)throw Error(n(318));if(a=r.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(n(557));a[fn]=r}else Zl(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;mi(r),a=!1}else f=Bm(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=f),a=!0;if(!a)return r.flags&256?(Gs(r),r):(Gs(r),null);if((r.flags&128)!==0)throw Error(n(558))}return mi(r),null;case 13:if(m=r.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(A=jl(r),m!==null&&m.dehydrated!==null){if(a===null){if(!A)throw Error(n(318));if(A=r.memoizedState,A=A!==null?A.dehydrated:null,!A)throw Error(n(317));A[fn]=r}else Zl(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;mi(r),A=!1}else A=Bm(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=A),A=!0;if(!A)return r.flags&256?(Gs(r),r):(Gs(r),null)}return Gs(r),(r.flags&128)!==0?(r.lanes=f,r):(f=m!==null,a=a!==null&&a.memoizedState!==null,f&&(m=r.child,A=null,m.alternate!==null&&m.alternate.memoizedState!==null&&m.alternate.memoizedState.cachePool!==null&&(A=m.alternate.memoizedState.cachePool.pool),E=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(E=m.memoizedState.cachePool.pool),E!==A&&(m.flags|=2048)),f!==a&&f&&(r.child.flags|=8192),du(r,r.updateQueue),mi(r),null);case 4:return Et(),a===null&&oM(r.stateNode.containerInfo),mi(r),null;case 10:return ar(r.type),mi(r),null;case 19:if(ae(Xi),m=r.memoizedState,m===null)return mi(r),null;if(A=(r.flags&128)!==0,E=m.rendering,E===null)if(A)jf(m,!1);else{if(hi!==0||a!==null&&(a.flags&128)!==0)for(a=r.child;a!==null;){if(E=bd(a),E!==null){for(r.flags|=128,jf(m,!1),a=E.updateQueue,r.updateQueue=a,du(r,a),r.subtreeFlags=0,a=f,f=r.child;f!==null;)Qa(f,a),f=f.sibling;return Me(Xi,Xi.current&1|2),Jn&&xo(r,m.treeForkCount),r.child}a=a.sibling}m.tail!==null&&I()>Zs&&(r.flags|=128,A=!0,jf(m,!1),r.lanes=4194304)}else{if(!A)if(a=bd(E),a!==null){if(r.flags|=128,A=!0,a=a.updateQueue,r.updateQueue=a,du(r,a),jf(m,!0),m.tail===null&&m.tailMode==="hidden"&&!E.alternate&&!Jn)return mi(r),null}else 2*I()-m.renderingStartTime>Zs&&f!==536870912&&(r.flags|=128,A=!0,jf(m,!1),r.lanes=4194304);m.isBackwards?(E.sibling=r.child,r.child=E):(a=m.last,a!==null?a.sibling=E:r.child=E,m.last=E)}return m.tail!==null?(a=m.tail,m.rendering=a,m.tail=a.sibling,m.renderingStartTime=I(),a.sibling=null,f=Xi.current,Me(Xi,A?f&1|2:f&1),Jn&&xo(r,m.treeForkCount),a):(mi(r),null);case 22:case 23:return Gs(r),es(),m=r.memoizedState!==null,a!==null?a.memoizedState!==null!==m&&(r.flags|=8192):m&&(r.flags|=8192),m?(f&536870912)!==0&&(r.flags&128)===0&&(mi(r),r.subtreeFlags&6&&(r.flags|=8192)):mi(r),f=r.updateQueue,f!==null&&du(r,f.retryQueue),f=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(f=a.memoizedState.cachePool.pool),m=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(m=r.memoizedState.cachePool.pool),m!==f&&(r.flags|=2048),a!==null&&ae(cl),null;case 24:return f=null,a!==null&&(f=a.memoizedState.cache),r.memoizedState.cache!==f&&(r.flags|=2048),ar(sn),mi(r),null;case 25:return null;case 30:return null}throw Error(n(156,r.tag))}function Gd(a,r){switch(ol(r),r.tag){case 1:return a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 3:return ar(sn),Et(),a=r.flags,(a&65536)!==0&&(a&128)===0?(r.flags=a&-65537|128,r):null;case 26:case 27:case 5:return on(r),null;case 31:if(r.memoizedState!==null){if(Gs(r),r.alternate===null)throw Error(n(340));Zl()}return a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 13:if(Gs(r),a=r.memoizedState,a!==null&&a.dehydrated!==null){if(r.alternate===null)throw Error(n(340));Zl()}return a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 19:return ae(Xi),null;case 4:return Et(),null;case 10:return ar(r.type),null;case 22:case 23:return Gs(r),es(),a!==null&&ae(cl),a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 24:return ar(sn),null;case 25:return null;default:return null}}function rc(a,r){switch(ol(r),r.tag){case 3:ar(sn),Et();break;case 26:case 27:case 5:on(r);break;case 4:Et();break;case 31:r.memoizedState!==null&&Gs(r);break;case 13:Gs(r);break;case 19:ae(Xi);break;case 10:ar(r.type);break;case 22:case 23:Gs(r),es(),a!==null&&ae(cl);break;case 24:ar(sn)}}function Qr(a,r){try{var f=r.updateQueue,m=f!==null?f.lastEffect:null;if(m!==null){var A=m.next;f=A;do{if((f.tag&a)===a){m=void 0;var E=f.create,U=f.inst;m=E(),U.destroy=m}f=f.next}while(f!==A)}}catch(X){Ai(r,r.return,X)}}function lr(a,r,f){try{var m=r.updateQueue,A=m!==null?m.lastEffect:null;if(A!==null){var E=A.next;m=E;do{if((m.tag&a)===a){var U=m.inst,X=U.destroy;if(X!==void 0){U.destroy=void 0,A=r;var re=f,Te=X;try{Te()}catch(ke){Ai(A,re,ke)}}}m=m.next}while(m!==E)}}catch(ke){Ai(r,r.return,ke)}}function yl(a){var r=a.updateQueue;if(r!==null){var f=a.stateNode;try{Ga(r,f)}catch(m){Ai(a,a.return,m)}}}function _g(a,r,f){f.props=Va(a.type,a.memoizedProps),f.state=a.memoizedState;try{f.componentWillUnmount()}catch(m){Ai(a,r,m)}}function $r(a,r){try{var f=a.ref;if(f!==null){switch(a.tag){case 26:case 27:case 5:var m=a.stateNode;break;case 30:m=a.stateNode;break;default:m=a.stateNode}typeof f=="function"?a.refCleanup=f(m):f.current=m}}catch(A){Ai(a,r,A)}}function qs(a,r){var f=a.ref,m=a.refCleanup;if(f!==null)if(typeof m=="function")try{m()}catch(A){Ai(a,r,A)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof f=="function")try{f(null)}catch(A){Ai(a,r,A)}else f.current=null}function Ks(a){var r=a.type,f=a.memoizedProps,m=a.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":f.autoFocus&&m.focus();break e;case"img":f.src?m.src=f.src:f.srcSet&&(m.srcset=f.srcSet)}}catch(A){Ai(a,a.return,A)}}function cr(a,r,f){try{var m=a.stateNode;M4(m,a.type,f,r),m[G]=r}catch(A){Ai(a,a.return,A)}}function pa(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&yu(a.type)||a.tag===4}function eo(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||pa(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&yu(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function Rn(a,r,f){var m=a.tag;if(m===5||m===6)a=a.stateNode,r?(f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f).insertBefore(a,r):(r=f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f,r.appendChild(a),f=f._reactRootContainer,f!=null||r.onclick!==null||(r.onclick=Cn));else if(m!==4&&(m===27&&yu(a.type)&&(f=a.stateNode,r=null),a=a.child,a!==null))for(Rn(a,r,f),a=a.sibling;a!==null;)Rn(a,r,f),a=a.sibling}function oi(a,r,f){var m=a.tag;if(m===5||m===6)a=a.stateNode,r?f.insertBefore(a,r):f.appendChild(a);else if(m!==4&&(m===27&&yu(a.type)&&(f=a.stateNode),a=a.child,a!==null))for(oi(a,r,f),a=a.sibling;a!==null;)oi(a,r,f),a=a.sibling}function ta(a){var r=a.stateNode,f=a.memoizedProps;try{for(var m=a.type,A=r.attributes;A.length;)r.removeAttributeNode(A[0]);ds(r,m,f),r[fn]=a,r[G]=f}catch(E){Ai(a,a.return,E)}}var ur=!1,Li=!1,Do=!1,Zf=typeof WeakSet=="function"?WeakSet:Set,qi=null;function pu(a,r){if(a=a.containerInfo,uM=Dy,a=ld(a),qc(a)){if("selectionStart"in a)var f={start:a.selectionStart,end:a.selectionEnd};else e:{f=(f=a.ownerDocument)&&f.defaultView||window;var m=f.getSelection&&f.getSelection();if(m&&m.rangeCount!==0){f=m.anchorNode;var A=m.anchorOffset,E=m.focusNode;m=m.focusOffset;try{f.nodeType,E.nodeType}catch{f=null;break e}var U=0,X=-1,re=-1,Te=0,ke=0,$e=a,De=null;t:for(;;){for(var Ge;$e!==f||A!==0&&$e.nodeType!==3||(X=U+A),$e!==E||m!==0&&$e.nodeType!==3||(re=U+m),$e.nodeType===3&&(U+=$e.nodeValue.length),(Ge=$e.firstChild)!==null;)De=$e,$e=Ge;for(;;){if($e===a)break t;if(De===f&&++Te===A&&(X=U),De===E&&++ke===m&&(re=U),(Ge=$e.nextSibling)!==null)break;$e=De,De=$e.parentNode}$e=Ge}f=X===-1||re===-1?null:{start:X,end:re}}else f=null}f=f||{start:0,end:0}}else f=null;for(fM={focusedElem:a,selectionRange:f},Dy=!1,qi=r;qi!==null;)if(r=qi,a=r.child,(r.subtreeFlags&1028)!==0&&a!==null)a.return=r,qi=a;else for(;qi!==null;){switch(r=qi,E=r.alternate,a=r.flags,r.tag){case 0:if((a&4)!==0&&(a=r.updateQueue,a=a!==null?a.events:null,a!==null))for(f=0;f<a.length;f++)A=a[f],A.ref.impl=A.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&E!==null){a=void 0,f=r,A=E.memoizedProps,E=E.memoizedState,m=f.stateNode;try{var Zt=Va(f.type,A);a=m.getSnapshotBeforeUpdate(Zt,E),m.__reactInternalSnapshotBeforeUpdate=a}catch(pn){Ai(f,f.return,pn)}}break;case 3:if((a&1024)!==0){if(a=r.stateNode.containerInfo,f=a.nodeType,f===9)pM(a);else if(f===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":pM(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(n(163))}if(a=r.sibling,a!==null){a.return=r.return,qi=a;break}qi=r.return}}function vy(a,r,f){var m=f.flags;switch(f.tag){case 0:case 11:case 15:Lo(a,f),m&4&&Qr(5,f);break;case 1:if(Lo(a,f),m&4)if(a=f.stateNode,r===null)try{a.componentDidMount()}catch(U){Ai(f,f.return,U)}else{var A=Va(f.type,r.memoizedProps);r=r.memoizedState;try{a.componentDidUpdate(A,r,a.__reactInternalSnapshotBeforeUpdate)}catch(U){Ai(f,f.return,U)}}m&64&&yl(f),m&512&&$r(f,f.return);break;case 3:if(Lo(a,f),m&64&&(a=f.updateQueue,a!==null)){if(r=null,f.child!==null)switch(f.child.tag){case 27:case 5:r=f.child.stateNode;break;case 1:r=f.child.stateNode}try{Ga(a,r)}catch(U){Ai(f,f.return,U)}}break;case 27:r===null&&m&4&&ta(f);case 26:case 5:Lo(a,f),r===null&&m&4&&Ks(f),m&512&&$r(f,f.return);break;case 12:Lo(a,f);break;case 31:Lo(a,f),m&4&&Vd(a,f);break;case 13:Lo(a,f),m&4&&yg(a,f),m&64&&(a=f.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(f=f4.bind(null,f),D4(a,f))));break;case 22:if(m=f.memoizedState!==null||ur,!m){r=r!==null&&r.memoizedState!==null||Li,A=ur;var E=Li;ur=m,(Li=r)&&!E?ui(a,f,(f.subtreeFlags&8772)!==0):Lo(a,f),ur=A,Li=E}break;case 30:break;default:Lo(a,f)}}function zd(a){var r=a.alternate;r!==null&&(a.alternate=null,zd(r)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(r=a.stateNode,r!==null&&nt(r)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var ii=null,ma=!1;function ns(a,r,f){for(f=f.child;f!==null;)xl(a,r,f),f=f.sibling}function xl(a,r,f){if(qe&&typeof qe.onCommitFiberUnmount=="function")try{qe.onCommitFiberUnmount(ze,f)}catch{}switch(f.tag){case 26:Li||qs(f,r),ns(a,r,f),f.memoizedState?f.memoizedState.count--:f.stateNode&&(f=f.stateNode,f.parentNode.removeChild(f));break;case 27:Li||qs(f,r);var m=ii,A=ma;yu(f.type)&&(ii=f.stateNode,ma=!1),ns(a,r,f),Mg(f.stateNode),ii=m,ma=A;break;case 5:Li||qs(f,r);case 6:if(m=ii,A=ma,ii=null,ns(a,r,f),ii=m,ma=A,ii!==null)if(ma)try{(ii.nodeType===9?ii.body:ii.nodeName==="HTML"?ii.ownerDocument.body:ii).removeChild(f.stateNode)}catch(E){Ai(f,r,E)}else try{ii.removeChild(f.stateNode)}catch(E){Ai(f,r,E)}break;case 18:ii!==null&&(ma?(a=ii,WC(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,f.stateNode),$d(a)):WC(ii,f.stateNode));break;case 4:m=ii,A=ma,ii=f.stateNode.containerInfo,ma=!0,ns(a,r,f),ii=m,ma=A;break;case 0:case 11:case 14:case 15:lr(2,f,r),Li||lr(4,f,r),ns(a,r,f);break;case 1:Li||(qs(f,r),m=f.stateNode,typeof m.componentWillUnmount=="function"&&_g(f,r,m)),ns(a,r,f);break;case 21:ns(a,r,f);break;case 22:Li=(m=Li)||f.memoizedState!==null,ns(a,r,f),Li=m;break;default:ns(a,r,f)}}function Vd(a,r){if(r.memoizedState===null&&(a=r.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{$d(a)}catch(f){Ai(r,r.return,f)}}}function yg(a,r){if(r.memoizedState===null&&(a=r.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{$d(a)}catch(f){Ai(r,r.return,f)}}function _y(a){switch(a.tag){case 31:case 13:case 19:var r=a.stateNode;return r===null&&(r=a.stateNode=new Zf),r;case 22:return a=a.stateNode,r=a._retryCache,r===null&&(r=a._retryCache=new Zf),r;default:throw Error(n(435,a.tag))}}function na(a,r){var f=_y(a);r.forEach(function(m){if(!f.has(m)){f.add(m);var A=h4.bind(null,a,m);m.then(A,A)}})}function is(a,r){var f=r.deletions;if(f!==null)for(var m=0;m<f.length;m++){var A=f[m],E=a,U=r,X=U;e:for(;X!==null;){switch(X.tag){case 27:if(yu(X.type)){ii=X.stateNode,ma=!1;break e}break;case 5:ii=X.stateNode,ma=!1;break e;case 3:case 4:ii=X.stateNode.containerInfo,ma=!0;break e}X=X.return}if(ii===null)throw Error(n(160));xl(E,U,A),ii=null,ma=!1,E=A.alternate,E!==null&&(E.return=null),A.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)Al(r,a),r=r.sibling}var Es=null;function Al(a,r){var f=a.alternate,m=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:is(r,a),Ki(a),m&4&&(lr(3,a,a.return),Qr(3,a),lr(5,a,a.return));break;case 1:is(r,a),Ki(a),m&512&&(Li||f===null||qs(f,f.return)),m&64&&ur&&(a=a.updateQueue,a!==null&&(m=a.callbacks,m!==null&&(f=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=f===null?m:f.concat(m))));break;case 26:var A=Es;if(is(r,a),Ki(a),m&512&&(Li||f===null||qs(f,f.return)),m&4){var E=f!==null?f.memoizedState:null;if(m=a.memoizedState,f===null)if(m===null)if(a.stateNode===null){e:{m=a.type,f=a.memoizedProps,A=A.ownerDocument||A;t:switch(m){case"title":E=A.getElementsByTagName("title")[0],(!E||E[ot]||E[fn]||E.namespaceURI==="http://www.w3.org/2000/svg"||E.hasAttribute("itemprop"))&&(E=A.createElement(m),A.head.insertBefore(E,A.querySelector("head > title"))),ds(E,m,f),E[fn]=a,k(E),m=E;break e;case"link":var U=rR("link","href",A).get(m+(f.href||""));if(U){for(var X=0;X<U.length;X++)if(E=U[X],E.getAttribute("href")===(f.href==null||f.href===""?null:f.href)&&E.getAttribute("rel")===(f.rel==null?null:f.rel)&&E.getAttribute("title")===(f.title==null?null:f.title)&&E.getAttribute("crossorigin")===(f.crossOrigin==null?null:f.crossOrigin)){U.splice(X,1);break t}}E=A.createElement(m),ds(E,m,f),A.head.appendChild(E);break;case"meta":if(U=rR("meta","content",A).get(m+(f.content||""))){for(X=0;X<U.length;X++)if(E=U[X],E.getAttribute("content")===(f.content==null?null:""+f.content)&&E.getAttribute("name")===(f.name==null?null:f.name)&&E.getAttribute("property")===(f.property==null?null:f.property)&&E.getAttribute("http-equiv")===(f.httpEquiv==null?null:f.httpEquiv)&&E.getAttribute("charset")===(f.charSet==null?null:f.charSet)){U.splice(X,1);break t}}E=A.createElement(m),ds(E,m,f),A.head.appendChild(E);break;default:throw Error(n(468,m))}E[fn]=a,k(E),m=E}a.stateNode=m}else oR(A,a.type,a.stateNode);else a.stateNode=sR(A,m,a.memoizedProps);else E!==m?(E===null?f.stateNode!==null&&(f=f.stateNode,f.parentNode.removeChild(f)):E.count--,m===null?oR(A,a.type,a.stateNode):sR(A,m,a.memoizedProps)):m===null&&a.stateNode!==null&&cr(a,a.memoizedProps,f.memoizedProps)}break;case 27:is(r,a),Ki(a),m&512&&(Li||f===null||qs(f,f.return)),f!==null&&m&4&&cr(a,a.memoizedProps,f.memoizedProps);break;case 5:if(is(r,a),Ki(a),m&512&&(Li||f===null||qs(f,f.return)),a.flags&32){A=a.stateNode;try{at(A,"")}catch(Zt){Ai(a,a.return,Zt)}}m&4&&a.stateNode!=null&&(A=a.memoizedProps,cr(a,A,f!==null?f.memoizedProps:A)),m&1024&&(Do=!0);break;case 6:if(is(r,a),Ki(a),m&4){if(a.stateNode===null)throw Error(n(162));m=a.memoizedProps,f=a.stateNode;try{f.nodeValue=m}catch(Zt){Ai(a,a.return,Zt)}}break;case 3:if(Cy=null,A=Es,Es=Ey(r.containerInfo),is(r,a),Es=A,Ki(a),m&4&&f!==null&&f.memoizedState.isDehydrated)try{$d(r.containerInfo)}catch(Zt){Ai(a,a.return,Zt)}Do&&(Do=!1,yy(a));break;case 4:m=Es,Es=Ey(a.stateNode.containerInfo),is(r,a),Ki(a),Es=m;break;case 12:is(r,a),Ki(a);break;case 31:is(r,a),Ki(a),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,na(a,m)));break;case 13:is(r,a),Ki(a),a.child.flags&8192&&a.memoizedState!==null!=(f!==null&&f.memoizedState!==null)&&(Oo=I()),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,na(a,m)));break;case 22:A=a.memoizedState!==null;var re=f!==null&&f.memoizedState!==null,Te=ur,ke=Li;if(ur=Te||A,Li=ke||re,is(r,a),Li=ke,ur=Te,Ki(a),m&8192)e:for(r=a.stateNode,r._visibility=A?r._visibility&-2:r._visibility|1,A&&(f===null||re||ur||Li||oc(a)),f=null,r=a;;){if(r.tag===5||r.tag===26){if(f===null){re=f=r;try{if(E=re.stateNode,A)U=E.style,typeof U.setProperty=="function"?U.setProperty("display","none","important"):U.display="none";else{X=re.stateNode;var $e=re.memoizedProps.style,De=$e!=null&&$e.hasOwnProperty("display")?$e.display:null;X.style.display=De==null||typeof De=="boolean"?"":(""+De).trim()}}catch(Zt){Ai(re,re.return,Zt)}}}else if(r.tag===6){if(f===null){re=r;try{re.stateNode.nodeValue=A?"":re.memoizedProps}catch(Zt){Ai(re,re.return,Zt)}}}else if(r.tag===18){if(f===null){re=r;try{var Ge=re.stateNode;A?jC(Ge,!0):jC(re.stateNode,!1)}catch(Zt){Ai(re,re.return,Zt)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===a)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===a)break e;for(;r.sibling===null;){if(r.return===null||r.return===a)break e;f===r&&(f=null),r=r.return}f===r&&(f=null),r.sibling.return=r.return,r=r.sibling}m&4&&(m=a.updateQueue,m!==null&&(f=m.retryQueue,f!==null&&(m.retryQueue=null,na(a,f))));break;case 19:is(r,a),Ki(a),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,na(a,m)));break;case 30:break;case 21:break;default:is(r,a),Ki(a)}}function Ki(a){var r=a.flags;if(r&2){try{for(var f,m=a.return;m!==null;){if(pa(m)){f=m;break}m=m.return}if(f==null)throw Error(n(160));switch(f.tag){case 27:var A=f.stateNode,E=eo(a);oi(a,E,A);break;case 5:var U=f.stateNode;f.flags&32&&(at(U,""),f.flags&=-33);var X=eo(a);oi(a,X,U);break;case 3:case 4:var re=f.stateNode.containerInfo,Te=eo(a);Rn(a,Te,re);break;default:throw Error(n(161))}}catch(ke){Ai(a,a.return,ke)}a.flags&=-3}r&4096&&(a.flags&=-4097)}function yy(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var r=a;yy(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),a=a.sibling}}function Lo(a,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)vy(a,r.alternate,r),r=r.sibling}function oc(a){for(a=a.child;a!==null;){var r=a;switch(r.tag){case 0:case 11:case 14:case 15:lr(4,r,r.return),oc(r);break;case 1:qs(r,r.return);var f=r.stateNode;typeof f.componentWillUnmount=="function"&&_g(r,r.return,f),oc(r);break;case 27:Mg(r.stateNode);case 26:case 5:qs(r,r.return),oc(r);break;case 22:r.memoizedState===null&&oc(r);break;case 30:oc(r);break;default:oc(r)}a=a.sibling}}function ui(a,r,f){for(f=f&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var m=r.alternate,A=a,E=r,U=E.flags;switch(E.tag){case 0:case 11:case 15:ui(A,E,f),Qr(4,E);break;case 1:if(ui(A,E,f),m=E,A=m.stateNode,typeof A.componentDidMount=="function")try{A.componentDidMount()}catch(Te){Ai(m,m.return,Te)}if(m=E,A=m.updateQueue,A!==null){var X=m.stateNode;try{var re=A.shared.hiddenCallbacks;if(re!==null)for(A.shared.hiddenCallbacks=null,A=0;A<re.length;A++)Kr(re[A],X)}catch(Te){Ai(m,m.return,Te)}}f&&U&64&&yl(E),$r(E,E.return);break;case 27:ta(E);case 26:case 5:ui(A,E,f),f&&m===null&&U&4&&Ks(E),$r(E,E.return);break;case 12:ui(A,E,f);break;case 31:ui(A,E,f),f&&U&4&&Vd(A,E);break;case 13:ui(A,E,f),f&&U&4&&yg(A,E);break;case 22:E.memoizedState===null&&ui(A,E,f),$r(E,E.return);break;case 30:break;default:ui(A,E,f)}r=r.sibling}}function kd(a,r){var f=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(f=a.memoizedState.cachePool.pool),a=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(a=r.memoizedState.cachePool.pool),a!==f&&(a!=null&&a.refCount++,f!=null&&Pa(f))}function No(a,r){a=null,r.alternate!==null&&(a=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==a&&(r.refCount++,a!=null&&Pa(a))}function Aa(a,r,f,m){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Hi(a,r,f,m),r=r.sibling}function Hi(a,r,f,m){var A=r.flags;switch(r.tag){case 0:case 11:case 15:Aa(a,r,f,m),A&2048&&Qr(9,r);break;case 1:Aa(a,r,f,m);break;case 3:Aa(a,r,f,m),A&2048&&(a=null,r.alternate!==null&&(a=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==a&&(r.refCount++,a!=null&&Pa(a)));break;case 12:if(A&2048){Aa(a,r,f,m),a=r.stateNode;try{var E=r.memoizedProps,U=E.id,X=E.onPostCommit;typeof X=="function"&&X(U,r.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(re){Ai(r,r.return,re)}}else Aa(a,r,f,m);break;case 31:Aa(a,r,f,m);break;case 13:Aa(a,r,f,m);break;case 23:break;case 22:E=r.stateNode,U=r.alternate,r.memoizedState!==null?E._visibility&2?Aa(a,r,f,m):mu(a,r):E._visibility&2?Aa(a,r,f,m):(E._visibility|=2,Sl(a,r,f,m,(r.subtreeFlags&10256)!==0||!1)),A&2048&&kd(U,r);break;case 24:Aa(a,r,f,m),A&2048&&No(r.alternate,r);break;default:Aa(a,r,f,m)}}function Sl(a,r,f,m,A){for(A=A&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var E=a,U=r,X=f,re=m,Te=U.flags;switch(U.tag){case 0:case 11:case 15:Sl(E,U,X,re,A),Qr(8,U);break;case 23:break;case 22:var ke=U.stateNode;U.memoizedState!==null?ke._visibility&2?Sl(E,U,X,re,A):mu(E,U):(ke._visibility|=2,Sl(E,U,X,re,A)),A&&Te&2048&&kd(U.alternate,U);break;case 24:Sl(E,U,X,re,A),A&&Te&2048&&No(U.alternate,U);break;default:Sl(E,U,X,re,A)}r=r.sibling}}function mu(a,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var f=a,m=r,A=m.flags;switch(m.tag){case 22:mu(f,m),A&2048&&kd(m.alternate,m);break;case 24:mu(f,m),A&2048&&No(m.alternate,m);break;default:mu(f,m)}r=r.sibling}}var Wi=8192;function lc(a,r,f){if(a.subtreeFlags&Wi)for(a=a.child;a!==null;)ia(a,r,f),a=a.sibling}function ia(a,r,f){switch(a.tag){case 26:lc(a,r,f),a.flags&Wi&&a.memoizedState!==null&&k4(f,Es,a.memoizedState,a.memoizedProps);break;case 5:lc(a,r,f);break;case 3:case 4:var m=Es;Es=Ey(a.stateNode.containerInfo),lc(a,r,f),Es=m;break;case 22:a.memoizedState===null&&(m=a.alternate,m!==null&&m.memoizedState!==null?(m=Wi,Wi=16777216,lc(a,r,f),Wi=m):lc(a,r,f));break;default:lc(a,r,f)}}function Ts(a){var r=a.alternate;if(r!==null&&(a=r.child,a!==null)){r.child=null;do r=a.sibling,a.sibling=null,a=r;while(a!==null)}}function fs(a){var r=a.deletions;if((a.flags&16)!==0){if(r!==null)for(var f=0;f<r.length;f++){var m=r[f];qi=m,Qf(m,a)}Ts(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)cc(a),a=a.sibling}function cc(a){switch(a.tag){case 0:case 11:case 15:fs(a),a.flags&2048&&lr(9,a,a.return);break;case 3:fs(a);break;case 12:fs(a);break;case 22:var r=a.stateNode;a.memoizedState!==null&&r._visibility&2&&(a.return===null||a.return.tag!==13)?(r._visibility&=-3,Xd(a)):fs(a);break;default:fs(a)}}function Xd(a){var r=a.deletions;if((a.flags&16)!==0){if(r!==null)for(var f=0;f<r.length;f++){var m=r[f];qi=m,Qf(m,a)}Ts(a)}for(a=a.child;a!==null;){switch(r=a,r.tag){case 0:case 11:case 15:lr(8,r,r.return),Xd(r);break;case 22:f=r.stateNode,f._visibility&2&&(f._visibility&=-3,Xd(r));break;default:Xd(r)}a=a.sibling}}function Qf(a,r){for(;qi!==null;){var f=qi;switch(f.tag){case 0:case 11:case 15:lr(8,f,r);break;case 23:case 22:if(f.memoizedState!==null&&f.memoizedState.cachePool!==null){var m=f.memoizedState.cachePool.pool;m!=null&&m.refCount++}break;case 24:Pa(f.memoizedState.cache)}if(m=f.child,m!==null)m.return=f,qi=m;else e:for(f=a;qi!==null;){m=qi;var A=m.sibling,E=m.return;if(zd(m),m===f){qi=null;break e}if(A!==null){A.return=E,qi=A;break e}qi=E}}}var Yd={getCacheForType:function(a){var r=wa(sn),f=r.data.get(a);return f===void 0&&(f=a(),r.data.set(a,f)),f},cacheSignal:function(){return wa(sn).controller.signal}},Jd=typeof WeakMap=="function"?WeakMap:Map,jn=0,fi=null,wn=null,Vn=0,rn=0,Fn=null,An=!1,Un=!1,xi=!1,aa=0,hi=0,Ws=0,Uo=0,wr=0,Zn=0,js=0,Br=null,as=null,Cs=!1,Oo=0,gu=0,Zs=1/0,vu=null,to=null,Pi=0,Dr=null,Qs=null,fr=0,Io=0,uc=null,qd=null,fc=0,hc=null;function hs(){return(jn&2)!==0&&Vn!==0?Vn&-Vn:H.T!==null?iM():vi()}function c(){if(Zn===0)if((Vn&536870912)===0||Jn){var a=We;We<<=1,(We&3932160)===0&&(We=262144),Zn=a}else Zn=536870912;return a=xa.current,a!==null&&(a.flags|=32),Zn}function u(a,r,f){(a===fi&&(rn===2||rn===9)||a.cancelPendingCommit!==null)&&(Se(a,0),B(a,Vn,Zn,!1)),Dn(a,f),((jn&2)===0||a!==fi)&&(a===fi&&((jn&2)===0&&(Uo|=f),hi===4&&B(a,Vn,Zn,!1)),Ml(a))}function g(a,r,f){if((jn&6)!==0)throw Error(n(327));var m=!f&&(r&127)===0&&(r&a.expiredLanes)===0||ft(a,r),A=m?dc(a,r):Rs(a,r,!0),E=m;do{if(A===0){Un&&!m&&B(a,r,0,!1);break}else{if(f=a.current.alternate,E&&!C(f)){A=Rs(a,r,!1),E=!1;continue}if(A===2){if(E=r,a.errorRecoveryDisabledLanes&E)var U=0;else U=a.pendingLanes&-536870913,U=U!==0?U:U&536870912?536870912:0;if(U!==0){r=U;e:{var X=a;A=Br;var re=X.current.memoizedState.isDehydrated;if(re&&(Se(X,U).flags|=256),U=Rs(X,U,!1),U!==2){if(xi&&!re){X.errorRecoveryDisabledLanes|=E,Uo|=E,A=4;break e}E=as,as=A,E!==null&&(as===null?as=E:as.push.apply(as,E))}A=U}if(E=!1,A!==2)continue}}if(A===1){Se(a,0),B(a,r,0,!0);break}e:{switch(m=a,E=A,E){case 0:case 1:throw Error(n(345));case 4:if((r&4194048)!==r)break;case 6:B(m,r,Zn,!An);break e;case 2:as=null;break;case 3:case 5:break;default:throw Error(n(329))}if((r&62914560)===r&&(A=Oo+300-I(),10<A)){if(B(m,r,Zn,!An),Ve(m,0,!0)!==0)break e;fr=r,m.timeoutHandle=qC(S.bind(null,m,f,as,vu,Cs,r,Zn,Uo,js,An,E,"Throttled",-0,0),A);break e}S(m,f,as,vu,Cs,r,Zn,Uo,js,An,E,null,-0,0)}}break}while(!0);Ml(a)}function S(a,r,f,m,A,E,U,X,re,Te,ke,$e,De,Ge){if(a.timeoutHandle=-1,$e=r.subtreeFlags,$e&8192||($e&16785408)===16785408){$e={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Cn},ia(r,E,$e);var Zt=(E&62914560)===E?Oo-I():(E&4194048)===E?gu-I():0;if(Zt=X4($e,Zt),Zt!==null){fr=E,a.cancelPendingCommit=Zt(vn.bind(null,a,r,E,f,m,A,U,X,re,ke,$e,null,De,Ge)),B(a,E,U,!Te);return}}vn(a,r,E,f,m,A,U,X,re)}function C(a){for(var r=a;;){var f=r.tag;if((f===0||f===11||f===15)&&r.flags&16384&&(f=r.updateQueue,f!==null&&(f=f.stores,f!==null)))for(var m=0;m<f.length;m++){var A=f[m],E=A.getSnapshot;A=A.value;try{if(!Bi(E(),A))return!1}catch{return!1}}if(f=r.child,r.subtreeFlags&16384&&f!==null)f.return=r,r=f;else{if(r===a)break;for(;r.sibling===null;){if(r.return===null||r.return===a)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function B(a,r,f,m){r&=~wr,r&=~Uo,a.suspendedLanes|=r,a.pingedLanes&=~r,m&&(a.warmLanes|=r),m=a.expirationTimes;for(var A=r;0<A;){var E=31-pt(A),U=1<<E;m[E]=-1,A&=~U}f!==0&&Ni(a,f,r)}function q(){return(jn&6)===0?(xg(0),!1):!0}function se(){if(wn!==null){if(rn===0)var a=wn.return;else a=wn,$a=So=null,jm(a),fl=null,hl=0,a=wn;for(;a!==null;)rc(a.alternate,a),a=a.return;wn=null}}function Se(a,r){var f=a.timeoutHandle;f!==-1&&(a.timeoutHandle=-1,T4(f)),f=a.cancelPendingCommit,f!==null&&(a.cancelPendingCommit=null,f()),fr=0,se(),fi=a,wn=f=Vr(a.current,null),Vn=r,rn=0,Fn=null,An=!1,Un=ft(a,r),xi=!1,js=Zn=wr=Uo=Ws=hi=0,as=Br=null,Cs=!1,(r&8)!==0&&(r|=r&32);var m=a.entangledLanes;if(m!==0)for(a=a.entanglements,m&=r;0<m;){var A=31-pt(m),E=1<<A;r|=a[A],m&=~E}return aa=r,al(),f}function Je(a,r){gn=null,H.H=Gf,r===ul||r===Er?(r=Ad(),rn=3):r===Bf?(r=Ad(),rn=4):rn=r===Hd?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,Fn=r,wn===null&&(hi=1,Fd(a,ys(r,a.current)))}function Mt(){var a=xa.current;return a===null?!0:(Vn&4194048)===Vn?sr===null:(Vn&62914560)===Vn||(Vn&536870912)!==0?a===sr:!1}function Gt(){var a=H.H;return H.H=Gf,a===null?Gf:a}function kt(){var a=H.A;return H.A=Yd,a}function xn(){hi=4,An||(Vn&4194048)!==Vn&&xa.current!==null||(Un=!0),(Ws&134217727)===0&&(Uo&134217727)===0||fi===null||B(fi,Vn,Zn,!1)}function Rs(a,r,f){var m=jn;jn|=2;var A=Gt(),E=kt();(fi!==a||Vn!==r)&&(vu=null,Se(a,r)),r=!1;var U=hi;e:do try{if(rn!==0&&wn!==null){var X=wn,re=Fn;switch(rn){case 8:se(),U=6;break e;case 3:case 2:case 9:case 6:xa.current===null&&(r=!0);var Te=rn;if(rn=0,Fn=null,dt(a,X,re,Te),f&&Un){U=0;break e}break;default:Te=rn,rn=0,Fn=null,dt(a,X,re,Te)}}$f(),U=hi;break}catch(ke){Je(a,ke)}while(!0);return r&&a.shellSuspendCounter++,$a=So=null,jn=m,H.H=A,H.A=E,wn===null&&(fi=null,Vn=0,al()),U}function $f(){for(;wn!==null;)xe(wn)}function dc(a,r){var f=jn;jn|=2;var m=Gt(),A=kt();fi!==a||Vn!==r?(vu=null,Zs=I()+500,Se(a,r)):Un=ft(a,r);e:do try{if(rn!==0&&wn!==null){r=wn;var E=Fn;t:switch(rn){case 1:rn=0,Fn=null,dt(a,r,E,1);break;case 2:case 9:if(X_(E)){rn=0,Fn=null,Fe(r);break}r=function(){rn!==2&&rn!==9||fi!==a||(rn=7),Ml(a)},E.then(r,r);break e;case 3:rn=7;break e;case 4:rn=5;break e;case 7:X_(E)?(rn=0,Fn=null,Fe(r)):(rn=0,Fn=null,dt(a,r,E,7));break;case 5:var U=null;switch(wn.tag){case 26:U=wn.memoizedState;case 5:case 27:var X=wn;if(U?lR(U):X.stateNode.complete){rn=0,Fn=null;var re=X.sibling;if(re!==null)wn=re;else{var Te=X.return;Te!==null?(wn=Te,nn(Te)):wn=null}break t}}rn=0,Fn=null,dt(a,r,E,5);break;case 6:rn=0,Fn=null,dt(a,r,E,6);break;case 8:se(),hi=6;break e;default:throw Error(n(462))}}Be();break}catch(ke){Je(a,ke)}while(!0);return $a=So=null,H.H=m,H.A=A,jn=f,wn!==null?0:(fi=null,Vn=0,al(),hi)}function Be(){for(;wn!==null&&!yt();)xe(wn)}function xe(a){var r=Pd(a.alternate,a,aa);a.memoizedProps=a.pendingProps,r===null?nn(a):wn=r}function Fe(a){var r=a,f=r.alternate;switch(r.tag){case 15:case 0:r=ts(f,r,r.pendingProps,r.type,void 0,Vn);break;case 11:r=ts(f,r,r.pendingProps,r.type.render,r.ref,Vn);break;case 5:jm(r);default:rc(f,r),r=wn=Qa(r,aa),r=Pd(f,r,aa)}a.memoizedProps=a.pendingProps,r===null?nn(a):wn=r}function dt(a,r,f,m){$a=So=null,jm(r),fl=null,hl=0;var A=r.return;try{if(Vs(a,A,r,f,Vn)){hi=1,Fd(a,ys(f,a.current)),wn=null;return}}catch(E){if(A!==null)throw wn=A,E;hi=1,Fd(a,ys(f,a.current)),wn=null;return}r.flags&32768?(Jn||m===1?a=!0:Un||(Vn&536870912)!==0?a=!1:(An=a=!0,(m===2||m===9||m===3||m===6)&&(m=xa.current,m!==null&&m.tag===13&&(m.flags|=16384))),Mi(r,a)):nn(r)}function nn(a){var r=a;do{if((r.flags&32768)!==0){Mi(r,An);return}a=r.return;var f=vg(r.alternate,r,aa);if(f!==null){wn=f;return}if(r=r.sibling,r!==null){wn=r;return}wn=r=a}while(r!==null);hi===0&&(hi=5)}function Mi(a,r){do{var f=Gd(a.alternate,a);if(f!==null){f.flags&=32767,wn=f;return}if(f=a.return,f!==null&&(f.flags|=32768,f.subtreeFlags=0,f.deletions=null),!r&&(a=a.sibling,a!==null)){wn=a;return}wn=a=f}while(a!==null);hi=6,wn=null}function vn(a,r,f,m,A,E,U,X,re){a.cancelPendingCommit=null;do Kd();while(Pi!==0);if((jn&6)!==0)throw Error(n(327));if(r!==null){if(r===a.current)throw Error(n(177));if(E=r.lanes|r.childLanes,E|=dd,Nn(a,f,E,U,X,re),a===fi&&(wn=fi=null,Vn=0),Qs=r,Dr=a,fr=f,Io=E,uc=A,qd=m,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,d4(Oe,function(){return BC(),null})):(a.callbackNode=null,a.callbackPriority=0),m=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||m){m=H.T,H.T=null,A=Y.p,Y.p=2,U=jn,jn|=4;try{pu(a,r,f)}finally{jn=U,Y.p=A,H.T=m}}Pi=1,ai(),Sa(),si()}}function ai(){if(Pi===1){Pi=0;var a=Dr,r=Qs,f=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||f){f=H.T,H.T=null;var m=Y.p;Y.p=2;var A=jn;jn|=4;try{Al(r,a);var E=fM,U=ld(a.containerInfo),X=E.focusedElem,re=E.selectionRange;if(U!==X&&X&&X.ownerDocument&&od(X.ownerDocument.documentElement,X)){if(re!==null&&qc(X)){var Te=re.start,ke=re.end;if(ke===void 0&&(ke=Te),"selectionStart"in X)X.selectionStart=Te,X.selectionEnd=Math.min(ke,X.value.length);else{var $e=X.ownerDocument||document,De=$e&&$e.defaultView||window;if(De.getSelection){var Ge=De.getSelection(),Zt=X.textContent.length,pn=Math.min(re.start,Zt),Ei=re.end===void 0?pn:Math.min(re.end,Zt);!Ge.extend&&pn>Ei&&(U=Ei,Ei=pn,pn=U);var Ae=Em(X,pn),pe=Em(X,Ei);if(Ae&&pe&&(Ge.rangeCount!==1||Ge.anchorNode!==Ae.node||Ge.anchorOffset!==Ae.offset||Ge.focusNode!==pe.node||Ge.focusOffset!==pe.offset)){var Ee=$e.createRange();Ee.setStart(Ae.node,Ae.offset),Ge.removeAllRanges(),pn>Ei?(Ge.addRange(Ee),Ge.extend(pe.node,pe.offset)):(Ee.setEnd(pe.node,pe.offset),Ge.addRange(Ee))}}}}for($e=[],Ge=X;Ge=Ge.parentNode;)Ge.nodeType===1&&$e.push({element:Ge,left:Ge.scrollLeft,top:Ge.scrollTop});for(typeof X.focus=="function"&&X.focus(),X=0;X<$e.length;X++){var Ke=$e[X];Ke.element.scrollLeft=Ke.left,Ke.element.scrollTop=Ke.top}}Dy=!!uM,fM=uM=null}finally{jn=A,Y.p=m,H.T=f}}a.current=r,Pi=2}}function Sa(){if(Pi===2){Pi=0;var a=Dr,r=Qs,f=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||f){f=H.T,H.T=null;var m=Y.p;Y.p=2;var A=jn;jn|=4;try{vy(a,r.alternate,r)}finally{jn=A,Y.p=m,H.T=f}}Pi=3}}function si(){if(Pi===4||Pi===3){Pi=0,j();var a=Dr,r=Qs,f=fr,m=qd;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?Pi=5:(Pi=0,Qs=Dr=null,Fo(a,a.pendingLanes));var A=a.pendingLanes;if(A===0&&(to=null),Ia(f),r=r.stateNode,qe&&typeof qe.onCommitFiberRoot=="function")try{qe.onCommitFiberRoot(ze,r,void 0,(r.current.flags&128)===128)}catch{}if(m!==null){r=H.T,A=Y.p,Y.p=2,H.T=null;try{for(var E=a.onRecoverableError,U=0;U<m.length;U++){var X=m[U];E(X.value,{componentStack:X.stack})}}finally{H.T=r,Y.p=A}}(fr&3)!==0&&Kd(),Ml(a),A=a.pendingLanes,(f&261930)!==0&&(A&42)!==0?a===hc?fc++:(fc=0,hc=a):fc=0,xg(0)}}function Fo(a,r){(a.pooledCacheLanes&=r)===0&&(r=a.pooledCache,r!=null&&(a.pooledCache=null,Pa(r)))}function Kd(){return ai(),Sa(),si(),BC()}function BC(){if(Pi!==5)return!1;var a=Dr,r=Io;Io=0;var f=Ia(fr),m=H.T,A=Y.p;try{Y.p=32>f?32:f,H.T=null,f=uc,uc=null;var E=Dr,U=fr;if(Pi=0,Qs=Dr=null,fr=0,(jn&6)!==0)throw Error(n(331));var X=jn;if(jn|=4,cc(E.current),Hi(E,E.current,U,f),jn=X,xg(0,!1),qe&&typeof qe.onPostCommitFiberRoot=="function")try{qe.onPostCommitFiberRoot(ze,E)}catch{}return!0}finally{Y.p=A,H.T=m,Fo(a,r)}}function DC(a,r,f){r=ys(f,r),r=gg(a.stateNode,r,2),a=To(a,r,2),a!==null&&(Dn(a,2),Ml(a))}function Ai(a,r,f){if(a.tag===3)DC(a,a,f);else for(;r!==null;){if(r.tag===3){DC(r,a,f);break}else if(r.tag===1){var m=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(to===null||!to.has(m))){a=ys(f,a),f=cu(2),m=To(r,f,2),m!==null&&(Ms(f,m,r,a),Dn(m,2),Ml(m));break}}r=r.return}}function eM(a,r,f){var m=a.pingCache;if(m===null){m=a.pingCache=new Jd;var A=new Set;m.set(r,A)}else A=m.get(r),A===void 0&&(A=new Set,m.set(r,A));A.has(f)||(xi=!0,A.add(f),a=u4.bind(null,a,r,f),r.then(a,a))}function u4(a,r,f){var m=a.pingCache;m!==null&&m.delete(r),a.pingedLanes|=a.suspendedLanes&f,a.warmLanes&=~f,fi===a&&(Vn&f)===f&&(hi===4||hi===3&&(Vn&62914560)===Vn&&300>I()-Oo?(jn&2)===0&&Se(a,0):wr|=f,js===Vn&&(js=0)),Ml(a)}function LC(a,r){r===0&&(r=Sn()),a=sl(a,r),a!==null&&(Dn(a,r),Ml(a))}function f4(a){var r=a.memoizedState,f=0;r!==null&&(f=r.retryLane),LC(a,f)}function h4(a,r){var f=0;switch(a.tag){case 31:case 13:var m=a.stateNode,A=a.memoizedState;A!==null&&(f=A.retryLane);break;case 19:m=a.stateNode;break;case 22:m=a.stateNode._retryCache;break;default:throw Error(n(314))}m!==null&&m.delete(r),LC(a,f)}function d4(a,r){return _t(a,r)}var xy=null,Wd=null,tM=!1,Ay=!1,nM=!1,_u=0;function Ml(a){a!==Wd&&a.next===null&&(Wd===null?xy=Wd=a:Wd=Wd.next=a),Ay=!0,tM||(tM=!0,m4())}function xg(a,r){if(!nM&&Ay){nM=!0;do for(var f=!1,m=xy;m!==null;){if(a!==0){var A=m.pendingLanes;if(A===0)var E=0;else{var U=m.suspendedLanes,X=m.pingedLanes;E=(1<<31-pt(42|a)+1)-1,E&=A&~(U&~X),E=E&201326741?E&201326741|1:E?E|2:0}E!==0&&(f=!0,IC(m,E))}else E=Vn,E=Ve(m,m===fi?E:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(E&3)===0||ft(m,E)||(f=!0,IC(m,E));m=m.next}while(f);nM=!1}}function p4(){NC()}function NC(){Ay=tM=!1;var a=0;_u!==0&&E4()&&(a=_u);for(var r=I(),f=null,m=xy;m!==null;){var A=m.next,E=UC(m,r);E===0?(m.next=null,f===null?xy=A:f.next=A,A===null&&(Wd=f)):(f=m,(a!==0||(E&3)!==0)&&(Ay=!0)),m=A}Pi!==0&&Pi!==5||xg(a),_u!==0&&(_u=0)}function UC(a,r){for(var f=a.suspendedLanes,m=a.pingedLanes,A=a.expirationTimes,E=a.pendingLanes&-62914561;0<E;){var U=31-pt(E),X=1<<U,re=A[U];re===-1?((X&f)===0||(X&m)!==0)&&(A[U]=jt(X,r)):re<=r&&(a.expiredLanes|=X),E&=~X}if(r=fi,f=Vn,f=Ve(a,a===r?f:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),m=a.callbackNode,f===0||a===r&&(rn===2||rn===9)||a.cancelPendingCommit!==null)return m!==null&&m!==null&&Ft(m),a.callbackNode=null,a.callbackPriority=0;if((f&3)===0||ft(a,f)){if(r=f&-f,r===a.callbackPriority)return r;switch(m!==null&&Ft(m),Ia(f)){case 2:case 8:f=Xe;break;case 32:f=Oe;break;case 268435456:f=gt;break;default:f=Oe}return m=OC.bind(null,a),f=_t(f,m),a.callbackPriority=r,a.callbackNode=f,r}return m!==null&&m!==null&&Ft(m),a.callbackPriority=2,a.callbackNode=null,2}function OC(a,r){if(Pi!==0&&Pi!==5)return a.callbackNode=null,a.callbackPriority=0,null;var f=a.callbackNode;if(Kd()&&a.callbackNode!==f)return null;var m=Vn;return m=Ve(a,a===fi?m:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),m===0?null:(g(a,m,r),UC(a,I()),a.callbackNode!=null&&a.callbackNode===f?OC.bind(null,a):null)}function IC(a,r){if(Kd())return null;g(a,r,!0)}function m4(){C4(function(){(jn&6)!==0?_t(Ie,p4):NC()})}function iM(){if(_u===0){var a=Eo;a===0&&(a=be,be<<=1,(be&261888)===0&&(be=256)),_u=a}return _u}function FC(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:En(""+a)}function HC(a,r){var f=r.ownerDocument.createElement("input");return f.name=r.name,f.value=r.value,a.id&&f.setAttribute("form",a.id),r.parentNode.insertBefore(f,r),a=new FormData(a),f.parentNode.removeChild(f),a}function g4(a,r,f,m,A){if(r==="submit"&&f&&f.stateNode===A){var E=FC((A[G]||null).action),U=m.submitter;U&&(r=(r=U[G]||null)?FC(r.formAction):U.getAttribute("formAction"),r!==null&&(E=r,U=null));var X=new mf("action","action",null,m,A);a.push({event:X,listeners:[{instance:null,listener:function(){if(m.defaultPrevented){if(_u!==0){var re=U?HC(A,U):new FormData(A);fg(f,{pending:!0,data:re,method:A.method,action:E},null,re)}}else typeof E=="function"&&(X.preventDefault(),re=U?HC(A,U):new FormData(A),fg(f,{pending:!0,data:re,method:A.method,action:E},E,re))},currentTarget:A}]})}}for(var aM=0;aM<hd.length;aM++){var sM=hd[aM],v4=sM.toLowerCase(),_4=sM[0].toUpperCase()+sM.slice(1);Za(v4,"on"+_4)}Za(_s,"onAnimationEnd"),Za(Tm,"onAnimationIteration"),Za(zr,"onAnimationStart"),Za("dblclick","onDoubleClick"),Za("focusin","onFocus"),Za("focusout","onBlur"),Za(Zc,"onTransitionRun"),Za(nl,"onTransitionStart"),Za(Cm,"onTransitionCancel"),Za(fd,"onTransitionEnd"),le("onMouseEnter",["mouseout","mouseover"]),le("onMouseLeave",["mouseout","mouseover"]),le("onPointerEnter",["pointerout","pointerover"]),le("onPointerLeave",["pointerout","pointerover"]),ce("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ce("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ce("onBeforeInput",["compositionend","keypress","textInput","paste"]),ce("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ce("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ce("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ag="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),y4=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ag));function PC(a,r){r=(r&4)!==0;for(var f=0;f<a.length;f++){var m=a[f],A=m.event;m=m.listeners;e:{var E=void 0;if(r)for(var U=m.length-1;0<=U;U--){var X=m[U],re=X.instance,Te=X.currentTarget;if(X=X.listener,re!==E&&A.isPropagationStopped())break e;E=X,A.currentTarget=Te;try{E(A)}catch(ke){il(ke)}A.currentTarget=null,E=re}else for(U=0;U<m.length;U++){if(X=m[U],re=X.instance,Te=X.currentTarget,X=X.listener,re!==E&&A.isPropagationStopped())break e;E=X,A.currentTarget=Te;try{E(A)}catch(ke){il(ke)}A.currentTarget=null,E=re}}}}function qn(a,r){var f=r[oe];f===void 0&&(f=r[oe]=new Set);var m=a+"__bubble";f.has(m)||(GC(r,a,2,!1),f.add(m))}function rM(a,r,f){var m=0;r&&(m|=4),GC(f,a,m,r)}var Sy="_reactListening"+Math.random().toString(36).slice(2);function oM(a){if(!a[Sy]){a[Sy]=!0,te.forEach(function(f){f!=="selectionchange"&&(y4.has(f)||rM(f,!1,a),rM(f,!0,a))});var r=a.nodeType===9?a:a.ownerDocument;r===null||r[Sy]||(r[Sy]=!0,rM("selectionchange",!1,r))}}function GC(a,r,f,m){switch(mR(r)){case 2:var A=q4;break;case 8:A=K4;break;default:A=SM}f=A.bind(null,r,f,a),A=void 0,!ir||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(A=!0),m?A!==void 0?a.addEventListener(r,f,{capture:!0,passive:A}):a.addEventListener(r,f,!0):A!==void 0?a.addEventListener(r,f,{passive:A}):a.addEventListener(r,f,!1)}function lM(a,r,f,m,A){var E=m;if((r&1)===0&&(r&2)===0&&m!==null)e:for(;;){if(m===null)return;var U=m.tag;if(U===3||U===4){var X=m.stateNode.containerInfo;if(X===A)break;if(U===4)for(U=m.return;U!==null;){var re=U.tag;if((re===3||re===4)&&U.stateNode.containerInfo===A)return;U=U.return}for(;X!==null;){if(U=Ze(X),U===null)return;if(re=U.tag,re===5||re===6||re===26||re===27){m=E=U;continue e}X=X.parentNode}}m=m.return}Ri(function(){var Te=E,ke=Ci(f),$e=[];e:{var De=_o.get(a);if(De!==void 0){var Ge=mf,Zt=a;switch(a){case"keypress":if(kl(f)===0)break e;case"keydown":case"keyup":Ge=mm;break;case"focusin":Zt="focus",Ge=nd;break;case"focusout":Zt="blur",Ge=nd;break;case"beforeblur":case"afterblur":Ge=nd;break;case"click":if(f.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Ge=A_;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ge=S_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ge=go;break;case _s:case Tm:case zr:Ge=E_;break;case fd:Ge=JS;break;case"scroll":case"scrollend":Ge=ed;break;case"wheel":Ge=jo;break;case"copy":case"cut":case"paste":Ge=um;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ge=id;break;case"toggle":case"beforetoggle":Ge=vm}var pn=(r&4)!==0,Ei=!pn&&(a==="scroll"||a==="scrollend"),Ae=pn?De!==null?De+"Capture":null:De;pn=[];for(var pe=Te,Ee;pe!==null;){var Ke=pe;if(Ee=Ke.stateNode,Ke=Ke.tag,Ke!==5&&Ke!==26&&Ke!==27||Ee===null||Ae===null||(Ke=ya(pe,Ae),Ke!=null&&pn.push(Sg(pe,Ke,Ee))),Ei)break;pe=pe.return}0<pn.length&&(De=new Ge(De,Zt,null,f,ke),$e.push({event:De,listeners:pn}))}}if((r&7)===0){e:{if(De=a==="mouseover"||a==="pointerover",Ge=a==="mouseout"||a==="pointerout",De&&f!==ti&&(Zt=f.relatedTarget||f.fromElement)&&(Ze(Zt)||Zt[J]))break e;if((Ge||De)&&(De=ke.window===ke?ke:(De=ke.ownerDocument)?De.defaultView||De.parentWindow:window,Ge?(Zt=f.relatedTarget||f.toElement,Ge=Te,Zt=Zt?Ze(Zt):null,Zt!==null&&(Ei=o(Zt),pn=Zt.tag,Zt!==Ei||pn!==5&&pn!==27&&pn!==6)&&(Zt=null)):(Ge=null,Zt=Te),Ge!==Zt)){if(pn=A_,Ke="onMouseLeave",Ae="onMouseEnter",pe="mouse",(a==="pointerout"||a==="pointerover")&&(pn=id,Ke="onPointerLeave",Ae="onPointerEnter",pe="pointer"),Ei=Ge==null?De:vt(Ge),Ee=Zt==null?De:vt(Zt),De=new pn(Ke,pe+"leave",Ge,f,ke),De.target=Ei,De.relatedTarget=Ee,Ke=null,Ze(ke)===Te&&(pn=new pn(Ae,pe+"enter",Zt,f,ke),pn.target=Ee,pn.relatedTarget=Ei,Ke=pn),Ei=Ke,Ge&&Zt)t:{for(pn=x4,Ae=Ge,pe=Zt,Ee=0,Ke=Ae;Ke;Ke=pn(Ke))Ee++;Ke=0;for(var un=pe;un;un=pn(un))Ke++;for(;0<Ee-Ke;)Ae=pn(Ae),Ee--;for(;0<Ke-Ee;)pe=pn(pe),Ke--;for(;Ee--;){if(Ae===pe||pe!==null&&Ae===pe.alternate){pn=Ae;break t}Ae=pn(Ae),pe=pn(pe)}pn=null}else pn=null;Ge!==null&&zC($e,De,Ge,pn,!1),Zt!==null&&Ei!==null&&zC($e,Ei,Zt,pn,!0)}}e:{if(De=Te?vt(Te):window,Ge=De.nodeName&&De.nodeName.toLowerCase(),Ge==="select"||Ge==="input"&&De.type==="file")var di=Sm;else if(xm(De))if(Af)di=I_;else{di=$o;var tn=Sf}else Ge=De.nodeName,!Ge||Ge.toLowerCase()!=="input"||De.type!=="checkbox"&&De.type!=="radio"?Te&&Vt(Te.elementType)&&(di=Sm):di=O_;if(di&&(di=di(a,Te))){rd($e,di,f,ke);break e}tn&&tn(a,De,Te),a==="focusout"&&Te&&De.type==="number"&&Te.memoizedProps.value!=null&&Gn(De,"number",De.value)}switch(tn=Te?vt(Te):window,a){case"focusin":(xm(tn)||tn.contentEditable==="true")&&(Kc=tn,cd=Te,Wc=null);break;case"focusout":Wc=cd=Kc=null;break;case"mousedown":Fs=!0;break;case"contextmenu":case"mouseup":case"dragend":Fs=!1,ud($e,f,ke);break;case"selectionchange":if(F_)break;case"keydown":case"keyup":ud($e,f,ke)}var On;if(Xl)e:{switch(a){case"compositionstart":var Qn="onCompositionStart";break e;case"compositionend":Qn="onCompositionEnd";break e;case"compositionupdate":Qn="onCompositionUpdate";break e}Qn=void 0}else Qo?ad(a,f)&&(Qn="onCompositionEnd"):a==="keydown"&&f.keyCode===229&&(Qn="onCompositionStart");Qn&&(Ha&&f.locale!=="ko"&&(Qo||Qn!=="onCompositionStart"?Qn==="onCompositionEnd"&&Qo&&(On=$h()):(xr=ke,Qh="value"in xr?xr.value:xr.textContent,Qo=!0)),tn=My(Te,Qn),0<tn.length&&(Qn=new fm(Qn,a,null,f,ke),$e.push({event:Qn,listeners:tn}),On?Qn.data=On:(On=Vc(f),On!==null&&(Qn.data=On)))),(On=Yl?sd(a,f):L_(a,f))&&(Qn=My(Te,"onBeforeInput"),0<Qn.length&&(tn=new fm("onBeforeInput","beforeinput",null,f,ke),$e.push({event:tn,listeners:Qn}),tn.data=On)),g4($e,a,Te,f,ke)}PC($e,r)})}function Sg(a,r,f){return{instance:a,listener:r,currentTarget:f}}function My(a,r){for(var f=r+"Capture",m=[];a!==null;){var A=a,E=A.stateNode;if(A=A.tag,A!==5&&A!==26&&A!==27||E===null||(A=ya(a,f),A!=null&&m.unshift(Sg(a,A,E)),A=ya(a,r),A!=null&&m.push(Sg(a,A,E))),a.tag===3)return m;a=a.return}return[]}function x4(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function zC(a,r,f,m,A){for(var E=r._reactName,U=[];f!==null&&f!==m;){var X=f,re=X.alternate,Te=X.stateNode;if(X=X.tag,re!==null&&re===m)break;X!==5&&X!==26&&X!==27||Te===null||(re=Te,A?(Te=ya(f,E),Te!=null&&U.unshift(Sg(f,Te,re))):A||(Te=ya(f,E),Te!=null&&U.push(Sg(f,Te,re)))),f=f.return}U.length!==0&&a.push({event:r,listeners:U})}var A4=/\r\n?/g,S4=/\u0000|\uFFFD/g;function VC(a){return(typeof a=="string"?a:""+a).replace(A4,`
8
+ `+m.stack}}var Kt=Object.prototype.hasOwnProperty,_t=s.unstable_scheduleCallback,Ft=s.unstable_cancelCallback,yt=s.unstable_shouldYield,j=s.unstable_requestPaint,I=s.unstable_now,ue=s.unstable_getCurrentPriorityLevel,Ie=s.unstable_ImmediatePriority,Xe=s.unstable_UserBlockingPriority,Oe=s.unstable_NormalPriority,Bt=s.unstable_LowPriority,gt=s.unstable_IdlePriority,Ht=s.log,Xt=s.unstable_setDisableYieldValue,ze=null,qe=null;function Tt(a){if(typeof Ht=="function"&&Xt(a),qe&&typeof qe.setStrictMode=="function")try{qe.setStrictMode(ze,a)}catch{}}var pt=Math.clz32?Math.clz32:de,st=Math.log,qt=Math.LN2;function de(a){return a>>>=0,a===0?32:31-(st(a)/qt|0)|0}var be=256,We=262144,St=4194304;function Ye(a){var r=a&42;if(r!==0)return r;switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function Ve(a,r,f){var m=a.pendingLanes;if(m===0)return 0;var A=0,E=a.suspendedLanes,U=a.pingedLanes;a=a.warmLanes;var X=m&134217727;return X!==0?(m=X&~E,m!==0?A=Ye(m):(U&=X,U!==0?A=Ye(U):f||(f=X&~a,f!==0&&(A=Ye(f))))):(X=m&~E,X!==0?A=Ye(X):U!==0?A=Ye(U):f||(f=m&~a,f!==0&&(A=Ye(f)))),A===0?0:r!==0&&r!==A&&(r&E)===0&&(E=A&-A,f=r&-r,E>=f||E===32&&(f&4194048)!==0)?r:A}function ft(a,r){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&r)===0}function jt(a,r){switch(a){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Mn(){var a=St;return St<<=1,(St&62914560)===0&&(St=4194304),a}function bt(a){for(var r=[],f=0;31>f;f++)r.push(a);return r}function Dn(a,r){a.pendingLanes|=r,r!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function Nn(a,r,f,m,A,E){var U=a.pendingLanes;a.pendingLanes=f,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=f,a.entangledLanes&=f,a.errorRecoveryDisabledLanes&=f,a.shellSuspendCounter=0;var X=a.entanglements,re=a.expirationTimes,Te=a.hiddenUpdates;for(f=U&~f;0<f;){var ke=31-pt(f),$e=1<<ke;X[ke]=0,re[ke]=-1;var De=Te[ke];if(De!==null)for(Te[ke]=null,ke=0;ke<De.length;ke++){var Ge=De[ke];Ge!==null&&(Ge.lane&=-536870913)}f&=~$e}m!==0&&Ni(a,m,0),E!==0&&A===0&&a.tag!==0&&(a.suspendedLanes|=E&~(U&~r))}function Ni(a,r,f){a.pendingLanes|=r,a.suspendedLanes&=~r;var m=31-pt(r);a.entangledLanes|=r,a.entanglements[m]=a.entanglements[m]|1073741824|f&261930}function fa(a,r){var f=a.entangledLanes|=r;for(a=a.entanglements;f;){var m=31-pt(f),A=1<<m;A&r|a[m]&r&&(a[m]|=r),f&=~A}}function Ui(a,r){var f=r&-r;return f=(f&42)!==0?1:Zi(f),(f&(a.suspendedLanes|r))!==0?0:f}function Zi(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function Ia(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function vi(){var a=Y.p;return a!==0?a:(a=window.event,a===void 0?32:mR(a.type))}function en(a,r){var f=Y.p;try{return Y.p=a,r()}finally{Y.p=f}}var ci=Math.random().toString(36).slice(2),fn="__reactFiber$"+ci,G="__reactProps$"+ci,J="__reactContainer$"+ci,oe="__reactEvents$"+ci,Re="__reactListeners$"+ci,Pe="__reactHandles$"+ci,He="__reactResources$"+ci,ot="__reactMarker$"+ci;function nt(a){delete a[fn],delete a[G],delete a[oe],delete a[Re],delete a[Pe]}function Ze(a){var r=a[fn];if(r)return r;for(var f=a.parentNode;f;){if(r=f[J]||f[fn]){if(f=r.alternate,r.child!==null||f!==null&&f.child!==null)for(a=$C(a);a!==null;){if(f=a[fn])return f;a=$C(a)}return r}a=f,f=a.parentNode}return null}function je(a){if(a=a[fn]||a[J]){var r=a.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return a}return null}function vt(a){var r=a.tag;if(r===5||r===26||r===27||r===6)return a.stateNode;throw Error(n(33))}function ht(a){var r=a[He];return r||(r=a[He]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function k(a){a[ot]=!0}var te=new Set,fe={};function ce(a,r){le(a,r),le(a+"Capture",r)}function le(a,r){for(fe[a]=r,a=0;a<r.length;a++)te.add(r[a])}var Qe=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),lt={},ct={};function Ct(a){return Kt.call(ct,a)?!0:Kt.call(lt,a)?!1:Qe.test(a)?ct[a]=!0:(lt[a]=!0,!1)}function xt(a,r,f){if(Ct(r))if(f===null)a.removeAttribute(r);else{switch(typeof f){case"undefined":case"function":case"symbol":a.removeAttribute(r);return;case"boolean":var m=r.toLowerCase().slice(0,5);if(m!=="data-"&&m!=="aria-"){a.removeAttribute(r);return}}a.setAttribute(r,""+f)}}function Yt(a,r,f){if(f===null)a.removeAttribute(r);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(r);return}a.setAttribute(r,""+f)}}function At(a,r,f,m){if(m===null)a.removeAttribute(f);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(f);return}a.setAttributeNS(r,f,""+m)}}function zt(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function mn(a){var r=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Pn(a,r,f){var m=Object.getOwnPropertyDescriptor(a.constructor.prototype,r);if(!a.hasOwnProperty(r)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var A=m.get,E=m.set;return Object.defineProperty(a,r,{configurable:!0,get:function(){return A.call(this)},set:function(U){f=""+U,E.call(this,U)}}),Object.defineProperty(a,r,{enumerable:m.enumerable}),{getValue:function(){return f},setValue:function(U){f=""+U},stopTracking:function(){a._valueTracker=null,delete a[r]}}}}function xn(a){if(!a._valueTracker){var r=mn(a)?"checked":"value";a._valueTracker=Pn(a,r,""+a[r])}}function Qt(a){if(!a)return!1;var r=a._valueTracker;if(!r)return!0;var f=r.getValue(),m="";return a&&(m=mn(a)?a.checked?"true":"false":a.value),a=m,a!==f?(r.setValue(a),!0):!1}function Dt(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var $t=/[\n"\\]/g;function Lt(a){return a.replace($t,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function ei(a,r,f,m,A,E,U,X){a.name="",U!=null&&typeof U!="function"&&typeof U!="symbol"&&typeof U!="boolean"?a.type=U:a.removeAttribute("type"),r!=null?U==="number"?(r===0&&a.value===""||a.value!=r)&&(a.value=""+zt(r)):a.value!==""+zt(r)&&(a.value=""+zt(r)):U!=="submit"&&U!=="reset"||a.removeAttribute("value"),r!=null?Gn(a,U,zt(r)):f!=null?Gn(a,U,zt(f)):m!=null&&a.removeAttribute("value"),A==null&&E!=null&&(a.defaultChecked=!!E),A!=null&&(a.checked=A&&typeof A!="function"&&typeof A!="symbol"),X!=null&&typeof X!="function"&&typeof X!="symbol"&&typeof X!="boolean"?a.name=""+zt(X):a.removeAttribute("name")}function Qi(a,r,f,m,A,E,U,X){if(E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(a.type=E),r!=null||f!=null){if(!(E!=="submit"&&E!=="reset"||r!=null)){xn(a);return}f=f!=null?""+zt(f):"",r=r!=null?""+zt(r):f,X||r===a.value||(a.value=r),a.defaultValue=r}m=m??A,m=typeof m!="function"&&typeof m!="symbol"&&!!m,a.checked=X?a.checked:!!m,a.defaultChecked=!!m,U!=null&&typeof U!="function"&&typeof U!="symbol"&&typeof U!="boolean"&&(a.name=U),xn(a)}function Gn(a,r,f){r==="number"&&Dt(a.ownerDocument)===a||a.defaultValue===""+f||(a.defaultValue=""+f)}function Fi(a,r,f,m){if(a=a.options,r){r={};for(var A=0;A<f.length;A++)r["$"+f[A]]=!0;for(f=0;f<a.length;f++)A=r.hasOwnProperty("$"+a[f].value),a[f].selected!==A&&(a[f].selected=A),A&&m&&(a[f].defaultSelected=!0)}else{for(f=""+zt(f),r=null,A=0;A<a.length;A++){if(a[A].value===f){a[A].selected=!0,m&&(a[A].defaultSelected=!0);return}r!==null||a[A].disabled||(r=a[A])}r!==null&&(r.selected=!0)}}function ri(a,r,f){if(r!=null&&(r=""+zt(r),r!==a.value&&(a.value=r),f==null)){a.defaultValue!==r&&(a.defaultValue=r);return}a.defaultValue=f!=null?""+zt(f):""}function we(a,r,f,m){if(r==null){if(m!=null){if(f!=null)throw Error(n(92));if(he(m)){if(1<m.length)throw Error(n(93));m=m[0]}f=m}f==null&&(f=""),r=f}f=zt(r),a.defaultValue=f,m=a.textContent,m===f&&m!==""&&m!==null&&(a.value=m),xn(a)}function at(a,r){if(r){var f=a.firstChild;if(f&&f===a.lastChild&&f.nodeType===3){f.nodeValue=r;return}}a.textContent=r}var ut=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Ut(a,r,f){var m=r.indexOf("--")===0;f==null||typeof f=="boolean"||f===""?m?a.setProperty(r,""):r==="float"?a.cssFloat="":a[r]="":m?a.setProperty(r,f):typeof f!="number"||f===0||ut.has(r)?r==="float"?a.cssFloat=f:a[r]=(""+f).trim():a[r]=f+"px"}function Nt(a,r,f){if(r!=null&&typeof r!="object")throw Error(n(62));if(a=a.style,f!=null){for(var m in f)!f.hasOwnProperty(m)||r!=null&&r.hasOwnProperty(m)||(m.indexOf("--")===0?a.setProperty(m,""):m==="float"?a.cssFloat="":a[m]="");for(var A in r)m=r[A],r.hasOwnProperty(A)&&f[A]!==m&&Ut(a,A,m)}else for(var E in r)r.hasOwnProperty(E)&&Ut(a,E,r[E])}function Vt(a){if(a.indexOf("-")===-1)return!1;switch(a){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ln=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Wn=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function En(a){return Wn.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function Cn(){}var ti=null;function Ci(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var _i=null,ha=null;function _a(a){var r=je(a);if(r&&(a=r.stateNode)){var f=a[G]||null;e:switch(a=r.stateNode,r.type){case"input":if(ei(a,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name),r=f.name,f.type==="radio"&&r!=null){for(f=a;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll('input[name="'+Lt(""+r)+'"][type="radio"]'),r=0;r<f.length;r++){var m=f[r];if(m!==a&&m.form===a.form){var A=m[G]||null;if(!A)throw Error(n(90));ei(m,A.value,A.defaultValue,A.defaultValue,A.checked,A.defaultChecked,A.type,A.name)}}for(r=0;r<f.length;r++)m=f[r],m.form===a.form&&Qt(m)}break e;case"textarea":ri(a,f.value,f.defaultValue);break e;case"select":r=f.value,r!=null&&Fi(a,!!f.multiple,r,!1)}}}var Wa=!1;function Ri(a,r,f){if(Wa)return a(r,f);Wa=!0;try{var m=a(r);return m}finally{if(Wa=!1,(_i!==null||ha!==null)&&(q(),_i&&(r=_i,a=ha,ha=_i=null,_a(r),a)))for(r=0;r<a.length;r++)_a(a[r])}}function ya(a,r){var f=a.stateNode;if(f===null)return null;var m=f[G]||null;if(m===null)return null;f=m[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(a=a.type,m=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!m;break e;default:a=!1}if(a)return null;if(f&&typeof f!="function")throw Error(n(231,r,typeof f));return f}var $i=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ir=!1;if($i)try{var qo={};Object.defineProperty(qo,"passive",{get:function(){ir=!0}}),window.addEventListener("test",qo,qo),window.removeEventListener("test",qo,qo)}catch{ir=!1}var xr=null,Qh=null,Ko=null;function $h(){if(Ko)return Ko;var a,r=Qh,f=r.length,m,A="value"in xr?xr.value:xr.textContent,E=A.length;for(a=0;a<f&&r[a]===A[a];a++);var U=f-a;for(m=1;m<=U&&r[f-m]===A[E-m];m++);return Ko=A.slice(a,1<m?1-m:void 0)}function kl(a){var r=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&r===13&&(a=13)):a=r,a===10&&(a=13),32<=a||a===13?a:0}function pf(){return!0}function cm(){return!1}function ja(a){function r(f,m,A,E,U){this._reactName=f,this._targetInst=A,this.type=m,this.nativeEvent=E,this.target=U,this.currentTarget=null;for(var X in a)a.hasOwnProperty(X)&&(f=a[X],this[X]=f?f(E):E[X]);return this.isDefaultPrevented=(E.defaultPrevented!=null?E.defaultPrevented:E.returnValue===!1)?pf:cm,this.isPropagationStopped=cm,this}return v(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=pf)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=pf)},persist:function(){},isPersistent:pf}),r}var Wo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},mf=ja(Wo),Ar=v({},Wo,{view:0,detail:0}),ed=ja(Ar),td,gf,zc,vf=v({},Ar,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:yf,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==zc&&(zc&&a.type==="mousemove"?(td=a.screenX-zc.screenX,gf=a.screenY-zc.screenY):gf=td=0,zc=a),td)},movementY:function(a){return"movementY"in a?a.movementY:gf}}),A_=ja(vf),Fa=v({},vf,{dataTransfer:0}),S_=ja(Fa),M_=v({},Ar,{relatedTarget:0}),nd=ja(M_),b_=v({},Wo,{animationName:0,elapsedTime:0,pseudoElement:0}),E_=ja(b_),_f=v({},Wo,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),um=ja(_f),T_=v({},Wo,{data:0}),fm=ja(T_),C_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},hm={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},dm={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function R_(a){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(a):(a=dm[a])?!!r[a]:!1}function yf(){return R_}var pm=v({},Ar,{key:function(a){if(a.key){var r=C_[a.key]||a.key;if(r!=="Unidentified")return r}return a.type==="keypress"?(a=kl(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?hm[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:yf,charCode:function(a){return a.type==="keypress"?kl(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?kl(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),mm=ja(pm),w_=v({},vf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),id=ja(w_),B_=v({},Ar,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:yf}),go=ja(B_),gm=v({},Wo,{propertyName:0,elapsedTime:0,pseudoElement:0}),JS=ja(gm),D_=v({},vf,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),jo=ja(D_),vo=v({},Wo,{newState:0,oldState:0}),vm=ja(vo),_m=[9,13,27,32],Xl=$i&&"CompositionEvent"in window,Zo=null;$i&&"documentMode"in document&&(Zo=document.documentMode);var Yl=$i&&"TextEvent"in window&&!Zo,Ha=$i&&(!Xl||Zo&&8<Zo&&11>=Zo),xf=" ",ym=!1;function ad(a,r){switch(a){case"keyup":return _m.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Vc(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Qo=!1;function sd(a,r){switch(a){case"compositionend":return Vc(r);case"keypress":return r.which!==32?null:(ym=!0,xf);case"textInput":return a=r.data,a===xf&&ym?null:a;default:return null}}function L_(a,r){if(Qo)return a==="compositionend"||!Xl&&ad(a,r)?(a=$h(),Ko=Qh=xr=null,Qo=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return Ha&&r.locale!=="ko"?null:r.data;default:return null}}var Is={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function xm(a){var r=a&&a.nodeName&&a.nodeName.toLowerCase();return r==="input"?!!Is[a.type]:r==="textarea"}function rd(a,r,f,m){_i?ha?ha.push(m):ha=[m]:_i=m,r=My(r,"onChange"),0<r.length&&(f=new mf("onChange","change",null,f,m),a.push({event:f,listeners:r}))}var kc=null,Xc=null;function Am(a){PC(a,0)}function Yc(a){var r=vt(a);if(Qt(r))return a}function Sm(a,r){if(a==="change")return r}var Af=!1;if($i){var Jl;if($i){var wi="oninput"in document;if(!wi){var N_=document.createElement("div");N_.setAttribute("oninput","return;"),wi=typeof N_.oninput=="function"}Jl=wi}else Jl=!1;Af=Jl&&(!document.documentMode||9<document.documentMode)}function U_(){kc&&(kc.detachEvent("onpropertychange",Mm),Xc=kc=null)}function Mm(a){if(a.propertyName==="value"&&Yc(Xc)){var r=[];rd(r,Xc,a,Ci(a)),Ri(Am,r)}}function Sf(a,r,f){a==="focusin"?(U_(),kc=r,Xc=f,kc.attachEvent("onpropertychange",Mm)):a==="focusout"&&U_()}function $o(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Yc(Xc)}function O_(a,r){if(a==="click")return Yc(r)}function I_(a,r){if(a==="input"||a==="change")return Yc(r)}function ql(a,r){return a===r&&(a!==0||1/a===1/r)||a!==a&&r!==r}var Bi=typeof Object.is=="function"?Object.is:ql;function Jc(a,r){if(Bi(a,r))return!0;if(typeof a!="object"||a===null||typeof r!="object"||r===null)return!1;var f=Object.keys(a),m=Object.keys(r);if(f.length!==m.length)return!1;for(m=0;m<f.length;m++){var A=f[m];if(!Kt.call(r,A)||!Bi(a[A],r[A]))return!1}return!0}function bm(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function Em(a,r){var f=bm(a);a=0;for(var m;f;){if(f.nodeType===3){if(m=a+f.textContent.length,a<=r&&m>=r)return{node:f,offset:r-a};a=m}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=bm(f)}}function od(a,r){return a&&r?a===r?!0:a&&a.nodeType===3?!1:r&&r.nodeType===3?od(a,r.parentNode):"contains"in a?a.contains(r):a.compareDocumentPosition?!!(a.compareDocumentPosition(r)&16):!1:!1}function ld(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var r=Dt(a.document);r instanceof a.HTMLIFrameElement;){try{var f=typeof r.contentWindow.location.href=="string"}catch{f=!1}if(f)a=r.contentWindow;else break;r=Dt(a.document)}return r}function qc(a){var r=a&&a.nodeName&&a.nodeName.toLowerCase();return r&&(r==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||r==="textarea"||a.contentEditable==="true")}var F_=$i&&"documentMode"in document&&11>=document.documentMode,Kc=null,cd=null,Wc=null,Fs=!1;function ud(a,r,f){var m=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;Fs||Kc==null||Kc!==Dt(m)||(m=Kc,"selectionStart"in m&&qc(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),Wc&&Jc(Wc,m)||(Wc=m,m=My(cd,"onSelect"),0<m.length&&(r=new mf("onSelect","select",null,r,f),a.push({event:r,listeners:m}),r.target=Kc)))}function el(a,r){var f={};return f[a.toLowerCase()]=r.toLowerCase(),f["Webkit"+a]="webkit"+r,f["Moz"+a]="moz"+r,f}var jc={animationend:el("Animation","AnimationEnd"),animationiteration:el("Animation","AnimationIteration"),animationstart:el("Animation","AnimationStart"),transitionrun:el("Transition","TransitionRun"),transitionstart:el("Transition","TransitionStart"),transitioncancel:el("Transition","TransitionCancel"),transitionend:el("Transition","TransitionEnd")},Mf={},rs={};$i&&(rs=document.createElement("div").style,"AnimationEvent"in window||(delete jc.animationend.animation,delete jc.animationiteration.animation,delete jc.animationstart.animation),"TransitionEvent"in window||delete jc.transitionend.transition);function tl(a){if(Mf[a])return Mf[a];if(!jc[a])return a;var r=jc[a],f;for(f in r)if(r.hasOwnProperty(f)&&f in rs)return Mf[a]=r[f];return a}var _s=tl("animationend"),Tm=tl("animationiteration"),zr=tl("animationstart"),Zc=tl("transitionrun"),nl=tl("transitionstart"),Cm=tl("transitioncancel"),fd=tl("transitionend"),_o=new Map,hd="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");hd.push("scrollEnd");function Za(a,r){_o.set(a,r),ce(r,[a])}var il=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(r))return}else if(typeof bl=="object"&&typeof bl.emit=="function"){bl.emit("uncaughtException",a);return}console.error(a)},Ta=[],Kl=0,dd=0;function al(){for(var a=Kl,r=dd=Kl=0;r<a;){var f=Ta[r];Ta[r++]=null;var m=Ta[r];Ta[r++]=null;var A=Ta[r];Ta[r++]=null;var E=Ta[r];if(Ta[r++]=null,m!==null&&A!==null){var U=m.pending;U===null?A.next=A:(A.next=U.next,U.next=A),m.pending=A}E!==0&&pd(f,A,E)}}function bf(a,r,f,m){Ta[Kl++]=a,Ta[Kl++]=r,Ta[Kl++]=f,Ta[Kl++]=m,dd|=m,a.lanes|=m,a=a.alternate,a!==null&&(a.lanes|=m)}function Qc(a,r,f,m){return bf(a,r,f,m),$c(a)}function sl(a,r){return bf(a,null,null,r),$c(a)}function pd(a,r,f){a.lanes|=f;var m=a.alternate;m!==null&&(m.lanes|=f);for(var A=!1,E=a.return;E!==null;)E.childLanes|=f,m=E.alternate,m!==null&&(m.childLanes|=f),E.tag===22&&(a=E.stateNode,a===null||a._visibility&1||(A=!0)),a=E,E=E.return;return a.tag===3?(E=a.stateNode,A&&r!==null&&(A=31-pt(f),a=E.hiddenUpdates,m=a[A],m===null?a[A]=[r]:m.push(r),r.lane=f|536870912),E):null}function $c(a){if(50<fc)throw fc=0,hc=null,Error(n(185));for(var r=a.return;r!==null;)a=r,r=a.return;return a.tag===3?a.stateNode:null}var rl={};function H_(a,r,f,m){this.tag=a,this.key=f,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,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 os(a,r,f,m){return new H_(a,r,f,m)}function ls(a){return a=a.prototype,!(!a||!a.isReactComponent)}function Vr(a,r){var f=a.alternate;return f===null?(f=os(a.tag,r,a.key,a.mode),f.elementType=a.elementType,f.type=a.type,f.stateNode=a.stateNode,f.alternate=a,a.alternate=f):(f.pendingProps=r,f.type=a.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=a.flags&65011712,f.childLanes=a.childLanes,f.lanes=a.lanes,f.child=a.child,f.memoizedProps=a.memoizedProps,f.memoizedState=a.memoizedState,f.updateQueue=a.updateQueue,r=a.dependencies,f.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},f.sibling=a.sibling,f.index=a.index,f.ref=a.ref,f.refCleanup=a.refCleanup,f}function Qa(a,r){a.flags&=65011714;var f=a.alternate;return f===null?(a.childLanes=0,a.lanes=r,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=f.childLanes,a.lanes=f.lanes,a.child=f.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=f.memoizedProps,a.memoizedState=f.memoizedState,a.updateQueue=f.updateQueue,a.type=f.type,r=f.dependencies,a.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),a}function Ef(a,r,f,m,A,E){var U=0;if(m=a,typeof a=="function")ls(a)&&(U=1);else if(typeof a=="string")U=V4(a,f,Ne.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case N:return a=os(31,f,r,A),a.elementType=N,a.lanes=E,a;case R:return yo(f.children,A,E,r);case T:U=8,A|=24;break;case M:return a=os(12,f,r,A|2),a.elementType=M,a.lanes=E,a;case P:return a=os(13,f,r,A),a.elementType=P,a.lanes=E,a;case O:return a=os(19,f,r,A),a.elementType=O,a.lanes=E,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case D:U=10;break e;case w:U=9;break e;case L:U=11;break e;case z:U=14;break e;case V:U=16,m=null;break e}U=29,f=Error(n(130,a===null?"null":typeof a,"")),m=null}return r=os(U,f,r,A),r.elementType=a,r.type=m,r.lanes=E,r}function yo(a,r,f,m){return a=os(7,a,m,r),a.lanes=f,a}function md(a,r,f){return a=os(6,a,null,r),a.lanes=f,a}function P_(a){var r=os(18,null,null,0);return r.stateNode=a,r}function Sr(a,r,f){return r=os(4,a.children!==null?a.children:[],a.key,r),r.lanes=f,r.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},r}var Rm=new WeakMap;function ys(a,r){if(typeof a=="object"&&a!==null){var f=Rm.get(a);return f!==void 0?f:(r={value:a,source:r,stack:Q(r)},Rm.set(a,r),r)}return{value:a,source:r,stack:Q(r)}}var Mr=[],Wl=0,Tf=null,eu=0,Hs=[],xs=0,kr=null,Xr=1,Yr="";function xo(a,r){Mr[Wl++]=eu,Mr[Wl++]=Tf,Tf=a,eu=r}function wm(a,r,f){Hs[xs++]=Xr,Hs[xs++]=Yr,Hs[xs++]=kr,kr=a;var m=Xr;a=Yr;var A=32-pt(m)-1;m&=~(1<<A),f+=1;var E=32-pt(r)+A;if(30<E){var U=A-A%5;E=(m&(1<<U)-1).toString(32),m>>=U,A-=U,Xr=1<<32-pt(r)+A|f<<A|m,Yr=E+a}else Xr=1<<E|f<<A|m,Yr=a}function gd(a){a.return!==null&&(xo(a,1),wm(a,1,0))}function ol(a){for(;a===Tf;)Tf=Mr[--Wl],Mr[Wl]=null,eu=Mr[--Wl],Mr[Wl]=null;for(;a===kr;)kr=Hs[--xs],Hs[xs]=null,Yr=Hs[--xs],Hs[xs]=null,Xr=Hs[--xs],Hs[xs]=null}function Cf(a,r){Hs[xs++]=Xr,Hs[xs++]=Yr,Hs[xs++]=kr,Xr=r.id,Yr=r.overflow,kr=a}var Ca=null,Si=null,Jn=!1,Ao=null,Ra=!1,vd=Error(n(519));function zn(a){var r=Error(n(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Rf(ys(r,a)),vd}function _d(a){var r=a.stateNode,f=a.type,m=a.memoizedProps;switch(r[fn]=a,r[G]=m,f){case"dialog":qn("cancel",r),qn("close",r);break;case"iframe":case"object":case"embed":qn("load",r);break;case"video":case"audio":for(f=0;f<Ag.length;f++)qn(Ag[f],r);break;case"source":qn("error",r);break;case"img":case"image":case"link":qn("error",r),qn("load",r);break;case"details":qn("toggle",r);break;case"input":qn("invalid",r),Qi(r,m.value,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name,!0);break;case"select":qn("invalid",r);break;case"textarea":qn("invalid",r),we(r,m.value,m.defaultValue,m.children)}f=m.children,typeof f!="string"&&typeof f!="number"&&typeof f!="bigint"||r.textContent===""+f||m.suppressHydrationWarning===!0||kC(r.textContent,f)?(m.popover!=null&&(qn("beforetoggle",r),qn("toggle",r)),m.onScroll!=null&&qn("scroll",r),m.onScrollEnd!=null&&qn("scrollend",r),m.onClick!=null&&(r.onclick=Cn),r=!0):r=!1,r||zn(a,!0)}function G_(a){for(Ca=a.return;Ca;)switch(Ca.tag){case 5:case 31:case 13:Ra=!1;return;case 27:case 3:Ra=!0;return;default:Ca=Ca.return}}function jl(a){if(a!==Ca)return!1;if(!Jn)return G_(a),Jn=!0,!1;var r=a.tag,f;if((f=r!==3&&r!==27)&&((f=r===5)&&(f=a.type,f=!(f!=="form"&&f!=="button")||hM(a.type,a.memoizedProps)),f=!f),f&&Si&&zn(a),G_(a),r===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(n(317));Si=QC(a)}else if(r===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(n(317));Si=QC(a)}else r===27?(r=Si,yu(a.type)?(a=vM,vM=null,Si=a):Si=r):Si=Ca?no(a.stateNode.nextSibling):null;return!0}function Zl(){Si=Ca=null,Jn=!1}function Bm(){var a=Ao;return a!==null&&(as===null?as=a:as.push.apply(as,a),Ao=null),a}function Rf(a){Ao===null?Ao=[a]:Ao.push(a)}var Dm=W(null),So=null,$a=null;function Mo(a,r,f){Me(Dm,r._currentValue),r._currentValue=f}function ar(a){a._currentValue=Dm.current,ae(Dm)}function bo(a,r,f){for(;a!==null;){var m=a.alternate;if((a.childLanes&r)!==r?(a.childLanes|=r,m!==null&&(m.childLanes|=r)):m!==null&&(m.childLanes&r)!==r&&(m.childLanes|=r),a===f)break;a=a.return}}function yd(a,r,f,m){var A=a.child;for(A!==null&&(A.return=a);A!==null;){var E=A.dependencies;if(E!==null){var U=A.child;E=E.firstContext;e:for(;E!==null;){var X=E;E=A;for(var re=0;re<r.length;re++)if(X.context===r[re]){E.lanes|=f,X=E.alternate,X!==null&&(X.lanes|=f),bo(E.return,f,a),m||(U=null);break e}E=X.next}}else if(A.tag===18){if(U=A.return,U===null)throw Error(n(341));U.lanes|=f,E=U.alternate,E!==null&&(E.lanes|=f),bo(U,f,a),U=null}else U=A.child;if(U!==null)U.return=A;else for(U=A;U!==null;){if(U===a){U=null;break}if(A=U.sibling,A!==null){A.return=U.return,U=A;break}U=U.return}A=U}}function ll(a,r,f,m){a=null;for(var A=r,E=!1;A!==null;){if(!E){if((A.flags&524288)!==0)E=!0;else if((A.flags&262144)!==0)break}if(A.tag===10){var U=A.alternate;if(U===null)throw Error(n(387));if(U=U.memoizedProps,U!==null){var X=A.type;Bi(A.pendingProps.value,U.value)||(a!==null?a.push(X):a=[X])}}else if(A===Ce.current){if(U=A.alternate,U===null)throw Error(n(387));U.memoizedState.memoizedState!==A.memoizedState.memoizedState&&(a!==null?a.push(Tg):a=[Tg])}A=A.return}a!==null&&yd(r,a,f,m),r.flags|=262144}function tu(a){for(a=a.firstContext;a!==null;){if(!Bi(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function Ql(a){So=a,$a=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function wa(a){return Lm(So,a)}function wf(a,r){return So===null&&Ql(a),Lm(a,r)}function Lm(a,r){var f=r._currentValue;if(r={context:r,memoizedValue:f,next:null},$a===null){if(a===null)throw Error(n(308));$a=r,a.dependencies={lanes:0,firstContext:r},a.flags|=524288}else $a=$a.next=r;return f}var z_=typeof AbortController<"u"?AbortController:function(){var a=[],r=this.signal={aborted:!1,addEventListener:function(f,m){a.push(m)}};this.abort=function(){r.aborted=!0,a.forEach(function(f){return f()})}},V_=s.unstable_scheduleCallback,Nm=s.unstable_NormalPriority,sn={$$typeof:D,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Um(){return{controller:new z_,data:new Map,refCount:0}}function Pa(a){a.refCount--,a.refCount===0&&V_(Nm,function(){a.controller.abort()})}var $l=null,Om=0,Eo=0,br=null;function nu(a,r){if($l===null){var f=$l=[];Om=0,Eo=iM(),br={status:"pending",value:void 0,then:function(m){f.push(m)}}}return Om++,r.then(Im,Im),r}function Im(){if(--Om===0&&$l!==null){br!==null&&(br.status="fulfilled");var a=$l;$l=null,Eo=0,br=null;for(var r=0;r<a.length;r++)(0,a[r])()}}function Fm(a,r){var f=[],m={status:"pending",value:null,reason:null,then:function(A){f.push(A)}};return a.then(function(){m.status="fulfilled",m.value=r;for(var A=0;A<f.length;A++)(0,f[A])(r)},function(A){for(m.status="rejected",m.reason=A,A=0;A<f.length;A++)(0,f[A])(void 0)}),m}var k_=H.S;H.S=function(a,r){gu=I(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&nu(a,r),k_!==null&&k_(a,r)};var cl=W(null);function Jr(){var a=cl.current;return a!==null?a:fi.pooledCache}function iu(a,r){r===null?Me(cl,cl.current):Me(cl,r.pool)}function xd(){var a=Jr();return a===null?null:{parent:sn._currentValue,pool:a}}var ul=Error(n(460)),Bf=Error(n(474)),Er=Error(n(542)),Df={then:function(){}};function X_(a){return a=a.status,a==="fulfilled"||a==="rejected"}function Hm(a,r,f){switch(f=a[f],f===void 0?a.push(r):f!==r&&(r.then(Cn,Cn),r=f),r.status){case"fulfilled":return r.value;case"rejected":throw a=r.reason,Pm(a),a;default:if(typeof r.status=="string")r.then(Cn,Cn);else{if(a=fi,a!==null&&100<a.shellSuspendCounter)throw Error(n(482));a=r,a.status="pending",a.then(function(m){if(r.status==="pending"){var A=r;A.status="fulfilled",A.value=m}},function(m){if(r.status==="pending"){var A=r;A.status="rejected",A.reason=m}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw a=r.reason,Pm(a),a}throw hn=r,ul}}function ec(a){try{var r=a._init;return r(a._payload)}catch(f){throw f!==null&&typeof f=="object"&&typeof f.then=="function"?(hn=f,ul):f}}var hn=null;function Ad(){if(hn===null)throw Error(n(459));var a=hn;return hn=null,a}function Pm(a){if(a===ul||a===Er)throw Error(n(483))}var fl=null,hl=0;function Sd(a){var r=hl;return hl+=1,fl===null&&(fl=[]),Hm(fl,a,r)}function Lf(a,r){r=r.props.ref,a.ref=r!==void 0?r:null}function Nf(a,r){throw r.$$typeof===y?Error(n(525)):(a=Object.prototype.toString.call(r),Error(n(31,a==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":a)))}function au(a){function r(Ae,pe){if(a){var Ee=Ae.deletions;Ee===null?(Ae.deletions=[pe],Ae.flags|=16):Ee.push(pe)}}function f(Ae,pe){if(!a)return null;for(;pe!==null;)r(Ae,pe),pe=pe.sibling;return null}function m(Ae){for(var pe=new Map;Ae!==null;)Ae.key!==null?pe.set(Ae.key,Ae):pe.set(Ae.index,Ae),Ae=Ae.sibling;return pe}function A(Ae,pe){return Ae=Vr(Ae,pe),Ae.index=0,Ae.sibling=null,Ae}function E(Ae,pe,Ee){return Ae.index=Ee,a?(Ee=Ae.alternate,Ee!==null?(Ee=Ee.index,Ee<pe?(Ae.flags|=67108866,pe):Ee):(Ae.flags|=67108866,pe)):(Ae.flags|=1048576,pe)}function U(Ae){return a&&Ae.alternate===null&&(Ae.flags|=67108866),Ae}function X(Ae,pe,Ee,Ke){return pe===null||pe.tag!==6?(pe=md(Ee,Ae.mode,Ke),pe.return=Ae,pe):(pe=A(pe,Ee),pe.return=Ae,pe)}function re(Ae,pe,Ee,Ke){var un=Ee.type;return un===R?ke(Ae,pe,Ee.props.children,Ke,Ee.key):pe!==null&&(pe.elementType===un||typeof un=="object"&&un!==null&&un.$$typeof===V&&ec(un)===pe.type)?(pe=A(pe,Ee.props),Lf(pe,Ee),pe.return=Ae,pe):(pe=Ef(Ee.type,Ee.key,Ee.props,null,Ae.mode,Ke),Lf(pe,Ee),pe.return=Ae,pe)}function Te(Ae,pe,Ee,Ke){return pe===null||pe.tag!==4||pe.stateNode.containerInfo!==Ee.containerInfo||pe.stateNode.implementation!==Ee.implementation?(pe=Sr(Ee,Ae.mode,Ke),pe.return=Ae,pe):(pe=A(pe,Ee.children||[]),pe.return=Ae,pe)}function ke(Ae,pe,Ee,Ke,un){return pe===null||pe.tag!==7?(pe=yo(Ee,Ae.mode,Ke,un),pe.return=Ae,pe):(pe=A(pe,Ee),pe.return=Ae,pe)}function $e(Ae,pe,Ee){if(typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint")return pe=md(""+pe,Ae.mode,Ee),pe.return=Ae,pe;if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case x:return Ee=Ef(pe.type,pe.key,pe.props,null,Ae.mode,Ee),Lf(Ee,pe),Ee.return=Ae,Ee;case b:return pe=Sr(pe,Ae.mode,Ee),pe.return=Ae,pe;case V:return pe=ec(pe),$e(Ae,pe,Ee)}if(he(pe)||ne(pe))return pe=yo(pe,Ae.mode,Ee,null),pe.return=Ae,pe;if(typeof pe.then=="function")return $e(Ae,Sd(pe),Ee);if(pe.$$typeof===D)return $e(Ae,wf(Ae,pe),Ee);Nf(Ae,pe)}return null}function De(Ae,pe,Ee,Ke){var un=pe!==null?pe.key:null;if(typeof Ee=="string"&&Ee!==""||typeof Ee=="number"||typeof Ee=="bigint")return un!==null?null:X(Ae,pe,""+Ee,Ke);if(typeof Ee=="object"&&Ee!==null){switch(Ee.$$typeof){case x:return Ee.key===un?re(Ae,pe,Ee,Ke):null;case b:return Ee.key===un?Te(Ae,pe,Ee,Ke):null;case V:return Ee=ec(Ee),De(Ae,pe,Ee,Ke)}if(he(Ee)||ne(Ee))return un!==null?null:ke(Ae,pe,Ee,Ke,null);if(typeof Ee.then=="function")return De(Ae,pe,Sd(Ee),Ke);if(Ee.$$typeof===D)return De(Ae,pe,wf(Ae,Ee),Ke);Nf(Ae,Ee)}return null}function Ge(Ae,pe,Ee,Ke,un){if(typeof Ke=="string"&&Ke!==""||typeof Ke=="number"||typeof Ke=="bigint")return Ae=Ae.get(Ee)||null,X(pe,Ae,""+Ke,un);if(typeof Ke=="object"&&Ke!==null){switch(Ke.$$typeof){case x:return Ae=Ae.get(Ke.key===null?Ee:Ke.key)||null,re(pe,Ae,Ke,un);case b:return Ae=Ae.get(Ke.key===null?Ee:Ke.key)||null,Te(pe,Ae,Ke,un);case V:return Ke=ec(Ke),Ge(Ae,pe,Ee,Ke,un)}if(he(Ke)||ne(Ke))return Ae=Ae.get(Ee)||null,ke(pe,Ae,Ke,un,null);if(typeof Ke.then=="function")return Ge(Ae,pe,Ee,Sd(Ke),un);if(Ke.$$typeof===D)return Ge(Ae,pe,Ee,wf(pe,Ke),un);Nf(pe,Ke)}return null}function Zt(Ae,pe,Ee,Ke){for(var un=null,di=null,tn=pe,On=pe=0,Qn=null;tn!==null&&On<Ee.length;On++){tn.index>On?(Qn=tn,tn=null):Qn=tn.sibling;var pi=De(Ae,tn,Ee[On],Ke);if(pi===null){tn===null&&(tn=Qn);break}a&&tn&&pi.alternate===null&&r(Ae,tn),pe=E(pi,pe,On),di===null?un=pi:di.sibling=pi,di=pi,tn=Qn}if(On===Ee.length)return f(Ae,tn),Jn&&xo(Ae,On),un;if(tn===null){for(;On<Ee.length;On++)tn=$e(Ae,Ee[On],Ke),tn!==null&&(pe=E(tn,pe,On),di===null?un=tn:di.sibling=tn,di=tn);return Jn&&xo(Ae,On),un}for(tn=m(tn);On<Ee.length;On++)Qn=Ge(tn,Ae,On,Ee[On],Ke),Qn!==null&&(a&&Qn.alternate!==null&&tn.delete(Qn.key===null?On:Qn.key),pe=E(Qn,pe,On),di===null?un=Qn:di.sibling=Qn,di=Qn);return a&&tn.forEach(function(bu){return r(Ae,bu)}),Jn&&xo(Ae,On),un}function pn(Ae,pe,Ee,Ke){if(Ee==null)throw Error(n(151));for(var un=null,di=null,tn=pe,On=pe=0,Qn=null,pi=Ee.next();tn!==null&&!pi.done;On++,pi=Ee.next()){tn.index>On?(Qn=tn,tn=null):Qn=tn.sibling;var bu=De(Ae,tn,pi.value,Ke);if(bu===null){tn===null&&(tn=Qn);break}a&&tn&&bu.alternate===null&&r(Ae,tn),pe=E(bu,pe,On),di===null?un=bu:di.sibling=bu,di=bu,tn=Qn}if(pi.done)return f(Ae,tn),Jn&&xo(Ae,On),un;if(tn===null){for(;!pi.done;On++,pi=Ee.next())pi=$e(Ae,pi.value,Ke),pi!==null&&(pe=E(pi,pe,On),di===null?un=pi:di.sibling=pi,di=pi);return Jn&&xo(Ae,On),un}for(tn=m(tn);!pi.done;On++,pi=Ee.next())pi=Ge(tn,Ae,On,pi.value,Ke),pi!==null&&(a&&pi.alternate!==null&&tn.delete(pi.key===null?On:pi.key),pe=E(pi,pe,On),di===null?un=pi:di.sibling=pi,di=pi);return a&&tn.forEach(function($4){return r(Ae,$4)}),Jn&&xo(Ae,On),un}function Ei(Ae,pe,Ee,Ke){if(typeof Ee=="object"&&Ee!==null&&Ee.type===R&&Ee.key===null&&(Ee=Ee.props.children),typeof Ee=="object"&&Ee!==null){switch(Ee.$$typeof){case x:e:{for(var un=Ee.key;pe!==null;){if(pe.key===un){if(un=Ee.type,un===R){if(pe.tag===7){f(Ae,pe.sibling),Ke=A(pe,Ee.props.children),Ke.return=Ae,Ae=Ke;break e}}else if(pe.elementType===un||typeof un=="object"&&un!==null&&un.$$typeof===V&&ec(un)===pe.type){f(Ae,pe.sibling),Ke=A(pe,Ee.props),Lf(Ke,Ee),Ke.return=Ae,Ae=Ke;break e}f(Ae,pe);break}else r(Ae,pe);pe=pe.sibling}Ee.type===R?(Ke=yo(Ee.props.children,Ae.mode,Ke,Ee.key),Ke.return=Ae,Ae=Ke):(Ke=Ef(Ee.type,Ee.key,Ee.props,null,Ae.mode,Ke),Lf(Ke,Ee),Ke.return=Ae,Ae=Ke)}return U(Ae);case b:e:{for(un=Ee.key;pe!==null;){if(pe.key===un)if(pe.tag===4&&pe.stateNode.containerInfo===Ee.containerInfo&&pe.stateNode.implementation===Ee.implementation){f(Ae,pe.sibling),Ke=A(pe,Ee.children||[]),Ke.return=Ae,Ae=Ke;break e}else{f(Ae,pe);break}else r(Ae,pe);pe=pe.sibling}Ke=Sr(Ee,Ae.mode,Ke),Ke.return=Ae,Ae=Ke}return U(Ae);case V:return Ee=ec(Ee),Ei(Ae,pe,Ee,Ke)}if(he(Ee))return Zt(Ae,pe,Ee,Ke);if(ne(Ee)){if(un=ne(Ee),typeof un!="function")throw Error(n(150));return Ee=un.call(Ee),pn(Ae,pe,Ee,Ke)}if(typeof Ee.then=="function")return Ei(Ae,pe,Sd(Ee),Ke);if(Ee.$$typeof===D)return Ei(Ae,pe,wf(Ae,Ee),Ke);Nf(Ae,Ee)}return typeof Ee=="string"&&Ee!==""||typeof Ee=="number"||typeof Ee=="bigint"?(Ee=""+Ee,pe!==null&&pe.tag===6?(f(Ae,pe.sibling),Ke=A(pe,Ee),Ke.return=Ae,Ae=Ke):(f(Ae,pe),Ke=md(Ee,Ae.mode,Ke),Ke.return=Ae,Ae=Ke),U(Ae)):f(Ae,pe)}return function(Ae,pe,Ee,Ke){try{hl=0;var un=Ei(Ae,pe,Ee,Ke);return fl=null,un}catch(tn){if(tn===ul||tn===Er)throw tn;var di=os(29,tn,null,Ae.mode);return di.lanes=Ke,di.return=Ae,di}}}var tc=au(!0),Y_=au(!1),dl=!1;function Gm(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function zm(a,r){a=a.updateQueue,r.updateQueue===a&&(r.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function qr(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function To(a,r,f){var m=a.updateQueue;if(m===null)return null;if(m=m.shared,(jn&2)!==0){var A=m.pending;return A===null?r.next=r:(r.next=A.next,A.next=r),m.pending=r,r=$c(a),pd(a,null,f),r}return bf(a,m,r,f),$c(a)}function pl(a,r,f){if(r=r.updateQueue,r!==null&&(r=r.shared,(f&4194048)!==0)){var m=r.lanes;m&=a.pendingLanes,f|=m,r.lanes=f,fa(a,f)}}function Md(a,r){var f=a.updateQueue,m=a.alternate;if(m!==null&&(m=m.updateQueue,f===m)){var A=null,E=null;if(f=f.firstBaseUpdate,f!==null){do{var U={lane:f.lane,tag:f.tag,payload:f.payload,callback:null,next:null};E===null?A=E=U:E=E.next=U,f=f.next}while(f!==null);E===null?A=E=r:E=E.next=r}else A=E=r;f={baseState:m.baseState,firstBaseUpdate:A,lastBaseUpdate:E,shared:m.shared,callbacks:m.callbacks},a.updateQueue=f;return}a=f.lastBaseUpdate,a===null?f.firstBaseUpdate=r:a.next=r,f.lastBaseUpdate=r}var Vm=!1;function Uf(){if(Vm){var a=br;if(a!==null)throw a}}function nc(a,r,f,m){Vm=!1;var A=a.updateQueue;dl=!1;var E=A.firstBaseUpdate,U=A.lastBaseUpdate,X=A.shared.pending;if(X!==null){A.shared.pending=null;var re=X,Te=re.next;re.next=null,U===null?E=Te:U.next=Te,U=re;var ke=a.alternate;ke!==null&&(ke=ke.updateQueue,X=ke.lastBaseUpdate,X!==U&&(X===null?ke.firstBaseUpdate=Te:X.next=Te,ke.lastBaseUpdate=re))}if(E!==null){var $e=A.baseState;U=0,ke=Te=re=null,X=E;do{var De=X.lane&-536870913,Ge=De!==X.lane;if(Ge?(Vn&De)===De:(m&De)===De){De!==0&&De===Eo&&(Vm=!0),ke!==null&&(ke=ke.next={lane:0,tag:X.tag,payload:X.payload,callback:null,next:null});e:{var Zt=a,pn=X;De=r;var Ei=f;switch(pn.tag){case 1:if(Zt=pn.payload,typeof Zt=="function"){$e=Zt.call(Ei,$e,De);break e}$e=Zt;break e;case 3:Zt.flags=Zt.flags&-65537|128;case 0:if(Zt=pn.payload,De=typeof Zt=="function"?Zt.call(Ei,$e,De):Zt,De==null)break e;$e=v({},$e,De);break e;case 2:dl=!0}}De=X.callback,De!==null&&(a.flags|=64,Ge&&(a.flags|=8192),Ge=A.callbacks,Ge===null?A.callbacks=[De]:Ge.push(De))}else Ge={lane:De,tag:X.tag,payload:X.payload,callback:X.callback,next:null},ke===null?(Te=ke=Ge,re=$e):ke=ke.next=Ge,U|=De;if(X=X.next,X===null){if(X=A.shared.pending,X===null)break;Ge=X,X=Ge.next,Ge.next=null,A.lastBaseUpdate=Ge,A.shared.pending=null}}while(!0);ke===null&&(re=$e),A.baseState=re,A.firstBaseUpdate=Te,A.lastBaseUpdate=ke,E===null&&(A.shared.lanes=0),Ws|=U,a.lanes=U,a.memoizedState=$e}}function Kr(a,r){if(typeof a!="function")throw Error(n(191,a));a.call(r)}function Ga(a,r){var f=a.callbacks;if(f!==null)for(a.callbacks=null,a=0;a<f.length;a++)Kr(f[a],r)}var Ps=W(null),cs=W(0);function km(a,r){a=aa,Me(cs,a),Me(Ps,r),aa=a|r.baseLanes}function Xm(){Me(cs,aa),Me(Ps,Ps.current)}function es(){aa=cs.current,ae(Ps),ae(cs)}var xa=W(null),sr=null;function ml(a){var r=a.alternate;Me(Xi,Xi.current&1),Me(xa,a),sr===null&&(r===null||Ps.current!==null||r.memoizedState!==null)&&(sr=a)}function Ym(a){Me(Xi,Xi.current),Me(xa,a),sr===null&&(sr=a)}function J_(a){a.tag===22?(Me(Xi,Xi.current),Me(xa,a),sr===null&&(sr=a)):Co()}function Co(){Me(Xi,Xi.current),Me(xa,xa.current)}function Gs(a){ae(xa),sr===a&&(sr=null),ae(Xi)}var Xi=W(0);function bd(a){for(var r=a;r!==null;){if(r.tag===13){var f=r.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||mM(f)||gM(f)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===a)break;for(;r.sibling===null;){if(r.return===null||r.return===a)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var As=0,gn=null,yi=null,da=null,Ed=!1,Wr=!1,ic=!1,Td=0,Of=0,jr=null,qS=0;function Yi(){throw Error(n(321))}function Jm(a,r){if(r===null)return!1;for(var f=0;f<r.length&&f<a.length;f++)if(!Bi(a[f],r[f]))return!1;return!0}function qm(a,r,f,m,A,E){return As=E,gn=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,H.H=a===null||a.memoizedState===null?hy:ou,ic=!1,E=f(m,A),ic=!1,Wr&&(E=K_(r,f,m,A)),q_(a),E}function q_(a){H.H=Gf;var r=yi!==null&&yi.next!==null;if(As=0,da=yi=gn=null,Ed=!1,Of=0,jr=null,r)throw Error(n(300));a===null||Di||(a=a.dependencies,a!==null&&tu(a)&&(Di=!0))}function K_(a,r,f,m){gn=a;var A=0;do{if(Wr&&(jr=null),Of=0,Wr=!1,25<=A)throw Error(n(301));if(A+=1,da=yi=null,a.updateQueue!=null){var E=a.updateQueue;E.lastEffect=null,E.events=null,E.stores=null,E.memoCache!=null&&(E.memoCache.index=0)}H.H=zf,E=r(f,m)}while(Wr);return E}function KS(){var a=H.H,r=a.useState()[0];return r=typeof r.then=="function"?Ff(r):r,a=a.useState()[0],(yi!==null?yi.memoizedState:null)!==a&&(gn.flags|=1024),r}function Km(){var a=Td!==0;return Td=0,a}function Wm(a,r,f){r.updateQueue=a.updateQueue,r.flags&=-2053,a.lanes&=~f}function jm(a){if(Ed){for(a=a.memoizedState;a!==null;){var r=a.queue;r!==null&&(r.pending=null),a=a.next}Ed=!1}As=0,da=yi=gn=null,Wr=!1,Of=Td=0,jr=null}function us(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return da===null?gn.memoizedState=da=a:da=da.next=a,da}function ea(){if(yi===null){var a=gn.alternate;a=a!==null?a.memoizedState:null}else a=yi.next;var r=da===null?gn.memoizedState:da.next;if(r!==null)da=r,yi=a;else{if(a===null)throw gn.alternate===null?Error(n(467)):Error(n(310));yi=a,a={memoizedState:yi.memoizedState,baseState:yi.baseState,baseQueue:yi.baseQueue,queue:yi.queue,next:null},da===null?gn.memoizedState=da=a:da=da.next=a}return da}function If(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ff(a){var r=Of;return Of+=1,jr===null&&(jr=[]),a=Hm(jr,a,r),r=gn,(da===null?r.memoizedState:da.next)===null&&(r=r.alternate,H.H=r===null||r.memoizedState===null?hy:ou),a}function Cd(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return Ff(a);if(a.$$typeof===D)return wa(a)}throw Error(n(438,String(a)))}function Zm(a){var r=null,f=gn.updateQueue;if(f!==null&&(r=f.memoCache),r==null){var m=gn.alternate;m!==null&&(m=m.updateQueue,m!==null&&(m=m.memoCache,m!=null&&(r={data:m.data.map(function(A){return A.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),f===null&&(f=If(),gn.updateQueue=f),f.memoCache=r,f=r.data[r.index],f===void 0)for(f=r.data[r.index]=Array(a),m=0;m<a;m++)f[m]=F;return r.index++,f}function Ro(a,r){return typeof r=="function"?r(a):r}function Rd(a){var r=ea();return Qm(r,yi,a)}function Qm(a,r,f){var m=a.queue;if(m===null)throw Error(n(311));m.lastRenderedReducer=f;var A=a.baseQueue,E=m.pending;if(E!==null){if(A!==null){var U=A.next;A.next=E.next,E.next=U}r.baseQueue=A=E,m.pending=null}if(E=a.baseState,A===null)a.memoizedState=E;else{r=A.next;var X=U=null,re=null,Te=r,ke=!1;do{var $e=Te.lane&-536870913;if($e!==Te.lane?(Vn&$e)===$e:(As&$e)===$e){var De=Te.revertLane;if(De===0)re!==null&&(re=re.next={lane:0,revertLane:0,gesture:null,action:Te.action,hasEagerState:Te.hasEagerState,eagerState:Te.eagerState,next:null}),$e===Eo&&(ke=!0);else if((As&De)===De){Te=Te.next,De===Eo&&(ke=!0);continue}else $e={lane:0,revertLane:Te.revertLane,gesture:null,action:Te.action,hasEagerState:Te.hasEagerState,eagerState:Te.eagerState,next:null},re===null?(X=re=$e,U=E):re=re.next=$e,gn.lanes|=De,Ws|=De;$e=Te.action,ic&&f(E,$e),E=Te.hasEagerState?Te.eagerState:f(E,$e)}else De={lane:$e,revertLane:Te.revertLane,gesture:Te.gesture,action:Te.action,hasEagerState:Te.hasEagerState,eagerState:Te.eagerState,next:null},re===null?(X=re=De,U=E):re=re.next=De,gn.lanes|=$e,Ws|=$e;Te=Te.next}while(Te!==null&&Te!==r);if(re===null?U=E:re.next=X,!Bi(E,a.memoizedState)&&(Di=!0,ke&&(f=br,f!==null)))throw f;a.memoizedState=E,a.baseState=U,a.baseQueue=re,m.lastRenderedState=E}return A===null&&(m.lanes=0),[a.memoizedState,m.dispatch]}function wd(a){var r=ea(),f=r.queue;if(f===null)throw Error(n(311));f.lastRenderedReducer=a;var m=f.dispatch,A=f.pending,E=r.memoizedState;if(A!==null){f.pending=null;var U=A=A.next;do E=a(E,U.action),U=U.next;while(U!==A);Bi(E,r.memoizedState)||(Di=!0),r.memoizedState=E,r.baseQueue===null&&(r.baseState=E),f.lastRenderedState=E}return[E,m]}function $m(a,r,f){var m=gn,A=ea(),E=Jn;if(E){if(f===void 0)throw Error(n(407));f=f()}else f=r();var U=!Bi((yi||A).memoizedState,f);if(U&&(A.memoizedState=f,Di=!0),A=A.queue,ag(tg.bind(null,m,A,a),[a]),A.getSnapshot!==r||U||da!==null&&da.memoizedState.tag&1){if(m.flags|=2048,su(9,{destroy:void 0},eg.bind(null,m,A,f,r),null),fi===null)throw Error(n(349));E||(As&127)!==0||W_(m,r,f)}return f}function W_(a,r,f){a.flags|=16384,a={getSnapshot:r,value:f},r=gn.updateQueue,r===null?(r=If(),gn.updateQueue=r,r.stores=[a]):(f=r.stores,f===null?r.stores=[a]:f.push(a))}function eg(a,r,f,m){r.value=f,r.getSnapshot=m,ng(r)&&Bd(a)}function tg(a,r,f){return f(function(){ng(r)&&Bd(a)})}function ng(a){var r=a.getSnapshot;a=a.value;try{var f=r();return!Bi(a,f)}catch{return!0}}function Bd(a){var r=sl(a,2);r!==null&&u(r,a,2)}function Hf(a){var r=us();if(typeof a=="function"){var f=a;if(a=f(),ic){Tt(!0);try{f()}finally{Tt(!1)}}}return r.memoizedState=r.baseState=a,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ro,lastRenderedState:a},r}function j_(a,r,f,m){return a.baseState=f,Qm(a,yi,typeof m=="function"?m:Ro)}function WS(a,r,f,m,A){if(wo(a))throw Error(n(485));if(a=r.action,a!==null){var E={payload:A,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(U){E.listeners.push(U)}};H.T!==null?f(!0):E.isTransition=!1,m(E),f=r.pending,f===null?(E.next=r.pending=E,Z_(r,E)):(E.next=f.next,r.pending=f.next=E)}}function Z_(a,r){var f=r.action,m=r.payload,A=a.state;if(r.isTransition){var E=H.T,U={};H.T=U;try{var X=f(A,m),re=H.S;re!==null&&re(U,X),Q_(a,r,X)}catch(Te){Dd(a,r,Te)}finally{E!==null&&U.types!==null&&(E.types=U.types),H.T=E}}else try{E=f(A,m),Q_(a,r,E)}catch(Te){Dd(a,r,Te)}}function Q_(a,r,f){f!==null&&typeof f=="object"&&typeof f.then=="function"?f.then(function(m){ig(a,r,m)},function(m){return Dd(a,r,m)}):ig(a,r,f)}function ig(a,r,f){r.status="fulfilled",r.value=f,$_(r),a.state=f,r=a.pending,r!==null&&(f=r.next,f===r?a.pending=null:(f=f.next,r.next=f,Z_(a,f)))}function Dd(a,r,f){var m=a.pending;if(a.pending=null,m!==null){m=m.next;do r.status="rejected",r.reason=f,$_(r),r=r.next;while(r!==m)}a.action=null}function $_(a){a=a.listeners;for(var r=0;r<a.length;r++)(0,a[r])()}function ey(a,r){return r}function ty(a,r){if(Jn){var f=fi.formState;if(f!==null){e:{var m=gn;if(Jn){if(Si){t:{for(var A=Si,E=Ra;A.nodeType!==8;){if(!E){A=null;break t}if(A=no(A.nextSibling),A===null){A=null;break t}}E=A.data,A=E==="F!"||E==="F"?A:null}if(A){Si=no(A.nextSibling),m=A.data==="F!";break e}}zn(m)}m=!1}m&&(r=f[0])}}return f=us(),f.memoizedState=f.baseState=r,m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ey,lastRenderedState:r},f.queue=m,f=fy.bind(null,gn,m),m.dispatch=f,m=Hf(!1),E=Pf.bind(null,gn,!1,m.queue),m=us(),A={state:r,dispatch:null,action:a,pending:null},m.queue=A,f=WS.bind(null,gn,A,E,f),A.dispatch=f,m.memoizedState=a,[r,f,!1]}function ny(a){var r=ea();return iy(r,yi,a)}function iy(a,r,f){if(r=Qm(a,r,ey)[0],a=Rd(Ro)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var m=Ff(r)}catch(U){throw U===ul?Er:U}else m=r;r=ea();var A=r.queue,E=A.dispatch;return f!==r.memoizedState&&(gn.flags|=2048,su(9,{destroy:void 0},jS.bind(null,A,f),null)),[m,E,a]}function jS(a,r){a.action=r}function ay(a){var r=ea(),f=yi;if(f!==null)return iy(r,f,a);ea(),r=r.memoizedState,f=ea();var m=f.queue.dispatch;return f.memoizedState=a,[r,m,!1]}function su(a,r,f,m){return a={tag:a,create:f,deps:m,inst:r,next:null},r=gn.updateQueue,r===null&&(r=If(),gn.updateQueue=r),f=r.lastEffect,f===null?r.lastEffect=a.next=a:(m=f.next,f.next=a,a.next=m,r.lastEffect=a),a}function sy(){return ea().memoizedState}function Ld(a,r,f,m){var A=us();gn.flags|=a,A.memoizedState=su(1|r,{destroy:void 0},f,m===void 0?null:m)}function Nd(a,r,f,m){var A=ea();m=m===void 0?null:m;var E=A.memoizedState.inst;yi!==null&&m!==null&&Jm(m,yi.memoizedState.deps)?A.memoizedState=su(r,E,f,m):(gn.flags|=a,A.memoizedState=su(1|r,E,f,m))}function ry(a,r){Ld(8390656,8,a,r)}function ag(a,r){Nd(2048,8,a,r)}function oy(a){gn.flags|=4;var r=gn.updateQueue;if(r===null)r=If(),gn.updateQueue=r,r.events=[a];else{var f=r.events;f===null?r.events=[a]:f.push(a)}}function ly(a){var r=ea().memoizedState;return oy({ref:r,nextImpl:a}),function(){if((jn&2)!==0)throw Error(n(440));return r.impl.apply(void 0,arguments)}}function cy(a,r){return Nd(4,2,a,r)}function zs(a,r){return Nd(4,4,a,r)}function sg(a,r){if(typeof r=="function"){a=a();var f=r(a);return function(){typeof f=="function"?f():r(null)}}if(r!=null)return a=a(),r.current=a,function(){r.current=null}}function Ud(a,r,f){f=f!=null?f.concat([a]):null,Nd(4,4,sg.bind(null,r,a),f)}function Od(){}function rg(a,r){var f=ea();r=r===void 0?null:r;var m=f.memoizedState;return r!==null&&Jm(r,m[1])?m[0]:(f.memoizedState=[a,r],a)}function og(a,r){var f=ea();r=r===void 0?null:r;var m=f.memoizedState;if(r!==null&&Jm(r,m[1]))return m[0];if(m=a(),ic){Tt(!0);try{a()}finally{Tt(!1)}}return f.memoizedState=[m,r],m}function lg(a,r,f){return f===void 0||(As&1073741824)!==0&&(Vn&261930)===0?a.memoizedState=r:(a.memoizedState=f,a=c(),gn.lanes|=a,Ws|=a,f)}function cg(a,r,f,m){return Bi(f,r)?f:Ps.current!==null?(a=lg(a,f,m),Bi(a,r)||(Di=!0),a):(As&42)===0||(As&1073741824)!==0&&(Vn&261930)===0?(Di=!0,a.memoizedState=f):(a=c(),gn.lanes|=a,Ws|=a,r)}function ug(a,r,f,m,A){var E=Y.p;Y.p=E!==0&&8>E?E:8;var U=H.T,X={};H.T=X,Pf(a,!1,r,f);try{var re=A(),Te=H.S;if(Te!==null&&Te(X,re),re!==null&&typeof re=="object"&&typeof re.then=="function"){var ke=Fm(re,m);ru(a,r,ke,hs(a))}else ru(a,r,m,hs(a))}catch($e){ru(a,r,{then:function(){},status:"rejected",reason:$e},hs())}finally{Y.p=E,U!==null&&X.types!==null&&(U.types=X.types),H.T=U}}function ZS(){}function fg(a,r,f,m){if(a.tag!==5)throw Error(n(476));var A=uy(a).queue;ug(a,A,r,$,f===null?ZS:function(){return hg(a),f(m)})}function uy(a){var r=a.memoizedState;if(r!==null)return r;r={memoizedState:$,baseState:$,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ro,lastRenderedState:$},next:null};var f={};return r.next={memoizedState:f,baseState:f,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ro,lastRenderedState:f},next:null},a.memoizedState=r,a=a.alternate,a!==null&&(a.memoizedState=r),r}function hg(a){var r=uy(a);r.next===null&&(r=a.alternate.memoizedState),ru(a,r.next.queue,{},hs())}function dg(){return wa(Tg)}function za(){return ea().memoizedState}function pg(){return ea().memoizedState}function QS(a){for(var r=a.return;r!==null;){switch(r.tag){case 24:case 3:var f=hs();a=qr(f);var m=To(r,a,f);m!==null&&(u(m,r,f),pl(m,r,f)),r={cache:Um()},a.payload=r;return}r=r.return}}function $S(a,r,f){var m=hs();f={lane:m,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},wo(a)?ac(r,f):(f=Qc(a,r,f,m),f!==null&&(u(f,a,m),Ss(f,r,m)))}function fy(a,r,f){var m=hs();ru(a,r,f,m)}function ru(a,r,f,m){var A={lane:m,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null};if(wo(a))ac(r,A);else{var E=a.alternate;if(a.lanes===0&&(E===null||E.lanes===0)&&(E=r.lastRenderedReducer,E!==null))try{var U=r.lastRenderedState,X=E(U,f);if(A.hasEagerState=!0,A.eagerState=X,Bi(X,U))return bf(a,r,A,0),fi===null&&al(),!1}catch{}if(f=Qc(a,r,A,m),f!==null)return u(f,a,m),Ss(f,r,m),!0}return!1}function Pf(a,r,f,m){if(m={lane:2,revertLane:iM(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},wo(a)){if(r)throw Error(n(479))}else r=Qc(a,f,m,2),r!==null&&u(r,a,2)}function wo(a){var r=a.alternate;return a===gn||r!==null&&r===gn}function ac(a,r){Wr=Ed=!0;var f=a.pending;f===null?r.next=r:(r.next=f.next,f.next=r),a.pending=r}function Ss(a,r,f){if((f&4194048)!==0){var m=r.lanes;m&=a.pendingLanes,f|=m,r.lanes=f,fa(a,f)}}var Gf={readContext:wa,use:Cd,useCallback:Yi,useContext:Yi,useEffect:Yi,useImperativeHandle:Yi,useLayoutEffect:Yi,useInsertionEffect:Yi,useMemo:Yi,useReducer:Yi,useRef:Yi,useState:Yi,useDebugValue:Yi,useDeferredValue:Yi,useTransition:Yi,useSyncExternalStore:Yi,useId:Yi,useHostTransitionStatus:Yi,useFormState:Yi,useActionState:Yi,useOptimistic:Yi,useMemoCache:Yi,useCacheRefresh:Yi};Gf.useEffectEvent=Yi;var hy={readContext:wa,use:Cd,useCallback:function(a,r){return us().memoizedState=[a,r===void 0?null:r],a},useContext:wa,useEffect:ry,useImperativeHandle:function(a,r,f){f=f!=null?f.concat([a]):null,Ld(4194308,4,sg.bind(null,r,a),f)},useLayoutEffect:function(a,r){return Ld(4194308,4,a,r)},useInsertionEffect:function(a,r){Ld(4,2,a,r)},useMemo:function(a,r){var f=us();r=r===void 0?null:r;var m=a();if(ic){Tt(!0);try{a()}finally{Tt(!1)}}return f.memoizedState=[m,r],m},useReducer:function(a,r,f){var m=us();if(f!==void 0){var A=f(r);if(ic){Tt(!0);try{f(r)}finally{Tt(!1)}}}else A=r;return m.memoizedState=m.baseState=A,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:A},m.queue=a,a=a.dispatch=$S.bind(null,gn,a),[m.memoizedState,a]},useRef:function(a){var r=us();return a={current:a},r.memoizedState=a},useState:function(a){a=Hf(a);var r=a.queue,f=fy.bind(null,gn,r);return r.dispatch=f,[a.memoizedState,f]},useDebugValue:Od,useDeferredValue:function(a,r){var f=us();return lg(f,a,r)},useTransition:function(){var a=Hf(!1);return a=ug.bind(null,gn,a.queue,!0,!1),us().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,r,f){var m=gn,A=us();if(Jn){if(f===void 0)throw Error(n(407));f=f()}else{if(f=r(),fi===null)throw Error(n(349));(Vn&127)!==0||W_(m,r,f)}A.memoizedState=f;var E={value:f,getSnapshot:r};return A.queue=E,ry(tg.bind(null,m,E,a),[a]),m.flags|=2048,su(9,{destroy:void 0},eg.bind(null,m,E,f,r),null),f},useId:function(){var a=us(),r=fi.identifierPrefix;if(Jn){var f=Yr,m=Xr;f=(m&~(1<<32-pt(m)-1)).toString(32)+f,r="_"+r+"R_"+f,f=Td++,0<f&&(r+="H"+f.toString(32)),r+="_"}else f=qS++,r="_"+r+"r_"+f.toString(32)+"_";return a.memoizedState=r},useHostTransitionStatus:dg,useFormState:ty,useActionState:ty,useOptimistic:function(a){var r=us();r.memoizedState=r.baseState=a;var f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=f,r=Pf.bind(null,gn,!0,f),f.dispatch=r,[a,r]},useMemoCache:Zm,useCacheRefresh:function(){return us().memoizedState=QS.bind(null,gn)},useEffectEvent:function(a){var r=us(),f={impl:a};return r.memoizedState=f,function(){if((jn&2)!==0)throw Error(n(440));return f.impl.apply(void 0,arguments)}}},ou={readContext:wa,use:Cd,useCallback:rg,useContext:wa,useEffect:ag,useImperativeHandle:Ud,useInsertionEffect:cy,useLayoutEffect:zs,useMemo:og,useReducer:Rd,useRef:sy,useState:function(){return Rd(Ro)},useDebugValue:Od,useDeferredValue:function(a,r){var f=ea();return cg(f,yi.memoizedState,a,r)},useTransition:function(){var a=Rd(Ro)[0],r=ea().memoizedState;return[typeof a=="boolean"?a:Ff(a),r]},useSyncExternalStore:$m,useId:za,useHostTransitionStatus:dg,useFormState:ny,useActionState:ny,useOptimistic:function(a,r){var f=ea();return j_(f,yi,a,r)},useMemoCache:Zm,useCacheRefresh:pg};ou.useEffectEvent=ly;var zf={readContext:wa,use:Cd,useCallback:rg,useContext:wa,useEffect:ag,useImperativeHandle:Ud,useInsertionEffect:cy,useLayoutEffect:zs,useMemo:og,useReducer:wd,useRef:sy,useState:function(){return wd(Ro)},useDebugValue:Od,useDeferredValue:function(a,r){var f=ea();return yi===null?lg(f,a,r):cg(f,yi.memoizedState,a,r)},useTransition:function(){var a=wd(Ro)[0],r=ea().memoizedState;return[typeof a=="boolean"?a:Ff(a),r]},useSyncExternalStore:$m,useId:za,useHostTransitionStatus:dg,useFormState:ay,useActionState:ay,useOptimistic:function(a,r){var f=ea();return yi!==null?j_(f,yi,a,r):(f.baseState=a,[a,f.queue.dispatch])},useMemoCache:Zm,useCacheRefresh:pg};zf.useEffectEvent=ly;function lu(a,r,f,m){r=a.memoizedState,f=f(m,r),f=f==null?r:v({},r,f),a.memoizedState=f,a.lanes===0&&(a.updateQueue.baseState=f)}var Vf={enqueueSetState:function(a,r,f){a=a._reactInternals;var m=hs(),A=qr(m);A.payload=r,f!=null&&(A.callback=f),r=To(a,A,m),r!==null&&(u(r,a,m),pl(r,a,m))},enqueueReplaceState:function(a,r,f){a=a._reactInternals;var m=hs(),A=qr(m);A.tag=1,A.payload=r,f!=null&&(A.callback=f),r=To(a,A,m),r!==null&&(u(r,a,m),pl(r,a,m))},enqueueForceUpdate:function(a,r){a=a._reactInternals;var f=hs(),m=qr(f);m.tag=2,r!=null&&(m.callback=r),r=To(a,m,f),r!==null&&(u(r,a,f),pl(r,a,f))}};function dy(a,r,f,m,A,E,U){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(m,E,U):r.prototype&&r.prototype.isPureReactComponent?!Jc(f,m)||!Jc(A,E):!0}function py(a,r,f,m){a=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(f,m),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(f,m),r.state!==a&&Vf.enqueueReplaceState(r,r.state,null)}function Va(a,r){var f=r;if("ref"in r){f={};for(var m in r)m!=="ref"&&(f[m]=r[m])}if(a=a.defaultProps){f===r&&(f=v({},f));for(var A in a)f[A]===void 0&&(f[A]=a[A])}return f}function mg(a){il(a)}function my(a){console.error(a)}function Id(a){il(a)}function Fd(a,r){try{var f=a.onUncaughtError;f(r.value,{componentStack:r.stack})}catch(m){setTimeout(function(){throw m})}}function gy(a,r,f){try{var m=a.onCaughtError;m(f.value,{componentStack:f.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(A){setTimeout(function(){throw A})}}function gg(a,r,f){return f=qr(f),f.tag=3,f.payload={element:null},f.callback=function(){Fd(a,r)},f}function cu(a){return a=qr(a),a.tag=3,a}function Ms(a,r,f,m){var A=f.type.getDerivedStateFromError;if(typeof A=="function"){var E=m.value;a.payload=function(){return A(E)},a.callback=function(){gy(r,f,m)}}var U=f.stateNode;U!==null&&typeof U.componentDidCatch=="function"&&(a.callback=function(){gy(r,f,m),typeof A!="function"&&(to===null?to=new Set([this]):to.add(this));var X=m.stack;this.componentDidCatch(m.value,{componentStack:X!==null?X:""})})}function Vs(a,r,f,m,A){if(f.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){if(r=f.alternate,r!==null&&ll(r,f,A,!0),f=xa.current,f!==null){switch(f.tag){case 31:case 13:return sr===null?An():f.alternate===null&&hi===0&&(hi=3),f.flags&=-257,f.flags|=65536,f.lanes=A,m===Df?f.flags|=16384:(r=f.updateQueue,r===null?f.updateQueue=new Set([m]):r.add(m),eM(a,m,A)),!1;case 22:return f.flags|=65536,m===Df?f.flags|=16384:(r=f.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([m])},f.updateQueue=r):(f=r.retryQueue,f===null?r.retryQueue=new Set([m]):f.add(m)),eM(a,m,A)),!1}throw Error(n(435,f.tag))}return eM(a,m,A),An(),!1}if(Jn)return r=xa.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=A,m!==vd&&(a=Error(n(422),{cause:m}),Rf(ys(a,f)))):(m!==vd&&(r=Error(n(423),{cause:m}),Rf(ys(r,f))),a=a.current.alternate,a.flags|=65536,A&=-A,a.lanes|=A,m=ys(m,f),A=gg(a.stateNode,m,A),Md(a,A),hi!==4&&(hi=2)),!1;var E=Error(n(520),{cause:m});if(E=ys(E,f),Br===null?Br=[E]:Br.push(E),hi!==4&&(hi=2),r===null)return!0;m=ys(m,f),f=r;do{switch(f.tag){case 3:return f.flags|=65536,a=A&-A,f.lanes|=a,a=gg(f.stateNode,m,a),Md(f,a),!1;case 1:if(r=f.type,E=f.stateNode,(f.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||E!==null&&typeof E.componentDidCatch=="function"&&(to===null||!to.has(E))))return f.flags|=65536,A&=-A,f.lanes|=A,A=cu(A),Ms(A,a,f,m),Md(f,A),!1}f=f.return}while(f!==null);return!1}var Hd=Error(n(461)),Di=!1;function Ji(a,r,f,m){r.child=a===null?Y_(r,null,f,m):tc(r,a.child,f,m)}function kf(a,r,f,m,A){f=f.render;var E=r.ref;if("ref"in m){var U={};for(var X in m)X!=="ref"&&(U[X]=m[X])}else U=m;return Ql(r),m=qm(a,r,f,U,E,A),X=Km(),a!==null&&!Di?(Wm(a,r,A),Rr(a,r,A)):(Jn&&X&&gd(r),r.flags|=1,Ji(a,r,m,A),r.child)}function Xf(a,r,f,m,A){if(a===null){var E=f.type;return typeof E=="function"&&!ls(E)&&E.defaultProps===void 0&&f.compare===null?(r.tag=15,r.type=E,ks(a,r,E,m,A)):(a=Ef(f.type,null,m,r,r.mode,A),a.ref=r.ref,a.return=r,r.child=a)}if(E=a.child,!vl(a,A)){var U=E.memoizedProps;if(f=f.compare,f=f!==null?f:Jc,f(U,m)&&a.ref===r.ref)return Rr(a,r,A)}return r.flags|=1,a=Vr(E,m),a.ref=r.ref,a.return=r,r.child=a}function ks(a,r,f,m,A){if(a!==null){var E=a.memoizedProps;if(Jc(E,m)&&a.ref===r.ref)if(Di=!1,r.pendingProps=m=E,vl(a,A))(a.flags&131072)!==0&&(Di=!0);else return r.lanes=a.lanes,Rr(a,r,A)}return uu(a,r,f,m,A)}function Xs(a,r,f,m){var A=m.children,E=a!==null?a.memoizedState:null;if(a===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),m.mode==="hidden"){if((r.flags&128)!==0){if(E=E!==null?E.baseLanes|f:f,a!==null){for(m=r.child=a.child,A=0;m!==null;)A=A|m.lanes|m.childLanes,m=m.sibling;m=A&~E}else m=0,r.child=null;return Zr(a,r,E,f,m)}if((f&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},a!==null&&iu(r,E!==null?E.cachePool:null),E!==null?km(r,E):Xm(),J_(r);else return m=r.lanes=536870912,Zr(a,r,E!==null?E.baseLanes|f:f,f,m)}else E!==null?(iu(r,E.cachePool),km(r,E),Co(),r.memoizedState=null):(a!==null&&iu(r,null),Xm(),Co());return Ji(a,r,A,f),r.child}function Tr(a,r){return a!==null&&a.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function Zr(a,r,f,m,A){var E=Jr();return E=E===null?null:{parent:sn._currentValue,pool:E},r.memoizedState={baseLanes:f,cachePool:E},a!==null&&iu(r,null),Xm(),J_(r),a!==null&&ll(a,r,m,!0),r.childLanes=A,null}function rr(a,r){return r=fu({mode:r.mode,children:r.children},a.mode),r.ref=a.ref,a.child=r,r.return=a,r}function Ba(a,r,f){return tc(r,a.child,null,f),a=rr(r,r.pendingProps),a.flags|=2,Gs(r),r.memoizedState=null,a}function Yf(a,r,f){var m=r.pendingProps,A=(r.flags&128)!==0;if(r.flags&=-129,a===null){if(Jn){if(m.mode==="hidden")return a=rr(r,m),r.lanes=536870912,Tr(null,a);if(Ym(r),(a=Si)?(a=ZC(a,Ra),a=a!==null&&a.data==="&"?a:null,a!==null&&(r.memoizedState={dehydrated:a,treeContext:kr!==null?{id:Xr,overflow:Yr}:null,retryLane:536870912,hydrationErrors:null},f=P_(a),f.return=r,r.child=f,Ca=r,Si=null)):a=null,a===null)throw zn(r);return r.lanes=536870912,null}return rr(r,m)}var E=a.memoizedState;if(E!==null){var U=E.dehydrated;if(Ym(r),A)if(r.flags&256)r.flags&=-257,r=Ba(a,r,f);else if(r.memoizedState!==null)r.child=a.child,r.flags|=128,r=null;else throw Error(n(558));else if(Di||ll(a,r,f,!1),A=(f&a.childLanes)!==0,Di||A){if(m=fi,m!==null&&(U=Ui(m,f),U!==0&&U!==E.retryLane))throw E.retryLane=U,sl(a,U),u(m,a,U),Hd;An(),r=Ba(a,r,f)}else a=E.treeContext,Si=no(U.nextSibling),Ca=r,Jn=!0,Ao=null,Ra=!1,a!==null&&Cf(r,a),r=rr(r,m),r.flags|=4096;return r}return a=Vr(a.child,{mode:m.mode,children:m.children}),a.ref=r.ref,r.child=a,a.return=r,a}function Cr(a,r){var f=r.ref;if(f===null)a!==null&&a.ref!==null&&(r.flags|=4194816);else{if(typeof f!="function"&&typeof f!="object")throw Error(n(284));(a===null||a.ref!==f)&&(r.flags|=4194816)}}function uu(a,r,f,m,A){return Ql(r),f=qm(a,r,f,m,void 0,A),m=Km(),a!==null&&!Di?(Wm(a,r,A),Rr(a,r,A)):(Jn&&m&&gd(r),r.flags|=1,Ji(a,r,f,A),r.child)}function ts(a,r,f,m,A,E){return Ql(r),r.updateQueue=null,f=K_(r,m,f,A),q_(a),m=Km(),a!==null&&!Di?(Wm(a,r,E),Rr(a,r,E)):(Jn&&m&&gd(r),r.flags|=1,Ji(a,r,f,E),r.child)}function ka(a,r,f,m,A){if(Ql(r),r.stateNode===null){var E=rl,U=f.contextType;typeof U=="object"&&U!==null&&(E=wa(U)),E=new f(m,E),r.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,E.updater=Vf,r.stateNode=E,E._reactInternals=r,E=r.stateNode,E.props=m,E.state=r.memoizedState,E.refs={},Gm(r),U=f.contextType,E.context=typeof U=="object"&&U!==null?wa(U):rl,E.state=r.memoizedState,U=f.getDerivedStateFromProps,typeof U=="function"&&(lu(r,f,U,m),E.state=r.memoizedState),typeof f.getDerivedStateFromProps=="function"||typeof E.getSnapshotBeforeUpdate=="function"||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(U=E.state,typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount(),U!==E.state&&Vf.enqueueReplaceState(E,E.state,null),nc(r,m,E,A),Uf(),E.state=r.memoizedState),typeof E.componentDidMount=="function"&&(r.flags|=4194308),m=!0}else if(a===null){E=r.stateNode;var X=r.memoizedProps,re=Va(f,X);E.props=re;var Te=E.context,ke=f.contextType;U=rl,typeof ke=="object"&&ke!==null&&(U=wa(ke));var $e=f.getDerivedStateFromProps;ke=typeof $e=="function"||typeof E.getSnapshotBeforeUpdate=="function",X=r.pendingProps!==X,ke||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(X||Te!==U)&&py(r,E,m,U),dl=!1;var De=r.memoizedState;E.state=De,nc(r,m,E,A),Uf(),Te=r.memoizedState,X||De!==Te||dl?(typeof $e=="function"&&(lu(r,f,$e,m),Te=r.memoizedState),(re=dl||dy(r,f,re,m,De,Te,U))?(ke||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount()),typeof E.componentDidMount=="function"&&(r.flags|=4194308)):(typeof E.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=m,r.memoizedState=Te),E.props=m,E.state=Te,E.context=U,m=re):(typeof E.componentDidMount=="function"&&(r.flags|=4194308),m=!1)}else{E=r.stateNode,zm(a,r),U=r.memoizedProps,ke=Va(f,U),E.props=ke,$e=r.pendingProps,De=E.context,Te=f.contextType,re=rl,typeof Te=="object"&&Te!==null&&(re=wa(Te)),X=f.getDerivedStateFromProps,(Te=typeof X=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(U!==$e||De!==re)&&py(r,E,m,re),dl=!1,De=r.memoizedState,E.state=De,nc(r,m,E,A),Uf();var Ge=r.memoizedState;U!==$e||De!==Ge||dl||a!==null&&a.dependencies!==null&&tu(a.dependencies)?(typeof X=="function"&&(lu(r,f,X,m),Ge=r.memoizedState),(ke=dl||dy(r,f,ke,m,De,Ge,re)||a!==null&&a.dependencies!==null&&tu(a.dependencies))?(Te||typeof E.UNSAFE_componentWillUpdate!="function"&&typeof E.componentWillUpdate!="function"||(typeof E.componentWillUpdate=="function"&&E.componentWillUpdate(m,Ge,re),typeof E.UNSAFE_componentWillUpdate=="function"&&E.UNSAFE_componentWillUpdate(m,Ge,re)),typeof E.componentDidUpdate=="function"&&(r.flags|=4),typeof E.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof E.componentDidUpdate!="function"||U===a.memoizedProps&&De===a.memoizedState||(r.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||U===a.memoizedProps&&De===a.memoizedState||(r.flags|=1024),r.memoizedProps=m,r.memoizedState=Ge),E.props=m,E.state=Ge,E.context=re,m=ke):(typeof E.componentDidUpdate!="function"||U===a.memoizedProps&&De===a.memoizedState||(r.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||U===a.memoizedProps&&De===a.memoizedState||(r.flags|=1024),m=!1)}return E=m,Cr(a,r),m=(r.flags&128)!==0,E||m?(E=r.stateNode,f=m&&typeof f.getDerivedStateFromError!="function"?null:E.render(),r.flags|=1,a!==null&&m?(r.child=tc(r,a.child,null,A),r.child=tc(r,null,f,A)):Ji(a,r,f,A),r.memoizedState=E.state,a=r.child):a=Rr(a,r,A),a}function ni(a,r,f,m){return Zl(),r.flags|=256,Ji(a,r,f,m),r.child}var Ys={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function or(a){return{baseLanes:a,cachePool:xd()}}function Jf(a,r,f){return a=a!==null?a.childLanes&~f:0,r&&(a|=Zn),a}function Js(a,r,f){var m=r.pendingProps,A=!1,E=(r.flags&128)!==0,U;if((U=E)||(U=a!==null&&a.memoizedState===null?!1:(Xi.current&2)!==0),U&&(A=!0,r.flags&=-129),U=(r.flags&32)!==0,r.flags&=-33,a===null){if(Jn){if(A?ml(r):Co(),(a=Si)?(a=ZC(a,Ra),a=a!==null&&a.data!=="&"?a:null,a!==null&&(r.memoizedState={dehydrated:a,treeContext:kr!==null?{id:Xr,overflow:Yr}:null,retryLane:536870912,hydrationErrors:null},f=P_(a),f.return=r,r.child=f,Ca=r,Si=null)):a=null,a===null)throw zn(r);return gM(a)?r.lanes=32:r.lanes=536870912,null}var X=m.children;return m=m.fallback,A?(Co(),A=r.mode,X=fu({mode:"hidden",children:X},A),m=yo(m,A,f,null),X.return=r,m.return=r,X.sibling=m,r.child=X,m=r.child,m.memoizedState=or(f),m.childLanes=Jf(a,U,f),r.memoizedState=Ys,Tr(null,m)):(ml(r),gl(r,X))}var re=a.memoizedState;if(re!==null&&(X=re.dehydrated,X!==null)){if(E)r.flags&256?(ml(r),r.flags&=-257,r=hu(a,r,f)):r.memoizedState!==null?(Co(),r.child=a.child,r.flags|=128,r=null):(Co(),X=m.fallback,A=r.mode,m=fu({mode:"visible",children:m.children},A),X=yo(X,A,f,null),X.flags|=2,m.return=r,X.return=r,m.sibling=X,r.child=m,tc(r,a.child,null,f),m=r.child,m.memoizedState=or(f),m.childLanes=Jf(a,U,f),r.memoizedState=Ys,r=Tr(null,m));else if(ml(r),gM(X)){if(U=X.nextSibling&&X.nextSibling.dataset,U)var Te=U.dgst;U=Te,m=Error(n(419)),m.stack="",m.digest=U,Rf({value:m,source:null,stack:null}),r=hu(a,r,f)}else if(Di||ll(a,r,f,!1),U=(f&a.childLanes)!==0,Di||U){if(U=fi,U!==null&&(m=Ui(U,f),m!==0&&m!==re.retryLane))throw re.retryLane=m,sl(a,m),u(U,a,m),Hd;mM(X)||An(),r=hu(a,r,f)}else mM(X)?(r.flags|=192,r.child=a.child,r=null):(a=re.treeContext,Si=no(X.nextSibling),Ca=r,Jn=!0,Ao=null,Ra=!1,a!==null&&Cf(r,a),r=gl(r,m.children),r.flags|=4096);return r}return A?(Co(),X=m.fallback,A=r.mode,re=a.child,Te=re.sibling,m=Vr(re,{mode:"hidden",children:m.children}),m.subtreeFlags=re.subtreeFlags&65011712,Te!==null?X=Vr(Te,X):(X=yo(X,A,f,null),X.flags|=2),X.return=r,m.return=r,m.sibling=X,r.child=m,Tr(null,m),m=r.child,X=a.child.memoizedState,X===null?X=or(f):(A=X.cachePool,A!==null?(re=sn._currentValue,A=A.parent!==re?{parent:re,pool:re}:A):A=xd(),X={baseLanes:X.baseLanes|f,cachePool:A}),m.memoizedState=X,m.childLanes=Jf(a,U,f),r.memoizedState=Ys,Tr(a.child,m)):(ml(r),f=a.child,a=f.sibling,f=Vr(f,{mode:"visible",children:m.children}),f.return=r,f.sibling=null,a!==null&&(U=r.deletions,U===null?(r.deletions=[a],r.flags|=16):U.push(a)),r.child=f,r.memoizedState=null,f)}function gl(a,r){return r=fu({mode:"visible",children:r},a.mode),r.return=a,a.child=r}function fu(a,r){return a=os(22,a,null,r),a.lanes=0,a}function hu(a,r,f){return tc(r,a.child,null,f),a=gl(r,r.pendingProps.children),a.flags|=2,r.memoizedState=null,a}function sc(a,r,f){a.lanes|=r;var m=a.alternate;m!==null&&(m.lanes|=r),bo(a.return,r,f)}function qf(a,r,f,m,A,E){var U=a.memoizedState;U===null?a.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:m,tail:f,tailMode:A,treeForkCount:E}:(U.isBackwards=r,U.rendering=null,U.renderingStartTime=0,U.last=m,U.tail=f,U.tailMode=A,U.treeForkCount=E)}function Kf(a,r,f){var m=r.pendingProps,A=m.revealOrder,E=m.tail;m=m.children;var U=Xi.current,X=(U&2)!==0;if(X?(U=U&1|2,r.flags|=128):U&=1,Me(Xi,U),Ji(a,r,m,f),m=Jn?eu:0,!X&&a!==null&&(a.flags&128)!==0)e:for(a=r.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&sc(a,f,r);else if(a.tag===19)sc(a,f,r);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===r)break e;for(;a.sibling===null;){if(a.return===null||a.return===r)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(A){case"forwards":for(f=r.child,A=null;f!==null;)a=f.alternate,a!==null&&bd(a)===null&&(A=f),f=f.sibling;f=A,f===null?(A=r.child,r.child=null):(A=f.sibling,f.sibling=null),qf(r,!1,A,f,E,m);break;case"backwards":case"unstable_legacy-backwards":for(f=null,A=r.child,r.child=null;A!==null;){if(a=A.alternate,a!==null&&bd(a)===null){r.child=A;break}a=A.sibling,A.sibling=f,f=A,A=a}qf(r,!0,f,null,E,m);break;case"together":qf(r,!1,null,null,void 0,m);break;default:r.memoizedState=null}return r.child}function Rr(a,r,f){if(a!==null&&(r.dependencies=a.dependencies),Ws|=r.lanes,(f&r.childLanes)===0)if(a!==null){if(ll(a,r,f,!1),(f&r.childLanes)===0)return null}else return null;if(a!==null&&r.child!==a.child)throw Error(n(153));if(r.child!==null){for(a=r.child,f=Vr(a,a.pendingProps),r.child=f,f.return=r;a.sibling!==null;)a=a.sibling,f=f.sibling=Vr(a,a.pendingProps),f.return=r;f.sibling=null}return r.child}function vl(a,r){return(a.lanes&r)!==0?!0:(a=a.dependencies,!!(a!==null&&tu(a)))}function Wf(a,r,f){switch(r.tag){case 3:tt(r,r.stateNode.containerInfo),Mo(r,sn,a.memoizedState.cache),Zl();break;case 27:case 5:wt(r);break;case 4:tt(r,r.stateNode.containerInfo);break;case 10:Mo(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,Ym(r),null;break;case 13:var m=r.memoizedState;if(m!==null)return m.dehydrated!==null?(ml(r),r.flags|=128,null):(f&r.child.childLanes)!==0?Js(a,r,f):(ml(r),a=Rr(a,r,f),a!==null?a.sibling:null);ml(r);break;case 19:var A=(a.flags&128)!==0;if(m=(f&r.childLanes)!==0,m||(ll(a,r,f,!1),m=(f&r.childLanes)!==0),A){if(m)return Kf(a,r,f);r.flags|=128}if(A=r.memoizedState,A!==null&&(A.rendering=null,A.tail=null,A.lastEffect=null),Me(Xi,Xi.current),m)break;return null;case 22:return r.lanes=0,Xs(a,r,f,r.pendingProps);case 24:Mo(r,sn,a.memoizedState.cache)}return Rr(a,r,f)}function Pd(a,r,f){if(a!==null)if(a.memoizedProps!==r.pendingProps)Di=!0;else{if(!vl(a,f)&&(r.flags&128)===0)return Di=!1,Wf(a,r,f);Di=(a.flags&131072)!==0}else Di=!1,Jn&&(r.flags&1048576)!==0&&wm(r,eu,r.index);switch(r.lanes=0,r.tag){case 16:e:{var m=r.pendingProps;if(a=ec(r.elementType),r.type=a,typeof a=="function")ls(a)?(m=Va(a,m),r.tag=1,r=ka(null,r,a,m,f)):(r.tag=0,r=uu(null,r,a,m,f));else{if(a!=null){var A=a.$$typeof;if(A===L){r.tag=11,r=kf(null,r,a,m,f);break e}else if(A===z){r.tag=14,r=Xf(null,r,a,m,f);break e}}throw r=ie(a)||a,Error(n(306,r,""))}}return r;case 0:return uu(a,r,r.type,r.pendingProps,f);case 1:return m=r.type,A=Va(m,r.pendingProps),ka(a,r,m,A,f);case 3:e:{if(tt(r,r.stateNode.containerInfo),a===null)throw Error(n(387));m=r.pendingProps;var E=r.memoizedState;A=E.element,zm(a,r),nc(r,m,null,f);var U=r.memoizedState;if(m=U.cache,Mo(r,sn,m),m!==E.cache&&yd(r,[sn],f,!0),Uf(),m=U.element,E.isDehydrated)if(E={element:m,isDehydrated:!1,cache:U.cache},r.updateQueue.baseState=E,r.memoizedState=E,r.flags&256){r=ni(a,r,m,f);break e}else if(m!==A){A=ys(Error(n(424)),r),Rf(A),r=ni(a,r,m,f);break e}else for(a=r.stateNode.containerInfo,a.nodeType===9?a=a.body:a=a.nodeName==="HTML"?a.ownerDocument.body:a,Si=no(a.firstChild),Ca=r,Jn=!0,Ao=null,Ra=!0,f=Y_(r,null,m,f),r.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling;else{if(Zl(),m===A){r=Rr(a,r,f);break e}Ji(a,r,m,f)}r=r.child}return r;case 26:return Cr(a,r),a===null?(f=iR(r.type,null,r.pendingProps,null))?r.memoizedState=f:Jn||(f=r.type,a=r.pendingProps,m=by(ve.current).createElement(f),m[fn]=r,m[G]=a,ds(m,f,a),k(m),r.stateNode=m):r.memoizedState=iR(r.type,a.memoizedProps,r.pendingProps,a.memoizedState),null;case 27:return wt(r),a===null&&Jn&&(m=r.stateNode=eR(r.type,r.pendingProps,ve.current),Ca=r,Ra=!0,A=Si,yu(r.type)?(vM=A,Si=no(m.firstChild)):Si=A),Ji(a,r,r.pendingProps.children,f),Cr(a,r),a===null&&(r.flags|=4194304),r.child;case 5:return a===null&&Jn&&((A=m=Si)&&(m=w4(m,r.type,r.pendingProps,Ra),m!==null?(r.stateNode=m,Ca=r,Si=no(m.firstChild),Ra=!1,A=!0):A=!1),A||zn(r)),wt(r),A=r.type,E=r.pendingProps,U=a!==null?a.memoizedProps:null,m=E.children,hM(A,E)?m=null:U!==null&&hM(A,U)&&(r.flags|=32),r.memoizedState!==null&&(A=qm(a,r,KS,null,null,f),Tg._currentValue=A),Cr(a,r),Ji(a,r,m,f),r.child;case 6:return a===null&&Jn&&((a=f=Si)&&(f=B4(f,r.pendingProps,Ra),f!==null?(r.stateNode=f,Ca=r,Si=null,a=!0):a=!1),a||zn(r)),null;case 13:return Js(a,r,f);case 4:return tt(r,r.stateNode.containerInfo),m=r.pendingProps,a===null?r.child=tc(r,null,m,f):Ji(a,r,m,f),r.child;case 11:return kf(a,r,r.type,r.pendingProps,f);case 7:return Ji(a,r,r.pendingProps,f),r.child;case 8:return Ji(a,r,r.pendingProps.children,f),r.child;case 12:return Ji(a,r,r.pendingProps.children,f),r.child;case 10:return m=r.pendingProps,Mo(r,r.type,m.value),Ji(a,r,m.children,f),r.child;case 9:return A=r.type._context,m=r.pendingProps.children,Ql(r),A=wa(A),m=m(A),r.flags|=1,Ji(a,r,m,f),r.child;case 14:return Xf(a,r,r.type,r.pendingProps,f);case 15:return ks(a,r,r.type,r.pendingProps,f);case 19:return Kf(a,r,f);case 31:return Yf(a,r,f);case 22:return Xs(a,r,f,r.pendingProps);case 24:return Ql(r),m=wa(sn),a===null?(A=Jr(),A===null&&(A=fi,E=Um(),A.pooledCache=E,E.refCount++,E!==null&&(A.pooledCacheLanes|=f),A=E),r.memoizedState={parent:m,cache:A},Gm(r),Mo(r,sn,A)):((a.lanes&f)!==0&&(zm(a,r),nc(r,null,null,f),Uf()),A=a.memoizedState,E=r.memoizedState,A.parent!==m?(A={parent:m,cache:m},r.memoizedState=A,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=A),Mo(r,sn,m)):(m=E.cache,Mo(r,sn,m),m!==A.cache&&yd(r,[sn],f,!0))),Ji(a,r,r.pendingProps.children,f),r.child;case 29:throw r.pendingProps}throw Error(n(156,r.tag))}function bs(a){a.flags|=4}function _l(a,r,f,m,A){if((r=(a.mode&32)!==0)&&(r=!1),r){if(a.flags|=16777216,(A&335544128)===A)if(a.stateNode.complete)a.flags|=8192;else if(Mt())a.flags|=8192;else throw hn=Df,Bf}else a.flags&=-16777217}function Bo(a,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!lR(r))if(Mt())a.flags|=8192;else throw hn=Df,Bf}function du(a,r){r!==null&&(a.flags|=4),a.flags&16384&&(r=a.tag!==22?Mn():536870912,a.lanes|=r,js|=r)}function jf(a,r){if(!Jn)switch(a.tailMode){case"hidden":r=a.tail;for(var f=null;r!==null;)r.alternate!==null&&(f=r),r=r.sibling;f===null?a.tail=null:f.sibling=null;break;case"collapsed":f=a.tail;for(var m=null;f!==null;)f.alternate!==null&&(m=f),f=f.sibling;m===null?r||a.tail===null?a.tail=null:a.tail.sibling=null:m.sibling=null}}function mi(a){var r=a.alternate!==null&&a.alternate.child===a.child,f=0,m=0;if(r)for(var A=a.child;A!==null;)f|=A.lanes|A.childLanes,m|=A.subtreeFlags&65011712,m|=A.flags&65011712,A.return=a,A=A.sibling;else for(A=a.child;A!==null;)f|=A.lanes|A.childLanes,m|=A.subtreeFlags,m|=A.flags,A.return=a,A=A.sibling;return a.subtreeFlags|=m,a.childLanes=f,r}function vg(a,r,f){var m=r.pendingProps;switch(ol(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return mi(r),null;case 1:return mi(r),null;case 3:return f=r.stateNode,m=null,a!==null&&(m=a.memoizedState.cache),r.memoizedState.cache!==m&&(r.flags|=2048),ar(sn),Et(),f.pendingContext&&(f.context=f.pendingContext,f.pendingContext=null),(a===null||a.child===null)&&(jl(r)?bs(r):a===null||a.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,Bm())),mi(r),null;case 26:var A=r.type,E=r.memoizedState;return a===null?(bs(r),E!==null?(mi(r),Bo(r,E)):(mi(r),_l(r,A,null,m,f))):E?E!==a.memoizedState?(bs(r),mi(r),Bo(r,E)):(mi(r),r.flags&=-16777217):(a=a.memoizedProps,a!==m&&bs(r),mi(r),_l(r,A,a,m,f)),null;case 27:if(on(r),f=ve.current,A=r.type,a!==null&&r.stateNode!=null)a.memoizedProps!==m&&bs(r);else{if(!m){if(r.stateNode===null)throw Error(n(166));return mi(r),null}a=Ne.current,jl(r)?_d(r):(a=eR(A,m,f),r.stateNode=a,bs(r))}return mi(r),null;case 5:if(on(r),A=r.type,a!==null&&r.stateNode!=null)a.memoizedProps!==m&&bs(r);else{if(!m){if(r.stateNode===null)throw Error(n(166));return mi(r),null}if(E=Ne.current,jl(r))_d(r);else{var U=by(ve.current);switch(E){case 1:E=U.createElementNS("http://www.w3.org/2000/svg",A);break;case 2:E=U.createElementNS("http://www.w3.org/1998/Math/MathML",A);break;default:switch(A){case"svg":E=U.createElementNS("http://www.w3.org/2000/svg",A);break;case"math":E=U.createElementNS("http://www.w3.org/1998/Math/MathML",A);break;case"script":E=U.createElement("div"),E.innerHTML="<script><\/script>",E=E.removeChild(E.firstChild);break;case"select":E=typeof m.is=="string"?U.createElement("select",{is:m.is}):U.createElement("select"),m.multiple?E.multiple=!0:m.size&&(E.size=m.size);break;default:E=typeof m.is=="string"?U.createElement(A,{is:m.is}):U.createElement(A)}}E[fn]=r,E[G]=m;e:for(U=r.child;U!==null;){if(U.tag===5||U.tag===6)E.appendChild(U.stateNode);else if(U.tag!==4&&U.tag!==27&&U.child!==null){U.child.return=U,U=U.child;continue}if(U===r)break e;for(;U.sibling===null;){if(U.return===null||U.return===r)break e;U=U.return}U.sibling.return=U.return,U=U.sibling}r.stateNode=E;e:switch(ds(E,A,m),A){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}m&&bs(r)}}return mi(r),_l(r,r.type,a===null?null:a.memoizedProps,r.pendingProps,f),null;case 6:if(a&&r.stateNode!=null)a.memoizedProps!==m&&bs(r);else{if(typeof m!="string"&&r.stateNode===null)throw Error(n(166));if(a=ve.current,jl(r)){if(a=r.stateNode,f=r.memoizedProps,m=null,A=Ca,A!==null)switch(A.tag){case 27:case 5:m=A.memoizedProps}a[fn]=r,a=!!(a.nodeValue===f||m!==null&&m.suppressHydrationWarning===!0||kC(a.nodeValue,f)),a||zn(r,!0)}else a=by(a).createTextNode(m),a[fn]=r,r.stateNode=a}return mi(r),null;case 31:if(f=r.memoizedState,a===null||a.memoizedState!==null){if(m=jl(r),f!==null){if(a===null){if(!m)throw Error(n(318));if(a=r.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(n(557));a[fn]=r}else Zl(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;mi(r),a=!1}else f=Bm(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=f),a=!0;if(!a)return r.flags&256?(Gs(r),r):(Gs(r),null);if((r.flags&128)!==0)throw Error(n(558))}return mi(r),null;case 13:if(m=r.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(A=jl(r),m!==null&&m.dehydrated!==null){if(a===null){if(!A)throw Error(n(318));if(A=r.memoizedState,A=A!==null?A.dehydrated:null,!A)throw Error(n(317));A[fn]=r}else Zl(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;mi(r),A=!1}else A=Bm(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=A),A=!0;if(!A)return r.flags&256?(Gs(r),r):(Gs(r),null)}return Gs(r),(r.flags&128)!==0?(r.lanes=f,r):(f=m!==null,a=a!==null&&a.memoizedState!==null,f&&(m=r.child,A=null,m.alternate!==null&&m.alternate.memoizedState!==null&&m.alternate.memoizedState.cachePool!==null&&(A=m.alternate.memoizedState.cachePool.pool),E=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(E=m.memoizedState.cachePool.pool),E!==A&&(m.flags|=2048)),f!==a&&f&&(r.child.flags|=8192),du(r,r.updateQueue),mi(r),null);case 4:return Et(),a===null&&oM(r.stateNode.containerInfo),mi(r),null;case 10:return ar(r.type),mi(r),null;case 19:if(ae(Xi),m=r.memoizedState,m===null)return mi(r),null;if(A=(r.flags&128)!==0,E=m.rendering,E===null)if(A)jf(m,!1);else{if(hi!==0||a!==null&&(a.flags&128)!==0)for(a=r.child;a!==null;){if(E=bd(a),E!==null){for(r.flags|=128,jf(m,!1),a=E.updateQueue,r.updateQueue=a,du(r,a),r.subtreeFlags=0,a=f,f=r.child;f!==null;)Qa(f,a),f=f.sibling;return Me(Xi,Xi.current&1|2),Jn&&xo(r,m.treeForkCount),r.child}a=a.sibling}m.tail!==null&&I()>Zs&&(r.flags|=128,A=!0,jf(m,!1),r.lanes=4194304)}else{if(!A)if(a=bd(E),a!==null){if(r.flags|=128,A=!0,a=a.updateQueue,r.updateQueue=a,du(r,a),jf(m,!0),m.tail===null&&m.tailMode==="hidden"&&!E.alternate&&!Jn)return mi(r),null}else 2*I()-m.renderingStartTime>Zs&&f!==536870912&&(r.flags|=128,A=!0,jf(m,!1),r.lanes=4194304);m.isBackwards?(E.sibling=r.child,r.child=E):(a=m.last,a!==null?a.sibling=E:r.child=E,m.last=E)}return m.tail!==null?(a=m.tail,m.rendering=a,m.tail=a.sibling,m.renderingStartTime=I(),a.sibling=null,f=Xi.current,Me(Xi,A?f&1|2:f&1),Jn&&xo(r,m.treeForkCount),a):(mi(r),null);case 22:case 23:return Gs(r),es(),m=r.memoizedState!==null,a!==null?a.memoizedState!==null!==m&&(r.flags|=8192):m&&(r.flags|=8192),m?(f&536870912)!==0&&(r.flags&128)===0&&(mi(r),r.subtreeFlags&6&&(r.flags|=8192)):mi(r),f=r.updateQueue,f!==null&&du(r,f.retryQueue),f=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(f=a.memoizedState.cachePool.pool),m=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(m=r.memoizedState.cachePool.pool),m!==f&&(r.flags|=2048),a!==null&&ae(cl),null;case 24:return f=null,a!==null&&(f=a.memoizedState.cache),r.memoizedState.cache!==f&&(r.flags|=2048),ar(sn),mi(r),null;case 25:return null;case 30:return null}throw Error(n(156,r.tag))}function Gd(a,r){switch(ol(r),r.tag){case 1:return a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 3:return ar(sn),Et(),a=r.flags,(a&65536)!==0&&(a&128)===0?(r.flags=a&-65537|128,r):null;case 26:case 27:case 5:return on(r),null;case 31:if(r.memoizedState!==null){if(Gs(r),r.alternate===null)throw Error(n(340));Zl()}return a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 13:if(Gs(r),a=r.memoizedState,a!==null&&a.dehydrated!==null){if(r.alternate===null)throw Error(n(340));Zl()}return a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 19:return ae(Xi),null;case 4:return Et(),null;case 10:return ar(r.type),null;case 22:case 23:return Gs(r),es(),a!==null&&ae(cl),a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 24:return ar(sn),null;case 25:return null;default:return null}}function rc(a,r){switch(ol(r),r.tag){case 3:ar(sn),Et();break;case 26:case 27:case 5:on(r);break;case 4:Et();break;case 31:r.memoizedState!==null&&Gs(r);break;case 13:Gs(r);break;case 19:ae(Xi);break;case 10:ar(r.type);break;case 22:case 23:Gs(r),es(),a!==null&&ae(cl);break;case 24:ar(sn)}}function Qr(a,r){try{var f=r.updateQueue,m=f!==null?f.lastEffect:null;if(m!==null){var A=m.next;f=A;do{if((f.tag&a)===a){m=void 0;var E=f.create,U=f.inst;m=E(),U.destroy=m}f=f.next}while(f!==A)}}catch(X){Ai(r,r.return,X)}}function lr(a,r,f){try{var m=r.updateQueue,A=m!==null?m.lastEffect:null;if(A!==null){var E=A.next;m=E;do{if((m.tag&a)===a){var U=m.inst,X=U.destroy;if(X!==void 0){U.destroy=void 0,A=r;var re=f,Te=X;try{Te()}catch(ke){Ai(A,re,ke)}}}m=m.next}while(m!==E)}}catch(ke){Ai(r,r.return,ke)}}function yl(a){var r=a.updateQueue;if(r!==null){var f=a.stateNode;try{Ga(r,f)}catch(m){Ai(a,a.return,m)}}}function _g(a,r,f){f.props=Va(a.type,a.memoizedProps),f.state=a.memoizedState;try{f.componentWillUnmount()}catch(m){Ai(a,r,m)}}function $r(a,r){try{var f=a.ref;if(f!==null){switch(a.tag){case 26:case 27:case 5:var m=a.stateNode;break;case 30:m=a.stateNode;break;default:m=a.stateNode}typeof f=="function"?a.refCleanup=f(m):f.current=m}}catch(A){Ai(a,r,A)}}function qs(a,r){var f=a.ref,m=a.refCleanup;if(f!==null)if(typeof m=="function")try{m()}catch(A){Ai(a,r,A)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof f=="function")try{f(null)}catch(A){Ai(a,r,A)}else f.current=null}function Ks(a){var r=a.type,f=a.memoizedProps,m=a.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":f.autoFocus&&m.focus();break e;case"img":f.src?m.src=f.src:f.srcSet&&(m.srcset=f.srcSet)}}catch(A){Ai(a,a.return,A)}}function cr(a,r,f){try{var m=a.stateNode;M4(m,a.type,f,r),m[G]=r}catch(A){Ai(a,a.return,A)}}function pa(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&yu(a.type)||a.tag===4}function eo(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||pa(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&yu(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function Rn(a,r,f){var m=a.tag;if(m===5||m===6)a=a.stateNode,r?(f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f).insertBefore(a,r):(r=f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f,r.appendChild(a),f=f._reactRootContainer,f!=null||r.onclick!==null||(r.onclick=Cn));else if(m!==4&&(m===27&&yu(a.type)&&(f=a.stateNode,r=null),a=a.child,a!==null))for(Rn(a,r,f),a=a.sibling;a!==null;)Rn(a,r,f),a=a.sibling}function oi(a,r,f){var m=a.tag;if(m===5||m===6)a=a.stateNode,r?f.insertBefore(a,r):f.appendChild(a);else if(m!==4&&(m===27&&yu(a.type)&&(f=a.stateNode),a=a.child,a!==null))for(oi(a,r,f),a=a.sibling;a!==null;)oi(a,r,f),a=a.sibling}function ta(a){var r=a.stateNode,f=a.memoizedProps;try{for(var m=a.type,A=r.attributes;A.length;)r.removeAttributeNode(A[0]);ds(r,m,f),r[fn]=a,r[G]=f}catch(E){Ai(a,a.return,E)}}var ur=!1,Li=!1,Do=!1,Zf=typeof WeakSet=="function"?WeakSet:Set,qi=null;function pu(a,r){if(a=a.containerInfo,uM=Dy,a=ld(a),qc(a)){if("selectionStart"in a)var f={start:a.selectionStart,end:a.selectionEnd};else e:{f=(f=a.ownerDocument)&&f.defaultView||window;var m=f.getSelection&&f.getSelection();if(m&&m.rangeCount!==0){f=m.anchorNode;var A=m.anchorOffset,E=m.focusNode;m=m.focusOffset;try{f.nodeType,E.nodeType}catch{f=null;break e}var U=0,X=-1,re=-1,Te=0,ke=0,$e=a,De=null;t:for(;;){for(var Ge;$e!==f||A!==0&&$e.nodeType!==3||(X=U+A),$e!==E||m!==0&&$e.nodeType!==3||(re=U+m),$e.nodeType===3&&(U+=$e.nodeValue.length),(Ge=$e.firstChild)!==null;)De=$e,$e=Ge;for(;;){if($e===a)break t;if(De===f&&++Te===A&&(X=U),De===E&&++ke===m&&(re=U),(Ge=$e.nextSibling)!==null)break;$e=De,De=$e.parentNode}$e=Ge}f=X===-1||re===-1?null:{start:X,end:re}}else f=null}f=f||{start:0,end:0}}else f=null;for(fM={focusedElem:a,selectionRange:f},Dy=!1,qi=r;qi!==null;)if(r=qi,a=r.child,(r.subtreeFlags&1028)!==0&&a!==null)a.return=r,qi=a;else for(;qi!==null;){switch(r=qi,E=r.alternate,a=r.flags,r.tag){case 0:if((a&4)!==0&&(a=r.updateQueue,a=a!==null?a.events:null,a!==null))for(f=0;f<a.length;f++)A=a[f],A.ref.impl=A.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&E!==null){a=void 0,f=r,A=E.memoizedProps,E=E.memoizedState,m=f.stateNode;try{var Zt=Va(f.type,A);a=m.getSnapshotBeforeUpdate(Zt,E),m.__reactInternalSnapshotBeforeUpdate=a}catch(pn){Ai(f,f.return,pn)}}break;case 3:if((a&1024)!==0){if(a=r.stateNode.containerInfo,f=a.nodeType,f===9)pM(a);else if(f===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":pM(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(n(163))}if(a=r.sibling,a!==null){a.return=r.return,qi=a;break}qi=r.return}}function vy(a,r,f){var m=f.flags;switch(f.tag){case 0:case 11:case 15:Lo(a,f),m&4&&Qr(5,f);break;case 1:if(Lo(a,f),m&4)if(a=f.stateNode,r===null)try{a.componentDidMount()}catch(U){Ai(f,f.return,U)}else{var A=Va(f.type,r.memoizedProps);r=r.memoizedState;try{a.componentDidUpdate(A,r,a.__reactInternalSnapshotBeforeUpdate)}catch(U){Ai(f,f.return,U)}}m&64&&yl(f),m&512&&$r(f,f.return);break;case 3:if(Lo(a,f),m&64&&(a=f.updateQueue,a!==null)){if(r=null,f.child!==null)switch(f.child.tag){case 27:case 5:r=f.child.stateNode;break;case 1:r=f.child.stateNode}try{Ga(a,r)}catch(U){Ai(f,f.return,U)}}break;case 27:r===null&&m&4&&ta(f);case 26:case 5:Lo(a,f),r===null&&m&4&&Ks(f),m&512&&$r(f,f.return);break;case 12:Lo(a,f);break;case 31:Lo(a,f),m&4&&Vd(a,f);break;case 13:Lo(a,f),m&4&&yg(a,f),m&64&&(a=f.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(f=f4.bind(null,f),D4(a,f))));break;case 22:if(m=f.memoizedState!==null||ur,!m){r=r!==null&&r.memoizedState!==null||Li,A=ur;var E=Li;ur=m,(Li=r)&&!E?ui(a,f,(f.subtreeFlags&8772)!==0):Lo(a,f),ur=A,Li=E}break;case 30:break;default:Lo(a,f)}}function zd(a){var r=a.alternate;r!==null&&(a.alternate=null,zd(r)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(r=a.stateNode,r!==null&&nt(r)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var ii=null,ma=!1;function ns(a,r,f){for(f=f.child;f!==null;)xl(a,r,f),f=f.sibling}function xl(a,r,f){if(qe&&typeof qe.onCommitFiberUnmount=="function")try{qe.onCommitFiberUnmount(ze,f)}catch{}switch(f.tag){case 26:Li||qs(f,r),ns(a,r,f),f.memoizedState?f.memoizedState.count--:f.stateNode&&(f=f.stateNode,f.parentNode.removeChild(f));break;case 27:Li||qs(f,r);var m=ii,A=ma;yu(f.type)&&(ii=f.stateNode,ma=!1),ns(a,r,f),Mg(f.stateNode),ii=m,ma=A;break;case 5:Li||qs(f,r);case 6:if(m=ii,A=ma,ii=null,ns(a,r,f),ii=m,ma=A,ii!==null)if(ma)try{(ii.nodeType===9?ii.body:ii.nodeName==="HTML"?ii.ownerDocument.body:ii).removeChild(f.stateNode)}catch(E){Ai(f,r,E)}else try{ii.removeChild(f.stateNode)}catch(E){Ai(f,r,E)}break;case 18:ii!==null&&(ma?(a=ii,WC(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,f.stateNode),$d(a)):WC(ii,f.stateNode));break;case 4:m=ii,A=ma,ii=f.stateNode.containerInfo,ma=!0,ns(a,r,f),ii=m,ma=A;break;case 0:case 11:case 14:case 15:lr(2,f,r),Li||lr(4,f,r),ns(a,r,f);break;case 1:Li||(qs(f,r),m=f.stateNode,typeof m.componentWillUnmount=="function"&&_g(f,r,m)),ns(a,r,f);break;case 21:ns(a,r,f);break;case 22:Li=(m=Li)||f.memoizedState!==null,ns(a,r,f),Li=m;break;default:ns(a,r,f)}}function Vd(a,r){if(r.memoizedState===null&&(a=r.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{$d(a)}catch(f){Ai(r,r.return,f)}}}function yg(a,r){if(r.memoizedState===null&&(a=r.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{$d(a)}catch(f){Ai(r,r.return,f)}}function _y(a){switch(a.tag){case 31:case 13:case 19:var r=a.stateNode;return r===null&&(r=a.stateNode=new Zf),r;case 22:return a=a.stateNode,r=a._retryCache,r===null&&(r=a._retryCache=new Zf),r;default:throw Error(n(435,a.tag))}}function na(a,r){var f=_y(a);r.forEach(function(m){if(!f.has(m)){f.add(m);var A=h4.bind(null,a,m);m.then(A,A)}})}function is(a,r){var f=r.deletions;if(f!==null)for(var m=0;m<f.length;m++){var A=f[m],E=a,U=r,X=U;e:for(;X!==null;){switch(X.tag){case 27:if(yu(X.type)){ii=X.stateNode,ma=!1;break e}break;case 5:ii=X.stateNode,ma=!1;break e;case 3:case 4:ii=X.stateNode.containerInfo,ma=!0;break e}X=X.return}if(ii===null)throw Error(n(160));xl(E,U,A),ii=null,ma=!1,E=A.alternate,E!==null&&(E.return=null),A.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)Al(r,a),r=r.sibling}var Es=null;function Al(a,r){var f=a.alternate,m=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:is(r,a),Ki(a),m&4&&(lr(3,a,a.return),Qr(3,a),lr(5,a,a.return));break;case 1:is(r,a),Ki(a),m&512&&(Li||f===null||qs(f,f.return)),m&64&&ur&&(a=a.updateQueue,a!==null&&(m=a.callbacks,m!==null&&(f=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=f===null?m:f.concat(m))));break;case 26:var A=Es;if(is(r,a),Ki(a),m&512&&(Li||f===null||qs(f,f.return)),m&4){var E=f!==null?f.memoizedState:null;if(m=a.memoizedState,f===null)if(m===null)if(a.stateNode===null){e:{m=a.type,f=a.memoizedProps,A=A.ownerDocument||A;t:switch(m){case"title":E=A.getElementsByTagName("title")[0],(!E||E[ot]||E[fn]||E.namespaceURI==="http://www.w3.org/2000/svg"||E.hasAttribute("itemprop"))&&(E=A.createElement(m),A.head.insertBefore(E,A.querySelector("head > title"))),ds(E,m,f),E[fn]=a,k(E),m=E;break e;case"link":var U=rR("link","href",A).get(m+(f.href||""));if(U){for(var X=0;X<U.length;X++)if(E=U[X],E.getAttribute("href")===(f.href==null||f.href===""?null:f.href)&&E.getAttribute("rel")===(f.rel==null?null:f.rel)&&E.getAttribute("title")===(f.title==null?null:f.title)&&E.getAttribute("crossorigin")===(f.crossOrigin==null?null:f.crossOrigin)){U.splice(X,1);break t}}E=A.createElement(m),ds(E,m,f),A.head.appendChild(E);break;case"meta":if(U=rR("meta","content",A).get(m+(f.content||""))){for(X=0;X<U.length;X++)if(E=U[X],E.getAttribute("content")===(f.content==null?null:""+f.content)&&E.getAttribute("name")===(f.name==null?null:f.name)&&E.getAttribute("property")===(f.property==null?null:f.property)&&E.getAttribute("http-equiv")===(f.httpEquiv==null?null:f.httpEquiv)&&E.getAttribute("charset")===(f.charSet==null?null:f.charSet)){U.splice(X,1);break t}}E=A.createElement(m),ds(E,m,f),A.head.appendChild(E);break;default:throw Error(n(468,m))}E[fn]=a,k(E),m=E}a.stateNode=m}else oR(A,a.type,a.stateNode);else a.stateNode=sR(A,m,a.memoizedProps);else E!==m?(E===null?f.stateNode!==null&&(f=f.stateNode,f.parentNode.removeChild(f)):E.count--,m===null?oR(A,a.type,a.stateNode):sR(A,m,a.memoizedProps)):m===null&&a.stateNode!==null&&cr(a,a.memoizedProps,f.memoizedProps)}break;case 27:is(r,a),Ki(a),m&512&&(Li||f===null||qs(f,f.return)),f!==null&&m&4&&cr(a,a.memoizedProps,f.memoizedProps);break;case 5:if(is(r,a),Ki(a),m&512&&(Li||f===null||qs(f,f.return)),a.flags&32){A=a.stateNode;try{at(A,"")}catch(Zt){Ai(a,a.return,Zt)}}m&4&&a.stateNode!=null&&(A=a.memoizedProps,cr(a,A,f!==null?f.memoizedProps:A)),m&1024&&(Do=!0);break;case 6:if(is(r,a),Ki(a),m&4){if(a.stateNode===null)throw Error(n(162));m=a.memoizedProps,f=a.stateNode;try{f.nodeValue=m}catch(Zt){Ai(a,a.return,Zt)}}break;case 3:if(Cy=null,A=Es,Es=Ey(r.containerInfo),is(r,a),Es=A,Ki(a),m&4&&f!==null&&f.memoizedState.isDehydrated)try{$d(r.containerInfo)}catch(Zt){Ai(a,a.return,Zt)}Do&&(Do=!1,yy(a));break;case 4:m=Es,Es=Ey(a.stateNode.containerInfo),is(r,a),Ki(a),Es=m;break;case 12:is(r,a),Ki(a);break;case 31:is(r,a),Ki(a),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,na(a,m)));break;case 13:is(r,a),Ki(a),a.child.flags&8192&&a.memoizedState!==null!=(f!==null&&f.memoizedState!==null)&&(Oo=I()),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,na(a,m)));break;case 22:A=a.memoizedState!==null;var re=f!==null&&f.memoizedState!==null,Te=ur,ke=Li;if(ur=Te||A,Li=ke||re,is(r,a),Li=ke,ur=Te,Ki(a),m&8192)e:for(r=a.stateNode,r._visibility=A?r._visibility&-2:r._visibility|1,A&&(f===null||re||ur||Li||oc(a)),f=null,r=a;;){if(r.tag===5||r.tag===26){if(f===null){re=f=r;try{if(E=re.stateNode,A)U=E.style,typeof U.setProperty=="function"?U.setProperty("display","none","important"):U.display="none";else{X=re.stateNode;var $e=re.memoizedProps.style,De=$e!=null&&$e.hasOwnProperty("display")?$e.display:null;X.style.display=De==null||typeof De=="boolean"?"":(""+De).trim()}}catch(Zt){Ai(re,re.return,Zt)}}}else if(r.tag===6){if(f===null){re=r;try{re.stateNode.nodeValue=A?"":re.memoizedProps}catch(Zt){Ai(re,re.return,Zt)}}}else if(r.tag===18){if(f===null){re=r;try{var Ge=re.stateNode;A?jC(Ge,!0):jC(re.stateNode,!1)}catch(Zt){Ai(re,re.return,Zt)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===a)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===a)break e;for(;r.sibling===null;){if(r.return===null||r.return===a)break e;f===r&&(f=null),r=r.return}f===r&&(f=null),r.sibling.return=r.return,r=r.sibling}m&4&&(m=a.updateQueue,m!==null&&(f=m.retryQueue,f!==null&&(m.retryQueue=null,na(a,f))));break;case 19:is(r,a),Ki(a),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,na(a,m)));break;case 30:break;case 21:break;default:is(r,a),Ki(a)}}function Ki(a){var r=a.flags;if(r&2){try{for(var f,m=a.return;m!==null;){if(pa(m)){f=m;break}m=m.return}if(f==null)throw Error(n(160));switch(f.tag){case 27:var A=f.stateNode,E=eo(a);oi(a,E,A);break;case 5:var U=f.stateNode;f.flags&32&&(at(U,""),f.flags&=-33);var X=eo(a);oi(a,X,U);break;case 3:case 4:var re=f.stateNode.containerInfo,Te=eo(a);Rn(a,Te,re);break;default:throw Error(n(161))}}catch(ke){Ai(a,a.return,ke)}a.flags&=-3}r&4096&&(a.flags&=-4097)}function yy(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var r=a;yy(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),a=a.sibling}}function Lo(a,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)vy(a,r.alternate,r),r=r.sibling}function oc(a){for(a=a.child;a!==null;){var r=a;switch(r.tag){case 0:case 11:case 14:case 15:lr(4,r,r.return),oc(r);break;case 1:qs(r,r.return);var f=r.stateNode;typeof f.componentWillUnmount=="function"&&_g(r,r.return,f),oc(r);break;case 27:Mg(r.stateNode);case 26:case 5:qs(r,r.return),oc(r);break;case 22:r.memoizedState===null&&oc(r);break;case 30:oc(r);break;default:oc(r)}a=a.sibling}}function ui(a,r,f){for(f=f&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var m=r.alternate,A=a,E=r,U=E.flags;switch(E.tag){case 0:case 11:case 15:ui(A,E,f),Qr(4,E);break;case 1:if(ui(A,E,f),m=E,A=m.stateNode,typeof A.componentDidMount=="function")try{A.componentDidMount()}catch(Te){Ai(m,m.return,Te)}if(m=E,A=m.updateQueue,A!==null){var X=m.stateNode;try{var re=A.shared.hiddenCallbacks;if(re!==null)for(A.shared.hiddenCallbacks=null,A=0;A<re.length;A++)Kr(re[A],X)}catch(Te){Ai(m,m.return,Te)}}f&&U&64&&yl(E),$r(E,E.return);break;case 27:ta(E);case 26:case 5:ui(A,E,f),f&&m===null&&U&4&&Ks(E),$r(E,E.return);break;case 12:ui(A,E,f);break;case 31:ui(A,E,f),f&&U&4&&Vd(A,E);break;case 13:ui(A,E,f),f&&U&4&&yg(A,E);break;case 22:E.memoizedState===null&&ui(A,E,f),$r(E,E.return);break;case 30:break;default:ui(A,E,f)}r=r.sibling}}function kd(a,r){var f=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(f=a.memoizedState.cachePool.pool),a=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(a=r.memoizedState.cachePool.pool),a!==f&&(a!=null&&a.refCount++,f!=null&&Pa(f))}function No(a,r){a=null,r.alternate!==null&&(a=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==a&&(r.refCount++,a!=null&&Pa(a))}function Aa(a,r,f,m){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Hi(a,r,f,m),r=r.sibling}function Hi(a,r,f,m){var A=r.flags;switch(r.tag){case 0:case 11:case 15:Aa(a,r,f,m),A&2048&&Qr(9,r);break;case 1:Aa(a,r,f,m);break;case 3:Aa(a,r,f,m),A&2048&&(a=null,r.alternate!==null&&(a=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==a&&(r.refCount++,a!=null&&Pa(a)));break;case 12:if(A&2048){Aa(a,r,f,m),a=r.stateNode;try{var E=r.memoizedProps,U=E.id,X=E.onPostCommit;typeof X=="function"&&X(U,r.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(re){Ai(r,r.return,re)}}else Aa(a,r,f,m);break;case 31:Aa(a,r,f,m);break;case 13:Aa(a,r,f,m);break;case 23:break;case 22:E=r.stateNode,U=r.alternate,r.memoizedState!==null?E._visibility&2?Aa(a,r,f,m):mu(a,r):E._visibility&2?Aa(a,r,f,m):(E._visibility|=2,Sl(a,r,f,m,(r.subtreeFlags&10256)!==0||!1)),A&2048&&kd(U,r);break;case 24:Aa(a,r,f,m),A&2048&&No(r.alternate,r);break;default:Aa(a,r,f,m)}}function Sl(a,r,f,m,A){for(A=A&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var E=a,U=r,X=f,re=m,Te=U.flags;switch(U.tag){case 0:case 11:case 15:Sl(E,U,X,re,A),Qr(8,U);break;case 23:break;case 22:var ke=U.stateNode;U.memoizedState!==null?ke._visibility&2?Sl(E,U,X,re,A):mu(E,U):(ke._visibility|=2,Sl(E,U,X,re,A)),A&&Te&2048&&kd(U.alternate,U);break;case 24:Sl(E,U,X,re,A),A&&Te&2048&&No(U.alternate,U);break;default:Sl(E,U,X,re,A)}r=r.sibling}}function mu(a,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var f=a,m=r,A=m.flags;switch(m.tag){case 22:mu(f,m),A&2048&&kd(m.alternate,m);break;case 24:mu(f,m),A&2048&&No(m.alternate,m);break;default:mu(f,m)}r=r.sibling}}var Wi=8192;function lc(a,r,f){if(a.subtreeFlags&Wi)for(a=a.child;a!==null;)ia(a,r,f),a=a.sibling}function ia(a,r,f){switch(a.tag){case 26:lc(a,r,f),a.flags&Wi&&a.memoizedState!==null&&k4(f,Es,a.memoizedState,a.memoizedProps);break;case 5:lc(a,r,f);break;case 3:case 4:var m=Es;Es=Ey(a.stateNode.containerInfo),lc(a,r,f),Es=m;break;case 22:a.memoizedState===null&&(m=a.alternate,m!==null&&m.memoizedState!==null?(m=Wi,Wi=16777216,lc(a,r,f),Wi=m):lc(a,r,f));break;default:lc(a,r,f)}}function Ts(a){var r=a.alternate;if(r!==null&&(a=r.child,a!==null)){r.child=null;do r=a.sibling,a.sibling=null,a=r;while(a!==null)}}function fs(a){var r=a.deletions;if((a.flags&16)!==0){if(r!==null)for(var f=0;f<r.length;f++){var m=r[f];qi=m,Qf(m,a)}Ts(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)cc(a),a=a.sibling}function cc(a){switch(a.tag){case 0:case 11:case 15:fs(a),a.flags&2048&&lr(9,a,a.return);break;case 3:fs(a);break;case 12:fs(a);break;case 22:var r=a.stateNode;a.memoizedState!==null&&r._visibility&2&&(a.return===null||a.return.tag!==13)?(r._visibility&=-3,Xd(a)):fs(a);break;default:fs(a)}}function Xd(a){var r=a.deletions;if((a.flags&16)!==0){if(r!==null)for(var f=0;f<r.length;f++){var m=r[f];qi=m,Qf(m,a)}Ts(a)}for(a=a.child;a!==null;){switch(r=a,r.tag){case 0:case 11:case 15:lr(8,r,r.return),Xd(r);break;case 22:f=r.stateNode,f._visibility&2&&(f._visibility&=-3,Xd(r));break;default:Xd(r)}a=a.sibling}}function Qf(a,r){for(;qi!==null;){var f=qi;switch(f.tag){case 0:case 11:case 15:lr(8,f,r);break;case 23:case 22:if(f.memoizedState!==null&&f.memoizedState.cachePool!==null){var m=f.memoizedState.cachePool.pool;m!=null&&m.refCount++}break;case 24:Pa(f.memoizedState.cache)}if(m=f.child,m!==null)m.return=f,qi=m;else e:for(f=a;qi!==null;){m=qi;var A=m.sibling,E=m.return;if(zd(m),m===f){qi=null;break e}if(A!==null){A.return=E,qi=A;break e}qi=E}}}var Yd={getCacheForType:function(a){var r=wa(sn),f=r.data.get(a);return f===void 0&&(f=a(),r.data.set(a,f)),f},cacheSignal:function(){return wa(sn).controller.signal}},Jd=typeof WeakMap=="function"?WeakMap:Map,jn=0,fi=null,wn=null,Vn=0,rn=0,Fn=null,Sn=!1,Un=!1,xi=!1,aa=0,hi=0,Ws=0,Uo=0,wr=0,Zn=0,js=0,Br=null,as=null,Cs=!1,Oo=0,gu=0,Zs=1/0,vu=null,to=null,Pi=0,Dr=null,Qs=null,fr=0,Io=0,uc=null,qd=null,fc=0,hc=null;function hs(){return(jn&2)!==0&&Vn!==0?Vn&-Vn:H.T!==null?iM():vi()}function c(){if(Zn===0)if((Vn&536870912)===0||Jn){var a=We;We<<=1,(We&3932160)===0&&(We=262144),Zn=a}else Zn=536870912;return a=xa.current,a!==null&&(a.flags|=32),Zn}function u(a,r,f){(a===fi&&(rn===2||rn===9)||a.cancelPendingCommit!==null)&&(Se(a,0),B(a,Vn,Zn,!1)),Dn(a,f),((jn&2)===0||a!==fi)&&(a===fi&&((jn&2)===0&&(Uo|=f),hi===4&&B(a,Vn,Zn,!1)),Ml(a))}function g(a,r,f){if((jn&6)!==0)throw Error(n(327));var m=!f&&(r&127)===0&&(r&a.expiredLanes)===0||ft(a,r),A=m?dc(a,r):Rs(a,r,!0),E=m;do{if(A===0){Un&&!m&&B(a,r,0,!1);break}else{if(f=a.current.alternate,E&&!C(f)){A=Rs(a,r,!1),E=!1;continue}if(A===2){if(E=r,a.errorRecoveryDisabledLanes&E)var U=0;else U=a.pendingLanes&-536870913,U=U!==0?U:U&536870912?536870912:0;if(U!==0){r=U;e:{var X=a;A=Br;var re=X.current.memoizedState.isDehydrated;if(re&&(Se(X,U).flags|=256),U=Rs(X,U,!1),U!==2){if(xi&&!re){X.errorRecoveryDisabledLanes|=E,Uo|=E,A=4;break e}E=as,as=A,E!==null&&(as===null?as=E:as.push.apply(as,E))}A=U}if(E=!1,A!==2)continue}}if(A===1){Se(a,0),B(a,r,0,!0);break}e:{switch(m=a,E=A,E){case 0:case 1:throw Error(n(345));case 4:if((r&4194048)!==r)break;case 6:B(m,r,Zn,!Sn);break e;case 2:as=null;break;case 3:case 5:break;default:throw Error(n(329))}if((r&62914560)===r&&(A=Oo+300-I(),10<A)){if(B(m,r,Zn,!Sn),Ve(m,0,!0)!==0)break e;fr=r,m.timeoutHandle=qC(S.bind(null,m,f,as,vu,Cs,r,Zn,Uo,js,Sn,E,"Throttled",-0,0),A);break e}S(m,f,as,vu,Cs,r,Zn,Uo,js,Sn,E,null,-0,0)}}break}while(!0);Ml(a)}function S(a,r,f,m,A,E,U,X,re,Te,ke,$e,De,Ge){if(a.timeoutHandle=-1,$e=r.subtreeFlags,$e&8192||($e&16785408)===16785408){$e={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Cn},ia(r,E,$e);var Zt=(E&62914560)===E?Oo-I():(E&4194048)===E?gu-I():0;if(Zt=X4($e,Zt),Zt!==null){fr=E,a.cancelPendingCommit=Zt(vn.bind(null,a,r,E,f,m,A,U,X,re,ke,$e,null,De,Ge)),B(a,E,U,!Te);return}}vn(a,r,E,f,m,A,U,X,re)}function C(a){for(var r=a;;){var f=r.tag;if((f===0||f===11||f===15)&&r.flags&16384&&(f=r.updateQueue,f!==null&&(f=f.stores,f!==null)))for(var m=0;m<f.length;m++){var A=f[m],E=A.getSnapshot;A=A.value;try{if(!Bi(E(),A))return!1}catch{return!1}}if(f=r.child,r.subtreeFlags&16384&&f!==null)f.return=r,r=f;else{if(r===a)break;for(;r.sibling===null;){if(r.return===null||r.return===a)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function B(a,r,f,m){r&=~wr,r&=~Uo,a.suspendedLanes|=r,a.pingedLanes&=~r,m&&(a.warmLanes|=r),m=a.expirationTimes;for(var A=r;0<A;){var E=31-pt(A),U=1<<E;m[E]=-1,A&=~U}f!==0&&Ni(a,f,r)}function q(){return(jn&6)===0?(xg(0),!1):!0}function se(){if(wn!==null){if(rn===0)var a=wn.return;else a=wn,$a=So=null,jm(a),fl=null,hl=0,a=wn;for(;a!==null;)rc(a.alternate,a),a=a.return;wn=null}}function Se(a,r){var f=a.timeoutHandle;f!==-1&&(a.timeoutHandle=-1,T4(f)),f=a.cancelPendingCommit,f!==null&&(a.cancelPendingCommit=null,f()),fr=0,se(),fi=a,wn=f=Vr(a.current,null),Vn=r,rn=0,Fn=null,Sn=!1,Un=ft(a,r),xi=!1,js=Zn=wr=Uo=Ws=hi=0,as=Br=null,Cs=!1,(r&8)!==0&&(r|=r&32);var m=a.entangledLanes;if(m!==0)for(a=a.entanglements,m&=r;0<m;){var A=31-pt(m),E=1<<A;r|=a[A],m&=~E}return aa=r,al(),f}function Je(a,r){gn=null,H.H=Gf,r===ul||r===Er?(r=Ad(),rn=3):r===Bf?(r=Ad(),rn=4):rn=r===Hd?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,Fn=r,wn===null&&(hi=1,Fd(a,ys(r,a.current)))}function Mt(){var a=xa.current;return a===null?!0:(Vn&4194048)===Vn?sr===null:(Vn&62914560)===Vn||(Vn&536870912)!==0?a===sr:!1}function Gt(){var a=H.H;return H.H=Gf,a===null?Gf:a}function kt(){var a=H.A;return H.A=Yd,a}function An(){hi=4,Sn||(Vn&4194048)!==Vn&&xa.current!==null||(Un=!0),(Ws&134217727)===0&&(Uo&134217727)===0||fi===null||B(fi,Vn,Zn,!1)}function Rs(a,r,f){var m=jn;jn|=2;var A=Gt(),E=kt();(fi!==a||Vn!==r)&&(vu=null,Se(a,r)),r=!1;var U=hi;e:do try{if(rn!==0&&wn!==null){var X=wn,re=Fn;switch(rn){case 8:se(),U=6;break e;case 3:case 2:case 9:case 6:xa.current===null&&(r=!0);var Te=rn;if(rn=0,Fn=null,dt(a,X,re,Te),f&&Un){U=0;break e}break;default:Te=rn,rn=0,Fn=null,dt(a,X,re,Te)}}$f(),U=hi;break}catch(ke){Je(a,ke)}while(!0);return r&&a.shellSuspendCounter++,$a=So=null,jn=m,H.H=A,H.A=E,wn===null&&(fi=null,Vn=0,al()),U}function $f(){for(;wn!==null;)xe(wn)}function dc(a,r){var f=jn;jn|=2;var m=Gt(),A=kt();fi!==a||Vn!==r?(vu=null,Zs=I()+500,Se(a,r)):Un=ft(a,r);e:do try{if(rn!==0&&wn!==null){r=wn;var E=Fn;t:switch(rn){case 1:rn=0,Fn=null,dt(a,r,E,1);break;case 2:case 9:if(X_(E)){rn=0,Fn=null,Fe(r);break}r=function(){rn!==2&&rn!==9||fi!==a||(rn=7),Ml(a)},E.then(r,r);break e;case 3:rn=7;break e;case 4:rn=5;break e;case 7:X_(E)?(rn=0,Fn=null,Fe(r)):(rn=0,Fn=null,dt(a,r,E,7));break;case 5:var U=null;switch(wn.tag){case 26:U=wn.memoizedState;case 5:case 27:var X=wn;if(U?lR(U):X.stateNode.complete){rn=0,Fn=null;var re=X.sibling;if(re!==null)wn=re;else{var Te=X.return;Te!==null?(wn=Te,nn(Te)):wn=null}break t}}rn=0,Fn=null,dt(a,r,E,5);break;case 6:rn=0,Fn=null,dt(a,r,E,6);break;case 8:se(),hi=6;break e;default:throw Error(n(462))}}Be();break}catch(ke){Je(a,ke)}while(!0);return $a=So=null,H.H=m,H.A=A,jn=f,wn!==null?0:(fi=null,Vn=0,al(),hi)}function Be(){for(;wn!==null&&!yt();)xe(wn)}function xe(a){var r=Pd(a.alternate,a,aa);a.memoizedProps=a.pendingProps,r===null?nn(a):wn=r}function Fe(a){var r=a,f=r.alternate;switch(r.tag){case 15:case 0:r=ts(f,r,r.pendingProps,r.type,void 0,Vn);break;case 11:r=ts(f,r,r.pendingProps,r.type.render,r.ref,Vn);break;case 5:jm(r);default:rc(f,r),r=wn=Qa(r,aa),r=Pd(f,r,aa)}a.memoizedProps=a.pendingProps,r===null?nn(a):wn=r}function dt(a,r,f,m){$a=So=null,jm(r),fl=null,hl=0;var A=r.return;try{if(Vs(a,A,r,f,Vn)){hi=1,Fd(a,ys(f,a.current)),wn=null;return}}catch(E){if(A!==null)throw wn=A,E;hi=1,Fd(a,ys(f,a.current)),wn=null;return}r.flags&32768?(Jn||m===1?a=!0:Un||(Vn&536870912)!==0?a=!1:(Sn=a=!0,(m===2||m===9||m===3||m===6)&&(m=xa.current,m!==null&&m.tag===13&&(m.flags|=16384))),Mi(r,a)):nn(r)}function nn(a){var r=a;do{if((r.flags&32768)!==0){Mi(r,Sn);return}a=r.return;var f=vg(r.alternate,r,aa);if(f!==null){wn=f;return}if(r=r.sibling,r!==null){wn=r;return}wn=r=a}while(r!==null);hi===0&&(hi=5)}function Mi(a,r){do{var f=Gd(a.alternate,a);if(f!==null){f.flags&=32767,wn=f;return}if(f=a.return,f!==null&&(f.flags|=32768,f.subtreeFlags=0,f.deletions=null),!r&&(a=a.sibling,a!==null)){wn=a;return}wn=a=f}while(a!==null);hi=6,wn=null}function vn(a,r,f,m,A,E,U,X,re){a.cancelPendingCommit=null;do Kd();while(Pi!==0);if((jn&6)!==0)throw Error(n(327));if(r!==null){if(r===a.current)throw Error(n(177));if(E=r.lanes|r.childLanes,E|=dd,Nn(a,f,E,U,X,re),a===fi&&(wn=fi=null,Vn=0),Qs=r,Dr=a,fr=f,Io=E,uc=A,qd=m,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,d4(Oe,function(){return BC(),null})):(a.callbackNode=null,a.callbackPriority=0),m=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||m){m=H.T,H.T=null,A=Y.p,Y.p=2,U=jn,jn|=4;try{pu(a,r,f)}finally{jn=U,Y.p=A,H.T=m}}Pi=1,ai(),Sa(),si()}}function ai(){if(Pi===1){Pi=0;var a=Dr,r=Qs,f=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||f){f=H.T,H.T=null;var m=Y.p;Y.p=2;var A=jn;jn|=4;try{Al(r,a);var E=fM,U=ld(a.containerInfo),X=E.focusedElem,re=E.selectionRange;if(U!==X&&X&&X.ownerDocument&&od(X.ownerDocument.documentElement,X)){if(re!==null&&qc(X)){var Te=re.start,ke=re.end;if(ke===void 0&&(ke=Te),"selectionStart"in X)X.selectionStart=Te,X.selectionEnd=Math.min(ke,X.value.length);else{var $e=X.ownerDocument||document,De=$e&&$e.defaultView||window;if(De.getSelection){var Ge=De.getSelection(),Zt=X.textContent.length,pn=Math.min(re.start,Zt),Ei=re.end===void 0?pn:Math.min(re.end,Zt);!Ge.extend&&pn>Ei&&(U=Ei,Ei=pn,pn=U);var Ae=Em(X,pn),pe=Em(X,Ei);if(Ae&&pe&&(Ge.rangeCount!==1||Ge.anchorNode!==Ae.node||Ge.anchorOffset!==Ae.offset||Ge.focusNode!==pe.node||Ge.focusOffset!==pe.offset)){var Ee=$e.createRange();Ee.setStart(Ae.node,Ae.offset),Ge.removeAllRanges(),pn>Ei?(Ge.addRange(Ee),Ge.extend(pe.node,pe.offset)):(Ee.setEnd(pe.node,pe.offset),Ge.addRange(Ee))}}}}for($e=[],Ge=X;Ge=Ge.parentNode;)Ge.nodeType===1&&$e.push({element:Ge,left:Ge.scrollLeft,top:Ge.scrollTop});for(typeof X.focus=="function"&&X.focus(),X=0;X<$e.length;X++){var Ke=$e[X];Ke.element.scrollLeft=Ke.left,Ke.element.scrollTop=Ke.top}}Dy=!!uM,fM=uM=null}finally{jn=A,Y.p=m,H.T=f}}a.current=r,Pi=2}}function Sa(){if(Pi===2){Pi=0;var a=Dr,r=Qs,f=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||f){f=H.T,H.T=null;var m=Y.p;Y.p=2;var A=jn;jn|=4;try{vy(a,r.alternate,r)}finally{jn=A,Y.p=m,H.T=f}}Pi=3}}function si(){if(Pi===4||Pi===3){Pi=0,j();var a=Dr,r=Qs,f=fr,m=qd;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?Pi=5:(Pi=0,Qs=Dr=null,Fo(a,a.pendingLanes));var A=a.pendingLanes;if(A===0&&(to=null),Ia(f),r=r.stateNode,qe&&typeof qe.onCommitFiberRoot=="function")try{qe.onCommitFiberRoot(ze,r,void 0,(r.current.flags&128)===128)}catch{}if(m!==null){r=H.T,A=Y.p,Y.p=2,H.T=null;try{for(var E=a.onRecoverableError,U=0;U<m.length;U++){var X=m[U];E(X.value,{componentStack:X.stack})}}finally{H.T=r,Y.p=A}}(fr&3)!==0&&Kd(),Ml(a),A=a.pendingLanes,(f&261930)!==0&&(A&42)!==0?a===hc?fc++:(fc=0,hc=a):fc=0,xg(0)}}function Fo(a,r){(a.pooledCacheLanes&=r)===0&&(r=a.pooledCache,r!=null&&(a.pooledCache=null,Pa(r)))}function Kd(){return ai(),Sa(),si(),BC()}function BC(){if(Pi!==5)return!1;var a=Dr,r=Io;Io=0;var f=Ia(fr),m=H.T,A=Y.p;try{Y.p=32>f?32:f,H.T=null,f=uc,uc=null;var E=Dr,U=fr;if(Pi=0,Qs=Dr=null,fr=0,(jn&6)!==0)throw Error(n(331));var X=jn;if(jn|=4,cc(E.current),Hi(E,E.current,U,f),jn=X,xg(0,!1),qe&&typeof qe.onPostCommitFiberRoot=="function")try{qe.onPostCommitFiberRoot(ze,E)}catch{}return!0}finally{Y.p=A,H.T=m,Fo(a,r)}}function DC(a,r,f){r=ys(f,r),r=gg(a.stateNode,r,2),a=To(a,r,2),a!==null&&(Dn(a,2),Ml(a))}function Ai(a,r,f){if(a.tag===3)DC(a,a,f);else for(;r!==null;){if(r.tag===3){DC(r,a,f);break}else if(r.tag===1){var m=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(to===null||!to.has(m))){a=ys(f,a),f=cu(2),m=To(r,f,2),m!==null&&(Ms(f,m,r,a),Dn(m,2),Ml(m));break}}r=r.return}}function eM(a,r,f){var m=a.pingCache;if(m===null){m=a.pingCache=new Jd;var A=new Set;m.set(r,A)}else A=m.get(r),A===void 0&&(A=new Set,m.set(r,A));A.has(f)||(xi=!0,A.add(f),a=u4.bind(null,a,r,f),r.then(a,a))}function u4(a,r,f){var m=a.pingCache;m!==null&&m.delete(r),a.pingedLanes|=a.suspendedLanes&f,a.warmLanes&=~f,fi===a&&(Vn&f)===f&&(hi===4||hi===3&&(Vn&62914560)===Vn&&300>I()-Oo?(jn&2)===0&&Se(a,0):wr|=f,js===Vn&&(js=0)),Ml(a)}function LC(a,r){r===0&&(r=Mn()),a=sl(a,r),a!==null&&(Dn(a,r),Ml(a))}function f4(a){var r=a.memoizedState,f=0;r!==null&&(f=r.retryLane),LC(a,f)}function h4(a,r){var f=0;switch(a.tag){case 31:case 13:var m=a.stateNode,A=a.memoizedState;A!==null&&(f=A.retryLane);break;case 19:m=a.stateNode;break;case 22:m=a.stateNode._retryCache;break;default:throw Error(n(314))}m!==null&&m.delete(r),LC(a,f)}function d4(a,r){return _t(a,r)}var xy=null,Wd=null,tM=!1,Ay=!1,nM=!1,_u=0;function Ml(a){a!==Wd&&a.next===null&&(Wd===null?xy=Wd=a:Wd=Wd.next=a),Ay=!0,tM||(tM=!0,m4())}function xg(a,r){if(!nM&&Ay){nM=!0;do for(var f=!1,m=xy;m!==null;){if(a!==0){var A=m.pendingLanes;if(A===0)var E=0;else{var U=m.suspendedLanes,X=m.pingedLanes;E=(1<<31-pt(42|a)+1)-1,E&=A&~(U&~X),E=E&201326741?E&201326741|1:E?E|2:0}E!==0&&(f=!0,IC(m,E))}else E=Vn,E=Ve(m,m===fi?E:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(E&3)===0||ft(m,E)||(f=!0,IC(m,E));m=m.next}while(f);nM=!1}}function p4(){NC()}function NC(){Ay=tM=!1;var a=0;_u!==0&&E4()&&(a=_u);for(var r=I(),f=null,m=xy;m!==null;){var A=m.next,E=UC(m,r);E===0?(m.next=null,f===null?xy=A:f.next=A,A===null&&(Wd=f)):(f=m,(a!==0||(E&3)!==0)&&(Ay=!0)),m=A}Pi!==0&&Pi!==5||xg(a),_u!==0&&(_u=0)}function UC(a,r){for(var f=a.suspendedLanes,m=a.pingedLanes,A=a.expirationTimes,E=a.pendingLanes&-62914561;0<E;){var U=31-pt(E),X=1<<U,re=A[U];re===-1?((X&f)===0||(X&m)!==0)&&(A[U]=jt(X,r)):re<=r&&(a.expiredLanes|=X),E&=~X}if(r=fi,f=Vn,f=Ve(a,a===r?f:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),m=a.callbackNode,f===0||a===r&&(rn===2||rn===9)||a.cancelPendingCommit!==null)return m!==null&&m!==null&&Ft(m),a.callbackNode=null,a.callbackPriority=0;if((f&3)===0||ft(a,f)){if(r=f&-f,r===a.callbackPriority)return r;switch(m!==null&&Ft(m),Ia(f)){case 2:case 8:f=Xe;break;case 32:f=Oe;break;case 268435456:f=gt;break;default:f=Oe}return m=OC.bind(null,a),f=_t(f,m),a.callbackPriority=r,a.callbackNode=f,r}return m!==null&&m!==null&&Ft(m),a.callbackPriority=2,a.callbackNode=null,2}function OC(a,r){if(Pi!==0&&Pi!==5)return a.callbackNode=null,a.callbackPriority=0,null;var f=a.callbackNode;if(Kd()&&a.callbackNode!==f)return null;var m=Vn;return m=Ve(a,a===fi?m:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),m===0?null:(g(a,m,r),UC(a,I()),a.callbackNode!=null&&a.callbackNode===f?OC.bind(null,a):null)}function IC(a,r){if(Kd())return null;g(a,r,!0)}function m4(){C4(function(){(jn&6)!==0?_t(Ie,p4):NC()})}function iM(){if(_u===0){var a=Eo;a===0&&(a=be,be<<=1,(be&261888)===0&&(be=256)),_u=a}return _u}function FC(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:En(""+a)}function HC(a,r){var f=r.ownerDocument.createElement("input");return f.name=r.name,f.value=r.value,a.id&&f.setAttribute("form",a.id),r.parentNode.insertBefore(f,r),a=new FormData(a),f.parentNode.removeChild(f),a}function g4(a,r,f,m,A){if(r==="submit"&&f&&f.stateNode===A){var E=FC((A[G]||null).action),U=m.submitter;U&&(r=(r=U[G]||null)?FC(r.formAction):U.getAttribute("formAction"),r!==null&&(E=r,U=null));var X=new mf("action","action",null,m,A);a.push({event:X,listeners:[{instance:null,listener:function(){if(m.defaultPrevented){if(_u!==0){var re=U?HC(A,U):new FormData(A);fg(f,{pending:!0,data:re,method:A.method,action:E},null,re)}}else typeof E=="function"&&(X.preventDefault(),re=U?HC(A,U):new FormData(A),fg(f,{pending:!0,data:re,method:A.method,action:E},E,re))},currentTarget:A}]})}}for(var aM=0;aM<hd.length;aM++){var sM=hd[aM],v4=sM.toLowerCase(),_4=sM[0].toUpperCase()+sM.slice(1);Za(v4,"on"+_4)}Za(_s,"onAnimationEnd"),Za(Tm,"onAnimationIteration"),Za(zr,"onAnimationStart"),Za("dblclick","onDoubleClick"),Za("focusin","onFocus"),Za("focusout","onBlur"),Za(Zc,"onTransitionRun"),Za(nl,"onTransitionStart"),Za(Cm,"onTransitionCancel"),Za(fd,"onTransitionEnd"),le("onMouseEnter",["mouseout","mouseover"]),le("onMouseLeave",["mouseout","mouseover"]),le("onPointerEnter",["pointerout","pointerover"]),le("onPointerLeave",["pointerout","pointerover"]),ce("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ce("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ce("onBeforeInput",["compositionend","keypress","textInput","paste"]),ce("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ce("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ce("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ag="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),y4=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ag));function PC(a,r){r=(r&4)!==0;for(var f=0;f<a.length;f++){var m=a[f],A=m.event;m=m.listeners;e:{var E=void 0;if(r)for(var U=m.length-1;0<=U;U--){var X=m[U],re=X.instance,Te=X.currentTarget;if(X=X.listener,re!==E&&A.isPropagationStopped())break e;E=X,A.currentTarget=Te;try{E(A)}catch(ke){il(ke)}A.currentTarget=null,E=re}else for(U=0;U<m.length;U++){if(X=m[U],re=X.instance,Te=X.currentTarget,X=X.listener,re!==E&&A.isPropagationStopped())break e;E=X,A.currentTarget=Te;try{E(A)}catch(ke){il(ke)}A.currentTarget=null,E=re}}}}function qn(a,r){var f=r[oe];f===void 0&&(f=r[oe]=new Set);var m=a+"__bubble";f.has(m)||(GC(r,a,2,!1),f.add(m))}function rM(a,r,f){var m=0;r&&(m|=4),GC(f,a,m,r)}var Sy="_reactListening"+Math.random().toString(36).slice(2);function oM(a){if(!a[Sy]){a[Sy]=!0,te.forEach(function(f){f!=="selectionchange"&&(y4.has(f)||rM(f,!1,a),rM(f,!0,a))});var r=a.nodeType===9?a:a.ownerDocument;r===null||r[Sy]||(r[Sy]=!0,rM("selectionchange",!1,r))}}function GC(a,r,f,m){switch(mR(r)){case 2:var A=q4;break;case 8:A=K4;break;default:A=SM}f=A.bind(null,r,f,a),A=void 0,!ir||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(A=!0),m?A!==void 0?a.addEventListener(r,f,{capture:!0,passive:A}):a.addEventListener(r,f,!0):A!==void 0?a.addEventListener(r,f,{passive:A}):a.addEventListener(r,f,!1)}function lM(a,r,f,m,A){var E=m;if((r&1)===0&&(r&2)===0&&m!==null)e:for(;;){if(m===null)return;var U=m.tag;if(U===3||U===4){var X=m.stateNode.containerInfo;if(X===A)break;if(U===4)for(U=m.return;U!==null;){var re=U.tag;if((re===3||re===4)&&U.stateNode.containerInfo===A)return;U=U.return}for(;X!==null;){if(U=Ze(X),U===null)return;if(re=U.tag,re===5||re===6||re===26||re===27){m=E=U;continue e}X=X.parentNode}}m=m.return}Ri(function(){var Te=E,ke=Ci(f),$e=[];e:{var De=_o.get(a);if(De!==void 0){var Ge=mf,Zt=a;switch(a){case"keypress":if(kl(f)===0)break e;case"keydown":case"keyup":Ge=mm;break;case"focusin":Zt="focus",Ge=nd;break;case"focusout":Zt="blur",Ge=nd;break;case"beforeblur":case"afterblur":Ge=nd;break;case"click":if(f.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Ge=A_;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ge=S_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ge=go;break;case _s:case Tm:case zr:Ge=E_;break;case fd:Ge=JS;break;case"scroll":case"scrollend":Ge=ed;break;case"wheel":Ge=jo;break;case"copy":case"cut":case"paste":Ge=um;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ge=id;break;case"toggle":case"beforetoggle":Ge=vm}var pn=(r&4)!==0,Ei=!pn&&(a==="scroll"||a==="scrollend"),Ae=pn?De!==null?De+"Capture":null:De;pn=[];for(var pe=Te,Ee;pe!==null;){var Ke=pe;if(Ee=Ke.stateNode,Ke=Ke.tag,Ke!==5&&Ke!==26&&Ke!==27||Ee===null||Ae===null||(Ke=ya(pe,Ae),Ke!=null&&pn.push(Sg(pe,Ke,Ee))),Ei)break;pe=pe.return}0<pn.length&&(De=new Ge(De,Zt,null,f,ke),$e.push({event:De,listeners:pn}))}}if((r&7)===0){e:{if(De=a==="mouseover"||a==="pointerover",Ge=a==="mouseout"||a==="pointerout",De&&f!==ti&&(Zt=f.relatedTarget||f.fromElement)&&(Ze(Zt)||Zt[J]))break e;if((Ge||De)&&(De=ke.window===ke?ke:(De=ke.ownerDocument)?De.defaultView||De.parentWindow:window,Ge?(Zt=f.relatedTarget||f.toElement,Ge=Te,Zt=Zt?Ze(Zt):null,Zt!==null&&(Ei=o(Zt),pn=Zt.tag,Zt!==Ei||pn!==5&&pn!==27&&pn!==6)&&(Zt=null)):(Ge=null,Zt=Te),Ge!==Zt)){if(pn=A_,Ke="onMouseLeave",Ae="onMouseEnter",pe="mouse",(a==="pointerout"||a==="pointerover")&&(pn=id,Ke="onPointerLeave",Ae="onPointerEnter",pe="pointer"),Ei=Ge==null?De:vt(Ge),Ee=Zt==null?De:vt(Zt),De=new pn(Ke,pe+"leave",Ge,f,ke),De.target=Ei,De.relatedTarget=Ee,Ke=null,Ze(ke)===Te&&(pn=new pn(Ae,pe+"enter",Zt,f,ke),pn.target=Ee,pn.relatedTarget=Ei,Ke=pn),Ei=Ke,Ge&&Zt)t:{for(pn=x4,Ae=Ge,pe=Zt,Ee=0,Ke=Ae;Ke;Ke=pn(Ke))Ee++;Ke=0;for(var un=pe;un;un=pn(un))Ke++;for(;0<Ee-Ke;)Ae=pn(Ae),Ee--;for(;0<Ke-Ee;)pe=pn(pe),Ke--;for(;Ee--;){if(Ae===pe||pe!==null&&Ae===pe.alternate){pn=Ae;break t}Ae=pn(Ae),pe=pn(pe)}pn=null}else pn=null;Ge!==null&&zC($e,De,Ge,pn,!1),Zt!==null&&Ei!==null&&zC($e,Ei,Zt,pn,!0)}}e:{if(De=Te?vt(Te):window,Ge=De.nodeName&&De.nodeName.toLowerCase(),Ge==="select"||Ge==="input"&&De.type==="file")var di=Sm;else if(xm(De))if(Af)di=I_;else{di=$o;var tn=Sf}else Ge=De.nodeName,!Ge||Ge.toLowerCase()!=="input"||De.type!=="checkbox"&&De.type!=="radio"?Te&&Vt(Te.elementType)&&(di=Sm):di=O_;if(di&&(di=di(a,Te))){rd($e,di,f,ke);break e}tn&&tn(a,De,Te),a==="focusout"&&Te&&De.type==="number"&&Te.memoizedProps.value!=null&&Gn(De,"number",De.value)}switch(tn=Te?vt(Te):window,a){case"focusin":(xm(tn)||tn.contentEditable==="true")&&(Kc=tn,cd=Te,Wc=null);break;case"focusout":Wc=cd=Kc=null;break;case"mousedown":Fs=!0;break;case"contextmenu":case"mouseup":case"dragend":Fs=!1,ud($e,f,ke);break;case"selectionchange":if(F_)break;case"keydown":case"keyup":ud($e,f,ke)}var On;if(Xl)e:{switch(a){case"compositionstart":var Qn="onCompositionStart";break e;case"compositionend":Qn="onCompositionEnd";break e;case"compositionupdate":Qn="onCompositionUpdate";break e}Qn=void 0}else Qo?ad(a,f)&&(Qn="onCompositionEnd"):a==="keydown"&&f.keyCode===229&&(Qn="onCompositionStart");Qn&&(Ha&&f.locale!=="ko"&&(Qo||Qn!=="onCompositionStart"?Qn==="onCompositionEnd"&&Qo&&(On=$h()):(xr=ke,Qh="value"in xr?xr.value:xr.textContent,Qo=!0)),tn=My(Te,Qn),0<tn.length&&(Qn=new fm(Qn,a,null,f,ke),$e.push({event:Qn,listeners:tn}),On?Qn.data=On:(On=Vc(f),On!==null&&(Qn.data=On)))),(On=Yl?sd(a,f):L_(a,f))&&(Qn=My(Te,"onBeforeInput"),0<Qn.length&&(tn=new fm("onBeforeInput","beforeinput",null,f,ke),$e.push({event:tn,listeners:Qn}),tn.data=On)),g4($e,a,Te,f,ke)}PC($e,r)})}function Sg(a,r,f){return{instance:a,listener:r,currentTarget:f}}function My(a,r){for(var f=r+"Capture",m=[];a!==null;){var A=a,E=A.stateNode;if(A=A.tag,A!==5&&A!==26&&A!==27||E===null||(A=ya(a,f),A!=null&&m.unshift(Sg(a,A,E)),A=ya(a,r),A!=null&&m.push(Sg(a,A,E))),a.tag===3)return m;a=a.return}return[]}function x4(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function zC(a,r,f,m,A){for(var E=r._reactName,U=[];f!==null&&f!==m;){var X=f,re=X.alternate,Te=X.stateNode;if(X=X.tag,re!==null&&re===m)break;X!==5&&X!==26&&X!==27||Te===null||(re=Te,A?(Te=ya(f,E),Te!=null&&U.unshift(Sg(f,Te,re))):A||(Te=ya(f,E),Te!=null&&U.push(Sg(f,Te,re)))),f=f.return}U.length!==0&&a.push({event:r,listeners:U})}var A4=/\r\n?/g,S4=/\u0000|\uFFFD/g;function VC(a){return(typeof a=="string"?a:""+a).replace(A4,`
9
9
  `).replace(S4,"")}function kC(a,r){return r=VC(r),VC(a)===r}function bi(a,r,f,m,A,E){switch(f){case"children":typeof m=="string"?r==="body"||r==="textarea"&&m===""||at(a,m):(typeof m=="number"||typeof m=="bigint")&&r!=="body"&&at(a,""+m);break;case"className":Yt(a,"class",m);break;case"tabIndex":Yt(a,"tabindex",m);break;case"dir":case"role":case"viewBox":case"width":case"height":Yt(a,f,m);break;case"style":Nt(a,m,E);break;case"data":if(r!=="object"){Yt(a,"data",m);break}case"src":case"href":if(m===""&&(r!=="a"||f!=="href")){a.removeAttribute(f);break}if(m==null||typeof m=="function"||typeof m=="symbol"||typeof m=="boolean"){a.removeAttribute(f);break}m=En(""+m),a.setAttribute(f,m);break;case"action":case"formAction":if(typeof m=="function"){a.setAttribute(f,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof E=="function"&&(f==="formAction"?(r!=="input"&&bi(a,r,"name",A.name,A,null),bi(a,r,"formEncType",A.formEncType,A,null),bi(a,r,"formMethod",A.formMethod,A,null),bi(a,r,"formTarget",A.formTarget,A,null)):(bi(a,r,"encType",A.encType,A,null),bi(a,r,"method",A.method,A,null),bi(a,r,"target",A.target,A,null)));if(m==null||typeof m=="symbol"||typeof m=="boolean"){a.removeAttribute(f);break}m=En(""+m),a.setAttribute(f,m);break;case"onClick":m!=null&&(a.onclick=Cn);break;case"onScroll":m!=null&&qn("scroll",a);break;case"onScrollEnd":m!=null&&qn("scrollend",a);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(n(61));if(f=m.__html,f!=null){if(A.children!=null)throw Error(n(60));a.innerHTML=f}}break;case"multiple":a.multiple=m&&typeof m!="function"&&typeof m!="symbol";break;case"muted":a.muted=m&&typeof m!="function"&&typeof m!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(m==null||typeof m=="function"||typeof m=="boolean"||typeof m=="symbol"){a.removeAttribute("xlink:href");break}f=En(""+m),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",f);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":m!=null&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(f,""+m):a.removeAttribute(f);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":m&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(f,""):a.removeAttribute(f);break;case"capture":case"download":m===!0?a.setAttribute(f,""):m!==!1&&m!=null&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(f,m):a.removeAttribute(f);break;case"cols":case"rows":case"size":case"span":m!=null&&typeof m!="function"&&typeof m!="symbol"&&!isNaN(m)&&1<=m?a.setAttribute(f,m):a.removeAttribute(f);break;case"rowSpan":case"start":m==null||typeof m=="function"||typeof m=="symbol"||isNaN(m)?a.removeAttribute(f):a.setAttribute(f,m);break;case"popover":qn("beforetoggle",a),qn("toggle",a),xt(a,"popover",m);break;case"xlinkActuate":At(a,"http://www.w3.org/1999/xlink","xlink:actuate",m);break;case"xlinkArcrole":At(a,"http://www.w3.org/1999/xlink","xlink:arcrole",m);break;case"xlinkRole":At(a,"http://www.w3.org/1999/xlink","xlink:role",m);break;case"xlinkShow":At(a,"http://www.w3.org/1999/xlink","xlink:show",m);break;case"xlinkTitle":At(a,"http://www.w3.org/1999/xlink","xlink:title",m);break;case"xlinkType":At(a,"http://www.w3.org/1999/xlink","xlink:type",m);break;case"xmlBase":At(a,"http://www.w3.org/XML/1998/namespace","xml:base",m);break;case"xmlLang":At(a,"http://www.w3.org/XML/1998/namespace","xml:lang",m);break;case"xmlSpace":At(a,"http://www.w3.org/XML/1998/namespace","xml:space",m);break;case"is":xt(a,"is",m);break;case"innerText":case"textContent":break;default:(!(2<f.length)||f[0]!=="o"&&f[0]!=="O"||f[1]!=="n"&&f[1]!=="N")&&(f=ln.get(f)||f,xt(a,f,m))}}function cM(a,r,f,m,A,E){switch(f){case"style":Nt(a,m,E);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(n(61));if(f=m.__html,f!=null){if(A.children!=null)throw Error(n(60));a.innerHTML=f}}break;case"children":typeof m=="string"?at(a,m):(typeof m=="number"||typeof m=="bigint")&&at(a,""+m);break;case"onScroll":m!=null&&qn("scroll",a);break;case"onScrollEnd":m!=null&&qn("scrollend",a);break;case"onClick":m!=null&&(a.onclick=Cn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!fe.hasOwnProperty(f))e:{if(f[0]==="o"&&f[1]==="n"&&(A=f.endsWith("Capture"),r=f.slice(2,A?f.length-7:void 0),E=a[G]||null,E=E!=null?E[f]:null,typeof E=="function"&&a.removeEventListener(r,E,A),typeof m=="function")){typeof E!="function"&&E!==null&&(f in a?a[f]=null:a.hasAttribute(f)&&a.removeAttribute(f)),a.addEventListener(r,m,A);break e}f in a?a[f]=m:m===!0?a.setAttribute(f,""):xt(a,f,m)}}}function ds(a,r,f){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":qn("error",a),qn("load",a);var m=!1,A=!1,E;for(E in f)if(f.hasOwnProperty(E)){var U=f[E];if(U!=null)switch(E){case"src":m=!0;break;case"srcSet":A=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(n(137,r));default:bi(a,r,E,U,f,null)}}A&&bi(a,r,"srcSet",f.srcSet,f,null),m&&bi(a,r,"src",f.src,f,null);return;case"input":qn("invalid",a);var X=E=U=A=null,re=null,Te=null;for(m in f)if(f.hasOwnProperty(m)){var ke=f[m];if(ke!=null)switch(m){case"name":A=ke;break;case"type":U=ke;break;case"checked":re=ke;break;case"defaultChecked":Te=ke;break;case"value":E=ke;break;case"defaultValue":X=ke;break;case"children":case"dangerouslySetInnerHTML":if(ke!=null)throw Error(n(137,r));break;default:bi(a,r,m,ke,f,null)}}Qi(a,E,X,re,Te,U,A,!1);return;case"select":qn("invalid",a),m=U=E=null;for(A in f)if(f.hasOwnProperty(A)&&(X=f[A],X!=null))switch(A){case"value":E=X;break;case"defaultValue":U=X;break;case"multiple":m=X;default:bi(a,r,A,X,f,null)}r=E,f=U,a.multiple=!!m,r!=null?Fi(a,!!m,r,!1):f!=null&&Fi(a,!!m,f,!0);return;case"textarea":qn("invalid",a),E=A=m=null;for(U in f)if(f.hasOwnProperty(U)&&(X=f[U],X!=null))switch(U){case"value":m=X;break;case"defaultValue":A=X;break;case"children":E=X;break;case"dangerouslySetInnerHTML":if(X!=null)throw Error(n(91));break;default:bi(a,r,U,X,f,null)}we(a,m,A,E);return;case"option":for(re in f)f.hasOwnProperty(re)&&(m=f[re],m!=null)&&(re==="selected"?a.selected=m&&typeof m!="function"&&typeof m!="symbol":bi(a,r,re,m,f,null));return;case"dialog":qn("beforetoggle",a),qn("toggle",a),qn("cancel",a),qn("close",a);break;case"iframe":case"object":qn("load",a);break;case"video":case"audio":for(m=0;m<Ag.length;m++)qn(Ag[m],a);break;case"image":qn("error",a),qn("load",a);break;case"details":qn("toggle",a);break;case"embed":case"source":case"link":qn("error",a),qn("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Te in f)if(f.hasOwnProperty(Te)&&(m=f[Te],m!=null))switch(Te){case"children":case"dangerouslySetInnerHTML":throw Error(n(137,r));default:bi(a,r,Te,m,f,null)}return;default:if(Vt(r)){for(ke in f)f.hasOwnProperty(ke)&&(m=f[ke],m!==void 0&&cM(a,r,ke,m,f,void 0));return}}for(X in f)f.hasOwnProperty(X)&&(m=f[X],m!=null&&bi(a,r,X,m,f,null))}function M4(a,r,f,m){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var A=null,E=null,U=null,X=null,re=null,Te=null,ke=null;for(Ge in f){var $e=f[Ge];if(f.hasOwnProperty(Ge)&&$e!=null)switch(Ge){case"checked":break;case"value":break;case"defaultValue":re=$e;default:m.hasOwnProperty(Ge)||bi(a,r,Ge,null,m,$e)}}for(var De in m){var Ge=m[De];if($e=f[De],m.hasOwnProperty(De)&&(Ge!=null||$e!=null))switch(De){case"type":E=Ge;break;case"name":A=Ge;break;case"checked":Te=Ge;break;case"defaultChecked":ke=Ge;break;case"value":U=Ge;break;case"defaultValue":X=Ge;break;case"children":case"dangerouslySetInnerHTML":if(Ge!=null)throw Error(n(137,r));break;default:Ge!==$e&&bi(a,r,De,Ge,m,$e)}}ei(a,U,X,re,Te,ke,E,A);return;case"select":Ge=U=X=De=null;for(E in f)if(re=f[E],f.hasOwnProperty(E)&&re!=null)switch(E){case"value":break;case"multiple":Ge=re;default:m.hasOwnProperty(E)||bi(a,r,E,null,m,re)}for(A in m)if(E=m[A],re=f[A],m.hasOwnProperty(A)&&(E!=null||re!=null))switch(A){case"value":De=E;break;case"defaultValue":X=E;break;case"multiple":U=E;default:E!==re&&bi(a,r,A,E,m,re)}r=X,f=U,m=Ge,De!=null?Fi(a,!!f,De,!1):!!m!=!!f&&(r!=null?Fi(a,!!f,r,!0):Fi(a,!!f,f?[]:"",!1));return;case"textarea":Ge=De=null;for(X in f)if(A=f[X],f.hasOwnProperty(X)&&A!=null&&!m.hasOwnProperty(X))switch(X){case"value":break;case"children":break;default:bi(a,r,X,null,m,A)}for(U in m)if(A=m[U],E=f[U],m.hasOwnProperty(U)&&(A!=null||E!=null))switch(U){case"value":De=A;break;case"defaultValue":Ge=A;break;case"children":break;case"dangerouslySetInnerHTML":if(A!=null)throw Error(n(91));break;default:A!==E&&bi(a,r,U,A,m,E)}ri(a,De,Ge);return;case"option":for(var Zt in f)De=f[Zt],f.hasOwnProperty(Zt)&&De!=null&&!m.hasOwnProperty(Zt)&&(Zt==="selected"?a.selected=!1:bi(a,r,Zt,null,m,De));for(re in m)De=m[re],Ge=f[re],m.hasOwnProperty(re)&&De!==Ge&&(De!=null||Ge!=null)&&(re==="selected"?a.selected=De&&typeof De!="function"&&typeof De!="symbol":bi(a,r,re,De,m,Ge));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var pn in f)De=f[pn],f.hasOwnProperty(pn)&&De!=null&&!m.hasOwnProperty(pn)&&bi(a,r,pn,null,m,De);for(Te in m)if(De=m[Te],Ge=f[Te],m.hasOwnProperty(Te)&&De!==Ge&&(De!=null||Ge!=null))switch(Te){case"children":case"dangerouslySetInnerHTML":if(De!=null)throw Error(n(137,r));break;default:bi(a,r,Te,De,m,Ge)}return;default:if(Vt(r)){for(var Ei in f)De=f[Ei],f.hasOwnProperty(Ei)&&De!==void 0&&!m.hasOwnProperty(Ei)&&cM(a,r,Ei,void 0,m,De);for(ke in m)De=m[ke],Ge=f[ke],!m.hasOwnProperty(ke)||De===Ge||De===void 0&&Ge===void 0||cM(a,r,ke,De,m,Ge);return}}for(var Ae in f)De=f[Ae],f.hasOwnProperty(Ae)&&De!=null&&!m.hasOwnProperty(Ae)&&bi(a,r,Ae,null,m,De);for($e in m)De=m[$e],Ge=f[$e],!m.hasOwnProperty($e)||De===Ge||De==null&&Ge==null||bi(a,r,$e,De,m,Ge)}function XC(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function b4(){if(typeof performance.getEntriesByType=="function"){for(var a=0,r=0,f=performance.getEntriesByType("resource"),m=0;m<f.length;m++){var A=f[m],E=A.transferSize,U=A.initiatorType,X=A.duration;if(E&&X&&XC(U)){for(U=0,X=A.responseEnd,m+=1;m<f.length;m++){var re=f[m],Te=re.startTime;if(Te>X)break;var ke=re.transferSize,$e=re.initiatorType;ke&&XC($e)&&(re=re.responseEnd,U+=ke*(re<X?1:(X-Te)/(re-Te)))}if(--m,r+=8*(E+U)/(A.duration/1e3),a++,10<a)break}}if(0<a)return r/a/1e6}return navigator.connection&&(a=navigator.connection.downlink,typeof a=="number")?a:5}var uM=null,fM=null;function by(a){return a.nodeType===9?a:a.ownerDocument}function YC(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function JC(a,r){if(a===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&r==="foreignObject"?0:a}function hM(a,r){return a==="textarea"||a==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var dM=null;function E4(){var a=window.event;return a&&a.type==="popstate"?a===dM?!1:(dM=a,!0):(dM=null,!1)}var qC=typeof setTimeout=="function"?setTimeout:void 0,T4=typeof clearTimeout=="function"?clearTimeout:void 0,KC=typeof Promise=="function"?Promise:void 0,C4=typeof queueMicrotask=="function"?queueMicrotask:typeof KC<"u"?function(a){return KC.resolve(null).then(a).catch(R4)}:qC;function R4(a){setTimeout(function(){throw a})}function yu(a){return a==="head"}function WC(a,r){var f=r,m=0;do{var A=f.nextSibling;if(a.removeChild(f),A&&A.nodeType===8)if(f=A.data,f==="/$"||f==="/&"){if(m===0){a.removeChild(A),$d(r);return}m--}else if(f==="$"||f==="$?"||f==="$~"||f==="$!"||f==="&")m++;else if(f==="html")Mg(a.ownerDocument.documentElement);else if(f==="head"){f=a.ownerDocument.head,Mg(f);for(var E=f.firstChild;E;){var U=E.nextSibling,X=E.nodeName;E[ot]||X==="SCRIPT"||X==="STYLE"||X==="LINK"&&E.rel.toLowerCase()==="stylesheet"||f.removeChild(E),E=U}}else f==="body"&&Mg(a.ownerDocument.body);f=A}while(f);$d(r)}function jC(a,r){var f=a;a=0;do{var m=f.nextSibling;if(f.nodeType===1?r?(f._stashedDisplay=f.style.display,f.style.display="none"):(f.style.display=f._stashedDisplay||"",f.getAttribute("style")===""&&f.removeAttribute("style")):f.nodeType===3&&(r?(f._stashedText=f.nodeValue,f.nodeValue=""):f.nodeValue=f._stashedText||""),m&&m.nodeType===8)if(f=m.data,f==="/$"){if(a===0)break;a--}else f!=="$"&&f!=="$?"&&f!=="$~"&&f!=="$!"||a++;f=m}while(f)}function pM(a){var r=a.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var f=r;switch(r=r.nextSibling,f.nodeName){case"HTML":case"HEAD":case"BODY":pM(f),nt(f);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(f.rel.toLowerCase()==="stylesheet")continue}a.removeChild(f)}}function w4(a,r,f,m){for(;a.nodeType===1;){var A=f;if(a.nodeName.toLowerCase()!==r.toLowerCase()){if(!m&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(m){if(!a[ot])switch(r){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(E=a.getAttribute("rel"),E==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(E!==A.rel||a.getAttribute("href")!==(A.href==null||A.href===""?null:A.href)||a.getAttribute("crossorigin")!==(A.crossOrigin==null?null:A.crossOrigin)||a.getAttribute("title")!==(A.title==null?null:A.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(E=a.getAttribute("src"),(E!==(A.src==null?null:A.src)||a.getAttribute("type")!==(A.type==null?null:A.type)||a.getAttribute("crossorigin")!==(A.crossOrigin==null?null:A.crossOrigin))&&E&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(r==="input"&&a.type==="hidden"){var E=A.name==null?null:""+A.name;if(A.type==="hidden"&&a.getAttribute("name")===E)return a}else return a;if(a=no(a.nextSibling),a===null)break}return null}function B4(a,r,f){if(r==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!f||(a=no(a.nextSibling),a===null))return null;return a}function ZC(a,r){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!r||(a=no(a.nextSibling),a===null))return null;return a}function mM(a){return a.data==="$?"||a.data==="$~"}function gM(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function D4(a,r){var f=a.ownerDocument;if(a.data==="$~")a._reactRetry=r;else if(a.data!=="$?"||f.readyState!=="loading")r();else{var m=function(){r(),f.removeEventListener("DOMContentLoaded",m)};f.addEventListener("DOMContentLoaded",m),a._reactRetry=m}}function no(a){for(;a!=null;a=a.nextSibling){var r=a.nodeType;if(r===1||r===3)break;if(r===8){if(r=a.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return a}var vM=null;function QC(a){a=a.nextSibling;for(var r=0;a;){if(a.nodeType===8){var f=a.data;if(f==="/$"||f==="/&"){if(r===0)return no(a.nextSibling);r--}else f!=="$"&&f!=="$!"&&f!=="$?"&&f!=="$~"&&f!=="&"||r++}a=a.nextSibling}return null}function $C(a){a=a.previousSibling;for(var r=0;a;){if(a.nodeType===8){var f=a.data;if(f==="$"||f==="$!"||f==="$?"||f==="$~"||f==="&"){if(r===0)return a;r--}else f!=="/$"&&f!=="/&"||r++}a=a.previousSibling}return null}function eR(a,r,f){switch(r=by(f),a){case"html":if(a=r.documentElement,!a)throw Error(n(452));return a;case"head":if(a=r.head,!a)throw Error(n(453));return a;case"body":if(a=r.body,!a)throw Error(n(454));return a;default:throw Error(n(451))}}function Mg(a){for(var r=a.attributes;r.length;)a.removeAttributeNode(r[0]);nt(a)}var io=new Map,tR=new Set;function Ey(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var pc=Y.d;Y.d={f:L4,r:N4,D:U4,C:O4,L:I4,m:F4,X:P4,S:H4,M:G4};function L4(){var a=pc.f(),r=q();return a||r}function N4(a){var r=je(a);r!==null&&r.tag===5&&r.type==="form"?hg(r):pc.r(a)}var jd=typeof document>"u"?null:document;function nR(a,r,f){var m=jd;if(m&&typeof r=="string"&&r){var A=Lt(r);A='link[rel="'+a+'"][href="'+A+'"]',typeof f=="string"&&(A+='[crossorigin="'+f+'"]'),tR.has(A)||(tR.add(A),a={rel:a,crossOrigin:f,href:r},m.querySelector(A)===null&&(r=m.createElement("link"),ds(r,"link",a),k(r),m.head.appendChild(r)))}}function U4(a){pc.D(a),nR("dns-prefetch",a,null)}function O4(a,r){pc.C(a,r),nR("preconnect",a,r)}function I4(a,r,f){pc.L(a,r,f);var m=jd;if(m&&a&&r){var A='link[rel="preload"][as="'+Lt(r)+'"]';r==="image"&&f&&f.imageSrcSet?(A+='[imagesrcset="'+Lt(f.imageSrcSet)+'"]',typeof f.imageSizes=="string"&&(A+='[imagesizes="'+Lt(f.imageSizes)+'"]')):A+='[href="'+Lt(a)+'"]';var E=A;switch(r){case"style":E=Zd(a);break;case"script":E=Qd(a)}io.has(E)||(a=v({rel:"preload",href:r==="image"&&f&&f.imageSrcSet?void 0:a,as:r},f),io.set(E,a),m.querySelector(A)!==null||r==="style"&&m.querySelector(bg(E))||r==="script"&&m.querySelector(Eg(E))||(r=m.createElement("link"),ds(r,"link",a),k(r),m.head.appendChild(r)))}}function F4(a,r){pc.m(a,r);var f=jd;if(f&&a){var m=r&&typeof r.as=="string"?r.as:"script",A='link[rel="modulepreload"][as="'+Lt(m)+'"][href="'+Lt(a)+'"]',E=A;switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":E=Qd(a)}if(!io.has(E)&&(a=v({rel:"modulepreload",href:a},r),io.set(E,a),f.querySelector(A)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(f.querySelector(Eg(E)))return}m=f.createElement("link"),ds(m,"link",a),k(m),f.head.appendChild(m)}}}function H4(a,r,f){pc.S(a,r,f);var m=jd;if(m&&a){var A=ht(m).hoistableStyles,E=Zd(a);r=r||"default";var U=A.get(E);if(!U){var X={loading:0,preload:null};if(U=m.querySelector(bg(E)))X.loading=5;else{a=v({rel:"stylesheet",href:a,"data-precedence":r},f),(f=io.get(E))&&_M(a,f);var re=U=m.createElement("link");k(re),ds(re,"link",a),re._p=new Promise(function(Te,ke){re.onload=Te,re.onerror=ke}),re.addEventListener("load",function(){X.loading|=1}),re.addEventListener("error",function(){X.loading|=2}),X.loading|=4,Ty(U,r,m)}U={type:"stylesheet",instance:U,count:1,state:X},A.set(E,U)}}}function P4(a,r){pc.X(a,r);var f=jd;if(f&&a){var m=ht(f).hoistableScripts,A=Qd(a),E=m.get(A);E||(E=f.querySelector(Eg(A)),E||(a=v({src:a,async:!0},r),(r=io.get(A))&&yM(a,r),E=f.createElement("script"),k(E),ds(E,"link",a),f.head.appendChild(E)),E={type:"script",instance:E,count:1,state:null},m.set(A,E))}}function G4(a,r){pc.M(a,r);var f=jd;if(f&&a){var m=ht(f).hoistableScripts,A=Qd(a),E=m.get(A);E||(E=f.querySelector(Eg(A)),E||(a=v({src:a,async:!0,type:"module"},r),(r=io.get(A))&&yM(a,r),E=f.createElement("script"),k(E),ds(E,"link",a),f.head.appendChild(E)),E={type:"script",instance:E,count:1,state:null},m.set(A,E))}}function iR(a,r,f,m){var A=(A=ve.current)?Ey(A):null;if(!A)throw Error(n(446));switch(a){case"meta":case"title":return null;case"style":return typeof f.precedence=="string"&&typeof f.href=="string"?(r=Zd(f.href),f=ht(A).hoistableStyles,m=f.get(r),m||(m={type:"style",instance:null,count:0,state:null},f.set(r,m)),m):{type:"void",instance:null,count:0,state:null};case"link":if(f.rel==="stylesheet"&&typeof f.href=="string"&&typeof f.precedence=="string"){a=Zd(f.href);var E=ht(A).hoistableStyles,U=E.get(a);if(U||(A=A.ownerDocument||A,U={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},E.set(a,U),(E=A.querySelector(bg(a)))&&!E._p&&(U.instance=E,U.state.loading=5),io.has(a)||(f={rel:"preload",as:"style",href:f.href,crossOrigin:f.crossOrigin,integrity:f.integrity,media:f.media,hrefLang:f.hrefLang,referrerPolicy:f.referrerPolicy},io.set(a,f),E||z4(A,a,f,U.state))),r&&m===null)throw Error(n(528,""));return U}if(r&&m!==null)throw Error(n(529,""));return null;case"script":return r=f.async,f=f.src,typeof f=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=Qd(f),f=ht(A).hoistableScripts,m=f.get(r),m||(m={type:"script",instance:null,count:0,state:null},f.set(r,m)),m):{type:"void",instance:null,count:0,state:null};default:throw Error(n(444,a))}}function Zd(a){return'href="'+Lt(a)+'"'}function bg(a){return'link[rel="stylesheet"]['+a+"]"}function aR(a){return v({},a,{"data-precedence":a.precedence,precedence:null})}function z4(a,r,f,m){a.querySelector('link[rel="preload"][as="style"]['+r+"]")?m.loading=1:(r=a.createElement("link"),m.preload=r,r.addEventListener("load",function(){return m.loading|=1}),r.addEventListener("error",function(){return m.loading|=2}),ds(r,"link",f),k(r),a.head.appendChild(r))}function Qd(a){return'[src="'+Lt(a)+'"]'}function Eg(a){return"script[async]"+a}function sR(a,r,f){if(r.count++,r.instance===null)switch(r.type){case"style":var m=a.querySelector('style[data-href~="'+Lt(f.href)+'"]');if(m)return r.instance=m,k(m),m;var A=v({},f,{"data-href":f.href,"data-precedence":f.precedence,href:null,precedence:null});return m=(a.ownerDocument||a).createElement("style"),k(m),ds(m,"style",A),Ty(m,f.precedence,a),r.instance=m;case"stylesheet":A=Zd(f.href);var E=a.querySelector(bg(A));if(E)return r.state.loading|=4,r.instance=E,k(E),E;m=aR(f),(A=io.get(A))&&_M(m,A),E=(a.ownerDocument||a).createElement("link"),k(E);var U=E;return U._p=new Promise(function(X,re){U.onload=X,U.onerror=re}),ds(E,"link",m),r.state.loading|=4,Ty(E,f.precedence,a),r.instance=E;case"script":return E=Qd(f.src),(A=a.querySelector(Eg(E)))?(r.instance=A,k(A),A):(m=f,(A=io.get(E))&&(m=v({},f),yM(m,A)),a=a.ownerDocument||a,A=a.createElement("script"),k(A),ds(A,"link",m),a.head.appendChild(A),r.instance=A);case"void":return null;default:throw Error(n(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(m=r.instance,r.state.loading|=4,Ty(m,f.precedence,a));return r.instance}function Ty(a,r,f){for(var m=f.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),A=m.length?m[m.length-1]:null,E=A,U=0;U<m.length;U++){var X=m[U];if(X.dataset.precedence===r)E=X;else if(E!==A)break}E?E.parentNode.insertBefore(a,E.nextSibling):(r=f.nodeType===9?f.head:f,r.insertBefore(a,r.firstChild))}function _M(a,r){a.crossOrigin==null&&(a.crossOrigin=r.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=r.referrerPolicy),a.title==null&&(a.title=r.title)}function yM(a,r){a.crossOrigin==null&&(a.crossOrigin=r.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=r.referrerPolicy),a.integrity==null&&(a.integrity=r.integrity)}var Cy=null;function rR(a,r,f){if(Cy===null){var m=new Map,A=Cy=new Map;A.set(f,m)}else A=Cy,m=A.get(f),m||(m=new Map,A.set(f,m));if(m.has(a))return m;for(m.set(a,null),f=f.getElementsByTagName(a),A=0;A<f.length;A++){var E=f[A];if(!(E[ot]||E[fn]||a==="link"&&E.getAttribute("rel")==="stylesheet")&&E.namespaceURI!=="http://www.w3.org/2000/svg"){var U=E.getAttribute(r)||"";U=a+U;var X=m.get(U);X?X.push(E):m.set(U,[E])}}return m}function oR(a,r,f){a=a.ownerDocument||a,a.head.insertBefore(f,r==="title"?a.querySelector("head > title"):null)}function V4(a,r,f){if(f===1||r.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;return r.rel==="stylesheet"?(a=r.disabled,typeof r.precedence=="string"&&a==null):!0;case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function lR(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function k4(a,r,f,m){if(f.type==="stylesheet"&&(typeof m.media!="string"||matchMedia(m.media).matches!==!1)&&(f.state.loading&4)===0){if(f.instance===null){var A=Zd(m.href),E=r.querySelector(bg(A));if(E){r=E._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(a.count++,a=Ry.bind(a),r.then(a,a)),f.state.loading|=4,f.instance=E,k(E);return}E=r.ownerDocument||r,m=aR(m),(A=io.get(A))&&_M(m,A),E=E.createElement("link"),k(E);var U=E;U._p=new Promise(function(X,re){U.onload=X,U.onerror=re}),ds(E,"link",m),f.instance=E}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(f,r),(r=f.state.preload)&&(f.state.loading&3)===0&&(a.count++,f=Ry.bind(a),r.addEventListener("load",f),r.addEventListener("error",f))}}var xM=0;function X4(a,r){return a.stylesheets&&a.count===0&&By(a,a.stylesheets),0<a.count||0<a.imgCount?function(f){var m=setTimeout(function(){if(a.stylesheets&&By(a,a.stylesheets),a.unsuspend){var E=a.unsuspend;a.unsuspend=null,E()}},6e4+r);0<a.imgBytes&&xM===0&&(xM=62500*b4());var A=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&By(a,a.stylesheets),a.unsuspend)){var E=a.unsuspend;a.unsuspend=null,E()}},(a.imgBytes>xM?50:800)+r);return a.unsuspend=f,function(){a.unsuspend=null,clearTimeout(m),clearTimeout(A)}}:null}function Ry(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)By(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var wy=null;function By(a,r){a.stylesheets=null,a.unsuspend!==null&&(a.count++,wy=new Map,r.forEach(Y4,a),wy=null,Ry.call(a))}function Y4(a,r){if(!(r.state.loading&4)){var f=wy.get(a);if(f)var m=f.get(null);else{f=new Map,wy.set(a,f);for(var A=a.querySelectorAll("link[data-precedence],style[data-precedence]"),E=0;E<A.length;E++){var U=A[E];(U.nodeName==="LINK"||U.getAttribute("media")!=="not all")&&(f.set(U.dataset.precedence,U),m=U)}m&&f.set(null,m)}A=r.instance,U=A.getAttribute("data-precedence"),E=f.get(U)||m,E===m&&f.set(null,A),f.set(U,A),this.count++,m=Ry.bind(this),A.addEventListener("load",m),A.addEventListener("error",m),E?E.parentNode.insertBefore(A,E.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(A,a.firstChild)),r.state.loading|=4}}var Tg={$$typeof:D,Provider:null,Consumer:null,_currentValue:$,_currentValue2:$,_threadCount:0};function J4(a,r,f,m,A,E,U,X,re){this.tag=1,this.containerInfo=a,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=bt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=bt(0),this.hiddenUpdates=bt(null),this.identifierPrefix=m,this.onUncaughtError=A,this.onCaughtError=E,this.onRecoverableError=U,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=re,this.incompleteTransitions=new Map}function cR(a,r,f,m,A,E,U,X,re,Te,ke,$e){return a=new J4(a,r,f,U,re,Te,ke,$e,X),r=1,E===!0&&(r|=24),E=os(3,null,null,r),a.current=E,E.stateNode=a,r=Um(),r.refCount++,a.pooledCache=r,r.refCount++,E.memoizedState={element:m,isDehydrated:f,cache:r},Gm(E),a}function uR(a){return a?(a=rl,a):rl}function fR(a,r,f,m,A,E){A=uR(A),m.context===null?m.context=A:m.pendingContext=A,m=qr(r),m.payload={element:f},E=E===void 0?null:E,E!==null&&(m.callback=E),f=To(a,m,r),f!==null&&(u(f,a,r),pl(f,a,r))}function hR(a,r){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var f=a.retryLane;a.retryLane=f!==0&&f<r?f:r}}function AM(a,r){hR(a,r),(a=a.alternate)&&hR(a,r)}function dR(a){if(a.tag===13||a.tag===31){var r=sl(a,67108864);r!==null&&u(r,a,67108864),AM(a,67108864)}}function pR(a){if(a.tag===13||a.tag===31){var r=hs();r=Zi(r);var f=sl(a,r);f!==null&&u(f,a,r),AM(a,r)}}var Dy=!0;function q4(a,r,f,m){var A=H.T;H.T=null;var E=Y.p;try{Y.p=2,SM(a,r,f,m)}finally{Y.p=E,H.T=A}}function K4(a,r,f,m){var A=H.T;H.T=null;var E=Y.p;try{Y.p=8,SM(a,r,f,m)}finally{Y.p=E,H.T=A}}function SM(a,r,f,m){if(Dy){var A=MM(m);if(A===null)lM(a,r,m,Ly,f),gR(a,m);else if(j4(A,a,r,f,m))m.stopPropagation();else if(gR(a,m),r&4&&-1<W4.indexOf(a)){for(;A!==null;){var E=je(A);if(E!==null)switch(E.tag){case 3:if(E=E.stateNode,E.current.memoizedState.isDehydrated){var U=Ye(E.pendingLanes);if(U!==0){var X=E;for(X.pendingLanes|=2,X.entangledLanes|=2;U;){var re=1<<31-pt(U);X.entanglements[1]|=re,U&=~re}Ml(E),(jn&6)===0&&(Zs=I()+500,xg(0))}}break;case 31:case 13:X=sl(E,2),X!==null&&u(X,E,2),q(),AM(E,2)}if(E=MM(m),E===null&&lM(a,r,m,Ly,f),E===A)break;A=E}A!==null&&m.stopPropagation()}else lM(a,r,m,null,f)}}function MM(a){return a=Ci(a),bM(a)}var Ly=null;function bM(a){if(Ly=null,a=Ze(a),a!==null){var r=o(a);if(r===null)a=null;else{var f=r.tag;if(f===13){if(a=l(r),a!==null)return a;a=null}else if(f===31){if(a=h(r),a!==null)return a;a=null}else if(f===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;a=null}else r!==a&&(a=null)}}return Ly=a,null}function mR(a){switch(a){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ue()){case Ie:return 2;case Xe:return 8;case Oe:case Bt:return 32;case gt:return 268435456;default:return 32}default:return 32}}var EM=!1,xu=null,Au=null,Su=null,Cg=new Map,Rg=new Map,Mu=[],W4="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function gR(a,r){switch(a){case"focusin":case"focusout":xu=null;break;case"dragenter":case"dragleave":Au=null;break;case"mouseover":case"mouseout":Su=null;break;case"pointerover":case"pointerout":Cg.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Rg.delete(r.pointerId)}}function wg(a,r,f,m,A,E){return a===null||a.nativeEvent!==E?(a={blockedOn:r,domEventName:f,eventSystemFlags:m,nativeEvent:E,targetContainers:[A]},r!==null&&(r=je(r),r!==null&&dR(r)),a):(a.eventSystemFlags|=m,r=a.targetContainers,A!==null&&r.indexOf(A)===-1&&r.push(A),a)}function j4(a,r,f,m,A){switch(r){case"focusin":return xu=wg(xu,a,r,f,m,A),!0;case"dragenter":return Au=wg(Au,a,r,f,m,A),!0;case"mouseover":return Su=wg(Su,a,r,f,m,A),!0;case"pointerover":var E=A.pointerId;return Cg.set(E,wg(Cg.get(E)||null,a,r,f,m,A)),!0;case"gotpointercapture":return E=A.pointerId,Rg.set(E,wg(Rg.get(E)||null,a,r,f,m,A)),!0}return!1}function vR(a){var r=Ze(a.target);if(r!==null){var f=o(r);if(f!==null){if(r=f.tag,r===13){if(r=l(f),r!==null){a.blockedOn=r,en(a.priority,function(){pR(f)});return}}else if(r===31){if(r=h(f),r!==null){a.blockedOn=r,en(a.priority,function(){pR(f)});return}}else if(r===3&&f.stateNode.current.memoizedState.isDehydrated){a.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}a.blockedOn=null}function Ny(a){if(a.blockedOn!==null)return!1;for(var r=a.targetContainers;0<r.length;){var f=MM(a.nativeEvent);if(f===null){f=a.nativeEvent;var m=new f.constructor(f.type,f);ti=m,f.target.dispatchEvent(m),ti=null}else return r=je(f),r!==null&&dR(r),a.blockedOn=f,!1;r.shift()}return!0}function _R(a,r,f){Ny(a)&&f.delete(r)}function Z4(){EM=!1,xu!==null&&Ny(xu)&&(xu=null),Au!==null&&Ny(Au)&&(Au=null),Su!==null&&Ny(Su)&&(Su=null),Cg.forEach(_R),Rg.forEach(_R)}function Uy(a,r){a.blockedOn===r&&(a.blockedOn=null,EM||(EM=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,Z4)))}var Oy=null;function yR(a){Oy!==a&&(Oy=a,s.unstable_scheduleCallback(s.unstable_NormalPriority,function(){Oy===a&&(Oy=null);for(var r=0;r<a.length;r+=3){var f=a[r],m=a[r+1],A=a[r+2];if(typeof m!="function"){if(bM(m||f)===null)continue;break}var E=je(f);E!==null&&(a.splice(r,3),r-=3,fg(E,{pending:!0,data:A,method:f.method,action:m},m,A))}}))}function $d(a){function r(re){return Uy(re,a)}xu!==null&&Uy(xu,a),Au!==null&&Uy(Au,a),Su!==null&&Uy(Su,a),Cg.forEach(r),Rg.forEach(r);for(var f=0;f<Mu.length;f++){var m=Mu[f];m.blockedOn===a&&(m.blockedOn=null)}for(;0<Mu.length&&(f=Mu[0],f.blockedOn===null);)vR(f),f.blockedOn===null&&Mu.shift();if(f=(a.ownerDocument||a).$$reactFormReplay,f!=null)for(m=0;m<f.length;m+=3){var A=f[m],E=f[m+1],U=A[G]||null;if(typeof E=="function")U||yR(f);else if(U){var X=null;if(E&&E.hasAttribute("formAction")){if(A=E,U=E[G]||null)X=U.formAction;else if(bM(A)!==null)continue}else X=U.action;typeof X=="function"?f[m+1]=X:(f.splice(m,3),m-=3),yR(f)}}}function xR(){function a(E){E.canIntercept&&E.info==="react-transition"&&E.intercept({handler:function(){return new Promise(function(U){return A=U})},focusReset:"manual",scroll:"manual"})}function r(){A!==null&&(A(),A=null),m||setTimeout(f,20)}function f(){if(!m&&!navigation.transition){var E=navigation.currentEntry;E&&E.url!=null&&navigation.navigate(E.url,{state:E.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var m=!1,A=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(f,100),function(){m=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),A!==null&&(A(),A=null)}}}function TM(a){this._internalRoot=a}Iy.prototype.render=TM.prototype.render=function(a){var r=this._internalRoot;if(r===null)throw Error(n(409));var f=r.current,m=hs();fR(f,m,a,r,null,null)},Iy.prototype.unmount=TM.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var r=a.containerInfo;fR(a.current,2,null,a,null,null),q(),r[J]=null}};function Iy(a){this._internalRoot=a}Iy.prototype.unstable_scheduleHydration=function(a){if(a){var r=vi();a={blockedOn:null,target:a,priority:r};for(var f=0;f<Mu.length&&r!==0&&r<Mu[f].priority;f++);Mu.splice(f,0,a),f===0&&vR(a)}};var AR=e.version;if(AR!=="19.2.3")throw Error(n(527,AR,"19.2.3"));Y.findDOMNode=function(a){var r=a._reactInternals;if(r===void 0)throw typeof a.render=="function"?Error(n(188)):(a=Object.keys(a).join(","),Error(n(268,a)));return a=p(r),a=a!==null?_(a):null,a=a===null?null:a.stateNode,a};var Q4={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Fy=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Fy.isDisabled&&Fy.supportsFiber)try{ze=Fy.inject(Q4),qe=Fy}catch{}}return ep.createRoot=function(a,r){if(!i(a))throw Error(n(299));var f=!1,m="",A=mg,E=my,U=Id;return r!=null&&(r.unstable_strictMode===!0&&(f=!0),r.identifierPrefix!==void 0&&(m=r.identifierPrefix),r.onUncaughtError!==void 0&&(A=r.onUncaughtError),r.onCaughtError!==void 0&&(E=r.onCaughtError),r.onRecoverableError!==void 0&&(U=r.onRecoverableError)),r=cR(a,1,!1,null,null,f,m,null,A,E,U,xR),a[J]=r.current,oM(a),new TM(r)},ep.hydrateRoot=function(a,r,f){if(!i(a))throw Error(n(299));var m=!1,A="",E=mg,U=my,X=Id,re=null;return f!=null&&(f.unstable_strictMode===!0&&(m=!0),f.identifierPrefix!==void 0&&(A=f.identifierPrefix),f.onUncaughtError!==void 0&&(E=f.onUncaughtError),f.onCaughtError!==void 0&&(U=f.onCaughtError),f.onRecoverableError!==void 0&&(X=f.onRecoverableError),f.formState!==void 0&&(re=f.formState)),r=cR(a,1,!0,r,f??null,m,A,re,E,U,X,xR),r.context=uR(null),f=r.current,m=hs(),m=Zi(m),A=qr(m),A.callback=null,To(f,A,m),f=m,r.current.lanes=f,Dn(r,f),Ml(r),a[J]=r.current,oM(a),new Iy(r)},ep.version="19.2.3",ep}var OM;function RR(){if(OM)return zy.exports;OM=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(e){console.error(e)}}return s(),zy.exports=CR(),zy.exports}var wR=RR(),Yy={exports:{}},tp={};var IM;function BR(){if(IM)return tp;IM=1;var s=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(n,i,o){var l=null;if(o!==void 0&&(l=""+o),i.key!==void 0&&(l=""+i.key),"key"in i){o={};for(var h in i)h!=="key"&&(o[h]=i[h])}else o=i;return i=o.ref,{$$typeof:s,type:n,key:l,ref:i!==void 0?i:null,props:o}}return tp.Fragment=e,tp.jsx=t,tp.jsxs=t,tp}var FM;function DR(){return FM||(FM=1,Yy.exports=BR()),Yy.exports}var Jt=DR();function Jy(){return Jy=Object.assign?Object.assign.bind():function(s){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(s[n]=t[n])}return s},Jy.apply(null,arguments)}const np="182",LR={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},NR={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},HM=0,qy=1,PM=2,UR=3,GM=0,th=1,ip=2,Eu=3,ao=0,ws=1,hr=2,so=0,Tu=1,Ky=2,Wy=3,jy=4,zM=5,mc=100,VM=101,kM=102,XM=103,YM=104,JM=200,qM=201,KM=202,WM=203,Bg=204,Dg=205,jM=206,ZM=207,QM=208,$M=209,eb=210,tb=211,nb=212,ib=213,ab=214,Lg=0,Ng=1,Ug=2,Cu=3,Og=4,Ig=5,Fg=6,Hg=7,ap=0,sb=1,rb=2,Lr=0,Zy=1,Qy=2,$y=3,Pg=4,ex=5,tx=6,nx=7,ix="attached",ob="detached",gc=300,ro=301,vc=302,nh=303,sp=304,ih=306,oo=1e3,Gi=1001,Ru=1002,zi=1003,rp=1004,OR=1004,_c=1005,IR=1005,In=1006,wu=1007,FR=1007,$s=1008,ax=1008,Xa=1009,Gg=1010,zg=1011,ah=1012,op=1013,dr=1014,Vi=1015,sa=1016,Vg=1017,kg=1018,sh=1020,sx=35902,rx=35899,ox=1021,lx=1022,ga=1023,Ho=1026,yc=1027,lp=1028,cp=1029,Bu=1030,Xg=1031,HR=1032,Yg=1033,up=33776,fp=33777,hp=33778,dp=33779,Jg=35840,qg=35841,Kg=35842,Wg=35843,jg=36196,Zg=37492,Qg=37496,$g=37488,e0=37489,t0=37490,n0=37491,i0=37808,a0=37809,s0=37810,r0=37811,o0=37812,l0=37813,c0=37814,u0=37815,f0=37816,h0=37817,d0=37818,p0=37819,m0=37820,g0=37821,v0=36492,_0=36494,y0=36495,x0=36283,A0=36284,S0=36285,M0=36286,pp=2200,lb=2201,cb=2202,Du=2300,xc=2301,b0=2302,Lu=2400,Nu=2401,mp=2402,E0=2500,cx=2501,ux=0,gp=1,Uu=2,ub=3200,PR=3201,GR=3202,zR=3203,Ac=0,fb=1,El="",ra="srgb",Ma="srgb-linear",vp="linear",gi="srgb",VR="",kR="rg",XR="ga",YR=0,Ou=7680,JR=7681,qR=7682,KR=7683,WR=34055,jR=34056,ZR=5386,QR=512,$R=513,e2=514,t2=515,n2=516,i2=517,a2=518,fx=519,hb=512,db=513,pb=514,T0=515,mb=516,gb=517,C0=518,vb=519,_p=35044,s2=35048,r2=35040,o2=35045,l2=35049,c2=35041,u2=35046,f2=35050,h2=35042,d2="100",hx="300 es",pr=2e3,rh=2001,p2={COMPUTE:"compute",RENDER:"render"},m2={PERSPECTIVE:"perspective",LINEAR:"linear",FLAT:"flat"},g2={NORMAL:"normal",CENTROID:"centroid",SAMPLE:"sample",FIRST:"first",EITHER:"either"};function _b(s){for(let e=s.length-1;e>=0;--e)if(s[e]>=65535)return!0;return!1}const v2={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function oh(s,e){return new v2[s](e)}function yb(s){return ArrayBuffer.isView(s)&&!(s instanceof DataView)}function yp(s){return document.createElementNS("http://www.w3.org/1999/xhtml",s)}function xb(){const s=yp("canvas");return s.style.display="block",s}const Ab={};let Sc=null;function _2(s){Sc=s}function y2(){return Sc}function xp(...s){const e="THREE."+s.shift();Sc?Sc("log",e,...s):console.log(e,...s)}function Ot(...s){const e="THREE."+s.shift();Sc?Sc("warn",e,...s):console.warn(e,...s)}function an(...s){const e="THREE."+s.shift();Sc?Sc("error",e,...s):console.error(e,...s)}function lh(...s){const e=s.join(" ");e in Ab||(Ab[e]=!0,Ot(...s))}function x2(s,e,t){return new Promise(function(n,i){function o(){switch(s.clientWaitSync(e,s.SYNC_FLUSH_COMMANDS_BIT,0)){case s.WAIT_FAILED:i();break;case s.TIMEOUT_EXPIRED:setTimeout(o,t);break;default:n()}}setTimeout(o,t)})}class Po{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){const n=this._listeners;return n===void 0?!1:n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){const n=this._listeners;if(n===void 0)return;const i=n[e];if(i!==void 0){const o=i.indexOf(t);o!==-1&&i.splice(o,1)}}dispatchEvent(e){const t=this._listeners;if(t===void 0)return;const n=t[e.type];if(n!==void 0){e.target=this;const i=n.slice(0);for(let o=0,l=i.length;o<l;o++)i[o].call(this,e);e.target=null}}}const ms=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let Sb=1234567;const Iu=Math.PI/180,ch=180/Math.PI;function mr(){const s=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(ms[s&255]+ms[s>>8&255]+ms[s>>16&255]+ms[s>>24&255]+"-"+ms[e&255]+ms[e>>8&255]+"-"+ms[e>>16&15|64]+ms[e>>24&255]+"-"+ms[t&63|128]+ms[t>>8&255]+"-"+ms[t>>16&255]+ms[t>>24&255]+ms[n&255]+ms[n>>8&255]+ms[n>>16&255]+ms[n>>24&255]).toLowerCase()}function _n(s,e,t){return Math.max(e,Math.min(t,s))}function dx(s,e){return(s%e+e)%e}function A2(s,e,t,n,i){return n+(s-e)*(i-n)/(t-e)}function S2(s,e,t){return s!==e?(t-s)/(e-s):0}function Ap(s,e,t){return(1-t)*s+t*e}function M2(s,e,t,n){return Ap(s,e,1-Math.exp(-t*n))}function b2(s,e=1){return e-Math.abs(dx(s,e*2)-e)}function E2(s,e,t){return s<=e?0:s>=t?1:(s=(s-e)/(t-e),s*s*(3-2*s))}function T2(s,e,t){return s<=e?0:s>=t?1:(s=(s-e)/(t-e),s*s*s*(s*(s*6-15)+10))}function C2(s,e){return s+Math.floor(Math.random()*(e-s+1))}function R2(s,e){return s+Math.random()*(e-s)}function w2(s){return s*(.5-Math.random())}function B2(s){s!==void 0&&(Sb=s);let e=Sb+=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 D2(s){return s*Iu}function L2(s){return s*ch}function N2(s){return(s&s-1)===0&&s!==0}function U2(s){return Math.pow(2,Math.ceil(Math.log(s)/Math.LN2))}function O2(s){return Math.pow(2,Math.floor(Math.log(s)/Math.LN2))}function I2(s,e,t,n,i){const o=Math.cos,l=Math.sin,h=o(t/2),d=l(t/2),p=o((e+n)/2),_=l((e+n)/2),v=o((e-n)/2),y=l((e-n)/2),x=o((n-e)/2),b=l((n-e)/2);switch(i){case"XYX":s.set(h*_,d*v,d*y,h*p);break;case"YZY":s.set(d*y,h*_,d*v,h*p);break;case"ZXZ":s.set(d*v,d*y,h*_,h*p);break;case"XZX":s.set(h*_,d*b,d*x,h*p);break;case"YXY":s.set(d*x,h*_,d*b,h*p);break;case"ZYZ":s.set(d*b,d*x,h*_,h*p);break;default:Ot("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function Bs(s,e){switch(e.constructor){case Float32Array:return s;case Uint32Array:return s/4294967295;case Uint16Array:return s/65535;case Uint8Array:return s/255;case Int32Array:return Math.max(s/2147483647,-1);case Int16Array:return Math.max(s/32767,-1);case Int8Array:return Math.max(s/127,-1);default:throw new Error("Invalid component type.")}}function Bn(s,e){switch(e.constructor){case Float32Array:return s;case Uint32Array:return Math.round(s*4294967295);case Uint16Array:return Math.round(s*65535);case Uint8Array:return Math.round(s*255);case Int32Array:return Math.round(s*2147483647);case Int16Array:return Math.round(s*32767);case Int8Array:return Math.round(s*127);default:throw new Error("Invalid component type.")}}const R0={DEG2RAD:Iu,RAD2DEG:ch,generateUUID:mr,clamp:_n,euclideanModulo:dx,mapLinear:A2,inverseLerp:S2,lerp:Ap,damp:M2,pingpong:b2,smoothstep:E2,smootherstep:T2,randInt:C2,randFloat:R2,randFloatSpread:w2,seededRandom:B2,degToRad:D2,radToDeg:L2,isPowerOfTwo:N2,ceilPowerOfTwo:U2,floorPowerOfTwo:O2,setQuaternionFromProperEuler:I2,normalize:Bn,denormalize:Bs};class et{constructor(e=0,t=0){et.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,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=_n(this.x,e.x,t.x),this.y=_n(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=_n(this.x,e,t),this.y=_n(this.y,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(_n(n,e,t))}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 n=this.dot(e)/t;return Math.acos(_n(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}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,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,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 n=Math.cos(t),i=Math.sin(t),o=this.x-e.x,l=this.y-e.y;return this.x=o*n-l*i+e.x,this.y=o*i+l*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Ya{constructor(e=0,t=0,n=0,i=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=i}static slerpFlat(e,t,n,i,o,l,h){let d=n[i+0],p=n[i+1],_=n[i+2],v=n[i+3],y=o[l+0],x=o[l+1],b=o[l+2],R=o[l+3];if(h<=0){e[t+0]=d,e[t+1]=p,e[t+2]=_,e[t+3]=v;return}if(h>=1){e[t+0]=y,e[t+1]=x,e[t+2]=b,e[t+3]=R;return}if(v!==R||d!==y||p!==x||_!==b){let T=d*y+p*x+_*b+v*R;T<0&&(y=-y,x=-x,b=-b,R=-R,T=-T);let M=1-h;if(T<.9995){const w=Math.acos(T),D=Math.sin(w);M=Math.sin(M*w)/D,h=Math.sin(h*w)/D,d=d*M+y*h,p=p*M+x*h,_=_*M+b*h,v=v*M+R*h}else{d=d*M+y*h,p=p*M+x*h,_=_*M+b*h,v=v*M+R*h;const w=1/Math.sqrt(d*d+p*p+_*_+v*v);d*=w,p*=w,_*=w,v*=w}}e[t]=d,e[t+1]=p,e[t+2]=_,e[t+3]=v}static multiplyQuaternionsFlat(e,t,n,i,o,l){const h=n[i],d=n[i+1],p=n[i+2],_=n[i+3],v=o[l],y=o[l+1],x=o[l+2],b=o[l+3];return e[t]=h*b+_*v+d*x-p*y,e[t+1]=d*b+_*y+p*v-h*x,e[t+2]=p*b+_*x+h*y-d*v,e[t+3]=_*b-h*v-d*y-p*x,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,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const n=e._x,i=e._y,o=e._z,l=e._order,h=Math.cos,d=Math.sin,p=h(n/2),_=h(i/2),v=h(o/2),y=d(n/2),x=d(i/2),b=d(o/2);switch(l){case"XYZ":this._x=y*_*v+p*x*b,this._y=p*x*v-y*_*b,this._z=p*_*b+y*x*v,this._w=p*_*v-y*x*b;break;case"YXZ":this._x=y*_*v+p*x*b,this._y=p*x*v-y*_*b,this._z=p*_*b-y*x*v,this._w=p*_*v+y*x*b;break;case"ZXY":this._x=y*_*v-p*x*b,this._y=p*x*v+y*_*b,this._z=p*_*b+y*x*v,this._w=p*_*v-y*x*b;break;case"ZYX":this._x=y*_*v-p*x*b,this._y=p*x*v+y*_*b,this._z=p*_*b-y*x*v,this._w=p*_*v+y*x*b;break;case"YZX":this._x=y*_*v+p*x*b,this._y=p*x*v+y*_*b,this._z=p*_*b-y*x*v,this._w=p*_*v-y*x*b;break;case"XZY":this._x=y*_*v-p*x*b,this._y=p*x*v-y*_*b,this._z=p*_*b+y*x*v,this._w=p*_*v+y*x*b;break;default:Ot("Quaternion: .setFromEuler() encountered an unknown order: "+l)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],i=t[4],o=t[8],l=t[1],h=t[5],d=t[9],p=t[2],_=t[6],v=t[10],y=n+h+v;if(y>0){const x=.5/Math.sqrt(y+1);this._w=.25/x,this._x=(_-d)*x,this._y=(o-p)*x,this._z=(l-i)*x}else if(n>h&&n>v){const x=2*Math.sqrt(1+n-h-v);this._w=(_-d)/x,this._x=.25*x,this._y=(i+l)/x,this._z=(o+p)/x}else if(h>v){const x=2*Math.sqrt(1+h-n-v);this._w=(o-p)/x,this._x=(i+l)/x,this._y=.25*x,this._z=(d+_)/x}else{const x=2*Math.sqrt(1+v-n-h);this._w=(l-i)/x,this._x=(o+p)/x,this._y=(d+_)/x,this._z=.25*x}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<1e-8?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(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=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(_n(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(n===0)return this;const i=Math.min(1,t/n);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,i=e._y,o=e._z,l=e._w,h=t._x,d=t._y,p=t._z,_=t._w;return this._x=n*_+l*h+i*p-o*d,this._y=i*_+l*d+o*h-n*p,this._z=o*_+l*p+n*d-i*h,this._w=l*_-n*h-i*d-o*p,this._onChangeCallback(),this}slerp(e,t){if(t<=0)return this;if(t>=1)return this.copy(e);let n=e._x,i=e._y,o=e._z,l=e._w,h=this.dot(e);h<0&&(n=-n,i=-i,o=-o,l=-l,h=-h);let d=1-t;if(h<.9995){const p=Math.acos(h),_=Math.sin(p);d=Math.sin(d*p)/_,t=Math.sin(t*p)/_,this._x=this._x*d+n*t,this._y=this._y*d+i*t,this._z=this._z*d+o*t,this._w=this._w*d+l*t,this._onChangeCallback()}else this._x=this._x*d+n*t,this._y=this._y*d+i*t,this._z=this._z*d+o*t,this._w=this._w*d+l*t,this.normalize();return this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),o=Math.sqrt(n);return this.set(i*Math.sin(e),i*Math.cos(e),o*Math.sin(t),o*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 Z{constructor(e=0,t=0,n=0){Z.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,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(Mb.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Mb.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,i=this.z,o=e.elements;return this.x=o[0]*t+o[3]*n+o[6]*i,this.y=o[1]*t+o[4]*n+o[7]*i,this.z=o[2]*t+o[5]*n+o[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,o=e.elements,l=1/(o[3]*t+o[7]*n+o[11]*i+o[15]);return this.x=(o[0]*t+o[4]*n+o[8]*i+o[12])*l,this.y=(o[1]*t+o[5]*n+o[9]*i+o[13])*l,this.z=(o[2]*t+o[6]*n+o[10]*i+o[14])*l,this}applyQuaternion(e){const t=this.x,n=this.y,i=this.z,o=e.x,l=e.y,h=e.z,d=e.w,p=2*(l*i-h*n),_=2*(h*t-o*i),v=2*(o*n-l*t);return this.x=t+d*p+l*v-h*_,this.y=n+d*_+h*p-o*v,this.z=i+d*v+o*_-l*p,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,n=this.y,i=this.z,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*i,this.y=o[1]*t+o[5]*n+o[9]*i,this.z=o[2]*t+o[6]*n+o[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=_n(this.x,e.x,t.x),this.y=_n(this.y,e.y,t.y),this.z=_n(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=_n(this.x,e,t),this.y=_n(this.y,e,t),this.z=_n(this.z,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(_n(n,e,t))}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,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,i=e.y,o=e.z,l=t.x,h=t.y,d=t.z;return this.x=i*d-o*h,this.y=o*l-n*d,this.z=n*h-i*l,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return px.copy(this).projectOnVector(e),this.sub(px)}reflect(e){return this.sub(px.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 n=this.dot(e)/t;return Math.acos(_n(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,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(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const px=new Z,Mb=new Ya;class Tn{constructor(e,t,n,i,o,l,h,d,p){Tn.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,i,o,l,h,d,p)}set(e,t,n,i,o,l,h,d,p){const _=this.elements;return _[0]=e,_[1]=i,_[2]=h,_[3]=t,_[4]=o,_[5]=d,_[6]=n,_[7]=l,_[8]=p,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.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 n=e.elements,i=t.elements,o=this.elements,l=n[0],h=n[3],d=n[6],p=n[1],_=n[4],v=n[7],y=n[2],x=n[5],b=n[8],R=i[0],T=i[3],M=i[6],w=i[1],D=i[4],L=i[7],P=i[2],O=i[5],z=i[8];return o[0]=l*R+h*w+d*P,o[3]=l*T+h*D+d*O,o[6]=l*M+h*L+d*z,o[1]=p*R+_*w+v*P,o[4]=p*T+_*D+v*O,o[7]=p*M+_*L+v*z,o[2]=y*R+x*w+b*P,o[5]=y*T+x*D+b*O,o[8]=y*M+x*L+b*z,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],n=e[1],i=e[2],o=e[3],l=e[4],h=e[5],d=e[6],p=e[7],_=e[8];return t*l*_-t*h*p-n*o*_+n*h*d+i*o*p-i*l*d}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],o=e[3],l=e[4],h=e[5],d=e[6],p=e[7],_=e[8],v=_*l-h*p,y=h*d-_*o,x=p*o-l*d,b=t*v+n*y+i*x;if(b===0)return this.set(0,0,0,0,0,0,0,0,0);const R=1/b;return e[0]=v*R,e[1]=(i*p-_*n)*R,e[2]=(h*n-i*l)*R,e[3]=y*R,e[4]=(_*t-i*d)*R,e[5]=(i*o-h*t)*R,e[6]=x*R,e[7]=(n*d-p*t)*R,e[8]=(l*t-n*o)*R,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,n,i,o,l,h){const d=Math.cos(o),p=Math.sin(o);return this.set(n*d,n*p,-n*(d*l+p*h)+l+e,-i*p,i*d,-i*(-p*l+d*h)+h+t,0,0,1),this}scale(e,t){return this.premultiply(mx.makeScale(e,t)),this}rotate(e){return this.premultiply(mx.makeRotation(-e)),this}translate(e,t){return this.premultiply(mx.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),n=Math.sin(e);return this.set(t,-n,0,n,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,n=e.elements;for(let i=0;i<9;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const mx=new Tn,bb=new Tn().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Eb=new Tn().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function F2(){const s={enabled:!0,workingColorSpace:Ma,spaces:{},convert:function(i,o,l){return this.enabled===!1||o===l||!o||!l||(this.spaces[o].transfer===gi&&(i.r=Tl(i.r),i.g=Tl(i.g),i.b=Tl(i.b)),this.spaces[o].primaries!==this.spaces[l].primaries&&(i.applyMatrix3(this.spaces[o].toXYZ),i.applyMatrix3(this.spaces[l].fromXYZ)),this.spaces[l].transfer===gi&&(i.r=uh(i.r),i.g=uh(i.g),i.b=uh(i.b))),i},workingToColorSpace:function(i,o){return this.convert(i,this.workingColorSpace,o)},colorSpaceToWorking:function(i,o){return this.convert(i,o,this.workingColorSpace)},getPrimaries:function(i){return this.spaces[i].primaries},getTransfer:function(i){return i===El?vp:this.spaces[i].transfer},getToneMappingMode:function(i){return this.spaces[i].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(i,o=this.workingColorSpace){return i.fromArray(this.spaces[o].luminanceCoefficients)},define:function(i){Object.assign(this.spaces,i)},_getMatrix:function(i,o,l){return i.copy(this.spaces[o].toXYZ).multiply(this.spaces[l].fromXYZ)},_getDrawingBufferColorSpace:function(i){return this.spaces[i].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(i=this.workingColorSpace){return this.spaces[i].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(i,o){return lh("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),s.workingToColorSpace(i,o)},toWorkingColorSpace:function(i,o){return lh("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),s.colorSpaceToWorking(i,o)}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],n=[.3127,.329];return s.define({[Ma]:{primaries:e,whitePoint:n,transfer:vp,toXYZ:bb,fromXYZ:Eb,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:ra},outputColorSpaceConfig:{drawingBufferColorSpace:ra}},[ra]:{primaries:e,whitePoint:n,transfer:gi,toXYZ:bb,fromXYZ:Eb,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:ra}}}),s}const Hn=F2();function Tl(s){return s<.04045?s*.0773993808:Math.pow(s*.9478672986+.0521327014,2.4)}function uh(s){return s<.0031308?s*12.92:1.055*Math.pow(s,.41666)-.055}let fh;class Tb{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{fh===void 0&&(fh=yp("canvas")),fh.width=e.width,fh.height=e.height;const i=fh.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),n=fh}return n.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=yp("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const i=n.getImageData(0,0,e.width,e.height),o=i.data;for(let l=0;l<o.length;l++)o[l]=Tl(o[l]/255)*255;return n.putImageData(i,0,0),t}else if(e.data){const t=e.data.slice(0);for(let n=0;n<t.length;n++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[n]=Math.floor(Tl(t[n]/255)*255):t[n]=Tl(t[n]);return{data:t,width:e.width,height:e.height}}else return Ot("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let H2=0;class Mc{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:H2++}),this.uuid=mr(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){const t=this.data;return typeof HTMLVideoElement<"u"&&t instanceof HTMLVideoElement?e.set(t.videoWidth,t.videoHeight,0):typeof VideoFrame<"u"&&t instanceof VideoFrame?e.set(t.displayHeight,t.displayWidth,0):t!==null?e.set(t.width,t.height,t.depth||0):e.set(0,0,0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const n={uuid:this.uuid,url:""},i=this.data;if(i!==null){let o;if(Array.isArray(i)){o=[];for(let l=0,h=i.length;l<h;l++)i[l].isDataTexture?o.push(gx(i[l].image)):o.push(gx(i[l]))}else o=gx(i);n.url=o}return t||(e.images[this.uuid]=n),n}}function gx(s){return typeof HTMLImageElement<"u"&&s instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&s instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&s instanceof ImageBitmap?Tb.getDataURL(s):s.data?{data:Array.from(s.data),width:s.width,height:s.height,type:s.data.constructor.name}:(Ot("Texture: Unable to serialize Texture."),{})}let P2=0;const vx=new Z;class li extends Po{constructor(e=li.DEFAULT_IMAGE,t=li.DEFAULT_MAPPING,n=Gi,i=Gi,o=In,l=$s,h=ga,d=Xa,p=li.DEFAULT_ANISOTROPY,_=El){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:P2++}),this.uuid=mr(),this.name="",this.source=new Mc(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=o,this.minFilter=l,this.anisotropy=p,this.format=h,this.internalFormat=null,this.type=d,this.offset=new et(0,0),this.repeat=new et(1,1),this.center=new et(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Tn,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=_,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(e&&e.depth&&e.depth>1),this.pmremVersion=0}get width(){return this.source.getSize(vx).x}get height(){return this.source.getSize(vx).y}get depth(){return this.source.getSize(vx).z}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const t in e){const n=e[t];if(n===void 0){Ot(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}const i=this[t];if(i===void 0){Ot(`Texture.setValues(): property '${t}' does not exist.`);continue}i&&n&&i.isVector2&&n.isVector2||i&&n&&i.isVector3&&n.isVector3||i&&n&&i.isMatrix3&&n.isMatrix3?i.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const n={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==gc)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case oo:e.x=e.x-Math.floor(e.x);break;case Gi:e.x=e.x<0?0:1;break;case Ru: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 oo:e.y=e.y-Math.floor(e.y);break;case Gi:e.y=e.y<0?0:1;break;case Ru: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++}}li.DEFAULT_IMAGE=null,li.DEFAULT_MAPPING=gc,li.DEFAULT_ANISOTROPY=1;class Ti{constructor(e=0,t=0,n=0,i=1){Ti.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,o=this.w,l=e.elements;return this.x=l[0]*t+l[4]*n+l[8]*i+l[12]*o,this.y=l[1]*t+l[5]*n+l[9]*i+l[13]*o,this.z=l[2]*t+l[6]*n+l[10]*i+l[14]*o,this.w=l[3]*t+l[7]*n+l[11]*i+l[15]*o,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,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,n,i,o;const d=e.elements,p=d[0],_=d[4],v=d[8],y=d[1],x=d[5],b=d[9],R=d[2],T=d[6],M=d[10];if(Math.abs(_-y)<.01&&Math.abs(v-R)<.01&&Math.abs(b-T)<.01){if(Math.abs(_+y)<.1&&Math.abs(v+R)<.1&&Math.abs(b+T)<.1&&Math.abs(p+x+M-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const D=(p+1)/2,L=(x+1)/2,P=(M+1)/2,O=(_+y)/4,z=(v+R)/4,V=(b+T)/4;return D>L&&D>P?D<.01?(n=0,i=.707106781,o=.707106781):(n=Math.sqrt(D),i=O/n,o=z/n):L>P?L<.01?(n=.707106781,i=0,o=.707106781):(i=Math.sqrt(L),n=O/i,o=V/i):P<.01?(n=.707106781,i=.707106781,o=0):(o=Math.sqrt(P),n=z/o,i=V/o),this.set(n,i,o,t),this}let w=Math.sqrt((T-b)*(T-b)+(v-R)*(v-R)+(y-_)*(y-_));return Math.abs(w)<.001&&(w=1),this.x=(T-b)/w,this.y=(v-R)/w,this.z=(y-_)/w,this.w=Math.acos((p+x+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=_n(this.x,e.x,t.x),this.y=_n(this.y,e.y,t.y),this.z=_n(this.z,e.z,t.z),this.w=_n(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=_n(this.x,e,t),this.y=_n(this.y,e,t),this.z=_n(this.z,e,t),this.w=_n(this.w,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(_n(n,e,t))}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,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,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 _x extends Po{constructor(e=1,t=1,n={}){super(),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:In,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},n),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=n.depth,this.scissor=new Ti(0,0,e,t),this.scissorTest=!1,this.viewport=new Ti(0,0,e,t);const i={width:e,height:t,depth:n.depth},o=new li(i);this.textures=[];const l=n.count;for(let h=0;h<l;h++)this.textures[h]=o.clone(),this.textures[h].isRenderTargetTexture=!0,this.textures[h].renderTarget=this;this._setTextureOptions(n),this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=n.depthTexture,this.samples=n.samples,this.multiview=n.multiview}_setTextureOptions(e={}){const t={minFilter:In,generateMipmaps:!1,flipY:!1,internalFormat:null};e.mapping!==void 0&&(t.mapping=e.mapping),e.wrapS!==void 0&&(t.wrapS=e.wrapS),e.wrapT!==void 0&&(t.wrapT=e.wrapT),e.wrapR!==void 0&&(t.wrapR=e.wrapR),e.magFilter!==void 0&&(t.magFilter=e.magFilter),e.minFilter!==void 0&&(t.minFilter=e.minFilter),e.format!==void 0&&(t.format=e.format),e.type!==void 0&&(t.type=e.type),e.anisotropy!==void 0&&(t.anisotropy=e.anisotropy),e.colorSpace!==void 0&&(t.colorSpace=e.colorSpace),e.flipY!==void 0&&(t.flipY=e.flipY),e.generateMipmaps!==void 0&&(t.generateMipmaps=e.generateMipmaps),e.internalFormat!==void 0&&(t.internalFormat=e.internalFormat);for(let n=0;n<this.textures.length;n++)this.textures[n].setValues(t)}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),e!==null&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let i=0,o=this.textures.length;i<o;i++)this.textures[i].image.width=e,this.textures[i].image.height=t,this.textures[i].image.depth=n,this.textures[i].isData3DTexture!==!0&&(this.textures[i].isArrayTexture=this.textures[i].image.depth>1);this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,n=e.textures.length;t<n;t++){this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;const i=Object.assign({},e.textures[t].image);this.textures[t].source=new Mc(i)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Ds extends _x{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}}class w0 extends li{constructor(e=null,t=1,n=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=zi,this.minFilter=zi,this.wrapR=Gi,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class G2 extends Ds{constructor(e=1,t=1,n=1,i={}){super(e,t,i),this.isWebGLArrayRenderTarget=!0,this.depth=n,this.texture=new w0(null,e,t,n),this._setTextureOptions(i),this.texture.isRenderTargetTexture=!0}}class B0 extends li{constructor(e=null,t=1,n=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=zi,this.minFilter=zi,this.wrapR=Gi,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class z2 extends Ds{constructor(e=1,t=1,n=1,i={}){super(e,t,i),this.isWebGL3DRenderTarget=!0,this.depth=n,this.texture=new B0(null,e,t,n),this._setTextureOptions(i),this.texture.isRenderTargetTexture=!0}}class Ja{constructor(e=new Z(1/0,1/0,1/0),t=new Z(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t+=3)this.expandByPoint(lo.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(lo.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=lo.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const n=e.geometry;if(n!==void 0){const o=n.getAttribute("position");if(t===!0&&o!==void 0&&e.isInstancedMesh!==!0)for(let l=0,h=o.count;l<h;l++)e.isMesh===!0?e.getVertexPosition(l,lo):lo.fromBufferAttribute(o,l),lo.applyMatrix4(e.matrixWorld),this.expandByPoint(lo);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),D0.copy(e.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),D0.copy(n.boundingBox)),D0.applyMatrix4(e.matrixWorld),this.union(D0)}const i=e.children;for(let o=0,l=i.length;o<l;o++)this.expandByObject(i[o],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,lo),lo.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Sp),L0.subVectors(this.max,Sp),hh.subVectors(e.a,Sp),dh.subVectors(e.b,Sp),ph.subVectors(e.c,Sp),bc.subVectors(dh,hh),Ec.subVectors(ph,dh),Fu.subVectors(hh,ph);let t=[0,-bc.z,bc.y,0,-Ec.z,Ec.y,0,-Fu.z,Fu.y,bc.z,0,-bc.x,Ec.z,0,-Ec.x,Fu.z,0,-Fu.x,-bc.y,bc.x,0,-Ec.y,Ec.x,0,-Fu.y,Fu.x,0];return!yx(t,hh,dh,ph,L0)||(t=[1,0,0,0,1,0,0,0,1],!yx(t,hh,dh,ph,L0))?!1:(N0.crossVectors(bc,Ec),t=[N0.x,N0.y,N0.z],yx(t,hh,dh,ph,L0))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,lo).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(lo).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:(Cl[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Cl[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Cl[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Cl[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Cl[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Cl[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Cl[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Cl[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Cl),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)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const Cl=[new Z,new Z,new Z,new Z,new Z,new Z,new Z,new Z],lo=new Z,D0=new Ja,hh=new Z,dh=new Z,ph=new Z,bc=new Z,Ec=new Z,Fu=new Z,Sp=new Z,L0=new Z,N0=new Z,Hu=new Z;function yx(s,e,t,n,i){for(let o=0,l=s.length-3;o<=l;o+=3){Hu.fromArray(s,o);const h=i.x*Math.abs(Hu.x)+i.y*Math.abs(Hu.y)+i.z*Math.abs(Hu.z),d=e.dot(Hu),p=t.dot(Hu),_=n.dot(Hu);if(Math.max(-Math.max(d,p,_),Math.min(d,p,_))>h)return!1}return!0}const V2=new Ja,Mp=new Z,xx=new Z;class Da{constructor(e=new Z,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;t!==void 0?n.copy(t):V2.setFromPoints(e).getCenter(n);let i=0;for(let o=0,l=e.length;o<l;o++)i=Math.max(i,n.distanceToSquared(e[o]));return this.radius=Math.sqrt(i),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Mp.subVectors(e,this.center);const t=Mp.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),i=(n-this.radius)*.5;this.center.addScaledVector(Mp,i/n),this.radius+=i}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(xx.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Mp.copy(e.center).add(xx)),this.expandByPoint(Mp.copy(e.center).sub(xx))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}const Rl=new Z,Ax=new Z,U0=new Z,Tc=new Z,Sx=new Z,O0=new Z,Mx=new Z;class mh{constructor(e=new Z,t=new Z(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Rl)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Rl.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Rl.copy(this.origin).addScaledVector(this.direction,t),Rl.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){Ax.copy(e).add(t).multiplyScalar(.5),U0.copy(t).sub(e).normalize(),Tc.copy(this.origin).sub(Ax);const o=e.distanceTo(t)*.5,l=-this.direction.dot(U0),h=Tc.dot(this.direction),d=-Tc.dot(U0),p=Tc.lengthSq(),_=Math.abs(1-l*l);let v,y,x,b;if(_>0)if(v=l*d-h,y=l*h-d,b=o*_,v>=0)if(y>=-b)if(y<=b){const R=1/_;v*=R,y*=R,x=v*(v+l*y+2*h)+y*(l*v+y+2*d)+p}else y=o,v=Math.max(0,-(l*y+h)),x=-v*v+y*(y+2*d)+p;else y=-o,v=Math.max(0,-(l*y+h)),x=-v*v+y*(y+2*d)+p;else y<=-b?(v=Math.max(0,-(-l*o+h)),y=v>0?-o:Math.min(Math.max(-o,-d),o),x=-v*v+y*(y+2*d)+p):y<=b?(v=0,y=Math.min(Math.max(-o,-d),o),x=y*(y+2*d)+p):(v=Math.max(0,-(l*o+h)),y=v>0?o:Math.min(Math.max(-o,-d),o),x=-v*v+y*(y+2*d)+p);else y=l>0?-o:o,v=Math.max(0,-(l*y+h)),x=-v*v+y*(y+2*d)+p;return n&&n.copy(this.origin).addScaledVector(this.direction,v),i&&i.copy(Ax).addScaledVector(U0,y),x}intersectSphere(e,t){Rl.subVectors(e.center,this.origin);const n=Rl.dot(this.direction),i=Rl.dot(Rl)-n*n,o=e.radius*e.radius;if(i>o)return null;const l=Math.sqrt(o-i),h=n-l,d=n+l;return d<0?null:h<0?this.at(d,t):this.at(h,t)}intersectsSphere(e){return e.radius<0?!1: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 n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,i,o,l,h,d;const p=1/this.direction.x,_=1/this.direction.y,v=1/this.direction.z,y=this.origin;return p>=0?(n=(e.min.x-y.x)*p,i=(e.max.x-y.x)*p):(n=(e.max.x-y.x)*p,i=(e.min.x-y.x)*p),_>=0?(o=(e.min.y-y.y)*_,l=(e.max.y-y.y)*_):(o=(e.max.y-y.y)*_,l=(e.min.y-y.y)*_),n>l||o>i||((o>n||isNaN(n))&&(n=o),(l<i||isNaN(i))&&(i=l),v>=0?(h=(e.min.z-y.z)*v,d=(e.max.z-y.z)*v):(h=(e.max.z-y.z)*v,d=(e.min.z-y.z)*v),n>d||h>i)||((h>n||n!==n)&&(n=h),(d<i||i!==i)&&(i=d),i<0)?null:this.at(n>=0?n:i,t)}intersectsBox(e){return this.intersectBox(e,Rl)!==null}intersectTriangle(e,t,n,i,o){Sx.subVectors(t,e),O0.subVectors(n,e),Mx.crossVectors(Sx,O0);let l=this.direction.dot(Mx),h;if(l>0){if(i)return null;h=1}else if(l<0)h=-1,l=-l;else return null;Tc.subVectors(this.origin,e);const d=h*this.direction.dot(O0.crossVectors(Tc,O0));if(d<0)return null;const p=h*this.direction.dot(Sx.cross(Tc));if(p<0||d+p>l)return null;const _=-h*Tc.dot(Mx);return _<0?null:this.at(_/l,o)}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 cn{constructor(e,t,n,i,o,l,h,d,p,_,v,y,x,b,R,T){cn.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,n,i,o,l,h,d,p,_,v,y,x,b,R,T)}set(e,t,n,i,o,l,h,d,p,_,v,y,x,b,R,T){const M=this.elements;return M[0]=e,M[4]=t,M[8]=n,M[12]=i,M[1]=o,M[5]=l,M[9]=h,M[13]=d,M[2]=p,M[6]=_,M[10]=v,M[14]=y,M[3]=x,M[7]=b,M[11]=R,M[15]=T,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 cn().fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[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,n){return this.determinant()===0?(e.set(1,0,0),t.set(0,1,0),n.set(0,0,1),this):(e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this)}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){if(e.determinant()===0)return this.identity();const t=this.elements,n=e.elements,i=1/gh.setFromMatrixColumn(e,0).length(),o=1/gh.setFromMatrixColumn(e,1).length(),l=1/gh.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*o,t[5]=n[5]*o,t[6]=n[6]*o,t[7]=0,t[8]=n[8]*l,t[9]=n[9]*l,t[10]=n[10]*l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,i=e.y,o=e.z,l=Math.cos(n),h=Math.sin(n),d=Math.cos(i),p=Math.sin(i),_=Math.cos(o),v=Math.sin(o);if(e.order==="XYZ"){const y=l*_,x=l*v,b=h*_,R=h*v;t[0]=d*_,t[4]=-d*v,t[8]=p,t[1]=x+b*p,t[5]=y-R*p,t[9]=-h*d,t[2]=R-y*p,t[6]=b+x*p,t[10]=l*d}else if(e.order==="YXZ"){const y=d*_,x=d*v,b=p*_,R=p*v;t[0]=y+R*h,t[4]=b*h-x,t[8]=l*p,t[1]=l*v,t[5]=l*_,t[9]=-h,t[2]=x*h-b,t[6]=R+y*h,t[10]=l*d}else if(e.order==="ZXY"){const y=d*_,x=d*v,b=p*_,R=p*v;t[0]=y-R*h,t[4]=-l*v,t[8]=b+x*h,t[1]=x+b*h,t[5]=l*_,t[9]=R-y*h,t[2]=-l*p,t[6]=h,t[10]=l*d}else if(e.order==="ZYX"){const y=l*_,x=l*v,b=h*_,R=h*v;t[0]=d*_,t[4]=b*p-x,t[8]=y*p+R,t[1]=d*v,t[5]=R*p+y,t[9]=x*p-b,t[2]=-p,t[6]=h*d,t[10]=l*d}else if(e.order==="YZX"){const y=l*d,x=l*p,b=h*d,R=h*p;t[0]=d*_,t[4]=R-y*v,t[8]=b*v+x,t[1]=v,t[5]=l*_,t[9]=-h*_,t[2]=-p*_,t[6]=x*v+b,t[10]=y-R*v}else if(e.order==="XZY"){const y=l*d,x=l*p,b=h*d,R=h*p;t[0]=d*_,t[4]=-v,t[8]=p*_,t[1]=y*v+R,t[5]=l*_,t[9]=x*v-b,t[2]=b*v-x,t[6]=h*_,t[10]=R*v+y}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(k2,e,X2)}lookAt(e,t,n){const i=this.elements;return gr.subVectors(e,t),gr.lengthSq()===0&&(gr.z=1),gr.normalize(),Cc.crossVectors(n,gr),Cc.lengthSq()===0&&(Math.abs(n.z)===1?gr.x+=1e-4:gr.z+=1e-4,gr.normalize(),Cc.crossVectors(n,gr)),Cc.normalize(),I0.crossVectors(gr,Cc),i[0]=Cc.x,i[4]=I0.x,i[8]=gr.x,i[1]=Cc.y,i[5]=I0.y,i[9]=gr.y,i[2]=Cc.z,i[6]=I0.z,i[10]=gr.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,o=this.elements,l=n[0],h=n[4],d=n[8],p=n[12],_=n[1],v=n[5],y=n[9],x=n[13],b=n[2],R=n[6],T=n[10],M=n[14],w=n[3],D=n[7],L=n[11],P=n[15],O=i[0],z=i[4],V=i[8],N=i[12],F=i[1],K=i[5],ne=i[9],ee=i[13],ie=i[2],he=i[6],H=i[10],Y=i[14],$=i[3],ye=i[7],_e=i[11],W=i[15];return o[0]=l*O+h*F+d*ie+p*$,o[4]=l*z+h*K+d*he+p*ye,o[8]=l*V+h*ne+d*H+p*_e,o[12]=l*N+h*ee+d*Y+p*W,o[1]=_*O+v*F+y*ie+x*$,o[5]=_*z+v*K+y*he+x*ye,o[9]=_*V+v*ne+y*H+x*_e,o[13]=_*N+v*ee+y*Y+x*W,o[2]=b*O+R*F+T*ie+M*$,o[6]=b*z+R*K+T*he+M*ye,o[10]=b*V+R*ne+T*H+M*_e,o[14]=b*N+R*ee+T*Y+M*W,o[3]=w*O+D*F+L*ie+P*$,o[7]=w*z+D*K+L*he+P*ye,o[11]=w*V+D*ne+L*H+P*_e,o[15]=w*N+D*ee+L*Y+P*W,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],n=e[4],i=e[8],o=e[12],l=e[1],h=e[5],d=e[9],p=e[13],_=e[2],v=e[6],y=e[10],x=e[14],b=e[3],R=e[7],T=e[11],M=e[15],w=d*x-p*y,D=h*x-p*v,L=h*y-d*v,P=l*x-p*_,O=l*y-d*_,z=l*v-h*_;return t*(R*w-T*D+M*L)-n*(b*w-T*P+M*O)+i*(b*D-R*P+M*z)-o*(b*L-R*O+T*z)}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,n){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],o=e[3],l=e[4],h=e[5],d=e[6],p=e[7],_=e[8],v=e[9],y=e[10],x=e[11],b=e[12],R=e[13],T=e[14],M=e[15],w=v*T*p-R*y*p+R*d*x-h*T*x-v*d*M+h*y*M,D=b*y*p-_*T*p-b*d*x+l*T*x+_*d*M-l*y*M,L=_*R*p-b*v*p+b*h*x-l*R*x-_*h*M+l*v*M,P=b*v*d-_*R*d-b*h*y+l*R*y+_*h*T-l*v*T,O=t*w+n*D+i*L+o*P;if(O===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const z=1/O;return e[0]=w*z,e[1]=(R*y*o-v*T*o-R*i*x+n*T*x+v*i*M-n*y*M)*z,e[2]=(h*T*o-R*d*o+R*i*p-n*T*p-h*i*M+n*d*M)*z,e[3]=(v*d*o-h*y*o-v*i*p+n*y*p+h*i*x-n*d*x)*z,e[4]=D*z,e[5]=(_*T*o-b*y*o+b*i*x-t*T*x-_*i*M+t*y*M)*z,e[6]=(b*d*o-l*T*o-b*i*p+t*T*p+l*i*M-t*d*M)*z,e[7]=(l*y*o-_*d*o+_*i*p-t*y*p-l*i*x+t*d*x)*z,e[8]=L*z,e[9]=(b*v*o-_*R*o-b*n*x+t*R*x+_*n*M-t*v*M)*z,e[10]=(l*R*o-b*h*o+b*n*p-t*R*p-l*n*M+t*h*M)*z,e[11]=(_*h*o-l*v*o-_*n*p+t*v*p+l*n*x-t*h*x)*z,e[12]=P*z,e[13]=(_*R*i-b*v*i+b*n*y-t*R*y-_*n*T+t*v*T)*z,e[14]=(b*h*i-l*R*i-b*n*d+t*R*d+l*n*T-t*h*T)*z,e[15]=(l*v*i-_*h*i+_*n*d-t*v*d-l*n*y+t*h*y)*z,this}scale(e){const t=this.elements,n=e.x,i=e.y,o=e.z;return t[0]*=n,t[4]*=i,t[8]*=o,t[1]*=n,t[5]*=i,t[9]*=o,t[2]*=n,t[6]*=i,t[10]*=o,t[3]*=n,t[7]*=i,t[11]*=o,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))}makeTranslation(e,t,n){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,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),i=Math.sin(t),o=1-n,l=e.x,h=e.y,d=e.z,p=o*l,_=o*h;return this.set(p*l+n,p*h-i*d,p*d+i*h,0,p*h+i*d,_*h+n,_*d-i*l,0,p*d-i*h,_*d+i*l,o*d*d+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,o,l){return this.set(1,n,o,0,e,1,l,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){const i=this.elements,o=t._x,l=t._y,h=t._z,d=t._w,p=o+o,_=l+l,v=h+h,y=o*p,x=o*_,b=o*v,R=l*_,T=l*v,M=h*v,w=d*p,D=d*_,L=d*v,P=n.x,O=n.y,z=n.z;return i[0]=(1-(R+M))*P,i[1]=(x+L)*P,i[2]=(b-D)*P,i[3]=0,i[4]=(x-L)*O,i[5]=(1-(y+M))*O,i[6]=(T+w)*O,i[7]=0,i[8]=(b+D)*z,i[9]=(T-w)*z,i[10]=(1-(y+R))*z,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){const i=this.elements;if(e.x=i[12],e.y=i[13],e.z=i[14],this.determinant()===0)return n.set(1,1,1),t.identity(),this;let o=gh.set(i[0],i[1],i[2]).length();const l=gh.set(i[4],i[5],i[6]).length(),h=gh.set(i[8],i[9],i[10]).length();this.determinant()<0&&(o=-o),co.copy(this);const p=1/o,_=1/l,v=1/h;return co.elements[0]*=p,co.elements[1]*=p,co.elements[2]*=p,co.elements[4]*=_,co.elements[5]*=_,co.elements[6]*=_,co.elements[8]*=v,co.elements[9]*=v,co.elements[10]*=v,t.setFromRotationMatrix(co),n.x=o,n.y=l,n.z=h,this}makePerspective(e,t,n,i,o,l,h=pr,d=!1){const p=this.elements,_=2*o/(t-e),v=2*o/(n-i),y=(t+e)/(t-e),x=(n+i)/(n-i);let b,R;if(d)b=o/(l-o),R=l*o/(l-o);else if(h===pr)b=-(l+o)/(l-o),R=-2*l*o/(l-o);else if(h===rh)b=-l/(l-o),R=-l*o/(l-o);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+h);return p[0]=_,p[4]=0,p[8]=y,p[12]=0,p[1]=0,p[5]=v,p[9]=x,p[13]=0,p[2]=0,p[6]=0,p[10]=b,p[14]=R,p[3]=0,p[7]=0,p[11]=-1,p[15]=0,this}makeOrthographic(e,t,n,i,o,l,h=pr,d=!1){const p=this.elements,_=2/(t-e),v=2/(n-i),y=-(t+e)/(t-e),x=-(n+i)/(n-i);let b,R;if(d)b=1/(l-o),R=l/(l-o);else if(h===pr)b=-2/(l-o),R=-(l+o)/(l-o);else if(h===rh)b=-1/(l-o),R=-o/(l-o);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+h);return p[0]=_,p[4]=0,p[8]=0,p[12]=y,p[1]=0,p[5]=v,p[9]=0,p[13]=x,p[2]=0,p[6]=0,p[10]=b,p[14]=R,p[3]=0,p[7]=0,p[11]=0,p[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let i=0;i<16;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}const gh=new Z,co=new cn,k2=new Z(0,0,0),X2=new Z(1,1,1),Cc=new Z,I0=new Z,gr=new Z,Cb=new cn,Rb=new Ya;class vr{constructor(e=0,t=0,n=0,i=vr.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){const i=e.elements,o=i[0],l=i[4],h=i[8],d=i[1],p=i[5],_=i[9],v=i[2],y=i[6],x=i[10];switch(t){case"XYZ":this._y=Math.asin(_n(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(-_,x),this._z=Math.atan2(-l,o)):(this._x=Math.atan2(y,p),this._z=0);break;case"YXZ":this._x=Math.asin(-_n(_,-1,1)),Math.abs(_)<.9999999?(this._y=Math.atan2(h,x),this._z=Math.atan2(d,p)):(this._y=Math.atan2(-v,o),this._z=0);break;case"ZXY":this._x=Math.asin(_n(y,-1,1)),Math.abs(y)<.9999999?(this._y=Math.atan2(-v,x),this._z=Math.atan2(-l,p)):(this._y=0,this._z=Math.atan2(d,o));break;case"ZYX":this._y=Math.asin(-_n(v,-1,1)),Math.abs(v)<.9999999?(this._x=Math.atan2(y,x),this._z=Math.atan2(d,o)):(this._x=0,this._z=Math.atan2(-l,p));break;case"YZX":this._z=Math.asin(_n(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(-_,p),this._y=Math.atan2(-v,o)):(this._x=0,this._y=Math.atan2(h,x));break;case"XZY":this._z=Math.asin(-_n(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(y,p),this._y=Math.atan2(h,o)):(this._x=Math.atan2(-_,x),this._y=0);break;default:Ot("Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return Cb.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Cb,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return Rb.setFromEuler(this),this.setFromQuaternion(Rb,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}}vr.DEFAULT_ORDER="XYZ";class vh{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}let Y2=0;const wb=new Z,_h=new Ya,wl=new cn,F0=new Z,bp=new Z,J2=new Z,q2=new Ya,Bb=new Z(1,0,0),Db=new Z(0,1,0),Lb=new Z(0,0,1),Nb={type:"added"},K2={type:"removed"},yh={type:"childadded",child:null},bx={type:"childremoved",child:null};class kn extends Po{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Y2++}),this.uuid=mr(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=kn.DEFAULT_UP.clone();const e=new Z,t=new vr,n=new Ya,i=new Z(1,1,1);function o(){n.setFromEuler(t,!1)}function l(){t.setFromQuaternion(n,void 0,!1)}t._onChange(o),n._onChange(l),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new cn},normalMatrix:{value:new Tn}}),this.matrix=new cn,this.matrixWorld=new cn,this.matrixAutoUpdate=kn.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=kn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new vh,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return _h.setFromAxisAngle(e,t),this.quaternion.multiply(_h),this}rotateOnWorldAxis(e,t){return _h.setFromAxisAngle(e,t),this.quaternion.premultiply(_h),this}rotateX(e){return this.rotateOnAxis(Bb,e)}rotateY(e){return this.rotateOnAxis(Db,e)}rotateZ(e){return this.rotateOnAxis(Lb,e)}translateOnAxis(e,t){return wb.copy(e).applyQuaternion(this.quaternion),this.position.add(wb.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(Bb,e)}translateY(e){return this.translateOnAxis(Db,e)}translateZ(e){return this.translateOnAxis(Lb,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(wl.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?F0.copy(e):F0.set(e,t,n);const i=this.parent;this.updateWorldMatrix(!0,!1),bp.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?wl.lookAt(bp,F0,this.up):wl.lookAt(F0,bp,this.up),this.quaternion.setFromRotationMatrix(wl),i&&(wl.extractRotation(i.matrixWorld),_h.setFromRotationMatrix(wl),this.quaternion.premultiply(_h.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(an("Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(Nb),yh.child=e,this.dispatchEvent(yh),yh.child=null):an("Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(K2),bx.child=e,this.dispatchEvent(bx),bx.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),wl.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),wl.multiply(e.parent.matrixWorld)),e.applyMatrix4(wl),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(Nb),yh.child=e,this.dispatchEvent(yh),yh.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,i=this.children.length;n<i;n++){const l=this.children[n].getObjectByProperty(e,t);if(l!==void 0)return l}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);const i=this.children;for(let o=0,l=i.length;o<l;o++)i[o].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(bp,e,J2),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(bp,q2,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t){const n=this.parent;if(e===!0&&n!==null&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),t===!0){const i=this.children;for(let o=0,l=i.length;o<l;o++)i[o].updateWorldMatrix(!1,!0)}}toJSON(e){const t=e===void 0||typeof e=="string",n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const i={};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.geometryInfo=this._geometryInfo.map(h=>({...h,boundingBox:h.boundingBox?h.boundingBox.toJSON():void 0,boundingSphere:h.boundingSphere?h.boundingSphere.toJSON():void 0})),i.instanceInfo=this._instanceInfo.map(h=>({...h})),i.availableInstanceIds=this._availableInstanceIds.slice(),i.availableGeometryIds=this._availableGeometryIds.slice(),i.nextIndexStart=this._nextIndexStart,i.nextVertexStart=this._nextVertexStart,i.geometryCount=this._geometryCount,i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.matricesTexture=this._matricesTexture.toJSON(e),i.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(i.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(i.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(i.boundingBox=this.boundingBox.toJSON()));function o(h,d){return h[d.uuid]===void 0&&(h[d.uuid]=d.toJSON(e)),d.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=o(e.geometries,this.geometry);const h=this.geometry.parameters;if(h!==void 0&&h.shapes!==void 0){const d=h.shapes;if(Array.isArray(d))for(let p=0,_=d.length;p<_;p++){const v=d[p];o(e.shapes,v)}else o(e.shapes,d)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(o(e.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const h=[];for(let d=0,p=this.material.length;d<p;d++)h.push(o(e.materials,this.material[d]));i.material=h}else i.material=o(e.materials,this.material);if(this.children.length>0){i.children=[];for(let h=0;h<this.children.length;h++)i.children.push(this.children[h].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(let h=0;h<this.animations.length;h++){const d=this.animations[h];i.animations.push(o(e.animations,d))}}if(t){const h=l(e.geometries),d=l(e.materials),p=l(e.textures),_=l(e.images),v=l(e.shapes),y=l(e.skeletons),x=l(e.animations),b=l(e.nodes);h.length>0&&(n.geometries=h),d.length>0&&(n.materials=d),p.length>0&&(n.textures=p),_.length>0&&(n.images=_),v.length>0&&(n.shapes=v),y.length>0&&(n.skeletons=y),x.length>0&&(n.animations=x),b.length>0&&(n.nodes=b)}return n.object=i,n;function l(h){const d=[];for(const p in h){const _=h[p];delete _.metadata,d.push(_)}return d}}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 n=0;n<e.children.length;n++){const i=e.children[n];this.add(i.clone())}return this}}kn.DEFAULT_UP=new Z(0,1,0),kn.DEFAULT_MATRIX_AUTO_UPDATE=!0,kn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const uo=new Z,Bl=new Z,Ex=new Z,Dl=new Z,xh=new Z,Ah=new Z,Ub=new Z,Tx=new Z,Cx=new Z,Rx=new Z,wx=new Ti,Bx=new Ti,Dx=new Ti;class er{constructor(e=new Z,t=new Z,n=new Z){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,i){i.subVectors(n,t),uo.subVectors(e,t),i.cross(uo);const o=i.lengthSq();return o>0?i.multiplyScalar(1/Math.sqrt(o)):i.set(0,0,0)}static getBarycoord(e,t,n,i,o){uo.subVectors(i,t),Bl.subVectors(n,t),Ex.subVectors(e,t);const l=uo.dot(uo),h=uo.dot(Bl),d=uo.dot(Ex),p=Bl.dot(Bl),_=Bl.dot(Ex),v=l*p-h*h;if(v===0)return o.set(0,0,0),null;const y=1/v,x=(p*d-h*_)*y,b=(l*_-h*d)*y;return o.set(1-x-b,b,x)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,Dl)===null?!1:Dl.x>=0&&Dl.y>=0&&Dl.x+Dl.y<=1}static getInterpolation(e,t,n,i,o,l,h,d){return this.getBarycoord(e,t,n,i,Dl)===null?(d.x=0,d.y=0,"z"in d&&(d.z=0),"w"in d&&(d.w=0),null):(d.setScalar(0),d.addScaledVector(o,Dl.x),d.addScaledVector(l,Dl.y),d.addScaledVector(h,Dl.z),d)}static getInterpolatedAttribute(e,t,n,i,o,l){return wx.setScalar(0),Bx.setScalar(0),Dx.setScalar(0),wx.fromBufferAttribute(e,t),Bx.fromBufferAttribute(e,n),Dx.fromBufferAttribute(e,i),l.setScalar(0),l.addScaledVector(wx,o.x),l.addScaledVector(Bx,o.y),l.addScaledVector(Dx,o.z),l}static isFrontFacing(e,t,n,i){return uo.subVectors(n,t),Bl.subVectors(e,t),uo.cross(Bl).dot(i)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,n,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return uo.subVectors(this.c,this.b),Bl.subVectors(this.a,this.b),uo.cross(Bl).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(.3333333333333333)}getNormal(e){return er.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return er.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,i,o){return er.getInterpolation(e,this.a,this.b,this.c,t,n,i,o)}containsPoint(e){return er.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return er.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,i=this.b,o=this.c;let l,h;xh.subVectors(i,n),Ah.subVectors(o,n),Tx.subVectors(e,n);const d=xh.dot(Tx),p=Ah.dot(Tx);if(d<=0&&p<=0)return t.copy(n);Cx.subVectors(e,i);const _=xh.dot(Cx),v=Ah.dot(Cx);if(_>=0&&v<=_)return t.copy(i);const y=d*v-_*p;if(y<=0&&d>=0&&_<=0)return l=d/(d-_),t.copy(n).addScaledVector(xh,l);Rx.subVectors(e,o);const x=xh.dot(Rx),b=Ah.dot(Rx);if(b>=0&&x<=b)return t.copy(o);const R=x*p-d*b;if(R<=0&&p>=0&&b<=0)return h=p/(p-b),t.copy(n).addScaledVector(Ah,h);const T=_*b-x*v;if(T<=0&&v-_>=0&&x-b>=0)return Ub.subVectors(o,i),h=(v-_)/(v-_+(x-b)),t.copy(i).addScaledVector(Ub,h);const M=1/(T+R+y);return l=R*M,h=y*M,t.copy(n).addScaledVector(xh,l).addScaledVector(Ah,h)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const Ob={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},Rc={h:0,s:0,l:0},H0={h:0,s:0,l:0};function Lx(s,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<.16666666666666666?s+(e-s)*6*t:t<.5?e:t<.6666666666666666?s+(e-s)*6*(.6666666666666666-t):s}class Rt{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){const i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=ra){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Hn.colorSpaceToWorking(this,t),this}setRGB(e,t,n,i=Hn.workingColorSpace){return this.r=e,this.g=t,this.b=n,Hn.colorSpaceToWorking(this,i),this}setHSL(e,t,n,i=Hn.workingColorSpace){if(e=dx(e,1),t=_n(t,0,1),n=_n(n,0,1),t===0)this.r=this.g=this.b=n;else{const o=n<=.5?n*(1+t):n+t-n*t,l=2*n-o;this.r=Lx(l,o,e+.3333333333333333),this.g=Lx(l,o,e),this.b=Lx(l,o,e-.3333333333333333)}return Hn.colorSpaceToWorking(this,i),this}setStyle(e,t=ra){function n(o){o!==void 0&&parseFloat(o)<1&&Ot("Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let o;const l=i[1],h=i[2];switch(l){case"rgb":case"rgba":if(o=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(h))return n(o[4]),this.setRGB(Math.min(255,parseInt(o[1],10))/255,Math.min(255,parseInt(o[2],10))/255,Math.min(255,parseInt(o[3],10))/255,t);if(o=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(h))return n(o[4]),this.setRGB(Math.min(100,parseInt(o[1],10))/100,Math.min(100,parseInt(o[2],10))/100,Math.min(100,parseInt(o[3],10))/100,t);break;case"hsl":case"hsla":if(o=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(h))return n(o[4]),this.setHSL(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,t);break;default:Ot("Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const o=i[1],l=o.length;if(l===3)return this.setRGB(parseInt(o.charAt(0),16)/15,parseInt(o.charAt(1),16)/15,parseInt(o.charAt(2),16)/15,t);if(l===6)return this.setHex(parseInt(o,16),t);Ot("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=ra){const n=Ob[e.toLowerCase()];return n!==void 0?this.setHex(n,t):Ot("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=Tl(e.r),this.g=Tl(e.g),this.b=Tl(e.b),this}copyLinearToSRGB(e){return this.r=uh(e.r),this.g=uh(e.g),this.b=uh(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=ra){return Hn.workingToColorSpace(gs.copy(this),e),Math.round(_n(gs.r*255,0,255))*65536+Math.round(_n(gs.g*255,0,255))*256+Math.round(_n(gs.b*255,0,255))}getHexString(e=ra){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Hn.workingColorSpace){Hn.workingToColorSpace(gs.copy(this),t);const n=gs.r,i=gs.g,o=gs.b,l=Math.max(n,i,o),h=Math.min(n,i,o);let d,p;const _=(h+l)/2;if(h===l)d=0,p=0;else{const v=l-h;switch(p=_<=.5?v/(l+h):v/(2-l-h),l){case n:d=(i-o)/v+(i<o?6:0);break;case i:d=(o-n)/v+2;break;case o:d=(n-i)/v+4;break}d/=6}return e.h=d,e.s=p,e.l=_,e}getRGB(e,t=Hn.workingColorSpace){return Hn.workingToColorSpace(gs.copy(this),t),e.r=gs.r,e.g=gs.g,e.b=gs.b,e}getStyle(e=ra){Hn.workingToColorSpace(gs.copy(this),e);const t=gs.r,n=gs.g,i=gs.b;return e!==ra?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(i*255)})`}offsetHSL(e,t,n){return this.getHSL(Rc),this.setHSL(Rc.h+e,Rc.s+t,Rc.l+n)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(Rc),e.getHSL(H0);const n=Ap(Rc.h,H0.h,t),i=Ap(Rc.s,H0.s,t),o=Ap(Rc.l,H0.l,t);return this.setHSL(n,i,o),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,n=this.g,i=this.b,o=e.elements;return this.r=o[0]*t+o[3]*n+o[6]*i,this.g=o[1]*t+o[4]*n+o[7]*i,this.b=o[2]*t+o[5]*n+o[8]*i,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const gs=new Rt;Rt.NAMES=Ob;let W2=0;class oa extends Po{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:W2++}),this.uuid=mr(),this.name="",this.type="Material",this.blending=Tu,this.side=ao,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=Bg,this.blendDst=Dg,this.blendEquation=mc,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Rt(0,0,0),this.blendAlpha=0,this.depthFunc=Cu,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=fx,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Ou,this.stencilZFail=Ou,this.stencilZPass=Ou,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const n=e[t];if(n===void 0){Ot(`Material: parameter '${t}' has value of undefined.`);continue}const i=this[t];if(i===void 0){Ot(`Material: '${t}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const n={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(n.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(n.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==Tu&&(n.blending=this.blending),this.side!==ao&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==Bg&&(n.blendSrc=this.blendSrc),this.blendDst!==Dg&&(n.blendDst=this.blendDst),this.blendEquation!==mc&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==Cu&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==fx&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Ou&&(n.stencilFail=this.stencilFail),this.stencilZFail!==Ou&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==Ou&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.allowOverride===!1&&(n.allowOverride=!1),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function i(o){const l=[];for(const h in o){const d=o[h];delete d.metadata,l.push(d)}return l}if(t){const o=i(e.textures),l=i(e.images);o.length>0&&(n.textures=o),l.length>0&&(n.images=l)}return n}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 n=null;if(t!==null){const i=t.length;n=new Array(i);for(let o=0;o!==i;++o)n[o]=t[o].clone()}return this.clippingPlanes=n,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.allowOverride=e.allowOverride,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class La extends oa{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Rt(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 vr,this.combine=ap,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 Ll=j2();function j2(){const s=new ArrayBuffer(4),e=new Float32Array(s),t=new Uint32Array(s),n=new Uint32Array(512),i=new Uint32Array(512);for(let d=0;d<256;++d){const p=d-127;p<-27?(n[d]=0,n[d|256]=32768,i[d]=24,i[d|256]=24):p<-14?(n[d]=1024>>-p-14,n[d|256]=1024>>-p-14|32768,i[d]=-p-1,i[d|256]=-p-1):p<=15?(n[d]=p+15<<10,n[d|256]=p+15<<10|32768,i[d]=13,i[d|256]=13):p<128?(n[d]=31744,n[d|256]=64512,i[d]=24,i[d|256]=24):(n[d]=31744,n[d|256]=64512,i[d]=13,i[d|256]=13)}const o=new Uint32Array(2048),l=new Uint32Array(64),h=new Uint32Array(64);for(let d=1;d<1024;++d){let p=d<<13,_=0;for(;(p&8388608)===0;)p<<=1,_-=8388608;p&=-8388609,_+=947912704,o[d]=p|_}for(let d=1024;d<2048;++d)o[d]=939524096+(d-1024<<13);for(let d=1;d<31;++d)l[d]=d<<23;l[31]=1199570944,l[32]=2147483648;for(let d=33;d<63;++d)l[d]=2147483648+(d-32<<23);l[63]=3347054592;for(let d=1;d<64;++d)d!==32&&(h[d]=1024);return{floatView:e,uint32View:t,baseTable:n,shiftTable:i,mantissaTable:o,exponentTable:l,offsetTable:h}}function tr(s){Math.abs(s)>65504&&Ot("DataUtils.toHalfFloat(): Value out of range."),s=_n(s,-65504,65504),Ll.floatView[0]=s;const e=Ll.uint32View[0],t=e>>23&511;return Ll.baseTable[t]+((e&8388607)>>Ll.shiftTable[t])}function Ep(s){const e=s>>10;return Ll.uint32View[0]=Ll.mantissaTable[Ll.offsetTable[e]+(s&1023)]+Ll.exponentTable[e],Ll.floatView[0]}class Pu{static toHalfFloat(e){return tr(e)}static fromHalfFloat(e){return Ep(e)}}const ba=new Z,P0=new et;let Z2=0;class Kn{constructor(e,t,n=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:Z2++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=n,this.usage=_p,this.updateRanges=[],this.gpuType=Vi,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}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,n){e*=this.itemSize,n*=t.itemSize;for(let i=0,o=this.itemSize;i<o;i++)this.array[e+i]=t.array[n+i];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,n=this.count;t<n;t++)P0.fromBufferAttribute(this,t),P0.applyMatrix3(e),this.setXY(t,P0.x,P0.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)ba.fromBufferAttribute(this,t),ba.applyMatrix3(e),this.setXYZ(t,ba.x,ba.y,ba.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)ba.fromBufferAttribute(this,t),ba.applyMatrix4(e),this.setXYZ(t,ba.x,ba.y,ba.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)ba.fromBufferAttribute(this,t),ba.applyNormalMatrix(e),this.setXYZ(t,ba.x,ba.y,ba.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)ba.fromBufferAttribute(this,t),ba.transformDirection(e),this.setXYZ(t,ba.x,ba.y,ba.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=Bs(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Bn(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Bs(t,this.array)),t}setX(e,t){return this.normalized&&(t=Bn(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Bs(t,this.array)),t}setY(e,t){return this.normalized&&(t=Bn(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=Bs(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Bn(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=Bs(t,this.array)),t}setW(e,t){return this.normalized&&(t=Bn(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=Bn(t,this.array),n=Bn(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,i){return e*=this.itemSize,this.normalized&&(t=Bn(t,this.array),n=Bn(n,this.array),i=Bn(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this}setXYZW(e,t,n,i,o){return e*=this.itemSize,this.normalized&&(t=Bn(t,this.array),n=Bn(n,this.array),i=Bn(i,this.array),o=Bn(o,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this.array[e+3]=o,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==_p&&(e.usage=this.usage),e}}class Q2 extends Kn{constructor(e,t,n){super(new Int8Array(e),t,n)}}class $2 extends Kn{constructor(e,t,n){super(new Uint8Array(e),t,n)}}class ew extends Kn{constructor(e,t,n){super(new Uint8ClampedArray(e),t,n)}}class tw extends Kn{constructor(e,t,n){super(new Int16Array(e),t,n)}}class Nx extends Kn{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class nw extends Kn{constructor(e,t,n){super(new Int32Array(e),t,n)}}class Ux extends Kn{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class iw extends Kn{constructor(e,t,n){super(new Uint16Array(e),t,n),this.isFloat16BufferAttribute=!0}getX(e){let t=Ep(this.array[e*this.itemSize]);return this.normalized&&(t=Bs(t,this.array)),t}setX(e,t){return this.normalized&&(t=Bn(t,this.array)),this.array[e*this.itemSize]=tr(t),this}getY(e){let t=Ep(this.array[e*this.itemSize+1]);return this.normalized&&(t=Bs(t,this.array)),t}setY(e,t){return this.normalized&&(t=Bn(t,this.array)),this.array[e*this.itemSize+1]=tr(t),this}getZ(e){let t=Ep(this.array[e*this.itemSize+2]);return this.normalized&&(t=Bs(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Bn(t,this.array)),this.array[e*this.itemSize+2]=tr(t),this}getW(e){let t=Ep(this.array[e*this.itemSize+3]);return this.normalized&&(t=Bs(t,this.array)),t}setW(e,t){return this.normalized&&(t=Bn(t,this.array)),this.array[e*this.itemSize+3]=tr(t),this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=Bn(t,this.array),n=Bn(n,this.array)),this.array[e+0]=tr(t),this.array[e+1]=tr(n),this}setXYZ(e,t,n,i){return e*=this.itemSize,this.normalized&&(t=Bn(t,this.array),n=Bn(n,this.array),i=Bn(i,this.array)),this.array[e+0]=tr(t),this.array[e+1]=tr(n),this.array[e+2]=tr(i),this}setXYZW(e,t,n,i,o){return e*=this.itemSize,this.normalized&&(t=Bn(t,this.array),n=Bn(n,this.array),i=Bn(i,this.array),o=Bn(o,this.array)),this.array[e+0]=tr(t),this.array[e+1]=tr(n),this.array[e+2]=tr(i),this.array[e+3]=tr(o),this}}class Wt extends Kn{constructor(e,t,n){super(new Float32Array(e),t,n)}}let aw=0;const Nr=new cn,Ox=new kn,Sh=new Z,_r=new Ja,Tp=new Ja,qa=new Z;class yn extends Po{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:aw++}),this.uuid=mr(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.indirectOffset=0,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(_b(e)?Ux:Nx)(e,1):this.index=e,this}setIndirect(e,t=0){return this.indirect=e,this.indirectOffset=t,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(n!==void 0){const o=new Tn().getNormalMatrix(e);n.applyNormalMatrix(o),n.needsUpdate=!0}const i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return Nr.makeRotationFromQuaternion(e),this.applyMatrix4(Nr),this}rotateX(e){return Nr.makeRotationX(e),this.applyMatrix4(Nr),this}rotateY(e){return Nr.makeRotationY(e),this.applyMatrix4(Nr),this}rotateZ(e){return Nr.makeRotationZ(e),this.applyMatrix4(Nr),this}translate(e,t,n){return Nr.makeTranslation(e,t,n),this.applyMatrix4(Nr),this}scale(e,t,n){return Nr.makeScale(e,t,n),this.applyMatrix4(Nr),this}lookAt(e){return Ox.lookAt(e),Ox.updateMatrix(),this.applyMatrix4(Ox.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Sh).negate(),this.translate(Sh.x,Sh.y,Sh.z),this}setFromPoints(e){const t=this.getAttribute("position");if(t===void 0){const n=[];for(let i=0,o=e.length;i<o;i++){const l=e[i];n.push(l.x,l.y,l.z||0)}this.setAttribute("position",new Wt(n,3))}else{const n=Math.min(e.length,t.count);for(let i=0;i<n;i++){const o=e[i];t.setXYZ(i,o.x,o.y,o.z||0)}e.length>t.count&&Ot("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Ja);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){an("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new Z(-1/0,-1/0,-1/0),new Z(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,i=t.length;n<i;n++){const o=t[n];_r.setFromBufferAttribute(o),this.morphTargetsRelative?(qa.addVectors(this.boundingBox.min,_r.min),this.boundingBox.expandByPoint(qa),qa.addVectors(this.boundingBox.max,_r.max),this.boundingBox.expandByPoint(qa)):(this.boundingBox.expandByPoint(_r.min),this.boundingBox.expandByPoint(_r.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&an('BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Da);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){an("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new Z,1/0);return}if(e){const n=this.boundingSphere.center;if(_r.setFromBufferAttribute(e),t)for(let o=0,l=t.length;o<l;o++){const h=t[o];Tp.setFromBufferAttribute(h),this.morphTargetsRelative?(qa.addVectors(_r.min,Tp.min),_r.expandByPoint(qa),qa.addVectors(_r.max,Tp.max),_r.expandByPoint(qa)):(_r.expandByPoint(Tp.min),_r.expandByPoint(Tp.max))}_r.getCenter(n);let i=0;for(let o=0,l=e.count;o<l;o++)qa.fromBufferAttribute(e,o),i=Math.max(i,n.distanceToSquared(qa));if(t)for(let o=0,l=t.length;o<l;o++){const h=t[o],d=this.morphTargetsRelative;for(let p=0,_=h.count;p<_;p++)qa.fromBufferAttribute(h,p),d&&(Sh.fromBufferAttribute(e,p),qa.add(Sh)),i=Math.max(i,n.distanceToSquared(qa))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&an('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){an("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const n=t.position,i=t.normal,o=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new Kn(new Float32Array(4*n.count),4));const l=this.getAttribute("tangent"),h=[],d=[];for(let V=0;V<n.count;V++)h[V]=new Z,d[V]=new Z;const p=new Z,_=new Z,v=new Z,y=new et,x=new et,b=new et,R=new Z,T=new Z;function M(V,N,F){p.fromBufferAttribute(n,V),_.fromBufferAttribute(n,N),v.fromBufferAttribute(n,F),y.fromBufferAttribute(o,V),x.fromBufferAttribute(o,N),b.fromBufferAttribute(o,F),_.sub(p),v.sub(p),x.sub(y),b.sub(y);const K=1/(x.x*b.y-b.x*x.y);isFinite(K)&&(R.copy(_).multiplyScalar(b.y).addScaledVector(v,-x.y).multiplyScalar(K),T.copy(v).multiplyScalar(x.x).addScaledVector(_,-b.x).multiplyScalar(K),h[V].add(R),h[N].add(R),h[F].add(R),d[V].add(T),d[N].add(T),d[F].add(T))}let w=this.groups;w.length===0&&(w=[{start:0,count:e.count}]);for(let V=0,N=w.length;V<N;++V){const F=w[V],K=F.start,ne=F.count;for(let ee=K,ie=K+ne;ee<ie;ee+=3)M(e.getX(ee+0),e.getX(ee+1),e.getX(ee+2))}const D=new Z,L=new Z,P=new Z,O=new Z;function z(V){P.fromBufferAttribute(i,V),O.copy(P);const N=h[V];D.copy(N),D.sub(P.multiplyScalar(P.dot(N))).normalize(),L.crossVectors(O,N);const K=L.dot(d[V])<0?-1:1;l.setXYZW(V,D.x,D.y,D.z,K)}for(let V=0,N=w.length;V<N;++V){const F=w[V],K=F.start,ne=F.count;for(let ee=K,ie=K+ne;ee<ie;ee+=3)z(e.getX(ee+0)),z(e.getX(ee+1)),z(e.getX(ee+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new Kn(new Float32Array(t.count*3),3),this.setAttribute("normal",n);else for(let y=0,x=n.count;y<x;y++)n.setXYZ(y,0,0,0);const i=new Z,o=new Z,l=new Z,h=new Z,d=new Z,p=new Z,_=new Z,v=new Z;if(e)for(let y=0,x=e.count;y<x;y+=3){const b=e.getX(y+0),R=e.getX(y+1),T=e.getX(y+2);i.fromBufferAttribute(t,b),o.fromBufferAttribute(t,R),l.fromBufferAttribute(t,T),_.subVectors(l,o),v.subVectors(i,o),_.cross(v),h.fromBufferAttribute(n,b),d.fromBufferAttribute(n,R),p.fromBufferAttribute(n,T),h.add(_),d.add(_),p.add(_),n.setXYZ(b,h.x,h.y,h.z),n.setXYZ(R,d.x,d.y,d.z),n.setXYZ(T,p.x,p.y,p.z)}else for(let y=0,x=t.count;y<x;y+=3)i.fromBufferAttribute(t,y+0),o.fromBufferAttribute(t,y+1),l.fromBufferAttribute(t,y+2),_.subVectors(l,o),v.subVectors(i,o),_.cross(v),n.setXYZ(y+0,_.x,_.y,_.z),n.setXYZ(y+1,_.x,_.y,_.z),n.setXYZ(y+2,_.x,_.y,_.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)qa.fromBufferAttribute(e,t),qa.normalize(),e.setXYZ(t,qa.x,qa.y,qa.z)}toNonIndexed(){function e(h,d){const p=h.array,_=h.itemSize,v=h.normalized,y=new p.constructor(d.length*_);let x=0,b=0;for(let R=0,T=d.length;R<T;R++){h.isInterleavedBufferAttribute?x=d[R]*h.data.stride+h.offset:x=d[R]*_;for(let M=0;M<_;M++)y[b++]=p[x++]}return new Kn(y,_,v)}if(this.index===null)return Ot("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new yn,n=this.index.array,i=this.attributes;for(const h in i){const d=i[h],p=e(d,n);t.setAttribute(h,p)}const o=this.morphAttributes;for(const h in o){const d=[],p=o[h];for(let _=0,v=p.length;_<v;_++){const y=p[_],x=e(y,n);d.push(x)}t.morphAttributes[h]=d}t.morphTargetsRelative=this.morphTargetsRelative;const l=this.groups;for(let h=0,d=l.length;h<d;h++){const p=l[h];t.addGroup(p.start,p.count,p.materialIndex)}return t}toJSON(){const e={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){const d=this.parameters;for(const p in d)d[p]!==void 0&&(e[p]=d[p]);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 n=this.attributes;for(const d in n){const p=n[d];e.data.attributes[d]=p.toJSON(e.data)}const i={};let o=!1;for(const d in this.morphAttributes){const p=this.morphAttributes[d],_=[];for(let v=0,y=p.length;v<y;v++){const x=p[v];_.push(x.toJSON(e.data))}_.length>0&&(i[d]=_,o=!0)}o&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const l=this.groups;l.length>0&&(e.data.groups=JSON.parse(JSON.stringify(l)));const h=this.boundingSphere;return h!==null&&(e.data.boundingSphere=h.toJSON()),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 n=e.index;n!==null&&this.setIndex(n.clone());const i=e.attributes;for(const p in i){const _=i[p];this.setAttribute(p,_.clone(t))}const o=e.morphAttributes;for(const p in o){const _=[],v=o[p];for(let y=0,x=v.length;y<x;y++)_.push(v[y].clone(t));this.morphAttributes[p]=_}this.morphTargetsRelative=e.morphTargetsRelative;const l=e.groups;for(let p=0,_=l.length;p<_;p++){const v=l[p];this.addGroup(v.start,v.count,v.materialIndex)}const h=e.boundingBox;h!==null&&(this.boundingBox=h.clone());const d=e.boundingSphere;return d!==null&&(this.boundingSphere=d.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const Ib=new cn,Gu=new mh,G0=new Da,Fb=new Z,z0=new Z,V0=new Z,k0=new Z,Ix=new Z,X0=new Z,Hb=new Z,Y0=new Z;class Oi extends kn{constructor(e=new yn,t=new La){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,l=i.length;o<l;o++){const h=i[o].name||String(o);this.morphTargetInfluences.push(0),this.morphTargetDictionary[h]=o}}}}getVertexPosition(e,t){const n=this.geometry,i=n.attributes.position,o=n.morphAttributes.position,l=n.morphTargetsRelative;t.fromBufferAttribute(i,e);const h=this.morphTargetInfluences;if(o&&h){X0.set(0,0,0);for(let d=0,p=o.length;d<p;d++){const _=h[d],v=o[d];_!==0&&(Ix.fromBufferAttribute(v,e),l?X0.addScaledVector(Ix,_):X0.addScaledVector(Ix.sub(t),_))}t.add(X0)}return t}raycast(e,t){const n=this.geometry,i=this.material,o=this.matrixWorld;i!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),G0.copy(n.boundingSphere),G0.applyMatrix4(o),Gu.copy(e.ray).recast(e.near),!(G0.containsPoint(Gu.origin)===!1&&(Gu.intersectSphere(G0,Fb)===null||Gu.origin.distanceToSquared(Fb)>(e.far-e.near)**2))&&(Ib.copy(o).invert(),Gu.copy(e.ray).applyMatrix4(Ib),!(n.boundingBox!==null&&Gu.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,Gu)))}_computeIntersections(e,t,n){let i;const o=this.geometry,l=this.material,h=o.index,d=o.attributes.position,p=o.attributes.uv,_=o.attributes.uv1,v=o.attributes.normal,y=o.groups,x=o.drawRange;if(h!==null)if(Array.isArray(l))for(let b=0,R=y.length;b<R;b++){const T=y[b],M=l[T.materialIndex],w=Math.max(T.start,x.start),D=Math.min(h.count,Math.min(T.start+T.count,x.start+x.count));for(let L=w,P=D;L<P;L+=3){const O=h.getX(L),z=h.getX(L+1),V=h.getX(L+2);i=J0(this,M,e,n,p,_,v,O,z,V),i&&(i.faceIndex=Math.floor(L/3),i.face.materialIndex=T.materialIndex,t.push(i))}}else{const b=Math.max(0,x.start),R=Math.min(h.count,x.start+x.count);for(let T=b,M=R;T<M;T+=3){const w=h.getX(T),D=h.getX(T+1),L=h.getX(T+2);i=J0(this,l,e,n,p,_,v,w,D,L),i&&(i.faceIndex=Math.floor(T/3),t.push(i))}}else if(d!==void 0)if(Array.isArray(l))for(let b=0,R=y.length;b<R;b++){const T=y[b],M=l[T.materialIndex],w=Math.max(T.start,x.start),D=Math.min(d.count,Math.min(T.start+T.count,x.start+x.count));for(let L=w,P=D;L<P;L+=3){const O=L,z=L+1,V=L+2;i=J0(this,M,e,n,p,_,v,O,z,V),i&&(i.faceIndex=Math.floor(L/3),i.face.materialIndex=T.materialIndex,t.push(i))}}else{const b=Math.max(0,x.start),R=Math.min(d.count,x.start+x.count);for(let T=b,M=R;T<M;T+=3){const w=T,D=T+1,L=T+2;i=J0(this,l,e,n,p,_,v,w,D,L),i&&(i.faceIndex=Math.floor(T/3),t.push(i))}}}}function sw(s,e,t,n,i,o,l,h){let d;if(e.side===ws?d=n.intersectTriangle(l,o,i,!0,h):d=n.intersectTriangle(i,o,l,e.side===ao,h),d===null)return null;Y0.copy(h),Y0.applyMatrix4(s.matrixWorld);const p=t.ray.origin.distanceTo(Y0);return p<t.near||p>t.far?null:{distance:p,point:Y0.clone(),object:s}}function J0(s,e,t,n,i,o,l,h,d,p){s.getVertexPosition(h,z0),s.getVertexPosition(d,V0),s.getVertexPosition(p,k0);const _=sw(s,e,t,n,z0,V0,k0,Hb);if(_){const v=new Z;er.getBarycoord(Hb,z0,V0,k0,v),i&&(_.uv=er.getInterpolatedAttribute(i,h,d,p,v,new et)),o&&(_.uv1=er.getInterpolatedAttribute(o,h,d,p,v,new et)),l&&(_.normal=er.getInterpolatedAttribute(l,h,d,p,v,new Z),_.normal.dot(n.direction)>0&&_.normal.multiplyScalar(-1));const y={a:h,b:d,c:p,normal:new Z,materialIndex:0};er.getNormal(z0,V0,k0,y.normal),_.face=y,_.barycoord=v}return _}class zu extends yn{constructor(e=1,t=1,n=1,i=1,o=1,l=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:i,heightSegments:o,depthSegments:l};const h=this;i=Math.floor(i),o=Math.floor(o),l=Math.floor(l);const d=[],p=[],_=[],v=[];let y=0,x=0;b("z","y","x",-1,-1,n,t,e,l,o,0),b("z","y","x",1,-1,n,t,-e,l,o,1),b("x","z","y",1,1,e,n,t,i,l,2),b("x","z","y",1,-1,e,n,-t,i,l,3),b("x","y","z",1,-1,e,t,n,i,o,4),b("x","y","z",-1,-1,e,t,-n,i,o,5),this.setIndex(d),this.setAttribute("position",new Wt(p,3)),this.setAttribute("normal",new Wt(_,3)),this.setAttribute("uv",new Wt(v,2));function b(R,T,M,w,D,L,P,O,z,V,N){const F=L/z,K=P/V,ne=L/2,ee=P/2,ie=O/2,he=z+1,H=V+1;let Y=0,$=0;const ye=new Z;for(let _e=0;_e<H;_e++){const W=_e*K-ee;for(let ae=0;ae<he;ae++){const Me=ae*F-ne;ye[R]=Me*w,ye[T]=W*D,ye[M]=ie,p.push(ye.x,ye.y,ye.z),ye[R]=0,ye[T]=0,ye[M]=O>0?1:-1,_.push(ye.x,ye.y,ye.z),v.push(ae/z),v.push(1-_e/V),Y+=1}}for(let _e=0;_e<V;_e++)for(let W=0;W<z;W++){const ae=y+W+he*_e,Me=y+W+he*(_e+1),Ne=y+(W+1)+he*(_e+1),it=y+(W+1)+he*_e;d.push(ae,Me,it),d.push(Me,Ne,it),$+=6}h.addGroup(x,$,N),x+=$,y+=Y}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new zu(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function Mh(s){const e={};for(const t in s){e[t]={};for(const n in s[t]){const i=s[t][n];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(Ot("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][n]=null):e[t][n]=i.clone():Array.isArray(i)?e[t][n]=i.slice():e[t][n]=i}}return e}function Ls(s){const e={};for(let t=0;t<s.length;t++){const n=Mh(s[t]);for(const i in n)e[i]=n[i]}return e}function rw(s){const e=[];for(let t=0;t<s.length;t++)e.push(s[t].clone());return e}function Pb(s){const e=s.getRenderTarget();return e===null?s.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:Hn.workingColorSpace}const Gb={clone:Mh,merge:Ls};var ow=`void main() {
10
10
  gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
11
11
  }`,lw=`void main() {
@@ -3965,7 +3965,7 @@ Material Type: `+K.type+`
3965
3965
 
3966
3966
  Program Info Log: `+he+`
3967
3967
  `+_e+`
3968
- `+W)}else he!==""?Ot("WebGLProgram: Program Info Log:",he):(H===""||Y==="")&&(ye=!1);ye&&(K.diagnostics={runnable:$,programLog:he,vertexShader:{log:H,prefix:T},fragmentShader:{log:Y,prefix:M}})}i.deleteShader(P),i.deleteShader(O),V=new e_(i,R),N=UN(i,R)}let V;this.getUniforms=function(){return V===void 0&&z(this),V};let N;this.getAttributes=function(){return N===void 0&&z(this),N};let F=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return F===!1&&(F=i.getProgramParameter(R,bN)),F},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(R),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=EN++,this.cacheKey=e,this.usedTimes=1,this.program=R,this.vertexShader=P,this.fragmentShader=O,this}let jN=0;class ZN{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,i=this._getShaderStage(t),o=this._getShaderStage(n),l=this._getShaderCacheForMaterial(e);return l.has(i)===!1&&(l.add(i),i.usedTimes++),l.has(o)===!1&&(l.add(o),o.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const n of t)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.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 n=t.get(e);return n===void 0&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){const t=this.shaderCache;let n=t.get(e);return n===void 0&&(n=new QN(e),t.set(e,n)),n}}class QN{constructor(e){this.id=jN++,this.code=e,this.usedTimes=0}}function $N(s,e,t,n,i,o,l){const h=new vh,d=new ZN,p=new Set,_=[],v=new Map,y=i.logarithmicDepthBuffer;let x=i.precision;const b={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distance",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function R(N){return p.add(N),N===0?"uv":`uv${N}`}function T(N,F,K,ne,ee){const ie=ne.fog,he=ee.geometry,H=N.isMeshStandardMaterial?ne.environment:null,Y=(N.isMeshStandardMaterial?t:e).get(N.envMap||H),$=Y&&Y.mapping===ih?Y.image.height:null,ye=b[N.type];N.precision!==null&&(x=i.getMaxPrecision(N.precision),x!==N.precision&&Ot("WebGLProgram.getParameters:",N.precision,"not supported, using",x,"instead."));const _e=he.morphAttributes.position||he.morphAttributes.normal||he.morphAttributes.color,W=_e!==void 0?_e.length:0;let ae=0;he.morphAttributes.position!==void 0&&(ae=1),he.morphAttributes.normal!==void 0&&(ae=2),he.morphAttributes.color!==void 0&&(ae=3);let Me,Ne,it,ve;if(ye){const bt=po[ye];Me=bt.vertexShader,Ne=bt.fragmentShader}else Me=N.vertexShader,Ne=N.fragmentShader,d.update(N),it=d.getVertexShaderID(N),ve=d.getFragmentShaderID(N);const Ce=s.getRenderTarget(),tt=s.state.buffers.depth.getReversed(),Et=ee.isInstancedMesh===!0,wt=ee.isBatchedMesh===!0,on=!!N.map,It=!!N.matcap,mt=!!Y,me=!!N.aoMap,Le=!!N.lightMap,Ue=!!N.bumpMap,rt=!!N.normalMap,Q=!!N.displacementMap,Kt=!!N.emissiveMap,_t=!!N.metalnessMap,Ft=!!N.roughnessMap,yt=N.anisotropy>0,j=N.clearcoat>0,I=N.dispersion>0,ue=N.iridescence>0,Ie=N.sheen>0,Xe=N.transmission>0,Oe=yt&&!!N.anisotropyMap,Bt=j&&!!N.clearcoatMap,gt=j&&!!N.clearcoatNormalMap,Ht=j&&!!N.clearcoatRoughnessMap,Xt=ue&&!!N.iridescenceMap,ze=ue&&!!N.iridescenceThicknessMap,qe=Ie&&!!N.sheenColorMap,Tt=Ie&&!!N.sheenRoughnessMap,pt=!!N.specularMap,st=!!N.specularColorMap,qt=!!N.specularIntensityMap,de=Xe&&!!N.transmissionMap,be=Xe&&!!N.thicknessMap,We=!!N.gradientMap,St=!!N.alphaMap,Ye=N.alphaTest>0,Ve=!!N.alphaHash,ft=!!N.extensions;let jt=Lr;N.toneMapped&&(Ce===null||Ce.isXRRenderTarget===!0)&&(jt=s.toneMapping);const Sn={shaderID:ye,shaderType:N.type,shaderName:N.name,vertexShader:Me,fragmentShader:Ne,defines:N.defines,customVertexShaderID:it,customFragmentShaderID:ve,isRawShaderMaterial:N.isRawShaderMaterial===!0,glslVersion:N.glslVersion,precision:x,batching:wt,batchingColor:wt&&ee._colorsTexture!==null,instancing:Et,instancingColor:Et&&ee.instanceColor!==null,instancingMorph:Et&&ee.morphTexture!==null,outputColorSpace:Ce===null?s.outputColorSpace:Ce.isXRRenderTarget===!0?Ce.texture.colorSpace:Ma,alphaToCoverage:!!N.alphaToCoverage,map:on,matcap:It,envMap:mt,envMapMode:mt&&Y.mapping,envMapCubeUVHeight:$,aoMap:me,lightMap:Le,bumpMap:Ue,normalMap:rt,displacementMap:Q,emissiveMap:Kt,normalMapObjectSpace:rt&&N.normalMapType===fb,normalMapTangentSpace:rt&&N.normalMapType===Ac,metalnessMap:_t,roughnessMap:Ft,anisotropy:yt,anisotropyMap:Oe,clearcoat:j,clearcoatMap:Bt,clearcoatNormalMap:gt,clearcoatRoughnessMap:Ht,dispersion:I,iridescence:ue,iridescenceMap:Xt,iridescenceThicknessMap:ze,sheen:Ie,sheenColorMap:qe,sheenRoughnessMap:Tt,specularMap:pt,specularColorMap:st,specularIntensityMap:qt,transmission:Xe,transmissionMap:de,thicknessMap:be,gradientMap:We,opaque:N.transparent===!1&&N.blending===Tu&&N.alphaToCoverage===!1,alphaMap:St,alphaTest:Ye,alphaHash:Ve,combine:N.combine,mapUv:on&&R(N.map.channel),aoMapUv:me&&R(N.aoMap.channel),lightMapUv:Le&&R(N.lightMap.channel),bumpMapUv:Ue&&R(N.bumpMap.channel),normalMapUv:rt&&R(N.normalMap.channel),displacementMapUv:Q&&R(N.displacementMap.channel),emissiveMapUv:Kt&&R(N.emissiveMap.channel),metalnessMapUv:_t&&R(N.metalnessMap.channel),roughnessMapUv:Ft&&R(N.roughnessMap.channel),anisotropyMapUv:Oe&&R(N.anisotropyMap.channel),clearcoatMapUv:Bt&&R(N.clearcoatMap.channel),clearcoatNormalMapUv:gt&&R(N.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Ht&&R(N.clearcoatRoughnessMap.channel),iridescenceMapUv:Xt&&R(N.iridescenceMap.channel),iridescenceThicknessMapUv:ze&&R(N.iridescenceThicknessMap.channel),sheenColorMapUv:qe&&R(N.sheenColorMap.channel),sheenRoughnessMapUv:Tt&&R(N.sheenRoughnessMap.channel),specularMapUv:pt&&R(N.specularMap.channel),specularColorMapUv:st&&R(N.specularColorMap.channel),specularIntensityMapUv:qt&&R(N.specularIntensityMap.channel),transmissionMapUv:de&&R(N.transmissionMap.channel),thicknessMapUv:be&&R(N.thicknessMap.channel),alphaMapUv:St&&R(N.alphaMap.channel),vertexTangents:!!he.attributes.tangent&&(rt||yt),vertexColors:N.vertexColors,vertexAlphas:N.vertexColors===!0&&!!he.attributes.color&&he.attributes.color.itemSize===4,pointsUvs:ee.isPoints===!0&&!!he.attributes.uv&&(on||St),fog:!!ie,useFog:N.fog===!0,fogExp2:!!ie&&ie.isFogExp2,flatShading:N.flatShading===!0&&N.wireframe===!1,sizeAttenuation:N.sizeAttenuation===!0,logarithmicDepthBuffer:y,reversedDepthBuffer:tt,skinning:ee.isSkinnedMesh===!0,morphTargets:he.morphAttributes.position!==void 0,morphNormals:he.morphAttributes.normal!==void 0,morphColors:he.morphAttributes.color!==void 0,morphTargetsCount:W,morphTextureStride:ae,numDirLights:F.directional.length,numPointLights:F.point.length,numSpotLights:F.spot.length,numSpotLightMaps:F.spotLightMap.length,numRectAreaLights:F.rectArea.length,numHemiLights:F.hemi.length,numDirLightShadows:F.directionalShadowMap.length,numPointLightShadows:F.pointShadowMap.length,numSpotLightShadows:F.spotShadowMap.length,numSpotLightShadowsWithMaps:F.numSpotLightShadowsWithMaps,numLightProbes:F.numLightProbes,numClippingPlanes:l.numPlanes,numClipIntersection:l.numIntersection,dithering:N.dithering,shadowMapEnabled:s.shadowMap.enabled&&K.length>0,shadowMapType:s.shadowMap.type,toneMapping:jt,decodeVideoTexture:on&&N.map.isVideoTexture===!0&&Hn.getTransfer(N.map.colorSpace)===gi,decodeVideoTextureEmissive:Kt&&N.emissiveMap.isVideoTexture===!0&&Hn.getTransfer(N.emissiveMap.colorSpace)===gi,premultipliedAlpha:N.premultipliedAlpha,doubleSided:N.side===hr,flipSided:N.side===ws,useDepthPacking:N.depthPacking>=0,depthPacking:N.depthPacking||0,index0AttributeName:N.index0AttributeName,extensionClipCullDistance:ft&&N.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(ft&&N.extensions.multiDraw===!0||wt)&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:N.customProgramCacheKey()};return Sn.vertexUv1s=p.has(1),Sn.vertexUv2s=p.has(2),Sn.vertexUv3s=p.has(3),p.clear(),Sn}function M(N){const F=[];if(N.shaderID?F.push(N.shaderID):(F.push(N.customVertexShaderID),F.push(N.customFragmentShaderID)),N.defines!==void 0)for(const K in N.defines)F.push(K),F.push(N.defines[K]);return N.isRawShaderMaterial===!1&&(w(F,N),D(F,N),F.push(s.outputColorSpace)),F.push(N.customProgramCacheKey),F.join()}function w(N,F){N.push(F.precision),N.push(F.outputColorSpace),N.push(F.envMapMode),N.push(F.envMapCubeUVHeight),N.push(F.mapUv),N.push(F.alphaMapUv),N.push(F.lightMapUv),N.push(F.aoMapUv),N.push(F.bumpMapUv),N.push(F.normalMapUv),N.push(F.displacementMapUv),N.push(F.emissiveMapUv),N.push(F.metalnessMapUv),N.push(F.roughnessMapUv),N.push(F.anisotropyMapUv),N.push(F.clearcoatMapUv),N.push(F.clearcoatNormalMapUv),N.push(F.clearcoatRoughnessMapUv),N.push(F.iridescenceMapUv),N.push(F.iridescenceThicknessMapUv),N.push(F.sheenColorMapUv),N.push(F.sheenRoughnessMapUv),N.push(F.specularMapUv),N.push(F.specularColorMapUv),N.push(F.specularIntensityMapUv),N.push(F.transmissionMapUv),N.push(F.thicknessMapUv),N.push(F.combine),N.push(F.fogExp2),N.push(F.sizeAttenuation),N.push(F.morphTargetsCount),N.push(F.morphAttributeCount),N.push(F.numDirLights),N.push(F.numPointLights),N.push(F.numSpotLights),N.push(F.numSpotLightMaps),N.push(F.numHemiLights),N.push(F.numRectAreaLights),N.push(F.numDirLightShadows),N.push(F.numPointLightShadows),N.push(F.numSpotLightShadows),N.push(F.numSpotLightShadowsWithMaps),N.push(F.numLightProbes),N.push(F.shadowMapType),N.push(F.toneMapping),N.push(F.numClippingPlanes),N.push(F.numClipIntersection),N.push(F.depthPacking)}function D(N,F){h.disableAll(),F.instancing&&h.enable(0),F.instancingColor&&h.enable(1),F.instancingMorph&&h.enable(2),F.matcap&&h.enable(3),F.envMap&&h.enable(4),F.normalMapObjectSpace&&h.enable(5),F.normalMapTangentSpace&&h.enable(6),F.clearcoat&&h.enable(7),F.iridescence&&h.enable(8),F.alphaTest&&h.enable(9),F.vertexColors&&h.enable(10),F.vertexAlphas&&h.enable(11),F.vertexUv1s&&h.enable(12),F.vertexUv2s&&h.enable(13),F.vertexUv3s&&h.enable(14),F.vertexTangents&&h.enable(15),F.anisotropy&&h.enable(16),F.alphaHash&&h.enable(17),F.batching&&h.enable(18),F.dispersion&&h.enable(19),F.batchingColor&&h.enable(20),F.gradientMap&&h.enable(21),N.push(h.mask),h.disableAll(),F.fog&&h.enable(0),F.useFog&&h.enable(1),F.flatShading&&h.enable(2),F.logarithmicDepthBuffer&&h.enable(3),F.reversedDepthBuffer&&h.enable(4),F.skinning&&h.enable(5),F.morphTargets&&h.enable(6),F.morphNormals&&h.enable(7),F.morphColors&&h.enable(8),F.premultipliedAlpha&&h.enable(9),F.shadowMapEnabled&&h.enable(10),F.doubleSided&&h.enable(11),F.flipSided&&h.enable(12),F.useDepthPacking&&h.enable(13),F.dithering&&h.enable(14),F.transmission&&h.enable(15),F.sheen&&h.enable(16),F.opaque&&h.enable(17),F.pointsUvs&&h.enable(18),F.decodeVideoTexture&&h.enable(19),F.decodeVideoTextureEmissive&&h.enable(20),F.alphaToCoverage&&h.enable(21),N.push(h.mask)}function L(N){const F=b[N.type];let K;if(F){const ne=po[F];K=Gb.clone(ne.uniforms)}else K=N.uniforms;return K}function P(N,F){let K=v.get(F);return K!==void 0?++K.usedTimes:(K=new WN(s,F,N,o),_.push(K),v.set(F,K)),K}function O(N){if(--N.usedTimes===0){const F=_.indexOf(N);_[F]=_[_.length-1],_.pop(),v.delete(N.cacheKey),N.destroy()}}function z(N){d.remove(N)}function V(){d.dispose()}return{getParameters:T,getProgramCacheKey:M,getUniforms:L,acquireProgram:P,releaseProgram:O,releaseShaderCache:z,programs:_,dispose:V}}function eU(){let s=new WeakMap;function e(l){return s.has(l)}function t(l){let h=s.get(l);return h===void 0&&(h={},s.set(l,h)),h}function n(l){s.delete(l)}function i(l,h,d){s.get(l)[h]=d}function o(){s=new WeakMap}return{has:e,get:t,remove:n,update:i,dispose:o}}function tU(s,e){return s.groupOrder!==e.groupOrder?s.groupOrder-e.groupOrder:s.renderOrder!==e.renderOrder?s.renderOrder-e.renderOrder:s.material.id!==e.material.id?s.material.id-e.material.id:s.z!==e.z?s.z-e.z:s.id-e.id}function kE(s,e){return s.groupOrder!==e.groupOrder?s.groupOrder-e.groupOrder:s.renderOrder!==e.renderOrder?s.renderOrder-e.renderOrder:s.z!==e.z?e.z-s.z:s.id-e.id}function XE(){const s=[];let e=0;const t=[],n=[],i=[];function o(){e=0,t.length=0,n.length=0,i.length=0}function l(v,y,x,b,R,T){let M=s[e];return M===void 0?(M={id:v.id,object:v,geometry:y,material:x,groupOrder:b,renderOrder:v.renderOrder,z:R,group:T},s[e]=M):(M.id=v.id,M.object=v,M.geometry=y,M.material=x,M.groupOrder=b,M.renderOrder=v.renderOrder,M.z=R,M.group=T),e++,M}function h(v,y,x,b,R,T){const M=l(v,y,x,b,R,T);x.transmission>0?n.push(M):x.transparent===!0?i.push(M):t.push(M)}function d(v,y,x,b,R,T){const M=l(v,y,x,b,R,T);x.transmission>0?n.unshift(M):x.transparent===!0?i.unshift(M):t.unshift(M)}function p(v,y){t.length>1&&t.sort(v||tU),n.length>1&&n.sort(y||kE),i.length>1&&i.sort(y||kE)}function _(){for(let v=e,y=s.length;v<y;v++){const x=s[v];if(x.id===null)break;x.id=null,x.object=null,x.geometry=null,x.material=null,x.group=null}}return{opaque:t,transmissive:n,transparent:i,init:o,push:h,unshift:d,finish:_,sort:p}}function nU(){let s=new WeakMap;function e(n,i){const o=s.get(n);let l;return o===void 0?(l=new XE,s.set(n,[l])):i>=o.length?(l=new XE,o.push(l)):l=o[i],l}function t(){s=new WeakMap}return{get:e,dispose:t}}function iU(){const s={};return{get:function(e){if(s[e.id]!==void 0)return s[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new Z,color:new Rt};break;case"SpotLight":t={position:new Z,direction:new Z,color:new Rt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new Z,color:new Rt,distance:0,decay:0};break;case"HemisphereLight":t={direction:new Z,skyColor:new Rt,groundColor:new Rt};break;case"RectAreaLight":t={color:new Rt,position:new Z,halfWidth:new Z,halfHeight:new Z};break}return s[e.id]=t,t}}}function aU(){const s={};return{get:function(e){if(s[e.id]!==void 0)return s[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new et};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new et};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new et,shadowCameraNear:1,shadowCameraFar:1e3};break}return s[e.id]=t,t}}}let sU=0;function rU(s,e){return(e.castShadow?2:0)-(s.castShadow?2:0)+(e.map?1:0)-(s.map?1:0)}function oU(s){const e=new iU,t=aU(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let p=0;p<9;p++)n.probe.push(new Z);const i=new Z,o=new cn,l=new cn;function h(p){let _=0,v=0,y=0;for(let N=0;N<9;N++)n.probe[N].set(0,0,0);let x=0,b=0,R=0,T=0,M=0,w=0,D=0,L=0,P=0,O=0,z=0;p.sort(rU);for(let N=0,F=p.length;N<F;N++){const K=p[N],ne=K.color,ee=K.intensity,ie=K.distance;let he=null;if(K.shadow&&K.shadow.map&&(K.shadow.map.texture.format===Bu?he=K.shadow.map.texture:he=K.shadow.map.depthTexture||K.shadow.map.texture),K.isAmbientLight)_+=ne.r*ee,v+=ne.g*ee,y+=ne.b*ee;else if(K.isLightProbe){for(let H=0;H<9;H++)n.probe[H].addScaledVector(K.sh.coefficients[H],ee);z++}else if(K.isDirectionalLight){const H=e.get(K);if(H.color.copy(K.color).multiplyScalar(K.intensity),K.castShadow){const Y=K.shadow,$=t.get(K);$.shadowIntensity=Y.intensity,$.shadowBias=Y.bias,$.shadowNormalBias=Y.normalBias,$.shadowRadius=Y.radius,$.shadowMapSize=Y.mapSize,n.directionalShadow[x]=$,n.directionalShadowMap[x]=he,n.directionalShadowMatrix[x]=K.shadow.matrix,w++}n.directional[x]=H,x++}else if(K.isSpotLight){const H=e.get(K);H.position.setFromMatrixPosition(K.matrixWorld),H.color.copy(ne).multiplyScalar(ee),H.distance=ie,H.coneCos=Math.cos(K.angle),H.penumbraCos=Math.cos(K.angle*(1-K.penumbra)),H.decay=K.decay,n.spot[R]=H;const Y=K.shadow;if(K.map&&(n.spotLightMap[P]=K.map,P++,Y.updateMatrices(K),K.castShadow&&O++),n.spotLightMatrix[R]=Y.matrix,K.castShadow){const $=t.get(K);$.shadowIntensity=Y.intensity,$.shadowBias=Y.bias,$.shadowNormalBias=Y.normalBias,$.shadowRadius=Y.radius,$.shadowMapSize=Y.mapSize,n.spotShadow[R]=$,n.spotShadowMap[R]=he,L++}R++}else if(K.isRectAreaLight){const H=e.get(K);H.color.copy(ne).multiplyScalar(ee),H.halfWidth.set(K.width*.5,0,0),H.halfHeight.set(0,K.height*.5,0),n.rectArea[T]=H,T++}else if(K.isPointLight){const H=e.get(K);if(H.color.copy(K.color).multiplyScalar(K.intensity),H.distance=K.distance,H.decay=K.decay,K.castShadow){const Y=K.shadow,$=t.get(K);$.shadowIntensity=Y.intensity,$.shadowBias=Y.bias,$.shadowNormalBias=Y.normalBias,$.shadowRadius=Y.radius,$.shadowMapSize=Y.mapSize,$.shadowCameraNear=Y.camera.near,$.shadowCameraFar=Y.camera.far,n.pointShadow[b]=$,n.pointShadowMap[b]=he,n.pointShadowMatrix[b]=K.shadow.matrix,D++}n.point[b]=H,b++}else if(K.isHemisphereLight){const H=e.get(K);H.skyColor.copy(K.color).multiplyScalar(ee),H.groundColor.copy(K.groundColor).multiplyScalar(ee),n.hemi[M]=H,M++}}T>0&&(s.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=Pt.LTC_FLOAT_1,n.rectAreaLTC2=Pt.LTC_FLOAT_2):(n.rectAreaLTC1=Pt.LTC_HALF_1,n.rectAreaLTC2=Pt.LTC_HALF_2)),n.ambient[0]=_,n.ambient[1]=v,n.ambient[2]=y;const V=n.hash;(V.directionalLength!==x||V.pointLength!==b||V.spotLength!==R||V.rectAreaLength!==T||V.hemiLength!==M||V.numDirectionalShadows!==w||V.numPointShadows!==D||V.numSpotShadows!==L||V.numSpotMaps!==P||V.numLightProbes!==z)&&(n.directional.length=x,n.spot.length=R,n.rectArea.length=T,n.point.length=b,n.hemi.length=M,n.directionalShadow.length=w,n.directionalShadowMap.length=w,n.pointShadow.length=D,n.pointShadowMap.length=D,n.spotShadow.length=L,n.spotShadowMap.length=L,n.directionalShadowMatrix.length=w,n.pointShadowMatrix.length=D,n.spotLightMatrix.length=L+P-O,n.spotLightMap.length=P,n.numSpotLightShadowsWithMaps=O,n.numLightProbes=z,V.directionalLength=x,V.pointLength=b,V.spotLength=R,V.rectAreaLength=T,V.hemiLength=M,V.numDirectionalShadows=w,V.numPointShadows=D,V.numSpotShadows=L,V.numSpotMaps=P,V.numLightProbes=z,n.version=sU++)}function d(p,_){let v=0,y=0,x=0,b=0,R=0;const T=_.matrixWorldInverse;for(let M=0,w=p.length;M<w;M++){const D=p[M];if(D.isDirectionalLight){const L=n.directional[v];L.direction.setFromMatrixPosition(D.matrixWorld),i.setFromMatrixPosition(D.target.matrixWorld),L.direction.sub(i),L.direction.transformDirection(T),v++}else if(D.isSpotLight){const L=n.spot[x];L.position.setFromMatrixPosition(D.matrixWorld),L.position.applyMatrix4(T),L.direction.setFromMatrixPosition(D.matrixWorld),i.setFromMatrixPosition(D.target.matrixWorld),L.direction.sub(i),L.direction.transformDirection(T),x++}else if(D.isRectAreaLight){const L=n.rectArea[b];L.position.setFromMatrixPosition(D.matrixWorld),L.position.applyMatrix4(T),l.identity(),o.copy(D.matrixWorld),o.premultiply(T),l.extractRotation(o),L.halfWidth.set(D.width*.5,0,0),L.halfHeight.set(0,D.height*.5,0),L.halfWidth.applyMatrix4(l),L.halfHeight.applyMatrix4(l),b++}else if(D.isPointLight){const L=n.point[y];L.position.setFromMatrixPosition(D.matrixWorld),L.position.applyMatrix4(T),y++}else if(D.isHemisphereLight){const L=n.hemi[R];L.direction.setFromMatrixPosition(D.matrixWorld),L.direction.transformDirection(T),R++}}}return{setup:h,setupView:d,state:n}}function YE(s){const e=new oU(s),t=[],n=[];function i(_){p.camera=_,t.length=0,n.length=0}function o(_){t.push(_)}function l(_){n.push(_)}function h(){e.setup(t)}function d(_){e.setupView(t,_)}const p={lightsArray:t,shadowsArray:n,camera:null,lights:e,transmissionRenderTarget:{}};return{init:i,state:p,setupLights:h,setupLightsView:d,pushLight:o,pushShadow:l}}function lU(s){let e=new WeakMap;function t(i,o=0){const l=e.get(i);let h;return l===void 0?(h=new YE(s),e.set(i,[h])):o>=l.length?(h=new YE(s),l.push(h)):h=l[o],h}function n(){e=new WeakMap}return{get:t,dispose:n}}const cU=`void main() {
3968
+ `+W)}else he!==""?Ot("WebGLProgram: Program Info Log:",he):(H===""||Y==="")&&(ye=!1);ye&&(K.diagnostics={runnable:$,programLog:he,vertexShader:{log:H,prefix:T},fragmentShader:{log:Y,prefix:M}})}i.deleteShader(P),i.deleteShader(O),V=new e_(i,R),N=UN(i,R)}let V;this.getUniforms=function(){return V===void 0&&z(this),V};let N;this.getAttributes=function(){return N===void 0&&z(this),N};let F=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return F===!1&&(F=i.getProgramParameter(R,bN)),F},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(R),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=EN++,this.cacheKey=e,this.usedTimes=1,this.program=R,this.vertexShader=P,this.fragmentShader=O,this}let jN=0;class ZN{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,i=this._getShaderStage(t),o=this._getShaderStage(n),l=this._getShaderCacheForMaterial(e);return l.has(i)===!1&&(l.add(i),i.usedTimes++),l.has(o)===!1&&(l.add(o),o.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const n of t)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.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 n=t.get(e);return n===void 0&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){const t=this.shaderCache;let n=t.get(e);return n===void 0&&(n=new QN(e),t.set(e,n)),n}}class QN{constructor(e){this.id=jN++,this.code=e,this.usedTimes=0}}function $N(s,e,t,n,i,o,l){const h=new vh,d=new ZN,p=new Set,_=[],v=new Map,y=i.logarithmicDepthBuffer;let x=i.precision;const b={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distance",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function R(N){return p.add(N),N===0?"uv":`uv${N}`}function T(N,F,K,ne,ee){const ie=ne.fog,he=ee.geometry,H=N.isMeshStandardMaterial?ne.environment:null,Y=(N.isMeshStandardMaterial?t:e).get(N.envMap||H),$=Y&&Y.mapping===ih?Y.image.height:null,ye=b[N.type];N.precision!==null&&(x=i.getMaxPrecision(N.precision),x!==N.precision&&Ot("WebGLProgram.getParameters:",N.precision,"not supported, using",x,"instead."));const _e=he.morphAttributes.position||he.morphAttributes.normal||he.morphAttributes.color,W=_e!==void 0?_e.length:0;let ae=0;he.morphAttributes.position!==void 0&&(ae=1),he.morphAttributes.normal!==void 0&&(ae=2),he.morphAttributes.color!==void 0&&(ae=3);let Me,Ne,it,ve;if(ye){const bt=po[ye];Me=bt.vertexShader,Ne=bt.fragmentShader}else Me=N.vertexShader,Ne=N.fragmentShader,d.update(N),it=d.getVertexShaderID(N),ve=d.getFragmentShaderID(N);const Ce=s.getRenderTarget(),tt=s.state.buffers.depth.getReversed(),Et=ee.isInstancedMesh===!0,wt=ee.isBatchedMesh===!0,on=!!N.map,It=!!N.matcap,mt=!!Y,me=!!N.aoMap,Le=!!N.lightMap,Ue=!!N.bumpMap,rt=!!N.normalMap,Q=!!N.displacementMap,Kt=!!N.emissiveMap,_t=!!N.metalnessMap,Ft=!!N.roughnessMap,yt=N.anisotropy>0,j=N.clearcoat>0,I=N.dispersion>0,ue=N.iridescence>0,Ie=N.sheen>0,Xe=N.transmission>0,Oe=yt&&!!N.anisotropyMap,Bt=j&&!!N.clearcoatMap,gt=j&&!!N.clearcoatNormalMap,Ht=j&&!!N.clearcoatRoughnessMap,Xt=ue&&!!N.iridescenceMap,ze=ue&&!!N.iridescenceThicknessMap,qe=Ie&&!!N.sheenColorMap,Tt=Ie&&!!N.sheenRoughnessMap,pt=!!N.specularMap,st=!!N.specularColorMap,qt=!!N.specularIntensityMap,de=Xe&&!!N.transmissionMap,be=Xe&&!!N.thicknessMap,We=!!N.gradientMap,St=!!N.alphaMap,Ye=N.alphaTest>0,Ve=!!N.alphaHash,ft=!!N.extensions;let jt=Lr;N.toneMapped&&(Ce===null||Ce.isXRRenderTarget===!0)&&(jt=s.toneMapping);const Mn={shaderID:ye,shaderType:N.type,shaderName:N.name,vertexShader:Me,fragmentShader:Ne,defines:N.defines,customVertexShaderID:it,customFragmentShaderID:ve,isRawShaderMaterial:N.isRawShaderMaterial===!0,glslVersion:N.glslVersion,precision:x,batching:wt,batchingColor:wt&&ee._colorsTexture!==null,instancing:Et,instancingColor:Et&&ee.instanceColor!==null,instancingMorph:Et&&ee.morphTexture!==null,outputColorSpace:Ce===null?s.outputColorSpace:Ce.isXRRenderTarget===!0?Ce.texture.colorSpace:Ma,alphaToCoverage:!!N.alphaToCoverage,map:on,matcap:It,envMap:mt,envMapMode:mt&&Y.mapping,envMapCubeUVHeight:$,aoMap:me,lightMap:Le,bumpMap:Ue,normalMap:rt,displacementMap:Q,emissiveMap:Kt,normalMapObjectSpace:rt&&N.normalMapType===fb,normalMapTangentSpace:rt&&N.normalMapType===Ac,metalnessMap:_t,roughnessMap:Ft,anisotropy:yt,anisotropyMap:Oe,clearcoat:j,clearcoatMap:Bt,clearcoatNormalMap:gt,clearcoatRoughnessMap:Ht,dispersion:I,iridescence:ue,iridescenceMap:Xt,iridescenceThicknessMap:ze,sheen:Ie,sheenColorMap:qe,sheenRoughnessMap:Tt,specularMap:pt,specularColorMap:st,specularIntensityMap:qt,transmission:Xe,transmissionMap:de,thicknessMap:be,gradientMap:We,opaque:N.transparent===!1&&N.blending===Tu&&N.alphaToCoverage===!1,alphaMap:St,alphaTest:Ye,alphaHash:Ve,combine:N.combine,mapUv:on&&R(N.map.channel),aoMapUv:me&&R(N.aoMap.channel),lightMapUv:Le&&R(N.lightMap.channel),bumpMapUv:Ue&&R(N.bumpMap.channel),normalMapUv:rt&&R(N.normalMap.channel),displacementMapUv:Q&&R(N.displacementMap.channel),emissiveMapUv:Kt&&R(N.emissiveMap.channel),metalnessMapUv:_t&&R(N.metalnessMap.channel),roughnessMapUv:Ft&&R(N.roughnessMap.channel),anisotropyMapUv:Oe&&R(N.anisotropyMap.channel),clearcoatMapUv:Bt&&R(N.clearcoatMap.channel),clearcoatNormalMapUv:gt&&R(N.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Ht&&R(N.clearcoatRoughnessMap.channel),iridescenceMapUv:Xt&&R(N.iridescenceMap.channel),iridescenceThicknessMapUv:ze&&R(N.iridescenceThicknessMap.channel),sheenColorMapUv:qe&&R(N.sheenColorMap.channel),sheenRoughnessMapUv:Tt&&R(N.sheenRoughnessMap.channel),specularMapUv:pt&&R(N.specularMap.channel),specularColorMapUv:st&&R(N.specularColorMap.channel),specularIntensityMapUv:qt&&R(N.specularIntensityMap.channel),transmissionMapUv:de&&R(N.transmissionMap.channel),thicknessMapUv:be&&R(N.thicknessMap.channel),alphaMapUv:St&&R(N.alphaMap.channel),vertexTangents:!!he.attributes.tangent&&(rt||yt),vertexColors:N.vertexColors,vertexAlphas:N.vertexColors===!0&&!!he.attributes.color&&he.attributes.color.itemSize===4,pointsUvs:ee.isPoints===!0&&!!he.attributes.uv&&(on||St),fog:!!ie,useFog:N.fog===!0,fogExp2:!!ie&&ie.isFogExp2,flatShading:N.flatShading===!0&&N.wireframe===!1,sizeAttenuation:N.sizeAttenuation===!0,logarithmicDepthBuffer:y,reversedDepthBuffer:tt,skinning:ee.isSkinnedMesh===!0,morphTargets:he.morphAttributes.position!==void 0,morphNormals:he.morphAttributes.normal!==void 0,morphColors:he.morphAttributes.color!==void 0,morphTargetsCount:W,morphTextureStride:ae,numDirLights:F.directional.length,numPointLights:F.point.length,numSpotLights:F.spot.length,numSpotLightMaps:F.spotLightMap.length,numRectAreaLights:F.rectArea.length,numHemiLights:F.hemi.length,numDirLightShadows:F.directionalShadowMap.length,numPointLightShadows:F.pointShadowMap.length,numSpotLightShadows:F.spotShadowMap.length,numSpotLightShadowsWithMaps:F.numSpotLightShadowsWithMaps,numLightProbes:F.numLightProbes,numClippingPlanes:l.numPlanes,numClipIntersection:l.numIntersection,dithering:N.dithering,shadowMapEnabled:s.shadowMap.enabled&&K.length>0,shadowMapType:s.shadowMap.type,toneMapping:jt,decodeVideoTexture:on&&N.map.isVideoTexture===!0&&Hn.getTransfer(N.map.colorSpace)===gi,decodeVideoTextureEmissive:Kt&&N.emissiveMap.isVideoTexture===!0&&Hn.getTransfer(N.emissiveMap.colorSpace)===gi,premultipliedAlpha:N.premultipliedAlpha,doubleSided:N.side===hr,flipSided:N.side===ws,useDepthPacking:N.depthPacking>=0,depthPacking:N.depthPacking||0,index0AttributeName:N.index0AttributeName,extensionClipCullDistance:ft&&N.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(ft&&N.extensions.multiDraw===!0||wt)&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:N.customProgramCacheKey()};return Mn.vertexUv1s=p.has(1),Mn.vertexUv2s=p.has(2),Mn.vertexUv3s=p.has(3),p.clear(),Mn}function M(N){const F=[];if(N.shaderID?F.push(N.shaderID):(F.push(N.customVertexShaderID),F.push(N.customFragmentShaderID)),N.defines!==void 0)for(const K in N.defines)F.push(K),F.push(N.defines[K]);return N.isRawShaderMaterial===!1&&(w(F,N),D(F,N),F.push(s.outputColorSpace)),F.push(N.customProgramCacheKey),F.join()}function w(N,F){N.push(F.precision),N.push(F.outputColorSpace),N.push(F.envMapMode),N.push(F.envMapCubeUVHeight),N.push(F.mapUv),N.push(F.alphaMapUv),N.push(F.lightMapUv),N.push(F.aoMapUv),N.push(F.bumpMapUv),N.push(F.normalMapUv),N.push(F.displacementMapUv),N.push(F.emissiveMapUv),N.push(F.metalnessMapUv),N.push(F.roughnessMapUv),N.push(F.anisotropyMapUv),N.push(F.clearcoatMapUv),N.push(F.clearcoatNormalMapUv),N.push(F.clearcoatRoughnessMapUv),N.push(F.iridescenceMapUv),N.push(F.iridescenceThicknessMapUv),N.push(F.sheenColorMapUv),N.push(F.sheenRoughnessMapUv),N.push(F.specularMapUv),N.push(F.specularColorMapUv),N.push(F.specularIntensityMapUv),N.push(F.transmissionMapUv),N.push(F.thicknessMapUv),N.push(F.combine),N.push(F.fogExp2),N.push(F.sizeAttenuation),N.push(F.morphTargetsCount),N.push(F.morphAttributeCount),N.push(F.numDirLights),N.push(F.numPointLights),N.push(F.numSpotLights),N.push(F.numSpotLightMaps),N.push(F.numHemiLights),N.push(F.numRectAreaLights),N.push(F.numDirLightShadows),N.push(F.numPointLightShadows),N.push(F.numSpotLightShadows),N.push(F.numSpotLightShadowsWithMaps),N.push(F.numLightProbes),N.push(F.shadowMapType),N.push(F.toneMapping),N.push(F.numClippingPlanes),N.push(F.numClipIntersection),N.push(F.depthPacking)}function D(N,F){h.disableAll(),F.instancing&&h.enable(0),F.instancingColor&&h.enable(1),F.instancingMorph&&h.enable(2),F.matcap&&h.enable(3),F.envMap&&h.enable(4),F.normalMapObjectSpace&&h.enable(5),F.normalMapTangentSpace&&h.enable(6),F.clearcoat&&h.enable(7),F.iridescence&&h.enable(8),F.alphaTest&&h.enable(9),F.vertexColors&&h.enable(10),F.vertexAlphas&&h.enable(11),F.vertexUv1s&&h.enable(12),F.vertexUv2s&&h.enable(13),F.vertexUv3s&&h.enable(14),F.vertexTangents&&h.enable(15),F.anisotropy&&h.enable(16),F.alphaHash&&h.enable(17),F.batching&&h.enable(18),F.dispersion&&h.enable(19),F.batchingColor&&h.enable(20),F.gradientMap&&h.enable(21),N.push(h.mask),h.disableAll(),F.fog&&h.enable(0),F.useFog&&h.enable(1),F.flatShading&&h.enable(2),F.logarithmicDepthBuffer&&h.enable(3),F.reversedDepthBuffer&&h.enable(4),F.skinning&&h.enable(5),F.morphTargets&&h.enable(6),F.morphNormals&&h.enable(7),F.morphColors&&h.enable(8),F.premultipliedAlpha&&h.enable(9),F.shadowMapEnabled&&h.enable(10),F.doubleSided&&h.enable(11),F.flipSided&&h.enable(12),F.useDepthPacking&&h.enable(13),F.dithering&&h.enable(14),F.transmission&&h.enable(15),F.sheen&&h.enable(16),F.opaque&&h.enable(17),F.pointsUvs&&h.enable(18),F.decodeVideoTexture&&h.enable(19),F.decodeVideoTextureEmissive&&h.enable(20),F.alphaToCoverage&&h.enable(21),N.push(h.mask)}function L(N){const F=b[N.type];let K;if(F){const ne=po[F];K=Gb.clone(ne.uniforms)}else K=N.uniforms;return K}function P(N,F){let K=v.get(F);return K!==void 0?++K.usedTimes:(K=new WN(s,F,N,o),_.push(K),v.set(F,K)),K}function O(N){if(--N.usedTimes===0){const F=_.indexOf(N);_[F]=_[_.length-1],_.pop(),v.delete(N.cacheKey),N.destroy()}}function z(N){d.remove(N)}function V(){d.dispose()}return{getParameters:T,getProgramCacheKey:M,getUniforms:L,acquireProgram:P,releaseProgram:O,releaseShaderCache:z,programs:_,dispose:V}}function eU(){let s=new WeakMap;function e(l){return s.has(l)}function t(l){let h=s.get(l);return h===void 0&&(h={},s.set(l,h)),h}function n(l){s.delete(l)}function i(l,h,d){s.get(l)[h]=d}function o(){s=new WeakMap}return{has:e,get:t,remove:n,update:i,dispose:o}}function tU(s,e){return s.groupOrder!==e.groupOrder?s.groupOrder-e.groupOrder:s.renderOrder!==e.renderOrder?s.renderOrder-e.renderOrder:s.material.id!==e.material.id?s.material.id-e.material.id:s.z!==e.z?s.z-e.z:s.id-e.id}function kE(s,e){return s.groupOrder!==e.groupOrder?s.groupOrder-e.groupOrder:s.renderOrder!==e.renderOrder?s.renderOrder-e.renderOrder:s.z!==e.z?e.z-s.z:s.id-e.id}function XE(){const s=[];let e=0;const t=[],n=[],i=[];function o(){e=0,t.length=0,n.length=0,i.length=0}function l(v,y,x,b,R,T){let M=s[e];return M===void 0?(M={id:v.id,object:v,geometry:y,material:x,groupOrder:b,renderOrder:v.renderOrder,z:R,group:T},s[e]=M):(M.id=v.id,M.object=v,M.geometry=y,M.material=x,M.groupOrder=b,M.renderOrder=v.renderOrder,M.z=R,M.group=T),e++,M}function h(v,y,x,b,R,T){const M=l(v,y,x,b,R,T);x.transmission>0?n.push(M):x.transparent===!0?i.push(M):t.push(M)}function d(v,y,x,b,R,T){const M=l(v,y,x,b,R,T);x.transmission>0?n.unshift(M):x.transparent===!0?i.unshift(M):t.unshift(M)}function p(v,y){t.length>1&&t.sort(v||tU),n.length>1&&n.sort(y||kE),i.length>1&&i.sort(y||kE)}function _(){for(let v=e,y=s.length;v<y;v++){const x=s[v];if(x.id===null)break;x.id=null,x.object=null,x.geometry=null,x.material=null,x.group=null}}return{opaque:t,transmissive:n,transparent:i,init:o,push:h,unshift:d,finish:_,sort:p}}function nU(){let s=new WeakMap;function e(n,i){const o=s.get(n);let l;return o===void 0?(l=new XE,s.set(n,[l])):i>=o.length?(l=new XE,o.push(l)):l=o[i],l}function t(){s=new WeakMap}return{get:e,dispose:t}}function iU(){const s={};return{get:function(e){if(s[e.id]!==void 0)return s[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new Z,color:new Rt};break;case"SpotLight":t={position:new Z,direction:new Z,color:new Rt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new Z,color:new Rt,distance:0,decay:0};break;case"HemisphereLight":t={direction:new Z,skyColor:new Rt,groundColor:new Rt};break;case"RectAreaLight":t={color:new Rt,position:new Z,halfWidth:new Z,halfHeight:new Z};break}return s[e.id]=t,t}}}function aU(){const s={};return{get:function(e){if(s[e.id]!==void 0)return s[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new et};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new et};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new et,shadowCameraNear:1,shadowCameraFar:1e3};break}return s[e.id]=t,t}}}let sU=0;function rU(s,e){return(e.castShadow?2:0)-(s.castShadow?2:0)+(e.map?1:0)-(s.map?1:0)}function oU(s){const e=new iU,t=aU(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let p=0;p<9;p++)n.probe.push(new Z);const i=new Z,o=new cn,l=new cn;function h(p){let _=0,v=0,y=0;for(let N=0;N<9;N++)n.probe[N].set(0,0,0);let x=0,b=0,R=0,T=0,M=0,w=0,D=0,L=0,P=0,O=0,z=0;p.sort(rU);for(let N=0,F=p.length;N<F;N++){const K=p[N],ne=K.color,ee=K.intensity,ie=K.distance;let he=null;if(K.shadow&&K.shadow.map&&(K.shadow.map.texture.format===Bu?he=K.shadow.map.texture:he=K.shadow.map.depthTexture||K.shadow.map.texture),K.isAmbientLight)_+=ne.r*ee,v+=ne.g*ee,y+=ne.b*ee;else if(K.isLightProbe){for(let H=0;H<9;H++)n.probe[H].addScaledVector(K.sh.coefficients[H],ee);z++}else if(K.isDirectionalLight){const H=e.get(K);if(H.color.copy(K.color).multiplyScalar(K.intensity),K.castShadow){const Y=K.shadow,$=t.get(K);$.shadowIntensity=Y.intensity,$.shadowBias=Y.bias,$.shadowNormalBias=Y.normalBias,$.shadowRadius=Y.radius,$.shadowMapSize=Y.mapSize,n.directionalShadow[x]=$,n.directionalShadowMap[x]=he,n.directionalShadowMatrix[x]=K.shadow.matrix,w++}n.directional[x]=H,x++}else if(K.isSpotLight){const H=e.get(K);H.position.setFromMatrixPosition(K.matrixWorld),H.color.copy(ne).multiplyScalar(ee),H.distance=ie,H.coneCos=Math.cos(K.angle),H.penumbraCos=Math.cos(K.angle*(1-K.penumbra)),H.decay=K.decay,n.spot[R]=H;const Y=K.shadow;if(K.map&&(n.spotLightMap[P]=K.map,P++,Y.updateMatrices(K),K.castShadow&&O++),n.spotLightMatrix[R]=Y.matrix,K.castShadow){const $=t.get(K);$.shadowIntensity=Y.intensity,$.shadowBias=Y.bias,$.shadowNormalBias=Y.normalBias,$.shadowRadius=Y.radius,$.shadowMapSize=Y.mapSize,n.spotShadow[R]=$,n.spotShadowMap[R]=he,L++}R++}else if(K.isRectAreaLight){const H=e.get(K);H.color.copy(ne).multiplyScalar(ee),H.halfWidth.set(K.width*.5,0,0),H.halfHeight.set(0,K.height*.5,0),n.rectArea[T]=H,T++}else if(K.isPointLight){const H=e.get(K);if(H.color.copy(K.color).multiplyScalar(K.intensity),H.distance=K.distance,H.decay=K.decay,K.castShadow){const Y=K.shadow,$=t.get(K);$.shadowIntensity=Y.intensity,$.shadowBias=Y.bias,$.shadowNormalBias=Y.normalBias,$.shadowRadius=Y.radius,$.shadowMapSize=Y.mapSize,$.shadowCameraNear=Y.camera.near,$.shadowCameraFar=Y.camera.far,n.pointShadow[b]=$,n.pointShadowMap[b]=he,n.pointShadowMatrix[b]=K.shadow.matrix,D++}n.point[b]=H,b++}else if(K.isHemisphereLight){const H=e.get(K);H.skyColor.copy(K.color).multiplyScalar(ee),H.groundColor.copy(K.groundColor).multiplyScalar(ee),n.hemi[M]=H,M++}}T>0&&(s.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=Pt.LTC_FLOAT_1,n.rectAreaLTC2=Pt.LTC_FLOAT_2):(n.rectAreaLTC1=Pt.LTC_HALF_1,n.rectAreaLTC2=Pt.LTC_HALF_2)),n.ambient[0]=_,n.ambient[1]=v,n.ambient[2]=y;const V=n.hash;(V.directionalLength!==x||V.pointLength!==b||V.spotLength!==R||V.rectAreaLength!==T||V.hemiLength!==M||V.numDirectionalShadows!==w||V.numPointShadows!==D||V.numSpotShadows!==L||V.numSpotMaps!==P||V.numLightProbes!==z)&&(n.directional.length=x,n.spot.length=R,n.rectArea.length=T,n.point.length=b,n.hemi.length=M,n.directionalShadow.length=w,n.directionalShadowMap.length=w,n.pointShadow.length=D,n.pointShadowMap.length=D,n.spotShadow.length=L,n.spotShadowMap.length=L,n.directionalShadowMatrix.length=w,n.pointShadowMatrix.length=D,n.spotLightMatrix.length=L+P-O,n.spotLightMap.length=P,n.numSpotLightShadowsWithMaps=O,n.numLightProbes=z,V.directionalLength=x,V.pointLength=b,V.spotLength=R,V.rectAreaLength=T,V.hemiLength=M,V.numDirectionalShadows=w,V.numPointShadows=D,V.numSpotShadows=L,V.numSpotMaps=P,V.numLightProbes=z,n.version=sU++)}function d(p,_){let v=0,y=0,x=0,b=0,R=0;const T=_.matrixWorldInverse;for(let M=0,w=p.length;M<w;M++){const D=p[M];if(D.isDirectionalLight){const L=n.directional[v];L.direction.setFromMatrixPosition(D.matrixWorld),i.setFromMatrixPosition(D.target.matrixWorld),L.direction.sub(i),L.direction.transformDirection(T),v++}else if(D.isSpotLight){const L=n.spot[x];L.position.setFromMatrixPosition(D.matrixWorld),L.position.applyMatrix4(T),L.direction.setFromMatrixPosition(D.matrixWorld),i.setFromMatrixPosition(D.target.matrixWorld),L.direction.sub(i),L.direction.transformDirection(T),x++}else if(D.isRectAreaLight){const L=n.rectArea[b];L.position.setFromMatrixPosition(D.matrixWorld),L.position.applyMatrix4(T),l.identity(),o.copy(D.matrixWorld),o.premultiply(T),l.extractRotation(o),L.halfWidth.set(D.width*.5,0,0),L.halfHeight.set(0,D.height*.5,0),L.halfWidth.applyMatrix4(l),L.halfHeight.applyMatrix4(l),b++}else if(D.isPointLight){const L=n.point[y];L.position.setFromMatrixPosition(D.matrixWorld),L.position.applyMatrix4(T),y++}else if(D.isHemisphereLight){const L=n.hemi[R];L.direction.setFromMatrixPosition(D.matrixWorld),L.direction.transformDirection(T),R++}}}return{setup:h,setupView:d,state:n}}function YE(s){const e=new oU(s),t=[],n=[];function i(_){p.camera=_,t.length=0,n.length=0}function o(_){t.push(_)}function l(_){n.push(_)}function h(){e.setup(t)}function d(_){e.setupView(t,_)}const p={lightsArray:t,shadowsArray:n,camera:null,lights:e,transmissionRenderTarget:{}};return{init:i,state:p,setupLights:h,setupLightsView:d,pushLight:o,pushShadow:l}}function lU(s){let e=new WeakMap;function t(i,o=0){const l=e.get(i);let h;return l===void 0?(h=new YE(s),e.set(i,[h])):o>=l.length?(h=new YE(s),l.push(h)):h=l[o],h}function n(){e=new WeakMap}return{get:t,dispose:n}}const cU=`void main() {
3969
3969
  gl_Position = vec4( position, 1.0 );
3970
3970
  }`,uU=`uniform sampler2D shadow_pass;
3971
3971
  uniform vec2 resolution;
@@ -3992,7 +3992,7 @@ void main() {
3992
3992
  squared_mean = squared_mean / samples;
3993
3993
  float std_dev = sqrt( max( 0.0, squared_mean - mean * mean ) );
3994
3994
  gl_FragColor = vec4( mean, std_dev, 0.0, 1.0 );
3995
- }`,fU=[new Z(1,0,0),new Z(-1,0,0),new Z(0,1,0),new Z(0,-1,0),new Z(0,0,1),new Z(0,0,-1)],hU=[new Z(0,-1,0),new Z(0,-1,0),new Z(0,0,1),new Z(0,0,-1),new Z(0,-1,0),new Z(0,-1,0)],JE=new cn,Qp=new Z,GA=new Z;function dU(s,e,t){let n=new Nh;const i=new et,o=new et,l=new Ti,h=new rA,d=new oA,p={},_=t.maxTextureSize,v={[ao]:ws,[ws]:ao,[hr]:hr},y=new Ns({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new et},radius:{value:4}},vertexShader:cU,fragmentShader:uU}),x=y.clone();x.defines.HORIZONTAL_PASS=1;const b=new yn;b.setAttribute("position",new Kn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const R=new Oi(b,y),T=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=th;let M=this.type;this.render=function(O,z,V){if(T.enabled===!1||T.autoUpdate===!1&&T.needsUpdate===!1||O.length===0)return;O.type===ip&&(Ot("WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead."),O.type=th);const N=s.getRenderTarget(),F=s.getActiveCubeFace(),K=s.getActiveMipmapLevel(),ne=s.state;ne.setBlending(so),ne.buffers.depth.getReversed()===!0?ne.buffers.color.setClear(0,0,0,0):ne.buffers.color.setClear(1,1,1,1),ne.buffers.depth.setTest(!0),ne.setScissorTest(!1);const ee=M!==this.type;ee&&z.traverse(function(ie){ie.material&&(Array.isArray(ie.material)?ie.material.forEach(he=>he.needsUpdate=!0):ie.material.needsUpdate=!0)});for(let ie=0,he=O.length;ie<he;ie++){const H=O[ie],Y=H.shadow;if(Y===void 0){Ot("WebGLShadowMap:",H,"has no shadow.");continue}if(Y.autoUpdate===!1&&Y.needsUpdate===!1)continue;i.copy(Y.mapSize);const $=Y.getFrameExtents();if(i.multiply($),o.copy(Y.mapSize),(i.x>_||i.y>_)&&(i.x>_&&(o.x=Math.floor(_/$.x),i.x=o.x*$.x,Y.mapSize.x=o.x),i.y>_&&(o.y=Math.floor(_/$.y),i.y=o.y*$.y,Y.mapSize.y=o.y)),Y.map===null||ee===!0){if(Y.map!==null&&(Y.map.depthTexture!==null&&(Y.map.depthTexture.dispose(),Y.map.depthTexture=null),Y.map.dispose()),this.type===Eu){if(H.isPointLight){Ot("WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.");continue}Y.map=new Ds(i.x,i.y,{format:Bu,type:sa,minFilter:In,magFilter:In,generateMipmaps:!1}),Y.map.texture.name=H.name+".shadowMap",Y.map.depthTexture=new Uh(i.x,i.y,Vi),Y.map.depthTexture.name=H.name+".shadowMapDepth",Y.map.depthTexture.format=Ho,Y.map.depthTexture.compareFunction=null,Y.map.depthTexture.minFilter=zi,Y.map.depthTexture.magFilter=zi}else{H.isPointLight?(Y.map=new K0(i.x),Y.map.depthTexture=new p1(i.x,dr)):(Y.map=new Ds(i.x,i.y),Y.map.depthTexture=new Uh(i.x,i.y,dr)),Y.map.depthTexture.name=H.name+".shadowMap",Y.map.depthTexture.format=Ho;const _e=s.state.buffers.depth.getReversed();this.type===th?(Y.map.depthTexture.compareFunction=_e?C0:T0,Y.map.depthTexture.minFilter=In,Y.map.depthTexture.magFilter=In):(Y.map.depthTexture.compareFunction=null,Y.map.depthTexture.minFilter=zi,Y.map.depthTexture.magFilter=zi)}Y.camera.updateProjectionMatrix()}const ye=Y.map.isWebGLCubeRenderTarget?6:1;for(let _e=0;_e<ye;_e++){if(Y.map.isWebGLCubeRenderTarget)s.setRenderTarget(Y.map,_e),s.clear();else{_e===0&&(s.setRenderTarget(Y.map),s.clear());const W=Y.getViewport(_e);l.set(o.x*W.x,o.y*W.y,o.x*W.z,o.y*W.w),ne.viewport(l)}if(H.isPointLight){const W=Y.camera,ae=Y.matrix,Me=H.distance||W.far;Me!==W.far&&(W.far=Me,W.updateProjectionMatrix()),Qp.setFromMatrixPosition(H.matrixWorld),W.position.copy(Qp),GA.copy(W.position),GA.add(fU[_e]),W.up.copy(hU[_e]),W.lookAt(GA),W.updateMatrixWorld(),ae.makeTranslation(-Qp.x,-Qp.y,-Qp.z),JE.multiplyMatrices(W.projectionMatrix,W.matrixWorldInverse),Y._frustum.setFromProjectionMatrix(JE,W.coordinateSystem,W.reversedDepth)}else Y.updateMatrices(H);n=Y.getFrustum(),L(z,V,Y.camera,H,this.type)}Y.isPointLightShadow!==!0&&this.type===Eu&&w(Y,V),Y.needsUpdate=!1}M=this.type,T.needsUpdate=!1,s.setRenderTarget(N,F,K)};function w(O,z){const V=e.update(R);y.defines.VSM_SAMPLES!==O.blurSamples&&(y.defines.VSM_SAMPLES=O.blurSamples,x.defines.VSM_SAMPLES=O.blurSamples,y.needsUpdate=!0,x.needsUpdate=!0),O.mapPass===null&&(O.mapPass=new Ds(i.x,i.y,{format:Bu,type:sa})),y.uniforms.shadow_pass.value=O.map.depthTexture,y.uniforms.resolution.value=O.mapSize,y.uniforms.radius.value=O.radius,s.setRenderTarget(O.mapPass),s.clear(),s.renderBufferDirect(z,null,V,y,R,null),x.uniforms.shadow_pass.value=O.mapPass.texture,x.uniforms.resolution.value=O.mapSize,x.uniforms.radius.value=O.radius,s.setRenderTarget(O.map),s.clear(),s.renderBufferDirect(z,null,V,x,R,null)}function D(O,z,V,N){let F=null;const K=V.isPointLight===!0?O.customDistanceMaterial:O.customDepthMaterial;if(K!==void 0)F=K;else if(F=V.isPointLight===!0?d:h,s.localClippingEnabled&&z.clipShadows===!0&&Array.isArray(z.clippingPlanes)&&z.clippingPlanes.length!==0||z.displacementMap&&z.displacementScale!==0||z.alphaMap&&z.alphaTest>0||z.map&&z.alphaTest>0||z.alphaToCoverage===!0){const ne=F.uuid,ee=z.uuid;let ie=p[ne];ie===void 0&&(ie={},p[ne]=ie);let he=ie[ee];he===void 0&&(he=F.clone(),ie[ee]=he,z.addEventListener("dispose",P)),F=he}if(F.visible=z.visible,F.wireframe=z.wireframe,N===Eu?F.side=z.shadowSide!==null?z.shadowSide:z.side:F.side=z.shadowSide!==null?z.shadowSide:v[z.side],F.alphaMap=z.alphaMap,F.alphaTest=z.alphaToCoverage===!0?.5:z.alphaTest,F.map=z.map,F.clipShadows=z.clipShadows,F.clippingPlanes=z.clippingPlanes,F.clipIntersection=z.clipIntersection,F.displacementMap=z.displacementMap,F.displacementScale=z.displacementScale,F.displacementBias=z.displacementBias,F.wireframeLinewidth=z.wireframeLinewidth,F.linewidth=z.linewidth,V.isPointLight===!0&&F.isMeshDistanceMaterial===!0){const ne=s.properties.get(F);ne.light=V}return F}function L(O,z,V,N,F){if(O.visible===!1)return;if(O.layers.test(z.layers)&&(O.isMesh||O.isLine||O.isPoints)&&(O.castShadow||O.receiveShadow&&F===Eu)&&(!O.frustumCulled||n.intersectsObject(O))){O.modelViewMatrix.multiplyMatrices(V.matrixWorldInverse,O.matrixWorld);const ee=e.update(O),ie=O.material;if(Array.isArray(ie)){const he=ee.groups;for(let H=0,Y=he.length;H<Y;H++){const $=he[H],ye=ie[$.materialIndex];if(ye&&ye.visible){const _e=D(O,ye,N,F);O.onBeforeShadow(s,O,z,V,ee,_e,$),s.renderBufferDirect(V,null,ee,_e,O,$),O.onAfterShadow(s,O,z,V,ee,_e,$)}}}else if(ie.visible){const he=D(O,ie,N,F);O.onBeforeShadow(s,O,z,V,ee,he,null),s.renderBufferDirect(V,null,ee,he,O,null),O.onAfterShadow(s,O,z,V,ee,he,null)}}const ne=O.children;for(let ee=0,ie=ne.length;ee<ie;ee++)L(ne[ee],z,V,N,F)}function P(O){O.target.removeEventListener("dispose",P);for(const V in p){const N=p[V],F=O.target.uuid;F in N&&(N[F].dispose(),delete N[F])}}}const pU={[Lg]:Ng,[Ug]:Fg,[Og]:Hg,[Cu]:Ig,[Ng]:Lg,[Fg]:Ug,[Hg]:Og,[Ig]:Cu};function mU(s,e){function t(){let de=!1;const be=new Ti;let We=null;const St=new Ti(0,0,0,0);return{setMask:function(Ye){We!==Ye&&!de&&(s.colorMask(Ye,Ye,Ye,Ye),We=Ye)},setLocked:function(Ye){de=Ye},setClear:function(Ye,Ve,ft,jt,Sn){Sn===!0&&(Ye*=jt,Ve*=jt,ft*=jt),be.set(Ye,Ve,ft,jt),St.equals(be)===!1&&(s.clearColor(Ye,Ve,ft,jt),St.copy(be))},reset:function(){de=!1,We=null,St.set(-1,0,0,0)}}}function n(){let de=!1,be=!1,We=null,St=null,Ye=null;return{setReversed:function(Ve){if(be!==Ve){const ft=e.get("EXT_clip_control");Ve?ft.clipControlEXT(ft.LOWER_LEFT_EXT,ft.ZERO_TO_ONE_EXT):ft.clipControlEXT(ft.LOWER_LEFT_EXT,ft.NEGATIVE_ONE_TO_ONE_EXT),be=Ve;const jt=Ye;Ye=null,this.setClear(jt)}},getReversed:function(){return be},setTest:function(Ve){Ve?Ce(s.DEPTH_TEST):tt(s.DEPTH_TEST)},setMask:function(Ve){We!==Ve&&!de&&(s.depthMask(Ve),We=Ve)},setFunc:function(Ve){if(be&&(Ve=pU[Ve]),St!==Ve){switch(Ve){case Lg:s.depthFunc(s.NEVER);break;case Ng:s.depthFunc(s.ALWAYS);break;case Ug:s.depthFunc(s.LESS);break;case Cu:s.depthFunc(s.LEQUAL);break;case Og:s.depthFunc(s.EQUAL);break;case Ig:s.depthFunc(s.GEQUAL);break;case Fg:s.depthFunc(s.GREATER);break;case Hg:s.depthFunc(s.NOTEQUAL);break;default:s.depthFunc(s.LEQUAL)}St=Ve}},setLocked:function(Ve){de=Ve},setClear:function(Ve){Ye!==Ve&&(be&&(Ve=1-Ve),s.clearDepth(Ve),Ye=Ve)},reset:function(){de=!1,We=null,St=null,Ye=null,be=!1}}}function i(){let de=!1,be=null,We=null,St=null,Ye=null,Ve=null,ft=null,jt=null,Sn=null;return{setTest:function(bt){de||(bt?Ce(s.STENCIL_TEST):tt(s.STENCIL_TEST))},setMask:function(bt){be!==bt&&!de&&(s.stencilMask(bt),be=bt)},setFunc:function(bt,Dn,Nn){(We!==bt||St!==Dn||Ye!==Nn)&&(s.stencilFunc(bt,Dn,Nn),We=bt,St=Dn,Ye=Nn)},setOp:function(bt,Dn,Nn){(Ve!==bt||ft!==Dn||jt!==Nn)&&(s.stencilOp(bt,Dn,Nn),Ve=bt,ft=Dn,jt=Nn)},setLocked:function(bt){de=bt},setClear:function(bt){Sn!==bt&&(s.clearStencil(bt),Sn=bt)},reset:function(){de=!1,be=null,We=null,St=null,Ye=null,Ve=null,ft=null,jt=null,Sn=null}}}const o=new t,l=new n,h=new i,d=new WeakMap,p=new WeakMap;let _={},v={},y=new WeakMap,x=[],b=null,R=!1,T=null,M=null,w=null,D=null,L=null,P=null,O=null,z=new Rt(0,0,0),V=0,N=!1,F=null,K=null,ne=null,ee=null,ie=null;const he=s.getParameter(s.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let H=!1,Y=0;const $=s.getParameter(s.VERSION);$.indexOf("WebGL")!==-1?(Y=parseFloat(/^WebGL (\d)/.exec($)[1]),H=Y>=1):$.indexOf("OpenGL ES")!==-1&&(Y=parseFloat(/^OpenGL ES (\d)/.exec($)[1]),H=Y>=2);let ye=null,_e={};const W=s.getParameter(s.SCISSOR_BOX),ae=s.getParameter(s.VIEWPORT),Me=new Ti().fromArray(W),Ne=new Ti().fromArray(ae);function it(de,be,We,St){const Ye=new Uint8Array(4),Ve=s.createTexture();s.bindTexture(de,Ve),s.texParameteri(de,s.TEXTURE_MIN_FILTER,s.NEAREST),s.texParameteri(de,s.TEXTURE_MAG_FILTER,s.NEAREST);for(let ft=0;ft<We;ft++)de===s.TEXTURE_3D||de===s.TEXTURE_2D_ARRAY?s.texImage3D(be,0,s.RGBA,1,1,St,0,s.RGBA,s.UNSIGNED_BYTE,Ye):s.texImage2D(be+ft,0,s.RGBA,1,1,0,s.RGBA,s.UNSIGNED_BYTE,Ye);return Ve}const ve={};ve[s.TEXTURE_2D]=it(s.TEXTURE_2D,s.TEXTURE_2D,1),ve[s.TEXTURE_CUBE_MAP]=it(s.TEXTURE_CUBE_MAP,s.TEXTURE_CUBE_MAP_POSITIVE_X,6),ve[s.TEXTURE_2D_ARRAY]=it(s.TEXTURE_2D_ARRAY,s.TEXTURE_2D_ARRAY,1,1),ve[s.TEXTURE_3D]=it(s.TEXTURE_3D,s.TEXTURE_3D,1,1),o.setClear(0,0,0,1),l.setClear(1),h.setClear(0),Ce(s.DEPTH_TEST),l.setFunc(Cu),Ue(!1),rt(qy),Ce(s.CULL_FACE),me(so);function Ce(de){_[de]!==!0&&(s.enable(de),_[de]=!0)}function tt(de){_[de]!==!1&&(s.disable(de),_[de]=!1)}function Et(de,be){return v[de]!==be?(s.bindFramebuffer(de,be),v[de]=be,de===s.DRAW_FRAMEBUFFER&&(v[s.FRAMEBUFFER]=be),de===s.FRAMEBUFFER&&(v[s.DRAW_FRAMEBUFFER]=be),!0):!1}function wt(de,be){let We=x,St=!1;if(de){We=y.get(be),We===void 0&&(We=[],y.set(be,We));const Ye=de.textures;if(We.length!==Ye.length||We[0]!==s.COLOR_ATTACHMENT0){for(let Ve=0,ft=Ye.length;Ve<ft;Ve++)We[Ve]=s.COLOR_ATTACHMENT0+Ve;We.length=Ye.length,St=!0}}else We[0]!==s.BACK&&(We[0]=s.BACK,St=!0);St&&s.drawBuffers(We)}function on(de){return b!==de?(s.useProgram(de),b=de,!0):!1}const It={[mc]:s.FUNC_ADD,[VM]:s.FUNC_SUBTRACT,[kM]:s.FUNC_REVERSE_SUBTRACT};It[XM]=s.MIN,It[YM]=s.MAX;const mt={[JM]:s.ZERO,[qM]:s.ONE,[KM]:s.SRC_COLOR,[Bg]:s.SRC_ALPHA,[eb]:s.SRC_ALPHA_SATURATE,[QM]:s.DST_COLOR,[jM]:s.DST_ALPHA,[WM]:s.ONE_MINUS_SRC_COLOR,[Dg]:s.ONE_MINUS_SRC_ALPHA,[$M]:s.ONE_MINUS_DST_COLOR,[ZM]:s.ONE_MINUS_DST_ALPHA,[tb]:s.CONSTANT_COLOR,[nb]:s.ONE_MINUS_CONSTANT_COLOR,[ib]:s.CONSTANT_ALPHA,[ab]:s.ONE_MINUS_CONSTANT_ALPHA};function me(de,be,We,St,Ye,Ve,ft,jt,Sn,bt){if(de===so){R===!0&&(tt(s.BLEND),R=!1);return}if(R===!1&&(Ce(s.BLEND),R=!0),de!==zM){if(de!==T||bt!==N){if((M!==mc||L!==mc)&&(s.blendEquation(s.FUNC_ADD),M=mc,L=mc),bt)switch(de){case Tu:s.blendFuncSeparate(s.ONE,s.ONE_MINUS_SRC_ALPHA,s.ONE,s.ONE_MINUS_SRC_ALPHA);break;case Ky:s.blendFunc(s.ONE,s.ONE);break;case Wy:s.blendFuncSeparate(s.ZERO,s.ONE_MINUS_SRC_COLOR,s.ZERO,s.ONE);break;case jy:s.blendFuncSeparate(s.DST_COLOR,s.ONE_MINUS_SRC_ALPHA,s.ZERO,s.ONE);break;default:an("WebGLState: Invalid blending: ",de);break}else switch(de){case Tu:s.blendFuncSeparate(s.SRC_ALPHA,s.ONE_MINUS_SRC_ALPHA,s.ONE,s.ONE_MINUS_SRC_ALPHA);break;case Ky:s.blendFuncSeparate(s.SRC_ALPHA,s.ONE,s.ONE,s.ONE);break;case Wy:an("WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true");break;case jy:an("WebGLState: MultiplyBlending requires material.premultipliedAlpha = true");break;default:an("WebGLState: Invalid blending: ",de);break}w=null,D=null,P=null,O=null,z.set(0,0,0),V=0,T=de,N=bt}return}Ye=Ye||be,Ve=Ve||We,ft=ft||St,(be!==M||Ye!==L)&&(s.blendEquationSeparate(It[be],It[Ye]),M=be,L=Ye),(We!==w||St!==D||Ve!==P||ft!==O)&&(s.blendFuncSeparate(mt[We],mt[St],mt[Ve],mt[ft]),w=We,D=St,P=Ve,O=ft),(jt.equals(z)===!1||Sn!==V)&&(s.blendColor(jt.r,jt.g,jt.b,Sn),z.copy(jt),V=Sn),T=de,N=!1}function Le(de,be){de.side===hr?tt(s.CULL_FACE):Ce(s.CULL_FACE);let We=de.side===ws;be&&(We=!We),Ue(We),de.blending===Tu&&de.transparent===!1?me(so):me(de.blending,de.blendEquation,de.blendSrc,de.blendDst,de.blendEquationAlpha,de.blendSrcAlpha,de.blendDstAlpha,de.blendColor,de.blendAlpha,de.premultipliedAlpha),l.setFunc(de.depthFunc),l.setTest(de.depthTest),l.setMask(de.depthWrite),o.setMask(de.colorWrite);const St=de.stencilWrite;h.setTest(St),St&&(h.setMask(de.stencilWriteMask),h.setFunc(de.stencilFunc,de.stencilRef,de.stencilFuncMask),h.setOp(de.stencilFail,de.stencilZFail,de.stencilZPass)),Kt(de.polygonOffset,de.polygonOffsetFactor,de.polygonOffsetUnits),de.alphaToCoverage===!0?Ce(s.SAMPLE_ALPHA_TO_COVERAGE):tt(s.SAMPLE_ALPHA_TO_COVERAGE)}function Ue(de){F!==de&&(de?s.frontFace(s.CW):s.frontFace(s.CCW),F=de)}function rt(de){de!==HM?(Ce(s.CULL_FACE),de!==K&&(de===qy?s.cullFace(s.BACK):de===PM?s.cullFace(s.FRONT):s.cullFace(s.FRONT_AND_BACK))):tt(s.CULL_FACE),K=de}function Q(de){de!==ne&&(H&&s.lineWidth(de),ne=de)}function Kt(de,be,We){de?(Ce(s.POLYGON_OFFSET_FILL),(ee!==be||ie!==We)&&(s.polygonOffset(be,We),ee=be,ie=We)):tt(s.POLYGON_OFFSET_FILL)}function _t(de){de?Ce(s.SCISSOR_TEST):tt(s.SCISSOR_TEST)}function Ft(de){de===void 0&&(de=s.TEXTURE0+he-1),ye!==de&&(s.activeTexture(de),ye=de)}function yt(de,be,We){We===void 0&&(ye===null?We=s.TEXTURE0+he-1:We=ye);let St=_e[We];St===void 0&&(St={type:void 0,texture:void 0},_e[We]=St),(St.type!==de||St.texture!==be)&&(ye!==We&&(s.activeTexture(We),ye=We),s.bindTexture(de,be||ve[de]),St.type=de,St.texture=be)}function j(){const de=_e[ye];de!==void 0&&de.type!==void 0&&(s.bindTexture(de.type,null),de.type=void 0,de.texture=void 0)}function I(){try{s.compressedTexImage2D(...arguments)}catch(de){an("WebGLState:",de)}}function ue(){try{s.compressedTexImage3D(...arguments)}catch(de){an("WebGLState:",de)}}function Ie(){try{s.texSubImage2D(...arguments)}catch(de){an("WebGLState:",de)}}function Xe(){try{s.texSubImage3D(...arguments)}catch(de){an("WebGLState:",de)}}function Oe(){try{s.compressedTexSubImage2D(...arguments)}catch(de){an("WebGLState:",de)}}function Bt(){try{s.compressedTexSubImage3D(...arguments)}catch(de){an("WebGLState:",de)}}function gt(){try{s.texStorage2D(...arguments)}catch(de){an("WebGLState:",de)}}function Ht(){try{s.texStorage3D(...arguments)}catch(de){an("WebGLState:",de)}}function Xt(){try{s.texImage2D(...arguments)}catch(de){an("WebGLState:",de)}}function ze(){try{s.texImage3D(...arguments)}catch(de){an("WebGLState:",de)}}function qe(de){Me.equals(de)===!1&&(s.scissor(de.x,de.y,de.z,de.w),Me.copy(de))}function Tt(de){Ne.equals(de)===!1&&(s.viewport(de.x,de.y,de.z,de.w),Ne.copy(de))}function pt(de,be){let We=p.get(be);We===void 0&&(We=new WeakMap,p.set(be,We));let St=We.get(de);St===void 0&&(St=s.getUniformBlockIndex(be,de.name),We.set(de,St))}function st(de,be){const St=p.get(be).get(de);d.get(be)!==St&&(s.uniformBlockBinding(be,St,de.__bindingPointIndex),d.set(be,St))}function qt(){s.disable(s.BLEND),s.disable(s.CULL_FACE),s.disable(s.DEPTH_TEST),s.disable(s.POLYGON_OFFSET_FILL),s.disable(s.SCISSOR_TEST),s.disable(s.STENCIL_TEST),s.disable(s.SAMPLE_ALPHA_TO_COVERAGE),s.blendEquation(s.FUNC_ADD),s.blendFunc(s.ONE,s.ZERO),s.blendFuncSeparate(s.ONE,s.ZERO,s.ONE,s.ZERO),s.blendColor(0,0,0,0),s.colorMask(!0,!0,!0,!0),s.clearColor(0,0,0,0),s.depthMask(!0),s.depthFunc(s.LESS),l.setReversed(!1),s.clearDepth(1),s.stencilMask(4294967295),s.stencilFunc(s.ALWAYS,0,4294967295),s.stencilOp(s.KEEP,s.KEEP,s.KEEP),s.clearStencil(0),s.cullFace(s.BACK),s.frontFace(s.CCW),s.polygonOffset(0,0),s.activeTexture(s.TEXTURE0),s.bindFramebuffer(s.FRAMEBUFFER,null),s.bindFramebuffer(s.DRAW_FRAMEBUFFER,null),s.bindFramebuffer(s.READ_FRAMEBUFFER,null),s.useProgram(null),s.lineWidth(1),s.scissor(0,0,s.canvas.width,s.canvas.height),s.viewport(0,0,s.canvas.width,s.canvas.height),_={},ye=null,_e={},v={},y=new WeakMap,x=[],b=null,R=!1,T=null,M=null,w=null,D=null,L=null,P=null,O=null,z=new Rt(0,0,0),V=0,N=!1,F=null,K=null,ne=null,ee=null,ie=null,Me.set(0,0,s.canvas.width,s.canvas.height),Ne.set(0,0,s.canvas.width,s.canvas.height),o.reset(),l.reset(),h.reset()}return{buffers:{color:o,depth:l,stencil:h},enable:Ce,disable:tt,bindFramebuffer:Et,drawBuffers:wt,useProgram:on,setBlending:me,setMaterial:Le,setFlipSided:Ue,setCullFace:rt,setLineWidth:Q,setPolygonOffset:Kt,setScissorTest:_t,activeTexture:Ft,bindTexture:yt,unbindTexture:j,compressedTexImage2D:I,compressedTexImage3D:ue,texImage2D:Xt,texImage3D:ze,updateUBOMapping:pt,uniformBlockBinding:st,texStorage2D:gt,texStorage3D:Ht,texSubImage2D:Ie,texSubImage3D:Xe,compressedTexSubImage2D:Oe,compressedTexSubImage3D:Bt,scissor:qe,viewport:Tt,reset:qt}}function gU(s,e,t,n,i,o,l){const h=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,d=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),p=new et,_=new WeakMap;let v;const y=new WeakMap;let x=!1;try{x=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function b(j,I){return x?new OffscreenCanvas(j,I):yp("canvas")}function R(j,I,ue){let Ie=1;const Xe=yt(j);if((Xe.width>ue||Xe.height>ue)&&(Ie=ue/Math.max(Xe.width,Xe.height)),Ie<1)if(typeof HTMLImageElement<"u"&&j instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&j instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&j instanceof ImageBitmap||typeof VideoFrame<"u"&&j instanceof VideoFrame){const Oe=Math.floor(Ie*Xe.width),Bt=Math.floor(Ie*Xe.height);v===void 0&&(v=b(Oe,Bt));const gt=I?b(Oe,Bt):v;return gt.width=Oe,gt.height=Bt,gt.getContext("2d").drawImage(j,0,0,Oe,Bt),Ot("WebGLRenderer: Texture has been resized from ("+Xe.width+"x"+Xe.height+") to ("+Oe+"x"+Bt+")."),gt}else return"data"in j&&Ot("WebGLRenderer: Image in DataTexture is too big ("+Xe.width+"x"+Xe.height+")."),j;return j}function T(j){return j.generateMipmaps}function M(j){s.generateMipmap(j)}function w(j){return j.isWebGLCubeRenderTarget?s.TEXTURE_CUBE_MAP:j.isWebGL3DRenderTarget?s.TEXTURE_3D:j.isWebGLArrayRenderTarget||j.isCompressedArrayTexture?s.TEXTURE_2D_ARRAY:s.TEXTURE_2D}function D(j,I,ue,Ie,Xe=!1){if(j!==null){if(s[j]!==void 0)return s[j];Ot("WebGLRenderer: Attempt to use non-existing WebGL internal format '"+j+"'")}let Oe=I;if(I===s.RED&&(ue===s.FLOAT&&(Oe=s.R32F),ue===s.HALF_FLOAT&&(Oe=s.R16F),ue===s.UNSIGNED_BYTE&&(Oe=s.R8)),I===s.RED_INTEGER&&(ue===s.UNSIGNED_BYTE&&(Oe=s.R8UI),ue===s.UNSIGNED_SHORT&&(Oe=s.R16UI),ue===s.UNSIGNED_INT&&(Oe=s.R32UI),ue===s.BYTE&&(Oe=s.R8I),ue===s.SHORT&&(Oe=s.R16I),ue===s.INT&&(Oe=s.R32I)),I===s.RG&&(ue===s.FLOAT&&(Oe=s.RG32F),ue===s.HALF_FLOAT&&(Oe=s.RG16F),ue===s.UNSIGNED_BYTE&&(Oe=s.RG8)),I===s.RG_INTEGER&&(ue===s.UNSIGNED_BYTE&&(Oe=s.RG8UI),ue===s.UNSIGNED_SHORT&&(Oe=s.RG16UI),ue===s.UNSIGNED_INT&&(Oe=s.RG32UI),ue===s.BYTE&&(Oe=s.RG8I),ue===s.SHORT&&(Oe=s.RG16I),ue===s.INT&&(Oe=s.RG32I)),I===s.RGB_INTEGER&&(ue===s.UNSIGNED_BYTE&&(Oe=s.RGB8UI),ue===s.UNSIGNED_SHORT&&(Oe=s.RGB16UI),ue===s.UNSIGNED_INT&&(Oe=s.RGB32UI),ue===s.BYTE&&(Oe=s.RGB8I),ue===s.SHORT&&(Oe=s.RGB16I),ue===s.INT&&(Oe=s.RGB32I)),I===s.RGBA_INTEGER&&(ue===s.UNSIGNED_BYTE&&(Oe=s.RGBA8UI),ue===s.UNSIGNED_SHORT&&(Oe=s.RGBA16UI),ue===s.UNSIGNED_INT&&(Oe=s.RGBA32UI),ue===s.BYTE&&(Oe=s.RGBA8I),ue===s.SHORT&&(Oe=s.RGBA16I),ue===s.INT&&(Oe=s.RGBA32I)),I===s.RGB&&(ue===s.UNSIGNED_INT_5_9_9_9_REV&&(Oe=s.RGB9_E5),ue===s.UNSIGNED_INT_10F_11F_11F_REV&&(Oe=s.R11F_G11F_B10F)),I===s.RGBA){const Bt=Xe?vp:Hn.getTransfer(Ie);ue===s.FLOAT&&(Oe=s.RGBA32F),ue===s.HALF_FLOAT&&(Oe=s.RGBA16F),ue===s.UNSIGNED_BYTE&&(Oe=Bt===gi?s.SRGB8_ALPHA8:s.RGBA8),ue===s.UNSIGNED_SHORT_4_4_4_4&&(Oe=s.RGBA4),ue===s.UNSIGNED_SHORT_5_5_5_1&&(Oe=s.RGB5_A1)}return(Oe===s.R16F||Oe===s.R32F||Oe===s.RG16F||Oe===s.RG32F||Oe===s.RGBA16F||Oe===s.RGBA32F)&&e.get("EXT_color_buffer_float"),Oe}function L(j,I){let ue;return j?I===null||I===dr||I===sh?ue=s.DEPTH24_STENCIL8:I===Vi?ue=s.DEPTH32F_STENCIL8:I===ah&&(ue=s.DEPTH24_STENCIL8,Ot("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):I===null||I===dr||I===sh?ue=s.DEPTH_COMPONENT24:I===Vi?ue=s.DEPTH_COMPONENT32F:I===ah&&(ue=s.DEPTH_COMPONENT16),ue}function P(j,I){return T(j)===!0||j.isFramebufferTexture&&j.minFilter!==zi&&j.minFilter!==In?Math.log2(Math.max(I.width,I.height))+1:j.mipmaps!==void 0&&j.mipmaps.length>0?j.mipmaps.length:j.isCompressedTexture&&Array.isArray(j.image)?I.mipmaps.length:1}function O(j){const I=j.target;I.removeEventListener("dispose",O),V(I),I.isVideoTexture&&_.delete(I)}function z(j){const I=j.target;I.removeEventListener("dispose",z),F(I)}function V(j){const I=n.get(j);if(I.__webglInit===void 0)return;const ue=j.source,Ie=y.get(ue);if(Ie){const Xe=Ie[I.__cacheKey];Xe.usedTimes--,Xe.usedTimes===0&&N(j),Object.keys(Ie).length===0&&y.delete(ue)}n.remove(j)}function N(j){const I=n.get(j);s.deleteTexture(I.__webglTexture);const ue=j.source,Ie=y.get(ue);delete Ie[I.__cacheKey],l.memory.textures--}function F(j){const I=n.get(j);if(j.depthTexture&&(j.depthTexture.dispose(),n.remove(j.depthTexture)),j.isWebGLCubeRenderTarget)for(let Ie=0;Ie<6;Ie++){if(Array.isArray(I.__webglFramebuffer[Ie]))for(let Xe=0;Xe<I.__webglFramebuffer[Ie].length;Xe++)s.deleteFramebuffer(I.__webglFramebuffer[Ie][Xe]);else s.deleteFramebuffer(I.__webglFramebuffer[Ie]);I.__webglDepthbuffer&&s.deleteRenderbuffer(I.__webglDepthbuffer[Ie])}else{if(Array.isArray(I.__webglFramebuffer))for(let Ie=0;Ie<I.__webglFramebuffer.length;Ie++)s.deleteFramebuffer(I.__webglFramebuffer[Ie]);else s.deleteFramebuffer(I.__webglFramebuffer);if(I.__webglDepthbuffer&&s.deleteRenderbuffer(I.__webglDepthbuffer),I.__webglMultisampledFramebuffer&&s.deleteFramebuffer(I.__webglMultisampledFramebuffer),I.__webglColorRenderbuffer)for(let Ie=0;Ie<I.__webglColorRenderbuffer.length;Ie++)I.__webglColorRenderbuffer[Ie]&&s.deleteRenderbuffer(I.__webglColorRenderbuffer[Ie]);I.__webglDepthRenderbuffer&&s.deleteRenderbuffer(I.__webglDepthRenderbuffer)}const ue=j.textures;for(let Ie=0,Xe=ue.length;Ie<Xe;Ie++){const Oe=n.get(ue[Ie]);Oe.__webglTexture&&(s.deleteTexture(Oe.__webglTexture),l.memory.textures--),n.remove(ue[Ie])}n.remove(j)}let K=0;function ne(){K=0}function ee(){const j=K;return j>=i.maxTextures&&Ot("WebGLTextures: Trying to use "+j+" texture units while this GPU supports only "+i.maxTextures),K+=1,j}function ie(j){const I=[];return I.push(j.wrapS),I.push(j.wrapT),I.push(j.wrapR||0),I.push(j.magFilter),I.push(j.minFilter),I.push(j.anisotropy),I.push(j.internalFormat),I.push(j.format),I.push(j.type),I.push(j.generateMipmaps),I.push(j.premultiplyAlpha),I.push(j.flipY),I.push(j.unpackAlignment),I.push(j.colorSpace),I.join()}function he(j,I){const ue=n.get(j);if(j.isVideoTexture&&_t(j),j.isRenderTargetTexture===!1&&j.isExternalTexture!==!0&&j.version>0&&ue.__version!==j.version){const Ie=j.image;if(Ie===null)Ot("WebGLRenderer: Texture marked for update but no image data found.");else if(Ie.complete===!1)Ot("WebGLRenderer: Texture marked for update but image is incomplete");else{ve(ue,j,I);return}}else j.isExternalTexture&&(ue.__webglTexture=j.sourceTexture?j.sourceTexture:null);t.bindTexture(s.TEXTURE_2D,ue.__webglTexture,s.TEXTURE0+I)}function H(j,I){const ue=n.get(j);if(j.isRenderTargetTexture===!1&&j.version>0&&ue.__version!==j.version){ve(ue,j,I);return}else j.isExternalTexture&&(ue.__webglTexture=j.sourceTexture?j.sourceTexture:null);t.bindTexture(s.TEXTURE_2D_ARRAY,ue.__webglTexture,s.TEXTURE0+I)}function Y(j,I){const ue=n.get(j);if(j.isRenderTargetTexture===!1&&j.version>0&&ue.__version!==j.version){ve(ue,j,I);return}t.bindTexture(s.TEXTURE_3D,ue.__webglTexture,s.TEXTURE0+I)}function $(j,I){const ue=n.get(j);if(j.isCubeDepthTexture!==!0&&j.version>0&&ue.__version!==j.version){Ce(ue,j,I);return}t.bindTexture(s.TEXTURE_CUBE_MAP,ue.__webglTexture,s.TEXTURE0+I)}const ye={[oo]:s.REPEAT,[Gi]:s.CLAMP_TO_EDGE,[Ru]:s.MIRRORED_REPEAT},_e={[zi]:s.NEAREST,[rp]:s.NEAREST_MIPMAP_NEAREST,[_c]:s.NEAREST_MIPMAP_LINEAR,[In]:s.LINEAR,[wu]:s.LINEAR_MIPMAP_NEAREST,[$s]:s.LINEAR_MIPMAP_LINEAR},W={[hb]:s.NEVER,[vb]:s.ALWAYS,[db]:s.LESS,[T0]:s.LEQUAL,[pb]:s.EQUAL,[C0]:s.GEQUAL,[mb]:s.GREATER,[gb]:s.NOTEQUAL};function ae(j,I){if(I.type===Vi&&e.has("OES_texture_float_linear")===!1&&(I.magFilter===In||I.magFilter===wu||I.magFilter===_c||I.magFilter===$s||I.minFilter===In||I.minFilter===wu||I.minFilter===_c||I.minFilter===$s)&&Ot("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),s.texParameteri(j,s.TEXTURE_WRAP_S,ye[I.wrapS]),s.texParameteri(j,s.TEXTURE_WRAP_T,ye[I.wrapT]),(j===s.TEXTURE_3D||j===s.TEXTURE_2D_ARRAY)&&s.texParameteri(j,s.TEXTURE_WRAP_R,ye[I.wrapR]),s.texParameteri(j,s.TEXTURE_MAG_FILTER,_e[I.magFilter]),s.texParameteri(j,s.TEXTURE_MIN_FILTER,_e[I.minFilter]),I.compareFunction&&(s.texParameteri(j,s.TEXTURE_COMPARE_MODE,s.COMPARE_REF_TO_TEXTURE),s.texParameteri(j,s.TEXTURE_COMPARE_FUNC,W[I.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(I.magFilter===zi||I.minFilter!==_c&&I.minFilter!==$s||I.type===Vi&&e.has("OES_texture_float_linear")===!1)return;if(I.anisotropy>1||n.get(I).__currentAnisotropy){const ue=e.get("EXT_texture_filter_anisotropic");s.texParameterf(j,ue.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(I.anisotropy,i.getMaxAnisotropy())),n.get(I).__currentAnisotropy=I.anisotropy}}}function Me(j,I){let ue=!1;j.__webglInit===void 0&&(j.__webglInit=!0,I.addEventListener("dispose",O));const Ie=I.source;let Xe=y.get(Ie);Xe===void 0&&(Xe={},y.set(Ie,Xe));const Oe=ie(I);if(Oe!==j.__cacheKey){Xe[Oe]===void 0&&(Xe[Oe]={texture:s.createTexture(),usedTimes:0},l.memory.textures++,ue=!0),Xe[Oe].usedTimes++;const Bt=Xe[j.__cacheKey];Bt!==void 0&&(Xe[j.__cacheKey].usedTimes--,Bt.usedTimes===0&&N(I)),j.__cacheKey=Oe,j.__webglTexture=Xe[Oe].texture}return ue}function Ne(j,I,ue){return Math.floor(Math.floor(j/ue)/I)}function it(j,I,ue,Ie){const Oe=j.updateRanges;if(Oe.length===0)t.texSubImage2D(s.TEXTURE_2D,0,0,0,I.width,I.height,ue,Ie,I.data);else{Oe.sort((ze,qe)=>ze.start-qe.start);let Bt=0;for(let ze=1;ze<Oe.length;ze++){const qe=Oe[Bt],Tt=Oe[ze],pt=qe.start+qe.count,st=Ne(Tt.start,I.width,4),qt=Ne(qe.start,I.width,4);Tt.start<=pt+1&&st===qt&&Ne(Tt.start+Tt.count-1,I.width,4)===st?qe.count=Math.max(qe.count,Tt.start+Tt.count-qe.start):(++Bt,Oe[Bt]=Tt)}Oe.length=Bt+1;const gt=s.getParameter(s.UNPACK_ROW_LENGTH),Ht=s.getParameter(s.UNPACK_SKIP_PIXELS),Xt=s.getParameter(s.UNPACK_SKIP_ROWS);s.pixelStorei(s.UNPACK_ROW_LENGTH,I.width);for(let ze=0,qe=Oe.length;ze<qe;ze++){const Tt=Oe[ze],pt=Math.floor(Tt.start/4),st=Math.ceil(Tt.count/4),qt=pt%I.width,de=Math.floor(pt/I.width),be=st,We=1;s.pixelStorei(s.UNPACK_SKIP_PIXELS,qt),s.pixelStorei(s.UNPACK_SKIP_ROWS,de),t.texSubImage2D(s.TEXTURE_2D,0,qt,de,be,We,ue,Ie,I.data)}j.clearUpdateRanges(),s.pixelStorei(s.UNPACK_ROW_LENGTH,gt),s.pixelStorei(s.UNPACK_SKIP_PIXELS,Ht),s.pixelStorei(s.UNPACK_SKIP_ROWS,Xt)}}function ve(j,I,ue){let Ie=s.TEXTURE_2D;(I.isDataArrayTexture||I.isCompressedArrayTexture)&&(Ie=s.TEXTURE_2D_ARRAY),I.isData3DTexture&&(Ie=s.TEXTURE_3D);const Xe=Me(j,I),Oe=I.source;t.bindTexture(Ie,j.__webglTexture,s.TEXTURE0+ue);const Bt=n.get(Oe);if(Oe.version!==Bt.__version||Xe===!0){t.activeTexture(s.TEXTURE0+ue);const gt=Hn.getPrimaries(Hn.workingColorSpace),Ht=I.colorSpace===El?null:Hn.getPrimaries(I.colorSpace),Xt=I.colorSpace===El||gt===Ht?s.NONE:s.BROWSER_DEFAULT_WEBGL;s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,I.flipY),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,I.premultiplyAlpha),s.pixelStorei(s.UNPACK_ALIGNMENT,I.unpackAlignment),s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,Xt);let ze=R(I.image,!1,i.maxTextureSize);ze=Ft(I,ze);const qe=o.convert(I.format,I.colorSpace),Tt=o.convert(I.type);let pt=D(I.internalFormat,qe,Tt,I.colorSpace,I.isVideoTexture);ae(Ie,I);let st;const qt=I.mipmaps,de=I.isVideoTexture!==!0,be=Bt.__version===void 0||Xe===!0,We=Oe.dataReady,St=P(I,ze);if(I.isDepthTexture)pt=L(I.format===yc,I.type),be&&(de?t.texStorage2D(s.TEXTURE_2D,1,pt,ze.width,ze.height):t.texImage2D(s.TEXTURE_2D,0,pt,ze.width,ze.height,0,qe,Tt,null));else if(I.isDataTexture)if(qt.length>0){de&&be&&t.texStorage2D(s.TEXTURE_2D,St,pt,qt[0].width,qt[0].height);for(let Ye=0,Ve=qt.length;Ye<Ve;Ye++)st=qt[Ye],de?We&&t.texSubImage2D(s.TEXTURE_2D,Ye,0,0,st.width,st.height,qe,Tt,st.data):t.texImage2D(s.TEXTURE_2D,Ye,pt,st.width,st.height,0,qe,Tt,st.data);I.generateMipmaps=!1}else de?(be&&t.texStorage2D(s.TEXTURE_2D,St,pt,ze.width,ze.height),We&&it(I,ze,qe,Tt)):t.texImage2D(s.TEXTURE_2D,0,pt,ze.width,ze.height,0,qe,Tt,ze.data);else if(I.isCompressedTexture)if(I.isCompressedArrayTexture){de&&be&&t.texStorage3D(s.TEXTURE_2D_ARRAY,St,pt,qt[0].width,qt[0].height,ze.depth);for(let Ye=0,Ve=qt.length;Ye<Ve;Ye++)if(st=qt[Ye],I.format!==ga)if(qe!==null)if(de){if(We)if(I.layerUpdates.size>0){const ft=DA(st.width,st.height,I.format,I.type);for(const jt of I.layerUpdates){const Sn=st.data.subarray(jt*ft/st.data.BYTES_PER_ELEMENT,(jt+1)*ft/st.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(s.TEXTURE_2D_ARRAY,Ye,0,0,jt,st.width,st.height,1,qe,Sn)}I.clearLayerUpdates()}else t.compressedTexSubImage3D(s.TEXTURE_2D_ARRAY,Ye,0,0,0,st.width,st.height,ze.depth,qe,st.data)}else t.compressedTexImage3D(s.TEXTURE_2D_ARRAY,Ye,pt,st.width,st.height,ze.depth,0,st.data,0,0);else Ot("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else de?We&&t.texSubImage3D(s.TEXTURE_2D_ARRAY,Ye,0,0,0,st.width,st.height,ze.depth,qe,Tt,st.data):t.texImage3D(s.TEXTURE_2D_ARRAY,Ye,pt,st.width,st.height,ze.depth,0,qe,Tt,st.data)}else{de&&be&&t.texStorage2D(s.TEXTURE_2D,St,pt,qt[0].width,qt[0].height);for(let Ye=0,Ve=qt.length;Ye<Ve;Ye++)st=qt[Ye],I.format!==ga?qe!==null?de?We&&t.compressedTexSubImage2D(s.TEXTURE_2D,Ye,0,0,st.width,st.height,qe,st.data):t.compressedTexImage2D(s.TEXTURE_2D,Ye,pt,st.width,st.height,0,st.data):Ot("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):de?We&&t.texSubImage2D(s.TEXTURE_2D,Ye,0,0,st.width,st.height,qe,Tt,st.data):t.texImage2D(s.TEXTURE_2D,Ye,pt,st.width,st.height,0,qe,Tt,st.data)}else if(I.isDataArrayTexture)if(de){if(be&&t.texStorage3D(s.TEXTURE_2D_ARRAY,St,pt,ze.width,ze.height,ze.depth),We)if(I.layerUpdates.size>0){const Ye=DA(ze.width,ze.height,I.format,I.type);for(const Ve of I.layerUpdates){const ft=ze.data.subarray(Ve*Ye/ze.data.BYTES_PER_ELEMENT,(Ve+1)*Ye/ze.data.BYTES_PER_ELEMENT);t.texSubImage3D(s.TEXTURE_2D_ARRAY,0,0,0,Ve,ze.width,ze.height,1,qe,Tt,ft)}I.clearLayerUpdates()}else t.texSubImage3D(s.TEXTURE_2D_ARRAY,0,0,0,0,ze.width,ze.height,ze.depth,qe,Tt,ze.data)}else t.texImage3D(s.TEXTURE_2D_ARRAY,0,pt,ze.width,ze.height,ze.depth,0,qe,Tt,ze.data);else if(I.isData3DTexture)de?(be&&t.texStorage3D(s.TEXTURE_3D,St,pt,ze.width,ze.height,ze.depth),We&&t.texSubImage3D(s.TEXTURE_3D,0,0,0,0,ze.width,ze.height,ze.depth,qe,Tt,ze.data)):t.texImage3D(s.TEXTURE_3D,0,pt,ze.width,ze.height,ze.depth,0,qe,Tt,ze.data);else if(I.isFramebufferTexture){if(be)if(de)t.texStorage2D(s.TEXTURE_2D,St,pt,ze.width,ze.height);else{let Ye=ze.width,Ve=ze.height;for(let ft=0;ft<St;ft++)t.texImage2D(s.TEXTURE_2D,ft,pt,Ye,Ve,0,qe,Tt,null),Ye>>=1,Ve>>=1}}else if(qt.length>0){if(de&&be){const Ye=yt(qt[0]);t.texStorage2D(s.TEXTURE_2D,St,pt,Ye.width,Ye.height)}for(let Ye=0,Ve=qt.length;Ye<Ve;Ye++)st=qt[Ye],de?We&&t.texSubImage2D(s.TEXTURE_2D,Ye,0,0,qe,Tt,st):t.texImage2D(s.TEXTURE_2D,Ye,pt,qe,Tt,st);I.generateMipmaps=!1}else if(de){if(be){const Ye=yt(ze);t.texStorage2D(s.TEXTURE_2D,St,pt,Ye.width,Ye.height)}We&&t.texSubImage2D(s.TEXTURE_2D,0,0,0,qe,Tt,ze)}else t.texImage2D(s.TEXTURE_2D,0,pt,qe,Tt,ze);T(I)&&M(Ie),Bt.__version=Oe.version,I.onUpdate&&I.onUpdate(I)}j.__version=I.version}function Ce(j,I,ue){if(I.image.length!==6)return;const Ie=Me(j,I),Xe=I.source;t.bindTexture(s.TEXTURE_CUBE_MAP,j.__webglTexture,s.TEXTURE0+ue);const Oe=n.get(Xe);if(Xe.version!==Oe.__version||Ie===!0){t.activeTexture(s.TEXTURE0+ue);const Bt=Hn.getPrimaries(Hn.workingColorSpace),gt=I.colorSpace===El?null:Hn.getPrimaries(I.colorSpace),Ht=I.colorSpace===El||Bt===gt?s.NONE:s.BROWSER_DEFAULT_WEBGL;s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,I.flipY),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,I.premultiplyAlpha),s.pixelStorei(s.UNPACK_ALIGNMENT,I.unpackAlignment),s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ht);const Xt=I.isCompressedTexture||I.image[0].isCompressedTexture,ze=I.image[0]&&I.image[0].isDataTexture,qe=[];for(let Ve=0;Ve<6;Ve++)!Xt&&!ze?qe[Ve]=R(I.image[Ve],!0,i.maxCubemapSize):qe[Ve]=ze?I.image[Ve].image:I.image[Ve],qe[Ve]=Ft(I,qe[Ve]);const Tt=qe[0],pt=o.convert(I.format,I.colorSpace),st=o.convert(I.type),qt=D(I.internalFormat,pt,st,I.colorSpace),de=I.isVideoTexture!==!0,be=Oe.__version===void 0||Ie===!0,We=Xe.dataReady;let St=P(I,Tt);ae(s.TEXTURE_CUBE_MAP,I);let Ye;if(Xt){de&&be&&t.texStorage2D(s.TEXTURE_CUBE_MAP,St,qt,Tt.width,Tt.height);for(let Ve=0;Ve<6;Ve++){Ye=qe[Ve].mipmaps;for(let ft=0;ft<Ye.length;ft++){const jt=Ye[ft];I.format!==ga?pt!==null?de?We&&t.compressedTexSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+Ve,ft,0,0,jt.width,jt.height,pt,jt.data):t.compressedTexImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+Ve,ft,qt,jt.width,jt.height,0,jt.data):Ot("WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):de?We&&t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+Ve,ft,0,0,jt.width,jt.height,pt,st,jt.data):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+Ve,ft,qt,jt.width,jt.height,0,pt,st,jt.data)}}}else{if(Ye=I.mipmaps,de&&be){Ye.length>0&&St++;const Ve=yt(qe[0]);t.texStorage2D(s.TEXTURE_CUBE_MAP,St,qt,Ve.width,Ve.height)}for(let Ve=0;Ve<6;Ve++)if(ze){de?We&&t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+Ve,0,0,0,qe[Ve].width,qe[Ve].height,pt,st,qe[Ve].data):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+Ve,0,qt,qe[Ve].width,qe[Ve].height,0,pt,st,qe[Ve].data);for(let ft=0;ft<Ye.length;ft++){const Sn=Ye[ft].image[Ve].image;de?We&&t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+Ve,ft+1,0,0,Sn.width,Sn.height,pt,st,Sn.data):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+Ve,ft+1,qt,Sn.width,Sn.height,0,pt,st,Sn.data)}}else{de?We&&t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+Ve,0,0,0,pt,st,qe[Ve]):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+Ve,0,qt,pt,st,qe[Ve]);for(let ft=0;ft<Ye.length;ft++){const jt=Ye[ft];de?We&&t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+Ve,ft+1,0,0,pt,st,jt.image[Ve]):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+Ve,ft+1,qt,pt,st,jt.image[Ve])}}}T(I)&&M(s.TEXTURE_CUBE_MAP),Oe.__version=Xe.version,I.onUpdate&&I.onUpdate(I)}j.__version=I.version}function tt(j,I,ue,Ie,Xe,Oe){const Bt=o.convert(ue.format,ue.colorSpace),gt=o.convert(ue.type),Ht=D(ue.internalFormat,Bt,gt,ue.colorSpace),Xt=n.get(I),ze=n.get(ue);if(ze.__renderTarget=I,!Xt.__hasExternalTextures){const qe=Math.max(1,I.width>>Oe),Tt=Math.max(1,I.height>>Oe);Xe===s.TEXTURE_3D||Xe===s.TEXTURE_2D_ARRAY?t.texImage3D(Xe,Oe,Ht,qe,Tt,I.depth,0,Bt,gt,null):t.texImage2D(Xe,Oe,Ht,qe,Tt,0,Bt,gt,null)}t.bindFramebuffer(s.FRAMEBUFFER,j),Kt(I)?h.framebufferTexture2DMultisampleEXT(s.FRAMEBUFFER,Ie,Xe,ze.__webglTexture,0,Q(I)):(Xe===s.TEXTURE_2D||Xe>=s.TEXTURE_CUBE_MAP_POSITIVE_X&&Xe<=s.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&s.framebufferTexture2D(s.FRAMEBUFFER,Ie,Xe,ze.__webglTexture,Oe),t.bindFramebuffer(s.FRAMEBUFFER,null)}function Et(j,I,ue){if(s.bindRenderbuffer(s.RENDERBUFFER,j),I.depthBuffer){const Ie=I.depthTexture,Xe=Ie&&Ie.isDepthTexture?Ie.type:null,Oe=L(I.stencilBuffer,Xe),Bt=I.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT;Kt(I)?h.renderbufferStorageMultisampleEXT(s.RENDERBUFFER,Q(I),Oe,I.width,I.height):ue?s.renderbufferStorageMultisample(s.RENDERBUFFER,Q(I),Oe,I.width,I.height):s.renderbufferStorage(s.RENDERBUFFER,Oe,I.width,I.height),s.framebufferRenderbuffer(s.FRAMEBUFFER,Bt,s.RENDERBUFFER,j)}else{const Ie=I.textures;for(let Xe=0;Xe<Ie.length;Xe++){const Oe=Ie[Xe],Bt=o.convert(Oe.format,Oe.colorSpace),gt=o.convert(Oe.type),Ht=D(Oe.internalFormat,Bt,gt,Oe.colorSpace);Kt(I)?h.renderbufferStorageMultisampleEXT(s.RENDERBUFFER,Q(I),Ht,I.width,I.height):ue?s.renderbufferStorageMultisample(s.RENDERBUFFER,Q(I),Ht,I.width,I.height):s.renderbufferStorage(s.RENDERBUFFER,Ht,I.width,I.height)}}s.bindRenderbuffer(s.RENDERBUFFER,null)}function wt(j,I,ue){const Ie=I.isWebGLCubeRenderTarget===!0;if(t.bindFramebuffer(s.FRAMEBUFFER,j),!(I.depthTexture&&I.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const Xe=n.get(I.depthTexture);if(Xe.__renderTarget=I,(!Xe.__webglTexture||I.depthTexture.image.width!==I.width||I.depthTexture.image.height!==I.height)&&(I.depthTexture.image.width=I.width,I.depthTexture.image.height=I.height,I.depthTexture.needsUpdate=!0),Ie){if(Xe.__webglInit===void 0&&(Xe.__webglInit=!0,I.depthTexture.addEventListener("dispose",O)),Xe.__webglTexture===void 0){Xe.__webglTexture=s.createTexture(),t.bindTexture(s.TEXTURE_CUBE_MAP,Xe.__webglTexture),ae(s.TEXTURE_CUBE_MAP,I.depthTexture);const Xt=o.convert(I.depthTexture.format),ze=o.convert(I.depthTexture.type);let qe;I.depthTexture.format===Ho?qe=s.DEPTH_COMPONENT24:I.depthTexture.format===yc&&(qe=s.DEPTH24_STENCIL8);for(let Tt=0;Tt<6;Tt++)s.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+Tt,0,qe,I.width,I.height,0,Xt,ze,null)}}else he(I.depthTexture,0);const Oe=Xe.__webglTexture,Bt=Q(I),gt=Ie?s.TEXTURE_CUBE_MAP_POSITIVE_X+ue:s.TEXTURE_2D,Ht=I.depthTexture.format===yc?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT;if(I.depthTexture.format===Ho)Kt(I)?h.framebufferTexture2DMultisampleEXT(s.FRAMEBUFFER,Ht,gt,Oe,0,Bt):s.framebufferTexture2D(s.FRAMEBUFFER,Ht,gt,Oe,0);else if(I.depthTexture.format===yc)Kt(I)?h.framebufferTexture2DMultisampleEXT(s.FRAMEBUFFER,Ht,gt,Oe,0,Bt):s.framebufferTexture2D(s.FRAMEBUFFER,Ht,gt,Oe,0);else throw new Error("Unknown depthTexture format")}function on(j){const I=n.get(j),ue=j.isWebGLCubeRenderTarget===!0;if(I.__boundDepthTexture!==j.depthTexture){const Ie=j.depthTexture;if(I.__depthDisposeCallback&&I.__depthDisposeCallback(),Ie){const Xe=()=>{delete I.__boundDepthTexture,delete I.__depthDisposeCallback,Ie.removeEventListener("dispose",Xe)};Ie.addEventListener("dispose",Xe),I.__depthDisposeCallback=Xe}I.__boundDepthTexture=Ie}if(j.depthTexture&&!I.__autoAllocateDepthBuffer)if(ue)for(let Ie=0;Ie<6;Ie++)wt(I.__webglFramebuffer[Ie],j,Ie);else{const Ie=j.texture.mipmaps;Ie&&Ie.length>0?wt(I.__webglFramebuffer[0],j,0):wt(I.__webglFramebuffer,j,0)}else if(ue){I.__webglDepthbuffer=[];for(let Ie=0;Ie<6;Ie++)if(t.bindFramebuffer(s.FRAMEBUFFER,I.__webglFramebuffer[Ie]),I.__webglDepthbuffer[Ie]===void 0)I.__webglDepthbuffer[Ie]=s.createRenderbuffer(),Et(I.__webglDepthbuffer[Ie],j,!1);else{const Xe=j.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT,Oe=I.__webglDepthbuffer[Ie];s.bindRenderbuffer(s.RENDERBUFFER,Oe),s.framebufferRenderbuffer(s.FRAMEBUFFER,Xe,s.RENDERBUFFER,Oe)}}else{const Ie=j.texture.mipmaps;if(Ie&&Ie.length>0?t.bindFramebuffer(s.FRAMEBUFFER,I.__webglFramebuffer[0]):t.bindFramebuffer(s.FRAMEBUFFER,I.__webglFramebuffer),I.__webglDepthbuffer===void 0)I.__webglDepthbuffer=s.createRenderbuffer(),Et(I.__webglDepthbuffer,j,!1);else{const Xe=j.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT,Oe=I.__webglDepthbuffer;s.bindRenderbuffer(s.RENDERBUFFER,Oe),s.framebufferRenderbuffer(s.FRAMEBUFFER,Xe,s.RENDERBUFFER,Oe)}}t.bindFramebuffer(s.FRAMEBUFFER,null)}function It(j,I,ue){const Ie=n.get(j);I!==void 0&&tt(Ie.__webglFramebuffer,j,j.texture,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,0),ue!==void 0&&on(j)}function mt(j){const I=j.texture,ue=n.get(j),Ie=n.get(I);j.addEventListener("dispose",z);const Xe=j.textures,Oe=j.isWebGLCubeRenderTarget===!0,Bt=Xe.length>1;if(Bt||(Ie.__webglTexture===void 0&&(Ie.__webglTexture=s.createTexture()),Ie.__version=I.version,l.memory.textures++),Oe){ue.__webglFramebuffer=[];for(let gt=0;gt<6;gt++)if(I.mipmaps&&I.mipmaps.length>0){ue.__webglFramebuffer[gt]=[];for(let Ht=0;Ht<I.mipmaps.length;Ht++)ue.__webglFramebuffer[gt][Ht]=s.createFramebuffer()}else ue.__webglFramebuffer[gt]=s.createFramebuffer()}else{if(I.mipmaps&&I.mipmaps.length>0){ue.__webglFramebuffer=[];for(let gt=0;gt<I.mipmaps.length;gt++)ue.__webglFramebuffer[gt]=s.createFramebuffer()}else ue.__webglFramebuffer=s.createFramebuffer();if(Bt)for(let gt=0,Ht=Xe.length;gt<Ht;gt++){const Xt=n.get(Xe[gt]);Xt.__webglTexture===void 0&&(Xt.__webglTexture=s.createTexture(),l.memory.textures++)}if(j.samples>0&&Kt(j)===!1){ue.__webglMultisampledFramebuffer=s.createFramebuffer(),ue.__webglColorRenderbuffer=[],t.bindFramebuffer(s.FRAMEBUFFER,ue.__webglMultisampledFramebuffer);for(let gt=0;gt<Xe.length;gt++){const Ht=Xe[gt];ue.__webglColorRenderbuffer[gt]=s.createRenderbuffer(),s.bindRenderbuffer(s.RENDERBUFFER,ue.__webglColorRenderbuffer[gt]);const Xt=o.convert(Ht.format,Ht.colorSpace),ze=o.convert(Ht.type),qe=D(Ht.internalFormat,Xt,ze,Ht.colorSpace,j.isXRRenderTarget===!0),Tt=Q(j);s.renderbufferStorageMultisample(s.RENDERBUFFER,Tt,qe,j.width,j.height),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0+gt,s.RENDERBUFFER,ue.__webglColorRenderbuffer[gt])}s.bindRenderbuffer(s.RENDERBUFFER,null),j.depthBuffer&&(ue.__webglDepthRenderbuffer=s.createRenderbuffer(),Et(ue.__webglDepthRenderbuffer,j,!0)),t.bindFramebuffer(s.FRAMEBUFFER,null)}}if(Oe){t.bindTexture(s.TEXTURE_CUBE_MAP,Ie.__webglTexture),ae(s.TEXTURE_CUBE_MAP,I);for(let gt=0;gt<6;gt++)if(I.mipmaps&&I.mipmaps.length>0)for(let Ht=0;Ht<I.mipmaps.length;Ht++)tt(ue.__webglFramebuffer[gt][Ht],j,I,s.COLOR_ATTACHMENT0,s.TEXTURE_CUBE_MAP_POSITIVE_X+gt,Ht);else tt(ue.__webglFramebuffer[gt],j,I,s.COLOR_ATTACHMENT0,s.TEXTURE_CUBE_MAP_POSITIVE_X+gt,0);T(I)&&M(s.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(Bt){for(let gt=0,Ht=Xe.length;gt<Ht;gt++){const Xt=Xe[gt],ze=n.get(Xt);let qe=s.TEXTURE_2D;(j.isWebGL3DRenderTarget||j.isWebGLArrayRenderTarget)&&(qe=j.isWebGL3DRenderTarget?s.TEXTURE_3D:s.TEXTURE_2D_ARRAY),t.bindTexture(qe,ze.__webglTexture),ae(qe,Xt),tt(ue.__webglFramebuffer,j,Xt,s.COLOR_ATTACHMENT0+gt,qe,0),T(Xt)&&M(qe)}t.unbindTexture()}else{let gt=s.TEXTURE_2D;if((j.isWebGL3DRenderTarget||j.isWebGLArrayRenderTarget)&&(gt=j.isWebGL3DRenderTarget?s.TEXTURE_3D:s.TEXTURE_2D_ARRAY),t.bindTexture(gt,Ie.__webglTexture),ae(gt,I),I.mipmaps&&I.mipmaps.length>0)for(let Ht=0;Ht<I.mipmaps.length;Ht++)tt(ue.__webglFramebuffer[Ht],j,I,s.COLOR_ATTACHMENT0,gt,Ht);else tt(ue.__webglFramebuffer,j,I,s.COLOR_ATTACHMENT0,gt,0);T(I)&&M(gt),t.unbindTexture()}j.depthBuffer&&on(j)}function me(j){const I=j.textures;for(let ue=0,Ie=I.length;ue<Ie;ue++){const Xe=I[ue];if(T(Xe)){const Oe=w(j),Bt=n.get(Xe).__webglTexture;t.bindTexture(Oe,Bt),M(Oe),t.unbindTexture()}}}const Le=[],Ue=[];function rt(j){if(j.samples>0){if(Kt(j)===!1){const I=j.textures,ue=j.width,Ie=j.height;let Xe=s.COLOR_BUFFER_BIT;const Oe=j.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT,Bt=n.get(j),gt=I.length>1;if(gt)for(let Xt=0;Xt<I.length;Xt++)t.bindFramebuffer(s.FRAMEBUFFER,Bt.__webglMultisampledFramebuffer),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0+Xt,s.RENDERBUFFER,null),t.bindFramebuffer(s.FRAMEBUFFER,Bt.__webglFramebuffer),s.framebufferTexture2D(s.DRAW_FRAMEBUFFER,s.COLOR_ATTACHMENT0+Xt,s.TEXTURE_2D,null,0);t.bindFramebuffer(s.READ_FRAMEBUFFER,Bt.__webglMultisampledFramebuffer);const Ht=j.texture.mipmaps;Ht&&Ht.length>0?t.bindFramebuffer(s.DRAW_FRAMEBUFFER,Bt.__webglFramebuffer[0]):t.bindFramebuffer(s.DRAW_FRAMEBUFFER,Bt.__webglFramebuffer);for(let Xt=0;Xt<I.length;Xt++){if(j.resolveDepthBuffer&&(j.depthBuffer&&(Xe|=s.DEPTH_BUFFER_BIT),j.stencilBuffer&&j.resolveStencilBuffer&&(Xe|=s.STENCIL_BUFFER_BIT)),gt){s.framebufferRenderbuffer(s.READ_FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.RENDERBUFFER,Bt.__webglColorRenderbuffer[Xt]);const ze=n.get(I[Xt]).__webglTexture;s.framebufferTexture2D(s.DRAW_FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,ze,0)}s.blitFramebuffer(0,0,ue,Ie,0,0,ue,Ie,Xe,s.NEAREST),d===!0&&(Le.length=0,Ue.length=0,Le.push(s.COLOR_ATTACHMENT0+Xt),j.depthBuffer&&j.resolveDepthBuffer===!1&&(Le.push(Oe),Ue.push(Oe),s.invalidateFramebuffer(s.DRAW_FRAMEBUFFER,Ue)),s.invalidateFramebuffer(s.READ_FRAMEBUFFER,Le))}if(t.bindFramebuffer(s.READ_FRAMEBUFFER,null),t.bindFramebuffer(s.DRAW_FRAMEBUFFER,null),gt)for(let Xt=0;Xt<I.length;Xt++){t.bindFramebuffer(s.FRAMEBUFFER,Bt.__webglMultisampledFramebuffer),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0+Xt,s.RENDERBUFFER,Bt.__webglColorRenderbuffer[Xt]);const ze=n.get(I[Xt]).__webglTexture;t.bindFramebuffer(s.FRAMEBUFFER,Bt.__webglFramebuffer),s.framebufferTexture2D(s.DRAW_FRAMEBUFFER,s.COLOR_ATTACHMENT0+Xt,s.TEXTURE_2D,ze,0)}t.bindFramebuffer(s.DRAW_FRAMEBUFFER,Bt.__webglMultisampledFramebuffer)}else if(j.depthBuffer&&j.resolveDepthBuffer===!1&&d){const I=j.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT;s.invalidateFramebuffer(s.DRAW_FRAMEBUFFER,[I])}}}function Q(j){return Math.min(i.maxSamples,j.samples)}function Kt(j){const I=n.get(j);return j.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&I.__useRenderToTexture!==!1}function _t(j){const I=l.render.frame;_.get(j)!==I&&(_.set(j,I),j.update())}function Ft(j,I){const ue=j.colorSpace,Ie=j.format,Xe=j.type;return j.isCompressedTexture===!0||j.isVideoTexture===!0||ue!==Ma&&ue!==El&&(Hn.getTransfer(ue)===gi?(Ie!==ga||Xe!==Xa)&&Ot("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):an("WebGLTextures: Unsupported texture color space:",ue)),I}function yt(j){return typeof HTMLImageElement<"u"&&j instanceof HTMLImageElement?(p.width=j.naturalWidth||j.width,p.height=j.naturalHeight||j.height):typeof VideoFrame<"u"&&j instanceof VideoFrame?(p.width=j.displayWidth,p.height=j.displayHeight):(p.width=j.width,p.height=j.height),p}this.allocateTextureUnit=ee,this.resetTextureUnits=ne,this.setTexture2D=he,this.setTexture2DArray=H,this.setTexture3D=Y,this.setTextureCube=$,this.rebindTextures=It,this.setupRenderTarget=mt,this.updateRenderTargetMipmap=me,this.updateMultisampleRenderTarget=rt,this.setupDepthRenderbuffer=on,this.setupFrameBufferTexture=tt,this.useMultisampledRTT=Kt,this.isReversedDepthBuffer=function(){return t.buffers.depth.getReversed()}}function qE(s,e){function t(n,i=El){let o;const l=Hn.getTransfer(i);if(n===Xa)return s.UNSIGNED_BYTE;if(n===Vg)return s.UNSIGNED_SHORT_4_4_4_4;if(n===kg)return s.UNSIGNED_SHORT_5_5_5_1;if(n===sx)return s.UNSIGNED_INT_5_9_9_9_REV;if(n===rx)return s.UNSIGNED_INT_10F_11F_11F_REV;if(n===Gg)return s.BYTE;if(n===zg)return s.SHORT;if(n===ah)return s.UNSIGNED_SHORT;if(n===op)return s.INT;if(n===dr)return s.UNSIGNED_INT;if(n===Vi)return s.FLOAT;if(n===sa)return s.HALF_FLOAT;if(n===ox)return s.ALPHA;if(n===lx)return s.RGB;if(n===ga)return s.RGBA;if(n===Ho)return s.DEPTH_COMPONENT;if(n===yc)return s.DEPTH_STENCIL;if(n===lp)return s.RED;if(n===cp)return s.RED_INTEGER;if(n===Bu)return s.RG;if(n===Xg)return s.RG_INTEGER;if(n===Yg)return s.RGBA_INTEGER;if(n===up||n===fp||n===hp||n===dp)if(l===gi)if(o=e.get("WEBGL_compressed_texture_s3tc_srgb"),o!==null){if(n===up)return o.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===fp)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===hp)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===dp)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(o=e.get("WEBGL_compressed_texture_s3tc"),o!==null){if(n===up)return o.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===fp)return o.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===hp)return o.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===dp)return o.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===Jg||n===qg||n===Kg||n===Wg)if(o=e.get("WEBGL_compressed_texture_pvrtc"),o!==null){if(n===Jg)return o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===qg)return o.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===Kg)return o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===Wg)return o.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===jg||n===Zg||n===Qg||n===$g||n===e0||n===t0||n===n0)if(o=e.get("WEBGL_compressed_texture_etc"),o!==null){if(n===jg||n===Zg)return l===gi?o.COMPRESSED_SRGB8_ETC2:o.COMPRESSED_RGB8_ETC2;if(n===Qg)return l===gi?o.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:o.COMPRESSED_RGBA8_ETC2_EAC;if(n===$g)return o.COMPRESSED_R11_EAC;if(n===e0)return o.COMPRESSED_SIGNED_R11_EAC;if(n===t0)return o.COMPRESSED_RG11_EAC;if(n===n0)return o.COMPRESSED_SIGNED_RG11_EAC}else return null;if(n===i0||n===a0||n===s0||n===r0||n===o0||n===l0||n===c0||n===u0||n===f0||n===h0||n===d0||n===p0||n===m0||n===g0)if(o=e.get("WEBGL_compressed_texture_astc"),o!==null){if(n===i0)return l===gi?o.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:o.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===a0)return l===gi?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:o.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===s0)return l===gi?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:o.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===r0)return l===gi?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:o.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===o0)return l===gi?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:o.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===l0)return l===gi?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:o.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===c0)return l===gi?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:o.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===u0)return l===gi?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:o.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===f0)return l===gi?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:o.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===h0)return l===gi?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:o.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===d0)return l===gi?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:o.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===p0)return l===gi?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:o.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===m0)return l===gi?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:o.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===g0)return l===gi?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:o.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===v0||n===_0||n===y0)if(o=e.get("EXT_texture_compression_bptc"),o!==null){if(n===v0)return l===gi?o.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:o.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===_0)return o.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===y0)return o.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===x0||n===A0||n===S0||n===M0)if(o=e.get("EXT_texture_compression_rgtc"),o!==null){if(n===x0)return o.COMPRESSED_RED_RGTC1_EXT;if(n===A0)return o.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===S0)return o.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===M0)return o.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===sh?s.UNSIGNED_INT_24_8:s[n]!==void 0?s[n]:null}return{convert:t}}const vU=`
3995
+ }`,fU=[new Z(1,0,0),new Z(-1,0,0),new Z(0,1,0),new Z(0,-1,0),new Z(0,0,1),new Z(0,0,-1)],hU=[new Z(0,-1,0),new Z(0,-1,0),new Z(0,0,1),new Z(0,0,-1),new Z(0,-1,0),new Z(0,-1,0)],JE=new cn,Qp=new Z,GA=new Z;function dU(s,e,t){let n=new Nh;const i=new et,o=new et,l=new Ti,h=new rA,d=new oA,p={},_=t.maxTextureSize,v={[ao]:ws,[ws]:ao,[hr]:hr},y=new Ns({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new et},radius:{value:4}},vertexShader:cU,fragmentShader:uU}),x=y.clone();x.defines.HORIZONTAL_PASS=1;const b=new yn;b.setAttribute("position",new Kn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const R=new Oi(b,y),T=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=th;let M=this.type;this.render=function(O,z,V){if(T.enabled===!1||T.autoUpdate===!1&&T.needsUpdate===!1||O.length===0)return;O.type===ip&&(Ot("WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead."),O.type=th);const N=s.getRenderTarget(),F=s.getActiveCubeFace(),K=s.getActiveMipmapLevel(),ne=s.state;ne.setBlending(so),ne.buffers.depth.getReversed()===!0?ne.buffers.color.setClear(0,0,0,0):ne.buffers.color.setClear(1,1,1,1),ne.buffers.depth.setTest(!0),ne.setScissorTest(!1);const ee=M!==this.type;ee&&z.traverse(function(ie){ie.material&&(Array.isArray(ie.material)?ie.material.forEach(he=>he.needsUpdate=!0):ie.material.needsUpdate=!0)});for(let ie=0,he=O.length;ie<he;ie++){const H=O[ie],Y=H.shadow;if(Y===void 0){Ot("WebGLShadowMap:",H,"has no shadow.");continue}if(Y.autoUpdate===!1&&Y.needsUpdate===!1)continue;i.copy(Y.mapSize);const $=Y.getFrameExtents();if(i.multiply($),o.copy(Y.mapSize),(i.x>_||i.y>_)&&(i.x>_&&(o.x=Math.floor(_/$.x),i.x=o.x*$.x,Y.mapSize.x=o.x),i.y>_&&(o.y=Math.floor(_/$.y),i.y=o.y*$.y,Y.mapSize.y=o.y)),Y.map===null||ee===!0){if(Y.map!==null&&(Y.map.depthTexture!==null&&(Y.map.depthTexture.dispose(),Y.map.depthTexture=null),Y.map.dispose()),this.type===Eu){if(H.isPointLight){Ot("WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.");continue}Y.map=new Ds(i.x,i.y,{format:Bu,type:sa,minFilter:In,magFilter:In,generateMipmaps:!1}),Y.map.texture.name=H.name+".shadowMap",Y.map.depthTexture=new Uh(i.x,i.y,Vi),Y.map.depthTexture.name=H.name+".shadowMapDepth",Y.map.depthTexture.format=Ho,Y.map.depthTexture.compareFunction=null,Y.map.depthTexture.minFilter=zi,Y.map.depthTexture.magFilter=zi}else{H.isPointLight?(Y.map=new K0(i.x),Y.map.depthTexture=new p1(i.x,dr)):(Y.map=new Ds(i.x,i.y),Y.map.depthTexture=new Uh(i.x,i.y,dr)),Y.map.depthTexture.name=H.name+".shadowMap",Y.map.depthTexture.format=Ho;const _e=s.state.buffers.depth.getReversed();this.type===th?(Y.map.depthTexture.compareFunction=_e?C0:T0,Y.map.depthTexture.minFilter=In,Y.map.depthTexture.magFilter=In):(Y.map.depthTexture.compareFunction=null,Y.map.depthTexture.minFilter=zi,Y.map.depthTexture.magFilter=zi)}Y.camera.updateProjectionMatrix()}const ye=Y.map.isWebGLCubeRenderTarget?6:1;for(let _e=0;_e<ye;_e++){if(Y.map.isWebGLCubeRenderTarget)s.setRenderTarget(Y.map,_e),s.clear();else{_e===0&&(s.setRenderTarget(Y.map),s.clear());const W=Y.getViewport(_e);l.set(o.x*W.x,o.y*W.y,o.x*W.z,o.y*W.w),ne.viewport(l)}if(H.isPointLight){const W=Y.camera,ae=Y.matrix,Me=H.distance||W.far;Me!==W.far&&(W.far=Me,W.updateProjectionMatrix()),Qp.setFromMatrixPosition(H.matrixWorld),W.position.copy(Qp),GA.copy(W.position),GA.add(fU[_e]),W.up.copy(hU[_e]),W.lookAt(GA),W.updateMatrixWorld(),ae.makeTranslation(-Qp.x,-Qp.y,-Qp.z),JE.multiplyMatrices(W.projectionMatrix,W.matrixWorldInverse),Y._frustum.setFromProjectionMatrix(JE,W.coordinateSystem,W.reversedDepth)}else Y.updateMatrices(H);n=Y.getFrustum(),L(z,V,Y.camera,H,this.type)}Y.isPointLightShadow!==!0&&this.type===Eu&&w(Y,V),Y.needsUpdate=!1}M=this.type,T.needsUpdate=!1,s.setRenderTarget(N,F,K)};function w(O,z){const V=e.update(R);y.defines.VSM_SAMPLES!==O.blurSamples&&(y.defines.VSM_SAMPLES=O.blurSamples,x.defines.VSM_SAMPLES=O.blurSamples,y.needsUpdate=!0,x.needsUpdate=!0),O.mapPass===null&&(O.mapPass=new Ds(i.x,i.y,{format:Bu,type:sa})),y.uniforms.shadow_pass.value=O.map.depthTexture,y.uniforms.resolution.value=O.mapSize,y.uniforms.radius.value=O.radius,s.setRenderTarget(O.mapPass),s.clear(),s.renderBufferDirect(z,null,V,y,R,null),x.uniforms.shadow_pass.value=O.mapPass.texture,x.uniforms.resolution.value=O.mapSize,x.uniforms.radius.value=O.radius,s.setRenderTarget(O.map),s.clear(),s.renderBufferDirect(z,null,V,x,R,null)}function D(O,z,V,N){let F=null;const K=V.isPointLight===!0?O.customDistanceMaterial:O.customDepthMaterial;if(K!==void 0)F=K;else if(F=V.isPointLight===!0?d:h,s.localClippingEnabled&&z.clipShadows===!0&&Array.isArray(z.clippingPlanes)&&z.clippingPlanes.length!==0||z.displacementMap&&z.displacementScale!==0||z.alphaMap&&z.alphaTest>0||z.map&&z.alphaTest>0||z.alphaToCoverage===!0){const ne=F.uuid,ee=z.uuid;let ie=p[ne];ie===void 0&&(ie={},p[ne]=ie);let he=ie[ee];he===void 0&&(he=F.clone(),ie[ee]=he,z.addEventListener("dispose",P)),F=he}if(F.visible=z.visible,F.wireframe=z.wireframe,N===Eu?F.side=z.shadowSide!==null?z.shadowSide:z.side:F.side=z.shadowSide!==null?z.shadowSide:v[z.side],F.alphaMap=z.alphaMap,F.alphaTest=z.alphaToCoverage===!0?.5:z.alphaTest,F.map=z.map,F.clipShadows=z.clipShadows,F.clippingPlanes=z.clippingPlanes,F.clipIntersection=z.clipIntersection,F.displacementMap=z.displacementMap,F.displacementScale=z.displacementScale,F.displacementBias=z.displacementBias,F.wireframeLinewidth=z.wireframeLinewidth,F.linewidth=z.linewidth,V.isPointLight===!0&&F.isMeshDistanceMaterial===!0){const ne=s.properties.get(F);ne.light=V}return F}function L(O,z,V,N,F){if(O.visible===!1)return;if(O.layers.test(z.layers)&&(O.isMesh||O.isLine||O.isPoints)&&(O.castShadow||O.receiveShadow&&F===Eu)&&(!O.frustumCulled||n.intersectsObject(O))){O.modelViewMatrix.multiplyMatrices(V.matrixWorldInverse,O.matrixWorld);const ee=e.update(O),ie=O.material;if(Array.isArray(ie)){const he=ee.groups;for(let H=0,Y=he.length;H<Y;H++){const $=he[H],ye=ie[$.materialIndex];if(ye&&ye.visible){const _e=D(O,ye,N,F);O.onBeforeShadow(s,O,z,V,ee,_e,$),s.renderBufferDirect(V,null,ee,_e,O,$),O.onAfterShadow(s,O,z,V,ee,_e,$)}}}else if(ie.visible){const he=D(O,ie,N,F);O.onBeforeShadow(s,O,z,V,ee,he,null),s.renderBufferDirect(V,null,ee,he,O,null),O.onAfterShadow(s,O,z,V,ee,he,null)}}const ne=O.children;for(let ee=0,ie=ne.length;ee<ie;ee++)L(ne[ee],z,V,N,F)}function P(O){O.target.removeEventListener("dispose",P);for(const V in p){const N=p[V],F=O.target.uuid;F in N&&(N[F].dispose(),delete N[F])}}}const pU={[Lg]:Ng,[Ug]:Fg,[Og]:Hg,[Cu]:Ig,[Ng]:Lg,[Fg]:Ug,[Hg]:Og,[Ig]:Cu};function mU(s,e){function t(){let de=!1;const be=new Ti;let We=null;const St=new Ti(0,0,0,0);return{setMask:function(Ye){We!==Ye&&!de&&(s.colorMask(Ye,Ye,Ye,Ye),We=Ye)},setLocked:function(Ye){de=Ye},setClear:function(Ye,Ve,ft,jt,Mn){Mn===!0&&(Ye*=jt,Ve*=jt,ft*=jt),be.set(Ye,Ve,ft,jt),St.equals(be)===!1&&(s.clearColor(Ye,Ve,ft,jt),St.copy(be))},reset:function(){de=!1,We=null,St.set(-1,0,0,0)}}}function n(){let de=!1,be=!1,We=null,St=null,Ye=null;return{setReversed:function(Ve){if(be!==Ve){const ft=e.get("EXT_clip_control");Ve?ft.clipControlEXT(ft.LOWER_LEFT_EXT,ft.ZERO_TO_ONE_EXT):ft.clipControlEXT(ft.LOWER_LEFT_EXT,ft.NEGATIVE_ONE_TO_ONE_EXT),be=Ve;const jt=Ye;Ye=null,this.setClear(jt)}},getReversed:function(){return be},setTest:function(Ve){Ve?Ce(s.DEPTH_TEST):tt(s.DEPTH_TEST)},setMask:function(Ve){We!==Ve&&!de&&(s.depthMask(Ve),We=Ve)},setFunc:function(Ve){if(be&&(Ve=pU[Ve]),St!==Ve){switch(Ve){case Lg:s.depthFunc(s.NEVER);break;case Ng:s.depthFunc(s.ALWAYS);break;case Ug:s.depthFunc(s.LESS);break;case Cu:s.depthFunc(s.LEQUAL);break;case Og:s.depthFunc(s.EQUAL);break;case Ig:s.depthFunc(s.GEQUAL);break;case Fg:s.depthFunc(s.GREATER);break;case Hg:s.depthFunc(s.NOTEQUAL);break;default:s.depthFunc(s.LEQUAL)}St=Ve}},setLocked:function(Ve){de=Ve},setClear:function(Ve){Ye!==Ve&&(be&&(Ve=1-Ve),s.clearDepth(Ve),Ye=Ve)},reset:function(){de=!1,We=null,St=null,Ye=null,be=!1}}}function i(){let de=!1,be=null,We=null,St=null,Ye=null,Ve=null,ft=null,jt=null,Mn=null;return{setTest:function(bt){de||(bt?Ce(s.STENCIL_TEST):tt(s.STENCIL_TEST))},setMask:function(bt){be!==bt&&!de&&(s.stencilMask(bt),be=bt)},setFunc:function(bt,Dn,Nn){(We!==bt||St!==Dn||Ye!==Nn)&&(s.stencilFunc(bt,Dn,Nn),We=bt,St=Dn,Ye=Nn)},setOp:function(bt,Dn,Nn){(Ve!==bt||ft!==Dn||jt!==Nn)&&(s.stencilOp(bt,Dn,Nn),Ve=bt,ft=Dn,jt=Nn)},setLocked:function(bt){de=bt},setClear:function(bt){Mn!==bt&&(s.clearStencil(bt),Mn=bt)},reset:function(){de=!1,be=null,We=null,St=null,Ye=null,Ve=null,ft=null,jt=null,Mn=null}}}const o=new t,l=new n,h=new i,d=new WeakMap,p=new WeakMap;let _={},v={},y=new WeakMap,x=[],b=null,R=!1,T=null,M=null,w=null,D=null,L=null,P=null,O=null,z=new Rt(0,0,0),V=0,N=!1,F=null,K=null,ne=null,ee=null,ie=null;const he=s.getParameter(s.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let H=!1,Y=0;const $=s.getParameter(s.VERSION);$.indexOf("WebGL")!==-1?(Y=parseFloat(/^WebGL (\d)/.exec($)[1]),H=Y>=1):$.indexOf("OpenGL ES")!==-1&&(Y=parseFloat(/^OpenGL ES (\d)/.exec($)[1]),H=Y>=2);let ye=null,_e={};const W=s.getParameter(s.SCISSOR_BOX),ae=s.getParameter(s.VIEWPORT),Me=new Ti().fromArray(W),Ne=new Ti().fromArray(ae);function it(de,be,We,St){const Ye=new Uint8Array(4),Ve=s.createTexture();s.bindTexture(de,Ve),s.texParameteri(de,s.TEXTURE_MIN_FILTER,s.NEAREST),s.texParameteri(de,s.TEXTURE_MAG_FILTER,s.NEAREST);for(let ft=0;ft<We;ft++)de===s.TEXTURE_3D||de===s.TEXTURE_2D_ARRAY?s.texImage3D(be,0,s.RGBA,1,1,St,0,s.RGBA,s.UNSIGNED_BYTE,Ye):s.texImage2D(be+ft,0,s.RGBA,1,1,0,s.RGBA,s.UNSIGNED_BYTE,Ye);return Ve}const ve={};ve[s.TEXTURE_2D]=it(s.TEXTURE_2D,s.TEXTURE_2D,1),ve[s.TEXTURE_CUBE_MAP]=it(s.TEXTURE_CUBE_MAP,s.TEXTURE_CUBE_MAP_POSITIVE_X,6),ve[s.TEXTURE_2D_ARRAY]=it(s.TEXTURE_2D_ARRAY,s.TEXTURE_2D_ARRAY,1,1),ve[s.TEXTURE_3D]=it(s.TEXTURE_3D,s.TEXTURE_3D,1,1),o.setClear(0,0,0,1),l.setClear(1),h.setClear(0),Ce(s.DEPTH_TEST),l.setFunc(Cu),Ue(!1),rt(qy),Ce(s.CULL_FACE),me(so);function Ce(de){_[de]!==!0&&(s.enable(de),_[de]=!0)}function tt(de){_[de]!==!1&&(s.disable(de),_[de]=!1)}function Et(de,be){return v[de]!==be?(s.bindFramebuffer(de,be),v[de]=be,de===s.DRAW_FRAMEBUFFER&&(v[s.FRAMEBUFFER]=be),de===s.FRAMEBUFFER&&(v[s.DRAW_FRAMEBUFFER]=be),!0):!1}function wt(de,be){let We=x,St=!1;if(de){We=y.get(be),We===void 0&&(We=[],y.set(be,We));const Ye=de.textures;if(We.length!==Ye.length||We[0]!==s.COLOR_ATTACHMENT0){for(let Ve=0,ft=Ye.length;Ve<ft;Ve++)We[Ve]=s.COLOR_ATTACHMENT0+Ve;We.length=Ye.length,St=!0}}else We[0]!==s.BACK&&(We[0]=s.BACK,St=!0);St&&s.drawBuffers(We)}function on(de){return b!==de?(s.useProgram(de),b=de,!0):!1}const It={[mc]:s.FUNC_ADD,[VM]:s.FUNC_SUBTRACT,[kM]:s.FUNC_REVERSE_SUBTRACT};It[XM]=s.MIN,It[YM]=s.MAX;const mt={[JM]:s.ZERO,[qM]:s.ONE,[KM]:s.SRC_COLOR,[Bg]:s.SRC_ALPHA,[eb]:s.SRC_ALPHA_SATURATE,[QM]:s.DST_COLOR,[jM]:s.DST_ALPHA,[WM]:s.ONE_MINUS_SRC_COLOR,[Dg]:s.ONE_MINUS_SRC_ALPHA,[$M]:s.ONE_MINUS_DST_COLOR,[ZM]:s.ONE_MINUS_DST_ALPHA,[tb]:s.CONSTANT_COLOR,[nb]:s.ONE_MINUS_CONSTANT_COLOR,[ib]:s.CONSTANT_ALPHA,[ab]:s.ONE_MINUS_CONSTANT_ALPHA};function me(de,be,We,St,Ye,Ve,ft,jt,Mn,bt){if(de===so){R===!0&&(tt(s.BLEND),R=!1);return}if(R===!1&&(Ce(s.BLEND),R=!0),de!==zM){if(de!==T||bt!==N){if((M!==mc||L!==mc)&&(s.blendEquation(s.FUNC_ADD),M=mc,L=mc),bt)switch(de){case Tu:s.blendFuncSeparate(s.ONE,s.ONE_MINUS_SRC_ALPHA,s.ONE,s.ONE_MINUS_SRC_ALPHA);break;case Ky:s.blendFunc(s.ONE,s.ONE);break;case Wy:s.blendFuncSeparate(s.ZERO,s.ONE_MINUS_SRC_COLOR,s.ZERO,s.ONE);break;case jy:s.blendFuncSeparate(s.DST_COLOR,s.ONE_MINUS_SRC_ALPHA,s.ZERO,s.ONE);break;default:an("WebGLState: Invalid blending: ",de);break}else switch(de){case Tu:s.blendFuncSeparate(s.SRC_ALPHA,s.ONE_MINUS_SRC_ALPHA,s.ONE,s.ONE_MINUS_SRC_ALPHA);break;case Ky:s.blendFuncSeparate(s.SRC_ALPHA,s.ONE,s.ONE,s.ONE);break;case Wy:an("WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true");break;case jy:an("WebGLState: MultiplyBlending requires material.premultipliedAlpha = true");break;default:an("WebGLState: Invalid blending: ",de);break}w=null,D=null,P=null,O=null,z.set(0,0,0),V=0,T=de,N=bt}return}Ye=Ye||be,Ve=Ve||We,ft=ft||St,(be!==M||Ye!==L)&&(s.blendEquationSeparate(It[be],It[Ye]),M=be,L=Ye),(We!==w||St!==D||Ve!==P||ft!==O)&&(s.blendFuncSeparate(mt[We],mt[St],mt[Ve],mt[ft]),w=We,D=St,P=Ve,O=ft),(jt.equals(z)===!1||Mn!==V)&&(s.blendColor(jt.r,jt.g,jt.b,Mn),z.copy(jt),V=Mn),T=de,N=!1}function Le(de,be){de.side===hr?tt(s.CULL_FACE):Ce(s.CULL_FACE);let We=de.side===ws;be&&(We=!We),Ue(We),de.blending===Tu&&de.transparent===!1?me(so):me(de.blending,de.blendEquation,de.blendSrc,de.blendDst,de.blendEquationAlpha,de.blendSrcAlpha,de.blendDstAlpha,de.blendColor,de.blendAlpha,de.premultipliedAlpha),l.setFunc(de.depthFunc),l.setTest(de.depthTest),l.setMask(de.depthWrite),o.setMask(de.colorWrite);const St=de.stencilWrite;h.setTest(St),St&&(h.setMask(de.stencilWriteMask),h.setFunc(de.stencilFunc,de.stencilRef,de.stencilFuncMask),h.setOp(de.stencilFail,de.stencilZFail,de.stencilZPass)),Kt(de.polygonOffset,de.polygonOffsetFactor,de.polygonOffsetUnits),de.alphaToCoverage===!0?Ce(s.SAMPLE_ALPHA_TO_COVERAGE):tt(s.SAMPLE_ALPHA_TO_COVERAGE)}function Ue(de){F!==de&&(de?s.frontFace(s.CW):s.frontFace(s.CCW),F=de)}function rt(de){de!==HM?(Ce(s.CULL_FACE),de!==K&&(de===qy?s.cullFace(s.BACK):de===PM?s.cullFace(s.FRONT):s.cullFace(s.FRONT_AND_BACK))):tt(s.CULL_FACE),K=de}function Q(de){de!==ne&&(H&&s.lineWidth(de),ne=de)}function Kt(de,be,We){de?(Ce(s.POLYGON_OFFSET_FILL),(ee!==be||ie!==We)&&(s.polygonOffset(be,We),ee=be,ie=We)):tt(s.POLYGON_OFFSET_FILL)}function _t(de){de?Ce(s.SCISSOR_TEST):tt(s.SCISSOR_TEST)}function Ft(de){de===void 0&&(de=s.TEXTURE0+he-1),ye!==de&&(s.activeTexture(de),ye=de)}function yt(de,be,We){We===void 0&&(ye===null?We=s.TEXTURE0+he-1:We=ye);let St=_e[We];St===void 0&&(St={type:void 0,texture:void 0},_e[We]=St),(St.type!==de||St.texture!==be)&&(ye!==We&&(s.activeTexture(We),ye=We),s.bindTexture(de,be||ve[de]),St.type=de,St.texture=be)}function j(){const de=_e[ye];de!==void 0&&de.type!==void 0&&(s.bindTexture(de.type,null),de.type=void 0,de.texture=void 0)}function I(){try{s.compressedTexImage2D(...arguments)}catch(de){an("WebGLState:",de)}}function ue(){try{s.compressedTexImage3D(...arguments)}catch(de){an("WebGLState:",de)}}function Ie(){try{s.texSubImage2D(...arguments)}catch(de){an("WebGLState:",de)}}function Xe(){try{s.texSubImage3D(...arguments)}catch(de){an("WebGLState:",de)}}function Oe(){try{s.compressedTexSubImage2D(...arguments)}catch(de){an("WebGLState:",de)}}function Bt(){try{s.compressedTexSubImage3D(...arguments)}catch(de){an("WebGLState:",de)}}function gt(){try{s.texStorage2D(...arguments)}catch(de){an("WebGLState:",de)}}function Ht(){try{s.texStorage3D(...arguments)}catch(de){an("WebGLState:",de)}}function Xt(){try{s.texImage2D(...arguments)}catch(de){an("WebGLState:",de)}}function ze(){try{s.texImage3D(...arguments)}catch(de){an("WebGLState:",de)}}function qe(de){Me.equals(de)===!1&&(s.scissor(de.x,de.y,de.z,de.w),Me.copy(de))}function Tt(de){Ne.equals(de)===!1&&(s.viewport(de.x,de.y,de.z,de.w),Ne.copy(de))}function pt(de,be){let We=p.get(be);We===void 0&&(We=new WeakMap,p.set(be,We));let St=We.get(de);St===void 0&&(St=s.getUniformBlockIndex(be,de.name),We.set(de,St))}function st(de,be){const St=p.get(be).get(de);d.get(be)!==St&&(s.uniformBlockBinding(be,St,de.__bindingPointIndex),d.set(be,St))}function qt(){s.disable(s.BLEND),s.disable(s.CULL_FACE),s.disable(s.DEPTH_TEST),s.disable(s.POLYGON_OFFSET_FILL),s.disable(s.SCISSOR_TEST),s.disable(s.STENCIL_TEST),s.disable(s.SAMPLE_ALPHA_TO_COVERAGE),s.blendEquation(s.FUNC_ADD),s.blendFunc(s.ONE,s.ZERO),s.blendFuncSeparate(s.ONE,s.ZERO,s.ONE,s.ZERO),s.blendColor(0,0,0,0),s.colorMask(!0,!0,!0,!0),s.clearColor(0,0,0,0),s.depthMask(!0),s.depthFunc(s.LESS),l.setReversed(!1),s.clearDepth(1),s.stencilMask(4294967295),s.stencilFunc(s.ALWAYS,0,4294967295),s.stencilOp(s.KEEP,s.KEEP,s.KEEP),s.clearStencil(0),s.cullFace(s.BACK),s.frontFace(s.CCW),s.polygonOffset(0,0),s.activeTexture(s.TEXTURE0),s.bindFramebuffer(s.FRAMEBUFFER,null),s.bindFramebuffer(s.DRAW_FRAMEBUFFER,null),s.bindFramebuffer(s.READ_FRAMEBUFFER,null),s.useProgram(null),s.lineWidth(1),s.scissor(0,0,s.canvas.width,s.canvas.height),s.viewport(0,0,s.canvas.width,s.canvas.height),_={},ye=null,_e={},v={},y=new WeakMap,x=[],b=null,R=!1,T=null,M=null,w=null,D=null,L=null,P=null,O=null,z=new Rt(0,0,0),V=0,N=!1,F=null,K=null,ne=null,ee=null,ie=null,Me.set(0,0,s.canvas.width,s.canvas.height),Ne.set(0,0,s.canvas.width,s.canvas.height),o.reset(),l.reset(),h.reset()}return{buffers:{color:o,depth:l,stencil:h},enable:Ce,disable:tt,bindFramebuffer:Et,drawBuffers:wt,useProgram:on,setBlending:me,setMaterial:Le,setFlipSided:Ue,setCullFace:rt,setLineWidth:Q,setPolygonOffset:Kt,setScissorTest:_t,activeTexture:Ft,bindTexture:yt,unbindTexture:j,compressedTexImage2D:I,compressedTexImage3D:ue,texImage2D:Xt,texImage3D:ze,updateUBOMapping:pt,uniformBlockBinding:st,texStorage2D:gt,texStorage3D:Ht,texSubImage2D:Ie,texSubImage3D:Xe,compressedTexSubImage2D:Oe,compressedTexSubImage3D:Bt,scissor:qe,viewport:Tt,reset:qt}}function gU(s,e,t,n,i,o,l){const h=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,d=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),p=new et,_=new WeakMap;let v;const y=new WeakMap;let x=!1;try{x=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function b(j,I){return x?new OffscreenCanvas(j,I):yp("canvas")}function R(j,I,ue){let Ie=1;const Xe=yt(j);if((Xe.width>ue||Xe.height>ue)&&(Ie=ue/Math.max(Xe.width,Xe.height)),Ie<1)if(typeof HTMLImageElement<"u"&&j instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&j instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&j instanceof ImageBitmap||typeof VideoFrame<"u"&&j instanceof VideoFrame){const Oe=Math.floor(Ie*Xe.width),Bt=Math.floor(Ie*Xe.height);v===void 0&&(v=b(Oe,Bt));const gt=I?b(Oe,Bt):v;return gt.width=Oe,gt.height=Bt,gt.getContext("2d").drawImage(j,0,0,Oe,Bt),Ot("WebGLRenderer: Texture has been resized from ("+Xe.width+"x"+Xe.height+") to ("+Oe+"x"+Bt+")."),gt}else return"data"in j&&Ot("WebGLRenderer: Image in DataTexture is too big ("+Xe.width+"x"+Xe.height+")."),j;return j}function T(j){return j.generateMipmaps}function M(j){s.generateMipmap(j)}function w(j){return j.isWebGLCubeRenderTarget?s.TEXTURE_CUBE_MAP:j.isWebGL3DRenderTarget?s.TEXTURE_3D:j.isWebGLArrayRenderTarget||j.isCompressedArrayTexture?s.TEXTURE_2D_ARRAY:s.TEXTURE_2D}function D(j,I,ue,Ie,Xe=!1){if(j!==null){if(s[j]!==void 0)return s[j];Ot("WebGLRenderer: Attempt to use non-existing WebGL internal format '"+j+"'")}let Oe=I;if(I===s.RED&&(ue===s.FLOAT&&(Oe=s.R32F),ue===s.HALF_FLOAT&&(Oe=s.R16F),ue===s.UNSIGNED_BYTE&&(Oe=s.R8)),I===s.RED_INTEGER&&(ue===s.UNSIGNED_BYTE&&(Oe=s.R8UI),ue===s.UNSIGNED_SHORT&&(Oe=s.R16UI),ue===s.UNSIGNED_INT&&(Oe=s.R32UI),ue===s.BYTE&&(Oe=s.R8I),ue===s.SHORT&&(Oe=s.R16I),ue===s.INT&&(Oe=s.R32I)),I===s.RG&&(ue===s.FLOAT&&(Oe=s.RG32F),ue===s.HALF_FLOAT&&(Oe=s.RG16F),ue===s.UNSIGNED_BYTE&&(Oe=s.RG8)),I===s.RG_INTEGER&&(ue===s.UNSIGNED_BYTE&&(Oe=s.RG8UI),ue===s.UNSIGNED_SHORT&&(Oe=s.RG16UI),ue===s.UNSIGNED_INT&&(Oe=s.RG32UI),ue===s.BYTE&&(Oe=s.RG8I),ue===s.SHORT&&(Oe=s.RG16I),ue===s.INT&&(Oe=s.RG32I)),I===s.RGB_INTEGER&&(ue===s.UNSIGNED_BYTE&&(Oe=s.RGB8UI),ue===s.UNSIGNED_SHORT&&(Oe=s.RGB16UI),ue===s.UNSIGNED_INT&&(Oe=s.RGB32UI),ue===s.BYTE&&(Oe=s.RGB8I),ue===s.SHORT&&(Oe=s.RGB16I),ue===s.INT&&(Oe=s.RGB32I)),I===s.RGBA_INTEGER&&(ue===s.UNSIGNED_BYTE&&(Oe=s.RGBA8UI),ue===s.UNSIGNED_SHORT&&(Oe=s.RGBA16UI),ue===s.UNSIGNED_INT&&(Oe=s.RGBA32UI),ue===s.BYTE&&(Oe=s.RGBA8I),ue===s.SHORT&&(Oe=s.RGBA16I),ue===s.INT&&(Oe=s.RGBA32I)),I===s.RGB&&(ue===s.UNSIGNED_INT_5_9_9_9_REV&&(Oe=s.RGB9_E5),ue===s.UNSIGNED_INT_10F_11F_11F_REV&&(Oe=s.R11F_G11F_B10F)),I===s.RGBA){const Bt=Xe?vp:Hn.getTransfer(Ie);ue===s.FLOAT&&(Oe=s.RGBA32F),ue===s.HALF_FLOAT&&(Oe=s.RGBA16F),ue===s.UNSIGNED_BYTE&&(Oe=Bt===gi?s.SRGB8_ALPHA8:s.RGBA8),ue===s.UNSIGNED_SHORT_4_4_4_4&&(Oe=s.RGBA4),ue===s.UNSIGNED_SHORT_5_5_5_1&&(Oe=s.RGB5_A1)}return(Oe===s.R16F||Oe===s.R32F||Oe===s.RG16F||Oe===s.RG32F||Oe===s.RGBA16F||Oe===s.RGBA32F)&&e.get("EXT_color_buffer_float"),Oe}function L(j,I){let ue;return j?I===null||I===dr||I===sh?ue=s.DEPTH24_STENCIL8:I===Vi?ue=s.DEPTH32F_STENCIL8:I===ah&&(ue=s.DEPTH24_STENCIL8,Ot("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):I===null||I===dr||I===sh?ue=s.DEPTH_COMPONENT24:I===Vi?ue=s.DEPTH_COMPONENT32F:I===ah&&(ue=s.DEPTH_COMPONENT16),ue}function P(j,I){return T(j)===!0||j.isFramebufferTexture&&j.minFilter!==zi&&j.minFilter!==In?Math.log2(Math.max(I.width,I.height))+1:j.mipmaps!==void 0&&j.mipmaps.length>0?j.mipmaps.length:j.isCompressedTexture&&Array.isArray(j.image)?I.mipmaps.length:1}function O(j){const I=j.target;I.removeEventListener("dispose",O),V(I),I.isVideoTexture&&_.delete(I)}function z(j){const I=j.target;I.removeEventListener("dispose",z),F(I)}function V(j){const I=n.get(j);if(I.__webglInit===void 0)return;const ue=j.source,Ie=y.get(ue);if(Ie){const Xe=Ie[I.__cacheKey];Xe.usedTimes--,Xe.usedTimes===0&&N(j),Object.keys(Ie).length===0&&y.delete(ue)}n.remove(j)}function N(j){const I=n.get(j);s.deleteTexture(I.__webglTexture);const ue=j.source,Ie=y.get(ue);delete Ie[I.__cacheKey],l.memory.textures--}function F(j){const I=n.get(j);if(j.depthTexture&&(j.depthTexture.dispose(),n.remove(j.depthTexture)),j.isWebGLCubeRenderTarget)for(let Ie=0;Ie<6;Ie++){if(Array.isArray(I.__webglFramebuffer[Ie]))for(let Xe=0;Xe<I.__webglFramebuffer[Ie].length;Xe++)s.deleteFramebuffer(I.__webglFramebuffer[Ie][Xe]);else s.deleteFramebuffer(I.__webglFramebuffer[Ie]);I.__webglDepthbuffer&&s.deleteRenderbuffer(I.__webglDepthbuffer[Ie])}else{if(Array.isArray(I.__webglFramebuffer))for(let Ie=0;Ie<I.__webglFramebuffer.length;Ie++)s.deleteFramebuffer(I.__webglFramebuffer[Ie]);else s.deleteFramebuffer(I.__webglFramebuffer);if(I.__webglDepthbuffer&&s.deleteRenderbuffer(I.__webglDepthbuffer),I.__webglMultisampledFramebuffer&&s.deleteFramebuffer(I.__webglMultisampledFramebuffer),I.__webglColorRenderbuffer)for(let Ie=0;Ie<I.__webglColorRenderbuffer.length;Ie++)I.__webglColorRenderbuffer[Ie]&&s.deleteRenderbuffer(I.__webglColorRenderbuffer[Ie]);I.__webglDepthRenderbuffer&&s.deleteRenderbuffer(I.__webglDepthRenderbuffer)}const ue=j.textures;for(let Ie=0,Xe=ue.length;Ie<Xe;Ie++){const Oe=n.get(ue[Ie]);Oe.__webglTexture&&(s.deleteTexture(Oe.__webglTexture),l.memory.textures--),n.remove(ue[Ie])}n.remove(j)}let K=0;function ne(){K=0}function ee(){const j=K;return j>=i.maxTextures&&Ot("WebGLTextures: Trying to use "+j+" texture units while this GPU supports only "+i.maxTextures),K+=1,j}function ie(j){const I=[];return I.push(j.wrapS),I.push(j.wrapT),I.push(j.wrapR||0),I.push(j.magFilter),I.push(j.minFilter),I.push(j.anisotropy),I.push(j.internalFormat),I.push(j.format),I.push(j.type),I.push(j.generateMipmaps),I.push(j.premultiplyAlpha),I.push(j.flipY),I.push(j.unpackAlignment),I.push(j.colorSpace),I.join()}function he(j,I){const ue=n.get(j);if(j.isVideoTexture&&_t(j),j.isRenderTargetTexture===!1&&j.isExternalTexture!==!0&&j.version>0&&ue.__version!==j.version){const Ie=j.image;if(Ie===null)Ot("WebGLRenderer: Texture marked for update but no image data found.");else if(Ie.complete===!1)Ot("WebGLRenderer: Texture marked for update but image is incomplete");else{ve(ue,j,I);return}}else j.isExternalTexture&&(ue.__webglTexture=j.sourceTexture?j.sourceTexture:null);t.bindTexture(s.TEXTURE_2D,ue.__webglTexture,s.TEXTURE0+I)}function H(j,I){const ue=n.get(j);if(j.isRenderTargetTexture===!1&&j.version>0&&ue.__version!==j.version){ve(ue,j,I);return}else j.isExternalTexture&&(ue.__webglTexture=j.sourceTexture?j.sourceTexture:null);t.bindTexture(s.TEXTURE_2D_ARRAY,ue.__webglTexture,s.TEXTURE0+I)}function Y(j,I){const ue=n.get(j);if(j.isRenderTargetTexture===!1&&j.version>0&&ue.__version!==j.version){ve(ue,j,I);return}t.bindTexture(s.TEXTURE_3D,ue.__webglTexture,s.TEXTURE0+I)}function $(j,I){const ue=n.get(j);if(j.isCubeDepthTexture!==!0&&j.version>0&&ue.__version!==j.version){Ce(ue,j,I);return}t.bindTexture(s.TEXTURE_CUBE_MAP,ue.__webglTexture,s.TEXTURE0+I)}const ye={[oo]:s.REPEAT,[Gi]:s.CLAMP_TO_EDGE,[Ru]:s.MIRRORED_REPEAT},_e={[zi]:s.NEAREST,[rp]:s.NEAREST_MIPMAP_NEAREST,[_c]:s.NEAREST_MIPMAP_LINEAR,[In]:s.LINEAR,[wu]:s.LINEAR_MIPMAP_NEAREST,[$s]:s.LINEAR_MIPMAP_LINEAR},W={[hb]:s.NEVER,[vb]:s.ALWAYS,[db]:s.LESS,[T0]:s.LEQUAL,[pb]:s.EQUAL,[C0]:s.GEQUAL,[mb]:s.GREATER,[gb]:s.NOTEQUAL};function ae(j,I){if(I.type===Vi&&e.has("OES_texture_float_linear")===!1&&(I.magFilter===In||I.magFilter===wu||I.magFilter===_c||I.magFilter===$s||I.minFilter===In||I.minFilter===wu||I.minFilter===_c||I.minFilter===$s)&&Ot("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),s.texParameteri(j,s.TEXTURE_WRAP_S,ye[I.wrapS]),s.texParameteri(j,s.TEXTURE_WRAP_T,ye[I.wrapT]),(j===s.TEXTURE_3D||j===s.TEXTURE_2D_ARRAY)&&s.texParameteri(j,s.TEXTURE_WRAP_R,ye[I.wrapR]),s.texParameteri(j,s.TEXTURE_MAG_FILTER,_e[I.magFilter]),s.texParameteri(j,s.TEXTURE_MIN_FILTER,_e[I.minFilter]),I.compareFunction&&(s.texParameteri(j,s.TEXTURE_COMPARE_MODE,s.COMPARE_REF_TO_TEXTURE),s.texParameteri(j,s.TEXTURE_COMPARE_FUNC,W[I.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(I.magFilter===zi||I.minFilter!==_c&&I.minFilter!==$s||I.type===Vi&&e.has("OES_texture_float_linear")===!1)return;if(I.anisotropy>1||n.get(I).__currentAnisotropy){const ue=e.get("EXT_texture_filter_anisotropic");s.texParameterf(j,ue.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(I.anisotropy,i.getMaxAnisotropy())),n.get(I).__currentAnisotropy=I.anisotropy}}}function Me(j,I){let ue=!1;j.__webglInit===void 0&&(j.__webglInit=!0,I.addEventListener("dispose",O));const Ie=I.source;let Xe=y.get(Ie);Xe===void 0&&(Xe={},y.set(Ie,Xe));const Oe=ie(I);if(Oe!==j.__cacheKey){Xe[Oe]===void 0&&(Xe[Oe]={texture:s.createTexture(),usedTimes:0},l.memory.textures++,ue=!0),Xe[Oe].usedTimes++;const Bt=Xe[j.__cacheKey];Bt!==void 0&&(Xe[j.__cacheKey].usedTimes--,Bt.usedTimes===0&&N(I)),j.__cacheKey=Oe,j.__webglTexture=Xe[Oe].texture}return ue}function Ne(j,I,ue){return Math.floor(Math.floor(j/ue)/I)}function it(j,I,ue,Ie){const Oe=j.updateRanges;if(Oe.length===0)t.texSubImage2D(s.TEXTURE_2D,0,0,0,I.width,I.height,ue,Ie,I.data);else{Oe.sort((ze,qe)=>ze.start-qe.start);let Bt=0;for(let ze=1;ze<Oe.length;ze++){const qe=Oe[Bt],Tt=Oe[ze],pt=qe.start+qe.count,st=Ne(Tt.start,I.width,4),qt=Ne(qe.start,I.width,4);Tt.start<=pt+1&&st===qt&&Ne(Tt.start+Tt.count-1,I.width,4)===st?qe.count=Math.max(qe.count,Tt.start+Tt.count-qe.start):(++Bt,Oe[Bt]=Tt)}Oe.length=Bt+1;const gt=s.getParameter(s.UNPACK_ROW_LENGTH),Ht=s.getParameter(s.UNPACK_SKIP_PIXELS),Xt=s.getParameter(s.UNPACK_SKIP_ROWS);s.pixelStorei(s.UNPACK_ROW_LENGTH,I.width);for(let ze=0,qe=Oe.length;ze<qe;ze++){const Tt=Oe[ze],pt=Math.floor(Tt.start/4),st=Math.ceil(Tt.count/4),qt=pt%I.width,de=Math.floor(pt/I.width),be=st,We=1;s.pixelStorei(s.UNPACK_SKIP_PIXELS,qt),s.pixelStorei(s.UNPACK_SKIP_ROWS,de),t.texSubImage2D(s.TEXTURE_2D,0,qt,de,be,We,ue,Ie,I.data)}j.clearUpdateRanges(),s.pixelStorei(s.UNPACK_ROW_LENGTH,gt),s.pixelStorei(s.UNPACK_SKIP_PIXELS,Ht),s.pixelStorei(s.UNPACK_SKIP_ROWS,Xt)}}function ve(j,I,ue){let Ie=s.TEXTURE_2D;(I.isDataArrayTexture||I.isCompressedArrayTexture)&&(Ie=s.TEXTURE_2D_ARRAY),I.isData3DTexture&&(Ie=s.TEXTURE_3D);const Xe=Me(j,I),Oe=I.source;t.bindTexture(Ie,j.__webglTexture,s.TEXTURE0+ue);const Bt=n.get(Oe);if(Oe.version!==Bt.__version||Xe===!0){t.activeTexture(s.TEXTURE0+ue);const gt=Hn.getPrimaries(Hn.workingColorSpace),Ht=I.colorSpace===El?null:Hn.getPrimaries(I.colorSpace),Xt=I.colorSpace===El||gt===Ht?s.NONE:s.BROWSER_DEFAULT_WEBGL;s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,I.flipY),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,I.premultiplyAlpha),s.pixelStorei(s.UNPACK_ALIGNMENT,I.unpackAlignment),s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,Xt);let ze=R(I.image,!1,i.maxTextureSize);ze=Ft(I,ze);const qe=o.convert(I.format,I.colorSpace),Tt=o.convert(I.type);let pt=D(I.internalFormat,qe,Tt,I.colorSpace,I.isVideoTexture);ae(Ie,I);let st;const qt=I.mipmaps,de=I.isVideoTexture!==!0,be=Bt.__version===void 0||Xe===!0,We=Oe.dataReady,St=P(I,ze);if(I.isDepthTexture)pt=L(I.format===yc,I.type),be&&(de?t.texStorage2D(s.TEXTURE_2D,1,pt,ze.width,ze.height):t.texImage2D(s.TEXTURE_2D,0,pt,ze.width,ze.height,0,qe,Tt,null));else if(I.isDataTexture)if(qt.length>0){de&&be&&t.texStorage2D(s.TEXTURE_2D,St,pt,qt[0].width,qt[0].height);for(let Ye=0,Ve=qt.length;Ye<Ve;Ye++)st=qt[Ye],de?We&&t.texSubImage2D(s.TEXTURE_2D,Ye,0,0,st.width,st.height,qe,Tt,st.data):t.texImage2D(s.TEXTURE_2D,Ye,pt,st.width,st.height,0,qe,Tt,st.data);I.generateMipmaps=!1}else de?(be&&t.texStorage2D(s.TEXTURE_2D,St,pt,ze.width,ze.height),We&&it(I,ze,qe,Tt)):t.texImage2D(s.TEXTURE_2D,0,pt,ze.width,ze.height,0,qe,Tt,ze.data);else if(I.isCompressedTexture)if(I.isCompressedArrayTexture){de&&be&&t.texStorage3D(s.TEXTURE_2D_ARRAY,St,pt,qt[0].width,qt[0].height,ze.depth);for(let Ye=0,Ve=qt.length;Ye<Ve;Ye++)if(st=qt[Ye],I.format!==ga)if(qe!==null)if(de){if(We)if(I.layerUpdates.size>0){const ft=DA(st.width,st.height,I.format,I.type);for(const jt of I.layerUpdates){const Mn=st.data.subarray(jt*ft/st.data.BYTES_PER_ELEMENT,(jt+1)*ft/st.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(s.TEXTURE_2D_ARRAY,Ye,0,0,jt,st.width,st.height,1,qe,Mn)}I.clearLayerUpdates()}else t.compressedTexSubImage3D(s.TEXTURE_2D_ARRAY,Ye,0,0,0,st.width,st.height,ze.depth,qe,st.data)}else t.compressedTexImage3D(s.TEXTURE_2D_ARRAY,Ye,pt,st.width,st.height,ze.depth,0,st.data,0,0);else Ot("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else de?We&&t.texSubImage3D(s.TEXTURE_2D_ARRAY,Ye,0,0,0,st.width,st.height,ze.depth,qe,Tt,st.data):t.texImage3D(s.TEXTURE_2D_ARRAY,Ye,pt,st.width,st.height,ze.depth,0,qe,Tt,st.data)}else{de&&be&&t.texStorage2D(s.TEXTURE_2D,St,pt,qt[0].width,qt[0].height);for(let Ye=0,Ve=qt.length;Ye<Ve;Ye++)st=qt[Ye],I.format!==ga?qe!==null?de?We&&t.compressedTexSubImage2D(s.TEXTURE_2D,Ye,0,0,st.width,st.height,qe,st.data):t.compressedTexImage2D(s.TEXTURE_2D,Ye,pt,st.width,st.height,0,st.data):Ot("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):de?We&&t.texSubImage2D(s.TEXTURE_2D,Ye,0,0,st.width,st.height,qe,Tt,st.data):t.texImage2D(s.TEXTURE_2D,Ye,pt,st.width,st.height,0,qe,Tt,st.data)}else if(I.isDataArrayTexture)if(de){if(be&&t.texStorage3D(s.TEXTURE_2D_ARRAY,St,pt,ze.width,ze.height,ze.depth),We)if(I.layerUpdates.size>0){const Ye=DA(ze.width,ze.height,I.format,I.type);for(const Ve of I.layerUpdates){const ft=ze.data.subarray(Ve*Ye/ze.data.BYTES_PER_ELEMENT,(Ve+1)*Ye/ze.data.BYTES_PER_ELEMENT);t.texSubImage3D(s.TEXTURE_2D_ARRAY,0,0,0,Ve,ze.width,ze.height,1,qe,Tt,ft)}I.clearLayerUpdates()}else t.texSubImage3D(s.TEXTURE_2D_ARRAY,0,0,0,0,ze.width,ze.height,ze.depth,qe,Tt,ze.data)}else t.texImage3D(s.TEXTURE_2D_ARRAY,0,pt,ze.width,ze.height,ze.depth,0,qe,Tt,ze.data);else if(I.isData3DTexture)de?(be&&t.texStorage3D(s.TEXTURE_3D,St,pt,ze.width,ze.height,ze.depth),We&&t.texSubImage3D(s.TEXTURE_3D,0,0,0,0,ze.width,ze.height,ze.depth,qe,Tt,ze.data)):t.texImage3D(s.TEXTURE_3D,0,pt,ze.width,ze.height,ze.depth,0,qe,Tt,ze.data);else if(I.isFramebufferTexture){if(be)if(de)t.texStorage2D(s.TEXTURE_2D,St,pt,ze.width,ze.height);else{let Ye=ze.width,Ve=ze.height;for(let ft=0;ft<St;ft++)t.texImage2D(s.TEXTURE_2D,ft,pt,Ye,Ve,0,qe,Tt,null),Ye>>=1,Ve>>=1}}else if(qt.length>0){if(de&&be){const Ye=yt(qt[0]);t.texStorage2D(s.TEXTURE_2D,St,pt,Ye.width,Ye.height)}for(let Ye=0,Ve=qt.length;Ye<Ve;Ye++)st=qt[Ye],de?We&&t.texSubImage2D(s.TEXTURE_2D,Ye,0,0,qe,Tt,st):t.texImage2D(s.TEXTURE_2D,Ye,pt,qe,Tt,st);I.generateMipmaps=!1}else if(de){if(be){const Ye=yt(ze);t.texStorage2D(s.TEXTURE_2D,St,pt,Ye.width,Ye.height)}We&&t.texSubImage2D(s.TEXTURE_2D,0,0,0,qe,Tt,ze)}else t.texImage2D(s.TEXTURE_2D,0,pt,qe,Tt,ze);T(I)&&M(Ie),Bt.__version=Oe.version,I.onUpdate&&I.onUpdate(I)}j.__version=I.version}function Ce(j,I,ue){if(I.image.length!==6)return;const Ie=Me(j,I),Xe=I.source;t.bindTexture(s.TEXTURE_CUBE_MAP,j.__webglTexture,s.TEXTURE0+ue);const Oe=n.get(Xe);if(Xe.version!==Oe.__version||Ie===!0){t.activeTexture(s.TEXTURE0+ue);const Bt=Hn.getPrimaries(Hn.workingColorSpace),gt=I.colorSpace===El?null:Hn.getPrimaries(I.colorSpace),Ht=I.colorSpace===El||Bt===gt?s.NONE:s.BROWSER_DEFAULT_WEBGL;s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,I.flipY),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,I.premultiplyAlpha),s.pixelStorei(s.UNPACK_ALIGNMENT,I.unpackAlignment),s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ht);const Xt=I.isCompressedTexture||I.image[0].isCompressedTexture,ze=I.image[0]&&I.image[0].isDataTexture,qe=[];for(let Ve=0;Ve<6;Ve++)!Xt&&!ze?qe[Ve]=R(I.image[Ve],!0,i.maxCubemapSize):qe[Ve]=ze?I.image[Ve].image:I.image[Ve],qe[Ve]=Ft(I,qe[Ve]);const Tt=qe[0],pt=o.convert(I.format,I.colorSpace),st=o.convert(I.type),qt=D(I.internalFormat,pt,st,I.colorSpace),de=I.isVideoTexture!==!0,be=Oe.__version===void 0||Ie===!0,We=Xe.dataReady;let St=P(I,Tt);ae(s.TEXTURE_CUBE_MAP,I);let Ye;if(Xt){de&&be&&t.texStorage2D(s.TEXTURE_CUBE_MAP,St,qt,Tt.width,Tt.height);for(let Ve=0;Ve<6;Ve++){Ye=qe[Ve].mipmaps;for(let ft=0;ft<Ye.length;ft++){const jt=Ye[ft];I.format!==ga?pt!==null?de?We&&t.compressedTexSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+Ve,ft,0,0,jt.width,jt.height,pt,jt.data):t.compressedTexImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+Ve,ft,qt,jt.width,jt.height,0,jt.data):Ot("WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):de?We&&t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+Ve,ft,0,0,jt.width,jt.height,pt,st,jt.data):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+Ve,ft,qt,jt.width,jt.height,0,pt,st,jt.data)}}}else{if(Ye=I.mipmaps,de&&be){Ye.length>0&&St++;const Ve=yt(qe[0]);t.texStorage2D(s.TEXTURE_CUBE_MAP,St,qt,Ve.width,Ve.height)}for(let Ve=0;Ve<6;Ve++)if(ze){de?We&&t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+Ve,0,0,0,qe[Ve].width,qe[Ve].height,pt,st,qe[Ve].data):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+Ve,0,qt,qe[Ve].width,qe[Ve].height,0,pt,st,qe[Ve].data);for(let ft=0;ft<Ye.length;ft++){const Mn=Ye[ft].image[Ve].image;de?We&&t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+Ve,ft+1,0,0,Mn.width,Mn.height,pt,st,Mn.data):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+Ve,ft+1,qt,Mn.width,Mn.height,0,pt,st,Mn.data)}}else{de?We&&t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+Ve,0,0,0,pt,st,qe[Ve]):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+Ve,0,qt,pt,st,qe[Ve]);for(let ft=0;ft<Ye.length;ft++){const jt=Ye[ft];de?We&&t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+Ve,ft+1,0,0,pt,st,jt.image[Ve]):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+Ve,ft+1,qt,pt,st,jt.image[Ve])}}}T(I)&&M(s.TEXTURE_CUBE_MAP),Oe.__version=Xe.version,I.onUpdate&&I.onUpdate(I)}j.__version=I.version}function tt(j,I,ue,Ie,Xe,Oe){const Bt=o.convert(ue.format,ue.colorSpace),gt=o.convert(ue.type),Ht=D(ue.internalFormat,Bt,gt,ue.colorSpace),Xt=n.get(I),ze=n.get(ue);if(ze.__renderTarget=I,!Xt.__hasExternalTextures){const qe=Math.max(1,I.width>>Oe),Tt=Math.max(1,I.height>>Oe);Xe===s.TEXTURE_3D||Xe===s.TEXTURE_2D_ARRAY?t.texImage3D(Xe,Oe,Ht,qe,Tt,I.depth,0,Bt,gt,null):t.texImage2D(Xe,Oe,Ht,qe,Tt,0,Bt,gt,null)}t.bindFramebuffer(s.FRAMEBUFFER,j),Kt(I)?h.framebufferTexture2DMultisampleEXT(s.FRAMEBUFFER,Ie,Xe,ze.__webglTexture,0,Q(I)):(Xe===s.TEXTURE_2D||Xe>=s.TEXTURE_CUBE_MAP_POSITIVE_X&&Xe<=s.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&s.framebufferTexture2D(s.FRAMEBUFFER,Ie,Xe,ze.__webglTexture,Oe),t.bindFramebuffer(s.FRAMEBUFFER,null)}function Et(j,I,ue){if(s.bindRenderbuffer(s.RENDERBUFFER,j),I.depthBuffer){const Ie=I.depthTexture,Xe=Ie&&Ie.isDepthTexture?Ie.type:null,Oe=L(I.stencilBuffer,Xe),Bt=I.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT;Kt(I)?h.renderbufferStorageMultisampleEXT(s.RENDERBUFFER,Q(I),Oe,I.width,I.height):ue?s.renderbufferStorageMultisample(s.RENDERBUFFER,Q(I),Oe,I.width,I.height):s.renderbufferStorage(s.RENDERBUFFER,Oe,I.width,I.height),s.framebufferRenderbuffer(s.FRAMEBUFFER,Bt,s.RENDERBUFFER,j)}else{const Ie=I.textures;for(let Xe=0;Xe<Ie.length;Xe++){const Oe=Ie[Xe],Bt=o.convert(Oe.format,Oe.colorSpace),gt=o.convert(Oe.type),Ht=D(Oe.internalFormat,Bt,gt,Oe.colorSpace);Kt(I)?h.renderbufferStorageMultisampleEXT(s.RENDERBUFFER,Q(I),Ht,I.width,I.height):ue?s.renderbufferStorageMultisample(s.RENDERBUFFER,Q(I),Ht,I.width,I.height):s.renderbufferStorage(s.RENDERBUFFER,Ht,I.width,I.height)}}s.bindRenderbuffer(s.RENDERBUFFER,null)}function wt(j,I,ue){const Ie=I.isWebGLCubeRenderTarget===!0;if(t.bindFramebuffer(s.FRAMEBUFFER,j),!(I.depthTexture&&I.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const Xe=n.get(I.depthTexture);if(Xe.__renderTarget=I,(!Xe.__webglTexture||I.depthTexture.image.width!==I.width||I.depthTexture.image.height!==I.height)&&(I.depthTexture.image.width=I.width,I.depthTexture.image.height=I.height,I.depthTexture.needsUpdate=!0),Ie){if(Xe.__webglInit===void 0&&(Xe.__webglInit=!0,I.depthTexture.addEventListener("dispose",O)),Xe.__webglTexture===void 0){Xe.__webglTexture=s.createTexture(),t.bindTexture(s.TEXTURE_CUBE_MAP,Xe.__webglTexture),ae(s.TEXTURE_CUBE_MAP,I.depthTexture);const Xt=o.convert(I.depthTexture.format),ze=o.convert(I.depthTexture.type);let qe;I.depthTexture.format===Ho?qe=s.DEPTH_COMPONENT24:I.depthTexture.format===yc&&(qe=s.DEPTH24_STENCIL8);for(let Tt=0;Tt<6;Tt++)s.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+Tt,0,qe,I.width,I.height,0,Xt,ze,null)}}else he(I.depthTexture,0);const Oe=Xe.__webglTexture,Bt=Q(I),gt=Ie?s.TEXTURE_CUBE_MAP_POSITIVE_X+ue:s.TEXTURE_2D,Ht=I.depthTexture.format===yc?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT;if(I.depthTexture.format===Ho)Kt(I)?h.framebufferTexture2DMultisampleEXT(s.FRAMEBUFFER,Ht,gt,Oe,0,Bt):s.framebufferTexture2D(s.FRAMEBUFFER,Ht,gt,Oe,0);else if(I.depthTexture.format===yc)Kt(I)?h.framebufferTexture2DMultisampleEXT(s.FRAMEBUFFER,Ht,gt,Oe,0,Bt):s.framebufferTexture2D(s.FRAMEBUFFER,Ht,gt,Oe,0);else throw new Error("Unknown depthTexture format")}function on(j){const I=n.get(j),ue=j.isWebGLCubeRenderTarget===!0;if(I.__boundDepthTexture!==j.depthTexture){const Ie=j.depthTexture;if(I.__depthDisposeCallback&&I.__depthDisposeCallback(),Ie){const Xe=()=>{delete I.__boundDepthTexture,delete I.__depthDisposeCallback,Ie.removeEventListener("dispose",Xe)};Ie.addEventListener("dispose",Xe),I.__depthDisposeCallback=Xe}I.__boundDepthTexture=Ie}if(j.depthTexture&&!I.__autoAllocateDepthBuffer)if(ue)for(let Ie=0;Ie<6;Ie++)wt(I.__webglFramebuffer[Ie],j,Ie);else{const Ie=j.texture.mipmaps;Ie&&Ie.length>0?wt(I.__webglFramebuffer[0],j,0):wt(I.__webglFramebuffer,j,0)}else if(ue){I.__webglDepthbuffer=[];for(let Ie=0;Ie<6;Ie++)if(t.bindFramebuffer(s.FRAMEBUFFER,I.__webglFramebuffer[Ie]),I.__webglDepthbuffer[Ie]===void 0)I.__webglDepthbuffer[Ie]=s.createRenderbuffer(),Et(I.__webglDepthbuffer[Ie],j,!1);else{const Xe=j.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT,Oe=I.__webglDepthbuffer[Ie];s.bindRenderbuffer(s.RENDERBUFFER,Oe),s.framebufferRenderbuffer(s.FRAMEBUFFER,Xe,s.RENDERBUFFER,Oe)}}else{const Ie=j.texture.mipmaps;if(Ie&&Ie.length>0?t.bindFramebuffer(s.FRAMEBUFFER,I.__webglFramebuffer[0]):t.bindFramebuffer(s.FRAMEBUFFER,I.__webglFramebuffer),I.__webglDepthbuffer===void 0)I.__webglDepthbuffer=s.createRenderbuffer(),Et(I.__webglDepthbuffer,j,!1);else{const Xe=j.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT,Oe=I.__webglDepthbuffer;s.bindRenderbuffer(s.RENDERBUFFER,Oe),s.framebufferRenderbuffer(s.FRAMEBUFFER,Xe,s.RENDERBUFFER,Oe)}}t.bindFramebuffer(s.FRAMEBUFFER,null)}function It(j,I,ue){const Ie=n.get(j);I!==void 0&&tt(Ie.__webglFramebuffer,j,j.texture,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,0),ue!==void 0&&on(j)}function mt(j){const I=j.texture,ue=n.get(j),Ie=n.get(I);j.addEventListener("dispose",z);const Xe=j.textures,Oe=j.isWebGLCubeRenderTarget===!0,Bt=Xe.length>1;if(Bt||(Ie.__webglTexture===void 0&&(Ie.__webglTexture=s.createTexture()),Ie.__version=I.version,l.memory.textures++),Oe){ue.__webglFramebuffer=[];for(let gt=0;gt<6;gt++)if(I.mipmaps&&I.mipmaps.length>0){ue.__webglFramebuffer[gt]=[];for(let Ht=0;Ht<I.mipmaps.length;Ht++)ue.__webglFramebuffer[gt][Ht]=s.createFramebuffer()}else ue.__webglFramebuffer[gt]=s.createFramebuffer()}else{if(I.mipmaps&&I.mipmaps.length>0){ue.__webglFramebuffer=[];for(let gt=0;gt<I.mipmaps.length;gt++)ue.__webglFramebuffer[gt]=s.createFramebuffer()}else ue.__webglFramebuffer=s.createFramebuffer();if(Bt)for(let gt=0,Ht=Xe.length;gt<Ht;gt++){const Xt=n.get(Xe[gt]);Xt.__webglTexture===void 0&&(Xt.__webglTexture=s.createTexture(),l.memory.textures++)}if(j.samples>0&&Kt(j)===!1){ue.__webglMultisampledFramebuffer=s.createFramebuffer(),ue.__webglColorRenderbuffer=[],t.bindFramebuffer(s.FRAMEBUFFER,ue.__webglMultisampledFramebuffer);for(let gt=0;gt<Xe.length;gt++){const Ht=Xe[gt];ue.__webglColorRenderbuffer[gt]=s.createRenderbuffer(),s.bindRenderbuffer(s.RENDERBUFFER,ue.__webglColorRenderbuffer[gt]);const Xt=o.convert(Ht.format,Ht.colorSpace),ze=o.convert(Ht.type),qe=D(Ht.internalFormat,Xt,ze,Ht.colorSpace,j.isXRRenderTarget===!0),Tt=Q(j);s.renderbufferStorageMultisample(s.RENDERBUFFER,Tt,qe,j.width,j.height),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0+gt,s.RENDERBUFFER,ue.__webglColorRenderbuffer[gt])}s.bindRenderbuffer(s.RENDERBUFFER,null),j.depthBuffer&&(ue.__webglDepthRenderbuffer=s.createRenderbuffer(),Et(ue.__webglDepthRenderbuffer,j,!0)),t.bindFramebuffer(s.FRAMEBUFFER,null)}}if(Oe){t.bindTexture(s.TEXTURE_CUBE_MAP,Ie.__webglTexture),ae(s.TEXTURE_CUBE_MAP,I);for(let gt=0;gt<6;gt++)if(I.mipmaps&&I.mipmaps.length>0)for(let Ht=0;Ht<I.mipmaps.length;Ht++)tt(ue.__webglFramebuffer[gt][Ht],j,I,s.COLOR_ATTACHMENT0,s.TEXTURE_CUBE_MAP_POSITIVE_X+gt,Ht);else tt(ue.__webglFramebuffer[gt],j,I,s.COLOR_ATTACHMENT0,s.TEXTURE_CUBE_MAP_POSITIVE_X+gt,0);T(I)&&M(s.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(Bt){for(let gt=0,Ht=Xe.length;gt<Ht;gt++){const Xt=Xe[gt],ze=n.get(Xt);let qe=s.TEXTURE_2D;(j.isWebGL3DRenderTarget||j.isWebGLArrayRenderTarget)&&(qe=j.isWebGL3DRenderTarget?s.TEXTURE_3D:s.TEXTURE_2D_ARRAY),t.bindTexture(qe,ze.__webglTexture),ae(qe,Xt),tt(ue.__webglFramebuffer,j,Xt,s.COLOR_ATTACHMENT0+gt,qe,0),T(Xt)&&M(qe)}t.unbindTexture()}else{let gt=s.TEXTURE_2D;if((j.isWebGL3DRenderTarget||j.isWebGLArrayRenderTarget)&&(gt=j.isWebGL3DRenderTarget?s.TEXTURE_3D:s.TEXTURE_2D_ARRAY),t.bindTexture(gt,Ie.__webglTexture),ae(gt,I),I.mipmaps&&I.mipmaps.length>0)for(let Ht=0;Ht<I.mipmaps.length;Ht++)tt(ue.__webglFramebuffer[Ht],j,I,s.COLOR_ATTACHMENT0,gt,Ht);else tt(ue.__webglFramebuffer,j,I,s.COLOR_ATTACHMENT0,gt,0);T(I)&&M(gt),t.unbindTexture()}j.depthBuffer&&on(j)}function me(j){const I=j.textures;for(let ue=0,Ie=I.length;ue<Ie;ue++){const Xe=I[ue];if(T(Xe)){const Oe=w(j),Bt=n.get(Xe).__webglTexture;t.bindTexture(Oe,Bt),M(Oe),t.unbindTexture()}}}const Le=[],Ue=[];function rt(j){if(j.samples>0){if(Kt(j)===!1){const I=j.textures,ue=j.width,Ie=j.height;let Xe=s.COLOR_BUFFER_BIT;const Oe=j.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT,Bt=n.get(j),gt=I.length>1;if(gt)for(let Xt=0;Xt<I.length;Xt++)t.bindFramebuffer(s.FRAMEBUFFER,Bt.__webglMultisampledFramebuffer),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0+Xt,s.RENDERBUFFER,null),t.bindFramebuffer(s.FRAMEBUFFER,Bt.__webglFramebuffer),s.framebufferTexture2D(s.DRAW_FRAMEBUFFER,s.COLOR_ATTACHMENT0+Xt,s.TEXTURE_2D,null,0);t.bindFramebuffer(s.READ_FRAMEBUFFER,Bt.__webglMultisampledFramebuffer);const Ht=j.texture.mipmaps;Ht&&Ht.length>0?t.bindFramebuffer(s.DRAW_FRAMEBUFFER,Bt.__webglFramebuffer[0]):t.bindFramebuffer(s.DRAW_FRAMEBUFFER,Bt.__webglFramebuffer);for(let Xt=0;Xt<I.length;Xt++){if(j.resolveDepthBuffer&&(j.depthBuffer&&(Xe|=s.DEPTH_BUFFER_BIT),j.stencilBuffer&&j.resolveStencilBuffer&&(Xe|=s.STENCIL_BUFFER_BIT)),gt){s.framebufferRenderbuffer(s.READ_FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.RENDERBUFFER,Bt.__webglColorRenderbuffer[Xt]);const ze=n.get(I[Xt]).__webglTexture;s.framebufferTexture2D(s.DRAW_FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,ze,0)}s.blitFramebuffer(0,0,ue,Ie,0,0,ue,Ie,Xe,s.NEAREST),d===!0&&(Le.length=0,Ue.length=0,Le.push(s.COLOR_ATTACHMENT0+Xt),j.depthBuffer&&j.resolveDepthBuffer===!1&&(Le.push(Oe),Ue.push(Oe),s.invalidateFramebuffer(s.DRAW_FRAMEBUFFER,Ue)),s.invalidateFramebuffer(s.READ_FRAMEBUFFER,Le))}if(t.bindFramebuffer(s.READ_FRAMEBUFFER,null),t.bindFramebuffer(s.DRAW_FRAMEBUFFER,null),gt)for(let Xt=0;Xt<I.length;Xt++){t.bindFramebuffer(s.FRAMEBUFFER,Bt.__webglMultisampledFramebuffer),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0+Xt,s.RENDERBUFFER,Bt.__webglColorRenderbuffer[Xt]);const ze=n.get(I[Xt]).__webglTexture;t.bindFramebuffer(s.FRAMEBUFFER,Bt.__webglFramebuffer),s.framebufferTexture2D(s.DRAW_FRAMEBUFFER,s.COLOR_ATTACHMENT0+Xt,s.TEXTURE_2D,ze,0)}t.bindFramebuffer(s.DRAW_FRAMEBUFFER,Bt.__webglMultisampledFramebuffer)}else if(j.depthBuffer&&j.resolveDepthBuffer===!1&&d){const I=j.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT;s.invalidateFramebuffer(s.DRAW_FRAMEBUFFER,[I])}}}function Q(j){return Math.min(i.maxSamples,j.samples)}function Kt(j){const I=n.get(j);return j.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&I.__useRenderToTexture!==!1}function _t(j){const I=l.render.frame;_.get(j)!==I&&(_.set(j,I),j.update())}function Ft(j,I){const ue=j.colorSpace,Ie=j.format,Xe=j.type;return j.isCompressedTexture===!0||j.isVideoTexture===!0||ue!==Ma&&ue!==El&&(Hn.getTransfer(ue)===gi?(Ie!==ga||Xe!==Xa)&&Ot("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):an("WebGLTextures: Unsupported texture color space:",ue)),I}function yt(j){return typeof HTMLImageElement<"u"&&j instanceof HTMLImageElement?(p.width=j.naturalWidth||j.width,p.height=j.naturalHeight||j.height):typeof VideoFrame<"u"&&j instanceof VideoFrame?(p.width=j.displayWidth,p.height=j.displayHeight):(p.width=j.width,p.height=j.height),p}this.allocateTextureUnit=ee,this.resetTextureUnits=ne,this.setTexture2D=he,this.setTexture2DArray=H,this.setTexture3D=Y,this.setTextureCube=$,this.rebindTextures=It,this.setupRenderTarget=mt,this.updateRenderTargetMipmap=me,this.updateMultisampleRenderTarget=rt,this.setupDepthRenderbuffer=on,this.setupFrameBufferTexture=tt,this.useMultisampledRTT=Kt,this.isReversedDepthBuffer=function(){return t.buffers.depth.getReversed()}}function qE(s,e){function t(n,i=El){let o;const l=Hn.getTransfer(i);if(n===Xa)return s.UNSIGNED_BYTE;if(n===Vg)return s.UNSIGNED_SHORT_4_4_4_4;if(n===kg)return s.UNSIGNED_SHORT_5_5_5_1;if(n===sx)return s.UNSIGNED_INT_5_9_9_9_REV;if(n===rx)return s.UNSIGNED_INT_10F_11F_11F_REV;if(n===Gg)return s.BYTE;if(n===zg)return s.SHORT;if(n===ah)return s.UNSIGNED_SHORT;if(n===op)return s.INT;if(n===dr)return s.UNSIGNED_INT;if(n===Vi)return s.FLOAT;if(n===sa)return s.HALF_FLOAT;if(n===ox)return s.ALPHA;if(n===lx)return s.RGB;if(n===ga)return s.RGBA;if(n===Ho)return s.DEPTH_COMPONENT;if(n===yc)return s.DEPTH_STENCIL;if(n===lp)return s.RED;if(n===cp)return s.RED_INTEGER;if(n===Bu)return s.RG;if(n===Xg)return s.RG_INTEGER;if(n===Yg)return s.RGBA_INTEGER;if(n===up||n===fp||n===hp||n===dp)if(l===gi)if(o=e.get("WEBGL_compressed_texture_s3tc_srgb"),o!==null){if(n===up)return o.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===fp)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===hp)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===dp)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(o=e.get("WEBGL_compressed_texture_s3tc"),o!==null){if(n===up)return o.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===fp)return o.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===hp)return o.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===dp)return o.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===Jg||n===qg||n===Kg||n===Wg)if(o=e.get("WEBGL_compressed_texture_pvrtc"),o!==null){if(n===Jg)return o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===qg)return o.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===Kg)return o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===Wg)return o.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===jg||n===Zg||n===Qg||n===$g||n===e0||n===t0||n===n0)if(o=e.get("WEBGL_compressed_texture_etc"),o!==null){if(n===jg||n===Zg)return l===gi?o.COMPRESSED_SRGB8_ETC2:o.COMPRESSED_RGB8_ETC2;if(n===Qg)return l===gi?o.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:o.COMPRESSED_RGBA8_ETC2_EAC;if(n===$g)return o.COMPRESSED_R11_EAC;if(n===e0)return o.COMPRESSED_SIGNED_R11_EAC;if(n===t0)return o.COMPRESSED_RG11_EAC;if(n===n0)return o.COMPRESSED_SIGNED_RG11_EAC}else return null;if(n===i0||n===a0||n===s0||n===r0||n===o0||n===l0||n===c0||n===u0||n===f0||n===h0||n===d0||n===p0||n===m0||n===g0)if(o=e.get("WEBGL_compressed_texture_astc"),o!==null){if(n===i0)return l===gi?o.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:o.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===a0)return l===gi?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:o.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===s0)return l===gi?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:o.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===r0)return l===gi?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:o.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===o0)return l===gi?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:o.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===l0)return l===gi?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:o.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===c0)return l===gi?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:o.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===u0)return l===gi?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:o.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===f0)return l===gi?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:o.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===h0)return l===gi?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:o.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===d0)return l===gi?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:o.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===p0)return l===gi?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:o.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===m0)return l===gi?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:o.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===g0)return l===gi?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:o.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===v0||n===_0||n===y0)if(o=e.get("EXT_texture_compression_bptc"),o!==null){if(n===v0)return l===gi?o.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:o.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===_0)return o.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===y0)return o.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===x0||n===A0||n===S0||n===M0)if(o=e.get("EXT_texture_compression_rgtc"),o!==null){if(n===x0)return o.COMPRESSED_RED_RGTC1_EXT;if(n===A0)return o.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===S0)return o.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===M0)return o.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===sh?s.UNSIGNED_INT_24_8:s[n]!==void 0?s[n]:null}return{convert:t}}const vU=`
3996
3996
  void main() {
3997
3997
 
3998
3998
  gl_Position = vec4( position, 1.0 );
@@ -4016,14 +4016,14 @@ void main() {
4016
4016
 
4017
4017
  }
4018
4018
 
4019
- }`;class yU{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t){if(this.texture===null){const n=new Jx(e.texture);(e.depthNear!==t.depthNear||e.depthFar!==t.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=n}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,n=new Ns({vertexShader:vU,fragmentShader:_U,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new Oi(new Nc(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class xU extends Po{constructor(e,t){super();const n=this;let i=null,o=1,l=null,h="local-floor",d=1,p=null,_=null,v=null,y=null,x=null,b=null;const R=typeof XRWebGLBinding<"u",T=new yU,M={},w=t.getContextAttributes();let D=null,L=null;const P=[],O=[],z=new et;let V=null;const N=new Ea;N.viewport=new Ti;const F=new Ea;F.viewport=new Ti;const K=[N,F],ne=new iE;let ee=null,ie=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(ve){let Ce=P[ve];return Ce===void 0&&(Ce=new W0,P[ve]=Ce),Ce.getTargetRaySpace()},this.getControllerGrip=function(ve){let Ce=P[ve];return Ce===void 0&&(Ce=new W0,P[ve]=Ce),Ce.getGripSpace()},this.getHand=function(ve){let Ce=P[ve];return Ce===void 0&&(Ce=new W0,P[ve]=Ce),Ce.getHandSpace()};function he(ve){const Ce=O.indexOf(ve.inputSource);if(Ce===-1)return;const tt=P[Ce];tt!==void 0&&(tt.update(ve.inputSource,ve.frame,p||l),tt.dispatchEvent({type:ve.type,data:ve.inputSource}))}function H(){i.removeEventListener("select",he),i.removeEventListener("selectstart",he),i.removeEventListener("selectend",he),i.removeEventListener("squeeze",he),i.removeEventListener("squeezestart",he),i.removeEventListener("squeezeend",he),i.removeEventListener("end",H),i.removeEventListener("inputsourceschange",Y);for(let ve=0;ve<P.length;ve++){const Ce=O[ve];Ce!==null&&(O[ve]=null,P[ve].disconnect(Ce))}ee=null,ie=null,T.reset();for(const ve in M)delete M[ve];e.setRenderTarget(D),x=null,y=null,v=null,i=null,L=null,it.stop(),n.isPresenting=!1,e.setPixelRatio(V),e.setSize(z.width,z.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(ve){o=ve,n.isPresenting===!0&&Ot("WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(ve){h=ve,n.isPresenting===!0&&Ot("WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return p||l},this.setReferenceSpace=function(ve){p=ve},this.getBaseLayer=function(){return y!==null?y:x},this.getBinding=function(){return v===null&&R&&(v=new XRWebGLBinding(i,t)),v},this.getFrame=function(){return b},this.getSession=function(){return i},this.setSession=async function(ve){if(i=ve,i!==null){if(D=e.getRenderTarget(),i.addEventListener("select",he),i.addEventListener("selectstart",he),i.addEventListener("selectend",he),i.addEventListener("squeeze",he),i.addEventListener("squeezestart",he),i.addEventListener("squeezeend",he),i.addEventListener("end",H),i.addEventListener("inputsourceschange",Y),w.xrCompatible!==!0&&await t.makeXRCompatible(),V=e.getPixelRatio(),e.getSize(z),R&&"createProjectionLayer"in XRWebGLBinding.prototype){let tt=null,Et=null,wt=null;w.depth&&(wt=w.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,tt=w.stencil?yc:Ho,Et=w.stencil?sh:dr);const on={colorFormat:t.RGBA8,depthFormat:wt,scaleFactor:o};v=this.getBinding(),y=v.createProjectionLayer(on),i.updateRenderState({layers:[y]}),e.setPixelRatio(1),e.setSize(y.textureWidth,y.textureHeight,!1),L=new Ds(y.textureWidth,y.textureHeight,{format:ga,type:Xa,depthTexture:new Uh(y.textureWidth,y.textureHeight,Et,void 0,void 0,void 0,void 0,void 0,void 0,tt),stencilBuffer:w.stencil,colorSpace:e.outputColorSpace,samples:w.antialias?4:0,resolveDepthBuffer:y.ignoreDepthValues===!1,resolveStencilBuffer:y.ignoreDepthValues===!1})}else{const tt={antialias:w.antialias,alpha:!0,depth:w.depth,stencil:w.stencil,framebufferScaleFactor:o};x=new XRWebGLLayer(i,t,tt),i.updateRenderState({baseLayer:x}),e.setPixelRatio(1),e.setSize(x.framebufferWidth,x.framebufferHeight,!1),L=new Ds(x.framebufferWidth,x.framebufferHeight,{format:ga,type:Xa,colorSpace:e.outputColorSpace,stencilBuffer:w.stencil,resolveDepthBuffer:x.ignoreDepthValues===!1,resolveStencilBuffer:x.ignoreDepthValues===!1})}L.isXRRenderTarget=!0,this.setFoveation(d),p=null,l=await i.requestReferenceSpace(h),it.setContext(i),it.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode},this.getDepthTexture=function(){return T.getDepthTexture()};function Y(ve){for(let Ce=0;Ce<ve.removed.length;Ce++){const tt=ve.removed[Ce],Et=O.indexOf(tt);Et>=0&&(O[Et]=null,P[Et].disconnect(tt))}for(let Ce=0;Ce<ve.added.length;Ce++){const tt=ve.added[Ce];let Et=O.indexOf(tt);if(Et===-1){for(let on=0;on<P.length;on++)if(on>=O.length){O.push(tt),Et=on;break}else if(O[on]===null){O[on]=tt,Et=on;break}if(Et===-1)break}const wt=P[Et];wt&&wt.connect(tt)}}const $=new Z,ye=new Z;function _e(ve,Ce,tt){$.setFromMatrixPosition(Ce.matrixWorld),ye.setFromMatrixPosition(tt.matrixWorld);const Et=$.distanceTo(ye),wt=Ce.projectionMatrix.elements,on=tt.projectionMatrix.elements,It=wt[14]/(wt[10]-1),mt=wt[14]/(wt[10]+1),me=(wt[9]+1)/wt[5],Le=(wt[9]-1)/wt[5],Ue=(wt[8]-1)/wt[0],rt=(on[8]+1)/on[0],Q=It*Ue,Kt=It*rt,_t=Et/(-Ue+rt),Ft=_t*-Ue;if(Ce.matrixWorld.decompose(ve.position,ve.quaternion,ve.scale),ve.translateX(Ft),ve.translateZ(_t),ve.matrixWorld.compose(ve.position,ve.quaternion,ve.scale),ve.matrixWorldInverse.copy(ve.matrixWorld).invert(),wt[10]===-1)ve.projectionMatrix.copy(Ce.projectionMatrix),ve.projectionMatrixInverse.copy(Ce.projectionMatrixInverse);else{const yt=It+_t,j=mt+_t,I=Q-Ft,ue=Kt+(Et-Ft),Ie=me*mt/j*yt,Xe=Le*mt/j*yt;ve.projectionMatrix.makePerspective(I,ue,Ie,Xe,yt,j),ve.projectionMatrixInverse.copy(ve.projectionMatrix).invert()}}function W(ve,Ce){Ce===null?ve.matrixWorld.copy(ve.matrix):ve.matrixWorld.multiplyMatrices(Ce.matrixWorld,ve.matrix),ve.matrixWorldInverse.copy(ve.matrixWorld).invert()}this.updateCamera=function(ve){if(i===null)return;let Ce=ve.near,tt=ve.far;T.texture!==null&&(T.depthNear>0&&(Ce=T.depthNear),T.depthFar>0&&(tt=T.depthFar)),ne.near=F.near=N.near=Ce,ne.far=F.far=N.far=tt,(ee!==ne.near||ie!==ne.far)&&(i.updateRenderState({depthNear:ne.near,depthFar:ne.far}),ee=ne.near,ie=ne.far),ne.layers.mask=ve.layers.mask|6,N.layers.mask=ne.layers.mask&3,F.layers.mask=ne.layers.mask&5;const Et=ve.parent,wt=ne.cameras;W(ne,Et);for(let on=0;on<wt.length;on++)W(wt[on],Et);wt.length===2?_e(ne,N,F):ne.projectionMatrix.copy(N.projectionMatrix),ae(ve,ne,Et)};function ae(ve,Ce,tt){tt===null?ve.matrix.copy(Ce.matrixWorld):(ve.matrix.copy(tt.matrixWorld),ve.matrix.invert(),ve.matrix.multiply(Ce.matrixWorld)),ve.matrix.decompose(ve.position,ve.quaternion,ve.scale),ve.updateMatrixWorld(!0),ve.projectionMatrix.copy(Ce.projectionMatrix),ve.projectionMatrixInverse.copy(Ce.projectionMatrixInverse),ve.isPerspectiveCamera&&(ve.fov=ch*2*Math.atan(1/ve.projectionMatrix.elements[5]),ve.zoom=1)}this.getCamera=function(){return ne},this.getFoveation=function(){if(!(y===null&&x===null))return d},this.setFoveation=function(ve){d=ve,y!==null&&(y.fixedFoveation=ve),x!==null&&x.fixedFoveation!==void 0&&(x.fixedFoveation=ve)},this.hasDepthSensing=function(){return T.texture!==null},this.getDepthSensingMesh=function(){return T.getMesh(ne)},this.getCameraTexture=function(ve){return M[ve]};let Me=null;function Ne(ve,Ce){if(_=Ce.getViewerPose(p||l),b=Ce,_!==null){const tt=_.views;x!==null&&(e.setRenderTargetFramebuffer(L,x.framebuffer),e.setRenderTarget(L));let Et=!1;tt.length!==ne.cameras.length&&(ne.cameras.length=0,Et=!0);for(let mt=0;mt<tt.length;mt++){const me=tt[mt];let Le=null;if(x!==null)Le=x.getViewport(me);else{const rt=v.getViewSubImage(y,me);Le=rt.viewport,mt===0&&(e.setRenderTargetTextures(L,rt.colorTexture,rt.depthStencilTexture),e.setRenderTarget(L))}let Ue=K[mt];Ue===void 0&&(Ue=new Ea,Ue.layers.enable(mt),Ue.viewport=new Ti,K[mt]=Ue),Ue.matrix.fromArray(me.transform.matrix),Ue.matrix.decompose(Ue.position,Ue.quaternion,Ue.scale),Ue.projectionMatrix.fromArray(me.projectionMatrix),Ue.projectionMatrixInverse.copy(Ue.projectionMatrix).invert(),Ue.viewport.set(Le.x,Le.y,Le.width,Le.height),mt===0&&(ne.matrix.copy(Ue.matrix),ne.matrix.decompose(ne.position,ne.quaternion,ne.scale)),Et===!0&&ne.cameras.push(Ue)}const wt=i.enabledFeatures;if(wt&&wt.includes("depth-sensing")&&i.depthUsage=="gpu-optimized"&&R){v=n.getBinding();const mt=v.getDepthInformation(tt[0]);mt&&mt.isValid&&mt.texture&&T.init(mt,i.renderState)}if(wt&&wt.includes("camera-access")&&R){e.state.unbindTexture(),v=n.getBinding();for(let mt=0;mt<tt.length;mt++){const me=tt[mt].camera;if(me){let Le=M[me];Le||(Le=new Jx,M[me]=Le);const Ue=v.getCameraImage(me);Le.sourceTexture=Ue}}}}for(let tt=0;tt<P.length;tt++){const Et=O[tt],wt=P[tt];Et!==null&&wt!==void 0&&wt.update(Et,Ce,p||l)}Me&&Me(ve,Ce),Ce.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:Ce}),b=null}const it=new xE;it.setAnimationLoop(Ne),this.setAnimationLoop=function(ve){Me=ve},this.dispose=function(){}}}const lf=new vr,AU=new cn;function SU(s,e){function t(T,M){T.matrixAutoUpdate===!0&&T.updateMatrix(),M.value.copy(T.matrix)}function n(T,M){M.color.getRGB(T.fogColor.value,Pb(s)),M.isFog?(T.fogNear.value=M.near,T.fogFar.value=M.far):M.isFogExp2&&(T.fogDensity.value=M.density)}function i(T,M,w,D,L){M.isMeshBasicMaterial||M.isMeshLambertMaterial?o(T,M):M.isMeshToonMaterial?(o(T,M),v(T,M)):M.isMeshPhongMaterial?(o(T,M),_(T,M)):M.isMeshStandardMaterial?(o(T,M),y(T,M),M.isMeshPhysicalMaterial&&x(T,M,L)):M.isMeshMatcapMaterial?(o(T,M),b(T,M)):M.isMeshDepthMaterial?o(T,M):M.isMeshDistanceMaterial?(o(T,M),R(T,M)):M.isMeshNormalMaterial?o(T,M):M.isLineBasicMaterial?(l(T,M),M.isLineDashedMaterial&&h(T,M)):M.isPointsMaterial?d(T,M,w,D):M.isSpriteMaterial?p(T,M):M.isShadowMaterial?(T.color.value.copy(M.color),T.opacity.value=M.opacity):M.isShaderMaterial&&(M.uniformsNeedUpdate=!1)}function o(T,M){T.opacity.value=M.opacity,M.color&&T.diffuse.value.copy(M.color),M.emissive&&T.emissive.value.copy(M.emissive).multiplyScalar(M.emissiveIntensity),M.map&&(T.map.value=M.map,t(M.map,T.mapTransform)),M.alphaMap&&(T.alphaMap.value=M.alphaMap,t(M.alphaMap,T.alphaMapTransform)),M.bumpMap&&(T.bumpMap.value=M.bumpMap,t(M.bumpMap,T.bumpMapTransform),T.bumpScale.value=M.bumpScale,M.side===ws&&(T.bumpScale.value*=-1)),M.normalMap&&(T.normalMap.value=M.normalMap,t(M.normalMap,T.normalMapTransform),T.normalScale.value.copy(M.normalScale),M.side===ws&&T.normalScale.value.negate()),M.displacementMap&&(T.displacementMap.value=M.displacementMap,t(M.displacementMap,T.displacementMapTransform),T.displacementScale.value=M.displacementScale,T.displacementBias.value=M.displacementBias),M.emissiveMap&&(T.emissiveMap.value=M.emissiveMap,t(M.emissiveMap,T.emissiveMapTransform)),M.specularMap&&(T.specularMap.value=M.specularMap,t(M.specularMap,T.specularMapTransform)),M.alphaTest>0&&(T.alphaTest.value=M.alphaTest);const w=e.get(M),D=w.envMap,L=w.envMapRotation;D&&(T.envMap.value=D,lf.copy(L),lf.x*=-1,lf.y*=-1,lf.z*=-1,D.isCubeTexture&&D.isRenderTargetTexture===!1&&(lf.y*=-1,lf.z*=-1),T.envMapRotation.value.setFromMatrix4(AU.makeRotationFromEuler(lf)),T.flipEnvMap.value=D.isCubeTexture&&D.isRenderTargetTexture===!1?-1:1,T.reflectivity.value=M.reflectivity,T.ior.value=M.ior,T.refractionRatio.value=M.refractionRatio),M.lightMap&&(T.lightMap.value=M.lightMap,T.lightMapIntensity.value=M.lightMapIntensity,t(M.lightMap,T.lightMapTransform)),M.aoMap&&(T.aoMap.value=M.aoMap,T.aoMapIntensity.value=M.aoMapIntensity,t(M.aoMap,T.aoMapTransform))}function l(T,M){T.diffuse.value.copy(M.color),T.opacity.value=M.opacity,M.map&&(T.map.value=M.map,t(M.map,T.mapTransform))}function h(T,M){T.dashSize.value=M.dashSize,T.totalSize.value=M.dashSize+M.gapSize,T.scale.value=M.scale}function d(T,M,w,D){T.diffuse.value.copy(M.color),T.opacity.value=M.opacity,T.size.value=M.size*w,T.scale.value=D*.5,M.map&&(T.map.value=M.map,t(M.map,T.uvTransform)),M.alphaMap&&(T.alphaMap.value=M.alphaMap,t(M.alphaMap,T.alphaMapTransform)),M.alphaTest>0&&(T.alphaTest.value=M.alphaTest)}function p(T,M){T.diffuse.value.copy(M.color),T.opacity.value=M.opacity,T.rotation.value=M.rotation,M.map&&(T.map.value=M.map,t(M.map,T.mapTransform)),M.alphaMap&&(T.alphaMap.value=M.alphaMap,t(M.alphaMap,T.alphaMapTransform)),M.alphaTest>0&&(T.alphaTest.value=M.alphaTest)}function _(T,M){T.specular.value.copy(M.specular),T.shininess.value=Math.max(M.shininess,1e-4)}function v(T,M){M.gradientMap&&(T.gradientMap.value=M.gradientMap)}function y(T,M){T.metalness.value=M.metalness,M.metalnessMap&&(T.metalnessMap.value=M.metalnessMap,t(M.metalnessMap,T.metalnessMapTransform)),T.roughness.value=M.roughness,M.roughnessMap&&(T.roughnessMap.value=M.roughnessMap,t(M.roughnessMap,T.roughnessMapTransform)),M.envMap&&(T.envMapIntensity.value=M.envMapIntensity)}function x(T,M,w){T.ior.value=M.ior,M.sheen>0&&(T.sheenColor.value.copy(M.sheenColor).multiplyScalar(M.sheen),T.sheenRoughness.value=M.sheenRoughness,M.sheenColorMap&&(T.sheenColorMap.value=M.sheenColorMap,t(M.sheenColorMap,T.sheenColorMapTransform)),M.sheenRoughnessMap&&(T.sheenRoughnessMap.value=M.sheenRoughnessMap,t(M.sheenRoughnessMap,T.sheenRoughnessMapTransform))),M.clearcoat>0&&(T.clearcoat.value=M.clearcoat,T.clearcoatRoughness.value=M.clearcoatRoughness,M.clearcoatMap&&(T.clearcoatMap.value=M.clearcoatMap,t(M.clearcoatMap,T.clearcoatMapTransform)),M.clearcoatRoughnessMap&&(T.clearcoatRoughnessMap.value=M.clearcoatRoughnessMap,t(M.clearcoatRoughnessMap,T.clearcoatRoughnessMapTransform)),M.clearcoatNormalMap&&(T.clearcoatNormalMap.value=M.clearcoatNormalMap,t(M.clearcoatNormalMap,T.clearcoatNormalMapTransform),T.clearcoatNormalScale.value.copy(M.clearcoatNormalScale),M.side===ws&&T.clearcoatNormalScale.value.negate())),M.dispersion>0&&(T.dispersion.value=M.dispersion),M.iridescence>0&&(T.iridescence.value=M.iridescence,T.iridescenceIOR.value=M.iridescenceIOR,T.iridescenceThicknessMinimum.value=M.iridescenceThicknessRange[0],T.iridescenceThicknessMaximum.value=M.iridescenceThicknessRange[1],M.iridescenceMap&&(T.iridescenceMap.value=M.iridescenceMap,t(M.iridescenceMap,T.iridescenceMapTransform)),M.iridescenceThicknessMap&&(T.iridescenceThicknessMap.value=M.iridescenceThicknessMap,t(M.iridescenceThicknessMap,T.iridescenceThicknessMapTransform))),M.transmission>0&&(T.transmission.value=M.transmission,T.transmissionSamplerMap.value=w.texture,T.transmissionSamplerSize.value.set(w.width,w.height),M.transmissionMap&&(T.transmissionMap.value=M.transmissionMap,t(M.transmissionMap,T.transmissionMapTransform)),T.thickness.value=M.thickness,M.thicknessMap&&(T.thicknessMap.value=M.thicknessMap,t(M.thicknessMap,T.thicknessMapTransform)),T.attenuationDistance.value=M.attenuationDistance,T.attenuationColor.value.copy(M.attenuationColor)),M.anisotropy>0&&(T.anisotropyVector.value.set(M.anisotropy*Math.cos(M.anisotropyRotation),M.anisotropy*Math.sin(M.anisotropyRotation)),M.anisotropyMap&&(T.anisotropyMap.value=M.anisotropyMap,t(M.anisotropyMap,T.anisotropyMapTransform))),T.specularIntensity.value=M.specularIntensity,T.specularColor.value.copy(M.specularColor),M.specularColorMap&&(T.specularColorMap.value=M.specularColorMap,t(M.specularColorMap,T.specularColorMapTransform)),M.specularIntensityMap&&(T.specularIntensityMap.value=M.specularIntensityMap,t(M.specularIntensityMap,T.specularIntensityMapTransform))}function b(T,M){M.matcap&&(T.matcap.value=M.matcap)}function R(T,M){const w=e.get(M).light;T.referencePosition.value.setFromMatrixPosition(w.matrixWorld),T.nearDistance.value=w.shadow.camera.near,T.farDistance.value=w.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:i}}function MU(s,e,t,n){let i={},o={},l=[];const h=s.getParameter(s.MAX_UNIFORM_BUFFER_BINDINGS);function d(w,D){const L=D.program;n.uniformBlockBinding(w,L)}function p(w,D){let L=i[w.id];L===void 0&&(b(w),L=_(w),i[w.id]=L,w.addEventListener("dispose",T));const P=D.program;n.updateUBOMapping(w,P);const O=e.render.frame;o[w.id]!==O&&(y(w),o[w.id]=O)}function _(w){const D=v();w.__bindingPointIndex=D;const L=s.createBuffer(),P=w.__size,O=w.usage;return s.bindBuffer(s.UNIFORM_BUFFER,L),s.bufferData(s.UNIFORM_BUFFER,P,O),s.bindBuffer(s.UNIFORM_BUFFER,null),s.bindBufferBase(s.UNIFORM_BUFFER,D,L),L}function v(){for(let w=0;w<h;w++)if(l.indexOf(w)===-1)return l.push(w),w;return an("WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function y(w){const D=i[w.id],L=w.uniforms,P=w.__cache;s.bindBuffer(s.UNIFORM_BUFFER,D);for(let O=0,z=L.length;O<z;O++){const V=Array.isArray(L[O])?L[O]:[L[O]];for(let N=0,F=V.length;N<F;N++){const K=V[N];if(x(K,O,N,P)===!0){const ne=K.__offset,ee=Array.isArray(K.value)?K.value:[K.value];let ie=0;for(let he=0;he<ee.length;he++){const H=ee[he],Y=R(H);typeof H=="number"||typeof H=="boolean"?(K.__data[0]=H,s.bufferSubData(s.UNIFORM_BUFFER,ne+ie,K.__data)):H.isMatrix3?(K.__data[0]=H.elements[0],K.__data[1]=H.elements[1],K.__data[2]=H.elements[2],K.__data[3]=0,K.__data[4]=H.elements[3],K.__data[5]=H.elements[4],K.__data[6]=H.elements[5],K.__data[7]=0,K.__data[8]=H.elements[6],K.__data[9]=H.elements[7],K.__data[10]=H.elements[8],K.__data[11]=0):(H.toArray(K.__data,ie),ie+=Y.storage/Float32Array.BYTES_PER_ELEMENT)}s.bufferSubData(s.UNIFORM_BUFFER,ne,K.__data)}}}s.bindBuffer(s.UNIFORM_BUFFER,null)}function x(w,D,L,P){const O=w.value,z=D+"_"+L;if(P[z]===void 0)return typeof O=="number"||typeof O=="boolean"?P[z]=O:P[z]=O.clone(),!0;{const V=P[z];if(typeof O=="number"||typeof O=="boolean"){if(V!==O)return P[z]=O,!0}else if(V.equals(O)===!1)return V.copy(O),!0}return!1}function b(w){const D=w.uniforms;let L=0;const P=16;for(let z=0,V=D.length;z<V;z++){const N=Array.isArray(D[z])?D[z]:[D[z]];for(let F=0,K=N.length;F<K;F++){const ne=N[F],ee=Array.isArray(ne.value)?ne.value:[ne.value];for(let ie=0,he=ee.length;ie<he;ie++){const H=ee[ie],Y=R(H),$=L%P,ye=$%Y.boundary,_e=$+ye;L+=ye,_e!==0&&P-_e<Y.storage&&(L+=P-_e),ne.__data=new Float32Array(Y.storage/Float32Array.BYTES_PER_ELEMENT),ne.__offset=L,L+=Y.storage}}}const O=L%P;return O>0&&(L+=P-O),w.__size=L,w.__cache={},this}function R(w){const D={boundary:0,storage:0};return typeof w=="number"||typeof w=="boolean"?(D.boundary=4,D.storage=4):w.isVector2?(D.boundary=8,D.storage=8):w.isVector3||w.isColor?(D.boundary=16,D.storage=12):w.isVector4?(D.boundary=16,D.storage=16):w.isMatrix3?(D.boundary=48,D.storage=48):w.isMatrix4?(D.boundary=64,D.storage=64):w.isTexture?Ot("WebGLRenderer: Texture samplers can not be part of an uniforms group."):Ot("WebGLRenderer: Unsupported uniform value type.",w),D}function T(w){const D=w.target;D.removeEventListener("dispose",T);const L=l.indexOf(D.__bindingPointIndex);l.splice(L,1),s.deleteBuffer(i[D.id]),delete i[D.id],delete o[D.id]}function M(){for(const w in i)s.deleteBuffer(i[w]);l=[],i={},o={}}return{bind:d,update:p,dispose:M}}const bU=new Uint16Array([12469,15057,12620,14925,13266,14620,13807,14376,14323,13990,14545,13625,14713,13328,14840,12882,14931,12528,14996,12233,15039,11829,15066,11525,15080,11295,15085,10976,15082,10705,15073,10495,13880,14564,13898,14542,13977,14430,14158,14124,14393,13732,14556,13410,14702,12996,14814,12596,14891,12291,14937,11834,14957,11489,14958,11194,14943,10803,14921,10506,14893,10278,14858,9960,14484,14039,14487,14025,14499,13941,14524,13740,14574,13468,14654,13106,14743,12678,14818,12344,14867,11893,14889,11509,14893,11180,14881,10751,14852,10428,14812,10128,14765,9754,14712,9466,14764,13480,14764,13475,14766,13440,14766,13347,14769,13070,14786,12713,14816,12387,14844,11957,14860,11549,14868,11215,14855,10751,14825,10403,14782,10044,14729,9651,14666,9352,14599,9029,14967,12835,14966,12831,14963,12804,14954,12723,14936,12564,14917,12347,14900,11958,14886,11569,14878,11247,14859,10765,14828,10401,14784,10011,14727,9600,14660,9289,14586,8893,14508,8533,15111,12234,15110,12234,15104,12216,15092,12156,15067,12010,15028,11776,14981,11500,14942,11205,14902,10752,14861,10393,14812,9991,14752,9570,14682,9252,14603,8808,14519,8445,14431,8145,15209,11449,15208,11451,15202,11451,15190,11438,15163,11384,15117,11274,15055,10979,14994,10648,14932,10343,14871,9936,14803,9532,14729,9218,14645,8742,14556,8381,14461,8020,14365,7603,15273,10603,15272,10607,15267,10619,15256,10631,15231,10614,15182,10535,15118,10389,15042,10167,14963,9787,14883,9447,14800,9115,14710,8665,14615,8318,14514,7911,14411,7507,14279,7198,15314,9675,15313,9683,15309,9712,15298,9759,15277,9797,15229,9773,15166,9668,15084,9487,14995,9274,14898,8910,14800,8539,14697,8234,14590,7790,14479,7409,14367,7067,14178,6621,15337,8619,15337,8631,15333,8677,15325,8769,15305,8871,15264,8940,15202,8909,15119,8775,15022,8565,14916,8328,14804,8009,14688,7614,14569,7287,14448,6888,14321,6483,14088,6171,15350,7402,15350,7419,15347,7480,15340,7613,15322,7804,15287,7973,15229,8057,15148,8012,15046,7846,14933,7611,14810,7357,14682,7069,14552,6656,14421,6316,14251,5948,14007,5528,15356,5942,15356,5977,15353,6119,15348,6294,15332,6551,15302,6824,15249,7044,15171,7122,15070,7050,14949,6861,14818,6611,14679,6349,14538,6067,14398,5651,14189,5311,13935,4958,15359,4123,15359,4153,15356,4296,15353,4646,15338,5160,15311,5508,15263,5829,15188,6042,15088,6094,14966,6001,14826,5796,14678,5543,14527,5287,14377,4985,14133,4586,13869,4257,15360,1563,15360,1642,15358,2076,15354,2636,15341,3350,15317,4019,15273,4429,15203,4732,15105,4911,14981,4932,14836,4818,14679,4621,14517,4386,14359,4156,14083,3795,13808,3437,15360,122,15360,137,15358,285,15355,636,15344,1274,15322,2177,15281,2765,15215,3223,15120,3451,14995,3569,14846,3567,14681,3466,14511,3305,14344,3121,14037,2800,13753,2467,15360,0,15360,1,15359,21,15355,89,15346,253,15325,479,15287,796,15225,1148,15133,1492,15008,1749,14856,1882,14685,1886,14506,1783,14324,1608,13996,1398,13702,1183]);let Xo=null;function EU(){return Xo===null&&(Xo=new Or(bU,16,16,Bu,sa),Xo.name="DFG_LUT",Xo.minFilter=In,Xo.magFilter=In,Xo.wrapS=Gi,Xo.wrapT=Gi,Xo.generateMipmaps=!1,Xo.needsUpdate=!0),Xo}class zA{constructor(e={}){const{canvas:t=xb(),context:n=null,depth:i=!0,stencil:o=!1,alpha:l=!1,antialias:h=!1,premultipliedAlpha:d=!0,preserveDrawingBuffer:p=!1,powerPreference:_="default",failIfMajorPerformanceCaveat:v=!1,reversedDepthBuffer:y=!1,outputBufferType:x=Xa}=e;this.isWebGLRenderer=!0;let b;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");b=n.getContextAttributes().alpha}else b=l;const R=x,T=new Set([Yg,Xg,cp]),M=new Set([Xa,dr,ah,sh,Vg,kg]),w=new Uint32Array(4),D=new Int32Array(4);let L=null,P=null;const O=[],z=[];let V=null;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.toneMapping=Lr,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const N=this;let F=!1;this._outputColorSpace=ra;let K=0,ne=0,ee=null,ie=-1,he=null;const H=new Ti,Y=new Ti;let $=null;const ye=new Rt(0);let _e=0,W=t.width,ae=t.height,Me=1,Ne=null,it=null;const ve=new Ti(0,0,W,ae),Ce=new Ti(0,0,W,ae);let tt=!1;const Et=new Nh;let wt=!1,on=!1;const It=new cn,mt=new Z,me=new Ti,Le={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let Ue=!1;function rt(){return ee===null?Me:1}let Q=n;function Kt(k,te){return t.getContext(k,te)}try{const k={alpha:!0,depth:i,stencil:o,antialias:h,premultipliedAlpha:d,preserveDrawingBuffer:p,powerPreference:_,failIfMajorPerformanceCaveat:v};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${np}`),t.addEventListener("webglcontextlost",jt,!1),t.addEventListener("webglcontextrestored",Sn,!1),t.addEventListener("webglcontextcreationerror",bt,!1),Q===null){const te="webgl2";if(Q=Kt(te,k),Q===null)throw Kt(te)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(k){throw an("WebGLRenderer: "+k.message),k}let _t,Ft,yt,j,I,ue,Ie,Xe,Oe,Bt,gt,Ht,Xt,ze,qe,Tt,pt,st,qt,de,be,We,St,Ye;function Ve(){_t=new TL(Q),_t.init(),We=new qE(Q,_t),Ft=new vL(Q,_t,e,We),yt=new mU(Q,_t),Ft.reversedDepthBuffer&&y&&yt.buffers.depth.setReversed(!0),j=new wL(Q),I=new eU,ue=new gU(Q,_t,yt,I,Ft,We,j),Ie=new yL(N),Xe=new EL(N),Oe=new d3(Q),St=new mL(Q,Oe),Bt=new CL(Q,Oe,j,St),gt=new DL(Q,Bt,Oe,j),qt=new BL(Q,Ft,ue),Tt=new _L(I),Ht=new $N(N,Ie,Xe,_t,Ft,St,Tt),Xt=new SU(N,I),ze=new nU,qe=new lU(_t),st=new pL(N,Ie,Xe,yt,gt,b,d),pt=new dU(N,gt,Ft),Ye=new MU(Q,j,Ft,yt),de=new gL(Q,_t,j),be=new RL(Q,_t,j),j.programs=Ht.programs,N.capabilities=Ft,N.extensions=_t,N.properties=I,N.renderLists=ze,N.shadowMap=pt,N.state=yt,N.info=j}Ve(),R!==Xa&&(V=new NL(R,t.width,t.height,i,o));const ft=new xU(N,Q);this.xr=ft,this.getContext=function(){return Q},this.getContextAttributes=function(){return Q.getContextAttributes()},this.forceContextLoss=function(){const k=_t.get("WEBGL_lose_context");k&&k.loseContext()},this.forceContextRestore=function(){const k=_t.get("WEBGL_lose_context");k&&k.restoreContext()},this.getPixelRatio=function(){return Me},this.setPixelRatio=function(k){k!==void 0&&(Me=k,this.setSize(W,ae,!1))},this.getSize=function(k){return k.set(W,ae)},this.setSize=function(k,te,fe=!0){if(ft.isPresenting){Ot("WebGLRenderer: Can't change size while VR device is presenting.");return}W=k,ae=te,t.width=Math.floor(k*Me),t.height=Math.floor(te*Me),fe===!0&&(t.style.width=k+"px",t.style.height=te+"px"),V!==null&&V.setSize(t.width,t.height),this.setViewport(0,0,k,te)},this.getDrawingBufferSize=function(k){return k.set(W*Me,ae*Me).floor()},this.setDrawingBufferSize=function(k,te,fe){W=k,ae=te,Me=fe,t.width=Math.floor(k*fe),t.height=Math.floor(te*fe),this.setViewport(0,0,k,te)},this.setEffects=function(k){if(R===Xa){console.error("THREE.WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");return}if(k){for(let te=0;te<k.length;te++)if(k[te].isOutputPass===!0){console.warn("THREE.WebGLRenderer: OutputPass is not needed in setEffects(). Tone mapping and color space conversion are applied automatically.");break}}V.setEffects(k||[])},this.getCurrentViewport=function(k){return k.copy(H)},this.getViewport=function(k){return k.copy(ve)},this.setViewport=function(k,te,fe,ce){k.isVector4?ve.set(k.x,k.y,k.z,k.w):ve.set(k,te,fe,ce),yt.viewport(H.copy(ve).multiplyScalar(Me).round())},this.getScissor=function(k){return k.copy(Ce)},this.setScissor=function(k,te,fe,ce){k.isVector4?Ce.set(k.x,k.y,k.z,k.w):Ce.set(k,te,fe,ce),yt.scissor(Y.copy(Ce).multiplyScalar(Me).round())},this.getScissorTest=function(){return tt},this.setScissorTest=function(k){yt.setScissorTest(tt=k)},this.setOpaqueSort=function(k){Ne=k},this.setTransparentSort=function(k){it=k},this.getClearColor=function(k){return k.copy(st.getClearColor())},this.setClearColor=function(){st.setClearColor(...arguments)},this.getClearAlpha=function(){return st.getClearAlpha()},this.setClearAlpha=function(){st.setClearAlpha(...arguments)},this.clear=function(k=!0,te=!0,fe=!0){let ce=0;if(k){let le=!1;if(ee!==null){const Qe=ee.texture.format;le=T.has(Qe)}if(le){const Qe=ee.texture.type,lt=M.has(Qe),ct=st.getClearColor(),Ct=st.getClearAlpha(),xt=ct.r,Yt=ct.g,At=ct.b;lt?(w[0]=xt,w[1]=Yt,w[2]=At,w[3]=Ct,Q.clearBufferuiv(Q.COLOR,0,w)):(D[0]=xt,D[1]=Yt,D[2]=At,D[3]=Ct,Q.clearBufferiv(Q.COLOR,0,D))}else ce|=Q.COLOR_BUFFER_BIT}te&&(ce|=Q.DEPTH_BUFFER_BIT),fe&&(ce|=Q.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),Q.clear(ce)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",jt,!1),t.removeEventListener("webglcontextrestored",Sn,!1),t.removeEventListener("webglcontextcreationerror",bt,!1),st.dispose(),ze.dispose(),qe.dispose(),I.dispose(),Ie.dispose(),Xe.dispose(),gt.dispose(),St.dispose(),Ye.dispose(),Ht.dispose(),ft.dispose(),ft.removeEventListener("sessionstart",Ia),ft.removeEventListener("sessionend",vi),en.stop()};function jt(k){k.preventDefault(),xp("WebGLRenderer: Context Lost."),F=!0}function Sn(){xp("WebGLRenderer: Context Restored."),F=!1;const k=j.autoReset,te=pt.enabled,fe=pt.autoUpdate,ce=pt.needsUpdate,le=pt.type;Ve(),j.autoReset=k,pt.enabled=te,pt.autoUpdate=fe,pt.needsUpdate=ce,pt.type=le}function bt(k){an("WebGLRenderer: A WebGL context could not be created. Reason: ",k.statusMessage)}function Dn(k){const te=k.target;te.removeEventListener("dispose",Dn),Nn(te)}function Nn(k){Ni(k),I.remove(k)}function Ni(k){const te=I.get(k).programs;te!==void 0&&(te.forEach(function(fe){Ht.releaseProgram(fe)}),k.isShaderMaterial&&Ht.releaseShaderCache(k))}this.renderBufferDirect=function(k,te,fe,ce,le,Qe){te===null&&(te=Le);const lt=le.isMesh&&le.matrixWorld.determinant()<0,ct=ot(k,te,fe,ce,le);yt.setMaterial(ce,lt);let Ct=fe.index,xt=1;if(ce.wireframe===!0){if(Ct=Bt.getWireframeAttribute(fe),Ct===void 0)return;xt=2}const Yt=fe.drawRange,At=fe.attributes.position;let zt=Yt.start*xt,mn=(Yt.start+Yt.count)*xt;Qe!==null&&(zt=Math.max(zt,Qe.start*xt),mn=Math.min(mn,(Qe.start+Qe.count)*xt)),Ct!==null?(zt=Math.max(zt,0),mn=Math.min(mn,Ct.count)):At!=null&&(zt=Math.max(zt,0),mn=Math.min(mn,At.count));const Pn=mn-zt;if(Pn<0||Pn===1/0)return;St.setup(le,ce,ct,fe,Ct);let Mn,Qt=de;if(Ct!==null&&(Mn=Oe.get(Ct),Qt=be,Qt.setIndex(Mn)),le.isMesh)ce.wireframe===!0?(yt.setLineWidth(ce.wireframeLinewidth*rt()),Qt.setMode(Q.LINES)):Qt.setMode(Q.TRIANGLES);else if(le.isLine){let Dt=ce.linewidth;Dt===void 0&&(Dt=1),yt.setLineWidth(Dt*rt()),le.isLineSegments?Qt.setMode(Q.LINES):le.isLineLoop?Qt.setMode(Q.LINE_LOOP):Qt.setMode(Q.LINE_STRIP)}else le.isPoints?Qt.setMode(Q.POINTS):le.isSprite&&Qt.setMode(Q.TRIANGLES);if(le.isBatchedMesh)if(le._multiDrawInstances!==null)lh("WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),Qt.renderMultiDrawInstances(le._multiDrawStarts,le._multiDrawCounts,le._multiDrawCount,le._multiDrawInstances);else if(_t.get("WEBGL_multi_draw"))Qt.renderMultiDraw(le._multiDrawStarts,le._multiDrawCounts,le._multiDrawCount);else{const Dt=le._multiDrawStarts,$t=le._multiDrawCounts,Lt=le._multiDrawCount,ei=Ct?Oe.get(Ct).bytesPerElement:1,Qi=I.get(ce).currentProgram.getUniforms();for(let Gn=0;Gn<Lt;Gn++)Qi.setValue(Q,"_gl_DrawID",Gn),Qt.render(Dt[Gn]/ei,$t[Gn])}else if(le.isInstancedMesh)Qt.renderInstances(zt,Pn,le.count);else if(fe.isInstancedBufferGeometry){const Dt=fe._maxInstanceCount!==void 0?fe._maxInstanceCount:1/0,$t=Math.min(fe.instanceCount,Dt);Qt.renderInstances(zt,Pn,$t)}else Qt.render(zt,Pn)};function fa(k,te,fe){k.transparent===!0&&k.side===hr&&k.forceSinglePass===!1?(k.side=ws,k.needsUpdate=!0,Re(k,te,fe),k.side=ao,k.needsUpdate=!0,Re(k,te,fe),k.side=hr):Re(k,te,fe)}this.compile=function(k,te,fe=null){fe===null&&(fe=k),P=qe.get(fe),P.init(te),z.push(P),fe.traverseVisible(function(le){le.isLight&&le.layers.test(te.layers)&&(P.pushLight(le),le.castShadow&&P.pushShadow(le))}),k!==fe&&k.traverseVisible(function(le){le.isLight&&le.layers.test(te.layers)&&(P.pushLight(le),le.castShadow&&P.pushShadow(le))}),P.setupLights();const ce=new Set;return k.traverse(function(le){if(!(le.isMesh||le.isPoints||le.isLine||le.isSprite))return;const Qe=le.material;if(Qe)if(Array.isArray(Qe))for(let lt=0;lt<Qe.length;lt++){const ct=Qe[lt];fa(ct,fe,le),ce.add(ct)}else fa(Qe,fe,le),ce.add(Qe)}),P=z.pop(),ce},this.compileAsync=function(k,te,fe=null){const ce=this.compile(k,te,fe);return new Promise(le=>{function Qe(){if(ce.forEach(function(lt){I.get(lt).currentProgram.isReady()&&ce.delete(lt)}),ce.size===0){le(k);return}setTimeout(Qe,10)}_t.get("KHR_parallel_shader_compile")!==null?Qe():setTimeout(Qe,10)})};let Ui=null;function Zi(k){Ui&&Ui(k)}function Ia(){en.stop()}function vi(){en.start()}const en=new xE;en.setAnimationLoop(Zi),typeof self<"u"&&en.setContext(self),this.setAnimationLoop=function(k){Ui=k,ft.setAnimationLoop(k),k===null?en.stop():en.start()},ft.addEventListener("sessionstart",Ia),ft.addEventListener("sessionend",vi),this.render=function(k,te){if(te!==void 0&&te.isCamera!==!0){an("WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(F===!0)return;const fe=ft.enabled===!0&&ft.isPresenting===!0,ce=V!==null&&(ee===null||fe)&&V.begin(N,ee);if(k.matrixWorldAutoUpdate===!0&&k.updateMatrixWorld(),te.parent===null&&te.matrixWorldAutoUpdate===!0&&te.updateMatrixWorld(),ft.enabled===!0&&ft.isPresenting===!0&&(V===null||V.isCompositing()===!1)&&(ft.cameraAutoUpdate===!0&&ft.updateCamera(te),te=ft.getCamera()),k.isScene===!0&&k.onBeforeRender(N,k,te,ee),P=qe.get(k,z.length),P.init(te),z.push(P),It.multiplyMatrices(te.projectionMatrix,te.matrixWorldInverse),Et.setFromProjectionMatrix(It,pr,te.reversedDepth),on=this.localClippingEnabled,wt=Tt.init(this.clippingPlanes,on),L=ze.get(k,O.length),L.init(),O.push(L),ft.enabled===!0&&ft.isPresenting===!0){const lt=N.xr.getDepthSensingMesh();lt!==null&&ci(lt,te,-1/0,N.sortObjects)}ci(k,te,0,N.sortObjects),L.finish(),N.sortObjects===!0&&L.sort(Ne,it),Ue=ft.enabled===!1||ft.isPresenting===!1||ft.hasDepthSensing()===!1,Ue&&st.addToRenderList(L,k),this.info.render.frame++,wt===!0&&Tt.beginShadows();const le=P.state.shadowsArray;if(pt.render(le,k,te),wt===!0&&Tt.endShadows(),this.info.autoReset===!0&&this.info.reset(),(ce&&V.hasRenderPass())===!1){const lt=L.opaque,ct=L.transmissive;if(P.setupLights(),te.isArrayCamera){const Ct=te.cameras;if(ct.length>0)for(let xt=0,Yt=Ct.length;xt<Yt;xt++){const At=Ct[xt];G(lt,ct,k,At)}Ue&&st.render(k);for(let xt=0,Yt=Ct.length;xt<Yt;xt++){const At=Ct[xt];fn(L,k,At,At.viewport)}}else ct.length>0&&G(lt,ct,k,te),Ue&&st.render(k),fn(L,k,te)}ee!==null&&ne===0&&(ue.updateMultisampleRenderTarget(ee),ue.updateRenderTargetMipmap(ee)),ce&&V.end(N),k.isScene===!0&&k.onAfterRender(N,k,te),St.resetDefaultState(),ie=-1,he=null,z.pop(),z.length>0?(P=z[z.length-1],wt===!0&&Tt.setGlobalState(N.clippingPlanes,P.state.camera)):P=null,O.pop(),O.length>0?L=O[O.length-1]:L=null};function ci(k,te,fe,ce){if(k.visible===!1)return;if(k.layers.test(te.layers)){if(k.isGroup)fe=k.renderOrder;else if(k.isLOD)k.autoUpdate===!0&&k.update(te);else if(k.isLight)P.pushLight(k),k.castShadow&&P.pushShadow(k);else if(k.isSprite){if(!k.frustumCulled||Et.intersectsSprite(k)){ce&&me.setFromMatrixPosition(k.matrixWorld).applyMatrix4(It);const lt=gt.update(k),ct=k.material;ct.visible&&L.push(k,lt,ct,fe,me.z,null)}}else if((k.isMesh||k.isLine||k.isPoints)&&(!k.frustumCulled||Et.intersectsObject(k))){const lt=gt.update(k),ct=k.material;if(ce&&(k.boundingSphere!==void 0?(k.boundingSphere===null&&k.computeBoundingSphere(),me.copy(k.boundingSphere.center)):(lt.boundingSphere===null&&lt.computeBoundingSphere(),me.copy(lt.boundingSphere.center)),me.applyMatrix4(k.matrixWorld).applyMatrix4(It)),Array.isArray(ct)){const Ct=lt.groups;for(let xt=0,Yt=Ct.length;xt<Yt;xt++){const At=Ct[xt],zt=ct[At.materialIndex];zt&&zt.visible&&L.push(k,lt,zt,fe,me.z,At)}}else ct.visible&&L.push(k,lt,ct,fe,me.z,null)}}const Qe=k.children;for(let lt=0,ct=Qe.length;lt<ct;lt++)ci(Qe[lt],te,fe,ce)}function fn(k,te,fe,ce){const{opaque:le,transmissive:Qe,transparent:lt}=k;P.setupLightsView(fe),wt===!0&&Tt.setGlobalState(N.clippingPlanes,fe),ce&&yt.viewport(H.copy(ce)),le.length>0&&J(le,te,fe),Qe.length>0&&J(Qe,te,fe),lt.length>0&&J(lt,te,fe),yt.buffers.depth.setTest(!0),yt.buffers.depth.setMask(!0),yt.buffers.color.setMask(!0),yt.setPolygonOffset(!1)}function G(k,te,fe,ce){if((fe.isScene===!0?fe.overrideMaterial:null)!==null)return;if(P.state.transmissionRenderTarget[ce.id]===void 0){const zt=_t.has("EXT_color_buffer_half_float")||_t.has("EXT_color_buffer_float");P.state.transmissionRenderTarget[ce.id]=new Ds(1,1,{generateMipmaps:!0,type:zt?sa:Xa,minFilter:$s,samples:Ft.samples,stencilBuffer:o,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Hn.workingColorSpace})}const Qe=P.state.transmissionRenderTarget[ce.id],lt=ce.viewport||H;Qe.setSize(lt.z*N.transmissionResolutionScale,lt.w*N.transmissionResolutionScale);const ct=N.getRenderTarget(),Ct=N.getActiveCubeFace(),xt=N.getActiveMipmapLevel();N.setRenderTarget(Qe),N.getClearColor(ye),_e=N.getClearAlpha(),_e<1&&N.setClearColor(16777215,.5),N.clear(),Ue&&st.render(fe);const Yt=N.toneMapping;N.toneMapping=Lr;const At=ce.viewport;if(ce.viewport!==void 0&&(ce.viewport=void 0),P.setupLightsView(ce),wt===!0&&Tt.setGlobalState(N.clippingPlanes,ce),J(k,fe,ce),ue.updateMultisampleRenderTarget(Qe),ue.updateRenderTargetMipmap(Qe),_t.has("WEBGL_multisampled_render_to_texture")===!1){let zt=!1;for(let mn=0,Pn=te.length;mn<Pn;mn++){const Mn=te[mn],{object:Qt,geometry:Dt,material:$t,group:Lt}=Mn;if($t.side===hr&&Qt.layers.test(ce.layers)){const ei=$t.side;$t.side=ws,$t.needsUpdate=!0,oe(Qt,fe,ce,Dt,$t,Lt),$t.side=ei,$t.needsUpdate=!0,zt=!0}}zt===!0&&(ue.updateMultisampleRenderTarget(Qe),ue.updateRenderTargetMipmap(Qe))}N.setRenderTarget(ct,Ct,xt),N.setClearColor(ye,_e),At!==void 0&&(ce.viewport=At),N.toneMapping=Yt}function J(k,te,fe){const ce=te.isScene===!0?te.overrideMaterial:null;for(let le=0,Qe=k.length;le<Qe;le++){const lt=k[le],{object:ct,geometry:Ct,group:xt}=lt;let Yt=lt.material;Yt.allowOverride===!0&&ce!==null&&(Yt=ce),ct.layers.test(fe.layers)&&oe(ct,te,fe,Ct,Yt,xt)}}function oe(k,te,fe,ce,le,Qe){k.onBeforeRender(N,te,fe,ce,le,Qe),k.modelViewMatrix.multiplyMatrices(fe.matrixWorldInverse,k.matrixWorld),k.normalMatrix.getNormalMatrix(k.modelViewMatrix),le.onBeforeRender(N,te,fe,ce,k,Qe),le.transparent===!0&&le.side===hr&&le.forceSinglePass===!1?(le.side=ws,le.needsUpdate=!0,N.renderBufferDirect(fe,te,ce,le,k,Qe),le.side=ao,le.needsUpdate=!0,N.renderBufferDirect(fe,te,ce,le,k,Qe),le.side=hr):N.renderBufferDirect(fe,te,ce,le,k,Qe),k.onAfterRender(N,te,fe,ce,le,Qe)}function Re(k,te,fe){te.isScene!==!0&&(te=Le);const ce=I.get(k),le=P.state.lights,Qe=P.state.shadowsArray,lt=le.state.version,ct=Ht.getParameters(k,le.state,Qe,te,fe),Ct=Ht.getProgramCacheKey(ct);let xt=ce.programs;ce.environment=k.isMeshStandardMaterial?te.environment:null,ce.fog=te.fog,ce.envMap=(k.isMeshStandardMaterial?Xe:Ie).get(k.envMap||ce.environment),ce.envMapRotation=ce.environment!==null&&k.envMap===null?te.environmentRotation:k.envMapRotation,xt===void 0&&(k.addEventListener("dispose",Dn),xt=new Map,ce.programs=xt);let Yt=xt.get(Ct);if(Yt!==void 0){if(ce.currentProgram===Yt&&ce.lightsStateVersion===lt)return He(k,ct),Yt}else ct.uniforms=Ht.getUniforms(k),k.onBeforeCompile(ct,N),Yt=Ht.acquireProgram(ct,Ct),xt.set(Ct,Yt),ce.uniforms=ct.uniforms;const At=ce.uniforms;return(!k.isShaderMaterial&&!k.isRawShaderMaterial||k.clipping===!0)&&(At.clippingPlanes=Tt.uniform),He(k,ct),ce.needsLights=Ze(k),ce.lightsStateVersion=lt,ce.needsLights&&(At.ambientLightColor.value=le.state.ambient,At.lightProbe.value=le.state.probe,At.directionalLights.value=le.state.directional,At.directionalLightShadows.value=le.state.directionalShadow,At.spotLights.value=le.state.spot,At.spotLightShadows.value=le.state.spotShadow,At.rectAreaLights.value=le.state.rectArea,At.ltc_1.value=le.state.rectAreaLTC1,At.ltc_2.value=le.state.rectAreaLTC2,At.pointLights.value=le.state.point,At.pointLightShadows.value=le.state.pointShadow,At.hemisphereLights.value=le.state.hemi,At.directionalShadowMap.value=le.state.directionalShadowMap,At.directionalShadowMatrix.value=le.state.directionalShadowMatrix,At.spotShadowMap.value=le.state.spotShadowMap,At.spotLightMatrix.value=le.state.spotLightMatrix,At.spotLightMap.value=le.state.spotLightMap,At.pointShadowMap.value=le.state.pointShadowMap,At.pointShadowMatrix.value=le.state.pointShadowMatrix),ce.currentProgram=Yt,ce.uniformsList=null,Yt}function Pe(k){if(k.uniformsList===null){const te=k.currentProgram.getUniforms();k.uniformsList=e_.seqWithValue(te.seq,k.uniforms)}return k.uniformsList}function He(k,te){const fe=I.get(k);fe.outputColorSpace=te.outputColorSpace,fe.batching=te.batching,fe.batchingColor=te.batchingColor,fe.instancing=te.instancing,fe.instancingColor=te.instancingColor,fe.instancingMorph=te.instancingMorph,fe.skinning=te.skinning,fe.morphTargets=te.morphTargets,fe.morphNormals=te.morphNormals,fe.morphColors=te.morphColors,fe.morphTargetsCount=te.morphTargetsCount,fe.numClippingPlanes=te.numClippingPlanes,fe.numIntersection=te.numClipIntersection,fe.vertexAlphas=te.vertexAlphas,fe.vertexTangents=te.vertexTangents,fe.toneMapping=te.toneMapping}function ot(k,te,fe,ce,le){te.isScene!==!0&&(te=Le),ue.resetTextureUnits();const Qe=te.fog,lt=ce.isMeshStandardMaterial?te.environment:null,ct=ee===null?N.outputColorSpace:ee.isXRRenderTarget===!0?ee.texture.colorSpace:Ma,Ct=(ce.isMeshStandardMaterial?Xe:Ie).get(ce.envMap||lt),xt=ce.vertexColors===!0&&!!fe.attributes.color&&fe.attributes.color.itemSize===4,Yt=!!fe.attributes.tangent&&(!!ce.normalMap||ce.anisotropy>0),At=!!fe.morphAttributes.position,zt=!!fe.morphAttributes.normal,mn=!!fe.morphAttributes.color;let Pn=Lr;ce.toneMapped&&(ee===null||ee.isXRRenderTarget===!0)&&(Pn=N.toneMapping);const Mn=fe.morphAttributes.position||fe.morphAttributes.normal||fe.morphAttributes.color,Qt=Mn!==void 0?Mn.length:0,Dt=I.get(ce),$t=P.state.lights;if(wt===!0&&(on===!0||k!==he)){const ut=k===he&&ce.id===ie;Tt.setState(ce,k,ut)}let Lt=!1;ce.version===Dt.__version?(Dt.needsLights&&Dt.lightsStateVersion!==$t.state.version||Dt.outputColorSpace!==ct||le.isBatchedMesh&&Dt.batching===!1||!le.isBatchedMesh&&Dt.batching===!0||le.isBatchedMesh&&Dt.batchingColor===!0&&le.colorTexture===null||le.isBatchedMesh&&Dt.batchingColor===!1&&le.colorTexture!==null||le.isInstancedMesh&&Dt.instancing===!1||!le.isInstancedMesh&&Dt.instancing===!0||le.isSkinnedMesh&&Dt.skinning===!1||!le.isSkinnedMesh&&Dt.skinning===!0||le.isInstancedMesh&&Dt.instancingColor===!0&&le.instanceColor===null||le.isInstancedMesh&&Dt.instancingColor===!1&&le.instanceColor!==null||le.isInstancedMesh&&Dt.instancingMorph===!0&&le.morphTexture===null||le.isInstancedMesh&&Dt.instancingMorph===!1&&le.morphTexture!==null||Dt.envMap!==Ct||ce.fog===!0&&Dt.fog!==Qe||Dt.numClippingPlanes!==void 0&&(Dt.numClippingPlanes!==Tt.numPlanes||Dt.numIntersection!==Tt.numIntersection)||Dt.vertexAlphas!==xt||Dt.vertexTangents!==Yt||Dt.morphTargets!==At||Dt.morphNormals!==zt||Dt.morphColors!==mn||Dt.toneMapping!==Pn||Dt.morphTargetsCount!==Qt)&&(Lt=!0):(Lt=!0,Dt.__version=ce.version);let ei=Dt.currentProgram;Lt===!0&&(ei=Re(ce,te,le));let Qi=!1,Gn=!1,Fi=!1;const ri=ei.getUniforms(),we=Dt.uniforms;if(yt.useProgram(ei.program)&&(Qi=!0,Gn=!0,Fi=!0),ce.id!==ie&&(ie=ce.id,Gn=!0),Qi||he!==k){yt.buffers.depth.getReversed()&&k.reversedDepth!==!0&&(k._reversedDepth=!0,k.updateProjectionMatrix()),ri.setValue(Q,"projectionMatrix",k.projectionMatrix),ri.setValue(Q,"viewMatrix",k.matrixWorldInverse);const Ut=ri.map.cameraPosition;Ut!==void 0&&Ut.setValue(Q,mt.setFromMatrixPosition(k.matrixWorld)),Ft.logarithmicDepthBuffer&&ri.setValue(Q,"logDepthBufFC",2/(Math.log(k.far+1)/Math.LN2)),(ce.isMeshPhongMaterial||ce.isMeshToonMaterial||ce.isMeshLambertMaterial||ce.isMeshBasicMaterial||ce.isMeshStandardMaterial||ce.isShaderMaterial)&&ri.setValue(Q,"isOrthographic",k.isOrthographicCamera===!0),he!==k&&(he=k,Gn=!0,Fi=!0)}if(Dt.needsLights&&($t.state.directionalShadowMap.length>0&&ri.setValue(Q,"directionalShadowMap",$t.state.directionalShadowMap,ue),$t.state.spotShadowMap.length>0&&ri.setValue(Q,"spotShadowMap",$t.state.spotShadowMap,ue),$t.state.pointShadowMap.length>0&&ri.setValue(Q,"pointShadowMap",$t.state.pointShadowMap,ue)),le.isSkinnedMesh){ri.setOptional(Q,le,"bindMatrix"),ri.setOptional(Q,le,"bindMatrixInverse");const ut=le.skeleton;ut&&(ut.boneTexture===null&&ut.computeBoneTexture(),ri.setValue(Q,"boneTexture",ut.boneTexture,ue))}le.isBatchedMesh&&(ri.setOptional(Q,le,"batchingTexture"),ri.setValue(Q,"batchingTexture",le._matricesTexture,ue),ri.setOptional(Q,le,"batchingIdTexture"),ri.setValue(Q,"batchingIdTexture",le._indirectTexture,ue),ri.setOptional(Q,le,"batchingColorTexture"),le._colorsTexture!==null&&ri.setValue(Q,"batchingColorTexture",le._colorsTexture,ue));const at=fe.morphAttributes;if((at.position!==void 0||at.normal!==void 0||at.color!==void 0)&&qt.update(le,fe,ei),(Gn||Dt.receiveShadow!==le.receiveShadow)&&(Dt.receiveShadow=le.receiveShadow,ri.setValue(Q,"receiveShadow",le.receiveShadow)),ce.isMeshGouraudMaterial&&ce.envMap!==null&&(we.envMap.value=Ct,we.flipEnvMap.value=Ct.isCubeTexture&&Ct.isRenderTargetTexture===!1?-1:1),ce.isMeshStandardMaterial&&ce.envMap===null&&te.environment!==null&&(we.envMapIntensity.value=te.environmentIntensity),we.dfgLUT!==void 0&&(we.dfgLUT.value=EU()),Gn&&(ri.setValue(Q,"toneMappingExposure",N.toneMappingExposure),Dt.needsLights&&nt(we,Fi),Qe&&ce.fog===!0&&Xt.refreshFogUniforms(we,Qe),Xt.refreshMaterialUniforms(we,ce,Me,ae,P.state.transmissionRenderTarget[k.id]),e_.upload(Q,Pe(Dt),we,ue)),ce.isShaderMaterial&&ce.uniformsNeedUpdate===!0&&(e_.upload(Q,Pe(Dt),we,ue),ce.uniformsNeedUpdate=!1),ce.isSpriteMaterial&&ri.setValue(Q,"center",le.center),ri.setValue(Q,"modelViewMatrix",le.modelViewMatrix),ri.setValue(Q,"normalMatrix",le.normalMatrix),ri.setValue(Q,"modelMatrix",le.matrixWorld),ce.isShaderMaterial||ce.isRawShaderMaterial){const ut=ce.uniformsGroups;for(let Ut=0,Nt=ut.length;Ut<Nt;Ut++){const Vt=ut[Ut];Ye.update(Vt,ei),Ye.bind(Vt,ei)}}return ei}function nt(k,te){k.ambientLightColor.needsUpdate=te,k.lightProbe.needsUpdate=te,k.directionalLights.needsUpdate=te,k.directionalLightShadows.needsUpdate=te,k.pointLights.needsUpdate=te,k.pointLightShadows.needsUpdate=te,k.spotLights.needsUpdate=te,k.spotLightShadows.needsUpdate=te,k.rectAreaLights.needsUpdate=te,k.hemisphereLights.needsUpdate=te}function Ze(k){return k.isMeshLambertMaterial||k.isMeshToonMaterial||k.isMeshPhongMaterial||k.isMeshStandardMaterial||k.isShadowMaterial||k.isShaderMaterial&&k.lights===!0}this.getActiveCubeFace=function(){return K},this.getActiveMipmapLevel=function(){return ne},this.getRenderTarget=function(){return ee},this.setRenderTargetTextures=function(k,te,fe){const ce=I.get(k);ce.__autoAllocateDepthBuffer=k.resolveDepthBuffer===!1,ce.__autoAllocateDepthBuffer===!1&&(ce.__useRenderToTexture=!1),I.get(k.texture).__webglTexture=te,I.get(k.depthTexture).__webglTexture=ce.__autoAllocateDepthBuffer?void 0:fe,ce.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(k,te){const fe=I.get(k);fe.__webglFramebuffer=te,fe.__useDefaultFramebuffer=te===void 0};const je=Q.createFramebuffer();this.setRenderTarget=function(k,te=0,fe=0){ee=k,K=te,ne=fe;let ce=null,le=!1,Qe=!1;if(k){const ct=I.get(k);if(ct.__useDefaultFramebuffer!==void 0){yt.bindFramebuffer(Q.FRAMEBUFFER,ct.__webglFramebuffer),H.copy(k.viewport),Y.copy(k.scissor),$=k.scissorTest,yt.viewport(H),yt.scissor(Y),yt.setScissorTest($),ie=-1;return}else if(ct.__webglFramebuffer===void 0)ue.setupRenderTarget(k);else if(ct.__hasExternalTextures)ue.rebindTextures(k,I.get(k.texture).__webglTexture,I.get(k.depthTexture).__webglTexture);else if(k.depthBuffer){const Yt=k.depthTexture;if(ct.__boundDepthTexture!==Yt){if(Yt!==null&&I.has(Yt)&&(k.width!==Yt.image.width||k.height!==Yt.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");ue.setupDepthRenderbuffer(k)}}const Ct=k.texture;(Ct.isData3DTexture||Ct.isDataArrayTexture||Ct.isCompressedArrayTexture)&&(Qe=!0);const xt=I.get(k).__webglFramebuffer;k.isWebGLCubeRenderTarget?(Array.isArray(xt[te])?ce=xt[te][fe]:ce=xt[te],le=!0):k.samples>0&&ue.useMultisampledRTT(k)===!1?ce=I.get(k).__webglMultisampledFramebuffer:Array.isArray(xt)?ce=xt[fe]:ce=xt,H.copy(k.viewport),Y.copy(k.scissor),$=k.scissorTest}else H.copy(ve).multiplyScalar(Me).floor(),Y.copy(Ce).multiplyScalar(Me).floor(),$=tt;if(fe!==0&&(ce=je),yt.bindFramebuffer(Q.FRAMEBUFFER,ce)&&yt.drawBuffers(k,ce),yt.viewport(H),yt.scissor(Y),yt.setScissorTest($),le){const ct=I.get(k.texture);Q.framebufferTexture2D(Q.FRAMEBUFFER,Q.COLOR_ATTACHMENT0,Q.TEXTURE_CUBE_MAP_POSITIVE_X+te,ct.__webglTexture,fe)}else if(Qe){const ct=te;for(let Ct=0;Ct<k.textures.length;Ct++){const xt=I.get(k.textures[Ct]);Q.framebufferTextureLayer(Q.FRAMEBUFFER,Q.COLOR_ATTACHMENT0+Ct,xt.__webglTexture,fe,ct)}}else if(k!==null&&fe!==0){const ct=I.get(k.texture);Q.framebufferTexture2D(Q.FRAMEBUFFER,Q.COLOR_ATTACHMENT0,Q.TEXTURE_2D,ct.__webglTexture,fe)}ie=-1},this.readRenderTargetPixels=function(k,te,fe,ce,le,Qe,lt,ct=0){if(!(k&&k.isWebGLRenderTarget)){an("WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Ct=I.get(k).__webglFramebuffer;if(k.isWebGLCubeRenderTarget&&lt!==void 0&&(Ct=Ct[lt]),Ct){yt.bindFramebuffer(Q.FRAMEBUFFER,Ct);try{const xt=k.textures[ct],Yt=xt.format,At=xt.type;if(!Ft.textureFormatReadable(Yt)){an("WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!Ft.textureTypeReadable(At)){an("WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}te>=0&&te<=k.width-ce&&fe>=0&&fe<=k.height-le&&(k.textures.length>1&&Q.readBuffer(Q.COLOR_ATTACHMENT0+ct),Q.readPixels(te,fe,ce,le,We.convert(Yt),We.convert(At),Qe))}finally{const xt=ee!==null?I.get(ee).__webglFramebuffer:null;yt.bindFramebuffer(Q.FRAMEBUFFER,xt)}}},this.readRenderTargetPixelsAsync=async function(k,te,fe,ce,le,Qe,lt,ct=0){if(!(k&&k.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Ct=I.get(k).__webglFramebuffer;if(k.isWebGLCubeRenderTarget&&lt!==void 0&&(Ct=Ct[lt]),Ct)if(te>=0&&te<=k.width-ce&&fe>=0&&fe<=k.height-le){yt.bindFramebuffer(Q.FRAMEBUFFER,Ct);const xt=k.textures[ct],Yt=xt.format,At=xt.type;if(!Ft.textureFormatReadable(Yt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Ft.textureTypeReadable(At))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const zt=Q.createBuffer();Q.bindBuffer(Q.PIXEL_PACK_BUFFER,zt),Q.bufferData(Q.PIXEL_PACK_BUFFER,Qe.byteLength,Q.STREAM_READ),k.textures.length>1&&Q.readBuffer(Q.COLOR_ATTACHMENT0+ct),Q.readPixels(te,fe,ce,le,We.convert(Yt),We.convert(At),0);const mn=ee!==null?I.get(ee).__webglFramebuffer:null;yt.bindFramebuffer(Q.FRAMEBUFFER,mn);const Pn=Q.fenceSync(Q.SYNC_GPU_COMMANDS_COMPLETE,0);return Q.flush(),await x2(Q,Pn,4),Q.bindBuffer(Q.PIXEL_PACK_BUFFER,zt),Q.getBufferSubData(Q.PIXEL_PACK_BUFFER,0,Qe),Q.deleteBuffer(zt),Q.deleteSync(Pn),Qe}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(k,te=null,fe=0){const ce=Math.pow(2,-fe),le=Math.floor(k.image.width*ce),Qe=Math.floor(k.image.height*ce),lt=te!==null?te.x:0,ct=te!==null?te.y:0;ue.setTexture2D(k,0),Q.copyTexSubImage2D(Q.TEXTURE_2D,fe,0,0,lt,ct,le,Qe),yt.unbindTexture()};const vt=Q.createFramebuffer(),ht=Q.createFramebuffer();this.copyTextureToTexture=function(k,te,fe=null,ce=null,le=0,Qe=null){Qe===null&&(le!==0?(lh("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),Qe=le,le=0):Qe=0);let lt,ct,Ct,xt,Yt,At,zt,mn,Pn;const Mn=k.isCompressedTexture?k.mipmaps[Qe]:k.image;if(fe!==null)lt=fe.max.x-fe.min.x,ct=fe.max.y-fe.min.y,Ct=fe.isBox3?fe.max.z-fe.min.z:1,xt=fe.min.x,Yt=fe.min.y,At=fe.isBox3?fe.min.z:0;else{const at=Math.pow(2,-le);lt=Math.floor(Mn.width*at),ct=Math.floor(Mn.height*at),k.isDataArrayTexture?Ct=Mn.depth:k.isData3DTexture?Ct=Math.floor(Mn.depth*at):Ct=1,xt=0,Yt=0,At=0}ce!==null?(zt=ce.x,mn=ce.y,Pn=ce.z):(zt=0,mn=0,Pn=0);const Qt=We.convert(te.format),Dt=We.convert(te.type);let $t;te.isData3DTexture?(ue.setTexture3D(te,0),$t=Q.TEXTURE_3D):te.isDataArrayTexture||te.isCompressedArrayTexture?(ue.setTexture2DArray(te,0),$t=Q.TEXTURE_2D_ARRAY):(ue.setTexture2D(te,0),$t=Q.TEXTURE_2D),Q.pixelStorei(Q.UNPACK_FLIP_Y_WEBGL,te.flipY),Q.pixelStorei(Q.UNPACK_PREMULTIPLY_ALPHA_WEBGL,te.premultiplyAlpha),Q.pixelStorei(Q.UNPACK_ALIGNMENT,te.unpackAlignment);const Lt=Q.getParameter(Q.UNPACK_ROW_LENGTH),ei=Q.getParameter(Q.UNPACK_IMAGE_HEIGHT),Qi=Q.getParameter(Q.UNPACK_SKIP_PIXELS),Gn=Q.getParameter(Q.UNPACK_SKIP_ROWS),Fi=Q.getParameter(Q.UNPACK_SKIP_IMAGES);Q.pixelStorei(Q.UNPACK_ROW_LENGTH,Mn.width),Q.pixelStorei(Q.UNPACK_IMAGE_HEIGHT,Mn.height),Q.pixelStorei(Q.UNPACK_SKIP_PIXELS,xt),Q.pixelStorei(Q.UNPACK_SKIP_ROWS,Yt),Q.pixelStorei(Q.UNPACK_SKIP_IMAGES,At);const ri=k.isDataArrayTexture||k.isData3DTexture,we=te.isDataArrayTexture||te.isData3DTexture;if(k.isDepthTexture){const at=I.get(k),ut=I.get(te),Ut=I.get(at.__renderTarget),Nt=I.get(ut.__renderTarget);yt.bindFramebuffer(Q.READ_FRAMEBUFFER,Ut.__webglFramebuffer),yt.bindFramebuffer(Q.DRAW_FRAMEBUFFER,Nt.__webglFramebuffer);for(let Vt=0;Vt<Ct;Vt++)ri&&(Q.framebufferTextureLayer(Q.READ_FRAMEBUFFER,Q.COLOR_ATTACHMENT0,I.get(k).__webglTexture,le,At+Vt),Q.framebufferTextureLayer(Q.DRAW_FRAMEBUFFER,Q.COLOR_ATTACHMENT0,I.get(te).__webglTexture,Qe,Pn+Vt)),Q.blitFramebuffer(xt,Yt,lt,ct,zt,mn,lt,ct,Q.DEPTH_BUFFER_BIT,Q.NEAREST);yt.bindFramebuffer(Q.READ_FRAMEBUFFER,null),yt.bindFramebuffer(Q.DRAW_FRAMEBUFFER,null)}else if(le!==0||k.isRenderTargetTexture||I.has(k)){const at=I.get(k),ut=I.get(te);yt.bindFramebuffer(Q.READ_FRAMEBUFFER,vt),yt.bindFramebuffer(Q.DRAW_FRAMEBUFFER,ht);for(let Ut=0;Ut<Ct;Ut++)ri?Q.framebufferTextureLayer(Q.READ_FRAMEBUFFER,Q.COLOR_ATTACHMENT0,at.__webglTexture,le,At+Ut):Q.framebufferTexture2D(Q.READ_FRAMEBUFFER,Q.COLOR_ATTACHMENT0,Q.TEXTURE_2D,at.__webglTexture,le),we?Q.framebufferTextureLayer(Q.DRAW_FRAMEBUFFER,Q.COLOR_ATTACHMENT0,ut.__webglTexture,Qe,Pn+Ut):Q.framebufferTexture2D(Q.DRAW_FRAMEBUFFER,Q.COLOR_ATTACHMENT0,Q.TEXTURE_2D,ut.__webglTexture,Qe),le!==0?Q.blitFramebuffer(xt,Yt,lt,ct,zt,mn,lt,ct,Q.COLOR_BUFFER_BIT,Q.NEAREST):we?Q.copyTexSubImage3D($t,Qe,zt,mn,Pn+Ut,xt,Yt,lt,ct):Q.copyTexSubImage2D($t,Qe,zt,mn,xt,Yt,lt,ct);yt.bindFramebuffer(Q.READ_FRAMEBUFFER,null),yt.bindFramebuffer(Q.DRAW_FRAMEBUFFER,null)}else we?k.isDataTexture||k.isData3DTexture?Q.texSubImage3D($t,Qe,zt,mn,Pn,lt,ct,Ct,Qt,Dt,Mn.data):te.isCompressedArrayTexture?Q.compressedTexSubImage3D($t,Qe,zt,mn,Pn,lt,ct,Ct,Qt,Mn.data):Q.texSubImage3D($t,Qe,zt,mn,Pn,lt,ct,Ct,Qt,Dt,Mn):k.isDataTexture?Q.texSubImage2D(Q.TEXTURE_2D,Qe,zt,mn,lt,ct,Qt,Dt,Mn.data):k.isCompressedTexture?Q.compressedTexSubImage2D(Q.TEXTURE_2D,Qe,zt,mn,Mn.width,Mn.height,Qt,Mn.data):Q.texSubImage2D(Q.TEXTURE_2D,Qe,zt,mn,lt,ct,Qt,Dt,Mn);Q.pixelStorei(Q.UNPACK_ROW_LENGTH,Lt),Q.pixelStorei(Q.UNPACK_IMAGE_HEIGHT,ei),Q.pixelStorei(Q.UNPACK_SKIP_PIXELS,Qi),Q.pixelStorei(Q.UNPACK_SKIP_ROWS,Gn),Q.pixelStorei(Q.UNPACK_SKIP_IMAGES,Fi),Qe===0&&te.generateMipmaps&&Q.generateMipmap($t),yt.unbindTexture()},this.initRenderTarget=function(k){I.get(k).__webglFramebuffer===void 0&&ue.setupRenderTarget(k)},this.initTexture=function(k){k.isCubeTexture?ue.setTextureCube(k,0):k.isData3DTexture?ue.setTexture3D(k,0):k.isDataArrayTexture||k.isCompressedArrayTexture?ue.setTexture2DArray(k,0):ue.setTexture2D(k,0),yt.unbindTexture()},this.resetState=function(){K=0,ne=0,ee=null,yt.reset(),St.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return pr}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=Hn._getDrawingBufferColorSpace(e),t.unpackColorSpace=Hn._getUnpackColorSpace()}}const TU=Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping:Pg,AddEquation:mc,AddOperation:rb,AdditiveAnimationBlendMode:cx,AdditiveBlending:Ky,AgXToneMapping:tx,AlphaFormat:ox,AlwaysCompare:vb,AlwaysDepth:Ng,AlwaysStencilFunc:fx,AmbientLight:K1,AnimationAction:oE,AnimationClip:Qu,AnimationLoader:lB,AnimationMixer:lE,AnimationObjectGroup:DB,AnimationUtils:aB,ArcCurve:g1,ArrayCamera:iE,ArrowHelper:a3,AttachedBindMode:ix,Audio:aE,AudioAnalyser:AB,AudioContext:yA,AudioListener:_B,AudioLoader:mB,AxesHelper:s3,BackSide:ws,BasicDepthPacking:ub,BasicShadowMap:GM,BatchedMesh:r1,Bone:Lp,BooleanKeyframeTrack:ju,Box2:VB,Box3:Ja,Box3Helper:n3,BoxGeometry:zu,BoxHelper:t3,BufferAttribute:Kn,BufferGeometry:yn,BufferGeometryLoader:Q1,ByteType:Gg,Cache:ko,Camera:q0,CameraHelper:e3,CanvasTexture:Cw,CapsuleGeometry:yv,CatmullRomCurve3:v1,CineonToneMapping:$y,CircleGeometry:xv,ClampToEdgeWrapping:Gi,Clock:xA,Color:Rt,ColorKeyframeTrack:fA,ColorManagement:Hn,CompressedArrayTexture:Ew,CompressedCubeTexture:Tw,CompressedTexture:_v,CompressedTextureLoader:cB,ConeGeometry:Pp,ConstantAlphaFactor:ib,ConstantColorFactor:tb,Controls:o3,CubeCamera:kb,CubeDepthTexture:p1,CubeReflectionMapping:ro,CubeRefractionMapping:vc,CubeTexture:Cp,CubeTextureLoader:X1,CubeUVReflectionMapping:ih,CubicBezierCurve:Qx,CubicBezierCurve3:y1,CubicInterpolant:G1,CullFaceBack:qy,CullFaceFront:PM,CullFaceFrontBack:UR,CullFaceNone:HM,Curve:fo,CurvePath:A1,CustomBlending:zM,CustomToneMapping:ex,CylinderGeometry:Hp,Cylindrical:zB,Data3DTexture:B0,DataArrayTexture:w0,DataTexture:Or,DataTextureLoader:hA,DataUtils:Pu,DecrementStencilOp:KR,DecrementWrapStencilOp:jR,DefaultLoadingManager:k1,DepthFormat:Ho,DepthStencilFormat:yc,DepthTexture:Uh,DetachedBindMode:ob,DirectionalLight:Vv,DirectionalLightHelper:$B,DiscreteInterpolant:z1,DodecahedronGeometry:Av,DoubleSide:hr,DstAlphaFactor:jM,DstColorFactor:QM,DynamicCopyUsage:f2,DynamicDrawUsage:s2,DynamicReadUsage:l2,EdgesGeometry:m1,EllipseCurve:Ev,EqualCompare:pb,EqualDepth:Og,EqualStencilFunc:e2,EquirectangularReflectionMapping:nh,EquirectangularRefractionMapping:sp,Euler:vr,EventDispatcher:Po,ExternalTexture:Jx,ExtrudeGeometry:Dv,FileLoader:Na,Float16BufferAttribute:iw,Float32BufferAttribute:Wt,FloatType:Vi,Fog:Z0,FogExp2:j0,FramebufferTexture:bw,FrontSide:ao,Frustum:Nh,FrustumArray:ov,GLBufferAttribute:FB,GLSL1:d2,GLSL3:hx,GreaterCompare:mb,GreaterDepth:Fg,GreaterEqualCompare:C0,GreaterEqualDepth:Ig,GreaterEqualStencilFunc:a2,GreaterStencilFunc:n2,GridHelper:ZB,Group:Ur,HalfFloatType:sa,HemisphereLight:Y1,HemisphereLightHelper:jB,IcosahedronGeometry:Jp,ImageBitmapLoader:_A,ImageLoader:Wp,ImageUtils:Tb,IncrementStencilOp:qR,IncrementWrapStencilOp:WR,InstancedBufferAttribute:Bc,InstancedBufferGeometry:Z1,InstancedInterleavedBuffer:IB,InstancedMesh:sv,Int16BufferAttribute:tw,Int32BufferAttribute:nw,Int8BufferAttribute:Q2,IntType:op,InterleavedBuffer:Th,InterleavedBufferAttribute:Nl,Interpolant:Wu,InterpolateDiscrete:Du,InterpolateLinear:xc,InterpolateSmooth:b0,InterpolationSamplingMode:g2,InterpolationSamplingType:m2,InvertStencilOp:ZR,KeepStencilOp:Ou,KeyframeTrack:Fr,LOD:Wb,LatheGeometry:Lv,Layers:vh,LessCompare:db,LessDepth:Ug,LessEqualCompare:T0,LessEqualDepth:Cu,LessEqualStencilFunc:t2,LessStencilFunc:$R,Light:Uc,LightProbe:j1,Line:Vo,Line3:YB,LineBasicMaterial:ss,LineCurve:$x,LineCurve3:x1,LineDashedMaterial:H1,LineLoop:pv,LineSegments:Ir,LinearFilter:In,LinearInterpolant:uA,LinearMipMapLinearFilter:ax,LinearMipMapNearestFilter:FR,LinearMipmapLinearFilter:$s,LinearMipmapNearestFilter:wu,LinearSRGBColorSpace:Ma,LinearToneMapping:Zy,LinearTransfer:vp,Loader:Ka,LoaderUtils:yr,LoadingManager:Pv,LoopOnce:pp,LoopPingPong:cb,LoopRepeat:lb,MOUSE:LR,Material:oa,MaterialLoader:kv,MathUtils:R0,Matrix2:CA,Matrix3:Tn,Matrix4:cn,MaxEquation:YM,Mesh:Oi,MeshBasicMaterial:La,MeshDepthMaterial:rA,MeshDistanceMaterial:oA,MeshLambertMaterial:I1,MeshMatcapMaterial:F1,MeshNormalMaterial:O1,MeshPhongMaterial:N1,MeshPhysicalMaterial:la,MeshStandardMaterial:qu,MeshToonMaterial:U1,MinEquation:XM,MirroredRepeatWrapping:Ru,MixOperation:sb,MultiplyBlending:jy,MultiplyOperation:ap,NearestFilter:zi,NearestMipMapLinearFilter:IR,NearestMipMapNearestFilter:OR,NearestMipmapLinearFilter:_c,NearestMipmapNearestFilter:rp,NeutralToneMapping:nx,NeverCompare:hb,NeverDepth:Lg,NeverStencilFunc:QR,NoBlending:so,NoColorSpace:El,NoNormalPacking:VR,NoToneMapping:Lr,NormalAnimationBlendMode:E0,NormalBlending:Tu,NormalGAPacking:XR,NormalRGPacking:kR,NotEqualCompare:gb,NotEqualDepth:Hg,NotEqualStencilFunc:i2,NumberKeyframeTrack:Ul,Object3D:kn,ObjectLoader:dB,ObjectSpaceNormalMap:fb,OctahedronGeometry:qp,OneFactor:qM,OneMinusConstantAlphaFactor:ab,OneMinusConstantColorFactor:nb,OneMinusDstAlphaFactor:ZM,OneMinusDstColorFactor:$M,OneMinusSrcAlphaFactor:Dg,OneMinusSrcColorFactor:WM,OrthographicCamera:Hl,PCFShadowMap:th,PCFSoftShadowMap:ip,PMREMGenerator:IA,Path:Rv,PerspectiveCamera:Ea,Plane:Dc,PlaneGeometry:Nc,PlaneHelper:i3,PointLight:zv,PointLightHelper:KB,Points:vv,PointsMaterial:Fp,PolarGridHelper:QB,PolyhedronGeometry:Lc,PositionalAudio:xB,PropertyBinding:$n,PropertyMixer:rE,QuadraticBezierCurve:eA,QuadraticBezierCurve3:tA,Quaternion:Ya,QuaternionKeyframeTrack:Ol,QuaternionLinearInterpolant:V1,R11_EAC_Format:$g,RED_GREEN_RGTC2_Format:S0,RED_RGTC1_Format:x0,REVISION:np,RG11_EAC_Format:t0,RGBADepthPacking:PR,RGBAFormat:ga,RGBAIntegerFormat:Yg,RGBA_ASTC_10x10_Format:p0,RGBA_ASTC_10x5_Format:f0,RGBA_ASTC_10x6_Format:h0,RGBA_ASTC_10x8_Format:d0,RGBA_ASTC_12x10_Format:m0,RGBA_ASTC_12x12_Format:g0,RGBA_ASTC_4x4_Format:i0,RGBA_ASTC_5x4_Format:a0,RGBA_ASTC_5x5_Format:s0,RGBA_ASTC_6x5_Format:r0,RGBA_ASTC_6x6_Format:o0,RGBA_ASTC_8x5_Format:l0,RGBA_ASTC_8x6_Format:c0,RGBA_ASTC_8x8_Format:u0,RGBA_BPTC_Format:v0,RGBA_ETC2_EAC_Format:Qg,RGBA_PVRTC_2BPPV1_Format:Wg,RGBA_PVRTC_4BPPV1_Format:Kg,RGBA_S3TC_DXT1_Format:fp,RGBA_S3TC_DXT3_Format:hp,RGBA_S3TC_DXT5_Format:dp,RGBDepthPacking:GR,RGBFormat:lx,RGBIntegerFormat:HR,RGB_BPTC_SIGNED_Format:_0,RGB_BPTC_UNSIGNED_Format:y0,RGB_ETC1_Format:jg,RGB_ETC2_Format:Zg,RGB_PVRTC_2BPPV1_Format:qg,RGB_PVRTC_4BPPV1_Format:Jg,RGB_S3TC_DXT1_Format:up,RGDepthPacking:zR,RGFormat:Bu,RGIntegerFormat:Xg,RawShaderMaterial:sA,Ray:mh,Raycaster:EA,RectAreaLight:W1,RedFormat:lp,RedIntegerFormat:cp,ReinhardToneMapping:Qy,RenderTarget:_x,RenderTarget3D:NB,RepeatWrapping:oo,ReplaceStencilOp:JR,ReverseSubtractEquation:kM,RingGeometry:Nv,SIGNED_R11_EAC_Format:e0,SIGNED_RED_GREEN_RGTC2_Format:M0,SIGNED_RED_RGTC1_Format:A0,SIGNED_RG11_EAC_Format:n0,SRGBColorSpace:ra,SRGBTransfer:gi,Scene:Rp,ShaderChunk:Ln,ShaderLib:po,ShaderMaterial:Ns,ShadowMaterial:L1,Shape:Yu,ShapeGeometry:Uv,ShapePath:r3,ShapeUtils:ho,ShortType:zg,Skeleton:Dh,SkeletonHelper:qB,SkinnedMesh:iv,Source:Mc,Sphere:Da,SphereGeometry:Kp,Spherical:GB,SphericalHarmonics3:gA,SplineCurve:nA,SpotLight:Gv,SpotLightHelper:JB,Sprite:qb,SpriteMaterial:Fx,SrcAlphaFactor:Bg,SrcAlphaSaturateFactor:eb,SrcColorFactor:KM,StaticCopyUsage:u2,StaticDrawUsage:_p,StaticReadUsage:o2,StereoCamera:gB,StreamCopyUsage:h2,StreamDrawUsage:r2,StreamReadUsage:c2,StringKeyframeTrack:Zu,SubtractEquation:VM,SubtractiveBlending:Wy,TOUCH:NR,TangentSpaceNormalMap:Ac,TetrahedronGeometry:Ov,Texture:li,TextureLoader:dA,TextureUtils:h3,Timer:HB,TimestampQuery:p2,TorusGeometry:Iv,TorusKnotGeometry:Fv,Triangle:er,TriangleFanDrawMode:Uu,TriangleStripDrawMode:gp,TrianglesDrawMode:ux,TubeGeometry:Hv,UVMapping:gc,Uint16BufferAttribute:Nx,Uint32BufferAttribute:Ux,Uint8BufferAttribute:$2,Uint8ClampedBufferAttribute:ew,Uniform:bA,UniformsGroup:OB,UniformsLib:Pt,UniformsUtils:Gb,UnsignedByteType:Xa,UnsignedInt101111Type:rx,UnsignedInt248Type:sh,UnsignedInt5999Type:sx,UnsignedIntType:dr,UnsignedShort4444Type:Vg,UnsignedShort5551Type:kg,UnsignedShortType:ah,VSMShadowMap:Eu,Vector2:et,Vector3:Z,Vector4:Ti,VectorKeyframeTrack:Il,VideoFrameTexture:Mw,VideoTexture:d1,WebGL3DRenderTarget:z2,WebGLArrayRenderTarget:G2,WebGLCoordinateSystem:pr,WebGLCubeRenderTarget:K0,WebGLRenderTarget:Ds,WebGLRenderer:zA,WebGLUtils:qE,WebGPUCoordinateSystem:rh,WebXRController:W0,WireframeGeometry:w1,WrapAroundEnding:mp,ZeroCurvatureEnding:Lu,ZeroFactor:JM,ZeroSlopeEnding:Nu,ZeroStencilOp:YR,createCanvasElement:xb,error:an,getConsoleFunction:y2,log:xp,setConsoleFunction:_2,warn:Ot,warnOnce:lh},Symbol.toStringTag,{value:"Module"}));var VA={exports:{}},Pl={};var KE;function CU(){return KE||(KE=1,Pl.ConcurrentRoot=1,Pl.ContinuousEventPriority=8,Pl.DefaultEventPriority=32,Pl.DiscreteEventPriority=2,Pl.IdleEventPriority=268435456,Pl.LegacyRoot=0,Pl.NoEventPriority=0),Pl}var WE;function RU(){return WE||(WE=1,VA.exports=CU()),VA.exports}var n_=RU(),kA={exports:{}},XA={},YA={exports:{}},JA={};var jE;function wU(){if(jE)return JA;jE=1;var s=eh();function e(v,y){return v===y&&(v!==0||1/v===1/y)||v!==v&&y!==y}var t=typeof Object.is=="function"?Object.is:e,n=s.useState,i=s.useEffect,o=s.useLayoutEffect,l=s.useDebugValue;function h(v,y){var x=y(),b=n({inst:{value:x,getSnapshot:y}}),R=b[0].inst,T=b[1];return o(function(){R.value=x,R.getSnapshot=y,d(R)&&T({inst:R})},[v,x,y]),i(function(){return d(R)&&T({inst:R}),v(function(){d(R)&&T({inst:R})})},[v]),l(x),x}function d(v){var y=v.getSnapshot;v=v.value;try{var x=y();return!t(v,x)}catch{return!0}}function p(v,y){return y()}var _=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:h;return JA.useSyncExternalStore=s.useSyncExternalStore!==void 0?s.useSyncExternalStore:_,JA}var ZE;function BU(){return ZE||(ZE=1,YA.exports=wU()),YA.exports}var QE;function DU(){if(QE)return XA;QE=1;var s=eh(),e=BU();function t(p,_){return p===_&&(p!==0||1/p===1/_)||p!==p&&_!==_}var n=typeof Object.is=="function"?Object.is:t,i=e.useSyncExternalStore,o=s.useRef,l=s.useEffect,h=s.useMemo,d=s.useDebugValue;return XA.useSyncExternalStoreWithSelector=function(p,_,v,y,x){var b=o(null);if(b.current===null){var R={hasValue:!1,value:null};b.current=R}else R=b.current;b=h(function(){function M(O){if(!w){if(w=!0,D=O,O=y(O),x!==void 0&&R.hasValue){var z=R.value;if(x(z,O))return L=z}return L=O}if(z=L,n(D,O))return z;var V=y(O);return x!==void 0&&x(z,V)?(D=O,z):(D=O,L=V)}var w=!1,D,L,P=v===void 0?null:v;return[function(){return M(_())},P===null?void 0:function(){return M(P())}]},[_,v,y,x]);var T=i(p,b[0],b[1]);return l(function(){R.hasValue=!0,R.value=T},[T]),d(T),T},XA}var $E;function LU(){return $E||($E=1,kA.exports=DU()),kA.exports}var NU=LU();const UU=Py(NU),eT=s=>{let e;const t=new Set,n=(p,_)=>{const v=typeof p=="function"?p(e):p;if(!Object.is(v,e)){const y=e;e=_??(typeof v!="object"||v===null)?v:Object.assign({},e,v),t.forEach(x=>x(e,y))}},i=()=>e,h={setState:n,getState:i,getInitialState:()=>d,subscribe:p=>(t.add(p),()=>t.delete(p))},d=e=s(n,i,h);return h},OU=(s=>s?eT(s):eT),{useSyncExternalStoreWithSelector:IU}=UU,FU=s=>s;function HU(s,e=FU,t){const n=IU(s.subscribe,s.getState,s.getInitialState,e,t);return wM.useDebugValue(n),n}const tT=(s,e)=>{const t=OU(s),n=(i,o=e)=>HU(t,i,o);return Object.assign(n,t),n},nT=((s,e)=>s?tT(s,e):tT),PU=s=>typeof s=="object"&&typeof s.then=="function",cf=[];function iT(s,e,t=(n,i)=>n===i){if(s===e)return!0;if(!s||!e)return!1;const n=s.length;if(e.length!==n)return!1;for(let i=0;i<n;i++)if(!t(s[i],e[i]))return!1;return!0}function aT(s,e=null,t=!1,n={}){e===null&&(e=[s]);for(const o of cf)if(iT(e,o.keys,o.equal)){if(t)return;if(Object.prototype.hasOwnProperty.call(o,"error"))throw o.error;if(Object.prototype.hasOwnProperty.call(o,"response"))return n.lifespan&&n.lifespan>0&&(o.timeout&&clearTimeout(o.timeout),o.timeout=setTimeout(o.remove,n.lifespan)),o.response;if(!t)throw o.promise}const i={keys:e,equal:n.equal,remove:()=>{const o=cf.indexOf(i);o!==-1&&cf.splice(o,1)},promise:(PU(s)?s:s(...e)).then(o=>{i.response=o,n.lifespan&&n.lifespan>0&&(i.timeout=setTimeout(i.remove,n.lifespan))}).catch(o=>i.error=o)};if(cf.push(i),!t)throw i.promise}const GU=(s,e,t)=>aT(s,e,!1,t),zU=(s,e,t)=>{aT(s,e,!0,t)},VU=s=>{if(s===void 0||s.length===0)cf.splice(0,cf.length);else{const e=cf.find(t=>iT(s,t.keys,t.equal));e&&e.remove()}};var qA={exports:{}},KA={exports:{}},WA={exports:{}},jA={};var sT;function kU(){return sT||(sT=1,(function(s){function e(H,Y){var $=H.length;H.push(Y);e:for(;0<$;){var ye=$-1>>>1,_e=H[ye];if(0<i(_e,Y))H[ye]=Y,H[$]=_e,$=ye;else break e}}function t(H){return H.length===0?null:H[0]}function n(H){if(H.length===0)return null;var Y=H[0],$=H.pop();if($!==Y){H[0]=$;e:for(var ye=0,_e=H.length,W=_e>>>1;ye<W;){var ae=2*(ye+1)-1,Me=H[ae],Ne=ae+1,it=H[Ne];if(0>i(Me,$))Ne<_e&&0>i(it,Me)?(H[ye]=it,H[Ne]=$,ye=Ne):(H[ye]=Me,H[ae]=$,ye=ae);else if(Ne<_e&&0>i(it,$))H[ye]=it,H[Ne]=$,ye=Ne;else break e}}return Y}function i(H,Y){var $=H.sortIndex-Y.sortIndex;return $!==0?$:H.id-Y.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;s.unstable_now=function(){return o.now()}}else{var l=Date,h=l.now();s.unstable_now=function(){return l.now()-h}}var d=[],p=[],_=1,v=null,y=3,x=!1,b=!1,R=!1,T=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;function D(H){for(var Y=t(p);Y!==null;){if(Y.callback===null)n(p);else if(Y.startTime<=H)n(p),Y.sortIndex=Y.expirationTime,e(d,Y);else break;Y=t(p)}}function L(H){if(R=!1,D(H),!b)if(t(d)!==null)b=!0,ie();else{var Y=t(p);Y!==null&&he(L,Y.startTime-H)}}var P=!1,O=-1,z=5,V=-1;function N(){return!(s.unstable_now()-V<z)}function F(){if(P){var H=s.unstable_now();V=H;var Y=!0;try{e:{b=!1,R&&(R=!1,M(O),O=-1),x=!0;var $=y;try{t:{for(D(H),v=t(d);v!==null&&!(v.expirationTime>H&&N());){var ye=v.callback;if(typeof ye=="function"){v.callback=null,y=v.priorityLevel;var _e=ye(v.expirationTime<=H);if(H=s.unstable_now(),typeof _e=="function"){v.callback=_e,D(H),Y=!0;break t}v===t(d)&&n(d),D(H)}else n(d);v=t(d)}if(v!==null)Y=!0;else{var W=t(p);W!==null&&he(L,W.startTime-H),Y=!1}}break e}finally{v=null,y=$,x=!1}Y=void 0}}finally{Y?K():P=!1}}}var K;if(typeof w=="function")K=function(){w(F)};else if(typeof MessageChannel<"u"){var ne=new MessageChannel,ee=ne.port2;ne.port1.onmessage=F,K=function(){ee.postMessage(null)}}else K=function(){T(F,0)};function ie(){P||(P=!0,K())}function he(H,Y){O=T(function(){H(s.unstable_now())},Y)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(H){H.callback=null},s.unstable_continueExecution=function(){b||x||(b=!0,ie())},s.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):z=0<H?Math.floor(1e3/H):5},s.unstable_getCurrentPriorityLevel=function(){return y},s.unstable_getFirstCallbackNode=function(){return t(d)},s.unstable_next=function(H){switch(y){case 1:case 2:case 3:var Y=3;break;default:Y=y}var $=y;y=Y;try{return H()}finally{y=$}},s.unstable_pauseExecution=function(){},s.unstable_requestPaint=function(){},s.unstable_runWithPriority=function(H,Y){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var $=y;y=H;try{return Y()}finally{y=$}},s.unstable_scheduleCallback=function(H,Y,$){var ye=s.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?ye+$:ye):$=ye,H){case 1:var _e=-1;break;case 2:_e=250;break;case 5:_e=1073741823;break;case 4:_e=1e4;break;default:_e=5e3}return _e=$+_e,H={id:_++,callback:Y,priorityLevel:H,startTime:$,expirationTime:_e,sortIndex:-1},$>ye?(H.sortIndex=$,e(p,H),t(d)===null&&H===t(p)&&(R?(M(O),O=-1):R=!0,he(L,$-ye))):(H.sortIndex=_e,e(d,H),b||x||(b=!0,ie())),H},s.unstable_shouldYield=N,s.unstable_wrapCallback=function(H){var Y=y;return function(){var $=y;y=Y;try{return H.apply(this,arguments)}finally{y=$}}}})(jA)),jA}var rT;function XU(){return rT||(rT=1,WA.exports=kU()),WA.exports}var oT;function YU(){return oT||(oT=1,(function(s){s.exports=function(e){function t(c,u,g,S){return new Dm(c,u,g,S)}function n(){}function i(c){var u="https://react.dev/errors/"+c;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)u+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+c+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(c){return c===null||typeof c!="object"?null:(c=Hm&&c[Hm]||c["@@iterator"],typeof c=="function"?c:null)}function l(c){if(c==null)return null;if(typeof c=="function")return c.$$typeof===ec?null:c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case nu:return"Fragment";case br:return"Portal";case Fm:return"Profiler";case Im:return"StrictMode";case xd:return"Suspense";case ul:return"SuspenseList"}if(typeof c=="object")switch(c.$$typeof){case Jr:return(c.displayName||"Context")+".Provider";case cl:return(c._context.displayName||"Context")+".Consumer";case iu:var u=c.render;return c=c.displayName,c||(c=u.displayName||u.name||"",c=c!==""?"ForwardRef("+c+")":"ForwardRef"),c;case Bf:return u=c.displayName||null,u!==null?u:l(c.type)||"Memo";case Er:u=c._payload,c=c._init;try{return l(c(u))}catch{}}return null}function h(c){if(Ad===void 0)try{throw Error()}catch(g){var u=g.stack.trim().match(/\n( *(at )?)/);Ad=u&&u[1]||"",Pm=-1<g.stack.indexOf(`
4019
+ }`;class yU{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t){if(this.texture===null){const n=new Jx(e.texture);(e.depthNear!==t.depthNear||e.depthFar!==t.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=n}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,n=new Ns({vertexShader:vU,fragmentShader:_U,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new Oi(new Nc(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class xU extends Po{constructor(e,t){super();const n=this;let i=null,o=1,l=null,h="local-floor",d=1,p=null,_=null,v=null,y=null,x=null,b=null;const R=typeof XRWebGLBinding<"u",T=new yU,M={},w=t.getContextAttributes();let D=null,L=null;const P=[],O=[],z=new et;let V=null;const N=new Ea;N.viewport=new Ti;const F=new Ea;F.viewport=new Ti;const K=[N,F],ne=new iE;let ee=null,ie=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(ve){let Ce=P[ve];return Ce===void 0&&(Ce=new W0,P[ve]=Ce),Ce.getTargetRaySpace()},this.getControllerGrip=function(ve){let Ce=P[ve];return Ce===void 0&&(Ce=new W0,P[ve]=Ce),Ce.getGripSpace()},this.getHand=function(ve){let Ce=P[ve];return Ce===void 0&&(Ce=new W0,P[ve]=Ce),Ce.getHandSpace()};function he(ve){const Ce=O.indexOf(ve.inputSource);if(Ce===-1)return;const tt=P[Ce];tt!==void 0&&(tt.update(ve.inputSource,ve.frame,p||l),tt.dispatchEvent({type:ve.type,data:ve.inputSource}))}function H(){i.removeEventListener("select",he),i.removeEventListener("selectstart",he),i.removeEventListener("selectend",he),i.removeEventListener("squeeze",he),i.removeEventListener("squeezestart",he),i.removeEventListener("squeezeend",he),i.removeEventListener("end",H),i.removeEventListener("inputsourceschange",Y);for(let ve=0;ve<P.length;ve++){const Ce=O[ve];Ce!==null&&(O[ve]=null,P[ve].disconnect(Ce))}ee=null,ie=null,T.reset();for(const ve in M)delete M[ve];e.setRenderTarget(D),x=null,y=null,v=null,i=null,L=null,it.stop(),n.isPresenting=!1,e.setPixelRatio(V),e.setSize(z.width,z.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(ve){o=ve,n.isPresenting===!0&&Ot("WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(ve){h=ve,n.isPresenting===!0&&Ot("WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return p||l},this.setReferenceSpace=function(ve){p=ve},this.getBaseLayer=function(){return y!==null?y:x},this.getBinding=function(){return v===null&&R&&(v=new XRWebGLBinding(i,t)),v},this.getFrame=function(){return b},this.getSession=function(){return i},this.setSession=async function(ve){if(i=ve,i!==null){if(D=e.getRenderTarget(),i.addEventListener("select",he),i.addEventListener("selectstart",he),i.addEventListener("selectend",he),i.addEventListener("squeeze",he),i.addEventListener("squeezestart",he),i.addEventListener("squeezeend",he),i.addEventListener("end",H),i.addEventListener("inputsourceschange",Y),w.xrCompatible!==!0&&await t.makeXRCompatible(),V=e.getPixelRatio(),e.getSize(z),R&&"createProjectionLayer"in XRWebGLBinding.prototype){let tt=null,Et=null,wt=null;w.depth&&(wt=w.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,tt=w.stencil?yc:Ho,Et=w.stencil?sh:dr);const on={colorFormat:t.RGBA8,depthFormat:wt,scaleFactor:o};v=this.getBinding(),y=v.createProjectionLayer(on),i.updateRenderState({layers:[y]}),e.setPixelRatio(1),e.setSize(y.textureWidth,y.textureHeight,!1),L=new Ds(y.textureWidth,y.textureHeight,{format:ga,type:Xa,depthTexture:new Uh(y.textureWidth,y.textureHeight,Et,void 0,void 0,void 0,void 0,void 0,void 0,tt),stencilBuffer:w.stencil,colorSpace:e.outputColorSpace,samples:w.antialias?4:0,resolveDepthBuffer:y.ignoreDepthValues===!1,resolveStencilBuffer:y.ignoreDepthValues===!1})}else{const tt={antialias:w.antialias,alpha:!0,depth:w.depth,stencil:w.stencil,framebufferScaleFactor:o};x=new XRWebGLLayer(i,t,tt),i.updateRenderState({baseLayer:x}),e.setPixelRatio(1),e.setSize(x.framebufferWidth,x.framebufferHeight,!1),L=new Ds(x.framebufferWidth,x.framebufferHeight,{format:ga,type:Xa,colorSpace:e.outputColorSpace,stencilBuffer:w.stencil,resolveDepthBuffer:x.ignoreDepthValues===!1,resolveStencilBuffer:x.ignoreDepthValues===!1})}L.isXRRenderTarget=!0,this.setFoveation(d),p=null,l=await i.requestReferenceSpace(h),it.setContext(i),it.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode},this.getDepthTexture=function(){return T.getDepthTexture()};function Y(ve){for(let Ce=0;Ce<ve.removed.length;Ce++){const tt=ve.removed[Ce],Et=O.indexOf(tt);Et>=0&&(O[Et]=null,P[Et].disconnect(tt))}for(let Ce=0;Ce<ve.added.length;Ce++){const tt=ve.added[Ce];let Et=O.indexOf(tt);if(Et===-1){for(let on=0;on<P.length;on++)if(on>=O.length){O.push(tt),Et=on;break}else if(O[on]===null){O[on]=tt,Et=on;break}if(Et===-1)break}const wt=P[Et];wt&&wt.connect(tt)}}const $=new Z,ye=new Z;function _e(ve,Ce,tt){$.setFromMatrixPosition(Ce.matrixWorld),ye.setFromMatrixPosition(tt.matrixWorld);const Et=$.distanceTo(ye),wt=Ce.projectionMatrix.elements,on=tt.projectionMatrix.elements,It=wt[14]/(wt[10]-1),mt=wt[14]/(wt[10]+1),me=(wt[9]+1)/wt[5],Le=(wt[9]-1)/wt[5],Ue=(wt[8]-1)/wt[0],rt=(on[8]+1)/on[0],Q=It*Ue,Kt=It*rt,_t=Et/(-Ue+rt),Ft=_t*-Ue;if(Ce.matrixWorld.decompose(ve.position,ve.quaternion,ve.scale),ve.translateX(Ft),ve.translateZ(_t),ve.matrixWorld.compose(ve.position,ve.quaternion,ve.scale),ve.matrixWorldInverse.copy(ve.matrixWorld).invert(),wt[10]===-1)ve.projectionMatrix.copy(Ce.projectionMatrix),ve.projectionMatrixInverse.copy(Ce.projectionMatrixInverse);else{const yt=It+_t,j=mt+_t,I=Q-Ft,ue=Kt+(Et-Ft),Ie=me*mt/j*yt,Xe=Le*mt/j*yt;ve.projectionMatrix.makePerspective(I,ue,Ie,Xe,yt,j),ve.projectionMatrixInverse.copy(ve.projectionMatrix).invert()}}function W(ve,Ce){Ce===null?ve.matrixWorld.copy(ve.matrix):ve.matrixWorld.multiplyMatrices(Ce.matrixWorld,ve.matrix),ve.matrixWorldInverse.copy(ve.matrixWorld).invert()}this.updateCamera=function(ve){if(i===null)return;let Ce=ve.near,tt=ve.far;T.texture!==null&&(T.depthNear>0&&(Ce=T.depthNear),T.depthFar>0&&(tt=T.depthFar)),ne.near=F.near=N.near=Ce,ne.far=F.far=N.far=tt,(ee!==ne.near||ie!==ne.far)&&(i.updateRenderState({depthNear:ne.near,depthFar:ne.far}),ee=ne.near,ie=ne.far),ne.layers.mask=ve.layers.mask|6,N.layers.mask=ne.layers.mask&3,F.layers.mask=ne.layers.mask&5;const Et=ve.parent,wt=ne.cameras;W(ne,Et);for(let on=0;on<wt.length;on++)W(wt[on],Et);wt.length===2?_e(ne,N,F):ne.projectionMatrix.copy(N.projectionMatrix),ae(ve,ne,Et)};function ae(ve,Ce,tt){tt===null?ve.matrix.copy(Ce.matrixWorld):(ve.matrix.copy(tt.matrixWorld),ve.matrix.invert(),ve.matrix.multiply(Ce.matrixWorld)),ve.matrix.decompose(ve.position,ve.quaternion,ve.scale),ve.updateMatrixWorld(!0),ve.projectionMatrix.copy(Ce.projectionMatrix),ve.projectionMatrixInverse.copy(Ce.projectionMatrixInverse),ve.isPerspectiveCamera&&(ve.fov=ch*2*Math.atan(1/ve.projectionMatrix.elements[5]),ve.zoom=1)}this.getCamera=function(){return ne},this.getFoveation=function(){if(!(y===null&&x===null))return d},this.setFoveation=function(ve){d=ve,y!==null&&(y.fixedFoveation=ve),x!==null&&x.fixedFoveation!==void 0&&(x.fixedFoveation=ve)},this.hasDepthSensing=function(){return T.texture!==null},this.getDepthSensingMesh=function(){return T.getMesh(ne)},this.getCameraTexture=function(ve){return M[ve]};let Me=null;function Ne(ve,Ce){if(_=Ce.getViewerPose(p||l),b=Ce,_!==null){const tt=_.views;x!==null&&(e.setRenderTargetFramebuffer(L,x.framebuffer),e.setRenderTarget(L));let Et=!1;tt.length!==ne.cameras.length&&(ne.cameras.length=0,Et=!0);for(let mt=0;mt<tt.length;mt++){const me=tt[mt];let Le=null;if(x!==null)Le=x.getViewport(me);else{const rt=v.getViewSubImage(y,me);Le=rt.viewport,mt===0&&(e.setRenderTargetTextures(L,rt.colorTexture,rt.depthStencilTexture),e.setRenderTarget(L))}let Ue=K[mt];Ue===void 0&&(Ue=new Ea,Ue.layers.enable(mt),Ue.viewport=new Ti,K[mt]=Ue),Ue.matrix.fromArray(me.transform.matrix),Ue.matrix.decompose(Ue.position,Ue.quaternion,Ue.scale),Ue.projectionMatrix.fromArray(me.projectionMatrix),Ue.projectionMatrixInverse.copy(Ue.projectionMatrix).invert(),Ue.viewport.set(Le.x,Le.y,Le.width,Le.height),mt===0&&(ne.matrix.copy(Ue.matrix),ne.matrix.decompose(ne.position,ne.quaternion,ne.scale)),Et===!0&&ne.cameras.push(Ue)}const wt=i.enabledFeatures;if(wt&&wt.includes("depth-sensing")&&i.depthUsage=="gpu-optimized"&&R){v=n.getBinding();const mt=v.getDepthInformation(tt[0]);mt&&mt.isValid&&mt.texture&&T.init(mt,i.renderState)}if(wt&&wt.includes("camera-access")&&R){e.state.unbindTexture(),v=n.getBinding();for(let mt=0;mt<tt.length;mt++){const me=tt[mt].camera;if(me){let Le=M[me];Le||(Le=new Jx,M[me]=Le);const Ue=v.getCameraImage(me);Le.sourceTexture=Ue}}}}for(let tt=0;tt<P.length;tt++){const Et=O[tt],wt=P[tt];Et!==null&&wt!==void 0&&wt.update(Et,Ce,p||l)}Me&&Me(ve,Ce),Ce.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:Ce}),b=null}const it=new xE;it.setAnimationLoop(Ne),this.setAnimationLoop=function(ve){Me=ve},this.dispose=function(){}}}const lf=new vr,AU=new cn;function SU(s,e){function t(T,M){T.matrixAutoUpdate===!0&&T.updateMatrix(),M.value.copy(T.matrix)}function n(T,M){M.color.getRGB(T.fogColor.value,Pb(s)),M.isFog?(T.fogNear.value=M.near,T.fogFar.value=M.far):M.isFogExp2&&(T.fogDensity.value=M.density)}function i(T,M,w,D,L){M.isMeshBasicMaterial||M.isMeshLambertMaterial?o(T,M):M.isMeshToonMaterial?(o(T,M),v(T,M)):M.isMeshPhongMaterial?(o(T,M),_(T,M)):M.isMeshStandardMaterial?(o(T,M),y(T,M),M.isMeshPhysicalMaterial&&x(T,M,L)):M.isMeshMatcapMaterial?(o(T,M),b(T,M)):M.isMeshDepthMaterial?o(T,M):M.isMeshDistanceMaterial?(o(T,M),R(T,M)):M.isMeshNormalMaterial?o(T,M):M.isLineBasicMaterial?(l(T,M),M.isLineDashedMaterial&&h(T,M)):M.isPointsMaterial?d(T,M,w,D):M.isSpriteMaterial?p(T,M):M.isShadowMaterial?(T.color.value.copy(M.color),T.opacity.value=M.opacity):M.isShaderMaterial&&(M.uniformsNeedUpdate=!1)}function o(T,M){T.opacity.value=M.opacity,M.color&&T.diffuse.value.copy(M.color),M.emissive&&T.emissive.value.copy(M.emissive).multiplyScalar(M.emissiveIntensity),M.map&&(T.map.value=M.map,t(M.map,T.mapTransform)),M.alphaMap&&(T.alphaMap.value=M.alphaMap,t(M.alphaMap,T.alphaMapTransform)),M.bumpMap&&(T.bumpMap.value=M.bumpMap,t(M.bumpMap,T.bumpMapTransform),T.bumpScale.value=M.bumpScale,M.side===ws&&(T.bumpScale.value*=-1)),M.normalMap&&(T.normalMap.value=M.normalMap,t(M.normalMap,T.normalMapTransform),T.normalScale.value.copy(M.normalScale),M.side===ws&&T.normalScale.value.negate()),M.displacementMap&&(T.displacementMap.value=M.displacementMap,t(M.displacementMap,T.displacementMapTransform),T.displacementScale.value=M.displacementScale,T.displacementBias.value=M.displacementBias),M.emissiveMap&&(T.emissiveMap.value=M.emissiveMap,t(M.emissiveMap,T.emissiveMapTransform)),M.specularMap&&(T.specularMap.value=M.specularMap,t(M.specularMap,T.specularMapTransform)),M.alphaTest>0&&(T.alphaTest.value=M.alphaTest);const w=e.get(M),D=w.envMap,L=w.envMapRotation;D&&(T.envMap.value=D,lf.copy(L),lf.x*=-1,lf.y*=-1,lf.z*=-1,D.isCubeTexture&&D.isRenderTargetTexture===!1&&(lf.y*=-1,lf.z*=-1),T.envMapRotation.value.setFromMatrix4(AU.makeRotationFromEuler(lf)),T.flipEnvMap.value=D.isCubeTexture&&D.isRenderTargetTexture===!1?-1:1,T.reflectivity.value=M.reflectivity,T.ior.value=M.ior,T.refractionRatio.value=M.refractionRatio),M.lightMap&&(T.lightMap.value=M.lightMap,T.lightMapIntensity.value=M.lightMapIntensity,t(M.lightMap,T.lightMapTransform)),M.aoMap&&(T.aoMap.value=M.aoMap,T.aoMapIntensity.value=M.aoMapIntensity,t(M.aoMap,T.aoMapTransform))}function l(T,M){T.diffuse.value.copy(M.color),T.opacity.value=M.opacity,M.map&&(T.map.value=M.map,t(M.map,T.mapTransform))}function h(T,M){T.dashSize.value=M.dashSize,T.totalSize.value=M.dashSize+M.gapSize,T.scale.value=M.scale}function d(T,M,w,D){T.diffuse.value.copy(M.color),T.opacity.value=M.opacity,T.size.value=M.size*w,T.scale.value=D*.5,M.map&&(T.map.value=M.map,t(M.map,T.uvTransform)),M.alphaMap&&(T.alphaMap.value=M.alphaMap,t(M.alphaMap,T.alphaMapTransform)),M.alphaTest>0&&(T.alphaTest.value=M.alphaTest)}function p(T,M){T.diffuse.value.copy(M.color),T.opacity.value=M.opacity,T.rotation.value=M.rotation,M.map&&(T.map.value=M.map,t(M.map,T.mapTransform)),M.alphaMap&&(T.alphaMap.value=M.alphaMap,t(M.alphaMap,T.alphaMapTransform)),M.alphaTest>0&&(T.alphaTest.value=M.alphaTest)}function _(T,M){T.specular.value.copy(M.specular),T.shininess.value=Math.max(M.shininess,1e-4)}function v(T,M){M.gradientMap&&(T.gradientMap.value=M.gradientMap)}function y(T,M){T.metalness.value=M.metalness,M.metalnessMap&&(T.metalnessMap.value=M.metalnessMap,t(M.metalnessMap,T.metalnessMapTransform)),T.roughness.value=M.roughness,M.roughnessMap&&(T.roughnessMap.value=M.roughnessMap,t(M.roughnessMap,T.roughnessMapTransform)),M.envMap&&(T.envMapIntensity.value=M.envMapIntensity)}function x(T,M,w){T.ior.value=M.ior,M.sheen>0&&(T.sheenColor.value.copy(M.sheenColor).multiplyScalar(M.sheen),T.sheenRoughness.value=M.sheenRoughness,M.sheenColorMap&&(T.sheenColorMap.value=M.sheenColorMap,t(M.sheenColorMap,T.sheenColorMapTransform)),M.sheenRoughnessMap&&(T.sheenRoughnessMap.value=M.sheenRoughnessMap,t(M.sheenRoughnessMap,T.sheenRoughnessMapTransform))),M.clearcoat>0&&(T.clearcoat.value=M.clearcoat,T.clearcoatRoughness.value=M.clearcoatRoughness,M.clearcoatMap&&(T.clearcoatMap.value=M.clearcoatMap,t(M.clearcoatMap,T.clearcoatMapTransform)),M.clearcoatRoughnessMap&&(T.clearcoatRoughnessMap.value=M.clearcoatRoughnessMap,t(M.clearcoatRoughnessMap,T.clearcoatRoughnessMapTransform)),M.clearcoatNormalMap&&(T.clearcoatNormalMap.value=M.clearcoatNormalMap,t(M.clearcoatNormalMap,T.clearcoatNormalMapTransform),T.clearcoatNormalScale.value.copy(M.clearcoatNormalScale),M.side===ws&&T.clearcoatNormalScale.value.negate())),M.dispersion>0&&(T.dispersion.value=M.dispersion),M.iridescence>0&&(T.iridescence.value=M.iridescence,T.iridescenceIOR.value=M.iridescenceIOR,T.iridescenceThicknessMinimum.value=M.iridescenceThicknessRange[0],T.iridescenceThicknessMaximum.value=M.iridescenceThicknessRange[1],M.iridescenceMap&&(T.iridescenceMap.value=M.iridescenceMap,t(M.iridescenceMap,T.iridescenceMapTransform)),M.iridescenceThicknessMap&&(T.iridescenceThicknessMap.value=M.iridescenceThicknessMap,t(M.iridescenceThicknessMap,T.iridescenceThicknessMapTransform))),M.transmission>0&&(T.transmission.value=M.transmission,T.transmissionSamplerMap.value=w.texture,T.transmissionSamplerSize.value.set(w.width,w.height),M.transmissionMap&&(T.transmissionMap.value=M.transmissionMap,t(M.transmissionMap,T.transmissionMapTransform)),T.thickness.value=M.thickness,M.thicknessMap&&(T.thicknessMap.value=M.thicknessMap,t(M.thicknessMap,T.thicknessMapTransform)),T.attenuationDistance.value=M.attenuationDistance,T.attenuationColor.value.copy(M.attenuationColor)),M.anisotropy>0&&(T.anisotropyVector.value.set(M.anisotropy*Math.cos(M.anisotropyRotation),M.anisotropy*Math.sin(M.anisotropyRotation)),M.anisotropyMap&&(T.anisotropyMap.value=M.anisotropyMap,t(M.anisotropyMap,T.anisotropyMapTransform))),T.specularIntensity.value=M.specularIntensity,T.specularColor.value.copy(M.specularColor),M.specularColorMap&&(T.specularColorMap.value=M.specularColorMap,t(M.specularColorMap,T.specularColorMapTransform)),M.specularIntensityMap&&(T.specularIntensityMap.value=M.specularIntensityMap,t(M.specularIntensityMap,T.specularIntensityMapTransform))}function b(T,M){M.matcap&&(T.matcap.value=M.matcap)}function R(T,M){const w=e.get(M).light;T.referencePosition.value.setFromMatrixPosition(w.matrixWorld),T.nearDistance.value=w.shadow.camera.near,T.farDistance.value=w.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:i}}function MU(s,e,t,n){let i={},o={},l=[];const h=s.getParameter(s.MAX_UNIFORM_BUFFER_BINDINGS);function d(w,D){const L=D.program;n.uniformBlockBinding(w,L)}function p(w,D){let L=i[w.id];L===void 0&&(b(w),L=_(w),i[w.id]=L,w.addEventListener("dispose",T));const P=D.program;n.updateUBOMapping(w,P);const O=e.render.frame;o[w.id]!==O&&(y(w),o[w.id]=O)}function _(w){const D=v();w.__bindingPointIndex=D;const L=s.createBuffer(),P=w.__size,O=w.usage;return s.bindBuffer(s.UNIFORM_BUFFER,L),s.bufferData(s.UNIFORM_BUFFER,P,O),s.bindBuffer(s.UNIFORM_BUFFER,null),s.bindBufferBase(s.UNIFORM_BUFFER,D,L),L}function v(){for(let w=0;w<h;w++)if(l.indexOf(w)===-1)return l.push(w),w;return an("WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function y(w){const D=i[w.id],L=w.uniforms,P=w.__cache;s.bindBuffer(s.UNIFORM_BUFFER,D);for(let O=0,z=L.length;O<z;O++){const V=Array.isArray(L[O])?L[O]:[L[O]];for(let N=0,F=V.length;N<F;N++){const K=V[N];if(x(K,O,N,P)===!0){const ne=K.__offset,ee=Array.isArray(K.value)?K.value:[K.value];let ie=0;for(let he=0;he<ee.length;he++){const H=ee[he],Y=R(H);typeof H=="number"||typeof H=="boolean"?(K.__data[0]=H,s.bufferSubData(s.UNIFORM_BUFFER,ne+ie,K.__data)):H.isMatrix3?(K.__data[0]=H.elements[0],K.__data[1]=H.elements[1],K.__data[2]=H.elements[2],K.__data[3]=0,K.__data[4]=H.elements[3],K.__data[5]=H.elements[4],K.__data[6]=H.elements[5],K.__data[7]=0,K.__data[8]=H.elements[6],K.__data[9]=H.elements[7],K.__data[10]=H.elements[8],K.__data[11]=0):(H.toArray(K.__data,ie),ie+=Y.storage/Float32Array.BYTES_PER_ELEMENT)}s.bufferSubData(s.UNIFORM_BUFFER,ne,K.__data)}}}s.bindBuffer(s.UNIFORM_BUFFER,null)}function x(w,D,L,P){const O=w.value,z=D+"_"+L;if(P[z]===void 0)return typeof O=="number"||typeof O=="boolean"?P[z]=O:P[z]=O.clone(),!0;{const V=P[z];if(typeof O=="number"||typeof O=="boolean"){if(V!==O)return P[z]=O,!0}else if(V.equals(O)===!1)return V.copy(O),!0}return!1}function b(w){const D=w.uniforms;let L=0;const P=16;for(let z=0,V=D.length;z<V;z++){const N=Array.isArray(D[z])?D[z]:[D[z]];for(let F=0,K=N.length;F<K;F++){const ne=N[F],ee=Array.isArray(ne.value)?ne.value:[ne.value];for(let ie=0,he=ee.length;ie<he;ie++){const H=ee[ie],Y=R(H),$=L%P,ye=$%Y.boundary,_e=$+ye;L+=ye,_e!==0&&P-_e<Y.storage&&(L+=P-_e),ne.__data=new Float32Array(Y.storage/Float32Array.BYTES_PER_ELEMENT),ne.__offset=L,L+=Y.storage}}}const O=L%P;return O>0&&(L+=P-O),w.__size=L,w.__cache={},this}function R(w){const D={boundary:0,storage:0};return typeof w=="number"||typeof w=="boolean"?(D.boundary=4,D.storage=4):w.isVector2?(D.boundary=8,D.storage=8):w.isVector3||w.isColor?(D.boundary=16,D.storage=12):w.isVector4?(D.boundary=16,D.storage=16):w.isMatrix3?(D.boundary=48,D.storage=48):w.isMatrix4?(D.boundary=64,D.storage=64):w.isTexture?Ot("WebGLRenderer: Texture samplers can not be part of an uniforms group."):Ot("WebGLRenderer: Unsupported uniform value type.",w),D}function T(w){const D=w.target;D.removeEventListener("dispose",T);const L=l.indexOf(D.__bindingPointIndex);l.splice(L,1),s.deleteBuffer(i[D.id]),delete i[D.id],delete o[D.id]}function M(){for(const w in i)s.deleteBuffer(i[w]);l=[],i={},o={}}return{bind:d,update:p,dispose:M}}const bU=new Uint16Array([12469,15057,12620,14925,13266,14620,13807,14376,14323,13990,14545,13625,14713,13328,14840,12882,14931,12528,14996,12233,15039,11829,15066,11525,15080,11295,15085,10976,15082,10705,15073,10495,13880,14564,13898,14542,13977,14430,14158,14124,14393,13732,14556,13410,14702,12996,14814,12596,14891,12291,14937,11834,14957,11489,14958,11194,14943,10803,14921,10506,14893,10278,14858,9960,14484,14039,14487,14025,14499,13941,14524,13740,14574,13468,14654,13106,14743,12678,14818,12344,14867,11893,14889,11509,14893,11180,14881,10751,14852,10428,14812,10128,14765,9754,14712,9466,14764,13480,14764,13475,14766,13440,14766,13347,14769,13070,14786,12713,14816,12387,14844,11957,14860,11549,14868,11215,14855,10751,14825,10403,14782,10044,14729,9651,14666,9352,14599,9029,14967,12835,14966,12831,14963,12804,14954,12723,14936,12564,14917,12347,14900,11958,14886,11569,14878,11247,14859,10765,14828,10401,14784,10011,14727,9600,14660,9289,14586,8893,14508,8533,15111,12234,15110,12234,15104,12216,15092,12156,15067,12010,15028,11776,14981,11500,14942,11205,14902,10752,14861,10393,14812,9991,14752,9570,14682,9252,14603,8808,14519,8445,14431,8145,15209,11449,15208,11451,15202,11451,15190,11438,15163,11384,15117,11274,15055,10979,14994,10648,14932,10343,14871,9936,14803,9532,14729,9218,14645,8742,14556,8381,14461,8020,14365,7603,15273,10603,15272,10607,15267,10619,15256,10631,15231,10614,15182,10535,15118,10389,15042,10167,14963,9787,14883,9447,14800,9115,14710,8665,14615,8318,14514,7911,14411,7507,14279,7198,15314,9675,15313,9683,15309,9712,15298,9759,15277,9797,15229,9773,15166,9668,15084,9487,14995,9274,14898,8910,14800,8539,14697,8234,14590,7790,14479,7409,14367,7067,14178,6621,15337,8619,15337,8631,15333,8677,15325,8769,15305,8871,15264,8940,15202,8909,15119,8775,15022,8565,14916,8328,14804,8009,14688,7614,14569,7287,14448,6888,14321,6483,14088,6171,15350,7402,15350,7419,15347,7480,15340,7613,15322,7804,15287,7973,15229,8057,15148,8012,15046,7846,14933,7611,14810,7357,14682,7069,14552,6656,14421,6316,14251,5948,14007,5528,15356,5942,15356,5977,15353,6119,15348,6294,15332,6551,15302,6824,15249,7044,15171,7122,15070,7050,14949,6861,14818,6611,14679,6349,14538,6067,14398,5651,14189,5311,13935,4958,15359,4123,15359,4153,15356,4296,15353,4646,15338,5160,15311,5508,15263,5829,15188,6042,15088,6094,14966,6001,14826,5796,14678,5543,14527,5287,14377,4985,14133,4586,13869,4257,15360,1563,15360,1642,15358,2076,15354,2636,15341,3350,15317,4019,15273,4429,15203,4732,15105,4911,14981,4932,14836,4818,14679,4621,14517,4386,14359,4156,14083,3795,13808,3437,15360,122,15360,137,15358,285,15355,636,15344,1274,15322,2177,15281,2765,15215,3223,15120,3451,14995,3569,14846,3567,14681,3466,14511,3305,14344,3121,14037,2800,13753,2467,15360,0,15360,1,15359,21,15355,89,15346,253,15325,479,15287,796,15225,1148,15133,1492,15008,1749,14856,1882,14685,1886,14506,1783,14324,1608,13996,1398,13702,1183]);let Xo=null;function EU(){return Xo===null&&(Xo=new Or(bU,16,16,Bu,sa),Xo.name="DFG_LUT",Xo.minFilter=In,Xo.magFilter=In,Xo.wrapS=Gi,Xo.wrapT=Gi,Xo.generateMipmaps=!1,Xo.needsUpdate=!0),Xo}class zA{constructor(e={}){const{canvas:t=xb(),context:n=null,depth:i=!0,stencil:o=!1,alpha:l=!1,antialias:h=!1,premultipliedAlpha:d=!0,preserveDrawingBuffer:p=!1,powerPreference:_="default",failIfMajorPerformanceCaveat:v=!1,reversedDepthBuffer:y=!1,outputBufferType:x=Xa}=e;this.isWebGLRenderer=!0;let b;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");b=n.getContextAttributes().alpha}else b=l;const R=x,T=new Set([Yg,Xg,cp]),M=new Set([Xa,dr,ah,sh,Vg,kg]),w=new Uint32Array(4),D=new Int32Array(4);let L=null,P=null;const O=[],z=[];let V=null;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.toneMapping=Lr,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const N=this;let F=!1;this._outputColorSpace=ra;let K=0,ne=0,ee=null,ie=-1,he=null;const H=new Ti,Y=new Ti;let $=null;const ye=new Rt(0);let _e=0,W=t.width,ae=t.height,Me=1,Ne=null,it=null;const ve=new Ti(0,0,W,ae),Ce=new Ti(0,0,W,ae);let tt=!1;const Et=new Nh;let wt=!1,on=!1;const It=new cn,mt=new Z,me=new Ti,Le={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let Ue=!1;function rt(){return ee===null?Me:1}let Q=n;function Kt(k,te){return t.getContext(k,te)}try{const k={alpha:!0,depth:i,stencil:o,antialias:h,premultipliedAlpha:d,preserveDrawingBuffer:p,powerPreference:_,failIfMajorPerformanceCaveat:v};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${np}`),t.addEventListener("webglcontextlost",jt,!1),t.addEventListener("webglcontextrestored",Mn,!1),t.addEventListener("webglcontextcreationerror",bt,!1),Q===null){const te="webgl2";if(Q=Kt(te,k),Q===null)throw Kt(te)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(k){throw an("WebGLRenderer: "+k.message),k}let _t,Ft,yt,j,I,ue,Ie,Xe,Oe,Bt,gt,Ht,Xt,ze,qe,Tt,pt,st,qt,de,be,We,St,Ye;function Ve(){_t=new TL(Q),_t.init(),We=new qE(Q,_t),Ft=new vL(Q,_t,e,We),yt=new mU(Q,_t),Ft.reversedDepthBuffer&&y&&yt.buffers.depth.setReversed(!0),j=new wL(Q),I=new eU,ue=new gU(Q,_t,yt,I,Ft,We,j),Ie=new yL(N),Xe=new EL(N),Oe=new d3(Q),St=new mL(Q,Oe),Bt=new CL(Q,Oe,j,St),gt=new DL(Q,Bt,Oe,j),qt=new BL(Q,Ft,ue),Tt=new _L(I),Ht=new $N(N,Ie,Xe,_t,Ft,St,Tt),Xt=new SU(N,I),ze=new nU,qe=new lU(_t),st=new pL(N,Ie,Xe,yt,gt,b,d),pt=new dU(N,gt,Ft),Ye=new MU(Q,j,Ft,yt),de=new gL(Q,_t,j),be=new RL(Q,_t,j),j.programs=Ht.programs,N.capabilities=Ft,N.extensions=_t,N.properties=I,N.renderLists=ze,N.shadowMap=pt,N.state=yt,N.info=j}Ve(),R!==Xa&&(V=new NL(R,t.width,t.height,i,o));const ft=new xU(N,Q);this.xr=ft,this.getContext=function(){return Q},this.getContextAttributes=function(){return Q.getContextAttributes()},this.forceContextLoss=function(){const k=_t.get("WEBGL_lose_context");k&&k.loseContext()},this.forceContextRestore=function(){const k=_t.get("WEBGL_lose_context");k&&k.restoreContext()},this.getPixelRatio=function(){return Me},this.setPixelRatio=function(k){k!==void 0&&(Me=k,this.setSize(W,ae,!1))},this.getSize=function(k){return k.set(W,ae)},this.setSize=function(k,te,fe=!0){if(ft.isPresenting){Ot("WebGLRenderer: Can't change size while VR device is presenting.");return}W=k,ae=te,t.width=Math.floor(k*Me),t.height=Math.floor(te*Me),fe===!0&&(t.style.width=k+"px",t.style.height=te+"px"),V!==null&&V.setSize(t.width,t.height),this.setViewport(0,0,k,te)},this.getDrawingBufferSize=function(k){return k.set(W*Me,ae*Me).floor()},this.setDrawingBufferSize=function(k,te,fe){W=k,ae=te,Me=fe,t.width=Math.floor(k*fe),t.height=Math.floor(te*fe),this.setViewport(0,0,k,te)},this.setEffects=function(k){if(R===Xa){console.error("THREE.WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");return}if(k){for(let te=0;te<k.length;te++)if(k[te].isOutputPass===!0){console.warn("THREE.WebGLRenderer: OutputPass is not needed in setEffects(). Tone mapping and color space conversion are applied automatically.");break}}V.setEffects(k||[])},this.getCurrentViewport=function(k){return k.copy(H)},this.getViewport=function(k){return k.copy(ve)},this.setViewport=function(k,te,fe,ce){k.isVector4?ve.set(k.x,k.y,k.z,k.w):ve.set(k,te,fe,ce),yt.viewport(H.copy(ve).multiplyScalar(Me).round())},this.getScissor=function(k){return k.copy(Ce)},this.setScissor=function(k,te,fe,ce){k.isVector4?Ce.set(k.x,k.y,k.z,k.w):Ce.set(k,te,fe,ce),yt.scissor(Y.copy(Ce).multiplyScalar(Me).round())},this.getScissorTest=function(){return tt},this.setScissorTest=function(k){yt.setScissorTest(tt=k)},this.setOpaqueSort=function(k){Ne=k},this.setTransparentSort=function(k){it=k},this.getClearColor=function(k){return k.copy(st.getClearColor())},this.setClearColor=function(){st.setClearColor(...arguments)},this.getClearAlpha=function(){return st.getClearAlpha()},this.setClearAlpha=function(){st.setClearAlpha(...arguments)},this.clear=function(k=!0,te=!0,fe=!0){let ce=0;if(k){let le=!1;if(ee!==null){const Qe=ee.texture.format;le=T.has(Qe)}if(le){const Qe=ee.texture.type,lt=M.has(Qe),ct=st.getClearColor(),Ct=st.getClearAlpha(),xt=ct.r,Yt=ct.g,At=ct.b;lt?(w[0]=xt,w[1]=Yt,w[2]=At,w[3]=Ct,Q.clearBufferuiv(Q.COLOR,0,w)):(D[0]=xt,D[1]=Yt,D[2]=At,D[3]=Ct,Q.clearBufferiv(Q.COLOR,0,D))}else ce|=Q.COLOR_BUFFER_BIT}te&&(ce|=Q.DEPTH_BUFFER_BIT),fe&&(ce|=Q.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),Q.clear(ce)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",jt,!1),t.removeEventListener("webglcontextrestored",Mn,!1),t.removeEventListener("webglcontextcreationerror",bt,!1),st.dispose(),ze.dispose(),qe.dispose(),I.dispose(),Ie.dispose(),Xe.dispose(),gt.dispose(),St.dispose(),Ye.dispose(),Ht.dispose(),ft.dispose(),ft.removeEventListener("sessionstart",Ia),ft.removeEventListener("sessionend",vi),en.stop()};function jt(k){k.preventDefault(),xp("WebGLRenderer: Context Lost."),F=!0}function Mn(){xp("WebGLRenderer: Context Restored."),F=!1;const k=j.autoReset,te=pt.enabled,fe=pt.autoUpdate,ce=pt.needsUpdate,le=pt.type;Ve(),j.autoReset=k,pt.enabled=te,pt.autoUpdate=fe,pt.needsUpdate=ce,pt.type=le}function bt(k){an("WebGLRenderer: A WebGL context could not be created. Reason: ",k.statusMessage)}function Dn(k){const te=k.target;te.removeEventListener("dispose",Dn),Nn(te)}function Nn(k){Ni(k),I.remove(k)}function Ni(k){const te=I.get(k).programs;te!==void 0&&(te.forEach(function(fe){Ht.releaseProgram(fe)}),k.isShaderMaterial&&Ht.releaseShaderCache(k))}this.renderBufferDirect=function(k,te,fe,ce,le,Qe){te===null&&(te=Le);const lt=le.isMesh&&le.matrixWorld.determinant()<0,ct=ot(k,te,fe,ce,le);yt.setMaterial(ce,lt);let Ct=fe.index,xt=1;if(ce.wireframe===!0){if(Ct=Bt.getWireframeAttribute(fe),Ct===void 0)return;xt=2}const Yt=fe.drawRange,At=fe.attributes.position;let zt=Yt.start*xt,mn=(Yt.start+Yt.count)*xt;Qe!==null&&(zt=Math.max(zt,Qe.start*xt),mn=Math.min(mn,(Qe.start+Qe.count)*xt)),Ct!==null?(zt=Math.max(zt,0),mn=Math.min(mn,Ct.count)):At!=null&&(zt=Math.max(zt,0),mn=Math.min(mn,At.count));const Pn=mn-zt;if(Pn<0||Pn===1/0)return;St.setup(le,ce,ct,fe,Ct);let xn,Qt=de;if(Ct!==null&&(xn=Oe.get(Ct),Qt=be,Qt.setIndex(xn)),le.isMesh)ce.wireframe===!0?(yt.setLineWidth(ce.wireframeLinewidth*rt()),Qt.setMode(Q.LINES)):Qt.setMode(Q.TRIANGLES);else if(le.isLine){let Dt=ce.linewidth;Dt===void 0&&(Dt=1),yt.setLineWidth(Dt*rt()),le.isLineSegments?Qt.setMode(Q.LINES):le.isLineLoop?Qt.setMode(Q.LINE_LOOP):Qt.setMode(Q.LINE_STRIP)}else le.isPoints?Qt.setMode(Q.POINTS):le.isSprite&&Qt.setMode(Q.TRIANGLES);if(le.isBatchedMesh)if(le._multiDrawInstances!==null)lh("WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),Qt.renderMultiDrawInstances(le._multiDrawStarts,le._multiDrawCounts,le._multiDrawCount,le._multiDrawInstances);else if(_t.get("WEBGL_multi_draw"))Qt.renderMultiDraw(le._multiDrawStarts,le._multiDrawCounts,le._multiDrawCount);else{const Dt=le._multiDrawStarts,$t=le._multiDrawCounts,Lt=le._multiDrawCount,ei=Ct?Oe.get(Ct).bytesPerElement:1,Qi=I.get(ce).currentProgram.getUniforms();for(let Gn=0;Gn<Lt;Gn++)Qi.setValue(Q,"_gl_DrawID",Gn),Qt.render(Dt[Gn]/ei,$t[Gn])}else if(le.isInstancedMesh)Qt.renderInstances(zt,Pn,le.count);else if(fe.isInstancedBufferGeometry){const Dt=fe._maxInstanceCount!==void 0?fe._maxInstanceCount:1/0,$t=Math.min(fe.instanceCount,Dt);Qt.renderInstances(zt,Pn,$t)}else Qt.render(zt,Pn)};function fa(k,te,fe){k.transparent===!0&&k.side===hr&&k.forceSinglePass===!1?(k.side=ws,k.needsUpdate=!0,Re(k,te,fe),k.side=ao,k.needsUpdate=!0,Re(k,te,fe),k.side=hr):Re(k,te,fe)}this.compile=function(k,te,fe=null){fe===null&&(fe=k),P=qe.get(fe),P.init(te),z.push(P),fe.traverseVisible(function(le){le.isLight&&le.layers.test(te.layers)&&(P.pushLight(le),le.castShadow&&P.pushShadow(le))}),k!==fe&&k.traverseVisible(function(le){le.isLight&&le.layers.test(te.layers)&&(P.pushLight(le),le.castShadow&&P.pushShadow(le))}),P.setupLights();const ce=new Set;return k.traverse(function(le){if(!(le.isMesh||le.isPoints||le.isLine||le.isSprite))return;const Qe=le.material;if(Qe)if(Array.isArray(Qe))for(let lt=0;lt<Qe.length;lt++){const ct=Qe[lt];fa(ct,fe,le),ce.add(ct)}else fa(Qe,fe,le),ce.add(Qe)}),P=z.pop(),ce},this.compileAsync=function(k,te,fe=null){const ce=this.compile(k,te,fe);return new Promise(le=>{function Qe(){if(ce.forEach(function(lt){I.get(lt).currentProgram.isReady()&&ce.delete(lt)}),ce.size===0){le(k);return}setTimeout(Qe,10)}_t.get("KHR_parallel_shader_compile")!==null?Qe():setTimeout(Qe,10)})};let Ui=null;function Zi(k){Ui&&Ui(k)}function Ia(){en.stop()}function vi(){en.start()}const en=new xE;en.setAnimationLoop(Zi),typeof self<"u"&&en.setContext(self),this.setAnimationLoop=function(k){Ui=k,ft.setAnimationLoop(k),k===null?en.stop():en.start()},ft.addEventListener("sessionstart",Ia),ft.addEventListener("sessionend",vi),this.render=function(k,te){if(te!==void 0&&te.isCamera!==!0){an("WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(F===!0)return;const fe=ft.enabled===!0&&ft.isPresenting===!0,ce=V!==null&&(ee===null||fe)&&V.begin(N,ee);if(k.matrixWorldAutoUpdate===!0&&k.updateMatrixWorld(),te.parent===null&&te.matrixWorldAutoUpdate===!0&&te.updateMatrixWorld(),ft.enabled===!0&&ft.isPresenting===!0&&(V===null||V.isCompositing()===!1)&&(ft.cameraAutoUpdate===!0&&ft.updateCamera(te),te=ft.getCamera()),k.isScene===!0&&k.onBeforeRender(N,k,te,ee),P=qe.get(k,z.length),P.init(te),z.push(P),It.multiplyMatrices(te.projectionMatrix,te.matrixWorldInverse),Et.setFromProjectionMatrix(It,pr,te.reversedDepth),on=this.localClippingEnabled,wt=Tt.init(this.clippingPlanes,on),L=ze.get(k,O.length),L.init(),O.push(L),ft.enabled===!0&&ft.isPresenting===!0){const lt=N.xr.getDepthSensingMesh();lt!==null&&ci(lt,te,-1/0,N.sortObjects)}ci(k,te,0,N.sortObjects),L.finish(),N.sortObjects===!0&&L.sort(Ne,it),Ue=ft.enabled===!1||ft.isPresenting===!1||ft.hasDepthSensing()===!1,Ue&&st.addToRenderList(L,k),this.info.render.frame++,wt===!0&&Tt.beginShadows();const le=P.state.shadowsArray;if(pt.render(le,k,te),wt===!0&&Tt.endShadows(),this.info.autoReset===!0&&this.info.reset(),(ce&&V.hasRenderPass())===!1){const lt=L.opaque,ct=L.transmissive;if(P.setupLights(),te.isArrayCamera){const Ct=te.cameras;if(ct.length>0)for(let xt=0,Yt=Ct.length;xt<Yt;xt++){const At=Ct[xt];G(lt,ct,k,At)}Ue&&st.render(k);for(let xt=0,Yt=Ct.length;xt<Yt;xt++){const At=Ct[xt];fn(L,k,At,At.viewport)}}else ct.length>0&&G(lt,ct,k,te),Ue&&st.render(k),fn(L,k,te)}ee!==null&&ne===0&&(ue.updateMultisampleRenderTarget(ee),ue.updateRenderTargetMipmap(ee)),ce&&V.end(N),k.isScene===!0&&k.onAfterRender(N,k,te),St.resetDefaultState(),ie=-1,he=null,z.pop(),z.length>0?(P=z[z.length-1],wt===!0&&Tt.setGlobalState(N.clippingPlanes,P.state.camera)):P=null,O.pop(),O.length>0?L=O[O.length-1]:L=null};function ci(k,te,fe,ce){if(k.visible===!1)return;if(k.layers.test(te.layers)){if(k.isGroup)fe=k.renderOrder;else if(k.isLOD)k.autoUpdate===!0&&k.update(te);else if(k.isLight)P.pushLight(k),k.castShadow&&P.pushShadow(k);else if(k.isSprite){if(!k.frustumCulled||Et.intersectsSprite(k)){ce&&me.setFromMatrixPosition(k.matrixWorld).applyMatrix4(It);const lt=gt.update(k),ct=k.material;ct.visible&&L.push(k,lt,ct,fe,me.z,null)}}else if((k.isMesh||k.isLine||k.isPoints)&&(!k.frustumCulled||Et.intersectsObject(k))){const lt=gt.update(k),ct=k.material;if(ce&&(k.boundingSphere!==void 0?(k.boundingSphere===null&&k.computeBoundingSphere(),me.copy(k.boundingSphere.center)):(lt.boundingSphere===null&&lt.computeBoundingSphere(),me.copy(lt.boundingSphere.center)),me.applyMatrix4(k.matrixWorld).applyMatrix4(It)),Array.isArray(ct)){const Ct=lt.groups;for(let xt=0,Yt=Ct.length;xt<Yt;xt++){const At=Ct[xt],zt=ct[At.materialIndex];zt&&zt.visible&&L.push(k,lt,zt,fe,me.z,At)}}else ct.visible&&L.push(k,lt,ct,fe,me.z,null)}}const Qe=k.children;for(let lt=0,ct=Qe.length;lt<ct;lt++)ci(Qe[lt],te,fe,ce)}function fn(k,te,fe,ce){const{opaque:le,transmissive:Qe,transparent:lt}=k;P.setupLightsView(fe),wt===!0&&Tt.setGlobalState(N.clippingPlanes,fe),ce&&yt.viewport(H.copy(ce)),le.length>0&&J(le,te,fe),Qe.length>0&&J(Qe,te,fe),lt.length>0&&J(lt,te,fe),yt.buffers.depth.setTest(!0),yt.buffers.depth.setMask(!0),yt.buffers.color.setMask(!0),yt.setPolygonOffset(!1)}function G(k,te,fe,ce){if((fe.isScene===!0?fe.overrideMaterial:null)!==null)return;if(P.state.transmissionRenderTarget[ce.id]===void 0){const zt=_t.has("EXT_color_buffer_half_float")||_t.has("EXT_color_buffer_float");P.state.transmissionRenderTarget[ce.id]=new Ds(1,1,{generateMipmaps:!0,type:zt?sa:Xa,minFilter:$s,samples:Ft.samples,stencilBuffer:o,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Hn.workingColorSpace})}const Qe=P.state.transmissionRenderTarget[ce.id],lt=ce.viewport||H;Qe.setSize(lt.z*N.transmissionResolutionScale,lt.w*N.transmissionResolutionScale);const ct=N.getRenderTarget(),Ct=N.getActiveCubeFace(),xt=N.getActiveMipmapLevel();N.setRenderTarget(Qe),N.getClearColor(ye),_e=N.getClearAlpha(),_e<1&&N.setClearColor(16777215,.5),N.clear(),Ue&&st.render(fe);const Yt=N.toneMapping;N.toneMapping=Lr;const At=ce.viewport;if(ce.viewport!==void 0&&(ce.viewport=void 0),P.setupLightsView(ce),wt===!0&&Tt.setGlobalState(N.clippingPlanes,ce),J(k,fe,ce),ue.updateMultisampleRenderTarget(Qe),ue.updateRenderTargetMipmap(Qe),_t.has("WEBGL_multisampled_render_to_texture")===!1){let zt=!1;for(let mn=0,Pn=te.length;mn<Pn;mn++){const xn=te[mn],{object:Qt,geometry:Dt,material:$t,group:Lt}=xn;if($t.side===hr&&Qt.layers.test(ce.layers)){const ei=$t.side;$t.side=ws,$t.needsUpdate=!0,oe(Qt,fe,ce,Dt,$t,Lt),$t.side=ei,$t.needsUpdate=!0,zt=!0}}zt===!0&&(ue.updateMultisampleRenderTarget(Qe),ue.updateRenderTargetMipmap(Qe))}N.setRenderTarget(ct,Ct,xt),N.setClearColor(ye,_e),At!==void 0&&(ce.viewport=At),N.toneMapping=Yt}function J(k,te,fe){const ce=te.isScene===!0?te.overrideMaterial:null;for(let le=0,Qe=k.length;le<Qe;le++){const lt=k[le],{object:ct,geometry:Ct,group:xt}=lt;let Yt=lt.material;Yt.allowOverride===!0&&ce!==null&&(Yt=ce),ct.layers.test(fe.layers)&&oe(ct,te,fe,Ct,Yt,xt)}}function oe(k,te,fe,ce,le,Qe){k.onBeforeRender(N,te,fe,ce,le,Qe),k.modelViewMatrix.multiplyMatrices(fe.matrixWorldInverse,k.matrixWorld),k.normalMatrix.getNormalMatrix(k.modelViewMatrix),le.onBeforeRender(N,te,fe,ce,k,Qe),le.transparent===!0&&le.side===hr&&le.forceSinglePass===!1?(le.side=ws,le.needsUpdate=!0,N.renderBufferDirect(fe,te,ce,le,k,Qe),le.side=ao,le.needsUpdate=!0,N.renderBufferDirect(fe,te,ce,le,k,Qe),le.side=hr):N.renderBufferDirect(fe,te,ce,le,k,Qe),k.onAfterRender(N,te,fe,ce,le,Qe)}function Re(k,te,fe){te.isScene!==!0&&(te=Le);const ce=I.get(k),le=P.state.lights,Qe=P.state.shadowsArray,lt=le.state.version,ct=Ht.getParameters(k,le.state,Qe,te,fe),Ct=Ht.getProgramCacheKey(ct);let xt=ce.programs;ce.environment=k.isMeshStandardMaterial?te.environment:null,ce.fog=te.fog,ce.envMap=(k.isMeshStandardMaterial?Xe:Ie).get(k.envMap||ce.environment),ce.envMapRotation=ce.environment!==null&&k.envMap===null?te.environmentRotation:k.envMapRotation,xt===void 0&&(k.addEventListener("dispose",Dn),xt=new Map,ce.programs=xt);let Yt=xt.get(Ct);if(Yt!==void 0){if(ce.currentProgram===Yt&&ce.lightsStateVersion===lt)return He(k,ct),Yt}else ct.uniforms=Ht.getUniforms(k),k.onBeforeCompile(ct,N),Yt=Ht.acquireProgram(ct,Ct),xt.set(Ct,Yt),ce.uniforms=ct.uniforms;const At=ce.uniforms;return(!k.isShaderMaterial&&!k.isRawShaderMaterial||k.clipping===!0)&&(At.clippingPlanes=Tt.uniform),He(k,ct),ce.needsLights=Ze(k),ce.lightsStateVersion=lt,ce.needsLights&&(At.ambientLightColor.value=le.state.ambient,At.lightProbe.value=le.state.probe,At.directionalLights.value=le.state.directional,At.directionalLightShadows.value=le.state.directionalShadow,At.spotLights.value=le.state.spot,At.spotLightShadows.value=le.state.spotShadow,At.rectAreaLights.value=le.state.rectArea,At.ltc_1.value=le.state.rectAreaLTC1,At.ltc_2.value=le.state.rectAreaLTC2,At.pointLights.value=le.state.point,At.pointLightShadows.value=le.state.pointShadow,At.hemisphereLights.value=le.state.hemi,At.directionalShadowMap.value=le.state.directionalShadowMap,At.directionalShadowMatrix.value=le.state.directionalShadowMatrix,At.spotShadowMap.value=le.state.spotShadowMap,At.spotLightMatrix.value=le.state.spotLightMatrix,At.spotLightMap.value=le.state.spotLightMap,At.pointShadowMap.value=le.state.pointShadowMap,At.pointShadowMatrix.value=le.state.pointShadowMatrix),ce.currentProgram=Yt,ce.uniformsList=null,Yt}function Pe(k){if(k.uniformsList===null){const te=k.currentProgram.getUniforms();k.uniformsList=e_.seqWithValue(te.seq,k.uniforms)}return k.uniformsList}function He(k,te){const fe=I.get(k);fe.outputColorSpace=te.outputColorSpace,fe.batching=te.batching,fe.batchingColor=te.batchingColor,fe.instancing=te.instancing,fe.instancingColor=te.instancingColor,fe.instancingMorph=te.instancingMorph,fe.skinning=te.skinning,fe.morphTargets=te.morphTargets,fe.morphNormals=te.morphNormals,fe.morphColors=te.morphColors,fe.morphTargetsCount=te.morphTargetsCount,fe.numClippingPlanes=te.numClippingPlanes,fe.numIntersection=te.numClipIntersection,fe.vertexAlphas=te.vertexAlphas,fe.vertexTangents=te.vertexTangents,fe.toneMapping=te.toneMapping}function ot(k,te,fe,ce,le){te.isScene!==!0&&(te=Le),ue.resetTextureUnits();const Qe=te.fog,lt=ce.isMeshStandardMaterial?te.environment:null,ct=ee===null?N.outputColorSpace:ee.isXRRenderTarget===!0?ee.texture.colorSpace:Ma,Ct=(ce.isMeshStandardMaterial?Xe:Ie).get(ce.envMap||lt),xt=ce.vertexColors===!0&&!!fe.attributes.color&&fe.attributes.color.itemSize===4,Yt=!!fe.attributes.tangent&&(!!ce.normalMap||ce.anisotropy>0),At=!!fe.morphAttributes.position,zt=!!fe.morphAttributes.normal,mn=!!fe.morphAttributes.color;let Pn=Lr;ce.toneMapped&&(ee===null||ee.isXRRenderTarget===!0)&&(Pn=N.toneMapping);const xn=fe.morphAttributes.position||fe.morphAttributes.normal||fe.morphAttributes.color,Qt=xn!==void 0?xn.length:0,Dt=I.get(ce),$t=P.state.lights;if(wt===!0&&(on===!0||k!==he)){const ut=k===he&&ce.id===ie;Tt.setState(ce,k,ut)}let Lt=!1;ce.version===Dt.__version?(Dt.needsLights&&Dt.lightsStateVersion!==$t.state.version||Dt.outputColorSpace!==ct||le.isBatchedMesh&&Dt.batching===!1||!le.isBatchedMesh&&Dt.batching===!0||le.isBatchedMesh&&Dt.batchingColor===!0&&le.colorTexture===null||le.isBatchedMesh&&Dt.batchingColor===!1&&le.colorTexture!==null||le.isInstancedMesh&&Dt.instancing===!1||!le.isInstancedMesh&&Dt.instancing===!0||le.isSkinnedMesh&&Dt.skinning===!1||!le.isSkinnedMesh&&Dt.skinning===!0||le.isInstancedMesh&&Dt.instancingColor===!0&&le.instanceColor===null||le.isInstancedMesh&&Dt.instancingColor===!1&&le.instanceColor!==null||le.isInstancedMesh&&Dt.instancingMorph===!0&&le.morphTexture===null||le.isInstancedMesh&&Dt.instancingMorph===!1&&le.morphTexture!==null||Dt.envMap!==Ct||ce.fog===!0&&Dt.fog!==Qe||Dt.numClippingPlanes!==void 0&&(Dt.numClippingPlanes!==Tt.numPlanes||Dt.numIntersection!==Tt.numIntersection)||Dt.vertexAlphas!==xt||Dt.vertexTangents!==Yt||Dt.morphTargets!==At||Dt.morphNormals!==zt||Dt.morphColors!==mn||Dt.toneMapping!==Pn||Dt.morphTargetsCount!==Qt)&&(Lt=!0):(Lt=!0,Dt.__version=ce.version);let ei=Dt.currentProgram;Lt===!0&&(ei=Re(ce,te,le));let Qi=!1,Gn=!1,Fi=!1;const ri=ei.getUniforms(),we=Dt.uniforms;if(yt.useProgram(ei.program)&&(Qi=!0,Gn=!0,Fi=!0),ce.id!==ie&&(ie=ce.id,Gn=!0),Qi||he!==k){yt.buffers.depth.getReversed()&&k.reversedDepth!==!0&&(k._reversedDepth=!0,k.updateProjectionMatrix()),ri.setValue(Q,"projectionMatrix",k.projectionMatrix),ri.setValue(Q,"viewMatrix",k.matrixWorldInverse);const Ut=ri.map.cameraPosition;Ut!==void 0&&Ut.setValue(Q,mt.setFromMatrixPosition(k.matrixWorld)),Ft.logarithmicDepthBuffer&&ri.setValue(Q,"logDepthBufFC",2/(Math.log(k.far+1)/Math.LN2)),(ce.isMeshPhongMaterial||ce.isMeshToonMaterial||ce.isMeshLambertMaterial||ce.isMeshBasicMaterial||ce.isMeshStandardMaterial||ce.isShaderMaterial)&&ri.setValue(Q,"isOrthographic",k.isOrthographicCamera===!0),he!==k&&(he=k,Gn=!0,Fi=!0)}if(Dt.needsLights&&($t.state.directionalShadowMap.length>0&&ri.setValue(Q,"directionalShadowMap",$t.state.directionalShadowMap,ue),$t.state.spotShadowMap.length>0&&ri.setValue(Q,"spotShadowMap",$t.state.spotShadowMap,ue),$t.state.pointShadowMap.length>0&&ri.setValue(Q,"pointShadowMap",$t.state.pointShadowMap,ue)),le.isSkinnedMesh){ri.setOptional(Q,le,"bindMatrix"),ri.setOptional(Q,le,"bindMatrixInverse");const ut=le.skeleton;ut&&(ut.boneTexture===null&&ut.computeBoneTexture(),ri.setValue(Q,"boneTexture",ut.boneTexture,ue))}le.isBatchedMesh&&(ri.setOptional(Q,le,"batchingTexture"),ri.setValue(Q,"batchingTexture",le._matricesTexture,ue),ri.setOptional(Q,le,"batchingIdTexture"),ri.setValue(Q,"batchingIdTexture",le._indirectTexture,ue),ri.setOptional(Q,le,"batchingColorTexture"),le._colorsTexture!==null&&ri.setValue(Q,"batchingColorTexture",le._colorsTexture,ue));const at=fe.morphAttributes;if((at.position!==void 0||at.normal!==void 0||at.color!==void 0)&&qt.update(le,fe,ei),(Gn||Dt.receiveShadow!==le.receiveShadow)&&(Dt.receiveShadow=le.receiveShadow,ri.setValue(Q,"receiveShadow",le.receiveShadow)),ce.isMeshGouraudMaterial&&ce.envMap!==null&&(we.envMap.value=Ct,we.flipEnvMap.value=Ct.isCubeTexture&&Ct.isRenderTargetTexture===!1?-1:1),ce.isMeshStandardMaterial&&ce.envMap===null&&te.environment!==null&&(we.envMapIntensity.value=te.environmentIntensity),we.dfgLUT!==void 0&&(we.dfgLUT.value=EU()),Gn&&(ri.setValue(Q,"toneMappingExposure",N.toneMappingExposure),Dt.needsLights&&nt(we,Fi),Qe&&ce.fog===!0&&Xt.refreshFogUniforms(we,Qe),Xt.refreshMaterialUniforms(we,ce,Me,ae,P.state.transmissionRenderTarget[k.id]),e_.upload(Q,Pe(Dt),we,ue)),ce.isShaderMaterial&&ce.uniformsNeedUpdate===!0&&(e_.upload(Q,Pe(Dt),we,ue),ce.uniformsNeedUpdate=!1),ce.isSpriteMaterial&&ri.setValue(Q,"center",le.center),ri.setValue(Q,"modelViewMatrix",le.modelViewMatrix),ri.setValue(Q,"normalMatrix",le.normalMatrix),ri.setValue(Q,"modelMatrix",le.matrixWorld),ce.isShaderMaterial||ce.isRawShaderMaterial){const ut=ce.uniformsGroups;for(let Ut=0,Nt=ut.length;Ut<Nt;Ut++){const Vt=ut[Ut];Ye.update(Vt,ei),Ye.bind(Vt,ei)}}return ei}function nt(k,te){k.ambientLightColor.needsUpdate=te,k.lightProbe.needsUpdate=te,k.directionalLights.needsUpdate=te,k.directionalLightShadows.needsUpdate=te,k.pointLights.needsUpdate=te,k.pointLightShadows.needsUpdate=te,k.spotLights.needsUpdate=te,k.spotLightShadows.needsUpdate=te,k.rectAreaLights.needsUpdate=te,k.hemisphereLights.needsUpdate=te}function Ze(k){return k.isMeshLambertMaterial||k.isMeshToonMaterial||k.isMeshPhongMaterial||k.isMeshStandardMaterial||k.isShadowMaterial||k.isShaderMaterial&&k.lights===!0}this.getActiveCubeFace=function(){return K},this.getActiveMipmapLevel=function(){return ne},this.getRenderTarget=function(){return ee},this.setRenderTargetTextures=function(k,te,fe){const ce=I.get(k);ce.__autoAllocateDepthBuffer=k.resolveDepthBuffer===!1,ce.__autoAllocateDepthBuffer===!1&&(ce.__useRenderToTexture=!1),I.get(k.texture).__webglTexture=te,I.get(k.depthTexture).__webglTexture=ce.__autoAllocateDepthBuffer?void 0:fe,ce.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(k,te){const fe=I.get(k);fe.__webglFramebuffer=te,fe.__useDefaultFramebuffer=te===void 0};const je=Q.createFramebuffer();this.setRenderTarget=function(k,te=0,fe=0){ee=k,K=te,ne=fe;let ce=null,le=!1,Qe=!1;if(k){const ct=I.get(k);if(ct.__useDefaultFramebuffer!==void 0){yt.bindFramebuffer(Q.FRAMEBUFFER,ct.__webglFramebuffer),H.copy(k.viewport),Y.copy(k.scissor),$=k.scissorTest,yt.viewport(H),yt.scissor(Y),yt.setScissorTest($),ie=-1;return}else if(ct.__webglFramebuffer===void 0)ue.setupRenderTarget(k);else if(ct.__hasExternalTextures)ue.rebindTextures(k,I.get(k.texture).__webglTexture,I.get(k.depthTexture).__webglTexture);else if(k.depthBuffer){const Yt=k.depthTexture;if(ct.__boundDepthTexture!==Yt){if(Yt!==null&&I.has(Yt)&&(k.width!==Yt.image.width||k.height!==Yt.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");ue.setupDepthRenderbuffer(k)}}const Ct=k.texture;(Ct.isData3DTexture||Ct.isDataArrayTexture||Ct.isCompressedArrayTexture)&&(Qe=!0);const xt=I.get(k).__webglFramebuffer;k.isWebGLCubeRenderTarget?(Array.isArray(xt[te])?ce=xt[te][fe]:ce=xt[te],le=!0):k.samples>0&&ue.useMultisampledRTT(k)===!1?ce=I.get(k).__webglMultisampledFramebuffer:Array.isArray(xt)?ce=xt[fe]:ce=xt,H.copy(k.viewport),Y.copy(k.scissor),$=k.scissorTest}else H.copy(ve).multiplyScalar(Me).floor(),Y.copy(Ce).multiplyScalar(Me).floor(),$=tt;if(fe!==0&&(ce=je),yt.bindFramebuffer(Q.FRAMEBUFFER,ce)&&yt.drawBuffers(k,ce),yt.viewport(H),yt.scissor(Y),yt.setScissorTest($),le){const ct=I.get(k.texture);Q.framebufferTexture2D(Q.FRAMEBUFFER,Q.COLOR_ATTACHMENT0,Q.TEXTURE_CUBE_MAP_POSITIVE_X+te,ct.__webglTexture,fe)}else if(Qe){const ct=te;for(let Ct=0;Ct<k.textures.length;Ct++){const xt=I.get(k.textures[Ct]);Q.framebufferTextureLayer(Q.FRAMEBUFFER,Q.COLOR_ATTACHMENT0+Ct,xt.__webglTexture,fe,ct)}}else if(k!==null&&fe!==0){const ct=I.get(k.texture);Q.framebufferTexture2D(Q.FRAMEBUFFER,Q.COLOR_ATTACHMENT0,Q.TEXTURE_2D,ct.__webglTexture,fe)}ie=-1},this.readRenderTargetPixels=function(k,te,fe,ce,le,Qe,lt,ct=0){if(!(k&&k.isWebGLRenderTarget)){an("WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Ct=I.get(k).__webglFramebuffer;if(k.isWebGLCubeRenderTarget&&lt!==void 0&&(Ct=Ct[lt]),Ct){yt.bindFramebuffer(Q.FRAMEBUFFER,Ct);try{const xt=k.textures[ct],Yt=xt.format,At=xt.type;if(!Ft.textureFormatReadable(Yt)){an("WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!Ft.textureTypeReadable(At)){an("WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}te>=0&&te<=k.width-ce&&fe>=0&&fe<=k.height-le&&(k.textures.length>1&&Q.readBuffer(Q.COLOR_ATTACHMENT0+ct),Q.readPixels(te,fe,ce,le,We.convert(Yt),We.convert(At),Qe))}finally{const xt=ee!==null?I.get(ee).__webglFramebuffer:null;yt.bindFramebuffer(Q.FRAMEBUFFER,xt)}}},this.readRenderTargetPixelsAsync=async function(k,te,fe,ce,le,Qe,lt,ct=0){if(!(k&&k.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Ct=I.get(k).__webglFramebuffer;if(k.isWebGLCubeRenderTarget&&lt!==void 0&&(Ct=Ct[lt]),Ct)if(te>=0&&te<=k.width-ce&&fe>=0&&fe<=k.height-le){yt.bindFramebuffer(Q.FRAMEBUFFER,Ct);const xt=k.textures[ct],Yt=xt.format,At=xt.type;if(!Ft.textureFormatReadable(Yt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Ft.textureTypeReadable(At))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const zt=Q.createBuffer();Q.bindBuffer(Q.PIXEL_PACK_BUFFER,zt),Q.bufferData(Q.PIXEL_PACK_BUFFER,Qe.byteLength,Q.STREAM_READ),k.textures.length>1&&Q.readBuffer(Q.COLOR_ATTACHMENT0+ct),Q.readPixels(te,fe,ce,le,We.convert(Yt),We.convert(At),0);const mn=ee!==null?I.get(ee).__webglFramebuffer:null;yt.bindFramebuffer(Q.FRAMEBUFFER,mn);const Pn=Q.fenceSync(Q.SYNC_GPU_COMMANDS_COMPLETE,0);return Q.flush(),await x2(Q,Pn,4),Q.bindBuffer(Q.PIXEL_PACK_BUFFER,zt),Q.getBufferSubData(Q.PIXEL_PACK_BUFFER,0,Qe),Q.deleteBuffer(zt),Q.deleteSync(Pn),Qe}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(k,te=null,fe=0){const ce=Math.pow(2,-fe),le=Math.floor(k.image.width*ce),Qe=Math.floor(k.image.height*ce),lt=te!==null?te.x:0,ct=te!==null?te.y:0;ue.setTexture2D(k,0),Q.copyTexSubImage2D(Q.TEXTURE_2D,fe,0,0,lt,ct,le,Qe),yt.unbindTexture()};const vt=Q.createFramebuffer(),ht=Q.createFramebuffer();this.copyTextureToTexture=function(k,te,fe=null,ce=null,le=0,Qe=null){Qe===null&&(le!==0?(lh("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),Qe=le,le=0):Qe=0);let lt,ct,Ct,xt,Yt,At,zt,mn,Pn;const xn=k.isCompressedTexture?k.mipmaps[Qe]:k.image;if(fe!==null)lt=fe.max.x-fe.min.x,ct=fe.max.y-fe.min.y,Ct=fe.isBox3?fe.max.z-fe.min.z:1,xt=fe.min.x,Yt=fe.min.y,At=fe.isBox3?fe.min.z:0;else{const at=Math.pow(2,-le);lt=Math.floor(xn.width*at),ct=Math.floor(xn.height*at),k.isDataArrayTexture?Ct=xn.depth:k.isData3DTexture?Ct=Math.floor(xn.depth*at):Ct=1,xt=0,Yt=0,At=0}ce!==null?(zt=ce.x,mn=ce.y,Pn=ce.z):(zt=0,mn=0,Pn=0);const Qt=We.convert(te.format),Dt=We.convert(te.type);let $t;te.isData3DTexture?(ue.setTexture3D(te,0),$t=Q.TEXTURE_3D):te.isDataArrayTexture||te.isCompressedArrayTexture?(ue.setTexture2DArray(te,0),$t=Q.TEXTURE_2D_ARRAY):(ue.setTexture2D(te,0),$t=Q.TEXTURE_2D),Q.pixelStorei(Q.UNPACK_FLIP_Y_WEBGL,te.flipY),Q.pixelStorei(Q.UNPACK_PREMULTIPLY_ALPHA_WEBGL,te.premultiplyAlpha),Q.pixelStorei(Q.UNPACK_ALIGNMENT,te.unpackAlignment);const Lt=Q.getParameter(Q.UNPACK_ROW_LENGTH),ei=Q.getParameter(Q.UNPACK_IMAGE_HEIGHT),Qi=Q.getParameter(Q.UNPACK_SKIP_PIXELS),Gn=Q.getParameter(Q.UNPACK_SKIP_ROWS),Fi=Q.getParameter(Q.UNPACK_SKIP_IMAGES);Q.pixelStorei(Q.UNPACK_ROW_LENGTH,xn.width),Q.pixelStorei(Q.UNPACK_IMAGE_HEIGHT,xn.height),Q.pixelStorei(Q.UNPACK_SKIP_PIXELS,xt),Q.pixelStorei(Q.UNPACK_SKIP_ROWS,Yt),Q.pixelStorei(Q.UNPACK_SKIP_IMAGES,At);const ri=k.isDataArrayTexture||k.isData3DTexture,we=te.isDataArrayTexture||te.isData3DTexture;if(k.isDepthTexture){const at=I.get(k),ut=I.get(te),Ut=I.get(at.__renderTarget),Nt=I.get(ut.__renderTarget);yt.bindFramebuffer(Q.READ_FRAMEBUFFER,Ut.__webglFramebuffer),yt.bindFramebuffer(Q.DRAW_FRAMEBUFFER,Nt.__webglFramebuffer);for(let Vt=0;Vt<Ct;Vt++)ri&&(Q.framebufferTextureLayer(Q.READ_FRAMEBUFFER,Q.COLOR_ATTACHMENT0,I.get(k).__webglTexture,le,At+Vt),Q.framebufferTextureLayer(Q.DRAW_FRAMEBUFFER,Q.COLOR_ATTACHMENT0,I.get(te).__webglTexture,Qe,Pn+Vt)),Q.blitFramebuffer(xt,Yt,lt,ct,zt,mn,lt,ct,Q.DEPTH_BUFFER_BIT,Q.NEAREST);yt.bindFramebuffer(Q.READ_FRAMEBUFFER,null),yt.bindFramebuffer(Q.DRAW_FRAMEBUFFER,null)}else if(le!==0||k.isRenderTargetTexture||I.has(k)){const at=I.get(k),ut=I.get(te);yt.bindFramebuffer(Q.READ_FRAMEBUFFER,vt),yt.bindFramebuffer(Q.DRAW_FRAMEBUFFER,ht);for(let Ut=0;Ut<Ct;Ut++)ri?Q.framebufferTextureLayer(Q.READ_FRAMEBUFFER,Q.COLOR_ATTACHMENT0,at.__webglTexture,le,At+Ut):Q.framebufferTexture2D(Q.READ_FRAMEBUFFER,Q.COLOR_ATTACHMENT0,Q.TEXTURE_2D,at.__webglTexture,le),we?Q.framebufferTextureLayer(Q.DRAW_FRAMEBUFFER,Q.COLOR_ATTACHMENT0,ut.__webglTexture,Qe,Pn+Ut):Q.framebufferTexture2D(Q.DRAW_FRAMEBUFFER,Q.COLOR_ATTACHMENT0,Q.TEXTURE_2D,ut.__webglTexture,Qe),le!==0?Q.blitFramebuffer(xt,Yt,lt,ct,zt,mn,lt,ct,Q.COLOR_BUFFER_BIT,Q.NEAREST):we?Q.copyTexSubImage3D($t,Qe,zt,mn,Pn+Ut,xt,Yt,lt,ct):Q.copyTexSubImage2D($t,Qe,zt,mn,xt,Yt,lt,ct);yt.bindFramebuffer(Q.READ_FRAMEBUFFER,null),yt.bindFramebuffer(Q.DRAW_FRAMEBUFFER,null)}else we?k.isDataTexture||k.isData3DTexture?Q.texSubImage3D($t,Qe,zt,mn,Pn,lt,ct,Ct,Qt,Dt,xn.data):te.isCompressedArrayTexture?Q.compressedTexSubImage3D($t,Qe,zt,mn,Pn,lt,ct,Ct,Qt,xn.data):Q.texSubImage3D($t,Qe,zt,mn,Pn,lt,ct,Ct,Qt,Dt,xn):k.isDataTexture?Q.texSubImage2D(Q.TEXTURE_2D,Qe,zt,mn,lt,ct,Qt,Dt,xn.data):k.isCompressedTexture?Q.compressedTexSubImage2D(Q.TEXTURE_2D,Qe,zt,mn,xn.width,xn.height,Qt,xn.data):Q.texSubImage2D(Q.TEXTURE_2D,Qe,zt,mn,lt,ct,Qt,Dt,xn);Q.pixelStorei(Q.UNPACK_ROW_LENGTH,Lt),Q.pixelStorei(Q.UNPACK_IMAGE_HEIGHT,ei),Q.pixelStorei(Q.UNPACK_SKIP_PIXELS,Qi),Q.pixelStorei(Q.UNPACK_SKIP_ROWS,Gn),Q.pixelStorei(Q.UNPACK_SKIP_IMAGES,Fi),Qe===0&&te.generateMipmaps&&Q.generateMipmap($t),yt.unbindTexture()},this.initRenderTarget=function(k){I.get(k).__webglFramebuffer===void 0&&ue.setupRenderTarget(k)},this.initTexture=function(k){k.isCubeTexture?ue.setTextureCube(k,0):k.isData3DTexture?ue.setTexture3D(k,0):k.isDataArrayTexture||k.isCompressedArrayTexture?ue.setTexture2DArray(k,0):ue.setTexture2D(k,0),yt.unbindTexture()},this.resetState=function(){K=0,ne=0,ee=null,yt.reset(),St.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return pr}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=Hn._getDrawingBufferColorSpace(e),t.unpackColorSpace=Hn._getUnpackColorSpace()}}const TU=Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping:Pg,AddEquation:mc,AddOperation:rb,AdditiveAnimationBlendMode:cx,AdditiveBlending:Ky,AgXToneMapping:tx,AlphaFormat:ox,AlwaysCompare:vb,AlwaysDepth:Ng,AlwaysStencilFunc:fx,AmbientLight:K1,AnimationAction:oE,AnimationClip:Qu,AnimationLoader:lB,AnimationMixer:lE,AnimationObjectGroup:DB,AnimationUtils:aB,ArcCurve:g1,ArrayCamera:iE,ArrowHelper:a3,AttachedBindMode:ix,Audio:aE,AudioAnalyser:AB,AudioContext:yA,AudioListener:_B,AudioLoader:mB,AxesHelper:s3,BackSide:ws,BasicDepthPacking:ub,BasicShadowMap:GM,BatchedMesh:r1,Bone:Lp,BooleanKeyframeTrack:ju,Box2:VB,Box3:Ja,Box3Helper:n3,BoxGeometry:zu,BoxHelper:t3,BufferAttribute:Kn,BufferGeometry:yn,BufferGeometryLoader:Q1,ByteType:Gg,Cache:ko,Camera:q0,CameraHelper:e3,CanvasTexture:Cw,CapsuleGeometry:yv,CatmullRomCurve3:v1,CineonToneMapping:$y,CircleGeometry:xv,ClampToEdgeWrapping:Gi,Clock:xA,Color:Rt,ColorKeyframeTrack:fA,ColorManagement:Hn,CompressedArrayTexture:Ew,CompressedCubeTexture:Tw,CompressedTexture:_v,CompressedTextureLoader:cB,ConeGeometry:Pp,ConstantAlphaFactor:ib,ConstantColorFactor:tb,Controls:o3,CubeCamera:kb,CubeDepthTexture:p1,CubeReflectionMapping:ro,CubeRefractionMapping:vc,CubeTexture:Cp,CubeTextureLoader:X1,CubeUVReflectionMapping:ih,CubicBezierCurve:Qx,CubicBezierCurve3:y1,CubicInterpolant:G1,CullFaceBack:qy,CullFaceFront:PM,CullFaceFrontBack:UR,CullFaceNone:HM,Curve:fo,CurvePath:A1,CustomBlending:zM,CustomToneMapping:ex,CylinderGeometry:Hp,Cylindrical:zB,Data3DTexture:B0,DataArrayTexture:w0,DataTexture:Or,DataTextureLoader:hA,DataUtils:Pu,DecrementStencilOp:KR,DecrementWrapStencilOp:jR,DefaultLoadingManager:k1,DepthFormat:Ho,DepthStencilFormat:yc,DepthTexture:Uh,DetachedBindMode:ob,DirectionalLight:Vv,DirectionalLightHelper:$B,DiscreteInterpolant:z1,DodecahedronGeometry:Av,DoubleSide:hr,DstAlphaFactor:jM,DstColorFactor:QM,DynamicCopyUsage:f2,DynamicDrawUsage:s2,DynamicReadUsage:l2,EdgesGeometry:m1,EllipseCurve:Ev,EqualCompare:pb,EqualDepth:Og,EqualStencilFunc:e2,EquirectangularReflectionMapping:nh,EquirectangularRefractionMapping:sp,Euler:vr,EventDispatcher:Po,ExternalTexture:Jx,ExtrudeGeometry:Dv,FileLoader:Na,Float16BufferAttribute:iw,Float32BufferAttribute:Wt,FloatType:Vi,Fog:Z0,FogExp2:j0,FramebufferTexture:bw,FrontSide:ao,Frustum:Nh,FrustumArray:ov,GLBufferAttribute:FB,GLSL1:d2,GLSL3:hx,GreaterCompare:mb,GreaterDepth:Fg,GreaterEqualCompare:C0,GreaterEqualDepth:Ig,GreaterEqualStencilFunc:a2,GreaterStencilFunc:n2,GridHelper:ZB,Group:Ur,HalfFloatType:sa,HemisphereLight:Y1,HemisphereLightHelper:jB,IcosahedronGeometry:Jp,ImageBitmapLoader:_A,ImageLoader:Wp,ImageUtils:Tb,IncrementStencilOp:qR,IncrementWrapStencilOp:WR,InstancedBufferAttribute:Bc,InstancedBufferGeometry:Z1,InstancedInterleavedBuffer:IB,InstancedMesh:sv,Int16BufferAttribute:tw,Int32BufferAttribute:nw,Int8BufferAttribute:Q2,IntType:op,InterleavedBuffer:Th,InterleavedBufferAttribute:Nl,Interpolant:Wu,InterpolateDiscrete:Du,InterpolateLinear:xc,InterpolateSmooth:b0,InterpolationSamplingMode:g2,InterpolationSamplingType:m2,InvertStencilOp:ZR,KeepStencilOp:Ou,KeyframeTrack:Fr,LOD:Wb,LatheGeometry:Lv,Layers:vh,LessCompare:db,LessDepth:Ug,LessEqualCompare:T0,LessEqualDepth:Cu,LessEqualStencilFunc:t2,LessStencilFunc:$R,Light:Uc,LightProbe:j1,Line:Vo,Line3:YB,LineBasicMaterial:ss,LineCurve:$x,LineCurve3:x1,LineDashedMaterial:H1,LineLoop:pv,LineSegments:Ir,LinearFilter:In,LinearInterpolant:uA,LinearMipMapLinearFilter:ax,LinearMipMapNearestFilter:FR,LinearMipmapLinearFilter:$s,LinearMipmapNearestFilter:wu,LinearSRGBColorSpace:Ma,LinearToneMapping:Zy,LinearTransfer:vp,Loader:Ka,LoaderUtils:yr,LoadingManager:Pv,LoopOnce:pp,LoopPingPong:cb,LoopRepeat:lb,MOUSE:LR,Material:oa,MaterialLoader:kv,MathUtils:R0,Matrix2:CA,Matrix3:Tn,Matrix4:cn,MaxEquation:YM,Mesh:Oi,MeshBasicMaterial:La,MeshDepthMaterial:rA,MeshDistanceMaterial:oA,MeshLambertMaterial:I1,MeshMatcapMaterial:F1,MeshNormalMaterial:O1,MeshPhongMaterial:N1,MeshPhysicalMaterial:la,MeshStandardMaterial:qu,MeshToonMaterial:U1,MinEquation:XM,MirroredRepeatWrapping:Ru,MixOperation:sb,MultiplyBlending:jy,MultiplyOperation:ap,NearestFilter:zi,NearestMipMapLinearFilter:IR,NearestMipMapNearestFilter:OR,NearestMipmapLinearFilter:_c,NearestMipmapNearestFilter:rp,NeutralToneMapping:nx,NeverCompare:hb,NeverDepth:Lg,NeverStencilFunc:QR,NoBlending:so,NoColorSpace:El,NoNormalPacking:VR,NoToneMapping:Lr,NormalAnimationBlendMode:E0,NormalBlending:Tu,NormalGAPacking:XR,NormalRGPacking:kR,NotEqualCompare:gb,NotEqualDepth:Hg,NotEqualStencilFunc:i2,NumberKeyframeTrack:Ul,Object3D:kn,ObjectLoader:dB,ObjectSpaceNormalMap:fb,OctahedronGeometry:qp,OneFactor:qM,OneMinusConstantAlphaFactor:ab,OneMinusConstantColorFactor:nb,OneMinusDstAlphaFactor:ZM,OneMinusDstColorFactor:$M,OneMinusSrcAlphaFactor:Dg,OneMinusSrcColorFactor:WM,OrthographicCamera:Hl,PCFShadowMap:th,PCFSoftShadowMap:ip,PMREMGenerator:IA,Path:Rv,PerspectiveCamera:Ea,Plane:Dc,PlaneGeometry:Nc,PlaneHelper:i3,PointLight:zv,PointLightHelper:KB,Points:vv,PointsMaterial:Fp,PolarGridHelper:QB,PolyhedronGeometry:Lc,PositionalAudio:xB,PropertyBinding:$n,PropertyMixer:rE,QuadraticBezierCurve:eA,QuadraticBezierCurve3:tA,Quaternion:Ya,QuaternionKeyframeTrack:Ol,QuaternionLinearInterpolant:V1,R11_EAC_Format:$g,RED_GREEN_RGTC2_Format:S0,RED_RGTC1_Format:x0,REVISION:np,RG11_EAC_Format:t0,RGBADepthPacking:PR,RGBAFormat:ga,RGBAIntegerFormat:Yg,RGBA_ASTC_10x10_Format:p0,RGBA_ASTC_10x5_Format:f0,RGBA_ASTC_10x6_Format:h0,RGBA_ASTC_10x8_Format:d0,RGBA_ASTC_12x10_Format:m0,RGBA_ASTC_12x12_Format:g0,RGBA_ASTC_4x4_Format:i0,RGBA_ASTC_5x4_Format:a0,RGBA_ASTC_5x5_Format:s0,RGBA_ASTC_6x5_Format:r0,RGBA_ASTC_6x6_Format:o0,RGBA_ASTC_8x5_Format:l0,RGBA_ASTC_8x6_Format:c0,RGBA_ASTC_8x8_Format:u0,RGBA_BPTC_Format:v0,RGBA_ETC2_EAC_Format:Qg,RGBA_PVRTC_2BPPV1_Format:Wg,RGBA_PVRTC_4BPPV1_Format:Kg,RGBA_S3TC_DXT1_Format:fp,RGBA_S3TC_DXT3_Format:hp,RGBA_S3TC_DXT5_Format:dp,RGBDepthPacking:GR,RGBFormat:lx,RGBIntegerFormat:HR,RGB_BPTC_SIGNED_Format:_0,RGB_BPTC_UNSIGNED_Format:y0,RGB_ETC1_Format:jg,RGB_ETC2_Format:Zg,RGB_PVRTC_2BPPV1_Format:qg,RGB_PVRTC_4BPPV1_Format:Jg,RGB_S3TC_DXT1_Format:up,RGDepthPacking:zR,RGFormat:Bu,RGIntegerFormat:Xg,RawShaderMaterial:sA,Ray:mh,Raycaster:EA,RectAreaLight:W1,RedFormat:lp,RedIntegerFormat:cp,ReinhardToneMapping:Qy,RenderTarget:_x,RenderTarget3D:NB,RepeatWrapping:oo,ReplaceStencilOp:JR,ReverseSubtractEquation:kM,RingGeometry:Nv,SIGNED_R11_EAC_Format:e0,SIGNED_RED_GREEN_RGTC2_Format:M0,SIGNED_RED_RGTC1_Format:A0,SIGNED_RG11_EAC_Format:n0,SRGBColorSpace:ra,SRGBTransfer:gi,Scene:Rp,ShaderChunk:Ln,ShaderLib:po,ShaderMaterial:Ns,ShadowMaterial:L1,Shape:Yu,ShapeGeometry:Uv,ShapePath:r3,ShapeUtils:ho,ShortType:zg,Skeleton:Dh,SkeletonHelper:qB,SkinnedMesh:iv,Source:Mc,Sphere:Da,SphereGeometry:Kp,Spherical:GB,SphericalHarmonics3:gA,SplineCurve:nA,SpotLight:Gv,SpotLightHelper:JB,Sprite:qb,SpriteMaterial:Fx,SrcAlphaFactor:Bg,SrcAlphaSaturateFactor:eb,SrcColorFactor:KM,StaticCopyUsage:u2,StaticDrawUsage:_p,StaticReadUsage:o2,StereoCamera:gB,StreamCopyUsage:h2,StreamDrawUsage:r2,StreamReadUsage:c2,StringKeyframeTrack:Zu,SubtractEquation:VM,SubtractiveBlending:Wy,TOUCH:NR,TangentSpaceNormalMap:Ac,TetrahedronGeometry:Ov,Texture:li,TextureLoader:dA,TextureUtils:h3,Timer:HB,TimestampQuery:p2,TorusGeometry:Iv,TorusKnotGeometry:Fv,Triangle:er,TriangleFanDrawMode:Uu,TriangleStripDrawMode:gp,TrianglesDrawMode:ux,TubeGeometry:Hv,UVMapping:gc,Uint16BufferAttribute:Nx,Uint32BufferAttribute:Ux,Uint8BufferAttribute:$2,Uint8ClampedBufferAttribute:ew,Uniform:bA,UniformsGroup:OB,UniformsLib:Pt,UniformsUtils:Gb,UnsignedByteType:Xa,UnsignedInt101111Type:rx,UnsignedInt248Type:sh,UnsignedInt5999Type:sx,UnsignedIntType:dr,UnsignedShort4444Type:Vg,UnsignedShort5551Type:kg,UnsignedShortType:ah,VSMShadowMap:Eu,Vector2:et,Vector3:Z,Vector4:Ti,VectorKeyframeTrack:Il,VideoFrameTexture:Mw,VideoTexture:d1,WebGL3DRenderTarget:z2,WebGLArrayRenderTarget:G2,WebGLCoordinateSystem:pr,WebGLCubeRenderTarget:K0,WebGLRenderTarget:Ds,WebGLRenderer:zA,WebGLUtils:qE,WebGPUCoordinateSystem:rh,WebXRController:W0,WireframeGeometry:w1,WrapAroundEnding:mp,ZeroCurvatureEnding:Lu,ZeroFactor:JM,ZeroSlopeEnding:Nu,ZeroStencilOp:YR,createCanvasElement:xb,error:an,getConsoleFunction:y2,log:xp,setConsoleFunction:_2,warn:Ot,warnOnce:lh},Symbol.toStringTag,{value:"Module"}));var VA={exports:{}},Pl={};var KE;function CU(){return KE||(KE=1,Pl.ConcurrentRoot=1,Pl.ContinuousEventPriority=8,Pl.DefaultEventPriority=32,Pl.DiscreteEventPriority=2,Pl.IdleEventPriority=268435456,Pl.LegacyRoot=0,Pl.NoEventPriority=0),Pl}var WE;function RU(){return WE||(WE=1,VA.exports=CU()),VA.exports}var n_=RU(),kA={exports:{}},XA={},YA={exports:{}},JA={};var jE;function wU(){if(jE)return JA;jE=1;var s=eh();function e(v,y){return v===y&&(v!==0||1/v===1/y)||v!==v&&y!==y}var t=typeof Object.is=="function"?Object.is:e,n=s.useState,i=s.useEffect,o=s.useLayoutEffect,l=s.useDebugValue;function h(v,y){var x=y(),b=n({inst:{value:x,getSnapshot:y}}),R=b[0].inst,T=b[1];return o(function(){R.value=x,R.getSnapshot=y,d(R)&&T({inst:R})},[v,x,y]),i(function(){return d(R)&&T({inst:R}),v(function(){d(R)&&T({inst:R})})},[v]),l(x),x}function d(v){var y=v.getSnapshot;v=v.value;try{var x=y();return!t(v,x)}catch{return!0}}function p(v,y){return y()}var _=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:h;return JA.useSyncExternalStore=s.useSyncExternalStore!==void 0?s.useSyncExternalStore:_,JA}var ZE;function BU(){return ZE||(ZE=1,YA.exports=wU()),YA.exports}var QE;function DU(){if(QE)return XA;QE=1;var s=eh(),e=BU();function t(p,_){return p===_&&(p!==0||1/p===1/_)||p!==p&&_!==_}var n=typeof Object.is=="function"?Object.is:t,i=e.useSyncExternalStore,o=s.useRef,l=s.useEffect,h=s.useMemo,d=s.useDebugValue;return XA.useSyncExternalStoreWithSelector=function(p,_,v,y,x){var b=o(null);if(b.current===null){var R={hasValue:!1,value:null};b.current=R}else R=b.current;b=h(function(){function M(O){if(!w){if(w=!0,D=O,O=y(O),x!==void 0&&R.hasValue){var z=R.value;if(x(z,O))return L=z}return L=O}if(z=L,n(D,O))return z;var V=y(O);return x!==void 0&&x(z,V)?(D=O,z):(D=O,L=V)}var w=!1,D,L,P=v===void 0?null:v;return[function(){return M(_())},P===null?void 0:function(){return M(P())}]},[_,v,y,x]);var T=i(p,b[0],b[1]);return l(function(){R.hasValue=!0,R.value=T},[T]),d(T),T},XA}var $E;function LU(){return $E||($E=1,kA.exports=DU()),kA.exports}var NU=LU();const UU=Py(NU),eT=s=>{let e;const t=new Set,n=(p,_)=>{const v=typeof p=="function"?p(e):p;if(!Object.is(v,e)){const y=e;e=_??(typeof v!="object"||v===null)?v:Object.assign({},e,v),t.forEach(x=>x(e,y))}},i=()=>e,h={setState:n,getState:i,getInitialState:()=>d,subscribe:p=>(t.add(p),()=>t.delete(p))},d=e=s(n,i,h);return h},OU=(s=>s?eT(s):eT),{useSyncExternalStoreWithSelector:IU}=UU,FU=s=>s;function HU(s,e=FU,t){const n=IU(s.subscribe,s.getState,s.getInitialState,e,t);return wM.useDebugValue(n),n}const tT=(s,e)=>{const t=OU(s),n=(i,o=e)=>HU(t,i,o);return Object.assign(n,t),n},nT=((s,e)=>s?tT(s,e):tT),PU=s=>typeof s=="object"&&typeof s.then=="function",cf=[];function iT(s,e,t=(n,i)=>n===i){if(s===e)return!0;if(!s||!e)return!1;const n=s.length;if(e.length!==n)return!1;for(let i=0;i<n;i++)if(!t(s[i],e[i]))return!1;return!0}function aT(s,e=null,t=!1,n={}){e===null&&(e=[s]);for(const o of cf)if(iT(e,o.keys,o.equal)){if(t)return;if(Object.prototype.hasOwnProperty.call(o,"error"))throw o.error;if(Object.prototype.hasOwnProperty.call(o,"response"))return n.lifespan&&n.lifespan>0&&(o.timeout&&clearTimeout(o.timeout),o.timeout=setTimeout(o.remove,n.lifespan)),o.response;if(!t)throw o.promise}const i={keys:e,equal:n.equal,remove:()=>{const o=cf.indexOf(i);o!==-1&&cf.splice(o,1)},promise:(PU(s)?s:s(...e)).then(o=>{i.response=o,n.lifespan&&n.lifespan>0&&(i.timeout=setTimeout(i.remove,n.lifespan))}).catch(o=>i.error=o)};if(cf.push(i),!t)throw i.promise}const GU=(s,e,t)=>aT(s,e,!1,t),zU=(s,e,t)=>{aT(s,e,!0,t)},VU=s=>{if(s===void 0||s.length===0)cf.splice(0,cf.length);else{const e=cf.find(t=>iT(s,t.keys,t.equal));e&&e.remove()}};var qA={exports:{}},KA={exports:{}},WA={exports:{}},jA={};var sT;function kU(){return sT||(sT=1,(function(s){function e(H,Y){var $=H.length;H.push(Y);e:for(;0<$;){var ye=$-1>>>1,_e=H[ye];if(0<i(_e,Y))H[ye]=Y,H[$]=_e,$=ye;else break e}}function t(H){return H.length===0?null:H[0]}function n(H){if(H.length===0)return null;var Y=H[0],$=H.pop();if($!==Y){H[0]=$;e:for(var ye=0,_e=H.length,W=_e>>>1;ye<W;){var ae=2*(ye+1)-1,Me=H[ae],Ne=ae+1,it=H[Ne];if(0>i(Me,$))Ne<_e&&0>i(it,Me)?(H[ye]=it,H[Ne]=$,ye=Ne):(H[ye]=Me,H[ae]=$,ye=ae);else if(Ne<_e&&0>i(it,$))H[ye]=it,H[Ne]=$,ye=Ne;else break e}}return Y}function i(H,Y){var $=H.sortIndex-Y.sortIndex;return $!==0?$:H.id-Y.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;s.unstable_now=function(){return o.now()}}else{var l=Date,h=l.now();s.unstable_now=function(){return l.now()-h}}var d=[],p=[],_=1,v=null,y=3,x=!1,b=!1,R=!1,T=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;function D(H){for(var Y=t(p);Y!==null;){if(Y.callback===null)n(p);else if(Y.startTime<=H)n(p),Y.sortIndex=Y.expirationTime,e(d,Y);else break;Y=t(p)}}function L(H){if(R=!1,D(H),!b)if(t(d)!==null)b=!0,ie();else{var Y=t(p);Y!==null&&he(L,Y.startTime-H)}}var P=!1,O=-1,z=5,V=-1;function N(){return!(s.unstable_now()-V<z)}function F(){if(P){var H=s.unstable_now();V=H;var Y=!0;try{e:{b=!1,R&&(R=!1,M(O),O=-1),x=!0;var $=y;try{t:{for(D(H),v=t(d);v!==null&&!(v.expirationTime>H&&N());){var ye=v.callback;if(typeof ye=="function"){v.callback=null,y=v.priorityLevel;var _e=ye(v.expirationTime<=H);if(H=s.unstable_now(),typeof _e=="function"){v.callback=_e,D(H),Y=!0;break t}v===t(d)&&n(d),D(H)}else n(d);v=t(d)}if(v!==null)Y=!0;else{var W=t(p);W!==null&&he(L,W.startTime-H),Y=!1}}break e}finally{v=null,y=$,x=!1}Y=void 0}}finally{Y?K():P=!1}}}var K;if(typeof w=="function")K=function(){w(F)};else if(typeof MessageChannel<"u"){var ne=new MessageChannel,ee=ne.port2;ne.port1.onmessage=F,K=function(){ee.postMessage(null)}}else K=function(){T(F,0)};function ie(){P||(P=!0,K())}function he(H,Y){O=T(function(){H(s.unstable_now())},Y)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(H){H.callback=null},s.unstable_continueExecution=function(){b||x||(b=!0,ie())},s.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):z=0<H?Math.floor(1e3/H):5},s.unstable_getCurrentPriorityLevel=function(){return y},s.unstable_getFirstCallbackNode=function(){return t(d)},s.unstable_next=function(H){switch(y){case 1:case 2:case 3:var Y=3;break;default:Y=y}var $=y;y=Y;try{return H()}finally{y=$}},s.unstable_pauseExecution=function(){},s.unstable_requestPaint=function(){},s.unstable_runWithPriority=function(H,Y){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var $=y;y=H;try{return Y()}finally{y=$}},s.unstable_scheduleCallback=function(H,Y,$){var ye=s.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?ye+$:ye):$=ye,H){case 1:var _e=-1;break;case 2:_e=250;break;case 5:_e=1073741823;break;case 4:_e=1e4;break;default:_e=5e3}return _e=$+_e,H={id:_++,callback:Y,priorityLevel:H,startTime:$,expirationTime:_e,sortIndex:-1},$>ye?(H.sortIndex=$,e(p,H),t(d)===null&&H===t(p)&&(R?(M(O),O=-1):R=!0,he(L,$-ye))):(H.sortIndex=_e,e(d,H),b||x||(b=!0,ie())),H},s.unstable_shouldYield=N,s.unstable_wrapCallback=function(H){var Y=y;return function(){var $=y;y=Y;try{return H.apply(this,arguments)}finally{y=$}}}})(jA)),jA}var rT;function XU(){return rT||(rT=1,WA.exports=kU()),WA.exports}var oT;function YU(){return oT||(oT=1,(function(s){s.exports=function(e){function t(c,u,g,S){return new Dm(c,u,g,S)}function n(){}function i(c){var u="https://react.dev/errors/"+c;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)u+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+c+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(c){return c===null||typeof c!="object"?null:(c=Hm&&c[Hm]||c["@@iterator"],typeof c=="function"?c:null)}function l(c){if(c==null)return null;if(typeof c=="function")return c.$$typeof===ec?null:c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case nu:return"Fragment";case br:return"Portal";case Fm:return"Profiler";case Im:return"StrictMode";case xd:return"Suspense";case ul:return"SuspenseList"}if(typeof c=="object")switch(c.$$typeof){case Jr:return(c.displayName||"Context")+".Provider";case cl:return(c._context.displayName||"Context")+".Consumer";case iu:var u=c.render;return c=c.displayName,c||(c=u.displayName||u.name||"",c=c!==""?"ForwardRef("+c+")":"ForwardRef"),c;case Bf:return u=c.displayName||null,u!==null?u:l(c.type)||"Memo";case Er:u=c._payload,c=c._init;try{return l(c(u))}catch{}}return null}function h(c){if(Ad===void 0)try{throw Error()}catch(g){var u=g.stack.trim().match(/\n( *(at )?)/);Ad=u&&u[1]||"",Pm=-1<g.stack.indexOf(`
4020
4020
  at`)?" (<anonymous>)":-1<g.stack.indexOf("@")?"@unknown:0:0":""}return`
4021
- `+Ad+c+Pm}function d(c,u){if(!c||fl)return"";fl=!0;var g=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var S={DetermineComponentFrameRoot:function(){try{if(u){var Gt=function(){throw Error()};if(Object.defineProperty(Gt.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Gt,[])}catch(xn){var kt=xn}Reflect.construct(c,[],Gt)}else{try{Gt.call()}catch(xn){kt=xn}c.call(Gt.prototype)}}else{try{throw Error()}catch(xn){kt=xn}(Gt=c())&&typeof Gt.catch=="function"&&Gt.catch(function(){})}}catch(xn){if(xn&&kt&&typeof xn.stack=="string")return[xn.stack,kt.stack]}return[null,null]}};S.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var C=Object.getOwnPropertyDescriptor(S.DetermineComponentFrameRoot,"name");C&&C.configurable&&Object.defineProperty(S.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var B=S.DetermineComponentFrameRoot(),q=B[0],se=B[1];if(q&&se){var Se=q.split(`
4021
+ `+Ad+c+Pm}function d(c,u){if(!c||fl)return"";fl=!0;var g=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var S={DetermineComponentFrameRoot:function(){try{if(u){var Gt=function(){throw Error()};if(Object.defineProperty(Gt.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Gt,[])}catch(An){var kt=An}Reflect.construct(c,[],Gt)}else{try{Gt.call()}catch(An){kt=An}c.call(Gt.prototype)}}else{try{throw Error()}catch(An){kt=An}(Gt=c())&&typeof Gt.catch=="function"&&Gt.catch(function(){})}}catch(An){if(An&&kt&&typeof An.stack=="string")return[An.stack,kt.stack]}return[null,null]}};S.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var C=Object.getOwnPropertyDescriptor(S.DetermineComponentFrameRoot,"name");C&&C.configurable&&Object.defineProperty(S.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var B=S.DetermineComponentFrameRoot(),q=B[0],se=B[1];if(q&&se){var Se=q.split(`
4022
4022
  `),Je=se.split(`
4023
4023
  `);for(C=S=0;S<Se.length&&!Se[S].includes("DetermineComponentFrameRoot");)S++;for(;C<Je.length&&!Je[C].includes("DetermineComponentFrameRoot");)C++;if(S===Se.length||C===Je.length)for(S=Se.length-1,C=Je.length-1;1<=S&&0<=C&&Se[S]!==Je[C];)C--;for(;1<=S&&0<=C;S--,C--)if(Se[S]!==Je[C]){if(S!==1||C!==1)do if(S--,C--,0>C||Se[S]!==Je[C]){var Mt=`
4024
4024
  `+Se[S].replace(" at new "," at ");return c.displayName&&Mt.includes("<anonymous>")&&(Mt=Mt.replace("<anonymous>",c.displayName)),Mt}while(1<=S&&0<=C);break}}}finally{fl=!1,Error.prepareStackTrace=g}return(g=c?c.displayName||c.name:"")?h(g):""}function p(c){switch(c.tag){case 26:case 27:case 5:return h(c.type);case 16:return h("Lazy");case 13:return h("Suspense");case 19:return h("SuspenseList");case 0:case 15:return c=d(c.type,!1),c;case 11:return c=d(c.type.render,!1),c;case 1:return c=d(c.type,!0),c;default:return""}}function _(c){try{var u="";do u+=p(c),c=c.return;while(c);return u}catch(g){return`
4025
4025
  Error generating stack: `+g.message+`
4026
- `+g.stack}}function v(c){var u=c,g=c;if(c.alternate)for(;u.return;)u=u.return;else{c=u;do u=c,(u.flags&4098)!==0&&(g=u.return),c=u.return;while(c)}return u.tag===3?g:null}function y(c){if(v(c)!==c)throw Error(i(188))}function x(c){var u=c.alternate;if(!u){if(u=v(c),u===null)throw Error(i(188));return u!==c?null:c}for(var g=c,S=u;;){var C=g.return;if(C===null)break;var B=C.alternate;if(B===null){if(S=C.return,S!==null){g=S;continue}break}if(C.child===B.child){for(B=C.child;B;){if(B===g)return y(C),c;if(B===S)return y(C),u;B=B.sibling}throw Error(i(188))}if(g.return!==S.return)g=C,S=B;else{for(var q=!1,se=C.child;se;){if(se===g){q=!0,g=C,S=B;break}if(se===S){q=!0,S=C,g=B;break}se=se.sibling}if(!q){for(se=B.child;se;){if(se===g){q=!0,g=B,S=C;break}if(se===S){q=!0,S=B,g=C;break}se=se.sibling}if(!q)throw Error(i(189))}}if(g.alternate!==S)throw Error(i(190))}if(g.tag!==3)throw Error(i(188));return g.stateNode.current===g?c:u}function b(c){var u=c.tag;if(u===5||u===26||u===27||u===6)return c;for(c=c.child;c!==null;){if(u=b(c),u!==null)return u;c=c.sibling}return null}function R(c){var u=c.tag;if(u===5||u===26||u===27||u===6)return c;for(c=c.child;c!==null;){if(c.tag!==4&&(u=R(c),u!==null))return u;c=c.sibling}return null}function T(c){return{current:c}}function M(c){0>wo||(c.current=Pf[wo],Pf[wo]=null,wo--)}function w(c,u){wo++,Pf[wo]=c.current,c.current=u}function D(c){return c>>>=0,c===0?32:31-(Gf(c)/hy|0)|0}function L(c){var u=c&42;if(u!==0)return u;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:return 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&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return c&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return c}}function P(c,u){var g=c.pendingLanes;if(g===0)return 0;var S=0,C=c.suspendedLanes,B=c.pingedLanes,q=c.warmLanes;c=c.finishedLanes!==0;var se=g&134217727;return se!==0?(g=se&~C,g!==0?S=L(g):(B&=se,B!==0?S=L(B):c||(q=se&~q,q!==0&&(S=L(q))))):(se=g&~C,se!==0?S=L(se):B!==0?S=L(B):c||(q=g&~q,q!==0&&(S=L(q)))),S===0?0:u!==0&&u!==S&&(u&C)===0&&(C=S&-S,q=u&-u,C>=q||C===32&&(q&4194176)!==0)?u:S}function O(c,u){return(c.pendingLanes&~(c.suspendedLanes&~c.pingedLanes)&u)===0}function z(c,u){switch(c){case 1:case 2:case 4:case 8:return u+250;case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return u+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function V(){var c=ou;return ou<<=1,(ou&4194176)===0&&(ou=128),c}function N(){var c=zf;return zf<<=1,(zf&62914560)===0&&(zf=4194304),c}function F(c){for(var u=[],g=0;31>g;g++)u.push(c);return u}function K(c,u){c.pendingLanes|=u,u!==268435456&&(c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0)}function ne(c,u,g,S,C,B){var q=c.pendingLanes;c.pendingLanes=g,c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0,c.expiredLanes&=g,c.entangledLanes&=g,c.errorRecoveryDisabledLanes&=g,c.shellSuspendCounter=0;var se=c.entanglements,Se=c.expirationTimes,Je=c.hiddenUpdates;for(g=q&~g;0<g;){var Mt=31-Ss(g),Gt=1<<Mt;se[Mt]=0,Se[Mt]=-1;var kt=Je[Mt];if(kt!==null)for(Je[Mt]=null,Mt=0;Mt<kt.length;Mt++){var xn=kt[Mt];xn!==null&&(xn.lane&=-536870913)}g&=~Gt}S!==0&&ee(c,S,0),B!==0&&C===0&&c.tag!==0&&(c.suspendedLanes|=B&~(q&~u))}function ee(c,u,g){c.pendingLanes|=u,c.suspendedLanes&=~u;var S=31-Ss(u);c.entangledLanes|=u,c.entanglements[S]=c.entanglements[S]|1073741824|g&4194218}function ie(c,u){var g=c.entangledLanes|=u;for(c=c.entanglements;g;){var S=31-Ss(g),C=1<<S;C&u|c[S]&u&&(c[S]|=u),g&=~C}}function he(c){return c&=-c,2<c?8<c?(c&134217727)!==0?32:268435456:8:2}function H(c){if(Ms&&typeof Ms.onCommitFiberRoot=="function")try{Ms.onCommitFiberRoot(cu,c,void 0,(c.current.flags&128)===128)}catch{}}function Y(c){if(typeof gy=="function"&&gg(c),Ms&&typeof Ms.setStrictMode=="function")try{Ms.setStrictMode(cu,c)}catch{}}function $(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}function ye(c,u){if(typeof c=="object"&&c!==null){var g=Hd.get(c);return g!==void 0?g:(u={value:c,source:u,stack:_(u)},Hd.set(c,u),u)}return{value:c,source:u,stack:_(u)}}function _e(c,u){Di[Ji++]=Xf,Di[Ji++]=kf,kf=c,Xf=u}function W(c,u,g){ks[Xs++]=Zr,ks[Xs++]=rr,ks[Xs++]=Tr,Tr=c;var S=Zr;c=rr;var C=32-Ss(S)-1;S&=~(1<<C),g+=1;var B=32-Ss(u)+C;if(30<B){var q=C-C%5;B=(S&(1<<q)-1).toString(32),S>>=q,C-=q,Zr=1<<32-Ss(u)+C|g<<C|S,rr=B+c}else Zr=1<<B|g<<C|S,rr=c}function ae(c){c.return!==null&&(_e(c,1),W(c,1,0))}function Me(c){for(;c===kf;)kf=Di[--Ji],Di[Ji]=null,Xf=Di[--Ji],Di[Ji]=null;for(;c===Tr;)Tr=ks[--Xs],ks[Xs]=null,rr=ks[--Xs],ks[Xs]=null,Zr=ks[--Xs],ks[Xs]=null}function Ne(c,u){w(Cr,u),w(Yf,c),w(Ba,null),c=tc(u),M(Ba),w(Ba,c)}function it(){M(Ba),M(Yf),M(Cr)}function ve(c){c.memoizedState!==null&&w(uu,c);var u=Ba.current,g=Y_(u,c.type);u!==g&&(w(Yf,c),w(Ba,g))}function Ce(c){Yf.current===c&&(M(Ba),M(Yf)),uu.current===c&&(M(uu),Kr?gn._currentValue=As:gn._currentValue2=As)}function tt(c){var u=Error(i(418,""));throw mt(ye(u,c)),Jf}function Et(c,u){if(!cs)throw Error(i(175));jS(c.stateNode,c.type,c.memoizedProps,u,c)||tt(c)}function wt(c){for(ts=c.return;ts;)switch(ts.tag){case 3:case 27:or=!0;return;case 5:case 13:or=!1;return;default:ts=ts.return}}function on(c){if(!cs||c!==ts)return!1;if(!ni)return wt(c),ni=!0,!1;var u=!1;if(za?c.tag!==3&&c.tag!==27&&(c.tag!==5||oy(c.type)&&!pl(c.type,c.memoizedProps))&&(u=!0):c.tag!==3&&(c.tag!==5||oy(c.type)&&!pl(c.type,c.memoizedProps))&&(u=!0),u&&ka&&tt(c),wt(c),c.tag===13){if(!cs)throw Error(i(316));if(c=c.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(i(317));ka=sy(c)}else ka=ts?ig(c.stateNode):null;return!0}function It(){cs&&(ka=ts=null,ni=!1)}function mt(c){Ys===null?Ys=[c]:Ys.push(c)}function me(){for(var c=gl,u=fu=gl=0;u<c;){var g=Js[u];Js[u++]=null;var S=Js[u];Js[u++]=null;var C=Js[u];Js[u++]=null;var B=Js[u];if(Js[u++]=null,S!==null&&C!==null){var q=S.pending;q===null?C.next=C:(C.next=q.next,q.next=C),S.pending=C}B!==0&&Q(g,C,B)}}function Le(c,u,g,S){Js[gl++]=c,Js[gl++]=u,Js[gl++]=g,Js[gl++]=S,fu|=S,c.lanes|=S,c=c.alternate,c!==null&&(c.lanes|=S)}function Ue(c,u,g,S){return Le(c,u,g,S),Kt(c)}function rt(c,u){return Le(c,null,null,u),Kt(c)}function Q(c,u,g){c.lanes|=g;var S=c.alternate;S!==null&&(S.lanes|=g);for(var C=!1,B=c.return;B!==null;)B.childLanes|=g,S=B.alternate,S!==null&&(S.childLanes|=g),B.tag===22&&(c=B.stateNode,c===null||c._visibility&1||(C=!0)),c=B,B=B.return;C&&u!==null&&c.tag===3&&(B=c.stateNode,C=31-Ss(g),B=B.hiddenUpdates,c=B[C],c===null?B[C]=[u]:c.push(u),u.lane=g|536870912)}function Kt(c){if(50<hc)throw hc=0,hs=null,Error(i(185));for(var u=c.return;u!==null;)c=u,u=c.return;return c.tag===3?c.stateNode:null}function _t(c){c!==sc&&c.next===null&&(sc===null?hu=sc=c:sc=sc.next=c),Kf=!0,qf||(qf=!0,Ie(yt))}function Ft(c,u){if(!Rr&&Kf){Rr=!0;do for(var g=!1,S=hu;S!==null;){if(c!==0){var C=S.pendingLanes;if(C===0)var B=0;else{var q=S.suspendedLanes,se=S.pingedLanes;B=(1<<31-Ss(42|c)+1)-1,B&=C&~(q&~se),B=B&201326677?B&201326677|1:B?B|2:0}B!==0&&(g=!0,ue(S,B))}else B=Un,B=P(S,S===Fn?B:0),(B&3)===0||O(S,B)||(g=!0,ue(S,B));S=S.next}while(g);Rr=!1}}function yt(){Kf=qf=!1;var c=0;vl!==0&&(ml()&&(c=vl),vl=0);for(var u=Va(),g=null,S=hu;S!==null;){var C=S.next,B=j(S,u);B===0?(S.next=null,g===null?hu=C:g.next=C,C===null&&(sc=g)):(g=S,(c!==0||(B&3)!==0)&&(Kf=!0)),S=C}Ft(c)}function j(c,u){for(var g=c.suspendedLanes,S=c.pingedLanes,C=c.expirationTimes,B=c.pendingLanes&-62914561;0<B;){var q=31-Ss(B),se=1<<q,Se=C[q];Se===-1?((se&g)===0||(se&S)!==0)&&(C[q]=z(se,u)):Se<=u&&(c.expiredLanes|=se),B&=~se}if(u=Fn,g=Un,g=P(c,c===u?g:0),S=c.callbackNode,g===0||c===u&&xi===2||c.cancelPendingCommit!==null)return S!==null&&S!==null&&Vf(S),c.callbackNode=null,c.callbackPriority=0;if((g&3)===0||O(c,g)){if(u=g&-g,u===c.callbackPriority)return u;switch(S!==null&&Vf(S),he(g)){case 2:case 8:g=my;break;case 32:g=Id;break;case 268435456:g=Fd;break;default:g=Id}return S=I.bind(null,c),g=lu(g,S),c.callbackPriority=u,c.callbackNode=g,u}return S!==null&&S!==null&&Vf(S),c.callbackPriority=2,c.callbackNode=null,2}function I(c,u){var g=c.callbackNode;if(Ra()&&c.callbackNode!==g)return null;var S=Un;return S=P(c,c===Fn?S:0),S===0?null:(Ef(c,S,u),j(c,Va()),c.callbackNode!=null&&c.callbackNode===g?I.bind(null,c):null)}function ue(c,u){if(Ra())return null;Ef(c,u,!0)}function Ie(c){da?Ed(function(){(rn&6)!==0?lu(mg,c):c()}):lu(mg,c)}function Xe(){return vl===0&&(vl=V()),vl}function Oe(c,u){if(Wf===null){var g=Wf=[];Pd=0,bs=Xe(),_l={status:"pending",value:void 0,then:function(S){g.push(S)}}}return Pd++,u.then(Bt,Bt),u}function Bt(){if(--Pd===0&&Wf!==null){_l!==null&&(_l.status="fulfilled");var c=Wf;Wf=null,bs=0,_l=null;for(var u=0;u<c.length;u++)(0,c[u])()}}function gt(c,u){var g=[],S={status:"pending",value:null,reason:null,then:function(C){g.push(C)}};return c.then(function(){S.status="fulfilled",S.value=u;for(var C=0;C<g.length;C++)(0,g[C])(u)},function(C){for(S.status="rejected",S.reason=C,C=0;C<g.length;C++)(0,g[C])(void 0)}),S}function Ht(c){c.updateQueue={baseState:c.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Xt(c,u){c=c.updateQueue,u.updateQueue===c&&(u.updateQueue={baseState:c.baseState,firstBaseUpdate:c.firstBaseUpdate,lastBaseUpdate:c.lastBaseUpdate,shared:c.shared,callbacks:null})}function ze(c){return{lane:c,tag:0,payload:null,callback:null,next:null}}function qe(c,u,g){var S=c.updateQueue;if(S===null)return null;if(S=S.shared,(rn&2)!==0){var C=S.pending;return C===null?u.next=u:(u.next=C.next,C.next=u),S.pending=u,u=Kt(c),Q(c,null,g),u}return Le(c,S,u,g),Kt(c)}function Tt(c,u,g){if(u=u.updateQueue,u!==null&&(u=u.shared,(g&4194176)!==0)){var S=u.lanes;S&=c.pendingLanes,g|=S,u.lanes=g,ie(c,g)}}function pt(c,u){var g=c.updateQueue,S=c.alternate;if(S!==null&&(S=S.updateQueue,g===S)){var C=null,B=null;if(g=g.firstBaseUpdate,g!==null){do{var q={lane:g.lane,tag:g.tag,payload:g.payload,callback:null,next:null};B===null?C=B=q:B=B.next=q,g=g.next}while(g!==null);B===null?C=B=u:B=B.next=u}else C=B=u;g={baseState:S.baseState,firstBaseUpdate:C,lastBaseUpdate:B,shared:S.shared,callbacks:S.callbacks},c.updateQueue=g;return}c=g.lastBaseUpdate,c===null?g.firstBaseUpdate=u:c.next=u,g.lastBaseUpdate=u}function st(){if(du){var c=_l;if(c!==null)throw c}}function qt(c,u,g,S){du=!1;var C=c.updateQueue;Bo=!1;var B=C.firstBaseUpdate,q=C.lastBaseUpdate,se=C.shared.pending;if(se!==null){C.shared.pending=null;var Se=se,Je=Se.next;Se.next=null,q===null?B=Je:q.next=Je,q=Se;var Mt=c.alternate;Mt!==null&&(Mt=Mt.updateQueue,se=Mt.lastBaseUpdate,se!==q&&(se===null?Mt.firstBaseUpdate=Je:se.next=Je,Mt.lastBaseUpdate=Se))}if(B!==null){var Gt=C.baseState;q=0,Mt=Je=Se=null,se=B;do{var kt=se.lane&-536870913,xn=kt!==se.lane;if(xn?(Un&kt)===kt:(S&kt)===kt){kt!==0&&kt===bs&&(du=!0),Mt!==null&&(Mt=Mt.next={lane:0,tag:se.tag,payload:se.payload,callback:null,next:null});e:{var Rs=c,$f=se;kt=u;var dc=g;switch($f.tag){case 1:if(Rs=$f.payload,typeof Rs=="function"){Gt=Rs.call(dc,Gt,kt);break e}Gt=Rs;break e;case 3:Rs.flags=Rs.flags&-65537|128;case 0:if(Rs=$f.payload,kt=typeof Rs=="function"?Rs.call(dc,Gt,kt):Rs,kt==null)break e;Gt=$l({},Gt,kt);break e;case 2:Bo=!0}}kt=se.callback,kt!==null&&(c.flags|=64,xn&&(c.flags|=8192),xn=C.callbacks,xn===null?C.callbacks=[kt]:xn.push(kt))}else xn={lane:kt,tag:se.tag,payload:se.payload,callback:se.callback,next:null},Mt===null?(Je=Mt=xn,Se=Gt):Mt=Mt.next=xn,q|=kt;if(se=se.next,se===null){if(se=C.shared.pending,se===null)break;xn=se,se=xn.next,xn.next=null,C.lastBaseUpdate=xn,C.shared.pending=null}}while(!0);Mt===null&&(Se=Gt),C.baseState=Se,C.firstBaseUpdate=Je,C.lastBaseUpdate=Mt,B===null&&(C.shared.lanes=0),js|=q,c.lanes=q,c.memoizedState=Gt}}function de(c,u){if(typeof c!="function")throw Error(i(191,c));c.call(u)}function be(c,u){var g=c.callbacks;if(g!==null)for(c.callbacks=null,c=0;c<g.length;c++)de(g[c],u)}function We(c,u){if(Vs(c,u))return!0;if(typeof c!="object"||c===null||typeof u!="object"||u===null)return!1;var g=Object.keys(c),S=Object.keys(u);if(g.length!==S.length)return!1;for(S=0;S<g.length;S++){var C=g[S];if(!jf.call(u,C)||!Vs(c[C],u[C]))return!1}return!0}function St(c){return c=c.status,c==="fulfilled"||c==="rejected"}function Ye(){}function Ve(c,u,g){switch(g=c[g],g===void 0?c.push(u):g!==u&&(u.then(Ye,Ye),u=g),u.status){case"fulfilled":return u.value;case"rejected":throw c=u.reason,c===mi?Error(i(483)):c;default:if(typeof u.status=="string")u.then(Ye,Ye);else{if(c=Fn,c!==null&&100<c.shellSuspendCounter)throw Error(i(482));c=u,c.status="pending",c.then(function(S){if(u.status==="pending"){var C=u;C.status="fulfilled",C.value=S}},function(S){if(u.status==="pending"){var C=u;C.status="rejected",C.reason=S}})}switch(u.status){case"fulfilled":return u.value;case"rejected":throw c=u.reason,c===mi?Error(i(483)):c}throw rc=u,mi}}function ft(){if(rc===null)throw Error(i(459));var c=rc;return rc=null,c}function jt(c){var u=lr;return lr+=1,Qr===null&&(Qr=[]),Ve(Qr,c,u)}function Sn(c,u){u=u.props.ref,c.ref=u!==void 0?u:null}function bt(c,u){throw u.$$typeof===Om?Error(i(525)):(c=Object.prototype.toString.call(u),Error(i(31,c==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":c)))}function Dn(c){var u=c._init;return u(c._payload)}function Nn(c){function u(Be,xe){if(c){var Fe=Be.deletions;Fe===null?(Be.deletions=[xe],Be.flags|=16):Fe.push(xe)}}function g(Be,xe){if(!c)return null;for(;xe!==null;)u(Be,xe),xe=xe.sibling;return null}function S(Be){for(var xe=new Map;Be!==null;)Be.key!==null?xe.set(Be.key,Be):xe.set(Be.index,Be),Be=Be.sibling;return xe}function C(Be,xe){return Be=$a(Be,xe),Be.index=0,Be.sibling=null,Be}function B(Be,xe,Fe){return Be.index=Fe,c?(Fe=Be.alternate,Fe!==null?(Fe=Fe.index,Fe<xe?(Be.flags|=33554434,xe):Fe):(Be.flags|=33554434,xe)):(Be.flags|=1048576,xe)}function q(Be){return c&&Be.alternate===null&&(Be.flags|=33554434),Be}function se(Be,xe,Fe,dt){return xe===null||xe.tag!==6?(xe=ll(Fe,Be.mode,dt),xe.return=Be,xe):(xe=C(xe,Fe),xe.return=Be,xe)}function Se(Be,xe,Fe,dt){var nn=Fe.type;return nn===nu?Mt(Be,xe,Fe.props.children,dt,Fe.key):xe!==null&&(xe.elementType===nn||typeof nn=="object"&&nn!==null&&nn.$$typeof===Er&&Dn(nn)===xe.type)?(xe=C(xe,Fe.props),Sn(xe,Fe),xe.return=Be,xe):(xe=ar(Fe.type,Fe.key,Fe.props,null,Be.mode,dt),Sn(xe,Fe),xe.return=Be,xe)}function Je(Be,xe,Fe,dt){return xe===null||xe.tag!==4||xe.stateNode.containerInfo!==Fe.containerInfo||xe.stateNode.implementation!==Fe.implementation?(xe=tu(Fe,Be.mode,dt),xe.return=Be,xe):(xe=C(xe,Fe.children||[]),xe.return=Be,xe)}function Mt(Be,xe,Fe,dt,nn){return xe===null||xe.tag!==7?(xe=bo(Fe,Be.mode,dt,nn),xe.return=Be,xe):(xe=C(xe,Fe),xe.return=Be,xe)}function Gt(Be,xe,Fe){if(typeof xe=="string"&&xe!==""||typeof xe=="number"||typeof xe=="bigint")return xe=ll(""+xe,Be.mode,Fe),xe.return=Be,xe;if(typeof xe=="object"&&xe!==null){switch(xe.$$typeof){case Eo:return Fe=ar(xe.type,xe.key,xe.props,null,Be.mode,Fe),Sn(Fe,xe),Fe.return=Be,Fe;case br:return xe=tu(xe,Be.mode,Fe),xe.return=Be,xe;case Er:var dt=xe._init;return xe=dt(xe._payload),Gt(Be,xe,Fe)}if(hl(xe)||o(xe))return xe=bo(xe,Be.mode,Fe,null),xe.return=Be,xe;if(typeof xe.then=="function")return Gt(Be,jt(xe),Fe);if(xe.$$typeof===Jr)return Gt(Be,xf(Be,xe),Fe);bt(Be,xe)}return null}function kt(Be,xe,Fe,dt){var nn=xe!==null?xe.key:null;if(typeof Fe=="string"&&Fe!==""||typeof Fe=="number"||typeof Fe=="bigint")return nn!==null?null:se(Be,xe,""+Fe,dt);if(typeof Fe=="object"&&Fe!==null){switch(Fe.$$typeof){case Eo:return Fe.key===nn?Se(Be,xe,Fe,dt):null;case br:return Fe.key===nn?Je(Be,xe,Fe,dt):null;case Er:return nn=Fe._init,Fe=nn(Fe._payload),kt(Be,xe,Fe,dt)}if(hl(Fe)||o(Fe))return nn!==null?null:Mt(Be,xe,Fe,dt,null);if(typeof Fe.then=="function")return kt(Be,xe,jt(Fe),dt);if(Fe.$$typeof===Jr)return kt(Be,xe,xf(Be,Fe),dt);bt(Be,Fe)}return null}function xn(Be,xe,Fe,dt,nn){if(typeof dt=="string"&&dt!==""||typeof dt=="number"||typeof dt=="bigint")return Be=Be.get(Fe)||null,se(xe,Be,""+dt,nn);if(typeof dt=="object"&&dt!==null){switch(dt.$$typeof){case Eo:return Be=Be.get(dt.key===null?Fe:dt.key)||null,Se(xe,Be,dt,nn);case br:return Be=Be.get(dt.key===null?Fe:dt.key)||null,Je(xe,Be,dt,nn);case Er:var Mi=dt._init;return dt=Mi(dt._payload),xn(Be,xe,Fe,dt,nn)}if(hl(dt)||o(dt))return Be=Be.get(Fe)||null,Mt(xe,Be,dt,nn,null);if(typeof dt.then=="function")return xn(Be,xe,Fe,jt(dt),nn);if(dt.$$typeof===Jr)return xn(Be,xe,Fe,xf(xe,dt),nn);bt(xe,dt)}return null}function Rs(Be,xe,Fe,dt){for(var nn=null,Mi=null,vn=xe,ai=xe=0,Sa=null;vn!==null&&ai<Fe.length;ai++){vn.index>ai?(Sa=vn,vn=null):Sa=vn.sibling;var si=kt(Be,vn,Fe[ai],dt);if(si===null){vn===null&&(vn=Sa);break}c&&vn&&si.alternate===null&&u(Be,vn),xe=B(si,xe,ai),Mi===null?nn=si:Mi.sibling=si,Mi=si,vn=Sa}if(ai===Fe.length)return g(Be,vn),ni&&_e(Be,ai),nn;if(vn===null){for(;ai<Fe.length;ai++)vn=Gt(Be,Fe[ai],dt),vn!==null&&(xe=B(vn,xe,ai),Mi===null?nn=vn:Mi.sibling=vn,Mi=vn);return ni&&_e(Be,ai),nn}for(vn=S(vn);ai<Fe.length;ai++)Sa=xn(vn,Be,ai,Fe[ai],dt),Sa!==null&&(c&&Sa.alternate!==null&&vn.delete(Sa.key===null?ai:Sa.key),xe=B(Sa,xe,ai),Mi===null?nn=Sa:Mi.sibling=Sa,Mi=Sa);return c&&vn.forEach(function(Fo){return u(Be,Fo)}),ni&&_e(Be,ai),nn}function $f(Be,xe,Fe,dt){if(Fe==null)throw Error(i(151));for(var nn=null,Mi=null,vn=xe,ai=xe=0,Sa=null,si=Fe.next();vn!==null&&!si.done;ai++,si=Fe.next()){vn.index>ai?(Sa=vn,vn=null):Sa=vn.sibling;var Fo=kt(Be,vn,si.value,dt);if(Fo===null){vn===null&&(vn=Sa);break}c&&vn&&Fo.alternate===null&&u(Be,vn),xe=B(Fo,xe,ai),Mi===null?nn=Fo:Mi.sibling=Fo,Mi=Fo,vn=Sa}if(si.done)return g(Be,vn),ni&&_e(Be,ai),nn;if(vn===null){for(;!si.done;ai++,si=Fe.next())si=Gt(Be,si.value,dt),si!==null&&(xe=B(si,xe,ai),Mi===null?nn=si:Mi.sibling=si,Mi=si);return ni&&_e(Be,ai),nn}for(vn=S(vn);!si.done;ai++,si=Fe.next())si=xn(vn,Be,ai,si.value,dt),si!==null&&(c&&si.alternate!==null&&vn.delete(si.key===null?ai:si.key),xe=B(si,xe,ai),Mi===null?nn=si:Mi.sibling=si,Mi=si);return c&&vn.forEach(function(Kd){return u(Be,Kd)}),ni&&_e(Be,ai),nn}function dc(Be,xe,Fe,dt){if(typeof Fe=="object"&&Fe!==null&&Fe.type===nu&&Fe.key===null&&(Fe=Fe.props.children),typeof Fe=="object"&&Fe!==null){switch(Fe.$$typeof){case Eo:e:{for(var nn=Fe.key;xe!==null;){if(xe.key===nn){if(nn=Fe.type,nn===nu){if(xe.tag===7){g(Be,xe.sibling),dt=C(xe,Fe.props.children),dt.return=Be,Be=dt;break e}}else if(xe.elementType===nn||typeof nn=="object"&&nn!==null&&nn.$$typeof===Er&&Dn(nn)===xe.type){g(Be,xe.sibling),dt=C(xe,Fe.props),Sn(dt,Fe),dt.return=Be,Be=dt;break e}g(Be,xe);break}else u(Be,xe);xe=xe.sibling}Fe.type===nu?(dt=bo(Fe.props.children,Be.mode,dt,Fe.key),dt.return=Be,Be=dt):(dt=ar(Fe.type,Fe.key,Fe.props,null,Be.mode,dt),Sn(dt,Fe),dt.return=Be,Be=dt)}return q(Be);case br:e:{for(nn=Fe.key;xe!==null;){if(xe.key===nn)if(xe.tag===4&&xe.stateNode.containerInfo===Fe.containerInfo&&xe.stateNode.implementation===Fe.implementation){g(Be,xe.sibling),dt=C(xe,Fe.children||[]),dt.return=Be,Be=dt;break e}else{g(Be,xe);break}else u(Be,xe);xe=xe.sibling}dt=tu(Fe,Be.mode,dt),dt.return=Be,Be=dt}return q(Be);case Er:return nn=Fe._init,Fe=nn(Fe._payload),dc(Be,xe,Fe,dt)}if(hl(Fe))return Rs(Be,xe,Fe,dt);if(o(Fe)){if(nn=o(Fe),typeof nn!="function")throw Error(i(150));return Fe=nn.call(Fe),$f(Be,xe,Fe,dt)}if(typeof Fe.then=="function")return dc(Be,xe,jt(Fe),dt);if(Fe.$$typeof===Jr)return dc(Be,xe,xf(Be,Fe),dt);bt(Be,Fe)}return typeof Fe=="string"&&Fe!==""||typeof Fe=="number"||typeof Fe=="bigint"?(Fe=""+Fe,xe!==null&&xe.tag===6?(g(Be,xe.sibling),dt=C(xe,Fe),dt.return=Be,Be=dt):(g(Be,xe),dt=ll(Fe,Be.mode,dt),dt.return=Be,Be=dt),q(Be)):g(Be,xe)}return function(Be,xe,Fe,dt){try{lr=0;var nn=dc(Be,xe,Fe,dt);return Qr=null,nn}catch(vn){if(vn===mi)throw vn;var Mi=t(29,vn,null,Be.mode);return Mi.lanes=dt,Mi.return=Be,Mi}}}function Ni(c,u){c=wr,w(qs,c),w($r,u),wr=c|u.baseLanes}function fa(){w(qs,wr),w($r,$r.current)}function Ui(){wr=qs.current,M($r),M(qs)}function Zi(c){var u=c.alternate;w(pa,pa.current&1),w(Ks,c),cr===null&&(u===null||$r.current!==null||u.memoizedState!==null)&&(cr=c)}function Ia(c){if(c.tag===22){if(w(pa,pa.current),w(Ks,c),cr===null){var u=c.alternate;u!==null&&u.memoizedState!==null&&(cr=c)}}else vi()}function vi(){w(pa,pa.current),w(Ks,Ks.current)}function en(c){M(Ks),cr===c&&(cr=null),M(pa)}function ci(c){for(var u=c;u!==null;){if(u.tag===13){var g=u.memoizedState;if(g!==null&&(g=g.dehydrated,g===null||Bd(g)||Hf(g)))return u}else if(u.tag===19&&u.memoizedProps.revealOrder!==void 0){if((u.flags&128)!==0)return u}else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===c)break;for(;u.sibling===null;){if(u.return===null||u.return===c)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}function fn(){throw Error(i(321))}function G(c,u){if(u===null)return!1;for(var g=0;g<u.length&&g<c.length;g++)if(!Vs(c[g],u[g]))return!1;return!0}function J(c,u,g,S,C,B){return eo=B,Rn=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,hn.H=c===null||c.memoizedState===null?ma:ns,Do=!1,B=g(S,C),Do=!1,Li&&(B=Re(u,g,S,C)),oe(c),B}function oe(c){hn.H=ii;var u=oi!==null&&oi.next!==null;if(eo=0,ta=oi=Rn=null,ur=!1,qi=0,pu=null,u)throw Error(i(300));c===null||na||(c=c.dependencies,c!==null&&Zo(c)&&(na=!0))}function Re(c,u,g,S){Rn=c;var C=0;do{if(Li&&(pu=null),qi=0,Li=!1,25<=C)throw Error(i(301));if(C+=1,ta=oi=null,c.updateQueue!=null){var B=c.updateQueue;B.lastEffect=null,B.events=null,B.stores=null,B.memoCache!=null&&(B.memoCache.index=0)}hn.H=xl,B=u(g,S)}while(Li);return B}function Pe(){var c=hn.H,u=c.useState()[0];return u=typeof u.then=="function"?vt(u):u,c=c.useState()[0],(oi!==null?oi.memoizedState:null)!==c&&(Rn.flags|=1024),u}function He(){var c=Zf!==0;return Zf=0,c}function ot(c,u,g){u.updateQueue=c.updateQueue,u.flags&=-2053,c.lanes&=~g}function nt(c){if(ur){for(c=c.memoizedState;c!==null;){var u=c.queue;u!==null&&(u.pending=null),c=c.next}ur=!1}eo=0,ta=oi=Rn=null,Li=!1,qi=Zf=0,pu=null}function Ze(){var c={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ta===null?Rn.memoizedState=ta=c:ta=ta.next=c,ta}function je(){if(oi===null){var c=Rn.alternate;c=c!==null?c.memoizedState:null}else c=oi.next;var u=ta===null?Rn.memoizedState:ta.next;if(u!==null)ta=u,oi=c;else{if(c===null)throw Rn.alternate===null?Error(i(467)):Error(i(310));oi=c,c={memoizedState:oi.memoizedState,baseState:oi.baseState,baseQueue:oi.baseQueue,queue:oi.queue,next:null},ta===null?Rn.memoizedState=ta=c:ta=ta.next=c}return ta}function vt(c){var u=qi;return qi+=1,pu===null&&(pu=[]),c=Ve(pu,c,u),u=Rn,(ta===null?u.memoizedState:ta.next)===null&&(u=u.alternate,hn.H=u===null||u.memoizedState===null?ma:ns),c}function ht(c){if(c!==null&&typeof c=="object"){if(typeof c.then=="function")return vt(c);if(c.$$typeof===Jr)return Ha(c)}throw Error(i(438,String(c)))}function k(c){var u=null,g=Rn.updateQueue;if(g!==null&&(u=g.memoCache),u==null){var S=Rn.alternate;S!==null&&(S=S.updateQueue,S!==null&&(S=S.memoCache,S!=null&&(u={data:S.data.map(function(C){return C.slice()}),index:0})))}if(u==null&&(u={data:[],index:0}),g===null&&(g=zd(),Rn.updateQueue=g),g.memoCache=u,g=u.data[u.index],g===void 0)for(g=u.data[u.index]=Array(c),S=0;S<c;S++)g[S]=X_;return u.index++,g}function te(c,u){return typeof u=="function"?u(c):u}function fe(c){var u=je();return ce(u,oi,c)}function ce(c,u,g){var S=c.queue;if(S===null)throw Error(i(311));S.lastRenderedReducer=g;var C=c.baseQueue,B=S.pending;if(B!==null){if(C!==null){var q=C.next;C.next=B.next,B.next=q}u.baseQueue=C=B,S.pending=null}if(B=c.baseState,C===null)c.memoizedState=B;else{u=C.next;var se=q=null,Se=null,Je=u,Mt=!1;do{var Gt=Je.lane&-536870913;if(Gt!==Je.lane?(Un&Gt)===Gt:(eo&Gt)===Gt){var kt=Je.revertLane;if(kt===0)Se!==null&&(Se=Se.next={lane:0,revertLane:0,action:Je.action,hasEagerState:Je.hasEagerState,eagerState:Je.eagerState,next:null}),Gt===bs&&(Mt=!0);else if((eo&kt)===kt){Je=Je.next,kt===bs&&(Mt=!0);continue}else Gt={lane:0,revertLane:Je.revertLane,action:Je.action,hasEagerState:Je.hasEagerState,eagerState:Je.eagerState,next:null},Se===null?(se=Se=Gt,q=B):Se=Se.next=Gt,Rn.lanes|=kt,js|=kt;Gt=Je.action,Do&&g(B,Gt),B=Je.hasEagerState?Je.eagerState:g(B,Gt)}else kt={lane:Gt,revertLane:Je.revertLane,action:Je.action,hasEagerState:Je.hasEagerState,eagerState:Je.eagerState,next:null},Se===null?(se=Se=kt,q=B):Se=Se.next=kt,Rn.lanes|=Gt,js|=Gt;Je=Je.next}while(Je!==null&&Je!==u);if(Se===null?q=B:Se.next=se,!Vs(B,c.memoizedState)&&(na=!0,Mt&&(g=_l,g!==null)))throw g;c.memoizedState=B,c.baseState=q,c.baseQueue=Se,S.lastRenderedState=B}return C===null&&(S.lanes=0),[c.memoizedState,S.dispatch]}function le(c){var u=je(),g=u.queue;if(g===null)throw Error(i(311));g.lastRenderedReducer=c;var S=g.dispatch,C=g.pending,B=u.memoizedState;if(C!==null){g.pending=null;var q=C=C.next;do B=c(B,q.action),q=q.next;while(q!==C);Vs(B,u.memoizedState)||(na=!0),u.memoizedState=B,u.baseQueue===null&&(u.baseState=B),g.lastRenderedState=B}return[B,S]}function Qe(c,u,g){var S=Rn,C=je(),B=ni;if(B){if(g===void 0)throw Error(i(407));g=g()}else g=u();var q=!Vs((oi||C).memoizedState,g);if(q&&(C.memoizedState=g,na=!0),C=C.queue,Vt(Ct.bind(null,S,C,c),[c]),C.getSnapshot!==u||q||ta!==null&&ta.memoizedState.tag&1){if(S.flags|=2048,we(9,ct.bind(null,S,C,g,u),{destroy:void 0},null),Fn===null)throw Error(i(349));B||(eo&60)!==0||lt(S,u,g)}return g}function lt(c,u,g){c.flags|=16384,c={getSnapshot:u,value:g},u=Rn.updateQueue,u===null?(u=zd(),Rn.updateQueue=u,u.stores=[c]):(g=u.stores,g===null?u.stores=[c]:g.push(c))}function ct(c,u,g,S){u.value=g,u.getSnapshot=S,xt(u)&&Yt(c)}function Ct(c,u,g){return g(function(){xt(u)&&Yt(c)})}function xt(c){var u=c.getSnapshot;c=c.value;try{var g=u();return!Vs(c,g)}catch{return!0}}function Yt(c){var u=rt(c,2);u!==null&&Qa(u,c,2)}function At(c){var u=Ze();if(typeof c=="function"){var g=c;if(c=g(),Do){Y(!0);try{g()}finally{Y(!1)}}}return u.memoizedState=u.baseState=c,u.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:te,lastRenderedState:c},u}function zt(c,u,g,S){return c.baseState=g,ce(c,oi,typeof S=="function"?S:te)}function mn(c,u,g,S,C){if(kl(c))throw Error(i(485));if(c=u.action,c!==null){var B={payload:C,action:c,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(q){B.listeners.push(q)}};hn.T!==null?g(!0):B.isTransition=!1,S(B),g=u.pending,g===null?(B.next=u.pending=B,Pn(u,B)):(B.next=g.next,u.pending=g.next=B)}}function Pn(c,u){var g=u.action,S=u.payload,C=c.state;if(u.isTransition){var B=hn.T,q={};hn.T=q;try{var se=g(C,S),Se=hn.S;Se!==null&&Se(q,se),Mn(c,u,se)}catch(Je){Dt(c,u,Je)}finally{hn.T=B}}else try{B=g(C,S),Mn(c,u,B)}catch(Je){Dt(c,u,Je)}}function Mn(c,u,g){g!==null&&typeof g=="object"&&typeof g.then=="function"?g.then(function(S){Qt(c,u,S)},function(S){return Dt(c,u,S)}):Qt(c,u,g)}function Qt(c,u,g){u.status="fulfilled",u.value=g,$t(u),c.state=g,u=c.pending,u!==null&&(g=u.next,g===u?c.pending=null:(g=g.next,u.next=g,Pn(c,g)))}function Dt(c,u,g){var S=c.pending;if(c.pending=null,S!==null){S=S.next;do u.status="rejected",u.reason=g,$t(u),u=u.next;while(u!==S)}c.action=null}function $t(c){c=c.listeners;for(var u=0;u<c.length;u++)(0,c[u])()}function Lt(c,u){return u}function ei(c,u){if(ni){var g=Fn.formState;if(g!==null){e:{var S=Rn;if(ni){if(ka){var C=Z_(ka,or);if(C){ka=ig(C),S=Q_(C);break e}}tt(S)}S=!1}S&&(u=g[0])}}g=Ze(),g.memoizedState=g.baseState=u,S={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Lt,lastRenderedState:u},g.queue=S,g=Qh.bind(null,Rn,S),S.dispatch=g,S=At(!1);var B=$h.bind(null,Rn,!1,S.queue);return S=Ze(),C={state:u,dispatch:null,action:c,pending:null},S.queue=C,g=mn.bind(null,Rn,C,B,g),C.dispatch=g,S.memoizedState=c,[u,g,!1]}function Qi(c){var u=je();return Gn(u,oi,c)}function Gn(c,u,g){u=ce(c,u,Lt)[0],c=fe(te)[0],u=typeof u=="object"&&u!==null&&typeof u.then=="function"?vt(u):u;var S=je(),C=S.queue,B=C.dispatch;return g!==S.memoizedState&&(Rn.flags|=2048,we(9,Fi.bind(null,C,g),{destroy:void 0},null)),[u,B,c]}function Fi(c,u){c.action=u}function ri(c){var u=je(),g=oi;if(g!==null)return Gn(u,g,c);je(),u=u.memoizedState,g=je();var S=g.queue.dispatch;return g.memoizedState=c,[u,S,!1]}function we(c,u,g,S){return c={tag:c,create:u,inst:g,deps:S,next:null},u=Rn.updateQueue,u===null&&(u=zd(),Rn.updateQueue=u),g=u.lastEffect,g===null?u.lastEffect=c.next=c:(S=g.next,g.next=c,c.next=S,u.lastEffect=c),c}function at(){return je().memoizedState}function ut(c,u,g,S){var C=Ze();Rn.flags|=c,C.memoizedState=we(1|u,g,{destroy:void 0},S===void 0?null:S)}function Ut(c,u,g,S){var C=je();S=S===void 0?null:S;var B=C.memoizedState.inst;oi!==null&&S!==null&&G(S,oi.memoizedState.deps)?C.memoizedState=we(u,g,B,S):(Rn.flags|=c,C.memoizedState=we(1|u,g,B,S))}function Nt(c,u){ut(8390656,8,c,u)}function Vt(c,u){Ut(2048,8,c,u)}function ln(c,u){return Ut(4,2,c,u)}function Wn(c,u){return Ut(4,4,c,u)}function En(c,u){if(typeof u=="function"){c=c();var g=u(c);return function(){typeof g=="function"?g():u(null)}}if(u!=null)return c=c(),u.current=c,function(){u.current=null}}function Cn(c,u,g){g=g!=null?g.concat([c]):null,Ut(4,4,En.bind(null,u,c),g)}function ti(){}function Ci(c,u){var g=je();u=u===void 0?null:u;var S=g.memoizedState;return u!==null&&G(u,S[1])?S[0]:(g.memoizedState=[c,u],c)}function _i(c,u){var g=je();u=u===void 0?null:u;var S=g.memoizedState;if(u!==null&&G(u,S[1]))return S[0];if(S=c(),Do){Y(!0);try{c()}finally{Y(!1)}}return g.memoizedState=[S,u],S}function ha(c,u,g){return g===void 0||(eo&1073741824)!==0?c.memoizedState=u:(c.memoizedState=g,c=Vr(),Rn.lanes|=c,js|=c,g)}function _a(c,u,g,S){return Vs(g,u)?g:$r.current!==null?(c=ha(c,g,S),Vs(c,u)||(na=!0),c):(eo&42)===0?(na=!0,c.memoizedState=g):(c=Vr(),Rn.lanes|=c,js|=c,u)}function Wa(c,u,g,S,C){var B=xa();es(B!==0&&8>B?B:8);var q=hn.T,se={};hn.T=se,$h(c,!1,u,g);try{var Se=C(),Je=hn.S;if(Je!==null&&Je(se,Se),Se!==null&&typeof Se=="object"&&typeof Se.then=="function"){var Mt=gt(Se,S);Ko(c,u,Mt,ls(c))}else Ko(c,u,S,ls(c))}catch(Gt){Ko(c,u,{then:function(){},status:"rejected",reason:Gt},ls())}finally{es(B),hn.T=q}}function Ri(c){var u=c.memoizedState;if(u!==null)return u;u={memoizedState:As,baseState:As,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:te,lastRenderedState:As},next:null};var g={};return u.next={memoizedState:g,baseState:g,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:te,lastRenderedState:g},next:null},c.memoizedState=u,c=c.alternate,c!==null&&(c.memoizedState=u),u}function ya(){return Ha(gn)}function $i(){return je().memoizedState}function ir(){return je().memoizedState}function qo(c){for(var u=c.return;u!==null;){switch(u.tag){case 24:case 3:var g=ls();c=ze(g);var S=qe(u,c,g);S!==null&&(Qa(S,u,g),Tt(S,u,g)),u={cache:ad()},c.payload=u;return}u=u.return}}function xr(c,u,g){var S=ls();g={lane:S,revertLane:0,action:g,hasEagerState:!1,eagerState:null,next:null},kl(c)?pf(u,g):(g=Ue(c,u,g,S),g!==null&&(Qa(g,c,S),cm(g,u,S)))}function Qh(c,u,g){var S=ls();Ko(c,u,g,S)}function Ko(c,u,g,S){var C={lane:S,revertLane:0,action:g,hasEagerState:!1,eagerState:null,next:null};if(kl(c))pf(u,C);else{var B=c.alternate;if(c.lanes===0&&(B===null||B.lanes===0)&&(B=u.lastRenderedReducer,B!==null))try{var q=u.lastRenderedState,se=B(q,g);if(C.hasEagerState=!0,C.eagerState=se,Vs(se,q))return Le(c,u,C,0),Fn===null&&me(),!1}catch{}if(g=Ue(c,u,C,S),g!==null)return Qa(g,c,S),cm(g,u,S),!0}return!1}function $h(c,u,g,S){if(S={lane:2,revertLane:Xe(),action:S,hasEagerState:!1,eagerState:null,next:null},kl(c)){if(u)throw Error(i(479))}else u=Ue(c,g,S,2),u!==null&&Qa(u,c,2)}function kl(c){var u=c.alternate;return c===Rn||u!==null&&u===Rn}function pf(c,u){Li=ur=!0;var g=c.pending;g===null?u.next=u:(u.next=g.next,g.next=u),c.pending=u}function cm(c,u,g){if((g&4194176)!==0){var S=u.lanes;S&=c.pendingLanes,g|=S,u.lanes=g,ie(c,g)}}function ja(c,u,g,S){u=c.memoizedState,g=g(S,u),g=g==null?u:$l({},u,g),c.memoizedState=g,c.lanes===0&&(c.updateQueue.baseState=g)}function Wo(c,u,g,S,C,B,q){return c=c.stateNode,typeof c.shouldComponentUpdate=="function"?c.shouldComponentUpdate(S,B,q):u.prototype&&u.prototype.isPureReactComponent?!We(g,S)||!We(C,B):!0}function mf(c,u,g,S){c=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(g,S),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(g,S),u.state!==c&&Vd.enqueueReplaceState(u,u.state,null)}function Ar(c,u){var g=u;if("ref"in u){g={};for(var S in u)S!=="ref"&&(g[S]=u[S])}if(c=c.defaultProps){g===u&&(g=$l({},g));for(var C in c)g[C]===void 0&&(g[C]=c[C])}return g}function ed(c,u){try{var g=c.onUncaughtError;g(u.value,{componentStack:u.stack})}catch(S){setTimeout(function(){throw S})}}function td(c,u,g){try{var S=c.onCaughtError;S(g.value,{componentStack:g.stack,errorBoundary:u.tag===1?u.stateNode:null})}catch(C){setTimeout(function(){throw C})}}function gf(c,u,g){return g=ze(g),g.tag=3,g.payload={element:null},g.callback=function(){ed(c,u)},g}function zc(c){return c=ze(c),c.tag=3,c}function vf(c,u,g,S){var C=g.type.getDerivedStateFromError;if(typeof C=="function"){var B=S.value;c.payload=function(){return C(B)},c.callback=function(){td(u,g,S)}}var q=g.stateNode;q!==null&&typeof q.componentDidCatch=="function"&&(c.callback=function(){td(u,g,S),typeof C!="function"&&(Qs===null?Qs=new Set([this]):Qs.add(this));var se=S.stack;this.componentDidCatch(S.value,{componentStack:se!==null?se:""})})}function A_(c,u,g,S,C){if(g.flags|=32768,S!==null&&typeof S=="object"&&typeof S.then=="function"){if(u=g.alternate,u!==null&&Xl(u,g,C,!0),g=Ks.current,g!==null){switch(g.tag){case 13:return cr===null?xs():g.alternate===null&&Zn===0&&(Zn=3),g.flags&=-257,g.flags|=65536,g.lanes=C,S===Gd?g.flags|=16384:(u=g.updateQueue,u===null?g.updateQueue=new Set([S]):u.add(S),_d(c,S,C)),!1;case 22:return g.flags|=65536,S===Gd?g.flags|=16384:(u=g.updateQueue,u===null?(u={transitions:null,markerInstances:null,retryQueue:new Set([S])},g.updateQueue=u):(g=u.retryQueue,g===null?u.retryQueue=new Set([S]):g.add(S)),_d(c,S,C)),!1}throw Error(i(435,g.tag))}return _d(c,S,C),xs(),!1}if(ni)return u=Ks.current,u!==null?((u.flags&65536)===0&&(u.flags|=256),u.flags|=65536,u.lanes=C,S!==Jf&&(c=Error(i(422),{cause:S}),mt(ye(c,g)))):(S!==Jf&&(u=Error(i(423),{cause:S}),mt(ye(u,g))),c=c.current.alternate,c.flags|=65536,C&=-C,c.lanes|=C,S=ye(S,g),C=gf(c.stateNode,S,C),pt(c,C),Zn!==4&&(Zn=2)),!1;var B=Error(i(520),{cause:S});if(B=ye(B,g),gu===null?gu=[B]:gu.push(B),Zn!==4&&(Zn=2),u===null)return!0;S=ye(S,g),g=u;do{switch(g.tag){case 3:return g.flags|=65536,c=C&-C,g.lanes|=c,c=gf(g.stateNode,S,c),pt(g,c),!1;case 1:if(u=g.type,B=g.stateNode,(g.flags&128)===0&&(typeof u.getDerivedStateFromError=="function"||B!==null&&typeof B.componentDidCatch=="function"&&(Qs===null||!Qs.has(B))))return g.flags|=65536,C&=-C,g.lanes|=C,C=zc(C),vf(C,c,g,S),pt(g,C),!1}g=g.return}while(g!==null);return!1}function Fa(c,u,g,S){u.child=c===null?_g(u,null,g,S):yl(u,c.child,g,S)}function S_(c,u,g,S,C){g=g.render;var B=u.ref;if("ref"in S){var q={};for(var se in S)se!=="ref"&&(q[se]=S[se])}else q=S;return Yl(u),S=J(c,u,g,q,B,C),se=He(),c!==null&&!na?(ot(c,u,C),go(c,u,C)):(ni&&se&&ae(u),u.flags|=1,Fa(c,u,S,C),u.child)}function M_(c,u,g,S,C){if(c===null){var B=g.type;return typeof B=="function"&&!So(B)&&B.defaultProps===void 0&&g.compare===null?(u.tag=15,u.type=B,nd(c,u,B,S,C)):(c=ar(g.type,null,S,u,u.mode,C),c.ref=u.ref,c.return=u,u.child=c)}if(B=c.child,!gm(c,C)){var q=B.memoizedProps;if(g=g.compare,g=g!==null?g:We,g(q,S)&&c.ref===u.ref)return go(c,u,C)}return u.flags|=1,c=$a(B,S),c.ref=u.ref,c.return=u,u.child=c}function nd(c,u,g,S,C){if(c!==null){var B=c.memoizedProps;if(We(B,S)&&c.ref===u.ref)if(na=!1,u.pendingProps=S=B,gm(c,C))(c.flags&131072)!==0&&(na=!0);else return u.lanes=c.lanes,go(c,u,C)}return um(c,u,g,S,C)}function b_(c,u,g){var S=u.pendingProps,C=S.children,B=(u.stateNode._pendingVisibility&2)!==0,q=c!==null?c.memoizedState:null;if(_f(c,u),S.mode==="hidden"||B){if((u.flags&128)!==0){if(S=q!==null?q.baseLanes|g:g,c!==null){for(C=u.child=c.child,B=0;C!==null;)B=B|C.lanes|C.childLanes,C=C.sibling;u.childLanes=B&~S}else u.childLanes=0,u.child=null;return E_(c,u,S,g)}if((g&536870912)!==0)u.memoizedState={baseLanes:0,cachePool:null},c!==null&&sd(u,q!==null?q.cachePool:null),q!==null?Ni(u,q):fa(),Ia(u);else return u.lanes=u.childLanes=536870912,E_(c,u,q!==null?q.baseLanes|g:g,g)}else q!==null?(sd(u,q.cachePool),Ni(u,q),vi(),u.memoizedState=null):(c!==null&&sd(u,null),fa(),vi());return Fa(c,u,C,g),u.child}function E_(c,u,g,S){var C=Qo();return C=C===null?null:{parent:Kr?ui._currentValue:ui._currentValue2,pool:C},u.memoizedState={baseLanes:g,cachePool:C},c!==null&&sd(u,null),fa(),Ia(u),c!==null&&Xl(c,u,S,!0),null}function _f(c,u){var g=u.ref;if(g===null)c!==null&&c.ref!==null&&(u.flags|=2097664);else{if(typeof g!="function"&&typeof g!="object")throw Error(i(284));(c===null||c.ref!==g)&&(u.flags|=2097664)}}function um(c,u,g,S,C){return Yl(u),g=J(c,u,g,S,void 0,C),S=He(),c!==null&&!na?(ot(c,u,C),go(c,u,C)):(ni&&S&&ae(u),u.flags|=1,Fa(c,u,g,C),u.child)}function T_(c,u,g,S,C,B){return Yl(u),u.updateQueue=null,g=Re(u,S,g,C),oe(c),S=He(),c!==null&&!na?(ot(c,u,B),go(c,u,B)):(ni&&S&&ae(u),u.flags|=1,Fa(c,u,g,B),u.child)}function fm(c,u,g,S,C){if(Yl(u),u.stateNode===null){var B=ac,q=g.contextType;typeof q=="object"&&q!==null&&(B=Ha(q)),B=new g(S,B),u.memoizedState=B.state!==null&&B.state!==void 0?B.state:null,B.updater=Vd,u.stateNode=B,B._reactInternals=u,B=u.stateNode,B.props=S,B.state=u.memoizedState,B.refs={},Ht(u),q=g.contextType,B.context=typeof q=="object"&&q!==null?Ha(q):ac,B.state=u.memoizedState,q=g.getDerivedStateFromProps,typeof q=="function"&&(ja(u,g,q,S),B.state=u.memoizedState),typeof g.getDerivedStateFromProps=="function"||typeof B.getSnapshotBeforeUpdate=="function"||typeof B.UNSAFE_componentWillMount!="function"&&typeof B.componentWillMount!="function"||(q=B.state,typeof B.componentWillMount=="function"&&B.componentWillMount(),typeof B.UNSAFE_componentWillMount=="function"&&B.UNSAFE_componentWillMount(),q!==B.state&&Vd.enqueueReplaceState(B,B.state,null),qt(u,S,B,C),st(),B.state=u.memoizedState),typeof B.componentDidMount=="function"&&(u.flags|=4194308),S=!0}else if(c===null){B=u.stateNode;var se=u.memoizedProps,Se=Ar(g,se);B.props=Se;var Je=B.context,Mt=g.contextType;q=ac,typeof Mt=="object"&&Mt!==null&&(q=Ha(Mt));var Gt=g.getDerivedStateFromProps;Mt=typeof Gt=="function"||typeof B.getSnapshotBeforeUpdate=="function",se=u.pendingProps!==se,Mt||typeof B.UNSAFE_componentWillReceiveProps!="function"&&typeof B.componentWillReceiveProps!="function"||(se||Je!==q)&&mf(u,B,S,q),Bo=!1;var kt=u.memoizedState;B.state=kt,qt(u,S,B,C),st(),Je=u.memoizedState,se||kt!==Je||Bo?(typeof Gt=="function"&&(ja(u,g,Gt,S),Je=u.memoizedState),(Se=Bo||Wo(u,g,Se,S,kt,Je,q))?(Mt||typeof B.UNSAFE_componentWillMount!="function"&&typeof B.componentWillMount!="function"||(typeof B.componentWillMount=="function"&&B.componentWillMount(),typeof B.UNSAFE_componentWillMount=="function"&&B.UNSAFE_componentWillMount()),typeof B.componentDidMount=="function"&&(u.flags|=4194308)):(typeof B.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=S,u.memoizedState=Je),B.props=S,B.state=Je,B.context=q,S=Se):(typeof B.componentDidMount=="function"&&(u.flags|=4194308),S=!1)}else{B=u.stateNode,Xt(c,u),q=u.memoizedProps,Mt=Ar(g,q),B.props=Mt,Gt=u.pendingProps,kt=B.context,Je=g.contextType,Se=ac,typeof Je=="object"&&Je!==null&&(Se=Ha(Je)),se=g.getDerivedStateFromProps,(Je=typeof se=="function"||typeof B.getSnapshotBeforeUpdate=="function")||typeof B.UNSAFE_componentWillReceiveProps!="function"&&typeof B.componentWillReceiveProps!="function"||(q!==Gt||kt!==Se)&&mf(u,B,S,Se),Bo=!1,kt=u.memoizedState,B.state=kt,qt(u,S,B,C),st();var xn=u.memoizedState;q!==Gt||kt!==xn||Bo||c!==null&&c.dependencies!==null&&Zo(c.dependencies)?(typeof se=="function"&&(ja(u,g,se,S),xn=u.memoizedState),(Mt=Bo||Wo(u,g,Mt,S,kt,xn,Se)||c!==null&&c.dependencies!==null&&Zo(c.dependencies))?(Je||typeof B.UNSAFE_componentWillUpdate!="function"&&typeof B.componentWillUpdate!="function"||(typeof B.componentWillUpdate=="function"&&B.componentWillUpdate(S,xn,Se),typeof B.UNSAFE_componentWillUpdate=="function"&&B.UNSAFE_componentWillUpdate(S,xn,Se)),typeof B.componentDidUpdate=="function"&&(u.flags|=4),typeof B.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof B.componentDidUpdate!="function"||q===c.memoizedProps&&kt===c.memoizedState||(u.flags|=4),typeof B.getSnapshotBeforeUpdate!="function"||q===c.memoizedProps&&kt===c.memoizedState||(u.flags|=1024),u.memoizedProps=S,u.memoizedState=xn),B.props=S,B.state=xn,B.context=Se,S=Mt):(typeof B.componentDidUpdate!="function"||q===c.memoizedProps&&kt===c.memoizedState||(u.flags|=4),typeof B.getSnapshotBeforeUpdate!="function"||q===c.memoizedProps&&kt===c.memoizedState||(u.flags|=1024),S=!1)}return B=S,_f(c,u),S=(u.flags&128)!==0,B||S?(B=u.stateNode,g=S&&typeof g.getDerivedStateFromError!="function"?null:B.render(),u.flags|=1,c!==null&&S?(u.child=yl(u,c.child,null,C),u.child=yl(u,null,g,C)):Fa(c,u,g,C),u.memoizedState=B.state,c=u.child):c=go(c,u,C),c}function C_(c,u,g,S){return It(),u.flags|=256,Fa(c,u,g,S),u.child}function hm(c){return{baseLanes:c,cachePool:L_()}}function dm(c,u,g){return c=c!==null?c.childLanes&~g:0,u&&(c|=Cs),c}function R_(c,u,g){var S=u.pendingProps,C=!1,B=(u.flags&128)!==0,q;if((q=B)||(q=c!==null&&c.memoizedState===null?!1:(pa.current&2)!==0),q&&(C=!0,u.flags&=-129),q=(u.flags&32)!==0,u.flags&=-33,c===null){if(ni){if(C?Zi(u):vi(),ni){var se=ka,Se;(Se=se)&&(se=iy(se,or),se!==null?(u.memoizedState={dehydrated:se,treeContext:Tr!==null?{id:Zr,overflow:rr}:null,retryLane:536870912},Se=t(18,null,null,0),Se.stateNode=se,Se.return=u,u.child=Se,ts=u,ka=null,Se=!0):Se=!1),Se||tt(u)}if(se=u.memoizedState,se!==null&&(se=se.dehydrated,se!==null))return Hf(se)?u.lanes=16:u.lanes=536870912,null;en(u)}return se=S.children,S=S.fallback,C?(vi(),C=u.mode,se=pm({mode:"hidden",children:se},C),S=bo(S,C,g,null),se.return=u,S.return=u,se.sibling=S,u.child=se,C=u.child,C.memoizedState=hm(g),C.childLanes=dm(c,q,g),u.memoizedState=is,S):(Zi(u),yf(u,se))}if(Se=c.memoizedState,Se!==null&&(se=Se.dehydrated,se!==null)){if(B)u.flags&256?(Zi(u),u.flags&=-257,u=mm(c,u,g)):u.memoizedState!==null?(vi(),u.child=c.child,u.flags|=128,u=null):(vi(),C=S.fallback,se=u.mode,S=pm({mode:"visible",children:S.children},se),C=bo(C,se,g,null),C.flags|=2,S.return=u,C.return=u,S.sibling=C,u.child=S,yl(u,c.child,null,g),S=u.child,S.memoizedState=hm(g),S.childLanes=dm(c,q,g),u.memoizedState=is,u=C);else if(Zi(u),Hf(se))q=j_(se).digest,S=Error(i(419)),S.stack="",S.digest=q,mt({value:S,source:null,stack:null}),u=mm(c,u,g);else if(na||Xl(c,u,g,!1),q=(g&c.childLanes)!==0,na||q){if(q=Fn,q!==null){if(S=g&-g,(S&42)!==0)S=1;else switch(S){case 2:S=1;break;case 8:S=4;break;case 32:S=16;break;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:S=64;break;case 268435456:S=134217728;break;default:S=0}if(S=(S&(q.suspendedLanes|g))!==0?0:S,S!==0&&S!==Se.retryLane)throw Se.retryLane=S,rt(c,S),Qa(q,c,S),_y}Bd(se)||xs(),u=mm(c,u,g)}else Bd(se)?(u.flags|=128,u.child=c.child,u=Zl.bind(null,c),WS(se,u),u=null):(c=Se.treeContext,cs&&(ka=ey(se),ts=u,ni=!0,Ys=null,or=!1,c!==null&&(ks[Xs++]=Zr,ks[Xs++]=rr,ks[Xs++]=Tr,Zr=c.id,rr=c.overflow,Tr=u)),u=yf(u,S.children),u.flags|=4096);return u}return C?(vi(),C=S.fallback,se=u.mode,Se=c.child,B=Se.sibling,S=$a(Se,{mode:"hidden",children:S.children}),S.subtreeFlags=Se.subtreeFlags&31457280,B!==null?C=$a(B,C):(C=bo(C,se,g,null),C.flags|=2),C.return=u,S.return=u,S.sibling=C,u.child=S,S=C,C=u.child,se=c.child.memoizedState,se===null?se=hm(g):(Se=se.cachePool,Se!==null?(B=Kr?ui._currentValue:ui._currentValue2,Se=Se.parent!==B?{parent:B,pool:B}:Se):Se=L_(),se={baseLanes:se.baseLanes|g,cachePool:Se}),C.memoizedState=se,C.childLanes=dm(c,q,g),u.memoizedState=is,S):(Zi(u),g=c.child,c=g.sibling,g=$a(g,{mode:"visible",children:S.children}),g.return=u,g.sibling=null,c!==null&&(q=u.deletions,q===null?(u.deletions=[c],u.flags|=16):q.push(c)),u.child=g,u.memoizedState=null,g)}function yf(c,u){return u=pm({mode:"visible",children:u},c.mode),u.return=c,c.child=u}function pm(c,u){return yd(c,u,0,null)}function mm(c,u,g){return yl(u,c.child,null,g),c=yf(u,u.pendingProps.children),c.flags|=2,u.memoizedState=null,c}function w_(c,u,g){c.lanes|=u;var S=c.alternate;S!==null&&(S.lanes|=u),vm(c.return,u,g)}function id(c,u,g,S,C){var B=c.memoizedState;B===null?c.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:S,tail:g,tailMode:C}:(B.isBackwards=u,B.rendering=null,B.renderingStartTime=0,B.last=S,B.tail=g,B.tailMode=C)}function B_(c,u,g){var S=u.pendingProps,C=S.revealOrder,B=S.tail;if(Fa(c,u,S.children,g),S=pa.current,(S&2)!==0)S=S&1|2,u.flags|=128;else{if(c!==null&&(c.flags&128)!==0)e:for(c=u.child;c!==null;){if(c.tag===13)c.memoizedState!==null&&w_(c,g,u);else if(c.tag===19)w_(c,g,u);else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===u)break e;for(;c.sibling===null;){if(c.return===null||c.return===u)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}S&=1}switch(w(pa,S),C){case"forwards":for(g=u.child,C=null;g!==null;)c=g.alternate,c!==null&&ci(c)===null&&(C=g),g=g.sibling;g=C,g===null?(C=u.child,u.child=null):(C=g.sibling,g.sibling=null),id(u,!1,C,g,B);break;case"backwards":for(g=null,C=u.child,u.child=null;C!==null;){if(c=C.alternate,c!==null&&ci(c)===null){u.child=C;break}c=C.sibling,C.sibling=g,g=C,C=c}id(u,!0,g,null,B);break;case"together":id(u,!1,null,null,void 0);break;default:u.memoizedState=null}return u.child}function go(c,u,g){if(c!==null&&(u.dependencies=c.dependencies),js|=u.lanes,(g&u.childLanes)===0)if(c!==null){if(Xl(c,u,g,!1),(g&u.childLanes)===0)return null}else return null;if(c!==null&&u.child!==c.child)throw Error(i(153));if(u.child!==null){for(c=u.child,g=$a(c,c.pendingProps),u.child=g,g.return=u;c.sibling!==null;)c=c.sibling,g=g.sibling=$a(c,c.pendingProps),g.return=u;g.sibling=null}return u.child}function gm(c,u){return(c.lanes&u)!==0?!0:(c=c.dependencies,!!(c!==null&&Zo(c)))}function JS(c,u,g){switch(u.tag){case 3:Ne(u,u.stateNode.containerInfo),jo(u,ui,c.memoizedState.cache),It();break;case 27:case 5:ve(u);break;case 4:Ne(u,u.stateNode.containerInfo);break;case 10:jo(u,u.type,u.memoizedProps.value);break;case 13:var S=u.memoizedState;if(S!==null)return S.dehydrated!==null?(Zi(u),u.flags|=128,null):(g&u.child.childLanes)!==0?R_(c,u,g):(Zi(u),c=go(c,u,g),c!==null?c.sibling:null);Zi(u);break;case 19:var C=(c.flags&128)!==0;if(S=(g&u.childLanes)!==0,S||(Xl(c,u,g,!1),S=(g&u.childLanes)!==0),C){if(S)return B_(c,u,g);u.flags|=128}if(C=u.memoizedState,C!==null&&(C.rendering=null,C.tail=null,C.lastEffect=null),w(pa,pa.current),S)break;return null;case 22:case 23:return u.lanes=0,b_(c,u,g);case 24:jo(u,ui,c.memoizedState.cache)}return go(c,u,g)}function D_(c,u,g){if(c!==null)if(c.memoizedProps!==u.pendingProps)na=!0;else{if(!gm(c,g)&&(u.flags&128)===0)return na=!1,JS(c,u,g);na=(c.flags&131072)!==0}else na=!1,ni&&(u.flags&1048576)!==0&&W(u,Xf,u.index);switch(u.lanes=0,u.tag){case 16:e:{c=u.pendingProps;var S=u.elementType,C=S._init;if(S=C(S._payload),u.type=S,typeof S=="function")So(S)?(c=Ar(S,c),u.tag=1,u=fm(null,u,S,c,g)):(u.tag=0,u=um(null,u,S,c,g));else{if(S!=null){if(C=S.$$typeof,C===iu){u.tag=11,u=S_(null,u,S,c,g);break e}else if(C===Bf){u.tag=14,u=M_(null,u,S,c,g);break e}}throw u=l(S)||S,Error(i(306,u,""))}}return u;case 0:return um(c,u,u.type,u.pendingProps,g);case 1:return S=u.type,C=Ar(S,u.pendingProps),fm(c,u,S,C,g);case 3:e:{if(Ne(u,u.stateNode.containerInfo),c===null)throw Error(i(387));var B=u.pendingProps;C=u.memoizedState,S=C.element,Xt(c,u),qt(u,B,null,g);var q=u.memoizedState;if(B=q.cache,jo(u,ui,B),B!==C.cache&&_m(u,[ui],g,!0),st(),B=q.element,cs&&C.isDehydrated)if(C={element:B,isDehydrated:!1,cache:q.cache},u.updateQueue.baseState=C,u.memoizedState=C,u.flags&256){u=C_(c,u,B,g);break e}else if(B!==S){S=ye(Error(i(424)),u),mt(S),u=C_(c,u,B,g);break e}else for(cs&&(ka=$_(u.stateNode.containerInfo),ts=u,ni=!0,Ys=null,or=!0),g=_g(u,null,B,g),u.child=g;g;)g.flags=g.flags&-3|4096,g=g.sibling;else{if(It(),B===S){u=go(c,u,g);break e}Fa(c,u,B,g)}u=u.child}return u;case 26:if(zs)return _f(c,u),c===null?(g=Od(u.type,null,u.pendingProps,null))?u.memoizedState=g:ni||(u.stateNode=ZS(u.type,u.pendingProps,Cr.current,u)):u.memoizedState=Od(u.type,c.memoizedProps,u.pendingProps,c.memoizedState),null;case 27:if(za)return ve(u),c===null&&za&&ni&&(S=u.stateNode=pg(u.type,u.pendingProps,Cr.current,Ba.current,!1),ts=u,or=!0,ka=Dd(S)),S=u.pendingProps.children,c!==null||ni?Fa(c,u,S,g):u.child=yl(u,null,S,g),_f(c,u),u.child;case 5:return c===null&&ni&&(ly(u.type,u.pendingProps,Ba.current),(C=S=ka)&&(S=ty(S,u.type,u.pendingProps,or),S!==null?(u.stateNode=S,ts=u,ka=Dd(S),or=!1,C=!0):C=!1),C||tt(u)),ve(u),C=u.type,B=u.pendingProps,q=c!==null?c.memoizedProps:null,S=B.children,pl(C,B)?S=null:q!==null&&pl(C,q)&&(u.flags|=32),u.memoizedState!==null&&(C=J(c,u,Pe,null,null,g),Kr?gn._currentValue=C:gn._currentValue2=C),_f(c,u),Fa(c,u,S,g),u.child;case 6:return c===null&&ni&&(cy(u.pendingProps,Ba.current),(c=g=ka)&&(g=ny(g,u.pendingProps,or),g!==null?(u.stateNode=g,ts=u,ka=null,c=!0):c=!1),c||tt(u)),null;case 13:return R_(c,u,g);case 4:return Ne(u,u.stateNode.containerInfo),S=u.pendingProps,c===null?u.child=yl(u,null,S,g):Fa(c,u,S,g),u.child;case 11:return S_(c,u,u.type,u.pendingProps,g);case 7:return Fa(c,u,u.pendingProps,g),u.child;case 8:return Fa(c,u,u.pendingProps.children,g),u.child;case 12:return Fa(c,u,u.pendingProps.children,g),u.child;case 10:return S=u.pendingProps,jo(u,u.type,S.value),Fa(c,u,S.children,g),u.child;case 9:return C=u.type._context,S=u.pendingProps.children,Yl(u),C=Ha(C),S=S(C),u.flags|=1,Fa(c,u,S,g),u.child;case 14:return M_(c,u,u.type,u.pendingProps,g);case 15:return nd(c,u,u.type,u.pendingProps,g);case 19:return B_(c,u,g);case 22:return b_(c,u,g);case 24:return Yl(u),S=Ha(ui),c===null?(C=Qo(),C===null&&(C=Fn,B=ad(),C.pooledCache=B,B.refCount++,B!==null&&(C.pooledCacheLanes|=g),C=B),u.memoizedState={parent:S,cache:C},Ht(u),jo(u,ui,C)):((c.lanes&g)!==0&&(Xt(c,u),qt(u,null,null,g),st()),C=c.memoizedState,B=u.memoizedState,C.parent!==S?(C={parent:S,cache:S},u.memoizedState=C,u.lanes===0&&(u.memoizedState=u.updateQueue.baseState=C),jo(u,ui,S)):(S=B.cache,jo(u,ui,S),S!==C.cache&&_m(u,[ui],g,!0))),Fa(c,u,u.pendingProps.children,g),u.child;case 29:throw u.pendingProps}throw Error(i(156,u.tag))}function jo(c,u,g){Kr?(w(Es,u._currentValue),u._currentValue=g):(w(Es,u._currentValue2),u._currentValue2=g)}function vo(c){var u=Es.current;Kr?c._currentValue=u:c._currentValue2=u,M(Es)}function vm(c,u,g){for(;c!==null;){var S=c.alternate;if((c.childLanes&u)!==u?(c.childLanes|=u,S!==null&&(S.childLanes|=u)):S!==null&&(S.childLanes&u)!==u&&(S.childLanes|=u),c===g)break;c=c.return}}function _m(c,u,g,S){var C=c.child;for(C!==null&&(C.return=c);C!==null;){var B=C.dependencies;if(B!==null){var q=C.child;B=B.firstContext;e:for(;B!==null;){var se=B;B=C;for(var Se=0;Se<u.length;Se++)if(se.context===u[Se]){B.lanes|=g,se=B.alternate,se!==null&&(se.lanes|=g),vm(B.return,g,c),S||(q=null);break e}B=se.next}}else if(C.tag===18){if(q=C.return,q===null)throw Error(i(341));q.lanes|=g,B=q.alternate,B!==null&&(B.lanes|=g),vm(q,g,c),q=null}else q=C.child;if(q!==null)q.return=C;else for(q=C;q!==null;){if(q===c){q=null;break}if(C=q.sibling,C!==null){C.return=q.return,q=C;break}q=q.return}C=q}}function Xl(c,u,g,S){c=null;for(var C=u,B=!1;C!==null;){if(!B){if((C.flags&524288)!==0)B=!0;else if((C.flags&262144)!==0)break}if(C.tag===10){var q=C.alternate;if(q===null)throw Error(i(387));if(q=q.memoizedProps,q!==null){var se=C.type;Vs(C.pendingProps.value,q.value)||(c!==null?c.push(se):c=[se])}}else if(C===uu.current){if(q=C.alternate,q===null)throw Error(i(387));q.memoizedState.memoizedState!==C.memoizedState.memoizedState&&(c!==null?c.push(gn):c=[gn])}C=C.return}c!==null&&_m(u,c,g,S),u.flags|=262144}function Zo(c){for(c=c.firstContext;c!==null;){var u=c.context;if(!Vs(Kr?u._currentValue:u._currentValue2,c.memoizedValue))return!0;c=c.next}return!1}function Yl(c){Al=c,Ki=null,c=c.dependencies,c!==null&&(c.firstContext=null)}function Ha(c){return ym(Al,c)}function xf(c,u){return Al===null&&Yl(c),ym(c,u)}function ym(c,u){var g=Kr?u._currentValue:u._currentValue2;if(u={context:u,memoizedValue:g,next:null},Ki===null){if(c===null)throw Error(i(308));Ki=u,c.dependencies={lanes:0,firstContext:u},c.flags|=524288}else Ki=Ki.next=u;return g}function ad(){return{controller:new yy,data:new Map,refCount:0}}function Vc(c){c.refCount--,c.refCount===0&&Lo(oc,function(){c.controller.abort()})}function Qo(){var c=No.current;return c!==null?c:Fn.pooledCache}function sd(c,u){u===null?w(No,No.current):w(No,u.pool)}function L_(){var c=Qo();return c===null?null:{parent:Kr?ui._currentValue:ui._currentValue2,pool:c}}function Is(c){c.flags|=4}function xm(c,u){if(c!==null&&c.child===u.child)return!1;if((u.flags&16)!==0)return!0;for(c=u.child;c!==null;){if((c.flags&13878)!==0||(c.subtreeFlags&13878)!==0)return!0;c=c.sibling}return!1}function rd(c,u,g,S){if(Ga)for(g=u.child;g!==null;){if(g.tag===5||g.tag===6)qr(c,g.stateNode);else if(!(g.tag===4||za&&g.tag===27)&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===u)break;for(;g.sibling===null;){if(g.return===null||g.return===u)return;g=g.return}g.sibling.return=g.return,g=g.sibling}else if(Ps)for(var C=u.child;C!==null;){if(C.tag===5){var B=C.stateNode;g&&S&&(B=tg(B,C.type,C.memoizedProps)),qr(c,B)}else if(C.tag===6)B=C.stateNode,g&&S&&(B=ng(B,C.memoizedProps)),qr(c,B);else if(C.tag!==4){if(C.tag===22&&C.memoizedState!==null)B=C.child,B!==null&&(B.return=C),rd(c,C,!0,!0);else if(C.child!==null){C.child.return=C,C=C.child;continue}}if(C===u)break;for(;C.sibling===null;){if(C.return===null||C.return===u)return;C=C.return}C.sibling.return=C.return,C=C.sibling}}function kc(c,u,g,S){if(Ps)for(var C=u.child;C!==null;){if(C.tag===5){var B=C.stateNode;g&&S&&(B=tg(B,C.type,C.memoizedProps)),$m(c,B)}else if(C.tag===6)B=C.stateNode,g&&S&&(B=ng(B,C.memoizedProps)),$m(c,B);else if(C.tag!==4){if(C.tag===22&&C.memoizedState!==null)B=C.child,B!==null&&(B.return=C),kc(c,C,!(C.memoizedProps!==null&&C.memoizedProps.mode==="manual"),!0);else if(C.child!==null){C.child.return=C,C=C.child;continue}}if(C===u)break;for(;C.sibling===null;){if(C.return===null||C.return===u)return;C=C.return}C.sibling.return=C.return,C=C.sibling}}function Xc(c,u){if(Ps&&xm(c,u)){c=u.stateNode;var g=c.containerInfo,S=wd();kc(S,u,!1,!1),c.pendingChildren=S,Is(u),W_(g,S)}}function Am(c,u,g,S){if(Ga)c.memoizedProps!==S&&Is(u);else if(Ps){var C=c.stateNode,B=c.memoizedProps;if((c=xm(c,u))||B!==S){var q=Ba.current;B=Qm(C,g,B,S,!c,null),B===C?u.stateNode=C:(To(B,g,S,q)&&Is(u),u.stateNode=B,c?rd(B,u,!1,!1):Is(u))}else u.stateNode=C}}function Yc(c,u,g){if(J_(u,g)){if(c.flags|=16777216,!Co(u,g))if(Tf())c.flags|=8192;else throw rc=Gd,vg}else c.flags&=-16777217}function Sm(c,u){if(uy(u)){if(c.flags|=16777216,!hg(u))if(Tf())c.flags|=8192;else throw rc=Gd,vg}else c.flags&=-16777217}function Af(c,u){u!==null&&(c.flags|=4),c.flags&16384&&(u=c.tag!==22?N():536870912,c.lanes|=u,Oo|=u)}function Jl(c,u){if(!ni)switch(c.tailMode){case"hidden":u=c.tail;for(var g=null;u!==null;)u.alternate!==null&&(g=u),u=u.sibling;g===null?c.tail=null:g.sibling=null;break;case"collapsed":g=c.tail;for(var S=null;g!==null;)g.alternate!==null&&(S=g),g=g.sibling;S===null?u||c.tail===null?c.tail=null:c.tail.sibling=null:S.sibling=null}}function wi(c){var u=c.alternate!==null&&c.alternate.child===c.child,g=0,S=0;if(u)for(var C=c.child;C!==null;)g|=C.lanes|C.childLanes,S|=C.subtreeFlags&31457280,S|=C.flags&31457280,C.return=c,C=C.sibling;else for(C=c.child;C!==null;)g|=C.lanes|C.childLanes,S|=C.subtreeFlags,S|=C.flags,C.return=c,C=C.sibling;return c.subtreeFlags|=S,c.childLanes=g,u}function N_(c,u,g){var S=u.pendingProps;switch(Me(u),u.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return wi(u),null;case 1:return wi(u),null;case 3:return g=u.stateNode,S=null,c!==null&&(S=c.memoizedState.cache),u.memoizedState.cache!==S&&(u.flags|=2048),vo(ui),it(),g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null),(c===null||c.child===null)&&(on(u)?Is(u):c===null||c.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,Ys!==null&&(yo(Ys),Ys=null))),Xc(c,u),wi(u),null;case 26:if(zs){g=u.type;var C=u.memoizedState;return c===null?(Is(u),C!==null?(wi(u),Sm(u,C)):(wi(u),Yc(u,g,S))):C?C!==c.memoizedState?(Is(u),wi(u),Sm(u,C)):(wi(u),u.flags&=-16777217):(Ga?c.memoizedProps!==S&&Is(u):Am(c,u,g,S),wi(u),Yc(u,g,S)),null}case 27:if(za){if(Ce(u),g=Cr.current,C=u.type,c!==null&&u.stateNode!=null)Ga?c.memoizedProps!==S&&Is(u):Am(c,u,C,S);else{if(!S){if(u.stateNode===null)throw Error(i(166));return wi(u),null}c=Ba.current,on(u)?Et(u,c):(c=pg(C,S,g,c,!0),u.stateNode=c,Is(u))}return wi(u),null}case 5:if(Ce(u),g=u.type,c!==null&&u.stateNode!=null)Am(c,u,g,S);else{if(!S){if(u.stateNode===null)throw Error(i(166));return wi(u),null}c=Ba.current,on(u)?Et(u,c):(C=zm(g,S,Cr.current,c,u),rd(C,u,!1,!1),u.stateNode=C,To(C,g,S,c)&&Is(u))}return wi(u),Yc(u,u.type,u.pendingProps),null;case 6:if(c&&u.stateNode!=null)g=c.memoizedProps,Ga?g!==S&&Is(u):Ps&&(g!==S?(u.stateNode=Md(S,Cr.current,Ba.current,u),Is(u)):u.stateNode=c.stateNode);else{if(typeof S!="string"&&u.stateNode===null)throw Error(i(166));if(c=Cr.current,g=Ba.current,on(u)){if(!cs)throw Error(i(176));if(c=u.stateNode,g=u.memoizedProps,S=null,C=ts,C!==null)switch(C.tag){case 27:case 5:S=C.memoizedProps}ay(c,g,u,S)||tt(u)}else u.stateNode=Md(S,c,g,u)}return wi(u),null;case 13:if(S=u.memoizedState,c===null||c.memoizedState!==null&&c.memoizedState.dehydrated!==null){if(C=on(u),S!==null&&S.dehydrated!==null){if(c===null){if(!C)throw Error(i(318));if(!cs)throw Error(i(344));if(C=u.memoizedState,C=C!==null?C.dehydrated:null,!C)throw Error(i(317));su(C,u)}else It(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;wi(u),C=!1}else Ys!==null&&(yo(Ys),Ys=null),C=!0;if(!C)return u.flags&256?(en(u),u):(en(u),null)}if(en(u),(u.flags&128)!==0)return u.lanes=g,u;if(g=S!==null,c=c!==null&&c.memoizedState!==null,g){S=u.child,C=null,S.alternate!==null&&S.alternate.memoizedState!==null&&S.alternate.memoizedState.cachePool!==null&&(C=S.alternate.memoizedState.cachePool.pool);var B=null;S.memoizedState!==null&&S.memoizedState.cachePool!==null&&(B=S.memoizedState.cachePool.pool),B!==C&&(S.flags|=2048)}return g!==c&&g&&(u.child.flags|=8192),Af(u,u.updateQueue),wi(u),null;case 4:return it(),Xc(c,u),c===null&&Xm(u.stateNode.containerInfo),wi(u),null;case 10:return vo(u.type),wi(u),null;case 19:if(M(pa),C=u.memoizedState,C===null)return wi(u),null;if(S=(u.flags&128)!==0,B=C.rendering,B===null)if(S)Jl(C,!1);else{if(Zn!==0||c!==null&&(c.flags&128)!==0)for(c=u.child;c!==null;){if(B=ci(c),B!==null){for(u.flags|=128,Jl(C,!1),c=B.updateQueue,u.updateQueue=c,Af(u,c),u.subtreeFlags=0,c=g,g=u.child;g!==null;)Mo(g,c),g=g.sibling;return w(pa,pa.current&1|2),u.child}c=c.sibling}C.tail!==null&&Va()>Pi&&(u.flags|=128,S=!0,Jl(C,!1),u.lanes=4194304)}else{if(!S)if(c=ci(B),c!==null){if(u.flags|=128,S=!0,c=c.updateQueue,u.updateQueue=c,Af(u,c),Jl(C,!0),C.tail===null&&C.tailMode==="hidden"&&!B.alternate&&!ni)return wi(u),null}else 2*Va()-C.renderingStartTime>Pi&&g!==536870912&&(u.flags|=128,S=!0,Jl(C,!1),u.lanes=4194304);C.isBackwards?(B.sibling=u.child,u.child=B):(c=C.last,c!==null?c.sibling=B:u.child=B,C.last=B)}return C.tail!==null?(u=C.tail,C.rendering=u,C.tail=u.sibling,C.renderingStartTime=Va(),u.sibling=null,c=pa.current,w(pa,S?c&1|2:c&1),u):(wi(u),null);case 22:case 23:return en(u),Ui(),S=u.memoizedState!==null,c!==null?c.memoizedState!==null!==S&&(u.flags|=8192):S&&(u.flags|=8192),S?(g&536870912)!==0&&(u.flags&128)===0&&(wi(u),u.subtreeFlags&6&&(u.flags|=8192)):wi(u),g=u.updateQueue,g!==null&&Af(u,g.retryQueue),g=null,c!==null&&c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(g=c.memoizedState.cachePool.pool),S=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(S=u.memoizedState.cachePool.pool),S!==g&&(u.flags|=2048),c!==null&&M(No),null;case 24:return g=null,c!==null&&(g=c.memoizedState.cache),u.memoizedState.cache!==g&&(u.flags|=2048),vo(ui),wi(u),null;case 25:return null}throw Error(i(156,u.tag))}function U_(c,u){switch(Me(u),u.tag){case 1:return c=u.flags,c&65536?(u.flags=c&-65537|128,u):null;case 3:return vo(ui),it(),c=u.flags,(c&65536)!==0&&(c&128)===0?(u.flags=c&-65537|128,u):null;case 26:case 27:case 5:return Ce(u),null;case 13:if(en(u),c=u.memoizedState,c!==null&&c.dehydrated!==null){if(u.alternate===null)throw Error(i(340));It()}return c=u.flags,c&65536?(u.flags=c&-65537|128,u):null;case 19:return M(pa),null;case 4:return it(),null;case 10:return vo(u.type),null;case 22:case 23:return en(u),Ui(),c!==null&&M(No),c=u.flags,c&65536?(u.flags=c&-65537|128,u):null;case 24:return vo(ui),null;case 25:return null;default:return null}}function Mm(c,u){switch(Me(u),u.tag){case 3:vo(ui),it();break;case 26:case 27:case 5:Ce(u);break;case 4:it();break;case 13:en(u);break;case 19:M(pa);break;case 10:vo(u.type);break;case 22:case 23:en(u),Ui(),c!==null&&M(No);break;case 24:vo(ui)}}function Sf(c,u){try{var g=u.updateQueue,S=g!==null?g.lastEffect:null;if(S!==null){var C=S.next;g=C;do{if((g.tag&c)===c){S=void 0;var B=g.create,q=g.inst;S=B(),q.destroy=S}g=g.next}while(g!==C)}}catch(se){zn(u,u.return,se)}}function $o(c,u,g){try{var S=u.updateQueue,C=S!==null?S.lastEffect:null;if(C!==null){var B=C.next;S=B;do{if((S.tag&c)===c){var q=S.inst,se=q.destroy;if(se!==void 0){q.destroy=void 0,C=u;var Se=g;try{se()}catch(Je){zn(C,Se,Je)}}}S=S.next}while(S!==B)}}catch(Je){zn(u,u.return,Je)}}function O_(c){var u=c.updateQueue;if(u!==null){var g=c.stateNode;try{be(u,g)}catch(S){zn(c,c.return,S)}}}function I_(c,u,g){g.props=Ar(c.type,c.memoizedProps),g.state=c.memoizedState;try{g.componentWillUnmount()}catch(S){zn(c,u,S)}}function ql(c,u){try{var g=c.ref;if(g!==null){var S=c.stateNode;switch(c.tag){case 26:case 27:case 5:var C=au(S);break;default:C=S}typeof g=="function"?c.refCleanup=g(C):g.current=C}}catch(B){zn(c,u,B)}}function Bi(c,u){var g=c.ref,S=c.refCleanup;if(g!==null)if(typeof S=="function")try{S()}catch(C){zn(c,u,C)}finally{c.refCleanup=null,c=c.alternate,c!=null&&(c.refCleanup=null)}else if(typeof g=="function")try{g(null)}catch(C){zn(c,u,C)}else g.current=null}function Jc(c){var u=c.type,g=c.memoizedProps,S=c.stateNode;try{KS(S,u,g,c)}catch(C){zn(c,c.return,C)}}function bm(c,u,g){try{Km(c.stateNode,c.type,g,u,c)}catch(S){zn(c,c.return,S)}}function Em(c){return c.tag===5||c.tag===3||(zs?c.tag===26:!1)||(za?c.tag===27:!1)||c.tag===4}function od(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||Em(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&(!za||c.tag!==27)&&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 ld(c,u,g){var S=c.tag;if(S===5||S===6)c=c.stateNode,u?jm(g,c,u):q_(g,c);else if(!(S===4||za&&S===27)&&(c=c.child,c!==null))for(ld(c,u,g),c=c.sibling;c!==null;)ld(c,u,g),c=c.sibling}function qc(c,u,g){var S=c.tag;if(S===5||S===6)c=c.stateNode,u?Wm(g,c,u):qm(g,c);else if(!(S===4||za&&S===27)&&(c=c.child,c!==null))for(qc(c,u,g),c=c.sibling;c!==null;)qc(c,u,g),c=c.sibling}function F_(c,u,g){c=c.containerInfo;try{eg(c,g)}catch(S){zn(u,u.return,S)}}function Kc(c,u){for(dl(c.containerInfo),Wi=u;Wi!==null;)if(c=Wi,u=c.child,(c.subtreeFlags&1028)!==0&&u!==null)u.return=c,Wi=u;else for(;Wi!==null;){c=Wi;var g=c.alternate;switch(u=c.flags,c.tag){case 0:break;case 11:case 15:break;case 1:if((u&1024)!==0&&g!==null){u=void 0;var S=c,C=g.memoizedProps;g=g.memoizedState;var B=S.stateNode;try{var q=Ar(S.type,C,S.elementType===S.type);u=B.getSnapshotBeforeUpdate(q,g),B.__reactInternalSnapshotBeforeUpdate=u}catch(se){zn(S,S.return,se)}}break;case 3:(u&1024)!==0&&Ga&&Rd(c.stateNode.containerInfo);break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((u&1024)!==0)throw Error(i(163))}if(u=c.sibling,u!==null){u.return=c.return,Wi=u;break}Wi=c.return}return q=lc,lc=!1,q}function cd(c,u,g){var S=g.flags;switch(g.tag){case 0:case 11:case 15:zr(c,g),S&4&&Sf(5,g);break;case 1:if(zr(c,g),S&4)if(c=g.stateNode,u===null)try{c.componentDidMount()}catch(se){zn(g,g.return,se)}else{var C=Ar(g.type,u.memoizedProps);u=u.memoizedState;try{c.componentDidUpdate(C,u,c.__reactInternalSnapshotBeforeUpdate)}catch(se){zn(g,g.return,se)}}S&64&&O_(g),S&512&&ql(g,g.return);break;case 3:if(zr(c,g),S&64&&(S=g.updateQueue,S!==null)){if(c=null,g.child!==null)switch(g.child.tag){case 27:case 5:c=au(g.child.stateNode);break;case 1:c=g.child.stateNode}try{be(S,c)}catch(se){zn(g,g.return,se)}}break;case 26:if(zs){zr(c,g),S&512&&ql(g,g.return);break}case 27:case 5:zr(c,g),u===null&&S&4&&Jc(g),S&512&&ql(g,g.return);break;case 12:zr(c,g);break;case 13:zr(c,g),S&4&&el(c,g);break;case 22:if(C=g.memoizedState!==null||Aa,!C){u=u!==null&&u.memoizedState!==null||Hi;var B=Aa,q=Hi;Aa=C,(Hi=u)&&!q?nl(c,g,(g.subtreeFlags&8772)!==0):zr(c,g),Aa=B,Hi=q}S&512&&(g.memoizedProps.mode==="manual"?ql(g,g.return):Bi(g,g.return));break;default:zr(c,g)}}function Wc(c){var u=c.alternate;u!==null&&(c.alternate=null,Wc(u)),c.child=null,c.deletions=null,c.sibling=null,c.tag===5&&(u=c.stateNode,u!==null&&Ym(u)),c.stateNode=null,c.return=null,c.dependencies=null,c.memoizedProps=null,c.memoizedState=null,c.pendingProps=null,c.stateNode=null,c.updateQueue=null}function Fs(c,u,g){for(g=g.child;g!==null;)ud(c,u,g),g=g.sibling}function ud(c,u,g){if(Ms&&typeof Ms.onCommitFiberUnmount=="function")try{Ms.onCommitFiberUnmount(cu,g)}catch{}switch(g.tag){case 26:if(zs){Hi||Bi(g,u),Fs(c,u,g),g.memoizedState?og(g.memoizedState):g.stateNode&&ug(g.stateNode);break}case 27:if(za){Hi||Bi(g,u);var S=ia,C=Ts;ia=g.stateNode,Fs(c,u,g),fy(g.stateNode),ia=S,Ts=C;break}case 5:Hi||Bi(g,u);case 6:if(Ga){if(S=ia,C=Ts,ia=null,Fs(c,u,g),ia=S,Ts=C,ia!==null)if(Ts)try{ea(ia,g.stateNode)}catch(B){zn(g,u,B)}else try{us(ia,g.stateNode)}catch(B){zn(g,u,B)}}else Fs(c,u,g);break;case 18:Ga&&ia!==null&&(Ts?ag(ia,g.stateNode):ry(ia,g.stateNode));break;case 4:Ga?(S=ia,C=Ts,ia=g.stateNode.containerInfo,Ts=!0,Fs(c,u,g),ia=S,Ts=C):(Ps&&F_(g.stateNode,g,wd()),Fs(c,u,g));break;case 0:case 11:case 14:case 15:Hi||$o(2,g,u),Hi||$o(4,g,u),Fs(c,u,g);break;case 1:Hi||(Bi(g,u),S=g.stateNode,typeof S.componentWillUnmount=="function"&&I_(g,u,S)),Fs(c,u,g);break;case 21:Fs(c,u,g);break;case 22:Hi||Bi(g,u),Hi=(S=Hi)||g.memoizedState!==null,Fs(c,u,g),Hi=S;break;default:Fs(c,u,g)}}function el(c,u){if(cs&&u.memoizedState===null&&(c=u.alternate,c!==null&&(c=c.memoizedState,c!==null&&(c=c.dehydrated,c!==null))))try{Nd(c)}catch(g){zn(u,u.return,g)}}function jc(c){switch(c.tag){case 13:case 19:var u=c.stateNode;return u===null&&(u=c.stateNode=new mu),u;case 22:return c=c.stateNode,u=c._retryCache,u===null&&(u=c._retryCache=new mu),u;default:throw Error(i(435,c.tag))}}function Mf(c,u){var g=jc(c);u.forEach(function(S){var C=Bm.bind(null,c,S);g.has(S)||(g.add(S),S.then(C,C))})}function rs(c,u){var g=u.deletions;if(g!==null)for(var S=0;S<g.length;S++){var C=g[S],B=c,q=u;if(Ga){var se=q;e:for(;se!==null;){switch(se.tag){case 27:case 5:ia=se.stateNode,Ts=!1;break e;case 3:ia=se.stateNode.containerInfo,Ts=!0;break e;case 4:ia=se.stateNode.containerInfo,Ts=!0;break e}se=se.return}if(ia===null)throw Error(i(160));ud(B,q,C),ia=null,Ts=!1}else ud(B,q,C);B=C.alternate,B!==null&&(B.return=null),C.return=null}if(u.subtreeFlags&13878)for(u=u.child;u!==null;)tl(u,c),u=u.sibling}function tl(c,u){var g=c.alternate,S=c.flags;switch(c.tag){case 0:case 11:case 14:case 15:rs(u,c),_s(c),S&4&&($o(3,c,c.return),Sf(3,c),$o(5,c,c.return));break;case 1:rs(u,c),_s(c),S&512&&(Hi||g===null||Bi(g,g.return)),S&64&&Aa&&(c=c.updateQueue,c!==null&&(S=c.callbacks,S!==null&&(g=c.shared.hiddenCallbacks,c.shared.hiddenCallbacks=g===null?S:g.concat(S))));break;case 26:if(zs){var C=fs;rs(u,c),_s(c),S&512&&(Hi||g===null||Bi(g,g.return)),S&4&&(S=g!==null?g.memoizedState:null,u=c.memoizedState,g===null?u===null?c.stateNode===null?c.stateNode=lg(C,c.type,c.memoizedProps,c):cg(C,c.type,c.stateNode):c.stateNode=rg(C,u,c.memoizedProps):S!==u?(S===null?g.stateNode!==null&&ug(g.stateNode):og(S),u===null?cg(C,c.type,c.stateNode):rg(C,u,c.memoizedProps)):u===null&&c.stateNode!==null&&bm(c,c.memoizedProps,g.memoizedProps));break}case 27:if(za&&S&4&&c.alternate===null){C=c.stateNode;var B=c.memoizedProps;try{QS(C),$S(c.type,B,C,c)}catch(Mt){zn(c,c.return,Mt)}}case 5:if(rs(u,c),_s(c),S&512&&(Hi||g===null||Bi(g,g.return)),Ga){if(c.flags&32){u=c.stateNode;try{If(u)}catch(Mt){zn(c,c.return,Mt)}}S&4&&c.stateNode!=null&&(u=c.memoizedProps,bm(c,u,g!==null?g.memoizedProps:u)),S&1024&&(Sl=!0)}break;case 6:if(rs(u,c),_s(c),S&4&&Ga){if(c.stateNode===null)throw Error(i(162));S=c.memoizedProps,g=g!==null?g.memoizedProps:S,u=c.stateNode;try{K_(u,g,S)}catch(Mt){zn(c,c.return,Mt)}}break;case 3:if(zs?(fg(),C=fs,fs=Ud(u.containerInfo),rs(u,c),fs=C):rs(u,c),_s(c),S&4){if(Ga&&cs&&g!==null&&g.memoizedState.isDehydrated)try{Ld(u.containerInfo)}catch(Mt){zn(c,c.return,Mt)}if(Ps){S=u.containerInfo,g=u.pendingChildren;try{eg(S,g)}catch(Mt){zn(c,c.return,Mt)}}}Sl&&(Sl=!1,Tm(c));break;case 4:zs?(g=fs,fs=Ud(c.stateNode.containerInfo),rs(u,c),_s(c),fs=g):(rs(u,c),_s(c)),S&4&&Ps&&F_(c.stateNode,c,c.stateNode.pendingChildren);break;case 12:rs(u,c),_s(c);break;case 13:rs(u,c),_s(c),c.child.flags&8192&&c.memoizedState!==null!=(g!==null&&g.memoizedState!==null)&&(to=Va()),S&4&&(S=c.updateQueue,S!==null&&(c.updateQueue=null,Mf(c,S)));break;case 22:S&512&&(Hi||g===null||Bi(g,g.return)),C=c.memoizedState!==null;var q=g!==null&&g.memoizedState!==null,se=Aa,Se=Hi;if(Aa=se||C,Hi=Se||q,rs(u,c),Hi=Se,Aa=se,_s(c),u=c.stateNode,u._current=c,u._visibility&=-3,u._visibility|=u._pendingVisibility&2,S&8192&&(u._visibility=C?u._visibility&-2:u._visibility|1,C&&(u=Aa||Hi,g===null||q||u||Zc(c)),Ga&&(c.memoizedProps===null||c.memoizedProps.mode!=="manual"))){e:if(g=null,Ga)for(u=c;;){if(u.tag===5||zs&&u.tag===26||za&&u.tag===27){if(g===null){q=g=u;try{B=q.stateNode,C?Ff(B):Zm(q.stateNode,q.memoizedProps)}catch(Mt){zn(q,q.return,Mt)}}}else if(u.tag===6){if(g===null){q=u;try{var Je=q.stateNode;C?Cd(Je):Ro(Je,q.memoizedProps)}catch(Mt){zn(q,q.return,Mt)}}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===c)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===c)break e;for(;u.sibling===null;){if(u.return===null||u.return===c)break e;g===u&&(g=null),u=u.return}g===u&&(g=null),u.sibling.return=u.return,u=u.sibling}}S&4&&(S=c.updateQueue,S!==null&&(g=S.retryQueue,g!==null&&(S.retryQueue=null,Mf(c,g))));break;case 19:rs(u,c),_s(c),S&4&&(S=c.updateQueue,S!==null&&(c.updateQueue=null,Mf(c,S)));break;case 21:break;default:rs(u,c),_s(c)}}function _s(c){var u=c.flags;if(u&2){try{if(Ga&&(!za||c.tag!==27)){e:{for(var g=c.return;g!==null;){if(Em(g)){var S=g;break e}g=g.return}throw Error(i(160))}switch(S.tag){case 27:if(za){var C=S.stateNode,B=od(c);qc(c,B,C);break}case 5:var q=S.stateNode;S.flags&32&&(If(q),S.flags&=-33);var se=od(c);qc(c,se,q);break;case 3:case 4:var Se=S.stateNode.containerInfo,Je=od(c);ld(c,Je,Se);break;default:throw Error(i(161))}}}catch(Mt){zn(c,c.return,Mt)}c.flags&=-3}u&4096&&(c.flags&=-4097)}function Tm(c){if(c.subtreeFlags&1024)for(c=c.child;c!==null;){var u=c;Tm(u),u.tag===5&&u.flags&1024&&yi(u.stateNode),c=c.sibling}}function zr(c,u){if(u.subtreeFlags&8772)for(u=u.child;u!==null;)cd(c,u.alternate,u),u=u.sibling}function Zc(c){for(c=c.child;c!==null;){var u=c;switch(u.tag){case 0:case 11:case 14:case 15:$o(4,u,u.return),Zc(u);break;case 1:Bi(u,u.return);var g=u.stateNode;typeof g.componentWillUnmount=="function"&&I_(u,u.return,g),Zc(u);break;case 26:case 27:case 5:Bi(u,u.return),Zc(u);break;case 22:Bi(u,u.return),u.memoizedState===null&&Zc(u);break;default:Zc(u)}c=c.sibling}}function nl(c,u,g){for(g=g&&(u.subtreeFlags&8772)!==0,u=u.child;u!==null;){var S=u.alternate,C=c,B=u,q=B.flags;switch(B.tag){case 0:case 11:case 15:nl(C,B,g),Sf(4,B);break;case 1:if(nl(C,B,g),S=B,C=S.stateNode,typeof C.componentDidMount=="function")try{C.componentDidMount()}catch(Je){zn(S,S.return,Je)}if(S=B,C=S.updateQueue,C!==null){var se=S.stateNode;try{var Se=C.shared.hiddenCallbacks;if(Se!==null)for(C.shared.hiddenCallbacks=null,C=0;C<Se.length;C++)de(Se[C],se)}catch(Je){zn(S,S.return,Je)}}g&&q&64&&O_(B),ql(B,B.return);break;case 26:case 27:case 5:nl(C,B,g),g&&S===null&&q&4&&Jc(B),ql(B,B.return);break;case 12:nl(C,B,g);break;case 13:nl(C,B,g),g&&q&4&&el(C,B);break;case 22:B.memoizedState===null&&nl(C,B,g),ql(B,B.return);break;default:nl(C,B,g)}u=u.sibling}}function Cm(c,u){var g=null;c!==null&&c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(g=c.memoizedState.cachePool.pool),c=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(c=u.memoizedState.cachePool.pool),c!==g&&(c!=null&&c.refCount++,g!=null&&Vc(g))}function fd(c,u){c=null,u.alternate!==null&&(c=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==c&&(u.refCount++,c!=null&&Vc(c))}function _o(c,u,g,S){if(u.subtreeFlags&10256)for(u=u.child;u!==null;)hd(c,u,g,S),u=u.sibling}function hd(c,u,g,S){var C=u.flags;switch(u.tag){case 0:case 11:case 15:_o(c,u,g,S),C&2048&&Sf(9,u);break;case 3:_o(c,u,g,S),C&2048&&(c=null,u.alternate!==null&&(c=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==c&&(u.refCount++,c!=null&&Vc(c)));break;case 12:if(C&2048){_o(c,u,g,S),c=u.stateNode;try{var B=u.memoizedProps,q=B.id,se=B.onPostCommit;typeof se=="function"&&se(q,u.alternate===null?"mount":"update",c.passiveEffectDuration,-0)}catch(Se){zn(u,u.return,Se)}}else _o(c,u,g,S);break;case 23:break;case 22:B=u.stateNode,u.memoizedState!==null?B._visibility&4?_o(c,u,g,S):il(c,u):B._visibility&4?_o(c,u,g,S):(B._visibility|=4,Za(c,u,g,S,(u.subtreeFlags&10256)!==0)),C&2048&&Cm(u.alternate,u);break;case 24:_o(c,u,g,S),C&2048&&fd(u.alternate,u);break;default:_o(c,u,g,S)}}function Za(c,u,g,S,C){for(C=C&&(u.subtreeFlags&10256)!==0,u=u.child;u!==null;){var B=c,q=u,se=g,Se=S,Je=q.flags;switch(q.tag){case 0:case 11:case 15:Za(B,q,se,Se,C),Sf(8,q);break;case 23:break;case 22:var Mt=q.stateNode;q.memoizedState!==null?Mt._visibility&4?Za(B,q,se,Se,C):il(B,q):(Mt._visibility|=4,Za(B,q,se,Se,C)),C&&Je&2048&&Cm(q.alternate,q);break;case 24:Za(B,q,se,Se,C),C&&Je&2048&&fd(q.alternate,q);break;default:Za(B,q,se,Se,C)}u=u.sibling}}function il(c,u){if(u.subtreeFlags&10256)for(u=u.child;u!==null;){var g=c,S=u,C=S.flags;switch(S.tag){case 22:il(g,S),C&2048&&Cm(S.alternate,S);break;case 24:il(g,S),C&2048&&fd(S.alternate,S);break;default:il(g,S)}u=u.sibling}}function Ta(c){if(c.subtreeFlags&cc)for(c=c.child;c!==null;)Kl(c),c=c.sibling}function Kl(c){switch(c.tag){case 26:Ta(c),c.flags&cc&&(c.memoizedState!==null?dg(fs,c.memoizedState,c.memoizedProps):Xi(c.type,c.memoizedProps));break;case 5:Ta(c),c.flags&cc&&Xi(c.type,c.memoizedProps);break;case 3:case 4:if(zs){var u=fs;fs=Ud(c.stateNode.containerInfo),Ta(c),fs=u}else Ta(c);break;case 22:c.memoizedState===null&&(u=c.alternate,u!==null&&u.memoizedState!==null?(u=cc,cc=16777216,Ta(c),cc=u):Ta(c));break;default:Ta(c)}}function dd(c){var u=c.alternate;if(u!==null&&(c=u.child,c!==null)){u.child=null;do u=c.sibling,c.sibling=null,c=u;while(c!==null)}}function al(c){var u=c.deletions;if((c.flags&16)!==0){if(u!==null)for(var g=0;g<u.length;g++){var S=u[g];Wi=S,sl(S,c)}dd(c)}if(c.subtreeFlags&10256)for(c=c.child;c!==null;)bf(c),c=c.sibling}function bf(c){switch(c.tag){case 0:case 11:case 15:al(c),c.flags&2048&&$o(9,c,c.return);break;case 3:al(c);break;case 12:al(c);break;case 22:var u=c.stateNode;c.memoizedState!==null&&u._visibility&4&&(c.return===null||c.return.tag!==13)?(u._visibility&=-5,Qc(c)):al(c);break;default:al(c)}}function Qc(c){var u=c.deletions;if((c.flags&16)!==0){if(u!==null)for(var g=0;g<u.length;g++){var S=u[g];Wi=S,sl(S,c)}dd(c)}for(c=c.child;c!==null;){switch(u=c,u.tag){case 0:case 11:case 15:$o(8,u,u.return),Qc(u);break;case 22:g=u.stateNode,g._visibility&4&&(g._visibility&=-5,Qc(u));break;default:Qc(u)}c=c.sibling}}function sl(c,u){for(;Wi!==null;){var g=Wi;switch(g.tag){case 0:case 11:case 15:$o(8,g,u);break;case 23:case 22:if(g.memoizedState!==null&&g.memoizedState.cachePool!==null){var S=g.memoizedState.cachePool.pool;S!=null&&S.refCount++}break;case 24:Vc(g.memoizedState.cache)}if(S=g.child,S!==null)S.return=g,Wi=S;else e:for(g=c;Wi!==null;){S=Wi;var C=S.sibling,B=S.return;if(Wc(S),S===g){Wi=null;break e}if(C!==null){C.return=B,Wi=C;break e}Wi=B}}}function pd(c){var u=km(c);if(u!=null){if(typeof u.memoizedProps["data-testname"]!="string")throw Error(i(364));return u}if(c=ic(c),c===null)throw Error(i(362));return c.stateNode.current}function $c(c,u){var g=c.tag;switch(u.$$typeof){case Qf:if(c.type===u.value)return!0;break;case Yd:e:{for(u=u.value,c=[c,0],g=0;g<c.length;){var S=c[g++],C=S.tag,B=c[g++],q=u[B];if(C!==5&&C!==26&&C!==27||!jr(S)){for(;q!=null&&$c(S,q);)B++,q=u[B];if(B===u.length){u=!0;break e}else for(S=S.child;S!==null;)c.push(S,B),S=S.sibling}}u=!1}return u;case Jd:if((g===5||g===26||g===27)&&qS(c.stateNode,u.value))return!0;break;case fi:if((g===5||g===6||g===26||g===27)&&(c=Of(c),c!==null&&0<=c.indexOf(u.value)))return!0;break;case jn:if((g===5||g===26||g===27)&&(c=c.memoizedProps["data-testname"],typeof c=="string"&&c.toLowerCase()===u.value.toLowerCase()))return!0;break;default:throw Error(i(365))}return!1}function rl(c){switch(c.$$typeof){case Qf:return"<"+(l(c.value)||"Unknown")+">";case Yd:return":has("+(rl(c)||"")+")";case Jd:return'[role="'+c.value+'"]';case fi:return'"'+c.value+'"';case jn:return'[data-testname="'+c.value+'"]';default:throw Error(i(365))}}function H_(c,u){var g=[];c=[c,0];for(var S=0;S<c.length;){var C=c[S++],B=C.tag,q=c[S++],se=u[q];if(B!==5&&B!==26&&B!==27||!jr(C)){for(;se!=null&&$c(C,se);)q++,se=u[q];if(q===u.length)g.push(C);else for(C=C.child;C!==null;)c.push(C,q),C=C.sibling}}return g}function os(c,u){if(!Wr)throw Error(i(363));c=pd(c),c=H_(c,u),u=[],c=Array.from(c);for(var g=0;g<c.length;){var S=c[g++],C=S.tag;if(C===5||C===26||C===27)jr(S)||u.push(S.stateNode);else for(S=S.child;S!==null;)c.push(S),S=S.sibling}return u}function ls(){if((rn&2)!==0&&Un!==0)return Un&-Un;if(hn.T!==null){var c=bs;return c!==0?c:Xe()}return sr()}function Vr(){Cs===0&&(Cs=(Un&536870912)===0||ni?V():536870912);var c=Ks.current;return c!==null&&(c.flags|=32),Cs}function Qa(c,u,g){(c===Fn&&xi===2||c.cancelPendingCommit!==null)&&(Mr(c,0),Sr(c,Un,Cs,!1)),K(c,g),((rn&2)===0||c!==Fn)&&(c===Fn&&((rn&2)===0&&(Br|=g),Zn===4&&Sr(c,Un,Cs,!1)),_t(c))}function Ef(c,u,g){if((rn&6)!==0)throw Error(i(327));var S=!g&&(u&60)===0&&(u&c.expiredLanes)===0||O(c,u),C=S?Yr(c,u):kr(c,u,!0),B=S;do{if(C===0){Ws&&!S&&Sr(c,u,0,!1);break}else if(C===6)Sr(c,u,0,!hi);else{if(g=c.current.alternate,B&&!P_(g)){C=kr(c,u,!1),B=!1;continue}if(C===2){if(B=u,c.errorRecoveryDisabledLanes&B)var q=0;else q=c.pendingLanes&-536870913,q=q!==0?q:q&536870912?536870912:0;if(q!==0){u=q;e:{var se=c;C=gu;var Se=cs&&se.current.memoizedState.isDehydrated;if(Se&&(Mr(se,q).flags|=256),q=kr(se,q,!1),q!==2){if(Uo&&!Se){se.errorRecoveryDisabledLanes|=B,Br|=B,C=4;break e}B=Zs,Zs=C,B!==null&&yo(B)}C=q}if(B=!1,C!==2)continue}}if(C===1){Mr(c,0),Sr(c,u,0,!0);break}e:{switch(S=c,C){case 0:case 1:throw Error(i(345));case 4:if((u&4194176)===u){Sr(S,u,Cs,!hi);break e}break;case 2:Zs=null;break;case 3:case 5:break;default:throw Error(i(329))}if(S.finishedWork=g,S.finishedLanes=u,(u&62914560)===u&&(B=to+300-Va(),10<B)){if(Sr(S,u,Cs,!hi),P(S,0)!==0)break e;S.timeoutHandle=Vm(md.bind(null,S,g,Zs,Dr,vu,u,Cs,Br,Oo,hi,2,-0,0),B);break e}md(S,g,Zs,Dr,vu,u,Cs,Br,Oo,hi,0,-0,0)}}break}while(!0);_t(c)}function yo(c){Zs===null?Zs=c:Zs.push.apply(Zs,c)}function md(c,u,g,S,C,B,q,se,Se,Je,Mt,Gt,kt){var xn=u.subtreeFlags;if((xn&8192||(xn&16785408)===16785408)&&(Gs(),Kl(u),u=bd(),u!==null)){c.cancelPendingCommit=u(Si.bind(null,c,g,S,C,q,se,Se,1,Gt,kt)),Sr(c,B,q,!Je);return}Si(c,g,S,C,q,se,Se,Mt,Gt,kt)}function P_(c){for(var u=c;;){var g=u.tag;if((g===0||g===11||g===15)&&u.flags&16384&&(g=u.updateQueue,g!==null&&(g=g.stores,g!==null)))for(var S=0;S<g.length;S++){var C=g[S],B=C.getSnapshot;C=C.value;try{if(!Vs(B(),C))return!1}catch{return!1}}if(g=u.child,u.subtreeFlags&16384&&g!==null)g.return=u,u=g;else{if(u===c)break;for(;u.sibling===null;){if(u.return===null||u.return===c)return!0;u=u.return}u.sibling.return=u.return,u=u.sibling}}return!0}function Sr(c,u,g,S){u&=~as,u&=~Br,c.suspendedLanes|=u,c.pingedLanes&=~u,S&&(c.warmLanes|=u),S=c.expirationTimes;for(var C=u;0<C;){var B=31-Ss(C),q=1<<B;S[B]=-1,C&=~q}g!==0&&ee(c,g,u)}function Rm(){return(rn&6)===0?(Ft(0),!1):!0}function ys(){if(An!==null){if(xi===0)var c=An.return;else c=An,Ki=Al=null,nt(c),Qr=null,lr=0,c=An;for(;c!==null;)Mm(c.alternate,c),c=c.return;An=null}}function Mr(c,u){c.finishedWork=null,c.finishedLanes=0;var g=c.timeoutHandle;g!==nc&&(c.timeoutHandle=nc,Uf(g)),g=c.cancelPendingCommit,g!==null&&(c.cancelPendingCommit=null,g()),ys(),Fn=c,An=g=$a(c.current,null),Un=u,xi=0,aa=null,hi=!1,Ws=O(c,u),Uo=!1,Oo=Cs=as=Br=js=Zn=0,Zs=gu=null,vu=!1,(u&8)!==0&&(u|=u&32);var S=c.entangledLanes;if(S!==0)for(c=c.entanglements,S&=u;0<S;){var C=31-Ss(S),B=1<<C;u|=c[C],S&=~B}return wr=u,me(),g}function Wl(c,u){Rn=null,hn.H=ii,u===mi?(u=ft(),xi=3):u===vg?(u=ft(),xi=4):xi=u===_y?8:u!==null&&typeof u=="object"&&typeof u.then=="function"?6:1,aa=u,An===null&&(Zn=1,ed(c,ye(u,c.current)))}function Tf(){var c=Ks.current;return c===null?!0:(Un&4194176)===Un?cr===null:(Un&62914560)===Un||(Un&536870912)!==0?c===cr:!1}function eu(){var c=hn.H;return hn.H=ii,c===null?ii:c}function Hs(){var c=hn.A;return hn.A=Xd,c}function xs(){Zn=4,hi||(Un&4194176)!==Un&&Ks.current!==null||(Ws=!0),(js&134217727)===0&&(Br&134217727)===0||Fn===null||Sr(Fn,Un,Cs,!1)}function kr(c,u,g){var S=rn;rn|=2;var C=eu(),B=Hs();(Fn!==c||Un!==u)&&(Dr=null,Mr(c,u)),u=!1;var q=Zn;e:do try{if(xi!==0&&An!==null){var se=An,Se=aa;switch(xi){case 8:ys(),q=6;break e;case 3:case 2:case 6:Ks.current===null&&(u=!0);var Je=xi;if(xi=0,aa=null,ol(c,se,Se,Je),g&&Ws){q=0;break e}break;default:Je=xi,xi=0,aa=null,ol(c,se,Se,Je)}}Xr(),q=Zn;break}catch(Mt){Wl(c,Mt)}while(!0);return u&&c.shellSuspendCounter++,Ki=Al=null,rn=S,hn.H=C,hn.A=B,An===null&&(Fn=null,Un=0,me()),q}function Xr(){for(;An!==null;)wm(An)}function Yr(c,u){var g=rn;rn|=2;var S=eu(),C=Hs();Fn!==c||Un!==u?(Dr=null,Pi=Va()+500,Mr(c,u)):Ws=O(c,u);e:do try{if(xi!==0&&An!==null){u=An;var B=aa;t:switch(xi){case 1:xi=0,aa=null,ol(c,u,B,1);break;case 2:if(St(B)){xi=0,aa=null,gd(u);break}u=function(){xi===2&&Fn===c&&(xi=7),_t(c)},B.then(u,u);break e;case 3:xi=7;break e;case 4:xi=5;break e;case 7:St(B)?(xi=0,aa=null,gd(u)):(xi=0,aa=null,ol(c,u,B,7));break;case 5:var q=null;switch(An.tag){case 26:q=An.memoizedState;case 5:case 27:var se=An,Se=se.type,Je=se.pendingProps;if(q?hg(q):Co(Se,Je)){xi=0,aa=null;var Mt=se.sibling;if(Mt!==null)An=Mt;else{var Gt=se.return;Gt!==null?(An=Gt,Cf(Gt)):An=null}break t}}xi=0,aa=null,ol(c,u,B,5);break;case 6:xi=0,aa=null,ol(c,u,B,6);break;case 8:ys(),Zn=6;break e;default:throw Error(i(462))}}xo();break}catch(kt){Wl(c,kt)}while(!0);return Ki=Al=null,hn.H=S,hn.A=C,rn=g,An!==null?0:(Fn=null,Un=0,me(),Zn)}function xo(){for(;An!==null&&!dy();)wm(An)}function wm(c){var u=D_(c.alternate,c,wr);c.memoizedProps=c.pendingProps,u===null?Cf(c):An=u}function gd(c){var u=c,g=u.alternate;switch(u.tag){case 15:case 0:u=T_(g,u,u.pendingProps,u.type,void 0,Un);break;case 11:u=T_(g,u,u.pendingProps,u.type.render,u.ref,Un);break;case 5:nt(u);default:Mm(g,u),u=An=Mo(u,wr),u=D_(g,u,wr)}c.memoizedProps=c.pendingProps,u===null?Cf(c):An=u}function ol(c,u,g,S){Ki=Al=null,nt(u),Qr=null,lr=0;var C=u.return;try{if(A_(c,C,u,g,Un)){Zn=1,ed(c,ye(g,c.current)),An=null;return}}catch(B){if(C!==null)throw An=C,B;Zn=1,ed(c,ye(g,c.current)),An=null;return}u.flags&32768?(ni||S===1?c=!0:Ws||(Un&536870912)!==0?c=!1:(hi=c=!0,(S===2||S===3||S===6)&&(S=Ks.current,S!==null&&S.tag===13&&(S.flags|=16384))),Ca(u,c)):Cf(u)}function Cf(c){var u=c;do{if((u.flags&32768)!==0){Ca(u,hi);return}c=u.return;var g=N_(u.alternate,u,wr);if(g!==null){An=g;return}if(u=u.sibling,u!==null){An=u;return}An=u=c}while(u!==null);Zn===0&&(Zn=5)}function Ca(c,u){do{var g=U_(c.alternate,c);if(g!==null){g.flags&=32767,An=g;return}if(g=c.return,g!==null&&(g.flags|=32768,g.subtreeFlags=0,g.deletions=null),!u&&(c=c.sibling,c!==null)){An=c;return}An=c=g}while(c!==null);Zn=6,An=null}function Si(c,u,g,S,C,B,q,se,Se,Je){var Mt=hn.T,Gt=xa();try{es(2),hn.T=null,Jn(c,u,g,S,Gt,C,B,q,se,Se,Je)}finally{hn.T=Mt,es(Gt)}}function Jn(c,u,g,S,C,B,q,se){do Ra();while(Io!==null);if((rn&6)!==0)throw Error(i(327));var Se=c.finishedWork;if(S=c.finishedLanes,Se===null)return null;if(c.finishedWork=null,c.finishedLanes=0,Se===c.current)throw Error(i(177));c.callbackNode=null,c.callbackPriority=0,c.cancelPendingCommit=null;var Je=Se.lanes|Se.childLanes;if(Je|=fu,ne(c,S,Je,B,q,se),c===Fn&&(An=Fn=null,Un=0),(Se.subtreeFlags&10256)===0&&(Se.flags&10256)===0||fr||(fr=!0,qd=Je,fc=g,Rf(Id,function(){return Ra(),null})),g=(Se.flags&15990)!==0,(Se.subtreeFlags&15990)!==0||g?(g=hn.T,hn.T=null,B=xa(),es(2),q=rn,rn|=4,Kc(c,Se),tl(Se,c),Gm(c.containerInfo),c.current=Se,cd(c,Se.alternate,Se),py(),rn=q,es(B),hn.T=g):c.current=Se,fr?(fr=!1,Io=c,uc=S):Ao(c,Je),Je=c.pendingLanes,Je===0&&(Qs=null),H(Se.stateNode),_t(c),u!==null)for(C=c.onRecoverableError,Se=0;Se<u.length;Se++)Je=u[Se],C(Je.value,{componentStack:Je.stack});return(uc&3)!==0&&Ra(),Je=c.pendingLanes,(S&4194218)!==0&&(Je&42)!==0?c===hs?hc++:(hc=0,hs=c):hc=0,Ft(0),null}function Ao(c,u){(c.pooledCacheLanes&=u)===0&&(u=c.pooledCache,u!=null&&(c.pooledCache=null,Vc(u)))}function Ra(){if(Io!==null){var c=Io,u=qd;qd=0;var g=he(uc),S=32>g?32:g;g=hn.T;var C=xa();try{if(es(S),hn.T=null,Io===null)var B=!1;else{S=fc,fc=null;var q=Io,se=uc;if(Io=null,uc=0,(rn&6)!==0)throw Error(i(331));var Se=rn;if(rn|=4,bf(q.current),hd(q,q.current,se,S),rn=Se,Ft(0,!1),Ms&&typeof Ms.onPostCommitFiberRoot=="function")try{Ms.onPostCommitFiberRoot(cu,q)}catch{}B=!0}return B}finally{es(C),hn.T=g,Ao(c,u)}}return!1}function vd(c,u,g){u=ye(g,u),u=gf(c.stateNode,u,2),c=qe(c,u,2),c!==null&&(K(c,2),_t(c))}function zn(c,u,g){if(c.tag===3)vd(c,c,g);else for(;u!==null;){if(u.tag===3){vd(u,c,g);break}else if(u.tag===1){var S=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof S.componentDidCatch=="function"&&(Qs===null||!Qs.has(S))){c=ye(g,c),g=zc(2),S=qe(u,g,2),S!==null&&(vf(g,S,u,c),K(S,2),_t(S));break}}u=u.return}}function _d(c,u,g){var S=c.pingCache;if(S===null){S=c.pingCache=new Vn;var C=new Set;S.set(u,C)}else C=S.get(u),C===void 0&&(C=new Set,S.set(u,C));C.has(g)||(Uo=!0,C.add(g),c=G_.bind(null,c,u,g),u.then(c,c))}function G_(c,u,g){var S=c.pingCache;S!==null&&S.delete(u),c.pingedLanes|=c.suspendedLanes&g,c.warmLanes&=~g,Fn===c&&(Un&g)===g&&(Zn===4||Zn===3&&(Un&62914560)===Un&&300>Va()-to?(rn&2)===0&&Mr(c,0):as|=g,Oo===Un&&(Oo=0)),_t(c)}function jl(c,u){u===0&&(u=N()),c=rt(c,u),c!==null&&(K(c,u),_t(c))}function Zl(c){var u=c.memoizedState,g=0;u!==null&&(g=u.retryLane),jl(c,g)}function Bm(c,u){var g=0;switch(c.tag){case 13:var S=c.stateNode,C=c.memoizedState;C!==null&&(g=C.retryLane);break;case 19:S=c.stateNode;break;case 22:S=c.stateNode._retryCache;break;default:throw Error(i(314))}S!==null&&S.delete(u),jl(c,g)}function Rf(c,u){return lu(c,u)}function Dm(c,u,g,S){this.tag=c,this.key=g,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=u,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=S,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function So(c){return c=c.prototype,!(!c||!c.isReactComponent)}function $a(c,u){var g=c.alternate;return g===null?(g=t(c.tag,u,c.key,c.mode),g.elementType=c.elementType,g.type=c.type,g.stateNode=c.stateNode,g.alternate=c,c.alternate=g):(g.pendingProps=u,g.type=c.type,g.flags=0,g.subtreeFlags=0,g.deletions=null),g.flags=c.flags&31457280,g.childLanes=c.childLanes,g.lanes=c.lanes,g.child=c.child,g.memoizedProps=c.memoizedProps,g.memoizedState=c.memoizedState,g.updateQueue=c.updateQueue,u=c.dependencies,g.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},g.sibling=c.sibling,g.index=c.index,g.ref=c.ref,g.refCleanup=c.refCleanup,g}function Mo(c,u){c.flags&=31457282;var g=c.alternate;return g===null?(c.childLanes=0,c.lanes=u,c.child=null,c.subtreeFlags=0,c.memoizedProps=null,c.memoizedState=null,c.updateQueue=null,c.dependencies=null,c.stateNode=null):(c.childLanes=g.childLanes,c.lanes=g.lanes,c.child=g.child,c.subtreeFlags=0,c.deletions=null,c.memoizedProps=g.memoizedProps,c.memoizedState=g.memoizedState,c.updateQueue=g.updateQueue,c.type=g.type,u=g.dependencies,c.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext}),c}function ar(c,u,g,S,C,B){var q=0;if(S=c,typeof c=="function")So(c)&&(q=1);else if(typeof c=="string")q=zs&&za?sg(c,g,Ba.current)?26:ru(c)?27:5:zs?sg(c,g,Ba.current)?26:5:za&&ru(c)?27:5;else e:switch(c){case nu:return bo(g.children,C,B,u);case Im:q=8,C|=24;break;case Fm:return c=t(12,g,u,C|2),c.elementType=Fm,c.lanes=B,c;case xd:return c=t(13,g,u,C),c.elementType=xd,c.lanes=B,c;case ul:return c=t(19,g,u,C),c.elementType=ul,c.lanes=B,c;case Df:return yd(g,C,B,u);default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case k_:case Jr:q=10;break e;case cl:q=9;break e;case iu:q=11;break e;case Bf:q=14;break e;case Er:q=16,S=null;break e}q=29,g=Error(i(130,c===null?"null":typeof c,"")),S=null}return u=t(q,g,u,C),u.elementType=c,u.type=S,u.lanes=B,u}function bo(c,u,g,S){return c=t(7,c,S,u),c.lanes=g,c}function yd(c,u,g,S){c=t(22,c,S,u),c.elementType=Df,c.lanes=g;var C={_visibility:1,_pendingVisibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null,_current:null,detach:function(){var B=C._current;if(B===null)throw Error(i(456));if((C._pendingVisibility&2)===0){var q=rt(B,2);q!==null&&(C._pendingVisibility|=2,Qa(q,B,2))}},attach:function(){var B=C._current;if(B===null)throw Error(i(456));if((C._pendingVisibility&2)!==0){var q=rt(B,2);q!==null&&(C._pendingVisibility&=-3,Qa(q,B,2))}}};return c.stateNode=C,c}function ll(c,u,g){return c=t(6,c,null,u),c.lanes=g,c}function tu(c,u,g){return u=t(4,c.children!==null?c.children:[],c.key,u),u.lanes=g,u.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},u}function Ql(c,u,g,S,C,B,q,se){this.tag=1,this.containerInfo=c,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=nc,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=F(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.finishedLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=F(0),this.hiddenUpdates=F(null),this.identifierPrefix=S,this.onUncaughtError=C,this.onCaughtError=B,this.onRecoverableError=q,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=se,this.incompleteTransitions=new Map}function wa(c,u,g,S,C,B,q,se,Se,Je,Mt,Gt){return c=new Ql(c,u,g,q,se,Se,Je,Gt),u=1,B===!0&&(u|=24),B=t(3,null,null,u),c.current=B,B.stateNode=c,u=ad(),u.refCount++,c.pooledCache=u,u.refCount++,B.memoizedState={element:S,isDehydrated:g,cache:u},Ht(B),c}function wf(c){return c?(c=ac,c):ac}function Lm(c){var u=c._reactInternals;if(u===void 0)throw typeof c.render=="function"?Error(i(188)):(c=Object.keys(c).join(","),Error(i(268,c)));return c=x(u),c=c!==null?b(c):null,c===null?null:au(c.stateNode)}function z_(c,u,g,S,C,B){C=wf(C),S.context===null?S.context=C:S.pendingContext=C,S=ze(u),S.payload={element:g},B=B===void 0?null:B,B!==null&&(S.callback=B),g=qe(c,S,u),g!==null&&(Qa(g,c,u),Tt(g,c,u))}function V_(c,u){if(c=c.memoizedState,c!==null&&c.dehydrated!==null){var g=c.retryLane;c.retryLane=g!==0&&g<u?g:u}}function Nm(c,u){V_(c,u),(c=c.alternate)&&V_(c,u)}var sn={},Um=eh(),Pa=XU(),$l=Object.assign,Om=Symbol.for("react.element"),Eo=Symbol.for("react.transitional.element"),br=Symbol.for("react.portal"),nu=Symbol.for("react.fragment"),Im=Symbol.for("react.strict_mode"),Fm=Symbol.for("react.profiler"),k_=Symbol.for("react.provider"),cl=Symbol.for("react.consumer"),Jr=Symbol.for("react.context"),iu=Symbol.for("react.forward_ref"),xd=Symbol.for("react.suspense"),ul=Symbol.for("react.suspense_list"),Bf=Symbol.for("react.memo"),Er=Symbol.for("react.lazy"),Df=Symbol.for("react.offscreen"),X_=Symbol.for("react.memo_cache_sentinel"),Hm=Symbol.iterator,ec=Symbol.for("react.client.reference"),hn=Um.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ad,Pm,fl=!1,hl=Array.isArray,Sd=e.rendererVersion,Lf=e.rendererPackageName,Nf=e.extraDevToolsConfig,au=e.getPublicInstance,tc=e.getRootHostContext,Y_=e.getChildHostContext,dl=e.prepareForCommit,Gm=e.resetAfterCommit,zm=e.createInstance,qr=e.appendInitialChild,To=e.finalizeInitialChildren,pl=e.shouldSetTextContent,Md=e.createTextInstance,Vm=e.scheduleTimeout,Uf=e.cancelTimeout,nc=e.noTimeout,Kr=e.isPrimaryRenderer;e.warnsIfNotActing;var Ga=e.supportsMutation,Ps=e.supportsPersistence,cs=e.supportsHydration,km=e.getInstanceFromNode;e.beforeActiveInstanceBlur,e.afterActiveInstanceBlur;var Xm=e.preparePortalMount;e.prepareScopeUpdate,e.getInstanceFromScope;var es=e.setCurrentUpdatePriority,xa=e.getCurrentUpdatePriority,sr=e.resolveUpdatePriority;e.resolveEventType,e.resolveEventTimeStamp;var ml=e.shouldAttemptEagerTransition,Ym=e.detachDeletedInstance;e.requestPostPaintCallback;var J_=e.maySuspendCommit,Co=e.preloadInstance,Gs=e.startSuspendingCommit,Xi=e.suspendInstance,bd=e.waitForCommitToBeReady,As=e.NotPendingTransition,gn=e.HostTransitionContext,yi=e.resetFormInstance;e.bindToConsole;var da=e.supportsMicrotasks,Ed=e.scheduleMicrotask,Wr=e.supportsTestSelectors,ic=e.findFiberRoot,Td=e.getBoundingRect,Of=e.getTextContent,jr=e.isHiddenSubtree,qS=e.matchAccessibilityRole,Yi=e.setFocusIfFocusable,Jm=e.setupIntersectionObserver,qm=e.appendChild,q_=e.appendChildToContainer,K_=e.commitTextUpdate,KS=e.commitMount,Km=e.commitUpdate,Wm=e.insertBefore,jm=e.insertInContainerBefore,us=e.removeChild,ea=e.removeChildFromContainer,If=e.resetTextContent,Ff=e.hideInstance,Cd=e.hideTextInstance,Zm=e.unhideInstance,Ro=e.unhideTextInstance,Rd=e.clearContainer,Qm=e.cloneInstance,wd=e.createContainerChildSet,$m=e.appendChildToContainerChildSet,W_=e.finalizeContainerChildren,eg=e.replaceContainerChildren,tg=e.cloneHiddenInstance,ng=e.cloneHiddenTextInstance,Bd=e.isSuspenseInstancePending,Hf=e.isSuspenseInstanceFallback,j_=e.getSuspenseInstanceFallbackErrorDetails,WS=e.registerSuspenseInstanceRetry,Z_=e.canHydrateFormStateMarker,Q_=e.isFormStateMarkerMatching,ig=e.getNextHydratableSibling,Dd=e.getFirstHydratableChild,$_=e.getFirstHydratableChildWithinContainer,ey=e.getFirstHydratableChildWithinSuspenseInstance,ty=e.canHydrateInstance,ny=e.canHydrateTextInstance,iy=e.canHydrateSuspenseInstance,jS=e.hydrateInstance,ay=e.hydrateTextInstance,su=e.hydrateSuspenseInstance,sy=e.getNextHydratableInstanceAfterSuspenseInstance,Ld=e.commitHydratedContainer,Nd=e.commitHydratedSuspenseInstance,ry=e.clearSuspenseBoundary,ag=e.clearSuspenseBoundaryFromContainer,oy=e.shouldDeleteUnhydratedTailInstances;e.diffHydratedPropsForDevWarnings,e.diffHydratedTextForDevWarnings,e.describeHydratableInstanceForDevWarnings;var ly=e.validateHydratableInstance,cy=e.validateHydratableTextInstance,zs=e.supportsResources,sg=e.isHostHoistableType,Ud=e.getHoistableRoot,Od=e.getResource,rg=e.acquireResource,og=e.releaseResource,lg=e.hydrateHoistable,cg=e.mountHoistable,ug=e.unmountHoistable,ZS=e.createHoistableInstance,fg=e.prepareToCommitHoistables,uy=e.mayResourceSuspendCommit,hg=e.preloadResource,dg=e.suspendResource,za=e.supportsSingletons,pg=e.resolveSingletonInstance,QS=e.clearSingleton,$S=e.acquireSingletonInstance,fy=e.releaseSingletonInstance,ru=e.isHostSingletonType,Pf=[],wo=-1,ac={},Ss=Math.clz32?Math.clz32:D,Gf=Math.log,hy=Math.LN2,ou=128,zf=4194304,lu=Pa.unstable_scheduleCallback,Vf=Pa.unstable_cancelCallback,dy=Pa.unstable_shouldYield,py=Pa.unstable_requestPaint,Va=Pa.unstable_now,mg=Pa.unstable_ImmediatePriority,my=Pa.unstable_UserBlockingPriority,Id=Pa.unstable_NormalPriority,Fd=Pa.unstable_IdlePriority,gy=Pa.log,gg=Pa.unstable_setDisableYieldValue,cu=null,Ms=null,Vs=typeof Object.is=="function"?Object.is:$,Hd=new WeakMap,Di=[],Ji=0,kf=null,Xf=0,ks=[],Xs=0,Tr=null,Zr=1,rr="",Ba=T(null),Yf=T(null),Cr=T(null),uu=T(null),ts=null,ka=null,ni=!1,Ys=null,or=!1,Jf=Error(i(519)),Js=[],gl=0,fu=0,hu=null,sc=null,qf=!1,Kf=!1,Rr=!1,vl=0,Wf=null,Pd=0,bs=0,_l=null,Bo=!1,du=!1,jf=Object.prototype.hasOwnProperty,mi=Error(i(460)),vg=Error(i(474)),Gd={then:function(){}},rc=null,Qr=null,lr=0,yl=Nn(!0),_g=Nn(!1),$r=T(null),qs=T(0),Ks=T(null),cr=null,pa=T(0),eo=0,Rn=null,oi=null,ta=null,ur=!1,Li=!1,Do=!1,Zf=0,qi=0,pu=null,vy=0,zd=function(){return{lastEffect:null,events:null,stores:null,memoCache:null}},ii={readContext:Ha,use:ht,useCallback:fn,useContext:fn,useEffect:fn,useImperativeHandle:fn,useLayoutEffect:fn,useInsertionEffect:fn,useMemo:fn,useReducer:fn,useRef:fn,useState:fn,useDebugValue:fn,useDeferredValue:fn,useTransition:fn,useSyncExternalStore:fn,useId:fn};ii.useCacheRefresh=fn,ii.useMemoCache=fn,ii.useHostTransitionStatus=fn,ii.useFormState=fn,ii.useActionState=fn,ii.useOptimistic=fn;var ma={readContext:Ha,use:ht,useCallback:function(c,u){return Ze().memoizedState=[c,u===void 0?null:u],c},useContext:Ha,useEffect:Nt,useImperativeHandle:function(c,u,g){g=g!=null?g.concat([c]):null,ut(4194308,4,En.bind(null,u,c),g)},useLayoutEffect:function(c,u){return ut(4194308,4,c,u)},useInsertionEffect:function(c,u){ut(4,2,c,u)},useMemo:function(c,u){var g=Ze();u=u===void 0?null:u;var S=c();if(Do){Y(!0);try{c()}finally{Y(!1)}}return g.memoizedState=[S,u],S},useReducer:function(c,u,g){var S=Ze();if(g!==void 0){var C=g(u);if(Do){Y(!0);try{g(u)}finally{Y(!1)}}}else C=u;return S.memoizedState=S.baseState=C,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:C},S.queue=c,c=c.dispatch=xr.bind(null,Rn,c),[S.memoizedState,c]},useRef:function(c){var u=Ze();return c={current:c},u.memoizedState=c},useState:function(c){c=At(c);var u=c.queue,g=Qh.bind(null,Rn,u);return u.dispatch=g,[c.memoizedState,g]},useDebugValue:ti,useDeferredValue:function(c,u){var g=Ze();return ha(g,c,u)},useTransition:function(){var c=At(!1);return c=Wa.bind(null,Rn,c.queue,!0,!1),Ze().memoizedState=c,[!1,c]},useSyncExternalStore:function(c,u,g){var S=Rn,C=Ze();if(ni){if(g===void 0)throw Error(i(407));g=g()}else{if(g=u(),Fn===null)throw Error(i(349));(Un&60)!==0||lt(S,u,g)}C.memoizedState=g;var B={value:g,getSnapshot:u};return C.queue=B,Nt(Ct.bind(null,S,B,c),[c]),S.flags|=2048,we(9,ct.bind(null,S,B,g,u),{destroy:void 0},null),g},useId:function(){var c=Ze(),u=Fn.identifierPrefix;if(ni){var g=rr,S=Zr;g=(S&~(1<<32-Ss(S)-1)).toString(32)+g,u=":"+u+"R"+g,g=Zf++,0<g&&(u+="H"+g.toString(32)),u+=":"}else g=vy++,u=":"+u+"r"+g.toString(32)+":";return c.memoizedState=u},useCacheRefresh:function(){return Ze().memoizedState=qo.bind(null,Rn)}};ma.useMemoCache=k,ma.useHostTransitionStatus=ya,ma.useFormState=ei,ma.useActionState=ei,ma.useOptimistic=function(c){var u=Ze();u.memoizedState=u.baseState=c;var g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return u.queue=g,u=$h.bind(null,Rn,!0,g),g.dispatch=u,[c,u]};var ns={readContext:Ha,use:ht,useCallback:Ci,useContext:Ha,useEffect:Vt,useImperativeHandle:Cn,useInsertionEffect:ln,useLayoutEffect:Wn,useMemo:_i,useReducer:fe,useRef:at,useState:function(){return fe(te)},useDebugValue:ti,useDeferredValue:function(c,u){var g=je();return _a(g,oi.memoizedState,c,u)},useTransition:function(){var c=fe(te)[0],u=je().memoizedState;return[typeof c=="boolean"?c:vt(c),u]},useSyncExternalStore:Qe,useId:$i};ns.useCacheRefresh=ir,ns.useMemoCache=k,ns.useHostTransitionStatus=ya,ns.useFormState=Qi,ns.useActionState=Qi,ns.useOptimistic=function(c,u){var g=je();return zt(g,oi,c,u)};var xl={readContext:Ha,use:ht,useCallback:Ci,useContext:Ha,useEffect:Vt,useImperativeHandle:Cn,useInsertionEffect:ln,useLayoutEffect:Wn,useMemo:_i,useReducer:le,useRef:at,useState:function(){return le(te)},useDebugValue:ti,useDeferredValue:function(c,u){var g=je();return oi===null?ha(g,c,u):_a(g,oi.memoizedState,c,u)},useTransition:function(){var c=le(te)[0],u=je().memoizedState;return[typeof c=="boolean"?c:vt(c),u]},useSyncExternalStore:Qe,useId:$i};xl.useCacheRefresh=ir,xl.useMemoCache=k,xl.useHostTransitionStatus=ya,xl.useFormState=ri,xl.useActionState=ri,xl.useOptimistic=function(c,u){var g=je();return oi!==null?zt(g,oi,c,u):(g.baseState=c,[c,g.queue.dispatch])};var Vd={isMounted:function(c){return(c=c._reactInternals)?v(c)===c:!1},enqueueSetState:function(c,u,g){c=c._reactInternals;var S=ls(),C=ze(S);C.payload=u,g!=null&&(C.callback=g),u=qe(c,C,S),u!==null&&(Qa(u,c,S),Tt(u,c,S))},enqueueReplaceState:function(c,u,g){c=c._reactInternals;var S=ls(),C=ze(S);C.tag=1,C.payload=u,g!=null&&(C.callback=g),u=qe(c,C,S),u!==null&&(Qa(u,c,S),Tt(u,c,S))},enqueueForceUpdate:function(c,u){c=c._reactInternals;var g=ls(),S=ze(g);S.tag=2,u!=null&&(S.callback=u),u=qe(c,S,g),u!==null&&(Qa(u,c,g),Tt(u,c,g))}},yg=typeof reportError=="function"?reportError:function(c){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var u=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof c=="object"&&c!==null&&typeof c.message=="string"?String(c.message):String(c),error:c});if(!window.dispatchEvent(u))return}else if(typeof bl=="object"&&typeof bl.emit=="function"){bl.emit("uncaughtException",c);return}console.error(c)},_y=Error(i(461)),na=!1,is={dehydrated:null,treeContext:null,retryLane:0},Es=T(null),Al=null,Ki=null,yy=typeof AbortController<"u"?AbortController:function(){var c=[],u=this.signal={aborted:!1,addEventListener:function(g,S){c.push(S)}};this.abort=function(){u.aborted=!0,c.forEach(function(g){return g()})}},Lo=Pa.unstable_scheduleCallback,oc=Pa.unstable_NormalPriority,ui={$$typeof:Jr,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0},kd=hn.S;hn.S=function(c,u){typeof u=="object"&&u!==null&&typeof u.then=="function"&&Oe(c,u),kd!==null&&kd(c,u)};var No=T(null),Aa=!1,Hi=!1,Sl=!1,mu=typeof WeakSet=="function"?WeakSet:Set,Wi=null,lc=!1,ia=null,Ts=!1,fs=null,cc=8192,Xd={getCacheForType:function(c){var u=Ha(ui),g=u.data.get(c);return g===void 0&&(g=c(),u.data.set(c,g)),g}},Qf=0,Yd=1,Jd=2,jn=3,fi=4;if(typeof Symbol=="function"&&Symbol.for){var wn=Symbol.for;Qf=wn("selector.component"),Yd=wn("selector.has_pseudo_class"),Jd=wn("selector.role"),jn=wn("selector.test_id"),fi=wn("selector.text")}var Vn=typeof WeakMap=="function"?WeakMap:Map,rn=0,Fn=null,An=null,Un=0,xi=0,aa=null,hi=!1,Ws=!1,Uo=!1,wr=0,Zn=0,js=0,Br=0,as=0,Cs=0,Oo=0,gu=null,Zs=null,vu=!1,to=0,Pi=1/0,Dr=null,Qs=null,fr=!1,Io=null,uc=0,qd=0,fc=null,hc=0,hs=null;return sn.attemptContinuousHydration=function(c){if(c.tag===13){var u=rt(c,67108864);u!==null&&Qa(u,c,67108864),Nm(c,67108864)}},sn.attemptHydrationAtCurrentPriority=function(c){if(c.tag===13){var u=ls(),g=rt(c,u);g!==null&&Qa(g,c,u),Nm(c,u)}},sn.attemptSynchronousHydration=function(c){switch(c.tag){case 3:if(c=c.stateNode,c.current.memoizedState.isDehydrated){var u=L(c.pendingLanes);if(u!==0){for(c.pendingLanes|=2,c.entangledLanes|=2;u;){var g=1<<31-Ss(u);c.entanglements[1]|=g,u&=~g}_t(c),(rn&6)===0&&(Pi=Va()+500,Ft(0))}}break;case 13:u=rt(c,2),u!==null&&Qa(u,c,2),Rm(),Nm(c,2)}},sn.batchedUpdates=function(c,u){return c(u)},sn.createComponentSelector=function(c){return{$$typeof:Qf,value:c}},sn.createContainer=function(c,u,g,S,C,B,q,se,Se,Je){return wa(c,u,!1,null,g,S,B,q,se,Se,Je,null)},sn.createHasPseudoClassSelector=function(c){return{$$typeof:Yd,value:c}},sn.createHydrationContainer=function(c,u,g,S,C,B,q,se,Se,Je,Mt,Gt,kt){return c=wa(g,S,!0,c,C,B,se,Se,Je,Mt,Gt,kt),c.context=wf(null),g=c.current,S=ls(),C=ze(S),C.callback=u??null,qe(g,C,S),c.current.lanes=S,K(c,S),_t(c),c},sn.createPortal=function(c,u,g){var S=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:br,key:S==null?null:""+S,children:c,containerInfo:u,implementation:g}},sn.createRoleSelector=function(c){return{$$typeof:Jd,value:c}},sn.createTestNameSelector=function(c){return{$$typeof:jn,value:c}},sn.createTextSelector=function(c){return{$$typeof:fi,value:c}},sn.defaultOnCaughtError=function(c){console.error(c)},sn.defaultOnRecoverableError=function(c){yg(c)},sn.defaultOnUncaughtError=function(c){yg(c)},sn.deferredUpdates=function(c){var u=hn.T,g=xa();try{return es(32),hn.T=null,c()}finally{es(g),hn.T=u}},sn.discreteUpdates=function(c,u,g,S,C){var B=hn.T,q=xa();try{return es(2),hn.T=null,c(u,g,S,C)}finally{es(q),hn.T=B,rn===0&&(Pi=Va()+500)}},sn.findAllNodes=os,sn.findBoundingRects=function(c,u){if(!Wr)throw Error(i(363));u=os(c,u),c=[];for(var g=0;g<u.length;g++)c.push(Td(u[g]));for(u=c.length-1;0<u;u--){g=c[u];for(var S=g.x,C=S+g.width,B=g.y,q=B+g.height,se=u-1;0<=se;se--)if(u!==se){var Se=c[se],Je=Se.x,Mt=Je+Se.width,Gt=Se.y,kt=Gt+Se.height;if(S>=Je&&B>=Gt&&C<=Mt&&q<=kt){c.splice(u,1);break}else if(S!==Je||g.width!==Se.width||kt<B||Gt>q){if(!(B!==Gt||g.height!==Se.height||Mt<S||Je>C)){Je>S&&(Se.width+=Je-S,Se.x=S),Mt<C&&(Se.width=C-Je),c.splice(u,1);break}}else{Gt>B&&(Se.height+=Gt-B,Se.y=B),kt<q&&(Se.height=q-Gt),c.splice(u,1);break}}}return c},sn.findHostInstance=Lm,sn.findHostInstanceWithNoPortals=function(c){return c=x(c),c=c!==null?R(c):null,c===null?null:au(c.stateNode)},sn.findHostInstanceWithWarning=function(c){return Lm(c)},sn.flushPassiveEffects=Ra,sn.flushSyncFromReconciler=function(c){var u=rn;rn|=1;var g=hn.T,S=xa();try{if(es(2),hn.T=null,c)return c()}finally{es(S),hn.T=g,rn=u,(rn&6)===0&&Ft(0)}},sn.flushSyncWork=Rm,sn.focusWithin=function(c,u){if(!Wr)throw Error(i(363));for(c=pd(c),u=H_(c,u),u=Array.from(u),c=0;c<u.length;){var g=u[c++],S=g.tag;if(!jr(g)){if((S===5||S===26||S===27)&&Yi(g.stateNode))return!0;for(g=g.child;g!==null;)u.push(g),g=g.sibling}}return!1},sn.getFindAllNodesFailureDescription=function(c,u){if(!Wr)throw Error(i(363));var g=0,S=[];c=[pd(c),0];for(var C=0;C<c.length;){var B=c[C++],q=B.tag,se=c[C++],Se=u[se];if((q!==5&&q!==26&&q!==27||!jr(B))&&($c(B,Se)&&(S.push(rl(Se)),se++,se>g&&(g=se)),se<u.length))for(B=B.child;B!==null;)c.push(B,se),B=B.sibling}if(g<u.length){for(c=[];g<u.length;g++)c.push(rl(u[g]));return`findAllNodes was able to match part of the selector:
4026
+ `+g.stack}}function v(c){var u=c,g=c;if(c.alternate)for(;u.return;)u=u.return;else{c=u;do u=c,(u.flags&4098)!==0&&(g=u.return),c=u.return;while(c)}return u.tag===3?g:null}function y(c){if(v(c)!==c)throw Error(i(188))}function x(c){var u=c.alternate;if(!u){if(u=v(c),u===null)throw Error(i(188));return u!==c?null:c}for(var g=c,S=u;;){var C=g.return;if(C===null)break;var B=C.alternate;if(B===null){if(S=C.return,S!==null){g=S;continue}break}if(C.child===B.child){for(B=C.child;B;){if(B===g)return y(C),c;if(B===S)return y(C),u;B=B.sibling}throw Error(i(188))}if(g.return!==S.return)g=C,S=B;else{for(var q=!1,se=C.child;se;){if(se===g){q=!0,g=C,S=B;break}if(se===S){q=!0,S=C,g=B;break}se=se.sibling}if(!q){for(se=B.child;se;){if(se===g){q=!0,g=B,S=C;break}if(se===S){q=!0,S=B,g=C;break}se=se.sibling}if(!q)throw Error(i(189))}}if(g.alternate!==S)throw Error(i(190))}if(g.tag!==3)throw Error(i(188));return g.stateNode.current===g?c:u}function b(c){var u=c.tag;if(u===5||u===26||u===27||u===6)return c;for(c=c.child;c!==null;){if(u=b(c),u!==null)return u;c=c.sibling}return null}function R(c){var u=c.tag;if(u===5||u===26||u===27||u===6)return c;for(c=c.child;c!==null;){if(c.tag!==4&&(u=R(c),u!==null))return u;c=c.sibling}return null}function T(c){return{current:c}}function M(c){0>wo||(c.current=Pf[wo],Pf[wo]=null,wo--)}function w(c,u){wo++,Pf[wo]=c.current,c.current=u}function D(c){return c>>>=0,c===0?32:31-(Gf(c)/hy|0)|0}function L(c){var u=c&42;if(u!==0)return u;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:return 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&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return c&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return c}}function P(c,u){var g=c.pendingLanes;if(g===0)return 0;var S=0,C=c.suspendedLanes,B=c.pingedLanes,q=c.warmLanes;c=c.finishedLanes!==0;var se=g&134217727;return se!==0?(g=se&~C,g!==0?S=L(g):(B&=se,B!==0?S=L(B):c||(q=se&~q,q!==0&&(S=L(q))))):(se=g&~C,se!==0?S=L(se):B!==0?S=L(B):c||(q=g&~q,q!==0&&(S=L(q)))),S===0?0:u!==0&&u!==S&&(u&C)===0&&(C=S&-S,q=u&-u,C>=q||C===32&&(q&4194176)!==0)?u:S}function O(c,u){return(c.pendingLanes&~(c.suspendedLanes&~c.pingedLanes)&u)===0}function z(c,u){switch(c){case 1:case 2:case 4:case 8:return u+250;case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return u+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function V(){var c=ou;return ou<<=1,(ou&4194176)===0&&(ou=128),c}function N(){var c=zf;return zf<<=1,(zf&62914560)===0&&(zf=4194304),c}function F(c){for(var u=[],g=0;31>g;g++)u.push(c);return u}function K(c,u){c.pendingLanes|=u,u!==268435456&&(c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0)}function ne(c,u,g,S,C,B){var q=c.pendingLanes;c.pendingLanes=g,c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0,c.expiredLanes&=g,c.entangledLanes&=g,c.errorRecoveryDisabledLanes&=g,c.shellSuspendCounter=0;var se=c.entanglements,Se=c.expirationTimes,Je=c.hiddenUpdates;for(g=q&~g;0<g;){var Mt=31-Ss(g),Gt=1<<Mt;se[Mt]=0,Se[Mt]=-1;var kt=Je[Mt];if(kt!==null)for(Je[Mt]=null,Mt=0;Mt<kt.length;Mt++){var An=kt[Mt];An!==null&&(An.lane&=-536870913)}g&=~Gt}S!==0&&ee(c,S,0),B!==0&&C===0&&c.tag!==0&&(c.suspendedLanes|=B&~(q&~u))}function ee(c,u,g){c.pendingLanes|=u,c.suspendedLanes&=~u;var S=31-Ss(u);c.entangledLanes|=u,c.entanglements[S]=c.entanglements[S]|1073741824|g&4194218}function ie(c,u){var g=c.entangledLanes|=u;for(c=c.entanglements;g;){var S=31-Ss(g),C=1<<S;C&u|c[S]&u&&(c[S]|=u),g&=~C}}function he(c){return c&=-c,2<c?8<c?(c&134217727)!==0?32:268435456:8:2}function H(c){if(Ms&&typeof Ms.onCommitFiberRoot=="function")try{Ms.onCommitFiberRoot(cu,c,void 0,(c.current.flags&128)===128)}catch{}}function Y(c){if(typeof gy=="function"&&gg(c),Ms&&typeof Ms.setStrictMode=="function")try{Ms.setStrictMode(cu,c)}catch{}}function $(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}function ye(c,u){if(typeof c=="object"&&c!==null){var g=Hd.get(c);return g!==void 0?g:(u={value:c,source:u,stack:_(u)},Hd.set(c,u),u)}return{value:c,source:u,stack:_(u)}}function _e(c,u){Di[Ji++]=Xf,Di[Ji++]=kf,kf=c,Xf=u}function W(c,u,g){ks[Xs++]=Zr,ks[Xs++]=rr,ks[Xs++]=Tr,Tr=c;var S=Zr;c=rr;var C=32-Ss(S)-1;S&=~(1<<C),g+=1;var B=32-Ss(u)+C;if(30<B){var q=C-C%5;B=(S&(1<<q)-1).toString(32),S>>=q,C-=q,Zr=1<<32-Ss(u)+C|g<<C|S,rr=B+c}else Zr=1<<B|g<<C|S,rr=c}function ae(c){c.return!==null&&(_e(c,1),W(c,1,0))}function Me(c){for(;c===kf;)kf=Di[--Ji],Di[Ji]=null,Xf=Di[--Ji],Di[Ji]=null;for(;c===Tr;)Tr=ks[--Xs],ks[Xs]=null,rr=ks[--Xs],ks[Xs]=null,Zr=ks[--Xs],ks[Xs]=null}function Ne(c,u){w(Cr,u),w(Yf,c),w(Ba,null),c=tc(u),M(Ba),w(Ba,c)}function it(){M(Ba),M(Yf),M(Cr)}function ve(c){c.memoizedState!==null&&w(uu,c);var u=Ba.current,g=Y_(u,c.type);u!==g&&(w(Yf,c),w(Ba,g))}function Ce(c){Yf.current===c&&(M(Ba),M(Yf)),uu.current===c&&(M(uu),Kr?gn._currentValue=As:gn._currentValue2=As)}function tt(c){var u=Error(i(418,""));throw mt(ye(u,c)),Jf}function Et(c,u){if(!cs)throw Error(i(175));jS(c.stateNode,c.type,c.memoizedProps,u,c)||tt(c)}function wt(c){for(ts=c.return;ts;)switch(ts.tag){case 3:case 27:or=!0;return;case 5:case 13:or=!1;return;default:ts=ts.return}}function on(c){if(!cs||c!==ts)return!1;if(!ni)return wt(c),ni=!0,!1;var u=!1;if(za?c.tag!==3&&c.tag!==27&&(c.tag!==5||oy(c.type)&&!pl(c.type,c.memoizedProps))&&(u=!0):c.tag!==3&&(c.tag!==5||oy(c.type)&&!pl(c.type,c.memoizedProps))&&(u=!0),u&&ka&&tt(c),wt(c),c.tag===13){if(!cs)throw Error(i(316));if(c=c.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(i(317));ka=sy(c)}else ka=ts?ig(c.stateNode):null;return!0}function It(){cs&&(ka=ts=null,ni=!1)}function mt(c){Ys===null?Ys=[c]:Ys.push(c)}function me(){for(var c=gl,u=fu=gl=0;u<c;){var g=Js[u];Js[u++]=null;var S=Js[u];Js[u++]=null;var C=Js[u];Js[u++]=null;var B=Js[u];if(Js[u++]=null,S!==null&&C!==null){var q=S.pending;q===null?C.next=C:(C.next=q.next,q.next=C),S.pending=C}B!==0&&Q(g,C,B)}}function Le(c,u,g,S){Js[gl++]=c,Js[gl++]=u,Js[gl++]=g,Js[gl++]=S,fu|=S,c.lanes|=S,c=c.alternate,c!==null&&(c.lanes|=S)}function Ue(c,u,g,S){return Le(c,u,g,S),Kt(c)}function rt(c,u){return Le(c,null,null,u),Kt(c)}function Q(c,u,g){c.lanes|=g;var S=c.alternate;S!==null&&(S.lanes|=g);for(var C=!1,B=c.return;B!==null;)B.childLanes|=g,S=B.alternate,S!==null&&(S.childLanes|=g),B.tag===22&&(c=B.stateNode,c===null||c._visibility&1||(C=!0)),c=B,B=B.return;C&&u!==null&&c.tag===3&&(B=c.stateNode,C=31-Ss(g),B=B.hiddenUpdates,c=B[C],c===null?B[C]=[u]:c.push(u),u.lane=g|536870912)}function Kt(c){if(50<hc)throw hc=0,hs=null,Error(i(185));for(var u=c.return;u!==null;)c=u,u=c.return;return c.tag===3?c.stateNode:null}function _t(c){c!==sc&&c.next===null&&(sc===null?hu=sc=c:sc=sc.next=c),Kf=!0,qf||(qf=!0,Ie(yt))}function Ft(c,u){if(!Rr&&Kf){Rr=!0;do for(var g=!1,S=hu;S!==null;){if(c!==0){var C=S.pendingLanes;if(C===0)var B=0;else{var q=S.suspendedLanes,se=S.pingedLanes;B=(1<<31-Ss(42|c)+1)-1,B&=C&~(q&~se),B=B&201326677?B&201326677|1:B?B|2:0}B!==0&&(g=!0,ue(S,B))}else B=Un,B=P(S,S===Fn?B:0),(B&3)===0||O(S,B)||(g=!0,ue(S,B));S=S.next}while(g);Rr=!1}}function yt(){Kf=qf=!1;var c=0;vl!==0&&(ml()&&(c=vl),vl=0);for(var u=Va(),g=null,S=hu;S!==null;){var C=S.next,B=j(S,u);B===0?(S.next=null,g===null?hu=C:g.next=C,C===null&&(sc=g)):(g=S,(c!==0||(B&3)!==0)&&(Kf=!0)),S=C}Ft(c)}function j(c,u){for(var g=c.suspendedLanes,S=c.pingedLanes,C=c.expirationTimes,B=c.pendingLanes&-62914561;0<B;){var q=31-Ss(B),se=1<<q,Se=C[q];Se===-1?((se&g)===0||(se&S)!==0)&&(C[q]=z(se,u)):Se<=u&&(c.expiredLanes|=se),B&=~se}if(u=Fn,g=Un,g=P(c,c===u?g:0),S=c.callbackNode,g===0||c===u&&xi===2||c.cancelPendingCommit!==null)return S!==null&&S!==null&&Vf(S),c.callbackNode=null,c.callbackPriority=0;if((g&3)===0||O(c,g)){if(u=g&-g,u===c.callbackPriority)return u;switch(S!==null&&Vf(S),he(g)){case 2:case 8:g=my;break;case 32:g=Id;break;case 268435456:g=Fd;break;default:g=Id}return S=I.bind(null,c),g=lu(g,S),c.callbackPriority=u,c.callbackNode=g,u}return S!==null&&S!==null&&Vf(S),c.callbackPriority=2,c.callbackNode=null,2}function I(c,u){var g=c.callbackNode;if(Ra()&&c.callbackNode!==g)return null;var S=Un;return S=P(c,c===Fn?S:0),S===0?null:(Ef(c,S,u),j(c,Va()),c.callbackNode!=null&&c.callbackNode===g?I.bind(null,c):null)}function ue(c,u){if(Ra())return null;Ef(c,u,!0)}function Ie(c){da?Ed(function(){(rn&6)!==0?lu(mg,c):c()}):lu(mg,c)}function Xe(){return vl===0&&(vl=V()),vl}function Oe(c,u){if(Wf===null){var g=Wf=[];Pd=0,bs=Xe(),_l={status:"pending",value:void 0,then:function(S){g.push(S)}}}return Pd++,u.then(Bt,Bt),u}function Bt(){if(--Pd===0&&Wf!==null){_l!==null&&(_l.status="fulfilled");var c=Wf;Wf=null,bs=0,_l=null;for(var u=0;u<c.length;u++)(0,c[u])()}}function gt(c,u){var g=[],S={status:"pending",value:null,reason:null,then:function(C){g.push(C)}};return c.then(function(){S.status="fulfilled",S.value=u;for(var C=0;C<g.length;C++)(0,g[C])(u)},function(C){for(S.status="rejected",S.reason=C,C=0;C<g.length;C++)(0,g[C])(void 0)}),S}function Ht(c){c.updateQueue={baseState:c.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Xt(c,u){c=c.updateQueue,u.updateQueue===c&&(u.updateQueue={baseState:c.baseState,firstBaseUpdate:c.firstBaseUpdate,lastBaseUpdate:c.lastBaseUpdate,shared:c.shared,callbacks:null})}function ze(c){return{lane:c,tag:0,payload:null,callback:null,next:null}}function qe(c,u,g){var S=c.updateQueue;if(S===null)return null;if(S=S.shared,(rn&2)!==0){var C=S.pending;return C===null?u.next=u:(u.next=C.next,C.next=u),S.pending=u,u=Kt(c),Q(c,null,g),u}return Le(c,S,u,g),Kt(c)}function Tt(c,u,g){if(u=u.updateQueue,u!==null&&(u=u.shared,(g&4194176)!==0)){var S=u.lanes;S&=c.pendingLanes,g|=S,u.lanes=g,ie(c,g)}}function pt(c,u){var g=c.updateQueue,S=c.alternate;if(S!==null&&(S=S.updateQueue,g===S)){var C=null,B=null;if(g=g.firstBaseUpdate,g!==null){do{var q={lane:g.lane,tag:g.tag,payload:g.payload,callback:null,next:null};B===null?C=B=q:B=B.next=q,g=g.next}while(g!==null);B===null?C=B=u:B=B.next=u}else C=B=u;g={baseState:S.baseState,firstBaseUpdate:C,lastBaseUpdate:B,shared:S.shared,callbacks:S.callbacks},c.updateQueue=g;return}c=g.lastBaseUpdate,c===null?g.firstBaseUpdate=u:c.next=u,g.lastBaseUpdate=u}function st(){if(du){var c=_l;if(c!==null)throw c}}function qt(c,u,g,S){du=!1;var C=c.updateQueue;Bo=!1;var B=C.firstBaseUpdate,q=C.lastBaseUpdate,se=C.shared.pending;if(se!==null){C.shared.pending=null;var Se=se,Je=Se.next;Se.next=null,q===null?B=Je:q.next=Je,q=Se;var Mt=c.alternate;Mt!==null&&(Mt=Mt.updateQueue,se=Mt.lastBaseUpdate,se!==q&&(se===null?Mt.firstBaseUpdate=Je:se.next=Je,Mt.lastBaseUpdate=Se))}if(B!==null){var Gt=C.baseState;q=0,Mt=Je=Se=null,se=B;do{var kt=se.lane&-536870913,An=kt!==se.lane;if(An?(Un&kt)===kt:(S&kt)===kt){kt!==0&&kt===bs&&(du=!0),Mt!==null&&(Mt=Mt.next={lane:0,tag:se.tag,payload:se.payload,callback:null,next:null});e:{var Rs=c,$f=se;kt=u;var dc=g;switch($f.tag){case 1:if(Rs=$f.payload,typeof Rs=="function"){Gt=Rs.call(dc,Gt,kt);break e}Gt=Rs;break e;case 3:Rs.flags=Rs.flags&-65537|128;case 0:if(Rs=$f.payload,kt=typeof Rs=="function"?Rs.call(dc,Gt,kt):Rs,kt==null)break e;Gt=$l({},Gt,kt);break e;case 2:Bo=!0}}kt=se.callback,kt!==null&&(c.flags|=64,An&&(c.flags|=8192),An=C.callbacks,An===null?C.callbacks=[kt]:An.push(kt))}else An={lane:kt,tag:se.tag,payload:se.payload,callback:se.callback,next:null},Mt===null?(Je=Mt=An,Se=Gt):Mt=Mt.next=An,q|=kt;if(se=se.next,se===null){if(se=C.shared.pending,se===null)break;An=se,se=An.next,An.next=null,C.lastBaseUpdate=An,C.shared.pending=null}}while(!0);Mt===null&&(Se=Gt),C.baseState=Se,C.firstBaseUpdate=Je,C.lastBaseUpdate=Mt,B===null&&(C.shared.lanes=0),js|=q,c.lanes=q,c.memoizedState=Gt}}function de(c,u){if(typeof c!="function")throw Error(i(191,c));c.call(u)}function be(c,u){var g=c.callbacks;if(g!==null)for(c.callbacks=null,c=0;c<g.length;c++)de(g[c],u)}function We(c,u){if(Vs(c,u))return!0;if(typeof c!="object"||c===null||typeof u!="object"||u===null)return!1;var g=Object.keys(c),S=Object.keys(u);if(g.length!==S.length)return!1;for(S=0;S<g.length;S++){var C=g[S];if(!jf.call(u,C)||!Vs(c[C],u[C]))return!1}return!0}function St(c){return c=c.status,c==="fulfilled"||c==="rejected"}function Ye(){}function Ve(c,u,g){switch(g=c[g],g===void 0?c.push(u):g!==u&&(u.then(Ye,Ye),u=g),u.status){case"fulfilled":return u.value;case"rejected":throw c=u.reason,c===mi?Error(i(483)):c;default:if(typeof u.status=="string")u.then(Ye,Ye);else{if(c=Fn,c!==null&&100<c.shellSuspendCounter)throw Error(i(482));c=u,c.status="pending",c.then(function(S){if(u.status==="pending"){var C=u;C.status="fulfilled",C.value=S}},function(S){if(u.status==="pending"){var C=u;C.status="rejected",C.reason=S}})}switch(u.status){case"fulfilled":return u.value;case"rejected":throw c=u.reason,c===mi?Error(i(483)):c}throw rc=u,mi}}function ft(){if(rc===null)throw Error(i(459));var c=rc;return rc=null,c}function jt(c){var u=lr;return lr+=1,Qr===null&&(Qr=[]),Ve(Qr,c,u)}function Mn(c,u){u=u.props.ref,c.ref=u!==void 0?u:null}function bt(c,u){throw u.$$typeof===Om?Error(i(525)):(c=Object.prototype.toString.call(u),Error(i(31,c==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":c)))}function Dn(c){var u=c._init;return u(c._payload)}function Nn(c){function u(Be,xe){if(c){var Fe=Be.deletions;Fe===null?(Be.deletions=[xe],Be.flags|=16):Fe.push(xe)}}function g(Be,xe){if(!c)return null;for(;xe!==null;)u(Be,xe),xe=xe.sibling;return null}function S(Be){for(var xe=new Map;Be!==null;)Be.key!==null?xe.set(Be.key,Be):xe.set(Be.index,Be),Be=Be.sibling;return xe}function C(Be,xe){return Be=$a(Be,xe),Be.index=0,Be.sibling=null,Be}function B(Be,xe,Fe){return Be.index=Fe,c?(Fe=Be.alternate,Fe!==null?(Fe=Fe.index,Fe<xe?(Be.flags|=33554434,xe):Fe):(Be.flags|=33554434,xe)):(Be.flags|=1048576,xe)}function q(Be){return c&&Be.alternate===null&&(Be.flags|=33554434),Be}function se(Be,xe,Fe,dt){return xe===null||xe.tag!==6?(xe=ll(Fe,Be.mode,dt),xe.return=Be,xe):(xe=C(xe,Fe),xe.return=Be,xe)}function Se(Be,xe,Fe,dt){var nn=Fe.type;return nn===nu?Mt(Be,xe,Fe.props.children,dt,Fe.key):xe!==null&&(xe.elementType===nn||typeof nn=="object"&&nn!==null&&nn.$$typeof===Er&&Dn(nn)===xe.type)?(xe=C(xe,Fe.props),Mn(xe,Fe),xe.return=Be,xe):(xe=ar(Fe.type,Fe.key,Fe.props,null,Be.mode,dt),Mn(xe,Fe),xe.return=Be,xe)}function Je(Be,xe,Fe,dt){return xe===null||xe.tag!==4||xe.stateNode.containerInfo!==Fe.containerInfo||xe.stateNode.implementation!==Fe.implementation?(xe=tu(Fe,Be.mode,dt),xe.return=Be,xe):(xe=C(xe,Fe.children||[]),xe.return=Be,xe)}function Mt(Be,xe,Fe,dt,nn){return xe===null||xe.tag!==7?(xe=bo(Fe,Be.mode,dt,nn),xe.return=Be,xe):(xe=C(xe,Fe),xe.return=Be,xe)}function Gt(Be,xe,Fe){if(typeof xe=="string"&&xe!==""||typeof xe=="number"||typeof xe=="bigint")return xe=ll(""+xe,Be.mode,Fe),xe.return=Be,xe;if(typeof xe=="object"&&xe!==null){switch(xe.$$typeof){case Eo:return Fe=ar(xe.type,xe.key,xe.props,null,Be.mode,Fe),Mn(Fe,xe),Fe.return=Be,Fe;case br:return xe=tu(xe,Be.mode,Fe),xe.return=Be,xe;case Er:var dt=xe._init;return xe=dt(xe._payload),Gt(Be,xe,Fe)}if(hl(xe)||o(xe))return xe=bo(xe,Be.mode,Fe,null),xe.return=Be,xe;if(typeof xe.then=="function")return Gt(Be,jt(xe),Fe);if(xe.$$typeof===Jr)return Gt(Be,xf(Be,xe),Fe);bt(Be,xe)}return null}function kt(Be,xe,Fe,dt){var nn=xe!==null?xe.key:null;if(typeof Fe=="string"&&Fe!==""||typeof Fe=="number"||typeof Fe=="bigint")return nn!==null?null:se(Be,xe,""+Fe,dt);if(typeof Fe=="object"&&Fe!==null){switch(Fe.$$typeof){case Eo:return Fe.key===nn?Se(Be,xe,Fe,dt):null;case br:return Fe.key===nn?Je(Be,xe,Fe,dt):null;case Er:return nn=Fe._init,Fe=nn(Fe._payload),kt(Be,xe,Fe,dt)}if(hl(Fe)||o(Fe))return nn!==null?null:Mt(Be,xe,Fe,dt,null);if(typeof Fe.then=="function")return kt(Be,xe,jt(Fe),dt);if(Fe.$$typeof===Jr)return kt(Be,xe,xf(Be,Fe),dt);bt(Be,Fe)}return null}function An(Be,xe,Fe,dt,nn){if(typeof dt=="string"&&dt!==""||typeof dt=="number"||typeof dt=="bigint")return Be=Be.get(Fe)||null,se(xe,Be,""+dt,nn);if(typeof dt=="object"&&dt!==null){switch(dt.$$typeof){case Eo:return Be=Be.get(dt.key===null?Fe:dt.key)||null,Se(xe,Be,dt,nn);case br:return Be=Be.get(dt.key===null?Fe:dt.key)||null,Je(xe,Be,dt,nn);case Er:var Mi=dt._init;return dt=Mi(dt._payload),An(Be,xe,Fe,dt,nn)}if(hl(dt)||o(dt))return Be=Be.get(Fe)||null,Mt(xe,Be,dt,nn,null);if(typeof dt.then=="function")return An(Be,xe,Fe,jt(dt),nn);if(dt.$$typeof===Jr)return An(Be,xe,Fe,xf(xe,dt),nn);bt(xe,dt)}return null}function Rs(Be,xe,Fe,dt){for(var nn=null,Mi=null,vn=xe,ai=xe=0,Sa=null;vn!==null&&ai<Fe.length;ai++){vn.index>ai?(Sa=vn,vn=null):Sa=vn.sibling;var si=kt(Be,vn,Fe[ai],dt);if(si===null){vn===null&&(vn=Sa);break}c&&vn&&si.alternate===null&&u(Be,vn),xe=B(si,xe,ai),Mi===null?nn=si:Mi.sibling=si,Mi=si,vn=Sa}if(ai===Fe.length)return g(Be,vn),ni&&_e(Be,ai),nn;if(vn===null){for(;ai<Fe.length;ai++)vn=Gt(Be,Fe[ai],dt),vn!==null&&(xe=B(vn,xe,ai),Mi===null?nn=vn:Mi.sibling=vn,Mi=vn);return ni&&_e(Be,ai),nn}for(vn=S(vn);ai<Fe.length;ai++)Sa=An(vn,Be,ai,Fe[ai],dt),Sa!==null&&(c&&Sa.alternate!==null&&vn.delete(Sa.key===null?ai:Sa.key),xe=B(Sa,xe,ai),Mi===null?nn=Sa:Mi.sibling=Sa,Mi=Sa);return c&&vn.forEach(function(Fo){return u(Be,Fo)}),ni&&_e(Be,ai),nn}function $f(Be,xe,Fe,dt){if(Fe==null)throw Error(i(151));for(var nn=null,Mi=null,vn=xe,ai=xe=0,Sa=null,si=Fe.next();vn!==null&&!si.done;ai++,si=Fe.next()){vn.index>ai?(Sa=vn,vn=null):Sa=vn.sibling;var Fo=kt(Be,vn,si.value,dt);if(Fo===null){vn===null&&(vn=Sa);break}c&&vn&&Fo.alternate===null&&u(Be,vn),xe=B(Fo,xe,ai),Mi===null?nn=Fo:Mi.sibling=Fo,Mi=Fo,vn=Sa}if(si.done)return g(Be,vn),ni&&_e(Be,ai),nn;if(vn===null){for(;!si.done;ai++,si=Fe.next())si=Gt(Be,si.value,dt),si!==null&&(xe=B(si,xe,ai),Mi===null?nn=si:Mi.sibling=si,Mi=si);return ni&&_e(Be,ai),nn}for(vn=S(vn);!si.done;ai++,si=Fe.next())si=An(vn,Be,ai,si.value,dt),si!==null&&(c&&si.alternate!==null&&vn.delete(si.key===null?ai:si.key),xe=B(si,xe,ai),Mi===null?nn=si:Mi.sibling=si,Mi=si);return c&&vn.forEach(function(Kd){return u(Be,Kd)}),ni&&_e(Be,ai),nn}function dc(Be,xe,Fe,dt){if(typeof Fe=="object"&&Fe!==null&&Fe.type===nu&&Fe.key===null&&(Fe=Fe.props.children),typeof Fe=="object"&&Fe!==null){switch(Fe.$$typeof){case Eo:e:{for(var nn=Fe.key;xe!==null;){if(xe.key===nn){if(nn=Fe.type,nn===nu){if(xe.tag===7){g(Be,xe.sibling),dt=C(xe,Fe.props.children),dt.return=Be,Be=dt;break e}}else if(xe.elementType===nn||typeof nn=="object"&&nn!==null&&nn.$$typeof===Er&&Dn(nn)===xe.type){g(Be,xe.sibling),dt=C(xe,Fe.props),Mn(dt,Fe),dt.return=Be,Be=dt;break e}g(Be,xe);break}else u(Be,xe);xe=xe.sibling}Fe.type===nu?(dt=bo(Fe.props.children,Be.mode,dt,Fe.key),dt.return=Be,Be=dt):(dt=ar(Fe.type,Fe.key,Fe.props,null,Be.mode,dt),Mn(dt,Fe),dt.return=Be,Be=dt)}return q(Be);case br:e:{for(nn=Fe.key;xe!==null;){if(xe.key===nn)if(xe.tag===4&&xe.stateNode.containerInfo===Fe.containerInfo&&xe.stateNode.implementation===Fe.implementation){g(Be,xe.sibling),dt=C(xe,Fe.children||[]),dt.return=Be,Be=dt;break e}else{g(Be,xe);break}else u(Be,xe);xe=xe.sibling}dt=tu(Fe,Be.mode,dt),dt.return=Be,Be=dt}return q(Be);case Er:return nn=Fe._init,Fe=nn(Fe._payload),dc(Be,xe,Fe,dt)}if(hl(Fe))return Rs(Be,xe,Fe,dt);if(o(Fe)){if(nn=o(Fe),typeof nn!="function")throw Error(i(150));return Fe=nn.call(Fe),$f(Be,xe,Fe,dt)}if(typeof Fe.then=="function")return dc(Be,xe,jt(Fe),dt);if(Fe.$$typeof===Jr)return dc(Be,xe,xf(Be,Fe),dt);bt(Be,Fe)}return typeof Fe=="string"&&Fe!==""||typeof Fe=="number"||typeof Fe=="bigint"?(Fe=""+Fe,xe!==null&&xe.tag===6?(g(Be,xe.sibling),dt=C(xe,Fe),dt.return=Be,Be=dt):(g(Be,xe),dt=ll(Fe,Be.mode,dt),dt.return=Be,Be=dt),q(Be)):g(Be,xe)}return function(Be,xe,Fe,dt){try{lr=0;var nn=dc(Be,xe,Fe,dt);return Qr=null,nn}catch(vn){if(vn===mi)throw vn;var Mi=t(29,vn,null,Be.mode);return Mi.lanes=dt,Mi.return=Be,Mi}}}function Ni(c,u){c=wr,w(qs,c),w($r,u),wr=c|u.baseLanes}function fa(){w(qs,wr),w($r,$r.current)}function Ui(){wr=qs.current,M($r),M(qs)}function Zi(c){var u=c.alternate;w(pa,pa.current&1),w(Ks,c),cr===null&&(u===null||$r.current!==null||u.memoizedState!==null)&&(cr=c)}function Ia(c){if(c.tag===22){if(w(pa,pa.current),w(Ks,c),cr===null){var u=c.alternate;u!==null&&u.memoizedState!==null&&(cr=c)}}else vi()}function vi(){w(pa,pa.current),w(Ks,Ks.current)}function en(c){M(Ks),cr===c&&(cr=null),M(pa)}function ci(c){for(var u=c;u!==null;){if(u.tag===13){var g=u.memoizedState;if(g!==null&&(g=g.dehydrated,g===null||Bd(g)||Hf(g)))return u}else if(u.tag===19&&u.memoizedProps.revealOrder!==void 0){if((u.flags&128)!==0)return u}else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===c)break;for(;u.sibling===null;){if(u.return===null||u.return===c)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}function fn(){throw Error(i(321))}function G(c,u){if(u===null)return!1;for(var g=0;g<u.length&&g<c.length;g++)if(!Vs(c[g],u[g]))return!1;return!0}function J(c,u,g,S,C,B){return eo=B,Rn=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,hn.H=c===null||c.memoizedState===null?ma:ns,Do=!1,B=g(S,C),Do=!1,Li&&(B=Re(u,g,S,C)),oe(c),B}function oe(c){hn.H=ii;var u=oi!==null&&oi.next!==null;if(eo=0,ta=oi=Rn=null,ur=!1,qi=0,pu=null,u)throw Error(i(300));c===null||na||(c=c.dependencies,c!==null&&Zo(c)&&(na=!0))}function Re(c,u,g,S){Rn=c;var C=0;do{if(Li&&(pu=null),qi=0,Li=!1,25<=C)throw Error(i(301));if(C+=1,ta=oi=null,c.updateQueue!=null){var B=c.updateQueue;B.lastEffect=null,B.events=null,B.stores=null,B.memoCache!=null&&(B.memoCache.index=0)}hn.H=xl,B=u(g,S)}while(Li);return B}function Pe(){var c=hn.H,u=c.useState()[0];return u=typeof u.then=="function"?vt(u):u,c=c.useState()[0],(oi!==null?oi.memoizedState:null)!==c&&(Rn.flags|=1024),u}function He(){var c=Zf!==0;return Zf=0,c}function ot(c,u,g){u.updateQueue=c.updateQueue,u.flags&=-2053,c.lanes&=~g}function nt(c){if(ur){for(c=c.memoizedState;c!==null;){var u=c.queue;u!==null&&(u.pending=null),c=c.next}ur=!1}eo=0,ta=oi=Rn=null,Li=!1,qi=Zf=0,pu=null}function Ze(){var c={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ta===null?Rn.memoizedState=ta=c:ta=ta.next=c,ta}function je(){if(oi===null){var c=Rn.alternate;c=c!==null?c.memoizedState:null}else c=oi.next;var u=ta===null?Rn.memoizedState:ta.next;if(u!==null)ta=u,oi=c;else{if(c===null)throw Rn.alternate===null?Error(i(467)):Error(i(310));oi=c,c={memoizedState:oi.memoizedState,baseState:oi.baseState,baseQueue:oi.baseQueue,queue:oi.queue,next:null},ta===null?Rn.memoizedState=ta=c:ta=ta.next=c}return ta}function vt(c){var u=qi;return qi+=1,pu===null&&(pu=[]),c=Ve(pu,c,u),u=Rn,(ta===null?u.memoizedState:ta.next)===null&&(u=u.alternate,hn.H=u===null||u.memoizedState===null?ma:ns),c}function ht(c){if(c!==null&&typeof c=="object"){if(typeof c.then=="function")return vt(c);if(c.$$typeof===Jr)return Ha(c)}throw Error(i(438,String(c)))}function k(c){var u=null,g=Rn.updateQueue;if(g!==null&&(u=g.memoCache),u==null){var S=Rn.alternate;S!==null&&(S=S.updateQueue,S!==null&&(S=S.memoCache,S!=null&&(u={data:S.data.map(function(C){return C.slice()}),index:0})))}if(u==null&&(u={data:[],index:0}),g===null&&(g=zd(),Rn.updateQueue=g),g.memoCache=u,g=u.data[u.index],g===void 0)for(g=u.data[u.index]=Array(c),S=0;S<c;S++)g[S]=X_;return u.index++,g}function te(c,u){return typeof u=="function"?u(c):u}function fe(c){var u=je();return ce(u,oi,c)}function ce(c,u,g){var S=c.queue;if(S===null)throw Error(i(311));S.lastRenderedReducer=g;var C=c.baseQueue,B=S.pending;if(B!==null){if(C!==null){var q=C.next;C.next=B.next,B.next=q}u.baseQueue=C=B,S.pending=null}if(B=c.baseState,C===null)c.memoizedState=B;else{u=C.next;var se=q=null,Se=null,Je=u,Mt=!1;do{var Gt=Je.lane&-536870913;if(Gt!==Je.lane?(Un&Gt)===Gt:(eo&Gt)===Gt){var kt=Je.revertLane;if(kt===0)Se!==null&&(Se=Se.next={lane:0,revertLane:0,action:Je.action,hasEagerState:Je.hasEagerState,eagerState:Je.eagerState,next:null}),Gt===bs&&(Mt=!0);else if((eo&kt)===kt){Je=Je.next,kt===bs&&(Mt=!0);continue}else Gt={lane:0,revertLane:Je.revertLane,action:Je.action,hasEagerState:Je.hasEagerState,eagerState:Je.eagerState,next:null},Se===null?(se=Se=Gt,q=B):Se=Se.next=Gt,Rn.lanes|=kt,js|=kt;Gt=Je.action,Do&&g(B,Gt),B=Je.hasEagerState?Je.eagerState:g(B,Gt)}else kt={lane:Gt,revertLane:Je.revertLane,action:Je.action,hasEagerState:Je.hasEagerState,eagerState:Je.eagerState,next:null},Se===null?(se=Se=kt,q=B):Se=Se.next=kt,Rn.lanes|=Gt,js|=Gt;Je=Je.next}while(Je!==null&&Je!==u);if(Se===null?q=B:Se.next=se,!Vs(B,c.memoizedState)&&(na=!0,Mt&&(g=_l,g!==null)))throw g;c.memoizedState=B,c.baseState=q,c.baseQueue=Se,S.lastRenderedState=B}return C===null&&(S.lanes=0),[c.memoizedState,S.dispatch]}function le(c){var u=je(),g=u.queue;if(g===null)throw Error(i(311));g.lastRenderedReducer=c;var S=g.dispatch,C=g.pending,B=u.memoizedState;if(C!==null){g.pending=null;var q=C=C.next;do B=c(B,q.action),q=q.next;while(q!==C);Vs(B,u.memoizedState)||(na=!0),u.memoizedState=B,u.baseQueue===null&&(u.baseState=B),g.lastRenderedState=B}return[B,S]}function Qe(c,u,g){var S=Rn,C=je(),B=ni;if(B){if(g===void 0)throw Error(i(407));g=g()}else g=u();var q=!Vs((oi||C).memoizedState,g);if(q&&(C.memoizedState=g,na=!0),C=C.queue,Vt(Ct.bind(null,S,C,c),[c]),C.getSnapshot!==u||q||ta!==null&&ta.memoizedState.tag&1){if(S.flags|=2048,we(9,ct.bind(null,S,C,g,u),{destroy:void 0},null),Fn===null)throw Error(i(349));B||(eo&60)!==0||lt(S,u,g)}return g}function lt(c,u,g){c.flags|=16384,c={getSnapshot:u,value:g},u=Rn.updateQueue,u===null?(u=zd(),Rn.updateQueue=u,u.stores=[c]):(g=u.stores,g===null?u.stores=[c]:g.push(c))}function ct(c,u,g,S){u.value=g,u.getSnapshot=S,xt(u)&&Yt(c)}function Ct(c,u,g){return g(function(){xt(u)&&Yt(c)})}function xt(c){var u=c.getSnapshot;c=c.value;try{var g=u();return!Vs(c,g)}catch{return!0}}function Yt(c){var u=rt(c,2);u!==null&&Qa(u,c,2)}function At(c){var u=Ze();if(typeof c=="function"){var g=c;if(c=g(),Do){Y(!0);try{g()}finally{Y(!1)}}}return u.memoizedState=u.baseState=c,u.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:te,lastRenderedState:c},u}function zt(c,u,g,S){return c.baseState=g,ce(c,oi,typeof S=="function"?S:te)}function mn(c,u,g,S,C){if(kl(c))throw Error(i(485));if(c=u.action,c!==null){var B={payload:C,action:c,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(q){B.listeners.push(q)}};hn.T!==null?g(!0):B.isTransition=!1,S(B),g=u.pending,g===null?(B.next=u.pending=B,Pn(u,B)):(B.next=g.next,u.pending=g.next=B)}}function Pn(c,u){var g=u.action,S=u.payload,C=c.state;if(u.isTransition){var B=hn.T,q={};hn.T=q;try{var se=g(C,S),Se=hn.S;Se!==null&&Se(q,se),xn(c,u,se)}catch(Je){Dt(c,u,Je)}finally{hn.T=B}}else try{B=g(C,S),xn(c,u,B)}catch(Je){Dt(c,u,Je)}}function xn(c,u,g){g!==null&&typeof g=="object"&&typeof g.then=="function"?g.then(function(S){Qt(c,u,S)},function(S){return Dt(c,u,S)}):Qt(c,u,g)}function Qt(c,u,g){u.status="fulfilled",u.value=g,$t(u),c.state=g,u=c.pending,u!==null&&(g=u.next,g===u?c.pending=null:(g=g.next,u.next=g,Pn(c,g)))}function Dt(c,u,g){var S=c.pending;if(c.pending=null,S!==null){S=S.next;do u.status="rejected",u.reason=g,$t(u),u=u.next;while(u!==S)}c.action=null}function $t(c){c=c.listeners;for(var u=0;u<c.length;u++)(0,c[u])()}function Lt(c,u){return u}function ei(c,u){if(ni){var g=Fn.formState;if(g!==null){e:{var S=Rn;if(ni){if(ka){var C=Z_(ka,or);if(C){ka=ig(C),S=Q_(C);break e}}tt(S)}S=!1}S&&(u=g[0])}}g=Ze(),g.memoizedState=g.baseState=u,S={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Lt,lastRenderedState:u},g.queue=S,g=Qh.bind(null,Rn,S),S.dispatch=g,S=At(!1);var B=$h.bind(null,Rn,!1,S.queue);return S=Ze(),C={state:u,dispatch:null,action:c,pending:null},S.queue=C,g=mn.bind(null,Rn,C,B,g),C.dispatch=g,S.memoizedState=c,[u,g,!1]}function Qi(c){var u=je();return Gn(u,oi,c)}function Gn(c,u,g){u=ce(c,u,Lt)[0],c=fe(te)[0],u=typeof u=="object"&&u!==null&&typeof u.then=="function"?vt(u):u;var S=je(),C=S.queue,B=C.dispatch;return g!==S.memoizedState&&(Rn.flags|=2048,we(9,Fi.bind(null,C,g),{destroy:void 0},null)),[u,B,c]}function Fi(c,u){c.action=u}function ri(c){var u=je(),g=oi;if(g!==null)return Gn(u,g,c);je(),u=u.memoizedState,g=je();var S=g.queue.dispatch;return g.memoizedState=c,[u,S,!1]}function we(c,u,g,S){return c={tag:c,create:u,inst:g,deps:S,next:null},u=Rn.updateQueue,u===null&&(u=zd(),Rn.updateQueue=u),g=u.lastEffect,g===null?u.lastEffect=c.next=c:(S=g.next,g.next=c,c.next=S,u.lastEffect=c),c}function at(){return je().memoizedState}function ut(c,u,g,S){var C=Ze();Rn.flags|=c,C.memoizedState=we(1|u,g,{destroy:void 0},S===void 0?null:S)}function Ut(c,u,g,S){var C=je();S=S===void 0?null:S;var B=C.memoizedState.inst;oi!==null&&S!==null&&G(S,oi.memoizedState.deps)?C.memoizedState=we(u,g,B,S):(Rn.flags|=c,C.memoizedState=we(1|u,g,B,S))}function Nt(c,u){ut(8390656,8,c,u)}function Vt(c,u){Ut(2048,8,c,u)}function ln(c,u){return Ut(4,2,c,u)}function Wn(c,u){return Ut(4,4,c,u)}function En(c,u){if(typeof u=="function"){c=c();var g=u(c);return function(){typeof g=="function"?g():u(null)}}if(u!=null)return c=c(),u.current=c,function(){u.current=null}}function Cn(c,u,g){g=g!=null?g.concat([c]):null,Ut(4,4,En.bind(null,u,c),g)}function ti(){}function Ci(c,u){var g=je();u=u===void 0?null:u;var S=g.memoizedState;return u!==null&&G(u,S[1])?S[0]:(g.memoizedState=[c,u],c)}function _i(c,u){var g=je();u=u===void 0?null:u;var S=g.memoizedState;if(u!==null&&G(u,S[1]))return S[0];if(S=c(),Do){Y(!0);try{c()}finally{Y(!1)}}return g.memoizedState=[S,u],S}function ha(c,u,g){return g===void 0||(eo&1073741824)!==0?c.memoizedState=u:(c.memoizedState=g,c=Vr(),Rn.lanes|=c,js|=c,g)}function _a(c,u,g,S){return Vs(g,u)?g:$r.current!==null?(c=ha(c,g,S),Vs(c,u)||(na=!0),c):(eo&42)===0?(na=!0,c.memoizedState=g):(c=Vr(),Rn.lanes|=c,js|=c,u)}function Wa(c,u,g,S,C){var B=xa();es(B!==0&&8>B?B:8);var q=hn.T,se={};hn.T=se,$h(c,!1,u,g);try{var Se=C(),Je=hn.S;if(Je!==null&&Je(se,Se),Se!==null&&typeof Se=="object"&&typeof Se.then=="function"){var Mt=gt(Se,S);Ko(c,u,Mt,ls(c))}else Ko(c,u,S,ls(c))}catch(Gt){Ko(c,u,{then:function(){},status:"rejected",reason:Gt},ls())}finally{es(B),hn.T=q}}function Ri(c){var u=c.memoizedState;if(u!==null)return u;u={memoizedState:As,baseState:As,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:te,lastRenderedState:As},next:null};var g={};return u.next={memoizedState:g,baseState:g,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:te,lastRenderedState:g},next:null},c.memoizedState=u,c=c.alternate,c!==null&&(c.memoizedState=u),u}function ya(){return Ha(gn)}function $i(){return je().memoizedState}function ir(){return je().memoizedState}function qo(c){for(var u=c.return;u!==null;){switch(u.tag){case 24:case 3:var g=ls();c=ze(g);var S=qe(u,c,g);S!==null&&(Qa(S,u,g),Tt(S,u,g)),u={cache:ad()},c.payload=u;return}u=u.return}}function xr(c,u,g){var S=ls();g={lane:S,revertLane:0,action:g,hasEagerState:!1,eagerState:null,next:null},kl(c)?pf(u,g):(g=Ue(c,u,g,S),g!==null&&(Qa(g,c,S),cm(g,u,S)))}function Qh(c,u,g){var S=ls();Ko(c,u,g,S)}function Ko(c,u,g,S){var C={lane:S,revertLane:0,action:g,hasEagerState:!1,eagerState:null,next:null};if(kl(c))pf(u,C);else{var B=c.alternate;if(c.lanes===0&&(B===null||B.lanes===0)&&(B=u.lastRenderedReducer,B!==null))try{var q=u.lastRenderedState,se=B(q,g);if(C.hasEagerState=!0,C.eagerState=se,Vs(se,q))return Le(c,u,C,0),Fn===null&&me(),!1}catch{}if(g=Ue(c,u,C,S),g!==null)return Qa(g,c,S),cm(g,u,S),!0}return!1}function $h(c,u,g,S){if(S={lane:2,revertLane:Xe(),action:S,hasEagerState:!1,eagerState:null,next:null},kl(c)){if(u)throw Error(i(479))}else u=Ue(c,g,S,2),u!==null&&Qa(u,c,2)}function kl(c){var u=c.alternate;return c===Rn||u!==null&&u===Rn}function pf(c,u){Li=ur=!0;var g=c.pending;g===null?u.next=u:(u.next=g.next,g.next=u),c.pending=u}function cm(c,u,g){if((g&4194176)!==0){var S=u.lanes;S&=c.pendingLanes,g|=S,u.lanes=g,ie(c,g)}}function ja(c,u,g,S){u=c.memoizedState,g=g(S,u),g=g==null?u:$l({},u,g),c.memoizedState=g,c.lanes===0&&(c.updateQueue.baseState=g)}function Wo(c,u,g,S,C,B,q){return c=c.stateNode,typeof c.shouldComponentUpdate=="function"?c.shouldComponentUpdate(S,B,q):u.prototype&&u.prototype.isPureReactComponent?!We(g,S)||!We(C,B):!0}function mf(c,u,g,S){c=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(g,S),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(g,S),u.state!==c&&Vd.enqueueReplaceState(u,u.state,null)}function Ar(c,u){var g=u;if("ref"in u){g={};for(var S in u)S!=="ref"&&(g[S]=u[S])}if(c=c.defaultProps){g===u&&(g=$l({},g));for(var C in c)g[C]===void 0&&(g[C]=c[C])}return g}function ed(c,u){try{var g=c.onUncaughtError;g(u.value,{componentStack:u.stack})}catch(S){setTimeout(function(){throw S})}}function td(c,u,g){try{var S=c.onCaughtError;S(g.value,{componentStack:g.stack,errorBoundary:u.tag===1?u.stateNode:null})}catch(C){setTimeout(function(){throw C})}}function gf(c,u,g){return g=ze(g),g.tag=3,g.payload={element:null},g.callback=function(){ed(c,u)},g}function zc(c){return c=ze(c),c.tag=3,c}function vf(c,u,g,S){var C=g.type.getDerivedStateFromError;if(typeof C=="function"){var B=S.value;c.payload=function(){return C(B)},c.callback=function(){td(u,g,S)}}var q=g.stateNode;q!==null&&typeof q.componentDidCatch=="function"&&(c.callback=function(){td(u,g,S),typeof C!="function"&&(Qs===null?Qs=new Set([this]):Qs.add(this));var se=S.stack;this.componentDidCatch(S.value,{componentStack:se!==null?se:""})})}function A_(c,u,g,S,C){if(g.flags|=32768,S!==null&&typeof S=="object"&&typeof S.then=="function"){if(u=g.alternate,u!==null&&Xl(u,g,C,!0),g=Ks.current,g!==null){switch(g.tag){case 13:return cr===null?xs():g.alternate===null&&Zn===0&&(Zn=3),g.flags&=-257,g.flags|=65536,g.lanes=C,S===Gd?g.flags|=16384:(u=g.updateQueue,u===null?g.updateQueue=new Set([S]):u.add(S),_d(c,S,C)),!1;case 22:return g.flags|=65536,S===Gd?g.flags|=16384:(u=g.updateQueue,u===null?(u={transitions:null,markerInstances:null,retryQueue:new Set([S])},g.updateQueue=u):(g=u.retryQueue,g===null?u.retryQueue=new Set([S]):g.add(S)),_d(c,S,C)),!1}throw Error(i(435,g.tag))}return _d(c,S,C),xs(),!1}if(ni)return u=Ks.current,u!==null?((u.flags&65536)===0&&(u.flags|=256),u.flags|=65536,u.lanes=C,S!==Jf&&(c=Error(i(422),{cause:S}),mt(ye(c,g)))):(S!==Jf&&(u=Error(i(423),{cause:S}),mt(ye(u,g))),c=c.current.alternate,c.flags|=65536,C&=-C,c.lanes|=C,S=ye(S,g),C=gf(c.stateNode,S,C),pt(c,C),Zn!==4&&(Zn=2)),!1;var B=Error(i(520),{cause:S});if(B=ye(B,g),gu===null?gu=[B]:gu.push(B),Zn!==4&&(Zn=2),u===null)return!0;S=ye(S,g),g=u;do{switch(g.tag){case 3:return g.flags|=65536,c=C&-C,g.lanes|=c,c=gf(g.stateNode,S,c),pt(g,c),!1;case 1:if(u=g.type,B=g.stateNode,(g.flags&128)===0&&(typeof u.getDerivedStateFromError=="function"||B!==null&&typeof B.componentDidCatch=="function"&&(Qs===null||!Qs.has(B))))return g.flags|=65536,C&=-C,g.lanes|=C,C=zc(C),vf(C,c,g,S),pt(g,C),!1}g=g.return}while(g!==null);return!1}function Fa(c,u,g,S){u.child=c===null?_g(u,null,g,S):yl(u,c.child,g,S)}function S_(c,u,g,S,C){g=g.render;var B=u.ref;if("ref"in S){var q={};for(var se in S)se!=="ref"&&(q[se]=S[se])}else q=S;return Yl(u),S=J(c,u,g,q,B,C),se=He(),c!==null&&!na?(ot(c,u,C),go(c,u,C)):(ni&&se&&ae(u),u.flags|=1,Fa(c,u,S,C),u.child)}function M_(c,u,g,S,C){if(c===null){var B=g.type;return typeof B=="function"&&!So(B)&&B.defaultProps===void 0&&g.compare===null?(u.tag=15,u.type=B,nd(c,u,B,S,C)):(c=ar(g.type,null,S,u,u.mode,C),c.ref=u.ref,c.return=u,u.child=c)}if(B=c.child,!gm(c,C)){var q=B.memoizedProps;if(g=g.compare,g=g!==null?g:We,g(q,S)&&c.ref===u.ref)return go(c,u,C)}return u.flags|=1,c=$a(B,S),c.ref=u.ref,c.return=u,u.child=c}function nd(c,u,g,S,C){if(c!==null){var B=c.memoizedProps;if(We(B,S)&&c.ref===u.ref)if(na=!1,u.pendingProps=S=B,gm(c,C))(c.flags&131072)!==0&&(na=!0);else return u.lanes=c.lanes,go(c,u,C)}return um(c,u,g,S,C)}function b_(c,u,g){var S=u.pendingProps,C=S.children,B=(u.stateNode._pendingVisibility&2)!==0,q=c!==null?c.memoizedState:null;if(_f(c,u),S.mode==="hidden"||B){if((u.flags&128)!==0){if(S=q!==null?q.baseLanes|g:g,c!==null){for(C=u.child=c.child,B=0;C!==null;)B=B|C.lanes|C.childLanes,C=C.sibling;u.childLanes=B&~S}else u.childLanes=0,u.child=null;return E_(c,u,S,g)}if((g&536870912)!==0)u.memoizedState={baseLanes:0,cachePool:null},c!==null&&sd(u,q!==null?q.cachePool:null),q!==null?Ni(u,q):fa(),Ia(u);else return u.lanes=u.childLanes=536870912,E_(c,u,q!==null?q.baseLanes|g:g,g)}else q!==null?(sd(u,q.cachePool),Ni(u,q),vi(),u.memoizedState=null):(c!==null&&sd(u,null),fa(),vi());return Fa(c,u,C,g),u.child}function E_(c,u,g,S){var C=Qo();return C=C===null?null:{parent:Kr?ui._currentValue:ui._currentValue2,pool:C},u.memoizedState={baseLanes:g,cachePool:C},c!==null&&sd(u,null),fa(),Ia(u),c!==null&&Xl(c,u,S,!0),null}function _f(c,u){var g=u.ref;if(g===null)c!==null&&c.ref!==null&&(u.flags|=2097664);else{if(typeof g!="function"&&typeof g!="object")throw Error(i(284));(c===null||c.ref!==g)&&(u.flags|=2097664)}}function um(c,u,g,S,C){return Yl(u),g=J(c,u,g,S,void 0,C),S=He(),c!==null&&!na?(ot(c,u,C),go(c,u,C)):(ni&&S&&ae(u),u.flags|=1,Fa(c,u,g,C),u.child)}function T_(c,u,g,S,C,B){return Yl(u),u.updateQueue=null,g=Re(u,S,g,C),oe(c),S=He(),c!==null&&!na?(ot(c,u,B),go(c,u,B)):(ni&&S&&ae(u),u.flags|=1,Fa(c,u,g,B),u.child)}function fm(c,u,g,S,C){if(Yl(u),u.stateNode===null){var B=ac,q=g.contextType;typeof q=="object"&&q!==null&&(B=Ha(q)),B=new g(S,B),u.memoizedState=B.state!==null&&B.state!==void 0?B.state:null,B.updater=Vd,u.stateNode=B,B._reactInternals=u,B=u.stateNode,B.props=S,B.state=u.memoizedState,B.refs={},Ht(u),q=g.contextType,B.context=typeof q=="object"&&q!==null?Ha(q):ac,B.state=u.memoizedState,q=g.getDerivedStateFromProps,typeof q=="function"&&(ja(u,g,q,S),B.state=u.memoizedState),typeof g.getDerivedStateFromProps=="function"||typeof B.getSnapshotBeforeUpdate=="function"||typeof B.UNSAFE_componentWillMount!="function"&&typeof B.componentWillMount!="function"||(q=B.state,typeof B.componentWillMount=="function"&&B.componentWillMount(),typeof B.UNSAFE_componentWillMount=="function"&&B.UNSAFE_componentWillMount(),q!==B.state&&Vd.enqueueReplaceState(B,B.state,null),qt(u,S,B,C),st(),B.state=u.memoizedState),typeof B.componentDidMount=="function"&&(u.flags|=4194308),S=!0}else if(c===null){B=u.stateNode;var se=u.memoizedProps,Se=Ar(g,se);B.props=Se;var Je=B.context,Mt=g.contextType;q=ac,typeof Mt=="object"&&Mt!==null&&(q=Ha(Mt));var Gt=g.getDerivedStateFromProps;Mt=typeof Gt=="function"||typeof B.getSnapshotBeforeUpdate=="function",se=u.pendingProps!==se,Mt||typeof B.UNSAFE_componentWillReceiveProps!="function"&&typeof B.componentWillReceiveProps!="function"||(se||Je!==q)&&mf(u,B,S,q),Bo=!1;var kt=u.memoizedState;B.state=kt,qt(u,S,B,C),st(),Je=u.memoizedState,se||kt!==Je||Bo?(typeof Gt=="function"&&(ja(u,g,Gt,S),Je=u.memoizedState),(Se=Bo||Wo(u,g,Se,S,kt,Je,q))?(Mt||typeof B.UNSAFE_componentWillMount!="function"&&typeof B.componentWillMount!="function"||(typeof B.componentWillMount=="function"&&B.componentWillMount(),typeof B.UNSAFE_componentWillMount=="function"&&B.UNSAFE_componentWillMount()),typeof B.componentDidMount=="function"&&(u.flags|=4194308)):(typeof B.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=S,u.memoizedState=Je),B.props=S,B.state=Je,B.context=q,S=Se):(typeof B.componentDidMount=="function"&&(u.flags|=4194308),S=!1)}else{B=u.stateNode,Xt(c,u),q=u.memoizedProps,Mt=Ar(g,q),B.props=Mt,Gt=u.pendingProps,kt=B.context,Je=g.contextType,Se=ac,typeof Je=="object"&&Je!==null&&(Se=Ha(Je)),se=g.getDerivedStateFromProps,(Je=typeof se=="function"||typeof B.getSnapshotBeforeUpdate=="function")||typeof B.UNSAFE_componentWillReceiveProps!="function"&&typeof B.componentWillReceiveProps!="function"||(q!==Gt||kt!==Se)&&mf(u,B,S,Se),Bo=!1,kt=u.memoizedState,B.state=kt,qt(u,S,B,C),st();var An=u.memoizedState;q!==Gt||kt!==An||Bo||c!==null&&c.dependencies!==null&&Zo(c.dependencies)?(typeof se=="function"&&(ja(u,g,se,S),An=u.memoizedState),(Mt=Bo||Wo(u,g,Mt,S,kt,An,Se)||c!==null&&c.dependencies!==null&&Zo(c.dependencies))?(Je||typeof B.UNSAFE_componentWillUpdate!="function"&&typeof B.componentWillUpdate!="function"||(typeof B.componentWillUpdate=="function"&&B.componentWillUpdate(S,An,Se),typeof B.UNSAFE_componentWillUpdate=="function"&&B.UNSAFE_componentWillUpdate(S,An,Se)),typeof B.componentDidUpdate=="function"&&(u.flags|=4),typeof B.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof B.componentDidUpdate!="function"||q===c.memoizedProps&&kt===c.memoizedState||(u.flags|=4),typeof B.getSnapshotBeforeUpdate!="function"||q===c.memoizedProps&&kt===c.memoizedState||(u.flags|=1024),u.memoizedProps=S,u.memoizedState=An),B.props=S,B.state=An,B.context=Se,S=Mt):(typeof B.componentDidUpdate!="function"||q===c.memoizedProps&&kt===c.memoizedState||(u.flags|=4),typeof B.getSnapshotBeforeUpdate!="function"||q===c.memoizedProps&&kt===c.memoizedState||(u.flags|=1024),S=!1)}return B=S,_f(c,u),S=(u.flags&128)!==0,B||S?(B=u.stateNode,g=S&&typeof g.getDerivedStateFromError!="function"?null:B.render(),u.flags|=1,c!==null&&S?(u.child=yl(u,c.child,null,C),u.child=yl(u,null,g,C)):Fa(c,u,g,C),u.memoizedState=B.state,c=u.child):c=go(c,u,C),c}function C_(c,u,g,S){return It(),u.flags|=256,Fa(c,u,g,S),u.child}function hm(c){return{baseLanes:c,cachePool:L_()}}function dm(c,u,g){return c=c!==null?c.childLanes&~g:0,u&&(c|=Cs),c}function R_(c,u,g){var S=u.pendingProps,C=!1,B=(u.flags&128)!==0,q;if((q=B)||(q=c!==null&&c.memoizedState===null?!1:(pa.current&2)!==0),q&&(C=!0,u.flags&=-129),q=(u.flags&32)!==0,u.flags&=-33,c===null){if(ni){if(C?Zi(u):vi(),ni){var se=ka,Se;(Se=se)&&(se=iy(se,or),se!==null?(u.memoizedState={dehydrated:se,treeContext:Tr!==null?{id:Zr,overflow:rr}:null,retryLane:536870912},Se=t(18,null,null,0),Se.stateNode=se,Se.return=u,u.child=Se,ts=u,ka=null,Se=!0):Se=!1),Se||tt(u)}if(se=u.memoizedState,se!==null&&(se=se.dehydrated,se!==null))return Hf(se)?u.lanes=16:u.lanes=536870912,null;en(u)}return se=S.children,S=S.fallback,C?(vi(),C=u.mode,se=pm({mode:"hidden",children:se},C),S=bo(S,C,g,null),se.return=u,S.return=u,se.sibling=S,u.child=se,C=u.child,C.memoizedState=hm(g),C.childLanes=dm(c,q,g),u.memoizedState=is,S):(Zi(u),yf(u,se))}if(Se=c.memoizedState,Se!==null&&(se=Se.dehydrated,se!==null)){if(B)u.flags&256?(Zi(u),u.flags&=-257,u=mm(c,u,g)):u.memoizedState!==null?(vi(),u.child=c.child,u.flags|=128,u=null):(vi(),C=S.fallback,se=u.mode,S=pm({mode:"visible",children:S.children},se),C=bo(C,se,g,null),C.flags|=2,S.return=u,C.return=u,S.sibling=C,u.child=S,yl(u,c.child,null,g),S=u.child,S.memoizedState=hm(g),S.childLanes=dm(c,q,g),u.memoizedState=is,u=C);else if(Zi(u),Hf(se))q=j_(se).digest,S=Error(i(419)),S.stack="",S.digest=q,mt({value:S,source:null,stack:null}),u=mm(c,u,g);else if(na||Xl(c,u,g,!1),q=(g&c.childLanes)!==0,na||q){if(q=Fn,q!==null){if(S=g&-g,(S&42)!==0)S=1;else switch(S){case 2:S=1;break;case 8:S=4;break;case 32:S=16;break;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:S=64;break;case 268435456:S=134217728;break;default:S=0}if(S=(S&(q.suspendedLanes|g))!==0?0:S,S!==0&&S!==Se.retryLane)throw Se.retryLane=S,rt(c,S),Qa(q,c,S),_y}Bd(se)||xs(),u=mm(c,u,g)}else Bd(se)?(u.flags|=128,u.child=c.child,u=Zl.bind(null,c),WS(se,u),u=null):(c=Se.treeContext,cs&&(ka=ey(se),ts=u,ni=!0,Ys=null,or=!1,c!==null&&(ks[Xs++]=Zr,ks[Xs++]=rr,ks[Xs++]=Tr,Zr=c.id,rr=c.overflow,Tr=u)),u=yf(u,S.children),u.flags|=4096);return u}return C?(vi(),C=S.fallback,se=u.mode,Se=c.child,B=Se.sibling,S=$a(Se,{mode:"hidden",children:S.children}),S.subtreeFlags=Se.subtreeFlags&31457280,B!==null?C=$a(B,C):(C=bo(C,se,g,null),C.flags|=2),C.return=u,S.return=u,S.sibling=C,u.child=S,S=C,C=u.child,se=c.child.memoizedState,se===null?se=hm(g):(Se=se.cachePool,Se!==null?(B=Kr?ui._currentValue:ui._currentValue2,Se=Se.parent!==B?{parent:B,pool:B}:Se):Se=L_(),se={baseLanes:se.baseLanes|g,cachePool:Se}),C.memoizedState=se,C.childLanes=dm(c,q,g),u.memoizedState=is,S):(Zi(u),g=c.child,c=g.sibling,g=$a(g,{mode:"visible",children:S.children}),g.return=u,g.sibling=null,c!==null&&(q=u.deletions,q===null?(u.deletions=[c],u.flags|=16):q.push(c)),u.child=g,u.memoizedState=null,g)}function yf(c,u){return u=pm({mode:"visible",children:u},c.mode),u.return=c,c.child=u}function pm(c,u){return yd(c,u,0,null)}function mm(c,u,g){return yl(u,c.child,null,g),c=yf(u,u.pendingProps.children),c.flags|=2,u.memoizedState=null,c}function w_(c,u,g){c.lanes|=u;var S=c.alternate;S!==null&&(S.lanes|=u),vm(c.return,u,g)}function id(c,u,g,S,C){var B=c.memoizedState;B===null?c.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:S,tail:g,tailMode:C}:(B.isBackwards=u,B.rendering=null,B.renderingStartTime=0,B.last=S,B.tail=g,B.tailMode=C)}function B_(c,u,g){var S=u.pendingProps,C=S.revealOrder,B=S.tail;if(Fa(c,u,S.children,g),S=pa.current,(S&2)!==0)S=S&1|2,u.flags|=128;else{if(c!==null&&(c.flags&128)!==0)e:for(c=u.child;c!==null;){if(c.tag===13)c.memoizedState!==null&&w_(c,g,u);else if(c.tag===19)w_(c,g,u);else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===u)break e;for(;c.sibling===null;){if(c.return===null||c.return===u)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}S&=1}switch(w(pa,S),C){case"forwards":for(g=u.child,C=null;g!==null;)c=g.alternate,c!==null&&ci(c)===null&&(C=g),g=g.sibling;g=C,g===null?(C=u.child,u.child=null):(C=g.sibling,g.sibling=null),id(u,!1,C,g,B);break;case"backwards":for(g=null,C=u.child,u.child=null;C!==null;){if(c=C.alternate,c!==null&&ci(c)===null){u.child=C;break}c=C.sibling,C.sibling=g,g=C,C=c}id(u,!0,g,null,B);break;case"together":id(u,!1,null,null,void 0);break;default:u.memoizedState=null}return u.child}function go(c,u,g){if(c!==null&&(u.dependencies=c.dependencies),js|=u.lanes,(g&u.childLanes)===0)if(c!==null){if(Xl(c,u,g,!1),(g&u.childLanes)===0)return null}else return null;if(c!==null&&u.child!==c.child)throw Error(i(153));if(u.child!==null){for(c=u.child,g=$a(c,c.pendingProps),u.child=g,g.return=u;c.sibling!==null;)c=c.sibling,g=g.sibling=$a(c,c.pendingProps),g.return=u;g.sibling=null}return u.child}function gm(c,u){return(c.lanes&u)!==0?!0:(c=c.dependencies,!!(c!==null&&Zo(c)))}function JS(c,u,g){switch(u.tag){case 3:Ne(u,u.stateNode.containerInfo),jo(u,ui,c.memoizedState.cache),It();break;case 27:case 5:ve(u);break;case 4:Ne(u,u.stateNode.containerInfo);break;case 10:jo(u,u.type,u.memoizedProps.value);break;case 13:var S=u.memoizedState;if(S!==null)return S.dehydrated!==null?(Zi(u),u.flags|=128,null):(g&u.child.childLanes)!==0?R_(c,u,g):(Zi(u),c=go(c,u,g),c!==null?c.sibling:null);Zi(u);break;case 19:var C=(c.flags&128)!==0;if(S=(g&u.childLanes)!==0,S||(Xl(c,u,g,!1),S=(g&u.childLanes)!==0),C){if(S)return B_(c,u,g);u.flags|=128}if(C=u.memoizedState,C!==null&&(C.rendering=null,C.tail=null,C.lastEffect=null),w(pa,pa.current),S)break;return null;case 22:case 23:return u.lanes=0,b_(c,u,g);case 24:jo(u,ui,c.memoizedState.cache)}return go(c,u,g)}function D_(c,u,g){if(c!==null)if(c.memoizedProps!==u.pendingProps)na=!0;else{if(!gm(c,g)&&(u.flags&128)===0)return na=!1,JS(c,u,g);na=(c.flags&131072)!==0}else na=!1,ni&&(u.flags&1048576)!==0&&W(u,Xf,u.index);switch(u.lanes=0,u.tag){case 16:e:{c=u.pendingProps;var S=u.elementType,C=S._init;if(S=C(S._payload),u.type=S,typeof S=="function")So(S)?(c=Ar(S,c),u.tag=1,u=fm(null,u,S,c,g)):(u.tag=0,u=um(null,u,S,c,g));else{if(S!=null){if(C=S.$$typeof,C===iu){u.tag=11,u=S_(null,u,S,c,g);break e}else if(C===Bf){u.tag=14,u=M_(null,u,S,c,g);break e}}throw u=l(S)||S,Error(i(306,u,""))}}return u;case 0:return um(c,u,u.type,u.pendingProps,g);case 1:return S=u.type,C=Ar(S,u.pendingProps),fm(c,u,S,C,g);case 3:e:{if(Ne(u,u.stateNode.containerInfo),c===null)throw Error(i(387));var B=u.pendingProps;C=u.memoizedState,S=C.element,Xt(c,u),qt(u,B,null,g);var q=u.memoizedState;if(B=q.cache,jo(u,ui,B),B!==C.cache&&_m(u,[ui],g,!0),st(),B=q.element,cs&&C.isDehydrated)if(C={element:B,isDehydrated:!1,cache:q.cache},u.updateQueue.baseState=C,u.memoizedState=C,u.flags&256){u=C_(c,u,B,g);break e}else if(B!==S){S=ye(Error(i(424)),u),mt(S),u=C_(c,u,B,g);break e}else for(cs&&(ka=$_(u.stateNode.containerInfo),ts=u,ni=!0,Ys=null,or=!0),g=_g(u,null,B,g),u.child=g;g;)g.flags=g.flags&-3|4096,g=g.sibling;else{if(It(),B===S){u=go(c,u,g);break e}Fa(c,u,B,g)}u=u.child}return u;case 26:if(zs)return _f(c,u),c===null?(g=Od(u.type,null,u.pendingProps,null))?u.memoizedState=g:ni||(u.stateNode=ZS(u.type,u.pendingProps,Cr.current,u)):u.memoizedState=Od(u.type,c.memoizedProps,u.pendingProps,c.memoizedState),null;case 27:if(za)return ve(u),c===null&&za&&ni&&(S=u.stateNode=pg(u.type,u.pendingProps,Cr.current,Ba.current,!1),ts=u,or=!0,ka=Dd(S)),S=u.pendingProps.children,c!==null||ni?Fa(c,u,S,g):u.child=yl(u,null,S,g),_f(c,u),u.child;case 5:return c===null&&ni&&(ly(u.type,u.pendingProps,Ba.current),(C=S=ka)&&(S=ty(S,u.type,u.pendingProps,or),S!==null?(u.stateNode=S,ts=u,ka=Dd(S),or=!1,C=!0):C=!1),C||tt(u)),ve(u),C=u.type,B=u.pendingProps,q=c!==null?c.memoizedProps:null,S=B.children,pl(C,B)?S=null:q!==null&&pl(C,q)&&(u.flags|=32),u.memoizedState!==null&&(C=J(c,u,Pe,null,null,g),Kr?gn._currentValue=C:gn._currentValue2=C),_f(c,u),Fa(c,u,S,g),u.child;case 6:return c===null&&ni&&(cy(u.pendingProps,Ba.current),(c=g=ka)&&(g=ny(g,u.pendingProps,or),g!==null?(u.stateNode=g,ts=u,ka=null,c=!0):c=!1),c||tt(u)),null;case 13:return R_(c,u,g);case 4:return Ne(u,u.stateNode.containerInfo),S=u.pendingProps,c===null?u.child=yl(u,null,S,g):Fa(c,u,S,g),u.child;case 11:return S_(c,u,u.type,u.pendingProps,g);case 7:return Fa(c,u,u.pendingProps,g),u.child;case 8:return Fa(c,u,u.pendingProps.children,g),u.child;case 12:return Fa(c,u,u.pendingProps.children,g),u.child;case 10:return S=u.pendingProps,jo(u,u.type,S.value),Fa(c,u,S.children,g),u.child;case 9:return C=u.type._context,S=u.pendingProps.children,Yl(u),C=Ha(C),S=S(C),u.flags|=1,Fa(c,u,S,g),u.child;case 14:return M_(c,u,u.type,u.pendingProps,g);case 15:return nd(c,u,u.type,u.pendingProps,g);case 19:return B_(c,u,g);case 22:return b_(c,u,g);case 24:return Yl(u),S=Ha(ui),c===null?(C=Qo(),C===null&&(C=Fn,B=ad(),C.pooledCache=B,B.refCount++,B!==null&&(C.pooledCacheLanes|=g),C=B),u.memoizedState={parent:S,cache:C},Ht(u),jo(u,ui,C)):((c.lanes&g)!==0&&(Xt(c,u),qt(u,null,null,g),st()),C=c.memoizedState,B=u.memoizedState,C.parent!==S?(C={parent:S,cache:S},u.memoizedState=C,u.lanes===0&&(u.memoizedState=u.updateQueue.baseState=C),jo(u,ui,S)):(S=B.cache,jo(u,ui,S),S!==C.cache&&_m(u,[ui],g,!0))),Fa(c,u,u.pendingProps.children,g),u.child;case 29:throw u.pendingProps}throw Error(i(156,u.tag))}function jo(c,u,g){Kr?(w(Es,u._currentValue),u._currentValue=g):(w(Es,u._currentValue2),u._currentValue2=g)}function vo(c){var u=Es.current;Kr?c._currentValue=u:c._currentValue2=u,M(Es)}function vm(c,u,g){for(;c!==null;){var S=c.alternate;if((c.childLanes&u)!==u?(c.childLanes|=u,S!==null&&(S.childLanes|=u)):S!==null&&(S.childLanes&u)!==u&&(S.childLanes|=u),c===g)break;c=c.return}}function _m(c,u,g,S){var C=c.child;for(C!==null&&(C.return=c);C!==null;){var B=C.dependencies;if(B!==null){var q=C.child;B=B.firstContext;e:for(;B!==null;){var se=B;B=C;for(var Se=0;Se<u.length;Se++)if(se.context===u[Se]){B.lanes|=g,se=B.alternate,se!==null&&(se.lanes|=g),vm(B.return,g,c),S||(q=null);break e}B=se.next}}else if(C.tag===18){if(q=C.return,q===null)throw Error(i(341));q.lanes|=g,B=q.alternate,B!==null&&(B.lanes|=g),vm(q,g,c),q=null}else q=C.child;if(q!==null)q.return=C;else for(q=C;q!==null;){if(q===c){q=null;break}if(C=q.sibling,C!==null){C.return=q.return,q=C;break}q=q.return}C=q}}function Xl(c,u,g,S){c=null;for(var C=u,B=!1;C!==null;){if(!B){if((C.flags&524288)!==0)B=!0;else if((C.flags&262144)!==0)break}if(C.tag===10){var q=C.alternate;if(q===null)throw Error(i(387));if(q=q.memoizedProps,q!==null){var se=C.type;Vs(C.pendingProps.value,q.value)||(c!==null?c.push(se):c=[se])}}else if(C===uu.current){if(q=C.alternate,q===null)throw Error(i(387));q.memoizedState.memoizedState!==C.memoizedState.memoizedState&&(c!==null?c.push(gn):c=[gn])}C=C.return}c!==null&&_m(u,c,g,S),u.flags|=262144}function Zo(c){for(c=c.firstContext;c!==null;){var u=c.context;if(!Vs(Kr?u._currentValue:u._currentValue2,c.memoizedValue))return!0;c=c.next}return!1}function Yl(c){Al=c,Ki=null,c=c.dependencies,c!==null&&(c.firstContext=null)}function Ha(c){return ym(Al,c)}function xf(c,u){return Al===null&&Yl(c),ym(c,u)}function ym(c,u){var g=Kr?u._currentValue:u._currentValue2;if(u={context:u,memoizedValue:g,next:null},Ki===null){if(c===null)throw Error(i(308));Ki=u,c.dependencies={lanes:0,firstContext:u},c.flags|=524288}else Ki=Ki.next=u;return g}function ad(){return{controller:new yy,data:new Map,refCount:0}}function Vc(c){c.refCount--,c.refCount===0&&Lo(oc,function(){c.controller.abort()})}function Qo(){var c=No.current;return c!==null?c:Fn.pooledCache}function sd(c,u){u===null?w(No,No.current):w(No,u.pool)}function L_(){var c=Qo();return c===null?null:{parent:Kr?ui._currentValue:ui._currentValue2,pool:c}}function Is(c){c.flags|=4}function xm(c,u){if(c!==null&&c.child===u.child)return!1;if((u.flags&16)!==0)return!0;for(c=u.child;c!==null;){if((c.flags&13878)!==0||(c.subtreeFlags&13878)!==0)return!0;c=c.sibling}return!1}function rd(c,u,g,S){if(Ga)for(g=u.child;g!==null;){if(g.tag===5||g.tag===6)qr(c,g.stateNode);else if(!(g.tag===4||za&&g.tag===27)&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===u)break;for(;g.sibling===null;){if(g.return===null||g.return===u)return;g=g.return}g.sibling.return=g.return,g=g.sibling}else if(Ps)for(var C=u.child;C!==null;){if(C.tag===5){var B=C.stateNode;g&&S&&(B=tg(B,C.type,C.memoizedProps)),qr(c,B)}else if(C.tag===6)B=C.stateNode,g&&S&&(B=ng(B,C.memoizedProps)),qr(c,B);else if(C.tag!==4){if(C.tag===22&&C.memoizedState!==null)B=C.child,B!==null&&(B.return=C),rd(c,C,!0,!0);else if(C.child!==null){C.child.return=C,C=C.child;continue}}if(C===u)break;for(;C.sibling===null;){if(C.return===null||C.return===u)return;C=C.return}C.sibling.return=C.return,C=C.sibling}}function kc(c,u,g,S){if(Ps)for(var C=u.child;C!==null;){if(C.tag===5){var B=C.stateNode;g&&S&&(B=tg(B,C.type,C.memoizedProps)),$m(c,B)}else if(C.tag===6)B=C.stateNode,g&&S&&(B=ng(B,C.memoizedProps)),$m(c,B);else if(C.tag!==4){if(C.tag===22&&C.memoizedState!==null)B=C.child,B!==null&&(B.return=C),kc(c,C,!(C.memoizedProps!==null&&C.memoizedProps.mode==="manual"),!0);else if(C.child!==null){C.child.return=C,C=C.child;continue}}if(C===u)break;for(;C.sibling===null;){if(C.return===null||C.return===u)return;C=C.return}C.sibling.return=C.return,C=C.sibling}}function Xc(c,u){if(Ps&&xm(c,u)){c=u.stateNode;var g=c.containerInfo,S=wd();kc(S,u,!1,!1),c.pendingChildren=S,Is(u),W_(g,S)}}function Am(c,u,g,S){if(Ga)c.memoizedProps!==S&&Is(u);else if(Ps){var C=c.stateNode,B=c.memoizedProps;if((c=xm(c,u))||B!==S){var q=Ba.current;B=Qm(C,g,B,S,!c,null),B===C?u.stateNode=C:(To(B,g,S,q)&&Is(u),u.stateNode=B,c?rd(B,u,!1,!1):Is(u))}else u.stateNode=C}}function Yc(c,u,g){if(J_(u,g)){if(c.flags|=16777216,!Co(u,g))if(Tf())c.flags|=8192;else throw rc=Gd,vg}else c.flags&=-16777217}function Sm(c,u){if(uy(u)){if(c.flags|=16777216,!hg(u))if(Tf())c.flags|=8192;else throw rc=Gd,vg}else c.flags&=-16777217}function Af(c,u){u!==null&&(c.flags|=4),c.flags&16384&&(u=c.tag!==22?N():536870912,c.lanes|=u,Oo|=u)}function Jl(c,u){if(!ni)switch(c.tailMode){case"hidden":u=c.tail;for(var g=null;u!==null;)u.alternate!==null&&(g=u),u=u.sibling;g===null?c.tail=null:g.sibling=null;break;case"collapsed":g=c.tail;for(var S=null;g!==null;)g.alternate!==null&&(S=g),g=g.sibling;S===null?u||c.tail===null?c.tail=null:c.tail.sibling=null:S.sibling=null}}function wi(c){var u=c.alternate!==null&&c.alternate.child===c.child,g=0,S=0;if(u)for(var C=c.child;C!==null;)g|=C.lanes|C.childLanes,S|=C.subtreeFlags&31457280,S|=C.flags&31457280,C.return=c,C=C.sibling;else for(C=c.child;C!==null;)g|=C.lanes|C.childLanes,S|=C.subtreeFlags,S|=C.flags,C.return=c,C=C.sibling;return c.subtreeFlags|=S,c.childLanes=g,u}function N_(c,u,g){var S=u.pendingProps;switch(Me(u),u.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return wi(u),null;case 1:return wi(u),null;case 3:return g=u.stateNode,S=null,c!==null&&(S=c.memoizedState.cache),u.memoizedState.cache!==S&&(u.flags|=2048),vo(ui),it(),g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null),(c===null||c.child===null)&&(on(u)?Is(u):c===null||c.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,Ys!==null&&(yo(Ys),Ys=null))),Xc(c,u),wi(u),null;case 26:if(zs){g=u.type;var C=u.memoizedState;return c===null?(Is(u),C!==null?(wi(u),Sm(u,C)):(wi(u),Yc(u,g,S))):C?C!==c.memoizedState?(Is(u),wi(u),Sm(u,C)):(wi(u),u.flags&=-16777217):(Ga?c.memoizedProps!==S&&Is(u):Am(c,u,g,S),wi(u),Yc(u,g,S)),null}case 27:if(za){if(Ce(u),g=Cr.current,C=u.type,c!==null&&u.stateNode!=null)Ga?c.memoizedProps!==S&&Is(u):Am(c,u,C,S);else{if(!S){if(u.stateNode===null)throw Error(i(166));return wi(u),null}c=Ba.current,on(u)?Et(u,c):(c=pg(C,S,g,c,!0),u.stateNode=c,Is(u))}return wi(u),null}case 5:if(Ce(u),g=u.type,c!==null&&u.stateNode!=null)Am(c,u,g,S);else{if(!S){if(u.stateNode===null)throw Error(i(166));return wi(u),null}c=Ba.current,on(u)?Et(u,c):(C=zm(g,S,Cr.current,c,u),rd(C,u,!1,!1),u.stateNode=C,To(C,g,S,c)&&Is(u))}return wi(u),Yc(u,u.type,u.pendingProps),null;case 6:if(c&&u.stateNode!=null)g=c.memoizedProps,Ga?g!==S&&Is(u):Ps&&(g!==S?(u.stateNode=Md(S,Cr.current,Ba.current,u),Is(u)):u.stateNode=c.stateNode);else{if(typeof S!="string"&&u.stateNode===null)throw Error(i(166));if(c=Cr.current,g=Ba.current,on(u)){if(!cs)throw Error(i(176));if(c=u.stateNode,g=u.memoizedProps,S=null,C=ts,C!==null)switch(C.tag){case 27:case 5:S=C.memoizedProps}ay(c,g,u,S)||tt(u)}else u.stateNode=Md(S,c,g,u)}return wi(u),null;case 13:if(S=u.memoizedState,c===null||c.memoizedState!==null&&c.memoizedState.dehydrated!==null){if(C=on(u),S!==null&&S.dehydrated!==null){if(c===null){if(!C)throw Error(i(318));if(!cs)throw Error(i(344));if(C=u.memoizedState,C=C!==null?C.dehydrated:null,!C)throw Error(i(317));su(C,u)}else It(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;wi(u),C=!1}else Ys!==null&&(yo(Ys),Ys=null),C=!0;if(!C)return u.flags&256?(en(u),u):(en(u),null)}if(en(u),(u.flags&128)!==0)return u.lanes=g,u;if(g=S!==null,c=c!==null&&c.memoizedState!==null,g){S=u.child,C=null,S.alternate!==null&&S.alternate.memoizedState!==null&&S.alternate.memoizedState.cachePool!==null&&(C=S.alternate.memoizedState.cachePool.pool);var B=null;S.memoizedState!==null&&S.memoizedState.cachePool!==null&&(B=S.memoizedState.cachePool.pool),B!==C&&(S.flags|=2048)}return g!==c&&g&&(u.child.flags|=8192),Af(u,u.updateQueue),wi(u),null;case 4:return it(),Xc(c,u),c===null&&Xm(u.stateNode.containerInfo),wi(u),null;case 10:return vo(u.type),wi(u),null;case 19:if(M(pa),C=u.memoizedState,C===null)return wi(u),null;if(S=(u.flags&128)!==0,B=C.rendering,B===null)if(S)Jl(C,!1);else{if(Zn!==0||c!==null&&(c.flags&128)!==0)for(c=u.child;c!==null;){if(B=ci(c),B!==null){for(u.flags|=128,Jl(C,!1),c=B.updateQueue,u.updateQueue=c,Af(u,c),u.subtreeFlags=0,c=g,g=u.child;g!==null;)Mo(g,c),g=g.sibling;return w(pa,pa.current&1|2),u.child}c=c.sibling}C.tail!==null&&Va()>Pi&&(u.flags|=128,S=!0,Jl(C,!1),u.lanes=4194304)}else{if(!S)if(c=ci(B),c!==null){if(u.flags|=128,S=!0,c=c.updateQueue,u.updateQueue=c,Af(u,c),Jl(C,!0),C.tail===null&&C.tailMode==="hidden"&&!B.alternate&&!ni)return wi(u),null}else 2*Va()-C.renderingStartTime>Pi&&g!==536870912&&(u.flags|=128,S=!0,Jl(C,!1),u.lanes=4194304);C.isBackwards?(B.sibling=u.child,u.child=B):(c=C.last,c!==null?c.sibling=B:u.child=B,C.last=B)}return C.tail!==null?(u=C.tail,C.rendering=u,C.tail=u.sibling,C.renderingStartTime=Va(),u.sibling=null,c=pa.current,w(pa,S?c&1|2:c&1),u):(wi(u),null);case 22:case 23:return en(u),Ui(),S=u.memoizedState!==null,c!==null?c.memoizedState!==null!==S&&(u.flags|=8192):S&&(u.flags|=8192),S?(g&536870912)!==0&&(u.flags&128)===0&&(wi(u),u.subtreeFlags&6&&(u.flags|=8192)):wi(u),g=u.updateQueue,g!==null&&Af(u,g.retryQueue),g=null,c!==null&&c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(g=c.memoizedState.cachePool.pool),S=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(S=u.memoizedState.cachePool.pool),S!==g&&(u.flags|=2048),c!==null&&M(No),null;case 24:return g=null,c!==null&&(g=c.memoizedState.cache),u.memoizedState.cache!==g&&(u.flags|=2048),vo(ui),wi(u),null;case 25:return null}throw Error(i(156,u.tag))}function U_(c,u){switch(Me(u),u.tag){case 1:return c=u.flags,c&65536?(u.flags=c&-65537|128,u):null;case 3:return vo(ui),it(),c=u.flags,(c&65536)!==0&&(c&128)===0?(u.flags=c&-65537|128,u):null;case 26:case 27:case 5:return Ce(u),null;case 13:if(en(u),c=u.memoizedState,c!==null&&c.dehydrated!==null){if(u.alternate===null)throw Error(i(340));It()}return c=u.flags,c&65536?(u.flags=c&-65537|128,u):null;case 19:return M(pa),null;case 4:return it(),null;case 10:return vo(u.type),null;case 22:case 23:return en(u),Ui(),c!==null&&M(No),c=u.flags,c&65536?(u.flags=c&-65537|128,u):null;case 24:return vo(ui),null;case 25:return null;default:return null}}function Mm(c,u){switch(Me(u),u.tag){case 3:vo(ui),it();break;case 26:case 27:case 5:Ce(u);break;case 4:it();break;case 13:en(u);break;case 19:M(pa);break;case 10:vo(u.type);break;case 22:case 23:en(u),Ui(),c!==null&&M(No);break;case 24:vo(ui)}}function Sf(c,u){try{var g=u.updateQueue,S=g!==null?g.lastEffect:null;if(S!==null){var C=S.next;g=C;do{if((g.tag&c)===c){S=void 0;var B=g.create,q=g.inst;S=B(),q.destroy=S}g=g.next}while(g!==C)}}catch(se){zn(u,u.return,se)}}function $o(c,u,g){try{var S=u.updateQueue,C=S!==null?S.lastEffect:null;if(C!==null){var B=C.next;S=B;do{if((S.tag&c)===c){var q=S.inst,se=q.destroy;if(se!==void 0){q.destroy=void 0,C=u;var Se=g;try{se()}catch(Je){zn(C,Se,Je)}}}S=S.next}while(S!==B)}}catch(Je){zn(u,u.return,Je)}}function O_(c){var u=c.updateQueue;if(u!==null){var g=c.stateNode;try{be(u,g)}catch(S){zn(c,c.return,S)}}}function I_(c,u,g){g.props=Ar(c.type,c.memoizedProps),g.state=c.memoizedState;try{g.componentWillUnmount()}catch(S){zn(c,u,S)}}function ql(c,u){try{var g=c.ref;if(g!==null){var S=c.stateNode;switch(c.tag){case 26:case 27:case 5:var C=au(S);break;default:C=S}typeof g=="function"?c.refCleanup=g(C):g.current=C}}catch(B){zn(c,u,B)}}function Bi(c,u){var g=c.ref,S=c.refCleanup;if(g!==null)if(typeof S=="function")try{S()}catch(C){zn(c,u,C)}finally{c.refCleanup=null,c=c.alternate,c!=null&&(c.refCleanup=null)}else if(typeof g=="function")try{g(null)}catch(C){zn(c,u,C)}else g.current=null}function Jc(c){var u=c.type,g=c.memoizedProps,S=c.stateNode;try{KS(S,u,g,c)}catch(C){zn(c,c.return,C)}}function bm(c,u,g){try{Km(c.stateNode,c.type,g,u,c)}catch(S){zn(c,c.return,S)}}function Em(c){return c.tag===5||c.tag===3||(zs?c.tag===26:!1)||(za?c.tag===27:!1)||c.tag===4}function od(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||Em(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&(!za||c.tag!==27)&&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 ld(c,u,g){var S=c.tag;if(S===5||S===6)c=c.stateNode,u?jm(g,c,u):q_(g,c);else if(!(S===4||za&&S===27)&&(c=c.child,c!==null))for(ld(c,u,g),c=c.sibling;c!==null;)ld(c,u,g),c=c.sibling}function qc(c,u,g){var S=c.tag;if(S===5||S===6)c=c.stateNode,u?Wm(g,c,u):qm(g,c);else if(!(S===4||za&&S===27)&&(c=c.child,c!==null))for(qc(c,u,g),c=c.sibling;c!==null;)qc(c,u,g),c=c.sibling}function F_(c,u,g){c=c.containerInfo;try{eg(c,g)}catch(S){zn(u,u.return,S)}}function Kc(c,u){for(dl(c.containerInfo),Wi=u;Wi!==null;)if(c=Wi,u=c.child,(c.subtreeFlags&1028)!==0&&u!==null)u.return=c,Wi=u;else for(;Wi!==null;){c=Wi;var g=c.alternate;switch(u=c.flags,c.tag){case 0:break;case 11:case 15:break;case 1:if((u&1024)!==0&&g!==null){u=void 0;var S=c,C=g.memoizedProps;g=g.memoizedState;var B=S.stateNode;try{var q=Ar(S.type,C,S.elementType===S.type);u=B.getSnapshotBeforeUpdate(q,g),B.__reactInternalSnapshotBeforeUpdate=u}catch(se){zn(S,S.return,se)}}break;case 3:(u&1024)!==0&&Ga&&Rd(c.stateNode.containerInfo);break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((u&1024)!==0)throw Error(i(163))}if(u=c.sibling,u!==null){u.return=c.return,Wi=u;break}Wi=c.return}return q=lc,lc=!1,q}function cd(c,u,g){var S=g.flags;switch(g.tag){case 0:case 11:case 15:zr(c,g),S&4&&Sf(5,g);break;case 1:if(zr(c,g),S&4)if(c=g.stateNode,u===null)try{c.componentDidMount()}catch(se){zn(g,g.return,se)}else{var C=Ar(g.type,u.memoizedProps);u=u.memoizedState;try{c.componentDidUpdate(C,u,c.__reactInternalSnapshotBeforeUpdate)}catch(se){zn(g,g.return,se)}}S&64&&O_(g),S&512&&ql(g,g.return);break;case 3:if(zr(c,g),S&64&&(S=g.updateQueue,S!==null)){if(c=null,g.child!==null)switch(g.child.tag){case 27:case 5:c=au(g.child.stateNode);break;case 1:c=g.child.stateNode}try{be(S,c)}catch(se){zn(g,g.return,se)}}break;case 26:if(zs){zr(c,g),S&512&&ql(g,g.return);break}case 27:case 5:zr(c,g),u===null&&S&4&&Jc(g),S&512&&ql(g,g.return);break;case 12:zr(c,g);break;case 13:zr(c,g),S&4&&el(c,g);break;case 22:if(C=g.memoizedState!==null||Aa,!C){u=u!==null&&u.memoizedState!==null||Hi;var B=Aa,q=Hi;Aa=C,(Hi=u)&&!q?nl(c,g,(g.subtreeFlags&8772)!==0):zr(c,g),Aa=B,Hi=q}S&512&&(g.memoizedProps.mode==="manual"?ql(g,g.return):Bi(g,g.return));break;default:zr(c,g)}}function Wc(c){var u=c.alternate;u!==null&&(c.alternate=null,Wc(u)),c.child=null,c.deletions=null,c.sibling=null,c.tag===5&&(u=c.stateNode,u!==null&&Ym(u)),c.stateNode=null,c.return=null,c.dependencies=null,c.memoizedProps=null,c.memoizedState=null,c.pendingProps=null,c.stateNode=null,c.updateQueue=null}function Fs(c,u,g){for(g=g.child;g!==null;)ud(c,u,g),g=g.sibling}function ud(c,u,g){if(Ms&&typeof Ms.onCommitFiberUnmount=="function")try{Ms.onCommitFiberUnmount(cu,g)}catch{}switch(g.tag){case 26:if(zs){Hi||Bi(g,u),Fs(c,u,g),g.memoizedState?og(g.memoizedState):g.stateNode&&ug(g.stateNode);break}case 27:if(za){Hi||Bi(g,u);var S=ia,C=Ts;ia=g.stateNode,Fs(c,u,g),fy(g.stateNode),ia=S,Ts=C;break}case 5:Hi||Bi(g,u);case 6:if(Ga){if(S=ia,C=Ts,ia=null,Fs(c,u,g),ia=S,Ts=C,ia!==null)if(Ts)try{ea(ia,g.stateNode)}catch(B){zn(g,u,B)}else try{us(ia,g.stateNode)}catch(B){zn(g,u,B)}}else Fs(c,u,g);break;case 18:Ga&&ia!==null&&(Ts?ag(ia,g.stateNode):ry(ia,g.stateNode));break;case 4:Ga?(S=ia,C=Ts,ia=g.stateNode.containerInfo,Ts=!0,Fs(c,u,g),ia=S,Ts=C):(Ps&&F_(g.stateNode,g,wd()),Fs(c,u,g));break;case 0:case 11:case 14:case 15:Hi||$o(2,g,u),Hi||$o(4,g,u),Fs(c,u,g);break;case 1:Hi||(Bi(g,u),S=g.stateNode,typeof S.componentWillUnmount=="function"&&I_(g,u,S)),Fs(c,u,g);break;case 21:Fs(c,u,g);break;case 22:Hi||Bi(g,u),Hi=(S=Hi)||g.memoizedState!==null,Fs(c,u,g),Hi=S;break;default:Fs(c,u,g)}}function el(c,u){if(cs&&u.memoizedState===null&&(c=u.alternate,c!==null&&(c=c.memoizedState,c!==null&&(c=c.dehydrated,c!==null))))try{Nd(c)}catch(g){zn(u,u.return,g)}}function jc(c){switch(c.tag){case 13:case 19:var u=c.stateNode;return u===null&&(u=c.stateNode=new mu),u;case 22:return c=c.stateNode,u=c._retryCache,u===null&&(u=c._retryCache=new mu),u;default:throw Error(i(435,c.tag))}}function Mf(c,u){var g=jc(c);u.forEach(function(S){var C=Bm.bind(null,c,S);g.has(S)||(g.add(S),S.then(C,C))})}function rs(c,u){var g=u.deletions;if(g!==null)for(var S=0;S<g.length;S++){var C=g[S],B=c,q=u;if(Ga){var se=q;e:for(;se!==null;){switch(se.tag){case 27:case 5:ia=se.stateNode,Ts=!1;break e;case 3:ia=se.stateNode.containerInfo,Ts=!0;break e;case 4:ia=se.stateNode.containerInfo,Ts=!0;break e}se=se.return}if(ia===null)throw Error(i(160));ud(B,q,C),ia=null,Ts=!1}else ud(B,q,C);B=C.alternate,B!==null&&(B.return=null),C.return=null}if(u.subtreeFlags&13878)for(u=u.child;u!==null;)tl(u,c),u=u.sibling}function tl(c,u){var g=c.alternate,S=c.flags;switch(c.tag){case 0:case 11:case 14:case 15:rs(u,c),_s(c),S&4&&($o(3,c,c.return),Sf(3,c),$o(5,c,c.return));break;case 1:rs(u,c),_s(c),S&512&&(Hi||g===null||Bi(g,g.return)),S&64&&Aa&&(c=c.updateQueue,c!==null&&(S=c.callbacks,S!==null&&(g=c.shared.hiddenCallbacks,c.shared.hiddenCallbacks=g===null?S:g.concat(S))));break;case 26:if(zs){var C=fs;rs(u,c),_s(c),S&512&&(Hi||g===null||Bi(g,g.return)),S&4&&(S=g!==null?g.memoizedState:null,u=c.memoizedState,g===null?u===null?c.stateNode===null?c.stateNode=lg(C,c.type,c.memoizedProps,c):cg(C,c.type,c.stateNode):c.stateNode=rg(C,u,c.memoizedProps):S!==u?(S===null?g.stateNode!==null&&ug(g.stateNode):og(S),u===null?cg(C,c.type,c.stateNode):rg(C,u,c.memoizedProps)):u===null&&c.stateNode!==null&&bm(c,c.memoizedProps,g.memoizedProps));break}case 27:if(za&&S&4&&c.alternate===null){C=c.stateNode;var B=c.memoizedProps;try{QS(C),$S(c.type,B,C,c)}catch(Mt){zn(c,c.return,Mt)}}case 5:if(rs(u,c),_s(c),S&512&&(Hi||g===null||Bi(g,g.return)),Ga){if(c.flags&32){u=c.stateNode;try{If(u)}catch(Mt){zn(c,c.return,Mt)}}S&4&&c.stateNode!=null&&(u=c.memoizedProps,bm(c,u,g!==null?g.memoizedProps:u)),S&1024&&(Sl=!0)}break;case 6:if(rs(u,c),_s(c),S&4&&Ga){if(c.stateNode===null)throw Error(i(162));S=c.memoizedProps,g=g!==null?g.memoizedProps:S,u=c.stateNode;try{K_(u,g,S)}catch(Mt){zn(c,c.return,Mt)}}break;case 3:if(zs?(fg(),C=fs,fs=Ud(u.containerInfo),rs(u,c),fs=C):rs(u,c),_s(c),S&4){if(Ga&&cs&&g!==null&&g.memoizedState.isDehydrated)try{Ld(u.containerInfo)}catch(Mt){zn(c,c.return,Mt)}if(Ps){S=u.containerInfo,g=u.pendingChildren;try{eg(S,g)}catch(Mt){zn(c,c.return,Mt)}}}Sl&&(Sl=!1,Tm(c));break;case 4:zs?(g=fs,fs=Ud(c.stateNode.containerInfo),rs(u,c),_s(c),fs=g):(rs(u,c),_s(c)),S&4&&Ps&&F_(c.stateNode,c,c.stateNode.pendingChildren);break;case 12:rs(u,c),_s(c);break;case 13:rs(u,c),_s(c),c.child.flags&8192&&c.memoizedState!==null!=(g!==null&&g.memoizedState!==null)&&(to=Va()),S&4&&(S=c.updateQueue,S!==null&&(c.updateQueue=null,Mf(c,S)));break;case 22:S&512&&(Hi||g===null||Bi(g,g.return)),C=c.memoizedState!==null;var q=g!==null&&g.memoizedState!==null,se=Aa,Se=Hi;if(Aa=se||C,Hi=Se||q,rs(u,c),Hi=Se,Aa=se,_s(c),u=c.stateNode,u._current=c,u._visibility&=-3,u._visibility|=u._pendingVisibility&2,S&8192&&(u._visibility=C?u._visibility&-2:u._visibility|1,C&&(u=Aa||Hi,g===null||q||u||Zc(c)),Ga&&(c.memoizedProps===null||c.memoizedProps.mode!=="manual"))){e:if(g=null,Ga)for(u=c;;){if(u.tag===5||zs&&u.tag===26||za&&u.tag===27){if(g===null){q=g=u;try{B=q.stateNode,C?Ff(B):Zm(q.stateNode,q.memoizedProps)}catch(Mt){zn(q,q.return,Mt)}}}else if(u.tag===6){if(g===null){q=u;try{var Je=q.stateNode;C?Cd(Je):Ro(Je,q.memoizedProps)}catch(Mt){zn(q,q.return,Mt)}}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===c)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===c)break e;for(;u.sibling===null;){if(u.return===null||u.return===c)break e;g===u&&(g=null),u=u.return}g===u&&(g=null),u.sibling.return=u.return,u=u.sibling}}S&4&&(S=c.updateQueue,S!==null&&(g=S.retryQueue,g!==null&&(S.retryQueue=null,Mf(c,g))));break;case 19:rs(u,c),_s(c),S&4&&(S=c.updateQueue,S!==null&&(c.updateQueue=null,Mf(c,S)));break;case 21:break;default:rs(u,c),_s(c)}}function _s(c){var u=c.flags;if(u&2){try{if(Ga&&(!za||c.tag!==27)){e:{for(var g=c.return;g!==null;){if(Em(g)){var S=g;break e}g=g.return}throw Error(i(160))}switch(S.tag){case 27:if(za){var C=S.stateNode,B=od(c);qc(c,B,C);break}case 5:var q=S.stateNode;S.flags&32&&(If(q),S.flags&=-33);var se=od(c);qc(c,se,q);break;case 3:case 4:var Se=S.stateNode.containerInfo,Je=od(c);ld(c,Je,Se);break;default:throw Error(i(161))}}}catch(Mt){zn(c,c.return,Mt)}c.flags&=-3}u&4096&&(c.flags&=-4097)}function Tm(c){if(c.subtreeFlags&1024)for(c=c.child;c!==null;){var u=c;Tm(u),u.tag===5&&u.flags&1024&&yi(u.stateNode),c=c.sibling}}function zr(c,u){if(u.subtreeFlags&8772)for(u=u.child;u!==null;)cd(c,u.alternate,u),u=u.sibling}function Zc(c){for(c=c.child;c!==null;){var u=c;switch(u.tag){case 0:case 11:case 14:case 15:$o(4,u,u.return),Zc(u);break;case 1:Bi(u,u.return);var g=u.stateNode;typeof g.componentWillUnmount=="function"&&I_(u,u.return,g),Zc(u);break;case 26:case 27:case 5:Bi(u,u.return),Zc(u);break;case 22:Bi(u,u.return),u.memoizedState===null&&Zc(u);break;default:Zc(u)}c=c.sibling}}function nl(c,u,g){for(g=g&&(u.subtreeFlags&8772)!==0,u=u.child;u!==null;){var S=u.alternate,C=c,B=u,q=B.flags;switch(B.tag){case 0:case 11:case 15:nl(C,B,g),Sf(4,B);break;case 1:if(nl(C,B,g),S=B,C=S.stateNode,typeof C.componentDidMount=="function")try{C.componentDidMount()}catch(Je){zn(S,S.return,Je)}if(S=B,C=S.updateQueue,C!==null){var se=S.stateNode;try{var Se=C.shared.hiddenCallbacks;if(Se!==null)for(C.shared.hiddenCallbacks=null,C=0;C<Se.length;C++)de(Se[C],se)}catch(Je){zn(S,S.return,Je)}}g&&q&64&&O_(B),ql(B,B.return);break;case 26:case 27:case 5:nl(C,B,g),g&&S===null&&q&4&&Jc(B),ql(B,B.return);break;case 12:nl(C,B,g);break;case 13:nl(C,B,g),g&&q&4&&el(C,B);break;case 22:B.memoizedState===null&&nl(C,B,g),ql(B,B.return);break;default:nl(C,B,g)}u=u.sibling}}function Cm(c,u){var g=null;c!==null&&c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(g=c.memoizedState.cachePool.pool),c=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(c=u.memoizedState.cachePool.pool),c!==g&&(c!=null&&c.refCount++,g!=null&&Vc(g))}function fd(c,u){c=null,u.alternate!==null&&(c=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==c&&(u.refCount++,c!=null&&Vc(c))}function _o(c,u,g,S){if(u.subtreeFlags&10256)for(u=u.child;u!==null;)hd(c,u,g,S),u=u.sibling}function hd(c,u,g,S){var C=u.flags;switch(u.tag){case 0:case 11:case 15:_o(c,u,g,S),C&2048&&Sf(9,u);break;case 3:_o(c,u,g,S),C&2048&&(c=null,u.alternate!==null&&(c=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==c&&(u.refCount++,c!=null&&Vc(c)));break;case 12:if(C&2048){_o(c,u,g,S),c=u.stateNode;try{var B=u.memoizedProps,q=B.id,se=B.onPostCommit;typeof se=="function"&&se(q,u.alternate===null?"mount":"update",c.passiveEffectDuration,-0)}catch(Se){zn(u,u.return,Se)}}else _o(c,u,g,S);break;case 23:break;case 22:B=u.stateNode,u.memoizedState!==null?B._visibility&4?_o(c,u,g,S):il(c,u):B._visibility&4?_o(c,u,g,S):(B._visibility|=4,Za(c,u,g,S,(u.subtreeFlags&10256)!==0)),C&2048&&Cm(u.alternate,u);break;case 24:_o(c,u,g,S),C&2048&&fd(u.alternate,u);break;default:_o(c,u,g,S)}}function Za(c,u,g,S,C){for(C=C&&(u.subtreeFlags&10256)!==0,u=u.child;u!==null;){var B=c,q=u,se=g,Se=S,Je=q.flags;switch(q.tag){case 0:case 11:case 15:Za(B,q,se,Se,C),Sf(8,q);break;case 23:break;case 22:var Mt=q.stateNode;q.memoizedState!==null?Mt._visibility&4?Za(B,q,se,Se,C):il(B,q):(Mt._visibility|=4,Za(B,q,se,Se,C)),C&&Je&2048&&Cm(q.alternate,q);break;case 24:Za(B,q,se,Se,C),C&&Je&2048&&fd(q.alternate,q);break;default:Za(B,q,se,Se,C)}u=u.sibling}}function il(c,u){if(u.subtreeFlags&10256)for(u=u.child;u!==null;){var g=c,S=u,C=S.flags;switch(S.tag){case 22:il(g,S),C&2048&&Cm(S.alternate,S);break;case 24:il(g,S),C&2048&&fd(S.alternate,S);break;default:il(g,S)}u=u.sibling}}function Ta(c){if(c.subtreeFlags&cc)for(c=c.child;c!==null;)Kl(c),c=c.sibling}function Kl(c){switch(c.tag){case 26:Ta(c),c.flags&cc&&(c.memoizedState!==null?dg(fs,c.memoizedState,c.memoizedProps):Xi(c.type,c.memoizedProps));break;case 5:Ta(c),c.flags&cc&&Xi(c.type,c.memoizedProps);break;case 3:case 4:if(zs){var u=fs;fs=Ud(c.stateNode.containerInfo),Ta(c),fs=u}else Ta(c);break;case 22:c.memoizedState===null&&(u=c.alternate,u!==null&&u.memoizedState!==null?(u=cc,cc=16777216,Ta(c),cc=u):Ta(c));break;default:Ta(c)}}function dd(c){var u=c.alternate;if(u!==null&&(c=u.child,c!==null)){u.child=null;do u=c.sibling,c.sibling=null,c=u;while(c!==null)}}function al(c){var u=c.deletions;if((c.flags&16)!==0){if(u!==null)for(var g=0;g<u.length;g++){var S=u[g];Wi=S,sl(S,c)}dd(c)}if(c.subtreeFlags&10256)for(c=c.child;c!==null;)bf(c),c=c.sibling}function bf(c){switch(c.tag){case 0:case 11:case 15:al(c),c.flags&2048&&$o(9,c,c.return);break;case 3:al(c);break;case 12:al(c);break;case 22:var u=c.stateNode;c.memoizedState!==null&&u._visibility&4&&(c.return===null||c.return.tag!==13)?(u._visibility&=-5,Qc(c)):al(c);break;default:al(c)}}function Qc(c){var u=c.deletions;if((c.flags&16)!==0){if(u!==null)for(var g=0;g<u.length;g++){var S=u[g];Wi=S,sl(S,c)}dd(c)}for(c=c.child;c!==null;){switch(u=c,u.tag){case 0:case 11:case 15:$o(8,u,u.return),Qc(u);break;case 22:g=u.stateNode,g._visibility&4&&(g._visibility&=-5,Qc(u));break;default:Qc(u)}c=c.sibling}}function sl(c,u){for(;Wi!==null;){var g=Wi;switch(g.tag){case 0:case 11:case 15:$o(8,g,u);break;case 23:case 22:if(g.memoizedState!==null&&g.memoizedState.cachePool!==null){var S=g.memoizedState.cachePool.pool;S!=null&&S.refCount++}break;case 24:Vc(g.memoizedState.cache)}if(S=g.child,S!==null)S.return=g,Wi=S;else e:for(g=c;Wi!==null;){S=Wi;var C=S.sibling,B=S.return;if(Wc(S),S===g){Wi=null;break e}if(C!==null){C.return=B,Wi=C;break e}Wi=B}}}function pd(c){var u=km(c);if(u!=null){if(typeof u.memoizedProps["data-testname"]!="string")throw Error(i(364));return u}if(c=ic(c),c===null)throw Error(i(362));return c.stateNode.current}function $c(c,u){var g=c.tag;switch(u.$$typeof){case Qf:if(c.type===u.value)return!0;break;case Yd:e:{for(u=u.value,c=[c,0],g=0;g<c.length;){var S=c[g++],C=S.tag,B=c[g++],q=u[B];if(C!==5&&C!==26&&C!==27||!jr(S)){for(;q!=null&&$c(S,q);)B++,q=u[B];if(B===u.length){u=!0;break e}else for(S=S.child;S!==null;)c.push(S,B),S=S.sibling}}u=!1}return u;case Jd:if((g===5||g===26||g===27)&&qS(c.stateNode,u.value))return!0;break;case fi:if((g===5||g===6||g===26||g===27)&&(c=Of(c),c!==null&&0<=c.indexOf(u.value)))return!0;break;case jn:if((g===5||g===26||g===27)&&(c=c.memoizedProps["data-testname"],typeof c=="string"&&c.toLowerCase()===u.value.toLowerCase()))return!0;break;default:throw Error(i(365))}return!1}function rl(c){switch(c.$$typeof){case Qf:return"<"+(l(c.value)||"Unknown")+">";case Yd:return":has("+(rl(c)||"")+")";case Jd:return'[role="'+c.value+'"]';case fi:return'"'+c.value+'"';case jn:return'[data-testname="'+c.value+'"]';default:throw Error(i(365))}}function H_(c,u){var g=[];c=[c,0];for(var S=0;S<c.length;){var C=c[S++],B=C.tag,q=c[S++],se=u[q];if(B!==5&&B!==26&&B!==27||!jr(C)){for(;se!=null&&$c(C,se);)q++,se=u[q];if(q===u.length)g.push(C);else for(C=C.child;C!==null;)c.push(C,q),C=C.sibling}}return g}function os(c,u){if(!Wr)throw Error(i(363));c=pd(c),c=H_(c,u),u=[],c=Array.from(c);for(var g=0;g<c.length;){var S=c[g++],C=S.tag;if(C===5||C===26||C===27)jr(S)||u.push(S.stateNode);else for(S=S.child;S!==null;)c.push(S),S=S.sibling}return u}function ls(){if((rn&2)!==0&&Un!==0)return Un&-Un;if(hn.T!==null){var c=bs;return c!==0?c:Xe()}return sr()}function Vr(){Cs===0&&(Cs=(Un&536870912)===0||ni?V():536870912);var c=Ks.current;return c!==null&&(c.flags|=32),Cs}function Qa(c,u,g){(c===Fn&&xi===2||c.cancelPendingCommit!==null)&&(Mr(c,0),Sr(c,Un,Cs,!1)),K(c,g),((rn&2)===0||c!==Fn)&&(c===Fn&&((rn&2)===0&&(Br|=g),Zn===4&&Sr(c,Un,Cs,!1)),_t(c))}function Ef(c,u,g){if((rn&6)!==0)throw Error(i(327));var S=!g&&(u&60)===0&&(u&c.expiredLanes)===0||O(c,u),C=S?Yr(c,u):kr(c,u,!0),B=S;do{if(C===0){Ws&&!S&&Sr(c,u,0,!1);break}else if(C===6)Sr(c,u,0,!hi);else{if(g=c.current.alternate,B&&!P_(g)){C=kr(c,u,!1),B=!1;continue}if(C===2){if(B=u,c.errorRecoveryDisabledLanes&B)var q=0;else q=c.pendingLanes&-536870913,q=q!==0?q:q&536870912?536870912:0;if(q!==0){u=q;e:{var se=c;C=gu;var Se=cs&&se.current.memoizedState.isDehydrated;if(Se&&(Mr(se,q).flags|=256),q=kr(se,q,!1),q!==2){if(Uo&&!Se){se.errorRecoveryDisabledLanes|=B,Br|=B,C=4;break e}B=Zs,Zs=C,B!==null&&yo(B)}C=q}if(B=!1,C!==2)continue}}if(C===1){Mr(c,0),Sr(c,u,0,!0);break}e:{switch(S=c,C){case 0:case 1:throw Error(i(345));case 4:if((u&4194176)===u){Sr(S,u,Cs,!hi);break e}break;case 2:Zs=null;break;case 3:case 5:break;default:throw Error(i(329))}if(S.finishedWork=g,S.finishedLanes=u,(u&62914560)===u&&(B=to+300-Va(),10<B)){if(Sr(S,u,Cs,!hi),P(S,0)!==0)break e;S.timeoutHandle=Vm(md.bind(null,S,g,Zs,Dr,vu,u,Cs,Br,Oo,hi,2,-0,0),B);break e}md(S,g,Zs,Dr,vu,u,Cs,Br,Oo,hi,0,-0,0)}}break}while(!0);_t(c)}function yo(c){Zs===null?Zs=c:Zs.push.apply(Zs,c)}function md(c,u,g,S,C,B,q,se,Se,Je,Mt,Gt,kt){var An=u.subtreeFlags;if((An&8192||(An&16785408)===16785408)&&(Gs(),Kl(u),u=bd(),u!==null)){c.cancelPendingCommit=u(Si.bind(null,c,g,S,C,q,se,Se,1,Gt,kt)),Sr(c,B,q,!Je);return}Si(c,g,S,C,q,se,Se,Mt,Gt,kt)}function P_(c){for(var u=c;;){var g=u.tag;if((g===0||g===11||g===15)&&u.flags&16384&&(g=u.updateQueue,g!==null&&(g=g.stores,g!==null)))for(var S=0;S<g.length;S++){var C=g[S],B=C.getSnapshot;C=C.value;try{if(!Vs(B(),C))return!1}catch{return!1}}if(g=u.child,u.subtreeFlags&16384&&g!==null)g.return=u,u=g;else{if(u===c)break;for(;u.sibling===null;){if(u.return===null||u.return===c)return!0;u=u.return}u.sibling.return=u.return,u=u.sibling}}return!0}function Sr(c,u,g,S){u&=~as,u&=~Br,c.suspendedLanes|=u,c.pingedLanes&=~u,S&&(c.warmLanes|=u),S=c.expirationTimes;for(var C=u;0<C;){var B=31-Ss(C),q=1<<B;S[B]=-1,C&=~q}g!==0&&ee(c,g,u)}function Rm(){return(rn&6)===0?(Ft(0),!1):!0}function ys(){if(Sn!==null){if(xi===0)var c=Sn.return;else c=Sn,Ki=Al=null,nt(c),Qr=null,lr=0,c=Sn;for(;c!==null;)Mm(c.alternate,c),c=c.return;Sn=null}}function Mr(c,u){c.finishedWork=null,c.finishedLanes=0;var g=c.timeoutHandle;g!==nc&&(c.timeoutHandle=nc,Uf(g)),g=c.cancelPendingCommit,g!==null&&(c.cancelPendingCommit=null,g()),ys(),Fn=c,Sn=g=$a(c.current,null),Un=u,xi=0,aa=null,hi=!1,Ws=O(c,u),Uo=!1,Oo=Cs=as=Br=js=Zn=0,Zs=gu=null,vu=!1,(u&8)!==0&&(u|=u&32);var S=c.entangledLanes;if(S!==0)for(c=c.entanglements,S&=u;0<S;){var C=31-Ss(S),B=1<<C;u|=c[C],S&=~B}return wr=u,me(),g}function Wl(c,u){Rn=null,hn.H=ii,u===mi?(u=ft(),xi=3):u===vg?(u=ft(),xi=4):xi=u===_y?8:u!==null&&typeof u=="object"&&typeof u.then=="function"?6:1,aa=u,Sn===null&&(Zn=1,ed(c,ye(u,c.current)))}function Tf(){var c=Ks.current;return c===null?!0:(Un&4194176)===Un?cr===null:(Un&62914560)===Un||(Un&536870912)!==0?c===cr:!1}function eu(){var c=hn.H;return hn.H=ii,c===null?ii:c}function Hs(){var c=hn.A;return hn.A=Xd,c}function xs(){Zn=4,hi||(Un&4194176)!==Un&&Ks.current!==null||(Ws=!0),(js&134217727)===0&&(Br&134217727)===0||Fn===null||Sr(Fn,Un,Cs,!1)}function kr(c,u,g){var S=rn;rn|=2;var C=eu(),B=Hs();(Fn!==c||Un!==u)&&(Dr=null,Mr(c,u)),u=!1;var q=Zn;e:do try{if(xi!==0&&Sn!==null){var se=Sn,Se=aa;switch(xi){case 8:ys(),q=6;break e;case 3:case 2:case 6:Ks.current===null&&(u=!0);var Je=xi;if(xi=0,aa=null,ol(c,se,Se,Je),g&&Ws){q=0;break e}break;default:Je=xi,xi=0,aa=null,ol(c,se,Se,Je)}}Xr(),q=Zn;break}catch(Mt){Wl(c,Mt)}while(!0);return u&&c.shellSuspendCounter++,Ki=Al=null,rn=S,hn.H=C,hn.A=B,Sn===null&&(Fn=null,Un=0,me()),q}function Xr(){for(;Sn!==null;)wm(Sn)}function Yr(c,u){var g=rn;rn|=2;var S=eu(),C=Hs();Fn!==c||Un!==u?(Dr=null,Pi=Va()+500,Mr(c,u)):Ws=O(c,u);e:do try{if(xi!==0&&Sn!==null){u=Sn;var B=aa;t:switch(xi){case 1:xi=0,aa=null,ol(c,u,B,1);break;case 2:if(St(B)){xi=0,aa=null,gd(u);break}u=function(){xi===2&&Fn===c&&(xi=7),_t(c)},B.then(u,u);break e;case 3:xi=7;break e;case 4:xi=5;break e;case 7:St(B)?(xi=0,aa=null,gd(u)):(xi=0,aa=null,ol(c,u,B,7));break;case 5:var q=null;switch(Sn.tag){case 26:q=Sn.memoizedState;case 5:case 27:var se=Sn,Se=se.type,Je=se.pendingProps;if(q?hg(q):Co(Se,Je)){xi=0,aa=null;var Mt=se.sibling;if(Mt!==null)Sn=Mt;else{var Gt=se.return;Gt!==null?(Sn=Gt,Cf(Gt)):Sn=null}break t}}xi=0,aa=null,ol(c,u,B,5);break;case 6:xi=0,aa=null,ol(c,u,B,6);break;case 8:ys(),Zn=6;break e;default:throw Error(i(462))}}xo();break}catch(kt){Wl(c,kt)}while(!0);return Ki=Al=null,hn.H=S,hn.A=C,rn=g,Sn!==null?0:(Fn=null,Un=0,me(),Zn)}function xo(){for(;Sn!==null&&!dy();)wm(Sn)}function wm(c){var u=D_(c.alternate,c,wr);c.memoizedProps=c.pendingProps,u===null?Cf(c):Sn=u}function gd(c){var u=c,g=u.alternate;switch(u.tag){case 15:case 0:u=T_(g,u,u.pendingProps,u.type,void 0,Un);break;case 11:u=T_(g,u,u.pendingProps,u.type.render,u.ref,Un);break;case 5:nt(u);default:Mm(g,u),u=Sn=Mo(u,wr),u=D_(g,u,wr)}c.memoizedProps=c.pendingProps,u===null?Cf(c):Sn=u}function ol(c,u,g,S){Ki=Al=null,nt(u),Qr=null,lr=0;var C=u.return;try{if(A_(c,C,u,g,Un)){Zn=1,ed(c,ye(g,c.current)),Sn=null;return}}catch(B){if(C!==null)throw Sn=C,B;Zn=1,ed(c,ye(g,c.current)),Sn=null;return}u.flags&32768?(ni||S===1?c=!0:Ws||(Un&536870912)!==0?c=!1:(hi=c=!0,(S===2||S===3||S===6)&&(S=Ks.current,S!==null&&S.tag===13&&(S.flags|=16384))),Ca(u,c)):Cf(u)}function Cf(c){var u=c;do{if((u.flags&32768)!==0){Ca(u,hi);return}c=u.return;var g=N_(u.alternate,u,wr);if(g!==null){Sn=g;return}if(u=u.sibling,u!==null){Sn=u;return}Sn=u=c}while(u!==null);Zn===0&&(Zn=5)}function Ca(c,u){do{var g=U_(c.alternate,c);if(g!==null){g.flags&=32767,Sn=g;return}if(g=c.return,g!==null&&(g.flags|=32768,g.subtreeFlags=0,g.deletions=null),!u&&(c=c.sibling,c!==null)){Sn=c;return}Sn=c=g}while(c!==null);Zn=6,Sn=null}function Si(c,u,g,S,C,B,q,se,Se,Je){var Mt=hn.T,Gt=xa();try{es(2),hn.T=null,Jn(c,u,g,S,Gt,C,B,q,se,Se,Je)}finally{hn.T=Mt,es(Gt)}}function Jn(c,u,g,S,C,B,q,se){do Ra();while(Io!==null);if((rn&6)!==0)throw Error(i(327));var Se=c.finishedWork;if(S=c.finishedLanes,Se===null)return null;if(c.finishedWork=null,c.finishedLanes=0,Se===c.current)throw Error(i(177));c.callbackNode=null,c.callbackPriority=0,c.cancelPendingCommit=null;var Je=Se.lanes|Se.childLanes;if(Je|=fu,ne(c,S,Je,B,q,se),c===Fn&&(Sn=Fn=null,Un=0),(Se.subtreeFlags&10256)===0&&(Se.flags&10256)===0||fr||(fr=!0,qd=Je,fc=g,Rf(Id,function(){return Ra(),null})),g=(Se.flags&15990)!==0,(Se.subtreeFlags&15990)!==0||g?(g=hn.T,hn.T=null,B=xa(),es(2),q=rn,rn|=4,Kc(c,Se),tl(Se,c),Gm(c.containerInfo),c.current=Se,cd(c,Se.alternate,Se),py(),rn=q,es(B),hn.T=g):c.current=Se,fr?(fr=!1,Io=c,uc=S):Ao(c,Je),Je=c.pendingLanes,Je===0&&(Qs=null),H(Se.stateNode),_t(c),u!==null)for(C=c.onRecoverableError,Se=0;Se<u.length;Se++)Je=u[Se],C(Je.value,{componentStack:Je.stack});return(uc&3)!==0&&Ra(),Je=c.pendingLanes,(S&4194218)!==0&&(Je&42)!==0?c===hs?hc++:(hc=0,hs=c):hc=0,Ft(0),null}function Ao(c,u){(c.pooledCacheLanes&=u)===0&&(u=c.pooledCache,u!=null&&(c.pooledCache=null,Vc(u)))}function Ra(){if(Io!==null){var c=Io,u=qd;qd=0;var g=he(uc),S=32>g?32:g;g=hn.T;var C=xa();try{if(es(S),hn.T=null,Io===null)var B=!1;else{S=fc,fc=null;var q=Io,se=uc;if(Io=null,uc=0,(rn&6)!==0)throw Error(i(331));var Se=rn;if(rn|=4,bf(q.current),hd(q,q.current,se,S),rn=Se,Ft(0,!1),Ms&&typeof Ms.onPostCommitFiberRoot=="function")try{Ms.onPostCommitFiberRoot(cu,q)}catch{}B=!0}return B}finally{es(C),hn.T=g,Ao(c,u)}}return!1}function vd(c,u,g){u=ye(g,u),u=gf(c.stateNode,u,2),c=qe(c,u,2),c!==null&&(K(c,2),_t(c))}function zn(c,u,g){if(c.tag===3)vd(c,c,g);else for(;u!==null;){if(u.tag===3){vd(u,c,g);break}else if(u.tag===1){var S=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof S.componentDidCatch=="function"&&(Qs===null||!Qs.has(S))){c=ye(g,c),g=zc(2),S=qe(u,g,2),S!==null&&(vf(g,S,u,c),K(S,2),_t(S));break}}u=u.return}}function _d(c,u,g){var S=c.pingCache;if(S===null){S=c.pingCache=new Vn;var C=new Set;S.set(u,C)}else C=S.get(u),C===void 0&&(C=new Set,S.set(u,C));C.has(g)||(Uo=!0,C.add(g),c=G_.bind(null,c,u,g),u.then(c,c))}function G_(c,u,g){var S=c.pingCache;S!==null&&S.delete(u),c.pingedLanes|=c.suspendedLanes&g,c.warmLanes&=~g,Fn===c&&(Un&g)===g&&(Zn===4||Zn===3&&(Un&62914560)===Un&&300>Va()-to?(rn&2)===0&&Mr(c,0):as|=g,Oo===Un&&(Oo=0)),_t(c)}function jl(c,u){u===0&&(u=N()),c=rt(c,u),c!==null&&(K(c,u),_t(c))}function Zl(c){var u=c.memoizedState,g=0;u!==null&&(g=u.retryLane),jl(c,g)}function Bm(c,u){var g=0;switch(c.tag){case 13:var S=c.stateNode,C=c.memoizedState;C!==null&&(g=C.retryLane);break;case 19:S=c.stateNode;break;case 22:S=c.stateNode._retryCache;break;default:throw Error(i(314))}S!==null&&S.delete(u),jl(c,g)}function Rf(c,u){return lu(c,u)}function Dm(c,u,g,S){this.tag=c,this.key=g,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=u,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=S,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function So(c){return c=c.prototype,!(!c||!c.isReactComponent)}function $a(c,u){var g=c.alternate;return g===null?(g=t(c.tag,u,c.key,c.mode),g.elementType=c.elementType,g.type=c.type,g.stateNode=c.stateNode,g.alternate=c,c.alternate=g):(g.pendingProps=u,g.type=c.type,g.flags=0,g.subtreeFlags=0,g.deletions=null),g.flags=c.flags&31457280,g.childLanes=c.childLanes,g.lanes=c.lanes,g.child=c.child,g.memoizedProps=c.memoizedProps,g.memoizedState=c.memoizedState,g.updateQueue=c.updateQueue,u=c.dependencies,g.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},g.sibling=c.sibling,g.index=c.index,g.ref=c.ref,g.refCleanup=c.refCleanup,g}function Mo(c,u){c.flags&=31457282;var g=c.alternate;return g===null?(c.childLanes=0,c.lanes=u,c.child=null,c.subtreeFlags=0,c.memoizedProps=null,c.memoizedState=null,c.updateQueue=null,c.dependencies=null,c.stateNode=null):(c.childLanes=g.childLanes,c.lanes=g.lanes,c.child=g.child,c.subtreeFlags=0,c.deletions=null,c.memoizedProps=g.memoizedProps,c.memoizedState=g.memoizedState,c.updateQueue=g.updateQueue,c.type=g.type,u=g.dependencies,c.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext}),c}function ar(c,u,g,S,C,B){var q=0;if(S=c,typeof c=="function")So(c)&&(q=1);else if(typeof c=="string")q=zs&&za?sg(c,g,Ba.current)?26:ru(c)?27:5:zs?sg(c,g,Ba.current)?26:5:za&&ru(c)?27:5;else e:switch(c){case nu:return bo(g.children,C,B,u);case Im:q=8,C|=24;break;case Fm:return c=t(12,g,u,C|2),c.elementType=Fm,c.lanes=B,c;case xd:return c=t(13,g,u,C),c.elementType=xd,c.lanes=B,c;case ul:return c=t(19,g,u,C),c.elementType=ul,c.lanes=B,c;case Df:return yd(g,C,B,u);default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case k_:case Jr:q=10;break e;case cl:q=9;break e;case iu:q=11;break e;case Bf:q=14;break e;case Er:q=16,S=null;break e}q=29,g=Error(i(130,c===null?"null":typeof c,"")),S=null}return u=t(q,g,u,C),u.elementType=c,u.type=S,u.lanes=B,u}function bo(c,u,g,S){return c=t(7,c,S,u),c.lanes=g,c}function yd(c,u,g,S){c=t(22,c,S,u),c.elementType=Df,c.lanes=g;var C={_visibility:1,_pendingVisibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null,_current:null,detach:function(){var B=C._current;if(B===null)throw Error(i(456));if((C._pendingVisibility&2)===0){var q=rt(B,2);q!==null&&(C._pendingVisibility|=2,Qa(q,B,2))}},attach:function(){var B=C._current;if(B===null)throw Error(i(456));if((C._pendingVisibility&2)!==0){var q=rt(B,2);q!==null&&(C._pendingVisibility&=-3,Qa(q,B,2))}}};return c.stateNode=C,c}function ll(c,u,g){return c=t(6,c,null,u),c.lanes=g,c}function tu(c,u,g){return u=t(4,c.children!==null?c.children:[],c.key,u),u.lanes=g,u.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},u}function Ql(c,u,g,S,C,B,q,se){this.tag=1,this.containerInfo=c,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=nc,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=F(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.finishedLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=F(0),this.hiddenUpdates=F(null),this.identifierPrefix=S,this.onUncaughtError=C,this.onCaughtError=B,this.onRecoverableError=q,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=se,this.incompleteTransitions=new Map}function wa(c,u,g,S,C,B,q,se,Se,Je,Mt,Gt){return c=new Ql(c,u,g,q,se,Se,Je,Gt),u=1,B===!0&&(u|=24),B=t(3,null,null,u),c.current=B,B.stateNode=c,u=ad(),u.refCount++,c.pooledCache=u,u.refCount++,B.memoizedState={element:S,isDehydrated:g,cache:u},Ht(B),c}function wf(c){return c?(c=ac,c):ac}function Lm(c){var u=c._reactInternals;if(u===void 0)throw typeof c.render=="function"?Error(i(188)):(c=Object.keys(c).join(","),Error(i(268,c)));return c=x(u),c=c!==null?b(c):null,c===null?null:au(c.stateNode)}function z_(c,u,g,S,C,B){C=wf(C),S.context===null?S.context=C:S.pendingContext=C,S=ze(u),S.payload={element:g},B=B===void 0?null:B,B!==null&&(S.callback=B),g=qe(c,S,u),g!==null&&(Qa(g,c,u),Tt(g,c,u))}function V_(c,u){if(c=c.memoizedState,c!==null&&c.dehydrated!==null){var g=c.retryLane;c.retryLane=g!==0&&g<u?g:u}}function Nm(c,u){V_(c,u),(c=c.alternate)&&V_(c,u)}var sn={},Um=eh(),Pa=XU(),$l=Object.assign,Om=Symbol.for("react.element"),Eo=Symbol.for("react.transitional.element"),br=Symbol.for("react.portal"),nu=Symbol.for("react.fragment"),Im=Symbol.for("react.strict_mode"),Fm=Symbol.for("react.profiler"),k_=Symbol.for("react.provider"),cl=Symbol.for("react.consumer"),Jr=Symbol.for("react.context"),iu=Symbol.for("react.forward_ref"),xd=Symbol.for("react.suspense"),ul=Symbol.for("react.suspense_list"),Bf=Symbol.for("react.memo"),Er=Symbol.for("react.lazy"),Df=Symbol.for("react.offscreen"),X_=Symbol.for("react.memo_cache_sentinel"),Hm=Symbol.iterator,ec=Symbol.for("react.client.reference"),hn=Um.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ad,Pm,fl=!1,hl=Array.isArray,Sd=e.rendererVersion,Lf=e.rendererPackageName,Nf=e.extraDevToolsConfig,au=e.getPublicInstance,tc=e.getRootHostContext,Y_=e.getChildHostContext,dl=e.prepareForCommit,Gm=e.resetAfterCommit,zm=e.createInstance,qr=e.appendInitialChild,To=e.finalizeInitialChildren,pl=e.shouldSetTextContent,Md=e.createTextInstance,Vm=e.scheduleTimeout,Uf=e.cancelTimeout,nc=e.noTimeout,Kr=e.isPrimaryRenderer;e.warnsIfNotActing;var Ga=e.supportsMutation,Ps=e.supportsPersistence,cs=e.supportsHydration,km=e.getInstanceFromNode;e.beforeActiveInstanceBlur,e.afterActiveInstanceBlur;var Xm=e.preparePortalMount;e.prepareScopeUpdate,e.getInstanceFromScope;var es=e.setCurrentUpdatePriority,xa=e.getCurrentUpdatePriority,sr=e.resolveUpdatePriority;e.resolveEventType,e.resolveEventTimeStamp;var ml=e.shouldAttemptEagerTransition,Ym=e.detachDeletedInstance;e.requestPostPaintCallback;var J_=e.maySuspendCommit,Co=e.preloadInstance,Gs=e.startSuspendingCommit,Xi=e.suspendInstance,bd=e.waitForCommitToBeReady,As=e.NotPendingTransition,gn=e.HostTransitionContext,yi=e.resetFormInstance;e.bindToConsole;var da=e.supportsMicrotasks,Ed=e.scheduleMicrotask,Wr=e.supportsTestSelectors,ic=e.findFiberRoot,Td=e.getBoundingRect,Of=e.getTextContent,jr=e.isHiddenSubtree,qS=e.matchAccessibilityRole,Yi=e.setFocusIfFocusable,Jm=e.setupIntersectionObserver,qm=e.appendChild,q_=e.appendChildToContainer,K_=e.commitTextUpdate,KS=e.commitMount,Km=e.commitUpdate,Wm=e.insertBefore,jm=e.insertInContainerBefore,us=e.removeChild,ea=e.removeChildFromContainer,If=e.resetTextContent,Ff=e.hideInstance,Cd=e.hideTextInstance,Zm=e.unhideInstance,Ro=e.unhideTextInstance,Rd=e.clearContainer,Qm=e.cloneInstance,wd=e.createContainerChildSet,$m=e.appendChildToContainerChildSet,W_=e.finalizeContainerChildren,eg=e.replaceContainerChildren,tg=e.cloneHiddenInstance,ng=e.cloneHiddenTextInstance,Bd=e.isSuspenseInstancePending,Hf=e.isSuspenseInstanceFallback,j_=e.getSuspenseInstanceFallbackErrorDetails,WS=e.registerSuspenseInstanceRetry,Z_=e.canHydrateFormStateMarker,Q_=e.isFormStateMarkerMatching,ig=e.getNextHydratableSibling,Dd=e.getFirstHydratableChild,$_=e.getFirstHydratableChildWithinContainer,ey=e.getFirstHydratableChildWithinSuspenseInstance,ty=e.canHydrateInstance,ny=e.canHydrateTextInstance,iy=e.canHydrateSuspenseInstance,jS=e.hydrateInstance,ay=e.hydrateTextInstance,su=e.hydrateSuspenseInstance,sy=e.getNextHydratableInstanceAfterSuspenseInstance,Ld=e.commitHydratedContainer,Nd=e.commitHydratedSuspenseInstance,ry=e.clearSuspenseBoundary,ag=e.clearSuspenseBoundaryFromContainer,oy=e.shouldDeleteUnhydratedTailInstances;e.diffHydratedPropsForDevWarnings,e.diffHydratedTextForDevWarnings,e.describeHydratableInstanceForDevWarnings;var ly=e.validateHydratableInstance,cy=e.validateHydratableTextInstance,zs=e.supportsResources,sg=e.isHostHoistableType,Ud=e.getHoistableRoot,Od=e.getResource,rg=e.acquireResource,og=e.releaseResource,lg=e.hydrateHoistable,cg=e.mountHoistable,ug=e.unmountHoistable,ZS=e.createHoistableInstance,fg=e.prepareToCommitHoistables,uy=e.mayResourceSuspendCommit,hg=e.preloadResource,dg=e.suspendResource,za=e.supportsSingletons,pg=e.resolveSingletonInstance,QS=e.clearSingleton,$S=e.acquireSingletonInstance,fy=e.releaseSingletonInstance,ru=e.isHostSingletonType,Pf=[],wo=-1,ac={},Ss=Math.clz32?Math.clz32:D,Gf=Math.log,hy=Math.LN2,ou=128,zf=4194304,lu=Pa.unstable_scheduleCallback,Vf=Pa.unstable_cancelCallback,dy=Pa.unstable_shouldYield,py=Pa.unstable_requestPaint,Va=Pa.unstable_now,mg=Pa.unstable_ImmediatePriority,my=Pa.unstable_UserBlockingPriority,Id=Pa.unstable_NormalPriority,Fd=Pa.unstable_IdlePriority,gy=Pa.log,gg=Pa.unstable_setDisableYieldValue,cu=null,Ms=null,Vs=typeof Object.is=="function"?Object.is:$,Hd=new WeakMap,Di=[],Ji=0,kf=null,Xf=0,ks=[],Xs=0,Tr=null,Zr=1,rr="",Ba=T(null),Yf=T(null),Cr=T(null),uu=T(null),ts=null,ka=null,ni=!1,Ys=null,or=!1,Jf=Error(i(519)),Js=[],gl=0,fu=0,hu=null,sc=null,qf=!1,Kf=!1,Rr=!1,vl=0,Wf=null,Pd=0,bs=0,_l=null,Bo=!1,du=!1,jf=Object.prototype.hasOwnProperty,mi=Error(i(460)),vg=Error(i(474)),Gd={then:function(){}},rc=null,Qr=null,lr=0,yl=Nn(!0),_g=Nn(!1),$r=T(null),qs=T(0),Ks=T(null),cr=null,pa=T(0),eo=0,Rn=null,oi=null,ta=null,ur=!1,Li=!1,Do=!1,Zf=0,qi=0,pu=null,vy=0,zd=function(){return{lastEffect:null,events:null,stores:null,memoCache:null}},ii={readContext:Ha,use:ht,useCallback:fn,useContext:fn,useEffect:fn,useImperativeHandle:fn,useLayoutEffect:fn,useInsertionEffect:fn,useMemo:fn,useReducer:fn,useRef:fn,useState:fn,useDebugValue:fn,useDeferredValue:fn,useTransition:fn,useSyncExternalStore:fn,useId:fn};ii.useCacheRefresh=fn,ii.useMemoCache=fn,ii.useHostTransitionStatus=fn,ii.useFormState=fn,ii.useActionState=fn,ii.useOptimistic=fn;var ma={readContext:Ha,use:ht,useCallback:function(c,u){return Ze().memoizedState=[c,u===void 0?null:u],c},useContext:Ha,useEffect:Nt,useImperativeHandle:function(c,u,g){g=g!=null?g.concat([c]):null,ut(4194308,4,En.bind(null,u,c),g)},useLayoutEffect:function(c,u){return ut(4194308,4,c,u)},useInsertionEffect:function(c,u){ut(4,2,c,u)},useMemo:function(c,u){var g=Ze();u=u===void 0?null:u;var S=c();if(Do){Y(!0);try{c()}finally{Y(!1)}}return g.memoizedState=[S,u],S},useReducer:function(c,u,g){var S=Ze();if(g!==void 0){var C=g(u);if(Do){Y(!0);try{g(u)}finally{Y(!1)}}}else C=u;return S.memoizedState=S.baseState=C,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:C},S.queue=c,c=c.dispatch=xr.bind(null,Rn,c),[S.memoizedState,c]},useRef:function(c){var u=Ze();return c={current:c},u.memoizedState=c},useState:function(c){c=At(c);var u=c.queue,g=Qh.bind(null,Rn,u);return u.dispatch=g,[c.memoizedState,g]},useDebugValue:ti,useDeferredValue:function(c,u){var g=Ze();return ha(g,c,u)},useTransition:function(){var c=At(!1);return c=Wa.bind(null,Rn,c.queue,!0,!1),Ze().memoizedState=c,[!1,c]},useSyncExternalStore:function(c,u,g){var S=Rn,C=Ze();if(ni){if(g===void 0)throw Error(i(407));g=g()}else{if(g=u(),Fn===null)throw Error(i(349));(Un&60)!==0||lt(S,u,g)}C.memoizedState=g;var B={value:g,getSnapshot:u};return C.queue=B,Nt(Ct.bind(null,S,B,c),[c]),S.flags|=2048,we(9,ct.bind(null,S,B,g,u),{destroy:void 0},null),g},useId:function(){var c=Ze(),u=Fn.identifierPrefix;if(ni){var g=rr,S=Zr;g=(S&~(1<<32-Ss(S)-1)).toString(32)+g,u=":"+u+"R"+g,g=Zf++,0<g&&(u+="H"+g.toString(32)),u+=":"}else g=vy++,u=":"+u+"r"+g.toString(32)+":";return c.memoizedState=u},useCacheRefresh:function(){return Ze().memoizedState=qo.bind(null,Rn)}};ma.useMemoCache=k,ma.useHostTransitionStatus=ya,ma.useFormState=ei,ma.useActionState=ei,ma.useOptimistic=function(c){var u=Ze();u.memoizedState=u.baseState=c;var g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return u.queue=g,u=$h.bind(null,Rn,!0,g),g.dispatch=u,[c,u]};var ns={readContext:Ha,use:ht,useCallback:Ci,useContext:Ha,useEffect:Vt,useImperativeHandle:Cn,useInsertionEffect:ln,useLayoutEffect:Wn,useMemo:_i,useReducer:fe,useRef:at,useState:function(){return fe(te)},useDebugValue:ti,useDeferredValue:function(c,u){var g=je();return _a(g,oi.memoizedState,c,u)},useTransition:function(){var c=fe(te)[0],u=je().memoizedState;return[typeof c=="boolean"?c:vt(c),u]},useSyncExternalStore:Qe,useId:$i};ns.useCacheRefresh=ir,ns.useMemoCache=k,ns.useHostTransitionStatus=ya,ns.useFormState=Qi,ns.useActionState=Qi,ns.useOptimistic=function(c,u){var g=je();return zt(g,oi,c,u)};var xl={readContext:Ha,use:ht,useCallback:Ci,useContext:Ha,useEffect:Vt,useImperativeHandle:Cn,useInsertionEffect:ln,useLayoutEffect:Wn,useMemo:_i,useReducer:le,useRef:at,useState:function(){return le(te)},useDebugValue:ti,useDeferredValue:function(c,u){var g=je();return oi===null?ha(g,c,u):_a(g,oi.memoizedState,c,u)},useTransition:function(){var c=le(te)[0],u=je().memoizedState;return[typeof c=="boolean"?c:vt(c),u]},useSyncExternalStore:Qe,useId:$i};xl.useCacheRefresh=ir,xl.useMemoCache=k,xl.useHostTransitionStatus=ya,xl.useFormState=ri,xl.useActionState=ri,xl.useOptimistic=function(c,u){var g=je();return oi!==null?zt(g,oi,c,u):(g.baseState=c,[c,g.queue.dispatch])};var Vd={isMounted:function(c){return(c=c._reactInternals)?v(c)===c:!1},enqueueSetState:function(c,u,g){c=c._reactInternals;var S=ls(),C=ze(S);C.payload=u,g!=null&&(C.callback=g),u=qe(c,C,S),u!==null&&(Qa(u,c,S),Tt(u,c,S))},enqueueReplaceState:function(c,u,g){c=c._reactInternals;var S=ls(),C=ze(S);C.tag=1,C.payload=u,g!=null&&(C.callback=g),u=qe(c,C,S),u!==null&&(Qa(u,c,S),Tt(u,c,S))},enqueueForceUpdate:function(c,u){c=c._reactInternals;var g=ls(),S=ze(g);S.tag=2,u!=null&&(S.callback=u),u=qe(c,S,g),u!==null&&(Qa(u,c,g),Tt(u,c,g))}},yg=typeof reportError=="function"?reportError:function(c){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var u=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof c=="object"&&c!==null&&typeof c.message=="string"?String(c.message):String(c),error:c});if(!window.dispatchEvent(u))return}else if(typeof bl=="object"&&typeof bl.emit=="function"){bl.emit("uncaughtException",c);return}console.error(c)},_y=Error(i(461)),na=!1,is={dehydrated:null,treeContext:null,retryLane:0},Es=T(null),Al=null,Ki=null,yy=typeof AbortController<"u"?AbortController:function(){var c=[],u=this.signal={aborted:!1,addEventListener:function(g,S){c.push(S)}};this.abort=function(){u.aborted=!0,c.forEach(function(g){return g()})}},Lo=Pa.unstable_scheduleCallback,oc=Pa.unstable_NormalPriority,ui={$$typeof:Jr,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0},kd=hn.S;hn.S=function(c,u){typeof u=="object"&&u!==null&&typeof u.then=="function"&&Oe(c,u),kd!==null&&kd(c,u)};var No=T(null),Aa=!1,Hi=!1,Sl=!1,mu=typeof WeakSet=="function"?WeakSet:Set,Wi=null,lc=!1,ia=null,Ts=!1,fs=null,cc=8192,Xd={getCacheForType:function(c){var u=Ha(ui),g=u.data.get(c);return g===void 0&&(g=c(),u.data.set(c,g)),g}},Qf=0,Yd=1,Jd=2,jn=3,fi=4;if(typeof Symbol=="function"&&Symbol.for){var wn=Symbol.for;Qf=wn("selector.component"),Yd=wn("selector.has_pseudo_class"),Jd=wn("selector.role"),jn=wn("selector.test_id"),fi=wn("selector.text")}var Vn=typeof WeakMap=="function"?WeakMap:Map,rn=0,Fn=null,Sn=null,Un=0,xi=0,aa=null,hi=!1,Ws=!1,Uo=!1,wr=0,Zn=0,js=0,Br=0,as=0,Cs=0,Oo=0,gu=null,Zs=null,vu=!1,to=0,Pi=1/0,Dr=null,Qs=null,fr=!1,Io=null,uc=0,qd=0,fc=null,hc=0,hs=null;return sn.attemptContinuousHydration=function(c){if(c.tag===13){var u=rt(c,67108864);u!==null&&Qa(u,c,67108864),Nm(c,67108864)}},sn.attemptHydrationAtCurrentPriority=function(c){if(c.tag===13){var u=ls(),g=rt(c,u);g!==null&&Qa(g,c,u),Nm(c,u)}},sn.attemptSynchronousHydration=function(c){switch(c.tag){case 3:if(c=c.stateNode,c.current.memoizedState.isDehydrated){var u=L(c.pendingLanes);if(u!==0){for(c.pendingLanes|=2,c.entangledLanes|=2;u;){var g=1<<31-Ss(u);c.entanglements[1]|=g,u&=~g}_t(c),(rn&6)===0&&(Pi=Va()+500,Ft(0))}}break;case 13:u=rt(c,2),u!==null&&Qa(u,c,2),Rm(),Nm(c,2)}},sn.batchedUpdates=function(c,u){return c(u)},sn.createComponentSelector=function(c){return{$$typeof:Qf,value:c}},sn.createContainer=function(c,u,g,S,C,B,q,se,Se,Je){return wa(c,u,!1,null,g,S,B,q,se,Se,Je,null)},sn.createHasPseudoClassSelector=function(c){return{$$typeof:Yd,value:c}},sn.createHydrationContainer=function(c,u,g,S,C,B,q,se,Se,Je,Mt,Gt,kt){return c=wa(g,S,!0,c,C,B,se,Se,Je,Mt,Gt,kt),c.context=wf(null),g=c.current,S=ls(),C=ze(S),C.callback=u??null,qe(g,C,S),c.current.lanes=S,K(c,S),_t(c),c},sn.createPortal=function(c,u,g){var S=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:br,key:S==null?null:""+S,children:c,containerInfo:u,implementation:g}},sn.createRoleSelector=function(c){return{$$typeof:Jd,value:c}},sn.createTestNameSelector=function(c){return{$$typeof:jn,value:c}},sn.createTextSelector=function(c){return{$$typeof:fi,value:c}},sn.defaultOnCaughtError=function(c){console.error(c)},sn.defaultOnRecoverableError=function(c){yg(c)},sn.defaultOnUncaughtError=function(c){yg(c)},sn.deferredUpdates=function(c){var u=hn.T,g=xa();try{return es(32),hn.T=null,c()}finally{es(g),hn.T=u}},sn.discreteUpdates=function(c,u,g,S,C){var B=hn.T,q=xa();try{return es(2),hn.T=null,c(u,g,S,C)}finally{es(q),hn.T=B,rn===0&&(Pi=Va()+500)}},sn.findAllNodes=os,sn.findBoundingRects=function(c,u){if(!Wr)throw Error(i(363));u=os(c,u),c=[];for(var g=0;g<u.length;g++)c.push(Td(u[g]));for(u=c.length-1;0<u;u--){g=c[u];for(var S=g.x,C=S+g.width,B=g.y,q=B+g.height,se=u-1;0<=se;se--)if(u!==se){var Se=c[se],Je=Se.x,Mt=Je+Se.width,Gt=Se.y,kt=Gt+Se.height;if(S>=Je&&B>=Gt&&C<=Mt&&q<=kt){c.splice(u,1);break}else if(S!==Je||g.width!==Se.width||kt<B||Gt>q){if(!(B!==Gt||g.height!==Se.height||Mt<S||Je>C)){Je>S&&(Se.width+=Je-S,Se.x=S),Mt<C&&(Se.width=C-Je),c.splice(u,1);break}}else{Gt>B&&(Se.height+=Gt-B,Se.y=B),kt<q&&(Se.height=q-Gt),c.splice(u,1);break}}}return c},sn.findHostInstance=Lm,sn.findHostInstanceWithNoPortals=function(c){return c=x(c),c=c!==null?R(c):null,c===null?null:au(c.stateNode)},sn.findHostInstanceWithWarning=function(c){return Lm(c)},sn.flushPassiveEffects=Ra,sn.flushSyncFromReconciler=function(c){var u=rn;rn|=1;var g=hn.T,S=xa();try{if(es(2),hn.T=null,c)return c()}finally{es(S),hn.T=g,rn=u,(rn&6)===0&&Ft(0)}},sn.flushSyncWork=Rm,sn.focusWithin=function(c,u){if(!Wr)throw Error(i(363));for(c=pd(c),u=H_(c,u),u=Array.from(u),c=0;c<u.length;){var g=u[c++],S=g.tag;if(!jr(g)){if((S===5||S===26||S===27)&&Yi(g.stateNode))return!0;for(g=g.child;g!==null;)u.push(g),g=g.sibling}}return!1},sn.getFindAllNodesFailureDescription=function(c,u){if(!Wr)throw Error(i(363));var g=0,S=[];c=[pd(c),0];for(var C=0;C<c.length;){var B=c[C++],q=B.tag,se=c[C++],Se=u[se];if((q!==5&&q!==26&&q!==27||!jr(B))&&($c(B,Se)&&(S.push(rl(Se)),se++,se>g&&(g=se)),se<u.length))for(B=B.child;B!==null;)c.push(B,se),B=B.sibling}if(g<u.length){for(c=[];g<u.length;g++)c.push(rl(u[g]));return`findAllNodes was able to match part of the selector:
4027
4027
  `+(S.join(" > ")+`
4028
4028
 
4029
4029
  No matching component was found for:
@@ -4112,7 +4112,7 @@ No matching component was found for:
4112
4112
  `))&&ie<N&&ne<V.byteLength;)he+=H,ie+=H.length,ne+=128,H+=String.fromCharCode.apply(null,new Uint16Array(V.subarray(ne,ne+128)));return-1<ee?(V.pos+=ie+ee+1,he+H.slice(0,ee)):!1},y=function(V){const N=/^#\?(\S+)/,F=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,K=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,ne=/^\s*FORMAT=(\S+)\s*$/,ee=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,ie={valid:0,string:"",comments:"",programtype:"RGBE",format:"",gamma:1,exposure:1,width:0,height:0};let he,H;for((V.pos>=V.byteLength||!(he=v(V)))&&l(1,"no header found"),(H=he.match(N))||l(3,"bad initial token"),ie.valid|=1,ie.programtype=H[1],ie.string+=he+`
4113
4113
  `;he=v(V),he!==!1;){if(ie.string+=he+`
4114
4114
  `,he.charAt(0)==="#"){ie.comments+=he+`
4115
- `;continue}if((H=he.match(F))&&(ie.gamma=parseFloat(H[1])),(H=he.match(K))&&(ie.exposure=parseFloat(H[1])),(H=he.match(ne))&&(ie.valid|=2,ie.format=H[1]),(H=he.match(ee))&&(ie.valid|=4,ie.height=parseInt(H[1],10),ie.width=parseInt(H[2],10)),ie.valid&2&&ie.valid&4)break}return ie.valid&2||l(3,"missing format specifier"),ie.valid&4||l(3,"missing image size specifier"),ie},x=function(V,N,F){const K=N;if(K<8||K>32767||V[0]!==2||V[1]!==2||V[2]&128)return new Uint8Array(V);K!==(V[2]<<8|V[3])&&l(3,"wrong scanline width");const ne=new Uint8Array(4*N*F);ne.length||l(4,"unable to allocate buffer space");let ee=0,ie=0;const he=4*K,H=new Uint8Array(4),Y=new Uint8Array(he);let $=F;for(;$>0&&ie<V.byteLength;){ie+4>V.byteLength&&l(1),H[0]=V[ie++],H[1]=V[ie++],H[2]=V[ie++],H[3]=V[ie++],(H[0]!=2||H[1]!=2||(H[2]<<8|H[3])!=K)&&l(3,"bad rgbe scanline format");let ye=0,_e;for(;ye<he&&ie<V.byteLength;){_e=V[ie++];const ae=_e>128;if(ae&&(_e-=128),(_e===0||ye+_e>he)&&l(3,"bad scanline data"),ae){const Me=V[ie++];for(let Ne=0;Ne<_e;Ne++)Y[ye++]=Me}else Y.set(V.subarray(ie,ie+_e),ye),ye+=_e,ie+=_e}const W=K;for(let ae=0;ae<W;ae++){let Me=0;ne[ee]=Y[ae+Me],Me+=K,ne[ee+1]=Y[ae+Me],Me+=K,ne[ee+2]=Y[ae+Me],Me+=K,ne[ee+3]=Y[ae+Me],ee+=4}$--}return ne},b=function(V,N,F,K){const ne=V[N+3],ee=Math.pow(2,ne-128)/255;F[K+0]=V[N+0]*ee,F[K+1]=V[N+1]*ee,F[K+2]=V[N+2]*ee,F[K+3]=1},R=function(V,N,F,K){const ne=V[N+3],ee=Math.pow(2,ne-128)/255;F[K+0]=Pu.toHalfFloat(Math.min(V[N+0]*ee,65504)),F[K+1]=Pu.toHalfFloat(Math.min(V[N+1]*ee,65504)),F[K+2]=Pu.toHalfFloat(Math.min(V[N+2]*ee,65504)),F[K+3]=Pu.toHalfFloat(1)},T=new Uint8Array(e);T.pos=0;const M=y(T),w=M.width,D=M.height,L=x(T.subarray(T.pos),w,D);let P,O,z;switch(this.type){case Vi:z=L.length/4;const V=new Float32Array(z*4);for(let F=0;F<z;F++)b(L,F*4,V,F*4);P=V,O=Vi;break;case sa:z=L.length/4;const N=new Uint16Array(z*4);for(let F=0;F<z;F++)R(L,F*4,N,F*4);P=N,O=sa;break;default:throw new Error("THREE.RGBELoader: Unsupported type: "+this.type)}return{width:w,height:D,data:P,header:M.string,gamma:M.gamma,exposure:M.exposure,type:O}}setDataType(e){return this.type=e,this}load(e,t,n,i){function o(l,h){switch(l.type){case Vi:case sa:"colorSpace"in l?l.colorSpace="srgb-linear":l.encoding=3e3,l.minFilter=In,l.magFilter=In,l.generateMipmaps=!1,l.flipY=!0;break}t&&t(l,h)}return super.load(e,o,n,i)}}const sm=vS>=152;class zI extends hA{constructor(e){super(e),this.type=sa}parse(e){const N=Math.pow(2.7182818,2.2);function F(G,J){for(var oe=0,Re=0;Re<65536;++Re)(Re==0||G[Re>>3]&1<<(Re&7))&&(J[oe++]=Re);for(var Pe=oe-1;oe<65536;)J[oe++]=0;return Pe}function K(G){for(var J=0;J<16384;J++)G[J]={},G[J].len=0,G[J].lit=0,G[J].p=null}const ne={l:0,c:0,lc:0};function ee(G,J,oe,Re,Pe){for(;oe<G;)J=J<<8|Tt(Re,Pe),oe+=8;oe-=G,ne.l=J>>oe&(1<<G)-1,ne.c=J,ne.lc=oe}const ie=new Array(59);function he(G){for(var J=0;J<=58;++J)ie[J]=0;for(var J=0;J<65537;++J)ie[G[J]]+=1;for(var oe=0,J=58;J>0;--J){var Re=oe+ie[J]>>1;ie[J]=oe,oe=Re}for(var J=0;J<65537;++J){var Pe=G[J];Pe>0&&(G[J]=Pe|ie[Pe]++<<6)}}function H(G,J,oe,Re,Pe,He,ot){for(var nt=oe,Ze=0,je=0;Pe<=He;Pe++){if(nt.value-oe.value>Re)return!1;ee(6,Ze,je,G,nt);var vt=ne.l;if(Ze=ne.c,je=ne.lc,ot[Pe]=vt,vt==63){if(nt.value-oe.value>Re)throw"Something wrong with hufUnpackEncTable";ee(8,Ze,je,G,nt);var ht=ne.l+6;if(Ze=ne.c,je=ne.lc,Pe+ht>He+1)throw"Something wrong with hufUnpackEncTable";for(;ht--;)ot[Pe++]=0;Pe--}else if(vt>=59){var ht=vt-59+2;if(Pe+ht>He+1)throw"Something wrong with hufUnpackEncTable";for(;ht--;)ot[Pe++]=0;Pe--}}he(ot)}function Y(G){return G&63}function $(G){return G>>6}function ye(G,J,oe,Re){for(;J<=oe;J++){var Pe=$(G[J]),He=Y(G[J]);if(Pe>>He)throw"Invalid table entry";if(He>14){var ot=Re[Pe>>He-14];if(ot.len)throw"Invalid table entry";if(ot.lit++,ot.p){var nt=ot.p;ot.p=new Array(ot.lit);for(var Ze=0;Ze<ot.lit-1;++Ze)ot.p[Ze]=nt[Ze]}else ot.p=new Array(1);ot.p[ot.lit-1]=J}else if(He)for(var je=0,Ze=1<<14-He;Ze>0;Ze--){var ot=Re[(Pe<<14-He)+je];if(ot.len||ot.p)throw"Invalid table entry";ot.len=He,ot.lit=J,je++}}return!0}const _e={c:0,lc:0};function W(G,J,oe,Re){G=G<<8|Tt(oe,Re),J+=8,_e.c=G,_e.lc=J}const ae={c:0,lc:0};function Me(G,J,oe,Re,Pe,He,ot,nt,Ze,je){if(G==J){Re<8&&(W(oe,Re,Pe,ot),oe=_e.c,Re=_e.lc),Re-=8;var vt=oe>>Re,vt=new Uint8Array([vt])[0];if(Ze.value+vt>je)return!1;for(var ht=nt[Ze.value-1];vt-- >0;)nt[Ze.value++]=ht}else if(Ze.value<je)nt[Ze.value++]=G;else return!1;ae.c=oe,ae.lc=Re}function Ne(G){return G&65535}function it(G){var J=Ne(G);return J>32767?J-65536:J}const ve={a:0,b:0};function Ce(G,J){var oe=it(G),Re=it(J),Pe=Re,He=oe+(Pe&1)+(Pe>>1),ot=He,nt=He-Pe;ve.a=ot,ve.b=nt}function tt(G,J){var oe=Ne(G),Re=Ne(J),Pe=oe-(Re>>1)&65535,He=Re+Pe-32768&65535;ve.a=He,ve.b=Pe}function Et(G,J,oe,Re,Pe,He,ot){for(var nt=ot<16384,Ze=oe>Pe?Pe:oe,je=1,vt;je<=Ze;)je<<=1;for(je>>=1,vt=je,je>>=1;je>=1;){for(var ht=0,k=ht+He*(Pe-vt),te=He*je,fe=He*vt,ce=Re*je,le=Re*vt,Qe,lt,ct,Ct;ht<=k;ht+=fe){for(var xt=ht,Yt=ht+Re*(oe-vt);xt<=Yt;xt+=le){var At=xt+ce,zt=xt+te,mn=zt+ce;nt?(Ce(G[xt+J],G[zt+J]),Qe=ve.a,ct=ve.b,Ce(G[At+J],G[mn+J]),lt=ve.a,Ct=ve.b,Ce(Qe,lt),G[xt+J]=ve.a,G[At+J]=ve.b,Ce(ct,Ct),G[zt+J]=ve.a,G[mn+J]=ve.b):(tt(G[xt+J],G[zt+J]),Qe=ve.a,ct=ve.b,tt(G[At+J],G[mn+J]),lt=ve.a,Ct=ve.b,tt(Qe,lt),G[xt+J]=ve.a,G[At+J]=ve.b,tt(ct,Ct),G[zt+J]=ve.a,G[mn+J]=ve.b)}if(oe&je){var zt=xt+te;nt?Ce(G[xt+J],G[zt+J]):tt(G[xt+J],G[zt+J]),Qe=ve.a,G[zt+J]=ve.b,G[xt+J]=Qe}}if(Pe&je)for(var xt=ht,Yt=ht+Re*(oe-vt);xt<=Yt;xt+=le){var At=xt+ce;nt?Ce(G[xt+J],G[At+J]):tt(G[xt+J],G[At+J]),Qe=ve.a,G[At+J]=ve.b,G[xt+J]=Qe}vt=je,je>>=1}return ht}function wt(G,J,oe,Re,Pe,He,ot,nt,Ze,je){for(var vt=0,ht=0,k=nt,te=Math.trunc(Pe.value+(He+7)/8);Pe.value<te;)for(W(vt,ht,oe,Pe),vt=_e.c,ht=_e.lc;ht>=14;){var fe=vt>>ht-14&16383,ce=J[fe];if(ce.len)ht-=ce.len,Me(ce.lit,ot,vt,ht,oe,Re,Pe,Ze,je,k),vt=ae.c,ht=ae.lc;else{if(!ce.p)throw"hufDecode issues";var le;for(le=0;le<ce.lit;le++){for(var Qe=Y(G[ce.p[le]]);ht<Qe&&Pe.value<te;)W(vt,ht,oe,Pe),vt=_e.c,ht=_e.lc;if(ht>=Qe&&$(G[ce.p[le]])==(vt>>ht-Qe&(1<<Qe)-1)){ht-=Qe,Me(ce.p[le],ot,vt,ht,oe,Re,Pe,Ze,je,k),vt=ae.c,ht=ae.lc;break}}if(le==ce.lit)throw"hufDecode issues"}}var lt=8-He&7;for(vt>>=lt,ht-=lt;ht>0;){var ce=J[vt<<14-ht&16383];if(ce.len)ht-=ce.len,Me(ce.lit,ot,vt,ht,oe,Re,Pe,Ze,je,k),vt=ae.c,ht=ae.lc;else throw"hufDecode issues"}return!0}function on(G,J,oe,Re,Pe,He){var ot={value:0},nt=oe.value,Ze=qe(J,oe),je=qe(J,oe);oe.value+=4;var vt=qe(J,oe);if(oe.value+=4,Ze<0||Ze>=65537||je<0||je>=65537)throw"Something wrong with HUF_ENCSIZE";var ht=new Array(65537),k=new Array(16384);K(k);var te=Re-(oe.value-nt);if(H(G,J,oe,te,Ze,je,ht),vt>8*(Re-(oe.value-nt)))throw"Something wrong with hufUncompress";ye(ht,Ze,je,k),wt(ht,k,G,J,oe,vt,je,He,Pe,ot)}function It(G,J,oe){for(var Re=0;Re<oe;++Re)J[Re]=G[J[Re]]}function mt(G){for(var J=1;J<G.length;J++){var oe=G[J-1]+G[J]-128;G[J]=oe}}function me(G,J){for(var oe=0,Re=Math.floor((G.length+1)/2),Pe=0,He=G.length-1;!(Pe>He||(J[Pe++]=G[oe++],Pe>He));)J[Pe++]=G[Re++]}function Le(G){for(var J=G.byteLength,oe=new Array,Re=0,Pe=new DataView(G);J>0;){var He=Pe.getInt8(Re++);if(He<0){var ot=-He;J-=ot+1;for(var nt=0;nt<ot;nt++)oe.push(Pe.getUint8(Re++))}else{var ot=He;J-=2;for(var Ze=Pe.getUint8(Re++),nt=0;nt<ot+1;nt++)oe.push(Ze)}}return oe}function Ue(G,J,oe,Re,Pe,He){var At=new DataView(He.buffer),ot=oe[G.idx[0]].width,nt=oe[G.idx[0]].height,Ze=3,je=Math.floor(ot/8),vt=Math.ceil(ot/8),ht=Math.ceil(nt/8),k=ot-(vt-1)*8,te=nt-(ht-1)*8,fe={value:0},ce=new Array(Ze),le=new Array(Ze),Qe=new Array(Ze),lt=new Array(Ze),ct=new Array(Ze);for(let Qt=0;Qt<Ze;++Qt)ct[Qt]=J[G.idx[Qt]],ce[Qt]=Qt<1?0:ce[Qt-1]+vt*ht,le[Qt]=new Float32Array(64),Qe[Qt]=new Uint16Array(64),lt[Qt]=new Uint16Array(vt*64);for(let Qt=0;Qt<ht;++Qt){var Ct=8;Qt==ht-1&&(Ct=te);var xt=8;for(let $t=0;$t<vt;++$t){$t==vt-1&&(xt=k);for(let Lt=0;Lt<Ze;++Lt)Qe[Lt].fill(0),Qe[Lt][0]=Pe[ce[Lt]++],rt(fe,Re,Qe[Lt]),Q(Qe[Lt],le[Lt]),Kt(le[Lt]);_t(le);for(let Lt=0;Lt<Ze;++Lt)Ft(le[Lt],lt[Lt],$t*64)}let Dt=0;for(let $t=0;$t<Ze;++$t){const Lt=oe[G.idx[$t]].type;for(let ei=8*Qt;ei<8*Qt+Ct;++ei){Dt=ct[$t][ei];for(let Qi=0;Qi<je;++Qi){const Gn=Qi*64+(ei&7)*8;At.setUint16(Dt+0*Lt,lt[$t][Gn+0],!0),At.setUint16(Dt+2*Lt,lt[$t][Gn+1],!0),At.setUint16(Dt+4*Lt,lt[$t][Gn+2],!0),At.setUint16(Dt+6*Lt,lt[$t][Gn+3],!0),At.setUint16(Dt+8*Lt,lt[$t][Gn+4],!0),At.setUint16(Dt+10*Lt,lt[$t][Gn+5],!0),At.setUint16(Dt+12*Lt,lt[$t][Gn+6],!0),At.setUint16(Dt+14*Lt,lt[$t][Gn+7],!0),Dt+=16*Lt}}if(je!=vt)for(let ei=8*Qt;ei<8*Qt+Ct;++ei){const Qi=ct[$t][ei]+8*je*2*Lt,Gn=je*64+(ei&7)*8;for(let Fi=0;Fi<xt;++Fi)At.setUint16(Qi+Fi*2*Lt,lt[$t][Gn+Fi],!0)}}}for(var Yt=new Uint16Array(ot),At=new DataView(He.buffer),zt=0;zt<Ze;++zt){oe[G.idx[zt]].decoded=!0;var mn=oe[G.idx[zt]].type;if(oe[zt].type==2)for(var Pn=0;Pn<nt;++Pn){const Qt=ct[zt][Pn];for(var Mn=0;Mn<ot;++Mn)Yt[Mn]=At.getUint16(Qt+Mn*2*mn,!0);for(var Mn=0;Mn<ot;++Mn)At.setFloat32(Qt+Mn*2*mn,be(Yt[Mn]),!0)}}}function rt(G,J,oe){for(var Re,Pe=1;Pe<64;)Re=J[G.value],Re==65280?Pe=64:Re>>8==255?Pe+=Re&255:(oe[Pe]=Re,Pe++),G.value++}function Q(G,J){J[0]=be(G[0]),J[1]=be(G[1]),J[2]=be(G[5]),J[3]=be(G[6]),J[4]=be(G[14]),J[5]=be(G[15]),J[6]=be(G[27]),J[7]=be(G[28]),J[8]=be(G[2]),J[9]=be(G[4]),J[10]=be(G[7]),J[11]=be(G[13]),J[12]=be(G[16]),J[13]=be(G[26]),J[14]=be(G[29]),J[15]=be(G[42]),J[16]=be(G[3]),J[17]=be(G[8]),J[18]=be(G[12]),J[19]=be(G[17]),J[20]=be(G[25]),J[21]=be(G[30]),J[22]=be(G[41]),J[23]=be(G[43]),J[24]=be(G[9]),J[25]=be(G[11]),J[26]=be(G[18]),J[27]=be(G[24]),J[28]=be(G[31]),J[29]=be(G[40]),J[30]=be(G[44]),J[31]=be(G[53]),J[32]=be(G[10]),J[33]=be(G[19]),J[34]=be(G[23]),J[35]=be(G[32]),J[36]=be(G[39]),J[37]=be(G[45]),J[38]=be(G[52]),J[39]=be(G[54]),J[40]=be(G[20]),J[41]=be(G[22]),J[42]=be(G[33]),J[43]=be(G[38]),J[44]=be(G[46]),J[45]=be(G[51]),J[46]=be(G[55]),J[47]=be(G[60]),J[48]=be(G[21]),J[49]=be(G[34]),J[50]=be(G[37]),J[51]=be(G[47]),J[52]=be(G[50]),J[53]=be(G[56]),J[54]=be(G[59]),J[55]=be(G[61]),J[56]=be(G[35]),J[57]=be(G[36]),J[58]=be(G[48]),J[59]=be(G[49]),J[60]=be(G[57]),J[61]=be(G[58]),J[62]=be(G[62]),J[63]=be(G[63])}function Kt(G){const J=.5*Math.cos(.7853975),oe=.5*Math.cos(3.14159/16),Re=.5*Math.cos(3.14159/8),Pe=.5*Math.cos(3*3.14159/16),He=.5*Math.cos(5*3.14159/16),ot=.5*Math.cos(3*3.14159/8),nt=.5*Math.cos(7*3.14159/16);for(var Ze=new Array(4),je=new Array(4),vt=new Array(4),ht=new Array(4),k=0;k<8;++k){var te=k*8;Ze[0]=Re*G[te+2],Ze[1]=ot*G[te+2],Ze[2]=Re*G[te+6],Ze[3]=ot*G[te+6],je[0]=oe*G[te+1]+Pe*G[te+3]+He*G[te+5]+nt*G[te+7],je[1]=Pe*G[te+1]-nt*G[te+3]-oe*G[te+5]-He*G[te+7],je[2]=He*G[te+1]-oe*G[te+3]+nt*G[te+5]+Pe*G[te+7],je[3]=nt*G[te+1]-He*G[te+3]+Pe*G[te+5]-oe*G[te+7],vt[0]=J*(G[te+0]+G[te+4]),vt[3]=J*(G[te+0]-G[te+4]),vt[1]=Ze[0]+Ze[3],vt[2]=Ze[1]-Ze[2],ht[0]=vt[0]+vt[1],ht[1]=vt[3]+vt[2],ht[2]=vt[3]-vt[2],ht[3]=vt[0]-vt[1],G[te+0]=ht[0]+je[0],G[te+1]=ht[1]+je[1],G[te+2]=ht[2]+je[2],G[te+3]=ht[3]+je[3],G[te+4]=ht[3]-je[3],G[te+5]=ht[2]-je[2],G[te+6]=ht[1]-je[1],G[te+7]=ht[0]-je[0]}for(var fe=0;fe<8;++fe)Ze[0]=Re*G[16+fe],Ze[1]=ot*G[16+fe],Ze[2]=Re*G[48+fe],Ze[3]=ot*G[48+fe],je[0]=oe*G[8+fe]+Pe*G[24+fe]+He*G[40+fe]+nt*G[56+fe],je[1]=Pe*G[8+fe]-nt*G[24+fe]-oe*G[40+fe]-He*G[56+fe],je[2]=He*G[8+fe]-oe*G[24+fe]+nt*G[40+fe]+Pe*G[56+fe],je[3]=nt*G[8+fe]-He*G[24+fe]+Pe*G[40+fe]-oe*G[56+fe],vt[0]=J*(G[fe]+G[32+fe]),vt[3]=J*(G[fe]-G[32+fe]),vt[1]=Ze[0]+Ze[3],vt[2]=Ze[1]-Ze[2],ht[0]=vt[0]+vt[1],ht[1]=vt[3]+vt[2],ht[2]=vt[3]-vt[2],ht[3]=vt[0]-vt[1],G[0+fe]=ht[0]+je[0],G[8+fe]=ht[1]+je[1],G[16+fe]=ht[2]+je[2],G[24+fe]=ht[3]+je[3],G[32+fe]=ht[3]-je[3],G[40+fe]=ht[2]-je[2],G[48+fe]=ht[1]-je[1],G[56+fe]=ht[0]-je[0]}function _t(G){for(var J=0;J<64;++J){var oe=G[0][J],Re=G[1][J],Pe=G[2][J];G[0][J]=oe+1.5747*Pe,G[1][J]=oe-.1873*Re-.4682*Pe,G[2][J]=oe+1.8556*Re}}function Ft(G,J,oe){for(var Re=0;Re<64;++Re)J[oe+Re]=Pu.toHalfFloat(yt(G[Re]))}function yt(G){return G<=1?Math.sign(G)*Math.pow(Math.abs(G),2.2):Math.sign(G)*Math.pow(N,Math.abs(G)-1)}function j(G){return new DataView(G.array.buffer,G.offset.value,G.size)}function I(G){var J=G.viewer.buffer.slice(G.offset.value,G.offset.value+G.size),oe=new Uint8Array(Le(J)),Re=new Uint8Array(oe.length);return mt(oe),me(oe,Re),new DataView(Re.buffer)}function ue(G){var J=G.array.slice(G.offset.value,G.offset.value+G.size),oe=h_(J),Re=new Uint8Array(oe.length);return mt(oe),me(oe,Re),new DataView(Re.buffer)}function Ie(G){for(var J=G.viewer,oe={value:G.offset.value},Re=new Uint16Array(G.width*G.scanlineBlockSize*(G.channels*G.type)),Pe=new Uint8Array(8192),He=0,ot=new Array(G.channels),nt=0;nt<G.channels;nt++)ot[nt]={},ot[nt].start=He,ot[nt].end=ot[nt].start,ot[nt].nx=G.width,ot[nt].ny=G.lines,ot[nt].size=G.type,He+=ot[nt].nx*ot[nt].ny*ot[nt].size;var Ze=We(J,oe),je=We(J,oe);if(je>=8192)throw"Something is wrong with PIZ_COMPRESSION BITMAP_SIZE";if(Ze<=je)for(var nt=0;nt<je-Ze+1;nt++)Pe[nt+Ze]=pt(J,oe);var vt=new Uint16Array(65536),ht=F(Pe,vt),k=qe(J,oe);on(G.array,J,oe,k,Re,He);for(var nt=0;nt<G.channels;++nt)for(var te=ot[nt],fe=0;fe<ot[nt].size;++fe)Et(Re,te.start+fe,te.nx,te.size,te.ny,te.nx*te.size,ht);It(vt,Re,He);for(var ce=0,le=new Uint8Array(Re.buffer.byteLength),Qe=0;Qe<G.lines;Qe++)for(var lt=0;lt<G.channels;lt++){var te=ot[lt],ct=te.nx*te.size,Ct=new Uint8Array(Re.buffer,te.end*2,ct*2);le.set(Ct,ce),ce+=ct*2,te.end+=ct}return new DataView(le.buffer)}function Xe(G){var J=G.array.slice(G.offset.value,G.offset.value+G.size),oe=h_(J);const Re=G.lines*G.channels*G.width,Pe=G.type==1?new Uint16Array(Re):new Uint32Array(Re);let He=0,ot=0;const nt=new Array(4);for(let Ze=0;Ze<G.lines;Ze++)for(let je=0;je<G.channels;je++){let vt=0;switch(G.type){case 1:nt[0]=He,nt[1]=nt[0]+G.width,He=nt[1]+G.width;for(let ht=0;ht<G.width;++ht){const k=oe[nt[0]++]<<8|oe[nt[1]++];vt+=k,Pe[ot]=vt,ot++}break;case 2:nt[0]=He,nt[1]=nt[0]+G.width,nt[2]=nt[1]+G.width,He=nt[2]+G.width;for(let ht=0;ht<G.width;++ht){const k=oe[nt[0]++]<<24|oe[nt[1]++]<<16|oe[nt[2]++]<<8;vt+=k,Pe[ot]=vt,ot++}break}}return new DataView(Pe.buffer)}function Oe(G){var J=G.viewer,oe={value:G.offset.value},Re=new Uint8Array(G.width*G.lines*(G.channels*G.type*2)),Pe={version:st(J,oe),unknownUncompressedSize:st(J,oe),unknownCompressedSize:st(J,oe),acCompressedSize:st(J,oe),dcCompressedSize:st(J,oe),rleCompressedSize:st(J,oe),rleUncompressedSize:st(J,oe),rleRawSize:st(J,oe),totalAcUncompressedCount:st(J,oe),totalDcUncompressedCount:st(J,oe),acCompression:st(J,oe)};if(Pe.version<2)throw"EXRLoader.parse: "+vi.compression+" version "+Pe.version+" is unsupported";for(var He=new Array,ot=We(J,oe)-2;ot>0;){var nt=Bt(J.buffer,oe),Ze=pt(J,oe),je=Ze>>2&3,vt=(Ze>>4)-1,ht=new Int8Array([vt])[0],k=pt(J,oe);He.push({name:nt,index:ht,type:k,compression:je}),ot-=nt.length+3}for(var te=vi.channels,fe=new Array(G.channels),ce=0;ce<G.channels;++ce){var le=fe[ce]={},Qe=te[ce];le.name=Qe.name,le.compression=0,le.decoded=!1,le.type=Qe.pixelType,le.pLinear=Qe.pLinear,le.width=G.width,le.height=G.lines}for(var lt={idx:new Array(3)},ct=0;ct<G.channels;++ct)for(var le=fe[ct],ce=0;ce<He.length;++ce){var Ct=He[ce];le.name==Ct.name&&(le.compression=Ct.compression,Ct.index>=0&&(lt.idx[Ct.index]=ct),le.offset=ct)}if(Pe.acCompressedSize>0)switch(Pe.acCompression){case 0:var At=new Uint16Array(Pe.totalAcUncompressedCount);on(G.array,J,oe,Pe.acCompressedSize,At,Pe.totalAcUncompressedCount);break;case 1:var xt=G.array.slice(oe.value,oe.value+Pe.totalAcUncompressedCount),Yt=h_(xt),At=new Uint16Array(Yt.buffer);oe.value+=Pe.totalAcUncompressedCount;break}if(Pe.dcCompressedSize>0){var zt={array:G.array,offset:oe,size:Pe.dcCompressedSize},mn=new Uint16Array(ue(zt).buffer);oe.value+=Pe.dcCompressedSize}if(Pe.rleRawSize>0){var xt=G.array.slice(oe.value,oe.value+Pe.rleCompressedSize),Yt=h_(xt),Pn=Le(Yt.buffer);oe.value+=Pe.rleCompressedSize}for(var Mn=0,Qt=new Array(fe.length),ce=0;ce<Qt.length;++ce)Qt[ce]=new Array;for(var Dt=0;Dt<G.lines;++Dt)for(var $t=0;$t<fe.length;++$t)Qt[$t].push(Mn),Mn+=fe[$t].width*G.type*2;Ue(lt,Qt,fe,At,mn,Re);for(var ce=0;ce<fe.length;++ce){var le=fe[ce];if(!le.decoded)switch(le.compression){case 2:for(var Lt=0,ei=0,Dt=0;Dt<G.lines;++Dt){for(var Qi=Qt[ce][Lt],Gn=0;Gn<le.width;++Gn){for(var Fi=0;Fi<2*le.type;++Fi)Re[Qi++]=Pn[ei+Fi*le.width*le.height];ei++}Lt++}break;default:throw"EXRLoader.parse: unsupported channel compression"}}return new DataView(Re.buffer)}function Bt(G,J){for(var oe=new Uint8Array(G),Re=0;oe[J.value+Re]!=0;)Re+=1;var Pe=new TextDecoder().decode(oe.slice(J.value,J.value+Re));return J.value=J.value+Re+1,Pe}function gt(G,J,oe){var Re=new TextDecoder().decode(new Uint8Array(G).slice(J.value,J.value+oe));return J.value=J.value+oe,Re}function Ht(G,J){var oe=ze(G,J),Re=qe(G,J);return[oe,Re]}function Xt(G,J){var oe=qe(G,J),Re=qe(G,J);return[oe,Re]}function ze(G,J){var oe=G.getInt32(J.value,!0);return J.value=J.value+4,oe}function qe(G,J){var oe=G.getUint32(J.value,!0);return J.value=J.value+4,oe}function Tt(G,J){var oe=G[J.value];return J.value=J.value+1,oe}function pt(G,J){var oe=G.getUint8(J.value);return J.value=J.value+1,oe}const st=function(G,J){let oe;return"getBigInt64"in DataView.prototype?oe=Number(G.getBigInt64(J.value,!0)):oe=G.getUint32(J.value+4,!0)+Number(G.getUint32(J.value,!0)<<32),J.value+=8,oe};function qt(G,J){var oe=G.getFloat32(J.value,!0);return J.value+=4,oe}function de(G,J){return Pu.toHalfFloat(qt(G,J))}function be(G){var J=(G&31744)>>10,oe=G&1023;return(G>>15?-1:1)*(J?J===31?oe?NaN:1/0:Math.pow(2,J-15)*(1+oe/1024):6103515625e-14*(oe/1024))}function We(G,J){var oe=G.getUint16(J.value,!0);return J.value+=2,oe}function St(G,J){return be(We(G,J))}function Ye(G,J,oe,Re){for(var Pe=oe.value,He=[];oe.value<Pe+Re-1;){var ot=Bt(J,oe),nt=ze(G,oe),Ze=pt(G,oe);oe.value+=3;var je=ze(G,oe),vt=ze(G,oe);He.push({name:ot,pixelType:nt,pLinear:Ze,xSampling:je,ySampling:vt})}return oe.value+=1,He}function Ve(G,J){var oe=qt(G,J),Re=qt(G,J),Pe=qt(G,J),He=qt(G,J),ot=qt(G,J),nt=qt(G,J),Ze=qt(G,J),je=qt(G,J);return{redX:oe,redY:Re,greenX:Pe,greenY:He,blueX:ot,blueY:nt,whiteX:Ze,whiteY:je}}function ft(G,J){var oe=["NO_COMPRESSION","RLE_COMPRESSION","ZIPS_COMPRESSION","ZIP_COMPRESSION","PIZ_COMPRESSION","PXR24_COMPRESSION","B44_COMPRESSION","B44A_COMPRESSION","DWAA_COMPRESSION","DWAB_COMPRESSION"],Re=pt(G,J);return oe[Re]}function jt(G,J){var oe=qe(G,J),Re=qe(G,J),Pe=qe(G,J),He=qe(G,J);return{xMin:oe,yMin:Re,xMax:Pe,yMax:He}}function Sn(G,J){var oe=["INCREASING_Y"],Re=pt(G,J);return oe[Re]}function bt(G,J){var oe=qt(G,J),Re=qt(G,J);return[oe,Re]}function Dn(G,J){var oe=qt(G,J),Re=qt(G,J),Pe=qt(G,J);return[oe,Re,Pe]}function Nn(G,J,oe,Re,Pe){if(Re==="string"||Re==="stringvector"||Re==="iccProfile")return gt(J,oe,Pe);if(Re==="chlist")return Ye(G,J,oe,Pe);if(Re==="chromaticities")return Ve(G,oe);if(Re==="compression")return ft(G,oe);if(Re==="box2i")return jt(G,oe);if(Re==="lineOrder")return Sn(G,oe);if(Re==="float")return qt(G,oe);if(Re==="v2f")return bt(G,oe);if(Re==="v3f")return Dn(G,oe);if(Re==="int")return ze(G,oe);if(Re==="rational")return Ht(G,oe);if(Re==="timecode")return Xt(G,oe);if(Re==="preview")return oe.value+=Pe,"skipped";oe.value+=Pe}function Ni(G,J,oe){const Re={};if(G.getUint32(0,!0)!=20000630)throw"THREE.EXRLoader: provided file doesn't appear to be in OpenEXR format.";Re.version=G.getUint8(4);const Pe=G.getUint8(5);Re.spec={singleTile:!!(Pe&2),longName:!!(Pe&4),deepFormat:!!(Pe&8),multiPart:!!(Pe&16)},oe.value=8;for(var He=!0;He;){var ot=Bt(J,oe);if(ot==0)He=!1;else{var nt=Bt(J,oe),Ze=qe(G,oe),je=Nn(G,J,oe,nt,Ze);je===void 0?console.warn(`EXRLoader.parse: skipped unknown header attribute type '${nt}'.`):Re[ot]=je}}if((Pe&-5)!=0)throw console.error("EXRHeader:",Re),"THREE.EXRLoader: provided file is currently unsupported.";return Re}function fa(G,J,oe,Re,Pe){const He={size:0,viewer:J,array:oe,offset:Re,width:G.dataWindow.xMax-G.dataWindow.xMin+1,height:G.dataWindow.yMax-G.dataWindow.yMin+1,channels:G.channels.length,bytesPerLine:null,lines:null,inputSize:null,type:G.channels[0].pixelType,uncompress:null,getter:null,format:null,[sm?"colorSpace":"encoding"]:null};switch(G.compression){case"NO_COMPRESSION":He.lines=1,He.uncompress=j;break;case"RLE_COMPRESSION":He.lines=1,He.uncompress=I;break;case"ZIPS_COMPRESSION":He.lines=1,He.uncompress=ue;break;case"ZIP_COMPRESSION":He.lines=16,He.uncompress=ue;break;case"PIZ_COMPRESSION":He.lines=32,He.uncompress=Ie;break;case"PXR24_COMPRESSION":He.lines=16,He.uncompress=Xe;break;case"DWAA_COMPRESSION":He.lines=32,He.uncompress=Oe;break;case"DWAB_COMPRESSION":He.lines=256,He.uncompress=Oe;break;default:throw"EXRLoader.parse: "+G.compression+" is unsupported"}if(He.scanlineBlockSize=He.lines,He.type==1)switch(Pe){case Vi:He.getter=St,He.inputSize=2;break;case sa:He.getter=We,He.inputSize=2;break}else if(He.type==2)switch(Pe){case Vi:He.getter=qt,He.inputSize=4;break;case sa:He.getter=de,He.inputSize=4}else throw"EXRLoader.parse: unsupported pixelType "+He.type+" for "+G.compression+".";He.blockCount=(G.dataWindow.yMax+1)/He.scanlineBlockSize;for(var ot=0;ot<He.blockCount;ot++)st(J,Re);He.outputChannels=He.channels==3?4:He.channels;const nt=He.width*He.height*He.outputChannels;switch(Pe){case Vi:He.byteArray=new Float32Array(nt),He.channels<He.outputChannels&&He.byteArray.fill(1,0,nt);break;case sa:He.byteArray=new Uint16Array(nt),He.channels<He.outputChannels&&He.byteArray.fill(15360,0,nt);break;default:console.error("THREE.EXRLoader: unsupported type: ",Pe);break}return He.bytesPerLine=He.width*He.inputSize*He.channels,He.outputChannels==4?He.format=ga:He.format=lp,sm?He.colorSpace="srgb-linear":He.encoding=3e3,He}const Ui=new DataView(e),Zi=new Uint8Array(e),Ia={value:0},vi=Ni(Ui,e,Ia),en=fa(vi,Ui,Zi,Ia,this.type),ci={value:0},fn={R:0,G:1,B:2,A:3,Y:0};for(let G=0;G<en.height/en.scanlineBlockSize;G++){const J=qe(Ui,Ia);en.size=qe(Ui,Ia),en.lines=J+en.scanlineBlockSize>en.height?en.height-J:en.scanlineBlockSize;const Re=en.size<en.lines*en.bytesPerLine?en.uncompress(en):j(en);Ia.value+=en.size;for(let Pe=0;Pe<en.scanlineBlockSize;Pe++){const He=Pe+G*en.scanlineBlockSize;if(He>=en.height)break;for(let ot=0;ot<en.channels;ot++){const nt=fn[vi.channels[ot].name];for(let Ze=0;Ze<en.width;Ze++){ci.value=(Pe*(en.channels*en.width)+ot*en.width+Ze)*en.inputSize;const je=(en.height-1-He)*(en.width*en.outputChannels)+Ze*en.outputChannels+nt;en.byteArray[je]=en.getter(Re,ci)}}}}return{header:vi,width:en.width,height:en.height,data:en.byteArray,format:en.format,[sm?"colorSpace":"encoding"]:en[sm?"colorSpace":"encoding"],type:this.type}}setDataType(e){return this.type=e,this}load(e,t,n,i){function o(l,h){sm?l.colorSpace=h.colorSpace:l.encoding=h.encoding,l.minFilter=In,l.magFilter=In,l.generateMipmaps=!1,l.flipY=!1,t&&t(l,h)}return super.load(e,o,n,i)}}const RS=new WeakMap;class VI extends Ka{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,n,i){const o=new Na(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,l=>{const h={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(l,h).then(t).catch(i)},n,i)}decodeDracoFile(e,t,n,i){const o={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:i||this.defaultAttributeTypes,useUniqueIDs:!!n};this.decodeGeometry(e,o).then(t)}decodeGeometry(e,t){for(const d in t.attributeTypes){const p=t.attributeTypes[d];p.BYTES_PER_ELEMENT!==void 0&&(t.attributeTypes[d]=p.name)}const n=JSON.stringify(t);if(RS.has(e)){const d=RS.get(e);if(d.key===n)return d.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 i;const o=this.workerNextTaskID++,l=e.byteLength,h=this._getWorker(o,l).then(d=>(i=d,new Promise((p,_)=>{i._callbacks[o]={resolve:p,reject:_},i.postMessage({type:"decode",id:o,taskConfig:t,buffer:e},[e])}))).then(d=>this._createGeometry(d.geometry));return h.catch(()=>!0).then(()=>{i&&o&&this._releaseTask(i,o)}),RS.set(e,{key:n,promise:h}),h}_createGeometry(e){const t=new yn;e.index&&t.setIndex(new Kn(e.index.array,1));for(let n=0;n<e.attributes.length;n++){const i=e.attributes[n],o=i.name,l=i.array,h=i.itemSize;t.setAttribute(o,new Kn(l,h))}return t}_loadLibrary(e,t){const n=new Na(this.manager);return n.setPath(this.decoderPath),n.setResponseType(t),n.setWithCredentials(this.withCredentials),new Promise((i,o)=>{n.load(e,i,void 0,o)})}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(n=>{const i=n[0];e||(this.decoderConfig.wasmBinary=n[1]);const o=kI.toString(),l=["/* draco decoder */",i,"","/* worker */",o.substring(o.indexOf("{")+1,o.lastIndexOf("}"))].join(`
4115
+ `;continue}if((H=he.match(F))&&(ie.gamma=parseFloat(H[1])),(H=he.match(K))&&(ie.exposure=parseFloat(H[1])),(H=he.match(ne))&&(ie.valid|=2,ie.format=H[1]),(H=he.match(ee))&&(ie.valid|=4,ie.height=parseInt(H[1],10),ie.width=parseInt(H[2],10)),ie.valid&2&&ie.valid&4)break}return ie.valid&2||l(3,"missing format specifier"),ie.valid&4||l(3,"missing image size specifier"),ie},x=function(V,N,F){const K=N;if(K<8||K>32767||V[0]!==2||V[1]!==2||V[2]&128)return new Uint8Array(V);K!==(V[2]<<8|V[3])&&l(3,"wrong scanline width");const ne=new Uint8Array(4*N*F);ne.length||l(4,"unable to allocate buffer space");let ee=0,ie=0;const he=4*K,H=new Uint8Array(4),Y=new Uint8Array(he);let $=F;for(;$>0&&ie<V.byteLength;){ie+4>V.byteLength&&l(1),H[0]=V[ie++],H[1]=V[ie++],H[2]=V[ie++],H[3]=V[ie++],(H[0]!=2||H[1]!=2||(H[2]<<8|H[3])!=K)&&l(3,"bad rgbe scanline format");let ye=0,_e;for(;ye<he&&ie<V.byteLength;){_e=V[ie++];const ae=_e>128;if(ae&&(_e-=128),(_e===0||ye+_e>he)&&l(3,"bad scanline data"),ae){const Me=V[ie++];for(let Ne=0;Ne<_e;Ne++)Y[ye++]=Me}else Y.set(V.subarray(ie,ie+_e),ye),ye+=_e,ie+=_e}const W=K;for(let ae=0;ae<W;ae++){let Me=0;ne[ee]=Y[ae+Me],Me+=K,ne[ee+1]=Y[ae+Me],Me+=K,ne[ee+2]=Y[ae+Me],Me+=K,ne[ee+3]=Y[ae+Me],ee+=4}$--}return ne},b=function(V,N,F,K){const ne=V[N+3],ee=Math.pow(2,ne-128)/255;F[K+0]=V[N+0]*ee,F[K+1]=V[N+1]*ee,F[K+2]=V[N+2]*ee,F[K+3]=1},R=function(V,N,F,K){const ne=V[N+3],ee=Math.pow(2,ne-128)/255;F[K+0]=Pu.toHalfFloat(Math.min(V[N+0]*ee,65504)),F[K+1]=Pu.toHalfFloat(Math.min(V[N+1]*ee,65504)),F[K+2]=Pu.toHalfFloat(Math.min(V[N+2]*ee,65504)),F[K+3]=Pu.toHalfFloat(1)},T=new Uint8Array(e);T.pos=0;const M=y(T),w=M.width,D=M.height,L=x(T.subarray(T.pos),w,D);let P,O,z;switch(this.type){case Vi:z=L.length/4;const V=new Float32Array(z*4);for(let F=0;F<z;F++)b(L,F*4,V,F*4);P=V,O=Vi;break;case sa:z=L.length/4;const N=new Uint16Array(z*4);for(let F=0;F<z;F++)R(L,F*4,N,F*4);P=N,O=sa;break;default:throw new Error("THREE.RGBELoader: Unsupported type: "+this.type)}return{width:w,height:D,data:P,header:M.string,gamma:M.gamma,exposure:M.exposure,type:O}}setDataType(e){return this.type=e,this}load(e,t,n,i){function o(l,h){switch(l.type){case Vi:case sa:"colorSpace"in l?l.colorSpace="srgb-linear":l.encoding=3e3,l.minFilter=In,l.magFilter=In,l.generateMipmaps=!1,l.flipY=!0;break}t&&t(l,h)}return super.load(e,o,n,i)}}const sm=vS>=152;class zI extends hA{constructor(e){super(e),this.type=sa}parse(e){const N=Math.pow(2.7182818,2.2);function F(G,J){for(var oe=0,Re=0;Re<65536;++Re)(Re==0||G[Re>>3]&1<<(Re&7))&&(J[oe++]=Re);for(var Pe=oe-1;oe<65536;)J[oe++]=0;return Pe}function K(G){for(var J=0;J<16384;J++)G[J]={},G[J].len=0,G[J].lit=0,G[J].p=null}const ne={l:0,c:0,lc:0};function ee(G,J,oe,Re,Pe){for(;oe<G;)J=J<<8|Tt(Re,Pe),oe+=8;oe-=G,ne.l=J>>oe&(1<<G)-1,ne.c=J,ne.lc=oe}const ie=new Array(59);function he(G){for(var J=0;J<=58;++J)ie[J]=0;for(var J=0;J<65537;++J)ie[G[J]]+=1;for(var oe=0,J=58;J>0;--J){var Re=oe+ie[J]>>1;ie[J]=oe,oe=Re}for(var J=0;J<65537;++J){var Pe=G[J];Pe>0&&(G[J]=Pe|ie[Pe]++<<6)}}function H(G,J,oe,Re,Pe,He,ot){for(var nt=oe,Ze=0,je=0;Pe<=He;Pe++){if(nt.value-oe.value>Re)return!1;ee(6,Ze,je,G,nt);var vt=ne.l;if(Ze=ne.c,je=ne.lc,ot[Pe]=vt,vt==63){if(nt.value-oe.value>Re)throw"Something wrong with hufUnpackEncTable";ee(8,Ze,je,G,nt);var ht=ne.l+6;if(Ze=ne.c,je=ne.lc,Pe+ht>He+1)throw"Something wrong with hufUnpackEncTable";for(;ht--;)ot[Pe++]=0;Pe--}else if(vt>=59){var ht=vt-59+2;if(Pe+ht>He+1)throw"Something wrong with hufUnpackEncTable";for(;ht--;)ot[Pe++]=0;Pe--}}he(ot)}function Y(G){return G&63}function $(G){return G>>6}function ye(G,J,oe,Re){for(;J<=oe;J++){var Pe=$(G[J]),He=Y(G[J]);if(Pe>>He)throw"Invalid table entry";if(He>14){var ot=Re[Pe>>He-14];if(ot.len)throw"Invalid table entry";if(ot.lit++,ot.p){var nt=ot.p;ot.p=new Array(ot.lit);for(var Ze=0;Ze<ot.lit-1;++Ze)ot.p[Ze]=nt[Ze]}else ot.p=new Array(1);ot.p[ot.lit-1]=J}else if(He)for(var je=0,Ze=1<<14-He;Ze>0;Ze--){var ot=Re[(Pe<<14-He)+je];if(ot.len||ot.p)throw"Invalid table entry";ot.len=He,ot.lit=J,je++}}return!0}const _e={c:0,lc:0};function W(G,J,oe,Re){G=G<<8|Tt(oe,Re),J+=8,_e.c=G,_e.lc=J}const ae={c:0,lc:0};function Me(G,J,oe,Re,Pe,He,ot,nt,Ze,je){if(G==J){Re<8&&(W(oe,Re,Pe,ot),oe=_e.c,Re=_e.lc),Re-=8;var vt=oe>>Re,vt=new Uint8Array([vt])[0];if(Ze.value+vt>je)return!1;for(var ht=nt[Ze.value-1];vt-- >0;)nt[Ze.value++]=ht}else if(Ze.value<je)nt[Ze.value++]=G;else return!1;ae.c=oe,ae.lc=Re}function Ne(G){return G&65535}function it(G){var J=Ne(G);return J>32767?J-65536:J}const ve={a:0,b:0};function Ce(G,J){var oe=it(G),Re=it(J),Pe=Re,He=oe+(Pe&1)+(Pe>>1),ot=He,nt=He-Pe;ve.a=ot,ve.b=nt}function tt(G,J){var oe=Ne(G),Re=Ne(J),Pe=oe-(Re>>1)&65535,He=Re+Pe-32768&65535;ve.a=He,ve.b=Pe}function Et(G,J,oe,Re,Pe,He,ot){for(var nt=ot<16384,Ze=oe>Pe?Pe:oe,je=1,vt;je<=Ze;)je<<=1;for(je>>=1,vt=je,je>>=1;je>=1;){for(var ht=0,k=ht+He*(Pe-vt),te=He*je,fe=He*vt,ce=Re*je,le=Re*vt,Qe,lt,ct,Ct;ht<=k;ht+=fe){for(var xt=ht,Yt=ht+Re*(oe-vt);xt<=Yt;xt+=le){var At=xt+ce,zt=xt+te,mn=zt+ce;nt?(Ce(G[xt+J],G[zt+J]),Qe=ve.a,ct=ve.b,Ce(G[At+J],G[mn+J]),lt=ve.a,Ct=ve.b,Ce(Qe,lt),G[xt+J]=ve.a,G[At+J]=ve.b,Ce(ct,Ct),G[zt+J]=ve.a,G[mn+J]=ve.b):(tt(G[xt+J],G[zt+J]),Qe=ve.a,ct=ve.b,tt(G[At+J],G[mn+J]),lt=ve.a,Ct=ve.b,tt(Qe,lt),G[xt+J]=ve.a,G[At+J]=ve.b,tt(ct,Ct),G[zt+J]=ve.a,G[mn+J]=ve.b)}if(oe&je){var zt=xt+te;nt?Ce(G[xt+J],G[zt+J]):tt(G[xt+J],G[zt+J]),Qe=ve.a,G[zt+J]=ve.b,G[xt+J]=Qe}}if(Pe&je)for(var xt=ht,Yt=ht+Re*(oe-vt);xt<=Yt;xt+=le){var At=xt+ce;nt?Ce(G[xt+J],G[At+J]):tt(G[xt+J],G[At+J]),Qe=ve.a,G[At+J]=ve.b,G[xt+J]=Qe}vt=je,je>>=1}return ht}function wt(G,J,oe,Re,Pe,He,ot,nt,Ze,je){for(var vt=0,ht=0,k=nt,te=Math.trunc(Pe.value+(He+7)/8);Pe.value<te;)for(W(vt,ht,oe,Pe),vt=_e.c,ht=_e.lc;ht>=14;){var fe=vt>>ht-14&16383,ce=J[fe];if(ce.len)ht-=ce.len,Me(ce.lit,ot,vt,ht,oe,Re,Pe,Ze,je,k),vt=ae.c,ht=ae.lc;else{if(!ce.p)throw"hufDecode issues";var le;for(le=0;le<ce.lit;le++){for(var Qe=Y(G[ce.p[le]]);ht<Qe&&Pe.value<te;)W(vt,ht,oe,Pe),vt=_e.c,ht=_e.lc;if(ht>=Qe&&$(G[ce.p[le]])==(vt>>ht-Qe&(1<<Qe)-1)){ht-=Qe,Me(ce.p[le],ot,vt,ht,oe,Re,Pe,Ze,je,k),vt=ae.c,ht=ae.lc;break}}if(le==ce.lit)throw"hufDecode issues"}}var lt=8-He&7;for(vt>>=lt,ht-=lt;ht>0;){var ce=J[vt<<14-ht&16383];if(ce.len)ht-=ce.len,Me(ce.lit,ot,vt,ht,oe,Re,Pe,Ze,je,k),vt=ae.c,ht=ae.lc;else throw"hufDecode issues"}return!0}function on(G,J,oe,Re,Pe,He){var ot={value:0},nt=oe.value,Ze=qe(J,oe),je=qe(J,oe);oe.value+=4;var vt=qe(J,oe);if(oe.value+=4,Ze<0||Ze>=65537||je<0||je>=65537)throw"Something wrong with HUF_ENCSIZE";var ht=new Array(65537),k=new Array(16384);K(k);var te=Re-(oe.value-nt);if(H(G,J,oe,te,Ze,je,ht),vt>8*(Re-(oe.value-nt)))throw"Something wrong with hufUncompress";ye(ht,Ze,je,k),wt(ht,k,G,J,oe,vt,je,He,Pe,ot)}function It(G,J,oe){for(var Re=0;Re<oe;++Re)J[Re]=G[J[Re]]}function mt(G){for(var J=1;J<G.length;J++){var oe=G[J-1]+G[J]-128;G[J]=oe}}function me(G,J){for(var oe=0,Re=Math.floor((G.length+1)/2),Pe=0,He=G.length-1;!(Pe>He||(J[Pe++]=G[oe++],Pe>He));)J[Pe++]=G[Re++]}function Le(G){for(var J=G.byteLength,oe=new Array,Re=0,Pe=new DataView(G);J>0;){var He=Pe.getInt8(Re++);if(He<0){var ot=-He;J-=ot+1;for(var nt=0;nt<ot;nt++)oe.push(Pe.getUint8(Re++))}else{var ot=He;J-=2;for(var Ze=Pe.getUint8(Re++),nt=0;nt<ot+1;nt++)oe.push(Ze)}}return oe}function Ue(G,J,oe,Re,Pe,He){var At=new DataView(He.buffer),ot=oe[G.idx[0]].width,nt=oe[G.idx[0]].height,Ze=3,je=Math.floor(ot/8),vt=Math.ceil(ot/8),ht=Math.ceil(nt/8),k=ot-(vt-1)*8,te=nt-(ht-1)*8,fe={value:0},ce=new Array(Ze),le=new Array(Ze),Qe=new Array(Ze),lt=new Array(Ze),ct=new Array(Ze);for(let Qt=0;Qt<Ze;++Qt)ct[Qt]=J[G.idx[Qt]],ce[Qt]=Qt<1?0:ce[Qt-1]+vt*ht,le[Qt]=new Float32Array(64),Qe[Qt]=new Uint16Array(64),lt[Qt]=new Uint16Array(vt*64);for(let Qt=0;Qt<ht;++Qt){var Ct=8;Qt==ht-1&&(Ct=te);var xt=8;for(let $t=0;$t<vt;++$t){$t==vt-1&&(xt=k);for(let Lt=0;Lt<Ze;++Lt)Qe[Lt].fill(0),Qe[Lt][0]=Pe[ce[Lt]++],rt(fe,Re,Qe[Lt]),Q(Qe[Lt],le[Lt]),Kt(le[Lt]);_t(le);for(let Lt=0;Lt<Ze;++Lt)Ft(le[Lt],lt[Lt],$t*64)}let Dt=0;for(let $t=0;$t<Ze;++$t){const Lt=oe[G.idx[$t]].type;for(let ei=8*Qt;ei<8*Qt+Ct;++ei){Dt=ct[$t][ei];for(let Qi=0;Qi<je;++Qi){const Gn=Qi*64+(ei&7)*8;At.setUint16(Dt+0*Lt,lt[$t][Gn+0],!0),At.setUint16(Dt+2*Lt,lt[$t][Gn+1],!0),At.setUint16(Dt+4*Lt,lt[$t][Gn+2],!0),At.setUint16(Dt+6*Lt,lt[$t][Gn+3],!0),At.setUint16(Dt+8*Lt,lt[$t][Gn+4],!0),At.setUint16(Dt+10*Lt,lt[$t][Gn+5],!0),At.setUint16(Dt+12*Lt,lt[$t][Gn+6],!0),At.setUint16(Dt+14*Lt,lt[$t][Gn+7],!0),Dt+=16*Lt}}if(je!=vt)for(let ei=8*Qt;ei<8*Qt+Ct;++ei){const Qi=ct[$t][ei]+8*je*2*Lt,Gn=je*64+(ei&7)*8;for(let Fi=0;Fi<xt;++Fi)At.setUint16(Qi+Fi*2*Lt,lt[$t][Gn+Fi],!0)}}}for(var Yt=new Uint16Array(ot),At=new DataView(He.buffer),zt=0;zt<Ze;++zt){oe[G.idx[zt]].decoded=!0;var mn=oe[G.idx[zt]].type;if(oe[zt].type==2)for(var Pn=0;Pn<nt;++Pn){const Qt=ct[zt][Pn];for(var xn=0;xn<ot;++xn)Yt[xn]=At.getUint16(Qt+xn*2*mn,!0);for(var xn=0;xn<ot;++xn)At.setFloat32(Qt+xn*2*mn,be(Yt[xn]),!0)}}}function rt(G,J,oe){for(var Re,Pe=1;Pe<64;)Re=J[G.value],Re==65280?Pe=64:Re>>8==255?Pe+=Re&255:(oe[Pe]=Re,Pe++),G.value++}function Q(G,J){J[0]=be(G[0]),J[1]=be(G[1]),J[2]=be(G[5]),J[3]=be(G[6]),J[4]=be(G[14]),J[5]=be(G[15]),J[6]=be(G[27]),J[7]=be(G[28]),J[8]=be(G[2]),J[9]=be(G[4]),J[10]=be(G[7]),J[11]=be(G[13]),J[12]=be(G[16]),J[13]=be(G[26]),J[14]=be(G[29]),J[15]=be(G[42]),J[16]=be(G[3]),J[17]=be(G[8]),J[18]=be(G[12]),J[19]=be(G[17]),J[20]=be(G[25]),J[21]=be(G[30]),J[22]=be(G[41]),J[23]=be(G[43]),J[24]=be(G[9]),J[25]=be(G[11]),J[26]=be(G[18]),J[27]=be(G[24]),J[28]=be(G[31]),J[29]=be(G[40]),J[30]=be(G[44]),J[31]=be(G[53]),J[32]=be(G[10]),J[33]=be(G[19]),J[34]=be(G[23]),J[35]=be(G[32]),J[36]=be(G[39]),J[37]=be(G[45]),J[38]=be(G[52]),J[39]=be(G[54]),J[40]=be(G[20]),J[41]=be(G[22]),J[42]=be(G[33]),J[43]=be(G[38]),J[44]=be(G[46]),J[45]=be(G[51]),J[46]=be(G[55]),J[47]=be(G[60]),J[48]=be(G[21]),J[49]=be(G[34]),J[50]=be(G[37]),J[51]=be(G[47]),J[52]=be(G[50]),J[53]=be(G[56]),J[54]=be(G[59]),J[55]=be(G[61]),J[56]=be(G[35]),J[57]=be(G[36]),J[58]=be(G[48]),J[59]=be(G[49]),J[60]=be(G[57]),J[61]=be(G[58]),J[62]=be(G[62]),J[63]=be(G[63])}function Kt(G){const J=.5*Math.cos(.7853975),oe=.5*Math.cos(3.14159/16),Re=.5*Math.cos(3.14159/8),Pe=.5*Math.cos(3*3.14159/16),He=.5*Math.cos(5*3.14159/16),ot=.5*Math.cos(3*3.14159/8),nt=.5*Math.cos(7*3.14159/16);for(var Ze=new Array(4),je=new Array(4),vt=new Array(4),ht=new Array(4),k=0;k<8;++k){var te=k*8;Ze[0]=Re*G[te+2],Ze[1]=ot*G[te+2],Ze[2]=Re*G[te+6],Ze[3]=ot*G[te+6],je[0]=oe*G[te+1]+Pe*G[te+3]+He*G[te+5]+nt*G[te+7],je[1]=Pe*G[te+1]-nt*G[te+3]-oe*G[te+5]-He*G[te+7],je[2]=He*G[te+1]-oe*G[te+3]+nt*G[te+5]+Pe*G[te+7],je[3]=nt*G[te+1]-He*G[te+3]+Pe*G[te+5]-oe*G[te+7],vt[0]=J*(G[te+0]+G[te+4]),vt[3]=J*(G[te+0]-G[te+4]),vt[1]=Ze[0]+Ze[3],vt[2]=Ze[1]-Ze[2],ht[0]=vt[0]+vt[1],ht[1]=vt[3]+vt[2],ht[2]=vt[3]-vt[2],ht[3]=vt[0]-vt[1],G[te+0]=ht[0]+je[0],G[te+1]=ht[1]+je[1],G[te+2]=ht[2]+je[2],G[te+3]=ht[3]+je[3],G[te+4]=ht[3]-je[3],G[te+5]=ht[2]-je[2],G[te+6]=ht[1]-je[1],G[te+7]=ht[0]-je[0]}for(var fe=0;fe<8;++fe)Ze[0]=Re*G[16+fe],Ze[1]=ot*G[16+fe],Ze[2]=Re*G[48+fe],Ze[3]=ot*G[48+fe],je[0]=oe*G[8+fe]+Pe*G[24+fe]+He*G[40+fe]+nt*G[56+fe],je[1]=Pe*G[8+fe]-nt*G[24+fe]-oe*G[40+fe]-He*G[56+fe],je[2]=He*G[8+fe]-oe*G[24+fe]+nt*G[40+fe]+Pe*G[56+fe],je[3]=nt*G[8+fe]-He*G[24+fe]+Pe*G[40+fe]-oe*G[56+fe],vt[0]=J*(G[fe]+G[32+fe]),vt[3]=J*(G[fe]-G[32+fe]),vt[1]=Ze[0]+Ze[3],vt[2]=Ze[1]-Ze[2],ht[0]=vt[0]+vt[1],ht[1]=vt[3]+vt[2],ht[2]=vt[3]-vt[2],ht[3]=vt[0]-vt[1],G[0+fe]=ht[0]+je[0],G[8+fe]=ht[1]+je[1],G[16+fe]=ht[2]+je[2],G[24+fe]=ht[3]+je[3],G[32+fe]=ht[3]-je[3],G[40+fe]=ht[2]-je[2],G[48+fe]=ht[1]-je[1],G[56+fe]=ht[0]-je[0]}function _t(G){for(var J=0;J<64;++J){var oe=G[0][J],Re=G[1][J],Pe=G[2][J];G[0][J]=oe+1.5747*Pe,G[1][J]=oe-.1873*Re-.4682*Pe,G[2][J]=oe+1.8556*Re}}function Ft(G,J,oe){for(var Re=0;Re<64;++Re)J[oe+Re]=Pu.toHalfFloat(yt(G[Re]))}function yt(G){return G<=1?Math.sign(G)*Math.pow(Math.abs(G),2.2):Math.sign(G)*Math.pow(N,Math.abs(G)-1)}function j(G){return new DataView(G.array.buffer,G.offset.value,G.size)}function I(G){var J=G.viewer.buffer.slice(G.offset.value,G.offset.value+G.size),oe=new Uint8Array(Le(J)),Re=new Uint8Array(oe.length);return mt(oe),me(oe,Re),new DataView(Re.buffer)}function ue(G){var J=G.array.slice(G.offset.value,G.offset.value+G.size),oe=h_(J),Re=new Uint8Array(oe.length);return mt(oe),me(oe,Re),new DataView(Re.buffer)}function Ie(G){for(var J=G.viewer,oe={value:G.offset.value},Re=new Uint16Array(G.width*G.scanlineBlockSize*(G.channels*G.type)),Pe=new Uint8Array(8192),He=0,ot=new Array(G.channels),nt=0;nt<G.channels;nt++)ot[nt]={},ot[nt].start=He,ot[nt].end=ot[nt].start,ot[nt].nx=G.width,ot[nt].ny=G.lines,ot[nt].size=G.type,He+=ot[nt].nx*ot[nt].ny*ot[nt].size;var Ze=We(J,oe),je=We(J,oe);if(je>=8192)throw"Something is wrong with PIZ_COMPRESSION BITMAP_SIZE";if(Ze<=je)for(var nt=0;nt<je-Ze+1;nt++)Pe[nt+Ze]=pt(J,oe);var vt=new Uint16Array(65536),ht=F(Pe,vt),k=qe(J,oe);on(G.array,J,oe,k,Re,He);for(var nt=0;nt<G.channels;++nt)for(var te=ot[nt],fe=0;fe<ot[nt].size;++fe)Et(Re,te.start+fe,te.nx,te.size,te.ny,te.nx*te.size,ht);It(vt,Re,He);for(var ce=0,le=new Uint8Array(Re.buffer.byteLength),Qe=0;Qe<G.lines;Qe++)for(var lt=0;lt<G.channels;lt++){var te=ot[lt],ct=te.nx*te.size,Ct=new Uint8Array(Re.buffer,te.end*2,ct*2);le.set(Ct,ce),ce+=ct*2,te.end+=ct}return new DataView(le.buffer)}function Xe(G){var J=G.array.slice(G.offset.value,G.offset.value+G.size),oe=h_(J);const Re=G.lines*G.channels*G.width,Pe=G.type==1?new Uint16Array(Re):new Uint32Array(Re);let He=0,ot=0;const nt=new Array(4);for(let Ze=0;Ze<G.lines;Ze++)for(let je=0;je<G.channels;je++){let vt=0;switch(G.type){case 1:nt[0]=He,nt[1]=nt[0]+G.width,He=nt[1]+G.width;for(let ht=0;ht<G.width;++ht){const k=oe[nt[0]++]<<8|oe[nt[1]++];vt+=k,Pe[ot]=vt,ot++}break;case 2:nt[0]=He,nt[1]=nt[0]+G.width,nt[2]=nt[1]+G.width,He=nt[2]+G.width;for(let ht=0;ht<G.width;++ht){const k=oe[nt[0]++]<<24|oe[nt[1]++]<<16|oe[nt[2]++]<<8;vt+=k,Pe[ot]=vt,ot++}break}}return new DataView(Pe.buffer)}function Oe(G){var J=G.viewer,oe={value:G.offset.value},Re=new Uint8Array(G.width*G.lines*(G.channels*G.type*2)),Pe={version:st(J,oe),unknownUncompressedSize:st(J,oe),unknownCompressedSize:st(J,oe),acCompressedSize:st(J,oe),dcCompressedSize:st(J,oe),rleCompressedSize:st(J,oe),rleUncompressedSize:st(J,oe),rleRawSize:st(J,oe),totalAcUncompressedCount:st(J,oe),totalDcUncompressedCount:st(J,oe),acCompression:st(J,oe)};if(Pe.version<2)throw"EXRLoader.parse: "+vi.compression+" version "+Pe.version+" is unsupported";for(var He=new Array,ot=We(J,oe)-2;ot>0;){var nt=Bt(J.buffer,oe),Ze=pt(J,oe),je=Ze>>2&3,vt=(Ze>>4)-1,ht=new Int8Array([vt])[0],k=pt(J,oe);He.push({name:nt,index:ht,type:k,compression:je}),ot-=nt.length+3}for(var te=vi.channels,fe=new Array(G.channels),ce=0;ce<G.channels;++ce){var le=fe[ce]={},Qe=te[ce];le.name=Qe.name,le.compression=0,le.decoded=!1,le.type=Qe.pixelType,le.pLinear=Qe.pLinear,le.width=G.width,le.height=G.lines}for(var lt={idx:new Array(3)},ct=0;ct<G.channels;++ct)for(var le=fe[ct],ce=0;ce<He.length;++ce){var Ct=He[ce];le.name==Ct.name&&(le.compression=Ct.compression,Ct.index>=0&&(lt.idx[Ct.index]=ct),le.offset=ct)}if(Pe.acCompressedSize>0)switch(Pe.acCompression){case 0:var At=new Uint16Array(Pe.totalAcUncompressedCount);on(G.array,J,oe,Pe.acCompressedSize,At,Pe.totalAcUncompressedCount);break;case 1:var xt=G.array.slice(oe.value,oe.value+Pe.totalAcUncompressedCount),Yt=h_(xt),At=new Uint16Array(Yt.buffer);oe.value+=Pe.totalAcUncompressedCount;break}if(Pe.dcCompressedSize>0){var zt={array:G.array,offset:oe,size:Pe.dcCompressedSize},mn=new Uint16Array(ue(zt).buffer);oe.value+=Pe.dcCompressedSize}if(Pe.rleRawSize>0){var xt=G.array.slice(oe.value,oe.value+Pe.rleCompressedSize),Yt=h_(xt),Pn=Le(Yt.buffer);oe.value+=Pe.rleCompressedSize}for(var xn=0,Qt=new Array(fe.length),ce=0;ce<Qt.length;++ce)Qt[ce]=new Array;for(var Dt=0;Dt<G.lines;++Dt)for(var $t=0;$t<fe.length;++$t)Qt[$t].push(xn),xn+=fe[$t].width*G.type*2;Ue(lt,Qt,fe,At,mn,Re);for(var ce=0;ce<fe.length;++ce){var le=fe[ce];if(!le.decoded)switch(le.compression){case 2:for(var Lt=0,ei=0,Dt=0;Dt<G.lines;++Dt){for(var Qi=Qt[ce][Lt],Gn=0;Gn<le.width;++Gn){for(var Fi=0;Fi<2*le.type;++Fi)Re[Qi++]=Pn[ei+Fi*le.width*le.height];ei++}Lt++}break;default:throw"EXRLoader.parse: unsupported channel compression"}}return new DataView(Re.buffer)}function Bt(G,J){for(var oe=new Uint8Array(G),Re=0;oe[J.value+Re]!=0;)Re+=1;var Pe=new TextDecoder().decode(oe.slice(J.value,J.value+Re));return J.value=J.value+Re+1,Pe}function gt(G,J,oe){var Re=new TextDecoder().decode(new Uint8Array(G).slice(J.value,J.value+oe));return J.value=J.value+oe,Re}function Ht(G,J){var oe=ze(G,J),Re=qe(G,J);return[oe,Re]}function Xt(G,J){var oe=qe(G,J),Re=qe(G,J);return[oe,Re]}function ze(G,J){var oe=G.getInt32(J.value,!0);return J.value=J.value+4,oe}function qe(G,J){var oe=G.getUint32(J.value,!0);return J.value=J.value+4,oe}function Tt(G,J){var oe=G[J.value];return J.value=J.value+1,oe}function pt(G,J){var oe=G.getUint8(J.value);return J.value=J.value+1,oe}const st=function(G,J){let oe;return"getBigInt64"in DataView.prototype?oe=Number(G.getBigInt64(J.value,!0)):oe=G.getUint32(J.value+4,!0)+Number(G.getUint32(J.value,!0)<<32),J.value+=8,oe};function qt(G,J){var oe=G.getFloat32(J.value,!0);return J.value+=4,oe}function de(G,J){return Pu.toHalfFloat(qt(G,J))}function be(G){var J=(G&31744)>>10,oe=G&1023;return(G>>15?-1:1)*(J?J===31?oe?NaN:1/0:Math.pow(2,J-15)*(1+oe/1024):6103515625e-14*(oe/1024))}function We(G,J){var oe=G.getUint16(J.value,!0);return J.value+=2,oe}function St(G,J){return be(We(G,J))}function Ye(G,J,oe,Re){for(var Pe=oe.value,He=[];oe.value<Pe+Re-1;){var ot=Bt(J,oe),nt=ze(G,oe),Ze=pt(G,oe);oe.value+=3;var je=ze(G,oe),vt=ze(G,oe);He.push({name:ot,pixelType:nt,pLinear:Ze,xSampling:je,ySampling:vt})}return oe.value+=1,He}function Ve(G,J){var oe=qt(G,J),Re=qt(G,J),Pe=qt(G,J),He=qt(G,J),ot=qt(G,J),nt=qt(G,J),Ze=qt(G,J),je=qt(G,J);return{redX:oe,redY:Re,greenX:Pe,greenY:He,blueX:ot,blueY:nt,whiteX:Ze,whiteY:je}}function ft(G,J){var oe=["NO_COMPRESSION","RLE_COMPRESSION","ZIPS_COMPRESSION","ZIP_COMPRESSION","PIZ_COMPRESSION","PXR24_COMPRESSION","B44_COMPRESSION","B44A_COMPRESSION","DWAA_COMPRESSION","DWAB_COMPRESSION"],Re=pt(G,J);return oe[Re]}function jt(G,J){var oe=qe(G,J),Re=qe(G,J),Pe=qe(G,J),He=qe(G,J);return{xMin:oe,yMin:Re,xMax:Pe,yMax:He}}function Mn(G,J){var oe=["INCREASING_Y"],Re=pt(G,J);return oe[Re]}function bt(G,J){var oe=qt(G,J),Re=qt(G,J);return[oe,Re]}function Dn(G,J){var oe=qt(G,J),Re=qt(G,J),Pe=qt(G,J);return[oe,Re,Pe]}function Nn(G,J,oe,Re,Pe){if(Re==="string"||Re==="stringvector"||Re==="iccProfile")return gt(J,oe,Pe);if(Re==="chlist")return Ye(G,J,oe,Pe);if(Re==="chromaticities")return Ve(G,oe);if(Re==="compression")return ft(G,oe);if(Re==="box2i")return jt(G,oe);if(Re==="lineOrder")return Mn(G,oe);if(Re==="float")return qt(G,oe);if(Re==="v2f")return bt(G,oe);if(Re==="v3f")return Dn(G,oe);if(Re==="int")return ze(G,oe);if(Re==="rational")return Ht(G,oe);if(Re==="timecode")return Xt(G,oe);if(Re==="preview")return oe.value+=Pe,"skipped";oe.value+=Pe}function Ni(G,J,oe){const Re={};if(G.getUint32(0,!0)!=20000630)throw"THREE.EXRLoader: provided file doesn't appear to be in OpenEXR format.";Re.version=G.getUint8(4);const Pe=G.getUint8(5);Re.spec={singleTile:!!(Pe&2),longName:!!(Pe&4),deepFormat:!!(Pe&8),multiPart:!!(Pe&16)},oe.value=8;for(var He=!0;He;){var ot=Bt(J,oe);if(ot==0)He=!1;else{var nt=Bt(J,oe),Ze=qe(G,oe),je=Nn(G,J,oe,nt,Ze);je===void 0?console.warn(`EXRLoader.parse: skipped unknown header attribute type '${nt}'.`):Re[ot]=je}}if((Pe&-5)!=0)throw console.error("EXRHeader:",Re),"THREE.EXRLoader: provided file is currently unsupported.";return Re}function fa(G,J,oe,Re,Pe){const He={size:0,viewer:J,array:oe,offset:Re,width:G.dataWindow.xMax-G.dataWindow.xMin+1,height:G.dataWindow.yMax-G.dataWindow.yMin+1,channels:G.channels.length,bytesPerLine:null,lines:null,inputSize:null,type:G.channels[0].pixelType,uncompress:null,getter:null,format:null,[sm?"colorSpace":"encoding"]:null};switch(G.compression){case"NO_COMPRESSION":He.lines=1,He.uncompress=j;break;case"RLE_COMPRESSION":He.lines=1,He.uncompress=I;break;case"ZIPS_COMPRESSION":He.lines=1,He.uncompress=ue;break;case"ZIP_COMPRESSION":He.lines=16,He.uncompress=ue;break;case"PIZ_COMPRESSION":He.lines=32,He.uncompress=Ie;break;case"PXR24_COMPRESSION":He.lines=16,He.uncompress=Xe;break;case"DWAA_COMPRESSION":He.lines=32,He.uncompress=Oe;break;case"DWAB_COMPRESSION":He.lines=256,He.uncompress=Oe;break;default:throw"EXRLoader.parse: "+G.compression+" is unsupported"}if(He.scanlineBlockSize=He.lines,He.type==1)switch(Pe){case Vi:He.getter=St,He.inputSize=2;break;case sa:He.getter=We,He.inputSize=2;break}else if(He.type==2)switch(Pe){case Vi:He.getter=qt,He.inputSize=4;break;case sa:He.getter=de,He.inputSize=4}else throw"EXRLoader.parse: unsupported pixelType "+He.type+" for "+G.compression+".";He.blockCount=(G.dataWindow.yMax+1)/He.scanlineBlockSize;for(var ot=0;ot<He.blockCount;ot++)st(J,Re);He.outputChannels=He.channels==3?4:He.channels;const nt=He.width*He.height*He.outputChannels;switch(Pe){case Vi:He.byteArray=new Float32Array(nt),He.channels<He.outputChannels&&He.byteArray.fill(1,0,nt);break;case sa:He.byteArray=new Uint16Array(nt),He.channels<He.outputChannels&&He.byteArray.fill(15360,0,nt);break;default:console.error("THREE.EXRLoader: unsupported type: ",Pe);break}return He.bytesPerLine=He.width*He.inputSize*He.channels,He.outputChannels==4?He.format=ga:He.format=lp,sm?He.colorSpace="srgb-linear":He.encoding=3e3,He}const Ui=new DataView(e),Zi=new Uint8Array(e),Ia={value:0},vi=Ni(Ui,e,Ia),en=fa(vi,Ui,Zi,Ia,this.type),ci={value:0},fn={R:0,G:1,B:2,A:3,Y:0};for(let G=0;G<en.height/en.scanlineBlockSize;G++){const J=qe(Ui,Ia);en.size=qe(Ui,Ia),en.lines=J+en.scanlineBlockSize>en.height?en.height-J:en.scanlineBlockSize;const Re=en.size<en.lines*en.bytesPerLine?en.uncompress(en):j(en);Ia.value+=en.size;for(let Pe=0;Pe<en.scanlineBlockSize;Pe++){const He=Pe+G*en.scanlineBlockSize;if(He>=en.height)break;for(let ot=0;ot<en.channels;ot++){const nt=fn[vi.channels[ot].name];for(let Ze=0;Ze<en.width;Ze++){ci.value=(Pe*(en.channels*en.width)+ot*en.width+Ze)*en.inputSize;const je=(en.height-1-He)*(en.width*en.outputChannels)+Ze*en.outputChannels+nt;en.byteArray[je]=en.getter(Re,ci)}}}}return{header:vi,width:en.width,height:en.height,data:en.byteArray,format:en.format,[sm?"colorSpace":"encoding"]:en[sm?"colorSpace":"encoding"],type:this.type}}setDataType(e){return this.type=e,this}load(e,t,n,i){function o(l,h){sm?l.colorSpace=h.colorSpace:l.encoding=h.encoding,l.minFilter=In,l.magFilter=In,l.generateMipmaps=!1,l.flipY=!1,t&&t(l,h)}return super.load(e,o,n,i)}}const RS=new WeakMap;class VI extends Ka{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,n,i){const o=new Na(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,l=>{const h={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(l,h).then(t).catch(i)},n,i)}decodeDracoFile(e,t,n,i){const o={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:i||this.defaultAttributeTypes,useUniqueIDs:!!n};this.decodeGeometry(e,o).then(t)}decodeGeometry(e,t){for(const d in t.attributeTypes){const p=t.attributeTypes[d];p.BYTES_PER_ELEMENT!==void 0&&(t.attributeTypes[d]=p.name)}const n=JSON.stringify(t);if(RS.has(e)){const d=RS.get(e);if(d.key===n)return d.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 i;const o=this.workerNextTaskID++,l=e.byteLength,h=this._getWorker(o,l).then(d=>(i=d,new Promise((p,_)=>{i._callbacks[o]={resolve:p,reject:_},i.postMessage({type:"decode",id:o,taskConfig:t,buffer:e},[e])}))).then(d=>this._createGeometry(d.geometry));return h.catch(()=>!0).then(()=>{i&&o&&this._releaseTask(i,o)}),RS.set(e,{key:n,promise:h}),h}_createGeometry(e){const t=new yn;e.index&&t.setIndex(new Kn(e.index.array,1));for(let n=0;n<e.attributes.length;n++){const i=e.attributes[n],o=i.name,l=i.array,h=i.itemSize;t.setAttribute(o,new Kn(l,h))}return t}_loadLibrary(e,t){const n=new Na(this.manager);return n.setPath(this.decoderPath),n.setResponseType(t),n.setWithCredentials(this.withCredentials),new Promise((i,o)=>{n.load(e,i,void 0,o)})}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(n=>{const i=n[0];e||(this.decoderConfig.wasmBinary=n[1]);const o=kI.toString(),l=["/* draco decoder */",i,"","/* worker */",o.substring(o.indexOf("{")+1,o.lastIndexOf("}"))].join(`
4116
4116
  `);this.workerSourceURL=URL.createObjectURL(new Blob([l]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){const i=new Worker(this.workerSourceURL);i._callbacks={},i._taskCosts={},i._taskLoad=0,i.postMessage({type:"init",decoderConfig:this.decoderConfig}),i.onmessage=function(o){const l=o.data;switch(l.type){case"decode":i._callbacks[l.id].resolve(l);break;case"error":i._callbacks[l.id].reject(l);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+l.type+'"')}},this.workerPool.push(i)}else this.workerPool.sort(function(i,o){return i._taskLoad>o._taskLoad?-1:1});const n=this.workerPool[this.workerPool.length-1];return n._taskCosts[e]=t,n._taskLoad+=t,n})}_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<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this}}function kI(){let s,e;onmessage=function(l){const h=l.data;switch(h.type){case"init":s=h.decoderConfig,e=new Promise(function(_){s.onModuleLoaded=function(v){_({draco:v})},DracoDecoderModule(s)});break;case"decode":const d=h.buffer,p=h.taskConfig;e.then(_=>{const v=_.draco,y=new v.Decoder,x=new v.DecoderBuffer;x.Init(new Int8Array(d),d.byteLength);try{const b=t(v,y,x,p),R=b.attributes.map(T=>T.array.buffer);b.index&&R.push(b.index.array.buffer),self.postMessage({type:"decode",id:h.id,geometry:b},R)}catch(b){console.error(b),self.postMessage({type:"error",id:h.id,error:b.message})}finally{v.destroy(x),v.destroy(y)}});break}};function t(l,h,d,p){const _=p.attributeIDs,v=p.attributeTypes;let y,x;const b=h.GetEncodedGeometryType(d);if(b===l.TRIANGULAR_MESH)y=new l.Mesh,x=h.DecodeBufferToMesh(d,y);else if(b===l.POINT_CLOUD)y=new l.PointCloud,x=h.DecodeBufferToPointCloud(d,y);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!x.ok()||y.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+x.error_msg());const R={index:null,attributes:[]};for(const T in _){const M=self[v[T]];let w,D;if(p.useUniqueIDs)D=_[T],w=h.GetAttributeByUniqueId(y,D);else{if(D=h.GetAttributeId(y,l[_[T]]),D===-1)continue;w=h.GetAttribute(y,D)}R.attributes.push(i(l,h,y,T,M,w))}return b===l.TRIANGULAR_MESH&&(R.index=n(l,h,y)),l.destroy(y),R}function n(l,h,d){const _=d.num_faces()*3,v=_*4,y=l._malloc(v);h.GetTrianglesUInt32Array(d,v,y);const x=new Uint32Array(l.HEAPF32.buffer,y,_).slice();return l._free(y),{array:x,itemSize:1}}function i(l,h,d,p,_,v){const y=v.num_components(),b=d.num_points()*y,R=b*_.BYTES_PER_ELEMENT,T=o(l,_),M=l._malloc(R);h.GetAttributeDataArrayForAllPoints(d,v,T,R,M);const w=new _(l.HEAPF32.buffer,M,b).slice();return l._free(M),{name:p,array:w,itemSize:y}}function o(l,h){switch(h){case Float32Array:return l.DT_FLOAT32;case Int8Array:return l.DT_INT8;case Int16Array:return l.DT_INT16;case Int32Array:return l.DT_INT32;case Uint8Array:return l.DT_UINT8;case Uint16Array:return l.DT_UINT16;case Uint32Array:return l.DT_UINT32}}}let p_;const wS=()=>{if(p_)return p_;const s="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]),n=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 i=s;WebAssembly.validate(t)&&(i=e);let o;const l=WebAssembly.instantiate(h(i),{}).then(v=>{o=v.instance,o.exports.__wasm_call_ctors()});function h(v){const y=new Uint8Array(v.length);for(let b=0;b<v.length;++b){const R=v.charCodeAt(b);y[b]=R>96?R-71:R>64?R-65:R>47?R+4:R>46?63:62}let x=0;for(let b=0;b<v.length;++b)y[x++]=y[b]<60?n[y[b]]:(y[b]-60)*64+y[++b];return y.buffer.slice(0,x)}function d(v,y,x,b,R,T){const M=o.exports.sbrk,w=x+3&-4,D=M(w*b),L=M(R.length),P=new Uint8Array(o.exports.memory.buffer);P.set(R,L);const O=v(D,x,b,L,R.length);if(O===0&&T&&T(D,w,b),y.set(P.subarray(D,D+x*b)),M(D-M(0)),O!==0)throw new Error(`Malformed buffer data: ${O}`)}const p={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},_={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return p_={ready:l,supported:!0,decodeVertexBuffer(v,y,x,b,R){d(o.exports.meshopt_decodeVertexBuffer,v,y,x,b,o.exports[p[R]])},decodeIndexBuffer(v,y,x,b){d(o.exports.meshopt_decodeIndexBuffer,v,y,x,b)},decodeIndexSequence(v,y,x,b){d(o.exports.meshopt_decodeIndexSequence,v,y,x,b)},decodeGltfBuffer(v,y,x,b,R,T){d(o.exports[_[R]],v,y,x,b,o.exports[p[T]])}},p_};let m_=null,eC="https://www.gstatic.com/draco/versioned/decoders/1.5.5/";function tC(s=!0,e=!0,t){return n=>{t&&t(n),s&&(m_||(m_=new VI),m_.setDecoderPath(typeof s=="string"?s:eC),n.setDRACOLoader(m_)),e&&n.setMeshoptDecoder(typeof wS=="function"?wS():wS)}}const Kh=(s,e,t,n)=>Gl(SS,s,tC(e,t,n));Kh.preload=(s,e,t,n)=>Gl.preload(SS,s,tC(e,t,n)),Kh.clear=s=>Gl.clear(SS,s),Kh.setDecoderPath=s=>{eC=s};const nC=(s,e,t)=>{let n;switch(s){case Xa:n=new Uint8ClampedArray(e*t*4);break;case sa:n=new Uint16Array(e*t*4);break;case dr:n=new Uint32Array(e*t*4);break;case Gg:n=new Int8Array(e*t*4);break;case zg:n=new Int16Array(e*t*4);break;case op:n=new Int32Array(e*t*4);break;case Vi:n=new Float32Array(e*t*4);break;default:throw new Error("Unsupported data type")}return n};let g_;const XI=(s,e,t,n)=>{if(g_!==void 0)return g_;const i=new Ds(1,1,n);e.setRenderTarget(i);const o=new Oi(new Nc,new La({color:16777215}));e.render(o,t),e.setRenderTarget(null);const l=nC(s,i.width,i.height);return e.readRenderTargetPixels(i,0,0,i.width,i.height,l),i.dispose(),o.geometry.dispose(),o.material.dispose(),g_=l[0]!==0,g_};class BS{_renderer;_rendererIsDisposable=!1;_material;_scene;_camera;_quad;_renderTarget;_width;_height;_type;_colorSpace;_supportsReadPixels=!0;constructor(e){this._width=e.width,this._height=e.height,this._type=e.type,this._colorSpace=e.colorSpace;const t={format:ga,depthBuffer:!1,stencilBuffer:!1,type:this._type,colorSpace:this._colorSpace,anisotropy:e.renderTargetOptions?.anisotropy!==void 0?e.renderTargetOptions?.anisotropy:1,generateMipmaps:e.renderTargetOptions?.generateMipmaps!==void 0?e.renderTargetOptions?.generateMipmaps:!1,magFilter:e.renderTargetOptions?.magFilter!==void 0?e.renderTargetOptions?.magFilter:In,minFilter:e.renderTargetOptions?.minFilter!==void 0?e.renderTargetOptions?.minFilter:In,samples:e.renderTargetOptions?.samples!==void 0?e.renderTargetOptions?.samples:void 0,wrapS:e.renderTargetOptions?.wrapS!==void 0?e.renderTargetOptions?.wrapS:Gi,wrapT:e.renderTargetOptions?.wrapT!==void 0?e.renderTargetOptions?.wrapT:Gi};if(this._material=e.material,e.renderer?this._renderer=e.renderer:(this._renderer=BS.instantiateRenderer(),this._rendererIsDisposable=!0),this._scene=new Rp,this._camera=new Hl,this._camera.position.set(0,0,10),this._camera.left=-.5,this._camera.right=.5,this._camera.top=.5,this._camera.bottom=-.5,this._camera.updateProjectionMatrix(),!XI(this._type,this._renderer,this._camera,t)){let n;this._type===sa&&(n=this._renderer.extensions.has("EXT_color_buffer_float")?Vi:void 0),n!==void 0?(console.warn(`This browser does not support reading pixels from ${this._type} RenderTargets, switching to ${Vi}`),this._type=n):(this._supportsReadPixels=!1,console.warn("This browser dos not support toArray or toDataTexture, calls to those methods will result in an error thrown"))}this._quad=new Oi(new Nc,this._material),this._quad.geometry.computeBoundingBox(),this._scene.add(this._quad),this._renderTarget=new Ds(this.width,this.height,t),this._renderTarget.texture.mapping=e.renderTargetOptions?.mapping!==void 0?e.renderTargetOptions?.mapping:gc}static instantiateRenderer(){const e=new zA;return e.setSize(128,128),e}render=()=>{this._renderer.setRenderTarget(this._renderTarget);try{this._renderer.render(this._scene,this._camera)}catch(e){throw this._renderer.setRenderTarget(null),e}this._renderer.setRenderTarget(null)};toArray(){if(!this._supportsReadPixels)throw new Error("Can't read pixels in this browser");const e=nC(this._type,this._width,this._height);return this._renderer.readRenderTargetPixels(this._renderTarget,0,0,this._width,this._height,e),e}toDataTexture(e){const t=new Or(this.toArray(),this.width,this.height,ga,this._type,e?.mapping||gc,e?.wrapS||Gi,e?.wrapT||Gi,e?.magFilter||In,e?.minFilter||In,e?.anisotropy||1,Ma);return t.generateMipmaps=e?.generateMipmaps!==void 0?e?.generateMipmaps:!1,t}disposeOnDemandRenderer(){this._renderer.setRenderTarget(null),this._rendererIsDisposable&&(this._renderer.dispose(),this._renderer.forceContextLoss())}dispose(e){this.disposeOnDemandRenderer(),e&&this.renderTarget.dispose(),this.material instanceof Ns&&Object.values(this.material.uniforms).forEach(t=>{t.value instanceof li&&t.value.dispose()}),Object.values(this.material).forEach(t=>{t instanceof li&&t.dispose()}),this.material.dispose(),this._quad.geometry.dispose()}get width(){return this._width}set width(e){this._width=e,this._renderTarget.setSize(this._width,this._height)}get height(){return this._height}set height(e){this._height=e,this._renderTarget.setSize(this._width,this._height)}get renderer(){return this._renderer}get renderTarget(){return this._renderTarget}set renderTarget(e){this._renderTarget=e,this._width=e.width,this._height=e.height}get material(){return this._material}get type(){return this._type}get colorSpace(){return this._colorSpace}}class iC extends Error{}class aC extends Error{}const rm=(s,e,t)=>{const n=new RegExp(`${e}="([^"]*)"`,"i").exec(s);if(n)return n[1];const i=new RegExp(`<${e}[^>]*>([\\s\\S]*?)</${e}>`,"i").exec(s);if(i){const o=i[1].match(/<rdf:li>([^<]*)<\/rdf:li>/g);return o&&o.length===3?o.map(l=>l.replace(/<\/?rdf:li>/g,"")):i[1].trim()}if(t!==void 0)return t;throw new Error(`Can't find ${e} in gainmap metadata`)},YI=s=>{let e;typeof TextDecoder<"u"?e=new TextDecoder().decode(s):e=s.toString();let t=e.indexOf("<x:xmpmeta");for(;t!==-1;){const n=e.indexOf("x:xmpmeta>",t),i=e.slice(t,n+10);try{const o=rm(i,"hdrgm:GainMapMin","0"),l=rm(i,"hdrgm:GainMapMax"),h=rm(i,"hdrgm:Gamma","1"),d=rm(i,"hdrgm:OffsetSDR","0.015625"),p=rm(i,"hdrgm:OffsetHDR","0.015625"),_=/hdrgm:HDRCapacityMin="([^"]*)"/.exec(i),v=_?_[1]:"0",y=/hdrgm:HDRCapacityMax="([^"]*)"/.exec(i);if(!y)throw new Error("Incomplete gainmap metadata");const x=y[1];return{gainMapMin:Array.isArray(o)?o.map(b=>parseFloat(b)):[parseFloat(o),parseFloat(o),parseFloat(o)],gainMapMax:Array.isArray(l)?l.map(b=>parseFloat(b)):[parseFloat(l),parseFloat(l),parseFloat(l)],gamma:Array.isArray(h)?h.map(b=>parseFloat(b)):[parseFloat(h),parseFloat(h),parseFloat(h)],offsetSdr:Array.isArray(d)?d.map(b=>parseFloat(b)):[parseFloat(d),parseFloat(d),parseFloat(d)],offsetHdr:Array.isArray(p)?p.map(b=>parseFloat(b)):[parseFloat(p),parseFloat(p),parseFloat(p)],hdrCapacityMin:parseFloat(v),hdrCapacityMax:parseFloat(x)}}catch{}t=e.indexOf("<x:xmpmeta",n)}};class JI{options;constructor(e){this.options={debug:e&&e.debug!==void 0?e.debug:!1,extractFII:e&&e.extractFII!==void 0?e.extractFII:!0,extractNonFII:e&&e.extractNonFII!==void 0?e.extractNonFII:!0}}extract(e){return new Promise((t,n)=>{const i=this.options.debug,o=new DataView(e.buffer);if(o.getUint16(0)!==65496){n(new Error("Not a valid jpeg"));return}const l=o.byteLength;let h=2,d=0,p;for(;h<l;){if(++d>250){n(new Error(`Found no marker after ${d} loops 😵`));return}if(o.getUint8(h)!==255){n(new Error(`Not a valid marker at offset 0x${h.toString(16)}, found: 0x${o.getUint8(h).toString(16)}`));return}if(p=o.getUint8(h+1),i&&console.log(`Marker: ${p.toString(16)}`),p===226){i&&console.log("Found APP2 marker (0xffe2)");const _=h+4;if(o.getUint32(_)===1297106432){const v=_+4;let y;if(o.getUint16(v)===18761)y=!1;else if(o.getUint16(v)===19789)y=!0;else{n(new Error("No valid endianness marker found in TIFF header"));return}if(o.getUint16(v+2,!y)!==42){n(new Error("Not valid TIFF data! (no 0x002A marker)"));return}const x=o.getUint32(v+4,!y);if(x<8){n(new Error("Not valid TIFF data! (First offset less than 8)"));return}const b=v+x,R=o.getUint16(b,!y),T=b+2;let M=0;for(let P=T;P<T+12*R;P+=12)o.getUint16(P,!y)===45057&&(M=o.getUint32(P+8,!y));const D=b+2+R*12+4,L=[];for(let P=D;P<D+M*16;P+=16){const O={MPType:o.getUint32(P,!y),size:o.getUint32(P+4,!y),dataOffset:o.getUint32(P+8,!y),dependantImages:o.getUint32(P+12,!y),start:-1,end:-1,isFII:!1};O.dataOffset?(O.start=v+O.dataOffset,O.isFII=!1):(O.start=0,O.isFII=!0),O.end=O.start+O.size,L.push(O)}if(this.options.extractNonFII&&L.length){const P=new Blob([o]),O=[];for(const z of L){if(z.isFII&&!this.options.extractFII)continue;const V=P.slice(z.start,z.end+1,"image/jpeg");O.push(V)}t(O)}}}h+=2+o.getUint16(h+2)}})}}const qI=async s=>{const e=YI(s);if(!e)throw new aC("Gain map XMP metadata not found");const n=await new JI({extractFII:!0,extractNonFII:!0}).extract(s);if(n.length!==2)throw new iC("Gain map recovery image not found");return{sdr:new Uint8Array(await n[0].arrayBuffer()),gainMap:new Uint8Array(await n[1].arrayBuffer()),metadata:e}},sC=s=>new Promise((e,t)=>{const n=document.createElement("img");n.onload=()=>{e(n)},n.onerror=i=>{t(i)},n.src=URL.createObjectURL(s)});class KI extends Ka{_renderer;_renderTargetOptions;_internalLoadingManager;_config;constructor(e,t){super(t),this._config=e,e.renderer&&(this._renderer=e.renderer),this._internalLoadingManager=new Pv}setRenderer(e){return this._renderer=e,this}setRenderTargetOptions(e){return this._renderTargetOptions=e,this}prepareQuadRenderer(){this._renderer||console.warn("WARNING: A Renderer was not passed to this Loader constructor or in setRenderer, the result of this Loader will need to be converted to a Data Texture with toDataTexture() before you can use it in your renderer.");const e=this._config.createMaterial({gainMapMax:[1,1,1],gainMapMin:[0,0,0],gamma:[1,1,1],offsetHdr:[1,1,1],offsetSdr:[1,1,1],hdrCapacityMax:1,hdrCapacityMin:0,maxDisplayBoost:1,gainMap:new li,sdr:new li});return this._config.createQuadRenderer({width:16,height:16,type:sa,colorSpace:Ma,material:e,renderer:this._renderer,renderTargetOptions:this._renderTargetOptions})}async processImages(e,t,n){const i=t?new Blob([t],{type:"image/jpeg"}):void 0,o=new Blob([e],{type:"image/jpeg"});let l,h,d=!1;if(typeof createImageBitmap>"u"){const p=await Promise.all([i?sC(i):Promise.resolve(void 0),sC(o)]);h=p[0],l=p[1],d=n==="flipY"}else{const p=await Promise.all([i?createImageBitmap(i,{imageOrientation:n||"flipY"}):Promise.resolve(void 0),createImageBitmap(o,{imageOrientation:n||"flipY"})]);h=p[0],l=p[1]}return{sdrImage:l,gainMapImage:h,needsFlip:d}}createTextures(e,t,n){const i=new li(t||new ImageData(2,2),gc,Gi,Gi,In,ax,ga,Xa,1,Ma);i.flipY=n,i.needsUpdate=!0;const o=new li(e,gc,Gi,Gi,In,ax,ga,Xa,1,ra);return o.flipY=n,o.needsUpdate=!0,{gainMap:i,sdr:o}}updateQuadRenderer(e,t,n,i,o){e.width=t.width,e.height=t.height,e.material.gainMap=n,e.material.sdr=i,e.material.gainMapMin=o.gainMapMin,e.material.gainMapMax=o.gainMapMax,e.material.offsetHdr=o.offsetHdr,e.material.offsetSdr=o.offsetSdr,e.material.gamma=o.gamma,e.material.hdrCapacityMin=o.hdrCapacityMin,e.material.hdrCapacityMax=o.hdrCapacityMax,e.material.maxDisplayBoost=Math.pow(2,o.hdrCapacityMax),e.material.needsUpdate=!0}}const WI=`
4117
4117
  varying vec2 vUv;
4118
4118
 
@@ -4146,12 +4146,12 @@ void main() {
4146
4146
  vec3 clampedHdrColor = max( HALF_FLOAT_MIN, min( HALF_FLOAT_MAX, hdrColor ));
4147
4147
  gl_FragColor = vec4( clampedHdrColor , 1.0 );
4148
4148
  }
4149
- `;class ZI extends Ns{_maxDisplayBoost;_hdrCapacityMin;_hdrCapacityMax;constructor({gamma:e,offsetHdr:t,offsetSdr:n,gainMapMin:i,gainMapMax:o,maxDisplayBoost:l,hdrCapacityMin:h,hdrCapacityMax:d,sdr:p,gainMap:_}){super({name:"GainMapDecoderMaterial",vertexShader:WI,fragmentShader:jI,uniforms:{sdr:{value:p},gainMap:{value:_},gamma:{value:new Z(1/e[0],1/e[1],1/e[2])},offsetHdr:{value:new Z().fromArray(t)},offsetSdr:{value:new Z().fromArray(n)},gainMapMin:{value:new Z().fromArray(i)},gainMapMax:{value:new Z().fromArray(o)},weightFactor:{value:(Math.log2(l)-h)/(d-h)}},blending:so,depthTest:!1,depthWrite:!1}),this._maxDisplayBoost=l,this._hdrCapacityMin=h,this._hdrCapacityMax=d,this.needsUpdate=!0,this.uniformsNeedUpdate=!0}get sdr(){return this.uniforms.sdr.value}set sdr(e){this.uniforms.sdr.value=e}get gainMap(){return this.uniforms.gainMap.value}set gainMap(e){this.uniforms.gainMap.value=e}get offsetHdr(){return this.uniforms.offsetHdr.value.toArray()}set offsetHdr(e){this.uniforms.offsetHdr.value.fromArray(e)}get offsetSdr(){return this.uniforms.offsetSdr.value.toArray()}set offsetSdr(e){this.uniforms.offsetSdr.value.fromArray(e)}get gainMapMin(){return this.uniforms.gainMapMin.value.toArray()}set gainMapMin(e){this.uniforms.gainMapMin.value.fromArray(e)}get gainMapMax(){return this.uniforms.gainMapMax.value.toArray()}set gainMapMax(e){this.uniforms.gainMapMax.value.fromArray(e)}get gamma(){const e=this.uniforms.gamma.value;return[1/e.x,1/e.y,1/e.z]}set gamma(e){const t=this.uniforms.gamma.value;t.x=1/e[0],t.y=1/e[1],t.z=1/e[2]}get hdrCapacityMin(){return this._hdrCapacityMin}set hdrCapacityMin(e){this._hdrCapacityMin=e,this.calculateWeight()}get hdrCapacityMax(){return this._hdrCapacityMax}set hdrCapacityMax(e){this._hdrCapacityMax=e,this.calculateWeight()}get maxDisplayBoost(){return this._maxDisplayBoost}set maxDisplayBoost(e){this._maxDisplayBoost=Math.max(1,Math.min(65504,e)),this.calculateWeight()}calculateWeight(){const e=(Math.log2(this._maxDisplayBoost)-this._hdrCapacityMin)/(this._hdrCapacityMax-this._hdrCapacityMin);this.uniforms.weightFactor.value=Math.max(0,Math.min(1,e))}}class rC extends KI{constructor(e,t){super({renderer:e,createMaterial:n=>new ZI(n),createQuadRenderer:n=>new BS(n)},t)}async render(e,t,n,i){const{sdrImage:o,gainMapImage:l,needsFlip:h}=await this.processImages(n,i,"flipY"),{gainMap:d,sdr:p}=this.createTextures(o,l,h);this.updateQuadRenderer(e,o,d,p,t),e.render()}}class QI extends rC{load([e,t,n],i,o,l){const h=this.prepareQuadRenderer();let d,p,_;const v=async()=>{if(d&&p&&_){try{await this.render(h,_,d,p)}catch(N){this.manager.itemError(e),this.manager.itemError(t),this.manager.itemError(n),typeof l=="function"&&l(N),h.disposeOnDemandRenderer();return}typeof i=="function"&&i(h),this.manager.itemEnd(e),this.manager.itemEnd(t),this.manager.itemEnd(n),h.disposeOnDemandRenderer()}};let y=!0,x=0,b=0,R=!0,T=0,M=0,w=!0,D=0,L=0;const P=()=>{if(typeof o=="function"){const N=x+T+D,F=b+M+L,K=y&&R&&w;o(new ProgressEvent("progress",{lengthComputable:K,loaded:F,total:N}))}};this.manager.itemStart(e),this.manager.itemStart(t),this.manager.itemStart(n);const O=new Na(this._internalLoadingManager);O.setResponseType("arraybuffer"),O.setRequestHeader(this.requestHeader),O.setPath(this.path),O.setWithCredentials(this.withCredentials),O.load(e,async N=>{if(typeof N=="string")throw new Error("Invalid sdr buffer");d=N,await v()},N=>{y=N.lengthComputable,b=N.loaded,x=N.total,P()},N=>{this.manager.itemError(e),typeof l=="function"&&l(N)});const z=new Na(this._internalLoadingManager);z.setResponseType("arraybuffer"),z.setRequestHeader(this.requestHeader),z.setPath(this.path),z.setWithCredentials(this.withCredentials),z.load(t,async N=>{if(typeof N=="string")throw new Error("Invalid gainmap buffer");p=N,await v()},N=>{R=N.lengthComputable,M=N.loaded,T=N.total,P()},N=>{this.manager.itemError(t),typeof l=="function"&&l(N)});const V=new Na(this._internalLoadingManager);return V.setRequestHeader(this.requestHeader),V.setPath(this.path),V.setWithCredentials(this.withCredentials),V.load(n,async N=>{if(typeof N!="string")throw new Error("Invalid metadata string");_=JSON.parse(N),await v()},N=>{w=N.lengthComputable,L=N.loaded,D=N.total,P()},N=>{this.manager.itemError(n),typeof l=="function"&&l(N)}),h}}class $I extends rC{load(e,t,n,i){const o=this.prepareQuadRenderer(),l=new Na(this._internalLoadingManager);return l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setPath(this.path),l.setWithCredentials(this.withCredentials),this.manager.itemStart(e),l.load(e,async h=>{if(typeof h=="string")throw new Error("Invalid buffer, received [string], was expecting [ArrayBuffer]");const d=new Uint8Array(h);let p,_,v;try{const y=await qI(d);p=y.sdr,_=y.gainMap,v=y.metadata}catch(y){if(y instanceof aC||y instanceof iC)console.warn(`Failure to reconstruct an HDR image from ${e}: Gain map metadata not found in the file, HDRJPGLoader will render the SDR jpeg`),v={gainMapMin:[0,0,0],gainMapMax:[1,1,1],gamma:[1,1,1],hdrCapacityMin:0,hdrCapacityMax:1,offsetHdr:[0,0,0],offsetSdr:[0,0,0]},p=d;else throw y}try{await this.render(o,v,p.buffer,_?.buffer)}catch(y){this.manager.itemError(e),typeof i=="function"&&i(y),o.disposeOnDemandRenderer();return}typeof t=="function"&&t(o),this.manager.itemEnd(e),o.disposeOnDemandRenderer()},n,h=>{this.manager.itemError(e),typeof i=="function"&&i(h)}),o}}const om={apartment:"lebombo_1k.hdr",city:"potsdamer_platz_1k.hdr",dawn:"kiara_1_dawn_1k.hdr",forest:"forest_slope_1k.hdr",lobby:"st_fagans_interior_1k.hdr",night:"dikhololo_night_1k.hdr",park:"rooitou_park_1k.hdr",studio:"studio_small_03_1k.hdr",sunset:"venice_sunset_1k.hdr",warehouse:"empty_warehouse_01_1k.hdr"},oC="https://raw.githack.com/pmndrs/drei-assets/456060a26bbeb8fdf79326f224b6d99b8bcce736/hdri/",Wh=s=>Array.isArray(s),DS=["/px.png","/nx.png","/py.png","/ny.png","/pz.png","/nz.png"];function v_({files:s=DS,path:e="",preset:t=void 0,colorSpace:n=void 0,extensions:i}={}){t&&(LS(t),s=om[t],e=oC);const o=Wh(s),{extension:l,isCubemap:h}=NS(s),d=US(l);if(!d)throw new Error("useEnvironment: Unrecognized file extension: "+s);const p=kh(x=>x.gl);ge.useLayoutEffect(()=>{if(l!=="webp"&&l!=="jpg"&&l!=="jpeg")return;function x(){Gl.clear(d,o?[s]:s)}p.domElement.addEventListener("webglcontextlost",x,{once:!0})},[s,p.domElement]);const _=Gl(d,o?[s]:s,x=>{(l==="webp"||l==="jpg"||l==="jpeg")&&x.setRenderer(p),x.setPath==null||x.setPath(e),i&&i(x)});let v=o?_[0]:_;if(l==="jpg"||l==="jpeg"||l==="webp"){var y;v=(y=v.renderTarget)==null?void 0:y.texture}return v.mapping=h?ro:nh,v.colorSpace=n??(h?"srgb":"srgb-linear"),v}const eF={files:DS,path:"",preset:void 0,extensions:void 0};v_.preload=s=>{const e={...eF,...s};let{files:t,path:n=""}=e;const{preset:i,extensions:o}=e;i&&(LS(i),t=om[i],n=oC);const{extension:l}=NS(t);if(l==="webp"||l==="jpg"||l==="jpeg")throw new Error("useEnvironment: Preloading gainmaps is not supported");const h=US(l);if(!h)throw new Error("useEnvironment: Unrecognized file extension: "+t);Gl.preload(h,Wh(t)?[t]:t,d=>{d.setPath==null||d.setPath(n),o&&o(d)})};const tF={files:DS,preset:void 0};v_.clear=s=>{const e={...tF,...s};let{files:t}=e;const{preset:n}=e;n&&(LS(n),t=om[n]);const{extension:i}=NS(t),o=US(i);if(!o)throw new Error("useEnvironment: Unrecognized file extension: "+t);Gl.clear(o,Wh(t)?[t]:t)};function LS(s){if(!(s in om))throw new Error("Preset must be one of: "+Object.keys(om).join(", "))}function NS(s){var e;const t=Wh(s)&&s.length===6,n=Wh(s)&&s.length===3&&s.some(l=>l.endsWith("json")),i=Wh(s)?s[0]:s;return{extension:t?"cube":n?"webp":i.startsWith("data:application/exr")?"exr":i.startsWith("data:application/hdr")?"hdr":i.startsWith("data:image/jpeg")?"jpg":(e=i.split(".").pop())==null||(e=e.split("?"))==null||(e=e.shift())==null?void 0:e.toLowerCase(),isCubemap:t,isGainmap:n}}function US(s){return s==="cube"?X1:s==="hdr"?GI:s==="exr"?zI:s==="jpg"||s==="jpeg"?$I:s==="webp"?QI:null}const nF=s=>s.current&&s.current.isScene,iF=s=>nF(s)?s.current:s;function OS(s,e,t,n,i={}){var o,l,h,d;i={backgroundBlurriness:0,backgroundIntensity:1,backgroundRotation:[0,0,0],environmentIntensity:1,environmentRotation:[0,0,0],...i};const p=iF(e||t),_=p.background,v=p.environment,y={backgroundBlurriness:p.backgroundBlurriness,backgroundIntensity:p.backgroundIntensity,backgroundRotation:(o=(l=p.backgroundRotation)==null||l.clone==null?void 0:l.clone())!==null&&o!==void 0?o:[0,0,0],environmentIntensity:p.environmentIntensity,environmentRotation:(h=(d=p.environmentRotation)==null||d.clone==null?void 0:d.clone())!==null&&h!==void 0?h:[0,0,0]};return s!=="only"&&(p.environment=n),s&&(p.background=n),Yo(p,i),()=>{s!=="only"&&(p.environment=v),s&&(p.background=_),Yo(p,y)}}function IS({scene:s,background:e=!1,map:t,...n}){const i=kh(o=>o.scene);return ge.useLayoutEffect(()=>{if(t)return OS(e,s,i,t,n)}),null}function lC({background:s=!1,scene:e,blur:t,backgroundBlurriness:n,backgroundIntensity:i,backgroundRotation:o,environmentIntensity:l,environmentRotation:h,...d}){const p=v_(d),_=kh(v=>v.scene);return ge.useLayoutEffect(()=>OS(s,e,_,p,{backgroundBlurriness:t??n,backgroundIntensity:i,backgroundRotation:o,environmentIntensity:l,environmentRotation:h})),ge.useEffect(()=>()=>{p.dispose()},[p]),null}function aF({children:s,near:e=.1,far:t=1e3,resolution:n=256,frames:i=1,map:o,background:l=!1,blur:h,backgroundBlurriness:d,backgroundIntensity:p,backgroundRotation:_,environmentIntensity:v,environmentRotation:y,scene:x,files:b,path:R,preset:T=void 0,extensions:M}){const w=kh(V=>V.gl),D=kh(V=>V.scene),L=ge.useRef(null),[P]=ge.useState(()=>new Rp),O=ge.useMemo(()=>{const V=new K0(n);return V.texture.type=sa,V},[n]);ge.useEffect(()=>()=>{O.dispose()},[O]),ge.useLayoutEffect(()=>{if(i===1){const V=w.autoClear;w.autoClear=!0,L.current.update(w,P),w.autoClear=V}return OS(l,x,D,O.texture,{backgroundBlurriness:h??d,backgroundIntensity:p,backgroundRotation:_,environmentIntensity:v,environmentRotation:y})},[s,P,O.texture,x,D,l,i,w]);let z=1;return bT(()=>{if(i===1/0||z<i){const V=w.autoClear;w.autoClear=!0,L.current.update(w,P),w.autoClear=V,z++}}),ge.createElement(ge.Fragment,null,DO(ge.createElement(ge.Fragment,null,s,ge.createElement("cubeCamera",{ref:L,args:[e,t,O]}),b||T?ge.createElement(lC,{background:!0,files:b,preset:T,path:R,extensions:M}):o?ge.createElement(IS,{background:!0,map:o,extensions:M}):null),P))}function sF(s){var e,t,n,i;const o=v_(s),l=s.map||o;ge.useMemo(()=>RT({GroundProjectedEnvImpl:aI}),[]),ge.useEffect(()=>()=>{o.dispose()},[o]);const h=ge.useMemo(()=>[l],[l]),d=(e=s.ground)==null?void 0:e.height,p=(t=s.ground)==null?void 0:t.radius,_=(n=(i=s.ground)==null?void 0:i.scale)!==null&&n!==void 0?n:1e3;return ge.createElement(ge.Fragment,null,ge.createElement(IS,Jy({},s,{map:l})),ge.createElement("groundProjectedEnvImpl",{args:h,scale:_,height:d,radius:p}))}function rF(s){return s.ground?ge.createElement(sF,s):s.map?ge.createElement(IS,s):s.children?ge.createElement(aF,s):ge.createElement(lC,s)}function cC(s,e){if(e===ux)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),s;if(e===Uu||e===gp){let t=s.getIndex();if(t===null){const l=[],h=s.getAttribute("position");if(h!==void 0){for(let d=0;d<h.count;d++)l.push(d);s.setIndex(l),t=s.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),s}const n=t.count-2,i=[];if(e===Uu)for(let l=1;l<=n;l++)i.push(t.getX(0)),i.push(t.getX(l)),i.push(t.getX(l+1));else for(let l=0;l<n;l++)l%2===0?(i.push(t.getX(l)),i.push(t.getX(l+1)),i.push(t.getX(l+2))):(i.push(t.getX(l+2)),i.push(t.getX(l+1)),i.push(t.getX(l)));i.length/3!==n&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const o=s.clone();return o.setIndex(i),o.clearGroups(),o}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),s}class oF extends Ka{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new hF(t)}),this.register(function(t){return new dF(t)}),this.register(function(t){return new SF(t)}),this.register(function(t){return new MF(t)}),this.register(function(t){return new bF(t)}),this.register(function(t){return new mF(t)}),this.register(function(t){return new gF(t)}),this.register(function(t){return new vF(t)}),this.register(function(t){return new _F(t)}),this.register(function(t){return new fF(t)}),this.register(function(t){return new yF(t)}),this.register(function(t){return new pF(t)}),this.register(function(t){return new AF(t)}),this.register(function(t){return new xF(t)}),this.register(function(t){return new cF(t)}),this.register(function(t){return new EF(t)}),this.register(function(t){return new TF(t)})}load(e,t,n,i){const o=this;let l;if(this.resourcePath!=="")l=this.resourcePath;else if(this.path!==""){const p=yr.extractUrlBase(e);l=yr.resolveURL(p,this.path)}else l=yr.extractUrlBase(e);this.manager.itemStart(e);const h=function(p){i?i(p):console.error(p),o.manager.itemError(e),o.manager.itemEnd(e)},d=new Na(this.manager);d.setPath(this.path),d.setResponseType("arraybuffer"),d.setRequestHeader(this.requestHeader),d.setWithCredentials(this.withCredentials),d.load(e,function(p){try{o.parse(p,l,function(_){t(_),o.manager.itemEnd(e)},h)}catch(_){h(_)}},n,h)}setDRACOLoader(e){return this.dracoLoader=e,this}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,i){let o;const l={},h={},d=new TextDecoder;if(typeof e=="string")o=JSON.parse(e);else if(e instanceof ArrayBuffer)if(d.decode(new Uint8Array(e,0,4))===uC){try{l[Yn.KHR_BINARY_GLTF]=new CF(e)}catch(v){i&&i(v);return}o=JSON.parse(l[Yn.KHR_BINARY_GLTF].content)}else o=JSON.parse(d.decode(e));else o=e;if(o.asset===void 0||o.asset.version[0]<2){i&&i(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const p=new GF(o,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});p.fileLoader.setRequestHeader(this.requestHeader);for(let _=0;_<this.pluginCallbacks.length;_++){const v=this.pluginCallbacks[_](p);v.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),h[v.name]=v,l[v.name]=!0}if(o.extensionsUsed)for(let _=0;_<o.extensionsUsed.length;++_){const v=o.extensionsUsed[_],y=o.extensionsRequired||[];switch(v){case Yn.KHR_MATERIALS_UNLIT:l[v]=new uF;break;case Yn.KHR_DRACO_MESH_COMPRESSION:l[v]=new RF(o,this.dracoLoader);break;case Yn.KHR_TEXTURE_TRANSFORM:l[v]=new wF;break;case Yn.KHR_MESH_QUANTIZATION:l[v]=new BF;break;default:y.indexOf(v)>=0&&h[v]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+v+'".')}}p.setExtensions(l),p.setPlugins(h),p.parse(n,i)}parseAsync(e,t){const n=this;return new Promise(function(i,o){n.parse(e,t,i,o)})}}function lF(){let s={};return{get:function(e){return s[e]},add:function(e,t){s[e]=t},remove:function(e){delete s[e]},removeAll:function(){s={}}}}const Yn={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 cF{constructor(e){this.parser=e,this.name=Yn.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let n=0,i=t.length;n<i;n++){const o=t[n];o.extensions&&o.extensions[this.name]&&o.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,o.extensions[this.name].light)}}_loadLight(e){const t=this.parser,n="light:"+e;let i=t.cache.get(n);if(i)return i;const o=t.json,d=((o.extensions&&o.extensions[this.name]||{}).lights||[])[e];let p;const _=new Rt(16777215);d.color!==void 0&&_.setRGB(d.color[0],d.color[1],d.color[2],Ma);const v=d.range!==void 0?d.range:0;switch(d.type){case"directional":p=new Vv(_),p.target.position.set(0,0,-1),p.add(p.target);break;case"point":p=new zv(_),p.distance=v;break;case"spot":p=new Gv(_),p.distance=v,d.spot=d.spot||{},d.spot.innerConeAngle=d.spot.innerConeAngle!==void 0?d.spot.innerConeAngle:0,d.spot.outerConeAngle=d.spot.outerConeAngle!==void 0?d.spot.outerConeAngle:Math.PI/4,p.angle=d.spot.outerConeAngle,p.penumbra=1-d.spot.innerConeAngle/d.spot.outerConeAngle,p.target.position.set(0,0,-1),p.add(p.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+d.type)}return p.position.set(0,0,0),Jo(p,d),d.intensity!==void 0&&(p.intensity=d.intensity),p.name=t.createUniqueName(d.name||"light_"+e),i=Promise.resolve(p),t.cache.add(n,i),i}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,n=this.parser,o=n.json.nodes[e],h=(o.extensions&&o.extensions[this.name]||{}).light;return h===void 0?null:this._loadLight(h).then(function(d){return n._getNodeRef(t.cache,h,d)})}}class uF{constructor(){this.name=Yn.KHR_MATERIALS_UNLIT}getMaterialType(){return La}extendParams(e,t,n){const i=[];e.color=new Rt(1,1,1),e.opacity=1;const o=t.pbrMetallicRoughness;if(o){if(Array.isArray(o.baseColorFactor)){const l=o.baseColorFactor;e.color.setRGB(l[0],l[1],l[2],Ma),e.opacity=l[3]}o.baseColorTexture!==void 0&&i.push(n.assignTexture(e,"map",o.baseColorTexture,ra))}return Promise.all(i)}}class fF{constructor(e){this.parser=e,this.name=Yn.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const i=this.parser.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=i.extensions[this.name].emissiveStrength;return o!==void 0&&(t.emissiveIntensity=o),Promise.resolve()}}class hF{constructor(e){this.parser=e,this.name=Yn.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:la}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=[],l=i.extensions[this.name];if(l.clearcoatFactor!==void 0&&(t.clearcoat=l.clearcoatFactor),l.clearcoatTexture!==void 0&&o.push(n.assignTexture(t,"clearcoatMap",l.clearcoatTexture)),l.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=l.clearcoatRoughnessFactor),l.clearcoatRoughnessTexture!==void 0&&o.push(n.assignTexture(t,"clearcoatRoughnessMap",l.clearcoatRoughnessTexture)),l.clearcoatNormalTexture!==void 0&&(o.push(n.assignTexture(t,"clearcoatNormalMap",l.clearcoatNormalTexture)),l.clearcoatNormalTexture.scale!==void 0)){const h=l.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new et(h,h)}return Promise.all(o)}}class dF{constructor(e){this.parser=e,this.name=Yn.KHR_MATERIALS_DISPERSION}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:la}extendMaterialParams(e,t){const i=this.parser.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=i.extensions[this.name];return t.dispersion=o.dispersion!==void 0?o.dispersion:0,Promise.resolve()}}class pF{constructor(e){this.parser=e,this.name=Yn.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:la}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=[],l=i.extensions[this.name];return l.iridescenceFactor!==void 0&&(t.iridescence=l.iridescenceFactor),l.iridescenceTexture!==void 0&&o.push(n.assignTexture(t,"iridescenceMap",l.iridescenceTexture)),l.iridescenceIor!==void 0&&(t.iridescenceIOR=l.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),l.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=l.iridescenceThicknessMinimum),l.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=l.iridescenceThicknessMaximum),l.iridescenceThicknessTexture!==void 0&&o.push(n.assignTexture(t,"iridescenceThicknessMap",l.iridescenceThicknessTexture)),Promise.all(o)}}class mF{constructor(e){this.parser=e,this.name=Yn.KHR_MATERIALS_SHEEN}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:la}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=[];t.sheenColor=new Rt(0,0,0),t.sheenRoughness=0,t.sheen=1;const l=i.extensions[this.name];if(l.sheenColorFactor!==void 0){const h=l.sheenColorFactor;t.sheenColor.setRGB(h[0],h[1],h[2],Ma)}return l.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=l.sheenRoughnessFactor),l.sheenColorTexture!==void 0&&o.push(n.assignTexture(t,"sheenColorMap",l.sheenColorTexture,ra)),l.sheenRoughnessTexture!==void 0&&o.push(n.assignTexture(t,"sheenRoughnessMap",l.sheenRoughnessTexture)),Promise.all(o)}}class gF{constructor(e){this.parser=e,this.name=Yn.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:la}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=[],l=i.extensions[this.name];return l.transmissionFactor!==void 0&&(t.transmission=l.transmissionFactor),l.transmissionTexture!==void 0&&o.push(n.assignTexture(t,"transmissionMap",l.transmissionTexture)),Promise.all(o)}}class vF{constructor(e){this.parser=e,this.name=Yn.KHR_MATERIALS_VOLUME}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:la}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=[],l=i.extensions[this.name];t.thickness=l.thicknessFactor!==void 0?l.thicknessFactor:0,l.thicknessTexture!==void 0&&o.push(n.assignTexture(t,"thicknessMap",l.thicknessTexture)),t.attenuationDistance=l.attenuationDistance||1/0;const h=l.attenuationColor||[1,1,1];return t.attenuationColor=new Rt().setRGB(h[0],h[1],h[2],Ma),Promise.all(o)}}class _F{constructor(e){this.parser=e,this.name=Yn.KHR_MATERIALS_IOR}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:la}extendMaterialParams(e,t){const i=this.parser.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=i.extensions[this.name];return t.ior=o.ior!==void 0?o.ior:1.5,Promise.resolve()}}class yF{constructor(e){this.parser=e,this.name=Yn.KHR_MATERIALS_SPECULAR}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:la}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=[],l=i.extensions[this.name];t.specularIntensity=l.specularFactor!==void 0?l.specularFactor:1,l.specularTexture!==void 0&&o.push(n.assignTexture(t,"specularIntensityMap",l.specularTexture));const h=l.specularColorFactor||[1,1,1];return t.specularColor=new Rt().setRGB(h[0],h[1],h[2],Ma),l.specularColorTexture!==void 0&&o.push(n.assignTexture(t,"specularColorMap",l.specularColorTexture,ra)),Promise.all(o)}}class xF{constructor(e){this.parser=e,this.name=Yn.EXT_MATERIALS_BUMP}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:la}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=[],l=i.extensions[this.name];return t.bumpScale=l.bumpFactor!==void 0?l.bumpFactor:1,l.bumpTexture!==void 0&&o.push(n.assignTexture(t,"bumpMap",l.bumpTexture)),Promise.all(o)}}class AF{constructor(e){this.parser=e,this.name=Yn.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:la}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=[],l=i.extensions[this.name];return l.anisotropyStrength!==void 0&&(t.anisotropy=l.anisotropyStrength),l.anisotropyRotation!==void 0&&(t.anisotropyRotation=l.anisotropyRotation),l.anisotropyTexture!==void 0&&o.push(n.assignTexture(t,"anisotropyMap",l.anisotropyTexture)),Promise.all(o)}}class SF{constructor(e){this.parser=e,this.name=Yn.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,n=t.json,i=n.textures[e];if(!i.extensions||!i.extensions[this.name])return null;const o=i.extensions[this.name],l=t.options.ktx2Loader;if(!l){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,o.source,l)}}class MF{constructor(e){this.parser=e,this.name=Yn.EXT_TEXTURE_WEBP}loadTexture(e){const t=this.name,n=this.parser,i=n.json,o=i.textures[e];if(!o.extensions||!o.extensions[t])return null;const l=o.extensions[t],h=i.images[l.source];let d=n.textureLoader;if(h.uri){const p=n.options.manager.getHandler(h.uri);p!==null&&(d=p)}return n.loadTextureImage(e,l.source,d)}}class bF{constructor(e){this.parser=e,this.name=Yn.EXT_TEXTURE_AVIF}loadTexture(e){const t=this.name,n=this.parser,i=n.json,o=i.textures[e];if(!o.extensions||!o.extensions[t])return null;const l=o.extensions[t],h=i.images[l.source];let d=n.textureLoader;if(h.uri){const p=n.options.manager.getHandler(h.uri);p!==null&&(d=p)}return n.loadTextureImage(e,l.source,d)}}class EF{constructor(e){this.name=Yn.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){const i=n.extensions[this.name],o=this.parser.getDependency("buffer",i.buffer),l=this.parser.options.meshoptDecoder;if(!l||!l.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 o.then(function(h){const d=i.byteOffset||0,p=i.byteLength||0,_=i.count,v=i.byteStride,y=new Uint8Array(h,d,p);return l.decodeGltfBufferAsync?l.decodeGltfBufferAsync(_,v,y,i.mode,i.filter).then(function(x){return x.buffer}):l.ready.then(function(){const x=new ArrayBuffer(_*v);return l.decodeGltfBuffer(new Uint8Array(x),_,v,y,i.mode,i.filter),x})})}else return null}}class TF{constructor(e){this.name=Yn.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,n=t.nodes[e];if(!n.extensions||!n.extensions[this.name]||n.mesh===void 0)return null;const i=t.meshes[n.mesh];for(const p of i.primitives)if(p.mode!==Gr.TRIANGLES&&p.mode!==Gr.TRIANGLE_STRIP&&p.mode!==Gr.TRIANGLE_FAN&&p.mode!==void 0)return null;const l=n.extensions[this.name].attributes,h=[],d={};for(const p in l)h.push(this.parser.getDependency("accessor",l[p]).then(_=>(d[p]=_,d[p])));return h.length<1?null:(h.push(this.parser.createNodeMesh(e)),Promise.all(h).then(p=>{const _=p.pop(),v=_.isGroup?_.children:[_],y=p[0].count,x=[];for(const b of v){const R=new cn,T=new Z,M=new Ya,w=new Z(1,1,1),D=new sv(b.geometry,b.material,y);for(let L=0;L<y;L++)d.TRANSLATION&&T.fromBufferAttribute(d.TRANSLATION,L),d.ROTATION&&M.fromBufferAttribute(d.ROTATION,L),d.SCALE&&w.fromBufferAttribute(d.SCALE,L),D.setMatrixAt(L,R.compose(T,M,w));for(const L in d)if(L==="_COLOR_0"){const P=d[L];D.instanceColor=new Bc(P.array,P.itemSize,P.normalized)}else L!=="TRANSLATION"&&L!=="ROTATION"&&L!=="SCALE"&&b.geometry.setAttribute(L,d[L]);kn.prototype.copy.call(D,b),this.parser.assignFinalMaterial(D),x.push(D)}return _.isGroup?(_.clear(),_.add(...x),_):x[0]}))}}const uC="glTF",lm=12,fC={JSON:1313821514,BIN:5130562};class CF{constructor(e){this.name=Yn.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,lm),n=new TextDecoder;if(this.header={magic:n.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==uC)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const i=this.header.length-lm,o=new DataView(e,lm);let l=0;for(;l<i;){const h=o.getUint32(l,!0);l+=4;const d=o.getUint32(l,!0);if(l+=4,d===fC.JSON){const p=new Uint8Array(e,lm+l,h);this.content=n.decode(p)}else if(d===fC.BIN){const p=lm+l;this.body=e.slice(p,p+h)}l+=h}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class RF{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=Yn.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const n=this.json,i=this.dracoLoader,o=e.extensions[this.name].bufferView,l=e.extensions[this.name].attributes,h={},d={},p={};for(const _ in l){const v=HS[_]||_.toLowerCase();h[v]=l[_]}for(const _ in e.attributes){const v=HS[_]||_.toLowerCase();if(l[_]!==void 0){const y=n.accessors[e.attributes[_]],x=jh[y.componentType];p[v]=x.name,d[v]=y.normalized===!0}}return t.getDependency("bufferView",o).then(function(_){return new Promise(function(v,y){i.decodeDracoFile(_,function(x){for(const b in x.attributes){const R=x.attributes[b],T=d[b];T!==void 0&&(R.normalized=T)}v(x)},h,p,Ma,y)})})}}class wF{constructor(){this.name=Yn.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return(t.texCoord===void 0||t.texCoord===e.channel)&&t.offset===void 0&&t.rotation===void 0&&t.scale===void 0||(e=e.clone(),t.texCoord!==void 0&&(e.channel=t.texCoord),t.offset!==void 0&&e.offset.fromArray(t.offset),t.rotation!==void 0&&(e.rotation=t.rotation),t.scale!==void 0&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}}class BF{constructor(){this.name=Yn.KHR_MESH_QUANTIZATION}}class hC extends Wu{constructor(e,t,n,i){super(e,t,n,i)}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,o=e*i*3+i;for(let l=0;l!==i;l++)t[l]=n[o+l];return t}interpolate_(e,t,n,i){const o=this.resultBuffer,l=this.sampleValues,h=this.valueSize,d=h*2,p=h*3,_=i-t,v=(n-t)/_,y=v*v,x=y*v,b=e*p,R=b-p,T=-2*x+3*y,M=x-y,w=1-T,D=M-y+v;for(let L=0;L!==h;L++){const P=l[R+L+h],O=l[R+L+d]*_,z=l[b+L+h],V=l[b+L]*_;o[L]=w*P+D*O+T*z+M*V}return o}}const DF=new Ya;class LF extends hC{interpolate_(e,t,n,i){const o=super.interpolate_(e,t,n,i);return DF.fromArray(o).normalize().toArray(o),o}}const Gr={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},jh={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},dC={9728:zi,9729:In,9984:rp,9985:wu,9986:_c,9987:$s},pC={33071:Gi,33648:Ru,10497:oo},FS={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},HS={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Gc={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},NF={CUBICSPLINE:void 0,LINEAR:xc,STEP:Du},PS={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function UF(s){return s.DefaultMaterial===void 0&&(s.DefaultMaterial=new qu({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:ao})),s.DefaultMaterial}function df(s,e,t){for(const n in t.extensions)s[n]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=t.extensions[n])}function Jo(s,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(s.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function OF(s,e,t){let n=!1,i=!1,o=!1;for(let p=0,_=e.length;p<_;p++){const v=e[p];if(v.POSITION!==void 0&&(n=!0),v.NORMAL!==void 0&&(i=!0),v.COLOR_0!==void 0&&(o=!0),n&&i&&o)break}if(!n&&!i&&!o)return Promise.resolve(s);const l=[],h=[],d=[];for(let p=0,_=e.length;p<_;p++){const v=e[p];if(n){const y=v.POSITION!==void 0?t.getDependency("accessor",v.POSITION):s.attributes.position;l.push(y)}if(i){const y=v.NORMAL!==void 0?t.getDependency("accessor",v.NORMAL):s.attributes.normal;h.push(y)}if(o){const y=v.COLOR_0!==void 0?t.getDependency("accessor",v.COLOR_0):s.attributes.color;d.push(y)}}return Promise.all([Promise.all(l),Promise.all(h),Promise.all(d)]).then(function(p){const _=p[0],v=p[1],y=p[2];return n&&(s.morphAttributes.position=_),i&&(s.morphAttributes.normal=v),o&&(s.morphAttributes.color=y),s.morphTargetsRelative=!0,s})}function IF(s,e){if(s.updateMorphTargets(),e.weights!==void 0)for(let t=0,n=e.weights.length;t<n;t++)s.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(s.morphTargetInfluences.length===t.length){s.morphTargetDictionary={};for(let n=0,i=t.length;n<i;n++)s.morphTargetDictionary[t[n]]=n}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function FF(s){let e;const t=s.extensions&&s.extensions[Yn.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+GS(t.attributes):e=s.indices+":"+GS(s.attributes)+":"+s.mode,s.targets!==void 0)for(let n=0,i=s.targets.length;n<i;n++)e+=":"+GS(s.targets[n]);return e}function GS(s){let e="";const t=Object.keys(s).sort();for(let n=0,i=t.length;n<i;n++)e+=t[n]+":"+s[t[n]]+";";return e}function zS(s){switch(s){case Int8Array:return .007874015748031496;case Uint8Array:return .00392156862745098;case Int16Array:return 3051850947599719e-20;case Uint16Array:return 15259021896696422e-21;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function HF(s){return s.search(/\.jpe?g($|\?)/i)>0||s.search(/^data\:image\/jpeg/)===0?"image/jpeg":s.search(/\.webp($|\?)/i)>0||s.search(/^data\:image\/webp/)===0?"image/webp":s.search(/\.ktx2($|\?)/i)>0||s.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const PF=new cn;class GF{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new lF,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 n=!1,i=-1,o=!1,l=-1;if(typeof navigator<"u"){const h=navigator.userAgent;n=/^((?!chrome|android).)*safari/i.test(h)===!0;const d=h.match(/Version\/(\d+)/);i=n&&d?parseInt(d[1],10):-1,o=h.indexOf("Firefox")>-1,l=o?h.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||n&&i<17||o&&l<98?this.textureLoader=new dA(this.options.manager):this.textureLoader=new _A(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new Na(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 n=this,i=this.json,o=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(l){return l._markDefs&&l._markDefs()}),Promise.all(this._invokeAll(function(l){return l.beforeRoot&&l.beforeRoot()})).then(function(){return Promise.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])}).then(function(l){const h={scene:l[0][i.scene||0],scenes:l[0],animations:l[1],cameras:l[2],asset:i.asset,parser:n,userData:{}};return df(o,h,i),Jo(h,i),Promise.all(n._invokeAll(function(d){return d.afterRoot&&d.afterRoot(h)})).then(function(){for(const d of h.scenes)d.updateMatrixWorld();e(h)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let i=0,o=t.length;i<o;i++){const l=t[i].joints;for(let h=0,d=l.length;h<d;h++)e[l[h]].isBone=!0}for(let i=0,o=e.length;i<o;i++){const l=e[i];l.mesh!==void 0&&(this._addNodeRef(this.meshCache,l.mesh),l.skin!==void 0&&(n[l.mesh].isSkinnedMesh=!0)),l.camera!==void 0&&this._addNodeRef(this.cameraCache,l.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,n){if(e.refs[t]<=1)return n;const i=n.clone(),o=(l,h)=>{const d=this.associations.get(l);d!=null&&this.associations.set(h,d);for(const[p,_]of l.children.entries())o(_,h.children[p])};return o(n,i),i.name+="_instance_"+e.uses[t]++,i}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let n=0;n<t.length;n++){const i=e(t[n]);if(i)return i}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const n=[];for(let i=0;i<t.length;i++){const o=e(t[i]);o&&n.push(o)}return n}getDependency(e,t){const n=e+":"+t;let i=this.cache.get(n);if(!i){switch(e){case"scene":i=this.loadScene(t);break;case"node":i=this._invokeOne(function(o){return o.loadNode&&o.loadNode(t)});break;case"mesh":i=this._invokeOne(function(o){return o.loadMesh&&o.loadMesh(t)});break;case"accessor":i=this.loadAccessor(t);break;case"bufferView":i=this._invokeOne(function(o){return o.loadBufferView&&o.loadBufferView(t)});break;case"buffer":i=this.loadBuffer(t);break;case"material":i=this._invokeOne(function(o){return o.loadMaterial&&o.loadMaterial(t)});break;case"texture":i=this._invokeOne(function(o){return o.loadTexture&&o.loadTexture(t)});break;case"skin":i=this.loadSkin(t);break;case"animation":i=this._invokeOne(function(o){return o.loadAnimation&&o.loadAnimation(t)});break;case"camera":i=this.loadCamera(t);break;default:if(i=this._invokeOne(function(o){return o!=this&&o.getDependency&&o.getDependency(e,t)}),!i)throw new Error("Unknown type: "+e);break}this.cache.add(n,i)}return i}getDependencies(e){let t=this.cache.get(e);if(!t){const n=this,i=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(i.map(function(o,l){return n.getDependency(e,l)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],n=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[Yn.KHR_BINARY_GLTF].body);const i=this.options;return new Promise(function(o,l){n.load(yr.resolveURL(t.uri,i.path),o,void 0,function(){l(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(n){const i=t.byteLength||0,o=t.byteOffset||0;return n.slice(o,o+i)})}loadAccessor(e){const t=this,n=this.json,i=this.json.accessors[e];if(i.bufferView===void 0&&i.sparse===void 0){const l=FS[i.type],h=jh[i.componentType],d=i.normalized===!0,p=new h(i.count*l);return Promise.resolve(new Kn(p,l,d))}const o=[];return i.bufferView!==void 0?o.push(this.getDependency("bufferView",i.bufferView)):o.push(null),i.sparse!==void 0&&(o.push(this.getDependency("bufferView",i.sparse.indices.bufferView)),o.push(this.getDependency("bufferView",i.sparse.values.bufferView))),Promise.all(o).then(function(l){const h=l[0],d=FS[i.type],p=jh[i.componentType],_=p.BYTES_PER_ELEMENT,v=_*d,y=i.byteOffset||0,x=i.bufferView!==void 0?n.bufferViews[i.bufferView].byteStride:void 0,b=i.normalized===!0;let R,T;if(x&&x!==v){const M=Math.floor(y/x),w="InterleavedBuffer:"+i.bufferView+":"+i.componentType+":"+M+":"+i.count;let D=t.cache.get(w);D||(R=new p(h,M*x,i.count*x/_),D=new Th(R,x/_),t.cache.add(w,D)),T=new Nl(D,d,y%x/_,b)}else h===null?R=new p(i.count*d):R=new p(h,y,i.count*d),T=new Kn(R,d,b);if(i.sparse!==void 0){const M=FS.SCALAR,w=jh[i.sparse.indices.componentType],D=i.sparse.indices.byteOffset||0,L=i.sparse.values.byteOffset||0,P=new w(l[1],D,i.sparse.count*M),O=new p(l[2],L,i.sparse.count*d);h!==null&&(T=new Kn(T.array.slice(),T.itemSize,T.normalized)),T.normalized=!1;for(let z=0,V=P.length;z<V;z++){const N=P[z];if(T.setX(N,O[z*d]),d>=2&&T.setY(N,O[z*d+1]),d>=3&&T.setZ(N,O[z*d+2]),d>=4&&T.setW(N,O[z*d+3]),d>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}T.normalized=b}return T})}loadTexture(e){const t=this.json,n=this.options,o=t.textures[e].source,l=t.images[o];let h=this.textureLoader;if(l.uri){const d=n.manager.getHandler(l.uri);d!==null&&(h=d)}return this.loadTextureImage(e,o,h)}loadTextureImage(e,t,n){const i=this,o=this.json,l=o.textures[e],h=o.images[t],d=(h.uri||h.bufferView)+":"+l.sampler;if(this.textureCache[d])return this.textureCache[d];const p=this.loadImageSource(t,n).then(function(_){_.flipY=!1,_.name=l.name||h.name||"",_.name===""&&typeof h.uri=="string"&&h.uri.startsWith("data:image/")===!1&&(_.name=h.uri);const y=(o.samplers||{})[l.sampler]||{};return _.magFilter=dC[y.magFilter]||In,_.minFilter=dC[y.minFilter]||$s,_.wrapS=pC[y.wrapS]||oo,_.wrapT=pC[y.wrapT]||oo,_.generateMipmaps=!_.isCompressedTexture&&_.minFilter!==zi&&_.minFilter!==In,i.associations.set(_,{textures:e}),_}).catch(function(){return null});return this.textureCache[d]=p,p}loadImageSource(e,t){const n=this,i=this.json,o=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(v=>v.clone());const l=i.images[e],h=self.URL||self.webkitURL;let d=l.uri||"",p=!1;if(l.bufferView!==void 0)d=n.getDependency("bufferView",l.bufferView).then(function(v){p=!0;const y=new Blob([v],{type:l.mimeType});return d=h.createObjectURL(y),d});else if(l.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const _=Promise.resolve(d).then(function(v){return new Promise(function(y,x){let b=y;t.isImageBitmapLoader===!0&&(b=function(R){const T=new li(R);T.needsUpdate=!0,y(T)}),t.load(yr.resolveURL(v,o.path),b,void 0,x)})}).then(function(v){return p===!0&&h.revokeObjectURL(d),Jo(v,l),v.userData.mimeType=l.mimeType||HF(l.uri),v}).catch(function(v){throw console.error("THREE.GLTFLoader: Couldn't load texture",d),v});return this.sourceCache[e]=_,_}assignTexture(e,t,n,i){const o=this;return this.getDependency("texture",n.index).then(function(l){if(!l)return null;if(n.texCoord!==void 0&&n.texCoord>0&&(l=l.clone(),l.channel=n.texCoord),o.extensions[Yn.KHR_TEXTURE_TRANSFORM]){const h=n.extensions!==void 0?n.extensions[Yn.KHR_TEXTURE_TRANSFORM]:void 0;if(h){const d=o.associations.get(l);l=o.extensions[Yn.KHR_TEXTURE_TRANSFORM].extendTexture(l,h),o.associations.set(l,d)}}return i!==void 0&&(l.colorSpace=i),e[t]=l,l})}assignFinalMaterial(e){const t=e.geometry;let n=e.material;const i=t.attributes.tangent===void 0,o=t.attributes.color!==void 0,l=t.attributes.normal===void 0;if(e.isPoints){const h="PointsMaterial:"+n.uuid;let d=this.cache.get(h);d||(d=new Fp,oa.prototype.copy.call(d,n),d.color.copy(n.color),d.map=n.map,d.sizeAttenuation=!1,this.cache.add(h,d)),n=d}else if(e.isLine){const h="LineBasicMaterial:"+n.uuid;let d=this.cache.get(h);d||(d=new ss,oa.prototype.copy.call(d,n),d.color.copy(n.color),d.map=n.map,this.cache.add(h,d)),n=d}if(i||o||l){let h="ClonedMaterial:"+n.uuid+":";i&&(h+="derivative-tangents:"),o&&(h+="vertex-colors:"),l&&(h+="flat-shading:");let d=this.cache.get(h);d||(d=n.clone(),o&&(d.vertexColors=!0),l&&(d.flatShading=!0),i&&(d.normalScale&&(d.normalScale.y*=-1),d.clearcoatNormalScale&&(d.clearcoatNormalScale.y*=-1)),this.cache.add(h,d),this.associations.set(d,this.associations.get(n))),n=d}e.material=n}getMaterialType(){return qu}loadMaterial(e){const t=this,n=this.json,i=this.extensions,o=n.materials[e];let l;const h={},d=o.extensions||{},p=[];if(d[Yn.KHR_MATERIALS_UNLIT]){const v=i[Yn.KHR_MATERIALS_UNLIT];l=v.getMaterialType(),p.push(v.extendParams(h,o,t))}else{const v=o.pbrMetallicRoughness||{};if(h.color=new Rt(1,1,1),h.opacity=1,Array.isArray(v.baseColorFactor)){const y=v.baseColorFactor;h.color.setRGB(y[0],y[1],y[2],Ma),h.opacity=y[3]}v.baseColorTexture!==void 0&&p.push(t.assignTexture(h,"map",v.baseColorTexture,ra)),h.metalness=v.metallicFactor!==void 0?v.metallicFactor:1,h.roughness=v.roughnessFactor!==void 0?v.roughnessFactor:1,v.metallicRoughnessTexture!==void 0&&(p.push(t.assignTexture(h,"metalnessMap",v.metallicRoughnessTexture)),p.push(t.assignTexture(h,"roughnessMap",v.metallicRoughnessTexture))),l=this._invokeOne(function(y){return y.getMaterialType&&y.getMaterialType(e)}),p.push(Promise.all(this._invokeAll(function(y){return y.extendMaterialParams&&y.extendMaterialParams(e,h)})))}o.doubleSided===!0&&(h.side=hr);const _=o.alphaMode||PS.OPAQUE;if(_===PS.BLEND?(h.transparent=!0,h.depthWrite=!1):(h.transparent=!1,_===PS.MASK&&(h.alphaTest=o.alphaCutoff!==void 0?o.alphaCutoff:.5)),o.normalTexture!==void 0&&l!==La&&(p.push(t.assignTexture(h,"normalMap",o.normalTexture)),h.normalScale=new et(1,1),o.normalTexture.scale!==void 0)){const v=o.normalTexture.scale;h.normalScale.set(v,v)}if(o.occlusionTexture!==void 0&&l!==La&&(p.push(t.assignTexture(h,"aoMap",o.occlusionTexture)),o.occlusionTexture.strength!==void 0&&(h.aoMapIntensity=o.occlusionTexture.strength)),o.emissiveFactor!==void 0&&l!==La){const v=o.emissiveFactor;h.emissive=new Rt().setRGB(v[0],v[1],v[2],Ma)}return o.emissiveTexture!==void 0&&l!==La&&p.push(t.assignTexture(h,"emissiveMap",o.emissiveTexture,ra)),Promise.all(p).then(function(){const v=new l(h);return o.name&&(v.name=o.name),Jo(v,o),t.associations.set(v,{materials:e}),o.extensions&&df(i,v,o),v})}createUniqueName(e){const t=$n.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,n=this.extensions,i=this.primitiveCache;function o(h){return n[Yn.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(h,t).then(function(d){return mC(d,h,t)})}const l=[];for(let h=0,d=e.length;h<d;h++){const p=e[h],_=FF(p),v=i[_];if(v)l.push(v.promise);else{let y;p.extensions&&p.extensions[Yn.KHR_DRACO_MESH_COMPRESSION]?y=o(p):y=mC(new yn,p,t),i[_]={primitive:p,promise:y},l.push(y)}}return Promise.all(l)}loadMesh(e){const t=this,n=this.json,i=this.extensions,o=n.meshes[e],l=o.primitives,h=[];for(let d=0,p=l.length;d<p;d++){const _=l[d].material===void 0?UF(this.cache):this.getDependency("material",l[d].material);h.push(_)}return h.push(t.loadGeometries(l)),Promise.all(h).then(function(d){const p=d.slice(0,d.length-1),_=d[d.length-1],v=[];for(let x=0,b=_.length;x<b;x++){const R=_[x],T=l[x];let M;const w=p[x];if(T.mode===Gr.TRIANGLES||T.mode===Gr.TRIANGLE_STRIP||T.mode===Gr.TRIANGLE_FAN||T.mode===void 0)M=o.isSkinnedMesh===!0?new iv(R,w):new Oi(R,w),M.isSkinnedMesh===!0&&M.normalizeSkinWeights(),T.mode===Gr.TRIANGLE_STRIP?M.geometry=cC(M.geometry,gp):T.mode===Gr.TRIANGLE_FAN&&(M.geometry=cC(M.geometry,Uu));else if(T.mode===Gr.LINES)M=new Ir(R,w);else if(T.mode===Gr.LINE_STRIP)M=new Vo(R,w);else if(T.mode===Gr.LINE_LOOP)M=new pv(R,w);else if(T.mode===Gr.POINTS)M=new vv(R,w);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+T.mode);Object.keys(M.geometry.morphAttributes).length>0&&IF(M,o),M.name=t.createUniqueName(o.name||"mesh_"+e),Jo(M,o),T.extensions&&df(i,M,T),t.assignFinalMaterial(M),v.push(M)}for(let x=0,b=v.length;x<b;x++)t.associations.set(v[x],{meshes:e,primitives:x});if(v.length===1)return o.extensions&&df(i,v[0],o),v[0];const y=new Ur;o.extensions&&df(i,y,o),t.associations.set(y,{meshes:e});for(let x=0,b=v.length;x<b;x++)y.add(v[x]);return y})}loadCamera(e){let t;const n=this.json.cameras[e],i=n[n.type];if(!i){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return n.type==="perspective"?t=new Ea(R0.radToDeg(i.yfov),i.aspectRatio||1,i.znear||1,i.zfar||2e6):n.type==="orthographic"&&(t=new Hl(-i.xmag,i.xmag,i.ymag,-i.ymag,i.znear,i.zfar)),n.name&&(t.name=this.createUniqueName(n.name)),Jo(t,n),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],n=[];for(let i=0,o=t.joints.length;i<o;i++)n.push(this._loadNodeShallow(t.joints[i]));return t.inverseBindMatrices!==void 0?n.push(this.getDependency("accessor",t.inverseBindMatrices)):n.push(null),Promise.all(n).then(function(i){const o=i.pop(),l=i,h=[],d=[];for(let p=0,_=l.length;p<_;p++){const v=l[p];if(v){h.push(v);const y=new cn;o!==null&&y.fromArray(o.array,p*16),d.push(y)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[p])}return new Dh(h,d)})}loadAnimation(e){const t=this.json,n=this,i=t.animations[e],o=i.name?i.name:"animation_"+e,l=[],h=[],d=[],p=[],_=[];for(let v=0,y=i.channels.length;v<y;v++){const x=i.channels[v],b=i.samplers[x.sampler],R=x.target,T=R.node,M=i.parameters!==void 0?i.parameters[b.input]:b.input,w=i.parameters!==void 0?i.parameters[b.output]:b.output;R.node!==void 0&&(l.push(this.getDependency("node",T)),h.push(this.getDependency("accessor",M)),d.push(this.getDependency("accessor",w)),p.push(b),_.push(R))}return Promise.all([Promise.all(l),Promise.all(h),Promise.all(d),Promise.all(p),Promise.all(_)]).then(function(v){const y=v[0],x=v[1],b=v[2],R=v[3],T=v[4],M=[];for(let D=0,L=y.length;D<L;D++){const P=y[D],O=x[D],z=b[D],V=R[D],N=T[D];if(P===void 0)continue;P.updateMatrix&&P.updateMatrix();const F=n._createAnimationTracks(P,O,z,V,N);if(F)for(let K=0;K<F.length;K++)M.push(F[K])}const w=new Qu(o,void 0,M);return Jo(w,i),w})}createNodeMesh(e){const t=this.json,n=this,i=t.nodes[e];return i.mesh===void 0?null:n.getDependency("mesh",i.mesh).then(function(o){const l=n._getNodeRef(n.meshCache,i.mesh,o);return i.weights!==void 0&&l.traverse(function(h){if(h.isMesh)for(let d=0,p=i.weights.length;d<p;d++)h.morphTargetInfluences[d]=i.weights[d]}),l})}loadNode(e){const t=this.json,n=this,i=t.nodes[e],o=n._loadNodeShallow(e),l=[],h=i.children||[];for(let p=0,_=h.length;p<_;p++)l.push(n.getDependency("node",h[p]));const d=i.skin===void 0?Promise.resolve(null):n.getDependency("skin",i.skin);return Promise.all([o,Promise.all(l),d]).then(function(p){const _=p[0],v=p[1],y=p[2];y!==null&&_.traverse(function(x){x.isSkinnedMesh&&x.bind(y,PF)});for(let x=0,b=v.length;x<b;x++)_.add(v[x]);return _})}_loadNodeShallow(e){const t=this.json,n=this.extensions,i=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const o=t.nodes[e],l=o.name?i.createUniqueName(o.name):"",h=[],d=i._invokeOne(function(p){return p.createNodeMesh&&p.createNodeMesh(e)});return d&&h.push(d),o.camera!==void 0&&h.push(i.getDependency("camera",o.camera).then(function(p){return i._getNodeRef(i.cameraCache,o.camera,p)})),i._invokeAll(function(p){return p.createNodeAttachment&&p.createNodeAttachment(e)}).forEach(function(p){h.push(p)}),this.nodeCache[e]=Promise.all(h).then(function(p){let _;if(o.isBone===!0?_=new Lp:p.length>1?_=new Ur:p.length===1?_=p[0]:_=new kn,_!==p[0])for(let v=0,y=p.length;v<y;v++)_.add(p[v]);if(o.name&&(_.userData.name=o.name,_.name=l),Jo(_,o),o.extensions&&df(n,_,o),o.matrix!==void 0){const v=new cn;v.fromArray(o.matrix),_.applyMatrix4(v)}else o.translation!==void 0&&_.position.fromArray(o.translation),o.rotation!==void 0&&_.quaternion.fromArray(o.rotation),o.scale!==void 0&&_.scale.fromArray(o.scale);if(!i.associations.has(_))i.associations.set(_,{});else if(o.mesh!==void 0&&i.meshCache.refs[o.mesh]>1){const v=i.associations.get(_);i.associations.set(_,{...v})}return i.associations.get(_).nodes=e,_}),this.nodeCache[e]}loadScene(e){const t=this.extensions,n=this.json.scenes[e],i=this,o=new Ur;n.name&&(o.name=i.createUniqueName(n.name)),Jo(o,n),n.extensions&&df(t,o,n);const l=n.nodes||[],h=[];for(let d=0,p=l.length;d<p;d++)h.push(i.getDependency("node",l[d]));return Promise.all(h).then(function(d){for(let _=0,v=d.length;_<v;_++)o.add(d[_]);const p=_=>{const v=new Map;for(const[y,x]of i.associations)(y instanceof oa||y instanceof li)&&v.set(y,x);return _.traverse(y=>{const x=i.associations.get(y);x!=null&&v.set(y,x)}),v};return i.associations=p(o),o})}_createAnimationTracks(e,t,n,i,o){const l=[],h=e.name?e.name:e.uuid,d=[];Gc[o.path]===Gc.weights?e.traverse(function(y){y.morphTargetInfluences&&d.push(y.name?y.name:y.uuid)}):d.push(h);let p;switch(Gc[o.path]){case Gc.weights:p=Ul;break;case Gc.rotation:p=Ol;break;case Gc.translation:case Gc.scale:p=Il;break;default:n.itemSize===1?p=Ul:p=Il;break}const _=i.interpolation!==void 0?NF[i.interpolation]:xc,v=this._getArrayFromAccessor(n);for(let y=0,x=d.length;y<x;y++){const b=new p(d[y]+"."+Gc[o.path],t.array,v,_);i.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(b),l.push(b)}return l}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const n=zS(t.constructor),i=new Float32Array(t.length);for(let o=0,l=t.length;o<l;o++)i[o]=t[o]*n;t=i}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(n){const i=this instanceof Ol?LF:hC;return new i(this.times,this.values,this.getValueSize()/3,n)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function zF(s,e,t){const n=e.attributes,i=new Ja;if(n.POSITION!==void 0){const h=t.json.accessors[n.POSITION],d=h.min,p=h.max;if(d!==void 0&&p!==void 0){if(i.set(new Z(d[0],d[1],d[2]),new Z(p[0],p[1],p[2])),h.normalized){const _=zS(jh[h.componentType]);i.min.multiplyScalar(_),i.max.multiplyScalar(_)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const o=e.targets;if(o!==void 0){const h=new Z,d=new Z;for(let p=0,_=o.length;p<_;p++){const v=o[p];if(v.POSITION!==void 0){const y=t.json.accessors[v.POSITION],x=y.min,b=y.max;if(x!==void 0&&b!==void 0){if(d.setX(Math.max(Math.abs(x[0]),Math.abs(b[0]))),d.setY(Math.max(Math.abs(x[1]),Math.abs(b[1]))),d.setZ(Math.max(Math.abs(x[2]),Math.abs(b[2]))),y.normalized){const R=zS(jh[y.componentType]);d.multiplyScalar(R)}h.max(d)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}i.expandByVector(h)}s.boundingBox=i;const l=new Da;i.getCenter(l.center),l.radius=i.min.distanceTo(i.max)/2,s.boundingSphere=l}function mC(s,e,t){const n=e.attributes,i=[];function o(l,h){return t.getDependency("accessor",l).then(function(d){s.setAttribute(h,d)})}for(const l in n){const h=HS[l]||l.toLowerCase();h in s.attributes||i.push(o(n[l],h))}if(e.indices!==void 0&&!s.index){const l=t.getDependency("accessor",e.indices).then(function(h){s.setIndex(h)});i.push(l)}return Hn.workingColorSpace!==Ma&&"COLOR_0"in n&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${Hn.workingColorSpace}" not supported.`),Jo(s,e),zF(s,e,t),Promise.all(i).then(function(){return e.targets!==void 0?OF(s,e.targets,t):s})}const Zh="https://ai.streamoji.com",ua=(...s)=>{},gC=({analyser:s})=>{const e=ge.useRef(null),t=ge.useRef(null);return ge.useEffect(()=>{const n=e.current;if(!n)return;const i=n.getContext("2d",{alpha:!0});if(!i)return;let o,l=null;s&&(s.fftSize=128,l=new Uint8Array(s.frequencyBinCount));const h=()=>{o=requestAnimationFrame(h),(n.width!==n.offsetWidth||n.height!==n.offsetHeight)&&(n.width=n.offsetWidth,n.height=n.offsetHeight);const d=n.width,p=n.height;if(d===0||p===0)return;const _=p/2;i.clearRect(0,0,d,p),i.fillStyle="#1e293b";const v=2,x=v+2,b=d*.95,R=Math.floor(b/x);(!t.current||t.current.length!==R)&&(t.current=new Float32Array(R).fill(2));const T=R*x,M=(d-T)/2;s&&l&&s.getByteFrequencyData(l);const w=l?l.length:0,L=Math.floor(w*.7)/R,P=new Float32Array(R);for(let O=0;O<R;O++){let z=0;if(l&&L>0){const F=Math.floor(O*L),K=Math.floor((O+1)*L);for(let ne=F;ne<K;ne++){const ee=l[ne]||0;ee>z&&(z=ee)}}z<10&&(z=0);const V=z/255,N=z>0?Math.max(2,Math.pow(V,1.4)*p*.25):2;P[O]=N}for(let O=0;O<R;O++){const z=R-1-O,V=Math.max(P[O],P[z]),N=t.current[O]+(V-t.current[O])*.3;t.current[O]=N;const F=M+O*x,K=_-N/2;i.beginPath(),i.roundRect?i.roundRect(F,K,v,N,4):i.fillRect(F,K,v,N),i.fill()}};return h(),()=>{cancelAnimationFrame(o)}},[s]),Jt.jsx("canvas",{ref:e,style:{width:"100%",height:"100%",display:"block"}})},VF="https://pub-48df6f7d60d6440bbd01676ea5d90e55.r2.dev",vC="https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/default-models/avatar-blue-suit.glb";function kF(s){const[e,t]=ge.useState(null);return ge.useEffect(()=>{if(!s){t(null);return}let n=!1;const i=`${VF}/${s}.glb`;return fetch(i,{method:"HEAD"}).then(o=>{n||t(o.ok?i:vC)}).catch(()=>{n||t(vC)}),()=>{n=!0}},[s]),e}const XF=["https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/idle/M_Standing_Idle_Variations_001.glb","https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/idle/M_Standing_Idle_Variations_002.glb","https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/idle/M_Standing_Idle_002.glb","https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/idle/M_Standing_Idle_Variations_005.glb"],YF=["https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/idle/F_Standing_Idle_Variations_001.glb","https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/idle/F_Standing_Idle_Variations_003.glb","https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/idle/F_Standing_Idle_Variations_003.glb"],JF=[{id:"m_expr_01",name:"Friendly Wave",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_001.glb"},{id:"m_expr_02",name:"You There",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_002.glb"},{id:"m_expr_04",name:"Awkward Agreement",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_004.glb"},{id:"m_expr_05",name:"What's Going On?",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_005.glb"},{id:"m_expr_06",name:"Tired Stretch",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_006.glb"},{id:"m_expr_07",name:"Conceilied Laughter",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_007.glb"},{id:"m_expr_08",name:"You Come Here",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_008.glb"},{id:"m_expr_09",name:"Come Here Kid",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_009.glb"},{id:"m_expr_10",name:"Come Here Everyone",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_010.glb"},{id:"m_expr_11",name:"No Freaking Way",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_011.glb"},{id:"m_expr_12",name:"Cheerful Approval",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_012.glb"},{id:"m_expr_13",name:"Waving Hello",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_013.glb"},{id:"m_expr_14",name:"Checking Surroundings",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_014.glb"},{id:"m_expr_15",name:"Referee Warning",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_015.glb"},{id:"m_expr_16",name:"You Thumbs Down",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_016.glb"},{id:"m_expr_17",name:"Side Thumbs Down",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_017.glb"},{id:"m_expr_18",name:"You're Finished",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_018.glb"},{id:"m_talk_01",name:"Oh God, Why Me?",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_001.glb"},{id:"m_talk_02",name:"What Are You Doing?",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_002.glb"},{id:"m_talk_03",name:"What Am I doing?",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_003.glb"},{id:"m_talk_04",name:"No Way",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_004.glb"},{id:"m_talk_05",name:"What's Going On?",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_005.glb"},{id:"m_talk_06",name:"I have no idea",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_006.glb"},{id:"m_talk_07",name:"What's going on here?",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_007.glb"},{id:"m_talk_08",name:"Let's stop",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_008.glb"},{id:"m_talk_09",name:"Fed Up Moment",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_009.glb"},{id:"m_talk_10",name:"What's This? Hold On",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_010.glb"},{id:"f_talk_01",name:"Great Job Clap",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/F_Talking_Variations_001.glb"},{id:"f_talk_02",name:"Chill Stretch",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/F_Talking_Variations_002.glb"},{id:"f_talk_03",name:"This Is Me",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/F_Talking_Variations_003.glb"},{id:"f_talk_04",name:"Empathize",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/F_Talking_Variations_004.glb"},{id:"f_talk_05",name:"Loose Hands Stretch",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/F_Talking_Variations_005.glb"},{id:"f_talk_06",name:"Take It Easy",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/F_Talking_Variations_006.glb"}],qF=["https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_005.glb","https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_007.glb","https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_006.glb"],KF=["https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/F_Talking_Variations_004.glb","https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/F_Talking_Variations_005.glb","https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/F_Talking_Variations_006.glb","https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/F_Talking_Variations_002.glb"],WF={zoom:.85,position:[.15,-.8,0],scale:1.5,rotation:[.15,.02,0]},jF=[-.45,1.9,.1],ZF=[-.45,1.75,.1],QF={browInnerUp:.2},VS=.18,$F=1,e4=.5,_C=3,__=.55,kS=.12,yC=2,xC=2,y_=4,AC=8,t4=1,SC=.38,MC=.32,bC="__branding__",x_={neutral:{eyeLookDownLeft:.1,eyeLookDownRight:.1},happy:{mouthSmileLeft:.2,mouthSmileRight:.2,eyeLookDownLeft:.1,eyeLookDownRight:.1},sad:{eyeLookDownLeft:.2,eyeLookDownRight:.2,browDownRight:.1,browInnerUp:.6,browOuterUpRight:.2,eyeSquintLeft:.7,eyeSquintRight:.7,mouthFrownLeft:.8,mouthFrownRight:.8,mouthLeft:.2,mouthPucker:.5,mouthRollLower:.2,mouthRollUpper:.2,mouthShrugLower:.2,mouthShrugUpper:.2,mouthStretchLeft:.4},angry:{eyeLookDownLeft:.1,eyeLookDownRight:.1,browDownLeft:.6,browDownRight:.6,jawForward:.3,mouthFrownLeft:.7,mouthFrownRight:.7,mouthRollLower:.2,mouthShrugLower:.3},fear:{browInnerUp:.7,eyeSquintLeft:.5,eyeSquintRight:.5,eyeWideLeft:.6,eyeWideRight:.6,mouthClose:.1,mouthFunnel:.3,mouthShrugLower:.5,mouthShrugUpper:.5},disgust:{browDownLeft:.7,browDownRight:.1,browInnerUp:.3,eyeSquintLeft:1,eyeSquintRight:1,eyeWideLeft:.5,eyeWideRight:.5,mouthLeft:.4,mouthPressLeft:.3,mouthRollLower:.3,mouthShrugLower:.3,mouthShrugUpper:.8,mouthUpperUpLeft:.3,noseSneerLeft:1,noseSneerRight:.7},love:{browInnerUp:.4,browOuterUpLeft:.2,browOuterUpRight:.2,mouthSmileLeft:.2,mouthSmileRight:.2,eyeBlinkLeft:.6,eyeBlinkRight:.6,eyeWideLeft:.7,eyeWideRight:.7,mouthDimpleLeft:.1,mouthDimpleRight:.1,mouthPressLeft:.2,mouthShrugUpper:.2,mouthUpperUpLeft:.1,mouthUpperUpRight:.1}},EC=[{key:"viseme_aa",mix:{jawOpen:.6},teethMix:{jawOpen:.6}},{key:"viseme_E",mix:{mouthPressLeft:.8,mouthPressRight:.8,mouthDimpleLeft:1,mouthDimpleRight:1,jawOpen:.3},teethMix:{mouthPressLeft:.8,mouthPressRight:.8,mouthDimpleLeft:1,mouthDimpleRight:1,jawOpen:.3}},{key:"viseme_I",mix:{mouthPressLeft:.6,mouthPressRight:.6,mouthDimpleLeft:.6,mouthDimpleRight:.6,jawOpen:.2},teethMix:{mouthPressLeft:.6,mouthPressRight:.6,mouthDimpleLeft:.6,mouthDimpleRight:.6,jawOpen:.2}},{key:"viseme_O",mix:{mouthPucker:1,jawForward:.6,jawOpen:.2},teethMix:{mouthPucker:1,jawForward:.6,jawOpen:.2}},{key:"viseme_U",mix:{mouthFunnel:1},teethMix:{mouthFunnel:1}},{key:"viseme_PP",mix:{mouthRollLower:.8,mouthRollUpper:.4,mouthUpperUpLeft:.3,mouthUpperUpRight:.3},teethMix:{mouthRollLower:.8,mouthRollUpper:.4,mouthUpperUpLeft:.3,mouthUpperUpRight:.3}},{key:"viseme_FF",mix:{mouthPucker:1,mouthShrugUpper:1,mouthLowerDownLeft:.2,mouthLowerDownRight:.2,mouthDimpleLeft:1,mouthDimpleRight:1,mouthRollLower:1},teethMix:{mouthPucker:1,mouthShrugUpper:1,mouthLowerDownLeft:.2,mouthLowerDownRight:.2,mouthDimpleLeft:1,mouthDimpleRight:1,mouthRollLower:1}},{key:"viseme_DD",mix:{mouthPressLeft:.8,mouthPressRight:.8,mouthFunnel:.5,jawOpen:.2},teethMix:{mouthPressLeft:.8,mouthPressRight:.8,mouthFunnel:.5,jawOpen:.2}},{key:"viseme_SS",mix:{mouthPressLeft:.8,mouthPressRight:.8,mouthLowerDownLeft:.5,mouthLowerDownRight:.5,jawOpen:.1},teethMix:{mouthPressLeft:.8,mouthPressRight:.8,mouthLowerDownLeft:.5,mouthLowerDownRight:.5,jawOpen:.1}},{key:"viseme_TH",mix:{mouthRollUpper:.6,jawOpen:.2,tongueOut:.4},teethMix:{mouthRollUpper:.6,jawOpen:.2,tongueOut:.4}},{key:"viseme_CH",mix:{mouthPucker:.5,jawOpen:.2},teethMix:{mouthPucker:.5,jawOpen:.2}},{key:"viseme_RR",mix:{mouthPucker:.5,jawOpen:.2},teethMix:{mouthPucker:.5,jawOpen:.2}},{key:"viseme_kk",mix:{mouthLowerDownLeft:.4,mouthLowerDownRight:.4,mouthDimpleLeft:.3,mouthDimpleRight:.3,mouthFunnel:.3,mouthPucker:.3,jawOpen:.15},teethMix:{mouthLowerDownLeft:.4,mouthLowerDownRight:.4,mouthDimpleLeft:.3,mouthDimpleRight:.3,mouthFunnel:.3,mouthPucker:.3,jawOpen:.15}},{key:"viseme_nn",mix:{mouthLowerDownLeft:.4,mouthLowerDownRight:.4,mouthDimpleLeft:.3,mouthDimpleRight:.3,mouthFunnel:.3,mouthPucker:.3,jawOpen:.15,tongueOut:.2},teethMix:{mouthLowerDownLeft:.4,mouthLowerDownRight:.4,mouthDimpleLeft:.3,mouthDimpleRight:.3,mouthFunnel:.3,mouthPucker:.3,jawOpen:.15,tongueOut:.2}},{key:"viseme_sil",mix:{}}],n4={aei:[{v:"aa",w:.5},{v:"E",w:.3},{v:"I",w:.2}],o:[{v:"O",w:.7},{v:"U",w:.3}],ee:[{v:"I",w:1}],bmp:[{v:"PP",w:1}],fv:[{v:"FF",w:1}],l:[{v:"nn",w:1}],r:[{v:"RR",w:1}],th:[{v:"TH",w:1}],qw:[{v:"U",w:.6},{v:"O",w:.4}],cdgknstxyz:[{v:"DD",w:.4},{v:"SS",w:.3},{v:"kk",w:.2},{v:"CH",w:.1}]},XS=new Set(EC.flatMap(s=>[...Object.keys(s.mix),...s.teethMix?Object.keys(s.teethMix):[]]));function TC(s){const e=Math.max(0,Math.min(1,s));return e*e*(3-2*e)}function i4(s,e,t){if(t<=0)return 0;const n=(s-e)/t;return n<0||n>1?0:n<.15?TC(n/.15):n>.85?TC((1-n)/.15):1}function a4(s){if(!s)return[{v:"sil",w:1}];const e=s.toLowerCase();return n4[e]??[{v:"sil",w:1}]}function s4({target:s}){const{camera:e}=kh();return ge.useEffect(()=>{e.lookAt(...s)},[e,s]),null}function dn(s,e,t){if(!s||!s.morphTargetDictionary)return;const n=s,i=n.morphTargetDictionary,o=n.morphTargetInfluences;if(o)for(const l in i)l.toLowerCase()===e.toLowerCase()&&(o[i[l]]=t)}const r4=ge.memo(({avatarUrl:s,isPlayingRef:e,visemeQueueRef:t,audioContextRef:n,responseAudioStartTimeRef:i,adjustments:o,mood:l,expression:h,agentResponse:d,isSpeaking:p,nextStartTimeRef:_,stopPlayback:v,setIsSpeaking:y,expressionUrl:x,onExpressionFinished:b,isNudgeResponse:R,avatarGender:T})=>{const{scene:M}=Kh(s),D=Kh(T==="female"?YF:XF),L=ge.useMemo(()=>D.flatMap(It=>It.animations),[D]),O=Kh(T==="female"?KF:qF),z=ge.useMemo(()=>O.flatMap(It=>It.animations),[O]),V=ge.useRef(null),N=ge.useRef(null),F=ge.useRef(null),K=ge.useRef(null),ne=ge.useRef(null),ee=ge.useRef(null),ie=ge.useRef([]),[he]=ge.useState(()=>new lE(M)),H=ge.useRef({}),Y=ge.useRef(null),$=ge.useRef(0),ye=ge.useRef(!1),_e=ge.useRef(0),W=ge.useRef(!1),ae=ge.useRef(null),Me=ge.useRef(_C),Ne=ge.useRef(-1),it=ge.useRef("left"),ve=ge.useRef(y_+Math.random()*(AC-y_)),Ce=ge.useRef(0),tt=ge.useRef("smile"),Et=ge.useRef({});ge.useEffect(()=>{if(!(!L||!M)){if(L.forEach((It,mt)=>{const me=`idle_${mt}`;if(!H.current[me]){const Le=he.clipAction(It,M);Le.name=me,Le.setLoop(pp,1),Le.clampWhenFinished=!0,H.current[me]=Le}}),z.forEach((It,mt)=>{const me=`talk_${mt}`;if(!H.current[me]){const Le=he.clipAction(It,M);Le.name=me,Le.setLoop(pp,1),Le.clampWhenFinished=!0,H.current[me]=Le}}),L.length>0){const It=H.current.idle_0,mt=Y.current&&he.existingAction(Y.current.getClip());It&&!mt&&(It.reset().fadeIn(.5).play(),Y.current=It)}return()=>{he.stopAllAction(),H.current={},Y.current=null}}},[L,z,M,he]);const wt=ge.useRef("");ge.useEffect(()=>{if(!x||!M||x===wt.current)return;wt.current=x,ae.current=x,new oF().load(x,mt=>{if(mt.animations&&mt.animations.length>0){const me=mt.animations[0],Le=he.clipAction(me,M);if(Le.name=`EXPR_${x}`,Le.setLoop(pp,1),Le.clampWhenFinished=!0,H.current[`EXPR_${x}`]=Le,p&&ae.current===x){const Ue=Y.current;Le.reset().fadeIn(.3).play(),Ue&&Ue!==Le&&Ue.crossFadeTo(Le,.3,!0),Y.current=Le,ae.current=null}}},void 0,mt=>{console.error(`[ANIMATION] Failed to load ${x}`,mt)})},[x,M,he,p]),ge.useEffect(()=>{const It=mt=>{const me=mt.action,Le=me.name||"";if(Le.startsWith("idle_")){const rt=(parseInt(Le.split("_")[1])+1)%L.length,Q=H.current[`idle_${rt}`];Q&&(Q.reset().fadeIn(.5).play(),me.crossFadeTo(Q,.5,!0),Y.current=Q)}else if(Le.startsWith("EXPR_")){if(p){const Ue=Math.floor(Math.random()*z.length),rt=H.current[`talk_${Ue}`];rt&&(rt.reset().fadeIn(.5).play(),me.crossFadeTo(rt,.5,!0),Y.current=rt)}else{const Ue=H.current.idle_0;Ue&&(Ue.reset().fadeIn(.5).play(),me.crossFadeTo(Ue,.5,!0),Y.current=Ue)}b&&b()}else if(Le.startsWith("talk_"))if(p&&!R){const rt=(parseInt(Le.split("_")[1])+1)%z.length,Q=H.current[`talk_${rt}`];Q&&(Q.reset().fadeIn(.3).play(),me.crossFadeTo(Q,.3,!0),Y.current=Q)}else{const Ue=H.current.idle_0;Ue&&(Ue.reset().fadeIn(.5).play(),me.crossFadeTo(Ue,.5,!0),Y.current=Ue)}};return he.addEventListener("finished",It),()=>he.removeEventListener("finished",It)},[he,L,z,p,R,b]),ge.useEffect(()=>{if(p&&M){const It=Y.current,mt=It?.name||"";if(mt.startsWith("idle_")||mt.startsWith("talk_")||mt===""){const me=ae.current;if(me){const Le=H.current[`EXPR_${me}`];if(Le){Le.reset().fadeIn(.3).play(),It&&It!==Le&&It.crossFadeTo(Le,.3,!0),Y.current=Le,ae.current=null;return}}if(mt.startsWith("idle_")||mt===""){const Le=Math.floor(Math.random()*z.length),Ue=H.current[`talk_${Le}`];Ue&&(Ue.reset().fadeIn(.5).play(),It&&It.crossFadeTo(Ue,.5,!0),Y.current=Ue)}}}else if(!p&&M){const It=Y.current,mt=It?.name||"";if(mt.startsWith("talk_")||mt.startsWith("EXPR_")){const me=H.current.idle_0;me&&(me.reset().fadeIn(.5).play(),It&&It.crossFadeTo(me,.5,!0),Y.current=me)}}},[p,M,x]),ge.useEffect(()=>{if(!M)return;M.traverse(me=>{if(me.isMesh&&me.morphTargetDictionary){const Le=me.name.toLowerCase();(Le.includes("head")||Le.includes("avatar"))&&(N.current=me,ua(`[ANIMATION] Found head mesh: ${me.name}`)),Le.includes("teeth")&&(F.current=me,ua(`[ANIMATION] Found teeth mesh: ${me.name}`)),Le.includes("beard")&&(K.current=me,ua(`[ANIMATION] Found beard mesh: ${me.name}`)),Le.includes("eyeleft")&&(ne.current=me,ua(`[ANIMATION] Found eye left mesh: ${me.name}`)),Le.includes("eyeright")&&(ee.current=me,ua(`[ANIMATION] Found eye right mesh: ${me.name}`))}});const It=N.current?.morphTargetDictionary;It&&Object.keys(It).filter(me=>me.toLowerCase().includes("brow"));const mt=[];M.traverse(me=>{if(me.isMesh){const Ue=me.morphTargetDictionary;Ue&&Object.keys(Ue).some(rt=>rt.toLowerCase().includes("brow"))&&mt.push(me)}}),ie.current=mt,mt.length>0&&ua("[ANIMATION] Meshes with brow morphs:",mt.length)},[M]);const on=It=>{const mt=x_[It]??x_.neutral;for(const me in mt)dn(N.current,me,mt[me]),dn(F.current,me,mt[me]),dn(K.current,me,mt[me])};return bT((It,mt)=>{on(l);const me=It.clock.elapsedTime;let Le=0;if(Math.floor(me)%5===0&&Math.floor((me-mt)%5)!==0){let bt=null;M.traverse(Nn=>{Nn.name.toLowerCase().includes("hips")&&(bt=Nn)});const Dn=bt?`Hips Y: ${bt.position.y.toFixed(4)}`:"Hips not found";ua(`[ANIMATION] Mixer Time: ${he.time.toFixed(2)}, ${Dn}`)}if(he.update(mt),me>$.current&&!ye.current&&(ye.current=!0,_e.current=me),ye.current){const bt=p?.2:.3,Dn=(me-_e.current)/bt;if(Dn>=1)if(ye.current=!1,W.current){const Nn=p?1:2.5;$.current=me+Nn,W.current=!1}else $.current=me+.12,W.current=!0;else{const Nn=Dn<.5?Dn*2:(1-Dn)*2;dn(N.current,"eyeBlinkLeft",Nn),dn(N.current,"eyeBlinkRight",Nn),dn(F.current,"eyeBlinkLeft",Nn),dn(F.current,"eyeBlinkRight",Nn),dn(K.current,"eyeBlinkLeft",Nn),dn(K.current,"eyeBlinkRight",Nn),Le=Nn*QF.browInnerUp}}const Ue=x_[l]??x_.neutral,rt=Ue.browInnerUp??0,Q=Ue.browOuterUpLeft??0,Kt=Ue.browOuterUpRight??0,_t=me*$F,Ft=VS*Math.sin(_t),yt=VS*.7*Math.sin(_t+.7),j=VS*.7*Math.sin(_t+1.3),I=bt=>Math.max(0,Math.min(1,bt)),ue=I(rt+Ft),Ie=I(Q+yt),Xe=I(Kt+j),Oe=I(ue+Le);dn(N.current,"browInnerUp",Oe),dn(F.current,"browInnerUp",Oe),dn(K.current,"browInnerUp",Oe),dn(N.current,"browOuterUpLeft",Ie),dn(F.current,"browOuterUpLeft",Ie),dn(K.current,"browOuterUpLeft",Ie),dn(N.current,"browOuterUpRight",Xe),dn(F.current,"browOuterUpRight",Xe),dn(K.current,"browOuterUpRight",Xe);const Bt=Me.current,gt=Bt+__,Ht=gt+kS;me>Ht&&(Me.current+=__+kS+_C);const Xt=!p&&me>=Bt&&me<gt,ze=!p&&me>=gt&&me<Ht;(Xt||ze)&&Ne.current!==Bt&&(Ne.current=Bt,it.current=Math.random()<.7?"left":"up");const qe=Xt?me-Bt:ze?__:0,Tt=Xt||ze?Math.min(1,qe/__):0,pt=Tt<=0?0:Math.sin(Tt*Math.PI),st=ze?1-(me-gt)/kS:1,qt=Xt?pt:ze?pt*st:0,de=e4*qt,be=bt=>Ue[bt]??0;if(it.current==="up"?(dn(ne.current,"eyeLookUpLeft",I(be("eyeLookUpLeft")+de)),dn(ne.current,"eyeLookDownLeft",I(be("eyeLookDownLeft"))),dn(ne.current,"eyeLookOutLeft",I(be("eyeLookOutLeft"))),dn(ne.current,"eyeLookInLeft",I(be("eyeLookInLeft"))),dn(ee.current,"eyeLookUpRight",I(be("eyeLookUpRight")+de)),dn(ee.current,"eyeLookDownRight",I(be("eyeLookDownRight"))),dn(ee.current,"eyeLookOutRight",I(be("eyeLookOutRight"))),dn(ee.current,"eyeLookInRight",I(be("eyeLookInRight")))):(dn(ne.current,"eyeLookUpLeft",I(be("eyeLookUpLeft"))),dn(ne.current,"eyeLookDownLeft",I(be("eyeLookDownLeft"))),dn(ne.current,"eyeLookOutLeft",I(be("eyeLookOutLeft"))),dn(ne.current,"eyeLookInLeft",I(be("eyeLookInLeft")+de)),dn(ee.current,"eyeLookUpRight",I(be("eyeLookUpRight"))),dn(ee.current,"eyeLookDownRight",I(be("eyeLookDownRight"))),dn(ee.current,"eyeLookOutRight",I(be("eyeLookOutRight")+de)),dn(ee.current,"eyeLookInRight",I(be("eyeLookInRight")))),!p&&me>=ve.current){Ce.current=me,tt.current=Math.random()<.5?"pucker":"smile";const bt=tt.current==="pucker"?xC:yC;ve.current=me+bt+y_+Math.random()*(AC-y_)}const We=tt.current==="pucker"?xC:yC,St=!p&&me>=Ce.current&&me<Ce.current+We,Ye=St?(me-Ce.current)/We:0,Ve=Ye<=0?0:Ye<.5?Ye*2:(()=>{const bt=(Ye-.5)*2;return 1-bt*bt*(3-2*bt)})(),ft=bt=>Ue[bt]??0;if(St)if(tt.current==="pucker"){const bt=I(ft("mouthPucker")+t4*Ve);dn(N.current,"mouthPucker",bt),dn(F.current,"mouthPucker",bt),dn(K.current,"mouthPucker",bt)}else{const bt=I(ft("mouthSmileLeft")+SC*Ve),Dn=I(ft("mouthSmileRight")+SC*Ve),Nn=I(ft("mouthDimpleLeft")+MC*Ve),Ni=I(ft("mouthDimpleRight")+MC*Ve);dn(N.current,"mouthSmileLeft",bt),dn(N.current,"mouthSmileRight",Dn),dn(N.current,"mouthDimpleLeft",Nn),dn(N.current,"mouthDimpleRight",Ni),dn(F.current,"mouthSmileLeft",bt),dn(F.current,"mouthSmileRight",Dn),dn(F.current,"mouthDimpleLeft",Nn),dn(F.current,"mouthDimpleRight",Ni),dn(K.current,"mouthSmileLeft",bt),dn(K.current,"mouthSmileRight",Dn),dn(K.current,"mouthDimpleLeft",Nn),dn(K.current,"mouthDimpleRight",Ni)}if(V.current){const bt=e.current?0:o.rotation[1];V.current.rotation.y=R0.lerp(V.current.rotation.y,bt,.1),V.current.position.set(...o.position),V.current.scale.setScalar(o.scale),V.current.rotation.x=o.rotation[0],V.current.rotation.z=o.rotation[2]}const jt={};if(XS.forEach(bt=>{jt[bt]=0}),e.current&&n.current){const bt=n.current.currentTime,Ni=(bt-i.current)*1e3- -150;for(let fa=0;fa<t.current.length;fa++){const Ui=t.current[fa];if(Ni<Ui.vtime||Ni>=Ui.vtime+Ui.vduration)continue;const Zi=i4(Ni,Ui.vtime,Ui.vduration),Ia=`viseme_${Ui.viseme}`.toLowerCase(),vi=EC.find(ci=>ci.key.toLowerCase()===Ia);if(!vi)continue;const en=(Ui.weight??1)*Zi;for(const ci in vi.mix)jt[ci]=Math.max(jt[ci]??0,vi.mix[ci]*en);if(vi.teethMix)for(const ci in vi.teethMix)jt[ci]=Math.max(jt[ci]??0,vi.teethMix[ci]*en)}bt>_.current+.5&&(v(),y(!1))}const Sn=Et.current;XS.forEach(bt=>{const Dn=jt[bt]??0,Nn=Sn[bt]??0;Sn[bt]=Math.max(0,Math.min(1,Nn+(Dn-Nn)*(1-Math.exp(-20*mt))))}),XS.forEach(bt=>{const Dn=Sn[bt]??0;dn(N.current,bt,Dn),dn(K.current,bt,Dn),dn(F.current,bt,Dn)})}),Jt.jsx("group",{ref:V,children:Jt.jsx("primitive",{object:M})})});function o4(s){return s?s.charAt(0).toUpperCase()+s.slice(1).toLowerCase():""}function CC(s){return s.replace(/\*(.*?)\*/g," $1 ").replace(/\[.*?\]/g," ").replace(/<.*?\/>/g," ").replace(/<.*?>.*?<\/.*?>/g," ").replace(/\s+/g," ").trim()}const YS=new Map,l4=({onNavigationRequested:s,agentId:e,presetUserDetails:t,onAvatarReady:n})=>{const[i,o]=ge.useState(""),[l,h]=ge.useState("male"),[d,p]=ge.useState(""),[_,v]=ge.useState(!1),[y,x]=ge.useState(()=>typeof window>"u"?null:sessionStorage.getItem("STREAMOJI_LEADS_SESSION_LEAD_ID")),b=i,R=l;ge.useEffect(()=>{if(!e){v(!0);return}let we=!1;return(async()=>{console.log(">> fetchConfig RUNNING for",e);try{const ut=`agent_config_${e}`,Ut=sessionStorage.getItem("STREAMOJI_LEADS_SESSION_LEAD_ID"),Nt=sessionStorage.getItem(ut);if(Nt)try{const ln=JSON.parse(Nt);we||(ln.encryptedAgentToken&&o(ln.encryptedAgentToken),ln.avatarGender&&h(ln.avatarGender),ln.agent_id&&p(ln.agent_id),ln.lead_id&&(x(ln.lead_id),sessionStorage.setItem("STREAMOJI_LEADS_SESSION_LEAD_ID",ln.lead_id)),v(!0));return}catch(ln){console.error("Failed to parse cached avatar config:",ln),sessionStorage.removeItem(ut)}let Vt;if(YS.has(e))console.log(">> REUSING in-flight fetch for",e),Vt=await YS.get(e);else{const ln=(async()=>{console.log(">> INITIATING visitedWebsite fetch for",e);const Wn={agentId:e,lead_id:Ut},En=await fetch(`${Zh}/visitedWebsite`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Wn)});if(!En.ok)throw new Error(`Fetch failed: ${En.status}`);const Cn=await En.json();return sessionStorage.setItem(ut,JSON.stringify(Cn)),Cn})();YS.set(e,ln),Vt=await ln}if(we)return;Vt&&(Vt.encryptedAgentToken&&o(Vt.encryptedAgentToken),Vt.avatarGender&&h(Vt.avatarGender),Vt.agent_id&&p(Vt.agent_id),Vt.lead_id&&(x(Vt.lead_id),sessionStorage.setItem("STREAMOJI_LEADS_SESSION_LEAD_ID",Vt.lead_id)))}catch(ut){console.error("Failed to fetch avatar config:",ut)}finally{we||v(!0)}})(),()=>{we=!0}},[e]);const T=kF(e??d),[M,w]=ge.useState(""),[D,L]=ge.useState(""),[P,O]=ge.useState("Ready"),[z,V]=ge.useState(!1),[N,F]=ge.useState(!1),[K,ne]=ge.useState([]),[ee,ie]=ge.useState(""),he=ge.useRef(null),[H,Y]=ge.useState(()=>typeof window<"u"?window.matchMedia("(max-width: 480px)").matches:!1);ge.useEffect(()=>{const we=window.matchMedia("(max-width: 480px)"),at=()=>Y(we.matches);return we.addEventListener("change",at),()=>we.removeEventListener("change",at)},[]);const $=H?80:600,ye=ge.useRef(!1),_e=ge.useRef([]),W=ge.useRef(0),ae=ge.useRef(!1),Me=ge.useRef([]),Ne=ge.useRef(null),it=ge.useRef([]);ge.useRef([]);const ve=ge.useRef([]),Ce=ge.useRef(0),tt=ge.useRef(0),Et=ge.useRef(0),wt=ge.useRef(0),on=ge.useRef(!1),[It,mt]=ge.useState(null),me=ge.useRef(null),[Le,Ue]=ge.useState("neutral"),[rt,Q]=ge.useState(""),[Kt,_t]=ge.useState(""),[Ft,yt]=ge.useState(()=>{if(typeof window>"u")return null;try{const we=window.sessionStorage.getItem("leadCaptureAskFor");return we&&we!==""?we:null}catch{return null}}),[j,I]=ge.useState("hidden"),[ue,Ie]=ge.useState(""),Xe=ge.useRef(null),Oe=ge.useRef(j);Oe.current=j;const[Bt,gt]=ge.useState(null),Ht=ge.useRef(null),Xt=ge.useRef(null),[ze,qe]=ge.useState(!1),Tt=ge.useRef(null),[pt,st]=ge.useState("hidden"),[qt,de]=ge.useState(""),be=ge.useRef(pt);be.current=pt;const We=ge.useRef(""),St=ge.useRef(!1),Ye=ge.useRef(""),Ve=ge.useRef(Date.now()),ft=ge.useRef([]),jt=ge.useRef(!1),[Sn,bt]=ge.useState(!1),[Dn,Nn]=ge.useState(!1),Ni=ge.useRef(null),fa=ge.useMemo(()=>ze?"Try again":P==="Busy"?"Busy":P==="Thinking..."||P==="Processing Voice..."?P:Ft!=null&&Ft!==""&&Ft!=="none"&&Ft!=="<none>"?`Enter ${o4(Ft)}`:pt!=="hidden"||!Dn?null:bC,[P,Ft,ze,pt,Dn]),Ui=!ze&&P!=="Busy"&&P!=="Thinking..."&&P!=="Processing Voice..."&&(Ft==null||Ft===""||Ft==="none"||Ft==="<none>");ge.useEffect(()=>{if(pt!=="hidden"||!Ui){Nn(!1),Ni.current!=null&&(clearTimeout(Ni.current),Ni.current=null);return}return Ni.current=setTimeout(()=>{Ni.current=null,Nn(!0)},400),()=>{Ni.current!=null&&(clearTimeout(Ni.current),Ni.current=null)}},[pt,Ui]);const Zi=fa!=null&&fa!=="";ge.useEffect(()=>{const we=Oe.current;if(!(we==="exiting"||we==="entering")){if(we==="hidden"){Zi&&(Ie(fa??""),I("entering"));return}we==="visible"&&(!Zi||fa!==ue)&&(Xe.current=Zi?fa:null,I("exiting"))}},[Zi,fa,j,ue]),ge.useEffect(()=>{if(P!=="Busy"){Xt.current!=null&&(clearTimeout(Xt.current),Xt.current=null);return}return Xt.current=setTimeout(()=>{Xt.current=null,O("Ready"),qe(!0)},12e3),()=>{Xt.current!=null&&(clearTimeout(Xt.current),Xt.current=null)}},[P]),ge.useEffect(()=>{if(!ze)return;const we=setTimeout(()=>qe(!1),2500);return()=>clearTimeout(we)},[ze]);const Ia=ge.useCallback(()=>{const we=Oe.current;if(we==="exiting"){I("hidden");const at=Xe.current;Xe.current=null,at!=null&&at!==""&&(Ie(at),I("entering"))}else we==="entering"&&I("visible")},[]),vi=we=>{if(!we)return;if(we.mood!=null){const Nt=String(we.mood).toLowerCase();Ue(Nt)}if(we.expression!=null){const Nt=String(we.expression).trim();Q(Nt);const Vt=JF.find(ln=>ln.name.toLowerCase()===Nt.toLowerCase());ua(`[STREAM] Animation match for "${Nt}": ${Vt?Vt.name:"NONE"}`),_t(Vt?.url??"")}if(we.navigation!=null){const Nt=String(we.navigation).trim();if(Nt!==""){let Vt=!1;if(typeof window<"u")try{const ln=new URL(window.location.href),Wn=new URL(Nt,window.location.href),En=ln.hostname==="leads.streamoji.com"||ln.hostname.includes("localhost");if(Wn.origin!==ln.origin&&!En){ua("[STREAM] Navigation rejected: different origin");return}const Cn=ti=>ti.replace(/\/+$/,"")||"/";Vt=Cn(ln.pathname)===Cn(Wn.pathname)}catch{}if(Vt)return;s?s(Nt):gt(Nt)}}const at=we.ask_for||we.lead_capture?.ask_for,ut=at?String(at).trim().toLowerCase():"",Ut=ut==="none"||ut==="<none>";if(at&&!Ut){const Nt=ut;if(t&&(Nt==="email"&&t.email||Nt==="name"&&t.name||Nt==="phone"&&t.phone))return;if(typeof window<"u")try{window.sessionStorage.setItem("leadCaptureAskFor",Nt)}catch{}yt(Nt||null)}else if(Ut||we.ask_for===null||we.lead_capture&&we.lead_capture.ask_for===null||we.ask_for==="none"){if(typeof window<"u")try{window.sessionStorage.removeItem("leadCaptureAskFor")}catch{}yt(null)}we.collected,we.valid},en=we=>{const at=we.trim();if(!at)return null;if(at.startsWith("{"))try{return JSON.parse(at)}catch{return null}if(at.includes(":")){const ut=at.split(":"),Ut=ut[0].trim().toLowerCase(),Nt=ut.slice(1).join(":").trim();return{[Ut]:Nt}}return null},ci=ge.useCallback(()=>{},[]),fn="§",G=()=>{for(;We.current.includes(`
4149
+ `;class ZI extends Ns{_maxDisplayBoost;_hdrCapacityMin;_hdrCapacityMax;constructor({gamma:e,offsetHdr:t,offsetSdr:n,gainMapMin:i,gainMapMax:o,maxDisplayBoost:l,hdrCapacityMin:h,hdrCapacityMax:d,sdr:p,gainMap:_}){super({name:"GainMapDecoderMaterial",vertexShader:WI,fragmentShader:jI,uniforms:{sdr:{value:p},gainMap:{value:_},gamma:{value:new Z(1/e[0],1/e[1],1/e[2])},offsetHdr:{value:new Z().fromArray(t)},offsetSdr:{value:new Z().fromArray(n)},gainMapMin:{value:new Z().fromArray(i)},gainMapMax:{value:new Z().fromArray(o)},weightFactor:{value:(Math.log2(l)-h)/(d-h)}},blending:so,depthTest:!1,depthWrite:!1}),this._maxDisplayBoost=l,this._hdrCapacityMin=h,this._hdrCapacityMax=d,this.needsUpdate=!0,this.uniformsNeedUpdate=!0}get sdr(){return this.uniforms.sdr.value}set sdr(e){this.uniforms.sdr.value=e}get gainMap(){return this.uniforms.gainMap.value}set gainMap(e){this.uniforms.gainMap.value=e}get offsetHdr(){return this.uniforms.offsetHdr.value.toArray()}set offsetHdr(e){this.uniforms.offsetHdr.value.fromArray(e)}get offsetSdr(){return this.uniforms.offsetSdr.value.toArray()}set offsetSdr(e){this.uniforms.offsetSdr.value.fromArray(e)}get gainMapMin(){return this.uniforms.gainMapMin.value.toArray()}set gainMapMin(e){this.uniforms.gainMapMin.value.fromArray(e)}get gainMapMax(){return this.uniforms.gainMapMax.value.toArray()}set gainMapMax(e){this.uniforms.gainMapMax.value.fromArray(e)}get gamma(){const e=this.uniforms.gamma.value;return[1/e.x,1/e.y,1/e.z]}set gamma(e){const t=this.uniforms.gamma.value;t.x=1/e[0],t.y=1/e[1],t.z=1/e[2]}get hdrCapacityMin(){return this._hdrCapacityMin}set hdrCapacityMin(e){this._hdrCapacityMin=e,this.calculateWeight()}get hdrCapacityMax(){return this._hdrCapacityMax}set hdrCapacityMax(e){this._hdrCapacityMax=e,this.calculateWeight()}get maxDisplayBoost(){return this._maxDisplayBoost}set maxDisplayBoost(e){this._maxDisplayBoost=Math.max(1,Math.min(65504,e)),this.calculateWeight()}calculateWeight(){const e=(Math.log2(this._maxDisplayBoost)-this._hdrCapacityMin)/(this._hdrCapacityMax-this._hdrCapacityMin);this.uniforms.weightFactor.value=Math.max(0,Math.min(1,e))}}class rC extends KI{constructor(e,t){super({renderer:e,createMaterial:n=>new ZI(n),createQuadRenderer:n=>new BS(n)},t)}async render(e,t,n,i){const{sdrImage:o,gainMapImage:l,needsFlip:h}=await this.processImages(n,i,"flipY"),{gainMap:d,sdr:p}=this.createTextures(o,l,h);this.updateQuadRenderer(e,o,d,p,t),e.render()}}class QI extends rC{load([e,t,n],i,o,l){const h=this.prepareQuadRenderer();let d,p,_;const v=async()=>{if(d&&p&&_){try{await this.render(h,_,d,p)}catch(N){this.manager.itemError(e),this.manager.itemError(t),this.manager.itemError(n),typeof l=="function"&&l(N),h.disposeOnDemandRenderer();return}typeof i=="function"&&i(h),this.manager.itemEnd(e),this.manager.itemEnd(t),this.manager.itemEnd(n),h.disposeOnDemandRenderer()}};let y=!0,x=0,b=0,R=!0,T=0,M=0,w=!0,D=0,L=0;const P=()=>{if(typeof o=="function"){const N=x+T+D,F=b+M+L,K=y&&R&&w;o(new ProgressEvent("progress",{lengthComputable:K,loaded:F,total:N}))}};this.manager.itemStart(e),this.manager.itemStart(t),this.manager.itemStart(n);const O=new Na(this._internalLoadingManager);O.setResponseType("arraybuffer"),O.setRequestHeader(this.requestHeader),O.setPath(this.path),O.setWithCredentials(this.withCredentials),O.load(e,async N=>{if(typeof N=="string")throw new Error("Invalid sdr buffer");d=N,await v()},N=>{y=N.lengthComputable,b=N.loaded,x=N.total,P()},N=>{this.manager.itemError(e),typeof l=="function"&&l(N)});const z=new Na(this._internalLoadingManager);z.setResponseType("arraybuffer"),z.setRequestHeader(this.requestHeader),z.setPath(this.path),z.setWithCredentials(this.withCredentials),z.load(t,async N=>{if(typeof N=="string")throw new Error("Invalid gainmap buffer");p=N,await v()},N=>{R=N.lengthComputable,M=N.loaded,T=N.total,P()},N=>{this.manager.itemError(t),typeof l=="function"&&l(N)});const V=new Na(this._internalLoadingManager);return V.setRequestHeader(this.requestHeader),V.setPath(this.path),V.setWithCredentials(this.withCredentials),V.load(n,async N=>{if(typeof N!="string")throw new Error("Invalid metadata string");_=JSON.parse(N),await v()},N=>{w=N.lengthComputable,L=N.loaded,D=N.total,P()},N=>{this.manager.itemError(n),typeof l=="function"&&l(N)}),h}}class $I extends rC{load(e,t,n,i){const o=this.prepareQuadRenderer(),l=new Na(this._internalLoadingManager);return l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setPath(this.path),l.setWithCredentials(this.withCredentials),this.manager.itemStart(e),l.load(e,async h=>{if(typeof h=="string")throw new Error("Invalid buffer, received [string], was expecting [ArrayBuffer]");const d=new Uint8Array(h);let p,_,v;try{const y=await qI(d);p=y.sdr,_=y.gainMap,v=y.metadata}catch(y){if(y instanceof aC||y instanceof iC)console.warn(`Failure to reconstruct an HDR image from ${e}: Gain map metadata not found in the file, HDRJPGLoader will render the SDR jpeg`),v={gainMapMin:[0,0,0],gainMapMax:[1,1,1],gamma:[1,1,1],hdrCapacityMin:0,hdrCapacityMax:1,offsetHdr:[0,0,0],offsetSdr:[0,0,0]},p=d;else throw y}try{await this.render(o,v,p.buffer,_?.buffer)}catch(y){this.manager.itemError(e),typeof i=="function"&&i(y),o.disposeOnDemandRenderer();return}typeof t=="function"&&t(o),this.manager.itemEnd(e),o.disposeOnDemandRenderer()},n,h=>{this.manager.itemError(e),typeof i=="function"&&i(h)}),o}}const om={apartment:"lebombo_1k.hdr",city:"potsdamer_platz_1k.hdr",dawn:"kiara_1_dawn_1k.hdr",forest:"forest_slope_1k.hdr",lobby:"st_fagans_interior_1k.hdr",night:"dikhololo_night_1k.hdr",park:"rooitou_park_1k.hdr",studio:"studio_small_03_1k.hdr",sunset:"venice_sunset_1k.hdr",warehouse:"empty_warehouse_01_1k.hdr"},oC="https://raw.githack.com/pmndrs/drei-assets/456060a26bbeb8fdf79326f224b6d99b8bcce736/hdri/",Wh=s=>Array.isArray(s),DS=["/px.png","/nx.png","/py.png","/ny.png","/pz.png","/nz.png"];function v_({files:s=DS,path:e="",preset:t=void 0,colorSpace:n=void 0,extensions:i}={}){t&&(LS(t),s=om[t],e=oC);const o=Wh(s),{extension:l,isCubemap:h}=NS(s),d=US(l);if(!d)throw new Error("useEnvironment: Unrecognized file extension: "+s);const p=kh(x=>x.gl);ge.useLayoutEffect(()=>{if(l!=="webp"&&l!=="jpg"&&l!=="jpeg")return;function x(){Gl.clear(d,o?[s]:s)}p.domElement.addEventListener("webglcontextlost",x,{once:!0})},[s,p.domElement]);const _=Gl(d,o?[s]:s,x=>{(l==="webp"||l==="jpg"||l==="jpeg")&&x.setRenderer(p),x.setPath==null||x.setPath(e),i&&i(x)});let v=o?_[0]:_;if(l==="jpg"||l==="jpeg"||l==="webp"){var y;v=(y=v.renderTarget)==null?void 0:y.texture}return v.mapping=h?ro:nh,v.colorSpace=n??(h?"srgb":"srgb-linear"),v}const eF={files:DS,path:"",preset:void 0,extensions:void 0};v_.preload=s=>{const e={...eF,...s};let{files:t,path:n=""}=e;const{preset:i,extensions:o}=e;i&&(LS(i),t=om[i],n=oC);const{extension:l}=NS(t);if(l==="webp"||l==="jpg"||l==="jpeg")throw new Error("useEnvironment: Preloading gainmaps is not supported");const h=US(l);if(!h)throw new Error("useEnvironment: Unrecognized file extension: "+t);Gl.preload(h,Wh(t)?[t]:t,d=>{d.setPath==null||d.setPath(n),o&&o(d)})};const tF={files:DS,preset:void 0};v_.clear=s=>{const e={...tF,...s};let{files:t}=e;const{preset:n}=e;n&&(LS(n),t=om[n]);const{extension:i}=NS(t),o=US(i);if(!o)throw new Error("useEnvironment: Unrecognized file extension: "+t);Gl.clear(o,Wh(t)?[t]:t)};function LS(s){if(!(s in om))throw new Error("Preset must be one of: "+Object.keys(om).join(", "))}function NS(s){var e;const t=Wh(s)&&s.length===6,n=Wh(s)&&s.length===3&&s.some(l=>l.endsWith("json")),i=Wh(s)?s[0]:s;return{extension:t?"cube":n?"webp":i.startsWith("data:application/exr")?"exr":i.startsWith("data:application/hdr")?"hdr":i.startsWith("data:image/jpeg")?"jpg":(e=i.split(".").pop())==null||(e=e.split("?"))==null||(e=e.shift())==null?void 0:e.toLowerCase(),isCubemap:t,isGainmap:n}}function US(s){return s==="cube"?X1:s==="hdr"?GI:s==="exr"?zI:s==="jpg"||s==="jpeg"?$I:s==="webp"?QI:null}const nF=s=>s.current&&s.current.isScene,iF=s=>nF(s)?s.current:s;function OS(s,e,t,n,i={}){var o,l,h,d;i={backgroundBlurriness:0,backgroundIntensity:1,backgroundRotation:[0,0,0],environmentIntensity:1,environmentRotation:[0,0,0],...i};const p=iF(e||t),_=p.background,v=p.environment,y={backgroundBlurriness:p.backgroundBlurriness,backgroundIntensity:p.backgroundIntensity,backgroundRotation:(o=(l=p.backgroundRotation)==null||l.clone==null?void 0:l.clone())!==null&&o!==void 0?o:[0,0,0],environmentIntensity:p.environmentIntensity,environmentRotation:(h=(d=p.environmentRotation)==null||d.clone==null?void 0:d.clone())!==null&&h!==void 0?h:[0,0,0]};return s!=="only"&&(p.environment=n),s&&(p.background=n),Yo(p,i),()=>{s!=="only"&&(p.environment=v),s&&(p.background=_),Yo(p,y)}}function IS({scene:s,background:e=!1,map:t,...n}){const i=kh(o=>o.scene);return ge.useLayoutEffect(()=>{if(t)return OS(e,s,i,t,n)}),null}function lC({background:s=!1,scene:e,blur:t,backgroundBlurriness:n,backgroundIntensity:i,backgroundRotation:o,environmentIntensity:l,environmentRotation:h,...d}){const p=v_(d),_=kh(v=>v.scene);return ge.useLayoutEffect(()=>OS(s,e,_,p,{backgroundBlurriness:t??n,backgroundIntensity:i,backgroundRotation:o,environmentIntensity:l,environmentRotation:h})),ge.useEffect(()=>()=>{p.dispose()},[p]),null}function aF({children:s,near:e=.1,far:t=1e3,resolution:n=256,frames:i=1,map:o,background:l=!1,blur:h,backgroundBlurriness:d,backgroundIntensity:p,backgroundRotation:_,environmentIntensity:v,environmentRotation:y,scene:x,files:b,path:R,preset:T=void 0,extensions:M}){const w=kh(V=>V.gl),D=kh(V=>V.scene),L=ge.useRef(null),[P]=ge.useState(()=>new Rp),O=ge.useMemo(()=>{const V=new K0(n);return V.texture.type=sa,V},[n]);ge.useEffect(()=>()=>{O.dispose()},[O]),ge.useLayoutEffect(()=>{if(i===1){const V=w.autoClear;w.autoClear=!0,L.current.update(w,P),w.autoClear=V}return OS(l,x,D,O.texture,{backgroundBlurriness:h??d,backgroundIntensity:p,backgroundRotation:_,environmentIntensity:v,environmentRotation:y})},[s,P,O.texture,x,D,l,i,w]);let z=1;return bT(()=>{if(i===1/0||z<i){const V=w.autoClear;w.autoClear=!0,L.current.update(w,P),w.autoClear=V,z++}}),ge.createElement(ge.Fragment,null,DO(ge.createElement(ge.Fragment,null,s,ge.createElement("cubeCamera",{ref:L,args:[e,t,O]}),b||T?ge.createElement(lC,{background:!0,files:b,preset:T,path:R,extensions:M}):o?ge.createElement(IS,{background:!0,map:o,extensions:M}):null),P))}function sF(s){var e,t,n,i;const o=v_(s),l=s.map||o;ge.useMemo(()=>RT({GroundProjectedEnvImpl:aI}),[]),ge.useEffect(()=>()=>{o.dispose()},[o]);const h=ge.useMemo(()=>[l],[l]),d=(e=s.ground)==null?void 0:e.height,p=(t=s.ground)==null?void 0:t.radius,_=(n=(i=s.ground)==null?void 0:i.scale)!==null&&n!==void 0?n:1e3;return ge.createElement(ge.Fragment,null,ge.createElement(IS,Jy({},s,{map:l})),ge.createElement("groundProjectedEnvImpl",{args:h,scale:_,height:d,radius:p}))}function rF(s){return s.ground?ge.createElement(sF,s):s.map?ge.createElement(IS,s):s.children?ge.createElement(aF,s):ge.createElement(lC,s)}function cC(s,e){if(e===ux)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),s;if(e===Uu||e===gp){let t=s.getIndex();if(t===null){const l=[],h=s.getAttribute("position");if(h!==void 0){for(let d=0;d<h.count;d++)l.push(d);s.setIndex(l),t=s.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),s}const n=t.count-2,i=[];if(e===Uu)for(let l=1;l<=n;l++)i.push(t.getX(0)),i.push(t.getX(l)),i.push(t.getX(l+1));else for(let l=0;l<n;l++)l%2===0?(i.push(t.getX(l)),i.push(t.getX(l+1)),i.push(t.getX(l+2))):(i.push(t.getX(l+2)),i.push(t.getX(l+1)),i.push(t.getX(l)));i.length/3!==n&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const o=s.clone();return o.setIndex(i),o.clearGroups(),o}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),s}class oF extends Ka{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new hF(t)}),this.register(function(t){return new dF(t)}),this.register(function(t){return new SF(t)}),this.register(function(t){return new MF(t)}),this.register(function(t){return new bF(t)}),this.register(function(t){return new mF(t)}),this.register(function(t){return new gF(t)}),this.register(function(t){return new vF(t)}),this.register(function(t){return new _F(t)}),this.register(function(t){return new fF(t)}),this.register(function(t){return new yF(t)}),this.register(function(t){return new pF(t)}),this.register(function(t){return new AF(t)}),this.register(function(t){return new xF(t)}),this.register(function(t){return new cF(t)}),this.register(function(t){return new EF(t)}),this.register(function(t){return new TF(t)})}load(e,t,n,i){const o=this;let l;if(this.resourcePath!=="")l=this.resourcePath;else if(this.path!==""){const p=yr.extractUrlBase(e);l=yr.resolveURL(p,this.path)}else l=yr.extractUrlBase(e);this.manager.itemStart(e);const h=function(p){i?i(p):console.error(p),o.manager.itemError(e),o.manager.itemEnd(e)},d=new Na(this.manager);d.setPath(this.path),d.setResponseType("arraybuffer"),d.setRequestHeader(this.requestHeader),d.setWithCredentials(this.withCredentials),d.load(e,function(p){try{o.parse(p,l,function(_){t(_),o.manager.itemEnd(e)},h)}catch(_){h(_)}},n,h)}setDRACOLoader(e){return this.dracoLoader=e,this}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,i){let o;const l={},h={},d=new TextDecoder;if(typeof e=="string")o=JSON.parse(e);else if(e instanceof ArrayBuffer)if(d.decode(new Uint8Array(e,0,4))===uC){try{l[Yn.KHR_BINARY_GLTF]=new CF(e)}catch(v){i&&i(v);return}o=JSON.parse(l[Yn.KHR_BINARY_GLTF].content)}else o=JSON.parse(d.decode(e));else o=e;if(o.asset===void 0||o.asset.version[0]<2){i&&i(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const p=new GF(o,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});p.fileLoader.setRequestHeader(this.requestHeader);for(let _=0;_<this.pluginCallbacks.length;_++){const v=this.pluginCallbacks[_](p);v.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),h[v.name]=v,l[v.name]=!0}if(o.extensionsUsed)for(let _=0;_<o.extensionsUsed.length;++_){const v=o.extensionsUsed[_],y=o.extensionsRequired||[];switch(v){case Yn.KHR_MATERIALS_UNLIT:l[v]=new uF;break;case Yn.KHR_DRACO_MESH_COMPRESSION:l[v]=new RF(o,this.dracoLoader);break;case Yn.KHR_TEXTURE_TRANSFORM:l[v]=new wF;break;case Yn.KHR_MESH_QUANTIZATION:l[v]=new BF;break;default:y.indexOf(v)>=0&&h[v]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+v+'".')}}p.setExtensions(l),p.setPlugins(h),p.parse(n,i)}parseAsync(e,t){const n=this;return new Promise(function(i,o){n.parse(e,t,i,o)})}}function lF(){let s={};return{get:function(e){return s[e]},add:function(e,t){s[e]=t},remove:function(e){delete s[e]},removeAll:function(){s={}}}}const Yn={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 cF{constructor(e){this.parser=e,this.name=Yn.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let n=0,i=t.length;n<i;n++){const o=t[n];o.extensions&&o.extensions[this.name]&&o.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,o.extensions[this.name].light)}}_loadLight(e){const t=this.parser,n="light:"+e;let i=t.cache.get(n);if(i)return i;const o=t.json,d=((o.extensions&&o.extensions[this.name]||{}).lights||[])[e];let p;const _=new Rt(16777215);d.color!==void 0&&_.setRGB(d.color[0],d.color[1],d.color[2],Ma);const v=d.range!==void 0?d.range:0;switch(d.type){case"directional":p=new Vv(_),p.target.position.set(0,0,-1),p.add(p.target);break;case"point":p=new zv(_),p.distance=v;break;case"spot":p=new Gv(_),p.distance=v,d.spot=d.spot||{},d.spot.innerConeAngle=d.spot.innerConeAngle!==void 0?d.spot.innerConeAngle:0,d.spot.outerConeAngle=d.spot.outerConeAngle!==void 0?d.spot.outerConeAngle:Math.PI/4,p.angle=d.spot.outerConeAngle,p.penumbra=1-d.spot.innerConeAngle/d.spot.outerConeAngle,p.target.position.set(0,0,-1),p.add(p.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+d.type)}return p.position.set(0,0,0),Jo(p,d),d.intensity!==void 0&&(p.intensity=d.intensity),p.name=t.createUniqueName(d.name||"light_"+e),i=Promise.resolve(p),t.cache.add(n,i),i}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,n=this.parser,o=n.json.nodes[e],h=(o.extensions&&o.extensions[this.name]||{}).light;return h===void 0?null:this._loadLight(h).then(function(d){return n._getNodeRef(t.cache,h,d)})}}class uF{constructor(){this.name=Yn.KHR_MATERIALS_UNLIT}getMaterialType(){return La}extendParams(e,t,n){const i=[];e.color=new Rt(1,1,1),e.opacity=1;const o=t.pbrMetallicRoughness;if(o){if(Array.isArray(o.baseColorFactor)){const l=o.baseColorFactor;e.color.setRGB(l[0],l[1],l[2],Ma),e.opacity=l[3]}o.baseColorTexture!==void 0&&i.push(n.assignTexture(e,"map",o.baseColorTexture,ra))}return Promise.all(i)}}class fF{constructor(e){this.parser=e,this.name=Yn.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const i=this.parser.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=i.extensions[this.name].emissiveStrength;return o!==void 0&&(t.emissiveIntensity=o),Promise.resolve()}}class hF{constructor(e){this.parser=e,this.name=Yn.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:la}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=[],l=i.extensions[this.name];if(l.clearcoatFactor!==void 0&&(t.clearcoat=l.clearcoatFactor),l.clearcoatTexture!==void 0&&o.push(n.assignTexture(t,"clearcoatMap",l.clearcoatTexture)),l.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=l.clearcoatRoughnessFactor),l.clearcoatRoughnessTexture!==void 0&&o.push(n.assignTexture(t,"clearcoatRoughnessMap",l.clearcoatRoughnessTexture)),l.clearcoatNormalTexture!==void 0&&(o.push(n.assignTexture(t,"clearcoatNormalMap",l.clearcoatNormalTexture)),l.clearcoatNormalTexture.scale!==void 0)){const h=l.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new et(h,h)}return Promise.all(o)}}class dF{constructor(e){this.parser=e,this.name=Yn.KHR_MATERIALS_DISPERSION}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:la}extendMaterialParams(e,t){const i=this.parser.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=i.extensions[this.name];return t.dispersion=o.dispersion!==void 0?o.dispersion:0,Promise.resolve()}}class pF{constructor(e){this.parser=e,this.name=Yn.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:la}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=[],l=i.extensions[this.name];return l.iridescenceFactor!==void 0&&(t.iridescence=l.iridescenceFactor),l.iridescenceTexture!==void 0&&o.push(n.assignTexture(t,"iridescenceMap",l.iridescenceTexture)),l.iridescenceIor!==void 0&&(t.iridescenceIOR=l.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),l.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=l.iridescenceThicknessMinimum),l.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=l.iridescenceThicknessMaximum),l.iridescenceThicknessTexture!==void 0&&o.push(n.assignTexture(t,"iridescenceThicknessMap",l.iridescenceThicknessTexture)),Promise.all(o)}}class mF{constructor(e){this.parser=e,this.name=Yn.KHR_MATERIALS_SHEEN}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:la}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=[];t.sheenColor=new Rt(0,0,0),t.sheenRoughness=0,t.sheen=1;const l=i.extensions[this.name];if(l.sheenColorFactor!==void 0){const h=l.sheenColorFactor;t.sheenColor.setRGB(h[0],h[1],h[2],Ma)}return l.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=l.sheenRoughnessFactor),l.sheenColorTexture!==void 0&&o.push(n.assignTexture(t,"sheenColorMap",l.sheenColorTexture,ra)),l.sheenRoughnessTexture!==void 0&&o.push(n.assignTexture(t,"sheenRoughnessMap",l.sheenRoughnessTexture)),Promise.all(o)}}class gF{constructor(e){this.parser=e,this.name=Yn.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:la}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=[],l=i.extensions[this.name];return l.transmissionFactor!==void 0&&(t.transmission=l.transmissionFactor),l.transmissionTexture!==void 0&&o.push(n.assignTexture(t,"transmissionMap",l.transmissionTexture)),Promise.all(o)}}class vF{constructor(e){this.parser=e,this.name=Yn.KHR_MATERIALS_VOLUME}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:la}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=[],l=i.extensions[this.name];t.thickness=l.thicknessFactor!==void 0?l.thicknessFactor:0,l.thicknessTexture!==void 0&&o.push(n.assignTexture(t,"thicknessMap",l.thicknessTexture)),t.attenuationDistance=l.attenuationDistance||1/0;const h=l.attenuationColor||[1,1,1];return t.attenuationColor=new Rt().setRGB(h[0],h[1],h[2],Ma),Promise.all(o)}}class _F{constructor(e){this.parser=e,this.name=Yn.KHR_MATERIALS_IOR}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:la}extendMaterialParams(e,t){const i=this.parser.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=i.extensions[this.name];return t.ior=o.ior!==void 0?o.ior:1.5,Promise.resolve()}}class yF{constructor(e){this.parser=e,this.name=Yn.KHR_MATERIALS_SPECULAR}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:la}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=[],l=i.extensions[this.name];t.specularIntensity=l.specularFactor!==void 0?l.specularFactor:1,l.specularTexture!==void 0&&o.push(n.assignTexture(t,"specularIntensityMap",l.specularTexture));const h=l.specularColorFactor||[1,1,1];return t.specularColor=new Rt().setRGB(h[0],h[1],h[2],Ma),l.specularColorTexture!==void 0&&o.push(n.assignTexture(t,"specularColorMap",l.specularColorTexture,ra)),Promise.all(o)}}class xF{constructor(e){this.parser=e,this.name=Yn.EXT_MATERIALS_BUMP}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:la}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=[],l=i.extensions[this.name];return t.bumpScale=l.bumpFactor!==void 0?l.bumpFactor:1,l.bumpTexture!==void 0&&o.push(n.assignTexture(t,"bumpMap",l.bumpTexture)),Promise.all(o)}}class AF{constructor(e){this.parser=e,this.name=Yn.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:la}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const o=[],l=i.extensions[this.name];return l.anisotropyStrength!==void 0&&(t.anisotropy=l.anisotropyStrength),l.anisotropyRotation!==void 0&&(t.anisotropyRotation=l.anisotropyRotation),l.anisotropyTexture!==void 0&&o.push(n.assignTexture(t,"anisotropyMap",l.anisotropyTexture)),Promise.all(o)}}class SF{constructor(e){this.parser=e,this.name=Yn.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,n=t.json,i=n.textures[e];if(!i.extensions||!i.extensions[this.name])return null;const o=i.extensions[this.name],l=t.options.ktx2Loader;if(!l){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,o.source,l)}}class MF{constructor(e){this.parser=e,this.name=Yn.EXT_TEXTURE_WEBP}loadTexture(e){const t=this.name,n=this.parser,i=n.json,o=i.textures[e];if(!o.extensions||!o.extensions[t])return null;const l=o.extensions[t],h=i.images[l.source];let d=n.textureLoader;if(h.uri){const p=n.options.manager.getHandler(h.uri);p!==null&&(d=p)}return n.loadTextureImage(e,l.source,d)}}class bF{constructor(e){this.parser=e,this.name=Yn.EXT_TEXTURE_AVIF}loadTexture(e){const t=this.name,n=this.parser,i=n.json,o=i.textures[e];if(!o.extensions||!o.extensions[t])return null;const l=o.extensions[t],h=i.images[l.source];let d=n.textureLoader;if(h.uri){const p=n.options.manager.getHandler(h.uri);p!==null&&(d=p)}return n.loadTextureImage(e,l.source,d)}}class EF{constructor(e){this.name=Yn.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){const i=n.extensions[this.name],o=this.parser.getDependency("buffer",i.buffer),l=this.parser.options.meshoptDecoder;if(!l||!l.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 o.then(function(h){const d=i.byteOffset||0,p=i.byteLength||0,_=i.count,v=i.byteStride,y=new Uint8Array(h,d,p);return l.decodeGltfBufferAsync?l.decodeGltfBufferAsync(_,v,y,i.mode,i.filter).then(function(x){return x.buffer}):l.ready.then(function(){const x=new ArrayBuffer(_*v);return l.decodeGltfBuffer(new Uint8Array(x),_,v,y,i.mode,i.filter),x})})}else return null}}class TF{constructor(e){this.name=Yn.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,n=t.nodes[e];if(!n.extensions||!n.extensions[this.name]||n.mesh===void 0)return null;const i=t.meshes[n.mesh];for(const p of i.primitives)if(p.mode!==Gr.TRIANGLES&&p.mode!==Gr.TRIANGLE_STRIP&&p.mode!==Gr.TRIANGLE_FAN&&p.mode!==void 0)return null;const l=n.extensions[this.name].attributes,h=[],d={};for(const p in l)h.push(this.parser.getDependency("accessor",l[p]).then(_=>(d[p]=_,d[p])));return h.length<1?null:(h.push(this.parser.createNodeMesh(e)),Promise.all(h).then(p=>{const _=p.pop(),v=_.isGroup?_.children:[_],y=p[0].count,x=[];for(const b of v){const R=new cn,T=new Z,M=new Ya,w=new Z(1,1,1),D=new sv(b.geometry,b.material,y);for(let L=0;L<y;L++)d.TRANSLATION&&T.fromBufferAttribute(d.TRANSLATION,L),d.ROTATION&&M.fromBufferAttribute(d.ROTATION,L),d.SCALE&&w.fromBufferAttribute(d.SCALE,L),D.setMatrixAt(L,R.compose(T,M,w));for(const L in d)if(L==="_COLOR_0"){const P=d[L];D.instanceColor=new Bc(P.array,P.itemSize,P.normalized)}else L!=="TRANSLATION"&&L!=="ROTATION"&&L!=="SCALE"&&b.geometry.setAttribute(L,d[L]);kn.prototype.copy.call(D,b),this.parser.assignFinalMaterial(D),x.push(D)}return _.isGroup?(_.clear(),_.add(...x),_):x[0]}))}}const uC="glTF",lm=12,fC={JSON:1313821514,BIN:5130562};class CF{constructor(e){this.name=Yn.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,lm),n=new TextDecoder;if(this.header={magic:n.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==uC)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const i=this.header.length-lm,o=new DataView(e,lm);let l=0;for(;l<i;){const h=o.getUint32(l,!0);l+=4;const d=o.getUint32(l,!0);if(l+=4,d===fC.JSON){const p=new Uint8Array(e,lm+l,h);this.content=n.decode(p)}else if(d===fC.BIN){const p=lm+l;this.body=e.slice(p,p+h)}l+=h}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class RF{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=Yn.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const n=this.json,i=this.dracoLoader,o=e.extensions[this.name].bufferView,l=e.extensions[this.name].attributes,h={},d={},p={};for(const _ in l){const v=HS[_]||_.toLowerCase();h[v]=l[_]}for(const _ in e.attributes){const v=HS[_]||_.toLowerCase();if(l[_]!==void 0){const y=n.accessors[e.attributes[_]],x=jh[y.componentType];p[v]=x.name,d[v]=y.normalized===!0}}return t.getDependency("bufferView",o).then(function(_){return new Promise(function(v,y){i.decodeDracoFile(_,function(x){for(const b in x.attributes){const R=x.attributes[b],T=d[b];T!==void 0&&(R.normalized=T)}v(x)},h,p,Ma,y)})})}}class wF{constructor(){this.name=Yn.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return(t.texCoord===void 0||t.texCoord===e.channel)&&t.offset===void 0&&t.rotation===void 0&&t.scale===void 0||(e=e.clone(),t.texCoord!==void 0&&(e.channel=t.texCoord),t.offset!==void 0&&e.offset.fromArray(t.offset),t.rotation!==void 0&&(e.rotation=t.rotation),t.scale!==void 0&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}}class BF{constructor(){this.name=Yn.KHR_MESH_QUANTIZATION}}class hC extends Wu{constructor(e,t,n,i){super(e,t,n,i)}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,o=e*i*3+i;for(let l=0;l!==i;l++)t[l]=n[o+l];return t}interpolate_(e,t,n,i){const o=this.resultBuffer,l=this.sampleValues,h=this.valueSize,d=h*2,p=h*3,_=i-t,v=(n-t)/_,y=v*v,x=y*v,b=e*p,R=b-p,T=-2*x+3*y,M=x-y,w=1-T,D=M-y+v;for(let L=0;L!==h;L++){const P=l[R+L+h],O=l[R+L+d]*_,z=l[b+L+h],V=l[b+L]*_;o[L]=w*P+D*O+T*z+M*V}return o}}const DF=new Ya;class LF extends hC{interpolate_(e,t,n,i){const o=super.interpolate_(e,t,n,i);return DF.fromArray(o).normalize().toArray(o),o}}const Gr={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},jh={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},dC={9728:zi,9729:In,9984:rp,9985:wu,9986:_c,9987:$s},pC={33071:Gi,33648:Ru,10497:oo},FS={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},HS={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Gc={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},NF={CUBICSPLINE:void 0,LINEAR:xc,STEP:Du},PS={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function UF(s){return s.DefaultMaterial===void 0&&(s.DefaultMaterial=new qu({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:ao})),s.DefaultMaterial}function df(s,e,t){for(const n in t.extensions)s[n]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=t.extensions[n])}function Jo(s,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(s.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function OF(s,e,t){let n=!1,i=!1,o=!1;for(let p=0,_=e.length;p<_;p++){const v=e[p];if(v.POSITION!==void 0&&(n=!0),v.NORMAL!==void 0&&(i=!0),v.COLOR_0!==void 0&&(o=!0),n&&i&&o)break}if(!n&&!i&&!o)return Promise.resolve(s);const l=[],h=[],d=[];for(let p=0,_=e.length;p<_;p++){const v=e[p];if(n){const y=v.POSITION!==void 0?t.getDependency("accessor",v.POSITION):s.attributes.position;l.push(y)}if(i){const y=v.NORMAL!==void 0?t.getDependency("accessor",v.NORMAL):s.attributes.normal;h.push(y)}if(o){const y=v.COLOR_0!==void 0?t.getDependency("accessor",v.COLOR_0):s.attributes.color;d.push(y)}}return Promise.all([Promise.all(l),Promise.all(h),Promise.all(d)]).then(function(p){const _=p[0],v=p[1],y=p[2];return n&&(s.morphAttributes.position=_),i&&(s.morphAttributes.normal=v),o&&(s.morphAttributes.color=y),s.morphTargetsRelative=!0,s})}function IF(s,e){if(s.updateMorphTargets(),e.weights!==void 0)for(let t=0,n=e.weights.length;t<n;t++)s.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(s.morphTargetInfluences.length===t.length){s.morphTargetDictionary={};for(let n=0,i=t.length;n<i;n++)s.morphTargetDictionary[t[n]]=n}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function FF(s){let e;const t=s.extensions&&s.extensions[Yn.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+GS(t.attributes):e=s.indices+":"+GS(s.attributes)+":"+s.mode,s.targets!==void 0)for(let n=0,i=s.targets.length;n<i;n++)e+=":"+GS(s.targets[n]);return e}function GS(s){let e="";const t=Object.keys(s).sort();for(let n=0,i=t.length;n<i;n++)e+=t[n]+":"+s[t[n]]+";";return e}function zS(s){switch(s){case Int8Array:return .007874015748031496;case Uint8Array:return .00392156862745098;case Int16Array:return 3051850947599719e-20;case Uint16Array:return 15259021896696422e-21;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function HF(s){return s.search(/\.jpe?g($|\?)/i)>0||s.search(/^data\:image\/jpeg/)===0?"image/jpeg":s.search(/\.webp($|\?)/i)>0||s.search(/^data\:image\/webp/)===0?"image/webp":s.search(/\.ktx2($|\?)/i)>0||s.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const PF=new cn;class GF{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new lF,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 n=!1,i=-1,o=!1,l=-1;if(typeof navigator<"u"){const h=navigator.userAgent;n=/^((?!chrome|android).)*safari/i.test(h)===!0;const d=h.match(/Version\/(\d+)/);i=n&&d?parseInt(d[1],10):-1,o=h.indexOf("Firefox")>-1,l=o?h.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||n&&i<17||o&&l<98?this.textureLoader=new dA(this.options.manager):this.textureLoader=new _A(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new Na(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 n=this,i=this.json,o=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(l){return l._markDefs&&l._markDefs()}),Promise.all(this._invokeAll(function(l){return l.beforeRoot&&l.beforeRoot()})).then(function(){return Promise.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])}).then(function(l){const h={scene:l[0][i.scene||0],scenes:l[0],animations:l[1],cameras:l[2],asset:i.asset,parser:n,userData:{}};return df(o,h,i),Jo(h,i),Promise.all(n._invokeAll(function(d){return d.afterRoot&&d.afterRoot(h)})).then(function(){for(const d of h.scenes)d.updateMatrixWorld();e(h)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let i=0,o=t.length;i<o;i++){const l=t[i].joints;for(let h=0,d=l.length;h<d;h++)e[l[h]].isBone=!0}for(let i=0,o=e.length;i<o;i++){const l=e[i];l.mesh!==void 0&&(this._addNodeRef(this.meshCache,l.mesh),l.skin!==void 0&&(n[l.mesh].isSkinnedMesh=!0)),l.camera!==void 0&&this._addNodeRef(this.cameraCache,l.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,n){if(e.refs[t]<=1)return n;const i=n.clone(),o=(l,h)=>{const d=this.associations.get(l);d!=null&&this.associations.set(h,d);for(const[p,_]of l.children.entries())o(_,h.children[p])};return o(n,i),i.name+="_instance_"+e.uses[t]++,i}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let n=0;n<t.length;n++){const i=e(t[n]);if(i)return i}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const n=[];for(let i=0;i<t.length;i++){const o=e(t[i]);o&&n.push(o)}return n}getDependency(e,t){const n=e+":"+t;let i=this.cache.get(n);if(!i){switch(e){case"scene":i=this.loadScene(t);break;case"node":i=this._invokeOne(function(o){return o.loadNode&&o.loadNode(t)});break;case"mesh":i=this._invokeOne(function(o){return o.loadMesh&&o.loadMesh(t)});break;case"accessor":i=this.loadAccessor(t);break;case"bufferView":i=this._invokeOne(function(o){return o.loadBufferView&&o.loadBufferView(t)});break;case"buffer":i=this.loadBuffer(t);break;case"material":i=this._invokeOne(function(o){return o.loadMaterial&&o.loadMaterial(t)});break;case"texture":i=this._invokeOne(function(o){return o.loadTexture&&o.loadTexture(t)});break;case"skin":i=this.loadSkin(t);break;case"animation":i=this._invokeOne(function(o){return o.loadAnimation&&o.loadAnimation(t)});break;case"camera":i=this.loadCamera(t);break;default:if(i=this._invokeOne(function(o){return o!=this&&o.getDependency&&o.getDependency(e,t)}),!i)throw new Error("Unknown type: "+e);break}this.cache.add(n,i)}return i}getDependencies(e){let t=this.cache.get(e);if(!t){const n=this,i=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(i.map(function(o,l){return n.getDependency(e,l)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],n=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[Yn.KHR_BINARY_GLTF].body);const i=this.options;return new Promise(function(o,l){n.load(yr.resolveURL(t.uri,i.path),o,void 0,function(){l(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(n){const i=t.byteLength||0,o=t.byteOffset||0;return n.slice(o,o+i)})}loadAccessor(e){const t=this,n=this.json,i=this.json.accessors[e];if(i.bufferView===void 0&&i.sparse===void 0){const l=FS[i.type],h=jh[i.componentType],d=i.normalized===!0,p=new h(i.count*l);return Promise.resolve(new Kn(p,l,d))}const o=[];return i.bufferView!==void 0?o.push(this.getDependency("bufferView",i.bufferView)):o.push(null),i.sparse!==void 0&&(o.push(this.getDependency("bufferView",i.sparse.indices.bufferView)),o.push(this.getDependency("bufferView",i.sparse.values.bufferView))),Promise.all(o).then(function(l){const h=l[0],d=FS[i.type],p=jh[i.componentType],_=p.BYTES_PER_ELEMENT,v=_*d,y=i.byteOffset||0,x=i.bufferView!==void 0?n.bufferViews[i.bufferView].byteStride:void 0,b=i.normalized===!0;let R,T;if(x&&x!==v){const M=Math.floor(y/x),w="InterleavedBuffer:"+i.bufferView+":"+i.componentType+":"+M+":"+i.count;let D=t.cache.get(w);D||(R=new p(h,M*x,i.count*x/_),D=new Th(R,x/_),t.cache.add(w,D)),T=new Nl(D,d,y%x/_,b)}else h===null?R=new p(i.count*d):R=new p(h,y,i.count*d),T=new Kn(R,d,b);if(i.sparse!==void 0){const M=FS.SCALAR,w=jh[i.sparse.indices.componentType],D=i.sparse.indices.byteOffset||0,L=i.sparse.values.byteOffset||0,P=new w(l[1],D,i.sparse.count*M),O=new p(l[2],L,i.sparse.count*d);h!==null&&(T=new Kn(T.array.slice(),T.itemSize,T.normalized)),T.normalized=!1;for(let z=0,V=P.length;z<V;z++){const N=P[z];if(T.setX(N,O[z*d]),d>=2&&T.setY(N,O[z*d+1]),d>=3&&T.setZ(N,O[z*d+2]),d>=4&&T.setW(N,O[z*d+3]),d>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}T.normalized=b}return T})}loadTexture(e){const t=this.json,n=this.options,o=t.textures[e].source,l=t.images[o];let h=this.textureLoader;if(l.uri){const d=n.manager.getHandler(l.uri);d!==null&&(h=d)}return this.loadTextureImage(e,o,h)}loadTextureImage(e,t,n){const i=this,o=this.json,l=o.textures[e],h=o.images[t],d=(h.uri||h.bufferView)+":"+l.sampler;if(this.textureCache[d])return this.textureCache[d];const p=this.loadImageSource(t,n).then(function(_){_.flipY=!1,_.name=l.name||h.name||"",_.name===""&&typeof h.uri=="string"&&h.uri.startsWith("data:image/")===!1&&(_.name=h.uri);const y=(o.samplers||{})[l.sampler]||{};return _.magFilter=dC[y.magFilter]||In,_.minFilter=dC[y.minFilter]||$s,_.wrapS=pC[y.wrapS]||oo,_.wrapT=pC[y.wrapT]||oo,_.generateMipmaps=!_.isCompressedTexture&&_.minFilter!==zi&&_.minFilter!==In,i.associations.set(_,{textures:e}),_}).catch(function(){return null});return this.textureCache[d]=p,p}loadImageSource(e,t){const n=this,i=this.json,o=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(v=>v.clone());const l=i.images[e],h=self.URL||self.webkitURL;let d=l.uri||"",p=!1;if(l.bufferView!==void 0)d=n.getDependency("bufferView",l.bufferView).then(function(v){p=!0;const y=new Blob([v],{type:l.mimeType});return d=h.createObjectURL(y),d});else if(l.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const _=Promise.resolve(d).then(function(v){return new Promise(function(y,x){let b=y;t.isImageBitmapLoader===!0&&(b=function(R){const T=new li(R);T.needsUpdate=!0,y(T)}),t.load(yr.resolveURL(v,o.path),b,void 0,x)})}).then(function(v){return p===!0&&h.revokeObjectURL(d),Jo(v,l),v.userData.mimeType=l.mimeType||HF(l.uri),v}).catch(function(v){throw console.error("THREE.GLTFLoader: Couldn't load texture",d),v});return this.sourceCache[e]=_,_}assignTexture(e,t,n,i){const o=this;return this.getDependency("texture",n.index).then(function(l){if(!l)return null;if(n.texCoord!==void 0&&n.texCoord>0&&(l=l.clone(),l.channel=n.texCoord),o.extensions[Yn.KHR_TEXTURE_TRANSFORM]){const h=n.extensions!==void 0?n.extensions[Yn.KHR_TEXTURE_TRANSFORM]:void 0;if(h){const d=o.associations.get(l);l=o.extensions[Yn.KHR_TEXTURE_TRANSFORM].extendTexture(l,h),o.associations.set(l,d)}}return i!==void 0&&(l.colorSpace=i),e[t]=l,l})}assignFinalMaterial(e){const t=e.geometry;let n=e.material;const i=t.attributes.tangent===void 0,o=t.attributes.color!==void 0,l=t.attributes.normal===void 0;if(e.isPoints){const h="PointsMaterial:"+n.uuid;let d=this.cache.get(h);d||(d=new Fp,oa.prototype.copy.call(d,n),d.color.copy(n.color),d.map=n.map,d.sizeAttenuation=!1,this.cache.add(h,d)),n=d}else if(e.isLine){const h="LineBasicMaterial:"+n.uuid;let d=this.cache.get(h);d||(d=new ss,oa.prototype.copy.call(d,n),d.color.copy(n.color),d.map=n.map,this.cache.add(h,d)),n=d}if(i||o||l){let h="ClonedMaterial:"+n.uuid+":";i&&(h+="derivative-tangents:"),o&&(h+="vertex-colors:"),l&&(h+="flat-shading:");let d=this.cache.get(h);d||(d=n.clone(),o&&(d.vertexColors=!0),l&&(d.flatShading=!0),i&&(d.normalScale&&(d.normalScale.y*=-1),d.clearcoatNormalScale&&(d.clearcoatNormalScale.y*=-1)),this.cache.add(h,d),this.associations.set(d,this.associations.get(n))),n=d}e.material=n}getMaterialType(){return qu}loadMaterial(e){const t=this,n=this.json,i=this.extensions,o=n.materials[e];let l;const h={},d=o.extensions||{},p=[];if(d[Yn.KHR_MATERIALS_UNLIT]){const v=i[Yn.KHR_MATERIALS_UNLIT];l=v.getMaterialType(),p.push(v.extendParams(h,o,t))}else{const v=o.pbrMetallicRoughness||{};if(h.color=new Rt(1,1,1),h.opacity=1,Array.isArray(v.baseColorFactor)){const y=v.baseColorFactor;h.color.setRGB(y[0],y[1],y[2],Ma),h.opacity=y[3]}v.baseColorTexture!==void 0&&p.push(t.assignTexture(h,"map",v.baseColorTexture,ra)),h.metalness=v.metallicFactor!==void 0?v.metallicFactor:1,h.roughness=v.roughnessFactor!==void 0?v.roughnessFactor:1,v.metallicRoughnessTexture!==void 0&&(p.push(t.assignTexture(h,"metalnessMap",v.metallicRoughnessTexture)),p.push(t.assignTexture(h,"roughnessMap",v.metallicRoughnessTexture))),l=this._invokeOne(function(y){return y.getMaterialType&&y.getMaterialType(e)}),p.push(Promise.all(this._invokeAll(function(y){return y.extendMaterialParams&&y.extendMaterialParams(e,h)})))}o.doubleSided===!0&&(h.side=hr);const _=o.alphaMode||PS.OPAQUE;if(_===PS.BLEND?(h.transparent=!0,h.depthWrite=!1):(h.transparent=!1,_===PS.MASK&&(h.alphaTest=o.alphaCutoff!==void 0?o.alphaCutoff:.5)),o.normalTexture!==void 0&&l!==La&&(p.push(t.assignTexture(h,"normalMap",o.normalTexture)),h.normalScale=new et(1,1),o.normalTexture.scale!==void 0)){const v=o.normalTexture.scale;h.normalScale.set(v,v)}if(o.occlusionTexture!==void 0&&l!==La&&(p.push(t.assignTexture(h,"aoMap",o.occlusionTexture)),o.occlusionTexture.strength!==void 0&&(h.aoMapIntensity=o.occlusionTexture.strength)),o.emissiveFactor!==void 0&&l!==La){const v=o.emissiveFactor;h.emissive=new Rt().setRGB(v[0],v[1],v[2],Ma)}return o.emissiveTexture!==void 0&&l!==La&&p.push(t.assignTexture(h,"emissiveMap",o.emissiveTexture,ra)),Promise.all(p).then(function(){const v=new l(h);return o.name&&(v.name=o.name),Jo(v,o),t.associations.set(v,{materials:e}),o.extensions&&df(i,v,o),v})}createUniqueName(e){const t=$n.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,n=this.extensions,i=this.primitiveCache;function o(h){return n[Yn.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(h,t).then(function(d){return mC(d,h,t)})}const l=[];for(let h=0,d=e.length;h<d;h++){const p=e[h],_=FF(p),v=i[_];if(v)l.push(v.promise);else{let y;p.extensions&&p.extensions[Yn.KHR_DRACO_MESH_COMPRESSION]?y=o(p):y=mC(new yn,p,t),i[_]={primitive:p,promise:y},l.push(y)}}return Promise.all(l)}loadMesh(e){const t=this,n=this.json,i=this.extensions,o=n.meshes[e],l=o.primitives,h=[];for(let d=0,p=l.length;d<p;d++){const _=l[d].material===void 0?UF(this.cache):this.getDependency("material",l[d].material);h.push(_)}return h.push(t.loadGeometries(l)),Promise.all(h).then(function(d){const p=d.slice(0,d.length-1),_=d[d.length-1],v=[];for(let x=0,b=_.length;x<b;x++){const R=_[x],T=l[x];let M;const w=p[x];if(T.mode===Gr.TRIANGLES||T.mode===Gr.TRIANGLE_STRIP||T.mode===Gr.TRIANGLE_FAN||T.mode===void 0)M=o.isSkinnedMesh===!0?new iv(R,w):new Oi(R,w),M.isSkinnedMesh===!0&&M.normalizeSkinWeights(),T.mode===Gr.TRIANGLE_STRIP?M.geometry=cC(M.geometry,gp):T.mode===Gr.TRIANGLE_FAN&&(M.geometry=cC(M.geometry,Uu));else if(T.mode===Gr.LINES)M=new Ir(R,w);else if(T.mode===Gr.LINE_STRIP)M=new Vo(R,w);else if(T.mode===Gr.LINE_LOOP)M=new pv(R,w);else if(T.mode===Gr.POINTS)M=new vv(R,w);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+T.mode);Object.keys(M.geometry.morphAttributes).length>0&&IF(M,o),M.name=t.createUniqueName(o.name||"mesh_"+e),Jo(M,o),T.extensions&&df(i,M,T),t.assignFinalMaterial(M),v.push(M)}for(let x=0,b=v.length;x<b;x++)t.associations.set(v[x],{meshes:e,primitives:x});if(v.length===1)return o.extensions&&df(i,v[0],o),v[0];const y=new Ur;o.extensions&&df(i,y,o),t.associations.set(y,{meshes:e});for(let x=0,b=v.length;x<b;x++)y.add(v[x]);return y})}loadCamera(e){let t;const n=this.json.cameras[e],i=n[n.type];if(!i){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return n.type==="perspective"?t=new Ea(R0.radToDeg(i.yfov),i.aspectRatio||1,i.znear||1,i.zfar||2e6):n.type==="orthographic"&&(t=new Hl(-i.xmag,i.xmag,i.ymag,-i.ymag,i.znear,i.zfar)),n.name&&(t.name=this.createUniqueName(n.name)),Jo(t,n),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],n=[];for(let i=0,o=t.joints.length;i<o;i++)n.push(this._loadNodeShallow(t.joints[i]));return t.inverseBindMatrices!==void 0?n.push(this.getDependency("accessor",t.inverseBindMatrices)):n.push(null),Promise.all(n).then(function(i){const o=i.pop(),l=i,h=[],d=[];for(let p=0,_=l.length;p<_;p++){const v=l[p];if(v){h.push(v);const y=new cn;o!==null&&y.fromArray(o.array,p*16),d.push(y)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[p])}return new Dh(h,d)})}loadAnimation(e){const t=this.json,n=this,i=t.animations[e],o=i.name?i.name:"animation_"+e,l=[],h=[],d=[],p=[],_=[];for(let v=0,y=i.channels.length;v<y;v++){const x=i.channels[v],b=i.samplers[x.sampler],R=x.target,T=R.node,M=i.parameters!==void 0?i.parameters[b.input]:b.input,w=i.parameters!==void 0?i.parameters[b.output]:b.output;R.node!==void 0&&(l.push(this.getDependency("node",T)),h.push(this.getDependency("accessor",M)),d.push(this.getDependency("accessor",w)),p.push(b),_.push(R))}return Promise.all([Promise.all(l),Promise.all(h),Promise.all(d),Promise.all(p),Promise.all(_)]).then(function(v){const y=v[0],x=v[1],b=v[2],R=v[3],T=v[4],M=[];for(let D=0,L=y.length;D<L;D++){const P=y[D],O=x[D],z=b[D],V=R[D],N=T[D];if(P===void 0)continue;P.updateMatrix&&P.updateMatrix();const F=n._createAnimationTracks(P,O,z,V,N);if(F)for(let K=0;K<F.length;K++)M.push(F[K])}const w=new Qu(o,void 0,M);return Jo(w,i),w})}createNodeMesh(e){const t=this.json,n=this,i=t.nodes[e];return i.mesh===void 0?null:n.getDependency("mesh",i.mesh).then(function(o){const l=n._getNodeRef(n.meshCache,i.mesh,o);return i.weights!==void 0&&l.traverse(function(h){if(h.isMesh)for(let d=0,p=i.weights.length;d<p;d++)h.morphTargetInfluences[d]=i.weights[d]}),l})}loadNode(e){const t=this.json,n=this,i=t.nodes[e],o=n._loadNodeShallow(e),l=[],h=i.children||[];for(let p=0,_=h.length;p<_;p++)l.push(n.getDependency("node",h[p]));const d=i.skin===void 0?Promise.resolve(null):n.getDependency("skin",i.skin);return Promise.all([o,Promise.all(l),d]).then(function(p){const _=p[0],v=p[1],y=p[2];y!==null&&_.traverse(function(x){x.isSkinnedMesh&&x.bind(y,PF)});for(let x=0,b=v.length;x<b;x++)_.add(v[x]);return _})}_loadNodeShallow(e){const t=this.json,n=this.extensions,i=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const o=t.nodes[e],l=o.name?i.createUniqueName(o.name):"",h=[],d=i._invokeOne(function(p){return p.createNodeMesh&&p.createNodeMesh(e)});return d&&h.push(d),o.camera!==void 0&&h.push(i.getDependency("camera",o.camera).then(function(p){return i._getNodeRef(i.cameraCache,o.camera,p)})),i._invokeAll(function(p){return p.createNodeAttachment&&p.createNodeAttachment(e)}).forEach(function(p){h.push(p)}),this.nodeCache[e]=Promise.all(h).then(function(p){let _;if(o.isBone===!0?_=new Lp:p.length>1?_=new Ur:p.length===1?_=p[0]:_=new kn,_!==p[0])for(let v=0,y=p.length;v<y;v++)_.add(p[v]);if(o.name&&(_.userData.name=o.name,_.name=l),Jo(_,o),o.extensions&&df(n,_,o),o.matrix!==void 0){const v=new cn;v.fromArray(o.matrix),_.applyMatrix4(v)}else o.translation!==void 0&&_.position.fromArray(o.translation),o.rotation!==void 0&&_.quaternion.fromArray(o.rotation),o.scale!==void 0&&_.scale.fromArray(o.scale);if(!i.associations.has(_))i.associations.set(_,{});else if(o.mesh!==void 0&&i.meshCache.refs[o.mesh]>1){const v=i.associations.get(_);i.associations.set(_,{...v})}return i.associations.get(_).nodes=e,_}),this.nodeCache[e]}loadScene(e){const t=this.extensions,n=this.json.scenes[e],i=this,o=new Ur;n.name&&(o.name=i.createUniqueName(n.name)),Jo(o,n),n.extensions&&df(t,o,n);const l=n.nodes||[],h=[];for(let d=0,p=l.length;d<p;d++)h.push(i.getDependency("node",l[d]));return Promise.all(h).then(function(d){for(let _=0,v=d.length;_<v;_++)o.add(d[_]);const p=_=>{const v=new Map;for(const[y,x]of i.associations)(y instanceof oa||y instanceof li)&&v.set(y,x);return _.traverse(y=>{const x=i.associations.get(y);x!=null&&v.set(y,x)}),v};return i.associations=p(o),o})}_createAnimationTracks(e,t,n,i,o){const l=[],h=e.name?e.name:e.uuid,d=[];Gc[o.path]===Gc.weights?e.traverse(function(y){y.morphTargetInfluences&&d.push(y.name?y.name:y.uuid)}):d.push(h);let p;switch(Gc[o.path]){case Gc.weights:p=Ul;break;case Gc.rotation:p=Ol;break;case Gc.translation:case Gc.scale:p=Il;break;default:n.itemSize===1?p=Ul:p=Il;break}const _=i.interpolation!==void 0?NF[i.interpolation]:xc,v=this._getArrayFromAccessor(n);for(let y=0,x=d.length;y<x;y++){const b=new p(d[y]+"."+Gc[o.path],t.array,v,_);i.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(b),l.push(b)}return l}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const n=zS(t.constructor),i=new Float32Array(t.length);for(let o=0,l=t.length;o<l;o++)i[o]=t[o]*n;t=i}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(n){const i=this instanceof Ol?LF:hC;return new i(this.times,this.values,this.getValueSize()/3,n)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function zF(s,e,t){const n=e.attributes,i=new Ja;if(n.POSITION!==void 0){const h=t.json.accessors[n.POSITION],d=h.min,p=h.max;if(d!==void 0&&p!==void 0){if(i.set(new Z(d[0],d[1],d[2]),new Z(p[0],p[1],p[2])),h.normalized){const _=zS(jh[h.componentType]);i.min.multiplyScalar(_),i.max.multiplyScalar(_)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const o=e.targets;if(o!==void 0){const h=new Z,d=new Z;for(let p=0,_=o.length;p<_;p++){const v=o[p];if(v.POSITION!==void 0){const y=t.json.accessors[v.POSITION],x=y.min,b=y.max;if(x!==void 0&&b!==void 0){if(d.setX(Math.max(Math.abs(x[0]),Math.abs(b[0]))),d.setY(Math.max(Math.abs(x[1]),Math.abs(b[1]))),d.setZ(Math.max(Math.abs(x[2]),Math.abs(b[2]))),y.normalized){const R=zS(jh[y.componentType]);d.multiplyScalar(R)}h.max(d)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}i.expandByVector(h)}s.boundingBox=i;const l=new Da;i.getCenter(l.center),l.radius=i.min.distanceTo(i.max)/2,s.boundingSphere=l}function mC(s,e,t){const n=e.attributes,i=[];function o(l,h){return t.getDependency("accessor",l).then(function(d){s.setAttribute(h,d)})}for(const l in n){const h=HS[l]||l.toLowerCase();h in s.attributes||i.push(o(n[l],h))}if(e.indices!==void 0&&!s.index){const l=t.getDependency("accessor",e.indices).then(function(h){s.setIndex(h)});i.push(l)}return Hn.workingColorSpace!==Ma&&"COLOR_0"in n&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${Hn.workingColorSpace}" not supported.`),Jo(s,e),zF(s,e,t),Promise.all(i).then(function(){return e.targets!==void 0?OF(s,e.targets,t):s})}const Zh="https://ai.streamoji.com",ua=(...s)=>{},gC=({analyser:s})=>{const e=ge.useRef(null),t=ge.useRef(null);return ge.useEffect(()=>{const n=e.current;if(!n)return;const i=n.getContext("2d",{alpha:!0});if(!i)return;let o,l=null;s&&(s.fftSize=128,l=new Uint8Array(s.frequencyBinCount));const h=()=>{o=requestAnimationFrame(h),(n.width!==n.offsetWidth||n.height!==n.offsetHeight)&&(n.width=n.offsetWidth,n.height=n.offsetHeight);const d=n.width,p=n.height;if(d===0||p===0)return;const _=p/2;i.clearRect(0,0,d,p),i.fillStyle="#1e293b";const v=2,x=v+2,b=d*.95,R=Math.floor(b/x);(!t.current||t.current.length!==R)&&(t.current=new Float32Array(R).fill(2));const T=R*x,M=(d-T)/2;s&&l&&s.getByteFrequencyData(l);const w=l?l.length:0,L=Math.floor(w*.7)/R,P=new Float32Array(R);for(let O=0;O<R;O++){let z=0;if(l&&L>0){const F=Math.floor(O*L),K=Math.floor((O+1)*L);for(let ne=F;ne<K;ne++){const ee=l[ne]||0;ee>z&&(z=ee)}}z<10&&(z=0);const V=z/255,N=z>0?Math.max(2,Math.pow(V,1.4)*p*.25):2;P[O]=N}for(let O=0;O<R;O++){const z=R-1-O,V=Math.max(P[O],P[z]),N=t.current[O]+(V-t.current[O])*.3;t.current[O]=N;const F=M+O*x,K=_-N/2;i.beginPath(),i.roundRect?i.roundRect(F,K,v,N,4):i.fillRect(F,K,v,N),i.fill()}};return h(),()=>{cancelAnimationFrame(o)}},[s]),Jt.jsx("canvas",{ref:e,style:{width:"100%",height:"100%",display:"block"}})},VF="https://pub-48df6f7d60d6440bbd01676ea5d90e55.r2.dev",vC="https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/default-models/avatar-blue-suit.glb";function kF(s){const[e,t]=ge.useState(null);return ge.useEffect(()=>{if(!s){t(null);return}let n=!1;const i=`${VF}/${s}.glb`;return fetch(i,{method:"HEAD"}).then(o=>{n||t(o.ok?i:vC)}).catch(()=>{n||t(vC)}),()=>{n=!0}},[s]),e}const XF=["https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/idle/M_Standing_Idle_Variations_001.glb","https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/idle/M_Standing_Idle_Variations_002.glb","https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/idle/M_Standing_Idle_002.glb","https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/idle/M_Standing_Idle_Variations_005.glb"],YF=["https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/idle/F_Standing_Idle_Variations_001.glb","https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/idle/F_Standing_Idle_Variations_003.glb","https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/idle/F_Standing_Idle_Variations_003.glb"],JF=[{id:"m_expr_01",name:"Friendly Wave",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_001.glb"},{id:"m_expr_02",name:"You There",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_002.glb"},{id:"m_expr_04",name:"Awkward Agreement",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_004.glb"},{id:"m_expr_05",name:"What's Going On?",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_005.glb"},{id:"m_expr_06",name:"Tired Stretch",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_006.glb"},{id:"m_expr_07",name:"Conceilied Laughter",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_007.glb"},{id:"m_expr_08",name:"You Come Here",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_008.glb"},{id:"m_expr_09",name:"Come Here Kid",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_009.glb"},{id:"m_expr_10",name:"Come Here Everyone",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_010.glb"},{id:"m_expr_11",name:"No Freaking Way",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_011.glb"},{id:"m_expr_12",name:"Cheerful Approval",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_012.glb"},{id:"m_expr_13",name:"Waving Hello",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_013.glb"},{id:"m_expr_14",name:"Checking Surroundings",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_014.glb"},{id:"m_expr_15",name:"Referee Warning",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_015.glb"},{id:"m_expr_16",name:"You Thumbs Down",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_016.glb"},{id:"m_expr_17",name:"Side Thumbs Down",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_017.glb"},{id:"m_expr_18",name:"You're Finished",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Standing_Expressions_018.glb"},{id:"m_talk_01",name:"Oh God, Why Me?",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_001.glb"},{id:"m_talk_02",name:"What Are You Doing?",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_002.glb"},{id:"m_talk_03",name:"What Am I doing?",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_003.glb"},{id:"m_talk_04",name:"No Way",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_004.glb"},{id:"m_talk_05",name:"What's Going On?",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_005.glb"},{id:"m_talk_06",name:"I have no idea",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_006.glb"},{id:"m_talk_07",name:"What's going on here?",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_007.glb"},{id:"m_talk_08",name:"Let's stop",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_008.glb"},{id:"m_talk_09",name:"Fed Up Moment",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_009.glb"},{id:"m_talk_10",name:"What's This? Hold On",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_010.glb"},{id:"f_talk_01",name:"Great Job Clap",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/F_Talking_Variations_001.glb"},{id:"f_talk_02",name:"Chill Stretch",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/F_Talking_Variations_002.glb"},{id:"f_talk_03",name:"This Is Me",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/F_Talking_Variations_003.glb"},{id:"f_talk_04",name:"Empathize",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/F_Talking_Variations_004.glb"},{id:"f_talk_05",name:"Loose Hands Stretch",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/F_Talking_Variations_005.glb"},{id:"f_talk_06",name:"Take It Easy",url:"https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/F_Talking_Variations_006.glb"}],qF=["https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_005.glb","https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_007.glb","https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/M_Talking_Variations_006.glb"],KF=["https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/F_Talking_Variations_004.glb","https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/F_Talking_Variations_005.glb","https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/F_Talking_Variations_006.glb","https://pub-be53cae7bd99457a8c1f11b4d38f1672.r2.dev/masculine/expression/F_Talking_Variations_002.glb"],WF={zoom:.85,position:[.15,-.8,0],scale:1.5,rotation:[.15,.02,0]},jF=[-.45,1.9,.1],ZF=[-.45,1.75,.1],QF={browInnerUp:.2},VS=.18,$F=1,e4=.5,_C=3,__=.55,kS=.12,yC=2,xC=2,y_=4,AC=8,t4=1,SC=.38,MC=.32,bC="__branding__",x_={neutral:{eyeLookDownLeft:.1,eyeLookDownRight:.1},happy:{mouthSmileLeft:.2,mouthSmileRight:.2,eyeLookDownLeft:.1,eyeLookDownRight:.1},sad:{eyeLookDownLeft:.2,eyeLookDownRight:.2,browDownRight:.1,browInnerUp:.6,browOuterUpRight:.2,eyeSquintLeft:.7,eyeSquintRight:.7,mouthFrownLeft:.8,mouthFrownRight:.8,mouthLeft:.2,mouthPucker:.5,mouthRollLower:.2,mouthRollUpper:.2,mouthShrugLower:.2,mouthShrugUpper:.2,mouthStretchLeft:.4},angry:{eyeLookDownLeft:.1,eyeLookDownRight:.1,browDownLeft:.6,browDownRight:.6,jawForward:.3,mouthFrownLeft:.7,mouthFrownRight:.7,mouthRollLower:.2,mouthShrugLower:.3},fear:{browInnerUp:.7,eyeSquintLeft:.5,eyeSquintRight:.5,eyeWideLeft:.6,eyeWideRight:.6,mouthClose:.1,mouthFunnel:.3,mouthShrugLower:.5,mouthShrugUpper:.5},disgust:{browDownLeft:.7,browDownRight:.1,browInnerUp:.3,eyeSquintLeft:1,eyeSquintRight:1,eyeWideLeft:.5,eyeWideRight:.5,mouthLeft:.4,mouthPressLeft:.3,mouthRollLower:.3,mouthShrugLower:.3,mouthShrugUpper:.8,mouthUpperUpLeft:.3,noseSneerLeft:1,noseSneerRight:.7},love:{browInnerUp:.4,browOuterUpLeft:.2,browOuterUpRight:.2,mouthSmileLeft:.2,mouthSmileRight:.2,eyeBlinkLeft:.6,eyeBlinkRight:.6,eyeWideLeft:.7,eyeWideRight:.7,mouthDimpleLeft:.1,mouthDimpleRight:.1,mouthPressLeft:.2,mouthShrugUpper:.2,mouthUpperUpLeft:.1,mouthUpperUpRight:.1}},EC=[{key:"viseme_aa",mix:{jawOpen:.6},teethMix:{jawOpen:.6}},{key:"viseme_E",mix:{mouthPressLeft:.8,mouthPressRight:.8,mouthDimpleLeft:1,mouthDimpleRight:1,jawOpen:.3},teethMix:{mouthPressLeft:.8,mouthPressRight:.8,mouthDimpleLeft:1,mouthDimpleRight:1,jawOpen:.3}},{key:"viseme_I",mix:{mouthPressLeft:.6,mouthPressRight:.6,mouthDimpleLeft:.6,mouthDimpleRight:.6,jawOpen:.2},teethMix:{mouthPressLeft:.6,mouthPressRight:.6,mouthDimpleLeft:.6,mouthDimpleRight:.6,jawOpen:.2}},{key:"viseme_O",mix:{mouthPucker:1,jawForward:.6,jawOpen:.2},teethMix:{mouthPucker:1,jawForward:.6,jawOpen:.2}},{key:"viseme_U",mix:{mouthFunnel:1},teethMix:{mouthFunnel:1}},{key:"viseme_PP",mix:{mouthRollLower:.8,mouthRollUpper:.4,mouthUpperUpLeft:.3,mouthUpperUpRight:.3},teethMix:{mouthRollLower:.8,mouthRollUpper:.4,mouthUpperUpLeft:.3,mouthUpperUpRight:.3}},{key:"viseme_FF",mix:{mouthPucker:1,mouthShrugUpper:1,mouthLowerDownLeft:.2,mouthLowerDownRight:.2,mouthDimpleLeft:1,mouthDimpleRight:1,mouthRollLower:1},teethMix:{mouthPucker:1,mouthShrugUpper:1,mouthLowerDownLeft:.2,mouthLowerDownRight:.2,mouthDimpleLeft:1,mouthDimpleRight:1,mouthRollLower:1}},{key:"viseme_DD",mix:{mouthPressLeft:.8,mouthPressRight:.8,mouthFunnel:.5,jawOpen:.2},teethMix:{mouthPressLeft:.8,mouthPressRight:.8,mouthFunnel:.5,jawOpen:.2}},{key:"viseme_SS",mix:{mouthPressLeft:.8,mouthPressRight:.8,mouthLowerDownLeft:.5,mouthLowerDownRight:.5,jawOpen:.1},teethMix:{mouthPressLeft:.8,mouthPressRight:.8,mouthLowerDownLeft:.5,mouthLowerDownRight:.5,jawOpen:.1}},{key:"viseme_TH",mix:{mouthRollUpper:.6,jawOpen:.2,tongueOut:.4},teethMix:{mouthRollUpper:.6,jawOpen:.2,tongueOut:.4}},{key:"viseme_CH",mix:{mouthPucker:.5,jawOpen:.2},teethMix:{mouthPucker:.5,jawOpen:.2}},{key:"viseme_RR",mix:{mouthPucker:.5,jawOpen:.2},teethMix:{mouthPucker:.5,jawOpen:.2}},{key:"viseme_kk",mix:{mouthLowerDownLeft:.4,mouthLowerDownRight:.4,mouthDimpleLeft:.3,mouthDimpleRight:.3,mouthFunnel:.3,mouthPucker:.3,jawOpen:.15},teethMix:{mouthLowerDownLeft:.4,mouthLowerDownRight:.4,mouthDimpleLeft:.3,mouthDimpleRight:.3,mouthFunnel:.3,mouthPucker:.3,jawOpen:.15}},{key:"viseme_nn",mix:{mouthLowerDownLeft:.4,mouthLowerDownRight:.4,mouthDimpleLeft:.3,mouthDimpleRight:.3,mouthFunnel:.3,mouthPucker:.3,jawOpen:.15,tongueOut:.2},teethMix:{mouthLowerDownLeft:.4,mouthLowerDownRight:.4,mouthDimpleLeft:.3,mouthDimpleRight:.3,mouthFunnel:.3,mouthPucker:.3,jawOpen:.15,tongueOut:.2}},{key:"viseme_sil",mix:{}}],n4={aei:[{v:"aa",w:.5},{v:"E",w:.3},{v:"I",w:.2}],o:[{v:"O",w:.7},{v:"U",w:.3}],ee:[{v:"I",w:1}],bmp:[{v:"PP",w:1}],fv:[{v:"FF",w:1}],l:[{v:"nn",w:1}],r:[{v:"RR",w:1}],th:[{v:"TH",w:1}],qw:[{v:"U",w:.6},{v:"O",w:.4}],cdgknstxyz:[{v:"DD",w:.4},{v:"SS",w:.3},{v:"kk",w:.2},{v:"CH",w:.1}]},XS=new Set(EC.flatMap(s=>[...Object.keys(s.mix),...s.teethMix?Object.keys(s.teethMix):[]]));function TC(s){const e=Math.max(0,Math.min(1,s));return e*e*(3-2*e)}function i4(s,e,t){if(t<=0)return 0;const n=(s-e)/t;return n<0||n>1?0:n<.15?TC(n/.15):n>.85?TC((1-n)/.15):1}function a4(s){if(!s)return[{v:"sil",w:1}];const e=s.toLowerCase();return n4[e]??[{v:"sil",w:1}]}function s4({target:s}){const{camera:e}=kh();return ge.useEffect(()=>{e.lookAt(...s)},[e,s]),null}function dn(s,e,t){if(!s||!s.morphTargetDictionary)return;const n=s,i=n.morphTargetDictionary,o=n.morphTargetInfluences;if(o)for(const l in i)l.toLowerCase()===e.toLowerCase()&&(o[i[l]]=t)}const r4=ge.memo(({avatarUrl:s,isPlayingRef:e,visemeQueueRef:t,audioContextRef:n,responseAudioStartTimeRef:i,adjustments:o,mood:l,expression:h,agentResponse:d,isSpeaking:p,nextStartTimeRef:_,stopPlayback:v,setIsSpeaking:y,expressionUrl:x,onExpressionFinished:b,isNudgeResponse:R,avatarGender:T})=>{const{scene:M}=Kh(s),D=Kh(T==="female"?YF:XF),L=ge.useMemo(()=>D.flatMap(It=>It.animations),[D]),O=Kh(T==="female"?KF:qF),z=ge.useMemo(()=>O.flatMap(It=>It.animations),[O]),V=ge.useRef(null),N=ge.useRef(null),F=ge.useRef(null),K=ge.useRef(null),ne=ge.useRef(null),ee=ge.useRef(null),ie=ge.useRef([]),[he]=ge.useState(()=>new lE(M)),H=ge.useRef({}),Y=ge.useRef(null),$=ge.useRef(0),ye=ge.useRef(!1),_e=ge.useRef(0),W=ge.useRef(!1),ae=ge.useRef(null),Me=ge.useRef(_C),Ne=ge.useRef(-1),it=ge.useRef("left"),ve=ge.useRef(y_+Math.random()*(AC-y_)),Ce=ge.useRef(0),tt=ge.useRef("smile"),Et=ge.useRef({});ge.useEffect(()=>{if(!(!L||!M)){if(L.forEach((It,mt)=>{const me=`idle_${mt}`;if(!H.current[me]){const Le=he.clipAction(It,M);Le.name=me,Le.setLoop(pp,1),Le.clampWhenFinished=!0,H.current[me]=Le}}),z.forEach((It,mt)=>{const me=`talk_${mt}`;if(!H.current[me]){const Le=he.clipAction(It,M);Le.name=me,Le.setLoop(pp,1),Le.clampWhenFinished=!0,H.current[me]=Le}}),L.length>0){const It=H.current.idle_0,mt=Y.current&&he.existingAction(Y.current.getClip());It&&!mt&&(It.reset().fadeIn(.5).play(),Y.current=It)}return()=>{he.stopAllAction(),H.current={},Y.current=null}}},[L,z,M,he]);const wt=ge.useRef("");ge.useEffect(()=>{if(!x||!M||x===wt.current)return;wt.current=x,ae.current=x,new oF().load(x,mt=>{if(mt.animations&&mt.animations.length>0){const me=mt.animations[0],Le=he.clipAction(me,M);if(Le.name=`EXPR_${x}`,Le.setLoop(pp,1),Le.clampWhenFinished=!0,H.current[`EXPR_${x}`]=Le,p&&ae.current===x){const Ue=Y.current;Le.reset().fadeIn(.3).play(),Ue&&Ue!==Le&&Ue.crossFadeTo(Le,.3,!0),Y.current=Le,ae.current=null}}},void 0,mt=>{console.error(`[ANIMATION] Failed to load ${x}`,mt)})},[x,M,he,p]),ge.useEffect(()=>{const It=mt=>{const me=mt.action,Le=me.name||"";if(Le.startsWith("idle_")){const rt=(parseInt(Le.split("_")[1])+1)%L.length,Q=H.current[`idle_${rt}`];Q&&(Q.reset().fadeIn(.5).play(),me.crossFadeTo(Q,.5,!0),Y.current=Q)}else if(Le.startsWith("EXPR_")){if(p){const Ue=Math.floor(Math.random()*z.length),rt=H.current[`talk_${Ue}`];rt&&(rt.reset().fadeIn(.5).play(),me.crossFadeTo(rt,.5,!0),Y.current=rt)}else{const Ue=H.current.idle_0;Ue&&(Ue.reset().fadeIn(.5).play(),me.crossFadeTo(Ue,.5,!0),Y.current=Ue)}b&&b()}else if(Le.startsWith("talk_"))if(p&&!R){const rt=(parseInt(Le.split("_")[1])+1)%z.length,Q=H.current[`talk_${rt}`];Q&&(Q.reset().fadeIn(.3).play(),me.crossFadeTo(Q,.3,!0),Y.current=Q)}else{const Ue=H.current.idle_0;Ue&&(Ue.reset().fadeIn(.5).play(),me.crossFadeTo(Ue,.5,!0),Y.current=Ue)}};return he.addEventListener("finished",It),()=>he.removeEventListener("finished",It)},[he,L,z,p,R,b]),ge.useEffect(()=>{if(p&&M){const It=Y.current,mt=It?.name||"";if(mt.startsWith("idle_")||mt.startsWith("talk_")||mt===""){const me=ae.current;if(me){const Le=H.current[`EXPR_${me}`];if(Le){Le.reset().fadeIn(.3).play(),It&&It!==Le&&It.crossFadeTo(Le,.3,!0),Y.current=Le,ae.current=null;return}}if(mt.startsWith("idle_")||mt===""){const Le=Math.floor(Math.random()*z.length),Ue=H.current[`talk_${Le}`];Ue&&(Ue.reset().fadeIn(.5).play(),It&&It.crossFadeTo(Ue,.5,!0),Y.current=Ue)}}}else if(!p&&M){const It=Y.current,mt=It?.name||"";if(mt.startsWith("talk_")||mt.startsWith("EXPR_")){const me=H.current.idle_0;me&&(me.reset().fadeIn(.5).play(),It&&It.crossFadeTo(me,.5,!0),Y.current=me)}}},[p,M,x]),ge.useEffect(()=>{if(!M)return;M.traverse(me=>{if(me.isMesh&&me.morphTargetDictionary){const Le=me.name.toLowerCase();(Le.includes("head")||Le.includes("avatar"))&&(N.current=me,ua(`[ANIMATION] Found head mesh: ${me.name}`)),Le.includes("teeth")&&(F.current=me,ua(`[ANIMATION] Found teeth mesh: ${me.name}`)),Le.includes("beard")&&(K.current=me,ua(`[ANIMATION] Found beard mesh: ${me.name}`)),Le.includes("eyeleft")&&(ne.current=me,ua(`[ANIMATION] Found eye left mesh: ${me.name}`)),Le.includes("eyeright")&&(ee.current=me,ua(`[ANIMATION] Found eye right mesh: ${me.name}`))}});const It=N.current?.morphTargetDictionary;It&&Object.keys(It).filter(me=>me.toLowerCase().includes("brow"));const mt=[];M.traverse(me=>{if(me.isMesh){const Ue=me.morphTargetDictionary;Ue&&Object.keys(Ue).some(rt=>rt.toLowerCase().includes("brow"))&&mt.push(me)}}),ie.current=mt,mt.length>0&&ua("[ANIMATION] Meshes with brow morphs:",mt.length)},[M]);const on=It=>{const mt=x_[It]??x_.neutral;for(const me in mt)dn(N.current,me,mt[me]),dn(F.current,me,mt[me]),dn(K.current,me,mt[me])};return bT((It,mt)=>{on(l);const me=It.clock.elapsedTime;let Le=0;if(Math.floor(me)%5===0&&Math.floor((me-mt)%5)!==0){let bt=null;M.traverse(Nn=>{Nn.name.toLowerCase().includes("hips")&&(bt=Nn)});const Dn=bt?`Hips Y: ${bt.position.y.toFixed(4)}`:"Hips not found";ua(`[ANIMATION] Mixer Time: ${he.time.toFixed(2)}, ${Dn}`)}if(he.update(mt),me>$.current&&!ye.current&&(ye.current=!0,_e.current=me),ye.current){const bt=p?.2:.3,Dn=(me-_e.current)/bt;if(Dn>=1)if(ye.current=!1,W.current){const Nn=p?1:2.5;$.current=me+Nn,W.current=!1}else $.current=me+.12,W.current=!0;else{const Nn=Dn<.5?Dn*2:(1-Dn)*2;dn(N.current,"eyeBlinkLeft",Nn),dn(N.current,"eyeBlinkRight",Nn),dn(F.current,"eyeBlinkLeft",Nn),dn(F.current,"eyeBlinkRight",Nn),dn(K.current,"eyeBlinkLeft",Nn),dn(K.current,"eyeBlinkRight",Nn),Le=Nn*QF.browInnerUp}}const Ue=x_[l]??x_.neutral,rt=Ue.browInnerUp??0,Q=Ue.browOuterUpLeft??0,Kt=Ue.browOuterUpRight??0,_t=me*$F,Ft=VS*Math.sin(_t),yt=VS*.7*Math.sin(_t+.7),j=VS*.7*Math.sin(_t+1.3),I=bt=>Math.max(0,Math.min(1,bt)),ue=I(rt+Ft),Ie=I(Q+yt),Xe=I(Kt+j),Oe=I(ue+Le);dn(N.current,"browInnerUp",Oe),dn(F.current,"browInnerUp",Oe),dn(K.current,"browInnerUp",Oe),dn(N.current,"browOuterUpLeft",Ie),dn(F.current,"browOuterUpLeft",Ie),dn(K.current,"browOuterUpLeft",Ie),dn(N.current,"browOuterUpRight",Xe),dn(F.current,"browOuterUpRight",Xe),dn(K.current,"browOuterUpRight",Xe);const Bt=Me.current,gt=Bt+__,Ht=gt+kS;me>Ht&&(Me.current+=__+kS+_C);const Xt=!p&&me>=Bt&&me<gt,ze=!p&&me>=gt&&me<Ht;(Xt||ze)&&Ne.current!==Bt&&(Ne.current=Bt,it.current=Math.random()<.7?"left":"up");const qe=Xt?me-Bt:ze?__:0,Tt=Xt||ze?Math.min(1,qe/__):0,pt=Tt<=0?0:Math.sin(Tt*Math.PI),st=ze?1-(me-gt)/kS:1,qt=Xt?pt:ze?pt*st:0,de=e4*qt,be=bt=>Ue[bt]??0;if(it.current==="up"?(dn(ne.current,"eyeLookUpLeft",I(be("eyeLookUpLeft")+de)),dn(ne.current,"eyeLookDownLeft",I(be("eyeLookDownLeft"))),dn(ne.current,"eyeLookOutLeft",I(be("eyeLookOutLeft"))),dn(ne.current,"eyeLookInLeft",I(be("eyeLookInLeft"))),dn(ee.current,"eyeLookUpRight",I(be("eyeLookUpRight")+de)),dn(ee.current,"eyeLookDownRight",I(be("eyeLookDownRight"))),dn(ee.current,"eyeLookOutRight",I(be("eyeLookOutRight"))),dn(ee.current,"eyeLookInRight",I(be("eyeLookInRight")))):(dn(ne.current,"eyeLookUpLeft",I(be("eyeLookUpLeft"))),dn(ne.current,"eyeLookDownLeft",I(be("eyeLookDownLeft"))),dn(ne.current,"eyeLookOutLeft",I(be("eyeLookOutLeft"))),dn(ne.current,"eyeLookInLeft",I(be("eyeLookInLeft")+de)),dn(ee.current,"eyeLookUpRight",I(be("eyeLookUpRight"))),dn(ee.current,"eyeLookDownRight",I(be("eyeLookDownRight"))),dn(ee.current,"eyeLookOutRight",I(be("eyeLookOutRight")+de)),dn(ee.current,"eyeLookInRight",I(be("eyeLookInRight")))),!p&&me>=ve.current){Ce.current=me,tt.current=Math.random()<.5?"pucker":"smile";const bt=tt.current==="pucker"?xC:yC;ve.current=me+bt+y_+Math.random()*(AC-y_)}const We=tt.current==="pucker"?xC:yC,St=!p&&me>=Ce.current&&me<Ce.current+We,Ye=St?(me-Ce.current)/We:0,Ve=Ye<=0?0:Ye<.5?Ye*2:(()=>{const bt=(Ye-.5)*2;return 1-bt*bt*(3-2*bt)})(),ft=bt=>Ue[bt]??0;if(St)if(tt.current==="pucker"){const bt=I(ft("mouthPucker")+t4*Ve);dn(N.current,"mouthPucker",bt),dn(F.current,"mouthPucker",bt),dn(K.current,"mouthPucker",bt)}else{const bt=I(ft("mouthSmileLeft")+SC*Ve),Dn=I(ft("mouthSmileRight")+SC*Ve),Nn=I(ft("mouthDimpleLeft")+MC*Ve),Ni=I(ft("mouthDimpleRight")+MC*Ve);dn(N.current,"mouthSmileLeft",bt),dn(N.current,"mouthSmileRight",Dn),dn(N.current,"mouthDimpleLeft",Nn),dn(N.current,"mouthDimpleRight",Ni),dn(F.current,"mouthSmileLeft",bt),dn(F.current,"mouthSmileRight",Dn),dn(F.current,"mouthDimpleLeft",Nn),dn(F.current,"mouthDimpleRight",Ni),dn(K.current,"mouthSmileLeft",bt),dn(K.current,"mouthSmileRight",Dn),dn(K.current,"mouthDimpleLeft",Nn),dn(K.current,"mouthDimpleRight",Ni)}if(V.current){const bt=e.current?0:o.rotation[1];V.current.rotation.y=R0.lerp(V.current.rotation.y,bt,.1),V.current.position.set(...o.position),V.current.scale.setScalar(o.scale),V.current.rotation.x=o.rotation[0],V.current.rotation.z=o.rotation[2]}const jt={};if(XS.forEach(bt=>{jt[bt]=0}),e.current&&n.current){const bt=n.current.currentTime,Ni=(bt-i.current)*1e3- -150;for(let fa=0;fa<t.current.length;fa++){const Ui=t.current[fa];if(Ni<Ui.vtime||Ni>=Ui.vtime+Ui.vduration)continue;const Zi=i4(Ni,Ui.vtime,Ui.vduration),Ia=`viseme_${Ui.viseme}`.toLowerCase(),vi=EC.find(ci=>ci.key.toLowerCase()===Ia);if(!vi)continue;const en=(Ui.weight??1)*Zi;for(const ci in vi.mix)jt[ci]=Math.max(jt[ci]??0,vi.mix[ci]*en);if(vi.teethMix)for(const ci in vi.teethMix)jt[ci]=Math.max(jt[ci]??0,vi.teethMix[ci]*en)}bt>_.current+.5&&(v(),y(!1))}const Mn=Et.current;XS.forEach(bt=>{const Dn=jt[bt]??0,Nn=Mn[bt]??0;Mn[bt]=Math.max(0,Math.min(1,Nn+(Dn-Nn)*(1-Math.exp(-20*mt))))}),XS.forEach(bt=>{const Dn=Mn[bt]??0;dn(N.current,bt,Dn),dn(K.current,bt,Dn),dn(F.current,bt,Dn)})}),Jt.jsx("group",{ref:V,children:Jt.jsx("primitive",{object:M})})});function o4(s){return s?s.charAt(0).toUpperCase()+s.slice(1).toLowerCase():""}function CC(s){return s.replace(/\*(.*?)\*/g," $1 ").replace(/\[.*?\]/g," ").replace(/<.*?\/>/g," ").replace(/<.*?>.*?<\/.*?>/g," ").replace(/\s+/g," ").trim()}const YS=new Map,l4=({onNavigationRequested:s,agentId:e,presetUserDetails:t,onAvatarReady:n})=>{const[i,o]=ge.useState(""),[l,h]=ge.useState("male"),[d,p]=ge.useState(""),[_,v]=ge.useState(!1),[y,x]=ge.useState(()=>typeof window>"u"?null:sessionStorage.getItem("STREAMOJI_LEADS_SESSION_LEAD_ID")),b=i,R=l;ge.useEffect(()=>{if(!e){v(!0);return}let we=!1;return(async()=>{console.log(">> fetchConfig RUNNING for",e);try{const ut=`agent_config_${e}`,Ut=sessionStorage.getItem("STREAMOJI_LEADS_SESSION_LEAD_ID"),Nt=sessionStorage.getItem(ut);if(Nt)try{const ln=JSON.parse(Nt);we||(ln.encryptedAgentToken&&o(ln.encryptedAgentToken),ln.avatarGender&&h(ln.avatarGender),ln.agent_id&&p(ln.agent_id),ln.lead_id&&(x(ln.lead_id),sessionStorage.setItem("STREAMOJI_LEADS_SESSION_LEAD_ID",ln.lead_id)),v(!0));return}catch(ln){console.error("Failed to parse cached avatar config:",ln),sessionStorage.removeItem(ut)}let Vt;if(YS.has(e))console.log(">> REUSING in-flight fetch for",e),Vt=await YS.get(e);else{const ln=(async()=>{console.log(">> INITIATING visitedWebsite fetch for",e);const Wn={agentId:e,lead_id:Ut},En=await fetch(`${Zh}/visitedWebsite`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Wn)});if(!En.ok)throw new Error(`Fetch failed: ${En.status}`);const Cn=await En.json();return sessionStorage.setItem(ut,JSON.stringify(Cn)),Cn})();YS.set(e,ln),Vt=await ln}if(we)return;Vt&&(Vt.encryptedAgentToken&&o(Vt.encryptedAgentToken),Vt.avatarGender&&h(Vt.avatarGender),Vt.agent_id&&p(Vt.agent_id),Vt.lead_id&&(x(Vt.lead_id),sessionStorage.setItem("STREAMOJI_LEADS_SESSION_LEAD_ID",Vt.lead_id)))}catch(ut){console.error("Failed to fetch avatar config:",ut)}finally{we||v(!0)}})(),()=>{we=!0}},[e]);const T=kF(e??d),[M,w]=ge.useState(""),[D,L]=ge.useState(""),[P,O]=ge.useState("Ready"),[z,V]=ge.useState(!1),[N,F]=ge.useState(!1),[K,ne]=ge.useState([]),[ee,ie]=ge.useState(""),he=ge.useRef(null),[H,Y]=ge.useState(()=>typeof window<"u"?window.matchMedia("(max-width: 480px)").matches:!1);ge.useEffect(()=>{const we=window.matchMedia("(max-width: 480px)"),at=()=>Y(we.matches);return we.addEventListener("change",at),()=>we.removeEventListener("change",at)},[]);const $=H?80:600,ye=ge.useRef(!1),_e=ge.useRef([]),W=ge.useRef(0),ae=ge.useRef(!1),Me=ge.useRef([]),Ne=ge.useRef(null),it=ge.useRef([]);ge.useRef([]);const ve=ge.useRef([]),Ce=ge.useRef(0),tt=ge.useRef(0),Et=ge.useRef(0),wt=ge.useRef(0),on=ge.useRef(!1),[It,mt]=ge.useState(null),me=ge.useRef(null),[Le,Ue]=ge.useState("neutral"),[rt,Q]=ge.useState(""),[Kt,_t]=ge.useState(""),[Ft,yt]=ge.useState(()=>{if(typeof window>"u")return null;try{const we=window.sessionStorage.getItem("leadCaptureAskFor");return we&&we!==""?we:null}catch{return null}}),[j,I]=ge.useState("hidden"),[ue,Ie]=ge.useState(""),Xe=ge.useRef(null),Oe=ge.useRef(j);Oe.current=j;const[Bt,gt]=ge.useState(null),Ht=ge.useRef(null),Xt=ge.useRef(null),[ze,qe]=ge.useState(!1),Tt=ge.useRef(null),[pt,st]=ge.useState("hidden"),[qt,de]=ge.useState(""),be=ge.useRef(pt);be.current=pt;const We=ge.useRef(""),St=ge.useRef(!1),Ye=ge.useRef(""),Ve=ge.useRef(Date.now()),ft=ge.useRef([]),jt=ge.useRef(!1),[Mn,bt]=ge.useState(!1),[Dn,Nn]=ge.useState(!1),Ni=ge.useRef(null),fa=ge.useMemo(()=>ze?"Try again":P==="Busy"?"Busy":P==="Thinking..."||P==="Processing Voice..."?P:Ft!=null&&Ft!==""&&Ft!=="none"&&Ft!=="<none>"?`Enter ${o4(Ft)}`:pt!=="hidden"||!Dn?null:bC,[P,Ft,ze,pt,Dn]),Ui=!ze&&P!=="Busy"&&P!=="Thinking..."&&P!=="Processing Voice..."&&(Ft==null||Ft===""||Ft==="none"||Ft==="<none>");ge.useEffect(()=>{if(pt!=="hidden"||!Ui){Nn(!1),Ni.current!=null&&(clearTimeout(Ni.current),Ni.current=null);return}return Ni.current=setTimeout(()=>{Ni.current=null,Nn(!0)},400),()=>{Ni.current!=null&&(clearTimeout(Ni.current),Ni.current=null)}},[pt,Ui]);const Zi=fa!=null&&fa!=="";ge.useEffect(()=>{const we=Oe.current;if(!(we==="exiting"||we==="entering")){if(we==="hidden"){Zi&&(Ie(fa??""),I("entering"));return}we==="visible"&&(!Zi||fa!==ue)&&(Xe.current=Zi?fa:null,I("exiting"))}},[Zi,fa,j,ue]),ge.useEffect(()=>{if(P!=="Busy"){Xt.current!=null&&(clearTimeout(Xt.current),Xt.current=null);return}return Xt.current=setTimeout(()=>{Xt.current=null,O("Ready"),qe(!0)},12e3),()=>{Xt.current!=null&&(clearTimeout(Xt.current),Xt.current=null)}},[P]),ge.useEffect(()=>{if(!ze)return;const we=setTimeout(()=>qe(!1),2500);return()=>clearTimeout(we)},[ze]);const Ia=ge.useCallback(()=>{const we=Oe.current;if(we==="exiting"){I("hidden");const at=Xe.current;Xe.current=null,at!=null&&at!==""&&(Ie(at),I("entering"))}else we==="entering"&&I("visible")},[]),vi=we=>{if(!we)return;if(we.mood!=null){const Nt=String(we.mood).toLowerCase();Ue(Nt)}if(we.expression!=null){const Nt=String(we.expression).trim();Q(Nt);const Vt=JF.find(ln=>ln.name.toLowerCase()===Nt.toLowerCase());ua(`[STREAM] Animation match for "${Nt}": ${Vt?Vt.name:"NONE"}`),_t(Vt?.url??"")}if(we.navigation!=null){const Nt=String(we.navigation).trim();if(Nt!==""){let Vt=!1;if(typeof window<"u")try{const ln=new URL(window.location.href),Wn=new URL(Nt,window.location.href),En=ln.hostname==="leads.streamoji.com"||ln.hostname.includes("localhost");if(Wn.origin!==ln.origin&&!En){ua("[STREAM] Navigation rejected: different origin");return}const Cn=ti=>ti.replace(/\/+$/,"")||"/";Vt=Cn(ln.pathname)===Cn(Wn.pathname)}catch{}if(Vt)return;s?s(Nt):gt(Nt)}}const at=we.ask_for||we.lead_capture?.ask_for,ut=at?String(at).trim().toLowerCase():"",Ut=ut==="none"||ut==="<none>";if(at&&!Ut){const Nt=ut;if(t&&(Nt==="email"&&t.email||Nt==="name"&&t.name||Nt==="phone"&&t.phone))return;if(typeof window<"u")try{window.sessionStorage.setItem("leadCaptureAskFor",Nt)}catch{}yt(Nt||null)}else if(Ut||we.ask_for===null||we.lead_capture&&we.lead_capture.ask_for===null||we.ask_for==="none"){if(typeof window<"u")try{window.sessionStorage.removeItem("leadCaptureAskFor")}catch{}yt(null)}we.collected,we.valid},en=we=>{const at=we.trim();if(!at)return null;if(at.startsWith("{"))try{return JSON.parse(at)}catch{return null}if(at.includes(":")){const ut=at.split(":"),Ut=ut[0].trim().toLowerCase(),Nt=ut.slice(1).join(":").trim();return{[Ut]:Nt}}return null},ci=ge.useCallback(()=>{},[]),fn="§",G=()=>{for(;We.current.includes(`
4150
4150
  `);){const we=We.current.indexOf(`
4151
- `),at=We.current.slice(0,we).trim();We.current=We.current.slice(we+1);const ut=en(at);ut&&vi(ut)}},J=we=>{if(St.current)if(we.includes(fn)){const at=we.indexOf(fn),ut=we.slice(0,at),Ut=we.slice(at+fn.length);ut&&(Ye.current+=ut,L(Nt=>Nt+ut)),St.current=!1,Ut&&(We.current+=Ut,G())}else we===fn?St.current=!1:(Ye.current+=we,L(at=>at+we));else if(we.includes(fn)){const at=we.indexOf(fn),ut=we.slice(0,at),Ut=we.slice(at+fn.length);We.current+=ut,G(),St.current=!0,Ut&&(Ye.current+=Ut,L(Nt=>Nt+Ut))}else if(we===fn){St.current=!0;return}else We.current+=we,G()};ge.useEffect(()=>{(async()=>{const at=sessionStorage.getItem("STREAMOJI_LEADS_SESSION_MESSAGES");let ut=[];if(at)try{ut=JSON.parse(at)}catch{ut=[]}ut.length===0&&t&&(t.name||t.email)?(ut=[{role:"user",content:`PRESET_USER_DETAILS: Name is "${t.name||""}" , Email is "${t.email||""}"`}],sessionStorage.setItem("STREAMOJI_LEADS_SESSION_MESSAGES",JSON.stringify(ut))):at||sessionStorage.setItem("STREAMOJI_LEADS_SESSION_MESSAGES",JSON.stringify([]))})()},[t]),ge.useEffect(()=>{const we=()=>{Ve.current=Date.now(),jt.current&&(jt.current=!1,bt(!1),ne([]),ie(""),L(""),F(!1))};window.addEventListener("mousemove",we),window.addEventListener("keydown",we),window.addEventListener("mousedown",we),window.addEventListener("touchstart",we);const at=setInterval(async()=>{if(Date.now()-Ve.current>=3e4&&!N&&!z&&P==="Ready"&&!jt.current)if(jt.current=!0,ft.current.length>0)bt(!0),ne(ft.current);else try{const Nt=`${Zh}/nudgeUser`,Vt={navigationUrl:window.location.href,agentId:e,lead_id:y},ln=await fetch(Nt,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Vt)});if(ln.ok){const En=(await ln.json()).nudge_questions;En&&En.length>0&&(ua("[NUDGE] Received nudge questions from API:",En),ft.current=En,bt(!0),ne(En))}}catch(Nt){console.error("[NUDGE] Error calling /nudgeUser:",Nt),jt.current=!1}},1e3);return()=>{window.removeEventListener("mousemove",we),window.removeEventListener("keydown",we),window.removeEventListener("mousedown",we),window.removeEventListener("touchstart",we),clearInterval(at)}},[b,N,z,P]),ge.useEffect(()=>{if(K.length===0)return;let we=0,at=0,ut=!1,Ut=100;const Nt=()=>{const Vt=K[we];if(ut){const ln=Vt.substring(0,at-1);ie(ln),at--,Ut=50}else{const ln=Vt.substring(0,at+1);ie(ln),at++,Ut=100}!ut&&at===Vt.length?(ut=!0,Ut=3e3):ut&&at===0&&(ut=!1,we=(we+1)%K.length,Ut=500),he.current=setTimeout(Nt,Ut)};return Nt(),()=>{he.current&&clearTimeout(he.current)}},[K]);const oe=()=>{try{return JSON.parse(sessionStorage.getItem("STREAMOJI_LEADS_SESSION_MESSAGES")||"[]")}catch{return[]}},Re=we=>{sessionStorage.setItem("STREAMOJI_LEADS_SESSION_MESSAGES",JSON.stringify(we))},[Pe,He]=ge.useState(!1),[ot,nt]=ge.useState(0),Ze=ge.useRef(null),je=ge.useRef([]),vt=ge.useRef(0),[ht,k]=ge.useState(null),[te,fe]=ge.useState(null),ce=ge.useRef(null),le=ge.useRef(null),Qe=ge.useCallback((we=!1)=>{we&&(on.current=!0,V(!1),O("Ready")),Me.current=[],_e.current=[],ae.current=!1,F(!1),Ce.current=0,tt.current=0,Et.current=0,it.current.forEach(at=>{try{at.stop()}catch{}}),Ht.current&&(clearTimeout(Ht.current),Ht.current=null),setTimeout(()=>{gt(null),_t("")},10),it.current=[]},[]),lt=async()=>{try{const we=await navigator.mediaDevices.getUserMedia({audio:!0}),at=window.AudioContext||window.webkitAudioContext,ut=new at,Ut=ut.createMediaStreamSource(we),Nt=ut.createAnalyser();Nt.fftSize=64,Ut.connect(Nt),ce.current=ut,le.current=Ut,fe(Nt);const Vt=new MediaRecorder(we);Ze.current=Vt,je.current=[],Vt.ondataavailable=ln=>{ln.data.size>0&&je.current.push(ln.data)},Vt.onstop=async()=>{const ln=Date.now()-vt.current;if(fe(null),le.current&&(le.current.disconnect(),le.current=null),ce.current&&ce.current.state!=="closed"&&(ce.current.close(),ce.current=null),ln<1e3){O("Recording too short. Hold or click longer."),V(!1);return}const Wn=new Blob(je.current,{type:"audio/wav"});await At(Wn)},vt.current=Date.now(),Vt.start(100),He(!0),O("Listening...")}catch(we){console.error("Error accessing microphone:",we),O("Mic Access Error")}},ct=()=>{Ze.current&&Ze.current.state!=="inactive"&&(Ze.current.stop(),Ze.current.stream.getTracks().forEach(we=>we.stop()),He(!1))},Ct=()=>{Ze.current&&Ze.current.state!=="inactive"&&(Ze.current.onstop=null,Ze.current.stop(),Ze.current.stream.getTracks().forEach(we=>we.stop()),fe(null),le.current&&(le.current.disconnect(),le.current=null),ce.current&&ce.current.state!=="closed"&&(ce.current.close(),ce.current=null),He(!1),je.current=[],O("Ready"))};ge.useEffect(()=>{if(!N)return;const we=()=>{const at=Et.current;if(at<=0)return;const ut=Ne.current,Ut=Ce.current;if(!ut)return;const Nt=ut.currentTime-Ut,Vt=Math.min(Math.max(0,Nt),at),Wn=CC(D).trim().length;if(Wn<=0)return;const En=Math.min(Math.round(Vt/at*Wn),Wn);mt(En)};return clearInterval(me.current??void 0),me.current=setInterval(we,90),()=>clearInterval(me.current??void 0)},[N,D,Et.current]),ge.useEffect(()=>{let we;return Pe?(nt(0),we=window.setInterval(()=>{nt(at=>at+1)},1e3)):nt(0),()=>clearInterval(we)},[Pe]);const xt=we=>{const at=we.numberOfChannels,ut=we.length*at*2+44,Ut=new ArrayBuffer(ut),Nt=new DataView(Ut);let Vt=0;const ln=ti=>{Nt.setUint16(Vt,ti,!0),Vt+=2},Wn=ti=>{Nt.setUint32(Vt,ti,!0),Vt+=4};Wn(1179011410),Wn(ut-8),Wn(1163280727),Wn(544501094),Wn(16),ln(1),ln(at),Wn(we.sampleRate),Wn(we.sampleRate*2*at),ln(at*2),ln(16),Wn(1635017060),Wn(ut-Vt-4);const En=[];for(let ti=0;ti<at;ti++)En.push(we.getChannelData(ti));let Cn=0;for(;Vt<ut;){for(let ti=0;ti<at;ti++){let Ci=Math.max(-1,Math.min(1,En[ti][Cn]));Ci=Ci<0?Ci*32768:Ci*32767,Nt.setInt16(Vt,Ci,!0),Vt+=2}Cn++}return new Blob([Ut],{type:"audio/wav"})},Yt=async(we,at,ut=!1)=>{if(!on.current){if(ye.current){_e.current.push({audio:we,visemes:at,isNewSegment:ut});return}ye.current=!0;try{const Ut=window.AudioContext||window.webkitAudioContext,Nt=Ne.current??new Ut;Nt.state==="suspended"&&await Nt.resume(),Ne.current=Nt;const Vt=window.atob(we),ln=new Uint8Array(Vt.length);for(let _a=0;_a<Vt.length;_a++)ln[_a]=Vt.charCodeAt(_a);const Wn=await Nt.decodeAudioData(ln.buffer.slice(0));Et.current+=Wn.duration;const En=Nt.currentTime;let Cn=tt.current;const ti=!ae.current;Cn<En&&(Cn=En+.1),tt.current=Cn+Wn.duration;const Ci=Nt.createBufferSource();Ci.buffer=Wn;let _i=ht;if((!_i||_i.context!==Nt)&&(_i=Nt.createAnalyser(),_i.fftSize=64,_i.connect(Nt.destination),k(_i)),Ci.connect(_i),it.current.push(Ci),on.current){it.current=it.current.filter(_a=>_a!==Ci);return}if(ti){ae.current=!0,F(!0),ua(`[AUDIO] setIsSpeaking(true) - First chunk starting at ${Cn.toFixed(3)}`),Ce.current=Cn;const _a=(Cn-En)*1e3;W.current=performance.now()+_a,ua(`[AUDIO] Response started. Initial startTime: ${Cn.toFixed(3)}, CT: ${En.toFixed(3)}`)}Ci.start(Cn);const ha=(Cn-Ce.current)*1e3;ut&&(wt.current=ha,ua(`[AUDIO] New segment detected at +${ha.toFixed(0)}ms. Resetting segment offset.`)),at.forEach((_a,Wa)=>{const Ri=_a.symbol??"";if(Ri){const ya=a4(Ri),$i=Math.round(_a.start*1e3),ir=Math.round((_a.duration??0)*1e3),qo=wt.current+$i;Wa<3&&ua(`[AUDIO] Viseme "${Ri}": segment_relative=${$i}ms, segment_offset=${wt.current.toFixed(0)}ms => vtime=${qo}ms`),ya.forEach(xr=>{Me.current.push({viseme:xr.v,weight:xr.w,vtime:qo,vduration:ir})})}}),O("Speaking...")}finally{if(ye.current=!1,_e.current.length>0){const Ut=_e.current.shift();Ut&&Yt(Ut.audio,Ut.visemes,Ut.isNewSegment)}}}},At=async we=>{try{V(!0),bt(!1),Ye.current="",L(""),O("Processing Voice...");const at=await we.arrayBuffer(),Ut=await new(window.AudioContext||window.webkitAudioContext)().decodeAudioData(at),Nt=xt(Ut),Vt=new FileReader;Vt.readAsDataURL(Nt),Vt.onloadend=async()=>{const ln=Vt.result.split(",")[1];Qe(),w(""),We.current="",St.current=!1;const Wn=`${Zh}/stt?token=${encodeURIComponent(b)}`,En=await fetch(Wn,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({audio_base64:ln,audio_format:"wav"})});if(En.status===429){try{const Wa=await En.text(),Ri=JSON.parse(Wa);ua("[STT] 429 agent at capacity:",Ri?.detail)}catch{}w(""),O("Busy"),V(!1);return}if(!En.ok){const Wa=await En.text();let Ri="STT Failed";try{Ri=JSON.parse(Wa).error||Ri}catch{Wa&&(Ri=Wa.slice(0,200))}throw new Error(Ri)}const Cn=En.body;if(ua("this is body"+Cn),!Cn){O("STT Failed"),V(!1);return}const ti=Cn.getReader();on.current=!1;const Ci=new TextDecoder;let _i="",ha=!1;const _a=async(Wa,Ri)=>{switch(Wa){case"transcript":Ri.transcript!=null&&w(String(Ri.transcript));break;case"text":{const ya=Ri.delta??Ri.text??"";ya&&J(ya);break}case"audio":{const ya=Ri.chunk,$i=Ri.visemes??[],ir=!!Ri.is_new_segment;ya&&await Yt(ya,$i,ir);break}case"done":{ha=!0,O("Ready"),V(!1);break}case"error":{ha=!0,O("STT Failed"),V(!1);break}default:break}};for(;;){const{done:Wa,value:Ri}=await ti.read();Ri&&(_i+=Ci.decode(Ri,{stream:!0}));const ya=_i.split(`
4151
+ `),at=We.current.slice(0,we).trim();We.current=We.current.slice(we+1);const ut=en(at);ut&&vi(ut)}},J=we=>{if(St.current)if(we.includes(fn)){const at=we.indexOf(fn),ut=we.slice(0,at),Ut=we.slice(at+fn.length);ut&&(Ye.current+=ut,L(Nt=>Nt+ut)),St.current=!1,Ut&&(We.current+=Ut,G())}else we===fn?St.current=!1:(Ye.current+=we,L(at=>at+we));else if(we.includes(fn)){const at=we.indexOf(fn),ut=we.slice(0,at),Ut=we.slice(at+fn.length);We.current+=ut,G(),St.current=!0,Ut&&(Ye.current+=Ut,L(Nt=>Nt+Ut))}else if(we===fn){St.current=!0;return}else We.current+=we,G()};ge.useEffect(()=>{(async()=>{const at=sessionStorage.getItem("STREAMOJI_LEADS_SESSION_MESSAGES");let ut=[];if(at)try{ut=JSON.parse(at)}catch{ut=[]}ut.length===0&&t&&(t.name||t.email)?(ut=[{role:"user",content:`PRESET_USER_DETAILS: Name is "${t.name||""}" , Email is "${t.email||""}"`}],sessionStorage.setItem("STREAMOJI_LEADS_SESSION_MESSAGES",JSON.stringify(ut))):at||sessionStorage.setItem("STREAMOJI_LEADS_SESSION_MESSAGES",JSON.stringify([]))})()},[t]),ge.useEffect(()=>{const we=()=>{Ve.current=Date.now(),jt.current&&(jt.current=!1,bt(!1),ne([]),ie(""),L(""),F(!1))};window.addEventListener("mousemove",we),window.addEventListener("keydown",we),window.addEventListener("mousedown",we),window.addEventListener("touchstart",we);const at=setInterval(async()=>{if(Date.now()-Ve.current>=3e4&&!N&&!z&&P==="Ready"&&!jt.current)if(jt.current=!0,ft.current.length>0)bt(!0),ne(ft.current);else try{const Nt=`${Zh}/nudgeUser`,Vt={navigationUrl:window.location.href,agentId:e,lead_id:y},ln=await fetch(Nt,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Vt)});if(ln.ok){const En=(await ln.json()).nudge_questions;En&&En.length>0&&(ua("[NUDGE] Received nudge questions from API:",En),ft.current=En,bt(!0),ne(En))}}catch(Nt){console.error("[NUDGE] Error calling /nudgeUser:",Nt),jt.current=!1}},1e3);return()=>{window.removeEventListener("mousemove",we),window.removeEventListener("keydown",we),window.removeEventListener("mousedown",we),window.removeEventListener("touchstart",we),clearInterval(at)}},[b,N,z,P]),ge.useEffect(()=>{if(K.length===0)return;let we=0,at=0,ut=!1,Ut=100;const Nt=()=>{const Vt=K[we];if(ut){const ln=Vt.substring(0,at-1);ie(ln),at--,Ut=50}else{const ln=Vt.substring(0,at+1);ie(ln),at++,Ut=100}!ut&&at===Vt.length?(ut=!0,Ut=3e3):ut&&at===0&&(ut=!1,we=(we+1)%K.length,Ut=500),he.current=setTimeout(Nt,Ut)};return Nt(),()=>{he.current&&clearTimeout(he.current)}},[K]);const oe=()=>{try{return JSON.parse(sessionStorage.getItem("STREAMOJI_LEADS_SESSION_MESSAGES")||"[]")}catch{return[]}},Re=we=>{sessionStorage.setItem("STREAMOJI_LEADS_SESSION_MESSAGES",JSON.stringify(we))},[Pe,He]=ge.useState(!1),[ot,nt]=ge.useState(0),Ze=ge.useRef(null),je=ge.useRef([]),vt=ge.useRef(0),[ht,k]=ge.useState(null),[te,fe]=ge.useState(null),ce=ge.useRef(null),le=ge.useRef(null),Qe=ge.useCallback((we=!1)=>{we&&(on.current=!0,V(!1),O("Ready")),Me.current=[],_e.current=[],ae.current=!1,F(!1),Ce.current=0,tt.current=0,Et.current=0,it.current.forEach(at=>{try{at.stop()}catch{}}),Ht.current&&(clearTimeout(Ht.current),Ht.current=null),setTimeout(()=>{gt(null),_t("")},10),it.current=[]},[]),lt=async()=>{try{const we=await navigator.mediaDevices.getUserMedia({audio:!0}),at=window.AudioContext||window.webkitAudioContext,ut=new at,Ut=ut.createMediaStreamSource(we),Nt=ut.createAnalyser();Nt.fftSize=64,Ut.connect(Nt),ce.current=ut,le.current=Ut,fe(Nt);const Vt=new MediaRecorder(we);Ze.current=Vt,je.current=[],Vt.ondataavailable=ln=>{ln.data.size>0&&je.current.push(ln.data)},Vt.onstop=async()=>{const ln=Date.now()-vt.current;if(fe(null),le.current&&(le.current.disconnect(),le.current=null),ce.current&&ce.current.state!=="closed"&&(ce.current.close(),ce.current=null),ln<1e3){O("Recording too short. Hold or click longer."),V(!1);return}const Wn=new Blob(je.current,{type:"audio/wav"});await At(Wn)},vt.current=Date.now(),Vt.start(100),He(!0),O("Listening...")}catch(we){console.error("Error accessing microphone:",we),O("Mic Access Error")}},ct=()=>{Ze.current&&Ze.current.state!=="inactive"&&(Ze.current.stop(),Ze.current.stream.getTracks().forEach(we=>we.stop()),He(!1))},Ct=()=>{Ze.current&&Ze.current.state!=="inactive"&&(Ze.current.onstop=null,Ze.current.stop(),Ze.current.stream.getTracks().forEach(we=>we.stop()),fe(null),le.current&&(le.current.disconnect(),le.current=null),ce.current&&ce.current.state!=="closed"&&(ce.current.close(),ce.current=null),He(!1),je.current=[],O("Ready"))};ge.useEffect(()=>{if(!N)return;const we=()=>{const at=Et.current;if(at<=0)return;const ut=Ne.current,Ut=Ce.current;if(!ut)return;const Nt=ut.currentTime-Ut,Vt=Math.min(Math.max(0,Nt),at),Wn=CC(D).trim().length;if(Wn<=0)return;const En=Math.min(Math.round(Vt/at*Wn),Wn);mt(En)};return clearInterval(me.current??void 0),me.current=setInterval(we,90),()=>clearInterval(me.current??void 0)},[N,D,Et.current]),ge.useEffect(()=>{let we;return Pe?(nt(0),we=window.setInterval(()=>{nt(at=>at+1)},1e3)):nt(0),()=>clearInterval(we)},[Pe]);const xt=we=>{const at=we.numberOfChannels,ut=we.length*at*2+44,Ut=new ArrayBuffer(ut),Nt=new DataView(Ut);let Vt=0;const ln=ti=>{Nt.setUint16(Vt,ti,!0),Vt+=2},Wn=ti=>{Nt.setUint32(Vt,ti,!0),Vt+=4};Wn(1179011410),Wn(ut-8),Wn(1163280727),Wn(544501094),Wn(16),ln(1),ln(at),Wn(we.sampleRate),Wn(we.sampleRate*2*at),ln(at*2),ln(16),Wn(1635017060),Wn(ut-Vt-4);const En=[];for(let ti=0;ti<at;ti++)En.push(we.getChannelData(ti));let Cn=0;for(;Vt<ut;){for(let ti=0;ti<at;ti++){let Ci=Math.max(-1,Math.min(1,En[ti][Cn]));Ci=Ci<0?Ci*32768:Ci*32767,Nt.setInt16(Vt,Ci,!0),Vt+=2}Cn++}return new Blob([Ut],{type:"audio/wav"})},Yt=async(we,at,ut=!1)=>{if(!on.current){if(ye.current){_e.current.push({audio:we,visemes:at,isNewSegment:ut});return}ye.current=!0;try{const Ut=window.AudioContext||window.webkitAudioContext,Nt=Ne.current??new Ut;Nt.state==="suspended"&&await Nt.resume(),Ne.current=Nt;const Vt=window.atob(we),ln=new Uint8Array(Vt.length);for(let _a=0;_a<Vt.length;_a++)ln[_a]=Vt.charCodeAt(_a);const Wn=await Nt.decodeAudioData(ln.buffer.slice(0));Et.current+=Wn.duration;const En=Nt.currentTime;let Cn=tt.current;const ti=!ae.current;Cn<En&&(Cn=En+.1),tt.current=Cn+Wn.duration;const Ci=Nt.createBufferSource();Ci.buffer=Wn;let _i=ht;if((!_i||_i.context!==Nt)&&(_i=Nt.createAnalyser(),_i.fftSize=64,_i.connect(Nt.destination),k(_i)),Ci.connect(_i),it.current.push(Ci),on.current){it.current=it.current.filter(_a=>_a!==Ci);return}if(ti){ae.current=!0,F(!0),ua(`[AUDIO] setIsSpeaking(true) - First chunk starting at ${Cn.toFixed(3)}`),Ce.current=Cn;const _a=(Cn-En)*1e3;W.current=performance.now()+_a,ua(`[AUDIO] Response started. Initial startTime: ${Cn.toFixed(3)}, CT: ${En.toFixed(3)}`)}Ci.start(Cn);const ha=(Cn-Ce.current)*1e3;ut&&(wt.current=ha,ua(`[AUDIO] New segment detected at +${ha.toFixed(0)}ms. Resetting segment offset.`)),at.forEach((_a,Wa)=>{const Ri=_a.symbol??"";if(Ri){const ya=a4(Ri),$i=Math.round(_a.start*1e3),ir=Math.round((_a.duration??0)*1e3),qo=wt.current+$i;Wa<3&&ua(`[AUDIO] Viseme "${Ri}": segment_relative=${$i}ms, segment_offset=${wt.current.toFixed(0)}ms => vtime=${qo}ms`),ya.forEach(xr=>{Me.current.push({viseme:xr.v,weight:xr.w,vtime:qo,vduration:ir})})}}),O("Speaking...")}finally{if(ye.current=!1,_e.current.length>0){const Ut=_e.current.shift();Ut&&Yt(Ut.audio,Ut.visemes,Ut.isNewSegment)}}}},At=async we=>{try{V(!0),bt(!1),Ye.current="",L(""),O("Processing Voice...");const at=await we.arrayBuffer(),Ut=await new(window.AudioContext||window.webkitAudioContext)().decodeAudioData(at),Nt=xt(Ut),Vt=new FileReader;Vt.readAsDataURL(Nt),Vt.onloadend=async()=>{const ln=Vt.result.split(",")[1];Qe(),w(""),We.current="",St.current=!1;const Wn=`${Zh}/stt?token=${encodeURIComponent(b)}`,En=await fetch(Wn,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({audio_base64:ln,audio_format:"wav",lead_id:y})});if(En.status===429){try{const Wa=await En.text(),Ri=JSON.parse(Wa);ua("[STT] 429 agent at capacity:",Ri?.detail)}catch{}w(""),O("Busy"),V(!1);return}if(!En.ok){const Wa=await En.text();let Ri="STT Failed";try{Ri=JSON.parse(Wa).error||Ri}catch{Wa&&(Ri=Wa.slice(0,200))}throw new Error(Ri)}const Cn=En.body;if(ua("this is body"+Cn),!Cn){O("STT Failed"),V(!1);return}const ti=Cn.getReader();on.current=!1;const Ci=new TextDecoder;let _i="",ha=!1;const _a=async(Wa,Ri)=>{switch(Wa){case"transcript":Ri.transcript!=null&&w(String(Ri.transcript));break;case"text":{const ya=Ri.delta??Ri.text??"";ya&&J(ya);break}case"audio":{const ya=Ri.chunk,$i=Ri.visemes??[],ir=!!Ri.is_new_segment;ya&&await Yt(ya,$i,ir);break}case"done":{ha=!0,O("Ready"),V(!1);break}case"error":{ha=!0,O("STT Failed"),V(!1);break}default:break}};for(;;){const{done:Wa,value:Ri}=await ti.read();Ri&&(_i+=Ci.decode(Ri,{stream:!0}));const ya=_i.split(`
4152
4152
 
4153
- `);_i=ya.pop()??"";for(const $i of ya){const ir=mn($i);ir&&await _a(ir.event,ir.data)}if(Wa){if(_i.trim()){const $i=mn(_i.trim());$i&&await _a($i.event,$i.data)}ha||(O("Ready"),V(!1));break}}}}catch(at){console.error("Audio Submission Error:",at),O("STT Failed"),V(!1)}},zt=async we=>{we&&we.preventDefault(),bt(!1),Ye.current="",L(""),!(!M||z)&&await Lt(M)},mn=we=>{const at=we.split(/\r?\n/);let ut="",Ut="";for(const Vt of at)Vt.startsWith("event:")?ut=Vt.slice(6).trim():Vt.startsWith("data:")&&(Ut=Vt.slice(5).trim());if(!ut)return null;let Nt={};if(Ut)try{Nt=JSON.parse(Ut)}catch{Nt={raw:Ut}}return{event:ut,data:Nt}},Pn=(we,at)=>{switch(we){case"connected":We.current="",St.current=!1;break;case"text":{const ut=at.delta??"";ut&&J(ut);break}case"metadata":{vi(at);break}case"audio":{const ut=at.chunk,Ut=at.visemes??[],Nt=at.is_new_segment??!1;ut&&Yt(ut,Ut,Nt);break}case"done":{const ut=oe(),Ut=Ye.current.trim(),Nt=[...ut,{role:"user",content:M||"..."},{role:"assistant",content:Ut}];Re(Nt),ve.current=[...Me.current],O("Ready"),V(!1),w("");break}case"error":{const ut=at.message??"Unknown error";Ye.current=ut,L(ut),O("Agent Failed"),V(!1);break}}},Mn=async(we,at)=>{V(!0),O("Thinking..."),Ye.current="",We.current="",St.current=!1,Qe(),Et.current=0,mt(0);try{const ut=await fetch(we,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(at)});if(ut.status===429)return O("Busy"),V(!1),"";if(!ut.ok)throw new Error("Request failed");const Ut=ut.body;if(!Ut)return O("Failed"),V(!1),"";const Nt=Ut.getReader();on.current=!1;const Vt=new TextDecoder;let ln="";for(;;){const{done:Wn,value:En}=await Nt.read();En&&(ln+=Vt.decode(En,{stream:!0}));const Cn=ln.split(`
4153
+ `);_i=ya.pop()??"";for(const $i of ya){const ir=mn($i);ir&&await _a(ir.event,ir.data)}if(Wa){if(_i.trim()){const $i=mn(_i.trim());$i&&await _a($i.event,$i.data)}ha||(O("Ready"),V(!1));break}}}}catch(at){console.error("Audio Submission Error:",at),O("STT Failed"),V(!1)}},zt=async we=>{we&&we.preventDefault(),bt(!1),Ye.current="",L(""),!(!M||z)&&await Lt(M)},mn=we=>{const at=we.split(/\r?\n/);let ut="",Ut="";for(const Vt of at)Vt.startsWith("event:")?ut=Vt.slice(6).trim():Vt.startsWith("data:")&&(Ut=Vt.slice(5).trim());if(!ut)return null;let Nt={};if(Ut)try{Nt=JSON.parse(Ut)}catch{Nt={raw:Ut}}return{event:ut,data:Nt}},Pn=(we,at)=>{switch(we){case"connected":We.current="",St.current=!1;break;case"text":{const ut=at.delta??"";ut&&J(ut);break}case"metadata":{vi(at);break}case"audio":{const ut=at.chunk,Ut=at.visemes??[],Nt=at.is_new_segment??!1;ut&&Yt(ut,Ut,Nt);break}case"done":{const ut=oe(),Ut=Ye.current.trim(),Nt=[...ut,{role:"user",content:M||"..."},{role:"assistant",content:Ut}];Re(Nt),ve.current=[...Me.current],O("Ready"),V(!1),w("");break}case"error":{const ut=at.message??"Unknown error";Ye.current=ut,L(ut),O("Agent Failed"),V(!1);break}}},xn=async(we,at)=>{V(!0),O("Thinking..."),Ye.current="",We.current="",St.current=!1,Qe(),Et.current=0,mt(0);try{const ut=await fetch(we,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(at)});if(ut.status===429)return O("Busy"),V(!1),"";if(!ut.ok)throw new Error("Request failed");const Ut=ut.body;if(!Ut)return O("Failed"),V(!1),"";const Nt=Ut.getReader();on.current=!1;const Vt=new TextDecoder;let ln="";for(;;){const{done:Wn,value:En}=await Nt.read();En&&(ln+=Vt.decode(En,{stream:!0}));const Cn=ln.split(`
4154
4154
 
4155
- `);ln=Cn.pop()??"";for(const ti of Cn){const Ci=mn(ti);Ci&&Pn(Ci.event,Ci.data)}if(Wn){if(ln.trim()){const ti=mn(ln.trim());ti&&Pn(ti.event,ti.data)}return O("Ready"),V(!1),Ye.current}}}catch(ut){return console.error("Streaming Error:",ut),O("Failed"),V(!1),""}},Qt=ge.useCallback(async we=>{const at=`${Zh}/avatar_tts`;return await Mn(at,{user_query:we})},[]),Dt=ge.useCallback(async(we,at,ut)=>{const Ut=`${Zh}/avatar_ttsWithKnowledge`;return await Mn(Ut,{user_query:we,knowledge:at,history:ut})},[]),$t=ge.useRef(!1);ge.useEffect(()=>{n&&!$t.current&&(n({avatarSpeak:Qt,avatarRespond:Dt}),$t.current=!0)},[n,Qt,Dt]);const Lt=async we=>{V(!0),O("Thinking..."),Ye.current="",We.current="",St.current=!1,Qe(),Et.current=0,mt(0);const at=`${Zh}/agent/chat?token=${encodeURIComponent(b)}`;try{const Ut={history:oe(),question:we};ua("[CHAT] Sending payload:",Ut);const Nt=await fetch(at,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ut),cache:"default"});if(Nt.status===429){try{const Cn=await Nt.json();ua("[CHAT] 429 agent at capacity:",Cn?.detail)}catch{}w(""),O("Busy"),V(!1);return}if(!Nt.ok)throw new Error("Agent request failed");const Vt=Nt.body;if(!Vt){O("Agent Failed"),V(!1);return}const ln=Vt.getReader();on.current=!1;const Wn=new TextDecoder;let En="";for(;;){const{done:Cn,value:ti}=await ln.read();ua(`[SSE] Chunk received. done=${Cn}, length=${ti?.length||0}`),ti&&(En+=Wn.decode(ti,{stream:!0}));const Ci=En.split(`
4155
+ `);ln=Cn.pop()??"";for(const ti of Cn){const Ci=mn(ti);Ci&&Pn(Ci.event,Ci.data)}if(Wn){if(ln.trim()){const ti=mn(ln.trim());ti&&Pn(ti.event,ti.data)}return O("Ready"),V(!1),Ye.current}}}catch(ut){return console.error("Streaming Error:",ut),O("Failed"),V(!1),""}},Qt=ge.useCallback(async we=>{const at=`${Zh}/avatar_tts`;return await xn(at,{user_query:we})},[xn]),Dt=ge.useCallback(async(we,at,ut)=>{const Ut=`${Zh}/avatar_ttsWithKnowledge`;return await xn(Ut,{user_query:we,knowledge:at,history:ut})},[xn]),$t=ge.useRef(!1);ge.useEffect(()=>{n&&!$t.current&&(n({avatarSpeak:Qt,avatarRespond:Dt}),$t.current=!0)},[n,Qt,Dt]);const Lt=async we=>{V(!0),O("Thinking..."),Ye.current="",We.current="",St.current=!1,Qe(),Et.current=0,mt(0);const at=`${Zh}/agent/chat?token=${encodeURIComponent(b)}`;try{const Ut={history:oe(),question:we,lead_id:y};ua("[CHAT] Sending payload:",Ut);const Nt=await fetch(at,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ut),cache:"default"});if(Nt.status===429){try{const Cn=await Nt.json();ua("[CHAT] 429 agent at capacity:",Cn?.detail)}catch{}w(""),O("Busy"),V(!1);return}if(!Nt.ok)throw new Error("Agent request failed");const Vt=Nt.body;if(!Vt){O("Agent Failed"),V(!1);return}const ln=Vt.getReader();on.current=!1;const Wn=new TextDecoder;let En="";for(;;){const{done:Cn,value:ti}=await ln.read();ua(`[SSE] Chunk received. done=${Cn}, length=${ti?.length||0}`),ti&&(En+=Wn.decode(ti,{stream:!0}));const Ci=En.split(`
4156
4156
 
4157
- `);En=Ci.pop()??"";for(const _i of Ci){ua(`[SSE] Processing block: ${_i.slice(0,50)}...`);const ha=mn(_i);ha&&(ua(`[SSE] Event: ${ha.event}`),Pn(ha.event,ha.data))}if(Cn){if(ua("[SSE] Stream finished"),En.trim()){const _i=mn(En.trim());_i&&Pn(_i.event,_i.data)}O("Ready"),V(!1),w("");break}}}catch(ut){console.error("Chat Error:",ut),O("Agent Failed"),V(!1)}},ei=D.trim(),Qi=CC(ei),Gn=Qi&&N?Qi.slice(0,It!=null&&It>0?It:0):"";ge.useEffect(()=>{const we=be.current;if(we!=="exiting"){if(Gn)de(Gn),we==="hidden"&&st("entering");else if(we==="visible"||we==="entering"){if(!s&&Bt){const at=Bt;try{window.location.href=at}catch{window.location.assign(at)}gt(null)}st("exiting")}}},[Gn,pt,s,Bt]);const Fi=ge.useCallback(()=>{const we=be.current;we==="entering"?st("visible"):we==="exiting"&&st("hidden")},[]);ge.useLayoutEffect(()=>{const we=Tt.current;we&&(we.scrollTop=we.scrollHeight)},[qt]);const ri=R==="female"?ZF:jF;return _?Jt.jsxs("div",{className:"avatar-widget-container",children:[Jt.jsxs("div",{className:"avatar-input-area",children:[j!=="hidden"?Jt.jsx("div",{className:`avatar-thinking-tab${j==="exiting"?" avatar-thinking-tab--exiting":j==="entering"?" avatar-thinking-tab--entering":""}`,onAnimationEnd:Ia,children:ue===bC?Jt.jsx("a",{href:"https://leads.streamoji.com",target:"_blank",rel:"noopener noreferrer",children:"Made by Streamoji Leads"}):ue}):null,Jt.jsx("div",{className:"avatar-input-container",children:Jt.jsx("div",{style:{display:"flex",alignItems:"center",width:"100%",height:"100%"},children:Pe?Jt.jsxs("div",{className:"avatar-input-recording",children:[Jt.jsx("button",{type:"button",className:"avatar-recording-cancel",onClick:Ct,title:"Cancel",children:Jt.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{display:"block"},children:[Jt.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Jt.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),Jt.jsxs("div",{style:{flex:1,height:"100%",position:"relative",display:"flex",alignItems:"center",minWidth:0},children:[Jt.jsx("div",{style:{flex:1,height:"100%"},children:Jt.jsx(gC,{analyser:te})}),Jt.jsxs("span",{style:{fontSize:"0.75rem",color:"#64748b",fontWeight:500,marginLeft:"4px",minWidth:"32px",textAlign:"right",fontVariantNumeric:"tabular-nums"},children:[Math.floor(ot/60),":",String(ot%60).padStart(2,"0")]})]}),Jt.jsx("button",{type:"button",className:"avatar-recording-confirm",onClick:ct,title:"Send",children:Jt.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{display:"block"},children:Jt.jsx("polyline",{points:"20 6 9 17 4 12"})})})]}):N&&!Sn?Jt.jsxs("div",{className:"avatar-input-speaking",children:[Jt.jsx("div",{style:{flex:1,height:"100%",display:"flex",alignItems:"center",paddingRight:"8px"},children:Jt.jsx(gC,{analyser:ht})}),Jt.jsx("button",{type:"button",className:"avatar-speaking-stop",onClick:()=>Qe(!0),title:"Stop",children:Jt.jsx("span",{className:"avatar-speaking-stop__icon","aria-hidden":!0})})]}):z?Jt.jsx("div",{style:{flex:1,height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:Jt.jsx("div",{className:"avatar-input-loader"})}):Jt.jsxs("form",{onSubmit:zt,style:{flex:1,display:"flex",height:"100%",alignItems:"center"},children:[Jt.jsx("input",{id:"avatar-text-input",type:"text",value:M,onChange:we=>w(we.target.value),placeholder:P==="Busy"?"Assisting another user":ee||"Ask me anything",disabled:z||P==="Busy",autoComplete:"off",style:{width:"100%",height:"100%"}}),P==="Busy"?Jt.jsx("button",{type:"button",className:"mic-button",disabled:!0,style:{backgroundColor:"#1e4a5e"},title:"Agent at capacity",children:Jt.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:Jt.jsx("path",{d:"M4 2L20 2L12 10L4 2z M12 14L4 22L20 22L12 14z",fill:"white"})})}):M.trim()===""?Jt.jsx("button",{type:"button",className:"mic-button",onClick:lt,disabled:z,style:{backgroundColor:"#1e4a5e"},children:Jt.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Jt.jsx("path",{d:"M12 14C13.66 14 15 12.66 15 11V5C15 3.34 13.66 2 12 2C10.34 2 9 3.34 9 5V11C9 12.66 10.34 14 12 14Z",fill:"white"}),Jt.jsx("path",{d:"M17 11C17 13.76 14.76 16 12 16C9.24 16 7 13.76 7 11H5C5 14.53 7.61 17.43 11 17.93V21H13V17.93C16.39 17.43 19 14.53 19 11H17Z",fill:"white"})]})}):Jt.jsx("button",{type:"submit",className:"mic-button",disabled:z,style:{backgroundColor:"#1e4a5e"},title:"Send",children:Jt.jsx("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:Jt.jsx("path",{d:"M19 12H5M19 12L14 17M19 12L14 7",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})})})]}),Jt.jsx("div",{className:"avatar-wrapper",children:Jt.jsxs("div",{className:"avatar-scene-wrapper",children:[pt!=="hidden"&&Jt.jsx("div",{className:`avatar-bubble${pt==="entering"?" avatar-bubble--entering":pt==="exiting"?" avatar-bubble--exiting":""}`,onAnimationEnd:Fi,children:Jt.jsx("div",{ref:Tt,className:`avatar-bubble__content${Sn?" avatar-bubble__content--nudge":""}`,children:qt})}),Jt.jsx("div",{className:"avatar-canvas-layer",style:{width:$,height:$},children:Jt.jsxs(kO,{shadows:!0,camera:{position:[.2,1.4,3],fov:42},gl:{alpha:!0},dpr:1,style:{pointerEvents:"none",width:"100%",height:"100%"},children:[Jt.jsx(s4,{target:ri}),Jt.jsx("ambientLight",{intensity:.7}),Jt.jsx("directionalLight",{position:[0,2,2],intensity:1}),Jt.jsx(rF,{preset:"city"}),Jt.jsx(ge.Suspense,{fallback:null,children:T!==null&&Jt.jsx(r4,{avatarUrl:T,isPlayingRef:ae,visemeQueueRef:Me,audioContextRef:Ne,responseAudioStartTimeRef:Ce,adjustments:WF,mood:Le,expression:rt,agentResponse:D,isSpeaking:N,nextStartTimeRef:tt,stopPlayback:Qe,setIsSpeaking:F,expressionUrl:Kt,onExpressionFinished:ci,isNudgeResponse:Sn,avatarGender:R})})]})})]})})]}):null},c4=({agentId:s,onNavigationRequested:e,presetUserDetails:t,onAvatarReady:n})=>Jt.jsx(l4,{agentId:s,onNavigationRequested:e,presetUserDetails:t,onAvatarReady:n}),RC="streamoji-leads-avatar-widget-root";function wC(s){const{agentId:e}=s;let t=document.getElementById(RC);if(!t){t=document.createElement("div"),t.id=RC,t.style.cssText="position:fixed;bottom:0;right:0;z-index:9999;pointer-events:none;";const i=document.createElement("div");i.style.cssText="pointer-events:auto;",t.appendChild(i),document.body.appendChild(t),t=i}wR.createRoot(t).render(wM.createElement(c4,{agentId:e||""}))}return window.StreamojiLeadsAvatarWidget={init:wC},Hy.init=wC,Object.defineProperty(Hy,Symbol.toStringTag,{value:"Module"}),Hy})({});
4157
+ `);En=Ci.pop()??"";for(const _i of Ci){ua(`[SSE] Processing block: ${_i.slice(0,50)}...`);const ha=mn(_i);ha&&(ua(`[SSE] Event: ${ha.event}`),Pn(ha.event,ha.data))}if(Cn){if(ua("[SSE] Stream finished"),En.trim()){const _i=mn(En.trim());_i&&Pn(_i.event,_i.data)}O("Ready"),V(!1),w("");break}}}catch(ut){console.error("Chat Error:",ut),O("Agent Failed"),V(!1)}},ei=D.trim(),Qi=CC(ei),Gn=Qi&&N?Qi.slice(0,It!=null&&It>0?It:0):"";ge.useEffect(()=>{const we=be.current;if(we!=="exiting"){if(Gn)de(Gn),we==="hidden"&&st("entering");else if(we==="visible"||we==="entering"){if(!s&&Bt){const at=Bt;try{window.location.href=at}catch{window.location.assign(at)}gt(null)}st("exiting")}}},[Gn,pt,s,Bt]);const Fi=ge.useCallback(()=>{const we=be.current;we==="entering"?st("visible"):we==="exiting"&&st("hidden")},[]);ge.useLayoutEffect(()=>{const we=Tt.current;we&&(we.scrollTop=we.scrollHeight)},[qt]);const ri=R==="female"?ZF:jF;return _?Jt.jsxs("div",{className:"avatar-widget-container",children:[Jt.jsxs("div",{className:"avatar-input-area",children:[j!=="hidden"?Jt.jsx("div",{className:`avatar-thinking-tab${j==="exiting"?" avatar-thinking-tab--exiting":j==="entering"?" avatar-thinking-tab--entering":""}`,onAnimationEnd:Ia,children:ue===bC?Jt.jsx("a",{href:"https://leads.streamoji.com",target:"_blank",rel:"noopener noreferrer",children:"Made by Streamoji Leads"}):ue}):null,Jt.jsx("div",{className:"avatar-input-container",children:Jt.jsx("div",{style:{display:"flex",alignItems:"center",width:"100%",height:"100%"},children:Pe?Jt.jsxs("div",{className:"avatar-input-recording",children:[Jt.jsx("button",{type:"button",className:"avatar-recording-cancel",onClick:Ct,title:"Cancel",children:Jt.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{display:"block"},children:[Jt.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Jt.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),Jt.jsxs("div",{style:{flex:1,height:"100%",position:"relative",display:"flex",alignItems:"center",minWidth:0},children:[Jt.jsx("div",{style:{flex:1,height:"100%"},children:Jt.jsx(gC,{analyser:te})}),Jt.jsxs("span",{style:{fontSize:"0.75rem",color:"#64748b",fontWeight:500,marginLeft:"4px",minWidth:"32px",textAlign:"right",fontVariantNumeric:"tabular-nums"},children:[Math.floor(ot/60),":",String(ot%60).padStart(2,"0")]})]}),Jt.jsx("button",{type:"button",className:"avatar-recording-confirm",onClick:ct,title:"Send",children:Jt.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{display:"block"},children:Jt.jsx("polyline",{points:"20 6 9 17 4 12"})})})]}):N&&!Mn?Jt.jsxs("div",{className:"avatar-input-speaking",children:[Jt.jsx("div",{style:{flex:1,height:"100%",display:"flex",alignItems:"center",paddingRight:"8px"},children:Jt.jsx(gC,{analyser:ht})}),Jt.jsx("button",{type:"button",className:"avatar-speaking-stop",onClick:()=>Qe(!0),title:"Stop",children:Jt.jsx("span",{className:"avatar-speaking-stop__icon","aria-hidden":!0})})]}):z?Jt.jsx("div",{style:{flex:1,height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:Jt.jsx("div",{className:"avatar-input-loader"})}):Jt.jsxs("form",{onSubmit:zt,style:{flex:1,display:"flex",height:"100%",alignItems:"center"},children:[Jt.jsx("input",{id:"avatar-text-input",type:"text",value:M,onChange:we=>w(we.target.value),placeholder:P==="Busy"?"Assisting another user":ee||"Ask me anything",disabled:z||P==="Busy",autoComplete:"off",style:{width:"100%",height:"100%"}}),P==="Busy"?Jt.jsx("button",{type:"button",className:"mic-button",disabled:!0,style:{backgroundColor:"#1e4a5e"},title:"Agent at capacity",children:Jt.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:Jt.jsx("path",{d:"M4 2L20 2L12 10L4 2z M12 14L4 22L20 22L12 14z",fill:"white"})})}):M.trim()===""?Jt.jsx("button",{type:"button",className:"mic-button",onClick:lt,disabled:z,style:{backgroundColor:"#1e4a5e"},children:Jt.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Jt.jsx("path",{d:"M12 14C13.66 14 15 12.66 15 11V5C15 3.34 13.66 2 12 2C10.34 2 9 3.34 9 5V11C9 12.66 10.34 14 12 14Z",fill:"white"}),Jt.jsx("path",{d:"M17 11C17 13.76 14.76 16 12 16C9.24 16 7 13.76 7 11H5C5 14.53 7.61 17.43 11 17.93V21H13V17.93C16.39 17.43 19 14.53 19 11H17Z",fill:"white"})]})}):Jt.jsx("button",{type:"submit",className:"mic-button",disabled:z,style:{backgroundColor:"#1e4a5e"},title:"Send",children:Jt.jsx("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:Jt.jsx("path",{d:"M19 12H5M19 12L14 17M19 12L14 7",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})})})]}),Jt.jsx("div",{className:"avatar-wrapper",children:Jt.jsxs("div",{className:"avatar-scene-wrapper",children:[pt!=="hidden"&&Jt.jsx("div",{className:`avatar-bubble${pt==="entering"?" avatar-bubble--entering":pt==="exiting"?" avatar-bubble--exiting":""}`,onAnimationEnd:Fi,children:Jt.jsx("div",{ref:Tt,className:`avatar-bubble__content${Mn?" avatar-bubble__content--nudge":""}`,children:qt})}),Jt.jsx("div",{className:"avatar-canvas-layer",style:{width:$,height:$},children:Jt.jsxs(kO,{shadows:!0,camera:{position:[.2,1.4,3],fov:42},gl:{alpha:!0},dpr:1,style:{pointerEvents:"none",width:"100%",height:"100%"},children:[Jt.jsx(s4,{target:ri}),Jt.jsx("ambientLight",{intensity:.7}),Jt.jsx("directionalLight",{position:[0,2,2],intensity:1}),Jt.jsx(rF,{preset:"city"}),Jt.jsx(ge.Suspense,{fallback:null,children:T!==null&&Jt.jsx(r4,{avatarUrl:T,isPlayingRef:ae,visemeQueueRef:Me,audioContextRef:Ne,responseAudioStartTimeRef:Ce,adjustments:WF,mood:Le,expression:rt,agentResponse:D,isSpeaking:N,nextStartTimeRef:tt,stopPlayback:Qe,setIsSpeaking:F,expressionUrl:Kt,onExpressionFinished:ci,isNudgeResponse:Mn,avatarGender:R})})]})})]})})]}):null},c4=({agentId:s,onNavigationRequested:e,presetUserDetails:t,onAvatarReady:n})=>Jt.jsx(l4,{agentId:s,onNavigationRequested:e,presetUserDetails:t,onAvatarReady:n}),RC="streamoji-leads-avatar-widget-root";function wC(s){const{agentId:e}=s;let t=document.getElementById(RC);if(!t){t=document.createElement("div"),t.id=RC,t.style.cssText="position:fixed;bottom:0;right:0;z-index:9999;pointer-events:none;";const i=document.createElement("div");i.style.cssText="pointer-events:auto;",t.appendChild(i),document.body.appendChild(t),t=i}wR.createRoot(t).render(wM.createElement(c4,{agentId:e||""}))}return window.StreamojiLeadsAvatarWidget={init:wC},Hy.init=wC,Object.defineProperty(Hy,Symbol.toStringTag,{value:"Module"}),Hy})({});