From 2b72b289ee20502f5ac0ebf6146ec9ddd72dfced Mon Sep 17 00:00:00 2001 From: Satyam Mishra Date: Fri, 20 Dec 2024 18:35:07 +0530 Subject: [PATCH] Updates --- .../{index-de4dd922.js => index-79bb26db.js} | 218 +++++++++--------- index.html | 6 +- 2 files changed, 112 insertions(+), 112 deletions(-) rename assets/{index-de4dd922.js => index-79bb26db.js} (93%) diff --git a/assets/index-de4dd922.js b/assets/index-79bb26db.js similarity index 93% rename from assets/index-de4dd922.js rename to assets/index-79bb26db.js index 3f5fa1f..313b14d 100644 --- a/assets/index-de4dd922.js +++ b/assets/index-79bb26db.js @@ -1,4 +1,4 @@ -function OB(n,e){for(var t=0;ti[r]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=t(r);fetch(r.href,s)}})();function kT(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function UB(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(i){var r=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(t,i,r.get?r:{enumerable:!0,get:function(){return n[i]}})}),t}var WN={exports:{}},y_={},jN={exports:{}},$t={};/** +function UB(n,e){for(var t=0;ti[r]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=t(r);fetch(r.href,s)}})();function kT(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function FB(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(i){var r=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(t,i,r.get?r:{enumerable:!0,get:function(){return n[i]}})}),t}var WN={exports:{}},y_={},jN={exports:{}},$t={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ function OB(n,e){for(var t=0;t>>1,Me=W[oe];if(0>>1;oer(we,Z))Ner(be,we)?(W[oe]=be,W[Ne]=Z,oe=Ne):(W[oe]=we,W[he]=Z,oe=he);else if(Ner(be,Z))W[oe]=be,W[Ne]=Z,oe=Ne;else break e}}return J}function r(W,J){var Z=W.sortIndex-J.sortIndex;return Z!==0?Z:W.id-J.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var l=[],c=[],d=1,f=null,p=3,m=!1,_=!1,S=!1,x=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(W){for(var J=t(c);J!==null;){if(J.callback===null)i(c);else if(J.startTime<=W)i(c),J.sortIndex=J.expirationTime,e(l,J);else break;J=t(c)}}function M(W){if(S=!1,w(W),!_)if(t(l)!==null)_=!0,ee(O);else{var J=t(c);J!==null&&pe(M,J.startTime-W)}}function O(W,J){_=!1,S&&(S=!1,y(P),P=-1),m=!0;var Z=p;try{for(w(J),f=t(l);f!==null&&(!(f.expirationTime>J)||W&&!R());){var oe=f.callback;if(typeof oe=="function"){f.callback=null,p=f.priorityLevel;var Me=oe(f.expirationTime<=J);J=n.unstable_now(),typeof Me=="function"?f.callback=Me:f===t(l)&&i(l),w(J)}else i(l);f=t(l)}if(f!==null)var Re=!0;else{var he=t(c);he!==null&&pe(M,he.startTime-J),Re=!1}return Re}finally{f=null,p=Z,m=!1}}var k=!1,I=null,P=-1,D=5,A=-1;function R(){return!(n.unstable_now()-AW||125oe?(W.sortIndex=Z,e(c,W),t(l)===null&&W===t(c)&&(S?(y(P),P=-1):S=!0,pe(M,Z-oe))):(W.sortIndex=Me,e(l,W),_||m||(_=!0,ee(O))),W},n.unstable_shouldYield=R,n.unstable_wrapCallback=function(W){var J=p;return function(){var Z=p;p=J;try{return W.apply(this,arguments)}finally{p=Z}}}})(iD);nD.exports=iD;var oz=nD.exports;/** + */(function(n){function e(W,J){var Z=W.length;W.push(J);e:for(;0>>1,Me=W[oe];if(0>>1;oer(we,Z))Ner(be,we)?(W[oe]=be,W[Ne]=Z,oe=Ne):(W[oe]=we,W[he]=Z,oe=he);else if(Ner(be,Z))W[oe]=be,W[Ne]=Z,oe=Ne;else break e}}return J}function r(W,J){var Z=W.sortIndex-J.sortIndex;return Z!==0?Z:W.id-J.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var l=[],c=[],d=1,f=null,p=3,m=!1,_=!1,S=!1,x=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(W){for(var J=t(c);J!==null;){if(J.callback===null)i(c);else if(J.startTime<=W)i(c),J.sortIndex=J.expirationTime,e(l,J);else break;J=t(c)}}function M(W){if(S=!1,w(W),!_)if(t(l)!==null)_=!0,ee(O);else{var J=t(c);J!==null&&pe(M,J.startTime-W)}}function O(W,J){_=!1,S&&(S=!1,y(P),P=-1),m=!0;var Z=p;try{for(w(J),f=t(l);f!==null&&(!(f.expirationTime>J)||W&&!R());){var oe=f.callback;if(typeof oe=="function"){f.callback=null,p=f.priorityLevel;var Me=oe(f.expirationTime<=J);J=n.unstable_now(),typeof Me=="function"?f.callback=Me:f===t(l)&&i(l),w(J)}else i(l);f=t(l)}if(f!==null)var Re=!0;else{var he=t(c);he!==null&&pe(M,he.startTime-J),Re=!1}return Re}finally{f=null,p=Z,m=!1}}var k=!1,I=null,P=-1,D=5,A=-1;function R(){return!(n.unstable_now()-AW||125oe?(W.sortIndex=Z,e(c,W),t(l)===null&&W===t(c)&&(S?(y(P),P=-1):S=!0,pe(M,Z-oe))):(W.sortIndex=Me,e(l,W),_||m||(_=!0,ee(O))),W},n.unstable_shouldYield=R,n.unstable_wrapCallback=function(W){var J=p;return function(){var Z=p;p=J;try{return W.apply(this,arguments)}finally{p=Z}}}})(iD);nD.exports=iD;var az=nD.exports;/** * @license React * react-dom.production.min.js * @@ -30,14 +30,14 @@ function OB(n,e){for(var t=0;t"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),L1=Object.prototype.hasOwnProperty,lz=/^[: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]*$/,sP={},oP={};function cz(n){return L1.call(oP,n)?!0:L1.call(sP,n)?!1:lz.test(n)?oP[n]=!0:(sP[n]=!0,!1)}function uz(n,e,t,i){if(t!==null&&t.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return i?!1:t!==null?!t.acceptsBooleans:(n=n.toLowerCase().slice(0,5),n!=="data-"&&n!=="aria-");default:return!1}}function hz(n,e,t,i){if(e===null||typeof e>"u"||uz(n,e,t,i))return!0;if(i)return!1;if(t!==null)switch(t.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Sr(n,e,t,i,r,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=i,this.attributeNamespace=r,this.mustUseProperty=t,this.propertyName=n,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var Di={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){Di[n]=new Sr(n,0,!1,n,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(n){var e=n[0];Di[e]=new Sr(e,1,!1,n[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(n){Di[n]=new Sr(n,2,!1,n.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){Di[n]=new Sr(n,2,!1,n,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(n){Di[n]=new Sr(n,3,!1,n.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(n){Di[n]=new Sr(n,3,!0,n,null,!1,!1)});["capture","download"].forEach(function(n){Di[n]=new Sr(n,4,!1,n,null,!1,!1)});["cols","rows","size","span"].forEach(function(n){Di[n]=new Sr(n,6,!1,n,null,!1,!1)});["rowSpan","start"].forEach(function(n){Di[n]=new Sr(n,5,!1,n.toLowerCase(),null,!1,!1)});var BT=/[\-:]([a-z])/g;function zT(n){return n[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(n){var e=n.replace(BT,zT);Di[e]=new Sr(e,1,!1,n,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(n){var e=n.replace(BT,zT);Di[e]=new Sr(e,1,!1,n,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(n){var e=n.replace(BT,zT);Di[e]=new Sr(e,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(n){Di[n]=new Sr(n,1,!1,n.toLowerCase(),null,!1,!1)});Di.xlinkHref=new Sr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(n){Di[n]=new Sr(n,1,!1,n.toLowerCase(),null,!0,!0)});function HT(n,e,t,i){var r=Di.hasOwnProperty(e)?Di[e]:null;(r!==null?r.type!==0:i||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),L1=Object.prototype.hasOwnProperty,cz=/^[: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]*$/,sP={},oP={};function uz(n){return L1.call(oP,n)?!0:L1.call(sP,n)?!1:cz.test(n)?oP[n]=!0:(sP[n]=!0,!1)}function hz(n,e,t,i){if(t!==null&&t.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return i?!1:t!==null?!t.acceptsBooleans:(n=n.toLowerCase().slice(0,5),n!=="data-"&&n!=="aria-");default:return!1}}function dz(n,e,t,i){if(e===null||typeof e>"u"||hz(n,e,t,i))return!0;if(i)return!1;if(t!==null)switch(t.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Sr(n,e,t,i,r,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=i,this.attributeNamespace=r,this.mustUseProperty=t,this.propertyName=n,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var Di={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){Di[n]=new Sr(n,0,!1,n,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(n){var e=n[0];Di[e]=new Sr(e,1,!1,n[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(n){Di[n]=new Sr(n,2,!1,n.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){Di[n]=new Sr(n,2,!1,n,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(n){Di[n]=new Sr(n,3,!1,n.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(n){Di[n]=new Sr(n,3,!0,n,null,!1,!1)});["capture","download"].forEach(function(n){Di[n]=new Sr(n,4,!1,n,null,!1,!1)});["cols","rows","size","span"].forEach(function(n){Di[n]=new Sr(n,6,!1,n,null,!1,!1)});["rowSpan","start"].forEach(function(n){Di[n]=new Sr(n,5,!1,n.toLowerCase(),null,!1,!1)});var BT=/[\-:]([a-z])/g;function zT(n){return n[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(n){var e=n.replace(BT,zT);Di[e]=new Sr(e,1,!1,n,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(n){var e=n.replace(BT,zT);Di[e]=new Sr(e,1,!1,n,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(n){var e=n.replace(BT,zT);Di[e]=new Sr(e,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(n){Di[n]=new Sr(n,1,!1,n.toLowerCase(),null,!1,!1)});Di.xlinkHref=new Sr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(n){Di[n]=new Sr(n,1,!1,n.toLowerCase(),null,!0,!0)});function HT(n,e,t,i){var r=Di.hasOwnProperty(e)?Di[e]:null;(r!==null?r.type!==0:i||!(2a||r[o]!==s[a]){var l=` -`+r[o].replace(" at new "," at ");return n.displayName&&l.includes("")&&(l=l.replace("",n.displayName)),l}while(1<=o&&0<=a);break}}}finally{OS=!1,Error.prepareStackTrace=t}return(n=n?n.displayName||n.name:"")?Vf(n):""}function dz(n){switch(n.tag){case 5:return Vf(n.type);case 16:return Vf("Lazy");case 13:return Vf("Suspense");case 19:return Vf("SuspenseList");case 0:case 2:case 15:return n=US(n.type,!1),n;case 11:return n=US(n.type.render,!1),n;case 1:return n=US(n.type,!0),n;default:return""}}function O1(n){if(n==null)return null;if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case ph:return"Fragment";case fh:return"Portal";case N1:return"Profiler";case GT:return"StrictMode";case D1:return"Suspense";case k1:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case oD:return(n.displayName||"Context")+".Consumer";case sD:return(n._context.displayName||"Context")+".Provider";case WT:var e=n.render;return n=n.displayName,n||(n=e.displayName||e.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case jT:return e=n.displayName||null,e!==null?e:O1(n.type)||"Memo";case qa:e=n._payload,n=n._init;try{return O1(n(e))}catch{}}return null}function fz(n){var e=n.type;switch(n.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return n=e.render,n=n.displayName||n.name||"",e.displayName||(n!==""?"ForwardRef("+n+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return O1(e);case 8:return e===GT?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function El(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function lD(n){var e=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function pz(n){var e=lD(n)?"checked":"value",t=Object.getOwnPropertyDescriptor(n.constructor.prototype,e),i=""+n[e];if(!n.hasOwnProperty(e)&&typeof t<"u"&&typeof t.get=="function"&&typeof t.set=="function"){var r=t.get,s=t.set;return Object.defineProperty(n,e,{configurable:!0,get:function(){return r.call(this)},set:function(o){i=""+o,s.call(this,o)}}),Object.defineProperty(n,e,{enumerable:t.enumerable}),{getValue:function(){return i},setValue:function(o){i=""+o},stopTracking:function(){n._valueTracker=null,delete n[e]}}}}function Hg(n){n._valueTracker||(n._valueTracker=pz(n))}function cD(n){if(!n)return!1;var e=n._valueTracker;if(!e)return!0;var t=e.getValue(),i="";return n&&(i=lD(n)?n.checked?"true":"false":n.value),n=i,n!==t?(e.setValue(n),!0):!1}function kv(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}function U1(n,e){var t=e.checked;return Hn({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t??n._wrapperState.initialChecked})}function lP(n,e){var t=e.defaultValue==null?"":e.defaultValue,i=e.checked!=null?e.checked:e.defaultChecked;t=El(e.value!=null?e.value:t),n._wrapperState={initialChecked:i,initialValue:t,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function uD(n,e){e=e.checked,e!=null&&HT(n,"checked",e,!1)}function F1(n,e){uD(n,e);var t=El(e.value),i=e.type;if(t!=null)i==="number"?(t===0&&n.value===""||n.value!=t)&&(n.value=""+t):n.value!==""+t&&(n.value=""+t);else if(i==="submit"||i==="reset"){n.removeAttribute("value");return}e.hasOwnProperty("value")?V1(n,e.type,t):e.hasOwnProperty("defaultValue")&&V1(n,e.type,El(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(n.defaultChecked=!!e.defaultChecked)}function cP(n,e,t){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var i=e.type;if(!(i!=="submit"&&i!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+n._wrapperState.initialValue,t||e===n.value||(n.value=e),n.defaultValue=e}t=n.name,t!==""&&(n.name=""),n.defaultChecked=!!n._wrapperState.initialChecked,t!==""&&(n.name=t)}function V1(n,e,t){(e!=="number"||kv(n.ownerDocument)!==n)&&(t==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+t&&(n.defaultValue=""+t))}var Bf=Array.isArray;function Uh(n,e,t,i){if(n=n.options,e){e={};for(var r=0;r"+e.valueOf().toString()+"",e=Gg.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;e.firstChild;)n.appendChild(e.firstChild)}});function Mp(n,e){if(e){var t=n.firstChild;if(t&&t===n.lastChild&&t.nodeType===3){t.nodeValue=e;return}}n.textContent=e}var Qf={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},mz=["Webkit","ms","Moz","O"];Object.keys(Qf).forEach(function(n){mz.forEach(function(e){e=e+n.charAt(0).toUpperCase()+n.substring(1),Qf[e]=Qf[n]})});function pD(n,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||Qf.hasOwnProperty(n)&&Qf[n]?(""+e).trim():e+"px"}function mD(n,e){n=n.style;for(var t in e)if(e.hasOwnProperty(t)){var i=t.indexOf("--")===0,r=pD(t,e[t],i);t==="float"&&(t="cssFloat"),i?n.setProperty(t,r):n[t]=r}}var gz=Hn({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function H1(n,e){if(e){if(gz[n]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(De(137,n));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(De(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(De(61))}if(e.style!=null&&typeof e.style!="object")throw Error(De(62))}}function G1(n,e){if(n.indexOf("-")===-1)return typeof e.is=="string";switch(n){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var W1=null;function XT(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var j1=null,Fh=null,Vh=null;function dP(n){if(n=Am(n)){if(typeof j1!="function")throw Error(De(280));var e=n.stateNode;e&&(e=E_(e),j1(n.stateNode,n.type,e))}}function gD(n){Fh?Vh?Vh.push(n):Vh=[n]:Fh=n}function yD(){if(Fh){var n=Fh,e=Vh;if(Vh=Fh=null,dP(n),e)for(n=0;n>>=0,n===0?32:31-(Cz(n)/bz|0)|0}var Wg=64,jg=4194304;function zf(n){switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return n&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return n}}function Vv(n,e){var t=n.pendingLanes;if(t===0)return 0;var i=0,r=n.suspendedLanes,s=n.pingedLanes,o=t&268435455;if(o!==0){var a=o&~r;a!==0?i=zf(a):(s&=o,s!==0&&(i=zf(s)))}else o=t&~r,o!==0?i=zf(o):s!==0&&(i=zf(s));if(i===0)return 0;if(e!==0&&e!==i&&!(e&r)&&(r=i&-i,s=e&-e,r>=s||r===16&&(s&4194240)!==0))return e;if(i&4&&(i|=t&16),e=n.entangledLanes,e!==0)for(n=n.entanglements,e&=i;0t;t++)e.push(n);return e}function Em(n,e,t){n.pendingLanes|=e,e!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,e=31-Hs(e),n[e]=t}function Lz(n,e){var t=n.pendingLanes&~e;n.pendingLanes=e,n.suspendedLanes=0,n.pingedLanes=0,n.expiredLanes&=e,n.mutableReadLanes&=e,n.entangledLanes&=e,e=n.entanglements;var i=n.eventTimes;for(n=n.expirationTimes;0=Zf),SP=String.fromCharCode(32),wP=!1;function UD(n,e){switch(n){case"keyup":return o5.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function FD(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var mh=!1;function l5(n,e){switch(n){case"compositionend":return FD(e);case"keypress":return e.which!==32?null:(wP=!0,SP);case"textInput":return n=e.data,n===SP&&wP?null:n;default:return null}}function c5(n,e){if(mh)return n==="compositionend"||!eA&&UD(n,e)?(n=kD(),dv=QT=il=null,mh=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:t,offset:e-n};n=i}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=MP(t)}}function HD(n,e){return n&&e?n===e?!0:n&&n.nodeType===3?!1:e&&e.nodeType===3?HD(n,e.parentNode):"contains"in n?n.contains(e):n.compareDocumentPosition?!!(n.compareDocumentPosition(e)&16):!1:!1}function GD(){for(var n=window,e=kv();e instanceof n.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch{t=!1}if(t)n=e.contentWindow;else break;e=kv(n.document)}return e}function tA(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e&&(e==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||e==="textarea"||n.contentEditable==="true")}function v5(n){var e=GD(),t=n.focusedElem,i=n.selectionRange;if(e!==t&&t&&t.ownerDocument&&HD(t.ownerDocument.documentElement,t)){if(i!==null&&tA(t)){if(e=i.start,n=i.end,n===void 0&&(n=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(n,t.value.length);else if(n=(e=t.ownerDocument||document)&&e.defaultView||window,n.getSelection){n=n.getSelection();var r=t.textContent.length,s=Math.min(i.start,r);i=i.end===void 0?s:Math.min(i.end,r),!n.extend&&s>i&&(r=i,i=s,s=r),r=CP(t,s);var o=CP(t,i);r&&o&&(n.rangeCount!==1||n.anchorNode!==r.node||n.anchorOffset!==r.offset||n.focusNode!==o.node||n.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(r.node,r.offset),n.removeAllRanges(),s>i?(n.addRange(e),n.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),n.addRange(e)))}}for(e=[],n=t;n=n.parentNode;)n.nodeType===1&&e.push({element:n,left:n.scrollLeft,top:n.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t=document.documentMode,gh=null,Q1=null,tp=null,J1=!1;function bP(n,e,t){var i=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;J1||gh==null||gh!==kv(i)||(i=gh,"selectionStart"in i&&tA(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),tp&&Lp(tp,i)||(tp=i,i=Hv(Q1,"onSelect"),0_h||(n.current=rE[_h],rE[_h]=null,_h--)}function An(n,e){_h++,rE[_h]=n.current,n.current=e}var Tl={},rr=Nl(Tl),Or=Nl(!1),Jc=Tl;function Qh(n,e){var t=n.type.contextTypes;if(!t)return Tl;var i=n.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===e)return i.__reactInternalMemoizedMaskedChildContext;var r={},s;for(s in t)r[s]=e[s];return i&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=e,n.__reactInternalMemoizedMaskedChildContext=r),r}function Ur(n){return n=n.childContextTypes,n!=null}function Wv(){Rn(Or),Rn(rr)}function kP(n,e,t){if(rr.current!==Tl)throw Error(De(168));An(rr,e),An(Or,t)}function JD(n,e,t){var i=n.stateNode;if(e=e.childContextTypes,typeof i.getChildContext!="function")return t;i=i.getChildContext();for(var r in i)if(!(r in e))throw Error(De(108,fz(n)||"Unknown",r));return Hn({},t,i)}function jv(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||Tl,Jc=rr.current,An(rr,n),An(Or,Or.current),!0}function OP(n,e,t){var i=n.stateNode;if(!i)throw Error(De(169));t?(n=JD(n,e,Jc),i.__reactInternalMemoizedMergedChildContext=n,Rn(Or),Rn(rr),An(rr,n)):Rn(Or),An(Or,t)}var Go=null,T_=!1,QS=!1;function ZD(n){Go===null?Go=[n]:Go.push(n)}function R5(n){T_=!0,ZD(n)}function Dl(){if(!QS&&Go!==null){QS=!0;var n=0,e=yn;try{var t=Go;for(yn=1;n>=o,r-=o,qo=1<<32-Hs(e)+r|t<P?(D=I,I=null):D=I.sibling;var A=p(y,I,w[P],M);if(A===null){I===null&&(I=D);break}n&&I&&A.alternate===null&&e(y,I),E=s(A,E,P),k===null?O=A:k.sibling=A,k=A,I=D}if(P===w.length)return t(y,I),Nn&&Sc(y,P),O;if(I===null){for(;PP?(D=I,I=null):D=I.sibling;var R=p(y,I,A.value,M);if(R===null){I===null&&(I=D);break}n&&I&&R.alternate===null&&e(y,I),E=s(R,E,P),k===null?O=R:k.sibling=R,k=R,I=D}if(A.done)return t(y,I),Nn&&Sc(y,P),O;if(I===null){for(;!A.done;P++,A=w.next())A=f(y,A.value,M),A!==null&&(E=s(A,E,P),k===null?O=A:k.sibling=A,k=A);return Nn&&Sc(y,P),O}for(I=i(y,I);!A.done;P++,A=w.next())A=m(I,y,P,A.value,M),A!==null&&(n&&A.alternate!==null&&I.delete(A.key===null?P:A.key),E=s(A,E,P),k===null?O=A:k.sibling=A,k=A);return n&&I.forEach(function(V){return e(y,V)}),Nn&&Sc(y,P),O}function x(y,E,w,M){if(typeof w=="object"&&w!==null&&w.type===ph&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case zg:e:{for(var O=w.key,k=E;k!==null;){if(k.key===O){if(O=w.type,O===ph){if(k.tag===7){t(y,k.sibling),E=r(k,w.props.children),E.return=y,y=E;break e}}else if(k.elementType===O||typeof O=="object"&&O!==null&&O.$$typeof===qa&&VP(O)===k.type){t(y,k.sibling),E=r(k,w.props),E.ref=mf(y,k,w),E.return=y,y=E;break e}t(y,k);break}else e(y,k);k=k.sibling}w.type===ph?(E=Gc(w.props.children,y.mode,M,w.key),E.return=y,y=E):(M=xv(w.type,w.key,w.props,null,y.mode,M),M.ref=mf(y,E,w),M.return=y,y=M)}return o(y);case fh:e:{for(k=w.key;E!==null;){if(E.key===k)if(E.tag===4&&E.stateNode.containerInfo===w.containerInfo&&E.stateNode.implementation===w.implementation){t(y,E.sibling),E=r(E,w.children||[]),E.return=y,y=E;break e}else{t(y,E);break}else e(y,E);E=E.sibling}E=sw(w,y.mode,M),E.return=y,y=E}return o(y);case qa:return k=w._init,x(y,E,k(w._payload),M)}if(Bf(w))return _(y,E,w,M);if(uf(w))return S(y,E,w,M);Jg(y,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,E!==null&&E.tag===6?(t(y,E.sibling),E=r(E,w),E.return=y,y=E):(t(y,E),E=rw(w,y.mode,M),E.return=y,y=E),o(y)):t(y,E)}return x}var Zh=i3(!0),r3=i3(!1),$v=Nl(null),Yv=null,wh=null,sA=null;function oA(){sA=wh=Yv=null}function aA(n){var e=$v.current;Rn($v),n._currentValue=e}function aE(n,e,t){for(;n!==null;){var i=n.alternate;if((n.childLanes&e)!==e?(n.childLanes|=e,i!==null&&(i.childLanes|=e)):i!==null&&(i.childLanes&e)!==e&&(i.childLanes|=e),n===t)break;n=n.return}}function zh(n,e){Yv=n,sA=wh=null,n=n.dependencies,n!==null&&n.firstContext!==null&&(n.lanes&e&&(Dr=!0),n.firstContext=null)}function As(n){var e=n._currentValue;if(sA!==n)if(n={context:n,memoizedValue:e,next:null},wh===null){if(Yv===null)throw Error(De(308));wh=n,Yv.dependencies={lanes:0,firstContext:n}}else wh=wh.next=n;return e}var Nc=null;function lA(n){Nc===null?Nc=[n]:Nc.push(n)}function s3(n,e,t,i){var r=e.interleaved;return r===null?(t.next=t,lA(e)):(t.next=r.next,r.next=t),e.interleaved=t,aa(n,i)}function aa(n,e){n.lanes|=e;var t=n.alternate;for(t!==null&&(t.lanes|=e),t=n,n=n.return;n!==null;)n.childLanes|=e,t=n.alternate,t!==null&&(t.childLanes|=e),t=n,n=n.return;return t.tag===3?t.stateNode:null}var $a=!1;function cA(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function o3(n,e){n=n.updateQueue,e.updateQueue===n&&(e.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,effects:n.effects})}function ta(n,e){return{eventTime:n,lane:e,tag:0,payload:null,callback:null,next:null}}function dl(n,e,t){var i=n.updateQueue;if(i===null)return null;if(i=i.shared,on&2){var r=i.pending;return r===null?e.next=e:(e.next=r.next,r.next=e),i.pending=e,aa(n,t)}return r=i.interleaved,r===null?(e.next=e,lA(i)):(e.next=r.next,r.next=e),i.interleaved=e,aa(n,t)}function pv(n,e,t){if(e=e.updateQueue,e!==null&&(e=e.shared,(t&4194240)!==0)){var i=e.lanes;i&=n.pendingLanes,t|=i,e.lanes=t,$T(n,t)}}function BP(n,e){var t=n.updateQueue,i=n.alternate;if(i!==null&&(i=i.updateQueue,t===i)){var r=null,s=null;if(t=t.firstBaseUpdate,t!==null){do{var o={eventTime:t.eventTime,lane:t.lane,tag:t.tag,payload:t.payload,callback:t.callback,next:null};s===null?r=s=o:s=s.next=o,t=t.next}while(t!==null);s===null?r=s=e:s=s.next=e}else r=s=e;t={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:s,shared:i.shared,effects:i.effects},n.updateQueue=t;return}n=t.lastBaseUpdate,n===null?t.firstBaseUpdate=e:n.next=e,t.lastBaseUpdate=e}function Kv(n,e,t,i){var r=n.updateQueue;$a=!1;var s=r.firstBaseUpdate,o=r.lastBaseUpdate,a=r.shared.pending;if(a!==null){r.shared.pending=null;var l=a,c=l.next;l.next=null,o===null?s=c:o.next=c,o=l;var d=n.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==o&&(a===null?d.firstBaseUpdate=c:a.next=c,d.lastBaseUpdate=l))}if(s!==null){var f=r.baseState;o=0,d=c=l=null,a=s;do{var p=a.lane,m=a.eventTime;if((i&p)===p){d!==null&&(d=d.next={eventTime:m,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var _=n,S=a;switch(p=e,m=t,S.tag){case 1:if(_=S.payload,typeof _=="function"){f=_.call(m,f,p);break e}f=_;break e;case 3:_.flags=_.flags&-65537|128;case 0:if(_=S.payload,p=typeof _=="function"?_.call(m,f,p):_,p==null)break e;f=Hn({},f,p);break e;case 2:$a=!0}}a.callback!==null&&a.lane!==0&&(n.flags|=64,p=r.effects,p===null?r.effects=[a]:p.push(a))}else m={eventTime:m,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(c=d=m,l=f):d=d.next=m,o|=p;if(a=a.next,a===null){if(a=r.shared.pending,a===null)break;p=a,a=p.next,p.next=null,r.lastBaseUpdate=p,r.shared.pending=null}}while(1);if(d===null&&(l=f),r.baseState=l,r.firstBaseUpdate=c,r.lastBaseUpdate=d,e=r.shared.interleaved,e!==null){r=e;do o|=r.lane,r=r.next;while(r!==e)}else s===null&&(r.shared.lanes=0);tu|=o,n.lanes=o,n.memoizedState=f}}function zP(n,e,t){if(n=e.effects,e.effects=null,n!==null)for(e=0;et?t:4,n(!0);var i=ZS.transition;ZS.transition={};try{n(!1),e()}finally{yn=t,ZS.transition=i}}function E3(){return Ms().memoizedState}function D5(n,e,t){var i=pl(n);if(t={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null},T3(n))A3(e,t);else if(t=s3(n,e,t,i),t!==null){var r=gr();Gs(t,n,i,r),M3(t,e,i)}}function k5(n,e,t){var i=pl(n),r={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null};if(T3(n))A3(e,r);else{var s=n.alternate;if(n.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,t);if(r.hasEagerState=!0,r.eagerState=a,Ws(a,o)){var l=e.interleaved;l===null?(r.next=r,lA(e)):(r.next=l.next,l.next=r),e.interleaved=r;return}}catch{}finally{}t=s3(n,e,r,i),t!==null&&(r=gr(),Gs(t,n,i,r),M3(t,e,i))}}function T3(n){var e=n.alternate;return n===zn||e!==null&&e===zn}function A3(n,e){np=Jv=!0;var t=n.pending;t===null?e.next=e:(e.next=t.next,t.next=e),n.pending=e}function M3(n,e,t){if(t&4194240){var i=e.lanes;i&=n.pendingLanes,t|=i,e.lanes=t,$T(n,t)}}var Zv={readContext:As,useCallback:Wi,useContext:Wi,useEffect:Wi,useImperativeHandle:Wi,useInsertionEffect:Wi,useLayoutEffect:Wi,useMemo:Wi,useReducer:Wi,useRef:Wi,useState:Wi,useDebugValue:Wi,useDeferredValue:Wi,useTransition:Wi,useMutableSource:Wi,useSyncExternalStore:Wi,useId:Wi,unstable_isNewReconciler:!1},O5={readContext:As,useCallback:function(n,e){return ao().memoizedState=[n,e===void 0?null:e],n},useContext:As,useEffect:GP,useImperativeHandle:function(n,e,t){return t=t!=null?t.concat([n]):null,gv(4194308,4,v3.bind(null,e,n),t)},useLayoutEffect:function(n,e){return gv(4194308,4,n,e)},useInsertionEffect:function(n,e){return gv(4,2,n,e)},useMemo:function(n,e){var t=ao();return e=e===void 0?null:e,n=n(),t.memoizedState=[n,e],n},useReducer:function(n,e,t){var i=ao();return e=t!==void 0?t(e):e,i.memoizedState=i.baseState=e,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:e},i.queue=n,n=n.dispatch=D5.bind(null,zn,n),[i.memoizedState,n]},useRef:function(n){var e=ao();return n={current:n},e.memoizedState=n},useState:HP,useDebugValue:yA,useDeferredValue:function(n){return ao().memoizedState=n},useTransition:function(){var n=HP(!1),e=n[0];return n=N5.bind(null,n[1]),ao().memoizedState=n,[e,n]},useMutableSource:function(){},useSyncExternalStore:function(n,e,t){var i=zn,r=ao();if(Nn){if(t===void 0)throw Error(De(407));t=t()}else{if(t=e(),Mi===null)throw Error(De(349));eu&30||u3(i,e,t)}r.memoizedState=t;var s={value:t,getSnapshot:e};return r.queue=s,GP(d3.bind(null,i,s,n),[n]),i.flags|=2048,Bp(9,h3.bind(null,i,s,t,e),void 0,null),t},useId:function(){var n=ao(),e=Mi.identifierPrefix;if(Nn){var t=$o,i=qo;t=(i&~(1<<32-Hs(i)-1)).toString(32)+t,e=":"+e+"R"+t,t=Fp++,0")&&(l=l.replace("",n.displayName)),l}while(1<=o&&0<=a);break}}}finally{OS=!1,Error.prepareStackTrace=t}return(n=n?n.displayName||n.name:"")?Vf(n):""}function fz(n){switch(n.tag){case 5:return Vf(n.type);case 16:return Vf("Lazy");case 13:return Vf("Suspense");case 19:return Vf("SuspenseList");case 0:case 2:case 15:return n=US(n.type,!1),n;case 11:return n=US(n.type.render,!1),n;case 1:return n=US(n.type,!0),n;default:return""}}function O1(n){if(n==null)return null;if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case ph:return"Fragment";case fh:return"Portal";case N1:return"Profiler";case GT:return"StrictMode";case D1:return"Suspense";case k1:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case oD:return(n.displayName||"Context")+".Consumer";case sD:return(n._context.displayName||"Context")+".Provider";case WT:var e=n.render;return n=n.displayName,n||(n=e.displayName||e.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case jT:return e=n.displayName||null,e!==null?e:O1(n.type)||"Memo";case qa:e=n._payload,n=n._init;try{return O1(n(e))}catch{}}return null}function pz(n){var e=n.type;switch(n.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return n=e.render,n=n.displayName||n.name||"",e.displayName||(n!==""?"ForwardRef("+n+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return O1(e);case 8:return e===GT?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function El(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function lD(n){var e=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function mz(n){var e=lD(n)?"checked":"value",t=Object.getOwnPropertyDescriptor(n.constructor.prototype,e),i=""+n[e];if(!n.hasOwnProperty(e)&&typeof t<"u"&&typeof t.get=="function"&&typeof t.set=="function"){var r=t.get,s=t.set;return Object.defineProperty(n,e,{configurable:!0,get:function(){return r.call(this)},set:function(o){i=""+o,s.call(this,o)}}),Object.defineProperty(n,e,{enumerable:t.enumerable}),{getValue:function(){return i},setValue:function(o){i=""+o},stopTracking:function(){n._valueTracker=null,delete n[e]}}}}function Hg(n){n._valueTracker||(n._valueTracker=mz(n))}function cD(n){if(!n)return!1;var e=n._valueTracker;if(!e)return!0;var t=e.getValue(),i="";return n&&(i=lD(n)?n.checked?"true":"false":n.value),n=i,n!==t?(e.setValue(n),!0):!1}function kv(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}function U1(n,e){var t=e.checked;return Hn({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t??n._wrapperState.initialChecked})}function lP(n,e){var t=e.defaultValue==null?"":e.defaultValue,i=e.checked!=null?e.checked:e.defaultChecked;t=El(e.value!=null?e.value:t),n._wrapperState={initialChecked:i,initialValue:t,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function uD(n,e){e=e.checked,e!=null&&HT(n,"checked",e,!1)}function F1(n,e){uD(n,e);var t=El(e.value),i=e.type;if(t!=null)i==="number"?(t===0&&n.value===""||n.value!=t)&&(n.value=""+t):n.value!==""+t&&(n.value=""+t);else if(i==="submit"||i==="reset"){n.removeAttribute("value");return}e.hasOwnProperty("value")?V1(n,e.type,t):e.hasOwnProperty("defaultValue")&&V1(n,e.type,El(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(n.defaultChecked=!!e.defaultChecked)}function cP(n,e,t){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var i=e.type;if(!(i!=="submit"&&i!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+n._wrapperState.initialValue,t||e===n.value||(n.value=e),n.defaultValue=e}t=n.name,t!==""&&(n.name=""),n.defaultChecked=!!n._wrapperState.initialChecked,t!==""&&(n.name=t)}function V1(n,e,t){(e!=="number"||kv(n.ownerDocument)!==n)&&(t==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+t&&(n.defaultValue=""+t))}var Bf=Array.isArray;function Uh(n,e,t,i){if(n=n.options,e){e={};for(var r=0;r"+e.valueOf().toString()+"",e=Gg.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;e.firstChild;)n.appendChild(e.firstChild)}});function Mp(n,e){if(e){var t=n.firstChild;if(t&&t===n.lastChild&&t.nodeType===3){t.nodeValue=e;return}}n.textContent=e}var Qf={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},gz=["Webkit","ms","Moz","O"];Object.keys(Qf).forEach(function(n){gz.forEach(function(e){e=e+n.charAt(0).toUpperCase()+n.substring(1),Qf[e]=Qf[n]})});function pD(n,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||Qf.hasOwnProperty(n)&&Qf[n]?(""+e).trim():e+"px"}function mD(n,e){n=n.style;for(var t in e)if(e.hasOwnProperty(t)){var i=t.indexOf("--")===0,r=pD(t,e[t],i);t==="float"&&(t="cssFloat"),i?n.setProperty(t,r):n[t]=r}}var yz=Hn({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function H1(n,e){if(e){if(yz[n]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(De(137,n));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(De(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(De(61))}if(e.style!=null&&typeof e.style!="object")throw Error(De(62))}}function G1(n,e){if(n.indexOf("-")===-1)return typeof e.is=="string";switch(n){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var W1=null;function XT(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var j1=null,Fh=null,Vh=null;function dP(n){if(n=Am(n)){if(typeof j1!="function")throw Error(De(280));var e=n.stateNode;e&&(e=E_(e),j1(n.stateNode,n.type,e))}}function gD(n){Fh?Vh?Vh.push(n):Vh=[n]:Fh=n}function yD(){if(Fh){var n=Fh,e=Vh;if(Vh=Fh=null,dP(n),e)for(n=0;n>>=0,n===0?32:31-(bz(n)/Pz|0)|0}var Wg=64,jg=4194304;function zf(n){switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return n&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return n}}function Vv(n,e){var t=n.pendingLanes;if(t===0)return 0;var i=0,r=n.suspendedLanes,s=n.pingedLanes,o=t&268435455;if(o!==0){var a=o&~r;a!==0?i=zf(a):(s&=o,s!==0&&(i=zf(s)))}else o=t&~r,o!==0?i=zf(o):s!==0&&(i=zf(s));if(i===0)return 0;if(e!==0&&e!==i&&!(e&r)&&(r=i&-i,s=e&-e,r>=s||r===16&&(s&4194240)!==0))return e;if(i&4&&(i|=t&16),e=n.entangledLanes,e!==0)for(n=n.entanglements,e&=i;0t;t++)e.push(n);return e}function Em(n,e,t){n.pendingLanes|=e,e!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,e=31-Hs(e),n[e]=t}function Nz(n,e){var t=n.pendingLanes&~e;n.pendingLanes=e,n.suspendedLanes=0,n.pingedLanes=0,n.expiredLanes&=e,n.mutableReadLanes&=e,n.entangledLanes&=e,e=n.entanglements;var i=n.eventTimes;for(n=n.expirationTimes;0=Zf),SP=String.fromCharCode(32),wP=!1;function UD(n,e){switch(n){case"keyup":return a5.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function FD(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var mh=!1;function c5(n,e){switch(n){case"compositionend":return FD(e);case"keypress":return e.which!==32?null:(wP=!0,SP);case"textInput":return n=e.data,n===SP&&wP?null:n;default:return null}}function u5(n,e){if(mh)return n==="compositionend"||!eA&&UD(n,e)?(n=kD(),dv=QT=il=null,mh=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:t,offset:e-n};n=i}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=MP(t)}}function HD(n,e){return n&&e?n===e?!0:n&&n.nodeType===3?!1:e&&e.nodeType===3?HD(n,e.parentNode):"contains"in n?n.contains(e):n.compareDocumentPosition?!!(n.compareDocumentPosition(e)&16):!1:!1}function GD(){for(var n=window,e=kv();e instanceof n.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch{t=!1}if(t)n=e.contentWindow;else break;e=kv(n.document)}return e}function tA(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e&&(e==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||e==="textarea"||n.contentEditable==="true")}function _5(n){var e=GD(),t=n.focusedElem,i=n.selectionRange;if(e!==t&&t&&t.ownerDocument&&HD(t.ownerDocument.documentElement,t)){if(i!==null&&tA(t)){if(e=i.start,n=i.end,n===void 0&&(n=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(n,t.value.length);else if(n=(e=t.ownerDocument||document)&&e.defaultView||window,n.getSelection){n=n.getSelection();var r=t.textContent.length,s=Math.min(i.start,r);i=i.end===void 0?s:Math.min(i.end,r),!n.extend&&s>i&&(r=i,i=s,s=r),r=CP(t,s);var o=CP(t,i);r&&o&&(n.rangeCount!==1||n.anchorNode!==r.node||n.anchorOffset!==r.offset||n.focusNode!==o.node||n.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(r.node,r.offset),n.removeAllRanges(),s>i?(n.addRange(e),n.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),n.addRange(e)))}}for(e=[],n=t;n=n.parentNode;)n.nodeType===1&&e.push({element:n,left:n.scrollLeft,top:n.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t=document.documentMode,gh=null,Q1=null,tp=null,J1=!1;function bP(n,e,t){var i=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;J1||gh==null||gh!==kv(i)||(i=gh,"selectionStart"in i&&tA(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),tp&&Lp(tp,i)||(tp=i,i=Hv(Q1,"onSelect"),0_h||(n.current=rE[_h],rE[_h]=null,_h--)}function An(n,e){_h++,rE[_h]=n.current,n.current=e}var Tl={},rr=Nl(Tl),Or=Nl(!1),Jc=Tl;function Qh(n,e){var t=n.type.contextTypes;if(!t)return Tl;var i=n.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===e)return i.__reactInternalMemoizedMaskedChildContext;var r={},s;for(s in t)r[s]=e[s];return i&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=e,n.__reactInternalMemoizedMaskedChildContext=r),r}function Ur(n){return n=n.childContextTypes,n!=null}function Wv(){Rn(Or),Rn(rr)}function kP(n,e,t){if(rr.current!==Tl)throw Error(De(168));An(rr,e),An(Or,t)}function JD(n,e,t){var i=n.stateNode;if(e=e.childContextTypes,typeof i.getChildContext!="function")return t;i=i.getChildContext();for(var r in i)if(!(r in e))throw Error(De(108,pz(n)||"Unknown",r));return Hn({},t,i)}function jv(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||Tl,Jc=rr.current,An(rr,n),An(Or,Or.current),!0}function OP(n,e,t){var i=n.stateNode;if(!i)throw Error(De(169));t?(n=JD(n,e,Jc),i.__reactInternalMemoizedMergedChildContext=n,Rn(Or),Rn(rr),An(rr,n)):Rn(Or),An(Or,t)}var Go=null,T_=!1,QS=!1;function ZD(n){Go===null?Go=[n]:Go.push(n)}function I5(n){T_=!0,ZD(n)}function Dl(){if(!QS&&Go!==null){QS=!0;var n=0,e=yn;try{var t=Go;for(yn=1;n>=o,r-=o,qo=1<<32-Hs(e)+r|t<P?(D=I,I=null):D=I.sibling;var A=p(y,I,w[P],M);if(A===null){I===null&&(I=D);break}n&&I&&A.alternate===null&&e(y,I),E=s(A,E,P),k===null?O=A:k.sibling=A,k=A,I=D}if(P===w.length)return t(y,I),Nn&&Sc(y,P),O;if(I===null){for(;PP?(D=I,I=null):D=I.sibling;var R=p(y,I,A.value,M);if(R===null){I===null&&(I=D);break}n&&I&&R.alternate===null&&e(y,I),E=s(R,E,P),k===null?O=R:k.sibling=R,k=R,I=D}if(A.done)return t(y,I),Nn&&Sc(y,P),O;if(I===null){for(;!A.done;P++,A=w.next())A=f(y,A.value,M),A!==null&&(E=s(A,E,P),k===null?O=A:k.sibling=A,k=A);return Nn&&Sc(y,P),O}for(I=i(y,I);!A.done;P++,A=w.next())A=m(I,y,P,A.value,M),A!==null&&(n&&A.alternate!==null&&I.delete(A.key===null?P:A.key),E=s(A,E,P),k===null?O=A:k.sibling=A,k=A);return n&&I.forEach(function(V){return e(y,V)}),Nn&&Sc(y,P),O}function x(y,E,w,M){if(typeof w=="object"&&w!==null&&w.type===ph&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case zg:e:{for(var O=w.key,k=E;k!==null;){if(k.key===O){if(O=w.type,O===ph){if(k.tag===7){t(y,k.sibling),E=r(k,w.props.children),E.return=y,y=E;break e}}else if(k.elementType===O||typeof O=="object"&&O!==null&&O.$$typeof===qa&&VP(O)===k.type){t(y,k.sibling),E=r(k,w.props),E.ref=mf(y,k,w),E.return=y,y=E;break e}t(y,k);break}else e(y,k);k=k.sibling}w.type===ph?(E=Gc(w.props.children,y.mode,M,w.key),E.return=y,y=E):(M=xv(w.type,w.key,w.props,null,y.mode,M),M.ref=mf(y,E,w),M.return=y,y=M)}return o(y);case fh:e:{for(k=w.key;E!==null;){if(E.key===k)if(E.tag===4&&E.stateNode.containerInfo===w.containerInfo&&E.stateNode.implementation===w.implementation){t(y,E.sibling),E=r(E,w.children||[]),E.return=y,y=E;break e}else{t(y,E);break}else e(y,E);E=E.sibling}E=sw(w,y.mode,M),E.return=y,y=E}return o(y);case qa:return k=w._init,x(y,E,k(w._payload),M)}if(Bf(w))return _(y,E,w,M);if(uf(w))return S(y,E,w,M);Jg(y,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,E!==null&&E.tag===6?(t(y,E.sibling),E=r(E,w),E.return=y,y=E):(t(y,E),E=rw(w,y.mode,M),E.return=y,y=E),o(y)):t(y,E)}return x}var Zh=i3(!0),r3=i3(!1),$v=Nl(null),Yv=null,wh=null,sA=null;function oA(){sA=wh=Yv=null}function aA(n){var e=$v.current;Rn($v),n._currentValue=e}function aE(n,e,t){for(;n!==null;){var i=n.alternate;if((n.childLanes&e)!==e?(n.childLanes|=e,i!==null&&(i.childLanes|=e)):i!==null&&(i.childLanes&e)!==e&&(i.childLanes|=e),n===t)break;n=n.return}}function zh(n,e){Yv=n,sA=wh=null,n=n.dependencies,n!==null&&n.firstContext!==null&&(n.lanes&e&&(Dr=!0),n.firstContext=null)}function As(n){var e=n._currentValue;if(sA!==n)if(n={context:n,memoizedValue:e,next:null},wh===null){if(Yv===null)throw Error(De(308));wh=n,Yv.dependencies={lanes:0,firstContext:n}}else wh=wh.next=n;return e}var Nc=null;function lA(n){Nc===null?Nc=[n]:Nc.push(n)}function s3(n,e,t,i){var r=e.interleaved;return r===null?(t.next=t,lA(e)):(t.next=r.next,r.next=t),e.interleaved=t,aa(n,i)}function aa(n,e){n.lanes|=e;var t=n.alternate;for(t!==null&&(t.lanes|=e),t=n,n=n.return;n!==null;)n.childLanes|=e,t=n.alternate,t!==null&&(t.childLanes|=e),t=n,n=n.return;return t.tag===3?t.stateNode:null}var $a=!1;function cA(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function o3(n,e){n=n.updateQueue,e.updateQueue===n&&(e.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,effects:n.effects})}function ta(n,e){return{eventTime:n,lane:e,tag:0,payload:null,callback:null,next:null}}function dl(n,e,t){var i=n.updateQueue;if(i===null)return null;if(i=i.shared,on&2){var r=i.pending;return r===null?e.next=e:(e.next=r.next,r.next=e),i.pending=e,aa(n,t)}return r=i.interleaved,r===null?(e.next=e,lA(i)):(e.next=r.next,r.next=e),i.interleaved=e,aa(n,t)}function pv(n,e,t){if(e=e.updateQueue,e!==null&&(e=e.shared,(t&4194240)!==0)){var i=e.lanes;i&=n.pendingLanes,t|=i,e.lanes=t,$T(n,t)}}function BP(n,e){var t=n.updateQueue,i=n.alternate;if(i!==null&&(i=i.updateQueue,t===i)){var r=null,s=null;if(t=t.firstBaseUpdate,t!==null){do{var o={eventTime:t.eventTime,lane:t.lane,tag:t.tag,payload:t.payload,callback:t.callback,next:null};s===null?r=s=o:s=s.next=o,t=t.next}while(t!==null);s===null?r=s=e:s=s.next=e}else r=s=e;t={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:s,shared:i.shared,effects:i.effects},n.updateQueue=t;return}n=t.lastBaseUpdate,n===null?t.firstBaseUpdate=e:n.next=e,t.lastBaseUpdate=e}function Kv(n,e,t,i){var r=n.updateQueue;$a=!1;var s=r.firstBaseUpdate,o=r.lastBaseUpdate,a=r.shared.pending;if(a!==null){r.shared.pending=null;var l=a,c=l.next;l.next=null,o===null?s=c:o.next=c,o=l;var d=n.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==o&&(a===null?d.firstBaseUpdate=c:a.next=c,d.lastBaseUpdate=l))}if(s!==null){var f=r.baseState;o=0,d=c=l=null,a=s;do{var p=a.lane,m=a.eventTime;if((i&p)===p){d!==null&&(d=d.next={eventTime:m,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var _=n,S=a;switch(p=e,m=t,S.tag){case 1:if(_=S.payload,typeof _=="function"){f=_.call(m,f,p);break e}f=_;break e;case 3:_.flags=_.flags&-65537|128;case 0:if(_=S.payload,p=typeof _=="function"?_.call(m,f,p):_,p==null)break e;f=Hn({},f,p);break e;case 2:$a=!0}}a.callback!==null&&a.lane!==0&&(n.flags|=64,p=r.effects,p===null?r.effects=[a]:p.push(a))}else m={eventTime:m,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(c=d=m,l=f):d=d.next=m,o|=p;if(a=a.next,a===null){if(a=r.shared.pending,a===null)break;p=a,a=p.next,p.next=null,r.lastBaseUpdate=p,r.shared.pending=null}}while(1);if(d===null&&(l=f),r.baseState=l,r.firstBaseUpdate=c,r.lastBaseUpdate=d,e=r.shared.interleaved,e!==null){r=e;do o|=r.lane,r=r.next;while(r!==e)}else s===null&&(r.shared.lanes=0);tu|=o,n.lanes=o,n.memoizedState=f}}function zP(n,e,t){if(n=e.effects,e.effects=null,n!==null)for(e=0;et?t:4,n(!0);var i=ZS.transition;ZS.transition={};try{n(!1),e()}finally{yn=t,ZS.transition=i}}function E3(){return Ms().memoizedState}function k5(n,e,t){var i=pl(n);if(t={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null},T3(n))A3(e,t);else if(t=s3(n,e,t,i),t!==null){var r=gr();Gs(t,n,i,r),M3(t,e,i)}}function O5(n,e,t){var i=pl(n),r={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null};if(T3(n))A3(e,r);else{var s=n.alternate;if(n.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,t);if(r.hasEagerState=!0,r.eagerState=a,Ws(a,o)){var l=e.interleaved;l===null?(r.next=r,lA(e)):(r.next=l.next,l.next=r),e.interleaved=r;return}}catch{}finally{}t=s3(n,e,r,i),t!==null&&(r=gr(),Gs(t,n,i,r),M3(t,e,i))}}function T3(n){var e=n.alternate;return n===zn||e!==null&&e===zn}function A3(n,e){np=Jv=!0;var t=n.pending;t===null?e.next=e:(e.next=t.next,t.next=e),n.pending=e}function M3(n,e,t){if(t&4194240){var i=e.lanes;i&=n.pendingLanes,t|=i,e.lanes=t,$T(n,t)}}var Zv={readContext:As,useCallback:Wi,useContext:Wi,useEffect:Wi,useImperativeHandle:Wi,useInsertionEffect:Wi,useLayoutEffect:Wi,useMemo:Wi,useReducer:Wi,useRef:Wi,useState:Wi,useDebugValue:Wi,useDeferredValue:Wi,useTransition:Wi,useMutableSource:Wi,useSyncExternalStore:Wi,useId:Wi,unstable_isNewReconciler:!1},U5={readContext:As,useCallback:function(n,e){return ao().memoizedState=[n,e===void 0?null:e],n},useContext:As,useEffect:GP,useImperativeHandle:function(n,e,t){return t=t!=null?t.concat([n]):null,gv(4194308,4,v3.bind(null,e,n),t)},useLayoutEffect:function(n,e){return gv(4194308,4,n,e)},useInsertionEffect:function(n,e){return gv(4,2,n,e)},useMemo:function(n,e){var t=ao();return e=e===void 0?null:e,n=n(),t.memoizedState=[n,e],n},useReducer:function(n,e,t){var i=ao();return e=t!==void 0?t(e):e,i.memoizedState=i.baseState=e,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:e},i.queue=n,n=n.dispatch=k5.bind(null,zn,n),[i.memoizedState,n]},useRef:function(n){var e=ao();return n={current:n},e.memoizedState=n},useState:HP,useDebugValue:yA,useDeferredValue:function(n){return ao().memoizedState=n},useTransition:function(){var n=HP(!1),e=n[0];return n=D5.bind(null,n[1]),ao().memoizedState=n,[e,n]},useMutableSource:function(){},useSyncExternalStore:function(n,e,t){var i=zn,r=ao();if(Nn){if(t===void 0)throw Error(De(407));t=t()}else{if(t=e(),Mi===null)throw Error(De(349));eu&30||u3(i,e,t)}r.memoizedState=t;var s={value:t,getSnapshot:e};return r.queue=s,GP(d3.bind(null,i,s,n),[n]),i.flags|=2048,Bp(9,h3.bind(null,i,s,t,e),void 0,null),t},useId:function(){var n=ao(),e=Mi.identifierPrefix;if(Nn){var t=$o,i=qo;t=(i&~(1<<32-Hs(i)-1)).toString(32)+t,e=":"+e+"R"+t,t=Fp++,0<\/script>",n=n.removeChild(n.firstChild)):typeof i.is=="string"?n=o.createElement(t,{is:i.is}):(n=o.createElement(t),t==="select"&&(o=n,i.multiple?o.multiple=!0:i.size&&(o.size=i.size))):n=o.createElementNS(n,t),n[co]=e,n[kp]=i,O3(n,e,!1,!1),e.stateNode=n;e:{switch(o=G1(t,i),t){case"dialog":Pn("cancel",n),Pn("close",n),r=i;break;case"iframe":case"object":case"embed":Pn("load",n),r=i;break;case"video":case"audio":for(r=0;rnd&&(e.flags|=128,i=!0,gf(s,!1),e.lanes=4194304)}else{if(!i)if(n=Qv(o),n!==null){if(e.flags|=128,i=!0,t=n.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),gf(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Nn)return ji(e),null}else 2*ti()-s.renderingStartTime>nd&&t!==1073741824&&(e.flags|=128,i=!0,gf(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(t=s.last,t!==null?t.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=ti(),e.sibling=null,t=Fn.current,An(Fn,i?t&1|2:t&1),e):(ji(e),null);case 22:case 23:return EA(),i=e.memoizedState!==null,n!==null&&n.memoizedState!==null!==i&&(e.flags|=8192),i&&e.mode&1?Yr&1073741824&&(ji(e),e.subtreeFlags&6&&(e.flags|=8192)):ji(e),null;case 24:return null;case 25:return null}throw Error(De(156,e.tag))}function W5(n,e){switch(iA(e),e.tag){case 1:return Ur(e.type)&&Wv(),n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 3:return ed(),Rn(Or),Rn(rr),dA(),n=e.flags,n&65536&&!(n&128)?(e.flags=n&-65537|128,e):null;case 5:return hA(e),null;case 13:if(Rn(Fn),n=e.memoizedState,n!==null&&n.dehydrated!==null){if(e.alternate===null)throw Error(De(340));Jh()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 19:return Rn(Fn),null;case 4:return ed(),null;case 10:return aA(e.type._context),null;case 22:case 23:return EA(),null;case 24:return null;default:return null}}var ey=!1,Ji=!1,j5=typeof WeakSet=="function"?WeakSet:Set,at=null;function Eh(n,e){var t=n.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(i){Xn(n,e,i)}else t.current=null}function gE(n,e,t){try{t()}catch(i){Xn(n,e,i)}}var eR=!1;function X5(n,e){if(Z1=Bv,n=GD(),tA(n)){if("selectionStart"in n)var t={start:n.selectionStart,end:n.selectionEnd};else e:{t=(t=n.ownerDocument)&&t.defaultView||window;var i=t.getSelection&&t.getSelection();if(i&&i.rangeCount!==0){t=i.anchorNode;var r=i.anchorOffset,s=i.focusNode;i=i.focusOffset;try{t.nodeType,s.nodeType}catch{t=null;break e}var o=0,a=-1,l=-1,c=0,d=0,f=n,p=null;t:for(;;){for(var m;f!==t||r!==0&&f.nodeType!==3||(a=o+r),f!==s||i!==0&&f.nodeType!==3||(l=o+i),f.nodeType===3&&(o+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===n)break t;if(p===t&&++c===r&&(a=o),p===s&&++d===i&&(l=o),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}t=a===-1||l===-1?null:{start:a,end:l}}else t=null}t=t||{start:0,end:0}}else t=null;for(eE={focusedElem:n,selectionRange:t},Bv=!1,at=e;at!==null;)if(e=at,n=e.child,(e.subtreeFlags&1028)!==0&&n!==null)n.return=e,at=n;else for(;at!==null;){e=at;try{var _=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(_!==null){var S=_.memoizedProps,x=_.memoizedState,y=e.stateNode,E=y.getSnapshotBeforeUpdate(e.elementType===e.type?S:ks(e.type,S),x);y.__reactInternalSnapshotBeforeUpdate=E}break;case 3:var w=e.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(De(163))}}catch(M){Xn(e,e.return,M)}if(n=e.sibling,n!==null){n.return=e.return,at=n;break}at=e.return}return _=eR,eR=!1,_}function ip(n,e,t){var i=e.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var r=i=i.next;do{if((r.tag&n)===n){var s=r.destroy;r.destroy=void 0,s!==void 0&&gE(e,t,s)}r=r.next}while(r!==i)}}function C_(n,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var t=e=e.next;do{if((t.tag&n)===n){var i=t.create;t.destroy=i()}t=t.next}while(t!==e)}}function yE(n){var e=n.ref;if(e!==null){var t=n.stateNode;switch(n.tag){case 5:n=t;break;default:n=t}typeof e=="function"?e(n):e.current=n}}function V3(n){var e=n.alternate;e!==null&&(n.alternate=null,V3(e)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(e=n.stateNode,e!==null&&(delete e[co],delete e[kp],delete e[iE],delete e[b5],delete e[P5])),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}function B3(n){return n.tag===5||n.tag===3||n.tag===4}function tR(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||B3(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function vE(n,e,t){var i=n.tag;if(i===5||i===6)n=n.stateNode,e?t.nodeType===8?t.parentNode.insertBefore(n,e):t.insertBefore(n,e):(t.nodeType===8?(e=t.parentNode,e.insertBefore(n,t)):(e=t,e.appendChild(n)),t=t._reactRootContainer,t!=null||e.onclick!==null||(e.onclick=Gv));else if(i!==4&&(n=n.child,n!==null))for(vE(n,e,t),n=n.sibling;n!==null;)vE(n,e,t),n=n.sibling}function _E(n,e,t){var i=n.tag;if(i===5||i===6)n=n.stateNode,e?t.insertBefore(n,e):t.appendChild(n);else if(i!==4&&(n=n.child,n!==null))for(_E(n,e,t),n=n.sibling;n!==null;)_E(n,e,t),n=n.sibling}var Ri=null,Us=!1;function Da(n,e,t){for(t=t.child;t!==null;)z3(n,e,t),t=t.sibling}function z3(n,e,t){if(po&&typeof po.onCommitFiberUnmount=="function")try{po.onCommitFiberUnmount(__,t)}catch{}switch(t.tag){case 5:Ji||Eh(t,e);case 6:var i=Ri,r=Us;Ri=null,Da(n,e,t),Ri=i,Us=r,Ri!==null&&(Us?(n=Ri,t=t.stateNode,n.nodeType===8?n.parentNode.removeChild(t):n.removeChild(t)):Ri.removeChild(t.stateNode));break;case 18:Ri!==null&&(Us?(n=Ri,t=t.stateNode,n.nodeType===8?KS(n.parentNode,t):n.nodeType===1&&KS(n,t),Rp(n)):KS(Ri,t.stateNode));break;case 4:i=Ri,r=Us,Ri=t.stateNode.containerInfo,Us=!0,Da(n,e,t),Ri=i,Us=r;break;case 0:case 11:case 14:case 15:if(!Ji&&(i=t.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){r=i=i.next;do{var s=r,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&gE(t,e,o),r=r.next}while(r!==i)}Da(n,e,t);break;case 1:if(!Ji&&(Eh(t,e),i=t.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=t.memoizedProps,i.state=t.memoizedState,i.componentWillUnmount()}catch(a){Xn(t,e,a)}Da(n,e,t);break;case 21:Da(n,e,t);break;case 22:t.mode&1?(Ji=(i=Ji)||t.memoizedState!==null,Da(n,e,t),Ji=i):Da(n,e,t);break;default:Da(n,e,t)}}function nR(n){var e=n.updateQueue;if(e!==null){n.updateQueue=null;var t=n.stateNode;t===null&&(t=n.stateNode=new j5),e.forEach(function(i){var r=t6.bind(null,n,i);t.has(i)||(t.add(i),i.then(r,r))})}}function Is(n,e){var t=e.deletions;if(t!==null)for(var i=0;ir&&(r=o),i&=~s}if(i=r,i=ti()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*$5(i/1960))-i,10n?16:n,rl===null)var i=!1;else{if(n=rl,rl=null,n0=0,on&6)throw Error(De(331));var r=on;for(on|=4,at=n.current;at!==null;){var s=at,o=s.child;if(at.flags&16){var a=s.deletions;if(a!==null){for(var l=0;lti()-SA?Hc(n,0):xA|=t),Fr(n,e)}function Y3(n,e){e===0&&(n.mode&1?(e=jg,jg<<=1,!(jg&130023424)&&(jg=4194304)):e=1);var t=gr();n=aa(n,e),n!==null&&(Em(n,e,t),Fr(n,t))}function e6(n){var e=n.memoizedState,t=0;e!==null&&(t=e.retryLane),Y3(n,t)}function t6(n,e){var t=0;switch(n.tag){case 13:var i=n.stateNode,r=n.memoizedState;r!==null&&(t=r.retryLane);break;case 19:i=n.stateNode;break;default:throw Error(De(314))}i!==null&&i.delete(e),Y3(n,t)}var K3;K3=function(n,e,t){if(n!==null)if(n.memoizedProps!==e.pendingProps||Or.current)Dr=!0;else{if(!(n.lanes&t)&&!(e.flags&128))return Dr=!1,H5(n,e,t);Dr=!!(n.flags&131072)}else Dr=!1,Nn&&e.flags&1048576&&e3(e,qv,e.index);switch(e.lanes=0,e.tag){case 2:var i=e.type;yv(n,e),n=e.pendingProps;var r=Qh(e,rr.current);zh(e,t),r=pA(null,e,i,n,r,t);var s=mA();return e.flags|=1,typeof r=="object"&&r!==null&&typeof r.render=="function"&&r.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Ur(i)?(s=!0,jv(e)):s=!1,e.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,cA(e),r.updater=M_,e.stateNode=r,r._reactInternals=e,cE(e,i,n,t),e=dE(null,e,i,!0,s,t)):(e.tag=0,Nn&&s&&nA(e),fr(null,e,r,t),e=e.child),e;case 16:i=e.elementType;e:{switch(yv(n,e),n=e.pendingProps,r=i._init,i=r(i._payload),e.type=i,r=e.tag=i6(i),n=ks(i,n),r){case 0:e=hE(null,e,i,n,t);break e;case 1:e=QP(null,e,i,n,t);break e;case 11:e=YP(null,e,i,n,t);break e;case 14:e=KP(null,e,i,ks(i.type,n),t);break e}throw Error(De(306,i,""))}return e;case 0:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:ks(i,r),hE(n,e,i,r,t);case 1:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:ks(i,r),QP(n,e,i,r,t);case 3:e:{if(N3(e),n===null)throw Error(De(387));i=e.pendingProps,s=e.memoizedState,r=s.element,o3(n,e),Kv(e,i,null,t);var o=e.memoizedState;if(i=o.element,s.isDehydrated)if(s={element:i,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){r=td(Error(De(423)),e),e=JP(n,e,i,t,r);break e}else if(i!==r){r=td(Error(De(424)),e),e=JP(n,e,i,t,r);break e}else for(Qr=hl(e.stateNode.containerInfo.firstChild),Jr=e,Nn=!0,Fs=null,t=r3(e,null,i,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(Jh(),i===r){e=la(n,e,t);break e}fr(n,e,i,t)}e=e.child}return e;case 5:return a3(e),n===null&&oE(e),i=e.type,r=e.pendingProps,s=n!==null?n.memoizedProps:null,o=r.children,tE(i,r)?o=null:s!==null&&tE(i,s)&&(e.flags|=32),L3(n,e),fr(n,e,o,t),e.child;case 6:return n===null&&oE(e),null;case 13:return D3(n,e,t);case 4:return uA(e,e.stateNode.containerInfo),i=e.pendingProps,n===null?e.child=Zh(e,null,i,t):fr(n,e,i,t),e.child;case 11:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:ks(i,r),YP(n,e,i,r,t);case 7:return fr(n,e,e.pendingProps,t),e.child;case 8:return fr(n,e,e.pendingProps.children,t),e.child;case 12:return fr(n,e,e.pendingProps.children,t),e.child;case 10:e:{if(i=e.type._context,r=e.pendingProps,s=e.memoizedProps,o=r.value,An($v,i._currentValue),i._currentValue=o,s!==null)if(Ws(s.value,o)){if(s.children===r.children&&!Or.current){e=la(n,e,t);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===i){if(s.tag===1){l=ta(-1,t&-t),l.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?l.next=l:(l.next=d.next,d.next=l),c.pending=l}}s.lanes|=t,l=s.alternate,l!==null&&(l.lanes|=t),aE(s.return,t,e),a.lanes|=t;break}l=l.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(De(341));o.lanes|=t,a=o.alternate,a!==null&&(a.lanes|=t),aE(o,t,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}fr(n,e,r.children,t),e=e.child}return e;case 9:return r=e.type,i=e.pendingProps.children,zh(e,t),r=As(r),i=i(r),e.flags|=1,fr(n,e,i,t),e.child;case 14:return i=e.type,r=ks(i,e.pendingProps),r=ks(i.type,r),KP(n,e,i,r,t);case 15:return R3(n,e,e.type,e.pendingProps,t);case 17:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:ks(i,r),yv(n,e),e.tag=1,Ur(i)?(n=!0,jv(e)):n=!1,zh(e,t),C3(e,i,r),cE(e,i,r,t),dE(null,e,i,!0,n,t);case 19:return k3(n,e,t);case 22:return I3(n,e,t)}throw Error(De(156,e.tag))};function Q3(n,e){return TD(n,e)}function n6(n,e,t,i){this.tag=n,this.key=t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ws(n,e,t,i){return new n6(n,e,t,i)}function AA(n){return n=n.prototype,!(!n||!n.isReactComponent)}function i6(n){if(typeof n=="function")return AA(n)?1:0;if(n!=null){if(n=n.$$typeof,n===WT)return 11;if(n===jT)return 14}return 2}function ml(n,e){var t=n.alternate;return t===null?(t=ws(n.tag,e,n.key,n.mode),t.elementType=n.elementType,t.type=n.type,t.stateNode=n.stateNode,t.alternate=n,n.alternate=t):(t.pendingProps=e,t.type=n.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=n.flags&14680064,t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},t.sibling=n.sibling,t.index=n.index,t.ref=n.ref,t}function xv(n,e,t,i,r,s){var o=2;if(i=n,typeof n=="function")AA(n)&&(o=1);else if(typeof n=="string")o=5;else e:switch(n){case ph:return Gc(t.children,r,s,e);case GT:o=8,r|=8;break;case N1:return n=ws(12,t,e,r|2),n.elementType=N1,n.lanes=s,n;case D1:return n=ws(13,t,e,r),n.elementType=D1,n.lanes=s,n;case k1:return n=ws(19,t,e,r),n.elementType=k1,n.lanes=s,n;case aD:return P_(t,r,s,e);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case sD:o=10;break e;case oD:o=9;break e;case WT:o=11;break e;case jT:o=14;break e;case qa:o=16,i=null;break e}throw Error(De(130,n==null?n:typeof n,""))}return e=ws(o,t,e,r),e.elementType=n,e.type=i,e.lanes=s,e}function Gc(n,e,t,i){return n=ws(7,n,i,e),n.lanes=t,n}function P_(n,e,t,i){return n=ws(22,n,i,e),n.elementType=aD,n.lanes=t,n.stateNode={isHidden:!1},n}function rw(n,e,t){return n=ws(6,n,null,e),n.lanes=t,n}function sw(n,e,t){return e=ws(4,n.children!==null?n.children:[],n.key,e),e.lanes=t,e.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},e}function r6(n,e,t,i,r){this.tag=e,this.containerInfo=n,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=VS(0),this.expirationTimes=VS(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=VS(0),this.identifierPrefix=i,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function MA(n,e,t,i,r,s,o,a,l){return n=new r6(n,e,t,a,l),e===1?(e=1,s===!0&&(e|=8)):e=0,s=ws(3,null,null,e),n.current=s,s.stateNode=n,s.memoizedState={element:i,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},cA(s),n}function s6(n,e,t){var i=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(tk)}catch(n){console.error(n)}}tk(),tD.exports=ns;var u6=tD.exports,nk,uR=u6;nk=I1.createRoot=uR.createRoot,I1.hydrateRoot=uR.hydrateRoot;/** +`+s.stack}return{value:n,source:e,stack:r,digest:null}}function nw(n,e,t){return{value:n,source:null,stack:t??null,digest:e??null}}function uE(n,e){try{console.error(e.value)}catch(t){setTimeout(function(){throw t})}}var B5=typeof WeakMap=="function"?WeakMap:Map;function b3(n,e,t){t=ta(-1,t),t.tag=3,t.payload={element:null};var i=e.value;return t.callback=function(){t0||(t0=!0,xE=i),uE(n,e)},t}function P3(n,e,t){t=ta(-1,t),t.tag=3;var i=n.type.getDerivedStateFromError;if(typeof i=="function"){var r=e.value;t.payload=function(){return i(r)},t.callback=function(){uE(n,e)}}var s=n.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(t.callback=function(){uE(n,e),typeof i!="function"&&(fl===null?fl=new Set([this]):fl.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),t}function XP(n,e,t){var i=n.pingCache;if(i===null){i=n.pingCache=new B5;var r=new Set;i.set(e,r)}else r=i.get(e),r===void 0&&(r=new Set,i.set(e,r));r.has(t)||(r.add(t),n=e6.bind(null,n,e,t),e.then(n,n))}function qP(n){do{var e;if((e=n.tag===13)&&(e=n.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return n;n=n.return}while(n!==null);return null}function $P(n,e,t,i,r){return n.mode&1?(n.flags|=65536,n.lanes=r,n):(n===e?n.flags|=65536:(n.flags|=128,t.flags|=131072,t.flags&=-52805,t.tag===1&&(t.alternate===null?t.tag=17:(e=ta(-1,1),e.tag=2,dl(t,e,1))),t.lanes|=1),n)}var z5=ya.ReactCurrentOwner,Dr=!1;function fr(n,e,t,i){e.child=n===null?r3(e,null,t,i):Zh(e,n.child,t,i)}function YP(n,e,t,i,r){t=t.render;var s=e.ref;return zh(e,r),i=pA(n,e,t,i,s,r),t=mA(),n!==null&&!Dr?(e.updateQueue=n.updateQueue,e.flags&=-2053,n.lanes&=~r,la(n,e,r)):(Nn&&t&&nA(e),e.flags|=1,fr(n,e,i,r),e.child)}function KP(n,e,t,i,r){if(n===null){var s=t.type;return typeof s=="function"&&!AA(s)&&s.defaultProps===void 0&&t.compare===null&&t.defaultProps===void 0?(e.tag=15,e.type=s,R3(n,e,s,i,r)):(n=xv(t.type,null,i,e,e.mode,r),n.ref=e.ref,n.return=e,e.child=n)}if(s=n.child,!(n.lanes&r)){var o=s.memoizedProps;if(t=t.compare,t=t!==null?t:Lp,t(o,i)&&n.ref===e.ref)return la(n,e,r)}return e.flags|=1,n=ml(s,i),n.ref=e.ref,n.return=e,e.child=n}function R3(n,e,t,i,r){if(n!==null){var s=n.memoizedProps;if(Lp(s,i)&&n.ref===e.ref)if(Dr=!1,e.pendingProps=i=s,(n.lanes&r)!==0)n.flags&131072&&(Dr=!0);else return e.lanes=n.lanes,la(n,e,r)}return hE(n,e,t,i,r)}function I3(n,e,t){var i=e.pendingProps,r=i.children,s=n!==null?n.memoizedState:null;if(i.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},An(Th,Yr),Yr|=t;else{if(!(t&1073741824))return n=s!==null?s.baseLanes|t:t,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:n,cachePool:null,transitions:null},e.updateQueue=null,An(Th,Yr),Yr|=n,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=s!==null?s.baseLanes:t,An(Th,Yr),Yr|=i}else s!==null?(i=s.baseLanes|t,e.memoizedState=null):i=t,An(Th,Yr),Yr|=i;return fr(n,e,r,t),e.child}function L3(n,e){var t=e.ref;(n===null&&t!==null||n!==null&&n.ref!==t)&&(e.flags|=512,e.flags|=2097152)}function hE(n,e,t,i,r){var s=Ur(t)?Jc:rr.current;return s=Qh(e,s),zh(e,r),t=pA(n,e,t,i,s,r),i=mA(),n!==null&&!Dr?(e.updateQueue=n.updateQueue,e.flags&=-2053,n.lanes&=~r,la(n,e,r)):(Nn&&i&&nA(e),e.flags|=1,fr(n,e,t,r),e.child)}function QP(n,e,t,i,r){if(Ur(t)){var s=!0;jv(e)}else s=!1;if(zh(e,r),e.stateNode===null)yv(n,e),C3(e,t,i),cE(e,t,i,r),i=!0;else if(n===null){var o=e.stateNode,a=e.memoizedProps;o.props=a;var l=o.context,c=t.contextType;typeof c=="object"&&c!==null?c=As(c):(c=Ur(t)?Jc:rr.current,c=Qh(e,c));var d=t.getDerivedStateFromProps,f=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";f||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==i||l!==c)&&jP(e,o,i,c),$a=!1;var p=e.memoizedState;o.state=p,Kv(e,i,o,r),l=e.memoizedState,a!==i||p!==l||Or.current||$a?(typeof d=="function"&&(lE(e,t,d,i),l=e.memoizedState),(a=$a||WP(e,t,a,i,p,l,c))?(f||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=i,e.memoizedState=l),o.props=i,o.state=l,o.context=c,i=a):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),i=!1)}else{o=e.stateNode,o3(n,e),a=e.memoizedProps,c=e.type===e.elementType?a:ks(e.type,a),o.props=c,f=e.pendingProps,p=o.context,l=t.contextType,typeof l=="object"&&l!==null?l=As(l):(l=Ur(t)?Jc:rr.current,l=Qh(e,l));var m=t.getDerivedStateFromProps;(d=typeof m=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==f||p!==l)&&jP(e,o,i,l),$a=!1,p=e.memoizedState,o.state=p,Kv(e,i,o,r);var _=e.memoizedState;a!==f||p!==_||Or.current||$a?(typeof m=="function"&&(lE(e,t,m,i),_=e.memoizedState),(c=$a||WP(e,t,c,i,p,_,l)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(i,_,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(i,_,l)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===n.memoizedProps&&p===n.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===n.memoizedProps&&p===n.memoizedState||(e.flags|=1024),e.memoizedProps=i,e.memoizedState=_),o.props=i,o.state=_,o.context=l,i=c):(typeof o.componentDidUpdate!="function"||a===n.memoizedProps&&p===n.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===n.memoizedProps&&p===n.memoizedState||(e.flags|=1024),i=!1)}return dE(n,e,t,i,s,r)}function dE(n,e,t,i,r,s){L3(n,e);var o=(e.flags&128)!==0;if(!i&&!o)return r&&OP(e,t,!1),la(n,e,s);i=e.stateNode,z5.current=e;var a=o&&typeof t.getDerivedStateFromError!="function"?null:i.render();return e.flags|=1,n!==null&&o?(e.child=Zh(e,n.child,null,s),e.child=Zh(e,null,a,s)):fr(n,e,a,s),e.memoizedState=i.state,r&&OP(e,t,!0),e.child}function N3(n){var e=n.stateNode;e.pendingContext?kP(n,e.pendingContext,e.pendingContext!==e.context):e.context&&kP(n,e.context,!1),uA(n,e.containerInfo)}function JP(n,e,t,i,r){return Jh(),rA(r),e.flags|=256,fr(n,e,t,i),e.child}var fE={dehydrated:null,treeContext:null,retryLane:0};function pE(n){return{baseLanes:n,cachePool:null,transitions:null}}function D3(n,e,t){var i=e.pendingProps,r=Fn.current,s=!1,o=(e.flags&128)!==0,a;if((a=o)||(a=n!==null&&n.memoizedState===null?!1:(r&2)!==0),a?(s=!0,e.flags&=-129):(n===null||n.memoizedState!==null)&&(r|=1),An(Fn,r&1),n===null)return oE(e),n=e.memoizedState,n!==null&&(n=n.dehydrated,n!==null)?(e.mode&1?n.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(o=i.children,n=i.fallback,s?(i=e.mode,s=e.child,o={mode:"hidden",children:o},!(i&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=P_(o,i,0,null),n=Gc(n,i,t,null),s.return=e,n.return=e,s.sibling=n,e.child=s,e.child.memoizedState=pE(t),e.memoizedState=fE,n):vA(e,o));if(r=n.memoizedState,r!==null&&(a=r.dehydrated,a!==null))return H5(n,e,o,i,a,r,t);if(s){s=i.fallback,o=e.mode,r=n.child,a=r.sibling;var l={mode:"hidden",children:i.children};return!(o&1)&&e.child!==r?(i=e.child,i.childLanes=0,i.pendingProps=l,e.deletions=null):(i=ml(r,l),i.subtreeFlags=r.subtreeFlags&14680064),a!==null?s=ml(a,s):(s=Gc(s,o,t,null),s.flags|=2),s.return=e,i.return=e,i.sibling=s,e.child=i,i=s,s=e.child,o=n.child.memoizedState,o=o===null?pE(t):{baseLanes:o.baseLanes|t,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=n.childLanes&~t,e.memoizedState=fE,i}return s=n.child,n=s.sibling,i=ml(s,{mode:"visible",children:i.children}),!(e.mode&1)&&(i.lanes=t),i.return=e,i.sibling=null,n!==null&&(t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)),e.child=i,e.memoizedState=null,i}function vA(n,e){return e=P_({mode:"visible",children:e},n.mode,0,null),e.return=n,n.child=e}function Zg(n,e,t,i){return i!==null&&rA(i),Zh(e,n.child,null,t),n=vA(e,e.pendingProps.children),n.flags|=2,e.memoizedState=null,n}function H5(n,e,t,i,r,s,o){if(t)return e.flags&256?(e.flags&=-257,i=nw(Error(De(422))),Zg(n,e,o,i)):e.memoizedState!==null?(e.child=n.child,e.flags|=128,null):(s=i.fallback,r=e.mode,i=P_({mode:"visible",children:i.children},r,0,null),s=Gc(s,r,o,null),s.flags|=2,i.return=e,s.return=e,i.sibling=s,e.child=i,e.mode&1&&Zh(e,n.child,null,o),e.child.memoizedState=pE(o),e.memoizedState=fE,s);if(!(e.mode&1))return Zg(n,e,o,null);if(r.data==="$!"){if(i=r.nextSibling&&r.nextSibling.dataset,i)var a=i.dgst;return i=a,s=Error(De(419)),i=nw(s,i,void 0),Zg(n,e,o,i)}if(a=(o&n.childLanes)!==0,Dr||a){if(i=Mi,i!==null){switch(o&-o){case 4:r=2;break;case 16:r=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:r=32;break;case 536870912:r=268435456;break;default:r=0}r=r&(i.suspendedLanes|o)?0:r,r!==0&&r!==s.retryLane&&(s.retryLane=r,aa(n,r),Gs(i,n,r,-1))}return TA(),i=nw(Error(De(421))),Zg(n,e,o,i)}return r.data==="$?"?(e.flags|=128,e.child=n.child,e=t6.bind(null,n),r._reactRetry=e,null):(n=s.treeContext,Qr=hl(r.nextSibling),Jr=e,Nn=!0,Fs=null,n!==null&&(xs[Ss++]=qo,xs[Ss++]=$o,xs[Ss++]=Zc,qo=n.id,$o=n.overflow,Zc=e),e=vA(e,i.children),e.flags|=4096,e)}function ZP(n,e,t){n.lanes|=e;var i=n.alternate;i!==null&&(i.lanes|=e),aE(n.return,e,t)}function iw(n,e,t,i,r){var s=n.memoizedState;s===null?n.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:i,tail:t,tailMode:r}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=i,s.tail=t,s.tailMode=r)}function k3(n,e,t){var i=e.pendingProps,r=i.revealOrder,s=i.tail;if(fr(n,e,i.children,t),i=Fn.current,i&2)i=i&1|2,e.flags|=128;else{if(n!==null&&n.flags&128)e:for(n=e.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&ZP(n,t,e);else if(n.tag===19)ZP(n,t,e);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}i&=1}if(An(Fn,i),!(e.mode&1))e.memoizedState=null;else switch(r){case"forwards":for(t=e.child,r=null;t!==null;)n=t.alternate,n!==null&&Qv(n)===null&&(r=t),t=t.sibling;t=r,t===null?(r=e.child,e.child=null):(r=t.sibling,t.sibling=null),iw(e,!1,r,t,s);break;case"backwards":for(t=null,r=e.child,e.child=null;r!==null;){if(n=r.alternate,n!==null&&Qv(n)===null){e.child=r;break}n=r.sibling,r.sibling=t,t=r,r=n}iw(e,!0,t,null,s);break;case"together":iw(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function yv(n,e){!(e.mode&1)&&n!==null&&(n.alternate=null,e.alternate=null,e.flags|=2)}function la(n,e,t){if(n!==null&&(e.dependencies=n.dependencies),tu|=e.lanes,!(t&e.childLanes))return null;if(n!==null&&e.child!==n.child)throw Error(De(153));if(e.child!==null){for(n=e.child,t=ml(n,n.pendingProps),e.child=t,t.return=e;n.sibling!==null;)n=n.sibling,t=t.sibling=ml(n,n.pendingProps),t.return=e;t.sibling=null}return e.child}function G5(n,e,t){switch(e.tag){case 3:N3(e),Jh();break;case 5:a3(e);break;case 1:Ur(e.type)&&jv(e);break;case 4:uA(e,e.stateNode.containerInfo);break;case 10:var i=e.type._context,r=e.memoizedProps.value;An($v,i._currentValue),i._currentValue=r;break;case 13:if(i=e.memoizedState,i!==null)return i.dehydrated!==null?(An(Fn,Fn.current&1),e.flags|=128,null):t&e.child.childLanes?D3(n,e,t):(An(Fn,Fn.current&1),n=la(n,e,t),n!==null?n.sibling:null);An(Fn,Fn.current&1);break;case 19:if(i=(t&e.childLanes)!==0,n.flags&128){if(i)return k3(n,e,t);e.flags|=128}if(r=e.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),An(Fn,Fn.current),i)break;return null;case 22:case 23:return e.lanes=0,I3(n,e,t)}return la(n,e,t)}var O3,mE,U3,F3;O3=function(n,e){for(var t=e.child;t!==null;){if(t.tag===5||t.tag===6)n.appendChild(t.stateNode);else if(t.tag!==4&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return;t=t.return}t.sibling.return=t.return,t=t.sibling}};mE=function(){};U3=function(n,e,t,i){var r=n.memoizedProps;if(r!==i){n=e.stateNode,Dc(mo.current);var s=null;switch(t){case"input":r=U1(n,r),i=U1(n,i),s=[];break;case"select":r=Hn({},r,{value:void 0}),i=Hn({},i,{value:void 0}),s=[];break;case"textarea":r=B1(n,r),i=B1(n,i),s=[];break;default:typeof r.onClick!="function"&&typeof i.onClick=="function"&&(n.onclick=Gv)}H1(t,i);var o;t=null;for(c in r)if(!i.hasOwnProperty(c)&&r.hasOwnProperty(c)&&r[c]!=null)if(c==="style"){var a=r[c];for(o in a)a.hasOwnProperty(o)&&(t||(t={}),t[o]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Ap.hasOwnProperty(c)?s||(s=[]):(s=s||[]).push(c,null));for(c in i){var l=i[c];if(a=r!=null?r[c]:void 0,i.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(t||(t={}),t[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(t||(t={}),t[o]=l[o])}else t||(s||(s=[]),s.push(c,t)),t=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(s=s||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Ap.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&Pn("scroll",n),s||a===l||(s=[])):(s=s||[]).push(c,l))}t&&(s=s||[]).push("style",t);var c=s;(e.updateQueue=c)&&(e.flags|=4)}};F3=function(n,e,t,i){t!==i&&(e.flags|=4)};function gf(n,e){if(!Nn)switch(n.tailMode){case"hidden":e=n.tail;for(var t=null;e!==null;)e.alternate!==null&&(t=e),e=e.sibling;t===null?n.tail=null:t.sibling=null;break;case"collapsed":t=n.tail;for(var i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e||n.tail===null?n.tail=null:n.tail.sibling=null:i.sibling=null}}function ji(n){var e=n.alternate!==null&&n.alternate.child===n.child,t=0,i=0;if(e)for(var r=n.child;r!==null;)t|=r.lanes|r.childLanes,i|=r.subtreeFlags&14680064,i|=r.flags&14680064,r.return=n,r=r.sibling;else for(r=n.child;r!==null;)t|=r.lanes|r.childLanes,i|=r.subtreeFlags,i|=r.flags,r.return=n,r=r.sibling;return n.subtreeFlags|=i,n.childLanes=t,e}function W5(n,e,t){var i=e.pendingProps;switch(iA(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ji(e),null;case 1:return Ur(e.type)&&Wv(),ji(e),null;case 3:return i=e.stateNode,ed(),Rn(Or),Rn(rr),dA(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(n===null||n.child===null)&&(Qg(e)?e.flags|=4:n===null||n.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,Fs!==null&&(EE(Fs),Fs=null))),mE(n,e),ji(e),null;case 5:hA(e);var r=Dc(Up.current);if(t=e.type,n!==null&&e.stateNode!=null)U3(n,e,t,i,r),n.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!i){if(e.stateNode===null)throw Error(De(166));return ji(e),null}if(n=Dc(mo.current),Qg(e)){i=e.stateNode,t=e.type;var s=e.memoizedProps;switch(i[co]=e,i[kp]=s,n=(e.mode&1)!==0,t){case"dialog":Pn("cancel",i),Pn("close",i);break;case"iframe":case"object":case"embed":Pn("load",i);break;case"video":case"audio":for(r=0;r<\/script>",n=n.removeChild(n.firstChild)):typeof i.is=="string"?n=o.createElement(t,{is:i.is}):(n=o.createElement(t),t==="select"&&(o=n,i.multiple?o.multiple=!0:i.size&&(o.size=i.size))):n=o.createElementNS(n,t),n[co]=e,n[kp]=i,O3(n,e,!1,!1),e.stateNode=n;e:{switch(o=G1(t,i),t){case"dialog":Pn("cancel",n),Pn("close",n),r=i;break;case"iframe":case"object":case"embed":Pn("load",n),r=i;break;case"video":case"audio":for(r=0;rnd&&(e.flags|=128,i=!0,gf(s,!1),e.lanes=4194304)}else{if(!i)if(n=Qv(o),n!==null){if(e.flags|=128,i=!0,t=n.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),gf(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Nn)return ji(e),null}else 2*ti()-s.renderingStartTime>nd&&t!==1073741824&&(e.flags|=128,i=!0,gf(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(t=s.last,t!==null?t.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=ti(),e.sibling=null,t=Fn.current,An(Fn,i?t&1|2:t&1),e):(ji(e),null);case 22:case 23:return EA(),i=e.memoizedState!==null,n!==null&&n.memoizedState!==null!==i&&(e.flags|=8192),i&&e.mode&1?Yr&1073741824&&(ji(e),e.subtreeFlags&6&&(e.flags|=8192)):ji(e),null;case 24:return null;case 25:return null}throw Error(De(156,e.tag))}function j5(n,e){switch(iA(e),e.tag){case 1:return Ur(e.type)&&Wv(),n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 3:return ed(),Rn(Or),Rn(rr),dA(),n=e.flags,n&65536&&!(n&128)?(e.flags=n&-65537|128,e):null;case 5:return hA(e),null;case 13:if(Rn(Fn),n=e.memoizedState,n!==null&&n.dehydrated!==null){if(e.alternate===null)throw Error(De(340));Jh()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 19:return Rn(Fn),null;case 4:return ed(),null;case 10:return aA(e.type._context),null;case 22:case 23:return EA(),null;case 24:return null;default:return null}}var ey=!1,Ji=!1,X5=typeof WeakSet=="function"?WeakSet:Set,at=null;function Eh(n,e){var t=n.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(i){Xn(n,e,i)}else t.current=null}function gE(n,e,t){try{t()}catch(i){Xn(n,e,i)}}var eR=!1;function q5(n,e){if(Z1=Bv,n=GD(),tA(n)){if("selectionStart"in n)var t={start:n.selectionStart,end:n.selectionEnd};else e:{t=(t=n.ownerDocument)&&t.defaultView||window;var i=t.getSelection&&t.getSelection();if(i&&i.rangeCount!==0){t=i.anchorNode;var r=i.anchorOffset,s=i.focusNode;i=i.focusOffset;try{t.nodeType,s.nodeType}catch{t=null;break e}var o=0,a=-1,l=-1,c=0,d=0,f=n,p=null;t:for(;;){for(var m;f!==t||r!==0&&f.nodeType!==3||(a=o+r),f!==s||i!==0&&f.nodeType!==3||(l=o+i),f.nodeType===3&&(o+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===n)break t;if(p===t&&++c===r&&(a=o),p===s&&++d===i&&(l=o),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}t=a===-1||l===-1?null:{start:a,end:l}}else t=null}t=t||{start:0,end:0}}else t=null;for(eE={focusedElem:n,selectionRange:t},Bv=!1,at=e;at!==null;)if(e=at,n=e.child,(e.subtreeFlags&1028)!==0&&n!==null)n.return=e,at=n;else for(;at!==null;){e=at;try{var _=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(_!==null){var S=_.memoizedProps,x=_.memoizedState,y=e.stateNode,E=y.getSnapshotBeforeUpdate(e.elementType===e.type?S:ks(e.type,S),x);y.__reactInternalSnapshotBeforeUpdate=E}break;case 3:var w=e.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(De(163))}}catch(M){Xn(e,e.return,M)}if(n=e.sibling,n!==null){n.return=e.return,at=n;break}at=e.return}return _=eR,eR=!1,_}function ip(n,e,t){var i=e.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var r=i=i.next;do{if((r.tag&n)===n){var s=r.destroy;r.destroy=void 0,s!==void 0&&gE(e,t,s)}r=r.next}while(r!==i)}}function C_(n,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var t=e=e.next;do{if((t.tag&n)===n){var i=t.create;t.destroy=i()}t=t.next}while(t!==e)}}function yE(n){var e=n.ref;if(e!==null){var t=n.stateNode;switch(n.tag){case 5:n=t;break;default:n=t}typeof e=="function"?e(n):e.current=n}}function V3(n){var e=n.alternate;e!==null&&(n.alternate=null,V3(e)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(e=n.stateNode,e!==null&&(delete e[co],delete e[kp],delete e[iE],delete e[P5],delete e[R5])),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}function B3(n){return n.tag===5||n.tag===3||n.tag===4}function tR(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||B3(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function vE(n,e,t){var i=n.tag;if(i===5||i===6)n=n.stateNode,e?t.nodeType===8?t.parentNode.insertBefore(n,e):t.insertBefore(n,e):(t.nodeType===8?(e=t.parentNode,e.insertBefore(n,t)):(e=t,e.appendChild(n)),t=t._reactRootContainer,t!=null||e.onclick!==null||(e.onclick=Gv));else if(i!==4&&(n=n.child,n!==null))for(vE(n,e,t),n=n.sibling;n!==null;)vE(n,e,t),n=n.sibling}function _E(n,e,t){var i=n.tag;if(i===5||i===6)n=n.stateNode,e?t.insertBefore(n,e):t.appendChild(n);else if(i!==4&&(n=n.child,n!==null))for(_E(n,e,t),n=n.sibling;n!==null;)_E(n,e,t),n=n.sibling}var Ri=null,Us=!1;function Da(n,e,t){for(t=t.child;t!==null;)z3(n,e,t),t=t.sibling}function z3(n,e,t){if(po&&typeof po.onCommitFiberUnmount=="function")try{po.onCommitFiberUnmount(__,t)}catch{}switch(t.tag){case 5:Ji||Eh(t,e);case 6:var i=Ri,r=Us;Ri=null,Da(n,e,t),Ri=i,Us=r,Ri!==null&&(Us?(n=Ri,t=t.stateNode,n.nodeType===8?n.parentNode.removeChild(t):n.removeChild(t)):Ri.removeChild(t.stateNode));break;case 18:Ri!==null&&(Us?(n=Ri,t=t.stateNode,n.nodeType===8?KS(n.parentNode,t):n.nodeType===1&&KS(n,t),Rp(n)):KS(Ri,t.stateNode));break;case 4:i=Ri,r=Us,Ri=t.stateNode.containerInfo,Us=!0,Da(n,e,t),Ri=i,Us=r;break;case 0:case 11:case 14:case 15:if(!Ji&&(i=t.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){r=i=i.next;do{var s=r,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&gE(t,e,o),r=r.next}while(r!==i)}Da(n,e,t);break;case 1:if(!Ji&&(Eh(t,e),i=t.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=t.memoizedProps,i.state=t.memoizedState,i.componentWillUnmount()}catch(a){Xn(t,e,a)}Da(n,e,t);break;case 21:Da(n,e,t);break;case 22:t.mode&1?(Ji=(i=Ji)||t.memoizedState!==null,Da(n,e,t),Ji=i):Da(n,e,t);break;default:Da(n,e,t)}}function nR(n){var e=n.updateQueue;if(e!==null){n.updateQueue=null;var t=n.stateNode;t===null&&(t=n.stateNode=new X5),e.forEach(function(i){var r=n6.bind(null,n,i);t.has(i)||(t.add(i),i.then(r,r))})}}function Is(n,e){var t=e.deletions;if(t!==null)for(var i=0;ir&&(r=o),i&=~s}if(i=r,i=ti()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Y5(i/1960))-i,10n?16:n,rl===null)var i=!1;else{if(n=rl,rl=null,n0=0,on&6)throw Error(De(331));var r=on;for(on|=4,at=n.current;at!==null;){var s=at,o=s.child;if(at.flags&16){var a=s.deletions;if(a!==null){for(var l=0;lti()-SA?Hc(n,0):xA|=t),Fr(n,e)}function Y3(n,e){e===0&&(n.mode&1?(e=jg,jg<<=1,!(jg&130023424)&&(jg=4194304)):e=1);var t=gr();n=aa(n,e),n!==null&&(Em(n,e,t),Fr(n,t))}function t6(n){var e=n.memoizedState,t=0;e!==null&&(t=e.retryLane),Y3(n,t)}function n6(n,e){var t=0;switch(n.tag){case 13:var i=n.stateNode,r=n.memoizedState;r!==null&&(t=r.retryLane);break;case 19:i=n.stateNode;break;default:throw Error(De(314))}i!==null&&i.delete(e),Y3(n,t)}var K3;K3=function(n,e,t){if(n!==null)if(n.memoizedProps!==e.pendingProps||Or.current)Dr=!0;else{if(!(n.lanes&t)&&!(e.flags&128))return Dr=!1,G5(n,e,t);Dr=!!(n.flags&131072)}else Dr=!1,Nn&&e.flags&1048576&&e3(e,qv,e.index);switch(e.lanes=0,e.tag){case 2:var i=e.type;yv(n,e),n=e.pendingProps;var r=Qh(e,rr.current);zh(e,t),r=pA(null,e,i,n,r,t);var s=mA();return e.flags|=1,typeof r=="object"&&r!==null&&typeof r.render=="function"&&r.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Ur(i)?(s=!0,jv(e)):s=!1,e.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,cA(e),r.updater=M_,e.stateNode=r,r._reactInternals=e,cE(e,i,n,t),e=dE(null,e,i,!0,s,t)):(e.tag=0,Nn&&s&&nA(e),fr(null,e,r,t),e=e.child),e;case 16:i=e.elementType;e:{switch(yv(n,e),n=e.pendingProps,r=i._init,i=r(i._payload),e.type=i,r=e.tag=r6(i),n=ks(i,n),r){case 0:e=hE(null,e,i,n,t);break e;case 1:e=QP(null,e,i,n,t);break e;case 11:e=YP(null,e,i,n,t);break e;case 14:e=KP(null,e,i,ks(i.type,n),t);break e}throw Error(De(306,i,""))}return e;case 0:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:ks(i,r),hE(n,e,i,r,t);case 1:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:ks(i,r),QP(n,e,i,r,t);case 3:e:{if(N3(e),n===null)throw Error(De(387));i=e.pendingProps,s=e.memoizedState,r=s.element,o3(n,e),Kv(e,i,null,t);var o=e.memoizedState;if(i=o.element,s.isDehydrated)if(s={element:i,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){r=td(Error(De(423)),e),e=JP(n,e,i,t,r);break e}else if(i!==r){r=td(Error(De(424)),e),e=JP(n,e,i,t,r);break e}else for(Qr=hl(e.stateNode.containerInfo.firstChild),Jr=e,Nn=!0,Fs=null,t=r3(e,null,i,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(Jh(),i===r){e=la(n,e,t);break e}fr(n,e,i,t)}e=e.child}return e;case 5:return a3(e),n===null&&oE(e),i=e.type,r=e.pendingProps,s=n!==null?n.memoizedProps:null,o=r.children,tE(i,r)?o=null:s!==null&&tE(i,s)&&(e.flags|=32),L3(n,e),fr(n,e,o,t),e.child;case 6:return n===null&&oE(e),null;case 13:return D3(n,e,t);case 4:return uA(e,e.stateNode.containerInfo),i=e.pendingProps,n===null?e.child=Zh(e,null,i,t):fr(n,e,i,t),e.child;case 11:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:ks(i,r),YP(n,e,i,r,t);case 7:return fr(n,e,e.pendingProps,t),e.child;case 8:return fr(n,e,e.pendingProps.children,t),e.child;case 12:return fr(n,e,e.pendingProps.children,t),e.child;case 10:e:{if(i=e.type._context,r=e.pendingProps,s=e.memoizedProps,o=r.value,An($v,i._currentValue),i._currentValue=o,s!==null)if(Ws(s.value,o)){if(s.children===r.children&&!Or.current){e=la(n,e,t);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===i){if(s.tag===1){l=ta(-1,t&-t),l.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?l.next=l:(l.next=d.next,d.next=l),c.pending=l}}s.lanes|=t,l=s.alternate,l!==null&&(l.lanes|=t),aE(s.return,t,e),a.lanes|=t;break}l=l.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(De(341));o.lanes|=t,a=o.alternate,a!==null&&(a.lanes|=t),aE(o,t,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}fr(n,e,r.children,t),e=e.child}return e;case 9:return r=e.type,i=e.pendingProps.children,zh(e,t),r=As(r),i=i(r),e.flags|=1,fr(n,e,i,t),e.child;case 14:return i=e.type,r=ks(i,e.pendingProps),r=ks(i.type,r),KP(n,e,i,r,t);case 15:return R3(n,e,e.type,e.pendingProps,t);case 17:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:ks(i,r),yv(n,e),e.tag=1,Ur(i)?(n=!0,jv(e)):n=!1,zh(e,t),C3(e,i,r),cE(e,i,r,t),dE(null,e,i,!0,n,t);case 19:return k3(n,e,t);case 22:return I3(n,e,t)}throw Error(De(156,e.tag))};function Q3(n,e){return TD(n,e)}function i6(n,e,t,i){this.tag=n,this.key=t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ws(n,e,t,i){return new i6(n,e,t,i)}function AA(n){return n=n.prototype,!(!n||!n.isReactComponent)}function r6(n){if(typeof n=="function")return AA(n)?1:0;if(n!=null){if(n=n.$$typeof,n===WT)return 11;if(n===jT)return 14}return 2}function ml(n,e){var t=n.alternate;return t===null?(t=ws(n.tag,e,n.key,n.mode),t.elementType=n.elementType,t.type=n.type,t.stateNode=n.stateNode,t.alternate=n,n.alternate=t):(t.pendingProps=e,t.type=n.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=n.flags&14680064,t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},t.sibling=n.sibling,t.index=n.index,t.ref=n.ref,t}function xv(n,e,t,i,r,s){var o=2;if(i=n,typeof n=="function")AA(n)&&(o=1);else if(typeof n=="string")o=5;else e:switch(n){case ph:return Gc(t.children,r,s,e);case GT:o=8,r|=8;break;case N1:return n=ws(12,t,e,r|2),n.elementType=N1,n.lanes=s,n;case D1:return n=ws(13,t,e,r),n.elementType=D1,n.lanes=s,n;case k1:return n=ws(19,t,e,r),n.elementType=k1,n.lanes=s,n;case aD:return P_(t,r,s,e);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case sD:o=10;break e;case oD:o=9;break e;case WT:o=11;break e;case jT:o=14;break e;case qa:o=16,i=null;break e}throw Error(De(130,n==null?n:typeof n,""))}return e=ws(o,t,e,r),e.elementType=n,e.type=i,e.lanes=s,e}function Gc(n,e,t,i){return n=ws(7,n,i,e),n.lanes=t,n}function P_(n,e,t,i){return n=ws(22,n,i,e),n.elementType=aD,n.lanes=t,n.stateNode={isHidden:!1},n}function rw(n,e,t){return n=ws(6,n,null,e),n.lanes=t,n}function sw(n,e,t){return e=ws(4,n.children!==null?n.children:[],n.key,e),e.lanes=t,e.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},e}function s6(n,e,t,i,r){this.tag=e,this.containerInfo=n,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=VS(0),this.expirationTimes=VS(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=VS(0),this.identifierPrefix=i,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function MA(n,e,t,i,r,s,o,a,l){return n=new s6(n,e,t,a,l),e===1?(e=1,s===!0&&(e|=8)):e=0,s=ws(3,null,null,e),n.current=s,s.stateNode=n,s.memoizedState={element:i,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},cA(s),n}function o6(n,e,t){var i=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(tk)}catch(n){console.error(n)}}tk(),tD.exports=ns;var h6=tD.exports,nk,uR=h6;nk=I1.createRoot=uR.createRoot,I1.hydrateRoot=uR.hydrateRoot;/** * @remix-run/router v1.20.0 * * Copyright (c) Remix Software Inc. @@ -46,7 +46,7 @@ Error generating stack: `+s.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Hp(){return Hp=Object.assign?Object.assign.bind():function(n){for(var e=1;e"u")throw new Error(e)}function ik(n,e){if(!n){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function d6(){return Math.random().toString(36).substr(2,8)}function dR(n,e){return{usr:n.state,key:n.key,idx:e}}function TE(n,e,t,i){return t===void 0&&(t=null),Hp({pathname:typeof n=="string"?n:n.pathname,search:"",hash:""},typeof e=="string"?Sd(e):e,{state:t,key:e&&e.key||i||d6()})}function s0(n){let{pathname:e="/",search:t="",hash:i=""}=n;return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),i&&i!=="#"&&(e+=i.charAt(0)==="#"?i:"#"+i),e}function Sd(n){let e={};if(n){let t=n.indexOf("#");t>=0&&(e.hash=n.substr(t),n=n.substr(0,t));let i=n.indexOf("?");i>=0&&(e.search=n.substr(i),n=n.substr(0,i)),n&&(e.pathname=n)}return e}function f6(n,e,t,i){i===void 0&&(i={});let{window:r=document.defaultView,v5Compat:s=!1}=i,o=r.history,a=sl.Pop,l=null,c=d();c==null&&(c=0,o.replaceState(Hp({},o.state,{idx:c}),""));function d(){return(o.state||{idx:null}).idx}function f(){a=sl.Pop;let x=d(),y=x==null?null:x-c;c=x,l&&l({action:a,location:S.location,delta:y})}function p(x,y){a=sl.Push;let E=TE(S.location,x,y);t&&t(E,x),c=d()+1;let w=dR(E,c),M=S.createHref(E);try{o.pushState(w,"",M)}catch(O){if(O instanceof DOMException&&O.name==="DataCloneError")throw O;r.location.assign(M)}s&&l&&l({action:a,location:S.location,delta:1})}function m(x,y){a=sl.Replace;let E=TE(S.location,x,y);t&&t(E,x),c=d();let w=dR(E,c),M=S.createHref(E);o.replaceState(w,"",M),s&&l&&l({action:a,location:S.location,delta:0})}function _(x){let y=r.location.origin!=="null"?r.location.origin:r.location.href,E=typeof x=="string"?x:s0(x);return E=E.replace(/ $/,"%20"),ii(y,"No window.location.(origin|href) available to create URL for href: "+E),new URL(E,y)}let S={get action(){return a},get location(){return n(r,o)},listen(x){if(l)throw new Error("A history only accepts one active listener");return r.addEventListener(hR,f),l=x,()=>{r.removeEventListener(hR,f),l=null}},createHref(x){return e(r,x)},createURL:_,encodeLocation(x){let y=_(x);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:p,replace:m,go(x){return o.go(x)}};return S}var fR;(function(n){n.data="data",n.deferred="deferred",n.redirect="redirect",n.error="error"})(fR||(fR={}));function p6(n,e,t){return t===void 0&&(t="/"),m6(n,e,t,!1)}function m6(n,e,t,i){let r=typeof e=="string"?Sd(e):e,s=RA(r.pathname||"/",t);if(s==null)return null;let o=rk(n);g6(o);let a=null;for(let l=0;a==null&&l{let l={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};l.relativePath.startsWith("/")&&(ii(l.relativePath.startsWith(i),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+i+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(i.length));let c=gl([i,l.relativePath]),d=t.concat(l);s.children&&s.children.length>0&&(ii(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),rk(s.children,e,d,c)),!(s.path==null&&!s.index)&&e.push({path:c,score:E6(c,s.index),routesMeta:d})};return n.forEach((s,o)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))r(s,o);else for(let l of sk(s.path))r(s,o,l)}),e}function sk(n){let e=n.split("/");if(e.length===0)return[];let[t,...i]=e,r=t.endsWith("?"),s=t.replace(/\?$/,"");if(i.length===0)return r?[s,""]:[s];let o=sk(i.join("/")),a=[];return a.push(...o.map(l=>l===""?s:[s,l].join("/"))),r&&a.push(...o),a.map(l=>n.startsWith("/")&&l===""?"/":l)}function g6(n){n.sort((e,t)=>e.score!==t.score?t.score-e.score:T6(e.routesMeta.map(i=>i.childrenIndex),t.routesMeta.map(i=>i.childrenIndex)))}const y6=/^:[\w-]+$/,v6=3,_6=2,x6=1,S6=10,w6=-2,pR=n=>n==="*";function E6(n,e){let t=n.split("/"),i=t.length;return t.some(pR)&&(i+=w6),e&&(i+=_6),t.filter(r=>!pR(r)).reduce((r,s)=>r+(y6.test(s)?v6:s===""?x6:S6),i)}function T6(n,e){return n.length===e.length&&n.slice(0,-1).every((i,r)=>i===e[r])?n[n.length-1]-e[e.length-1]:0}function A6(n,e,t){t===void 0&&(t=!1);let{routesMeta:i}=n,r={},s="/",o=[];for(let a=0;a{let{paramName:p,isOptional:m}=d;if(p==="*"){let S=a[f]||"";o=s.slice(0,s.length-S.length).replace(/(.)\/+$/,"$1")}const _=a[f];return m&&!_?c[p]=void 0:c[p]=(_||"").replace(/%2F/g,"/"),c},{}),pathname:s,pathnameBase:o,pattern:n}}function M6(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!0),ik(n==="*"||!n.endsWith("*")||n.endsWith("/*"),'Route path "'+n+'" will be treated as if it were '+('"'+n.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+n.replace(/\*$/,"/*")+'".'));let i=[],r="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,l)=>(i.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return n.endsWith("*")?(i.push({paramName:"*"}),r+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):t?r+="\\/*$":n!==""&&n!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,e?void 0:"i"),i]}function C6(n){try{return n.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return ik(!1,'The URL path "'+n+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),n}}function RA(n,e){if(e==="/")return n;if(!n.toLowerCase().startsWith(e.toLowerCase()))return null;let t=e.endsWith("/")?e.length-1:e.length,i=n.charAt(t);return i&&i!=="/"?null:n.slice(t)||"/"}function b6(n,e){e===void 0&&(e="/");let{pathname:t,search:i="",hash:r=""}=typeof n=="string"?Sd(n):n;return{pathname:t?t.startsWith("/")?t:P6(t,e):e,search:L6(i),hash:N6(r)}}function P6(n,e){let t=e.replace(/\/+$/,"").split("/");return n.split("/").forEach(r=>{r===".."?t.length>1&&t.pop():r!=="."&&t.push(r)}),t.length>1?t.join("/"):"/"}function ow(n,e,t,i){return"Cannot include a '"+n+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(i)+"]. Please separate it out to the ")+("`to."+t+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function R6(n){return n.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function IA(n,e){let t=R6(n);return e?t.map((i,r)=>r===t.length-1?i.pathname:i.pathnameBase):t.map(i=>i.pathnameBase)}function LA(n,e,t,i){i===void 0&&(i=!1);let r;typeof n=="string"?r=Sd(n):(r=Hp({},n),ii(!r.pathname||!r.pathname.includes("?"),ow("?","pathname","search",r)),ii(!r.pathname||!r.pathname.includes("#"),ow("#","pathname","hash",r)),ii(!r.search||!r.search.includes("#"),ow("#","search","hash",r)));let s=n===""||r.pathname==="",o=s?"/":r.pathname,a;if(o==null)a=t;else{let f=e.length-1;if(!i&&o.startsWith("..")){let p=o.split("/");for(;p[0]==="..";)p.shift(),f-=1;r.pathname=p.join("/")}a=f>=0?e[f]:"/"}let l=b6(r,a),c=o&&o!=="/"&&o.endsWith("/"),d=(s||o===".")&&t.endsWith("/");return!l.pathname.endsWith("/")&&(c||d)&&(l.pathname+="/"),l}const gl=n=>n.join("/").replace(/\/\/+/g,"/"),I6=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),L6=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,N6=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n;function D6(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}const ok=["post","put","patch","delete"];new Set(ok);const k6=["get",...ok];new Set(k6);/** + */function Hp(){return Hp=Object.assign?Object.assign.bind():function(n){for(var e=1;e"u")throw new Error(e)}function ik(n,e){if(!n){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function f6(){return Math.random().toString(36).substr(2,8)}function dR(n,e){return{usr:n.state,key:n.key,idx:e}}function TE(n,e,t,i){return t===void 0&&(t=null),Hp({pathname:typeof n=="string"?n:n.pathname,search:"",hash:""},typeof e=="string"?Sd(e):e,{state:t,key:e&&e.key||i||f6()})}function s0(n){let{pathname:e="/",search:t="",hash:i=""}=n;return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),i&&i!=="#"&&(e+=i.charAt(0)==="#"?i:"#"+i),e}function Sd(n){let e={};if(n){let t=n.indexOf("#");t>=0&&(e.hash=n.substr(t),n=n.substr(0,t));let i=n.indexOf("?");i>=0&&(e.search=n.substr(i),n=n.substr(0,i)),n&&(e.pathname=n)}return e}function p6(n,e,t,i){i===void 0&&(i={});let{window:r=document.defaultView,v5Compat:s=!1}=i,o=r.history,a=sl.Pop,l=null,c=d();c==null&&(c=0,o.replaceState(Hp({},o.state,{idx:c}),""));function d(){return(o.state||{idx:null}).idx}function f(){a=sl.Pop;let x=d(),y=x==null?null:x-c;c=x,l&&l({action:a,location:S.location,delta:y})}function p(x,y){a=sl.Push;let E=TE(S.location,x,y);t&&t(E,x),c=d()+1;let w=dR(E,c),M=S.createHref(E);try{o.pushState(w,"",M)}catch(O){if(O instanceof DOMException&&O.name==="DataCloneError")throw O;r.location.assign(M)}s&&l&&l({action:a,location:S.location,delta:1})}function m(x,y){a=sl.Replace;let E=TE(S.location,x,y);t&&t(E,x),c=d();let w=dR(E,c),M=S.createHref(E);o.replaceState(w,"",M),s&&l&&l({action:a,location:S.location,delta:0})}function _(x){let y=r.location.origin!=="null"?r.location.origin:r.location.href,E=typeof x=="string"?x:s0(x);return E=E.replace(/ $/,"%20"),ii(y,"No window.location.(origin|href) available to create URL for href: "+E),new URL(E,y)}let S={get action(){return a},get location(){return n(r,o)},listen(x){if(l)throw new Error("A history only accepts one active listener");return r.addEventListener(hR,f),l=x,()=>{r.removeEventListener(hR,f),l=null}},createHref(x){return e(r,x)},createURL:_,encodeLocation(x){let y=_(x);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:p,replace:m,go(x){return o.go(x)}};return S}var fR;(function(n){n.data="data",n.deferred="deferred",n.redirect="redirect",n.error="error"})(fR||(fR={}));function m6(n,e,t){return t===void 0&&(t="/"),g6(n,e,t,!1)}function g6(n,e,t,i){let r=typeof e=="string"?Sd(e):e,s=RA(r.pathname||"/",t);if(s==null)return null;let o=rk(n);y6(o);let a=null;for(let l=0;a==null&&l{let l={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};l.relativePath.startsWith("/")&&(ii(l.relativePath.startsWith(i),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+i+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(i.length));let c=gl([i,l.relativePath]),d=t.concat(l);s.children&&s.children.length>0&&(ii(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),rk(s.children,e,d,c)),!(s.path==null&&!s.index)&&e.push({path:c,score:T6(c,s.index),routesMeta:d})};return n.forEach((s,o)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))r(s,o);else for(let l of sk(s.path))r(s,o,l)}),e}function sk(n){let e=n.split("/");if(e.length===0)return[];let[t,...i]=e,r=t.endsWith("?"),s=t.replace(/\?$/,"");if(i.length===0)return r?[s,""]:[s];let o=sk(i.join("/")),a=[];return a.push(...o.map(l=>l===""?s:[s,l].join("/"))),r&&a.push(...o),a.map(l=>n.startsWith("/")&&l===""?"/":l)}function y6(n){n.sort((e,t)=>e.score!==t.score?t.score-e.score:A6(e.routesMeta.map(i=>i.childrenIndex),t.routesMeta.map(i=>i.childrenIndex)))}const v6=/^:[\w-]+$/,_6=3,x6=2,S6=1,w6=10,E6=-2,pR=n=>n==="*";function T6(n,e){let t=n.split("/"),i=t.length;return t.some(pR)&&(i+=E6),e&&(i+=x6),t.filter(r=>!pR(r)).reduce((r,s)=>r+(v6.test(s)?_6:s===""?S6:w6),i)}function A6(n,e){return n.length===e.length&&n.slice(0,-1).every((i,r)=>i===e[r])?n[n.length-1]-e[e.length-1]:0}function M6(n,e,t){t===void 0&&(t=!1);let{routesMeta:i}=n,r={},s="/",o=[];for(let a=0;a{let{paramName:p,isOptional:m}=d;if(p==="*"){let S=a[f]||"";o=s.slice(0,s.length-S.length).replace(/(.)\/+$/,"$1")}const _=a[f];return m&&!_?c[p]=void 0:c[p]=(_||"").replace(/%2F/g,"/"),c},{}),pathname:s,pathnameBase:o,pattern:n}}function C6(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!0),ik(n==="*"||!n.endsWith("*")||n.endsWith("/*"),'Route path "'+n+'" will be treated as if it were '+('"'+n.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+n.replace(/\*$/,"/*")+'".'));let i=[],r="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,l)=>(i.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return n.endsWith("*")?(i.push({paramName:"*"}),r+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):t?r+="\\/*$":n!==""&&n!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,e?void 0:"i"),i]}function b6(n){try{return n.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return ik(!1,'The URL path "'+n+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),n}}function RA(n,e){if(e==="/")return n;if(!n.toLowerCase().startsWith(e.toLowerCase()))return null;let t=e.endsWith("/")?e.length-1:e.length,i=n.charAt(t);return i&&i!=="/"?null:n.slice(t)||"/"}function P6(n,e){e===void 0&&(e="/");let{pathname:t,search:i="",hash:r=""}=typeof n=="string"?Sd(n):n;return{pathname:t?t.startsWith("/")?t:R6(t,e):e,search:N6(i),hash:D6(r)}}function R6(n,e){let t=e.replace(/\/+$/,"").split("/");return n.split("/").forEach(r=>{r===".."?t.length>1&&t.pop():r!=="."&&t.push(r)}),t.length>1?t.join("/"):"/"}function ow(n,e,t,i){return"Cannot include a '"+n+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(i)+"]. Please separate it out to the ")+("`to."+t+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function I6(n){return n.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function IA(n,e){let t=I6(n);return e?t.map((i,r)=>r===t.length-1?i.pathname:i.pathnameBase):t.map(i=>i.pathnameBase)}function LA(n,e,t,i){i===void 0&&(i=!1);let r;typeof n=="string"?r=Sd(n):(r=Hp({},n),ii(!r.pathname||!r.pathname.includes("?"),ow("?","pathname","search",r)),ii(!r.pathname||!r.pathname.includes("#"),ow("#","pathname","hash",r)),ii(!r.search||!r.search.includes("#"),ow("#","search","hash",r)));let s=n===""||r.pathname==="",o=s?"/":r.pathname,a;if(o==null)a=t;else{let f=e.length-1;if(!i&&o.startsWith("..")){let p=o.split("/");for(;p[0]==="..";)p.shift(),f-=1;r.pathname=p.join("/")}a=f>=0?e[f]:"/"}let l=P6(r,a),c=o&&o!=="/"&&o.endsWith("/"),d=(s||o===".")&&t.endsWith("/");return!l.pathname.endsWith("/")&&(c||d)&&(l.pathname+="/"),l}const gl=n=>n.join("/").replace(/\/\/+/g,"/"),L6=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),N6=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,D6=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n;function k6(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}const ok=["post","put","patch","delete"];new Set(ok);const O6=["get",...ok];new Set(O6);/** * React Router v6.27.0 * * Copyright (c) Remix Software Inc. @@ -55,7 +55,7 @@ Error generating stack: `+s.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Gp(){return Gp=Object.assign?Object.assign.bind():function(n){for(var e=1;e{a.current=!0}),q.useCallback(function(c,d){if(d===void 0&&(d={}),!a.current)return;if(typeof c=="number"){i.go(c);return}let f=LA(c,JSON.parse(o),s,d.relative==="path");n==null&&e!=="/"&&(f.pathname=f.pathname==="/"?e:gl([e,f.pathname])),(d.replace?i.replace:i.push)(f,d.state,d)},[e,i,o,s,n])}const V6=q.createContext(null);function B6(n){let e=q.useContext(va).outlet;return e&&q.createElement(V6.Provider,{value:n},e)}function ck(n,e){let{relative:t}=e===void 0?{}:e,{future:i}=q.useContext(kl),{matches:r}=q.useContext(va),{pathname:s}=Cm(),o=JSON.stringify(IA(r,i.v7_relativeSplatPath));return q.useMemo(()=>LA(n,JSON.parse(o),s,t==="path"),[n,o,s,t])}function z6(n,e){return H6(n,e)}function H6(n,e,t,i){wd()||ii(!1);let{navigator:r}=q.useContext(kl),{matches:s}=q.useContext(va),o=s[s.length-1],a=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let c=Cm(),d;if(e){var f;let x=typeof e=="string"?Sd(e):e;l==="/"||(f=x.pathname)!=null&&f.startsWith(l)||ii(!1),d=x}else d=c;let p=d.pathname||"/",m=p;if(l!=="/"){let x=l.replace(/^\//,"").split("/");m="/"+p.replace(/^\//,"").split("/").slice(x.length).join("/")}let _=p6(n,{pathname:m}),S=q6(_&&_.map(x=>Object.assign({},x,{params:Object.assign({},a,x.params),pathname:gl([l,r.encodeLocation?r.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?l:gl([l,r.encodeLocation?r.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),s,t,i);return e&&S?q.createElement(D_.Provider,{value:{location:Gp({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:sl.Pop}},S):S}function G6(){let n=Q6(),e=D6(n)?n.status+" "+n.statusText:n instanceof Error?n.message:JSON.stringify(n),t=n instanceof Error?n.stack:null,r={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},s=null;return q.createElement(q.Fragment,null,q.createElement("h2",null,"Unexpected Application Error!"),q.createElement("h3",{style:{fontStyle:"italic"}},e),t?q.createElement("pre",{style:r},t):null,s)}const W6=q.createElement(G6,null);class j6 extends q.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?q.createElement(va.Provider,{value:this.props.routeContext},q.createElement(ak.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function X6(n){let{routeContext:e,match:t,children:i}=n,r=q.useContext(NA);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),q.createElement(va.Provider,{value:e},i)}function q6(n,e,t,i){var r;if(e===void 0&&(e=[]),t===void 0&&(t=null),i===void 0&&(i=null),n==null){var s;if(!t)return null;if(t.errors)n=t.matches;else if((s=i)!=null&&s.v7_partialHydration&&e.length===0&&!t.initialized&&t.matches.length>0)n=t.matches;else return null}let o=n,a=(r=t)==null?void 0:r.errors;if(a!=null){let d=o.findIndex(f=>f.route.id&&(a==null?void 0:a[f.route.id])!==void 0);d>=0||ii(!1),o=o.slice(0,Math.min(o.length,d+1))}let l=!1,c=-1;if(t&&i&&i.v7_partialHydration)for(let d=0;d=0?o=o.slice(0,c+1):o=[o[0]];break}}}return o.reduceRight((d,f,p)=>{let m,_=!1,S=null,x=null;t&&(m=a&&f.route.id?a[f.route.id]:void 0,S=f.route.errorElement||W6,l&&(c<0&&p===0?(Z6("route-fallback",!1),_=!0,x=null):c===p&&(_=!0,x=f.route.hydrateFallbackElement||null)));let y=e.concat(o.slice(0,p+1)),E=()=>{let w;return m?w=S:_?w=x:f.route.Component?w=q.createElement(f.route.Component,null):f.route.element?w=f.route.element:w=d,q.createElement(X6,{match:f,routeContext:{outlet:d,matches:y,isDataRoute:t!=null},children:w})};return t&&(f.route.ErrorBoundary||f.route.errorElement||p===0)?q.createElement(j6,{location:t.location,revalidation:t.revalidation,component:S,error:m,children:E(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):E()},null)}var uk=function(n){return n.UseBlocker="useBlocker",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n}(uk||{}),o0=function(n){return n.UseBlocker="useBlocker",n.UseLoaderData="useLoaderData",n.UseActionData="useActionData",n.UseRouteError="useRouteError",n.UseNavigation="useNavigation",n.UseRouteLoaderData="useRouteLoaderData",n.UseMatches="useMatches",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n.UseRouteId="useRouteId",n}(o0||{});function $6(n){let e=q.useContext(NA);return e||ii(!1),e}function Y6(n){let e=q.useContext(O6);return e||ii(!1),e}function K6(n){let e=q.useContext(va);return e||ii(!1),e}function hk(n){let e=K6(),t=e.matches[e.matches.length-1];return t.route.id||ii(!1),t.route.id}function Q6(){var n;let e=q.useContext(ak),t=Y6(o0.UseRouteError),i=hk(o0.UseRouteError);return e!==void 0?e:(n=t.errors)==null?void 0:n[i]}function J6(){let{router:n}=$6(uk.UseNavigateStable),e=hk(o0.UseNavigateStable),t=q.useRef(!1);return lk(()=>{t.current=!0}),q.useCallback(function(r,s){s===void 0&&(s={}),t.current&&(typeof r=="number"?n.navigate(r):n.navigate(r,Gp({fromRouteId:e},s)))},[n,e])}const gR={};function Z6(n,e,t){!e&&!gR[n]&&(gR[n]=!0)}function eH(n){let{to:e,replace:t,state:i,relative:r}=n;wd()||ii(!1);let{future:s,static:o}=q.useContext(kl),{matches:a}=q.useContext(va),{pathname:l}=Cm(),c=DA(),d=LA(e,IA(a,s.v7_relativeSplatPath),l,r==="path"),f=JSON.stringify(d);return q.useEffect(()=>c(JSON.parse(f),{replace:t,state:i,relative:r}),[c,f,r,t,i]),null}function dk(n){return B6(n.context)}function ys(n){ii(!1)}function tH(n){let{basename:e="/",children:t=null,location:i,navigationType:r=sl.Pop,navigator:s,static:o=!1,future:a}=n;wd()&&ii(!1);let l=e.replace(/^\/*/,"/"),c=q.useMemo(()=>({basename:l,navigator:s,static:o,future:Gp({v7_relativeSplatPath:!1},a)}),[l,a,s,o]);typeof i=="string"&&(i=Sd(i));let{pathname:d="/",search:f="",hash:p="",state:m=null,key:_="default"}=i,S=q.useMemo(()=>{let x=RA(d,l);return x==null?null:{location:{pathname:x,search:f,hash:p,state:m,key:_},navigationType:r}},[l,d,f,p,m,_,r]);return S==null?null:q.createElement(kl.Provider,{value:c},q.createElement(D_.Provider,{children:t,value:S}))}function nH(n){let{children:e,location:t}=n;return z6(AE(e),t)}new Promise(()=>{});function AE(n,e){e===void 0&&(e=[]);let t=[];return q.Children.forEach(n,(i,r)=>{if(!q.isValidElement(i))return;let s=[...e,r];if(i.type===q.Fragment){t.push.apply(t,AE(i.props.children,s));return}i.type!==ys&&ii(!1),!i.props.index||!i.props.children||ii(!1);let o={id:i.props.id||s.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,loader:i.props.loader,action:i.props.action,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(o.children=AE(i.props.children,s)),t.push(o)}),t}/** + */function Gp(){return Gp=Object.assign?Object.assign.bind():function(n){for(var e=1;e{a.current=!0}),q.useCallback(function(c,d){if(d===void 0&&(d={}),!a.current)return;if(typeof c=="number"){i.go(c);return}let f=LA(c,JSON.parse(o),s,d.relative==="path");n==null&&e!=="/"&&(f.pathname=f.pathname==="/"?e:gl([e,f.pathname])),(d.replace?i.replace:i.push)(f,d.state,d)},[e,i,o,s,n])}const B6=q.createContext(null);function z6(n){let e=q.useContext(va).outlet;return e&&q.createElement(B6.Provider,{value:n},e)}function ck(n,e){let{relative:t}=e===void 0?{}:e,{future:i}=q.useContext(kl),{matches:r}=q.useContext(va),{pathname:s}=Cm(),o=JSON.stringify(IA(r,i.v7_relativeSplatPath));return q.useMemo(()=>LA(n,JSON.parse(o),s,t==="path"),[n,o,s,t])}function H6(n,e){return G6(n,e)}function G6(n,e,t,i){wd()||ii(!1);let{navigator:r}=q.useContext(kl),{matches:s}=q.useContext(va),o=s[s.length-1],a=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let c=Cm(),d;if(e){var f;let x=typeof e=="string"?Sd(e):e;l==="/"||(f=x.pathname)!=null&&f.startsWith(l)||ii(!1),d=x}else d=c;let p=d.pathname||"/",m=p;if(l!=="/"){let x=l.replace(/^\//,"").split("/");m="/"+p.replace(/^\//,"").split("/").slice(x.length).join("/")}let _=m6(n,{pathname:m}),S=$6(_&&_.map(x=>Object.assign({},x,{params:Object.assign({},a,x.params),pathname:gl([l,r.encodeLocation?r.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?l:gl([l,r.encodeLocation?r.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),s,t,i);return e&&S?q.createElement(D_.Provider,{value:{location:Gp({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:sl.Pop}},S):S}function W6(){let n=J6(),e=k6(n)?n.status+" "+n.statusText:n instanceof Error?n.message:JSON.stringify(n),t=n instanceof Error?n.stack:null,r={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},s=null;return q.createElement(q.Fragment,null,q.createElement("h2",null,"Unexpected Application Error!"),q.createElement("h3",{style:{fontStyle:"italic"}},e),t?q.createElement("pre",{style:r},t):null,s)}const j6=q.createElement(W6,null);class X6 extends q.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?q.createElement(va.Provider,{value:this.props.routeContext},q.createElement(ak.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function q6(n){let{routeContext:e,match:t,children:i}=n,r=q.useContext(NA);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),q.createElement(va.Provider,{value:e},i)}function $6(n,e,t,i){var r;if(e===void 0&&(e=[]),t===void 0&&(t=null),i===void 0&&(i=null),n==null){var s;if(!t)return null;if(t.errors)n=t.matches;else if((s=i)!=null&&s.v7_partialHydration&&e.length===0&&!t.initialized&&t.matches.length>0)n=t.matches;else return null}let o=n,a=(r=t)==null?void 0:r.errors;if(a!=null){let d=o.findIndex(f=>f.route.id&&(a==null?void 0:a[f.route.id])!==void 0);d>=0||ii(!1),o=o.slice(0,Math.min(o.length,d+1))}let l=!1,c=-1;if(t&&i&&i.v7_partialHydration)for(let d=0;d=0?o=o.slice(0,c+1):o=[o[0]];break}}}return o.reduceRight((d,f,p)=>{let m,_=!1,S=null,x=null;t&&(m=a&&f.route.id?a[f.route.id]:void 0,S=f.route.errorElement||j6,l&&(c<0&&p===0?(eH("route-fallback",!1),_=!0,x=null):c===p&&(_=!0,x=f.route.hydrateFallbackElement||null)));let y=e.concat(o.slice(0,p+1)),E=()=>{let w;return m?w=S:_?w=x:f.route.Component?w=q.createElement(f.route.Component,null):f.route.element?w=f.route.element:w=d,q.createElement(q6,{match:f,routeContext:{outlet:d,matches:y,isDataRoute:t!=null},children:w})};return t&&(f.route.ErrorBoundary||f.route.errorElement||p===0)?q.createElement(X6,{location:t.location,revalidation:t.revalidation,component:S,error:m,children:E(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):E()},null)}var uk=function(n){return n.UseBlocker="useBlocker",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n}(uk||{}),o0=function(n){return n.UseBlocker="useBlocker",n.UseLoaderData="useLoaderData",n.UseActionData="useActionData",n.UseRouteError="useRouteError",n.UseNavigation="useNavigation",n.UseRouteLoaderData="useRouteLoaderData",n.UseMatches="useMatches",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n.UseRouteId="useRouteId",n}(o0||{});function Y6(n){let e=q.useContext(NA);return e||ii(!1),e}function K6(n){let e=q.useContext(U6);return e||ii(!1),e}function Q6(n){let e=q.useContext(va);return e||ii(!1),e}function hk(n){let e=Q6(),t=e.matches[e.matches.length-1];return t.route.id||ii(!1),t.route.id}function J6(){var n;let e=q.useContext(ak),t=K6(o0.UseRouteError),i=hk(o0.UseRouteError);return e!==void 0?e:(n=t.errors)==null?void 0:n[i]}function Z6(){let{router:n}=Y6(uk.UseNavigateStable),e=hk(o0.UseNavigateStable),t=q.useRef(!1);return lk(()=>{t.current=!0}),q.useCallback(function(r,s){s===void 0&&(s={}),t.current&&(typeof r=="number"?n.navigate(r):n.navigate(r,Gp({fromRouteId:e},s)))},[n,e])}const gR={};function eH(n,e,t){!e&&!gR[n]&&(gR[n]=!0)}function tH(n){let{to:e,replace:t,state:i,relative:r}=n;wd()||ii(!1);let{future:s,static:o}=q.useContext(kl),{matches:a}=q.useContext(va),{pathname:l}=Cm(),c=DA(),d=LA(e,IA(a,s.v7_relativeSplatPath),l,r==="path"),f=JSON.stringify(d);return q.useEffect(()=>c(JSON.parse(f),{replace:t,state:i,relative:r}),[c,f,r,t,i]),null}function dk(n){return z6(n.context)}function ys(n){ii(!1)}function nH(n){let{basename:e="/",children:t=null,location:i,navigationType:r=sl.Pop,navigator:s,static:o=!1,future:a}=n;wd()&&ii(!1);let l=e.replace(/^\/*/,"/"),c=q.useMemo(()=>({basename:l,navigator:s,static:o,future:Gp({v7_relativeSplatPath:!1},a)}),[l,a,s,o]);typeof i=="string"&&(i=Sd(i));let{pathname:d="/",search:f="",hash:p="",state:m=null,key:_="default"}=i,S=q.useMemo(()=>{let x=RA(d,l);return x==null?null:{location:{pathname:x,search:f,hash:p,state:m,key:_},navigationType:r}},[l,d,f,p,m,_,r]);return S==null?null:q.createElement(kl.Provider,{value:c},q.createElement(D_.Provider,{children:t,value:S}))}function iH(n){let{children:e,location:t}=n;return H6(AE(e),t)}new Promise(()=>{});function AE(n,e){e===void 0&&(e=[]);let t=[];return q.Children.forEach(n,(i,r)=>{if(!q.isValidElement(i))return;let s=[...e,r];if(i.type===q.Fragment){t.push.apply(t,AE(i.props.children,s));return}i.type!==ys&&ii(!1),!i.props.index||!i.props.children||ii(!1);let o={id:i.props.id||s.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,loader:i.props.loader,action:i.props.action,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(o.children=AE(i.props.children,s)),t.push(o)}),t}/** * React Router DOM v6.27.0 * * Copyright (c) Remix Software Inc. @@ -64,7 +64,7 @@ Error generating stack: `+s.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function ME(){return ME=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&(t[r]=n[r]);return t}function rH(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function sH(n,e){return n.button===0&&(!e||e==="_self")&&!rH(n)}const oH=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],aH="6";try{window.__reactRouterVersion=aH}catch{}const lH="startTransition",yR=ZB[lH];function cH(n){let{basename:e,children:t,future:i,window:r}=n,s=q.useRef();s.current==null&&(s.current=h6({window:r,v5Compat:!0}));let o=s.current,[a,l]=q.useState({action:o.action,location:o.location}),{v7_startTransition:c}=i||{},d=q.useCallback(f=>{c&&yR?yR(()=>l(f)):l(f)},[l,c]);return q.useLayoutEffect(()=>o.listen(d),[o,d]),q.createElement(tH,{basename:e,children:t,location:a.location,navigationType:a.action,navigator:o,future:i})}const uH=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",hH=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ac=q.forwardRef(function(e,t){let{onClick:i,relative:r,reloadDocument:s,replace:o,state:a,target:l,to:c,preventScrollReset:d,viewTransition:f}=e,p=iH(e,oH),{basename:m}=q.useContext(kl),_,S=!1;if(typeof c=="string"&&hH.test(c)&&(_=c,uH))try{let w=new URL(window.location.href),M=c.startsWith("//")?new URL(w.protocol+c):new URL(c),O=RA(M.pathname,m);M.origin===w.origin&&O!=null?c=O+M.search+M.hash:S=!0}catch{}let x=U6(c,{relative:r}),y=dH(c,{replace:o,state:a,target:l,preventScrollReset:d,relative:r,viewTransition:f});function E(w){i&&i(w),w.defaultPrevented||y(w)}return q.createElement("a",ME({},p,{href:_||x,onClick:S||s?i:E,ref:t,target:l}))});var vR;(function(n){n.UseScrollRestoration="useScrollRestoration",n.UseSubmit="useSubmit",n.UseSubmitFetcher="useSubmitFetcher",n.UseFetcher="useFetcher",n.useViewTransitionState="useViewTransitionState"})(vR||(vR={}));var _R;(function(n){n.UseFetcher="useFetcher",n.UseFetchers="useFetchers",n.UseScrollRestoration="useScrollRestoration"})(_R||(_R={}));function dH(n,e){let{target:t,replace:i,state:r,preventScrollReset:s,relative:o,viewTransition:a}=e===void 0?{}:e,l=DA(),c=Cm(),d=ck(n,{relative:o});return q.useCallback(f=>{if(sH(f,t)){f.preventDefault();let p=i!==void 0?i:s0(c)===s0(d);l(n,{replace:p,state:r,preventScrollReset:s,relative:o,viewTransition:a})}},[c,l,d,i,r,t,n,s,o,a])}const fk=q.createContext({transformPagePoint:n=>n,isStatic:!1,reducedMotion:"never"}),k_=q.createContext({}),O_=q.createContext(null),U_=typeof document<"u",kA=U_?q.useLayoutEffect:q.useEffect,pk=q.createContext({strict:!1}),OA=n=>n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),fH="framerAppearId",mk="data-"+OA(fH);function pH(n,e,t,i){const{visualElement:r}=q.useContext(k_),s=q.useContext(pk),o=q.useContext(O_),a=q.useContext(fk).reducedMotion,l=q.useRef();i=i||s.renderer,!l.current&&i&&(l.current=i(n,{visualState:e,parent:r,props:t,presenceContext:o,blockInitialAnimation:o?o.initial===!1:!1,reducedMotionConfig:a}));const c=l.current;q.useInsertionEffect(()=>{c&&c.update(t,o)});const d=q.useRef(!!(t[mk]&&!window.HandoffComplete));return kA(()=>{c&&(c.render(),d.current&&c.animationState&&c.animationState.animateChanges())}),q.useEffect(()=>{c&&(c.updateFeatures(),!d.current&&c.animationState&&c.animationState.animateChanges(),d.current&&(d.current=!1,window.HandoffComplete=!0))}),c}function Ah(n){return n&&typeof n=="object"&&Object.prototype.hasOwnProperty.call(n,"current")}function mH(n,e,t){return q.useCallback(i=>{i&&n.mount&&n.mount(i),e&&(i?e.mount(i):e.unmount()),t&&(typeof t=="function"?t(i):Ah(t)&&(t.current=i))},[e])}function Wp(n){return typeof n=="string"||Array.isArray(n)}function F_(n){return n!==null&&typeof n=="object"&&typeof n.start=="function"}const UA=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],FA=["initial",...UA];function V_(n){return F_(n.animate)||FA.some(e=>Wp(n[e]))}function gk(n){return!!(V_(n)||n.variants)}function gH(n,e){if(V_(n)){const{initial:t,animate:i}=n;return{initial:t===!1||Wp(t)?t:void 0,animate:Wp(i)?i:void 0}}return n.inherit!==!1?e:{}}function yH(n){const{initial:e,animate:t}=gH(n,q.useContext(k_));return q.useMemo(()=>({initial:e,animate:t}),[xR(e),xR(t)])}function xR(n){return Array.isArray(n)?n.join(" "):n}const SR={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},jp={};for(const n in SR)jp[n]={isEnabled:e=>SR[n].some(t=>!!e[t])};function vH(n){for(const e in n)jp[e]={...jp[e],...n[e]}}const VA=q.createContext({}),yk=q.createContext({}),_H=Symbol.for("motionComponentSymbol");function xH({preloadedFeatures:n,createVisualElement:e,useRender:t,useVisualState:i,Component:r}){n&&vH(n);function s(a,l){let c;const d={...q.useContext(fk),...a,layoutId:SH(a)},{isStatic:f}=d,p=yH(a),m=i(a,f);if(!f&&U_){p.visualElement=pH(r,m,d,e);const _=q.useContext(yk),S=q.useContext(pk).strict;p.visualElement&&(c=p.visualElement.loadFeatures(d,S,n,_))}return q.createElement(k_.Provider,{value:p},c&&p.visualElement?q.createElement(c,{visualElement:p.visualElement,...d}):null,t(r,a,mH(m,p.visualElement,l),m,f,p.visualElement))}const o=q.forwardRef(s);return o[_H]=r,o}function SH({layoutId:n}){const e=q.useContext(VA).id;return e&&n!==void 0?e+"-"+n:n}function wH(n){function e(i,r={}){return xH(n(i,r))}if(typeof Proxy>"u")return e;const t=new Map;return new Proxy(e,{get:(i,r)=>(t.has(r)||t.set(r,e(r)),t.get(r))})}const EH=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function BA(n){return typeof n!="string"||n.includes("-")?!1:!!(EH.indexOf(n)>-1||/[A-Z]/.test(n))}const a0={};function TH(n){Object.assign(a0,n)}const bm=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],mu=new Set(bm);function vk(n,{layout:e,layoutId:t}){return mu.has(n)||n.startsWith("origin")||(e||t!==void 0)&&(!!a0[n]||n==="opacity")}const Br=n=>!!(n&&n.getVelocity),AH={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},MH=bm.length;function CH(n,{enableHardwareAcceleration:e=!0,allowTransformNone:t=!0},i,r){let s="";for(let o=0;oe=>typeof e=="string"&&e.startsWith(n),xk=_k("--"),CE=_k("var(--"),bH=/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,PH=(n,e)=>e&&typeof n=="number"?e.transform(n):n,Al=(n,e,t)=>Math.min(Math.max(t,n),e),gu={test:n=>typeof n=="number",parse:parseFloat,transform:n=>n},op={...gu,transform:n=>Al(0,1,n)},iy={...gu,default:1},ap=n=>Math.round(n*1e5)/1e5,B_=/(-)?([\d]*\.?[\d])+/g,Sk=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,RH=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function Pm(n){return typeof n=="string"}const Rm=n=>({test:e=>Pm(e)&&e.endsWith(n)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${n}`}),Xa=Rm("deg"),go=Rm("%"),Ct=Rm("px"),IH=Rm("vh"),LH=Rm("vw"),wR={...go,parse:n=>go.parse(n)/100,transform:n=>go.transform(n*100)},ER={...gu,transform:Math.round},wk={borderWidth:Ct,borderTopWidth:Ct,borderRightWidth:Ct,borderBottomWidth:Ct,borderLeftWidth:Ct,borderRadius:Ct,radius:Ct,borderTopLeftRadius:Ct,borderTopRightRadius:Ct,borderBottomRightRadius:Ct,borderBottomLeftRadius:Ct,width:Ct,maxWidth:Ct,height:Ct,maxHeight:Ct,size:Ct,top:Ct,right:Ct,bottom:Ct,left:Ct,padding:Ct,paddingTop:Ct,paddingRight:Ct,paddingBottom:Ct,paddingLeft:Ct,margin:Ct,marginTop:Ct,marginRight:Ct,marginBottom:Ct,marginLeft:Ct,rotate:Xa,rotateX:Xa,rotateY:Xa,rotateZ:Xa,scale:iy,scaleX:iy,scaleY:iy,scaleZ:iy,skew:Xa,skewX:Xa,skewY:Xa,distance:Ct,translateX:Ct,translateY:Ct,translateZ:Ct,x:Ct,y:Ct,z:Ct,perspective:Ct,transformPerspective:Ct,opacity:op,originX:wR,originY:wR,originZ:Ct,zIndex:ER,fillOpacity:op,strokeOpacity:op,numOctaves:ER};function zA(n,e,t,i){const{style:r,vars:s,transform:o,transformOrigin:a}=n;let l=!1,c=!1,d=!0;for(const f in e){const p=e[f];if(xk(f)){s[f]=p;continue}const m=wk[f],_=PH(p,m);if(mu.has(f)){if(l=!0,o[f]=_,!d)continue;p!==(m.default||0)&&(d=!1)}else f.startsWith("origin")?(c=!0,a[f]=_):r[f]=_}if(e.transform||(l||i?r.transform=CH(n.transform,t,d,i):r.transform&&(r.transform="none")),c){const{originX:f="50%",originY:p="50%",originZ:m=0}=a;r.transformOrigin=`${f} ${p} ${m}`}}const HA=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Ek(n,e,t){for(const i in e)!Br(e[i])&&!vk(i,t)&&(n[i]=e[i])}function NH({transformTemplate:n},e,t){return q.useMemo(()=>{const i=HA();return zA(i,e,{enableHardwareAcceleration:!t},n),Object.assign({},i.vars,i.style)},[e])}function DH(n,e,t){const i=n.style||{},r={};return Ek(r,i,n),Object.assign(r,NH(n,e,t)),n.transformValues?n.transformValues(r):r}function kH(n,e,t){const i={},r=DH(n,e,t);return n.drag&&n.dragListener!==!1&&(i.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=n.drag===!0?"none":`pan-${n.drag==="x"?"y":"x"}`),n.tabIndex===void 0&&(n.onTap||n.onTapStart||n.whileTap)&&(i.tabIndex=0),i.style=r,i}const OH=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function l0(n){return n.startsWith("while")||n.startsWith("drag")&&n!=="draggable"||n.startsWith("layout")||n.startsWith("onTap")||n.startsWith("onPan")||n.startsWith("onLayout")||OH.has(n)}let Tk=n=>!l0(n);function UH(n){n&&(Tk=e=>e.startsWith("on")?!l0(e):n(e))}try{UH(require("@emotion/is-prop-valid").default)}catch{}function FH(n,e,t){const i={};for(const r in n)r==="values"&&typeof n.values=="object"||(Tk(r)||t===!0&&l0(r)||!e&&!l0(r)||n.draggable&&r.startsWith("onDrag"))&&(i[r]=n[r]);return i}function TR(n,e,t){return typeof n=="string"?n:Ct.transform(e+t*n)}function VH(n,e,t){const i=TR(e,n.x,n.width),r=TR(t,n.y,n.height);return`${i} ${r}`}const BH={offset:"stroke-dashoffset",array:"stroke-dasharray"},zH={offset:"strokeDashoffset",array:"strokeDasharray"};function HH(n,e,t=1,i=0,r=!0){n.pathLength=1;const s=r?BH:zH;n[s.offset]=Ct.transform(-i);const o=Ct.transform(e),a=Ct.transform(t);n[s.array]=`${o} ${a}`}function GA(n,{attrX:e,attrY:t,attrScale:i,originX:r,originY:s,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...c},d,f,p){if(zA(n,c,d,p),f){n.style.viewBox&&(n.attrs.viewBox=n.style.viewBox);return}n.attrs=n.style,n.style={};const{attrs:m,style:_,dimensions:S}=n;m.transform&&(S&&(_.transform=m.transform),delete m.transform),S&&(r!==void 0||s!==void 0||_.transform)&&(_.transformOrigin=VH(S,r!==void 0?r:.5,s!==void 0?s:.5)),e!==void 0&&(m.x=e),t!==void 0&&(m.y=t),i!==void 0&&(m.scale=i),o!==void 0&&HH(m,o,a,l,!1)}const Ak=()=>({...HA(),attrs:{}}),WA=n=>typeof n=="string"&&n.toLowerCase()==="svg";function GH(n,e,t,i){const r=q.useMemo(()=>{const s=Ak();return GA(s,e,{enableHardwareAcceleration:!1},WA(i),n.transformTemplate),{...s.attrs,style:{...s.style}}},[e]);if(n.style){const s={};Ek(s,n.style,n),r.style={...s,...r.style}}return r}function WH(n=!1){return(t,i,r,{latestValues:s},o)=>{const l=(BA(t)?GH:kH)(i,s,o,t),d={...FH(i,typeof t=="string",n),...l,ref:r},{children:f}=i,p=q.useMemo(()=>Br(f)?f.get():f,[f]);return q.createElement(t,{...d,children:p})}}function Mk(n,{style:e,vars:t},i,r){Object.assign(n.style,e,r&&r.getProjectionStyles(i));for(const s in t)n.style.setProperty(s,t[s])}const Ck=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function bk(n,e,t,i){Mk(n,e,void 0,i);for(const r in e.attrs)n.setAttribute(Ck.has(r)?r:OA(r),e.attrs[r])}function jA(n,e){const{style:t}=n,i={};for(const r in t)(Br(t[r])||e.style&&Br(e.style[r])||vk(r,n))&&(i[r]=t[r]);return i}function Pk(n,e){const t=jA(n,e);for(const i in n)if(Br(n[i])||Br(e[i])){const r=bm.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;t[r]=n[i]}return t}function XA(n,e,t,i={},r={}){return typeof e=="function"&&(e=e(t!==void 0?t:n.custom,i,r)),typeof e=="string"&&(e=n.variants&&n.variants[e]),typeof e=="function"&&(e=e(t!==void 0?t:n.custom,i,r)),e}function Rk(n){const e=q.useRef(null);return e.current===null&&(e.current=n()),e.current}const c0=n=>Array.isArray(n),jH=n=>!!(n&&typeof n=="object"&&n.mix&&n.toValue),XH=n=>c0(n)?n[n.length-1]||0:n;function Sv(n){const e=Br(n)?n.get():n;return jH(e)?e.toValue():e}function qH({scrapeMotionValuesFromProps:n,createRenderState:e,onMount:t},i,r,s){const o={latestValues:$H(i,r,s,n),renderState:e()};return t&&(o.mount=a=>t(i,a,o)),o}const Ik=n=>(e,t)=>{const i=q.useContext(k_),r=q.useContext(O_),s=()=>qH(n,e,i,r);return t?s():Rk(s)};function $H(n,e,t,i){const r={},s=i(n,{});for(const p in s)r[p]=Sv(s[p]);let{initial:o,animate:a}=n;const l=V_(n),c=gk(n);e&&c&&!l&&n.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let d=t?t.initial===!1:!1;d=d||o===!1;const f=d?a:o;return f&&typeof f!="boolean"&&!F_(f)&&(Array.isArray(f)?f:[f]).forEach(m=>{const _=XA(n,m);if(!_)return;const{transitionEnd:S,transition:x,...y}=_;for(const E in y){let w=y[E];if(Array.isArray(w)){const M=d?w.length-1:0;w=w[M]}w!==null&&(r[E]=w)}for(const E in S)r[E]=S[E]}),r}const Yn=n=>n;class AR{constructor(){this.order=[],this.scheduled=new Set}add(e){if(!this.scheduled.has(e))return this.scheduled.add(e),this.order.push(e),!0}remove(e){const t=this.order.indexOf(e);t!==-1&&(this.order.splice(t,1),this.scheduled.delete(e))}clear(){this.order.length=0,this.scheduled.clear()}}function YH(n){let e=new AR,t=new AR,i=0,r=!1,s=!1;const o=new WeakSet,a={schedule:(l,c=!1,d=!1)=>{const f=d&&r,p=f?e:t;return c&&o.add(l),p.add(l)&&f&&r&&(i=e.order.length),l},cancel:l=>{t.remove(l),o.delete(l)},process:l=>{if(r){s=!0;return}if(r=!0,[e,t]=[t,e],t.clear(),i=e.order.length,i)for(let c=0;c(f[p]=YH(()=>t=!0),f),{}),o=f=>s[f].process(r),a=()=>{const f=performance.now();t=!1,r.delta=i?1e3/60:Math.max(Math.min(f-r.timestamp,KH),1),r.timestamp=f,r.isProcessing=!0,ry.forEach(o),r.isProcessing=!1,t&&e&&(i=!1,n(a))},l=()=>{t=!0,i=!0,r.isProcessing||n(a)};return{schedule:ry.reduce((f,p)=>{const m=s[p];return f[p]=(_,S=!1,x=!1)=>(t||l(),m.schedule(_,S,x)),f},{}),cancel:f=>ry.forEach(p=>s[p].cancel(f)),state:r,steps:s}}const{schedule:Mn,cancel:ca,state:Ki,steps:aw}=QH(typeof requestAnimationFrame<"u"?requestAnimationFrame:Yn,!0),JH={useVisualState:Ik({scrapeMotionValuesFromProps:Pk,createRenderState:Ak,onMount:(n,e,{renderState:t,latestValues:i})=>{Mn.read(()=>{try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}),Mn.render(()=>{GA(t,i,{enableHardwareAcceleration:!1},WA(e.tagName),n.transformTemplate),bk(e,t)})}})},ZH={useVisualState:Ik({scrapeMotionValuesFromProps:jA,createRenderState:HA})};function e9(n,{forwardMotionProps:e=!1},t,i){return{...BA(n)?JH:ZH,preloadedFeatures:t,useRender:WH(e),createVisualElement:i,Component:n}}function Yo(n,e,t,i={passive:!0}){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t)}const Lk=n=>n.pointerType==="mouse"?typeof n.button!="number"||n.button<=0:n.isPrimary!==!1;function z_(n,e="page"){return{point:{x:n[e+"X"],y:n[e+"Y"]}}}const t9=n=>e=>Lk(e)&&n(e,z_(e));function na(n,e,t,i){return Yo(n,e,t9(t),i)}const n9=(n,e)=>t=>e(n(t)),yl=(...n)=>n.reduce(n9);function Nk(n){let e=null;return()=>{const t=()=>{e=null};return e===null?(e=n,t):!1}}const MR=Nk("dragHorizontal"),CR=Nk("dragVertical");function Dk(n){let e=!1;if(n==="y")e=CR();else if(n==="x")e=MR();else{const t=MR(),i=CR();t&&i?e=()=>{t(),i()}:(t&&t(),i&&i())}return e}function kk(){const n=Dk(!0);return n?(n(),!1):!0}class Ol{constructor(e){this.isMounted=!1,this.node=e}update(){}}function bR(n,e){const t="pointer"+(e?"enter":"leave"),i="onHover"+(e?"Start":"End"),r=(s,o)=>{if(s.pointerType==="touch"||kk())return;const a=n.getProps();n.animationState&&a.whileHover&&n.animationState.setActive("whileHover",e),a[i]&&Mn.update(()=>a[i](s,o))};return na(n.current,t,r,{passive:!n.getProps()[i]})}class i9 extends Ol{mount(){this.unmount=yl(bR(this.node,!0),bR(this.node,!1))}unmount(){}}class r9 extends Ol{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=yl(Yo(this.node.current,"focus",()=>this.onFocus()),Yo(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const Ok=(n,e)=>e?n===e?!0:Ok(n,e.parentElement):!1;function lw(n,e){if(!e)return;const t=new PointerEvent("pointer"+n);e(t,z_(t))}class s9 extends Ol{constructor(){super(...arguments),this.removeStartListeners=Yn,this.removeEndListeners=Yn,this.removeAccessibleListeners=Yn,this.startPointerPress=(e,t)=>{if(this.isPressing)return;this.removeEndListeners();const i=this.node.getProps(),s=na(window,"pointerup",(a,l)=>{if(!this.checkPressEnd())return;const{onTap:c,onTapCancel:d,globalTapTarget:f}=this.node.getProps();Mn.update(()=>{!f&&!Ok(this.node.current,a.target)?d&&d(a,l):c&&c(a,l)})},{passive:!(i.onTap||i.onPointerUp)}),o=na(window,"pointercancel",(a,l)=>this.cancelPress(a,l),{passive:!(i.onTapCancel||i.onPointerCancel)});this.removeEndListeners=yl(s,o),this.startPress(e,t)},this.startAccessiblePress=()=>{const e=s=>{if(s.key!=="Enter"||this.isPressing)return;const o=a=>{a.key!=="Enter"||!this.checkPressEnd()||lw("up",(l,c)=>{const{onTap:d}=this.node.getProps();d&&Mn.update(()=>d(l,c))})};this.removeEndListeners(),this.removeEndListeners=Yo(this.node.current,"keyup",o),lw("down",(a,l)=>{this.startPress(a,l)})},t=Yo(this.node.current,"keydown",e),i=()=>{this.isPressing&&lw("cancel",(s,o)=>this.cancelPress(s,o))},r=Yo(this.node.current,"blur",i);this.removeAccessibleListeners=yl(t,r)}}startPress(e,t){this.isPressing=!0;const{onTapStart:i,whileTap:r}=this.node.getProps();r&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),i&&Mn.update(()=>i(e,t))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!kk()}cancelPress(e,t){if(!this.checkPressEnd())return;const{onTapCancel:i}=this.node.getProps();i&&Mn.update(()=>i(e,t))}mount(){const e=this.node.getProps(),t=na(e.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),i=Yo(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=yl(t,i)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const bE=new WeakMap,cw=new WeakMap,o9=n=>{const e=bE.get(n.target);e&&e(n)},a9=n=>{n.forEach(o9)};function l9({root:n,...e}){const t=n||document;cw.has(t)||cw.set(t,{});const i=cw.get(t),r=JSON.stringify(e);return i[r]||(i[r]=new IntersectionObserver(a9,{root:n,...e})),i[r]}function c9(n,e,t){const i=l9(e);return bE.set(n,t),i.observe(n),()=>{bE.delete(n),i.unobserve(n)}}const u9={some:0,all:1};class h9 extends Ol{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:t,margin:i,amount:r="some",once:s}=e,o={root:t?t.current:void 0,rootMargin:i,threshold:typeof r=="number"?r:u9[r]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,s&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:d,onViewportLeave:f}=this.node.getProps(),p=c?d:f;p&&p(l)};return c9(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(d9(e,t))&&this.startObserver()}unmount(){}}function d9({viewport:n={}},{viewport:e={}}={}){return t=>n[t]!==e[t]}const f9={inView:{Feature:h9},tap:{Feature:s9},focus:{Feature:r9},hover:{Feature:i9}};function Uk(n,e){if(!Array.isArray(e))return!1;const t=e.length;if(t!==n.length)return!1;for(let i=0;ie[i]=t.get()),e}function m9(n){const e={};return n.values.forEach((t,i)=>e[i]=t.getVelocity()),e}function H_(n,e,t){const i=n.getProps();return XA(i,e,t!==void 0?t:i.custom,p9(n),m9(n))}let g9=Yn,qA=Yn;const vl=n=>n*1e3,ia=n=>n/1e3,y9={current:!1},Fk=n=>Array.isArray(n)&&typeof n[0]=="number";function Vk(n){return!!(!n||typeof n=="string"&&Bk[n]||Fk(n)||Array.isArray(n)&&n.every(Vk))}const Gf=([n,e,t,i])=>`cubic-bezier(${n}, ${e}, ${t}, ${i})`,Bk={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Gf([0,.65,.55,1]),circOut:Gf([.55,0,1,.45]),backIn:Gf([.31,.01,.66,-.59]),backOut:Gf([.33,1.53,.69,.99])};function zk(n){if(n)return Fk(n)?Gf(n):Array.isArray(n)?n.map(zk):Bk[n]}function v9(n,e,t,{delay:i=0,duration:r,repeat:s=0,repeatType:o="loop",ease:a,times:l}={}){const c={[e]:t};l&&(c.offset=l);const d=zk(a);return Array.isArray(d)&&(c.easing=d),n.animate(c,{delay:i,duration:r,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"})}function _9(n,{repeat:e,repeatType:t="loop"}){const i=e&&t!=="loop"&&e%2===1?0:n.length-1;return n[i]}const Hk=(n,e,t)=>(((1-3*t+3*e)*n+(3*t-6*e))*n+3*e)*n,x9=1e-7,S9=12;function w9(n,e,t,i,r){let s,o,a=0;do o=e+(t-e)/2,s=Hk(o,i,r)-n,s>0?t=o:e=o;while(Math.abs(s)>x9&&++aw9(s,0,1,n,t);return s=>s===0||s===1?s:Hk(r(s),e,i)}const E9=Im(.42,0,1,1),T9=Im(0,0,.58,1),Gk=Im(.42,0,.58,1),A9=n=>Array.isArray(n)&&typeof n[0]!="number",Wk=n=>e=>e<=.5?n(2*e)/2:(2-n(2*(1-e)))/2,jk=n=>e=>1-n(1-e),$A=n=>1-Math.sin(Math.acos(n)),Xk=jk($A),M9=Wk($A),qk=Im(.33,1.53,.69,.99),YA=jk(qk),C9=Wk(YA),b9=n=>(n*=2)<1?.5*YA(n):.5*(2-Math.pow(2,-10*(n-1))),P9={linear:Yn,easeIn:E9,easeInOut:Gk,easeOut:T9,circIn:$A,circInOut:M9,circOut:Xk,backIn:YA,backInOut:C9,backOut:qk,anticipate:b9},PR=n=>{if(Array.isArray(n)){qA(n.length===4);const[e,t,i,r]=n;return Im(e,t,i,r)}else if(typeof n=="string")return P9[n];return n},KA=(n,e)=>t=>!!(Pm(t)&&RH.test(t)&&t.startsWith(n)||e&&Object.prototype.hasOwnProperty.call(t,e)),$k=(n,e,t)=>i=>{if(!Pm(i))return i;const[r,s,o,a]=i.match(B_);return{[n]:parseFloat(r),[e]:parseFloat(s),[t]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},R9=n=>Al(0,255,n),uw={...gu,transform:n=>Math.round(R9(n))},kc={test:KA("rgb","red"),parse:$k("red","green","blue"),transform:({red:n,green:e,blue:t,alpha:i=1})=>"rgba("+uw.transform(n)+", "+uw.transform(e)+", "+uw.transform(t)+", "+ap(op.transform(i))+")"};function I9(n){let e="",t="",i="",r="";return n.length>5?(e=n.substring(1,3),t=n.substring(3,5),i=n.substring(5,7),r=n.substring(7,9)):(e=n.substring(1,2),t=n.substring(2,3),i=n.substring(3,4),r=n.substring(4,5),e+=e,t+=t,i+=i,r+=r),{red:parseInt(e,16),green:parseInt(t,16),blue:parseInt(i,16),alpha:r?parseInt(r,16)/255:1}}const PE={test:KA("#"),parse:I9,transform:kc.transform},Mh={test:KA("hsl","hue"),parse:$k("hue","saturation","lightness"),transform:({hue:n,saturation:e,lightness:t,alpha:i=1})=>"hsla("+Math.round(n)+", "+go.transform(ap(e))+", "+go.transform(ap(t))+", "+ap(op.transform(i))+")"},dr={test:n=>kc.test(n)||PE.test(n)||Mh.test(n),parse:n=>kc.test(n)?kc.parse(n):Mh.test(n)?Mh.parse(n):PE.parse(n),transform:n=>Pm(n)?n:n.hasOwnProperty("red")?kc.transform(n):Mh.transform(n)},Vn=(n,e,t)=>-t*n+t*e+n;function hw(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*(2/3-t)*6:n}function L9({hue:n,saturation:e,lightness:t,alpha:i}){n/=360,e/=100,t/=100;let r=0,s=0,o=0;if(!e)r=s=o=t;else{const a=t<.5?t*(1+e):t+e-t*e,l=2*t-a;r=hw(l,a,n+1/3),s=hw(l,a,n),o=hw(l,a,n-1/3)}return{red:Math.round(r*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:i}}const dw=(n,e,t)=>{const i=n*n;return Math.sqrt(Math.max(0,t*(e*e-i)+i))},N9=[PE,kc,Mh],D9=n=>N9.find(e=>e.test(n));function RR(n){const e=D9(n);let t=e.parse(n);return e===Mh&&(t=L9(t)),t}const Yk=(n,e)=>{const t=RR(n),i=RR(e),r={...t};return s=>(r.red=dw(t.red,i.red,s),r.green=dw(t.green,i.green,s),r.blue=dw(t.blue,i.blue,s),r.alpha=Vn(t.alpha,i.alpha,s),kc.transform(r))};function k9(n){var e,t;return isNaN(n)&&Pm(n)&&(((e=n.match(B_))===null||e===void 0?void 0:e.length)||0)+(((t=n.match(Sk))===null||t===void 0?void 0:t.length)||0)>0}const Kk={regex:bH,countKey:"Vars",token:"${v}",parse:Yn},Qk={regex:Sk,countKey:"Colors",token:"${c}",parse:dr.parse},Jk={regex:B_,countKey:"Numbers",token:"${n}",parse:gu.parse};function fw(n,{regex:e,countKey:t,token:i,parse:r}){const s=n.tokenised.match(e);s&&(n["num"+t]=s.length,n.tokenised=n.tokenised.replace(e,i),n.values.push(...s.map(r)))}function u0(n){const e=n.toString(),t={value:e,tokenised:e,values:[],numVars:0,numColors:0,numNumbers:0};return t.value.includes("var(--")&&fw(t,Kk),fw(t,Qk),fw(t,Jk),t}function Zk(n){return u0(n).values}function eO(n){const{values:e,numColors:t,numVars:i,tokenised:r}=u0(n),s=e.length;return o=>{let a=r;for(let l=0;ltypeof n=="number"?0:n;function U9(n){const e=Zk(n);return eO(n)(e.map(O9))}const Ml={test:k9,parse:Zk,createTransformer:eO,getAnimatableNone:U9},tO=(n,e)=>t=>`${t>0?e:n}`;function nO(n,e){return typeof n=="number"?t=>Vn(n,e,t):dr.test(n)?Yk(n,e):n.startsWith("var(")?tO(n,e):rO(n,e)}const iO=(n,e)=>{const t=[...n],i=t.length,r=n.map((s,o)=>nO(s,e[o]));return s=>{for(let o=0;o{const t={...n,...e},i={};for(const r in t)n[r]!==void 0&&e[r]!==void 0&&(i[r]=nO(n[r],e[r]));return r=>{for(const s in i)t[s]=i[s](r);return t}},rO=(n,e)=>{const t=Ml.createTransformer(e),i=u0(n),r=u0(e);return i.numVars===r.numVars&&i.numColors===r.numColors&&i.numNumbers>=r.numNumbers?yl(iO(i.values,r.values),t):tO(n,e)},Xp=(n,e,t)=>{const i=e-n;return i===0?1:(t-n)/i},IR=(n,e)=>t=>Vn(n,e,t);function V9(n){return typeof n=="number"?IR:typeof n=="string"?dr.test(n)?Yk:rO:Array.isArray(n)?iO:typeof n=="object"?F9:IR}function B9(n,e,t){const i=[],r=t||V9(n[0]),s=n.length-1;for(let o=0;oe[0];n[0]>n[s-1]&&(n=[...n].reverse(),e=[...e].reverse());const o=B9(e,i,r),a=o.length,l=c=>{let d=0;if(a>1)for(;dl(Al(n[0],n[s-1],c)):l}function z9(n,e){const t=n[n.length-1];for(let i=1;i<=e;i++){const r=Xp(0,e,i);n.push(Vn(t,1,r))}}function H9(n){const e=[0];return z9(e,n.length-1),e}function G9(n,e){return n.map(t=>t*e)}function W9(n,e){return n.map(()=>e||Gk).splice(0,n.length-1)}function h0({duration:n=300,keyframes:e,times:t,ease:i="easeInOut"}){const r=A9(i)?i.map(PR):PR(i),s={done:!1,value:e[0]},o=G9(t&&t.length===e.length?t:H9(e),n),a=sO(o,e,{ease:Array.isArray(r)?r:W9(e,r)});return{calculatedDuration:n,next:l=>(s.value=a(l),s.done=l>=n,s)}}function oO(n,e){return e?n*(1e3/e):0}const j9=5;function aO(n,e,t){const i=Math.max(e-j9,0);return oO(t-n(i),e-i)}const pw=.001,X9=.01,LR=10,q9=.05,$9=1;function Y9({duration:n=800,bounce:e=.25,velocity:t=0,mass:i=1}){let r,s;g9(n<=vl(LR));let o=1-e;o=Al(q9,$9,o),n=Al(X9,LR,ia(n)),o<1?(r=c=>{const d=c*o,f=d*n,p=d-t,m=RE(c,o),_=Math.exp(-f);return pw-p/m*_},s=c=>{const f=c*o*n,p=f*t+t,m=Math.pow(o,2)*Math.pow(c,2)*n,_=Math.exp(-f),S=RE(Math.pow(c,2),o);return(-r(c)+pw>0?-1:1)*((p-m)*_)/S}):(r=c=>{const d=Math.exp(-c*n),f=(c-t)*n+1;return-pw+d*f},s=c=>{const d=Math.exp(-c*n),f=(t-c)*(n*n);return d*f});const a=5/n,l=Q9(r,s,a);if(n=vl(n),isNaN(l))return{stiffness:100,damping:10,duration:n};{const c=Math.pow(l,2)*i;return{stiffness:c,damping:o*2*Math.sqrt(i*c),duration:n}}}const K9=12;function Q9(n,e,t){let i=t;for(let r=1;rn[t]!==void 0)}function e8(n){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...n};if(!NR(n,Z9)&&NR(n,J9)){const t=Y9(n);e={...e,...t,mass:1},e.isResolvedFromDuration=!0}return e}function lO({keyframes:n,restDelta:e,restSpeed:t,...i}){const r=n[0],s=n[n.length-1],o={done:!1,value:r},{stiffness:a,damping:l,mass:c,duration:d,velocity:f,isResolvedFromDuration:p}=e8({...i,velocity:-ia(i.velocity||0)}),m=f||0,_=l/(2*Math.sqrt(a*c)),S=s-r,x=ia(Math.sqrt(a/c)),y=Math.abs(S)<5;t||(t=y?.01:2),e||(e=y?.005:.5);let E;if(_<1){const w=RE(x,_);E=M=>{const O=Math.exp(-_*x*M);return s-O*((m+_*x*S)/w*Math.sin(w*M)+S*Math.cos(w*M))}}else if(_===1)E=w=>s-Math.exp(-x*w)*(S+(m+x*S)*w);else{const w=x*Math.sqrt(_*_-1);E=M=>{const O=Math.exp(-_*x*M),k=Math.min(w*M,300);return s-O*((m+_*x*S)*Math.sinh(k)+w*S*Math.cosh(k))/w}}return{calculatedDuration:p&&d||null,next:w=>{const M=E(w);if(p)o.done=w>=d;else{let O=m;w!==0&&(_<1?O=aO(E,w,M):O=0);const k=Math.abs(O)<=t,I=Math.abs(s-M)<=e;o.done=k&&I}return o.value=o.done?s:M,o}}}function DR({keyframes:n,velocity:e=0,power:t=.8,timeConstant:i=325,bounceDamping:r=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:d}){const f=n[0],p={done:!1,value:f},m=P=>a!==void 0&&Pl,_=P=>a===void 0?l:l===void 0||Math.abs(a-P)-S*Math.exp(-P/i),w=P=>y+E(P),M=P=>{const D=E(P),A=w(P);p.done=Math.abs(D)<=c,p.value=p.done?y:A};let O,k;const I=P=>{m(p.value)&&(O=P,k=lO({keyframes:[p.value,_(p.value)],velocity:aO(w,P,p.value),damping:r,stiffness:s,restDelta:c,restSpeed:d}))};return I(0),{calculatedDuration:null,next:P=>{let D=!1;return!k&&O===void 0&&(D=!0,M(P),I(P)),O!==void 0&&P>O?k.next(P-O):(!D&&M(P),p)}}}const t8=n=>{const e=({timestamp:t})=>n(t);return{start:()=>Mn.update(e,!0),stop:()=>ca(e),now:()=>Ki.isProcessing?Ki.timestamp:performance.now()}},kR=2e4;function OR(n){let e=0;const t=50;let i=n.next(e);for(;!i.done&&e=kR?1/0:e}const n8={decay:DR,inertia:DR,tween:h0,keyframes:h0,spring:lO};function d0({autoplay:n=!0,delay:e=0,driver:t=t8,keyframes:i,type:r="keyframes",repeat:s=0,repeatDelay:o=0,repeatType:a="loop",onPlay:l,onStop:c,onComplete:d,onUpdate:f,...p}){let m=1,_=!1,S,x;const y=()=>{x=new Promise(oe=>{S=oe})};y();let E;const w=n8[r]||h0;let M;w!==h0&&typeof i[0]!="number"&&(M=sO([0,100],i,{clamp:!1}),i=[0,100]);const O=w({...p,keyframes:i});let k;a==="mirror"&&(k=w({...p,keyframes:[...i].reverse(),velocity:-(p.velocity||0)}));let I="idle",P=null,D=null,A=null;O.calculatedDuration===null&&s&&(O.calculatedDuration=OR(O));const{calculatedDuration:R}=O;let V=1/0,U=1/0;R!==null&&(V=R+o,U=V*(s+1)-o);let se=0;const le=oe=>{if(D===null)return;m>0&&(D=Math.min(D,oe)),m<0&&(D=Math.min(oe-U/m,D)),P!==null?se=P:se=Math.round(oe-D)*m;const Me=se-e*(m>=0?1:-1),Re=m>=0?Me<0:Me>U;se=Math.max(Me,0),I==="finished"&&P===null&&(se=U);let he=se,we=O;if(s){const dt=Math.min(se,U)/V;let Ke=Math.floor(dt),ke=dt%1;!ke&&dt>=1&&(ke=1),ke===1&&Ke--,Ke=Math.min(Ke,s+1),!!(Ke%2)&&(a==="reverse"?(ke=1-ke,o&&(ke-=o/V)):a==="mirror"&&(we=k)),he=Al(0,1,ke)*V}const Ne=Re?{done:!1,value:i[0]}:we.next(he);M&&(Ne.value=M(Ne.value));let{done:be}=Ne;!Re&&R!==null&&(be=m>=0?se>=U:se<=0);const ft=P===null&&(I==="finished"||I==="running"&&be);return f&&f(Ne.value),ft&&W(),Ne},ee=()=>{E&&E.stop(),E=void 0},pe=()=>{I="idle",ee(),S(),y(),D=A=null},W=()=>{I="finished",d&&d(),ee(),S()},J=()=>{if(_)return;E||(E=t(le));const oe=E.now();l&&l(),P!==null?D=oe-P:(!D||I==="finished")&&(D=oe),I==="finished"&&y(),A=D,P=null,I="running",E.start()};n&&J();const Z={then(oe,Me){return x.then(oe,Me)},get time(){return ia(se)},set time(oe){oe=vl(oe),se=oe,P!==null||!E||m===0?P=oe:D=E.now()-oe/m},get duration(){const oe=O.calculatedDuration===null?OR(O):O.calculatedDuration;return ia(oe)},get speed(){return m},set speed(oe){oe===m||!E||(m=oe,Z.time=ia(se))},get state(){return I},play:J,pause:()=>{I="paused",P=se},stop:()=>{_=!0,I!=="idle"&&(I="idle",c&&c(),pe())},cancel:()=>{A!==null&&le(A),pe()},complete:()=>{I="finished"},sample:oe=>(D=0,le(oe))};return Z}function i8(n){let e;return()=>(e===void 0&&(e=n()),e)}const r8=i8(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),s8=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),sy=10,o8=2e4,a8=(n,e)=>e.type==="spring"||n==="backgroundColor"||!Vk(e.ease);function l8(n,e,{onUpdate:t,onComplete:i,...r}){if(!(r8()&&s8.has(e)&&!r.repeatDelay&&r.repeatType!=="mirror"&&r.damping!==0&&r.type!=="inertia"))return!1;let o=!1,a,l,c=!1;const d=()=>{l=new Promise(w=>{a=w})};d();let{keyframes:f,duration:p=300,ease:m,times:_}=r;if(a8(e,r)){const w=d0({...r,repeat:0,delay:0});let M={done:!1,value:f[0]};const O=[];let k=0;for(;!M.done&&k{c=!1,S.cancel()},y=()=>{c=!0,Mn.update(x),a(),d()};return S.onfinish=()=>{c||(n.set(_9(f,r)),i&&i(),y())},{then(w,M){return l.then(w,M)},attachTimeline(w){return S.timeline=w,S.onfinish=null,Yn},get time(){return ia(S.currentTime||0)},set time(w){S.currentTime=vl(w)},get speed(){return S.playbackRate},set speed(w){S.playbackRate=w},get duration(){return ia(p)},play:()=>{o||(S.play(),ca(x))},pause:()=>S.pause(),stop:()=>{if(o=!0,S.playState==="idle")return;const{currentTime:w}=S;if(w){const M=d0({...r,autoplay:!1});n.setWithVelocity(M.sample(w-sy).value,M.sample(w).value,sy)}y()},complete:()=>{c||S.finish()},cancel:y}}function c8({keyframes:n,delay:e,onUpdate:t,onComplete:i}){const r=()=>(t&&t(n[n.length-1]),i&&i(),{time:0,speed:1,duration:0,play:Yn,pause:Yn,stop:Yn,then:s=>(s(),Promise.resolve()),cancel:Yn,complete:Yn});return e?d0({keyframes:[0,1],duration:0,delay:e,onComplete:r}):r()}const u8={type:"spring",stiffness:500,damping:25,restSpeed:10},h8=n=>({type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restSpeed:10}),d8={type:"keyframes",duration:.8},f8={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},p8=(n,{keyframes:e})=>e.length>2?d8:mu.has(n)?n.startsWith("scale")?h8(e[1]):u8:f8,IE=(n,e)=>n==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Ml.test(e)||e==="0")&&!e.startsWith("url(")),m8=new Set(["brightness","contrast","saturate","opacity"]);function g8(n){const[e,t]=n.slice(0,-1).split("(");if(e==="drop-shadow")return n;const[i]=t.match(B_)||[];if(!i)return n;const r=t.replace(i,"");let s=m8.has(e)?1:0;return i!==t&&(s*=100),e+"("+s+r+")"}const y8=/([a-z-]*)\(.*?\)/g,LE={...Ml,getAnimatableNone:n=>{const e=n.match(y8);return e?e.map(g8).join(" "):n}},v8={...wk,color:dr,backgroundColor:dr,outlineColor:dr,fill:dr,stroke:dr,borderColor:dr,borderTopColor:dr,borderRightColor:dr,borderBottomColor:dr,borderLeftColor:dr,filter:LE,WebkitFilter:LE},QA=n=>v8[n];function cO(n,e){let t=QA(n);return t!==LE&&(t=Ml),t.getAnimatableNone?t.getAnimatableNone(e):void 0}const uO=n=>/^0[^.\s]+$/.test(n);function _8(n){if(typeof n=="number")return n===0;if(n!==null)return n==="none"||n==="0"||uO(n)}function x8(n,e,t,i){const r=IE(e,t);let s;Array.isArray(t)?s=[...t]:s=[null,t];const o=i.from!==void 0?i.from:n.get();let a;const l=[];for(let c=0;cr=>{const s=JA(i,n)||{},o=s.delay||i.delay||0;let{elapsed:a=0}=i;a=a-vl(o);const l=x8(e,n,t,s),c=l[0],d=l[l.length-1],f=IE(n,c),p=IE(n,d);let m={keyframes:l,velocity:e.getVelocity(),ease:"easeOut",...s,delay:-a,onUpdate:_=>{e.set(_),s.onUpdate&&s.onUpdate(_)},onComplete:()=>{r(),s.onComplete&&s.onComplete()}};if(S8(s)||(m={...m,...p8(n,m)}),m.duration&&(m.duration=vl(m.duration)),m.repeatDelay&&(m.repeatDelay=vl(m.repeatDelay)),!f||!p||y9.current||s.type===!1||w8.skipAnimations)return c8(m);if(!i.isHandoff&&e.owner&&e.owner.current instanceof HTMLElement&&!e.owner.getProps().onUpdate){const _=l8(e,n,m);if(_)return _}return d0(m)};function f0(n){return!!(Br(n)&&n.add)}const hO=n=>/^\-?\d*\.?\d+$/.test(n);function eM(n,e){n.indexOf(e)===-1&&n.push(e)}function tM(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}class nM{constructor(){this.subscriptions=[]}add(e){return eM(this.subscriptions,e),()=>tM(this.subscriptions,e)}notify(e,t,i){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,t,i);else for(let s=0;s!isNaN(parseFloat(n));class T8{constructor(e,t={}){this.version="10.18.0",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(i,r=!0)=>{this.prev=this.current,this.current=i;const{delta:s,timestamp:o}=Ki;this.lastUpdated!==o&&(this.timeDelta=s,this.lastUpdated=o,Mn.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),r&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>Mn.postRender(this.velocityCheck),this.velocityCheck=({timestamp:i})=>{i!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=e,this.canTrackVelocity=E8(this.current),this.owner=t.owner}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new nM);const i=this.events[e].add(t);return e==="change"?()=>{i(),Mn.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){!t||!this.passiveEffect?this.updateAndNotify(e,t):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,t,i){this.set(t),this.prev=e,this.timeDelta=i}jump(e){this.updateAndNotify(e),this.prev=e,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?oO(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function id(n,e){return new T8(n,e)}const dO=n=>e=>e.test(n),A8={test:n=>n==="auto",parse:n=>n},fO=[gu,Ct,go,Xa,LH,IH,A8],vf=n=>fO.find(dO(n)),M8=[...fO,dr,Ml],C8=n=>M8.find(dO(n));function b8(n,e,t){n.hasValue(e)?n.getValue(e).set(t):n.addValue(e,id(t))}function P8(n,e){const t=H_(n,e);let{transitionEnd:i={},transition:r={},...s}=t?n.makeTargetAnimatable(t,!1):{};s={...s,...i};for(const o in s){const a=XH(s[o]);b8(n,o,a)}}function R8(n,e,t){var i,r;const s=Object.keys(e).filter(a=>!n.hasValue(a)),o=s.length;if(o)for(let a=0;al.remove(f))),c.push(x)}return o&&Promise.all(c).then(()=>{o&&P8(n,o)}),c}function NE(n,e,t={}){const i=H_(n,e,t.custom);let{transition:r=n.getDefaultTransition()||{}}=i||{};t.transitionOverride&&(r=t.transitionOverride);const s=i?()=>Promise.all(pO(n,i,t)):()=>Promise.resolve(),o=n.variantChildren&&n.variantChildren.size?(l=0)=>{const{delayChildren:c=0,staggerChildren:d,staggerDirection:f}=r;return k8(n,e,c+l,d,f,t)}:()=>Promise.resolve(),{when:a}=r;if(a){const[l,c]=a==="beforeChildren"?[s,o]:[o,s];return l().then(()=>c())}else return Promise.all([s(),o(t.delay)])}function k8(n,e,t=0,i=0,r=1,s){const o=[],a=(n.variantChildren.size-1)*i,l=r===1?(c=0)=>c*i:(c=0)=>a-c*i;return Array.from(n.variantChildren).sort(O8).forEach((c,d)=>{c.notify("AnimationStart",e),o.push(NE(c,e,{...s,delay:t+l(d)}).then(()=>c.notify("AnimationComplete",e)))}),Promise.all(o)}function O8(n,e){return n.sortNodePosition(e)}function U8(n,e,t={}){n.notify("AnimationStart",e);let i;if(Array.isArray(e)){const r=e.map(s=>NE(n,s,t));i=Promise.all(r)}else if(typeof e=="string")i=NE(n,e,t);else{const r=typeof e=="function"?H_(n,e,t.custom):e;i=Promise.all(pO(n,r,t))}return i.then(()=>n.notify("AnimationComplete",e))}const F8=[...UA].reverse(),V8=UA.length;function B8(n){return e=>Promise.all(e.map(({animation:t,options:i})=>U8(n,t,i)))}function z8(n){let e=B8(n);const t=G8();let i=!0;const r=(l,c)=>{const d=H_(n,c);if(d){const{transition:f,transitionEnd:p,...m}=d;l={...l,...m,...p}}return l};function s(l){e=l(n)}function o(l,c){const d=n.getProps(),f=n.getVariantContext(!0)||{},p=[],m=new Set;let _={},S=1/0;for(let y=0;yS&&O,A=!1;const R=Array.isArray(M)?M:[M];let V=R.reduce(r,{});k===!1&&(V={});const{prevResolvedValues:U={}}=w,se={...U,...V},le=ee=>{D=!0,m.has(ee)&&(A=!0,m.delete(ee)),w.needsAnimating[ee]=!0};for(const ee in se){const pe=V[ee],W=U[ee];if(_.hasOwnProperty(ee))continue;let J=!1;c0(pe)&&c0(W)?J=!Uk(pe,W):J=pe!==W,J?pe!==void 0?le(ee):m.add(ee):pe!==void 0&&m.has(ee)?le(ee):w.protectedKeys[ee]=!0}w.prevProp=M,w.prevResolvedValues=V,w.isActive&&(_={..._,...V}),i&&n.blockInitialAnimation&&(D=!1),D&&(!I||A)&&p.push(...R.map(ee=>({animation:ee,options:{type:E,...l}})))}if(m.size){const y={};m.forEach(E=>{const w=n.getBaseTarget(E);w!==void 0&&(y[E]=w)}),p.push({animation:y})}let x=!!p.length;return i&&(d.initial===!1||d.initial===d.animate)&&!n.manuallyAnimateOnMount&&(x=!1),i=!1,x?e(p):Promise.resolve()}function a(l,c,d){var f;if(t[l].isActive===c)return Promise.resolve();(f=n.variantChildren)===null||f===void 0||f.forEach(m=>{var _;return(_=m.animationState)===null||_===void 0?void 0:_.setActive(l,c)}),t[l].isActive=c;const p=o(d,l);for(const m in t)t[m].protectedKeys={};return p}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>t}}function H8(n,e){return typeof e=="string"?e!==n:Array.isArray(e)?!Uk(e,n):!1}function lc(n=!1){return{isActive:n,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function G8(){return{animate:lc(!0),whileInView:lc(),whileHover:lc(),whileTap:lc(),whileDrag:lc(),whileFocus:lc(),exit:lc()}}class W8 extends Ol{constructor(e){super(e),e.animationState||(e.animationState=z8(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();this.unmount(),F_(e)&&(this.unmount=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){}}let j8=0;class X8 extends Ol{constructor(){super(...arguments),this.id=j8++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:t,custom:i}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;const s=this.node.animationState.setActive("exit",!e,{custom:i??this.node.getProps().custom});t&&!e&&s.then(()=>t(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}const q8={animation:{Feature:W8},exit:{Feature:X8}},UR=(n,e)=>Math.abs(n-e);function $8(n,e){const t=UR(n.x,e.x),i=UR(n.y,e.y);return Math.sqrt(t**2+i**2)}class mO{constructor(e,t,{transformPagePoint:i,contextWindow:r,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=gw(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,m=$8(f.offset,{x:0,y:0})>=3;if(!p&&!m)return;const{point:_}=f,{timestamp:S}=Ki;this.history.push({..._,timestamp:S});const{onStart:x,onMove:y}=this.handlers;p||(x&&x(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,f)},this.handlePointerMove=(f,p)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=mw(p,this.transformPagePoint),Mn.update(this.updatePoint,!0)},this.handlePointerUp=(f,p)=>{this.end();const{onEnd:m,onSessionEnd:_,resumeAnimation:S}=this.handlers;if(this.dragSnapToOrigin&&S&&S(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=gw(f.type==="pointercancel"?this.lastMoveEventInfo:mw(p,this.transformPagePoint),this.history);this.startEvent&&m&&m(f,x),_&&_(f,x)},!Lk(e))return;this.dragSnapToOrigin=s,this.handlers=t,this.transformPagePoint=i,this.contextWindow=r||window;const o=z_(e),a=mw(o,this.transformPagePoint),{point:l}=a,{timestamp:c}=Ki;this.history=[{...l,timestamp:c}];const{onSessionStart:d}=t;d&&d(e,gw(a,this.history)),this.removeListeners=yl(na(this.contextWindow,"pointermove",this.handlePointerMove),na(this.contextWindow,"pointerup",this.handlePointerUp),na(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),ca(this.updatePoint)}}function mw(n,e){return e?{point:e(n.point)}:n}function FR(n,e){return{x:n.x-e.x,y:n.y-e.y}}function gw({point:n},e){return{point:n,delta:FR(n,gO(e)),offset:FR(n,Y8(e)),velocity:K8(e,.1)}}function Y8(n){return n[0]}function gO(n){return n[n.length-1]}function K8(n,e){if(n.length<2)return{x:0,y:0};let t=n.length-1,i=null;const r=gO(n);for(;t>=0&&(i=n[t],!(r.timestamp-i.timestamp>vl(e)));)t--;if(!i)return{x:0,y:0};const s=ia(r.timestamp-i.timestamp);if(s===0)return{x:0,y:0};const o={x:(r.x-i.x)/s,y:(r.y-i.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function ts(n){return n.max-n.min}function DE(n,e=0,t=.01){return Math.abs(n-e)<=t}function VR(n,e,t,i=.5){n.origin=i,n.originPoint=Vn(e.min,e.max,n.origin),n.scale=ts(t)/ts(e),(DE(n.scale,1,1e-4)||isNaN(n.scale))&&(n.scale=1),n.translate=Vn(t.min,t.max,n.origin)-n.originPoint,(DE(n.translate)||isNaN(n.translate))&&(n.translate=0)}function lp(n,e,t,i){VR(n.x,e.x,t.x,i?i.originX:void 0),VR(n.y,e.y,t.y,i?i.originY:void 0)}function BR(n,e,t){n.min=t.min+e.min,n.max=n.min+ts(e)}function Q8(n,e,t){BR(n.x,e.x,t.x),BR(n.y,e.y,t.y)}function zR(n,e,t){n.min=e.min-t.min,n.max=n.min+ts(e)}function cp(n,e,t){zR(n.x,e.x,t.x),zR(n.y,e.y,t.y)}function J8(n,{min:e,max:t},i){return e!==void 0&&nt&&(n=i?Vn(t,n,i.max):Math.min(n,t)),n}function HR(n,e,t){return{min:e!==void 0?n.min+e:void 0,max:t!==void 0?n.max+t-(n.max-n.min):void 0}}function Z8(n,{top:e,left:t,bottom:i,right:r}){return{x:HR(n.x,t,r),y:HR(n.y,e,i)}}function GR(n,e){let t=e.min-n.min,i=e.max-n.max;return e.max-e.mini?t=Xp(e.min,e.max-i,n.min):i>r&&(t=Xp(n.min,n.max-r,e.min)),Al(0,1,t)}function nG(n,e){const t={};return e.min!==void 0&&(t.min=e.min-n.min),e.max!==void 0&&(t.max=e.max-n.min),t}const kE=.35;function iG(n=kE){return n===!1?n=0:n===!0&&(n=kE),{x:WR(n,"left","right"),y:WR(n,"top","bottom")}}function WR(n,e,t){return{min:jR(n,e),max:jR(n,t)}}function jR(n,e){return typeof n=="number"?n:n[e]||0}const XR=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ch=()=>({x:XR(),y:XR()}),qR=()=>({min:0,max:0}),hi=()=>({x:qR(),y:qR()});function vs(n){return[n("x"),n("y")]}function yO({top:n,left:e,right:t,bottom:i}){return{x:{min:e,max:t},y:{min:n,max:i}}}function rG({x:n,y:e}){return{top:e.min,right:n.max,bottom:e.max,left:n.min}}function sG(n,e){if(!e)return n;const t=e({x:n.left,y:n.top}),i=e({x:n.right,y:n.bottom});return{top:t.y,left:t.x,bottom:i.y,right:i.x}}function yw(n){return n===void 0||n===1}function OE({scale:n,scaleX:e,scaleY:t}){return!yw(n)||!yw(e)||!yw(t)}function Ec(n){return OE(n)||vO(n)||n.z||n.rotate||n.rotateX||n.rotateY}function vO(n){return $R(n.x)||$R(n.y)}function $R(n){return n&&n!=="0%"}function p0(n,e,t){const i=n-t,r=e*i;return t+r}function YR(n,e,t,i,r){return r!==void 0&&(n=p0(n,r,i)),p0(n,t,i)+e}function UE(n,e=0,t=1,i,r){n.min=YR(n.min,e,t,i,r),n.max=YR(n.max,e,t,i,r)}function _O(n,{x:e,y:t}){UE(n.x,e.translate,e.scale,e.originPoint),UE(n.y,t.translate,t.scale,t.originPoint)}function oG(n,e,t,i=!1){const r=t.length;if(!r)return;e.x=e.y=1;let s,o;for(let a=0;a1.0000000000001||n<.999999999999?n:1}function Ya(n,e){n.min=n.min+e,n.max=n.max+e}function QR(n,e,[t,i,r]){const s=e[r]!==void 0?e[r]:.5,o=Vn(n.min,n.max,s);UE(n,e[t],e[i],o,e.scale)}const aG=["x","scaleX","originX"],lG=["y","scaleY","originY"];function bh(n,e){QR(n.x,e,aG),QR(n.y,e,lG)}function xO(n,e){return yO(sG(n.getBoundingClientRect(),e))}function cG(n,e,t){const i=xO(n,t),{scroll:r}=e;return r&&(Ya(i.x,r.offset.x),Ya(i.y,r.offset.y)),i}const SO=({current:n})=>n?n.ownerDocument.defaultView:null,uG=new WeakMap;class hG{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=hi(),this.visualElement=e}start(e,{snapToCursor:t=!1}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const r=d=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(z_(d,"page").point)},s=(d,f)=>{const{drag:p,dragPropagation:m,onDragStart:_}=this.getProps();if(p&&!m&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=Dk(p),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),vs(x=>{let y=this.getAxisMotionValue(x).get()||0;if(go.test(y)){const{projection:E}=this.visualElement;if(E&&E.layout){const w=E.layout.layoutBox[x];w&&(y=ts(w)*(parseFloat(y)/100))}}this.originPoint[x]=y}),_&&Mn.update(()=>_(d,f),!1,!0);const{animationState:S}=this.visualElement;S&&S.setActive("whileDrag",!0)},o=(d,f)=>{const{dragPropagation:p,dragDirectionLock:m,onDirectionLock:_,onDrag:S}=this.getProps();if(!p&&!this.openGlobalLock)return;const{offset:x}=f;if(m&&this.currentDirection===null){this.currentDirection=dG(x),this.currentDirection!==null&&_&&_(this.currentDirection);return}this.updateAxis("x",f.point,x),this.updateAxis("y",f.point,x),this.visualElement.render(),S&&S(d,f)},a=(d,f)=>this.stop(d,f),l=()=>vs(d=>{var f;return this.getAnimationState(d)==="paused"&&((f=this.getAxisMotionValue(d).animation)===null||f===void 0?void 0:f.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new mO(e,{onSessionStart:r,onStart:s,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:SO(this.visualElement)})}stop(e,t){const i=this.isDragging;if(this.cancel(),!i)return;const{velocity:r}=t;this.startAnimation(r);const{onDragEnd:s}=this.getProps();s&&Mn.update(()=>s(e,t))}cancel(){this.isDragging=!1;const{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:i}=this.getProps();!i&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(e,t,i){const{drag:r}=this.getProps();if(!i||!oy(e,r,this.currentDirection))return;const s=this.getAxisMotionValue(e);let o=this.originPoint[e]+i[e];this.constraints&&this.constraints[e]&&(o=J8(o,this.constraints[e],this.elastic[e])),s.set(o)}resolveConstraints(){var e;const{dragConstraints:t,dragElastic:i}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(e=this.visualElement.projection)===null||e===void 0?void 0:e.layout,s=this.constraints;t&&Ah(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=Z8(r.layoutBox,t):this.constraints=!1,this.elastic=iG(i),s!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&vs(o=>{this.getAxisMotionValue(o)&&(this.constraints[o]=nG(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!Ah(e))return!1;const i=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const s=cG(i,r.root,this.visualElement.getTransformPagePoint());let o=eG(r.layout.layoutBox,s);if(t){const a=t(rG(o));this.hasMutatedConstraints=!!a,a&&(o=yO(a))}return o}startAnimation(e){const{drag:t,dragMomentum:i,dragElastic:r,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=vs(d=>{if(!oy(d,t,this.currentDirection))return;let f=l&&l[d]||{};o&&(f={min:0,max:0});const p=r?200:1e6,m=r?40:1e7,_={type:"inertia",velocity:i?e[d]:0,bounceStiffness:p,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...s,...f};return this.startAxisValueAnimation(d,_)});return Promise.all(c).then(a)}startAxisValueAnimation(e,t){const i=this.getAxisMotionValue(e);return i.start(ZA(e,i,0,t))}stopAnimation(){vs(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){vs(e=>{var t;return(t=this.getAxisMotionValue(e).animation)===null||t===void 0?void 0:t.pause()})}getAnimationState(e){var t;return(t=this.getAxisMotionValue(e).animation)===null||t===void 0?void 0:t.state}getAxisMotionValue(e){const t="_drag"+e.toUpperCase(),i=this.visualElement.getProps(),r=i[t];return r||this.visualElement.getValue(e,(i.initial?i.initial[e]:void 0)||0)}snapToCursor(e){vs(t=>{const{drag:i}=this.getProps();if(!oy(t,i,this.currentDirection))return;const{projection:r}=this.visualElement,s=this.getAxisMotionValue(t);if(r&&r.layout){const{min:o,max:a}=r.layout.layoutBox[t];s.set(e[t]-Vn(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:i}=this.visualElement;if(!Ah(t)||!i||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};vs(o=>{const a=this.getAxisMotionValue(o);if(a){const l=a.get();r[o]=tG({min:l,max:l},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),vs(o=>{if(!oy(o,e,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(Vn(l,c,r[o]))})}addListeners(){if(!this.visualElement.current)return;uG.set(this.visualElement,this);const e=this.visualElement.current,t=na(e,"pointerdown",l=>{const{drag:c,dragListener:d=!0}=this.getProps();c&&d&&this.start(l)}),i=()=>{const{dragConstraints:l}=this.getProps();Ah(l)&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,s=r.addEventListener("measure",i);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),i();const o=Yo(window,"resize",()=>this.scalePositionWithinConstraints()),a=r.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(vs(d=>{const f=this.getAxisMotionValue(d);f&&(this.originPoint[d]+=l[d].translate,f.set(f.get()+l[d].translate))}),this.visualElement.render())});return()=>{o(),t(),s(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:i=!1,dragPropagation:r=!1,dragConstraints:s=!1,dragElastic:o=kE,dragMomentum:a=!0}=e;return{...e,drag:t,dragDirectionLock:i,dragPropagation:r,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function oy(n,e,t){return(e===!0||e===n)&&(t===null||t===n)}function dG(n,e=10){let t=null;return Math.abs(n.y)>e?t="y":Math.abs(n.x)>e&&(t="x"),t}class fG extends Ol{constructor(e){super(e),this.removeGroupControls=Yn,this.removeListeners=Yn,this.controls=new hG(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Yn}unmount(){this.removeGroupControls(),this.removeListeners()}}const JR=n=>(e,t)=>{n&&Mn.update(()=>n(e,t))};class pG extends Ol{constructor(){super(...arguments),this.removePointerDownListener=Yn}onPointerDown(e){this.session=new mO(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:SO(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:i,onPanEnd:r}=this.node.getProps();return{onSessionStart:JR(e),onStart:JR(t),onMove:i,onEnd:(s,o)=>{delete this.session,r&&Mn.update(()=>r(s,o))}}}mount(){this.removePointerDownListener=na(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function mG(){const n=q.useContext(O_);if(n===null)return[!0,null];const{isPresent:e,onExitComplete:t,register:i}=n,r=q.useId();return q.useEffect(()=>i(r),[]),!e&&t?[!1,()=>t&&t(r)]:[!0]}const wv={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function ZR(n,e){return e.max===e.min?0:n/(e.max-e.min)*100}const _f={correct:(n,e)=>{if(!e.target)return n;if(typeof n=="string")if(Ct.test(n))n=parseFloat(n);else return n;const t=ZR(n,e.target.x),i=ZR(n,e.target.y);return`${t}% ${i}%`}},gG={correct:(n,{treeScale:e,projectionDelta:t})=>{const i=n,r=Ml.parse(n);if(r.length>5)return i;const s=Ml.createTransformer(n),o=typeof r[0]!="number"?1:0,a=t.x.scale*e.x,l=t.y.scale*e.y;r[0+o]/=a,r[1+o]/=l;const c=Vn(a,l,.5);return typeof r[2+o]=="number"&&(r[2+o]/=c),typeof r[3+o]=="number"&&(r[3+o]/=c),s(r)}};class yG extends v_.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:i,layoutId:r}=this.props,{projection:s}=e;TH(vG),s&&(t.group&&t.group.add(s),i&&i.register&&r&&i.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),wv.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:i,drag:r,isPresent:s}=this.props,o=i.projection;return o&&(o.isPresent=s,r||e.layoutDependency!==t||t===void 0?o.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?o.promote():o.relegate()||Mn.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),queueMicrotask(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:i}=this.props,{projection:r}=e;r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),i&&i.deregister&&i.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function wO(n){const[e,t]=mG(),i=q.useContext(VA);return v_.createElement(yG,{...n,layoutGroup:i,switchLayoutGroup:q.useContext(yk),isPresent:e,safeToRemove:t})}const vG={borderRadius:{..._f,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:_f,borderTopRightRadius:_f,borderBottomLeftRadius:_f,borderBottomRightRadius:_f,boxShadow:gG},EO=["TopLeft","TopRight","BottomLeft","BottomRight"],_G=EO.length,eI=n=>typeof n=="string"?parseFloat(n):n,tI=n=>typeof n=="number"||Ct.test(n);function xG(n,e,t,i,r,s){r?(n.opacity=Vn(0,t.opacity!==void 0?t.opacity:1,SG(i)),n.opacityExit=Vn(e.opacity!==void 0?e.opacity:1,0,wG(i))):s&&(n.opacity=Vn(e.opacity!==void 0?e.opacity:1,t.opacity!==void 0?t.opacity:1,i));for(let o=0;o<_G;o++){const a=`border${EO[o]}Radius`;let l=nI(e,a),c=nI(t,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||tI(l)===tI(c)?(n[a]=Math.max(Vn(eI(l),eI(c),i),0),(go.test(c)||go.test(l))&&(n[a]+="%")):n[a]=c}(e.rotate||t.rotate)&&(n.rotate=Vn(e.rotate||0,t.rotate||0,i))}function nI(n,e){return n[e]!==void 0?n[e]:n.borderRadius}const SG=TO(0,.5,Xk),wG=TO(.5,.95,Yn);function TO(n,e,t){return i=>ie?1:t(Xp(n,e,i))}function iI(n,e){n.min=e.min,n.max=e.max}function ms(n,e){iI(n.x,e.x),iI(n.y,e.y)}function rI(n,e,t,i,r){return n-=e,n=p0(n,1/t,i),r!==void 0&&(n=p0(n,1/r,i)),n}function EG(n,e=0,t=1,i=.5,r,s=n,o=n){if(go.test(e)&&(e=parseFloat(e),e=Vn(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=Vn(s.min,s.max,i);n===s&&(a-=e),n.min=rI(n.min,e,t,a,r),n.max=rI(n.max,e,t,a,r)}function sI(n,e,[t,i,r],s,o){EG(n,e[t],e[i],e[r],e.scale,s,o)}const TG=["x","scaleX","originX"],AG=["y","scaleY","originY"];function oI(n,e,t,i){sI(n.x,e,TG,t?t.x:void 0,i?i.x:void 0),sI(n.y,e,AG,t?t.y:void 0,i?i.y:void 0)}function aI(n){return n.translate===0&&n.scale===1}function AO(n){return aI(n.x)&&aI(n.y)}function MG(n,e){return n.x.min===e.x.min&&n.x.max===e.x.max&&n.y.min===e.y.min&&n.y.max===e.y.max}function MO(n,e){return Math.round(n.x.min)===Math.round(e.x.min)&&Math.round(n.x.max)===Math.round(e.x.max)&&Math.round(n.y.min)===Math.round(e.y.min)&&Math.round(n.y.max)===Math.round(e.y.max)}function lI(n){return ts(n.x)/ts(n.y)}class CG{constructor(){this.members=[]}add(e){eM(this.members,e),e.scheduleRender()}remove(e){if(tM(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(e){const t=this.members.findIndex(r=>e===r);if(t===0)return!1;let i;for(let r=t;r>=0;r--){const s=this.members[r];if(s.isPresent!==!1){i=s;break}}return i?(this.promote(i),!0):!1}promote(e,t){const i=this.lead;if(e!==i&&(this.prevLead=i,this.lead=e,e.show(),i)){i.instance&&i.scheduleRender(),e.scheduleRender(),e.resumeFrom=i,t&&(e.resumeFrom.preserveOpacity=!0),i.snapshot&&(e.snapshot=i.snapshot,e.snapshot.latestValues=i.animationValues||i.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:r}=e.options;r===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:t,resumingFrom:i}=e;t.onExitComplete&&t.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function cI(n,e,t){let i="";const r=n.x.translate/e.x,s=n.y.translate/e.y;if((r||s)&&(i=`translate3d(${r}px, ${s}px, 0) `),(e.x!==1||e.y!==1)&&(i+=`scale(${1/e.x}, ${1/e.y}) `),t){const{rotate:l,rotateX:c,rotateY:d}=t;l&&(i+=`rotate(${l}deg) `),c&&(i+=`rotateX(${c}deg) `),d&&(i+=`rotateY(${d}deg) `)}const o=n.x.scale*e.x,a=n.y.scale*e.y;return(o!==1||a!==1)&&(i+=`scale(${o}, ${a})`),i||"none"}const bG=(n,e)=>n.depth-e.depth;class PG{constructor(){this.children=[],this.isDirty=!1}add(e){eM(this.children,e),this.isDirty=!0}remove(e){tM(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(bG),this.isDirty=!1,this.children.forEach(e)}}function RG(n,e){const t=performance.now(),i=({timestamp:r})=>{const s=r-t;s>=e&&(ca(i),n(s-e))};return Mn.read(i,!0),()=>ca(i)}function IG(n){window.MotionDebug&&window.MotionDebug.record(n)}function LG(n){return n instanceof SVGElement&&n.tagName!=="svg"}function NG(n,e,t){const i=Br(n)?n:id(n);return i.start(ZA("",i,e,t)),i.animation}const uI=["","X","Y","Z"],DG={visibility:"hidden"},hI=1e3;let kG=0;const Tc={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function CO({attachResizeListener:n,defaultParent:e,measureScroll:t,checkIsScrollRoot:i,resetTransform:r}){return class{constructor(o={},a=e==null?void 0:e()){this.id=kG++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Tc.totalNodes=Tc.resolvedTargetDeltas=Tc.recalculatedProjection=0,this.nodes.forEach(FG),this.nodes.forEach(GG),this.nodes.forEach(WG),this.nodes.forEach(VG),IG(Tc)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;lthis.root.updateBlockedByResize=!1;n(o,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=RG(p,250),wv.hasAnimatedSinceResize&&(wv.hasAnimatedSinceResize=!1,this.nodes.forEach(fI))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||c)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:p,hasRelativeTargetChanged:m,layout:_})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const S=this.options.transition||d.getDefaultTransition()||YG,{onLayoutAnimationStart:x,onLayoutAnimationComplete:y}=d.getProps(),E=!this.targetLayout||!MO(this.targetLayout,_)||m,w=!p&&m;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||w||p&&(E||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,w);const M={...JA(S,"layout"),onPlay:x,onComplete:y};(d.shouldReduceMotion||this.options.layoutRoot)&&(M.delay=0,M.type=!1),this.startAnimation(M)}else p||fI(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=_})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,ca(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(jG),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;dthis.update()))}clearAllSnapshots(){this.nodes.forEach(BG),this.sharedNodes.forEach(XG)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Mn.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Mn.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{const O=M/1e3;pI(f.x,o.x,O),pI(f.y,o.y,O),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(cp(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),qG(this.relativeTarget,this.relativeTargetOrigin,p,O),w&&MG(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=hi()),ms(w,this.relativeTarget)),S&&(this.animationValues=d,xG(d,c,this.latestValues,O,E,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=O},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(ca(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Mn.update(()=>{wv.hasAnimatedSinceResize=!0,this.currentAnimation=NG(0,hI,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(hI),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:d}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&bO(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||hi();const f=ts(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+f;const p=ts(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+p}ms(a,l),bh(a,d),lp(this.projectionDeltaWithTransform,this.layoutCorrected,a,d)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new CG),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.rotate||l.rotateX||l.rotateY||l.rotateZ)&&(a=!0),!a)return;const c={};for(let d=0;d{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(dI),this.root.sharedNodes.clear()}}}function OG(n){n.updateLayout()}function UG(n){var e;const t=((e=n.resumeFrom)===null||e===void 0?void 0:e.snapshot)||n.snapshot;if(n.isLead()&&n.layout&&t&&n.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:r}=n.layout,{animationType:s}=n.options,o=t.source!==n.layout.source;s==="size"?vs(f=>{const p=o?t.measuredBox[f]:t.layoutBox[f],m=ts(p);p.min=i[f].min,p.max=p.min+m}):bO(s,t.layoutBox,i)&&vs(f=>{const p=o?t.measuredBox[f]:t.layoutBox[f],m=ts(i[f]);p.max=p.min+m,n.relativeTarget&&!n.currentAnimation&&(n.isProjectionDirty=!0,n.relativeTarget[f].max=n.relativeTarget[f].min+m)});const a=Ch();lp(a,i,t.layoutBox);const l=Ch();o?lp(l,n.applyTransform(r,!0),t.measuredBox):lp(l,i,t.layoutBox);const c=!AO(a);let d=!1;if(!n.resumeFrom){const f=n.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:p,layout:m}=f;if(p&&m){const _=hi();cp(_,t.layoutBox,p.layoutBox);const S=hi();cp(S,i,m.layoutBox),MO(_,S)||(d=!0),f.options.layoutRoot&&(n.relativeTarget=S,n.relativeTargetOrigin=_,n.relativeParent=f)}}}n.notifyListeners("didUpdate",{layout:i,snapshot:t,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeTargetChanged:d})}else if(n.isLead()){const{onExitComplete:i}=n.options;i&&i()}n.options.transition=void 0}function FG(n){Tc.totalNodes++,n.parent&&(n.isProjecting()||(n.isProjectionDirty=n.parent.isProjectionDirty),n.isSharedProjectionDirty||(n.isSharedProjectionDirty=!!(n.isProjectionDirty||n.parent.isProjectionDirty||n.parent.isSharedProjectionDirty)),n.isTransformDirty||(n.isTransformDirty=n.parent.isTransformDirty))}function VG(n){n.isProjectionDirty=n.isSharedProjectionDirty=n.isTransformDirty=!1}function BG(n){n.clearSnapshot()}function dI(n){n.clearMeasurements()}function zG(n){n.isLayoutDirty=!1}function HG(n){const{visualElement:e}=n.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),n.resetTransform()}function fI(n){n.finishAnimation(),n.targetDelta=n.relativeTarget=n.target=void 0,n.isProjectionDirty=!0}function GG(n){n.resolveTargetDelta()}function WG(n){n.calcProjection()}function jG(n){n.resetRotation()}function XG(n){n.removeLeadSnapshot()}function pI(n,e,t){n.translate=Vn(e.translate,0,t),n.scale=Vn(e.scale,1,t),n.origin=e.origin,n.originPoint=e.originPoint}function mI(n,e,t,i){n.min=Vn(e.min,t.min,i),n.max=Vn(e.max,t.max,i)}function qG(n,e,t,i){mI(n.x,e.x,t.x,i),mI(n.y,e.y,t.y,i)}function $G(n){return n.animationValues&&n.animationValues.opacityExit!==void 0}const YG={duration:.45,ease:[.4,0,.1,1]},gI=n=>typeof navigator<"u"&&navigator.userAgent.toLowerCase().includes(n),yI=gI("applewebkit/")&&!gI("chrome/")?Math.round:Yn;function vI(n){n.min=yI(n.min),n.max=yI(n.max)}function KG(n){vI(n.x),vI(n.y)}function bO(n,e,t){return n==="position"||n==="preserve-aspect"&&!DE(lI(e),lI(t),.2)}const QG=CO({attachResizeListener:(n,e)=>Yo(n,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),vw={current:void 0},PO=CO({measureScroll:n=>({x:n.scrollLeft,y:n.scrollTop}),defaultParent:()=>{if(!vw.current){const n=new QG({});n.mount(window),n.setOptions({layoutScroll:!0}),vw.current=n}return vw.current},resetTransform:(n,e)=>{n.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:n=>window.getComputedStyle(n).position==="fixed"}),JG={pan:{Feature:pG},drag:{Feature:fG,ProjectionNode:PO,MeasureLayout:wO}},ZG=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function eW(n){const e=ZG.exec(n);if(!e)return[,];const[,t,i]=e;return[t,i]}function FE(n,e,t=1){const[i,r]=eW(n);if(!i)return;const s=window.getComputedStyle(e).getPropertyValue(i);if(s){const o=s.trim();return hO(o)?parseFloat(o):o}else return CE(r)?FE(r,e,t+1):r}function tW(n,{...e},t){const i=n.current;if(!(i instanceof Element))return{target:e,transitionEnd:t};t&&(t={...t}),n.values.forEach(r=>{const s=r.get();if(!CE(s))return;const o=FE(s,i);o&&r.set(o)});for(const r in e){const s=e[r];if(!CE(s))continue;const o=FE(s,i);o&&(e[r]=o,t||(t={}),t[r]===void 0&&(t[r]=s))}return{target:e,transitionEnd:t}}const nW=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),RO=n=>nW.has(n),iW=n=>Object.keys(n).some(RO),_I=n=>n===gu||n===Ct,xI=(n,e)=>parseFloat(n.split(", ")[e]),SI=(n,e)=>(t,{transform:i})=>{if(i==="none"||!i)return 0;const r=i.match(/^matrix3d\((.+)\)$/);if(r)return xI(r[1],e);{const s=i.match(/^matrix\((.+)\)$/);return s?xI(s[1],n):0}},rW=new Set(["x","y","z"]),sW=bm.filter(n=>!rW.has(n));function oW(n){const e=[];return sW.forEach(t=>{const i=n.getValue(t);i!==void 0&&(e.push([t,i.get()]),i.set(t.startsWith("scale")?1:0))}),e.length&&n.render(),e}const rd={width:({x:n},{paddingLeft:e="0",paddingRight:t="0"})=>n.max-n.min-parseFloat(e)-parseFloat(t),height:({y:n},{paddingTop:e="0",paddingBottom:t="0"})=>n.max-n.min-parseFloat(e)-parseFloat(t),top:(n,{top:e})=>parseFloat(e),left:(n,{left:e})=>parseFloat(e),bottom:({y:n},{top:e})=>parseFloat(e)+(n.max-n.min),right:({x:n},{left:e})=>parseFloat(e)+(n.max-n.min),x:SI(4,13),y:SI(5,14)};rd.translateX=rd.x;rd.translateY=rd.y;const aW=(n,e,t)=>{const i=e.measureViewportBox(),r=e.current,s=getComputedStyle(r),{display:o}=s,a={};o==="none"&&e.setStaticValue("display",n.display||"block"),t.forEach(c=>{a[c]=rd[c](i,s)}),e.render();const l=e.measureViewportBox();return t.forEach(c=>{const d=e.getValue(c);d&&d.jump(a[c]),n[c]=rd[c](l,s)}),n},lW=(n,e,t={},i={})=>{e={...e},i={...i};const r=Object.keys(e).filter(RO);let s=[],o=!1;const a=[];if(r.forEach(l=>{const c=n.getValue(l);if(!n.hasValue(l))return;let d=t[l],f=vf(d);const p=e[l];let m;if(c0(p)){const _=p.length,S=p[0]===null?1:0;d=p[S],f=vf(d);for(let x=S;x<_&&p[x]!==null;x++)m?qA(vf(p[x])===m):m=vf(p[x])}else m=vf(p);if(f!==m)if(_I(f)&&_I(m)){const _=c.get();typeof _=="string"&&c.set(parseFloat(_)),typeof p=="string"?e[l]=parseFloat(p):Array.isArray(p)&&m===Ct&&(e[l]=p.map(parseFloat))}else f!=null&&f.transform&&(m!=null&&m.transform)&&(d===0||p===0)?d===0?c.set(m.transform(d)):e[l]=f.transform(p):(o||(s=oW(n),o=!0),a.push(l),i[l]=i[l]!==void 0?i[l]:e[l],c.jump(p))}),a.length){const l=a.indexOf("height")>=0?window.pageYOffset:null,c=aW(e,n,a);return s.length&&s.forEach(([d,f])=>{n.getValue(d).set(f)}),n.render(),U_&&l!==null&&window.scrollTo({top:l}),{target:c,transitionEnd:i}}else return{target:e,transitionEnd:i}};function cW(n,e,t,i){return iW(e)?lW(n,e,t,i):{target:e,transitionEnd:i}}const uW=(n,e,t,i)=>{const r=tW(n,e,i);return e=r.target,i=r.transitionEnd,cW(n,e,t,i)},VE={current:null},IO={current:!1};function hW(){if(IO.current=!0,!!U_)if(window.matchMedia){const n=window.matchMedia("(prefers-reduced-motion)"),e=()=>VE.current=n.matches;n.addListener(e),e()}else VE.current=!1}function dW(n,e,t){const{willChange:i}=e;for(const r in e){const s=e[r],o=t[r];if(Br(s))n.addValue(r,s),f0(i)&&i.add(r);else if(Br(o))n.addValue(r,id(s,{owner:n})),f0(i)&&i.remove(r);else if(o!==s)if(n.hasValue(r)){const a=n.getValue(r);!a.hasAnimated&&a.set(s)}else{const a=n.getStaticValue(r);n.addValue(r,id(a!==void 0?a:s,{owner:n}))}}for(const r in t)e[r]===void 0&&n.removeValue(r);return e}const wI=new WeakMap,LO=Object.keys(jp),fW=LO.length,EI=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],pW=FA.length;class mW{constructor({parent:e,props:t,presenceContext:i,reducedMotionConfig:r,visualState:s},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>Mn.render(this.render,!1,!0);const{latestValues:a,renderState:l}=s;this.latestValues=a,this.baseTarget={...a},this.initialValues=t.initial?{...a}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=i,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.options=o,this.isControllingVariants=V_(t),this.isVariantNode=gk(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:c,...d}=this.scrapeMotionValuesFromProps(t,{});for(const f in d){const p=d[f];a[f]!==void 0&&Br(p)&&(p.set(a[f],!1),f0(c)&&c.add(f))}}scrapeMotionValuesFromProps(e,t){return{}}mount(e){this.current=e,wI.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,i)=>this.bindToMotionValue(i,t)),IO.current||hW(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:VE.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){wI.delete(this.current),this.projection&&this.projection.unmount(),ca(this.notifyUpdate),ca(this.render),this.valueSubscriptions.forEach(e=>e()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features)this.features[e].unmount();this.current=null}bindToMotionValue(e,t){const i=mu.has(e),r=t.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&Mn.update(this.notifyUpdate,!1,!0),i&&this.projection&&(this.projection.isTransformDirty=!0)}),s=t.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(e,()=>{r(),s()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}loadFeatures({children:e,...t},i,r,s){let o,a;for(let l=0;lthis.scheduleRender(),animationType:typeof c=="string"?c:"both",initialPromotionConfig:s,layoutScroll:p,layoutRoot:m})}return a}updateFeatures(){for(const e in this.features){const t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):hi()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}makeTargetAnimatable(e,t=!0){return this.makeTargetAnimatableFromInstance(e,this.props,t)}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let i=0;it.variantChildren.delete(e)}addValue(e,t){t!==this.values.get(e)&&(this.removeValue(e),this.bindToMotionValue(e,t)),this.values.set(e,t),this.latestValues[e]=t.get()}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let i=this.values.get(e);return i===void 0&&t!==void 0&&(i=id(t,{owner:this}),this.addValue(e,i)),i}readValue(e){var t;return this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:(t=this.getBaseTargetFromProps(this.props,e))!==null&&t!==void 0?t:this.readValueFromInstance(this.current,e,this.options)}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;const{initial:i}=this.props,r=typeof i=="string"||typeof i=="object"?(t=XA(this.props,i))===null||t===void 0?void 0:t[e]:void 0;if(i&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!Br(s)?s:this.initialValues[e]!==void 0&&r===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new nM),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class NO extends mW{sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:i}){delete t[e],delete i[e]}makeTargetAnimatableFromInstance({transition:e,transitionEnd:t,...i},{transformValues:r},s){let o=L8(i,e||{},this);if(r&&(t&&(t=r(t)),i&&(i=r(i)),o&&(o=r(o))),s){R8(this,i,o);const a=uW(this,i,o,t);t=a.transitionEnd,i=a.target}return{transition:e,transitionEnd:t,...i}}}function gW(n){return window.getComputedStyle(n)}class yW extends NO{constructor(){super(...arguments),this.type="html"}readValueFromInstance(e,t){if(mu.has(t)){const i=QA(t);return i&&i.default||0}else{const i=gW(e),r=(xk(t)?i.getPropertyValue(t):i[t])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return xO(e,t)}build(e,t,i,r){zA(e,t,i,r.transformTemplate)}scrapeMotionValuesFromProps(e,t){return jA(e,t)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Br(e)&&(this.childSubscription=e.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}renderInstance(e,t,i,r){Mk(e,t,i,r)}}class vW extends NO{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(mu.has(t)){const i=QA(t);return i&&i.default||0}return t=Ck.has(t)?t:OA(t),e.getAttribute(t)}measureInstanceViewportBox(){return hi()}scrapeMotionValuesFromProps(e,t){return Pk(e,t)}build(e,t,i,r){GA(e,t,i,this.isSVGTag,r.transformTemplate)}renderInstance(e,t,i,r){bk(e,t,i,r)}mount(e){this.isSVGTag=WA(e.tagName),super.mount(e)}}const _W=(n,e)=>BA(n)?new vW(e,{enableHardwareAcceleration:!1}):new yW(e,{enableHardwareAcceleration:!0}),xW={layout:{ProjectionNode:PO,MeasureLayout:wO}},SW={...q8,...f9,...JG,...xW},er=wH((n,e)=>e9(n,e,SW,_W));function DO(){const n=q.useRef(!1);return kA(()=>(n.current=!0,()=>{n.current=!1}),[]),n}function wW(){const n=DO(),[e,t]=q.useState(0),i=q.useCallback(()=>{n.current&&t(e+1)},[e]);return[q.useCallback(()=>Mn.postRender(i),[i]),e]}class EW extends q.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){const i=this.props.sizeRef.current;i.height=t.offsetHeight||0,i.width=t.offsetWidth||0,i.top=t.offsetTop,i.left=t.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function TW({children:n,isPresent:e}){const t=q.useId(),i=q.useRef(null),r=q.useRef({width:0,height:0,top:0,left:0});return q.useInsertionEffect(()=>{const{width:s,height:o,top:a,left:l}=r.current;if(e||!i.current||!s||!o)return;i.current.dataset.motionPopId=t;const c=document.createElement("style");return document.head.appendChild(c),c.sheet&&c.sheet.insertRule(` + */function ME(){return ME=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0)&&(t[r]=n[r]);return t}function sH(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function oH(n,e){return n.button===0&&(!e||e==="_self")&&!sH(n)}const aH=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],lH="6";try{window.__reactRouterVersion=lH}catch{}const cH="startTransition",yR=ez[cH];function uH(n){let{basename:e,children:t,future:i,window:r}=n,s=q.useRef();s.current==null&&(s.current=d6({window:r,v5Compat:!0}));let o=s.current,[a,l]=q.useState({action:o.action,location:o.location}),{v7_startTransition:c}=i||{},d=q.useCallback(f=>{c&&yR?yR(()=>l(f)):l(f)},[l,c]);return q.useLayoutEffect(()=>o.listen(d),[o,d]),q.createElement(nH,{basename:e,children:t,location:a.location,navigationType:a.action,navigator:o,future:i})}const hH=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",dH=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ac=q.forwardRef(function(e,t){let{onClick:i,relative:r,reloadDocument:s,replace:o,state:a,target:l,to:c,preventScrollReset:d,viewTransition:f}=e,p=rH(e,aH),{basename:m}=q.useContext(kl),_,S=!1;if(typeof c=="string"&&dH.test(c)&&(_=c,hH))try{let w=new URL(window.location.href),M=c.startsWith("//")?new URL(w.protocol+c):new URL(c),O=RA(M.pathname,m);M.origin===w.origin&&O!=null?c=O+M.search+M.hash:S=!0}catch{}let x=F6(c,{relative:r}),y=fH(c,{replace:o,state:a,target:l,preventScrollReset:d,relative:r,viewTransition:f});function E(w){i&&i(w),w.defaultPrevented||y(w)}return q.createElement("a",ME({},p,{href:_||x,onClick:S||s?i:E,ref:t,target:l}))});var vR;(function(n){n.UseScrollRestoration="useScrollRestoration",n.UseSubmit="useSubmit",n.UseSubmitFetcher="useSubmitFetcher",n.UseFetcher="useFetcher",n.useViewTransitionState="useViewTransitionState"})(vR||(vR={}));var _R;(function(n){n.UseFetcher="useFetcher",n.UseFetchers="useFetchers",n.UseScrollRestoration="useScrollRestoration"})(_R||(_R={}));function fH(n,e){let{target:t,replace:i,state:r,preventScrollReset:s,relative:o,viewTransition:a}=e===void 0?{}:e,l=DA(),c=Cm(),d=ck(n,{relative:o});return q.useCallback(f=>{if(oH(f,t)){f.preventDefault();let p=i!==void 0?i:s0(c)===s0(d);l(n,{replace:p,state:r,preventScrollReset:s,relative:o,viewTransition:a})}},[c,l,d,i,r,t,n,s,o,a])}const fk=q.createContext({transformPagePoint:n=>n,isStatic:!1,reducedMotion:"never"}),k_=q.createContext({}),O_=q.createContext(null),U_=typeof document<"u",kA=U_?q.useLayoutEffect:q.useEffect,pk=q.createContext({strict:!1}),OA=n=>n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),pH="framerAppearId",mk="data-"+OA(pH);function mH(n,e,t,i){const{visualElement:r}=q.useContext(k_),s=q.useContext(pk),o=q.useContext(O_),a=q.useContext(fk).reducedMotion,l=q.useRef();i=i||s.renderer,!l.current&&i&&(l.current=i(n,{visualState:e,parent:r,props:t,presenceContext:o,blockInitialAnimation:o?o.initial===!1:!1,reducedMotionConfig:a}));const c=l.current;q.useInsertionEffect(()=>{c&&c.update(t,o)});const d=q.useRef(!!(t[mk]&&!window.HandoffComplete));return kA(()=>{c&&(c.render(),d.current&&c.animationState&&c.animationState.animateChanges())}),q.useEffect(()=>{c&&(c.updateFeatures(),!d.current&&c.animationState&&c.animationState.animateChanges(),d.current&&(d.current=!1,window.HandoffComplete=!0))}),c}function Ah(n){return n&&typeof n=="object"&&Object.prototype.hasOwnProperty.call(n,"current")}function gH(n,e,t){return q.useCallback(i=>{i&&n.mount&&n.mount(i),e&&(i?e.mount(i):e.unmount()),t&&(typeof t=="function"?t(i):Ah(t)&&(t.current=i))},[e])}function Wp(n){return typeof n=="string"||Array.isArray(n)}function F_(n){return n!==null&&typeof n=="object"&&typeof n.start=="function"}const UA=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],FA=["initial",...UA];function V_(n){return F_(n.animate)||FA.some(e=>Wp(n[e]))}function gk(n){return!!(V_(n)||n.variants)}function yH(n,e){if(V_(n)){const{initial:t,animate:i}=n;return{initial:t===!1||Wp(t)?t:void 0,animate:Wp(i)?i:void 0}}return n.inherit!==!1?e:{}}function vH(n){const{initial:e,animate:t}=yH(n,q.useContext(k_));return q.useMemo(()=>({initial:e,animate:t}),[xR(e),xR(t)])}function xR(n){return Array.isArray(n)?n.join(" "):n}const SR={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},jp={};for(const n in SR)jp[n]={isEnabled:e=>SR[n].some(t=>!!e[t])};function _H(n){for(const e in n)jp[e]={...jp[e],...n[e]}}const VA=q.createContext({}),yk=q.createContext({}),xH=Symbol.for("motionComponentSymbol");function SH({preloadedFeatures:n,createVisualElement:e,useRender:t,useVisualState:i,Component:r}){n&&_H(n);function s(a,l){let c;const d={...q.useContext(fk),...a,layoutId:wH(a)},{isStatic:f}=d,p=vH(a),m=i(a,f);if(!f&&U_){p.visualElement=mH(r,m,d,e);const _=q.useContext(yk),S=q.useContext(pk).strict;p.visualElement&&(c=p.visualElement.loadFeatures(d,S,n,_))}return q.createElement(k_.Provider,{value:p},c&&p.visualElement?q.createElement(c,{visualElement:p.visualElement,...d}):null,t(r,a,gH(m,p.visualElement,l),m,f,p.visualElement))}const o=q.forwardRef(s);return o[xH]=r,o}function wH({layoutId:n}){const e=q.useContext(VA).id;return e&&n!==void 0?e+"-"+n:n}function EH(n){function e(i,r={}){return SH(n(i,r))}if(typeof Proxy>"u")return e;const t=new Map;return new Proxy(e,{get:(i,r)=>(t.has(r)||t.set(r,e(r)),t.get(r))})}const TH=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function BA(n){return typeof n!="string"||n.includes("-")?!1:!!(TH.indexOf(n)>-1||/[A-Z]/.test(n))}const a0={};function AH(n){Object.assign(a0,n)}const bm=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],mu=new Set(bm);function vk(n,{layout:e,layoutId:t}){return mu.has(n)||n.startsWith("origin")||(e||t!==void 0)&&(!!a0[n]||n==="opacity")}const Br=n=>!!(n&&n.getVelocity),MH={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},CH=bm.length;function bH(n,{enableHardwareAcceleration:e=!0,allowTransformNone:t=!0},i,r){let s="";for(let o=0;oe=>typeof e=="string"&&e.startsWith(n),xk=_k("--"),CE=_k("var(--"),PH=/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,RH=(n,e)=>e&&typeof n=="number"?e.transform(n):n,Al=(n,e,t)=>Math.min(Math.max(t,n),e),gu={test:n=>typeof n=="number",parse:parseFloat,transform:n=>n},op={...gu,transform:n=>Al(0,1,n)},iy={...gu,default:1},ap=n=>Math.round(n*1e5)/1e5,B_=/(-)?([\d]*\.?[\d])+/g,Sk=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,IH=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function Pm(n){return typeof n=="string"}const Rm=n=>({test:e=>Pm(e)&&e.endsWith(n)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${n}`}),Xa=Rm("deg"),go=Rm("%"),Ct=Rm("px"),LH=Rm("vh"),NH=Rm("vw"),wR={...go,parse:n=>go.parse(n)/100,transform:n=>go.transform(n*100)},ER={...gu,transform:Math.round},wk={borderWidth:Ct,borderTopWidth:Ct,borderRightWidth:Ct,borderBottomWidth:Ct,borderLeftWidth:Ct,borderRadius:Ct,radius:Ct,borderTopLeftRadius:Ct,borderTopRightRadius:Ct,borderBottomRightRadius:Ct,borderBottomLeftRadius:Ct,width:Ct,maxWidth:Ct,height:Ct,maxHeight:Ct,size:Ct,top:Ct,right:Ct,bottom:Ct,left:Ct,padding:Ct,paddingTop:Ct,paddingRight:Ct,paddingBottom:Ct,paddingLeft:Ct,margin:Ct,marginTop:Ct,marginRight:Ct,marginBottom:Ct,marginLeft:Ct,rotate:Xa,rotateX:Xa,rotateY:Xa,rotateZ:Xa,scale:iy,scaleX:iy,scaleY:iy,scaleZ:iy,skew:Xa,skewX:Xa,skewY:Xa,distance:Ct,translateX:Ct,translateY:Ct,translateZ:Ct,x:Ct,y:Ct,z:Ct,perspective:Ct,transformPerspective:Ct,opacity:op,originX:wR,originY:wR,originZ:Ct,zIndex:ER,fillOpacity:op,strokeOpacity:op,numOctaves:ER};function zA(n,e,t,i){const{style:r,vars:s,transform:o,transformOrigin:a}=n;let l=!1,c=!1,d=!0;for(const f in e){const p=e[f];if(xk(f)){s[f]=p;continue}const m=wk[f],_=RH(p,m);if(mu.has(f)){if(l=!0,o[f]=_,!d)continue;p!==(m.default||0)&&(d=!1)}else f.startsWith("origin")?(c=!0,a[f]=_):r[f]=_}if(e.transform||(l||i?r.transform=bH(n.transform,t,d,i):r.transform&&(r.transform="none")),c){const{originX:f="50%",originY:p="50%",originZ:m=0}=a;r.transformOrigin=`${f} ${p} ${m}`}}const HA=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Ek(n,e,t){for(const i in e)!Br(e[i])&&!vk(i,t)&&(n[i]=e[i])}function DH({transformTemplate:n},e,t){return q.useMemo(()=>{const i=HA();return zA(i,e,{enableHardwareAcceleration:!t},n),Object.assign({},i.vars,i.style)},[e])}function kH(n,e,t){const i=n.style||{},r={};return Ek(r,i,n),Object.assign(r,DH(n,e,t)),n.transformValues?n.transformValues(r):r}function OH(n,e,t){const i={},r=kH(n,e,t);return n.drag&&n.dragListener!==!1&&(i.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=n.drag===!0?"none":`pan-${n.drag==="x"?"y":"x"}`),n.tabIndex===void 0&&(n.onTap||n.onTapStart||n.whileTap)&&(i.tabIndex=0),i.style=r,i}const UH=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function l0(n){return n.startsWith("while")||n.startsWith("drag")&&n!=="draggable"||n.startsWith("layout")||n.startsWith("onTap")||n.startsWith("onPan")||n.startsWith("onLayout")||UH.has(n)}let Tk=n=>!l0(n);function FH(n){n&&(Tk=e=>e.startsWith("on")?!l0(e):n(e))}try{FH(require("@emotion/is-prop-valid").default)}catch{}function VH(n,e,t){const i={};for(const r in n)r==="values"&&typeof n.values=="object"||(Tk(r)||t===!0&&l0(r)||!e&&!l0(r)||n.draggable&&r.startsWith("onDrag"))&&(i[r]=n[r]);return i}function TR(n,e,t){return typeof n=="string"?n:Ct.transform(e+t*n)}function BH(n,e,t){const i=TR(e,n.x,n.width),r=TR(t,n.y,n.height);return`${i} ${r}`}const zH={offset:"stroke-dashoffset",array:"stroke-dasharray"},HH={offset:"strokeDashoffset",array:"strokeDasharray"};function GH(n,e,t=1,i=0,r=!0){n.pathLength=1;const s=r?zH:HH;n[s.offset]=Ct.transform(-i);const o=Ct.transform(e),a=Ct.transform(t);n[s.array]=`${o} ${a}`}function GA(n,{attrX:e,attrY:t,attrScale:i,originX:r,originY:s,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...c},d,f,p){if(zA(n,c,d,p),f){n.style.viewBox&&(n.attrs.viewBox=n.style.viewBox);return}n.attrs=n.style,n.style={};const{attrs:m,style:_,dimensions:S}=n;m.transform&&(S&&(_.transform=m.transform),delete m.transform),S&&(r!==void 0||s!==void 0||_.transform)&&(_.transformOrigin=BH(S,r!==void 0?r:.5,s!==void 0?s:.5)),e!==void 0&&(m.x=e),t!==void 0&&(m.y=t),i!==void 0&&(m.scale=i),o!==void 0&&GH(m,o,a,l,!1)}const Ak=()=>({...HA(),attrs:{}}),WA=n=>typeof n=="string"&&n.toLowerCase()==="svg";function WH(n,e,t,i){const r=q.useMemo(()=>{const s=Ak();return GA(s,e,{enableHardwareAcceleration:!1},WA(i),n.transformTemplate),{...s.attrs,style:{...s.style}}},[e]);if(n.style){const s={};Ek(s,n.style,n),r.style={...s,...r.style}}return r}function jH(n=!1){return(t,i,r,{latestValues:s},o)=>{const l=(BA(t)?WH:OH)(i,s,o,t),d={...VH(i,typeof t=="string",n),...l,ref:r},{children:f}=i,p=q.useMemo(()=>Br(f)?f.get():f,[f]);return q.createElement(t,{...d,children:p})}}function Mk(n,{style:e,vars:t},i,r){Object.assign(n.style,e,r&&r.getProjectionStyles(i));for(const s in t)n.style.setProperty(s,t[s])}const Ck=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function bk(n,e,t,i){Mk(n,e,void 0,i);for(const r in e.attrs)n.setAttribute(Ck.has(r)?r:OA(r),e.attrs[r])}function jA(n,e){const{style:t}=n,i={};for(const r in t)(Br(t[r])||e.style&&Br(e.style[r])||vk(r,n))&&(i[r]=t[r]);return i}function Pk(n,e){const t=jA(n,e);for(const i in n)if(Br(n[i])||Br(e[i])){const r=bm.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;t[r]=n[i]}return t}function XA(n,e,t,i={},r={}){return typeof e=="function"&&(e=e(t!==void 0?t:n.custom,i,r)),typeof e=="string"&&(e=n.variants&&n.variants[e]),typeof e=="function"&&(e=e(t!==void 0?t:n.custom,i,r)),e}function Rk(n){const e=q.useRef(null);return e.current===null&&(e.current=n()),e.current}const c0=n=>Array.isArray(n),XH=n=>!!(n&&typeof n=="object"&&n.mix&&n.toValue),qH=n=>c0(n)?n[n.length-1]||0:n;function Sv(n){const e=Br(n)?n.get():n;return XH(e)?e.toValue():e}function $H({scrapeMotionValuesFromProps:n,createRenderState:e,onMount:t},i,r,s){const o={latestValues:YH(i,r,s,n),renderState:e()};return t&&(o.mount=a=>t(i,a,o)),o}const Ik=n=>(e,t)=>{const i=q.useContext(k_),r=q.useContext(O_),s=()=>$H(n,e,i,r);return t?s():Rk(s)};function YH(n,e,t,i){const r={},s=i(n,{});for(const p in s)r[p]=Sv(s[p]);let{initial:o,animate:a}=n;const l=V_(n),c=gk(n);e&&c&&!l&&n.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let d=t?t.initial===!1:!1;d=d||o===!1;const f=d?a:o;return f&&typeof f!="boolean"&&!F_(f)&&(Array.isArray(f)?f:[f]).forEach(m=>{const _=XA(n,m);if(!_)return;const{transitionEnd:S,transition:x,...y}=_;for(const E in y){let w=y[E];if(Array.isArray(w)){const M=d?w.length-1:0;w=w[M]}w!==null&&(r[E]=w)}for(const E in S)r[E]=S[E]}),r}const Yn=n=>n;class AR{constructor(){this.order=[],this.scheduled=new Set}add(e){if(!this.scheduled.has(e))return this.scheduled.add(e),this.order.push(e),!0}remove(e){const t=this.order.indexOf(e);t!==-1&&(this.order.splice(t,1),this.scheduled.delete(e))}clear(){this.order.length=0,this.scheduled.clear()}}function KH(n){let e=new AR,t=new AR,i=0,r=!1,s=!1;const o=new WeakSet,a={schedule:(l,c=!1,d=!1)=>{const f=d&&r,p=f?e:t;return c&&o.add(l),p.add(l)&&f&&r&&(i=e.order.length),l},cancel:l=>{t.remove(l),o.delete(l)},process:l=>{if(r){s=!0;return}if(r=!0,[e,t]=[t,e],t.clear(),i=e.order.length,i)for(let c=0;c(f[p]=KH(()=>t=!0),f),{}),o=f=>s[f].process(r),a=()=>{const f=performance.now();t=!1,r.delta=i?1e3/60:Math.max(Math.min(f-r.timestamp,QH),1),r.timestamp=f,r.isProcessing=!0,ry.forEach(o),r.isProcessing=!1,t&&e&&(i=!1,n(a))},l=()=>{t=!0,i=!0,r.isProcessing||n(a)};return{schedule:ry.reduce((f,p)=>{const m=s[p];return f[p]=(_,S=!1,x=!1)=>(t||l(),m.schedule(_,S,x)),f},{}),cancel:f=>ry.forEach(p=>s[p].cancel(f)),state:r,steps:s}}const{schedule:Mn,cancel:ca,state:Ki,steps:aw}=JH(typeof requestAnimationFrame<"u"?requestAnimationFrame:Yn,!0),ZH={useVisualState:Ik({scrapeMotionValuesFromProps:Pk,createRenderState:Ak,onMount:(n,e,{renderState:t,latestValues:i})=>{Mn.read(()=>{try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}),Mn.render(()=>{GA(t,i,{enableHardwareAcceleration:!1},WA(e.tagName),n.transformTemplate),bk(e,t)})}})},e9={useVisualState:Ik({scrapeMotionValuesFromProps:jA,createRenderState:HA})};function t9(n,{forwardMotionProps:e=!1},t,i){return{...BA(n)?ZH:e9,preloadedFeatures:t,useRender:jH(e),createVisualElement:i,Component:n}}function Yo(n,e,t,i={passive:!0}){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t)}const Lk=n=>n.pointerType==="mouse"?typeof n.button!="number"||n.button<=0:n.isPrimary!==!1;function z_(n,e="page"){return{point:{x:n[e+"X"],y:n[e+"Y"]}}}const n9=n=>e=>Lk(e)&&n(e,z_(e));function na(n,e,t,i){return Yo(n,e,n9(t),i)}const i9=(n,e)=>t=>e(n(t)),yl=(...n)=>n.reduce(i9);function Nk(n){let e=null;return()=>{const t=()=>{e=null};return e===null?(e=n,t):!1}}const MR=Nk("dragHorizontal"),CR=Nk("dragVertical");function Dk(n){let e=!1;if(n==="y")e=CR();else if(n==="x")e=MR();else{const t=MR(),i=CR();t&&i?e=()=>{t(),i()}:(t&&t(),i&&i())}return e}function kk(){const n=Dk(!0);return n?(n(),!1):!0}class Ol{constructor(e){this.isMounted=!1,this.node=e}update(){}}function bR(n,e){const t="pointer"+(e?"enter":"leave"),i="onHover"+(e?"Start":"End"),r=(s,o)=>{if(s.pointerType==="touch"||kk())return;const a=n.getProps();n.animationState&&a.whileHover&&n.animationState.setActive("whileHover",e),a[i]&&Mn.update(()=>a[i](s,o))};return na(n.current,t,r,{passive:!n.getProps()[i]})}class r9 extends Ol{mount(){this.unmount=yl(bR(this.node,!0),bR(this.node,!1))}unmount(){}}class s9 extends Ol{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=yl(Yo(this.node.current,"focus",()=>this.onFocus()),Yo(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const Ok=(n,e)=>e?n===e?!0:Ok(n,e.parentElement):!1;function lw(n,e){if(!e)return;const t=new PointerEvent("pointer"+n);e(t,z_(t))}class o9 extends Ol{constructor(){super(...arguments),this.removeStartListeners=Yn,this.removeEndListeners=Yn,this.removeAccessibleListeners=Yn,this.startPointerPress=(e,t)=>{if(this.isPressing)return;this.removeEndListeners();const i=this.node.getProps(),s=na(window,"pointerup",(a,l)=>{if(!this.checkPressEnd())return;const{onTap:c,onTapCancel:d,globalTapTarget:f}=this.node.getProps();Mn.update(()=>{!f&&!Ok(this.node.current,a.target)?d&&d(a,l):c&&c(a,l)})},{passive:!(i.onTap||i.onPointerUp)}),o=na(window,"pointercancel",(a,l)=>this.cancelPress(a,l),{passive:!(i.onTapCancel||i.onPointerCancel)});this.removeEndListeners=yl(s,o),this.startPress(e,t)},this.startAccessiblePress=()=>{const e=s=>{if(s.key!=="Enter"||this.isPressing)return;const o=a=>{a.key!=="Enter"||!this.checkPressEnd()||lw("up",(l,c)=>{const{onTap:d}=this.node.getProps();d&&Mn.update(()=>d(l,c))})};this.removeEndListeners(),this.removeEndListeners=Yo(this.node.current,"keyup",o),lw("down",(a,l)=>{this.startPress(a,l)})},t=Yo(this.node.current,"keydown",e),i=()=>{this.isPressing&&lw("cancel",(s,o)=>this.cancelPress(s,o))},r=Yo(this.node.current,"blur",i);this.removeAccessibleListeners=yl(t,r)}}startPress(e,t){this.isPressing=!0;const{onTapStart:i,whileTap:r}=this.node.getProps();r&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),i&&Mn.update(()=>i(e,t))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!kk()}cancelPress(e,t){if(!this.checkPressEnd())return;const{onTapCancel:i}=this.node.getProps();i&&Mn.update(()=>i(e,t))}mount(){const e=this.node.getProps(),t=na(e.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),i=Yo(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=yl(t,i)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const bE=new WeakMap,cw=new WeakMap,a9=n=>{const e=bE.get(n.target);e&&e(n)},l9=n=>{n.forEach(a9)};function c9({root:n,...e}){const t=n||document;cw.has(t)||cw.set(t,{});const i=cw.get(t),r=JSON.stringify(e);return i[r]||(i[r]=new IntersectionObserver(l9,{root:n,...e})),i[r]}function u9(n,e,t){const i=c9(e);return bE.set(n,t),i.observe(n),()=>{bE.delete(n),i.unobserve(n)}}const h9={some:0,all:1};class d9 extends Ol{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:t,margin:i,amount:r="some",once:s}=e,o={root:t?t.current:void 0,rootMargin:i,threshold:typeof r=="number"?r:h9[r]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,s&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:d,onViewportLeave:f}=this.node.getProps(),p=c?d:f;p&&p(l)};return u9(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(f9(e,t))&&this.startObserver()}unmount(){}}function f9({viewport:n={}},{viewport:e={}}={}){return t=>n[t]!==e[t]}const p9={inView:{Feature:d9},tap:{Feature:o9},focus:{Feature:s9},hover:{Feature:r9}};function Uk(n,e){if(!Array.isArray(e))return!1;const t=e.length;if(t!==n.length)return!1;for(let i=0;ie[i]=t.get()),e}function g9(n){const e={};return n.values.forEach((t,i)=>e[i]=t.getVelocity()),e}function H_(n,e,t){const i=n.getProps();return XA(i,e,t!==void 0?t:i.custom,m9(n),g9(n))}let y9=Yn,qA=Yn;const vl=n=>n*1e3,ia=n=>n/1e3,v9={current:!1},Fk=n=>Array.isArray(n)&&typeof n[0]=="number";function Vk(n){return!!(!n||typeof n=="string"&&Bk[n]||Fk(n)||Array.isArray(n)&&n.every(Vk))}const Gf=([n,e,t,i])=>`cubic-bezier(${n}, ${e}, ${t}, ${i})`,Bk={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Gf([0,.65,.55,1]),circOut:Gf([.55,0,1,.45]),backIn:Gf([.31,.01,.66,-.59]),backOut:Gf([.33,1.53,.69,.99])};function zk(n){if(n)return Fk(n)?Gf(n):Array.isArray(n)?n.map(zk):Bk[n]}function _9(n,e,t,{delay:i=0,duration:r,repeat:s=0,repeatType:o="loop",ease:a,times:l}={}){const c={[e]:t};l&&(c.offset=l);const d=zk(a);return Array.isArray(d)&&(c.easing=d),n.animate(c,{delay:i,duration:r,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"})}function x9(n,{repeat:e,repeatType:t="loop"}){const i=e&&t!=="loop"&&e%2===1?0:n.length-1;return n[i]}const Hk=(n,e,t)=>(((1-3*t+3*e)*n+(3*t-6*e))*n+3*e)*n,S9=1e-7,w9=12;function E9(n,e,t,i,r){let s,o,a=0;do o=e+(t-e)/2,s=Hk(o,i,r)-n,s>0?t=o:e=o;while(Math.abs(s)>S9&&++aE9(s,0,1,n,t);return s=>s===0||s===1?s:Hk(r(s),e,i)}const T9=Im(.42,0,1,1),A9=Im(0,0,.58,1),Gk=Im(.42,0,.58,1),M9=n=>Array.isArray(n)&&typeof n[0]!="number",Wk=n=>e=>e<=.5?n(2*e)/2:(2-n(2*(1-e)))/2,jk=n=>e=>1-n(1-e),$A=n=>1-Math.sin(Math.acos(n)),Xk=jk($A),C9=Wk($A),qk=Im(.33,1.53,.69,.99),YA=jk(qk),b9=Wk(YA),P9=n=>(n*=2)<1?.5*YA(n):.5*(2-Math.pow(2,-10*(n-1))),R9={linear:Yn,easeIn:T9,easeInOut:Gk,easeOut:A9,circIn:$A,circInOut:C9,circOut:Xk,backIn:YA,backInOut:b9,backOut:qk,anticipate:P9},PR=n=>{if(Array.isArray(n)){qA(n.length===4);const[e,t,i,r]=n;return Im(e,t,i,r)}else if(typeof n=="string")return R9[n];return n},KA=(n,e)=>t=>!!(Pm(t)&&IH.test(t)&&t.startsWith(n)||e&&Object.prototype.hasOwnProperty.call(t,e)),$k=(n,e,t)=>i=>{if(!Pm(i))return i;const[r,s,o,a]=i.match(B_);return{[n]:parseFloat(r),[e]:parseFloat(s),[t]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},I9=n=>Al(0,255,n),uw={...gu,transform:n=>Math.round(I9(n))},kc={test:KA("rgb","red"),parse:$k("red","green","blue"),transform:({red:n,green:e,blue:t,alpha:i=1})=>"rgba("+uw.transform(n)+", "+uw.transform(e)+", "+uw.transform(t)+", "+ap(op.transform(i))+")"};function L9(n){let e="",t="",i="",r="";return n.length>5?(e=n.substring(1,3),t=n.substring(3,5),i=n.substring(5,7),r=n.substring(7,9)):(e=n.substring(1,2),t=n.substring(2,3),i=n.substring(3,4),r=n.substring(4,5),e+=e,t+=t,i+=i,r+=r),{red:parseInt(e,16),green:parseInt(t,16),blue:parseInt(i,16),alpha:r?parseInt(r,16)/255:1}}const PE={test:KA("#"),parse:L9,transform:kc.transform},Mh={test:KA("hsl","hue"),parse:$k("hue","saturation","lightness"),transform:({hue:n,saturation:e,lightness:t,alpha:i=1})=>"hsla("+Math.round(n)+", "+go.transform(ap(e))+", "+go.transform(ap(t))+", "+ap(op.transform(i))+")"},dr={test:n=>kc.test(n)||PE.test(n)||Mh.test(n),parse:n=>kc.test(n)?kc.parse(n):Mh.test(n)?Mh.parse(n):PE.parse(n),transform:n=>Pm(n)?n:n.hasOwnProperty("red")?kc.transform(n):Mh.transform(n)},Vn=(n,e,t)=>-t*n+t*e+n;function hw(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*(2/3-t)*6:n}function N9({hue:n,saturation:e,lightness:t,alpha:i}){n/=360,e/=100,t/=100;let r=0,s=0,o=0;if(!e)r=s=o=t;else{const a=t<.5?t*(1+e):t+e-t*e,l=2*t-a;r=hw(l,a,n+1/3),s=hw(l,a,n),o=hw(l,a,n-1/3)}return{red:Math.round(r*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:i}}const dw=(n,e,t)=>{const i=n*n;return Math.sqrt(Math.max(0,t*(e*e-i)+i))},D9=[PE,kc,Mh],k9=n=>D9.find(e=>e.test(n));function RR(n){const e=k9(n);let t=e.parse(n);return e===Mh&&(t=N9(t)),t}const Yk=(n,e)=>{const t=RR(n),i=RR(e),r={...t};return s=>(r.red=dw(t.red,i.red,s),r.green=dw(t.green,i.green,s),r.blue=dw(t.blue,i.blue,s),r.alpha=Vn(t.alpha,i.alpha,s),kc.transform(r))};function O9(n){var e,t;return isNaN(n)&&Pm(n)&&(((e=n.match(B_))===null||e===void 0?void 0:e.length)||0)+(((t=n.match(Sk))===null||t===void 0?void 0:t.length)||0)>0}const Kk={regex:PH,countKey:"Vars",token:"${v}",parse:Yn},Qk={regex:Sk,countKey:"Colors",token:"${c}",parse:dr.parse},Jk={regex:B_,countKey:"Numbers",token:"${n}",parse:gu.parse};function fw(n,{regex:e,countKey:t,token:i,parse:r}){const s=n.tokenised.match(e);s&&(n["num"+t]=s.length,n.tokenised=n.tokenised.replace(e,i),n.values.push(...s.map(r)))}function u0(n){const e=n.toString(),t={value:e,tokenised:e,values:[],numVars:0,numColors:0,numNumbers:0};return t.value.includes("var(--")&&fw(t,Kk),fw(t,Qk),fw(t,Jk),t}function Zk(n){return u0(n).values}function eO(n){const{values:e,numColors:t,numVars:i,tokenised:r}=u0(n),s=e.length;return o=>{let a=r;for(let l=0;ltypeof n=="number"?0:n;function F9(n){const e=Zk(n);return eO(n)(e.map(U9))}const Ml={test:O9,parse:Zk,createTransformer:eO,getAnimatableNone:F9},tO=(n,e)=>t=>`${t>0?e:n}`;function nO(n,e){return typeof n=="number"?t=>Vn(n,e,t):dr.test(n)?Yk(n,e):n.startsWith("var(")?tO(n,e):rO(n,e)}const iO=(n,e)=>{const t=[...n],i=t.length,r=n.map((s,o)=>nO(s,e[o]));return s=>{for(let o=0;o{const t={...n,...e},i={};for(const r in t)n[r]!==void 0&&e[r]!==void 0&&(i[r]=nO(n[r],e[r]));return r=>{for(const s in i)t[s]=i[s](r);return t}},rO=(n,e)=>{const t=Ml.createTransformer(e),i=u0(n),r=u0(e);return i.numVars===r.numVars&&i.numColors===r.numColors&&i.numNumbers>=r.numNumbers?yl(iO(i.values,r.values),t):tO(n,e)},Xp=(n,e,t)=>{const i=e-n;return i===0?1:(t-n)/i},IR=(n,e)=>t=>Vn(n,e,t);function B9(n){return typeof n=="number"?IR:typeof n=="string"?dr.test(n)?Yk:rO:Array.isArray(n)?iO:typeof n=="object"?V9:IR}function z9(n,e,t){const i=[],r=t||B9(n[0]),s=n.length-1;for(let o=0;oe[0];n[0]>n[s-1]&&(n=[...n].reverse(),e=[...e].reverse());const o=z9(e,i,r),a=o.length,l=c=>{let d=0;if(a>1)for(;dl(Al(n[0],n[s-1],c)):l}function H9(n,e){const t=n[n.length-1];for(let i=1;i<=e;i++){const r=Xp(0,e,i);n.push(Vn(t,1,r))}}function G9(n){const e=[0];return H9(e,n.length-1),e}function W9(n,e){return n.map(t=>t*e)}function j9(n,e){return n.map(()=>e||Gk).splice(0,n.length-1)}function h0({duration:n=300,keyframes:e,times:t,ease:i="easeInOut"}){const r=M9(i)?i.map(PR):PR(i),s={done:!1,value:e[0]},o=W9(t&&t.length===e.length?t:G9(e),n),a=sO(o,e,{ease:Array.isArray(r)?r:j9(e,r)});return{calculatedDuration:n,next:l=>(s.value=a(l),s.done=l>=n,s)}}function oO(n,e){return e?n*(1e3/e):0}const X9=5;function aO(n,e,t){const i=Math.max(e-X9,0);return oO(t-n(i),e-i)}const pw=.001,q9=.01,LR=10,$9=.05,Y9=1;function K9({duration:n=800,bounce:e=.25,velocity:t=0,mass:i=1}){let r,s;y9(n<=vl(LR));let o=1-e;o=Al($9,Y9,o),n=Al(q9,LR,ia(n)),o<1?(r=c=>{const d=c*o,f=d*n,p=d-t,m=RE(c,o),_=Math.exp(-f);return pw-p/m*_},s=c=>{const f=c*o*n,p=f*t+t,m=Math.pow(o,2)*Math.pow(c,2)*n,_=Math.exp(-f),S=RE(Math.pow(c,2),o);return(-r(c)+pw>0?-1:1)*((p-m)*_)/S}):(r=c=>{const d=Math.exp(-c*n),f=(c-t)*n+1;return-pw+d*f},s=c=>{const d=Math.exp(-c*n),f=(t-c)*(n*n);return d*f});const a=5/n,l=J9(r,s,a);if(n=vl(n),isNaN(l))return{stiffness:100,damping:10,duration:n};{const c=Math.pow(l,2)*i;return{stiffness:c,damping:o*2*Math.sqrt(i*c),duration:n}}}const Q9=12;function J9(n,e,t){let i=t;for(let r=1;rn[t]!==void 0)}function t8(n){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...n};if(!NR(n,e8)&&NR(n,Z9)){const t=K9(n);e={...e,...t,mass:1},e.isResolvedFromDuration=!0}return e}function lO({keyframes:n,restDelta:e,restSpeed:t,...i}){const r=n[0],s=n[n.length-1],o={done:!1,value:r},{stiffness:a,damping:l,mass:c,duration:d,velocity:f,isResolvedFromDuration:p}=t8({...i,velocity:-ia(i.velocity||0)}),m=f||0,_=l/(2*Math.sqrt(a*c)),S=s-r,x=ia(Math.sqrt(a/c)),y=Math.abs(S)<5;t||(t=y?.01:2),e||(e=y?.005:.5);let E;if(_<1){const w=RE(x,_);E=M=>{const O=Math.exp(-_*x*M);return s-O*((m+_*x*S)/w*Math.sin(w*M)+S*Math.cos(w*M))}}else if(_===1)E=w=>s-Math.exp(-x*w)*(S+(m+x*S)*w);else{const w=x*Math.sqrt(_*_-1);E=M=>{const O=Math.exp(-_*x*M),k=Math.min(w*M,300);return s-O*((m+_*x*S)*Math.sinh(k)+w*S*Math.cosh(k))/w}}return{calculatedDuration:p&&d||null,next:w=>{const M=E(w);if(p)o.done=w>=d;else{let O=m;w!==0&&(_<1?O=aO(E,w,M):O=0);const k=Math.abs(O)<=t,I=Math.abs(s-M)<=e;o.done=k&&I}return o.value=o.done?s:M,o}}}function DR({keyframes:n,velocity:e=0,power:t=.8,timeConstant:i=325,bounceDamping:r=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:d}){const f=n[0],p={done:!1,value:f},m=P=>a!==void 0&&Pl,_=P=>a===void 0?l:l===void 0||Math.abs(a-P)-S*Math.exp(-P/i),w=P=>y+E(P),M=P=>{const D=E(P),A=w(P);p.done=Math.abs(D)<=c,p.value=p.done?y:A};let O,k;const I=P=>{m(p.value)&&(O=P,k=lO({keyframes:[p.value,_(p.value)],velocity:aO(w,P,p.value),damping:r,stiffness:s,restDelta:c,restSpeed:d}))};return I(0),{calculatedDuration:null,next:P=>{let D=!1;return!k&&O===void 0&&(D=!0,M(P),I(P)),O!==void 0&&P>O?k.next(P-O):(!D&&M(P),p)}}}const n8=n=>{const e=({timestamp:t})=>n(t);return{start:()=>Mn.update(e,!0),stop:()=>ca(e),now:()=>Ki.isProcessing?Ki.timestamp:performance.now()}},kR=2e4;function OR(n){let e=0;const t=50;let i=n.next(e);for(;!i.done&&e=kR?1/0:e}const i8={decay:DR,inertia:DR,tween:h0,keyframes:h0,spring:lO};function d0({autoplay:n=!0,delay:e=0,driver:t=n8,keyframes:i,type:r="keyframes",repeat:s=0,repeatDelay:o=0,repeatType:a="loop",onPlay:l,onStop:c,onComplete:d,onUpdate:f,...p}){let m=1,_=!1,S,x;const y=()=>{x=new Promise(oe=>{S=oe})};y();let E;const w=i8[r]||h0;let M;w!==h0&&typeof i[0]!="number"&&(M=sO([0,100],i,{clamp:!1}),i=[0,100]);const O=w({...p,keyframes:i});let k;a==="mirror"&&(k=w({...p,keyframes:[...i].reverse(),velocity:-(p.velocity||0)}));let I="idle",P=null,D=null,A=null;O.calculatedDuration===null&&s&&(O.calculatedDuration=OR(O));const{calculatedDuration:R}=O;let V=1/0,U=1/0;R!==null&&(V=R+o,U=V*(s+1)-o);let se=0;const le=oe=>{if(D===null)return;m>0&&(D=Math.min(D,oe)),m<0&&(D=Math.min(oe-U/m,D)),P!==null?se=P:se=Math.round(oe-D)*m;const Me=se-e*(m>=0?1:-1),Re=m>=0?Me<0:Me>U;se=Math.max(Me,0),I==="finished"&&P===null&&(se=U);let he=se,we=O;if(s){const dt=Math.min(se,U)/V;let Ke=Math.floor(dt),ke=dt%1;!ke&&dt>=1&&(ke=1),ke===1&&Ke--,Ke=Math.min(Ke,s+1),!!(Ke%2)&&(a==="reverse"?(ke=1-ke,o&&(ke-=o/V)):a==="mirror"&&(we=k)),he=Al(0,1,ke)*V}const Ne=Re?{done:!1,value:i[0]}:we.next(he);M&&(Ne.value=M(Ne.value));let{done:be}=Ne;!Re&&R!==null&&(be=m>=0?se>=U:se<=0);const ft=P===null&&(I==="finished"||I==="running"&&be);return f&&f(Ne.value),ft&&W(),Ne},ee=()=>{E&&E.stop(),E=void 0},pe=()=>{I="idle",ee(),S(),y(),D=A=null},W=()=>{I="finished",d&&d(),ee(),S()},J=()=>{if(_)return;E||(E=t(le));const oe=E.now();l&&l(),P!==null?D=oe-P:(!D||I==="finished")&&(D=oe),I==="finished"&&y(),A=D,P=null,I="running",E.start()};n&&J();const Z={then(oe,Me){return x.then(oe,Me)},get time(){return ia(se)},set time(oe){oe=vl(oe),se=oe,P!==null||!E||m===0?P=oe:D=E.now()-oe/m},get duration(){const oe=O.calculatedDuration===null?OR(O):O.calculatedDuration;return ia(oe)},get speed(){return m},set speed(oe){oe===m||!E||(m=oe,Z.time=ia(se))},get state(){return I},play:J,pause:()=>{I="paused",P=se},stop:()=>{_=!0,I!=="idle"&&(I="idle",c&&c(),pe())},cancel:()=>{A!==null&&le(A),pe()},complete:()=>{I="finished"},sample:oe=>(D=0,le(oe))};return Z}function r8(n){let e;return()=>(e===void 0&&(e=n()),e)}const s8=r8(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),o8=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),sy=10,a8=2e4,l8=(n,e)=>e.type==="spring"||n==="backgroundColor"||!Vk(e.ease);function c8(n,e,{onUpdate:t,onComplete:i,...r}){if(!(s8()&&o8.has(e)&&!r.repeatDelay&&r.repeatType!=="mirror"&&r.damping!==0&&r.type!=="inertia"))return!1;let o=!1,a,l,c=!1;const d=()=>{l=new Promise(w=>{a=w})};d();let{keyframes:f,duration:p=300,ease:m,times:_}=r;if(l8(e,r)){const w=d0({...r,repeat:0,delay:0});let M={done:!1,value:f[0]};const O=[];let k=0;for(;!M.done&&k{c=!1,S.cancel()},y=()=>{c=!0,Mn.update(x),a(),d()};return S.onfinish=()=>{c||(n.set(x9(f,r)),i&&i(),y())},{then(w,M){return l.then(w,M)},attachTimeline(w){return S.timeline=w,S.onfinish=null,Yn},get time(){return ia(S.currentTime||0)},set time(w){S.currentTime=vl(w)},get speed(){return S.playbackRate},set speed(w){S.playbackRate=w},get duration(){return ia(p)},play:()=>{o||(S.play(),ca(x))},pause:()=>S.pause(),stop:()=>{if(o=!0,S.playState==="idle")return;const{currentTime:w}=S;if(w){const M=d0({...r,autoplay:!1});n.setWithVelocity(M.sample(w-sy).value,M.sample(w).value,sy)}y()},complete:()=>{c||S.finish()},cancel:y}}function u8({keyframes:n,delay:e,onUpdate:t,onComplete:i}){const r=()=>(t&&t(n[n.length-1]),i&&i(),{time:0,speed:1,duration:0,play:Yn,pause:Yn,stop:Yn,then:s=>(s(),Promise.resolve()),cancel:Yn,complete:Yn});return e?d0({keyframes:[0,1],duration:0,delay:e,onComplete:r}):r()}const h8={type:"spring",stiffness:500,damping:25,restSpeed:10},d8=n=>({type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restSpeed:10}),f8={type:"keyframes",duration:.8},p8={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},m8=(n,{keyframes:e})=>e.length>2?f8:mu.has(n)?n.startsWith("scale")?d8(e[1]):h8:p8,IE=(n,e)=>n==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Ml.test(e)||e==="0")&&!e.startsWith("url(")),g8=new Set(["brightness","contrast","saturate","opacity"]);function y8(n){const[e,t]=n.slice(0,-1).split("(");if(e==="drop-shadow")return n;const[i]=t.match(B_)||[];if(!i)return n;const r=t.replace(i,"");let s=g8.has(e)?1:0;return i!==t&&(s*=100),e+"("+s+r+")"}const v8=/([a-z-]*)\(.*?\)/g,LE={...Ml,getAnimatableNone:n=>{const e=n.match(v8);return e?e.map(y8).join(" "):n}},_8={...wk,color:dr,backgroundColor:dr,outlineColor:dr,fill:dr,stroke:dr,borderColor:dr,borderTopColor:dr,borderRightColor:dr,borderBottomColor:dr,borderLeftColor:dr,filter:LE,WebkitFilter:LE},QA=n=>_8[n];function cO(n,e){let t=QA(n);return t!==LE&&(t=Ml),t.getAnimatableNone?t.getAnimatableNone(e):void 0}const uO=n=>/^0[^.\s]+$/.test(n);function x8(n){if(typeof n=="number")return n===0;if(n!==null)return n==="none"||n==="0"||uO(n)}function S8(n,e,t,i){const r=IE(e,t);let s;Array.isArray(t)?s=[...t]:s=[null,t];const o=i.from!==void 0?i.from:n.get();let a;const l=[];for(let c=0;cr=>{const s=JA(i,n)||{},o=s.delay||i.delay||0;let{elapsed:a=0}=i;a=a-vl(o);const l=S8(e,n,t,s),c=l[0],d=l[l.length-1],f=IE(n,c),p=IE(n,d);let m={keyframes:l,velocity:e.getVelocity(),ease:"easeOut",...s,delay:-a,onUpdate:_=>{e.set(_),s.onUpdate&&s.onUpdate(_)},onComplete:()=>{r(),s.onComplete&&s.onComplete()}};if(w8(s)||(m={...m,...m8(n,m)}),m.duration&&(m.duration=vl(m.duration)),m.repeatDelay&&(m.repeatDelay=vl(m.repeatDelay)),!f||!p||v9.current||s.type===!1||E8.skipAnimations)return u8(m);if(!i.isHandoff&&e.owner&&e.owner.current instanceof HTMLElement&&!e.owner.getProps().onUpdate){const _=c8(e,n,m);if(_)return _}return d0(m)};function f0(n){return!!(Br(n)&&n.add)}const hO=n=>/^\-?\d*\.?\d+$/.test(n);function eM(n,e){n.indexOf(e)===-1&&n.push(e)}function tM(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}class nM{constructor(){this.subscriptions=[]}add(e){return eM(this.subscriptions,e),()=>tM(this.subscriptions,e)}notify(e,t,i){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,t,i);else for(let s=0;s!isNaN(parseFloat(n));class A8{constructor(e,t={}){this.version="10.18.0",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(i,r=!0)=>{this.prev=this.current,this.current=i;const{delta:s,timestamp:o}=Ki;this.lastUpdated!==o&&(this.timeDelta=s,this.lastUpdated=o,Mn.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),r&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>Mn.postRender(this.velocityCheck),this.velocityCheck=({timestamp:i})=>{i!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=e,this.canTrackVelocity=T8(this.current),this.owner=t.owner}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new nM);const i=this.events[e].add(t);return e==="change"?()=>{i(),Mn.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){!t||!this.passiveEffect?this.updateAndNotify(e,t):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,t,i){this.set(t),this.prev=e,this.timeDelta=i}jump(e){this.updateAndNotify(e),this.prev=e,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?oO(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function id(n,e){return new A8(n,e)}const dO=n=>e=>e.test(n),M8={test:n=>n==="auto",parse:n=>n},fO=[gu,Ct,go,Xa,NH,LH,M8],vf=n=>fO.find(dO(n)),C8=[...fO,dr,Ml],b8=n=>C8.find(dO(n));function P8(n,e,t){n.hasValue(e)?n.getValue(e).set(t):n.addValue(e,id(t))}function R8(n,e){const t=H_(n,e);let{transitionEnd:i={},transition:r={},...s}=t?n.makeTargetAnimatable(t,!1):{};s={...s,...i};for(const o in s){const a=qH(s[o]);P8(n,o,a)}}function I8(n,e,t){var i,r;const s=Object.keys(e).filter(a=>!n.hasValue(a)),o=s.length;if(o)for(let a=0;al.remove(f))),c.push(x)}return o&&Promise.all(c).then(()=>{o&&R8(n,o)}),c}function NE(n,e,t={}){const i=H_(n,e,t.custom);let{transition:r=n.getDefaultTransition()||{}}=i||{};t.transitionOverride&&(r=t.transitionOverride);const s=i?()=>Promise.all(pO(n,i,t)):()=>Promise.resolve(),o=n.variantChildren&&n.variantChildren.size?(l=0)=>{const{delayChildren:c=0,staggerChildren:d,staggerDirection:f}=r;return O8(n,e,c+l,d,f,t)}:()=>Promise.resolve(),{when:a}=r;if(a){const[l,c]=a==="beforeChildren"?[s,o]:[o,s];return l().then(()=>c())}else return Promise.all([s(),o(t.delay)])}function O8(n,e,t=0,i=0,r=1,s){const o=[],a=(n.variantChildren.size-1)*i,l=r===1?(c=0)=>c*i:(c=0)=>a-c*i;return Array.from(n.variantChildren).sort(U8).forEach((c,d)=>{c.notify("AnimationStart",e),o.push(NE(c,e,{...s,delay:t+l(d)}).then(()=>c.notify("AnimationComplete",e)))}),Promise.all(o)}function U8(n,e){return n.sortNodePosition(e)}function F8(n,e,t={}){n.notify("AnimationStart",e);let i;if(Array.isArray(e)){const r=e.map(s=>NE(n,s,t));i=Promise.all(r)}else if(typeof e=="string")i=NE(n,e,t);else{const r=typeof e=="function"?H_(n,e,t.custom):e;i=Promise.all(pO(n,r,t))}return i.then(()=>n.notify("AnimationComplete",e))}const V8=[...UA].reverse(),B8=UA.length;function z8(n){return e=>Promise.all(e.map(({animation:t,options:i})=>F8(n,t,i)))}function H8(n){let e=z8(n);const t=W8();let i=!0;const r=(l,c)=>{const d=H_(n,c);if(d){const{transition:f,transitionEnd:p,...m}=d;l={...l,...m,...p}}return l};function s(l){e=l(n)}function o(l,c){const d=n.getProps(),f=n.getVariantContext(!0)||{},p=[],m=new Set;let _={},S=1/0;for(let y=0;yS&&O,A=!1;const R=Array.isArray(M)?M:[M];let V=R.reduce(r,{});k===!1&&(V={});const{prevResolvedValues:U={}}=w,se={...U,...V},le=ee=>{D=!0,m.has(ee)&&(A=!0,m.delete(ee)),w.needsAnimating[ee]=!0};for(const ee in se){const pe=V[ee],W=U[ee];if(_.hasOwnProperty(ee))continue;let J=!1;c0(pe)&&c0(W)?J=!Uk(pe,W):J=pe!==W,J?pe!==void 0?le(ee):m.add(ee):pe!==void 0&&m.has(ee)?le(ee):w.protectedKeys[ee]=!0}w.prevProp=M,w.prevResolvedValues=V,w.isActive&&(_={..._,...V}),i&&n.blockInitialAnimation&&(D=!1),D&&(!I||A)&&p.push(...R.map(ee=>({animation:ee,options:{type:E,...l}})))}if(m.size){const y={};m.forEach(E=>{const w=n.getBaseTarget(E);w!==void 0&&(y[E]=w)}),p.push({animation:y})}let x=!!p.length;return i&&(d.initial===!1||d.initial===d.animate)&&!n.manuallyAnimateOnMount&&(x=!1),i=!1,x?e(p):Promise.resolve()}function a(l,c,d){var f;if(t[l].isActive===c)return Promise.resolve();(f=n.variantChildren)===null||f===void 0||f.forEach(m=>{var _;return(_=m.animationState)===null||_===void 0?void 0:_.setActive(l,c)}),t[l].isActive=c;const p=o(d,l);for(const m in t)t[m].protectedKeys={};return p}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>t}}function G8(n,e){return typeof e=="string"?e!==n:Array.isArray(e)?!Uk(e,n):!1}function lc(n=!1){return{isActive:n,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function W8(){return{animate:lc(!0),whileInView:lc(),whileHover:lc(),whileTap:lc(),whileDrag:lc(),whileFocus:lc(),exit:lc()}}class j8 extends Ol{constructor(e){super(e),e.animationState||(e.animationState=H8(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();this.unmount(),F_(e)&&(this.unmount=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){}}let X8=0;class q8 extends Ol{constructor(){super(...arguments),this.id=X8++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:t,custom:i}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;const s=this.node.animationState.setActive("exit",!e,{custom:i??this.node.getProps().custom});t&&!e&&s.then(()=>t(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}const $8={animation:{Feature:j8},exit:{Feature:q8}},UR=(n,e)=>Math.abs(n-e);function Y8(n,e){const t=UR(n.x,e.x),i=UR(n.y,e.y);return Math.sqrt(t**2+i**2)}class mO{constructor(e,t,{transformPagePoint:i,contextWindow:r,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=gw(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,m=Y8(f.offset,{x:0,y:0})>=3;if(!p&&!m)return;const{point:_}=f,{timestamp:S}=Ki;this.history.push({..._,timestamp:S});const{onStart:x,onMove:y}=this.handlers;p||(x&&x(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,f)},this.handlePointerMove=(f,p)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=mw(p,this.transformPagePoint),Mn.update(this.updatePoint,!0)},this.handlePointerUp=(f,p)=>{this.end();const{onEnd:m,onSessionEnd:_,resumeAnimation:S}=this.handlers;if(this.dragSnapToOrigin&&S&&S(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=gw(f.type==="pointercancel"?this.lastMoveEventInfo:mw(p,this.transformPagePoint),this.history);this.startEvent&&m&&m(f,x),_&&_(f,x)},!Lk(e))return;this.dragSnapToOrigin=s,this.handlers=t,this.transformPagePoint=i,this.contextWindow=r||window;const o=z_(e),a=mw(o,this.transformPagePoint),{point:l}=a,{timestamp:c}=Ki;this.history=[{...l,timestamp:c}];const{onSessionStart:d}=t;d&&d(e,gw(a,this.history)),this.removeListeners=yl(na(this.contextWindow,"pointermove",this.handlePointerMove),na(this.contextWindow,"pointerup",this.handlePointerUp),na(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),ca(this.updatePoint)}}function mw(n,e){return e?{point:e(n.point)}:n}function FR(n,e){return{x:n.x-e.x,y:n.y-e.y}}function gw({point:n},e){return{point:n,delta:FR(n,gO(e)),offset:FR(n,K8(e)),velocity:Q8(e,.1)}}function K8(n){return n[0]}function gO(n){return n[n.length-1]}function Q8(n,e){if(n.length<2)return{x:0,y:0};let t=n.length-1,i=null;const r=gO(n);for(;t>=0&&(i=n[t],!(r.timestamp-i.timestamp>vl(e)));)t--;if(!i)return{x:0,y:0};const s=ia(r.timestamp-i.timestamp);if(s===0)return{x:0,y:0};const o={x:(r.x-i.x)/s,y:(r.y-i.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function ts(n){return n.max-n.min}function DE(n,e=0,t=.01){return Math.abs(n-e)<=t}function VR(n,e,t,i=.5){n.origin=i,n.originPoint=Vn(e.min,e.max,n.origin),n.scale=ts(t)/ts(e),(DE(n.scale,1,1e-4)||isNaN(n.scale))&&(n.scale=1),n.translate=Vn(t.min,t.max,n.origin)-n.originPoint,(DE(n.translate)||isNaN(n.translate))&&(n.translate=0)}function lp(n,e,t,i){VR(n.x,e.x,t.x,i?i.originX:void 0),VR(n.y,e.y,t.y,i?i.originY:void 0)}function BR(n,e,t){n.min=t.min+e.min,n.max=n.min+ts(e)}function J8(n,e,t){BR(n.x,e.x,t.x),BR(n.y,e.y,t.y)}function zR(n,e,t){n.min=e.min-t.min,n.max=n.min+ts(e)}function cp(n,e,t){zR(n.x,e.x,t.x),zR(n.y,e.y,t.y)}function Z8(n,{min:e,max:t},i){return e!==void 0&&nt&&(n=i?Vn(t,n,i.max):Math.min(n,t)),n}function HR(n,e,t){return{min:e!==void 0?n.min+e:void 0,max:t!==void 0?n.max+t-(n.max-n.min):void 0}}function eG(n,{top:e,left:t,bottom:i,right:r}){return{x:HR(n.x,t,r),y:HR(n.y,e,i)}}function GR(n,e){let t=e.min-n.min,i=e.max-n.max;return e.max-e.mini?t=Xp(e.min,e.max-i,n.min):i>r&&(t=Xp(n.min,n.max-r,e.min)),Al(0,1,t)}function iG(n,e){const t={};return e.min!==void 0&&(t.min=e.min-n.min),e.max!==void 0&&(t.max=e.max-n.min),t}const kE=.35;function rG(n=kE){return n===!1?n=0:n===!0&&(n=kE),{x:WR(n,"left","right"),y:WR(n,"top","bottom")}}function WR(n,e,t){return{min:jR(n,e),max:jR(n,t)}}function jR(n,e){return typeof n=="number"?n:n[e]||0}const XR=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ch=()=>({x:XR(),y:XR()}),qR=()=>({min:0,max:0}),hi=()=>({x:qR(),y:qR()});function vs(n){return[n("x"),n("y")]}function yO({top:n,left:e,right:t,bottom:i}){return{x:{min:e,max:t},y:{min:n,max:i}}}function sG({x:n,y:e}){return{top:e.min,right:n.max,bottom:e.max,left:n.min}}function oG(n,e){if(!e)return n;const t=e({x:n.left,y:n.top}),i=e({x:n.right,y:n.bottom});return{top:t.y,left:t.x,bottom:i.y,right:i.x}}function yw(n){return n===void 0||n===1}function OE({scale:n,scaleX:e,scaleY:t}){return!yw(n)||!yw(e)||!yw(t)}function Ec(n){return OE(n)||vO(n)||n.z||n.rotate||n.rotateX||n.rotateY}function vO(n){return $R(n.x)||$R(n.y)}function $R(n){return n&&n!=="0%"}function p0(n,e,t){const i=n-t,r=e*i;return t+r}function YR(n,e,t,i,r){return r!==void 0&&(n=p0(n,r,i)),p0(n,t,i)+e}function UE(n,e=0,t=1,i,r){n.min=YR(n.min,e,t,i,r),n.max=YR(n.max,e,t,i,r)}function _O(n,{x:e,y:t}){UE(n.x,e.translate,e.scale,e.originPoint),UE(n.y,t.translate,t.scale,t.originPoint)}function aG(n,e,t,i=!1){const r=t.length;if(!r)return;e.x=e.y=1;let s,o;for(let a=0;a1.0000000000001||n<.999999999999?n:1}function Ya(n,e){n.min=n.min+e,n.max=n.max+e}function QR(n,e,[t,i,r]){const s=e[r]!==void 0?e[r]:.5,o=Vn(n.min,n.max,s);UE(n,e[t],e[i],o,e.scale)}const lG=["x","scaleX","originX"],cG=["y","scaleY","originY"];function bh(n,e){QR(n.x,e,lG),QR(n.y,e,cG)}function xO(n,e){return yO(oG(n.getBoundingClientRect(),e))}function uG(n,e,t){const i=xO(n,t),{scroll:r}=e;return r&&(Ya(i.x,r.offset.x),Ya(i.y,r.offset.y)),i}const SO=({current:n})=>n?n.ownerDocument.defaultView:null,hG=new WeakMap;class dG{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=hi(),this.visualElement=e}start(e,{snapToCursor:t=!1}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const r=d=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(z_(d,"page").point)},s=(d,f)=>{const{drag:p,dragPropagation:m,onDragStart:_}=this.getProps();if(p&&!m&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=Dk(p),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),vs(x=>{let y=this.getAxisMotionValue(x).get()||0;if(go.test(y)){const{projection:E}=this.visualElement;if(E&&E.layout){const w=E.layout.layoutBox[x];w&&(y=ts(w)*(parseFloat(y)/100))}}this.originPoint[x]=y}),_&&Mn.update(()=>_(d,f),!1,!0);const{animationState:S}=this.visualElement;S&&S.setActive("whileDrag",!0)},o=(d,f)=>{const{dragPropagation:p,dragDirectionLock:m,onDirectionLock:_,onDrag:S}=this.getProps();if(!p&&!this.openGlobalLock)return;const{offset:x}=f;if(m&&this.currentDirection===null){this.currentDirection=fG(x),this.currentDirection!==null&&_&&_(this.currentDirection);return}this.updateAxis("x",f.point,x),this.updateAxis("y",f.point,x),this.visualElement.render(),S&&S(d,f)},a=(d,f)=>this.stop(d,f),l=()=>vs(d=>{var f;return this.getAnimationState(d)==="paused"&&((f=this.getAxisMotionValue(d).animation)===null||f===void 0?void 0:f.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new mO(e,{onSessionStart:r,onStart:s,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:SO(this.visualElement)})}stop(e,t){const i=this.isDragging;if(this.cancel(),!i)return;const{velocity:r}=t;this.startAnimation(r);const{onDragEnd:s}=this.getProps();s&&Mn.update(()=>s(e,t))}cancel(){this.isDragging=!1;const{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:i}=this.getProps();!i&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(e,t,i){const{drag:r}=this.getProps();if(!i||!oy(e,r,this.currentDirection))return;const s=this.getAxisMotionValue(e);let o=this.originPoint[e]+i[e];this.constraints&&this.constraints[e]&&(o=Z8(o,this.constraints[e],this.elastic[e])),s.set(o)}resolveConstraints(){var e;const{dragConstraints:t,dragElastic:i}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(e=this.visualElement.projection)===null||e===void 0?void 0:e.layout,s=this.constraints;t&&Ah(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=eG(r.layoutBox,t):this.constraints=!1,this.elastic=rG(i),s!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&vs(o=>{this.getAxisMotionValue(o)&&(this.constraints[o]=iG(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!Ah(e))return!1;const i=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const s=uG(i,r.root,this.visualElement.getTransformPagePoint());let o=tG(r.layout.layoutBox,s);if(t){const a=t(sG(o));this.hasMutatedConstraints=!!a,a&&(o=yO(a))}return o}startAnimation(e){const{drag:t,dragMomentum:i,dragElastic:r,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=vs(d=>{if(!oy(d,t,this.currentDirection))return;let f=l&&l[d]||{};o&&(f={min:0,max:0});const p=r?200:1e6,m=r?40:1e7,_={type:"inertia",velocity:i?e[d]:0,bounceStiffness:p,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...s,...f};return this.startAxisValueAnimation(d,_)});return Promise.all(c).then(a)}startAxisValueAnimation(e,t){const i=this.getAxisMotionValue(e);return i.start(ZA(e,i,0,t))}stopAnimation(){vs(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){vs(e=>{var t;return(t=this.getAxisMotionValue(e).animation)===null||t===void 0?void 0:t.pause()})}getAnimationState(e){var t;return(t=this.getAxisMotionValue(e).animation)===null||t===void 0?void 0:t.state}getAxisMotionValue(e){const t="_drag"+e.toUpperCase(),i=this.visualElement.getProps(),r=i[t];return r||this.visualElement.getValue(e,(i.initial?i.initial[e]:void 0)||0)}snapToCursor(e){vs(t=>{const{drag:i}=this.getProps();if(!oy(t,i,this.currentDirection))return;const{projection:r}=this.visualElement,s=this.getAxisMotionValue(t);if(r&&r.layout){const{min:o,max:a}=r.layout.layoutBox[t];s.set(e[t]-Vn(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:i}=this.visualElement;if(!Ah(t)||!i||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};vs(o=>{const a=this.getAxisMotionValue(o);if(a){const l=a.get();r[o]=nG({min:l,max:l},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),vs(o=>{if(!oy(o,e,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(Vn(l,c,r[o]))})}addListeners(){if(!this.visualElement.current)return;hG.set(this.visualElement,this);const e=this.visualElement.current,t=na(e,"pointerdown",l=>{const{drag:c,dragListener:d=!0}=this.getProps();c&&d&&this.start(l)}),i=()=>{const{dragConstraints:l}=this.getProps();Ah(l)&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,s=r.addEventListener("measure",i);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),i();const o=Yo(window,"resize",()=>this.scalePositionWithinConstraints()),a=r.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(vs(d=>{const f=this.getAxisMotionValue(d);f&&(this.originPoint[d]+=l[d].translate,f.set(f.get()+l[d].translate))}),this.visualElement.render())});return()=>{o(),t(),s(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:i=!1,dragPropagation:r=!1,dragConstraints:s=!1,dragElastic:o=kE,dragMomentum:a=!0}=e;return{...e,drag:t,dragDirectionLock:i,dragPropagation:r,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function oy(n,e,t){return(e===!0||e===n)&&(t===null||t===n)}function fG(n,e=10){let t=null;return Math.abs(n.y)>e?t="y":Math.abs(n.x)>e&&(t="x"),t}class pG extends Ol{constructor(e){super(e),this.removeGroupControls=Yn,this.removeListeners=Yn,this.controls=new dG(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Yn}unmount(){this.removeGroupControls(),this.removeListeners()}}const JR=n=>(e,t)=>{n&&Mn.update(()=>n(e,t))};class mG extends Ol{constructor(){super(...arguments),this.removePointerDownListener=Yn}onPointerDown(e){this.session=new mO(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:SO(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:i,onPanEnd:r}=this.node.getProps();return{onSessionStart:JR(e),onStart:JR(t),onMove:i,onEnd:(s,o)=>{delete this.session,r&&Mn.update(()=>r(s,o))}}}mount(){this.removePointerDownListener=na(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function gG(){const n=q.useContext(O_);if(n===null)return[!0,null];const{isPresent:e,onExitComplete:t,register:i}=n,r=q.useId();return q.useEffect(()=>i(r),[]),!e&&t?[!1,()=>t&&t(r)]:[!0]}const wv={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function ZR(n,e){return e.max===e.min?0:n/(e.max-e.min)*100}const _f={correct:(n,e)=>{if(!e.target)return n;if(typeof n=="string")if(Ct.test(n))n=parseFloat(n);else return n;const t=ZR(n,e.target.x),i=ZR(n,e.target.y);return`${t}% ${i}%`}},yG={correct:(n,{treeScale:e,projectionDelta:t})=>{const i=n,r=Ml.parse(n);if(r.length>5)return i;const s=Ml.createTransformer(n),o=typeof r[0]!="number"?1:0,a=t.x.scale*e.x,l=t.y.scale*e.y;r[0+o]/=a,r[1+o]/=l;const c=Vn(a,l,.5);return typeof r[2+o]=="number"&&(r[2+o]/=c),typeof r[3+o]=="number"&&(r[3+o]/=c),s(r)}};class vG extends v_.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:i,layoutId:r}=this.props,{projection:s}=e;AH(_G),s&&(t.group&&t.group.add(s),i&&i.register&&r&&i.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),wv.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:i,drag:r,isPresent:s}=this.props,o=i.projection;return o&&(o.isPresent=s,r||e.layoutDependency!==t||t===void 0?o.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?o.promote():o.relegate()||Mn.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),queueMicrotask(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:i}=this.props,{projection:r}=e;r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),i&&i.deregister&&i.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function wO(n){const[e,t]=gG(),i=q.useContext(VA);return v_.createElement(vG,{...n,layoutGroup:i,switchLayoutGroup:q.useContext(yk),isPresent:e,safeToRemove:t})}const _G={borderRadius:{..._f,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:_f,borderTopRightRadius:_f,borderBottomLeftRadius:_f,borderBottomRightRadius:_f,boxShadow:yG},EO=["TopLeft","TopRight","BottomLeft","BottomRight"],xG=EO.length,eI=n=>typeof n=="string"?parseFloat(n):n,tI=n=>typeof n=="number"||Ct.test(n);function SG(n,e,t,i,r,s){r?(n.opacity=Vn(0,t.opacity!==void 0?t.opacity:1,wG(i)),n.opacityExit=Vn(e.opacity!==void 0?e.opacity:1,0,EG(i))):s&&(n.opacity=Vn(e.opacity!==void 0?e.opacity:1,t.opacity!==void 0?t.opacity:1,i));for(let o=0;oie?1:t(Xp(n,e,i))}function iI(n,e){n.min=e.min,n.max=e.max}function ms(n,e){iI(n.x,e.x),iI(n.y,e.y)}function rI(n,e,t,i,r){return n-=e,n=p0(n,1/t,i),r!==void 0&&(n=p0(n,1/r,i)),n}function TG(n,e=0,t=1,i=.5,r,s=n,o=n){if(go.test(e)&&(e=parseFloat(e),e=Vn(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=Vn(s.min,s.max,i);n===s&&(a-=e),n.min=rI(n.min,e,t,a,r),n.max=rI(n.max,e,t,a,r)}function sI(n,e,[t,i,r],s,o){TG(n,e[t],e[i],e[r],e.scale,s,o)}const AG=["x","scaleX","originX"],MG=["y","scaleY","originY"];function oI(n,e,t,i){sI(n.x,e,AG,t?t.x:void 0,i?i.x:void 0),sI(n.y,e,MG,t?t.y:void 0,i?i.y:void 0)}function aI(n){return n.translate===0&&n.scale===1}function AO(n){return aI(n.x)&&aI(n.y)}function CG(n,e){return n.x.min===e.x.min&&n.x.max===e.x.max&&n.y.min===e.y.min&&n.y.max===e.y.max}function MO(n,e){return Math.round(n.x.min)===Math.round(e.x.min)&&Math.round(n.x.max)===Math.round(e.x.max)&&Math.round(n.y.min)===Math.round(e.y.min)&&Math.round(n.y.max)===Math.round(e.y.max)}function lI(n){return ts(n.x)/ts(n.y)}class bG{constructor(){this.members=[]}add(e){eM(this.members,e),e.scheduleRender()}remove(e){if(tM(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(e){const t=this.members.findIndex(r=>e===r);if(t===0)return!1;let i;for(let r=t;r>=0;r--){const s=this.members[r];if(s.isPresent!==!1){i=s;break}}return i?(this.promote(i),!0):!1}promote(e,t){const i=this.lead;if(e!==i&&(this.prevLead=i,this.lead=e,e.show(),i)){i.instance&&i.scheduleRender(),e.scheduleRender(),e.resumeFrom=i,t&&(e.resumeFrom.preserveOpacity=!0),i.snapshot&&(e.snapshot=i.snapshot,e.snapshot.latestValues=i.animationValues||i.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:r}=e.options;r===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:t,resumingFrom:i}=e;t.onExitComplete&&t.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function cI(n,e,t){let i="";const r=n.x.translate/e.x,s=n.y.translate/e.y;if((r||s)&&(i=`translate3d(${r}px, ${s}px, 0) `),(e.x!==1||e.y!==1)&&(i+=`scale(${1/e.x}, ${1/e.y}) `),t){const{rotate:l,rotateX:c,rotateY:d}=t;l&&(i+=`rotate(${l}deg) `),c&&(i+=`rotateX(${c}deg) `),d&&(i+=`rotateY(${d}deg) `)}const o=n.x.scale*e.x,a=n.y.scale*e.y;return(o!==1||a!==1)&&(i+=`scale(${o}, ${a})`),i||"none"}const PG=(n,e)=>n.depth-e.depth;class RG{constructor(){this.children=[],this.isDirty=!1}add(e){eM(this.children,e),this.isDirty=!0}remove(e){tM(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(PG),this.isDirty=!1,this.children.forEach(e)}}function IG(n,e){const t=performance.now(),i=({timestamp:r})=>{const s=r-t;s>=e&&(ca(i),n(s-e))};return Mn.read(i,!0),()=>ca(i)}function LG(n){window.MotionDebug&&window.MotionDebug.record(n)}function NG(n){return n instanceof SVGElement&&n.tagName!=="svg"}function DG(n,e,t){const i=Br(n)?n:id(n);return i.start(ZA("",i,e,t)),i.animation}const uI=["","X","Y","Z"],kG={visibility:"hidden"},hI=1e3;let OG=0;const Tc={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function CO({attachResizeListener:n,defaultParent:e,measureScroll:t,checkIsScrollRoot:i,resetTransform:r}){return class{constructor(o={},a=e==null?void 0:e()){this.id=OG++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Tc.totalNodes=Tc.resolvedTargetDeltas=Tc.recalculatedProjection=0,this.nodes.forEach(VG),this.nodes.forEach(WG),this.nodes.forEach(jG),this.nodes.forEach(BG),LG(Tc)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;lthis.root.updateBlockedByResize=!1;n(o,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=IG(p,250),wv.hasAnimatedSinceResize&&(wv.hasAnimatedSinceResize=!1,this.nodes.forEach(fI))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||c)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:p,hasRelativeTargetChanged:m,layout:_})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const S=this.options.transition||d.getDefaultTransition()||KG,{onLayoutAnimationStart:x,onLayoutAnimationComplete:y}=d.getProps(),E=!this.targetLayout||!MO(this.targetLayout,_)||m,w=!p&&m;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||w||p&&(E||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,w);const M={...JA(S,"layout"),onPlay:x,onComplete:y};(d.shouldReduceMotion||this.options.layoutRoot)&&(M.delay=0,M.type=!1),this.startAnimation(M)}else p||fI(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=_})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,ca(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(XG),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;dthis.update()))}clearAllSnapshots(){this.nodes.forEach(zG),this.sharedNodes.forEach(qG)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Mn.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Mn.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{const O=M/1e3;pI(f.x,o.x,O),pI(f.y,o.y,O),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(cp(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),$G(this.relativeTarget,this.relativeTargetOrigin,p,O),w&&CG(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=hi()),ms(w,this.relativeTarget)),S&&(this.animationValues=d,SG(d,c,this.latestValues,O,E,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=O},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(ca(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Mn.update(()=>{wv.hasAnimatedSinceResize=!0,this.currentAnimation=DG(0,hI,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(hI),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:d}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&bO(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||hi();const f=ts(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+f;const p=ts(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+p}ms(a,l),bh(a,d),lp(this.projectionDeltaWithTransform,this.layoutCorrected,a,d)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new bG),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.rotate||l.rotateX||l.rotateY||l.rotateZ)&&(a=!0),!a)return;const c={};for(let d=0;d{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(dI),this.root.sharedNodes.clear()}}}function UG(n){n.updateLayout()}function FG(n){var e;const t=((e=n.resumeFrom)===null||e===void 0?void 0:e.snapshot)||n.snapshot;if(n.isLead()&&n.layout&&t&&n.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:r}=n.layout,{animationType:s}=n.options,o=t.source!==n.layout.source;s==="size"?vs(f=>{const p=o?t.measuredBox[f]:t.layoutBox[f],m=ts(p);p.min=i[f].min,p.max=p.min+m}):bO(s,t.layoutBox,i)&&vs(f=>{const p=o?t.measuredBox[f]:t.layoutBox[f],m=ts(i[f]);p.max=p.min+m,n.relativeTarget&&!n.currentAnimation&&(n.isProjectionDirty=!0,n.relativeTarget[f].max=n.relativeTarget[f].min+m)});const a=Ch();lp(a,i,t.layoutBox);const l=Ch();o?lp(l,n.applyTransform(r,!0),t.measuredBox):lp(l,i,t.layoutBox);const c=!AO(a);let d=!1;if(!n.resumeFrom){const f=n.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:p,layout:m}=f;if(p&&m){const _=hi();cp(_,t.layoutBox,p.layoutBox);const S=hi();cp(S,i,m.layoutBox),MO(_,S)||(d=!0),f.options.layoutRoot&&(n.relativeTarget=S,n.relativeTargetOrigin=_,n.relativeParent=f)}}}n.notifyListeners("didUpdate",{layout:i,snapshot:t,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeTargetChanged:d})}else if(n.isLead()){const{onExitComplete:i}=n.options;i&&i()}n.options.transition=void 0}function VG(n){Tc.totalNodes++,n.parent&&(n.isProjecting()||(n.isProjectionDirty=n.parent.isProjectionDirty),n.isSharedProjectionDirty||(n.isSharedProjectionDirty=!!(n.isProjectionDirty||n.parent.isProjectionDirty||n.parent.isSharedProjectionDirty)),n.isTransformDirty||(n.isTransformDirty=n.parent.isTransformDirty))}function BG(n){n.isProjectionDirty=n.isSharedProjectionDirty=n.isTransformDirty=!1}function zG(n){n.clearSnapshot()}function dI(n){n.clearMeasurements()}function HG(n){n.isLayoutDirty=!1}function GG(n){const{visualElement:e}=n.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),n.resetTransform()}function fI(n){n.finishAnimation(),n.targetDelta=n.relativeTarget=n.target=void 0,n.isProjectionDirty=!0}function WG(n){n.resolveTargetDelta()}function jG(n){n.calcProjection()}function XG(n){n.resetRotation()}function qG(n){n.removeLeadSnapshot()}function pI(n,e,t){n.translate=Vn(e.translate,0,t),n.scale=Vn(e.scale,1,t),n.origin=e.origin,n.originPoint=e.originPoint}function mI(n,e,t,i){n.min=Vn(e.min,t.min,i),n.max=Vn(e.max,t.max,i)}function $G(n,e,t,i){mI(n.x,e.x,t.x,i),mI(n.y,e.y,t.y,i)}function YG(n){return n.animationValues&&n.animationValues.opacityExit!==void 0}const KG={duration:.45,ease:[.4,0,.1,1]},gI=n=>typeof navigator<"u"&&navigator.userAgent.toLowerCase().includes(n),yI=gI("applewebkit/")&&!gI("chrome/")?Math.round:Yn;function vI(n){n.min=yI(n.min),n.max=yI(n.max)}function QG(n){vI(n.x),vI(n.y)}function bO(n,e,t){return n==="position"||n==="preserve-aspect"&&!DE(lI(e),lI(t),.2)}const JG=CO({attachResizeListener:(n,e)=>Yo(n,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),vw={current:void 0},PO=CO({measureScroll:n=>({x:n.scrollLeft,y:n.scrollTop}),defaultParent:()=>{if(!vw.current){const n=new JG({});n.mount(window),n.setOptions({layoutScroll:!0}),vw.current=n}return vw.current},resetTransform:(n,e)=>{n.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:n=>window.getComputedStyle(n).position==="fixed"}),ZG={pan:{Feature:mG},drag:{Feature:pG,ProjectionNode:PO,MeasureLayout:wO}},eW=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function tW(n){const e=eW.exec(n);if(!e)return[,];const[,t,i]=e;return[t,i]}function FE(n,e,t=1){const[i,r]=tW(n);if(!i)return;const s=window.getComputedStyle(e).getPropertyValue(i);if(s){const o=s.trim();return hO(o)?parseFloat(o):o}else return CE(r)?FE(r,e,t+1):r}function nW(n,{...e},t){const i=n.current;if(!(i instanceof Element))return{target:e,transitionEnd:t};t&&(t={...t}),n.values.forEach(r=>{const s=r.get();if(!CE(s))return;const o=FE(s,i);o&&r.set(o)});for(const r in e){const s=e[r];if(!CE(s))continue;const o=FE(s,i);o&&(e[r]=o,t||(t={}),t[r]===void 0&&(t[r]=s))}return{target:e,transitionEnd:t}}const iW=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),RO=n=>iW.has(n),rW=n=>Object.keys(n).some(RO),_I=n=>n===gu||n===Ct,xI=(n,e)=>parseFloat(n.split(", ")[e]),SI=(n,e)=>(t,{transform:i})=>{if(i==="none"||!i)return 0;const r=i.match(/^matrix3d\((.+)\)$/);if(r)return xI(r[1],e);{const s=i.match(/^matrix\((.+)\)$/);return s?xI(s[1],n):0}},sW=new Set(["x","y","z"]),oW=bm.filter(n=>!sW.has(n));function aW(n){const e=[];return oW.forEach(t=>{const i=n.getValue(t);i!==void 0&&(e.push([t,i.get()]),i.set(t.startsWith("scale")?1:0))}),e.length&&n.render(),e}const rd={width:({x:n},{paddingLeft:e="0",paddingRight:t="0"})=>n.max-n.min-parseFloat(e)-parseFloat(t),height:({y:n},{paddingTop:e="0",paddingBottom:t="0"})=>n.max-n.min-parseFloat(e)-parseFloat(t),top:(n,{top:e})=>parseFloat(e),left:(n,{left:e})=>parseFloat(e),bottom:({y:n},{top:e})=>parseFloat(e)+(n.max-n.min),right:({x:n},{left:e})=>parseFloat(e)+(n.max-n.min),x:SI(4,13),y:SI(5,14)};rd.translateX=rd.x;rd.translateY=rd.y;const lW=(n,e,t)=>{const i=e.measureViewportBox(),r=e.current,s=getComputedStyle(r),{display:o}=s,a={};o==="none"&&e.setStaticValue("display",n.display||"block"),t.forEach(c=>{a[c]=rd[c](i,s)}),e.render();const l=e.measureViewportBox();return t.forEach(c=>{const d=e.getValue(c);d&&d.jump(a[c]),n[c]=rd[c](l,s)}),n},cW=(n,e,t={},i={})=>{e={...e},i={...i};const r=Object.keys(e).filter(RO);let s=[],o=!1;const a=[];if(r.forEach(l=>{const c=n.getValue(l);if(!n.hasValue(l))return;let d=t[l],f=vf(d);const p=e[l];let m;if(c0(p)){const _=p.length,S=p[0]===null?1:0;d=p[S],f=vf(d);for(let x=S;x<_&&p[x]!==null;x++)m?qA(vf(p[x])===m):m=vf(p[x])}else m=vf(p);if(f!==m)if(_I(f)&&_I(m)){const _=c.get();typeof _=="string"&&c.set(parseFloat(_)),typeof p=="string"?e[l]=parseFloat(p):Array.isArray(p)&&m===Ct&&(e[l]=p.map(parseFloat))}else f!=null&&f.transform&&(m!=null&&m.transform)&&(d===0||p===0)?d===0?c.set(m.transform(d)):e[l]=f.transform(p):(o||(s=aW(n),o=!0),a.push(l),i[l]=i[l]!==void 0?i[l]:e[l],c.jump(p))}),a.length){const l=a.indexOf("height")>=0?window.pageYOffset:null,c=lW(e,n,a);return s.length&&s.forEach(([d,f])=>{n.getValue(d).set(f)}),n.render(),U_&&l!==null&&window.scrollTo({top:l}),{target:c,transitionEnd:i}}else return{target:e,transitionEnd:i}};function uW(n,e,t,i){return rW(e)?cW(n,e,t,i):{target:e,transitionEnd:i}}const hW=(n,e,t,i)=>{const r=nW(n,e,i);return e=r.target,i=r.transitionEnd,uW(n,e,t,i)},VE={current:null},IO={current:!1};function dW(){if(IO.current=!0,!!U_)if(window.matchMedia){const n=window.matchMedia("(prefers-reduced-motion)"),e=()=>VE.current=n.matches;n.addListener(e),e()}else VE.current=!1}function fW(n,e,t){const{willChange:i}=e;for(const r in e){const s=e[r],o=t[r];if(Br(s))n.addValue(r,s),f0(i)&&i.add(r);else if(Br(o))n.addValue(r,id(s,{owner:n})),f0(i)&&i.remove(r);else if(o!==s)if(n.hasValue(r)){const a=n.getValue(r);!a.hasAnimated&&a.set(s)}else{const a=n.getStaticValue(r);n.addValue(r,id(a!==void 0?a:s,{owner:n}))}}for(const r in t)e[r]===void 0&&n.removeValue(r);return e}const wI=new WeakMap,LO=Object.keys(jp),pW=LO.length,EI=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],mW=FA.length;class gW{constructor({parent:e,props:t,presenceContext:i,reducedMotionConfig:r,visualState:s},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>Mn.render(this.render,!1,!0);const{latestValues:a,renderState:l}=s;this.latestValues=a,this.baseTarget={...a},this.initialValues=t.initial?{...a}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=i,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.options=o,this.isControllingVariants=V_(t),this.isVariantNode=gk(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:c,...d}=this.scrapeMotionValuesFromProps(t,{});for(const f in d){const p=d[f];a[f]!==void 0&&Br(p)&&(p.set(a[f],!1),f0(c)&&c.add(f))}}scrapeMotionValuesFromProps(e,t){return{}}mount(e){this.current=e,wI.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,i)=>this.bindToMotionValue(i,t)),IO.current||dW(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:VE.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){wI.delete(this.current),this.projection&&this.projection.unmount(),ca(this.notifyUpdate),ca(this.render),this.valueSubscriptions.forEach(e=>e()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features)this.features[e].unmount();this.current=null}bindToMotionValue(e,t){const i=mu.has(e),r=t.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&Mn.update(this.notifyUpdate,!1,!0),i&&this.projection&&(this.projection.isTransformDirty=!0)}),s=t.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(e,()=>{r(),s()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}loadFeatures({children:e,...t},i,r,s){let o,a;for(let l=0;lthis.scheduleRender(),animationType:typeof c=="string"?c:"both",initialPromotionConfig:s,layoutScroll:p,layoutRoot:m})}return a}updateFeatures(){for(const e in this.features){const t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):hi()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}makeTargetAnimatable(e,t=!0){return this.makeTargetAnimatableFromInstance(e,this.props,t)}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let i=0;it.variantChildren.delete(e)}addValue(e,t){t!==this.values.get(e)&&(this.removeValue(e),this.bindToMotionValue(e,t)),this.values.set(e,t),this.latestValues[e]=t.get()}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let i=this.values.get(e);return i===void 0&&t!==void 0&&(i=id(t,{owner:this}),this.addValue(e,i)),i}readValue(e){var t;return this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:(t=this.getBaseTargetFromProps(this.props,e))!==null&&t!==void 0?t:this.readValueFromInstance(this.current,e,this.options)}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;const{initial:i}=this.props,r=typeof i=="string"||typeof i=="object"?(t=XA(this.props,i))===null||t===void 0?void 0:t[e]:void 0;if(i&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!Br(s)?s:this.initialValues[e]!==void 0&&r===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new nM),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class NO extends gW{sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:i}){delete t[e],delete i[e]}makeTargetAnimatableFromInstance({transition:e,transitionEnd:t,...i},{transformValues:r},s){let o=N8(i,e||{},this);if(r&&(t&&(t=r(t)),i&&(i=r(i)),o&&(o=r(o))),s){I8(this,i,o);const a=hW(this,i,o,t);t=a.transitionEnd,i=a.target}return{transition:e,transitionEnd:t,...i}}}function yW(n){return window.getComputedStyle(n)}class vW extends NO{constructor(){super(...arguments),this.type="html"}readValueFromInstance(e,t){if(mu.has(t)){const i=QA(t);return i&&i.default||0}else{const i=yW(e),r=(xk(t)?i.getPropertyValue(t):i[t])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return xO(e,t)}build(e,t,i,r){zA(e,t,i,r.transformTemplate)}scrapeMotionValuesFromProps(e,t){return jA(e,t)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Br(e)&&(this.childSubscription=e.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}renderInstance(e,t,i,r){Mk(e,t,i,r)}}class _W extends NO{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(mu.has(t)){const i=QA(t);return i&&i.default||0}return t=Ck.has(t)?t:OA(t),e.getAttribute(t)}measureInstanceViewportBox(){return hi()}scrapeMotionValuesFromProps(e,t){return Pk(e,t)}build(e,t,i,r){GA(e,t,i,this.isSVGTag,r.transformTemplate)}renderInstance(e,t,i,r){bk(e,t,i,r)}mount(e){this.isSVGTag=WA(e.tagName),super.mount(e)}}const xW=(n,e)=>BA(n)?new _W(e,{enableHardwareAcceleration:!1}):new vW(e,{enableHardwareAcceleration:!0}),SW={layout:{ProjectionNode:PO,MeasureLayout:wO}},wW={...$8,...p9,...ZG,...SW},er=EH((n,e)=>t9(n,e,wW,xW));function DO(){const n=q.useRef(!1);return kA(()=>(n.current=!0,()=>{n.current=!1}),[]),n}function EW(){const n=DO(),[e,t]=q.useState(0),i=q.useCallback(()=>{n.current&&t(e+1)},[e]);return[q.useCallback(()=>Mn.postRender(i),[i]),e]}class TW extends q.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){const i=this.props.sizeRef.current;i.height=t.offsetHeight||0,i.width=t.offsetWidth||0,i.top=t.offsetTop,i.left=t.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function AW({children:n,isPresent:e}){const t=q.useId(),i=q.useRef(null),r=q.useRef({width:0,height:0,top:0,left:0});return q.useInsertionEffect(()=>{const{width:s,height:o,top:a,left:l}=r.current;if(e||!i.current||!s||!o)return;i.current.dataset.motionPopId=t;const c=document.createElement("style");return document.head.appendChild(c),c.sheet&&c.sheet.insertRule(` [data-motion-pop-id="${t}"] { position: absolute !important; width: ${s}px !important; @@ -72,14 +72,14 @@ Error generating stack: `+s.message+` top: ${a}px !important; left: ${l}px !important; } - `),()=>{document.head.removeChild(c)}},[e]),q.createElement(EW,{isPresent:e,childRef:i,sizeRef:r},q.cloneElement(n,{ref:i}))}const _w=({children:n,initial:e,isPresent:t,onExitComplete:i,custom:r,presenceAffectsLayout:s,mode:o})=>{const a=Rk(AW),l=q.useId(),c=q.useMemo(()=>({id:l,initial:e,isPresent:t,custom:r,onExitComplete:d=>{a.set(d,!0);for(const f of a.values())if(!f)return;i&&i()},register:d=>(a.set(d,!1),()=>a.delete(d))}),s?void 0:[t]);return q.useMemo(()=>{a.forEach((d,f)=>a.set(f,!1))},[t]),q.useEffect(()=>{!t&&!a.size&&i&&i()},[t]),o==="popLayout"&&(n=q.createElement(TW,{isPresent:t},n)),q.createElement(O_.Provider,{value:c},n)};function AW(){return new Map}function MW(n){return q.useEffect(()=>()=>n(),[])}const Ac=n=>n.key||"";function CW(n,e){n.forEach(t=>{const i=Ac(t);e.set(i,t)})}function bW(n){const e=[];return q.Children.forEach(n,t=>{q.isValidElement(t)&&e.push(t)}),e}const TI=({children:n,custom:e,initial:t=!0,onExitComplete:i,exitBeforeEnter:r,presenceAffectsLayout:s=!0,mode:o="sync"})=>{const a=q.useContext(VA).forceRender||wW()[0],l=DO(),c=bW(n);let d=c;const f=q.useRef(new Map).current,p=q.useRef(d),m=q.useRef(new Map).current,_=q.useRef(!0);if(kA(()=>{_.current=!1,CW(c,m),p.current=d}),MW(()=>{_.current=!0,m.clear(),f.clear()}),_.current)return q.createElement(q.Fragment,null,d.map(E=>q.createElement(_w,{key:Ac(E),isPresent:!0,initial:t?void 0:!1,presenceAffectsLayout:s,mode:o},E)));d=[...d];const S=p.current.map(Ac),x=c.map(Ac),y=S.length;for(let E=0;E{if(x.indexOf(w)!==-1)return;const M=m.get(w);if(!M)return;const O=S.indexOf(w);let k=E;if(!k){const I=()=>{f.delete(w);const P=Array.from(m.keys()).filter(D=>!x.includes(D));if(P.forEach(D=>m.delete(D)),p.current=c.filter(D=>{const A=Ac(D);return A===w||P.includes(A)}),!f.size){if(l.current===!1)return;a(),i&&i()}};k=q.createElement(_w,{key:Ac(M),isPresent:!1,onExitComplete:I,custom:e,presenceAffectsLayout:s,mode:o},M),f.set(w,k)}d.splice(O,0,k)}),d=d.map(E=>{const w=E.key;return f.has(w)?E:q.createElement(_w,{key:Ac(E),isPresent:!0,presenceAffectsLayout:s,mode:o},E)}),q.createElement(q.Fragment,null,f.size?d:d.map(E=>q.cloneElement(E)))},sr={paddingX:"sm:px-16 px-6",paddingY:"sm:py-16 py-6",padding:"sm:px-16 px-6 sm:py-16 py-10",heroHeadText:"font-black text-[#373737] lg:text-[80px] sm:text-[60px] xs:text-[50px] text-[40px] lg:leading-[98px] mt-2",heroSubText:"text-[#dfd9ff] font-medium lg:text-[30px] sm:text-[26px] xs:text-[20px] text-[16px] lg:leading-[40px]",sectionHeadText:"text-black font-black md:text-[60px] sm:text-[50px] xs:text-[40px] text-[30px]",sectionSubText:"sm:text-[18px] text-[14px] text-secondary uppercase tracking-wider"},PW="/portfolio-react-threejs/assets/web-0c6824d5.webp",RW="/portfolio-react-threejs/assets/mobile-84df6906.webp",IW="/portfolio-react-threejs/assets/creator-ab86683b.webp",AI=[{id:"HeroSection",title:"Home",type:"route"},{id:"AboutSection",title:"About",type:"route"},{id:"ExperienceSection",title:"Experience",type:"route"},{id:"TechSkillsSection",title:"Skills",type:"route"},{id:"ResumeSection",title:"Resume",type:"route"},{id:"ProjectsSection",title:"Projects",type:"route"},{id:"BlogsSections",title:"Blogs",type:"route"},{id:"ContactSection",title:"Contact",type:"route"},{id:"freetools",title:"Free Tools",type:"tools"}],LW=[{id:"DownloadTube",title:"DownloadTube (Youtube Downloader)",type:"video",url:"https://downloadtube-iota.vercel.app/"}],NW=[{title:"Full Stack Web Development",icon:PW},{title:"Designing",icon:IW},{title:"ML and DL Learner",icon:RW}],DW="/portfolio-react-threejs/assets/logo-white-f51edd31.webp",kW="/portfolio-react-threejs/assets/bars-solid-dd6e31d5.svg",OW="/portfolio-react-threejs/assets/circle-xmark-regular-11645b29.svg",Lm=n=>({hidden:{y:-50,opacity:0},show:{y:0,opacity:1,transition:{type:"spring",duration:1.25,delay:n}}}),Ed=(n,e,t,i)=>({hidden:{x:n==="left"?100:n==="right"?-100:0,y:n==="up"?100:n==="down"?-100:0,opacity:0},show:{x:0,y:0,opacity:1,transition:{type:e,delay:t,duration:i,ease:"easeOut"}}}),UW=(n,e)=>({hidden:{},show:{transition:{staggerChildren:n,delayChildren:e||0}}}),FW=()=>{const[n,e]=q.useState(""),[t,i]=q.useState(!1),[r,s]=q.useState(!1);return B.jsx(er.nav,{className:`${sr.paddingX} w-full flex items-center py-5 fixed top-0 z-20 bg-black`,children:B.jsxs("div",{className:"w-full flex justify-between items-center max-w-7xl mx-auto",children:[B.jsxs("a",{href:"",className:"flex items-center gap-2",onClick:()=>{e(""),window.scrollTo(0,0)},children:[B.jsx("img",{src:DW,className:"w-10 h-10 object-contain",alt:"logo"}),B.jsxs("div",{className:"text-primary text-[18px] md:block lg:flex ",children:[B.jsx("p",{className:"flex",children:"Satyam Mishra  "}),B.jsx("span",{className:"sm:block hidden",children:"| Bedead"})]})]}),B.jsxs("ul",{className:"list-none hidden sm:flex flex-row md:gap-4 items-center",children:[AI.map(o=>B.jsx("li",{className:o.type=="tools"?"bg-secondary text-gray-400 hover:text-primary py-2 px-3 rounded-xl text-[18px] font-medium cursor-pointer":`${n==o.title?"text-primary":"text-gray-400"} + `),()=>{document.head.removeChild(c)}},[e]),q.createElement(TW,{isPresent:e,childRef:i,sizeRef:r},q.cloneElement(n,{ref:i}))}const _w=({children:n,initial:e,isPresent:t,onExitComplete:i,custom:r,presenceAffectsLayout:s,mode:o})=>{const a=Rk(MW),l=q.useId(),c=q.useMemo(()=>({id:l,initial:e,isPresent:t,custom:r,onExitComplete:d=>{a.set(d,!0);for(const f of a.values())if(!f)return;i&&i()},register:d=>(a.set(d,!1),()=>a.delete(d))}),s?void 0:[t]);return q.useMemo(()=>{a.forEach((d,f)=>a.set(f,!1))},[t]),q.useEffect(()=>{!t&&!a.size&&i&&i()},[t]),o==="popLayout"&&(n=q.createElement(AW,{isPresent:t},n)),q.createElement(O_.Provider,{value:c},n)};function MW(){return new Map}function CW(n){return q.useEffect(()=>()=>n(),[])}const Ac=n=>n.key||"";function bW(n,e){n.forEach(t=>{const i=Ac(t);e.set(i,t)})}function PW(n){const e=[];return q.Children.forEach(n,t=>{q.isValidElement(t)&&e.push(t)}),e}const TI=({children:n,custom:e,initial:t=!0,onExitComplete:i,exitBeforeEnter:r,presenceAffectsLayout:s=!0,mode:o="sync"})=>{const a=q.useContext(VA).forceRender||EW()[0],l=DO(),c=PW(n);let d=c;const f=q.useRef(new Map).current,p=q.useRef(d),m=q.useRef(new Map).current,_=q.useRef(!0);if(kA(()=>{_.current=!1,bW(c,m),p.current=d}),CW(()=>{_.current=!0,m.clear(),f.clear()}),_.current)return q.createElement(q.Fragment,null,d.map(E=>q.createElement(_w,{key:Ac(E),isPresent:!0,initial:t?void 0:!1,presenceAffectsLayout:s,mode:o},E)));d=[...d];const S=p.current.map(Ac),x=c.map(Ac),y=S.length;for(let E=0;E{if(x.indexOf(w)!==-1)return;const M=m.get(w);if(!M)return;const O=S.indexOf(w);let k=E;if(!k){const I=()=>{f.delete(w);const P=Array.from(m.keys()).filter(D=>!x.includes(D));if(P.forEach(D=>m.delete(D)),p.current=c.filter(D=>{const A=Ac(D);return A===w||P.includes(A)}),!f.size){if(l.current===!1)return;a(),i&&i()}};k=q.createElement(_w,{key:Ac(M),isPresent:!1,onExitComplete:I,custom:e,presenceAffectsLayout:s,mode:o},M),f.set(w,k)}d.splice(O,0,k)}),d=d.map(E=>{const w=E.key;return f.has(w)?E:q.createElement(_w,{key:Ac(E),isPresent:!0,presenceAffectsLayout:s,mode:o},E)}),q.createElement(q.Fragment,null,f.size?d:d.map(E=>q.cloneElement(E)))},sr={paddingX:"sm:px-16 px-6",paddingY:"sm:py-16 py-6",padding:"sm:px-16 px-6 sm:py-16 py-10",heroHeadText:"font-black text-[#373737] lg:text-[80px] sm:text-[60px] xs:text-[50px] text-[40px] lg:leading-[98px] mt-2",heroSubText:"text-[#dfd9ff] font-medium lg:text-[30px] sm:text-[26px] xs:text-[20px] text-[16px] lg:leading-[40px]",sectionHeadText:"text-black font-black md:text-[60px] sm:text-[50px] xs:text-[40px] text-[30px]",sectionSubText:"sm:text-[18px] text-[14px] text-secondary uppercase tracking-wider"},RW="/assets/web-0c6824d5.webp",IW="/assets/mobile-84df6906.webp",LW="/assets/creator-ab86683b.webp",AI=[{id:"HeroSection",title:"Home",type:"route"},{id:"AboutSection",title:"About",type:"route"},{id:"ExperienceSection",title:"Experience",type:"route"},{id:"TechSkillsSection",title:"Skills",type:"route"},{id:"ResumeSection",title:"Resume",type:"route"},{id:"ProjectsSection",title:"Projects",type:"route"},{id:"BlogsSections",title:"Blogs",type:"route"},{id:"ContactSection",title:"Contact",type:"route"},{id:"freetools",title:"Free Tools",type:"tools"}],NW=[{id:"DownloadTube",title:"DownloadTube (Youtube Downloader)",type:"video",url:"https://downloadtube-iota.vercel.app/"}],DW=[{title:"Full Stack Web Development",icon:RW},{title:"Designing",icon:LW},{title:"ML and DL Learner",icon:IW}],kW="/assets/logo-white-f51edd31.webp",OW="/assets/bars-solid-dd6e31d5.svg",UW="/assets/circle-xmark-regular-11645b29.svg",Lm=n=>({hidden:{y:-50,opacity:0},show:{y:0,opacity:1,transition:{type:"spring",duration:1.25,delay:n}}}),Ed=(n,e,t,i)=>({hidden:{x:n==="left"?100:n==="right"?-100:0,y:n==="up"?100:n==="down"?-100:0,opacity:0},show:{x:0,y:0,opacity:1,transition:{type:e,delay:t,duration:i,ease:"easeOut"}}}),FW=(n,e)=>({hidden:{},show:{transition:{staggerChildren:n,delayChildren:e||0}}}),kO=()=>{const[n,e]=q.useState(""),[t,i]=q.useState(!1),[r,s]=q.useState(!1);return B.jsx(er.nav,{className:`${sr.paddingX} w-full flex items-center py-5 fixed top-0 z-20 bg-black`,children:B.jsxs("div",{className:"w-full flex justify-between items-center max-w-7xl mx-auto",children:[B.jsxs("a",{href:"",className:"flex items-center gap-2",onClick:()=>{e(""),window.scrollTo(0,0)},children:[B.jsx("img",{src:kW,className:"w-10 h-10 object-contain",alt:"logo"}),B.jsxs("div",{className:"text-primary text-[18px] md:block lg:flex ",children:[B.jsx("p",{className:"flex",children:"Satyam Mishra  "}),B.jsx("span",{className:"sm:block hidden",children:"| Bedead"})]})]}),B.jsxs("ul",{className:"list-none hidden sm:flex flex-row md:gap-4 items-center",children:[AI.map(o=>B.jsx("li",{className:o.type=="tools"?"bg-secondary text-gray-400 hover:text-primary py-2 px-3 rounded-xl text-[18px] font-medium cursor-pointer":`${n==o.title?"text-primary":"text-gray-400"} hover:text-primary underline-offset-8 text-[18px] font-medium cursor-pointer`,onClick:()=>{e(o.title),o.type=="tools"&&s(!r)},children:o.type=="tools"?o.title:B.jsxs("a",{href:` #${o.id}`,children:[o.title," "]})},o.id))," "]}),B.jsx(TI,{children:r&&B.jsx(er.div,{className:`${r?"flex":"hidden"} p-6 bg-primary absolute - top-60 right-40 sm:top-20 sm:right-5 mx-4 my-2 min-w-[140px] z-10 rounded-xl outline`,initial:{scale:.1,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.1,opacity:0},transition:{type:"spring",damping:10},children:B.jsxs("ul",{className:"list-none flex justify-end items-start flex-col gap-2",children:[LW.map(o=>B.jsx(er.li,{variants:Ed("right","spring",.1,.75),className:`${n==o.title?"text-black underline":"text-secondary"} font-poppins hover:underline underline-offset-8 font-medium cursor-pointer text-[16px] hover:text-secondary`,onClick:()=>{o.type=="tools"&&s(!r),e(o.title),window.open(o.url,"_blank")},children:o.type=="tools"?o.title:B.jsxs("a",{to:`#${o.id}`,children:[o.id," "]})},o.id))," "]})})}),B.jsxs("div",{className:"sm:hidden flex flex-1 justify-end items-center",children:[B.jsx("img",{src:t?OW:kW,alt:"menu",className:"w-[28px] h-[28px] object-contain cursor-pointer",onClick:()=>{i(!t),r==!0&&s(!1)}}),B.jsx(TI,{children:t&&B.jsx(er.div,{className:`${t?"flex":"hidden"} p-6 bg-gradient-to-r from-[#f6f6f6] to-white absolute - top-20 right-0 mx-4 my-2 min-w-[140px] z-10 rounded-xl outline`,initial:{scale:.1,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.1,opacity:0},transition:{type:"spring",damping:10},children:B.jsxs("ul",{className:"list-none flex justify-end items-start flex-col gap-2",children:[AI.map(o=>B.jsx("li",{className:`${n==o.title?"text-black underline":"text-secondary"} font-poppins hover:underline underline-offset-8 font-medium cursor-pointer text-[16px] hover:text-secondary`,onClick:()=>{o.type!="tools"&&i(!t),e(o.title),o.type=="tools"&&s(!r)},children:o.type=="tools"?o.title:B.jsxs("a",{href:`#${o.id}`,children:[o.title," "]})},o.id))," "]})})})]})]})})},VW=()=>B.jsxs("div",{children:[location.pathname==="/"&&B.jsx(FW,{}),B.jsx(dk,{})]});var BW=Object.defineProperty,zW=Object.defineProperties,HW=Object.getOwnPropertyDescriptors,MI=Object.getOwnPropertySymbols,GW=Object.prototype.hasOwnProperty,WW=Object.prototype.propertyIsEnumerable,CI=(n,e,t)=>e in n?BW(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,xf=(n,e)=>{for(var t in e||(e={}))GW.call(e,t)&&CI(n,t,e[t]);if(MI)for(var t of MI(e))WW.call(e,t)&&CI(n,t,e[t]);return n},Sf=(n,e)=>zW(n,HW(e)),G_=class extends q.Component{constructor(n){super(n),this.ref=v_.createRef(),this.state={style:{}};const e={reverse:!1,max:35,perspective:1e3,easing:"cubic-bezier(.03,.98,.52,.99)",scale:"1.1",speed:"1000",transition:!0,axis:null,reset:!0};this.width=null,this.height=null,this.left=null,this.top=null,this.transitionTimeout=null,this.updateCall=null,this.element=null,this.settings=Object.assign({},e,this.props.options),this.reverse=this.settings.reverse?-1:1,this.onMouseEnter=this.onMouseEnter.bind(this,this.props.onMouseEnter),this.onMouseMove=this.onMouseMove.bind(this,this.props.onMouseMove),this.onMouseLeave=this.onMouseLeave.bind(this,this.props.onMouseLeave)}componentDidMount(){this.element=this.ref.current,setTimeout(()=>{this.element.parentElement.querySelector(":hover")===this.element&&this.onMouseEnter()},0)}componentWillUnmount(){clearTimeout(this.transitionTimeout),cancelAnimationFrame(this.updateCall)}onMouseEnter(n=()=>{},e){return this.updateElementPosition(),this.setState(Object.assign({},this.state,{style:Sf(xf({},this.state.style),{willChange:"transform"})})),this.setTransition(),n(e)}reset(){window.requestAnimationFrame(()=>{this.setState(Object.assign({},this.state,{style:Sf(xf({},this.state.style),{transform:`perspective(${this.settings.perspective}px) rotateX(0deg) rotateY(0deg) scale3d(1, 1, 1)`})}))})}onMouseMove(n=()=>{},e){return e.persist(),this.updateCall!==null&&window.cancelAnimationFrame(this.updateCall),this.event=e,this.updateCall=requestAnimationFrame(this.update.bind(this,e)),n(e)}setTransition(){clearTimeout(this.transitionTimeout),this.setState(Object.assign({},this.state,{style:Sf(xf({},this.state.style),{transition:`${this.settings.speed}ms ${this.settings.easing}`})})),this.transitionTimeout=setTimeout(()=>{this.setState(Object.assign({},this.state,{style:Sf(xf({},this.state.style),{transition:""})}))},this.settings.speed)}onMouseLeave(n=()=>{},e){return this.setTransition(),this.settings.reset&&this.reset(),n(e)}getValues(n){const e=(n.nativeEvent.clientX-this.left)/this.width,t=(n.nativeEvent.clientY-this.top)/this.height,i=Math.min(Math.max(e,0),1),r=Math.min(Math.max(t,0),1),s=(this.reverse*(this.settings.max/2-i*this.settings.max)).toFixed(2),o=(this.reverse*(r*this.settings.max-this.settings.max/2)).toFixed(2),a=i*100,l=r*100;return{tiltX:s,tiltY:o,percentageX:a,percentageY:l}}updateElementPosition(){const n=this.element.getBoundingClientRect();this.width=this.element.offsetWidth,this.height=this.element.offsetHeight,this.left=n.left,this.top=n.top}update(n){const e=this.getValues(n);this.setState(Object.assign({},this.state,{style:Sf(xf({},this.state.style),{transform:`perspective(${this.settings.perspective}px) rotateX(${this.settings.axis==="x"?0:e.tiltY}deg) rotateY(${this.settings.axis==="y"?0:e.tiltX}deg) scale3d(${this.settings.scale}, ${this.settings.scale}, ${this.settings.scale})`})})),this.updateCall=null}render(){const n=Object.assign({},this.props.style,this.state.style);return B.jsx("div",{style:n,ref:this.ref,className:this.props.className,onMouseEnter:this.onMouseEnter,onMouseMove:this.onMouseMove,onMouseLeave:this.onMouseLeave,children:this.props.children})}};const Td=(n,e)=>function(){return B.jsxs(er.section,{variants:UW(),initial:"hidden",whileInView:"show",viewport:{once:!0,amount:0},exit:"hidden",className:`${sr.padding} max-w-7xl mx-auto relative z-0`,children:[B.jsx("span",{className:"hash-span",id:e,children:" "}),B.jsx(n,{})]})},jW=({index:n,title:e,icon:t})=>B.jsx(G_,{className:"xs:w-[250px] w-full",children:B.jsx(er.div,{variants:Ed("right","spring",.5*n,.75),className:"w-full green-pink-gradient p-[1px] rounded-[20px] shadow-[#fcd4d4] shadow-card",children:B.jsxs("div",{options:{max:45,scale:1,speed:450},className:"bg-primary rounded-[20px] py-5 px-12 min-h-[280px] flex justify-evenly items-center flex-col",children:[B.jsx("img",{src:t,alt:e,className:"w-16 h-16 object-contain"}),B.jsx("h3",{className:"text-black text-[20px] font-bold text-center",children:e})]})})}),XW=()=>B.jsxs("section",{children:[B.jsxs(er.div,{variants:Lm(0),children:[B.jsx("h2",{className:`${sr.sectionHeadText} text-center`,children:"Overview."}),B.jsxs(er.p,{variants:Ed("","",.1,1),className:`${sr.sectionSubText} text-center`,children:["Introduction? Nahh",B.jsx("br",{}),"I do this 👇"]})]}),B.jsx("div",{className:"mt-20 flex flex-wrap justify-center gap-10",children:NW.map((n,e)=>B.jsx(jW,{index:e,...n},n.title))})]}),qW=Td(XW,"AboutSection");var W_={},kO={exports:{}},$W="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",YW=$W,KW=YW;function OO(){}function UO(){}UO.resetWarningCache=OO;var QW=function(){function n(i,r,s,o,a,l){if(l!==KW){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}n.isRequired=n;function e(){return n}var t={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:e,element:n,elementType:n,instanceOf:e,node:n,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:UO,resetWarningCache:OO};return t.PropTypes=t,t};kO.exports=QW();var FO=kO.exports,VO={exports:{}};/*! + top-60 right-40 sm:top-20 sm:right-5 mx-4 my-2 min-w-[140px] z-10 rounded-xl outline`,initial:{scale:.1,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.1,opacity:0},transition:{type:"spring",damping:10},children:B.jsxs("ul",{className:"list-none flex justify-end items-start flex-col gap-2",children:[NW.map(o=>B.jsx(er.li,{variants:Ed("right","spring",.1,.75),className:`${n==o.title?"text-black underline":"text-secondary"} font-poppins hover:underline underline-offset-8 font-medium cursor-pointer text-[16px] hover:text-secondary`,onClick:()=>{o.type=="tools"&&s(!r),e(o.title),window.open(o.url,"_blank")},children:o.type=="tools"?o.title:B.jsxs("a",{to:`#${o.id}`,children:[o.id," "]})},o.id))," "]})})}),B.jsxs("div",{className:"sm:hidden flex flex-1 justify-end items-center",children:[B.jsx("img",{src:t?UW:OW,alt:"menu",className:"w-[28px] h-[28px] object-contain cursor-pointer",onClick:()=>{i(!t),r==!0&&s(!1)}}),B.jsx(TI,{children:t&&B.jsx(er.div,{className:`${t?"flex":"hidden"} p-6 bg-gradient-to-r from-[#f6f6f6] to-white absolute + top-20 right-0 mx-4 my-2 min-w-[140px] z-10 rounded-xl outline`,initial:{scale:.1,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.1,opacity:0},transition:{type:"spring",damping:10},children:B.jsxs("ul",{className:"list-none flex justify-end items-start flex-col gap-2",children:[AI.map(o=>B.jsx("li",{className:`${n==o.title?"text-black underline":"text-secondary"} font-poppins hover:underline underline-offset-8 font-medium cursor-pointer text-[16px] hover:text-secondary`,onClick:()=>{o.type!="tools"&&i(!t),e(o.title),o.type=="tools"&&s(!r)},children:o.type=="tools"?o.title:B.jsxs("a",{href:`#${o.id}`,children:[o.title," "]})},o.id))," "]})})})]})]})})},VW=()=>B.jsxs("div",{children:[location.pathname==="/"&&B.jsx(kO,{}),B.jsx(dk,{})]});var BW=Object.defineProperty,zW=Object.defineProperties,HW=Object.getOwnPropertyDescriptors,MI=Object.getOwnPropertySymbols,GW=Object.prototype.hasOwnProperty,WW=Object.prototype.propertyIsEnumerable,CI=(n,e,t)=>e in n?BW(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,xf=(n,e)=>{for(var t in e||(e={}))GW.call(e,t)&&CI(n,t,e[t]);if(MI)for(var t of MI(e))WW.call(e,t)&&CI(n,t,e[t]);return n},Sf=(n,e)=>zW(n,HW(e)),G_=class extends q.Component{constructor(n){super(n),this.ref=v_.createRef(),this.state={style:{}};const e={reverse:!1,max:35,perspective:1e3,easing:"cubic-bezier(.03,.98,.52,.99)",scale:"1.1",speed:"1000",transition:!0,axis:null,reset:!0};this.width=null,this.height=null,this.left=null,this.top=null,this.transitionTimeout=null,this.updateCall=null,this.element=null,this.settings=Object.assign({},e,this.props.options),this.reverse=this.settings.reverse?-1:1,this.onMouseEnter=this.onMouseEnter.bind(this,this.props.onMouseEnter),this.onMouseMove=this.onMouseMove.bind(this,this.props.onMouseMove),this.onMouseLeave=this.onMouseLeave.bind(this,this.props.onMouseLeave)}componentDidMount(){this.element=this.ref.current,setTimeout(()=>{this.element.parentElement.querySelector(":hover")===this.element&&this.onMouseEnter()},0)}componentWillUnmount(){clearTimeout(this.transitionTimeout),cancelAnimationFrame(this.updateCall)}onMouseEnter(n=()=>{},e){return this.updateElementPosition(),this.setState(Object.assign({},this.state,{style:Sf(xf({},this.state.style),{willChange:"transform"})})),this.setTransition(),n(e)}reset(){window.requestAnimationFrame(()=>{this.setState(Object.assign({},this.state,{style:Sf(xf({},this.state.style),{transform:`perspective(${this.settings.perspective}px) rotateX(0deg) rotateY(0deg) scale3d(1, 1, 1)`})}))})}onMouseMove(n=()=>{},e){return e.persist(),this.updateCall!==null&&window.cancelAnimationFrame(this.updateCall),this.event=e,this.updateCall=requestAnimationFrame(this.update.bind(this,e)),n(e)}setTransition(){clearTimeout(this.transitionTimeout),this.setState(Object.assign({},this.state,{style:Sf(xf({},this.state.style),{transition:`${this.settings.speed}ms ${this.settings.easing}`})})),this.transitionTimeout=setTimeout(()=>{this.setState(Object.assign({},this.state,{style:Sf(xf({},this.state.style),{transition:""})}))},this.settings.speed)}onMouseLeave(n=()=>{},e){return this.setTransition(),this.settings.reset&&this.reset(),n(e)}getValues(n){const e=(n.nativeEvent.clientX-this.left)/this.width,t=(n.nativeEvent.clientY-this.top)/this.height,i=Math.min(Math.max(e,0),1),r=Math.min(Math.max(t,0),1),s=(this.reverse*(this.settings.max/2-i*this.settings.max)).toFixed(2),o=(this.reverse*(r*this.settings.max-this.settings.max/2)).toFixed(2),a=i*100,l=r*100;return{tiltX:s,tiltY:o,percentageX:a,percentageY:l}}updateElementPosition(){const n=this.element.getBoundingClientRect();this.width=this.element.offsetWidth,this.height=this.element.offsetHeight,this.left=n.left,this.top=n.top}update(n){const e=this.getValues(n);this.setState(Object.assign({},this.state,{style:Sf(xf({},this.state.style),{transform:`perspective(${this.settings.perspective}px) rotateX(${this.settings.axis==="x"?0:e.tiltY}deg) rotateY(${this.settings.axis==="y"?0:e.tiltX}deg) scale3d(${this.settings.scale}, ${this.settings.scale}, ${this.settings.scale})`})})),this.updateCall=null}render(){const n=Object.assign({},this.props.style,this.state.style);return B.jsx("div",{style:n,ref:this.ref,className:this.props.className,onMouseEnter:this.onMouseEnter,onMouseMove:this.onMouseMove,onMouseLeave:this.onMouseLeave,children:this.props.children})}};const Td=(n,e)=>function(){return B.jsxs(er.section,{variants:FW(),initial:"hidden",whileInView:"show",viewport:{once:!0,amount:0},exit:"hidden",className:`${sr.padding} max-w-7xl mx-auto relative z-0`,children:[B.jsx("span",{className:"hash-span",id:e,children:" "}),B.jsx(n,{})]})},jW=({index:n,title:e,icon:t})=>B.jsx(G_,{className:"xs:w-[250px] w-full",children:B.jsx(er.div,{variants:Ed("right","spring",.5*n,.75),className:"w-full green-pink-gradient p-[1px] rounded-[20px] shadow-[#fcd4d4] shadow-card",children:B.jsxs("div",{options:{max:45,scale:1,speed:450},className:"bg-primary rounded-[20px] py-5 px-12 min-h-[280px] flex justify-evenly items-center flex-col",children:[B.jsx("img",{src:t,alt:e,className:"w-16 h-16 object-contain"}),B.jsx("h3",{className:"text-black text-[20px] font-bold text-center",children:e})]})})}),XW=()=>B.jsxs("section",{children:[B.jsxs(er.div,{variants:Lm(0),children:[B.jsx("h2",{className:`${sr.sectionHeadText} text-center`,children:"Overview."}),B.jsxs(er.p,{variants:Ed("","",.1,1),className:`${sr.sectionSubText} text-center`,children:["Introduction? Nahh",B.jsx("br",{}),"I do this 👇"]})]}),B.jsx("div",{className:"mt-20 flex flex-wrap justify-center gap-10",children:DW.map((n,e)=>B.jsx(jW,{index:e,...n},n.title))})]}),qW=Td(XW,"AboutSection");var W_={},OO={exports:{}},$W="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",YW=$W,KW=YW;function UO(){}function FO(){}FO.resetWarningCache=UO;var QW=function(){function n(i,r,s,o,a,l){if(l!==KW){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}n.isRequired=n;function e(){return n}var t={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:e,element:n,elementType:n,instanceOf:e,node:n,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:FO,resetWarningCache:UO};return t.PropTypes=t,t};OO.exports=QW();var VO=OO.exports,BO={exports:{}};/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames -*/(function(n){(function(){var e={}.hasOwnProperty;function t(){for(var s="",o=0;o(typeof window=="object"&&document.documentElement.style.setProperty("--line-color",i),JW.default.createElement("div",{className:(0,ZW.default)(e,"vertical-timeline",{"vertical-timeline--animate":n,"vertical-timeline--two-columns":t==="2-columns","vertical-timeline--one-column-left":t==="1-column"||t==="1-column-left","vertical-timeline--one-column-right":t==="1-column-right"})},r));zO.propTypes={children:ka.default.oneOfType([ka.default.arrayOf(ka.default.node),ka.default.node]).isRequired,className:ka.default.string,animate:ka.default.bool,layout:ka.default.oneOf(["1-column-left","1-column","2-columns","1-column-right"]),lineColor:ka.default.string};var ej=zO;W_.default=ej;var j_={};function BE(){return BE=Object.assign||function(n){for(var e=1;e=0)&&(t[r]=n[r]);return t}var HE=new Map,ay=new WeakMap,bI=0,HO=void 0;function ij(n){HO=n}function rj(n){return n?(ay.has(n)||(bI+=1,ay.set(n,bI.toString())),ay.get(n)):"0"}function sj(n){return Object.keys(n).sort().filter(function(e){return n[e]!==void 0}).map(function(e){return e+"_"+(e==="root"?rj(n.root):n[e])}).toString()}function oj(n){var e=sj(n),t=HE.get(e);if(!t){var i=new Map,r,s=new IntersectionObserver(function(o){o.forEach(function(a){var l,c=a.isIntersecting&&r.some(function(d){return a.intersectionRatio>=d});n.trackVisibility&&typeof a.isVisible>"u"&&(a.isVisible=c),(l=i.get(a.target))==null||l.forEach(function(d){d(c,a)})})},n);r=s.thresholds||(Array.isArray(n.threshold)?n.threshold:[n.threshold||0]),t={id:e,observer:s,elements:i},HE.set(e,t)}return t}function rM(n,e,t,i){if(t===void 0&&(t={}),i===void 0&&(i=HO),typeof window.IntersectionObserver>"u"&&i!==void 0){var r=n.getBoundingClientRect();return e(i,{isIntersecting:i,target:n,intersectionRatio:typeof t.threshold=="number"?t.threshold:0,time:0,boundingClientRect:r,intersectionRect:r,rootBounds:r}),function(){}}var s=oj(t),o=s.id,a=s.observer,l=s.elements,c=l.get(n)||[];return l.has(n)||l.set(n,c),c.push(e),a.observe(n),function(){c.splice(c.indexOf(e),1),c.length===0&&(l.delete(n),a.unobserve(n)),l.size===0&&(a.disconnect(),HE.delete(o))}}var aj=["children","as","triggerOnce","threshold","root","rootMargin","onChange","skip","trackVisibility","delay","initialInView","fallbackInView"];function PI(n){return typeof n.children!="function"}var m0=function(n){tj(e,n);function e(i){var r;return r=n.call(this,i)||this,r.node=null,r._unobserveCb=null,r.handleNode=function(s){r.node&&(r.unobserve(),!s&&!r.props.triggerOnce&&!r.props.skip&&r.setState({inView:!!r.props.initialInView,entry:void 0})),r.node=s||null,r.observeNode()},r.handleChange=function(s,o){s&&r.props.triggerOnce&&r.unobserve(),PI(r.props)||r.setState({inView:s,entry:o}),r.props.onChange&&r.props.onChange(s,o)},r.state={inView:!!i.initialInView,entry:void 0},r}var t=e.prototype;return t.componentDidUpdate=function(r){(r.rootMargin!==this.props.rootMargin||r.root!==this.props.root||r.threshold!==this.props.threshold||r.skip!==this.props.skip||r.trackVisibility!==this.props.trackVisibility||r.delay!==this.props.delay)&&(this.unobserve(),this.observeNode())},t.componentWillUnmount=function(){this.unobserve(),this.node=null},t.observeNode=function(){if(!(!this.node||this.props.skip)){var r=this.props,s=r.threshold,o=r.root,a=r.rootMargin,l=r.trackVisibility,c=r.delay,d=r.fallbackInView;this._unobserveCb=rM(this.node,this.handleChange,{threshold:s,root:o,rootMargin:a,trackVisibility:l,delay:c},d)}},t.unobserve=function(){this._unobserveCb&&(this._unobserveCb(),this._unobserveCb=null)},t.render=function(){if(!PI(this.props)){var r=this.state,s=r.inView,o=r.entry;return this.props.children({inView:s,entry:o,ref:this.handleNode})}var a=this.props,l=a.children,c=a.as,d=nj(a,aj);return q.createElement(c||"div",BE({ref:this.handleNode},d),l)},e}(q.Component);m0.displayName="InView";m0.defaultProps={threshold:0,triggerOnce:!1,initialInView:!1};function lj(n){var e=n===void 0?{}:n,t=e.threshold,i=e.delay,r=e.trackVisibility,s=e.rootMargin,o=e.root,a=e.triggerOnce,l=e.skip,c=e.initialInView,d=e.fallbackInView,f=q.useRef(),p=q.useState({inView:!!c}),m=p[0],_=p[1],S=q.useCallback(function(y){f.current!==void 0&&(f.current(),f.current=void 0),!l&&y&&(f.current=rM(y,function(E,w){_({inView:E,entry:w}),w.isIntersecting&&a&&f.current&&(f.current(),f.current=void 0)},{root:o,rootMargin:s,threshold:t,trackVisibility:r,delay:i},d))},[Array.isArray(t)?t.toString():t,o,s,a,l,r,d,i]);q.useEffect(function(){!f.current&&m.entry&&!a&&!l&&_({inView:!!c})});var x=[S,m.inView,m.entry];return x.ref=x[0],x.inView=x[1],x.entry=x[2],x}const cj=Object.freeze(Object.defineProperty({__proto__:null,InView:m0,default:m0,defaultFallbackInView:ij,observe:rM,useInView:lj},Symbol.toStringTag,{value:"Module"})),uj=UB(cj);j_.__esModule=!0;j_.default=void 0;var Oa=sM(q),Ln=sM(FO),ly=sM(BO),hj=uj;function sM(n){return n&&n.__esModule?n:{default:n}}const GO=({children:n="",className:e="",contentArrowStyle:t=null,contentStyle:i=null,date:r="",dateClassName:s="",icon:o=null,iconClassName:a="",iconOnClick:l=null,onTimelineElementClick:c=null,iconStyle:d=null,id:f="",position:p="",style:m=null,textClassName:_="",intersectionObserverProps:S={rootMargin:"0px 0px -40px 0px",triggerOnce:!0},visible:x=!1})=>Oa.default.createElement(hj.InView,S,({inView:y,ref:E})=>Oa.default.createElement("div",{ref:E,id:f,className:(0,ly.default)(e,"vertical-timeline-element",{"vertical-timeline-element--left":p==="left","vertical-timeline-element--right":p==="right","vertical-timeline-element--no-children":n===""}),style:m},Oa.default.createElement(Oa.default.Fragment,null,Oa.default.createElement("span",{style:d,onClick:l,className:(0,ly.default)(a,"vertical-timeline-element-icon",{"bounce-in":y||x,"is-hidden":!(y||x)})},o),Oa.default.createElement("div",{style:i,onClick:c,className:(0,ly.default)(_,"vertical-timeline-element-content",{"bounce-in":y||x,"is-hidden":!(y||x)})},Oa.default.createElement("div",{style:t,className:"vertical-timeline-element-content-arrow"}),n,Oa.default.createElement("span",{className:(0,ly.default)(s,"vertical-timeline-element-date")},r)))));GO.propTypes={children:Ln.default.oneOfType([Ln.default.arrayOf(Ln.default.node),Ln.default.node]),className:Ln.default.string,contentArrowStyle:Ln.default.shape({}),contentStyle:Ln.default.shape({}),date:Ln.default.node,dateClassName:Ln.default.string,icon:Ln.default.element,iconClassName:Ln.default.string,iconStyle:Ln.default.shape({}),iconOnClick:Ln.default.func,onTimelineElementClick:Ln.default.func,id:Ln.default.string,position:Ln.default.string,style:Ln.default.shape({}),textClassName:Ln.default.string,visible:Ln.default.bool,intersectionObserverProps:Ln.default.shape({root:Ln.default.object,rootMargin:Ln.default.string,threshold:Ln.default.number,triggerOnce:Ln.default.bool})};var dj=GO;j_.default=dj;var WO={VerticalTimeline:W_.default,VerticalTimelineElement:j_.default};/** +*/(function(n){(function(){var e={}.hasOwnProperty;function t(){for(var s="",o=0;o(typeof window=="object"&&document.documentElement.style.setProperty("--line-color",i),JW.default.createElement("div",{className:(0,ZW.default)(e,"vertical-timeline",{"vertical-timeline--animate":n,"vertical-timeline--two-columns":t==="2-columns","vertical-timeline--one-column-left":t==="1-column"||t==="1-column-left","vertical-timeline--one-column-right":t==="1-column-right"})},r));HO.propTypes={children:ka.default.oneOfType([ka.default.arrayOf(ka.default.node),ka.default.node]).isRequired,className:ka.default.string,animate:ka.default.bool,layout:ka.default.oneOf(["1-column-left","1-column","2-columns","1-column-right"]),lineColor:ka.default.string};var ej=HO;W_.default=ej;var j_={};function BE(){return BE=Object.assign||function(n){for(var e=1;e=0)&&(t[r]=n[r]);return t}var HE=new Map,ay=new WeakMap,bI=0,GO=void 0;function ij(n){GO=n}function rj(n){return n?(ay.has(n)||(bI+=1,ay.set(n,bI.toString())),ay.get(n)):"0"}function sj(n){return Object.keys(n).sort().filter(function(e){return n[e]!==void 0}).map(function(e){return e+"_"+(e==="root"?rj(n.root):n[e])}).toString()}function oj(n){var e=sj(n),t=HE.get(e);if(!t){var i=new Map,r,s=new IntersectionObserver(function(o){o.forEach(function(a){var l,c=a.isIntersecting&&r.some(function(d){return a.intersectionRatio>=d});n.trackVisibility&&typeof a.isVisible>"u"&&(a.isVisible=c),(l=i.get(a.target))==null||l.forEach(function(d){d(c,a)})})},n);r=s.thresholds||(Array.isArray(n.threshold)?n.threshold:[n.threshold||0]),t={id:e,observer:s,elements:i},HE.set(e,t)}return t}function rM(n,e,t,i){if(t===void 0&&(t={}),i===void 0&&(i=GO),typeof window.IntersectionObserver>"u"&&i!==void 0){var r=n.getBoundingClientRect();return e(i,{isIntersecting:i,target:n,intersectionRatio:typeof t.threshold=="number"?t.threshold:0,time:0,boundingClientRect:r,intersectionRect:r,rootBounds:r}),function(){}}var s=oj(t),o=s.id,a=s.observer,l=s.elements,c=l.get(n)||[];return l.has(n)||l.set(n,c),c.push(e),a.observe(n),function(){c.splice(c.indexOf(e),1),c.length===0&&(l.delete(n),a.unobserve(n)),l.size===0&&(a.disconnect(),HE.delete(o))}}var aj=["children","as","triggerOnce","threshold","root","rootMargin","onChange","skip","trackVisibility","delay","initialInView","fallbackInView"];function PI(n){return typeof n.children!="function"}var m0=function(n){tj(e,n);function e(i){var r;return r=n.call(this,i)||this,r.node=null,r._unobserveCb=null,r.handleNode=function(s){r.node&&(r.unobserve(),!s&&!r.props.triggerOnce&&!r.props.skip&&r.setState({inView:!!r.props.initialInView,entry:void 0})),r.node=s||null,r.observeNode()},r.handleChange=function(s,o){s&&r.props.triggerOnce&&r.unobserve(),PI(r.props)||r.setState({inView:s,entry:o}),r.props.onChange&&r.props.onChange(s,o)},r.state={inView:!!i.initialInView,entry:void 0},r}var t=e.prototype;return t.componentDidUpdate=function(r){(r.rootMargin!==this.props.rootMargin||r.root!==this.props.root||r.threshold!==this.props.threshold||r.skip!==this.props.skip||r.trackVisibility!==this.props.trackVisibility||r.delay!==this.props.delay)&&(this.unobserve(),this.observeNode())},t.componentWillUnmount=function(){this.unobserve(),this.node=null},t.observeNode=function(){if(!(!this.node||this.props.skip)){var r=this.props,s=r.threshold,o=r.root,a=r.rootMargin,l=r.trackVisibility,c=r.delay,d=r.fallbackInView;this._unobserveCb=rM(this.node,this.handleChange,{threshold:s,root:o,rootMargin:a,trackVisibility:l,delay:c},d)}},t.unobserve=function(){this._unobserveCb&&(this._unobserveCb(),this._unobserveCb=null)},t.render=function(){if(!PI(this.props)){var r=this.state,s=r.inView,o=r.entry;return this.props.children({inView:s,entry:o,ref:this.handleNode})}var a=this.props,l=a.children,c=a.as,d=nj(a,aj);return q.createElement(c||"div",BE({ref:this.handleNode},d),l)},e}(q.Component);m0.displayName="InView";m0.defaultProps={threshold:0,triggerOnce:!1,initialInView:!1};function lj(n){var e=n===void 0?{}:n,t=e.threshold,i=e.delay,r=e.trackVisibility,s=e.rootMargin,o=e.root,a=e.triggerOnce,l=e.skip,c=e.initialInView,d=e.fallbackInView,f=q.useRef(),p=q.useState({inView:!!c}),m=p[0],_=p[1],S=q.useCallback(function(y){f.current!==void 0&&(f.current(),f.current=void 0),!l&&y&&(f.current=rM(y,function(E,w){_({inView:E,entry:w}),w.isIntersecting&&a&&f.current&&(f.current(),f.current=void 0)},{root:o,rootMargin:s,threshold:t,trackVisibility:r,delay:i},d))},[Array.isArray(t)?t.toString():t,o,s,a,l,r,d,i]);q.useEffect(function(){!f.current&&m.entry&&!a&&!l&&_({inView:!!c})});var x=[S,m.inView,m.entry];return x.ref=x[0],x.inView=x[1],x.entry=x[2],x}const cj=Object.freeze(Object.defineProperty({__proto__:null,InView:m0,default:m0,defaultFallbackInView:ij,observe:rM,useInView:lj},Symbol.toStringTag,{value:"Module"})),uj=FB(cj);j_.__esModule=!0;j_.default=void 0;var Oa=sM(q),Ln=sM(VO),ly=sM(zO),hj=uj;function sM(n){return n&&n.__esModule?n:{default:n}}const WO=({children:n="",className:e="",contentArrowStyle:t=null,contentStyle:i=null,date:r="",dateClassName:s="",icon:o=null,iconClassName:a="",iconOnClick:l=null,onTimelineElementClick:c=null,iconStyle:d=null,id:f="",position:p="",style:m=null,textClassName:_="",intersectionObserverProps:S={rootMargin:"0px 0px -40px 0px",triggerOnce:!0},visible:x=!1})=>Oa.default.createElement(hj.InView,S,({inView:y,ref:E})=>Oa.default.createElement("div",{ref:E,id:f,className:(0,ly.default)(e,"vertical-timeline-element",{"vertical-timeline-element--left":p==="left","vertical-timeline-element--right":p==="right","vertical-timeline-element--no-children":n===""}),style:m},Oa.default.createElement(Oa.default.Fragment,null,Oa.default.createElement("span",{style:d,onClick:l,className:(0,ly.default)(a,"vertical-timeline-element-icon",{"bounce-in":y||x,"is-hidden":!(y||x)})},o),Oa.default.createElement("div",{style:i,onClick:c,className:(0,ly.default)(_,"vertical-timeline-element-content",{"bounce-in":y||x,"is-hidden":!(y||x)})},Oa.default.createElement("div",{style:t,className:"vertical-timeline-element-content-arrow"}),n,Oa.default.createElement("span",{className:(0,ly.default)(s,"vertical-timeline-element-date")},r)))));WO.propTypes={children:Ln.default.oneOfType([Ln.default.arrayOf(Ln.default.node),Ln.default.node]),className:Ln.default.string,contentArrowStyle:Ln.default.shape({}),contentStyle:Ln.default.shape({}),date:Ln.default.node,dateClassName:Ln.default.string,icon:Ln.default.element,iconClassName:Ln.default.string,iconStyle:Ln.default.shape({}),iconOnClick:Ln.default.func,onTimelineElementClick:Ln.default.func,id:Ln.default.string,position:Ln.default.string,style:Ln.default.shape({}),textClassName:Ln.default.string,visible:Ln.default.bool,intersectionObserverProps:Ln.default.shape({root:Ln.default.object,rootMargin:Ln.default.string,threshold:Ln.default.number,triggerOnce:Ln.default.bool})};var dj=WO;j_.default=dj;var jO={VerticalTimeline:W_.default,VerticalTimelineElement:j_.default};/** * @license * Copyright 2017 Google LLC * @@ -109,7 +109,7 @@ Error generating stack: `+s.message+` * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const jO=function(n){const e=[];let t=0;for(let i=0;i>6|192,e[t++]=r&63|128):(r&64512)===55296&&i+1>18|240,e[t++]=r>>12&63|128,e[t++]=r>>6&63|128,e[t++]=r&63|128):(e[t++]=r>>12|224,e[t++]=r>>6&63|128,e[t++]=r&63|128)}return e},fj=function(n){const e=[];let t=0,i=0;for(;t191&&r<224){const s=n[t++];e[i++]=String.fromCharCode((r&31)<<6|s&63)}else if(r>239&&r<365){const s=n[t++],o=n[t++],a=n[t++],l=((r&7)<<18|(s&63)<<12|(o&63)<<6|a&63)-65536;e[i++]=String.fromCharCode(55296+(l>>10)),e[i++]=String.fromCharCode(56320+(l&1023))}else{const s=n[t++],o=n[t++];e[i++]=String.fromCharCode((r&15)<<12|(s&63)<<6|o&63)}}return e.join("")},XO={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(n,e){if(!Array.isArray(n))throw Error("encodeByteArray takes an array as a parameter");this.init_();const t=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,i=[];for(let r=0;r>2,f=(s&3)<<4|a>>4;let p=(a&15)<<2|c>>6,m=c&63;l||(m=64,o||(p=64)),i.push(t[d],t[f],t[p],t[m])}return i.join("")},encodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(n):this.encodeByteArray(jO(n),e)},decodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(n):fj(this.decodeStringToByteArray(n,e))},decodeStringToByteArray(n,e){this.init_();const t=e?this.charToByteMapWebSafe_:this.charToByteMap_,i=[];for(let r=0;r>4;if(i.push(p),c!==64){const m=a<<4&240|c>>2;if(i.push(m),f!==64){const _=c<<6&192|f;i.push(_)}}}return i},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let n=0;n=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(n)]=n,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(n)]=n)}}};class pj extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const mj=function(n){const e=jO(n);return XO.encodeByteArray(e,!0)},g0=function(n){return mj(n).replace(/\./g,"")},qO=function(n){try{return XO.decodeString(n,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};/** + */const XO=function(n){const e=[];let t=0;for(let i=0;i>6|192,e[t++]=r&63|128):(r&64512)===55296&&i+1>18|240,e[t++]=r>>12&63|128,e[t++]=r>>6&63|128,e[t++]=r&63|128):(e[t++]=r>>12|224,e[t++]=r>>6&63|128,e[t++]=r&63|128)}return e},fj=function(n){const e=[];let t=0,i=0;for(;t191&&r<224){const s=n[t++];e[i++]=String.fromCharCode((r&31)<<6|s&63)}else if(r>239&&r<365){const s=n[t++],o=n[t++],a=n[t++],l=((r&7)<<18|(s&63)<<12|(o&63)<<6|a&63)-65536;e[i++]=String.fromCharCode(55296+(l>>10)),e[i++]=String.fromCharCode(56320+(l&1023))}else{const s=n[t++],o=n[t++];e[i++]=String.fromCharCode((r&15)<<12|(s&63)<<6|o&63)}}return e.join("")},qO={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(n,e){if(!Array.isArray(n))throw Error("encodeByteArray takes an array as a parameter");this.init_();const t=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,i=[];for(let r=0;r>2,f=(s&3)<<4|a>>4;let p=(a&15)<<2|c>>6,m=c&63;l||(m=64,o||(p=64)),i.push(t[d],t[f],t[p],t[m])}return i.join("")},encodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(n):this.encodeByteArray(XO(n),e)},decodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(n):fj(this.decodeStringToByteArray(n,e))},decodeStringToByteArray(n,e){this.init_();const t=e?this.charToByteMapWebSafe_:this.charToByteMap_,i=[];for(let r=0;r>4;if(i.push(p),c!==64){const m=a<<4&240|c>>2;if(i.push(m),f!==64){const _=c<<6&192|f;i.push(_)}}}return i},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let n=0;n=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(n)]=n,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(n)]=n)}}};class pj extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const mj=function(n){const e=XO(n);return qO.encodeByteArray(e,!0)},g0=function(n){return mj(n).replace(/\./g,"")},$O=function(n){try{return qO.decodeString(n,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};/** * @license * Copyright 2022 Google LLC * @@ -139,7 +139,7 @@ Error generating stack: `+s.message+` * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const yj=()=>gj().__FIREBASE_DEFAULTS__,vj=()=>{if(typeof process>"u"||typeof process.env>"u")return;const n={}.__FIREBASE_DEFAULTS__;if(n)return JSON.parse(n)},_j=()=>{if(typeof document>"u")return;let n;try{n=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const e=n&&qO(n[1]);return e&&JSON.parse(e)},X_=()=>{try{return yj()||vj()||_j()}catch(n){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${n}`);return}},$O=n=>{var e,t;return(t=(e=X_())===null||e===void 0?void 0:e.emulatorHosts)===null||t===void 0?void 0:t[n]},xj=n=>{const e=$O(n);if(!e)return;const t=e.lastIndexOf(":");if(t<=0||t+1===e.length)throw new Error(`Invalid host ${e} with no separate hostname and port!`);const i=parseInt(e.substring(t+1),10);return e[0]==="["?[e.substring(1,t-1),i]:[e.substring(0,t),i]},YO=()=>{var n;return(n=X_())===null||n===void 0?void 0:n.config},KO=n=>{var e;return(e=X_())===null||e===void 0?void 0:e[`_${n}`]};/** + */const yj=()=>gj().__FIREBASE_DEFAULTS__,vj=()=>{if(typeof process>"u"||typeof process.env>"u")return;const n={}.__FIREBASE_DEFAULTS__;if(n)return JSON.parse(n)},_j=()=>{if(typeof document>"u")return;let n;try{n=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const e=n&&$O(n[1]);return e&&JSON.parse(e)},X_=()=>{try{return yj()||vj()||_j()}catch(n){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${n}`);return}},YO=n=>{var e,t;return(t=(e=X_())===null||e===void 0?void 0:e.emulatorHosts)===null||t===void 0?void 0:t[n]},xj=n=>{const e=YO(n);if(!e)return;const t=e.lastIndexOf(":");if(t<=0||t+1===e.length)throw new Error(`Invalid host ${e} with no separate hostname and port!`);const i=parseInt(e.substring(t+1),10);return e[0]==="["?[e.substring(1,t-1),i]:[e.substring(0,t),i]},KO=()=>{var n;return(n=X_())===null||n===void 0?void 0:n.config},QO=n=>{var e;return(e=X_())===null||e===void 0?void 0:e[`_${n}`]};/** * @license * Copyright 2017 Google LLC * @@ -289,7 +289,7 @@ Error generating stack: `+s.message+` * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var Qt;(function(n){n[n.DEBUG=0]="DEBUG",n[n.VERBOSE=1]="VERBOSE",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.SILENT=5]="SILENT"})(Qt||(Qt={}));const Gj={debug:Qt.DEBUG,verbose:Qt.VERBOSE,info:Qt.INFO,warn:Qt.WARN,error:Qt.ERROR,silent:Qt.SILENT},Wj=Qt.INFO,jj={[Qt.DEBUG]:"log",[Qt.VERBOSE]:"log",[Qt.INFO]:"info",[Qt.WARN]:"warn",[Qt.ERROR]:"error"},Xj=(n,e,...t)=>{if(ee.some(t=>n instanceof t);let II,LI;function $j(){return II||(II=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Yj(){return LI||(LI=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const QO=new WeakMap,GE=new WeakMap,JO=new WeakMap,Sw=new WeakMap,aM=new WeakMap;function Kj(n){const e=new Promise((t,i)=>{const r=()=>{n.removeEventListener("success",s),n.removeEventListener("error",o)},s=()=>{t(_l(n.result)),r()},o=()=>{i(n.error),r()};n.addEventListener("success",s),n.addEventListener("error",o)});return e.then(t=>{t instanceof IDBCursor&&QO.set(t,n)}).catch(()=>{}),aM.set(e,n),e}function Qj(n){if(GE.has(n))return;const e=new Promise((t,i)=>{const r=()=>{n.removeEventListener("complete",s),n.removeEventListener("error",o),n.removeEventListener("abort",o)},s=()=>{t(),r()},o=()=>{i(n.error||new DOMException("AbortError","AbortError")),r()};n.addEventListener("complete",s),n.addEventListener("error",o),n.addEventListener("abort",o)});GE.set(n,e)}let WE={get(n,e,t){if(n instanceof IDBTransaction){if(e==="done")return GE.get(n);if(e==="objectStoreNames")return n.objectStoreNames||JO.get(n);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return _l(n[e])},set(n,e,t){return n[e]=t,!0},has(n,e){return n instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in n}};function Jj(n){WE=n(WE)}function Zj(n){return n===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...t){const i=n.call(ww(this),e,...t);return JO.set(i,e.sort?e.sort():[e]),_l(i)}:Yj().includes(n)?function(...e){return n.apply(ww(this),e),_l(QO.get(this))}:function(...e){return _l(n.apply(ww(this),e))}}function e7(n){return typeof n=="function"?Zj(n):(n instanceof IDBTransaction&&Qj(n),qj(n,$j())?new Proxy(n,WE):n)}function _l(n){if(n instanceof IDBRequest)return Kj(n);if(Sw.has(n))return Sw.get(n);const e=e7(n);return e!==n&&(Sw.set(n,e),aM.set(e,n)),e}const ww=n=>aM.get(n);function t7(n,e,{blocked:t,upgrade:i,blocking:r,terminated:s}={}){const o=indexedDB.open(n,e),a=_l(o);return i&&o.addEventListener("upgradeneeded",l=>{i(_l(o.result),l.oldVersion,l.newVersion,_l(o.transaction),l)}),t&&o.addEventListener("blocked",l=>t(l.oldVersion,l.newVersion,l)),a.then(l=>{s&&l.addEventListener("close",()=>s()),r&&l.addEventListener("versionchange",c=>r(c.oldVersion,c.newVersion,c))}).catch(()=>{}),a}const n7=["get","getKey","getAll","getAllKeys","count"],i7=["put","add","delete","clear"],Ew=new Map;function NI(n,e){if(!(n instanceof IDBDatabase&&!(e in n)&&typeof e=="string"))return;if(Ew.get(e))return Ew.get(e);const t=e.replace(/FromIndex$/,""),i=e!==t,r=i7.includes(t);if(!(t in(i?IDBIndex:IDBObjectStore).prototype)||!(r||n7.includes(t)))return;const s=async function(o,...a){const l=this.transaction(o,r?"readwrite":"readonly");let c=l.store;return i&&(c=c.index(a.shift())),(await Promise.all([c[t](...a),r&&l.done]))[0]};return Ew.set(e,s),s}Jj(n=>({...n,get:(e,t,i)=>NI(e,t)||n.get(e,t,i),has:(e,t)=>!!NI(e,t)||n.has(e,t)}));/** + */var Qt;(function(n){n[n.DEBUG=0]="DEBUG",n[n.VERBOSE=1]="VERBOSE",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.SILENT=5]="SILENT"})(Qt||(Qt={}));const Gj={debug:Qt.DEBUG,verbose:Qt.VERBOSE,info:Qt.INFO,warn:Qt.WARN,error:Qt.ERROR,silent:Qt.SILENT},Wj=Qt.INFO,jj={[Qt.DEBUG]:"log",[Qt.VERBOSE]:"log",[Qt.INFO]:"info",[Qt.WARN]:"warn",[Qt.ERROR]:"error"},Xj=(n,e,...t)=>{if(ee.some(t=>n instanceof t);let II,LI;function $j(){return II||(II=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Yj(){return LI||(LI=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const JO=new WeakMap,GE=new WeakMap,ZO=new WeakMap,Sw=new WeakMap,aM=new WeakMap;function Kj(n){const e=new Promise((t,i)=>{const r=()=>{n.removeEventListener("success",s),n.removeEventListener("error",o)},s=()=>{t(_l(n.result)),r()},o=()=>{i(n.error),r()};n.addEventListener("success",s),n.addEventListener("error",o)});return e.then(t=>{t instanceof IDBCursor&&JO.set(t,n)}).catch(()=>{}),aM.set(e,n),e}function Qj(n){if(GE.has(n))return;const e=new Promise((t,i)=>{const r=()=>{n.removeEventListener("complete",s),n.removeEventListener("error",o),n.removeEventListener("abort",o)},s=()=>{t(),r()},o=()=>{i(n.error||new DOMException("AbortError","AbortError")),r()};n.addEventListener("complete",s),n.addEventListener("error",o),n.addEventListener("abort",o)});GE.set(n,e)}let WE={get(n,e,t){if(n instanceof IDBTransaction){if(e==="done")return GE.get(n);if(e==="objectStoreNames")return n.objectStoreNames||ZO.get(n);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return _l(n[e])},set(n,e,t){return n[e]=t,!0},has(n,e){return n instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in n}};function Jj(n){WE=n(WE)}function Zj(n){return n===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...t){const i=n.call(ww(this),e,...t);return ZO.set(i,e.sort?e.sort():[e]),_l(i)}:Yj().includes(n)?function(...e){return n.apply(ww(this),e),_l(JO.get(this))}:function(...e){return _l(n.apply(ww(this),e))}}function e7(n){return typeof n=="function"?Zj(n):(n instanceof IDBTransaction&&Qj(n),qj(n,$j())?new Proxy(n,WE):n)}function _l(n){if(n instanceof IDBRequest)return Kj(n);if(Sw.has(n))return Sw.get(n);const e=e7(n);return e!==n&&(Sw.set(n,e),aM.set(e,n)),e}const ww=n=>aM.get(n);function t7(n,e,{blocked:t,upgrade:i,blocking:r,terminated:s}={}){const o=indexedDB.open(n,e),a=_l(o);return i&&o.addEventListener("upgradeneeded",l=>{i(_l(o.result),l.oldVersion,l.newVersion,_l(o.transaction),l)}),t&&o.addEventListener("blocked",l=>t(l.oldVersion,l.newVersion,l)),a.then(l=>{s&&l.addEventListener("close",()=>s()),r&&l.addEventListener("versionchange",c=>r(c.oldVersion,c.newVersion,c))}).catch(()=>{}),a}const n7=["get","getKey","getAll","getAllKeys","count"],i7=["put","add","delete","clear"],Ew=new Map;function NI(n,e){if(!(n instanceof IDBDatabase&&!(e in n)&&typeof e=="string"))return;if(Ew.get(e))return Ew.get(e);const t=e.replace(/FromIndex$/,""),i=e!==t,r=i7.includes(t);if(!(t in(i?IDBIndex:IDBObjectStore).prototype)||!(r||n7.includes(t)))return;const s=async function(o,...a){const l=this.transaction(o,r?"readwrite":"readonly");let c=l.store;return i&&(c=c.index(a.shift())),(await Promise.all([c[t](...a),r&&l.done]))[0]};return Ew.set(e,s),s}Jj(n=>({...n,get:(e,t,i)=>NI(e,t)||n.get(e,t,i),has:(e,t)=>!!NI(e,t)||n.has(e,t)}));/** * @license * Copyright 2019 Google LLC * @@ -394,7 +394,7 @@ Error generating stack: `+s.message+` * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const Ad=L7;function ZO(n,e={}){let t=n;typeof e!="object"&&(e={name:e});const i=Object.assign({name:XE,automaticDataCollectionEnabled:!1},e),r=i.name;if(typeof r!="string"||!r)throw xl.create("bad-app-name",{appName:String(r)});if(t||(t=YO()),!t)throw xl.create("no-options");const s=v0.get(r);if(s){if(y0(t,s.options)&&y0(i,s.config))return s;throw xl.create("duplicate-app",{appName:r})}const o=new Hj(r);for(const l of qE.values())o.addComponent(l);const a=new O7(t,i,o);return v0.set(r,a),a}function eU(n=XE){const e=v0.get(n);if(!e&&n===XE&&YO())return ZO();if(!e)throw xl.create("no-app",{appName:n});return e}function Sl(n,e,t){var i;let r=(i=N7[n])!==null&&i!==void 0?i:n;t&&(r+=`-${t}`);const s=r.match(/\s|\//),o=e.match(/\s|\//);if(s||o){const a=[`Unable to register library "${r}" with version "${e}":`];s&&a.push(`library name "${r}" contains illegal characters (whitespace or "/")`),s&&o&&a.push("and"),o&&a.push(`version name "${e}" contains illegal characters (whitespace or "/")`),ua.warn(a.join(" "));return}sd(new iu(`${r}-version`,()=>({library:r,version:e}),"VERSION"))}/** + */const Ad=L7;function eU(n,e={}){let t=n;typeof e!="object"&&(e={name:e});const i=Object.assign({name:XE,automaticDataCollectionEnabled:!1},e),r=i.name;if(typeof r!="string"||!r)throw xl.create("bad-app-name",{appName:String(r)});if(t||(t=KO()),!t)throw xl.create("no-options");const s=v0.get(r);if(s){if(y0(t,s.options)&&y0(i,s.config))return s;throw xl.create("duplicate-app",{appName:r})}const o=new Hj(r);for(const l of qE.values())o.addComponent(l);const a=new O7(t,i,o);return v0.set(r,a),a}function tU(n=XE){const e=v0.get(n);if(!e&&n===XE&&KO())return eU();if(!e)throw xl.create("no-app",{appName:n});return e}function Sl(n,e,t){var i;let r=(i=N7[n])!==null&&i!==void 0?i:n;t&&(r+=`-${t}`);const s=r.match(/\s|\//),o=e.match(/\s|\//);if(s||o){const a=[`Unable to register library "${r}" with version "${e}":`];s&&a.push(`library name "${r}" contains illegal characters (whitespace or "/")`),s&&o&&a.push("and"),o&&a.push(`version name "${e}" contains illegal characters (whitespace or "/")`),ua.warn(a.join(" "));return}sd(new iu(`${r}-version`,()=>({library:r,version:e}),"VERSION"))}/** * @license * Copyright 2021 Google LLC * @@ -409,7 +409,7 @@ Error generating stack: `+s.message+` * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const U7="firebase-heartbeat-database",F7=1,qp="firebase-heartbeat-store";let Tw=null;function tU(){return Tw||(Tw=t7(U7,F7,{upgrade:(n,e)=>{switch(e){case 0:try{n.createObjectStore(qp)}catch(t){console.warn(t)}}}}).catch(n=>{throw xl.create("idb-open",{originalErrorMessage:n.message})})),Tw}async function V7(n){try{const t=(await tU()).transaction(qp),i=await t.objectStore(qp).get(nU(n));return await t.done,i}catch(e){if(e instanceof _a)ua.warn(e.message);else{const t=xl.create("idb-get",{originalErrorMessage:e==null?void 0:e.message});ua.warn(t.message)}}}async function OI(n,e){try{const i=(await tU()).transaction(qp,"readwrite");await i.objectStore(qp).put(e,nU(n)),await i.done}catch(t){if(t instanceof _a)ua.warn(t.message);else{const i=xl.create("idb-set",{originalErrorMessage:t==null?void 0:t.message});ua.warn(i.message)}}}function nU(n){return`${n.name}!${n.options.appId}`}/** + */const U7="firebase-heartbeat-database",F7=1,qp="firebase-heartbeat-store";let Tw=null;function nU(){return Tw||(Tw=t7(U7,F7,{upgrade:(n,e)=>{switch(e){case 0:try{n.createObjectStore(qp)}catch(t){console.warn(t)}}}}).catch(n=>{throw xl.create("idb-open",{originalErrorMessage:n.message})})),Tw}async function V7(n){try{const t=(await nU()).transaction(qp),i=await t.objectStore(qp).get(iU(n));return await t.done,i}catch(e){if(e instanceof _a)ua.warn(e.message);else{const t=xl.create("idb-get",{originalErrorMessage:e==null?void 0:e.message});ua.warn(t.message)}}}async function OI(n,e){try{const i=(await nU()).transaction(qp,"readwrite");await i.objectStore(qp).put(e,iU(n)),await i.done}catch(t){if(t instanceof _a)ua.warn(t.message);else{const i=xl.create("idb-set",{originalErrorMessage:t==null?void 0:t.message});ua.warn(i.message)}}}function iU(n){return`${n.name}!${n.options.appId}`}/** * @license * Copyright 2021 Google LLC * @@ -442,14 +442,14 @@ Error generating stack: `+s.message+` */function j7(n){sd(new iu("platform-logger",e=>new r7(e),"PRIVATE")),sd(new iu("heartbeat",e=>new H7(e),"PRIVATE")),Sl(jE,DI,n),Sl(jE,DI,"esm2017"),Sl("fire-js","")}j7("");var VI=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/** @license Copyright The Closure Library Authors. SPDX-License-Identifier: Apache-2.0 -*/var Wc,iU;(function(){var n;/** @license +*/var Wc,rU;(function(){var n;/** @license Copyright The Closure Library Authors. SPDX-License-Identifier: Apache-2.0 -*/function e(I,P){function D(){}D.prototype=P.prototype,I.D=P.prototype,I.prototype=new D,I.prototype.constructor=I,I.C=function(A,R,V){for(var U=Array(arguments.length-2),se=2;seR;++R)A[R]=P.charCodeAt(D++)|P.charCodeAt(D++)<<8|P.charCodeAt(D++)<<16|P.charCodeAt(D++)<<24;else for(R=0;16>R;++R)A[R]=P[D++]|P[D++]<<8|P[D++]<<16|P[D++]<<24;P=I.g[0],D=I.g[1],R=I.g[2];var V=I.g[3],U=P+(V^D&(R^V))+A[0]+3614090360&4294967295;P=D+(U<<7&4294967295|U>>>25),U=V+(R^P&(D^R))+A[1]+3905402710&4294967295,V=P+(U<<12&4294967295|U>>>20),U=R+(D^V&(P^D))+A[2]+606105819&4294967295,R=V+(U<<17&4294967295|U>>>15),U=D+(P^R&(V^P))+A[3]+3250441966&4294967295,D=R+(U<<22&4294967295|U>>>10),U=P+(V^D&(R^V))+A[4]+4118548399&4294967295,P=D+(U<<7&4294967295|U>>>25),U=V+(R^P&(D^R))+A[5]+1200080426&4294967295,V=P+(U<<12&4294967295|U>>>20),U=R+(D^V&(P^D))+A[6]+2821735955&4294967295,R=V+(U<<17&4294967295|U>>>15),U=D+(P^R&(V^P))+A[7]+4249261313&4294967295,D=R+(U<<22&4294967295|U>>>10),U=P+(V^D&(R^V))+A[8]+1770035416&4294967295,P=D+(U<<7&4294967295|U>>>25),U=V+(R^P&(D^R))+A[9]+2336552879&4294967295,V=P+(U<<12&4294967295|U>>>20),U=R+(D^V&(P^D))+A[10]+4294925233&4294967295,R=V+(U<<17&4294967295|U>>>15),U=D+(P^R&(V^P))+A[11]+2304563134&4294967295,D=R+(U<<22&4294967295|U>>>10),U=P+(V^D&(R^V))+A[12]+1804603682&4294967295,P=D+(U<<7&4294967295|U>>>25),U=V+(R^P&(D^R))+A[13]+4254626195&4294967295,V=P+(U<<12&4294967295|U>>>20),U=R+(D^V&(P^D))+A[14]+2792965006&4294967295,R=V+(U<<17&4294967295|U>>>15),U=D+(P^R&(V^P))+A[15]+1236535329&4294967295,D=R+(U<<22&4294967295|U>>>10),U=P+(R^V&(D^R))+A[1]+4129170786&4294967295,P=D+(U<<5&4294967295|U>>>27),U=V+(D^R&(P^D))+A[6]+3225465664&4294967295,V=P+(U<<9&4294967295|U>>>23),U=R+(P^D&(V^P))+A[11]+643717713&4294967295,R=V+(U<<14&4294967295|U>>>18),U=D+(V^P&(R^V))+A[0]+3921069994&4294967295,D=R+(U<<20&4294967295|U>>>12),U=P+(R^V&(D^R))+A[5]+3593408605&4294967295,P=D+(U<<5&4294967295|U>>>27),U=V+(D^R&(P^D))+A[10]+38016083&4294967295,V=P+(U<<9&4294967295|U>>>23),U=R+(P^D&(V^P))+A[15]+3634488961&4294967295,R=V+(U<<14&4294967295|U>>>18),U=D+(V^P&(R^V))+A[4]+3889429448&4294967295,D=R+(U<<20&4294967295|U>>>12),U=P+(R^V&(D^R))+A[9]+568446438&4294967295,P=D+(U<<5&4294967295|U>>>27),U=V+(D^R&(P^D))+A[14]+3275163606&4294967295,V=P+(U<<9&4294967295|U>>>23),U=R+(P^D&(V^P))+A[3]+4107603335&4294967295,R=V+(U<<14&4294967295|U>>>18),U=D+(V^P&(R^V))+A[8]+1163531501&4294967295,D=R+(U<<20&4294967295|U>>>12),U=P+(R^V&(D^R))+A[13]+2850285829&4294967295,P=D+(U<<5&4294967295|U>>>27),U=V+(D^R&(P^D))+A[2]+4243563512&4294967295,V=P+(U<<9&4294967295|U>>>23),U=R+(P^D&(V^P))+A[7]+1735328473&4294967295,R=V+(U<<14&4294967295|U>>>18),U=D+(V^P&(R^V))+A[12]+2368359562&4294967295,D=R+(U<<20&4294967295|U>>>12),U=P+(D^R^V)+A[5]+4294588738&4294967295,P=D+(U<<4&4294967295|U>>>28),U=V+(P^D^R)+A[8]+2272392833&4294967295,V=P+(U<<11&4294967295|U>>>21),U=R+(V^P^D)+A[11]+1839030562&4294967295,R=V+(U<<16&4294967295|U>>>16),U=D+(R^V^P)+A[14]+4259657740&4294967295,D=R+(U<<23&4294967295|U>>>9),U=P+(D^R^V)+A[1]+2763975236&4294967295,P=D+(U<<4&4294967295|U>>>28),U=V+(P^D^R)+A[4]+1272893353&4294967295,V=P+(U<<11&4294967295|U>>>21),U=R+(V^P^D)+A[7]+4139469664&4294967295,R=V+(U<<16&4294967295|U>>>16),U=D+(R^V^P)+A[10]+3200236656&4294967295,D=R+(U<<23&4294967295|U>>>9),U=P+(D^R^V)+A[13]+681279174&4294967295,P=D+(U<<4&4294967295|U>>>28),U=V+(P^D^R)+A[0]+3936430074&4294967295,V=P+(U<<11&4294967295|U>>>21),U=R+(V^P^D)+A[3]+3572445317&4294967295,R=V+(U<<16&4294967295|U>>>16),U=D+(R^V^P)+A[6]+76029189&4294967295,D=R+(U<<23&4294967295|U>>>9),U=P+(D^R^V)+A[9]+3654602809&4294967295,P=D+(U<<4&4294967295|U>>>28),U=V+(P^D^R)+A[12]+3873151461&4294967295,V=P+(U<<11&4294967295|U>>>21),U=R+(V^P^D)+A[15]+530742520&4294967295,R=V+(U<<16&4294967295|U>>>16),U=D+(R^V^P)+A[2]+3299628645&4294967295,D=R+(U<<23&4294967295|U>>>9),U=P+(R^(D|~V))+A[0]+4096336452&4294967295,P=D+(U<<6&4294967295|U>>>26),U=V+(D^(P|~R))+A[7]+1126891415&4294967295,V=P+(U<<10&4294967295|U>>>22),U=R+(P^(V|~D))+A[14]+2878612391&4294967295,R=V+(U<<15&4294967295|U>>>17),U=D+(V^(R|~P))+A[5]+4237533241&4294967295,D=R+(U<<21&4294967295|U>>>11),U=P+(R^(D|~V))+A[12]+1700485571&4294967295,P=D+(U<<6&4294967295|U>>>26),U=V+(D^(P|~R))+A[3]+2399980690&4294967295,V=P+(U<<10&4294967295|U>>>22),U=R+(P^(V|~D))+A[10]+4293915773&4294967295,R=V+(U<<15&4294967295|U>>>17),U=D+(V^(R|~P))+A[1]+2240044497&4294967295,D=R+(U<<21&4294967295|U>>>11),U=P+(R^(D|~V))+A[8]+1873313359&4294967295,P=D+(U<<6&4294967295|U>>>26),U=V+(D^(P|~R))+A[15]+4264355552&4294967295,V=P+(U<<10&4294967295|U>>>22),U=R+(P^(V|~D))+A[6]+2734768916&4294967295,R=V+(U<<15&4294967295|U>>>17),U=D+(V^(R|~P))+A[13]+1309151649&4294967295,D=R+(U<<21&4294967295|U>>>11),U=P+(R^(D|~V))+A[4]+4149444226&4294967295,P=D+(U<<6&4294967295|U>>>26),U=V+(D^(P|~R))+A[11]+3174756917&4294967295,V=P+(U<<10&4294967295|U>>>22),U=R+(P^(V|~D))+A[2]+718787259&4294967295,R=V+(U<<15&4294967295|U>>>17),U=D+(V^(R|~P))+A[9]+3951481745&4294967295,I.g[0]=I.g[0]+P&4294967295,I.g[1]=I.g[1]+(R+(U<<21&4294967295|U>>>11))&4294967295,I.g[2]=I.g[2]+R&4294967295,I.g[3]=I.g[3]+V&4294967295}i.prototype.u=function(I,P){P===void 0&&(P=I.length);for(var D=P-this.blockSize,A=this.B,R=this.h,V=0;Vthis.h?this.blockSize:2*this.blockSize)-this.h);I[0]=128;for(var P=1;PP;++P)for(var A=0;32>A;A+=8)I[D++]=this.g[P]>>>A&255;return I};function s(I,P){var D=a;return Object.prototype.hasOwnProperty.call(D,I)?D[I]:D[I]=P(I)}function o(I,P){this.h=P;for(var D=[],A=!0,R=I.length-1;0<=R;R--){var V=I[R]|0;A&&V==P||(D[R]=V,A=!1)}this.g=D}var a={};function l(I){return-128<=I&&128>I?s(I,function(P){return new o([P|0],0>P?-1:0)}):new o([I|0],0>I?-1:0)}function c(I){if(isNaN(I)||!isFinite(I))return f;if(0>I)return x(c(-I));for(var P=[],D=1,A=0;I>=D;A++)P[A]=I/D|0,D*=4294967296;return new o(P,0)}function d(I,P){if(I.length==0)throw Error("number format error: empty string");if(P=P||10,2>P||36V?(V=c(Math.pow(P,V)),A=A.j(V).add(c(U))):(A=A.j(D),A=A.add(c(U)))}return A}var f=l(0),p=l(1),m=l(16777216);n=o.prototype,n.m=function(){if(S(this))return-x(this).m();for(var I=0,P=1,D=0;DI||36>>0).toString(I);if(D=R,_(D))return V+A;for(;6>V.length;)V="0"+V;A=V+A}},n.i=function(I){return 0>I?0:I>>16)+(this.i(R)>>>16)+(I.i(R)>>>16);A=U>>>16,V&=65535,U&=65535,D[R]=U<<16|V}return new o(D,D[D.length-1]&-2147483648?-1:0)};function y(I,P){return I.add(x(P))}n.j=function(I){if(_(this)||_(I))return f;if(S(this))return S(I)?x(this).j(x(I)):x(x(this).j(I));if(S(I))return x(this.j(x(I)));if(0>this.l(m)&&0>I.l(m))return c(this.m()*I.m());for(var P=this.g.length+I.g.length,D=[],A=0;A<2*P;A++)D[A]=0;for(A=0;A>>16,U=this.i(A)&65535,se=I.i(R)>>>16,le=I.i(R)&65535;D[2*A+2*R]+=U*le,E(D,2*A+2*R),D[2*A+2*R+1]+=V*le,E(D,2*A+2*R+1),D[2*A+2*R+1]+=U*se,E(D,2*A+2*R+1),D[2*A+2*R+2]+=V*se,E(D,2*A+2*R+2)}for(A=0;A>>16,I[P]&=65535,P++}function w(I,P){this.g=I,this.h=P}function M(I,P){if(_(P))throw Error("division by zero");if(_(I))return new w(f,f);if(S(I))return P=M(x(I),P),new w(x(P.g),x(P.h));if(S(P))return P=M(I,x(P)),new w(x(P.g),P.h);if(30=A.l(I);)D=O(D),A=O(A);var R=k(D,1),V=k(A,1);for(A=k(A,2),D=k(D,2);!_(A);){var U=V.add(A);0>=U.l(I)&&(R=R.add(D),V=U),A=k(A,1),D=k(D,1)}return P=y(I,R.j(P)),new w(R,P)}for(R=f;0<=I.l(P);){for(D=Math.max(1,Math.floor(I.m()/P.m())),A=Math.ceil(Math.log(D)/Math.LN2),A=48>=A?1:Math.pow(2,A-48),V=c(D),U=V.j(P);S(U)||0>>31;return new o(D,I.h)}function k(I,P){var D=P>>5;P%=32;for(var A=I.g.length-D,R=[],V=0;V>>P|I.i(V+D+1)<<32-P:I.i(V+D);return new o(R,I.h)}i.prototype.digest=i.prototype.v,i.prototype.reset=i.prototype.s,i.prototype.update=i.prototype.u,iU=i,o.prototype.add=o.prototype.add,o.prototype.multiply=o.prototype.j,o.prototype.modulo=o.prototype.A,o.prototype.compare=o.prototype.l,o.prototype.toNumber=o.prototype.m,o.prototype.toString=o.prototype.toString,o.prototype.getBits=o.prototype.i,o.fromNumber=c,o.fromString=d,Wc=o}).apply(typeof VI<"u"?VI:typeof self<"u"?self:typeof window<"u"?window:{});var cy=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/** @license +*/function e(I,P){function D(){}D.prototype=P.prototype,I.D=P.prototype,I.prototype=new D,I.prototype.constructor=I,I.C=function(A,R,V){for(var U=Array(arguments.length-2),se=2;seR;++R)A[R]=P.charCodeAt(D++)|P.charCodeAt(D++)<<8|P.charCodeAt(D++)<<16|P.charCodeAt(D++)<<24;else for(R=0;16>R;++R)A[R]=P[D++]|P[D++]<<8|P[D++]<<16|P[D++]<<24;P=I.g[0],D=I.g[1],R=I.g[2];var V=I.g[3],U=P+(V^D&(R^V))+A[0]+3614090360&4294967295;P=D+(U<<7&4294967295|U>>>25),U=V+(R^P&(D^R))+A[1]+3905402710&4294967295,V=P+(U<<12&4294967295|U>>>20),U=R+(D^V&(P^D))+A[2]+606105819&4294967295,R=V+(U<<17&4294967295|U>>>15),U=D+(P^R&(V^P))+A[3]+3250441966&4294967295,D=R+(U<<22&4294967295|U>>>10),U=P+(V^D&(R^V))+A[4]+4118548399&4294967295,P=D+(U<<7&4294967295|U>>>25),U=V+(R^P&(D^R))+A[5]+1200080426&4294967295,V=P+(U<<12&4294967295|U>>>20),U=R+(D^V&(P^D))+A[6]+2821735955&4294967295,R=V+(U<<17&4294967295|U>>>15),U=D+(P^R&(V^P))+A[7]+4249261313&4294967295,D=R+(U<<22&4294967295|U>>>10),U=P+(V^D&(R^V))+A[8]+1770035416&4294967295,P=D+(U<<7&4294967295|U>>>25),U=V+(R^P&(D^R))+A[9]+2336552879&4294967295,V=P+(U<<12&4294967295|U>>>20),U=R+(D^V&(P^D))+A[10]+4294925233&4294967295,R=V+(U<<17&4294967295|U>>>15),U=D+(P^R&(V^P))+A[11]+2304563134&4294967295,D=R+(U<<22&4294967295|U>>>10),U=P+(V^D&(R^V))+A[12]+1804603682&4294967295,P=D+(U<<7&4294967295|U>>>25),U=V+(R^P&(D^R))+A[13]+4254626195&4294967295,V=P+(U<<12&4294967295|U>>>20),U=R+(D^V&(P^D))+A[14]+2792965006&4294967295,R=V+(U<<17&4294967295|U>>>15),U=D+(P^R&(V^P))+A[15]+1236535329&4294967295,D=R+(U<<22&4294967295|U>>>10),U=P+(R^V&(D^R))+A[1]+4129170786&4294967295,P=D+(U<<5&4294967295|U>>>27),U=V+(D^R&(P^D))+A[6]+3225465664&4294967295,V=P+(U<<9&4294967295|U>>>23),U=R+(P^D&(V^P))+A[11]+643717713&4294967295,R=V+(U<<14&4294967295|U>>>18),U=D+(V^P&(R^V))+A[0]+3921069994&4294967295,D=R+(U<<20&4294967295|U>>>12),U=P+(R^V&(D^R))+A[5]+3593408605&4294967295,P=D+(U<<5&4294967295|U>>>27),U=V+(D^R&(P^D))+A[10]+38016083&4294967295,V=P+(U<<9&4294967295|U>>>23),U=R+(P^D&(V^P))+A[15]+3634488961&4294967295,R=V+(U<<14&4294967295|U>>>18),U=D+(V^P&(R^V))+A[4]+3889429448&4294967295,D=R+(U<<20&4294967295|U>>>12),U=P+(R^V&(D^R))+A[9]+568446438&4294967295,P=D+(U<<5&4294967295|U>>>27),U=V+(D^R&(P^D))+A[14]+3275163606&4294967295,V=P+(U<<9&4294967295|U>>>23),U=R+(P^D&(V^P))+A[3]+4107603335&4294967295,R=V+(U<<14&4294967295|U>>>18),U=D+(V^P&(R^V))+A[8]+1163531501&4294967295,D=R+(U<<20&4294967295|U>>>12),U=P+(R^V&(D^R))+A[13]+2850285829&4294967295,P=D+(U<<5&4294967295|U>>>27),U=V+(D^R&(P^D))+A[2]+4243563512&4294967295,V=P+(U<<9&4294967295|U>>>23),U=R+(P^D&(V^P))+A[7]+1735328473&4294967295,R=V+(U<<14&4294967295|U>>>18),U=D+(V^P&(R^V))+A[12]+2368359562&4294967295,D=R+(U<<20&4294967295|U>>>12),U=P+(D^R^V)+A[5]+4294588738&4294967295,P=D+(U<<4&4294967295|U>>>28),U=V+(P^D^R)+A[8]+2272392833&4294967295,V=P+(U<<11&4294967295|U>>>21),U=R+(V^P^D)+A[11]+1839030562&4294967295,R=V+(U<<16&4294967295|U>>>16),U=D+(R^V^P)+A[14]+4259657740&4294967295,D=R+(U<<23&4294967295|U>>>9),U=P+(D^R^V)+A[1]+2763975236&4294967295,P=D+(U<<4&4294967295|U>>>28),U=V+(P^D^R)+A[4]+1272893353&4294967295,V=P+(U<<11&4294967295|U>>>21),U=R+(V^P^D)+A[7]+4139469664&4294967295,R=V+(U<<16&4294967295|U>>>16),U=D+(R^V^P)+A[10]+3200236656&4294967295,D=R+(U<<23&4294967295|U>>>9),U=P+(D^R^V)+A[13]+681279174&4294967295,P=D+(U<<4&4294967295|U>>>28),U=V+(P^D^R)+A[0]+3936430074&4294967295,V=P+(U<<11&4294967295|U>>>21),U=R+(V^P^D)+A[3]+3572445317&4294967295,R=V+(U<<16&4294967295|U>>>16),U=D+(R^V^P)+A[6]+76029189&4294967295,D=R+(U<<23&4294967295|U>>>9),U=P+(D^R^V)+A[9]+3654602809&4294967295,P=D+(U<<4&4294967295|U>>>28),U=V+(P^D^R)+A[12]+3873151461&4294967295,V=P+(U<<11&4294967295|U>>>21),U=R+(V^P^D)+A[15]+530742520&4294967295,R=V+(U<<16&4294967295|U>>>16),U=D+(R^V^P)+A[2]+3299628645&4294967295,D=R+(U<<23&4294967295|U>>>9),U=P+(R^(D|~V))+A[0]+4096336452&4294967295,P=D+(U<<6&4294967295|U>>>26),U=V+(D^(P|~R))+A[7]+1126891415&4294967295,V=P+(U<<10&4294967295|U>>>22),U=R+(P^(V|~D))+A[14]+2878612391&4294967295,R=V+(U<<15&4294967295|U>>>17),U=D+(V^(R|~P))+A[5]+4237533241&4294967295,D=R+(U<<21&4294967295|U>>>11),U=P+(R^(D|~V))+A[12]+1700485571&4294967295,P=D+(U<<6&4294967295|U>>>26),U=V+(D^(P|~R))+A[3]+2399980690&4294967295,V=P+(U<<10&4294967295|U>>>22),U=R+(P^(V|~D))+A[10]+4293915773&4294967295,R=V+(U<<15&4294967295|U>>>17),U=D+(V^(R|~P))+A[1]+2240044497&4294967295,D=R+(U<<21&4294967295|U>>>11),U=P+(R^(D|~V))+A[8]+1873313359&4294967295,P=D+(U<<6&4294967295|U>>>26),U=V+(D^(P|~R))+A[15]+4264355552&4294967295,V=P+(U<<10&4294967295|U>>>22),U=R+(P^(V|~D))+A[6]+2734768916&4294967295,R=V+(U<<15&4294967295|U>>>17),U=D+(V^(R|~P))+A[13]+1309151649&4294967295,D=R+(U<<21&4294967295|U>>>11),U=P+(R^(D|~V))+A[4]+4149444226&4294967295,P=D+(U<<6&4294967295|U>>>26),U=V+(D^(P|~R))+A[11]+3174756917&4294967295,V=P+(U<<10&4294967295|U>>>22),U=R+(P^(V|~D))+A[2]+718787259&4294967295,R=V+(U<<15&4294967295|U>>>17),U=D+(V^(R|~P))+A[9]+3951481745&4294967295,I.g[0]=I.g[0]+P&4294967295,I.g[1]=I.g[1]+(R+(U<<21&4294967295|U>>>11))&4294967295,I.g[2]=I.g[2]+R&4294967295,I.g[3]=I.g[3]+V&4294967295}i.prototype.u=function(I,P){P===void 0&&(P=I.length);for(var D=P-this.blockSize,A=this.B,R=this.h,V=0;Vthis.h?this.blockSize:2*this.blockSize)-this.h);I[0]=128;for(var P=1;PP;++P)for(var A=0;32>A;A+=8)I[D++]=this.g[P]>>>A&255;return I};function s(I,P){var D=a;return Object.prototype.hasOwnProperty.call(D,I)?D[I]:D[I]=P(I)}function o(I,P){this.h=P;for(var D=[],A=!0,R=I.length-1;0<=R;R--){var V=I[R]|0;A&&V==P||(D[R]=V,A=!1)}this.g=D}var a={};function l(I){return-128<=I&&128>I?s(I,function(P){return new o([P|0],0>P?-1:0)}):new o([I|0],0>I?-1:0)}function c(I){if(isNaN(I)||!isFinite(I))return f;if(0>I)return x(c(-I));for(var P=[],D=1,A=0;I>=D;A++)P[A]=I/D|0,D*=4294967296;return new o(P,0)}function d(I,P){if(I.length==0)throw Error("number format error: empty string");if(P=P||10,2>P||36V?(V=c(Math.pow(P,V)),A=A.j(V).add(c(U))):(A=A.j(D),A=A.add(c(U)))}return A}var f=l(0),p=l(1),m=l(16777216);n=o.prototype,n.m=function(){if(S(this))return-x(this).m();for(var I=0,P=1,D=0;DI||36>>0).toString(I);if(D=R,_(D))return V+A;for(;6>V.length;)V="0"+V;A=V+A}},n.i=function(I){return 0>I?0:I>>16)+(this.i(R)>>>16)+(I.i(R)>>>16);A=U>>>16,V&=65535,U&=65535,D[R]=U<<16|V}return new o(D,D[D.length-1]&-2147483648?-1:0)};function y(I,P){return I.add(x(P))}n.j=function(I){if(_(this)||_(I))return f;if(S(this))return S(I)?x(this).j(x(I)):x(x(this).j(I));if(S(I))return x(this.j(x(I)));if(0>this.l(m)&&0>I.l(m))return c(this.m()*I.m());for(var P=this.g.length+I.g.length,D=[],A=0;A<2*P;A++)D[A]=0;for(A=0;A>>16,U=this.i(A)&65535,se=I.i(R)>>>16,le=I.i(R)&65535;D[2*A+2*R]+=U*le,E(D,2*A+2*R),D[2*A+2*R+1]+=V*le,E(D,2*A+2*R+1),D[2*A+2*R+1]+=U*se,E(D,2*A+2*R+1),D[2*A+2*R+2]+=V*se,E(D,2*A+2*R+2)}for(A=0;A>>16,I[P]&=65535,P++}function w(I,P){this.g=I,this.h=P}function M(I,P){if(_(P))throw Error("division by zero");if(_(I))return new w(f,f);if(S(I))return P=M(x(I),P),new w(x(P.g),x(P.h));if(S(P))return P=M(I,x(P)),new w(x(P.g),P.h);if(30=A.l(I);)D=O(D),A=O(A);var R=k(D,1),V=k(A,1);for(A=k(A,2),D=k(D,2);!_(A);){var U=V.add(A);0>=U.l(I)&&(R=R.add(D),V=U),A=k(A,1),D=k(D,1)}return P=y(I,R.j(P)),new w(R,P)}for(R=f;0<=I.l(P);){for(D=Math.max(1,Math.floor(I.m()/P.m())),A=Math.ceil(Math.log(D)/Math.LN2),A=48>=A?1:Math.pow(2,A-48),V=c(D),U=V.j(P);S(U)||0>>31;return new o(D,I.h)}function k(I,P){var D=P>>5;P%=32;for(var A=I.g.length-D,R=[],V=0;V>>P|I.i(V+D+1)<<32-P:I.i(V+D);return new o(R,I.h)}i.prototype.digest=i.prototype.v,i.prototype.reset=i.prototype.s,i.prototype.update=i.prototype.u,rU=i,o.prototype.add=o.prototype.add,o.prototype.multiply=o.prototype.j,o.prototype.modulo=o.prototype.A,o.prototype.compare=o.prototype.l,o.prototype.toNumber=o.prototype.m,o.prototype.toString=o.prototype.toString,o.prototype.getBits=o.prototype.i,o.fromNumber=c,o.fromString=d,Wc=o}).apply(typeof VI<"u"?VI:typeof self<"u"?self:typeof window<"u"?window:{});var cy=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/** @license Copyright The Closure Library Authors. SPDX-License-Identifier: Apache-2.0 -*/var rU,Xf,sU,Ev,$E,oU,aU,lU;(function(){var n,e=typeof Object.defineProperties=="function"?Object.defineProperty:function(g,C,L){return g==Array.prototype||g==Object.prototype||(g[C]=L.value),g};function t(g){g=[typeof globalThis=="object"&&globalThis,g,typeof window=="object"&&window,typeof self=="object"&&self,typeof cy=="object"&&cy];for(var C=0;CC.length?de:(C=C.slice(z,z+L),g.C=z+L,C)))}H.prototype.cancel=function(){this.J=!0,zt(this)};function it(g){g.S=Date.now()+g.I,_t(g,g.I)}function _t(g,C){if(g.B!=null)throw Error("WatchDog timer not null");g.B=ss(p(g.ba,g),C)}function xt(g){g.B&&(a.clearTimeout(g.B),g.B=null)}H.prototype.ba=function(){this.B=null;const g=Date.now();0<=g-this.S?(Sa(this.i,this.A),this.L!=2&&(kn(),si(17)),zt(this),this.s=2,ut(this)):_t(this,this.S-g)};function ut(g){g.j.G==0||g.J||Ql(g.j,g)}function zt(g){xt(g);var C=g.M;C&&typeof C.ma=="function"&&C.ma(),g.M=null,K(g.U),g.g&&(C=g.g,g.g=null,C.abort(),C.ma())}function Yt(g,C){try{var L=g.j;if(L.G!=0&&(L.g==g||qt(L.h,g))){if(!g.K&&qt(L.h,g)&&L.G==3){try{var z=L.Da.g.parse(C)}catch{z=null}if(Array.isArray(z)&&z.length==3){var ne=z;if(ne[0]==0){e:if(!L.u){if(L.g)if(L.g.F+3e3ne[2]&&L.F&&L.v==0&&!L.C&&(L.C=ss(p(L.Za,L),6e3));if(1>=ot(L.h)&&L.ca){try{L.ca()}catch{}L.ca=void 0}}else no(L,11)}else if((g.K||L.g==g)&&Kl(L),!E(C))for(ne=L.Da.g.parse(C),C=0;C=g.j:!1}function ot(g){return g.h?1:g.g?g.g.size:0}function qt(g,C){return g.h?g.h==C:g.g?g.g.has(C):!1}function Mt(g,C){g.g?g.g.add(C):g.h=C}function Gn(g,C){g.h&&g.h==C?g.h=null:g.g&&g.g.has(C)&&g.g.delete(C)}Ot.prototype.cancel=function(){if(this.i=Ui(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&this.g.size!==0){for(const g of this.g.values())g.cancel();this.g.clear()}};function Ui(g){if(g.h!=null)return g.i.concat(g.h.D);if(g.g!=null&&g.g.size!==0){let C=g.i;for(const L of g.g.values())C=C.concat(L.D);return C}return S(g.i)}function dn(g){if(g.V&&typeof g.V=="function")return g.V();if(typeof Map<"u"&&g instanceof Map||typeof Set<"u"&&g instanceof Set)return Array.from(g.values());if(typeof g=="string")return g.split("");if(l(g)){for(var C=[],L=g.length,z=0;zC)throw Error("Bad port number "+C);g.s=C}else g.s=null}function ng(g,C,L){C instanceof Po?(g.i=C,Gx(g.i,g.h)):(L||(C=eo(C,jl)),g.i=new Po(C,g.h))}function fn(g,C,L){g.i.set(C,L)}function bo(g){return fn(g,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),g}function bs(g,C){return g?C?decodeURI(g.replace(/%25/g,"%2525")):decodeURIComponent(g):""}function eo(g,C,L){return typeof g=="string"?(g=encodeURI(g).replace(C,zx),L&&(g=g.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),g):null}function zx(g){return g=g.charCodeAt(0),"%"+(g>>4&15).toString(16)+(g&15).toString(16)}var ig=/[#\/\?@]/g,Ud=/[#\?:]/g,Fd=/[#\?]/g,jl=/[#\?@]/g,Hx=/#/g;function Po(g,C){this.h=this.g=null,this.i=g||null,this.j=!!C}function Ht(g){g.g||(g.g=new Map,g.h=0,g.i&&Zs(g.i,function(C,L){g.add(decodeURIComponent(C.replace(/\+/g," ")),L)}))}n=Po.prototype,n.add=function(g,C){Ht(this),this.i=null,g=Ta(this,g);var L=this.g.get(g);return L||this.g.set(g,L=[]),L.push(C),this.h+=1,this};function Vd(g,C){Ht(g),C=Ta(g,C),g.g.has(C)&&(g.i=null,g.h-=g.g.get(C).length,g.g.delete(C))}function Mu(g,C){return Ht(g),C=Ta(g,C),g.g.has(C)}n.forEach=function(g,C){Ht(this),this.g.forEach(function(L,z){L.forEach(function(ne){g.call(C,ne,z,this)},this)},this)},n.na=function(){Ht(this);const g=Array.from(this.g.values()),C=Array.from(this.g.keys()),L=[];for(let z=0;z{z.abort(),to(L,"TestPingServer: timeout",!1,C)},1e4);fetch(g,{signal:z.signal}).then(fe=>{clearTimeout(ne),fe.ok?to(L,"TestPingServer: ok",!0,C):to(L,"TestPingServer: server error",!1,C)}).catch(()=>{clearTimeout(ne),to(L,"TestPingServer: error",!1,C)})}function to(g,C,L,z,ne){try{ne&&(ne.onload=null,ne.onerror=null,ne.onabort=null,ne.ontimeout=null),z(L)}catch{}}function Hd(){this.g=new Y}function Wx(g,C,L){const z=L||"";try{_n(g,function(ne,fe){let ze=ne;c(ne)&&(ze=ve(ne)),C.push(z+fe+"="+encodeURIComponent(ze))})}catch(ne){throw C.push(z+"type="+encodeURIComponent("_badmap")),ne}}function Ro(g){this.l=g.Ub||null,this.j=g.eb||!1}_(Ro,Fe),Ro.prototype.g=function(){return new ar(this.l,this.j)},Ro.prototype.i=function(g){return function(){return g}}({});function ar(g,C){Ce.call(this),this.D=g,this.o=C,this.m=void 0,this.status=this.readyState=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.u=new Headers,this.h=null,this.B="GET",this.A="",this.g=!1,this.v=this.j=this.l=null}_(ar,Ce),n=ar.prototype,n.open=function(g,C){if(this.readyState!=0)throw this.abort(),Error("Error reopening a connection");this.B=g,this.A=C,this.readyState=1,Fi(this)},n.send=function(g){if(this.readyState!=1)throw this.abort(),Error("need to call open() first. ");this.g=!0;const C={headers:this.u,method:this.B,credentials:this.m,cache:void 0};g&&(C.body=g),(this.D||a).fetch(new Request(this.A,C)).then(this.Sa.bind(this),this.ga.bind(this))},n.abort=function(){this.response=this.responseText="",this.u=new Headers,this.status=0,this.j&&this.j.cancel("Request was aborted.").catch(()=>{}),1<=this.readyState&&this.g&&this.readyState!=4&&(this.g=!1,Xl(this)),this.readyState=0},n.Sa=function(g){if(this.g&&(this.l=g,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=g.headers,this.readyState=2,Fi(this)),this.g&&(this.readyState=3,Fi(this),this.g)))if(this.responseType==="arraybuffer")g.arrayBuffer().then(this.Qa.bind(this),this.ga.bind(this));else if(typeof a.ReadableStream<"u"&&"body"in g){if(this.j=g.body.getReader(),this.o){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.v=new TextDecoder;rg(this)}else g.text().then(this.Ra.bind(this),this.ga.bind(this))};function rg(g){g.j.read().then(g.Pa.bind(g)).catch(g.ga.bind(g))}n.Pa=function(g){if(this.g){if(this.o&&g.value)this.response.push(g.value);else if(!this.o){var C=g.value?g.value:new Uint8Array(0);(C=this.v.decode(C,{stream:!g.done}))&&(this.response=this.responseText+=C)}g.done?Xl(this):Fi(this),this.readyState==3&&rg(this)}},n.Ra=function(g){this.g&&(this.response=this.responseText=g,Xl(this))},n.Qa=function(g){this.g&&(this.response=g,Xl(this))},n.ga=function(){this.g&&Xl(this)};function Xl(g){g.readyState=4,g.l=null,g.j=null,g.v=null,Fi(g)}n.setRequestHeader=function(g,C){this.u.append(g,C)},n.getResponseHeader=function(g){return this.h&&this.h.get(g.toLowerCase())||""},n.getAllResponseHeaders=function(){if(!this.h)return"";const g=[],C=this.h.entries();for(var L=C.next();!L.done;)L=L.value,g.push(L[0]+": "+L[1]),L=C.next();return g.join(`\r `)};function Fi(g){g.onreadystatechange&&g.onreadystatechange.call(g)}Object.defineProperty(ar.prototype,"withCredentials",{get:function(){return this.m==="include"},set:function(g){this.m=g?"include":"same-origin"}});function ls(g){let C="";return k(g,function(L,z){C+=z,C+=":",C+=L,C+=`\r `}),C}function Aa(g,C,L){e:{for(z in L){var z=!1;break e}z=!0}z||(L=ls(L),typeof g=="string"?L!=null&&encodeURIComponent(String(L)):fn(g,C,L))}function wn(g){Ce.call(this),this.headers=new Map,this.o=g||null,this.h=!1,this.v=this.g=null,this.D="",this.m=0,this.l="",this.j=this.B=this.u=this.A=!1,this.I=null,this.H="",this.J=!1}_(wn,Ce);var sg=/^https?$/i,jx=["POST","PUT"];n=wn.prototype,n.Ha=function(g){this.J=g},n.ea=function(g,C,L,z){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+g);C=C?C.toUpperCase():"GET",this.D=g,this.l="",this.m=0,this.A=!1,this.h=!0,this.g=this.o?this.o.g():Wl.g(),this.v=this.o?me(this.o):me(Wl),this.g.onreadystatechange=p(this.Ea,this);try{this.B=!0,this.g.open(C,String(g),!0),this.B=!1}catch(fe){Hr(this,fe);return}if(g=L||"",L=new Map(this.headers),z)if(Object.getPrototypeOf(z)===Object.prototype)for(var ne in z)L.set(ne,z[ne]);else if(typeof z.keys=="function"&&typeof z.get=="function")for(const fe of z.keys())L.set(fe,z.get(fe));else throw Error("Unknown input type for opt_headers: "+String(z));z=Array.from(L.keys()).find(fe=>fe.toLowerCase()=="content-type"),ne=a.FormData&&g instanceof a.FormData,!(0<=Array.prototype.indexOf.call(jx,C,void 0))||z||ne||L.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[fe,ze]of L)this.g.setRequestHeader(fe,ze);this.H&&(this.g.responseType=this.H),"withCredentials"in this.g&&this.g.withCredentials!==this.J&&(this.g.withCredentials=this.J);try{Tr(this),this.u=!0,this.g.send(g),this.u=!1}catch(fe){Hr(this,fe)}};function Hr(g,C){g.h=!1,g.g&&(g.j=!0,g.g.abort(),g.j=!1),g.l=C,g.m=5,og(g),Cu(g)}function og(g){g.A||(g.A=!0,Ge(g,"complete"),Ge(g,"error"))}n.abort=function(g){this.g&&this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1,this.m=g||7,Ge(this,"complete"),Ge(this,"abort"),Cu(this))},n.N=function(){this.g&&(this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1),Cu(this,!0)),wn.aa.N.call(this)},n.Ea=function(){this.s||(this.B||this.u||this.j?ql(this):this.bb())},n.bb=function(){ql(this)};function ql(g){if(g.h&&typeof o<"u"&&(!g.v[1]||Ar(g)!=4||g.Z()!=2)){if(g.u&&Ar(g)==4)Le(g.Ea,0,g);else if(Ge(g,"readystatechange"),Ar(g)==4){g.h=!1;try{const ze=g.Z();e:switch(ze){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var C=!0;break e;default:C=!1}var L;if(!(L=C)){var z;if(z=ze===0){var ne=String(g.D).match(Er)[1]||null;!ne&&a.self&&a.self.location&&(ne=a.self.location.protocol.slice(0,-1)),z=!sg.test(ne?ne.toLowerCase():"")}L=z}if(L)Ge(g,"complete"),Ge(g,"success");else{g.m=6;try{var fe=2{}:null;g.g=null,g.v=null,C||Ge(g,"ready");try{L.onreadystatechange=z}catch{}}}function Tr(g){g.I&&(a.clearTimeout(g.I),g.I=null)}n.isActive=function(){return!!this.g};function Ar(g){return g.g?g.g.readyState:0}n.Z=function(){try{return 2=g.h.j-(g.s?1:0)?!1:g.s?(g.i=C.D.concat(g.i),!0):g.G==1||g.G==2||g.B>=(g.Va?0:g.Wa)?!1:(g.s=ss(p(g.Ga,g,C),Wd(g,g.B)),g.B++,!0)}n.Ga=function(g){if(this.s)if(this.s=null,this.G==1){if(!g){this.U=Math.floor(1e5*Math.random()),g=this.U++;const ne=new H(this,this.j,g);let fe=this.o;if(this.S&&(fe?(fe=P(fe),A(fe,this.S)):fe=this.S),this.m!==null||this.O||(ne.H=fe,fe=null),this.P)e:{for(var C=0,L=0;LKt)fe=Math.max(0,ne[Qn].g-100),pn=!1;else try{Wx(mn,ze,"req"+Kt+"_")}catch{z&&z(mn)}}if(pn){z=ze.join("&");break e}}}return g=g.i.splice(0,L),C.D=g,z}function Gd(g){if(!g.g&&!g.u){g.Y=1;var C=g.Fa;pe||Z(),W||(pe(),W=!0),J.add(C,g),g.v=0}}function Wr(g){return g.g||g.u||3<=g.v?!1:(g.Y++,g.u=ss(p(g.Fa,g),Wd(g,g.v)),g.v++,!0)}n.Fa=function(){if(this.u=null,Yl(this),this.ba&&!(this.M||this.g==null||0>=this.R)){var g=2*this.R;this.j.info("BP detection timer enabled: "+g),this.A=ss(p(this.ab,this),g)}},n.ab=function(){this.A&&(this.A=null,this.j.info("BP detection timeout reached."),this.j.info("Buffering proxy detected and switch to long-polling!"),this.F=!1,this.M=!0,si(10),Ca(this),Yl(this))};function cs(g){g.A!=null&&(a.clearTimeout(g.A),g.A=null)}function Yl(g){g.g=new H(g,g.j,"rpc",g.Y),g.m===null&&(g.g.H=g.o),g.g.O=0;var C=bn(g.qa);fn(C,"RID","rpc"),fn(C,"SID",g.K),fn(C,"AID",g.T),fn(C,"CI",g.F?"0":"1"),!g.F&&g.ja&&fn(C,"TO",g.ja),fn(C,"TYPE","xmlhttp"),Cr(g,C),g.m&&g.o&&Aa(C,g.m,g.o),g.L&&(g.g.I=g.L);var L=g.g;g=g.ia,L.L=1,L.v=bo(bn(C)),L.m=null,L.P=!0,Be(L,g)}n.Za=function(){this.C!=null&&(this.C=null,Ca(this),Wr(this),si(19))};function Kl(g){g.C!=null&&(a.clearTimeout(g.C),g.C=null)}function Ql(g,C){var L=null;if(g.g==C){Kl(g),cs(g),g.g=null;var z=2}else if(qt(g.h,C))L=C.D,Gn(g.h,C),z=1;else return;if(g.G!=0){if(C.o)if(z==1){L=C.m?C.m.length:0,C=Date.now()-C.F;var ne=g.B;z=It(),Ge(z,new rs(z,L)),Ps(g)}else Gd(g);else if(ne=C.s,ne==3||ne==0&&0=g.h.j-(g.s?1:0)?!1:g.s?(g.i=C.D.concat(g.i),!0):g.G==1||g.G==2||g.B>=(g.Va?0:g.Wa)?!1:(g.s=ss(p(g.Ga,g,C),Wd(g,g.B)),g.B++,!0)}n.Ga=function(g){if(this.s)if(this.s=null,this.G==1){if(!g){this.U=Math.floor(1e5*Math.random()),g=this.U++;const ne=new H(this,this.j,g);let fe=this.o;if(this.S&&(fe?(fe=P(fe),A(fe,this.S)):fe=this.S),this.m!==null||this.O||(ne.H=fe,fe=null),this.P)e:{for(var C=0,L=0;LKt)fe=Math.max(0,ne[Qn].g-100),pn=!1;else try{Wx(mn,ze,"req"+Kt+"_")}catch{z&&z(mn)}}if(pn){z=ze.join("&");break e}}}return g=g.i.splice(0,L),C.D=g,z}function Gd(g){if(!g.g&&!g.u){g.Y=1;var C=g.Fa;pe||Z(),W||(pe(),W=!0),J.add(C,g),g.v=0}}function Wr(g){return g.g||g.u||3<=g.v?!1:(g.Y++,g.u=ss(p(g.Fa,g),Wd(g,g.v)),g.v++,!0)}n.Fa=function(){if(this.u=null,Yl(this),this.ba&&!(this.M||this.g==null||0>=this.R)){var g=2*this.R;this.j.info("BP detection timer enabled: "+g),this.A=ss(p(this.ab,this),g)}},n.ab=function(){this.A&&(this.A=null,this.j.info("BP detection timeout reached."),this.j.info("Buffering proxy detected and switch to long-polling!"),this.F=!1,this.M=!0,si(10),Ca(this),Yl(this))};function cs(g){g.A!=null&&(a.clearTimeout(g.A),g.A=null)}function Yl(g){g.g=new H(g,g.j,"rpc",g.Y),g.m===null&&(g.g.H=g.o),g.g.O=0;var C=bn(g.qa);fn(C,"RID","rpc"),fn(C,"SID",g.K),fn(C,"AID",g.T),fn(C,"CI",g.F?"0":"1"),!g.F&&g.ja&&fn(C,"TO",g.ja),fn(C,"TYPE","xmlhttp"),Cr(g,C),g.m&&g.o&&Aa(C,g.m,g.o),g.L&&(g.g.I=g.L);var L=g.g;g=g.ia,L.L=1,L.v=bo(bn(C)),L.m=null,L.P=!0,Be(L,g)}n.Za=function(){this.C!=null&&(this.C=null,Ca(this),Wr(this),si(19))};function Kl(g){g.C!=null&&(a.clearTimeout(g.C),g.C=null)}function Ql(g,C){var L=null;if(g.g==C){Kl(g),cs(g),g.g=null;var z=2}else if(qt(g.h,C))L=C.D,Gn(g.h,C),z=1;else return;if(g.G!=0){if(C.o)if(z==1){L=C.m?C.m.length:0,C=Date.now()-C.F;var ne=g.B;z=It(),Ge(z,new rs(z,L)),Ps(g)}else Gd(g);else if(ne=C.s,ne==3||ne==0&&0t(Qi.UNAUTHENTICATED))}shutdown(){}}class q7{constructor(e){this.token=e,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(e,t){this.changeListener=t,e.enqueueRetryable(()=>t(this.token.user))}shutdown(){this.changeListener=null}}class $7{constructor(e){this.t=e,this.currentUser=Qi.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(e,t){Kn(this.o===void 0);let i=this.i;const r=l=>this.i!==i?(i=this.i,t(l)):Promise.resolve();let s=new jc;this.o=()=>{this.i++,this.currentUser=this.u(),s.resolve(),s=new jc,e.enqueueRetryable(()=>r(this.currentUser))};const o=()=>{const l=s;e.enqueueRetryable(async()=>{await l.promise,await r(this.currentUser)})},a=l=>{pt("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=l,this.o&&(this.auth.addAuthTokenListener(this.o),o())};this.t.onInit(l=>a(l)),setTimeout(()=>{if(!this.auth){const l=this.t.getImmediate({optional:!0});l?a(l):(pt("FirebaseAuthCredentialsProvider","Auth not yet detected"),s.resolve(),s=new jc)}},0),o()}getToken(){const e=this.i,t=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(t).then(i=>this.i!==e?(pt("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):i?(Kn(typeof i.accessToken=="string"),new cU(i.accessToken,this.currentUser)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.o&&this.auth.removeAuthTokenListener(this.o),this.o=void 0}u(){const e=this.auth&&this.auth.getUid();return Kn(e===null||typeof e=="string"),new Qi(e)}}class Y7{constructor(e,t,i){this.l=e,this.h=t,this.P=i,this.type="FirstParty",this.user=Qi.FIRST_PARTY,this.I=new Map}T(){return this.P?this.P():null}get headers(){this.I.set("X-Goog-AuthUser",this.l);const e=this.T();return e&&this.I.set("Authorization",e),this.h&&this.I.set("X-Goog-Iam-Authorization-Token",this.h),this.I}}class K7{constructor(e,t,i){this.l=e,this.h=t,this.P=i}getToken(){return Promise.resolve(new Y7(this.l,this.h,this.P))}start(e,t){e.enqueueRetryable(()=>t(Qi.FIRST_PARTY))}shutdown(){}invalidateToken(){}}class Q7{constructor(e){this.value=e,this.type="AppCheck",this.headers=new Map,e&&e.length>0&&this.headers.set("x-firebase-appcheck",this.value)}}class J7{constructor(e){this.A=e,this.forceRefresh=!1,this.appCheck=null,this.R=null}start(e,t){Kn(this.o===void 0);const i=s=>{s.error!=null&&pt("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${s.error.message}`);const o=s.token!==this.R;return this.R=s.token,pt("FirebaseAppCheckTokenProvider",`Received ${o?"new":"existing"} token.`),o?t(s.token):Promise.resolve()};this.o=s=>{e.enqueueRetryable(()=>i(s))};const r=s=>{pt("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=s,this.o&&this.appCheck.addTokenListener(this.o)};this.A.onInit(s=>r(s)),setTimeout(()=>{if(!this.appCheck){const s=this.A.getImmediate({optional:!0});s?r(s):pt("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}},0)}getToken(){const e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then(t=>t?(Kn(typeof t.token=="string"),this.R=t.token,new Q7(t.token)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.o&&this.appCheck.removeTokenListener(this.o),this.o=void 0}}/** + */class uU{constructor(e,t){this.user=t,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${e}`)}}class X7{getToken(){return Promise.resolve(null)}invalidateToken(){}start(e,t){e.enqueueRetryable(()=>t(Qi.UNAUTHENTICATED))}shutdown(){}}class q7{constructor(e){this.token=e,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(e,t){this.changeListener=t,e.enqueueRetryable(()=>t(this.token.user))}shutdown(){this.changeListener=null}}class $7{constructor(e){this.t=e,this.currentUser=Qi.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(e,t){Kn(this.o===void 0);let i=this.i;const r=l=>this.i!==i?(i=this.i,t(l)):Promise.resolve();let s=new jc;this.o=()=>{this.i++,this.currentUser=this.u(),s.resolve(),s=new jc,e.enqueueRetryable(()=>r(this.currentUser))};const o=()=>{const l=s;e.enqueueRetryable(async()=>{await l.promise,await r(this.currentUser)})},a=l=>{pt("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=l,this.o&&(this.auth.addAuthTokenListener(this.o),o())};this.t.onInit(l=>a(l)),setTimeout(()=>{if(!this.auth){const l=this.t.getImmediate({optional:!0});l?a(l):(pt("FirebaseAuthCredentialsProvider","Auth not yet detected"),s.resolve(),s=new jc)}},0),o()}getToken(){const e=this.i,t=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(t).then(i=>this.i!==e?(pt("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):i?(Kn(typeof i.accessToken=="string"),new uU(i.accessToken,this.currentUser)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.o&&this.auth.removeAuthTokenListener(this.o),this.o=void 0}u(){const e=this.auth&&this.auth.getUid();return Kn(e===null||typeof e=="string"),new Qi(e)}}class Y7{constructor(e,t,i){this.l=e,this.h=t,this.P=i,this.type="FirstParty",this.user=Qi.FIRST_PARTY,this.I=new Map}T(){return this.P?this.P():null}get headers(){this.I.set("X-Goog-AuthUser",this.l);const e=this.T();return e&&this.I.set("Authorization",e),this.h&&this.I.set("X-Goog-Iam-Authorization-Token",this.h),this.I}}class K7{constructor(e,t,i){this.l=e,this.h=t,this.P=i}getToken(){return Promise.resolve(new Y7(this.l,this.h,this.P))}start(e,t){e.enqueueRetryable(()=>t(Qi.FIRST_PARTY))}shutdown(){}invalidateToken(){}}class Q7{constructor(e){this.value=e,this.type="AppCheck",this.headers=new Map,e&&e.length>0&&this.headers.set("x-firebase-appcheck",this.value)}}class J7{constructor(e){this.A=e,this.forceRefresh=!1,this.appCheck=null,this.R=null}start(e,t){Kn(this.o===void 0);const i=s=>{s.error!=null&&pt("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${s.error.message}`);const o=s.token!==this.R;return this.R=s.token,pt("FirebaseAppCheckTokenProvider",`Received ${o?"new":"existing"} token.`),o?t(s.token):Promise.resolve()};this.o=s=>{e.enqueueRetryable(()=>i(s))};const r=s=>{pt("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=s,this.o&&this.appCheck.addTokenListener(this.o)};this.A.onInit(s=>r(s)),setTimeout(()=>{if(!this.appCheck){const s=this.A.getImmediate({optional:!0});s?r(s):pt("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}},0)}getToken(){const e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then(t=>t?(Kn(typeof t.token=="string"),this.R=t.token,new Q7(t.token)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.o&&this.appCheck.removeTokenListener(this.o),this.o=void 0}}/** * @license * Copyright 2020 Google LLC * @@ -806,7 +806,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class uU extends Error{constructor(){super(...arguments),this.name="Base64DecodeError"}}/** + */class hU extends Error{constructor(){super(...arguments),this.name="Base64DecodeError"}}/** * @license * Copyright 2020 Google LLC * @@ -821,7 +821,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class ki{constructor(e){this.binaryString=e}static fromBase64String(e){const t=function(r){try{return atob(r)}catch(s){throw typeof DOMException<"u"&&s instanceof DOMException?new uU("Invalid base64 string: "+s):s}}(e);return new ki(t)}static fromUint8Array(e){const t=function(r){let s="";for(let o=0;oee":return e>0;case">=":return e>=0;default:return Wt()}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}}class To extends hU{constructor(e,t){super(),this.filters=e,this.op=t,this.ae=null}static create(e,t){return new To(e,t)}matches(e){return dU(this)?this.filters.find(t=>!t.matches(e))===void 0:this.filters.find(t=>t.matches(e))!==void 0}getFlattenedFilters(){return this.ae!==null||(this.ae=this.filters.reduce((e,t)=>e.concat(t.getFlattenedFilters()),[])),this.ae}getFilters(){return Object.assign([],this.filters)}}function dU(n){return n.op==="and"}function fU(n){return pX(n)&&dU(n)}function pX(n){for(const e of n.filters)if(e instanceof To)return!1;return!0}function JE(n){if(n instanceof gi)return n.field.canonicalString()+n.op.toString()+cd(n.value);if(fU(n))return n.filters.map(e=>JE(e)).join(",");{const e=n.filters.map(t=>JE(t)).join(",");return`${n.op}(${e})`}}function pU(n,e){return n instanceof gi?function(i,r){return r instanceof gi&&i.op===r.op&&i.field.isEqual(r.field)&&Eo(i.value,r.value)}(n,e):n instanceof To?function(i,r){return r instanceof To&&i.op===r.op&&i.filters.length===r.filters.length?i.filters.reduce((s,o,a)=>s&&pU(o,r.filters[a]),!0):!1}(n,e):void Wt()}function mU(n){return n instanceof gi?function(t){return`${t.field.canonicalString()} ${t.op} ${cd(t.value)}`}(n):n instanceof To?function(t){return t.op.toString()+" {"+t.getFilters().map(mU).join(" ,")+"}"}(n):"Filter"}class mX extends gi{constructor(e,t,i){super(e,t,i),this.key=Pt.fromName(i.referenceValue)}matches(e){const t=Pt.comparator(e.key,this.key);return this.matchesComparison(t)}}class gX extends gi{constructor(e,t){super(e,"in",t),this.keys=gU("in",t)}matches(e){return this.keys.some(t=>t.isEqual(e.key))}}class yX extends gi{constructor(e,t){super(e,"not-in",t),this.keys=gU("not-in",t)}matches(e){return!this.keys.some(t=>t.isEqual(e.key))}}function gU(n,e){var t;return(((t=e.arrayValue)===null||t===void 0?void 0:t.values)||[]).map(i=>Pt.fromName(i.referenceValue))}class vX extends gi{constructor(e,t){super(e,"array-contains",t)}matches(e){const t=e.data.field(this.field);return pM(t)&&Qp(t.arrayValue,this.value)}}class _X extends gi{constructor(e,t){super(e,"in",t)}matches(e){const t=e.data.field(this.field);return t!==null&&Qp(this.value.arrayValue,t)}}class xX extends gi{constructor(e,t){super(e,"not-in",t)}matches(e){if(Qp(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const t=e.data.field(this.field);return t!==null&&!Qp(this.value.arrayValue,t)}}class SX extends gi{constructor(e,t){super(e,"array-contains-any",t)}matches(e){const t=e.data.field(this.field);return!(!pM(t)||!t.arrayValue.values)&&t.arrayValue.values.some(i=>Qp(this.value.arrayValue,i))}}/** + */class dU{}class gi extends dU{constructor(e,t,i){super(),this.field=e,this.op=t,this.value=i}static create(e,t,i){return e.isKeyField()?t==="in"||t==="not-in"?this.createKeyFieldInFilter(e,t,i):new mX(e,t,i):t==="array-contains"?new vX(e,i):t==="in"?new _X(e,i):t==="not-in"?new xX(e,i):t==="array-contains-any"?new SX(e,i):new gi(e,t,i)}static createKeyFieldInFilter(e,t,i){return t==="in"?new gX(e,i):new yX(e,i)}matches(e){const t=e.data.field(this.field);return this.op==="!="?t!==null&&this.matchesComparison(ld(t,this.value)):t!==null&&ou(this.value)===ou(t)&&this.matchesComparison(ld(t,this.value))}matchesComparison(e){switch(this.op){case"<":return e<0;case"<=":return e<=0;case"==":return e===0;case"!=":return e!==0;case">":return e>0;case">=":return e>=0;default:return Wt()}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}}class To extends dU{constructor(e,t){super(),this.filters=e,this.op=t,this.ae=null}static create(e,t){return new To(e,t)}matches(e){return fU(this)?this.filters.find(t=>!t.matches(e))===void 0:this.filters.find(t=>t.matches(e))!==void 0}getFlattenedFilters(){return this.ae!==null||(this.ae=this.filters.reduce((e,t)=>e.concat(t.getFlattenedFilters()),[])),this.ae}getFilters(){return Object.assign([],this.filters)}}function fU(n){return n.op==="and"}function pU(n){return pX(n)&&fU(n)}function pX(n){for(const e of n.filters)if(e instanceof To)return!1;return!0}function JE(n){if(n instanceof gi)return n.field.canonicalString()+n.op.toString()+cd(n.value);if(pU(n))return n.filters.map(e=>JE(e)).join(",");{const e=n.filters.map(t=>JE(t)).join(",");return`${n.op}(${e})`}}function mU(n,e){return n instanceof gi?function(i,r){return r instanceof gi&&i.op===r.op&&i.field.isEqual(r.field)&&Eo(i.value,r.value)}(n,e):n instanceof To?function(i,r){return r instanceof To&&i.op===r.op&&i.filters.length===r.filters.length?i.filters.reduce((s,o,a)=>s&&mU(o,r.filters[a]),!0):!1}(n,e):void Wt()}function gU(n){return n instanceof gi?function(t){return`${t.field.canonicalString()} ${t.op} ${cd(t.value)}`}(n):n instanceof To?function(t){return t.op.toString()+" {"+t.getFilters().map(gU).join(" ,")+"}"}(n):"Filter"}class mX extends gi{constructor(e,t,i){super(e,t,i),this.key=Pt.fromName(i.referenceValue)}matches(e){const t=Pt.comparator(e.key,this.key);return this.matchesComparison(t)}}class gX extends gi{constructor(e,t){super(e,"in",t),this.keys=yU("in",t)}matches(e){return this.keys.some(t=>t.isEqual(e.key))}}class yX extends gi{constructor(e,t){super(e,"not-in",t),this.keys=yU("not-in",t)}matches(e){return!this.keys.some(t=>t.isEqual(e.key))}}function yU(n,e){var t;return(((t=e.arrayValue)===null||t===void 0?void 0:t.values)||[]).map(i=>Pt.fromName(i.referenceValue))}class vX extends gi{constructor(e,t){super(e,"array-contains",t)}matches(e){const t=e.data.field(this.field);return pM(t)&&Qp(t.arrayValue,this.value)}}class _X extends gi{constructor(e,t){super(e,"in",t)}matches(e){const t=e.data.field(this.field);return t!==null&&Qp(this.value.arrayValue,t)}}class xX extends gi{constructor(e,t){super(e,"not-in",t)}matches(e){if(Qp(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const t=e.data.field(this.field);return t!==null&&!Qp(this.value.arrayValue,t)}}class SX extends gi{constructor(e,t){super(e,"array-contains-any",t)}matches(e){const t=e.data.field(this.field);return!(!pM(t)||!t.arrayValue.values)&&t.arrayValue.values.some(i=>Qp(this.value.arrayValue,i))}}/** * @license * Copyright 2019 Google LLC * @@ -956,7 +956,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class wX{constructor(e,t=null,i=[],r=[],s=null,o=null,a=null){this.path=e,this.collectionGroup=t,this.orderBy=i,this.filters=r,this.limit=s,this.startAt=o,this.endAt=a,this.ue=null}}function YI(n,e=null,t=[],i=[],r=null,s=null,o=null){return new wX(n,e,t,i,r,s,o)}function mM(n){const e=en(n);if(e.ue===null){let t=e.path.canonicalString();e.collectionGroup!==null&&(t+="|cg:"+e.collectionGroup),t+="|f:",t+=e.filters.map(i=>JE(i)).join(","),t+="|ob:",t+=e.orderBy.map(i=>function(s){return s.field.canonicalString()+s.dir}(i)).join(","),q_(e.limit)||(t+="|l:",t+=e.limit),e.startAt&&(t+="|lb:",t+=e.startAt.inclusive?"b:":"a:",t+=e.startAt.position.map(i=>cd(i)).join(",")),e.endAt&&(t+="|ub:",t+=e.endAt.inclusive?"a:":"b:",t+=e.endAt.position.map(i=>cd(i)).join(",")),e.ue=t}return e.ue}function gM(n,e){if(n.limit!==e.limit||n.orderBy.length!==e.orderBy.length)return!1;for(let t=0;tJE(i)).join(","),t+="|ob:",t+=e.orderBy.map(i=>function(s){return s.field.canonicalString()+s.dir}(i)).join(","),q_(e.limit)||(t+="|l:",t+=e.limit),e.startAt&&(t+="|lb:",t+=e.startAt.inclusive?"b:":"a:",t+=e.startAt.position.map(i=>cd(i)).join(",")),e.endAt&&(t+="|ub:",t+=e.endAt.inclusive?"a:":"b:",t+=e.endAt.position.map(i=>cd(i)).join(",")),e.ue=t}return e.ue}function gM(n,e){if(n.limit!==e.limit||n.orderBy.length!==e.orderBy.length)return!1;for(let t=0;t0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";(function(o){let a=new Ni(pr.comparator);return o.filters.forEach(l=>{l.getFlattenedFilters().forEach(c=>{c.isInequality()&&(a=a.add(c.field))})}),a})(e).forEach(s=>{t.has(s.canonicalString())||s.isKeyField()||e.ce.push(new x0(s,i))}),t.has(pr.keyField().canonicalString())||e.ce.push(new x0(pr.keyField(),i))}return e.ce}function yo(n){const e=en(n);return e.le||(e.le=AX(e,hp(n))),e.le}function AX(n,e){if(n.limitType==="F")return YI(n.path,n.collectionGroup,e,n.filters,n.limit,n.startAt,n.endAt);{e=e.map(r=>{const s=r.dir==="desc"?"asc":"desc";return new x0(r.field,s)});const t=n.endAt?new _0(n.endAt.position,n.endAt.inclusive):null,i=n.startAt?new _0(n.startAt.position,n.startAt.inclusive):null;return YI(n.path,n.collectionGroup,e,n.filters,n.limit,t,i)}}function eT(n,e,t){return new Y_(n.path,n.collectionGroup,n.explicitOrderBy.slice(),n.filters.slice(),e,t,n.startAt,n.endAt)}function K_(n,e){return gM(yo(n),yo(e))&&n.limitType===e.limitType}function vU(n){return`${mM(yo(n))}|lt:${n.limitType}`}function lh(n){return`Query(target=${function(t){let i=t.path.canonicalString();return t.collectionGroup!==null&&(i+=" collectionGroup="+t.collectionGroup),t.filters.length>0&&(i+=`, filters: [${t.filters.map(r=>mU(r)).join(", ")}]`),q_(t.limit)||(i+=", limit: "+t.limit),t.orderBy.length>0&&(i+=`, orderBy: [${t.orderBy.map(r=>function(o){return`${o.field.canonicalString()} (${o.dir})`}(r)).join(", ")}]`),t.startAt&&(i+=", startAt: ",i+=t.startAt.inclusive?"b:":"a:",i+=t.startAt.position.map(r=>cd(r)).join(",")),t.endAt&&(i+=", endAt: ",i+=t.endAt.inclusive?"a:":"b:",i+=t.endAt.position.map(r=>cd(r)).join(",")),`Target(${i})`}(yo(n))}; limitType=${n.limitType})`}function Q_(n,e){return e.isFoundDocument()&&function(i,r){const s=r.key.path;return i.collectionGroup!==null?r.key.hasCollectionId(i.collectionGroup)&&i.path.isPrefixOf(s):Pt.isDocumentKey(i.path)?i.path.isEqual(s):i.path.isImmediateParentOf(s)}(n,e)&&function(i,r){for(const s of hp(i))if(!s.field.isKeyField()&&r.data.field(s.field)===null)return!1;return!0}(n,e)&&function(i,r){for(const s of i.filters)if(!s.matches(r))return!1;return!0}(n,e)&&function(i,r){return!(i.startAt&&!function(o,a,l){const c=qI(o,a,l);return o.inclusive?c<=0:c<0}(i.startAt,hp(i),r)||i.endAt&&!function(o,a,l){const c=qI(o,a,l);return o.inclusive?c>=0:c>0}(i.endAt,hp(i),r))}(n,e)}function MX(n){return n.collectionGroup||(n.path.length%2==1?n.path.lastSegment():n.path.get(n.path.length-2))}function _U(n){return(e,t)=>{let i=!1;for(const r of hp(n)){const s=CX(r,e,t);if(s!==0)return s;i=i||r.field.isKeyField()}return 0}}function CX(n,e,t){const i=n.field.isKeyField()?Pt.comparator(e.key,t.key):function(s,o,a){const l=o.data.field(s),c=a.data.field(s);return l!==null&&c!==null?ld(l,c):Wt()}(n.field,e,t);switch(n.dir){case"asc":return i;case"desc":return-1*i;default:return Wt()}}/** + */class Y_{constructor(e,t=null,i=[],r=[],s=null,o="F",a=null,l=null){this.path=e,this.collectionGroup=t,this.explicitOrderBy=i,this.filters=r,this.limit=s,this.limitType=o,this.startAt=a,this.endAt=l,this.ce=null,this.le=null,this.he=null,this.startAt,this.endAt}}function EX(n,e,t,i,r,s,o,a){return new Y_(n,e,t,i,r,s,o,a)}function vU(n){return new Y_(n)}function KI(n){return n.filters.length===0&&n.limit===null&&n.startAt==null&&n.endAt==null&&(n.explicitOrderBy.length===0||n.explicitOrderBy.length===1&&n.explicitOrderBy[0].field.isKeyField())}function TX(n){return n.collectionGroup!==null}function hp(n){const e=en(n);if(e.ce===null){e.ce=[];const t=new Set;for(const s of e.explicitOrderBy)e.ce.push(s),t.add(s.field.canonicalString());const i=e.explicitOrderBy.length>0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";(function(o){let a=new Ni(pr.comparator);return o.filters.forEach(l=>{l.getFlattenedFilters().forEach(c=>{c.isInequality()&&(a=a.add(c.field))})}),a})(e).forEach(s=>{t.has(s.canonicalString())||s.isKeyField()||e.ce.push(new x0(s,i))}),t.has(pr.keyField().canonicalString())||e.ce.push(new x0(pr.keyField(),i))}return e.ce}function yo(n){const e=en(n);return e.le||(e.le=AX(e,hp(n))),e.le}function AX(n,e){if(n.limitType==="F")return YI(n.path,n.collectionGroup,e,n.filters,n.limit,n.startAt,n.endAt);{e=e.map(r=>{const s=r.dir==="desc"?"asc":"desc";return new x0(r.field,s)});const t=n.endAt?new _0(n.endAt.position,n.endAt.inclusive):null,i=n.startAt?new _0(n.startAt.position,n.startAt.inclusive):null;return YI(n.path,n.collectionGroup,e,n.filters,n.limit,t,i)}}function eT(n,e,t){return new Y_(n.path,n.collectionGroup,n.explicitOrderBy.slice(),n.filters.slice(),e,t,n.startAt,n.endAt)}function K_(n,e){return gM(yo(n),yo(e))&&n.limitType===e.limitType}function _U(n){return`${mM(yo(n))}|lt:${n.limitType}`}function lh(n){return`Query(target=${function(t){let i=t.path.canonicalString();return t.collectionGroup!==null&&(i+=" collectionGroup="+t.collectionGroup),t.filters.length>0&&(i+=`, filters: [${t.filters.map(r=>gU(r)).join(", ")}]`),q_(t.limit)||(i+=", limit: "+t.limit),t.orderBy.length>0&&(i+=`, orderBy: [${t.orderBy.map(r=>function(o){return`${o.field.canonicalString()} (${o.dir})`}(r)).join(", ")}]`),t.startAt&&(i+=", startAt: ",i+=t.startAt.inclusive?"b:":"a:",i+=t.startAt.position.map(r=>cd(r)).join(",")),t.endAt&&(i+=", endAt: ",i+=t.endAt.inclusive?"a:":"b:",i+=t.endAt.position.map(r=>cd(r)).join(",")),`Target(${i})`}(yo(n))}; limitType=${n.limitType})`}function Q_(n,e){return e.isFoundDocument()&&function(i,r){const s=r.key.path;return i.collectionGroup!==null?r.key.hasCollectionId(i.collectionGroup)&&i.path.isPrefixOf(s):Pt.isDocumentKey(i.path)?i.path.isEqual(s):i.path.isImmediateParentOf(s)}(n,e)&&function(i,r){for(const s of hp(i))if(!s.field.isKeyField()&&r.data.field(s.field)===null)return!1;return!0}(n,e)&&function(i,r){for(const s of i.filters)if(!s.matches(r))return!1;return!0}(n,e)&&function(i,r){return!(i.startAt&&!function(o,a,l){const c=qI(o,a,l);return o.inclusive?c<=0:c<0}(i.startAt,hp(i),r)||i.endAt&&!function(o,a,l){const c=qI(o,a,l);return o.inclusive?c>=0:c>0}(i.endAt,hp(i),r))}(n,e)}function MX(n){return n.collectionGroup||(n.path.length%2==1?n.path.lastSegment():n.path.get(n.path.length-2))}function xU(n){return(e,t)=>{let i=!1;for(const r of hp(n)){const s=CX(r,e,t);if(s!==0)return s;i=i||r.field.isKeyField()}return 0}}function CX(n,e,t){const i=n.field.isKeyField()?Pt.comparator(e.key,t.key):function(s,o,a){const l=o.data.field(s),c=a.data.field(s);return l!==null&&c!==null?ld(l,c):Wt()}(n.field,e,t);switch(n.dir){case"asc":return i;case"desc":return-1*i;default:return Wt()}}/** * @license * Copyright 2017 Google LLC * @@ -1001,7 +1001,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const bX=new ri(Pt.comparator);function Pl(){return bX}const xU=new ri(Pt.comparator);function qf(...n){let e=xU;for(const t of n)e=e.insert(t.key,t);return e}function PX(n){let e=xU;return n.forEach((t,i)=>e=e.insert(t,i.overlayedDocument)),e}function Oc(){return dp()}function SU(){return dp()}function dp(){return new Cd(n=>n.toString(),(n,e)=>n.isEqual(e))}const RX=new Ni(Pt.comparator);function rn(...n){let e=RX;for(const t of n)e=e.add(t);return e}const IX=new Ni(hn);function LX(){return IX}/** + */const bX=new ri(Pt.comparator);function Pl(){return bX}const SU=new ri(Pt.comparator);function qf(...n){let e=SU;for(const t of n)e=e.insert(t.key,t);return e}function PX(n){let e=SU;return n.forEach((t,i)=>e=e.insert(t,i.overlayedDocument)),e}function Oc(){return dp()}function wU(){return dp()}function dp(){return new Cd(n=>n.toString(),(n,e)=>n.isEqual(e))}const RX=new Ni(Pt.comparator);function rn(...n){let e=RX;for(const t of n)e=e.add(t);return e}const IX=new Ni(hn);function LX(){return IX}/** * @license * Copyright 2020 Google LLC * @@ -1031,7 +1031,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class J_{constructor(){this._=void 0}}function kX(n,e,t){return n instanceof tT?function(r,s){const o={fields:{__type__:{stringValue:"server_timestamp"},__local_write_time__:{timestampValue:{seconds:r.seconds,nanos:r.nanoseconds}}}};return s&&dM(s)&&(s=fM(s)),s&&(o.fields.__previous_value__=s),{mapValue:o}}(t,e):n instanceof S0?wU(n,e):n instanceof w0?EU(n,e):function(r,s){const o=UX(r,s),a=QI(o)+QI(r.Pe);return QE(o)&&QE(r.Pe)?DX(a):NX(r.serializer,a)}(n,e)}function OX(n,e,t){return n instanceof S0?wU(n,e):n instanceof w0?EU(n,e):t}function UX(n,e){return n instanceof nT?function(i){return QE(i)||function(s){return!!s&&"doubleValue"in s}(i)}(e)?e:{integerValue:0}:null}class tT extends J_{}class S0 extends J_{constructor(e){super(),this.elements=e}}function wU(n,e){const t=TU(e);for(const i of n.elements)t.some(r=>Eo(r,i))||t.push(i);return{arrayValue:{values:t}}}class w0 extends J_{constructor(e){super(),this.elements=e}}function EU(n,e){let t=TU(e);for(const i of n.elements)t=t.filter(r=>!Eo(r,i));return{arrayValue:{values:t}}}class nT extends J_{constructor(e,t){super(),this.serializer=e,this.Pe=t}}function QI(n){return ei(n.integerValue||n.doubleValue)}function TU(n){return pM(n)&&n.arrayValue.values?n.arrayValue.values.slice():[]}function FX(n,e){return n.field.isEqual(e.field)&&function(i,r){return i instanceof S0&&r instanceof S0||i instanceof w0&&r instanceof w0?ad(i.elements,r.elements,Eo):i instanceof nT&&r instanceof nT?Eo(i.Pe,r.Pe):i instanceof tT&&r instanceof tT}(n.transform,e.transform)}class Xc{constructor(e,t){this.updateTime=e,this.exists=t}static none(){return new Xc}static exists(e){return new Xc(void 0,e)}static updateTime(e){return new Xc(e)}get isNone(){return this.updateTime===void 0&&this.exists===void 0}isEqual(e){return this.exists===e.exists&&(this.updateTime?!!e.updateTime&&this.updateTime.isEqual(e.updateTime):!e.updateTime)}}function Tv(n,e){return n.updateTime!==void 0?e.isFoundDocument()&&e.version.isEqual(n.updateTime):n.exists===void 0||n.exists===e.isFoundDocument()}class yM{}function AU(n,e){if(!n.hasLocalMutations||e&&e.fields.length===0)return null;if(e===null)return n.isNoDocument()?new BX(n.key,Xc.none()):new vM(n.key,n.data,Xc.none());{const t=n.data,i=uo.empty();let r=new Ni(pr.comparator);for(let s of e.fields)if(!r.has(s)){let o=t.field(s);o===null&&s.length>1&&(s=s.popLast(),o=t.field(s)),o===null?i.delete(s):i.set(s,o),r=r.add(s)}return new Z_(n.key,i,new ol(r.toArray()),Xc.none())}}function VX(n,e,t){n instanceof vM?function(r,s,o){const a=r.value.clone(),l=ZI(r.fieldTransforms,s,o.transformResults);a.setAll(l),s.convertToFoundDocument(o.version,a).setHasCommittedMutations()}(n,e,t):n instanceof Z_?function(r,s,o){if(!Tv(r.precondition,s))return void s.convertToUnknownDocument(o.version);const a=ZI(r.fieldTransforms,s,o.transformResults),l=s.data;l.setAll(MU(r)),l.setAll(a),s.convertToFoundDocument(o.version,l).setHasCommittedMutations()}(n,e,t):function(r,s,o){s.convertToNoDocument(o.version).setHasCommittedMutations()}(0,e,t)}function fp(n,e,t,i){return n instanceof vM?function(s,o,a,l){if(!Tv(s.precondition,o))return a;const c=s.value.clone(),d=e2(s.fieldTransforms,l,o);return c.setAll(d),o.convertToFoundDocument(o.version,c).setHasLocalMutations(),null}(n,e,t,i):n instanceof Z_?function(s,o,a,l){if(!Tv(s.precondition,o))return a;const c=e2(s.fieldTransforms,l,o),d=o.data;return d.setAll(MU(s)),d.setAll(c),o.convertToFoundDocument(o.version,d).setHasLocalMutations(),a===null?null:a.unionWith(s.fieldMask.fields).unionWith(s.fieldTransforms.map(f=>f.field))}(n,e,t,i):function(s,o,a){return Tv(s.precondition,o)?(o.convertToNoDocument(o.version).setHasLocalMutations(),null):a}(n,e,t)}function JI(n,e){return n.type===e.type&&!!n.key.isEqual(e.key)&&!!n.precondition.isEqual(e.precondition)&&!!function(i,r){return i===void 0&&r===void 0||!(!i||!r)&&ad(i,r,(s,o)=>FX(s,o))}(n.fieldTransforms,e.fieldTransforms)&&(n.type===0?n.value.isEqual(e.value):n.type!==1||n.data.isEqual(e.data)&&n.fieldMask.isEqual(e.fieldMask))}class vM extends yM{constructor(e,t,i,r=[]){super(),this.key=e,this.value=t,this.precondition=i,this.fieldTransforms=r,this.type=0}getFieldMask(){return null}}class Z_ extends yM{constructor(e,t,i,r,s=[]){super(),this.key=e,this.data=t,this.fieldMask=i,this.precondition=r,this.fieldTransforms=s,this.type=1}getFieldMask(){return this.fieldMask}}function MU(n){const e=new Map;return n.fieldMask.fields.forEach(t=>{if(!t.isEmpty()){const i=n.data.field(t);e.set(t,i)}}),e}function ZI(n,e,t){const i=new Map;Kn(n.length===t.length);for(let r=0;rEo(r,i))||t.push(i);return{arrayValue:{values:t}}}class w0 extends J_{constructor(e){super(),this.elements=e}}function TU(n,e){let t=AU(e);for(const i of n.elements)t=t.filter(r=>!Eo(r,i));return{arrayValue:{values:t}}}class nT extends J_{constructor(e,t){super(),this.serializer=e,this.Pe=t}}function QI(n){return ei(n.integerValue||n.doubleValue)}function AU(n){return pM(n)&&n.arrayValue.values?n.arrayValue.values.slice():[]}function FX(n,e){return n.field.isEqual(e.field)&&function(i,r){return i instanceof S0&&r instanceof S0||i instanceof w0&&r instanceof w0?ad(i.elements,r.elements,Eo):i instanceof nT&&r instanceof nT?Eo(i.Pe,r.Pe):i instanceof tT&&r instanceof tT}(n.transform,e.transform)}class Xc{constructor(e,t){this.updateTime=e,this.exists=t}static none(){return new Xc}static exists(e){return new Xc(void 0,e)}static updateTime(e){return new Xc(e)}get isNone(){return this.updateTime===void 0&&this.exists===void 0}isEqual(e){return this.exists===e.exists&&(this.updateTime?!!e.updateTime&&this.updateTime.isEqual(e.updateTime):!e.updateTime)}}function Tv(n,e){return n.updateTime!==void 0?e.isFoundDocument()&&e.version.isEqual(n.updateTime):n.exists===void 0||n.exists===e.isFoundDocument()}class yM{}function MU(n,e){if(!n.hasLocalMutations||e&&e.fields.length===0)return null;if(e===null)return n.isNoDocument()?new BX(n.key,Xc.none()):new vM(n.key,n.data,Xc.none());{const t=n.data,i=uo.empty();let r=new Ni(pr.comparator);for(let s of e.fields)if(!r.has(s)){let o=t.field(s);o===null&&s.length>1&&(s=s.popLast(),o=t.field(s)),o===null?i.delete(s):i.set(s,o),r=r.add(s)}return new Z_(n.key,i,new ol(r.toArray()),Xc.none())}}function VX(n,e,t){n instanceof vM?function(r,s,o){const a=r.value.clone(),l=ZI(r.fieldTransforms,s,o.transformResults);a.setAll(l),s.convertToFoundDocument(o.version,a).setHasCommittedMutations()}(n,e,t):n instanceof Z_?function(r,s,o){if(!Tv(r.precondition,s))return void s.convertToUnknownDocument(o.version);const a=ZI(r.fieldTransforms,s,o.transformResults),l=s.data;l.setAll(CU(r)),l.setAll(a),s.convertToFoundDocument(o.version,l).setHasCommittedMutations()}(n,e,t):function(r,s,o){s.convertToNoDocument(o.version).setHasCommittedMutations()}(0,e,t)}function fp(n,e,t,i){return n instanceof vM?function(s,o,a,l){if(!Tv(s.precondition,o))return a;const c=s.value.clone(),d=e2(s.fieldTransforms,l,o);return c.setAll(d),o.convertToFoundDocument(o.version,c).setHasLocalMutations(),null}(n,e,t,i):n instanceof Z_?function(s,o,a,l){if(!Tv(s.precondition,o))return a;const c=e2(s.fieldTransforms,l,o),d=o.data;return d.setAll(CU(s)),d.setAll(c),o.convertToFoundDocument(o.version,d).setHasLocalMutations(),a===null?null:a.unionWith(s.fieldMask.fields).unionWith(s.fieldTransforms.map(f=>f.field))}(n,e,t,i):function(s,o,a){return Tv(s.precondition,o)?(o.convertToNoDocument(o.version).setHasLocalMutations(),null):a}(n,e,t)}function JI(n,e){return n.type===e.type&&!!n.key.isEqual(e.key)&&!!n.precondition.isEqual(e.precondition)&&!!function(i,r){return i===void 0&&r===void 0||!(!i||!r)&&ad(i,r,(s,o)=>FX(s,o))}(n.fieldTransforms,e.fieldTransforms)&&(n.type===0?n.value.isEqual(e.value):n.type!==1||n.data.isEqual(e.data)&&n.fieldMask.isEqual(e.fieldMask))}class vM extends yM{constructor(e,t,i,r=[]){super(),this.key=e,this.value=t,this.precondition=i,this.fieldTransforms=r,this.type=0}getFieldMask(){return null}}class Z_ extends yM{constructor(e,t,i,r,s=[]){super(),this.key=e,this.data=t,this.fieldMask=i,this.precondition=r,this.fieldTransforms=s,this.type=1}getFieldMask(){return this.fieldMask}}function CU(n){const e=new Map;return n.fieldMask.fields.forEach(t=>{if(!t.isEmpty()){const i=n.data.field(t);e.set(t,i)}}),e}function ZI(n,e,t){const i=new Map;Kn(n.length===t.length);for(let r=0;r{const s=e.get(r.key),o=s.overlayedDocument;let a=this.applyToLocalView(o,s.mutatedFields);a=t.has(r.key)?null:a;const l=AU(o,a);l!==null&&i.set(r.key,l),o.isValidDocument()||o.convertToNoDocument(kt.min())}),i}keys(){return this.mutations.reduce((e,t)=>e.add(t.key),rn())}isEqual(e){return this.batchId===e.batchId&&ad(this.mutations,e.mutations,(t,i)=>JI(t,i))&&ad(this.baseMutations,e.baseMutations,(t,i)=>JI(t,i))}}/** + */class zX{constructor(e,t,i,r){this.batchId=e,this.localWriteTime=t,this.baseMutations=i,this.mutations=r}applyToRemoteDocument(e,t){const i=t.mutationResults;for(let r=0;r{const s=e.get(r.key),o=s.overlayedDocument;let a=this.applyToLocalView(o,s.mutatedFields);a=t.has(r.key)?null:a;const l=MU(o,a);l!==null&&i.set(r.key,l),o.isValidDocument()||o.convertToNoDocument(kt.min())}),i}keys(){return this.mutations.reduce((e,t)=>e.add(t.key),rn())}isEqual(e){return this.batchId===e.batchId&&ad(this.mutations,e.mutations,(t,i)=>JI(t,i))&&ad(this.baseMutations,e.baseMutations,(t,i)=>JI(t,i))}}/** * @license * Copyright 2022 Google LLC * @@ -1094,7 +1094,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var ui,Jt;function CU(n){if(n===void 0)return ha("GRPC error has no .code"),qe.UNKNOWN;switch(n){case ui.OK:return qe.OK;case ui.CANCELLED:return qe.CANCELLED;case ui.UNKNOWN:return qe.UNKNOWN;case ui.DEADLINE_EXCEEDED:return qe.DEADLINE_EXCEEDED;case ui.RESOURCE_EXHAUSTED:return qe.RESOURCE_EXHAUSTED;case ui.INTERNAL:return qe.INTERNAL;case ui.UNAVAILABLE:return qe.UNAVAILABLE;case ui.UNAUTHENTICATED:return qe.UNAUTHENTICATED;case ui.INVALID_ARGUMENT:return qe.INVALID_ARGUMENT;case ui.NOT_FOUND:return qe.NOT_FOUND;case ui.ALREADY_EXISTS:return qe.ALREADY_EXISTS;case ui.PERMISSION_DENIED:return qe.PERMISSION_DENIED;case ui.FAILED_PRECONDITION:return qe.FAILED_PRECONDITION;case ui.ABORTED:return qe.ABORTED;case ui.OUT_OF_RANGE:return qe.OUT_OF_RANGE;case ui.UNIMPLEMENTED:return qe.UNIMPLEMENTED;case ui.DATA_LOSS:return qe.DATA_LOSS;default:return Wt()}}(Jt=ui||(ui={}))[Jt.OK=0]="OK",Jt[Jt.CANCELLED=1]="CANCELLED",Jt[Jt.UNKNOWN=2]="UNKNOWN",Jt[Jt.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",Jt[Jt.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",Jt[Jt.NOT_FOUND=5]="NOT_FOUND",Jt[Jt.ALREADY_EXISTS=6]="ALREADY_EXISTS",Jt[Jt.PERMISSION_DENIED=7]="PERMISSION_DENIED",Jt[Jt.UNAUTHENTICATED=16]="UNAUTHENTICATED",Jt[Jt.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",Jt[Jt.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",Jt[Jt.ABORTED=10]="ABORTED",Jt[Jt.OUT_OF_RANGE=11]="OUT_OF_RANGE",Jt[Jt.UNIMPLEMENTED=12]="UNIMPLEMENTED",Jt[Jt.INTERNAL=13]="INTERNAL",Jt[Jt.UNAVAILABLE=14]="UNAVAILABLE",Jt[Jt.DATA_LOSS=15]="DATA_LOSS";/** + */var ui,Jt;function bU(n){if(n===void 0)return ha("GRPC error has no .code"),qe.UNKNOWN;switch(n){case ui.OK:return qe.OK;case ui.CANCELLED:return qe.CANCELLED;case ui.UNKNOWN:return qe.UNKNOWN;case ui.DEADLINE_EXCEEDED:return qe.DEADLINE_EXCEEDED;case ui.RESOURCE_EXHAUSTED:return qe.RESOURCE_EXHAUSTED;case ui.INTERNAL:return qe.INTERNAL;case ui.UNAVAILABLE:return qe.UNAVAILABLE;case ui.UNAUTHENTICATED:return qe.UNAUTHENTICATED;case ui.INVALID_ARGUMENT:return qe.INVALID_ARGUMENT;case ui.NOT_FOUND:return qe.NOT_FOUND;case ui.ALREADY_EXISTS:return qe.ALREADY_EXISTS;case ui.PERMISSION_DENIED:return qe.PERMISSION_DENIED;case ui.FAILED_PRECONDITION:return qe.FAILED_PRECONDITION;case ui.ABORTED:return qe.ABORTED;case ui.OUT_OF_RANGE:return qe.OUT_OF_RANGE;case ui.UNIMPLEMENTED:return qe.UNIMPLEMENTED;case ui.DATA_LOSS:return qe.DATA_LOSS;default:return Wt()}}(Jt=ui||(ui={}))[Jt.OK=0]="OK",Jt[Jt.CANCELLED=1]="CANCELLED",Jt[Jt.UNKNOWN=2]="UNKNOWN",Jt[Jt.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",Jt[Jt.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",Jt[Jt.NOT_FOUND=5]="NOT_FOUND",Jt[Jt.ALREADY_EXISTS=6]="ALREADY_EXISTS",Jt[Jt.PERMISSION_DENIED=7]="PERMISSION_DENIED",Jt[Jt.UNAUTHENTICATED=16]="UNAUTHENTICATED",Jt[Jt.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",Jt[Jt.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",Jt[Jt.ABORTED=10]="ABORTED",Jt[Jt.OUT_OF_RANGE=11]="OUT_OF_RANGE",Jt[Jt.UNIMPLEMENTED=12]="UNIMPLEMENTED",Jt[Jt.INTERNAL=13]="INTERNAL",Jt[Jt.UNAVAILABLE=14]="UNAVAILABLE",Jt[Jt.DATA_LOSS=15]="DATA_LOSS";/** * @license * Copyright 2023 Google LLC * @@ -1124,7 +1124,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const jX=new Wc([4294967295,4294967295],0);function t2(n){const e=WX().encode(n),t=new iU;return t.update(e),new Uint8Array(t.digest())}function n2(n){const e=new DataView(n.buffer),t=e.getUint32(0,!0),i=e.getUint32(4,!0),r=e.getUint32(8,!0),s=e.getUint32(12,!0);return[new Wc([t,i],0),new Wc([r,s],0)]}class _M{constructor(e,t,i){if(this.bitmap=e,this.padding=t,this.hashCount=i,t<0||t>=8)throw new $f(`Invalid padding: ${t}`);if(i<0)throw new $f(`Invalid hash count: ${i}`);if(e.length>0&&this.hashCount===0)throw new $f(`Invalid hash count: ${i}`);if(e.length===0&&t!==0)throw new $f(`Invalid padding when bitmap length is 0: ${t}`);this.Ie=8*e.length-t,this.Te=Wc.fromNumber(this.Ie)}Ee(e,t,i){let r=e.add(t.multiply(Wc.fromNumber(i)));return r.compare(jX)===1&&(r=new Wc([r.getBits(0),r.getBits(1)],0)),r.modulo(this.Te).toNumber()}de(e){return(this.bitmap[Math.floor(e/8)]&1<o.insert(a)),o}insert(e){if(this.Ie===0)return;const t=t2(e),[i,r]=n2(t);for(let s=0;s=8)throw new $f(`Invalid padding: ${t}`);if(i<0)throw new $f(`Invalid hash count: ${i}`);if(e.length>0&&this.hashCount===0)throw new $f(`Invalid hash count: ${i}`);if(e.length===0&&t!==0)throw new $f(`Invalid padding when bitmap length is 0: ${t}`);this.Ie=8*e.length-t,this.Te=Wc.fromNumber(this.Ie)}Ee(e,t,i){let r=e.add(t.multiply(Wc.fromNumber(i)));return r.compare(jX)===1&&(r=new Wc([r.getBits(0),r.getBits(1)],0)),r.modulo(this.Te).toNumber()}de(e){return(this.bitmap[Math.floor(e/8)]&1<o.insert(a)),o}insert(e){if(this.Ie===0)return;const t=t2(e),[i,r]=n2(t);for(let s=0;s0&&(this.we=!0,this.pe=e)}ve(){let e=rn(),t=rn(),i=rn();return this.ge.forEach((r,s)=>{switch(s){case 0:e=e.add(r);break;case 2:t=t.add(r);break;case 1:i=i.add(r);break;default:Wt()}}),new Om(this.pe,this.ye,e,t,i)}Ce(){this.we=!1,this.ge=s2()}Fe(e,t){this.we=!0,this.ge=this.ge.insert(e,t)}Me(e){this.we=!0,this.ge=this.ge.remove(e)}xe(){this.fe+=1}Oe(){this.fe-=1,Kn(this.fe>=0)}Ne(){this.we=!0,this.ye=!0}}class XX{constructor(e){this.Le=e,this.Be=new Map,this.ke=Pl(),this.qe=r2(),this.Qe=new ri(hn)}Ke(e){for(const t of e.Re)e.Ve&&e.Ve.isFoundDocument()?this.$e(t,e.Ve):this.Ue(t,e.key,e.Ve);for(const t of e.removedTargetIds)this.Ue(t,e.key,e.Ve)}We(e){this.forEachTarget(e,t=>{const i=this.Ge(t);switch(e.state){case 0:this.ze(t)&&i.De(e.resumeToken);break;case 1:i.Oe(),i.Se||i.Ce(),i.De(e.resumeToken);break;case 2:i.Oe(),i.Se||this.removeTarget(t);break;case 3:this.ze(t)&&(i.Ne(),i.De(e.resumeToken));break;case 4:this.ze(t)&&(this.je(t),i.De(e.resumeToken));break;default:Wt()}})}forEachTarget(e,t){e.targetIds.length>0?e.targetIds.forEach(t):this.Be.forEach((i,r)=>{this.ze(r)&&t(r)})}He(e){const t=e.targetId,i=e.me.count,r=this.Je(t);if(r){const s=r.target;if(ZE(s))if(i===0){const o=new Pt(s.path);this.Ue(t,o,Zi.newNoDocument(o,kt.min()))}else Kn(i===1);else{const o=this.Ye(t);if(o!==i){const a=this.Ze(e),l=a?this.Xe(a,e,o):1;if(l!==0){this.je(t);const c=l===2?"TargetPurposeExistenceFilterMismatchBloom":"TargetPurposeExistenceFilterMismatch";this.Qe=this.Qe.insert(t,c)}}}}}Ze(e){const t=e.me.unchangedNames;if(!t||!t.bits)return null;const{bits:{bitmap:i="",padding:r=0},hashCount:s=0}=t;let o,a;try{o=su(i).toUint8Array()}catch(l){if(l instanceof uU)return od("Decoding the base64 bloom filter in existence filter failed ("+l.message+"); ignoring the bloom filter and falling back to full re-query."),null;throw l}try{a=new _M(o,r,s)}catch(l){return od(l instanceof $f?"BloomFilter error: ":"Applying bloom filter failed: ",l),null}return a.Ie===0?null:a}Xe(e,t,i){return t.me.count===i-this.nt(e,t.targetId)?0:2}nt(e,t){const i=this.Le.getRemoteKeysForTarget(t);let r=0;return i.forEach(s=>{const o=this.Le.tt(),a=`projects/${o.projectId}/databases/${o.database}/documents/${s.path.canonicalString()}`;e.mightContain(a)||(this.Ue(t,s,null),r++)}),r}rt(e){const t=new Map;this.Be.forEach((s,o)=>{const a=this.Je(o);if(a){if(s.current&&ZE(a.target)){const l=new Pt(a.target.path);this.ke.get(l)!==null||this.it(o,l)||this.Ue(o,l,Zi.newNoDocument(l,e))}s.be&&(t.set(o,s.ve()),s.Ce())}});let i=rn();this.qe.forEach((s,o)=>{let a=!0;o.forEachWhile(l=>{const c=this.Je(l);return!c||c.purpose==="TargetPurposeLimboResolution"||(a=!1,!1)}),a&&(i=i.add(s))}),this.ke.forEach((s,o)=>o.setReadTime(e));const r=new ex(e,t,this.Qe,this.ke,i);return this.ke=Pl(),this.qe=r2(),this.Qe=new ri(hn),r}$e(e,t){if(!this.ze(e))return;const i=this.it(e,t.key)?2:0;this.Ge(e).Fe(t.key,i),this.ke=this.ke.insert(t.key,t),this.qe=this.qe.insert(t.key,this.st(t.key).add(e))}Ue(e,t,i){if(!this.ze(e))return;const r=this.Ge(e);this.it(e,t)?r.Fe(t,1):r.Me(t),this.qe=this.qe.insert(t,this.st(t).delete(e)),i&&(this.ke=this.ke.insert(t,i))}removeTarget(e){this.Be.delete(e)}Ye(e){const t=this.Ge(e).ve();return this.Le.getRemoteKeysForTarget(e).size+t.addedDocuments.size-t.removedDocuments.size}xe(e){this.Ge(e).xe()}Ge(e){let t=this.Be.get(e);return t||(t=new i2,this.Be.set(e,t)),t}st(e){let t=this.qe.get(e);return t||(t=new Ni(hn),this.qe=this.qe.insert(e,t)),t}ze(e){const t=this.Je(e)!==null;return t||pt("WatchChangeAggregator","Detected inactive target",e),t}Je(e){const t=this.Be.get(e);return t&&t.Se?null:this.Le.ot(e)}je(e){this.Be.set(e,new i2),this.Le.getRemoteKeysForTarget(e).forEach(t=>{this.Ue(e,t,null)})}it(e,t){return this.Le.getRemoteKeysForTarget(e).has(t)}}function r2(){return new ri(Pt.comparator)}function s2(){return new ri(Pt.comparator)}const qX=(()=>({asc:"ASCENDING",desc:"DESCENDING"}))(),$X=(()=>({"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"}))(),YX=(()=>({and:"AND",or:"OR"}))();class KX{constructor(e,t){this.databaseId=e,this.useProto3Json=t}}function iT(n,e){return n.useProto3Json||q_(e)?e:{value:e}}function QX(n,e){return n.useProto3Json?`${new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+e.nanoseconds).slice(-9)}Z`:{seconds:""+e.seconds,nanos:e.nanoseconds}}function JX(n,e){return n.useProto3Json?e.toBase64():e.toUint8Array()}function Gh(n){return Kn(!!n),kt.fromTimestamp(function(t){const i=bl(t);return new Vr(i.seconds,i.nanos)}(n))}function ZX(n,e){return rT(n,e).canonicalString()}function rT(n,e){const t=function(r){return new qn(["projects",r.projectId,"databases",r.database])}(n).child("documents");return e===void 0?t:t.child(e)}function RU(n){const e=qn.fromString(n);return Kn(kU(e)),e}function Mw(n,e){const t=RU(e);if(t.get(1)!==n.databaseId.projectId)throw new Tt(qe.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+t.get(1)+" vs "+n.databaseId.projectId);if(t.get(3)!==n.databaseId.database)throw new Tt(qe.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+t.get(3)+" vs "+n.databaseId.database);return new Pt(LU(t))}function IU(n,e){return ZX(n.databaseId,e)}function eq(n){const e=RU(n);return e.length===4?qn.emptyPath():LU(e)}function o2(n){return new qn(["projects",n.databaseId.projectId,"databases",n.databaseId.database]).canonicalString()}function LU(n){return Kn(n.length>4&&n.get(4)==="documents"),n.popFirst(5)}function tq(n,e){let t;if("targetChange"in e){e.targetChange;const i=function(c){return c==="NO_CHANGE"?0:c==="ADD"?1:c==="REMOVE"?2:c==="CURRENT"?3:c==="RESET"?4:Wt()}(e.targetChange.targetChangeType||"NO_CHANGE"),r=e.targetChange.targetIds||[],s=function(c,d){return c.useProto3Json?(Kn(d===void 0||typeof d=="string"),ki.fromBase64String(d||"")):(Kn(d===void 0||d instanceof Buffer||d instanceof Uint8Array),ki.fromUint8Array(d||new Uint8Array))}(n,e.targetChange.resumeToken),o=e.targetChange.cause,a=o&&function(c){const d=c.code===void 0?qe.UNKNOWN:CU(c.code);return new Tt(d,c.message||"")}(o);t=new PU(i,r,s,a||null)}else if("documentChange"in e){e.documentChange;const i=e.documentChange;i.document,i.document.name,i.document.updateTime;const r=Mw(n,i.document.name),s=Gh(i.document.updateTime),o=i.document.createTime?Gh(i.document.createTime):kt.min(),a=new uo({mapValue:{fields:i.document.fields}}),l=Zi.newFoundDocument(r,s,o,a),c=i.targetIds||[],d=i.removedTargetIds||[];t=new Av(c,d,l.key,l)}else if("documentDelete"in e){e.documentDelete;const i=e.documentDelete;i.document;const r=Mw(n,i.document),s=i.readTime?Gh(i.readTime):kt.min(),o=Zi.newNoDocument(r,s),a=i.removedTargetIds||[];t=new Av([],a,o.key,o)}else if("documentRemove"in e){e.documentRemove;const i=e.documentRemove;i.document;const r=Mw(n,i.document),s=i.removedTargetIds||[];t=new Av([],s,r,null)}else{if(!("filter"in e))return Wt();{e.filter;const i=e.filter;i.targetId;const{count:r=0,unchangedNames:s}=i,o=new GX(r,s),a=i.targetId;t=new bU(a,o)}}return t}function nq(n,e){return{documents:[IU(n,e.path)]}}function iq(n,e){const t={structuredQuery:{}},i=e.path;let r;e.collectionGroup!==null?(r=i,t.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(r=i.popLast(),t.structuredQuery.from=[{collectionId:i.lastSegment()}]),t.parent=IU(n,r);const s=function(c){if(c.length!==0)return DU(To.create(c,"and"))}(e.filters);s&&(t.structuredQuery.where=s);const o=function(c){if(c.length!==0)return c.map(d=>function(p){return{field:ch(p.field),direction:oq(p.dir)}}(d))}(e.orderBy);o&&(t.structuredQuery.orderBy=o);const a=iT(n,e.limit);return a!==null&&(t.structuredQuery.limit=a),e.startAt&&(t.structuredQuery.startAt=function(c){return{before:c.inclusive,values:c.position}}(e.startAt)),e.endAt&&(t.structuredQuery.endAt=function(c){return{before:!c.inclusive,values:c.position}}(e.endAt)),{_t:t,parent:r}}function rq(n){let e=eq(n.parent);const t=n.structuredQuery,i=t.from?t.from.length:0;let r=null;if(i>0){Kn(i===1);const d=t.from[0];d.allDescendants?r=d.collectionId:e=e.child(d.collectionId)}let s=[];t.where&&(s=function(f){const p=NU(f);return p instanceof To&&fU(p)?p.getFilters():[p]}(t.where));let o=[];t.orderBy&&(o=function(f){return f.map(p=>function(_){return new x0(uh(_.field),function(x){switch(x){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(_.direction))}(p))}(t.orderBy));let a=null;t.limit&&(a=function(f){let p;return p=typeof f=="object"?f.value:f,q_(p)?null:p}(t.limit));let l=null;t.startAt&&(l=function(f){const p=!!f.before,m=f.values||[];return new _0(m,p)}(t.startAt));let c=null;return t.endAt&&(c=function(f){const p=!f.before,m=f.values||[];return new _0(m,p)}(t.endAt)),EX(e,r,o,s,a,"F",l,c)}function sq(n,e){const t=function(r){switch(r){case"TargetPurposeListen":return null;case"TargetPurposeExistenceFilterMismatch":return"existence-filter-mismatch";case"TargetPurposeExistenceFilterMismatchBloom":return"existence-filter-mismatch-bloom";case"TargetPurposeLimboResolution":return"limbo-document";default:return Wt()}}(e.purpose);return t==null?null:{"goog-listen-tags":t}}function NU(n){return n.unaryFilter!==void 0?function(t){switch(t.unaryFilter.op){case"IS_NAN":const i=uh(t.unaryFilter.field);return gi.create(i,"==",{doubleValue:NaN});case"IS_NULL":const r=uh(t.unaryFilter.field);return gi.create(r,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":const s=uh(t.unaryFilter.field);return gi.create(s,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const o=uh(t.unaryFilter.field);return gi.create(o,"!=",{nullValue:"NULL_VALUE"});default:return Wt()}}(n):n.fieldFilter!==void 0?function(t){return gi.create(uh(t.fieldFilter.field),function(r){switch(r){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";default:return Wt()}}(t.fieldFilter.op),t.fieldFilter.value)}(n):n.compositeFilter!==void 0?function(t){return To.create(t.compositeFilter.filters.map(i=>NU(i)),function(r){switch(r){case"AND":return"and";case"OR":return"or";default:return Wt()}}(t.compositeFilter.op))}(n):Wt()}function oq(n){return qX[n]}function aq(n){return $X[n]}function lq(n){return YX[n]}function ch(n){return{fieldPath:n.canonicalString()}}function uh(n){return pr.fromServerFormat(n.fieldPath)}function DU(n){return n instanceof gi?function(t){if(t.op==="=="){if(XI(t.value))return{unaryFilter:{field:ch(t.field),op:"IS_NAN"}};if(jI(t.value))return{unaryFilter:{field:ch(t.field),op:"IS_NULL"}}}else if(t.op==="!="){if(XI(t.value))return{unaryFilter:{field:ch(t.field),op:"IS_NOT_NAN"}};if(jI(t.value))return{unaryFilter:{field:ch(t.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:ch(t.field),op:aq(t.op),value:t.value}}}(n):n instanceof To?function(t){const i=t.getFilters().map(r=>DU(r));return i.length===1?i[0]:{compositeFilter:{op:lq(t.op),filters:i}}}(n):Wt()}function kU(n){return n.length>=4&&n.get(0)==="projects"&&n.get(2)==="databases"}/** + */class Av{constructor(e,t,i,r){this.Re=e,this.removedTargetIds=t,this.key=i,this.Ve=r}}class PU{constructor(e,t){this.targetId=e,this.me=t}}class RU{constructor(e,t,i=ki.EMPTY_BYTE_STRING,r=null){this.state=e,this.targetIds=t,this.resumeToken=i,this.cause=r}}class i2{constructor(){this.fe=0,this.ge=s2(),this.pe=ki.EMPTY_BYTE_STRING,this.ye=!1,this.we=!0}get current(){return this.ye}get resumeToken(){return this.pe}get Se(){return this.fe!==0}get be(){return this.we}De(e){e.approximateByteSize()>0&&(this.we=!0,this.pe=e)}ve(){let e=rn(),t=rn(),i=rn();return this.ge.forEach((r,s)=>{switch(s){case 0:e=e.add(r);break;case 2:t=t.add(r);break;case 1:i=i.add(r);break;default:Wt()}}),new Om(this.pe,this.ye,e,t,i)}Ce(){this.we=!1,this.ge=s2()}Fe(e,t){this.we=!0,this.ge=this.ge.insert(e,t)}Me(e){this.we=!0,this.ge=this.ge.remove(e)}xe(){this.fe+=1}Oe(){this.fe-=1,Kn(this.fe>=0)}Ne(){this.we=!0,this.ye=!0}}class XX{constructor(e){this.Le=e,this.Be=new Map,this.ke=Pl(),this.qe=r2(),this.Qe=new ri(hn)}Ke(e){for(const t of e.Re)e.Ve&&e.Ve.isFoundDocument()?this.$e(t,e.Ve):this.Ue(t,e.key,e.Ve);for(const t of e.removedTargetIds)this.Ue(t,e.key,e.Ve)}We(e){this.forEachTarget(e,t=>{const i=this.Ge(t);switch(e.state){case 0:this.ze(t)&&i.De(e.resumeToken);break;case 1:i.Oe(),i.Se||i.Ce(),i.De(e.resumeToken);break;case 2:i.Oe(),i.Se||this.removeTarget(t);break;case 3:this.ze(t)&&(i.Ne(),i.De(e.resumeToken));break;case 4:this.ze(t)&&(this.je(t),i.De(e.resumeToken));break;default:Wt()}})}forEachTarget(e,t){e.targetIds.length>0?e.targetIds.forEach(t):this.Be.forEach((i,r)=>{this.ze(r)&&t(r)})}He(e){const t=e.targetId,i=e.me.count,r=this.Je(t);if(r){const s=r.target;if(ZE(s))if(i===0){const o=new Pt(s.path);this.Ue(t,o,Zi.newNoDocument(o,kt.min()))}else Kn(i===1);else{const o=this.Ye(t);if(o!==i){const a=this.Ze(e),l=a?this.Xe(a,e,o):1;if(l!==0){this.je(t);const c=l===2?"TargetPurposeExistenceFilterMismatchBloom":"TargetPurposeExistenceFilterMismatch";this.Qe=this.Qe.insert(t,c)}}}}}Ze(e){const t=e.me.unchangedNames;if(!t||!t.bits)return null;const{bits:{bitmap:i="",padding:r=0},hashCount:s=0}=t;let o,a;try{o=su(i).toUint8Array()}catch(l){if(l instanceof hU)return od("Decoding the base64 bloom filter in existence filter failed ("+l.message+"); ignoring the bloom filter and falling back to full re-query."),null;throw l}try{a=new _M(o,r,s)}catch(l){return od(l instanceof $f?"BloomFilter error: ":"Applying bloom filter failed: ",l),null}return a.Ie===0?null:a}Xe(e,t,i){return t.me.count===i-this.nt(e,t.targetId)?0:2}nt(e,t){const i=this.Le.getRemoteKeysForTarget(t);let r=0;return i.forEach(s=>{const o=this.Le.tt(),a=`projects/${o.projectId}/databases/${o.database}/documents/${s.path.canonicalString()}`;e.mightContain(a)||(this.Ue(t,s,null),r++)}),r}rt(e){const t=new Map;this.Be.forEach((s,o)=>{const a=this.Je(o);if(a){if(s.current&&ZE(a.target)){const l=new Pt(a.target.path);this.ke.get(l)!==null||this.it(o,l)||this.Ue(o,l,Zi.newNoDocument(l,e))}s.be&&(t.set(o,s.ve()),s.Ce())}});let i=rn();this.qe.forEach((s,o)=>{let a=!0;o.forEachWhile(l=>{const c=this.Je(l);return!c||c.purpose==="TargetPurposeLimboResolution"||(a=!1,!1)}),a&&(i=i.add(s))}),this.ke.forEach((s,o)=>o.setReadTime(e));const r=new ex(e,t,this.Qe,this.ke,i);return this.ke=Pl(),this.qe=r2(),this.Qe=new ri(hn),r}$e(e,t){if(!this.ze(e))return;const i=this.it(e,t.key)?2:0;this.Ge(e).Fe(t.key,i),this.ke=this.ke.insert(t.key,t),this.qe=this.qe.insert(t.key,this.st(t.key).add(e))}Ue(e,t,i){if(!this.ze(e))return;const r=this.Ge(e);this.it(e,t)?r.Fe(t,1):r.Me(t),this.qe=this.qe.insert(t,this.st(t).delete(e)),i&&(this.ke=this.ke.insert(t,i))}removeTarget(e){this.Be.delete(e)}Ye(e){const t=this.Ge(e).ve();return this.Le.getRemoteKeysForTarget(e).size+t.addedDocuments.size-t.removedDocuments.size}xe(e){this.Ge(e).xe()}Ge(e){let t=this.Be.get(e);return t||(t=new i2,this.Be.set(e,t)),t}st(e){let t=this.qe.get(e);return t||(t=new Ni(hn),this.qe=this.qe.insert(e,t)),t}ze(e){const t=this.Je(e)!==null;return t||pt("WatchChangeAggregator","Detected inactive target",e),t}Je(e){const t=this.Be.get(e);return t&&t.Se?null:this.Le.ot(e)}je(e){this.Be.set(e,new i2),this.Le.getRemoteKeysForTarget(e).forEach(t=>{this.Ue(e,t,null)})}it(e,t){return this.Le.getRemoteKeysForTarget(e).has(t)}}function r2(){return new ri(Pt.comparator)}function s2(){return new ri(Pt.comparator)}const qX=(()=>({asc:"ASCENDING",desc:"DESCENDING"}))(),$X=(()=>({"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"}))(),YX=(()=>({and:"AND",or:"OR"}))();class KX{constructor(e,t){this.databaseId=e,this.useProto3Json=t}}function iT(n,e){return n.useProto3Json||q_(e)?e:{value:e}}function QX(n,e){return n.useProto3Json?`${new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+e.nanoseconds).slice(-9)}Z`:{seconds:""+e.seconds,nanos:e.nanoseconds}}function JX(n,e){return n.useProto3Json?e.toBase64():e.toUint8Array()}function Gh(n){return Kn(!!n),kt.fromTimestamp(function(t){const i=bl(t);return new Vr(i.seconds,i.nanos)}(n))}function ZX(n,e){return rT(n,e).canonicalString()}function rT(n,e){const t=function(r){return new qn(["projects",r.projectId,"databases",r.database])}(n).child("documents");return e===void 0?t:t.child(e)}function IU(n){const e=qn.fromString(n);return Kn(OU(e)),e}function Mw(n,e){const t=IU(e);if(t.get(1)!==n.databaseId.projectId)throw new Tt(qe.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+t.get(1)+" vs "+n.databaseId.projectId);if(t.get(3)!==n.databaseId.database)throw new Tt(qe.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+t.get(3)+" vs "+n.databaseId.database);return new Pt(NU(t))}function LU(n,e){return ZX(n.databaseId,e)}function eq(n){const e=IU(n);return e.length===4?qn.emptyPath():NU(e)}function o2(n){return new qn(["projects",n.databaseId.projectId,"databases",n.databaseId.database]).canonicalString()}function NU(n){return Kn(n.length>4&&n.get(4)==="documents"),n.popFirst(5)}function tq(n,e){let t;if("targetChange"in e){e.targetChange;const i=function(c){return c==="NO_CHANGE"?0:c==="ADD"?1:c==="REMOVE"?2:c==="CURRENT"?3:c==="RESET"?4:Wt()}(e.targetChange.targetChangeType||"NO_CHANGE"),r=e.targetChange.targetIds||[],s=function(c,d){return c.useProto3Json?(Kn(d===void 0||typeof d=="string"),ki.fromBase64String(d||"")):(Kn(d===void 0||d instanceof Buffer||d instanceof Uint8Array),ki.fromUint8Array(d||new Uint8Array))}(n,e.targetChange.resumeToken),o=e.targetChange.cause,a=o&&function(c){const d=c.code===void 0?qe.UNKNOWN:bU(c.code);return new Tt(d,c.message||"")}(o);t=new RU(i,r,s,a||null)}else if("documentChange"in e){e.documentChange;const i=e.documentChange;i.document,i.document.name,i.document.updateTime;const r=Mw(n,i.document.name),s=Gh(i.document.updateTime),o=i.document.createTime?Gh(i.document.createTime):kt.min(),a=new uo({mapValue:{fields:i.document.fields}}),l=Zi.newFoundDocument(r,s,o,a),c=i.targetIds||[],d=i.removedTargetIds||[];t=new Av(c,d,l.key,l)}else if("documentDelete"in e){e.documentDelete;const i=e.documentDelete;i.document;const r=Mw(n,i.document),s=i.readTime?Gh(i.readTime):kt.min(),o=Zi.newNoDocument(r,s),a=i.removedTargetIds||[];t=new Av([],a,o.key,o)}else if("documentRemove"in e){e.documentRemove;const i=e.documentRemove;i.document;const r=Mw(n,i.document),s=i.removedTargetIds||[];t=new Av([],s,r,null)}else{if(!("filter"in e))return Wt();{e.filter;const i=e.filter;i.targetId;const{count:r=0,unchangedNames:s}=i,o=new GX(r,s),a=i.targetId;t=new PU(a,o)}}return t}function nq(n,e){return{documents:[LU(n,e.path)]}}function iq(n,e){const t={structuredQuery:{}},i=e.path;let r;e.collectionGroup!==null?(r=i,t.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(r=i.popLast(),t.structuredQuery.from=[{collectionId:i.lastSegment()}]),t.parent=LU(n,r);const s=function(c){if(c.length!==0)return kU(To.create(c,"and"))}(e.filters);s&&(t.structuredQuery.where=s);const o=function(c){if(c.length!==0)return c.map(d=>function(p){return{field:ch(p.field),direction:oq(p.dir)}}(d))}(e.orderBy);o&&(t.structuredQuery.orderBy=o);const a=iT(n,e.limit);return a!==null&&(t.structuredQuery.limit=a),e.startAt&&(t.structuredQuery.startAt=function(c){return{before:c.inclusive,values:c.position}}(e.startAt)),e.endAt&&(t.structuredQuery.endAt=function(c){return{before:!c.inclusive,values:c.position}}(e.endAt)),{_t:t,parent:r}}function rq(n){let e=eq(n.parent);const t=n.structuredQuery,i=t.from?t.from.length:0;let r=null;if(i>0){Kn(i===1);const d=t.from[0];d.allDescendants?r=d.collectionId:e=e.child(d.collectionId)}let s=[];t.where&&(s=function(f){const p=DU(f);return p instanceof To&&pU(p)?p.getFilters():[p]}(t.where));let o=[];t.orderBy&&(o=function(f){return f.map(p=>function(_){return new x0(uh(_.field),function(x){switch(x){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(_.direction))}(p))}(t.orderBy));let a=null;t.limit&&(a=function(f){let p;return p=typeof f=="object"?f.value:f,q_(p)?null:p}(t.limit));let l=null;t.startAt&&(l=function(f){const p=!!f.before,m=f.values||[];return new _0(m,p)}(t.startAt));let c=null;return t.endAt&&(c=function(f){const p=!f.before,m=f.values||[];return new _0(m,p)}(t.endAt)),EX(e,r,o,s,a,"F",l,c)}function sq(n,e){const t=function(r){switch(r){case"TargetPurposeListen":return null;case"TargetPurposeExistenceFilterMismatch":return"existence-filter-mismatch";case"TargetPurposeExistenceFilterMismatchBloom":return"existence-filter-mismatch-bloom";case"TargetPurposeLimboResolution":return"limbo-document";default:return Wt()}}(e.purpose);return t==null?null:{"goog-listen-tags":t}}function DU(n){return n.unaryFilter!==void 0?function(t){switch(t.unaryFilter.op){case"IS_NAN":const i=uh(t.unaryFilter.field);return gi.create(i,"==",{doubleValue:NaN});case"IS_NULL":const r=uh(t.unaryFilter.field);return gi.create(r,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":const s=uh(t.unaryFilter.field);return gi.create(s,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const o=uh(t.unaryFilter.field);return gi.create(o,"!=",{nullValue:"NULL_VALUE"});default:return Wt()}}(n):n.fieldFilter!==void 0?function(t){return gi.create(uh(t.fieldFilter.field),function(r){switch(r){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";default:return Wt()}}(t.fieldFilter.op),t.fieldFilter.value)}(n):n.compositeFilter!==void 0?function(t){return To.create(t.compositeFilter.filters.map(i=>DU(i)),function(r){switch(r){case"AND":return"and";case"OR":return"or";default:return Wt()}}(t.compositeFilter.op))}(n):Wt()}function oq(n){return qX[n]}function aq(n){return $X[n]}function lq(n){return YX[n]}function ch(n){return{fieldPath:n.canonicalString()}}function uh(n){return pr.fromServerFormat(n.fieldPath)}function kU(n){return n instanceof gi?function(t){if(t.op==="=="){if(XI(t.value))return{unaryFilter:{field:ch(t.field),op:"IS_NAN"}};if(jI(t.value))return{unaryFilter:{field:ch(t.field),op:"IS_NULL"}}}else if(t.op==="!="){if(XI(t.value))return{unaryFilter:{field:ch(t.field),op:"IS_NOT_NAN"}};if(jI(t.value))return{unaryFilter:{field:ch(t.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:ch(t.field),op:aq(t.op),value:t.value}}}(n):n instanceof To?function(t){const i=t.getFilters().map(r=>kU(r));return i.length===1?i[0]:{compositeFilter:{op:lq(t.op),filters:i}}}(n):Wt()}function OU(n){return n.length>=4&&n.get(0)==="projects"&&n.get(2)==="databases"}/** * @license * Copyright 2017 Google LLC * @@ -1274,7 +1274,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class mq{constructor(e,t,i,r){this.remoteDocumentCache=e,this.mutationQueue=t,this.documentOverlayCache=i,this.indexManager=r}getDocument(e,t){let i=null;return this.documentOverlayCache.getOverlay(e,t).next(r=>(i=r,this.remoteDocumentCache.getEntry(e,t))).next(r=>(i!==null&&fp(i.mutation,r,ol.empty(),Vr.now()),r))}getDocuments(e,t){return this.remoteDocumentCache.getEntries(e,t).next(i=>this.getLocalViewOfDocuments(e,i,rn()).next(()=>i))}getLocalViewOfDocuments(e,t,i=rn()){const r=Oc();return this.populateOverlays(e,r,t).next(()=>this.computeViews(e,t,r,i).next(s=>{let o=qf();return s.forEach((a,l)=>{o=o.insert(a,l.overlayedDocument)}),o}))}getOverlayedDocuments(e,t){const i=Oc();return this.populateOverlays(e,i,t).next(()=>this.computeViews(e,t,i,rn()))}populateOverlays(e,t,i){const r=[];return i.forEach(s=>{t.has(s)||r.push(s)}),this.documentOverlayCache.getOverlays(e,r).next(s=>{s.forEach((o,a)=>{t.set(o,a)})})}computeViews(e,t,i,r){let s=Pl();const o=dp(),a=function(){return dp()}();return t.forEach((l,c)=>{const d=i.get(c.key);r.has(c.key)&&(d===void 0||d.mutation instanceof Z_)?s=s.insert(c.key,c):d!==void 0?(o.set(c.key,d.mutation.getFieldMask()),fp(d.mutation,c,d.mutation.getFieldMask(),Vr.now())):o.set(c.key,ol.empty())}),this.recalculateAndSaveOverlays(e,s).next(l=>(l.forEach((c,d)=>o.set(c,d)),t.forEach((c,d)=>{var f;return a.set(c,new pq(d,(f=o.get(c))!==null&&f!==void 0?f:null))}),a))}recalculateAndSaveOverlays(e,t){const i=dp();let r=new ri((o,a)=>o-a),s=rn();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,t).next(o=>{for(const a of o)a.keys().forEach(l=>{const c=t.get(l);if(c===null)return;let d=i.get(l)||ol.empty();d=a.applyToLocalView(c,d),i.set(l,d);const f=(r.get(a.batchId)||rn()).add(l);r=r.insert(a.batchId,f)})}).next(()=>{const o=[],a=r.getReverseIterator();for(;a.hasNext();){const l=a.getNext(),c=l.key,d=l.value,f=SU();d.forEach(p=>{if(!s.has(p)){const m=AU(t.get(p),i.get(p));m!==null&&f.set(p,m),s=s.add(p)}}),o.push(this.documentOverlayCache.saveOverlays(e,c,f))}return Ie.waitFor(o)}).next(()=>i)}recalculateAndSaveOverlaysForDocumentKeys(e,t){return this.remoteDocumentCache.getEntries(e,t).next(i=>this.recalculateAndSaveOverlays(e,i))}getDocumentsMatchingQuery(e,t,i,r){return function(o){return Pt.isDocumentKey(o.path)&&o.collectionGroup===null&&o.filters.length===0}(t)?this.getDocumentsMatchingDocumentQuery(e,t.path):TX(t)?this.getDocumentsMatchingCollectionGroupQuery(e,t,i,r):this.getDocumentsMatchingCollectionQuery(e,t,i,r)}getNextDocuments(e,t,i,r){return this.remoteDocumentCache.getAllFromCollectionGroup(e,t,i,r).next(s=>{const o=r-s.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(e,t,i.largestBatchId,r-s.size):Ie.resolve(Oc());let a=-1,l=s;return o.next(c=>Ie.forEach(c,(d,f)=>(a{l=l.insert(d,p)}))).next(()=>this.populateOverlays(e,c,s)).next(()=>this.computeViews(e,l,c,rn())).next(d=>({batchId:a,changes:PX(d)})))})}getDocumentsMatchingDocumentQuery(e,t){return this.getDocument(e,new Pt(t)).next(i=>{let r=qf();return i.isFoundDocument()&&(r=r.insert(i.key,i)),r})}getDocumentsMatchingCollectionGroupQuery(e,t,i,r){const s=t.collectionGroup;let o=qf();return this.indexManager.getCollectionParents(e,s).next(a=>Ie.forEach(a,l=>{const c=function(f,p){return new Y_(p,null,f.explicitOrderBy.slice(),f.filters.slice(),f.limit,f.limitType,f.startAt,f.endAt)}(t,l.child(s));return this.getDocumentsMatchingCollectionQuery(e,c,i,r).next(d=>{d.forEach((f,p)=>{o=o.insert(f,p)})})}).next(()=>o))}getDocumentsMatchingCollectionQuery(e,t,i,r){let s;return this.documentOverlayCache.getOverlaysForCollection(e,t.path,i.largestBatchId).next(o=>(s=o,this.remoteDocumentCache.getDocumentsMatchingQuery(e,t,i,s,r))).next(o=>{s.forEach((l,c)=>{const d=c.getKey();o.get(d)===null&&(o=o.insert(d,Zi.newInvalidDocument(d)))});let a=qf();return o.forEach((l,c)=>{const d=s.get(l);d!==void 0&&fp(d.mutation,c,ol.empty(),Vr.now()),Q_(t,c)&&(a=a.insert(l,c))}),a})}}/** + */class mq{constructor(e,t,i,r){this.remoteDocumentCache=e,this.mutationQueue=t,this.documentOverlayCache=i,this.indexManager=r}getDocument(e,t){let i=null;return this.documentOverlayCache.getOverlay(e,t).next(r=>(i=r,this.remoteDocumentCache.getEntry(e,t))).next(r=>(i!==null&&fp(i.mutation,r,ol.empty(),Vr.now()),r))}getDocuments(e,t){return this.remoteDocumentCache.getEntries(e,t).next(i=>this.getLocalViewOfDocuments(e,i,rn()).next(()=>i))}getLocalViewOfDocuments(e,t,i=rn()){const r=Oc();return this.populateOverlays(e,r,t).next(()=>this.computeViews(e,t,r,i).next(s=>{let o=qf();return s.forEach((a,l)=>{o=o.insert(a,l.overlayedDocument)}),o}))}getOverlayedDocuments(e,t){const i=Oc();return this.populateOverlays(e,i,t).next(()=>this.computeViews(e,t,i,rn()))}populateOverlays(e,t,i){const r=[];return i.forEach(s=>{t.has(s)||r.push(s)}),this.documentOverlayCache.getOverlays(e,r).next(s=>{s.forEach((o,a)=>{t.set(o,a)})})}computeViews(e,t,i,r){let s=Pl();const o=dp(),a=function(){return dp()}();return t.forEach((l,c)=>{const d=i.get(c.key);r.has(c.key)&&(d===void 0||d.mutation instanceof Z_)?s=s.insert(c.key,c):d!==void 0?(o.set(c.key,d.mutation.getFieldMask()),fp(d.mutation,c,d.mutation.getFieldMask(),Vr.now())):o.set(c.key,ol.empty())}),this.recalculateAndSaveOverlays(e,s).next(l=>(l.forEach((c,d)=>o.set(c,d)),t.forEach((c,d)=>{var f;return a.set(c,new pq(d,(f=o.get(c))!==null&&f!==void 0?f:null))}),a))}recalculateAndSaveOverlays(e,t){const i=dp();let r=new ri((o,a)=>o-a),s=rn();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,t).next(o=>{for(const a of o)a.keys().forEach(l=>{const c=t.get(l);if(c===null)return;let d=i.get(l)||ol.empty();d=a.applyToLocalView(c,d),i.set(l,d);const f=(r.get(a.batchId)||rn()).add(l);r=r.insert(a.batchId,f)})}).next(()=>{const o=[],a=r.getReverseIterator();for(;a.hasNext();){const l=a.getNext(),c=l.key,d=l.value,f=wU();d.forEach(p=>{if(!s.has(p)){const m=MU(t.get(p),i.get(p));m!==null&&f.set(p,m),s=s.add(p)}}),o.push(this.documentOverlayCache.saveOverlays(e,c,f))}return Ie.waitFor(o)}).next(()=>i)}recalculateAndSaveOverlaysForDocumentKeys(e,t){return this.remoteDocumentCache.getEntries(e,t).next(i=>this.recalculateAndSaveOverlays(e,i))}getDocumentsMatchingQuery(e,t,i,r){return function(o){return Pt.isDocumentKey(o.path)&&o.collectionGroup===null&&o.filters.length===0}(t)?this.getDocumentsMatchingDocumentQuery(e,t.path):TX(t)?this.getDocumentsMatchingCollectionGroupQuery(e,t,i,r):this.getDocumentsMatchingCollectionQuery(e,t,i,r)}getNextDocuments(e,t,i,r){return this.remoteDocumentCache.getAllFromCollectionGroup(e,t,i,r).next(s=>{const o=r-s.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(e,t,i.largestBatchId,r-s.size):Ie.resolve(Oc());let a=-1,l=s;return o.next(c=>Ie.forEach(c,(d,f)=>(a{l=l.insert(d,p)}))).next(()=>this.populateOverlays(e,c,s)).next(()=>this.computeViews(e,l,c,rn())).next(d=>({batchId:a,changes:PX(d)})))})}getDocumentsMatchingDocumentQuery(e,t){return this.getDocument(e,new Pt(t)).next(i=>{let r=qf();return i.isFoundDocument()&&(r=r.insert(i.key,i)),r})}getDocumentsMatchingCollectionGroupQuery(e,t,i,r){const s=t.collectionGroup;let o=qf();return this.indexManager.getCollectionParents(e,s).next(a=>Ie.forEach(a,l=>{const c=function(f,p){return new Y_(p,null,f.explicitOrderBy.slice(),f.filters.slice(),f.limit,f.limitType,f.startAt,f.endAt)}(t,l.child(s));return this.getDocumentsMatchingCollectionQuery(e,c,i,r).next(d=>{d.forEach((f,p)=>{o=o.insert(f,p)})})}).next(()=>o))}getDocumentsMatchingCollectionQuery(e,t,i,r){let s;return this.documentOverlayCache.getOverlaysForCollection(e,t.path,i.largestBatchId).next(o=>(s=o,this.remoteDocumentCache.getDocumentsMatchingQuery(e,t,i,s,r))).next(o=>{s.forEach((l,c)=>{const d=c.getKey();o.get(d)===null&&(o=o.insert(d,Zi.newInvalidDocument(d)))});let a=qf();return o.forEach((l,c)=>{const d=s.get(l);d!==void 0&&fp(d.mutation,c,ol.empty(),Vr.now()),Q_(t,c)&&(a=a.insert(l,c))}),a})}}/** * @license * Copyright 2020 Google LLC * @@ -1439,7 +1439,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class Mq{constructor(){this.Gi=!1,this.zi=!1,this.ji=100,this.Hi=function(){return Pj()?8:aX(or())>0?6:4}()}initialize(e,t){this.Ji=e,this.indexManager=t,this.Gi=!0}getDocumentsMatchingQuery(e,t,i,r){const s={result:null};return this.Yi(e,t).next(o=>{s.result=o}).next(()=>{if(!s.result)return this.Zi(e,t,r,i).next(o=>{s.result=o})}).next(()=>{if(s.result)return;const o=new Aq;return this.Xi(e,t,o).next(a=>{if(s.result=a,this.zi)return this.es(e,t,o,a.size)})}).next(()=>s.result)}es(e,t,i,r){return i.documentReadCountthis.Hi*r?(wf()<=Qt.DEBUG&&pt("QueryEngine","The SDK decides to create cache indexes for query:",lh(t),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(e,yo(t))):Ie.resolve())}Yi(e,t){if(KI(t))return Ie.resolve(null);let i=yo(t);return this.indexManager.getIndexType(e,i).next(r=>r===0?null:(t.limit!==null&&r===1&&(t=eT(t,null,"F"),i=yo(t)),this.indexManager.getDocumentsMatchingTarget(e,i).next(s=>{const o=rn(...s);return this.Ji.getDocuments(e,o).next(a=>this.indexManager.getMinOffset(e,i).next(l=>{const c=this.ts(t,a);return this.ns(t,c,o,l.readTime)?this.Yi(e,eT(t,null,"F")):this.rs(e,c,t,l)}))})))}Zi(e,t,i,r){return KI(t)||r.isEqual(kt.min())?Ie.resolve(null):this.Ji.getDocuments(e,i).next(s=>{const o=this.ts(t,s);return this.ns(t,o,i,r)?Ie.resolve(null):(wf()<=Qt.DEBUG&&pt("QueryEngine","Re-using previous result from %s to execute query: %s",r.toString(),lh(t)),this.rs(e,o,t,nX(r,-1)).next(a=>a))})}ts(e,t){let i=new Ni(_U(e));return t.forEach((r,s)=>{Q_(e,s)&&(i=i.add(s))}),i}ns(e,t,i,r){if(e.limit===null)return!1;if(i.size!==t.size)return!0;const s=e.limitType==="F"?t.last():t.first();return!!s&&(s.hasPendingWrites||s.version.compareTo(r)>0)}Xi(e,t,i){return wf()<=Qt.DEBUG&&pt("QueryEngine","Using full collection scan to execute query:",lh(t)),this.Ji.getDocumentsMatchingQuery(e,t,Cl.min(),i)}rs(e,t,i,r){return this.Ji.getDocumentsMatchingQuery(e,i,r).next(s=>(t.forEach(o=>{s=s.insert(o.key,o)}),s))}}/** + */class Mq{constructor(){this.Gi=!1,this.zi=!1,this.ji=100,this.Hi=function(){return Pj()?8:aX(or())>0?6:4}()}initialize(e,t){this.Ji=e,this.indexManager=t,this.Gi=!0}getDocumentsMatchingQuery(e,t,i,r){const s={result:null};return this.Yi(e,t).next(o=>{s.result=o}).next(()=>{if(!s.result)return this.Zi(e,t,r,i).next(o=>{s.result=o})}).next(()=>{if(s.result)return;const o=new Aq;return this.Xi(e,t,o).next(a=>{if(s.result=a,this.zi)return this.es(e,t,o,a.size)})}).next(()=>s.result)}es(e,t,i,r){return i.documentReadCountthis.Hi*r?(wf()<=Qt.DEBUG&&pt("QueryEngine","The SDK decides to create cache indexes for query:",lh(t),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(e,yo(t))):Ie.resolve())}Yi(e,t){if(KI(t))return Ie.resolve(null);let i=yo(t);return this.indexManager.getIndexType(e,i).next(r=>r===0?null:(t.limit!==null&&r===1&&(t=eT(t,null,"F"),i=yo(t)),this.indexManager.getDocumentsMatchingTarget(e,i).next(s=>{const o=rn(...s);return this.Ji.getDocuments(e,o).next(a=>this.indexManager.getMinOffset(e,i).next(l=>{const c=this.ts(t,a);return this.ns(t,c,o,l.readTime)?this.Yi(e,eT(t,null,"F")):this.rs(e,c,t,l)}))})))}Zi(e,t,i,r){return KI(t)||r.isEqual(kt.min())?Ie.resolve(null):this.Ji.getDocuments(e,i).next(s=>{const o=this.ts(t,s);return this.ns(t,o,i,r)?Ie.resolve(null):(wf()<=Qt.DEBUG&&pt("QueryEngine","Re-using previous result from %s to execute query: %s",r.toString(),lh(t)),this.rs(e,o,t,nX(r,-1)).next(a=>a))})}ts(e,t){let i=new Ni(xU(e));return t.forEach((r,s)=>{Q_(e,s)&&(i=i.add(s))}),i}ns(e,t,i,r){if(e.limit===null)return!1;if(i.size!==t.size)return!0;const s=e.limitType==="F"?t.last():t.first();return!!s&&(s.hasPendingWrites||s.version.compareTo(r)>0)}Xi(e,t,i){return wf()<=Qt.DEBUG&&pt("QueryEngine","Using full collection scan to execute query:",lh(t)),this.Ji.getDocumentsMatchingQuery(e,t,Cl.min(),i)}rs(e,t,i,r){return this.Ji.getDocumentsMatchingQuery(e,i,r).next(s=>(t.forEach(o=>{s=s.insert(o.key,o)}),s))}}/** * @license * Copyright 2020 Google LLC * @@ -1454,7 +1454,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class Cq{constructor(e,t,i,r){this.persistence=e,this.ss=t,this.serializer=r,this.os=new ri(hn),this._s=new Cd(s=>mM(s),gM),this.us=new Map,this.cs=e.getRemoteDocumentCache(),this.Ur=e.getTargetCache(),this.Gr=e.getBundleCache(),this.ls(i)}ls(e){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(e),this.indexManager=this.persistence.getIndexManager(e),this.mutationQueue=this.persistence.getMutationQueue(e,this.indexManager),this.localDocuments=new mq(this.cs,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.cs.setIndexManager(this.indexManager),this.ss.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",t=>e.collect(t,this.os))}}function bq(n,e,t,i){return new Cq(n,e,t,i)}async function OU(n,e){const t=en(n);return await t.persistence.runTransaction("Handle user change","readonly",i=>{let r;return t.mutationQueue.getAllMutationBatches(i).next(s=>(r=s,t.ls(e),t.mutationQueue.getAllMutationBatches(i))).next(s=>{const o=[],a=[];let l=rn();for(const c of r){o.push(c.batchId);for(const d of c.mutations)l=l.add(d.key)}for(const c of s){a.push(c.batchId);for(const d of c.mutations)l=l.add(d.key)}return t.localDocuments.getDocuments(i,l).next(c=>({hs:c,removedBatchIds:o,addedBatchIds:a}))})})}function UU(n){const e=en(n);return e.persistence.runTransaction("Get last remote snapshot version","readonly",t=>e.Ur.getLastRemoteSnapshotVersion(t))}function Pq(n,e){const t=en(n),i=e.snapshotVersion;let r=t.os;return t.persistence.runTransaction("Apply remote event","readwrite-primary",s=>{const o=t.cs.newChangeBuffer({trackRemovals:!0});r=t.os;const a=[];e.targetChanges.forEach((d,f)=>{const p=r.get(f);if(!p)return;a.push(t.Ur.removeMatchingKeys(s,d.removedDocuments,f).next(()=>t.Ur.addMatchingKeys(s,d.addedDocuments,f)));let m=p.withSequenceNumber(s.currentSequenceNumber);e.targetMismatches.get(f)!==null?m=m.withResumeToken(ki.EMPTY_BYTE_STRING,kt.min()).withLastLimboFreeSnapshotVersion(kt.min()):d.resumeToken.approximateByteSize()>0&&(m=m.withResumeToken(d.resumeToken,i)),r=r.insert(f,m),function(S,x,y){return S.resumeToken.approximateByteSize()===0||x.snapshotVersion.toMicroseconds()-S.snapshotVersion.toMicroseconds()>=3e8?!0:y.addedDocuments.size+y.modifiedDocuments.size+y.removedDocuments.size>0}(p,m,d)&&a.push(t.Ur.updateTargetData(s,m))});let l=Pl(),c=rn();if(e.documentUpdates.forEach(d=>{e.resolvedLimboDocuments.has(d)&&a.push(t.persistence.referenceDelegate.updateLimboDocument(s,d))}),a.push(Rq(s,o,e.documentUpdates).next(d=>{l=d.Ps,c=d.Is})),!i.isEqual(kt.min())){const d=t.Ur.getLastRemoteSnapshotVersion(s).next(f=>t.Ur.setTargetsMetadata(s,s.currentSequenceNumber,i));a.push(d)}return Ie.waitFor(a).next(()=>o.apply(s)).next(()=>t.localDocuments.getLocalViewOfDocuments(s,l,c)).next(()=>l)}).then(s=>(t.os=r,s))}function Rq(n,e,t){let i=rn(),r=rn();return t.forEach(s=>i=i.add(s)),e.getEntries(n,i).next(s=>{let o=Pl();return t.forEach((a,l)=>{const c=s.get(a);l.isFoundDocument()!==c.isFoundDocument()&&(r=r.add(a)),l.isNoDocument()&&l.version.isEqual(kt.min())?(e.removeEntry(a,l.readTime),o=o.insert(a,l)):!c.isValidDocument()||l.version.compareTo(c.version)>0||l.version.compareTo(c.version)===0&&c.hasPendingWrites?(e.addEntry(l),o=o.insert(a,l)):pt("LocalStore","Ignoring outdated watch update for ",a,". Current version:",c.version," Watch version:",l.version)}),{Ps:o,Is:r}})}function Iq(n,e){const t=en(n);return t.persistence.runTransaction("Allocate target","readwrite",i=>{let r;return t.Ur.getTargetData(i,e).next(s=>s?(r=s,Ie.resolve(r)):t.Ur.allocateTargetId(i).next(o=>(r=new al(e,o,"TargetPurposeListen",i.currentSequenceNumber),t.Ur.addTargetData(i,r).next(()=>r))))}).then(i=>{const r=t.os.get(i.targetId);return(r===null||i.snapshotVersion.compareTo(r.snapshotVersion)>0)&&(t.os=t.os.insert(i.targetId,i),t._s.set(e,i.targetId)),i})}async function sT(n,e,t){const i=en(n),r=i.os.get(e),s=t?"readwrite":"readwrite-primary";try{t||await i.persistence.runTransaction("Release target",s,o=>i.persistence.referenceDelegate.removeTarget(o,r))}catch(o){if(!km(o))throw o;pt("LocalStore",`Failed to update sequence numbers for target ${e}: ${o}`)}i.os=i.os.remove(e),i._s.delete(r.target)}function a2(n,e,t){const i=en(n);let r=kt.min(),s=rn();return i.persistence.runTransaction("Execute query","readwrite",o=>function(l,c,d){const f=en(l),p=f._s.get(d);return p!==void 0?Ie.resolve(f.os.get(p)):f.Ur.getTargetData(c,d)}(i,o,yo(e)).next(a=>{if(a)return r=a.lastLimboFreeSnapshotVersion,i.Ur.getMatchingKeysForTargetId(o,a.targetId).next(l=>{s=l})}).next(()=>i.ss.getDocumentsMatchingQuery(o,e,t?r:kt.min(),t?s:rn())).next(a=>(Lq(i,MX(e),a),{documents:a,Ts:s})))}function Lq(n,e,t){let i=n.us.get(e)||kt.min();t.forEach((r,s)=>{s.readTime.compareTo(i)>0&&(i=s.readTime)}),n.us.set(e,i)}class l2{constructor(){this.activeTargetIds=LX()}fs(e){this.activeTargetIds=this.activeTargetIds.add(e)}gs(e){this.activeTargetIds=this.activeTargetIds.delete(e)}Vs(){const e={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(e)}}class Nq{constructor(){this.so=new l2,this.oo={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,t,i){}addLocalQueryTarget(e,t=!0){return t&&this.so.fs(e),this.oo[e]||"not-current"}updateQueryState(e,t,i){this.oo[e]=t}removeLocalQueryTarget(e){this.so.gs(e)}isLocalQueryTarget(e){return this.so.activeTargetIds.has(e)}clearQueryState(e){delete this.oo[e]}getAllActiveQueryTargets(){return this.so.activeTargetIds}isActiveQueryTarget(e){return this.so.activeTargetIds.has(e)}start(){return this.so=new l2,Promise.resolve()}handleUserChange(e,t,i){}setOnlineState(e){}shutdown(){}writeSequenceNumber(e){}notifyBundleLoaded(e){}}/** + */class Cq{constructor(e,t,i,r){this.persistence=e,this.ss=t,this.serializer=r,this.os=new ri(hn),this._s=new Cd(s=>mM(s),gM),this.us=new Map,this.cs=e.getRemoteDocumentCache(),this.Ur=e.getTargetCache(),this.Gr=e.getBundleCache(),this.ls(i)}ls(e){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(e),this.indexManager=this.persistence.getIndexManager(e),this.mutationQueue=this.persistence.getMutationQueue(e,this.indexManager),this.localDocuments=new mq(this.cs,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.cs.setIndexManager(this.indexManager),this.ss.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",t=>e.collect(t,this.os))}}function bq(n,e,t,i){return new Cq(n,e,t,i)}async function UU(n,e){const t=en(n);return await t.persistence.runTransaction("Handle user change","readonly",i=>{let r;return t.mutationQueue.getAllMutationBatches(i).next(s=>(r=s,t.ls(e),t.mutationQueue.getAllMutationBatches(i))).next(s=>{const o=[],a=[];let l=rn();for(const c of r){o.push(c.batchId);for(const d of c.mutations)l=l.add(d.key)}for(const c of s){a.push(c.batchId);for(const d of c.mutations)l=l.add(d.key)}return t.localDocuments.getDocuments(i,l).next(c=>({hs:c,removedBatchIds:o,addedBatchIds:a}))})})}function FU(n){const e=en(n);return e.persistence.runTransaction("Get last remote snapshot version","readonly",t=>e.Ur.getLastRemoteSnapshotVersion(t))}function Pq(n,e){const t=en(n),i=e.snapshotVersion;let r=t.os;return t.persistence.runTransaction("Apply remote event","readwrite-primary",s=>{const o=t.cs.newChangeBuffer({trackRemovals:!0});r=t.os;const a=[];e.targetChanges.forEach((d,f)=>{const p=r.get(f);if(!p)return;a.push(t.Ur.removeMatchingKeys(s,d.removedDocuments,f).next(()=>t.Ur.addMatchingKeys(s,d.addedDocuments,f)));let m=p.withSequenceNumber(s.currentSequenceNumber);e.targetMismatches.get(f)!==null?m=m.withResumeToken(ki.EMPTY_BYTE_STRING,kt.min()).withLastLimboFreeSnapshotVersion(kt.min()):d.resumeToken.approximateByteSize()>0&&(m=m.withResumeToken(d.resumeToken,i)),r=r.insert(f,m),function(S,x,y){return S.resumeToken.approximateByteSize()===0||x.snapshotVersion.toMicroseconds()-S.snapshotVersion.toMicroseconds()>=3e8?!0:y.addedDocuments.size+y.modifiedDocuments.size+y.removedDocuments.size>0}(p,m,d)&&a.push(t.Ur.updateTargetData(s,m))});let l=Pl(),c=rn();if(e.documentUpdates.forEach(d=>{e.resolvedLimboDocuments.has(d)&&a.push(t.persistence.referenceDelegate.updateLimboDocument(s,d))}),a.push(Rq(s,o,e.documentUpdates).next(d=>{l=d.Ps,c=d.Is})),!i.isEqual(kt.min())){const d=t.Ur.getLastRemoteSnapshotVersion(s).next(f=>t.Ur.setTargetsMetadata(s,s.currentSequenceNumber,i));a.push(d)}return Ie.waitFor(a).next(()=>o.apply(s)).next(()=>t.localDocuments.getLocalViewOfDocuments(s,l,c)).next(()=>l)}).then(s=>(t.os=r,s))}function Rq(n,e,t){let i=rn(),r=rn();return t.forEach(s=>i=i.add(s)),e.getEntries(n,i).next(s=>{let o=Pl();return t.forEach((a,l)=>{const c=s.get(a);l.isFoundDocument()!==c.isFoundDocument()&&(r=r.add(a)),l.isNoDocument()&&l.version.isEqual(kt.min())?(e.removeEntry(a,l.readTime),o=o.insert(a,l)):!c.isValidDocument()||l.version.compareTo(c.version)>0||l.version.compareTo(c.version)===0&&c.hasPendingWrites?(e.addEntry(l),o=o.insert(a,l)):pt("LocalStore","Ignoring outdated watch update for ",a,". Current version:",c.version," Watch version:",l.version)}),{Ps:o,Is:r}})}function Iq(n,e){const t=en(n);return t.persistence.runTransaction("Allocate target","readwrite",i=>{let r;return t.Ur.getTargetData(i,e).next(s=>s?(r=s,Ie.resolve(r)):t.Ur.allocateTargetId(i).next(o=>(r=new al(e,o,"TargetPurposeListen",i.currentSequenceNumber),t.Ur.addTargetData(i,r).next(()=>r))))}).then(i=>{const r=t.os.get(i.targetId);return(r===null||i.snapshotVersion.compareTo(r.snapshotVersion)>0)&&(t.os=t.os.insert(i.targetId,i),t._s.set(e,i.targetId)),i})}async function sT(n,e,t){const i=en(n),r=i.os.get(e),s=t?"readwrite":"readwrite-primary";try{t||await i.persistence.runTransaction("Release target",s,o=>i.persistence.referenceDelegate.removeTarget(o,r))}catch(o){if(!km(o))throw o;pt("LocalStore",`Failed to update sequence numbers for target ${e}: ${o}`)}i.os=i.os.remove(e),i._s.delete(r.target)}function a2(n,e,t){const i=en(n);let r=kt.min(),s=rn();return i.persistence.runTransaction("Execute query","readwrite",o=>function(l,c,d){const f=en(l),p=f._s.get(d);return p!==void 0?Ie.resolve(f.os.get(p)):f.Ur.getTargetData(c,d)}(i,o,yo(e)).next(a=>{if(a)return r=a.lastLimboFreeSnapshotVersion,i.Ur.getMatchingKeysForTargetId(o,a.targetId).next(l=>{s=l})}).next(()=>i.ss.getDocumentsMatchingQuery(o,e,t?r:kt.min(),t?s:rn())).next(a=>(Lq(i,MX(e),a),{documents:a,Ts:s})))}function Lq(n,e,t){let i=n.us.get(e)||kt.min();t.forEach((r,s)=>{s.readTime.compareTo(i)>0&&(i=s.readTime)}),n.us.set(e,i)}class l2{constructor(){this.activeTargetIds=LX()}fs(e){this.activeTargetIds=this.activeTargetIds.add(e)}gs(e){this.activeTargetIds=this.activeTargetIds.delete(e)}Vs(){const e={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(e)}}class Nq{constructor(){this.so=new l2,this.oo={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,t,i){}addLocalQueryTarget(e,t=!0){return t&&this.so.fs(e),this.oo[e]||"not-current"}updateQueryState(e,t,i){this.oo[e]=t}removeLocalQueryTarget(e){this.so.gs(e)}isLocalQueryTarget(e){return this.so.activeTargetIds.has(e)}clearQueryState(e){delete this.oo[e]}getAllActiveQueryTargets(){return this.so.activeTargetIds}isActiveQueryTarget(e){return this.so.activeTargetIds.has(e)}start(){return this.so=new l2,Promise.resolve()}handleUserChange(e,t,i){}setOnlineState(e){}shutdown(){}writeSequenceNumber(e){}notifyBundleLoaded(e){}}/** * @license * Copyright 2019 Google LLC * @@ -1544,7 +1544,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const Xi="WebChannelConnection";class Uq extends class{constructor(t){this.databaseInfo=t,this.databaseId=t.databaseId;const i=t.ssl?"https":"http",r=encodeURIComponent(this.databaseId.projectId),s=encodeURIComponent(this.databaseId.database);this.Do=i+"://"+t.host,this.vo=`projects/${r}/databases/${s}`,this.Co=this.databaseId.database==="(default)"?`project_id=${r}`:`project_id=${r}&database_id=${s}`}get Fo(){return!1}Mo(t,i,r,s,o){const a=Cw(),l=this.xo(t,i.toUriEncodedString());pt("RestConnection",`Sending RPC '${t}' ${a}:`,l,r);const c={"google-cloud-resource-prefix":this.vo,"x-goog-request-params":this.Co};return this.Oo(c,s,o),this.No(t,l,c,r).then(d=>(pt("RestConnection",`Received RPC '${t}' ${a}: `,d),d),d=>{throw od("RestConnection",`RPC '${t}' ${a} failed with error: `,d,"url: ",l,"request:",r),d})}Lo(t,i,r,s,o,a){return this.Mo(t,i,r,s,o)}Oo(t,i,r){t["X-Goog-Api-Client"]=function(){return"gl-js/ fire/"+Md}(),t["Content-Type"]="text/plain",this.databaseInfo.appId&&(t["X-Firebase-GMPID"]=this.databaseInfo.appId),i&&i.headers.forEach((s,o)=>t[o]=s),r&&r.headers.forEach((s,o)=>t[o]=s)}xo(t,i){const r=kq[t];return`${this.Do}/v1/${i}:${r}`}terminate(){}}{constructor(e){super(e),this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams,this.longPollingOptions=e.longPollingOptions}No(e,t,i,r){const s=Cw();return new Promise((o,a)=>{const l=new rU;l.setWithCredentials(!0),l.listenOnce(sU.COMPLETE,()=>{try{switch(l.getLastErrorCode()){case Ev.NO_ERROR:const d=l.getResponseJson();pt(Xi,`XHR for RPC '${e}' ${s} received:`,JSON.stringify(d)),o(d);break;case Ev.TIMEOUT:pt(Xi,`RPC '${e}' ${s} timed out`),a(new Tt(qe.DEADLINE_EXCEEDED,"Request time out"));break;case Ev.HTTP_ERROR:const f=l.getStatus();if(pt(Xi,`RPC '${e}' ${s} failed with status:`,f,"response text:",l.getResponseText()),f>0){let p=l.getResponseJson();Array.isArray(p)&&(p=p[0]);const m=p==null?void 0:p.error;if(m&&m.status&&m.message){const _=function(x){const y=x.toLowerCase().replace(/_/g,"-");return Object.values(qe).indexOf(y)>=0?y:qe.UNKNOWN}(m.status);a(new Tt(_,m.message))}else a(new Tt(qe.UNKNOWN,"Server responded with status "+l.getStatus()))}else a(new Tt(qe.UNAVAILABLE,"Connection failed."));break;default:Wt()}}finally{pt(Xi,`RPC '${e}' ${s} completed.`)}});const c=JSON.stringify(r);pt(Xi,`RPC '${e}' ${s} sending request:`,r),l.send(t,"POST",c,i,15)})}Bo(e,t,i){const r=Cw(),s=[this.Do,"/","google.firestore.v1.Firestore","/",e,"/channel"],o=lU(),a=aU(),l={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:`projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling},c=this.longPollingOptions.timeoutSeconds;c!==void 0&&(l.longPollingTimeout=Math.round(1e3*c)),this.useFetchStreams&&(l.useFetchStreams=!0),this.Oo(l.initMessageHeaders,t,i),l.encodeInitMessageHeaders=!0;const d=s.join("");pt(Xi,`Creating RPC '${e}' stream ${r}: ${d}`,l);const f=o.createWebChannel(d,l);let p=!1,m=!1;const _=new Oq({Io:x=>{m?pt(Xi,`Not sending because RPC '${e}' stream ${r} is closed:`,x):(p||(pt(Xi,`Opening RPC '${e}' stream ${r} transport.`),f.open(),p=!0),pt(Xi,`RPC '${e}' stream ${r} sending:`,x),f.send(x))},To:()=>f.close()}),S=(x,y,E)=>{x.listen(y,w=>{try{E(w)}catch(M){setTimeout(()=>{throw M},0)}})};return S(f,Xf.EventType.OPEN,()=>{m||(pt(Xi,`RPC '${e}' stream ${r} transport opened.`),_.yo())}),S(f,Xf.EventType.CLOSE,()=>{m||(m=!0,pt(Xi,`RPC '${e}' stream ${r} transport closed`),_.So())}),S(f,Xf.EventType.ERROR,x=>{m||(m=!0,od(Xi,`RPC '${e}' stream ${r} transport errored:`,x),_.So(new Tt(qe.UNAVAILABLE,"The operation could not be completed")))}),S(f,Xf.EventType.MESSAGE,x=>{var y;if(!m){const E=x.data[0];Kn(!!E);const w=E,M=w.error||((y=w[0])===null||y===void 0?void 0:y.error);if(M){pt(Xi,`RPC '${e}' stream ${r} received error:`,M);const O=M.status;let k=function(D){const A=ui[D];if(A!==void 0)return CU(A)}(O),I=M.message;k===void 0&&(k=qe.INTERNAL,I="Unknown error status: "+O+" with message "+M.message),m=!0,_.So(new Tt(k,I)),f.close()}else pt(Xi,`RPC '${e}' stream ${r} received:`,E),_.bo(E)}}),S(a,oU.STAT_EVENT,x=>{x.stat===$E.PROXY?pt(Xi,`RPC '${e}' stream ${r} detected buffering proxy`):x.stat===$E.NOPROXY&&pt(Xi,`RPC '${e}' stream ${r} detected no buffering proxy`)}),setTimeout(()=>{_.wo()},0),_}}function bw(){return typeof document<"u"?document:null}/** + */const Xi="WebChannelConnection";class Uq extends class{constructor(t){this.databaseInfo=t,this.databaseId=t.databaseId;const i=t.ssl?"https":"http",r=encodeURIComponent(this.databaseId.projectId),s=encodeURIComponent(this.databaseId.database);this.Do=i+"://"+t.host,this.vo=`projects/${r}/databases/${s}`,this.Co=this.databaseId.database==="(default)"?`project_id=${r}`:`project_id=${r}&database_id=${s}`}get Fo(){return!1}Mo(t,i,r,s,o){const a=Cw(),l=this.xo(t,i.toUriEncodedString());pt("RestConnection",`Sending RPC '${t}' ${a}:`,l,r);const c={"google-cloud-resource-prefix":this.vo,"x-goog-request-params":this.Co};return this.Oo(c,s,o),this.No(t,l,c,r).then(d=>(pt("RestConnection",`Received RPC '${t}' ${a}: `,d),d),d=>{throw od("RestConnection",`RPC '${t}' ${a} failed with error: `,d,"url: ",l,"request:",r),d})}Lo(t,i,r,s,o,a){return this.Mo(t,i,r,s,o)}Oo(t,i,r){t["X-Goog-Api-Client"]=function(){return"gl-js/ fire/"+Md}(),t["Content-Type"]="text/plain",this.databaseInfo.appId&&(t["X-Firebase-GMPID"]=this.databaseInfo.appId),i&&i.headers.forEach((s,o)=>t[o]=s),r&&r.headers.forEach((s,o)=>t[o]=s)}xo(t,i){const r=kq[t];return`${this.Do}/v1/${i}:${r}`}terminate(){}}{constructor(e){super(e),this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams,this.longPollingOptions=e.longPollingOptions}No(e,t,i,r){const s=Cw();return new Promise((o,a)=>{const l=new sU;l.setWithCredentials(!0),l.listenOnce(oU.COMPLETE,()=>{try{switch(l.getLastErrorCode()){case Ev.NO_ERROR:const d=l.getResponseJson();pt(Xi,`XHR for RPC '${e}' ${s} received:`,JSON.stringify(d)),o(d);break;case Ev.TIMEOUT:pt(Xi,`RPC '${e}' ${s} timed out`),a(new Tt(qe.DEADLINE_EXCEEDED,"Request time out"));break;case Ev.HTTP_ERROR:const f=l.getStatus();if(pt(Xi,`RPC '${e}' ${s} failed with status:`,f,"response text:",l.getResponseText()),f>0){let p=l.getResponseJson();Array.isArray(p)&&(p=p[0]);const m=p==null?void 0:p.error;if(m&&m.status&&m.message){const _=function(x){const y=x.toLowerCase().replace(/_/g,"-");return Object.values(qe).indexOf(y)>=0?y:qe.UNKNOWN}(m.status);a(new Tt(_,m.message))}else a(new Tt(qe.UNKNOWN,"Server responded with status "+l.getStatus()))}else a(new Tt(qe.UNAVAILABLE,"Connection failed."));break;default:Wt()}}finally{pt(Xi,`RPC '${e}' ${s} completed.`)}});const c=JSON.stringify(r);pt(Xi,`RPC '${e}' ${s} sending request:`,r),l.send(t,"POST",c,i,15)})}Bo(e,t,i){const r=Cw(),s=[this.Do,"/","google.firestore.v1.Firestore","/",e,"/channel"],o=cU(),a=lU(),l={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:`projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling},c=this.longPollingOptions.timeoutSeconds;c!==void 0&&(l.longPollingTimeout=Math.round(1e3*c)),this.useFetchStreams&&(l.useFetchStreams=!0),this.Oo(l.initMessageHeaders,t,i),l.encodeInitMessageHeaders=!0;const d=s.join("");pt(Xi,`Creating RPC '${e}' stream ${r}: ${d}`,l);const f=o.createWebChannel(d,l);let p=!1,m=!1;const _=new Oq({Io:x=>{m?pt(Xi,`Not sending because RPC '${e}' stream ${r} is closed:`,x):(p||(pt(Xi,`Opening RPC '${e}' stream ${r} transport.`),f.open(),p=!0),pt(Xi,`RPC '${e}' stream ${r} sending:`,x),f.send(x))},To:()=>f.close()}),S=(x,y,E)=>{x.listen(y,w=>{try{E(w)}catch(M){setTimeout(()=>{throw M},0)}})};return S(f,Xf.EventType.OPEN,()=>{m||(pt(Xi,`RPC '${e}' stream ${r} transport opened.`),_.yo())}),S(f,Xf.EventType.CLOSE,()=>{m||(m=!0,pt(Xi,`RPC '${e}' stream ${r} transport closed`),_.So())}),S(f,Xf.EventType.ERROR,x=>{m||(m=!0,od(Xi,`RPC '${e}' stream ${r} transport errored:`,x),_.So(new Tt(qe.UNAVAILABLE,"The operation could not be completed")))}),S(f,Xf.EventType.MESSAGE,x=>{var y;if(!m){const E=x.data[0];Kn(!!E);const w=E,M=w.error||((y=w[0])===null||y===void 0?void 0:y.error);if(M){pt(Xi,`RPC '${e}' stream ${r} received error:`,M);const O=M.status;let k=function(D){const A=ui[D];if(A!==void 0)return bU(A)}(O),I=M.message;k===void 0&&(k=qe.INTERNAL,I="Unknown error status: "+O+" with message "+M.message),m=!0,_.So(new Tt(k,I)),f.close()}else pt(Xi,`RPC '${e}' stream ${r} received:`,E),_.bo(E)}}),S(a,aU.STAT_EVENT,x=>{x.stat===$E.PROXY?pt(Xi,`RPC '${e}' stream ${r} detected buffering proxy`):x.stat===$E.NOPROXY&&pt(Xi,`RPC '${e}' stream ${r} detected no buffering proxy`)}),setTimeout(()=>{_.wo()},0),_}}function bw(){return typeof document<"u"?document:null}/** * @license * Copyright 2020 Google LLC * @@ -1559,7 +1559,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function FU(n){return new KX(n,!0)}/** + */function VU(n){return new KX(n,!0)}/** * @license * Copyright 2017 Google LLC * @@ -1574,7 +1574,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class VU{constructor(e,t,i=1e3,r=1.5,s=6e4){this.ui=e,this.timerId=t,this.ko=i,this.qo=r,this.Qo=s,this.Ko=0,this.$o=null,this.Uo=Date.now(),this.reset()}reset(){this.Ko=0}Wo(){this.Ko=this.Qo}Go(e){this.cancel();const t=Math.floor(this.Ko+this.zo()),i=Math.max(0,Date.now()-this.Uo),r=Math.max(0,t-i);r>0&&pt("ExponentialBackoff",`Backing off for ${r} ms (base delay: ${this.Ko} ms, delay with jitter: ${t} ms, last attempt: ${i} ms ago)`),this.$o=this.ui.enqueueAfterDelay(this.timerId,r,()=>(this.Uo=Date.now(),e())),this.Ko*=this.qo,this.Kothis.Qo&&(this.Ko=this.Qo)}jo(){this.$o!==null&&(this.$o.skipDelay(),this.$o=null)}cancel(){this.$o!==null&&(this.$o.cancel(),this.$o=null)}zo(){return(Math.random()-.5)*this.Ko}}/** + */class BU{constructor(e,t,i=1e3,r=1.5,s=6e4){this.ui=e,this.timerId=t,this.ko=i,this.qo=r,this.Qo=s,this.Ko=0,this.$o=null,this.Uo=Date.now(),this.reset()}reset(){this.Ko=0}Wo(){this.Ko=this.Qo}Go(e){this.cancel();const t=Math.floor(this.Ko+this.zo()),i=Math.max(0,Date.now()-this.Uo),r=Math.max(0,t-i);r>0&&pt("ExponentialBackoff",`Backing off for ${r} ms (base delay: ${this.Ko} ms, delay with jitter: ${t} ms, last attempt: ${i} ms ago)`),this.$o=this.ui.enqueueAfterDelay(this.timerId,r,()=>(this.Uo=Date.now(),e())),this.Ko*=this.qo,this.Kothis.Qo&&(this.Ko=this.Qo)}jo(){this.$o!==null&&(this.$o.skipDelay(),this.$o=null)}cancel(){this.$o!==null&&(this.$o.cancel(),this.$o=null)}zo(){return(Math.random()-.5)*this.Ko}}/** * @license * Copyright 2017 Google LLC * @@ -1589,7 +1589,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class Fq{constructor(e,t,i,r,s,o,a,l){this.ui=e,this.Ho=i,this.Jo=r,this.connection=s,this.authCredentialsProvider=o,this.appCheckCredentialsProvider=a,this.listener=l,this.state=0,this.Yo=0,this.Zo=null,this.Xo=null,this.stream=null,this.e_=0,this.t_=new VU(e,t)}n_(){return this.state===1||this.state===5||this.r_()}r_(){return this.state===2||this.state===3}start(){this.e_=0,this.state!==4?this.auth():this.i_()}async stop(){this.n_()&&await this.close(0)}s_(){this.state=0,this.t_.reset()}o_(){this.r_()&&this.Zo===null&&(this.Zo=this.ui.enqueueAfterDelay(this.Ho,6e4,()=>this.__()))}a_(e){this.u_(),this.stream.send(e)}async __(){if(this.r_())return this.close(0)}u_(){this.Zo&&(this.Zo.cancel(),this.Zo=null)}c_(){this.Xo&&(this.Xo.cancel(),this.Xo=null)}async close(e,t){this.u_(),this.c_(),this.t_.cancel(),this.Yo++,e!==4?this.t_.reset():t&&t.code===qe.RESOURCE_EXHAUSTED?(ha(t.toString()),ha("Using maximum backoff delay to prevent overloading the backend."),this.t_.Wo()):t&&t.code===qe.UNAUTHENTICATED&&this.state!==3&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),this.stream!==null&&(this.l_(),this.stream.close(),this.stream=null),this.state=e,await this.listener.mo(t)}l_(){}auth(){this.state=1;const e=this.h_(this.Yo),t=this.Yo;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then(([i,r])=>{this.Yo===t&&this.P_(i,r)},i=>{e(()=>{const r=new Tt(qe.UNKNOWN,"Fetching auth token failed: "+i.message);return this.I_(r)})})}P_(e,t){const i=this.h_(this.Yo);this.stream=this.T_(e,t),this.stream.Eo(()=>{i(()=>this.listener.Eo())}),this.stream.Ro(()=>{i(()=>(this.state=2,this.Xo=this.ui.enqueueAfterDelay(this.Jo,1e4,()=>(this.r_()&&(this.state=3),Promise.resolve())),this.listener.Ro()))}),this.stream.mo(r=>{i(()=>this.I_(r))}),this.stream.onMessage(r=>{i(()=>++this.e_==1?this.E_(r):this.onNext(r))})}i_(){this.state=5,this.t_.Go(async()=>{this.state=0,this.start()})}I_(e){return pt("PersistentStream",`close with error: ${e}`),this.stream=null,this.close(4,e)}h_(e){return t=>{this.ui.enqueueAndForget(()=>this.Yo===e?t():(pt("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve()))}}}class Vq extends Fq{constructor(e,t,i,r,s,o){super(e,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",t,i,r,o),this.serializer=s}T_(e,t){return this.connection.Bo("Listen",e,t)}E_(e){return this.onNext(e)}onNext(e){this.t_.reset();const t=tq(this.serializer,e),i=function(s){if(!("targetChange"in s))return kt.min();const o=s.targetChange;return o.targetIds&&o.targetIds.length?kt.min():o.readTime?Gh(o.readTime):kt.min()}(e);return this.listener.d_(t,i)}A_(e){const t={};t.database=o2(this.serializer),t.addTarget=function(s,o){let a;const l=o.target;if(a=ZE(l)?{documents:nq(s,l)}:{query:iq(s,l)._t},a.targetId=o.targetId,o.resumeToken.approximateByteSize()>0){a.resumeToken=JX(s,o.resumeToken);const c=iT(s,o.expectedCount);c!==null&&(a.expectedCount=c)}else if(o.snapshotVersion.compareTo(kt.min())>0){a.readTime=QX(s,o.snapshotVersion.toTimestamp());const c=iT(s,o.expectedCount);c!==null&&(a.expectedCount=c)}return a}(this.serializer,e);const i=sq(this.serializer,e);i&&(t.labels=i),this.a_(t)}R_(e){const t={};t.database=o2(this.serializer),t.removeTarget=e,this.a_(t)}}/** + */class Fq{constructor(e,t,i,r,s,o,a,l){this.ui=e,this.Ho=i,this.Jo=r,this.connection=s,this.authCredentialsProvider=o,this.appCheckCredentialsProvider=a,this.listener=l,this.state=0,this.Yo=0,this.Zo=null,this.Xo=null,this.stream=null,this.e_=0,this.t_=new BU(e,t)}n_(){return this.state===1||this.state===5||this.r_()}r_(){return this.state===2||this.state===3}start(){this.e_=0,this.state!==4?this.auth():this.i_()}async stop(){this.n_()&&await this.close(0)}s_(){this.state=0,this.t_.reset()}o_(){this.r_()&&this.Zo===null&&(this.Zo=this.ui.enqueueAfterDelay(this.Ho,6e4,()=>this.__()))}a_(e){this.u_(),this.stream.send(e)}async __(){if(this.r_())return this.close(0)}u_(){this.Zo&&(this.Zo.cancel(),this.Zo=null)}c_(){this.Xo&&(this.Xo.cancel(),this.Xo=null)}async close(e,t){this.u_(),this.c_(),this.t_.cancel(),this.Yo++,e!==4?this.t_.reset():t&&t.code===qe.RESOURCE_EXHAUSTED?(ha(t.toString()),ha("Using maximum backoff delay to prevent overloading the backend."),this.t_.Wo()):t&&t.code===qe.UNAUTHENTICATED&&this.state!==3&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),this.stream!==null&&(this.l_(),this.stream.close(),this.stream=null),this.state=e,await this.listener.mo(t)}l_(){}auth(){this.state=1;const e=this.h_(this.Yo),t=this.Yo;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then(([i,r])=>{this.Yo===t&&this.P_(i,r)},i=>{e(()=>{const r=new Tt(qe.UNKNOWN,"Fetching auth token failed: "+i.message);return this.I_(r)})})}P_(e,t){const i=this.h_(this.Yo);this.stream=this.T_(e,t),this.stream.Eo(()=>{i(()=>this.listener.Eo())}),this.stream.Ro(()=>{i(()=>(this.state=2,this.Xo=this.ui.enqueueAfterDelay(this.Jo,1e4,()=>(this.r_()&&(this.state=3),Promise.resolve())),this.listener.Ro()))}),this.stream.mo(r=>{i(()=>this.I_(r))}),this.stream.onMessage(r=>{i(()=>++this.e_==1?this.E_(r):this.onNext(r))})}i_(){this.state=5,this.t_.Go(async()=>{this.state=0,this.start()})}I_(e){return pt("PersistentStream",`close with error: ${e}`),this.stream=null,this.close(4,e)}h_(e){return t=>{this.ui.enqueueAndForget(()=>this.Yo===e?t():(pt("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve()))}}}class Vq extends Fq{constructor(e,t,i,r,s,o){super(e,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",t,i,r,o),this.serializer=s}T_(e,t){return this.connection.Bo("Listen",e,t)}E_(e){return this.onNext(e)}onNext(e){this.t_.reset();const t=tq(this.serializer,e),i=function(s){if(!("targetChange"in s))return kt.min();const o=s.targetChange;return o.targetIds&&o.targetIds.length?kt.min():o.readTime?Gh(o.readTime):kt.min()}(e);return this.listener.d_(t,i)}A_(e){const t={};t.database=o2(this.serializer),t.addTarget=function(s,o){let a;const l=o.target;if(a=ZE(l)?{documents:nq(s,l)}:{query:iq(s,l)._t},a.targetId=o.targetId,o.resumeToken.approximateByteSize()>0){a.resumeToken=JX(s,o.resumeToken);const c=iT(s,o.expectedCount);c!==null&&(a.expectedCount=c)}else if(o.snapshotVersion.compareTo(kt.min())>0){a.readTime=QX(s,o.snapshotVersion.toTimestamp());const c=iT(s,o.expectedCount);c!==null&&(a.expectedCount=c)}return a}(this.serializer,e);const i=sq(this.serializer,e);i&&(t.labels=i),this.a_(t)}R_(e){const t={};t.database=o2(this.serializer),t.removeTarget=e,this.a_(t)}}/** * @license * Copyright 2017 Google LLC * @@ -1620,7 +1620,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class Hq{constructor(e,t,i,r,s){this.localStore=e,this.datastore=t,this.asyncQueue=i,this.remoteSyncer={},this.O_=[],this.N_=new Map,this.L_=new Set,this.B_=[],this.k_=s,this.k_._o(o=>{i.enqueueAndForget(async()=>{Fm(this)&&(pt("RemoteStore","Restarting streams for network reachability change."),await async function(l){const c=en(l);c.L_.add(4),await Um(c),c.q_.set("Unknown"),c.L_.delete(4),await tx(c)}(this))})}),this.q_=new zq(i,r)}}async function tx(n){if(Fm(n))for(const e of n.B_)await e(!0)}async function Um(n){for(const e of n.B_)await e(!1)}function BU(n,e){const t=en(n);t.N_.has(e.targetId)||(t.N_.set(e.targetId,e),MM(t)?AM(t):bd(t).r_()&&TM(t,e))}function EM(n,e){const t=en(n),i=bd(t);t.N_.delete(e),i.r_()&&zU(t,e),t.N_.size===0&&(i.r_()?i.o_():Fm(t)&&t.q_.set("Unknown"))}function TM(n,e){if(n.Q_.xe(e.targetId),e.resumeToken.approximateByteSize()>0||e.snapshotVersion.compareTo(kt.min())>0){const t=n.remoteSyncer.getRemoteKeysForTarget(e.targetId).size;e=e.withExpectedCount(t)}bd(n).A_(e)}function zU(n,e){n.Q_.xe(e),bd(n).R_(e)}function AM(n){n.Q_=new XX({getRemoteKeysForTarget:e=>n.remoteSyncer.getRemoteKeysForTarget(e),ot:e=>n.N_.get(e)||null,tt:()=>n.datastore.serializer.databaseId}),bd(n).start(),n.q_.v_()}function MM(n){return Fm(n)&&!bd(n).n_()&&n.N_.size>0}function Fm(n){return en(n).L_.size===0}function HU(n){n.Q_=void 0}async function Gq(n){n.q_.set("Online")}async function Wq(n){n.N_.forEach((e,t)=>{TM(n,e)})}async function jq(n,e){HU(n),MM(n)?(n.q_.M_(e),AM(n)):n.q_.set("Unknown")}async function Xq(n,e,t){if(n.q_.set("Online"),e instanceof PU&&e.state===2&&e.cause)try{await async function(r,s){const o=s.cause;for(const a of s.targetIds)r.N_.has(a)&&(await r.remoteSyncer.rejectListen(a,o),r.N_.delete(a),r.Q_.removeTarget(a))}(n,e)}catch(i){pt("RemoteStore","Failed to remove targets %s: %s ",e.targetIds.join(","),i),await u2(n,i)}else if(e instanceof Av?n.Q_.Ke(e):e instanceof bU?n.Q_.He(e):n.Q_.We(e),!t.isEqual(kt.min()))try{const i=await UU(n.localStore);t.compareTo(i)>=0&&await function(s,o){const a=s.Q_.rt(o);return a.targetChanges.forEach((l,c)=>{if(l.resumeToken.approximateByteSize()>0){const d=s.N_.get(c);d&&s.N_.set(c,d.withResumeToken(l.resumeToken,o))}}),a.targetMismatches.forEach((l,c)=>{const d=s.N_.get(l);if(!d)return;s.N_.set(l,d.withResumeToken(ki.EMPTY_BYTE_STRING,d.snapshotVersion)),zU(s,l);const f=new al(d.target,l,c,d.sequenceNumber);TM(s,f)}),s.remoteSyncer.applyRemoteEvent(a)}(n,t)}catch(i){pt("RemoteStore","Failed to raise snapshot:",i),await u2(n,i)}}async function u2(n,e,t){if(!km(e))throw e;n.L_.add(1),await Um(n),n.q_.set("Offline"),t||(t=()=>UU(n.localStore)),n.asyncQueue.enqueueRetryable(async()=>{pt("RemoteStore","Retrying IndexedDB access"),await t(),n.L_.delete(1),await tx(n)})}async function h2(n,e){const t=en(n);t.asyncQueue.verifyOperationInProgress(),pt("RemoteStore","RemoteStore received new credentials");const i=Fm(t);t.L_.add(3),await Um(t),i&&t.q_.set("Unknown"),await t.remoteSyncer.handleCredentialChange(e),t.L_.delete(3),await tx(t)}async function qq(n,e){const t=en(n);e?(t.L_.delete(2),await tx(t)):e||(t.L_.add(2),await Um(t),t.q_.set("Unknown"))}function bd(n){return n.K_||(n.K_=function(t,i,r){const s=en(t);return s.w_(),new Vq(i,s.connection,s.authCredentials,s.appCheckCredentials,s.serializer,r)}(n.datastore,n.asyncQueue,{Eo:Gq.bind(null,n),Ro:Wq.bind(null,n),mo:jq.bind(null,n),d_:Xq.bind(null,n)}),n.B_.push(async e=>{e?(n.K_.s_(),MM(n)?AM(n):n.q_.set("Unknown")):(await n.K_.stop(),HU(n))})),n.K_}/** + */class Hq{constructor(e,t,i,r,s){this.localStore=e,this.datastore=t,this.asyncQueue=i,this.remoteSyncer={},this.O_=[],this.N_=new Map,this.L_=new Set,this.B_=[],this.k_=s,this.k_._o(o=>{i.enqueueAndForget(async()=>{Fm(this)&&(pt("RemoteStore","Restarting streams for network reachability change."),await async function(l){const c=en(l);c.L_.add(4),await Um(c),c.q_.set("Unknown"),c.L_.delete(4),await tx(c)}(this))})}),this.q_=new zq(i,r)}}async function tx(n){if(Fm(n))for(const e of n.B_)await e(!0)}async function Um(n){for(const e of n.B_)await e(!1)}function zU(n,e){const t=en(n);t.N_.has(e.targetId)||(t.N_.set(e.targetId,e),MM(t)?AM(t):bd(t).r_()&&TM(t,e))}function EM(n,e){const t=en(n),i=bd(t);t.N_.delete(e),i.r_()&&HU(t,e),t.N_.size===0&&(i.r_()?i.o_():Fm(t)&&t.q_.set("Unknown"))}function TM(n,e){if(n.Q_.xe(e.targetId),e.resumeToken.approximateByteSize()>0||e.snapshotVersion.compareTo(kt.min())>0){const t=n.remoteSyncer.getRemoteKeysForTarget(e.targetId).size;e=e.withExpectedCount(t)}bd(n).A_(e)}function HU(n,e){n.Q_.xe(e),bd(n).R_(e)}function AM(n){n.Q_=new XX({getRemoteKeysForTarget:e=>n.remoteSyncer.getRemoteKeysForTarget(e),ot:e=>n.N_.get(e)||null,tt:()=>n.datastore.serializer.databaseId}),bd(n).start(),n.q_.v_()}function MM(n){return Fm(n)&&!bd(n).n_()&&n.N_.size>0}function Fm(n){return en(n).L_.size===0}function GU(n){n.Q_=void 0}async function Gq(n){n.q_.set("Online")}async function Wq(n){n.N_.forEach((e,t)=>{TM(n,e)})}async function jq(n,e){GU(n),MM(n)?(n.q_.M_(e),AM(n)):n.q_.set("Unknown")}async function Xq(n,e,t){if(n.q_.set("Online"),e instanceof RU&&e.state===2&&e.cause)try{await async function(r,s){const o=s.cause;for(const a of s.targetIds)r.N_.has(a)&&(await r.remoteSyncer.rejectListen(a,o),r.N_.delete(a),r.Q_.removeTarget(a))}(n,e)}catch(i){pt("RemoteStore","Failed to remove targets %s: %s ",e.targetIds.join(","),i),await u2(n,i)}else if(e instanceof Av?n.Q_.Ke(e):e instanceof PU?n.Q_.He(e):n.Q_.We(e),!t.isEqual(kt.min()))try{const i=await FU(n.localStore);t.compareTo(i)>=0&&await function(s,o){const a=s.Q_.rt(o);return a.targetChanges.forEach((l,c)=>{if(l.resumeToken.approximateByteSize()>0){const d=s.N_.get(c);d&&s.N_.set(c,d.withResumeToken(l.resumeToken,o))}}),a.targetMismatches.forEach((l,c)=>{const d=s.N_.get(l);if(!d)return;s.N_.set(l,d.withResumeToken(ki.EMPTY_BYTE_STRING,d.snapshotVersion)),HU(s,l);const f=new al(d.target,l,c,d.sequenceNumber);TM(s,f)}),s.remoteSyncer.applyRemoteEvent(a)}(n,t)}catch(i){pt("RemoteStore","Failed to raise snapshot:",i),await u2(n,i)}}async function u2(n,e,t){if(!km(e))throw e;n.L_.add(1),await Um(n),n.q_.set("Offline"),t||(t=()=>FU(n.localStore)),n.asyncQueue.enqueueRetryable(async()=>{pt("RemoteStore","Retrying IndexedDB access"),await t(),n.L_.delete(1),await tx(n)})}async function h2(n,e){const t=en(n);t.asyncQueue.verifyOperationInProgress(),pt("RemoteStore","RemoteStore received new credentials");const i=Fm(t);t.L_.add(3),await Um(t),i&&t.q_.set("Unknown"),await t.remoteSyncer.handleCredentialChange(e),t.L_.delete(3),await tx(t)}async function qq(n,e){const t=en(n);e?(t.L_.delete(2),await tx(t)):e||(t.L_.add(2),await Um(t),t.q_.set("Unknown"))}function bd(n){return n.K_||(n.K_=function(t,i,r){const s=en(t);return s.w_(),new Vq(i,s.connection,s.authCredentials,s.appCheckCredentials,s.serializer,r)}(n.datastore,n.asyncQueue,{Eo:Gq.bind(null,n),Ro:Wq.bind(null,n),mo:jq.bind(null,n),d_:Xq.bind(null,n)}),n.B_.push(async e=>{e?(n.K_.s_(),MM(n)?AM(n):n.q_.set("Unknown")):(await n.K_.stop(),GU(n))})),n.K_}/** * @license * Copyright 2017 Google LLC * @@ -1635,7 +1635,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class CM{constructor(e,t,i,r,s){this.asyncQueue=e,this.timerId=t,this.targetTimeMs=i,this.op=r,this.removalCallback=s,this.deferred=new jc,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(o=>{})}get promise(){return this.deferred.promise}static createAndSchedule(e,t,i,r,s){const o=Date.now()+i,a=new CM(e,t,o,r,s);return a.start(i),a}start(e){this.timerHandle=setTimeout(()=>this.handleDelayElapsed(),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){this.timerHandle!==null&&(this.clearTimeout(),this.deferred.reject(new Tt(qe.CANCELLED,"Operation cancelled"+(e?": "+e:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget(()=>this.timerHandle!==null?(this.clearTimeout(),this.op().then(e=>this.deferred.resolve(e))):Promise.resolve())}clearTimeout(){this.timerHandle!==null&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}}function GU(n,e){if(ha("AsyncQueue",`${e}: ${n}`),km(n))return new Tt(qe.UNAVAILABLE,`${e}: ${n}`);throw n}/** + */class CM{constructor(e,t,i,r,s){this.asyncQueue=e,this.timerId=t,this.targetTimeMs=i,this.op=r,this.removalCallback=s,this.deferred=new jc,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(o=>{})}get promise(){return this.deferred.promise}static createAndSchedule(e,t,i,r,s){const o=Date.now()+i,a=new CM(e,t,o,r,s);return a.start(i),a}start(e){this.timerHandle=setTimeout(()=>this.handleDelayElapsed(),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){this.timerHandle!==null&&(this.clearTimeout(),this.deferred.reject(new Tt(qe.CANCELLED,"Operation cancelled"+(e?": "+e:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget(()=>this.timerHandle!==null?(this.clearTimeout(),this.op().then(e=>this.deferred.resolve(e))):Promise.resolve())}clearTimeout(){this.timerHandle!==null&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}}function WU(n,e){if(ha("AsyncQueue",`${e}: ${n}`),km(n))return new Tt(qe.UNAVAILABLE,`${e}: ${n}`);throw n}/** * @license * Copyright 2017 Google LLC * @@ -1683,7 +1683,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class $q{constructor(){this.z_=void 0,this.j_=[]}H_(){return this.j_.some(e=>e.J_())}}class Yq{constructor(){this.queries=f2(),this.onlineState="Unknown",this.Y_=new Set}terminate(){(function(t,i){const r=en(t),s=r.queries;r.queries=f2(),s.forEach((o,a)=>{for(const l of a.j_)l.onError(i)})})(this,new Tt(qe.ABORTED,"Firestore shutting down"))}}function f2(){return new Cd(n=>vU(n),K_)}async function Kq(n,e){const t=en(n);let i=3;const r=e.query;let s=t.queries.get(r);s?!s.H_()&&e.J_()&&(i=2):(s=new $q,i=e.J_()?0:1);try{switch(i){case 0:s.z_=await t.onListen(r,!0);break;case 1:s.z_=await t.onListen(r,!1);break;case 2:await t.onFirstRemoteStoreListen(r)}}catch(o){const a=GU(o,`Initialization of query '${lh(e.query)}' failed`);return void e.onError(a)}t.queries.set(r,s),s.j_.push(e),e.Z_(t.onlineState),s.z_&&e.X_(s.z_)&&bM(t)}async function Qq(n,e){const t=en(n),i=e.query;let r=3;const s=t.queries.get(i);if(s){const o=s.j_.indexOf(e);o>=0&&(s.j_.splice(o,1),s.j_.length===0?r=e.J_()?0:1:!s.H_()&&e.J_()&&(r=2))}switch(r){case 0:return t.queries.delete(i),t.onUnlisten(i,!0);case 1:return t.queries.delete(i),t.onUnlisten(i,!1);case 2:return t.onLastRemoteStoreUnlisten(i);default:return}}function Jq(n,e){const t=en(n);let i=!1;for(const r of e){const s=r.query,o=t.queries.get(s);if(o){for(const a of o.j_)a.X_(r)&&(i=!0);o.z_=r}}i&&bM(t)}function Zq(n,e,t){const i=en(n),r=i.queries.get(e);if(r)for(const s of r.j_)s.onError(t);i.queries.delete(e)}function bM(n){n.Y_.forEach(e=>{e.next()})}var oT,p2;(p2=oT||(oT={})).ea="default",p2.Cache="cache";class e${constructor(e,t,i){this.query=e,this.ta=t,this.na=!1,this.ra=null,this.onlineState="Unknown",this.options=i||{}}X_(e){if(!this.options.includeMetadataChanges){const i=[];for(const r of e.docChanges)r.type!==3&&i.push(r);e=new hd(e.query,e.docs,e.oldDocs,i,e.mutatedKeys,e.fromCache,e.syncStateChanged,!0,e.hasCachedResults)}let t=!1;return this.na?this.ia(e)&&(this.ta.next(e),t=!0):this.sa(e,this.onlineState)&&(this.oa(e),t=!0),this.ra=e,t}onError(e){this.ta.error(e)}Z_(e){this.onlineState=e;let t=!1;return this.ra&&!this.na&&this.sa(this.ra,e)&&(this.oa(this.ra),t=!0),t}sa(e,t){if(!e.fromCache||!this.J_())return!0;const i=t!=="Offline";return(!this.options._a||!i)&&(!e.docs.isEmpty()||e.hasCachedResults||t==="Offline")}ia(e){if(e.docChanges.length>0)return!0;const t=this.ra&&this.ra.hasPendingWrites!==e.hasPendingWrites;return!(!e.syncStateChanged&&!t)&&this.options.includeMetadataChanges===!0}oa(e){e=hd.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache,e.hasCachedResults),this.na=!0,this.ta.next(e)}J_(){return this.options.source!==oT.Cache}}/** + */class $q{constructor(){this.z_=void 0,this.j_=[]}H_(){return this.j_.some(e=>e.J_())}}class Yq{constructor(){this.queries=f2(),this.onlineState="Unknown",this.Y_=new Set}terminate(){(function(t,i){const r=en(t),s=r.queries;r.queries=f2(),s.forEach((o,a)=>{for(const l of a.j_)l.onError(i)})})(this,new Tt(qe.ABORTED,"Firestore shutting down"))}}function f2(){return new Cd(n=>_U(n),K_)}async function Kq(n,e){const t=en(n);let i=3;const r=e.query;let s=t.queries.get(r);s?!s.H_()&&e.J_()&&(i=2):(s=new $q,i=e.J_()?0:1);try{switch(i){case 0:s.z_=await t.onListen(r,!0);break;case 1:s.z_=await t.onListen(r,!1);break;case 2:await t.onFirstRemoteStoreListen(r)}}catch(o){const a=WU(o,`Initialization of query '${lh(e.query)}' failed`);return void e.onError(a)}t.queries.set(r,s),s.j_.push(e),e.Z_(t.onlineState),s.z_&&e.X_(s.z_)&&bM(t)}async function Qq(n,e){const t=en(n),i=e.query;let r=3;const s=t.queries.get(i);if(s){const o=s.j_.indexOf(e);o>=0&&(s.j_.splice(o,1),s.j_.length===0?r=e.J_()?0:1:!s.H_()&&e.J_()&&(r=2))}switch(r){case 0:return t.queries.delete(i),t.onUnlisten(i,!0);case 1:return t.queries.delete(i),t.onUnlisten(i,!1);case 2:return t.onLastRemoteStoreUnlisten(i);default:return}}function Jq(n,e){const t=en(n);let i=!1;for(const r of e){const s=r.query,o=t.queries.get(s);if(o){for(const a of o.j_)a.X_(r)&&(i=!0);o.z_=r}}i&&bM(t)}function Zq(n,e,t){const i=en(n),r=i.queries.get(e);if(r)for(const s of r.j_)s.onError(t);i.queries.delete(e)}function bM(n){n.Y_.forEach(e=>{e.next()})}var oT,p2;(p2=oT||(oT={})).ea="default",p2.Cache="cache";class e${constructor(e,t,i){this.query=e,this.ta=t,this.na=!1,this.ra=null,this.onlineState="Unknown",this.options=i||{}}X_(e){if(!this.options.includeMetadataChanges){const i=[];for(const r of e.docChanges)r.type!==3&&i.push(r);e=new hd(e.query,e.docs,e.oldDocs,i,e.mutatedKeys,e.fromCache,e.syncStateChanged,!0,e.hasCachedResults)}let t=!1;return this.na?this.ia(e)&&(this.ta.next(e),t=!0):this.sa(e,this.onlineState)&&(this.oa(e),t=!0),this.ra=e,t}onError(e){this.ta.error(e)}Z_(e){this.onlineState=e;let t=!1;return this.ra&&!this.na&&this.sa(this.ra,e)&&(this.oa(this.ra),t=!0),t}sa(e,t){if(!e.fromCache||!this.J_())return!0;const i=t!=="Offline";return(!this.options._a||!i)&&(!e.docs.isEmpty()||e.hasCachedResults||t==="Offline")}ia(e){if(e.docChanges.length>0)return!0;const t=this.ra&&this.ra.hasPendingWrites!==e.hasPendingWrites;return!(!e.syncStateChanged&&!t)&&this.options.includeMetadataChanges===!0}oa(e){e=hd.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache,e.hasCachedResults),this.na=!0,this.ta.next(e)}J_(){return this.options.source!==oT.Cache}}/** * @license * Copyright 2017 Google LLC * @@ -1698,7 +1698,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class WU{constructor(e){this.key=e}}class jU{constructor(e){this.key=e}}class t${constructor(e,t){this.query=e,this.Ta=t,this.Ea=null,this.hasCachedResults=!1,this.current=!1,this.da=rn(),this.mutatedKeys=rn(),this.Aa=_U(e),this.Ra=new Wh(this.Aa)}get Va(){return this.Ta}ma(e,t){const i=t?t.fa:new d2,r=t?t.Ra:this.Ra;let s=t?t.mutatedKeys:this.mutatedKeys,o=r,a=!1;const l=this.query.limitType==="F"&&r.size===this.query.limit?r.last():null,c=this.query.limitType==="L"&&r.size===this.query.limit?r.first():null;if(e.inorderTraversal((d,f)=>{const p=r.get(d),m=Q_(this.query,f)?f:null,_=!!p&&this.mutatedKeys.has(p.key),S=!!m&&(m.hasLocalMutations||this.mutatedKeys.has(m.key)&&m.hasCommittedMutations);let x=!1;p&&m?p.data.isEqual(m.data)?_!==S&&(i.track({type:3,doc:m}),x=!0):this.ga(p,m)||(i.track({type:2,doc:m}),x=!0,(l&&this.Aa(m,l)>0||c&&this.Aa(m,c)<0)&&(a=!0)):!p&&m?(i.track({type:0,doc:m}),x=!0):p&&!m&&(i.track({type:1,doc:p}),x=!0,(l||c)&&(a=!0)),x&&(m?(o=o.add(m),s=S?s.add(d):s.delete(d)):(o=o.delete(d),s=s.delete(d)))}),this.query.limit!==null)for(;o.size>this.query.limit;){const d=this.query.limitType==="F"?o.last():o.first();o=o.delete(d.key),s=s.delete(d.key),i.track({type:1,doc:d})}return{Ra:o,fa:i,ns:a,mutatedKeys:s}}ga(e,t){return e.hasLocalMutations&&t.hasCommittedMutations&&!t.hasLocalMutations}applyChanges(e,t,i,r){const s=this.Ra;this.Ra=e.Ra,this.mutatedKeys=e.mutatedKeys;const o=e.fa.G_();o.sort((d,f)=>function(m,_){const S=x=>{switch(x){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return Wt()}};return S(m)-S(_)}(d.type,f.type)||this.Aa(d.doc,f.doc)),this.pa(i),r=r!=null&&r;const a=t&&!r?this.ya():[],l=this.da.size===0&&this.current&&!r?1:0,c=l!==this.Ea;return this.Ea=l,o.length!==0||c?{snapshot:new hd(this.query,e.Ra,s,o,e.mutatedKeys,l===0,c,!1,!!i&&i.resumeToken.approximateByteSize()>0),wa:a}:{wa:a}}Z_(e){return this.current&&e==="Offline"?(this.current=!1,this.applyChanges({Ra:this.Ra,fa:new d2,mutatedKeys:this.mutatedKeys,ns:!1},!1)):{wa:[]}}Sa(e){return!this.Ta.has(e)&&!!this.Ra.has(e)&&!this.Ra.get(e).hasLocalMutations}pa(e){e&&(e.addedDocuments.forEach(t=>this.Ta=this.Ta.add(t)),e.modifiedDocuments.forEach(t=>{}),e.removedDocuments.forEach(t=>this.Ta=this.Ta.delete(t)),this.current=e.current)}ya(){if(!this.current)return[];const e=this.da;this.da=rn(),this.Ra.forEach(i=>{this.Sa(i.key)&&(this.da=this.da.add(i.key))});const t=[];return e.forEach(i=>{this.da.has(i)||t.push(new jU(i))}),this.da.forEach(i=>{e.has(i)||t.push(new WU(i))}),t}ba(e){this.Ta=e.Ts,this.da=rn();const t=this.ma(e.documents);return this.applyChanges(t,!0)}Da(){return hd.fromInitialDocuments(this.query,this.Ra,this.mutatedKeys,this.Ea===0,this.hasCachedResults)}}class n${constructor(e,t,i){this.query=e,this.targetId=t,this.view=i}}class i${constructor(e){this.key=e,this.va=!1}}class r${constructor(e,t,i,r,s,o){this.localStore=e,this.remoteStore=t,this.eventManager=i,this.sharedClientState=r,this.currentUser=s,this.maxConcurrentLimboResolutions=o,this.Ca={},this.Fa=new Cd(a=>vU(a),K_),this.Ma=new Map,this.xa=new Set,this.Oa=new ri(Pt.comparator),this.Na=new Map,this.La=new xM,this.Ba={},this.ka=new Map,this.qa=ud.kn(),this.onlineState="Unknown",this.Qa=void 0}get isPrimaryClient(){return this.Qa===!0}}async function s$(n,e,t=!0){const i=KU(n);let r;const s=i.Fa.get(e);return s?(i.sharedClientState.addLocalQueryTarget(s.targetId),r=s.view.Da()):r=await XU(i,e,t,!0),r}async function o$(n,e){const t=KU(n);await XU(t,e,!0,!1)}async function XU(n,e,t,i){const r=await Iq(n.localStore,yo(e)),s=r.targetId,o=n.sharedClientState.addLocalQueryTarget(s,t);let a;return i&&(a=await a$(n,e,s,o==="current",r.resumeToken)),n.isPrimaryClient&&t&&BU(n.remoteStore,r),a}async function a$(n,e,t,i,r){n.Ka=(f,p,m)=>async function(S,x,y,E){let w=x.view.ma(y);w.ns&&(w=await a2(S.localStore,x.query,!1).then(({documents:I})=>x.view.ma(I,w)));const M=E&&E.targetChanges.get(x.targetId),O=E&&E.targetMismatches.get(x.targetId)!=null,k=x.view.applyChanges(w,S.isPrimaryClient,M,O);return g2(S,x.targetId,k.wa),k.snapshot}(n,f,p,m);const s=await a2(n.localStore,e,!0),o=new t$(e,s.Ts),a=o.ma(s.documents),l=Om.createSynthesizedTargetChangeForCurrentChange(t,i&&n.onlineState!=="Offline",r),c=o.applyChanges(a,n.isPrimaryClient,l);g2(n,t,c.wa);const d=new n$(e,t,o);return n.Fa.set(e,d),n.Ma.has(t)?n.Ma.get(t).push(e):n.Ma.set(t,[e]),c.snapshot}async function l$(n,e,t){const i=en(n),r=i.Fa.get(e),s=i.Ma.get(r.targetId);if(s.length>1)return i.Ma.set(r.targetId,s.filter(o=>!K_(o,e))),void i.Fa.delete(e);i.isPrimaryClient?(i.sharedClientState.removeLocalQueryTarget(r.targetId),i.sharedClientState.isActiveQueryTarget(r.targetId)||await sT(i.localStore,r.targetId,!1).then(()=>{i.sharedClientState.clearQueryState(r.targetId),t&&EM(i.remoteStore,r.targetId),aT(i,r.targetId)}).catch(uM)):(aT(i,r.targetId),await sT(i.localStore,r.targetId,!0))}async function c$(n,e){const t=en(n),i=t.Fa.get(e),r=t.Ma.get(i.targetId);t.isPrimaryClient&&r.length===1&&(t.sharedClientState.removeLocalQueryTarget(i.targetId),EM(t.remoteStore,i.targetId))}async function qU(n,e){const t=en(n);try{const i=await Pq(t.localStore,e);e.targetChanges.forEach((r,s)=>{const o=t.Na.get(s);o&&(Kn(r.addedDocuments.size+r.modifiedDocuments.size+r.removedDocuments.size<=1),r.addedDocuments.size>0?o.va=!0:r.modifiedDocuments.size>0?Kn(o.va):r.removedDocuments.size>0&&(Kn(o.va),o.va=!1))}),await YU(t,i,e)}catch(i){await uM(i)}}function m2(n,e,t){const i=en(n);if(i.isPrimaryClient&&t===0||!i.isPrimaryClient&&t===1){const r=[];i.Fa.forEach((s,o)=>{const a=o.view.Z_(e);a.snapshot&&r.push(a.snapshot)}),function(o,a){const l=en(o);l.onlineState=a;let c=!1;l.queries.forEach((d,f)=>{for(const p of f.j_)p.Z_(a)&&(c=!0)}),c&&bM(l)}(i.eventManager,e),r.length&&i.Ca.d_(r),i.onlineState=e,i.isPrimaryClient&&i.sharedClientState.setOnlineState(e)}}async function u$(n,e,t){const i=en(n);i.sharedClientState.updateQueryState(e,"rejected",t);const r=i.Na.get(e),s=r&&r.key;if(s){let o=new ri(Pt.comparator);o=o.insert(s,Zi.newNoDocument(s,kt.min()));const a=rn().add(s),l=new ex(kt.min(),new Map,new ri(hn),o,a);await qU(i,l),i.Oa=i.Oa.remove(s),i.Na.delete(e),PM(i)}else await sT(i.localStore,e,!1).then(()=>aT(i,e,t)).catch(uM)}function aT(n,e,t=null){n.sharedClientState.removeLocalQueryTarget(e);for(const i of n.Ma.get(e))n.Fa.delete(i),t&&n.Ca.$a(i,t);n.Ma.delete(e),n.isPrimaryClient&&n.La.gr(e).forEach(i=>{n.La.containsKey(i)||$U(n,i)})}function $U(n,e){n.xa.delete(e.path.canonicalString());const t=n.Oa.get(e);t!==null&&(EM(n.remoteStore,t),n.Oa=n.Oa.remove(e),n.Na.delete(t),PM(n))}function g2(n,e,t){for(const i of t)i instanceof WU?(n.La.addReference(i.key,e),h$(n,i)):i instanceof jU?(pt("SyncEngine","Document no longer in limbo: "+i.key),n.La.removeReference(i.key,e),n.La.containsKey(i.key)||$U(n,i.key)):Wt()}function h$(n,e){const t=e.key,i=t.path.canonicalString();n.Oa.get(t)||n.xa.has(i)||(pt("SyncEngine","New document in limbo: "+t),n.xa.add(i),PM(n))}function PM(n){for(;n.xa.size>0&&n.Oa.size{o.push(i.Ka(l,e,t).then(c=>{var d;if((c||t)&&i.isPrimaryClient){const f=c?!c.fromCache:(d=t==null?void 0:t.targetChanges.get(l.targetId))===null||d===void 0?void 0:d.current;i.sharedClientState.updateQueryState(l.targetId,f?"current":"not-current")}if(c){r.push(c);const f=wM.Wi(l.targetId,c);s.push(f)}}))}),await Promise.all(o),i.Ca.d_(r),await async function(l,c){const d=en(l);try{await d.persistence.runTransaction("notifyLocalViewChanges","readwrite",f=>Ie.forEach(c,p=>Ie.forEach(p.$i,m=>d.persistence.referenceDelegate.addReference(f,p.targetId,m)).next(()=>Ie.forEach(p.Ui,m=>d.persistence.referenceDelegate.removeReference(f,p.targetId,m)))))}catch(f){if(!km(f))throw f;pt("LocalStore","Failed to update sequence numbers: "+f)}for(const f of c){const p=f.targetId;if(!f.fromCache){const m=d.os.get(p),_=m.snapshotVersion,S=m.withLastLimboFreeSnapshotVersion(_);d.os=d.os.insert(p,S)}}}(i.localStore,s))}async function d$(n,e){const t=en(n);if(!t.currentUser.isEqual(e)){pt("SyncEngine","User change. New user:",e.toKey());const i=await OU(t.localStore,e);t.currentUser=e,function(s,o){s.ka.forEach(a=>{a.forEach(l=>{l.reject(new Tt(qe.CANCELLED,o))})}),s.ka.clear()}(t,"'waitForPendingWrites' promise is rejected due to a user change."),t.sharedClientState.handleUserChange(e,i.removedBatchIds,i.addedBatchIds),await YU(t,i.hs)}}function f$(n,e){const t=en(n),i=t.Na.get(e);if(i&&i.va)return rn().add(i.key);{let r=rn();const s=t.Ma.get(e);if(!s)return r;for(const o of s){const a=t.Fa.get(o);r=r.unionWith(a.view.Va)}return r}}function KU(n){const e=en(n);return e.remoteStore.remoteSyncer.applyRemoteEvent=qU.bind(null,e),e.remoteStore.remoteSyncer.getRemoteKeysForTarget=f$.bind(null,e),e.remoteStore.remoteSyncer.rejectListen=u$.bind(null,e),e.Ca.d_=Jq.bind(null,e.eventManager),e.Ca.$a=Zq.bind(null,e.eventManager),e}class E0{constructor(){this.kind="memory",this.synchronizeTabs=!1}async initialize(e){this.serializer=FU(e.databaseInfo.databaseId),this.sharedClientState=this.Wa(e),this.persistence=this.Ga(e),await this.persistence.start(),this.localStore=this.za(e),this.gcScheduler=this.ja(e,this.localStore),this.indexBackfillerScheduler=this.Ha(e,this.localStore)}ja(e,t){return null}Ha(e,t){return null}za(e){return bq(this.persistence,new Mq,e.initialUser,this.serializer)}Ga(e){return new Eq(SM.Zr,this.serializer)}Wa(e){return new Nq}async terminate(){var e,t;(e=this.gcScheduler)===null||e===void 0||e.stop(),(t=this.indexBackfillerScheduler)===null||t===void 0||t.stop(),this.sharedClientState.shutdown(),await this.persistence.shutdown()}}E0.provider={build:()=>new E0};class lT{async initialize(e,t){this.localStore||(this.localStore=e.localStore,this.sharedClientState=e.sharedClientState,this.datastore=this.createDatastore(t),this.remoteStore=this.createRemoteStore(t),this.eventManager=this.createEventManager(t),this.syncEngine=this.createSyncEngine(t,!e.synchronizeTabs),this.sharedClientState.onlineStateHandler=i=>m2(this.syncEngine,i,1),this.remoteStore.remoteSyncer.handleCredentialChange=d$.bind(null,this.syncEngine),await qq(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(e){return function(){return new Yq}()}createDatastore(e){const t=FU(e.databaseInfo.databaseId),i=function(s){return new Uq(s)}(e.databaseInfo);return function(s,o,a,l){return new Bq(s,o,a,l)}(e.authCredentials,e.appCheckCredentials,i,t)}createRemoteStore(e){return function(i,r,s,o,a){return new Hq(i,r,s,o,a)}(this.localStore,this.datastore,e.asyncQueue,t=>m2(this.syncEngine,t,0),function(){return c2.D()?new c2:new Dq}())}createSyncEngine(e,t){return function(r,s,o,a,l,c,d){const f=new r$(r,s,o,a,l,c);return d&&(f.Qa=!0),f}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,e.initialUser,e.maxConcurrentLimboResolutions,t)}async terminate(){var e,t;await async function(r){const s=en(r);pt("RemoteStore","RemoteStore shutting down."),s.L_.add(5),await Um(s),s.k_.shutdown(),s.q_.set("Unknown")}(this.remoteStore),(e=this.datastore)===null||e===void 0||e.terminate(),(t=this.eventManager)===null||t===void 0||t.terminate()}}lT.provider={build:()=>new lT};/** + */class jU{constructor(e){this.key=e}}class XU{constructor(e){this.key=e}}class t${constructor(e,t){this.query=e,this.Ta=t,this.Ea=null,this.hasCachedResults=!1,this.current=!1,this.da=rn(),this.mutatedKeys=rn(),this.Aa=xU(e),this.Ra=new Wh(this.Aa)}get Va(){return this.Ta}ma(e,t){const i=t?t.fa:new d2,r=t?t.Ra:this.Ra;let s=t?t.mutatedKeys:this.mutatedKeys,o=r,a=!1;const l=this.query.limitType==="F"&&r.size===this.query.limit?r.last():null,c=this.query.limitType==="L"&&r.size===this.query.limit?r.first():null;if(e.inorderTraversal((d,f)=>{const p=r.get(d),m=Q_(this.query,f)?f:null,_=!!p&&this.mutatedKeys.has(p.key),S=!!m&&(m.hasLocalMutations||this.mutatedKeys.has(m.key)&&m.hasCommittedMutations);let x=!1;p&&m?p.data.isEqual(m.data)?_!==S&&(i.track({type:3,doc:m}),x=!0):this.ga(p,m)||(i.track({type:2,doc:m}),x=!0,(l&&this.Aa(m,l)>0||c&&this.Aa(m,c)<0)&&(a=!0)):!p&&m?(i.track({type:0,doc:m}),x=!0):p&&!m&&(i.track({type:1,doc:p}),x=!0,(l||c)&&(a=!0)),x&&(m?(o=o.add(m),s=S?s.add(d):s.delete(d)):(o=o.delete(d),s=s.delete(d)))}),this.query.limit!==null)for(;o.size>this.query.limit;){const d=this.query.limitType==="F"?o.last():o.first();o=o.delete(d.key),s=s.delete(d.key),i.track({type:1,doc:d})}return{Ra:o,fa:i,ns:a,mutatedKeys:s}}ga(e,t){return e.hasLocalMutations&&t.hasCommittedMutations&&!t.hasLocalMutations}applyChanges(e,t,i,r){const s=this.Ra;this.Ra=e.Ra,this.mutatedKeys=e.mutatedKeys;const o=e.fa.G_();o.sort((d,f)=>function(m,_){const S=x=>{switch(x){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return Wt()}};return S(m)-S(_)}(d.type,f.type)||this.Aa(d.doc,f.doc)),this.pa(i),r=r!=null&&r;const a=t&&!r?this.ya():[],l=this.da.size===0&&this.current&&!r?1:0,c=l!==this.Ea;return this.Ea=l,o.length!==0||c?{snapshot:new hd(this.query,e.Ra,s,o,e.mutatedKeys,l===0,c,!1,!!i&&i.resumeToken.approximateByteSize()>0),wa:a}:{wa:a}}Z_(e){return this.current&&e==="Offline"?(this.current=!1,this.applyChanges({Ra:this.Ra,fa:new d2,mutatedKeys:this.mutatedKeys,ns:!1},!1)):{wa:[]}}Sa(e){return!this.Ta.has(e)&&!!this.Ra.has(e)&&!this.Ra.get(e).hasLocalMutations}pa(e){e&&(e.addedDocuments.forEach(t=>this.Ta=this.Ta.add(t)),e.modifiedDocuments.forEach(t=>{}),e.removedDocuments.forEach(t=>this.Ta=this.Ta.delete(t)),this.current=e.current)}ya(){if(!this.current)return[];const e=this.da;this.da=rn(),this.Ra.forEach(i=>{this.Sa(i.key)&&(this.da=this.da.add(i.key))});const t=[];return e.forEach(i=>{this.da.has(i)||t.push(new XU(i))}),this.da.forEach(i=>{e.has(i)||t.push(new jU(i))}),t}ba(e){this.Ta=e.Ts,this.da=rn();const t=this.ma(e.documents);return this.applyChanges(t,!0)}Da(){return hd.fromInitialDocuments(this.query,this.Ra,this.mutatedKeys,this.Ea===0,this.hasCachedResults)}}class n${constructor(e,t,i){this.query=e,this.targetId=t,this.view=i}}class i${constructor(e){this.key=e,this.va=!1}}class r${constructor(e,t,i,r,s,o){this.localStore=e,this.remoteStore=t,this.eventManager=i,this.sharedClientState=r,this.currentUser=s,this.maxConcurrentLimboResolutions=o,this.Ca={},this.Fa=new Cd(a=>_U(a),K_),this.Ma=new Map,this.xa=new Set,this.Oa=new ri(Pt.comparator),this.Na=new Map,this.La=new xM,this.Ba={},this.ka=new Map,this.qa=ud.kn(),this.onlineState="Unknown",this.Qa=void 0}get isPrimaryClient(){return this.Qa===!0}}async function s$(n,e,t=!0){const i=QU(n);let r;const s=i.Fa.get(e);return s?(i.sharedClientState.addLocalQueryTarget(s.targetId),r=s.view.Da()):r=await qU(i,e,t,!0),r}async function o$(n,e){const t=QU(n);await qU(t,e,!0,!1)}async function qU(n,e,t,i){const r=await Iq(n.localStore,yo(e)),s=r.targetId,o=n.sharedClientState.addLocalQueryTarget(s,t);let a;return i&&(a=await a$(n,e,s,o==="current",r.resumeToken)),n.isPrimaryClient&&t&&zU(n.remoteStore,r),a}async function a$(n,e,t,i,r){n.Ka=(f,p,m)=>async function(S,x,y,E){let w=x.view.ma(y);w.ns&&(w=await a2(S.localStore,x.query,!1).then(({documents:I})=>x.view.ma(I,w)));const M=E&&E.targetChanges.get(x.targetId),O=E&&E.targetMismatches.get(x.targetId)!=null,k=x.view.applyChanges(w,S.isPrimaryClient,M,O);return g2(S,x.targetId,k.wa),k.snapshot}(n,f,p,m);const s=await a2(n.localStore,e,!0),o=new t$(e,s.Ts),a=o.ma(s.documents),l=Om.createSynthesizedTargetChangeForCurrentChange(t,i&&n.onlineState!=="Offline",r),c=o.applyChanges(a,n.isPrimaryClient,l);g2(n,t,c.wa);const d=new n$(e,t,o);return n.Fa.set(e,d),n.Ma.has(t)?n.Ma.get(t).push(e):n.Ma.set(t,[e]),c.snapshot}async function l$(n,e,t){const i=en(n),r=i.Fa.get(e),s=i.Ma.get(r.targetId);if(s.length>1)return i.Ma.set(r.targetId,s.filter(o=>!K_(o,e))),void i.Fa.delete(e);i.isPrimaryClient?(i.sharedClientState.removeLocalQueryTarget(r.targetId),i.sharedClientState.isActiveQueryTarget(r.targetId)||await sT(i.localStore,r.targetId,!1).then(()=>{i.sharedClientState.clearQueryState(r.targetId),t&&EM(i.remoteStore,r.targetId),aT(i,r.targetId)}).catch(uM)):(aT(i,r.targetId),await sT(i.localStore,r.targetId,!0))}async function c$(n,e){const t=en(n),i=t.Fa.get(e),r=t.Ma.get(i.targetId);t.isPrimaryClient&&r.length===1&&(t.sharedClientState.removeLocalQueryTarget(i.targetId),EM(t.remoteStore,i.targetId))}async function $U(n,e){const t=en(n);try{const i=await Pq(t.localStore,e);e.targetChanges.forEach((r,s)=>{const o=t.Na.get(s);o&&(Kn(r.addedDocuments.size+r.modifiedDocuments.size+r.removedDocuments.size<=1),r.addedDocuments.size>0?o.va=!0:r.modifiedDocuments.size>0?Kn(o.va):r.removedDocuments.size>0&&(Kn(o.va),o.va=!1))}),await KU(t,i,e)}catch(i){await uM(i)}}function m2(n,e,t){const i=en(n);if(i.isPrimaryClient&&t===0||!i.isPrimaryClient&&t===1){const r=[];i.Fa.forEach((s,o)=>{const a=o.view.Z_(e);a.snapshot&&r.push(a.snapshot)}),function(o,a){const l=en(o);l.onlineState=a;let c=!1;l.queries.forEach((d,f)=>{for(const p of f.j_)p.Z_(a)&&(c=!0)}),c&&bM(l)}(i.eventManager,e),r.length&&i.Ca.d_(r),i.onlineState=e,i.isPrimaryClient&&i.sharedClientState.setOnlineState(e)}}async function u$(n,e,t){const i=en(n);i.sharedClientState.updateQueryState(e,"rejected",t);const r=i.Na.get(e),s=r&&r.key;if(s){let o=new ri(Pt.comparator);o=o.insert(s,Zi.newNoDocument(s,kt.min()));const a=rn().add(s),l=new ex(kt.min(),new Map,new ri(hn),o,a);await $U(i,l),i.Oa=i.Oa.remove(s),i.Na.delete(e),PM(i)}else await sT(i.localStore,e,!1).then(()=>aT(i,e,t)).catch(uM)}function aT(n,e,t=null){n.sharedClientState.removeLocalQueryTarget(e);for(const i of n.Ma.get(e))n.Fa.delete(i),t&&n.Ca.$a(i,t);n.Ma.delete(e),n.isPrimaryClient&&n.La.gr(e).forEach(i=>{n.La.containsKey(i)||YU(n,i)})}function YU(n,e){n.xa.delete(e.path.canonicalString());const t=n.Oa.get(e);t!==null&&(EM(n.remoteStore,t),n.Oa=n.Oa.remove(e),n.Na.delete(t),PM(n))}function g2(n,e,t){for(const i of t)i instanceof jU?(n.La.addReference(i.key,e),h$(n,i)):i instanceof XU?(pt("SyncEngine","Document no longer in limbo: "+i.key),n.La.removeReference(i.key,e),n.La.containsKey(i.key)||YU(n,i.key)):Wt()}function h$(n,e){const t=e.key,i=t.path.canonicalString();n.Oa.get(t)||n.xa.has(i)||(pt("SyncEngine","New document in limbo: "+t),n.xa.add(i),PM(n))}function PM(n){for(;n.xa.size>0&&n.Oa.size{o.push(i.Ka(l,e,t).then(c=>{var d;if((c||t)&&i.isPrimaryClient){const f=c?!c.fromCache:(d=t==null?void 0:t.targetChanges.get(l.targetId))===null||d===void 0?void 0:d.current;i.sharedClientState.updateQueryState(l.targetId,f?"current":"not-current")}if(c){r.push(c);const f=wM.Wi(l.targetId,c);s.push(f)}}))}),await Promise.all(o),i.Ca.d_(r),await async function(l,c){const d=en(l);try{await d.persistence.runTransaction("notifyLocalViewChanges","readwrite",f=>Ie.forEach(c,p=>Ie.forEach(p.$i,m=>d.persistence.referenceDelegate.addReference(f,p.targetId,m)).next(()=>Ie.forEach(p.Ui,m=>d.persistence.referenceDelegate.removeReference(f,p.targetId,m)))))}catch(f){if(!km(f))throw f;pt("LocalStore","Failed to update sequence numbers: "+f)}for(const f of c){const p=f.targetId;if(!f.fromCache){const m=d.os.get(p),_=m.snapshotVersion,S=m.withLastLimboFreeSnapshotVersion(_);d.os=d.os.insert(p,S)}}}(i.localStore,s))}async function d$(n,e){const t=en(n);if(!t.currentUser.isEqual(e)){pt("SyncEngine","User change. New user:",e.toKey());const i=await UU(t.localStore,e);t.currentUser=e,function(s,o){s.ka.forEach(a=>{a.forEach(l=>{l.reject(new Tt(qe.CANCELLED,o))})}),s.ka.clear()}(t,"'waitForPendingWrites' promise is rejected due to a user change."),t.sharedClientState.handleUserChange(e,i.removedBatchIds,i.addedBatchIds),await KU(t,i.hs)}}function f$(n,e){const t=en(n),i=t.Na.get(e);if(i&&i.va)return rn().add(i.key);{let r=rn();const s=t.Ma.get(e);if(!s)return r;for(const o of s){const a=t.Fa.get(o);r=r.unionWith(a.view.Va)}return r}}function QU(n){const e=en(n);return e.remoteStore.remoteSyncer.applyRemoteEvent=$U.bind(null,e),e.remoteStore.remoteSyncer.getRemoteKeysForTarget=f$.bind(null,e),e.remoteStore.remoteSyncer.rejectListen=u$.bind(null,e),e.Ca.d_=Jq.bind(null,e.eventManager),e.Ca.$a=Zq.bind(null,e.eventManager),e}class E0{constructor(){this.kind="memory",this.synchronizeTabs=!1}async initialize(e){this.serializer=VU(e.databaseInfo.databaseId),this.sharedClientState=this.Wa(e),this.persistence=this.Ga(e),await this.persistence.start(),this.localStore=this.za(e),this.gcScheduler=this.ja(e,this.localStore),this.indexBackfillerScheduler=this.Ha(e,this.localStore)}ja(e,t){return null}Ha(e,t){return null}za(e){return bq(this.persistence,new Mq,e.initialUser,this.serializer)}Ga(e){return new Eq(SM.Zr,this.serializer)}Wa(e){return new Nq}async terminate(){var e,t;(e=this.gcScheduler)===null||e===void 0||e.stop(),(t=this.indexBackfillerScheduler)===null||t===void 0||t.stop(),this.sharedClientState.shutdown(),await this.persistence.shutdown()}}E0.provider={build:()=>new E0};class lT{async initialize(e,t){this.localStore||(this.localStore=e.localStore,this.sharedClientState=e.sharedClientState,this.datastore=this.createDatastore(t),this.remoteStore=this.createRemoteStore(t),this.eventManager=this.createEventManager(t),this.syncEngine=this.createSyncEngine(t,!e.synchronizeTabs),this.sharedClientState.onlineStateHandler=i=>m2(this.syncEngine,i,1),this.remoteStore.remoteSyncer.handleCredentialChange=d$.bind(null,this.syncEngine),await qq(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(e){return function(){return new Yq}()}createDatastore(e){const t=VU(e.databaseInfo.databaseId),i=function(s){return new Uq(s)}(e.databaseInfo);return function(s,o,a,l){return new Bq(s,o,a,l)}(e.authCredentials,e.appCheckCredentials,i,t)}createRemoteStore(e){return function(i,r,s,o,a){return new Hq(i,r,s,o,a)}(this.localStore,this.datastore,e.asyncQueue,t=>m2(this.syncEngine,t,0),function(){return c2.D()?new c2:new Dq}())}createSyncEngine(e,t){return function(r,s,o,a,l,c,d){const f=new r$(r,s,o,a,l,c);return d&&(f.Qa=!0),f}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,e.initialUser,e.maxConcurrentLimboResolutions,t)}async terminate(){var e,t;await async function(r){const s=en(r);pt("RemoteStore","RemoteStore shutting down."),s.L_.add(5),await Um(s),s.k_.shutdown(),s.q_.set("Unknown")}(this.remoteStore),(e=this.datastore)===null||e===void 0||e.terminate(),(t=this.eventManager)===null||t===void 0||t.terminate()}}lT.provider={build:()=>new lT};/** * @license * Copyright 2020 Google LLC * @@ -1743,7 +1743,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class m${constructor(e,t,i,r,s){this.authCredentials=e,this.appCheckCredentials=t,this.asyncQueue=i,this.databaseInfo=r,this.user=Qi.UNAUTHENTICATED,this.clientId=eX.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this._uninitializedComponentsProvider=s,this.authCredentials.start(i,async o=>{pt("FirestoreClient","Received user=",o.uid),await this.authCredentialListener(o),this.user=o}),this.appCheckCredentials.start(i,o=>(pt("FirestoreClient","Received new app check token=",o),this.appCheckCredentialListener(o,this.user)))}get configuration(){return{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,authCredentials:this.authCredentials,appCheckCredentials:this.appCheckCredentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(e){this.authCredentialListener=e}setAppCheckTokenChangeListener(e){this.appCheckCredentialListener=e}terminate(){this.asyncQueue.enterRestrictedMode();const e=new jc;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted(async()=>{try{this._onlineComponents&&await this._onlineComponents.terminate(),this._offlineComponents&&await this._offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),e.resolve()}catch(t){const i=GU(t,"Failed to shutdown persistence");e.reject(i)}}),e.promise}}async function Pw(n,e){n.asyncQueue.verifyOperationInProgress(),pt("FirestoreClient","Initializing OfflineComponentProvider");const t=n.configuration;await e.initialize(t);let i=t.initialUser;n.setCredentialChangeListener(async r=>{i.isEqual(r)||(await OU(e.localStore,r),i=r)}),e.persistence.setDatabaseDeletedListener(()=>n.terminate()),n._offlineComponents=e}async function y2(n,e){n.asyncQueue.verifyOperationInProgress();const t=await g$(n);pt("FirestoreClient","Initializing OnlineComponentProvider"),await e.initialize(t,n.configuration),n.setCredentialChangeListener(i=>h2(e.remoteStore,i)),n.setAppCheckTokenChangeListener((i,r)=>h2(e.remoteStore,r)),n._onlineComponents=e}async function g$(n){if(!n._offlineComponents)if(n._uninitializedComponentsProvider){pt("FirestoreClient","Using user provided OfflineComponentProvider");try{await Pw(n,n._uninitializedComponentsProvider._offline)}catch(e){const t=e;if(!function(r){return r.name==="FirebaseError"?r.code===qe.FAILED_PRECONDITION||r.code===qe.UNIMPLEMENTED:!(typeof DOMException<"u"&&r instanceof DOMException)||r.code===22||r.code===20||r.code===11}(t))throw t;od("Error using user provided cache. Falling back to memory cache: "+t),await Pw(n,new E0)}}else pt("FirestoreClient","Using default OfflineComponentProvider"),await Pw(n,new E0);return n._offlineComponents}async function y$(n){return n._onlineComponents||(n._uninitializedComponentsProvider?(pt("FirestoreClient","Using user provided OnlineComponentProvider"),await y2(n,n._uninitializedComponentsProvider._online)):(pt("FirestoreClient","Using default OnlineComponentProvider"),await y2(n,new lT))),n._onlineComponents}async function v$(n){const e=await y$(n),t=e.eventManager;return t.onListen=s$.bind(null,e.syncEngine),t.onUnlisten=l$.bind(null,e.syncEngine),t.onFirstRemoteStoreListen=o$.bind(null,e.syncEngine),t.onLastRemoteStoreUnlisten=c$.bind(null,e.syncEngine),t}function _$(n,e,t={}){const i=new jc;return n.asyncQueue.enqueueAndForget(async()=>function(s,o,a,l,c){const d=new p$({next:p=>{d.Za(),o.enqueueAndForget(()=>Qq(s,f)),p.fromCache&&l.source==="server"?c.reject(new Tt(qe.UNAVAILABLE,'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')):c.resolve(p)},error:p=>c.reject(p)}),f=new e$(a,d,{includeMetadataChanges:!0,_a:!0});return Kq(s,f)}(await v$(n),n.asyncQueue,e,t,i)),i.promise}/** + */class m${constructor(e,t,i,r,s){this.authCredentials=e,this.appCheckCredentials=t,this.asyncQueue=i,this.databaseInfo=r,this.user=Qi.UNAUTHENTICATED,this.clientId=eX.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this._uninitializedComponentsProvider=s,this.authCredentials.start(i,async o=>{pt("FirestoreClient","Received user=",o.uid),await this.authCredentialListener(o),this.user=o}),this.appCheckCredentials.start(i,o=>(pt("FirestoreClient","Received new app check token=",o),this.appCheckCredentialListener(o,this.user)))}get configuration(){return{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,authCredentials:this.authCredentials,appCheckCredentials:this.appCheckCredentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(e){this.authCredentialListener=e}setAppCheckTokenChangeListener(e){this.appCheckCredentialListener=e}terminate(){this.asyncQueue.enterRestrictedMode();const e=new jc;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted(async()=>{try{this._onlineComponents&&await this._onlineComponents.terminate(),this._offlineComponents&&await this._offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),e.resolve()}catch(t){const i=WU(t,"Failed to shutdown persistence");e.reject(i)}}),e.promise}}async function Pw(n,e){n.asyncQueue.verifyOperationInProgress(),pt("FirestoreClient","Initializing OfflineComponentProvider");const t=n.configuration;await e.initialize(t);let i=t.initialUser;n.setCredentialChangeListener(async r=>{i.isEqual(r)||(await UU(e.localStore,r),i=r)}),e.persistence.setDatabaseDeletedListener(()=>n.terminate()),n._offlineComponents=e}async function y2(n,e){n.asyncQueue.verifyOperationInProgress();const t=await g$(n);pt("FirestoreClient","Initializing OnlineComponentProvider"),await e.initialize(t,n.configuration),n.setCredentialChangeListener(i=>h2(e.remoteStore,i)),n.setAppCheckTokenChangeListener((i,r)=>h2(e.remoteStore,r)),n._onlineComponents=e}async function g$(n){if(!n._offlineComponents)if(n._uninitializedComponentsProvider){pt("FirestoreClient","Using user provided OfflineComponentProvider");try{await Pw(n,n._uninitializedComponentsProvider._offline)}catch(e){const t=e;if(!function(r){return r.name==="FirebaseError"?r.code===qe.FAILED_PRECONDITION||r.code===qe.UNIMPLEMENTED:!(typeof DOMException<"u"&&r instanceof DOMException)||r.code===22||r.code===20||r.code===11}(t))throw t;od("Error using user provided cache. Falling back to memory cache: "+t),await Pw(n,new E0)}}else pt("FirestoreClient","Using default OfflineComponentProvider"),await Pw(n,new E0);return n._offlineComponents}async function y$(n){return n._onlineComponents||(n._uninitializedComponentsProvider?(pt("FirestoreClient","Using user provided OnlineComponentProvider"),await y2(n,n._uninitializedComponentsProvider._online)):(pt("FirestoreClient","Using default OnlineComponentProvider"),await y2(n,new lT))),n._onlineComponents}async function v$(n){const e=await y$(n),t=e.eventManager;return t.onListen=s$.bind(null,e.syncEngine),t.onUnlisten=l$.bind(null,e.syncEngine),t.onFirstRemoteStoreListen=o$.bind(null,e.syncEngine),t.onLastRemoteStoreUnlisten=c$.bind(null,e.syncEngine),t}function _$(n,e,t={}){const i=new jc;return n.asyncQueue.enqueueAndForget(async()=>function(s,o,a,l,c){const d=new p$({next:p=>{d.Za(),o.enqueueAndForget(()=>Qq(s,f)),p.fromCache&&l.source==="server"?c.reject(new Tt(qe.UNAVAILABLE,'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')):c.resolve(p)},error:p=>c.reject(p)}),f=new e$(a,d,{includeMetadataChanges:!0,_a:!0});return Kq(s,f)}(await v$(n),n.asyncQueue,e,t,i)),i.promise}/** * @license * Copyright 2023 Google LLC * @@ -1758,7 +1758,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function QU(n){const e={};return n.timeoutSeconds!==void 0&&(e.timeoutSeconds=n.timeoutSeconds),e}/** + */function JU(n){const e={};return n.timeoutSeconds!==void 0&&(e.timeoutSeconds=n.timeoutSeconds),e}/** * @license * Copyright 2020 Google LLC * @@ -1803,7 +1803,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class x2{constructor(e){var t,i;if(e.host===void 0){if(e.ssl!==void 0)throw new Tt(qe.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com",this.ssl=!0}else this.host=e.host,this.ssl=(t=e.ssl)===null||t===void 0||t;if(this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,this.localCache=e.localCache,e.cacheSizeBytes===void 0)this.cacheSizeBytes=41943040;else{if(e.cacheSizeBytes!==-1&&e.cacheSizeBytes<1048576)throw new Tt(qe.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}S$("experimentalForceLongPolling",e.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",e.experimentalAutoDetectLongPolling),this.experimentalForceLongPolling=!!e.experimentalForceLongPolling,this.experimentalForceLongPolling?this.experimentalAutoDetectLongPolling=!1:e.experimentalAutoDetectLongPolling===void 0?this.experimentalAutoDetectLongPolling=!0:this.experimentalAutoDetectLongPolling=!!e.experimentalAutoDetectLongPolling,this.experimentalLongPollingOptions=QU((i=e.experimentalLongPollingOptions)!==null&&i!==void 0?i:{}),function(s){if(s.timeoutSeconds!==void 0){if(isNaN(s.timeoutSeconds))throw new Tt(qe.INVALID_ARGUMENT,`invalid long polling timeout: ${s.timeoutSeconds} (must not be NaN)`);if(s.timeoutSeconds<5)throw new Tt(qe.INVALID_ARGUMENT,`invalid long polling timeout: ${s.timeoutSeconds} (minimum allowed value is 5)`);if(s.timeoutSeconds>30)throw new Tt(qe.INVALID_ARGUMENT,`invalid long polling timeout: ${s.timeoutSeconds} (maximum allowed value is 30)`)}}(this.experimentalLongPollingOptions),this.useFetchStreams=!!e.useFetchStreams}isEqual(e){return this.host===e.host&&this.ssl===e.ssl&&this.credentials===e.credentials&&this.cacheSizeBytes===e.cacheSizeBytes&&this.experimentalForceLongPolling===e.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===e.experimentalAutoDetectLongPolling&&function(i,r){return i.timeoutSeconds===r.timeoutSeconds}(this.experimentalLongPollingOptions,e.experimentalLongPollingOptions)&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams}}class RM{constructor(e,t,i,r){this._authCredentials=e,this._appCheckCredentials=t,this._databaseId=i,this._app=r,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new x2({}),this._settingsFrozen=!1,this._terminateTask="notTerminated"}get app(){if(!this._app)throw new Tt(qe.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app}get _initialized(){return this._settingsFrozen}get _terminated(){return this._terminateTask!=="notTerminated"}_setSettings(e){if(this._settingsFrozen)throw new Tt(qe.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");this._settings=new x2(e),e.credentials!==void 0&&(this._authCredentials=function(i){if(!i)return new X7;switch(i.type){case"firstParty":return new K7(i.sessionIndex||"0",i.iamToken||null,i.authTokenFactory||null);case"provider":return i.client;default:throw new Tt(qe.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invalid credential type")}}(e.credentials))}_getSettings(){return this._settings}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return this._terminateTask==="notTerminated"&&(this._terminateTask=this._terminate()),this._terminateTask}async _restart(){this._terminateTask==="notTerminated"?await this._terminate():this._terminateTask="notTerminated"}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return function(t){const i=v2.get(t);i&&(pt("ComponentProvider","Removing Datastore"),v2.delete(t),i.terminate())}(this),Promise.resolve()}}function E$(n,e,t,i={}){var r;const s=(n=cT(n,RM))._getSettings(),o=`${e}:${t}`;if(s.host!=="firestore.googleapis.com"&&s.host!==o&&od("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used."),n._setSettings(Object.assign(Object.assign({},s),{host:o,ssl:!1})),i.mockUserToken){let a,l;if(typeof i.mockUserToken=="string")a=i.mockUserToken,l=Qi.MOCK_USER;else{a=wj(i.mockUserToken,(r=n._app)===null||r===void 0?void 0:r.options.projectId);const c=i.mockUserToken.sub||i.mockUserToken.user_id;if(!c)throw new Tt(qe.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");l=new Qi(c)}n._authCredentials=new q7(new cU(a,l))}}/** + */class x2{constructor(e){var t,i;if(e.host===void 0){if(e.ssl!==void 0)throw new Tt(qe.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com",this.ssl=!0}else this.host=e.host,this.ssl=(t=e.ssl)===null||t===void 0||t;if(this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,this.localCache=e.localCache,e.cacheSizeBytes===void 0)this.cacheSizeBytes=41943040;else{if(e.cacheSizeBytes!==-1&&e.cacheSizeBytes<1048576)throw new Tt(qe.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}S$("experimentalForceLongPolling",e.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",e.experimentalAutoDetectLongPolling),this.experimentalForceLongPolling=!!e.experimentalForceLongPolling,this.experimentalForceLongPolling?this.experimentalAutoDetectLongPolling=!1:e.experimentalAutoDetectLongPolling===void 0?this.experimentalAutoDetectLongPolling=!0:this.experimentalAutoDetectLongPolling=!!e.experimentalAutoDetectLongPolling,this.experimentalLongPollingOptions=JU((i=e.experimentalLongPollingOptions)!==null&&i!==void 0?i:{}),function(s){if(s.timeoutSeconds!==void 0){if(isNaN(s.timeoutSeconds))throw new Tt(qe.INVALID_ARGUMENT,`invalid long polling timeout: ${s.timeoutSeconds} (must not be NaN)`);if(s.timeoutSeconds<5)throw new Tt(qe.INVALID_ARGUMENT,`invalid long polling timeout: ${s.timeoutSeconds} (minimum allowed value is 5)`);if(s.timeoutSeconds>30)throw new Tt(qe.INVALID_ARGUMENT,`invalid long polling timeout: ${s.timeoutSeconds} (maximum allowed value is 30)`)}}(this.experimentalLongPollingOptions),this.useFetchStreams=!!e.useFetchStreams}isEqual(e){return this.host===e.host&&this.ssl===e.ssl&&this.credentials===e.credentials&&this.cacheSizeBytes===e.cacheSizeBytes&&this.experimentalForceLongPolling===e.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===e.experimentalAutoDetectLongPolling&&function(i,r){return i.timeoutSeconds===r.timeoutSeconds}(this.experimentalLongPollingOptions,e.experimentalLongPollingOptions)&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams}}class RM{constructor(e,t,i,r){this._authCredentials=e,this._appCheckCredentials=t,this._databaseId=i,this._app=r,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new x2({}),this._settingsFrozen=!1,this._terminateTask="notTerminated"}get app(){if(!this._app)throw new Tt(qe.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app}get _initialized(){return this._settingsFrozen}get _terminated(){return this._terminateTask!=="notTerminated"}_setSettings(e){if(this._settingsFrozen)throw new Tt(qe.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");this._settings=new x2(e),e.credentials!==void 0&&(this._authCredentials=function(i){if(!i)return new X7;switch(i.type){case"firstParty":return new K7(i.sessionIndex||"0",i.iamToken||null,i.authTokenFactory||null);case"provider":return i.client;default:throw new Tt(qe.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invalid credential type")}}(e.credentials))}_getSettings(){return this._settings}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return this._terminateTask==="notTerminated"&&(this._terminateTask=this._terminate()),this._terminateTask}async _restart(){this._terminateTask==="notTerminated"?await this._terminate():this._terminateTask="notTerminated"}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return function(t){const i=v2.get(t);i&&(pt("ComponentProvider","Removing Datastore"),v2.delete(t),i.terminate())}(this),Promise.resolve()}}function E$(n,e,t,i={}){var r;const s=(n=cT(n,RM))._getSettings(),o=`${e}:${t}`;if(s.host!=="firestore.googleapis.com"&&s.host!==o&&od("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used."),n._setSettings(Object.assign(Object.assign({},s),{host:o,ssl:!1})),i.mockUserToken){let a,l;if(typeof i.mockUserToken=="string")a=i.mockUserToken,l=Qi.MOCK_USER;else{a=wj(i.mockUserToken,(r=n._app)===null||r===void 0?void 0:r.options.projectId);const c=i.mockUserToken.sub||i.mockUserToken.user_id;if(!c)throw new Tt(qe.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");l=new Qi(c)}n._authCredentials=new q7(new uU(a,l))}}/** * @license * Copyright 2020 Google LLC * @@ -1818,7 +1818,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class nx{constructor(e,t,i){this.converter=t,this._query=i,this.type="query",this.firestore=e}withConverter(e){return new nx(this.firestore,e,this._query)}}class Pd{constructor(e,t,i){this.converter=t,this._key=i,this.type="document",this.firestore=e}get _path(){return this._key.path}get id(){return this._key.path.lastSegment()}get path(){return this._key.path.canonicalString()}get parent(){return new jh(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new Pd(this.firestore,e,this._key)}}class jh extends nx{constructor(e,t,i){super(e,t,yU(i)),this._path=i,this.type="collection"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){const e=this._path.popLast();return e.isEmpty()?null:new Pd(this.firestore,null,new Pt(e))}withConverter(e){return new jh(this.firestore,e,this._path)}}function IM(n,e,...t){if(n=Ul(n),x$("collection","path",e),n instanceof RM){const i=qn.fromString(e,...t);return _2(i),new jh(n,null,i)}{if(!(n instanceof Pd||n instanceof jh))throw new Tt(qe.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const i=n._path.child(qn.fromString(e,...t));return _2(i),new jh(n.firestore,null,i)}}/** + */class nx{constructor(e,t,i){this.converter=t,this._query=i,this.type="query",this.firestore=e}withConverter(e){return new nx(this.firestore,e,this._query)}}class Pd{constructor(e,t,i){this.converter=t,this._key=i,this.type="document",this.firestore=e}get _path(){return this._key.path}get id(){return this._key.path.lastSegment()}get path(){return this._key.path.canonicalString()}get parent(){return new jh(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new Pd(this.firestore,e,this._key)}}class jh extends nx{constructor(e,t,i){super(e,t,vU(i)),this._path=i,this.type="collection"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){const e=this._path.popLast();return e.isEmpty()?null:new Pd(this.firestore,null,new Pt(e))}withConverter(e){return new jh(this.firestore,e,this._path)}}function IM(n,e,...t){if(n=Ul(n),x$("collection","path",e),n instanceof RM){const i=qn.fromString(e,...t);return _2(i),new jh(n,null,i)}{if(!(n instanceof Pd||n instanceof jh))throw new Tt(qe.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const i=n._path.child(qn.fromString(e,...t));return _2(i),new jh(n.firestore,null,i)}}/** * @license * Copyright 2020 Google LLC * @@ -1833,8 +1833,8 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class S2{constructor(e=Promise.resolve()){this.Pu=[],this.Iu=!1,this.Tu=[],this.Eu=null,this.du=!1,this.Au=!1,this.Ru=[],this.t_=new VU(this,"async_queue_retry"),this.Vu=()=>{const i=bw();i&&pt("AsyncQueue","Visibility state changed to "+i.visibilityState),this.t_.jo()},this.mu=e;const t=bw();t&&typeof t.addEventListener=="function"&&t.addEventListener("visibilitychange",this.Vu)}get isShuttingDown(){return this.Iu}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.fu(),this.gu(e)}enterRestrictedMode(e){if(!this.Iu){this.Iu=!0,this.Au=e||!1;const t=bw();t&&typeof t.removeEventListener=="function"&&t.removeEventListener("visibilitychange",this.Vu)}}enqueue(e){if(this.fu(),this.Iu)return new Promise(()=>{});const t=new jc;return this.gu(()=>this.Iu&&this.Au?Promise.resolve():(e().then(t.resolve,t.reject),t.promise)).then(()=>t.promise)}enqueueRetryable(e){this.enqueueAndForget(()=>(this.Pu.push(e),this.pu()))}async pu(){if(this.Pu.length!==0){try{await this.Pu[0](),this.Pu.shift(),this.t_.reset()}catch(e){if(!km(e))throw e;pt("AsyncQueue","Operation failed with retryable error: "+e)}this.Pu.length>0&&this.t_.Go(()=>this.pu())}}gu(e){const t=this.mu.then(()=>(this.du=!0,e().catch(i=>{this.Eu=i,this.du=!1;const r=function(o){let a=o.message||"";return o.stack&&(a=o.stack.includes(o.message)?o.stack:o.message+` -`+o.stack),a}(i);throw ha("INTERNAL UNHANDLED ERROR: ",r),i}).then(i=>(this.du=!1,i))));return this.mu=t,t}enqueueAfterDelay(e,t,i){this.fu(),this.Ru.indexOf(e)>-1&&(t=0);const r=CM.createAndSchedule(this,e,t,i,s=>this.yu(s));return this.Tu.push(r),r}fu(){this.Eu&&Wt()}verifyOperationInProgress(){}async wu(){let e;do e=this.mu,await e;while(e!==this.mu)}Su(e){for(const t of this.Tu)if(t.timerId===e)return!0;return!1}bu(e){return this.wu().then(()=>{this.Tu.sort((t,i)=>t.targetTimeMs-i.targetTimeMs);for(const t of this.Tu)if(t.skipDelay(),e!=="all"&&t.timerId===e)break;return this.wu()})}Du(e){this.Ru.push(e)}yu(e){const t=this.Tu.indexOf(e);this.Tu.splice(t,1)}}class JU extends RM{constructor(e,t,i,r){super(e,t,i,r),this.type="firestore",this._queue=new S2,this._persistenceKey=(r==null?void 0:r.name)||"[DEFAULT]"}async _terminate(){if(this._firestoreClient){const e=this._firestoreClient.terminate();this._queue=new S2(e),this._firestoreClient=void 0,await e}}}function T$(n,e){const t=typeof n=="object"?n:eU(),i=typeof n=="string"?n:e||"(default)",r=lM(t,"firestore").getImmediate({identifier:i});if(!r._initialized){const s=xj("firestore");s&&E$(r,...s)}return r}function A$(n){if(n._terminated)throw new Tt(qe.FAILED_PRECONDITION,"The client has already been terminated.");return n._firestoreClient||M$(n),n._firestoreClient}function M$(n){var e,t,i;const r=n._freezeSettings(),s=function(a,l,c,d){return new uX(a,l,c,d.host,d.ssl,d.experimentalForceLongPolling,d.experimentalAutoDetectLongPolling,QU(d.experimentalLongPollingOptions),d.useFetchStreams)}(n._databaseId,((e=n._app)===null||e===void 0?void 0:e.options.appId)||"",n._persistenceKey,r);n._componentsProvider||!((t=r.localCache)===null||t===void 0)&&t._offlineComponentProvider&&(!((i=r.localCache)===null||i===void 0)&&i._onlineComponentProvider)&&(n._componentsProvider={_offline:r.localCache._offlineComponentProvider,_online:r.localCache._onlineComponentProvider}),n._firestoreClient=new m$(n._authCredentials,n._appCheckCredentials,n._queue,s,n._componentsProvider&&function(a){const l=a==null?void 0:a._online.build();return{_offline:a==null?void 0:a._offline.build(l),_online:l}}(n._componentsProvider))}/** + */class S2{constructor(e=Promise.resolve()){this.Pu=[],this.Iu=!1,this.Tu=[],this.Eu=null,this.du=!1,this.Au=!1,this.Ru=[],this.t_=new BU(this,"async_queue_retry"),this.Vu=()=>{const i=bw();i&&pt("AsyncQueue","Visibility state changed to "+i.visibilityState),this.t_.jo()},this.mu=e;const t=bw();t&&typeof t.addEventListener=="function"&&t.addEventListener("visibilitychange",this.Vu)}get isShuttingDown(){return this.Iu}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.fu(),this.gu(e)}enterRestrictedMode(e){if(!this.Iu){this.Iu=!0,this.Au=e||!1;const t=bw();t&&typeof t.removeEventListener=="function"&&t.removeEventListener("visibilitychange",this.Vu)}}enqueue(e){if(this.fu(),this.Iu)return new Promise(()=>{});const t=new jc;return this.gu(()=>this.Iu&&this.Au?Promise.resolve():(e().then(t.resolve,t.reject),t.promise)).then(()=>t.promise)}enqueueRetryable(e){this.enqueueAndForget(()=>(this.Pu.push(e),this.pu()))}async pu(){if(this.Pu.length!==0){try{await this.Pu[0](),this.Pu.shift(),this.t_.reset()}catch(e){if(!km(e))throw e;pt("AsyncQueue","Operation failed with retryable error: "+e)}this.Pu.length>0&&this.t_.Go(()=>this.pu())}}gu(e){const t=this.mu.then(()=>(this.du=!0,e().catch(i=>{this.Eu=i,this.du=!1;const r=function(o){let a=o.message||"";return o.stack&&(a=o.stack.includes(o.message)?o.stack:o.message+` +`+o.stack),a}(i);throw ha("INTERNAL UNHANDLED ERROR: ",r),i}).then(i=>(this.du=!1,i))));return this.mu=t,t}enqueueAfterDelay(e,t,i){this.fu(),this.Ru.indexOf(e)>-1&&(t=0);const r=CM.createAndSchedule(this,e,t,i,s=>this.yu(s));return this.Tu.push(r),r}fu(){this.Eu&&Wt()}verifyOperationInProgress(){}async wu(){let e;do e=this.mu,await e;while(e!==this.mu)}Su(e){for(const t of this.Tu)if(t.timerId===e)return!0;return!1}bu(e){return this.wu().then(()=>{this.Tu.sort((t,i)=>t.targetTimeMs-i.targetTimeMs);for(const t of this.Tu)if(t.skipDelay(),e!=="all"&&t.timerId===e)break;return this.wu()})}Du(e){this.Ru.push(e)}yu(e){const t=this.Tu.indexOf(e);this.Tu.splice(t,1)}}class ZU extends RM{constructor(e,t,i,r){super(e,t,i,r),this.type="firestore",this._queue=new S2,this._persistenceKey=(r==null?void 0:r.name)||"[DEFAULT]"}async _terminate(){if(this._firestoreClient){const e=this._firestoreClient.terminate();this._queue=new S2(e),this._firestoreClient=void 0,await e}}}function T$(n,e){const t=typeof n=="object"?n:tU(),i=typeof n=="string"?n:e||"(default)",r=lM(t,"firestore").getImmediate({identifier:i});if(!r._initialized){const s=xj("firestore");s&&E$(r,...s)}return r}function A$(n){if(n._terminated)throw new Tt(qe.FAILED_PRECONDITION,"The client has already been terminated.");return n._firestoreClient||M$(n),n._firestoreClient}function M$(n){var e,t,i;const r=n._freezeSettings(),s=function(a,l,c,d){return new uX(a,l,c,d.host,d.ssl,d.experimentalForceLongPolling,d.experimentalAutoDetectLongPolling,JU(d.experimentalLongPollingOptions),d.useFetchStreams)}(n._databaseId,((e=n._app)===null||e===void 0?void 0:e.options.appId)||"",n._persistenceKey,r);n._componentsProvider||!((t=r.localCache)===null||t===void 0)&&t._offlineComponentProvider&&(!((i=r.localCache)===null||i===void 0)&&i._onlineComponentProvider)&&(n._componentsProvider={_offline:r.localCache._offlineComponentProvider,_online:r.localCache._onlineComponentProvider}),n._firestoreClient=new m$(n._authCredentials,n._appCheckCredentials,n._queue,s,n._componentsProvider&&function(a){const l=a==null?void 0:a._online.build();return{_offline:a==null?void 0:a._offline.build(l),_online:l}}(n._componentsProvider))}/** * @license * Copyright 2020 Google LLC * @@ -1864,7 +1864,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class ZU{constructor(...e){for(let t=0;tt)}toArray(){return this._values.map(e=>e)}isEqual(e){return function(i,r){if(i.length!==r.length)return!1;for(let s=0;s=0)throw w2(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`,n,!1,void 0,t);try{return new ZU(...e.split("."))._internalPath}catch{throw w2(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,n,!1,void 0,t)}}function w2(n,e,t,i,r){const s=i&&!i.isEmpty(),o=r!==void 0;let a=`Function ${e}() called with invalid data`;t&&(a+=" (via `toFirestore()`)"),a+=". ";let l="";return(s||o)&&(l+=" (found",s&&(l+=` in field ${i}`),o&&(l+=` in document ${r}`),l+=")"),new Tt(qe.INVALID_ARGUMENT,a+n+l)}/** + */class b${constructor(e){this._values=(e||[]).map(t=>t)}toArray(){return this._values.map(e=>e)}isEqual(e){return function(i,r){if(i.length!==r.length)return!1;for(let s=0;s=0)throw w2(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`,n,!1,void 0,t);try{return new eF(...e.split("."))._internalPath}catch{throw w2(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,n,!1,void 0,t)}}function w2(n,e,t,i,r){const s=i&&!i.isEmpty(),o=r!==void 0;let a=`Function ${e}() called with invalid data`;t&&(a+=" (via `toFirestore()`)"),a+=". ";let l="";return(s||o)&&(l+=" (found",s&&(l+=` in field ${i}`),o&&(l+=` in document ${r}`),l+=")"),new Tt(qe.INVALID_ARGUMENT,a+n+l)}/** * @license * Copyright 2020 Google LLC * @@ -1909,7 +1909,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class eF{constructor(e,t,i,r,s){this._firestore=e,this._userDataWriter=t,this._key=i,this._document=r,this._converter=s}get id(){return this._key.path.lastSegment()}get ref(){return new Pd(this._firestore,this._converter,this._key)}exists(){return this._document!==null}data(){if(this._document){if(this._converter){const e=new I$(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(e)}return this._userDataWriter.convertValue(this._document.data.value)}}get(e){if(this._document){const t=this._document.data.field(tF("DocumentSnapshot.get",e));if(t!==null)return this._userDataWriter.convertValue(t)}}}class I$ extends eF{data(){return super.data()}}function tF(n,e){return typeof e=="string"?R$(n,e):e instanceof ZU?e._internalPath:e._delegate._internalPath}/** + */class tF{constructor(e,t,i,r,s){this._firestore=e,this._userDataWriter=t,this._key=i,this._document=r,this._converter=s}get id(){return this._key.path.lastSegment()}get ref(){return new Pd(this._firestore,this._converter,this._key)}exists(){return this._document!==null}data(){if(this._document){if(this._converter){const e=new I$(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(e)}return this._userDataWriter.convertValue(this._document.data.value)}}get(e){if(this._document){const t=this._document.data.field(nF("DocumentSnapshot.get",e));if(t!==null)return this._userDataWriter.convertValue(t)}}}class I$ extends tF{data(){return super.data()}}function nF(n,e){return typeof e=="string"?R$(n,e):e instanceof eF?e._internalPath:e._delegate._internalPath}/** * @license * Copyright 2020 Google LLC * @@ -1924,7 +1924,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function L$(n){if(n.limitType==="L"&&n.explicitOrderBy.length===0)throw new Tt(qe.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}class N${convertValue(e,t="none"){switch(ou(e)){case 0:return null;case 1:return e.booleanValue;case 2:return ei(e.integerValue||e.doubleValue);case 3:return this.convertTimestamp(e.timestampValue);case 4:return this.convertServerTimestamp(e,t);case 5:return e.stringValue;case 6:return this.convertBytes(su(e.bytesValue));case 7:return this.convertReference(e.referenceValue);case 8:return this.convertGeoPoint(e.geoPointValue);case 9:return this.convertArray(e.arrayValue,t);case 11:return this.convertObject(e.mapValue,t);case 10:return this.convertVectorValue(e.mapValue);default:throw Wt()}}convertObject(e,t){return this.convertObjectMap(e.fields,t)}convertObjectMap(e,t="none"){const i={};return $_(e,(r,s)=>{i[r]=this.convertValue(s,t)}),i}convertVectorValue(e){var t,i,r;const s=(r=(i=(t=e.fields)===null||t===void 0?void 0:t.value.arrayValue)===null||i===void 0?void 0:i.values)===null||r===void 0?void 0:r.map(o=>ei(o.doubleValue));return new b$(s)}convertGeoPoint(e){return new C$(ei(e.latitude),ei(e.longitude))}convertArray(e,t){return(e.values||[]).map(i=>this.convertValue(i,t))}convertServerTimestamp(e,t){switch(t){case"previous":const i=fM(e);return i==null?null:this.convertValue(i,t);case"estimate":return this.convertTimestamp(Yp(e));default:return null}}convertTimestamp(e){const t=bl(e);return new Vr(t.seconds,t.nanos)}convertDocumentKey(e,t){const i=qn.fromString(e);Kn(kU(i));const r=new Kp(i.get(1),i.get(3)),s=new Pt(i.popFirst(5));return r.isEqual(t)||ha(`Document ${s} contains a document reference within a different database (${r.projectId}/${r.database}) which is not supported. It will be treated as a reference in the current database (${t.projectId}/${t.database}) instead.`),s}}/** + */function L$(n){if(n.limitType==="L"&&n.explicitOrderBy.length===0)throw new Tt(qe.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}class N${convertValue(e,t="none"){switch(ou(e)){case 0:return null;case 1:return e.booleanValue;case 2:return ei(e.integerValue||e.doubleValue);case 3:return this.convertTimestamp(e.timestampValue);case 4:return this.convertServerTimestamp(e,t);case 5:return e.stringValue;case 6:return this.convertBytes(su(e.bytesValue));case 7:return this.convertReference(e.referenceValue);case 8:return this.convertGeoPoint(e.geoPointValue);case 9:return this.convertArray(e.arrayValue,t);case 11:return this.convertObject(e.mapValue,t);case 10:return this.convertVectorValue(e.mapValue);default:throw Wt()}}convertObject(e,t){return this.convertObjectMap(e.fields,t)}convertObjectMap(e,t="none"){const i={};return $_(e,(r,s)=>{i[r]=this.convertValue(s,t)}),i}convertVectorValue(e){var t,i,r;const s=(r=(i=(t=e.fields)===null||t===void 0?void 0:t.value.arrayValue)===null||i===void 0?void 0:i.values)===null||r===void 0?void 0:r.map(o=>ei(o.doubleValue));return new b$(s)}convertGeoPoint(e){return new C$(ei(e.latitude),ei(e.longitude))}convertArray(e,t){return(e.values||[]).map(i=>this.convertValue(i,t))}convertServerTimestamp(e,t){switch(t){case"previous":const i=fM(e);return i==null?null:this.convertValue(i,t);case"estimate":return this.convertTimestamp(Yp(e));default:return null}}convertTimestamp(e){const t=bl(e);return new Vr(t.seconds,t.nanos)}convertDocumentKey(e,t){const i=qn.fromString(e);Kn(OU(i));const r=new Kp(i.get(1),i.get(3)),s=new Pt(i.popFirst(5));return r.isEqual(t)||ha(`Document ${s} contains a document reference within a different database (${r.projectId}/${r.database}) which is not supported. It will be treated as a reference in the current database (${t.projectId}/${t.database}) instead.`),s}}/** * @license * Copyright 2020 Google LLC * @@ -1939,7 +1939,7 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class fy{constructor(e,t){this.hasPendingWrites=e,this.fromCache=t}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}}class D$ extends eF{constructor(e,t,i,r,s,o){super(e,t,i,r,o),this._firestore=e,this._firestoreImpl=e,this.metadata=s}exists(){return super.exists()}data(e={}){if(this._document){if(this._converter){const t=new Mv(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(t,e)}return this._userDataWriter.convertValue(this._document.data.value,e.serverTimestamps)}}get(e,t={}){if(this._document){const i=this._document.data.field(tF("DocumentSnapshot.get",e));if(i!==null)return this._userDataWriter.convertValue(i,t.serverTimestamps)}}}class Mv extends D${data(e={}){return super.data(e)}}class k${constructor(e,t,i,r){this._firestore=e,this._userDataWriter=t,this._snapshot=r,this.metadata=new fy(r.hasPendingWrites,r.fromCache),this.query=i}get docs(){const e=[];return this.forEach(t=>e.push(t)),e}get size(){return this._snapshot.docs.size}get empty(){return this.size===0}forEach(e,t){this._snapshot.docs.forEach(i=>{e.call(t,new Mv(this._firestore,this._userDataWriter,i.key,i,new fy(this._snapshot.mutatedKeys.has(i.key),this._snapshot.fromCache),this.query.converter))})}docChanges(e={}){const t=!!e.includeMetadataChanges;if(t&&this._snapshot.excludesMetadataChanges)throw new Tt(qe.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===t||(this._cachedChanges=function(r,s){if(r._snapshot.oldDocs.isEmpty()){let o=0;return r._snapshot.docChanges.map(a=>{const l=new Mv(r._firestore,r._userDataWriter,a.doc.key,a.doc,new fy(r._snapshot.mutatedKeys.has(a.doc.key),r._snapshot.fromCache),r.query.converter);return a.doc,{type:"added",doc:l,oldIndex:-1,newIndex:o++}})}{let o=r._snapshot.oldDocs;return r._snapshot.docChanges.filter(a=>s||a.type!==3).map(a=>{const l=new Mv(r._firestore,r._userDataWriter,a.doc.key,a.doc,new fy(r._snapshot.mutatedKeys.has(a.doc.key),r._snapshot.fromCache),r.query.converter);let c=-1,d=-1;return a.type!==0&&(c=o.indexOf(a.doc.key),o=o.delete(a.doc.key)),a.type!==1&&(o=o.add(a.doc),d=o.indexOf(a.doc.key)),{type:O$(a.type),doc:l,oldIndex:c,newIndex:d}})}}(this,t),this._cachedChangesIncludeMetadataChanges=t),this._cachedChanges}}function O$(n){switch(n){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return Wt()}}class U$ extends N${constructor(e){super(),this.firestore=e}convertBytes(e){return new T0(e)}convertReference(e){const t=this.convertDocumentKey(e,this.firestore._databaseId);return new Pd(this.firestore,null,t)}}function LM(n){n=cT(n,nx);const e=cT(n.firestore,JU),t=A$(e),i=new U$(e);return L$(n._query),_$(t,n._query).then(r=>new k$(e,i,n,r))}(function(e,t=!0){(function(r){Md=r})(Ad),sd(new iu("firestore",(i,{instanceIdentifier:r,options:s})=>{const o=i.getProvider("app").getImmediate(),a=new JU(new $7(i.getProvider("auth-internal")),new J7(i.getProvider("app-check-internal")),function(c,d){if(!Object.prototype.hasOwnProperty.apply(c.options,["projectId"]))throw new Tt(qe.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new Kp(c.options.projectId,d)}(o,r),o);return s=Object.assign({useFetchStreams:t},s),a._setSettings(s),a},"PUBLIC").setMultipleInstances(!0)),Sl(BI,"4.7.3",e),Sl(BI,"4.7.3","esm2017")})();var F$="firebase",V$="10.14.1";/** + */class fy{constructor(e,t){this.hasPendingWrites=e,this.fromCache=t}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}}class D$ extends tF{constructor(e,t,i,r,s,o){super(e,t,i,r,o),this._firestore=e,this._firestoreImpl=e,this.metadata=s}exists(){return super.exists()}data(e={}){if(this._document){if(this._converter){const t=new Mv(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(t,e)}return this._userDataWriter.convertValue(this._document.data.value,e.serverTimestamps)}}get(e,t={}){if(this._document){const i=this._document.data.field(nF("DocumentSnapshot.get",e));if(i!==null)return this._userDataWriter.convertValue(i,t.serverTimestamps)}}}class Mv extends D${data(e={}){return super.data(e)}}class k${constructor(e,t,i,r){this._firestore=e,this._userDataWriter=t,this._snapshot=r,this.metadata=new fy(r.hasPendingWrites,r.fromCache),this.query=i}get docs(){const e=[];return this.forEach(t=>e.push(t)),e}get size(){return this._snapshot.docs.size}get empty(){return this.size===0}forEach(e,t){this._snapshot.docs.forEach(i=>{e.call(t,new Mv(this._firestore,this._userDataWriter,i.key,i,new fy(this._snapshot.mutatedKeys.has(i.key),this._snapshot.fromCache),this.query.converter))})}docChanges(e={}){const t=!!e.includeMetadataChanges;if(t&&this._snapshot.excludesMetadataChanges)throw new Tt(qe.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===t||(this._cachedChanges=function(r,s){if(r._snapshot.oldDocs.isEmpty()){let o=0;return r._snapshot.docChanges.map(a=>{const l=new Mv(r._firestore,r._userDataWriter,a.doc.key,a.doc,new fy(r._snapshot.mutatedKeys.has(a.doc.key),r._snapshot.fromCache),r.query.converter);return a.doc,{type:"added",doc:l,oldIndex:-1,newIndex:o++}})}{let o=r._snapshot.oldDocs;return r._snapshot.docChanges.filter(a=>s||a.type!==3).map(a=>{const l=new Mv(r._firestore,r._userDataWriter,a.doc.key,a.doc,new fy(r._snapshot.mutatedKeys.has(a.doc.key),r._snapshot.fromCache),r.query.converter);let c=-1,d=-1;return a.type!==0&&(c=o.indexOf(a.doc.key),o=o.delete(a.doc.key)),a.type!==1&&(o=o.add(a.doc),d=o.indexOf(a.doc.key)),{type:O$(a.type),doc:l,oldIndex:c,newIndex:d}})}}(this,t),this._cachedChangesIncludeMetadataChanges=t),this._cachedChanges}}function O$(n){switch(n){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return Wt()}}class U$ extends N${constructor(e){super(),this.firestore=e}convertBytes(e){return new T0(e)}convertReference(e){const t=this.convertDocumentKey(e,this.firestore._databaseId);return new Pd(this.firestore,null,t)}}function LM(n){n=cT(n,nx);const e=cT(n.firestore,ZU),t=A$(e),i=new U$(e);return L$(n._query),_$(t,n._query).then(r=>new k$(e,i,n,r))}(function(e,t=!0){(function(r){Md=r})(Ad),sd(new iu("firestore",(i,{instanceIdentifier:r,options:s})=>{const o=i.getProvider("app").getImmediate(),a=new ZU(new $7(i.getProvider("auth-internal")),new J7(i.getProvider("app-check-internal")),function(c,d){if(!Object.prototype.hasOwnProperty.apply(c.options,["projectId"]))throw new Tt(qe.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new Kp(c.options.projectId,d)}(o,r),o);return s=Object.assign({useFetchStreams:t},s),a._setSettings(s),a},"PUBLIC").setMultipleInstances(!0)),Sl(BI,"4.7.3",e),Sl(BI,"4.7.3","esm2017")})();var F$="firebase",V$="10.14.1";/** * @license * Copyright 2020 Google LLC * @@ -1954,11 +1954,11 @@ This typically indicates that your device does not have a healthy Internet conne * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */Sl(F$,V$,"app");const B$={apiKey:"AIzaSyC_lxk5L-t6jwEb9g8h7ErMyQ7sjkvy6AM",authDomain:"portfolio-9f302.firebaseapp.com",projectId:"portfolio-9f302",storageBucket:"portfolio-9f302.appspot.com",messagingSenderId:"202288634568",appId:"1:202288634568:web:edf2762243915c92b923fd"},z$=ZO(B$),NM=T$(z$),H$=({experience:n})=>B.jsxs(WO.VerticalTimelineElement,{contentStyle:{background:"black",color:"black"},contentArrowStyle:{borderRight:"7px solid black"},date:n.date,iconStyle:{background:n.iconBg},icon:B.jsx("div",{className:"flex justify-center items-center w-full h-full",children:B.jsx("img",{src:n.icon,alt:n.company_name,className:"w-[75%] h-[75%] object-contain"})}),children:[B.jsxs("div",{children:[B.jsx("h3",{className:"text-[#fcd4d4] text-[24px] font-bold",children:n.title}),B.jsx("p",{className:"text-white text-[16px] font-semibold",style:{margin:0},children:n.company_name})]}),B.jsx("ul",{className:"mt-5 list-disc ml-5 space-y-2",children:n.points.map((e,t)=>B.jsx("li",{className:"text-white-100 text-[14px] pl-1 tracking-wider",children:e},`experience-point-${t}`))})]}),G$=()=>{const[n,e]=q.useState([]);return q.useEffect(()=>{(async()=>{const r=(await LM(IM(NM,"Experience"))).docs.map(s=>s.data()).sort((s,o)=>o.index-s.index);e(r)})()},[]),B.jsxs("section",{children:[B.jsxs(er.div,{variants:Lm(),children:[B.jsx("h2",{className:`${sr.sectionHeadText} text-center`,children:"Work Experience."}),B.jsx("p",{className:`${sr.sectionSubText} text-center`,children:"Where I have worked so far?"})]}),B.jsx("div",{className:"mt-20 flex flex-col",children:B.jsx(WO.VerticalTimeline,{lineColor:"#373737",children:n.map((t,i)=>B.jsx(H$,{experience:t},`experience-${i}`))})})]})},W$=Td(G$,"ExperienceSection"),j$=()=>B.jsxs("div",{id:"HeroSection",className:"relative bg-black text-white h-fit flex flex-col rounded-b-[356px]",children:[B.jsxs("div",{className:"flex-grow flex flex-col justify-center items-center text-center px-6 py-32",children:[B.jsxs("h1",{className:"text-6xl font-bold",children:["Hello, I am Satyam ",B.jsx("br",{})," Mishra"]}),B.jsx("p",{className:"mt-6 max-w-md text-gray-400",children:"I'm a computer science student with a simple and curious mind."}),B.jsx("a",{href:"https://medium.com/@Satyam_Mishra/",target:"_blank",children:B.jsxs("button",{className:"mt-8 bg-yellow-400 hover:bg-yellow-500 text-black font-bold py-3 px-8 rounded-full flex items-center",children:["Read my blogs ",B.jsx("span",{className:"ml-2",children:"▶"})]})})]}),B.jsx("div",{className:" absolute z-10 xs:bottom-8 bottom-8 w-full flex justify-center items-center",children:B.jsx("a",{href:"#AboutSection",children:B.jsx("div",{className:"w-[35px] h-[64px] rounded-3xl border-4 border-primary flex justify-center items-start p-2",children:B.jsx(er.div,{animate:{y:[0,24,0]},transition:{duration:1.5,repeat:1/0,repeatType:"loop"},className:"w-3 h-3 rounded-full bg-primary mb-2"})})})})]});/** + */Sl(F$,V$,"app");const B$={apiKey:"AIzaSyC_lxk5L-t6jwEb9g8h7ErMyQ7sjkvy6AM",authDomain:"portfolio-9f302.firebaseapp.com",projectId:"portfolio-9f302",storageBucket:"portfolio-9f302.appspot.com",messagingSenderId:"202288634568",appId:"1:202288634568:web:edf2762243915c92b923fd"},z$=eU(B$),NM=T$(z$),H$=({experience:n})=>B.jsxs(jO.VerticalTimelineElement,{contentStyle:{background:"black",color:"black"},contentArrowStyle:{borderRight:"7px solid black"},date:n.date,iconStyle:{background:n.iconBg},icon:B.jsx("div",{className:"flex justify-center items-center w-full h-full",children:B.jsx("img",{src:n.icon,alt:n.company_name,className:"w-[75%] h-[75%] object-contain"})}),children:[B.jsxs("div",{children:[B.jsx("h3",{className:"text-[#fcd4d4] text-[24px] font-bold",children:n.title}),B.jsx("p",{className:"text-white text-[16px] font-semibold",style:{margin:0},children:n.company_name})]}),B.jsx("ul",{className:"mt-5 list-disc ml-5 space-y-2",children:n.points.map((e,t)=>B.jsx("li",{className:"text-white-100 text-[14px] pl-1 tracking-wider",children:e},`experience-point-${t}`))})]}),G$=()=>{const[n,e]=q.useState([]);return q.useEffect(()=>{(async()=>{const r=(await LM(IM(NM,"Experience"))).docs.map(s=>s.data()).sort((s,o)=>o.index-s.index);e(r)})()},[]),B.jsxs("section",{children:[B.jsxs(er.div,{variants:Lm(),children:[B.jsx("h2",{className:`${sr.sectionHeadText} text-center`,children:"Work Experience."}),B.jsx("p",{className:`${sr.sectionSubText} text-center`,children:"Where I have worked so far?"})]}),B.jsx("div",{className:"mt-20 flex flex-col",children:B.jsx(jO.VerticalTimeline,{lineColor:"#373737",children:n.map((t,i)=>B.jsx(H$,{experience:t},`experience-${i}`))})})]})},W$=Td(G$,"ExperienceSection"),j$=()=>B.jsxs("div",{id:"HeroSection",className:"relative bg-black text-white h-fit flex flex-col rounded-b-[356px]",children:[B.jsxs("div",{className:"flex-grow flex flex-col justify-center items-center text-center px-6 py-32",children:[B.jsxs("h1",{className:"text-6xl font-bold",children:["Hello, I am Satyam ",B.jsx("br",{})," Mishra"]}),B.jsx("p",{className:"mt-6 max-w-md text-gray-400",children:"I'm a computer science student with a simple and curious mind."}),B.jsx("a",{href:"https://medium.com/@Satyam_Mishra/",target:"_blank",children:B.jsxs("button",{className:"mt-8 bg-yellow-400 hover:bg-yellow-500 text-black font-bold py-3 px-8 rounded-full flex items-center",children:["Read my blogs ",B.jsx("span",{className:"ml-2",children:"▶"})]})})]}),B.jsx("div",{className:" absolute z-10 xs:bottom-8 bottom-8 w-full flex justify-center items-center",children:B.jsx("a",{href:"#AboutSection",children:B.jsx("div",{className:"w-[35px] h-[64px] rounded-3xl border-4 border-primary flex justify-center items-start p-2",children:B.jsx(er.div,{animate:{y:[0,24,0]},transition:{duration:1.5,repeat:1/0,repeatType:"loop"},className:"w-3 h-3 rounded-full bg-primary mb-2"})})})})]});/** * @license * Copyright 2010-2024 Three.js Authors * SPDX-License-Identifier: MIT - */const ix="169",Cc={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},bc={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},nF=0,uT=1,iF=2,X$=3,rF=0,rx=1,pp=2,Os=3,da=0,yr=1,Bs=2,ra=0,qc=1,hT=2,dT=3,fT=4,sF=5,Ja=100,oF=101,aF=102,lF=103,cF=104,uF=200,hF=201,dF=202,fF=203,A0=204,M0=205,pF=206,mF=207,gF=208,yF=209,vF=210,_F=211,xF=212,SF=213,wF=214,C0=0,b0=1,P0=2,au=3,R0=4,I0=5,L0=6,N0=7,Vm=0,EF=1,TF=2,vo=0,AF=1,MF=2,CF=3,DM=4,bF=5,PF=6,RF=7,pT="attached",IF="detached",sx=300,fa=301,Rl=302,Jp=303,Zp=304,Rd=306,em=1e3,Es=1001,tm=1002,Ai=1003,kM=1004,q$=1004,Ph=1005,$$=1005,fi=1006,mp=1007,Y$=1007,ho=1008,K$=1008,js=1009,OM=1010,UM=1011,dd=1012,ox=1013,pa=1014,kr=1015,Id=1016,ax=1017,lx=1018,lu=1020,FM=35902,VM=1021,BM=1022,tr=1023,zM=1024,HM=1025,$c=1026,cu=1027,cx=1028,Bm=1029,GM=1030,ux=1031,Q$=1032,hx=1033,gp=33776,yp=33777,vp=33778,_p=33779,D0=35840,k0=35841,O0=35842,U0=35843,F0=36196,V0=37492,B0=37496,z0=37808,H0=37809,G0=37810,W0=37811,j0=37812,X0=37813,q0=37814,$0=37815,Y0=37816,K0=37817,Q0=37818,J0=37819,Z0=37820,e_=37821,xp=36492,t_=36494,n_=36495,WM=36283,i_=36284,r_=36285,s_=36286,LF=2200,NF=2201,DF=2202,nm=2300,o_=2301,Cv=2302,Uc=2400,Fc=2401,im=2402,dx=2500,jM=2501,J$=0,Z$=1,eY=2,kF=3200,OF=3201,tY=3202,nY=3203,Fl=0,UF=1,jo="",_s="srgb",xa="srgb-linear",fx="display-p3",zm="display-p3-linear",rm="linear",En="srgb",sm="rec709",om="p3",iY=0,Pc=7680,rY=7681,sY=7682,oY=7683,aY=34055,lY=34056,cY=5386,uY=512,hY=513,dY=514,fY=515,pY=516,mY=517,gY=518,mT=519,FF=512,VF=513,BF=514,XM=515,zF=516,HF=517,GF=518,WF=519,am=35044,yY=35048,vY=35040,_Y=35045,xY=35049,SY=35041,wY=35046,EY=35050,TY=35042,AY="100",gT="300 es",fo=2e3,lm=2001;class Ys{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const i=this._listeners;return i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const r=this._listeners[e];if(r!==void 0){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const i=this._listeners[e.type];if(i!==void 0){e.target=this;const r=i.slice(0);for(let s=0,o=r.length;s>8&255]+qi[n>>16&255]+qi[n>>24&255]+"-"+qi[e&255]+qi[e>>8&255]+"-"+qi[e>>16&15|64]+qi[e>>24&255]+"-"+qi[t&63|128]+qi[t>>8&255]+"-"+qi[t>>16&255]+qi[t>>24&255]+qi[i&255]+qi[i>>8&255]+qi[i>>16&255]+qi[i>>24&255]).toLowerCase()}function $n(n,e,t){return Math.max(e,Math.min(t,n))}function qM(n,e){return(n%e+e)%e}function MY(n,e,t,i,r){return i+(n-e)*(r-i)/(t-e)}function CY(n,e,t){return n!==e?(t-n)/(e-n):0}function Sp(n,e,t){return(1-t)*n+t*e}function bY(n,e,t,i){return Sp(n,e,1-Math.exp(-t*i))}function PY(n,e=1){return e-Math.abs(qM(n,e*2)-e)}function RY(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function IY(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function LY(n,e){return n+Math.floor(Math.random()*(e-n+1))}function NY(n,e){return n+Math.random()*(e-n)}function DY(n){return n*(.5-Math.random())}function kY(n){n!==void 0&&(E2=n);let e=E2+=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 OY(n){return n*Yc}function UY(n){return n*fd}function FY(n){return(n&n-1)===0&&n!==0}function VY(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function BY(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function zY(n,e,t,i,r){const s=Math.cos,o=Math.sin,a=s(t/2),l=o(t/2),c=s((e+i)/2),d=o((e+i)/2),f=s((e-i)/2),p=o((e-i)/2),m=s((i-e)/2),_=o((i-e)/2);switch(r){case"XYX":n.set(a*d,l*f,l*p,a*c);break;case"YZY":n.set(l*p,a*d,l*f,a*c);break;case"ZXZ":n.set(l*f,l*p,a*d,a*c);break;case"XZX":n.set(a*d,l*_,l*m,a*c);break;case"YXY":n.set(l*m,a*d,l*_,a*c);break;case"ZYZ":n.set(l*_,l*m,a*d,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function mr(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function Ft(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const jF={DEG2RAD:Yc,RAD2DEG:fd,generateUUID:Zr,clamp:$n,euclideanModulo:qM,mapLinear:MY,inverseLerp:CY,lerp:Sp,damp:bY,pingpong:PY,smoothstep:RY,smootherstep:IY,randInt:LY,randFloat:NY,randFloatSpread:DY,seededRandom:kY,degToRad:OY,radToDeg:UY,isPowerOfTwo:FY,ceilPowerOfTwo:VY,floorPowerOfTwo:BY,setQuaternionFromProperEuler:zY,normalize:Ft,denormalize:mr};class Ee{constructor(e=0,t=0){Ee.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,i=this.y,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6],this.y=r[1]*t+r[4]*i+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos($n(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const i=Math.cos(t),r=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*i-o*r+e.x,this.y=s*r+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Ut{constructor(e,t,i,r,s,o,a,l,c){Ut.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,o,a,l,c)}set(e,t,i,r,s,o,a,l,c){const d=this.elements;return d[0]=e,d[1]=r,d[2]=a,d[3]=t,d[4]=s,d[5]=l,d[6]=i,d[7]=o,d[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,o=i[0],a=i[3],l=i[6],c=i[1],d=i[4],f=i[7],p=i[2],m=i[5],_=i[8],S=r[0],x=r[3],y=r[6],E=r[1],w=r[4],M=r[7],O=r[2],k=r[5],I=r[8];return s[0]=o*S+a*E+l*O,s[3]=o*x+a*w+l*k,s[6]=o*y+a*M+l*I,s[1]=c*S+d*E+f*O,s[4]=c*x+d*w+f*k,s[7]=c*y+d*M+f*I,s[2]=p*S+m*E+_*O,s[5]=p*x+m*w+_*k,s[8]=p*y+m*M+_*I,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],d=e[8];return t*o*d-t*a*c-i*s*d+i*a*l+r*s*c-r*o*l}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],d=e[8],f=d*o-a*c,p=a*l-d*s,m=c*s-o*l,_=t*f+i*p+r*m;if(_===0)return this.set(0,0,0,0,0,0,0,0,0);const S=1/_;return e[0]=f*S,e[1]=(r*c-d*i)*S,e[2]=(a*i-r*o)*S,e[3]=p*S,e[4]=(d*t-r*l)*S,e[5]=(r*s-a*t)*S,e[6]=m*S,e[7]=(i*l-c*t)*S,e[8]=(o*t-i*s)*S,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,r,s,o,a){const l=Math.cos(s),c=Math.sin(s);return this.set(i*l,i*c,-i*(l*o+c*a)+o+e,-r*c,r*l,-r*(-c*o+l*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(Rw.makeScale(e,t)),this}rotate(e){return this.premultiply(Rw.makeRotation(-e)),this}translate(e,t){return this.premultiply(Rw.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<9;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const Rw=new Ut;function XF(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}const HY={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function Rh(n,e){return new HY[n](e)}function cm(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function qF(){const n=cm("canvas");return n.style.display="block",n}const T2={};function bv(n){n in T2||(T2[n]=!0,console.warn(n))}function GY(n,e,t){return new Promise(function(i,r){function s(){switch(n.clientWaitSync(e,n.SYNC_FLUSH_COMMANDS_BIT,0)){case n.WAIT_FAILED:r();break;case n.TIMEOUT_EXPIRED:setTimeout(s,t);break;default:i()}}setTimeout(s,t)})}function WY(n){const e=n.elements;e[2]=.5*e[2]+.5*e[3],e[6]=.5*e[6]+.5*e[7],e[10]=.5*e[10]+.5*e[11],e[14]=.5*e[14]+.5*e[15]}function jY(n){const e=n.elements;e[11]===-1?(e[10]=-e[10]-1,e[14]=-e[14]):(e[10]=-e[10],e[14]=-e[14]+1)}const A2=new Ut().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),M2=new Ut().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),Ef={[xa]:{transfer:rm,primaries:sm,luminanceCoefficients:[.2126,.7152,.0722],toReference:n=>n,fromReference:n=>n},[_s]:{transfer:En,primaries:sm,luminanceCoefficients:[.2126,.7152,.0722],toReference:n=>n.convertSRGBToLinear(),fromReference:n=>n.convertLinearToSRGB()},[zm]:{transfer:rm,primaries:om,luminanceCoefficients:[.2289,.6917,.0793],toReference:n=>n.applyMatrix3(M2),fromReference:n=>n.applyMatrix3(A2)},[fx]:{transfer:En,primaries:om,luminanceCoefficients:[.2289,.6917,.0793],toReference:n=>n.convertSRGBToLinear().applyMatrix3(M2),fromReference:n=>n.applyMatrix3(A2).convertLinearToSRGB()}},XY=new Set([xa,zm]),cn={enabled:!0,_workingColorSpace:xa,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(n){if(!XY.has(n))throw new Error(`Unsupported working color space, "${n}".`);this._workingColorSpace=n},convert:function(n,e,t){if(this.enabled===!1||e===t||!e||!t)return n;const i=Ef[e].toReference,r=Ef[t].fromReference;return r(i(n))},fromWorkingColorSpace:function(n,e){return this.convert(n,this._workingColorSpace,e)},toWorkingColorSpace:function(n,e){return this.convert(n,e,this._workingColorSpace)},getPrimaries:function(n){return Ef[n].primaries},getTransfer:function(n){return n===jo?rm:Ef[n].transfer},getLuminanceCoefficients:function(n,e=this._workingColorSpace){return n.fromArray(Ef[e].luminanceCoefficients)}};function Xh(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function Iw(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let Gu;class $F{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{Gu===void 0&&(Gu=cm("canvas")),Gu.width=e.width,Gu.height=e.height;const i=Gu.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=Gu}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=cm("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const r=i.getImageData(0,0,e.width,e.height),s=r.data;for(let o=0;o0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==sx)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case em:e.x=e.x-Math.floor(e.x);break;case Es:e.x=e.x<0?0:1;break;case tm: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 em:e.y=e.y-Math.floor(e.y);break;case Es:e.y=e.y<0?0:1;break;case tm: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++}}In.DEFAULT_IMAGE=null;In.DEFAULT_MAPPING=sx;In.DEFAULT_ANISOTROPY=1;class sn{constructor(e=0,t=0,i=0,r=1){sn.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*r+o[12]*s,this.y=o[1]*t+o[5]*i+o[9]*r+o[13]*s,this.z=o[2]*t+o[6]*i+o[10]*r+o[14]*s,this.w=o[3]*t+o[7]*i+o[11]*r+o[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,r,s;const l=e.elements,c=l[0],d=l[4],f=l[8],p=l[1],m=l[5],_=l[9],S=l[2],x=l[6],y=l[10];if(Math.abs(d-p)<.01&&Math.abs(f-S)<.01&&Math.abs(_-x)<.01){if(Math.abs(d+p)<.1&&Math.abs(f+S)<.1&&Math.abs(_+x)<.1&&Math.abs(c+m+y-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const w=(c+1)/2,M=(m+1)/2,O=(y+1)/2,k=(d+p)/4,I=(f+S)/4,P=(_+x)/4;return w>M&&w>O?w<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(w),r=k/i,s=I/i):M>O?M<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(M),i=k/r,s=P/r):O<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(O),i=I/s,r=P/s),this.set(i,r,s,t),this}let E=Math.sqrt((x-_)*(x-_)+(f-S)*(f-S)+(p-d)*(p-d));return Math.abs(E)<.001&&(E=1),this.x=(x-_)/E,this.y=(f-S)/E,this.z=(p-d)/E,this.w=Math.acos((c+m+y-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class YF extends Ys{constructor(e=1,t=1,i={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new sn(0,0,e,t),this.scissorTest=!1,this.viewport=new sn(0,0,e,t);const r={width:e,height:t,depth:1};i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:fi,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},i);const s=new In(r,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace);s.flipY=!1,s.generateMipmaps=i.generateMipmaps,s.internalFormat=i.internalFormat,this.textures=[];const o=i.count;for(let a=0;a=0?1:-1,w=1-y*y;if(w>Number.EPSILON){const O=Math.sqrt(w),k=Math.atan2(O,y*E);x=Math.sin(x*k)/O,a=Math.sin(a*k)/O}const M=a*E;if(l=l*x+p*M,c=c*x+m*M,d=d*x+_*M,f=f*x+S*M,x===1-a){const O=1/Math.sqrt(l*l+c*c+d*d+f*f);l*=O,c*=O,d*=O,f*=O}}e[t]=l,e[t+1]=c,e[t+2]=d,e[t+3]=f}static multiplyQuaternionsFlat(e,t,i,r,s,o){const a=i[r],l=i[r+1],c=i[r+2],d=i[r+3],f=s[o],p=s[o+1],m=s[o+2],_=s[o+3];return e[t]=a*_+d*f+l*m-c*p,e[t+1]=l*_+d*p+c*f-a*m,e[t+2]=c*_+d*m+a*p-l*f,e[t+3]=d*_-a*f-l*p-c*m,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,r){return this._x=e,this._y=t,this._z=i,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const i=e._x,r=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(i/2),d=a(r/2),f=a(s/2),p=l(i/2),m=l(r/2),_=l(s/2);switch(o){case"XYZ":this._x=p*d*f+c*m*_,this._y=c*m*f-p*d*_,this._z=c*d*_+p*m*f,this._w=c*d*f-p*m*_;break;case"YXZ":this._x=p*d*f+c*m*_,this._y=c*m*f-p*d*_,this._z=c*d*_-p*m*f,this._w=c*d*f+p*m*_;break;case"ZXY":this._x=p*d*f-c*m*_,this._y=c*m*f+p*d*_,this._z=c*d*_+p*m*f,this._w=c*d*f-p*m*_;break;case"ZYX":this._x=p*d*f-c*m*_,this._y=c*m*f+p*d*_,this._z=c*d*_-p*m*f,this._w=c*d*f+p*m*_;break;case"YZX":this._x=p*d*f+c*m*_,this._y=c*m*f+p*d*_,this._z=c*d*_-p*m*f,this._w=c*d*f-p*m*_;break;case"XZY":this._x=p*d*f-c*m*_,this._y=c*m*f-p*d*_,this._z=c*d*_+p*m*f,this._w=c*d*f+p*m*_;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],r=t[4],s=t[8],o=t[1],a=t[5],l=t[9],c=t[2],d=t[6],f=t[10],p=i+a+f;if(p>0){const m=.5/Math.sqrt(p+1);this._w=.25/m,this._x=(d-l)*m,this._y=(s-c)*m,this._z=(o-r)*m}else if(i>a&&i>f){const m=2*Math.sqrt(1+i-a-f);this._w=(d-l)/m,this._x=.25*m,this._y=(r+o)/m,this._z=(s+c)/m}else if(a>f){const m=2*Math.sqrt(1+a-i-f);this._w=(s-c)/m,this._x=(r+o)/m,this._y=.25*m,this._z=(l+d)/m}else{const m=2*Math.sqrt(1+f-i-a);this._w=(o-r)/m,this._x=(s+c)/m,this._y=(l+d)/m,this._z=.25*m}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return iMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs($n(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(i===0)return this;const r=Math.min(1,t/i);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const i=e._x,r=e._y,s=e._z,o=e._w,a=t._x,l=t._y,c=t._z,d=t._w;return this._x=i*d+o*a+r*c-s*l,this._y=r*d+o*l+s*a-i*c,this._z=s*d+o*c+i*l-r*a,this._w=o*d-i*a-r*l-s*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const i=this._x,r=this._y,s=this._z,o=this._w;let a=o*e._w+i*e._x+r*e._y+s*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=i,this._y=r,this._z=s,this;const l=1-a*a;if(l<=Number.EPSILON){const m=1-t;return this._w=m*o+t*this._w,this._x=m*i+t*this._x,this._y=m*r+t*this._y,this._z=m*s+t*this._z,this.normalize(),this}const c=Math.sqrt(l),d=Math.atan2(c,a),f=Math.sin((1-t)*d)/c,p=Math.sin(t*d)/c;return this._w=o*f+this._w*p,this._x=i*f+this._x*p,this._y=r*f+this._y*p,this._z=s*f+this._z*p,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),r=Math.sqrt(1-i),s=Math.sqrt(i);return this.set(r*Math.sin(e),r*Math.cos(e),s*Math.sin(t),s*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class G{constructor(e=0,t=0,i=0){G.prototype.isVector3=!0,this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(C2.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(C2.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[3]*i+s[6]*r,this.y=s[1]*t+s[4]*i+s[7]*r,this.z=s[2]*t+s[5]*i+s[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=e.elements,o=1/(s[3]*t+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*t+s[4]*i+s[8]*r+s[12])*o,this.y=(s[1]*t+s[5]*i+s[9]*r+s[13])*o,this.z=(s[2]*t+s[6]*i+s[10]*r+s[14])*o,this}applyQuaternion(e){const t=this.x,i=this.y,r=this.z,s=e.x,o=e.y,a=e.z,l=e.w,c=2*(o*r-a*i),d=2*(a*t-s*r),f=2*(s*i-o*t);return this.x=t+l*c+o*f-a*d,this.y=i+l*d+a*c-s*f,this.z=r+l*f+s*d-o*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[4]*i+s[8]*r,this.y=s[1]*t+s[5]*i+s[9]*r,this.z=s[2]*t+s[6]*i+s[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,r=e.y,s=e.z,o=t.x,a=t.y,l=t.z;return this.x=r*l-s*a,this.y=s*o-i*l,this.z=i*a-r*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return Nw.copy(this).projectOnVector(e),this.sub(Nw)}reflect(e){return this.sub(Nw.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos($n(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return t*t+i*i+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){const r=Math.sin(t)*e;return this.x=r*Math.sin(i),this.y=Math.cos(t)*e,this.z=r*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,i=Math.sqrt(1-t*t);return this.x=i*Math.cos(e),this.y=t,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Nw=new G,C2=new nr;class vr{constructor(e=new G(1/0,1/0,1/0),t=new G(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,i=e.length;t=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,Ls),Ls.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Tf),my.subVectors(this.max,Tf),Wu.subVectors(e.a,Tf),ju.subVectors(e.b,Tf),Xu.subVectors(e.c,Tf),Ua.subVectors(ju,Wu),Fa.subVectors(Xu,ju),cc.subVectors(Wu,Xu);let t=[0,-Ua.z,Ua.y,0,-Fa.z,Fa.y,0,-cc.z,cc.y,Ua.z,0,-Ua.x,Fa.z,0,-Fa.x,cc.z,0,-cc.x,-Ua.y,Ua.x,0,-Fa.y,Fa.x,0,-cc.y,cc.x,0];return!Dw(t,Wu,ju,Xu,my)||(t=[1,0,0,0,1,0,0,0,1],!Dw(t,Wu,ju,Xu,my))?!1:(gy.crossVectors(Ua,Fa),t=[gy.x,gy.y,gy.z],Dw(t,Wu,ju,Xu,my))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Ls).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Ls).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:(Oo[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Oo[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Oo[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Oo[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Oo[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Oo[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Oo[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Oo[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Oo),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const Oo=[new G,new G,new G,new G,new G,new G,new G,new G],Ls=new G,py=new vr,Wu=new G,ju=new G,Xu=new G,Ua=new G,Fa=new G,cc=new G,Tf=new G,my=new G,gy=new G,uc=new G;function Dw(n,e,t,i,r){for(let s=0,o=n.length-3;s<=o;s+=3){uc.fromArray(n,s);const a=r.x*Math.abs(uc.x)+r.y*Math.abs(uc.y)+r.z*Math.abs(uc.z),l=e.dot(uc),c=t.dot(uc),d=i.dot(uc);if(Math.max(-Math.max(l,c,d),Math.min(l,c,d))>a)return!1}return!0}const QY=new vr,Af=new G,kw=new G;class ir{constructor(e=new G,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const i=this.center;t!==void 0?i.copy(t):QY.setFromPoints(e).getCenter(i);let r=0;for(let s=0,o=e.length;sthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Af.subVectors(e,this.center);const t=Af.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),r=(i-this.radius)*.5;this.center.addScaledVector(Af,r/i),this.radius+=r}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(kw.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Af.copy(e.center).add(kw)),this.expandByPoint(Af.copy(e.center).sub(kw))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Uo=new G,Ow=new G,yy=new G,Va=new G,Uw=new G,vy=new G,Fw=new G;class yu{constructor(e=new G,t=new G(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Uo)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Uo.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Uo.copy(this.origin).addScaledVector(this.direction,t),Uo.distanceToSquared(e))}distanceSqToSegment(e,t,i,r){Ow.copy(e).add(t).multiplyScalar(.5),yy.copy(t).sub(e).normalize(),Va.copy(this.origin).sub(Ow);const s=e.distanceTo(t)*.5,o=-this.direction.dot(yy),a=Va.dot(this.direction),l=-Va.dot(yy),c=Va.lengthSq(),d=Math.abs(1-o*o);let f,p,m,_;if(d>0)if(f=o*l-a,p=o*a-l,_=s*d,f>=0)if(p>=-_)if(p<=_){const S=1/d;f*=S,p*=S,m=f*(f+o*p+2*a)+p*(o*f+p+2*l)+c}else p=s,f=Math.max(0,-(o*p+a)),m=-f*f+p*(p+2*l)+c;else p=-s,f=Math.max(0,-(o*p+a)),m=-f*f+p*(p+2*l)+c;else p<=-_?(f=Math.max(0,-(-o*s+a)),p=f>0?-s:Math.min(Math.max(-s,-l),s),m=-f*f+p*(p+2*l)+c):p<=_?(f=0,p=Math.min(Math.max(-s,-l),s),m=p*(p+2*l)+c):(f=Math.max(0,-(o*s+a)),p=f>0?s:Math.min(Math.max(-s,-l),s),m=-f*f+p*(p+2*l)+c);else p=o>0?-s:s,f=Math.max(0,-(o*p+a)),m=-f*f+p*(p+2*l)+c;return i&&i.copy(this.origin).addScaledVector(this.direction,f),r&&r.copy(Ow).addScaledVector(yy,p),m}intersectSphere(e,t){Uo.subVectors(e.center,this.origin);const i=Uo.dot(this.direction),r=Uo.dot(Uo)-i*i,s=e.radius*e.radius;if(r>s)return null;const o=Math.sqrt(s-r),a=i-o,l=i+o;return l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){const i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,r,s,o,a,l;const c=1/this.direction.x,d=1/this.direction.y,f=1/this.direction.z,p=this.origin;return c>=0?(i=(e.min.x-p.x)*c,r=(e.max.x-p.x)*c):(i=(e.max.x-p.x)*c,r=(e.min.x-p.x)*c),d>=0?(s=(e.min.y-p.y)*d,o=(e.max.y-p.y)*d):(s=(e.max.y-p.y)*d,o=(e.min.y-p.y)*d),i>o||s>r||((s>i||isNaN(i))&&(i=s),(o=0?(a=(e.min.z-p.z)*f,l=(e.max.z-p.z)*f):(a=(e.max.z-p.z)*f,l=(e.min.z-p.z)*f),i>l||a>r)||((a>i||i!==i)&&(i=a),(l=0?i:r,t)}intersectsBox(e){return this.intersectBox(e,Uo)!==null}intersectTriangle(e,t,i,r,s){Uw.subVectors(t,e),vy.subVectors(i,e),Fw.crossVectors(Uw,vy);let o=this.direction.dot(Fw),a;if(o>0){if(r)return null;a=1}else if(o<0)a=-1,o=-o;else return null;Va.subVectors(this.origin,e);const l=a*this.direction.dot(vy.crossVectors(Va,vy));if(l<0)return null;const c=a*this.direction.dot(Uw.cross(Va));if(c<0||l+c>o)return null;const d=-a*Va.dot(Fw);return d<0?null:this.at(d/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class St{constructor(e,t,i,r,s,o,a,l,c,d,f,p,m,_,S,x){St.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,o,a,l,c,d,f,p,m,_,S,x)}set(e,t,i,r,s,o,a,l,c,d,f,p,m,_,S,x){const y=this.elements;return y[0]=e,y[4]=t,y[8]=i,y[12]=r,y[1]=s,y[5]=o,y[9]=a,y[13]=l,y[2]=c,y[6]=d,y[10]=f,y[14]=p,y[3]=m,y[7]=_,y[11]=S,y[15]=x,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new St().fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,i=e.elements,r=1/qu.setFromMatrixColumn(e,0).length(),s=1/qu.setFromMatrixColumn(e,1).length(),o=1/qu.setFromMatrixColumn(e,2).length();return t[0]=i[0]*r,t[1]=i[1]*r,t[2]=i[2]*r,t[3]=0,t[4]=i[4]*s,t[5]=i[5]*s,t[6]=i[6]*s,t[7]=0,t[8]=i[8]*o,t[9]=i[9]*o,t[10]=i[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,i=e.x,r=e.y,s=e.z,o=Math.cos(i),a=Math.sin(i),l=Math.cos(r),c=Math.sin(r),d=Math.cos(s),f=Math.sin(s);if(e.order==="XYZ"){const p=o*d,m=o*f,_=a*d,S=a*f;t[0]=l*d,t[4]=-l*f,t[8]=c,t[1]=m+_*c,t[5]=p-S*c,t[9]=-a*l,t[2]=S-p*c,t[6]=_+m*c,t[10]=o*l}else if(e.order==="YXZ"){const p=l*d,m=l*f,_=c*d,S=c*f;t[0]=p+S*a,t[4]=_*a-m,t[8]=o*c,t[1]=o*f,t[5]=o*d,t[9]=-a,t[2]=m*a-_,t[6]=S+p*a,t[10]=o*l}else if(e.order==="ZXY"){const p=l*d,m=l*f,_=c*d,S=c*f;t[0]=p-S*a,t[4]=-o*f,t[8]=_+m*a,t[1]=m+_*a,t[5]=o*d,t[9]=S-p*a,t[2]=-o*c,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){const p=o*d,m=o*f,_=a*d,S=a*f;t[0]=l*d,t[4]=_*c-m,t[8]=p*c+S,t[1]=l*f,t[5]=S*c+p,t[9]=m*c-_,t[2]=-c,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){const p=o*l,m=o*c,_=a*l,S=a*c;t[0]=l*d,t[4]=S-p*f,t[8]=_*f+m,t[1]=f,t[5]=o*d,t[9]=-a*d,t[2]=-c*d,t[6]=m*f+_,t[10]=p-S*f}else if(e.order==="XZY"){const p=o*l,m=o*c,_=a*l,S=a*c;t[0]=l*d,t[4]=-f,t[8]=c*d,t[1]=p*f+S,t[5]=o*d,t[9]=m*f-_,t[2]=_*f-m,t[6]=a*d,t[10]=S*f+p}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(JY,e,ZY)}lookAt(e,t,i){const r=this.elements;return qr.subVectors(e,t),qr.lengthSq()===0&&(qr.z=1),qr.normalize(),Ba.crossVectors(i,qr),Ba.lengthSq()===0&&(Math.abs(i.z)===1?qr.x+=1e-4:qr.z+=1e-4,qr.normalize(),Ba.crossVectors(i,qr)),Ba.normalize(),_y.crossVectors(qr,Ba),r[0]=Ba.x,r[4]=_y.x,r[8]=qr.x,r[1]=Ba.y,r[5]=_y.y,r[9]=qr.y,r[2]=Ba.z,r[6]=_y.z,r[10]=qr.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,o=i[0],a=i[4],l=i[8],c=i[12],d=i[1],f=i[5],p=i[9],m=i[13],_=i[2],S=i[6],x=i[10],y=i[14],E=i[3],w=i[7],M=i[11],O=i[15],k=r[0],I=r[4],P=r[8],D=r[12],A=r[1],R=r[5],V=r[9],U=r[13],se=r[2],le=r[6],ee=r[10],pe=r[14],W=r[3],J=r[7],Z=r[11],oe=r[15];return s[0]=o*k+a*A+l*se+c*W,s[4]=o*I+a*R+l*le+c*J,s[8]=o*P+a*V+l*ee+c*Z,s[12]=o*D+a*U+l*pe+c*oe,s[1]=d*k+f*A+p*se+m*W,s[5]=d*I+f*R+p*le+m*J,s[9]=d*P+f*V+p*ee+m*Z,s[13]=d*D+f*U+p*pe+m*oe,s[2]=_*k+S*A+x*se+y*W,s[6]=_*I+S*R+x*le+y*J,s[10]=_*P+S*V+x*ee+y*Z,s[14]=_*D+S*U+x*pe+y*oe,s[3]=E*k+w*A+M*se+O*W,s[7]=E*I+w*R+M*le+O*J,s[11]=E*P+w*V+M*ee+O*Z,s[15]=E*D+w*U+M*pe+O*oe,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[4],r=e[8],s=e[12],o=e[1],a=e[5],l=e[9],c=e[13],d=e[2],f=e[6],p=e[10],m=e[14],_=e[3],S=e[7],x=e[11],y=e[15];return _*(+s*l*f-r*c*f-s*a*p+i*c*p+r*a*m-i*l*m)+S*(+t*l*m-t*c*p+s*o*p-r*o*m+r*c*d-s*l*d)+x*(+t*c*f-t*a*m-s*o*f+i*o*m+s*a*d-i*c*d)+y*(-r*a*d-t*l*f+t*a*p+r*o*f-i*o*p+i*l*d)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],d=e[8],f=e[9],p=e[10],m=e[11],_=e[12],S=e[13],x=e[14],y=e[15],E=f*x*c-S*p*c+S*l*m-a*x*m-f*l*y+a*p*y,w=_*p*c-d*x*c-_*l*m+o*x*m+d*l*y-o*p*y,M=d*S*c-_*f*c+_*a*m-o*S*m-d*a*y+o*f*y,O=_*f*l-d*S*l-_*a*p+o*S*p+d*a*x-o*f*x,k=t*E+i*w+r*M+s*O;if(k===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const I=1/k;return e[0]=E*I,e[1]=(S*p*s-f*x*s-S*r*m+i*x*m+f*r*y-i*p*y)*I,e[2]=(a*x*s-S*l*s+S*r*c-i*x*c-a*r*y+i*l*y)*I,e[3]=(f*l*s-a*p*s-f*r*c+i*p*c+a*r*m-i*l*m)*I,e[4]=w*I,e[5]=(d*x*s-_*p*s+_*r*m-t*x*m-d*r*y+t*p*y)*I,e[6]=(_*l*s-o*x*s-_*r*c+t*x*c+o*r*y-t*l*y)*I,e[7]=(o*p*s-d*l*s+d*r*c-t*p*c-o*r*m+t*l*m)*I,e[8]=M*I,e[9]=(_*f*s-d*S*s-_*i*m+t*S*m+d*i*y-t*f*y)*I,e[10]=(o*S*s-_*a*s+_*i*c-t*S*c-o*i*y+t*a*y)*I,e[11]=(d*a*s-o*f*s-d*i*c+t*f*c+o*i*m-t*a*m)*I,e[12]=O*I,e[13]=(d*S*r-_*f*r+_*i*p-t*S*p-d*i*x+t*f*x)*I,e[14]=(_*a*r-o*S*r-_*i*l+t*S*l+o*i*x-t*a*x)*I,e[15]=(o*f*r-d*a*r+d*i*l-t*f*l-o*i*p+t*a*p)*I,this}scale(e){const t=this.elements,i=e.x,r=e.y,s=e.z;return t[0]*=i,t[4]*=r,t[8]*=s,t[1]*=i,t[5]*=r,t[9]*=s,t[2]*=i,t[6]*=r,t[10]*=s,t[3]*=i,t[7]*=r,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,r))}makeTranslation(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),r=Math.sin(t),s=1-i,o=e.x,a=e.y,l=e.z,c=s*o,d=s*a;return this.set(c*o+i,c*a-r*l,c*l+r*a,0,c*a+r*l,d*a+i,d*l-r*o,0,c*l-r*a,d*l+r*o,s*l*l+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,r,s,o){return this.set(1,i,s,0,e,1,o,0,t,r,1,0,0,0,0,1),this}compose(e,t,i){const r=this.elements,s=t._x,o=t._y,a=t._z,l=t._w,c=s+s,d=o+o,f=a+a,p=s*c,m=s*d,_=s*f,S=o*d,x=o*f,y=a*f,E=l*c,w=l*d,M=l*f,O=i.x,k=i.y,I=i.z;return r[0]=(1-(S+y))*O,r[1]=(m+M)*O,r[2]=(_-w)*O,r[3]=0,r[4]=(m-M)*k,r[5]=(1-(p+y))*k,r[6]=(x+E)*k,r[7]=0,r[8]=(_+w)*I,r[9]=(x-E)*I,r[10]=(1-(p+S))*I,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,i){const r=this.elements;let s=qu.set(r[0],r[1],r[2]).length();const o=qu.set(r[4],r[5],r[6]).length(),a=qu.set(r[8],r[9],r[10]).length();this.determinant()<0&&(s=-s),e.x=r[12],e.y=r[13],e.z=r[14],Ns.copy(this);const c=1/s,d=1/o,f=1/a;return Ns.elements[0]*=c,Ns.elements[1]*=c,Ns.elements[2]*=c,Ns.elements[4]*=d,Ns.elements[5]*=d,Ns.elements[6]*=d,Ns.elements[8]*=f,Ns.elements[9]*=f,Ns.elements[10]*=f,t.setFromRotationMatrix(Ns),i.x=s,i.y=o,i.z=a,this}makePerspective(e,t,i,r,s,o,a=fo){const l=this.elements,c=2*s/(t-e),d=2*s/(i-r),f=(t+e)/(t-e),p=(i+r)/(i-r);let m,_;if(a===fo)m=-(o+s)/(o-s),_=-2*o*s/(o-s);else if(a===lm)m=-o/(o-s),_=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=c,l[4]=0,l[8]=f,l[12]=0,l[1]=0,l[5]=d,l[9]=p,l[13]=0,l[2]=0,l[6]=0,l[10]=m,l[14]=_,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,i,r,s,o,a=fo){const l=this.elements,c=1/(t-e),d=1/(i-r),f=1/(o-s),p=(t+e)*c,m=(i+r)*d;let _,S;if(a===fo)_=(o+s)*f,S=-2*f;else if(a===lm)_=s*f,S=-1*f;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-p,l[1]=0,l[5]=2*d,l[9]=0,l[13]=-m,l[2]=0,l[6]=0,l[10]=S,l[14]=-_,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<16;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}const qu=new G,Ns=new St,JY=new G(0,0,0),ZY=new G(1,1,1),Ba=new G,_y=new G,qr=new G,b2=new St,P2=new nr;class _r{constructor(e=0,t=0,i=0,r=_r.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,r=this._order){return this._x=e,this._y=t,this._z=i,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,i=!0){const r=e.elements,s=r[0],o=r[4],a=r[8],l=r[1],c=r[5],d=r[9],f=r[2],p=r[6],m=r[10];switch(t){case"XYZ":this._y=Math.asin($n(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-d,m),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(p,c),this._z=0);break;case"YXZ":this._x=Math.asin(-$n(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(a,m),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-f,s),this._z=0);break;case"ZXY":this._x=Math.asin($n(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-f,m),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-$n(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(p,m),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin($n(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-d,c),this._y=Math.atan2(-f,s)):(this._x=0,this._y=Math.atan2(a,m));break;case"XZY":this._z=Math.asin(-$n(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(p,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-d,m),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return b2.makeRotationFromQuaternion(e),this.setFromRotationMatrix(b2,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return P2.setFromEuler(this),this.setFromQuaternion(P2,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}}_r.DEFAULT_ORDER="XYZ";class Kc{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){for(let i=0;i0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.visibility=this._visibility,r.active=this._active,r.bounds=this._bounds.map(a=>({boxInitialized:a.boxInitialized,boxMin:a.box.min.toArray(),boxMax:a.box.max.toArray(),sphereInitialized:a.sphereInitialized,sphereRadius:a.sphere.radius,sphereCenter:a.sphere.center.toArray()})),r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.geometryCount=this._geometryCount,r.matricesTexture=this._matricesTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere={center:r.boundingSphere.center.toArray(),radius:r.boundingSphere.radius}),this.boundingBox!==null&&(r.boundingBox={min:r.boundingBox.min.toArray(),max:r.boundingBox.max.toArray()}));function s(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let c=0,d=l.length;c0){r.children=[];for(let a=0;a0){r.animations=[];for(let a=0;a0&&(i.geometries=a),l.length>0&&(i.materials=l),c.length>0&&(i.textures=c),d.length>0&&(i.images=d),f.length>0&&(i.shapes=f),p.length>0&&(i.skeletons=p),m.length>0&&(i.animations=m),_.length>0&&(i.nodes=_)}return i.object=r,i;function o(a){const l=[];for(const c in a){const d=a[c];delete d.metadata,l.push(d)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;i0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(e,t,i,r,s){Ds.subVectors(r,t),Vo.subVectors(i,t),Bw.subVectors(e,t);const o=Ds.dot(Ds),a=Ds.dot(Vo),l=Ds.dot(Bw),c=Vo.dot(Vo),d=Vo.dot(Bw),f=o*c-a*a;if(f===0)return s.set(0,0,0),null;const p=1/f,m=(c*l-a*d)*p,_=(o*d-a*l)*p;return s.set(1-m-_,_,m)}static containsPoint(e,t,i,r){return this.getBarycoord(e,t,i,r,Bo)===null?!1:Bo.x>=0&&Bo.y>=0&&Bo.x+Bo.y<=1}static getInterpolation(e,t,i,r,s,o,a,l){return this.getBarycoord(e,t,i,r,Bo)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(s,Bo.x),l.addScaledVector(o,Bo.y),l.addScaledVector(a,Bo.z),l)}static getInterpolatedAttribute(e,t,i,r,s,o){return Ww.setScalar(0),jw.setScalar(0),Xw.setScalar(0),Ww.fromBufferAttribute(e,t),jw.fromBufferAttribute(e,i),Xw.fromBufferAttribute(e,r),o.setScalar(0),o.addScaledVector(Ww,s.x),o.addScaledVector(jw,s.y),o.addScaledVector(Xw,s.z),o}static isFrontFacing(e,t,i,r){return Ds.subVectors(i,t),Vo.subVectors(e,t),Ds.cross(Vo).dot(r)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,r){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,i,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Ds.subVectors(this.c,this.b),Vo.subVectors(this.a,this.b),Ds.cross(Vo).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Nr.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Nr.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,r,s){return Nr.getInterpolation(e,this.a,this.b,this.c,t,i,r,s)}containsPoint(e){return Nr.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Nr.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,r=this.b,s=this.c;let o,a;Ku.subVectors(r,i),Qu.subVectors(s,i),zw.subVectors(e,i);const l=Ku.dot(zw),c=Qu.dot(zw);if(l<=0&&c<=0)return t.copy(i);Hw.subVectors(e,r);const d=Ku.dot(Hw),f=Qu.dot(Hw);if(d>=0&&f<=d)return t.copy(r);const p=l*f-d*c;if(p<=0&&l>=0&&d<=0)return o=l/(l-d),t.copy(i).addScaledVector(Ku,o);Gw.subVectors(e,s);const m=Ku.dot(Gw),_=Qu.dot(Gw);if(_>=0&&m<=_)return t.copy(s);const S=m*c-l*_;if(S<=0&&c>=0&&_<=0)return a=c/(c-_),t.copy(i).addScaledVector(Qu,a);const x=d*_-m*f;if(x<=0&&f-d>=0&&m-_>=0)return k2.subVectors(s,r),a=(f-d)/(f-d+(m-_)),t.copy(r).addScaledVector(k2,a);const y=1/(x+S+p);return o=S*y,a=p*y,t.copy(i).addScaledVector(Ku,o).addScaledVector(Qu,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const KF={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},za={h:0,s:0,l:0},Sy={h:0,s:0,l:0};function qw(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}class rt{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(t===void 0&&i===void 0){const r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=_s){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,cn.toWorkingColorSpace(this,t),this}setRGB(e,t,i,r=cn.workingColorSpace){return this.r=e,this.g=t,this.b=i,cn.toWorkingColorSpace(this,r),this}setHSL(e,t,i,r=cn.workingColorSpace){if(e=qM(e,1),t=$n(t,0,1),i=$n(i,0,1),t===0)this.r=this.g=this.b=i;else{const s=i<=.5?i*(1+t):i+t-i*t,o=2*i-s;this.r=qw(o,s,e+1/3),this.g=qw(o,s,e),this.b=qw(o,s,e-1/3)}return cn.toWorkingColorSpace(this,r),this}setStyle(e,t=_s){function i(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const o=r[1],a=r[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=r[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(s,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=_s){const i=KF[e.toLowerCase()];return i!==void 0?this.setHex(i,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Xh(e.r),this.g=Xh(e.g),this.b=Xh(e.b),this}copyLinearToSRGB(e){return this.r=Iw(e.r),this.g=Iw(e.g),this.b=Iw(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=_s){return cn.fromWorkingColorSpace($i.copy(this),e),Math.round($n($i.r*255,0,255))*65536+Math.round($n($i.g*255,0,255))*256+Math.round($n($i.b*255,0,255))}getHexString(e=_s){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=cn.workingColorSpace){cn.fromWorkingColorSpace($i.copy(this),t);const i=$i.r,r=$i.g,s=$i.b,o=Math.max(i,r,s),a=Math.min(i,r,s);let l,c;const d=(a+o)/2;if(a===o)l=0,c=0;else{const f=o-a;switch(c=d<=.5?f/(o+a):f/(2-o-a),o){case i:l=(r-s)/f+(r0!=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 i=e[t];if(i===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(i.dispersion=this.dispersion),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==qc&&(i.blending=this.blending),this.side!==da&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==A0&&(i.blendSrc=this.blendSrc),this.blendDst!==M0&&(i.blendDst=this.blendDst),this.blendEquation!==Ja&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==au&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==mT&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Pc&&(i.stencilFail=this.stencilFail),this.stencilZFail!==Pc&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==Pc&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function r(s){const o=[];for(const a in s){const l=s[a];delete l.metadata,o.push(l)}return o}if(t){const s=r(e.textures),o=r(e.images);s.length>0&&(i.textures=s),o.length>0&&(i.images=o)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let i=null;if(t!==null){const r=t.length;i=new Array(r);for(let s=0;s!==r;++s)i[s]=t[s].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}}class Vl extends Oi{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 _r,this.combine=Vm,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 Xo=sK();function sK(){const n=new ArrayBuffer(4),e=new Float32Array(n),t=new Uint32Array(n),i=new Uint32Array(512),r=new Uint32Array(512);for(let l=0;l<256;++l){const c=l-127;c<-27?(i[l]=0,i[l|256]=32768,r[l]=24,r[l|256]=24):c<-14?(i[l]=1024>>-c-14,i[l|256]=1024>>-c-14|32768,r[l]=-c-1,r[l|256]=-c-1):c<=15?(i[l]=c+15<<10,i[l|256]=c+15<<10|32768,r[l]=13,r[l|256]=13):c<128?(i[l]=31744,i[l|256]=64512,r[l]=24,r[l|256]=24):(i[l]=31744,i[l|256]=64512,r[l]=13,r[l|256]=13)}const s=new Uint32Array(2048),o=new Uint32Array(64),a=new Uint32Array(64);for(let l=1;l<1024;++l){let c=l<<13,d=0;for(;!(c&8388608);)c<<=1,d-=8388608;c&=-8388609,d+=947912704,s[l]=c|d}for(let l=1024;l<2048;++l)s[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)o[l]=l<<23;o[31]=1199570944,o[32]=2147483648;for(let l=33;l<63;++l)o[l]=2147483648+(l-32<<23);o[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(a[l]=1024);return{floatView:e,uint32View:t,baseTable:i,shiftTable:r,mantissaTable:s,exponentTable:o,offsetTable:a}}function Ir(n){Math.abs(n)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),n=$n(n,-65504,65504),Xo.floatView[0]=n;const e=Xo.uint32View[0],t=e>>23&511;return Xo.baseTable[t]+((e&8388607)>>Xo.shiftTable[t])}function Yf(n){const e=n>>10;return Xo.uint32View[0]=Xo.mantissaTable[Xo.offsetTable[e]+(n&1023)]+Xo.exponentTable[e],Xo.floatView[0]}const oK={toHalfFloat:Ir,fromHalfFloat:Yf},ci=new G,wy=new Ee;class vn{constructor(e,t,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=am,this.updateRanges=[],this.gpuType=kr,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,i){e*=this.itemSize,i*=t.itemSize;for(let r=0,s=this.itemSize;r0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const i=this.attributes;for(const l in i){const c=i[l];e.data.attributes[l]=c.toJSON(e.data)}const r={};let s=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],d=[];for(let f=0,p=c.length;f0&&(r[l]=d,s=!0)}s&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone(t));const r=e.attributes;for(const c in r){const d=r[c];this.setAttribute(c,d.clone(t))}const s=e.morphAttributes;for(const c in s){const d=[],f=s[c];for(let p=0,m=f.length;p0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s(e.far-e.near)**2))&&(O2.copy(s).invert(),hc.copy(e.ray).applyMatrix4(O2),!(i.boundingBox!==null&&hc.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,hc)))}_computeIntersections(e,t,i){let r;const s=this.geometry,o=this.material,a=s.index,l=s.attributes.position,c=s.attributes.uv,d=s.attributes.uv1,f=s.attributes.normal,p=s.groups,m=s.drawRange;if(a!==null)if(Array.isArray(o))for(let _=0,S=p.length;_t.far?null:{distance:c,point:by.clone(),object:n}}function Py(n,e,t,i,r,s,o,a,l,c){n.getVertexPosition(a,Ty),n.getVertexPosition(l,Ay),n.getVertexPosition(c,My);const d=pK(n,e,t,i,Ty,Ay,My,F2);if(d){const f=new G;Nr.getBarycoord(F2,Ty,Ay,My,f),r&&(d.uv=Nr.getInterpolatedAttribute(r,a,l,c,f,new Ee)),s&&(d.uv1=Nr.getInterpolatedAttribute(s,a,l,c,f,new Ee)),o&&(d.normal=Nr.getInterpolatedAttribute(o,a,l,c,f,new G),d.normal.dot(i.direction)>0&&d.normal.multiplyScalar(-1));const p={a,b:l,c,normal:new G,materialIndex:0};Nr.getNormal(Ty,Ay,My,p.normal),d.face=p,d.barycoord=f}return d}class vu extends Vt{constructor(e=1,t=1,i=1,r=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:r,heightSegments:s,depthSegments:o};const a=this;r=Math.floor(r),s=Math.floor(s),o=Math.floor(o);const l=[],c=[],d=[],f=[];let p=0,m=0;_("z","y","x",-1,-1,i,t,e,o,s,0),_("z","y","x",1,-1,i,t,-e,o,s,1),_("x","z","y",1,1,e,i,t,r,o,2),_("x","z","y",1,-1,e,i,-t,r,o,3),_("x","y","z",1,-1,e,t,i,r,s,4),_("x","y","z",-1,-1,e,t,-i,r,s,5),this.setIndex(l),this.setAttribute("position",new ht(c,3)),this.setAttribute("normal",new ht(d,3)),this.setAttribute("uv",new ht(f,2));function _(S,x,y,E,w,M,O,k,I,P,D){const A=M/I,R=O/P,V=M/2,U=O/2,se=k/2,le=I+1,ee=P+1;let pe=0,W=0;const J=new G;for(let Z=0;Z0?1:-1,d.push(J.x,J.y,J.z),f.push(Me/I),f.push(1-Z/P),pe+=1}}for(let Z=0;Z>8&255]+qi[n>>16&255]+qi[n>>24&255]+"-"+qi[e&255]+qi[e>>8&255]+"-"+qi[e>>16&15|64]+qi[e>>24&255]+"-"+qi[t&63|128]+qi[t>>8&255]+"-"+qi[t>>16&255]+qi[t>>24&255]+qi[i&255]+qi[i>>8&255]+qi[i>>16&255]+qi[i>>24&255]).toLowerCase()}function $n(n,e,t){return Math.max(e,Math.min(t,n))}function qM(n,e){return(n%e+e)%e}function MY(n,e,t,i,r){return i+(n-e)*(r-i)/(t-e)}function CY(n,e,t){return n!==e?(t-n)/(e-n):0}function Sp(n,e,t){return(1-t)*n+t*e}function bY(n,e,t,i){return Sp(n,e,1-Math.exp(-t*i))}function PY(n,e=1){return e-Math.abs(qM(n,e*2)-e)}function RY(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function IY(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function LY(n,e){return n+Math.floor(Math.random()*(e-n+1))}function NY(n,e){return n+Math.random()*(e-n)}function DY(n){return n*(.5-Math.random())}function kY(n){n!==void 0&&(E2=n);let e=E2+=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 OY(n){return n*Yc}function UY(n){return n*fd}function FY(n){return(n&n-1)===0&&n!==0}function VY(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function BY(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function zY(n,e,t,i,r){const s=Math.cos,o=Math.sin,a=s(t/2),l=o(t/2),c=s((e+i)/2),d=o((e+i)/2),f=s((e-i)/2),p=o((e-i)/2),m=s((i-e)/2),_=o((i-e)/2);switch(r){case"XYX":n.set(a*d,l*f,l*p,a*c);break;case"YZY":n.set(l*p,a*d,l*f,a*c);break;case"ZXZ":n.set(l*f,l*p,a*d,a*c);break;case"XZX":n.set(a*d,l*_,l*m,a*c);break;case"YXY":n.set(l*m,a*d,l*_,a*c);break;case"ZYZ":n.set(l*_,l*m,a*d,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function mr(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function Ft(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const XF={DEG2RAD:Yc,RAD2DEG:fd,generateUUID:Zr,clamp:$n,euclideanModulo:qM,mapLinear:MY,inverseLerp:CY,lerp:Sp,damp:bY,pingpong:PY,smoothstep:RY,smootherstep:IY,randInt:LY,randFloat:NY,randFloatSpread:DY,seededRandom:kY,degToRad:OY,radToDeg:UY,isPowerOfTwo:FY,ceilPowerOfTwo:VY,floorPowerOfTwo:BY,setQuaternionFromProperEuler:zY,normalize:Ft,denormalize:mr};class Ee{constructor(e=0,t=0){Ee.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,i=this.y,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6],this.y=r[1]*t+r[4]*i+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos($n(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const i=Math.cos(t),r=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*i-o*r+e.x,this.y=s*r+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Ut{constructor(e,t,i,r,s,o,a,l,c){Ut.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,o,a,l,c)}set(e,t,i,r,s,o,a,l,c){const d=this.elements;return d[0]=e,d[1]=r,d[2]=a,d[3]=t,d[4]=s,d[5]=l,d[6]=i,d[7]=o,d[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,o=i[0],a=i[3],l=i[6],c=i[1],d=i[4],f=i[7],p=i[2],m=i[5],_=i[8],S=r[0],x=r[3],y=r[6],E=r[1],w=r[4],M=r[7],O=r[2],k=r[5],I=r[8];return s[0]=o*S+a*E+l*O,s[3]=o*x+a*w+l*k,s[6]=o*y+a*M+l*I,s[1]=c*S+d*E+f*O,s[4]=c*x+d*w+f*k,s[7]=c*y+d*M+f*I,s[2]=p*S+m*E+_*O,s[5]=p*x+m*w+_*k,s[8]=p*y+m*M+_*I,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],d=e[8];return t*o*d-t*a*c-i*s*d+i*a*l+r*s*c-r*o*l}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],d=e[8],f=d*o-a*c,p=a*l-d*s,m=c*s-o*l,_=t*f+i*p+r*m;if(_===0)return this.set(0,0,0,0,0,0,0,0,0);const S=1/_;return e[0]=f*S,e[1]=(r*c-d*i)*S,e[2]=(a*i-r*o)*S,e[3]=p*S,e[4]=(d*t-r*l)*S,e[5]=(r*s-a*t)*S,e[6]=m*S,e[7]=(i*l-c*t)*S,e[8]=(o*t-i*s)*S,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,r,s,o,a){const l=Math.cos(s),c=Math.sin(s);return this.set(i*l,i*c,-i*(l*o+c*a)+o+e,-r*c,r*l,-r*(-c*o+l*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(Rw.makeScale(e,t)),this}rotate(e){return this.premultiply(Rw.makeRotation(-e)),this}translate(e,t){return this.premultiply(Rw.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<9;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const Rw=new Ut;function qF(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}const HY={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function Rh(n,e){return new HY[n](e)}function cm(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function $F(){const n=cm("canvas");return n.style.display="block",n}const T2={};function bv(n){n in T2||(T2[n]=!0,console.warn(n))}function GY(n,e,t){return new Promise(function(i,r){function s(){switch(n.clientWaitSync(e,n.SYNC_FLUSH_COMMANDS_BIT,0)){case n.WAIT_FAILED:r();break;case n.TIMEOUT_EXPIRED:setTimeout(s,t);break;default:i()}}setTimeout(s,t)})}function WY(n){const e=n.elements;e[2]=.5*e[2]+.5*e[3],e[6]=.5*e[6]+.5*e[7],e[10]=.5*e[10]+.5*e[11],e[14]=.5*e[14]+.5*e[15]}function jY(n){const e=n.elements;e[11]===-1?(e[10]=-e[10]-1,e[14]=-e[14]):(e[10]=-e[10],e[14]=-e[14]+1)}const A2=new Ut().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),M2=new Ut().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),Ef={[xa]:{transfer:rm,primaries:sm,luminanceCoefficients:[.2126,.7152,.0722],toReference:n=>n,fromReference:n=>n},[_s]:{transfer:En,primaries:sm,luminanceCoefficients:[.2126,.7152,.0722],toReference:n=>n.convertSRGBToLinear(),fromReference:n=>n.convertLinearToSRGB()},[zm]:{transfer:rm,primaries:om,luminanceCoefficients:[.2289,.6917,.0793],toReference:n=>n.applyMatrix3(M2),fromReference:n=>n.applyMatrix3(A2)},[fx]:{transfer:En,primaries:om,luminanceCoefficients:[.2289,.6917,.0793],toReference:n=>n.convertSRGBToLinear().applyMatrix3(M2),fromReference:n=>n.applyMatrix3(A2).convertLinearToSRGB()}},XY=new Set([xa,zm]),cn={enabled:!0,_workingColorSpace:xa,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(n){if(!XY.has(n))throw new Error(`Unsupported working color space, "${n}".`);this._workingColorSpace=n},convert:function(n,e,t){if(this.enabled===!1||e===t||!e||!t)return n;const i=Ef[e].toReference,r=Ef[t].fromReference;return r(i(n))},fromWorkingColorSpace:function(n,e){return this.convert(n,this._workingColorSpace,e)},toWorkingColorSpace:function(n,e){return this.convert(n,e,this._workingColorSpace)},getPrimaries:function(n){return Ef[n].primaries},getTransfer:function(n){return n===jo?rm:Ef[n].transfer},getLuminanceCoefficients:function(n,e=this._workingColorSpace){return n.fromArray(Ef[e].luminanceCoefficients)}};function Xh(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function Iw(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let Gu;class YF{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{Gu===void 0&&(Gu=cm("canvas")),Gu.width=e.width,Gu.height=e.height;const i=Gu.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=Gu}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=cm("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const r=i.getImageData(0,0,e.width,e.height),s=r.data;for(let o=0;o0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==sx)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case em:e.x=e.x-Math.floor(e.x);break;case Es:e.x=e.x<0?0:1;break;case tm: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 em:e.y=e.y-Math.floor(e.y);break;case Es:e.y=e.y<0?0:1;break;case tm: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++}}In.DEFAULT_IMAGE=null;In.DEFAULT_MAPPING=sx;In.DEFAULT_ANISOTROPY=1;class sn{constructor(e=0,t=0,i=0,r=1){sn.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*r+o[12]*s,this.y=o[1]*t+o[5]*i+o[9]*r+o[13]*s,this.z=o[2]*t+o[6]*i+o[10]*r+o[14]*s,this.w=o[3]*t+o[7]*i+o[11]*r+o[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,r,s;const l=e.elements,c=l[0],d=l[4],f=l[8],p=l[1],m=l[5],_=l[9],S=l[2],x=l[6],y=l[10];if(Math.abs(d-p)<.01&&Math.abs(f-S)<.01&&Math.abs(_-x)<.01){if(Math.abs(d+p)<.1&&Math.abs(f+S)<.1&&Math.abs(_+x)<.1&&Math.abs(c+m+y-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const w=(c+1)/2,M=(m+1)/2,O=(y+1)/2,k=(d+p)/4,I=(f+S)/4,P=(_+x)/4;return w>M&&w>O?w<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(w),r=k/i,s=I/i):M>O?M<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(M),i=k/r,s=P/r):O<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(O),i=I/s,r=P/s),this.set(i,r,s,t),this}let E=Math.sqrt((x-_)*(x-_)+(f-S)*(f-S)+(p-d)*(p-d));return Math.abs(E)<.001&&(E=1),this.x=(x-_)/E,this.y=(f-S)/E,this.z=(p-d)/E,this.w=Math.acos((c+m+y-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class KF extends Ys{constructor(e=1,t=1,i={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new sn(0,0,e,t),this.scissorTest=!1,this.viewport=new sn(0,0,e,t);const r={width:e,height:t,depth:1};i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:fi,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},i);const s=new In(r,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace);s.flipY=!1,s.generateMipmaps=i.generateMipmaps,s.internalFormat=i.internalFormat,this.textures=[];const o=i.count;for(let a=0;a=0?1:-1,w=1-y*y;if(w>Number.EPSILON){const O=Math.sqrt(w),k=Math.atan2(O,y*E);x=Math.sin(x*k)/O,a=Math.sin(a*k)/O}const M=a*E;if(l=l*x+p*M,c=c*x+m*M,d=d*x+_*M,f=f*x+S*M,x===1-a){const O=1/Math.sqrt(l*l+c*c+d*d+f*f);l*=O,c*=O,d*=O,f*=O}}e[t]=l,e[t+1]=c,e[t+2]=d,e[t+3]=f}static multiplyQuaternionsFlat(e,t,i,r,s,o){const a=i[r],l=i[r+1],c=i[r+2],d=i[r+3],f=s[o],p=s[o+1],m=s[o+2],_=s[o+3];return e[t]=a*_+d*f+l*m-c*p,e[t+1]=l*_+d*p+c*f-a*m,e[t+2]=c*_+d*m+a*p-l*f,e[t+3]=d*_-a*f-l*p-c*m,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,r){return this._x=e,this._y=t,this._z=i,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const i=e._x,r=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(i/2),d=a(r/2),f=a(s/2),p=l(i/2),m=l(r/2),_=l(s/2);switch(o){case"XYZ":this._x=p*d*f+c*m*_,this._y=c*m*f-p*d*_,this._z=c*d*_+p*m*f,this._w=c*d*f-p*m*_;break;case"YXZ":this._x=p*d*f+c*m*_,this._y=c*m*f-p*d*_,this._z=c*d*_-p*m*f,this._w=c*d*f+p*m*_;break;case"ZXY":this._x=p*d*f-c*m*_,this._y=c*m*f+p*d*_,this._z=c*d*_+p*m*f,this._w=c*d*f-p*m*_;break;case"ZYX":this._x=p*d*f-c*m*_,this._y=c*m*f+p*d*_,this._z=c*d*_-p*m*f,this._w=c*d*f+p*m*_;break;case"YZX":this._x=p*d*f+c*m*_,this._y=c*m*f+p*d*_,this._z=c*d*_-p*m*f,this._w=c*d*f-p*m*_;break;case"XZY":this._x=p*d*f-c*m*_,this._y=c*m*f-p*d*_,this._z=c*d*_+p*m*f,this._w=c*d*f+p*m*_;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],r=t[4],s=t[8],o=t[1],a=t[5],l=t[9],c=t[2],d=t[6],f=t[10],p=i+a+f;if(p>0){const m=.5/Math.sqrt(p+1);this._w=.25/m,this._x=(d-l)*m,this._y=(s-c)*m,this._z=(o-r)*m}else if(i>a&&i>f){const m=2*Math.sqrt(1+i-a-f);this._w=(d-l)/m,this._x=.25*m,this._y=(r+o)/m,this._z=(s+c)/m}else if(a>f){const m=2*Math.sqrt(1+a-i-f);this._w=(s-c)/m,this._x=(r+o)/m,this._y=.25*m,this._z=(l+d)/m}else{const m=2*Math.sqrt(1+f-i-a);this._w=(o-r)/m,this._x=(s+c)/m,this._y=(l+d)/m,this._z=.25*m}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return iMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs($n(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(i===0)return this;const r=Math.min(1,t/i);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const i=e._x,r=e._y,s=e._z,o=e._w,a=t._x,l=t._y,c=t._z,d=t._w;return this._x=i*d+o*a+r*c-s*l,this._y=r*d+o*l+s*a-i*c,this._z=s*d+o*c+i*l-r*a,this._w=o*d-i*a-r*l-s*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const i=this._x,r=this._y,s=this._z,o=this._w;let a=o*e._w+i*e._x+r*e._y+s*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=i,this._y=r,this._z=s,this;const l=1-a*a;if(l<=Number.EPSILON){const m=1-t;return this._w=m*o+t*this._w,this._x=m*i+t*this._x,this._y=m*r+t*this._y,this._z=m*s+t*this._z,this.normalize(),this}const c=Math.sqrt(l),d=Math.atan2(c,a),f=Math.sin((1-t)*d)/c,p=Math.sin(t*d)/c;return this._w=o*f+this._w*p,this._x=i*f+this._x*p,this._y=r*f+this._y*p,this._z=s*f+this._z*p,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),r=Math.sqrt(1-i),s=Math.sqrt(i);return this.set(r*Math.sin(e),r*Math.cos(e),s*Math.sin(t),s*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class G{constructor(e=0,t=0,i=0){G.prototype.isVector3=!0,this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(C2.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(C2.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[3]*i+s[6]*r,this.y=s[1]*t+s[4]*i+s[7]*r,this.z=s[2]*t+s[5]*i+s[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=e.elements,o=1/(s[3]*t+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*t+s[4]*i+s[8]*r+s[12])*o,this.y=(s[1]*t+s[5]*i+s[9]*r+s[13])*o,this.z=(s[2]*t+s[6]*i+s[10]*r+s[14])*o,this}applyQuaternion(e){const t=this.x,i=this.y,r=this.z,s=e.x,o=e.y,a=e.z,l=e.w,c=2*(o*r-a*i),d=2*(a*t-s*r),f=2*(s*i-o*t);return this.x=t+l*c+o*f-a*d,this.y=i+l*d+a*c-s*f,this.z=r+l*f+s*d-o*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[4]*i+s[8]*r,this.y=s[1]*t+s[5]*i+s[9]*r,this.z=s[2]*t+s[6]*i+s[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,r=e.y,s=e.z,o=t.x,a=t.y,l=t.z;return this.x=r*l-s*a,this.y=s*o-i*l,this.z=i*a-r*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return Nw.copy(this).projectOnVector(e),this.sub(Nw)}reflect(e){return this.sub(Nw.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos($n(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return t*t+i*i+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){const r=Math.sin(t)*e;return this.x=r*Math.sin(i),this.y=Math.cos(t)*e,this.z=r*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,i=Math.sqrt(1-t*t);return this.x=i*Math.cos(e),this.y=t,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Nw=new G,C2=new nr;class vr{constructor(e=new G(1/0,1/0,1/0),t=new G(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,i=e.length;t=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,Ls),Ls.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Tf),my.subVectors(this.max,Tf),Wu.subVectors(e.a,Tf),ju.subVectors(e.b,Tf),Xu.subVectors(e.c,Tf),Ua.subVectors(ju,Wu),Fa.subVectors(Xu,ju),cc.subVectors(Wu,Xu);let t=[0,-Ua.z,Ua.y,0,-Fa.z,Fa.y,0,-cc.z,cc.y,Ua.z,0,-Ua.x,Fa.z,0,-Fa.x,cc.z,0,-cc.x,-Ua.y,Ua.x,0,-Fa.y,Fa.x,0,-cc.y,cc.x,0];return!Dw(t,Wu,ju,Xu,my)||(t=[1,0,0,0,1,0,0,0,1],!Dw(t,Wu,ju,Xu,my))?!1:(gy.crossVectors(Ua,Fa),t=[gy.x,gy.y,gy.z],Dw(t,Wu,ju,Xu,my))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Ls).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Ls).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:(Oo[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Oo[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Oo[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Oo[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Oo[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Oo[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Oo[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Oo[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Oo),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const Oo=[new G,new G,new G,new G,new G,new G,new G,new G],Ls=new G,py=new vr,Wu=new G,ju=new G,Xu=new G,Ua=new G,Fa=new G,cc=new G,Tf=new G,my=new G,gy=new G,uc=new G;function Dw(n,e,t,i,r){for(let s=0,o=n.length-3;s<=o;s+=3){uc.fromArray(n,s);const a=r.x*Math.abs(uc.x)+r.y*Math.abs(uc.y)+r.z*Math.abs(uc.z),l=e.dot(uc),c=t.dot(uc),d=i.dot(uc);if(Math.max(-Math.max(l,c,d),Math.min(l,c,d))>a)return!1}return!0}const QY=new vr,Af=new G,kw=new G;class ir{constructor(e=new G,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const i=this.center;t!==void 0?i.copy(t):QY.setFromPoints(e).getCenter(i);let r=0;for(let s=0,o=e.length;sthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Af.subVectors(e,this.center);const t=Af.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),r=(i-this.radius)*.5;this.center.addScaledVector(Af,r/i),this.radius+=r}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(kw.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Af.copy(e.center).add(kw)),this.expandByPoint(Af.copy(e.center).sub(kw))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Uo=new G,Ow=new G,yy=new G,Va=new G,Uw=new G,vy=new G,Fw=new G;class yu{constructor(e=new G,t=new G(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Uo)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Uo.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Uo.copy(this.origin).addScaledVector(this.direction,t),Uo.distanceToSquared(e))}distanceSqToSegment(e,t,i,r){Ow.copy(e).add(t).multiplyScalar(.5),yy.copy(t).sub(e).normalize(),Va.copy(this.origin).sub(Ow);const s=e.distanceTo(t)*.5,o=-this.direction.dot(yy),a=Va.dot(this.direction),l=-Va.dot(yy),c=Va.lengthSq(),d=Math.abs(1-o*o);let f,p,m,_;if(d>0)if(f=o*l-a,p=o*a-l,_=s*d,f>=0)if(p>=-_)if(p<=_){const S=1/d;f*=S,p*=S,m=f*(f+o*p+2*a)+p*(o*f+p+2*l)+c}else p=s,f=Math.max(0,-(o*p+a)),m=-f*f+p*(p+2*l)+c;else p=-s,f=Math.max(0,-(o*p+a)),m=-f*f+p*(p+2*l)+c;else p<=-_?(f=Math.max(0,-(-o*s+a)),p=f>0?-s:Math.min(Math.max(-s,-l),s),m=-f*f+p*(p+2*l)+c):p<=_?(f=0,p=Math.min(Math.max(-s,-l),s),m=p*(p+2*l)+c):(f=Math.max(0,-(o*s+a)),p=f>0?s:Math.min(Math.max(-s,-l),s),m=-f*f+p*(p+2*l)+c);else p=o>0?-s:s,f=Math.max(0,-(o*p+a)),m=-f*f+p*(p+2*l)+c;return i&&i.copy(this.origin).addScaledVector(this.direction,f),r&&r.copy(Ow).addScaledVector(yy,p),m}intersectSphere(e,t){Uo.subVectors(e.center,this.origin);const i=Uo.dot(this.direction),r=Uo.dot(Uo)-i*i,s=e.radius*e.radius;if(r>s)return null;const o=Math.sqrt(s-r),a=i-o,l=i+o;return l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){const i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,r,s,o,a,l;const c=1/this.direction.x,d=1/this.direction.y,f=1/this.direction.z,p=this.origin;return c>=0?(i=(e.min.x-p.x)*c,r=(e.max.x-p.x)*c):(i=(e.max.x-p.x)*c,r=(e.min.x-p.x)*c),d>=0?(s=(e.min.y-p.y)*d,o=(e.max.y-p.y)*d):(s=(e.max.y-p.y)*d,o=(e.min.y-p.y)*d),i>o||s>r||((s>i||isNaN(i))&&(i=s),(o=0?(a=(e.min.z-p.z)*f,l=(e.max.z-p.z)*f):(a=(e.max.z-p.z)*f,l=(e.min.z-p.z)*f),i>l||a>r)||((a>i||i!==i)&&(i=a),(l=0?i:r,t)}intersectsBox(e){return this.intersectBox(e,Uo)!==null}intersectTriangle(e,t,i,r,s){Uw.subVectors(t,e),vy.subVectors(i,e),Fw.crossVectors(Uw,vy);let o=this.direction.dot(Fw),a;if(o>0){if(r)return null;a=1}else if(o<0)a=-1,o=-o;else return null;Va.subVectors(this.origin,e);const l=a*this.direction.dot(vy.crossVectors(Va,vy));if(l<0)return null;const c=a*this.direction.dot(Uw.cross(Va));if(c<0||l+c>o)return null;const d=-a*Va.dot(Fw);return d<0?null:this.at(d/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class St{constructor(e,t,i,r,s,o,a,l,c,d,f,p,m,_,S,x){St.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,o,a,l,c,d,f,p,m,_,S,x)}set(e,t,i,r,s,o,a,l,c,d,f,p,m,_,S,x){const y=this.elements;return y[0]=e,y[4]=t,y[8]=i,y[12]=r,y[1]=s,y[5]=o,y[9]=a,y[13]=l,y[2]=c,y[6]=d,y[10]=f,y[14]=p,y[3]=m,y[7]=_,y[11]=S,y[15]=x,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new St().fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,i=e.elements,r=1/qu.setFromMatrixColumn(e,0).length(),s=1/qu.setFromMatrixColumn(e,1).length(),o=1/qu.setFromMatrixColumn(e,2).length();return t[0]=i[0]*r,t[1]=i[1]*r,t[2]=i[2]*r,t[3]=0,t[4]=i[4]*s,t[5]=i[5]*s,t[6]=i[6]*s,t[7]=0,t[8]=i[8]*o,t[9]=i[9]*o,t[10]=i[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,i=e.x,r=e.y,s=e.z,o=Math.cos(i),a=Math.sin(i),l=Math.cos(r),c=Math.sin(r),d=Math.cos(s),f=Math.sin(s);if(e.order==="XYZ"){const p=o*d,m=o*f,_=a*d,S=a*f;t[0]=l*d,t[4]=-l*f,t[8]=c,t[1]=m+_*c,t[5]=p-S*c,t[9]=-a*l,t[2]=S-p*c,t[6]=_+m*c,t[10]=o*l}else if(e.order==="YXZ"){const p=l*d,m=l*f,_=c*d,S=c*f;t[0]=p+S*a,t[4]=_*a-m,t[8]=o*c,t[1]=o*f,t[5]=o*d,t[9]=-a,t[2]=m*a-_,t[6]=S+p*a,t[10]=o*l}else if(e.order==="ZXY"){const p=l*d,m=l*f,_=c*d,S=c*f;t[0]=p-S*a,t[4]=-o*f,t[8]=_+m*a,t[1]=m+_*a,t[5]=o*d,t[9]=S-p*a,t[2]=-o*c,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){const p=o*d,m=o*f,_=a*d,S=a*f;t[0]=l*d,t[4]=_*c-m,t[8]=p*c+S,t[1]=l*f,t[5]=S*c+p,t[9]=m*c-_,t[2]=-c,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){const p=o*l,m=o*c,_=a*l,S=a*c;t[0]=l*d,t[4]=S-p*f,t[8]=_*f+m,t[1]=f,t[5]=o*d,t[9]=-a*d,t[2]=-c*d,t[6]=m*f+_,t[10]=p-S*f}else if(e.order==="XZY"){const p=o*l,m=o*c,_=a*l,S=a*c;t[0]=l*d,t[4]=-f,t[8]=c*d,t[1]=p*f+S,t[5]=o*d,t[9]=m*f-_,t[2]=_*f-m,t[6]=a*d,t[10]=S*f+p}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(JY,e,ZY)}lookAt(e,t,i){const r=this.elements;return qr.subVectors(e,t),qr.lengthSq()===0&&(qr.z=1),qr.normalize(),Ba.crossVectors(i,qr),Ba.lengthSq()===0&&(Math.abs(i.z)===1?qr.x+=1e-4:qr.z+=1e-4,qr.normalize(),Ba.crossVectors(i,qr)),Ba.normalize(),_y.crossVectors(qr,Ba),r[0]=Ba.x,r[4]=_y.x,r[8]=qr.x,r[1]=Ba.y,r[5]=_y.y,r[9]=qr.y,r[2]=Ba.z,r[6]=_y.z,r[10]=qr.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,o=i[0],a=i[4],l=i[8],c=i[12],d=i[1],f=i[5],p=i[9],m=i[13],_=i[2],S=i[6],x=i[10],y=i[14],E=i[3],w=i[7],M=i[11],O=i[15],k=r[0],I=r[4],P=r[8],D=r[12],A=r[1],R=r[5],V=r[9],U=r[13],se=r[2],le=r[6],ee=r[10],pe=r[14],W=r[3],J=r[7],Z=r[11],oe=r[15];return s[0]=o*k+a*A+l*se+c*W,s[4]=o*I+a*R+l*le+c*J,s[8]=o*P+a*V+l*ee+c*Z,s[12]=o*D+a*U+l*pe+c*oe,s[1]=d*k+f*A+p*se+m*W,s[5]=d*I+f*R+p*le+m*J,s[9]=d*P+f*V+p*ee+m*Z,s[13]=d*D+f*U+p*pe+m*oe,s[2]=_*k+S*A+x*se+y*W,s[6]=_*I+S*R+x*le+y*J,s[10]=_*P+S*V+x*ee+y*Z,s[14]=_*D+S*U+x*pe+y*oe,s[3]=E*k+w*A+M*se+O*W,s[7]=E*I+w*R+M*le+O*J,s[11]=E*P+w*V+M*ee+O*Z,s[15]=E*D+w*U+M*pe+O*oe,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[4],r=e[8],s=e[12],o=e[1],a=e[5],l=e[9],c=e[13],d=e[2],f=e[6],p=e[10],m=e[14],_=e[3],S=e[7],x=e[11],y=e[15];return _*(+s*l*f-r*c*f-s*a*p+i*c*p+r*a*m-i*l*m)+S*(+t*l*m-t*c*p+s*o*p-r*o*m+r*c*d-s*l*d)+x*(+t*c*f-t*a*m-s*o*f+i*o*m+s*a*d-i*c*d)+y*(-r*a*d-t*l*f+t*a*p+r*o*f-i*o*p+i*l*d)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],d=e[8],f=e[9],p=e[10],m=e[11],_=e[12],S=e[13],x=e[14],y=e[15],E=f*x*c-S*p*c+S*l*m-a*x*m-f*l*y+a*p*y,w=_*p*c-d*x*c-_*l*m+o*x*m+d*l*y-o*p*y,M=d*S*c-_*f*c+_*a*m-o*S*m-d*a*y+o*f*y,O=_*f*l-d*S*l-_*a*p+o*S*p+d*a*x-o*f*x,k=t*E+i*w+r*M+s*O;if(k===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const I=1/k;return e[0]=E*I,e[1]=(S*p*s-f*x*s-S*r*m+i*x*m+f*r*y-i*p*y)*I,e[2]=(a*x*s-S*l*s+S*r*c-i*x*c-a*r*y+i*l*y)*I,e[3]=(f*l*s-a*p*s-f*r*c+i*p*c+a*r*m-i*l*m)*I,e[4]=w*I,e[5]=(d*x*s-_*p*s+_*r*m-t*x*m-d*r*y+t*p*y)*I,e[6]=(_*l*s-o*x*s-_*r*c+t*x*c+o*r*y-t*l*y)*I,e[7]=(o*p*s-d*l*s+d*r*c-t*p*c-o*r*m+t*l*m)*I,e[8]=M*I,e[9]=(_*f*s-d*S*s-_*i*m+t*S*m+d*i*y-t*f*y)*I,e[10]=(o*S*s-_*a*s+_*i*c-t*S*c-o*i*y+t*a*y)*I,e[11]=(d*a*s-o*f*s-d*i*c+t*f*c+o*i*m-t*a*m)*I,e[12]=O*I,e[13]=(d*S*r-_*f*r+_*i*p-t*S*p-d*i*x+t*f*x)*I,e[14]=(_*a*r-o*S*r-_*i*l+t*S*l+o*i*x-t*a*x)*I,e[15]=(o*f*r-d*a*r+d*i*l-t*f*l-o*i*p+t*a*p)*I,this}scale(e){const t=this.elements,i=e.x,r=e.y,s=e.z;return t[0]*=i,t[4]*=r,t[8]*=s,t[1]*=i,t[5]*=r,t[9]*=s,t[2]*=i,t[6]*=r,t[10]*=s,t[3]*=i,t[7]*=r,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,r))}makeTranslation(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),r=Math.sin(t),s=1-i,o=e.x,a=e.y,l=e.z,c=s*o,d=s*a;return this.set(c*o+i,c*a-r*l,c*l+r*a,0,c*a+r*l,d*a+i,d*l-r*o,0,c*l-r*a,d*l+r*o,s*l*l+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,r,s,o){return this.set(1,i,s,0,e,1,o,0,t,r,1,0,0,0,0,1),this}compose(e,t,i){const r=this.elements,s=t._x,o=t._y,a=t._z,l=t._w,c=s+s,d=o+o,f=a+a,p=s*c,m=s*d,_=s*f,S=o*d,x=o*f,y=a*f,E=l*c,w=l*d,M=l*f,O=i.x,k=i.y,I=i.z;return r[0]=(1-(S+y))*O,r[1]=(m+M)*O,r[2]=(_-w)*O,r[3]=0,r[4]=(m-M)*k,r[5]=(1-(p+y))*k,r[6]=(x+E)*k,r[7]=0,r[8]=(_+w)*I,r[9]=(x-E)*I,r[10]=(1-(p+S))*I,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,i){const r=this.elements;let s=qu.set(r[0],r[1],r[2]).length();const o=qu.set(r[4],r[5],r[6]).length(),a=qu.set(r[8],r[9],r[10]).length();this.determinant()<0&&(s=-s),e.x=r[12],e.y=r[13],e.z=r[14],Ns.copy(this);const c=1/s,d=1/o,f=1/a;return Ns.elements[0]*=c,Ns.elements[1]*=c,Ns.elements[2]*=c,Ns.elements[4]*=d,Ns.elements[5]*=d,Ns.elements[6]*=d,Ns.elements[8]*=f,Ns.elements[9]*=f,Ns.elements[10]*=f,t.setFromRotationMatrix(Ns),i.x=s,i.y=o,i.z=a,this}makePerspective(e,t,i,r,s,o,a=fo){const l=this.elements,c=2*s/(t-e),d=2*s/(i-r),f=(t+e)/(t-e),p=(i+r)/(i-r);let m,_;if(a===fo)m=-(o+s)/(o-s),_=-2*o*s/(o-s);else if(a===lm)m=-o/(o-s),_=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=c,l[4]=0,l[8]=f,l[12]=0,l[1]=0,l[5]=d,l[9]=p,l[13]=0,l[2]=0,l[6]=0,l[10]=m,l[14]=_,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,i,r,s,o,a=fo){const l=this.elements,c=1/(t-e),d=1/(i-r),f=1/(o-s),p=(t+e)*c,m=(i+r)*d;let _,S;if(a===fo)_=(o+s)*f,S=-2*f;else if(a===lm)_=s*f,S=-1*f;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-p,l[1]=0,l[5]=2*d,l[9]=0,l[13]=-m,l[2]=0,l[6]=0,l[10]=S,l[14]=-_,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<16;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}const qu=new G,Ns=new St,JY=new G(0,0,0),ZY=new G(1,1,1),Ba=new G,_y=new G,qr=new G,b2=new St,P2=new nr;class _r{constructor(e=0,t=0,i=0,r=_r.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,r=this._order){return this._x=e,this._y=t,this._z=i,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,i=!0){const r=e.elements,s=r[0],o=r[4],a=r[8],l=r[1],c=r[5],d=r[9],f=r[2],p=r[6],m=r[10];switch(t){case"XYZ":this._y=Math.asin($n(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-d,m),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(p,c),this._z=0);break;case"YXZ":this._x=Math.asin(-$n(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(a,m),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-f,s),this._z=0);break;case"ZXY":this._x=Math.asin($n(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-f,m),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-$n(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(p,m),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin($n(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-d,c),this._y=Math.atan2(-f,s)):(this._x=0,this._y=Math.atan2(a,m));break;case"XZY":this._z=Math.asin(-$n(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(p,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-d,m),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return b2.makeRotationFromQuaternion(e),this.setFromRotationMatrix(b2,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return P2.setFromEuler(this),this.setFromQuaternion(P2,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}}_r.DEFAULT_ORDER="XYZ";class Kc{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){for(let i=0;i0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.visibility=this._visibility,r.active=this._active,r.bounds=this._bounds.map(a=>({boxInitialized:a.boxInitialized,boxMin:a.box.min.toArray(),boxMax:a.box.max.toArray(),sphereInitialized:a.sphereInitialized,sphereRadius:a.sphere.radius,sphereCenter:a.sphere.center.toArray()})),r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.geometryCount=this._geometryCount,r.matricesTexture=this._matricesTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere={center:r.boundingSphere.center.toArray(),radius:r.boundingSphere.radius}),this.boundingBox!==null&&(r.boundingBox={min:r.boundingBox.min.toArray(),max:r.boundingBox.max.toArray()}));function s(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let c=0,d=l.length;c0){r.children=[];for(let a=0;a0){r.animations=[];for(let a=0;a0&&(i.geometries=a),l.length>0&&(i.materials=l),c.length>0&&(i.textures=c),d.length>0&&(i.images=d),f.length>0&&(i.shapes=f),p.length>0&&(i.skeletons=p),m.length>0&&(i.animations=m),_.length>0&&(i.nodes=_)}return i.object=r,i;function o(a){const l=[];for(const c in a){const d=a[c];delete d.metadata,l.push(d)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;i0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(e,t,i,r,s){Ds.subVectors(r,t),Vo.subVectors(i,t),Bw.subVectors(e,t);const o=Ds.dot(Ds),a=Ds.dot(Vo),l=Ds.dot(Bw),c=Vo.dot(Vo),d=Vo.dot(Bw),f=o*c-a*a;if(f===0)return s.set(0,0,0),null;const p=1/f,m=(c*l-a*d)*p,_=(o*d-a*l)*p;return s.set(1-m-_,_,m)}static containsPoint(e,t,i,r){return this.getBarycoord(e,t,i,r,Bo)===null?!1:Bo.x>=0&&Bo.y>=0&&Bo.x+Bo.y<=1}static getInterpolation(e,t,i,r,s,o,a,l){return this.getBarycoord(e,t,i,r,Bo)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(s,Bo.x),l.addScaledVector(o,Bo.y),l.addScaledVector(a,Bo.z),l)}static getInterpolatedAttribute(e,t,i,r,s,o){return Ww.setScalar(0),jw.setScalar(0),Xw.setScalar(0),Ww.fromBufferAttribute(e,t),jw.fromBufferAttribute(e,i),Xw.fromBufferAttribute(e,r),o.setScalar(0),o.addScaledVector(Ww,s.x),o.addScaledVector(jw,s.y),o.addScaledVector(Xw,s.z),o}static isFrontFacing(e,t,i,r){return Ds.subVectors(i,t),Vo.subVectors(e,t),Ds.cross(Vo).dot(r)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,r){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,i,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Ds.subVectors(this.c,this.b),Vo.subVectors(this.a,this.b),Ds.cross(Vo).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Nr.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Nr.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,r,s){return Nr.getInterpolation(e,this.a,this.b,this.c,t,i,r,s)}containsPoint(e){return Nr.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Nr.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,r=this.b,s=this.c;let o,a;Ku.subVectors(r,i),Qu.subVectors(s,i),zw.subVectors(e,i);const l=Ku.dot(zw),c=Qu.dot(zw);if(l<=0&&c<=0)return t.copy(i);Hw.subVectors(e,r);const d=Ku.dot(Hw),f=Qu.dot(Hw);if(d>=0&&f<=d)return t.copy(r);const p=l*f-d*c;if(p<=0&&l>=0&&d<=0)return o=l/(l-d),t.copy(i).addScaledVector(Ku,o);Gw.subVectors(e,s);const m=Ku.dot(Gw),_=Qu.dot(Gw);if(_>=0&&m<=_)return t.copy(s);const S=m*c-l*_;if(S<=0&&c>=0&&_<=0)return a=c/(c-_),t.copy(i).addScaledVector(Qu,a);const x=d*_-m*f;if(x<=0&&f-d>=0&&m-_>=0)return k2.subVectors(s,r),a=(f-d)/(f-d+(m-_)),t.copy(r).addScaledVector(k2,a);const y=1/(x+S+p);return o=S*y,a=p*y,t.copy(i).addScaledVector(Ku,o).addScaledVector(Qu,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const QF={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},za={h:0,s:0,l:0},Sy={h:0,s:0,l:0};function qw(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}class rt{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(t===void 0&&i===void 0){const r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=_s){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,cn.toWorkingColorSpace(this,t),this}setRGB(e,t,i,r=cn.workingColorSpace){return this.r=e,this.g=t,this.b=i,cn.toWorkingColorSpace(this,r),this}setHSL(e,t,i,r=cn.workingColorSpace){if(e=qM(e,1),t=$n(t,0,1),i=$n(i,0,1),t===0)this.r=this.g=this.b=i;else{const s=i<=.5?i*(1+t):i+t-i*t,o=2*i-s;this.r=qw(o,s,e+1/3),this.g=qw(o,s,e),this.b=qw(o,s,e-1/3)}return cn.toWorkingColorSpace(this,r),this}setStyle(e,t=_s){function i(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const o=r[1],a=r[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=r[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(s,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=_s){const i=QF[e.toLowerCase()];return i!==void 0?this.setHex(i,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Xh(e.r),this.g=Xh(e.g),this.b=Xh(e.b),this}copyLinearToSRGB(e){return this.r=Iw(e.r),this.g=Iw(e.g),this.b=Iw(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=_s){return cn.fromWorkingColorSpace($i.copy(this),e),Math.round($n($i.r*255,0,255))*65536+Math.round($n($i.g*255,0,255))*256+Math.round($n($i.b*255,0,255))}getHexString(e=_s){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=cn.workingColorSpace){cn.fromWorkingColorSpace($i.copy(this),t);const i=$i.r,r=$i.g,s=$i.b,o=Math.max(i,r,s),a=Math.min(i,r,s);let l,c;const d=(a+o)/2;if(a===o)l=0,c=0;else{const f=o-a;switch(c=d<=.5?f/(o+a):f/(2-o-a),o){case i:l=(r-s)/f+(r0!=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 i=e[t];if(i===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(i.dispersion=this.dispersion),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==qc&&(i.blending=this.blending),this.side!==da&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==A0&&(i.blendSrc=this.blendSrc),this.blendDst!==M0&&(i.blendDst=this.blendDst),this.blendEquation!==Ja&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==au&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==mT&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Pc&&(i.stencilFail=this.stencilFail),this.stencilZFail!==Pc&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==Pc&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function r(s){const o=[];for(const a in s){const l=s[a];delete l.metadata,o.push(l)}return o}if(t){const s=r(e.textures),o=r(e.images);s.length>0&&(i.textures=s),o.length>0&&(i.images=o)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let i=null;if(t!==null){const r=t.length;i=new Array(r);for(let s=0;s!==r;++s)i[s]=t[s].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}}class Vl extends Oi{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 _r,this.combine=Vm,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 Xo=sK();function sK(){const n=new ArrayBuffer(4),e=new Float32Array(n),t=new Uint32Array(n),i=new Uint32Array(512),r=new Uint32Array(512);for(let l=0;l<256;++l){const c=l-127;c<-27?(i[l]=0,i[l|256]=32768,r[l]=24,r[l|256]=24):c<-14?(i[l]=1024>>-c-14,i[l|256]=1024>>-c-14|32768,r[l]=-c-1,r[l|256]=-c-1):c<=15?(i[l]=c+15<<10,i[l|256]=c+15<<10|32768,r[l]=13,r[l|256]=13):c<128?(i[l]=31744,i[l|256]=64512,r[l]=24,r[l|256]=24):(i[l]=31744,i[l|256]=64512,r[l]=13,r[l|256]=13)}const s=new Uint32Array(2048),o=new Uint32Array(64),a=new Uint32Array(64);for(let l=1;l<1024;++l){let c=l<<13,d=0;for(;!(c&8388608);)c<<=1,d-=8388608;c&=-8388609,d+=947912704,s[l]=c|d}for(let l=1024;l<2048;++l)s[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)o[l]=l<<23;o[31]=1199570944,o[32]=2147483648;for(let l=33;l<63;++l)o[l]=2147483648+(l-32<<23);o[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(a[l]=1024);return{floatView:e,uint32View:t,baseTable:i,shiftTable:r,mantissaTable:s,exponentTable:o,offsetTable:a}}function Ir(n){Math.abs(n)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),n=$n(n,-65504,65504),Xo.floatView[0]=n;const e=Xo.uint32View[0],t=e>>23&511;return Xo.baseTable[t]+((e&8388607)>>Xo.shiftTable[t])}function Yf(n){const e=n>>10;return Xo.uint32View[0]=Xo.mantissaTable[Xo.offsetTable[e]+(n&1023)]+Xo.exponentTable[e],Xo.floatView[0]}const oK={toHalfFloat:Ir,fromHalfFloat:Yf},ci=new G,wy=new Ee;class vn{constructor(e,t,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=am,this.updateRanges=[],this.gpuType=kr,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,i){e*=this.itemSize,i*=t.itemSize;for(let r=0,s=this.itemSize;r0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const i=this.attributes;for(const l in i){const c=i[l];e.data.attributes[l]=c.toJSON(e.data)}const r={};let s=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],d=[];for(let f=0,p=c.length;f0&&(r[l]=d,s=!0)}s&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone(t));const r=e.attributes;for(const c in r){const d=r[c];this.setAttribute(c,d.clone(t))}const s=e.morphAttributes;for(const c in s){const d=[],f=s[c];for(let p=0,m=f.length;p0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s(e.far-e.near)**2))&&(O2.copy(s).invert(),hc.copy(e.ray).applyMatrix4(O2),!(i.boundingBox!==null&&hc.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,hc)))}_computeIntersections(e,t,i){let r;const s=this.geometry,o=this.material,a=s.index,l=s.attributes.position,c=s.attributes.uv,d=s.attributes.uv1,f=s.attributes.normal,p=s.groups,m=s.drawRange;if(a!==null)if(Array.isArray(o))for(let _=0,S=p.length;_t.far?null:{distance:c,point:by.clone(),object:n}}function Py(n,e,t,i,r,s,o,a,l,c){n.getVertexPosition(a,Ty),n.getVertexPosition(l,Ay),n.getVertexPosition(c,My);const d=pK(n,e,t,i,Ty,Ay,My,F2);if(d){const f=new G;Nr.getBarycoord(F2,Ty,Ay,My,f),r&&(d.uv=Nr.getInterpolatedAttribute(r,a,l,c,f,new Ee)),s&&(d.uv1=Nr.getInterpolatedAttribute(s,a,l,c,f,new Ee)),o&&(d.normal=Nr.getInterpolatedAttribute(o,a,l,c,f,new G),d.normal.dot(i.direction)>0&&d.normal.multiplyScalar(-1));const p={a,b:l,c,normal:new G,materialIndex:0};Nr.getNormal(Ty,Ay,My,p.normal),d.face=p,d.barycoord=f}return d}class vu extends Vt{constructor(e=1,t=1,i=1,r=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:r,heightSegments:s,depthSegments:o};const a=this;r=Math.floor(r),s=Math.floor(s),o=Math.floor(o);const l=[],c=[],d=[],f=[];let p=0,m=0;_("z","y","x",-1,-1,i,t,e,o,s,0),_("z","y","x",1,-1,i,t,-e,o,s,1),_("x","z","y",1,1,e,i,t,r,o,2),_("x","z","y",1,-1,e,i,-t,r,o,3),_("x","y","z",1,-1,e,t,i,r,s,4),_("x","y","z",-1,-1,e,t,-i,r,s,5),this.setIndex(l),this.setAttribute("position",new ht(c,3)),this.setAttribute("normal",new ht(d,3)),this.setAttribute("uv",new ht(f,2));function _(S,x,y,E,w,M,O,k,I,P,D){const A=M/I,R=O/P,V=M/2,U=O/2,se=k/2,le=I+1,ee=P+1;let pe=0,W=0;const J=new G;for(let Z=0;Z0?1:-1,d.push(J.x,J.y,J.z),f.push(Me/I),f.push(1-Z/P),pe+=1}}for(let Z=0;Z1?null:t.copy(e.start).addScaledVector(i,s)}intersectsLine(e){const t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const i=t||_K.getNormalMatrix(e),r=this.coplanarPoint(Kw).applyMatrix4(e),s=this.normal.applyMatrix3(i).normalize();return this.constant=-r.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const dc=new ir,Ry=new G;class Wm{constructor(e=new Wo,t=new Wo,i=new Wo,r=new Wo,s=new Wo,o=new Wo){this.planes=[e,t,i,r,s,o]}set(e,t,i,r,s,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(i),a[3].copy(r),a[4].copy(s),a[5].copy(o),this}copy(e){const t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=fo){const i=this.planes,r=e.elements,s=r[0],o=r[1],a=r[2],l=r[3],c=r[4],d=r[5],f=r[6],p=r[7],m=r[8],_=r[9],S=r[10],x=r[11],y=r[12],E=r[13],w=r[14],M=r[15];if(i[0].setComponents(l-s,p-c,x-m,M-y).normalize(),i[1].setComponents(l+s,p+c,x+m,M+y).normalize(),i[2].setComponents(l+o,p+d,x+_,M+E).normalize(),i[3].setComponents(l-o,p-d,x-_,M-E).normalize(),i[4].setComponents(l-a,p-f,x-S,M-w).normalize(),t===fo)i[5].setComponents(l+a,p+f,x+S,M+w).normalize();else if(t===lm)i[5].setComponents(a,f,S,w).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),dc.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),dc.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(dc)}intersectsSprite(e){return dc.center.set(0,0,0),dc.radius=.7071067811865476,dc.applyMatrix4(e.matrixWorld),this.intersectsSphere(dc)}intersectsSphere(e){const t=this.planes,i=e.center,r=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(i)0?e.max.x:e.min.x,Ry.y=r.normal.y>0?e.max.y:e.min.y,Ry.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Ry)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function ZF(){let n=null,e=!1,t=null,i=null;function r(s,o){t(s,o),i=n.requestAnimationFrame(r)}return{start:function(){e!==!0&&t!==null&&(i=n.requestAnimationFrame(r),e=!0)},stop:function(){n.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){n=s}}}function xK(n){const e=new WeakMap;function t(a,l){const c=a.array,d=a.usage,f=c.byteLength,p=n.createBuffer();n.bindBuffer(l,p),n.bufferData(l,c,d),a.onUploadCallback();let m;if(c instanceof Float32Array)m=n.FLOAT;else if(c instanceof Uint16Array)a.isFloat16BufferAttribute?m=n.HALF_FLOAT:m=n.UNSIGNED_SHORT;else if(c instanceof Int16Array)m=n.SHORT;else if(c instanceof Uint32Array)m=n.UNSIGNED_INT;else if(c instanceof Int32Array)m=n.INT;else if(c instanceof Int8Array)m=n.BYTE;else if(c instanceof Uint8Array)m=n.UNSIGNED_BYTE;else if(c instanceof Uint8ClampedArray)m=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+c);return{buffer:p,type:m,bytesPerElement:c.BYTES_PER_ELEMENT,version:a.version,size:f}}function i(a,l,c){const d=l.array,f=l.updateRanges;if(n.bindBuffer(c,a),f.length===0)n.bufferSubData(c,0,d);else{f.sort((m,_)=>m.start-_.start);let p=0;for(let m=1;m1?null:t.copy(e.start).addScaledVector(i,s)}intersectsLine(e){const t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const i=t||_K.getNormalMatrix(e),r=this.coplanarPoint(Kw).applyMatrix4(e),s=this.normal.applyMatrix3(i).normalize();return this.constant=-r.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const dc=new ir,Ry=new G;class Wm{constructor(e=new Wo,t=new Wo,i=new Wo,r=new Wo,s=new Wo,o=new Wo){this.planes=[e,t,i,r,s,o]}set(e,t,i,r,s,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(i),a[3].copy(r),a[4].copy(s),a[5].copy(o),this}copy(e){const t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=fo){const i=this.planes,r=e.elements,s=r[0],o=r[1],a=r[2],l=r[3],c=r[4],d=r[5],f=r[6],p=r[7],m=r[8],_=r[9],S=r[10],x=r[11],y=r[12],E=r[13],w=r[14],M=r[15];if(i[0].setComponents(l-s,p-c,x-m,M-y).normalize(),i[1].setComponents(l+s,p+c,x+m,M+y).normalize(),i[2].setComponents(l+o,p+d,x+_,M+E).normalize(),i[3].setComponents(l-o,p-d,x-_,M-E).normalize(),i[4].setComponents(l-a,p-f,x-S,M-w).normalize(),t===fo)i[5].setComponents(l+a,p+f,x+S,M+w).normalize();else if(t===lm)i[5].setComponents(a,f,S,w).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),dc.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),dc.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(dc)}intersectsSprite(e){return dc.center.set(0,0,0),dc.radius=.7071067811865476,dc.applyMatrix4(e.matrixWorld),this.intersectsSphere(dc)}intersectsSphere(e){const t=this.planes,i=e.center,r=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(i)0?e.max.x:e.min.x,Ry.y=r.normal.y>0?e.max.y:e.min.y,Ry.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Ry)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function eV(){let n=null,e=!1,t=null,i=null;function r(s,o){t(s,o),i=n.requestAnimationFrame(r)}return{start:function(){e!==!0&&t!==null&&(i=n.requestAnimationFrame(r),e=!0)},stop:function(){n.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){n=s}}}function xK(n){const e=new WeakMap;function t(a,l){const c=a.array,d=a.usage,f=c.byteLength,p=n.createBuffer();n.bindBuffer(l,p),n.bufferData(l,c,d),a.onUploadCallback();let m;if(c instanceof Float32Array)m=n.FLOAT;else if(c instanceof Uint16Array)a.isFloat16BufferAttribute?m=n.HALF_FLOAT:m=n.UNSIGNED_SHORT;else if(c instanceof Int16Array)m=n.SHORT;else if(c instanceof Uint32Array)m=n.UNSIGNED_INT;else if(c instanceof Int32Array)m=n.INT;else if(c instanceof Int8Array)m=n.BYTE;else if(c instanceof Uint8Array)m=n.UNSIGNED_BYTE;else if(c instanceof Uint8ClampedArray)m=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+c);return{buffer:p,type:m,bytesPerElement:c.BYTES_PER_ELEMENT,version:a.version,size:f}}function i(a,l,c){const d=l.array,f=l.updateRanges;if(n.bindBuffer(c,a),f.length===0)n.bufferSubData(c,0,d);else{f.sort((m,_)=>m.start-_.start);let p=0;for(let m=1;m #include #include -}`,Gt={alphahash_fragment:SK,alphahash_pars_fragment:wK,alphamap_fragment:EK,alphamap_pars_fragment:TK,alphatest_fragment:AK,alphatest_pars_fragment:MK,aomap_fragment:CK,aomap_pars_fragment:bK,batching_pars_vertex:PK,batching_vertex:RK,begin_vertex:IK,beginnormal_vertex:LK,bsdfs:NK,iridescence_fragment:DK,bumpmap_pars_fragment:kK,clipping_planes_fragment:OK,clipping_planes_pars_fragment:UK,clipping_planes_pars_vertex:FK,clipping_planes_vertex:VK,color_fragment:BK,color_pars_fragment:zK,color_pars_vertex:HK,color_vertex:GK,common:WK,cube_uv_reflection_fragment:jK,defaultnormal_vertex:XK,displacementmap_pars_vertex:qK,displacementmap_vertex:$K,emissivemap_fragment:YK,emissivemap_pars_fragment:KK,colorspace_fragment:QK,colorspace_pars_fragment:JK,envmap_fragment:ZK,envmap_common_pars_fragment:eQ,envmap_pars_fragment:tQ,envmap_pars_vertex:nQ,envmap_physical_pars_fragment:fQ,envmap_vertex:iQ,fog_vertex:rQ,fog_pars_vertex:sQ,fog_fragment:oQ,fog_pars_fragment:aQ,gradientmap_pars_fragment:lQ,lightmap_pars_fragment:cQ,lights_lambert_fragment:uQ,lights_lambert_pars_fragment:hQ,lights_pars_begin:dQ,lights_toon_fragment:pQ,lights_toon_pars_fragment:mQ,lights_phong_fragment:gQ,lights_phong_pars_fragment:yQ,lights_physical_fragment:vQ,lights_physical_pars_fragment:_Q,lights_fragment_begin:xQ,lights_fragment_maps:SQ,lights_fragment_end:wQ,logdepthbuf_fragment:EQ,logdepthbuf_pars_fragment:TQ,logdepthbuf_pars_vertex:AQ,logdepthbuf_vertex:MQ,map_fragment:CQ,map_pars_fragment:bQ,map_particle_fragment:PQ,map_particle_pars_fragment:RQ,metalnessmap_fragment:IQ,metalnessmap_pars_fragment:LQ,morphinstance_vertex:NQ,morphcolor_vertex:DQ,morphnormal_vertex:kQ,morphtarget_pars_vertex:OQ,morphtarget_vertex:UQ,normal_fragment_begin:FQ,normal_fragment_maps:VQ,normal_pars_fragment:BQ,normal_pars_vertex:zQ,normal_vertex:HQ,normalmap_pars_fragment:GQ,clearcoat_normal_fragment_begin:WQ,clearcoat_normal_fragment_maps:jQ,clearcoat_pars_fragment:XQ,iridescence_pars_fragment:qQ,opaque_fragment:$Q,packing:YQ,premultiplied_alpha_fragment:KQ,project_vertex:QQ,dithering_fragment:JQ,dithering_pars_fragment:ZQ,roughnessmap_fragment:eJ,roughnessmap_pars_fragment:tJ,shadowmap_pars_fragment:nJ,shadowmap_pars_vertex:iJ,shadowmap_vertex:rJ,shadowmask_pars_fragment:sJ,skinbase_vertex:oJ,skinning_pars_vertex:aJ,skinning_vertex:lJ,skinnormal_vertex:cJ,specularmap_fragment:uJ,specularmap_pars_fragment:hJ,tonemapping_fragment:dJ,tonemapping_pars_fragment:fJ,transmission_fragment:pJ,transmission_pars_fragment:mJ,uv_pars_fragment:gJ,uv_pars_vertex:yJ,uv_vertex:vJ,worldpos_vertex:_J,background_vert:xJ,background_frag:SJ,backgroundCube_vert:wJ,backgroundCube_frag:EJ,cube_vert:TJ,cube_frag:AJ,depth_vert:MJ,depth_frag:CJ,distanceRGBA_vert:bJ,distanceRGBA_frag:PJ,equirect_vert:RJ,equirect_frag:IJ,linedashed_vert:LJ,linedashed_frag:NJ,meshbasic_vert:DJ,meshbasic_frag:kJ,meshlambert_vert:OJ,meshlambert_frag:UJ,meshmatcap_vert:FJ,meshmatcap_frag:VJ,meshnormal_vert:BJ,meshnormal_frag:zJ,meshphong_vert:HJ,meshphong_frag:GJ,meshphysical_vert:WJ,meshphysical_frag:jJ,meshtoon_vert:XJ,meshtoon_frag:qJ,points_vert:$J,points_frag:YJ,shadow_vert:KJ,shadow_frag:QJ,sprite_vert:JJ,sprite_frag:ZJ},Ye={common:{diffuse:{value:new rt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Ut},alphaMap:{value:null},alphaMapTransform:{value:new Ut},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Ut}},envmap:{envMap:{value:null},envMapRotation:{value:new Ut},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Ut}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Ut}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Ut},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Ut},normalScale:{value:new Ee(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Ut},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Ut}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Ut}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Ut}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new rt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new rt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Ut},alphaTest:{value:0},uvTransform:{value:new Ut}},sprite:{diffuse:{value:new rt(16777215)},opacity:{value:1},center:{value:new Ee(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Ut},alphaMap:{value:null},alphaMapTransform:{value:new Ut},alphaTest:{value:0}}},Vs={basic:{uniforms:hr([Ye.common,Ye.specularmap,Ye.envmap,Ye.aomap,Ye.lightmap,Ye.fog]),vertexShader:Gt.meshbasic_vert,fragmentShader:Gt.meshbasic_frag},lambert:{uniforms:hr([Ye.common,Ye.specularmap,Ye.envmap,Ye.aomap,Ye.lightmap,Ye.emissivemap,Ye.bumpmap,Ye.normalmap,Ye.displacementmap,Ye.fog,Ye.lights,{emissive:{value:new rt(0)}}]),vertexShader:Gt.meshlambert_vert,fragmentShader:Gt.meshlambert_frag},phong:{uniforms:hr([Ye.common,Ye.specularmap,Ye.envmap,Ye.aomap,Ye.lightmap,Ye.emissivemap,Ye.bumpmap,Ye.normalmap,Ye.displacementmap,Ye.fog,Ye.lights,{emissive:{value:new rt(0)},specular:{value:new rt(1118481)},shininess:{value:30}}]),vertexShader:Gt.meshphong_vert,fragmentShader:Gt.meshphong_frag},standard:{uniforms:hr([Ye.common,Ye.envmap,Ye.aomap,Ye.lightmap,Ye.emissivemap,Ye.bumpmap,Ye.normalmap,Ye.displacementmap,Ye.roughnessmap,Ye.metalnessmap,Ye.fog,Ye.lights,{emissive:{value:new rt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Gt.meshphysical_vert,fragmentShader:Gt.meshphysical_frag},toon:{uniforms:hr([Ye.common,Ye.aomap,Ye.lightmap,Ye.emissivemap,Ye.bumpmap,Ye.normalmap,Ye.displacementmap,Ye.gradientmap,Ye.fog,Ye.lights,{emissive:{value:new rt(0)}}]),vertexShader:Gt.meshtoon_vert,fragmentShader:Gt.meshtoon_frag},matcap:{uniforms:hr([Ye.common,Ye.bumpmap,Ye.normalmap,Ye.displacementmap,Ye.fog,{matcap:{value:null}}]),vertexShader:Gt.meshmatcap_vert,fragmentShader:Gt.meshmatcap_frag},points:{uniforms:hr([Ye.points,Ye.fog]),vertexShader:Gt.points_vert,fragmentShader:Gt.points_frag},dashed:{uniforms:hr([Ye.common,Ye.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Gt.linedashed_vert,fragmentShader:Gt.linedashed_frag},depth:{uniforms:hr([Ye.common,Ye.displacementmap]),vertexShader:Gt.depth_vert,fragmentShader:Gt.depth_frag},normal:{uniforms:hr([Ye.common,Ye.bumpmap,Ye.normalmap,Ye.displacementmap,{opacity:{value:1}}]),vertexShader:Gt.meshnormal_vert,fragmentShader:Gt.meshnormal_frag},sprite:{uniforms:hr([Ye.sprite,Ye.fog]),vertexShader:Gt.sprite_vert,fragmentShader:Gt.sprite_frag},background:{uniforms:{uvTransform:{value:new Ut},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Gt.background_vert,fragmentShader:Gt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Ut}},vertexShader:Gt.backgroundCube_vert,fragmentShader:Gt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Gt.cube_vert,fragmentShader:Gt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Gt.equirect_vert,fragmentShader:Gt.equirect_frag},distanceRGBA:{uniforms:hr([Ye.common,Ye.displacementmap,{referencePosition:{value:new G},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Gt.distanceRGBA_vert,fragmentShader:Gt.distanceRGBA_frag},shadow:{uniforms:hr([Ye.lights,Ye.fog,{color:{value:new rt(0)},opacity:{value:1}}]),vertexShader:Gt.shadow_vert,fragmentShader:Gt.shadow_frag}};Vs.physical={uniforms:hr([Vs.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Ut},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Ut},clearcoatNormalScale:{value:new Ee(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Ut},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Ut},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Ut},sheen:{value:0},sheenColor:{value:new rt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Ut},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Ut},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Ut},transmissionSamplerSize:{value:new Ee},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Ut},attenuationDistance:{value:0},attenuationColor:{value:new rt(0)},specularColor:{value:new rt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Ut},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Ut},anisotropyVector:{value:new Ee},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Ut}}]),vertexShader:Gt.meshphysical_vert,fragmentShader:Gt.meshphysical_frag};const Iy={r:0,b:0,g:0},fc=new _r,eZ=new St;function tZ(n,e,t,i,r,s,o){const a=new rt(0);let l=s===!0?0:1,c,d,f=null,p=0,m=null;function _(E){let w=E.isScene===!0?E.background:null;return w&&w.isTexture&&(w=(E.backgroundBlurriness>0?t:e).get(w)),w}function S(E){let w=!1;const M=_(E);M===null?y(a,l):M&&M.isColor&&(y(M,1),w=!0);const O=n.xr.getEnvironmentBlendMode();O==="additive"?i.buffers.color.setClear(0,0,0,1,o):O==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,o),(n.autoClear||w)&&(i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil))}function x(E,w){const M=_(w);M&&(M.isCubeTexture||M.mapping===Rd)?(d===void 0&&(d=new ni(new vu(1,1,1),new qs({name:"BackgroundCubeMaterial",uniforms:pd(Vs.backgroundCube.uniforms),vertexShader:Vs.backgroundCube.vertexShader,fragmentShader:Vs.backgroundCube.fragmentShader,side:yr,depthTest:!1,depthWrite:!1,fog:!1})),d.geometry.deleteAttribute("normal"),d.geometry.deleteAttribute("uv"),d.onBeforeRender=function(O,k,I){this.matrixWorld.copyPosition(I.matrixWorld)},Object.defineProperty(d.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(d)),fc.copy(w.backgroundRotation),fc.x*=-1,fc.y*=-1,fc.z*=-1,M.isCubeTexture&&M.isRenderTargetTexture===!1&&(fc.y*=-1,fc.z*=-1),d.material.uniforms.envMap.value=M,d.material.uniforms.flipEnvMap.value=M.isCubeTexture&&M.isRenderTargetTexture===!1?-1:1,d.material.uniforms.backgroundBlurriness.value=w.backgroundBlurriness,d.material.uniforms.backgroundIntensity.value=w.backgroundIntensity,d.material.uniforms.backgroundRotation.value.setFromMatrix4(eZ.makeRotationFromEuler(fc)),d.material.toneMapped=cn.getTransfer(M.colorSpace)!==En,(f!==M||p!==M.version||m!==n.toneMapping)&&(d.material.needsUpdate=!0,f=M,p=M.version,m=n.toneMapping),d.layers.enableAll(),E.unshift(d,d.geometry,d.material,0,0,null)):M&&M.isTexture&&(c===void 0&&(c=new ni(new Ld(2,2),new qs({name:"BackgroundMaterial",uniforms:pd(Vs.background.uniforms),vertexShader:Vs.background.vertexShader,fragmentShader:Vs.background.fragmentShader,side:da,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(c)),c.material.uniforms.t2D.value=M,c.material.uniforms.backgroundIntensity.value=w.backgroundIntensity,c.material.toneMapped=cn.getTransfer(M.colorSpace)!==En,M.matrixAutoUpdate===!0&&M.updateMatrix(),c.material.uniforms.uvTransform.value.copy(M.matrix),(f!==M||p!==M.version||m!==n.toneMapping)&&(c.material.needsUpdate=!0,f=M,p=M.version,m=n.toneMapping),c.layers.enableAll(),E.unshift(c,c.geometry,c.material,0,0,null))}function y(E,w){E.getRGB(Iy,QF(n)),i.buffers.color.setClear(Iy.r,Iy.g,Iy.b,w,o)}return{getClearColor:function(){return a},setClearColor:function(E,w=1){a.set(E),l=w,y(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(E){l=E,y(a,l)},render:S,addToRenderList:x}}function nZ(n,e){const t=n.getParameter(n.MAX_VERTEX_ATTRIBS),i={},r=p(null);let s=r,o=!1;function a(A,R,V,U,se){let le=!1;const ee=f(U,V,R);s!==ee&&(s=ee,c(s.object)),le=m(A,U,V,se),le&&_(A,U,V,se),se!==null&&e.update(se,n.ELEMENT_ARRAY_BUFFER),(le||o)&&(o=!1,M(A,R,V,U),se!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,e.get(se).buffer))}function l(){return n.createVertexArray()}function c(A){return n.bindVertexArray(A)}function d(A){return n.deleteVertexArray(A)}function f(A,R,V){const U=V.wireframe===!0;let se=i[A.id];se===void 0&&(se={},i[A.id]=se);let le=se[R.id];le===void 0&&(le={},se[R.id]=le);let ee=le[U];return ee===void 0&&(ee=p(l()),le[U]=ee),ee}function p(A){const R=[],V=[],U=[];for(let se=0;se=0){const Z=se[W];let oe=le[W];if(oe===void 0&&(W==="instanceMatrix"&&A.instanceMatrix&&(oe=A.instanceMatrix),W==="instanceColor"&&A.instanceColor&&(oe=A.instanceColor)),Z===void 0||Z.attribute!==oe||oe&&Z.data!==oe.data)return!0;ee++}return s.attributesNum!==ee||s.index!==U}function _(A,R,V,U){const se={},le=R.attributes;let ee=0;const pe=V.getAttributes();for(const W in pe)if(pe[W].location>=0){let Z=le[W];Z===void 0&&(W==="instanceMatrix"&&A.instanceMatrix&&(Z=A.instanceMatrix),W==="instanceColor"&&A.instanceColor&&(Z=A.instanceColor));const oe={};oe.attribute=Z,Z&&Z.data&&(oe.data=Z.data),se[W]=oe,ee++}s.attributes=se,s.attributesNum=ee,s.index=U}function S(){const A=s.newAttributes;for(let R=0,V=A.length;R=0){let J=se[pe];if(J===void 0&&(pe==="instanceMatrix"&&A.instanceMatrix&&(J=A.instanceMatrix),pe==="instanceColor"&&A.instanceColor&&(J=A.instanceColor)),J!==void 0){const Z=J.normalized,oe=J.itemSize,Me=e.get(J);if(Me===void 0)continue;const Re=Me.buffer,he=Me.type,we=Me.bytesPerElement,Ne=he===n.INT||he===n.UNSIGNED_INT||J.gpuType===ox;if(J.isInterleavedBufferAttribute){const be=J.data,ft=be.stride,dt=J.offset;if(be.isInstancedInterleavedBuffer){for(let Ke=0;Ke0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";I="mediump"}return I==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=t.precision!==void 0?t.precision:"highp";const d=l(c);d!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",d,"instead."),c=d);const f=t.logarithmicDepthBuffer===!0,p=t.reverseDepthBuffer===!0&&e.has("EXT_clip_control");if(p===!0){const I=e.get("EXT_clip_control");I.clipControlEXT(I.LOWER_LEFT_EXT,I.ZERO_TO_ONE_EXT)}const m=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),_=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),S=n.getParameter(n.MAX_TEXTURE_SIZE),x=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),y=n.getParameter(n.MAX_VERTEX_ATTRIBS),E=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),w=n.getParameter(n.MAX_VARYING_VECTORS),M=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),O=_>0,k=n.getParameter(n.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:l,textureFormatReadable:o,textureTypeReadable:a,precision:c,logarithmicDepthBuffer:f,reverseDepthBuffer:p,maxTextures:m,maxVertexTextures:_,maxTextureSize:S,maxCubemapSize:x,maxAttributes:y,maxVertexUniforms:E,maxVaryings:w,maxFragmentUniforms:M,vertexTextures:O,maxSamples:k}}function sZ(n){const e=this;let t=null,i=0,r=!1,s=!1;const o=new Wo,a=new Ut,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(f,p){const m=f.length!==0||p||i!==0||r;return r=p,i=f.length,m},this.beginShadows=function(){s=!0,d(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(f,p){t=d(f,p,0)},this.setState=function(f,p,m){const _=f.clippingPlanes,S=f.clipIntersection,x=f.clipShadows,y=n.get(f);if(!r||_===null||_.length===0||s&&!x)s?d(null):c();else{const E=s?0:i,w=E*4;let M=y.clippingState||null;l.value=M,M=d(_,p,w,m);for(let O=0;O!==w;++O)M[O]=t[O];y.clippingState=M,this.numIntersection=S?this.numPlanes:0,this.numPlanes+=E}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function d(f,p,m,_){const S=f!==null?f.length:0;let x=null;if(S!==0){if(x=l.value,_!==!0||x===null){const y=m+S*4,E=p.matrixWorldInverse;a.getNormalMatrix(E),(x===null||x.length0){const c=new JM(l.height);return c.fromEquirectangularTexture(n,o),e.set(o,c),o.addEventListener("dispose",r),t(c.texture,o.mapping)}else return null}}return o}function r(o){const a=o.target;a.removeEventListener("dispose",r);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function s(){e=new WeakMap}return{get:i,dispose:s}}class zs extends Hm{constructor(e=-1,t=1,i=1,r=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=r,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,i,r,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let s=i-e,o=i+e,a=r+t,l=r-t;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,d=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,o=s+c*this.view.width,a-=d*this.view.offsetY,l=a-d*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}const Ih=4,z2=[.125,.215,.35,.446,.526,.582],Ic=20,Qw=new zs,H2=new rt;let Jw=null,Zw=0,e1=0,t1=!1;const Rc=(1+Math.sqrt(5))/2,th=1/Rc,G2=[new G(-Rc,th,0),new G(Rc,th,0),new G(-th,0,Rc),new G(th,0,Rc),new G(0,Rc,-th),new G(0,Rc,th),new G(-1,1,-1),new G(1,1,-1),new G(-1,1,1),new G(1,1,1)];class yT{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,r=100){Jw=this._renderer.getRenderTarget(),Zw=this._renderer.getActiveCubeFace(),e1=this._renderer.getActiveMipmapLevel(),t1=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,i,r,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=X2(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=j2(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?w:0,w,w),d.setRenderTarget(r),S&&d.render(_,a),d.render(e,a)}_.geometry.dispose(),_.material.dispose(),d.toneMapping=p,d.autoClear=f,e.background=x}_textureToCubeUV(e,t){const i=this._renderer,r=e.mapping===fa||e.mapping===Rl;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=X2()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=j2());const s=r?this._cubemapMaterial:this._equirectMaterial,o=new ni(this._lodPlanes[0],s),a=s.uniforms;a.envMap.value=e;const l=this._cubeSize;Ly(t,0,0,3*l,2*l),i.setRenderTarget(t),i.render(o,Qw)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;const r=this._lodPlanes.length;for(let s=1;sIc&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${x} samples when the maximum is set to ${Ic}`);const y=[];let E=0;for(let I=0;Iw-Ih?r-w+Ih:0),k=4*(this._cubeSize-M);Ly(t,O,k,3*M,2*M),l.setRenderTarget(t),l.render(f,Qw)}}function aZ(n){const e=[],t=[],i=[];let r=n;const s=n-Ih+1+z2.length;for(let o=0;on-Ih?l=z2[o-n+Ih-1]:o===0&&(l=0),i.push(l);const c=1/(a-2),d=-c,f=1+c,p=[d,d,f,d,f,f,d,d,f,f,d,f],m=6,_=6,S=3,x=2,y=1,E=new Float32Array(S*_*m),w=new Float32Array(x*_*m),M=new Float32Array(y*_*m);for(let k=0;k2?0:-1,D=[I,P,0,I+2/3,P,0,I+2/3,P+1,0,I,P,0,I+2/3,P+1,0,I,P+1,0];E.set(D,S*_*k),w.set(p,x*_*k);const A=[k,k,k,k,k,k];M.set(A,y*_*k)}const O=new Vt;O.setAttribute("position",new vn(E,S)),O.setAttribute("uv",new vn(w,x)),O.setAttribute("faceIndex",new vn(M,y)),e.push(O),r>Ih&&r--}return{lodPlanes:e,sizeLods:t,sigmas:i}}function W2(n,e,t){const i=new Xs(n,e,t);return i.texture.mapping=Rd,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function Ly(n,e,t,i,r){n.viewport.set(e,t,i,r),n.scissor.set(e,t,i,r)}function lZ(n,e,t){const i=new Float32Array(Ic),r=new G(0,1,0);return new qs({name:"SphericalGaussianBlur",defines:{n:Ic,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:ZM(),fragmentShader:` +}`,Gt={alphahash_fragment:SK,alphahash_pars_fragment:wK,alphamap_fragment:EK,alphamap_pars_fragment:TK,alphatest_fragment:AK,alphatest_pars_fragment:MK,aomap_fragment:CK,aomap_pars_fragment:bK,batching_pars_vertex:PK,batching_vertex:RK,begin_vertex:IK,beginnormal_vertex:LK,bsdfs:NK,iridescence_fragment:DK,bumpmap_pars_fragment:kK,clipping_planes_fragment:OK,clipping_planes_pars_fragment:UK,clipping_planes_pars_vertex:FK,clipping_planes_vertex:VK,color_fragment:BK,color_pars_fragment:zK,color_pars_vertex:HK,color_vertex:GK,common:WK,cube_uv_reflection_fragment:jK,defaultnormal_vertex:XK,displacementmap_pars_vertex:qK,displacementmap_vertex:$K,emissivemap_fragment:YK,emissivemap_pars_fragment:KK,colorspace_fragment:QK,colorspace_pars_fragment:JK,envmap_fragment:ZK,envmap_common_pars_fragment:eQ,envmap_pars_fragment:tQ,envmap_pars_vertex:nQ,envmap_physical_pars_fragment:fQ,envmap_vertex:iQ,fog_vertex:rQ,fog_pars_vertex:sQ,fog_fragment:oQ,fog_pars_fragment:aQ,gradientmap_pars_fragment:lQ,lightmap_pars_fragment:cQ,lights_lambert_fragment:uQ,lights_lambert_pars_fragment:hQ,lights_pars_begin:dQ,lights_toon_fragment:pQ,lights_toon_pars_fragment:mQ,lights_phong_fragment:gQ,lights_phong_pars_fragment:yQ,lights_physical_fragment:vQ,lights_physical_pars_fragment:_Q,lights_fragment_begin:xQ,lights_fragment_maps:SQ,lights_fragment_end:wQ,logdepthbuf_fragment:EQ,logdepthbuf_pars_fragment:TQ,logdepthbuf_pars_vertex:AQ,logdepthbuf_vertex:MQ,map_fragment:CQ,map_pars_fragment:bQ,map_particle_fragment:PQ,map_particle_pars_fragment:RQ,metalnessmap_fragment:IQ,metalnessmap_pars_fragment:LQ,morphinstance_vertex:NQ,morphcolor_vertex:DQ,morphnormal_vertex:kQ,morphtarget_pars_vertex:OQ,morphtarget_vertex:UQ,normal_fragment_begin:FQ,normal_fragment_maps:VQ,normal_pars_fragment:BQ,normal_pars_vertex:zQ,normal_vertex:HQ,normalmap_pars_fragment:GQ,clearcoat_normal_fragment_begin:WQ,clearcoat_normal_fragment_maps:jQ,clearcoat_pars_fragment:XQ,iridescence_pars_fragment:qQ,opaque_fragment:$Q,packing:YQ,premultiplied_alpha_fragment:KQ,project_vertex:QQ,dithering_fragment:JQ,dithering_pars_fragment:ZQ,roughnessmap_fragment:eJ,roughnessmap_pars_fragment:tJ,shadowmap_pars_fragment:nJ,shadowmap_pars_vertex:iJ,shadowmap_vertex:rJ,shadowmask_pars_fragment:sJ,skinbase_vertex:oJ,skinning_pars_vertex:aJ,skinning_vertex:lJ,skinnormal_vertex:cJ,specularmap_fragment:uJ,specularmap_pars_fragment:hJ,tonemapping_fragment:dJ,tonemapping_pars_fragment:fJ,transmission_fragment:pJ,transmission_pars_fragment:mJ,uv_pars_fragment:gJ,uv_pars_vertex:yJ,uv_vertex:vJ,worldpos_vertex:_J,background_vert:xJ,background_frag:SJ,backgroundCube_vert:wJ,backgroundCube_frag:EJ,cube_vert:TJ,cube_frag:AJ,depth_vert:MJ,depth_frag:CJ,distanceRGBA_vert:bJ,distanceRGBA_frag:PJ,equirect_vert:RJ,equirect_frag:IJ,linedashed_vert:LJ,linedashed_frag:NJ,meshbasic_vert:DJ,meshbasic_frag:kJ,meshlambert_vert:OJ,meshlambert_frag:UJ,meshmatcap_vert:FJ,meshmatcap_frag:VJ,meshnormal_vert:BJ,meshnormal_frag:zJ,meshphong_vert:HJ,meshphong_frag:GJ,meshphysical_vert:WJ,meshphysical_frag:jJ,meshtoon_vert:XJ,meshtoon_frag:qJ,points_vert:$J,points_frag:YJ,shadow_vert:KJ,shadow_frag:QJ,sprite_vert:JJ,sprite_frag:ZJ},Ye={common:{diffuse:{value:new rt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Ut},alphaMap:{value:null},alphaMapTransform:{value:new Ut},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Ut}},envmap:{envMap:{value:null},envMapRotation:{value:new Ut},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Ut}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Ut}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Ut},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Ut},normalScale:{value:new Ee(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Ut},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Ut}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Ut}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Ut}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new rt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new rt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Ut},alphaTest:{value:0},uvTransform:{value:new Ut}},sprite:{diffuse:{value:new rt(16777215)},opacity:{value:1},center:{value:new Ee(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Ut},alphaMap:{value:null},alphaMapTransform:{value:new Ut},alphaTest:{value:0}}},Vs={basic:{uniforms:hr([Ye.common,Ye.specularmap,Ye.envmap,Ye.aomap,Ye.lightmap,Ye.fog]),vertexShader:Gt.meshbasic_vert,fragmentShader:Gt.meshbasic_frag},lambert:{uniforms:hr([Ye.common,Ye.specularmap,Ye.envmap,Ye.aomap,Ye.lightmap,Ye.emissivemap,Ye.bumpmap,Ye.normalmap,Ye.displacementmap,Ye.fog,Ye.lights,{emissive:{value:new rt(0)}}]),vertexShader:Gt.meshlambert_vert,fragmentShader:Gt.meshlambert_frag},phong:{uniforms:hr([Ye.common,Ye.specularmap,Ye.envmap,Ye.aomap,Ye.lightmap,Ye.emissivemap,Ye.bumpmap,Ye.normalmap,Ye.displacementmap,Ye.fog,Ye.lights,{emissive:{value:new rt(0)},specular:{value:new rt(1118481)},shininess:{value:30}}]),vertexShader:Gt.meshphong_vert,fragmentShader:Gt.meshphong_frag},standard:{uniforms:hr([Ye.common,Ye.envmap,Ye.aomap,Ye.lightmap,Ye.emissivemap,Ye.bumpmap,Ye.normalmap,Ye.displacementmap,Ye.roughnessmap,Ye.metalnessmap,Ye.fog,Ye.lights,{emissive:{value:new rt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Gt.meshphysical_vert,fragmentShader:Gt.meshphysical_frag},toon:{uniforms:hr([Ye.common,Ye.aomap,Ye.lightmap,Ye.emissivemap,Ye.bumpmap,Ye.normalmap,Ye.displacementmap,Ye.gradientmap,Ye.fog,Ye.lights,{emissive:{value:new rt(0)}}]),vertexShader:Gt.meshtoon_vert,fragmentShader:Gt.meshtoon_frag},matcap:{uniforms:hr([Ye.common,Ye.bumpmap,Ye.normalmap,Ye.displacementmap,Ye.fog,{matcap:{value:null}}]),vertexShader:Gt.meshmatcap_vert,fragmentShader:Gt.meshmatcap_frag},points:{uniforms:hr([Ye.points,Ye.fog]),vertexShader:Gt.points_vert,fragmentShader:Gt.points_frag},dashed:{uniforms:hr([Ye.common,Ye.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Gt.linedashed_vert,fragmentShader:Gt.linedashed_frag},depth:{uniforms:hr([Ye.common,Ye.displacementmap]),vertexShader:Gt.depth_vert,fragmentShader:Gt.depth_frag},normal:{uniforms:hr([Ye.common,Ye.bumpmap,Ye.normalmap,Ye.displacementmap,{opacity:{value:1}}]),vertexShader:Gt.meshnormal_vert,fragmentShader:Gt.meshnormal_frag},sprite:{uniforms:hr([Ye.sprite,Ye.fog]),vertexShader:Gt.sprite_vert,fragmentShader:Gt.sprite_frag},background:{uniforms:{uvTransform:{value:new Ut},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Gt.background_vert,fragmentShader:Gt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Ut}},vertexShader:Gt.backgroundCube_vert,fragmentShader:Gt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Gt.cube_vert,fragmentShader:Gt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Gt.equirect_vert,fragmentShader:Gt.equirect_frag},distanceRGBA:{uniforms:hr([Ye.common,Ye.displacementmap,{referencePosition:{value:new G},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Gt.distanceRGBA_vert,fragmentShader:Gt.distanceRGBA_frag},shadow:{uniforms:hr([Ye.lights,Ye.fog,{color:{value:new rt(0)},opacity:{value:1}}]),vertexShader:Gt.shadow_vert,fragmentShader:Gt.shadow_frag}};Vs.physical={uniforms:hr([Vs.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Ut},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Ut},clearcoatNormalScale:{value:new Ee(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Ut},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Ut},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Ut},sheen:{value:0},sheenColor:{value:new rt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Ut},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Ut},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Ut},transmissionSamplerSize:{value:new Ee},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Ut},attenuationDistance:{value:0},attenuationColor:{value:new rt(0)},specularColor:{value:new rt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Ut},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Ut},anisotropyVector:{value:new Ee},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Ut}}]),vertexShader:Gt.meshphysical_vert,fragmentShader:Gt.meshphysical_frag};const Iy={r:0,b:0,g:0},fc=new _r,eZ=new St;function tZ(n,e,t,i,r,s,o){const a=new rt(0);let l=s===!0?0:1,c,d,f=null,p=0,m=null;function _(E){let w=E.isScene===!0?E.background:null;return w&&w.isTexture&&(w=(E.backgroundBlurriness>0?t:e).get(w)),w}function S(E){let w=!1;const M=_(E);M===null?y(a,l):M&&M.isColor&&(y(M,1),w=!0);const O=n.xr.getEnvironmentBlendMode();O==="additive"?i.buffers.color.setClear(0,0,0,1,o):O==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,o),(n.autoClear||w)&&(i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil))}function x(E,w){const M=_(w);M&&(M.isCubeTexture||M.mapping===Rd)?(d===void 0&&(d=new ni(new vu(1,1,1),new qs({name:"BackgroundCubeMaterial",uniforms:pd(Vs.backgroundCube.uniforms),vertexShader:Vs.backgroundCube.vertexShader,fragmentShader:Vs.backgroundCube.fragmentShader,side:yr,depthTest:!1,depthWrite:!1,fog:!1})),d.geometry.deleteAttribute("normal"),d.geometry.deleteAttribute("uv"),d.onBeforeRender=function(O,k,I){this.matrixWorld.copyPosition(I.matrixWorld)},Object.defineProperty(d.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(d)),fc.copy(w.backgroundRotation),fc.x*=-1,fc.y*=-1,fc.z*=-1,M.isCubeTexture&&M.isRenderTargetTexture===!1&&(fc.y*=-1,fc.z*=-1),d.material.uniforms.envMap.value=M,d.material.uniforms.flipEnvMap.value=M.isCubeTexture&&M.isRenderTargetTexture===!1?-1:1,d.material.uniforms.backgroundBlurriness.value=w.backgroundBlurriness,d.material.uniforms.backgroundIntensity.value=w.backgroundIntensity,d.material.uniforms.backgroundRotation.value.setFromMatrix4(eZ.makeRotationFromEuler(fc)),d.material.toneMapped=cn.getTransfer(M.colorSpace)!==En,(f!==M||p!==M.version||m!==n.toneMapping)&&(d.material.needsUpdate=!0,f=M,p=M.version,m=n.toneMapping),d.layers.enableAll(),E.unshift(d,d.geometry,d.material,0,0,null)):M&&M.isTexture&&(c===void 0&&(c=new ni(new Ld(2,2),new qs({name:"BackgroundMaterial",uniforms:pd(Vs.background.uniforms),vertexShader:Vs.background.vertexShader,fragmentShader:Vs.background.fragmentShader,side:da,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(c)),c.material.uniforms.t2D.value=M,c.material.uniforms.backgroundIntensity.value=w.backgroundIntensity,c.material.toneMapped=cn.getTransfer(M.colorSpace)!==En,M.matrixAutoUpdate===!0&&M.updateMatrix(),c.material.uniforms.uvTransform.value.copy(M.matrix),(f!==M||p!==M.version||m!==n.toneMapping)&&(c.material.needsUpdate=!0,f=M,p=M.version,m=n.toneMapping),c.layers.enableAll(),E.unshift(c,c.geometry,c.material,0,0,null))}function y(E,w){E.getRGB(Iy,JF(n)),i.buffers.color.setClear(Iy.r,Iy.g,Iy.b,w,o)}return{getClearColor:function(){return a},setClearColor:function(E,w=1){a.set(E),l=w,y(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(E){l=E,y(a,l)},render:S,addToRenderList:x}}function nZ(n,e){const t=n.getParameter(n.MAX_VERTEX_ATTRIBS),i={},r=p(null);let s=r,o=!1;function a(A,R,V,U,se){let le=!1;const ee=f(U,V,R);s!==ee&&(s=ee,c(s.object)),le=m(A,U,V,se),le&&_(A,U,V,se),se!==null&&e.update(se,n.ELEMENT_ARRAY_BUFFER),(le||o)&&(o=!1,M(A,R,V,U),se!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,e.get(se).buffer))}function l(){return n.createVertexArray()}function c(A){return n.bindVertexArray(A)}function d(A){return n.deleteVertexArray(A)}function f(A,R,V){const U=V.wireframe===!0;let se=i[A.id];se===void 0&&(se={},i[A.id]=se);let le=se[R.id];le===void 0&&(le={},se[R.id]=le);let ee=le[U];return ee===void 0&&(ee=p(l()),le[U]=ee),ee}function p(A){const R=[],V=[],U=[];for(let se=0;se=0){const Z=se[W];let oe=le[W];if(oe===void 0&&(W==="instanceMatrix"&&A.instanceMatrix&&(oe=A.instanceMatrix),W==="instanceColor"&&A.instanceColor&&(oe=A.instanceColor)),Z===void 0||Z.attribute!==oe||oe&&Z.data!==oe.data)return!0;ee++}return s.attributesNum!==ee||s.index!==U}function _(A,R,V,U){const se={},le=R.attributes;let ee=0;const pe=V.getAttributes();for(const W in pe)if(pe[W].location>=0){let Z=le[W];Z===void 0&&(W==="instanceMatrix"&&A.instanceMatrix&&(Z=A.instanceMatrix),W==="instanceColor"&&A.instanceColor&&(Z=A.instanceColor));const oe={};oe.attribute=Z,Z&&Z.data&&(oe.data=Z.data),se[W]=oe,ee++}s.attributes=se,s.attributesNum=ee,s.index=U}function S(){const A=s.newAttributes;for(let R=0,V=A.length;R=0){let J=se[pe];if(J===void 0&&(pe==="instanceMatrix"&&A.instanceMatrix&&(J=A.instanceMatrix),pe==="instanceColor"&&A.instanceColor&&(J=A.instanceColor)),J!==void 0){const Z=J.normalized,oe=J.itemSize,Me=e.get(J);if(Me===void 0)continue;const Re=Me.buffer,he=Me.type,we=Me.bytesPerElement,Ne=he===n.INT||he===n.UNSIGNED_INT||J.gpuType===ox;if(J.isInterleavedBufferAttribute){const be=J.data,ft=be.stride,dt=J.offset;if(be.isInstancedInterleavedBuffer){for(let Ke=0;Ke0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";I="mediump"}return I==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=t.precision!==void 0?t.precision:"highp";const d=l(c);d!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",d,"instead."),c=d);const f=t.logarithmicDepthBuffer===!0,p=t.reverseDepthBuffer===!0&&e.has("EXT_clip_control");if(p===!0){const I=e.get("EXT_clip_control");I.clipControlEXT(I.LOWER_LEFT_EXT,I.ZERO_TO_ONE_EXT)}const m=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),_=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),S=n.getParameter(n.MAX_TEXTURE_SIZE),x=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),y=n.getParameter(n.MAX_VERTEX_ATTRIBS),E=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),w=n.getParameter(n.MAX_VARYING_VECTORS),M=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),O=_>0,k=n.getParameter(n.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:l,textureFormatReadable:o,textureTypeReadable:a,precision:c,logarithmicDepthBuffer:f,reverseDepthBuffer:p,maxTextures:m,maxVertexTextures:_,maxTextureSize:S,maxCubemapSize:x,maxAttributes:y,maxVertexUniforms:E,maxVaryings:w,maxFragmentUniforms:M,vertexTextures:O,maxSamples:k}}function sZ(n){const e=this;let t=null,i=0,r=!1,s=!1;const o=new Wo,a=new Ut,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(f,p){const m=f.length!==0||p||i!==0||r;return r=p,i=f.length,m},this.beginShadows=function(){s=!0,d(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(f,p){t=d(f,p,0)},this.setState=function(f,p,m){const _=f.clippingPlanes,S=f.clipIntersection,x=f.clipShadows,y=n.get(f);if(!r||_===null||_.length===0||s&&!x)s?d(null):c();else{const E=s?0:i,w=E*4;let M=y.clippingState||null;l.value=M,M=d(_,p,w,m);for(let O=0;O!==w;++O)M[O]=t[O];y.clippingState=M,this.numIntersection=S?this.numPlanes:0,this.numPlanes+=E}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function d(f,p,m,_){const S=f!==null?f.length:0;let x=null;if(S!==0){if(x=l.value,_!==!0||x===null){const y=m+S*4,E=p.matrixWorldInverse;a.getNormalMatrix(E),(x===null||x.length0){const c=new JM(l.height);return c.fromEquirectangularTexture(n,o),e.set(o,c),o.addEventListener("dispose",r),t(c.texture,o.mapping)}else return null}}return o}function r(o){const a=o.target;a.removeEventListener("dispose",r);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function s(){e=new WeakMap}return{get:i,dispose:s}}class zs extends Hm{constructor(e=-1,t=1,i=1,r=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=r,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,i,r,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let s=i-e,o=i+e,a=r+t,l=r-t;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,d=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,o=s+c*this.view.width,a-=d*this.view.offsetY,l=a-d*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}const Ih=4,z2=[.125,.215,.35,.446,.526,.582],Ic=20,Qw=new zs,H2=new rt;let Jw=null,Zw=0,e1=0,t1=!1;const Rc=(1+Math.sqrt(5))/2,th=1/Rc,G2=[new G(-Rc,th,0),new G(Rc,th,0),new G(-th,0,Rc),new G(th,0,Rc),new G(0,Rc,-th),new G(0,Rc,th),new G(-1,1,-1),new G(1,1,-1),new G(-1,1,1),new G(1,1,1)];class yT{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,r=100){Jw=this._renderer.getRenderTarget(),Zw=this._renderer.getActiveCubeFace(),e1=this._renderer.getActiveMipmapLevel(),t1=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,i,r,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=X2(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=j2(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?w:0,w,w),d.setRenderTarget(r),S&&d.render(_,a),d.render(e,a)}_.geometry.dispose(),_.material.dispose(),d.toneMapping=p,d.autoClear=f,e.background=x}_textureToCubeUV(e,t){const i=this._renderer,r=e.mapping===fa||e.mapping===Rl;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=X2()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=j2());const s=r?this._cubemapMaterial:this._equirectMaterial,o=new ni(this._lodPlanes[0],s),a=s.uniforms;a.envMap.value=e;const l=this._cubeSize;Ly(t,0,0,3*l,2*l),i.setRenderTarget(t),i.render(o,Qw)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;const r=this._lodPlanes.length;for(let s=1;sIc&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${x} samples when the maximum is set to ${Ic}`);const y=[];let E=0;for(let I=0;Iw-Ih?r-w+Ih:0),k=4*(this._cubeSize-M);Ly(t,O,k,3*M,2*M),l.setRenderTarget(t),l.render(f,Qw)}}function aZ(n){const e=[],t=[],i=[];let r=n;const s=n-Ih+1+z2.length;for(let o=0;on-Ih?l=z2[o-n+Ih-1]:o===0&&(l=0),i.push(l);const c=1/(a-2),d=-c,f=1+c,p=[d,d,f,d,f,f,d,d,f,f,d,f],m=6,_=6,S=3,x=2,y=1,E=new Float32Array(S*_*m),w=new Float32Array(x*_*m),M=new Float32Array(y*_*m);for(let k=0;k2?0:-1,D=[I,P,0,I+2/3,P,0,I+2/3,P+1,0,I,P,0,I+2/3,P+1,0,I,P+1,0];E.set(D,S*_*k),w.set(p,x*_*k);const A=[k,k,k,k,k,k];M.set(A,y*_*k)}const O=new Vt;O.setAttribute("position",new vn(E,S)),O.setAttribute("uv",new vn(w,x)),O.setAttribute("faceIndex",new vn(M,y)),e.push(O),r>Ih&&r--}return{lodPlanes:e,sizeLods:t,sigmas:i}}function W2(n,e,t){const i=new Xs(n,e,t);return i.texture.mapping=Rd,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function Ly(n,e,t,i,r){n.viewport.set(e,t,i,r),n.scissor.set(e,t,i,r)}function lZ(n,e,t){const i=new Float32Array(Ic),r=new G(0,1,0);return new qs({name:"SphericalGaussianBlur",defines:{n:Ic,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:ZM(),fragmentShader:` precision mediump float; precision mediump int; @@ -5690,13 +5690,13 @@ void main() { gl_Position = vec4( position, 1.0 ); } - `}function cZ(n){let e=new WeakMap,t=null;function i(a){if(a&&a.isTexture){const l=a.mapping,c=l===Jp||l===Zp,d=l===fa||l===Rl;if(c||d){let f=e.get(a);const p=f!==void 0?f.texture.pmremVersion:0;if(a.isRenderTargetTexture&&a.pmremVersion!==p)return t===null&&(t=new yT(n)),f=c?t.fromEquirectangular(a,f):t.fromCubemap(a,f),f.texture.pmremVersion=a.pmremVersion,e.set(a,f),f.texture;if(f!==void 0)return f.texture;{const m=a.image;return c&&m&&m.height>0||d&&m&&r(m)?(t===null&&(t=new yT(n)),f=c?t.fromEquirectangular(a):t.fromCubemap(a),f.texture.pmremVersion=a.pmremVersion,e.set(a,f),a.addEventListener("dispose",s),f.texture):null}}}return a}function r(a){let l=0;const c=6;for(let d=0;de.maxTextureSize&&(k=Math.ceil(O/e.maxTextureSize),O=e.maxTextureSize);const I=new Float32Array(O*k*4*f),P=new px(I,O,k,f);P.type=kr,P.needsUpdate=!0;const D=M*4;for(let R=0;R0)return n;const r=e*t;let s=$2[r];if(s===void 0&&(s=new Float32Array(r),$2[r]=s),e!==0){i.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=t,n[o].toArray(s,a)}return s}function vi(n,e){if(n.length!==e.length)return!1;for(let t=0,i=n.length;t0||d&&m&&r(m)?(t===null&&(t=new yT(n)),f=c?t.fromEquirectangular(a):t.fromCubemap(a),f.texture.pmremVersion=a.pmremVersion,e.set(a,f),a.addEventListener("dispose",s),f.texture):null}}}return a}function r(a){let l=0;const c=6;for(let d=0;de.maxTextureSize&&(k=Math.ceil(O/e.maxTextureSize),O=e.maxTextureSize);const I=new Float32Array(O*k*4*f),P=new px(I,O,k,f);P.type=kr,P.needsUpdate=!0;const D=M*4;for(let R=0;R0)return n;const r=e*t;let s=$2[r];if(s===void 0&&(s=new Float32Array(r),$2[r]=s),e!==0){i.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=t,n[o].toArray(s,a)}return s}function vi(n,e){if(n.length!==e.length)return!1;for(let t=0,i=n.length;t":" "} ${a}: ${t[o]}`)}return i.join(` `)}function cee(n){const e=cn.getPrimaries(cn.workingColorSpace),t=cn.getPrimaries(n);let i;switch(e===t?i="":e===om&&t===sm?i="LinearDisplayP3ToLinearSRGB":e===sm&&t===om&&(i="LinearSRGBToLinearDisplayP3"),n){case xa:case zm:return[i,"LinearTransferOETF"];case _s:case fx:return[i,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",n),[i,"LinearTransferOETF"]}}function tL(n,e,t){const i=n.getShaderParameter(e,n.COMPILE_STATUS),r=n.getShaderInfoLog(e).trim();if(i&&r==="")return"";const s=/ERROR: 0:(\d+)/.exec(r);if(s){const o=parseInt(s[1]);return t.toUpperCase()+` `+r+` -`+lee(n.getShaderSource(e),o)}else return r}function uee(n,e){const t=cee(e);return`vec4 ${n}( vec4 value ) { return ${t[0]}( ${t[1]}( value ) ); }`}function hee(n,e){let t;switch(e){case AF:t="Linear";break;case MF:t="Reinhard";break;case CF:t="Cineon";break;case DM:t="ACESFilmic";break;case PF:t="AgX";break;case RF:t="Neutral";break;case bF:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}const Ny=new G;function dee(){cn.getLuminanceCoefficients(Ny);const n=Ny.x.toFixed(4),e=Ny.y.toFixed(4),t=Ny.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${n}, ${e}, ${t} );`," return dot( weights, rgb );","}"].join(` +`+lee(n.getShaderSource(e),o)}else return r}function uee(n,e){const t=cee(e);return`vec4 ${n}( vec4 value ) { return ${t[0]}( ${t[1]}( value ) ); }`}function hee(n,e){let t;switch(e){case MF:t="Linear";break;case CF:t="Reinhard";break;case bF:t="Cineon";break;case DM:t="ACESFilmic";break;case RF:t="AgX";break;case IF:t="Neutral";break;case PF:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}const Ny=new G;function dee(){cn.getLuminanceCoefficients(Ny);const n=Ny.x.toFixed(4),e=Ny.y.toFixed(4),t=Ny.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${n}, ${e}, ${t} );`," return dot( weights, rgb );","}"].join(` `)}function fee(n){return[n.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",n.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Kf).join(` `)}function pee(n){const e=[];for(const t in n){const i=n[t];i!==!1&&e.push("#define "+t+" "+i)}return e.join(` `)}function mee(n,e){const t={},i=n.getProgramParameter(e,n.ACTIVE_ATTRIBUTES);for(let r=0;r/gm;function vT(n){return n.replace(gee,vee)}const yee=new Map;function vee(n,e){let t=Gt[e];if(t===void 0){const i=yee.get(e);if(i!==void 0)t=Gt[i],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,i);else throw new Error("Can not resolve #include <"+e+">")}return vT(t)}const _ee=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function rL(n){return n.replace(_ee,xee)}function xee(n,e,t,i){let r="";for(let s=parseInt(e);s0&&(x+=` `),y=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,_].filter(Kf).join(` @@ -5740,7 +5740,7 @@ Material Type: `+R.type+` Program Info Log: `+V+` `+pe+` -`+W)}else V!==""?console.warn("THREE.WebGLProgram: Program Info Log:",V):(U===""||se==="")&&(ee=!1);ee&&(R.diagnostics={runnable:le,programLog:V,vertexShader:{log:U,prefix:x},fragmentShader:{log:se,prefix:y}})}r.deleteShader(O),r.deleteShader(k),P=new Pv(r,S),D=mee(r,S)}let P;this.getUniforms=function(){return P===void 0&&I(this),P};let D;this.getAttributes=function(){return D===void 0&&I(this),D};let A=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return A===!1&&(A=r.getProgramParameter(S,oee)),A},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(S),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=aee++,this.cacheKey=e,this.usedTimes=1,this.program=S,this.vertexShader=O,this.fragmentShader=k,this}let Cee=0;class bee{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,i=e.fragmentShader,r=this._getShaderStage(t),s=this._getShaderStage(i),o=this._getShaderCacheForMaterial(e);return o.has(r)===!1&&(o.add(r),r.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const i of t)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let i=t.get(e);return i===void 0&&(i=new Set,t.set(e,i)),i}_getShaderStage(e){const t=this.shaderCache;let i=t.get(e);return i===void 0&&(i=new Pee(e),t.set(e,i)),i}}class Pee{constructor(e){this.id=Cee++,this.code=e,this.usedTimes=0}}function Ree(n,e,t,i,r,s,o){const a=new Kc,l=new bee,c=new Set,d=[],f=r.logarithmicDepthBuffer,p=r.reverseDepthBuffer,m=r.vertexTextures;let _=r.precision;const S={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function x(A){return c.add(A),A===0?"uv":`uv${A}`}function y(A,R,V,U,se){const le=U.fog,ee=se.geometry,pe=A.isMeshStandardMaterial?U.environment:null,W=(A.isMeshStandardMaterial?t:e).get(A.envMap||pe),J=W&&W.mapping===Rd?W.image.height:null,Z=S[A.type];A.precision!==null&&(_=r.getMaxPrecision(A.precision),_!==A.precision&&console.warn("THREE.WebGLProgram.getParameters:",A.precision,"not supported, using",_,"instead."));const oe=ee.morphAttributes.position||ee.morphAttributes.normal||ee.morphAttributes.color,Me=oe!==void 0?oe.length:0;let Re=0;ee.morphAttributes.position!==void 0&&(Re=1),ee.morphAttributes.normal!==void 0&&(Re=2),ee.morphAttributes.color!==void 0&&(Re=3);let he,we,Ne,be;if(Z){const Sn=Vs[Z];he=Sn.vertexShader,we=Sn.fragmentShader}else he=A.vertexShader,we=A.fragmentShader,l.update(A),Ne=l.getVertexShaderID(A),be=l.getFragmentShaderID(A);const ft=n.getRenderTarget(),dt=se.isInstancedMesh===!0,Ke=se.isBatchedMesh===!0,ke=!!A.map,xe=!!A.matcap,j=!!W,Ve=!!A.aoMap,Oe=!!A.lightMap,Pe=!!A.bumpMap,Ue=!!A.normalMap,lt=!!A.displacementMap,We=!!A.emissiveMap,X=!!A.metalnessMap,F=!!A.roughnessMap,ae=A.anisotropy>0,_e=A.clearcoat>0,Te=A.dispersion>0,Se=A.iridescence>0,nt=A.sheen>0,Ce=A.transmission>0,Ge=ae&&!!A.anisotropyMap,Lt=_e&&!!A.clearcoatMap,Le=_e&&!!A.clearcoatNormalMap,Ze=_e&&!!A.clearcoatRoughnessMap,Et=Se&&!!A.iridescenceMap,vt=Se&&!!A.iridescenceThicknessMap,et=nt&&!!A.sheenColorMap,K=nt&&!!A.sheenRoughnessMap,ve=!!A.specularMap,je=!!A.specularColorMap,Y=!!A.specularIntensityMap,Fe=Ce&&!!A.transmissionMap,me=Ce&&!!A.thicknessMap,Ae=!!A.gradientMap,Xe=!!A.alphaMap,$e=A.alphaTest>0,At=!!A.alphaHash,Bt=!!A.extensions;let Cn=vo;A.toneMapped&&(ft===null||ft.isXRRenderTarget===!0)&&(Cn=n.toneMapping);const It={shaderID:Z,shaderType:A.type,shaderName:A.name,vertexShader:he,fragmentShader:we,defines:A.defines,customVertexShaderID:Ne,customFragmentShaderID:be,isRawShaderMaterial:A.isRawShaderMaterial===!0,glslVersion:A.glslVersion,precision:_,batching:Ke,batchingColor:Ke&&se._colorsTexture!==null,instancing:dt,instancingColor:dt&&se.instanceColor!==null,instancingMorph:dt&&se.morphTexture!==null,supportsVertexTextures:m,outputColorSpace:ft===null?n.outputColorSpace:ft.isXRRenderTarget===!0?ft.texture.colorSpace:xa,alphaToCoverage:!!A.alphaToCoverage,map:ke,matcap:xe,envMap:j,envMapMode:j&&W.mapping,envMapCubeUVHeight:J,aoMap:Ve,lightMap:Oe,bumpMap:Pe,normalMap:Ue,displacementMap:m&<,emissiveMap:We,normalMapObjectSpace:Ue&&A.normalMapType===UF,normalMapTangentSpace:Ue&&A.normalMapType===Fl,metalnessMap:X,roughnessMap:F,anisotropy:ae,anisotropyMap:Ge,clearcoat:_e,clearcoatMap:Lt,clearcoatNormalMap:Le,clearcoatRoughnessMap:Ze,dispersion:Te,iridescence:Se,iridescenceMap:Et,iridescenceThicknessMap:vt,sheen:nt,sheenColorMap:et,sheenRoughnessMap:K,specularMap:ve,specularColorMap:je,specularIntensityMap:Y,transmission:Ce,transmissionMap:Fe,thicknessMap:me,gradientMap:Ae,opaque:A.transparent===!1&&A.blending===qc&&A.alphaToCoverage===!1,alphaMap:Xe,alphaTest:$e,alphaHash:At,combine:A.combine,mapUv:ke&&x(A.map.channel),aoMapUv:Ve&&x(A.aoMap.channel),lightMapUv:Oe&&x(A.lightMap.channel),bumpMapUv:Pe&&x(A.bumpMap.channel),normalMapUv:Ue&&x(A.normalMap.channel),displacementMapUv:lt&&x(A.displacementMap.channel),emissiveMapUv:We&&x(A.emissiveMap.channel),metalnessMapUv:X&&x(A.metalnessMap.channel),roughnessMapUv:F&&x(A.roughnessMap.channel),anisotropyMapUv:Ge&&x(A.anisotropyMap.channel),clearcoatMapUv:Lt&&x(A.clearcoatMap.channel),clearcoatNormalMapUv:Le&&x(A.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Ze&&x(A.clearcoatRoughnessMap.channel),iridescenceMapUv:Et&&x(A.iridescenceMap.channel),iridescenceThicknessMapUv:vt&&x(A.iridescenceThicknessMap.channel),sheenColorMapUv:et&&x(A.sheenColorMap.channel),sheenRoughnessMapUv:K&&x(A.sheenRoughnessMap.channel),specularMapUv:ve&&x(A.specularMap.channel),specularColorMapUv:je&&x(A.specularColorMap.channel),specularIntensityMapUv:Y&&x(A.specularIntensityMap.channel),transmissionMapUv:Fe&&x(A.transmissionMap.channel),thicknessMapUv:me&&x(A.thicknessMap.channel),alphaMapUv:Xe&&x(A.alphaMap.channel),vertexTangents:!!ee.attributes.tangent&&(Ue||ae),vertexColors:A.vertexColors,vertexAlphas:A.vertexColors===!0&&!!ee.attributes.color&&ee.attributes.color.itemSize===4,pointsUvs:se.isPoints===!0&&!!ee.attributes.uv&&(ke||Xe),fog:!!le,useFog:A.fog===!0,fogExp2:!!le&&le.isFogExp2,flatShading:A.flatShading===!0,sizeAttenuation:A.sizeAttenuation===!0,logarithmicDepthBuffer:f,reverseDepthBuffer:p,skinning:se.isSkinnedMesh===!0,morphTargets:ee.morphAttributes.position!==void 0,morphNormals:ee.morphAttributes.normal!==void 0,morphColors:ee.morphAttributes.color!==void 0,morphTargetsCount:Me,morphTextureStride:Re,numDirLights:R.directional.length,numPointLights:R.point.length,numSpotLights:R.spot.length,numSpotLightMaps:R.spotLightMap.length,numRectAreaLights:R.rectArea.length,numHemiLights:R.hemi.length,numDirLightShadows:R.directionalShadowMap.length,numPointLightShadows:R.pointShadowMap.length,numSpotLightShadows:R.spotShadowMap.length,numSpotLightShadowsWithMaps:R.numSpotLightShadowsWithMaps,numLightProbes:R.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:A.dithering,shadowMapEnabled:n.shadowMap.enabled&&V.length>0,shadowMapType:n.shadowMap.type,toneMapping:Cn,decodeVideoTexture:ke&&A.map.isVideoTexture===!0&&cn.getTransfer(A.map.colorSpace)===En,premultipliedAlpha:A.premultipliedAlpha,doubleSided:A.side===Bs,flipSided:A.side===yr,useDepthPacking:A.depthPacking>=0,depthPacking:A.depthPacking||0,index0AttributeName:A.index0AttributeName,extensionClipCullDistance:Bt&&A.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(Bt&&A.extensions.multiDraw===!0||Ke)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:A.customProgramCacheKey()};return It.vertexUv1s=c.has(1),It.vertexUv2s=c.has(2),It.vertexUv3s=c.has(3),c.clear(),It}function E(A){const R=[];if(A.shaderID?R.push(A.shaderID):(R.push(A.customVertexShaderID),R.push(A.customFragmentShaderID)),A.defines!==void 0)for(const V in A.defines)R.push(V),R.push(A.defines[V]);return A.isRawShaderMaterial===!1&&(w(R,A),M(R,A),R.push(n.outputColorSpace)),R.push(A.customProgramCacheKey),R.join()}function w(A,R){A.push(R.precision),A.push(R.outputColorSpace),A.push(R.envMapMode),A.push(R.envMapCubeUVHeight),A.push(R.mapUv),A.push(R.alphaMapUv),A.push(R.lightMapUv),A.push(R.aoMapUv),A.push(R.bumpMapUv),A.push(R.normalMapUv),A.push(R.displacementMapUv),A.push(R.emissiveMapUv),A.push(R.metalnessMapUv),A.push(R.roughnessMapUv),A.push(R.anisotropyMapUv),A.push(R.clearcoatMapUv),A.push(R.clearcoatNormalMapUv),A.push(R.clearcoatRoughnessMapUv),A.push(R.iridescenceMapUv),A.push(R.iridescenceThicknessMapUv),A.push(R.sheenColorMapUv),A.push(R.sheenRoughnessMapUv),A.push(R.specularMapUv),A.push(R.specularColorMapUv),A.push(R.specularIntensityMapUv),A.push(R.transmissionMapUv),A.push(R.thicknessMapUv),A.push(R.combine),A.push(R.fogExp2),A.push(R.sizeAttenuation),A.push(R.morphTargetsCount),A.push(R.morphAttributeCount),A.push(R.numDirLights),A.push(R.numPointLights),A.push(R.numSpotLights),A.push(R.numSpotLightMaps),A.push(R.numHemiLights),A.push(R.numRectAreaLights),A.push(R.numDirLightShadows),A.push(R.numPointLightShadows),A.push(R.numSpotLightShadows),A.push(R.numSpotLightShadowsWithMaps),A.push(R.numLightProbes),A.push(R.shadowMapType),A.push(R.toneMapping),A.push(R.numClippingPlanes),A.push(R.numClipIntersection),A.push(R.depthPacking)}function M(A,R){a.disableAll(),R.supportsVertexTextures&&a.enable(0),R.instancing&&a.enable(1),R.instancingColor&&a.enable(2),R.instancingMorph&&a.enable(3),R.matcap&&a.enable(4),R.envMap&&a.enable(5),R.normalMapObjectSpace&&a.enable(6),R.normalMapTangentSpace&&a.enable(7),R.clearcoat&&a.enable(8),R.iridescence&&a.enable(9),R.alphaTest&&a.enable(10),R.vertexColors&&a.enable(11),R.vertexAlphas&&a.enable(12),R.vertexUv1s&&a.enable(13),R.vertexUv2s&&a.enable(14),R.vertexUv3s&&a.enable(15),R.vertexTangents&&a.enable(16),R.anisotropy&&a.enable(17),R.alphaHash&&a.enable(18),R.batching&&a.enable(19),R.dispersion&&a.enable(20),R.batchingColor&&a.enable(21),A.push(a.mask),a.disableAll(),R.fog&&a.enable(0),R.useFog&&a.enable(1),R.flatShading&&a.enable(2),R.logarithmicDepthBuffer&&a.enable(3),R.reverseDepthBuffer&&a.enable(4),R.skinning&&a.enable(5),R.morphTargets&&a.enable(6),R.morphNormals&&a.enable(7),R.morphColors&&a.enable(8),R.premultipliedAlpha&&a.enable(9),R.shadowMapEnabled&&a.enable(10),R.doubleSided&&a.enable(11),R.flipSided&&a.enable(12),R.useDepthPacking&&a.enable(13),R.dithering&&a.enable(14),R.transmission&&a.enable(15),R.sheen&&a.enable(16),R.opaque&&a.enable(17),R.pointsUvs&&a.enable(18),R.decodeVideoTexture&&a.enable(19),R.alphaToCoverage&&a.enable(20),A.push(a.mask)}function O(A){const R=S[A.type];let V;if(R){const U=Vs[R];V=JF.clone(U.uniforms)}else V=A.uniforms;return V}function k(A,R){let V;for(let U=0,se=d.length;U0?i.push(y):m.transparent===!0?r.push(y):t.push(y)}function l(f,p,m,_,S,x){const y=o(f,p,m,_,S,x);m.transmission>0?i.unshift(y):m.transparent===!0?r.unshift(y):t.unshift(y)}function c(f,p){t.length>1&&t.sort(f||Lee),i.length>1&&i.sort(p||oL),r.length>1&&r.sort(p||oL)}function d(){for(let f=e,p=n.length;f=s.length?(o=new aL,s.push(o)):o=s[r],o}function t(){n=new WeakMap}return{get:e,dispose:t}}function Dee(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new G,color:new rt};break;case"SpotLight":t={position:new G,direction:new G,color:new rt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new G,color:new rt,distance:0,decay:0};break;case"HemisphereLight":t={direction:new G,skyColor:new rt,groundColor:new rt};break;case"RectAreaLight":t={color:new rt,position:new G,halfWidth:new G,halfHeight:new G};break}return n[e.id]=t,t}}}function kee(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ee};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ee};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ee,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let Oee=0;function Uee(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function Fee(n){const e=new Dee,t=kee(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)i.probe.push(new G);const r=new G,s=new St,o=new St;function a(c){let d=0,f=0,p=0;for(let D=0;D<9;D++)i.probe[D].set(0,0,0);let m=0,_=0,S=0,x=0,y=0,E=0,w=0,M=0,O=0,k=0,I=0;c.sort(Uee);for(let D=0,A=c.length;D0&&(n.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=Ye.LTC_FLOAT_1,i.rectAreaLTC2=Ye.LTC_FLOAT_2):(i.rectAreaLTC1=Ye.LTC_HALF_1,i.rectAreaLTC2=Ye.LTC_HALF_2)),i.ambient[0]=d,i.ambient[1]=f,i.ambient[2]=p;const P=i.hash;(P.directionalLength!==m||P.pointLength!==_||P.spotLength!==S||P.rectAreaLength!==x||P.hemiLength!==y||P.numDirectionalShadows!==E||P.numPointShadows!==w||P.numSpotShadows!==M||P.numSpotMaps!==O||P.numLightProbes!==I)&&(i.directional.length=m,i.spot.length=S,i.rectArea.length=x,i.point.length=_,i.hemi.length=y,i.directionalShadow.length=E,i.directionalShadowMap.length=E,i.pointShadow.length=w,i.pointShadowMap.length=w,i.spotShadow.length=M,i.spotShadowMap.length=M,i.directionalShadowMatrix.length=E,i.pointShadowMatrix.length=w,i.spotLightMatrix.length=M+O-k,i.spotLightMap.length=O,i.numSpotLightShadowsWithMaps=k,i.numLightProbes=I,P.directionalLength=m,P.pointLength=_,P.spotLength=S,P.rectAreaLength=x,P.hemiLength=y,P.numDirectionalShadows=E,P.numPointShadows=w,P.numSpotShadows=M,P.numSpotMaps=O,P.numLightProbes=I,i.version=Oee++)}function l(c,d){let f=0,p=0,m=0,_=0,S=0;const x=d.matrixWorldInverse;for(let y=0,E=c.length;y=o.length?(a=new lL(n),o.push(a)):a=o[s],a}function i(){e=new WeakMap}return{get:t,dispose:i}}class tC extends Oi{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=kF,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class nC extends Oi{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}const Bee=`void main() { +`+W)}else V!==""?console.warn("THREE.WebGLProgram: Program Info Log:",V):(U===""||se==="")&&(ee=!1);ee&&(R.diagnostics={runnable:le,programLog:V,vertexShader:{log:U,prefix:x},fragmentShader:{log:se,prefix:y}})}r.deleteShader(O),r.deleteShader(k),P=new Pv(r,S),D=mee(r,S)}let P;this.getUniforms=function(){return P===void 0&&I(this),P};let D;this.getAttributes=function(){return D===void 0&&I(this),D};let A=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return A===!1&&(A=r.getProgramParameter(S,oee)),A},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(S),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=aee++,this.cacheKey=e,this.usedTimes=1,this.program=S,this.vertexShader=O,this.fragmentShader=k,this}let Cee=0;class bee{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,i=e.fragmentShader,r=this._getShaderStage(t),s=this._getShaderStage(i),o=this._getShaderCacheForMaterial(e);return o.has(r)===!1&&(o.add(r),r.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const i of t)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let i=t.get(e);return i===void 0&&(i=new Set,t.set(e,i)),i}_getShaderStage(e){const t=this.shaderCache;let i=t.get(e);return i===void 0&&(i=new Pee(e),t.set(e,i)),i}}class Pee{constructor(e){this.id=Cee++,this.code=e,this.usedTimes=0}}function Ree(n,e,t,i,r,s,o){const a=new Kc,l=new bee,c=new Set,d=[],f=r.logarithmicDepthBuffer,p=r.reverseDepthBuffer,m=r.vertexTextures;let _=r.precision;const S={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function x(A){return c.add(A),A===0?"uv":`uv${A}`}function y(A,R,V,U,se){const le=U.fog,ee=se.geometry,pe=A.isMeshStandardMaterial?U.environment:null,W=(A.isMeshStandardMaterial?t:e).get(A.envMap||pe),J=W&&W.mapping===Rd?W.image.height:null,Z=S[A.type];A.precision!==null&&(_=r.getMaxPrecision(A.precision),_!==A.precision&&console.warn("THREE.WebGLProgram.getParameters:",A.precision,"not supported, using",_,"instead."));const oe=ee.morphAttributes.position||ee.morphAttributes.normal||ee.morphAttributes.color,Me=oe!==void 0?oe.length:0;let Re=0;ee.morphAttributes.position!==void 0&&(Re=1),ee.morphAttributes.normal!==void 0&&(Re=2),ee.morphAttributes.color!==void 0&&(Re=3);let he,we,Ne,be;if(Z){const Sn=Vs[Z];he=Sn.vertexShader,we=Sn.fragmentShader}else he=A.vertexShader,we=A.fragmentShader,l.update(A),Ne=l.getVertexShaderID(A),be=l.getFragmentShaderID(A);const ft=n.getRenderTarget(),dt=se.isInstancedMesh===!0,Ke=se.isBatchedMesh===!0,ke=!!A.map,xe=!!A.matcap,j=!!W,Ve=!!A.aoMap,Oe=!!A.lightMap,Pe=!!A.bumpMap,Ue=!!A.normalMap,lt=!!A.displacementMap,We=!!A.emissiveMap,X=!!A.metalnessMap,F=!!A.roughnessMap,ae=A.anisotropy>0,_e=A.clearcoat>0,Te=A.dispersion>0,Se=A.iridescence>0,nt=A.sheen>0,Ce=A.transmission>0,Ge=ae&&!!A.anisotropyMap,Lt=_e&&!!A.clearcoatMap,Le=_e&&!!A.clearcoatNormalMap,Ze=_e&&!!A.clearcoatRoughnessMap,Et=Se&&!!A.iridescenceMap,vt=Se&&!!A.iridescenceThicknessMap,et=nt&&!!A.sheenColorMap,K=nt&&!!A.sheenRoughnessMap,ve=!!A.specularMap,je=!!A.specularColorMap,Y=!!A.specularIntensityMap,Fe=Ce&&!!A.transmissionMap,me=Ce&&!!A.thicknessMap,Ae=!!A.gradientMap,Xe=!!A.alphaMap,$e=A.alphaTest>0,At=!!A.alphaHash,Bt=!!A.extensions;let Cn=vo;A.toneMapped&&(ft===null||ft.isXRRenderTarget===!0)&&(Cn=n.toneMapping);const It={shaderID:Z,shaderType:A.type,shaderName:A.name,vertexShader:he,fragmentShader:we,defines:A.defines,customVertexShaderID:Ne,customFragmentShaderID:be,isRawShaderMaterial:A.isRawShaderMaterial===!0,glslVersion:A.glslVersion,precision:_,batching:Ke,batchingColor:Ke&&se._colorsTexture!==null,instancing:dt,instancingColor:dt&&se.instanceColor!==null,instancingMorph:dt&&se.morphTexture!==null,supportsVertexTextures:m,outputColorSpace:ft===null?n.outputColorSpace:ft.isXRRenderTarget===!0?ft.texture.colorSpace:xa,alphaToCoverage:!!A.alphaToCoverage,map:ke,matcap:xe,envMap:j,envMapMode:j&&W.mapping,envMapCubeUVHeight:J,aoMap:Ve,lightMap:Oe,bumpMap:Pe,normalMap:Ue,displacementMap:m&<,emissiveMap:We,normalMapObjectSpace:Ue&&A.normalMapType===FF,normalMapTangentSpace:Ue&&A.normalMapType===Fl,metalnessMap:X,roughnessMap:F,anisotropy:ae,anisotropyMap:Ge,clearcoat:_e,clearcoatMap:Lt,clearcoatNormalMap:Le,clearcoatRoughnessMap:Ze,dispersion:Te,iridescence:Se,iridescenceMap:Et,iridescenceThicknessMap:vt,sheen:nt,sheenColorMap:et,sheenRoughnessMap:K,specularMap:ve,specularColorMap:je,specularIntensityMap:Y,transmission:Ce,transmissionMap:Fe,thicknessMap:me,gradientMap:Ae,opaque:A.transparent===!1&&A.blending===qc&&A.alphaToCoverage===!1,alphaMap:Xe,alphaTest:$e,alphaHash:At,combine:A.combine,mapUv:ke&&x(A.map.channel),aoMapUv:Ve&&x(A.aoMap.channel),lightMapUv:Oe&&x(A.lightMap.channel),bumpMapUv:Pe&&x(A.bumpMap.channel),normalMapUv:Ue&&x(A.normalMap.channel),displacementMapUv:lt&&x(A.displacementMap.channel),emissiveMapUv:We&&x(A.emissiveMap.channel),metalnessMapUv:X&&x(A.metalnessMap.channel),roughnessMapUv:F&&x(A.roughnessMap.channel),anisotropyMapUv:Ge&&x(A.anisotropyMap.channel),clearcoatMapUv:Lt&&x(A.clearcoatMap.channel),clearcoatNormalMapUv:Le&&x(A.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Ze&&x(A.clearcoatRoughnessMap.channel),iridescenceMapUv:Et&&x(A.iridescenceMap.channel),iridescenceThicknessMapUv:vt&&x(A.iridescenceThicknessMap.channel),sheenColorMapUv:et&&x(A.sheenColorMap.channel),sheenRoughnessMapUv:K&&x(A.sheenRoughnessMap.channel),specularMapUv:ve&&x(A.specularMap.channel),specularColorMapUv:je&&x(A.specularColorMap.channel),specularIntensityMapUv:Y&&x(A.specularIntensityMap.channel),transmissionMapUv:Fe&&x(A.transmissionMap.channel),thicknessMapUv:me&&x(A.thicknessMap.channel),alphaMapUv:Xe&&x(A.alphaMap.channel),vertexTangents:!!ee.attributes.tangent&&(Ue||ae),vertexColors:A.vertexColors,vertexAlphas:A.vertexColors===!0&&!!ee.attributes.color&&ee.attributes.color.itemSize===4,pointsUvs:se.isPoints===!0&&!!ee.attributes.uv&&(ke||Xe),fog:!!le,useFog:A.fog===!0,fogExp2:!!le&&le.isFogExp2,flatShading:A.flatShading===!0,sizeAttenuation:A.sizeAttenuation===!0,logarithmicDepthBuffer:f,reverseDepthBuffer:p,skinning:se.isSkinnedMesh===!0,morphTargets:ee.morphAttributes.position!==void 0,morphNormals:ee.morphAttributes.normal!==void 0,morphColors:ee.morphAttributes.color!==void 0,morphTargetsCount:Me,morphTextureStride:Re,numDirLights:R.directional.length,numPointLights:R.point.length,numSpotLights:R.spot.length,numSpotLightMaps:R.spotLightMap.length,numRectAreaLights:R.rectArea.length,numHemiLights:R.hemi.length,numDirLightShadows:R.directionalShadowMap.length,numPointLightShadows:R.pointShadowMap.length,numSpotLightShadows:R.spotShadowMap.length,numSpotLightShadowsWithMaps:R.numSpotLightShadowsWithMaps,numLightProbes:R.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:A.dithering,shadowMapEnabled:n.shadowMap.enabled&&V.length>0,shadowMapType:n.shadowMap.type,toneMapping:Cn,decodeVideoTexture:ke&&A.map.isVideoTexture===!0&&cn.getTransfer(A.map.colorSpace)===En,premultipliedAlpha:A.premultipliedAlpha,doubleSided:A.side===Bs,flipSided:A.side===yr,useDepthPacking:A.depthPacking>=0,depthPacking:A.depthPacking||0,index0AttributeName:A.index0AttributeName,extensionClipCullDistance:Bt&&A.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(Bt&&A.extensions.multiDraw===!0||Ke)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:A.customProgramCacheKey()};return It.vertexUv1s=c.has(1),It.vertexUv2s=c.has(2),It.vertexUv3s=c.has(3),c.clear(),It}function E(A){const R=[];if(A.shaderID?R.push(A.shaderID):(R.push(A.customVertexShaderID),R.push(A.customFragmentShaderID)),A.defines!==void 0)for(const V in A.defines)R.push(V),R.push(A.defines[V]);return A.isRawShaderMaterial===!1&&(w(R,A),M(R,A),R.push(n.outputColorSpace)),R.push(A.customProgramCacheKey),R.join()}function w(A,R){A.push(R.precision),A.push(R.outputColorSpace),A.push(R.envMapMode),A.push(R.envMapCubeUVHeight),A.push(R.mapUv),A.push(R.alphaMapUv),A.push(R.lightMapUv),A.push(R.aoMapUv),A.push(R.bumpMapUv),A.push(R.normalMapUv),A.push(R.displacementMapUv),A.push(R.emissiveMapUv),A.push(R.metalnessMapUv),A.push(R.roughnessMapUv),A.push(R.anisotropyMapUv),A.push(R.clearcoatMapUv),A.push(R.clearcoatNormalMapUv),A.push(R.clearcoatRoughnessMapUv),A.push(R.iridescenceMapUv),A.push(R.iridescenceThicknessMapUv),A.push(R.sheenColorMapUv),A.push(R.sheenRoughnessMapUv),A.push(R.specularMapUv),A.push(R.specularColorMapUv),A.push(R.specularIntensityMapUv),A.push(R.transmissionMapUv),A.push(R.thicknessMapUv),A.push(R.combine),A.push(R.fogExp2),A.push(R.sizeAttenuation),A.push(R.morphTargetsCount),A.push(R.morphAttributeCount),A.push(R.numDirLights),A.push(R.numPointLights),A.push(R.numSpotLights),A.push(R.numSpotLightMaps),A.push(R.numHemiLights),A.push(R.numRectAreaLights),A.push(R.numDirLightShadows),A.push(R.numPointLightShadows),A.push(R.numSpotLightShadows),A.push(R.numSpotLightShadowsWithMaps),A.push(R.numLightProbes),A.push(R.shadowMapType),A.push(R.toneMapping),A.push(R.numClippingPlanes),A.push(R.numClipIntersection),A.push(R.depthPacking)}function M(A,R){a.disableAll(),R.supportsVertexTextures&&a.enable(0),R.instancing&&a.enable(1),R.instancingColor&&a.enable(2),R.instancingMorph&&a.enable(3),R.matcap&&a.enable(4),R.envMap&&a.enable(5),R.normalMapObjectSpace&&a.enable(6),R.normalMapTangentSpace&&a.enable(7),R.clearcoat&&a.enable(8),R.iridescence&&a.enable(9),R.alphaTest&&a.enable(10),R.vertexColors&&a.enable(11),R.vertexAlphas&&a.enable(12),R.vertexUv1s&&a.enable(13),R.vertexUv2s&&a.enable(14),R.vertexUv3s&&a.enable(15),R.vertexTangents&&a.enable(16),R.anisotropy&&a.enable(17),R.alphaHash&&a.enable(18),R.batching&&a.enable(19),R.dispersion&&a.enable(20),R.batchingColor&&a.enable(21),A.push(a.mask),a.disableAll(),R.fog&&a.enable(0),R.useFog&&a.enable(1),R.flatShading&&a.enable(2),R.logarithmicDepthBuffer&&a.enable(3),R.reverseDepthBuffer&&a.enable(4),R.skinning&&a.enable(5),R.morphTargets&&a.enable(6),R.morphNormals&&a.enable(7),R.morphColors&&a.enable(8),R.premultipliedAlpha&&a.enable(9),R.shadowMapEnabled&&a.enable(10),R.doubleSided&&a.enable(11),R.flipSided&&a.enable(12),R.useDepthPacking&&a.enable(13),R.dithering&&a.enable(14),R.transmission&&a.enable(15),R.sheen&&a.enable(16),R.opaque&&a.enable(17),R.pointsUvs&&a.enable(18),R.decodeVideoTexture&&a.enable(19),R.alphaToCoverage&&a.enable(20),A.push(a.mask)}function O(A){const R=S[A.type];let V;if(R){const U=Vs[R];V=ZF.clone(U.uniforms)}else V=A.uniforms;return V}function k(A,R){let V;for(let U=0,se=d.length;U0?i.push(y):m.transparent===!0?r.push(y):t.push(y)}function l(f,p,m,_,S,x){const y=o(f,p,m,_,S,x);m.transmission>0?i.unshift(y):m.transparent===!0?r.unshift(y):t.unshift(y)}function c(f,p){t.length>1&&t.sort(f||Lee),i.length>1&&i.sort(p||oL),r.length>1&&r.sort(p||oL)}function d(){for(let f=e,p=n.length;f=s.length?(o=new aL,s.push(o)):o=s[r],o}function t(){n=new WeakMap}return{get:e,dispose:t}}function Dee(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new G,color:new rt};break;case"SpotLight":t={position:new G,direction:new G,color:new rt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new G,color:new rt,distance:0,decay:0};break;case"HemisphereLight":t={direction:new G,skyColor:new rt,groundColor:new rt};break;case"RectAreaLight":t={color:new rt,position:new G,halfWidth:new G,halfHeight:new G};break}return n[e.id]=t,t}}}function kee(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ee};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ee};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ee,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let Oee=0;function Uee(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function Fee(n){const e=new Dee,t=kee(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)i.probe.push(new G);const r=new G,s=new St,o=new St;function a(c){let d=0,f=0,p=0;for(let D=0;D<9;D++)i.probe[D].set(0,0,0);let m=0,_=0,S=0,x=0,y=0,E=0,w=0,M=0,O=0,k=0,I=0;c.sort(Uee);for(let D=0,A=c.length;D0&&(n.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=Ye.LTC_FLOAT_1,i.rectAreaLTC2=Ye.LTC_FLOAT_2):(i.rectAreaLTC1=Ye.LTC_HALF_1,i.rectAreaLTC2=Ye.LTC_HALF_2)),i.ambient[0]=d,i.ambient[1]=f,i.ambient[2]=p;const P=i.hash;(P.directionalLength!==m||P.pointLength!==_||P.spotLength!==S||P.rectAreaLength!==x||P.hemiLength!==y||P.numDirectionalShadows!==E||P.numPointShadows!==w||P.numSpotShadows!==M||P.numSpotMaps!==O||P.numLightProbes!==I)&&(i.directional.length=m,i.spot.length=S,i.rectArea.length=x,i.point.length=_,i.hemi.length=y,i.directionalShadow.length=E,i.directionalShadowMap.length=E,i.pointShadow.length=w,i.pointShadowMap.length=w,i.spotShadow.length=M,i.spotShadowMap.length=M,i.directionalShadowMatrix.length=E,i.pointShadowMatrix.length=w,i.spotLightMatrix.length=M+O-k,i.spotLightMap.length=O,i.numSpotLightShadowsWithMaps=k,i.numLightProbes=I,P.directionalLength=m,P.pointLength=_,P.spotLength=S,P.rectAreaLength=x,P.hemiLength=y,P.numDirectionalShadows=E,P.numPointShadows=w,P.numSpotShadows=M,P.numSpotMaps=O,P.numLightProbes=I,i.version=Oee++)}function l(c,d){let f=0,p=0,m=0,_=0,S=0;const x=d.matrixWorldInverse;for(let y=0,E=c.length;y=o.length?(a=new lL(n),o.push(a)):a=o[s],a}function i(){e=new WeakMap}return{get:t,dispose:i}}class tC extends Oi{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=OF,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class nC extends Oi{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}const Bee=`void main() { gl_Position = vec4( position, 1.0 ); }`,zee=`uniform sampler2D shadow_pass; uniform vec2 resolution; @@ -5768,7 +5768,7 @@ void main() { squared_mean = squared_mean / samples; float std_dev = sqrt( squared_mean - mean * mean ); gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`;function Hee(n,e,t){let i=new Wm;const r=new Ee,s=new Ee,o=new sn,a=new tC({depthPacking:OF}),l=new nC,c={},d=t.maxTextureSize,f={[da]:yr,[yr]:da,[Bs]:Bs},p=new qs({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ee},radius:{value:4}},vertexShader:Bee,fragmentShader:zee}),m=p.clone();m.defines.HORIZONTAL_PASS=1;const _=new Vt;_.setAttribute("position",new vn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const S=new ni(_,p),x=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=rx;let y=this.type;this.render=function(k,I,P){if(x.enabled===!1||x.autoUpdate===!1&&x.needsUpdate===!1||k.length===0)return;const D=n.getRenderTarget(),A=n.getActiveCubeFace(),R=n.getActiveMipmapLevel(),V=n.state;V.setBlending(ra),V.buffers.color.setClear(1,1,1,1),V.buffers.depth.setTest(!0),V.setScissorTest(!1);const U=y!==Os&&this.type===Os,se=y===Os&&this.type!==Os;for(let le=0,ee=k.length;led||r.y>d)&&(r.x>d&&(s.x=Math.floor(d/J.x),r.x=s.x*J.x,W.mapSize.x=s.x),r.y>d&&(s.y=Math.floor(d/J.y),r.y=s.y*J.y,W.mapSize.y=s.y)),W.map===null||U===!0||se===!0){const oe=this.type!==Os?{minFilter:Ai,magFilter:Ai}:{};W.map!==null&&W.map.dispose(),W.map=new Xs(r.x,r.y,oe),W.map.texture.name=pe.name+".shadowMap",W.camera.updateProjectionMatrix()}n.setRenderTarget(W.map),n.clear();const Z=W.getViewportCount();for(let oe=0;oe0||I.map&&I.alphaTest>0){const V=A.uuid,U=I.uuid;let se=c[V];se===void 0&&(se={},c[V]=se);let le=se[U];le===void 0&&(le=A.clone(),se[U]=le,I.addEventListener("dispose",O)),A=le}if(A.visible=I.visible,A.wireframe=I.wireframe,D===Os?A.side=I.shadowSide!==null?I.shadowSide:I.side:A.side=I.shadowSide!==null?I.shadowSide:f[I.side],A.alphaMap=I.alphaMap,A.alphaTest=I.alphaTest,A.map=I.map,A.clipShadows=I.clipShadows,A.clippingPlanes=I.clippingPlanes,A.clipIntersection=I.clipIntersection,A.displacementMap=I.displacementMap,A.displacementScale=I.displacementScale,A.displacementBias=I.displacementBias,A.wireframeLinewidth=I.wireframeLinewidth,A.linewidth=I.linewidth,P.isPointLight===!0&&A.isMeshDistanceMaterial===!0){const V=n.properties.get(A);V.light=P}return A}function M(k,I,P,D,A){if(k.visible===!1)return;if(k.layers.test(I.layers)&&(k.isMesh||k.isLine||k.isPoints)&&(k.castShadow||k.receiveShadow&&A===Os)&&(!k.frustumCulled||i.intersectsObject(k))){k.modelViewMatrix.multiplyMatrices(P.matrixWorldInverse,k.matrixWorld);const U=e.update(k),se=k.material;if(Array.isArray(se)){const le=U.groups;for(let ee=0,pe=le.length;ee=1):pe.indexOf("OpenGL ES")!==-1&&(ee=parseFloat(/^OpenGL ES (\d)/.exec(pe)[1]),le=ee>=2);let W=null,J={};const Z=n.getParameter(n.SCISSOR_BOX),oe=n.getParameter(n.VIEWPORT),Me=new sn().fromArray(Z),Re=new sn().fromArray(oe);function he(Y,Fe,me,Ae){const Xe=new Uint8Array(4),$e=n.createTexture();n.bindTexture(Y,$e),n.texParameteri(Y,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(Y,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let At=0;Ate?(n.repeat.x=1,n.repeat.y=t/e,n.offset.x=0,n.offset.y=(1-n.repeat.y)/2):(n.repeat.x=e/t,n.repeat.y=1,n.offset.x=(1-n.repeat.x)/2,n.offset.y=0),n}function Xee(n,e){const t=n.image&&n.image.width?n.image.width/n.image.height:1;return t>e?(n.repeat.x=e/t,n.repeat.y=1,n.offset.x=(1-n.repeat.x)/2,n.offset.y=0):(n.repeat.x=1,n.repeat.y=t/e,n.offset.x=0,n.offset.y=(1-n.repeat.y)/2),n}function qee(n){return n.repeat.x=1,n.repeat.y=1,n.offset.x=0,n.offset.y=0,n}function _T(n,e,t,i){const r=$ee(i);switch(t){case VM:return n*e;case zM:return n*e;case HM:return n*e*2;case cx:return n*e/r.components*r.byteLength;case Bm:return n*e/r.components*r.byteLength;case GM:return n*e*2/r.components*r.byteLength;case ux:return n*e*2/r.components*r.byteLength;case BM:return n*e*3/r.components*r.byteLength;case tr:return n*e*4/r.components*r.byteLength;case hx:return n*e*4/r.components*r.byteLength;case gp:case yp:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case vp:case _p:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case k0:case U0:return Math.max(n,16)*Math.max(e,8)/4;case D0:case O0:return Math.max(n,8)*Math.max(e,8)/2;case F0:case V0:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case B0:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case z0:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case H0:return Math.floor((n+4)/5)*Math.floor((e+3)/4)*16;case G0:return Math.floor((n+4)/5)*Math.floor((e+4)/5)*16;case W0:return Math.floor((n+5)/6)*Math.floor((e+4)/5)*16;case j0:return Math.floor((n+5)/6)*Math.floor((e+5)/6)*16;case X0:return Math.floor((n+7)/8)*Math.floor((e+4)/5)*16;case q0:return Math.floor((n+7)/8)*Math.floor((e+5)/6)*16;case $0:return Math.floor((n+7)/8)*Math.floor((e+7)/8)*16;case Y0:return Math.floor((n+9)/10)*Math.floor((e+4)/5)*16;case K0:return Math.floor((n+9)/10)*Math.floor((e+5)/6)*16;case Q0:return Math.floor((n+9)/10)*Math.floor((e+7)/8)*16;case J0:return Math.floor((n+9)/10)*Math.floor((e+9)/10)*16;case Z0:return Math.floor((n+11)/12)*Math.floor((e+9)/10)*16;case e_:return Math.floor((n+11)/12)*Math.floor((e+11)/12)*16;case xp:case t_:case n_:return Math.ceil(n/4)*Math.ceil(e/4)*16;case WM:case i_:return Math.ceil(n/4)*Math.ceil(e/4)*8;case r_:case s_:return Math.ceil(n/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function $ee(n){switch(n){case js:case OM:return{byteLength:1,components:1};case dd:case UM:case Id:return{byteLength:2,components:1};case ax:case lx:return{byteLength:2,components:4};case pa:case ox:case kr:return{byteLength:4,components:1};case FM:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${n}.`)}const Yee={contain:jee,cover:Xee,fill:qee,getByteLength:_T};function Kee(n,e,t,i,r,s,o){const a=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,l=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new Ee,d=new WeakMap;let f;const p=new WeakMap;let m=!1;try{m=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function _(X,F){return m?new OffscreenCanvas(X,F):cm("canvas")}function S(X,F,ae){let _e=1;const Te=We(X);if((Te.width>ae||Te.height>ae)&&(_e=ae/Math.max(Te.width,Te.height)),_e<1)if(typeof HTMLImageElement<"u"&&X instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&X instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&X instanceof ImageBitmap||typeof VideoFrame<"u"&&X instanceof VideoFrame){const Se=Math.floor(_e*Te.width),nt=Math.floor(_e*Te.height);f===void 0&&(f=_(Se,nt));const Ce=F?_(Se,nt):f;return Ce.width=Se,Ce.height=nt,Ce.getContext("2d").drawImage(X,0,0,Se,nt),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+Te.width+"x"+Te.height+") to ("+Se+"x"+nt+")."),Ce}else return"data"in X&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+Te.width+"x"+Te.height+")."),X;return X}function x(X){return X.generateMipmaps&&X.minFilter!==Ai&&X.minFilter!==fi}function y(X){n.generateMipmap(X)}function E(X,F,ae,_e,Te=!1){if(X!==null){if(n[X]!==void 0)return n[X];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+X+"'")}let Se=F;if(F===n.RED&&(ae===n.FLOAT&&(Se=n.R32F),ae===n.HALF_FLOAT&&(Se=n.R16F),ae===n.UNSIGNED_BYTE&&(Se=n.R8)),F===n.RED_INTEGER&&(ae===n.UNSIGNED_BYTE&&(Se=n.R8UI),ae===n.UNSIGNED_SHORT&&(Se=n.R16UI),ae===n.UNSIGNED_INT&&(Se=n.R32UI),ae===n.BYTE&&(Se=n.R8I),ae===n.SHORT&&(Se=n.R16I),ae===n.INT&&(Se=n.R32I)),F===n.RG&&(ae===n.FLOAT&&(Se=n.RG32F),ae===n.HALF_FLOAT&&(Se=n.RG16F),ae===n.UNSIGNED_BYTE&&(Se=n.RG8)),F===n.RG_INTEGER&&(ae===n.UNSIGNED_BYTE&&(Se=n.RG8UI),ae===n.UNSIGNED_SHORT&&(Se=n.RG16UI),ae===n.UNSIGNED_INT&&(Se=n.RG32UI),ae===n.BYTE&&(Se=n.RG8I),ae===n.SHORT&&(Se=n.RG16I),ae===n.INT&&(Se=n.RG32I)),F===n.RGB_INTEGER&&(ae===n.UNSIGNED_BYTE&&(Se=n.RGB8UI),ae===n.UNSIGNED_SHORT&&(Se=n.RGB16UI),ae===n.UNSIGNED_INT&&(Se=n.RGB32UI),ae===n.BYTE&&(Se=n.RGB8I),ae===n.SHORT&&(Se=n.RGB16I),ae===n.INT&&(Se=n.RGB32I)),F===n.RGBA_INTEGER&&(ae===n.UNSIGNED_BYTE&&(Se=n.RGBA8UI),ae===n.UNSIGNED_SHORT&&(Se=n.RGBA16UI),ae===n.UNSIGNED_INT&&(Se=n.RGBA32UI),ae===n.BYTE&&(Se=n.RGBA8I),ae===n.SHORT&&(Se=n.RGBA16I),ae===n.INT&&(Se=n.RGBA32I)),F===n.RGB&&ae===n.UNSIGNED_INT_5_9_9_9_REV&&(Se=n.RGB9_E5),F===n.RGBA){const nt=Te?rm:cn.getTransfer(_e);ae===n.FLOAT&&(Se=n.RGBA32F),ae===n.HALF_FLOAT&&(Se=n.RGBA16F),ae===n.UNSIGNED_BYTE&&(Se=nt===En?n.SRGB8_ALPHA8:n.RGBA8),ae===n.UNSIGNED_SHORT_4_4_4_4&&(Se=n.RGBA4),ae===n.UNSIGNED_SHORT_5_5_5_1&&(Se=n.RGB5_A1)}return(Se===n.R16F||Se===n.R32F||Se===n.RG16F||Se===n.RG32F||Se===n.RGBA16F||Se===n.RGBA32F)&&e.get("EXT_color_buffer_float"),Se}function w(X,F){let ae;return X?F===null||F===pa||F===lu?ae=n.DEPTH24_STENCIL8:F===kr?ae=n.DEPTH32F_STENCIL8:F===dd&&(ae=n.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):F===null||F===pa||F===lu?ae=n.DEPTH_COMPONENT24:F===kr?ae=n.DEPTH_COMPONENT32F:F===dd&&(ae=n.DEPTH_COMPONENT16),ae}function M(X,F){return x(X)===!0||X.isFramebufferTexture&&X.minFilter!==Ai&&X.minFilter!==fi?Math.log2(Math.max(F.width,F.height))+1:X.mipmaps!==void 0&&X.mipmaps.length>0?X.mipmaps.length:X.isCompressedTexture&&Array.isArray(X.image)?F.mipmaps.length:1}function O(X){const F=X.target;F.removeEventListener("dispose",O),I(F),F.isVideoTexture&&d.delete(F)}function k(X){const F=X.target;F.removeEventListener("dispose",k),D(F)}function I(X){const F=i.get(X);if(F.__webglInit===void 0)return;const ae=X.source,_e=p.get(ae);if(_e){const Te=_e[F.__cacheKey];Te.usedTimes--,Te.usedTimes===0&&P(X),Object.keys(_e).length===0&&p.delete(ae)}i.remove(X)}function P(X){const F=i.get(X);n.deleteTexture(F.__webglTexture);const ae=X.source,_e=p.get(ae);delete _e[F.__cacheKey],o.memory.textures--}function D(X){const F=i.get(X);if(X.depthTexture&&X.depthTexture.dispose(),X.isWebGLCubeRenderTarget)for(let _e=0;_e<6;_e++){if(Array.isArray(F.__webglFramebuffer[_e]))for(let Te=0;Te=r.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+X+" texture units while this GPU supports only "+r.maxTextures),A+=1,X}function U(X){const F=[];return F.push(X.wrapS),F.push(X.wrapT),F.push(X.wrapR||0),F.push(X.magFilter),F.push(X.minFilter),F.push(X.anisotropy),F.push(X.internalFormat),F.push(X.format),F.push(X.type),F.push(X.generateMipmaps),F.push(X.premultiplyAlpha),F.push(X.flipY),F.push(X.unpackAlignment),F.push(X.colorSpace),F.join()}function se(X,F){const ae=i.get(X);if(X.isVideoTexture&&Ue(X),X.isRenderTargetTexture===!1&&X.version>0&&ae.__version!==X.version){const _e=X.image;if(_e===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(_e.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Re(ae,X,F);return}}t.bindTexture(n.TEXTURE_2D,ae.__webglTexture,n.TEXTURE0+F)}function le(X,F){const ae=i.get(X);if(X.version>0&&ae.__version!==X.version){Re(ae,X,F);return}t.bindTexture(n.TEXTURE_2D_ARRAY,ae.__webglTexture,n.TEXTURE0+F)}function ee(X,F){const ae=i.get(X);if(X.version>0&&ae.__version!==X.version){Re(ae,X,F);return}t.bindTexture(n.TEXTURE_3D,ae.__webglTexture,n.TEXTURE0+F)}function pe(X,F){const ae=i.get(X);if(X.version>0&&ae.__version!==X.version){he(ae,X,F);return}t.bindTexture(n.TEXTURE_CUBE_MAP,ae.__webglTexture,n.TEXTURE0+F)}const W={[em]:n.REPEAT,[Es]:n.CLAMP_TO_EDGE,[tm]:n.MIRRORED_REPEAT},J={[Ai]:n.NEAREST,[kM]:n.NEAREST_MIPMAP_NEAREST,[Ph]:n.NEAREST_MIPMAP_LINEAR,[fi]:n.LINEAR,[mp]:n.LINEAR_MIPMAP_NEAREST,[ho]:n.LINEAR_MIPMAP_LINEAR},Z={[FF]:n.NEVER,[WF]:n.ALWAYS,[VF]:n.LESS,[XM]:n.LEQUAL,[BF]:n.EQUAL,[GF]:n.GEQUAL,[zF]:n.GREATER,[HF]:n.NOTEQUAL};function oe(X,F){if(F.type===kr&&e.has("OES_texture_float_linear")===!1&&(F.magFilter===fi||F.magFilter===mp||F.magFilter===Ph||F.magFilter===ho||F.minFilter===fi||F.minFilter===mp||F.minFilter===Ph||F.minFilter===ho)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),n.texParameteri(X,n.TEXTURE_WRAP_S,W[F.wrapS]),n.texParameteri(X,n.TEXTURE_WRAP_T,W[F.wrapT]),(X===n.TEXTURE_3D||X===n.TEXTURE_2D_ARRAY)&&n.texParameteri(X,n.TEXTURE_WRAP_R,W[F.wrapR]),n.texParameteri(X,n.TEXTURE_MAG_FILTER,J[F.magFilter]),n.texParameteri(X,n.TEXTURE_MIN_FILTER,J[F.minFilter]),F.compareFunction&&(n.texParameteri(X,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(X,n.TEXTURE_COMPARE_FUNC,Z[F.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(F.magFilter===Ai||F.minFilter!==Ph&&F.minFilter!==ho||F.type===kr&&e.has("OES_texture_float_linear")===!1)return;if(F.anisotropy>1||i.get(F).__currentAnisotropy){const ae=e.get("EXT_texture_filter_anisotropic");n.texParameterf(X,ae.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(F.anisotropy,r.getMaxAnisotropy())),i.get(F).__currentAnisotropy=F.anisotropy}}}function Me(X,F){let ae=!1;X.__webglInit===void 0&&(X.__webglInit=!0,F.addEventListener("dispose",O));const _e=F.source;let Te=p.get(_e);Te===void 0&&(Te={},p.set(_e,Te));const Se=U(F);if(Se!==X.__cacheKey){Te[Se]===void 0&&(Te[Se]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,ae=!0),Te[Se].usedTimes++;const nt=Te[X.__cacheKey];nt!==void 0&&(Te[X.__cacheKey].usedTimes--,nt.usedTimes===0&&P(F)),X.__cacheKey=Se,X.__webglTexture=Te[Se].texture}return ae}function Re(X,F,ae){let _e=n.TEXTURE_2D;(F.isDataArrayTexture||F.isCompressedArrayTexture)&&(_e=n.TEXTURE_2D_ARRAY),F.isData3DTexture&&(_e=n.TEXTURE_3D);const Te=Me(X,F),Se=F.source;t.bindTexture(_e,X.__webglTexture,n.TEXTURE0+ae);const nt=i.get(Se);if(Se.version!==nt.__version||Te===!0){t.activeTexture(n.TEXTURE0+ae);const Ce=cn.getPrimaries(cn.workingColorSpace),Ge=F.colorSpace===jo?null:cn.getPrimaries(F.colorSpace),Lt=F.colorSpace===jo||Ce===Ge?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,F.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,F.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,F.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,Lt);let Le=S(F.image,!1,r.maxTextureSize);Le=lt(F,Le);const Ze=s.convert(F.format,F.colorSpace),Et=s.convert(F.type);let vt=E(F.internalFormat,Ze,Et,F.colorSpace,F.isVideoTexture);oe(_e,F);let et;const K=F.mipmaps,ve=F.isVideoTexture!==!0,je=nt.__version===void 0||Te===!0,Y=Se.dataReady,Fe=M(F,Le);if(F.isDepthTexture)vt=w(F.format===cu,F.type),je&&(ve?t.texStorage2D(n.TEXTURE_2D,1,vt,Le.width,Le.height):t.texImage2D(n.TEXTURE_2D,0,vt,Le.width,Le.height,0,Ze,Et,null));else if(F.isDataTexture)if(K.length>0){ve&&je&&t.texStorage2D(n.TEXTURE_2D,Fe,vt,K[0].width,K[0].height);for(let me=0,Ae=K.length;me0){const Xe=_T(et.width,et.height,F.format,F.type);for(const $e of F.layerUpdates){const At=et.data.subarray($e*Xe/et.data.BYTES_PER_ELEMENT,($e+1)*Xe/et.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,me,0,0,$e,et.width,et.height,1,Ze,At,0,0)}F.clearLayerUpdates()}else t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,me,0,0,0,et.width,et.height,Le.depth,Ze,et.data,0,0)}else t.compressedTexImage3D(n.TEXTURE_2D_ARRAY,me,vt,et.width,et.height,Le.depth,0,et.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else ve?Y&&t.texSubImage3D(n.TEXTURE_2D_ARRAY,me,0,0,0,et.width,et.height,Le.depth,Ze,Et,et.data):t.texImage3D(n.TEXTURE_2D_ARRAY,me,vt,et.width,et.height,Le.depth,0,Ze,Et,et.data)}else{ve&&je&&t.texStorage2D(n.TEXTURE_2D,Fe,vt,K[0].width,K[0].height);for(let me=0,Ae=K.length;me0){const me=_T(Le.width,Le.height,F.format,F.type);for(const Ae of F.layerUpdates){const Xe=Le.data.subarray(Ae*me/Le.data.BYTES_PER_ELEMENT,(Ae+1)*me/Le.data.BYTES_PER_ELEMENT);t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,Ae,Le.width,Le.height,1,Ze,Et,Xe)}F.clearLayerUpdates()}else t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,0,Le.width,Le.height,Le.depth,Ze,Et,Le.data)}else t.texImage3D(n.TEXTURE_2D_ARRAY,0,vt,Le.width,Le.height,Le.depth,0,Ze,Et,Le.data);else if(F.isData3DTexture)ve?(je&&t.texStorage3D(n.TEXTURE_3D,Fe,vt,Le.width,Le.height,Le.depth),Y&&t.texSubImage3D(n.TEXTURE_3D,0,0,0,0,Le.width,Le.height,Le.depth,Ze,Et,Le.data)):t.texImage3D(n.TEXTURE_3D,0,vt,Le.width,Le.height,Le.depth,0,Ze,Et,Le.data);else if(F.isFramebufferTexture){if(je)if(ve)t.texStorage2D(n.TEXTURE_2D,Fe,vt,Le.width,Le.height);else{let me=Le.width,Ae=Le.height;for(let Xe=0;Xe>=1,Ae>>=1}}else if(K.length>0){if(ve&&je){const me=We(K[0]);t.texStorage2D(n.TEXTURE_2D,Fe,vt,me.width,me.height)}for(let me=0,Ae=K.length;me0&&Fe++;const Ae=We(Ze[0]);t.texStorage2D(n.TEXTURE_CUBE_MAP,Fe,K,Ae.width,Ae.height)}for(let Ae=0;Ae<6;Ae++)if(Le){ve?Y&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Ae,0,0,0,Ze[Ae].width,Ze[Ae].height,vt,et,Ze[Ae].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Ae,0,K,Ze[Ae].width,Ze[Ae].height,0,vt,et,Ze[Ae].data);for(let Xe=0;Xe>Se),Ze=Math.max(1,F.height>>Se);Te===n.TEXTURE_3D||Te===n.TEXTURE_2D_ARRAY?t.texImage3D(Te,Se,Ge,Le,Ze,F.depth,0,nt,Ce,null):t.texImage2D(Te,Se,Ge,Le,Ze,0,nt,Ce,null)}t.bindFramebuffer(n.FRAMEBUFFER,X),Pe(F)?a.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,_e,Te,i.get(ae).__webglTexture,0,Oe(F)):(Te===n.TEXTURE_2D||Te>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&Te<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,_e,Te,i.get(ae).__webglTexture,Se),t.bindFramebuffer(n.FRAMEBUFFER,null)}function Ne(X,F,ae){if(n.bindRenderbuffer(n.RENDERBUFFER,X),F.depthBuffer){const _e=F.depthTexture,Te=_e&&_e.isDepthTexture?_e.type:null,Se=w(F.stencilBuffer,Te),nt=F.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,Ce=Oe(F);Pe(F)?a.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,Ce,Se,F.width,F.height):ae?n.renderbufferStorageMultisample(n.RENDERBUFFER,Ce,Se,F.width,F.height):n.renderbufferStorage(n.RENDERBUFFER,Se,F.width,F.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,nt,n.RENDERBUFFER,X)}else{const _e=F.textures;for(let Te=0;Te<_e.length;Te++){const Se=_e[Te],nt=s.convert(Se.format,Se.colorSpace),Ce=s.convert(Se.type),Ge=E(Se.internalFormat,nt,Ce,Se.colorSpace),Lt=Oe(F);ae&&Pe(F)===!1?n.renderbufferStorageMultisample(n.RENDERBUFFER,Lt,Ge,F.width,F.height):Pe(F)?a.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,Lt,Ge,F.width,F.height):n.renderbufferStorage(n.RENDERBUFFER,Ge,F.width,F.height)}}n.bindRenderbuffer(n.RENDERBUFFER,null)}function be(X,F){if(F&&F.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(n.FRAMEBUFFER,X),!(F.depthTexture&&F.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!i.get(F.depthTexture).__webglTexture||F.depthTexture.image.width!==F.width||F.depthTexture.image.height!==F.height)&&(F.depthTexture.image.width=F.width,F.depthTexture.image.height=F.height,F.depthTexture.needsUpdate=!0),se(F.depthTexture,0);const _e=i.get(F.depthTexture).__webglTexture,Te=Oe(F);if(F.depthTexture.format===$c)Pe(F)?a.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,_e,0,Te):n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,_e,0);else if(F.depthTexture.format===cu)Pe(F)?a.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.TEXTURE_2D,_e,0,Te):n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.TEXTURE_2D,_e,0);else throw new Error("Unknown depthTexture format")}function ft(X){const F=i.get(X),ae=X.isWebGLCubeRenderTarget===!0;if(F.__boundDepthTexture!==X.depthTexture){const _e=X.depthTexture;if(F.__depthDisposeCallback&&F.__depthDisposeCallback(),_e){const Te=()=>{delete F.__boundDepthTexture,delete F.__depthDisposeCallback,_e.removeEventListener("dispose",Te)};_e.addEventListener("dispose",Te),F.__depthDisposeCallback=Te}F.__boundDepthTexture=_e}if(X.depthTexture&&!F.__autoAllocateDepthBuffer){if(ae)throw new Error("target.depthTexture not supported in Cube render targets");be(F.__webglFramebuffer,X)}else if(ae){F.__webglDepthbuffer=[];for(let _e=0;_e<6;_e++)if(t.bindFramebuffer(n.FRAMEBUFFER,F.__webglFramebuffer[_e]),F.__webglDepthbuffer[_e]===void 0)F.__webglDepthbuffer[_e]=n.createRenderbuffer(),Ne(F.__webglDepthbuffer[_e],X,!1);else{const Te=X.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,Se=F.__webglDepthbuffer[_e];n.bindRenderbuffer(n.RENDERBUFFER,Se),n.framebufferRenderbuffer(n.FRAMEBUFFER,Te,n.RENDERBUFFER,Se)}}else if(t.bindFramebuffer(n.FRAMEBUFFER,F.__webglFramebuffer),F.__webglDepthbuffer===void 0)F.__webglDepthbuffer=n.createRenderbuffer(),Ne(F.__webglDepthbuffer,X,!1);else{const _e=X.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,Te=F.__webglDepthbuffer;n.bindRenderbuffer(n.RENDERBUFFER,Te),n.framebufferRenderbuffer(n.FRAMEBUFFER,_e,n.RENDERBUFFER,Te)}t.bindFramebuffer(n.FRAMEBUFFER,null)}function dt(X,F,ae){const _e=i.get(X);F!==void 0&&we(_e.__webglFramebuffer,X,X.texture,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,0),ae!==void 0&&ft(X)}function Ke(X){const F=X.texture,ae=i.get(X),_e=i.get(F);X.addEventListener("dispose",k);const Te=X.textures,Se=X.isWebGLCubeRenderTarget===!0,nt=Te.length>1;if(nt||(_e.__webglTexture===void 0&&(_e.__webglTexture=n.createTexture()),_e.__version=F.version,o.memory.textures++),Se){ae.__webglFramebuffer=[];for(let Ce=0;Ce<6;Ce++)if(F.mipmaps&&F.mipmaps.length>0){ae.__webglFramebuffer[Ce]=[];for(let Ge=0;Ge0){ae.__webglFramebuffer=[];for(let Ce=0;Ce0&&Pe(X)===!1){ae.__webglMultisampledFramebuffer=n.createFramebuffer(),ae.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,ae.__webglMultisampledFramebuffer);for(let Ce=0;Ce0)for(let Ge=0;Ge0)for(let Ge=0;Ge0){if(Pe(X)===!1){const F=X.textures,ae=X.width,_e=X.height;let Te=n.COLOR_BUFFER_BIT;const Se=X.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,nt=i.get(X),Ce=F.length>1;if(Ce)for(let Ge=0;Ge0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&F.__useRenderToTexture!==!1}function Ue(X){const F=o.render.frame;d.get(X)!==F&&(d.set(X,F),X.update())}function lt(X,F){const ae=X.colorSpace,_e=X.format,Te=X.type;return X.isCompressedTexture===!0||X.isVideoTexture===!0||ae!==xa&&ae!==jo&&(cn.getTransfer(ae)===En?(_e!==tr||Te!==js)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",ae)),F}function We(X){return typeof HTMLImageElement<"u"&&X instanceof HTMLImageElement?(c.width=X.naturalWidth||X.width,c.height=X.naturalHeight||X.height):typeof VideoFrame<"u"&&X instanceof VideoFrame?(c.width=X.displayWidth,c.height=X.displayHeight):(c.width=X.width,c.height=X.height),c}this.allocateTextureUnit=V,this.resetTextureUnits=R,this.setTexture2D=se,this.setTexture2DArray=le,this.setTexture3D=ee,this.setTextureCube=pe,this.rebindTextures=dt,this.setupRenderTarget=Ke,this.updateRenderTargetMipmap=ke,this.updateMultisampleRenderTarget=Ve,this.setupDepthRenderbuffer=ft,this.setupFrameBufferTexture=we,this.useMultisampledRTT=Pe}function rV(n,e){function t(i,r=jo){let s;const o=cn.getTransfer(r);if(i===js)return n.UNSIGNED_BYTE;if(i===ax)return n.UNSIGNED_SHORT_4_4_4_4;if(i===lx)return n.UNSIGNED_SHORT_5_5_5_1;if(i===FM)return n.UNSIGNED_INT_5_9_9_9_REV;if(i===OM)return n.BYTE;if(i===UM)return n.SHORT;if(i===dd)return n.UNSIGNED_SHORT;if(i===ox)return n.INT;if(i===pa)return n.UNSIGNED_INT;if(i===kr)return n.FLOAT;if(i===Id)return n.HALF_FLOAT;if(i===VM)return n.ALPHA;if(i===BM)return n.RGB;if(i===tr)return n.RGBA;if(i===zM)return n.LUMINANCE;if(i===HM)return n.LUMINANCE_ALPHA;if(i===$c)return n.DEPTH_COMPONENT;if(i===cu)return n.DEPTH_STENCIL;if(i===cx)return n.RED;if(i===Bm)return n.RED_INTEGER;if(i===GM)return n.RG;if(i===ux)return n.RG_INTEGER;if(i===hx)return n.RGBA_INTEGER;if(i===gp||i===yp||i===vp||i===_p)if(o===En)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(i===gp)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===yp)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===vp)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===_p)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(i===gp)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===yp)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===vp)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===_p)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(i===D0||i===k0||i===O0||i===U0)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(i===D0)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===k0)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===O0)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===U0)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(i===F0||i===V0||i===B0)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(i===F0||i===V0)return o===En?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(i===B0)return o===En?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(i===z0||i===H0||i===G0||i===W0||i===j0||i===X0||i===q0||i===$0||i===Y0||i===K0||i===Q0||i===J0||i===Z0||i===e_)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(i===z0)return o===En?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===H0)return o===En?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===G0)return o===En?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===W0)return o===En?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===j0)return o===En?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===X0)return o===En?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===q0)return o===En?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===$0)return o===En?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===Y0)return o===En?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===K0)return o===En?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===Q0)return o===En?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===J0)return o===En?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===Z0)return o===En?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===e_)return o===En?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===xp||i===t_||i===n_)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(i===xp)return o===En?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===t_)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===n_)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(i===WM||i===i_||i===r_||i===s_)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(i===xp)return s.COMPRESSED_RED_RGTC1_EXT;if(i===i_)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===r_)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===s_)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return i===lu?n.UNSIGNED_INT_24_8:n[i]!==void 0?n[i]:null}return{convert:t}}class sV extends Dn{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class Lh extends Zt{constructor(){super(),this.isGroup=!0,this.type="Group"}}const Qee={type:"move"};class i1{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Lh,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Lh,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new G,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new G),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Lh,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new G,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new G),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,i){let r=null,s=null,o=null;const a=this._targetRay,l=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(c&&e.hand){o=!0;for(const S of e.hand.values()){const x=t.getJointPose(S,i),y=this._getHandJoint(c,S);x!==null&&(y.matrix.fromArray(x.transform.matrix),y.matrix.decompose(y.position,y.rotation,y.scale),y.matrixWorldNeedsUpdate=!0,y.jointRadius=x.radius),y.visible=x!==null}const d=c.joints["index-finger-tip"],f=c.joints["thumb-tip"],p=d.position.distanceTo(f.position),m=.02,_=.005;c.inputState.pinching&&p>m+_?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&p<=m-_&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,i),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(r=t.getPose(e.targetRaySpace,i),r===null&&s!==null&&(r=s),r!==null&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(Qee)))}return a!==null&&(a.visible=r!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const i=new Lh;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}const Jee=` +}`;function Hee(n,e,t){let i=new Wm;const r=new Ee,s=new Ee,o=new sn,a=new tC({depthPacking:UF}),l=new nC,c={},d=t.maxTextureSize,f={[da]:yr,[yr]:da,[Bs]:Bs},p=new qs({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ee},radius:{value:4}},vertexShader:Bee,fragmentShader:zee}),m=p.clone();m.defines.HORIZONTAL_PASS=1;const _=new Vt;_.setAttribute("position",new vn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const S=new ni(_,p),x=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=rx;let y=this.type;this.render=function(k,I,P){if(x.enabled===!1||x.autoUpdate===!1&&x.needsUpdate===!1||k.length===0)return;const D=n.getRenderTarget(),A=n.getActiveCubeFace(),R=n.getActiveMipmapLevel(),V=n.state;V.setBlending(ra),V.buffers.color.setClear(1,1,1,1),V.buffers.depth.setTest(!0),V.setScissorTest(!1);const U=y!==Os&&this.type===Os,se=y===Os&&this.type!==Os;for(let le=0,ee=k.length;led||r.y>d)&&(r.x>d&&(s.x=Math.floor(d/J.x),r.x=s.x*J.x,W.mapSize.x=s.x),r.y>d&&(s.y=Math.floor(d/J.y),r.y=s.y*J.y,W.mapSize.y=s.y)),W.map===null||U===!0||se===!0){const oe=this.type!==Os?{minFilter:Ai,magFilter:Ai}:{};W.map!==null&&W.map.dispose(),W.map=new Xs(r.x,r.y,oe),W.map.texture.name=pe.name+".shadowMap",W.camera.updateProjectionMatrix()}n.setRenderTarget(W.map),n.clear();const Z=W.getViewportCount();for(let oe=0;oe0||I.map&&I.alphaTest>0){const V=A.uuid,U=I.uuid;let se=c[V];se===void 0&&(se={},c[V]=se);let le=se[U];le===void 0&&(le=A.clone(),se[U]=le,I.addEventListener("dispose",O)),A=le}if(A.visible=I.visible,A.wireframe=I.wireframe,D===Os?A.side=I.shadowSide!==null?I.shadowSide:I.side:A.side=I.shadowSide!==null?I.shadowSide:f[I.side],A.alphaMap=I.alphaMap,A.alphaTest=I.alphaTest,A.map=I.map,A.clipShadows=I.clipShadows,A.clippingPlanes=I.clippingPlanes,A.clipIntersection=I.clipIntersection,A.displacementMap=I.displacementMap,A.displacementScale=I.displacementScale,A.displacementBias=I.displacementBias,A.wireframeLinewidth=I.wireframeLinewidth,A.linewidth=I.linewidth,P.isPointLight===!0&&A.isMeshDistanceMaterial===!0){const V=n.properties.get(A);V.light=P}return A}function M(k,I,P,D,A){if(k.visible===!1)return;if(k.layers.test(I.layers)&&(k.isMesh||k.isLine||k.isPoints)&&(k.castShadow||k.receiveShadow&&A===Os)&&(!k.frustumCulled||i.intersectsObject(k))){k.modelViewMatrix.multiplyMatrices(P.matrixWorldInverse,k.matrixWorld);const U=e.update(k),se=k.material;if(Array.isArray(se)){const le=U.groups;for(let ee=0,pe=le.length;ee=1):pe.indexOf("OpenGL ES")!==-1&&(ee=parseFloat(/^OpenGL ES (\d)/.exec(pe)[1]),le=ee>=2);let W=null,J={};const Z=n.getParameter(n.SCISSOR_BOX),oe=n.getParameter(n.VIEWPORT),Me=new sn().fromArray(Z),Re=new sn().fromArray(oe);function he(Y,Fe,me,Ae){const Xe=new Uint8Array(4),$e=n.createTexture();n.bindTexture(Y,$e),n.texParameteri(Y,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(Y,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let At=0;Ate?(n.repeat.x=1,n.repeat.y=t/e,n.offset.x=0,n.offset.y=(1-n.repeat.y)/2):(n.repeat.x=e/t,n.repeat.y=1,n.offset.x=(1-n.repeat.x)/2,n.offset.y=0),n}function Xee(n,e){const t=n.image&&n.image.width?n.image.width/n.image.height:1;return t>e?(n.repeat.x=e/t,n.repeat.y=1,n.offset.x=(1-n.repeat.x)/2,n.offset.y=0):(n.repeat.x=1,n.repeat.y=t/e,n.offset.x=0,n.offset.y=(1-n.repeat.y)/2),n}function qee(n){return n.repeat.x=1,n.repeat.y=1,n.offset.x=0,n.offset.y=0,n}function _T(n,e,t,i){const r=$ee(i);switch(t){case VM:return n*e;case zM:return n*e;case HM:return n*e*2;case cx:return n*e/r.components*r.byteLength;case Bm:return n*e/r.components*r.byteLength;case GM:return n*e*2/r.components*r.byteLength;case ux:return n*e*2/r.components*r.byteLength;case BM:return n*e*3/r.components*r.byteLength;case tr:return n*e*4/r.components*r.byteLength;case hx:return n*e*4/r.components*r.byteLength;case gp:case yp:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case vp:case _p:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case k0:case U0:return Math.max(n,16)*Math.max(e,8)/4;case D0:case O0:return Math.max(n,8)*Math.max(e,8)/2;case F0:case V0:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case B0:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case z0:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case H0:return Math.floor((n+4)/5)*Math.floor((e+3)/4)*16;case G0:return Math.floor((n+4)/5)*Math.floor((e+4)/5)*16;case W0:return Math.floor((n+5)/6)*Math.floor((e+4)/5)*16;case j0:return Math.floor((n+5)/6)*Math.floor((e+5)/6)*16;case X0:return Math.floor((n+7)/8)*Math.floor((e+4)/5)*16;case q0:return Math.floor((n+7)/8)*Math.floor((e+5)/6)*16;case $0:return Math.floor((n+7)/8)*Math.floor((e+7)/8)*16;case Y0:return Math.floor((n+9)/10)*Math.floor((e+4)/5)*16;case K0:return Math.floor((n+9)/10)*Math.floor((e+5)/6)*16;case Q0:return Math.floor((n+9)/10)*Math.floor((e+7)/8)*16;case J0:return Math.floor((n+9)/10)*Math.floor((e+9)/10)*16;case Z0:return Math.floor((n+11)/12)*Math.floor((e+9)/10)*16;case e_:return Math.floor((n+11)/12)*Math.floor((e+11)/12)*16;case xp:case t_:case n_:return Math.ceil(n/4)*Math.ceil(e/4)*16;case WM:case i_:return Math.ceil(n/4)*Math.ceil(e/4)*8;case r_:case s_:return Math.ceil(n/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function $ee(n){switch(n){case js:case OM:return{byteLength:1,components:1};case dd:case UM:case Id:return{byteLength:2,components:1};case ax:case lx:return{byteLength:2,components:4};case pa:case ox:case kr:return{byteLength:4,components:1};case FM:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${n}.`)}const Yee={contain:jee,cover:Xee,fill:qee,getByteLength:_T};function Kee(n,e,t,i,r,s,o){const a=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,l=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new Ee,d=new WeakMap;let f;const p=new WeakMap;let m=!1;try{m=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function _(X,F){return m?new OffscreenCanvas(X,F):cm("canvas")}function S(X,F,ae){let _e=1;const Te=We(X);if((Te.width>ae||Te.height>ae)&&(_e=ae/Math.max(Te.width,Te.height)),_e<1)if(typeof HTMLImageElement<"u"&&X instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&X instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&X instanceof ImageBitmap||typeof VideoFrame<"u"&&X instanceof VideoFrame){const Se=Math.floor(_e*Te.width),nt=Math.floor(_e*Te.height);f===void 0&&(f=_(Se,nt));const Ce=F?_(Se,nt):f;return Ce.width=Se,Ce.height=nt,Ce.getContext("2d").drawImage(X,0,0,Se,nt),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+Te.width+"x"+Te.height+") to ("+Se+"x"+nt+")."),Ce}else return"data"in X&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+Te.width+"x"+Te.height+")."),X;return X}function x(X){return X.generateMipmaps&&X.minFilter!==Ai&&X.minFilter!==fi}function y(X){n.generateMipmap(X)}function E(X,F,ae,_e,Te=!1){if(X!==null){if(n[X]!==void 0)return n[X];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+X+"'")}let Se=F;if(F===n.RED&&(ae===n.FLOAT&&(Se=n.R32F),ae===n.HALF_FLOAT&&(Se=n.R16F),ae===n.UNSIGNED_BYTE&&(Se=n.R8)),F===n.RED_INTEGER&&(ae===n.UNSIGNED_BYTE&&(Se=n.R8UI),ae===n.UNSIGNED_SHORT&&(Se=n.R16UI),ae===n.UNSIGNED_INT&&(Se=n.R32UI),ae===n.BYTE&&(Se=n.R8I),ae===n.SHORT&&(Se=n.R16I),ae===n.INT&&(Se=n.R32I)),F===n.RG&&(ae===n.FLOAT&&(Se=n.RG32F),ae===n.HALF_FLOAT&&(Se=n.RG16F),ae===n.UNSIGNED_BYTE&&(Se=n.RG8)),F===n.RG_INTEGER&&(ae===n.UNSIGNED_BYTE&&(Se=n.RG8UI),ae===n.UNSIGNED_SHORT&&(Se=n.RG16UI),ae===n.UNSIGNED_INT&&(Se=n.RG32UI),ae===n.BYTE&&(Se=n.RG8I),ae===n.SHORT&&(Se=n.RG16I),ae===n.INT&&(Se=n.RG32I)),F===n.RGB_INTEGER&&(ae===n.UNSIGNED_BYTE&&(Se=n.RGB8UI),ae===n.UNSIGNED_SHORT&&(Se=n.RGB16UI),ae===n.UNSIGNED_INT&&(Se=n.RGB32UI),ae===n.BYTE&&(Se=n.RGB8I),ae===n.SHORT&&(Se=n.RGB16I),ae===n.INT&&(Se=n.RGB32I)),F===n.RGBA_INTEGER&&(ae===n.UNSIGNED_BYTE&&(Se=n.RGBA8UI),ae===n.UNSIGNED_SHORT&&(Se=n.RGBA16UI),ae===n.UNSIGNED_INT&&(Se=n.RGBA32UI),ae===n.BYTE&&(Se=n.RGBA8I),ae===n.SHORT&&(Se=n.RGBA16I),ae===n.INT&&(Se=n.RGBA32I)),F===n.RGB&&ae===n.UNSIGNED_INT_5_9_9_9_REV&&(Se=n.RGB9_E5),F===n.RGBA){const nt=Te?rm:cn.getTransfer(_e);ae===n.FLOAT&&(Se=n.RGBA32F),ae===n.HALF_FLOAT&&(Se=n.RGBA16F),ae===n.UNSIGNED_BYTE&&(Se=nt===En?n.SRGB8_ALPHA8:n.RGBA8),ae===n.UNSIGNED_SHORT_4_4_4_4&&(Se=n.RGBA4),ae===n.UNSIGNED_SHORT_5_5_5_1&&(Se=n.RGB5_A1)}return(Se===n.R16F||Se===n.R32F||Se===n.RG16F||Se===n.RG32F||Se===n.RGBA16F||Se===n.RGBA32F)&&e.get("EXT_color_buffer_float"),Se}function w(X,F){let ae;return X?F===null||F===pa||F===lu?ae=n.DEPTH24_STENCIL8:F===kr?ae=n.DEPTH32F_STENCIL8:F===dd&&(ae=n.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):F===null||F===pa||F===lu?ae=n.DEPTH_COMPONENT24:F===kr?ae=n.DEPTH_COMPONENT32F:F===dd&&(ae=n.DEPTH_COMPONENT16),ae}function M(X,F){return x(X)===!0||X.isFramebufferTexture&&X.minFilter!==Ai&&X.minFilter!==fi?Math.log2(Math.max(F.width,F.height))+1:X.mipmaps!==void 0&&X.mipmaps.length>0?X.mipmaps.length:X.isCompressedTexture&&Array.isArray(X.image)?F.mipmaps.length:1}function O(X){const F=X.target;F.removeEventListener("dispose",O),I(F),F.isVideoTexture&&d.delete(F)}function k(X){const F=X.target;F.removeEventListener("dispose",k),D(F)}function I(X){const F=i.get(X);if(F.__webglInit===void 0)return;const ae=X.source,_e=p.get(ae);if(_e){const Te=_e[F.__cacheKey];Te.usedTimes--,Te.usedTimes===0&&P(X),Object.keys(_e).length===0&&p.delete(ae)}i.remove(X)}function P(X){const F=i.get(X);n.deleteTexture(F.__webglTexture);const ae=X.source,_e=p.get(ae);delete _e[F.__cacheKey],o.memory.textures--}function D(X){const F=i.get(X);if(X.depthTexture&&X.depthTexture.dispose(),X.isWebGLCubeRenderTarget)for(let _e=0;_e<6;_e++){if(Array.isArray(F.__webglFramebuffer[_e]))for(let Te=0;Te=r.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+X+" texture units while this GPU supports only "+r.maxTextures),A+=1,X}function U(X){const F=[];return F.push(X.wrapS),F.push(X.wrapT),F.push(X.wrapR||0),F.push(X.magFilter),F.push(X.minFilter),F.push(X.anisotropy),F.push(X.internalFormat),F.push(X.format),F.push(X.type),F.push(X.generateMipmaps),F.push(X.premultiplyAlpha),F.push(X.flipY),F.push(X.unpackAlignment),F.push(X.colorSpace),F.join()}function se(X,F){const ae=i.get(X);if(X.isVideoTexture&&Ue(X),X.isRenderTargetTexture===!1&&X.version>0&&ae.__version!==X.version){const _e=X.image;if(_e===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(_e.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Re(ae,X,F);return}}t.bindTexture(n.TEXTURE_2D,ae.__webglTexture,n.TEXTURE0+F)}function le(X,F){const ae=i.get(X);if(X.version>0&&ae.__version!==X.version){Re(ae,X,F);return}t.bindTexture(n.TEXTURE_2D_ARRAY,ae.__webglTexture,n.TEXTURE0+F)}function ee(X,F){const ae=i.get(X);if(X.version>0&&ae.__version!==X.version){Re(ae,X,F);return}t.bindTexture(n.TEXTURE_3D,ae.__webglTexture,n.TEXTURE0+F)}function pe(X,F){const ae=i.get(X);if(X.version>0&&ae.__version!==X.version){he(ae,X,F);return}t.bindTexture(n.TEXTURE_CUBE_MAP,ae.__webglTexture,n.TEXTURE0+F)}const W={[em]:n.REPEAT,[Es]:n.CLAMP_TO_EDGE,[tm]:n.MIRRORED_REPEAT},J={[Ai]:n.NEAREST,[kM]:n.NEAREST_MIPMAP_NEAREST,[Ph]:n.NEAREST_MIPMAP_LINEAR,[fi]:n.LINEAR,[mp]:n.LINEAR_MIPMAP_NEAREST,[ho]:n.LINEAR_MIPMAP_LINEAR},Z={[VF]:n.NEVER,[jF]:n.ALWAYS,[BF]:n.LESS,[XM]:n.LEQUAL,[zF]:n.EQUAL,[WF]:n.GEQUAL,[HF]:n.GREATER,[GF]:n.NOTEQUAL};function oe(X,F){if(F.type===kr&&e.has("OES_texture_float_linear")===!1&&(F.magFilter===fi||F.magFilter===mp||F.magFilter===Ph||F.magFilter===ho||F.minFilter===fi||F.minFilter===mp||F.minFilter===Ph||F.minFilter===ho)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),n.texParameteri(X,n.TEXTURE_WRAP_S,W[F.wrapS]),n.texParameteri(X,n.TEXTURE_WRAP_T,W[F.wrapT]),(X===n.TEXTURE_3D||X===n.TEXTURE_2D_ARRAY)&&n.texParameteri(X,n.TEXTURE_WRAP_R,W[F.wrapR]),n.texParameteri(X,n.TEXTURE_MAG_FILTER,J[F.magFilter]),n.texParameteri(X,n.TEXTURE_MIN_FILTER,J[F.minFilter]),F.compareFunction&&(n.texParameteri(X,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(X,n.TEXTURE_COMPARE_FUNC,Z[F.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(F.magFilter===Ai||F.minFilter!==Ph&&F.minFilter!==ho||F.type===kr&&e.has("OES_texture_float_linear")===!1)return;if(F.anisotropy>1||i.get(F).__currentAnisotropy){const ae=e.get("EXT_texture_filter_anisotropic");n.texParameterf(X,ae.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(F.anisotropy,r.getMaxAnisotropy())),i.get(F).__currentAnisotropy=F.anisotropy}}}function Me(X,F){let ae=!1;X.__webglInit===void 0&&(X.__webglInit=!0,F.addEventListener("dispose",O));const _e=F.source;let Te=p.get(_e);Te===void 0&&(Te={},p.set(_e,Te));const Se=U(F);if(Se!==X.__cacheKey){Te[Se]===void 0&&(Te[Se]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,ae=!0),Te[Se].usedTimes++;const nt=Te[X.__cacheKey];nt!==void 0&&(Te[X.__cacheKey].usedTimes--,nt.usedTimes===0&&P(F)),X.__cacheKey=Se,X.__webglTexture=Te[Se].texture}return ae}function Re(X,F,ae){let _e=n.TEXTURE_2D;(F.isDataArrayTexture||F.isCompressedArrayTexture)&&(_e=n.TEXTURE_2D_ARRAY),F.isData3DTexture&&(_e=n.TEXTURE_3D);const Te=Me(X,F),Se=F.source;t.bindTexture(_e,X.__webglTexture,n.TEXTURE0+ae);const nt=i.get(Se);if(Se.version!==nt.__version||Te===!0){t.activeTexture(n.TEXTURE0+ae);const Ce=cn.getPrimaries(cn.workingColorSpace),Ge=F.colorSpace===jo?null:cn.getPrimaries(F.colorSpace),Lt=F.colorSpace===jo||Ce===Ge?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,F.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,F.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,F.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,Lt);let Le=S(F.image,!1,r.maxTextureSize);Le=lt(F,Le);const Ze=s.convert(F.format,F.colorSpace),Et=s.convert(F.type);let vt=E(F.internalFormat,Ze,Et,F.colorSpace,F.isVideoTexture);oe(_e,F);let et;const K=F.mipmaps,ve=F.isVideoTexture!==!0,je=nt.__version===void 0||Te===!0,Y=Se.dataReady,Fe=M(F,Le);if(F.isDepthTexture)vt=w(F.format===cu,F.type),je&&(ve?t.texStorage2D(n.TEXTURE_2D,1,vt,Le.width,Le.height):t.texImage2D(n.TEXTURE_2D,0,vt,Le.width,Le.height,0,Ze,Et,null));else if(F.isDataTexture)if(K.length>0){ve&&je&&t.texStorage2D(n.TEXTURE_2D,Fe,vt,K[0].width,K[0].height);for(let me=0,Ae=K.length;me0){const Xe=_T(et.width,et.height,F.format,F.type);for(const $e of F.layerUpdates){const At=et.data.subarray($e*Xe/et.data.BYTES_PER_ELEMENT,($e+1)*Xe/et.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,me,0,0,$e,et.width,et.height,1,Ze,At,0,0)}F.clearLayerUpdates()}else t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,me,0,0,0,et.width,et.height,Le.depth,Ze,et.data,0,0)}else t.compressedTexImage3D(n.TEXTURE_2D_ARRAY,me,vt,et.width,et.height,Le.depth,0,et.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else ve?Y&&t.texSubImage3D(n.TEXTURE_2D_ARRAY,me,0,0,0,et.width,et.height,Le.depth,Ze,Et,et.data):t.texImage3D(n.TEXTURE_2D_ARRAY,me,vt,et.width,et.height,Le.depth,0,Ze,Et,et.data)}else{ve&&je&&t.texStorage2D(n.TEXTURE_2D,Fe,vt,K[0].width,K[0].height);for(let me=0,Ae=K.length;me0){const me=_T(Le.width,Le.height,F.format,F.type);for(const Ae of F.layerUpdates){const Xe=Le.data.subarray(Ae*me/Le.data.BYTES_PER_ELEMENT,(Ae+1)*me/Le.data.BYTES_PER_ELEMENT);t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,Ae,Le.width,Le.height,1,Ze,Et,Xe)}F.clearLayerUpdates()}else t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,0,Le.width,Le.height,Le.depth,Ze,Et,Le.data)}else t.texImage3D(n.TEXTURE_2D_ARRAY,0,vt,Le.width,Le.height,Le.depth,0,Ze,Et,Le.data);else if(F.isData3DTexture)ve?(je&&t.texStorage3D(n.TEXTURE_3D,Fe,vt,Le.width,Le.height,Le.depth),Y&&t.texSubImage3D(n.TEXTURE_3D,0,0,0,0,Le.width,Le.height,Le.depth,Ze,Et,Le.data)):t.texImage3D(n.TEXTURE_3D,0,vt,Le.width,Le.height,Le.depth,0,Ze,Et,Le.data);else if(F.isFramebufferTexture){if(je)if(ve)t.texStorage2D(n.TEXTURE_2D,Fe,vt,Le.width,Le.height);else{let me=Le.width,Ae=Le.height;for(let Xe=0;Xe>=1,Ae>>=1}}else if(K.length>0){if(ve&&je){const me=We(K[0]);t.texStorage2D(n.TEXTURE_2D,Fe,vt,me.width,me.height)}for(let me=0,Ae=K.length;me0&&Fe++;const Ae=We(Ze[0]);t.texStorage2D(n.TEXTURE_CUBE_MAP,Fe,K,Ae.width,Ae.height)}for(let Ae=0;Ae<6;Ae++)if(Le){ve?Y&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Ae,0,0,0,Ze[Ae].width,Ze[Ae].height,vt,et,Ze[Ae].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Ae,0,K,Ze[Ae].width,Ze[Ae].height,0,vt,et,Ze[Ae].data);for(let Xe=0;Xe>Se),Ze=Math.max(1,F.height>>Se);Te===n.TEXTURE_3D||Te===n.TEXTURE_2D_ARRAY?t.texImage3D(Te,Se,Ge,Le,Ze,F.depth,0,nt,Ce,null):t.texImage2D(Te,Se,Ge,Le,Ze,0,nt,Ce,null)}t.bindFramebuffer(n.FRAMEBUFFER,X),Pe(F)?a.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,_e,Te,i.get(ae).__webglTexture,0,Oe(F)):(Te===n.TEXTURE_2D||Te>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&Te<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,_e,Te,i.get(ae).__webglTexture,Se),t.bindFramebuffer(n.FRAMEBUFFER,null)}function Ne(X,F,ae){if(n.bindRenderbuffer(n.RENDERBUFFER,X),F.depthBuffer){const _e=F.depthTexture,Te=_e&&_e.isDepthTexture?_e.type:null,Se=w(F.stencilBuffer,Te),nt=F.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,Ce=Oe(F);Pe(F)?a.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,Ce,Se,F.width,F.height):ae?n.renderbufferStorageMultisample(n.RENDERBUFFER,Ce,Se,F.width,F.height):n.renderbufferStorage(n.RENDERBUFFER,Se,F.width,F.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,nt,n.RENDERBUFFER,X)}else{const _e=F.textures;for(let Te=0;Te<_e.length;Te++){const Se=_e[Te],nt=s.convert(Se.format,Se.colorSpace),Ce=s.convert(Se.type),Ge=E(Se.internalFormat,nt,Ce,Se.colorSpace),Lt=Oe(F);ae&&Pe(F)===!1?n.renderbufferStorageMultisample(n.RENDERBUFFER,Lt,Ge,F.width,F.height):Pe(F)?a.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,Lt,Ge,F.width,F.height):n.renderbufferStorage(n.RENDERBUFFER,Ge,F.width,F.height)}}n.bindRenderbuffer(n.RENDERBUFFER,null)}function be(X,F){if(F&&F.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(n.FRAMEBUFFER,X),!(F.depthTexture&&F.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!i.get(F.depthTexture).__webglTexture||F.depthTexture.image.width!==F.width||F.depthTexture.image.height!==F.height)&&(F.depthTexture.image.width=F.width,F.depthTexture.image.height=F.height,F.depthTexture.needsUpdate=!0),se(F.depthTexture,0);const _e=i.get(F.depthTexture).__webglTexture,Te=Oe(F);if(F.depthTexture.format===$c)Pe(F)?a.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,_e,0,Te):n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,_e,0);else if(F.depthTexture.format===cu)Pe(F)?a.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.TEXTURE_2D,_e,0,Te):n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.TEXTURE_2D,_e,0);else throw new Error("Unknown depthTexture format")}function ft(X){const F=i.get(X),ae=X.isWebGLCubeRenderTarget===!0;if(F.__boundDepthTexture!==X.depthTexture){const _e=X.depthTexture;if(F.__depthDisposeCallback&&F.__depthDisposeCallback(),_e){const Te=()=>{delete F.__boundDepthTexture,delete F.__depthDisposeCallback,_e.removeEventListener("dispose",Te)};_e.addEventListener("dispose",Te),F.__depthDisposeCallback=Te}F.__boundDepthTexture=_e}if(X.depthTexture&&!F.__autoAllocateDepthBuffer){if(ae)throw new Error("target.depthTexture not supported in Cube render targets");be(F.__webglFramebuffer,X)}else if(ae){F.__webglDepthbuffer=[];for(let _e=0;_e<6;_e++)if(t.bindFramebuffer(n.FRAMEBUFFER,F.__webglFramebuffer[_e]),F.__webglDepthbuffer[_e]===void 0)F.__webglDepthbuffer[_e]=n.createRenderbuffer(),Ne(F.__webglDepthbuffer[_e],X,!1);else{const Te=X.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,Se=F.__webglDepthbuffer[_e];n.bindRenderbuffer(n.RENDERBUFFER,Se),n.framebufferRenderbuffer(n.FRAMEBUFFER,Te,n.RENDERBUFFER,Se)}}else if(t.bindFramebuffer(n.FRAMEBUFFER,F.__webglFramebuffer),F.__webglDepthbuffer===void 0)F.__webglDepthbuffer=n.createRenderbuffer(),Ne(F.__webglDepthbuffer,X,!1);else{const _e=X.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,Te=F.__webglDepthbuffer;n.bindRenderbuffer(n.RENDERBUFFER,Te),n.framebufferRenderbuffer(n.FRAMEBUFFER,_e,n.RENDERBUFFER,Te)}t.bindFramebuffer(n.FRAMEBUFFER,null)}function dt(X,F,ae){const _e=i.get(X);F!==void 0&&we(_e.__webglFramebuffer,X,X.texture,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,0),ae!==void 0&&ft(X)}function Ke(X){const F=X.texture,ae=i.get(X),_e=i.get(F);X.addEventListener("dispose",k);const Te=X.textures,Se=X.isWebGLCubeRenderTarget===!0,nt=Te.length>1;if(nt||(_e.__webglTexture===void 0&&(_e.__webglTexture=n.createTexture()),_e.__version=F.version,o.memory.textures++),Se){ae.__webglFramebuffer=[];for(let Ce=0;Ce<6;Ce++)if(F.mipmaps&&F.mipmaps.length>0){ae.__webglFramebuffer[Ce]=[];for(let Ge=0;Ge0){ae.__webglFramebuffer=[];for(let Ce=0;Ce0&&Pe(X)===!1){ae.__webglMultisampledFramebuffer=n.createFramebuffer(),ae.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,ae.__webglMultisampledFramebuffer);for(let Ce=0;Ce0)for(let Ge=0;Ge0)for(let Ge=0;Ge0){if(Pe(X)===!1){const F=X.textures,ae=X.width,_e=X.height;let Te=n.COLOR_BUFFER_BIT;const Se=X.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,nt=i.get(X),Ce=F.length>1;if(Ce)for(let Ge=0;Ge0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&F.__useRenderToTexture!==!1}function Ue(X){const F=o.render.frame;d.get(X)!==F&&(d.set(X,F),X.update())}function lt(X,F){const ae=X.colorSpace,_e=X.format,Te=X.type;return X.isCompressedTexture===!0||X.isVideoTexture===!0||ae!==xa&&ae!==jo&&(cn.getTransfer(ae)===En?(_e!==tr||Te!==js)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",ae)),F}function We(X){return typeof HTMLImageElement<"u"&&X instanceof HTMLImageElement?(c.width=X.naturalWidth||X.width,c.height=X.naturalHeight||X.height):typeof VideoFrame<"u"&&X instanceof VideoFrame?(c.width=X.displayWidth,c.height=X.displayHeight):(c.width=X.width,c.height=X.height),c}this.allocateTextureUnit=V,this.resetTextureUnits=R,this.setTexture2D=se,this.setTexture2DArray=le,this.setTexture3D=ee,this.setTextureCube=pe,this.rebindTextures=dt,this.setupRenderTarget=Ke,this.updateRenderTargetMipmap=ke,this.updateMultisampleRenderTarget=Ve,this.setupDepthRenderbuffer=ft,this.setupFrameBufferTexture=we,this.useMultisampledRTT=Pe}function sV(n,e){function t(i,r=jo){let s;const o=cn.getTransfer(r);if(i===js)return n.UNSIGNED_BYTE;if(i===ax)return n.UNSIGNED_SHORT_4_4_4_4;if(i===lx)return n.UNSIGNED_SHORT_5_5_5_1;if(i===FM)return n.UNSIGNED_INT_5_9_9_9_REV;if(i===OM)return n.BYTE;if(i===UM)return n.SHORT;if(i===dd)return n.UNSIGNED_SHORT;if(i===ox)return n.INT;if(i===pa)return n.UNSIGNED_INT;if(i===kr)return n.FLOAT;if(i===Id)return n.HALF_FLOAT;if(i===VM)return n.ALPHA;if(i===BM)return n.RGB;if(i===tr)return n.RGBA;if(i===zM)return n.LUMINANCE;if(i===HM)return n.LUMINANCE_ALPHA;if(i===$c)return n.DEPTH_COMPONENT;if(i===cu)return n.DEPTH_STENCIL;if(i===cx)return n.RED;if(i===Bm)return n.RED_INTEGER;if(i===GM)return n.RG;if(i===ux)return n.RG_INTEGER;if(i===hx)return n.RGBA_INTEGER;if(i===gp||i===yp||i===vp||i===_p)if(o===En)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(i===gp)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===yp)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===vp)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===_p)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(i===gp)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===yp)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===vp)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===_p)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(i===D0||i===k0||i===O0||i===U0)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(i===D0)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===k0)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===O0)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===U0)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(i===F0||i===V0||i===B0)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(i===F0||i===V0)return o===En?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(i===B0)return o===En?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(i===z0||i===H0||i===G0||i===W0||i===j0||i===X0||i===q0||i===$0||i===Y0||i===K0||i===Q0||i===J0||i===Z0||i===e_)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(i===z0)return o===En?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===H0)return o===En?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===G0)return o===En?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===W0)return o===En?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===j0)return o===En?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===X0)return o===En?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===q0)return o===En?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===$0)return o===En?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===Y0)return o===En?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===K0)return o===En?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===Q0)return o===En?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===J0)return o===En?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===Z0)return o===En?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===e_)return o===En?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===xp||i===t_||i===n_)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(i===xp)return o===En?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===t_)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===n_)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(i===WM||i===i_||i===r_||i===s_)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(i===xp)return s.COMPRESSED_RED_RGTC1_EXT;if(i===i_)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===r_)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===s_)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return i===lu?n.UNSIGNED_INT_24_8:n[i]!==void 0?n[i]:null}return{convert:t}}class oV extends Dn{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class Lh extends Zt{constructor(){super(),this.isGroup=!0,this.type="Group"}}const Qee={type:"move"};class i1{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Lh,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Lh,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new G,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new G),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Lh,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new G,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new G),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,i){let r=null,s=null,o=null;const a=this._targetRay,l=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(c&&e.hand){o=!0;for(const S of e.hand.values()){const x=t.getJointPose(S,i),y=this._getHandJoint(c,S);x!==null&&(y.matrix.fromArray(x.transform.matrix),y.matrix.decompose(y.position,y.rotation,y.scale),y.matrixWorldNeedsUpdate=!0,y.jointRadius=x.radius),y.visible=x!==null}const d=c.joints["index-finger-tip"],f=c.joints["thumb-tip"],p=d.position.distanceTo(f.position),m=.02,_=.005;c.inputState.pinching&&p>m+_?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&p<=m-_&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,i),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(r=t.getPose(e.targetRaySpace,i),r===null&&s!==null&&(r=s),r!==null&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(Qee)))}return a!==null&&(a.visible=r!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const i=new Lh;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}const Jee=` void main() { gl_Position = vec4( position, 1.0 ); @@ -5792,7 +5792,7 @@ void main() { } -}`;class ete{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,i){if(this.texture===null){const r=new In,s=e.properties.get(r);s.__webglTexture=t.texture,(t.depthNear!=i.depthNear||t.depthFar!=i.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=r}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,i=new qs({vertexShader:Jee,fragmentShader:Zee,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new ni(new Ld(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class tte extends Ys{constructor(e,t){super();const i=this;let r=null,s=1,o=null,a="local-floor",l=1,c=null,d=null,f=null,p=null,m=null,_=null;const S=new ete,x=t.getContextAttributes();let y=null,E=null;const w=[],M=[],O=new Ee;let k=null;const I=new Dn;I.layers.enable(1),I.viewport=new sn;const P=new Dn;P.layers.enable(2),P.viewport=new sn;const D=[I,P],A=new sV;A.layers.enable(1),A.layers.enable(2);let R=null,V=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(he){let we=w[he];return we===void 0&&(we=new i1,w[he]=we),we.getTargetRaySpace()},this.getControllerGrip=function(he){let we=w[he];return we===void 0&&(we=new i1,w[he]=we),we.getGripSpace()},this.getHand=function(he){let we=w[he];return we===void 0&&(we=new i1,w[he]=we),we.getHandSpace()};function U(he){const we=M.indexOf(he.inputSource);if(we===-1)return;const Ne=w[we];Ne!==void 0&&(Ne.update(he.inputSource,he.frame,c||o),Ne.dispatchEvent({type:he.type,data:he.inputSource}))}function se(){r.removeEventListener("select",U),r.removeEventListener("selectstart",U),r.removeEventListener("selectend",U),r.removeEventListener("squeeze",U),r.removeEventListener("squeezestart",U),r.removeEventListener("squeezeend",U),r.removeEventListener("end",se),r.removeEventListener("inputsourceschange",le);for(let he=0;he=0&&(M[be]=null,w[be].disconnect(Ne))}for(let we=0;we=M.length){M.push(Ne),be=dt;break}else if(M[dt]===null){M[dt]=Ne,be=dt;break}if(be===-1)break}const ft=w[be];ft&&ft.connect(Ne)}}const ee=new G,pe=new G;function W(he,we,Ne){ee.setFromMatrixPosition(we.matrixWorld),pe.setFromMatrixPosition(Ne.matrixWorld);const be=ee.distanceTo(pe),ft=we.projectionMatrix.elements,dt=Ne.projectionMatrix.elements,Ke=ft[14]/(ft[10]-1),ke=ft[14]/(ft[10]+1),xe=(ft[9]+1)/ft[5],j=(ft[9]-1)/ft[5],Ve=(ft[8]-1)/ft[0],Oe=(dt[8]+1)/dt[0],Pe=Ke*Ve,Ue=Ke*Oe,lt=be/(-Ve+Oe),We=lt*-Ve;if(we.matrixWorld.decompose(he.position,he.quaternion,he.scale),he.translateX(We),he.translateZ(lt),he.matrixWorld.compose(he.position,he.quaternion,he.scale),he.matrixWorldInverse.copy(he.matrixWorld).invert(),ft[10]===-1)he.projectionMatrix.copy(we.projectionMatrix),he.projectionMatrixInverse.copy(we.projectionMatrixInverse);else{const X=Ke+lt,F=ke+lt,ae=Pe-We,_e=Ue+(be-We),Te=xe*ke/F*X,Se=j*ke/F*X;he.projectionMatrix.makePerspective(ae,_e,Te,Se,X,F),he.projectionMatrixInverse.copy(he.projectionMatrix).invert()}}function J(he,we){we===null?he.matrixWorld.copy(he.matrix):he.matrixWorld.multiplyMatrices(we.matrixWorld,he.matrix),he.matrixWorldInverse.copy(he.matrixWorld).invert()}this.updateCamera=function(he){if(r===null)return;let we=he.near,Ne=he.far;S.texture!==null&&(S.depthNear>0&&(we=S.depthNear),S.depthFar>0&&(Ne=S.depthFar)),A.near=P.near=I.near=we,A.far=P.far=I.far=Ne,(R!==A.near||V!==A.far)&&(r.updateRenderState({depthNear:A.near,depthFar:A.far}),R=A.near,V=A.far);const be=he.parent,ft=A.cameras;J(A,be);for(let dt=0;dt0&&(x.alphaTest.value=y.alphaTest);const E=e.get(y),w=E.envMap,M=E.envMapRotation;w&&(x.envMap.value=w,pc.copy(M),pc.x*=-1,pc.y*=-1,pc.z*=-1,w.isCubeTexture&&w.isRenderTargetTexture===!1&&(pc.y*=-1,pc.z*=-1),x.envMapRotation.value.setFromMatrix4(nte.makeRotationFromEuler(pc)),x.flipEnvMap.value=w.isCubeTexture&&w.isRenderTargetTexture===!1?-1:1,x.reflectivity.value=y.reflectivity,x.ior.value=y.ior,x.refractionRatio.value=y.refractionRatio),y.lightMap&&(x.lightMap.value=y.lightMap,x.lightMapIntensity.value=y.lightMapIntensity,t(y.lightMap,x.lightMapTransform)),y.aoMap&&(x.aoMap.value=y.aoMap,x.aoMapIntensity.value=y.aoMapIntensity,t(y.aoMap,x.aoMapTransform))}function o(x,y){x.diffuse.value.copy(y.color),x.opacity.value=y.opacity,y.map&&(x.map.value=y.map,t(y.map,x.mapTransform))}function a(x,y){x.dashSize.value=y.dashSize,x.totalSize.value=y.dashSize+y.gapSize,x.scale.value=y.scale}function l(x,y,E,w){x.diffuse.value.copy(y.color),x.opacity.value=y.opacity,x.size.value=y.size*E,x.scale.value=w*.5,y.map&&(x.map.value=y.map,t(y.map,x.uvTransform)),y.alphaMap&&(x.alphaMap.value=y.alphaMap,t(y.alphaMap,x.alphaMapTransform)),y.alphaTest>0&&(x.alphaTest.value=y.alphaTest)}function c(x,y){x.diffuse.value.copy(y.color),x.opacity.value=y.opacity,x.rotation.value=y.rotation,y.map&&(x.map.value=y.map,t(y.map,x.mapTransform)),y.alphaMap&&(x.alphaMap.value=y.alphaMap,t(y.alphaMap,x.alphaMapTransform)),y.alphaTest>0&&(x.alphaTest.value=y.alphaTest)}function d(x,y){x.specular.value.copy(y.specular),x.shininess.value=Math.max(y.shininess,1e-4)}function f(x,y){y.gradientMap&&(x.gradientMap.value=y.gradientMap)}function p(x,y){x.metalness.value=y.metalness,y.metalnessMap&&(x.metalnessMap.value=y.metalnessMap,t(y.metalnessMap,x.metalnessMapTransform)),x.roughness.value=y.roughness,y.roughnessMap&&(x.roughnessMap.value=y.roughnessMap,t(y.roughnessMap,x.roughnessMapTransform)),y.envMap&&(x.envMapIntensity.value=y.envMapIntensity)}function m(x,y,E){x.ior.value=y.ior,y.sheen>0&&(x.sheenColor.value.copy(y.sheenColor).multiplyScalar(y.sheen),x.sheenRoughness.value=y.sheenRoughness,y.sheenColorMap&&(x.sheenColorMap.value=y.sheenColorMap,t(y.sheenColorMap,x.sheenColorMapTransform)),y.sheenRoughnessMap&&(x.sheenRoughnessMap.value=y.sheenRoughnessMap,t(y.sheenRoughnessMap,x.sheenRoughnessMapTransform))),y.clearcoat>0&&(x.clearcoat.value=y.clearcoat,x.clearcoatRoughness.value=y.clearcoatRoughness,y.clearcoatMap&&(x.clearcoatMap.value=y.clearcoatMap,t(y.clearcoatMap,x.clearcoatMapTransform)),y.clearcoatRoughnessMap&&(x.clearcoatRoughnessMap.value=y.clearcoatRoughnessMap,t(y.clearcoatRoughnessMap,x.clearcoatRoughnessMapTransform)),y.clearcoatNormalMap&&(x.clearcoatNormalMap.value=y.clearcoatNormalMap,t(y.clearcoatNormalMap,x.clearcoatNormalMapTransform),x.clearcoatNormalScale.value.copy(y.clearcoatNormalScale),y.side===yr&&x.clearcoatNormalScale.value.negate())),y.dispersion>0&&(x.dispersion.value=y.dispersion),y.iridescence>0&&(x.iridescence.value=y.iridescence,x.iridescenceIOR.value=y.iridescenceIOR,x.iridescenceThicknessMinimum.value=y.iridescenceThicknessRange[0],x.iridescenceThicknessMaximum.value=y.iridescenceThicknessRange[1],y.iridescenceMap&&(x.iridescenceMap.value=y.iridescenceMap,t(y.iridescenceMap,x.iridescenceMapTransform)),y.iridescenceThicknessMap&&(x.iridescenceThicknessMap.value=y.iridescenceThicknessMap,t(y.iridescenceThicknessMap,x.iridescenceThicknessMapTransform))),y.transmission>0&&(x.transmission.value=y.transmission,x.transmissionSamplerMap.value=E.texture,x.transmissionSamplerSize.value.set(E.width,E.height),y.transmissionMap&&(x.transmissionMap.value=y.transmissionMap,t(y.transmissionMap,x.transmissionMapTransform)),x.thickness.value=y.thickness,y.thicknessMap&&(x.thicknessMap.value=y.thicknessMap,t(y.thicknessMap,x.thicknessMapTransform)),x.attenuationDistance.value=y.attenuationDistance,x.attenuationColor.value.copy(y.attenuationColor)),y.anisotropy>0&&(x.anisotropyVector.value.set(y.anisotropy*Math.cos(y.anisotropyRotation),y.anisotropy*Math.sin(y.anisotropyRotation)),y.anisotropyMap&&(x.anisotropyMap.value=y.anisotropyMap,t(y.anisotropyMap,x.anisotropyMapTransform))),x.specularIntensity.value=y.specularIntensity,x.specularColor.value.copy(y.specularColor),y.specularColorMap&&(x.specularColorMap.value=y.specularColorMap,t(y.specularColorMap,x.specularColorMapTransform)),y.specularIntensityMap&&(x.specularIntensityMap.value=y.specularIntensityMap,t(y.specularIntensityMap,x.specularIntensityMapTransform))}function _(x,y){y.matcap&&(x.matcap.value=y.matcap)}function S(x,y){const E=e.get(y).light;x.referencePosition.value.setFromMatrixPosition(E.matrixWorld),x.nearDistance.value=E.shadow.camera.near,x.farDistance.value=E.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:r}}function rte(n,e,t,i){let r={},s={},o=[];const a=n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS);function l(E,w){const M=w.program;i.uniformBlockBinding(E,M)}function c(E,w){let M=r[E.id];M===void 0&&(_(E),M=d(E),r[E.id]=M,E.addEventListener("dispose",x));const O=w.program;i.updateUBOMapping(E,O);const k=e.render.frame;s[E.id]!==k&&(p(E),s[E.id]=k)}function d(E){const w=f();E.__bindingPointIndex=w;const M=n.createBuffer(),O=E.__size,k=E.usage;return n.bindBuffer(n.UNIFORM_BUFFER,M),n.bufferData(n.UNIFORM_BUFFER,O,k),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,w,M),M}function f(){for(let E=0;E0&&(M+=O-k),E.__size=M,E.__cache={},this}function S(E){const w={boundary:0,storage:0};return typeof E=="number"||typeof E=="boolean"?(w.boundary=4,w.storage=4):E.isVector2?(w.boundary=8,w.storage=8):E.isVector3||E.isColor?(w.boundary=16,w.storage=12):E.isVector4?(w.boundary=16,w.storage=16):E.isMatrix3?(w.boundary=48,w.storage=48):E.isMatrix4?(w.boundary=64,w.storage=64):E.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",E),w}function x(E){const w=E.target;w.removeEventListener("dispose",x);const M=o.indexOf(w.__bindingPointIndex);o.splice(M,1),n.deleteBuffer(r[w.id]),delete r[w.id],delete s[w.id]}function y(){for(const E in r)n.deleteBuffer(r[E]);o=[],r={},s={}}return{bind:l,update:c,dispose:y}}class oV{constructor(e={}){const{canvas:t=qF(),context:i=null,depth:r=!0,stencil:s=!1,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:d="default",failIfMajorPerformanceCaveat:f=!1}=e;this.isWebGLRenderer=!0;let p;if(i!==null){if(typeof WebGLRenderingContext<"u"&&i instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");p=i.getContextAttributes().alpha}else p=o;const m=new Uint32Array(4),_=new Int32Array(4);let S=null,x=null;const y=[],E=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=_s,this.toneMapping=vo,this.toneMappingExposure=1;const w=this;let M=!1,O=0,k=0,I=null,P=-1,D=null;const A=new sn,R=new sn;let V=null;const U=new rt(0);let se=0,le=t.width,ee=t.height,pe=1,W=null,J=null;const Z=new sn(0,0,le,ee),oe=new sn(0,0,le,ee);let Me=!1;const Re=new Wm;let he=!1,we=!1;const Ne=new St,be=new St,ft=new G,dt=new sn,Ke={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let ke=!1;function xe(){return I===null?pe:1}let j=i;function Ve(H,te){return t.getContext(H,te)}try{const H={alpha:!0,depth:r,stencil:s,antialias:a,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:d,failIfMajorPerformanceCaveat:f};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${ix}`),t.addEventListener("webglcontextlost",Ae,!1),t.addEventListener("webglcontextrestored",Xe,!1),t.addEventListener("webglcontextcreationerror",$e,!1),j===null){const te="webgl2";if(j=Ve(te,H),j===null)throw Ve(te)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(H){throw console.error("THREE.WebGLRenderer: "+H.message),H}let Oe,Pe,Ue,lt,We,X,F,ae,_e,Te,Se,nt,Ce,Ge,Lt,Le,Ze,Et,vt,et,K,ve,je,Y;function Fe(){Oe=new uZ(j),Oe.init(),ve=new rV(j,Oe),Pe=new rZ(j,Oe,e,ve),Ue=new Wee(j),Pe.reverseDepthBuffer&&Ue.buffers.depth.setReversed(!0),lt=new fZ(j),We=new Iee,X=new Kee(j,Oe,Ue,We,Pe,ve,lt),F=new oZ(w),ae=new cZ(w),_e=new xK(j),je=new nZ(j,_e),Te=new hZ(j,_e,lt,je),Se=new mZ(j,Te,_e,lt),vt=new pZ(j,Pe,X),Le=new sZ(We),nt=new Ree(w,F,ae,Oe,Pe,je,Le),Ce=new ite(w,We),Ge=new Nee,Lt=new Vee(Oe),Et=new tZ(w,F,ae,Ue,Se,p,l),Ze=new Hee(w,Se,Pe),Y=new rte(j,lt,Pe,Ue),et=new iZ(j,Oe,lt),K=new dZ(j,Oe,lt),lt.programs=nt.programs,w.capabilities=Pe,w.extensions=Oe,w.properties=We,w.renderLists=Ge,w.shadowMap=Ze,w.state=Ue,w.info=lt}Fe();const me=new tte(w,j);this.xr=me,this.getContext=function(){return j},this.getContextAttributes=function(){return j.getContextAttributes()},this.forceContextLoss=function(){const H=Oe.get("WEBGL_lose_context");H&&H.loseContext()},this.forceContextRestore=function(){const H=Oe.get("WEBGL_lose_context");H&&H.restoreContext()},this.getPixelRatio=function(){return pe},this.setPixelRatio=function(H){H!==void 0&&(pe=H,this.setSize(le,ee,!1))},this.getSize=function(H){return H.set(le,ee)},this.setSize=function(H,te,ce=!0){if(me.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}le=H,ee=te,t.width=Math.floor(H*pe),t.height=Math.floor(te*pe),ce===!0&&(t.style.width=H+"px",t.style.height=te+"px"),this.setViewport(0,0,H,te)},this.getDrawingBufferSize=function(H){return H.set(le*pe,ee*pe).floor()},this.setDrawingBufferSize=function(H,te,ce){le=H,ee=te,pe=ce,t.width=Math.floor(H*ce),t.height=Math.floor(te*ce),this.setViewport(0,0,H,te)},this.getCurrentViewport=function(H){return H.copy(A)},this.getViewport=function(H){return H.copy(Z)},this.setViewport=function(H,te,ce,de){H.isVector4?Z.set(H.x,H.y,H.z,H.w):Z.set(H,te,ce,de),Ue.viewport(A.copy(Z).multiplyScalar(pe).round())},this.getScissor=function(H){return H.copy(oe)},this.setScissor=function(H,te,ce,de){H.isVector4?oe.set(H.x,H.y,H.z,H.w):oe.set(H,te,ce,de),Ue.scissor(R.copy(oe).multiplyScalar(pe).round())},this.getScissorTest=function(){return Me},this.setScissorTest=function(H){Ue.setScissorTest(Me=H)},this.setOpaqueSort=function(H){W=H},this.setTransparentSort=function(H){J=H},this.getClearColor=function(H){return H.copy(Et.getClearColor())},this.setClearColor=function(){Et.setClearColor.apply(Et,arguments)},this.getClearAlpha=function(){return Et.getClearAlpha()},this.setClearAlpha=function(){Et.setClearAlpha.apply(Et,arguments)},this.clear=function(H=!0,te=!0,ce=!0){let de=0;if(H){let ie=!1;if(I!==null){const Be=I.texture.format;ie=Be===hx||Be===ux||Be===Bm}if(ie){const Be=I.texture.type,Qe=Be===js||Be===pa||Be===dd||Be===lu||Be===ax||Be===lx,st=Et.getClearColor(),it=Et.getClearAlpha(),_t=st.r,xt=st.g,ut=st.b;Qe?(m[0]=_t,m[1]=xt,m[2]=ut,m[3]=it,j.clearBufferuiv(j.COLOR,0,m)):(_[0]=_t,_[1]=xt,_[2]=ut,_[3]=it,j.clearBufferiv(j.COLOR,0,_))}else de|=j.COLOR_BUFFER_BIT}te&&(de|=j.DEPTH_BUFFER_BIT,j.clearDepth(this.capabilities.reverseDepthBuffer?0:1)),ce&&(de|=j.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),j.clear(de)},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",Ae,!1),t.removeEventListener("webglcontextrestored",Xe,!1),t.removeEventListener("webglcontextcreationerror",$e,!1),Ge.dispose(),Lt.dispose(),We.dispose(),F.dispose(),ae.dispose(),Se.dispose(),je.dispose(),Y.dispose(),nt.dispose(),me.dispose(),me.removeEventListener("sessionstart",Gl),me.removeEventListener("sessionend",si),rs.stop()};function Ae(H){H.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),M=!0}function Xe(){console.log("THREE.WebGLRenderer: Context Restored."),M=!1;const H=lt.autoReset,te=Ze.enabled,ce=Ze.autoUpdate,de=Ze.needsUpdate,ie=Ze.type;Fe(),lt.autoReset=H,Ze.enabled=te,Ze.autoUpdate=ce,Ze.needsUpdate=de,Ze.type=ie}function $e(H){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",H.statusMessage)}function At(H){const te=H.target;te.removeEventListener("dispose",At),Bt(te)}function Bt(H){Cn(H),We.remove(H)}function Cn(H){const te=We.get(H).programs;te!==void 0&&(te.forEach(function(ce){nt.releaseProgram(ce)}),H.isShaderMaterial&&nt.releaseShaderCache(H))}this.renderBufferDirect=function(H,te,ce,de,ie,Be){te===null&&(te=Ke);const Qe=ie.isMesh&&ie.matrixWorld.determinant()<0,st=Au(H,te,ce,de,ie);Ue.setMaterial(de,Qe);let it=ce.index,_t=1;if(de.wireframe===!0){if(it=Te.getWireframeAttribute(ce),it===void 0)return;_t=2}const xt=ce.drawRange,ut=ce.attributes.position;let zt=xt.start*_t,Yt=(xt.start+xt.count)*_t;Be!==null&&(zt=Math.max(zt,Be.start*_t),Yt=Math.min(Yt,(Be.start+Be.count)*_t)),it!==null?(zt=Math.max(zt,0),Yt=Math.min(Yt,it.count)):ut!=null&&(zt=Math.max(zt,0),Yt=Math.min(Yt,ut.count));const tn=Yt-zt;if(tn<0||tn===1/0)return;je.setup(ie,de,st,ce,it);let Ot,mt=et;if(it!==null&&(Ot=_e.get(it),mt=K,mt.setIndex(Ot)),ie.isMesh)de.wireframe===!0?(Ue.setLineWidth(de.wireframeLinewidth*xe()),mt.setMode(j.LINES)):mt.setMode(j.TRIANGLES);else if(ie.isLine){let ot=de.linewidth;ot===void 0&&(ot=1),Ue.setLineWidth(ot*xe()),ie.isLineSegments?mt.setMode(j.LINES):ie.isLineLoop?mt.setMode(j.LINE_LOOP):mt.setMode(j.LINE_STRIP)}else ie.isPoints?mt.setMode(j.POINTS):ie.isSprite&&mt.setMode(j.TRIANGLES);if(ie.isBatchedMesh)if(ie._multiDrawInstances!==null)mt.renderMultiDrawInstances(ie._multiDrawStarts,ie._multiDrawCounts,ie._multiDrawCount,ie._multiDrawInstances);else if(Oe.get("WEBGL_multi_draw"))mt.renderMultiDraw(ie._multiDrawStarts,ie._multiDrawCounts,ie._multiDrawCount);else{const ot=ie._multiDrawStarts,qt=ie._multiDrawCounts,Mt=ie._multiDrawCount,Gn=it?_e.get(it).bytesPerElement:1,Ui=We.get(de).currentProgram.getUniforms();for(let dn=0;dn{function Be(){if(de.forEach(function(Qe){We.get(Qe).currentProgram.isReady()&&de.delete(Qe)}),de.size===0){ie(H);return}setTimeout(Be,10)}Oe.get("KHR_parallel_shader_compile")!==null?Be():setTimeout(Be,10)})};let Sn=null;function kn(H){Sn&&Sn(H)}function Gl(){rs.stop()}function si(){rs.start()}const rs=new ZF;rs.setAnimationLoop(kn),typeof self<"u"&&rs.setContext(self),this.setAnimationLoop=function(H){Sn=H,me.setAnimationLoop(H),H===null?rs.stop():rs.start()},me.addEventListener("sessionstart",Gl),me.addEventListener("sessionend",si),this.render=function(H,te){if(te!==void 0&&te.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(M===!0)return;if(H.matrixWorldAutoUpdate===!0&&H.updateMatrixWorld(),te.parent===null&&te.matrixWorldAutoUpdate===!0&&te.updateMatrixWorld(),me.enabled===!0&&me.isPresenting===!0&&(me.cameraAutoUpdate===!0&&me.updateCamera(te),te=me.getCamera()),H.isScene===!0&&H.onBeforeRender(w,H,te,I),x=Lt.get(H,E.length),x.init(te),E.push(x),be.multiplyMatrices(te.projectionMatrix,te.matrixWorldInverse),Re.setFromProjectionMatrix(be),we=this.localClippingEnabled,he=Le.init(this.clippingPlanes,we),S=Ge.get(H,y.length),S.init(),y.push(S),me.enabled===!0&&me.isPresenting===!0){const Be=w.xr.getDepthSensingMesh();Be!==null&&ss(Be,te,-1/0,w.sortObjects)}ss(H,te,0,w.sortObjects),S.finish(),w.sortObjects===!0&&S.sort(W,J),ke=me.enabled===!1||me.isPresenting===!1||me.hasDepthSensing()===!1,ke&&Et.addToRenderList(S,H),this.info.render.frame++,he===!0&&Le.beginShadows();const ce=x.state.shadowsArray;Ze.render(ce,H,te),he===!0&&Le.endShadows(),this.info.autoReset===!0&&this.info.reset();const de=S.opaque,ie=S.transmissive;if(x.setupLights(),te.isArrayCamera){const Be=te.cameras;if(ie.length>0)for(let Qe=0,st=Be.length;Qe0&&Eu(de,ie,H,te),ke&&Et.render(H),os(S,H,te);I!==null&&(X.updateMultisampleRenderTarget(I),X.updateRenderTargetMipmap(I)),H.isScene===!0&&H.onAfterRender(w,H,te),je.resetDefaultState(),P=-1,D=null,E.pop(),E.length>0?(x=E[E.length-1],he===!0&&Le.setGlobalState(w.clippingPlanes,x.state.camera)):x=null,y.pop(),y.length>0?S=y[y.length-1]:S=null};function ss(H,te,ce,de){if(H.visible===!1)return;if(H.layers.test(te.layers)){if(H.isGroup)ce=H.renderOrder;else if(H.isLOD)H.autoUpdate===!0&&H.update(te);else if(H.isLight)x.pushLight(H),H.castShadow&&x.pushShadow(H);else if(H.isSprite){if(!H.frustumCulled||Re.intersectsSprite(H)){de&&dt.setFromMatrixPosition(H.matrixWorld).applyMatrix4(be);const Qe=Se.update(H),st=H.material;st.visible&&S.push(H,Qe,st,ce,dt.z,null)}}else if((H.isMesh||H.isLine||H.isPoints)&&(!H.frustumCulled||Re.intersectsObject(H))){const Qe=Se.update(H),st=H.material;if(de&&(H.boundingSphere!==void 0?(H.boundingSphere===null&&H.computeBoundingSphere(),dt.copy(H.boundingSphere.center)):(Qe.boundingSphere===null&&Qe.computeBoundingSphere(),dt.copy(Qe.boundingSphere.center)),dt.applyMatrix4(H.matrixWorld).applyMatrix4(be)),Array.isArray(st)){const it=Qe.groups;for(let _t=0,xt=it.length;_t0&&as(ie,te,ce),Be.length>0&&as(Be,te,ce),Qe.length>0&&as(Qe,te,ce),Ue.buffers.depth.setTest(!0),Ue.buffers.depth.setMask(!0),Ue.buffers.color.setMask(!0),Ue.setPolygonOffset(!1)}function Eu(H,te,ce,de){if((ce.isScene===!0?ce.overrideMaterial:null)!==null)return;x.state.transmissionRenderTarget[de.id]===void 0&&(x.state.transmissionRenderTarget[de.id]=new Xs(1,1,{generateMipmaps:!0,type:Oe.has("EXT_color_buffer_half_float")||Oe.has("EXT_color_buffer_float")?Id:js,minFilter:ho,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:cn.workingColorSpace}));const Be=x.state.transmissionRenderTarget[de.id],Qe=de.viewport||A;Be.setSize(Qe.z,Qe.w);const st=w.getRenderTarget();w.setRenderTarget(Be),w.getClearColor(U),se=w.getClearAlpha(),se<1&&w.setClearColor(16777215,.5),w.clear(),ke&&Et.render(ce);const it=w.toneMapping;w.toneMapping=vo;const _t=de.viewport;if(de.viewport!==void 0&&(de.viewport=void 0),x.setupLightsView(de),he===!0&&Le.setGlobalState(w.clippingPlanes,de),as(H,ce,de),X.updateMultisampleRenderTarget(Be),X.updateRenderTargetMipmap(Be),Oe.has("WEBGL_multisampled_render_to_texture")===!1){let xt=!1;for(let ut=0,zt=te.length;ut0),ut=!!ce.morphAttributes.position,zt=!!ce.morphAttributes.normal,Yt=!!ce.morphAttributes.color;let tn=vo;de.toneMapped&&(I===null||I.isXRRenderTarget===!0)&&(tn=w.toneMapping);const Ot=ce.morphAttributes.position||ce.morphAttributes.normal||ce.morphAttributes.color,mt=Ot!==void 0?Ot.length:0,ot=We.get(de),qt=x.state.lights;if(he===!0&&(we===!0||H!==D)){const On=H===D&&de.id===P;Le.setState(de,H,On)}let Mt=!1;de.version===ot.__version?(ot.needsLights&&ot.lightsStateVersion!==qt.state.version||ot.outputColorSpace!==st||ie.isBatchedMesh&&ot.batching===!1||!ie.isBatchedMesh&&ot.batching===!0||ie.isBatchedMesh&&ot.batchingColor===!0&&ie.colorTexture===null||ie.isBatchedMesh&&ot.batchingColor===!1&&ie.colorTexture!==null||ie.isInstancedMesh&&ot.instancing===!1||!ie.isInstancedMesh&&ot.instancing===!0||ie.isSkinnedMesh&&ot.skinning===!1||!ie.isSkinnedMesh&&ot.skinning===!0||ie.isInstancedMesh&&ot.instancingColor===!0&&ie.instanceColor===null||ie.isInstancedMesh&&ot.instancingColor===!1&&ie.instanceColor!==null||ie.isInstancedMesh&&ot.instancingMorph===!0&&ie.morphTexture===null||ie.isInstancedMesh&&ot.instancingMorph===!1&&ie.morphTexture!==null||ot.envMap!==it||de.fog===!0&&ot.fog!==Be||ot.numClippingPlanes!==void 0&&(ot.numClippingPlanes!==Le.numPlanes||ot.numIntersection!==Le.numIntersection)||ot.vertexAlphas!==_t||ot.vertexTangents!==xt||ot.morphTargets!==ut||ot.morphNormals!==zt||ot.morphColors!==Yt||ot.toneMapping!==tn||ot.morphTargetsCount!==mt)&&(Mt=!0):(Mt=!0,ot.__version=de.version);let Gn=ot.currentProgram;Mt===!0&&(Gn=Sa(de,te,ie));let Ui=!1,dn=!1,Js=!1;const _n=Gn.getUniforms(),Er=ot.uniforms;if(Ue.useProgram(Gn.program)&&(Ui=!0,dn=!0,Js=!0),de.id!==P&&(P=de.id,dn=!0),Ui||D!==H){Pe.reverseDepthBuffer?(Ne.copy(H.projectionMatrix),WY(Ne),jY(Ne),_n.setValue(j,"projectionMatrix",Ne)):_n.setValue(j,"projectionMatrix",H.projectionMatrix),_n.setValue(j,"viewMatrix",H.matrixWorldInverse);const On=_n.map.cameraPosition;On!==void 0&&On.setValue(j,ft.setFromMatrixPosition(H.matrixWorld)),Pe.logarithmicDepthBuffer&&_n.setValue(j,"logDepthBufFC",2/(Math.log(H.far+1)/Math.LN2)),(de.isMeshPhongMaterial||de.isMeshToonMaterial||de.isMeshLambertMaterial||de.isMeshBasicMaterial||de.isMeshStandardMaterial||de.isShaderMaterial)&&_n.setValue(j,"isOrthographic",H.isOrthographicCamera===!0),D!==H&&(D=H,dn=!0,Js=!0)}if(ie.isSkinnedMesh){_n.setOptional(j,ie,"bindMatrix"),_n.setOptional(j,ie,"bindMatrixInverse");const On=ie.skeleton;On&&(On.boneTexture===null&&On.computeBoneTexture(),_n.setValue(j,"boneTexture",On.boneTexture,X))}ie.isBatchedMesh&&(_n.setOptional(j,ie,"batchingTexture"),_n.setValue(j,"batchingTexture",ie._matricesTexture,X),_n.setOptional(j,ie,"batchingIdTexture"),_n.setValue(j,"batchingIdTexture",ie._indirectTexture,X),_n.setOptional(j,ie,"batchingColorTexture"),ie._colorsTexture!==null&&_n.setValue(j,"batchingColorTexture",ie._colorsTexture,X));const Zs=ce.morphAttributes;if((Zs.position!==void 0||Zs.normal!==void 0||Zs.color!==void 0)&&vt.update(ie,ce,Gn),(dn||ot.receiveShadow!==ie.receiveShadow)&&(ot.receiveShadow=ie.receiveShadow,_n.setValue(j,"receiveShadow",ie.receiveShadow)),de.isMeshGouraudMaterial&&de.envMap!==null&&(Er.envMap.value=it,Er.flipEnvMap.value=it.isCubeTexture&&it.isRenderTargetTexture===!1?-1:1),de.isMeshStandardMaterial&&de.envMap===null&&te.environment!==null&&(Er.envMapIntensity.value=te.environmentIntensity),dn&&(_n.setValue(j,"toneMappingExposure",w.toneMappingExposure),ot.needsLights&&Wl(Er,Js),Be&&de.fog===!0&&Ce.refreshFogUniforms(Er,Be),Ce.refreshMaterialUniforms(Er,de,pe,ee,x.state.transmissionRenderTarget[H.id]),Pv.upload(j,Tu(ot),Er,X)),de.isShaderMaterial&&de.uniformsNeedUpdate===!0&&(Pv.upload(j,Tu(ot),Er,X),de.uniformsNeedUpdate=!1),de.isSpriteMaterial&&_n.setValue(j,"center",ie.center),_n.setValue(j,"modelViewMatrix",ie.modelViewMatrix),_n.setValue(j,"normalMatrix",ie.normalMatrix),_n.setValue(j,"modelMatrix",ie.matrixWorld),de.isShaderMaterial||de.isRawShaderMaterial){const On=de.uniformsGroups;for(let bn=0,Ea=On.length;bn0&&X.useMultisampledRTT(H)===!1?ie=We.get(H).__webglMultisampledFramebuffer:Array.isArray(xt)?ie=xt[ce]:ie=xt,A.copy(H.viewport),R.copy(H.scissor),V=H.scissorTest}else A.copy(Z).multiplyScalar(pe).floor(),R.copy(oe).multiplyScalar(pe).floor(),V=Me;if(Ue.bindFramebuffer(j.FRAMEBUFFER,ie)&&de&&Ue.drawBuffers(H,ie),Ue.viewport(A),Ue.scissor(R),Ue.setScissorTest(V),Be){const it=We.get(H.texture);j.framebufferTexture2D(j.FRAMEBUFFER,j.COLOR_ATTACHMENT0,j.TEXTURE_CUBE_MAP_POSITIVE_X+te,it.__webglTexture,ce)}else if(Qe){const it=We.get(H.texture),_t=te||0;j.framebufferTextureLayer(j.FRAMEBUFFER,j.COLOR_ATTACHMENT0,it.__webglTexture,ce||0,_t)}P=-1},this.readRenderTargetPixels=function(H,te,ce,de,ie,Be,Qe){if(!(H&&H.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let st=We.get(H).__webglFramebuffer;if(H.isWebGLCubeRenderTarget&&Qe!==void 0&&(st=st[Qe]),st){Ue.bindFramebuffer(j.FRAMEBUFFER,st);try{const it=H.texture,_t=it.format,xt=it.type;if(!Pe.textureFormatReadable(_t)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!Pe.textureTypeReadable(xt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}te>=0&&te<=H.width-de&&ce>=0&&ce<=H.height-ie&&j.readPixels(te,ce,de,ie,ve.convert(_t),ve.convert(xt),Be)}finally{const it=I!==null?We.get(I).__webglFramebuffer:null;Ue.bindFramebuffer(j.FRAMEBUFFER,it)}}},this.readRenderTargetPixelsAsync=async function(H,te,ce,de,ie,Be,Qe){if(!(H&&H.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let st=We.get(H).__webglFramebuffer;if(H.isWebGLCubeRenderTarget&&Qe!==void 0&&(st=st[Qe]),st){const it=H.texture,_t=it.format,xt=it.type;if(!Pe.textureFormatReadable(_t))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Pe.textureTypeReadable(xt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(te>=0&&te<=H.width-de&&ce>=0&&ce<=H.height-ie){Ue.bindFramebuffer(j.FRAMEBUFFER,st);const ut=j.createBuffer();j.bindBuffer(j.PIXEL_PACK_BUFFER,ut),j.bufferData(j.PIXEL_PACK_BUFFER,Be.byteLength,j.STREAM_READ),j.readPixels(te,ce,de,ie,ve.convert(_t),ve.convert(xt),0);const zt=I!==null?We.get(I).__webglFramebuffer:null;Ue.bindFramebuffer(j.FRAMEBUFFER,zt);const Yt=j.fenceSync(j.SYNC_GPU_COMMANDS_COMPLETE,0);return j.flush(),await GY(j,Yt,4),j.bindBuffer(j.PIXEL_PACK_BUFFER,ut),j.getBufferSubData(j.PIXEL_PACK_BUFFER,0,Be),j.deleteBuffer(ut),j.deleteSync(Yt),Be}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")}},this.copyFramebufferToTexture=function(H,te=null,ce=0){H.isTexture!==!0&&(bv("WebGLRenderer: copyFramebufferToTexture function signature has changed."),te=arguments[0]||null,H=arguments[1]);const de=Math.pow(2,-ce),ie=Math.floor(H.image.width*de),Be=Math.floor(H.image.height*de),Qe=te!==null?te.x:0,st=te!==null?te.y:0;X.setTexture2D(H,0),j.copyTexSubImage2D(j.TEXTURE_2D,ce,0,0,Qe,st,ie,Be),Ue.unbindTexture()},this.copyTextureToTexture=function(H,te,ce=null,de=null,ie=0){H.isTexture!==!0&&(bv("WebGLRenderer: copyTextureToTexture function signature has changed."),de=arguments[0]||null,H=arguments[1],te=arguments[2],ie=arguments[3]||0,ce=null);let Be,Qe,st,it,_t,xt;ce!==null?(Be=ce.max.x-ce.min.x,Qe=ce.max.y-ce.min.y,st=ce.min.x,it=ce.min.y):(Be=H.image.width,Qe=H.image.height,st=0,it=0),de!==null?(_t=de.x,xt=de.y):(_t=0,xt=0);const ut=ve.convert(te.format),zt=ve.convert(te.type);X.setTexture2D(te,0),j.pixelStorei(j.UNPACK_FLIP_Y_WEBGL,te.flipY),j.pixelStorei(j.UNPACK_PREMULTIPLY_ALPHA_WEBGL,te.premultiplyAlpha),j.pixelStorei(j.UNPACK_ALIGNMENT,te.unpackAlignment);const Yt=j.getParameter(j.UNPACK_ROW_LENGTH),tn=j.getParameter(j.UNPACK_IMAGE_HEIGHT),Ot=j.getParameter(j.UNPACK_SKIP_PIXELS),mt=j.getParameter(j.UNPACK_SKIP_ROWS),ot=j.getParameter(j.UNPACK_SKIP_IMAGES),qt=H.isCompressedTexture?H.mipmaps[ie]:H.image;j.pixelStorei(j.UNPACK_ROW_LENGTH,qt.width),j.pixelStorei(j.UNPACK_IMAGE_HEIGHT,qt.height),j.pixelStorei(j.UNPACK_SKIP_PIXELS,st),j.pixelStorei(j.UNPACK_SKIP_ROWS,it),H.isDataTexture?j.texSubImage2D(j.TEXTURE_2D,ie,_t,xt,Be,Qe,ut,zt,qt.data):H.isCompressedTexture?j.compressedTexSubImage2D(j.TEXTURE_2D,ie,_t,xt,qt.width,qt.height,ut,qt.data):j.texSubImage2D(j.TEXTURE_2D,ie,_t,xt,Be,Qe,ut,zt,qt),j.pixelStorei(j.UNPACK_ROW_LENGTH,Yt),j.pixelStorei(j.UNPACK_IMAGE_HEIGHT,tn),j.pixelStorei(j.UNPACK_SKIP_PIXELS,Ot),j.pixelStorei(j.UNPACK_SKIP_ROWS,mt),j.pixelStorei(j.UNPACK_SKIP_IMAGES,ot),ie===0&&te.generateMipmaps&&j.generateMipmap(j.TEXTURE_2D),Ue.unbindTexture()},this.copyTextureToTexture3D=function(H,te,ce=null,de=null,ie=0){H.isTexture!==!0&&(bv("WebGLRenderer: copyTextureToTexture3D function signature has changed."),ce=arguments[0]||null,de=arguments[1]||null,H=arguments[2],te=arguments[3],ie=arguments[4]||0);let Be,Qe,st,it,_t,xt,ut,zt,Yt;const tn=H.isCompressedTexture?H.mipmaps[ie]:H.image;ce!==null?(Be=ce.max.x-ce.min.x,Qe=ce.max.y-ce.min.y,st=ce.max.z-ce.min.z,it=ce.min.x,_t=ce.min.y,xt=ce.min.z):(Be=tn.width,Qe=tn.height,st=tn.depth,it=0,_t=0,xt=0),de!==null?(ut=de.x,zt=de.y,Yt=de.z):(ut=0,zt=0,Yt=0);const Ot=ve.convert(te.format),mt=ve.convert(te.type);let ot;if(te.isData3DTexture)X.setTexture3D(te,0),ot=j.TEXTURE_3D;else if(te.isDataArrayTexture||te.isCompressedArrayTexture)X.setTexture2DArray(te,0),ot=j.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}j.pixelStorei(j.UNPACK_FLIP_Y_WEBGL,te.flipY),j.pixelStorei(j.UNPACK_PREMULTIPLY_ALPHA_WEBGL,te.premultiplyAlpha),j.pixelStorei(j.UNPACK_ALIGNMENT,te.unpackAlignment);const qt=j.getParameter(j.UNPACK_ROW_LENGTH),Mt=j.getParameter(j.UNPACK_IMAGE_HEIGHT),Gn=j.getParameter(j.UNPACK_SKIP_PIXELS),Ui=j.getParameter(j.UNPACK_SKIP_ROWS),dn=j.getParameter(j.UNPACK_SKIP_IMAGES);j.pixelStorei(j.UNPACK_ROW_LENGTH,tn.width),j.pixelStorei(j.UNPACK_IMAGE_HEIGHT,tn.height),j.pixelStorei(j.UNPACK_SKIP_PIXELS,it),j.pixelStorei(j.UNPACK_SKIP_ROWS,_t),j.pixelStorei(j.UNPACK_SKIP_IMAGES,xt),H.isDataTexture||H.isData3DTexture?j.texSubImage3D(ot,ie,ut,zt,Yt,Be,Qe,st,Ot,mt,tn.data):te.isCompressedArrayTexture?j.compressedTexSubImage3D(ot,ie,ut,zt,Yt,Be,Qe,st,Ot,tn.data):j.texSubImage3D(ot,ie,ut,zt,Yt,Be,Qe,st,Ot,mt,tn),j.pixelStorei(j.UNPACK_ROW_LENGTH,qt),j.pixelStorei(j.UNPACK_IMAGE_HEIGHT,Mt),j.pixelStorei(j.UNPACK_SKIP_PIXELS,Gn),j.pixelStorei(j.UNPACK_SKIP_ROWS,Ui),j.pixelStorei(j.UNPACK_SKIP_IMAGES,dn),ie===0&&te.generateMipmaps&&j.generateMipmap(ot),Ue.unbindTexture()},this.initRenderTarget=function(H){We.get(H).__webglFramebuffer===void 0&&X.setupRenderTarget(H)},this.initTexture=function(H){H.isCubeTexture?X.setTextureCube(H,0):H.isData3DTexture?X.setTexture3D(H,0):H.isDataArrayTexture||H.isCompressedArrayTexture?X.setTexture2DArray(H,0):X.setTexture2D(H,0),Ue.unbindTexture()},this.resetState=function(){O=0,k=0,I=null,Ue.reset(),je.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return fo}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===fx?"display-p3":"srgb",t.unpackColorSpace=cn.workingColorSpace===zm?"display-p3":"srgb"}}class gx{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new rt(e),this.density=t}clone(){return new gx(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class yx{constructor(e,t=1,i=1e3){this.isFog=!0,this.name="",this.color=new rt(e),this.near=t,this.far=i}clone(){return new yx(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class a_ extends Zt{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new _r,this.environmentIntensity=1,this.environmentRotation=new _r,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class vx{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=am,this.updateRanges=[],this.version=0,this.uuid=Zr()}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.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,i){e*=this.stride,i*=t.stride;for(let r=0,s=this.stride;re.far||t.push({distance:l,point:bf.clone(),uv:Nr.getInterpolation(bf,Dy,Rf,ky,cL,r1,uL,new Ee),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function Oy(n,e,t,i,r,s){sh.subVectors(n,t).addScalar(.5).multiply(i),r!==void 0?(Pf.x=s*sh.x-r*sh.y,Pf.y=r*sh.x+s*sh.y):Pf.copy(sh),n.copy(e),n.x+=Pf.x,n.y+=Pf.y,n.applyMatrix4(aV)}const Uy=new G,hL=new G;class cV extends Zt{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let i=0,r=t.length;i0){let i,r;for(i=1,r=t.length;i0){Uy.setFromMatrixPosition(this.matrixWorld);const r=e.ray.origin.distanceTo(Uy);this.getObjectForDistance(r).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){Uy.setFromMatrixPosition(e.matrixWorld),hL.setFromMatrixPosition(this.matrixWorld);const i=Uy.distanceTo(hL)/e.zoom;t[0].object.visible=!0;let r,s;for(r=1,s=t.length;r=o)t[r-1].object.visible=!1,t[r].object.visible=!0;else break}for(this._currentLevel=r-1;r=r.length&&r.push({start:-1,count:-1,z:-1,index:-1});const o=r[this.index];s.push(o),this.index++,o.start=e.start,o.count=e.count,o.z=t,o.index=i}reset(){this.list.length=0,this.index=0}}const Ga=new St,a1=new St,hte=new St,dte=new rt(1,1,1),xL=new St,l1=new Wm,By=new vr,mc=new ir,Nf=new G,SL=new G,fte=new G,c1=new ute,Yi=new ni,zy=[];function pte(n,e,t=0){const i=e.itemSize;if(n.isInterleavedBufferAttribute||n.array.constructor!==e.array.constructor){const r=n.count;for(let s=0;s65535?new Uint32Array(r):new Uint16Array(r);t.setIndex(new vn(s,1))}this._geometryInitialized=!0}}_validateGeometry(e){const t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw new Error('BatchedMesh: All geometries must consistently have "index".');for(const i in t.attributes){if(!e.hasAttribute(i))throw new Error(`BatchedMesh: Added geometry missing "${i}". All geometries must have consistent attributes.`);const r=e.getAttribute(i),s=t.getAttribute(i);if(r.itemSize!==s.itemSize||r.normalized!==s.normalized)throw new Error("BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new vr);const e=this.boundingBox,t=this._drawInfo;e.makeEmpty();for(let i=0,r=t.length;i=this.maxInstanceCount&&this._availableInstanceIds.length===0)throw new Error("BatchedMesh: Maximum item count reached.");const i={visible:!0,active:!0,geometryIndex:e};let r=null;this._availableInstanceIds.length>0?(r=this._availableInstanceIds.pop(),this._drawInfo[r]=i):(r=this._drawInfo.length,this._drawInfo.push(i));const s=this._matricesTexture,o=s.image.data;hte.toArray(o,r*16),s.needsUpdate=!0;const a=this._colorsTexture;return a&&(dte.toArray(a.image.data,r*4),a.needsUpdate=!0),r}addGeometry(e,t=-1,i=-1){if(this._initializeGeometry(e),this._validateGeometry(e),this._drawInfo.length>=this._maxInstanceCount)throw new Error("BatchedMesh: Maximum item count reached.");const r={vertexStart:-1,vertexCount:-1,indexStart:-1,indexCount:-1};let s=null;const o=this._reservedRanges,a=this._drawRanges,l=this._bounds;this._geometryCount!==0&&(s=o[o.length-1]),t===-1?r.vertexCount=e.getAttribute("position").count:r.vertexCount=t,s===null?r.vertexStart=0:r.vertexStart=s.vertexStart+s.vertexCount;const c=e.getIndex(),d=c!==null;if(d&&(i===-1?r.indexCount=c.count:r.indexCount=i,s===null?r.indexStart=0:r.indexStart=s.indexStart+s.indexCount),r.indexStart!==-1&&r.indexStart+r.indexCount>this._maxIndexCount||r.vertexStart+r.vertexCount>this._maxVertexCount)throw new Error("BatchedMesh: Reserved space request exceeds the maximum buffer size.");const f=this._geometryCount;return this._geometryCount++,o.push(r),a.push({start:d?r.indexStart:r.vertexStart,count:-1}),l.push({boxInitialized:!1,box:new vr,sphereInitialized:!1,sphere:new ir}),this.setGeometryAt(f,e),f}setGeometryAt(e,t){if(e>=this._geometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);const i=this.geometry,r=i.getIndex()!==null,s=i.getIndex(),o=t.getIndex(),a=this._reservedRanges[e];if(r&&o.count>a.indexCount||t.attributes.position.count>a.vertexCount)throw new Error("BatchedMesh: Reserved space not large enough for provided geometry.");const l=a.vertexStart,c=a.vertexCount;for(const m in i.attributes){const _=t.getAttribute(m),S=i.getAttribute(m);pte(_,S,l);const x=_.itemSize;for(let y=_.count,E=c;y=t.length||t[e].active===!1?this:(t[e].active=!1,this._availableInstanceIds.push(e),this._visibilityChanged=!0,this)}getBoundingBoxAt(e,t){if(e>=this._geometryCount)return null;const i=this._bounds[e],r=i.box,s=this.geometry;if(i.boxInitialized===!1){r.makeEmpty();const o=s.index,a=s.attributes.position,l=this._drawRanges[e];for(let c=l.start,d=l.start+l.count;c=this._geometryCount)return null;const i=this._bounds[e],r=i.sphere,s=this.geometry;if(i.sphereInitialized===!1){r.makeEmpty(),this.getBoundingBoxAt(e,By),By.getCenter(r.center);const o=s.index,a=s.attributes.position,l=this._drawRanges[e];let c=0;for(let d=l.start,f=l.start+l.count;d=i.length||i[e].active===!1?this:(t.toArray(s,e*16),r.needsUpdate=!0,this)}getMatrixAt(e,t){const i=this._drawInfo,r=this._matricesTexture.image.data;return e>=i.length||i[e].active===!1?null:t.fromArray(r,e*16)}setColorAt(e,t){this._colorsTexture===null&&this._initColorsTexture();const i=this._colorsTexture,r=this._colorsTexture.image.data,s=this._drawInfo;return e>=s.length||s[e].active===!1?this:(t.toArray(r,e*4),i.needsUpdate=!0,this)}getColorAt(e,t){const i=this._colorsTexture.image.data,r=this._drawInfo;return e>=r.length||r[e].active===!1?null:t.fromArray(i,e*4)}setVisibleAt(e,t){const i=this._drawInfo;return e>=i.length||i[e].active===!1||i[e].visible===t?this:(i[e].visible=t,this._visibilityChanged=!0,this)}getVisibleAt(e){const t=this._drawInfo;return e>=t.length||t[e].active===!1?!1:t[e].visible}setGeometryIdAt(e,t){const i=this._drawInfo;return e>=i.length||i[e].active===!1||t<0||t>=this._geometryCount?null:(i[e].geometryIndex=t,this)}getGeometryIdAt(e){const t=this._drawInfo;return e>=t.length||t[e].active===!1?-1:t[e].geometryIndex}getGeometryRangeAt(e,t={}){if(e<0||e>=this._geometryCount)return null;const i=this._drawRanges[e];return t.start=i.start,t.count=i.count,t}raycast(e,t){const i=this._drawInfo,r=this._drawRanges,s=this.matrixWorld,o=this.geometry;Yi.material=this.material,Yi.geometry.index=o.index,Yi.geometry.attributes=o.attributes,Yi.geometry.boundingBox===null&&(Yi.geometry.boundingBox=new vr),Yi.geometry.boundingSphere===null&&(Yi.geometry.boundingSphere=new ir);for(let a=0,l=i.length;a({...t})),this._reservedRanges=e._reservedRanges.map(t=>({...t})),this._drawInfo=e._drawInfo.map(t=>({...t})),this._bounds=e._bounds.map(t=>({boxInitialized:t.boxInitialized,box:t.box.clone(),sphereInitialized:t.sphereInitialized,sphere:t.sphere.clone()})),this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._geometryCount=e._geometryCount,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),this._colorsTexture!==null&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){return this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,this._colorsTexture!==null&&(this._colorsTexture.dispose(),this._colorsTexture=null),this}onBeforeRender(e,t,i,r,s){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const o=r.getIndex(),a=o===null?1:o.array.BYTES_PER_ELEMENT,l=this._drawInfo,c=this._multiDrawStarts,d=this._multiDrawCounts,f=this._drawRanges,p=this.perObjectFrustumCulled,m=this._indirectTexture,_=m.image.data;p&&(xL.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse).multiply(this.matrixWorld),l1.setFromProjectionMatrix(xL,e.coordinateSystem));let S=0;if(this.sortObjects){a1.copy(this.matrixWorld).invert(),Nf.setFromMatrixPosition(i.matrixWorld).applyMatrix4(a1),SL.set(0,0,-1).transformDirection(i.matrixWorld).transformDirection(a1);for(let E=0,w=l.length;E0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;si)return;u1.applyMatrix4(n.matrixWorld);const l=e.ray.origin.distanceTo(u1);if(!(le.far))return{distance:l,point:EL.clone().applyMatrix4(n.matrixWorld),index:r,face:null,faceIndex:null,barycoord:null,object:n}}const TL=new G,AL=new G;class Ao extends Il{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,i=[];for(let r=0,s=t.count;r0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;sr.far)return;s.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,faceIndex:null,barycoord:null,object:o})}}class mte extends In{constructor(e,t,i,r,s,o,a,l,c){super(e,t,i,r,s,o,a,l,c),this.isVideoTexture=!0,this.minFilter=o!==void 0?o:fi,this.magFilter=s!==void 0?s:fi,this.generateMipmaps=!1;const d=this;function f(){d.needsUpdate=!0,e.requestVideoFrameCallback(f)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(f)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class gte extends In{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=Ai,this.minFilter=Ai,this.generateMipmaps=!1,this.needsUpdate=!0}}class xx extends In{constructor(e,t,i,r,s,o,a,l,c,d,f,p){super(null,o,a,l,c,d,r,s,f,p),this.isCompressedTexture=!0,this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class yte extends xx{constructor(e,t,i,r,s,o){super(e,t,i,s,o),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=Es,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class vte extends xx{constructor(e,t,i){super(void 0,e[0].width,e[0].height,t,i,fa),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class _te extends In{constructor(e,t,i,r,s,o,a,l,c){super(e,t,i,r,s,o,a,l,c),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Ks{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const i=this.getUtoTmapping(e);return this.getPoint(i,t)}getPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return t}getSpacedPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPointAt(i/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let i,r=this.getPoint(0),s=0;t.push(0);for(let o=1;o<=e;o++)i=this.getPoint(o/e),s+=i.distanceTo(r),t.push(s),r=i;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const i=this.getLengths();let r=0;const s=i.length;let o;t?o=t:o=e*i[s-1];let a=0,l=s-1,c;for(;a<=l;)if(r=Math.floor(a+(l-a)/2),c=i[r]-o,c<0)a=r+1;else if(c>0)l=r-1;else{l=r;break}if(r=l,i[r]===o)return r/(s-1);const d=i[r],p=i[r+1]-d,m=(o-d)/p;return(r+m)/(s-1)}getTangent(e,t){let r=e-1e-4,s=e+1e-4;r<0&&(r=0),s>1&&(s=1);const o=this.getPoint(r),a=this.getPoint(s),l=t||(o.isVector2?new Ee:new G);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){const i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t){const i=new G,r=[],s=[],o=[],a=new G,l=new St;for(let m=0;m<=e;m++){const _=m/e;r[m]=this.getTangentAt(_,new G)}s[0]=new G,o[0]=new G;let c=Number.MAX_VALUE;const d=Math.abs(r[0].x),f=Math.abs(r[0].y),p=Math.abs(r[0].z);d<=c&&(c=d,i.set(1,0,0)),f<=c&&(c=f,i.set(0,1,0)),p<=c&&i.set(0,0,1),a.crossVectors(r[0],i).normalize(),s[0].crossVectors(r[0],a),o[0].crossVectors(r[0],s[0]);for(let m=1;m<=e;m++){if(s[m]=s[m-1].clone(),o[m]=o[m-1].clone(),a.crossVectors(r[m-1],r[m]),a.length()>Number.EPSILON){a.normalize();const _=Math.acos($n(r[m-1].dot(r[m]),-1,1));s[m].applyMatrix4(l.makeRotationAxis(a,_))}o[m].crossVectors(r[m],s[m])}if(t===!0){let m=Math.acos($n(s[0].dot(s[e]),-1,1));m/=e,r[0].dot(a.crossVectors(s[0],s[e]))>0&&(m=-m);for(let _=1;_<=e;_++)s[_].applyMatrix4(l.makeRotationAxis(r[_],m*_)),o[_].crossVectors(r[_],s[_])}return{tangents:r,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class Sx extends Ks{constructor(e=0,t=0,i=1,r=1,s=0,o=Math.PI*2,a=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=r,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t=new Ee){const i=t,r=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const o=Math.abs(s)r;)s-=r;s0?0:(Math.floor(Math.abs(a)/s)+1)*s:l===0&&a===s-1&&(a=s-2,l=1);let c,d;this.closed||a>0?c=r[(a-1)%s]:(Xy.subVectors(r[0],r[1]).add(r[0]),c=Xy);const f=r[a%s],p=r[(a+1)%s];if(this.closed||a+2r.length-2?r.length-1:o+1],f=r[o>r.length-3?r.length-1:o+2];return i.set(bL(a,l.x,c.x,d.x,f.x),bL(a,l.y,c.y,d.y,f.y)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t=i){const o=r[s]-i,a=this.curves[s],l=a.getLength(),c=l===0?0:1-o/l;return a.getPointAt(c,t)}s++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let i=0,r=this.curves.length;i1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,i=e.curves.length;t0){const f=c.getPoint(0);f.equals(this.currentPoint)||this.lineTo(f.x,f.y)}this.curves.push(c);const d=c.getPoint(1);return this.currentPoint.copy(d),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class jm extends Vt{constructor(e=[new Ee(0,-.5),new Ee(.5,0),new Ee(0,.5)],t=12,i=0,r=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:i,phiLength:r},t=Math.floor(t),r=$n(r,0,Math.PI*2);const s=[],o=[],a=[],l=[],c=[],d=1/t,f=new G,p=new Ee,m=new G,_=new G,S=new G;let x=0,y=0;for(let E=0;E<=e.length-1;E++)switch(E){case 0:x=e[E+1].x-e[E].x,y=e[E+1].y-e[E].y,m.x=y*1,m.y=-x,m.z=y*0,S.copy(m),m.normalize(),l.push(m.x,m.y,m.z);break;case e.length-1:l.push(S.x,S.y,S.z);break;default:x=e[E+1].x-e[E].x,y=e[E+1].y-e[E].y,m.x=y*1,m.y=-x,m.z=y*0,_.copy(m),m.x+=S.x,m.y+=S.y,m.z+=S.z,m.normalize(),l.push(m.x,m.y,m.z),S.copy(_)}for(let E=0;E<=t;E++){const w=i+E*d*r,M=Math.sin(w),O=Math.cos(w);for(let k=0;k<=e.length-1;k++){f.x=e[k].x*M,f.y=e[k].y,f.z=e[k].x*O,o.push(f.x,f.y,f.z),p.x=E/t,p.y=k/(e.length-1),a.push(p.x,p.y);const I=l[3*k+0]*M,P=l[3*k+1],D=l[3*k+0]*O;c.push(I,P,D)}}for(let E=0;E0&&w(!0),t>0&&w(!1)),this.setIndex(d),this.setAttribute("position",new ht(f,3)),this.setAttribute("normal",new ht(p,3)),this.setAttribute("uv",new ht(m,2));function E(){const M=new G,O=new G;let k=0;const I=(t-e)/i;for(let P=0;P<=s;P++){const D=[],A=P/s,R=A*(t-e)+e;for(let V=0;V<=r;V++){const U=V/r,se=U*l+a,le=Math.sin(se),ee=Math.cos(se);O.x=R*le,O.y=-A*i+x,O.z=R*ee,f.push(O.x,O.y,O.z),M.set(le,I,ee).normalize(),p.push(M.x,M.y,M.z),m.push(U,1-A),D.push(_++)}S.push(D)}for(let P=0;P0&&(d.push(A,R,U),k+=3),t>0&&(d.push(R,V,U),k+=3)}c.addGroup(y,k,0),y+=k}function w(M){const O=_,k=new Ee,I=new G;let P=0;const D=M===!0?e:t,A=M===!0?1:-1;for(let V=1;V<=r;V++)f.push(0,x*A,0),p.push(0,A,0),m.push(.5,.5),_++;const R=_;for(let V=0;V<=r;V++){const se=V/r*l+a,le=Math.cos(se),ee=Math.sin(se);I.x=D*ee,I.y=x*A,I.z=D*le,f.push(I.x,I.y,I.z),p.push(0,A,0),k.x=le*.5+.5,k.y=ee*.5*A+.5,m.push(k.x,k.y),_++}for(let V=0;V.9&&I<.1&&(w<.2&&(o[E+0]+=1),M<.2&&(o[E+2]+=1),O<.2&&(o[E+4]+=1))}}function p(E){s.push(E.x,E.y,E.z)}function m(E,w){const M=E*3;w.x=e[M+0],w.y=e[M+1],w.z=e[M+2]}function _(){const E=new G,w=new G,M=new G,O=new G,k=new Ee,I=new Ee,P=new Ee;for(let D=0,A=0;D80*t){a=c=n[0],l=d=n[1];for(let _=t;_c&&(c=f),p>d&&(d=p);m=Math.max(c-a,d-l),m=m!==0?32767/m:0}return hm(s,o,t,a,l,m,0),o}};function SV(n,e,t,i,r){let s,o;if(r===Gte(n,e,t,i)>0)for(s=e;s=e;s-=i)o=PL(s,n[s],n[s+1],o);return o&&Mx(o,o.next)&&(fm(o),o=o.next),o}function hu(n,e){if(!n)return n;e||(e=n);let t=n,i;do if(i=!1,!t.steiner&&(Mx(t,t.next)||Bn(t.prev,t,t.next)===0)){if(fm(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function hm(n,e,t,i,r,s,o){if(!n)return;!o&&s&&Ute(n,i,r,s);let a=n,l,c;for(;n.prev!==n.next;){if(l=n.prev,c=n.next,s?Pte(n,i,r,s):bte(n)){e.push(l.i/t|0),e.push(n.i/t|0),e.push(c.i/t|0),fm(n),n=c.next,a=c.next;continue}if(n=c,n===a){o?o===1?(n=Rte(hu(n),e,t),hm(n,e,t,i,r,s,2)):o===2&&Ite(n,e,t,i,r,s):hm(hu(n),e,t,i,r,s,1);break}}}function bte(n){const e=n.prev,t=n,i=n.next;if(Bn(e,t,i)>=0)return!1;const r=e.x,s=t.x,o=i.x,a=e.y,l=t.y,c=i.y,d=rs?r>o?r:o:s>o?s:o,m=a>l?a>c?a:c:l>c?l:c;let _=i.next;for(;_!==e;){if(_.x>=d&&_.x<=p&&_.y>=f&&_.y<=m&&Nh(r,a,s,l,o,c,_.x,_.y)&&Bn(_.prev,_,_.next)>=0)return!1;_=_.next}return!0}function Pte(n,e,t,i){const r=n.prev,s=n,o=n.next;if(Bn(r,s,o)>=0)return!1;const a=r.x,l=s.x,c=o.x,d=r.y,f=s.y,p=o.y,m=al?a>c?a:c:l>c?l:c,x=d>f?d>p?d:p:f>p?f:p,y=ST(m,_,e,t,i),E=ST(S,x,e,t,i);let w=n.prevZ,M=n.nextZ;for(;w&&w.z>=y&&M&&M.z<=E;){if(w.x>=m&&w.x<=S&&w.y>=_&&w.y<=x&&w!==r&&w!==o&&Nh(a,d,l,f,c,p,w.x,w.y)&&Bn(w.prev,w,w.next)>=0||(w=w.prevZ,M.x>=m&&M.x<=S&&M.y>=_&&M.y<=x&&M!==r&&M!==o&&Nh(a,d,l,f,c,p,M.x,M.y)&&Bn(M.prev,M,M.next)>=0))return!1;M=M.nextZ}for(;w&&w.z>=y;){if(w.x>=m&&w.x<=S&&w.y>=_&&w.y<=x&&w!==r&&w!==o&&Nh(a,d,l,f,c,p,w.x,w.y)&&Bn(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;M&&M.z<=E;){if(M.x>=m&&M.x<=S&&M.y>=_&&M.y<=x&&M!==r&&M!==o&&Nh(a,d,l,f,c,p,M.x,M.y)&&Bn(M.prev,M,M.next)>=0)return!1;M=M.nextZ}return!0}function Rte(n,e,t){let i=n;do{const r=i.prev,s=i.next.next;!Mx(r,s)&&wV(r,i,i.next,s)&&dm(r,s)&&dm(s,r)&&(e.push(r.i/t|0),e.push(i.i/t|0),e.push(s.i/t|0),fm(i),fm(i.next),i=n=s),i=i.next}while(i!==n);return hu(i)}function Ite(n,e,t,i,r,s){let o=n;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&Bte(o,a)){let l=EV(o,a);o=hu(o,o.next),l=hu(l,l.next),hm(o,e,t,i,r,s,0),hm(l,e,t,i,r,s,0);return}a=a.next}o=o.next}while(o!==n)}function Lte(n,e,t,i){const r=[];let s,o,a,l,c;for(s=0,o=e.length;s=t.next.y&&t.next.y!==t.y){const p=t.x+(o-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(p<=s&&p>i&&(i=p,r=t.x=t.x&&t.x>=l&&s!==t.x&&Nh(or.x||t.x===r.x&&Ote(r,t)))&&(r=t,d=f)),t=t.next;while(t!==a);return r}function Ote(n,e){return Bn(n.prev,n,e.prev)<0&&Bn(e.next,n,n.next)<0}function Ute(n,e,t,i){let r=n;do r.z===0&&(r.z=ST(r.x,r.y,e,t,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==n);r.prevZ.nextZ=null,r.prevZ=null,Fte(r)}function Fte(n){let e,t,i,r,s,o,a,l,c=1;do{for(t=n,n=null,s=null,o=0;t;){for(o++,i=t,a=0,e=0;e0||l>0&&i;)a!==0&&(l===0||!i||t.z<=i.z)?(r=t,t=t.nextZ,a--):(r=i,i=i.nextZ,l--),s?s.nextZ=r:n=r,r.prevZ=s,s=r;t=i}s.nextZ=null,c*=2}while(o>1);return n}function ST(n,e,t,i,r){return n=(n-t)*r|0,e=(e-i)*r|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function Vte(n){let e=n,t=n;do(e.x=(n-o)*(s-a)&&(n-o)*(i-a)>=(t-o)*(e-a)&&(t-o)*(s-a)>=(r-o)*(i-a)}function Bte(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!zte(n,e)&&(dm(n,e)&&dm(e,n)&&Hte(n,e)&&(Bn(n.prev,n,e.prev)||Bn(n,e.prev,e))||Mx(n,e)&&Bn(n.prev,n,n.next)>0&&Bn(e.prev,e,e.next)>0)}function Bn(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function Mx(n,e){return n.x===e.x&&n.y===e.y}function wV(n,e,t,i){const r=Qy(Bn(n,e,t)),s=Qy(Bn(n,e,i)),o=Qy(Bn(t,i,n)),a=Qy(Bn(t,i,e));return!!(r!==s&&o!==a||r===0&&Ky(n,t,e)||s===0&&Ky(n,i,e)||o===0&&Ky(t,n,i)||a===0&&Ky(t,e,i))}function Ky(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function Qy(n){return n>0?1:n<0?-1:0}function zte(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&wV(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function dm(n,e){return Bn(n.prev,n,n.next)<0?Bn(n,e,n.next)>=0&&Bn(n,n.prev,e)>=0:Bn(n,e,n.prev)<0||Bn(n,n.next,e)<0}function Hte(n,e){let t=n,i=!1;const r=(n.x+e.x)/2,s=(n.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&r<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==n);return i}function EV(n,e){const t=new wT(n.i,n.x,n.y),i=new wT(e.i,e.x,e.y),r=n.next,s=e.prev;return n.next=e,e.prev=n,t.next=r,r.prev=t,i.next=t,t.prev=i,s.next=i,i.prev=s,i}function PL(n,e,t,i){const r=new wT(n,e,t);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function fm(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function wT(n,e,t){this.i=n,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Gte(n,e,t,i){let r=0;for(let s=e,o=t-i;s2&&n[e-1].equals(n[0])&&n.pop()}function IL(n,e){for(let t=0;tNumber.EPSILON){const Te=Math.sqrt(ae),Se=Math.sqrt(X*X+F*F),nt=j.x-We/Te,Ce=j.y+lt/Te,Ge=Ve.x-F/Se,Lt=Ve.y+X/Se,Le=((Ge-nt)*F-(Lt-Ce)*X)/(lt*F-We*X);Oe=nt+lt*Le-xe.x,Pe=Ce+We*Le-xe.y;const Ze=Oe*Oe+Pe*Pe;if(Ze<=2)return new Ee(Oe,Pe);Ue=Math.sqrt(Ze/2)}else{let Te=!1;lt>Number.EPSILON?X>Number.EPSILON&&(Te=!0):lt<-Number.EPSILON?X<-Number.EPSILON&&(Te=!0):Math.sign(We)===Math.sign(F)&&(Te=!0),Te?(Oe=-We,Pe=lt,Ue=Math.sqrt(ae)):(Oe=lt,Pe=We,Ue=Math.sqrt(ae/2))}return new Ee(Oe/Ue,Pe/Ue)}const J=[];for(let xe=0,j=se.length,Ve=j-1,Oe=xe+1;xe=0;xe--){const j=xe/x,Ve=m*Math.cos(j*Math.PI/2),Oe=_*Math.sin(j*Math.PI/2)+S;for(let Pe=0,Ue=se.length;Pe=0;){const Oe=Ve;let Pe=Ve-1;Pe<0&&(Pe=xe.length-1);for(let Ue=0,lt=d+x*2;Ue0)&&m.push(w,M,k),(y!==i-1||l0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class bV extends Oi{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new rt(16777215),this.specular=new rt(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new rt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Fl,this.normalScale=new Ee(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new _r,this.combine=Vm,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class PV extends Oi{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new rt(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new rt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Fl,this.normalScale=new Ee(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class RV extends Oi{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Fl,this.normalScale=new Ee(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class IV extends Oi{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new rt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new rt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Fl,this.normalScale=new Ee(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new _r,this.combine=Vm,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class LV extends Oi{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new rt(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Fl,this.normalScale=new Ee(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}}class NV extends wr{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function Bc(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function DV(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function kV(n){function e(r,s){return n[r]-n[s]}const t=n.length,i=new Array(t);for(let r=0;r!==t;++r)i[r]=r;return i.sort(e),i}function ET(n,e,t){const i=n.length,r=new n.constructor(i);for(let s=0,o=0;o!==i;++s){const a=t[s]*e;for(let l=0;l!==e;++l)r[o++]=n[a+l]}return r}function fC(n,e,t,i){let r=1,s=n[0];for(;s!==void 0&&s[i]===void 0;)s=n[r++];if(s===void 0)return;let o=s[i];if(o!==void 0)if(Array.isArray(o))do o=s[i],o!==void 0&&(e.push(s.time),t.push.apply(t,o)),s=n[r++];while(s!==void 0);else if(o.toArray!==void 0)do o=s[i],o!==void 0&&(e.push(s.time),o.toArray(t,t.length)),s=n[r++];while(s!==void 0);else do o=s[i],o!==void 0&&(e.push(s.time),t.push(o)),s=n[r++];while(s!==void 0)}function qte(n,e,t,i,r=30){const s=n.clone();s.name=e;const o=[];for(let l=0;l=i)){f.push(c.times[m]);for(let S=0;Ss.tracks[l].times[0]&&(a=s.tracks[l].times[0]);for(let l=0;l=a.times[_]){const y=_*f+d,E=y+f-d;S=a.values.slice(y,E)}else{const y=a.createInterpolant(),E=d,w=f-d;y.evaluate(s),S=y.resultBuffer.slice(E,w)}l==="quaternion"&&new nr().fromArray(S).normalize().conjugate().toArray(S);const x=c.times.length;for(let y=0;y=s)){const a=t[1];e=s)break t}o=i,i=0;break n}break e}for(;i>>1;et;)--o;if(++o,s!==0||o!==r){s>=o&&(o=Math.max(o,1),s=o-1);const a=this.getValueSize();this.times=i.slice(s,o),this.values=this.values.slice(s*a,o*a)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const i=this.times,r=this.values,s=i.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==s;a++){const l=i[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(r!==void 0&&DV(r))for(let a=0,l=r.length;a!==l;++a){const c=r[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),i=this.getValueSize(),r=this.getInterpolation()===Cv,s=e.length-1;let o=1;for(let a=1;a0){e[o]=e[s];for(let a=s*i,l=o*i,c=0;c!==i;++c)t[l+c]=t[a+c];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*i)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),i=this.constructor,r=new i(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}Qs.prototype.TimeBufferType=Float32Array;Qs.prototype.ValueBufferType=Float32Array;Qs.prototype.DefaultInterpolation=o_;class _u extends Qs{constructor(e,t,i){super(e,t,i)}}_u.prototype.ValueTypeName="bool";_u.prototype.ValueBufferType=Array;_u.prototype.DefaultInterpolation=nm;_u.prototype.InterpolantFactoryMethodLinear=void 0;_u.prototype.InterpolantFactoryMethodSmooth=void 0;class mC extends Qs{}mC.prototype.ValueTypeName="color";class pm extends Qs{}pm.prototype.ValueTypeName="number";class FV extends $m{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(i-t)/(r-t);let c=e*a;for(let d=c+a;c!==d;c+=4)nr.slerpFlat(s,0,o,c-a,o,c,l);return s}}class Ym extends Qs{InterpolantFactoryMethodLinear(e){return new FV(this.times,this.values,this.getValueSize(),e)}}Ym.prototype.ValueTypeName="quaternion";Ym.prototype.InterpolantFactoryMethodSmooth=void 0;class xu extends Qs{constructor(e,t,i){super(e,t,i)}}xu.prototype.ValueTypeName="string";xu.prototype.ValueBufferType=Array;xu.prototype.DefaultInterpolation=nm;xu.prototype.InterpolantFactoryMethodLinear=void 0;xu.prototype.InterpolantFactoryMethodSmooth=void 0;class mm extends Qs{}mm.prototype.ValueTypeName="vector";class gm{constructor(e="",t=-1,i=[],r=dx){this.name=e,this.tracks=i,this.duration=t,this.blendMode=r,this.uuid=Zr(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],i=e.tracks,r=1/(e.fps||1);for(let o=0,a=i.length;o!==a;++o)t.push(Qte(i[o]).scale(r));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){const t=[],i=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=i.length;s!==o;++s)t.push(Qs.toJSON(i[s]));return r}static CreateFromMorphTargetSequence(e,t,i,r){const s=t.length,o=[];for(let a=0;a1){const f=d[1];let p=r[f];p||(r[f]=p=[]),p.push(c)}}const o=[];for(const a in r)o.push(this.CreateFromMorphTargetSequence(a,r[a],t,i));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(f,p,m,_,S){if(m.length!==0){const x=[],y=[];fC(m,x,y,_),x.length!==0&&S.push(new f(p,x,y))}},r=[],s=e.name||"default",o=e.fps||30,a=e.blendMode;let l=e.length||-1;const c=e.hierarchy||[];for(let f=0;f{t&&t(s),this.manager.itemEnd(e)},0),s;if(zo[e]!==void 0){zo[e].push({onLoad:t,onProgress:i,onError:r});return}zo[e]=[],zo[e].push({onLoad:t,onProgress:i,onError:r});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=this.responseType;fetch(o).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const d=zo[e],f=c.body.getReader(),p=c.headers.get("X-File-Size")||c.headers.get("Content-Length"),m=p?parseInt(p):0,_=m!==0;let S=0;const x=new ReadableStream({start(y){E();function E(){f.read().then(({done:w,value:M})=>{if(w)y.close();else{S+=M.byteLength;const O=new ProgressEvent("progress",{lengthComputable:_,loaded:S,total:m});for(let k=0,I=d.length;k{y.error(w)})}}});return new Response(x)}else throw new Jte(`fetch for "${c.url}" responded with ${c.status}: ${c.statusText}`,c)}).then(c=>{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(d=>new DOMParser().parseFromString(d,a));case"json":return c.json();default:if(a===void 0)return c.text();{const f=/charset="?([^;"\s]*)"?/i.exec(a),p=f&&f[1]?f[1].toLowerCase():void 0,m=new TextDecoder(p);return c.arrayBuffer().then(_=>m.decode(_))}}}).then(c=>{Qo.add(e,c);const d=zo[e];delete zo[e];for(let f=0,p=d.length;f{const d=zo[e];if(d===void 0)throw this.manager.itemError(e),c;delete zo[e];for(let f=0,p=d.length;f{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class Zte extends zr{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new ma(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{t(s.parse(JSON.parse(a)))}catch(l){r?r(l):console.error(l),s.manager.itemError(e)}},i,r)}parse(e){const t=[];for(let i=0;i0:r.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const s in e.uniforms){const o=e.uniforms[s];switch(r.uniforms[s]={},o.type){case"t":r.uniforms[s].value=i(o.value);break;case"c":r.uniforms[s].value=new rt().setHex(o.value);break;case"v2":r.uniforms[s].value=new Ee().fromArray(o.value);break;case"v3":r.uniforms[s].value=new G().fromArray(o.value);break;case"v4":r.uniforms[s].value=new sn().fromArray(o.value);break;case"m3":r.uniforms[s].value=new Ut().fromArray(o.value);break;case"m4":r.uniforms[s].value=new St().fromArray(o.value);break;default:r.uniforms[s].value=o.value}}if(e.defines!==void 0&&(r.defines=e.defines),e.vertexShader!==void 0&&(r.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(r.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(r.glslVersion=e.glslVersion),e.extensions!==void 0)for(const s in e.extensions)r.extensions[s]=e.extensions[s];if(e.lights!==void 0&&(r.lights=e.lights),e.clipping!==void 0&&(r.clipping=e.clipping),e.size!==void 0&&(r.size=e.size),e.sizeAttenuation!==void 0&&(r.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(r.map=i(e.map)),e.matcap!==void 0&&(r.matcap=i(e.matcap)),e.alphaMap!==void 0&&(r.alphaMap=i(e.alphaMap)),e.bumpMap!==void 0&&(r.bumpMap=i(e.bumpMap)),e.bumpScale!==void 0&&(r.bumpScale=e.bumpScale),e.normalMap!==void 0&&(r.normalMap=i(e.normalMap)),e.normalMapType!==void 0&&(r.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),r.normalScale=new Ee().fromArray(s)}return e.displacementMap!==void 0&&(r.displacementMap=i(e.displacementMap)),e.displacementScale!==void 0&&(r.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(r.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(r.roughnessMap=i(e.roughnessMap)),e.metalnessMap!==void 0&&(r.metalnessMap=i(e.metalnessMap)),e.emissiveMap!==void 0&&(r.emissiveMap=i(e.emissiveMap)),e.emissiveIntensity!==void 0&&(r.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(r.specularMap=i(e.specularMap)),e.specularIntensityMap!==void 0&&(r.specularIntensityMap=i(e.specularIntensityMap)),e.specularColorMap!==void 0&&(r.specularColorMap=i(e.specularColorMap)),e.envMap!==void 0&&(r.envMap=i(e.envMap)),e.envMapRotation!==void 0&&r.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(r.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(r.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(r.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(r.lightMap=i(e.lightMap)),e.lightMapIntensity!==void 0&&(r.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(r.aoMap=i(e.aoMap)),e.aoMapIntensity!==void 0&&(r.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(r.gradientMap=i(e.gradientMap)),e.clearcoatMap!==void 0&&(r.clearcoatMap=i(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(r.clearcoatRoughnessMap=i(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(r.clearcoatNormalMap=i(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(r.clearcoatNormalScale=new Ee().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(r.iridescenceMap=i(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(r.iridescenceThicknessMap=i(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(r.transmissionMap=i(e.transmissionMap)),e.thicknessMap!==void 0&&(r.thicknessMap=i(e.thicknessMap)),e.anisotropyMap!==void 0&&(r.anisotropyMap=i(e.anisotropyMap)),e.sheenColorMap!==void 0&&(r.sheenColorMap=i(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(r.sheenRoughnessMap=i(e.sheenRoughnessMap)),r}setTextures(e){return this.textures=e,this}createMaterialFromType(e){return Ox.createMaterialFromType(e)}static createMaterialFromType(e){const t={ShadowMaterial:AV,SpriteMaterial:iC,RawShaderMaterial:MV,ShaderMaterial:qs,PointsMaterial:sC,MeshPhysicalMaterial:CV,MeshStandardMaterial:dC,MeshPhongMaterial:bV,MeshToonMaterial:PV,MeshNormalMaterial:RV,MeshLambertMaterial:IV,MeshDepthMaterial:tC,MeshDistanceMaterial:nC,MeshBasicMaterial:Vl,MeshMatcapMaterial:LV,LineDashedMaterial:NV,LineBasicMaterial:wr,Material:Oi};return new t[e]}}class TT{static decodeText(e){if(console.warn("THREE.LoaderUtils: decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead."),typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let i=0,r=e.length;i0){const l=new gC(t);s=new ym(l),s.setCrossOrigin(this.crossOrigin);for(let c=0,d=e.length;c0){r=new ym(this.manager),r.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;o{const x=new vr;x.min.fromArray(S.boxMin),x.max.fromArray(S.boxMax);const y=new ir;return y.radius=S.sphereRadius,y.center.fromArray(S.sphereCenter),{boxInitialized:S.boxInitialized,box:x,sphereInitialized:S.sphereInitialized,sphere:y}}),o._maxInstanceCount=e.maxInstanceCount,o._maxVertexCount=e.maxVertexCount,o._maxIndexCount=e.maxIndexCount,o._geometryInitialized=e.geometryInitialized,o._geometryCount=e.geometryCount,o._matricesTexture=c(e.matricesTexture.uuid),e.colorsTexture!==void 0&&(o._colorsTexture=c(e.colorsTexture.uuid));break;case"LOD":o=new cV;break;case"Line":o=new Il(a(e.geometry),l(e.material));break;case"LineLoop":o=new fV(a(e.geometry),l(e.material));break;case"LineSegments":o=new Ao(a(e.geometry),l(e.material));break;case"PointCloud":case"Points":o=new pV(a(e.geometry),l(e.material));break;case"Sprite":o=new lV(l(e.material));break;case"Group":o=new Lh;break;case"Bone":o=new rC;break;default:o=new Zt}if(o.uuid=e.uuid,e.name!==void 0&&(o.name=e.name),e.matrix!==void 0?(o.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(o.matrixAutoUpdate=e.matrixAutoUpdate),o.matrixAutoUpdate&&o.matrix.decompose(o.position,o.quaternion,o.scale)):(e.position!==void 0&&o.position.fromArray(e.position),e.rotation!==void 0&&o.rotation.fromArray(e.rotation),e.quaternion!==void 0&&o.quaternion.fromArray(e.quaternion),e.scale!==void 0&&o.scale.fromArray(e.scale)),e.up!==void 0&&o.up.fromArray(e.up),e.castShadow!==void 0&&(o.castShadow=e.castShadow),e.receiveShadow!==void 0&&(o.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.intensity!==void 0&&(o.shadow.intensity=e.shadow.intensity),e.shadow.bias!==void 0&&(o.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(o.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(o.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&o.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(o.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(o.visible=e.visible),e.frustumCulled!==void 0&&(o.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(o.renderOrder=e.renderOrder),e.userData!==void 0&&(o.userData=e.userData),e.layers!==void 0&&(o.layers.mask=e.layers),e.children!==void 0){const p=e.children;for(let m=0;m"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,i,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=Qo.get(e);if(o!==void 0){if(s.manager.itemStart(e),o.then){o.then(c=>{t&&t(c),s.manager.itemEnd(e)}).catch(c=>{r&&r(c)});return}return setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o}const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader;const l=fetch(e,a).then(function(c){return c.blob()}).then(function(c){return createImageBitmap(c,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(c){return Qo.add(e,c),t&&t(c),s.manager.itemEnd(e),c}).catch(function(c){r&&r(c),Qo.remove(e),s.manager.itemError(e),s.manager.itemEnd(e)});Qo.add(e,l),s.manager.itemStart(e)}}let Jy;class vC{static getContext(){return Jy===void 0&&(Jy=new(window.AudioContext||window.webkitAudioContext)),Jy}static setContext(e){Jy=e}}class cne extends zr{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new ma(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){try{const c=l.slice(0);vC.getContext().decodeAudioData(c,function(f){t(f)}).catch(a)}catch(c){a(c)}},i,r);function a(l){r?r(l):console.error(l),s.manager.itemError(e)}}}const VL=new St,BL=new St,gc=new St;class une{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Dn,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Dn,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,gc.copy(e.projectionMatrix);const r=t.eyeSep/2,s=r*t.near/t.focus,o=t.near*Math.tan(Yc*t.fov*.5)/t.zoom;let a,l;BL.elements[12]=-r,VL.elements[12]=r,a=-o*t.aspect+s,l=o*t.aspect+s,gc.elements[0]=2*t.near/(l-a),gc.elements[8]=(l+a)/(l-a),this.cameraL.projectionMatrix.copy(gc),a=-o*t.aspect-s,l=o*t.aspect-s,gc.elements[0]=2*t.near/(l-a),gc.elements[8]=(l+a)/(l-a),this.cameraR.projectionMatrix.copy(gc)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(BL),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(VL)}}class _C{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=zL(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=zL();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function zL(){return performance.now()}const yc=new G,HL=new nr,hne=new G,vc=new G;class dne extends Zt{constructor(){super(),this.type="AudioListener",this.context=vC.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new _C}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,i=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(yc,HL,hne),vc.set(0,0,-1).applyQuaternion(HL),t.positionX){const r=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(yc.x,r),t.positionY.linearRampToValueAtTime(yc.y,r),t.positionZ.linearRampToValueAtTime(yc.z,r),t.forwardX.linearRampToValueAtTime(vc.x,r),t.forwardY.linearRampToValueAtTime(vc.y,r),t.forwardZ.linearRampToValueAtTime(vc.z,r),t.upX.linearRampToValueAtTime(i.x,r),t.upY.linearRampToValueAtTime(i.y,r),t.upZ.linearRampToValueAtTime(i.z,r)}else t.setPosition(yc.x,yc.y,yc.z),t.setOrientation(vc.x,vc.y,vc.z,i.x,i.y,i.z)}}class YV extends Zt{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(e=0){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(this.context.currentTime+e),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(i,r,this._addIndex*t,1,t);for(let l=t,c=t+t;l!==c;++l)if(i[l]!==i[l+t]){a.setValue(i,r);break}}saveOriginalState(){const e=this.binding,t=this.buffer,i=this.valueSize,r=i*this._origIndex;e.getValue(t,r);for(let s=i,o=r;s!==o;++s)t[s]=t[r+s%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let i=e;i=.5)for(let o=0;o!==s;++o)e[t+o]=e[i+o]}_slerp(e,t,i,r){nr.slerpFlat(e,t,e,t,e,i,r)}_slerpAdditive(e,t,i,r,s){const o=this._workIndex*s;nr.multiplyQuaternionsFlat(e,o,e,t,e,i),nr.slerpFlat(e,t,e,t,e,o,r)}_lerp(e,t,i,r,s){const o=1-r;for(let a=0;a!==s;++a){const l=t+a;e[l]=e[l]*o+e[i+a]*r}}_lerpAdditive(e,t,i,r,s){for(let o=0;o!==s;++o){const a=t+o;e[a]=e[a]+e[i+o]*r}}}const xC="\\[\\]\\.:\\/",gne=new RegExp("["+xC+"]","g"),SC="[^"+xC+"]",yne="[^"+xC.replace("\\.","")+"]",vne=/((?:WC+[\/:])*)/.source.replace("WC",SC),_ne=/(WCOD+)?/.source.replace("WCOD",yne),xne=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",SC),Sne=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",SC),wne=new RegExp("^"+vne+_ne+xne+Sne+"$"),Ene=["material","materials","bones","map"];class Tne{constructor(e,t,i){const r=i||nn.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();const i=this._targetGroup.nCachedObjects_,r=this._bindings[i];r!==void 0&&r.getValue(e,t)}setValue(e,t){const i=this._bindings;for(let r=this._targetGroup.nCachedObjects_,s=i.length;r!==s;++r)i[r].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}}class nn{constructor(e,t,i){this.path=t,this.parsedPath=i||nn.parseTrackName(t),this.node=nn.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return e&&e.isAnimationObjectGroup?new nn.Composite(e,t,i):new nn(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(gne,"")}static parseTrackName(e){const t=wne.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=i.nodeName&&i.nodeName.lastIndexOf(".");if(r!==void 0&&r!==-1){const s=i.nodeName.substring(r+1);Ene.indexOf(s)!==-1&&(i.nodeName=i.nodeName.substring(0,r),i.objectName=s)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const i=e.skeleton.getBoneByName(t);if(i!==void 0)return i}if(e.children){const i=function(s){for(let o=0;o=s){const f=s++,p=e[f];t[p.uuid]=d,e[d]=p,t[c]=f,e[f]=l;for(let m=0,_=r;m!==_;++m){const S=i[m],x=S[f],y=S[d];S[d]=x,S[f]=y}}}this.nCachedObjects_=s}uncache(){const e=this._objects,t=this._indicesByUUID,i=this._bindings,r=i.length;let s=this.nCachedObjects_,o=e.length;for(let a=0,l=arguments.length;a!==l;++a){const c=arguments[a],d=c.uuid,f=t[d];if(f!==void 0)if(delete t[d],f0&&(t[m.uuid]=f),e[f]=m,e.pop();for(let _=0,S=r;_!==S;++_){const x=i[_];x[f]=x[p],x.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){const i=this._bindingsIndicesByPath;let r=i[e];const s=this._bindings;if(r!==void 0)return s[r];const o=this._paths,a=this._parsedPaths,l=this._objects,c=l.length,d=this.nCachedObjects_,f=new Array(c);r=s.length,i[e]=r,o.push(e),a.push(t),s.push(f);for(let p=d,m=l.length;p!==m;++p){const _=l[p];f[p]=new nn(_,e,t)}return f}unsubscribe_(e){const t=this._bindingsIndicesByPath,i=t[e];if(i!==void 0){const r=this._paths,s=this._parsedPaths,o=this._bindings,a=o.length-1,l=o[a],c=e[a];t[c]=i,o[i]=l,o.pop(),s[i]=s[a],s.pop(),r[i]=r[a],r.pop()}}}class QV{constructor(e,t,i=null,r=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=i,this.blendMode=r;const s=t.tracks,o=s.length,a=new Array(o),l={endingStart:Uc,endingEnd:Uc};for(let c=0;c!==o;++c){const d=s[c].createInterpolant(null);a[c]=d,d.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=NF,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,i){if(e.fadeOut(t),this.fadeIn(t),i){const r=this._clip.duration,s=e._clip.duration,o=s/r,a=r/s;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,i){return e.crossFadeFrom(this,t,i)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,i){const r=this._mixer,s=r.time,o=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);const l=a.parameterPositions,c=a.sampleValues;return l[0]=s,l[1]=s+i,c[0]=e/o,c[1]=t/o,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,i,r){if(!this.enabled){this._updateWeight(e);return}const s=this._startTime;if(s!==null){const l=(e-s)*i;l<0||i===0?t=0:(this._startTime=null,t=i*l)}t*=this._updateTimeScale(e);const o=this._updateTime(t),a=this._updateWeight(e);if(a>0){const l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case jM:for(let d=0,f=l.length;d!==f;++d)l[d].evaluate(o),c[d].accumulateAdditive(a);break;case dx:default:for(let d=0,f=l.length;d!==f;++d)l[d].evaluate(o),c[d].accumulate(r,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const i=this._weightInterpolant;if(i!==null){const r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopFading(),r===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const i=this._timeScaleInterpolant;if(i!==null){const r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,i=this.loop;let r=this.time+e,s=this._loopCount;const o=i===DF;if(e===0)return s===-1?r:o&&(s&1)===1?t-r:r;if(i===LF){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=t)r=t;else if(r<0)r=0;else{this.time=r;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),r>=t||r<0){const a=Math.floor(r/t);r-=t*a,s+=Math.abs(a);const l=this.repetitions-s;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){const c=e<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=r;if(o&&(s&1)===1)return t-r}return r}_setEndings(e,t,i){const r=this._interpolantSettings;i?(r.endingStart=Fc,r.endingEnd=Fc):(e?r.endingStart=this.zeroSlopeAtStart?Fc:Uc:r.endingStart=im,t?r.endingEnd=this.zeroSlopeAtEnd?Fc:Uc:r.endingEnd=im)}_scheduleFading(e,t,i){const r=this._mixer,s=r.time;let o=this._weightInterpolant;o===null&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);const a=o.parameterPositions,l=o.sampleValues;return a[0]=s,l[0]=t,a[1]=s+e,l[1]=i,this}}const Mne=new Float32Array(1);class Cne extends Ys{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const i=e._localRoot||this._root,r=e._clip.tracks,s=r.length,o=e._propertyBindings,a=e._interpolants,l=i.uuid,c=this._bindingsByRootAndName;let d=c[l];d===void 0&&(d={},c[l]=d);for(let f=0;f!==s;++f){const p=r[f],m=p.name;let _=d[m];if(_!==void 0)++_.referenceCount,o[f]=_;else{if(_=o[f],_!==void 0){_._cacheIndex===null&&(++_.referenceCount,this._addInactiveBinding(_,l,m));continue}const S=t&&t._propertyBindings[f].binding.parsedPath;_=new KV(nn.create(i,m,S),p.ValueTypeName,p.getValueSize()),++_.referenceCount,this._addInactiveBinding(_,l,m),o[f]=_}a[f].resultBuffer=_.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const i=(e._localRoot||this._root).uuid,r=e._clip.uuid,s=this._actionsByClip[r];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,r,i)}const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];--s.useCount===0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t=0;--i)e[i].stop();return this}update(e){e*=this.timeScale;const t=this._actions,i=this._nActiveActions,r=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let c=0;c!==i;++c)t[c]._update(r,e,s,o);const a=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)a[c].apply(o);return this}setTime(e){this.time=0;for(let t=0;t=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,XL).distanceTo(e)}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const qL=new G,Zy=new G;class Dne{constructor(e=new G,t=new G){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){qL.subVectors(e,this.start),Zy.subVectors(this.end,this.start);const i=Zy.dot(Zy);let s=Zy.dot(qL)/i;return t&&(s=$n(s,0,1)),s}closestPointToPoint(e,t,i){const r=this.closestPointToPointParameter(e,t);return this.delta(i).multiplyScalar(r).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const $L=new G;class kne extends Zt{constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const i=new Vt,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,a=1,l=32;o1)for(let f=0;f.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{ZL.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(ZL,t)}}setLength(e,t=e*.2,i=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(i,t,i),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class $ne extends Ao{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],i=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],r=new Vt;r.setAttribute("position",new ht(t,3)),r.setAttribute("color",new ht(i,3));const s=new wr({vertexColors:!0,toneMapped:!1});super(r,s),this.type="AxesHelper"}setColors(e,t,i){const r=new rt,s=this.geometry.attributes.color.array;return r.set(e),r.toArray(s,0),r.toArray(s,3),r.set(t),r.toArray(s,6),r.toArray(s,9),r.set(i),r.toArray(s,12),r.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class Yne{constructor(){this.type="ShapePath",this.color=new rt,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new um,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,i,r){return this.currentPath.quadraticCurveTo(e,t,i,r),this}bezierCurveTo(e,t,i,r,s,o){return this.currentPath.bezierCurveTo(e,t,i,r,s,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(y){const E=[];for(let w=0,M=y.length;wNumber.EPSILON){if(A<0&&(I=E[k],D=-D,P=E[O],A=-A),y.yP.y)continue;if(y.y===I.y){if(y.x===I.x)return!0}else{const R=A*(y.x-I.x)-D*(y.y-I.y);if(R===0)return!0;if(R<0)continue;M=!M}}else{if(y.y!==I.y)continue;if(P.x<=y.x&&y.x<=I.x||I.x<=y.x&&y.x<=P.x)return!0}}return M}const r=xo.isClockWise,s=this.subPaths;if(s.length===0)return[];let o,a,l;const c=[];if(s.length===1)return a=s[0],l=new Qc,l.curves=a.curves,c.push(l),c;let d=!r(s[0].getPoints());d=e?!d:d;const f=[],p=[];let m=[],_=0,S;p[_]=void 0,m[_]=[];for(let y=0,E=s.length;y1){let y=!1,E=0;for(let w=0,M=p.length;w0&&y===!1&&(m=f)}let x;for(let y=0,E=p.length;y=0&&(M[be]=null,w[be].disconnect(Ne))}for(let we=0;we=M.length){M.push(Ne),be=dt;break}else if(M[dt]===null){M[dt]=Ne,be=dt;break}if(be===-1)break}const ft=w[be];ft&&ft.connect(Ne)}}const ee=new G,pe=new G;function W(he,we,Ne){ee.setFromMatrixPosition(we.matrixWorld),pe.setFromMatrixPosition(Ne.matrixWorld);const be=ee.distanceTo(pe),ft=we.projectionMatrix.elements,dt=Ne.projectionMatrix.elements,Ke=ft[14]/(ft[10]-1),ke=ft[14]/(ft[10]+1),xe=(ft[9]+1)/ft[5],j=(ft[9]-1)/ft[5],Ve=(ft[8]-1)/ft[0],Oe=(dt[8]+1)/dt[0],Pe=Ke*Ve,Ue=Ke*Oe,lt=be/(-Ve+Oe),We=lt*-Ve;if(we.matrixWorld.decompose(he.position,he.quaternion,he.scale),he.translateX(We),he.translateZ(lt),he.matrixWorld.compose(he.position,he.quaternion,he.scale),he.matrixWorldInverse.copy(he.matrixWorld).invert(),ft[10]===-1)he.projectionMatrix.copy(we.projectionMatrix),he.projectionMatrixInverse.copy(we.projectionMatrixInverse);else{const X=Ke+lt,F=ke+lt,ae=Pe-We,_e=Ue+(be-We),Te=xe*ke/F*X,Se=j*ke/F*X;he.projectionMatrix.makePerspective(ae,_e,Te,Se,X,F),he.projectionMatrixInverse.copy(he.projectionMatrix).invert()}}function J(he,we){we===null?he.matrixWorld.copy(he.matrix):he.matrixWorld.multiplyMatrices(we.matrixWorld,he.matrix),he.matrixWorldInverse.copy(he.matrixWorld).invert()}this.updateCamera=function(he){if(r===null)return;let we=he.near,Ne=he.far;S.texture!==null&&(S.depthNear>0&&(we=S.depthNear),S.depthFar>0&&(Ne=S.depthFar)),A.near=P.near=I.near=we,A.far=P.far=I.far=Ne,(R!==A.near||V!==A.far)&&(r.updateRenderState({depthNear:A.near,depthFar:A.far}),R=A.near,V=A.far);const be=he.parent,ft=A.cameras;J(A,be);for(let dt=0;dt0&&(x.alphaTest.value=y.alphaTest);const E=e.get(y),w=E.envMap,M=E.envMapRotation;w&&(x.envMap.value=w,pc.copy(M),pc.x*=-1,pc.y*=-1,pc.z*=-1,w.isCubeTexture&&w.isRenderTargetTexture===!1&&(pc.y*=-1,pc.z*=-1),x.envMapRotation.value.setFromMatrix4(nte.makeRotationFromEuler(pc)),x.flipEnvMap.value=w.isCubeTexture&&w.isRenderTargetTexture===!1?-1:1,x.reflectivity.value=y.reflectivity,x.ior.value=y.ior,x.refractionRatio.value=y.refractionRatio),y.lightMap&&(x.lightMap.value=y.lightMap,x.lightMapIntensity.value=y.lightMapIntensity,t(y.lightMap,x.lightMapTransform)),y.aoMap&&(x.aoMap.value=y.aoMap,x.aoMapIntensity.value=y.aoMapIntensity,t(y.aoMap,x.aoMapTransform))}function o(x,y){x.diffuse.value.copy(y.color),x.opacity.value=y.opacity,y.map&&(x.map.value=y.map,t(y.map,x.mapTransform))}function a(x,y){x.dashSize.value=y.dashSize,x.totalSize.value=y.dashSize+y.gapSize,x.scale.value=y.scale}function l(x,y,E,w){x.diffuse.value.copy(y.color),x.opacity.value=y.opacity,x.size.value=y.size*E,x.scale.value=w*.5,y.map&&(x.map.value=y.map,t(y.map,x.uvTransform)),y.alphaMap&&(x.alphaMap.value=y.alphaMap,t(y.alphaMap,x.alphaMapTransform)),y.alphaTest>0&&(x.alphaTest.value=y.alphaTest)}function c(x,y){x.diffuse.value.copy(y.color),x.opacity.value=y.opacity,x.rotation.value=y.rotation,y.map&&(x.map.value=y.map,t(y.map,x.mapTransform)),y.alphaMap&&(x.alphaMap.value=y.alphaMap,t(y.alphaMap,x.alphaMapTransform)),y.alphaTest>0&&(x.alphaTest.value=y.alphaTest)}function d(x,y){x.specular.value.copy(y.specular),x.shininess.value=Math.max(y.shininess,1e-4)}function f(x,y){y.gradientMap&&(x.gradientMap.value=y.gradientMap)}function p(x,y){x.metalness.value=y.metalness,y.metalnessMap&&(x.metalnessMap.value=y.metalnessMap,t(y.metalnessMap,x.metalnessMapTransform)),x.roughness.value=y.roughness,y.roughnessMap&&(x.roughnessMap.value=y.roughnessMap,t(y.roughnessMap,x.roughnessMapTransform)),y.envMap&&(x.envMapIntensity.value=y.envMapIntensity)}function m(x,y,E){x.ior.value=y.ior,y.sheen>0&&(x.sheenColor.value.copy(y.sheenColor).multiplyScalar(y.sheen),x.sheenRoughness.value=y.sheenRoughness,y.sheenColorMap&&(x.sheenColorMap.value=y.sheenColorMap,t(y.sheenColorMap,x.sheenColorMapTransform)),y.sheenRoughnessMap&&(x.sheenRoughnessMap.value=y.sheenRoughnessMap,t(y.sheenRoughnessMap,x.sheenRoughnessMapTransform))),y.clearcoat>0&&(x.clearcoat.value=y.clearcoat,x.clearcoatRoughness.value=y.clearcoatRoughness,y.clearcoatMap&&(x.clearcoatMap.value=y.clearcoatMap,t(y.clearcoatMap,x.clearcoatMapTransform)),y.clearcoatRoughnessMap&&(x.clearcoatRoughnessMap.value=y.clearcoatRoughnessMap,t(y.clearcoatRoughnessMap,x.clearcoatRoughnessMapTransform)),y.clearcoatNormalMap&&(x.clearcoatNormalMap.value=y.clearcoatNormalMap,t(y.clearcoatNormalMap,x.clearcoatNormalMapTransform),x.clearcoatNormalScale.value.copy(y.clearcoatNormalScale),y.side===yr&&x.clearcoatNormalScale.value.negate())),y.dispersion>0&&(x.dispersion.value=y.dispersion),y.iridescence>0&&(x.iridescence.value=y.iridescence,x.iridescenceIOR.value=y.iridescenceIOR,x.iridescenceThicknessMinimum.value=y.iridescenceThicknessRange[0],x.iridescenceThicknessMaximum.value=y.iridescenceThicknessRange[1],y.iridescenceMap&&(x.iridescenceMap.value=y.iridescenceMap,t(y.iridescenceMap,x.iridescenceMapTransform)),y.iridescenceThicknessMap&&(x.iridescenceThicknessMap.value=y.iridescenceThicknessMap,t(y.iridescenceThicknessMap,x.iridescenceThicknessMapTransform))),y.transmission>0&&(x.transmission.value=y.transmission,x.transmissionSamplerMap.value=E.texture,x.transmissionSamplerSize.value.set(E.width,E.height),y.transmissionMap&&(x.transmissionMap.value=y.transmissionMap,t(y.transmissionMap,x.transmissionMapTransform)),x.thickness.value=y.thickness,y.thicknessMap&&(x.thicknessMap.value=y.thicknessMap,t(y.thicknessMap,x.thicknessMapTransform)),x.attenuationDistance.value=y.attenuationDistance,x.attenuationColor.value.copy(y.attenuationColor)),y.anisotropy>0&&(x.anisotropyVector.value.set(y.anisotropy*Math.cos(y.anisotropyRotation),y.anisotropy*Math.sin(y.anisotropyRotation)),y.anisotropyMap&&(x.anisotropyMap.value=y.anisotropyMap,t(y.anisotropyMap,x.anisotropyMapTransform))),x.specularIntensity.value=y.specularIntensity,x.specularColor.value.copy(y.specularColor),y.specularColorMap&&(x.specularColorMap.value=y.specularColorMap,t(y.specularColorMap,x.specularColorMapTransform)),y.specularIntensityMap&&(x.specularIntensityMap.value=y.specularIntensityMap,t(y.specularIntensityMap,x.specularIntensityMapTransform))}function _(x,y){y.matcap&&(x.matcap.value=y.matcap)}function S(x,y){const E=e.get(y).light;x.referencePosition.value.setFromMatrixPosition(E.matrixWorld),x.nearDistance.value=E.shadow.camera.near,x.farDistance.value=E.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:r}}function rte(n,e,t,i){let r={},s={},o=[];const a=n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS);function l(E,w){const M=w.program;i.uniformBlockBinding(E,M)}function c(E,w){let M=r[E.id];M===void 0&&(_(E),M=d(E),r[E.id]=M,E.addEventListener("dispose",x));const O=w.program;i.updateUBOMapping(E,O);const k=e.render.frame;s[E.id]!==k&&(p(E),s[E.id]=k)}function d(E){const w=f();E.__bindingPointIndex=w;const M=n.createBuffer(),O=E.__size,k=E.usage;return n.bindBuffer(n.UNIFORM_BUFFER,M),n.bufferData(n.UNIFORM_BUFFER,O,k),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,w,M),M}function f(){for(let E=0;E0&&(M+=O-k),E.__size=M,E.__cache={},this}function S(E){const w={boundary:0,storage:0};return typeof E=="number"||typeof E=="boolean"?(w.boundary=4,w.storage=4):E.isVector2?(w.boundary=8,w.storage=8):E.isVector3||E.isColor?(w.boundary=16,w.storage=12):E.isVector4?(w.boundary=16,w.storage=16):E.isMatrix3?(w.boundary=48,w.storage=48):E.isMatrix4?(w.boundary=64,w.storage=64):E.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",E),w}function x(E){const w=E.target;w.removeEventListener("dispose",x);const M=o.indexOf(w.__bindingPointIndex);o.splice(M,1),n.deleteBuffer(r[w.id]),delete r[w.id],delete s[w.id]}function y(){for(const E in r)n.deleteBuffer(r[E]);o=[],r={},s={}}return{bind:l,update:c,dispose:y}}class aV{constructor(e={}){const{canvas:t=$F(),context:i=null,depth:r=!0,stencil:s=!1,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:d="default",failIfMajorPerformanceCaveat:f=!1}=e;this.isWebGLRenderer=!0;let p;if(i!==null){if(typeof WebGLRenderingContext<"u"&&i instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");p=i.getContextAttributes().alpha}else p=o;const m=new Uint32Array(4),_=new Int32Array(4);let S=null,x=null;const y=[],E=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=_s,this.toneMapping=vo,this.toneMappingExposure=1;const w=this;let M=!1,O=0,k=0,I=null,P=-1,D=null;const A=new sn,R=new sn;let V=null;const U=new rt(0);let se=0,le=t.width,ee=t.height,pe=1,W=null,J=null;const Z=new sn(0,0,le,ee),oe=new sn(0,0,le,ee);let Me=!1;const Re=new Wm;let he=!1,we=!1;const Ne=new St,be=new St,ft=new G,dt=new sn,Ke={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let ke=!1;function xe(){return I===null?pe:1}let j=i;function Ve(H,te){return t.getContext(H,te)}try{const H={alpha:!0,depth:r,stencil:s,antialias:a,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:d,failIfMajorPerformanceCaveat:f};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${ix}`),t.addEventListener("webglcontextlost",Ae,!1),t.addEventListener("webglcontextrestored",Xe,!1),t.addEventListener("webglcontextcreationerror",$e,!1),j===null){const te="webgl2";if(j=Ve(te,H),j===null)throw Ve(te)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(H){throw console.error("THREE.WebGLRenderer: "+H.message),H}let Oe,Pe,Ue,lt,We,X,F,ae,_e,Te,Se,nt,Ce,Ge,Lt,Le,Ze,Et,vt,et,K,ve,je,Y;function Fe(){Oe=new uZ(j),Oe.init(),ve=new sV(j,Oe),Pe=new rZ(j,Oe,e,ve),Ue=new Wee(j),Pe.reverseDepthBuffer&&Ue.buffers.depth.setReversed(!0),lt=new fZ(j),We=new Iee,X=new Kee(j,Oe,Ue,We,Pe,ve,lt),F=new oZ(w),ae=new cZ(w),_e=new xK(j),je=new nZ(j,_e),Te=new hZ(j,_e,lt,je),Se=new mZ(j,Te,_e,lt),vt=new pZ(j,Pe,X),Le=new sZ(We),nt=new Ree(w,F,ae,Oe,Pe,je,Le),Ce=new ite(w,We),Ge=new Nee,Lt=new Vee(Oe),Et=new tZ(w,F,ae,Ue,Se,p,l),Ze=new Hee(w,Se,Pe),Y=new rte(j,lt,Pe,Ue),et=new iZ(j,Oe,lt),K=new dZ(j,Oe,lt),lt.programs=nt.programs,w.capabilities=Pe,w.extensions=Oe,w.properties=We,w.renderLists=Ge,w.shadowMap=Ze,w.state=Ue,w.info=lt}Fe();const me=new tte(w,j);this.xr=me,this.getContext=function(){return j},this.getContextAttributes=function(){return j.getContextAttributes()},this.forceContextLoss=function(){const H=Oe.get("WEBGL_lose_context");H&&H.loseContext()},this.forceContextRestore=function(){const H=Oe.get("WEBGL_lose_context");H&&H.restoreContext()},this.getPixelRatio=function(){return pe},this.setPixelRatio=function(H){H!==void 0&&(pe=H,this.setSize(le,ee,!1))},this.getSize=function(H){return H.set(le,ee)},this.setSize=function(H,te,ce=!0){if(me.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}le=H,ee=te,t.width=Math.floor(H*pe),t.height=Math.floor(te*pe),ce===!0&&(t.style.width=H+"px",t.style.height=te+"px"),this.setViewport(0,0,H,te)},this.getDrawingBufferSize=function(H){return H.set(le*pe,ee*pe).floor()},this.setDrawingBufferSize=function(H,te,ce){le=H,ee=te,pe=ce,t.width=Math.floor(H*ce),t.height=Math.floor(te*ce),this.setViewport(0,0,H,te)},this.getCurrentViewport=function(H){return H.copy(A)},this.getViewport=function(H){return H.copy(Z)},this.setViewport=function(H,te,ce,de){H.isVector4?Z.set(H.x,H.y,H.z,H.w):Z.set(H,te,ce,de),Ue.viewport(A.copy(Z).multiplyScalar(pe).round())},this.getScissor=function(H){return H.copy(oe)},this.setScissor=function(H,te,ce,de){H.isVector4?oe.set(H.x,H.y,H.z,H.w):oe.set(H,te,ce,de),Ue.scissor(R.copy(oe).multiplyScalar(pe).round())},this.getScissorTest=function(){return Me},this.setScissorTest=function(H){Ue.setScissorTest(Me=H)},this.setOpaqueSort=function(H){W=H},this.setTransparentSort=function(H){J=H},this.getClearColor=function(H){return H.copy(Et.getClearColor())},this.setClearColor=function(){Et.setClearColor.apply(Et,arguments)},this.getClearAlpha=function(){return Et.getClearAlpha()},this.setClearAlpha=function(){Et.setClearAlpha.apply(Et,arguments)},this.clear=function(H=!0,te=!0,ce=!0){let de=0;if(H){let ie=!1;if(I!==null){const Be=I.texture.format;ie=Be===hx||Be===ux||Be===Bm}if(ie){const Be=I.texture.type,Qe=Be===js||Be===pa||Be===dd||Be===lu||Be===ax||Be===lx,st=Et.getClearColor(),it=Et.getClearAlpha(),_t=st.r,xt=st.g,ut=st.b;Qe?(m[0]=_t,m[1]=xt,m[2]=ut,m[3]=it,j.clearBufferuiv(j.COLOR,0,m)):(_[0]=_t,_[1]=xt,_[2]=ut,_[3]=it,j.clearBufferiv(j.COLOR,0,_))}else de|=j.COLOR_BUFFER_BIT}te&&(de|=j.DEPTH_BUFFER_BIT,j.clearDepth(this.capabilities.reverseDepthBuffer?0:1)),ce&&(de|=j.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),j.clear(de)},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",Ae,!1),t.removeEventListener("webglcontextrestored",Xe,!1),t.removeEventListener("webglcontextcreationerror",$e,!1),Ge.dispose(),Lt.dispose(),We.dispose(),F.dispose(),ae.dispose(),Se.dispose(),je.dispose(),Y.dispose(),nt.dispose(),me.dispose(),me.removeEventListener("sessionstart",Gl),me.removeEventListener("sessionend",si),rs.stop()};function Ae(H){H.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),M=!0}function Xe(){console.log("THREE.WebGLRenderer: Context Restored."),M=!1;const H=lt.autoReset,te=Ze.enabled,ce=Ze.autoUpdate,de=Ze.needsUpdate,ie=Ze.type;Fe(),lt.autoReset=H,Ze.enabled=te,Ze.autoUpdate=ce,Ze.needsUpdate=de,Ze.type=ie}function $e(H){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",H.statusMessage)}function At(H){const te=H.target;te.removeEventListener("dispose",At),Bt(te)}function Bt(H){Cn(H),We.remove(H)}function Cn(H){const te=We.get(H).programs;te!==void 0&&(te.forEach(function(ce){nt.releaseProgram(ce)}),H.isShaderMaterial&&nt.releaseShaderCache(H))}this.renderBufferDirect=function(H,te,ce,de,ie,Be){te===null&&(te=Ke);const Qe=ie.isMesh&&ie.matrixWorld.determinant()<0,st=Au(H,te,ce,de,ie);Ue.setMaterial(de,Qe);let it=ce.index,_t=1;if(de.wireframe===!0){if(it=Te.getWireframeAttribute(ce),it===void 0)return;_t=2}const xt=ce.drawRange,ut=ce.attributes.position;let zt=xt.start*_t,Yt=(xt.start+xt.count)*_t;Be!==null&&(zt=Math.max(zt,Be.start*_t),Yt=Math.min(Yt,(Be.start+Be.count)*_t)),it!==null?(zt=Math.max(zt,0),Yt=Math.min(Yt,it.count)):ut!=null&&(zt=Math.max(zt,0),Yt=Math.min(Yt,ut.count));const tn=Yt-zt;if(tn<0||tn===1/0)return;je.setup(ie,de,st,ce,it);let Ot,mt=et;if(it!==null&&(Ot=_e.get(it),mt=K,mt.setIndex(Ot)),ie.isMesh)de.wireframe===!0?(Ue.setLineWidth(de.wireframeLinewidth*xe()),mt.setMode(j.LINES)):mt.setMode(j.TRIANGLES);else if(ie.isLine){let ot=de.linewidth;ot===void 0&&(ot=1),Ue.setLineWidth(ot*xe()),ie.isLineSegments?mt.setMode(j.LINES):ie.isLineLoop?mt.setMode(j.LINE_LOOP):mt.setMode(j.LINE_STRIP)}else ie.isPoints?mt.setMode(j.POINTS):ie.isSprite&&mt.setMode(j.TRIANGLES);if(ie.isBatchedMesh)if(ie._multiDrawInstances!==null)mt.renderMultiDrawInstances(ie._multiDrawStarts,ie._multiDrawCounts,ie._multiDrawCount,ie._multiDrawInstances);else if(Oe.get("WEBGL_multi_draw"))mt.renderMultiDraw(ie._multiDrawStarts,ie._multiDrawCounts,ie._multiDrawCount);else{const ot=ie._multiDrawStarts,qt=ie._multiDrawCounts,Mt=ie._multiDrawCount,Gn=it?_e.get(it).bytesPerElement:1,Ui=We.get(de).currentProgram.getUniforms();for(let dn=0;dn{function Be(){if(de.forEach(function(Qe){We.get(Qe).currentProgram.isReady()&&de.delete(Qe)}),de.size===0){ie(H);return}setTimeout(Be,10)}Oe.get("KHR_parallel_shader_compile")!==null?Be():setTimeout(Be,10)})};let Sn=null;function kn(H){Sn&&Sn(H)}function Gl(){rs.stop()}function si(){rs.start()}const rs=new eV;rs.setAnimationLoop(kn),typeof self<"u"&&rs.setContext(self),this.setAnimationLoop=function(H){Sn=H,me.setAnimationLoop(H),H===null?rs.stop():rs.start()},me.addEventListener("sessionstart",Gl),me.addEventListener("sessionend",si),this.render=function(H,te){if(te!==void 0&&te.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(M===!0)return;if(H.matrixWorldAutoUpdate===!0&&H.updateMatrixWorld(),te.parent===null&&te.matrixWorldAutoUpdate===!0&&te.updateMatrixWorld(),me.enabled===!0&&me.isPresenting===!0&&(me.cameraAutoUpdate===!0&&me.updateCamera(te),te=me.getCamera()),H.isScene===!0&&H.onBeforeRender(w,H,te,I),x=Lt.get(H,E.length),x.init(te),E.push(x),be.multiplyMatrices(te.projectionMatrix,te.matrixWorldInverse),Re.setFromProjectionMatrix(be),we=this.localClippingEnabled,he=Le.init(this.clippingPlanes,we),S=Ge.get(H,y.length),S.init(),y.push(S),me.enabled===!0&&me.isPresenting===!0){const Be=w.xr.getDepthSensingMesh();Be!==null&&ss(Be,te,-1/0,w.sortObjects)}ss(H,te,0,w.sortObjects),S.finish(),w.sortObjects===!0&&S.sort(W,J),ke=me.enabled===!1||me.isPresenting===!1||me.hasDepthSensing()===!1,ke&&Et.addToRenderList(S,H),this.info.render.frame++,he===!0&&Le.beginShadows();const ce=x.state.shadowsArray;Ze.render(ce,H,te),he===!0&&Le.endShadows(),this.info.autoReset===!0&&this.info.reset();const de=S.opaque,ie=S.transmissive;if(x.setupLights(),te.isArrayCamera){const Be=te.cameras;if(ie.length>0)for(let Qe=0,st=Be.length;Qe0&&Eu(de,ie,H,te),ke&&Et.render(H),os(S,H,te);I!==null&&(X.updateMultisampleRenderTarget(I),X.updateRenderTargetMipmap(I)),H.isScene===!0&&H.onAfterRender(w,H,te),je.resetDefaultState(),P=-1,D=null,E.pop(),E.length>0?(x=E[E.length-1],he===!0&&Le.setGlobalState(w.clippingPlanes,x.state.camera)):x=null,y.pop(),y.length>0?S=y[y.length-1]:S=null};function ss(H,te,ce,de){if(H.visible===!1)return;if(H.layers.test(te.layers)){if(H.isGroup)ce=H.renderOrder;else if(H.isLOD)H.autoUpdate===!0&&H.update(te);else if(H.isLight)x.pushLight(H),H.castShadow&&x.pushShadow(H);else if(H.isSprite){if(!H.frustumCulled||Re.intersectsSprite(H)){de&&dt.setFromMatrixPosition(H.matrixWorld).applyMatrix4(be);const Qe=Se.update(H),st=H.material;st.visible&&S.push(H,Qe,st,ce,dt.z,null)}}else if((H.isMesh||H.isLine||H.isPoints)&&(!H.frustumCulled||Re.intersectsObject(H))){const Qe=Se.update(H),st=H.material;if(de&&(H.boundingSphere!==void 0?(H.boundingSphere===null&&H.computeBoundingSphere(),dt.copy(H.boundingSphere.center)):(Qe.boundingSphere===null&&Qe.computeBoundingSphere(),dt.copy(Qe.boundingSphere.center)),dt.applyMatrix4(H.matrixWorld).applyMatrix4(be)),Array.isArray(st)){const it=Qe.groups;for(let _t=0,xt=it.length;_t0&&as(ie,te,ce),Be.length>0&&as(Be,te,ce),Qe.length>0&&as(Qe,te,ce),Ue.buffers.depth.setTest(!0),Ue.buffers.depth.setMask(!0),Ue.buffers.color.setMask(!0),Ue.setPolygonOffset(!1)}function Eu(H,te,ce,de){if((ce.isScene===!0?ce.overrideMaterial:null)!==null)return;x.state.transmissionRenderTarget[de.id]===void 0&&(x.state.transmissionRenderTarget[de.id]=new Xs(1,1,{generateMipmaps:!0,type:Oe.has("EXT_color_buffer_half_float")||Oe.has("EXT_color_buffer_float")?Id:js,minFilter:ho,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:cn.workingColorSpace}));const Be=x.state.transmissionRenderTarget[de.id],Qe=de.viewport||A;Be.setSize(Qe.z,Qe.w);const st=w.getRenderTarget();w.setRenderTarget(Be),w.getClearColor(U),se=w.getClearAlpha(),se<1&&w.setClearColor(16777215,.5),w.clear(),ke&&Et.render(ce);const it=w.toneMapping;w.toneMapping=vo;const _t=de.viewport;if(de.viewport!==void 0&&(de.viewport=void 0),x.setupLightsView(de),he===!0&&Le.setGlobalState(w.clippingPlanes,de),as(H,ce,de),X.updateMultisampleRenderTarget(Be),X.updateRenderTargetMipmap(Be),Oe.has("WEBGL_multisampled_render_to_texture")===!1){let xt=!1;for(let ut=0,zt=te.length;ut0),ut=!!ce.morphAttributes.position,zt=!!ce.morphAttributes.normal,Yt=!!ce.morphAttributes.color;let tn=vo;de.toneMapped&&(I===null||I.isXRRenderTarget===!0)&&(tn=w.toneMapping);const Ot=ce.morphAttributes.position||ce.morphAttributes.normal||ce.morphAttributes.color,mt=Ot!==void 0?Ot.length:0,ot=We.get(de),qt=x.state.lights;if(he===!0&&(we===!0||H!==D)){const On=H===D&&de.id===P;Le.setState(de,H,On)}let Mt=!1;de.version===ot.__version?(ot.needsLights&&ot.lightsStateVersion!==qt.state.version||ot.outputColorSpace!==st||ie.isBatchedMesh&&ot.batching===!1||!ie.isBatchedMesh&&ot.batching===!0||ie.isBatchedMesh&&ot.batchingColor===!0&&ie.colorTexture===null||ie.isBatchedMesh&&ot.batchingColor===!1&&ie.colorTexture!==null||ie.isInstancedMesh&&ot.instancing===!1||!ie.isInstancedMesh&&ot.instancing===!0||ie.isSkinnedMesh&&ot.skinning===!1||!ie.isSkinnedMesh&&ot.skinning===!0||ie.isInstancedMesh&&ot.instancingColor===!0&&ie.instanceColor===null||ie.isInstancedMesh&&ot.instancingColor===!1&&ie.instanceColor!==null||ie.isInstancedMesh&&ot.instancingMorph===!0&&ie.morphTexture===null||ie.isInstancedMesh&&ot.instancingMorph===!1&&ie.morphTexture!==null||ot.envMap!==it||de.fog===!0&&ot.fog!==Be||ot.numClippingPlanes!==void 0&&(ot.numClippingPlanes!==Le.numPlanes||ot.numIntersection!==Le.numIntersection)||ot.vertexAlphas!==_t||ot.vertexTangents!==xt||ot.morphTargets!==ut||ot.morphNormals!==zt||ot.morphColors!==Yt||ot.toneMapping!==tn||ot.morphTargetsCount!==mt)&&(Mt=!0):(Mt=!0,ot.__version=de.version);let Gn=ot.currentProgram;Mt===!0&&(Gn=Sa(de,te,ie));let Ui=!1,dn=!1,Js=!1;const _n=Gn.getUniforms(),Er=ot.uniforms;if(Ue.useProgram(Gn.program)&&(Ui=!0,dn=!0,Js=!0),de.id!==P&&(P=de.id,dn=!0),Ui||D!==H){Pe.reverseDepthBuffer?(Ne.copy(H.projectionMatrix),WY(Ne),jY(Ne),_n.setValue(j,"projectionMatrix",Ne)):_n.setValue(j,"projectionMatrix",H.projectionMatrix),_n.setValue(j,"viewMatrix",H.matrixWorldInverse);const On=_n.map.cameraPosition;On!==void 0&&On.setValue(j,ft.setFromMatrixPosition(H.matrixWorld)),Pe.logarithmicDepthBuffer&&_n.setValue(j,"logDepthBufFC",2/(Math.log(H.far+1)/Math.LN2)),(de.isMeshPhongMaterial||de.isMeshToonMaterial||de.isMeshLambertMaterial||de.isMeshBasicMaterial||de.isMeshStandardMaterial||de.isShaderMaterial)&&_n.setValue(j,"isOrthographic",H.isOrthographicCamera===!0),D!==H&&(D=H,dn=!0,Js=!0)}if(ie.isSkinnedMesh){_n.setOptional(j,ie,"bindMatrix"),_n.setOptional(j,ie,"bindMatrixInverse");const On=ie.skeleton;On&&(On.boneTexture===null&&On.computeBoneTexture(),_n.setValue(j,"boneTexture",On.boneTexture,X))}ie.isBatchedMesh&&(_n.setOptional(j,ie,"batchingTexture"),_n.setValue(j,"batchingTexture",ie._matricesTexture,X),_n.setOptional(j,ie,"batchingIdTexture"),_n.setValue(j,"batchingIdTexture",ie._indirectTexture,X),_n.setOptional(j,ie,"batchingColorTexture"),ie._colorsTexture!==null&&_n.setValue(j,"batchingColorTexture",ie._colorsTexture,X));const Zs=ce.morphAttributes;if((Zs.position!==void 0||Zs.normal!==void 0||Zs.color!==void 0)&&vt.update(ie,ce,Gn),(dn||ot.receiveShadow!==ie.receiveShadow)&&(ot.receiveShadow=ie.receiveShadow,_n.setValue(j,"receiveShadow",ie.receiveShadow)),de.isMeshGouraudMaterial&&de.envMap!==null&&(Er.envMap.value=it,Er.flipEnvMap.value=it.isCubeTexture&&it.isRenderTargetTexture===!1?-1:1),de.isMeshStandardMaterial&&de.envMap===null&&te.environment!==null&&(Er.envMapIntensity.value=te.environmentIntensity),dn&&(_n.setValue(j,"toneMappingExposure",w.toneMappingExposure),ot.needsLights&&Wl(Er,Js),Be&&de.fog===!0&&Ce.refreshFogUniforms(Er,Be),Ce.refreshMaterialUniforms(Er,de,pe,ee,x.state.transmissionRenderTarget[H.id]),Pv.upload(j,Tu(ot),Er,X)),de.isShaderMaterial&&de.uniformsNeedUpdate===!0&&(Pv.upload(j,Tu(ot),Er,X),de.uniformsNeedUpdate=!1),de.isSpriteMaterial&&_n.setValue(j,"center",ie.center),_n.setValue(j,"modelViewMatrix",ie.modelViewMatrix),_n.setValue(j,"normalMatrix",ie.normalMatrix),_n.setValue(j,"modelMatrix",ie.matrixWorld),de.isShaderMaterial||de.isRawShaderMaterial){const On=de.uniformsGroups;for(let bn=0,Ea=On.length;bn0&&X.useMultisampledRTT(H)===!1?ie=We.get(H).__webglMultisampledFramebuffer:Array.isArray(xt)?ie=xt[ce]:ie=xt,A.copy(H.viewport),R.copy(H.scissor),V=H.scissorTest}else A.copy(Z).multiplyScalar(pe).floor(),R.copy(oe).multiplyScalar(pe).floor(),V=Me;if(Ue.bindFramebuffer(j.FRAMEBUFFER,ie)&&de&&Ue.drawBuffers(H,ie),Ue.viewport(A),Ue.scissor(R),Ue.setScissorTest(V),Be){const it=We.get(H.texture);j.framebufferTexture2D(j.FRAMEBUFFER,j.COLOR_ATTACHMENT0,j.TEXTURE_CUBE_MAP_POSITIVE_X+te,it.__webglTexture,ce)}else if(Qe){const it=We.get(H.texture),_t=te||0;j.framebufferTextureLayer(j.FRAMEBUFFER,j.COLOR_ATTACHMENT0,it.__webglTexture,ce||0,_t)}P=-1},this.readRenderTargetPixels=function(H,te,ce,de,ie,Be,Qe){if(!(H&&H.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let st=We.get(H).__webglFramebuffer;if(H.isWebGLCubeRenderTarget&&Qe!==void 0&&(st=st[Qe]),st){Ue.bindFramebuffer(j.FRAMEBUFFER,st);try{const it=H.texture,_t=it.format,xt=it.type;if(!Pe.textureFormatReadable(_t)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!Pe.textureTypeReadable(xt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}te>=0&&te<=H.width-de&&ce>=0&&ce<=H.height-ie&&j.readPixels(te,ce,de,ie,ve.convert(_t),ve.convert(xt),Be)}finally{const it=I!==null?We.get(I).__webglFramebuffer:null;Ue.bindFramebuffer(j.FRAMEBUFFER,it)}}},this.readRenderTargetPixelsAsync=async function(H,te,ce,de,ie,Be,Qe){if(!(H&&H.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let st=We.get(H).__webglFramebuffer;if(H.isWebGLCubeRenderTarget&&Qe!==void 0&&(st=st[Qe]),st){const it=H.texture,_t=it.format,xt=it.type;if(!Pe.textureFormatReadable(_t))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Pe.textureTypeReadable(xt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(te>=0&&te<=H.width-de&&ce>=0&&ce<=H.height-ie){Ue.bindFramebuffer(j.FRAMEBUFFER,st);const ut=j.createBuffer();j.bindBuffer(j.PIXEL_PACK_BUFFER,ut),j.bufferData(j.PIXEL_PACK_BUFFER,Be.byteLength,j.STREAM_READ),j.readPixels(te,ce,de,ie,ve.convert(_t),ve.convert(xt),0);const zt=I!==null?We.get(I).__webglFramebuffer:null;Ue.bindFramebuffer(j.FRAMEBUFFER,zt);const Yt=j.fenceSync(j.SYNC_GPU_COMMANDS_COMPLETE,0);return j.flush(),await GY(j,Yt,4),j.bindBuffer(j.PIXEL_PACK_BUFFER,ut),j.getBufferSubData(j.PIXEL_PACK_BUFFER,0,Be),j.deleteBuffer(ut),j.deleteSync(Yt),Be}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")}},this.copyFramebufferToTexture=function(H,te=null,ce=0){H.isTexture!==!0&&(bv("WebGLRenderer: copyFramebufferToTexture function signature has changed."),te=arguments[0]||null,H=arguments[1]);const de=Math.pow(2,-ce),ie=Math.floor(H.image.width*de),Be=Math.floor(H.image.height*de),Qe=te!==null?te.x:0,st=te!==null?te.y:0;X.setTexture2D(H,0),j.copyTexSubImage2D(j.TEXTURE_2D,ce,0,0,Qe,st,ie,Be),Ue.unbindTexture()},this.copyTextureToTexture=function(H,te,ce=null,de=null,ie=0){H.isTexture!==!0&&(bv("WebGLRenderer: copyTextureToTexture function signature has changed."),de=arguments[0]||null,H=arguments[1],te=arguments[2],ie=arguments[3]||0,ce=null);let Be,Qe,st,it,_t,xt;ce!==null?(Be=ce.max.x-ce.min.x,Qe=ce.max.y-ce.min.y,st=ce.min.x,it=ce.min.y):(Be=H.image.width,Qe=H.image.height,st=0,it=0),de!==null?(_t=de.x,xt=de.y):(_t=0,xt=0);const ut=ve.convert(te.format),zt=ve.convert(te.type);X.setTexture2D(te,0),j.pixelStorei(j.UNPACK_FLIP_Y_WEBGL,te.flipY),j.pixelStorei(j.UNPACK_PREMULTIPLY_ALPHA_WEBGL,te.premultiplyAlpha),j.pixelStorei(j.UNPACK_ALIGNMENT,te.unpackAlignment);const Yt=j.getParameter(j.UNPACK_ROW_LENGTH),tn=j.getParameter(j.UNPACK_IMAGE_HEIGHT),Ot=j.getParameter(j.UNPACK_SKIP_PIXELS),mt=j.getParameter(j.UNPACK_SKIP_ROWS),ot=j.getParameter(j.UNPACK_SKIP_IMAGES),qt=H.isCompressedTexture?H.mipmaps[ie]:H.image;j.pixelStorei(j.UNPACK_ROW_LENGTH,qt.width),j.pixelStorei(j.UNPACK_IMAGE_HEIGHT,qt.height),j.pixelStorei(j.UNPACK_SKIP_PIXELS,st),j.pixelStorei(j.UNPACK_SKIP_ROWS,it),H.isDataTexture?j.texSubImage2D(j.TEXTURE_2D,ie,_t,xt,Be,Qe,ut,zt,qt.data):H.isCompressedTexture?j.compressedTexSubImage2D(j.TEXTURE_2D,ie,_t,xt,qt.width,qt.height,ut,qt.data):j.texSubImage2D(j.TEXTURE_2D,ie,_t,xt,Be,Qe,ut,zt,qt),j.pixelStorei(j.UNPACK_ROW_LENGTH,Yt),j.pixelStorei(j.UNPACK_IMAGE_HEIGHT,tn),j.pixelStorei(j.UNPACK_SKIP_PIXELS,Ot),j.pixelStorei(j.UNPACK_SKIP_ROWS,mt),j.pixelStorei(j.UNPACK_SKIP_IMAGES,ot),ie===0&&te.generateMipmaps&&j.generateMipmap(j.TEXTURE_2D),Ue.unbindTexture()},this.copyTextureToTexture3D=function(H,te,ce=null,de=null,ie=0){H.isTexture!==!0&&(bv("WebGLRenderer: copyTextureToTexture3D function signature has changed."),ce=arguments[0]||null,de=arguments[1]||null,H=arguments[2],te=arguments[3],ie=arguments[4]||0);let Be,Qe,st,it,_t,xt,ut,zt,Yt;const tn=H.isCompressedTexture?H.mipmaps[ie]:H.image;ce!==null?(Be=ce.max.x-ce.min.x,Qe=ce.max.y-ce.min.y,st=ce.max.z-ce.min.z,it=ce.min.x,_t=ce.min.y,xt=ce.min.z):(Be=tn.width,Qe=tn.height,st=tn.depth,it=0,_t=0,xt=0),de!==null?(ut=de.x,zt=de.y,Yt=de.z):(ut=0,zt=0,Yt=0);const Ot=ve.convert(te.format),mt=ve.convert(te.type);let ot;if(te.isData3DTexture)X.setTexture3D(te,0),ot=j.TEXTURE_3D;else if(te.isDataArrayTexture||te.isCompressedArrayTexture)X.setTexture2DArray(te,0),ot=j.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}j.pixelStorei(j.UNPACK_FLIP_Y_WEBGL,te.flipY),j.pixelStorei(j.UNPACK_PREMULTIPLY_ALPHA_WEBGL,te.premultiplyAlpha),j.pixelStorei(j.UNPACK_ALIGNMENT,te.unpackAlignment);const qt=j.getParameter(j.UNPACK_ROW_LENGTH),Mt=j.getParameter(j.UNPACK_IMAGE_HEIGHT),Gn=j.getParameter(j.UNPACK_SKIP_PIXELS),Ui=j.getParameter(j.UNPACK_SKIP_ROWS),dn=j.getParameter(j.UNPACK_SKIP_IMAGES);j.pixelStorei(j.UNPACK_ROW_LENGTH,tn.width),j.pixelStorei(j.UNPACK_IMAGE_HEIGHT,tn.height),j.pixelStorei(j.UNPACK_SKIP_PIXELS,it),j.pixelStorei(j.UNPACK_SKIP_ROWS,_t),j.pixelStorei(j.UNPACK_SKIP_IMAGES,xt),H.isDataTexture||H.isData3DTexture?j.texSubImage3D(ot,ie,ut,zt,Yt,Be,Qe,st,Ot,mt,tn.data):te.isCompressedArrayTexture?j.compressedTexSubImage3D(ot,ie,ut,zt,Yt,Be,Qe,st,Ot,tn.data):j.texSubImage3D(ot,ie,ut,zt,Yt,Be,Qe,st,Ot,mt,tn),j.pixelStorei(j.UNPACK_ROW_LENGTH,qt),j.pixelStorei(j.UNPACK_IMAGE_HEIGHT,Mt),j.pixelStorei(j.UNPACK_SKIP_PIXELS,Gn),j.pixelStorei(j.UNPACK_SKIP_ROWS,Ui),j.pixelStorei(j.UNPACK_SKIP_IMAGES,dn),ie===0&&te.generateMipmaps&&j.generateMipmap(ot),Ue.unbindTexture()},this.initRenderTarget=function(H){We.get(H).__webglFramebuffer===void 0&&X.setupRenderTarget(H)},this.initTexture=function(H){H.isCubeTexture?X.setTextureCube(H,0):H.isData3DTexture?X.setTexture3D(H,0):H.isDataArrayTexture||H.isCompressedArrayTexture?X.setTexture2DArray(H,0):X.setTexture2D(H,0),Ue.unbindTexture()},this.resetState=function(){O=0,k=0,I=null,Ue.reset(),je.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return fo}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===fx?"display-p3":"srgb",t.unpackColorSpace=cn.workingColorSpace===zm?"display-p3":"srgb"}}class gx{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new rt(e),this.density=t}clone(){return new gx(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class yx{constructor(e,t=1,i=1e3){this.isFog=!0,this.name="",this.color=new rt(e),this.near=t,this.far=i}clone(){return new yx(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class a_ extends Zt{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new _r,this.environmentIntensity=1,this.environmentRotation=new _r,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class vx{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=am,this.updateRanges=[],this.version=0,this.uuid=Zr()}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.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,i){e*=this.stride,i*=t.stride;for(let r=0,s=this.stride;re.far||t.push({distance:l,point:bf.clone(),uv:Nr.getInterpolation(bf,Dy,Rf,ky,cL,r1,uL,new Ee),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function Oy(n,e,t,i,r,s){sh.subVectors(n,t).addScalar(.5).multiply(i),r!==void 0?(Pf.x=s*sh.x-r*sh.y,Pf.y=r*sh.x+s*sh.y):Pf.copy(sh),n.copy(e),n.x+=Pf.x,n.y+=Pf.y,n.applyMatrix4(lV)}const Uy=new G,hL=new G;class uV extends Zt{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let i=0,r=t.length;i0){let i,r;for(i=1,r=t.length;i0){Uy.setFromMatrixPosition(this.matrixWorld);const r=e.ray.origin.distanceTo(Uy);this.getObjectForDistance(r).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){Uy.setFromMatrixPosition(e.matrixWorld),hL.setFromMatrixPosition(this.matrixWorld);const i=Uy.distanceTo(hL)/e.zoom;t[0].object.visible=!0;let r,s;for(r=1,s=t.length;r=o)t[r-1].object.visible=!1,t[r].object.visible=!0;else break}for(this._currentLevel=r-1;r=r.length&&r.push({start:-1,count:-1,z:-1,index:-1});const o=r[this.index];s.push(o),this.index++,o.start=e.start,o.count=e.count,o.z=t,o.index=i}reset(){this.list.length=0,this.index=0}}const Ga=new St,a1=new St,hte=new St,dte=new rt(1,1,1),xL=new St,l1=new Wm,By=new vr,mc=new ir,Nf=new G,SL=new G,fte=new G,c1=new ute,Yi=new ni,zy=[];function pte(n,e,t=0){const i=e.itemSize;if(n.isInterleavedBufferAttribute||n.array.constructor!==e.array.constructor){const r=n.count;for(let s=0;s65535?new Uint32Array(r):new Uint16Array(r);t.setIndex(new vn(s,1))}this._geometryInitialized=!0}}_validateGeometry(e){const t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw new Error('BatchedMesh: All geometries must consistently have "index".');for(const i in t.attributes){if(!e.hasAttribute(i))throw new Error(`BatchedMesh: Added geometry missing "${i}". All geometries must have consistent attributes.`);const r=e.getAttribute(i),s=t.getAttribute(i);if(r.itemSize!==s.itemSize||r.normalized!==s.normalized)throw new Error("BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new vr);const e=this.boundingBox,t=this._drawInfo;e.makeEmpty();for(let i=0,r=t.length;i=this.maxInstanceCount&&this._availableInstanceIds.length===0)throw new Error("BatchedMesh: Maximum item count reached.");const i={visible:!0,active:!0,geometryIndex:e};let r=null;this._availableInstanceIds.length>0?(r=this._availableInstanceIds.pop(),this._drawInfo[r]=i):(r=this._drawInfo.length,this._drawInfo.push(i));const s=this._matricesTexture,o=s.image.data;hte.toArray(o,r*16),s.needsUpdate=!0;const a=this._colorsTexture;return a&&(dte.toArray(a.image.data,r*4),a.needsUpdate=!0),r}addGeometry(e,t=-1,i=-1){if(this._initializeGeometry(e),this._validateGeometry(e),this._drawInfo.length>=this._maxInstanceCount)throw new Error("BatchedMesh: Maximum item count reached.");const r={vertexStart:-1,vertexCount:-1,indexStart:-1,indexCount:-1};let s=null;const o=this._reservedRanges,a=this._drawRanges,l=this._bounds;this._geometryCount!==0&&(s=o[o.length-1]),t===-1?r.vertexCount=e.getAttribute("position").count:r.vertexCount=t,s===null?r.vertexStart=0:r.vertexStart=s.vertexStart+s.vertexCount;const c=e.getIndex(),d=c!==null;if(d&&(i===-1?r.indexCount=c.count:r.indexCount=i,s===null?r.indexStart=0:r.indexStart=s.indexStart+s.indexCount),r.indexStart!==-1&&r.indexStart+r.indexCount>this._maxIndexCount||r.vertexStart+r.vertexCount>this._maxVertexCount)throw new Error("BatchedMesh: Reserved space request exceeds the maximum buffer size.");const f=this._geometryCount;return this._geometryCount++,o.push(r),a.push({start:d?r.indexStart:r.vertexStart,count:-1}),l.push({boxInitialized:!1,box:new vr,sphereInitialized:!1,sphere:new ir}),this.setGeometryAt(f,e),f}setGeometryAt(e,t){if(e>=this._geometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);const i=this.geometry,r=i.getIndex()!==null,s=i.getIndex(),o=t.getIndex(),a=this._reservedRanges[e];if(r&&o.count>a.indexCount||t.attributes.position.count>a.vertexCount)throw new Error("BatchedMesh: Reserved space not large enough for provided geometry.");const l=a.vertexStart,c=a.vertexCount;for(const m in i.attributes){const _=t.getAttribute(m),S=i.getAttribute(m);pte(_,S,l);const x=_.itemSize;for(let y=_.count,E=c;y=t.length||t[e].active===!1?this:(t[e].active=!1,this._availableInstanceIds.push(e),this._visibilityChanged=!0,this)}getBoundingBoxAt(e,t){if(e>=this._geometryCount)return null;const i=this._bounds[e],r=i.box,s=this.geometry;if(i.boxInitialized===!1){r.makeEmpty();const o=s.index,a=s.attributes.position,l=this._drawRanges[e];for(let c=l.start,d=l.start+l.count;c=this._geometryCount)return null;const i=this._bounds[e],r=i.sphere,s=this.geometry;if(i.sphereInitialized===!1){r.makeEmpty(),this.getBoundingBoxAt(e,By),By.getCenter(r.center);const o=s.index,a=s.attributes.position,l=this._drawRanges[e];let c=0;for(let d=l.start,f=l.start+l.count;d=i.length||i[e].active===!1?this:(t.toArray(s,e*16),r.needsUpdate=!0,this)}getMatrixAt(e,t){const i=this._drawInfo,r=this._matricesTexture.image.data;return e>=i.length||i[e].active===!1?null:t.fromArray(r,e*16)}setColorAt(e,t){this._colorsTexture===null&&this._initColorsTexture();const i=this._colorsTexture,r=this._colorsTexture.image.data,s=this._drawInfo;return e>=s.length||s[e].active===!1?this:(t.toArray(r,e*4),i.needsUpdate=!0,this)}getColorAt(e,t){const i=this._colorsTexture.image.data,r=this._drawInfo;return e>=r.length||r[e].active===!1?null:t.fromArray(i,e*4)}setVisibleAt(e,t){const i=this._drawInfo;return e>=i.length||i[e].active===!1||i[e].visible===t?this:(i[e].visible=t,this._visibilityChanged=!0,this)}getVisibleAt(e){const t=this._drawInfo;return e>=t.length||t[e].active===!1?!1:t[e].visible}setGeometryIdAt(e,t){const i=this._drawInfo;return e>=i.length||i[e].active===!1||t<0||t>=this._geometryCount?null:(i[e].geometryIndex=t,this)}getGeometryIdAt(e){const t=this._drawInfo;return e>=t.length||t[e].active===!1?-1:t[e].geometryIndex}getGeometryRangeAt(e,t={}){if(e<0||e>=this._geometryCount)return null;const i=this._drawRanges[e];return t.start=i.start,t.count=i.count,t}raycast(e,t){const i=this._drawInfo,r=this._drawRanges,s=this.matrixWorld,o=this.geometry;Yi.material=this.material,Yi.geometry.index=o.index,Yi.geometry.attributes=o.attributes,Yi.geometry.boundingBox===null&&(Yi.geometry.boundingBox=new vr),Yi.geometry.boundingSphere===null&&(Yi.geometry.boundingSphere=new ir);for(let a=0,l=i.length;a({...t})),this._reservedRanges=e._reservedRanges.map(t=>({...t})),this._drawInfo=e._drawInfo.map(t=>({...t})),this._bounds=e._bounds.map(t=>({boxInitialized:t.boxInitialized,box:t.box.clone(),sphereInitialized:t.sphereInitialized,sphere:t.sphere.clone()})),this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._geometryCount=e._geometryCount,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),this._colorsTexture!==null&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){return this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,this._colorsTexture!==null&&(this._colorsTexture.dispose(),this._colorsTexture=null),this}onBeforeRender(e,t,i,r,s){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const o=r.getIndex(),a=o===null?1:o.array.BYTES_PER_ELEMENT,l=this._drawInfo,c=this._multiDrawStarts,d=this._multiDrawCounts,f=this._drawRanges,p=this.perObjectFrustumCulled,m=this._indirectTexture,_=m.image.data;p&&(xL.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse).multiply(this.matrixWorld),l1.setFromProjectionMatrix(xL,e.coordinateSystem));let S=0;if(this.sortObjects){a1.copy(this.matrixWorld).invert(),Nf.setFromMatrixPosition(i.matrixWorld).applyMatrix4(a1),SL.set(0,0,-1).transformDirection(i.matrixWorld).transformDirection(a1);for(let E=0,w=l.length;E0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;si)return;u1.applyMatrix4(n.matrixWorld);const l=e.ray.origin.distanceTo(u1);if(!(le.far))return{distance:l,point:EL.clone().applyMatrix4(n.matrixWorld),index:r,face:null,faceIndex:null,barycoord:null,object:n}}const TL=new G,AL=new G;class Ao extends Il{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,i=[];for(let r=0,s=t.count;r0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;sr.far)return;s.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,faceIndex:null,barycoord:null,object:o})}}class mte extends In{constructor(e,t,i,r,s,o,a,l,c){super(e,t,i,r,s,o,a,l,c),this.isVideoTexture=!0,this.minFilter=o!==void 0?o:fi,this.magFilter=s!==void 0?s:fi,this.generateMipmaps=!1;const d=this;function f(){d.needsUpdate=!0,e.requestVideoFrameCallback(f)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(f)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class gte extends In{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=Ai,this.minFilter=Ai,this.generateMipmaps=!1,this.needsUpdate=!0}}class xx extends In{constructor(e,t,i,r,s,o,a,l,c,d,f,p){super(null,o,a,l,c,d,r,s,f,p),this.isCompressedTexture=!0,this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class yte extends xx{constructor(e,t,i,r,s,o){super(e,t,i,s,o),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=Es,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class vte extends xx{constructor(e,t,i){super(void 0,e[0].width,e[0].height,t,i,fa),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class _te extends In{constructor(e,t,i,r,s,o,a,l,c){super(e,t,i,r,s,o,a,l,c),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Ks{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const i=this.getUtoTmapping(e);return this.getPoint(i,t)}getPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return t}getSpacedPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPointAt(i/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let i,r=this.getPoint(0),s=0;t.push(0);for(let o=1;o<=e;o++)i=this.getPoint(o/e),s+=i.distanceTo(r),t.push(s),r=i;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const i=this.getLengths();let r=0;const s=i.length;let o;t?o=t:o=e*i[s-1];let a=0,l=s-1,c;for(;a<=l;)if(r=Math.floor(a+(l-a)/2),c=i[r]-o,c<0)a=r+1;else if(c>0)l=r-1;else{l=r;break}if(r=l,i[r]===o)return r/(s-1);const d=i[r],p=i[r+1]-d,m=(o-d)/p;return(r+m)/(s-1)}getTangent(e,t){let r=e-1e-4,s=e+1e-4;r<0&&(r=0),s>1&&(s=1);const o=this.getPoint(r),a=this.getPoint(s),l=t||(o.isVector2?new Ee:new G);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){const i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t){const i=new G,r=[],s=[],o=[],a=new G,l=new St;for(let m=0;m<=e;m++){const _=m/e;r[m]=this.getTangentAt(_,new G)}s[0]=new G,o[0]=new G;let c=Number.MAX_VALUE;const d=Math.abs(r[0].x),f=Math.abs(r[0].y),p=Math.abs(r[0].z);d<=c&&(c=d,i.set(1,0,0)),f<=c&&(c=f,i.set(0,1,0)),p<=c&&i.set(0,0,1),a.crossVectors(r[0],i).normalize(),s[0].crossVectors(r[0],a),o[0].crossVectors(r[0],s[0]);for(let m=1;m<=e;m++){if(s[m]=s[m-1].clone(),o[m]=o[m-1].clone(),a.crossVectors(r[m-1],r[m]),a.length()>Number.EPSILON){a.normalize();const _=Math.acos($n(r[m-1].dot(r[m]),-1,1));s[m].applyMatrix4(l.makeRotationAxis(a,_))}o[m].crossVectors(r[m],s[m])}if(t===!0){let m=Math.acos($n(s[0].dot(s[e]),-1,1));m/=e,r[0].dot(a.crossVectors(s[0],s[e]))>0&&(m=-m);for(let _=1;_<=e;_++)s[_].applyMatrix4(l.makeRotationAxis(r[_],m*_)),o[_].crossVectors(r[_],s[_])}return{tangents:r,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class Sx extends Ks{constructor(e=0,t=0,i=1,r=1,s=0,o=Math.PI*2,a=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=r,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t=new Ee){const i=t,r=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const o=Math.abs(s)r;)s-=r;s0?0:(Math.floor(Math.abs(a)/s)+1)*s:l===0&&a===s-1&&(a=s-2,l=1);let c,d;this.closed||a>0?c=r[(a-1)%s]:(Xy.subVectors(r[0],r[1]).add(r[0]),c=Xy);const f=r[a%s],p=r[(a+1)%s];if(this.closed||a+2r.length-2?r.length-1:o+1],f=r[o>r.length-3?r.length-1:o+2];return i.set(bL(a,l.x,c.x,d.x,f.x),bL(a,l.y,c.y,d.y,f.y)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t=i){const o=r[s]-i,a=this.curves[s],l=a.getLength(),c=l===0?0:1-o/l;return a.getPointAt(c,t)}s++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let i=0,r=this.curves.length;i1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,i=e.curves.length;t0){const f=c.getPoint(0);f.equals(this.currentPoint)||this.lineTo(f.x,f.y)}this.curves.push(c);const d=c.getPoint(1);return this.currentPoint.copy(d),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class jm extends Vt{constructor(e=[new Ee(0,-.5),new Ee(.5,0),new Ee(0,.5)],t=12,i=0,r=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:i,phiLength:r},t=Math.floor(t),r=$n(r,0,Math.PI*2);const s=[],o=[],a=[],l=[],c=[],d=1/t,f=new G,p=new Ee,m=new G,_=new G,S=new G;let x=0,y=0;for(let E=0;E<=e.length-1;E++)switch(E){case 0:x=e[E+1].x-e[E].x,y=e[E+1].y-e[E].y,m.x=y*1,m.y=-x,m.z=y*0,S.copy(m),m.normalize(),l.push(m.x,m.y,m.z);break;case e.length-1:l.push(S.x,S.y,S.z);break;default:x=e[E+1].x-e[E].x,y=e[E+1].y-e[E].y,m.x=y*1,m.y=-x,m.z=y*0,_.copy(m),m.x+=S.x,m.y+=S.y,m.z+=S.z,m.normalize(),l.push(m.x,m.y,m.z),S.copy(_)}for(let E=0;E<=t;E++){const w=i+E*d*r,M=Math.sin(w),O=Math.cos(w);for(let k=0;k<=e.length-1;k++){f.x=e[k].x*M,f.y=e[k].y,f.z=e[k].x*O,o.push(f.x,f.y,f.z),p.x=E/t,p.y=k/(e.length-1),a.push(p.x,p.y);const I=l[3*k+0]*M,P=l[3*k+1],D=l[3*k+0]*O;c.push(I,P,D)}}for(let E=0;E0&&w(!0),t>0&&w(!1)),this.setIndex(d),this.setAttribute("position",new ht(f,3)),this.setAttribute("normal",new ht(p,3)),this.setAttribute("uv",new ht(m,2));function E(){const M=new G,O=new G;let k=0;const I=(t-e)/i;for(let P=0;P<=s;P++){const D=[],A=P/s,R=A*(t-e)+e;for(let V=0;V<=r;V++){const U=V/r,se=U*l+a,le=Math.sin(se),ee=Math.cos(se);O.x=R*le,O.y=-A*i+x,O.z=R*ee,f.push(O.x,O.y,O.z),M.set(le,I,ee).normalize(),p.push(M.x,M.y,M.z),m.push(U,1-A),D.push(_++)}S.push(D)}for(let P=0;P0&&(d.push(A,R,U),k+=3),t>0&&(d.push(R,V,U),k+=3)}c.addGroup(y,k,0),y+=k}function w(M){const O=_,k=new Ee,I=new G;let P=0;const D=M===!0?e:t,A=M===!0?1:-1;for(let V=1;V<=r;V++)f.push(0,x*A,0),p.push(0,A,0),m.push(.5,.5),_++;const R=_;for(let V=0;V<=r;V++){const se=V/r*l+a,le=Math.cos(se),ee=Math.sin(se);I.x=D*ee,I.y=x*A,I.z=D*le,f.push(I.x,I.y,I.z),p.push(0,A,0),k.x=le*.5+.5,k.y=ee*.5*A+.5,m.push(k.x,k.y),_++}for(let V=0;V.9&&I<.1&&(w<.2&&(o[E+0]+=1),M<.2&&(o[E+2]+=1),O<.2&&(o[E+4]+=1))}}function p(E){s.push(E.x,E.y,E.z)}function m(E,w){const M=E*3;w.x=e[M+0],w.y=e[M+1],w.z=e[M+2]}function _(){const E=new G,w=new G,M=new G,O=new G,k=new Ee,I=new Ee,P=new Ee;for(let D=0,A=0;D80*t){a=c=n[0],l=d=n[1];for(let _=t;_c&&(c=f),p>d&&(d=p);m=Math.max(c-a,d-l),m=m!==0?32767/m:0}return hm(s,o,t,a,l,m,0),o}};function wV(n,e,t,i,r){let s,o;if(r===Gte(n,e,t,i)>0)for(s=e;s=e;s-=i)o=PL(s,n[s],n[s+1],o);return o&&Mx(o,o.next)&&(fm(o),o=o.next),o}function hu(n,e){if(!n)return n;e||(e=n);let t=n,i;do if(i=!1,!t.steiner&&(Mx(t,t.next)||Bn(t.prev,t,t.next)===0)){if(fm(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function hm(n,e,t,i,r,s,o){if(!n)return;!o&&s&&Ute(n,i,r,s);let a=n,l,c;for(;n.prev!==n.next;){if(l=n.prev,c=n.next,s?Pte(n,i,r,s):bte(n)){e.push(l.i/t|0),e.push(n.i/t|0),e.push(c.i/t|0),fm(n),n=c.next,a=c.next;continue}if(n=c,n===a){o?o===1?(n=Rte(hu(n),e,t),hm(n,e,t,i,r,s,2)):o===2&&Ite(n,e,t,i,r,s):hm(hu(n),e,t,i,r,s,1);break}}}function bte(n){const e=n.prev,t=n,i=n.next;if(Bn(e,t,i)>=0)return!1;const r=e.x,s=t.x,o=i.x,a=e.y,l=t.y,c=i.y,d=rs?r>o?r:o:s>o?s:o,m=a>l?a>c?a:c:l>c?l:c;let _=i.next;for(;_!==e;){if(_.x>=d&&_.x<=p&&_.y>=f&&_.y<=m&&Nh(r,a,s,l,o,c,_.x,_.y)&&Bn(_.prev,_,_.next)>=0)return!1;_=_.next}return!0}function Pte(n,e,t,i){const r=n.prev,s=n,o=n.next;if(Bn(r,s,o)>=0)return!1;const a=r.x,l=s.x,c=o.x,d=r.y,f=s.y,p=o.y,m=al?a>c?a:c:l>c?l:c,x=d>f?d>p?d:p:f>p?f:p,y=ST(m,_,e,t,i),E=ST(S,x,e,t,i);let w=n.prevZ,M=n.nextZ;for(;w&&w.z>=y&&M&&M.z<=E;){if(w.x>=m&&w.x<=S&&w.y>=_&&w.y<=x&&w!==r&&w!==o&&Nh(a,d,l,f,c,p,w.x,w.y)&&Bn(w.prev,w,w.next)>=0||(w=w.prevZ,M.x>=m&&M.x<=S&&M.y>=_&&M.y<=x&&M!==r&&M!==o&&Nh(a,d,l,f,c,p,M.x,M.y)&&Bn(M.prev,M,M.next)>=0))return!1;M=M.nextZ}for(;w&&w.z>=y;){if(w.x>=m&&w.x<=S&&w.y>=_&&w.y<=x&&w!==r&&w!==o&&Nh(a,d,l,f,c,p,w.x,w.y)&&Bn(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;M&&M.z<=E;){if(M.x>=m&&M.x<=S&&M.y>=_&&M.y<=x&&M!==r&&M!==o&&Nh(a,d,l,f,c,p,M.x,M.y)&&Bn(M.prev,M,M.next)>=0)return!1;M=M.nextZ}return!0}function Rte(n,e,t){let i=n;do{const r=i.prev,s=i.next.next;!Mx(r,s)&&EV(r,i,i.next,s)&&dm(r,s)&&dm(s,r)&&(e.push(r.i/t|0),e.push(i.i/t|0),e.push(s.i/t|0),fm(i),fm(i.next),i=n=s),i=i.next}while(i!==n);return hu(i)}function Ite(n,e,t,i,r,s){let o=n;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&Bte(o,a)){let l=TV(o,a);o=hu(o,o.next),l=hu(l,l.next),hm(o,e,t,i,r,s,0),hm(l,e,t,i,r,s,0);return}a=a.next}o=o.next}while(o!==n)}function Lte(n,e,t,i){const r=[];let s,o,a,l,c;for(s=0,o=e.length;s=t.next.y&&t.next.y!==t.y){const p=t.x+(o-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(p<=s&&p>i&&(i=p,r=t.x=t.x&&t.x>=l&&s!==t.x&&Nh(or.x||t.x===r.x&&Ote(r,t)))&&(r=t,d=f)),t=t.next;while(t!==a);return r}function Ote(n,e){return Bn(n.prev,n,e.prev)<0&&Bn(e.next,n,n.next)<0}function Ute(n,e,t,i){let r=n;do r.z===0&&(r.z=ST(r.x,r.y,e,t,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==n);r.prevZ.nextZ=null,r.prevZ=null,Fte(r)}function Fte(n){let e,t,i,r,s,o,a,l,c=1;do{for(t=n,n=null,s=null,o=0;t;){for(o++,i=t,a=0,e=0;e0||l>0&&i;)a!==0&&(l===0||!i||t.z<=i.z)?(r=t,t=t.nextZ,a--):(r=i,i=i.nextZ,l--),s?s.nextZ=r:n=r,r.prevZ=s,s=r;t=i}s.nextZ=null,c*=2}while(o>1);return n}function ST(n,e,t,i,r){return n=(n-t)*r|0,e=(e-i)*r|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function Vte(n){let e=n,t=n;do(e.x=(n-o)*(s-a)&&(n-o)*(i-a)>=(t-o)*(e-a)&&(t-o)*(s-a)>=(r-o)*(i-a)}function Bte(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!zte(n,e)&&(dm(n,e)&&dm(e,n)&&Hte(n,e)&&(Bn(n.prev,n,e.prev)||Bn(n,e.prev,e))||Mx(n,e)&&Bn(n.prev,n,n.next)>0&&Bn(e.prev,e,e.next)>0)}function Bn(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function Mx(n,e){return n.x===e.x&&n.y===e.y}function EV(n,e,t,i){const r=Qy(Bn(n,e,t)),s=Qy(Bn(n,e,i)),o=Qy(Bn(t,i,n)),a=Qy(Bn(t,i,e));return!!(r!==s&&o!==a||r===0&&Ky(n,t,e)||s===0&&Ky(n,i,e)||o===0&&Ky(t,n,i)||a===0&&Ky(t,e,i))}function Ky(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function Qy(n){return n>0?1:n<0?-1:0}function zte(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&EV(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function dm(n,e){return Bn(n.prev,n,n.next)<0?Bn(n,e,n.next)>=0&&Bn(n,n.prev,e)>=0:Bn(n,e,n.prev)<0||Bn(n,n.next,e)<0}function Hte(n,e){let t=n,i=!1;const r=(n.x+e.x)/2,s=(n.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&r<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==n);return i}function TV(n,e){const t=new wT(n.i,n.x,n.y),i=new wT(e.i,e.x,e.y),r=n.next,s=e.prev;return n.next=e,e.prev=n,t.next=r,r.prev=t,i.next=t,t.prev=i,s.next=i,i.prev=s,i}function PL(n,e,t,i){const r=new wT(n,e,t);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function fm(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function wT(n,e,t){this.i=n,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Gte(n,e,t,i){let r=0;for(let s=e,o=t-i;s2&&n[e-1].equals(n[0])&&n.pop()}function IL(n,e){for(let t=0;tNumber.EPSILON){const Te=Math.sqrt(ae),Se=Math.sqrt(X*X+F*F),nt=j.x-We/Te,Ce=j.y+lt/Te,Ge=Ve.x-F/Se,Lt=Ve.y+X/Se,Le=((Ge-nt)*F-(Lt-Ce)*X)/(lt*F-We*X);Oe=nt+lt*Le-xe.x,Pe=Ce+We*Le-xe.y;const Ze=Oe*Oe+Pe*Pe;if(Ze<=2)return new Ee(Oe,Pe);Ue=Math.sqrt(Ze/2)}else{let Te=!1;lt>Number.EPSILON?X>Number.EPSILON&&(Te=!0):lt<-Number.EPSILON?X<-Number.EPSILON&&(Te=!0):Math.sign(We)===Math.sign(F)&&(Te=!0),Te?(Oe=-We,Pe=lt,Ue=Math.sqrt(ae)):(Oe=lt,Pe=We,Ue=Math.sqrt(ae/2))}return new Ee(Oe/Ue,Pe/Ue)}const J=[];for(let xe=0,j=se.length,Ve=j-1,Oe=xe+1;xe=0;xe--){const j=xe/x,Ve=m*Math.cos(j*Math.PI/2),Oe=_*Math.sin(j*Math.PI/2)+S;for(let Pe=0,Ue=se.length;Pe=0;){const Oe=Ve;let Pe=Ve-1;Pe<0&&(Pe=xe.length-1);for(let Ue=0,lt=d+x*2;Ue0)&&m.push(w,M,k),(y!==i-1||l0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class PV extends Oi{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new rt(16777215),this.specular=new rt(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new rt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Fl,this.normalScale=new Ee(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new _r,this.combine=Vm,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class RV extends Oi{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new rt(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new rt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Fl,this.normalScale=new Ee(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class IV extends Oi{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Fl,this.normalScale=new Ee(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class LV extends Oi{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new rt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new rt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Fl,this.normalScale=new Ee(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new _r,this.combine=Vm,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class NV extends Oi{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new rt(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Fl,this.normalScale=new Ee(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}}class DV extends wr{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function Bc(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function kV(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function OV(n){function e(r,s){return n[r]-n[s]}const t=n.length,i=new Array(t);for(let r=0;r!==t;++r)i[r]=r;return i.sort(e),i}function ET(n,e,t){const i=n.length,r=new n.constructor(i);for(let s=0,o=0;o!==i;++s){const a=t[s]*e;for(let l=0;l!==e;++l)r[o++]=n[a+l]}return r}function fC(n,e,t,i){let r=1,s=n[0];for(;s!==void 0&&s[i]===void 0;)s=n[r++];if(s===void 0)return;let o=s[i];if(o!==void 0)if(Array.isArray(o))do o=s[i],o!==void 0&&(e.push(s.time),t.push.apply(t,o)),s=n[r++];while(s!==void 0);else if(o.toArray!==void 0)do o=s[i],o!==void 0&&(e.push(s.time),o.toArray(t,t.length)),s=n[r++];while(s!==void 0);else do o=s[i],o!==void 0&&(e.push(s.time),t.push(o)),s=n[r++];while(s!==void 0)}function qte(n,e,t,i,r=30){const s=n.clone();s.name=e;const o=[];for(let l=0;l=i)){f.push(c.times[m]);for(let S=0;Ss.tracks[l].times[0]&&(a=s.tracks[l].times[0]);for(let l=0;l=a.times[_]){const y=_*f+d,E=y+f-d;S=a.values.slice(y,E)}else{const y=a.createInterpolant(),E=d,w=f-d;y.evaluate(s),S=y.resultBuffer.slice(E,w)}l==="quaternion"&&new nr().fromArray(S).normalize().conjugate().toArray(S);const x=c.times.length;for(let y=0;y=s)){const a=t[1];e=s)break t}o=i,i=0;break n}break e}for(;i>>1;et;)--o;if(++o,s!==0||o!==r){s>=o&&(o=Math.max(o,1),s=o-1);const a=this.getValueSize();this.times=i.slice(s,o),this.values=this.values.slice(s*a,o*a)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const i=this.times,r=this.values,s=i.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==s;a++){const l=i[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(r!==void 0&&kV(r))for(let a=0,l=r.length;a!==l;++a){const c=r[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),i=this.getValueSize(),r=this.getInterpolation()===Cv,s=e.length-1;let o=1;for(let a=1;a0){e[o]=e[s];for(let a=s*i,l=o*i,c=0;c!==i;++c)t[l+c]=t[a+c];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*i)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),i=this.constructor,r=new i(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}Qs.prototype.TimeBufferType=Float32Array;Qs.prototype.ValueBufferType=Float32Array;Qs.prototype.DefaultInterpolation=o_;class _u extends Qs{constructor(e,t,i){super(e,t,i)}}_u.prototype.ValueTypeName="bool";_u.prototype.ValueBufferType=Array;_u.prototype.DefaultInterpolation=nm;_u.prototype.InterpolantFactoryMethodLinear=void 0;_u.prototype.InterpolantFactoryMethodSmooth=void 0;class mC extends Qs{}mC.prototype.ValueTypeName="color";class pm extends Qs{}pm.prototype.ValueTypeName="number";class VV extends $m{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(i-t)/(r-t);let c=e*a;for(let d=c+a;c!==d;c+=4)nr.slerpFlat(s,0,o,c-a,o,c,l);return s}}class Ym extends Qs{InterpolantFactoryMethodLinear(e){return new VV(this.times,this.values,this.getValueSize(),e)}}Ym.prototype.ValueTypeName="quaternion";Ym.prototype.InterpolantFactoryMethodSmooth=void 0;class xu extends Qs{constructor(e,t,i){super(e,t,i)}}xu.prototype.ValueTypeName="string";xu.prototype.ValueBufferType=Array;xu.prototype.DefaultInterpolation=nm;xu.prototype.InterpolantFactoryMethodLinear=void 0;xu.prototype.InterpolantFactoryMethodSmooth=void 0;class mm extends Qs{}mm.prototype.ValueTypeName="vector";class gm{constructor(e="",t=-1,i=[],r=dx){this.name=e,this.tracks=i,this.duration=t,this.blendMode=r,this.uuid=Zr(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],i=e.tracks,r=1/(e.fps||1);for(let o=0,a=i.length;o!==a;++o)t.push(Qte(i[o]).scale(r));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){const t=[],i=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=i.length;s!==o;++s)t.push(Qs.toJSON(i[s]));return r}static CreateFromMorphTargetSequence(e,t,i,r){const s=t.length,o=[];for(let a=0;a1){const f=d[1];let p=r[f];p||(r[f]=p=[]),p.push(c)}}const o=[];for(const a in r)o.push(this.CreateFromMorphTargetSequence(a,r[a],t,i));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(f,p,m,_,S){if(m.length!==0){const x=[],y=[];fC(m,x,y,_),x.length!==0&&S.push(new f(p,x,y))}},r=[],s=e.name||"default",o=e.fps||30,a=e.blendMode;let l=e.length||-1;const c=e.hierarchy||[];for(let f=0;f{t&&t(s),this.manager.itemEnd(e)},0),s;if(zo[e]!==void 0){zo[e].push({onLoad:t,onProgress:i,onError:r});return}zo[e]=[],zo[e].push({onLoad:t,onProgress:i,onError:r});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=this.responseType;fetch(o).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const d=zo[e],f=c.body.getReader(),p=c.headers.get("X-File-Size")||c.headers.get("Content-Length"),m=p?parseInt(p):0,_=m!==0;let S=0;const x=new ReadableStream({start(y){E();function E(){f.read().then(({done:w,value:M})=>{if(w)y.close();else{S+=M.byteLength;const O=new ProgressEvent("progress",{lengthComputable:_,loaded:S,total:m});for(let k=0,I=d.length;k{y.error(w)})}}});return new Response(x)}else throw new Jte(`fetch for "${c.url}" responded with ${c.status}: ${c.statusText}`,c)}).then(c=>{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(d=>new DOMParser().parseFromString(d,a));case"json":return c.json();default:if(a===void 0)return c.text();{const f=/charset="?([^;"\s]*)"?/i.exec(a),p=f&&f[1]?f[1].toLowerCase():void 0,m=new TextDecoder(p);return c.arrayBuffer().then(_=>m.decode(_))}}}).then(c=>{Qo.add(e,c);const d=zo[e];delete zo[e];for(let f=0,p=d.length;f{const d=zo[e];if(d===void 0)throw this.manager.itemError(e),c;delete zo[e];for(let f=0,p=d.length;f{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class Zte extends zr{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new ma(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{t(s.parse(JSON.parse(a)))}catch(l){r?r(l):console.error(l),s.manager.itemError(e)}},i,r)}parse(e){const t=[];for(let i=0;i0:r.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const s in e.uniforms){const o=e.uniforms[s];switch(r.uniforms[s]={},o.type){case"t":r.uniforms[s].value=i(o.value);break;case"c":r.uniforms[s].value=new rt().setHex(o.value);break;case"v2":r.uniforms[s].value=new Ee().fromArray(o.value);break;case"v3":r.uniforms[s].value=new G().fromArray(o.value);break;case"v4":r.uniforms[s].value=new sn().fromArray(o.value);break;case"m3":r.uniforms[s].value=new Ut().fromArray(o.value);break;case"m4":r.uniforms[s].value=new St().fromArray(o.value);break;default:r.uniforms[s].value=o.value}}if(e.defines!==void 0&&(r.defines=e.defines),e.vertexShader!==void 0&&(r.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(r.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(r.glslVersion=e.glslVersion),e.extensions!==void 0)for(const s in e.extensions)r.extensions[s]=e.extensions[s];if(e.lights!==void 0&&(r.lights=e.lights),e.clipping!==void 0&&(r.clipping=e.clipping),e.size!==void 0&&(r.size=e.size),e.sizeAttenuation!==void 0&&(r.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(r.map=i(e.map)),e.matcap!==void 0&&(r.matcap=i(e.matcap)),e.alphaMap!==void 0&&(r.alphaMap=i(e.alphaMap)),e.bumpMap!==void 0&&(r.bumpMap=i(e.bumpMap)),e.bumpScale!==void 0&&(r.bumpScale=e.bumpScale),e.normalMap!==void 0&&(r.normalMap=i(e.normalMap)),e.normalMapType!==void 0&&(r.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),r.normalScale=new Ee().fromArray(s)}return e.displacementMap!==void 0&&(r.displacementMap=i(e.displacementMap)),e.displacementScale!==void 0&&(r.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(r.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(r.roughnessMap=i(e.roughnessMap)),e.metalnessMap!==void 0&&(r.metalnessMap=i(e.metalnessMap)),e.emissiveMap!==void 0&&(r.emissiveMap=i(e.emissiveMap)),e.emissiveIntensity!==void 0&&(r.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(r.specularMap=i(e.specularMap)),e.specularIntensityMap!==void 0&&(r.specularIntensityMap=i(e.specularIntensityMap)),e.specularColorMap!==void 0&&(r.specularColorMap=i(e.specularColorMap)),e.envMap!==void 0&&(r.envMap=i(e.envMap)),e.envMapRotation!==void 0&&r.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(r.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(r.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(r.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(r.lightMap=i(e.lightMap)),e.lightMapIntensity!==void 0&&(r.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(r.aoMap=i(e.aoMap)),e.aoMapIntensity!==void 0&&(r.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(r.gradientMap=i(e.gradientMap)),e.clearcoatMap!==void 0&&(r.clearcoatMap=i(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(r.clearcoatRoughnessMap=i(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(r.clearcoatNormalMap=i(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(r.clearcoatNormalScale=new Ee().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(r.iridescenceMap=i(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(r.iridescenceThicknessMap=i(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(r.transmissionMap=i(e.transmissionMap)),e.thicknessMap!==void 0&&(r.thicknessMap=i(e.thicknessMap)),e.anisotropyMap!==void 0&&(r.anisotropyMap=i(e.anisotropyMap)),e.sheenColorMap!==void 0&&(r.sheenColorMap=i(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(r.sheenRoughnessMap=i(e.sheenRoughnessMap)),r}setTextures(e){return this.textures=e,this}createMaterialFromType(e){return Ox.createMaterialFromType(e)}static createMaterialFromType(e){const t={ShadowMaterial:MV,SpriteMaterial:iC,RawShaderMaterial:CV,ShaderMaterial:qs,PointsMaterial:sC,MeshPhysicalMaterial:bV,MeshStandardMaterial:dC,MeshPhongMaterial:PV,MeshToonMaterial:RV,MeshNormalMaterial:IV,MeshLambertMaterial:LV,MeshDepthMaterial:tC,MeshDistanceMaterial:nC,MeshBasicMaterial:Vl,MeshMatcapMaterial:NV,LineDashedMaterial:DV,LineBasicMaterial:wr,Material:Oi};return new t[e]}}class TT{static decodeText(e){if(console.warn("THREE.LoaderUtils: decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead."),typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let i=0,r=e.length;i0){const l=new gC(t);s=new ym(l),s.setCrossOrigin(this.crossOrigin);for(let c=0,d=e.length;c0){r=new ym(this.manager),r.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;o{const x=new vr;x.min.fromArray(S.boxMin),x.max.fromArray(S.boxMax);const y=new ir;return y.radius=S.sphereRadius,y.center.fromArray(S.sphereCenter),{boxInitialized:S.boxInitialized,box:x,sphereInitialized:S.sphereInitialized,sphere:y}}),o._maxInstanceCount=e.maxInstanceCount,o._maxVertexCount=e.maxVertexCount,o._maxIndexCount=e.maxIndexCount,o._geometryInitialized=e.geometryInitialized,o._geometryCount=e.geometryCount,o._matricesTexture=c(e.matricesTexture.uuid),e.colorsTexture!==void 0&&(o._colorsTexture=c(e.colorsTexture.uuid));break;case"LOD":o=new uV;break;case"Line":o=new Il(a(e.geometry),l(e.material));break;case"LineLoop":o=new pV(a(e.geometry),l(e.material));break;case"LineSegments":o=new Ao(a(e.geometry),l(e.material));break;case"PointCloud":case"Points":o=new mV(a(e.geometry),l(e.material));break;case"Sprite":o=new cV(l(e.material));break;case"Group":o=new Lh;break;case"Bone":o=new rC;break;default:o=new Zt}if(o.uuid=e.uuid,e.name!==void 0&&(o.name=e.name),e.matrix!==void 0?(o.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(o.matrixAutoUpdate=e.matrixAutoUpdate),o.matrixAutoUpdate&&o.matrix.decompose(o.position,o.quaternion,o.scale)):(e.position!==void 0&&o.position.fromArray(e.position),e.rotation!==void 0&&o.rotation.fromArray(e.rotation),e.quaternion!==void 0&&o.quaternion.fromArray(e.quaternion),e.scale!==void 0&&o.scale.fromArray(e.scale)),e.up!==void 0&&o.up.fromArray(e.up),e.castShadow!==void 0&&(o.castShadow=e.castShadow),e.receiveShadow!==void 0&&(o.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.intensity!==void 0&&(o.shadow.intensity=e.shadow.intensity),e.shadow.bias!==void 0&&(o.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(o.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(o.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&o.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(o.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(o.visible=e.visible),e.frustumCulled!==void 0&&(o.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(o.renderOrder=e.renderOrder),e.userData!==void 0&&(o.userData=e.userData),e.layers!==void 0&&(o.layers.mask=e.layers),e.children!==void 0){const p=e.children;for(let m=0;m"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,i,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=Qo.get(e);if(o!==void 0){if(s.manager.itemStart(e),o.then){o.then(c=>{t&&t(c),s.manager.itemEnd(e)}).catch(c=>{r&&r(c)});return}return setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o}const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader;const l=fetch(e,a).then(function(c){return c.blob()}).then(function(c){return createImageBitmap(c,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(c){return Qo.add(e,c),t&&t(c),s.manager.itemEnd(e),c}).catch(function(c){r&&r(c),Qo.remove(e),s.manager.itemError(e),s.manager.itemEnd(e)});Qo.add(e,l),s.manager.itemStart(e)}}let Jy;class vC{static getContext(){return Jy===void 0&&(Jy=new(window.AudioContext||window.webkitAudioContext)),Jy}static setContext(e){Jy=e}}class cne extends zr{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new ma(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){try{const c=l.slice(0);vC.getContext().decodeAudioData(c,function(f){t(f)}).catch(a)}catch(c){a(c)}},i,r);function a(l){r?r(l):console.error(l),s.manager.itemError(e)}}}const VL=new St,BL=new St,gc=new St;class une{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Dn,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Dn,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,gc.copy(e.projectionMatrix);const r=t.eyeSep/2,s=r*t.near/t.focus,o=t.near*Math.tan(Yc*t.fov*.5)/t.zoom;let a,l;BL.elements[12]=-r,VL.elements[12]=r,a=-o*t.aspect+s,l=o*t.aspect+s,gc.elements[0]=2*t.near/(l-a),gc.elements[8]=(l+a)/(l-a),this.cameraL.projectionMatrix.copy(gc),a=-o*t.aspect-s,l=o*t.aspect-s,gc.elements[0]=2*t.near/(l-a),gc.elements[8]=(l+a)/(l-a),this.cameraR.projectionMatrix.copy(gc)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(BL),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(VL)}}class _C{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=zL(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=zL();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function zL(){return performance.now()}const yc=new G,HL=new nr,hne=new G,vc=new G;class dne extends Zt{constructor(){super(),this.type="AudioListener",this.context=vC.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new _C}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,i=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(yc,HL,hne),vc.set(0,0,-1).applyQuaternion(HL),t.positionX){const r=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(yc.x,r),t.positionY.linearRampToValueAtTime(yc.y,r),t.positionZ.linearRampToValueAtTime(yc.z,r),t.forwardX.linearRampToValueAtTime(vc.x,r),t.forwardY.linearRampToValueAtTime(vc.y,r),t.forwardZ.linearRampToValueAtTime(vc.z,r),t.upX.linearRampToValueAtTime(i.x,r),t.upY.linearRampToValueAtTime(i.y,r),t.upZ.linearRampToValueAtTime(i.z,r)}else t.setPosition(yc.x,yc.y,yc.z),t.setOrientation(vc.x,vc.y,vc.z,i.x,i.y,i.z)}}class KV extends Zt{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(e=0){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(this.context.currentTime+e),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(i,r,this._addIndex*t,1,t);for(let l=t,c=t+t;l!==c;++l)if(i[l]!==i[l+t]){a.setValue(i,r);break}}saveOriginalState(){const e=this.binding,t=this.buffer,i=this.valueSize,r=i*this._origIndex;e.getValue(t,r);for(let s=i,o=r;s!==o;++s)t[s]=t[r+s%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let i=e;i=.5)for(let o=0;o!==s;++o)e[t+o]=e[i+o]}_slerp(e,t,i,r){nr.slerpFlat(e,t,e,t,e,i,r)}_slerpAdditive(e,t,i,r,s){const o=this._workIndex*s;nr.multiplyQuaternionsFlat(e,o,e,t,e,i),nr.slerpFlat(e,t,e,t,e,o,r)}_lerp(e,t,i,r,s){const o=1-r;for(let a=0;a!==s;++a){const l=t+a;e[l]=e[l]*o+e[i+a]*r}}_lerpAdditive(e,t,i,r,s){for(let o=0;o!==s;++o){const a=t+o;e[a]=e[a]+e[i+o]*r}}}const xC="\\[\\]\\.:\\/",gne=new RegExp("["+xC+"]","g"),SC="[^"+xC+"]",yne="[^"+xC.replace("\\.","")+"]",vne=/((?:WC+[\/:])*)/.source.replace("WC",SC),_ne=/(WCOD+)?/.source.replace("WCOD",yne),xne=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",SC),Sne=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",SC),wne=new RegExp("^"+vne+_ne+xne+Sne+"$"),Ene=["material","materials","bones","map"];class Tne{constructor(e,t,i){const r=i||nn.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();const i=this._targetGroup.nCachedObjects_,r=this._bindings[i];r!==void 0&&r.getValue(e,t)}setValue(e,t){const i=this._bindings;for(let r=this._targetGroup.nCachedObjects_,s=i.length;r!==s;++r)i[r].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}}class nn{constructor(e,t,i){this.path=t,this.parsedPath=i||nn.parseTrackName(t),this.node=nn.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return e&&e.isAnimationObjectGroup?new nn.Composite(e,t,i):new nn(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(gne,"")}static parseTrackName(e){const t=wne.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=i.nodeName&&i.nodeName.lastIndexOf(".");if(r!==void 0&&r!==-1){const s=i.nodeName.substring(r+1);Ene.indexOf(s)!==-1&&(i.nodeName=i.nodeName.substring(0,r),i.objectName=s)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const i=e.skeleton.getBoneByName(t);if(i!==void 0)return i}if(e.children){const i=function(s){for(let o=0;o=s){const f=s++,p=e[f];t[p.uuid]=d,e[d]=p,t[c]=f,e[f]=l;for(let m=0,_=r;m!==_;++m){const S=i[m],x=S[f],y=S[d];S[d]=x,S[f]=y}}}this.nCachedObjects_=s}uncache(){const e=this._objects,t=this._indicesByUUID,i=this._bindings,r=i.length;let s=this.nCachedObjects_,o=e.length;for(let a=0,l=arguments.length;a!==l;++a){const c=arguments[a],d=c.uuid,f=t[d];if(f!==void 0)if(delete t[d],f0&&(t[m.uuid]=f),e[f]=m,e.pop();for(let _=0,S=r;_!==S;++_){const x=i[_];x[f]=x[p],x.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){const i=this._bindingsIndicesByPath;let r=i[e];const s=this._bindings;if(r!==void 0)return s[r];const o=this._paths,a=this._parsedPaths,l=this._objects,c=l.length,d=this.nCachedObjects_,f=new Array(c);r=s.length,i[e]=r,o.push(e),a.push(t),s.push(f);for(let p=d,m=l.length;p!==m;++p){const _=l[p];f[p]=new nn(_,e,t)}return f}unsubscribe_(e){const t=this._bindingsIndicesByPath,i=t[e];if(i!==void 0){const r=this._paths,s=this._parsedPaths,o=this._bindings,a=o.length-1,l=o[a],c=e[a];t[c]=i,o[i]=l,o.pop(),s[i]=s[a],s.pop(),r[i]=r[a],r.pop()}}}class JV{constructor(e,t,i=null,r=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=i,this.blendMode=r;const s=t.tracks,o=s.length,a=new Array(o),l={endingStart:Uc,endingEnd:Uc};for(let c=0;c!==o;++c){const d=s[c].createInterpolant(null);a[c]=d,d.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=DF,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,i){if(e.fadeOut(t),this.fadeIn(t),i){const r=this._clip.duration,s=e._clip.duration,o=s/r,a=r/s;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,i){return e.crossFadeFrom(this,t,i)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,i){const r=this._mixer,s=r.time,o=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);const l=a.parameterPositions,c=a.sampleValues;return l[0]=s,l[1]=s+i,c[0]=e/o,c[1]=t/o,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,i,r){if(!this.enabled){this._updateWeight(e);return}const s=this._startTime;if(s!==null){const l=(e-s)*i;l<0||i===0?t=0:(this._startTime=null,t=i*l)}t*=this._updateTimeScale(e);const o=this._updateTime(t),a=this._updateWeight(e);if(a>0){const l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case jM:for(let d=0,f=l.length;d!==f;++d)l[d].evaluate(o),c[d].accumulateAdditive(a);break;case dx:default:for(let d=0,f=l.length;d!==f;++d)l[d].evaluate(o),c[d].accumulate(r,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const i=this._weightInterpolant;if(i!==null){const r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopFading(),r===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const i=this._timeScaleInterpolant;if(i!==null){const r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,i=this.loop;let r=this.time+e,s=this._loopCount;const o=i===kF;if(e===0)return s===-1?r:o&&(s&1)===1?t-r:r;if(i===NF){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=t)r=t;else if(r<0)r=0;else{this.time=r;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),r>=t||r<0){const a=Math.floor(r/t);r-=t*a,s+=Math.abs(a);const l=this.repetitions-s;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){const c=e<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=r;if(o&&(s&1)===1)return t-r}return r}_setEndings(e,t,i){const r=this._interpolantSettings;i?(r.endingStart=Fc,r.endingEnd=Fc):(e?r.endingStart=this.zeroSlopeAtStart?Fc:Uc:r.endingStart=im,t?r.endingEnd=this.zeroSlopeAtEnd?Fc:Uc:r.endingEnd=im)}_scheduleFading(e,t,i){const r=this._mixer,s=r.time;let o=this._weightInterpolant;o===null&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);const a=o.parameterPositions,l=o.sampleValues;return a[0]=s,l[0]=t,a[1]=s+e,l[1]=i,this}}const Mne=new Float32Array(1);class Cne extends Ys{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const i=e._localRoot||this._root,r=e._clip.tracks,s=r.length,o=e._propertyBindings,a=e._interpolants,l=i.uuid,c=this._bindingsByRootAndName;let d=c[l];d===void 0&&(d={},c[l]=d);for(let f=0;f!==s;++f){const p=r[f],m=p.name;let _=d[m];if(_!==void 0)++_.referenceCount,o[f]=_;else{if(_=o[f],_!==void 0){_._cacheIndex===null&&(++_.referenceCount,this._addInactiveBinding(_,l,m));continue}const S=t&&t._propertyBindings[f].binding.parsedPath;_=new QV(nn.create(i,m,S),p.ValueTypeName,p.getValueSize()),++_.referenceCount,this._addInactiveBinding(_,l,m),o[f]=_}a[f].resultBuffer=_.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const i=(e._localRoot||this._root).uuid,r=e._clip.uuid,s=this._actionsByClip[r];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,r,i)}const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];--s.useCount===0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t=0;--i)e[i].stop();return this}update(e){e*=this.timeScale;const t=this._actions,i=this._nActiveActions,r=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let c=0;c!==i;++c)t[c]._update(r,e,s,o);const a=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)a[c].apply(o);return this}setTime(e){this.time=0;for(let t=0;t=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,XL).distanceTo(e)}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const qL=new G,Zy=new G;class Dne{constructor(e=new G,t=new G){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){qL.subVectors(e,this.start),Zy.subVectors(this.end,this.start);const i=Zy.dot(Zy);let s=Zy.dot(qL)/i;return t&&(s=$n(s,0,1)),s}closestPointToPoint(e,t,i){const r=this.closestPointToPointParameter(e,t);return this.delta(i).multiplyScalar(r).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const $L=new G;class kne extends Zt{constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const i=new Vt,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,a=1,l=32;o1)for(let f=0;f.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{ZL.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(ZL,t)}}setLength(e,t=e*.2,i=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(i,t,i),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class $ne extends Ao{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],i=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],r=new Vt;r.setAttribute("position",new ht(t,3)),r.setAttribute("color",new ht(i,3));const s=new wr({vertexColors:!0,toneMapped:!1});super(r,s),this.type="AxesHelper"}setColors(e,t,i){const r=new rt,s=this.geometry.attributes.color.array;return r.set(e),r.toArray(s,0),r.toArray(s,3),r.set(t),r.toArray(s,6),r.toArray(s,9),r.set(i),r.toArray(s,12),r.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class Yne{constructor(){this.type="ShapePath",this.color=new rt,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new um,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,i,r){return this.currentPath.quadraticCurveTo(e,t,i,r),this}bezierCurveTo(e,t,i,r,s,o){return this.currentPath.bezierCurveTo(e,t,i,r,s,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(y){const E=[];for(let w=0,M=y.length;wNumber.EPSILON){if(A<0&&(I=E[k],D=-D,P=E[O],A=-A),y.yP.y)continue;if(y.y===I.y){if(y.x===I.x)return!0}else{const R=A*(y.x-I.x)-D*(y.y-I.y);if(R===0)return!0;if(R<0)continue;M=!M}}else{if(y.y!==I.y)continue;if(P.x<=y.x&&y.x<=I.x||I.x<=y.x&&y.x<=P.x)return!0}}return M}const r=xo.isClockWise,s=this.subPaths;if(s.length===0)return[];let o,a,l;const c=[];if(s.length===1)return a=s[0],l=new Qc,l.curves=a.curves,c.push(l),c;let d=!r(s[0].getPoints());d=e?!d:d;const f=[],p=[];let m=[],_=0,S;p[_]=void 0,m[_]=[];for(let y=0,E=s.length;y1){let y=!1,E=0;for(let w=0,M=p.length;w0&&y===!1&&(m=f)}let x;for(let y=0,E=p.length;y{const f=typeof c=="function"?c(e):c;if(f!==e){const p=e;e=d?f:Object.assign({},e,f),t.forEach(m=>m(e,p))}},r=()=>e,s=(c,d=r,f=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let p=d(e);function m(){const _=d(e);if(!f(p,_)){const S=p;c(p=_,S)}}return t.add(m),()=>t.delete(m)},l={setState:i,getState:r,subscribe:(c,d,f)=>d||f?s(c,d,f):(t.add(c),()=>t.delete(c)),destroy:()=>t.clear()};return e=n(i,r,l),l}const eie=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),eN=eie?q.useEffect:q.useLayoutEffect;function t4(n){const e=typeof n=="function"?Zne(n):n,t=(i=e.getState,r=Object.is)=>{const[,s]=q.useReducer(x=>x+1,0),o=e.getState(),a=q.useRef(o),l=q.useRef(i),c=q.useRef(r),d=q.useRef(!1),f=q.useRef();f.current===void 0&&(f.current=i(o));let p,m=!1;(a.current!==o||l.current!==i||c.current!==r||d.current)&&(p=i(o),m=!r(f.current,p)),eN(()=>{m&&(f.current=p),a.current=o,l.current=i,c.current=r,d.current=!1});const _=q.useRef(o);eN(()=>{const x=()=>{try{const E=e.getState(),w=l.current(E);c.current(f.current,w)||(a.current=E,f.current=w,s())}catch{d.current=!0,s()}},y=e.subscribe(x);return e.getState()!==_.current&&x(),y},[]);const S=m?p:f.current;return q.useDebugValue(S),S};return Object.assign(t,e),t[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const i=[t,e];return{next(){const r=i.length<=0;return{value:i.shift(),done:r}}}},t}const tie=n=>typeof n=="object"&&typeof n.then=="function",zc=[];function n4(n,e,t=(i,r)=>i===r){if(n===e)return!0;if(!n||!e)return!1;const i=n.length;if(e.length!==i)return!1;for(let r=0;r0&&(s.timeout&&clearTimeout(s.timeout),s.timeout=setTimeout(s.remove,i.lifespan)),s.response;if(!t)throw s.promise}const r={keys:e,equal:i.equal,remove:()=>{const s=zc.indexOf(r);s!==-1&&zc.splice(s,1)},promise:(tie(n)?n:n(...e)).then(s=>{r.response=s,i.lifespan&&i.lifespan>0&&(r.timeout=setTimeout(r.remove,i.lifespan))}).catch(s=>r.error=s)};if(zc.push(r),!t)throw r.promise}const nie=(n,e,t)=>i4(n,e,!1,t),iie=(n,e,t)=>void i4(n,e,!0,t),rie=n=>{if(n===void 0||n.length===0)zc.splice(0,zc.length);else{const e=zc.find(t=>n4(n,t.keys,t.equal));e&&e.remove()}};var r4={exports:{}},s4={exports:{}},o4={};/** + */Su.ConcurrentRoot=1;Su.ContinuousEventPriority=4;Su.DefaultEventPriority=16;Su.DiscreteEventPriority=1;Su.IdleEventPriority=536870912;Su.LegacyRoot=0;t4.exports=Su;var kh=t4.exports;function Zne(n){let e;const t=new Set,i=(c,d)=>{const f=typeof c=="function"?c(e):c;if(f!==e){const p=e;e=d?f:Object.assign({},e,f),t.forEach(m=>m(e,p))}},r=()=>e,s=(c,d=r,f=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let p=d(e);function m(){const _=d(e);if(!f(p,_)){const S=p;c(p=_,S)}}return t.add(m),()=>t.delete(m)},l={setState:i,getState:r,subscribe:(c,d,f)=>d||f?s(c,d,f):(t.add(c),()=>t.delete(c)),destroy:()=>t.clear()};return e=n(i,r,l),l}const eie=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),eN=eie?q.useEffect:q.useLayoutEffect;function n4(n){const e=typeof n=="function"?Zne(n):n,t=(i=e.getState,r=Object.is)=>{const[,s]=q.useReducer(x=>x+1,0),o=e.getState(),a=q.useRef(o),l=q.useRef(i),c=q.useRef(r),d=q.useRef(!1),f=q.useRef();f.current===void 0&&(f.current=i(o));let p,m=!1;(a.current!==o||l.current!==i||c.current!==r||d.current)&&(p=i(o),m=!r(f.current,p)),eN(()=>{m&&(f.current=p),a.current=o,l.current=i,c.current=r,d.current=!1});const _=q.useRef(o);eN(()=>{const x=()=>{try{const E=e.getState(),w=l.current(E);c.current(f.current,w)||(a.current=E,f.current=w,s())}catch{d.current=!0,s()}},y=e.subscribe(x);return e.getState()!==_.current&&x(),y},[]);const S=m?p:f.current;return q.useDebugValue(S),S};return Object.assign(t,e),t[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const i=[t,e];return{next(){const r=i.length<=0;return{value:i.shift(),done:r}}}},t}const tie=n=>typeof n=="object"&&typeof n.then=="function",zc=[];function i4(n,e,t=(i,r)=>i===r){if(n===e)return!0;if(!n||!e)return!1;const i=n.length;if(e.length!==i)return!1;for(let r=0;r0&&(s.timeout&&clearTimeout(s.timeout),s.timeout=setTimeout(s.remove,i.lifespan)),s.response;if(!t)throw s.promise}const r={keys:e,equal:i.equal,remove:()=>{const s=zc.indexOf(r);s!==-1&&zc.splice(s,1)},promise:(tie(n)?n:n(...e)).then(s=>{r.response=s,i.lifespan&&i.lifespan>0&&(r.timeout=setTimeout(r.remove,i.lifespan))}).catch(s=>r.error=s)};if(zc.push(r),!t)throw r.promise}const nie=(n,e,t)=>r4(n,e,!1,t),iie=(n,e,t)=>void r4(n,e,!0,t),rie=n=>{if(n===void 0||n.length===0)zc.splice(0,zc.length);else{const e=zc.find(t=>i4(n,t.keys,t.equal));e&&e.remove()}};var s4={exports:{}},o4={exports:{}},a4={};/** * @license React * scheduler.production.min.js * @@ -5808,7 +5808,7 @@ void main() { * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(n){function e(W,J){var Z=W.length;W.push(J);e:for(;0>>1,Me=W[oe];if(0>>1;oer(we,Z))Ner(be,we)?(W[oe]=be,W[Ne]=Z,oe=Ne):(W[oe]=we,W[he]=Z,oe=he);else if(Ner(be,Z))W[oe]=be,W[Ne]=Z,oe=Ne;else break e}}return J}function r(W,J){var Z=W.sortIndex-J.sortIndex;return Z!==0?Z:W.id-J.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var l=[],c=[],d=1,f=null,p=3,m=!1,_=!1,S=!1,x=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(W){for(var J=t(c);J!==null;){if(J.callback===null)i(c);else if(J.startTime<=W)i(c),J.sortIndex=J.expirationTime,e(l,J);else break;J=t(c)}}function M(W){if(S=!1,w(W),!_)if(t(l)!==null)_=!0,ee(O);else{var J=t(c);J!==null&&pe(M,J.startTime-W)}}function O(W,J){_=!1,S&&(S=!1,y(P),P=-1),m=!0;var Z=p;try{for(w(J),f=t(l);f!==null&&(!(f.expirationTime>J)||W&&!R());){var oe=f.callback;if(typeof oe=="function"){f.callback=null,p=f.priorityLevel;var Me=oe(f.expirationTime<=J);J=n.unstable_now(),typeof Me=="function"?f.callback=Me:f===t(l)&&i(l),w(J)}else i(l);f=t(l)}if(f!==null)var Re=!0;else{var he=t(c);he!==null&&pe(M,he.startTime-J),Re=!1}return Re}finally{f=null,p=Z,m=!1}}var k=!1,I=null,P=-1,D=5,A=-1;function R(){return!(n.unstable_now()-AW||125oe?(W.sortIndex=Z,e(c,W),t(l)===null&&W===t(c)&&(S?(y(P),P=-1):S=!0,pe(M,Z-oe))):(W.sortIndex=Me,e(l,W),_||m||(_=!0,ee(O))),W},n.unstable_shouldYield=R,n.unstable_wrapCallback=function(W){var J=p;return function(){var Z=p;p=J;try{return W.apply(this,arguments)}finally{p=Z}}}})(o4);s4.exports=o4;var CT=s4.exports;/** + */(function(n){function e(W,J){var Z=W.length;W.push(J);e:for(;0>>1,Me=W[oe];if(0>>1;oer(we,Z))Ner(be,we)?(W[oe]=be,W[Ne]=Z,oe=Ne):(W[oe]=we,W[he]=Z,oe=he);else if(Ner(be,Z))W[oe]=be,W[Ne]=Z,oe=Ne;else break e}}return J}function r(W,J){var Z=W.sortIndex-J.sortIndex;return Z!==0?Z:W.id-J.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var l=[],c=[],d=1,f=null,p=3,m=!1,_=!1,S=!1,x=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(W){for(var J=t(c);J!==null;){if(J.callback===null)i(c);else if(J.startTime<=W)i(c),J.sortIndex=J.expirationTime,e(l,J);else break;J=t(c)}}function M(W){if(S=!1,w(W),!_)if(t(l)!==null)_=!0,ee(O);else{var J=t(c);J!==null&&pe(M,J.startTime-W)}}function O(W,J){_=!1,S&&(S=!1,y(P),P=-1),m=!0;var Z=p;try{for(w(J),f=t(l);f!==null&&(!(f.expirationTime>J)||W&&!R());){var oe=f.callback;if(typeof oe=="function"){f.callback=null,p=f.priorityLevel;var Me=oe(f.expirationTime<=J);J=n.unstable_now(),typeof Me=="function"?f.callback=Me:f===t(l)&&i(l),w(J)}else i(l);f=t(l)}if(f!==null)var Re=!0;else{var he=t(c);he!==null&&pe(M,he.startTime-J),Re=!1}return Re}finally{f=null,p=Z,m=!1}}var k=!1,I=null,P=-1,D=5,A=-1;function R(){return!(n.unstable_now()-AW||125oe?(W.sortIndex=Z,e(c,W),t(l)===null&&W===t(c)&&(S?(y(P),P=-1):S=!0,pe(M,Z-oe))):(W.sortIndex=Me,e(l,W),_||m||(_=!0,ee(O))),W},n.unstable_shouldYield=R,n.unstable_wrapCallback=function(W){var J=p;return function(){var Z=p;p=J;try{return W.apply(this,arguments)}finally{p=Z}}}})(a4);o4.exports=a4;var CT=o4.exports;/** * @license React * react-reconciler.production.min.js * @@ -5820,13 +5820,13 @@ void main() { `+st+u}var _t=!1;function xt(u,h){if(!u||_t)return"";_t=!0;var v=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(h)if(h=function(){throw Error()},Object.defineProperty(h.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(h,[])}catch(He){var T=He}Reflect.construct(u,[],h)}else{try{h.call()}catch(He){T=He}u.call(h.prototype)}else{try{throw Error()}catch(He){T=He}u()}}catch(He){if(He&&T&&typeof He.stack=="string"){for(var b=He.stack.split(` `),N=T.stack.split(` `),$=b.length-1,Q=N.length-1;1<=$&&0<=Q&&b[$]!==N[Q];)Q--;for(;1<=$&&0<=Q;$--,Q--)if(b[$]!==N[Q]){if($!==1||Q!==1)do if($--,Q--,0>Q||b[$]!==N[Q]){var ye=` -`+b[$].replace(" at new "," at ");return u.displayName&&ye.includes("")&&(ye=ye.replace("",u.displayName)),ye}while(1<=$&&0<=Q);break}}}finally{_t=!1,Error.prepareStackTrace=v}return(u=u?u.displayName||u.name:"")?it(u):""}var ut=Object.prototype.hasOwnProperty,zt=[],Yt=-1;function tn(u){return{current:u}}function Ot(u){0>Yt||(u.current=zt[Yt],zt[Yt]=null,Yt--)}function mt(u,h){Yt++,zt[Yt]=u.current,u.current=h}var ot={},qt=tn(ot),Mt=tn(!1),Gn=ot;function Ui(u,h){var v=u.type.contextTypes;if(!v)return ot;var T=u.stateNode;if(T&&T.__reactInternalMemoizedUnmaskedChildContext===h)return T.__reactInternalMemoizedMaskedChildContext;var b={},N;for(N in v)b[N]=h[N];return T&&(u=u.stateNode,u.__reactInternalMemoizedUnmaskedChildContext=h,u.__reactInternalMemoizedMaskedChildContext=b),b}function dn(u){return u=u.childContextTypes,u!=null}function Js(){Ot(Mt),Ot(qt)}function _n(u,h,v){if(qt.current!==ot)throw Error(o(168));mt(qt,h),mt(Mt,v)}function Er(u,h,v){var T=u.stateNode;if(h=h.childContextTypes,typeof T.getChildContext!="function")return v;T=T.getChildContext();for(var b in T)if(!(b in h))throw Error(o(108,P(u)||"Unknown",b));return s({},v,T)}function Zs(u){return u=(u=u.stateNode)&&u.__reactInternalMemoizedMergedChildContext||ot,Gn=qt.current,mt(qt,u),mt(Mt,Mt.current),!0}function On(u,h,v){var T=u.stateNode;if(!T)throw Error(o(169));v?(u=Er(u,h,Gn),T.__reactInternalMemoizedMergedChildContext=u,Ot(Mt),Ot(qt),mt(qt,u)):Ot(Mt),mt(Mt,v)}var bn=Math.clz32?Math.clz32:ng,Ea=Math.log,Co=Math.LN2;function ng(u){return u>>>=0,u===0?32:31-(Ea(u)/Co|0)|0}var fn=64,bo=4194304;function bs(u){switch(u&-u){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return u&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return u&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return u}}function eo(u,h){var v=u.pendingLanes;if(v===0)return 0;var T=0,b=u.suspendedLanes,N=u.pingedLanes,$=v&268435455;if($!==0){var Q=$&~b;Q!==0?T=bs(Q):(N&=$,N!==0&&(T=bs(N)))}else $=v&~b,$!==0?T=bs($):N!==0&&(T=bs(N));if(T===0)return 0;if(h!==0&&h!==T&&!(h&b)&&(b=T&-T,N=h&-h,b>=N||b===16&&(N&4194240)!==0))return h;if(T&4&&(T|=v&16),h=u.entangledLanes,h!==0)for(u=u.entanglements,h&=T;0v;v++)h.push(u);return h}function jl(u,h,v){u.pendingLanes|=h,h!==536870912&&(u.suspendedLanes=0,u.pingedLanes=0),u=u.eventTimes,h=31-bn(h),u[h]=v}function Hx(u,h){var v=u.pendingLanes&~h;u.pendingLanes=h,u.suspendedLanes=0,u.pingedLanes=0,u.expiredLanes&=h,u.mutableReadLanes&=h,u.entangledLanes&=h,h=u.entanglements;var T=u.eventTimes;for(u=u.expirationTimes;0>=$,b-=$,ne=1<<32-bn(h)+b|v<an?(Si=Dt,Dt=null):Si=Dt.sibling;var ln=wt(ue,Dt,ge[an],tt);if(ln===null){Dt===null&&(Dt=Si);break}u&&Dt&&ln.alternate===null&&h(ue,Dt),re=N(ln,re,an),jt===null?gt=ln:jt.sibling=ln,jt=ln,Dt=Si}if(an===ge.length)return v(ue,Dt),un&&ze(ue,an),gt;if(Dt===null){for(;anan?(Si=Dt,Dt=null):Si=Dt.sibling;var Na=wt(ue,Dt,ln.value,tt);if(Na===null){Dt===null&&(Dt=Si);break}u&&Dt&&Na.alternate===null&&h(ue,Dt),re=N(Na,re,an),jt===null?gt=Na:jt.sibling=Na,jt=Na,Dt=Si}if(ln.done)return v(ue,Dt),un&&ze(ue,an),gt;if(Dt===null){for(;!ln.done;an++,ln=ge.next())ln=Nt(ue,ln.value,tt),ln!==null&&(re=N(ln,re,an),jt===null?gt=ln:jt.sibling=ln,jt=ln);return un&&ze(ue,an),gt}for(Dt=T(ue,Dt);!ln.done;an++,ln=ge.next())ln=xn(Dt,ue,an,ln.value,tt),ln!==null&&(u&&ln.alternate!==null&&Dt.delete(ln.key===null?an:ln.key),re=N(ln,re,an),jt===null?gt=ln:jt.sibling=ln,jt=ln);return u&&Dt.forEach(function(kB){return h(ue,kB)}),un&&ze(ue,an),gt}function ps(ue,re,ge,tt){if(typeof ge=="object"&&ge!==null&&ge.type===d&&ge.key===null&&(ge=ge.props.children),typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case l:e:{for(var gt=ge.key,jt=re;jt!==null;){if(jt.key===gt){if(gt=ge.type,gt===d){if(jt.tag===7){v(ue,jt.sibling),re=b(jt,ge.props.children),re.return=ue,ue=re;break e}}else if(jt.elementType===gt||typeof gt=="object"&>!==null&>.$$typeof===w&&BC(gt)===jt.type){v(ue,jt.sibling),re=b(jt,ge.props),re.ref=$d(ue,jt,ge),re.return=ue,ue=re;break e}v(ue,jt);break}else h(ue,jt);jt=jt.sibling}ge.type===d?(re=oc(ge.props.children,ue.mode,tt,ge.key),re.return=ue,ue=re):(tt=Fg(ge.type,ge.key,ge.props,null,ue.mode,tt),tt.ref=$d(ue,re,ge),tt.return=ue,ue=tt)}return $(ue);case c:e:{for(jt=ge.key;re!==null;){if(re.key===jt)if(re.tag===4&&re.stateNode.containerInfo===ge.containerInfo&&re.stateNode.implementation===ge.implementation){v(ue,re.sibling),re=b(re,ge.children||[]),re.return=ue,ue=re;break e}else{v(ue,re);break}else h(ue,re);re=re.sibling}re=LS(ge,ue.mode,tt),re.return=ue,ue=re}return $(ue);case w:return jt=ge._init,ps(ue,re,jt(ge._payload),tt)}if(le(ge))return yt(ue,re,ge,tt);if(k(ge))return Gi(ue,re,ge,tt);ag(ue,ge)}return typeof ge=="string"&&ge!==""||typeof ge=="number"?(ge=""+ge,re!==null&&re.tag===6?(v(ue,re.sibling),re=b(re,ge),re.return=ue,ue=re):(v(ue,re),re=IS(ge,ue.mode,tt),re.return=ue,ue=re),$(ue)):v(ue,re)}return ps}var ku=zC(!0),HC=zC(!1),Yd={},us=tn(Yd),Kd=tn(Yd),Ou=tn(Yd);function io(u){if(u===Yd)throw Error(o(174));return u}function Yx(u,h){mt(Ou,h),mt(Kd,u),mt(us,Yd),u=pe(h),Ot(us),mt(us,u)}function Uu(){Ot(us),Ot(Kd),Ot(Ou)}function GC(u){var h=io(Ou.current),v=io(us.current);h=W(v,u.type,h),v!==h&&(mt(Kd,u),mt(us,h))}function Kx(u){Kd.current===u&&(Ot(us),Ot(Kd))}var Un=tn(0);function lg(u){for(var h=u;h!==null;){if(h.tag===13){var v=h.memoizedState;if(v!==null&&(v=v.dehydrated,v===null||ss(v)||os(v)))return h}else if(h.tag===19&&h.memoizedProps.revealOrder!==void 0){if(h.flags&128)return h}else if(h.child!==null){h.child.return=h,h=h.child;continue}if(h===u)break;for(;h.sibling===null;){if(h.return===null||h.return===u)return null;h=h.return}h.sibling.return=h.return,h=h.sibling}return null}var Qx=[];function Jx(){for(var u=0;uv?v:4,u(!0);var T=hs.transition;hs.transition={};try{u(!1),h()}finally{Ht=v,hs.transition=T}}function ib(){return ro().memoizedState}function lB(u,h,v){var T=Ra(u);v={lane:T,action:v,hasEagerState:!1,eagerState:null,next:null},rb(u)?sb(h,v):(ob(u,h,v),v=cr(),u=ds(u,T,v),u!==null&&ab(u,h,T))}function cB(u,h,v){var T=Ra(u),b={lane:T,action:v,hasEagerState:!1,eagerState:null,next:null};if(rb(u))sb(h,b);else{ob(u,h,b);var N=u.alternate;if(u.lanes===0&&(N===null||N.lanes===0)&&(N=h.lastRenderedReducer,N!==null))try{var $=h.lastRenderedState,Q=N($,v);if(b.hasEagerState=!0,b.eagerState=Q,Fi(Q,$))return}catch{}finally{}v=cr(),u=ds(u,T,v),u!==null&&ab(u,h,T)}}function rb(u){var h=u.alternate;return u===Wn||h!==null&&h===Wn}function sb(u,h){Qd=ug=!0;var v=u.pending;v===null?h.next=h:(h.next=v.next,v.next=h),u.pending=h}function ob(u,h,v){ai!==null&&u.mode&1&&!(Xt&2)?(u=h.interleaved,u===null?(v.next=v,Gr===null?Gr=[h]:Gr.push(h)):(v.next=u.next,u.next=v),h.interleaved=v):(u=h.pending,u===null?v.next=v:(v.next=u.next,u.next=v),h.pending=v)}function ab(u,h,v){if(v&4194240){var T=h.lanes;T&=u.pendingLanes,v|=T,h.lanes=v,Po(u,v)}}var mg={readContext:Mr,useCallback:zi,useContext:zi,useEffect:zi,useImperativeHandle:zi,useInsertionEffect:zi,useLayoutEffect:zi,useMemo:zi,useReducer:zi,useRef:zi,useState:zi,useDebugValue:zi,useDeferredValue:zi,useTransition:zi,useMutableSource:zi,useSyncExternalStore:zi,useId:zi,unstable_isNewReconciler:!1},uB={readContext:Mr,useCallback:function(u,h){return Do().memoizedState=[u,h===void 0?null:h],u},useContext:Mr,useEffect:iS,useImperativeHandle:function(u,h,v){return v=v!=null?v.concat([u]):null,fg(4194308,4,ZC.bind(null,h,u),v)},useLayoutEffect:function(u,h){return fg(4194308,4,u,h)},useInsertionEffect:function(u,h){return fg(4,2,u,h)},useMemo:function(u,h){var v=Do();return h=h===void 0?null:h,u=u(),v.memoizedState=[u,h],u},useReducer:function(u,h,v){var T=Do();return h=v!==void 0?v(h):h,T.memoizedState=T.baseState=h,u={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:u,lastRenderedState:h},T.queue=u,u=u.dispatch=lB.bind(null,Wn,u),[T.memoizedState,u]},useRef:function(u){var h=Do();return u={current:u},h.memoizedState=u},useState:nS,useDebugValue:rS,useDeferredValue:function(u){var h=nS(u),v=h[0],T=h[1];return iS(function(){var b=hs.transition;hs.transition={};try{T(u)}finally{hs.transition=b}},[u]),v},useTransition:function(){var u=nS(!1),h=u[0];return u=aB.bind(null,u[1]),Do().memoizedState=u,[h,u]},useMutableSource:function(){},useSyncExternalStore:function(u,h,v){var T=Wn,b=Do();if(un){if(v===void 0)throw Error(o(407));v=v()}else{if(v=h(),ai===null)throw Error(o(349));Fu&30||XC(T,h,v)}b.memoizedState=v;var N={value:v,getSnapshot:h};return b.queue=N,iS($C.bind(null,T,N,u),[u]),T.flags|=2048,Zd(9,qC.bind(null,T,N,v,h),void 0,null),v},useId:function(){var u=Do(),h=ai.identifierPrefix;if(un){var v=fe,T=ne;v=(T&~(1<<32-bn(T)-1)).toString(32)+v,h=":"+h+"R"+v,v=Jd++,0")&&(ye=ye.replace("",u.displayName)),ye}while(1<=$&&0<=Q);break}}}finally{_t=!1,Error.prepareStackTrace=v}return(u=u?u.displayName||u.name:"")?it(u):""}var ut=Object.prototype.hasOwnProperty,zt=[],Yt=-1;function tn(u){return{current:u}}function Ot(u){0>Yt||(u.current=zt[Yt],zt[Yt]=null,Yt--)}function mt(u,h){Yt++,zt[Yt]=u.current,u.current=h}var ot={},qt=tn(ot),Mt=tn(!1),Gn=ot;function Ui(u,h){var v=u.type.contextTypes;if(!v)return ot;var T=u.stateNode;if(T&&T.__reactInternalMemoizedUnmaskedChildContext===h)return T.__reactInternalMemoizedMaskedChildContext;var b={},N;for(N in v)b[N]=h[N];return T&&(u=u.stateNode,u.__reactInternalMemoizedUnmaskedChildContext=h,u.__reactInternalMemoizedMaskedChildContext=b),b}function dn(u){return u=u.childContextTypes,u!=null}function Js(){Ot(Mt),Ot(qt)}function _n(u,h,v){if(qt.current!==ot)throw Error(o(168));mt(qt,h),mt(Mt,v)}function Er(u,h,v){var T=u.stateNode;if(h=h.childContextTypes,typeof T.getChildContext!="function")return v;T=T.getChildContext();for(var b in T)if(!(b in h))throw Error(o(108,P(u)||"Unknown",b));return s({},v,T)}function Zs(u){return u=(u=u.stateNode)&&u.__reactInternalMemoizedMergedChildContext||ot,Gn=qt.current,mt(qt,u),mt(Mt,Mt.current),!0}function On(u,h,v){var T=u.stateNode;if(!T)throw Error(o(169));v?(u=Er(u,h,Gn),T.__reactInternalMemoizedMergedChildContext=u,Ot(Mt),Ot(qt),mt(qt,u)):Ot(Mt),mt(Mt,v)}var bn=Math.clz32?Math.clz32:ng,Ea=Math.log,Co=Math.LN2;function ng(u){return u>>>=0,u===0?32:31-(Ea(u)/Co|0)|0}var fn=64,bo=4194304;function bs(u){switch(u&-u){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return u&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return u&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return u}}function eo(u,h){var v=u.pendingLanes;if(v===0)return 0;var T=0,b=u.suspendedLanes,N=u.pingedLanes,$=v&268435455;if($!==0){var Q=$&~b;Q!==0?T=bs(Q):(N&=$,N!==0&&(T=bs(N)))}else $=v&~b,$!==0?T=bs($):N!==0&&(T=bs(N));if(T===0)return 0;if(h!==0&&h!==T&&!(h&b)&&(b=T&-T,N=h&-h,b>=N||b===16&&(N&4194240)!==0))return h;if(T&4&&(T|=v&16),h=u.entangledLanes,h!==0)for(u=u.entanglements,h&=T;0v;v++)h.push(u);return h}function jl(u,h,v){u.pendingLanes|=h,h!==536870912&&(u.suspendedLanes=0,u.pingedLanes=0),u=u.eventTimes,h=31-bn(h),u[h]=v}function Hx(u,h){var v=u.pendingLanes&~h;u.pendingLanes=h,u.suspendedLanes=0,u.pingedLanes=0,u.expiredLanes&=h,u.mutableReadLanes&=h,u.entangledLanes&=h,h=u.entanglements;var T=u.eventTimes;for(u=u.expirationTimes;0>=$,b-=$,ne=1<<32-bn(h)+b|v<an?(Si=Dt,Dt=null):Si=Dt.sibling;var ln=wt(ue,Dt,ge[an],tt);if(ln===null){Dt===null&&(Dt=Si);break}u&&Dt&&ln.alternate===null&&h(ue,Dt),re=N(ln,re,an),jt===null?gt=ln:jt.sibling=ln,jt=ln,Dt=Si}if(an===ge.length)return v(ue,Dt),un&&ze(ue,an),gt;if(Dt===null){for(;anan?(Si=Dt,Dt=null):Si=Dt.sibling;var Na=wt(ue,Dt,ln.value,tt);if(Na===null){Dt===null&&(Dt=Si);break}u&&Dt&&Na.alternate===null&&h(ue,Dt),re=N(Na,re,an),jt===null?gt=Na:jt.sibling=Na,jt=Na,Dt=Si}if(ln.done)return v(ue,Dt),un&&ze(ue,an),gt;if(Dt===null){for(;!ln.done;an++,ln=ge.next())ln=Nt(ue,ln.value,tt),ln!==null&&(re=N(ln,re,an),jt===null?gt=ln:jt.sibling=ln,jt=ln);return un&&ze(ue,an),gt}for(Dt=T(ue,Dt);!ln.done;an++,ln=ge.next())ln=xn(Dt,ue,an,ln.value,tt),ln!==null&&(u&&ln.alternate!==null&&Dt.delete(ln.key===null?an:ln.key),re=N(ln,re,an),jt===null?gt=ln:jt.sibling=ln,jt=ln);return u&&Dt.forEach(function(OB){return h(ue,OB)}),un&&ze(ue,an),gt}function ps(ue,re,ge,tt){if(typeof ge=="object"&&ge!==null&&ge.type===d&&ge.key===null&&(ge=ge.props.children),typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case l:e:{for(var gt=ge.key,jt=re;jt!==null;){if(jt.key===gt){if(gt=ge.type,gt===d){if(jt.tag===7){v(ue,jt.sibling),re=b(jt,ge.props.children),re.return=ue,ue=re;break e}}else if(jt.elementType===gt||typeof gt=="object"&>!==null&>.$$typeof===w&&BC(gt)===jt.type){v(ue,jt.sibling),re=b(jt,ge.props),re.ref=$d(ue,jt,ge),re.return=ue,ue=re;break e}v(ue,jt);break}else h(ue,jt);jt=jt.sibling}ge.type===d?(re=oc(ge.props.children,ue.mode,tt,ge.key),re.return=ue,ue=re):(tt=Fg(ge.type,ge.key,ge.props,null,ue.mode,tt),tt.ref=$d(ue,re,ge),tt.return=ue,ue=tt)}return $(ue);case c:e:{for(jt=ge.key;re!==null;){if(re.key===jt)if(re.tag===4&&re.stateNode.containerInfo===ge.containerInfo&&re.stateNode.implementation===ge.implementation){v(ue,re.sibling),re=b(re,ge.children||[]),re.return=ue,ue=re;break e}else{v(ue,re);break}else h(ue,re);re=re.sibling}re=LS(ge,ue.mode,tt),re.return=ue,ue=re}return $(ue);case w:return jt=ge._init,ps(ue,re,jt(ge._payload),tt)}if(le(ge))return yt(ue,re,ge,tt);if(k(ge))return Gi(ue,re,ge,tt);ag(ue,ge)}return typeof ge=="string"&&ge!==""||typeof ge=="number"?(ge=""+ge,re!==null&&re.tag===6?(v(ue,re.sibling),re=b(re,ge),re.return=ue,ue=re):(v(ue,re),re=IS(ge,ue.mode,tt),re.return=ue,ue=re),$(ue)):v(ue,re)}return ps}var ku=zC(!0),HC=zC(!1),Yd={},us=tn(Yd),Kd=tn(Yd),Ou=tn(Yd);function io(u){if(u===Yd)throw Error(o(174));return u}function Yx(u,h){mt(Ou,h),mt(Kd,u),mt(us,Yd),u=pe(h),Ot(us),mt(us,u)}function Uu(){Ot(us),Ot(Kd),Ot(Ou)}function GC(u){var h=io(Ou.current),v=io(us.current);h=W(v,u.type,h),v!==h&&(mt(Kd,u),mt(us,h))}function Kx(u){Kd.current===u&&(Ot(us),Ot(Kd))}var Un=tn(0);function lg(u){for(var h=u;h!==null;){if(h.tag===13){var v=h.memoizedState;if(v!==null&&(v=v.dehydrated,v===null||ss(v)||os(v)))return h}else if(h.tag===19&&h.memoizedProps.revealOrder!==void 0){if(h.flags&128)return h}else if(h.child!==null){h.child.return=h,h=h.child;continue}if(h===u)break;for(;h.sibling===null;){if(h.return===null||h.return===u)return null;h=h.return}h.sibling.return=h.return,h=h.sibling}return null}var Qx=[];function Jx(){for(var u=0;uv?v:4,u(!0);var T=hs.transition;hs.transition={};try{u(!1),h()}finally{Ht=v,hs.transition=T}}function ib(){return ro().memoizedState}function cB(u,h,v){var T=Ra(u);v={lane:T,action:v,hasEagerState:!1,eagerState:null,next:null},rb(u)?sb(h,v):(ob(u,h,v),v=cr(),u=ds(u,T,v),u!==null&&ab(u,h,T))}function uB(u,h,v){var T=Ra(u),b={lane:T,action:v,hasEagerState:!1,eagerState:null,next:null};if(rb(u))sb(h,b);else{ob(u,h,b);var N=u.alternate;if(u.lanes===0&&(N===null||N.lanes===0)&&(N=h.lastRenderedReducer,N!==null))try{var $=h.lastRenderedState,Q=N($,v);if(b.hasEagerState=!0,b.eagerState=Q,Fi(Q,$))return}catch{}finally{}v=cr(),u=ds(u,T,v),u!==null&&ab(u,h,T)}}function rb(u){var h=u.alternate;return u===Wn||h!==null&&h===Wn}function sb(u,h){Qd=ug=!0;var v=u.pending;v===null?h.next=h:(h.next=v.next,v.next=h),u.pending=h}function ob(u,h,v){ai!==null&&u.mode&1&&!(Xt&2)?(u=h.interleaved,u===null?(v.next=v,Gr===null?Gr=[h]:Gr.push(h)):(v.next=u.next,u.next=v),h.interleaved=v):(u=h.pending,u===null?v.next=v:(v.next=u.next,u.next=v),h.pending=v)}function ab(u,h,v){if(v&4194240){var T=h.lanes;T&=u.pendingLanes,v|=T,h.lanes=v,Po(u,v)}}var mg={readContext:Mr,useCallback:zi,useContext:zi,useEffect:zi,useImperativeHandle:zi,useInsertionEffect:zi,useLayoutEffect:zi,useMemo:zi,useReducer:zi,useRef:zi,useState:zi,useDebugValue:zi,useDeferredValue:zi,useTransition:zi,useMutableSource:zi,useSyncExternalStore:zi,useId:zi,unstable_isNewReconciler:!1},hB={readContext:Mr,useCallback:function(u,h){return Do().memoizedState=[u,h===void 0?null:h],u},useContext:Mr,useEffect:iS,useImperativeHandle:function(u,h,v){return v=v!=null?v.concat([u]):null,fg(4194308,4,ZC.bind(null,h,u),v)},useLayoutEffect:function(u,h){return fg(4194308,4,u,h)},useInsertionEffect:function(u,h){return fg(4,2,u,h)},useMemo:function(u,h){var v=Do();return h=h===void 0?null:h,u=u(),v.memoizedState=[u,h],u},useReducer:function(u,h,v){var T=Do();return h=v!==void 0?v(h):h,T.memoizedState=T.baseState=h,u={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:u,lastRenderedState:h},T.queue=u,u=u.dispatch=cB.bind(null,Wn,u),[T.memoizedState,u]},useRef:function(u){var h=Do();return u={current:u},h.memoizedState=u},useState:nS,useDebugValue:rS,useDeferredValue:function(u){var h=nS(u),v=h[0],T=h[1];return iS(function(){var b=hs.transition;hs.transition={};try{T(u)}finally{hs.transition=b}},[u]),v},useTransition:function(){var u=nS(!1),h=u[0];return u=lB.bind(null,u[1]),Do().memoizedState=u,[h,u]},useMutableSource:function(){},useSyncExternalStore:function(u,h,v){var T=Wn,b=Do();if(un){if(v===void 0)throw Error(o(407));v=v()}else{if(v=h(),ai===null)throw Error(o(349));Fu&30||XC(T,h,v)}b.memoizedState=v;var N={value:v,getSnapshot:h};return b.queue=N,iS($C.bind(null,T,N,u),[u]),T.flags|=2048,Zd(9,qC.bind(null,T,N,v,h),void 0,null),v},useId:function(){var u=Do(),h=ai.identifierPrefix;if(un){var v=fe,T=ne;v=(T&~(1<<32-bn(T)-1)).toString(32)+v,h=":"+h+"R"+v,v=Jd++,0ES&&(h.flags|=128,T=!0,rf(b,!1),h.lanes=4194304)}else{if(!T)if(u=lg(N),u!==null){if(h.flags|=128,T=!0,u=u.updateQueue,u!==null&&(h.updateQueue=u,h.flags|=4),rf(b,!0),b.tail===null&&b.tailMode==="hidden"&&!N.alternate&&!un)return Hi(h),null}else 2*oi()-b.renderingStartTime>ES&&v!==1073741824&&(h.flags|=128,T=!0,rf(b,!1),h.lanes=4194304);b.isBackwards?(N.sibling=h.child,h.child=N):(u=b.last,u!==null?u.sibling=N:h.child=N,b.last=N)}return b.tail!==null?(h=b.tail,b.rendering=h,b.tail=h.sibling,b.renderingStartTime=oi(),h.sibling=null,u=Un.current,mt(Un,T?u&1|2:u&1),h):(Hi(h),null);case 22:case 23:return bS(),T=h.memoizedState!==null,u!==null&&u.memoizedState!==null!==T&&(h.flags|=8192),T&&h.mode&1?Xr&1073741824&&(Hi(h),ke&&h.subtreeFlags&6&&(h.flags|=8192)):Hi(h),null;case 24:return null;case 25:return null}throw Error(o(156,h.tag))}var mB=a.ReactCurrentOwner,jr=!1;function lr(u,h,v,T){h.child=u===null?HC(h,null,v,T):ku(h,u.child,v,T)}function mb(u,h,v,T,b){v=v.render;var N=h.ref;return Ps(h,b),T=eS(u,h,v,T,N,b),v=tS(),u!==null&&!jr?(h.updateQueue=u.updateQueue,h.flags&=-2053,u.lanes&=~b,ko(u,h,b)):(un&&v&&Qn(h),h.flags|=1,lr(u,h,T,b),h.child)}function gb(u,h,v,T,b){if(u===null){var N=v.type;return typeof N=="function"&&!RS(N)&&N.defaultProps===void 0&&v.compare===null&&v.defaultProps===void 0?(h.tag=15,h.type=N,yb(u,h,N,T,b)):(u=Fg(v.type,null,T,h,h.mode,b),u.ref=h.ref,u.return=h,h.child=u)}if(N=u.child,!(u.lanes&b)){var $=N.memoizedProps;if(v=v.compare,v=v!==null?v:ql,v($,T)&&u.ref===h.ref)return ko(u,h,b)}return h.flags|=1,u=La(N,T),u.ref=h.ref,u.return=h,h.child=u}function yb(u,h,v,T,b){if(u!==null&&ql(u.memoizedProps,T)&&u.ref===h.ref)if(jr=!1,(u.lanes&b)!==0)u.flags&131072&&(jr=!0);else return h.lanes=u.lanes,ko(u,h,b);return aS(u,h,v,T,b)}function vb(u,h,v){var T=h.pendingProps,b=T.children,N=u!==null?u.memoizedState:null;if(T.mode==="hidden")if(!(h.mode&1))h.memoizedState={baseLanes:0,cachePool:null},mt(Vu,Xr),Xr|=v;else if(v&1073741824)h.memoizedState={baseLanes:0,cachePool:null},T=N!==null?N.baseLanes:v,mt(Vu,Xr),Xr|=T;else return u=N!==null?N.baseLanes|v:v,h.lanes=h.childLanes=1073741824,h.memoizedState={baseLanes:u,cachePool:null},h.updateQueue=null,mt(Vu,Xr),Xr|=u,null;else N!==null?(T=N.baseLanes|v,h.memoizedState=null):T=v,mt(Vu,Xr),Xr|=T;return lr(u,h,b,v),h.child}function _b(u,h){var v=h.ref;(u===null&&v!==null||u!==null&&u.ref!==v)&&(h.flags|=512,h.flags|=2097152)}function aS(u,h,v,T,b){var N=dn(v)?Gn:qt.current;return N=Ui(h,N),Ps(h,b),v=eS(u,h,v,T,N,b),T=tS(),u!==null&&!jr?(h.updateQueue=u.updateQueue,h.flags&=-2053,u.lanes&=~b,ko(u,h,b)):(un&&T&&Qn(h),h.flags|=1,lr(u,h,v,b),h.child)}function xb(u,h,v,T,b){if(dn(v)){var N=!0;Zs(h)}else N=!1;if(Ps(h,b),h.stateNode===null)u!==null&&(u.alternate=null,h.alternate=null,h.flags|=2),Xd(h,v,T),Ci(h,v,T,b),T=!0;else if(u===null){var $=h.stateNode,Q=h.memoizedProps;$.props=Q;var ye=$.context,He=v.contextType;typeof He=="object"&&He!==null?He=Mr(He):(He=dn(v)?Gn:qt.current,He=Ui(h,He));var ct=v.getDerivedStateFromProps,Nt=typeof ct=="function"||typeof $.getSnapshotBeforeUpdate=="function";Nt||typeof $.UNSAFE_componentWillReceiveProps!="function"&&typeof $.componentWillReceiveProps!="function"||(Q!==T||ye!==He)&&Zl(h,$,T,He),Cr=!1;var wt=h.memoizedState;$.state=wt,Ql(h,T,$,b),ye=h.memoizedState,Q!==T||wt!==ye||Mt.current||Cr?(typeof ct=="function"&&(Lu(h,v,ct,T),ye=h.memoizedState),(Q=Cr||jd(h,v,Q,T,wt,ye,He))?(Nt||typeof $.UNSAFE_componentWillMount!="function"&&typeof $.componentWillMount!="function"||(typeof $.componentWillMount=="function"&&$.componentWillMount(),typeof $.UNSAFE_componentWillMount=="function"&&$.UNSAFE_componentWillMount()),typeof $.componentDidMount=="function"&&(h.flags|=4194308)):(typeof $.componentDidMount=="function"&&(h.flags|=4194308),h.memoizedProps=T,h.memoizedState=ye),$.props=T,$.state=ye,$.context=He,T=Q):(typeof $.componentDidMount=="function"&&(h.flags|=4194308),T=!1)}else{$=h.stateNode,Gd(u,h),Q=h.memoizedProps,He=h.type===h.elementType?Q:Tr(h.type,Q),$.props=He,Nt=h.pendingProps,wt=$.context,ye=v.contextType,typeof ye=="object"&&ye!==null?ye=Mr(ye):(ye=dn(v)?Gn:qt.current,ye=Ui(h,ye));var xn=v.getDerivedStateFromProps;(ct=typeof xn=="function"||typeof $.getSnapshotBeforeUpdate=="function")||typeof $.UNSAFE_componentWillReceiveProps!="function"&&typeof $.componentWillReceiveProps!="function"||(Q!==Nt||wt!==ye)&&Zl(h,$,T,ye),Cr=!1,wt=h.memoizedState,$.state=wt,Ql(h,T,$,b);var yt=h.memoizedState;Q!==Nt||wt!==yt||Mt.current||Cr?(typeof xn=="function"&&(Lu(h,v,xn,T),yt=h.memoizedState),(He=Cr||jd(h,v,He,T,wt,yt,ye)||!1)?(ct||typeof $.UNSAFE_componentWillUpdate!="function"&&typeof $.componentWillUpdate!="function"||(typeof $.componentWillUpdate=="function"&&$.componentWillUpdate(T,yt,ye),typeof $.UNSAFE_componentWillUpdate=="function"&&$.UNSAFE_componentWillUpdate(T,yt,ye)),typeof $.componentDidUpdate=="function"&&(h.flags|=4),typeof $.getSnapshotBeforeUpdate=="function"&&(h.flags|=1024)):(typeof $.componentDidUpdate!="function"||Q===u.memoizedProps&&wt===u.memoizedState||(h.flags|=4),typeof $.getSnapshotBeforeUpdate!="function"||Q===u.memoizedProps&&wt===u.memoizedState||(h.flags|=1024),h.memoizedProps=T,h.memoizedState=yt),$.props=T,$.state=yt,$.context=ye,T=He):(typeof $.componentDidUpdate!="function"||Q===u.memoizedProps&&wt===u.memoizedState||(h.flags|=4),typeof $.getSnapshotBeforeUpdate!="function"||Q===u.memoizedProps&&wt===u.memoizedState||(h.flags|=1024),T=!1)}return lS(u,h,v,T,N,b)}function lS(u,h,v,T,b,N){_b(u,h);var $=(h.flags&128)!==0;if(!T&&!$)return b&&On(h,v,!1),ko(u,h,N);T=h.stateNode,mB.current=h;var Q=$&&typeof v.getDerivedStateFromError!="function"?null:T.render();return h.flags|=1,u!==null&&$?(h.child=ku(h,u.child,null,N),h.child=ku(h,null,Q,N)):lr(u,h,Q,N),h.memoizedState=T.state,b&&On(h,v,!0),h.child}function Sb(u){var h=u.stateNode;h.pendingContext?_n(u,h.pendingContext,h.pendingContext!==h.context):h.context&&_n(u,h.context,!1),Yx(u,h.containerInfo)}function wb(u,h,v,T,b){return Du(),$x(b),h.flags|=256,lr(u,h,v,T),h.child}var vg={dehydrated:null,treeContext:null,retryLane:0};function _g(u){return{baseLanes:u,cachePool:null}}function Eb(u,h,v){var T=h.pendingProps,b=Un.current,N=!1,$=(h.flags&128)!==0,Q;if((Q=$)||(Q=u!==null&&u.memoizedState===null?!1:(b&2)!==0),Q?(N=!0,h.flags&=-129):(u===null||u.memoizedState!==null)&&(b|=1),mt(Un,b&1),u===null)return qx(h),u=h.memoizedState,u!==null&&(u=u.dehydrated,u!==null)?(h.mode&1?os(u)?h.lanes=8:h.lanes=1073741824:h.lanes=1,null):(b=T.children,u=T.fallback,N?(T=h.mode,N=h.child,b={mode:"hidden",children:b},!(T&1)&&N!==null?(N.childLanes=0,N.pendingProps=b):N=Vg(b,T,0,null),u=oc(u,T,v,null),N.return=h,u.return=h,N.sibling=u,h.child=N,h.child.memoizedState=_g(v),h.memoizedState=vg,u):cS(h,b));if(b=u.memoizedState,b!==null){if(Q=b.dehydrated,Q!==null){if($)return h.flags&256?(h.flags&=-257,xg(u,h,v,Error(o(422)))):h.memoizedState!==null?(h.child=u.child,h.flags|=128,null):(N=T.fallback,b=h.mode,T=Vg({mode:"visible",children:T.children},b,0,null),N=oc(N,b,v,null),N.flags|=2,T.return=h,N.return=h,T.sibling=N,h.child=T,h.mode&1&&ku(h,u.child,null,v),h.child.memoizedState=_g(v),h.memoizedState=vg,N);if(!(h.mode&1))h=xg(u,h,v,null);else if(os(Q))h=xg(u,h,v,Error(o(419)));else if(T=(v&u.childLanes)!==0,jr||T){if(T=ai,T!==null){switch(v&-v){case 4:N=2;break;case 16:N=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:N=32;break;case 536870912:N=268435456;break;default:N=0}T=N&(T.suspendedLanes|v)?0:N,T!==0&&T!==b.retryLane&&(b.retryLane=T,ds(u,T,-1))}PS(),h=xg(u,h,v,Error(o(421)))}else ss(Q)?(h.flags|=128,h.child=u.child,h=bB.bind(null,u),Eu(Q,h),h=null):(v=b.treeContext,j&&(gn=Tu(Q),mn=h,un=!0,Vi=null,bi=!1,v!==null&&(C[L++]=ne,C[L++]=fe,C[L++]=z,ne=v.id,fe=v.overflow,z=h)),h=cS(h,h.pendingProps.children),h.flags|=4096);return h}return N?(T=Ab(u,h,T.children,T.fallback,v),N=h.child,b=u.child.memoizedState,N.memoizedState=b===null?_g(v):{baseLanes:b.baseLanes|v,cachePool:null},N.childLanes=u.childLanes&~v,h.memoizedState=vg,T):(v=Tb(u,h,T.children,v),h.memoizedState=null,v)}return N?(T=Ab(u,h,T.children,T.fallback,v),N=h.child,b=u.child.memoizedState,N.memoizedState=b===null?_g(v):{baseLanes:b.baseLanes|v,cachePool:null},N.childLanes=u.childLanes&~v,h.memoizedState=vg,T):(v=Tb(u,h,T.children,v),h.memoizedState=null,v)}function cS(u,h){return h=Vg({mode:"visible",children:h},u.mode,0,null),h.return=u,u.child=h}function Tb(u,h,v,T){var b=u.child;return u=b.sibling,v=La(b,{mode:"visible",children:v}),!(h.mode&1)&&(v.lanes=T),v.return=h,v.sibling=null,u!==null&&(T=h.deletions,T===null?(h.deletions=[u],h.flags|=16):T.push(u)),h.child=v}function Ab(u,h,v,T,b){var N=h.mode;u=u.child;var $=u.sibling,Q={mode:"hidden",children:v};return!(N&1)&&h.child!==u?(v=h.child,v.childLanes=0,v.pendingProps=Q,h.deletions=null):(v=La(u,Q),v.subtreeFlags=u.subtreeFlags&14680064),$!==null?T=La($,T):(T=oc(T,N,b,null),T.flags|=2),T.return=h,v.return=h,v.sibling=T,h.child=v,T}function xg(u,h,v,T){return T!==null&&$x(T),ku(h,u.child,null,v),u=cS(h,h.pendingProps.children),u.flags|=2,h.memoizedState=null,u}function Mb(u,h,v){u.lanes|=h;var T=u.alternate;T!==null&&(T.lanes|=h),Ru(u.return,h,v)}function uS(u,h,v,T,b){var N=u.memoizedState;N===null?u.memoizedState={isBackwards:h,rendering:null,renderingStartTime:0,last:T,tail:v,tailMode:b}:(N.isBackwards=h,N.rendering=null,N.renderingStartTime=0,N.last=T,N.tail=v,N.tailMode=b)}function Cb(u,h,v){var T=h.pendingProps,b=T.revealOrder,N=T.tail;if(lr(u,h,T.children,v),T=Un.current,T&2)T=T&1|2,h.flags|=128;else{if(u!==null&&u.flags&128)e:for(u=h.child;u!==null;){if(u.tag===13)u.memoizedState!==null&&Mb(u,v,h);else if(u.tag===19)Mb(u,v,h);else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===h)break e;for(;u.sibling===null;){if(u.return===null||u.return===h)break e;u=u.return}u.sibling.return=u.return,u=u.sibling}T&=1}if(mt(Un,T),!(h.mode&1))h.memoizedState=null;else switch(b){case"forwards":for(v=h.child,b=null;v!==null;)u=v.alternate,u!==null&&lg(u)===null&&(b=v),v=v.sibling;v=b,v===null?(b=h.child,h.child=null):(b=v.sibling,v.sibling=null),uS(h,!1,b,v,N);break;case"backwards":for(v=null,b=h.child,h.child=null;b!==null;){if(u=b.alternate,u!==null&&lg(u)===null){h.child=b;break}u=b.sibling,b.sibling=v,v=b,b=u}uS(h,!0,v,null,N);break;case"together":uS(h,!1,null,null,void 0);break;default:h.memoizedState=null}return h.child}function ko(u,h,v){if(u!==null&&(h.dependencies=u.dependencies),Bu|=h.lanes,!(v&h.childLanes))return null;if(u!==null&&h.child!==u.child)throw Error(o(153));if(h.child!==null){for(u=h.child,v=La(u,u.pendingProps),h.child=v,v.return=h;u.sibling!==null;)u=u.sibling,v=v.sibling=La(u,u.pendingProps),v.return=h;v.sibling=null}return h.child}function gB(u,h,v){switch(h.tag){case 3:Sb(h),Du();break;case 5:GC(h);break;case 1:dn(h.type)&&Zs(h);break;case 4:Yx(h,h.stateNode.containerInfo);break;case 10:Pu(h,h.type._context,h.memoizedProps.value);break;case 13:var T=h.memoizedState;if(T!==null)return T.dehydrated!==null?(mt(Un,Un.current&1),h.flags|=128,null):v&h.child.childLanes?Eb(u,h,v):(mt(Un,Un.current&1),u=ko(u,h,v),u!==null?u.sibling:null);mt(Un,Un.current&1);break;case 19:if(T=(v&h.childLanes)!==0,u.flags&128){if(T)return Cb(u,h,v);h.flags|=128}var b=h.memoizedState;if(b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),mt(Un,Un.current),T)break;return null;case 22:case 23:return h.lanes=0,vb(u,h,v)}return ko(u,h,v)}function yB(u,h){switch(Kt(h),h.tag){case 1:return dn(h.type)&&Js(),u=h.flags,u&65536?(h.flags=u&-65537|128,h):null;case 3:return Uu(),Ot(Mt),Ot(qt),Jx(),u=h.flags,u&65536&&!(u&128)?(h.flags=u&-65537|128,h):null;case 5:return Kx(h),null;case 13:if(Ot(Un),u=h.memoizedState,u!==null&&u.dehydrated!==null){if(h.alternate===null)throw Error(o(340));Du()}return u=h.flags,u&65536?(h.flags=u&-65537|128,h):null;case 19:return Ot(Un),null;case 4:return Uu(),null;case 10:return Ca(h.type._context),null;case 22:case 23:return bS(),null;case 24:return null;default:return null}}var Sg=!1,tc=!1,vB=typeof WeakSet=="function"?WeakSet:Set,Je=null;function wg(u,h){var v=u.ref;if(v!==null)if(typeof v=="function")try{v(null)}catch(T){Rr(u,h,T)}else v.current=null}function hS(u,h,v){try{v()}catch(T){Rr(u,h,T)}}var bb=!1;function _B(u,h){for(J(u.containerInfo),Je=h;Je!==null;)if(u=Je,h=u.child,(u.subtreeFlags&1028)!==0&&h!==null)h.return=u,Je=h;else for(;Je!==null;){u=Je;try{var v=u.alternate;if(u.flags&1024)switch(u.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var T=v.memoizedProps,b=v.memoizedState,N=u.stateNode,$=N.getSnapshotBeforeUpdate(u.elementType===u.type?T:Tr(u.type,T),b);N.__reactInternalSnapshotBeforeUpdate=$}break;case 3:ke&&Xe(u.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(Q){Rr(u,u.return,Q)}if(h=u.sibling,h!==null){h.return=u.return,Je=h;break}Je=u.return}return v=bb,bb=!1,v}function nc(u,h,v){var T=h.updateQueue;if(T=T!==null?T.lastEffect:null,T!==null){var b=T=T.next;do{if((b.tag&u)===u){var N=b.destroy;b.destroy=void 0,N!==void 0&&hS(h,v,N)}b=b.next}while(b!==T)}}function sf(u,h){if(h=h.updateQueue,h=h!==null?h.lastEffect:null,h!==null){var v=h=h.next;do{if((v.tag&u)===u){var T=v.create;v.destroy=T()}v=v.next}while(v!==h)}}function dS(u){var h=u.ref;if(h!==null){var v=u.stateNode;switch(u.tag){case 5:u=ee(v);break;default:u=v}typeof h=="function"?h(u):h.current=u}}function Pb(u,h,v){if(ar&&typeof ar.onCommitFiberUnmount=="function")try{ar.onCommitFiberUnmount(Ro,h)}catch{}switch(h.tag){case 0:case 11:case 14:case 15:if(u=h.updateQueue,u!==null&&(u=u.lastEffect,u!==null)){var T=u=u.next;do{var b=T,N=b.destroy;b=b.tag,N!==void 0&&(b&2||b&4)&&hS(h,v,N),T=T.next}while(T!==u)}break;case 1:if(wg(h,v),u=h.stateNode,typeof u.componentWillUnmount=="function")try{u.props=h.memoizedProps,u.state=h.memoizedState,u.componentWillUnmount()}catch($){Rr(h,v,$)}break;case 5:wg(h,v);break;case 4:ke?kb(u,h,v):xe&&xe&&(h=h.stateNode.containerInfo,v=At(h),It(h,v))}}function Rb(u,h,v){for(var T=h;;)if(Pb(u,T,v),T.child===null||ke&&T.tag===4){if(T===h)break;for(;T.sibling===null;){if(T.return===null||T.return===h)return;T=T.return}T.sibling.return=T.return,T=T.sibling}else T.child.return=T,T=T.child}function Ib(u){var h=u.alternate;h!==null&&(u.alternate=null,Ib(h)),u.child=null,u.deletions=null,u.sibling=null,u.tag===5&&(h=u.stateNode,h!==null&&Ue(h)),u.stateNode=null,u.return=null,u.dependencies=null,u.memoizedProps=null,u.memoizedState=null,u.pendingProps=null,u.stateNode=null,u.updateQueue=null}function Lb(u){return u.tag===5||u.tag===3||u.tag===4}function Nb(u){e:for(;;){for(;u.sibling===null;){if(u.return===null||Lb(u.return))return null;u=u.return}for(u.sibling.return=u.return,u=u.sibling;u.tag!==5&&u.tag!==6&&u.tag!==18;){if(u.flags&2||u.child===null||u.tag===4)continue e;u.child.return=u,u=u.child}if(!(u.flags&2))return u.stateNode}}function Db(u){if(ke){e:{for(var h=u.return;h!==null;){if(Lb(h))break e;h=h.return}throw Error(o(160))}var v=h;switch(v.tag){case 5:h=v.stateNode,v.flags&32&&(je(h),v.flags&=-33),v=Nb(u),pS(u,v,h);break;case 3:case 4:h=v.stateNode.containerInfo,v=Nb(u),fS(u,v,h);break;default:throw Error(o(161))}}}function fS(u,h,v){var T=u.tag;if(T===5||T===6)u=u.stateNode,h?et(v,u,h):Lt(v,u);else if(T!==4&&(u=u.child,u!==null))for(fS(u,h,v),u=u.sibling;u!==null;)fS(u,h,v),u=u.sibling}function pS(u,h,v){var T=u.tag;if(T===5||T===6)u=u.stateNode,h?vt(v,u,h):Ge(v,u);else if(T!==4&&(u=u.child,u!==null))for(pS(u,h,v),u=u.sibling;u!==null;)pS(u,h,v),u=u.sibling}function kb(u,h,v){for(var T=h,b=!1,N,$;;){if(!b){b=T.return;e:for(;;){if(b===null)throw Error(o(160));switch(N=b.stateNode,b.tag){case 5:$=!1;break e;case 3:N=N.containerInfo,$=!0;break e;case 4:N=N.containerInfo,$=!0;break e}b=b.return}b=!0}if(T.tag===5||T.tag===6)Rb(u,T,v),$?ve(N,T.stateNode):K(N,T.stateNode);else if(T.tag===18)$?de(N,T.stateNode):ce(N,T.stateNode);else if(T.tag===4){if(T.child!==null){N=T.stateNode.containerInfo,$=!0,T.child.return=T,T=T.child;continue}}else if(Pb(u,T,v),T.child!==null){T.child.return=T,T=T.child;continue}if(T===h)break;for(;T.sibling===null;){if(T.return===null||T.return===h)return;T=T.return,T.tag===4&&(b=!1)}T.sibling.return=T.return,T=T.sibling}}function mS(u,h){if(ke){switch(h.tag){case 0:case 11:case 14:case 15:nc(3,h,h.return),sf(3,h),nc(5,h,h.return);return;case 1:return;case 5:var v=h.stateNode;if(v!=null){var T=h.memoizedProps;u=u!==null?u.memoizedProps:T;var b=h.type,N=h.updateQueue;h.updateQueue=null,N!==null&&Et(v,N,b,u,T,h)}return;case 6:if(h.stateNode===null)throw Error(o(162));v=h.memoizedProps,Le(h.stateNode,u!==null?u.memoizedProps:v,v);return;case 3:j&&u!==null&&u.memoizedState.isDehydrated&&H(h.stateNode.containerInfo);return;case 12:return;case 13:Eg(h);return;case 19:Eg(h);return;case 17:return}throw Error(o(163))}switch(h.tag){case 0:case 11:case 14:case 15:nc(3,h,h.return),sf(3,h),nc(5,h,h.return);return;case 12:return;case 13:Eg(h);return;case 19:Eg(h);return;case 3:j&&u!==null&&u.memoizedState.isDehydrated&&H(h.stateNode.containerInfo);break;case 22:case 23:return}e:if(xe){switch(h.tag){case 1:case 5:case 6:break e;case 3:case 4:h=h.stateNode,It(h.containerInfo,h.pendingChildren);break e}throw Error(o(163))}}function Eg(u){var h=u.updateQueue;if(h!==null){u.updateQueue=null;var v=u.stateNode;v===null&&(v=u.stateNode=new vB),h.forEach(function(T){var b=PB.bind(null,u,T);v.has(T)||(v.add(T),T.then(b,b))})}}function xB(u,h){for(Je=h;Je!==null;){h=Je;var v=h.deletions;if(v!==null)for(var T=0;T";case Ag:return":has("+(vS(u)||"")+")";case Mg:return'[role="'+u.value+'"]';case bg:return'"'+u.value+'"';case Cg:return'[data-testname="'+u.value+'"]';default:throw Error(o(365))}}function Bb(u,h){var v=[];u=[u,0];for(var T=0;Tb&&(b=$),T&=~N}if(T=b,T=oi()-T,T=(120>T?120:480>T?480:1080>T?1080:1920>T?1920:3e3>T?3e3:4320>T?4320:1960*wB(T/1960))-T,10u?16:u,Pa===null)var T=!1;else{if(u=Pa,Pa=null,Ng=0,Xt&6)throw Error(o(331));var b=Xt;for(Xt|=4,Je=u.current;Je!==null;){var N=Je,$=N.child;if(Je.flags&16){var Q=N.deletions;if(Q!==null){for(var ye=0;yeoi()-wS?ic(u,0):SS|=v),Pr(u,h)}function Yb(u,h){h===0&&(u.mode&1?(h=bo,bo<<=1,!(bo&130023424)&&(bo=4194304)):h=1);var v=cr();u=Og(u,h),u!==null&&(jl(u,h,v),Pr(u,v))}function bB(u){var h=u.memoizedState,v=0;h!==null&&(v=h.retryLane),Yb(u,v)}function PB(u,h){var v=0;switch(u.tag){case 13:var T=u.stateNode,b=u.memoizedState;b!==null&&(v=b.retryLane);break;case 19:T=u.stateNode;break;default:throw Error(o(314))}T!==null&&T.delete(h),Yb(u,v)}var Kb;Kb=function(u,h,v){if(u!==null)if(u.memoizedProps!==h.pendingProps||Mt.current)jr=!0;else{if(!(u.lanes&v)&&!(h.flags&128))return jr=!1,gB(u,h,v);jr=!!(u.flags&131072)}else jr=!1,un&&h.flags&1048576&&pn(h,g,h.index);switch(h.lanes=0,h.tag){case 2:var T=h.type;u!==null&&(u.alternate=null,h.alternate=null,h.flags|=2),u=h.pendingProps;var b=Ui(h,qt.current);Ps(h,v),b=eS(null,h,T,u,b,v);var N=tS();return h.flags|=1,typeof b=="object"&&b!==null&&typeof b.render=="function"&&b.$$typeof===void 0?(h.tag=1,h.memoizedState=null,h.updateQueue=null,dn(T)?(N=!0,Zs(h)):N=!1,h.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,Iu(h),b.updater=Jl,h.stateNode=b,b._reactInternals=h,Ci(h,T,u,v),h=lS(null,h,T,!0,N,v)):(h.tag=0,un&&N&&Qn(h),lr(null,h,b,v),h=h.child),h;case 16:T=h.elementType;e:{switch(u!==null&&(u.alternate=null,h.alternate=null,h.flags|=2),u=h.pendingProps,b=T._init,T=b(T._payload),h.type=T,b=h.tag=IB(T),u=Tr(T,u),b){case 0:h=aS(null,h,T,u,v);break e;case 1:h=xb(null,h,T,u,v);break e;case 11:h=mb(null,h,T,u,v);break e;case 14:h=gb(null,h,T,Tr(T.type,u),v);break e}throw Error(o(306,T,""))}return h;case 0:return T=h.type,b=h.pendingProps,b=h.elementType===T?b:Tr(T,b),aS(u,h,T,b,v);case 1:return T=h.type,b=h.pendingProps,b=h.elementType===T?b:Tr(T,b),xb(u,h,T,b,v);case 3:e:{if(Sb(h),u===null)throw Error(o(387));T=h.pendingProps,N=h.memoizedState,b=N.element,Gd(u,h),Ql(h,T,null,v);var $=h.memoizedState;if(T=$.element,j&&N.isDehydrated)if(N={element:T,isDehydrated:!1,cache:$.cache,transitions:$.transitions},h.updateQueue.baseState=N,h.memoizedState=N,h.flags&256){b=Error(o(423)),h=wb(u,h,T,v,b);break e}else if(T!==b){b=Error(o(424)),h=wb(u,h,T,v,b);break e}else for(j&&(gn=Sa(h.stateNode.containerInfo),mn=h,un=!0,Vi=null,bi=!1),v=HC(h,null,T,v),h.child=v;v;)v.flags=v.flags&-3|4096,v=v.sibling;else{if(Du(),T===b){h=ko(u,h,v);break e}lr(u,h,T,v)}h=h.child}return h;case 5:return GC(h),u===null&&qx(h),T=h.type,b=h.pendingProps,N=u!==null?u.memoizedProps:null,$=b.children,we(T,b)?$=null:N!==null&&we(T,N)&&(h.flags|=32),_b(u,h),lr(u,h,$,v),h.child;case 6:return u===null&&qx(h),null;case 13:return Eb(u,h,v);case 4:return Yx(h,h.stateNode.containerInfo),T=h.pendingProps,u===null?h.child=ku(h,null,T,v):lr(u,h,T,v),h.child;case 11:return T=h.type,b=h.pendingProps,b=h.elementType===T?b:Tr(T,b),mb(u,h,T,b,v);case 7:return lr(u,h,h.pendingProps,v),h.child;case 8:return lr(u,h,h.pendingProps.children,v),h.child;case 12:return lr(u,h,h.pendingProps.children,v),h.child;case 10:e:{if(T=h.type._context,b=h.pendingProps,N=h.memoizedProps,$=b.value,Pu(h,T,$),N!==null)if(Fi(N.value,$)){if(N.children===b.children&&!Mt.current){h=ko(u,h,v);break e}}else for(N=h.child,N!==null&&(N.return=h);N!==null;){var Q=N.dependencies;if(Q!==null){$=N.child;for(var ye=Q.firstContext;ye!==null;){if(ye.context===T){if(N.tag===1){ye=Wr(-1,v&-v),ye.tag=2;var He=N.updateQueue;if(He!==null){He=He.shared;var ct=He.pending;ct===null?ye.next=ye:(ye.next=ct.next,ct.next=ye),He.pending=ye}}N.lanes|=v,ye=N.alternate,ye!==null&&(ye.lanes|=v),Ru(N.return,v,h),Q.lanes|=v;break}ye=ye.next}}else if(N.tag===10)$=N.type===h.type?null:N.child;else if(N.tag===18){if($=N.return,$===null)throw Error(o(341));$.lanes|=v,Q=$.alternate,Q!==null&&(Q.lanes|=v),Ru($,v,h),$=N.sibling}else $=N.child;if($!==null)$.return=N;else for($=N;$!==null;){if($===h){$=null;break}if(N=$.sibling,N!==null){N.return=$.return,$=N;break}$=$.return}N=$}lr(u,h,b.children,v),h=h.child}return h;case 9:return b=h.type,T=h.pendingProps.children,Ps(h,v),b=Mr(b),T=T(b),h.flags|=1,lr(u,h,T,v),h.child;case 14:return T=h.type,b=Tr(T,h.pendingProps),b=Tr(T.type,b),gb(u,h,T,b,v);case 15:return yb(u,h,h.type,h.pendingProps,v);case 17:return T=h.type,b=h.pendingProps,b=h.elementType===T?b:Tr(T,b),u!==null&&(u.alternate=null,h.alternate=null,h.flags|=2),h.tag=1,dn(T)?(u=!0,Zs(h)):u=!1,Ps(h,v),Xd(h,T,b),Ci(h,T,b,v),lS(null,h,T,!0,u,v);case 19:return Cb(u,h,v);case 22:return vb(u,h,v)}throw Error(o(156,h.tag))};function Qb(u,h){return Mu(u,h)}function RB(u,h,v,T){this.tag=u,this.key=v,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=h,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=T,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function fs(u,h,v,T){return new RB(u,h,v,T)}function RS(u){return u=u.prototype,!(!u||!u.isReactComponent)}function IB(u){if(typeof u=="function")return RS(u)?1:0;if(u!=null){if(u=u.$$typeof,u===S)return 11;if(u===E)return 14}return 2}function La(u,h){var v=u.alternate;return v===null?(v=fs(u.tag,h,u.key,u.mode),v.elementType=u.elementType,v.type=u.type,v.stateNode=u.stateNode,v.alternate=u,u.alternate=v):(v.pendingProps=h,v.type=u.type,v.flags=0,v.subtreeFlags=0,v.deletions=null),v.flags=u.flags&14680064,v.childLanes=u.childLanes,v.lanes=u.lanes,v.child=u.child,v.memoizedProps=u.memoizedProps,v.memoizedState=u.memoizedState,v.updateQueue=u.updateQueue,h=u.dependencies,v.dependencies=h===null?null:{lanes:h.lanes,firstContext:h.firstContext},v.sibling=u.sibling,v.index=u.index,v.ref=u.ref,v}function Fg(u,h,v,T,b,N){var $=2;if(T=u,typeof u=="function")RS(u)&&($=1);else if(typeof u=="string")$=5;else e:switch(u){case d:return oc(v.children,b,N,h);case f:$=8,b|=8;break;case p:return u=fs(12,v,h,b|2),u.elementType=p,u.lanes=N,u;case x:return u=fs(13,v,h,b),u.elementType=x,u.lanes=N,u;case y:return u=fs(19,v,h,b),u.elementType=y,u.lanes=N,u;case M:return Vg(v,b,N,h);default:if(typeof u=="object"&&u!==null)switch(u.$$typeof){case m:$=10;break e;case _:$=9;break e;case S:$=11;break e;case E:$=14;break e;case w:$=16,T=null;break e}throw Error(o(130,u==null?u:typeof u,""))}return h=fs($,v,h,b),h.elementType=u,h.type=T,h.lanes=N,h}function oc(u,h,v,T){return u=fs(7,u,T,h),u.lanes=v,u}function Vg(u,h,v,T){return u=fs(22,u,T,h),u.elementType=M,u.lanes=v,u.stateNode={},u}function IS(u,h,v){return u=fs(6,u,null,h),u.lanes=v,u}function LS(u,h,v){return h=fs(4,u.children!==null?u.children:[],u.key,h),h.lanes=v,h.stateNode={containerInfo:u.containerInfo,pendingChildren:null,implementation:u.implementation},h}function LB(u,h,v,T,b){this.tag=h,this.containerInfo=u,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=dt,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Fd(0),this.expirationTimes=Fd(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Fd(0),this.identifierPrefix=T,this.onRecoverableError=b,j&&(this.mutableSourceEagerHydrationData=null)}function Jb(u,h,v,T,b,N,$,Q,ye){return u=new LB(u,h,v,Q,ye),h===1?(h=1,N===!0&&(h|=8)):h=0,N=fs(3,null,null,h),u.current=N,N.stateNode=u,N.memoizedState={element:T,isDehydrated:v,cache:null,transitions:null},Iu(N),u}function Zb(u){if(!u)return ot;u=u._reactInternals;e:{if(D(u)!==u||u.tag!==1)throw Error(o(170));var h=u;do{switch(h.tag){case 3:h=h.stateNode.context;break e;case 1:if(dn(h.type)){h=h.stateNode.__reactInternalMemoizedMergedChildContext;break e}}h=h.return}while(h!==null);throw Error(o(171))}if(u.tag===1){var v=u.type;if(dn(v))return Er(u,v,h)}return h}function eP(u){var h=u._reactInternals;if(h===void 0)throw typeof u.render=="function"?Error(o(188)):(u=Object.keys(u).join(","),Error(o(268,u)));return u=V(h),u===null?null:u.stateNode}function tP(u,h){if(u=u.memoizedState,u!==null&&u.dehydrated!==null){var v=u.retryLane;u.retryLane=v!==0&&v=He&&N>=Nt&&b<=ct&&$<=wt){u.splice(h,1);break}else if(T!==He||v.width!==ye.width||wt$){if(!(N!==Nt||v.height!==ye.height||ctb)){He>T&&(ye.width+=He-T,ye.x=T),ctN&&(ye.height+=Nt-N,ye.y=N),wt<$&&(ye.height=$-Nt),u.splice(h,1);break}}}return u},t.findHostInstance=eP,t.findHostInstanceWithNoPortals=function(u){return u=R(u),u=u!==null?se(u):null,u===null?null:u.stateNode},t.findHostInstanceWithWarning=function(u){return eP(u)},t.flushControlled=function(u){var h=Xt;Xt|=1;var v=Jn.transition,T=Ht;try{Jn.transition=null,Ht=1,u()}finally{Ht=T,Jn.transition=v,Xt=h,Xt===0&&(zu(),Hr())}},t.flushPassiveEffects=sc,t.flushSync=Gb,t.focusWithin=function(u,h){if(!X)throw Error(o(363));for(u=gS(u),h=Bb(u,h),h=Array.from(h),u=0;uv&&(v=$)),$ES&&(h.flags|=128,T=!0,rf(b,!1),h.lanes=4194304)}else{if(!T)if(u=lg(N),u!==null){if(h.flags|=128,T=!0,u=u.updateQueue,u!==null&&(h.updateQueue=u,h.flags|=4),rf(b,!0),b.tail===null&&b.tailMode==="hidden"&&!N.alternate&&!un)return Hi(h),null}else 2*oi()-b.renderingStartTime>ES&&v!==1073741824&&(h.flags|=128,T=!0,rf(b,!1),h.lanes=4194304);b.isBackwards?(N.sibling=h.child,h.child=N):(u=b.last,u!==null?u.sibling=N:h.child=N,b.last=N)}return b.tail!==null?(h=b.tail,b.rendering=h,b.tail=h.sibling,b.renderingStartTime=oi(),h.sibling=null,u=Un.current,mt(Un,T?u&1|2:u&1),h):(Hi(h),null);case 22:case 23:return bS(),T=h.memoizedState!==null,u!==null&&u.memoizedState!==null!==T&&(h.flags|=8192),T&&h.mode&1?Xr&1073741824&&(Hi(h),ke&&h.subtreeFlags&6&&(h.flags|=8192)):Hi(h),null;case 24:return null;case 25:return null}throw Error(o(156,h.tag))}var gB=a.ReactCurrentOwner,jr=!1;function lr(u,h,v,T){h.child=u===null?HC(h,null,v,T):ku(h,u.child,v,T)}function mb(u,h,v,T,b){v=v.render;var N=h.ref;return Ps(h,b),T=eS(u,h,v,T,N,b),v=tS(),u!==null&&!jr?(h.updateQueue=u.updateQueue,h.flags&=-2053,u.lanes&=~b,ko(u,h,b)):(un&&v&&Qn(h),h.flags|=1,lr(u,h,T,b),h.child)}function gb(u,h,v,T,b){if(u===null){var N=v.type;return typeof N=="function"&&!RS(N)&&N.defaultProps===void 0&&v.compare===null&&v.defaultProps===void 0?(h.tag=15,h.type=N,yb(u,h,N,T,b)):(u=Fg(v.type,null,T,h,h.mode,b),u.ref=h.ref,u.return=h,h.child=u)}if(N=u.child,!(u.lanes&b)){var $=N.memoizedProps;if(v=v.compare,v=v!==null?v:ql,v($,T)&&u.ref===h.ref)return ko(u,h,b)}return h.flags|=1,u=La(N,T),u.ref=h.ref,u.return=h,h.child=u}function yb(u,h,v,T,b){if(u!==null&&ql(u.memoizedProps,T)&&u.ref===h.ref)if(jr=!1,(u.lanes&b)!==0)u.flags&131072&&(jr=!0);else return h.lanes=u.lanes,ko(u,h,b);return aS(u,h,v,T,b)}function vb(u,h,v){var T=h.pendingProps,b=T.children,N=u!==null?u.memoizedState:null;if(T.mode==="hidden")if(!(h.mode&1))h.memoizedState={baseLanes:0,cachePool:null},mt(Vu,Xr),Xr|=v;else if(v&1073741824)h.memoizedState={baseLanes:0,cachePool:null},T=N!==null?N.baseLanes:v,mt(Vu,Xr),Xr|=T;else return u=N!==null?N.baseLanes|v:v,h.lanes=h.childLanes=1073741824,h.memoizedState={baseLanes:u,cachePool:null},h.updateQueue=null,mt(Vu,Xr),Xr|=u,null;else N!==null?(T=N.baseLanes|v,h.memoizedState=null):T=v,mt(Vu,Xr),Xr|=T;return lr(u,h,b,v),h.child}function _b(u,h){var v=h.ref;(u===null&&v!==null||u!==null&&u.ref!==v)&&(h.flags|=512,h.flags|=2097152)}function aS(u,h,v,T,b){var N=dn(v)?Gn:qt.current;return N=Ui(h,N),Ps(h,b),v=eS(u,h,v,T,N,b),T=tS(),u!==null&&!jr?(h.updateQueue=u.updateQueue,h.flags&=-2053,u.lanes&=~b,ko(u,h,b)):(un&&T&&Qn(h),h.flags|=1,lr(u,h,v,b),h.child)}function xb(u,h,v,T,b){if(dn(v)){var N=!0;Zs(h)}else N=!1;if(Ps(h,b),h.stateNode===null)u!==null&&(u.alternate=null,h.alternate=null,h.flags|=2),Xd(h,v,T),Ci(h,v,T,b),T=!0;else if(u===null){var $=h.stateNode,Q=h.memoizedProps;$.props=Q;var ye=$.context,He=v.contextType;typeof He=="object"&&He!==null?He=Mr(He):(He=dn(v)?Gn:qt.current,He=Ui(h,He));var ct=v.getDerivedStateFromProps,Nt=typeof ct=="function"||typeof $.getSnapshotBeforeUpdate=="function";Nt||typeof $.UNSAFE_componentWillReceiveProps!="function"&&typeof $.componentWillReceiveProps!="function"||(Q!==T||ye!==He)&&Zl(h,$,T,He),Cr=!1;var wt=h.memoizedState;$.state=wt,Ql(h,T,$,b),ye=h.memoizedState,Q!==T||wt!==ye||Mt.current||Cr?(typeof ct=="function"&&(Lu(h,v,ct,T),ye=h.memoizedState),(Q=Cr||jd(h,v,Q,T,wt,ye,He))?(Nt||typeof $.UNSAFE_componentWillMount!="function"&&typeof $.componentWillMount!="function"||(typeof $.componentWillMount=="function"&&$.componentWillMount(),typeof $.UNSAFE_componentWillMount=="function"&&$.UNSAFE_componentWillMount()),typeof $.componentDidMount=="function"&&(h.flags|=4194308)):(typeof $.componentDidMount=="function"&&(h.flags|=4194308),h.memoizedProps=T,h.memoizedState=ye),$.props=T,$.state=ye,$.context=He,T=Q):(typeof $.componentDidMount=="function"&&(h.flags|=4194308),T=!1)}else{$=h.stateNode,Gd(u,h),Q=h.memoizedProps,He=h.type===h.elementType?Q:Tr(h.type,Q),$.props=He,Nt=h.pendingProps,wt=$.context,ye=v.contextType,typeof ye=="object"&&ye!==null?ye=Mr(ye):(ye=dn(v)?Gn:qt.current,ye=Ui(h,ye));var xn=v.getDerivedStateFromProps;(ct=typeof xn=="function"||typeof $.getSnapshotBeforeUpdate=="function")||typeof $.UNSAFE_componentWillReceiveProps!="function"&&typeof $.componentWillReceiveProps!="function"||(Q!==Nt||wt!==ye)&&Zl(h,$,T,ye),Cr=!1,wt=h.memoizedState,$.state=wt,Ql(h,T,$,b);var yt=h.memoizedState;Q!==Nt||wt!==yt||Mt.current||Cr?(typeof xn=="function"&&(Lu(h,v,xn,T),yt=h.memoizedState),(He=Cr||jd(h,v,He,T,wt,yt,ye)||!1)?(ct||typeof $.UNSAFE_componentWillUpdate!="function"&&typeof $.componentWillUpdate!="function"||(typeof $.componentWillUpdate=="function"&&$.componentWillUpdate(T,yt,ye),typeof $.UNSAFE_componentWillUpdate=="function"&&$.UNSAFE_componentWillUpdate(T,yt,ye)),typeof $.componentDidUpdate=="function"&&(h.flags|=4),typeof $.getSnapshotBeforeUpdate=="function"&&(h.flags|=1024)):(typeof $.componentDidUpdate!="function"||Q===u.memoizedProps&&wt===u.memoizedState||(h.flags|=4),typeof $.getSnapshotBeforeUpdate!="function"||Q===u.memoizedProps&&wt===u.memoizedState||(h.flags|=1024),h.memoizedProps=T,h.memoizedState=yt),$.props=T,$.state=yt,$.context=ye,T=He):(typeof $.componentDidUpdate!="function"||Q===u.memoizedProps&&wt===u.memoizedState||(h.flags|=4),typeof $.getSnapshotBeforeUpdate!="function"||Q===u.memoizedProps&&wt===u.memoizedState||(h.flags|=1024),T=!1)}return lS(u,h,v,T,N,b)}function lS(u,h,v,T,b,N){_b(u,h);var $=(h.flags&128)!==0;if(!T&&!$)return b&&On(h,v,!1),ko(u,h,N);T=h.stateNode,gB.current=h;var Q=$&&typeof v.getDerivedStateFromError!="function"?null:T.render();return h.flags|=1,u!==null&&$?(h.child=ku(h,u.child,null,N),h.child=ku(h,null,Q,N)):lr(u,h,Q,N),h.memoizedState=T.state,b&&On(h,v,!0),h.child}function Sb(u){var h=u.stateNode;h.pendingContext?_n(u,h.pendingContext,h.pendingContext!==h.context):h.context&&_n(u,h.context,!1),Yx(u,h.containerInfo)}function wb(u,h,v,T,b){return Du(),$x(b),h.flags|=256,lr(u,h,v,T),h.child}var vg={dehydrated:null,treeContext:null,retryLane:0};function _g(u){return{baseLanes:u,cachePool:null}}function Eb(u,h,v){var T=h.pendingProps,b=Un.current,N=!1,$=(h.flags&128)!==0,Q;if((Q=$)||(Q=u!==null&&u.memoizedState===null?!1:(b&2)!==0),Q?(N=!0,h.flags&=-129):(u===null||u.memoizedState!==null)&&(b|=1),mt(Un,b&1),u===null)return qx(h),u=h.memoizedState,u!==null&&(u=u.dehydrated,u!==null)?(h.mode&1?os(u)?h.lanes=8:h.lanes=1073741824:h.lanes=1,null):(b=T.children,u=T.fallback,N?(T=h.mode,N=h.child,b={mode:"hidden",children:b},!(T&1)&&N!==null?(N.childLanes=0,N.pendingProps=b):N=Vg(b,T,0,null),u=oc(u,T,v,null),N.return=h,u.return=h,N.sibling=u,h.child=N,h.child.memoizedState=_g(v),h.memoizedState=vg,u):cS(h,b));if(b=u.memoizedState,b!==null){if(Q=b.dehydrated,Q!==null){if($)return h.flags&256?(h.flags&=-257,xg(u,h,v,Error(o(422)))):h.memoizedState!==null?(h.child=u.child,h.flags|=128,null):(N=T.fallback,b=h.mode,T=Vg({mode:"visible",children:T.children},b,0,null),N=oc(N,b,v,null),N.flags|=2,T.return=h,N.return=h,T.sibling=N,h.child=T,h.mode&1&&ku(h,u.child,null,v),h.child.memoizedState=_g(v),h.memoizedState=vg,N);if(!(h.mode&1))h=xg(u,h,v,null);else if(os(Q))h=xg(u,h,v,Error(o(419)));else if(T=(v&u.childLanes)!==0,jr||T){if(T=ai,T!==null){switch(v&-v){case 4:N=2;break;case 16:N=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:N=32;break;case 536870912:N=268435456;break;default:N=0}T=N&(T.suspendedLanes|v)?0:N,T!==0&&T!==b.retryLane&&(b.retryLane=T,ds(u,T,-1))}PS(),h=xg(u,h,v,Error(o(421)))}else ss(Q)?(h.flags|=128,h.child=u.child,h=PB.bind(null,u),Eu(Q,h),h=null):(v=b.treeContext,j&&(gn=Tu(Q),mn=h,un=!0,Vi=null,bi=!1,v!==null&&(C[L++]=ne,C[L++]=fe,C[L++]=z,ne=v.id,fe=v.overflow,z=h)),h=cS(h,h.pendingProps.children),h.flags|=4096);return h}return N?(T=Ab(u,h,T.children,T.fallback,v),N=h.child,b=u.child.memoizedState,N.memoizedState=b===null?_g(v):{baseLanes:b.baseLanes|v,cachePool:null},N.childLanes=u.childLanes&~v,h.memoizedState=vg,T):(v=Tb(u,h,T.children,v),h.memoizedState=null,v)}return N?(T=Ab(u,h,T.children,T.fallback,v),N=h.child,b=u.child.memoizedState,N.memoizedState=b===null?_g(v):{baseLanes:b.baseLanes|v,cachePool:null},N.childLanes=u.childLanes&~v,h.memoizedState=vg,T):(v=Tb(u,h,T.children,v),h.memoizedState=null,v)}function cS(u,h){return h=Vg({mode:"visible",children:h},u.mode,0,null),h.return=u,u.child=h}function Tb(u,h,v,T){var b=u.child;return u=b.sibling,v=La(b,{mode:"visible",children:v}),!(h.mode&1)&&(v.lanes=T),v.return=h,v.sibling=null,u!==null&&(T=h.deletions,T===null?(h.deletions=[u],h.flags|=16):T.push(u)),h.child=v}function Ab(u,h,v,T,b){var N=h.mode;u=u.child;var $=u.sibling,Q={mode:"hidden",children:v};return!(N&1)&&h.child!==u?(v=h.child,v.childLanes=0,v.pendingProps=Q,h.deletions=null):(v=La(u,Q),v.subtreeFlags=u.subtreeFlags&14680064),$!==null?T=La($,T):(T=oc(T,N,b,null),T.flags|=2),T.return=h,v.return=h,v.sibling=T,h.child=v,T}function xg(u,h,v,T){return T!==null&&$x(T),ku(h,u.child,null,v),u=cS(h,h.pendingProps.children),u.flags|=2,h.memoizedState=null,u}function Mb(u,h,v){u.lanes|=h;var T=u.alternate;T!==null&&(T.lanes|=h),Ru(u.return,h,v)}function uS(u,h,v,T,b){var N=u.memoizedState;N===null?u.memoizedState={isBackwards:h,rendering:null,renderingStartTime:0,last:T,tail:v,tailMode:b}:(N.isBackwards=h,N.rendering=null,N.renderingStartTime=0,N.last=T,N.tail=v,N.tailMode=b)}function Cb(u,h,v){var T=h.pendingProps,b=T.revealOrder,N=T.tail;if(lr(u,h,T.children,v),T=Un.current,T&2)T=T&1|2,h.flags|=128;else{if(u!==null&&u.flags&128)e:for(u=h.child;u!==null;){if(u.tag===13)u.memoizedState!==null&&Mb(u,v,h);else if(u.tag===19)Mb(u,v,h);else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===h)break e;for(;u.sibling===null;){if(u.return===null||u.return===h)break e;u=u.return}u.sibling.return=u.return,u=u.sibling}T&=1}if(mt(Un,T),!(h.mode&1))h.memoizedState=null;else switch(b){case"forwards":for(v=h.child,b=null;v!==null;)u=v.alternate,u!==null&&lg(u)===null&&(b=v),v=v.sibling;v=b,v===null?(b=h.child,h.child=null):(b=v.sibling,v.sibling=null),uS(h,!1,b,v,N);break;case"backwards":for(v=null,b=h.child,h.child=null;b!==null;){if(u=b.alternate,u!==null&&lg(u)===null){h.child=b;break}u=b.sibling,b.sibling=v,v=b,b=u}uS(h,!0,v,null,N);break;case"together":uS(h,!1,null,null,void 0);break;default:h.memoizedState=null}return h.child}function ko(u,h,v){if(u!==null&&(h.dependencies=u.dependencies),Bu|=h.lanes,!(v&h.childLanes))return null;if(u!==null&&h.child!==u.child)throw Error(o(153));if(h.child!==null){for(u=h.child,v=La(u,u.pendingProps),h.child=v,v.return=h;u.sibling!==null;)u=u.sibling,v=v.sibling=La(u,u.pendingProps),v.return=h;v.sibling=null}return h.child}function yB(u,h,v){switch(h.tag){case 3:Sb(h),Du();break;case 5:GC(h);break;case 1:dn(h.type)&&Zs(h);break;case 4:Yx(h,h.stateNode.containerInfo);break;case 10:Pu(h,h.type._context,h.memoizedProps.value);break;case 13:var T=h.memoizedState;if(T!==null)return T.dehydrated!==null?(mt(Un,Un.current&1),h.flags|=128,null):v&h.child.childLanes?Eb(u,h,v):(mt(Un,Un.current&1),u=ko(u,h,v),u!==null?u.sibling:null);mt(Un,Un.current&1);break;case 19:if(T=(v&h.childLanes)!==0,u.flags&128){if(T)return Cb(u,h,v);h.flags|=128}var b=h.memoizedState;if(b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),mt(Un,Un.current),T)break;return null;case 22:case 23:return h.lanes=0,vb(u,h,v)}return ko(u,h,v)}function vB(u,h){switch(Kt(h),h.tag){case 1:return dn(h.type)&&Js(),u=h.flags,u&65536?(h.flags=u&-65537|128,h):null;case 3:return Uu(),Ot(Mt),Ot(qt),Jx(),u=h.flags,u&65536&&!(u&128)?(h.flags=u&-65537|128,h):null;case 5:return Kx(h),null;case 13:if(Ot(Un),u=h.memoizedState,u!==null&&u.dehydrated!==null){if(h.alternate===null)throw Error(o(340));Du()}return u=h.flags,u&65536?(h.flags=u&-65537|128,h):null;case 19:return Ot(Un),null;case 4:return Uu(),null;case 10:return Ca(h.type._context),null;case 22:case 23:return bS(),null;case 24:return null;default:return null}}var Sg=!1,tc=!1,_B=typeof WeakSet=="function"?WeakSet:Set,Je=null;function wg(u,h){var v=u.ref;if(v!==null)if(typeof v=="function")try{v(null)}catch(T){Rr(u,h,T)}else v.current=null}function hS(u,h,v){try{v()}catch(T){Rr(u,h,T)}}var bb=!1;function xB(u,h){for(J(u.containerInfo),Je=h;Je!==null;)if(u=Je,h=u.child,(u.subtreeFlags&1028)!==0&&h!==null)h.return=u,Je=h;else for(;Je!==null;){u=Je;try{var v=u.alternate;if(u.flags&1024)switch(u.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var T=v.memoizedProps,b=v.memoizedState,N=u.stateNode,$=N.getSnapshotBeforeUpdate(u.elementType===u.type?T:Tr(u.type,T),b);N.__reactInternalSnapshotBeforeUpdate=$}break;case 3:ke&&Xe(u.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(Q){Rr(u,u.return,Q)}if(h=u.sibling,h!==null){h.return=u.return,Je=h;break}Je=u.return}return v=bb,bb=!1,v}function nc(u,h,v){var T=h.updateQueue;if(T=T!==null?T.lastEffect:null,T!==null){var b=T=T.next;do{if((b.tag&u)===u){var N=b.destroy;b.destroy=void 0,N!==void 0&&hS(h,v,N)}b=b.next}while(b!==T)}}function sf(u,h){if(h=h.updateQueue,h=h!==null?h.lastEffect:null,h!==null){var v=h=h.next;do{if((v.tag&u)===u){var T=v.create;v.destroy=T()}v=v.next}while(v!==h)}}function dS(u){var h=u.ref;if(h!==null){var v=u.stateNode;switch(u.tag){case 5:u=ee(v);break;default:u=v}typeof h=="function"?h(u):h.current=u}}function Pb(u,h,v){if(ar&&typeof ar.onCommitFiberUnmount=="function")try{ar.onCommitFiberUnmount(Ro,h)}catch{}switch(h.tag){case 0:case 11:case 14:case 15:if(u=h.updateQueue,u!==null&&(u=u.lastEffect,u!==null)){var T=u=u.next;do{var b=T,N=b.destroy;b=b.tag,N!==void 0&&(b&2||b&4)&&hS(h,v,N),T=T.next}while(T!==u)}break;case 1:if(wg(h,v),u=h.stateNode,typeof u.componentWillUnmount=="function")try{u.props=h.memoizedProps,u.state=h.memoizedState,u.componentWillUnmount()}catch($){Rr(h,v,$)}break;case 5:wg(h,v);break;case 4:ke?kb(u,h,v):xe&&xe&&(h=h.stateNode.containerInfo,v=At(h),It(h,v))}}function Rb(u,h,v){for(var T=h;;)if(Pb(u,T,v),T.child===null||ke&&T.tag===4){if(T===h)break;for(;T.sibling===null;){if(T.return===null||T.return===h)return;T=T.return}T.sibling.return=T.return,T=T.sibling}else T.child.return=T,T=T.child}function Ib(u){var h=u.alternate;h!==null&&(u.alternate=null,Ib(h)),u.child=null,u.deletions=null,u.sibling=null,u.tag===5&&(h=u.stateNode,h!==null&&Ue(h)),u.stateNode=null,u.return=null,u.dependencies=null,u.memoizedProps=null,u.memoizedState=null,u.pendingProps=null,u.stateNode=null,u.updateQueue=null}function Lb(u){return u.tag===5||u.tag===3||u.tag===4}function Nb(u){e:for(;;){for(;u.sibling===null;){if(u.return===null||Lb(u.return))return null;u=u.return}for(u.sibling.return=u.return,u=u.sibling;u.tag!==5&&u.tag!==6&&u.tag!==18;){if(u.flags&2||u.child===null||u.tag===4)continue e;u.child.return=u,u=u.child}if(!(u.flags&2))return u.stateNode}}function Db(u){if(ke){e:{for(var h=u.return;h!==null;){if(Lb(h))break e;h=h.return}throw Error(o(160))}var v=h;switch(v.tag){case 5:h=v.stateNode,v.flags&32&&(je(h),v.flags&=-33),v=Nb(u),pS(u,v,h);break;case 3:case 4:h=v.stateNode.containerInfo,v=Nb(u),fS(u,v,h);break;default:throw Error(o(161))}}}function fS(u,h,v){var T=u.tag;if(T===5||T===6)u=u.stateNode,h?et(v,u,h):Lt(v,u);else if(T!==4&&(u=u.child,u!==null))for(fS(u,h,v),u=u.sibling;u!==null;)fS(u,h,v),u=u.sibling}function pS(u,h,v){var T=u.tag;if(T===5||T===6)u=u.stateNode,h?vt(v,u,h):Ge(v,u);else if(T!==4&&(u=u.child,u!==null))for(pS(u,h,v),u=u.sibling;u!==null;)pS(u,h,v),u=u.sibling}function kb(u,h,v){for(var T=h,b=!1,N,$;;){if(!b){b=T.return;e:for(;;){if(b===null)throw Error(o(160));switch(N=b.stateNode,b.tag){case 5:$=!1;break e;case 3:N=N.containerInfo,$=!0;break e;case 4:N=N.containerInfo,$=!0;break e}b=b.return}b=!0}if(T.tag===5||T.tag===6)Rb(u,T,v),$?ve(N,T.stateNode):K(N,T.stateNode);else if(T.tag===18)$?de(N,T.stateNode):ce(N,T.stateNode);else if(T.tag===4){if(T.child!==null){N=T.stateNode.containerInfo,$=!0,T.child.return=T,T=T.child;continue}}else if(Pb(u,T,v),T.child!==null){T.child.return=T,T=T.child;continue}if(T===h)break;for(;T.sibling===null;){if(T.return===null||T.return===h)return;T=T.return,T.tag===4&&(b=!1)}T.sibling.return=T.return,T=T.sibling}}function mS(u,h){if(ke){switch(h.tag){case 0:case 11:case 14:case 15:nc(3,h,h.return),sf(3,h),nc(5,h,h.return);return;case 1:return;case 5:var v=h.stateNode;if(v!=null){var T=h.memoizedProps;u=u!==null?u.memoizedProps:T;var b=h.type,N=h.updateQueue;h.updateQueue=null,N!==null&&Et(v,N,b,u,T,h)}return;case 6:if(h.stateNode===null)throw Error(o(162));v=h.memoizedProps,Le(h.stateNode,u!==null?u.memoizedProps:v,v);return;case 3:j&&u!==null&&u.memoizedState.isDehydrated&&H(h.stateNode.containerInfo);return;case 12:return;case 13:Eg(h);return;case 19:Eg(h);return;case 17:return}throw Error(o(163))}switch(h.tag){case 0:case 11:case 14:case 15:nc(3,h,h.return),sf(3,h),nc(5,h,h.return);return;case 12:return;case 13:Eg(h);return;case 19:Eg(h);return;case 3:j&&u!==null&&u.memoizedState.isDehydrated&&H(h.stateNode.containerInfo);break;case 22:case 23:return}e:if(xe){switch(h.tag){case 1:case 5:case 6:break e;case 3:case 4:h=h.stateNode,It(h.containerInfo,h.pendingChildren);break e}throw Error(o(163))}}function Eg(u){var h=u.updateQueue;if(h!==null){u.updateQueue=null;var v=u.stateNode;v===null&&(v=u.stateNode=new _B),h.forEach(function(T){var b=RB.bind(null,u,T);v.has(T)||(v.add(T),T.then(b,b))})}}function SB(u,h){for(Je=h;Je!==null;){h=Je;var v=h.deletions;if(v!==null)for(var T=0;T";case Ag:return":has("+(vS(u)||"")+")";case Mg:return'[role="'+u.value+'"]';case bg:return'"'+u.value+'"';case Cg:return'[data-testname="'+u.value+'"]';default:throw Error(o(365))}}function Bb(u,h){var v=[];u=[u,0];for(var T=0;Tb&&(b=$),T&=~N}if(T=b,T=oi()-T,T=(120>T?120:480>T?480:1080>T?1080:1920>T?1920:3e3>T?3e3:4320>T?4320:1960*EB(T/1960))-T,10u?16:u,Pa===null)var T=!1;else{if(u=Pa,Pa=null,Ng=0,Xt&6)throw Error(o(331));var b=Xt;for(Xt|=4,Je=u.current;Je!==null;){var N=Je,$=N.child;if(Je.flags&16){var Q=N.deletions;if(Q!==null){for(var ye=0;yeoi()-wS?ic(u,0):SS|=v),Pr(u,h)}function Yb(u,h){h===0&&(u.mode&1?(h=bo,bo<<=1,!(bo&130023424)&&(bo=4194304)):h=1);var v=cr();u=Og(u,h),u!==null&&(jl(u,h,v),Pr(u,v))}function PB(u){var h=u.memoizedState,v=0;h!==null&&(v=h.retryLane),Yb(u,v)}function RB(u,h){var v=0;switch(u.tag){case 13:var T=u.stateNode,b=u.memoizedState;b!==null&&(v=b.retryLane);break;case 19:T=u.stateNode;break;default:throw Error(o(314))}T!==null&&T.delete(h),Yb(u,v)}var Kb;Kb=function(u,h,v){if(u!==null)if(u.memoizedProps!==h.pendingProps||Mt.current)jr=!0;else{if(!(u.lanes&v)&&!(h.flags&128))return jr=!1,yB(u,h,v);jr=!!(u.flags&131072)}else jr=!1,un&&h.flags&1048576&&pn(h,g,h.index);switch(h.lanes=0,h.tag){case 2:var T=h.type;u!==null&&(u.alternate=null,h.alternate=null,h.flags|=2),u=h.pendingProps;var b=Ui(h,qt.current);Ps(h,v),b=eS(null,h,T,u,b,v);var N=tS();return h.flags|=1,typeof b=="object"&&b!==null&&typeof b.render=="function"&&b.$$typeof===void 0?(h.tag=1,h.memoizedState=null,h.updateQueue=null,dn(T)?(N=!0,Zs(h)):N=!1,h.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,Iu(h),b.updater=Jl,h.stateNode=b,b._reactInternals=h,Ci(h,T,u,v),h=lS(null,h,T,!0,N,v)):(h.tag=0,un&&N&&Qn(h),lr(null,h,b,v),h=h.child),h;case 16:T=h.elementType;e:{switch(u!==null&&(u.alternate=null,h.alternate=null,h.flags|=2),u=h.pendingProps,b=T._init,T=b(T._payload),h.type=T,b=h.tag=LB(T),u=Tr(T,u),b){case 0:h=aS(null,h,T,u,v);break e;case 1:h=xb(null,h,T,u,v);break e;case 11:h=mb(null,h,T,u,v);break e;case 14:h=gb(null,h,T,Tr(T.type,u),v);break e}throw Error(o(306,T,""))}return h;case 0:return T=h.type,b=h.pendingProps,b=h.elementType===T?b:Tr(T,b),aS(u,h,T,b,v);case 1:return T=h.type,b=h.pendingProps,b=h.elementType===T?b:Tr(T,b),xb(u,h,T,b,v);case 3:e:{if(Sb(h),u===null)throw Error(o(387));T=h.pendingProps,N=h.memoizedState,b=N.element,Gd(u,h),Ql(h,T,null,v);var $=h.memoizedState;if(T=$.element,j&&N.isDehydrated)if(N={element:T,isDehydrated:!1,cache:$.cache,transitions:$.transitions},h.updateQueue.baseState=N,h.memoizedState=N,h.flags&256){b=Error(o(423)),h=wb(u,h,T,v,b);break e}else if(T!==b){b=Error(o(424)),h=wb(u,h,T,v,b);break e}else for(j&&(gn=Sa(h.stateNode.containerInfo),mn=h,un=!0,Vi=null,bi=!1),v=HC(h,null,T,v),h.child=v;v;)v.flags=v.flags&-3|4096,v=v.sibling;else{if(Du(),T===b){h=ko(u,h,v);break e}lr(u,h,T,v)}h=h.child}return h;case 5:return GC(h),u===null&&qx(h),T=h.type,b=h.pendingProps,N=u!==null?u.memoizedProps:null,$=b.children,we(T,b)?$=null:N!==null&&we(T,N)&&(h.flags|=32),_b(u,h),lr(u,h,$,v),h.child;case 6:return u===null&&qx(h),null;case 13:return Eb(u,h,v);case 4:return Yx(h,h.stateNode.containerInfo),T=h.pendingProps,u===null?h.child=ku(h,null,T,v):lr(u,h,T,v),h.child;case 11:return T=h.type,b=h.pendingProps,b=h.elementType===T?b:Tr(T,b),mb(u,h,T,b,v);case 7:return lr(u,h,h.pendingProps,v),h.child;case 8:return lr(u,h,h.pendingProps.children,v),h.child;case 12:return lr(u,h,h.pendingProps.children,v),h.child;case 10:e:{if(T=h.type._context,b=h.pendingProps,N=h.memoizedProps,$=b.value,Pu(h,T,$),N!==null)if(Fi(N.value,$)){if(N.children===b.children&&!Mt.current){h=ko(u,h,v);break e}}else for(N=h.child,N!==null&&(N.return=h);N!==null;){var Q=N.dependencies;if(Q!==null){$=N.child;for(var ye=Q.firstContext;ye!==null;){if(ye.context===T){if(N.tag===1){ye=Wr(-1,v&-v),ye.tag=2;var He=N.updateQueue;if(He!==null){He=He.shared;var ct=He.pending;ct===null?ye.next=ye:(ye.next=ct.next,ct.next=ye),He.pending=ye}}N.lanes|=v,ye=N.alternate,ye!==null&&(ye.lanes|=v),Ru(N.return,v,h),Q.lanes|=v;break}ye=ye.next}}else if(N.tag===10)$=N.type===h.type?null:N.child;else if(N.tag===18){if($=N.return,$===null)throw Error(o(341));$.lanes|=v,Q=$.alternate,Q!==null&&(Q.lanes|=v),Ru($,v,h),$=N.sibling}else $=N.child;if($!==null)$.return=N;else for($=N;$!==null;){if($===h){$=null;break}if(N=$.sibling,N!==null){N.return=$.return,$=N;break}$=$.return}N=$}lr(u,h,b.children,v),h=h.child}return h;case 9:return b=h.type,T=h.pendingProps.children,Ps(h,v),b=Mr(b),T=T(b),h.flags|=1,lr(u,h,T,v),h.child;case 14:return T=h.type,b=Tr(T,h.pendingProps),b=Tr(T.type,b),gb(u,h,T,b,v);case 15:return yb(u,h,h.type,h.pendingProps,v);case 17:return T=h.type,b=h.pendingProps,b=h.elementType===T?b:Tr(T,b),u!==null&&(u.alternate=null,h.alternate=null,h.flags|=2),h.tag=1,dn(T)?(u=!0,Zs(h)):u=!1,Ps(h,v),Xd(h,T,b),Ci(h,T,b,v),lS(null,h,T,!0,u,v);case 19:return Cb(u,h,v);case 22:return vb(u,h,v)}throw Error(o(156,h.tag))};function Qb(u,h){return Mu(u,h)}function IB(u,h,v,T){this.tag=u,this.key=v,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=h,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=T,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function fs(u,h,v,T){return new IB(u,h,v,T)}function RS(u){return u=u.prototype,!(!u||!u.isReactComponent)}function LB(u){if(typeof u=="function")return RS(u)?1:0;if(u!=null){if(u=u.$$typeof,u===S)return 11;if(u===E)return 14}return 2}function La(u,h){var v=u.alternate;return v===null?(v=fs(u.tag,h,u.key,u.mode),v.elementType=u.elementType,v.type=u.type,v.stateNode=u.stateNode,v.alternate=u,u.alternate=v):(v.pendingProps=h,v.type=u.type,v.flags=0,v.subtreeFlags=0,v.deletions=null),v.flags=u.flags&14680064,v.childLanes=u.childLanes,v.lanes=u.lanes,v.child=u.child,v.memoizedProps=u.memoizedProps,v.memoizedState=u.memoizedState,v.updateQueue=u.updateQueue,h=u.dependencies,v.dependencies=h===null?null:{lanes:h.lanes,firstContext:h.firstContext},v.sibling=u.sibling,v.index=u.index,v.ref=u.ref,v}function Fg(u,h,v,T,b,N){var $=2;if(T=u,typeof u=="function")RS(u)&&($=1);else if(typeof u=="string")$=5;else e:switch(u){case d:return oc(v.children,b,N,h);case f:$=8,b|=8;break;case p:return u=fs(12,v,h,b|2),u.elementType=p,u.lanes=N,u;case x:return u=fs(13,v,h,b),u.elementType=x,u.lanes=N,u;case y:return u=fs(19,v,h,b),u.elementType=y,u.lanes=N,u;case M:return Vg(v,b,N,h);default:if(typeof u=="object"&&u!==null)switch(u.$$typeof){case m:$=10;break e;case _:$=9;break e;case S:$=11;break e;case E:$=14;break e;case w:$=16,T=null;break e}throw Error(o(130,u==null?u:typeof u,""))}return h=fs($,v,h,b),h.elementType=u,h.type=T,h.lanes=N,h}function oc(u,h,v,T){return u=fs(7,u,T,h),u.lanes=v,u}function Vg(u,h,v,T){return u=fs(22,u,T,h),u.elementType=M,u.lanes=v,u.stateNode={},u}function IS(u,h,v){return u=fs(6,u,null,h),u.lanes=v,u}function LS(u,h,v){return h=fs(4,u.children!==null?u.children:[],u.key,h),h.lanes=v,h.stateNode={containerInfo:u.containerInfo,pendingChildren:null,implementation:u.implementation},h}function NB(u,h,v,T,b){this.tag=h,this.containerInfo=u,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=dt,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Fd(0),this.expirationTimes=Fd(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Fd(0),this.identifierPrefix=T,this.onRecoverableError=b,j&&(this.mutableSourceEagerHydrationData=null)}function Jb(u,h,v,T,b,N,$,Q,ye){return u=new NB(u,h,v,Q,ye),h===1?(h=1,N===!0&&(h|=8)):h=0,N=fs(3,null,null,h),u.current=N,N.stateNode=u,N.memoizedState={element:T,isDehydrated:v,cache:null,transitions:null},Iu(N),u}function Zb(u){if(!u)return ot;u=u._reactInternals;e:{if(D(u)!==u||u.tag!==1)throw Error(o(170));var h=u;do{switch(h.tag){case 3:h=h.stateNode.context;break e;case 1:if(dn(h.type)){h=h.stateNode.__reactInternalMemoizedMergedChildContext;break e}}h=h.return}while(h!==null);throw Error(o(171))}if(u.tag===1){var v=u.type;if(dn(v))return Er(u,v,h)}return h}function eP(u){var h=u._reactInternals;if(h===void 0)throw typeof u.render=="function"?Error(o(188)):(u=Object.keys(u).join(","),Error(o(268,u)));return u=V(h),u===null?null:u.stateNode}function tP(u,h){if(u=u.memoizedState,u!==null&&u.dehydrated!==null){var v=u.retryLane;u.retryLane=v!==0&&v=He&&N>=Nt&&b<=ct&&$<=wt){u.splice(h,1);break}else if(T!==He||v.width!==ye.width||wt$){if(!(N!==Nt||v.height!==ye.height||ctb)){He>T&&(ye.width+=He-T,ye.x=T),ctN&&(ye.height+=Nt-N,ye.y=N),wt<$&&(ye.height=$-Nt),u.splice(h,1);break}}}return u},t.findHostInstance=eP,t.findHostInstanceWithNoPortals=function(u){return u=R(u),u=u!==null?se(u):null,u===null?null:u.stateNode},t.findHostInstanceWithWarning=function(u){return eP(u)},t.flushControlled=function(u){var h=Xt;Xt|=1;var v=Jn.transition,T=Ht;try{Jn.transition=null,Ht=1,u()}finally{Ht=T,Jn.transition=v,Xt=h,Xt===0&&(zu(),Hr())}},t.flushPassiveEffects=sc,t.flushSync=Gb,t.focusWithin=function(u,h){if(!X)throw Error(o(363));for(u=gS(u),h=Bb(u,h),h=Array.from(h),u=0;uv&&(v=$)),$ ")+` No matching component was found for: - `)+u.join(" > ")}return null},t.getPublicRootInstance=function(u){if(u=u.current,!u.child)return null;switch(u.child.tag){case 5:return ee(u.child.stateNode);default:return u.child.stateNode}},t.injectIntoDevTools=function(u){if(u={bundleType:u.bundleType,version:u.version,rendererPackageName:u.rendererPackageName,rendererConfig:u.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:a.ReactCurrentDispatcher,findHostInstanceByFiber:NB,findFiberByHostInstance:u.findFiberByHostInstance||DB,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")u=!1;else{var h=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(h.isDisabled||!h.supportsFiber)u=!0;else{try{Ro=h.inject(u),ar=h}catch{}u=!!h.checkDCE}}return u},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(u,h,v,T){if(!X)throw Error(o(363));u=_S(u,h);var b=Ce(u,v,T).disconnect;return{disconnect:function(){b()}}},t.registerMutableSourceForHydration=function(u,h){var v=h._getVersion;v=v(h._source),u.mutableSourceEagerHydrationData==null?u.mutableSourceEagerHydrationData=[h,v]:u.mutableSourceEagerHydrationData.push(h,v)},t.runWithPriority=function(u,h){var v=Ht;try{return Ht=u,h()}finally{Ht=v}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(u,h,v,T){var b=h.current,N=cr(),$=Ra(b);return v=Zb(v),h.context===null?h.context=v:h.pendingContext=v,h=Wr(N,$),h.payload={element:u},T=T===void 0?null:T,T!==null&&(h.callback=T),cs(b,h),u=ds(b,$,N),u!==null&&Yl(u,b,$),$},t};r4.exports=sie;var oie=r4.exports;const aie=kT(oie),TC={},lie=n=>void Object.assign(TC,n);function cie(n,e){function t(d,{args:f=[],attach:p,...m},_){let S=`${d[0].toUpperCase()}${d.slice(1)}`,x;if(d==="primitive"){if(m.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const y=m.object;x=hh(y,{type:d,root:_,attach:p,primitive:!0})}else{const y=TC[S];if(!y)throw new Error(`R3F: ${S} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(!Array.isArray(f))throw new Error("R3F: The args prop must be an array!");x=hh(new y(...f),{type:d,root:_,attach:p,memoizedProps:{args:f}})}return x.__r3f.attach===void 0&&(x instanceof Vt?x.__r3f.attach="geometry":x instanceof Oi&&(x.__r3f.attach="material")),S!=="inject"&&S1(x,m),x}function i(d,f){let p=!1;if(f){var m,_;(m=f.__r3f)!=null&&m.attach?x1(d,f,f.__r3f.attach):f.isObject3D&&d.isObject3D&&(d.add(f),p=!0),p||(_=d.__r3f)==null||_.objects.push(f),f.__r3f||hh(f,{}),f.__r3f.parent=d,PT(f),dh(f)}}function r(d,f,p){let m=!1;if(f){var _,S;if((_=f.__r3f)!=null&&_.attach)x1(d,f,f.__r3f.attach);else if(f.isObject3D&&d.isObject3D){f.parent=d,f.dispatchEvent({type:"added"}),d.dispatchEvent({type:"childadded",child:f});const x=d.children.filter(E=>E!==f),y=x.indexOf(p);d.children=[...x.slice(0,y),f,...x.slice(y)],m=!0}m||(S=d.__r3f)==null||S.objects.push(f),f.__r3f||hh(f,{}),f.__r3f.parent=d,PT(f),dh(f)}}function s(d,f,p=!1){d&&[...d].forEach(m=>o(f,m,p))}function o(d,f,p){if(f){var m,_,S;if(f.__r3f&&(f.__r3f.parent=null),(m=d.__r3f)!=null&&m.objects&&(d.__r3f.objects=d.__r3f.objects.filter(M=>M!==f)),(_=f.__r3f)!=null&&_.attach)sN(d,f,f.__r3f.attach);else if(f.isObject3D&&d.isObject3D){var x;d.remove(f),(x=f.__r3f)!=null&&x.root&&vie(Rv(f),f)}const E=(S=f.__r3f)==null?void 0:S.primitive,w=!E&&(p===void 0?f.dispose!==null:p);if(!E){var y;s((y=f.__r3f)==null?void 0:y.objects,f,w),s(f.children,f,w)}if(delete f.__r3f,w&&f.dispose&&f.type!=="Scene"){const M=()=>{try{f.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT>"u"?CT.unstable_scheduleCallback(CT.unstable_IdlePriority,M):M()}dh(d)}}function a(d,f,p,m){var _;const S=(_=d.__r3f)==null?void 0:_.parent;if(!S)return;const x=t(f,p,d.__r3f.root);if(d.children){for(const y of d.children)y.__r3f&&i(x,y);d.children=d.children.filter(y=>!y.__r3f)}d.__r3f.objects.forEach(y=>i(x,y)),d.__r3f.objects=[],d.__r3f.autoRemovedBeforeAppend||o(S,d),x.parent&&(x.__r3f.autoRemovedBeforeAppend=!0),i(S,x),x.raycast&&x.__r3f.eventCount&&Rv(x).getState().internal.interaction.push(x),[m,m.alternate].forEach(y=>{y!==null&&(y.stateNode=x,y.ref&&(typeof y.ref=="function"?y.ref(x):y.ref.current=x))})}const l=()=>{};return{reconciler:aie({createInstance:t,removeChild:o,appendChild:i,appendInitialChild:i,insertBefore:r,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(d,f)=>{if(!f)return;const p=d.getState().scene;p.__r3f&&(p.__r3f.root=d,i(p,f))},removeChildFromContainer:(d,f)=>{f&&o(d.getState().scene,f)},insertInContainerBefore:(d,f,p)=>{if(!f||!p)return;const m=d.getState().scene;m.__r3f&&r(m,f,p)},getRootHostContext:()=>null,getChildHostContext:d=>d,finalizeInitialChildren(d){var f;return!!((f=d==null?void 0:d.__r3f)!=null?f:{}).handlers},prepareUpdate(d,f,p,m){var _;if(((_=d==null?void 0:d.__r3f)!=null?_:{}).primitive&&m.object&&m.object!==d)return[!0];{const{args:x=[],children:y,...E}=m,{args:w=[],children:M,...O}=p;if(!Array.isArray(x))throw new Error("R3F: the args prop must be an array!");if(x.some((I,P)=>I!==w[P]))return[!0];const k=f4(d,E,O,!0);return k.changes.length?[!1,k]:null}},commitUpdate(d,[f,p],m,_,S,x){f?a(d,m,S,x):S1(d,p)},commitMount(d,f,p,m){var _;const S=(_=d.__r3f)!=null?_:{};d.raycast&&S.handlers&&S.eventCount&&Rv(d).getState().internal.interaction.push(d)},getPublicInstance:d=>d,prepareForCommit:()=>null,preparePortalMount:d=>hh(d.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(d){var f;const{attach:p,parent:m}=(f=d.__r3f)!=null?f:{};p&&m&&sN(m,d,p),d.isObject3D&&(d.visible=!1),dh(d)},unhideInstance(d,f){var p;const{attach:m,parent:_}=(p=d.__r3f)!=null?p:{};m&&_&&x1(_,d,m),(d.isObject3D&&f.visible==null||f.visible)&&(d.visible=!0),dh(d)},createTextInstance:l,hideTextInstance:l,unhideTextInstance:l,getCurrentEventPriority:()=>e?e():kh.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&Tn.fun(performance.now)?performance.now:Tn.fun(Date.now)?Date.now:()=>0,scheduleTimeout:Tn.fun(setTimeout)?setTimeout:void 0,cancelTimeout:Tn.fun(clearTimeout)?clearTimeout:void 0}),applyProps:S1}}var tN,nN;const _1=n=>"colorSpace"in n||"outputColorSpace"in n,a4=()=>{var n;return(n=TC.ColorManagement)!=null?n:null},l4=n=>n&&n.isOrthographicCamera,uie=n=>n&&n.hasOwnProperty("current"),Km=typeof window<"u"&&((tN=window.document)!=null&&tN.createElement||((nN=window.navigator)==null?void 0:nN.product)==="ReactNative")?q.useLayoutEffect:q.useEffect;function c4(n){const e=q.useRef(n);return Km(()=>void(e.current=n),[n]),e}function hie({set:n}){return Km(()=>(n(new Promise(()=>null)),()=>n(!1)),[n]),null}class u4 extends q.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}u4.getDerivedStateFromError=()=>({error:!0});const h4="__default",iN=new Map,die=n=>n&&!!n.memoized&&!!n.changes;function d4(n){var e;const t=typeof window<"u"?(e=window.devicePixelRatio)!=null?e:2:1;return Array.isArray(n)?Math.min(Math.max(n[0],t),n[1]):n}const Of=n=>{var e;return(e=n.__r3f)==null?void 0:e.root.getState()};function Rv(n){let e=n.__r3f.root;for(;e.getState().previousRoot;)e=e.getState().previousRoot;return e}const Tn={obj:n=>n===Object(n)&&!Tn.arr(n)&&typeof n!="function",fun:n=>typeof n=="function",str:n=>typeof n=="string",num:n=>typeof n=="number",boo:n=>typeof n=="boolean",und:n=>n===void 0,arr:n=>Array.isArray(n),equ(n,e,{arrays:t="shallow",objects:i="reference",strict:r=!0}={}){if(typeof n!=typeof e||!!n!=!!e)return!1;if(Tn.str(n)||Tn.num(n)||Tn.boo(n))return n===e;const s=Tn.obj(n);if(s&&i==="reference")return n===e;const o=Tn.arr(n);if(o&&t==="reference")return n===e;if((o||s)&&n===e)return!0;let a;for(a in n)if(!(a in e))return!1;if(s&&t==="shallow"&&i==="shallow"){for(a in r?e:n)if(!Tn.equ(n[a],e[a],{strict:r,objects:"reference"}))return!1}else for(a in r?e:n)if(n[a]!==e[a])return!1;if(Tn.und(a)){if(o&&n.length===0&&e.length===0||s&&Object.keys(n).length===0&&Object.keys(e).length===0)return!0;if(n!==e)return!1}return!0}};function fie(n){const e={nodes:{},materials:{}};return n&&n.traverse(t=>{t.name&&(e.nodes[t.name]=t),t.material&&!e.materials[t.material.name]&&(e.materials[t.material.name]=t.material)}),e}function pie(n){n.dispose&&n.type!=="Scene"&&n.dispose();for(const e in n)e.dispose==null||e.dispose(),delete n[e]}function hh(n,e){const t=n;return t.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...e},n}function bT(n,e){let t=n;if(e.includes("-")){const i=e.split("-"),r=i.pop();return t=i.reduce((s,o)=>s[o],n),{target:t,key:r}}else return{target:t,key:e}}const rN=/-\d+$/;function x1(n,e,t){if(Tn.str(t)){if(rN.test(t)){const s=t.replace(rN,""),{target:o,key:a}=bT(n,s);Array.isArray(o[a])||(o[a]=[])}const{target:i,key:r}=bT(n,t);e.__r3f.previousAttach=i[r],i[r]=e}else e.__r3f.previousAttach=t(n,e)}function sN(n,e,t){var i,r;if(Tn.str(t)){const{target:s,key:o}=bT(n,t),a=e.__r3f.previousAttach;a===void 0?delete s[o]:s[o]=a}else(i=e.__r3f)==null||i.previousAttach==null||i.previousAttach(n,e);(r=e.__r3f)==null||delete r.previousAttach}function f4(n,{children:e,key:t,ref:i,...r},{children:s,key:o,ref:a,...l}={},c=!1){const d=n.__r3f,f=Object.entries(r),p=[];if(c){const _=Object.keys(l);for(let S=0;S<_.length;S++)r.hasOwnProperty(_[S])||f.unshift([_[S],h4+"remove"])}f.forEach(([_,S])=>{var x;if((x=n.__r3f)!=null&&x.primitive&&_==="object"||Tn.equ(S,l[_]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(_))return p.push([_,S,!0,[]]);let y=[];_.includes("-")&&(y=_.split("-")),p.push([_,S,!1,y]);for(const E in r){const w=r[E];E.startsWith(`${_}-`)&&p.push([E,w,!1,E.split("-")])}});const m={...r};return d!=null&&d.memoizedProps&&d!=null&&d.memoizedProps.args&&(m.args=d.memoizedProps.args),d!=null&&d.memoizedProps&&d!=null&&d.memoizedProps.attach&&(m.attach=d.memoizedProps.attach),{memoized:m,changes:p}}const mie=typeof process<"u"&&!1;function S1(n,e){var t;const i=n.__r3f,r=i==null?void 0:i.root,s=r==null||r.getState==null?void 0:r.getState(),{memoized:o,changes:a}=die(e)?e:f4(n,e),l=i==null?void 0:i.eventCount;n.__r3f&&(n.__r3f.memoizedProps=o);for(let d=0;dy[E],n),!(x&&x.set))){const[y,...E]=_.reverse();S=E.reverse().reduce((w,M)=>w[M],n),f=y}if(p===h4+"remove")if(S.constructor){let y=iN.get(S.constructor);y||(y=new S.constructor,iN.set(S.constructor,y)),p=y[f]}else p=0;if(m&&i)p?i.handlers[f]=p:delete i.handlers[f],i.eventCount=Object.keys(i.handlers).length;else if(x&&x.set&&(x.copy||x instanceof Kc)){if(Array.isArray(p))x.fromArray?x.fromArray(p):x.set(...p);else if(x.copy&&p&&p.constructor&&(mie?x.constructor.name===p.constructor.name:x.constructor===p.constructor))x.copy(p);else if(p!==void 0){const y=x instanceof rt;!y&&x.setScalar?x.setScalar(p):x instanceof Kc&&p instanceof Kc?x.mask=p.mask:x.set(p),!a4()&&s&&!s.linear&&y&&x.convertSRGBToLinear()}}else if(S[f]=p,S[f]instanceof In&&S[f].format===tr&&S[f].type===js&&s){const y=S[f];_1(y)&&_1(s.gl)?y.colorSpace=s.gl.outputColorSpace:y.encoding=s.gl.outputEncoding}dh(n)}if(i&&i.parent&&n.raycast&&l!==i.eventCount){const d=Rv(n).getState().internal,f=d.interaction.indexOf(n);f>-1&&d.interaction.splice(f,1),i.eventCount&&d.interaction.push(n)}return!(a.length===1&&a[0][0]==="onUpdate")&&a.length&&(t=n.__r3f)!=null&&t.parent&&PT(n),n}function dh(n){var e,t;const i=(e=n.__r3f)==null||(t=e.root)==null||t.getState==null?void 0:t.getState();i&&i.internal.frames===0&&i.invalidate()}function PT(n){n.onUpdate==null||n.onUpdate(n)}function gie(n,e){n.manual||(l4(n)?(n.left=e.width/-2,n.right=e.width/2,n.top=e.height/2,n.bottom=e.height/-2):n.aspect=e.width/e.height,n.updateProjectionMatrix(),n.updateMatrixWorld())}function sv(n){return(n.eventObject||n.object).uuid+"/"+n.index+n.instanceId}function yie(){var n;const e=typeof self<"u"&&self||typeof window<"u"&&window;if(!e)return kh.DefaultEventPriority;switch((n=e.event)==null?void 0:n.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return kh.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return kh.ContinuousEventPriority;default:return kh.DefaultEventPriority}}function p4(n,e,t,i){const r=t.get(e);r&&(t.delete(e),t.size===0&&(n.delete(i),r.target.releasePointerCapture(i)))}function vie(n,e){const{internal:t}=n.getState();t.interaction=t.interaction.filter(i=>i!==e),t.initialHits=t.initialHits.filter(i=>i!==e),t.hovered.forEach((i,r)=>{(i.eventObject===e||i.object===e)&&t.hovered.delete(r)}),t.capturedMap.forEach((i,r)=>{p4(t.capturedMap,e,i,r)})}function _ie(n){function e(l){const{internal:c}=n.getState(),d=l.offsetX-c.initialClick[0],f=l.offsetY-c.initialClick[1];return Math.round(Math.sqrt(d*d+f*f))}function t(l){return l.filter(c=>["Move","Over","Enter","Out","Leave"].some(d=>{var f;return(f=c.__r3f)==null?void 0:f.handlers["onPointer"+d]}))}function i(l,c){const d=n.getState(),f=new Set,p=[],m=c?c(d.internal.interaction):d.internal.interaction;for(let y=0;y{const w=Of(y.object),M=Of(E.object);return!w||!M?y.distance-E.distance:M.events.priority-w.events.priority||y.distance-E.distance}).filter(y=>{const E=sv(y);return f.has(E)?!1:(f.add(E),!0)});d.events.filter&&(S=d.events.filter(S,d));for(const y of S){let E=y.object;for(;E;){var x;(x=E.__r3f)!=null&&x.eventCount&&p.push({...y,eventObject:E}),E=E.parent}}if("pointerId"in l&&d.internal.capturedMap.has(l.pointerId))for(let y of d.internal.capturedMap.get(l.pointerId).values())f.has(sv(y.intersection))||p.push(y.intersection);return p}function r(l,c,d,f){const p=n.getState();if(l.length){const m={stopped:!1};for(const _ of l){const S=Of(_.object)||p,{raycaster:x,pointer:y,camera:E,internal:w}=S,M=new G(y.x,y.y,0).unproject(E),O=A=>{var R,V;return(R=(V=w.capturedMap.get(A))==null?void 0:V.has(_.eventObject))!=null?R:!1},k=A=>{const R={intersection:_,target:c.target};w.capturedMap.has(A)?w.capturedMap.get(A).set(_.eventObject,R):w.capturedMap.set(A,new Map([[_.eventObject,R]])),c.target.setPointerCapture(A)},I=A=>{const R=w.capturedMap.get(A);R&&p4(w.capturedMap,_.eventObject,R,A)};let P={};for(let A in c){let R=c[A];typeof R!="function"&&(P[A]=R)}let D={..._,...P,pointer:y,intersections:l,stopped:m.stopped,delta:d,unprojectedPoint:M,ray:x.ray,camera:E,stopPropagation(){const A="pointerId"in c&&w.capturedMap.get(c.pointerId);if((!A||A.has(_.eventObject))&&(D.stopped=m.stopped=!0,w.hovered.size&&Array.from(w.hovered.values()).find(R=>R.eventObject===_.eventObject))){const R=l.slice(0,l.indexOf(_));s([...R,_])}},target:{hasPointerCapture:O,setPointerCapture:k,releasePointerCapture:I},currentTarget:{hasPointerCapture:O,setPointerCapture:k,releasePointerCapture:I},nativeEvent:c};if(f(D),m.stopped===!0)break}}return l}function s(l){const{internal:c}=n.getState();for(const d of c.hovered.values())if(!l.length||!l.find(f=>f.object===d.object&&f.index===d.index&&f.instanceId===d.instanceId)){const p=d.eventObject.__r3f,m=p==null?void 0:p.handlers;if(c.hovered.delete(sv(d)),p!=null&&p.eventCount){const _={...d,intersections:l};m.onPointerOut==null||m.onPointerOut(_),m.onPointerLeave==null||m.onPointerLeave(_)}}}function o(l,c){for(let d=0;ds([]);case"onLostPointerCapture":return c=>{const{internal:d}=n.getState();"pointerId"in c&&d.capturedMap.has(c.pointerId)&&requestAnimationFrame(()=>{d.capturedMap.has(c.pointerId)&&(d.capturedMap.delete(c.pointerId),s([]))})}}return function(d){const{onPointerMissed:f,internal:p}=n.getState();p.lastEvent.current=d;const m=l==="onPointerMove",_=l==="onClick"||l==="onContextMenu"||l==="onDoubleClick",x=i(d,m?t:void 0),y=_?e(d):0;l==="onPointerDown"&&(p.initialClick=[d.offsetX,d.offsetY],p.initialHits=x.map(w=>w.eventObject)),_&&!x.length&&y<=2&&(o(d,p.interaction),f&&f(d)),m&&s(x);function E(w){const M=w.eventObject,O=M.__r3f,k=O==null?void 0:O.handlers;if(O!=null&&O.eventCount)if(m){if(k.onPointerOver||k.onPointerEnter||k.onPointerOut||k.onPointerLeave){const I=sv(w),P=p.hovered.get(I);P?P.stopped&&w.stopPropagation():(p.hovered.set(I,w),k.onPointerOver==null||k.onPointerOver(w),k.onPointerEnter==null||k.onPointerEnter(w))}k.onPointerMove==null||k.onPointerMove(w)}else{const I=k[l];I?(!_||p.initialHits.includes(M))&&(o(d,p.interaction.filter(P=>!p.initialHits.includes(P))),I(w)):_&&p.initialHits.includes(M)&&o(d,p.interaction.filter(P=>!p.initialHits.includes(P)))}}r(x,d,y,E)}}return{handlePointer:a}}const m4=n=>!!(n!=null&&n.render),g4=q.createContext(null),xie=(n,e)=>{const t=t4((a,l)=>{const c=new G,d=new G,f=new G;function p(y=l().camera,E=d,w=l().size){const{width:M,height:O,top:k,left:I}=w,P=M/O;E instanceof G?f.copy(E):f.set(...E);const D=y.getWorldPosition(c).distanceTo(f);if(l4(y))return{width:M/y.zoom,height:O/y.zoom,top:k,left:I,factor:1,distance:D,aspect:P};{const A=y.fov*Math.PI/180,R=2*Math.tan(A/2)*D,V=R*(M/O);return{width:V,height:R,top:k,left:I,factor:M/V,distance:D,aspect:P}}}let m;const _=y=>a(E=>({performance:{...E.performance,current:y}})),S=new Ee;return{set:a,get:l,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(y=1)=>n(l(),y),advance:(y,E)=>e(y,E,l()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new _C,pointer:S,mouse:S,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const y=l();m&&clearTimeout(m),y.performance.current!==y.performance.min&&_(y.performance.min),m=setTimeout(()=>_(l().performance.max),y.performance.debounce)}},size:{width:0,height:0,top:0,left:0,updateStyle:!1},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:p},setEvents:y=>a(E=>({...E,events:{...E.events,...y}})),setSize:(y,E,w,M,O)=>{const k=l().camera,I={width:y,height:E,top:M||0,left:O||0,updateStyle:w};a(P=>({size:I,viewport:{...P.viewport,...p(k,d,I)}}))},setDpr:y=>a(E=>{const w=d4(y);return{viewport:{...E.viewport,dpr:w,initialDpr:E.viewport.initialDpr||w}}}),setFrameloop:(y="always")=>{const E=l().clock;E.stop(),E.elapsedTime=0,y!=="never"&&(E.start(),E.elapsedTime=0),a(()=>({frameloop:y}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:q.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(y,E,w)=>{const M=l().internal;return M.priority=M.priority+(E>0?1:0),M.subscribers.push({ref:y,priority:E,store:w}),M.subscribers=M.subscribers.sort((O,k)=>O.priority-k.priority),()=>{const O=l().internal;O!=null&&O.subscribers&&(O.priority=O.priority-(E>0?1:0),O.subscribers=O.subscribers.filter(k=>k.ref!==y))}}}}}),i=t.getState();let r=i.size,s=i.viewport.dpr,o=i.camera;return t.subscribe(()=>{const{camera:a,size:l,viewport:c,gl:d,set:f}=t.getState();if(l.width!==r.width||l.height!==r.height||c.dpr!==s){var p;r=l,s=c.dpr,gie(a,l),d.setPixelRatio(c.dpr);const m=(p=l.updateStyle)!=null?p:typeof HTMLCanvasElement<"u"&&d.domElement instanceof HTMLCanvasElement;d.setSize(l.width,l.height,m)}a!==o&&(o=a,f(m=>({viewport:{...m.viewport,...m.viewport.getCurrentViewport(a)}})))}),t.subscribe(a=>n(a)),t};let ov,Sie=new Set,wie=new Set,Eie=new Set;function w1(n,e){if(n.size)for(const{callback:t}of n.values())t(e)}function Uf(n,e){switch(n){case"before":return w1(Sie,e);case"after":return w1(wie,e);case"tail":return w1(Eie,e)}}let E1,T1;function A1(n,e,t){let i=e.clock.getDelta();for(e.frameloop==="never"&&typeof n=="number"&&(i=n-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=n),E1=e.internal.subscribers,ov=0;ov0)&&!((d=s.gl.xr)!=null&&d.isPresenting)&&(i+=A1(c,s))}if(t=!1,Uf("after",c),i===0)return Uf("tail",c),e=!1,cancelAnimationFrame(r)}function a(c,d=1){var f;if(!c)return n.forEach(p=>a(p.store.getState(),d));(f=c.gl.xr)!=null&&f.isPresenting||!c.internal.active||c.frameloop==="never"||(d>1?c.internal.frames=Math.min(60,c.internal.frames+d):t?c.internal.frames=2:c.internal.frames=1,e||(e=!0,requestAnimationFrame(o)))}function l(c,d=!0,f,p){if(d&&Uf("before",c),f)A1(c,f,p);else for(const m of n.values())A1(c,m.store.getState());d&&Uf("after",c)}return{loop:o,invalidate:a,advance:l}}function y4(){const n=q.useContext(g4);if(!n)throw new Error("R3F: Hooks can only be used within the Canvas component!");return n}function Kr(n=t=>t,e){return y4()(n,e)}function AC(n,e=0){const t=y4(),i=t.getState().internal.subscribe,r=c4(n);return Km(()=>i(r,e,t),[e,i,t]),null}const oN=new WeakMap;function v4(n,e){return function(t,...i){let r=oN.get(t);return r||(r=new t,oN.set(t,r)),n&&n(r),Promise.all(i.map(s=>new Promise((o,a)=>r.load(s,l=>{l.scene&&Object.assign(l,fie(l.scene)),o(l)},e,l=>a(new Error(`Could not load ${s}: ${l==null?void 0:l.message}`))))))}}function Qm(n,e,t,i){const r=Array.isArray(e)?e:[e],s=nie(v4(t,i),[n,...r],{equal:Tn.equ});return Array.isArray(e)?s:s[0]}Qm.preload=function(n,e,t){const i=Array.isArray(e)?e:[e];return iie(v4(t),[n,...i])};Qm.clear=function(n,e){const t=Array.isArray(e)?e:[e];return rie([n,...t])};const gd=new Map,{invalidate:aN,advance:lN}=Tie(gd),{reconciler:h_,applyProps:lo}=cie(gd,yie),ah={objects:"shallow",strict:!1},Aie=(n,e)=>{const t=typeof n=="function"?n(e):n;return m4(t)?t:new oV({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0,...n})};function Mie(n,e){const t=typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement;if(e){const{width:i,height:r,top:s,left:o,updateStyle:a=t}=e;return{width:i,height:r,top:s,left:o,updateStyle:a}}else if(typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement&&n.parentElement){const{width:i,height:r,top:s,left:o}=n.parentElement.getBoundingClientRect();return{width:i,height:r,top:s,left:o,updateStyle:t}}else if(typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas)return{width:n.width,height:n.height,top:0,left:0,updateStyle:t};return{width:0,height:0,top:0,left:0}}function Cie(n){const e=gd.get(n),t=e==null?void 0:e.fiber,i=e==null?void 0:e.store;e&&console.warn("R3F.createRoot should only be called once!");const r=typeof reportError=="function"?reportError:console.error,s=i||xie(aN,lN),o=t||h_.createContainer(s,kh.ConcurrentRoot,null,!1,null,"",r,null);e||gd.set(n,{fiber:o,store:s});let a,l=!1,c;return{configure(d={}){let{gl:f,size:p,scene:m,events:_,onCreated:S,shadows:x=!1,linear:y=!1,flat:E=!1,legacy:w=!1,orthographic:M=!1,frameloop:O="always",dpr:k=[1,2],performance:I,raycaster:P,camera:D,onPointerMissed:A}=d,R=s.getState(),V=R.gl;R.gl||R.set({gl:V=Aie(f,n)});let U=R.raycaster;U||R.set({raycaster:U=new JV});const{params:se,...le}=P||{};if(Tn.equ(le,U,ah)||lo(U,{...le}),Tn.equ(se,U.params,ah)||lo(U,{params:{...U.params,...se}}),!R.camera||R.camera===c&&!Tn.equ(c,D,ah)){c=D;const Z=D instanceof Hm,oe=Z?D:M?new zs(0,0,0,0,.1,1e3):new Dn(75,0,.1,1e3);Z||(oe.position.z=5,D&&(lo(oe,D),("aspect"in D||"left"in D||"right"in D||"bottom"in D||"top"in D)&&(oe.manual=!0,oe.updateProjectionMatrix())),!R.camera&&!(D!=null&&D.rotation)&&oe.lookAt(0,0,0)),R.set({camera:oe}),U.camera=oe}if(!R.scene){let Z;m instanceof a_?Z=m:(Z=new a_,m&&lo(Z,m)),R.set({scene:hh(Z)})}if(!R.xr){var ee;const Z=(Re,he)=>{const we=s.getState();we.frameloop!=="never"&&lN(Re,!0,we,he)},oe=()=>{const Re=s.getState();Re.gl.xr.enabled=Re.gl.xr.isPresenting,Re.gl.xr.setAnimationLoop(Re.gl.xr.isPresenting?Z:null),Re.gl.xr.isPresenting||aN(Re)},Me={connect(){const Re=s.getState().gl;Re.xr.addEventListener("sessionstart",oe),Re.xr.addEventListener("sessionend",oe)},disconnect(){const Re=s.getState().gl;Re.xr.removeEventListener("sessionstart",oe),Re.xr.removeEventListener("sessionend",oe)}};typeof((ee=V.xr)==null?void 0:ee.addEventListener)=="function"&&Me.connect(),R.set({xr:Me})}if(V.shadowMap){const Z=V.shadowMap.enabled,oe=V.shadowMap.type;if(V.shadowMap.enabled=!!x,Tn.boo(x))V.shadowMap.type=pp;else if(Tn.str(x)){var pe;const Me={basic:rF,percentage:rx,soft:pp,variance:Os};V.shadowMap.type=(pe=Me[x])!=null?pe:pp}else Tn.obj(x)&&Object.assign(V.shadowMap,x);(Z!==V.shadowMap.enabled||oe!==V.shadowMap.type)&&(V.shadowMap.needsUpdate=!0)}const W=a4();W&&("enabled"in W?W.enabled=!w:"legacyMode"in W&&(W.legacyMode=w)),l||lo(V,{outputEncoding:y?3e3:3001,toneMapping:E?vo:DM}),R.legacy!==w&&R.set(()=>({legacy:w})),R.linear!==y&&R.set(()=>({linear:y})),R.flat!==E&&R.set(()=>({flat:E})),f&&!Tn.fun(f)&&!m4(f)&&!Tn.equ(f,V,ah)&&lo(V,f),_&&!R.events.handlers&&R.set({events:_(s)});const J=Mie(n,p);return Tn.equ(J,R.size,ah)||R.setSize(J.width,J.height,J.updateStyle,J.top,J.left),k&&R.viewport.dpr!==d4(k)&&R.setDpr(k),R.frameloop!==O&&R.setFrameloop(O),R.onPointerMissed||R.set({onPointerMissed:A}),I&&!Tn.equ(I,R.performance,ah)&&R.set(Z=>({performance:{...Z.performance,...I}})),a=S,l=!0,this},render(d){return l||this.configure(),h_.updateContainer(B.jsx(bie,{store:s,children:d,onCreated:a,rootElement:n}),o,null,()=>{}),s},unmount(){_4(n)}}}function bie({store:n,children:e,onCreated:t,rootElement:i}){return Km(()=>{const r=n.getState();r.set(s=>({internal:{...s.internal,active:!0}})),t&&t(r),n.getState().events.connected||r.events.connect==null||r.events.connect(i)},[]),B.jsx(g4.Provider,{value:n,children:e})}function _4(n,e){const t=gd.get(n),i=t==null?void 0:t.fiber;if(i){const r=t==null?void 0:t.store.getState();r&&(r.internal.active=!1),h_.updateContainer(null,i,null,()=>{r&&setTimeout(()=>{try{var s,o,a,l;r.events.disconnect==null||r.events.disconnect(),(s=r.gl)==null||(o=s.renderLists)==null||o.dispose==null||o.dispose(),(a=r.gl)==null||a.forceContextLoss==null||a.forceContextLoss(),(l=r.gl)!=null&&l.xr&&r.xr.disconnect(),pie(r),gd.delete(n),e&&e(n)}catch{}},500)})}}h_.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:q.version});const M1={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};function Pie(n){const{handlePointer:e}=_ie(n);return{priority:1,enabled:!0,compute(t,i,r){i.pointer.set(t.offsetX/i.size.width*2-1,-(t.offsetY/i.size.height)*2+1),i.raycaster.setFromCamera(i.pointer,i.camera)},connected:void 0,handlers:Object.keys(M1).reduce((t,i)=>({...t,[i]:e(i)}),{}),update:()=>{var t;const{events:i,internal:r}=n.getState();(t=r.lastEvent)!=null&&t.current&&i.handlers&&i.handlers.onPointerMove(r.lastEvent.current)},connect:t=>{var i;const{set:r,events:s}=n.getState();s.disconnect==null||s.disconnect(),r(o=>({events:{...o.events,connected:t}})),Object.entries((i=s.handlers)!=null?i:[]).forEach(([o,a])=>{const[l,c]=M1[o];t.addEventListener(l,a,{passive:c})})},disconnect:()=>{const{set:t,events:i}=n.getState();if(i.connected){var r;Object.entries((r=i.handlers)!=null?r:[]).forEach(([s,o])=>{if(i&&i.connected instanceof HTMLElement){const[a]=M1[s];i.connected.removeEventListener(a,o)}}),t(s=>({events:{...s.events,connected:void 0}}))}}}}function RT(n,e,t){var i,r,s,o,a;e==null&&(e=100);function l(){var d=Date.now()-o;d=0?i=setTimeout(l,e-d):(i=null,t||(a=n.apply(s,r),s=r=null))}var c=function(){s=this,r=arguments,o=Date.now();var d=t&&!i;return i||(i=setTimeout(l,e)),d&&(a=n.apply(s,r),s=r=null),a};return c.clear=function(){i&&(clearTimeout(i),i=null)},c.flush=function(){i&&(a=n.apply(s,r),s=r=null,clearTimeout(i),i=null)},c}RT.debounce=RT;var Rie=RT;const cN=kT(Rie);var Iie=Object.defineProperty,Lie=Object.defineProperties,Nie=Object.getOwnPropertyDescriptors,uN=Object.getOwnPropertySymbols,Die=Object.prototype.hasOwnProperty,kie=Object.prototype.propertyIsEnumerable,hN=(n,e,t)=>e in n?Iie(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,dN=(n,e)=>{for(var t in e||(e={}))Die.call(e,t)&&hN(n,t,e[t]);if(uN)for(var t of uN(e))kie.call(e,t)&&hN(n,t,e[t]);return n},Oie=(n,e)=>Lie(n,Nie(e)),fN,pN;typeof window<"u"&&((fN=window.document)!=null&&fN.createElement||((pN=window.navigator)==null?void 0:pN.product)==="ReactNative")?q.useLayoutEffect:q.useEffect;function x4(n,e,t){if(!n)return;if(t(n)===!0)return n;let i=e?n.return:n.child;for(;i;){const r=x4(i,e,t);if(r)return r;i=e?null:i.sibling}}function S4(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}const mN=console.error;console.error=function(){const n=[...arguments].join("");if(n!=null&&n.startsWith("Warning:")&&n.includes("useContext")){console.error=mN;return}return mN.apply(this,arguments)};const MC=S4(q.createContext(null));class w4 extends q.Component{render(){return q.createElement(MC.Provider,{value:this._reactInternals},this.props.children)}}function Uie(){const n=q.useContext(MC);if(n===null)throw new Error("its-fine: useFiber must be called within a !");const e=q.useId();return q.useMemo(()=>{for(const i of[n,n==null?void 0:n.alternate]){if(!i)continue;const r=x4(i,!1,s=>{let o=s.memoizedState;for(;o;){if(o.memoizedState===e)return!0;o=o.next}});if(r)return r}},[n,e])}function Fie(){const n=Uie(),[e]=q.useState(()=>new Map);e.clear();let t=n;for(;t;){if(t.type&&typeof t.type=="object"){const r=t.type._context===void 0&&t.type.Provider===t.type?t.type:t.type._context;r&&r!==MC&&!e.has(r)&&e.set(r,q.useContext(S4(r)))}t=t.return}return e}function Vie(){const n=Fie();return q.useMemo(()=>Array.from(n.keys()).reduce((e,t)=>i=>q.createElement(e,null,q.createElement(t.Provider,Oie(dN({},i),{value:n.get(t)}))),e=>q.createElement(w4,dN({},e))),[n])}function Bie({debounce:n,scroll:e,polyfill:t,offsetSize:i}={debounce:0,scroll:!1,offsetSize:!1}){const r=t||typeof window<"u"&&window.ResizeObserver,[s,o]=q.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0});if(!r)return s.width=1280,s.height=800,[()=>{},s,()=>{}];const a=q.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:s,orientationHandler:null}),l=n?typeof n=="number"?n:n.scroll:null,c=n?typeof n=="number"?n:n.resize:null,d=q.useRef(!1);q.useEffect(()=>(d.current=!0,()=>void(d.current=!1)));const[f,p,m]=q.useMemo(()=>{const y=()=>{if(!a.current.element)return;const{left:E,top:w,width:M,height:O,bottom:k,right:I,x:P,y:D}=a.current.element.getBoundingClientRect(),A={left:E,top:w,width:M,height:O,bottom:k,right:I,x:P,y:D};a.current.element instanceof HTMLElement&&i&&(A.height=a.current.element.offsetHeight,A.width=a.current.element.offsetWidth),Object.freeze(A),d.current&&!Wie(a.current.lastBounds,A)&&o(a.current.lastBounds=A)};return[y,c?cN(y,c):y,l?cN(y,l):y]},[o,i,l,c]);function _(){a.current.scrollContainers&&(a.current.scrollContainers.forEach(y=>y.removeEventListener("scroll",m,!0)),a.current.scrollContainers=null),a.current.resizeObserver&&(a.current.resizeObserver.disconnect(),a.current.resizeObserver=null),a.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",a.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",a.current.orientationHandler))}function S(){var y;a.current.element&&(a.current.resizeObserver=new r(p),(y=a.current.resizeObserver)==null||y.observe(a.current.element),e&&a.current.scrollContainers&&a.current.scrollContainers.forEach(E=>E.addEventListener("scroll",m,{capture:!0,passive:!0})),a.current.orientationHandler=()=>{m()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",a.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",a.current.orientationHandler))}const x=y=>{!y||y===a.current.element||(_(),a.current.element=y,a.current.scrollContainers=E4(y),S())};return Hie(m,!!e),zie(p),q.useEffect(()=>{_(),S()},[e,m,p]),q.useEffect(()=>_,[]),[x,s,f]}function zie(n){q.useEffect(()=>{const e=n;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[n])}function Hie(n,e){q.useEffect(()=>{if(e){const t=n;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",t,!0)}},[n,e])}function E4(n){const e=[];if(!n||n===document.body)return e;const{overflow:t,overflowX:i,overflowY:r}=window.getComputedStyle(n);return[t,i,r].some(s=>s==="auto"||s==="scroll")&&e.push(n),[...e,...E4(n.parentElement)]}const Gie=["x","y","top","bottom","left","right","width","height"],Wie=(n,e)=>Gie.every(t=>n[t]===e[t]),jie=q.forwardRef(function({children:e,fallback:t,resize:i,style:r,gl:s,events:o=Pie,eventSource:a,eventPrefix:l,shadows:c,linear:d,flat:f,legacy:p,orthographic:m,frameloop:_,dpr:S,performance:x,raycaster:y,camera:E,scene:w,onPointerMissed:M,onCreated:O,...k},I){q.useMemo(()=>lie(Jne),[]);const P=Vie(),[D,A]=Bie({scroll:!0,debounce:{scroll:50,resize:0},...i}),R=q.useRef(null),V=q.useRef(null);q.useImperativeHandle(I,()=>R.current);const U=c4(M),[se,le]=q.useState(!1),[ee,pe]=q.useState(!1);if(se)throw se;if(ee)throw ee;const W=q.useRef(null);Km(()=>{const Z=R.current;A.width>0&&A.height>0&&Z&&(W.current||(W.current=Cie(Z)),W.current.configure({gl:s,events:o,shadows:c,linear:d,flat:f,legacy:p,orthographic:m,frameloop:_,dpr:S,performance:x,raycaster:y,camera:E,scene:w,size:A,onPointerMissed:(...oe)=>U.current==null?void 0:U.current(...oe),onCreated:oe=>{oe.events.connect==null||oe.events.connect(a?uie(a)?a.current:a:V.current),l&&oe.setEvents({compute:(Me,Re)=>{const he=Me[l+"X"],we=Me[l+"Y"];Re.pointer.set(he/Re.size.width*2-1,-(we/Re.size.height)*2+1),Re.raycaster.setFromCamera(Re.pointer,Re.camera)}}),O==null||O(oe)}}),W.current.render(B.jsx(P,{children:B.jsx(u4,{set:pe,children:B.jsx(q.Suspense,{fallback:B.jsx(hie,{set:le}),children:e})})})))}),q.useEffect(()=>{const Z=R.current;if(Z)return()=>_4(Z)},[]);const J=a?"none":"auto";return B.jsx("div",{ref:V,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:J,...r},...k,children:B.jsx("div",{ref:D,style:{width:"100%",height:"100%"},children:B.jsx("canvas",{ref:R,style:{display:"block"},children:t})})})}),Xie=q.forwardRef(function(e,t){return B.jsx(w4,{children:B.jsx(jie,{...e,ref:t})})});function vm(){return vm=Object.assign?Object.assign.bind():function(n){for(var e=1;eMath.PI/2}function Kie(n,e,t,i){const r=Jm.setFromMatrixPosition(n.matrixWorld),s=r.clone();s.project(e),gN.set(s.x,s.y),t.setFromCamera(gN,e);const o=t.intersectObjects(i,!0);if(o.length){const a=o[0].distance;return r.distanceTo(t.ray.origin)Math.abs(n)<1e-10?0:n;function T4(n,e,t=""){let i="matrix3d(";for(let r=0;r!==16;r++)i+=IT(e[r]*n.elements[r])+(r!==15?",":")");return t+i}const Zie=(n=>e=>T4(e,n))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),ere=(n=>(e,t)=>T4(e,n(t),"translate(-50%,-50%)"))(n=>[1/n,1/n,1/n,1,-1/n,-1/n,-1/n,-1,1/n,1/n,1/n,1,1,1,1,1]);function tre(n){return n&&typeof n=="object"&&"current"in n}const nre=q.forwardRef(({children:n,eps:e=.001,style:t,className:i,prepend:r,center:s,fullscreen:o,portal:a,distanceFactor:l,sprite:c=!1,transform:d=!1,occlude:f,onOcclude:p,castShadow:m,receiveShadow:_,material:S,geometry:x,zIndexRange:y=[16777271,0],calculatePosition:E=$ie,as:w="div",wrapperClass:M,pointerEvents:O="auto",...k},I)=>{const{gl:P,camera:D,scene:A,size:R,raycaster:V,events:U,viewport:se}=Kr(),[le]=q.useState(()=>document.createElement(w)),ee=q.useRef(),pe=q.useRef(null),W=q.useRef(0),J=q.useRef([0,0]),Z=q.useRef(null),oe=q.useRef(null),Me=(a==null?void 0:a.current)||U.connected||P.domElement.parentNode,Re=q.useRef(null),he=q.useRef(!1),we=q.useMemo(()=>f&&f!=="blending"||Array.isArray(f)&&f.length&&tre(f[0]),[f]);q.useLayoutEffect(()=>{const Ke=P.domElement;f&&f==="blending"?(Ke.style.zIndex=`${Math.floor(y[0]/2)}`,Ke.style.position="absolute",Ke.style.pointerEvents="none"):(Ke.style.zIndex=null,Ke.style.position=null,Ke.style.pointerEvents=null)},[f]),q.useLayoutEffect(()=>{if(pe.current){const Ke=ee.current=nk(le);if(A.updateMatrixWorld(),d)le.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{const ke=E(pe.current,D,R);le.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${ke[0]}px,${ke[1]}px,0);transform-origin:0 0;`}return Me&&(r?Me.prepend(le):Me.appendChild(le)),()=>{Me&&Me.removeChild(le),Ke.unmount()}}},[Me,d]),q.useLayoutEffect(()=>{M&&(le.className=M)},[M]);const Ne=q.useMemo(()=>d?{position:"absolute",top:0,left:0,width:R.width,height:R.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:s?"translate3d(-50%,-50%,0)":"none",...o&&{top:-R.height/2,left:-R.width/2,width:R.width,height:R.height},...t},[t,s,o,R,d]),be=q.useMemo(()=>({position:"absolute",pointerEvents:O}),[O]);q.useLayoutEffect(()=>{if(he.current=!1,d){var Ke;(Ke=ee.current)==null||Ke.render(q.createElement("div",{ref:Z,style:Ne},q.createElement("div",{ref:oe,style:be},q.createElement("div",{ref:I,className:i,style:t,children:n}))))}else{var ke;(ke=ee.current)==null||ke.render(q.createElement("div",{ref:I,style:Ne,className:i,children:n}))}});const ft=q.useRef(!0);AC(Ke=>{if(pe.current){D.updateMatrixWorld(),pe.current.updateWorldMatrix(!0,!1);const ke=d?J.current:E(pe.current,D,R);if(d||Math.abs(W.current-D.zoom)>e||Math.abs(J.current[0]-ke[0])>e||Math.abs(J.current[1]-ke[1])>e){const xe=Yie(pe.current,D);let j=!1;we&&(Array.isArray(f)?j=f.map(Ue=>Ue.current):f!=="blending"&&(j=[A]));const Ve=ft.current;if(j){const Ue=Kie(pe.current,D,V,j);ft.current=Ue&&!xe}else ft.current=!xe;Ve!==ft.current&&(p?p(!ft.current):le.style.display=ft.current?"block":"none");const Oe=Math.floor(y[0]/2),Pe=f?we?[y[0],Oe]:[Oe-1,0]:y;if(le.style.zIndex=`${Jie(pe.current,D,Pe)}`,d){const[Ue,lt]=[R.width/2,R.height/2],We=D.projectionMatrix.elements[5]*lt,{isOrthographicCamera:X,top:F,left:ae,bottom:_e,right:Te}=D,Se=Zie(D.matrixWorldInverse),nt=X?`scale(${We})translate(${IT(-(Te+ae)/2)}px,${IT((F+_e)/2)}px)`:`translateZ(${We}px)`;let Ce=pe.current.matrixWorld;c&&(Ce=D.matrixWorldInverse.clone().transpose().copyPosition(Ce).scale(pe.current.scale),Ce.elements[3]=Ce.elements[7]=Ce.elements[11]=0,Ce.elements[15]=1),le.style.width=R.width+"px",le.style.height=R.height+"px",le.style.perspective=X?"":`${We}px`,Z.current&&oe.current&&(Z.current.style.transform=`${nt}${Se}translate(${Ue}px,${lt}px)`,oe.current.style.transform=ere(Ce,1/((l||10)/400)))}else{const Ue=l===void 0?1:Qie(pe.current,D)*l;le.style.transform=`translate3d(${ke[0]}px,${ke[1]}px,0) scale(${Ue})`}J.current=ke,W.current=D.zoom}}if(!we&&Re.current&&!he.current)if(d){if(Z.current){const ke=Z.current.children[0];if(ke!=null&&ke.clientWidth&&ke!=null&&ke.clientHeight){const{isOrthographicCamera:xe}=D;if(xe||x)k.scale&&(Array.isArray(k.scale)?k.scale instanceof G?Re.current.scale.copy(k.scale.clone().divideScalar(1)):Re.current.scale.set(1/k.scale[0],1/k.scale[1],1/k.scale[2]):Re.current.scale.setScalar(1/k.scale));else{const j=(l||10)/400,Ve=ke.clientWidth*j,Oe=ke.clientHeight*j;Re.current.scale.set(Ve,Oe,1)}he.current=!0}}}else{const ke=le.children[0];if(ke!=null&&ke.clientWidth&&ke!=null&&ke.clientHeight){const xe=1/se.factor,j=ke.clientWidth*xe,Ve=ke.clientHeight*xe;Re.current.scale.set(j,Ve,1),he.current=!0}Re.current.lookAt(Ke.camera.position)}});const dt=q.useMemo(()=>({vertexShader:d?void 0:` + `)+u.join(" > ")}return null},t.getPublicRootInstance=function(u){if(u=u.current,!u.child)return null;switch(u.child.tag){case 5:return ee(u.child.stateNode);default:return u.child.stateNode}},t.injectIntoDevTools=function(u){if(u={bundleType:u.bundleType,version:u.version,rendererPackageName:u.rendererPackageName,rendererConfig:u.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:a.ReactCurrentDispatcher,findHostInstanceByFiber:DB,findFiberByHostInstance:u.findFiberByHostInstance||kB,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")u=!1;else{var h=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(h.isDisabled||!h.supportsFiber)u=!0;else{try{Ro=h.inject(u),ar=h}catch{}u=!!h.checkDCE}}return u},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(u,h,v,T){if(!X)throw Error(o(363));u=_S(u,h);var b=Ce(u,v,T).disconnect;return{disconnect:function(){b()}}},t.registerMutableSourceForHydration=function(u,h){var v=h._getVersion;v=v(h._source),u.mutableSourceEagerHydrationData==null?u.mutableSourceEagerHydrationData=[h,v]:u.mutableSourceEagerHydrationData.push(h,v)},t.runWithPriority=function(u,h){var v=Ht;try{return Ht=u,h()}finally{Ht=v}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(u,h,v,T){var b=h.current,N=cr(),$=Ra(b);return v=Zb(v),h.context===null?h.context=v:h.pendingContext=v,h=Wr(N,$),h.payload={element:u},T=T===void 0?null:T,T!==null&&(h.callback=T),cs(b,h),u=ds(b,$,N),u!==null&&Yl(u,b,$),$},t};s4.exports=sie;var oie=s4.exports;const aie=kT(oie),TC={},lie=n=>void Object.assign(TC,n);function cie(n,e){function t(d,{args:f=[],attach:p,...m},_){let S=`${d[0].toUpperCase()}${d.slice(1)}`,x;if(d==="primitive"){if(m.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const y=m.object;x=hh(y,{type:d,root:_,attach:p,primitive:!0})}else{const y=TC[S];if(!y)throw new Error(`R3F: ${S} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(!Array.isArray(f))throw new Error("R3F: The args prop must be an array!");x=hh(new y(...f),{type:d,root:_,attach:p,memoizedProps:{args:f}})}return x.__r3f.attach===void 0&&(x instanceof Vt?x.__r3f.attach="geometry":x instanceof Oi&&(x.__r3f.attach="material")),S!=="inject"&&S1(x,m),x}function i(d,f){let p=!1;if(f){var m,_;(m=f.__r3f)!=null&&m.attach?x1(d,f,f.__r3f.attach):f.isObject3D&&d.isObject3D&&(d.add(f),p=!0),p||(_=d.__r3f)==null||_.objects.push(f),f.__r3f||hh(f,{}),f.__r3f.parent=d,PT(f),dh(f)}}function r(d,f,p){let m=!1;if(f){var _,S;if((_=f.__r3f)!=null&&_.attach)x1(d,f,f.__r3f.attach);else if(f.isObject3D&&d.isObject3D){f.parent=d,f.dispatchEvent({type:"added"}),d.dispatchEvent({type:"childadded",child:f});const x=d.children.filter(E=>E!==f),y=x.indexOf(p);d.children=[...x.slice(0,y),f,...x.slice(y)],m=!0}m||(S=d.__r3f)==null||S.objects.push(f),f.__r3f||hh(f,{}),f.__r3f.parent=d,PT(f),dh(f)}}function s(d,f,p=!1){d&&[...d].forEach(m=>o(f,m,p))}function o(d,f,p){if(f){var m,_,S;if(f.__r3f&&(f.__r3f.parent=null),(m=d.__r3f)!=null&&m.objects&&(d.__r3f.objects=d.__r3f.objects.filter(M=>M!==f)),(_=f.__r3f)!=null&&_.attach)sN(d,f,f.__r3f.attach);else if(f.isObject3D&&d.isObject3D){var x;d.remove(f),(x=f.__r3f)!=null&&x.root&&vie(Rv(f),f)}const E=(S=f.__r3f)==null?void 0:S.primitive,w=!E&&(p===void 0?f.dispose!==null:p);if(!E){var y;s((y=f.__r3f)==null?void 0:y.objects,f,w),s(f.children,f,w)}if(delete f.__r3f,w&&f.dispose&&f.type!=="Scene"){const M=()=>{try{f.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT>"u"?CT.unstable_scheduleCallback(CT.unstable_IdlePriority,M):M()}dh(d)}}function a(d,f,p,m){var _;const S=(_=d.__r3f)==null?void 0:_.parent;if(!S)return;const x=t(f,p,d.__r3f.root);if(d.children){for(const y of d.children)y.__r3f&&i(x,y);d.children=d.children.filter(y=>!y.__r3f)}d.__r3f.objects.forEach(y=>i(x,y)),d.__r3f.objects=[],d.__r3f.autoRemovedBeforeAppend||o(S,d),x.parent&&(x.__r3f.autoRemovedBeforeAppend=!0),i(S,x),x.raycast&&x.__r3f.eventCount&&Rv(x).getState().internal.interaction.push(x),[m,m.alternate].forEach(y=>{y!==null&&(y.stateNode=x,y.ref&&(typeof y.ref=="function"?y.ref(x):y.ref.current=x))})}const l=()=>{};return{reconciler:aie({createInstance:t,removeChild:o,appendChild:i,appendInitialChild:i,insertBefore:r,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(d,f)=>{if(!f)return;const p=d.getState().scene;p.__r3f&&(p.__r3f.root=d,i(p,f))},removeChildFromContainer:(d,f)=>{f&&o(d.getState().scene,f)},insertInContainerBefore:(d,f,p)=>{if(!f||!p)return;const m=d.getState().scene;m.__r3f&&r(m,f,p)},getRootHostContext:()=>null,getChildHostContext:d=>d,finalizeInitialChildren(d){var f;return!!((f=d==null?void 0:d.__r3f)!=null?f:{}).handlers},prepareUpdate(d,f,p,m){var _;if(((_=d==null?void 0:d.__r3f)!=null?_:{}).primitive&&m.object&&m.object!==d)return[!0];{const{args:x=[],children:y,...E}=m,{args:w=[],children:M,...O}=p;if(!Array.isArray(x))throw new Error("R3F: the args prop must be an array!");if(x.some((I,P)=>I!==w[P]))return[!0];const k=p4(d,E,O,!0);return k.changes.length?[!1,k]:null}},commitUpdate(d,[f,p],m,_,S,x){f?a(d,m,S,x):S1(d,p)},commitMount(d,f,p,m){var _;const S=(_=d.__r3f)!=null?_:{};d.raycast&&S.handlers&&S.eventCount&&Rv(d).getState().internal.interaction.push(d)},getPublicInstance:d=>d,prepareForCommit:()=>null,preparePortalMount:d=>hh(d.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(d){var f;const{attach:p,parent:m}=(f=d.__r3f)!=null?f:{};p&&m&&sN(m,d,p),d.isObject3D&&(d.visible=!1),dh(d)},unhideInstance(d,f){var p;const{attach:m,parent:_}=(p=d.__r3f)!=null?p:{};m&&_&&x1(_,d,m),(d.isObject3D&&f.visible==null||f.visible)&&(d.visible=!0),dh(d)},createTextInstance:l,hideTextInstance:l,unhideTextInstance:l,getCurrentEventPriority:()=>e?e():kh.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&Tn.fun(performance.now)?performance.now:Tn.fun(Date.now)?Date.now:()=>0,scheduleTimeout:Tn.fun(setTimeout)?setTimeout:void 0,cancelTimeout:Tn.fun(clearTimeout)?clearTimeout:void 0}),applyProps:S1}}var tN,nN;const _1=n=>"colorSpace"in n||"outputColorSpace"in n,l4=()=>{var n;return(n=TC.ColorManagement)!=null?n:null},c4=n=>n&&n.isOrthographicCamera,uie=n=>n&&n.hasOwnProperty("current"),Km=typeof window<"u"&&((tN=window.document)!=null&&tN.createElement||((nN=window.navigator)==null?void 0:nN.product)==="ReactNative")?q.useLayoutEffect:q.useEffect;function u4(n){const e=q.useRef(n);return Km(()=>void(e.current=n),[n]),e}function hie({set:n}){return Km(()=>(n(new Promise(()=>null)),()=>n(!1)),[n]),null}class h4 extends q.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}h4.getDerivedStateFromError=()=>({error:!0});const d4="__default",iN=new Map,die=n=>n&&!!n.memoized&&!!n.changes;function f4(n){var e;const t=typeof window<"u"?(e=window.devicePixelRatio)!=null?e:2:1;return Array.isArray(n)?Math.min(Math.max(n[0],t),n[1]):n}const Of=n=>{var e;return(e=n.__r3f)==null?void 0:e.root.getState()};function Rv(n){let e=n.__r3f.root;for(;e.getState().previousRoot;)e=e.getState().previousRoot;return e}const Tn={obj:n=>n===Object(n)&&!Tn.arr(n)&&typeof n!="function",fun:n=>typeof n=="function",str:n=>typeof n=="string",num:n=>typeof n=="number",boo:n=>typeof n=="boolean",und:n=>n===void 0,arr:n=>Array.isArray(n),equ(n,e,{arrays:t="shallow",objects:i="reference",strict:r=!0}={}){if(typeof n!=typeof e||!!n!=!!e)return!1;if(Tn.str(n)||Tn.num(n)||Tn.boo(n))return n===e;const s=Tn.obj(n);if(s&&i==="reference")return n===e;const o=Tn.arr(n);if(o&&t==="reference")return n===e;if((o||s)&&n===e)return!0;let a;for(a in n)if(!(a in e))return!1;if(s&&t==="shallow"&&i==="shallow"){for(a in r?e:n)if(!Tn.equ(n[a],e[a],{strict:r,objects:"reference"}))return!1}else for(a in r?e:n)if(n[a]!==e[a])return!1;if(Tn.und(a)){if(o&&n.length===0&&e.length===0||s&&Object.keys(n).length===0&&Object.keys(e).length===0)return!0;if(n!==e)return!1}return!0}};function fie(n){const e={nodes:{},materials:{}};return n&&n.traverse(t=>{t.name&&(e.nodes[t.name]=t),t.material&&!e.materials[t.material.name]&&(e.materials[t.material.name]=t.material)}),e}function pie(n){n.dispose&&n.type!=="Scene"&&n.dispose();for(const e in n)e.dispose==null||e.dispose(),delete n[e]}function hh(n,e){const t=n;return t.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...e},n}function bT(n,e){let t=n;if(e.includes("-")){const i=e.split("-"),r=i.pop();return t=i.reduce((s,o)=>s[o],n),{target:t,key:r}}else return{target:t,key:e}}const rN=/-\d+$/;function x1(n,e,t){if(Tn.str(t)){if(rN.test(t)){const s=t.replace(rN,""),{target:o,key:a}=bT(n,s);Array.isArray(o[a])||(o[a]=[])}const{target:i,key:r}=bT(n,t);e.__r3f.previousAttach=i[r],i[r]=e}else e.__r3f.previousAttach=t(n,e)}function sN(n,e,t){var i,r;if(Tn.str(t)){const{target:s,key:o}=bT(n,t),a=e.__r3f.previousAttach;a===void 0?delete s[o]:s[o]=a}else(i=e.__r3f)==null||i.previousAttach==null||i.previousAttach(n,e);(r=e.__r3f)==null||delete r.previousAttach}function p4(n,{children:e,key:t,ref:i,...r},{children:s,key:o,ref:a,...l}={},c=!1){const d=n.__r3f,f=Object.entries(r),p=[];if(c){const _=Object.keys(l);for(let S=0;S<_.length;S++)r.hasOwnProperty(_[S])||f.unshift([_[S],d4+"remove"])}f.forEach(([_,S])=>{var x;if((x=n.__r3f)!=null&&x.primitive&&_==="object"||Tn.equ(S,l[_]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(_))return p.push([_,S,!0,[]]);let y=[];_.includes("-")&&(y=_.split("-")),p.push([_,S,!1,y]);for(const E in r){const w=r[E];E.startsWith(`${_}-`)&&p.push([E,w,!1,E.split("-")])}});const m={...r};return d!=null&&d.memoizedProps&&d!=null&&d.memoizedProps.args&&(m.args=d.memoizedProps.args),d!=null&&d.memoizedProps&&d!=null&&d.memoizedProps.attach&&(m.attach=d.memoizedProps.attach),{memoized:m,changes:p}}const mie=typeof process<"u"&&!1;function S1(n,e){var t;const i=n.__r3f,r=i==null?void 0:i.root,s=r==null||r.getState==null?void 0:r.getState(),{memoized:o,changes:a}=die(e)?e:p4(n,e),l=i==null?void 0:i.eventCount;n.__r3f&&(n.__r3f.memoizedProps=o);for(let d=0;dy[E],n),!(x&&x.set))){const[y,...E]=_.reverse();S=E.reverse().reduce((w,M)=>w[M],n),f=y}if(p===d4+"remove")if(S.constructor){let y=iN.get(S.constructor);y||(y=new S.constructor,iN.set(S.constructor,y)),p=y[f]}else p=0;if(m&&i)p?i.handlers[f]=p:delete i.handlers[f],i.eventCount=Object.keys(i.handlers).length;else if(x&&x.set&&(x.copy||x instanceof Kc)){if(Array.isArray(p))x.fromArray?x.fromArray(p):x.set(...p);else if(x.copy&&p&&p.constructor&&(mie?x.constructor.name===p.constructor.name:x.constructor===p.constructor))x.copy(p);else if(p!==void 0){const y=x instanceof rt;!y&&x.setScalar?x.setScalar(p):x instanceof Kc&&p instanceof Kc?x.mask=p.mask:x.set(p),!l4()&&s&&!s.linear&&y&&x.convertSRGBToLinear()}}else if(S[f]=p,S[f]instanceof In&&S[f].format===tr&&S[f].type===js&&s){const y=S[f];_1(y)&&_1(s.gl)?y.colorSpace=s.gl.outputColorSpace:y.encoding=s.gl.outputEncoding}dh(n)}if(i&&i.parent&&n.raycast&&l!==i.eventCount){const d=Rv(n).getState().internal,f=d.interaction.indexOf(n);f>-1&&d.interaction.splice(f,1),i.eventCount&&d.interaction.push(n)}return!(a.length===1&&a[0][0]==="onUpdate")&&a.length&&(t=n.__r3f)!=null&&t.parent&&PT(n),n}function dh(n){var e,t;const i=(e=n.__r3f)==null||(t=e.root)==null||t.getState==null?void 0:t.getState();i&&i.internal.frames===0&&i.invalidate()}function PT(n){n.onUpdate==null||n.onUpdate(n)}function gie(n,e){n.manual||(c4(n)?(n.left=e.width/-2,n.right=e.width/2,n.top=e.height/2,n.bottom=e.height/-2):n.aspect=e.width/e.height,n.updateProjectionMatrix(),n.updateMatrixWorld())}function sv(n){return(n.eventObject||n.object).uuid+"/"+n.index+n.instanceId}function yie(){var n;const e=typeof self<"u"&&self||typeof window<"u"&&window;if(!e)return kh.DefaultEventPriority;switch((n=e.event)==null?void 0:n.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return kh.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return kh.ContinuousEventPriority;default:return kh.DefaultEventPriority}}function m4(n,e,t,i){const r=t.get(e);r&&(t.delete(e),t.size===0&&(n.delete(i),r.target.releasePointerCapture(i)))}function vie(n,e){const{internal:t}=n.getState();t.interaction=t.interaction.filter(i=>i!==e),t.initialHits=t.initialHits.filter(i=>i!==e),t.hovered.forEach((i,r)=>{(i.eventObject===e||i.object===e)&&t.hovered.delete(r)}),t.capturedMap.forEach((i,r)=>{m4(t.capturedMap,e,i,r)})}function _ie(n){function e(l){const{internal:c}=n.getState(),d=l.offsetX-c.initialClick[0],f=l.offsetY-c.initialClick[1];return Math.round(Math.sqrt(d*d+f*f))}function t(l){return l.filter(c=>["Move","Over","Enter","Out","Leave"].some(d=>{var f;return(f=c.__r3f)==null?void 0:f.handlers["onPointer"+d]}))}function i(l,c){const d=n.getState(),f=new Set,p=[],m=c?c(d.internal.interaction):d.internal.interaction;for(let y=0;y{const w=Of(y.object),M=Of(E.object);return!w||!M?y.distance-E.distance:M.events.priority-w.events.priority||y.distance-E.distance}).filter(y=>{const E=sv(y);return f.has(E)?!1:(f.add(E),!0)});d.events.filter&&(S=d.events.filter(S,d));for(const y of S){let E=y.object;for(;E;){var x;(x=E.__r3f)!=null&&x.eventCount&&p.push({...y,eventObject:E}),E=E.parent}}if("pointerId"in l&&d.internal.capturedMap.has(l.pointerId))for(let y of d.internal.capturedMap.get(l.pointerId).values())f.has(sv(y.intersection))||p.push(y.intersection);return p}function r(l,c,d,f){const p=n.getState();if(l.length){const m={stopped:!1};for(const _ of l){const S=Of(_.object)||p,{raycaster:x,pointer:y,camera:E,internal:w}=S,M=new G(y.x,y.y,0).unproject(E),O=A=>{var R,V;return(R=(V=w.capturedMap.get(A))==null?void 0:V.has(_.eventObject))!=null?R:!1},k=A=>{const R={intersection:_,target:c.target};w.capturedMap.has(A)?w.capturedMap.get(A).set(_.eventObject,R):w.capturedMap.set(A,new Map([[_.eventObject,R]])),c.target.setPointerCapture(A)},I=A=>{const R=w.capturedMap.get(A);R&&m4(w.capturedMap,_.eventObject,R,A)};let P={};for(let A in c){let R=c[A];typeof R!="function"&&(P[A]=R)}let D={..._,...P,pointer:y,intersections:l,stopped:m.stopped,delta:d,unprojectedPoint:M,ray:x.ray,camera:E,stopPropagation(){const A="pointerId"in c&&w.capturedMap.get(c.pointerId);if((!A||A.has(_.eventObject))&&(D.stopped=m.stopped=!0,w.hovered.size&&Array.from(w.hovered.values()).find(R=>R.eventObject===_.eventObject))){const R=l.slice(0,l.indexOf(_));s([...R,_])}},target:{hasPointerCapture:O,setPointerCapture:k,releasePointerCapture:I},currentTarget:{hasPointerCapture:O,setPointerCapture:k,releasePointerCapture:I},nativeEvent:c};if(f(D),m.stopped===!0)break}}return l}function s(l){const{internal:c}=n.getState();for(const d of c.hovered.values())if(!l.length||!l.find(f=>f.object===d.object&&f.index===d.index&&f.instanceId===d.instanceId)){const p=d.eventObject.__r3f,m=p==null?void 0:p.handlers;if(c.hovered.delete(sv(d)),p!=null&&p.eventCount){const _={...d,intersections:l};m.onPointerOut==null||m.onPointerOut(_),m.onPointerLeave==null||m.onPointerLeave(_)}}}function o(l,c){for(let d=0;ds([]);case"onLostPointerCapture":return c=>{const{internal:d}=n.getState();"pointerId"in c&&d.capturedMap.has(c.pointerId)&&requestAnimationFrame(()=>{d.capturedMap.has(c.pointerId)&&(d.capturedMap.delete(c.pointerId),s([]))})}}return function(d){const{onPointerMissed:f,internal:p}=n.getState();p.lastEvent.current=d;const m=l==="onPointerMove",_=l==="onClick"||l==="onContextMenu"||l==="onDoubleClick",x=i(d,m?t:void 0),y=_?e(d):0;l==="onPointerDown"&&(p.initialClick=[d.offsetX,d.offsetY],p.initialHits=x.map(w=>w.eventObject)),_&&!x.length&&y<=2&&(o(d,p.interaction),f&&f(d)),m&&s(x);function E(w){const M=w.eventObject,O=M.__r3f,k=O==null?void 0:O.handlers;if(O!=null&&O.eventCount)if(m){if(k.onPointerOver||k.onPointerEnter||k.onPointerOut||k.onPointerLeave){const I=sv(w),P=p.hovered.get(I);P?P.stopped&&w.stopPropagation():(p.hovered.set(I,w),k.onPointerOver==null||k.onPointerOver(w),k.onPointerEnter==null||k.onPointerEnter(w))}k.onPointerMove==null||k.onPointerMove(w)}else{const I=k[l];I?(!_||p.initialHits.includes(M))&&(o(d,p.interaction.filter(P=>!p.initialHits.includes(P))),I(w)):_&&p.initialHits.includes(M)&&o(d,p.interaction.filter(P=>!p.initialHits.includes(P)))}}r(x,d,y,E)}}return{handlePointer:a}}const g4=n=>!!(n!=null&&n.render),y4=q.createContext(null),xie=(n,e)=>{const t=n4((a,l)=>{const c=new G,d=new G,f=new G;function p(y=l().camera,E=d,w=l().size){const{width:M,height:O,top:k,left:I}=w,P=M/O;E instanceof G?f.copy(E):f.set(...E);const D=y.getWorldPosition(c).distanceTo(f);if(c4(y))return{width:M/y.zoom,height:O/y.zoom,top:k,left:I,factor:1,distance:D,aspect:P};{const A=y.fov*Math.PI/180,R=2*Math.tan(A/2)*D,V=R*(M/O);return{width:V,height:R,top:k,left:I,factor:M/V,distance:D,aspect:P}}}let m;const _=y=>a(E=>({performance:{...E.performance,current:y}})),S=new Ee;return{set:a,get:l,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(y=1)=>n(l(),y),advance:(y,E)=>e(y,E,l()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new _C,pointer:S,mouse:S,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const y=l();m&&clearTimeout(m),y.performance.current!==y.performance.min&&_(y.performance.min),m=setTimeout(()=>_(l().performance.max),y.performance.debounce)}},size:{width:0,height:0,top:0,left:0,updateStyle:!1},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:p},setEvents:y=>a(E=>({...E,events:{...E.events,...y}})),setSize:(y,E,w,M,O)=>{const k=l().camera,I={width:y,height:E,top:M||0,left:O||0,updateStyle:w};a(P=>({size:I,viewport:{...P.viewport,...p(k,d,I)}}))},setDpr:y=>a(E=>{const w=f4(y);return{viewport:{...E.viewport,dpr:w,initialDpr:E.viewport.initialDpr||w}}}),setFrameloop:(y="always")=>{const E=l().clock;E.stop(),E.elapsedTime=0,y!=="never"&&(E.start(),E.elapsedTime=0),a(()=>({frameloop:y}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:q.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(y,E,w)=>{const M=l().internal;return M.priority=M.priority+(E>0?1:0),M.subscribers.push({ref:y,priority:E,store:w}),M.subscribers=M.subscribers.sort((O,k)=>O.priority-k.priority),()=>{const O=l().internal;O!=null&&O.subscribers&&(O.priority=O.priority-(E>0?1:0),O.subscribers=O.subscribers.filter(k=>k.ref!==y))}}}}}),i=t.getState();let r=i.size,s=i.viewport.dpr,o=i.camera;return t.subscribe(()=>{const{camera:a,size:l,viewport:c,gl:d,set:f}=t.getState();if(l.width!==r.width||l.height!==r.height||c.dpr!==s){var p;r=l,s=c.dpr,gie(a,l),d.setPixelRatio(c.dpr);const m=(p=l.updateStyle)!=null?p:typeof HTMLCanvasElement<"u"&&d.domElement instanceof HTMLCanvasElement;d.setSize(l.width,l.height,m)}a!==o&&(o=a,f(m=>({viewport:{...m.viewport,...m.viewport.getCurrentViewport(a)}})))}),t.subscribe(a=>n(a)),t};let ov,Sie=new Set,wie=new Set,Eie=new Set;function w1(n,e){if(n.size)for(const{callback:t}of n.values())t(e)}function Uf(n,e){switch(n){case"before":return w1(Sie,e);case"after":return w1(wie,e);case"tail":return w1(Eie,e)}}let E1,T1;function A1(n,e,t){let i=e.clock.getDelta();for(e.frameloop==="never"&&typeof n=="number"&&(i=n-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=n),E1=e.internal.subscribers,ov=0;ov0)&&!((d=s.gl.xr)!=null&&d.isPresenting)&&(i+=A1(c,s))}if(t=!1,Uf("after",c),i===0)return Uf("tail",c),e=!1,cancelAnimationFrame(r)}function a(c,d=1){var f;if(!c)return n.forEach(p=>a(p.store.getState(),d));(f=c.gl.xr)!=null&&f.isPresenting||!c.internal.active||c.frameloop==="never"||(d>1?c.internal.frames=Math.min(60,c.internal.frames+d):t?c.internal.frames=2:c.internal.frames=1,e||(e=!0,requestAnimationFrame(o)))}function l(c,d=!0,f,p){if(d&&Uf("before",c),f)A1(c,f,p);else for(const m of n.values())A1(c,m.store.getState());d&&Uf("after",c)}return{loop:o,invalidate:a,advance:l}}function v4(){const n=q.useContext(y4);if(!n)throw new Error("R3F: Hooks can only be used within the Canvas component!");return n}function Kr(n=t=>t,e){return v4()(n,e)}function AC(n,e=0){const t=v4(),i=t.getState().internal.subscribe,r=u4(n);return Km(()=>i(r,e,t),[e,i,t]),null}const oN=new WeakMap;function _4(n,e){return function(t,...i){let r=oN.get(t);return r||(r=new t,oN.set(t,r)),n&&n(r),Promise.all(i.map(s=>new Promise((o,a)=>r.load(s,l=>{l.scene&&Object.assign(l,fie(l.scene)),o(l)},e,l=>a(new Error(`Could not load ${s}: ${l==null?void 0:l.message}`))))))}}function Qm(n,e,t,i){const r=Array.isArray(e)?e:[e],s=nie(_4(t,i),[n,...r],{equal:Tn.equ});return Array.isArray(e)?s:s[0]}Qm.preload=function(n,e,t){const i=Array.isArray(e)?e:[e];return iie(_4(t),[n,...i])};Qm.clear=function(n,e){const t=Array.isArray(e)?e:[e];return rie([n,...t])};const gd=new Map,{invalidate:aN,advance:lN}=Tie(gd),{reconciler:h_,applyProps:lo}=cie(gd,yie),ah={objects:"shallow",strict:!1},Aie=(n,e)=>{const t=typeof n=="function"?n(e):n;return g4(t)?t:new aV({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0,...n})};function Mie(n,e){const t=typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement;if(e){const{width:i,height:r,top:s,left:o,updateStyle:a=t}=e;return{width:i,height:r,top:s,left:o,updateStyle:a}}else if(typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement&&n.parentElement){const{width:i,height:r,top:s,left:o}=n.parentElement.getBoundingClientRect();return{width:i,height:r,top:s,left:o,updateStyle:t}}else if(typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas)return{width:n.width,height:n.height,top:0,left:0,updateStyle:t};return{width:0,height:0,top:0,left:0}}function Cie(n){const e=gd.get(n),t=e==null?void 0:e.fiber,i=e==null?void 0:e.store;e&&console.warn("R3F.createRoot should only be called once!");const r=typeof reportError=="function"?reportError:console.error,s=i||xie(aN,lN),o=t||h_.createContainer(s,kh.ConcurrentRoot,null,!1,null,"",r,null);e||gd.set(n,{fiber:o,store:s});let a,l=!1,c;return{configure(d={}){let{gl:f,size:p,scene:m,events:_,onCreated:S,shadows:x=!1,linear:y=!1,flat:E=!1,legacy:w=!1,orthographic:M=!1,frameloop:O="always",dpr:k=[1,2],performance:I,raycaster:P,camera:D,onPointerMissed:A}=d,R=s.getState(),V=R.gl;R.gl||R.set({gl:V=Aie(f,n)});let U=R.raycaster;U||R.set({raycaster:U=new ZV});const{params:se,...le}=P||{};if(Tn.equ(le,U,ah)||lo(U,{...le}),Tn.equ(se,U.params,ah)||lo(U,{params:{...U.params,...se}}),!R.camera||R.camera===c&&!Tn.equ(c,D,ah)){c=D;const Z=D instanceof Hm,oe=Z?D:M?new zs(0,0,0,0,.1,1e3):new Dn(75,0,.1,1e3);Z||(oe.position.z=5,D&&(lo(oe,D),("aspect"in D||"left"in D||"right"in D||"bottom"in D||"top"in D)&&(oe.manual=!0,oe.updateProjectionMatrix())),!R.camera&&!(D!=null&&D.rotation)&&oe.lookAt(0,0,0)),R.set({camera:oe}),U.camera=oe}if(!R.scene){let Z;m instanceof a_?Z=m:(Z=new a_,m&&lo(Z,m)),R.set({scene:hh(Z)})}if(!R.xr){var ee;const Z=(Re,he)=>{const we=s.getState();we.frameloop!=="never"&&lN(Re,!0,we,he)},oe=()=>{const Re=s.getState();Re.gl.xr.enabled=Re.gl.xr.isPresenting,Re.gl.xr.setAnimationLoop(Re.gl.xr.isPresenting?Z:null),Re.gl.xr.isPresenting||aN(Re)},Me={connect(){const Re=s.getState().gl;Re.xr.addEventListener("sessionstart",oe),Re.xr.addEventListener("sessionend",oe)},disconnect(){const Re=s.getState().gl;Re.xr.removeEventListener("sessionstart",oe),Re.xr.removeEventListener("sessionend",oe)}};typeof((ee=V.xr)==null?void 0:ee.addEventListener)=="function"&&Me.connect(),R.set({xr:Me})}if(V.shadowMap){const Z=V.shadowMap.enabled,oe=V.shadowMap.type;if(V.shadowMap.enabled=!!x,Tn.boo(x))V.shadowMap.type=pp;else if(Tn.str(x)){var pe;const Me={basic:sF,percentage:rx,soft:pp,variance:Os};V.shadowMap.type=(pe=Me[x])!=null?pe:pp}else Tn.obj(x)&&Object.assign(V.shadowMap,x);(Z!==V.shadowMap.enabled||oe!==V.shadowMap.type)&&(V.shadowMap.needsUpdate=!0)}const W=l4();W&&("enabled"in W?W.enabled=!w:"legacyMode"in W&&(W.legacyMode=w)),l||lo(V,{outputEncoding:y?3e3:3001,toneMapping:E?vo:DM}),R.legacy!==w&&R.set(()=>({legacy:w})),R.linear!==y&&R.set(()=>({linear:y})),R.flat!==E&&R.set(()=>({flat:E})),f&&!Tn.fun(f)&&!g4(f)&&!Tn.equ(f,V,ah)&&lo(V,f),_&&!R.events.handlers&&R.set({events:_(s)});const J=Mie(n,p);return Tn.equ(J,R.size,ah)||R.setSize(J.width,J.height,J.updateStyle,J.top,J.left),k&&R.viewport.dpr!==f4(k)&&R.setDpr(k),R.frameloop!==O&&R.setFrameloop(O),R.onPointerMissed||R.set({onPointerMissed:A}),I&&!Tn.equ(I,R.performance,ah)&&R.set(Z=>({performance:{...Z.performance,...I}})),a=S,l=!0,this},render(d){return l||this.configure(),h_.updateContainer(B.jsx(bie,{store:s,children:d,onCreated:a,rootElement:n}),o,null,()=>{}),s},unmount(){x4(n)}}}function bie({store:n,children:e,onCreated:t,rootElement:i}){return Km(()=>{const r=n.getState();r.set(s=>({internal:{...s.internal,active:!0}})),t&&t(r),n.getState().events.connected||r.events.connect==null||r.events.connect(i)},[]),B.jsx(y4.Provider,{value:n,children:e})}function x4(n,e){const t=gd.get(n),i=t==null?void 0:t.fiber;if(i){const r=t==null?void 0:t.store.getState();r&&(r.internal.active=!1),h_.updateContainer(null,i,null,()=>{r&&setTimeout(()=>{try{var s,o,a,l;r.events.disconnect==null||r.events.disconnect(),(s=r.gl)==null||(o=s.renderLists)==null||o.dispose==null||o.dispose(),(a=r.gl)==null||a.forceContextLoss==null||a.forceContextLoss(),(l=r.gl)!=null&&l.xr&&r.xr.disconnect(),pie(r),gd.delete(n),e&&e(n)}catch{}},500)})}}h_.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:q.version});const M1={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};function Pie(n){const{handlePointer:e}=_ie(n);return{priority:1,enabled:!0,compute(t,i,r){i.pointer.set(t.offsetX/i.size.width*2-1,-(t.offsetY/i.size.height)*2+1),i.raycaster.setFromCamera(i.pointer,i.camera)},connected:void 0,handlers:Object.keys(M1).reduce((t,i)=>({...t,[i]:e(i)}),{}),update:()=>{var t;const{events:i,internal:r}=n.getState();(t=r.lastEvent)!=null&&t.current&&i.handlers&&i.handlers.onPointerMove(r.lastEvent.current)},connect:t=>{var i;const{set:r,events:s}=n.getState();s.disconnect==null||s.disconnect(),r(o=>({events:{...o.events,connected:t}})),Object.entries((i=s.handlers)!=null?i:[]).forEach(([o,a])=>{const[l,c]=M1[o];t.addEventListener(l,a,{passive:c})})},disconnect:()=>{const{set:t,events:i}=n.getState();if(i.connected){var r;Object.entries((r=i.handlers)!=null?r:[]).forEach(([s,o])=>{if(i&&i.connected instanceof HTMLElement){const[a]=M1[s];i.connected.removeEventListener(a,o)}}),t(s=>({events:{...s.events,connected:void 0}}))}}}}function RT(n,e,t){var i,r,s,o,a;e==null&&(e=100);function l(){var d=Date.now()-o;d=0?i=setTimeout(l,e-d):(i=null,t||(a=n.apply(s,r),s=r=null))}var c=function(){s=this,r=arguments,o=Date.now();var d=t&&!i;return i||(i=setTimeout(l,e)),d&&(a=n.apply(s,r),s=r=null),a};return c.clear=function(){i&&(clearTimeout(i),i=null)},c.flush=function(){i&&(a=n.apply(s,r),s=r=null,clearTimeout(i),i=null)},c}RT.debounce=RT;var Rie=RT;const cN=kT(Rie);var Iie=Object.defineProperty,Lie=Object.defineProperties,Nie=Object.getOwnPropertyDescriptors,uN=Object.getOwnPropertySymbols,Die=Object.prototype.hasOwnProperty,kie=Object.prototype.propertyIsEnumerable,hN=(n,e,t)=>e in n?Iie(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,dN=(n,e)=>{for(var t in e||(e={}))Die.call(e,t)&&hN(n,t,e[t]);if(uN)for(var t of uN(e))kie.call(e,t)&&hN(n,t,e[t]);return n},Oie=(n,e)=>Lie(n,Nie(e)),fN,pN;typeof window<"u"&&((fN=window.document)!=null&&fN.createElement||((pN=window.navigator)==null?void 0:pN.product)==="ReactNative")?q.useLayoutEffect:q.useEffect;function S4(n,e,t){if(!n)return;if(t(n)===!0)return n;let i=e?n.return:n.child;for(;i;){const r=S4(i,e,t);if(r)return r;i=e?null:i.sibling}}function w4(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}const mN=console.error;console.error=function(){const n=[...arguments].join("");if(n!=null&&n.startsWith("Warning:")&&n.includes("useContext")){console.error=mN;return}return mN.apply(this,arguments)};const MC=w4(q.createContext(null));class E4 extends q.Component{render(){return q.createElement(MC.Provider,{value:this._reactInternals},this.props.children)}}function Uie(){const n=q.useContext(MC);if(n===null)throw new Error("its-fine: useFiber must be called within a !");const e=q.useId();return q.useMemo(()=>{for(const i of[n,n==null?void 0:n.alternate]){if(!i)continue;const r=S4(i,!1,s=>{let o=s.memoizedState;for(;o;){if(o.memoizedState===e)return!0;o=o.next}});if(r)return r}},[n,e])}function Fie(){const n=Uie(),[e]=q.useState(()=>new Map);e.clear();let t=n;for(;t;){if(t.type&&typeof t.type=="object"){const r=t.type._context===void 0&&t.type.Provider===t.type?t.type:t.type._context;r&&r!==MC&&!e.has(r)&&e.set(r,q.useContext(w4(r)))}t=t.return}return e}function Vie(){const n=Fie();return q.useMemo(()=>Array.from(n.keys()).reduce((e,t)=>i=>q.createElement(e,null,q.createElement(t.Provider,Oie(dN({},i),{value:n.get(t)}))),e=>q.createElement(E4,dN({},e))),[n])}function Bie({debounce:n,scroll:e,polyfill:t,offsetSize:i}={debounce:0,scroll:!1,offsetSize:!1}){const r=t||typeof window<"u"&&window.ResizeObserver,[s,o]=q.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0});if(!r)return s.width=1280,s.height=800,[()=>{},s,()=>{}];const a=q.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:s,orientationHandler:null}),l=n?typeof n=="number"?n:n.scroll:null,c=n?typeof n=="number"?n:n.resize:null,d=q.useRef(!1);q.useEffect(()=>(d.current=!0,()=>void(d.current=!1)));const[f,p,m]=q.useMemo(()=>{const y=()=>{if(!a.current.element)return;const{left:E,top:w,width:M,height:O,bottom:k,right:I,x:P,y:D}=a.current.element.getBoundingClientRect(),A={left:E,top:w,width:M,height:O,bottom:k,right:I,x:P,y:D};a.current.element instanceof HTMLElement&&i&&(A.height=a.current.element.offsetHeight,A.width=a.current.element.offsetWidth),Object.freeze(A),d.current&&!Wie(a.current.lastBounds,A)&&o(a.current.lastBounds=A)};return[y,c?cN(y,c):y,l?cN(y,l):y]},[o,i,l,c]);function _(){a.current.scrollContainers&&(a.current.scrollContainers.forEach(y=>y.removeEventListener("scroll",m,!0)),a.current.scrollContainers=null),a.current.resizeObserver&&(a.current.resizeObserver.disconnect(),a.current.resizeObserver=null),a.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",a.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",a.current.orientationHandler))}function S(){var y;a.current.element&&(a.current.resizeObserver=new r(p),(y=a.current.resizeObserver)==null||y.observe(a.current.element),e&&a.current.scrollContainers&&a.current.scrollContainers.forEach(E=>E.addEventListener("scroll",m,{capture:!0,passive:!0})),a.current.orientationHandler=()=>{m()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",a.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",a.current.orientationHandler))}const x=y=>{!y||y===a.current.element||(_(),a.current.element=y,a.current.scrollContainers=T4(y),S())};return Hie(m,!!e),zie(p),q.useEffect(()=>{_(),S()},[e,m,p]),q.useEffect(()=>_,[]),[x,s,f]}function zie(n){q.useEffect(()=>{const e=n;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[n])}function Hie(n,e){q.useEffect(()=>{if(e){const t=n;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",t,!0)}},[n,e])}function T4(n){const e=[];if(!n||n===document.body)return e;const{overflow:t,overflowX:i,overflowY:r}=window.getComputedStyle(n);return[t,i,r].some(s=>s==="auto"||s==="scroll")&&e.push(n),[...e,...T4(n.parentElement)]}const Gie=["x","y","top","bottom","left","right","width","height"],Wie=(n,e)=>Gie.every(t=>n[t]===e[t]),jie=q.forwardRef(function({children:e,fallback:t,resize:i,style:r,gl:s,events:o=Pie,eventSource:a,eventPrefix:l,shadows:c,linear:d,flat:f,legacy:p,orthographic:m,frameloop:_,dpr:S,performance:x,raycaster:y,camera:E,scene:w,onPointerMissed:M,onCreated:O,...k},I){q.useMemo(()=>lie(Jne),[]);const P=Vie(),[D,A]=Bie({scroll:!0,debounce:{scroll:50,resize:0},...i}),R=q.useRef(null),V=q.useRef(null);q.useImperativeHandle(I,()=>R.current);const U=u4(M),[se,le]=q.useState(!1),[ee,pe]=q.useState(!1);if(se)throw se;if(ee)throw ee;const W=q.useRef(null);Km(()=>{const Z=R.current;A.width>0&&A.height>0&&Z&&(W.current||(W.current=Cie(Z)),W.current.configure({gl:s,events:o,shadows:c,linear:d,flat:f,legacy:p,orthographic:m,frameloop:_,dpr:S,performance:x,raycaster:y,camera:E,scene:w,size:A,onPointerMissed:(...oe)=>U.current==null?void 0:U.current(...oe),onCreated:oe=>{oe.events.connect==null||oe.events.connect(a?uie(a)?a.current:a:V.current),l&&oe.setEvents({compute:(Me,Re)=>{const he=Me[l+"X"],we=Me[l+"Y"];Re.pointer.set(he/Re.size.width*2-1,-(we/Re.size.height)*2+1),Re.raycaster.setFromCamera(Re.pointer,Re.camera)}}),O==null||O(oe)}}),W.current.render(B.jsx(P,{children:B.jsx(h4,{set:pe,children:B.jsx(q.Suspense,{fallback:B.jsx(hie,{set:le}),children:e})})})))}),q.useEffect(()=>{const Z=R.current;if(Z)return()=>x4(Z)},[]);const J=a?"none":"auto";return B.jsx("div",{ref:V,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:J,...r},...k,children:B.jsx("div",{ref:D,style:{width:"100%",height:"100%"},children:B.jsx("canvas",{ref:R,style:{display:"block"},children:t})})})}),Xie=q.forwardRef(function(e,t){return B.jsx(E4,{children:B.jsx(jie,{...e,ref:t})})});function vm(){return vm=Object.assign?Object.assign.bind():function(n){for(var e=1;eMath.PI/2}function Kie(n,e,t,i){const r=Jm.setFromMatrixPosition(n.matrixWorld),s=r.clone();s.project(e),gN.set(s.x,s.y),t.setFromCamera(gN,e);const o=t.intersectObjects(i,!0);if(o.length){const a=o[0].distance;return r.distanceTo(t.ray.origin)Math.abs(n)<1e-10?0:n;function A4(n,e,t=""){let i="matrix3d(";for(let r=0;r!==16;r++)i+=IT(e[r]*n.elements[r])+(r!==15?",":")");return t+i}const Zie=(n=>e=>A4(e,n))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),ere=(n=>(e,t)=>A4(e,n(t),"translate(-50%,-50%)"))(n=>[1/n,1/n,1/n,1,-1/n,-1/n,-1/n,-1,1/n,1/n,1/n,1,1,1,1,1]);function tre(n){return n&&typeof n=="object"&&"current"in n}const nre=q.forwardRef(({children:n,eps:e=.001,style:t,className:i,prepend:r,center:s,fullscreen:o,portal:a,distanceFactor:l,sprite:c=!1,transform:d=!1,occlude:f,onOcclude:p,castShadow:m,receiveShadow:_,material:S,geometry:x,zIndexRange:y=[16777271,0],calculatePosition:E=$ie,as:w="div",wrapperClass:M,pointerEvents:O="auto",...k},I)=>{const{gl:P,camera:D,scene:A,size:R,raycaster:V,events:U,viewport:se}=Kr(),[le]=q.useState(()=>document.createElement(w)),ee=q.useRef(),pe=q.useRef(null),W=q.useRef(0),J=q.useRef([0,0]),Z=q.useRef(null),oe=q.useRef(null),Me=(a==null?void 0:a.current)||U.connected||P.domElement.parentNode,Re=q.useRef(null),he=q.useRef(!1),we=q.useMemo(()=>f&&f!=="blending"||Array.isArray(f)&&f.length&&tre(f[0]),[f]);q.useLayoutEffect(()=>{const Ke=P.domElement;f&&f==="blending"?(Ke.style.zIndex=`${Math.floor(y[0]/2)}`,Ke.style.position="absolute",Ke.style.pointerEvents="none"):(Ke.style.zIndex=null,Ke.style.position=null,Ke.style.pointerEvents=null)},[f]),q.useLayoutEffect(()=>{if(pe.current){const Ke=ee.current=nk(le);if(A.updateMatrixWorld(),d)le.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{const ke=E(pe.current,D,R);le.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${ke[0]}px,${ke[1]}px,0);transform-origin:0 0;`}return Me&&(r?Me.prepend(le):Me.appendChild(le)),()=>{Me&&Me.removeChild(le),Ke.unmount()}}},[Me,d]),q.useLayoutEffect(()=>{M&&(le.className=M)},[M]);const Ne=q.useMemo(()=>d?{position:"absolute",top:0,left:0,width:R.width,height:R.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:s?"translate3d(-50%,-50%,0)":"none",...o&&{top:-R.height/2,left:-R.width/2,width:R.width,height:R.height},...t},[t,s,o,R,d]),be=q.useMemo(()=>({position:"absolute",pointerEvents:O}),[O]);q.useLayoutEffect(()=>{if(he.current=!1,d){var Ke;(Ke=ee.current)==null||Ke.render(q.createElement("div",{ref:Z,style:Ne},q.createElement("div",{ref:oe,style:be},q.createElement("div",{ref:I,className:i,style:t,children:n}))))}else{var ke;(ke=ee.current)==null||ke.render(q.createElement("div",{ref:I,style:Ne,className:i,children:n}))}});const ft=q.useRef(!0);AC(Ke=>{if(pe.current){D.updateMatrixWorld(),pe.current.updateWorldMatrix(!0,!1);const ke=d?J.current:E(pe.current,D,R);if(d||Math.abs(W.current-D.zoom)>e||Math.abs(J.current[0]-ke[0])>e||Math.abs(J.current[1]-ke[1])>e){const xe=Yie(pe.current,D);let j=!1;we&&(Array.isArray(f)?j=f.map(Ue=>Ue.current):f!=="blending"&&(j=[A]));const Ve=ft.current;if(j){const Ue=Kie(pe.current,D,V,j);ft.current=Ue&&!xe}else ft.current=!xe;Ve!==ft.current&&(p?p(!ft.current):le.style.display=ft.current?"block":"none");const Oe=Math.floor(y[0]/2),Pe=f?we?[y[0],Oe]:[Oe-1,0]:y;if(le.style.zIndex=`${Jie(pe.current,D,Pe)}`,d){const[Ue,lt]=[R.width/2,R.height/2],We=D.projectionMatrix.elements[5]*lt,{isOrthographicCamera:X,top:F,left:ae,bottom:_e,right:Te}=D,Se=Zie(D.matrixWorldInverse),nt=X?`scale(${We})translate(${IT(-(Te+ae)/2)}px,${IT((F+_e)/2)}px)`:`translateZ(${We}px)`;let Ce=pe.current.matrixWorld;c&&(Ce=D.matrixWorldInverse.clone().transpose().copyPosition(Ce).scale(pe.current.scale),Ce.elements[3]=Ce.elements[7]=Ce.elements[11]=0,Ce.elements[15]=1),le.style.width=R.width+"px",le.style.height=R.height+"px",le.style.perspective=X?"":`${We}px`,Z.current&&oe.current&&(Z.current.style.transform=`${nt}${Se}translate(${Ue}px,${lt}px)`,oe.current.style.transform=ere(Ce,1/((l||10)/400)))}else{const Ue=l===void 0?1:Qie(pe.current,D)*l;le.style.transform=`translate3d(${ke[0]}px,${ke[1]}px,0) scale(${Ue})`}J.current=ke,W.current=D.zoom}}if(!we&&Re.current&&!he.current)if(d){if(Z.current){const ke=Z.current.children[0];if(ke!=null&&ke.clientWidth&&ke!=null&&ke.clientHeight){const{isOrthographicCamera:xe}=D;if(xe||x)k.scale&&(Array.isArray(k.scale)?k.scale instanceof G?Re.current.scale.copy(k.scale.clone().divideScalar(1)):Re.current.scale.set(1/k.scale[0],1/k.scale[1],1/k.scale[2]):Re.current.scale.setScalar(1/k.scale));else{const j=(l||10)/400,Ve=ke.clientWidth*j,Oe=ke.clientHeight*j;Re.current.scale.set(Ve,Oe,1)}he.current=!0}}}else{const ke=le.children[0];if(ke!=null&&ke.clientWidth&&ke!=null&&ke.clientHeight){const xe=1/se.factor,j=ke.clientWidth*xe,Ve=ke.clientHeight*xe;Re.current.scale.set(j,Ve,1),he.current=!0}Re.current.lookAt(Ke.camera.position)}});const dt=q.useMemo(()=>({vertexShader:d?void 0:` /* This shader is from the THREE's SpriteMaterial. We need to turn the backing plane into a Sprite @@ -5863,7 +5863,7 @@ No matching component was found for: void main() { gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); } - `}),[d]);return q.createElement("group",vm({},k,{ref:pe}),f&&!we&&q.createElement("mesh",{castShadow:m,receiveShadow:_,ref:Re},x||q.createElement("planeGeometry",null),S||q.createElement("shaderMaterial",{side:Bs,vertexShader:dt.vertexShader,fragmentShader:dt.fragmentShader})))});let Ff=0;const ire=t4(n=>(Dh.onStart=(e,t,i)=>{n({active:!0,item:e,loaded:t,total:i,progress:(t-Ff)/(i-Ff)*100})},Dh.onLoad=()=>{n({active:!1})},Dh.onError=e=>n(t=>({errors:[...t.errors,e]})),Dh.onProgress=(e,t,i)=>{t===i&&(Ff=i),n({active:!0,item:e,loaded:t,total:i,progress:(t-Ff)/(i-Ff)*100||100})},{errors:[],active:!1,progress:0,item:"",loaded:0,total:0}));var rre=Object.defineProperty,sre=(n,e,t)=>e in n?rre(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Rt=(n,e,t)=>(sre(n,typeof e!="symbol"?e+"":e,t),t);const av=new yu,yN=new Wo,ore=Math.cos(70*(Math.PI/180)),vN=(n,e)=>(n%e+e)%e;let are=class extends Ys{constructor(e,t){super(),Rt(this,"object"),Rt(this,"domElement"),Rt(this,"enabled",!0),Rt(this,"target",new G),Rt(this,"minDistance",0),Rt(this,"maxDistance",1/0),Rt(this,"minZoom",0),Rt(this,"maxZoom",1/0),Rt(this,"minPolarAngle",0),Rt(this,"maxPolarAngle",Math.PI),Rt(this,"minAzimuthAngle",-1/0),Rt(this,"maxAzimuthAngle",1/0),Rt(this,"enableDamping",!1),Rt(this,"dampingFactor",.05),Rt(this,"enableZoom",!0),Rt(this,"zoomSpeed",1),Rt(this,"enableRotate",!0),Rt(this,"rotateSpeed",1),Rt(this,"enablePan",!0),Rt(this,"panSpeed",1),Rt(this,"screenSpacePanning",!0),Rt(this,"keyPanSpeed",7),Rt(this,"zoomToCursor",!1),Rt(this,"autoRotate",!1),Rt(this,"autoRotateSpeed",2),Rt(this,"reverseOrbit",!1),Rt(this,"reverseHorizontalOrbit",!1),Rt(this,"reverseVerticalOrbit",!1),Rt(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),Rt(this,"mouseButtons",{LEFT:Cc.ROTATE,MIDDLE:Cc.DOLLY,RIGHT:Cc.PAN}),Rt(this,"touches",{ONE:bc.ROTATE,TWO:bc.DOLLY_PAN}),Rt(this,"target0"),Rt(this,"position0"),Rt(this,"zoom0"),Rt(this,"_domElementKeyEvents",null),Rt(this,"getPolarAngle"),Rt(this,"getAzimuthalAngle"),Rt(this,"setPolarAngle"),Rt(this,"setAzimuthalAngle"),Rt(this,"getDistance"),Rt(this,"listenToKeyEvents"),Rt(this,"stopListenToKeyEvents"),Rt(this,"saveState"),Rt(this,"reset"),Rt(this,"update"),Rt(this,"connect"),Rt(this,"dispose"),this.object=e,this.domElement=t,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>d.phi,this.getAzimuthalAngle=()=>d.theta,this.setPolarAngle=K=>{let ve=vN(K,2*Math.PI),je=d.phi;je<0&&(je+=2*Math.PI),ve<0&&(ve+=2*Math.PI);let Y=Math.abs(ve-je);2*Math.PI-Y{let ve=vN(K,2*Math.PI),je=d.theta;je<0&&(je+=2*Math.PI),ve<0&&(ve+=2*Math.PI);let Y=Math.abs(ve-je);2*Math.PI-Yi.object.position.distanceTo(i.target),this.listenToKeyEvents=K=>{K.addEventListener("keydown",Ce),this._domElementKeyEvents=K},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",Ce),this._domElementKeyEvents=null},this.saveState=()=>{i.target0.copy(i.target),i.position0.copy(i.object.position),i.zoom0=i.object.zoom},this.reset=()=>{i.target.copy(i.target0),i.object.position.copy(i.position0),i.object.zoom=i.zoom0,i.object.updateProjectionMatrix(),i.dispatchEvent(r),i.update(),l=a.NONE},this.update=(()=>{const K=new G,ve=new G(0,1,0),je=new nr().setFromUnitVectors(e.up,ve),Y=je.clone().invert(),Fe=new G,me=new nr,Ae=2*Math.PI;return function(){const $e=i.object.position;je.setFromUnitVectors(e.up,ve),Y.copy(je).invert(),K.copy($e).sub(i.target),K.applyQuaternion(je),d.setFromVector3(K),i.autoRotate&&l===a.NONE&&se(V()),i.enableDamping?(d.theta+=f.theta*i.dampingFactor,d.phi+=f.phi*i.dampingFactor):(d.theta+=f.theta,d.phi+=f.phi);let At=i.minAzimuthAngle,Bt=i.maxAzimuthAngle;isFinite(At)&&isFinite(Bt)&&(At<-Math.PI?At+=Ae:At>Math.PI&&(At-=Ae),Bt<-Math.PI?Bt+=Ae:Bt>Math.PI&&(Bt-=Ae),At<=Bt?d.theta=Math.max(At,Math.min(Bt,d.theta)):d.theta=d.theta>(At+Bt)/2?Math.max(At,d.theta):Math.min(Bt,d.theta)),d.phi=Math.max(i.minPolarAngle,Math.min(i.maxPolarAngle,d.phi)),d.makeSafe(),i.enableDamping===!0?i.target.addScaledVector(m,i.dampingFactor):i.target.add(m),i.zoomToCursor&&D||i.object.isOrthographicCamera?d.radius=Me(d.radius):d.radius=Me(d.radius*p),K.setFromSpherical(d),K.applyQuaternion(Y),$e.copy(i.target).add(K),i.object.matrixAutoUpdate||i.object.updateMatrix(),i.object.lookAt(i.target),i.enableDamping===!0?(f.theta*=1-i.dampingFactor,f.phi*=1-i.dampingFactor,m.multiplyScalar(1-i.dampingFactor)):(f.set(0,0,0),m.set(0,0,0));let Cn=!1;if(i.zoomToCursor&&D){let It=null;if(i.object instanceof Dn&&i.object.isPerspectiveCamera){const Sn=K.length();It=Me(Sn*p);const kn=Sn-It;i.object.position.addScaledVector(I,kn),i.object.updateMatrixWorld()}else if(i.object.isOrthographicCamera){const Sn=new G(P.x,P.y,0);Sn.unproject(i.object),i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom/p)),i.object.updateProjectionMatrix(),Cn=!0;const kn=new G(P.x,P.y,0);kn.unproject(i.object),i.object.position.sub(kn).add(Sn),i.object.updateMatrixWorld(),It=K.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),i.zoomToCursor=!1;It!==null&&(i.screenSpacePanning?i.target.set(0,0,-1).transformDirection(i.object.matrix).multiplyScalar(It).add(i.object.position):(av.origin.copy(i.object.position),av.direction.set(0,0,-1).transformDirection(i.object.matrix),Math.abs(i.object.up.dot(av.direction))c||8*(1-me.dot(i.object.quaternion))>c?(i.dispatchEvent(r),Fe.copy(i.object.position),me.copy(i.object.quaternion),Cn=!1,!0):!1}})(),this.connect=K=>{i.domElement=K,i.domElement.style.touchAction="none",i.domElement.addEventListener("contextmenu",Le),i.domElement.addEventListener("pointerdown",F),i.domElement.addEventListener("pointercancel",_e),i.domElement.addEventListener("wheel",nt)},this.dispose=()=>{var K,ve,je,Y,Fe,me;i.domElement&&(i.domElement.style.touchAction="auto"),(K=i.domElement)==null||K.removeEventListener("contextmenu",Le),(ve=i.domElement)==null||ve.removeEventListener("pointerdown",F),(je=i.domElement)==null||je.removeEventListener("pointercancel",_e),(Y=i.domElement)==null||Y.removeEventListener("wheel",nt),(Fe=i.domElement)==null||Fe.ownerDocument.removeEventListener("pointermove",ae),(me=i.domElement)==null||me.ownerDocument.removeEventListener("pointerup",_e),i._domElementKeyEvents!==null&&i._domElementKeyEvents.removeEventListener("keydown",Ce)};const i=this,r={type:"change"},s={type:"start"},o={type:"end"},a={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let l=a.NONE;const c=1e-6,d=new MT,f=new MT;let p=1;const m=new G,_=new Ee,S=new Ee,x=new Ee,y=new Ee,E=new Ee,w=new Ee,M=new Ee,O=new Ee,k=new Ee,I=new G,P=new Ee;let D=!1;const A=[],R={};function V(){return 2*Math.PI/60/60*i.autoRotateSpeed}function U(){return Math.pow(.95,i.zoomSpeed)}function se(K){i.reverseOrbit||i.reverseHorizontalOrbit?f.theta+=K:f.theta-=K}function le(K){i.reverseOrbit||i.reverseVerticalOrbit?f.phi+=K:f.phi-=K}const ee=(()=>{const K=new G;return function(je,Y){K.setFromMatrixColumn(Y,0),K.multiplyScalar(-je),m.add(K)}})(),pe=(()=>{const K=new G;return function(je,Y){i.screenSpacePanning===!0?K.setFromMatrixColumn(Y,1):(K.setFromMatrixColumn(Y,0),K.crossVectors(i.object.up,K)),K.multiplyScalar(je),m.add(K)}})(),W=(()=>{const K=new G;return function(je,Y){const Fe=i.domElement;if(Fe&&i.object instanceof Dn&&i.object.isPerspectiveCamera){const me=i.object.position;K.copy(me).sub(i.target);let Ae=K.length();Ae*=Math.tan(i.object.fov/2*Math.PI/180),ee(2*je*Ae/Fe.clientHeight,i.object.matrix),pe(2*Y*Ae/Fe.clientHeight,i.object.matrix)}else Fe&&i.object instanceof zs&&i.object.isOrthographicCamera?(ee(je*(i.object.right-i.object.left)/i.object.zoom/Fe.clientWidth,i.object.matrix),pe(Y*(i.object.top-i.object.bottom)/i.object.zoom/Fe.clientHeight,i.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),i.enablePan=!1)}})();function J(K){i.object instanceof Dn&&i.object.isPerspectiveCamera||i.object instanceof zs&&i.object.isOrthographicCamera?p/=K:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function Z(K){i.object instanceof Dn&&i.object.isPerspectiveCamera||i.object instanceof zs&&i.object.isOrthographicCamera?p*=K:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function oe(K){if(!i.zoomToCursor||!i.domElement)return;D=!0;const ve=i.domElement.getBoundingClientRect(),je=K.clientX-ve.left,Y=K.clientY-ve.top,Fe=ve.width,me=ve.height;P.x=je/Fe*2-1,P.y=-(Y/me)*2+1,I.set(P.x,P.y,1).unproject(i.object).sub(i.object.position).normalize()}function Me(K){return Math.max(i.minDistance,Math.min(i.maxDistance,K))}function Re(K){_.set(K.clientX,K.clientY)}function he(K){oe(K),M.set(K.clientX,K.clientY)}function we(K){y.set(K.clientX,K.clientY)}function Ne(K){S.set(K.clientX,K.clientY),x.subVectors(S,_).multiplyScalar(i.rotateSpeed);const ve=i.domElement;ve&&(se(2*Math.PI*x.x/ve.clientHeight),le(2*Math.PI*x.y/ve.clientHeight)),_.copy(S),i.update()}function be(K){O.set(K.clientX,K.clientY),k.subVectors(O,M),k.y>0?J(U()):k.y<0&&Z(U()),M.copy(O),i.update()}function ft(K){E.set(K.clientX,K.clientY),w.subVectors(E,y).multiplyScalar(i.panSpeed),W(w.x,w.y),y.copy(E),i.update()}function dt(K){oe(K),K.deltaY<0?Z(U()):K.deltaY>0&&J(U()),i.update()}function Ke(K){let ve=!1;switch(K.code){case i.keys.UP:W(0,i.keyPanSpeed),ve=!0;break;case i.keys.BOTTOM:W(0,-i.keyPanSpeed),ve=!0;break;case i.keys.LEFT:W(i.keyPanSpeed,0),ve=!0;break;case i.keys.RIGHT:W(-i.keyPanSpeed,0),ve=!0;break}ve&&(K.preventDefault(),i.update())}function ke(){if(A.length==1)_.set(A[0].pageX,A[0].pageY);else{const K=.5*(A[0].pageX+A[1].pageX),ve=.5*(A[0].pageY+A[1].pageY);_.set(K,ve)}}function xe(){if(A.length==1)y.set(A[0].pageX,A[0].pageY);else{const K=.5*(A[0].pageX+A[1].pageX),ve=.5*(A[0].pageY+A[1].pageY);y.set(K,ve)}}function j(){const K=A[0].pageX-A[1].pageX,ve=A[0].pageY-A[1].pageY,je=Math.sqrt(K*K+ve*ve);M.set(0,je)}function Ve(){i.enableZoom&&j(),i.enablePan&&xe()}function Oe(){i.enableZoom&&j(),i.enableRotate&&ke()}function Pe(K){if(A.length==1)S.set(K.pageX,K.pageY);else{const je=et(K),Y=.5*(K.pageX+je.x),Fe=.5*(K.pageY+je.y);S.set(Y,Fe)}x.subVectors(S,_).multiplyScalar(i.rotateSpeed);const ve=i.domElement;ve&&(se(2*Math.PI*x.x/ve.clientHeight),le(2*Math.PI*x.y/ve.clientHeight)),_.copy(S)}function Ue(K){if(A.length==1)E.set(K.pageX,K.pageY);else{const ve=et(K),je=.5*(K.pageX+ve.x),Y=.5*(K.pageY+ve.y);E.set(je,Y)}w.subVectors(E,y).multiplyScalar(i.panSpeed),W(w.x,w.y),y.copy(E)}function lt(K){const ve=et(K),je=K.pageX-ve.x,Y=K.pageY-ve.y,Fe=Math.sqrt(je*je+Y*Y);O.set(0,Fe),k.set(0,Math.pow(O.y/M.y,i.zoomSpeed)),J(k.y),M.copy(O)}function We(K){i.enableZoom&<(K),i.enablePan&&Ue(K)}function X(K){i.enableZoom&<(K),i.enableRotate&&Pe(K)}function F(K){var ve,je;i.enabled!==!1&&(A.length===0&&((ve=i.domElement)==null||ve.ownerDocument.addEventListener("pointermove",ae),(je=i.domElement)==null||je.ownerDocument.addEventListener("pointerup",_e)),Ze(K),K.pointerType==="touch"?Ge(K):Te(K))}function ae(K){i.enabled!==!1&&(K.pointerType==="touch"?Lt(K):Se(K))}function _e(K){var ve,je,Y;Et(K),A.length===0&&((ve=i.domElement)==null||ve.releasePointerCapture(K.pointerId),(je=i.domElement)==null||je.ownerDocument.removeEventListener("pointermove",ae),(Y=i.domElement)==null||Y.ownerDocument.removeEventListener("pointerup",_e)),i.dispatchEvent(o),l=a.NONE}function Te(K){let ve;switch(K.button){case 0:ve=i.mouseButtons.LEFT;break;case 1:ve=i.mouseButtons.MIDDLE;break;case 2:ve=i.mouseButtons.RIGHT;break;default:ve=-1}switch(ve){case Cc.DOLLY:if(i.enableZoom===!1)return;he(K),l=a.DOLLY;break;case Cc.ROTATE:if(K.ctrlKey||K.metaKey||K.shiftKey){if(i.enablePan===!1)return;we(K),l=a.PAN}else{if(i.enableRotate===!1)return;Re(K),l=a.ROTATE}break;case Cc.PAN:if(K.ctrlKey||K.metaKey||K.shiftKey){if(i.enableRotate===!1)return;Re(K),l=a.ROTATE}else{if(i.enablePan===!1)return;we(K),l=a.PAN}break;default:l=a.NONE}l!==a.NONE&&i.dispatchEvent(s)}function Se(K){if(i.enabled!==!1)switch(l){case a.ROTATE:if(i.enableRotate===!1)return;Ne(K);break;case a.DOLLY:if(i.enableZoom===!1)return;be(K);break;case a.PAN:if(i.enablePan===!1)return;ft(K);break}}function nt(K){i.enabled===!1||i.enableZoom===!1||l!==a.NONE&&l!==a.ROTATE||(K.preventDefault(),i.dispatchEvent(s),dt(K),i.dispatchEvent(o))}function Ce(K){i.enabled===!1||i.enablePan===!1||Ke(K)}function Ge(K){switch(vt(K),A.length){case 1:switch(i.touches.ONE){case bc.ROTATE:if(i.enableRotate===!1)return;ke(),l=a.TOUCH_ROTATE;break;case bc.PAN:if(i.enablePan===!1)return;xe(),l=a.TOUCH_PAN;break;default:l=a.NONE}break;case 2:switch(i.touches.TWO){case bc.DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;Ve(),l=a.TOUCH_DOLLY_PAN;break;case bc.DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;Oe(),l=a.TOUCH_DOLLY_ROTATE;break;default:l=a.NONE}break;default:l=a.NONE}l!==a.NONE&&i.dispatchEvent(s)}function Lt(K){switch(vt(K),l){case a.TOUCH_ROTATE:if(i.enableRotate===!1)return;Pe(K),i.update();break;case a.TOUCH_PAN:if(i.enablePan===!1)return;Ue(K),i.update();break;case a.TOUCH_DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;We(K),i.update();break;case a.TOUCH_DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;X(K),i.update();break;default:l=a.NONE}}function Le(K){i.enabled!==!1&&K.preventDefault()}function Ze(K){A.push(K)}function Et(K){delete R[K.pointerId];for(let ve=0;ve0,O=U>0,k=se>0,I=(M?1:0)+(O?1:0)+(k?1:0),I){case 0:{y.push(S[w]),y.push(S[w+1]),y.push(S[w+2]);break}case 1:{if(M&&(P=S[w+1],D=S[w+2],A=_(S[w],P,x,E),R=_(S[w],D,x,E)),O){P=S[w],D=S[w+2],A=_(S[w+1],P,x,E),R=_(S[w+1],D,x,E),y.push(A),y.push(D.clone()),y.push(P.clone()),y.push(D.clone()),y.push(A.clone()),y.push(R);break}k&&(P=S[w],D=S[w+1],A=_(S[w+2],P,x,E),R=_(S[w+2],D,x,E)),y.push(P.clone()),y.push(D.clone()),y.push(A),y.push(R),y.push(A.clone()),y.push(D.clone());break}case 2:{M||(P=S[w].clone(),D=_(P,S[w+1],x,E),A=_(P,S[w+2],x,E),y.push(P),y.push(D),y.push(A)),O||(P=S[w+1].clone(),D=_(P,S[w+2],x,E),A=_(P,S[w],x,E),y.push(P),y.push(D),y.push(A)),k||(P=S[w+2].clone(),D=_(P,S[w],x,E),A=_(P,S[w+1],x,E),y.push(P),y.push(D),y.push(A));break}}}return y}function _(S,x,y,E){const w=S.position.dot(y)-E,M=x.position.dot(y)-E,O=w/(w-M);return new _N(new G(S.position.x+O*(x.position.x-S.position.x),S.position.y+O*(x.position.y-S.position.y),S.position.z+O*(x.position.z-S.position.z)),new G(S.normal.x+O*(x.normal.x-S.normal.x),S.normal.y+O*(x.normal.y-S.normal.y),S.normal.z+O*(x.normal.z-S.normal.z)))}}}class _N{constructor(e,t){this.position=e,this.normal=t}clone(){return new this.constructor(this.position.clone(),this.normal.clone())}}const C1=n=>n===Object(n)&&!Array.isArray(n)&&typeof n!="function";function bC(n,e){const t=Kr(s=>s.gl),i=Qm(kx,C1(n)?Object.values(n):n);return q.useLayoutEffect(()=>{e==null||e(i)},[e]),q.useEffect(()=>{if("initTexture"in t){let s=[];Array.isArray(i)?s=i:i instanceof In?s=[i]:C1(i)&&(s=Object.values(i)),s.forEach(o=>{o instanceof In&&t.initTexture(o)})}},[t,i]),q.useMemo(()=>{if(C1(n)){const s={};let o=0;for(const a in n)s[a]=i[o++];return s}else return i},[n,i])}bC.preload=n=>Qm.preload(kx,n);bC.clear=n=>Qm.clear(kx,n);function cre(n){return Array.isArray(n)}function b1(n=[0,0,0]){return cre(n)?n:n instanceof G||n instanceof _r?[n.x,n.y,n.z]:[n,n,n]}const ure=q.forwardRef(function({debug:e,depthTest:t=!1,polygonOffsetFactor:i=-10,map:r,mesh:s,children:o,position:a,rotation:l,scale:c,...d},f){const p=q.useRef(null);q.useImperativeHandle(f,()=>p.current);const m=q.useRef(null);return q.useLayoutEffect(()=>{const _=(s==null?void 0:s.current)||p.current.parent,S=p.current;if(!(_ instanceof ni))throw new Error('Decal must have a Mesh as parent or specify its "mesh" prop');const x={position:new G,rotation:new _r,scale:new G(1,1,1)};if(_){lo(x,{position:a,scale:c});const y=_.matrixWorld.clone();if(_.matrixWorld.identity(),!l||typeof l=="number"){const E=new Zt;E.position.copy(x.position),E.lookAt(_.position),typeof l=="number"&&E.rotateZ(l),lo(x,{rotation:E.rotation})}else lo(x,{rotation:l});return S.geometry=new lre(_,x.position,x.rotation,x.scale),m.current&&(lo(m.current,x),m.current.traverse(E=>E.raycast=()=>null)),_.matrixWorld=y,()=>{S.geometry.dispose()}}},[s,...b1(a),...b1(c),...b1(l)]),q.createElement("mesh",vm({ref:p,"material-transparent":!0,"material-polygonOffset":!0,"material-polygonOffsetFactor":i,"material-depthTest":t,"material-map":r},d),o,e&&q.createElement("mesh",{ref:m},q.createElement("boxGeometry",null),q.createElement("meshNormalMaterial",{wireframe:!0}),q.createElement("axesHelper",null)))}),hre=q.forwardRef(({makeDefault:n,camera:e,regress:t,domElement:i,enableDamping:r=!0,keyEvents:s=!1,onChange:o,onStart:a,onEnd:l,...c},d)=>{const f=Kr(k=>k.invalidate),p=Kr(k=>k.camera),m=Kr(k=>k.gl),_=Kr(k=>k.events),S=Kr(k=>k.setEvents),x=Kr(k=>k.set),y=Kr(k=>k.get),E=Kr(k=>k.performance),w=e||p,M=i||_.connected||m.domElement,O=q.useMemo(()=>new are(w),[w]);return AC(()=>{O.enabled&&O.update()},-1),q.useEffect(()=>(s&&O.connect(s===!0?M:s),O.connect(M),()=>void O.dispose()),[s,M,t,O,f]),q.useEffect(()=>{const k=D=>{f(),t&&E.regress(),o&&o(D)},I=D=>{a&&a(D)},P=D=>{l&&l(D)};return O.addEventListener("change",k),O.addEventListener("start",I),O.addEventListener("end",P),()=>{O.removeEventListener("start",I),O.removeEventListener("end",P),O.removeEventListener("change",k)}},[o,a,l,O,f,S]),q.useEffect(()=>{if(n){const k=y().controls;return x({controls:O}),()=>x({controls:k})}},[n,O]),q.createElement("primitive",vm({ref:d,object:O,enableDamping:r},c))}),dre=q.forwardRef(({children:n,enabled:e=!0,speed:t=1,rotationIntensity:i=1,floatIntensity:r=1,floatingRange:s=[-.1,.1],autoInvalidate:o=!1,...a},l)=>{const c=q.useRef(null);q.useImperativeHandle(l,()=>c.current,[]);const d=q.useRef(Math.random()*1e4);return AC(f=>{var p,m;if(!e||t===0)return;o&&f.invalidate();const _=d.current+f.clock.getElapsedTime();c.current.rotation.x=Math.cos(_/4*t)/8*i,c.current.rotation.y=Math.sin(_/4*t)/8*i,c.current.rotation.z=Math.sin(_/4*t)/20*i;let S=Math.sin(_/4*t)/10;S=jF.mapLinear(S,-.1,.1,(p=s==null?void 0:s[0])!==null&&p!==void 0?p:-.1,(m=s==null?void 0:s[1])!==null&&m!==void 0?m:.1),c.current.position.y=S*r,c.current.updateMatrix()}),q.createElement("group",a,q.createElement("group",{ref:c,matrixAutoUpdate:!1},n))});function fre({all:n,scene:e,camera:t}){const i=Kr(({gl:o})=>o),r=Kr(({camera:o})=>o),s=Kr(({scene:o})=>o);return q.useLayoutEffect(()=>{const o=[];n&&(e||s).traverse(c=>{c.visible===!1&&(o.push(c),c.visible=!0)}),i.compile(e||s,t||r);const a=new JM(128);new QM(.01,1e5,a).update(i,e||s),a.dispose(),o.forEach(c=>c.visible=!1)},[]),null}const pre=()=>{const{progress:n}=ire(),e={display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column"},t={fontSize:14,color:"#F1F1F1",fontWeight:800,marginTop:40};return B.jsxs(nre,{as:"div",center:!0,style:e,children:[B.jsx("span",{className:"canvas-loader"}),B.jsxs("p",{style:t,children:[n.toFixed(0),"%"]})]})},mre=n=>{const[e]=bC([n.imgUrl]);return B.jsxs(dre,{speed:1,rotationIntensity:0,floatIntensity:5,children:[B.jsx("ambientLight",{intensity:2.4}),B.jsx("directionalLight",{position:[0,0,.05]}),B.jsxs("mesh",{castShadow:!0,receiveShadow:!0,scale:2.75,children:[B.jsx("icosahedronGeometry",{args:[1,1]}),B.jsx("meshStandardMaterial",{color:"#fcd4d4",polygonOffset:!0,polygonOffsetFactor:-5,flatShading:!0}),B.jsx(ure,{position:[0,0,1],rotation:[2*Math.PI,0,6.25],scale:1,map:e,flatShading:!0})]})]})},gre=({icon:n})=>B.jsxs(Xie,{frameloop:"demand",dpr:[1,2],gl:{preserveDrawingBuffer:!0},children:[B.jsxs(q.Suspense,{fallback:B.jsx(pre,{}),children:[B.jsx(hre,{enableZoom:!1}),B.jsx(mre,{imgUrl:n})]}),B.jsx(fre,{all:!0})]}),yre="/portfolio-react-threejs/assets/texture-5adaf7bf.webp",vre=()=>B.jsxs("section",{className:"xl:mt-6 flex flex-row flex-wrap justify-center items-center gap-10",children:[B.jsxs(er.div,{variants:Lm(),children:[B.jsx("h2",{className:`${sr.sectionHeadText} text-center`,children:"Skills & Technologies."}),B.jsx("p",{className:`${sr.sectionSubText} text-center`,children:"What have i learnd?"})]}),B.jsx("div",{className:"w-full lg:w-[400px] lg:h-[400px] ",children:B.jsx(gre,{icon:yre})},"skillsBall")]}),_re=Td(vre,"TechSkillsSection"),xre="/portfolio-react-threejs/assets/cover_img-4c0efeb6.webp",xN="/portfolio-react-threejs/assets/resume-bb345e2c.pdf",Sre=()=>{const[n,e]=q.useState(!1),t=()=>e(!0),i=()=>e(!1),r=()=>{const s=document.createElement("a");s.href=xN,s.download="Satyam_Mishra_Resume",s.click()};return B.jsxs("section",{className:"-m-5 md:-m-10 max-w-screen-xl mx-auto my-10 space-y-10 max",children:[B.jsxs(er.div,{variants:Lm(0),children:[B.jsx("h2",{className:`${sr.sectionHeadText} text-center`,children:"Resume."}),B.jsx("p",{className:`${sr.sectionSubText} text-center`,children:"Here's my Resume😁"})]}),B.jsx(er.div,{variants:Ed("right","spring",.5*0,.75),className:"md:flex justify-center items-center",children:B.jsxs(G_,{options:{max:45,scale:1,speed:450},className:"group bg-white shadow-[#fcd4d4] shadow-card rounded-2xl mx-auto w-[90%] md:min-w-1/3 md:max-w-3xl h-full",children:[B.jsx("div",{className:"group-hover:opacity-100 relative w-full h-full mb-5",children:B.jsx("img",{src:xre,loading:"lazy",alt:"Resume cover image",className:"w-full h-full object-cover rounded-2xl"})}),B.jsxs("div",{className:"text-primary flex items-center space-x-5 md:space-y-5 justify-center absolute z-10 md:top-10 md:-right-24 md:bottom-0 md:flex-col md:items-center md:justify-center transition-opacity duration-300",children:[B.jsxs("button",{onClick:r,className:"mt-8 bg-blue-500 hover:bg-blue-300 font-bold py-3 px-6 rounded-full flex items-center",children:["Download ",B.jsx("span",{className:"ml-2",children:"▶"})]}),B.jsxs("button",{onClick:t,className:"mt-8 bg-green-500 hover:bg-green-300 font-bold py-3 px-6 rounded-full flex items-center",children:["View ",B.jsx("span",{className:"ml-2",children:"▶"})]})]})]})}),n&&B.jsx("div",{className:"fixed inset-0 z-50 overflow-auto -top-10 bg-black bg-opacity-60 flex items-center justify-center",children:B.jsxs("div",{className:"bg-white p-2 rounded-2xl max-w-screen-lg w-[70%] relative",children:[B.jsx("button",{className:"absolute -top-12 right-0 md:top-2 md:-right-20 bg-black hover:bg-gray-800 py-2 px-3 rounded-xl text-white hover:text-gray-200",onClick:i,children:"Close"}),B.jsx("iframe",{title:"PDF Viewer",src:xN,className:"w-full h-[400px]"})]})})]})},wre=Td(Sre,"ResumeSection"),Ere="data:image/webp;base64,UklGRggMAABXRUJQVlA4WAoAAAAwAAAA7wAA7wAASUNDUMgBAAAAAAHIAAAAAAQwAABtbnRyUkdCIFhZWiAH4AABAAEAAAAAAABhY3NwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAA9tYAAQAAAADTLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlkZXNjAAAA8AAAACRyWFlaAAABFAAAABRnWFlaAAABKAAAABRiWFlaAAABPAAAABR3dHB0AAABUAAAABRyVFJDAAABZAAAAChnVFJDAAABZAAAAChiVFJDAAABZAAAAChjcHJ0AAABjAAAADxtbHVjAAAAAAAAAAEAAAAMZW5VUwAAAAgAAAAcAHMAUgBHAEJYWVogAAAAAAAAb6IAADj1AAADkFhZWiAAAAAAAABimQAAt4UAABjaWFlaIAAAAAAAACSgAAAPhAAAts9YWVogAAAAAAAA9tYAAQAAAADTLXBhcmEAAAAAAAQAAAACZmYAAPKnAAANWQAAE9AAAApbAAAAAAAAAABtbHVjAAAAAAAAAAEAAAAMZW5VUwAAACAAAAAcAEcAbwBvAGcAbABlACAASQBuAGMALgAgADIAMAAxADZBTFBIggkAAAGwBgC0MTfWGWamsV3bbVDbdvu29tp23dRuk7VRu12btW0H89Kkk0wwcx6Ce8+959tf721ETAD87f//pevfqP+jaW9v+fHERZfrHuI9l+viiR+3vJX2aP9G/n81nMlTln+biVLvfLN8SrLzr0HMgLSfPUi05ETG+OrGztE9bT+Sv5AxwGHQQibsdKOi7h3jgw2X/5jtHlTas220v5FqlJaDGrybkWSQnNMPoDb3T3MYn8jnb6BWM9PijE3V9ALUbsHaROMSlVaIWi7KiDMmYUsKUNsFi0ONh3V6Jmo953Grweh5ArV/rLuRCMtAFtdHGoYRmcika7oxiNuDjO6ONQCDs5DVrEHcOVcgux/4s1b/JDJ8vC5jA/6JLOcN48oy34dM++ZaWPLfhozvCWQoZh+yfjienUaXkflLDZlJykb2Xa1Z6XAXDWB+V0a65KMhdPdio6cHDaKnBxNt89EwujuxkJqHBvJuCgONXGgosxtqL+YyGsxL0Zpz/o6Gc7+/1izb0IBuMetsPhrS2Rob5DMmvmHaqpuLBjWvgab8T6JhPVZFT2+ggV2rpcEoPbuWf2i9HtNW/1akH8+vq6Z2rxvqXztbmG+AhuKy5A2CcgMGvOnSSU5Gf38od6gwzIzRzx6U/g1U2G/UL7r4abgdKvy9MNypnXEof2DFAKDD7zr4tR1Udog4HK2ZqCx5LmulwDTinGrnhpug0rZccXci9PIJyt8IIh1LvCp5F/qByC3i8H2t9ESCrwgB6HpVnUudQOwLErCLRqwnKIwWBBE/qvJtGAgeIOOIRR+PIMVWosDv/cpk7duw+JH+bVrWjAu1WEMTaia1HfDY0s0HXZV52w6im8nAB7QRlk0iShiYVpSXtWtGv0gQHjtw9heu8paA+GgpmSG6WIIkg8SBaQUiurdPrwnyTXUf2lOIiEtAYogUXKCJuAIagRLAvC69nxPI+g9+K90kI0iOO0YPa5Cmvwy9BsrB5Vqo5jEWAZIKE3SQjkTjuUiQhKs1EFlApTkXSbLcEerNQKo9uegjC19VzplJZgwXE6Tddqg2Dcm+ysUMaThFtQN0PuTiM3l/KpaEdPdxcUgetlArnVCeiQezm8BqpfzvEsI6PDRAgrlVVBqLlMfwMJECjlJpB6kVPKwjsVmhEA+pP3g4SKIwUJ2JSLo0lINwLwkco85OWjiYg+FIc6syDjex+RwsJ5JvV6UX0r4czUH1TBrYVZXltAqSgMX2RTQWqnKa1jBg8iEaxxSJQ9IZwOYGEhijxkhS5wP5iLhFYogayyh5WwOjA0ksVmMfpXRgdTuF35RwFhNyRfJS20OgyKFCChJ+HJhdQACTVJhK6LaDm7B8AhNVWEHoWWB3GYElKnxHJzeYn4QieV+pcIfOCmD4c3k3FfBHukkcDZDnq0KvMZ0TwLH1tjRsQK8/nddYgnXy+tJ7lE5bnobLe4heGpk8G0/hXmnz6L1FZjcwfUjaG/S2kpnP1fvSNtH7icwErl6S9j29U2RacTVE2nF618jEcZUk7Qq9TDIBXNWVdoteLhWvmatYaS56BVTuAdeB0tz0SqmUsBUlrZSelwr6cVVDPx4yYVw1kVZIL49MDa7aScujl0OmC1djpGXTu05mGlevS7tC7ziZNK4+lHaE3s9ktnO1T9qP9HaQyTHzFFgibQe998hgU556o/S36M2l8whP8+XNpPcQnb08HZX3AL2BdEpiOGqK8gfQa0EHn+BoIYFG9AJ8dA4yZLsmz+ekBzfoYE9+JqH8a6DgN4R+ZMdylsDXKqwhhJ24GYMEF6owjdJhGy9VLlIYqUISJXyGl2VIsaYK9iJK7pqcJJdSyDGpAAcp4c92PoJOIsUvQcmVpHANG6YNSHKuGsNp4WQuXkWaw9SI9tEq6sfDZC+N0nA14CQt9PTlYIIXaf4Kii4lhp6++hvvRaKvqtKTGpY8rznT816kmqyKXz41xDftOgvYhGQzzarAVnr4Sy19NT+OdD8AZccogPceM+vJNqMYCd+nTlChAog/1NdRymGk7A5SB7Ypgd711XRTLcOLpD8AhUepgeieF66T+DXFSLy7Sg6XIoieD5roouUHxUj9mkUlWKMMou+roQ71Asb8igrOAaVTFELEux/0tankHLa+AFX01VEL/lQKEXM+mVJNjboPbcpDRX8Gxcep9t/n1o1vbKVkbznlnSuo8CjV/G5r4L8L/lj3QM/adll+9fs8+uaBIlT7vEU1mKGJsksvv2oRZ3n9mg91+CAoH54v6tLQyLovnqHmug+kjs7VwR2nerBEVFcAAPOQk6QO1QTJNQ5r4BXQYJxH0MD/ArA9U0jnS3+QHvilcvlhOoAVgq7VKwOgySkqOx1A0LFXtcWgxah8MXh3aFkQ8iWN35xA0rlfLVeYHmCWIPQ+WBbYN1G4GAVEq2Yq9SRoMuiOIPSNKAusW+QVpwLZziUKnbPrAqaJQndSWVBln7TngPALCg0FbZoPiMKrQWVB7FVJf5op2Y4q8wNotJ1PFC4rB5rlSSlNAtLtfIp4k3UCbworaVYODPPJeBOIv6XIatBq6E1RuK08mCPBk0gttlCJCwF6geHCfA3LM70jbiWQT1fB1wV0u14UvlMemJeJ8taiV7tUgTWg3fAbou4FlAcw8IKY7aDg5/QuBugHevoE4YSKgLn7gq9PuYoQ81xXLxz7dfs7aQ/3behQoSc5XxfQ8VJRX1dIn9Y71OaDlm0/C/Im6gjWEvvGoidIzBKDz2upE60rkaDrXqViTmjJXkjJkwL6fkYMpuoIfqU0FXT+rph0LS0j9CZo3e9HIe5IHY2ms9umNwg9LgJn66g9md/8QffxV0S4a2moPpWzUaD/RlkC8EuzfiKIXE0EDlu4BOBy/ZhpZDcAHlNyBeBck26ARFYScNnKJQA3BvNzoyHw2ey2ALw52sTMhZrAab2rAhBPPhDKyYk44DX+sAjEkh9mjmySGMzCvgjgNugLIUJ1tT0Q+LVlMOabYwaWpxdxdW84cN3+Fk8XmwLfMV9z9FUEcG56vJibwufNwHzbc7wcaAT8O9O8fJSm2cEQdjvPxdk2YBQdMzwcuGc4wEA2+Ep7vk8TwGB2P6a3Qx3BeNoeuamvGw9YwJD6Tb+lpyuPO8GwBjx1TT/nJtvA0NonHNfLsbFWMLymLuuLK2RVxYaI7vfagUGOfelUBaJVqYqHHw4BI5266nZZjVSJTwXDbU6acRoR/6GKUa85ff2Cv1Z/+///8wRWUDggkAAAAFAPAJ0BKvAA8AA+bTaZSaQjIqEgKACADYlpbuF2sRtACewD32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D31gAAP7/1gAAAAAAAAAAAA==",Tre="/portfolio-react-threejs/assets/appstore-0b8f390b.png",Are="/portfolio-react-threejs/assets/colab-9e4861eb.png",Mre="/portfolio-react-threejs/assets/huggingface-720eadc9.png",SN="/portfolio-react-threejs/assets/website-078d1216.gif",Cre=({index:n,name:e,description:t,tags:i,image:r,source_code_link:s,date:o})=>B.jsx(G_,{className:"sm:w-[360px] w-full",children:B.jsx(er.div,{id:n,variants:Ed("right","spring",0,.75),className:"shadow-[#fcd4d4] green-pink-gradient shadow-card p-[1px] rounded-2xl ",children:B.jsxs("div",{className:"bg-primary rounded-2xl py-5 px-8",options:{max:45,scale:1,speed:450},children:[B.jsxs("div",{className:"relative w-full h-[230px]",children:[B.jsx("img",{src:r,alt:"project_image",className:"w-full h-full object-cover rounded-2xl"}),B.jsx("div",{className:"absolute inset-0 z-10 space-y-3 flex-col justify-end m-3 card-img_hover",children:Object.entries(s).map(([a,l])=>B.jsx("div",{onClick:()=>window.open(l,"_blank"),className:"border-black border-2 white-gradient w-10 h-10 rounded-full flex justify-center items-center cursor-pointer",title:a==="Github"?"View in GitHub":a==="Appstore"?"View in App Store":a==="Colab"?"View in Google Colab":a==="Huggingface"?"View in Hugging Face":a==="Live"?"View Live Website":"View Now",children:B.jsx("img",{src:a==="Github"?Ere:a==="Appstore"?Tre:a==="Colab"?Are:a==="Huggingface"?Mre:SN,alt:`${a} link`,className:"w-1/2 h-1/2 object-contain"})},a))})]}),B.jsxs("div",{className:"mt-5",children:[B.jsx("h3",{className:"text-black font-bold text-[24px]",children:e}),B.jsx("p",{className:"mt-2 text-secondary text-[14px]",children:t})]}),B.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[Object.entries(i).map(([a,l])=>B.jsxs("p",{className:`text-[14px] ${l}`,children:["#",a," "]},`${e}-${a}`))," "]}),B.jsx("p",{children:o})]})})}),bre=()=>{const[n,e]=q.useState([]);return q.useEffect(()=>{(async()=>{const r=(await LM(IM(NM,"Projects"))).docs.map(s=>s.data()).sort((s,o)=>o.index-s.index);e(r)})()},[]),B.jsxs("section",{className:"-m-5 md:-m-10 ",children:[B.jsxs(er.div,{variants:Lm(0),children:[B.jsx("h2",{className:`${sr.sectionHeadText} text-center`,children:"Projects."}),B.jsx("p",{className:`${sr.sectionSubText} text-center`,children:"My works? Here they are."})]}),B.jsxs("div",{className:" mt-20 grid md:grid-cols-2 lg:grid-cols-3 gap-5",children:[n.map((t,i)=>B.jsx(Cre,{index:i,...t},`project-${i}`))," "]})]})},Pre=Td(bre,"ProjectsSection"),Rre=({index:n,name:e,date:t,image:i,link:r})=>B.jsx("div",{id:n,children:B.jsx(er.div,{variants:Ed("right","spring",.5,.75),children:B.jsx(G_,{options:{max:45,scale:1,speed:450},className:"bg-white shadow-[#fcd4d4] shadow-card p-5 rounded-2xl sm:w-[360px] w-full",children:B.jsxs("a",{href:r,target:"_blank",children:[B.jsx("div",{className:"relative w-full ",children:B.jsx("img",{src:i,placeholder:e,loading:"lazy",alt:`${e} cover image`,className:"w-full h-52 object-cover rounded-2xl"})}),B.jsx("p",{className:"mt-3 text-left",children:t}),B.jsx("h3",{className:"text-black font-bold text-[24px] text-left",children:e})]})})})});function Ire(){const[n,e]=q.useState([]);return q.useEffect(()=>{(async()=>{const r=(await LM(IM(NM,"Blogs"))).docs.map(s=>s.data()).sort((s,o)=>o.index-s.index);e(r)})()},[]),B.jsxs("div",{className:"my-10",children:[B.jsxs("div",{children:[B.jsx("h2",{className:`${sr.sectionHeadText} text-center`,children:"Blogs."}),B.jsx("p",{className:`${sr.sectionSubText} text-center`,children:"Blogs written by me"})]}),B.jsx("div",{className:"my-20 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-5",children:n.map((t,i)=>B.jsx(Rre,{index:i,...t},`blog-${i}`))})]})}const Lre=Td(Ire,"BlogsSections"),_m={_origin:"https://api.emailjs.com"},Nre=(n,e="https://api.emailjs.com")=>{_m._userID=n,_m._origin=e},A4=(n,e,t)=>{if(!n)throw"The public key is required. Visit https://dashboard.emailjs.com/admin/account";if(!e)throw"The service ID is required. Visit https://dashboard.emailjs.com/admin";if(!t)throw"The template ID is required. Visit https://dashboard.emailjs.com/admin/templates";return!0};class wN{constructor(e){this.status=e?e.status:0,this.text=e?e.responseText:"Network Error"}}const M4=(n,e,t={})=>new Promise((i,r)=>{const s=new XMLHttpRequest;s.addEventListener("load",({target:o})=>{const a=new wN(o);a.status===200||a.text==="OK"?i(a):r(a)}),s.addEventListener("error",({target:o})=>{r(new wN(o))}),s.open("POST",_m._origin+n,!0),Object.keys(t).forEach(o=>{s.setRequestHeader(o,t[o])}),s.send(e)}),Dre=(n,e,t,i)=>{const r=i||_m._userID;return A4(r,n,e),M4("/api/v1.0/email/send",JSON.stringify({lib_version:"3.12.1",user_id:r,service_id:n,template_id:e,template_params:t}),{"Content-type":"application/json"})},kre=n=>{let e;if(typeof n=="string"?e=document.querySelector(n):e=n,!e||e.nodeName!=="FORM")throw"The 3rd parameter is expected to be the HTML form element or the style selector of form";return e},Ore=(n,e,t,i)=>{const r=i||_m._userID,s=kre(t);A4(r,n,e);const o=new FormData(s);return o.append("lib_version","3.12.1"),o.append("service_id",n),o.append("template_id",e),o.append("user_id",r),M4("/api/v1.0/email/send-form",o)},EN={init:Nre,send:Dre,sendForm:Ore},Ure=()=>{const n=q.useRef(),[e,t]=q.useState({name:"",email:"",message:""}),[i,r]=q.useState(!1),[s,o]=q.useState(!1),a=c=>{const{target:d}=c,{name:f,value:p}=d;t({...e,[f]:p})},l=c=>{c.preventDefault(),r(!0),EN.init("Tlnn1O7PC8WlYPRT7"),EN.send("service_w2nrv74","template_hmf109b",{from_name:e.name,to_name:"Satyam Mishra",from_email:e.email,to_email:"satyammishra9050@gmail.com",message:e.message}).then(()=>{r(!1),o(!0),t({name:"",email:"",message:""})},d=>{r(!1),console.error(d),alert("Ahh, something went wrong. Please try again.")})};return B.jsxs("footer",{id:"ContactSection",className:"lg:grid lg:grid-cols-5 bg-black h-fit ",children:[B.jsxs("div",{className:"relative p-12 block h-32 lg:col-span-2 lg:h-full",children:[B.jsx("p",{className:`${sr.sectionSubText} text-white`,children:"I am open to work"}),B.jsx("h3",{className:`${sr.sectionHeadText} text-primary`,children:"Get In Touch."}),s?B.jsxs("div",{children:[B.jsx("p",{className:"text-green-500 mt-2",children:"Thank you. I have recieved your msg."}),B.jsx("p",{className:"text-green-500",children:"I will get back to you right on."})]}):B.jsxs("form",{ref:n,onSubmit:l,className:"flex flex-col gap-1",children:[B.jsxs("label",{className:"flex flex-col",children:[B.jsx("span",{className:"text-black font-medium mb-1",children:"Your Name"}),B.jsx("input",{type:"text",name:"name",value:e.name,onChange:a,placeholder:"What's your good name?",className:"bg-blue-50 py-4 px-6 placeholder:text-secondary text-black rounded-lg outline-none border-none font-medium"})]}),B.jsxs("label",{className:"flex flex-col",children:[B.jsx("span",{className:"text-black font-medium mb-1",children:"Your Email"}),B.jsx("input",{type:"email",name:"email",value:e.email,onChange:a,placeholder:"What's your email?",className:"bg-blue-50 py-4 px-6 placeholder:text-secondary text-black rounded-lg outline-none border-none font-medium"})]}),B.jsxs("label",{className:"flex flex-col",children:[B.jsx("span",{className:"text-black font-medium mb-1",children:"Your Message"}),B.jsx("textarea",{name:"message",value:e.message,onChange:a,placeholder:"What's your message?",className:"bg-blue-50 py-4 px-6 placeholder:text-secondary text-black rounded-lg outline-none border-none font-medium"})]}),B.jsx("button",{type:"submit","aria-busy":i,className:"mt-6 bg-secondary hover:bg-slate-600 py-3 px-8 rounded-xl outline-none w-fit text-primary font-bold",children:i?"Sending...":"Send"})]})]}),B.jsxs("div",{className:"px-4 py-16 sm:px-6 lg:col-span-3 lg:px-8",children:[B.jsxs("div",{className:"grid grid-cols-1 gap-8 sm:grid-cols-2",children:[B.jsxs("div",{children:[B.jsxs("p",{children:[B.jsx("span",{className:"text-xs uppercase tracking-wide text-gray-200",children:" Mail me "}),B.jsx("a",{href:"mailto:satyam.work.only@gmail.com?subject=Just%20wondaring&body=Nothing%20much.",className:"animate-pulse block text-2xl font-medium text-gray-400 hover:opacity-75 sm:text-3xl",children:"Click here to mail."})]}),B.jsxs("ul",{className:"text-gray-200 mt-8 flex gap-6",children:[B.jsx("li",{children:B.jsxs("a",{href:"https://www.instagram.com/satyammishra9050/",rel:"noreferrer",target:"_blank",className:"transition hover:opacity-75",children:[B.jsx("span",{className:"sr-only",children:"Instagram"}),B.jsx("svg",{className:"size-6",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:B.jsx("path",{fillRule:"evenodd",d:"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z",clipRule:"evenodd"})})]})}),B.jsx("li",{children:B.jsxs("a",{href:"https://x.com/bedeadmishra",rel:"noreferrer",target:"_blank",className:"transition hover:opacity-75",children:[B.jsx("span",{className:"sr-only",children:"Twitter"}),B.jsx("svg",{className:"size-6",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:B.jsx("path",{d:"M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84"})})]})}),B.jsx("li",{children:B.jsxs("a",{href:"https://github.com/bedead",rel:"noreferrer",target:"_blank",className:"transition hover:opacity-75",children:[B.jsx("span",{className:"sr-only",children:"GitHub"}),B.jsx("svg",{className:"size-6",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:B.jsx("path",{fillRule:"evenodd",d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z",clipRule:"evenodd"})})]})}),B.jsx("li",{children:B.jsxs("a",{href:"https://www.linkedin.com/in/theaiguysatyam/",rel:"noreferrer",target:"_blank",className:"transition hover:opacity-75",children:[B.jsx("span",{className:"sr-only",children:"Linkedin"}),B.jsx("svg",{className:"size-6",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24",children:B.jsx("path",{d:"M 5.75 3 C 4.2400226 3 3 4.2400226 3 5.75 L 3 18.25 C 3 19.759977 4.2400226 21 5.75 21 L 18.25 21 C 19.759977 21 21 19.759977 21 18.25 L 21 5.75 C 21 4.2400226 19.759977 3 18.25 3 L 5.75 3 z M 5.75 4.5 L 18.25 4.5 C 18.950023 4.5 19.5 5.0499774 19.5 5.75 L 19.5 18.25 C 19.5 18.950023 18.950023 19.5 18.25 19.5 L 5.75 19.5 C 5.0499774 19.5 4.5 18.950023 4.5 18.25 L 4.5 5.75 C 4.5 5.0499774 5.0499774 4.5 5.75 4.5 z M 8.1855469 6.7851562 C 7.4445469 6.7851563 7 7.2293594 7 7.8183594 C 7 8.4113594 7.444375 8.8574219 8.109375 8.8574219 C 8.850375 8.8574219 9.2910156 8.4113594 9.2910156 7.8183594 C 9.2910156 7.2303594 8.8505469 6.7851562 8.1855469 6.7851562 z M 7.0625 9.9628906 L 7.0625 16 L 9.2363281 16 L 9.2363281 9.9628906 L 7.0625 9.9628906 z M 11.033203 9.9628906 L 11.033203 16 L 13.207031 16 L 13.207031 12.697266 C 13.207031 11.718266 13.908141 11.574219 14.119141 11.574219 C 14.330141 11.574219 14.892578 11.785266 14.892578 12.697266 L 14.892578 16 L 17 16 L 17 12.697266 C 17 10.806266 16.154516 9.9628906 15.103516 9.9628906 C 14.052516 9.9628906 13.490031 10.312641 13.207031 10.806641 L 13.207031 9.9628906 L 11.033203 9.9628906 z"})})]})})]})]}),B.jsxs("div",{className:"text-gray-400 grid grid-cols-1 gap-4 sm:grid-cols-2",children:[B.jsxs("div",{children:[B.jsx("p",{className:"font-medium text-gray-200",children:"Top Projects"}),B.jsxs("ul",{className:"mt-6 space-y-4 text-sm",children:[B.jsx("li",{children:B.jsx("a",{href:"https://github.com/bedead/lung-cancer-classification-yoloV8---gradio",className:"transition hover:opacity-75",children:" PATENT - CLASSIFICATION OF LUNG CANCER USING DEEP LEARNING TECHNIQUES. "})}),B.jsx("li",{children:B.jsx("a",{href:"https://colab.research.google.com/drive/1a6LATySYKaS8qqfk_4maSaV4guvTRA-8?usp=sharing",className:"transition hover:opacity-75",children:" ConvoGen AI "})}),B.jsx("li",{children:B.jsx("a",{href:"https://github.com/bedead/Anon-Exchange-chatting",className:"transition hover:opacity-75",children:" Anon Exchange "})})]})]}),B.jsxs("div",{children:[B.jsx("p",{className:"font-medium text-gray-200",children:"Free tools"}),B.jsx("ul",{className:"mt-6 space-y-4 text-sm",children:B.jsx("li",{children:B.jsx("a",{href:"https://downloadtube-iota.vercel.app/",target:"_blank",className:"transition hover:opacity-75",children:" DownloadTube "})})})]})]})]}),B.jsx("div",{className:"mt-12 border-t text-gray-300 border-gray-100 pt-12",children:B.jsx("div",{className:"sm:flex sm:items-center sm:justify-between",children:B.jsx("p",{className:"mt-8 text-sm sm:mt-0",children:"© 2024. Bedead. Made with 💖."})})})]})]})};function Fre(){return B.jsxs("div",{children:[B.jsx(j$,{}),B.jsx(qW,{}),B.jsx(W$,{}),B.jsx(_re,{}),B.jsx(wre,{}),B.jsx(Pre,{}),B.jsx(Lre,{}),B.jsx(Ure,{})]})}function PC(n,e){var t={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(n);r(Dh.onStart=(e,t,i)=>{n({active:!0,item:e,loaded:t,total:i,progress:(t-Ff)/(i-Ff)*100})},Dh.onLoad=()=>{n({active:!1})},Dh.onError=e=>n(t=>({errors:[...t.errors,e]})),Dh.onProgress=(e,t,i)=>{t===i&&(Ff=i),n({active:!0,item:e,loaded:t,total:i,progress:(t-Ff)/(i-Ff)*100||100})},{errors:[],active:!1,progress:0,item:"",loaded:0,total:0}));var rre=Object.defineProperty,sre=(n,e,t)=>e in n?rre(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Rt=(n,e,t)=>(sre(n,typeof e!="symbol"?e+"":e,t),t);const av=new yu,yN=new Wo,ore=Math.cos(70*(Math.PI/180)),vN=(n,e)=>(n%e+e)%e;let are=class extends Ys{constructor(e,t){super(),Rt(this,"object"),Rt(this,"domElement"),Rt(this,"enabled",!0),Rt(this,"target",new G),Rt(this,"minDistance",0),Rt(this,"maxDistance",1/0),Rt(this,"minZoom",0),Rt(this,"maxZoom",1/0),Rt(this,"minPolarAngle",0),Rt(this,"maxPolarAngle",Math.PI),Rt(this,"minAzimuthAngle",-1/0),Rt(this,"maxAzimuthAngle",1/0),Rt(this,"enableDamping",!1),Rt(this,"dampingFactor",.05),Rt(this,"enableZoom",!0),Rt(this,"zoomSpeed",1),Rt(this,"enableRotate",!0),Rt(this,"rotateSpeed",1),Rt(this,"enablePan",!0),Rt(this,"panSpeed",1),Rt(this,"screenSpacePanning",!0),Rt(this,"keyPanSpeed",7),Rt(this,"zoomToCursor",!1),Rt(this,"autoRotate",!1),Rt(this,"autoRotateSpeed",2),Rt(this,"reverseOrbit",!1),Rt(this,"reverseHorizontalOrbit",!1),Rt(this,"reverseVerticalOrbit",!1),Rt(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),Rt(this,"mouseButtons",{LEFT:Cc.ROTATE,MIDDLE:Cc.DOLLY,RIGHT:Cc.PAN}),Rt(this,"touches",{ONE:bc.ROTATE,TWO:bc.DOLLY_PAN}),Rt(this,"target0"),Rt(this,"position0"),Rt(this,"zoom0"),Rt(this,"_domElementKeyEvents",null),Rt(this,"getPolarAngle"),Rt(this,"getAzimuthalAngle"),Rt(this,"setPolarAngle"),Rt(this,"setAzimuthalAngle"),Rt(this,"getDistance"),Rt(this,"listenToKeyEvents"),Rt(this,"stopListenToKeyEvents"),Rt(this,"saveState"),Rt(this,"reset"),Rt(this,"update"),Rt(this,"connect"),Rt(this,"dispose"),this.object=e,this.domElement=t,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>d.phi,this.getAzimuthalAngle=()=>d.theta,this.setPolarAngle=K=>{let ve=vN(K,2*Math.PI),je=d.phi;je<0&&(je+=2*Math.PI),ve<0&&(ve+=2*Math.PI);let Y=Math.abs(ve-je);2*Math.PI-Y{let ve=vN(K,2*Math.PI),je=d.theta;je<0&&(je+=2*Math.PI),ve<0&&(ve+=2*Math.PI);let Y=Math.abs(ve-je);2*Math.PI-Yi.object.position.distanceTo(i.target),this.listenToKeyEvents=K=>{K.addEventListener("keydown",Ce),this._domElementKeyEvents=K},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",Ce),this._domElementKeyEvents=null},this.saveState=()=>{i.target0.copy(i.target),i.position0.copy(i.object.position),i.zoom0=i.object.zoom},this.reset=()=>{i.target.copy(i.target0),i.object.position.copy(i.position0),i.object.zoom=i.zoom0,i.object.updateProjectionMatrix(),i.dispatchEvent(r),i.update(),l=a.NONE},this.update=(()=>{const K=new G,ve=new G(0,1,0),je=new nr().setFromUnitVectors(e.up,ve),Y=je.clone().invert(),Fe=new G,me=new nr,Ae=2*Math.PI;return function(){const $e=i.object.position;je.setFromUnitVectors(e.up,ve),Y.copy(je).invert(),K.copy($e).sub(i.target),K.applyQuaternion(je),d.setFromVector3(K),i.autoRotate&&l===a.NONE&&se(V()),i.enableDamping?(d.theta+=f.theta*i.dampingFactor,d.phi+=f.phi*i.dampingFactor):(d.theta+=f.theta,d.phi+=f.phi);let At=i.minAzimuthAngle,Bt=i.maxAzimuthAngle;isFinite(At)&&isFinite(Bt)&&(At<-Math.PI?At+=Ae:At>Math.PI&&(At-=Ae),Bt<-Math.PI?Bt+=Ae:Bt>Math.PI&&(Bt-=Ae),At<=Bt?d.theta=Math.max(At,Math.min(Bt,d.theta)):d.theta=d.theta>(At+Bt)/2?Math.max(At,d.theta):Math.min(Bt,d.theta)),d.phi=Math.max(i.minPolarAngle,Math.min(i.maxPolarAngle,d.phi)),d.makeSafe(),i.enableDamping===!0?i.target.addScaledVector(m,i.dampingFactor):i.target.add(m),i.zoomToCursor&&D||i.object.isOrthographicCamera?d.radius=Me(d.radius):d.radius=Me(d.radius*p),K.setFromSpherical(d),K.applyQuaternion(Y),$e.copy(i.target).add(K),i.object.matrixAutoUpdate||i.object.updateMatrix(),i.object.lookAt(i.target),i.enableDamping===!0?(f.theta*=1-i.dampingFactor,f.phi*=1-i.dampingFactor,m.multiplyScalar(1-i.dampingFactor)):(f.set(0,0,0),m.set(0,0,0));let Cn=!1;if(i.zoomToCursor&&D){let It=null;if(i.object instanceof Dn&&i.object.isPerspectiveCamera){const Sn=K.length();It=Me(Sn*p);const kn=Sn-It;i.object.position.addScaledVector(I,kn),i.object.updateMatrixWorld()}else if(i.object.isOrthographicCamera){const Sn=new G(P.x,P.y,0);Sn.unproject(i.object),i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom/p)),i.object.updateProjectionMatrix(),Cn=!0;const kn=new G(P.x,P.y,0);kn.unproject(i.object),i.object.position.sub(kn).add(Sn),i.object.updateMatrixWorld(),It=K.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),i.zoomToCursor=!1;It!==null&&(i.screenSpacePanning?i.target.set(0,0,-1).transformDirection(i.object.matrix).multiplyScalar(It).add(i.object.position):(av.origin.copy(i.object.position),av.direction.set(0,0,-1).transformDirection(i.object.matrix),Math.abs(i.object.up.dot(av.direction))c||8*(1-me.dot(i.object.quaternion))>c?(i.dispatchEvent(r),Fe.copy(i.object.position),me.copy(i.object.quaternion),Cn=!1,!0):!1}})(),this.connect=K=>{i.domElement=K,i.domElement.style.touchAction="none",i.domElement.addEventListener("contextmenu",Le),i.domElement.addEventListener("pointerdown",F),i.domElement.addEventListener("pointercancel",_e),i.domElement.addEventListener("wheel",nt)},this.dispose=()=>{var K,ve,je,Y,Fe,me;i.domElement&&(i.domElement.style.touchAction="auto"),(K=i.domElement)==null||K.removeEventListener("contextmenu",Le),(ve=i.domElement)==null||ve.removeEventListener("pointerdown",F),(je=i.domElement)==null||je.removeEventListener("pointercancel",_e),(Y=i.domElement)==null||Y.removeEventListener("wheel",nt),(Fe=i.domElement)==null||Fe.ownerDocument.removeEventListener("pointermove",ae),(me=i.domElement)==null||me.ownerDocument.removeEventListener("pointerup",_e),i._domElementKeyEvents!==null&&i._domElementKeyEvents.removeEventListener("keydown",Ce)};const i=this,r={type:"change"},s={type:"start"},o={type:"end"},a={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let l=a.NONE;const c=1e-6,d=new MT,f=new MT;let p=1;const m=new G,_=new Ee,S=new Ee,x=new Ee,y=new Ee,E=new Ee,w=new Ee,M=new Ee,O=new Ee,k=new Ee,I=new G,P=new Ee;let D=!1;const A=[],R={};function V(){return 2*Math.PI/60/60*i.autoRotateSpeed}function U(){return Math.pow(.95,i.zoomSpeed)}function se(K){i.reverseOrbit||i.reverseHorizontalOrbit?f.theta+=K:f.theta-=K}function le(K){i.reverseOrbit||i.reverseVerticalOrbit?f.phi+=K:f.phi-=K}const ee=(()=>{const K=new G;return function(je,Y){K.setFromMatrixColumn(Y,0),K.multiplyScalar(-je),m.add(K)}})(),pe=(()=>{const K=new G;return function(je,Y){i.screenSpacePanning===!0?K.setFromMatrixColumn(Y,1):(K.setFromMatrixColumn(Y,0),K.crossVectors(i.object.up,K)),K.multiplyScalar(je),m.add(K)}})(),W=(()=>{const K=new G;return function(je,Y){const Fe=i.domElement;if(Fe&&i.object instanceof Dn&&i.object.isPerspectiveCamera){const me=i.object.position;K.copy(me).sub(i.target);let Ae=K.length();Ae*=Math.tan(i.object.fov/2*Math.PI/180),ee(2*je*Ae/Fe.clientHeight,i.object.matrix),pe(2*Y*Ae/Fe.clientHeight,i.object.matrix)}else Fe&&i.object instanceof zs&&i.object.isOrthographicCamera?(ee(je*(i.object.right-i.object.left)/i.object.zoom/Fe.clientWidth,i.object.matrix),pe(Y*(i.object.top-i.object.bottom)/i.object.zoom/Fe.clientHeight,i.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),i.enablePan=!1)}})();function J(K){i.object instanceof Dn&&i.object.isPerspectiveCamera||i.object instanceof zs&&i.object.isOrthographicCamera?p/=K:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function Z(K){i.object instanceof Dn&&i.object.isPerspectiveCamera||i.object instanceof zs&&i.object.isOrthographicCamera?p*=K:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function oe(K){if(!i.zoomToCursor||!i.domElement)return;D=!0;const ve=i.domElement.getBoundingClientRect(),je=K.clientX-ve.left,Y=K.clientY-ve.top,Fe=ve.width,me=ve.height;P.x=je/Fe*2-1,P.y=-(Y/me)*2+1,I.set(P.x,P.y,1).unproject(i.object).sub(i.object.position).normalize()}function Me(K){return Math.max(i.minDistance,Math.min(i.maxDistance,K))}function Re(K){_.set(K.clientX,K.clientY)}function he(K){oe(K),M.set(K.clientX,K.clientY)}function we(K){y.set(K.clientX,K.clientY)}function Ne(K){S.set(K.clientX,K.clientY),x.subVectors(S,_).multiplyScalar(i.rotateSpeed);const ve=i.domElement;ve&&(se(2*Math.PI*x.x/ve.clientHeight),le(2*Math.PI*x.y/ve.clientHeight)),_.copy(S),i.update()}function be(K){O.set(K.clientX,K.clientY),k.subVectors(O,M),k.y>0?J(U()):k.y<0&&Z(U()),M.copy(O),i.update()}function ft(K){E.set(K.clientX,K.clientY),w.subVectors(E,y).multiplyScalar(i.panSpeed),W(w.x,w.y),y.copy(E),i.update()}function dt(K){oe(K),K.deltaY<0?Z(U()):K.deltaY>0&&J(U()),i.update()}function Ke(K){let ve=!1;switch(K.code){case i.keys.UP:W(0,i.keyPanSpeed),ve=!0;break;case i.keys.BOTTOM:W(0,-i.keyPanSpeed),ve=!0;break;case i.keys.LEFT:W(i.keyPanSpeed,0),ve=!0;break;case i.keys.RIGHT:W(-i.keyPanSpeed,0),ve=!0;break}ve&&(K.preventDefault(),i.update())}function ke(){if(A.length==1)_.set(A[0].pageX,A[0].pageY);else{const K=.5*(A[0].pageX+A[1].pageX),ve=.5*(A[0].pageY+A[1].pageY);_.set(K,ve)}}function xe(){if(A.length==1)y.set(A[0].pageX,A[0].pageY);else{const K=.5*(A[0].pageX+A[1].pageX),ve=.5*(A[0].pageY+A[1].pageY);y.set(K,ve)}}function j(){const K=A[0].pageX-A[1].pageX,ve=A[0].pageY-A[1].pageY,je=Math.sqrt(K*K+ve*ve);M.set(0,je)}function Ve(){i.enableZoom&&j(),i.enablePan&&xe()}function Oe(){i.enableZoom&&j(),i.enableRotate&&ke()}function Pe(K){if(A.length==1)S.set(K.pageX,K.pageY);else{const je=et(K),Y=.5*(K.pageX+je.x),Fe=.5*(K.pageY+je.y);S.set(Y,Fe)}x.subVectors(S,_).multiplyScalar(i.rotateSpeed);const ve=i.domElement;ve&&(se(2*Math.PI*x.x/ve.clientHeight),le(2*Math.PI*x.y/ve.clientHeight)),_.copy(S)}function Ue(K){if(A.length==1)E.set(K.pageX,K.pageY);else{const ve=et(K),je=.5*(K.pageX+ve.x),Y=.5*(K.pageY+ve.y);E.set(je,Y)}w.subVectors(E,y).multiplyScalar(i.panSpeed),W(w.x,w.y),y.copy(E)}function lt(K){const ve=et(K),je=K.pageX-ve.x,Y=K.pageY-ve.y,Fe=Math.sqrt(je*je+Y*Y);O.set(0,Fe),k.set(0,Math.pow(O.y/M.y,i.zoomSpeed)),J(k.y),M.copy(O)}function We(K){i.enableZoom&<(K),i.enablePan&&Ue(K)}function X(K){i.enableZoom&<(K),i.enableRotate&&Pe(K)}function F(K){var ve,je;i.enabled!==!1&&(A.length===0&&((ve=i.domElement)==null||ve.ownerDocument.addEventListener("pointermove",ae),(je=i.domElement)==null||je.ownerDocument.addEventListener("pointerup",_e)),Ze(K),K.pointerType==="touch"?Ge(K):Te(K))}function ae(K){i.enabled!==!1&&(K.pointerType==="touch"?Lt(K):Se(K))}function _e(K){var ve,je,Y;Et(K),A.length===0&&((ve=i.domElement)==null||ve.releasePointerCapture(K.pointerId),(je=i.domElement)==null||je.ownerDocument.removeEventListener("pointermove",ae),(Y=i.domElement)==null||Y.ownerDocument.removeEventListener("pointerup",_e)),i.dispatchEvent(o),l=a.NONE}function Te(K){let ve;switch(K.button){case 0:ve=i.mouseButtons.LEFT;break;case 1:ve=i.mouseButtons.MIDDLE;break;case 2:ve=i.mouseButtons.RIGHT;break;default:ve=-1}switch(ve){case Cc.DOLLY:if(i.enableZoom===!1)return;he(K),l=a.DOLLY;break;case Cc.ROTATE:if(K.ctrlKey||K.metaKey||K.shiftKey){if(i.enablePan===!1)return;we(K),l=a.PAN}else{if(i.enableRotate===!1)return;Re(K),l=a.ROTATE}break;case Cc.PAN:if(K.ctrlKey||K.metaKey||K.shiftKey){if(i.enableRotate===!1)return;Re(K),l=a.ROTATE}else{if(i.enablePan===!1)return;we(K),l=a.PAN}break;default:l=a.NONE}l!==a.NONE&&i.dispatchEvent(s)}function Se(K){if(i.enabled!==!1)switch(l){case a.ROTATE:if(i.enableRotate===!1)return;Ne(K);break;case a.DOLLY:if(i.enableZoom===!1)return;be(K);break;case a.PAN:if(i.enablePan===!1)return;ft(K);break}}function nt(K){i.enabled===!1||i.enableZoom===!1||l!==a.NONE&&l!==a.ROTATE||(K.preventDefault(),i.dispatchEvent(s),dt(K),i.dispatchEvent(o))}function Ce(K){i.enabled===!1||i.enablePan===!1||Ke(K)}function Ge(K){switch(vt(K),A.length){case 1:switch(i.touches.ONE){case bc.ROTATE:if(i.enableRotate===!1)return;ke(),l=a.TOUCH_ROTATE;break;case bc.PAN:if(i.enablePan===!1)return;xe(),l=a.TOUCH_PAN;break;default:l=a.NONE}break;case 2:switch(i.touches.TWO){case bc.DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;Ve(),l=a.TOUCH_DOLLY_PAN;break;case bc.DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;Oe(),l=a.TOUCH_DOLLY_ROTATE;break;default:l=a.NONE}break;default:l=a.NONE}l!==a.NONE&&i.dispatchEvent(s)}function Lt(K){switch(vt(K),l){case a.TOUCH_ROTATE:if(i.enableRotate===!1)return;Pe(K),i.update();break;case a.TOUCH_PAN:if(i.enablePan===!1)return;Ue(K),i.update();break;case a.TOUCH_DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;We(K),i.update();break;case a.TOUCH_DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;X(K),i.update();break;default:l=a.NONE}}function Le(K){i.enabled!==!1&&K.preventDefault()}function Ze(K){A.push(K)}function Et(K){delete R[K.pointerId];for(let ve=0;ve0,O=U>0,k=se>0,I=(M?1:0)+(O?1:0)+(k?1:0),I){case 0:{y.push(S[w]),y.push(S[w+1]),y.push(S[w+2]);break}case 1:{if(M&&(P=S[w+1],D=S[w+2],A=_(S[w],P,x,E),R=_(S[w],D,x,E)),O){P=S[w],D=S[w+2],A=_(S[w+1],P,x,E),R=_(S[w+1],D,x,E),y.push(A),y.push(D.clone()),y.push(P.clone()),y.push(D.clone()),y.push(A.clone()),y.push(R);break}k&&(P=S[w],D=S[w+1],A=_(S[w+2],P,x,E),R=_(S[w+2],D,x,E)),y.push(P.clone()),y.push(D.clone()),y.push(A),y.push(R),y.push(A.clone()),y.push(D.clone());break}case 2:{M||(P=S[w].clone(),D=_(P,S[w+1],x,E),A=_(P,S[w+2],x,E),y.push(P),y.push(D),y.push(A)),O||(P=S[w+1].clone(),D=_(P,S[w+2],x,E),A=_(P,S[w],x,E),y.push(P),y.push(D),y.push(A)),k||(P=S[w+2].clone(),D=_(P,S[w],x,E),A=_(P,S[w+1],x,E),y.push(P),y.push(D),y.push(A));break}}}return y}function _(S,x,y,E){const w=S.position.dot(y)-E,M=x.position.dot(y)-E,O=w/(w-M);return new _N(new G(S.position.x+O*(x.position.x-S.position.x),S.position.y+O*(x.position.y-S.position.y),S.position.z+O*(x.position.z-S.position.z)),new G(S.normal.x+O*(x.normal.x-S.normal.x),S.normal.y+O*(x.normal.y-S.normal.y),S.normal.z+O*(x.normal.z-S.normal.z)))}}}class _N{constructor(e,t){this.position=e,this.normal=t}clone(){return new this.constructor(this.position.clone(),this.normal.clone())}}const C1=n=>n===Object(n)&&!Array.isArray(n)&&typeof n!="function";function bC(n,e){const t=Kr(s=>s.gl),i=Qm(kx,C1(n)?Object.values(n):n);return q.useLayoutEffect(()=>{e==null||e(i)},[e]),q.useEffect(()=>{if("initTexture"in t){let s=[];Array.isArray(i)?s=i:i instanceof In?s=[i]:C1(i)&&(s=Object.values(i)),s.forEach(o=>{o instanceof In&&t.initTexture(o)})}},[t,i]),q.useMemo(()=>{if(C1(n)){const s={};let o=0;for(const a in n)s[a]=i[o++];return s}else return i},[n,i])}bC.preload=n=>Qm.preload(kx,n);bC.clear=n=>Qm.clear(kx,n);function cre(n){return Array.isArray(n)}function b1(n=[0,0,0]){return cre(n)?n:n instanceof G||n instanceof _r?[n.x,n.y,n.z]:[n,n,n]}const ure=q.forwardRef(function({debug:e,depthTest:t=!1,polygonOffsetFactor:i=-10,map:r,mesh:s,children:o,position:a,rotation:l,scale:c,...d},f){const p=q.useRef(null);q.useImperativeHandle(f,()=>p.current);const m=q.useRef(null);return q.useLayoutEffect(()=>{const _=(s==null?void 0:s.current)||p.current.parent,S=p.current;if(!(_ instanceof ni))throw new Error('Decal must have a Mesh as parent or specify its "mesh" prop');const x={position:new G,rotation:new _r,scale:new G(1,1,1)};if(_){lo(x,{position:a,scale:c});const y=_.matrixWorld.clone();if(_.matrixWorld.identity(),!l||typeof l=="number"){const E=new Zt;E.position.copy(x.position),E.lookAt(_.position),typeof l=="number"&&E.rotateZ(l),lo(x,{rotation:E.rotation})}else lo(x,{rotation:l});return S.geometry=new lre(_,x.position,x.rotation,x.scale),m.current&&(lo(m.current,x),m.current.traverse(E=>E.raycast=()=>null)),_.matrixWorld=y,()=>{S.geometry.dispose()}}},[s,...b1(a),...b1(c),...b1(l)]),q.createElement("mesh",vm({ref:p,"material-transparent":!0,"material-polygonOffset":!0,"material-polygonOffsetFactor":i,"material-depthTest":t,"material-map":r},d),o,e&&q.createElement("mesh",{ref:m},q.createElement("boxGeometry",null),q.createElement("meshNormalMaterial",{wireframe:!0}),q.createElement("axesHelper",null)))}),hre=q.forwardRef(({makeDefault:n,camera:e,regress:t,domElement:i,enableDamping:r=!0,keyEvents:s=!1,onChange:o,onStart:a,onEnd:l,...c},d)=>{const f=Kr(k=>k.invalidate),p=Kr(k=>k.camera),m=Kr(k=>k.gl),_=Kr(k=>k.events),S=Kr(k=>k.setEvents),x=Kr(k=>k.set),y=Kr(k=>k.get),E=Kr(k=>k.performance),w=e||p,M=i||_.connected||m.domElement,O=q.useMemo(()=>new are(w),[w]);return AC(()=>{O.enabled&&O.update()},-1),q.useEffect(()=>(s&&O.connect(s===!0?M:s),O.connect(M),()=>void O.dispose()),[s,M,t,O,f]),q.useEffect(()=>{const k=D=>{f(),t&&E.regress(),o&&o(D)},I=D=>{a&&a(D)},P=D=>{l&&l(D)};return O.addEventListener("change",k),O.addEventListener("start",I),O.addEventListener("end",P),()=>{O.removeEventListener("start",I),O.removeEventListener("end",P),O.removeEventListener("change",k)}},[o,a,l,O,f,S]),q.useEffect(()=>{if(n){const k=y().controls;return x({controls:O}),()=>x({controls:k})}},[n,O]),q.createElement("primitive",vm({ref:d,object:O,enableDamping:r},c))}),dre=q.forwardRef(({children:n,enabled:e=!0,speed:t=1,rotationIntensity:i=1,floatIntensity:r=1,floatingRange:s=[-.1,.1],autoInvalidate:o=!1,...a},l)=>{const c=q.useRef(null);q.useImperativeHandle(l,()=>c.current,[]);const d=q.useRef(Math.random()*1e4);return AC(f=>{var p,m;if(!e||t===0)return;o&&f.invalidate();const _=d.current+f.clock.getElapsedTime();c.current.rotation.x=Math.cos(_/4*t)/8*i,c.current.rotation.y=Math.sin(_/4*t)/8*i,c.current.rotation.z=Math.sin(_/4*t)/20*i;let S=Math.sin(_/4*t)/10;S=XF.mapLinear(S,-.1,.1,(p=s==null?void 0:s[0])!==null&&p!==void 0?p:-.1,(m=s==null?void 0:s[1])!==null&&m!==void 0?m:.1),c.current.position.y=S*r,c.current.updateMatrix()}),q.createElement("group",a,q.createElement("group",{ref:c,matrixAutoUpdate:!1},n))});function fre({all:n,scene:e,camera:t}){const i=Kr(({gl:o})=>o),r=Kr(({camera:o})=>o),s=Kr(({scene:o})=>o);return q.useLayoutEffect(()=>{const o=[];n&&(e||s).traverse(c=>{c.visible===!1&&(o.push(c),c.visible=!0)}),i.compile(e||s,t||r);const a=new JM(128);new QM(.01,1e5,a).update(i,e||s),a.dispose(),o.forEach(c=>c.visible=!1)},[]),null}const pre=()=>{const{progress:n}=ire(),e={display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column"},t={fontSize:14,color:"#F1F1F1",fontWeight:800,marginTop:40};return B.jsxs(nre,{as:"div",center:!0,style:e,children:[B.jsx("span",{className:"canvas-loader"}),B.jsxs("p",{style:t,children:[n.toFixed(0),"%"]})]})},mre=n=>{const[e]=bC([n.imgUrl]);return B.jsxs(dre,{speed:1,rotationIntensity:0,floatIntensity:5,children:[B.jsx("ambientLight",{intensity:2.4}),B.jsx("directionalLight",{position:[0,0,.05]}),B.jsxs("mesh",{castShadow:!0,receiveShadow:!0,scale:2.75,children:[B.jsx("icosahedronGeometry",{args:[1,1]}),B.jsx("meshStandardMaterial",{color:"#fcd4d4",polygonOffset:!0,polygonOffsetFactor:-5,flatShading:!0}),B.jsx(ure,{position:[0,0,1],rotation:[2*Math.PI,0,6.25],scale:1,map:e,flatShading:!0})]})]})},gre=({icon:n})=>B.jsxs(Xie,{frameloop:"demand",dpr:[1,2],gl:{preserveDrawingBuffer:!0},children:[B.jsxs(q.Suspense,{fallback:B.jsx(pre,{}),children:[B.jsx(hre,{enableZoom:!1}),B.jsx(mre,{imgUrl:n})]}),B.jsx(fre,{all:!0})]}),yre="/assets/texture-5adaf7bf.webp",vre=()=>B.jsxs("section",{className:"xl:mt-6 flex flex-row flex-wrap justify-center items-center gap-10",children:[B.jsxs(er.div,{variants:Lm(),children:[B.jsx("h2",{className:`${sr.sectionHeadText} text-center`,children:"Skills & Technologies."}),B.jsx("p",{className:`${sr.sectionSubText} text-center`,children:"What have i learnd?"})]}),B.jsx("div",{className:"w-full lg:w-[400px] lg:h-[400px] ",children:B.jsx(gre,{icon:yre})},"skillsBall")]}),_re=Td(vre,"TechSkillsSection"),xre="/assets/cover_img-4c0efeb6.webp",xN="/assets/resume-bb345e2c.pdf",Sre=()=>{const[n,e]=q.useState(!1),t=()=>e(!0),i=()=>e(!1),r=()=>{const s=document.createElement("a");s.href=xN,s.download="Satyam_Mishra_Resume",s.click()};return B.jsxs("section",{className:"-m-5 md:-m-10 max-w-screen-xl mx-auto my-10 space-y-10 max",children:[B.jsxs(er.div,{variants:Lm(0),children:[B.jsx("h2",{className:`${sr.sectionHeadText} text-center`,children:"Resume."}),B.jsx("p",{className:`${sr.sectionSubText} text-center`,children:"Here's my Resume😁"})]}),B.jsx(er.div,{variants:Ed("right","spring",.5*0,.75),className:"md:flex justify-center items-center",children:B.jsxs(G_,{options:{max:45,scale:1,speed:450},className:"group bg-white shadow-[#fcd4d4] shadow-card rounded-2xl mx-auto w-[90%] md:min-w-1/3 md:max-w-3xl h-full",children:[B.jsx("div",{className:"group-hover:opacity-100 relative w-full h-full mb-5",children:B.jsx("img",{src:xre,loading:"lazy",alt:"Resume cover image",className:"w-full h-full object-cover rounded-2xl"})}),B.jsxs("div",{className:"text-primary flex items-center space-x-5 md:space-y-5 justify-center absolute z-10 md:top-10 md:-right-24 md:bottom-0 md:flex-col md:items-center md:justify-center transition-opacity duration-300",children:[B.jsxs("button",{onClick:r,className:"mt-8 bg-blue-500 hover:bg-blue-300 font-bold py-3 px-6 rounded-full flex items-center",children:["Download ",B.jsx("span",{className:"ml-2",children:"▶"})]}),B.jsxs("button",{onClick:t,className:"mt-8 bg-green-500 hover:bg-green-300 font-bold py-3 px-6 rounded-full flex items-center",children:["View ",B.jsx("span",{className:"ml-2",children:"▶"})]})]})]})}),n&&B.jsx("div",{className:"fixed inset-0 z-50 overflow-auto -top-10 bg-black bg-opacity-60 flex items-center justify-center",children:B.jsxs("div",{className:"bg-white p-2 rounded-2xl max-w-screen-lg w-[70%] relative",children:[B.jsx("button",{className:"absolute -top-12 right-0 md:top-2 md:-right-20 bg-black hover:bg-gray-800 py-2 px-3 rounded-xl text-white hover:text-gray-200",onClick:i,children:"Close"}),B.jsx("iframe",{title:"PDF Viewer",src:xN,className:"w-full h-[400px]"})]})})]})},wre=Td(Sre,"ResumeSection"),Ere="data:image/webp;base64,UklGRggMAABXRUJQVlA4WAoAAAAwAAAA7wAA7wAASUNDUMgBAAAAAAHIAAAAAAQwAABtbnRyUkdCIFhZWiAH4AABAAEAAAAAAABhY3NwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAA9tYAAQAAAADTLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlkZXNjAAAA8AAAACRyWFlaAAABFAAAABRnWFlaAAABKAAAABRiWFlaAAABPAAAABR3dHB0AAABUAAAABRyVFJDAAABZAAAAChnVFJDAAABZAAAAChiVFJDAAABZAAAAChjcHJ0AAABjAAAADxtbHVjAAAAAAAAAAEAAAAMZW5VUwAAAAgAAAAcAHMAUgBHAEJYWVogAAAAAAAAb6IAADj1AAADkFhZWiAAAAAAAABimQAAt4UAABjaWFlaIAAAAAAAACSgAAAPhAAAts9YWVogAAAAAAAA9tYAAQAAAADTLXBhcmEAAAAAAAQAAAACZmYAAPKnAAANWQAAE9AAAApbAAAAAAAAAABtbHVjAAAAAAAAAAEAAAAMZW5VUwAAACAAAAAcAEcAbwBvAGcAbABlACAASQBuAGMALgAgADIAMAAxADZBTFBIggkAAAGwBgC0MTfWGWamsV3bbVDbdvu29tp23dRuk7VRu12btW0H89Kkk0wwcx6Ce8+959tf721ETAD87f//pevfqP+jaW9v+fHERZfrHuI9l+viiR+3vJX2aP9G/n81nMlTln+biVLvfLN8SrLzr0HMgLSfPUi05ETG+OrGztE9bT+Sv5AxwGHQQibsdKOi7h3jgw2X/5jtHlTas220v5FqlJaDGrybkWSQnNMPoDb3T3MYn8jnb6BWM9PijE3V9ALUbsHaROMSlVaIWi7KiDMmYUsKUNsFi0ONh3V6Jmo953Grweh5ArV/rLuRCMtAFtdHGoYRmcika7oxiNuDjO6ONQCDs5DVrEHcOVcgux/4s1b/JDJ8vC5jA/6JLOcN48oy34dM++ZaWPLfhozvCWQoZh+yfjienUaXkflLDZlJykb2Xa1Z6XAXDWB+V0a65KMhdPdio6cHDaKnBxNt89EwujuxkJqHBvJuCgONXGgosxtqL+YyGsxL0Zpz/o6Gc7+/1izb0IBuMetsPhrS2Rob5DMmvmHaqpuLBjWvgab8T6JhPVZFT2+ggV2rpcEoPbuWf2i9HtNW/1akH8+vq6Z2rxvqXztbmG+AhuKy5A2CcgMGvOnSSU5Gf38od6gwzIzRzx6U/g1U2G/UL7r4abgdKvy9MNypnXEof2DFAKDD7zr4tR1Udog4HK2ZqCx5LmulwDTinGrnhpug0rZccXci9PIJyt8IIh1LvCp5F/qByC3i8H2t9ESCrwgB6HpVnUudQOwLErCLRqwnKIwWBBE/qvJtGAgeIOOIRR+PIMVWosDv/cpk7duw+JH+bVrWjAu1WEMTaia1HfDY0s0HXZV52w6im8nAB7QRlk0iShiYVpSXtWtGv0gQHjtw9heu8paA+GgpmSG6WIIkg8SBaQUiurdPrwnyTXUf2lOIiEtAYogUXKCJuAIagRLAvC69nxPI+g9+K90kI0iOO0YPa5Cmvwy9BsrB5Vqo5jEWAZIKE3SQjkTjuUiQhKs1EFlApTkXSbLcEerNQKo9uegjC19VzplJZgwXE6Tddqg2Dcm+ysUMaThFtQN0PuTiM3l/KpaEdPdxcUgetlArnVCeiQezm8BqpfzvEsI6PDRAgrlVVBqLlMfwMJECjlJpB6kVPKwjsVmhEA+pP3g4SKIwUJ2JSLo0lINwLwkco85OWjiYg+FIc6syDjex+RwsJ5JvV6UX0r4czUH1TBrYVZXltAqSgMX2RTQWqnKa1jBg8iEaxxSJQ9IZwOYGEhijxkhS5wP5iLhFYogayyh5WwOjA0ksVmMfpXRgdTuF35RwFhNyRfJS20OgyKFCChJ+HJhdQACTVJhK6LaDm7B8AhNVWEHoWWB3GYElKnxHJzeYn4QieV+pcIfOCmD4c3k3FfBHukkcDZDnq0KvMZ0TwLH1tjRsQK8/nddYgnXy+tJ7lE5bnobLe4heGpk8G0/hXmnz6L1FZjcwfUjaG/S2kpnP1fvSNtH7icwErl6S9j29U2RacTVE2nF618jEcZUk7Qq9TDIBXNWVdoteLhWvmatYaS56BVTuAdeB0tz0SqmUsBUlrZSelwr6cVVDPx4yYVw1kVZIL49MDa7aScujl0OmC1djpGXTu05mGlevS7tC7ziZNK4+lHaE3s9ktnO1T9qP9HaQyTHzFFgibQe998hgU556o/S36M2l8whP8+XNpPcQnb08HZX3AL2BdEpiOGqK8gfQa0EHn+BoIYFG9AJ8dA4yZLsmz+ekBzfoYE9+JqH8a6DgN4R+ZMdylsDXKqwhhJ24GYMEF6owjdJhGy9VLlIYqUISJXyGl2VIsaYK9iJK7pqcJJdSyDGpAAcp4c92PoJOIsUvQcmVpHANG6YNSHKuGsNp4WQuXkWaw9SI9tEq6sfDZC+N0nA14CQt9PTlYIIXaf4Kii4lhp6++hvvRaKvqtKTGpY8rznT816kmqyKXz41xDftOgvYhGQzzarAVnr4Sy19NT+OdD8AZccogPceM+vJNqMYCd+nTlChAog/1NdRymGk7A5SB7Ypgd711XRTLcOLpD8AhUepgeieF66T+DXFSLy7Sg6XIoieD5roouUHxUj9mkUlWKMMou+roQ71Asb8igrOAaVTFELEux/0tankHLa+AFX01VEL/lQKEXM+mVJNjboPbcpDRX8Gxcep9t/n1o1vbKVkbznlnSuo8CjV/G5r4L8L/lj3QM/adll+9fs8+uaBIlT7vEU1mKGJsksvv2oRZ3n9mg91+CAoH54v6tLQyLovnqHmug+kjs7VwR2nerBEVFcAAPOQk6QO1QTJNQ5r4BXQYJxH0MD/ArA9U0jnS3+QHvilcvlhOoAVgq7VKwOgySkqOx1A0LFXtcWgxah8MXh3aFkQ8iWN35xA0rlfLVeYHmCWIPQ+WBbYN1G4GAVEq2Yq9SRoMuiOIPSNKAusW+QVpwLZziUKnbPrAqaJQndSWVBln7TngPALCg0FbZoPiMKrQWVB7FVJf5op2Y4q8wNotJ1PFC4rB5rlSSlNAtLtfIp4k3UCbworaVYODPPJeBOIv6XIatBq6E1RuK08mCPBk0gttlCJCwF6geHCfA3LM70jbiWQT1fB1wV0u14UvlMemJeJ8taiV7tUgTWg3fAbou4FlAcw8IKY7aDg5/QuBugHevoE4YSKgLn7gq9PuYoQ81xXLxz7dfs7aQ/3behQoSc5XxfQ8VJRX1dIn9Y71OaDlm0/C/Im6gjWEvvGoidIzBKDz2upE60rkaDrXqViTmjJXkjJkwL6fkYMpuoIfqU0FXT+rph0LS0j9CZo3e9HIe5IHY2ms9umNwg9LgJn66g9md/8QffxV0S4a2moPpWzUaD/RlkC8EuzfiKIXE0EDlu4BOBy/ZhpZDcAHlNyBeBck26ARFYScNnKJQA3BvNzoyHw2ey2ALw52sTMhZrAab2rAhBPPhDKyYk44DX+sAjEkh9mjmySGMzCvgjgNugLIUJ1tT0Q+LVlMOabYwaWpxdxdW84cN3+Fk8XmwLfMV9z9FUEcG56vJibwufNwHzbc7wcaAT8O9O8fJSm2cEQdjvPxdk2YBQdMzwcuGc4wEA2+Ep7vk8TwGB2P6a3Qx3BeNoeuamvGw9YwJD6Tb+lpyuPO8GwBjx1TT/nJtvA0NonHNfLsbFWMLymLuuLK2RVxYaI7vfagUGOfelUBaJVqYqHHw4BI5266nZZjVSJTwXDbU6acRoR/6GKUa85ff2Cv1Z/+///8wRWUDggkAAAAFAPAJ0BKvAA8AA+bTaZSaQjIqEgKACADYlpbuF2sRtACewD32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D31gAAP7/1gAAAAAAAAAAAA==",Tre="/assets/appstore-0b8f390b.png",Are="/assets/colab-9e4861eb.png",Mre="/assets/huggingface-720eadc9.png",SN="/assets/website-078d1216.gif",Cre=({index:n,name:e,description:t,tags:i,image:r,source_code_link:s,date:o})=>B.jsx(G_,{className:"sm:w-[360px] w-full",children:B.jsx(er.div,{id:n,variants:Ed("right","spring",0,.75),className:"shadow-[#fcd4d4] green-pink-gradient shadow-card p-[1px] rounded-2xl ",children:B.jsxs("div",{className:"bg-primary rounded-2xl py-5 px-8",options:{max:45,scale:1,speed:450},children:[B.jsxs("div",{className:"relative w-full h-[230px]",children:[B.jsx("img",{src:r,alt:"project_image",className:"w-full h-full object-cover rounded-2xl"}),B.jsx("div",{className:"absolute inset-0 z-10 space-y-3 flex-col justify-end m-3 card-img_hover",children:Object.entries(s).map(([a,l])=>B.jsx("div",{onClick:()=>window.open(l,"_blank"),className:"border-black border-2 white-gradient w-10 h-10 rounded-full flex justify-center items-center cursor-pointer",title:a==="Github"?"View in GitHub":a==="Appstore"?"View in App Store":a==="Colab"?"View in Google Colab":a==="Huggingface"?"View in Hugging Face":a==="Live"?"View Live Website":"View Now",children:B.jsx("img",{src:a==="Github"?Ere:a==="Appstore"?Tre:a==="Colab"?Are:a==="Huggingface"?Mre:SN,alt:`${a} link`,className:"w-1/2 h-1/2 object-contain"})},a))})]}),B.jsxs("div",{className:"mt-5",children:[B.jsx("h3",{className:"text-black font-bold text-[24px]",children:e}),B.jsx("p",{className:"mt-2 text-secondary text-[14px]",children:t})]}),B.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[Object.entries(i).map(([a,l])=>B.jsxs("p",{className:`text-[14px] ${l}`,children:["#",a," "]},`${e}-${a}`))," "]}),B.jsx("p",{children:o})]})})}),bre=()=>{const[n,e]=q.useState([]);return q.useEffect(()=>{(async()=>{const r=(await LM(IM(NM,"Projects"))).docs.map(s=>s.data()).sort((s,o)=>o.index-s.index);e(r)})()},[]),B.jsxs("section",{className:"-m-5 md:-m-10 ",children:[B.jsxs(er.div,{variants:Lm(0),children:[B.jsx("h2",{className:`${sr.sectionHeadText} text-center`,children:"Projects."}),B.jsx("p",{className:`${sr.sectionSubText} text-center`,children:"My works? Here they are."})]}),B.jsxs("div",{className:" mt-20 grid md:grid-cols-2 lg:grid-cols-3 gap-5",children:[n.map((t,i)=>B.jsx(Cre,{index:i,...t},`project-${i}`))," "]})]})},Pre=Td(bre,"ProjectsSection"),Rre=({index:n,name:e,date:t,image:i,link:r})=>B.jsx("div",{id:n,children:B.jsx(er.div,{variants:Ed("right","spring",.5,.75),children:B.jsx(G_,{options:{max:45,scale:1,speed:450},className:"bg-white shadow-[#fcd4d4] shadow-card p-5 rounded-2xl sm:w-[360px] w-full",children:B.jsxs("a",{href:r,target:"_blank",children:[B.jsx("div",{className:"relative w-full ",children:B.jsx("img",{src:i,placeholder:e,loading:"lazy",alt:`${e} cover image`,className:"w-full h-52 object-cover rounded-2xl"})}),B.jsx("p",{className:"mt-3 text-left",children:t}),B.jsx("h3",{className:"text-black font-bold text-[24px] text-left",children:e})]})})})});function Ire(){const[n,e]=q.useState([]);return q.useEffect(()=>{(async()=>{const r=(await LM(IM(NM,"Blogs"))).docs.map(s=>s.data()).sort((s,o)=>o.index-s.index);e(r)})()},[]),B.jsxs("div",{className:"my-10",children:[B.jsxs("div",{children:[B.jsx("h2",{className:`${sr.sectionHeadText} text-center`,children:"Blogs."}),B.jsx("p",{className:`${sr.sectionSubText} text-center`,children:"Blogs written by me"})]}),B.jsx("div",{className:"my-20 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-5",children:n.map((t,i)=>B.jsx(Rre,{index:i,...t},`blog-${i}`))})]})}const Lre=Td(Ire,"BlogsSections"),_m={_origin:"https://api.emailjs.com"},Nre=(n,e="https://api.emailjs.com")=>{_m._userID=n,_m._origin=e},M4=(n,e,t)=>{if(!n)throw"The public key is required. Visit https://dashboard.emailjs.com/admin/account";if(!e)throw"The service ID is required. Visit https://dashboard.emailjs.com/admin";if(!t)throw"The template ID is required. Visit https://dashboard.emailjs.com/admin/templates";return!0};class wN{constructor(e){this.status=e?e.status:0,this.text=e?e.responseText:"Network Error"}}const C4=(n,e,t={})=>new Promise((i,r)=>{const s=new XMLHttpRequest;s.addEventListener("load",({target:o})=>{const a=new wN(o);a.status===200||a.text==="OK"?i(a):r(a)}),s.addEventListener("error",({target:o})=>{r(new wN(o))}),s.open("POST",_m._origin+n,!0),Object.keys(t).forEach(o=>{s.setRequestHeader(o,t[o])}),s.send(e)}),Dre=(n,e,t,i)=>{const r=i||_m._userID;return M4(r,n,e),C4("/api/v1.0/email/send",JSON.stringify({lib_version:"3.12.1",user_id:r,service_id:n,template_id:e,template_params:t}),{"Content-type":"application/json"})},kre=n=>{let e;if(typeof n=="string"?e=document.querySelector(n):e=n,!e||e.nodeName!=="FORM")throw"The 3rd parameter is expected to be the HTML form element or the style selector of form";return e},Ore=(n,e,t,i)=>{const r=i||_m._userID,s=kre(t);M4(r,n,e);const o=new FormData(s);return o.append("lib_version","3.12.1"),o.append("service_id",n),o.append("template_id",e),o.append("user_id",r),C4("/api/v1.0/email/send-form",o)},EN={init:Nre,send:Dre,sendForm:Ore},Ure=()=>{const n=q.useRef(),[e,t]=q.useState({name:"",email:"",message:""}),[i,r]=q.useState(!1),[s,o]=q.useState(!1),a=c=>{const{target:d}=c,{name:f,value:p}=d;t({...e,[f]:p})},l=c=>{c.preventDefault(),r(!0),EN.init("Tlnn1O7PC8WlYPRT7"),EN.send("service_w2nrv74","template_hmf109b",{from_name:e.name,to_name:"Satyam Mishra",from_email:e.email,to_email:"satyammishra9050@gmail.com",message:e.message}).then(()=>{r(!1),o(!0),t({name:"",email:"",message:""})},d=>{r(!1),console.error(d),alert("Ahh, something went wrong. Please try again.")})};return B.jsxs("footer",{id:"ContactSection",className:"lg:grid lg:grid-cols-5 bg-black h-fit ",children:[B.jsxs("div",{className:"relative p-12 block h-32 lg:col-span-2 lg:h-full",children:[B.jsx("p",{className:`${sr.sectionSubText} text-white`,children:"I am open to work"}),B.jsx("h3",{className:`${sr.sectionHeadText} text-primary`,children:"Get In Touch."}),s?B.jsxs("div",{children:[B.jsx("p",{className:"text-green-500 mt-2",children:"Thank you. I have recieved your msg."}),B.jsx("p",{className:"text-green-500",children:"I will get back to you right on."})]}):B.jsxs("form",{ref:n,onSubmit:l,className:"flex flex-col gap-1",children:[B.jsxs("label",{className:"flex flex-col",children:[B.jsx("span",{className:"text-black font-medium mb-1",children:"Your Name"}),B.jsx("input",{type:"text",name:"name",value:e.name,onChange:a,placeholder:"What's your good name?",className:"bg-blue-50 py-4 px-6 placeholder:text-secondary text-black rounded-lg outline-none border-none font-medium"})]}),B.jsxs("label",{className:"flex flex-col",children:[B.jsx("span",{className:"text-black font-medium mb-1",children:"Your Email"}),B.jsx("input",{type:"email",name:"email",value:e.email,onChange:a,placeholder:"What's your email?",className:"bg-blue-50 py-4 px-6 placeholder:text-secondary text-black rounded-lg outline-none border-none font-medium"})]}),B.jsxs("label",{className:"flex flex-col",children:[B.jsx("span",{className:"text-black font-medium mb-1",children:"Your Message"}),B.jsx("textarea",{name:"message",value:e.message,onChange:a,placeholder:"What's your message?",className:"bg-blue-50 py-4 px-6 placeholder:text-secondary text-black rounded-lg outline-none border-none font-medium"})]}),B.jsx("button",{type:"submit","aria-busy":i,className:"mt-6 bg-secondary hover:bg-slate-600 py-3 px-8 rounded-xl outline-none w-fit text-primary font-bold",children:i?"Sending...":"Send"})]})]}),B.jsxs("div",{className:"px-4 py-16 sm:px-6 lg:col-span-3 lg:px-8",children:[B.jsxs("div",{className:"grid grid-cols-1 gap-8 sm:grid-cols-2",children:[B.jsxs("div",{children:[B.jsxs("p",{children:[B.jsx("span",{className:"text-xs uppercase tracking-wide text-gray-200",children:" Mail me "}),B.jsx("a",{href:"mailto:satyam.work.only@gmail.com?subject=Just%20wondaring&body=Nothing%20much.",className:"animate-pulse block text-2xl font-medium text-gray-400 hover:opacity-75 sm:text-3xl",children:"Click here to mail."})]}),B.jsxs("ul",{className:"text-gray-200 mt-8 flex gap-6",children:[B.jsx("li",{children:B.jsxs("a",{href:"https://www.instagram.com/satyammishra9050/",rel:"noreferrer",target:"_blank",className:"transition hover:opacity-75",children:[B.jsx("span",{className:"sr-only",children:"Instagram"}),B.jsx("svg",{className:"size-6",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:B.jsx("path",{fillRule:"evenodd",d:"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z",clipRule:"evenodd"})})]})}),B.jsx("li",{children:B.jsxs("a",{href:"https://x.com/bedeadmishra",rel:"noreferrer",target:"_blank",className:"transition hover:opacity-75",children:[B.jsx("span",{className:"sr-only",children:"Twitter"}),B.jsx("svg",{className:"size-6",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:B.jsx("path",{d:"M8.29 20.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0022 5.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.072 4.072 0 012.8 9.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 012 18.407a11.616 11.616 0 006.29 1.84"})})]})}),B.jsx("li",{children:B.jsxs("a",{href:"https://github.com/bedead",rel:"noreferrer",target:"_blank",className:"transition hover:opacity-75",children:[B.jsx("span",{className:"sr-only",children:"GitHub"}),B.jsx("svg",{className:"size-6",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:B.jsx("path",{fillRule:"evenodd",d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z",clipRule:"evenodd"})})]})}),B.jsx("li",{children:B.jsxs("a",{href:"https://www.linkedin.com/in/theaiguysatyam/",rel:"noreferrer",target:"_blank",className:"transition hover:opacity-75",children:[B.jsx("span",{className:"sr-only",children:"Linkedin"}),B.jsx("svg",{className:"size-6",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24",children:B.jsx("path",{d:"M 5.75 3 C 4.2400226 3 3 4.2400226 3 5.75 L 3 18.25 C 3 19.759977 4.2400226 21 5.75 21 L 18.25 21 C 19.759977 21 21 19.759977 21 18.25 L 21 5.75 C 21 4.2400226 19.759977 3 18.25 3 L 5.75 3 z M 5.75 4.5 L 18.25 4.5 C 18.950023 4.5 19.5 5.0499774 19.5 5.75 L 19.5 18.25 C 19.5 18.950023 18.950023 19.5 18.25 19.5 L 5.75 19.5 C 5.0499774 19.5 4.5 18.950023 4.5 18.25 L 4.5 5.75 C 4.5 5.0499774 5.0499774 4.5 5.75 4.5 z M 8.1855469 6.7851562 C 7.4445469 6.7851563 7 7.2293594 7 7.8183594 C 7 8.4113594 7.444375 8.8574219 8.109375 8.8574219 C 8.850375 8.8574219 9.2910156 8.4113594 9.2910156 7.8183594 C 9.2910156 7.2303594 8.8505469 6.7851562 8.1855469 6.7851562 z M 7.0625 9.9628906 L 7.0625 16 L 9.2363281 16 L 9.2363281 9.9628906 L 7.0625 9.9628906 z M 11.033203 9.9628906 L 11.033203 16 L 13.207031 16 L 13.207031 12.697266 C 13.207031 11.718266 13.908141 11.574219 14.119141 11.574219 C 14.330141 11.574219 14.892578 11.785266 14.892578 12.697266 L 14.892578 16 L 17 16 L 17 12.697266 C 17 10.806266 16.154516 9.9628906 15.103516 9.9628906 C 14.052516 9.9628906 13.490031 10.312641 13.207031 10.806641 L 13.207031 9.9628906 L 11.033203 9.9628906 z"})})]})})]})]}),B.jsxs("div",{className:"text-gray-400 grid grid-cols-1 gap-4 sm:grid-cols-2",children:[B.jsxs("div",{children:[B.jsx("p",{className:"font-medium text-gray-200",children:"Top Projects"}),B.jsxs("ul",{className:"mt-6 space-y-4 text-sm",children:[B.jsx("li",{children:B.jsx("a",{href:"https://github.com/bedead/lung-cancer-classification-yoloV8---gradio",className:"transition hover:opacity-75",children:" PATENT - CLASSIFICATION OF LUNG CANCER USING DEEP LEARNING TECHNIQUES. "})}),B.jsx("li",{children:B.jsx("a",{href:"https://colab.research.google.com/drive/1a6LATySYKaS8qqfk_4maSaV4guvTRA-8?usp=sharing",className:"transition hover:opacity-75",children:" ConvoGen AI "})}),B.jsx("li",{children:B.jsx("a",{href:"https://github.com/bedead/Anon-Exchange-chatting",className:"transition hover:opacity-75",children:" Anon Exchange "})})]})]}),B.jsxs("div",{children:[B.jsx("p",{className:"font-medium text-gray-200",children:"Free tools"}),B.jsx("ul",{className:"mt-6 space-y-4 text-sm",children:B.jsx("li",{children:B.jsx("a",{href:"https://downloadtube-iota.vercel.app/",target:"_blank",className:"transition hover:opacity-75",children:" DownloadTube "})})})]})]})]}),B.jsx("div",{className:"mt-12 border-t text-gray-300 border-gray-100 pt-12",children:B.jsx("div",{className:"sm:flex sm:items-center sm:justify-between",children:B.jsx("p",{className:"mt-8 text-sm sm:mt-0",children:"© 2024. Bedead. Made with 💖."})})})]})]})};function Fre(){return B.jsxs("div",{children:[B.jsx(j$,{}),B.jsx(qW,{}),B.jsx(W$,{}),B.jsx(_re,{}),B.jsx(wre,{}),B.jsx(Pre,{}),B.jsx(Lre,{}),B.jsx(Ure,{})]})}function PC(n,e){var t={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(n);r{let s={},o={};i&&(e==="GET"?o=i:s={body:JSON.stringify(i)});const a=Dm(Object.assign({key:n.config.apiKey},o)).slice(1),l=await n._getAdditionalHeaders();l["Content-Type"]="application/json",n.languageCode&&(l["X-Firebase-Locale"]=n.languageCode);const c=Object.assign({method:e,headers:l},s);return Aj()||(c.referrerPolicy="no-referrer"),R4.fetch()(L4(n,n.config.apiHost,t,a),c)})}async function I4(n,e,t){n._canInitEmulator=!1;const i=Object.assign(Object.assign({},Wre),e);try{const r=new qre(n),s=await Promise.race([t(),r.promise]);r.clearNetworkTimeout();const o=await s.json();if("needConfirmation"in o)throw lv(n,"account-exists-with-different-credential",o);if(s.ok&&!("errorMessage"in o))return o;{const a=s.ok?o.errorMessage:o.error.message,[l,c]=a.split(" : ");if(l==="FEDERATED_USER_ID_ALREADY_LINKED")throw lv(n,"credential-already-in-use",o);if(l==="EMAIL_EXISTS")throw lv(n,"email-already-in-use",o);if(l==="USER_DISABLED")throw lv(n,"user-disabled",o);const d=i[l]||l.toLowerCase().replace(/[_\s]+/g,"-");if(c)throw P4(n,d,c);$s(n,d)}}catch(r){if(r instanceof _a)throw r;$s(n,"network-request-failed",{message:String(r)})}}async function Ux(n,e,t,i,r={}){const s=await Hl(n,e,t,i,r);return"mfaPendingCredential"in s&&$s(n,"multi-factor-auth-required",{_serverResponse:s}),s}function L4(n,e,t,i){const r=`${e}${t}?${i}`;return n.config.emulator?IC(n.config,r):`${n.config.apiScheme}://${r}`}function Xre(n){switch(n){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}class qre{constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((t,i)=>{this.timer=setTimeout(()=>i(So(this.auth,"network-request-failed")),jre.get())})}clearNetworkTimeout(){clearTimeout(this.timer)}}function lv(n,e,t){const i={appName:n.name};t.email&&(i.email=t.email),t.phoneNumber&&(i.phoneNumber=t.phoneNumber);const r=So(n,e,i);return r.customData._tokenResponse=t,r}function AN(n){return n!==void 0&&n.enterprise!==void 0}class $re{constructor(e){if(this.siteKey="",this.recaptchaEnforcementState=[],e.recaptchaKey===void 0)throw new Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.recaptchaEnforcementState=e.recaptchaEnforcementState}getProviderEnforcementState(e){if(!this.recaptchaEnforcementState||this.recaptchaEnforcementState.length===0)return null;for(const t of this.recaptchaEnforcementState)if(t.provider&&t.provider===e)return Xre(t.enforcementState);return null}isProviderEnabled(e){return this.getProviderEnforcementState(e)==="ENFORCE"||this.getProviderEnforcementState(e)==="AUDIT"}}async function Yre(n,e){return Hl(n,"GET","/v2/recaptchaConfig",wu(n,e))}/** + */const jre=new Zm(3e4,6e4);function wu(n,e){return n.tenantId&&!e.tenantId?Object.assign(Object.assign({},e),{tenantId:n.tenantId}):e}async function Hl(n,e,t,i,r={}){return L4(n,r,async()=>{let s={},o={};i&&(e==="GET"?o=i:s={body:JSON.stringify(i)});const a=Dm(Object.assign({key:n.config.apiKey},o)).slice(1),l=await n._getAdditionalHeaders();l["Content-Type"]="application/json",n.languageCode&&(l["X-Firebase-Locale"]=n.languageCode);const c=Object.assign({method:e,headers:l},s);return Aj()||(c.referrerPolicy="no-referrer"),I4.fetch()(N4(n,n.config.apiHost,t,a),c)})}async function L4(n,e,t){n._canInitEmulator=!1;const i=Object.assign(Object.assign({},Wre),e);try{const r=new qre(n),s=await Promise.race([t(),r.promise]);r.clearNetworkTimeout();const o=await s.json();if("needConfirmation"in o)throw lv(n,"account-exists-with-different-credential",o);if(s.ok&&!("errorMessage"in o))return o;{const a=s.ok?o.errorMessage:o.error.message,[l,c]=a.split(" : ");if(l==="FEDERATED_USER_ID_ALREADY_LINKED")throw lv(n,"credential-already-in-use",o);if(l==="EMAIL_EXISTS")throw lv(n,"email-already-in-use",o);if(l==="USER_DISABLED")throw lv(n,"user-disabled",o);const d=i[l]||l.toLowerCase().replace(/[_\s]+/g,"-");if(c)throw R4(n,d,c);$s(n,d)}}catch(r){if(r instanceof _a)throw r;$s(n,"network-request-failed",{message:String(r)})}}async function Ux(n,e,t,i,r={}){const s=await Hl(n,e,t,i,r);return"mfaPendingCredential"in s&&$s(n,"multi-factor-auth-required",{_serverResponse:s}),s}function N4(n,e,t,i){const r=`${e}${t}?${i}`;return n.config.emulator?IC(n.config,r):`${n.config.apiScheme}://${r}`}function Xre(n){switch(n){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}class qre{constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((t,i)=>{this.timer=setTimeout(()=>i(So(this.auth,"network-request-failed")),jre.get())})}clearNetworkTimeout(){clearTimeout(this.timer)}}function lv(n,e,t){const i={appName:n.name};t.email&&(i.email=t.email),t.phoneNumber&&(i.phoneNumber=t.phoneNumber);const r=So(n,e,i);return r.customData._tokenResponse=t,r}function AN(n){return n!==void 0&&n.enterprise!==void 0}class $re{constructor(e){if(this.siteKey="",this.recaptchaEnforcementState=[],e.recaptchaKey===void 0)throw new Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.recaptchaEnforcementState=e.recaptchaEnforcementState}getProviderEnforcementState(e){if(!this.recaptchaEnforcementState||this.recaptchaEnforcementState.length===0)return null;for(const t of this.recaptchaEnforcementState)if(t.provider&&t.provider===e)return Xre(t.enforcementState);return null}isProviderEnabled(e){return this.getProviderEnforcementState(e)==="ENFORCE"||this.getProviderEnforcementState(e)==="AUDIT"}}async function Yre(n,e){return Hl(n,"GET","/v2/recaptchaConfig",wu(n,e))}/** * @license * Copyright 2020 Google LLC * @@ -6013,7 +6013,7 @@ No matching component was found for: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */async function Kre(n,e){return Hl(n,"POST","/v1/accounts:delete",e)}async function N4(n,e){return Hl(n,"POST","/v1/accounts:lookup",e)}/** + */async function Kre(n,e){return Hl(n,"POST","/v1/accounts:delete",e)}async function D4(n,e){return Hl(n,"POST","/v1/accounts:lookup",e)}/** * @license * Copyright 2020 Google LLC * @@ -6028,7 +6028,7 @@ No matching component was found for: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function Tp(n){if(n)try{const e=new Date(Number(n));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}async function Qre(n,e=!1){const t=Ul(n),i=await t.getIdToken(e),r=LC(i);bt(r&&r.exp&&r.auth_time&&r.iat,t.auth,"internal-error");const s=typeof r.firebase=="object"?r.firebase:void 0,o=s==null?void 0:s.sign_in_provider;return{claims:r,token:i,authTime:Tp(P1(r.auth_time)),issuedAtTime:Tp(P1(r.iat)),expirationTime:Tp(P1(r.exp)),signInProvider:o||null,signInSecondFactor:(s==null?void 0:s.sign_in_second_factor)||null}}function P1(n){return Number(n)*1e3}function LC(n){const[e,t,i]=n.split(".");if(e===void 0||t===void 0||i===void 0)return Iv("JWT malformed, contained fewer than 3 sections"),null;try{const r=qO(t);return r?JSON.parse(r):(Iv("Failed to decode base64 JWT payload"),null)}catch(r){return Iv("Caught error parsing JWT payload as JSON",r==null?void 0:r.toString()),null}}function MN(n){const e=LC(n);return bt(e,"internal-error"),bt(typeof e.exp<"u","internal-error"),bt(typeof e.iat<"u","internal-error"),Number(e.exp)-Number(e.iat)}/** + */function Tp(n){if(n)try{const e=new Date(Number(n));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}async function Qre(n,e=!1){const t=Ul(n),i=await t.getIdToken(e),r=LC(i);bt(r&&r.exp&&r.auth_time&&r.iat,t.auth,"internal-error");const s=typeof r.firebase=="object"?r.firebase:void 0,o=s==null?void 0:s.sign_in_provider;return{claims:r,token:i,authTime:Tp(P1(r.auth_time)),issuedAtTime:Tp(P1(r.iat)),expirationTime:Tp(P1(r.exp)),signInProvider:o||null,signInSecondFactor:(s==null?void 0:s.sign_in_second_factor)||null}}function P1(n){return Number(n)*1e3}function LC(n){const[e,t,i]=n.split(".");if(e===void 0||t===void 0||i===void 0)return Iv("JWT malformed, contained fewer than 3 sections"),null;try{const r=$O(t);return r?JSON.parse(r):(Iv("Failed to decode base64 JWT payload"),null)}catch(r){return Iv("Caught error parsing JWT payload as JSON",r==null?void 0:r.toString()),null}}function MN(n){const e=LC(n);return bt(e,"internal-error"),bt(typeof e.exp<"u","internal-error"),bt(typeof e.iat<"u","internal-error"),Number(e.exp)-Number(e.iat)}/** * @license * Copyright 2020 Google LLC * @@ -6088,7 +6088,7 @@ No matching component was found for: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */async function f_(n){var e;const t=n.auth,i=await n.getIdToken(),r=await xm(n,N4(t,{idToken:i}));bt(r==null?void 0:r.users.length,t,"internal-error");const s=r.users[0];n._notifyReloadListener(s);const o=!((e=s.providerUserInfo)===null||e===void 0)&&e.length?D4(s.providerUserInfo):[],a=tse(n.providerData,o),l=n.isAnonymous,c=!(n.email&&s.passwordHash)&&!(a!=null&&a.length),d=l?c:!1,f={uid:s.localId,displayName:s.displayName||null,photoURL:s.photoUrl||null,email:s.email||null,emailVerified:s.emailVerified||!1,phoneNumber:s.phoneNumber||null,tenantId:s.tenantId||null,providerData:a,metadata:new NT(s.createdAt,s.lastLoginAt),isAnonymous:d};Object.assign(n,f)}async function ese(n){const e=Ul(n);await f_(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}function tse(n,e){return[...n.filter(i=>!e.some(r=>r.providerId===i.providerId)),...e]}function D4(n){return n.map(e=>{var{providerId:t}=e,i=PC(e,["providerId"]);return{providerId:t,uid:i.rawId||"",displayName:i.displayName||null,email:i.email||null,phoneNumber:i.phoneNumber||null,photoURL:i.photoUrl||null}})}/** + */async function f_(n){var e;const t=n.auth,i=await n.getIdToken(),r=await xm(n,D4(t,{idToken:i}));bt(r==null?void 0:r.users.length,t,"internal-error");const s=r.users[0];n._notifyReloadListener(s);const o=!((e=s.providerUserInfo)===null||e===void 0)&&e.length?k4(s.providerUserInfo):[],a=tse(n.providerData,o),l=n.isAnonymous,c=!(n.email&&s.passwordHash)&&!(a!=null&&a.length),d=l?c:!1,f={uid:s.localId,displayName:s.displayName||null,photoURL:s.photoUrl||null,email:s.email||null,emailVerified:s.emailVerified||!1,phoneNumber:s.phoneNumber||null,tenantId:s.tenantId||null,providerData:a,metadata:new NT(s.createdAt,s.lastLoginAt),isAnonymous:d};Object.assign(n,f)}async function ese(n){const e=Ul(n);await f_(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}function tse(n,e){return[...n.filter(i=>!e.some(r=>r.providerId===i.providerId)),...e]}function k4(n){return n.map(e=>{var{providerId:t}=e,i=PC(e,["providerId"]);return{providerId:t,uid:i.rawId||"",displayName:i.displayName||null,email:i.email||null,phoneNumber:i.phoneNumber||null,photoURL:i.photoUrl||null}})}/** * @license * Copyright 2020 Google LLC * @@ -6103,7 +6103,7 @@ No matching component was found for: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */async function nse(n,e){const t=await I4(n,{},async()=>{const i=Dm({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:r,apiKey:s}=n.config,o=L4(n,r,"/v1/token",`key=${s}`),a=await n._getAdditionalHeaders();return a["Content-Type"]="application/x-www-form-urlencoded",R4.fetch()(o,{method:"POST",headers:a,body:i})});return{accessToken:t.access_token,expiresIn:t.expires_in,refreshToken:t.refresh_token}}async function ise(n,e){return Hl(n,"POST","/v2/accounts:revokeToken",wu(n,e))}/** + */async function nse(n,e){const t=await L4(n,{},async()=>{const i=Dm({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:r,apiKey:s}=n.config,o=N4(n,r,"/v1/token",`key=${s}`),a=await n._getAdditionalHeaders();return a["Content-Type"]="application/x-www-form-urlencoded",I4.fetch()(o,{method:"POST",headers:a,body:i})});return{accessToken:t.access_token,expiresIn:t.expires_in,refreshToken:t.refresh_token}}async function ise(n,e){return Hl(n,"POST","/v2/accounts:revokeToken",wu(n,e))}/** * @license * Copyright 2020 Google LLC * @@ -6133,7 +6133,7 @@ No matching component was found for: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function ja(n,e){bt(typeof n=="string"||typeof n>"u","internal-error",{appName:e})}class Zo{constructor(e){var{uid:t,auth:i,stsTokenManager:r}=e,s=PC(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new Zre(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=i,this.stsTokenManager=r,this.accessToken=r.accessToken,this.displayName=s.displayName||null,this.email=s.email||null,this.emailVerified=s.emailVerified||!1,this.phoneNumber=s.phoneNumber||null,this.photoURL=s.photoURL||null,this.isAnonymous=s.isAnonymous||!1,this.tenantId=s.tenantId||null,this.providerData=s.providerData?[...s.providerData]:[],this.metadata=new NT(s.createdAt||void 0,s.lastLoginAt||void 0)}async getIdToken(e){const t=await xm(this,this.stsTokenManager.getToken(this.auth,e));return bt(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return Qre(this,e)}reload(){return ese(this)}_assign(e){this!==e&&(bt(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(t=>Object.assign({},t)),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const t=new Zo(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}));return t.metadata._copy(this.metadata),t}_onReload(e){bt(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,t=!1){let i=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),i=!0),t&&await f_(this),await this.auth._persistUserIfCurrent(this),i&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(Ko(this.auth.app))return Promise.reject(wl(this.auth));const e=await this.getIdToken();return await xm(this,Kre(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return Object.assign(Object.assign({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>Object.assign({},e)),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{apiKey:this.auth.config.apiKey,appName:this.auth.name})}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,t){var i,r,s,o,a,l,c,d;const f=(i=t.displayName)!==null&&i!==void 0?i:void 0,p=(r=t.email)!==null&&r!==void 0?r:void 0,m=(s=t.phoneNumber)!==null&&s!==void 0?s:void 0,_=(o=t.photoURL)!==null&&o!==void 0?o:void 0,S=(a=t.tenantId)!==null&&a!==void 0?a:void 0,x=(l=t._redirectEventId)!==null&&l!==void 0?l:void 0,y=(c=t.createdAt)!==null&&c!==void 0?c:void 0,E=(d=t.lastLoginAt)!==null&&d!==void 0?d:void 0,{uid:w,emailVerified:M,isAnonymous:O,providerData:k,stsTokenManager:I}=t;bt(w&&I,e,"internal-error");const P=qh.fromJSON(this.name,I);bt(typeof w=="string",e,"internal-error"),ja(f,e.name),ja(p,e.name),bt(typeof M=="boolean",e,"internal-error"),bt(typeof O=="boolean",e,"internal-error"),ja(m,e.name),ja(_,e.name),ja(S,e.name),ja(x,e.name),ja(y,e.name),ja(E,e.name);const D=new Zo({uid:w,auth:e,email:p,emailVerified:M,displayName:f,isAnonymous:O,photoURL:_,phoneNumber:m,tenantId:S,stsTokenManager:P,createdAt:y,lastLoginAt:E});return k&&Array.isArray(k)&&(D.providerData=k.map(A=>Object.assign({},A))),x&&(D._redirectEventId=x),D}static async _fromIdTokenResponse(e,t,i=!1){const r=new qh;r.updateFromServerResponse(t);const s=new Zo({uid:t.localId,auth:e,stsTokenManager:r,isAnonymous:i});return await f_(s),s}static async _fromGetAccountInfoResponse(e,t,i){const r=t.users[0];bt(r.localId!==void 0,"internal-error");const s=r.providerUserInfo!==void 0?D4(r.providerUserInfo):[],o=!(r.email&&r.passwordHash)&&!(s!=null&&s.length),a=new qh;a.updateFromIdToken(i);const l=new Zo({uid:r.localId,auth:e,stsTokenManager:a,isAnonymous:o}),c={uid:r.localId,displayName:r.displayName||null,photoURL:r.photoUrl||null,email:r.email||null,emailVerified:r.emailVerified||!1,phoneNumber:r.phoneNumber||null,tenantId:r.tenantId||null,providerData:s,metadata:new NT(r.createdAt,r.lastLoginAt),isAnonymous:!(r.email&&r.passwordHash)&&!(s!=null&&s.length)};return Object.assign(l,c),l}}/** + */function ja(n,e){bt(typeof n=="string"||typeof n>"u","internal-error",{appName:e})}class Zo{constructor(e){var{uid:t,auth:i,stsTokenManager:r}=e,s=PC(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new Zre(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=i,this.stsTokenManager=r,this.accessToken=r.accessToken,this.displayName=s.displayName||null,this.email=s.email||null,this.emailVerified=s.emailVerified||!1,this.phoneNumber=s.phoneNumber||null,this.photoURL=s.photoURL||null,this.isAnonymous=s.isAnonymous||!1,this.tenantId=s.tenantId||null,this.providerData=s.providerData?[...s.providerData]:[],this.metadata=new NT(s.createdAt||void 0,s.lastLoginAt||void 0)}async getIdToken(e){const t=await xm(this,this.stsTokenManager.getToken(this.auth,e));return bt(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return Qre(this,e)}reload(){return ese(this)}_assign(e){this!==e&&(bt(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(t=>Object.assign({},t)),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const t=new Zo(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}));return t.metadata._copy(this.metadata),t}_onReload(e){bt(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,t=!1){let i=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),i=!0),t&&await f_(this),await this.auth._persistUserIfCurrent(this),i&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(Ko(this.auth.app))return Promise.reject(wl(this.auth));const e=await this.getIdToken();return await xm(this,Kre(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return Object.assign(Object.assign({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>Object.assign({},e)),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{apiKey:this.auth.config.apiKey,appName:this.auth.name})}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,t){var i,r,s,o,a,l,c,d;const f=(i=t.displayName)!==null&&i!==void 0?i:void 0,p=(r=t.email)!==null&&r!==void 0?r:void 0,m=(s=t.phoneNumber)!==null&&s!==void 0?s:void 0,_=(o=t.photoURL)!==null&&o!==void 0?o:void 0,S=(a=t.tenantId)!==null&&a!==void 0?a:void 0,x=(l=t._redirectEventId)!==null&&l!==void 0?l:void 0,y=(c=t.createdAt)!==null&&c!==void 0?c:void 0,E=(d=t.lastLoginAt)!==null&&d!==void 0?d:void 0,{uid:w,emailVerified:M,isAnonymous:O,providerData:k,stsTokenManager:I}=t;bt(w&&I,e,"internal-error");const P=qh.fromJSON(this.name,I);bt(typeof w=="string",e,"internal-error"),ja(f,e.name),ja(p,e.name),bt(typeof M=="boolean",e,"internal-error"),bt(typeof O=="boolean",e,"internal-error"),ja(m,e.name),ja(_,e.name),ja(S,e.name),ja(x,e.name),ja(y,e.name),ja(E,e.name);const D=new Zo({uid:w,auth:e,email:p,emailVerified:M,displayName:f,isAnonymous:O,photoURL:_,phoneNumber:m,tenantId:S,stsTokenManager:P,createdAt:y,lastLoginAt:E});return k&&Array.isArray(k)&&(D.providerData=k.map(A=>Object.assign({},A))),x&&(D._redirectEventId=x),D}static async _fromIdTokenResponse(e,t,i=!1){const r=new qh;r.updateFromServerResponse(t);const s=new Zo({uid:t.localId,auth:e,stsTokenManager:r,isAnonymous:i});return await f_(s),s}static async _fromGetAccountInfoResponse(e,t,i){const r=t.users[0];bt(r.localId!==void 0,"internal-error");const s=r.providerUserInfo!==void 0?k4(r.providerUserInfo):[],o=!(r.email&&r.passwordHash)&&!(s!=null&&s.length),a=new qh;a.updateFromIdToken(i);const l=new Zo({uid:r.localId,auth:e,stsTokenManager:a,isAnonymous:o}),c={uid:r.localId,displayName:r.displayName||null,photoURL:r.photoUrl||null,email:r.email||null,emailVerified:r.emailVerified||!1,phoneNumber:r.phoneNumber||null,tenantId:r.tenantId||null,providerData:s,metadata:new NT(r.createdAt,r.lastLoginAt),isAnonymous:!(r.email&&r.passwordHash)&&!(s!=null&&s.length)};return Object.assign(l,c),l}}/** * @license * Copyright 2020 Google LLC * @@ -6163,7 +6163,7 @@ No matching component was found for: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class k4{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,t){this.storage[e]=t}async _get(e){const t=this.storage[e];return t===void 0?null:t}async _remove(e){delete this.storage[e]}_addListener(e,t){}_removeListener(e,t){}}k4.type="NONE";const bN=k4;/** + */class O4{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,t){this.storage[e]=t}async _get(e){const t=this.storage[e];return t===void 0?null:t}async _remove(e){delete this.storage[e]}_addListener(e,t){}_removeListener(e,t){}}O4.type="NONE";const bN=O4;/** * @license * Copyright 2019 Google LLC * @@ -6193,7 +6193,7 @@ No matching component was found for: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function PN(n){const e=n.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(V4(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(O4(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(z4(e))return"Blackberry";if(H4(e))return"Webos";if(U4(e))return"Safari";if((e.includes("chrome/")||F4(e))&&!e.includes("edge/"))return"Chrome";if(B4(e))return"Android";{const t=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,i=n.match(t);if((i==null?void 0:i.length)===2)return i[1]}return"Other"}function O4(n=or()){return/firefox\//i.test(n)}function U4(n=or()){const e=n.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function F4(n=or()){return/crios\//i.test(n)}function V4(n=or()){return/iemobile/i.test(n)}function B4(n=or()){return/android/i.test(n)}function z4(n=or()){return/blackberry/i.test(n)}function H4(n=or()){return/webos/i.test(n)}function NC(n=or()){return/iphone|ipad|ipod/i.test(n)||/macintosh/i.test(n)&&/mobile/i.test(n)}function rse(n=or()){var e;return NC(n)&&!!(!((e=window.navigator)===null||e===void 0)&&e.standalone)}function sse(){return bj()&&document.documentMode===10}function G4(n=or()){return NC(n)||B4(n)||H4(n)||z4(n)||/windows phone/i.test(n)||V4(n)}/** + */function PN(n){const e=n.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(B4(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(U4(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(H4(e))return"Blackberry";if(G4(e))return"Webos";if(F4(e))return"Safari";if((e.includes("chrome/")||V4(e))&&!e.includes("edge/"))return"Chrome";if(z4(e))return"Android";{const t=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,i=n.match(t);if((i==null?void 0:i.length)===2)return i[1]}return"Other"}function U4(n=or()){return/firefox\//i.test(n)}function F4(n=or()){const e=n.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function V4(n=or()){return/crios\//i.test(n)}function B4(n=or()){return/iemobile/i.test(n)}function z4(n=or()){return/android/i.test(n)}function H4(n=or()){return/blackberry/i.test(n)}function G4(n=or()){return/webos/i.test(n)}function NC(n=or()){return/iphone|ipad|ipod/i.test(n)||/macintosh/i.test(n)&&/mobile/i.test(n)}function rse(n=or()){var e;return NC(n)&&!!(!((e=window.navigator)===null||e===void 0)&&e.standalone)}function sse(){return bj()&&document.documentMode===10}function W4(n=or()){return NC(n)||z4(n)||G4(n)||H4(n)||/windows phone/i.test(n)||B4(n)}/** * @license * Copyright 2020 Google LLC * @@ -6208,7 +6208,7 @@ No matching component was found for: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function W4(n,e=[]){let t;switch(n){case"Browser":t=PN(or());break;case"Worker":t=`${PN(or())}-${n}`;break;default:t=n}const i=e.length?e.join(","):"FirebaseCore-web";return`${t}/JsCore/${Ad}/${i}`}/** + */function j4(n,e=[]){let t;switch(n){case"Browser":t=PN(or());break;case"Worker":t=`${PN(or())}-${n}`;break;default:t=n}const i=e.length?e.join(","):"FirebaseCore-web";return`${t}/JsCore/${Ad}/${i}`}/** * @license * Copyright 2022 Google LLC * @@ -6268,7 +6268,7 @@ No matching component was found for: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class use{constructor(e,t,i,r){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=i,this.config=r,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new RN(this),this.idTokenSubscription=new RN(this),this.beforeStateQueue=new ose(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=b4,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=r.sdkClientVersion}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=ea(t)),this._initializationPromise=this.queue(async()=>{var i,r;if(!this._deleted&&(this.persistenceManager=await $h.create(this,e),!this._deleted)){if(!((i=this._popupRedirectResolver)===null||i===void 0)&&i._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(t),this.lastNotifiedUid=((r=this.currentUser)===null||r===void 0?void 0:r.uid)||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const e=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!e)){if(this.currentUser&&e&&this.currentUser.uid===e.uid){this._currentUser._assign(e),await this.currentUser.getIdToken();return}await this._updateCurrentUser(e,!0)}}async initializeCurrentUserFromIdToken(e){try{const t=await N4(this,{idToken:e}),i=await Zo._fromGetAccountInfoResponse(this,t,e);await this.directlySetCurrentUser(i)}catch(t){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",t),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){var t;if(Ko(this.app)){const o=this.app.settings.authIdToken;return o?new Promise(a=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(o).then(a,a))}):this.directlySetCurrentUser(null)}const i=await this.assertedPersistence.getCurrentUser();let r=i,s=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const o=(t=this.redirectUser)===null||t===void 0?void 0:t._redirectEventId,a=r==null?void 0:r._redirectEventId,l=await this.tryRedirectSignIn(e);(!o||o===a)&&(l!=null&&l.user)&&(r=l.user,s=!0)}if(!r)return this.directlySetCurrentUser(null);if(!r._redirectEventId){if(s)try{await this.beforeStateQueue.runMiddleware(r)}catch(o){r=i,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(o))}return r?this.reloadAndSetCurrentUserOrClear(r):this.directlySetCurrentUser(null)}return bt(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===r._redirectEventId?this.directlySetCurrentUser(r):this.reloadAndSetCurrentUserOrClear(r)}async tryRedirectSignIn(e){let t=null;try{t=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch{await this._setRedirectUser(null)}return t}async reloadAndSetCurrentUserOrClear(e){try{await f_(e)}catch(t){if((t==null?void 0:t.code)!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=Gre()}async _delete(){this._deleted=!0}async updateCurrentUser(e){if(Ko(this.app))return Promise.reject(wl(this));const t=e?Ul(e):null;return t&&bt(t.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(t&&t._clone(this))}async _updateCurrentUser(e,t=!1){if(!this._deleted)return e&&bt(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),t||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return Ko(this.app)?Promise.reject(wl(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return Ko(this.app)?Promise.reject(wl(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(ea(e))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const t=this._getPasswordPolicyInternal();return t.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):t.validatePassword(e)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const e=await ase(this),t=new cse(e);this.tenantId===null?this._projectPasswordPolicy=t:this._tenantPasswordPolicies[this.tenantId]=t}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(e){this._errorFactory=new Nm("auth","Firebase",e())}onAuthStateChanged(e,t,i){return this.registerStateListener(this.authStateSubscription,e,t,i)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,i){return this.registerStateListener(this.idTokenSubscription,e,t,i)}authStateReady(){return new Promise((e,t)=>{if(this.currentUser)e();else{const i=this.onAuthStateChanged(()=>{i(),e()},t)}})}async revokeAccessToken(e){if(this.currentUser){const t=await this.currentUser.getIdToken(),i={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:t};this.tenantId!=null&&(i.tenantId=this.tenantId),await ise(this,i)}}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(e=this._currentUser)===null||e===void 0?void 0:e.toJSON()}}async _setRedirectUser(e,t){const i=await this.getOrInitRedirectPersistenceManager(t);return e===null?i.removeCurrentUser():i.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const t=e&&ea(e)||this._popupRedirectResolver;bt(t,this,"argument-error"),this.redirectPersistenceManager=await $h.create(this,[ea(t._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var t,i;return this._isInitialized&&await this.queue(async()=>{}),((t=this._currentUser)===null||t===void 0?void 0:t._redirectEventId)===e?this._currentUser:((i=this.redirectUser)===null||i===void 0?void 0:i._redirectEventId)===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(e))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var e,t;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const i=(t=(e=this.currentUser)===null||e===void 0?void 0:e.uid)!==null&&t!==void 0?t:null;this.lastNotifiedUid!==i&&(this.lastNotifiedUid=i,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,i,r){if(this._deleted)return()=>{};const s=typeof t=="function"?t:t.next.bind(t);let o=!1;const a=this._isInitialized?Promise.resolve():this._initializationPromise;if(bt(a,this,"internal-error"),a.then(()=>{o||s(this.currentUser)}),typeof t=="function"){const l=e.addObserver(t,i,r);return()=>{o=!0,l()}}else{const l=e.addObserver(t);return()=>{o=!0,l()}}}async directlySetCurrentUser(e){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?await this.assertedPersistence.setCurrentUser(e):await this.assertedPersistence.removeCurrentUser()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return bt(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=W4(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var e;const t={"X-Client-Version":this.clientVersion};this.app.options.appId&&(t["X-Firebase-gmpid"]=this.app.options.appId);const i=await((e=this.heartbeatServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getHeartbeatsHeader());i&&(t["X-Firebase-Client"]=i);const r=await this._getAppCheckToken();return r&&(t["X-Firebase-AppCheck"]=r),t}async _getAppCheckToken(){var e;const t=await((e=this.appCheckServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getToken());return t!=null&&t.error&&Bre(`Error while retrieving App Check token: ${t.error}`),t==null?void 0:t.token}}function kd(n){return Ul(n)}class RN{constructor(e){this.auth=e,this.observer=null,this.addObserver=Oj(t=>this.observer=t)}get next(){return bt(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/** + */class use{constructor(e,t,i,r){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=i,this.config=r,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new RN(this),this.idTokenSubscription=new RN(this),this.beforeStateQueue=new ose(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=P4,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=r.sdkClientVersion}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=ea(t)),this._initializationPromise=this.queue(async()=>{var i,r;if(!this._deleted&&(this.persistenceManager=await $h.create(this,e),!this._deleted)){if(!((i=this._popupRedirectResolver)===null||i===void 0)&&i._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(t),this.lastNotifiedUid=((r=this.currentUser)===null||r===void 0?void 0:r.uid)||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const e=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!e)){if(this.currentUser&&e&&this.currentUser.uid===e.uid){this._currentUser._assign(e),await this.currentUser.getIdToken();return}await this._updateCurrentUser(e,!0)}}async initializeCurrentUserFromIdToken(e){try{const t=await D4(this,{idToken:e}),i=await Zo._fromGetAccountInfoResponse(this,t,e);await this.directlySetCurrentUser(i)}catch(t){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",t),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){var t;if(Ko(this.app)){const o=this.app.settings.authIdToken;return o?new Promise(a=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(o).then(a,a))}):this.directlySetCurrentUser(null)}const i=await this.assertedPersistence.getCurrentUser();let r=i,s=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const o=(t=this.redirectUser)===null||t===void 0?void 0:t._redirectEventId,a=r==null?void 0:r._redirectEventId,l=await this.tryRedirectSignIn(e);(!o||o===a)&&(l!=null&&l.user)&&(r=l.user,s=!0)}if(!r)return this.directlySetCurrentUser(null);if(!r._redirectEventId){if(s)try{await this.beforeStateQueue.runMiddleware(r)}catch(o){r=i,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(o))}return r?this.reloadAndSetCurrentUserOrClear(r):this.directlySetCurrentUser(null)}return bt(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===r._redirectEventId?this.directlySetCurrentUser(r):this.reloadAndSetCurrentUserOrClear(r)}async tryRedirectSignIn(e){let t=null;try{t=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch{await this._setRedirectUser(null)}return t}async reloadAndSetCurrentUserOrClear(e){try{await f_(e)}catch(t){if((t==null?void 0:t.code)!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=Gre()}async _delete(){this._deleted=!0}async updateCurrentUser(e){if(Ko(this.app))return Promise.reject(wl(this));const t=e?Ul(e):null;return t&&bt(t.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(t&&t._clone(this))}async _updateCurrentUser(e,t=!1){if(!this._deleted)return e&&bt(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),t||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return Ko(this.app)?Promise.reject(wl(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return Ko(this.app)?Promise.reject(wl(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(ea(e))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const t=this._getPasswordPolicyInternal();return t.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):t.validatePassword(e)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const e=await ase(this),t=new cse(e);this.tenantId===null?this._projectPasswordPolicy=t:this._tenantPasswordPolicies[this.tenantId]=t}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(e){this._errorFactory=new Nm("auth","Firebase",e())}onAuthStateChanged(e,t,i){return this.registerStateListener(this.authStateSubscription,e,t,i)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,i){return this.registerStateListener(this.idTokenSubscription,e,t,i)}authStateReady(){return new Promise((e,t)=>{if(this.currentUser)e();else{const i=this.onAuthStateChanged(()=>{i(),e()},t)}})}async revokeAccessToken(e){if(this.currentUser){const t=await this.currentUser.getIdToken(),i={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:t};this.tenantId!=null&&(i.tenantId=this.tenantId),await ise(this,i)}}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(e=this._currentUser)===null||e===void 0?void 0:e.toJSON()}}async _setRedirectUser(e,t){const i=await this.getOrInitRedirectPersistenceManager(t);return e===null?i.removeCurrentUser():i.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const t=e&&ea(e)||this._popupRedirectResolver;bt(t,this,"argument-error"),this.redirectPersistenceManager=await $h.create(this,[ea(t._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var t,i;return this._isInitialized&&await this.queue(async()=>{}),((t=this._currentUser)===null||t===void 0?void 0:t._redirectEventId)===e?this._currentUser:((i=this.redirectUser)===null||i===void 0?void 0:i._redirectEventId)===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(e))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var e,t;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const i=(t=(e=this.currentUser)===null||e===void 0?void 0:e.uid)!==null&&t!==void 0?t:null;this.lastNotifiedUid!==i&&(this.lastNotifiedUid=i,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,i,r){if(this._deleted)return()=>{};const s=typeof t=="function"?t:t.next.bind(t);let o=!1;const a=this._isInitialized?Promise.resolve():this._initializationPromise;if(bt(a,this,"internal-error"),a.then(()=>{o||s(this.currentUser)}),typeof t=="function"){const l=e.addObserver(t,i,r);return()=>{o=!0,l()}}else{const l=e.addObserver(t);return()=>{o=!0,l()}}}async directlySetCurrentUser(e){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?await this.assertedPersistence.setCurrentUser(e):await this.assertedPersistence.removeCurrentUser()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return bt(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=j4(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var e;const t={"X-Client-Version":this.clientVersion};this.app.options.appId&&(t["X-Firebase-gmpid"]=this.app.options.appId);const i=await((e=this.heartbeatServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getHeartbeatsHeader());i&&(t["X-Firebase-Client"]=i);const r=await this._getAppCheckToken();return r&&(t["X-Firebase-AppCheck"]=r),t}async _getAppCheckToken(){var e;const t=await((e=this.appCheckServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getToken());return t!=null&&t.error&&Bre(`Error while retrieving App Check token: ${t.error}`),t==null?void 0:t.token}}function kd(n){return Ul(n)}class RN{constructor(e){this.auth=e,this.observer=null,this.addObserver=Oj(t=>this.observer=t)}get next(){return bt(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/** * @license * Copyright 2020 Google LLC * @@ -6283,7 +6283,7 @@ No matching component was found for: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */let Fx={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function hse(n){Fx=n}function j4(n){return Fx.loadJS(n)}function dse(){return Fx.recaptchaEnterpriseScript}function fse(){return Fx.gapiScript}function pse(n){return`__${n}${Math.floor(Math.random()*1e6)}`}const mse="recaptcha-enterprise",gse="NO_RECAPTCHA";class yse{constructor(e){this.type=mse,this.auth=kd(e)}async verify(e="verify",t=!1){async function i(s){if(!t){if(s.tenantId==null&&s._agentRecaptchaConfig!=null)return s._agentRecaptchaConfig.siteKey;if(s.tenantId!=null&&s._tenantRecaptchaConfigs[s.tenantId]!==void 0)return s._tenantRecaptchaConfigs[s.tenantId].siteKey}return new Promise(async(o,a)=>{Yre(s,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(l=>{if(l.recaptchaKey===void 0)a(new Error("recaptcha Enterprise site key undefined"));else{const c=new $re(l);return s.tenantId==null?s._agentRecaptchaConfig=c:s._tenantRecaptchaConfigs[s.tenantId]=c,o(c.siteKey)}}).catch(l=>{a(l)})})}function r(s,o,a){const l=window.grecaptcha;AN(l)?l.enterprise.ready(()=>{l.enterprise.execute(s,{action:e}).then(c=>{o(c)}).catch(()=>{o(gse)})}):a(Error("No reCAPTCHA enterprise script loaded."))}return new Promise((s,o)=>{i(this.auth).then(a=>{if(!t&&AN(window.grecaptcha))r(a,s,o);else{if(typeof window>"u"){o(new Error("RecaptchaVerifier is only supported in browser"));return}let l=dse();l.length!==0&&(l+=a),j4(l).then(()=>{r(a,s,o)}).catch(c=>{o(c)})}}).catch(a=>{o(a)})})}}async function IN(n,e,t,i=!1){const r=new yse(n);let s;try{s=await r.verify(t)}catch{s=await r.verify(t,!0)}const o=Object.assign({},e);return i?Object.assign(o,{captchaResp:s}):Object.assign(o,{captchaResponse:s}),Object.assign(o,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(o,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),o}async function LN(n,e,t,i){var r;if(!((r=n._getRecaptchaConfig())===null||r===void 0)&&r.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")){const s=await IN(n,e,t,t==="getOobCode");return i(n,s)}else return i(n,e).catch(async s=>{if(s.code==="auth/missing-recaptcha-token"){console.log(`${t} is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow.`);const o=await IN(n,e,t,t==="getOobCode");return i(n,o)}else return Promise.reject(s)})}/** + */let Fx={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function hse(n){Fx=n}function X4(n){return Fx.loadJS(n)}function dse(){return Fx.recaptchaEnterpriseScript}function fse(){return Fx.gapiScript}function pse(n){return`__${n}${Math.floor(Math.random()*1e6)}`}const mse="recaptcha-enterprise",gse="NO_RECAPTCHA";class yse{constructor(e){this.type=mse,this.auth=kd(e)}async verify(e="verify",t=!1){async function i(s){if(!t){if(s.tenantId==null&&s._agentRecaptchaConfig!=null)return s._agentRecaptchaConfig.siteKey;if(s.tenantId!=null&&s._tenantRecaptchaConfigs[s.tenantId]!==void 0)return s._tenantRecaptchaConfigs[s.tenantId].siteKey}return new Promise(async(o,a)=>{Yre(s,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(l=>{if(l.recaptchaKey===void 0)a(new Error("recaptcha Enterprise site key undefined"));else{const c=new $re(l);return s.tenantId==null?s._agentRecaptchaConfig=c:s._tenantRecaptchaConfigs[s.tenantId]=c,o(c.siteKey)}}).catch(l=>{a(l)})})}function r(s,o,a){const l=window.grecaptcha;AN(l)?l.enterprise.ready(()=>{l.enterprise.execute(s,{action:e}).then(c=>{o(c)}).catch(()=>{o(gse)})}):a(Error("No reCAPTCHA enterprise script loaded."))}return new Promise((s,o)=>{i(this.auth).then(a=>{if(!t&&AN(window.grecaptcha))r(a,s,o);else{if(typeof window>"u"){o(new Error("RecaptchaVerifier is only supported in browser"));return}let l=dse();l.length!==0&&(l+=a),X4(l).then(()=>{r(a,s,o)}).catch(c=>{o(c)})}}).catch(a=>{o(a)})})}}async function IN(n,e,t,i=!1){const r=new yse(n);let s;try{s=await r.verify(t)}catch{s=await r.verify(t,!0)}const o=Object.assign({},e);return i?Object.assign(o,{captchaResp:s}):Object.assign(o,{captchaResponse:s}),Object.assign(o,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(o,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),o}async function LN(n,e,t,i){var r;if(!((r=n._getRecaptchaConfig())===null||r===void 0)&&r.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")){const s=await IN(n,e,t,t==="getOobCode");return i(n,s)}else return i(n,e).catch(async s=>{if(s.code==="auth/missing-recaptcha-token"){console.log(`${t} is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow.`);const o=await IN(n,e,t,t==="getOobCode");return i(n,o)}else return Promise.reject(s)})}/** * @license * Copyright 2020 Google LLC * @@ -6298,7 +6298,7 @@ No matching component was found for: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function vse(n,e){const t=lM(n,"auth");if(t.isInitialized()){const r=t.getImmediate(),s=t.getOptions();if(y0(s,e??{}))return r;$s(r,"already-initialized")}return t.initialize({options:e})}function _se(n,e){const t=(e==null?void 0:e.persistence)||[],i=(Array.isArray(t)?t:[t]).map(ea);e!=null&&e.errorMap&&n._updateErrorMap(e.errorMap),n._initializeWithPersistence(i,e==null?void 0:e.popupRedirectResolver)}function xse(n,e,t){const i=kd(n);bt(i._canInitEmulator,i,"emulator-config-failed"),bt(/^https?:\/\//.test(e),i,"invalid-emulator-scheme");const r=!!(t!=null&&t.disableWarnings),s=X4(e),{host:o,port:a}=Sse(e),l=a===null?"":`:${a}`;i.config.emulator={url:`${s}//${o}${l}/`},i.settings.appVerificationDisabledForTesting=!0,i.emulatorConfig=Object.freeze({host:o,port:a,protocol:s.replace(":",""),options:Object.freeze({disableWarnings:r})}),r||wse()}function X4(n){const e=n.indexOf(":");return e<0?"":n.substr(0,e+1)}function Sse(n){const e=X4(n),t=/(\/\/)?([^?#/]+)/.exec(n.substr(e.length));if(!t)return{host:"",port:null};const i=t[2].split("@").pop()||"",r=/^(\[[^\]]+\])(:|$)/.exec(i);if(r){const s=r[1];return{host:s,port:NN(i.substr(s.length+1))}}else{const[s,o]=i.split(":");return{host:s,port:NN(o)}}}function NN(n){if(!n)return null;const e=Number(n);return isNaN(e)?null:e}function wse(){function n(){const e=document.createElement("p"),t=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",t.position="fixed",t.width="100%",t.backgroundColor="#ffffff",t.border=".1em solid #000000",t.color="#b50000",t.bottom="0px",t.left="0px",t.margin="0px",t.zIndex="10000",t.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",n):n())}/** + */function vse(n,e){const t=lM(n,"auth");if(t.isInitialized()){const r=t.getImmediate(),s=t.getOptions();if(y0(s,e??{}))return r;$s(r,"already-initialized")}return t.initialize({options:e})}function _se(n,e){const t=(e==null?void 0:e.persistence)||[],i=(Array.isArray(t)?t:[t]).map(ea);e!=null&&e.errorMap&&n._updateErrorMap(e.errorMap),n._initializeWithPersistence(i,e==null?void 0:e.popupRedirectResolver)}function xse(n,e,t){const i=kd(n);bt(i._canInitEmulator,i,"emulator-config-failed"),bt(/^https?:\/\//.test(e),i,"invalid-emulator-scheme");const r=!!(t!=null&&t.disableWarnings),s=q4(e),{host:o,port:a}=Sse(e),l=a===null?"":`:${a}`;i.config.emulator={url:`${s}//${o}${l}/`},i.settings.appVerificationDisabledForTesting=!0,i.emulatorConfig=Object.freeze({host:o,port:a,protocol:s.replace(":",""),options:Object.freeze({disableWarnings:r})}),r||wse()}function q4(n){const e=n.indexOf(":");return e<0?"":n.substr(0,e+1)}function Sse(n){const e=q4(n),t=/(\/\/)?([^?#/]+)/.exec(n.substr(e.length));if(!t)return{host:"",port:null};const i=t[2].split("@").pop()||"",r=/^(\[[^\]]+\])(:|$)/.exec(i);if(r){const s=r[1];return{host:s,port:NN(i.substr(s.length+1))}}else{const[s,o]=i.split(":");return{host:s,port:NN(o)}}}function NN(n){if(!n)return null;const e=Number(n);return isNaN(e)?null:e}function wse(){function n(){const e=document.createElement("p"),t=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",t.position="fixed",t.width="100%",t.backgroundColor="#ffffff",t.border=".1em solid #000000",t.color="#b50000",t.bottom="0px",t.left="0px",t.margin="0px",t.zIndex="10000",t.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",n):n())}/** * @license * Copyright 2020 Google LLC * @@ -6433,7 +6433,7 @@ No matching component was found for: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class q4{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}}/** + */class $4{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}}/** * @license * Copyright 2019 Google LLC * @@ -6448,7 +6448,7 @@ No matching component was found for: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class eg extends q4{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}/** + */class eg extends $4{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}/** * @license * Copyright 2020 Google LLC * @@ -6538,7 +6538,7 @@ No matching component was found for: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class p_ extends _a{constructor(e,t,i,r){var s;super(t.code,t.message),this.operationType=i,this.user=r,Object.setPrototypeOf(this,p_.prototype),this.customData={appName:e.name,tenantId:(s=e.tenantId)!==null&&s!==void 0?s:void 0,_serverResponse:t.customData._serverResponse,operationType:i}}static _fromErrorAndOperation(e,t,i,r){return new p_(e,t,i,r)}}function $4(n,e,t,i){return(e==="reauthenticate"?t._getReauthenticationResolver(n):t._getIdTokenResponse(n)).catch(s=>{throw s.code==="auth/multi-factor-auth-required"?p_._fromErrorAndOperation(n,s,e,i):s})}async function Rse(n,e,t=!1){const i=await xm(n,e._linkToIdToken(n.auth,await n.getIdToken()),t);return yd._forOperation(n,"link",i)}/** + */class p_ extends _a{constructor(e,t,i,r){var s;super(t.code,t.message),this.operationType=i,this.user=r,Object.setPrototypeOf(this,p_.prototype),this.customData={appName:e.name,tenantId:(s=e.tenantId)!==null&&s!==void 0?s:void 0,_serverResponse:t.customData._serverResponse,operationType:i}}static _fromErrorAndOperation(e,t,i,r){return new p_(e,t,i,r)}}function Y4(n,e,t,i){return(e==="reauthenticate"?t._getReauthenticationResolver(n):t._getIdTokenResponse(n)).catch(s=>{throw s.code==="auth/multi-factor-auth-required"?p_._fromErrorAndOperation(n,s,e,i):s})}async function Rse(n,e,t=!1){const i=await xm(n,e._linkToIdToken(n.auth,await n.getIdToken()),t);return yd._forOperation(n,"link",i)}/** * @license * Copyright 2019 Google LLC * @@ -6553,7 +6553,7 @@ No matching component was found for: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */async function Ise(n,e,t=!1){const{auth:i}=n;if(Ko(i.app))return Promise.reject(wl(i));const r="reauthenticate";try{const s=await xm(n,$4(i,r,e,n),t);bt(s.idToken,i,"internal-error");const o=LC(s.idToken);bt(o,i,"internal-error");const{sub:a}=o;return bt(n.uid===a,i,"user-mismatch"),yd._forOperation(n,r,s)}catch(s){throw(s==null?void 0:s.code)==="auth/user-not-found"&&$s(i,"user-mismatch"),s}}/** + */async function Ise(n,e,t=!1){const{auth:i}=n;if(Ko(i.app))return Promise.reject(wl(i));const r="reauthenticate";try{const s=await xm(n,Y4(i,r,e,n),t);bt(s.idToken,i,"internal-error");const o=LC(s.idToken);bt(o,i,"internal-error");const{sub:a}=o;return bt(n.uid===a,i,"user-mismatch"),yd._forOperation(n,r,s)}catch(s){throw(s==null?void 0:s.code)==="auth/user-not-found"&&$s(i,"user-mismatch"),s}}/** * @license * Copyright 2020 Google LLC * @@ -6568,7 +6568,7 @@ No matching component was found for: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */async function Y4(n,e,t=!1){if(Ko(n.app))return Promise.reject(wl(n));const i="signIn",r=await $4(n,i,e),s=await yd._fromIdTokenResponse(n,i,r);return t||await n._updateCurrentUser(s.user),s}async function Lse(n,e){return Y4(kd(n),e)}/** + */async function K4(n,e,t=!1){if(Ko(n.app))return Promise.reject(wl(n));const i="signIn",r=await Y4(n,i,e),s=await yd._fromIdTokenResponse(n,i,r);return t||await n._updateCurrentUser(s.user),s}async function Lse(n,e){return K4(kd(n),e)}/** * @license * Copyright 2020 Google LLC * @@ -6598,7 +6598,7 @@ No matching component was found for: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class K4{constructor(e,t){this.storageRetriever=e,this.type=t}_isAvailable(){try{return this.storage?(this.storage.setItem(m_,"1"),this.storage.removeItem(m_),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(e,t){return this.storage.setItem(e,JSON.stringify(t)),Promise.resolve()}_get(e){const t=this.storage.getItem(e);return Promise.resolve(t?JSON.parse(t):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}/** + */class Q4{constructor(e,t){this.storageRetriever=e,this.type=t}_isAvailable(){try{return this.storage?(this.storage.setItem(m_,"1"),this.storage.removeItem(m_),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(e,t){return this.storage.setItem(e,JSON.stringify(t)),Promise.resolve()}_get(e){const t=this.storage.getItem(e);return Promise.resolve(t?JSON.parse(t):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}/** * @license * Copyright 2020 Google LLC * @@ -6613,7 +6613,7 @@ No matching component was found for: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const Use=1e3,Fse=10;class Q4 extends K4{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,t)=>this.onStorageEvent(e,t),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=G4(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const t of Object.keys(this.listeners)){const i=this.storage.getItem(t),r=this.localCache[t];i!==r&&e(t,r,i)}}onStorageEvent(e,t=!1){if(!e.key){this.forAllChangedKeys((o,a,l)=>{this.notifyListeners(o,l)});return}const i=e.key;t?this.detachListener():this.stopPolling();const r=()=>{const o=this.storage.getItem(i);!t&&this.localCache[i]===o||this.notifyListeners(i,o)},s=this.storage.getItem(i);sse()&&s!==e.newValue&&e.newValue!==e.oldValue?setTimeout(r,Fse):r()}notifyListeners(e,t){this.localCache[e]=t;const i=this.listeners[e];if(i)for(const r of Array.from(i))r(t&&JSON.parse(t))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,t,i)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:t,newValue:i}),!0)})},Use)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,t){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(e,t){await super._set(e,t),this.localCache[e]=JSON.stringify(t)}async _get(e){const t=await super._get(e);return this.localCache[e]=JSON.stringify(t),t}async _remove(e){await super._remove(e),delete this.localCache[e]}}Q4.type="LOCAL";const Vse=Q4;/** + */const Use=1e3,Fse=10;class J4 extends Q4{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,t)=>this.onStorageEvent(e,t),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=W4(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const t of Object.keys(this.listeners)){const i=this.storage.getItem(t),r=this.localCache[t];i!==r&&e(t,r,i)}}onStorageEvent(e,t=!1){if(!e.key){this.forAllChangedKeys((o,a,l)=>{this.notifyListeners(o,l)});return}const i=e.key;t?this.detachListener():this.stopPolling();const r=()=>{const o=this.storage.getItem(i);!t&&this.localCache[i]===o||this.notifyListeners(i,o)},s=this.storage.getItem(i);sse()&&s!==e.newValue&&e.newValue!==e.oldValue?setTimeout(r,Fse):r()}notifyListeners(e,t){this.localCache[e]=t;const i=this.listeners[e];if(i)for(const r of Array.from(i))r(t&&JSON.parse(t))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,t,i)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:t,newValue:i}),!0)})},Use)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,t){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(e,t){await super._set(e,t),this.localCache[e]=JSON.stringify(t)}async _get(e){const t=await super._get(e);return this.localCache[e]=JSON.stringify(t),t}async _remove(e){await super._remove(e),delete this.localCache[e]}}J4.type="LOCAL";const Vse=J4;/** * @license * Copyright 2020 Google LLC * @@ -6628,7 +6628,7 @@ No matching component was found for: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class J4 extends K4{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,t){}_removeListener(e,t){}}J4.type="SESSION";const Z4=J4;/** + */class Z4 extends Q4{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,t){}_removeListener(e,t){}}Z4.type="SESSION";const eB=Z4;/** * @license * Copyright 2019 Google LLC * @@ -6718,7 +6718,7 @@ No matching component was found for: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function eB(){return typeof wo().WorkerGlobalScope<"u"&&typeof wo().importScripts=="function"}async function Gse(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function Wse(){var n;return((n=navigator==null?void 0:navigator.serviceWorker)===null||n===void 0?void 0:n.controller)||null}function jse(){return eB()?self:null}/** + */function tB(){return typeof wo().WorkerGlobalScope<"u"&&typeof wo().importScripts=="function"}async function Gse(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function Wse(){var n;return((n=navigator==null?void 0:navigator.serviceWorker)===null||n===void 0?void 0:n.controller)||null}function jse(){return tB()?self:null}/** * @license * Copyright 2019 Google LLC * @@ -6733,7 +6733,7 @@ No matching component was found for: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const tB="firebaseLocalStorageDb",Xse=1,g_="firebaseLocalStorage",nB="fbase_key";class tg{constructor(e){this.request=e}toPromise(){return new Promise((e,t)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{t(this.request.error)})})}}function Bx(n,e){return n.transaction([g_],e?"readwrite":"readonly").objectStore(g_)}function qse(){const n=indexedDB.deleteDatabase(tB);return new tg(n).toPromise()}function DT(){const n=indexedDB.open(tB,Xse);return new Promise((e,t)=>{n.addEventListener("error",()=>{t(n.error)}),n.addEventListener("upgradeneeded",()=>{const i=n.result;try{i.createObjectStore(g_,{keyPath:nB})}catch(r){t(r)}}),n.addEventListener("success",async()=>{const i=n.result;i.objectStoreNames.contains(g_)?e(i):(i.close(),await qse(),e(await DT()))})})}async function kN(n,e,t){const i=Bx(n,!0).put({[nB]:e,value:t});return new tg(i).toPromise()}async function $se(n,e){const t=Bx(n,!1).get(e),i=await new tg(t).toPromise();return i===void 0?null:i.value}function ON(n,e){const t=Bx(n,!0).delete(e);return new tg(t).toPromise()}const Yse=800,Kse=3;class iB{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db?this.db:(this.db=await DT(),this.db)}async _withRetries(e){let t=0;for(;;)try{const i=await this._openDb();return await e(i)}catch(i){if(t++>Kse)throw i;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return eB()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=Vx._getInstance(jse()),this.receiver._subscribe("keyChanged",async(e,t)=>({keyProcessed:(await this._poll()).includes(t.key)})),this.receiver._subscribe("ping",async(e,t)=>["keyChanged"])}async initializeSender(){var e,t;if(this.activeServiceWorker=await Gse(),!this.activeServiceWorker)return;this.sender=new zse(this.activeServiceWorker);const i=await this.sender._send("ping",{},800);i&&!((e=i[0])===null||e===void 0)&&e.fulfilled&&!((t=i[0])===null||t===void 0)&&t.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(!(!this.sender||!this.activeServiceWorker||Wse()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;const e=await DT();return await kN(e,m_,"1"),await ON(e,m_),!0}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,t){return this._withPendingWrite(async()=>(await this._withRetries(i=>kN(i,e,t)),this.localCache[e]=t,this.notifyServiceWorker(e)))}async _get(e){const t=await this._withRetries(i=>$se(i,e));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(t=>ON(t,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){const e=await this._withRetries(r=>{const s=Bx(r,!1).getAll();return new tg(s).toPromise()});if(!e)return[];if(this.pendingWrites!==0)return[];const t=[],i=new Set;if(e.length!==0)for(const{fbase_key:r,value:s}of e)i.add(r),JSON.stringify(this.localCache[r])!==JSON.stringify(s)&&(this.notifyListeners(r,s),t.push(r));for(const r of Object.keys(this.localCache))this.localCache[r]&&!i.has(r)&&(this.notifyListeners(r,null),t.push(r));return t}notifyListeners(e,t){this.localCache[e]=t;const i=this.listeners[e];if(i)for(const r of Array.from(i))r(t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),Yse)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,t){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&this.stopPolling()}}iB.type="LOCAL";const Qse=iB;new Zm(3e4,6e4);/** + */const nB="firebaseLocalStorageDb",Xse=1,g_="firebaseLocalStorage",iB="fbase_key";class tg{constructor(e){this.request=e}toPromise(){return new Promise((e,t)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{t(this.request.error)})})}}function Bx(n,e){return n.transaction([g_],e?"readwrite":"readonly").objectStore(g_)}function qse(){const n=indexedDB.deleteDatabase(nB);return new tg(n).toPromise()}function DT(){const n=indexedDB.open(nB,Xse);return new Promise((e,t)=>{n.addEventListener("error",()=>{t(n.error)}),n.addEventListener("upgradeneeded",()=>{const i=n.result;try{i.createObjectStore(g_,{keyPath:iB})}catch(r){t(r)}}),n.addEventListener("success",async()=>{const i=n.result;i.objectStoreNames.contains(g_)?e(i):(i.close(),await qse(),e(await DT()))})})}async function kN(n,e,t){const i=Bx(n,!0).put({[iB]:e,value:t});return new tg(i).toPromise()}async function $se(n,e){const t=Bx(n,!1).get(e),i=await new tg(t).toPromise();return i===void 0?null:i.value}function ON(n,e){const t=Bx(n,!0).delete(e);return new tg(t).toPromise()}const Yse=800,Kse=3;class rB{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db?this.db:(this.db=await DT(),this.db)}async _withRetries(e){let t=0;for(;;)try{const i=await this._openDb();return await e(i)}catch(i){if(t++>Kse)throw i;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return tB()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=Vx._getInstance(jse()),this.receiver._subscribe("keyChanged",async(e,t)=>({keyProcessed:(await this._poll()).includes(t.key)})),this.receiver._subscribe("ping",async(e,t)=>["keyChanged"])}async initializeSender(){var e,t;if(this.activeServiceWorker=await Gse(),!this.activeServiceWorker)return;this.sender=new zse(this.activeServiceWorker);const i=await this.sender._send("ping",{},800);i&&!((e=i[0])===null||e===void 0)&&e.fulfilled&&!((t=i[0])===null||t===void 0)&&t.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(!(!this.sender||!this.activeServiceWorker||Wse()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;const e=await DT();return await kN(e,m_,"1"),await ON(e,m_),!0}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,t){return this._withPendingWrite(async()=>(await this._withRetries(i=>kN(i,e,t)),this.localCache[e]=t,this.notifyServiceWorker(e)))}async _get(e){const t=await this._withRetries(i=>$se(i,e));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(t=>ON(t,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){const e=await this._withRetries(r=>{const s=Bx(r,!1).getAll();return new tg(s).toPromise()});if(!e)return[];if(this.pendingWrites!==0)return[];const t=[],i=new Set;if(e.length!==0)for(const{fbase_key:r,value:s}of e)i.add(r),JSON.stringify(this.localCache[r])!==JSON.stringify(s)&&(this.notifyListeners(r,s),t.push(r));for(const r of Object.keys(this.localCache))this.localCache[r]&&!i.has(r)&&(this.notifyListeners(r,null),t.push(r));return t}notifyListeners(e,t){this.localCache[e]=t;const i=this.listeners[e];if(i)for(const r of Array.from(i))r(t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),Yse)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,t){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&this.stopPolling()}}rB.type="LOCAL";const Qse=rB;new Zm(3e4,6e4);/** * @license * Copyright 2021 Google LLC * @@ -6763,7 +6763,7 @@ No matching component was found for: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class UC extends DC{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return Yh(e,this._buildIdpRequest())}_linkToIdToken(e,t){return Yh(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return Yh(e,this._buildIdpRequest())}_buildIdpRequest(e){const t={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(t.idToken=e),t}}function Zse(n){return Y4(n.auth,new UC(n),n.bypassAuthState)}function eoe(n){const{auth:e,user:t}=n;return bt(t,e,"internal-error"),Ise(t,new UC(n),n.bypassAuthState)}async function toe(n){const{auth:e,user:t}=n;return bt(t,e,"internal-error"),Rse(t,new UC(n),n.bypassAuthState)}/** + */class UC extends DC{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return Yh(e,this._buildIdpRequest())}_linkToIdToken(e,t){return Yh(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return Yh(e,this._buildIdpRequest())}_buildIdpRequest(e){const t={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(t.idToken=e),t}}function Zse(n){return K4(n.auth,new UC(n),n.bypassAuthState)}function eoe(n){const{auth:e,user:t}=n;return bt(t,e,"internal-error"),Ise(t,new UC(n),n.bypassAuthState)}async function toe(n){const{auth:e,user:t}=n;return bt(t,e,"internal-error"),Rse(t,new UC(n),n.bypassAuthState)}/** * @license * Copyright 2020 Google LLC * @@ -6778,7 +6778,7 @@ No matching component was found for: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class rB{constructor(e,t,i,r,s=!1){this.auth=e,this.resolver=i,this.user=r,this.bypassAuthState=s,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(t)?t:[t]}execute(){return new Promise(async(e,t)=>{this.pendingPromise={resolve:e,reject:t};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(i){this.reject(i)}})}async onAuthEvent(e){const{urlResponse:t,sessionId:i,postBody:r,tenantId:s,error:o,type:a}=e;if(o){this.reject(o);return}const l={auth:this.auth,requestUri:t,sessionId:i,tenantId:s||void 0,postBody:r||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(a)(l))}catch(c){this.reject(c)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return Zse;case"linkViaPopup":case"linkViaRedirect":return toe;case"reauthViaPopup":case"reauthViaRedirect":return eoe;default:$s(this.auth,"internal-error")}}resolve(e){ga(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){ga(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}/** + */class sB{constructor(e,t,i,r,s=!1){this.auth=e,this.resolver=i,this.user=r,this.bypassAuthState=s,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(t)?t:[t]}execute(){return new Promise(async(e,t)=>{this.pendingPromise={resolve:e,reject:t};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(i){this.reject(i)}})}async onAuthEvent(e){const{urlResponse:t,sessionId:i,postBody:r,tenantId:s,error:o,type:a}=e;if(o){this.reject(o);return}const l={auth:this.auth,requestUri:t,sessionId:i,tenantId:s||void 0,postBody:r||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(a)(l))}catch(c){this.reject(c)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return Zse;case"linkViaPopup":case"linkViaRedirect":return toe;case"reauthViaPopup":case"reauthViaRedirect":return eoe;default:$s(this.auth,"internal-error")}}resolve(e){ga(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){ga(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}/** * @license * Copyright 2020 Google LLC * @@ -6793,7 +6793,7 @@ No matching component was found for: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const noe=new Zm(2e3,1e4);class Oh extends rB{constructor(e,t,i,r,s){super(e,t,r,s),this.provider=i,this.authWindow=null,this.pollId=null,Oh.currentPopupAction&&Oh.currentPopupAction.cancel(),Oh.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return bt(e,this.auth,"internal-error"),e}async onExecution(){ga(this.filter.length===1,"Popup operations only handle one event");const e=OC();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(t=>{this.reject(t)}),this.resolver._isIframeWebStorageSupported(this.auth,t=>{t||this.reject(So(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var e;return((e=this.authWindow)===null||e===void 0?void 0:e.associatedEvent)||null}cancel(){this.reject(So(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,Oh.currentPopupAction=null}pollUserCancellation(){const e=()=>{var t,i;if(!((i=(t=this.authWindow)===null||t===void 0?void 0:t.window)===null||i===void 0)&&i.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(So(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(e,noe.get())};e()}}Oh.currentPopupAction=null;/** + */const noe=new Zm(2e3,1e4);class Oh extends sB{constructor(e,t,i,r,s){super(e,t,r,s),this.provider=i,this.authWindow=null,this.pollId=null,Oh.currentPopupAction&&Oh.currentPopupAction.cancel(),Oh.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return bt(e,this.auth,"internal-error"),e}async onExecution(){ga(this.filter.length===1,"Popup operations only handle one event");const e=OC();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(t=>{this.reject(t)}),this.resolver._isIframeWebStorageSupported(this.auth,t=>{t||this.reject(So(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var e;return((e=this.authWindow)===null||e===void 0?void 0:e.associatedEvent)||null}cancel(){this.reject(So(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,Oh.currentPopupAction=null}pollUserCancellation(){const e=()=>{var t,i;if(!((i=(t=this.authWindow)===null||t===void 0?void 0:t.window)===null||i===void 0)&&i.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(So(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(e,noe.get())};e()}}Oh.currentPopupAction=null;/** * @license * Copyright 2020 Google LLC * @@ -6808,7 +6808,7 @@ No matching component was found for: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const ioe="pendingRedirect",Nv=new Map;class roe extends rB{constructor(e,t,i=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,i),this.eventId=null}async execute(){let e=Nv.get(this.auth._key());if(!e){try{const i=await soe(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(i)}catch(t){e=()=>Promise.reject(t)}Nv.set(this.auth._key(),e)}return this.bypassAuthState||Nv.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if(e.type==="signInViaRedirect")return super.onAuthEvent(e);if(e.type==="unknown"){this.resolve(null);return}if(e.eventId){const t=await this.auth._redirectUserForId(e.eventId);if(t)return this.user=t,super.onAuthEvent(e);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function soe(n,e){const t=loe(e),i=aoe(n);if(!await i._isAvailable())return!1;const r=await i._get(t)==="true";return await i._remove(t),r}function ooe(n,e){Nv.set(n._key(),e)}function aoe(n){return ea(n._redirectPersistence)}function loe(n){return Lv(ioe,n.config.apiKey,n.name)}async function coe(n,e,t=!1){if(Ko(n.app))return Promise.reject(wl(n));const i=kd(n),r=Jse(i,e),o=await new roe(i,r,t).execute();return o&&!t&&(delete o.user._redirectEventId,await i._persistUserIfCurrent(o.user),await i._setRedirectUser(null,e)),o}/** + */const ioe="pendingRedirect",Nv=new Map;class roe extends sB{constructor(e,t,i=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,i),this.eventId=null}async execute(){let e=Nv.get(this.auth._key());if(!e){try{const i=await soe(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(i)}catch(t){e=()=>Promise.reject(t)}Nv.set(this.auth._key(),e)}return this.bypassAuthState||Nv.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if(e.type==="signInViaRedirect")return super.onAuthEvent(e);if(e.type==="unknown"){this.resolve(null);return}if(e.eventId){const t=await this.auth._redirectUserForId(e.eventId);if(t)return this.user=t,super.onAuthEvent(e);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function soe(n,e){const t=loe(e),i=aoe(n);if(!await i._isAvailable())return!1;const r=await i._get(t)==="true";return await i._remove(t),r}function ooe(n,e){Nv.set(n._key(),e)}function aoe(n){return ea(n._redirectPersistence)}function loe(n){return Lv(ioe,n.config.apiKey,n.name)}async function coe(n,e,t=!1){if(Ko(n.app))return Promise.reject(wl(n));const i=kd(n),r=Jse(i,e),o=await new roe(i,r,t).execute();return o&&!t&&(delete o.user._redirectEventId,await i._persistUserIfCurrent(o.user),await i._setRedirectUser(null,e)),o}/** * @license * Copyright 2020 Google LLC * @@ -6823,7 +6823,7 @@ No matching component was found for: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const uoe=10*60*1e3;class hoe{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let t=!1;return this.consumers.forEach(i=>{this.isEventForConsumer(e,i)&&(t=!0,this.sendToConsumer(e,i),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!doe(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){var i;if(e.error&&!sB(e)){const r=((i=e.error.code)===null||i===void 0?void 0:i.split("auth/")[1])||"internal-error";t.onError(So(this.auth,r))}else t.onAuthEvent(e)}isEventForConsumer(e,t){const i=t.eventId===null||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&i}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=uoe&&this.cachedEventUids.clear(),this.cachedEventUids.has(UN(e))}saveEventToCache(e){this.cachedEventUids.add(UN(e)),this.lastProcessedEventTime=Date.now()}}function UN(n){return[n.type,n.eventId,n.sessionId,n.tenantId].filter(e=>e).join("-")}function sB({type:n,error:e}){return n==="unknown"&&(e==null?void 0:e.code)==="auth/no-auth-event"}function doe(n){switch(n.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return sB(n);default:return!1}}/** + */const uoe=10*60*1e3;class hoe{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let t=!1;return this.consumers.forEach(i=>{this.isEventForConsumer(e,i)&&(t=!0,this.sendToConsumer(e,i),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!doe(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){var i;if(e.error&&!oB(e)){const r=((i=e.error.code)===null||i===void 0?void 0:i.split("auth/")[1])||"internal-error";t.onError(So(this.auth,r))}else t.onAuthEvent(e)}isEventForConsumer(e,t){const i=t.eventId===null||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&i}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=uoe&&this.cachedEventUids.clear(),this.cachedEventUids.has(UN(e))}saveEventToCache(e){this.cachedEventUids.add(UN(e)),this.lastProcessedEventTime=Date.now()}}function UN(n){return[n.type,n.eventId,n.sessionId,n.tenantId].filter(e=>e).join("-")}function oB({type:n,error:e}){return n==="unknown"&&(e==null?void 0:e.code)==="auth/no-auth-event"}function doe(n){switch(n.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return oB(n);default:return!1}}/** * @license * Copyright 2020 Google LLC * @@ -6868,7 +6868,7 @@ No matching component was found for: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const voe=new Zm(3e4,6e4);function FN(){const n=wo().___jsl;if(n!=null&&n.H){for(const e of Object.keys(n.H))if(n.H[e].r=n.H[e].r||[],n.H[e].L=n.H[e].L||[],n.H[e].r=[...n.H[e].L],n.CP)for(let t=0;t{var i,r,s;function o(){FN(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{FN(),t(So(n,"network-request-failed"))},timeout:voe.get()})}if(!((r=(i=wo().gapi)===null||i===void 0?void 0:i.iframes)===null||r===void 0)&&r.Iframe)e(gapi.iframes.getContext());else if(!((s=wo().gapi)===null||s===void 0)&&s.load)o();else{const a=pse("iframefcb");return wo()[a]=()=>{gapi.load?o():t(So(n,"network-request-failed"))},j4(`${fse()}?onload=${a}`).catch(l=>t(l))}}).catch(e=>{throw Dv=null,e})}let Dv=null;function xoe(n){return Dv=Dv||_oe(n),Dv}/** + */const voe=new Zm(3e4,6e4);function FN(){const n=wo().___jsl;if(n!=null&&n.H){for(const e of Object.keys(n.H))if(n.H[e].r=n.H[e].r||[],n.H[e].L=n.H[e].L||[],n.H[e].r=[...n.H[e].L],n.CP)for(let t=0;t{var i,r,s;function o(){FN(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{FN(),t(So(n,"network-request-failed"))},timeout:voe.get()})}if(!((r=(i=wo().gapi)===null||i===void 0?void 0:i.iframes)===null||r===void 0)&&r.Iframe)e(gapi.iframes.getContext());else if(!((s=wo().gapi)===null||s===void 0)&&s.load)o();else{const a=pse("iframefcb");return wo()[a]=()=>{gapi.load?o():t(So(n,"network-request-failed"))},X4(`${fse()}?onload=${a}`).catch(l=>t(l))}}).catch(e=>{throw Dv=null,e})}let Dv=null;function xoe(n){return Dv=Dv||_oe(n),Dv}/** * @license * Copyright 2020 Google LLC. * @@ -6898,7 +6898,7 @@ No matching component was found for: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const boe={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},Poe=500,Roe=600,Ioe="_blank",Loe="http://localhost";class VN{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function Noe(n,e,t,i=Poe,r=Roe){const s=Math.max((window.screen.availHeight-r)/2,0).toString(),o=Math.max((window.screen.availWidth-i)/2,0).toString();let a="";const l=Object.assign(Object.assign({},boe),{width:i.toString(),height:r.toString(),top:s,left:o}),c=or().toLowerCase();t&&(a=F4(c)?Ioe:t),O4(c)&&(e=e||Loe,l.scrollbars="yes");const d=Object.entries(l).reduce((p,[m,_])=>`${p}${m}=${_},`,"");if(rse(c)&&a!=="_self")return Doe(e||"",a),new VN(null);const f=window.open(e||"",a,d);bt(f,n,"popup-blocked");try{f.focus()}catch{}return new VN(f)}function Doe(n,e){const t=document.createElement("a");t.href=n,t.target=e;const i=document.createEvent("MouseEvent");i.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),t.dispatchEvent(i)}/** + */const boe={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},Poe=500,Roe=600,Ioe="_blank",Loe="http://localhost";class VN{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function Noe(n,e,t,i=Poe,r=Roe){const s=Math.max((window.screen.availHeight-r)/2,0).toString(),o=Math.max((window.screen.availWidth-i)/2,0).toString();let a="";const l=Object.assign(Object.assign({},boe),{width:i.toString(),height:r.toString(),top:s,left:o}),c=or().toLowerCase();t&&(a=V4(c)?Ioe:t),U4(c)&&(e=e||Loe,l.scrollbars="yes");const d=Object.entries(l).reduce((p,[m,_])=>`${p}${m}=${_},`,"");if(rse(c)&&a!=="_self")return Doe(e||"",a),new VN(null);const f=window.open(e||"",a,d);bt(f,n,"popup-blocked");try{f.focus()}catch{}return new VN(f)}function Doe(n,e){const t=document.createElement("a");t.href=n,t.target=e;const i=document.createEvent("MouseEvent");i.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),t.dispatchEvent(i)}/** * @license * Copyright 2021 Google LLC * @@ -6913,7 +6913,7 @@ No matching component was found for: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const koe="__/auth/handler",Ooe="emulator/auth/handler",Uoe=encodeURIComponent("fac");async function BN(n,e,t,i,r,s){bt(n.config.authDomain,n,"auth-domain-config-required"),bt(n.config.apiKey,n,"invalid-api-key");const o={apiKey:n.config.apiKey,appName:n.name,authType:t,redirectUrl:i,v:Ad,eventId:r};if(e instanceof q4){e.setDefaultLanguage(n.languageCode),o.providerId=e.providerId||"",kj(e.getCustomParameters())||(o.customParameters=JSON.stringify(e.getCustomParameters()));for(const[d,f]of Object.entries(s||{}))o[d]=f}if(e instanceof eg){const d=e.getScopes().filter(f=>f!=="");d.length>0&&(o.scopes=d.join(","))}n.tenantId&&(o.tid=n.tenantId);const a=o;for(const d of Object.keys(a))a[d]===void 0&&delete a[d];const l=await n._getAppCheckToken(),c=l?`#${Uoe}=${encodeURIComponent(l)}`:"";return`${Foe(n)}?${Dm(a).slice(1)}${c}`}function Foe({config:n}){return n.emulator?IC(n,Ooe):`https://${n.authDomain}/${koe}`}/** + */const koe="__/auth/handler",Ooe="emulator/auth/handler",Uoe=encodeURIComponent("fac");async function BN(n,e,t,i,r,s){bt(n.config.authDomain,n,"auth-domain-config-required"),bt(n.config.apiKey,n,"invalid-api-key");const o={apiKey:n.config.apiKey,appName:n.name,authType:t,redirectUrl:i,v:Ad,eventId:r};if(e instanceof $4){e.setDefaultLanguage(n.languageCode),o.providerId=e.providerId||"",kj(e.getCustomParameters())||(o.customParameters=JSON.stringify(e.getCustomParameters()));for(const[d,f]of Object.entries(s||{}))o[d]=f}if(e instanceof eg){const d=e.getScopes().filter(f=>f!=="");d.length>0&&(o.scopes=d.join(","))}n.tenantId&&(o.tid=n.tenantId);const a=o;for(const d of Object.keys(a))a[d]===void 0&&delete a[d];const l=await n._getAppCheckToken(),c=l?`#${Uoe}=${encodeURIComponent(l)}`:"";return`${Foe(n)}?${Dm(a).slice(1)}${c}`}function Foe({config:n}){return n.emulator?IC(n,Ooe):`https://${n.authDomain}/${koe}`}/** * @license * Copyright 2020 Google LLC * @@ -6928,7 +6928,7 @@ No matching component was found for: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const R1="webStorageSupport";class Voe{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=Z4,this._completeRedirectFn=coe,this._overrideRedirectResult=ooe}async _openPopup(e,t,i,r){var s;ga((s=this.eventManagers[e._key()])===null||s===void 0?void 0:s.manager,"_initialize() not called before _openPopup()");const o=await BN(e,t,i,LT(),r);return Noe(e,o,OC())}async _openRedirect(e,t,i,r){await this._originValidation(e);const s=await BN(e,t,i,LT(),r);return Hse(s),new Promise(()=>{})}_initialize(e){const t=e._key();if(this.eventManagers[t]){const{manager:r,promise:s}=this.eventManagers[t];return r?Promise.resolve(r):(ga(s,"If manager is not set, promise should be"),s)}const i=this.initAndGetManager(e);return this.eventManagers[t]={promise:i},i.catch(()=>{delete this.eventManagers[t]}),i}async initAndGetManager(e){const t=await Coe(e),i=new hoe(e);return t.register("authEvent",r=>(bt(r==null?void 0:r.authEvent,e,"invalid-auth-event"),{status:i.onEvent(r.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:i},this.iframes[e._key()]=t,i}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send(R1,{type:R1},r=>{var s;const o=(s=r==null?void 0:r[0])===null||s===void 0?void 0:s[R1];o!==void 0&&t(!!o),$s(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=goe(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return G4()||U4()||NC()}}const Boe=Voe;var zN="@firebase/auth",HN="1.7.9";/** + */const R1="webStorageSupport";class Voe{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=eB,this._completeRedirectFn=coe,this._overrideRedirectResult=ooe}async _openPopup(e,t,i,r){var s;ga((s=this.eventManagers[e._key()])===null||s===void 0?void 0:s.manager,"_initialize() not called before _openPopup()");const o=await BN(e,t,i,LT(),r);return Noe(e,o,OC())}async _openRedirect(e,t,i,r){await this._originValidation(e);const s=await BN(e,t,i,LT(),r);return Hse(s),new Promise(()=>{})}_initialize(e){const t=e._key();if(this.eventManagers[t]){const{manager:r,promise:s}=this.eventManagers[t];return r?Promise.resolve(r):(ga(s,"If manager is not set, promise should be"),s)}const i=this.initAndGetManager(e);return this.eventManagers[t]={promise:i},i.catch(()=>{delete this.eventManagers[t]}),i}async initAndGetManager(e){const t=await Coe(e),i=new hoe(e);return t.register("authEvent",r=>(bt(r==null?void 0:r.authEvent,e,"invalid-auth-event"),{status:i.onEvent(r.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:i},this.iframes[e._key()]=t,i}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send(R1,{type:R1},r=>{var s;const o=(s=r==null?void 0:r[0])===null||s===void 0?void 0:s[R1];o!==void 0&&t(!!o),$s(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=goe(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return W4()||F4()||NC()}}const Boe=Voe;var zN="@firebase/auth",HN="1.7.9";/** * @license * Copyright 2020 Google LLC * @@ -6958,7 +6958,7 @@ No matching component was found for: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */function Hoe(n){switch(n){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}function Goe(n){sd(new iu("auth",(e,{options:t})=>{const i=e.getProvider("app").getImmediate(),r=e.getProvider("heartbeat"),s=e.getProvider("app-check-internal"),{apiKey:o,authDomain:a}=i.options;bt(o&&!o.includes(":"),"invalid-api-key",{appName:i.name});const l={apiKey:o,authDomain:a,clientPlatform:n,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:W4(n)},c=new use(i,r,s,l);return _se(c,t),c},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,i)=>{e.getProvider("auth-internal").initialize()})),sd(new iu("auth-internal",e=>{const t=kd(e.getProvider("auth").getImmediate());return(i=>new zoe(i))(t)},"PRIVATE").setInstantiationMode("EXPLICIT")),Sl(zN,HN,Hoe(n)),Sl(zN,HN,"esm2017")}/** + */function Hoe(n){switch(n){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}function Goe(n){sd(new iu("auth",(e,{options:t})=>{const i=e.getProvider("app").getImmediate(),r=e.getProvider("heartbeat"),s=e.getProvider("app-check-internal"),{apiKey:o,authDomain:a}=i.options;bt(o&&!o.includes(":"),"invalid-api-key",{appName:i.name});const l={apiKey:o,authDomain:a,clientPlatform:n,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:j4(n)},c=new use(i,r,s,l);return _se(c,t),c},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,i)=>{e.getProvider("auth-internal").initialize()})),sd(new iu("auth-internal",e=>{const t=kd(e.getProvider("auth").getImmediate());return(i=>new zoe(i))(t)},"PRIVATE").setInstantiationMode("EXPLICIT")),Sl(zN,HN,Hoe(n)),Sl(zN,HN,"esm2017")}/** * @license * Copyright 2021 Google LLC * @@ -6973,4 +6973,4 @@ No matching component was found for: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const Woe=5*60,joe=KO("authIdTokenMaxAge")||Woe;let GN=null;const Xoe=n=>async e=>{const t=e&&await e.getIdTokenResult(),i=t&&(new Date().getTime()-Date.parse(t.issuedAtTime))/1e3;if(i&&i>joe)return;const r=t==null?void 0:t.token;GN!==r&&(GN=r,await fetch(n,{method:r?"POST":"DELETE",headers:r?{Authorization:`Bearer ${r}`}:{}}))};function qoe(n=eU()){const e=lM(n,"auth");if(e.isInitialized())return e.getImmediate();const t=vse(n,{popupRedirectResolver:Boe,persistence:[Qse,Vse,Z4]}),i=KO("authTokenSyncURL");if(i&&typeof isSecureContext=="boolean"&&isSecureContext){const s=new URL(i,location.origin);if(location.origin===s.origin){const o=Xoe(s.toString());Ose(t,o,()=>o(t.currentUser)),kse(t,a=>o(a))}}const r=$O("auth");return r&&xse(t,`http://${r}`),t}function $oe(){var n,e;return(e=(n=document.getElementsByTagName("head"))===null||n===void 0?void 0:n[0])!==null&&e!==void 0?e:document}hse({loadJS(n){return new Promise((e,t)=>{const i=document.createElement("script");i.setAttribute("src",n),i.onload=e,i.onerror=r=>{const s=So("internal-error");s.customData=r,t(s)},i.type="text/javascript",i.charset="UTF-8",$oe().appendChild(i)})},gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="});Goe("Browser");const Yoe=()=>{const[n,e]=q.useState(""),[t,i]=q.useState(""),[r,s]=q.useState(""),o=DA(),a=qoe(),l=c=>{c.preventDefault(),Dse(a,n,t).then(d=>{const f=d.user;console.log("User signed in:",f),o("/admin/dashboard")}).catch(d=>{const f=d.code,p=d.message;s(p),console.error("Error signing in:",f,p)})};return B.jsx("div",{className:"flex items-center justify-center min-h-screen bg-gray-100",children:B.jsxs("div",{className:"bg-white p-8 rounded-lg shadow-md w-96",children:[B.jsx("h2",{className:"text-2xl font-bold text-center mb-6",children:"Login"}),r&&B.jsx("p",{className:"text-red-500 text-sm text-center mb-4",children:r}),B.jsxs("form",{onSubmit:l,children:[B.jsxs("div",{className:"mb-4",children:[B.jsx("label",{className:"block text-sm font-medium text-gray-700",htmlFor:"email",children:"Email"}),B.jsx("input",{type:"email",id:"email",className:"mt-1 block w-full p-2 border border-gray-300 rounded-md focus:outline-none focus:ring focus:ring-blue-500",placeholder:"you@example.com",value:n,onChange:c=>e(c.target.value),required:!0})]}),B.jsxs("div",{className:"mb-6",children:[B.jsx("label",{className:"block text-sm font-medium text-gray-700",htmlFor:"password",children:"Password"}),B.jsx("input",{type:"password",id:"password",className:"mt-1 block w-full p-2 border border-gray-300 rounded-md focus:outline-none focus:ring focus:ring-blue-500",placeholder:"********",value:t,onChange:c=>i(c.target.value),required:!0})]}),B.jsx("button",{type:"submit",className:"w-full bg-blue-500 text-white font-semibold py-2 rounded-md hover:bg-blue-600 transition duration-200",children:"Login"})]}),B.jsxs("p",{className:"mt-4 text-center text-sm text-gray-600",children:["Forgot password? ",B.jsx("a",{href:"#",className:"text-blue-500 hover:underline",children:"Fuck you!"})]})]})})},Koe=()=>B.jsxs("div",{className:"flex min-h-screen bg-gray-100",children:[B.jsxs("aside",{className:"w-64 bg-white shadow-md",children:[B.jsx("div",{className:"p-4",children:B.jsx("h2",{className:"text-2xl font-bold text-center",children:"Admin Dashboard"})}),B.jsx("nav",{className:"mt-4",children:B.jsxs("ul",{children:[B.jsx("li",{children:B.jsx(ac,{to:"/",className:"block p-4 hover:bg-gray-200",children:"Home"})}),B.jsx("li",{children:B.jsx(ac,{to:"add-blog",className:"block p-4 hover:bg-gray-200",children:"Add Blog"})}),B.jsx("li",{children:B.jsx(ac,{to:"add-project",className:"block p-4 hover:bg-gray-200",children:"Add Project"})}),B.jsx("li",{children:B.jsx(ac,{to:"add-experience",className:"block p-4 hover:bg-gray-200",children:"Add Experience"})}),B.jsx("li",{children:B.jsx(ac,{to:"edit-blog",className:"block p-4 hover:bg-gray-200",children:"Edit Blog"})}),B.jsx("li",{children:B.jsx(ac,{to:"edit-project",className:"block p-4 hover:bg-gray-200",children:"Edit Project"})}),B.jsx("li",{children:B.jsx(ac,{to:"edit-experience",className:"block p-4 hover:bg-gray-200",children:"Edit Experience"})})]})})]}),B.jsxs("main",{className:"flex-1 p-6",children:[B.jsx(dk,{})," "]})]}),Qoe=()=>B.jsxs("div",{children:[B.jsx("h2",{className:"text-xl font-bold mb-4",children:"Add Blog"}),B.jsxs("form",{children:[B.jsxs("div",{className:"mb-4",children:[B.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Title"}),B.jsx("input",{type:"text",className:"mt-1 block w-full p-2 border border-gray-300 rounded-md",required:!0})]}),B.jsxs("div",{className:"mb-4",children:[B.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Content"}),B.jsx("textarea",{className:"mt-1 block w-full p-2 border border-gray-300 rounded-md",required:!0})]}),B.jsx("button",{type:"submit",className:"bg-blue-500 text-white py-2 px-4 rounded-md",children:"Add Blog"})]})]}),Joe=()=>B.jsxs("div",{children:[B.jsx("h2",{className:"text-xl font-bold mb-4",children:"Add Project"}),B.jsxs("form",{children:[B.jsxs("div",{className:"mb-4",children:[B.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Project Name"}),B.jsx("input",{type:"text",className:"mt-1 block w-full p-2 border border-gray-300 rounded-md",required:!0})]}),B.jsxs("div",{className:"mb-4",children:[B.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Description"}),B.jsx("textarea",{className:"mt-1 block w-full p-2 border border-gray-300 rounded-md",required:!0})]}),B.jsx("button",{type:"submit",className:"bg-blue-500 text-white py-2 px-4 rounded-md",children:"Add Project"})]})]}),Zoe=()=>B.jsxs("div",{children:[B.jsx("h2",{className:"text-xl font-bold mb-4",children:"Add Experience"}),B.jsxs("form",{children:[B.jsxs("div",{className:"mb-4",children:[B.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Experience Name"}),B.jsx("input",{type:"text",className:"mt-1 block w-full p-2 border border-gray-300 rounded-md",required:!0})]}),B.jsxs("div",{className:"mb-4",children:[B.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Description"}),B.jsx("textarea",{className:"mt-1 block w-full p-2 border border-gray-300 rounded-md",required:!0})]}),B.jsx("button",{type:"submit",className:"bg-blue-500 text-white py-2 px-4 rounded-md",children:"Add Experience"})]})]}),eae=()=>B.jsxs("div",{children:[B.jsx("h2",{className:"text-xl font-bold mb-4",children:"Edit Blog"}),B.jsxs("form",{children:[B.jsxs("div",{className:"mb-4",children:[B.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Blog ID"}),B.jsx("input",{type:"text",className:"mt-1 block w-full p-2 border border-gray-300 rounded-md",required:!0})]}),B.jsxs("div",{className:"mb-4",children:[B.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"New Content"}),B.jsx("textarea",{className:"mt-1 block w-full p-2 border border-gray-300 rounded-md",required:!0})]}),B.jsx("button",{type:"submit",className:"bg-blue-500 text-white py-2 px-4 rounded-md",children:"Edit Blog"})]})]}),tae=()=>B.jsxs("div",{children:[B.jsx("h2",{className:"text-xl font-bold mb-4",children:"Edit Project"}),B.jsxs("form",{children:[B.jsxs("div",{className:"mb-4",children:[B.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Project ID"}),B.jsx("input",{type:"text",className:"mt-1 block w-full p-2 border border-gray-300 rounded-md",required:!0})]}),B.jsxs("div",{className:"mb-4",children:[B.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"New Description"}),B.jsx("textarea",{className:"mt-1 block w-full p-2 border border-gray-300 rounded-md",required:!0})]}),B.jsx("button",{type:"submit",className:"bg-blue-500 text-white py-2 px-4 rounded-md",children:"Edit Project"})]})]}),nae=()=>B.jsxs("div",{children:[B.jsx("h2",{className:"text-xl font-bold mb-4",children:"Edit Experience"}),B.jsxs("form",{children:[B.jsxs("div",{className:"mb-4",children:[B.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Project ID"}),B.jsx("input",{type:"text",className:"mt-1 block w-full p-2 border border-gray-300 rounded-md",required:!0})]}),B.jsxs("div",{className:"mb-4",children:[B.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"New Description"}),B.jsx("textarea",{className:"mt-1 block w-full p-2 border border-gray-300 rounded-md",required:!0})]}),B.jsx("button",{type:"submit",className:"bg-blue-500 text-white py-2 px-4 rounded-md",children:"Edit Project"})]})]}),iae=I1.createRoot(document.getElementById("root"));iae.render(B.jsx(cH,{children:B.jsx(nH,{children:B.jsxs(ys,{path:"/",element:B.jsx(VW,{}),children:[B.jsx(ys,{index:!0,element:B.jsx(Fre,{})}),B.jsx(ys,{path:"/login",element:B.jsx(Yoe,{})}),B.jsxs(ys,{path:"/admin/dashboard",element:B.jsx(Koe,{}),children:[B.jsx(ys,{path:"add-blog",element:B.jsx(Qoe,{})}),B.jsx(ys,{path:"add-project",element:B.jsx(Joe,{})}),B.jsx(ys,{path:"add-experience",element:B.jsx(Zoe,{})}),B.jsx(ys,{path:"edit-blog",element:B.jsx(eae,{})}),B.jsx(ys,{path:"edit-project",element:B.jsx(tae,{})}),B.jsx(ys,{path:"edit-experience",element:B.jsx(nae,{})})]}),B.jsx(ys,{path:"*",element:B.jsx(eH,{to:"/"})})]})})})); + */const Woe=5*60,joe=QO("authIdTokenMaxAge")||Woe;let GN=null;const Xoe=n=>async e=>{const t=e&&await e.getIdTokenResult(),i=t&&(new Date().getTime()-Date.parse(t.issuedAtTime))/1e3;if(i&&i>joe)return;const r=t==null?void 0:t.token;GN!==r&&(GN=r,await fetch(n,{method:r?"POST":"DELETE",headers:r?{Authorization:`Bearer ${r}`}:{}}))};function qoe(n=tU()){const e=lM(n,"auth");if(e.isInitialized())return e.getImmediate();const t=vse(n,{popupRedirectResolver:Boe,persistence:[Qse,Vse,eB]}),i=QO("authTokenSyncURL");if(i&&typeof isSecureContext=="boolean"&&isSecureContext){const s=new URL(i,location.origin);if(location.origin===s.origin){const o=Xoe(s.toString());Ose(t,o,()=>o(t.currentUser)),kse(t,a=>o(a))}}const r=YO("auth");return r&&xse(t,`http://${r}`),t}function $oe(){var n,e;return(e=(n=document.getElementsByTagName("head"))===null||n===void 0?void 0:n[0])!==null&&e!==void 0?e:document}hse({loadJS(n){return new Promise((e,t)=>{const i=document.createElement("script");i.setAttribute("src",n),i.onload=e,i.onerror=r=>{const s=So("internal-error");s.customData=r,t(s)},i.type="text/javascript",i.charset="UTF-8",$oe().appendChild(i)})},gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="});Goe("Browser");const Yoe=()=>{const[n,e]=q.useState(""),[t,i]=q.useState(""),[r,s]=q.useState(""),o=DA(),a=qoe(),l=c=>{c.preventDefault(),Dse(a,n,t).then(d=>{const f=d.user;console.log("User signed in:",f),o("/admin/dashboard")}).catch(d=>{const f=d.code,p=d.message;s(p),console.error("Error signing in:",f,p)})};return B.jsx("div",{className:"flex items-center justify-center min-h-screen bg-gray-100",children:B.jsxs("div",{className:"bg-white p-8 rounded-lg shadow-md w-96",children:[B.jsx("h2",{className:"text-2xl font-bold text-center mb-6",children:"Login"}),r&&B.jsx("p",{className:"text-red-500 text-sm text-center mb-4",children:r}),B.jsxs("form",{onSubmit:l,children:[B.jsxs("div",{className:"mb-4",children:[B.jsx("label",{className:"block text-sm font-medium text-gray-700",htmlFor:"email",children:"Email"}),B.jsx("input",{type:"email",id:"email",className:"mt-1 block w-full p-2 border border-gray-300 rounded-md focus:outline-none focus:ring focus:ring-blue-500",placeholder:"you@example.com",value:n,onChange:c=>e(c.target.value),required:!0})]}),B.jsxs("div",{className:"mb-6",children:[B.jsx("label",{className:"block text-sm font-medium text-gray-700",htmlFor:"password",children:"Password"}),B.jsx("input",{type:"password",id:"password",className:"mt-1 block w-full p-2 border border-gray-300 rounded-md focus:outline-none focus:ring focus:ring-blue-500",placeholder:"********",value:t,onChange:c=>i(c.target.value),required:!0})]}),B.jsx("button",{type:"submit",className:"w-full bg-blue-500 text-white font-semibold py-2 rounded-md hover:bg-blue-600 transition duration-200",children:"Login"})]}),B.jsxs("p",{className:"mt-4 text-center text-sm text-gray-600",children:["Forgot password? ",B.jsx("a",{href:"#",className:"text-blue-500 hover:underline",children:"Fuck you!"})]})]})})},Koe=()=>B.jsxs("div",{className:"flex min-h-screen bg-gray-100",children:[B.jsxs("aside",{className:"w-64 bg-white shadow-md",children:[B.jsx("div",{className:"p-4",children:B.jsx("h2",{className:"text-2xl font-bold text-center",children:"Admin Dashboard"})}),B.jsx("nav",{className:"mt-4",children:B.jsxs("ul",{children:[B.jsx("li",{children:B.jsx(ac,{to:"/",className:"block p-4 hover:bg-gray-200",children:"Home"})}),B.jsx("li",{children:B.jsx(ac,{to:"add-blog",className:"block p-4 hover:bg-gray-200",children:"Add Blog"})}),B.jsx("li",{children:B.jsx(ac,{to:"add-project",className:"block p-4 hover:bg-gray-200",children:"Add Project"})}),B.jsx("li",{children:B.jsx(ac,{to:"add-experience",className:"block p-4 hover:bg-gray-200",children:"Add Experience"})}),B.jsx("li",{children:B.jsx(ac,{to:"edit-blog",className:"block p-4 hover:bg-gray-200",children:"Edit Blog"})}),B.jsx("li",{children:B.jsx(ac,{to:"edit-project",className:"block p-4 hover:bg-gray-200",children:"Edit Project"})}),B.jsx("li",{children:B.jsx(ac,{to:"edit-experience",className:"block p-4 hover:bg-gray-200",children:"Edit Experience"})})]})})]}),B.jsxs("main",{className:"flex-1 p-6",children:[B.jsx(dk,{})," "]})]}),Qoe=()=>B.jsxs("div",{children:[B.jsx("h2",{className:"text-xl font-bold mb-4",children:"Add Blog"}),B.jsxs("form",{children:[B.jsxs("div",{className:"mb-4",children:[B.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Title"}),B.jsx("input",{type:"text",className:"mt-1 block w-full p-2 border border-gray-300 rounded-md",required:!0})]}),B.jsxs("div",{className:"mb-4",children:[B.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Content"}),B.jsx("textarea",{className:"mt-1 block w-full p-2 border border-gray-300 rounded-md",required:!0})]}),B.jsx("button",{type:"submit",className:"bg-blue-500 text-white py-2 px-4 rounded-md",children:"Add Blog"})]})]}),Joe=()=>B.jsxs("div",{children:[B.jsx("h2",{className:"text-xl font-bold mb-4",children:"Add Project"}),B.jsxs("form",{children:[B.jsxs("div",{className:"mb-4",children:[B.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Project Name"}),B.jsx("input",{type:"text",className:"mt-1 block w-full p-2 border border-gray-300 rounded-md",required:!0})]}),B.jsxs("div",{className:"mb-4",children:[B.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Description"}),B.jsx("textarea",{className:"mt-1 block w-full p-2 border border-gray-300 rounded-md",required:!0})]}),B.jsx("button",{type:"submit",className:"bg-blue-500 text-white py-2 px-4 rounded-md",children:"Add Project"})]})]}),Zoe=()=>B.jsxs("div",{children:[B.jsx("h2",{className:"text-xl font-bold mb-4",children:"Add Experience"}),B.jsxs("form",{children:[B.jsxs("div",{className:"mb-4",children:[B.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Experience Name"}),B.jsx("input",{type:"text",className:"mt-1 block w-full p-2 border border-gray-300 rounded-md",required:!0})]}),B.jsxs("div",{className:"mb-4",children:[B.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Description"}),B.jsx("textarea",{className:"mt-1 block w-full p-2 border border-gray-300 rounded-md",required:!0})]}),B.jsx("button",{type:"submit",className:"bg-blue-500 text-white py-2 px-4 rounded-md",children:"Add Experience"})]})]}),eae=()=>B.jsxs("div",{children:[B.jsx("h2",{className:"text-xl font-bold mb-4",children:"Edit Blog"}),B.jsxs("form",{children:[B.jsxs("div",{className:"mb-4",children:[B.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Blog ID"}),B.jsx("input",{type:"text",className:"mt-1 block w-full p-2 border border-gray-300 rounded-md",required:!0})]}),B.jsxs("div",{className:"mb-4",children:[B.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"New Content"}),B.jsx("textarea",{className:"mt-1 block w-full p-2 border border-gray-300 rounded-md",required:!0})]}),B.jsx("button",{type:"submit",className:"bg-blue-500 text-white py-2 px-4 rounded-md",children:"Edit Blog"})]})]}),tae=()=>B.jsxs("div",{children:[B.jsx("h2",{className:"text-xl font-bold mb-4",children:"Edit Project"}),B.jsxs("form",{children:[B.jsxs("div",{className:"mb-4",children:[B.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Project ID"}),B.jsx("input",{type:"text",className:"mt-1 block w-full p-2 border border-gray-300 rounded-md",required:!0})]}),B.jsxs("div",{className:"mb-4",children:[B.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"New Description"}),B.jsx("textarea",{className:"mt-1 block w-full p-2 border border-gray-300 rounded-md",required:!0})]}),B.jsx("button",{type:"submit",className:"bg-blue-500 text-white py-2 px-4 rounded-md",children:"Edit Project"})]})]}),nae=()=>B.jsxs("div",{children:[B.jsx("h2",{className:"text-xl font-bold mb-4",children:"Edit Experience"}),B.jsxs("form",{children:[B.jsxs("div",{className:"mb-4",children:[B.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Project ID"}),B.jsx("input",{type:"text",className:"mt-1 block w-full p-2 border border-gray-300 rounded-md",required:!0})]}),B.jsxs("div",{className:"mb-4",children:[B.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"New Description"}),B.jsx("textarea",{className:"mt-1 block w-full p-2 border border-gray-300 rounded-md",required:!0})]}),B.jsx("button",{type:"submit",className:"bg-blue-500 text-white py-2 px-4 rounded-md",children:"Edit Project"})]})]}),iae=I1.createRoot(document.getElementById("root"));iae.render(B.jsxs(uH,{children:[B.jsx(kO,{}),B.jsx(iH,{children:B.jsxs(ys,{path:"/",element:B.jsx(VW,{}),children:[B.jsx(ys,{index:!0,element:B.jsx(Fre,{})}),B.jsx(ys,{path:"/login",element:B.jsx(Yoe,{})}),B.jsxs(ys,{path:"/admin/dashboard",element:B.jsx(Koe,{}),children:[B.jsx(ys,{path:"add-blog",element:B.jsx(Qoe,{})}),B.jsx(ys,{path:"add-project",element:B.jsx(Joe,{})}),B.jsx(ys,{path:"add-experience",element:B.jsx(Zoe,{})}),B.jsx(ys,{path:"edit-blog",element:B.jsx(eae,{})}),B.jsx(ys,{path:"edit-project",element:B.jsx(tae,{})}),B.jsx(ys,{path:"edit-experience",element:B.jsx(nae,{})})]}),B.jsx(ys,{path:"*",element:B.jsx(tH,{to:"/"})})]})})]})); diff --git a/index.html b/index.html index efc691f..2710d82 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,7 @@ - + Satyam Mishra | Bedead - - + +