diff --git a/.env b/.env
deleted file mode 100644
index 67dbc71..0000000
--- a/.env
+++ /dev/null
@@ -1,7 +0,0 @@
-VITE_apiKey=AIzaSyA9rwmAgjAlIC-gitEJi7lm5c8xlpgeOdY
-VITE_authDomain=connection-280f7.firebaseapp.com
-VITE_projectId=connection-280f7
-VITE_storageBucket=connection-280f7.appspot.com
-VITE_messagingSenderId=514095534536
-VITE_appId=1:514095534536:web:6bca02ef3459c41bde70fd
-VITE_databaseURL=https://connection-280f7-default-rtdb.europe-west1.firebasedatabase.app
\ No newline at end of file
diff --git a/.eslintrc.cjs b/.eslintrc.cjs
deleted file mode 100644
index ce53ce2..0000000
--- a/.eslintrc.cjs
+++ /dev/null
@@ -1,28 +0,0 @@
-module.exports = {
- root: true,
- env: { browser: true, es2020: true },
- extends: [
- 'eslint:recommended',
- 'plugin:react/recommended',
- 'plugin:react/jsx-runtime',
- 'plugin:react-hooks/recommended',
- 'plugin:prettier/recommended'
- ],
- ignorePatterns: ['dist', '.eslintrc.cjs'],
- parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
- settings: { react: { version: '18.2' } },
- plugins: ['react-refresh', 'prettier'],
- rules: {
- 'react/jsx-no-target-blank': 'off',
- 'react-refresh/only-export-components': [
- 'warn',
- { allowConstantExport: true },
- ],
- 'prettier/prettier': [
- 'warn',
- {
- endOfLine: 'auto',
- },
- ]
- },
-}
diff --git a/.firebaserc b/.firebaserc
deleted file mode 100644
index 012ace3..0000000
--- a/.firebaserc
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "projects": {
- "default": "connection-280f7"
- }
-}
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
deleted file mode 100644
index e4fb9a5..0000000
--- a/.github/workflows/deploy.yml
+++ /dev/null
@@ -1,51 +0,0 @@
-# Simple workflow for deploying static content to GitHub Pages
-name: Deploy static content to Pages
-
-on:
- # Runs on pushes targeting the default branch
- push:
- branches: ['main']
-
- # Allows you to run this workflow manually from the Actions tab
- workflow_dispatch:
-
-# Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages
-permissions:
- contents: read
- pages: write
- id-token: write
-
-# Allow one concurrent deployment
-concurrency:
- group: 'pages'
- cancel-in-progress: true
-
-jobs:
- # Single deploy job since we're just deploying
- deploy:
- environment:
- name: github-pages
- url: ${{ steps.deployment.outputs.page_url }}
- runs-on: ubuntu-latest
- steps:
- - name: Checkout
- uses: actions/checkout@v4
- - name: Set up Node
- uses: actions/setup-node@v4
- with:
- node-version: 20
- cache: 'npm'
- - name: Install dependencies
- run: npm ci
- - name: Build
- run: npm run build
- - name: Setup Pages
- uses: actions/configure-pages@v4
- - name: Upload artifact
- uses: actions/upload-pages-artifact@v3
- with:
- # Upload dist folder
- path: './dist'
- - name: Deploy to GitHub Pages
- id: deployment
- uses: actions/deploy-pages@v4
diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index a547bf3..0000000
--- a/.gitignore
+++ /dev/null
@@ -1,24 +0,0 @@
-# Logs
-logs
-*.log
-npm-debug.log*
-yarn-debug.log*
-yarn-error.log*
-pnpm-debug.log*
-lerna-debug.log*
-
-node_modules
-dist
-dist-ssr
-*.local
-
-# Editor directories and files
-.vscode/*
-!.vscode/extensions.json
-.idea
-.DS_Store
-*.suo
-*.ntvs*
-*.njsproj
-*.sln
-*.sw?
diff --git a/.prettierignore b/.prettierignore
deleted file mode 100644
index 369938e..0000000
--- a/.prettierignore
+++ /dev/null
@@ -1,7 +0,0 @@
-**/.git
-**/.svn
-**/.hg
-**/node_modules
-**/.scss
-**/.css
-**/.vue
diff --git a/.prettierrc b/.prettierrc
deleted file mode 100644
index 213598e..0000000
--- a/.prettierrc
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "semi": true,
- "tabWidth": 2,
- "singleQuote": true,
- "trailingComma": "all",
- "bracketSpacing": true,
- "arrowParens": "avoid",
- "maxLineLength": 200
-}
diff --git a/404.html b/404.html
new file mode 100644
index 0000000..16584c7
--- /dev/null
+++ b/404.html
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+ Connection
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/README.md b/README.md
deleted file mode 100644
index fe6ac1e..0000000
--- a/README.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# React + Vite
-
-This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
-
-Currently, two official plugins are available:
-
-- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
-- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
-"# react-template"
-"# Connection"
-"# Connection"
diff --git a/assets/index-CbB4cIxE.js b/assets/index-CbB4cIxE.js
new file mode 100644
index 0000000..8dcf839
--- /dev/null
+++ b/assets/index-CbB4cIxE.js
@@ -0,0 +1,8726 @@
+function ZU(t,e){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();function _m(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function hc(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var qU={exports:{}},Wx={},eF={exports:{}},Nn={};/**
+ * @license React
+ * react.production.min.js
+ *
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */var Y1=Symbol.for("react.element"),cY=Symbol.for("react.portal"),uY=Symbol.for("react.fragment"),fY=Symbol.for("react.strict_mode"),dY=Symbol.for("react.profiler"),hY=Symbol.for("react.provider"),pY=Symbol.for("react.context"),mY=Symbol.for("react.forward_ref"),gY=Symbol.for("react.suspense"),vY=Symbol.for("react.memo"),yY=Symbol.for("react.lazy"),iN=Symbol.iterator;function wY(t){return t===null||typeof t!="object"?null:(t=iN&&t[iN]||t["@@iterator"],typeof t=="function"?t:null)}var tF={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},nF=Object.assign,rF={};function Mm(t,e,n){this.props=t,this.context=e,this.refs=rF,this.updater=n||tF}Mm.prototype.isReactComponent={};Mm.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};Mm.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function iF(){}iF.prototype=Mm.prototype;function nL(t,e,n){this.props=t,this.context=e,this.refs=rF,this.updater=n||tF}var rL=nL.prototype=new iF;rL.constructor=nL;nF(rL,Mm.prototype);rL.isPureReactComponent=!0;var sN=Array.isArray,sF=Object.prototype.hasOwnProperty,iL={current:null},oF={key:!0,ref:!0,__self:!0,__source:!0};function aF(t,e,n){var r,i={},s=null,o=null;if(e!=null)for(r in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(s=""+e.key),e)sF.call(e,r)&&!oF.hasOwnProperty(r)&&(i[r]=e[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1>>1,_e=j[de];if(0>>1;dei(we,ne))he<_e&&0>i(Ie,we)?(j[de]=Ie,j[he]=ne,de=he):(j[de]=we,j[ce]=ne,de=ce);else if(he<_e&&0>i(Ie,ne))j[de]=Ie,j[he]=ne,de=he;else break e}}return q}function i(j,q){var ne=j.sortIndex-q.sortIndex;return ne!==0?ne:j.id-q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();t.unstable_now=function(){return o.now()-a}}var l=[],c=[],u=1,f=null,h=3,m=!1,v=!1,w=!1,y=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(j){for(var q=n(c);q!==null;){if(q.callback===null)r(c);else if(q.startTime<=j)r(c),q.sortIndex=q.expirationTime,e(l,q);else break;q=n(c)}}function S(j){if(w=!1,x(j),!v)if(n(l)!==null)v=!0,ee(D);else{var q=n(c);q!==null&&le(S,q.startTime-j)}}function D(j,q){v=!1,w&&(w=!1,g(R),R=-1),m=!0;var ne=h;try{for(x(q),f=n(l);f!==null&&(!(f.expirationTime>q)||j&&!P());){var de=f.callback;if(typeof de=="function"){f.callback=null,h=f.priorityLevel;var _e=de(f.expirationTime<=q);q=t.unstable_now(),typeof _e=="function"?f.callback=_e:f===n(l)&&r(l),x(q)}else r(l);f=n(l)}if(f!==null)var ge=!0;else{var ce=n(c);ce!==null&&le(S,ce.startTime-q),ge=!1}return ge}finally{f=null,h=ne,m=!1}}var T=!1,E=null,R=-1,C=5,L=-1;function P(){return!(t.unstable_now()-Lj||125de?(j.sortIndex=ne,e(c,j),n(l)===null&&j===n(c)&&(w?(g(R),R=-1):w=!0,le(S,ne-de))):(j.sortIndex=_e,e(l,j),v||m||(v=!0,ee(D))),j},t.unstable_shouldYield=P,t.unstable_wrapCallback=function(j){var q=h;return function(){var ne=h;h=q;try{return j.apply(this,arguments)}finally{h=ne}}}})(dF);fF.exports=dF;var LY=fF.exports;/**
+ * @license React
+ * react-dom.production.min.js
+ *
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */var RY=I,Ao=LY;function vt(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),jA=Object.prototype.hasOwnProperty,PY=/^[: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]*$/,aN={},lN={};function DY(t){return jA.call(lN,t)?!0:jA.call(aN,t)?!1:PY.test(t)?lN[t]=!0:(aN[t]=!0,!1)}function NY(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function kY(t,e,n,r){if(e===null||typeof e>"u"||NY(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.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 Fs(t,e,n,r,i,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var Xi={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Xi[t]=new Fs(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Xi[e]=new Fs(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Xi[t]=new Fs(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Xi[t]=new Fs(t,2,!1,t,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(t){Xi[t]=new Fs(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Xi[t]=new Fs(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Xi[t]=new Fs(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Xi[t]=new Fs(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Xi[t]=new Fs(t,5,!1,t.toLowerCase(),null,!1,!1)});var oL=/[\-:]([a-z])/g;function aL(t){return t[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(t){var e=t.replace(oL,aL);Xi[e]=new Fs(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(oL,aL);Xi[e]=new Fs(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(oL,aL);Xi[e]=new Fs(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Xi[t]=new Fs(t,1,!1,t.toLowerCase(),null,!1,!1)});Xi.xlinkHref=new Fs("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Xi[t]=new Fs(t,1,!1,t.toLowerCase(),null,!0,!0)});function lL(t,e,n,r){var i=Xi.hasOwnProperty(e)?Xi[e]:null;(i!==null?i.type!==0:r||!(2a||i[o]!==s[a]){var l=`
+`+i[o].replace(" at new "," at ");return t.displayName&&l.includes("")&&(l=l.replace("",t.displayName)),l}while(1<=o&&0<=a);break}}}finally{bC=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?tg(t):""}function BY(t){switch(t.tag){case 5:return tg(t.type);case 16:return tg("Lazy");case 13:return tg("Suspense");case 19:return tg("SuspenseList");case 0:case 2:case 15:return t=SC(t.type,!1),t;case 11:return t=SC(t.type.render,!1),t;case 1:return t=SC(t.type,!0),t;default:return""}}function VA(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case ep:return"Fragment";case qh:return"Portal";case zA:return"Profiler";case cL:return"StrictMode";case HA:return"Suspense";case GA:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case mF:return(t.displayName||"Context")+".Consumer";case pF:return(t._context.displayName||"Context")+".Provider";case uL:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case fL:return e=t.displayName||null,e!==null?e:VA(t.type)||"Memo";case zc:e=t._payload,t=t._init;try{return VA(t(e))}catch{}}return null}function OY(t){var e=t.type;switch(t.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 t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return VA(e);case 8:return e===cL?"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 yu(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function vF(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function UY(t){var e=vF(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Fy(t){t._valueTracker||(t._valueTracker=UY(t))}function yF(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=vF(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function nM(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function WA(t,e){var n=e.checked;return Br({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function uN(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=yu(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function wF(t,e){e=e.checked,e!=null&&lL(t,"checked",e,!1)}function $A(t,e){wF(t,e);var n=yu(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?JA(t,e.type,n):e.hasOwnProperty("defaultValue")&&JA(t,e.type,yu(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function fN(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function JA(t,e,n){(e!=="number"||nM(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var ng=Array.isArray;function gp(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=jy.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Xg(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var yg={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},FY=["Webkit","ms","Moz","O"];Object.keys(yg).forEach(function(t){FY.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),yg[e]=yg[t]})});function bF(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||yg.hasOwnProperty(t)&&yg[t]?(""+e).trim():e+"px"}function SF(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=bF(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var jY=Br({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 XA(t,e){if(e){if(jY[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(vt(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(vt(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(vt(61))}if(e.style!=null&&typeof e.style!="object")throw Error(vt(62))}}function KA(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){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 ZA=null;function dL(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var qA=null,vp=null,yp=null;function pN(t){if(t=K1(t)){if(typeof qA!="function")throw Error(vt(280));var e=t.stateNode;e&&(e=Xx(e),qA(t.stateNode,t.type,e))}}function CF(t){vp?yp?yp.push(t):yp=[t]:vp=t}function EF(){if(vp){var t=vp,e=yp;if(yp=vp=null,pN(t),e)for(t=0;t>>=0,t===0?32:31-(KY(t)/ZY|0)|0}var zy=64,Hy=4194304;function rg(t){switch(t&-t){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 t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function oM(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,s=t.pingedLanes,o=n&268435455;if(o!==0){var a=o&~i;a!==0?r=rg(a):(s&=o,s!==0&&(r=rg(s)))}else o=n&~i,o!==0?r=rg(o):s!==0&&(r=rg(s));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0n;n++)e.push(t);return e}function Q1(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Ra(e),t[e]=n}function nQ(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0=_g),bN=" ",SN=!1;function $F(t,e){switch(t){case"keyup":return LQ.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function JF(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var tp=!1;function PQ(t,e){switch(t){case"compositionend":return JF(e);case"keypress":return e.which!==32?null:(SN=!0,bN);case"textInput":return t=e.data,t===bN&&SN?null:t;default:return null}}function DQ(t,e){if(tp)return t==="compositionend"||!_L&&$F(t,e)?(t=VF(),S_=vL=tu=null,tp=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=TN(n)}}function KF(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?KF(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function ZF(){for(var t=window,e=nM();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=nM(t.document)}return e}function ML(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function HQ(t){var e=ZF(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&KF(n.ownerDocument.documentElement,n)){if(r!==null&&ML(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!t.extend&&s>r&&(i=r,r=s,s=i),i=IN(n,s);var o=IN(n,r);i&&o&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),s>r?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,np=null,sT=null,xg=null,oT=!1;function LN(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;oT||np==null||np!==nM(r)||(r=np,"selectionStart"in r&&ML(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),xg&&n1(xg,r)||(xg=r,r=cM(sT,"onSelect"),0sp||(t.current=dT[sp],dT[sp]=null,sp--)}function _r(t,e){sp++,dT[sp]=t.current,t.current=e}var wu={},ys=Ru(wu),Ys=Ru(!1),ud=wu;function Op(t,e){var n=t.type.contextTypes;if(!n)return wu;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=e[s];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function Qs(t){return t=t.childContextTypes,t!=null}function fM(){Sr(Ys),Sr(ys)}function ON(t,e,n){if(ys.current!==wu)throw Error(vt(168));_r(ys,e),_r(Ys,n)}function aj(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(vt(108,OY(t)||"Unknown",i));return Br({},n,r)}function dM(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||wu,ud=ys.current,_r(ys,t),_r(Ys,Ys.current),!0}function UN(t,e,n){var r=t.stateNode;if(!r)throw Error(vt(169));n?(t=aj(t,e,ud),r.__reactInternalMemoizedMergedChildContext=t,Sr(Ys),Sr(ys),_r(ys,t)):Sr(Ys),_r(Ys,n)}var zl=null,Kx=!1,UC=!1;function lj(t){zl===null?zl=[t]:zl.push(t)}function eX(t){Kx=!0,lj(t)}function Pu(){if(!UC&&zl!==null){UC=!0;var t=0,e=lr;try{var n=zl;for(lr=1;t>=o,i-=o,Wl=1<<32-Ra(e)+i|n<R?(C=E,E=null):C=E.sibling;var L=h(g,E,x[R],S);if(L===null){E===null&&(E=C);break}t&&E&&L.alternate===null&&e(g,E),_=s(L,_,R),T===null?D=L:T.sibling=L,T=L,E=C}if(R===x.length)return n(g,E),Ar&&Af(g,R),D;if(E===null){for(;RR?(C=E,E=null):C=E.sibling;var P=h(g,E,L.value,S);if(P===null){E===null&&(E=C);break}t&&E&&P.alternate===null&&e(g,E),_=s(P,_,R),T===null?D=P:T.sibling=P,T=P,E=C}if(L.done)return n(g,E),Ar&&Af(g,R),D;if(E===null){for(;!L.done;R++,L=x.next())L=f(g,L.value,S),L!==null&&(_=s(L,_,R),T===null?D=L:T.sibling=L,T=L);return Ar&&Af(g,R),D}for(E=r(g,E);!L.done;R++,L=x.next())L=m(E,g,R,L.value,S),L!==null&&(t&&L.alternate!==null&&E.delete(L.key===null?R:L.key),_=s(L,_,R),T===null?D=L:T.sibling=L,T=L);return t&&E.forEach(function(z){return e(g,z)}),Ar&&Af(g,R),D}function y(g,_,x,S){if(typeof x=="object"&&x!==null&&x.type===ep&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Uy:e:{for(var D=x.key,T=_;T!==null;){if(T.key===D){if(D=x.type,D===ep){if(T.tag===7){n(g,T.sibling),_=i(T,x.props.children),_.return=g,g=_;break e}}else if(T.elementType===D||typeof D=="object"&&D!==null&&D.$$typeof===zc&&zN(D)===T.type){n(g,T.sibling),_=i(T,x.props),_.ref=M0(g,T,x),_.return=g,g=_;break e}n(g,T);break}else e(g,T);T=T.sibling}x.type===ep?(_=td(x.props.children,g.mode,S,x.key),_.return=g,g=_):(S=P_(x.type,x.key,x.props,null,g.mode,S),S.ref=M0(g,_,x),S.return=g,g=S)}return o(g);case qh:e:{for(T=x.key;_!==null;){if(_.key===T)if(_.tag===4&&_.stateNode.containerInfo===x.containerInfo&&_.stateNode.implementation===x.implementation){n(g,_.sibling),_=i(_,x.children||[]),_.return=g,g=_;break e}else{n(g,_);break}else e(g,_);_=_.sibling}_=$C(x,g.mode,S),_.return=g,g=_}return o(g);case zc:return T=x._init,y(g,_,T(x._payload),S)}if(ng(x))return v(g,_,x,S);if(g0(x))return w(g,_,x,S);Qy(g,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,_!==null&&_.tag===6?(n(g,_.sibling),_=i(_,x),_.return=g,g=_):(n(g,_),_=WC(x,g.mode,S),_.return=g,g=_),o(g)):n(g,_)}return y}var Fp=dj(!0),hj=dj(!1),mM=Ru(null),gM=null,lp=null,CL=null;function EL(){CL=lp=gM=null}function AL(t){var e=mM.current;Sr(mM),t._currentValue=e}function mT(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function _p(t,e){gM=t,CL=lp=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&($s=!0),t.firstContext=null)}function ra(t){var e=t._currentValue;if(CL!==t)if(t={context:t,memoizedValue:e,next:null},lp===null){if(gM===null)throw Error(vt(308));lp=t,gM.dependencies={lanes:0,firstContext:t}}else lp=lp.next=t;return e}var Ff=null;function TL(t){Ff===null?Ff=[t]:Ff.push(t)}function pj(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,TL(e)):(n.next=i.next,i.next=n),e.interleaved=n,sc(t,r)}function sc(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var Hc=!1;function IL(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function mj(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Zl(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function cu(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,Yn&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,sc(t,n)}return i=r.interleaved,i===null?(e.next=e,TL(r)):(e.next=i.next,i.next=e),r.interleaved=e,sc(t,n)}function E_(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,pL(t,n)}}function HN(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?i=s=e:s=s.next=e}else i=s=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function vM(t,e,n,r){var i=t.updateQueue;Hc=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,c=l.next;l.next=null,o===null?s=c:o.next=c,o=l;var u=t.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==o&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(s!==null){var f=i.baseState;o=0,u=c=l=null,a=s;do{var h=a.lane,m=a.eventTime;if((r&h)===h){u!==null&&(u=u.next={eventTime:m,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var v=t,w=a;switch(h=e,m=n,w.tag){case 1:if(v=w.payload,typeof v=="function"){f=v.call(m,f,h);break e}f=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=w.payload,h=typeof v=="function"?v.call(m,f,h):v,h==null)break e;f=Br({},f,h);break e;case 2:Hc=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,h=i.effects,h===null?i.effects=[a]:h.push(a))}else m={eventTime:m,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=m,l=f):u=u.next=m,o|=h;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;h=a,a=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(u===null&&(l=f),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=u,e=i.shared.interleaved,e!==null){i=e;do o|=i.lane,i=i.next;while(i!==e)}else s===null&&(i.shared.lanes=0);hd|=o,t.lanes=o,t.memoizedState=f}}function GN(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;en?n:4,t(!0);var r=jC.transition;jC.transition={};try{t(!1),e()}finally{lr=n,jC.transition=r}}function Pj(){return ia().memoizedState}function iX(t,e,n){var r=fu(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Dj(t))Nj(e,n);else if(n=pj(t,e,n,r),n!==null){var i=Ds();Pa(n,t,r,i),kj(n,e,r)}}function sX(t,e,n){var r=fu(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Dj(t))Nj(e,i);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,n);if(i.hasEagerState=!0,i.eagerState=a,Ba(a,o)){var l=e.interleaved;l===null?(i.next=i,TL(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}n=pj(t,e,i,r),n!==null&&(i=Ds(),Pa(n,t,r,i),kj(n,e,r))}}function Dj(t){var e=t.alternate;return t===Nr||e!==null&&e===Nr}function Nj(t,e){bg=wM=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function kj(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,pL(t,n)}}var _M={readContext:ra,useCallback:as,useContext:as,useEffect:as,useImperativeHandle:as,useInsertionEffect:as,useLayoutEffect:as,useMemo:as,useReducer:as,useRef:as,useState:as,useDebugValue:as,useDeferredValue:as,useTransition:as,useMutableSource:as,useSyncExternalStore:as,useId:as,unstable_isNewReconciler:!1},oX={readContext:ra,useCallback:function(t,e){return Xa().memoizedState=[t,e===void 0?null:e],t},useContext:ra,useEffect:WN,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,T_(4194308,4,Aj.bind(null,e,t),n)},useLayoutEffect:function(t,e){return T_(4194308,4,t,e)},useInsertionEffect:function(t,e){return T_(4,2,t,e)},useMemo:function(t,e){var n=Xa();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=Xa();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=iX.bind(null,Nr,t),[r.memoizedState,t]},useRef:function(t){var e=Xa();return t={current:t},e.memoizedState=t},useState:VN,useDebugValue:OL,useDeferredValue:function(t){return Xa().memoizedState=t},useTransition:function(){var t=VN(!1),e=t[0];return t=rX.bind(null,t[1]),Xa().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=Nr,i=Xa();if(Ar){if(n===void 0)throw Error(vt(407));n=n()}else{if(n=e(),Oi===null)throw Error(vt(349));dd&30||wj(r,e,n)}i.memoizedState=n;var s={value:n,getSnapshot:e};return i.queue=s,WN(Mj.bind(null,r,s,t),[t]),r.flags|=2048,u1(9,_j.bind(null,r,s,n,e),void 0,null),n},useId:function(){var t=Xa(),e=Oi.identifierPrefix;if(Ar){var n=$l,r=Wl;n=(r&~(1<<32-Ra(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=l1++,0<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=o.createElement(n,{is:r.is}):(t=o.createElement(n),n==="select"&&(o=t,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):t=o.createElementNS(t,n),t[qa]=e,t[s1]=r,Wj(t,e,!1,!1),e.stateNode=t;e:{switch(o=KA(n,r),n){case"dialog":xr("cancel",t),xr("close",t),i=r;break;case"iframe":case"object":case"embed":xr("load",t),i=r;break;case"video":case"audio":for(i=0;iHp&&(e.flags|=128,r=!0,x0(s,!1),e.lanes=4194304)}else{if(!r)if(t=yM(o),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),x0(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Ar)return ls(e),null}else 2*Kr()-s.renderingStartTime>Hp&&n!==1073741824&&(e.flags|=128,r=!0,x0(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(n=s.last,n!==null?n.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Kr(),e.sibling=null,n=Rr.current,_r(Rr,r?n&1|2:n&1),e):(ls(e),null);case 22:case 23:return GL(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?uo&1073741824&&(ls(e),e.subtreeFlags&6&&(e.flags|=8192)):ls(e),null;case 24:return null;case 25:return null}throw Error(vt(156,e.tag))}function pX(t,e){switch(bL(e),e.tag){case 1:return Qs(e.type)&&fM(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return jp(),Sr(Ys),Sr(ys),PL(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return RL(e),null;case 13:if(Sr(Rr),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(vt(340));Up()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Sr(Rr),null;case 4:return jp(),null;case 10:return AL(e.type._context),null;case 22:case 23:return GL(),null;case 24:return null;default:return null}}var Ky=!1,ms=!1,mX=typeof WeakSet=="function"?WeakSet:Set,jt=null;function cp(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Gr(t,e,r)}else n.current=null}function ST(t,e,n){try{n()}catch(r){Gr(t,e,r)}}var nk=!1;function gX(t,e){if(aT=aM,t=ZF(),ML(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,a=-1,l=-1,c=0,u=0,f=t,h=null;t:for(;;){for(var m;f!==n||i!==0&&f.nodeType!==3||(a=o+i),f!==s||r!==0&&f.nodeType!==3||(l=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(m=f.firstChild)!==null;)h=f,f=m;for(;;){if(f===t)break t;if(h===n&&++c===i&&(a=o),h===s&&++u===r&&(l=o),(m=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=m}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(lT={focusedElem:t,selectionRange:n},aM=!1,jt=e;jt!==null;)if(e=jt,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,jt=t;else for(;jt!==null;){e=jt;try{var v=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var w=v.memoizedProps,y=v.memoizedState,g=e.stateNode,_=g.getSnapshotBeforeUpdate(e.elementType===e.type?w:ba(e.type,w),y);g.__reactInternalSnapshotBeforeUpdate=_}break;case 3:var x=e.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(vt(163))}}catch(S){Gr(e,e.return,S)}if(t=e.sibling,t!==null){t.return=e.return,jt=t;break}jt=e.return}return v=nk,nk=!1,v}function Sg(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var s=i.destroy;i.destroy=void 0,s!==void 0&&ST(e,n,s)}i=i.next}while(i!==r)}}function eb(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function CT(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function Yj(t){var e=t.alternate;e!==null&&(t.alternate=null,Yj(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[qa],delete e[s1],delete e[fT],delete e[ZQ],delete e[qQ])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function Qj(t){return t.tag===5||t.tag===3||t.tag===4}function rk(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Qj(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function ET(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=uM));else if(r!==4&&(t=t.child,t!==null))for(ET(t,e,n),t=t.sibling;t!==null;)ET(t,e,n),t=t.sibling}function AT(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(AT(t,e,n),t=t.sibling;t!==null;)AT(t,e,n),t=t.sibling}var Gi=null,Ca=!1;function Ec(t,e,n){for(n=n.child;n!==null;)Xj(t,e,n),n=n.sibling}function Xj(t,e,n){if(nl&&typeof nl.onCommitFiberUnmount=="function")try{nl.onCommitFiberUnmount($x,n)}catch{}switch(n.tag){case 5:ms||cp(n,e);case 6:var r=Gi,i=Ca;Gi=null,Ec(t,e,n),Gi=r,Ca=i,Gi!==null&&(Ca?(t=Gi,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Gi.removeChild(n.stateNode));break;case 18:Gi!==null&&(Ca?(t=Gi,n=n.stateNode,t.nodeType===8?OC(t.parentNode,n):t.nodeType===1&&OC(t,n),e1(t)):OC(Gi,n.stateNode));break;case 4:r=Gi,i=Ca,Gi=n.stateNode.containerInfo,Ca=!0,Ec(t,e,n),Gi=r,Ca=i;break;case 0:case 11:case 14:case 15:if(!ms&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&ST(n,e,o),i=i.next}while(i!==r)}Ec(t,e,n);break;case 1:if(!ms&&(cp(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Gr(n,e,a)}Ec(t,e,n);break;case 21:Ec(t,e,n);break;case 22:n.mode&1?(ms=(r=ms)||n.memoizedState!==null,Ec(t,e,n),ms=r):Ec(t,e,n);break;default:Ec(t,e,n)}}function ik(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new mX),e.forEach(function(r){var i=CX.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function ya(t,e){var n=e.deletions;if(n!==null)for(var r=0;ri&&(i=o),r&=~s}if(r=i,r=Kr()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*yX(r/1960))-r,10t?16:t,nu===null)var r=!1;else{if(t=nu,nu=null,bM=0,Yn&6)throw Error(vt(331));var i=Yn;for(Yn|=4,jt=t.current;jt!==null;){var s=jt,o=s.child;if(jt.flags&16){var a=s.deletions;if(a!==null){for(var l=0;lKr()-zL?ed(t,0):jL|=n),Xs(t,e)}function iz(t,e){e===0&&(t.mode&1?(e=Hy,Hy<<=1,!(Hy&130023424)&&(Hy=4194304)):e=1);var n=Ds();t=sc(t,e),t!==null&&(Q1(t,e,n),Xs(t,n))}function SX(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),iz(t,n)}function CX(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(vt(314))}r!==null&&r.delete(e),iz(t,n)}var sz;sz=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||Ys.current)$s=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return $s=!1,dX(t,e,n);$s=!!(t.flags&131072)}else $s=!1,Ar&&e.flags&1048576&&cj(e,pM,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;I_(t,e),t=e.pendingProps;var i=Op(e,ys.current);_p(e,n),i=NL(null,e,r,t,i,n);var s=kL();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Qs(r)?(s=!0,dM(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,IL(e),i.updater=qx,e.stateNode=i,i._reactInternals=e,vT(e,r,t,n),e=_T(null,e,r,!0,s,n)):(e.tag=0,Ar&&s&&xL(e),Rs(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(I_(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=AX(r),t=ba(r,t),i){case 0:e=wT(null,e,r,t,n);break e;case 1:e=qN(null,e,r,t,n);break e;case 11:e=KN(null,e,r,t,n);break e;case 14:e=ZN(null,e,r,ba(r.type,t),n);break e}throw Error(vt(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:ba(r,i),wT(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:ba(r,i),qN(t,e,r,i,n);case 3:e:{if(Hj(e),t===null)throw Error(vt(387));r=e.pendingProps,s=e.memoizedState,i=s.element,mj(t,e),vM(e,r,null,n);var o=e.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=zp(Error(vt(423)),e),e=ek(t,e,r,n,i);break e}else if(r!==i){i=zp(Error(vt(424)),e),e=ek(t,e,r,n,i);break e}else for(go=lu(e.stateNode.containerInfo.firstChild),bo=e,Ar=!0,Aa=null,n=hj(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Up(),r===i){e=oc(t,e,n);break e}Rs(t,e,r,n)}e=e.child}return e;case 5:return gj(e),t===null&&pT(e),r=e.type,i=e.pendingProps,s=t!==null?t.memoizedProps:null,o=i.children,cT(r,i)?o=null:s!==null&&cT(r,s)&&(e.flags|=32),zj(t,e),Rs(t,e,o,n),e.child;case 6:return t===null&&pT(e),null;case 13:return Gj(t,e,n);case 4:return LL(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=Fp(e,null,r,n):Rs(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:ba(r,i),KN(t,e,r,i,n);case 7:return Rs(t,e,e.pendingProps,n),e.child;case 8:return Rs(t,e,e.pendingProps.children,n),e.child;case 12:return Rs(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value,_r(mM,r._currentValue),r._currentValue=o,s!==null)if(Ba(s.value,o)){if(s.children===i.children&&!Ys.current){e=oc(t,e,n);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===r){if(s.tag===1){l=Zl(-1,n&-n),l.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),mT(s.return,n,e),a.lanes|=n;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(vt(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),mT(o,n,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}Rs(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,_p(e,n),i=ra(i),r=r(i),e.flags|=1,Rs(t,e,r,n),e.child;case 14:return r=e.type,i=ba(r,e.pendingProps),i=ba(r.type,i),ZN(t,e,r,i,n);case 15:return Fj(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:ba(r,i),I_(t,e),e.tag=1,Qs(r)?(t=!0,dM(e)):t=!1,_p(e,n),Bj(e,r,i),vT(e,r,i,n),_T(null,e,r,!0,t,n);case 19:return Vj(t,e,n);case 22:return jj(t,e,n)}throw Error(vt(156,e.tag))};function oz(t,e){return DF(t,e)}function EX(t,e,n,r){this.tag=t,this.key=n,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=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function qo(t,e,n,r){return new EX(t,e,n,r)}function WL(t){return t=t.prototype,!(!t||!t.isReactComponent)}function AX(t){if(typeof t=="function")return WL(t)?1:0;if(t!=null){if(t=t.$$typeof,t===uL)return 11;if(t===fL)return 14}return 2}function du(t,e){var n=t.alternate;return n===null?(n=qo(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function P_(t,e,n,r,i,s){var o=2;if(r=t,typeof t=="function")WL(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case ep:return td(n.children,i,s,e);case cL:o=8,i|=8;break;case zA:return t=qo(12,n,e,i|2),t.elementType=zA,t.lanes=s,t;case HA:return t=qo(13,n,e,i),t.elementType=HA,t.lanes=s,t;case GA:return t=qo(19,n,e,i),t.elementType=GA,t.lanes=s,t;case gF:return nb(n,i,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case pF:o=10;break e;case mF:o=9;break e;case uL:o=11;break e;case fL:o=14;break e;case zc:o=16,r=null;break e}throw Error(vt(130,t==null?t:typeof t,""))}return e=qo(o,n,e,i),e.elementType=t,e.type=r,e.lanes=s,e}function td(t,e,n,r){return t=qo(7,t,r,e),t.lanes=n,t}function nb(t,e,n,r){return t=qo(22,t,r,e),t.elementType=gF,t.lanes=n,t.stateNode={isHidden:!1},t}function WC(t,e,n){return t=qo(6,t,null,e),t.lanes=n,t}function $C(t,e,n){return e=qo(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function TX(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=EC(0),this.expirationTimes=EC(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=EC(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function $L(t,e,n,r,i,s,o,a,l){return t=new TX(t,e,n,a,l),e===1?(e=1,s===!0&&(e|=8)):e=0,s=qo(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},IL(s),t}function IX(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(uz)}catch(t){console.error(t)}}uz(),uF.exports=Io;var md=uF.exports;const sg=_m(md),NX=ZU({__proto__:null,default:sg},[md]);var dk=md;FA.createRoot=dk.createRoot,FA.hydrateRoot=dk.hydrateRoot;/**
+ * @remix-run/router v1.17.0
+ *
+ * Copyright (c) Remix Software Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE.md file in the root directory of this source tree.
+ *
+ * @license MIT
+ */function Lr(){return Lr=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u")throw new Error(e)}function Gp(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function BX(){return Math.random().toString(36).substr(2,8)}function pk(t,e){return{usr:t.state,key:t.key,idx:e}}function d1(t,e,n,r){return n===void 0&&(n=null),Lr({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?Du(e):e,{state:n,key:e&&e.key||r||BX()})}function q1(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function Du(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function OX(t,e,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:s=!1}=r,o=i.history,a=pi.Pop,l=null,c=u();c==null&&(c=0,o.replaceState(Lr({},o.state,{idx:c}),""));function u(){return(o.state||{idx:null}).idx}function f(){a=pi.Pop;let y=u(),g=y==null?null:y-c;c=y,l&&l({action:a,location:w.location,delta:g})}function h(y,g){a=pi.Push;let _=d1(w.location,y,g);c=u()+1;let x=pk(_,c),S=w.createHref(_);try{o.pushState(x,"",S)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;i.location.assign(S)}s&&l&&l({action:a,location:w.location,delta:1})}function m(y,g){a=pi.Replace;let _=d1(w.location,y,g);c=u();let x=pk(_,c),S=w.createHref(_);o.replaceState(x,"",S),s&&l&&l({action:a,location:w.location,delta:0})}function v(y){let g=i.location.origin!=="null"?i.location.origin:i.location.href,_=typeof y=="string"?y:q1(y);return _=_.replace(/ $/,"%20"),Ln(g,"No window.location.(origin|href) available to create URL for href: "+_),new URL(_,g)}let w={get action(){return a},get location(){return t(i,o)},listen(y){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(hk,f),l=y,()=>{i.removeEventListener(hk,f),l=null}},createHref(y){return e(i,y)},createURL:v,encodeLocation(y){let g=v(y);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:h,replace:m,go(y){return o.go(y)}};return w}var yr;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(yr||(yr={}));const UX=new Set(["lazy","caseSensitive","path","id","index","children"]);function FX(t){return t.index===!0}function h1(t,e,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),t.map((i,s)=>{let o=[...n,String(s)],a=typeof i.id=="string"?i.id:o.join("-");if(Ln(i.index!==!0||!i.children,"Cannot specify children on an index route"),Ln(!r[a],'Found a route id collision on id "'+a+`". Route id's must be globally unique within Data Router usages`),FX(i)){let l=Lr({},i,e(i),{id:a});return r[a]=l,l}else{let l=Lr({},i,e(i),{id:a,children:void 0});return r[a]=l,i.children&&(l.children=h1(i.children,e,o,r)),l}})}function Nf(t,e,n){return n===void 0&&(n="/"),D_(t,e,n,!1)}function D_(t,e,n,r){let i=typeof e=="string"?Du(e):e,s=ev(i.pathname||"/",n);if(s==null)return null;let o=fz(t);zX(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("/")&&(Ln(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let c=hu([r,l.relativePath]),u=n.concat(l);s.children&&s.children.length>0&&(Ln(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),fz(s.children,e,u,c)),!(s.path==null&&!s.index)&&e.push({path:c,score:YX(c,s.index),routesMeta:u})};return t.forEach((s,o)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))i(s,o);else for(let l of dz(s.path))i(s,o,l)}),e}function dz(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let o=dz(r.join("/")),a=[];return a.push(...o.map(l=>l===""?s:[s,l].join("/"))),i&&a.push(...o),a.map(l=>t.startsWith("/")&&l===""?"/":l)}function zX(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:QX(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const HX=/^:[\w-]+$/,GX=3,VX=2,WX=1,$X=10,JX=-2,mk=t=>t==="*";function YX(t,e){let n=t.split("/"),r=n.length;return n.some(mk)&&(r+=JX),e&&(r+=VX),n.filter(i=>!mk(i)).reduce((i,s)=>i+(HX.test(s)?GX:s===""?WX:$X),r)}function QX(t,e){return t.length===e.length&&t.slice(0,-1).every((r,i)=>r===e[i])?t[t.length-1]-e[e.length-1]:0}function XX(t,e,n){n===void 0&&(n=!1);let{routesMeta:r}=t,i={},s="/",o=[];for(let a=0;a{let{paramName:h,isOptional:m}=u;if(h==="*"){let w=a[f]||"";o=s.slice(0,s.length-w.length).replace(/(.)\/+$/,"$1")}const v=a[f];return m&&!v?c[h]=void 0:c[h]=(v||"").replace(/%2F/g,"/"),c},{}),pathname:s,pathnameBase:o,pattern:t}}function KX(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),Gp(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let r=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),r]}function ZX(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return Gp(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function ev(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}function qX(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:i=""}=typeof t=="string"?Du(t):t;return{pathname:n?n.startsWith("/")?n:eK(n,e):e,search:nK(r),hash:rK(i)}}function eK(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function JC(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function hz(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function XL(t,e){let n=hz(t);return e?n.map((r,i)=>i===t.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function KL(t,e,n,r){r===void 0&&(r=!1);let i;typeof t=="string"?i=Du(t):(i=Lr({},t),Ln(!i.pathname||!i.pathname.includes("?"),JC("?","pathname","search",i)),Ln(!i.pathname||!i.pathname.includes("#"),JC("#","pathname","hash",i)),Ln(!i.search||!i.search.includes("#"),JC("#","search","hash",i)));let s=t===""||i.pathname==="",o=s?"/":i.pathname,a;if(o==null)a=n;else{let f=e.length-1;if(!r&&o.startsWith("..")){let h=o.split("/");for(;h[0]==="..";)h.shift(),f-=1;i.pathname=h.join("/")}a=f>=0?e[f]:"/"}let l=qX(i,a),c=o&&o!=="/"&&o.endsWith("/"),u=(s||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}const hu=t=>t.join("/").replace(/\/\/+/g,"/"),tK=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),nK=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,rK=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;class ZL{constructor(e,n,r,i){i===void 0&&(i=!1),this.status=e,this.statusText=n||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function ab(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const pz=["post","put","patch","delete"],iK=new Set(pz),sK=["get",...pz],oK=new Set(sK),aK=new Set([301,302,303,307,308]),lK=new Set([307,308]),YC={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},cK={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},S0={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},qL=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,uK=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),mz="remix-router-transitions";function fK(t){const e=t.window?t.window:typeof window<"u"?window:void 0,n=typeof e<"u"&&typeof e.document<"u"&&typeof e.document.createElement<"u",r=!n;Ln(t.routes.length>0,"You must provide a non-empty routes array to createRouter");let i;if(t.mapRouteProperties)i=t.mapRouteProperties;else if(t.detectErrorBoundary){let ue=t.detectErrorBoundary;i=me=>({hasErrorBoundary:ue(me)})}else i=uK;let s={},o=h1(t.routes,i,void 0,s),a,l=t.basename||"/",c=t.unstable_dataStrategy||gK,u=t.unstable_patchRoutesOnMiss,f=Lr({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,unstable_skipActionErrorRevalidation:!1},t.future),h=null,m=new Set,v=null,w=null,y=null,g=t.hydrationData!=null,_=Nf(o,t.history.location,l),x=null;if(_==null&&!u){let ue=Ls(404,{pathname:t.history.location.pathname}),{matches:me,route:Se}=Ek(o);_=me,x={[Se.id]:ue}}let S;if(!_)S=!1,_=[];else if(_.some(ue=>ue.route.lazy))S=!1;else if(!_.some(ue=>ue.route.loader))S=!0;else if(f.v7_partialHydration){let ue=t.hydrationData?t.hydrationData.loaderData:null,me=t.hydrationData?t.hydrationData.errors:null,Se=Ge=>Ge.route.loader?typeof Ge.route.loader=="function"&&Ge.route.loader.hydrate===!0?!1:ue&&ue[Ge.route.id]!==void 0||me&&me[Ge.route.id]!==void 0:!0;if(me){let Ge=_.findIndex(mt=>me[mt.route.id]!==void 0);S=_.slice(0,Ge+1).every(Se)}else S=_.every(Se)}else S=t.hydrationData!=null;let D,T={historyAction:t.history.action,location:t.history.location,matches:_,initialized:S,navigation:YC,restoreScrollPosition:t.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:t.hydrationData&&t.hydrationData.loaderData||{},actionData:t.hydrationData&&t.hydrationData.actionData||null,errors:t.hydrationData&&t.hydrationData.errors||x,fetchers:new Map,blockers:new Map},E=pi.Pop,R=!1,C,L=!1,P=new Map,z=null,B=!1,Y=!1,ie=[],ee=[],le=new Map,j=0,q=-1,ne=new Map,de=new Set,_e=new Map,ge=new Map,ce=new Set,we=new Map,he=new Map,Ie=new Map,et=!1;function ct(){if(h=t.history.listen(ue=>{let{action:me,location:Se,delta:Ge}=ue;if(et){et=!1;return}Gp(he.size===0||Ge!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let mt=fe({currentLocation:T.location,nextLocation:Se,historyAction:me});if(mt&&Ge!=null){et=!0,t.history.go(Ge*-1),st(mt,{state:"blocked",location:Se,proceed(){st(mt,{state:"proceeding",proceed:void 0,reset:void 0,location:Se}),t.history.go(Ge)},reset(){let bt=new Map(T.blockers);bt.set(mt,S0),$({blockers:bt})}});return}return Ue(me,Se)}),n){IK(e,P);let ue=()=>LK(e,P);e.addEventListener("pagehide",ue),z=()=>e.removeEventListener("pagehide",ue)}return T.initialized||Ue(pi.Pop,T.location,{initialHydration:!0}),D}function it(){h&&h(),z&&z(),m.clear(),C&&C.abort(),T.fetchers.forEach((ue,me)=>_t(me)),T.blockers.forEach((ue,me)=>pe(me))}function ut(ue){return m.add(ue),()=>m.delete(ue)}function $(ue,me){me===void 0&&(me={}),T=Lr({},T,ue);let Se=[],Ge=[];f.v7_fetcherPersist&&T.fetchers.forEach((mt,bt)=>{mt.state==="idle"&&(ce.has(bt)?Ge.push(bt):Se.push(bt))}),[...m].forEach(mt=>mt(T,{deletedFetchers:Ge,unstable_viewTransitionOpts:me.viewTransitionOpts,unstable_flushSync:me.flushSync===!0})),f.v7_fetcherPersist&&(Se.forEach(mt=>T.fetchers.delete(mt)),Ge.forEach(mt=>_t(mt)))}function Ce(ue,me,Se){var Ge,mt;let{flushSync:bt}=Se===void 0?{}:Se,ot=T.actionData!=null&&T.navigation.formMethod!=null&&Ea(T.navigation.formMethod)&&T.navigation.state==="loading"&&((Ge=ue.state)==null?void 0:Ge._isRedirect)!==!0,gt;me.actionData?Object.keys(me.actionData).length>0?gt=me.actionData:gt=null:ot?gt=T.actionData:gt=null;let Gt=me.loaderData?Sk(T.loaderData,me.loaderData,me.matches||[],me.errors):T.loaderData,F=T.blockers;F.size>0&&(F=new Map(F),F.forEach((U,J)=>F.set(J,S0)));let W=R===!0||T.navigation.formMethod!=null&&Ea(T.navigation.formMethod)&&((mt=ue.state)==null?void 0:mt._isRedirect)!==!0;a&&(o=a,a=void 0),B||E===pi.Pop||(E===pi.Push?t.history.push(ue,ue.state):E===pi.Replace&&t.history.replace(ue,ue.state));let ae;if(E===pi.Pop){let U=P.get(T.location.pathname);U&&U.has(ue.pathname)?ae={currentLocation:T.location,nextLocation:ue}:P.has(ue.pathname)&&(ae={currentLocation:ue,nextLocation:T.location})}else if(L){let U=P.get(T.location.pathname);U?U.add(ue.pathname):(U=new Set([ue.pathname]),P.set(T.location.pathname,U)),ae={currentLocation:T.location,nextLocation:ue}}$(Lr({},me,{actionData:gt,loaderData:Gt,historyAction:E,location:ue,initialized:!0,navigation:YC,revalidation:"idle",restoreScrollPosition:rn(ue,me.matches||T.matches),preventScrollReset:W,blockers:F}),{viewTransitionOpts:ae,flushSync:bt===!0}),E=pi.Pop,R=!1,L=!1,B=!1,Y=!1,ie=[],ee=[]}async function Ne(ue,me){if(typeof ue=="number"){t.history.go(ue);return}let Se=PT(T.location,T.matches,l,f.v7_prependBasename,ue,f.v7_relativeSplatPath,me==null?void 0:me.fromRouteId,me==null?void 0:me.relative),{path:Ge,submission:mt,error:bt}=vk(f.v7_normalizeFormMethod,!1,Se,me),ot=T.location,gt=d1(T.location,Ge,me&&me.state);gt=Lr({},gt,t.history.encodeLocation(gt));let Gt=me&&me.replace!=null?me.replace:void 0,F=pi.Push;Gt===!0?F=pi.Replace:Gt===!1||mt!=null&&Ea(mt.formMethod)&&mt.formAction===T.location.pathname+T.location.search&&(F=pi.Replace);let W=me&&"preventScrollReset"in me?me.preventScrollReset===!0:void 0,ae=(me&&me.unstable_flushSync)===!0,U=fe({currentLocation:ot,nextLocation:gt,historyAction:F});if(U){st(U,{state:"blocked",location:gt,proceed(){st(U,{state:"proceeding",proceed:void 0,reset:void 0,location:gt}),Ne(ue,me)},reset(){let J=new Map(T.blockers);J.set(U,S0),$({blockers:J})}});return}return await Ue(F,gt,{submission:mt,pendingError:bt,preventScrollReset:W,replace:me&&me.replace,enableViewTransition:me&&me.unstable_viewTransition,flushSync:ae})}function ze(){if(Qe(),$({revalidation:"loading"}),T.navigation.state!=="submitting"){if(T.navigation.state==="idle"){Ue(T.historyAction,T.location,{startUninterruptedRevalidation:!0});return}Ue(E||T.historyAction,T.navigation.location,{overrideNavigation:T.navigation})}}async function Ue(ue,me,Se){C&&C.abort(),C=null,E=ue,B=(Se&&Se.startUninterruptedRevalidation)===!0,Jt(T.location,T.matches),R=(Se&&Se.preventScrollReset)===!0,L=(Se&&Se.enableViewTransition)===!0;let Ge=a||o,mt=Se&&Se.overrideNavigation,bt=Nf(Ge,me,l),ot=(Se&&Se.flushSync)===!0,gt=Jn(bt,Ge,me.pathname);if(gt.active&>.matches&&(bt=gt.matches),!bt){let{error:K,notFoundMatches:se,route:te}=Pe(me.pathname);Ce(me,{matches:se,loaderData:{},errors:{[te.id]:K}},{flushSync:ot});return}if(T.initialized&&!Y&&xK(T.location,me)&&!(Se&&Se.submission&&Ea(Se.submission.formMethod))){Ce(me,{matches:bt},{flushSync:ot});return}C=new AbortController;let Gt=mh(t.history,me,C.signal,Se&&Se.submission),F;if(Se&&Se.pendingError)F=[Ag(bt).route.id,{type:yr.error,error:Se.pendingError}];else if(Se&&Se.submission&&Ea(Se.submission.formMethod)){let K=await Et(Gt,me,Se.submission,bt,gt.active,{replace:Se.replace,flushSync:ot});if(K.shortCircuited)return;if(K.pendingActionResult){let[se,te]=K.pendingActionResult;if(fo(te)&&ab(te.error)&&te.error.status===404){C=null,Ce(me,{matches:K.matches,loaderData:{},errors:{[se]:te.error}});return}}bt=K.matches||bt,F=K.pendingActionResult,mt=QC(me,Se.submission),ot=!1,gt.active=!1,Gt=mh(t.history,Gt.url,Gt.signal)}let{shortCircuited:W,matches:ae,loaderData:U,errors:J}=await lt(Gt,me,bt,gt.active,mt,Se&&Se.submission,Se&&Se.fetcherSubmission,Se&&Se.replace,Se&&Se.initialHydration===!0,ot,F);W||(C=null,Ce(me,Lr({matches:ae||bt},Ck(F),{loaderData:U,errors:J})))}async function Et(ue,me,Se,Ge,mt,bt){bt===void 0&&(bt={}),Qe();let ot=AK(me,Se);if($({navigation:ot},{flushSync:bt.flushSync===!0}),mt){let F=await jn(Ge,me.pathname,ue.signal);if(F.type==="aborted")return{shortCircuited:!0};if(F.type==="error"){let{error:W,notFoundMatches:ae,route:U}=rt(me.pathname,F);return{matches:ae,pendingActionResult:[U.id,{type:yr.error,error:W}]}}else if(F.matches)Ge=F.matches;else{let{notFoundMatches:W,error:ae,route:U}=Pe(me.pathname);return{matches:W,pendingActionResult:[U.id,{type:yr.error,error:ae}]}}}let gt,Gt=og(Ge,me);if(!Gt.route.action&&!Gt.route.lazy)gt={type:yr.error,error:Ls(405,{method:ue.method,pathname:me.pathname,routeId:Gt.route.id})};else if(gt=(await He("action",ue,[Gt],Ge))[0],ue.signal.aborted)return{shortCircuited:!0};if(Hf(gt)){let F;return bt&&bt.replace!=null?F=bt.replace:F=Mk(gt.response.headers.get("Location"),new URL(ue.url),l)===T.location.pathname+T.location.search,await De(ue,gt,{submission:Se,replace:F}),{shortCircuited:!0}}if(zf(gt))throw Ls(400,{type:"defer-action"});if(fo(gt)){let F=Ag(Ge,Gt.route.id);return(bt&&bt.replace)!==!0&&(E=pi.Push),{matches:Ge,pendingActionResult:[F.route.id,gt]}}return{matches:Ge,pendingActionResult:[Gt.route.id,gt]}}async function lt(ue,me,Se,Ge,mt,bt,ot,gt,Gt,F,W){let ae=mt||QC(me,bt),U=bt||ot||Ik(ae),J=!B&&(!f.v7_partialHydration||!Gt);if(Ge){if(J){let St=yt(W);$(Lr({navigation:ae},St!==void 0?{actionData:St}:{}),{flushSync:F})}let qe=await jn(Se,me.pathname,ue.signal);if(qe.type==="aborted")return{shortCircuited:!0};if(qe.type==="error"){let{error:St,notFoundMatches:at,route:Oe}=rt(me.pathname,qe);return{matches:at,loaderData:{},errors:{[Oe.id]:St}}}else if(qe.matches)Se=qe.matches;else{let{error:St,notFoundMatches:at,route:Oe}=Pe(me.pathname);return{matches:at,loaderData:{},errors:{[Oe.id]:St}}}}let K=a||o,[se,te]=yk(t.history,T,Se,U,me,f.v7_partialHydration&&Gt===!0,f.unstable_skipActionErrorRevalidation,Y,ie,ee,ce,_e,de,K,l,W);if(It(qe=>!(Se&&Se.some(St=>St.route.id===qe))||se&&se.some(St=>St.route.id===qe)),q=++j,se.length===0&&te.length===0){let qe=Tt();return Ce(me,Lr({matches:Se,loaderData:{},errors:W&&fo(W[1])?{[W[0]]:W[1].error}:null},Ck(W),qe?{fetchers:new Map(T.fetchers)}:{}),{flushSync:F}),{shortCircuited:!0}}if(J){let qe={};if(!Ge){qe.navigation=ae;let St=yt(W);St!==void 0&&(qe.actionData=St)}te.length>0&&(qe.fetchers=re(te)),$(qe,{flushSync:F})}te.forEach(qe=>{le.has(qe.key)&&We(qe.key),qe.controller&&le.set(qe.key,qe.controller)});let ve=()=>te.forEach(qe=>We(qe.key));C&&C.signal.addEventListener("abort",ve);let{loaderResults:xe,fetcherResults:Te}=await pt(T.matches,Se,se,te,ue);if(ue.signal.aborted)return{shortCircuited:!0};C&&C.signal.removeEventListener("abort",ve),te.forEach(qe=>le.delete(qe.key));let Ae=Ak([...xe,...Te]);if(Ae){if(Ae.idx>=se.length){let qe=te[Ae.idx-se.length].key;de.add(qe)}return await De(ue,Ae.result,{replace:gt}),{shortCircuited:!0}}let{loaderData:ht,errors:Ve}=bk(T,Se,se,xe,W,te,Te,we);we.forEach((qe,St)=>{qe.subscribe(at=>{(at||qe.done)&&we.delete(St)})}),f.v7_partialHydration&&Gt&&T.errors&&Object.entries(T.errors).filter(qe=>{let[St]=qe;return!se.some(at=>at.route.id===St)}).forEach(qe=>{let[St,at]=qe;Ve=Object.assign(Ve||{},{[St]:at})});let $e=Tt(),ft=Ft(q),Mt=$e||ft||te.length>0;return Lr({matches:Se,loaderData:ht,errors:Ve},Mt?{fetchers:new Map(T.fetchers)}:{})}function yt(ue){if(ue&&!fo(ue[1]))return{[ue[0]]:ue[1].data};if(T.actionData)return Object.keys(T.actionData).length===0?null:T.actionData}function re(ue){return ue.forEach(me=>{let Se=T.fetchers.get(me.key),Ge=C0(void 0,Se?Se.data:void 0);T.fetchers.set(me.key,Ge)}),new Map(T.fetchers)}function V(ue,me,Se,Ge){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");le.has(ue)&&We(ue);let mt=(Ge&&Ge.unstable_flushSync)===!0,bt=a||o,ot=PT(T.location,T.matches,l,f.v7_prependBasename,Se,f.v7_relativeSplatPath,me,Ge==null?void 0:Ge.relative),gt=Nf(bt,ot,l),Gt=Jn(gt,bt,ot);if(Gt.active&&Gt.matches&&(gt=Gt.matches),!gt){Ke(ue,me,Ls(404,{pathname:ot}),{flushSync:mt});return}let{path:F,submission:W,error:ae}=vk(f.v7_normalizeFormMethod,!0,ot,Ge);if(ae){Ke(ue,me,ae,{flushSync:mt});return}let U=og(gt,F);if(R=(Ge&&Ge.preventScrollReset)===!0,W&&Ea(W.formMethod)){Ee(ue,me,F,U,gt,Gt.active,mt,W);return}_e.set(ue,{routeId:me,path:F}),je(ue,me,F,U,gt,Gt.active,mt,W)}async function Ee(ue,me,Se,Ge,mt,bt,ot,gt){Qe(),_e.delete(ue);function Gt(Oe){if(!Oe.route.action&&!Oe.route.lazy){let kt=Ls(405,{method:gt.formMethod,pathname:Se,routeId:me});return Ke(ue,me,kt,{flushSync:ot}),!0}return!1}if(!bt&&Gt(Ge))return;let F=T.fetchers.get(ue);Ye(ue,TK(gt,F),{flushSync:ot});let W=new AbortController,ae=mh(t.history,Se,W.signal,gt);if(bt){let Oe=await jn(mt,Se,ae.signal);if(Oe.type==="aborted")return;if(Oe.type==="error"){let{error:kt}=rt(Se,Oe);Ke(ue,me,kt,{flushSync:ot});return}else if(Oe.matches){if(mt=Oe.matches,Ge=og(mt,Se),Gt(Ge))return}else{Ke(ue,me,Ls(404,{pathname:Se}),{flushSync:ot});return}}le.set(ue,W);let U=j,K=(await He("action",ae,[Ge],mt))[0];if(ae.signal.aborted){le.get(ue)===W&&le.delete(ue);return}if(f.v7_fetcherPersist&&ce.has(ue)){if(Hf(K)||fo(K)){Ye(ue,jc(void 0));return}}else{if(Hf(K))if(le.delete(ue),q>U){Ye(ue,jc(void 0));return}else return de.add(ue),Ye(ue,C0(gt)),De(ae,K,{fetcherSubmission:gt});if(fo(K)){Ke(ue,me,K.error);return}}if(zf(K))throw Ls(400,{type:"defer-action"});let se=T.navigation.location||T.location,te=mh(t.history,se,W.signal),ve=a||o,xe=T.navigation.state!=="idle"?Nf(ve,T.navigation.location,l):T.matches;Ln(xe,"Didn't find any matches after fetcher action");let Te=++j;ne.set(ue,Te);let Ae=C0(gt,K.data);T.fetchers.set(ue,Ae);let[ht,Ve]=yk(t.history,T,xe,gt,se,!1,f.unstable_skipActionErrorRevalidation,Y,ie,ee,ce,_e,de,ve,l,[Ge.route.id,K]);Ve.filter(Oe=>Oe.key!==ue).forEach(Oe=>{let kt=Oe.key,Pt=T.fetchers.get(kt),Ut=C0(void 0,Pt?Pt.data:void 0);T.fetchers.set(kt,Ut),le.has(kt)&&We(kt),Oe.controller&&le.set(kt,Oe.controller)}),$({fetchers:new Map(T.fetchers)});let $e=()=>Ve.forEach(Oe=>We(Oe.key));W.signal.addEventListener("abort",$e);let{loaderResults:ft,fetcherResults:Mt}=await pt(T.matches,xe,ht,Ve,te);if(W.signal.aborted)return;W.signal.removeEventListener("abort",$e),ne.delete(ue),le.delete(ue),Ve.forEach(Oe=>le.delete(Oe.key));let qe=Ak([...ft,...Mt]);if(qe){if(qe.idx>=ht.length){let Oe=Ve[qe.idx-ht.length].key;de.add(Oe)}return De(te,qe.result)}let{loaderData:St,errors:at}=bk(T,T.matches,ht,ft,void 0,Ve,Mt,we);if(T.fetchers.has(ue)){let Oe=jc(K.data);T.fetchers.set(ue,Oe)}Ft(Te),T.navigation.state==="loading"&&Te>q?(Ln(E,"Expected pending action"),C&&C.abort(),Ce(T.navigation.location,{matches:xe,loaderData:St,errors:at,fetchers:new Map(T.fetchers)})):($({errors:at,loaderData:Sk(T.loaderData,St,xe,at),fetchers:new Map(T.fetchers)}),Y=!1)}async function je(ue,me,Se,Ge,mt,bt,ot,gt){let Gt=T.fetchers.get(ue);Ye(ue,C0(gt,Gt?Gt.data:void 0),{flushSync:ot});let F=new AbortController,W=mh(t.history,Se,F.signal);if(bt){let K=await jn(mt,Se,W.signal);if(K.type==="aborted")return;if(K.type==="error"){let{error:se}=rt(Se,K);Ke(ue,me,se,{flushSync:ot});return}else if(K.matches)mt=K.matches,Ge=og(mt,Se);else{Ke(ue,me,Ls(404,{pathname:Se}),{flushSync:ot});return}}le.set(ue,F);let ae=j,J=(await He("loader",W,[Ge],mt))[0];if(zf(J)&&(J=await _z(J,W.signal,!0)||J),le.get(ue)===F&&le.delete(ue),!W.signal.aborted){if(ce.has(ue)){Ye(ue,jc(void 0));return}if(Hf(J))if(q>ae){Ye(ue,jc(void 0));return}else{de.add(ue),await De(W,J);return}if(fo(J)){Ke(ue,me,J.error);return}Ln(!zf(J),"Unhandled fetcher deferred data"),Ye(ue,jc(J.data))}}async function De(ue,me,Se){let{submission:Ge,fetcherSubmission:mt,replace:bt}=Se===void 0?{}:Se;me.response.headers.has("X-Remix-Revalidate")&&(Y=!0);let ot=me.response.headers.get("Location");Ln(ot,"Expected a Location header on the redirect Response"),ot=Mk(ot,new URL(ue.url),l);let gt=d1(T.location,ot,{_isRedirect:!0});if(n){let J=!1;if(me.response.headers.has("X-Remix-Reload-Document"))J=!0;else if(qL.test(ot)){const K=t.history.createURL(ot);J=K.origin!==e.location.origin||ev(K.pathname,l)==null}if(J){bt?e.location.replace(ot):e.location.assign(ot);return}}C=null;let Gt=bt===!0?pi.Replace:pi.Push,{formMethod:F,formAction:W,formEncType:ae}=T.navigation;!Ge&&!mt&&F&&W&&ae&&(Ge=Ik(T.navigation));let U=Ge||mt;if(lK.has(me.response.status)&&U&&Ea(U.formMethod))await Ue(Gt,gt,{submission:Lr({},U,{formAction:ot}),preventScrollReset:R});else{let J=QC(gt,Ge);await Ue(Gt,gt,{overrideNavigation:J,fetcherSubmission:mt,preventScrollReset:R})}}async function He(ue,me,Se,Ge){try{let mt=await vK(c,ue,me,Se,Ge,s,i);return await Promise.all(mt.map((bt,ot)=>{if(SK(bt)){let gt=bt.result;return{type:yr.redirect,response:_K(gt,me,Se[ot].route.id,Ge,l,f.v7_relativeSplatPath)}}return wK(bt)}))}catch(mt){return Se.map(()=>({type:yr.error,error:mt}))}}async function pt(ue,me,Se,Ge,mt){let[bt,...ot]=await Promise.all([Se.length?He("loader",mt,Se,me):[],...Ge.map(gt=>{if(gt.matches&>.match&>.controller){let Gt=mh(t.history,gt.path,gt.controller.signal);return He("loader",Gt,[gt.match],gt.matches).then(F=>F[0])}else return Promise.resolve({type:yr.error,error:Ls(404,{pathname:gt.path})})})]);return await Promise.all([Tk(ue,Se,bt,bt.map(()=>mt.signal),!1,T.loaderData),Tk(ue,Ge.map(gt=>gt.match),ot,Ge.map(gt=>gt.controller?gt.controller.signal:null),!0)]),{loaderResults:bt,fetcherResults:ot}}function Qe(){Y=!0,ie.push(...It()),_e.forEach((ue,me)=>{le.has(me)&&(ee.push(me),We(me))})}function Ye(ue,me,Se){Se===void 0&&(Se={}),T.fetchers.set(ue,me),$({fetchers:new Map(T.fetchers)},{flushSync:(Se&&Se.flushSync)===!0})}function Ke(ue,me,Se,Ge){Ge===void 0&&(Ge={});let mt=Ag(T.matches,me);_t(ue),$({errors:{[mt.route.id]:Se},fetchers:new Map(T.fetchers)},{flushSync:(Ge&&Ge.flushSync)===!0})}function nt(ue){return f.v7_fetcherPersist&&(ge.set(ue,(ge.get(ue)||0)+1),ce.has(ue)&&ce.delete(ue)),T.fetchers.get(ue)||cK}function _t(ue){let me=T.fetchers.get(ue);le.has(ue)&&!(me&&me.state==="loading"&&ne.has(ue))&&We(ue),_e.delete(ue),ne.delete(ue),de.delete(ue),ce.delete(ue),T.fetchers.delete(ue)}function Qt(ue){if(f.v7_fetcherPersist){let me=(ge.get(ue)||0)-1;me<=0?(ge.delete(ue),ce.add(ue)):ge.set(ue,me)}else _t(ue);$({fetchers:new Map(T.fetchers)})}function We(ue){let me=le.get(ue);Ln(me,"Expected fetch controller: "+ue),me.abort(),le.delete(ue)}function Ze(ue){for(let me of ue){let Se=nt(me),Ge=jc(Se.data);T.fetchers.set(me,Ge)}}function Tt(){let ue=[],me=!1;for(let Se of de){let Ge=T.fetchers.get(Se);Ln(Ge,"Expected fetcher: "+Se),Ge.state==="loading"&&(de.delete(Se),ue.push(Se),me=!0)}return Ze(ue),me}function Ft(ue){let me=[];for(let[Se,Ge]of ne)if(Ge0}function en(ue,me){let Se=T.blockers.get(ue)||S0;return he.get(ue)!==me&&he.set(ue,me),Se}function pe(ue){T.blockers.delete(ue),he.delete(ue)}function st(ue,me){let Se=T.blockers.get(ue)||S0;Ln(Se.state==="unblocked"&&me.state==="blocked"||Se.state==="blocked"&&me.state==="blocked"||Se.state==="blocked"&&me.state==="proceeding"||Se.state==="blocked"&&me.state==="unblocked"||Se.state==="proceeding"&&me.state==="unblocked","Invalid blocker state transition: "+Se.state+" -> "+me.state);let Ge=new Map(T.blockers);Ge.set(ue,me),$({blockers:Ge})}function fe(ue){let{currentLocation:me,nextLocation:Se,historyAction:Ge}=ue;if(he.size===0)return;he.size>1&&Gp(!1,"A router only supports one blocker at a time");let mt=Array.from(he.entries()),[bt,ot]=mt[mt.length-1],gt=T.blockers.get(bt);if(!(gt&>.state==="proceeding")&&ot({currentLocation:me,nextLocation:Se,historyAction:Ge}))return bt}function Pe(ue){let me=Ls(404,{pathname:ue}),Se=a||o,{matches:Ge,route:mt}=Ek(Se);return It(),{notFoundMatches:Ge,route:mt,error:me}}function rt(ue,me){let Se=me.partialMatches,Ge=Se[Se.length-1].route,mt=Ls(400,{type:"route-discovery",routeId:Ge.id,pathname:ue,message:me.error!=null&&"message"in me.error?me.error:String(me.error)});return{notFoundMatches:Se,route:Ge,error:mt}}function It(ue){let me=[];return we.forEach((Se,Ge)=>{(!ue||ue(Ge))&&(Se.cancel(),me.push(Ge),we.delete(Ge))}),me}function Le(ue,me,Se){if(v=ue,y=me,w=Se||null,!g&&T.navigation===YC){g=!0;let Ge=rn(T.location,T.matches);Ge!=null&&$({restoreScrollPosition:Ge})}return()=>{v=null,y=null,w=null}}function At(ue,me){return w&&w(ue,me.map(Ge=>jX(Ge,T.loaderData)))||ue.key}function Jt(ue,me){if(v&&y){let Se=At(ue,me);v[Se]=y()}}function rn(ue,me){if(v){let Se=At(ue,me),Ge=v[Se];if(typeof Ge=="number")return Ge}return null}function Jn(ue,me,Se){if(u)if(ue){if(ue[ue.length-1].route.path==="*")return{active:!0,matches:D_(me,Se,l,!0)}}else return{active:!0,matches:D_(me,Se,l,!0)||[]};return{active:!1,matches:null}}async function jn(ue,me,Se){let Ge=ue,mt=Ge.length>0?Ge[Ge.length-1].route:null;for(;;){try{await mK(u,me,Ge,o||a,s,i,Ie,Se)}catch(F){return{type:"error",error:F,partialMatches:Ge}}if(Se.aborted)return{type:"aborted"};let bt=a||o,ot=Nf(bt,me,l),gt=!1;if(ot){let F=ot[ot.length-1].route;if(F.index)return{type:"success",matches:ot};if(F.path&&F.path.length>0)if(F.path==="*")gt=!0;else return{type:"success",matches:ot}}let Gt=D_(bt,me,l,!0);if(!Gt||Ge.map(F=>F.route.id).join("-")===Gt.map(F=>F.route.id).join("-"))return{type:"success",matches:gt?ot:null};if(Ge=Gt,mt=Ge[Ge.length-1].route,mt.path==="*")return{type:"success",matches:Ge}}}function vn(ue){s={},a=h1(ue,i,void 0,s)}return D={get basename(){return l},get future(){return f},get state(){return T},get routes(){return o},get window(){return e},initialize:ct,subscribe:ut,enableScrollRestoration:Le,navigate:Ne,fetch:V,revalidate:ze,createHref:ue=>t.history.createHref(ue),encodeLocation:ue=>t.history.encodeLocation(ue),getFetcher:nt,deleteFetcher:Qt,dispose:it,getBlocker:en,deleteBlocker:pe,patchRoutes(ue,me){return vz(ue,me,o||a,s,i)},_internalFetchControllers:le,_internalActiveDeferreds:we,_internalSetRoutes:vn},D}function dK(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function PT(t,e,n,r,i,s,o,a){let l,c;if(o){l=[];for(let f of e)if(l.push(f),f.route.id===o){c=f;break}}else l=e,c=e[e.length-1];let u=KL(i||".",XL(l,s),ev(t.pathname,n)||t.pathname,a==="path");return i==null&&(u.search=t.search,u.hash=t.hash),(i==null||i===""||i===".")&&c&&c.route.index&&!e4(u.search)&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(u.pathname=u.pathname==="/"?n:hu([n,u.pathname])),q1(u)}function vk(t,e,n,r){if(!r||!dK(r))return{path:n};if(r.formMethod&&!EK(r.formMethod))return{path:n,error:Ls(405,{method:r.formMethod})};let i=()=>({path:n,error:Ls(400,{type:"invalid-body"})}),s=r.formMethod||"get",o=t?s.toUpperCase():s.toLowerCase(),a=yz(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!Ea(o))return i();let h=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((m,v)=>{let[w,y]=v;return""+m+w+"="+y+`
+`},""):String(r.body);return{path:n,submission:{formMethod:o,formAction:a,formEncType:r.formEncType,formData:void 0,json:void 0,text:h}}}else if(r.formEncType==="application/json"){if(!Ea(o))return i();try{let h=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:o,formAction:a,formEncType:r.formEncType,formData:void 0,json:h,text:void 0}}}catch{return i()}}}Ln(typeof FormData=="function","FormData is not available in this environment");let l,c;if(r.formData)l=DT(r.formData),c=r.formData;else if(r.body instanceof FormData)l=DT(r.body),c=r.body;else if(r.body instanceof URLSearchParams)l=r.body,c=xk(l);else if(r.body==null)l=new URLSearchParams,c=new FormData;else try{l=new URLSearchParams(r.body),c=xk(l)}catch{return i()}let u={formMethod:o,formAction:a,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:c,json:void 0,text:void 0};if(Ea(u.formMethod))return{path:n,submission:u};let f=Du(n);return e&&f.search&&e4(f.search)&&l.append("index",""),f.search="?"+l,{path:q1(f),submission:u}}function hK(t,e){let n=t;if(e){let r=t.findIndex(i=>i.route.id===e);r>=0&&(n=t.slice(0,r))}return n}function yk(t,e,n,r,i,s,o,a,l,c,u,f,h,m,v,w){let y=w?fo(w[1])?w[1].error:w[1].data:void 0,g=t.createURL(e.location),_=t.createURL(i),x=w&&fo(w[1])?w[0]:void 0,S=x?hK(n,x):n,D=w?w[1].statusCode:void 0,T=o&&D&&D>=400,E=S.filter((C,L)=>{let{route:P}=C;if(P.lazy)return!0;if(P.loader==null)return!1;if(s)return typeof P.loader!="function"||P.loader.hydrate?!0:e.loaderData[P.id]===void 0&&(!e.errors||e.errors[P.id]===void 0);if(pK(e.loaderData,e.matches[L],C)||l.some(Y=>Y===C.route.id))return!0;let z=e.matches[L],B=C;return wk(C,Lr({currentUrl:g,currentParams:z.params,nextUrl:_,nextParams:B.params},r,{actionResult:y,unstable_actionStatus:D,defaultShouldRevalidate:T?!1:a||g.pathname+g.search===_.pathname+_.search||g.search!==_.search||gz(z,B)}))}),R=[];return f.forEach((C,L)=>{if(s||!n.some(ie=>ie.route.id===C.routeId)||u.has(L))return;let P=Nf(m,C.path,v);if(!P){R.push({key:L,routeId:C.routeId,path:C.path,matches:null,match:null,controller:null});return}let z=e.fetchers.get(L),B=og(P,C.path),Y=!1;h.has(L)?Y=!1:c.includes(L)?Y=!0:z&&z.state!=="idle"&&z.data===void 0?Y=a:Y=wk(B,Lr({currentUrl:g,currentParams:e.matches[e.matches.length-1].params,nextUrl:_,nextParams:n[n.length-1].params},r,{actionResult:y,unstable_actionStatus:D,defaultShouldRevalidate:T?!1:a})),Y&&R.push({key:L,routeId:C.routeId,path:C.path,matches:P,match:B,controller:new AbortController})}),[E,R]}function pK(t,e,n){let r=!e||n.route.id!==e.route.id,i=t[n.route.id]===void 0;return r||i}function gz(t,e){let n=t.route.path;return t.pathname!==e.pathname||n!=null&&n.endsWith("*")&&t.params["*"]!==e.params["*"]}function wk(t,e){if(t.route.shouldRevalidate){let n=t.route.shouldRevalidate(e);if(typeof n=="boolean")return n}return e.defaultShouldRevalidate}async function mK(t,e,n,r,i,s,o,a){let l=[e,...n.map(c=>c.route.id)].join("-");try{let c=o.get(l);c||(c=t({path:e,matches:n,patch:(u,f)=>{a.aborted||vz(u,f,r,i,s)}}),o.set(l,c)),c&&bK(c)&&await c}finally{o.delete(l)}}function vz(t,e,n,r,i){if(t){var s;let o=r[t];Ln(o,"No route found to patch children into: routeId = "+t);let a=h1(e,i,[t,"patch",String(((s=o.children)==null?void 0:s.length)||"0")],r);o.children?o.children.push(...a):o.children=a}else{let o=h1(e,i,["patch",String(n.length||"0")],r);n.push(...o)}}async function _k(t,e,n){if(!t.lazy)return;let r=await t.lazy();if(!t.lazy)return;let i=n[t.id];Ln(i,"No route found in manifest");let s={};for(let o in r){let l=i[o]!==void 0&&o!=="hasErrorBoundary";Gp(!l,'Route "'+i.id+'" has a static property "'+o+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+o+'" will be ignored.')),!l&&!UX.has(o)&&(s[o]=r[o])}Object.assign(i,s),Object.assign(i,Lr({},e(i),{lazy:void 0}))}function gK(t){return Promise.all(t.matches.map(e=>e.resolve()))}async function vK(t,e,n,r,i,s,o,a){let l=r.reduce((f,h)=>f.add(h.route.id),new Set),c=new Set,u=await t({matches:i.map(f=>{let h=l.has(f.route.id);return Lr({},f,{shouldLoad:h,resolve:v=>(c.add(f.route.id),h?yK(e,n,f,s,o,v,a):Promise.resolve({type:yr.data,result:void 0}))})}),request:n,params:i[0].params,context:a});return i.forEach(f=>Ln(c.has(f.route.id),'`match.resolve()` was not called for route id "'+f.route.id+'". You must call `match.resolve()` on every match passed to `dataStrategy` to ensure all routes are properly loaded.')),u.filter((f,h)=>l.has(i[h].route.id))}async function yK(t,e,n,r,i,s,o){let a,l,c=u=>{let f,h=new Promise((w,y)=>f=y);l=()=>f(),e.signal.addEventListener("abort",l);let m=w=>typeof u!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+t+'" [routeId: '+n.route.id+"]"))):u({request:e,params:n.params,context:o},...w!==void 0?[w]:[]),v;return s?v=s(w=>m(w)):v=(async()=>{try{return{type:"data",result:await m()}}catch(w){return{type:"error",result:w}}})(),Promise.race([v,h])};try{let u=n.route[t];if(n.route.lazy)if(u){let f,[h]=await Promise.all([c(u).catch(m=>{f=m}),_k(n.route,i,r)]);if(f!==void 0)throw f;a=h}else if(await _k(n.route,i,r),u=n.route[t],u)a=await c(u);else if(t==="action"){let f=new URL(e.url),h=f.pathname+f.search;throw Ls(405,{method:e.method,pathname:h,routeId:n.route.id})}else return{type:yr.data,result:void 0};else if(u)a=await c(u);else{let f=new URL(e.url),h=f.pathname+f.search;throw Ls(404,{pathname:h})}Ln(a.result!==void 0,"You defined "+(t==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+t+"` ")+"function. Please return a value or `null`.")}catch(u){return{type:yr.error,result:u}}finally{l&&e.signal.removeEventListener("abort",l)}return a}async function wK(t){let{result:e,type:n,status:r}=t;if(wz(e)){let o;try{let a=e.headers.get("Content-Type");a&&/\bapplication\/json\b/.test(a)?e.body==null?o=null:o=await e.json():o=await e.text()}catch(a){return{type:yr.error,error:a}}return n===yr.error?{type:yr.error,error:new ZL(e.status,e.statusText,o),statusCode:e.status,headers:e.headers}:{type:yr.data,data:o,statusCode:e.status,headers:e.headers}}if(n===yr.error)return{type:yr.error,error:e,statusCode:ab(e)?e.status:r};if(CK(e)){var i,s;return{type:yr.deferred,deferredData:e,statusCode:(i=e.init)==null?void 0:i.status,headers:((s=e.init)==null?void 0:s.headers)&&new Headers(e.init.headers)}}return{type:yr.data,data:e,statusCode:r}}function _K(t,e,n,r,i,s){let o=t.headers.get("Location");if(Ln(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!qL.test(o)){let a=r.slice(0,r.findIndex(l=>l.route.id===n)+1);o=PT(new URL(e.url),a,i,!0,o,s),t.headers.set("Location",o)}return t}function Mk(t,e,n){if(qL.test(t)){let r=t,i=r.startsWith("//")?new URL(e.protocol+r):new URL(r),s=ev(i.pathname,n)!=null;if(i.origin===e.origin&&s)return i.pathname+i.search+i.hash}return t}function mh(t,e,n,r){let i=t.createURL(yz(e)).toString(),s={signal:n};if(r&&Ea(r.formMethod)){let{formMethod:o,formEncType:a}=r;s.method=o.toUpperCase(),a==="application/json"?(s.headers=new Headers({"Content-Type":a}),s.body=JSON.stringify(r.json)):a==="text/plain"?s.body=r.text:a==="application/x-www-form-urlencoded"&&r.formData?s.body=DT(r.formData):s.body=r.formData}return new Request(i,s)}function DT(t){let e=new URLSearchParams;for(let[n,r]of t.entries())e.append(n,typeof r=="string"?r:r.name);return e}function xk(t){let e=new FormData;for(let[n,r]of t.entries())e.append(n,r);return e}function MK(t,e,n,r,i,s){let o={},a=null,l,c=!1,u={},f=r&&fo(r[1])?r[1].error:void 0;return n.forEach((h,m)=>{let v=e[m].route.id;if(Ln(!Hf(h),"Cannot handle redirect results in processLoaderData"),fo(h)){let w=h.error;f!==void 0&&(w=f,f=void 0),a=a||{};{let y=Ag(t,v);a[y.route.id]==null&&(a[y.route.id]=w)}o[v]=void 0,c||(c=!0,l=ab(h.error)?h.error.status:500),h.headers&&(u[v]=h.headers)}else zf(h)?(i.set(v,h.deferredData),o[v]=h.deferredData.data,h.statusCode!=null&&h.statusCode!==200&&!c&&(l=h.statusCode),h.headers&&(u[v]=h.headers)):(o[v]=h.data,h.statusCode&&h.statusCode!==200&&!c&&(l=h.statusCode),h.headers&&(u[v]=h.headers))}),f!==void 0&&r&&(a={[r[0]]:f},o[r[0]]=void 0),{loaderData:o,errors:a,statusCode:l||200,loaderHeaders:u}}function bk(t,e,n,r,i,s,o,a){let{loaderData:l,errors:c}=MK(e,n,r,i,a);for(let u=0;ur.route.id===e)+1):[...t]).reverse().find(r=>r.route.hasErrorBoundary===!0)||t[0]}function Ek(t){let e=t.length===1?t[0]:t.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:e}],route:e}}function Ls(t,e){let{pathname:n,routeId:r,method:i,type:s,message:o}=e===void 0?{}:e,a="Unknown Server Error",l="Unknown @remix-run/router error";return t===400?(a="Bad Request",s==="route-discovery"?l='Unable to match URL "'+n+'" - the `children()` function for '+("route `"+r+"` threw the following error:\n"+o):i&&n&&r?l="You made a "+i+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":s==="defer-action"?l="defer() is not supported in actions":s==="invalid-body"&&(l="Unable to encode submission body")):t===403?(a="Forbidden",l='Route "'+r+'" does not match URL "'+n+'"'):t===404?(a="Not Found",l='No route matches URL "'+n+'"'):t===405&&(a="Method Not Allowed",i&&n&&r?l="You made a "+i.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":i&&(l='Invalid request method "'+i.toUpperCase()+'"')),new ZL(t||500,a,new Error(l),!0)}function Ak(t){for(let e=t.length-1;e>=0;e--){let n=t[e];if(Hf(n))return{result:n,idx:e}}}function yz(t){let e=typeof t=="string"?Du(t):t;return q1(Lr({},e,{hash:""}))}function xK(t,e){return t.pathname!==e.pathname||t.search!==e.search?!1:t.hash===""?e.hash!=="":t.hash===e.hash?!0:e.hash!==""}function bK(t){return typeof t=="object"&&t!=null&&"then"in t}function SK(t){return wz(t.result)&&aK.has(t.result.status)}function zf(t){return t.type===yr.deferred}function fo(t){return t.type===yr.error}function Hf(t){return(t&&t.type)===yr.redirect}function CK(t){let e=t;return e&&typeof e=="object"&&typeof e.data=="object"&&typeof e.subscribe=="function"&&typeof e.cancel=="function"&&typeof e.resolveData=="function"}function wz(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function EK(t){return oK.has(t.toLowerCase())}function Ea(t){return iK.has(t.toLowerCase())}async function Tk(t,e,n,r,i,s){for(let o=0;of.route.id===l.route.id),u=c!=null&&!gz(c,l)&&(s&&s[l.route.id])!==void 0;if(zf(a)&&(i||u)){let f=r[o];Ln(f,"Expected an AbortSignal for revalidating fetcher deferred result"),await _z(a,f,i).then(h=>{h&&(n[o]=h||n[o])})}}}async function _z(t,e,n){if(n===void 0&&(n=!1),!await t.deferredData.resolveData(e)){if(n)try{return{type:yr.data,data:t.deferredData.unwrappedData}}catch(i){return{type:yr.error,error:i}}return{type:yr.data,data:t.deferredData.data}}}function e4(t){return new URLSearchParams(t).getAll("index").some(e=>e==="")}function og(t,e){let n=typeof e=="string"?Du(e).search:e.search;if(t[t.length-1].route.index&&e4(n||""))return t[t.length-1];let r=hz(t);return r[r.length-1]}function Ik(t){let{formMethod:e,formAction:n,formEncType:r,text:i,formData:s,json:o}=t;if(!(!e||!n||!r)){if(i!=null)return{formMethod:e,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(s!=null)return{formMethod:e,formAction:n,formEncType:r,formData:s,json:void 0,text:void 0};if(o!==void 0)return{formMethod:e,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function QC(t,e){return e?{state:"loading",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}:{state:"loading",location:t,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function AK(t,e){return{state:"submitting",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}}function C0(t,e){return t?{state:"loading",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function TK(t,e){return{state:"submitting",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e?e.data:void 0}}function jc(t){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function IK(t,e){try{let n=t.sessionStorage.getItem(mz);if(n){let r=JSON.parse(n);for(let[i,s]of Object.entries(r||{}))s&&Array.isArray(s)&&e.set(i,new Set(s||[]))}}catch{}}function LK(t,e){if(e.size>0){let n={};for(let[r,i]of e)n[r]=[...i];try{t.sessionStorage.setItem(mz,JSON.stringify(n))}catch(r){Gp(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/**
+ * React Router v6.24.0
+ *
+ * Copyright (c) Remix Software Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE.md file in the root directory of this source tree.
+ *
+ * @license MIT
+ */function EM(){return EM=Object.assign?Object.assign.bind():function(t){for(var e=1;e{a.current=!0}),I.useCallback(function(c,u){if(u===void 0&&(u={}),!a.current)return;if(typeof c=="number"){r.go(c);return}let f=KL(c,JSON.parse(o),s,u.relative==="path");t==null&&e!=="/"&&(f.pathname=f.pathname==="/"?e:hu([e,f.pathname])),(u.replace?r.replace:r.push)(f,u.state,u)},[e,r,o,s,t])}const PK=I.createContext(null);function DK(t){let e=I.useContext(Nu).outlet;return e&&I.createElement(PK.Provider,{value:t},e)}function NK(t,e,n,r){nv()||Ln(!1);let{navigator:i}=I.useContext(tv),{matches:s}=I.useContext(Nu),o=s[s.length-1],a=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let c=n4(),u;u=c;let f=u.pathname||"/",h=f;if(l!=="/"){let w=l.replace(/^\//,"").split("/");h="/"+f.replace(/^\//,"").split("/").slice(w.length).join("/")}let m=Nf(t,{pathname:h});return FK(m&&m.map(w=>Object.assign({},w,{params:Object.assign({},a,w.params),pathname:hu([l,i.encodeLocation?i.encodeLocation(w.pathname).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?l:hu([l,i.encodeLocation?i.encodeLocation(w.pathnameBase).pathname:w.pathnameBase])})),s,n,r)}function kK(){let t=Ez(),e=ab(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return I.createElement(I.Fragment,null,I.createElement("h2",null,"Unexpected Application Error!"),I.createElement("h3",{style:{fontStyle:"italic"}},e),n?I.createElement("pre",{style:i},n):null,null)}const BK=I.createElement(kK,null);class OK extends I.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,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?I.createElement(Nu.Provider,{value:this.props.routeContext},I.createElement(xz.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function UK(t){let{routeContext:e,match:n,children:r}=t,i=I.useContext(lb);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),I.createElement(Nu.Provider,{value:e},r)}function FK(t,e,n,r){var i;if(e===void 0&&(e=[]),n===void 0&&(n=null),r===void 0&&(r=null),t==null){var s;if((s=n)!=null&&s.errors)t=n.matches;else return null}let o=t,a=(i=n)==null?void 0:i.errors;if(a!=null){let u=o.findIndex(f=>f.route.id&&(a==null?void 0:a[f.route.id])!==void 0);u>=0||Ln(!1),o=o.slice(0,Math.min(o.length,u+1))}let l=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let u=0;u=0?o=o.slice(0,c+1):o=[o[0]];break}}}return o.reduceRight((u,f,h)=>{let m,v=!1,w=null,y=null;n&&(m=a&&f.route.id?a[f.route.id]:void 0,w=f.route.errorElement||BK,l&&(c<0&&h===0?(v=!0,y=null):c===h&&(v=!0,y=f.route.hydrateFallbackElement||null)));let g=e.concat(o.slice(0,h+1)),_=()=>{let x;return m?x=w:v?x=y:f.route.Component?x=I.createElement(f.route.Component,null):f.route.element?x=f.route.element:x=u,I.createElement(UK,{match:f,routeContext:{outlet:u,matches:g,isDataRoute:n!=null},children:x})};return n&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?I.createElement(OK,{location:n.location,revalidation:n.revalidation,component:w,error:m,children:_(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):_()},null)}var Sz=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(Sz||{}),AM=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(AM||{});function jK(t){let e=I.useContext(lb);return e||Ln(!1),e}function zK(t){let e=I.useContext(Mz);return e||Ln(!1),e}function HK(t){let e=I.useContext(Nu);return e||Ln(!1),e}function Cz(t){let e=HK(),n=e.matches[e.matches.length-1];return n.route.id||Ln(!1),n.route.id}function Ez(){var t;let e=I.useContext(xz),n=zK(AM.UseRouteError),r=Cz(AM.UseRouteError);return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}function GK(){let{router:t}=jK(Sz.UseNavigateStable),e=Cz(AM.UseNavigateStable),n=I.useRef(!1);return bz(()=>{n.current=!0}),I.useCallback(function(i,s){s===void 0&&(s={}),n.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,EM({fromRouteId:e},s)))},[t,e])}function VK(t){let{to:e,replace:n,state:r,relative:i}=t;nv()||Ln(!1);let{future:s,static:o}=I.useContext(tv),{matches:a}=I.useContext(Nu),{pathname:l}=n4(),c=yl(),u=KL(e,XL(a,s.v7_relativeSplatPath),l,i==="path"),f=JSON.stringify(u);return I.useEffect(()=>c(JSON.parse(f),{replace:n,state:r,relative:i}),[c,f,i,n,r]),null}function WK(t){return DK(t.context)}function $K(t){let{basename:e="/",children:n=null,location:r,navigationType:i=pi.Pop,navigator:s,static:o=!1,future:a}=t;nv()&&Ln(!1);let l=e.replace(/^\/*/,"/"),c=I.useMemo(()=>({basename:l,navigator:s,static:o,future:EM({v7_relativeSplatPath:!1},a)}),[l,a,s,o]);typeof r=="string"&&(r=Du(r));let{pathname:u="/",search:f="",hash:h="",state:m=null,key:v="default"}=r,w=I.useMemo(()=>{let y=ev(u,l);return y==null?null:{location:{pathname:y,search:f,hash:h,state:m,key:v},navigationType:i}},[l,u,f,h,m,v,i]);return w==null?null:I.createElement(tv.Provider,{value:c},I.createElement(t4.Provider,{children:n,value:w}))}new Promise(()=>{});function JK(t){let e={hasErrorBoundary:t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&Object.assign(e,{element:I.createElement(t.Component),Component:void 0}),t.HydrateFallback&&Object.assign(e,{hydrateFallbackElement:I.createElement(t.HydrateFallback),HydrateFallback:void 0}),t.ErrorBoundary&&Object.assign(e,{errorElement:I.createElement(t.ErrorBoundary),ErrorBoundary:void 0}),e}/**
+ * React Router DOM v6.24.0
+ *
+ * Copyright (c) Remix Software Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE.md file in the root directory of this source tree.
+ *
+ * @license MIT
+ */function TM(){return TM=Object.assign?Object.assign.bind():function(t){for(var e=1;e{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",e(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}};function iZ(t){let{fallbackElement:e,router:n,future:r}=t,[i,s]=I.useState(n.state),[o,a]=I.useState(),[l,c]=I.useState({isTransitioning:!1}),[u,f]=I.useState(),[h,m]=I.useState(),[v,w]=I.useState(),y=I.useRef(new Map),{v7_startTransition:g}=r||{},_=I.useCallback(E=>{g?nZ(E):E()},[g]),x=I.useCallback((E,R)=>{let{deletedFetchers:C,unstable_flushSync:L,unstable_viewTransitionOpts:P}=R;C.forEach(B=>y.current.delete(B)),E.fetchers.forEach((B,Y)=>{B.data!==void 0&&y.current.set(Y,B.data)});let z=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!P||z){L?E0(()=>s(E)):_(()=>s(E));return}if(L){E0(()=>{h&&(u&&u.resolve(),h.skipTransition()),c({isTransitioning:!0,flushSync:!0,currentLocation:P.currentLocation,nextLocation:P.nextLocation})});let B=n.window.document.startViewTransition(()=>{E0(()=>s(E))});B.finished.finally(()=>{E0(()=>{f(void 0),m(void 0),a(void 0),c({isTransitioning:!1})})}),E0(()=>m(B));return}h?(u&&u.resolve(),h.skipTransition(),w({state:E,currentLocation:P.currentLocation,nextLocation:P.nextLocation})):(a(E),c({isTransitioning:!0,flushSync:!1,currentLocation:P.currentLocation,nextLocation:P.nextLocation}))},[n.window,h,u,y,_]);I.useLayoutEffect(()=>n.subscribe(x),[n,x]),I.useEffect(()=>{l.isTransitioning&&!l.flushSync&&f(new rZ)},[l]),I.useEffect(()=>{if(u&&o&&n.window){let E=o,R=u.promise,C=n.window.document.startViewTransition(async()=>{_(()=>s(E)),await R});C.finished.finally(()=>{f(void 0),m(void 0),a(void 0),c({isTransitioning:!1})}),m(C)}},[_,o,u,n.window]),I.useEffect(()=>{u&&o&&i.location.key===o.location.key&&u.resolve()},[u,h,i.location,o]),I.useEffect(()=>{!l.isTransitioning&&v&&(a(v.state),c({isTransitioning:!0,flushSync:!1,currentLocation:v.currentLocation,nextLocation:v.nextLocation}),w(void 0))},[l.isTransitioning,v]),I.useEffect(()=>{},[]);let S=I.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:E=>n.navigate(E),push:(E,R,C)=>n.navigate(E,{state:R,preventScrollReset:C==null?void 0:C.preventScrollReset}),replace:(E,R,C)=>n.navigate(E,{replace:!0,state:R,preventScrollReset:C==null?void 0:C.preventScrollReset})}),[n]),D=n.basename||"/",T=I.useMemo(()=>({router:n,navigator:S,static:!1,basename:D}),[n,S,D]);return I.createElement(I.Fragment,null,I.createElement(lb.Provider,{value:T},I.createElement(Mz.Provider,{value:i},I.createElement(qK.Provider,{value:y.current},I.createElement(ZK.Provider,{value:l},I.createElement($K,{basename:D,location:i.location,navigationType:i.historyAction,navigator:S,future:{v7_relativeSplatPath:n.future.v7_relativeSplatPath}},i.initialized||n.future.v7_partialHydration?I.createElement(sZ,{routes:n.routes,future:n.future,state:i}):e))))),null)}function sZ(t){let{routes:e,future:n,state:r}=t;return NK(e,void 0,r,n)}var Pk;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(Pk||(Pk={}));var Dk;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(Dk||(Dk={}));var Az={exports:{}},oZ="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",aZ=oZ,lZ=aZ;function Tz(){}function Iz(){}Iz.resetWarningCache=Tz;var cZ=function(){function t(r,i,s,o,a,l){if(l!==lZ){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}}t.isRequired=t;function e(){return t}var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:Iz,resetWarningCache:Tz};return n.PropTypes=n,n};Az.exports=cZ();var uZ=Az.exports;const Cn=_m(uZ);Lz.propTypes={router:Cn.object};function Lz({router:t}){return O.jsx("div",{className:"wrapper",children:O.jsx("div",{className:"content",children:O.jsx(iZ,{router:t})})})}function X(){return X=Object.assign?Object.assign.bind():function(t){for(var e=1;e0?Wi(Sm,--Zs):0,Vp--,gi===10&&(Vp=1,ub--),gi}function So(){return gi=Zs2||m1(gi)>3?"":" "}function EZ(t,e){for(;--e&&So()&&!(gi<48||gi>102||gi>57&&gi<65||gi>70&&gi<97););return rv(t,N_()+(e<6&&il()==32&&So()==32))}function kT(t){for(;So();)switch(gi){case t:return Zs;case 34:case 39:t!==34&&t!==39&&kT(gi);break;case 40:t===41&&kT(t);break;case 92:So();break}return Zs}function AZ(t,e){for(;So()&&t+gi!==57;)if(t+gi===84&&il()===47)break;return"/*"+rv(e,Zs-1)+"*"+cb(t===47?t:So())}function TZ(t){for(;!m1(il());)So();return rv(t,Zs)}function IZ(t){return Oz(B_("",null,null,null,[""],t=Bz(t),0,[0],t))}function B_(t,e,n,r,i,s,o,a,l){for(var c=0,u=0,f=o,h=0,m=0,v=0,w=1,y=1,g=1,_=0,x="",S=i,D=s,T=r,E=x;y;)switch(v=_,_=So()){case 40:if(v!=108&&Wi(E,f-1)==58){NT(E+=rr(k_(_),"&","&\f"),"&\f")!=-1&&(g=-1);break}case 34:case 39:case 91:E+=k_(_);break;case 9:case 10:case 13:case 32:E+=CZ(v);break;case 92:E+=EZ(N_()-1,7);continue;case 47:switch(il()){case 42:case 47:ew(LZ(AZ(So(),N_()),e,n),l);break;default:E+="/"}break;case 123*w:a[c++]=Ka(E)*g;case 125*w:case 59:case 0:switch(_){case 0:case 125:y=0;case 59+u:g==-1&&(E=rr(E,/\f/g,"")),m>0&&Ka(E)-f&&ew(m>32?kk(E+";",r,n,f-1):kk(rr(E," ","")+";",r,n,f-2),l);break;case 59:E+=";";default:if(ew(T=Nk(E,e,n,c,u,i,a,x,S=[],D=[],f),s),_===123)if(u===0)B_(E,e,T,T,S,s,f,a,D);else switch(h===99&&Wi(E,3)===110?100:h){case 100:case 108:case 109:case 115:B_(t,T,T,r&&ew(Nk(t,T,T,0,0,i,a,x,i,S=[],f),D),i,D,f,a,r?S:D);break;default:B_(E,T,T,T,[""],D,0,a,D)}}c=u=m=0,w=g=1,x=E="",f=o;break;case 58:f=1+Ka(E),m=v;default:if(w<1){if(_==123)--w;else if(_==125&&w++==0&&SZ()==125)continue}switch(E+=cb(_),_*w){case 38:g=u>0?1:(E+="\f",-1);break;case 44:a[c++]=(Ka(E)-1)*g,g=1;break;case 64:il()===45&&(E+=k_(So())),h=il(),u=f=Ka(x=E+=TZ(N_())),_++;break;case 45:v===45&&Ka(E)==2&&(w=0)}}return s}function Nk(t,e,n,r,i,s,o,a,l,c,u){for(var f=i-1,h=i===0?s:[""],m=s4(h),v=0,w=0,y=0;v0?h[g]+" "+_:rr(_,/&\f/g,h[g])))&&(l[y++]=x);return fb(t,e,n,i===0?r4:a,l,c,u)}function LZ(t,e,n){return fb(t,e,n,Pz,cb(bZ()),p1(t,2,-2),0)}function kk(t,e,n,r){return fb(t,e,n,i4,p1(t,0,r),p1(t,r+1,-1),r)}function xp(t,e){for(var n="",r=s4(t),i=0;i6)switch(Wi(t,e+1)){case 109:if(Wi(t,e+4)!==45)break;case 102:return rr(t,/(.+:)(.+)-([^]+)/,"$1"+nr+"$2-$3$1"+IM+(Wi(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~NT(t,"stretch")?Uz(rr(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(Wi(t,e+1)!==115)break;case 6444:switch(Wi(t,Ka(t)-3-(~NT(t,"!important")&&10))){case 107:return rr(t,":",":"+nr)+t;case 101:return rr(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+nr+(Wi(t,14)===45?"inline-":"")+"box$3$1"+nr+"$2$3$1"+hs+"$2box$3")+t}break;case 5936:switch(Wi(t,e+11)){case 114:return nr+t+hs+rr(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return nr+t+hs+rr(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return nr+t+hs+rr(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return nr+t+hs+t+t}return t}var FZ=function(e,n,r,i){if(e.length>-1&&!e.return)switch(e.type){case i4:e.return=Uz(e.value,e.length);break;case Dz:return xp([A0(e,{value:rr(e.value,"@","@"+nr)})],i);case r4:if(e.length)return xZ(e.props,function(s){switch(MZ(s,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return xp([A0(e,{props:[rr(s,/:(read-\w+)/,":"+IM+"$1")]})],i);case"::placeholder":return xp([A0(e,{props:[rr(s,/:(plac\w+)/,":"+nr+"input-$1")]}),A0(e,{props:[rr(s,/:(plac\w+)/,":"+IM+"$1")]}),A0(e,{props:[rr(s,/:(plac\w+)/,hs+"input-$1")]})],i)}return""})}},jZ=[FZ],Fz=function(e){var n=e.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(w){var y=w.getAttribute("data-emotion");y.indexOf(" ")!==-1&&(document.head.appendChild(w),w.setAttribute("data-s",""))})}var i=e.stylisPlugins||jZ,s={},o,a=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(w){for(var y=w.getAttribute("data-emotion").split(" "),g=1;g=4;++r,i-=4)n=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(i){case 3:e^=(t.charCodeAt(r+2)&255)<<16;case 2:e^=(t.charCodeAt(r+1)&255)<<8;case 1:e^=t.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var ZZ={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},qZ=/[A-Z]|^ms/g,eq=/_EMO_([^_]+?)_([^]*?)_EMO_/g,$z=function(e){return e.charCodeAt(1)===45},Ok=function(e){return e!=null&&typeof e!="boolean"},XC=Rz(function(t){return $z(t)?t:t.replace(qZ,"-$&").toLowerCase()}),Uk=function(e,n){switch(e){case"animation":case"animationName":if(typeof n=="string")return n.replace(eq,function(r,i,s){return Za={name:i,styles:s,next:Za},i})}return ZZ[e]!==1&&!$z(e)&&typeof n=="number"&&n!==0?n+"px":n};function g1(t,e,n){if(n==null)return"";if(n.__emotion_styles!==void 0)return n;switch(typeof n){case"boolean":return"";case"object":{if(n.anim===1)return Za={name:n.name,styles:n.styles,next:Za},n.name;if(n.styles!==void 0){var r=n.next;if(r!==void 0)for(;r!==void 0;)Za={name:r.name,styles:r.styles,next:Za},r=r.next;var i=n.styles+";";return i}return tq(t,e,n)}case"function":{if(t!==void 0){var s=Za,o=n(t);return Za=s,g1(t,e,o)}break}}if(e==null)return n;var a=e[n];return a!==void 0?a:n}function tq(t,e,n){var r="";if(Array.isArray(n))for(var i=0;i96?oq:aq},Gk=function(e,n,r){var i;if(n){var s=n.shouldForwardProp;i=e.__emotion_forwardProp&&s?function(o){return e.__emotion_forwardProp(o)&&s(o)}:s}return typeof i!="function"&&r&&(i=e.__emotion_forwardProp),i},lq=function(e){var n=e.cache,r=e.serialized,i=e.isStringTag;return Vz(n,r,i),rq(function(){return Wz(n,r,i)}),null},cq=function t(e,n){var r=e.__emotion_real===e,i=r&&e.__emotion_base||e,s,o;n!==void 0&&(s=n.label,o=n.target);var a=Gk(e,n,r),l=a||Hk(i),c=!l("as");return function(){var u=arguments,f=r&&e.__emotion_styles!==void 0?e.__emotion_styles.slice(0):[];if(s!==void 0&&f.push("label:"+s+";"),u[0]==null||u[0].raw===void 0)f.push.apply(f,u);else{f.push(u[0][0]);for(var h=u.length,m=1;m{e[n]=Zz(t[n])}),e}function Co(t,e,n={clone:!0}){const r=n.clone?X({},t):t;return Yc(t)&&Yc(e)&&Object.keys(e).forEach(i=>{Yc(e[i])&&Object.prototype.hasOwnProperty.call(t,i)&&Yc(t[i])?r[i]=Co(t[i],e[i],n):n.clone?r[i]=Yc(e[i])?Zz(e[i]):e[i]:r[i]=e[i]}),r}const fq=Object.freeze(Object.defineProperty({__proto__:null,default:Co,isPlainObject:Yc},Symbol.toStringTag,{value:"Module"}));function gd(t){let e="https://mui.com/production-error/?code="+t;for(let n=1;nn==null?e:function(...i){e.apply(this,i),n.apply(this,i)},()=>{})}function Db(t,e=166){let n;function r(...i){const s=()=>{t.apply(this,i)};clearTimeout(n),n=setTimeout(s,e)}return r.clear=()=>{clearTimeout(n)},r}function wq(t,e){return()=>null}function Tg(t,e){var n,r;return I.isValidElement(t)&&e.indexOf((n=t.type.muiName)!=null?n:(r=t.type)==null||(r=r._payload)==null||(r=r.value)==null?void 0:r.muiName)!==-1}function Zr(t){return t&&t.ownerDocument||document}function Ks(t){return Zr(t).defaultView||window}function _q(t,e){return()=>null}function LM(t,e){typeof t=="function"?t(e):t&&(t.current=e)}const Oa=typeof window<"u"?I.useLayoutEffect:I.useEffect;let $k=0;function Mq(t){const[e,n]=I.useState(t),r=t||e;return I.useEffect(()=>{e==null&&($k+=1,n(`mui-${$k}`))},[e]),r}const Jk=tM.useId;function Nb(t){if(Jk!==void 0){const e=Jk();return t??e}return Mq(t)}function xq(t,e,n,r,i){return null}function RM({controlled:t,default:e,name:n,state:r="value"}){const{current:i}=I.useRef(t!==void 0),[s,o]=I.useState(e),a=i?t:s,l=I.useCallback(c=>{i||o(c)},[]);return[a,l]}function vo(t){const e=I.useRef(t);return Oa(()=>{e.current=t}),I.useRef((...n)=>(0,e.current)(...n)).current}function ni(...t){return I.useMemo(()=>t.every(e=>e==null)?null:e=>{t.forEach(n=>{LM(n,e)})},t)}const Yk={};function bq(t,e){const n=I.useRef(Yk);return n.current===Yk&&(n.current=t(e)),n}const Sq=[];function Cq(t){I.useEffect(t,Sq)}class kb{constructor(){this.currentId=null,this.clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)},this.disposeEffect=()=>this.clear}static create(){return new kb}start(e,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},e)}}function Bb(){const t=bq(kb.create).current;return Cq(t.disposeEffect),t}let Ob=!0,OT=!1;const Eq=new kb,Aq={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function Tq(t){const{type:e,tagName:n}=t;return!!(n==="INPUT"&&Aq[e]&&!t.readOnly||n==="TEXTAREA"&&!t.readOnly||t.isContentEditable)}function Iq(t){t.metaKey||t.altKey||t.ctrlKey||(Ob=!0)}function qC(){Ob=!1}function Lq(){this.visibilityState==="hidden"&&OT&&(Ob=!0)}function Rq(t){t.addEventListener("keydown",Iq,!0),t.addEventListener("mousedown",qC,!0),t.addEventListener("pointerdown",qC,!0),t.addEventListener("touchstart",qC,!0),t.addEventListener("visibilitychange",Lq,!0)}function Pq(t){const{target:e}=t;try{return e.matches(":focus-visible")}catch{}return Ob||Tq(e)}function r5(){const t=I.useCallback(i=>{i!=null&&Rq(i.ownerDocument)},[]),e=I.useRef(!1);function n(){return e.current?(OT=!0,Eq.start(100,()=>{OT=!1}),e.current=!1,!0):!1}function r(i){return Pq(i)?(e.current=!0,!0):!1}return{isFocusVisibleRef:e,onFocus:r,onBlur:n,ref:t}}function i5(t){const e=t.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}function PM(t,e){const n=X({},e);return Object.keys(t).forEach(r=>{if(r.toString().match(/^(components|slots)$/))n[r]=X({},t[r],n[r]);else if(r.toString().match(/^(componentsProps|slotProps)$/)){const i=t[r]||{},s=e[r];n[r]={},!s||!Object.keys(s)?n[r]=i:!i||!Object.keys(i)?n[r]=s:(n[r]=X({},s),Object.keys(i).forEach(o=>{n[r][o]=PM(i[o],s[o])}))}else n[r]===void 0&&(n[r]=t[r])}),n}function bn(t,e,n=void 0){const r={};return Object.keys(t).forEach(i=>{r[i]=t[i].reduce((s,o)=>{if(o){const a=e(o);a!==""&&s.push(a),n&&n[o]&&s.push(n[o])}return s},[]).join(" ")}),r}const Qk=t=>t,Dq=()=>{let t=Qk;return{configure(e){t=e},generate(e){return t(e)},reset(){t=Qk}}},h4=Dq(),Nq={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function Mn(t,e,n="Mui"){const r=Nq[e];return r?`${n}-${r}`:`${h4.generate(t)}-${e}`}function fn(t,e,n="Mui"){const r={};return e.forEach(i=>{r[i]=Mn(t,i,n)}),r}function kq(t,e=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(e,Math.min(t,n))}const Bq=Object.freeze(Object.defineProperty({__proto__:null,default:kq},Symbol.toStringTag,{value:"Module"}));function Nt(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.includes(r))continue;n[r]=t[r]}return n}function s5(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;ee(Hq(i)?n:i):e;return O.jsx(sq,{styles:r})}function l5(t,e){return Be(t,e)}const Gq=(t,e)=>{Array.isArray(t.__emotion_styles)&&(t.__emotion_styles=e(t.__emotion_styles))},Vq=Object.freeze(Object.defineProperty({__proto__:null,GlobalStyles:a5,StyledEngineProvider:zq,ThemeContext:iv,css:wl,default:l5,internal_processStyles:Gq,keyframes:Cm},Symbol.toStringTag,{value:"Module"})),Wq=hc(Vq),$q=hc(fq),Jq=hc(yq),Yq=hc(vq),Qq=["values","unit","step"],Xq=t=>{const e=Object.keys(t).map(n=>({key:n,val:t[n]}))||[];return e.sort((n,r)=>n.val-r.val),e.reduce((n,r)=>X({},n,{[r.key]:r.val}),{})};function c5(t){const{values:e={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5}=t,i=Nt(t,Qq),s=Xq(e),o=Object.keys(s);function a(h){return`@media (min-width:${typeof e[h]=="number"?e[h]:h}${n})`}function l(h){return`@media (max-width:${(typeof e[h]=="number"?e[h]:h)-r/100}${n})`}function c(h,m){const v=o.indexOf(m);return`@media (min-width:${typeof e[h]=="number"?e[h]:h}${n}) and (max-width:${(v!==-1&&typeof e[o[v]]=="number"?e[o[v]]:m)-r/100}${n})`}function u(h){return o.indexOf(h)+1`@media (min-width:${p4[t]}px)`};function ac(t,e,n){const r=t.theme||{};if(Array.isArray(e)){const s=r.breakpoints||Kk;return e.reduce((o,a,l)=>(o[s.up(s.keys[l])]=n(e[l]),o),{})}if(typeof e=="object"){const s=r.breakpoints||Kk;return Object.keys(e).reduce((o,a)=>{if(Object.keys(s.values||p4).indexOf(a)!==-1){const l=s.up(a);o[l]=n(e[a],a)}else{const l=a;o[l]=e[l]}return o},{})}return n(e)}function Zq(t={}){var e;return((e=t.keys)==null?void 0:e.reduce((r,i)=>{const s=t.up(i);return r[s]={},r},{}))||{}}function qq(t,e){return t.reduce((n,r)=>{const i=n[r];return(!i||Object.keys(i).length===0)&&delete n[r],n},e)}function Ub(t,e,n=!0){if(!e||typeof e!="string")return null;if(t&&t.vars&&n){const r=`vars.${e}`.split(".").reduce((i,s)=>i&&i[s]?i[s]:null,t);if(r!=null)return r}return e.split(".").reduce((r,i)=>r&&r[i]!=null?r[i]:null,t)}function DM(t,e,n,r=n){let i;return typeof t=="function"?i=t(n):Array.isArray(t)?i=t[n]||r:i=Ub(t,n)||r,e&&(i=e(i,r,t)),i}function ri(t){const{prop:e,cssProperty:n=t.prop,themeKey:r,transform:i}=t,s=o=>{if(o[e]==null)return null;const a=o[e],l=o.theme,c=Ub(l,r)||{};return ac(o,a,f=>{let h=DM(c,i,f);return f===h&&typeof f=="string"&&(h=DM(c,i,`${e}${f==="default"?"":zt(f)}`,f)),n===!1?h:{[n]:h}})};return s.propTypes={},s.filterProps=[e],s}function eee(t){const e={};return n=>(e[n]===void 0&&(e[n]=t(n)),e[n])}const tee={m:"margin",p:"padding"},nee={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},Zk={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},ree=eee(t=>{if(t.length>2)if(Zk[t])t=Zk[t];else return[t];const[e,n]=t.split(""),r=tee[e],i=nee[n]||"";return Array.isArray(i)?i.map(s=>r+s):[r+i]}),m4=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],g4=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...m4,...g4];function ov(t,e,n,r){var i;const s=(i=Ub(t,e,!1))!=null?i:n;return typeof s=="number"?o=>typeof o=="string"?o:s*o:Array.isArray(s)?o=>typeof o=="string"?o:s[o]:typeof s=="function"?s:()=>{}}function u5(t){return ov(t,"spacing",8)}function av(t,e){if(typeof e=="string"||e==null)return e;const n=Math.abs(e),r=t(n);return e>=0?r:typeof r=="number"?-r:`-${r}`}function iee(t,e){return n=>t.reduce((r,i)=>(r[i]=av(e,n),r),{})}function see(t,e,n,r){if(e.indexOf(n)===-1)return null;const i=ree(n),s=iee(i,r),o=t[n];return ac(t,o,s)}function f5(t,e){const n=u5(t.theme);return Object.keys(t).map(r=>see(t,e,r,n)).reduce(Ig,{})}function zr(t){return f5(t,m4)}zr.propTypes={};zr.filterProps=m4;function Hr(t){return f5(t,g4)}Hr.propTypes={};Hr.filterProps=g4;function oee(t=8){if(t.mui)return t;const e=u5({spacing:t}),n=(...r)=>(r.length===0?[1]:r).map(s=>{const o=e(s);return typeof o=="number"?`${o}px`:o}).join(" ");return n.mui=!0,n}function Fb(...t){const e=t.reduce((r,i)=>(i.filterProps.forEach(s=>{r[s]=i}),r),{}),n=r=>Object.keys(r).reduce((i,s)=>e[s]?Ig(i,e[s](r)):i,{});return n.propTypes={},n.filterProps=t.reduce((r,i)=>r.concat(i.filterProps),[]),n}function Xo(t){return typeof t!="number"?t:`${t}px solid`}function ca(t,e){return ri({prop:t,themeKey:"borders",transform:e})}const aee=ca("border",Xo),lee=ca("borderTop",Xo),cee=ca("borderRight",Xo),uee=ca("borderBottom",Xo),fee=ca("borderLeft",Xo),dee=ca("borderColor"),hee=ca("borderTopColor"),pee=ca("borderRightColor"),mee=ca("borderBottomColor"),gee=ca("borderLeftColor"),vee=ca("outline",Xo),yee=ca("outlineColor"),jb=t=>{if(t.borderRadius!==void 0&&t.borderRadius!==null){const e=ov(t.theme,"shape.borderRadius",4),n=r=>({borderRadius:av(e,r)});return ac(t,t.borderRadius,n)}return null};jb.propTypes={};jb.filterProps=["borderRadius"];Fb(aee,lee,cee,uee,fee,dee,hee,pee,mee,gee,jb,vee,yee);const zb=t=>{if(t.gap!==void 0&&t.gap!==null){const e=ov(t.theme,"spacing",8),n=r=>({gap:av(e,r)});return ac(t,t.gap,n)}return null};zb.propTypes={};zb.filterProps=["gap"];const Hb=t=>{if(t.columnGap!==void 0&&t.columnGap!==null){const e=ov(t.theme,"spacing",8),n=r=>({columnGap:av(e,r)});return ac(t,t.columnGap,n)}return null};Hb.propTypes={};Hb.filterProps=["columnGap"];const Gb=t=>{if(t.rowGap!==void 0&&t.rowGap!==null){const e=ov(t.theme,"spacing",8),n=r=>({rowGap:av(e,r)});return ac(t,t.rowGap,n)}return null};Gb.propTypes={};Gb.filterProps=["rowGap"];const wee=ri({prop:"gridColumn"}),_ee=ri({prop:"gridRow"}),Mee=ri({prop:"gridAutoFlow"}),xee=ri({prop:"gridAutoColumns"}),bee=ri({prop:"gridAutoRows"}),See=ri({prop:"gridTemplateColumns"}),Cee=ri({prop:"gridTemplateRows"}),Eee=ri({prop:"gridTemplateAreas"}),Aee=ri({prop:"gridArea"});Fb(zb,Hb,Gb,wee,_ee,Mee,xee,bee,See,Cee,Eee,Aee);function bp(t,e){return e==="grey"?e:t}const Tee=ri({prop:"color",themeKey:"palette",transform:bp}),Iee=ri({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:bp}),Lee=ri({prop:"backgroundColor",themeKey:"palette",transform:bp});Fb(Tee,Iee,Lee);function po(t){return t<=1&&t!==0?`${t*100}%`:t}const Ree=ri({prop:"width",transform:po}),v4=t=>{if(t.maxWidth!==void 0&&t.maxWidth!==null){const e=n=>{var r,i;const s=((r=t.theme)==null||(r=r.breakpoints)==null||(r=r.values)==null?void 0:r[n])||p4[n];return s?((i=t.theme)==null||(i=i.breakpoints)==null?void 0:i.unit)!=="px"?{maxWidth:`${s}${t.theme.breakpoints.unit}`}:{maxWidth:s}:{maxWidth:po(n)}};return ac(t,t.maxWidth,e)}return null};v4.filterProps=["maxWidth"];const Pee=ri({prop:"minWidth",transform:po}),Dee=ri({prop:"height",transform:po}),Nee=ri({prop:"maxHeight",transform:po}),kee=ri({prop:"minHeight",transform:po});ri({prop:"size",cssProperty:"width",transform:po});ri({prop:"size",cssProperty:"height",transform:po});const Bee=ri({prop:"boxSizing"});Fb(Ree,v4,Pee,Dee,Nee,kee,Bee);const lv={border:{themeKey:"borders",transform:Xo},borderTop:{themeKey:"borders",transform:Xo},borderRight:{themeKey:"borders",transform:Xo},borderBottom:{themeKey:"borders",transform:Xo},borderLeft:{themeKey:"borders",transform:Xo},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Xo},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:jb},color:{themeKey:"palette",transform:bp},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:bp},backgroundColor:{themeKey:"palette",transform:bp},p:{style:Hr},pt:{style:Hr},pr:{style:Hr},pb:{style:Hr},pl:{style:Hr},px:{style:Hr},py:{style:Hr},padding:{style:Hr},paddingTop:{style:Hr},paddingRight:{style:Hr},paddingBottom:{style:Hr},paddingLeft:{style:Hr},paddingX:{style:Hr},paddingY:{style:Hr},paddingInline:{style:Hr},paddingInlineStart:{style:Hr},paddingInlineEnd:{style:Hr},paddingBlock:{style:Hr},paddingBlockStart:{style:Hr},paddingBlockEnd:{style:Hr},m:{style:zr},mt:{style:zr},mr:{style:zr},mb:{style:zr},ml:{style:zr},mx:{style:zr},my:{style:zr},margin:{style:zr},marginTop:{style:zr},marginRight:{style:zr},marginBottom:{style:zr},marginLeft:{style:zr},marginX:{style:zr},marginY:{style:zr},marginInline:{style:zr},marginInlineStart:{style:zr},marginInlineEnd:{style:zr},marginBlock:{style:zr},marginBlockStart:{style:zr},marginBlockEnd:{style:zr},displayPrint:{cssProperty:!1,transform:t=>({"@media print":{display:t}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:zb},rowGap:{style:Gb},columnGap:{style:Hb},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:po},maxWidth:{style:v4},minWidth:{transform:po},height:{transform:po},maxHeight:{transform:po},minHeight:{transform:po},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function Oee(...t){const e=t.reduce((r,i)=>r.concat(Object.keys(i)),[]),n=new Set(e);return t.every(r=>n.size===Object.keys(r).length)}function Uee(t,e){return typeof t=="function"?t(e):t}function d5(){function t(n,r,i,s){const o={[n]:r,theme:i},a=s[n];if(!a)return{[n]:r};const{cssProperty:l=n,themeKey:c,transform:u,style:f}=a;if(r==null)return null;if(c==="typography"&&r==="inherit")return{[n]:r};const h=Ub(i,c)||{};return f?f(o):ac(o,r,v=>{let w=DM(h,u,v);return v===w&&typeof v=="string"&&(w=DM(h,u,`${n}${v==="default"?"":zt(v)}`,v)),l===!1?w:{[l]:w}})}function e(n){var r;const{sx:i,theme:s={}}=n||{};if(!i)return null;const o=(r=s.unstable_sxConfig)!=null?r:lv;function a(l){let c=l;if(typeof l=="function")c=l(s);else if(typeof l!="object")return l;if(!c)return null;const u=Zq(s.breakpoints),f=Object.keys(u);let h=u;return Object.keys(c).forEach(m=>{const v=Uee(c[m],s);if(v!=null)if(typeof v=="object")if(o[m])h=Ig(h,t(m,v,s,o));else{const w=ac({theme:s},v,y=>({[m]:y}));Oee(w,v)?h[m]=e({sx:v,theme:s}):h=Ig(h,w)}else h=Ig(h,t(m,v,s,o))}),qq(f,h)}return Array.isArray(i)?i.map(a):a(i)}return e}const cv=d5();cv.filterProps=["sx"];function h5(t,e){const n=this;return n.vars&&typeof n.getColorSchemeSelector=="function"?{[n.getColorSchemeSelector(t).replace(/(\[[^\]]+\])/,"*:where($1)")]:e}:n.palette.mode===t?e:{}}const Fee=["breakpoints","palette","spacing","shape"];function y4(t={},...e){const{breakpoints:n={},palette:r={},spacing:i,shape:s={}}=t,o=Nt(t,Fee),a=c5(n),l=oee(i);let c=Co({breakpoints:a,direction:"ltr",components:{},palette:X({mode:"light"},r),spacing:l,shape:X({},Kq,s)},o);return c.applyStyles=h5,c=e.reduce((u,f)=>Co(u,f),c),c.unstable_sxConfig=X({},lv,o==null?void 0:o.unstable_sxConfig),c.unstable_sx=function(f){return cv({sx:f,theme:this})},c}const jee=Object.freeze(Object.defineProperty({__proto__:null,default:y4,private_createBreakpoints:c5,unstable_applyStyles:h5},Symbol.toStringTag,{value:"Module"})),zee=hc(jee),Hee=["sx"],Gee=t=>{var e,n;const r={systemProps:{},otherProps:{}},i=(e=t==null||(n=t.theme)==null?void 0:n.unstable_sxConfig)!=null?e:lv;return Object.keys(t).forEach(s=>{i[s]?r.systemProps[s]=t[s]:r.otherProps[s]=t[s]}),r};function w4(t){const{sx:e}=t,n=Nt(t,Hee),{systemProps:r,otherProps:i}=Gee(n);let s;return Array.isArray(e)?s=[r,...e]:typeof e=="function"?s=(...o)=>{const a=e(...o);return Yc(a)?X({},r,a):r}:s=X({},r,e),X({},i,{sx:s})}const Vee=Object.freeze(Object.defineProperty({__proto__:null,default:cv,extendSxProp:w4,unstable_createStyleFunctionSx:d5,unstable_defaultSxConfig:lv},Symbol.toStringTag,{value:"Module"})),Wee=hc(Vee);var Em=Ur;Object.defineProperty(sv,"__esModule",{value:!0});var $ee=sv.default=ste;sv.shouldForwardProp=O_;sv.systemDefaultTheme=void 0;var $o=Em(Xz()),FT=Em(jq()),qk=qee(Wq),Jee=$q;Em(Jq);Em(Yq);var Yee=Em(zee),Qee=Em(Wee);const Xee=["ownerState"],Kee=["variants"],Zee=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function p5(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(p5=function(r){return r?n:e})(t)}function qee(t,e){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=p5(e);if(n&&n.has(t))return n.get(t);var r={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if(s!=="default"&&Object.prototype.hasOwnProperty.call(t,s)){var o=i?Object.getOwnPropertyDescriptor(t,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=t[s]}return r.default=t,n&&n.set(t,r),r}function ete(t){return Object.keys(t).length===0}function tte(t){return typeof t=="string"&&t.charCodeAt(0)>96}function O_(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}const nte=sv.systemDefaultTheme=(0,Yee.default)(),rte=t=>t&&t.charAt(0).toLowerCase()+t.slice(1);function tw({defaultTheme:t,theme:e,themeId:n}){return ete(e)?t:e[n]||e}function ite(t){return t?(e,n)=>n[t]:null}function U_(t,e){let{ownerState:n}=e,r=(0,FT.default)(e,Xee);const i=typeof t=="function"?t((0,$o.default)({ownerState:n},r)):t;if(Array.isArray(i))return i.flatMap(s=>U_(s,(0,$o.default)({ownerState:n},r)));if(i&&typeof i=="object"&&Array.isArray(i.variants)){const{variants:s=[]}=i;let a=(0,FT.default)(i,Kee);return s.forEach(l=>{let c=!0;typeof l.props=="function"?c=l.props((0,$o.default)({ownerState:n},r,n)):Object.keys(l.props).forEach(u=>{(n==null?void 0:n[u])!==l.props[u]&&r[u]!==l.props[u]&&(c=!1)}),c&&(Array.isArray(a)||(a=[a]),a.push(typeof l.style=="function"?l.style((0,$o.default)({ownerState:n},r,n)):l.style))}),a}return i}function ste(t={}){const{themeId:e,defaultTheme:n=nte,rootShouldForwardProp:r=O_,slotShouldForwardProp:i=O_}=t,s=o=>(0,Qee.default)((0,$o.default)({},o,{theme:tw((0,$o.default)({},o,{defaultTheme:n,themeId:e}))}));return s.__mui_systemSx=!0,(o,a={})=>{(0,qk.internal_processStyles)(o,D=>D.filter(T=>!(T!=null&&T.__mui_systemSx)));const{name:l,slot:c,skipVariantsResolver:u,skipSx:f,overridesResolver:h=ite(rte(c))}=a,m=(0,FT.default)(a,Zee),v=u!==void 0?u:c&&c!=="Root"&&c!=="root"||!1,w=f||!1;let y,g=O_;c==="Root"||c==="root"?g=r:c?g=i:tte(o)&&(g=void 0);const _=(0,qk.default)(o,(0,$o.default)({shouldForwardProp:g,label:y},m)),x=D=>typeof D=="function"&&D.__emotion_real!==D||(0,Jee.isPlainObject)(D)?T=>U_(D,(0,$o.default)({},T,{theme:tw({theme:T.theme,defaultTheme:n,themeId:e})})):D,S=(D,...T)=>{let E=x(D);const R=T?T.map(x):[];l&&h&&R.push(P=>{const z=tw((0,$o.default)({},P,{defaultTheme:n,themeId:e}));if(!z.components||!z.components[l]||!z.components[l].styleOverrides)return null;const B=z.components[l].styleOverrides,Y={};return Object.entries(B).forEach(([ie,ee])=>{Y[ie]=U_(ee,(0,$o.default)({},P,{theme:z}))}),h(P,Y)}),l&&!v&&R.push(P=>{var z;const B=tw((0,$o.default)({},P,{defaultTheme:n,themeId:e})),Y=B==null||(z=B.components)==null||(z=z[l])==null?void 0:z.variants;return U_({variants:Y},(0,$o.default)({},P,{theme:B}))}),w||R.push(s);const C=R.length-T.length;if(Array.isArray(D)&&C>0){const P=new Array(C).fill("");E=[...D,...P],E.raw=[...D.raw,...P]}const L=_(E,...R);return o.muiName&&(L.muiName=o.muiName),L};return _.withConfig&&(S.withConfig=_.withConfig),S}}function ote(t,e){return X({toolbar:{minHeight:56,[t.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[t.up("sm")]:{minHeight:64}}},e)}var ii={};const ate=hc(dq),lte=hc(Bq);var m5=Ur;Object.defineProperty(ii,"__esModule",{value:!0});var yo=ii.alpha=w5;ii.blend=_te;ii.colorChannel=void 0;var jT=ii.darken=M4;ii.decomposeColor=sa;var cte=ii.emphasize=_5,ute=ii.getContrastRatio=mte;ii.getLuminance=NM;ii.hexToRgb=g5;ii.hslToRgb=y5;var zT=ii.lighten=x4;ii.private_safeAlpha=gte;ii.private_safeColorChannel=void 0;ii.private_safeDarken=vte;ii.private_safeEmphasize=wte;ii.private_safeLighten=yte;ii.recomposeColor=Am;ii.rgbToHex=pte;var e6=m5(ate),fte=m5(lte);function _4(t,e=0,n=1){return(0,fte.default)(t,e,n)}function g5(t){t=t.slice(1);const e=new RegExp(`.{1,${t.length>=6?2:1}}`,"g");let n=t.match(e);return n&&n[0].length===1&&(n=n.map(r=>r+r)),n?`rgb${n.length===4?"a":""}(${n.map((r,i)=>i<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function dte(t){const e=t.toString(16);return e.length===1?`0${e}`:e}function sa(t){if(t.type)return t;if(t.charAt(0)==="#")return sa(g5(t));const e=t.indexOf("("),n=t.substring(0,e);if(["rgb","rgba","hsl","hsla","color"].indexOf(n)===-1)throw new Error((0,e6.default)(9,t));let r=t.substring(e+1,t.length-1),i;if(n==="color"){if(r=r.split(" "),i=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(i)===-1)throw new Error((0,e6.default)(10,i))}else r=r.split(",");return r=r.map(s=>parseFloat(s)),{type:n,values:r,colorSpace:i}}const v5=t=>{const e=sa(t);return e.values.slice(0,3).map((n,r)=>e.type.indexOf("hsl")!==-1&&r!==0?`${n}%`:n).join(" ")};ii.colorChannel=v5;const hte=(t,e)=>{try{return v5(t)}catch{return t}};ii.private_safeColorChannel=hte;function Am(t){const{type:e,colorSpace:n}=t;let{values:r}=t;return e.indexOf("rgb")!==-1?r=r.map((i,s)=>s<3?parseInt(i,10):i):e.indexOf("hsl")!==-1&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),e.indexOf("color")!==-1?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${e}(${r})`}function pte(t){if(t.indexOf("#")===0)return t;const{values:e}=sa(t);return`#${e.map((n,r)=>dte(r===3?Math.round(255*n):n)).join("")}`}function y5(t){t=sa(t);const{values:e}=t,n=e[0],r=e[1]/100,i=e[2]/100,s=r*Math.min(i,1-i),o=(c,u=(c+n/30)%12)=>i-s*Math.max(Math.min(u-3,9-u,1),-1);let a="rgb";const l=[Math.round(o(0)*255),Math.round(o(8)*255),Math.round(o(4)*255)];return t.type==="hsla"&&(a+="a",l.push(e[3])),Am({type:a,values:l})}function NM(t){t=sa(t);let e=t.type==="hsl"||t.type==="hsla"?sa(y5(t)).values:t.values;return e=e.map(n=>(t.type!=="color"&&(n/=255),n<=.03928?n/12.92:((n+.055)/1.055)**2.4)),Number((.2126*e[0]+.7152*e[1]+.0722*e[2]).toFixed(3))}function mte(t,e){const n=NM(t),r=NM(e);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function w5(t,e){return t=sa(t),e=_4(e),(t.type==="rgb"||t.type==="hsl")&&(t.type+="a"),t.type==="color"?t.values[3]=`/${e}`:t.values[3]=e,Am(t)}function gte(t,e,n){try{return w5(t,e)}catch{return t}}function M4(t,e){if(t=sa(t),e=_4(e),t.type.indexOf("hsl")!==-1)t.values[2]*=1-e;else if(t.type.indexOf("rgb")!==-1||t.type.indexOf("color")!==-1)for(let n=0;n<3;n+=1)t.values[n]*=1-e;return Am(t)}function vte(t,e,n){try{return M4(t,e)}catch{return t}}function x4(t,e){if(t=sa(t),e=_4(e),t.type.indexOf("hsl")!==-1)t.values[2]+=(100-t.values[2])*e;else if(t.type.indexOf("rgb")!==-1)for(let n=0;n<3;n+=1)t.values[n]+=(255-t.values[n])*e;else if(t.type.indexOf("color")!==-1)for(let n=0;n<3;n+=1)t.values[n]+=(1-t.values[n])*e;return Am(t)}function yte(t,e,n){try{return x4(t,e)}catch{return t}}function _5(t,e=.15){return NM(t)>.5?M4(t,e):x4(t,e)}function wte(t,e,n){try{return _5(t,e)}catch{return t}}function _te(t,e,n,r=1){const i=(l,c)=>Math.round((l**(1/r)*(1-n)+c**(1/r)*n)**r),s=sa(t),o=sa(e),a=[i(s.values[0],o.values[0]),i(s.values[1],o.values[1]),i(s.values[2],o.values[2])];return Am({type:"rgb",values:a})}const v1={black:"#000",white:"#fff"},Mte={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},gh={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},vh={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},T0={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},yh={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},wh={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},_h={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},xte=["mode","contrastThreshold","tonalOffset"],t6={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:v1.white,default:v1.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},tE={text:{primary:v1.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:v1.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function n6(t,e,n,r){const i=r.light||r,s=r.dark||r*1.5;t[e]||(t.hasOwnProperty(n)?t[e]=t[n]:e==="light"?t.light=zT(t.main,i):e==="dark"&&(t.dark=jT(t.main,s)))}function bte(t="light"){return t==="dark"?{main:yh[200],light:yh[50],dark:yh[400]}:{main:yh[700],light:yh[400],dark:yh[800]}}function Ste(t="light"){return t==="dark"?{main:gh[200],light:gh[50],dark:gh[400]}:{main:gh[500],light:gh[300],dark:gh[700]}}function Cte(t="light"){return t==="dark"?{main:vh[500],light:vh[300],dark:vh[700]}:{main:vh[700],light:vh[400],dark:vh[800]}}function Ete(t="light"){return t==="dark"?{main:wh[400],light:wh[300],dark:wh[700]}:{main:wh[700],light:wh[500],dark:wh[900]}}function Ate(t="light"){return t==="dark"?{main:_h[400],light:_h[300],dark:_h[700]}:{main:_h[800],light:_h[500],dark:_h[900]}}function Tte(t="light"){return t==="dark"?{main:T0[400],light:T0[300],dark:T0[700]}:{main:"#ed6c02",light:T0[500],dark:T0[900]}}function Ite(t){const{mode:e="light",contrastThreshold:n=3,tonalOffset:r=.2}=t,i=Nt(t,xte),s=t.primary||bte(e),o=t.secondary||Ste(e),a=t.error||Cte(e),l=t.info||Ete(e),c=t.success||Ate(e),u=t.warning||Tte(e);function f(w){return ute(w,tE.text.primary)>=n?tE.text.primary:t6.text.primary}const h=({color:w,name:y,mainShade:g=500,lightShade:_=300,darkShade:x=700})=>{if(w=X({},w),!w.main&&w[g]&&(w.main=w[g]),!w.hasOwnProperty("main"))throw new Error(gd(11,y?` (${y})`:"",g));if(typeof w.main!="string")throw new Error(gd(12,y?` (${y})`:"",JSON.stringify(w.main)));return n6(w,"light",_,r),n6(w,"dark",x,r),w.contrastText||(w.contrastText=f(w.main)),w},m={dark:tE,light:t6};return Co(X({common:X({},v1),mode:e,primary:h({color:s,name:"primary"}),secondary:h({color:o,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:h({color:a,name:"error"}),warning:h({color:u,name:"warning"}),info:h({color:l,name:"info"}),success:h({color:c,name:"success"}),grey:Mte,contrastThreshold:n,getContrastText:f,augmentColor:h,tonalOffset:r},m[e]),i)}const Lte=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function Rte(t){return Math.round(t*1e5)/1e5}const r6={textTransform:"uppercase"},i6='"Roboto", "Helvetica", "Arial", sans-serif';function Pte(t,e){const n=typeof e=="function"?e(t):e,{fontFamily:r=i6,fontSize:i=14,fontWeightLight:s=300,fontWeightRegular:o=400,fontWeightMedium:a=500,fontWeightBold:l=700,htmlFontSize:c=16,allVariants:u,pxToRem:f}=n,h=Nt(n,Lte),m=i/14,v=f||(g=>`${g/c*m}rem`),w=(g,_,x,S,D)=>X({fontFamily:r,fontWeight:g,fontSize:v(_),lineHeight:x},r===i6?{letterSpacing:`${Rte(S/_)}em`}:{},D,u),y={h1:w(s,96,1.167,-1.5),h2:w(s,60,1.2,-.5),h3:w(o,48,1.167,0),h4:w(o,34,1.235,.25),h5:w(o,24,1.334,0),h6:w(a,20,1.6,.15),subtitle1:w(o,16,1.75,.15),subtitle2:w(a,14,1.57,.1),body1:w(o,16,1.5,.15),body2:w(o,14,1.43,.15),button:w(a,14,1.75,.4,r6),caption:w(o,12,1.66,.4),overline:w(o,12,2.66,1,r6),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return Co(X({htmlFontSize:c,pxToRem:v,fontFamily:r,fontSize:i,fontWeightLight:s,fontWeightRegular:o,fontWeightMedium:a,fontWeightBold:l},y),h,{clone:!1})}const Dte=.2,Nte=.14,kte=.12;function Er(...t){return[`${t[0]}px ${t[1]}px ${t[2]}px ${t[3]}px rgba(0,0,0,${Dte})`,`${t[4]}px ${t[5]}px ${t[6]}px ${t[7]}px rgba(0,0,0,${Nte})`,`${t[8]}px ${t[9]}px ${t[10]}px ${t[11]}px rgba(0,0,0,${kte})`].join(",")}const Bte=["none",Er(0,2,1,-1,0,1,1,0,0,1,3,0),Er(0,3,1,-2,0,2,2,0,0,1,5,0),Er(0,3,3,-2,0,3,4,0,0,1,8,0),Er(0,2,4,-1,0,4,5,0,0,1,10,0),Er(0,3,5,-1,0,5,8,0,0,1,14,0),Er(0,3,5,-1,0,6,10,0,0,1,18,0),Er(0,4,5,-2,0,7,10,1,0,2,16,1),Er(0,5,5,-3,0,8,10,1,0,3,14,2),Er(0,5,6,-3,0,9,12,1,0,3,16,2),Er(0,6,6,-3,0,10,14,1,0,4,18,3),Er(0,6,7,-4,0,11,15,1,0,4,20,3),Er(0,7,8,-4,0,12,17,2,0,5,22,4),Er(0,7,8,-4,0,13,19,2,0,5,24,4),Er(0,7,9,-4,0,14,21,2,0,5,26,4),Er(0,8,9,-5,0,15,22,2,0,6,28,5),Er(0,8,10,-5,0,16,24,2,0,6,30,5),Er(0,8,11,-5,0,17,26,2,0,6,32,5),Er(0,9,11,-5,0,18,28,2,0,7,34,6),Er(0,9,12,-6,0,19,29,2,0,7,36,6),Er(0,10,13,-6,0,20,31,3,0,8,38,7),Er(0,10,13,-6,0,21,33,3,0,8,40,7),Er(0,10,14,-6,0,22,35,3,0,8,42,7),Er(0,11,14,-7,0,23,36,3,0,9,44,8),Er(0,11,15,-7,0,24,38,3,0,9,46,8)],Ote=["duration","easing","delay"],Ute={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},M5={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function s6(t){return`${Math.round(t)}ms`}function Fte(t){if(!t)return 0;const e=t/36;return Math.round((4+15*e**.25+e/5)*10)}function jte(t){const e=X({},Ute,t.easing),n=X({},M5,t.duration);return X({getAutoHeightDuration:Fte,create:(i=["all"],s={})=>{const{duration:o=n.standard,easing:a=e.easeInOut,delay:l=0}=s;return Nt(s,Ote),(Array.isArray(i)?i:[i]).map(c=>`${c} ${typeof o=="string"?o:s6(o)} ${a} ${typeof l=="string"?l:s6(l)}`).join(",")}},t,{easing:e,duration:n})}const zte={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},Hte=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function b4(t={},...e){const{mixins:n={},palette:r={},transitions:i={},typography:s={}}=t,o=Nt(t,Hte);if(t.vars)throw new Error(gd(18));const a=Ite(r),l=y4(t);let c=Co(l,{mixins:ote(l.breakpoints,n),palette:a,shadows:Bte.slice(),typography:Pte(a,s),transitions:jte(i),zIndex:X({},zte)});return c=Co(c,o),c=e.reduce((u,f)=>Co(u,f),c),c.unstable_sxConfig=X({},lv,o==null?void 0:o.unstable_sxConfig),c.unstable_sx=function(f){return cv({sx:f,theme:this})},c}const S4=b4(),Wp="$$material";function x5(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}const Po=t=>x5(t)&&t!=="classes",Ct=$ee({themeId:Wp,defaultTheme:S4,rootShouldForwardProp:Po});function Gte(t){return Mn("MuiSvgIcon",t)}fn("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Vte=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],Wte=t=>{const{color:e,fontSize:n,classes:r}=t,i={root:["root",e!=="inherit"&&`color${zt(e)}`,`fontSize${zt(n)}`]};return bn(i,Gte,r)},$te=Ct("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.color!=="inherit"&&e[`color${zt(n.color)}`],e[`fontSize${zt(n.fontSize)}`]]}})(({theme:t,ownerState:e})=>{var n,r,i,s,o,a,l,c,u,f,h,m,v;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:e.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:(n=t.transitions)==null||(r=n.create)==null?void 0:r.call(n,"fill",{duration:(i=t.transitions)==null||(i=i.duration)==null?void 0:i.shorter}),fontSize:{inherit:"inherit",small:((s=t.typography)==null||(o=s.pxToRem)==null?void 0:o.call(s,20))||"1.25rem",medium:((a=t.typography)==null||(l=a.pxToRem)==null?void 0:l.call(a,24))||"1.5rem",large:((c=t.typography)==null||(u=c.pxToRem)==null?void 0:u.call(c,35))||"2.1875rem"}[e.fontSize],color:(f=(h=(t.vars||t).palette)==null||(h=h[e.color])==null?void 0:h.main)!=null?f:{action:(m=(t.vars||t).palette)==null||(m=m.action)==null?void 0:m.active,disabled:(v=(t.vars||t).palette)==null||(v=v.action)==null?void 0:v.disabled,inherit:void 0}[e.color]}}),HT=I.forwardRef(function(e,n){const r=gn({props:e,name:"MuiSvgIcon"}),{children:i,className:s,color:o="inherit",component:a="svg",fontSize:l="medium",htmlColor:c,inheritViewBox:u=!1,titleAccess:f,viewBox:h="0 0 24 24"}=r,m=Nt(r,Vte),v=I.isValidElement(i)&&i.type==="svg",w=X({},r,{color:o,component:a,fontSize:l,instanceFontSize:e.fontSize,inheritViewBox:u,viewBox:h,hasSvgAsChild:v}),y={};u||(y.viewBox=h);const g=Wte(w);return O.jsxs($te,X({as:a,className:Vt(g.root,s),focusable:"false",color:c,"aria-hidden":f?void 0:!0,role:f?"img":void 0,ref:n},y,m,v&&i.props,{ownerState:w,children:[v?i.props.children:i,f?O.jsx("title",{children:f}):null]}))});HT.muiName="SvgIcon";function ku(t,e){function n(r,i){return O.jsx(HT,X({"data-testid":`${e}Icon`,ref:i},r,{children:t}))}return n.muiName=HT.muiName,I.memo(I.forwardRef(n))}const Jte={configure:t=>{h4.configure(t)}},Yte=Object.freeze(Object.defineProperty({__proto__:null,capitalize:zt,createChainedFunction:BT,createSvgIcon:ku,debounce:Db,deprecatedPropType:wq,isMuiElement:Tg,ownerDocument:Zr,ownerWindow:Ks,requirePropFactory:_q,setRef:LM,unstable_ClassNameGenerator:Jte,unstable_useEnhancedEffect:Oa,unstable_useId:Nb,unsupportedProp:xq,useControlled:RM,useEventCallback:vo,useForkRef:ni,useIsFocusVisible:r5},Symbol.toStringTag,{value:"Module"})),Qte=hc(Yte);var o6;function si(){return o6||(o6=1,function(t){"use client";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return e.createSvgIcon}});var e=Qte}(ZC)),ZC}var Xte=Ur;Object.defineProperty(u4,"__esModule",{value:!0});var C4=u4.default=void 0,Kte=Xte(si()),Zte=O;C4=u4.default=(0,Kte.default)((0,Zte.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");function qte(t){return Object.keys(t).length===0}function b5(t=null){const e=I.useContext(iv);return!e||qte(e)?t:e}const ene=y4();function E4(t=ene){return b5(t)}function tne({styles:t,themeId:e,defaultTheme:n={}}){const r=E4(n),i=typeof t=="function"?t(e&&r[e]||r):t;return O.jsx(a5,{styles:i})}const nne=["className","component"];function rne(t={}){const{themeId:e,defaultTheme:n,defaultClassName:r="MuiBox-root",generateClassName:i}=t,s=l5("div",{shouldForwardProp:a=>a!=="theme"&&a!=="sx"&&a!=="as"})(cv);return I.forwardRef(function(l,c){const u=E4(n),f=w4(l),{className:h,component:m="div"}=f,v=Nt(f,nne);return O.jsx(s,X({as:m,ref:c,className:Vt(h,i?i(r):r),theme:e&&u[e]||u},v))})}const S5=I.createContext(null);function C5(){return I.useContext(S5)}const ine=typeof Symbol=="function"&&Symbol.for,sne=ine?Symbol.for("mui.nested"):"__THEME_NESTED__";function one(t,e){return typeof e=="function"?e(t):X({},t,e)}function ane(t){const{children:e,theme:n}=t,r=C5(),i=I.useMemo(()=>{const s=r===null?n:one(r,n);return s!=null&&(s[sne]=r!==null),s},[n,r]);return O.jsx(S5.Provider,{value:i,children:e})}const lne=["value"],E5=I.createContext();function cne(t){let{value:e}=t,n=Nt(t,lne);return O.jsx(E5.Provider,X({value:e??!0},n))}const A5=()=>{const t=I.useContext(E5);return t??!1},a6={};function l6(t,e,n,r=!1){return I.useMemo(()=>{const i=t&&e[t]||e;if(typeof n=="function"){const s=n(i),o=t?X({},e,{[t]:s}):s;return r?()=>o:o}return t?X({},e,{[t]:n}):X({},e,n)},[t,e,n,r])}function une(t){const{children:e,theme:n,themeId:r}=t,i=b5(a6),s=C5()||a6,o=l6(r,i,n),a=l6(r,s,n,!0),l=o.direction==="rtl";return O.jsx(ane,{theme:a,children:O.jsx(iv.Provider,{value:o,children:O.jsx(cne,{value:l,children:O.jsx(Oq,{value:o==null?void 0:o.components,children:e})})})})}function Bu(){const t=E4(S4);return t[Wp]||t}const fne=["theme"];function dne(t){let{theme:e}=t,n=Nt(t,fne);const r=e[Wp];return O.jsx(une,X({},n,{themeId:r?Wp:void 0,theme:r||e}))}const c6=t=>{let e;return t<1?e=5.11916*t**2:e=4.5*Math.log(t+1)+2,(e/100).toFixed(2)};var fr={};/**
+ * @license React
+ * react-is.production.min.js
+ *
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */var A4=Symbol.for("react.element"),T4=Symbol.for("react.portal"),Vb=Symbol.for("react.fragment"),Wb=Symbol.for("react.strict_mode"),$b=Symbol.for("react.profiler"),Jb=Symbol.for("react.provider"),Yb=Symbol.for("react.context"),hne=Symbol.for("react.server_context"),Qb=Symbol.for("react.forward_ref"),Xb=Symbol.for("react.suspense"),Kb=Symbol.for("react.suspense_list"),Zb=Symbol.for("react.memo"),qb=Symbol.for("react.lazy"),pne=Symbol.for("react.offscreen"),T5;T5=Symbol.for("react.module.reference");function ua(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case A4:switch(t=t.type,t){case Vb:case $b:case Wb:case Xb:case Kb:return t;default:switch(t=t&&t.$$typeof,t){case hne:case Yb:case Qb:case qb:case Zb:case Jb:return t;default:return e}}case T4:return e}}}fr.ContextConsumer=Yb;fr.ContextProvider=Jb;fr.Element=A4;fr.ForwardRef=Qb;fr.Fragment=Vb;fr.Lazy=qb;fr.Memo=Zb;fr.Portal=T4;fr.Profiler=$b;fr.StrictMode=Wb;fr.Suspense=Xb;fr.SuspenseList=Kb;fr.isAsyncMode=function(){return!1};fr.isConcurrentMode=function(){return!1};fr.isContextConsumer=function(t){return ua(t)===Yb};fr.isContextProvider=function(t){return ua(t)===Jb};fr.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===A4};fr.isForwardRef=function(t){return ua(t)===Qb};fr.isFragment=function(t){return ua(t)===Vb};fr.isLazy=function(t){return ua(t)===qb};fr.isMemo=function(t){return ua(t)===Zb};fr.isPortal=function(t){return ua(t)===T4};fr.isProfiler=function(t){return ua(t)===$b};fr.isStrictMode=function(t){return ua(t)===Wb};fr.isSuspense=function(t){return ua(t)===Xb};fr.isSuspenseList=function(t){return ua(t)===Kb};fr.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===Vb||t===$b||t===Wb||t===Xb||t===Kb||t===pne||typeof t=="object"&&t!==null&&(t.$$typeof===qb||t.$$typeof===Zb||t.$$typeof===Jb||t.$$typeof===Yb||t.$$typeof===Qb||t.$$typeof===T5||t.getModuleId!==void 0)};fr.typeOf=ua;function GT(t,e){return GT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},GT(t,e)}function I5(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,GT(t,e)}const u6={disabled:!1},kM=qt.createContext(null);var mne=function(e){return e.scrollTop},ag="unmounted",If="exited",Lf="entering",Wh="entered",VT="exiting",fa=function(t){I5(e,t);function e(r,i){var s;s=t.call(this,r,i)||this;var o=i,a=o&&!o.isMounting?r.enter:r.appear,l;return s.appearStatus=null,r.in?a?(l=If,s.appearStatus=Lf):l=Wh:r.unmountOnExit||r.mountOnEnter?l=ag:l=If,s.state={status:l},s.nextCallback=null,s}e.getDerivedStateFromProps=function(i,s){var o=i.in;return o&&s.status===ag?{status:If}:null};var n=e.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(i){var s=null;if(i!==this.props){var o=this.state.status;this.props.in?o!==Lf&&o!==Wh&&(s=Lf):(o===Lf||o===Wh)&&(s=VT)}this.updateStatus(!1,s)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var i=this.props.timeout,s,o,a;return s=o=a=i,i!=null&&typeof i!="number"&&(s=i.exit,o=i.enter,a=i.appear!==void 0?i.appear:o),{exit:s,enter:o,appear:a}},n.updateStatus=function(i,s){if(i===void 0&&(i=!1),s!==null)if(this.cancelNextCallback(),s===Lf){if(this.props.unmountOnExit||this.props.mountOnEnter){var o=this.props.nodeRef?this.props.nodeRef.current:sg.findDOMNode(this);o&&mne(o)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===If&&this.setState({status:ag})},n.performEnter=function(i){var s=this,o=this.props.enter,a=this.context?this.context.isMounting:i,l=this.props.nodeRef?[a]:[sg.findDOMNode(this),a],c=l[0],u=l[1],f=this.getTimeouts(),h=a?f.appear:f.enter;if(!i&&!o||u6.disabled){this.safeSetState({status:Wh},function(){s.props.onEntered(c)});return}this.props.onEnter(c,u),this.safeSetState({status:Lf},function(){s.props.onEntering(c,u),s.onTransitionEnd(h,function(){s.safeSetState({status:Wh},function(){s.props.onEntered(c,u)})})})},n.performExit=function(){var i=this,s=this.props.exit,o=this.getTimeouts(),a=this.props.nodeRef?void 0:sg.findDOMNode(this);if(!s||u6.disabled){this.safeSetState({status:If},function(){i.props.onExited(a)});return}this.props.onExit(a),this.safeSetState({status:VT},function(){i.props.onExiting(a),i.onTransitionEnd(o.exit,function(){i.safeSetState({status:If},function(){i.props.onExited(a)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(i,s){s=this.setNextCallback(s),this.setState(i,s)},n.setNextCallback=function(i){var s=this,o=!0;return this.nextCallback=function(a){o&&(o=!1,s.nextCallback=null,i(a))},this.nextCallback.cancel=function(){o=!1},this.nextCallback},n.onTransitionEnd=function(i,s){this.setNextCallback(s);var o=this.props.nodeRef?this.props.nodeRef.current:sg.findDOMNode(this),a=i==null&&!this.props.addEndListener;if(!o||a){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[o,this.nextCallback],c=l[0],u=l[1];this.props.addEndListener(c,u)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===ag)return null;var s=this.props,o=s.children;s.in,s.mountOnEnter,s.unmountOnExit,s.appear,s.enter,s.exit,s.timeout,s.addEndListener,s.onEnter,s.onEntering,s.onEntered,s.onExit,s.onExiting,s.onExited,s.nodeRef;var a=Nt(s,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return qt.createElement(kM.Provider,{value:null},typeof o=="function"?o(i,a):qt.cloneElement(qt.Children.only(o),a))},e}(qt.Component);fa.contextType=kM;fa.propTypes={};function Mh(){}fa.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Mh,onEntering:Mh,onEntered:Mh,onExit:Mh,onExiting:Mh,onExited:Mh};fa.UNMOUNTED=ag;fa.EXITED=If;fa.ENTERING=Lf;fa.ENTERED=Wh;fa.EXITING=VT;function gne(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function I4(t,e){var n=function(s){return e&&I.isValidElement(s)?e(s):s},r=Object.create(null);return t&&I.Children.map(t,function(i){return i}).forEach(function(i){r[i.key]=n(i)}),r}function vne(t,e){t=t||{},e=e||{};function n(u){return u in e?e[u]:t[u]}var r=Object.create(null),i=[];for(var s in t)s in e?i.length&&(r[s]=i,i=[]):i.push(s);var o,a={};for(var l in e){if(r[l])for(o=0;ot.scrollTop;function lc(t,e){var n,r;const{timeout:i,easing:s,style:o={}}=t;return{duration:(n=o.transitionDuration)!=null?n:typeof i=="number"?i:i[e.mode]||0,easing:(r=o.transitionTimingFunction)!=null?r:typeof s=="object"?s[e.mode]:s,delay:o.transitionDelay}}function xne(t){return Mn("MuiCollapse",t)}fn("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const bne=["addEndListener","children","className","collapsedSize","component","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","orientation","style","timeout","TransitionComponent"],Sne=t=>{const{orientation:e,classes:n}=t,r={root:["root",`${e}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${e}`],wrapperInner:["wrapperInner",`${e}`]};return bn(r,xne,n)},Cne=Ct("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.orientation],n.state==="entered"&&e.entered,n.state==="exited"&&!n.in&&n.collapsedSize==="0px"&&e.hidden]}})(({theme:t,ownerState:e})=>X({height:0,overflow:"hidden",transition:t.transitions.create("height")},e.orientation==="horizontal"&&{height:"auto",width:0,transition:t.transitions.create("width")},e.state==="entered"&&X({height:"auto",overflow:"visible"},e.orientation==="horizontal"&&{width:"auto"}),e.state==="exited"&&!e.in&&e.collapsedSize==="0px"&&{visibility:"hidden"})),Ene=Ct("div",{name:"MuiCollapse",slot:"Wrapper",overridesResolver:(t,e)=>e.wrapper})(({ownerState:t})=>X({display:"flex",width:"100%"},t.orientation==="horizontal"&&{width:"auto",height:"100%"})),Ane=Ct("div",{name:"MuiCollapse",slot:"WrapperInner",overridesResolver:(t,e)=>e.wrapperInner})(({ownerState:t})=>X({width:"100%"},t.orientation==="horizontal"&&{width:"auto",height:"100%"})),L5=I.forwardRef(function(e,n){const r=gn({props:e,name:"MuiCollapse"}),{addEndListener:i,children:s,className:o,collapsedSize:a="0px",component:l,easing:c,in:u,onEnter:f,onEntered:h,onEntering:m,onExit:v,onExited:w,onExiting:y,orientation:g="vertical",style:_,timeout:x=M5.standard,TransitionComponent:S=fa}=r,D=Nt(r,bne),T=X({},r,{orientation:g,collapsedSize:a}),E=Sne(T),R=Bu(),C=Bb(),L=I.useRef(null),P=I.useRef(),z=typeof a=="number"?`${a}px`:a,B=g==="horizontal",Y=B?"width":"height",ie=I.useRef(null),ee=ni(n,ie),le=he=>Ie=>{if(he){const et=ie.current;Ie===void 0?he(et):he(et,Ie)}},j=()=>L.current?L.current[B?"clientWidth":"clientHeight"]:0,q=le((he,Ie)=>{L.current&&B&&(L.current.style.position="absolute"),he.style[Y]=z,f&&f(he,Ie)}),ne=le((he,Ie)=>{const et=j();L.current&&B&&(L.current.style.position="");const{duration:ct,easing:it}=lc({style:_,timeout:x,easing:c},{mode:"enter"});if(x==="auto"){const ut=R.transitions.getAutoHeightDuration(et);he.style.transitionDuration=`${ut}ms`,P.current=ut}else he.style.transitionDuration=typeof ct=="string"?ct:`${ct}ms`;he.style[Y]=`${et}px`,he.style.transitionTimingFunction=it,m&&m(he,Ie)}),de=le((he,Ie)=>{he.style[Y]="auto",h&&h(he,Ie)}),_e=le(he=>{he.style[Y]=`${j()}px`,v&&v(he)}),ge=le(w),ce=le(he=>{const Ie=j(),{duration:et,easing:ct}=lc({style:_,timeout:x,easing:c},{mode:"exit"});if(x==="auto"){const it=R.transitions.getAutoHeightDuration(Ie);he.style.transitionDuration=`${it}ms`,P.current=it}else he.style.transitionDuration=typeof et=="string"?et:`${et}ms`;he.style[Y]=z,he.style.transitionTimingFunction=ct,y&&y(he)}),we=he=>{x==="auto"&&C.start(P.current||0,he),i&&i(ie.current,he)};return O.jsx(S,X({in:u,onEnter:q,onEntered:de,onEntering:ne,onExit:_e,onExited:ge,onExiting:ce,addEndListener:we,nodeRef:ie,timeout:x==="auto"?null:x},D,{children:(he,Ie)=>O.jsx(Cne,X({as:l,className:Vt(E.root,o,{entered:E.entered,exited:!u&&z==="0px"&&E.hidden}[he]),style:X({[B?"minWidth":"minHeight"]:z},_),ref:ee},Ie,{ownerState:X({},T,{state:he}),children:O.jsx(Ene,{ownerState:X({},T,{state:he}),className:E.wrapper,ref:L,children:O.jsx(Ane,{ownerState:X({},T,{state:he}),className:E.wrapperInner,children:s})})}))}))});L5.muiSupportAuto=!0;function Tne(t){return Mn("MuiPaper",t)}fn("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const Ine=["className","component","elevation","square","variant"],Lne=t=>{const{square:e,elevation:n,variant:r,classes:i}=t,s={root:["root",r,!e&&"rounded",r==="elevation"&&`elevation${n}`]};return bn(s,Tne,i)},Rne=Ct("div",{name:"MuiPaper",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],!n.square&&e.rounded,n.variant==="elevation"&&e[`elevation${n.elevation}`]]}})(({theme:t,ownerState:e})=>{var n;return X({backgroundColor:(t.vars||t).palette.background.paper,color:(t.vars||t).palette.text.primary,transition:t.transitions.create("box-shadow")},!e.square&&{borderRadius:t.shape.borderRadius},e.variant==="outlined"&&{border:`1px solid ${(t.vars||t).palette.divider}`},e.variant==="elevation"&&X({boxShadow:(t.vars||t).shadows[e.elevation]},!t.vars&&t.palette.mode==="dark"&&{backgroundImage:`linear-gradient(${yo("#fff",c6(e.elevation))}, ${yo("#fff",c6(e.elevation))})`},t.vars&&{backgroundImage:(n=t.vars.overlays)==null?void 0:n[e.elevation]}))}),Ou=I.forwardRef(function(e,n){const r=gn({props:e,name:"MuiPaper"}),{className:i,component:s="div",elevation:o=1,square:a=!1,variant:l="elevation"}=r,c=Nt(r,Ine),u=X({},r,{component:s,elevation:o,square:a,variant:l}),f=Lne(u);return O.jsx(Rne,X({as:s,ownerState:u,className:Vt(f.root,i),ref:n},c))}),R5=I.createContext({});function $p(t){return typeof t=="string"}function P5(t,e,n){return t===void 0||$p(t)?e:X({},e,{ownerState:X({},e.ownerState,n)})}function BM(t,e=[]){if(t===void 0)return{};const n={};return Object.keys(t).filter(r=>r.match(/^on[A-Z]/)&&typeof t[r]=="function"&&!e.includes(r)).forEach(r=>{n[r]=t[r]}),n}function D5(t,e,n){return typeof t=="function"?t(e,n):t}function f6(t){if(t===void 0)return{};const e={};return Object.keys(t).filter(n=>!(n.match(/^on[A-Z]/)&&typeof t[n]=="function")).forEach(n=>{e[n]=t[n]}),e}function N5(t){const{getSlotProps:e,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:s}=t;if(!e){const m=Vt(n==null?void 0:n.className,s,i==null?void 0:i.className,r==null?void 0:r.className),v=X({},n==null?void 0:n.style,i==null?void 0:i.style,r==null?void 0:r.style),w=X({},n,i,r);return m.length>0&&(w.className=m),Object.keys(v).length>0&&(w.style=v),{props:w,internalRef:void 0}}const o=BM(X({},i,r)),a=f6(r),l=f6(i),c=e(o),u=Vt(c==null?void 0:c.className,n==null?void 0:n.className,s,i==null?void 0:i.className,r==null?void 0:r.className),f=X({},c==null?void 0:c.style,n==null?void 0:n.style,i==null?void 0:i.style,r==null?void 0:r.style),h=X({},c,n,l,a);return u.length>0&&(h.className=u),Object.keys(f).length>0&&(h.style=f),{props:h,internalRef:c.ref}}const Pne=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function vd(t){var e;const{elementType:n,externalSlotProps:r,ownerState:i,skipResolvingSlotProps:s=!1}=t,o=Nt(t,Pne),a=s?{}:D5(r,i),{props:l,internalRef:c}=N5(X({},o,{externalSlotProps:a})),u=ni(c,a==null?void 0:a.ref,(e=t.additionalProps)==null?void 0:e.ref);return P5(n,X({},l,{ref:u}),i)}const Dne=["className","elementType","ownerState","externalForwardedProps","getSlotOwnerState","internalForwardedProps"],Nne=["component","slots","slotProps"],kne=["component"];function OM(t,e){const{className:n,elementType:r,ownerState:i,externalForwardedProps:s,getSlotOwnerState:o,internalForwardedProps:a}=e,l=Nt(e,Dne),{component:c,slots:u={[t]:void 0},slotProps:f={[t]:void 0}}=s,h=Nt(s,Nne),m=u[t]||r,v=D5(f[t],i),w=N5(X({className:n},l,{externalForwardedProps:t==="root"?h:void 0,externalSlotProps:v})),{props:{component:y},internalRef:g}=w,_=Nt(w.props,kne),x=ni(g,v==null?void 0:v.ref,e.ref),S=o?o(_):{},D=X({},i,S),T=t==="root"?y||c:y,E=P5(m,X({},t==="root"&&!c&&!u[t]&&a,t!=="root"&&!u[t]&&a,_,T&&{as:T},{ref:x}),D);return Object.keys(S).forEach(R=>{delete E[R]}),[m,E]}function Bne(t){return Mn("MuiAccordion",t)}const nw=fn("MuiAccordion",["root","rounded","expanded","disabled","gutters","region"]),One=["children","className","defaultExpanded","disabled","disableGutters","expanded","onChange","square","slots","slotProps","TransitionComponent","TransitionProps"],Une=t=>{const{classes:e,square:n,expanded:r,disabled:i,disableGutters:s}=t;return bn({root:["root",!n&&"rounded",r&&"expanded",i&&"disabled",!s&&"gutters"],region:["region"]},Bne,e)},Fne=Ct(Ou,{name:"MuiAccordion",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${nw.region}`]:e.region},e.root,!n.square&&e.rounded,!n.disableGutters&&e.gutters]}})(({theme:t})=>{const e={duration:t.transitions.duration.shortest};return{position:"relative",transition:t.transitions.create(["margin"],e),overflowAnchor:"none","&::before":{position:"absolute",left:0,top:-1,right:0,height:1,content:'""',opacity:1,backgroundColor:(t.vars||t).palette.divider,transition:t.transitions.create(["opacity","background-color"],e)},"&:first-of-type":{"&::before":{display:"none"}},[`&.${nw.expanded}`]:{"&::before":{opacity:0},"&:first-of-type":{marginTop:0},"&:last-of-type":{marginBottom:0},"& + &":{"&::before":{display:"none"}}},[`&.${nw.disabled}`]:{backgroundColor:(t.vars||t).palette.action.disabledBackground}}},({theme:t})=>({variants:[{props:e=>!e.square,style:{borderRadius:0,"&:first-of-type":{borderTopLeftRadius:(t.vars||t).shape.borderRadius,borderTopRightRadius:(t.vars||t).shape.borderRadius},"&:last-of-type":{borderBottomLeftRadius:(t.vars||t).shape.borderRadius,borderBottomRightRadius:(t.vars||t).shape.borderRadius,"@supports (-ms-ime-align: auto)":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}}},{props:e=>!e.disableGutters,style:{[`&.${nw.expanded}`]:{margin:"16px 0"}}}]})),jne=I.forwardRef(function(e,n){const r=gn({props:e,name:"MuiAccordion"}),{children:i,className:s,defaultExpanded:o=!1,disabled:a=!1,disableGutters:l=!1,expanded:c,onChange:u,square:f=!1,slots:h={},slotProps:m={},TransitionComponent:v,TransitionProps:w}=r,y=Nt(r,One),[g,_]=RM({controlled:c,default:o,name:"Accordion",state:"expanded"}),x=I.useCallback(B=>{_(!g),u&&u(B,!g)},[g,u,_]),[S,...D]=I.Children.toArray(i),T=I.useMemo(()=>({expanded:g,disabled:a,disableGutters:l,toggle:x}),[g,a,l,x]),E=X({},r,{square:f,disabled:a,disableGutters:l,expanded:g}),R=Une(E),C=X({transition:v},h),L=X({transition:w},m),[P,z]=OM("transition",{elementType:L5,externalForwardedProps:{slots:C,slotProps:L},ownerState:E});return O.jsxs(Fne,X({className:Vt(R.root,s),ref:n,ownerState:E,square:f},y,{children:[O.jsx(R5.Provider,{value:T,children:S}),O.jsx(P,X({in:g,timeout:"auto"},z,{children:O.jsx("div",{"aria-labelledby":S.props.id,id:S.props["aria-controls"],role:"region",className:R.region,children:D})}))]}))});function zne(t){return Mn("MuiAccordionDetails",t)}fn("MuiAccordionDetails",["root"]);const Hne=["className"],Gne=t=>{const{classes:e}=t;return bn({root:["root"]},zne,e)},Vne=Ct("div",{name:"MuiAccordionDetails",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({padding:t.spacing(1,2,2)})),Wne=I.forwardRef(function(e,n){const r=gn({props:e,name:"MuiAccordionDetails"}),{className:i}=r,s=Nt(r,Hne),o=r,a=Gne(o);return O.jsx(Vne,X({className:Vt(a.root,i),ref:n,ownerState:o},s))});function $ne(t){const{className:e,classes:n,pulsate:r=!1,rippleX:i,rippleY:s,rippleSize:o,in:a,onExited:l,timeout:c}=t,[u,f]=I.useState(!1),h=Vt(e,n.ripple,n.rippleVisible,r&&n.ripplePulsate),m={width:o,height:o,top:-(o/2)+s,left:-(o/2)+i},v=Vt(n.child,u&&n.childLeaving,r&&n.childPulsate);return!a&&!u&&f(!0),I.useEffect(()=>{if(!a&&l!=null){const w=setTimeout(l,c);return()=>{clearTimeout(w)}}},[l,a,c]),O.jsx("span",{className:h,style:m,children:O.jsx("span",{className:v})})}const Jo=fn("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),Jne=["center","classes","className"];let e2=t=>t,d6,h6,p6,m6;const WT=550,Yne=80,Qne=Cm(d6||(d6=e2`
+ 0% {
+ transform: scale(0);
+ opacity: 0.1;
+ }
+
+ 100% {
+ transform: scale(1);
+ opacity: 0.3;
+ }
+`)),Xne=Cm(h6||(h6=e2`
+ 0% {
+ opacity: 1;
+ }
+
+ 100% {
+ opacity: 0;
+ }
+`)),Kne=Cm(p6||(p6=e2`
+ 0% {
+ transform: scale(1);
+ }
+
+ 50% {
+ transform: scale(0.92);
+ }
+
+ 100% {
+ transform: scale(1);
+ }
+`)),Zne=Ct("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),qne=Ct($ne,{name:"MuiTouchRipple",slot:"Ripple"})(m6||(m6=e2`
+ opacity: 0;
+ position: absolute;
+
+ &.${0} {
+ opacity: 0.3;
+ transform: scale(1);
+ animation-name: ${0};
+ animation-duration: ${0}ms;
+ animation-timing-function: ${0};
+ }
+
+ &.${0} {
+ animation-duration: ${0}ms;
+ }
+
+ & .${0} {
+ opacity: 1;
+ display: block;
+ width: 100%;
+ height: 100%;
+ border-radius: 50%;
+ background-color: currentColor;
+ }
+
+ & .${0} {
+ opacity: 0;
+ animation-name: ${0};
+ animation-duration: ${0}ms;
+ animation-timing-function: ${0};
+ }
+
+ & .${0} {
+ position: absolute;
+ /* @noflip */
+ left: 0px;
+ top: 0;
+ animation-name: ${0};
+ animation-duration: 2500ms;
+ animation-timing-function: ${0};
+ animation-iteration-count: infinite;
+ animation-delay: 200ms;
+ }
+`),Jo.rippleVisible,Qne,WT,({theme:t})=>t.transitions.easing.easeInOut,Jo.ripplePulsate,({theme:t})=>t.transitions.duration.shorter,Jo.child,Jo.childLeaving,Xne,WT,({theme:t})=>t.transitions.easing.easeInOut,Jo.childPulsate,Kne,({theme:t})=>t.transitions.easing.easeInOut),ere=I.forwardRef(function(e,n){const r=gn({props:e,name:"MuiTouchRipple"}),{center:i=!1,classes:s={},className:o}=r,a=Nt(r,Jne),[l,c]=I.useState([]),u=I.useRef(0),f=I.useRef(null);I.useEffect(()=>{f.current&&(f.current(),f.current=null)},[l]);const h=I.useRef(!1),m=Bb(),v=I.useRef(null),w=I.useRef(null),y=I.useCallback(S=>{const{pulsate:D,rippleX:T,rippleY:E,rippleSize:R,cb:C}=S;c(L=>[...L,O.jsx(qne,{classes:{ripple:Vt(s.ripple,Jo.ripple),rippleVisible:Vt(s.rippleVisible,Jo.rippleVisible),ripplePulsate:Vt(s.ripplePulsate,Jo.ripplePulsate),child:Vt(s.child,Jo.child),childLeaving:Vt(s.childLeaving,Jo.childLeaving),childPulsate:Vt(s.childPulsate,Jo.childPulsate)},timeout:WT,pulsate:D,rippleX:T,rippleY:E,rippleSize:R},u.current)]),u.current+=1,f.current=C},[s]),g=I.useCallback((S={},D={},T=()=>{})=>{const{pulsate:E=!1,center:R=i||D.pulsate,fakeElement:C=!1}=D;if((S==null?void 0:S.type)==="mousedown"&&h.current){h.current=!1;return}(S==null?void 0:S.type)==="touchstart"&&(h.current=!0);const L=C?null:w.current,P=L?L.getBoundingClientRect():{width:0,height:0,left:0,top:0};let z,B,Y;if(R||S===void 0||S.clientX===0&&S.clientY===0||!S.clientX&&!S.touches)z=Math.round(P.width/2),B=Math.round(P.height/2);else{const{clientX:ie,clientY:ee}=S.touches&&S.touches.length>0?S.touches[0]:S;z=Math.round(ie-P.left),B=Math.round(ee-P.top)}if(R)Y=Math.sqrt((2*P.width**2+P.height**2)/3),Y%2===0&&(Y+=1);else{const ie=Math.max(Math.abs((L?L.clientWidth:0)-z),z)*2+2,ee=Math.max(Math.abs((L?L.clientHeight:0)-B),B)*2+2;Y=Math.sqrt(ie**2+ee**2)}S!=null&&S.touches?v.current===null&&(v.current=()=>{y({pulsate:E,rippleX:z,rippleY:B,rippleSize:Y,cb:T})},m.start(Yne,()=>{v.current&&(v.current(),v.current=null)})):y({pulsate:E,rippleX:z,rippleY:B,rippleSize:Y,cb:T})},[i,y,m]),_=I.useCallback(()=>{g({},{pulsate:!0})},[g]),x=I.useCallback((S,D)=>{if(m.clear(),(S==null?void 0:S.type)==="touchend"&&v.current){v.current(),v.current=null,m.start(0,()=>{x(S,D)});return}v.current=null,c(T=>T.length>0?T.slice(1):T),f.current=D},[m]);return I.useImperativeHandle(n,()=>({pulsate:_,start:g,stop:x}),[_,g,x]),O.jsx(Zne,X({className:Vt(Jo.root,s.root,o),ref:w},a,{children:O.jsx(L4,{component:null,exit:!0,children:l})}))});function tre(t){return Mn("MuiButtonBase",t)}const nre=fn("MuiButtonBase",["root","disabled","focusVisible"]),rre=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],ire=t=>{const{disabled:e,focusVisible:n,focusVisibleClassName:r,classes:i}=t,o=bn({root:["root",e&&"disabled",n&&"focusVisible"]},tre,i);return n&&r&&(o.root+=` ${r}`),o},sre=Ct("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${nre.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),t2=I.forwardRef(function(e,n){const r=gn({props:e,name:"MuiButtonBase"}),{action:i,centerRipple:s=!1,children:o,className:a,component:l="button",disabled:c=!1,disableRipple:u=!1,disableTouchRipple:f=!1,focusRipple:h=!1,LinkComponent:m="a",onBlur:v,onClick:w,onContextMenu:y,onDragLeave:g,onFocus:_,onFocusVisible:x,onKeyDown:S,onKeyUp:D,onMouseDown:T,onMouseLeave:E,onMouseUp:R,onTouchEnd:C,onTouchMove:L,onTouchStart:P,tabIndex:z=0,TouchRippleProps:B,touchRippleRef:Y,type:ie}=r,ee=Nt(r,rre),le=I.useRef(null),j=I.useRef(null),q=ni(j,Y),{isFocusVisibleRef:ne,onFocus:de,onBlur:_e,ref:ge}=r5(),[ce,we]=I.useState(!1);c&&ce&&we(!1),I.useImperativeHandle(i,()=>({focusVisible:()=>{we(!0),le.current.focus()}}),[]);const[he,Ie]=I.useState(!1);I.useEffect(()=>{Ie(!0)},[]);const et=he&&!u&&!c;I.useEffect(()=>{ce&&h&&!u&&he&&j.current.pulsate()},[u,h,ce,he]);function ct(Ke,nt,_t=f){return vo(Qt=>(nt&&nt(Qt),!_t&&j.current&&j.current[Ke](Qt),!0))}const it=ct("start",T),ut=ct("stop",y),$=ct("stop",g),Ce=ct("stop",R),Ne=ct("stop",Ke=>{ce&&Ke.preventDefault(),E&&E(Ke)}),ze=ct("start",P),Ue=ct("stop",C),Et=ct("stop",L),lt=ct("stop",Ke=>{_e(Ke),ne.current===!1&&we(!1),v&&v(Ke)},!1),yt=vo(Ke=>{le.current||(le.current=Ke.currentTarget),de(Ke),ne.current===!0&&(we(!0),x&&x(Ke)),_&&_(Ke)}),re=()=>{const Ke=le.current;return l&&l!=="button"&&!(Ke.tagName==="A"&&Ke.href)},V=I.useRef(!1),Ee=vo(Ke=>{h&&!V.current&&ce&&j.current&&Ke.key===" "&&(V.current=!0,j.current.stop(Ke,()=>{j.current.start(Ke)})),Ke.target===Ke.currentTarget&&re()&&Ke.key===" "&&Ke.preventDefault(),S&&S(Ke),Ke.target===Ke.currentTarget&&re()&&Ke.key==="Enter"&&!c&&(Ke.preventDefault(),w&&w(Ke))}),je=vo(Ke=>{h&&Ke.key===" "&&j.current&&ce&&!Ke.defaultPrevented&&(V.current=!1,j.current.stop(Ke,()=>{j.current.pulsate(Ke)})),D&&D(Ke),w&&Ke.target===Ke.currentTarget&&re()&&Ke.key===" "&&!Ke.defaultPrevented&&w(Ke)});let De=l;De==="button"&&(ee.href||ee.to)&&(De=m);const He={};De==="button"?(He.type=ie===void 0?"button":ie,He.disabled=c):(!ee.href&&!ee.to&&(He.role="button"),c&&(He["aria-disabled"]=c));const pt=ni(n,ge,le),Qe=X({},r,{centerRipple:s,component:l,disabled:c,disableRipple:u,disableTouchRipple:f,focusRipple:h,tabIndex:z,focusVisible:ce}),Ye=ire(Qe);return O.jsxs(sre,X({as:De,className:Vt(Ye.root,a),ownerState:Qe,onBlur:lt,onClick:w,onContextMenu:ut,onFocus:yt,onKeyDown:Ee,onKeyUp:je,onMouseDown:it,onMouseLeave:Ne,onMouseUp:Ce,onDragLeave:$,onTouchEnd:Ue,onTouchMove:Et,onTouchStart:ze,ref:pt,tabIndex:c?-1:z,type:ie},He,ee,{children:[o,et?O.jsx(ere,X({ref:q,center:s},B)):null]}))});function ore(t){return Mn("MuiAccordionSummary",t)}const fp=fn("MuiAccordionSummary",["root","expanded","focusVisible","disabled","gutters","contentGutters","content","expandIconWrapper"]),are=["children","className","expandIcon","focusVisibleClassName","onClick"],lre=t=>{const{classes:e,expanded:n,disabled:r,disableGutters:i}=t;return bn({root:["root",n&&"expanded",r&&"disabled",!i&&"gutters"],focusVisible:["focusVisible"],content:["content",n&&"expanded",!i&&"contentGutters"],expandIconWrapper:["expandIconWrapper",n&&"expanded"]},ore,e)},cre=Ct(t2,{name:"MuiAccordionSummary",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>{const e={duration:t.transitions.duration.shortest};return{display:"flex",minHeight:48,padding:t.spacing(0,2),transition:t.transitions.create(["min-height","background-color"],e),[`&.${fp.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${fp.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity},[`&:hover:not(.${fp.disabled})`]:{cursor:"pointer"},variants:[{props:n=>!n.disableGutters,style:{[`&.${fp.expanded}`]:{minHeight:64}}}]}}),ure=Ct("div",{name:"MuiAccordionSummary",slot:"Content",overridesResolver:(t,e)=>e.content})(({theme:t})=>({display:"flex",flexGrow:1,margin:"12px 0",variants:[{props:e=>!e.disableGutters,style:{transition:t.transitions.create(["margin"],{duration:t.transitions.duration.shortest}),[`&.${fp.expanded}`]:{margin:"20px 0"}}}]})),fre=Ct("div",{name:"MuiAccordionSummary",slot:"ExpandIconWrapper",overridesResolver:(t,e)=>e.expandIconWrapper})(({theme:t})=>({display:"flex",color:(t.vars||t).palette.action.active,transform:"rotate(0deg)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shortest}),[`&.${fp.expanded}`]:{transform:"rotate(180deg)"}})),dre=I.forwardRef(function(e,n){const r=gn({props:e,name:"MuiAccordionSummary"}),{children:i,className:s,expandIcon:o,focusVisibleClassName:a,onClick:l}=r,c=Nt(r,are),{disabled:u=!1,disableGutters:f,expanded:h,toggle:m}=I.useContext(R5),v=g=>{m&&m(g),l&&l(g)},w=X({},r,{expanded:h,disabled:u,disableGutters:f}),y=lre(w);return O.jsxs(cre,X({focusRipple:!1,disableRipple:!0,disabled:u,component:"div","aria-expanded":h,className:Vt(y.root,s),focusVisibleClassName:Vt(y.focusVisible,a),onClick:v,ref:n,ownerState:w},c,{children:[O.jsx(ure,{className:y.content,ownerState:w,children:i}),o&&O.jsx(fre,{className:y.expandIconWrapper,ownerState:w,children:o})]}))});function hre(t){return Mn("MuiAlert",t)}const g6=fn("MuiAlert",["root","action","icon","message","filled","colorSuccess","colorInfo","colorWarning","colorError","filledSuccess","filledInfo","filledWarning","filledError","outlined","outlinedSuccess","outlinedInfo","outlinedWarning","outlinedError","standard","standardSuccess","standardInfo","standardWarning","standardError"]);function pre(t){return Mn("MuiIconButton",t)}const mre=fn("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]),gre=["edge","children","className","color","disabled","disableFocusRipple","size"],vre=t=>{const{classes:e,disabled:n,color:r,edge:i,size:s}=t,o={root:["root",n&&"disabled",r!=="default"&&`color${zt(r)}`,i&&`edge${zt(i)}`,`size${zt(s)}`]};return bn(o,pre,e)},yre=Ct(t2,{name:"MuiIconButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.color!=="default"&&e[`color${zt(n.color)}`],n.edge&&e[`edge${zt(n.edge)}`],e[`size${zt(n.size)}`]]}})(({theme:t,ownerState:e})=>X({textAlign:"center",flex:"0 0 auto",fontSize:t.typography.pxToRem(24),padding:8,borderRadius:"50%",overflow:"visible",color:(t.vars||t).palette.action.active,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest})},!e.disableRipple&&{"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:yo(t.palette.action.active,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},e.edge==="start"&&{marginLeft:e.size==="small"?-3:-12},e.edge==="end"&&{marginRight:e.size==="small"?-3:-12}),({theme:t,ownerState:e})=>{var n;const r=(n=(t.vars||t).palette)==null?void 0:n[e.color];return X({},e.color==="inherit"&&{color:"inherit"},e.color!=="inherit"&&e.color!=="default"&&X({color:r==null?void 0:r.main},!e.disableRipple&&{"&:hover":X({},r&&{backgroundColor:t.vars?`rgba(${r.mainChannel} / ${t.vars.palette.action.hoverOpacity})`:yo(r.main,t.palette.action.hoverOpacity)},{"@media (hover: none)":{backgroundColor:"transparent"}})}),e.size==="small"&&{padding:5,fontSize:t.typography.pxToRem(18)},e.size==="large"&&{padding:12,fontSize:t.typography.pxToRem(28)},{[`&.${mre.disabled}`]:{backgroundColor:"transparent",color:(t.vars||t).palette.action.disabled}})}),wre=I.forwardRef(function(e,n){const r=gn({props:e,name:"MuiIconButton"}),{edge:i=!1,children:s,className:o,color:a="default",disabled:l=!1,disableFocusRipple:c=!1,size:u="medium"}=r,f=Nt(r,gre),h=X({},r,{edge:i,color:a,disabled:l,disableFocusRipple:c,size:u}),m=vre(h);return O.jsx(yre,X({className:Vt(m.root,o),centerRipple:!0,focusRipple:!c,disabled:l,ref:n},f,{ownerState:h,children:s}))}),_re=ku(O.jsx("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"}),"SuccessOutlined"),Mre=ku(O.jsx("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"}),"ReportProblemOutlined"),xre=ku(O.jsx("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"ErrorOutline"),bre=ku(O.jsx("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"}),"InfoOutlined"),Sre=ku(O.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),Cre=["action","children","className","closeText","color","components","componentsProps","icon","iconMapping","onClose","role","severity","slotProps","slots","variant"],Ere=t=>{const{variant:e,color:n,severity:r,classes:i}=t,s={root:["root",`color${zt(n||r)}`,`${e}${zt(n||r)}`,`${e}`],icon:["icon"],message:["message"],action:["action"]};return bn(s,hre,i)},Are=Ct(Ou,{name:"MuiAlert",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],e[`${n.variant}${zt(n.color||n.severity)}`]]}})(({theme:t})=>{const e=t.palette.mode==="light"?jT:zT,n=t.palette.mode==="light"?zT:jT;return X({},t.typography.body2,{backgroundColor:"transparent",display:"flex",padding:"6px 16px",variants:[...Object.entries(t.palette).filter(([,r])=>r.main&&r.light).map(([r])=>({props:{colorSeverity:r,variant:"standard"},style:{color:t.vars?t.vars.palette.Alert[`${r}Color`]:e(t.palette[r].light,.6),backgroundColor:t.vars?t.vars.palette.Alert[`${r}StandardBg`]:n(t.palette[r].light,.9),[`& .${g6.icon}`]:t.vars?{color:t.vars.palette.Alert[`${r}IconColor`]}:{color:t.palette[r].main}}})),...Object.entries(t.palette).filter(([,r])=>r.main&&r.light).map(([r])=>({props:{colorSeverity:r,variant:"outlined"},style:{color:t.vars?t.vars.palette.Alert[`${r}Color`]:e(t.palette[r].light,.6),border:`1px solid ${(t.vars||t).palette[r].light}`,[`& .${g6.icon}`]:t.vars?{color:t.vars.palette.Alert[`${r}IconColor`]}:{color:t.palette[r].main}}})),...Object.entries(t.palette).filter(([,r])=>r.main&&r.dark).map(([r])=>({props:{colorSeverity:r,variant:"filled"},style:X({fontWeight:t.typography.fontWeightMedium},t.vars?{color:t.vars.palette.Alert[`${r}FilledColor`],backgroundColor:t.vars.palette.Alert[`${r}FilledBg`]}:{backgroundColor:t.palette.mode==="dark"?t.palette[r].dark:t.palette[r].main,color:t.palette.getContrastText(t.palette[r].main)})}))]})}),Tre=Ct("div",{name:"MuiAlert",slot:"Icon",overridesResolver:(t,e)=>e.icon})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),Ire=Ct("div",{name:"MuiAlert",slot:"Message",overridesResolver:(t,e)=>e.message})({padding:"8px 0",minWidth:0,overflow:"auto"}),v6=Ct("div",{name:"MuiAlert",slot:"Action",overridesResolver:(t,e)=>e.action})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),y6={success:O.jsx(_re,{fontSize:"inherit"}),warning:O.jsx(Mre,{fontSize:"inherit"}),error:O.jsx(xre,{fontSize:"inherit"}),info:O.jsx(bre,{fontSize:"inherit"})},k5=I.forwardRef(function(e,n){const r=gn({props:e,name:"MuiAlert"}),{action:i,children:s,className:o,closeText:a="Close",color:l,components:c={},componentsProps:u={},icon:f,iconMapping:h=y6,onClose:m,role:v="alert",severity:w="success",slotProps:y={},slots:g={},variant:_="standard"}=r,x=Nt(r,Cre),S=X({},r,{color:l,severity:w,variant:_,colorSeverity:l||w}),D=Ere(S),T={slots:X({closeButton:c.CloseButton,closeIcon:c.CloseIcon},g),slotProps:X({},u,y)},[E,R]=OM("closeButton",{elementType:wre,externalForwardedProps:T,ownerState:S}),[C,L]=OM("closeIcon",{elementType:Sre,externalForwardedProps:T,ownerState:S});return O.jsxs(Are,X({role:v,elevation:0,ownerState:S,className:Vt(D.root,o),ref:n},x,{children:[f!==!1?O.jsx(Tre,{ownerState:S,className:D.icon,children:f||h[w]||y6[w]}):null,O.jsx(Ire,{ownerState:S,className:D.message,children:s}),i!=null?O.jsx(v6,{ownerState:S,className:D.action,children:i}):null,i==null&&m?O.jsx(v6,{ownerState:S,className:D.action,children:O.jsx(E,X({size:"small","aria-label":a,title:a,color:"inherit",onClick:m},R,{children:O.jsx(C,X({fontSize:"small"},L))}))}):null]}))});function Lre(t){return Mn("MuiTypography",t)}fn("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const Rre=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],Pre=t=>{const{align:e,gutterBottom:n,noWrap:r,paragraph:i,variant:s,classes:o}=t,a={root:["root",s,t.align!=="inherit"&&`align${zt(e)}`,n&&"gutterBottom",r&&"noWrap",i&&"paragraph"]};return bn(a,Lre,o)},Dre=Ct("span",{name:"MuiTypography",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.variant&&e[n.variant],n.align!=="inherit"&&e[`align${zt(n.align)}`],n.noWrap&&e.noWrap,n.gutterBottom&&e.gutterBottom,n.paragraph&&e.paragraph]}})(({theme:t,ownerState:e})=>X({margin:0},e.variant==="inherit"&&{font:"inherit"},e.variant!=="inherit"&&t.typography[e.variant],e.align!=="inherit"&&{textAlign:e.align},e.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},e.gutterBottom&&{marginBottom:"0.35em"},e.paragraph&&{marginBottom:16})),w6={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},Nre={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},kre=t=>Nre[t]||t,Bre=I.forwardRef(function(e,n){const r=gn({props:e,name:"MuiTypography"}),i=kre(r.color),s=w4(X({},r,{color:i})),{align:o="inherit",className:a,component:l,gutterBottom:c=!1,noWrap:u=!1,paragraph:f=!1,variant:h="body1",variantMapping:m=w6}=s,v=Nt(s,Rre),w=X({},s,{align:o,color:i,className:a,component:l,gutterBottom:c,noWrap:u,paragraph:f,variant:h,variantMapping:m}),y=l||(f?"p":m[h]||w6[h])||"span",g=Pre(w);return O.jsx(Dre,X({as:y,ref:n,ownerState:w,className:Vt(g.root,a)},v))});function Ore(t){return Mn("MuiAppBar",t)}fn("MuiAppBar",["root","positionFixed","positionAbsolute","positionSticky","positionStatic","positionRelative","colorDefault","colorPrimary","colorSecondary","colorInherit","colorTransparent","colorError","colorInfo","colorSuccess","colorWarning"]);const Ure=["className","color","enableColorOnDark","position"],Fre=t=>{const{color:e,position:n,classes:r}=t,i={root:["root",`color${zt(e)}`,`position${zt(n)}`]};return bn(i,Ore,r)},rw=(t,e)=>t?`${t==null?void 0:t.replace(")","")}, ${e})`:e,jre=Ct(Ou,{name:"MuiAppBar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`position${zt(n.position)}`],e[`color${zt(n.color)}`]]}})(({theme:t,ownerState:e})=>{const n=t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[900];return X({display:"flex",flexDirection:"column",width:"100%",boxSizing:"border-box",flexShrink:0},e.position==="fixed"&&{position:"fixed",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0,"@media print":{position:"absolute"}},e.position==="absolute"&&{position:"absolute",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0},e.position==="sticky"&&{position:"sticky",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0},e.position==="static"&&{position:"static"},e.position==="relative"&&{position:"relative"},!t.vars&&X({},e.color==="default"&&{backgroundColor:n,color:t.palette.getContrastText(n)},e.color&&e.color!=="default"&&e.color!=="inherit"&&e.color!=="transparent"&&{backgroundColor:t.palette[e.color].main,color:t.palette[e.color].contrastText},e.color==="inherit"&&{color:"inherit"},t.palette.mode==="dark"&&!e.enableColorOnDark&&{backgroundColor:null,color:null},e.color==="transparent"&&X({backgroundColor:"transparent",color:"inherit"},t.palette.mode==="dark"&&{backgroundImage:"none"})),t.vars&&X({},e.color==="default"&&{"--AppBar-background":e.enableColorOnDark?t.vars.palette.AppBar.defaultBg:rw(t.vars.palette.AppBar.darkBg,t.vars.palette.AppBar.defaultBg),"--AppBar-color":e.enableColorOnDark?t.vars.palette.text.primary:rw(t.vars.palette.AppBar.darkColor,t.vars.palette.text.primary)},e.color&&!e.color.match(/^(default|inherit|transparent)$/)&&{"--AppBar-background":e.enableColorOnDark?t.vars.palette[e.color].main:rw(t.vars.palette.AppBar.darkBg,t.vars.palette[e.color].main),"--AppBar-color":e.enableColorOnDark?t.vars.palette[e.color].contrastText:rw(t.vars.palette.AppBar.darkColor,t.vars.palette[e.color].contrastText)},!["inherit","transparent"].includes(e.color)&&{backgroundColor:"var(--AppBar-background)"},{color:e.color==="inherit"?"inherit":"var(--AppBar-color)"},e.color==="transparent"&&{backgroundImage:"none",backgroundColor:"transparent",color:"inherit"}))}),zre=I.forwardRef(function(e,n){const r=gn({props:e,name:"MuiAppBar"}),{className:i,color:s="primary",enableColorOnDark:o=!1,position:a="fixed"}=r,l=Nt(r,Ure),c=X({},r,{color:s,position:a,enableColorOnDark:o}),u=Fre(c);return O.jsx(jre,X({square:!0,component:"header",ownerState:c,elevation:4,className:Vt(u.root,i,a==="fixed"&&"mui-fixed"),ref:n},l))});function _6(t){return t.substring(2).toLowerCase()}function Hre(t,e){return e.documentElement.clientWidth(setTimeout(()=>{l.current=!0},0),()=>{l.current=!1}),[]);const u=ni(e.ref,a),f=vo(v=>{const w=c.current;c.current=!1;const y=Zr(a.current);if(!l.current||!a.current||"clientX"in v&&Hre(v,y))return;if(o.current){o.current=!1;return}let g;v.composedPath?g=v.composedPath().indexOf(a.current)>-1:g=!y.documentElement.contains(v.target)||a.current.contains(v.target),!g&&(n||!w)&&i(v)}),h=v=>w=>{c.current=!0;const y=e.props[v];y&&y(w)},m={ref:u};return s!==!1&&(m[s]=h(s)),I.useEffect(()=>{if(s!==!1){const v=_6(s),w=Zr(a.current),y=()=>{o.current=!0};return w.addEventListener(v,f),w.addEventListener("touchmove",y),()=>{w.removeEventListener(v,f),w.removeEventListener("touchmove",y)}}},[f,s]),r!==!1&&(m[r]=h(r)),I.useEffect(()=>{if(r!==!1){const v=_6(r),w=Zr(a.current);return w.addEventListener(v,f),()=>{w.removeEventListener(v,f)}}},[f,r]),O.jsx(I.Fragment,{children:I.cloneElement(e,m)})}const Vre=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function Wre(t){const e=parseInt(t.getAttribute("tabindex")||"",10);return Number.isNaN(e)?t.contentEditable==="true"||(t.nodeName==="AUDIO"||t.nodeName==="VIDEO"||t.nodeName==="DETAILS")&&t.getAttribute("tabindex")===null?0:t.tabIndex:e}function $re(t){if(t.tagName!=="INPUT"||t.type!=="radio"||!t.name)return!1;const e=r=>t.ownerDocument.querySelector(`input[type="radio"]${r}`);let n=e(`[name="${t.name}"]:checked`);return n||(n=e(`[name="${t.name}"]`)),n!==t}function Jre(t){return!(t.disabled||t.tagName==="INPUT"&&t.type==="hidden"||$re(t))}function Yre(t){const e=[],n=[];return Array.from(t.querySelectorAll(Vre)).forEach((r,i)=>{const s=Wre(r);s===-1||!Jre(r)||(s===0?e.push(r):n.push({documentOrder:i,tabIndex:s,node:r}))}),n.sort((r,i)=>r.tabIndex===i.tabIndex?r.documentOrder-i.documentOrder:r.tabIndex-i.tabIndex).map(r=>r.node).concat(e)}function Qre(){return!0}function Xre(t){const{children:e,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:i=!1,getTabbable:s=Yre,isEnabled:o=Qre,open:a}=t,l=I.useRef(!1),c=I.useRef(null),u=I.useRef(null),f=I.useRef(null),h=I.useRef(null),m=I.useRef(!1),v=I.useRef(null),w=ni(e.ref,v),y=I.useRef(null);I.useEffect(()=>{!a||!v.current||(m.current=!n)},[n,a]),I.useEffect(()=>{if(!a||!v.current)return;const x=Zr(v.current);return v.current.contains(x.activeElement)||(v.current.hasAttribute("tabIndex")||v.current.setAttribute("tabIndex","-1"),m.current&&v.current.focus()),()=>{i||(f.current&&f.current.focus&&(l.current=!0,f.current.focus()),f.current=null)}},[a]),I.useEffect(()=>{if(!a||!v.current)return;const x=Zr(v.current),S=E=>{y.current=E,!(r||!o()||E.key!=="Tab")&&x.activeElement===v.current&&E.shiftKey&&(l.current=!0,u.current&&u.current.focus())},D=()=>{const E=v.current;if(E===null)return;if(!x.hasFocus()||!o()||l.current){l.current=!1;return}if(E.contains(x.activeElement)||r&&x.activeElement!==c.current&&x.activeElement!==u.current)return;if(x.activeElement!==h.current)h.current=null;else if(h.current!==null)return;if(!m.current)return;let R=[];if((x.activeElement===c.current||x.activeElement===u.current)&&(R=s(v.current)),R.length>0){var C,L;const P=!!((C=y.current)!=null&&C.shiftKey&&((L=y.current)==null?void 0:L.key)==="Tab"),z=R[0],B=R[R.length-1];typeof z!="string"&&typeof B!="string"&&(P?B.focus():z.focus())}else E.focus()};x.addEventListener("focusin",D),x.addEventListener("keydown",S,!0);const T=setInterval(()=>{x.activeElement&&x.activeElement.tagName==="BODY"&&D()},50);return()=>{clearInterval(T),x.removeEventListener("focusin",D),x.removeEventListener("keydown",S,!0)}},[n,r,i,o,a,s]);const g=x=>{f.current===null&&(f.current=x.relatedTarget),m.current=!0,h.current=x.target;const S=e.props.onFocus;S&&S(x)},_=x=>{f.current===null&&(f.current=x.relatedTarget),m.current=!0};return O.jsxs(I.Fragment,{children:[O.jsx("div",{tabIndex:a?0:-1,onFocus:_,ref:c,"data-testid":"sentinelStart"}),I.cloneElement(e,{ref:w,onFocus:g}),O.jsx("div",{tabIndex:a?0:-1,onFocus:_,ref:u,"data-testid":"sentinelEnd"})]})}function Kre(t){return typeof t=="function"?t():t}const Zre=I.forwardRef(function(e,n){const{children:r,container:i,disablePortal:s=!1}=e,[o,a]=I.useState(null),l=ni(I.isValidElement(r)?r.ref:null,n);if(Oa(()=>{s||a(Kre(i)||document.body)},[i,s]),Oa(()=>{if(o&&!s)return LM(n,o),()=>{LM(n,null)}},[n,o,s]),s){if(I.isValidElement(r)){const c={ref:l};return I.cloneElement(r,c)}return O.jsx(I.Fragment,{children:r})}return O.jsx(I.Fragment,{children:o&&md.createPortal(r,o)})});function qre(t){const e=Zr(t);return e.body===t?Ks(t).innerWidth>e.documentElement.clientWidth:t.scrollHeight>t.clientHeight}function Lg(t,e){e?t.setAttribute("aria-hidden","true"):t.removeAttribute("aria-hidden")}function M6(t){return parseInt(Ks(t).getComputedStyle(t).paddingRight,10)||0}function eie(t){const n=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].indexOf(t.tagName)!==-1,r=t.tagName==="INPUT"&&t.getAttribute("type")==="hidden";return n||r}function x6(t,e,n,r,i){const s=[e,n,...r];[].forEach.call(t.children,o=>{const a=s.indexOf(o)===-1,l=!eie(o);a&&l&&Lg(o,i)})}function nE(t,e){let n=-1;return t.some((r,i)=>e(r)?(n=i,!0):!1),n}function tie(t,e){const n=[],r=t.container;if(!e.disableScrollLock){if(qre(r)){const o=i5(Zr(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${M6(r)+o}px`;const a=Zr(r).querySelectorAll(".mui-fixed");[].forEach.call(a,l=>{n.push({value:l.style.paddingRight,property:"padding-right",el:l}),l.style.paddingRight=`${M6(l)+o}px`})}let s;if(r.parentNode instanceof DocumentFragment)s=Zr(r).body;else{const o=r.parentElement,a=Ks(r);s=(o==null?void 0:o.nodeName)==="HTML"&&a.getComputedStyle(o).overflowY==="scroll"?o:r}n.push({value:s.style.overflow,property:"overflow",el:s},{value:s.style.overflowX,property:"overflow-x",el:s},{value:s.style.overflowY,property:"overflow-y",el:s}),s.style.overflow="hidden"}return()=>{n.forEach(({value:s,el:o,property:a})=>{s?o.style.setProperty(a,s):o.style.removeProperty(a)})}}function nie(t){const e=[];return[].forEach.call(t.children,n=>{n.getAttribute("aria-hidden")==="true"&&e.push(n)}),e}class rie{constructor(){this.containers=void 0,this.modals=void 0,this.modals=[],this.containers=[]}add(e,n){let r=this.modals.indexOf(e);if(r!==-1)return r;r=this.modals.length,this.modals.push(e),e.modalRef&&Lg(e.modalRef,!1);const i=nie(n);x6(n,e.mount,e.modalRef,i,!0);const s=nE(this.containers,o=>o.container===n);return s!==-1?(this.containers[s].modals.push(e),r):(this.containers.push({modals:[e],container:n,restore:null,hiddenSiblings:i}),r)}mount(e,n){const r=nE(this.containers,s=>s.modals.indexOf(e)!==-1),i=this.containers[r];i.restore||(i.restore=tie(i,n))}remove(e,n=!0){const r=this.modals.indexOf(e);if(r===-1)return r;const i=nE(this.containers,o=>o.modals.indexOf(e)!==-1),s=this.containers[i];if(s.modals.splice(s.modals.indexOf(e),1),this.modals.splice(r,1),s.modals.length===0)s.restore&&s.restore(),e.modalRef&&Lg(e.modalRef,n),x6(s.container,e.mount,e.modalRef,s.hiddenSiblings,!1),this.containers.splice(i,1);else{const o=s.modals[s.modals.length-1];o.modalRef&&Lg(o.modalRef,!1)}return r}isTopModal(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}}function iie(t){return typeof t=="function"?t():t}function sie(t){return t?t.props.hasOwnProperty("in"):!1}const oie=new rie;function aie(t){const{container:e,disableEscapeKeyDown:n=!1,disableScrollLock:r=!1,manager:i=oie,closeAfterTransition:s=!1,onTransitionEnter:o,onTransitionExited:a,children:l,onClose:c,open:u,rootRef:f}=t,h=I.useRef({}),m=I.useRef(null),v=I.useRef(null),w=ni(v,f),[y,g]=I.useState(!u),_=sie(l);let x=!0;(t["aria-hidden"]==="false"||t["aria-hidden"]===!1)&&(x=!1);const S=()=>Zr(m.current),D=()=>(h.current.modalRef=v.current,h.current.mount=m.current,h.current),T=()=>{i.mount(D(),{disableScrollLock:r}),v.current&&(v.current.scrollTop=0)},E=vo(()=>{const ee=iie(e)||S().body;i.add(D(),ee),v.current&&T()}),R=I.useCallback(()=>i.isTopModal(D()),[i]),C=vo(ee=>{m.current=ee,ee&&(u&&R()?T():v.current&&Lg(v.current,x))}),L=I.useCallback(()=>{i.remove(D(),x)},[x,i]);I.useEffect(()=>()=>{L()},[L]),I.useEffect(()=>{u?E():(!_||!s)&&L()},[u,L,_,s,E]);const P=ee=>le=>{var j;(j=ee.onKeyDown)==null||j.call(ee,le),!(le.key!=="Escape"||le.which===229||!R())&&(n||(le.stopPropagation(),c&&c(le,"escapeKeyDown")))},z=ee=>le=>{var j;(j=ee.onClick)==null||j.call(ee,le),le.target===le.currentTarget&&c&&c(le,"backdropClick")};return{getRootProps:(ee={})=>{const le=BM(t);delete le.onTransitionEnter,delete le.onTransitionExited;const j=X({},le,ee);return X({role:"presentation"},j,{onKeyDown:P(j),ref:w})},getBackdropProps:(ee={})=>{const le=ee;return X({"aria-hidden":!0},le,{onClick:z(le),open:u})},getTransitionProps:()=>{const ee=()=>{g(!1),o&&o()},le=()=>{g(!0),a&&a(),s&&L()};return{onEnter:BT(ee,l==null?void 0:l.props.onEnter),onExited:BT(le,l==null?void 0:l.props.onExited)}},rootRef:w,portalRef:C,isTopModal:R,exited:y,hasTransition:_}}function lie(t){const{children:e,defer:n=!1,fallback:r=null}=t,[i,s]=I.useState(!1);return Oa(()=>{n||s(!0)},[n]),I.useEffect(()=>{n&&s(!0)},[n]),O.jsx(I.Fragment,{children:i?e:r})}function cie(t={}){const{autoHideDuration:e=null,disableWindowBlurListener:n=!1,onClose:r,open:i,resumeHideDuration:s}=t,o=Bb();I.useEffect(()=>{if(!i)return;function g(_){_.defaultPrevented||(_.key==="Escape"||_.key==="Esc")&&(r==null||r(_,"escapeKeyDown"))}return document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g)}},[i,r]);const a=vo((g,_)=>{r==null||r(g,_)}),l=vo(g=>{!r||g==null||o.start(g,()=>{a(null,"timeout")})});I.useEffect(()=>(i&&l(e),o.clear),[i,e,l,o]);const c=g=>{r==null||r(g,"clickaway")},u=o.clear,f=I.useCallback(()=>{e!=null&&l(s??e*.5)},[e,s,l]),h=g=>_=>{const x=g.onBlur;x==null||x(_),f()},m=g=>_=>{const x=g.onFocus;x==null||x(_),u()},v=g=>_=>{const x=g.onMouseEnter;x==null||x(_),u()},w=g=>_=>{const x=g.onMouseLeave;x==null||x(_),f()};return I.useEffect(()=>{if(!n&&i)return window.addEventListener("focus",f),window.addEventListener("blur",u),()=>{window.removeEventListener("focus",f),window.removeEventListener("blur",u)}},[n,i,f,u]),{getRootProps:(g={})=>{const _=X({},BM(t),BM(g));return X({role:"presentation"},g,_,{onBlur:h(_),onFocus:m(_),onMouseEnter:v(_),onMouseLeave:w(_)})},onClickAway:c}}const uie=["onChange","maxRows","minRows","style","value"];function iw(t){return parseInt(t,10)||0}const fie={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function die(t){return t==null||Object.keys(t).length===0||t.outerHeightStyle===0&&!t.overflowing}const hie=I.forwardRef(function(e,n){const{onChange:r,maxRows:i,minRows:s=1,style:o,value:a}=e,l=Nt(e,uie),{current:c}=I.useRef(a!=null),u=I.useRef(null),f=ni(n,u),h=I.useRef(null),m=I.useCallback(()=>{const y=u.current,_=Ks(y).getComputedStyle(y);if(_.width==="0px")return{outerHeightStyle:0,overflowing:!1};const x=h.current;x.style.width=_.width,x.value=y.value||e.placeholder||"x",x.value.slice(-1)===`
+`&&(x.value+=" ");const S=_.boxSizing,D=iw(_.paddingBottom)+iw(_.paddingTop),T=iw(_.borderBottomWidth)+iw(_.borderTopWidth),E=x.scrollHeight;x.value="x";const R=x.scrollHeight;let C=E;s&&(C=Math.max(Number(s)*R,C)),i&&(C=Math.min(Number(i)*R,C)),C=Math.max(C,R);const L=C+(S==="border-box"?D+T:0),P=Math.abs(C-E)<=1;return{outerHeightStyle:L,overflowing:P}},[i,s,e.placeholder]),v=I.useCallback(()=>{const y=m();if(die(y))return;const g=u.current;g.style.height=`${y.outerHeightStyle}px`,g.style.overflow=y.overflowing?"hidden":""},[m]);Oa(()=>{const y=()=>{v()};let g;const _=Db(y),x=u.current,S=Ks(x);S.addEventListener("resize",_);let D;return typeof ResizeObserver<"u"&&(D=new ResizeObserver(y),D.observe(x)),()=>{_.clear(),cancelAnimationFrame(g),S.removeEventListener("resize",_),D&&D.disconnect()}},[m,v]),Oa(()=>{v()});const w=y=>{c||v(),r&&r(y)};return O.jsxs(I.Fragment,{children:[O.jsx("textarea",X({value:a,onChange:w,ref:f,rows:s,style:o},l)),O.jsx("textarea",{"aria-hidden":!0,className:e.className,readOnly:!0,ref:h,tabIndex:-1,style:X({},fie.shadow,o,{paddingTop:0,paddingBottom:0})})]})});function Tm({props:t,states:e,muiFormControl:n}){return e.reduce((r,i)=>(r[i]=t[i],n&&typeof t[i]>"u"&&(r[i]=n[i]),r),{})}const P4=I.createContext(void 0);function Im(){return I.useContext(P4)}function B5(t){return O.jsx(tne,X({},t,{defaultTheme:S4,themeId:Wp}))}function b6(t){return t!=null&&!(Array.isArray(t)&&t.length===0)}function UM(t,e=!1){return t&&(b6(t.value)&&t.value!==""||e&&b6(t.defaultValue)&&t.defaultValue!=="")}function pie(t){return t.startAdornment}function mie(t){return Mn("MuiInputBase",t)}const Jp=fn("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]),gie=["aria-describedby","autoComplete","autoFocus","className","color","components","componentsProps","defaultValue","disabled","disableInjectingGlobalStyles","endAdornment","error","fullWidth","id","inputComponent","inputProps","inputRef","margin","maxRows","minRows","multiline","name","onBlur","onChange","onClick","onFocus","onKeyDown","onKeyUp","placeholder","readOnly","renderSuffix","rows","size","slotProps","slots","startAdornment","type","value"],n2=(t,e)=>{const{ownerState:n}=t;return[e.root,n.formControl&&e.formControl,n.startAdornment&&e.adornedStart,n.endAdornment&&e.adornedEnd,n.error&&e.error,n.size==="small"&&e.sizeSmall,n.multiline&&e.multiline,n.color&&e[`color${zt(n.color)}`],n.fullWidth&&e.fullWidth,n.hiddenLabel&&e.hiddenLabel]},r2=(t,e)=>{const{ownerState:n}=t;return[e.input,n.size==="small"&&e.inputSizeSmall,n.multiline&&e.inputMultiline,n.type==="search"&&e.inputTypeSearch,n.startAdornment&&e.inputAdornedStart,n.endAdornment&&e.inputAdornedEnd,n.hiddenLabel&&e.inputHiddenLabel]},vie=t=>{const{classes:e,color:n,disabled:r,error:i,endAdornment:s,focused:o,formControl:a,fullWidth:l,hiddenLabel:c,multiline:u,readOnly:f,size:h,startAdornment:m,type:v}=t,w={root:["root",`color${zt(n)}`,r&&"disabled",i&&"error",l&&"fullWidth",o&&"focused",a&&"formControl",h&&h!=="medium"&&`size${zt(h)}`,u&&"multiline",m&&"adornedStart",s&&"adornedEnd",c&&"hiddenLabel",f&&"readOnly"],input:["input",r&&"disabled",v==="search"&&"inputTypeSearch",u&&"inputMultiline",h==="small"&&"inputSizeSmall",c&&"inputHiddenLabel",m&&"inputAdornedStart",s&&"inputAdornedEnd",f&&"readOnly"]};return bn(w,mie,e)},i2=Ct("div",{name:"MuiInputBase",slot:"Root",overridesResolver:n2})(({theme:t,ownerState:e})=>X({},t.typography.body1,{color:(t.vars||t).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${Jp.disabled}`]:{color:(t.vars||t).palette.text.disabled,cursor:"default"}},e.multiline&&X({padding:"4px 0 5px"},e.size==="small"&&{paddingTop:1}),e.fullWidth&&{width:"100%"})),s2=Ct("input",{name:"MuiInputBase",slot:"Input",overridesResolver:r2})(({theme:t,ownerState:e})=>{const n=t.palette.mode==="light",r=X({color:"currentColor"},t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:n?.42:.5},{transition:t.transitions.create("opacity",{duration:t.transitions.duration.shorter})}),i={opacity:"0 !important"},s=t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:n?.42:.5};return X({font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%",animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&::-webkit-input-placeholder":r,"&::-moz-placeholder":r,"&:-ms-input-placeholder":r,"&::-ms-input-placeholder":r,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${Jp.formControl} &`]:{"&::-webkit-input-placeholder":i,"&::-moz-placeholder":i,"&:-ms-input-placeholder":i,"&::-ms-input-placeholder":i,"&:focus::-webkit-input-placeholder":s,"&:focus::-moz-placeholder":s,"&:focus:-ms-input-placeholder":s,"&:focus::-ms-input-placeholder":s},[`&.${Jp.disabled}`]:{opacity:1,WebkitTextFillColor:(t.vars||t).palette.text.disabled},"&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}},e.size==="small"&&{paddingTop:1},e.multiline&&{height:"auto",resize:"none",padding:0,paddingTop:0},e.type==="search"&&{MozAppearance:"textfield"})}),yie=O.jsx(B5,{styles:{"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}}),wie=I.forwardRef(function(e,n){var r;const i=gn({props:e,name:"MuiInputBase"}),{"aria-describedby":s,autoComplete:o,autoFocus:a,className:l,components:c={},componentsProps:u={},defaultValue:f,disabled:h,disableInjectingGlobalStyles:m,endAdornment:v,fullWidth:w=!1,id:y,inputComponent:g="input",inputProps:_={},inputRef:x,maxRows:S,minRows:D,multiline:T=!1,name:E,onBlur:R,onChange:C,onClick:L,onFocus:P,onKeyDown:z,onKeyUp:B,placeholder:Y,readOnly:ie,renderSuffix:ee,rows:le,slotProps:j={},slots:q={},startAdornment:ne,type:de="text",value:_e}=i,ge=Nt(i,gie),ce=_.value!=null?_.value:_e,{current:we}=I.useRef(ce!=null),he=I.useRef(),Ie=I.useCallback(Ye=>{},[]),et=ni(he,x,_.ref,Ie),[ct,it]=I.useState(!1),ut=Im(),$=Tm({props:i,muiFormControl:ut,states:["color","disabled","error","hiddenLabel","size","required","filled"]});$.focused=ut?ut.focused:ct,I.useEffect(()=>{!ut&&h&&ct&&(it(!1),R&&R())},[ut,h,ct,R]);const Ce=ut&&ut.onFilled,Ne=ut&&ut.onEmpty,ze=I.useCallback(Ye=>{UM(Ye)?Ce&&Ce():Ne&&Ne()},[Ce,Ne]);Oa(()=>{we&&ze({value:ce})},[ce,ze,we]);const Ue=Ye=>{if($.disabled){Ye.stopPropagation();return}P&&P(Ye),_.onFocus&&_.onFocus(Ye),ut&&ut.onFocus?ut.onFocus(Ye):it(!0)},Et=Ye=>{R&&R(Ye),_.onBlur&&_.onBlur(Ye),ut&&ut.onBlur?ut.onBlur(Ye):it(!1)},lt=(Ye,...Ke)=>{if(!we){const nt=Ye.target||he.current;if(nt==null)throw new Error(gd(1));ze({value:nt.value})}_.onChange&&_.onChange(Ye,...Ke),C&&C(Ye,...Ke)};I.useEffect(()=>{ze(he.current)},[]);const yt=Ye=>{he.current&&Ye.currentTarget===Ye.target&&he.current.focus(),L&&L(Ye)};let re=g,V=_;T&&re==="input"&&(le?V=X({type:void 0,minRows:le,maxRows:le},V):V=X({type:void 0,maxRows:S,minRows:D},V),re=hie);const Ee=Ye=>{ze(Ye.animationName==="mui-auto-fill-cancel"?he.current:{value:"x"})};I.useEffect(()=>{ut&&ut.setAdornedStart(!!ne)},[ut,ne]);const je=X({},i,{color:$.color||"primary",disabled:$.disabled,endAdornment:v,error:$.error,focused:$.focused,formControl:ut,fullWidth:w,hiddenLabel:$.hiddenLabel,multiline:T,size:$.size,startAdornment:ne,type:de}),De=vie(je),He=q.root||c.Root||i2,pt=j.root||u.root||{},Qe=q.input||c.Input||s2;return V=X({},V,(r=j.input)!=null?r:u.input),O.jsxs(I.Fragment,{children:[!m&&yie,O.jsxs(He,X({},pt,!$p(He)&&{ownerState:X({},je,pt.ownerState)},{ref:n,onClick:yt},ge,{className:Vt(De.root,pt.className,l,ie&&"MuiInputBase-readOnly"),children:[ne,O.jsx(P4.Provider,{value:null,children:O.jsx(Qe,X({ownerState:je,"aria-invalid":$.error,"aria-describedby":s,autoComplete:o,autoFocus:a,defaultValue:f,disabled:$.disabled,id:y,onAnimationStart:Ee,name:E,placeholder:Y,readOnly:ie,required:$.required,rows:le,value:ce,onKeyDown:z,onKeyUp:B,type:de},V,!$p(Qe)&&{as:re,ownerState:X({},je,V.ownerState)},{ref:et,className:Vt(De.input,V.className,ie&&"MuiInputBase-readOnly"),onBlur:Et,onChange:lt,onFocus:Ue}))}),v,ee?ee(X({},$,{startAdornment:ne})):null]}))]})}),D4=wie;function _ie(t){return Mn("MuiInput",t)}const I0=X({},Jp,fn("MuiInput",["root","underline","input"]));function Mie(t){return Mn("MuiOutlinedInput",t)}const Ac=X({},Jp,fn("MuiOutlinedInput",["root","notchedOutline","input"]));function xie(t){return Mn("MuiFilledInput",t)}const hf=X({},Jp,fn("MuiFilledInput",["root","underline","input"])),bie=ku(O.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),Sie=ku(O.jsx("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"}),"Person");function Cie(t){return Mn("MuiAvatar",t)}fn("MuiAvatar",["root","colorDefault","circular","rounded","square","img","fallback"]);const Eie=["alt","children","className","component","slots","slotProps","imgProps","sizes","src","srcSet","variant"],Aie=t=>{const{classes:e,variant:n,colorDefault:r}=t;return bn({root:["root",n,r&&"colorDefault"],img:["img"],fallback:["fallback"]},Cie,e)},Tie=Ct("div",{name:"MuiAvatar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],n.colorDefault&&e.colorDefault]}})(({theme:t})=>({position:"relative",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:40,height:40,fontFamily:t.typography.fontFamily,fontSize:t.typography.pxToRem(20),lineHeight:1,borderRadius:"50%",overflow:"hidden",userSelect:"none",variants:[{props:{variant:"rounded"},style:{borderRadius:(t.vars||t).shape.borderRadius}},{props:{variant:"square"},style:{borderRadius:0}},{props:{colorDefault:!0},style:X({color:(t.vars||t).palette.background.default},t.vars?{backgroundColor:t.vars.palette.Avatar.defaultBg}:X({backgroundColor:t.palette.grey[400]},t.applyStyles("dark",{backgroundColor:t.palette.grey[600]})))}]})),Iie=Ct("img",{name:"MuiAvatar",slot:"Img",overridesResolver:(t,e)=>e.img})({width:"100%",height:"100%",textAlign:"center",objectFit:"cover",color:"transparent",textIndent:1e4}),Lie=Ct(Sie,{name:"MuiAvatar",slot:"Fallback",overridesResolver:(t,e)=>e.fallback})({width:"75%",height:"75%"});function Rie({crossOrigin:t,referrerPolicy:e,src:n,srcSet:r}){const[i,s]=I.useState(!1);return I.useEffect(()=>{if(!n&&!r)return;s(!1);let o=!0;const a=new Image;return a.onload=()=>{o&&s("loaded")},a.onerror=()=>{o&&s("error")},a.crossOrigin=t,a.referrerPolicy=e,a.src=n,r&&(a.srcset=r),()=>{o=!1}},[t,e,n,r]),i}const Pie=I.forwardRef(function(e,n){const r=gn({props:e,name:"MuiAvatar"}),{alt:i,children:s,className:o,component:a="div",slots:l={},slotProps:c={},imgProps:u,sizes:f,src:h,srcSet:m,variant:v="circular"}=r,w=Nt(r,Eie);let y=null;const g=Rie(X({},u,{src:h,srcSet:m})),_=h||m,x=_&&g!=="error",S=X({},r,{colorDefault:!x,component:a,variant:v}),D=Aie(S),[T,E]=OM("img",{className:D.img,elementType:Iie,externalForwardedProps:{slots:l,slotProps:{img:X({},u,c.img)}},additionalProps:{alt:i,src:h,srcSet:m,sizes:f},ownerState:S});return x?y=O.jsx(T,X({},E)):s||s===0?y=s:_&&i?y=i[0]:y=O.jsx(Lie,{ownerState:S,className:D.fallback}),O.jsx(Tie,X({as:a,ownerState:S,className:Vt(D.root,o),ref:n},w,{children:y}))}),Die=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],Nie={entering:{opacity:1},entered:{opacity:1}},O5=I.forwardRef(function(e,n){const r=Bu(),i={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:s,appear:o=!0,children:a,easing:l,in:c,onEnter:u,onEntered:f,onEntering:h,onExit:m,onExited:v,onExiting:w,style:y,timeout:g=i,TransitionComponent:_=fa}=e,x=Nt(e,Die),S=I.useRef(null),D=ni(S,a.ref,n),T=Y=>ie=>{if(Y){const ee=S.current;ie===void 0?Y(ee):Y(ee,ie)}},E=T(h),R=T((Y,ie)=>{R4(Y);const ee=lc({style:y,timeout:g,easing:l},{mode:"enter"});Y.style.webkitTransition=r.transitions.create("opacity",ee),Y.style.transition=r.transitions.create("opacity",ee),u&&u(Y,ie)}),C=T(f),L=T(w),P=T(Y=>{const ie=lc({style:y,timeout:g,easing:l},{mode:"exit"});Y.style.webkitTransition=r.transitions.create("opacity",ie),Y.style.transition=r.transitions.create("opacity",ie),m&&m(Y)}),z=T(v),B=Y=>{s&&s(S.current,Y)};return O.jsx(_,X({appear:o,in:c,nodeRef:S,onEnter:R,onEntered:C,onEntering:E,onExit:P,onExited:z,onExiting:L,addEndListener:B,timeout:g},x,{children:(Y,ie)=>I.cloneElement(a,X({style:X({opacity:0,visibility:Y==="exited"&&!c?"hidden":void 0},Nie[Y],y,a.props.style),ref:D},ie))}))});function kie(t){return Mn("MuiBackdrop",t)}fn("MuiBackdrop",["root","invisible"]);const Bie=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],Oie=t=>{const{classes:e,invisible:n}=t;return bn({root:["root",n&&"invisible"]},kie,e)},Uie=Ct("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.invisible&&e.invisible]}})(({ownerState:t})=>X({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},t.invisible&&{backgroundColor:"transparent"})),U5=I.forwardRef(function(e,n){var r,i,s;const o=gn({props:e,name:"MuiBackdrop"}),{children:a,className:l,component:c="div",components:u={},componentsProps:f={},invisible:h=!1,open:m,slotProps:v={},slots:w={},TransitionComponent:y=O5,transitionDuration:g}=o,_=Nt(o,Bie),x=X({},o,{component:c,invisible:h}),S=Oie(x),D=(r=v.root)!=null?r:f.root;return O.jsx(y,X({in:m,timeout:g},_,{children:O.jsx(Uie,X({"aria-hidden":!0},D,{as:(i=(s=w.root)!=null?s:u.Root)!=null?i:c,className:Vt(S.root,l,D==null?void 0:D.className),ownerState:X({},x,D==null?void 0:D.ownerState),classes:S,ref:n,children:a}))}))}),Fie=fn("MuiBox",["root"]),jie=b4(),zie=rne({themeId:Wp,defaultTheme:jie,defaultClassName:Fie.root,generateClassName:h4.generate});function Hie(t){return Mn("MuiButton",t)}const sw=fn("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]),Gie=I.createContext({}),Vie=I.createContext(void 0),Wie=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],$ie=t=>{const{color:e,disableElevation:n,fullWidth:r,size:i,variant:s,classes:o}=t,a={root:["root",s,`${s}${zt(e)}`,`size${zt(i)}`,`${s}Size${zt(i)}`,`color${zt(e)}`,n&&"disableElevation",r&&"fullWidth"],label:["label"],startIcon:["icon","startIcon",`iconSize${zt(i)}`],endIcon:["icon","endIcon",`iconSize${zt(i)}`]},l=bn(a,Hie,o);return X({},o,l)},F5=t=>X({},t.size==="small"&&{"& > *:nth-of-type(1)":{fontSize:18}},t.size==="medium"&&{"& > *:nth-of-type(1)":{fontSize:20}},t.size==="large"&&{"& > *:nth-of-type(1)":{fontSize:22}}),Jie=Ct(t2,{shouldForwardProp:t=>Po(t)||t==="classes",name:"MuiButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],e[`${n.variant}${zt(n.color)}`],e[`size${zt(n.size)}`],e[`${n.variant}Size${zt(n.size)}`],n.color==="inherit"&&e.colorInherit,n.disableElevation&&e.disableElevation,n.fullWidth&&e.fullWidth]}})(({theme:t,ownerState:e})=>{var n,r;const i=t.palette.mode==="light"?t.palette.grey[300]:t.palette.grey[800],s=t.palette.mode==="light"?t.palette.grey.A100:t.palette.grey[700];return X({},t.typography.button,{minWidth:64,padding:"6px 16px",borderRadius:(t.vars||t).shape.borderRadius,transition:t.transitions.create(["background-color","box-shadow","border-color","color"],{duration:t.transitions.duration.short}),"&:hover":X({textDecoration:"none",backgroundColor:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / ${t.vars.palette.action.hoverOpacity})`:yo(t.palette.text.primary,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},e.variant==="text"&&e.color!=="inherit"&&{backgroundColor:t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:yo(t.palette[e.color].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},e.variant==="outlined"&&e.color!=="inherit"&&{border:`1px solid ${(t.vars||t).palette[e.color].main}`,backgroundColor:t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:yo(t.palette[e.color].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},e.variant==="contained"&&{backgroundColor:t.vars?t.vars.palette.Button.inheritContainedHoverBg:s,boxShadow:(t.vars||t).shadows[4],"@media (hover: none)":{boxShadow:(t.vars||t).shadows[2],backgroundColor:(t.vars||t).palette.grey[300]}},e.variant==="contained"&&e.color!=="inherit"&&{backgroundColor:(t.vars||t).palette[e.color].dark,"@media (hover: none)":{backgroundColor:(t.vars||t).palette[e.color].main}}),"&:active":X({},e.variant==="contained"&&{boxShadow:(t.vars||t).shadows[8]}),[`&.${sw.focusVisible}`]:X({},e.variant==="contained"&&{boxShadow:(t.vars||t).shadows[6]}),[`&.${sw.disabled}`]:X({color:(t.vars||t).palette.action.disabled},e.variant==="outlined"&&{border:`1px solid ${(t.vars||t).palette.action.disabledBackground}`},e.variant==="contained"&&{color:(t.vars||t).palette.action.disabled,boxShadow:(t.vars||t).shadows[0],backgroundColor:(t.vars||t).palette.action.disabledBackground})},e.variant==="text"&&{padding:"6px 8px"},e.variant==="text"&&e.color!=="inherit"&&{color:(t.vars||t).palette[e.color].main},e.variant==="outlined"&&{padding:"5px 15px",border:"1px solid currentColor"},e.variant==="outlined"&&e.color!=="inherit"&&{color:(t.vars||t).palette[e.color].main,border:t.vars?`1px solid rgba(${t.vars.palette[e.color].mainChannel} / 0.5)`:`1px solid ${yo(t.palette[e.color].main,.5)}`},e.variant==="contained"&&{color:t.vars?t.vars.palette.text.primary:(n=(r=t.palette).getContrastText)==null?void 0:n.call(r,t.palette.grey[300]),backgroundColor:t.vars?t.vars.palette.Button.inheritContainedBg:i,boxShadow:(t.vars||t).shadows[2]},e.variant==="contained"&&e.color!=="inherit"&&{color:(t.vars||t).palette[e.color].contrastText,backgroundColor:(t.vars||t).palette[e.color].main},e.color==="inherit"&&{color:"inherit",borderColor:"currentColor"},e.size==="small"&&e.variant==="text"&&{padding:"4px 5px",fontSize:t.typography.pxToRem(13)},e.size==="large"&&e.variant==="text"&&{padding:"8px 11px",fontSize:t.typography.pxToRem(15)},e.size==="small"&&e.variant==="outlined"&&{padding:"3px 9px",fontSize:t.typography.pxToRem(13)},e.size==="large"&&e.variant==="outlined"&&{padding:"7px 21px",fontSize:t.typography.pxToRem(15)},e.size==="small"&&e.variant==="contained"&&{padding:"4px 10px",fontSize:t.typography.pxToRem(13)},e.size==="large"&&e.variant==="contained"&&{padding:"8px 22px",fontSize:t.typography.pxToRem(15)},e.fullWidth&&{width:"100%"})},({ownerState:t})=>t.disableElevation&&{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${sw.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${sw.disabled}`]:{boxShadow:"none"}}),Yie=Ct("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.startIcon,e[`iconSize${zt(n.size)}`]]}})(({ownerState:t})=>X({display:"inherit",marginRight:8,marginLeft:-4},t.size==="small"&&{marginLeft:-2},F5(t))),Qie=Ct("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.endIcon,e[`iconSize${zt(n.size)}`]]}})(({ownerState:t})=>X({display:"inherit",marginRight:-4,marginLeft:8},t.size==="small"&&{marginRight:-2},F5(t))),FM=I.forwardRef(function(e,n){const r=I.useContext(Gie),i=I.useContext(Vie),s=PM(r,e),o=gn({props:s,name:"MuiButton"}),{children:a,color:l="primary",component:c="button",className:u,disabled:f=!1,disableElevation:h=!1,disableFocusRipple:m=!1,endIcon:v,focusVisibleClassName:w,fullWidth:y=!1,size:g="medium",startIcon:_,type:x,variant:S="text"}=o,D=Nt(o,Wie),T=X({},o,{color:l,component:c,disabled:f,disableElevation:h,disableFocusRipple:m,fullWidth:y,size:g,type:x,variant:S}),E=$ie(T),R=_&&O.jsx(Yie,{className:E.startIcon,ownerState:T,children:_}),C=v&&O.jsx(Qie,{className:E.endIcon,ownerState:T,children:v}),L=i||"";return O.jsxs(Jie,X({ownerState:T,className:Vt(r.className,E.root,u,L),component:c,disabled:f,focusRipple:!m,focusVisibleClassName:Vt(E.focusVisible,w),ref:n,type:x},D,{classes:E,children:[R,a,C]}))});function Xie(t){return Mn("MuiCircularProgress",t)}fn("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const Kie=["className","color","disableShrink","size","style","thickness","value","variant"];let o2=t=>t,S6,C6,E6,A6;const Tc=44,Zie=Cm(S6||(S6=o2`
+ 0% {
+ transform: rotate(0deg);
+ }
+
+ 100% {
+ transform: rotate(360deg);
+ }
+`)),qie=Cm(C6||(C6=o2`
+ 0% {
+ stroke-dasharray: 1px, 200px;
+ stroke-dashoffset: 0;
+ }
+
+ 50% {
+ stroke-dasharray: 100px, 200px;
+ stroke-dashoffset: -15px;
+ }
+
+ 100% {
+ stroke-dasharray: 100px, 200px;
+ stroke-dashoffset: -125px;
+ }
+`)),ese=t=>{const{classes:e,variant:n,color:r,disableShrink:i}=t,s={root:["root",n,`color${zt(r)}`],svg:["svg"],circle:["circle",`circle${zt(n)}`,i&&"circleDisableShrink"]};return bn(s,Xie,e)},tse=Ct("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],e[`color${zt(n.color)}`]]}})(({ownerState:t,theme:e})=>X({display:"inline-block"},t.variant==="determinate"&&{transition:e.transitions.create("transform")},t.color!=="inherit"&&{color:(e.vars||e).palette[t.color].main}),({ownerState:t})=>t.variant==="indeterminate"&&wl(E6||(E6=o2`
+ animation: ${0} 1.4s linear infinite;
+ `),Zie)),nse=Ct("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(t,e)=>e.svg})({display:"block"}),rse=Ct("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.circle,e[`circle${zt(n.variant)}`],n.disableShrink&&e.circleDisableShrink]}})(({ownerState:t,theme:e})=>X({stroke:"currentColor"},t.variant==="determinate"&&{transition:e.transitions.create("stroke-dashoffset")},t.variant==="indeterminate"&&{strokeDasharray:"80px, 200px",strokeDashoffset:0}),({ownerState:t})=>t.variant==="indeterminate"&&!t.disableShrink&&wl(A6||(A6=o2`
+ animation: ${0} 1.4s ease-in-out infinite;
+ `),qie)),ise=I.forwardRef(function(e,n){const r=gn({props:e,name:"MuiCircularProgress"}),{className:i,color:s="primary",disableShrink:o=!1,size:a=40,style:l,thickness:c=3.6,value:u=0,variant:f="indeterminate"}=r,h=Nt(r,Kie),m=X({},r,{color:s,disableShrink:o,size:a,thickness:c,value:u,variant:f}),v=ese(m),w={},y={},g={};if(f==="determinate"){const _=2*Math.PI*((Tc-c)/2);w.strokeDasharray=_.toFixed(3),g["aria-valuenow"]=Math.round(u),w.strokeDashoffset=`${((100-u)/100*_).toFixed(3)}px`,y.transform="rotate(-90deg)"}return O.jsx(tse,X({className:Vt(v.root,i),style:X({width:a,height:a},y,l),ownerState:m,ref:n,role:"progressbar"},g,h,{children:O.jsx(nse,{className:v.svg,ownerState:m,viewBox:`${Tc/2} ${Tc/2} ${Tc} ${Tc}`,children:O.jsx(rse,{className:v.circle,style:w,ownerState:m,cx:Tc,cy:Tc,r:(Tc-c)/2,fill:"none",strokeWidth:c})})}))}),sse=(t,e)=>X({WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box",WebkitTextSizeAdjust:"100%"},e&&!t.vars&&{colorScheme:t.palette.mode}),ose=t=>X({color:(t.vars||t).palette.text.primary},t.typography.body1,{backgroundColor:(t.vars||t).palette.background.default,"@media print":{backgroundColor:(t.vars||t).palette.common.white}}),ase=(t,e=!1)=>{var n;const r={};e&&t.colorSchemes&&Object.entries(t.colorSchemes).forEach(([o,a])=>{var l;r[t.getColorSchemeSelector(o).replace(/\s*&/,"")]={colorScheme:(l=a.palette)==null?void 0:l.mode}});let i=X({html:sse(t,e),"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:t.typography.fontWeightBold},body:X({margin:0},ose(t),{"&::backdrop":{backgroundColor:(t.vars||t).palette.background.default}})},r);const s=(n=t.components)==null||(n=n.MuiCssBaseline)==null?void 0:n.styleOverrides;return s&&(i=[i,s]),i};function lse(t){const e=gn({props:t,name:"MuiCssBaseline"}),{children:n,enableColorScheme:r=!1}=e;return O.jsxs(I.Fragment,{children:[O.jsx(B5,{styles:i=>ase(i,r)}),n]})}function cse(t){return Mn("MuiModal",t)}fn("MuiModal",["root","hidden","backdrop"]);const use=["BackdropComponent","BackdropProps","classes","className","closeAfterTransition","children","container","component","components","componentsProps","disableAutoFocus","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","onBackdropClick","onClose","onTransitionEnter","onTransitionExited","open","slotProps","slots","theme"],fse=t=>{const{open:e,exited:n,classes:r}=t;return bn({root:["root",!e&&n&&"hidden"],backdrop:["backdrop"]},cse,r)},dse=Ct("div",{name:"MuiModal",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.open&&n.exited&&e.hidden]}})(({theme:t,ownerState:e})=>X({position:"fixed",zIndex:(t.vars||t).zIndex.modal,right:0,bottom:0,top:0,left:0},!e.open&&e.exited&&{visibility:"hidden"})),hse=Ct(U5,{name:"MuiModal",slot:"Backdrop",overridesResolver:(t,e)=>e.backdrop})({zIndex:-1}),N4=I.forwardRef(function(e,n){var r,i,s,o,a,l;const c=gn({name:"MuiModal",props:e}),{BackdropComponent:u=hse,BackdropProps:f,className:h,closeAfterTransition:m=!1,children:v,container:w,component:y,components:g={},componentsProps:_={},disableAutoFocus:x=!1,disableEnforceFocus:S=!1,disableEscapeKeyDown:D=!1,disablePortal:T=!1,disableRestoreFocus:E=!1,disableScrollLock:R=!1,hideBackdrop:C=!1,keepMounted:L=!1,onBackdropClick:P,open:z,slotProps:B,slots:Y}=c,ie=Nt(c,use),ee=X({},c,{closeAfterTransition:m,disableAutoFocus:x,disableEnforceFocus:S,disableEscapeKeyDown:D,disablePortal:T,disableRestoreFocus:E,disableScrollLock:R,hideBackdrop:C,keepMounted:L}),{getRootProps:le,getBackdropProps:j,getTransitionProps:q,portalRef:ne,isTopModal:de,exited:_e,hasTransition:ge}=aie(X({},ee,{rootRef:n})),ce=X({},ee,{exited:_e}),we=fse(ce),he={};if(v.props.tabIndex===void 0&&(he.tabIndex="-1"),ge){const{onEnter:Ce,onExited:Ne}=q();he.onEnter=Ce,he.onExited=Ne}const Ie=(r=(i=Y==null?void 0:Y.root)!=null?i:g.Root)!=null?r:dse,et=(s=(o=Y==null?void 0:Y.backdrop)!=null?o:g.Backdrop)!=null?s:u,ct=(a=B==null?void 0:B.root)!=null?a:_.root,it=(l=B==null?void 0:B.backdrop)!=null?l:_.backdrop,ut=vd({elementType:Ie,externalSlotProps:ct,externalForwardedProps:ie,getSlotProps:le,additionalProps:{ref:n,as:y},ownerState:ce,className:Vt(h,ct==null?void 0:ct.className,we==null?void 0:we.root,!ce.open&&ce.exited&&(we==null?void 0:we.hidden))}),$=vd({elementType:et,externalSlotProps:it,additionalProps:f,getSlotProps:Ce=>j(X({},Ce,{onClick:Ne=>{P&&P(Ne),Ce!=null&&Ce.onClick&&Ce.onClick(Ne)}})),className:Vt(it==null?void 0:it.className,f==null?void 0:f.className,we==null?void 0:we.backdrop),ownerState:ce});return!L&&!z&&(!ge||_e)?null:O.jsx(Zre,{ref:ne,container:w,disablePortal:T,children:O.jsxs(Ie,X({},ut,{children:[!C&&u?O.jsx(et,X({},$)):null,O.jsx(Xre,{disableEnforceFocus:S,disableAutoFocus:x,disableRestoreFocus:E,isEnabled:de,open:z,children:I.cloneElement(v,he)})]}))})});function pse(t){return Mn("MuiDialog",t)}const rE=fn("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),j5=I.createContext({}),mse=["aria-describedby","aria-labelledby","BackdropComponent","BackdropProps","children","className","disableEscapeKeyDown","fullScreen","fullWidth","maxWidth","onBackdropClick","onClick","onClose","open","PaperComponent","PaperProps","scroll","TransitionComponent","transitionDuration","TransitionProps"],gse=Ct(U5,{name:"MuiDialog",slot:"Backdrop",overrides:(t,e)=>e.backdrop})({zIndex:-1}),vse=t=>{const{classes:e,scroll:n,maxWidth:r,fullWidth:i,fullScreen:s}=t,o={root:["root"],container:["container",`scroll${zt(n)}`],paper:["paper",`paperScroll${zt(n)}`,`paperWidth${zt(String(r))}`,i&&"paperFullWidth",s&&"paperFullScreen"]};return bn(o,pse,e)},yse=Ct(N4,{name:"MuiDialog",slot:"Root",overridesResolver:(t,e)=>e.root})({"@media print":{position:"absolute !important"}}),wse=Ct("div",{name:"MuiDialog",slot:"Container",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.container,e[`scroll${zt(n.scroll)}`]]}})(({ownerState:t})=>X({height:"100%","@media print":{height:"auto"},outline:0},t.scroll==="paper"&&{display:"flex",justifyContent:"center",alignItems:"center"},t.scroll==="body"&&{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}})),_se=Ct(Ou,{name:"MuiDialog",slot:"Paper",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.paper,e[`scrollPaper${zt(n.scroll)}`],e[`paperWidth${zt(String(n.maxWidth))}`],n.fullWidth&&e.paperFullWidth,n.fullScreen&&e.paperFullScreen]}})(({theme:t,ownerState:e})=>X({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"}},e.scroll==="paper"&&{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"},e.scroll==="body"&&{display:"inline-block",verticalAlign:"middle",textAlign:"left"},!e.maxWidth&&{maxWidth:"calc(100% - 64px)"},e.maxWidth==="xs"&&{maxWidth:t.breakpoints.unit==="px"?Math.max(t.breakpoints.values.xs,444):`max(${t.breakpoints.values.xs}${t.breakpoints.unit}, 444px)`,[`&.${rE.paperScrollBody}`]:{[t.breakpoints.down(Math.max(t.breakpoints.values.xs,444)+32*2)]:{maxWidth:"calc(100% - 64px)"}}},e.maxWidth&&e.maxWidth!=="xs"&&{maxWidth:`${t.breakpoints.values[e.maxWidth]}${t.breakpoints.unit}`,[`&.${rE.paperScrollBody}`]:{[t.breakpoints.down(t.breakpoints.values[e.maxWidth]+32*2)]:{maxWidth:"calc(100% - 64px)"}}},e.fullWidth&&{width:"calc(100% - 64px)"},e.fullScreen&&{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${rE.paperScrollBody}`]:{margin:0,maxWidth:"100%"}})),z5=I.forwardRef(function(e,n){const r=gn({props:e,name:"MuiDialog"}),i=Bu(),s={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{"aria-describedby":o,"aria-labelledby":a,BackdropComponent:l,BackdropProps:c,children:u,className:f,disableEscapeKeyDown:h=!1,fullScreen:m=!1,fullWidth:v=!1,maxWidth:w="sm",onBackdropClick:y,onClick:g,onClose:_,open:x,PaperComponent:S=Ou,PaperProps:D={},scroll:T="paper",TransitionComponent:E=O5,transitionDuration:R=s,TransitionProps:C}=r,L=Nt(r,mse),P=X({},r,{disableEscapeKeyDown:h,fullScreen:m,fullWidth:v,maxWidth:w,scroll:T}),z=vse(P),B=I.useRef(),Y=j=>{B.current=j.target===j.currentTarget},ie=j=>{g&&g(j),B.current&&(B.current=null,y&&y(j),_&&_(j,"backdropClick"))},ee=Nb(a),le=I.useMemo(()=>({titleId:ee}),[ee]);return O.jsx(yse,X({className:Vt(z.root,f),closeAfterTransition:!0,components:{Backdrop:gse},componentsProps:{backdrop:X({transitionDuration:R,as:l},c)},disableEscapeKeyDown:h,onClose:_,open:x,ref:n,onClick:ie,ownerState:P},L,{children:O.jsx(E,X({appear:!0,in:x,timeout:R,role:"presentation"},C,{children:O.jsx(wse,{className:Vt(z.container),onMouseDown:Y,ownerState:P,children:O.jsx(_se,X({as:S,elevation:24,role:"dialog","aria-describedby":o,"aria-labelledby":ee},D,{className:Vt(z.paper,D.className),ownerState:P,children:O.jsx(j5.Provider,{value:le,children:u})}))})}))}))});function Mse(t){return Mn("MuiDialogActions",t)}fn("MuiDialogActions",["root","spacing"]);const xse=["className","disableSpacing"],bse=t=>{const{classes:e,disableSpacing:n}=t;return bn({root:["root",!n&&"spacing"]},Mse,e)},Sse=Ct("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.disableSpacing&&e.spacing]}})(({ownerState:t})=>X({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto"},!t.disableSpacing&&{"& > :not(style) ~ :not(style)":{marginLeft:8}})),H5=I.forwardRef(function(e,n){const r=gn({props:e,name:"MuiDialogActions"}),{className:i,disableSpacing:s=!1}=r,o=Nt(r,xse),a=X({},r,{disableSpacing:s}),l=bse(a);return O.jsx(Sse,X({className:Vt(l.root,i),ownerState:a,ref:n},o))});function Cse(t){return Mn("MuiDialogContent",t)}fn("MuiDialogContent",["root","dividers"]);function Ese(t){return Mn("MuiDialogTitle",t)}const Ase=fn("MuiDialogTitle",["root"]),Tse=["className","dividers"],Ise=t=>{const{classes:e,dividers:n}=t;return bn({root:["root",n&&"dividers"]},Cse,e)},Lse=Ct("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.dividers&&e.dividers]}})(({theme:t,ownerState:e})=>X({flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px"},e.dividers?{padding:"16px 24px",borderTop:`1px solid ${(t.vars||t).palette.divider}`,borderBottom:`1px solid ${(t.vars||t).palette.divider}`}:{[`.${Ase.root} + &`]:{paddingTop:0}})),G5=I.forwardRef(function(e,n){const r=gn({props:e,name:"MuiDialogContent"}),{className:i,dividers:s=!1}=r,o=Nt(r,Tse),a=X({},r,{dividers:s}),l=Ise(a);return O.jsx(Lse,X({className:Vt(l.root,i),ownerState:a,ref:n},o))}),Rse=["className","id"],Pse=t=>{const{classes:e}=t;return bn({root:["root"]},Ese,e)},Dse=Ct(Bre,{name:"MuiDialogTitle",slot:"Root",overridesResolver:(t,e)=>e.root})({padding:"16px 24px",flex:"0 0 auto"}),V5=I.forwardRef(function(e,n){const r=gn({props:e,name:"MuiDialogTitle"}),{className:i,id:s}=r,o=Nt(r,Rse),a=r,l=Pse(a),{titleId:c=s}=I.useContext(j5);return O.jsx(Dse,X({component:"h2",className:Vt(l.root,i),ownerState:a,ref:n,variant:"h6",id:s??c},o))});function Nse(t){return Mn("MuiDivider",t)}fn("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]);const kse=["absolute","children","className","component","flexItem","light","orientation","role","textAlign","variant"],Bse=t=>{const{absolute:e,children:n,classes:r,flexItem:i,light:s,orientation:o,textAlign:a,variant:l}=t;return bn({root:["root",e&&"absolute",l,s&&"light",o==="vertical"&&"vertical",i&&"flexItem",n&&"withChildren",n&&o==="vertical"&&"withChildrenVertical",a==="right"&&o!=="vertical"&&"textAlignRight",a==="left"&&o!=="vertical"&&"textAlignLeft"],wrapper:["wrapper",o==="vertical"&&"wrapperVertical"]},Nse,r)},Ose=Ct("div",{name:"MuiDivider",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.absolute&&e.absolute,e[n.variant],n.light&&e.light,n.orientation==="vertical"&&e.vertical,n.flexItem&&e.flexItem,n.children&&e.withChildren,n.children&&n.orientation==="vertical"&&e.withChildrenVertical,n.textAlign==="right"&&n.orientation!=="vertical"&&e.textAlignRight,n.textAlign==="left"&&n.orientation!=="vertical"&&e.textAlignLeft]}})(({theme:t,ownerState:e})=>X({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(t.vars||t).palette.divider,borderBottomWidth:"thin"},e.absolute&&{position:"absolute",bottom:0,left:0,width:"100%"},e.light&&{borderColor:t.vars?`rgba(${t.vars.palette.dividerChannel} / 0.08)`:yo(t.palette.divider,.08)},e.variant==="inset"&&{marginLeft:72},e.variant==="middle"&&e.orientation==="horizontal"&&{marginLeft:t.spacing(2),marginRight:t.spacing(2)},e.variant==="middle"&&e.orientation==="vertical"&&{marginTop:t.spacing(1),marginBottom:t.spacing(1)},e.orientation==="vertical"&&{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"},e.flexItem&&{alignSelf:"stretch",height:"auto"}),({ownerState:t})=>X({},t.children&&{display:"flex",whiteSpace:"nowrap",textAlign:"center",border:0,"&::before, &::after":{content:'""',alignSelf:"center"}}),({theme:t,ownerState:e})=>X({},e.children&&e.orientation!=="vertical"&&{"&::before, &::after":{width:"100%",borderTop:`thin solid ${(t.vars||t).palette.divider}`}}),({theme:t,ownerState:e})=>X({},e.children&&e.orientation==="vertical"&&{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:`thin solid ${(t.vars||t).palette.divider}`}}),({ownerState:t})=>X({},t.textAlign==="right"&&t.orientation!=="vertical"&&{"&::before":{width:"90%"},"&::after":{width:"10%"}},t.textAlign==="left"&&t.orientation!=="vertical"&&{"&::before":{width:"10%"},"&::after":{width:"90%"}})),Use=Ct("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.wrapper,n.orientation==="vertical"&&e.wrapperVertical]}})(({theme:t,ownerState:e})=>X({display:"inline-block",paddingLeft:`calc(${t.spacing(1)} * 1.2)`,paddingRight:`calc(${t.spacing(1)} * 1.2)`},e.orientation==="vertical"&&{paddingTop:`calc(${t.spacing(1)} * 1.2)`,paddingBottom:`calc(${t.spacing(1)} * 1.2)`})),W5=I.forwardRef(function(e,n){const r=gn({props:e,name:"MuiDivider"}),{absolute:i=!1,children:s,className:o,component:a=s?"div":"hr",flexItem:l=!1,light:c=!1,orientation:u="horizontal",role:f=a!=="hr"?"separator":void 0,textAlign:h="center",variant:m="fullWidth"}=r,v=Nt(r,kse),w=X({},r,{absolute:i,component:a,flexItem:l,light:c,orientation:u,role:f,textAlign:h,variant:m}),y=Bse(w);return O.jsx(Ose,X({as:a,className:Vt(y.root,o),role:f,ref:n,ownerState:w},v,{children:s?O.jsx(Use,{className:y.wrapper,ownerState:w,children:s}):null}))});W5.muiSkipListHighlight=!0;const Fse=["addEndListener","appear","children","container","direction","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function jse(t,e,n){const r=e.getBoundingClientRect(),i=n&&n.getBoundingClientRect(),s=Ks(e);let o;if(e.fakeTransform)o=e.fakeTransform;else{const c=s.getComputedStyle(e);o=c.getPropertyValue("-webkit-transform")||c.getPropertyValue("transform")}let a=0,l=0;if(o&&o!=="none"&&typeof o=="string"){const c=o.split("(")[1].split(")")[0].split(",");a=parseInt(c[4],10),l=parseInt(c[5],10)}return t==="left"?i?`translateX(${i.right+a-r.left}px)`:`translateX(${s.innerWidth+a-r.left}px)`:t==="right"?i?`translateX(-${r.right-i.left-a}px)`:`translateX(-${r.left+r.width-a}px)`:t==="up"?i?`translateY(${i.bottom+l-r.top}px)`:`translateY(${s.innerHeight+l-r.top}px)`:i?`translateY(-${r.top-i.top+r.height-l}px)`:`translateY(-${r.top+r.height-l}px)`}function zse(t){return typeof t=="function"?t():t}function ow(t,e,n){const r=zse(n),i=jse(t,e,r);i&&(e.style.webkitTransform=i,e.style.transform=i)}const Hse=I.forwardRef(function(e,n){const r=Bu(),i={enter:r.transitions.easing.easeOut,exit:r.transitions.easing.sharp},s={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:o,appear:a=!0,children:l,container:c,direction:u="down",easing:f=i,in:h,onEnter:m,onEntered:v,onEntering:w,onExit:y,onExited:g,onExiting:_,style:x,timeout:S=s,TransitionComponent:D=fa}=e,T=Nt(e,Fse),E=I.useRef(null),R=ni(l.ref,E,n),C=j=>q=>{j&&(q===void 0?j(E.current):j(E.current,q))},L=C((j,q)=>{ow(u,j,c),R4(j),m&&m(j,q)}),P=C((j,q)=>{const ne=lc({timeout:S,style:x,easing:f},{mode:"enter"});j.style.webkitTransition=r.transitions.create("-webkit-transform",X({},ne)),j.style.transition=r.transitions.create("transform",X({},ne)),j.style.webkitTransform="none",j.style.transform="none",w&&w(j,q)}),z=C(v),B=C(_),Y=C(j=>{const q=lc({timeout:S,style:x,easing:f},{mode:"exit"});j.style.webkitTransition=r.transitions.create("-webkit-transform",q),j.style.transition=r.transitions.create("transform",q),ow(u,j,c),y&&y(j)}),ie=C(j=>{j.style.webkitTransition="",j.style.transition="",g&&g(j)}),ee=j=>{o&&o(E.current,j)},le=I.useCallback(()=>{E.current&&ow(u,E.current,c)},[u,c]);return I.useEffect(()=>{if(h||u==="down"||u==="right")return;const j=Db(()=>{E.current&&ow(u,E.current,c)}),q=Ks(E.current);return q.addEventListener("resize",j),()=>{j.clear(),q.removeEventListener("resize",j)}},[u,h,c]),I.useEffect(()=>{h||le()},[h,le]),O.jsx(D,X({nodeRef:E,onEnter:L,onEntered:z,onEntering:P,onExit:Y,onExited:ie,onExiting:B,addEndListener:ee,appear:a,in:h,timeout:S},T,{children:(j,q)=>I.cloneElement(l,X({ref:R,style:X({visibility:j==="exited"&&!h?"hidden":void 0},x,l.props.style)},q))}))});function Gse(t){return Mn("MuiDrawer",t)}fn("MuiDrawer",["root","docked","paper","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);const Vse=["BackdropProps"],Wse=["anchor","BackdropProps","children","className","elevation","hideBackdrop","ModalProps","onClose","open","PaperProps","SlideProps","TransitionComponent","transitionDuration","variant"],$5=(t,e)=>{const{ownerState:n}=t;return[e.root,(n.variant==="permanent"||n.variant==="persistent")&&e.docked,e.modal]},$se=t=>{const{classes:e,anchor:n,variant:r}=t,i={root:["root"],docked:[(r==="permanent"||r==="persistent")&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${zt(n)}`,r!=="temporary"&&`paperAnchorDocked${zt(n)}`]};return bn(i,Gse,e)},Jse=Ct(N4,{name:"MuiDrawer",slot:"Root",overridesResolver:$5})(({theme:t})=>({zIndex:(t.vars||t).zIndex.drawer})),T6=Ct("div",{shouldForwardProp:Po,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:$5})({flex:"0 0 auto"}),Yse=Ct(Ou,{name:"MuiDrawer",slot:"Paper",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.paper,e[`paperAnchor${zt(n.anchor)}`],n.variant!=="temporary"&&e[`paperAnchorDocked${zt(n.anchor)}`]]}})(({theme:t,ownerState:e})=>X({overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:(t.vars||t).zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0},e.anchor==="left"&&{left:0},e.anchor==="top"&&{top:0,left:0,right:0,height:"auto",maxHeight:"100%"},e.anchor==="right"&&{right:0},e.anchor==="bottom"&&{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"},e.anchor==="left"&&e.variant!=="temporary"&&{borderRight:`1px solid ${(t.vars||t).palette.divider}`},e.anchor==="top"&&e.variant!=="temporary"&&{borderBottom:`1px solid ${(t.vars||t).palette.divider}`},e.anchor==="right"&&e.variant!=="temporary"&&{borderLeft:`1px solid ${(t.vars||t).palette.divider}`},e.anchor==="bottom"&&e.variant!=="temporary"&&{borderTop:`1px solid ${(t.vars||t).palette.divider}`})),J5={left:"right",right:"left",top:"down",bottom:"up"};function kf(t){return["left","right"].indexOf(t)!==-1}function lg({direction:t},e){return t==="rtl"&&kf(e)?J5[e]:e}const Qse=I.forwardRef(function(e,n){const r=gn({props:e,name:"MuiDrawer"}),i=Bu(),s=A5(),o={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{anchor:a="left",BackdropProps:l,children:c,className:u,elevation:f=16,hideBackdrop:h=!1,ModalProps:{BackdropProps:m}={},onClose:v,open:w=!1,PaperProps:y={},SlideProps:g,TransitionComponent:_=Hse,transitionDuration:x=o,variant:S="temporary"}=r,D=Nt(r.ModalProps,Vse),T=Nt(r,Wse),E=I.useRef(!1);I.useEffect(()=>{E.current=!0},[]);const R=lg({direction:s?"rtl":"ltr"},a),L=X({},r,{anchor:a,elevation:f,open:w,variant:S},T),P=$se(L),z=O.jsx(Yse,X({elevation:S==="temporary"?f:0,square:!0},y,{className:Vt(P.paper,y.className),ownerState:L,children:c}));if(S==="permanent")return O.jsx(T6,X({className:Vt(P.root,P.docked,u),ownerState:L,ref:n},T,{children:z}));const B=O.jsx(_,X({in:w,direction:J5[R],timeout:x,appear:E.current},g,{children:z}));return S==="persistent"?O.jsx(T6,X({className:Vt(P.root,P.docked,u),ownerState:L,ref:n},T,{children:B})):O.jsx(Jse,X({BackdropProps:X({},l,m,{transitionDuration:x}),className:Vt(P.root,P.modal,u),open:w,ownerState:L,onClose:v,hideBackdrop:h,ref:n},T,D,{children:B}))}),Xse=["disableUnderline","components","componentsProps","fullWidth","hiddenLabel","inputComponent","multiline","slotProps","slots","type"],Kse=t=>{const{classes:e,disableUnderline:n}=t,i=bn({root:["root",!n&&"underline"],input:["input"]},xie,e);return X({},e,i)},Zse=Ct(i2,{shouldForwardProp:t=>Po(t)||t==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[...n2(t,e),!n.disableUnderline&&e.underline]}})(({theme:t,ownerState:e})=>{var n;const r=t.palette.mode==="light",i=r?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",s=r?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",o=r?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",a=r?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return X({position:"relative",backgroundColor:t.vars?t.vars.palette.FilledInput.bg:s,borderTopLeftRadius:(t.vars||t).shape.borderRadius,borderTopRightRadius:(t.vars||t).shape.borderRadius,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),"&:hover":{backgroundColor:t.vars?t.vars.palette.FilledInput.hoverBg:o,"@media (hover: none)":{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:s}},[`&.${hf.focused}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:s},[`&.${hf.disabled}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.disabledBg:a}},!e.disableUnderline&&{"&::after":{borderBottom:`2px solid ${(n=(t.vars||t).palette[e.color||"primary"])==null?void 0:n.main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${hf.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${hf.error}`]:{"&::before, &::after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:`1px solid ${t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})`:i}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${hf.disabled}, .${hf.error}):before`]:{borderBottom:`1px solid ${(t.vars||t).palette.text.primary}`},[`&.${hf.disabled}:before`]:{borderBottomStyle:"dotted"}},e.startAdornment&&{paddingLeft:12},e.endAdornment&&{paddingRight:12},e.multiline&&X({padding:"25px 12px 8px"},e.size==="small"&&{paddingTop:21,paddingBottom:4},e.hiddenLabel&&{paddingTop:16,paddingBottom:17},e.hiddenLabel&&e.size==="small"&&{paddingTop:8,paddingBottom:9}))}),qse=Ct(s2,{name:"MuiFilledInput",slot:"Input",overridesResolver:r2})(({theme:t,ownerState:e})=>X({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12},!t.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:t.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:t.palette.mode==="light"?null:"#fff",caretColor:t.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},t.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[t.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},e.size==="small"&&{paddingTop:21,paddingBottom:4},e.hiddenLabel&&{paddingTop:16,paddingBottom:17},e.startAdornment&&{paddingLeft:0},e.endAdornment&&{paddingRight:0},e.hiddenLabel&&e.size==="small"&&{paddingTop:8,paddingBottom:9},e.multiline&&{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0})),k4=I.forwardRef(function(e,n){var r,i,s,o;const a=gn({props:e,name:"MuiFilledInput"}),{components:l={},componentsProps:c,fullWidth:u=!1,inputComponent:f="input",multiline:h=!1,slotProps:m,slots:v={},type:w="text"}=a,y=Nt(a,Xse),g=X({},a,{fullWidth:u,inputComponent:f,multiline:h,type:w}),_=Kse(a),x={root:{ownerState:g},input:{ownerState:g}},S=m??c?Co(x,m??c):x,D=(r=(i=v.root)!=null?i:l.Root)!=null?r:Zse,T=(s=(o=v.input)!=null?o:l.Input)!=null?s:qse;return O.jsx(D4,X({slots:{root:D,input:T},componentsProps:S,fullWidth:u,inputComponent:f,multiline:h,ref:n,type:w},y,{classes:_}))});k4.muiName="Input";function eoe(t){return Mn("MuiFormControl",t)}fn("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const toe=["children","className","color","component","disabled","error","focused","fullWidth","hiddenLabel","margin","required","size","variant"],noe=t=>{const{classes:e,margin:n,fullWidth:r}=t,i={root:["root",n!=="none"&&`margin${zt(n)}`,r&&"fullWidth"]};return bn(i,eoe,e)},roe=Ct("div",{name:"MuiFormControl",slot:"Root",overridesResolver:({ownerState:t},e)=>X({},e.root,e[`margin${zt(t.margin)}`],t.fullWidth&&e.fullWidth)})(({ownerState:t})=>X({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top"},t.margin==="normal"&&{marginTop:16,marginBottom:8},t.margin==="dense"&&{marginTop:8,marginBottom:4},t.fullWidth&&{width:"100%"})),ioe=I.forwardRef(function(e,n){const r=gn({props:e,name:"MuiFormControl"}),{children:i,className:s,color:o="primary",component:a="div",disabled:l=!1,error:c=!1,focused:u,fullWidth:f=!1,hiddenLabel:h=!1,margin:m="none",required:v=!1,size:w="medium",variant:y="outlined"}=r,g=Nt(r,toe),_=X({},r,{color:o,component:a,disabled:l,error:c,fullWidth:f,hiddenLabel:h,margin:m,required:v,size:w,variant:y}),x=noe(_),[S,D]=I.useState(()=>{let B=!1;return i&&I.Children.forEach(i,Y=>{if(!Tg(Y,["Input","Select"]))return;const ie=Tg(Y,["Select"])?Y.props.input:Y;ie&&pie(ie.props)&&(B=!0)}),B}),[T,E]=I.useState(()=>{let B=!1;return i&&I.Children.forEach(i,Y=>{Tg(Y,["Input","Select"])&&(UM(Y.props,!0)||UM(Y.props.inputProps,!0))&&(B=!0)}),B}),[R,C]=I.useState(!1);l&&R&&C(!1);const L=u!==void 0&&!l?u:R;let P;const z=I.useMemo(()=>({adornedStart:S,setAdornedStart:D,color:o,disabled:l,error:c,filled:T,focused:L,fullWidth:f,hiddenLabel:h,size:w,onBlur:()=>{C(!1)},onEmpty:()=>{E(!1)},onFilled:()=>{E(!0)},onFocus:()=>{C(!0)},registerEffect:P,required:v,variant:y}),[S,o,l,c,T,L,f,h,P,v,w,y]);return O.jsx(P4.Provider,{value:z,children:O.jsx(roe,X({as:a,ownerState:_,className:Vt(x.root,s),ref:n},g,{children:i}))})});function soe(t){return Mn("MuiFormHelperText",t)}const I6=fn("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var L6;const ooe=["children","className","component","disabled","error","filled","focused","margin","required","variant"],aoe=t=>{const{classes:e,contained:n,size:r,disabled:i,error:s,filled:o,focused:a,required:l}=t,c={root:["root",i&&"disabled",s&&"error",r&&`size${zt(r)}`,n&&"contained",a&&"focused",o&&"filled",l&&"required"]};return bn(c,soe,e)},loe=Ct("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.size&&e[`size${zt(n.size)}`],n.contained&&e.contained,n.filled&&e.filled]}})(({theme:t,ownerState:e})=>X({color:(t.vars||t).palette.text.secondary},t.typography.caption,{textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${I6.disabled}`]:{color:(t.vars||t).palette.text.disabled},[`&.${I6.error}`]:{color:(t.vars||t).palette.error.main}},e.size==="small"&&{marginTop:4},e.contained&&{marginLeft:14,marginRight:14})),coe=I.forwardRef(function(e,n){const r=gn({props:e,name:"MuiFormHelperText"}),{children:i,className:s,component:o="p"}=r,a=Nt(r,ooe),l=Im(),c=Tm({props:r,muiFormControl:l,states:["variant","size","disabled","error","filled","focused","required"]}),u=X({},r,{component:o,contained:c.variant==="filled"||c.variant==="outlined",variant:c.variant,size:c.size,disabled:c.disabled,error:c.error,filled:c.filled,focused:c.focused,required:c.required}),f=aoe(u);return O.jsx(loe,X({as:o,ownerState:u,className:Vt(f.root,s),ref:n},a,{children:i===" "?L6||(L6=O.jsx("span",{className:"notranslate",children:""})):i}))});function uoe(t){return Mn("MuiFormLabel",t)}const Rg=fn("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),foe=["children","className","color","component","disabled","error","filled","focused","required"],doe=t=>{const{classes:e,color:n,focused:r,disabled:i,error:s,filled:o,required:a}=t,l={root:["root",`color${zt(n)}`,i&&"disabled",s&&"error",o&&"filled",r&&"focused",a&&"required"],asterisk:["asterisk",s&&"error"]};return bn(l,uoe,e)},hoe=Ct("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:({ownerState:t},e)=>X({},e.root,t.color==="secondary"&&e.colorSecondary,t.filled&&e.filled)})(({theme:t,ownerState:e})=>X({color:(t.vars||t).palette.text.secondary},t.typography.body1,{lineHeight:"1.4375em",padding:0,position:"relative",[`&.${Rg.focused}`]:{color:(t.vars||t).palette[e.color].main},[`&.${Rg.disabled}`]:{color:(t.vars||t).palette.text.disabled},[`&.${Rg.error}`]:{color:(t.vars||t).palette.error.main}})),poe=Ct("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(t,e)=>e.asterisk})(({theme:t})=>({[`&.${Rg.error}`]:{color:(t.vars||t).palette.error.main}})),moe=I.forwardRef(function(e,n){const r=gn({props:e,name:"MuiFormLabel"}),{children:i,className:s,component:o="label"}=r,a=Nt(r,foe),l=Im(),c=Tm({props:r,muiFormControl:l,states:["color","required","focused","disabled","error","filled"]}),u=X({},r,{color:c.color||"primary",component:o,disabled:c.disabled,error:c.error,filled:c.filled,focused:c.focused,required:c.required}),f=doe(u);return O.jsxs(hoe,X({as:o,ownerState:u,className:Vt(f.root,s),ref:n},a,{children:[i,c.required&&O.jsxs(poe,{ownerState:u,"aria-hidden":!0,className:f.asterisk,children:[" ","*"]})]}))}),goe=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function $T(t){return`scale(${t}, ${t**2})`}const voe={entering:{opacity:1,transform:$T(1)},entered:{opacity:1,transform:"none"}},iE=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),B4=I.forwardRef(function(e,n){const{addEndListener:r,appear:i=!0,children:s,easing:o,in:a,onEnter:l,onEntered:c,onEntering:u,onExit:f,onExited:h,onExiting:m,style:v,timeout:w="auto",TransitionComponent:y=fa}=e,g=Nt(e,goe),_=Bb(),x=I.useRef(),S=Bu(),D=I.useRef(null),T=ni(D,s.ref,n),E=ie=>ee=>{if(ie){const le=D.current;ee===void 0?ie(le):ie(le,ee)}},R=E(u),C=E((ie,ee)=>{R4(ie);const{duration:le,delay:j,easing:q}=lc({style:v,timeout:w,easing:o},{mode:"enter"});let ne;w==="auto"?(ne=S.transitions.getAutoHeightDuration(ie.clientHeight),x.current=ne):ne=le,ie.style.transition=[S.transitions.create("opacity",{duration:ne,delay:j}),S.transitions.create("transform",{duration:iE?ne:ne*.666,delay:j,easing:q})].join(","),l&&l(ie,ee)}),L=E(c),P=E(m),z=E(ie=>{const{duration:ee,delay:le,easing:j}=lc({style:v,timeout:w,easing:o},{mode:"exit"});let q;w==="auto"?(q=S.transitions.getAutoHeightDuration(ie.clientHeight),x.current=q):q=ee,ie.style.transition=[S.transitions.create("opacity",{duration:q,delay:le}),S.transitions.create("transform",{duration:iE?q:q*.666,delay:iE?le:le||q*.333,easing:j})].join(","),ie.style.opacity=0,ie.style.transform=$T(.75),f&&f(ie)}),B=E(h),Y=ie=>{w==="auto"&&_.start(x.current||0,ie),r&&r(D.current,ie)};return O.jsx(y,X({appear:i,in:a,nodeRef:D,onEnter:C,onEntered:L,onEntering:R,onExit:z,onExited:B,onExiting:P,addEndListener:Y,timeout:w==="auto"?null:w},g,{children:(ie,ee)=>I.cloneElement(s,X({style:X({opacity:0,transform:$T(.75),visibility:ie==="exited"&&!a?"hidden":void 0},voe[ie],v,s.props.style),ref:T},ee))}))});B4.muiSupportAuto=!0;const yoe=["disableUnderline","components","componentsProps","fullWidth","inputComponent","multiline","slotProps","slots","type"],woe=t=>{const{classes:e,disableUnderline:n}=t,i=bn({root:["root",!n&&"underline"],input:["input"]},_ie,e);return X({},e,i)},_oe=Ct(i2,{shouldForwardProp:t=>Po(t)||t==="classes",name:"MuiInput",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[...n2(t,e),!n.disableUnderline&&e.underline]}})(({theme:t,ownerState:e})=>{let r=t.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return t.vars&&(r=`rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})`),X({position:"relative"},e.formControl&&{"label + &":{marginTop:16}},!e.disableUnderline&&{"&::after":{borderBottom:`2px solid ${(t.vars||t).palette[e.color].main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${I0.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${I0.error}`]:{"&::before, &::after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:`1px solid ${r}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${I0.disabled}, .${I0.error}):before`]:{borderBottom:`2px solid ${(t.vars||t).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${r}`}},[`&.${I0.disabled}:before`]:{borderBottomStyle:"dotted"}})}),Moe=Ct(s2,{name:"MuiInput",slot:"Input",overridesResolver:r2})({}),a2=I.forwardRef(function(e,n){var r,i,s,o;const a=gn({props:e,name:"MuiInput"}),{disableUnderline:l,components:c={},componentsProps:u,fullWidth:f=!1,inputComponent:h="input",multiline:m=!1,slotProps:v,slots:w={},type:y="text"}=a,g=Nt(a,yoe),_=woe(a),S={root:{ownerState:{disableUnderline:l}}},D=v??u?Co(v??u,S):S,T=(r=(i=w.root)!=null?i:c.Root)!=null?r:_oe,E=(s=(o=w.input)!=null?o:c.Input)!=null?s:Moe;return O.jsx(D4,X({slots:{root:T,input:E},slotProps:D,fullWidth:f,inputComponent:h,multiline:m,ref:n,type:y},g,{classes:_}))});a2.muiName="Input";function xoe(t){return Mn("MuiInputLabel",t)}fn("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const boe=["disableAnimation","margin","shrink","variant","className"],Soe=t=>{const{classes:e,formControl:n,size:r,shrink:i,disableAnimation:s,variant:o,required:a}=t,l={root:["root",n&&"formControl",!s&&"animated",i&&"shrink",r&&r!=="normal"&&`size${zt(r)}`,o],asterisk:[a&&"asterisk"]},c=bn(l,xoe,e);return X({},e,c)},Coe=Ct(moe,{shouldForwardProp:t=>Po(t)||t==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${Rg.asterisk}`]:e.asterisk},e.root,n.formControl&&e.formControl,n.size==="small"&&e.sizeSmall,n.shrink&&e.shrink,!n.disableAnimation&&e.animated,n.focused&&e.focused,e[n.variant]]}})(({theme:t,ownerState:e})=>X({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},e.formControl&&{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"},e.size==="small"&&{transform:"translate(0, 17px) scale(1)"},e.shrink&&{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"},!e.disableAnimation&&{transition:t.transitions.create(["color","transform","max-width"],{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut})},e.variant==="filled"&&X({zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},e.size==="small"&&{transform:"translate(12px, 13px) scale(1)"},e.shrink&&X({userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"},e.size==="small"&&{transform:"translate(12px, 4px) scale(0.75)"})),e.variant==="outlined"&&X({zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},e.size==="small"&&{transform:"translate(14px, 9px) scale(1)"},e.shrink&&{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}))),Eoe=I.forwardRef(function(e,n){const r=gn({name:"MuiInputLabel",props:e}),{disableAnimation:i=!1,shrink:s,className:o}=r,a=Nt(r,boe),l=Im();let c=s;typeof c>"u"&&l&&(c=l.filled||l.focused||l.adornedStart);const u=Tm({props:r,muiFormControl:l,states:["size","variant","required","focused"]}),f=X({},r,{disableAnimation:i,formControl:l,shrink:c,size:u.size,variant:u.variant,required:u.required,focused:u.focused}),h=Soe(f);return O.jsx(Coe,X({"data-shrink":c,ownerState:f,ref:n,className:Vt(h.root,o)},a,{classes:h}))}),Pg=I.createContext({});function Aoe(t){return Mn("MuiList",t)}fn("MuiList",["root","padding","dense","subheader"]);const Toe=["children","className","component","dense","disablePadding","subheader"],Ioe=t=>{const{classes:e,disablePadding:n,dense:r,subheader:i}=t;return bn({root:["root",!n&&"padding",r&&"dense",i&&"subheader"]},Aoe,e)},Loe=Ct("ul",{name:"MuiList",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.disablePadding&&e.padding,n.dense&&e.dense,n.subheader&&e.subheader]}})(({ownerState:t})=>X({listStyle:"none",margin:0,padding:0,position:"relative"},!t.disablePadding&&{paddingTop:8,paddingBottom:8},t.subheader&&{paddingTop:0})),uv=I.forwardRef(function(e,n){const r=gn({props:e,name:"MuiList"}),{children:i,className:s,component:o="ul",dense:a=!1,disablePadding:l=!1,subheader:c}=r,u=Nt(r,Toe),f=I.useMemo(()=>({dense:a}),[a]),h=X({},r,{component:o,dense:a,disablePadding:l}),m=Ioe(h);return O.jsx(Pg.Provider,{value:f,children:O.jsxs(Loe,X({as:o,className:Vt(m.root,s),ref:n,ownerState:h},u,{children:[c,i]}))})});function Roe(t){return Mn("MuiListItem",t)}const $h=fn("MuiListItem",["root","container","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","padding","button","secondaryAction","selected"]),Poe=fn("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]);function Doe(t){return Mn("MuiListItemSecondaryAction",t)}fn("MuiListItemSecondaryAction",["root","disableGutters"]);const Noe=["className"],koe=t=>{const{disableGutters:e,classes:n}=t;return bn({root:["root",e&&"disableGutters"]},Doe,n)},Boe=Ct("div",{name:"MuiListItemSecondaryAction",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.disableGutters&&e.disableGutters]}})(({ownerState:t})=>X({position:"absolute",right:16,top:"50%",transform:"translateY(-50%)"},t.disableGutters&&{right:0})),Y5=I.forwardRef(function(e,n){const r=gn({props:e,name:"MuiListItemSecondaryAction"}),{className:i}=r,s=Nt(r,Noe),o=I.useContext(Pg),a=X({},r,{disableGutters:o.disableGutters}),l=koe(a);return O.jsx(Boe,X({className:Vt(l.root,i),ownerState:a,ref:n},s))});Y5.muiName="ListItemSecondaryAction";const Ooe=["className"],Uoe=["alignItems","autoFocus","button","children","className","component","components","componentsProps","ContainerComponent","ContainerProps","dense","disabled","disableGutters","disablePadding","divider","focusVisibleClassName","secondaryAction","selected","slotProps","slots"],Foe=(t,e)=>{const{ownerState:n}=t;return[e.root,n.dense&&e.dense,n.alignItems==="flex-start"&&e.alignItemsFlexStart,n.divider&&e.divider,!n.disableGutters&&e.gutters,!n.disablePadding&&e.padding,n.button&&e.button,n.hasSecondaryAction&&e.secondaryAction]},joe=t=>{const{alignItems:e,button:n,classes:r,dense:i,disabled:s,disableGutters:o,disablePadding:a,divider:l,hasSecondaryAction:c,selected:u}=t;return bn({root:["root",i&&"dense",!o&&"gutters",!a&&"padding",l&&"divider",s&&"disabled",n&&"button",e==="flex-start"&&"alignItemsFlexStart",c&&"secondaryAction",u&&"selected"],container:["container"]},Roe,r)},zoe=Ct("div",{name:"MuiListItem",slot:"Root",overridesResolver:Foe})(({theme:t,ownerState:e})=>X({display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left"},!e.disablePadding&&X({paddingTop:8,paddingBottom:8},e.dense&&{paddingTop:4,paddingBottom:4},!e.disableGutters&&{paddingLeft:16,paddingRight:16},!!e.secondaryAction&&{paddingRight:48}),!!e.secondaryAction&&{[`& > .${Poe.root}`]:{paddingRight:48}},{[`&.${$h.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${$h.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:yo(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${$h.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:yo(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},[`&.${$h.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}},e.alignItems==="flex-start"&&{alignItems:"flex-start"},e.divider&&{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"},e.button&&{transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${$h.selected}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:yo(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:yo(t.palette.primary.main,t.palette.action.selectedOpacity)}}},e.hasSecondaryAction&&{paddingRight:48})),Hoe=Ct("li",{name:"MuiListItem",slot:"Container",overridesResolver:(t,e)=>e.container})({position:"relative"}),l2=I.forwardRef(function(e,n){const r=gn({props:e,name:"MuiListItem"}),{alignItems:i="center",autoFocus:s=!1,button:o=!1,children:a,className:l,component:c,components:u={},componentsProps:f={},ContainerComponent:h="li",ContainerProps:{className:m}={},dense:v=!1,disabled:w=!1,disableGutters:y=!1,disablePadding:g=!1,divider:_=!1,focusVisibleClassName:x,secondaryAction:S,selected:D=!1,slotProps:T={},slots:E={}}=r,R=Nt(r.ContainerProps,Ooe),C=Nt(r,Uoe),L=I.useContext(Pg),P=I.useMemo(()=>({dense:v||L.dense||!1,alignItems:i,disableGutters:y}),[i,L.dense,v,y]),z=I.useRef(null);Oa(()=>{s&&z.current&&z.current.focus()},[s]);const B=I.Children.toArray(a),Y=B.length&&Tg(B[B.length-1],["ListItemSecondaryAction"]),ie=X({},r,{alignItems:i,autoFocus:s,button:o,dense:P.dense,disabled:w,disableGutters:y,disablePadding:g,divider:_,hasSecondaryAction:Y,selected:D}),ee=joe(ie),le=ni(z,n),j=E.root||u.Root||zoe,q=T.root||f.root||{},ne=X({className:Vt(ee.root,q.className,l),disabled:w},C);let de=c||"li";return o&&(ne.component=c||"div",ne.focusVisibleClassName=Vt($h.focusVisible,x),de=t2),Y?(de=!ne.component&&!c?"div":de,h==="li"&&(de==="li"?de="div":ne.component==="li"&&(ne.component="div")),O.jsx(Pg.Provider,{value:P,children:O.jsxs(Hoe,X({as:h,className:Vt(ee.container,m),ref:le,ownerState:ie},R,{children:[O.jsx(j,X({},q,!$p(j)&&{as:de,ownerState:X({},ie,q.ownerState)},ne,{children:B})),B.pop()]}))})):O.jsx(Pg.Provider,{value:P,children:O.jsxs(j,X({},q,{as:de,ref:le},!$p(j)&&{ownerState:X({},ie,q.ownerState)},ne,{children:[B,S&&O.jsx(Y5,{children:S})]}))})}),Goe=["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"];function sE(t,e,n){return t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:n?null:t.firstChild}function R6(t,e,n){return t===e?n?t.firstChild:t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:n?null:t.lastChild}function Q5(t,e){if(e===void 0)return!0;let n=t.innerText;return n===void 0&&(n=t.textContent),n=n.trim().toLowerCase(),n.length===0?!1:e.repeating?n[0]===e.keys[0]:n.indexOf(e.keys.join(""))===0}function L0(t,e,n,r,i,s){let o=!1,a=i(t,e,e?n:!1);for(;a;){if(a===t.firstChild){if(o)return!1;o=!0}const l=r?!1:a.disabled||a.getAttribute("aria-disabled")==="true";if(!a.hasAttribute("tabindex")||!Q5(a,s)||l)a=i(t,a,n);else return a.focus(),!0}return!1}const Voe=I.forwardRef(function(e,n){const{actions:r,autoFocus:i=!1,autoFocusItem:s=!1,children:o,className:a,disabledItemsFocusable:l=!1,disableListWrap:c=!1,onKeyDown:u,variant:f="selectedMenu"}=e,h=Nt(e,Goe),m=I.useRef(null),v=I.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});Oa(()=>{i&&m.current.focus()},[i]),I.useImperativeHandle(r,()=>({adjustStyleForScrollbar:(x,{direction:S})=>{const D=!m.current.style.width;if(x.clientHeight{const S=m.current,D=x.key,T=Zr(S).activeElement;if(D==="ArrowDown")x.preventDefault(),L0(S,T,c,l,sE);else if(D==="ArrowUp")x.preventDefault(),L0(S,T,c,l,R6);else if(D==="Home")x.preventDefault(),L0(S,null,c,l,sE);else if(D==="End")x.preventDefault(),L0(S,null,c,l,R6);else if(D.length===1){const E=v.current,R=D.toLowerCase(),C=performance.now();E.keys.length>0&&(C-E.lastTime>500?(E.keys=[],E.repeating=!0,E.previousKeyMatched=!0):E.repeating&&R!==E.keys[0]&&(E.repeating=!1)),E.lastTime=C,E.keys.push(R);const L=T&&!E.repeating&&Q5(T,E);E.previousKeyMatched&&(L||L0(S,T,!1,l,sE,E))?x.preventDefault():E.previousKeyMatched=!1}u&&u(x)},y=ni(m,n);let g=-1;I.Children.forEach(o,(x,S)=>{if(!I.isValidElement(x)){g===S&&(g+=1,g>=o.length&&(g=-1));return}x.props.disabled||(f==="selectedMenu"&&x.props.selected||g===-1)&&(g=S),g===S&&(x.props.disabled||x.props.muiSkipListHighlight||x.type.muiSkipListHighlight)&&(g+=1,g>=o.length&&(g=-1))});const _=I.Children.map(o,(x,S)=>{if(S===g){const D={};return s&&(D.autoFocus=!0),x.props.tabIndex===void 0&&f==="selectedMenu"&&(D.tabIndex=0),I.cloneElement(x,D)}return x});return O.jsx(uv,X({role:"menu",ref:y,className:a,onKeyDown:w,tabIndex:i?0:-1},h,{children:_}))});function Woe(t){return Mn("MuiPopover",t)}fn("MuiPopover",["root","paper"]);const $oe=["onEntering"],Joe=["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","className","container","elevation","marginThreshold","open","PaperProps","slots","slotProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps","disableScrollLock"],Yoe=["slotProps"];function P6(t,e){let n=0;return typeof e=="number"?n=e:e==="center"?n=t.height/2:e==="bottom"&&(n=t.height),n}function D6(t,e){let n=0;return typeof e=="number"?n=e:e==="center"?n=t.width/2:e==="right"&&(n=t.width),n}function N6(t){return[t.horizontal,t.vertical].map(e=>typeof e=="number"?`${e}px`:e).join(" ")}function oE(t){return typeof t=="function"?t():t}const Qoe=t=>{const{classes:e}=t;return bn({root:["root"],paper:["paper"]},Woe,e)},Xoe=Ct(N4,{name:"MuiPopover",slot:"Root",overridesResolver:(t,e)=>e.root})({}),X5=Ct(Ou,{name:"MuiPopover",slot:"Paper",overridesResolver:(t,e)=>e.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),Koe=I.forwardRef(function(e,n){var r,i,s;const o=gn({props:e,name:"MuiPopover"}),{action:a,anchorEl:l,anchorOrigin:c={vertical:"top",horizontal:"left"},anchorPosition:u,anchorReference:f="anchorEl",children:h,className:m,container:v,elevation:w=8,marginThreshold:y=16,open:g,PaperProps:_={},slots:x,slotProps:S,transformOrigin:D={vertical:"top",horizontal:"left"},TransitionComponent:T=B4,transitionDuration:E="auto",TransitionProps:{onEntering:R}={},disableScrollLock:C=!1}=o,L=Nt(o.TransitionProps,$oe),P=Nt(o,Joe),z=(r=S==null?void 0:S.paper)!=null?r:_,B=I.useRef(),Y=ni(B,z.ref),ie=X({},o,{anchorOrigin:c,anchorReference:f,elevation:w,marginThreshold:y,externalPaperSlotProps:z,transformOrigin:D,TransitionComponent:T,transitionDuration:E,TransitionProps:L}),ee=Qoe(ie),le=I.useCallback(()=>{if(f==="anchorPosition")return u;const Ce=oE(l),ze=(Ce&&Ce.nodeType===1?Ce:Zr(B.current).body).getBoundingClientRect();return{top:ze.top+P6(ze,c.vertical),left:ze.left+D6(ze,c.horizontal)}},[l,c.horizontal,c.vertical,u,f]),j=I.useCallback(Ce=>({vertical:P6(Ce,D.vertical),horizontal:D6(Ce,D.horizontal)}),[D.horizontal,D.vertical]),q=I.useCallback(Ce=>{const Ne={width:Ce.offsetWidth,height:Ce.offsetHeight},ze=j(Ne);if(f==="none")return{top:null,left:null,transformOrigin:N6(ze)};const Ue=le();let Et=Ue.top-ze.vertical,lt=Ue.left-ze.horizontal;const yt=Et+Ne.height,re=lt+Ne.width,V=Ks(oE(l)),Ee=V.innerHeight-y,je=V.innerWidth-y;if(y!==null&&EtEe){const De=yt-Ee;Et-=De,ze.vertical+=De}if(y!==null&<je){const De=re-je;lt-=De,ze.horizontal+=De}return{top:`${Math.round(Et)}px`,left:`${Math.round(lt)}px`,transformOrigin:N6(ze)}},[l,f,le,j,y]),[ne,de]=I.useState(g),_e=I.useCallback(()=>{const Ce=B.current;if(!Ce)return;const Ne=q(Ce);Ne.top!==null&&(Ce.style.top=Ne.top),Ne.left!==null&&(Ce.style.left=Ne.left),Ce.style.transformOrigin=Ne.transformOrigin,de(!0)},[q]);I.useEffect(()=>(C&&window.addEventListener("scroll",_e),()=>window.removeEventListener("scroll",_e)),[l,C,_e]);const ge=(Ce,Ne)=>{R&&R(Ce,Ne),_e()},ce=()=>{de(!1)};I.useEffect(()=>{g&&_e()}),I.useImperativeHandle(a,()=>g?{updatePosition:()=>{_e()}}:null,[g,_e]),I.useEffect(()=>{if(!g)return;const Ce=Db(()=>{_e()}),Ne=Ks(l);return Ne.addEventListener("resize",Ce),()=>{Ce.clear(),Ne.removeEventListener("resize",Ce)}},[l,g,_e]);let we=E;E==="auto"&&!T.muiSupportAuto&&(we=void 0);const he=v||(l?Zr(oE(l)).body:void 0),Ie=(i=x==null?void 0:x.root)!=null?i:Xoe,et=(s=x==null?void 0:x.paper)!=null?s:X5,ct=vd({elementType:et,externalSlotProps:X({},z,{style:ne?z.style:X({},z.style,{opacity:0})}),additionalProps:{elevation:w,ref:Y},ownerState:ie,className:Vt(ee.paper,z==null?void 0:z.className)}),it=vd({elementType:Ie,externalSlotProps:(S==null?void 0:S.root)||{},externalForwardedProps:P,additionalProps:{ref:n,slotProps:{backdrop:{invisible:!0}},container:he,open:g},ownerState:ie,className:Vt(ee.root,m)}),{slotProps:ut}=it,$=Nt(it,Yoe);return O.jsx(Ie,X({},$,!$p(Ie)&&{slotProps:ut,disableScrollLock:C},{children:O.jsx(T,X({appear:!0,in:g,onEntering:ge,onExited:ce,timeout:we},L,{children:O.jsx(et,X({},ct,{children:h}))}))}))});function Zoe(t){return Mn("MuiMenu",t)}fn("MuiMenu",["root","paper","list"]);const qoe=["onEntering"],eae=["autoFocus","children","className","disableAutoFocusItem","MenuListProps","onClose","open","PaperProps","PopoverClasses","transitionDuration","TransitionProps","variant","slots","slotProps"],tae={vertical:"top",horizontal:"right"},nae={vertical:"top",horizontal:"left"},rae=t=>{const{classes:e}=t;return bn({root:["root"],paper:["paper"],list:["list"]},Zoe,e)},iae=Ct(Koe,{shouldForwardProp:t=>Po(t)||t==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(t,e)=>e.root})({}),sae=Ct(X5,{name:"MuiMenu",slot:"Paper",overridesResolver:(t,e)=>e.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),oae=Ct(Voe,{name:"MuiMenu",slot:"List",overridesResolver:(t,e)=>e.list})({outline:0}),aae=I.forwardRef(function(e,n){var r,i;const s=gn({props:e,name:"MuiMenu"}),{autoFocus:o=!0,children:a,className:l,disableAutoFocusItem:c=!1,MenuListProps:u={},onClose:f,open:h,PaperProps:m={},PopoverClasses:v,transitionDuration:w="auto",TransitionProps:{onEntering:y}={},variant:g="selectedMenu",slots:_={},slotProps:x={}}=s,S=Nt(s.TransitionProps,qoe),D=Nt(s,eae),T=A5(),E=X({},s,{autoFocus:o,disableAutoFocusItem:c,MenuListProps:u,onEntering:y,PaperProps:m,transitionDuration:w,TransitionProps:S,variant:g}),R=rae(E),C=o&&!c&&h,L=I.useRef(null),P=(j,q)=>{L.current&&L.current.adjustStyleForScrollbar(j,{direction:T?"rtl":"ltr"}),y&&y(j,q)},z=j=>{j.key==="Tab"&&(j.preventDefault(),f&&f(j,"tabKeyDown"))};let B=-1;I.Children.map(a,(j,q)=>{I.isValidElement(j)&&(j.props.disabled||(g==="selectedMenu"&&j.props.selected||B===-1)&&(B=q))});const Y=(r=_.paper)!=null?r:sae,ie=(i=x.paper)!=null?i:m,ee=vd({elementType:_.root,externalSlotProps:x.root,ownerState:E,className:[R.root,l]}),le=vd({elementType:Y,externalSlotProps:ie,ownerState:E,className:R.paper});return O.jsx(iae,X({onClose:f,anchorOrigin:{vertical:"bottom",horizontal:T?"right":"left"},transformOrigin:T?tae:nae,slots:{paper:Y,root:_.root},slotProps:{root:ee,paper:le},open:h,ref:n,transitionDuration:w,TransitionProps:X({onEntering:P},S),ownerState:E},D,{classes:v,children:O.jsx(oae,X({onKeyDown:z,actions:L,autoFocus:o&&(B===-1||c),autoFocusItem:C,variant:g},u,{className:Vt(R.list,u.className),children:a}))}))});function lae(t){return Mn("MuiNativeSelect",t)}const O4=fn("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),cae=["className","disabled","error","IconComponent","inputRef","variant"],uae=t=>{const{classes:e,variant:n,disabled:r,multiple:i,open:s,error:o}=t,a={select:["select",n,r&&"disabled",i&&"multiple",o&&"error"],icon:["icon",`icon${zt(n)}`,s&&"iconOpen",r&&"disabled"]};return bn(a,lae,e)},K5=({ownerState:t,theme:e})=>X({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":X({},e.vars?{backgroundColor:`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.05)`}:{backgroundColor:e.palette.mode==="light"?"rgba(0, 0, 0, 0.05)":"rgba(255, 255, 255, 0.05)"},{borderRadius:0}),"&::-ms-expand":{display:"none"},[`&.${O4.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(e.vars||e).palette.background.paper},"&&&":{paddingRight:24,minWidth:16}},t.variant==="filled"&&{"&&&":{paddingRight:32}},t.variant==="outlined"&&{borderRadius:(e.vars||e).shape.borderRadius,"&:focus":{borderRadius:(e.vars||e).shape.borderRadius},"&&&":{paddingRight:32}}),fae=Ct("select",{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:Po,overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.select,e[n.variant],n.error&&e.error,{[`&.${O4.multiple}`]:e.multiple}]}})(K5),Z5=({ownerState:t,theme:e})=>X({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(e.vars||e).palette.action.active,[`&.${O4.disabled}`]:{color:(e.vars||e).palette.action.disabled}},t.open&&{transform:"rotate(180deg)"},t.variant==="filled"&&{right:7},t.variant==="outlined"&&{right:7}),dae=Ct("svg",{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.icon,n.variant&&e[`icon${zt(n.variant)}`],n.open&&e.iconOpen]}})(Z5),hae=I.forwardRef(function(e,n){const{className:r,disabled:i,error:s,IconComponent:o,inputRef:a,variant:l="standard"}=e,c=Nt(e,cae),u=X({},e,{disabled:i,variant:l,error:s}),f=uae(u);return O.jsxs(I.Fragment,{children:[O.jsx(fae,X({ownerState:u,className:Vt(f.select,r),disabled:i,ref:a||n},c)),e.multiple?null:O.jsx(dae,{as:o,ownerState:u,className:f.icon})]})});var k6;const pae=["children","classes","className","label","notched"],mae=Ct("fieldset",{shouldForwardProp:Po})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),gae=Ct("legend",{shouldForwardProp:Po})(({ownerState:t,theme:e})=>X({float:"unset",width:"auto",overflow:"hidden"},!t.withLabel&&{padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})},t.withLabel&&X({display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}},t.notched&&{maxWidth:"100%",transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})})));function vae(t){const{className:e,label:n,notched:r}=t,i=Nt(t,pae),s=n!=null&&n!=="",o=X({},t,{notched:r,withLabel:s});return O.jsx(mae,X({"aria-hidden":!0,className:e,ownerState:o},i,{children:O.jsx(gae,{ownerState:o,children:s?O.jsx("span",{children:n}):k6||(k6=O.jsx("span",{className:"notranslate",children:""}))})}))}const yae=["components","fullWidth","inputComponent","label","multiline","notched","slots","type"],wae=t=>{const{classes:e}=t,r=bn({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},Mie,e);return X({},e,r)},_ae=Ct(i2,{shouldForwardProp:t=>Po(t)||t==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:n2})(({theme:t,ownerState:e})=>{const n=t.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return X({position:"relative",borderRadius:(t.vars||t).shape.borderRadius,[`&:hover .${Ac.notchedOutline}`]:{borderColor:(t.vars||t).palette.text.primary},"@media (hover: none)":{[`&:hover .${Ac.notchedOutline}`]:{borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:n}},[`&.${Ac.focused} .${Ac.notchedOutline}`]:{borderColor:(t.vars||t).palette[e.color].main,borderWidth:2},[`&.${Ac.error} .${Ac.notchedOutline}`]:{borderColor:(t.vars||t).palette.error.main},[`&.${Ac.disabled} .${Ac.notchedOutline}`]:{borderColor:(t.vars||t).palette.action.disabled}},e.startAdornment&&{paddingLeft:14},e.endAdornment&&{paddingRight:14},e.multiline&&X({padding:"16.5px 14px"},e.size==="small"&&{padding:"8.5px 14px"}))}),Mae=Ct(vae,{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(t,e)=>e.notchedOutline})(({theme:t})=>{const e=t.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:e}}),xae=Ct(s2,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:r2})(({theme:t,ownerState:e})=>X({padding:"16.5px 14px"},!t.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:t.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:t.palette.mode==="light"?null:"#fff",caretColor:t.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},t.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[t.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},e.size==="small"&&{padding:"8.5px 14px"},e.multiline&&{padding:0},e.startAdornment&&{paddingLeft:0},e.endAdornment&&{paddingRight:0})),U4=I.forwardRef(function(e,n){var r,i,s,o,a;const l=gn({props:e,name:"MuiOutlinedInput"}),{components:c={},fullWidth:u=!1,inputComponent:f="input",label:h,multiline:m=!1,notched:v,slots:w={},type:y="text"}=l,g=Nt(l,yae),_=wae(l),x=Im(),S=Tm({props:l,muiFormControl:x,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),D=X({},l,{color:S.color||"primary",disabled:S.disabled,error:S.error,focused:S.focused,formControl:x,fullWidth:u,hiddenLabel:S.hiddenLabel,multiline:m,size:S.size,type:y}),T=(r=(i=w.root)!=null?i:c.Root)!=null?r:_ae,E=(s=(o=w.input)!=null?o:c.Input)!=null?s:xae;return O.jsx(D4,X({slots:{root:T,input:E},renderSuffix:R=>O.jsx(Mae,{ownerState:D,className:_.notchedOutline,label:h!=null&&h!==""&&S.required?a||(a=O.jsxs(I.Fragment,{children:[h," ","*"]})):h,notched:typeof v<"u"?v:!!(R.startAdornment||R.filled||R.focused)}),fullWidth:u,inputComponent:f,multiline:m,ref:n,type:y},g,{classes:X({},_,{notchedOutline:null})}))});U4.muiName="Input";function bae(t){return Mn("MuiSelect",t)}const R0=fn("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var B6;const Sae=["aria-describedby","aria-label","autoFocus","autoWidth","children","className","defaultOpen","defaultValue","disabled","displayEmpty","error","IconComponent","inputRef","labelId","MenuProps","multiple","name","onBlur","onChange","onClose","onFocus","onOpen","open","readOnly","renderValue","SelectDisplayProps","tabIndex","type","value","variant"],Cae=Ct("div",{name:"MuiSelect",slot:"Select",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`&.${R0.select}`]:e.select},{[`&.${R0.select}`]:e[n.variant]},{[`&.${R0.error}`]:e.error},{[`&.${R0.multiple}`]:e.multiple}]}})(K5,{[`&.${R0.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),Eae=Ct("svg",{name:"MuiSelect",slot:"Icon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.icon,n.variant&&e[`icon${zt(n.variant)}`],n.open&&e.iconOpen]}})(Z5),Aae=Ct("input",{shouldForwardProp:t=>x5(t)&&t!=="classes",name:"MuiSelect",slot:"NativeInput",overridesResolver:(t,e)=>e.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function O6(t,e){return typeof e=="object"&&e!==null?t===e:String(t)===String(e)}function Tae(t){return t==null||typeof t=="string"&&!t.trim()}const Iae=t=>{const{classes:e,variant:n,disabled:r,multiple:i,open:s,error:o}=t,a={select:["select",n,r&&"disabled",i&&"multiple",o&&"error"],icon:["icon",`icon${zt(n)}`,s&&"iconOpen",r&&"disabled"],nativeInput:["nativeInput"]};return bn(a,bae,e)},Lae=I.forwardRef(function(e,n){var r;const{"aria-describedby":i,"aria-label":s,autoFocus:o,autoWidth:a,children:l,className:c,defaultOpen:u,defaultValue:f,disabled:h,displayEmpty:m,error:v=!1,IconComponent:w,inputRef:y,labelId:g,MenuProps:_={},multiple:x,name:S,onBlur:D,onChange:T,onClose:E,onFocus:R,onOpen:C,open:L,readOnly:P,renderValue:z,SelectDisplayProps:B={},tabIndex:Y,value:ie,variant:ee="standard"}=e,le=Nt(e,Sae),[j,q]=RM({controlled:ie,default:f,name:"Select"}),[ne,de]=RM({controlled:L,default:u,name:"Select"}),_e=I.useRef(null),ge=I.useRef(null),[ce,we]=I.useState(null),{current:he}=I.useRef(L!=null),[Ie,et]=I.useState(),ct=ni(n,y),it=I.useCallback(We=>{ge.current=We,We&&we(We)},[]),ut=ce==null?void 0:ce.parentNode;I.useImperativeHandle(ct,()=>({focus:()=>{ge.current.focus()},node:_e.current,value:j}),[j]),I.useEffect(()=>{u&&ne&&ce&&!he&&(et(a?null:ut.clientWidth),ge.current.focus())},[ce,a]),I.useEffect(()=>{o&&ge.current.focus()},[o]),I.useEffect(()=>{if(!g)return;const We=Zr(ge.current).getElementById(g);if(We){const Ze=()=>{getSelection().isCollapsed&&ge.current.focus()};return We.addEventListener("click",Ze),()=>{We.removeEventListener("click",Ze)}}},[g]);const $=(We,Ze)=>{We?C&&C(Ze):E&&E(Ze),he||(et(a?null:ut.clientWidth),de(We))},Ce=We=>{We.button===0&&(We.preventDefault(),ge.current.focus(),$(!0,We))},Ne=We=>{$(!1,We)},ze=I.Children.toArray(l),Ue=We=>{const Ze=ze.find(Tt=>Tt.props.value===We.target.value);Ze!==void 0&&(q(Ze.props.value),T&&T(We,Ze))},Et=We=>Ze=>{let Tt;if(Ze.currentTarget.hasAttribute("tabindex")){if(x){Tt=Array.isArray(j)?j.slice():[];const Ft=j.indexOf(We.props.value);Ft===-1?Tt.push(We.props.value):Tt.splice(Ft,1)}else Tt=We.props.value;if(We.props.onClick&&We.props.onClick(Ze),j!==Tt&&(q(Tt),T)){const Ft=Ze.nativeEvent||Ze,en=new Ft.constructor(Ft.type,Ft);Object.defineProperty(en,"target",{writable:!0,value:{value:Tt,name:S}}),T(en,We)}x||$(!1,Ze)}},lt=We=>{P||[" ","ArrowUp","ArrowDown","Enter"].indexOf(We.key)!==-1&&(We.preventDefault(),$(!0,We))},yt=ce!==null&&ne,re=We=>{!yt&&D&&(Object.defineProperty(We,"target",{writable:!0,value:{value:j,name:S}}),D(We))};delete le["aria-invalid"];let V,Ee;const je=[];let De=!1;(UM({value:j})||m)&&(z?V=z(j):De=!0);const He=ze.map(We=>{if(!I.isValidElement(We))return null;let Ze;if(x){if(!Array.isArray(j))throw new Error(gd(2));Ze=j.some(Tt=>O6(Tt,We.props.value)),Ze&&De&&je.push(We.props.children)}else Ze=O6(j,We.props.value),Ze&&De&&(Ee=We.props.children);return I.cloneElement(We,{"aria-selected":Ze?"true":"false",onClick:Et(We),onKeyUp:Tt=>{Tt.key===" "&&Tt.preventDefault(),We.props.onKeyUp&&We.props.onKeyUp(Tt)},role:"option",selected:Ze,value:void 0,"data-value":We.props.value})});De&&(x?je.length===0?V=null:V=je.reduce((We,Ze,Tt)=>(We.push(Ze),Tt{const{classes:e}=t;return e},F4={name:"MuiSelect",overridesResolver:(t,e)=>e.root,shouldForwardProp:t=>Po(t)&&t!=="variant",slot:"Root"},Nae=Ct(a2,F4)(""),kae=Ct(U4,F4)(""),Bae=Ct(k4,F4)(""),q5=I.forwardRef(function(e,n){const r=gn({name:"MuiSelect",props:e}),{autoWidth:i=!1,children:s,classes:o={},className:a,defaultOpen:l=!1,displayEmpty:c=!1,IconComponent:u=bie,id:f,input:h,inputProps:m,label:v,labelId:w,MenuProps:y,multiple:g=!1,native:_=!1,onClose:x,onOpen:S,open:D,renderValue:T,SelectDisplayProps:E,variant:R="outlined"}=r,C=Nt(r,Rae),L=_?hae:Lae,P=Im(),z=Tm({props:r,muiFormControl:P,states:["variant","error"]}),B=z.variant||R,Y=X({},r,{variant:B,classes:o}),ie=Dae(Y),ee=Nt(ie,Pae),le=h||{standard:O.jsx(Nae,{ownerState:Y}),outlined:O.jsx(kae,{label:v,ownerState:Y}),filled:O.jsx(Bae,{ownerState:Y})}[B],j=ni(n,le.ref);return O.jsx(I.Fragment,{children:I.cloneElement(le,X({inputComponent:L,inputProps:X({children:s,error:z.error,IconComponent:u,variant:B,type:void 0,multiple:g},_?{id:f}:{autoWidth:i,defaultOpen:l,displayEmpty:c,labelId:w,MenuProps:y,onClose:x,onOpen:S,open:D,renderValue:T,SelectDisplayProps:X({id:f},E)},m,{classes:m?Co(ee,m.classes):ee},h?h.props.inputProps:{})},(g&&_||c)&&B==="outlined"?{notched:!0}:{},{ref:j,className:Vt(le.props.className,a,ie.root)},!h&&{variant:B},C))})});q5.muiName="Select";function Oae(t){return Mn("MuiSnackbarContent",t)}fn("MuiSnackbarContent",["root","message","action"]);const Uae=["action","className","message","role"],Fae=t=>{const{classes:e}=t;return bn({root:["root"],action:["action"],message:["message"]},Oae,e)},jae=Ct(Ou,{name:"MuiSnackbarContent",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>{const e=t.palette.mode==="light"?.8:.98,n=cte(t.palette.background.default,e);return X({},t.typography.body2,{color:t.vars?t.vars.palette.SnackbarContent.color:t.palette.getContrastText(n),backgroundColor:t.vars?t.vars.palette.SnackbarContent.bg:n,display:"flex",alignItems:"center",flexWrap:"wrap",padding:"6px 16px",borderRadius:(t.vars||t).shape.borderRadius,flexGrow:1,[t.breakpoints.up("sm")]:{flexGrow:"initial",minWidth:288}})}),zae=Ct("div",{name:"MuiSnackbarContent",slot:"Message",overridesResolver:(t,e)=>e.message})({padding:"8px 0"}),Hae=Ct("div",{name:"MuiSnackbarContent",slot:"Action",overridesResolver:(t,e)=>e.action})({display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}),Gae=I.forwardRef(function(e,n){const r=gn({props:e,name:"MuiSnackbarContent"}),{action:i,className:s,message:o,role:a="alert"}=r,l=Nt(r,Uae),c=r,u=Fae(c);return O.jsxs(jae,X({role:a,square:!0,elevation:6,className:Vt(u.root,s),ownerState:c,ref:n},l,{children:[O.jsx(zae,{className:u.message,ownerState:c,children:o}),i?O.jsx(Hae,{className:u.action,ownerState:c,children:i}):null]}))});function Vae(t){return Mn("MuiSnackbar",t)}fn("MuiSnackbar",["root","anchorOriginTopCenter","anchorOriginBottomCenter","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft"]);const Wae=["onEnter","onExited"],$ae=["action","anchorOrigin","autoHideDuration","children","className","ClickAwayListenerProps","ContentProps","disableWindowBlurListener","message","onBlur","onClose","onFocus","onMouseEnter","onMouseLeave","open","resumeHideDuration","TransitionComponent","transitionDuration","TransitionProps"],Jae=t=>{const{classes:e,anchorOrigin:n}=t,r={root:["root",`anchorOrigin${zt(n.vertical)}${zt(n.horizontal)}`]};return bn(r,Vae,e)},U6=Ct("div",{name:"MuiSnackbar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`anchorOrigin${zt(n.anchorOrigin.vertical)}${zt(n.anchorOrigin.horizontal)}`]]}})(({theme:t,ownerState:e})=>{const n={left:"50%",right:"auto",transform:"translateX(-50%)"};return X({zIndex:(t.vars||t).zIndex.snackbar,position:"fixed",display:"flex",left:8,right:8,justifyContent:"center",alignItems:"center"},e.anchorOrigin.vertical==="top"?{top:8}:{bottom:8},e.anchorOrigin.horizontal==="left"&&{justifyContent:"flex-start"},e.anchorOrigin.horizontal==="right"&&{justifyContent:"flex-end"},{[t.breakpoints.up("sm")]:X({},e.anchorOrigin.vertical==="top"?{top:24}:{bottom:24},e.anchorOrigin.horizontal==="center"&&n,e.anchorOrigin.horizontal==="left"&&{left:24,right:"auto"},e.anchorOrigin.horizontal==="right"&&{right:24,left:"auto"})})}),e8=I.forwardRef(function(e,n){const r=gn({props:e,name:"MuiSnackbar"}),i=Bu(),s={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{action:o,anchorOrigin:{vertical:a,horizontal:l}={vertical:"bottom",horizontal:"left"},autoHideDuration:c=null,children:u,className:f,ClickAwayListenerProps:h,ContentProps:m,disableWindowBlurListener:v=!1,message:w,open:y,TransitionComponent:g=B4,transitionDuration:_=s,TransitionProps:{onEnter:x,onExited:S}={}}=r,D=Nt(r.TransitionProps,Wae),T=Nt(r,$ae),E=X({},r,{anchorOrigin:{vertical:a,horizontal:l},autoHideDuration:c,disableWindowBlurListener:v,TransitionComponent:g,transitionDuration:_}),R=Jae(E),{getRootProps:C,onClickAway:L}=cie(X({},E)),[P,z]=I.useState(!0),B=vd({elementType:U6,getSlotProps:C,externalForwardedProps:T,ownerState:E,additionalProps:{ref:n},className:[R.root,f]}),Y=ee=>{z(!0),S&&S(ee)},ie=(ee,le)=>{z(!1),x&&x(ee,le)};return!y&&P?null:O.jsx(Gre,X({onClickAway:L},h,{children:O.jsx(U6,X({},B,{children:O.jsx(g,X({appear:!0,in:y,timeout:_,direction:a==="top"?"down":"up",onEnter:ie,onExited:Y},D,{children:u||O.jsx(Gae,X({message:w,action:o},m))}))}))}))}),Yae=["anchor","classes","className","width","style"],Qae=Ct("div",{shouldForwardProp:Po})(({theme:t,ownerState:e})=>X({position:"fixed",top:0,left:0,bottom:0,zIndex:t.zIndex.drawer-1},e.anchor==="left"&&{right:"auto"},e.anchor==="right"&&{left:"auto",right:0},e.anchor==="top"&&{bottom:"auto",right:0},e.anchor==="bottom"&&{top:"auto",bottom:0,right:0})),Xae=I.forwardRef(function(e,n){const{anchor:r,classes:i={},className:s,width:o,style:a}=e,l=Nt(e,Yae),c=e;return O.jsx(Qae,X({className:Vt("PrivateSwipeArea-root",i.root,i[`anchor${zt(r)}`],s),ref:n,style:X({[kf(r)?"width":"height"]:o},a),ownerState:c},l))}),Kae=["BackdropProps"],Zae=["anchor","disableBackdropTransition","disableDiscovery","disableSwipeToOpen","hideBackdrop","hysteresis","allowSwipeInChildren","minFlingVelocity","ModalProps","onClose","onOpen","open","PaperProps","SwipeAreaProps","swipeAreaWidth","transitionDuration","variant"],aw=3,aE=20;let Rl=null;function lE(t,e,n){return t==="right"?n.body.offsetWidth-e[0].pageX:e[0].pageX}function cE(t,e,n){return t==="bottom"?n.innerHeight-e[0].clientY:e[0].clientY}function P0(t,e){return t?e.clientWidth:e.clientHeight}function F6(t,e,n,r){return Math.min(Math.max(n?e-t:r+e-t,0),r)}function qae(t,e){const n=[];for(;t&&t!==e.parentElement;){const r=Ks(e).getComputedStyle(t);r.getPropertyValue("position")==="absolute"||r.getPropertyValue("overflow-x")==="hidden"||(t.clientWidth>0&&t.scrollWidth>t.clientWidth||t.clientHeight>0&&t.scrollHeight>t.clientHeight)&&n.push(t),t=t.parentElement}return n}function ele({domTreeShapes:t,start:e,current:n,anchor:r}){const i={scrollPosition:{x:"scrollLeft",y:"scrollTop"},scrollLength:{x:"scrollWidth",y:"scrollHeight"},clientLength:{x:"clientWidth",y:"clientHeight"}};return t.some(s=>{let o=n>=e;(r==="top"||r==="left")&&(o=!o);const a=r==="left"||r==="right"?"x":"y",l=Math.round(s[i.scrollPosition[a]]),c=l>0,u=l+s[i.clientLength[a]]{le.current=null},[g]);const j=I.useCallback((ge,ce={})=>{const{mode:we=null,changeTransition:he=!0}=ce,Ie=lg(i,o),et=["right","bottom"].indexOf(Ie)!==-1?1:-1,ct=kf(o),it=ct?`translate(${et*ge}px, 0)`:`translate(0, ${et*ge}px)`,ut=Y.current.style;ut.webkitTransform=it,ut.transform=it;let $="";if(we&&($=i.transitions.create("all",lc({easing:void 0,style:void 0,timeout:D},{mode:we}))),he&&(ut.webkitTransition=$,ut.transition=$),!a&&!u){const Ce=B.current.style;Ce.opacity=1-ge/P0(ct,Y.current),he&&(Ce.webkitTransition=$,Ce.transition=$)}},[o,a,u,i,D]),q=vo(ge=>{if(!ee.current)return;if(Rl=null,ee.current=!1,md.flushSync(()=>{L(!1)}),!P.current.isSwiping){P.current.isSwiping=null;return}P.current.isSwiping=null;const ce=lg(i,o),we=kf(o);let he;we?he=lE(ce,ge.changedTouches,Zr(ge.currentTarget)):he=cE(ce,ge.changedTouches,Ks(ge.currentTarget));const Ie=we?P.current.startX:P.current.startY,et=P0(we,Y.current),ct=F6(he,Ie,g,et),it=ct/et;if(Math.abs(P.current.velocity)>m&&(le.current=Math.abs((et-ct)/P.current.velocity)*1e3),g){P.current.velocity>m||it>f?w():j(0,{mode:"exit"});return}P.current.velocity<-m||1-it>f?y():j(P0(we,Y.current),{mode:"enter"})}),ne=(ge=!1)=>{if(!C){(ge||!(l&&h))&&md.flushSync(()=>{L(!0)});const ce=kf(o);!g&&Y.current&&j(P0(ce,Y.current)+(l?15:-aE),{changeTransition:!1}),P.current.velocity=0,P.current.lastTime=null,P.current.lastTranslate=null,P.current.paperHit=!1,ee.current=!0}},de=vo(ge=>{if(!Y.current||!ee.current||Rl!==null&&Rl!==P.current)return;ne(!0);const ce=lg(i,o),we=kf(o),he=lE(ce,ge.touches,Zr(ge.currentTarget)),Ie=cE(ce,ge.touches,Ks(ge.currentTarget));if(g&&Y.current.contains(ge.target)&&Rl===null){const $=qae(ge.target,Y.current);if(ele({domTreeShapes:$,start:we?P.current.startX:P.current.startY,current:we?he:Ie,anchor:o})){Rl=!0;return}Rl=P.current}if(P.current.isSwiping==null){const $=Math.abs(he-P.current.startX),Ce=Math.abs(Ie-P.current.startY),Ne=we?$>Ce&&$>aw:Ce>$&&Ce>aw;if(Ne&&ge.cancelable&&ge.preventDefault(),Ne===!0||(we?Ce>aw:$>aw)){if(P.current.isSwiping=Ne,!Ne){q(ge);return}P.current.startX=he,P.current.startY=Ie,!l&&!g&&(we?P.current.startX-=aE:P.current.startY-=aE)}}if(!P.current.isSwiping)return;const et=P0(we,Y.current);let ct=we?P.current.startX:P.current.startY;g&&!P.current.paperHit&&(ct=Math.min(ct,et));const it=F6(we?he:Ie,ct,g,et);if(g)if(P.current.paperHit)it===0&&(P.current.startX=he,P.current.startY=Ie);else if(we?he{if(ge.defaultPrevented||ge.defaultMuiPrevented||g&&(u||!B.current.contains(ge.target))&&!Y.current.contains(ge.target))return;const ce=lg(i,o),we=kf(o),he=lE(ce,ge.touches,Zr(ge.currentTarget)),Ie=cE(ce,ge.touches,Ks(ge.currentTarget));if(!g){var et;if(c||!(ge.target===z.current||(et=Y.current)!=null&&et.contains(ge.target)&&(typeof h=="function"?h(ge,z.current,Y.current):h)))return;if(we){if(he>S)return}else if(Ie>S)return}ge.defaultMuiPrevented=!0,Rl=null,P.current.startX=he,P.current.startY=Ie,ne()});return I.useEffect(()=>{if(T==="temporary"){const ge=Zr(Y.current);return ge.addEventListener("touchstart",_e),ge.addEventListener("touchmove",de,{passive:!g}),ge.addEventListener("touchend",q),()=>{ge.removeEventListener("touchstart",_e),ge.removeEventListener("touchmove",de,{passive:!g}),ge.removeEventListener("touchend",q)}}},[T,g,_e,de,q]),I.useEffect(()=>()=>{Rl===P.current&&(Rl=null)},[]),I.useEffect(()=>{g||L(!1)},[g]),O.jsxs(I.Fragment,{children:[O.jsx(Qse,X({open:T==="temporary"&&C?!0:g,variant:T,ModalProps:X({BackdropProps:X({},v,{ref:B})},T==="temporary"&&{keepMounted:!0},E),hideBackdrop:u,PaperProps:X({},_,{style:X({pointerEvents:T==="temporary"&&!g&&!h?"none":""},_.style),ref:ie}),anchor:o,transitionDuration:le.current||D,onClose:w,ref:n},R)),!c&&T==="temporary"&&O.jsx(lie,{children:O.jsx(Xae,X({anchor:o,ref:z,width:S},x))})]})});function rle(t){return Mn("MuiToolbar",t)}fn("MuiToolbar",["root","gutters","regular","dense"]);const ile=["className","component","disableGutters","variant"],sle=t=>{const{classes:e,disableGutters:n,variant:r}=t;return bn({root:["root",!n&&"gutters",r]},rle,e)},ole=Ct("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.disableGutters&&e.gutters,e[n.variant]]}})(({theme:t,ownerState:e})=>X({position:"relative",display:"flex",alignItems:"center"},!e.disableGutters&&{paddingLeft:t.spacing(2),paddingRight:t.spacing(2),[t.breakpoints.up("sm")]:{paddingLeft:t.spacing(3),paddingRight:t.spacing(3)}},e.variant==="dense"&&{minHeight:48}),({theme:t,ownerState:e})=>e.variant==="regular"&&t.mixins.toolbar),ale=I.forwardRef(function(e,n){const r=gn({props:e,name:"MuiToolbar"}),{className:i,component:s="div",disableGutters:o=!1,variant:a="regular"}=r,l=Nt(r,ile),c=X({},r,{component:s,disableGutters:o,variant:a}),u=sle(c);return O.jsx(ole,X({as:s,className:Vt(u.root,i),ref:n,ownerState:c},l))});function lle(t){return Mn("MuiTextField",t)}fn("MuiTextField",["root"]);const cle=["autoComplete","autoFocus","children","className","color","defaultValue","disabled","error","FormHelperTextProps","fullWidth","helperText","id","InputLabelProps","inputProps","InputProps","inputRef","label","maxRows","minRows","multiline","name","onBlur","onChange","onFocus","placeholder","required","rows","select","SelectProps","type","value","variant"],ule={standard:a2,filled:k4,outlined:U4},fle=t=>{const{classes:e}=t;return bn({root:["root"]},lle,e)},dle=Ct(ioe,{name:"MuiTextField",slot:"Root",overridesResolver:(t,e)=>e.root})({}),hle=I.forwardRef(function(e,n){const r=gn({props:e,name:"MuiTextField"}),{autoComplete:i,autoFocus:s=!1,children:o,className:a,color:l="primary",defaultValue:c,disabled:u=!1,error:f=!1,FormHelperTextProps:h,fullWidth:m=!1,helperText:v,id:w,InputLabelProps:y,inputProps:g,InputProps:_,inputRef:x,label:S,maxRows:D,minRows:T,multiline:E=!1,name:R,onBlur:C,onChange:L,onFocus:P,placeholder:z,required:B=!1,rows:Y,select:ie=!1,SelectProps:ee,type:le,value:j,variant:q="outlined"}=r,ne=Nt(r,cle),de=X({},r,{autoFocus:s,color:l,disabled:u,error:f,fullWidth:m,multiline:E,required:B,select:ie,variant:q}),_e=fle(de),ge={};q==="outlined"&&(y&&typeof y.shrink<"u"&&(ge.notched=y.shrink),ge.label=S),ie&&((!ee||!ee.native)&&(ge.id=void 0),ge["aria-describedby"]=void 0);const ce=Nb(w),we=v&&ce?`${ce}-helper-text`:void 0,he=S&&ce?`${ce}-label`:void 0,Ie=ule[q],et=O.jsx(Ie,X({"aria-describedby":we,autoComplete:i,autoFocus:s,defaultValue:c,fullWidth:m,multiline:E,name:R,rows:Y,maxRows:D,minRows:T,type:le,value:j,id:ce,inputRef:x,onBlur:C,onChange:L,onFocus:P,placeholder:z,inputProps:g},ge,_));return O.jsxs(dle,X({className:Vt(_e.root,a),disabled:u,error:f,fullWidth:m,ref:n,required:B,color:l,variant:q,ownerState:de},ne,{children:[S!=null&&S!==""&&O.jsx(Eoe,X({htmlFor:ce,id:he},y,{children:S})),ie?O.jsx(q5,X({"aria-describedby":we,id:ce,labelId:he,value:j,input:et},ee,{children:o})):et,v&&O.jsx(coe,X({id:we},h,{children:v}))]}))});var ple={VITE_apiKey:"AIzaSyA9rwmAgjAlIC-gitEJi7lm5c8xlpgeOdY",VITE_authDomain:"connection-280f7.firebaseapp.com",VITE_projectId:"connection-280f7",VITE_storageBucket:"connection-280f7.appspot.com",VITE_messagingSenderId:"514095534536",VITE_appId:"1:514095534536:web:6bca02ef3459c41bde70fd",VITE_databaseURL:"https://connection-280f7-default-rtdb.europe-west1.firebasedatabase.app",BASE_URL:"/Connection/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const j6=t=>{let e;const n=new Set,r=(u,f)=>{const h=typeof u=="function"?u(e):u;if(!Object.is(h,e)){const m=e;e=f??(typeof h!="object"||h===null)?h:Object.assign({},e,h),n.forEach(v=>v(e,m))}},i=()=>e,l={setState:r,getState:i,getInitialState:()=>c,subscribe:u=>(n.add(u),()=>n.delete(u)),destroy:()=>{(ple?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},c=e=t(r,i,l);return l},mle=t=>t?j6(t):j6;var t8={exports:{}},n8={},r8={exports:{}},i8={};/**
+ * @license React
+ * use-sync-external-store-shim.production.min.js
+ *
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */var Yp=I;function gle(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var vle=typeof Object.is=="function"?Object.is:gle,yle=Yp.useState,wle=Yp.useEffect,_le=Yp.useLayoutEffect,Mle=Yp.useDebugValue;function xle(t,e){var n=e(),r=yle({inst:{value:n,getSnapshot:e}}),i=r[0].inst,s=r[1];return _le(function(){i.value=n,i.getSnapshot=e,uE(i)&&s({inst:i})},[t,n,e]),wle(function(){return uE(i)&&s({inst:i}),t(function(){uE(i)&&s({inst:i})})},[t]),Mle(n),n}function uE(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!vle(t,n)}catch{return!0}}function ble(t,e){return e()}var Sle=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?ble:xle;i8.useSyncExternalStore=Yp.useSyncExternalStore!==void 0?Yp.useSyncExternalStore:Sle;r8.exports=i8;var Cle=r8.exports;/**
+ * @license React
+ * use-sync-external-store-shim/with-selector.production.min.js
+ *
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */var c2=I,Ele=Cle;function Ale(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Tle=typeof Object.is=="function"?Object.is:Ale,Ile=Ele.useSyncExternalStore,Lle=c2.useRef,Rle=c2.useEffect,Ple=c2.useMemo,Dle=c2.useDebugValue;n8.useSyncExternalStoreWithSelector=function(t,e,n,r,i){var s=Lle(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=Ple(function(){function l(m){if(!c){if(c=!0,u=m,m=r(m),i!==void 0&&o.hasValue){var v=o.value;if(i(v,m))return f=v}return f=m}if(v=f,Tle(u,m))return v;var w=r(m);return i!==void 0&&i(v,w)?v:(u=m,f=w)}var c=!1,u,f,h=n===void 0?null:n;return[function(){return l(e())},h===null?void 0:function(){return l(h())}]},[e,n,r,i]);var a=Ile(t,s[0],s[1]);return Rle(function(){o.hasValue=!0,o.value=a},[a]),Dle(a),a};t8.exports=n8;var Nle=t8.exports;const kle=_m(Nle);var s8={VITE_apiKey:"AIzaSyA9rwmAgjAlIC-gitEJi7lm5c8xlpgeOdY",VITE_authDomain:"connection-280f7.firebaseapp.com",VITE_projectId:"connection-280f7",VITE_storageBucket:"connection-280f7.appspot.com",VITE_messagingSenderId:"514095534536",VITE_appId:"1:514095534536:web:6bca02ef3459c41bde70fd",VITE_databaseURL:"https://connection-280f7-default-rtdb.europe-west1.firebasedatabase.app",BASE_URL:"/Connection/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{useDebugValue:Ble}=qt,{useSyncExternalStoreWithSelector:Ole}=kle;let z6=!1;const Ule=t=>t;function Fle(t,e=Ule,n){(s8?"production":void 0)!=="production"&&n&&!z6&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),z6=!0);const r=Ole(t.subscribe,t.getState,t.getServerState||t.getInitialState,e,n);return Ble(r),r}const H6=t=>{(s8?"production":void 0)!=="production"&&typeof t!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const e=typeof t=="function"?mle(t):t,n=(r,i)=>Fle(e,r,i);return Object.assign(n,e),n},j4=t=>t?H6(t):H6;var G6={};/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 o8=function(t){const e=[];let n=0;for(let r=0;r>6|192,e[n++]=i&63|128):(i&64512)===55296&&r+1>18|240,e[n++]=i>>12&63|128,e[n++]=i>>6&63|128,e[n++]=i&63|128):(e[n++]=i>>12|224,e[n++]=i>>6&63|128,e[n++]=i&63|128)}return e},jle=function(t){const e=[];let n=0,r=0;for(;n191&&i<224){const s=t[n++];e[r++]=String.fromCharCode((i&31)<<6|s&63)}else if(i>239&&i<365){const s=t[n++],o=t[n++],a=t[n++],l=((i&7)<<18|(s&63)<<12|(o&63)<<6|a&63)-65536;e[r++]=String.fromCharCode(55296+(l>>10)),e[r++]=String.fromCharCode(56320+(l&1023))}else{const s=t[n++],o=t[n++];e[r++]=String.fromCharCode((i&15)<<12|(s&63)<<6|o&63)}}return e.join("")},a8={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(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let i=0;i>2,f=(s&3)<<4|a>>4;let h=(a&15)<<2|c>>6,m=c&63;l||(m=64,o||(h=64)),r.push(n[u],n[f],n[h],n[m])}return r.join("")},encodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(o8(t),e)},decodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):jle(this.decodeStringToByteArray(t,e))},decodeStringToByteArray(t,e){this.init_();const n=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let i=0;i>4;if(r.push(h),c!==64){const m=a<<4&240|c>>2;if(r.push(m),f!==64){const v=c<<6&192|f;r.push(v)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let t=0;t=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}};class zle extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const Hle=function(t){const e=o8(t);return a8.encodeByteArray(e,!0)},jM=function(t){return Hle(t).replace(/\./g,"")},l8=function(t){try{return a8.decodeString(t,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};/**
+ * @license
+ * Copyright 2022 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Gle(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}/**
+ * @license
+ * Copyright 2022 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Vle=()=>Gle().__FIREBASE_DEFAULTS__,Wle=()=>{if(typeof process>"u"||typeof G6>"u")return;const t=G6.__FIREBASE_DEFAULTS__;if(t)return JSON.parse(t)},$le=()=>{if(typeof document>"u")return;let t;try{t=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const e=t&&l8(t[1]);return e&&JSON.parse(e)},u2=()=>{try{return Vle()||Wle()||$le()}catch(t){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${t}`);return}},c8=t=>{var e,n;return(n=(e=u2())===null||e===void 0?void 0:e.emulatorHosts)===null||n===void 0?void 0:n[t]},u8=t=>{const e=c8(t);if(!e)return;const n=e.lastIndexOf(":");if(n<=0||n+1===e.length)throw new Error(`Invalid host ${e} with no separate hostname and port!`);const r=parseInt(e.substring(n+1),10);return e[0]==="["?[e.substring(1,n-1),r]:[e.substring(0,n),r]},f8=()=>{var t;return(t=u2())===null||t===void 0?void 0:t.config},d8=t=>{var e;return(e=u2())===null||e===void 0?void 0:e[`_${t}`]};/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Jle{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,n)=>{this.resolve=e,this.reject=n})}wrapCallback(e){return(n,r)=>{n?this.reject(n):this.resolve(r),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(n):e(n,r))}}}/**
+ * @license
+ * Copyright 2021 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 h8(t,e){if(t.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const n={alg:"none",type:"JWT"},r=e||"demo-project",i=t.iat||0,s=t.sub||t.user_id;if(!s)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const o=Object.assign({iss:`https://securetoken.google.com/${r}`,aud:r,iat:i,exp:i+3600,auth_time:i,sub:s,user_id:s,firebase:{sign_in_provider:"custom",identities:{}}},t);return[jM(JSON.stringify(n)),jM(JSON.stringify(o)),""].join(".")}/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Ki(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function Yle(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(Ki())}function Qle(){var t;const e=(t=u2())===null||t===void 0?void 0:t.forceEnvironment;if(e==="node")return!0;if(e==="browser")return!1;try{return Object.prototype.toString.call(global.process)==="[object process]"}catch{return!1}}function Xle(){const t=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof t=="object"&&t.id!==void 0}function Kle(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function Zle(){const t=Ki();return t.indexOf("MSIE ")>=0||t.indexOf("Trident/")>=0}function qle(){return!Qle()&&!!navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function ece(){try{return typeof indexedDB=="object"}catch{return!1}}function tce(){return new Promise((t,e)=>{try{let n=!0;const r="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(r);i.onsuccess=()=>{i.result.close(),n||self.indexedDB.deleteDatabase(r),t(!0)},i.onupgradeneeded=()=>{n=!1},i.onerror=()=>{var s;e(((s=i.error)===null||s===void 0?void 0:s.message)||"")}}catch(n){e(n)}})}/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 nce="FirebaseError";class Ml extends Error{constructor(e,n,r){super(n),this.code=e,this.customData=r,this.name=nce,Object.setPrototypeOf(this,Ml.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,fv.prototype.create)}}class fv{constructor(e,n,r){this.service=e,this.serviceName=n,this.errors=r}create(e,...n){const r=n[0]||{},i=`${this.service}/${e}`,s=this.errors[e],o=s?rce(s,r):"Error",a=`${this.serviceName}: ${o} (${i}).`;return new Ml(i,a,r)}}function rce(t,e){return t.replace(ice,(n,r)=>{const i=e[r];return i!=null?String(i):`<${r}?>`})}const ice=/\{\$([^}]+)}/g;function sce(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}function Qp(t,e){if(t===e)return!0;const n=Object.keys(t),r=Object.keys(e);for(const i of n){if(!r.includes(i))return!1;const s=t[i],o=e[i];if(V6(s)&&V6(o)){if(!Qp(s,o))return!1}else if(s!==o)return!1}for(const i of r)if(!n.includes(i))return!1;return!0}function V6(t){return t!==null&&typeof t=="object"}/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 dv(t){const e=[];for(const[n,r]of Object.entries(t))Array.isArray(r)?r.forEach(i=>{e.push(encodeURIComponent(n)+"="+encodeURIComponent(i))}):e.push(encodeURIComponent(n)+"="+encodeURIComponent(r));return e.length?"&"+e.join("&"):""}function cg(t){const e={};return t.replace(/^\?/,"").split("&").forEach(r=>{if(r){const[i,s]=r.split("=");e[decodeURIComponent(i)]=decodeURIComponent(s)}}),e}function ug(t){const e=t.indexOf("?");if(!e)return"";const n=t.indexOf("#",e);return t.substring(e,n>0?n:void 0)}function oce(t,e){const n=new ace(t,e);return n.subscribe.bind(n)}class ace{constructor(e,n){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=n,this.task.then(()=>{e(this)}).catch(r=>{this.error(r)})}next(e){this.forEachObserver(n=>{n.next(e)})}error(e){this.forEachObserver(n=>{n.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,n,r){let i;if(e===void 0&&n===void 0&&r===void 0)throw new Error("Missing Observer.");lce(e,["next","error","complete"])?i=e:i={next:e,error:n,complete:r},i.next===void 0&&(i.next=fE),i.error===void 0&&(i.error=fE),i.complete===void 0&&(i.complete=fE);const s=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?i.error(this.finalError):i.complete()}catch{}}),this.observers.push(i),s}unsubscribeOne(e){this.observers===void 0||this.observers[e]===void 0||(delete this.observers[e],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let n=0;n{if(this.observers!==void 0&&this.observers[e]!==void 0)try{n(this.observers[e])}catch(r){typeof console<"u"&&console.error&&console.error(r)}})}close(e){this.finalized||(this.finalized=!0,e!==void 0&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function lce(t,e){if(typeof t!="object"||t===null)return!1;for(const n of e)if(n in t&&typeof t[n]=="function")return!0;return!1}function fE(){}/**
+ * @license
+ * Copyright 2021 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 mr(t){return t&&t._delegate?t._delegate:t}let _u=class{constructor(e,n,r){this.name=e,this.instanceFactory=n,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}};/**
+ * @license
+ * Copyright 2019 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Rf="[DEFAULT]";/**
+ * @license
+ * Copyright 2019 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 cce=class{constructor(e,n){this.name=e,this.container=n,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const n=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(n)){const r=new Jle;if(this.instancesDeferred.set(n,r),this.isInitialized(n)||this.shouldAutoInitialize())try{const i=this.getOrInitializeService({instanceIdentifier:n});i&&r.resolve(i)}catch{}}return this.instancesDeferred.get(n).promise}getImmediate(e){var n;const r=this.normalizeInstanceIdentifier(e==null?void 0:e.identifier),i=(n=e==null?void 0:e.optional)!==null&&n!==void 0?n:!1;if(this.isInitialized(r)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:r})}catch(s){if(i)return null;throw s}else{if(i)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,!!this.shouldAutoInitialize()){if(fce(e))try{this.getOrInitializeService({instanceIdentifier:Rf})}catch{}for(const[n,r]of this.instancesDeferred.entries()){const i=this.normalizeInstanceIdentifier(n);try{const s=this.getOrInitializeService({instanceIdentifier:i});r.resolve(s)}catch{}}}}clearInstance(e=Rf){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter(n=>"INTERNAL"in n).map(n=>n.INTERNAL.delete()),...e.filter(n=>"_delete"in n).map(n=>n._delete())])}isComponentSet(){return this.component!=null}isInitialized(e=Rf){return this.instances.has(e)}getOptions(e=Rf){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:n={}}=e,r=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(r))throw Error(`${this.name}(${r}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const i=this.getOrInitializeService({instanceIdentifier:r,options:n});for(const[s,o]of this.instancesDeferred.entries()){const a=this.normalizeInstanceIdentifier(s);r===a&&o.resolve(i)}return i}onInit(e,n){var r;const i=this.normalizeInstanceIdentifier(n),s=(r=this.onInitCallbacks.get(i))!==null&&r!==void 0?r:new Set;s.add(e),this.onInitCallbacks.set(i,s);const o=this.instances.get(i);return o&&e(o,i),()=>{s.delete(e)}}invokeOnInitCallbacks(e,n){const r=this.onInitCallbacks.get(n);if(r)for(const i of r)try{i(e,n)}catch{}}getOrInitializeService({instanceIdentifier:e,options:n={}}){let r=this.instances.get(e);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:uce(e),options:n}),this.instances.set(e,r),this.instancesOptions.set(e,n),this.invokeOnInitCallbacks(r,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,r)}catch{}return r||null}normalizeInstanceIdentifier(e=Rf){return this.component?this.component.multipleInstances?e:Rf:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}};function uce(t){return t===Rf?void 0:t}function fce(t){return t.instantiationMode==="EAGER"}/**
+ * @license
+ * Copyright 2019 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 dce{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const n=this.getProvider(e.name);if(n.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);n.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const n=new cce(e,this);return this.providers.set(e,n),n}getProviders(){return Array.from(this.providers.values())}}/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Gn;(function(t){t[t.DEBUG=0]="DEBUG",t[t.VERBOSE=1]="VERBOSE",t[t.INFO=2]="INFO",t[t.WARN=3]="WARN",t[t.ERROR=4]="ERROR",t[t.SILENT=5]="SILENT"})(Gn||(Gn={}));const hce={debug:Gn.DEBUG,verbose:Gn.VERBOSE,info:Gn.INFO,warn:Gn.WARN,error:Gn.ERROR,silent:Gn.SILENT},pce=Gn.INFO,mce={[Gn.DEBUG]:"log",[Gn.VERBOSE]:"log",[Gn.INFO]:"info",[Gn.WARN]:"warn",[Gn.ERROR]:"error"},gce=(t,e,...n)=>{if(ee.some(n=>t instanceof n);let W6,$6;function yce(){return W6||(W6=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function wce(){return $6||($6=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const p8=new WeakMap,JT=new WeakMap,m8=new WeakMap,dE=new WeakMap,H4=new WeakMap;function _ce(t){const e=new Promise((n,r)=>{const i=()=>{t.removeEventListener("success",s),t.removeEventListener("error",o)},s=()=>{n(pu(t.result)),i()},o=()=>{r(t.error),i()};t.addEventListener("success",s),t.addEventListener("error",o)});return e.then(n=>{n instanceof IDBCursor&&p8.set(n,t)}).catch(()=>{}),H4.set(e,t),e}function Mce(t){if(JT.has(t))return;const e=new Promise((n,r)=>{const i=()=>{t.removeEventListener("complete",s),t.removeEventListener("error",o),t.removeEventListener("abort",o)},s=()=>{n(),i()},o=()=>{r(t.error||new DOMException("AbortError","AbortError")),i()};t.addEventListener("complete",s),t.addEventListener("error",o),t.addEventListener("abort",o)});JT.set(t,e)}let YT={get(t,e,n){if(t instanceof IDBTransaction){if(e==="done")return JT.get(t);if(e==="objectStoreNames")return t.objectStoreNames||m8.get(t);if(e==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return pu(t[e])},set(t,e,n){return t[e]=n,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};function xce(t){YT=t(YT)}function bce(t){return t===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...n){const r=t.call(hE(this),e,...n);return m8.set(r,e.sort?e.sort():[e]),pu(r)}:wce().includes(t)?function(...e){return t.apply(hE(this),e),pu(p8.get(this))}:function(...e){return pu(t.apply(hE(this),e))}}function Sce(t){return typeof t=="function"?bce(t):(t instanceof IDBTransaction&&Mce(t),vce(t,yce())?new Proxy(t,YT):t)}function pu(t){if(t instanceof IDBRequest)return _ce(t);if(dE.has(t))return dE.get(t);const e=Sce(t);return e!==t&&(dE.set(t,e),H4.set(e,t)),e}const hE=t=>H4.get(t);function Cce(t,e,{blocked:n,upgrade:r,blocking:i,terminated:s}={}){const o=indexedDB.open(t,e),a=pu(o);return r&&o.addEventListener("upgradeneeded",l=>{r(pu(o.result),l.oldVersion,l.newVersion,pu(o.transaction),l)}),n&&o.addEventListener("blocked",l=>n(l.oldVersion,l.newVersion,l)),a.then(l=>{s&&l.addEventListener("close",()=>s()),i&&l.addEventListener("versionchange",c=>i(c.oldVersion,c.newVersion,c))}).catch(()=>{}),a}const Ece=["get","getKey","getAll","getAllKeys","count"],Ace=["put","add","delete","clear"],pE=new Map;function J6(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(pE.get(e))return pE.get(e);const n=e.replace(/FromIndex$/,""),r=e!==n,i=Ace.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(i||Ece.includes(n)))return;const s=async function(o,...a){const l=this.transaction(o,i?"readwrite":"readonly");let c=l.store;return r&&(c=c.index(a.shift())),(await Promise.all([c[n](...a),i&&l.done]))[0]};return pE.set(e,s),s}xce(t=>({...t,get:(e,n,r)=>J6(e,n)||t.get(e,n,r),has:(e,n)=>!!J6(e,n)||t.has(e,n)}));/**
+ * @license
+ * Copyright 2019 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Tce{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(n=>{if(Ice(n)){const r=n.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(n=>n).join(" ")}}function Ice(t){const e=t.getComponent();return(e==null?void 0:e.type)==="VERSION"}const QT="@firebase/app",Y6="0.10.6";/**
+ * @license
+ * Copyright 2019 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 yd=new z4("@firebase/app"),Lce="@firebase/app-compat",Rce="@firebase/analytics-compat",Pce="@firebase/analytics",Dce="@firebase/app-check-compat",Nce="@firebase/app-check",kce="@firebase/auth",Bce="@firebase/auth-compat",Oce="@firebase/database",Uce="@firebase/database-compat",Fce="@firebase/functions",jce="@firebase/functions-compat",zce="@firebase/installations",Hce="@firebase/installations-compat",Gce="@firebase/messaging",Vce="@firebase/messaging-compat",Wce="@firebase/performance",$ce="@firebase/performance-compat",Jce="@firebase/remote-config",Yce="@firebase/remote-config-compat",Qce="@firebase/storage",Xce="@firebase/storage-compat",Kce="@firebase/firestore",Zce="@firebase/vertexai-preview",qce="@firebase/firestore-compat",eue="firebase",tue="10.12.3";/**
+ * @license
+ * Copyright 2019 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 XT="[DEFAULT]",nue={[QT]:"fire-core",[Lce]:"fire-core-compat",[Pce]:"fire-analytics",[Rce]:"fire-analytics-compat",[Nce]:"fire-app-check",[Dce]:"fire-app-check-compat",[kce]:"fire-auth",[Bce]:"fire-auth-compat",[Oce]:"fire-rtdb",[Uce]:"fire-rtdb-compat",[Fce]:"fire-fn",[jce]:"fire-fn-compat",[zce]:"fire-iid",[Hce]:"fire-iid-compat",[Gce]:"fire-fcm",[Vce]:"fire-fcm-compat",[Wce]:"fire-perf",[$ce]:"fire-perf-compat",[Jce]:"fire-rc",[Yce]:"fire-rc-compat",[Qce]:"fire-gcs",[Xce]:"fire-gcs-compat",[Kce]:"fire-fst",[qce]:"fire-fst-compat",[Zce]:"fire-vertex","fire-js":"fire-js",[eue]:"fire-js-all"};/**
+ * @license
+ * Copyright 2019 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 zM=new Map,rue=new Map,KT=new Map;function Q6(t,e){try{t.container.addComponent(e)}catch(n){yd.debug(`Component ${e.name} failed to register with FirebaseApp ${t.name}`,n)}}function wd(t){const e=t.name;if(KT.has(e))return yd.debug(`There were multiple attempts to register component ${e}.`),!1;KT.set(e,t);for(const n of zM.values())Q6(n,t);for(const n of rue.values())Q6(n,t);return!0}function f2(t,e){const n=t.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),t.container.getProvider(e)}function La(t){return t.settings!==void 0}/**
+ * @license
+ * Copyright 2019 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 iue={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."},mu=new fv("app","Firebase",iue);/**
+ * @license
+ * Copyright 2019 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 sue{constructor(e,n,r){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},n),this._name=n.name,this._automaticDataCollectionEnabled=n.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new _u("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw mu.create("app-deleted",{appName:this._name})}}/**
+ * @license
+ * Copyright 2019 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Bd=tue;function g8(t,e={}){let n=t;typeof e!="object"&&(e={name:e});const r=Object.assign({name:XT,automaticDataCollectionEnabled:!1},e),i=r.name;if(typeof i!="string"||!i)throw mu.create("bad-app-name",{appName:String(i)});if(n||(n=f8()),!n)throw mu.create("no-options");const s=zM.get(i);if(s){if(Qp(n,s.options)&&Qp(r,s.config))return s;throw mu.create("duplicate-app",{appName:i})}const o=new dce(i);for(const l of KT.values())o.addComponent(l);const a=new sue(n,r,o);return zM.set(i,a),a}function G4(t=XT){const e=zM.get(t);if(!e&&t===XT&&f8())return g8();if(!e)throw mu.create("no-app",{appName:t});return e}function sl(t,e,n){var r;let i=(r=nue[t])!==null&&r!==void 0?r:t;n&&(i+=`-${n}`);const s=i.match(/\s|\//),o=e.match(/\s|\//);if(s||o){const a=[`Unable to register library "${i}" with version "${e}":`];s&&a.push(`library name "${i}" contains illegal characters (whitespace or "/")`),s&&o&&a.push("and"),o&&a.push(`version name "${e}" contains illegal characters (whitespace or "/")`),yd.warn(a.join(" "));return}wd(new _u(`${i}-version`,()=>({library:i,version:e}),"VERSION"))}/**
+ * @license
+ * Copyright 2021 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 oue="firebase-heartbeat-database",aue=1,y1="firebase-heartbeat-store";let mE=null;function v8(){return mE||(mE=Cce(oue,aue,{upgrade:(t,e)=>{switch(e){case 0:try{t.createObjectStore(y1)}catch(n){console.warn(n)}}}}).catch(t=>{throw mu.create("idb-open",{originalErrorMessage:t.message})})),mE}async function lue(t){try{const n=(await v8()).transaction(y1),r=await n.objectStore(y1).get(y8(t));return await n.done,r}catch(e){if(e instanceof Ml)yd.warn(e.message);else{const n=mu.create("idb-get",{originalErrorMessage:e==null?void 0:e.message});yd.warn(n.message)}}}async function X6(t,e){try{const r=(await v8()).transaction(y1,"readwrite");await r.objectStore(y1).put(e,y8(t)),await r.done}catch(n){if(n instanceof Ml)yd.warn(n.message);else{const r=mu.create("idb-set",{originalErrorMessage:n==null?void 0:n.message});yd.warn(r.message)}}}function y8(t){return`${t.name}!${t.options.appId}`}/**
+ * @license
+ * Copyright 2021 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 cue=1024,uue=30*24*60*60*1e3;class fue{constructor(e){this.container=e,this._heartbeatsCache=null;const n=this.container.getProvider("app").getImmediate();this._storage=new hue(n),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}async triggerHeartbeat(){var e,n;const i=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),s=K6();if(!(((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,((n=this._heartbeatsCache)===null||n===void 0?void 0:n.heartbeats)==null))&&!(this._heartbeatsCache.lastSentHeartbeatDate===s||this._heartbeatsCache.heartbeats.some(o=>o.date===s)))return this._heartbeatsCache.heartbeats.push({date:s,agent:i}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter(o=>{const a=new Date(o.date).valueOf();return Date.now()-a<=uue}),this._storage.overwrite(this._heartbeatsCache)}async getHeartbeatsHeader(){var e;if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";const n=K6(),{heartbeatsToSend:r,unsentEntries:i}=due(this._heartbeatsCache.heartbeats),s=jM(JSON.stringify({version:2,heartbeats:r}));return this._heartbeatsCache.lastSentHeartbeatDate=n,i.length>0?(this._heartbeatsCache.heartbeats=i,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),s}}function K6(){return new Date().toISOString().substring(0,10)}function due(t,e=cue){const n=[];let r=t.slice();for(const i of t){const s=n.find(o=>o.agent===i.agent);if(s){if(s.dates.push(i.date),Z6(n)>e){s.dates.pop();break}}else if(n.push({agent:i.agent,dates:[i.date]}),Z6(n)>e){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}class hue{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return ece()?tce().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const n=await lue(this.app);return n!=null&&n.heartbeats?n:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(e){var n;if(await this._canUseIndexedDBPromise){const i=await this.read();return X6(this.app,{lastSentHeartbeatDate:(n=e.lastSentHeartbeatDate)!==null&&n!==void 0?n:i.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){var n;if(await this._canUseIndexedDBPromise){const i=await this.read();return X6(this.app,{lastSentHeartbeatDate:(n=e.lastSentHeartbeatDate)!==null&&n!==void 0?n:i.lastSentHeartbeatDate,heartbeats:[...i.heartbeats,...e.heartbeats]})}else return}}function Z6(t){return jM(JSON.stringify({version:2,heartbeats:t})).length}/**
+ * @license
+ * Copyright 2019 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 pue(t){wd(new _u("platform-logger",e=>new Tce(e),"PRIVATE")),wd(new _u("heartbeat",e=>new fue(e),"PRIVATE")),sl(QT,Y6,t),sl(QT,Y6,"esm2017"),sl("fire-js","")}pue("");function V4(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i"u")return null;const t=navigator;return t.languages&&t.languages[0]||t.language||null}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 hv{constructor(e,n){this.shortDelay=e,this.longDelay=n,cc(n>e,"Short delay should be less than long delay!"),this.isMobile=Yle()||Kle()}get(){return wue()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 J4(t,e){cc(t.emulator,"Emulator should always be set here");const{url:n}=t.emulator;return e?`${n}${e.startsWith("/")?e.slice(1):e}`:n}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 M8{static initialize(e,n,r){this.fetchImpl=e,n&&(this.headersImpl=n),r&&(this.responseImpl=r)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self<"u"&&"fetch"in self)return self.fetch;if(typeof globalThis<"u"&&globalThis.fetch)return globalThis.fetch;if(typeof fetch<"u")return fetch;Jl("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){if(this.headersImpl)return this.headersImpl;if(typeof self<"u"&&"Headers"in self)return self.Headers;if(typeof globalThis<"u"&&globalThis.Headers)return globalThis.Headers;if(typeof Headers<"u")return Headers;Jl("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){if(this.responseImpl)return this.responseImpl;if(typeof self<"u"&&"Response"in self)return self.Response;if(typeof globalThis<"u"&&globalThis.Response)return globalThis.Response;if(typeof Response<"u")return Response;Jl("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Mue={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"};/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 xue=new hv(3e4,6e4);function Uu(t,e){return t.tenantId&&!e.tenantId?Object.assign(Object.assign({},e),{tenantId:t.tenantId}):e}async function Fu(t,e,n,r,i={}){return x8(t,i,async()=>{let s={},o={};r&&(e==="GET"?o=r:s={body:JSON.stringify(r)});const a=dv(Object.assign({key:t.config.apiKey},o)).slice(1),l=await t._getAdditionalHeaders();return l["Content-Type"]="application/json",t.languageCode&&(l["X-Firebase-Locale"]=t.languageCode),M8.fetch()(b8(t,t.config.apiHost,n,a),Object.assign({method:e,headers:l,referrerPolicy:"no-referrer"},s))})}async function x8(t,e,n){t._canInitEmulator=!1;const r=Object.assign(Object.assign({},Mue),e);try{const i=new Sue(t),s=await Promise.race([n(),i.promise]);i.clearNetworkTimeout();const o=await s.json();if("needConfirmation"in o)throw lw(t,"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 lw(t,"credential-already-in-use",o);if(l==="EMAIL_EXISTS")throw lw(t,"email-already-in-use",o);if(l==="USER_DISABLED")throw lw(t,"user-disabled",o);const u=r[l]||l.toLowerCase().replace(/[_\s]+/g,"-");if(c)throw W4(t,u,c);oa(t,u)}}catch(i){if(i instanceof Ml)throw i;oa(t,"network-request-failed",{message:String(i)})}}async function pv(t,e,n,r,i={}){const s=await Fu(t,e,n,r,i);return"mfaPendingCredential"in s&&oa(t,"multi-factor-auth-required",{_serverResponse:s}),s}function b8(t,e,n,r){const i=`${e}${n}?${r}`;return t.config.emulator?J4(t.config,i):`${t.config.apiScheme}://${i}`}function bue(t){switch(t){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}class Sue{constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((n,r)=>{this.timer=setTimeout(()=>r(Da(this.auth,"network-request-failed")),xue.get())})}clearNetworkTimeout(){clearTimeout(this.timer)}}function lw(t,e,n){const r={appName:t.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);const i=Da(t,e,r);return i.customData._tokenResponse=n,i}function eB(t){return t!==void 0&&t.enterprise!==void 0}class Cue{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 n of this.recaptchaEnforcementState)if(n.provider&&n.provider===e)return bue(n.enforcementState);return null}isProviderEnabled(e){return this.getProviderEnforcementState(e)==="ENFORCE"||this.getProviderEnforcementState(e)==="AUDIT"}}async function Eue(t,e){return Fu(t,"GET","/v2/recaptchaConfig",Uu(t,e))}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Aue(t,e){return Fu(t,"POST","/v1/accounts:delete",e)}async function S8(t,e){return Fu(t,"POST","/v1/accounts:lookup",e)}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Dg(t){if(t)try{const e=new Date(Number(t));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}async function Tue(t,e=!1){const n=mr(t),r=await n.getIdToken(e),i=Y4(r);sn(i&&i.exp&&i.auth_time&&i.iat,n.auth,"internal-error");const s=typeof i.firebase=="object"?i.firebase:void 0,o=s==null?void 0:s.sign_in_provider;return{claims:i,token:r,authTime:Dg(gE(i.auth_time)),issuedAtTime:Dg(gE(i.iat)),expirationTime:Dg(gE(i.exp)),signInProvider:o||null,signInSecondFactor:(s==null?void 0:s.sign_in_second_factor)||null}}function gE(t){return Number(t)*1e3}function Y4(t){const[e,n,r]=t.split(".");if(e===void 0||n===void 0||r===void 0)return F_("JWT malformed, contained fewer than 3 sections"),null;try{const i=l8(n);return i?JSON.parse(i):(F_("Failed to decode base64 JWT payload"),null)}catch(i){return F_("Caught error parsing JWT payload as JSON",i==null?void 0:i.toString()),null}}function tB(t){const e=Y4(t);return sn(e,"internal-error"),sn(typeof e.exp<"u","internal-error"),sn(typeof e.iat<"u","internal-error"),Number(e.exp)-Number(e.iat)}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 w1(t,e,n=!1){if(n)return e;try{return await e}catch(r){throw r instanceof Ml&&Iue(r)&&t.auth.currentUser===t&&await t.auth.signOut(),r}}function Iue({code:t}){return t==="auth/user-disabled"||t==="auth/user-token-expired"}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Lue{constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,this.timerId!==null&&clearTimeout(this.timerId))}getInterval(e){var n;if(e){const r=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),r}else{this.errorBackoff=3e4;const i=((n=this.user.stsTokenManager.expirationTime)!==null&&n!==void 0?n:0)-Date.now()-3e5;return Math.max(0,i)}}schedule(e=!1){if(!this.isRunning)return;const n=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},n)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){(e==null?void 0:e.code)==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 qT{constructor(e,n){this.createdAt=e,this.lastLoginAt=n,this._initializeTime()}_initializeTime(){this.lastSignInTime=Dg(this.lastLoginAt),this.creationTime=Dg(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/**
+ * @license
+ * Copyright 2019 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 GM(t){var e;const n=t.auth,r=await t.getIdToken(),i=await w1(t,S8(n,{idToken:r}));sn(i==null?void 0:i.users.length,n,"internal-error");const s=i.users[0];t._notifyReloadListener(s);const o=!((e=s.providerUserInfo)===null||e===void 0)&&e.length?C8(s.providerUserInfo):[],a=Pue(t.providerData,o),l=t.isAnonymous,c=!(t.email&&s.passwordHash)&&!(a!=null&&a.length),u=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 qT(s.createdAt,s.lastLoginAt),isAnonymous:u};Object.assign(t,f)}async function Rue(t){const e=mr(t);await GM(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}function Pue(t,e){return[...t.filter(r=>!e.some(i=>i.providerId===r.providerId)),...e]}function C8(t){return t.map(e=>{var{providerId:n}=e,r=V4(e,["providerId"]);return{providerId:n,uid:r.rawId||"",displayName:r.displayName||null,email:r.email||null,phoneNumber:r.phoneNumber||null,photoURL:r.photoUrl||null}})}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Due(t,e){const n=await x8(t,{},async()=>{const r=dv({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:i,apiKey:s}=t.config,o=b8(t,i,"/v1/token",`key=${s}`),a=await t._getAdditionalHeaders();return a["Content-Type"]="application/x-www-form-urlencoded",M8.fetch()(o,{method:"POST",headers:a,body:r})});return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}async function Nue(t,e){return Fu(t,"POST","/v2/accounts:revokeToken",Uu(t,e))}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Sp{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){sn(e.idToken,"internal-error"),sn(typeof e.idToken<"u","internal-error"),sn(typeof e.refreshToken<"u","internal-error");const n="expiresIn"in e&&typeof e.expiresIn<"u"?Number(e.expiresIn):tB(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,n)}updateFromIdToken(e){sn(e.length!==0,"internal-error");const n=tB(e);this.updateTokensAndExpiration(e,null,n)}async getToken(e,n=!1){return!n&&this.accessToken&&!this.isExpired?this.accessToken:(sn(this.refreshToken,e,"user-token-expired"),this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null)}clearRefreshToken(){this.refreshToken=null}async refresh(e,n){const{accessToken:r,refreshToken:i,expiresIn:s}=await Due(e,n);this.updateTokensAndExpiration(r,i,Number(s))}updateTokensAndExpiration(e,n,r){this.refreshToken=n||null,this.accessToken=e||null,this.expirationTime=Date.now()+r*1e3}static fromJSON(e,n){const{refreshToken:r,accessToken:i,expirationTime:s}=n,o=new Sp;return r&&(sn(typeof r=="string","internal-error",{appName:e}),o.refreshToken=r),i&&(sn(typeof i=="string","internal-error",{appName:e}),o.accessToken=i),s&&(sn(typeof s=="number","internal-error",{appName:e}),o.expirationTime=s),o}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new Sp,this.toJSON())}_performRefresh(){return Jl("not implemented")}}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Ic(t,e){sn(typeof t=="string"||typeof t>"u","internal-error",{appName:e})}class Yl{constructor(e){var{uid:n,auth:r,stsTokenManager:i}=e,s=V4(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new Lue(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=n,this.auth=r,this.stsTokenManager=i,this.accessToken=i.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 qT(s.createdAt||void 0,s.lastLoginAt||void 0)}async getIdToken(e){const n=await w1(this,this.stsTokenManager.getToken(this.auth,e));return sn(n,this.auth,"internal-error"),this.accessToken!==n&&(this.accessToken=n,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),n}getIdTokenResult(e){return Tue(this,e)}reload(){return Rue(this)}_assign(e){this!==e&&(sn(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(n=>Object.assign({},n)),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const n=new Yl(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}));return n.metadata._copy(this.metadata),n}_onReload(e){sn(!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,n=!1){let r=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),r=!0),n&&await GM(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(La(this.auth.app))return Promise.reject(ql(this.auth));const e=await this.getIdToken();return await w1(this,Aue(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,n){var r,i,s,o,a,l,c,u;const f=(r=n.displayName)!==null&&r!==void 0?r:void 0,h=(i=n.email)!==null&&i!==void 0?i:void 0,m=(s=n.phoneNumber)!==null&&s!==void 0?s:void 0,v=(o=n.photoURL)!==null&&o!==void 0?o:void 0,w=(a=n.tenantId)!==null&&a!==void 0?a:void 0,y=(l=n._redirectEventId)!==null&&l!==void 0?l:void 0,g=(c=n.createdAt)!==null&&c!==void 0?c:void 0,_=(u=n.lastLoginAt)!==null&&u!==void 0?u:void 0,{uid:x,emailVerified:S,isAnonymous:D,providerData:T,stsTokenManager:E}=n;sn(x&&E,e,"internal-error");const R=Sp.fromJSON(this.name,E);sn(typeof x=="string",e,"internal-error"),Ic(f,e.name),Ic(h,e.name),sn(typeof S=="boolean",e,"internal-error"),sn(typeof D=="boolean",e,"internal-error"),Ic(m,e.name),Ic(v,e.name),Ic(w,e.name),Ic(y,e.name),Ic(g,e.name),Ic(_,e.name);const C=new Yl({uid:x,auth:e,email:h,emailVerified:S,displayName:f,isAnonymous:D,photoURL:v,phoneNumber:m,tenantId:w,stsTokenManager:R,createdAt:g,lastLoginAt:_});return T&&Array.isArray(T)&&(C.providerData=T.map(L=>Object.assign({},L))),y&&(C._redirectEventId=y),C}static async _fromIdTokenResponse(e,n,r=!1){const i=new Sp;i.updateFromServerResponse(n);const s=new Yl({uid:n.localId,auth:e,stsTokenManager:i,isAnonymous:r});return await GM(s),s}static async _fromGetAccountInfoResponse(e,n,r){const i=n.users[0];sn(i.localId!==void 0,"internal-error");const s=i.providerUserInfo!==void 0?C8(i.providerUserInfo):[],o=!(i.email&&i.passwordHash)&&!(s!=null&&s.length),a=new Sp;a.updateFromIdToken(r);const l=new Yl({uid:i.localId,auth:e,stsTokenManager:a,isAnonymous:o}),c={uid:i.localId,displayName:i.displayName||null,photoURL:i.photoUrl||null,email:i.email||null,emailVerified:i.emailVerified||!1,phoneNumber:i.phoneNumber||null,tenantId:i.tenantId||null,providerData:s,metadata:new qT(i.createdAt,i.lastLoginAt),isAnonymous:!(i.email&&i.passwordHash)&&!(s!=null&&s.length)};return Object.assign(l,c),l}}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 nB=new Map;function Ql(t){cc(t instanceof Function,"Expected a class definition");let e=nB.get(t);return e?(cc(e instanceof t,"Instance stored in cache mismatched with class"),e):(e=new t,nB.set(t,e),e)}/**
+ * @license
+ * Copyright 2019 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 E8{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,n){this.storage[e]=n}async _get(e){const n=this.storage[e];return n===void 0?null:n}async _remove(e){delete this.storage[e]}_addListener(e,n){}_removeListener(e,n){}}E8.type="NONE";const rB=E8;/**
+ * @license
+ * Copyright 2019 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 j_(t,e,n){return`firebase:${t}:${e}:${n}`}class Cp{constructor(e,n,r){this.persistence=e,this.auth=n,this.userKey=r;const{config:i,name:s}=this.auth;this.fullUserKey=j_(this.userKey,i.apiKey,s),this.fullPersistenceKey=j_("persistence",i.apiKey,s),this.boundEventHandler=n._onStorageEvent.bind(n),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){const e=await this.persistence._get(this.fullUserKey);return e?Yl._fromJSON(this.auth,e):null}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;const n=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=e,n)return this.setCurrentUser(n)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,n,r="authUser"){if(!n.length)return new Cp(Ql(rB),e,r);const i=(await Promise.all(n.map(async c=>{if(await c._isAvailable())return c}))).filter(c=>c);let s=i[0]||Ql(rB);const o=j_(r,e.config.apiKey,e.name);let a=null;for(const c of n)try{const u=await c._get(o);if(u){const f=Yl._fromJSON(e,u);c!==s&&(a=f),s=c;break}}catch{}const l=i.filter(c=>c._shouldAllowMigration);return!s._shouldAllowMigration||!l.length?new Cp(s,e,r):(s=l[0],a&&await s._set(o,a.toJSON()),await Promise.all(n.map(async c=>{if(c!==s)try{await c._remove(o)}catch{}})),new Cp(s,e,r))}}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 iB(t){const e=t.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(I8(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(A8(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(R8(e))return"Blackberry";if(P8(e))return"Webos";if(Q4(e))return"Safari";if((e.includes("chrome/")||T8(e))&&!e.includes("edge/"))return"Chrome";if(L8(e))return"Android";{const n=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,r=t.match(n);if((r==null?void 0:r.length)===2)return r[1]}return"Other"}function A8(t=Ki()){return/firefox\//i.test(t)}function Q4(t=Ki()){const e=t.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function T8(t=Ki()){return/crios\//i.test(t)}function I8(t=Ki()){return/iemobile/i.test(t)}function L8(t=Ki()){return/android/i.test(t)}function R8(t=Ki()){return/blackberry/i.test(t)}function P8(t=Ki()){return/webos/i.test(t)}function d2(t=Ki()){return/iphone|ipad|ipod/i.test(t)||/macintosh/i.test(t)&&/mobile/i.test(t)}function kue(t=Ki()){var e;return d2(t)&&!!(!((e=window.navigator)===null||e===void 0)&&e.standalone)}function Bue(){return Zle()&&document.documentMode===10}function D8(t=Ki()){return d2(t)||L8(t)||P8(t)||R8(t)||/windows phone/i.test(t)||I8(t)}function Oue(){try{return!!(window&&window!==window.top)}catch{return!1}}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 N8(t,e=[]){let n;switch(t){case"Browser":n=iB(Ki());break;case"Worker":n=`${iB(Ki())}-${t}`;break;default:n=t}const r=e.length?e.join(","):"FirebaseCore-web";return`${n}/JsCore/${Bd}/${r}`}/**
+ * @license
+ * Copyright 2022 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Uue{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,n){const r=s=>new Promise((o,a)=>{try{const l=e(s);o(l)}catch(l){a(l)}});r.onAbort=n,this.queue.push(r);const i=this.queue.length-1;return()=>{this.queue[i]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;const n=[];try{for(const r of this.queue)await r(e),r.onAbort&&n.push(r.onAbort)}catch(r){n.reverse();for(const i of n)try{i()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:r==null?void 0:r.message})}}}/**
+ * @license
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Fue(t,e={}){return Fu(t,"GET","/v2/passwordPolicy",Uu(t,e))}/**
+ * @license
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 jue=6;class zue{constructor(e){var n,r,i,s;const o=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=(n=o.minPasswordLength)!==null&&n!==void 0?n:jue,o.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=o.maxPasswordLength),o.containsLowercaseCharacter!==void 0&&(this.customStrengthOptions.containsLowercaseLetter=o.containsLowercaseCharacter),o.containsUppercaseCharacter!==void 0&&(this.customStrengthOptions.containsUppercaseLetter=o.containsUppercaseCharacter),o.containsNumericCharacter!==void 0&&(this.customStrengthOptions.containsNumericCharacter=o.containsNumericCharacter),o.containsNonAlphanumericCharacter!==void 0&&(this.customStrengthOptions.containsNonAlphanumericCharacter=o.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,this.enforcementState==="ENFORCEMENT_STATE_UNSPECIFIED"&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=(i=(r=e.allowedNonAlphanumericCharacters)===null||r===void 0?void 0:r.join(""))!==null&&i!==void 0?i:"",this.forceUpgradeOnSignin=(s=e.forceUpgradeOnSignin)!==null&&s!==void 0?s:!1,this.schemaVersion=e.schemaVersion}validatePassword(e){var n,r,i,s,o,a;const l={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,l),this.validatePasswordCharacterOptions(e,l),l.isValid&&(l.isValid=(n=l.meetsMinPasswordLength)!==null&&n!==void 0?n:!0),l.isValid&&(l.isValid=(r=l.meetsMaxPasswordLength)!==null&&r!==void 0?r:!0),l.isValid&&(l.isValid=(i=l.containsLowercaseLetter)!==null&&i!==void 0?i:!0),l.isValid&&(l.isValid=(s=l.containsUppercaseLetter)!==null&&s!==void 0?s:!0),l.isValid&&(l.isValid=(o=l.containsNumericCharacter)!==null&&o!==void 0?o:!0),l.isValid&&(l.isValid=(a=l.containsNonAlphanumericCharacter)!==null&&a!==void 0?a:!0),l}validatePasswordLengthOptions(e,n){const r=this.customStrengthOptions.minPasswordLength,i=this.customStrengthOptions.maxPasswordLength;r&&(n.meetsMinPasswordLength=e.length>=r),i&&(n.meetsMaxPasswordLength=e.length<=i)}validatePasswordCharacterOptions(e,n){this.updatePasswordCharacterOptionsStatuses(n,!1,!1,!1,!1);let r;for(let i=0;i="a"&&r<="z",r>="A"&&r<="Z",r>="0"&&r<="9",this.allowedNonAlphanumericCharacters.includes(r))}updatePasswordCharacterOptionsStatuses(e,n,r,i,s){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=n)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=r)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=i)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=s))}}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Hue{constructor(e,n,r,i){this.app=e,this.heartbeatServiceProvider=n,this.appCheckServiceProvider=r,this.config=i,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new sB(this),this.idTokenSubscription=new sB(this),this.beforeStateQueue=new Uue(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=_8,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=i.sdkClientVersion}_initializeWithPersistence(e,n){return n&&(this._popupRedirectResolver=Ql(n)),this._initializationPromise=this.queue(async()=>{var r,i;if(!this._deleted&&(this.persistenceManager=await Cp.create(this,e),!this._deleted)){if(!((r=this._popupRedirectResolver)===null||r===void 0)&&r._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(n),this.lastNotifiedUid=((i=this.currentUser)===null||i===void 0?void 0:i.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 n=await S8(this,{idToken:e}),r=await Yl._fromGetAccountInfoResponse(this,n,e);await this.directlySetCurrentUser(r)}catch(n){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",n),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){var n;if(La(this.app)){const o=this.app.settings.authIdToken;return o?new Promise(a=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(o).then(a,a))}):this.directlySetCurrentUser(null)}const r=await this.assertedPersistence.getCurrentUser();let i=r,s=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const o=(n=this.redirectUser)===null||n===void 0?void 0:n._redirectEventId,a=i==null?void 0:i._redirectEventId,l=await this.tryRedirectSignIn(e);(!o||o===a)&&(l!=null&&l.user)&&(i=l.user,s=!0)}if(!i)return this.directlySetCurrentUser(null);if(!i._redirectEventId){if(s)try{await this.beforeStateQueue.runMiddleware(i)}catch(o){i=r,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(o))}return i?this.reloadAndSetCurrentUserOrClear(i):this.directlySetCurrentUser(null)}return sn(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===i._redirectEventId?this.directlySetCurrentUser(i):this.reloadAndSetCurrentUserOrClear(i)}async tryRedirectSignIn(e){let n=null;try{n=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch{await this._setRedirectUser(null)}return n}async reloadAndSetCurrentUserOrClear(e){try{await GM(e)}catch(n){if((n==null?void 0:n.code)!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=_ue()}async _delete(){this._deleted=!0}async updateCurrentUser(e){if(La(this.app))return Promise.reject(ql(this));const n=e?mr(e):null;return n&&sn(n.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(n&&n._clone(this))}async _updateCurrentUser(e,n=!1){if(!this._deleted)return e&&sn(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),n||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return La(this.app)?Promise.reject(ql(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return La(this.app)?Promise.reject(ql(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(Ql(e))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const n=this._getPasswordPolicyInternal();return n.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):n.validatePassword(e)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const e=await Fue(this),n=new zue(e);this.tenantId===null?this._projectPasswordPolicy=n:this._tenantPasswordPolicies[this.tenantId]=n}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(e){this._errorFactory=new fv("auth","Firebase",e())}onAuthStateChanged(e,n,r){return this.registerStateListener(this.authStateSubscription,e,n,r)}beforeAuthStateChanged(e,n){return this.beforeStateQueue.pushCallback(e,n)}onIdTokenChanged(e,n,r){return this.registerStateListener(this.idTokenSubscription,e,n,r)}authStateReady(){return new Promise((e,n)=>{if(this.currentUser)e();else{const r=this.onAuthStateChanged(()=>{r(),e()},n)}})}async revokeAccessToken(e){if(this.currentUser){const n=await this.currentUser.getIdToken(),r={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:n};this.tenantId!=null&&(r.tenantId=this.tenantId),await Nue(this,r)}}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,n){const r=await this.getOrInitRedirectPersistenceManager(n);return e===null?r.removeCurrentUser():r.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const n=e&&Ql(e)||this._popupRedirectResolver;sn(n,this,"argument-error"),this.redirectPersistenceManager=await Cp.create(this,[Ql(n._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var n,r;return this._isInitialized&&await this.queue(async()=>{}),((n=this._currentUser)===null||n===void 0?void 0:n._redirectEventId)===e?this._currentUser:((r=this.redirectUser)===null||r===void 0?void 0:r._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,n;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const r=(n=(e=this.currentUser)===null||e===void 0?void 0:e.uid)!==null&&n!==void 0?n:null;this.lastNotifiedUid!==r&&(this.lastNotifiedUid=r,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,n,r,i){if(this._deleted)return()=>{};const s=typeof n=="function"?n:n.next.bind(n);let o=!1;const a=this._isInitialized?Promise.resolve():this._initializationPromise;if(sn(a,this,"internal-error"),a.then(()=>{o||s(this.currentUser)}),typeof n=="function"){const l=e.addObserver(n,r,i);return()=>{o=!0,l()}}else{const l=e.addObserver(n);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 sn(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=N8(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var e;const n={"X-Client-Version":this.clientVersion};this.app.options.appId&&(n["X-Firebase-gmpid"]=this.app.options.appId);const r=await((e=this.heartbeatServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getHeartbeatsHeader());r&&(n["X-Firebase-Client"]=r);const i=await this._getAppCheckToken();return i&&(n["X-Firebase-AppCheck"]=i),n}async _getAppCheckToken(){var e;const n=await((e=this.appCheckServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getToken());return n!=null&&n.error&&gue(`Error while retrieving App Check token: ${n.error}`),n==null?void 0:n.token}}function ju(t){return mr(t)}class sB{constructor(e){this.auth=e,this.observer=null,this.addObserver=oce(n=>this.observer=n)}get next(){return sn(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 h2={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function Gue(t){h2=t}function k8(t){return h2.loadJS(t)}function Vue(){return h2.recaptchaEnterpriseScript}function Wue(){return h2.gapiScript}function $ue(t){return`__${t}${Math.floor(Math.random()*1e6)}`}const Jue="recaptcha-enterprise",Yue="NO_RECAPTCHA";class Que{constructor(e){this.type=Jue,this.auth=ju(e)}async verify(e="verify",n=!1){async function r(s){if(!n){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)=>{Eue(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 Cue(l);return s.tenantId==null?s._agentRecaptchaConfig=c:s._tenantRecaptchaConfigs[s.tenantId]=c,o(c.siteKey)}}).catch(l=>{a(l)})})}function i(s,o,a){const l=window.grecaptcha;eB(l)?l.enterprise.ready(()=>{l.enterprise.execute(s,{action:e}).then(c=>{o(c)}).catch(()=>{o(Yue)})}):a(Error("No reCAPTCHA enterprise script loaded."))}return new Promise((s,o)=>{r(this.auth).then(a=>{if(!n&&eB(window.grecaptcha))i(a,s,o);else{if(typeof window>"u"){o(new Error("RecaptchaVerifier is only supported in browser"));return}let l=Vue();l.length!==0&&(l+=a),k8(l).then(()=>{i(a,s,o)}).catch(c=>{o(c)})}}).catch(a=>{o(a)})})}}async function oB(t,e,n,r=!1){const i=new Que(t);let s;try{s=await i.verify(n)}catch{s=await i.verify(n,!0)}const o=Object.assign({},e);return r?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 eI(t,e,n,r){var i;if(!((i=t._getRecaptchaConfig())===null||i===void 0)&&i.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")){const s=await oB(t,e,n,n==="getOobCode");return r(t,s)}else return r(t,e).catch(async s=>{if(s.code==="auth/missing-recaptcha-token"){console.log(`${n} is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow.`);const o=await oB(t,e,n,n==="getOobCode");return r(t,o)}else return Promise.reject(s)})}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Xue(t,e){const n=f2(t,"auth");if(n.isInitialized()){const i=n.getImmediate(),s=n.getOptions();if(Qp(s,e??{}))return i;oa(i,"already-initialized")}return n.initialize({options:e})}function Kue(t,e){const n=(e==null?void 0:e.persistence)||[],r=(Array.isArray(n)?n:[n]).map(Ql);e!=null&&e.errorMap&&t._updateErrorMap(e.errorMap),t._initializeWithPersistence(r,e==null?void 0:e.popupRedirectResolver)}function Zue(t,e,n){const r=ju(t);sn(r._canInitEmulator,r,"emulator-config-failed"),sn(/^https?:\/\//.test(e),r,"invalid-emulator-scheme");const i=!1,s=B8(e),{host:o,port:a}=que(e),l=a===null?"":`:${a}`;r.config.emulator={url:`${s}//${o}${l}/`},r.settings.appVerificationDisabledForTesting=!0,r.emulatorConfig=Object.freeze({host:o,port:a,protocol:s.replace(":",""),options:Object.freeze({disableWarnings:i})}),efe()}function B8(t){const e=t.indexOf(":");return e<0?"":t.substr(0,e+1)}function que(t){const e=B8(t),n=/(\/\/)?([^?#/]+)/.exec(t.substr(e.length));if(!n)return{host:"",port:null};const r=n[2].split("@").pop()||"",i=/^(\[[^\]]+\])(:|$)/.exec(r);if(i){const s=i[1];return{host:s,port:aB(r.substr(s.length+1))}}else{const[s,o]=r.split(":");return{host:s,port:aB(o)}}}function aB(t){if(!t)return null;const e=Number(t);return isNaN(e)?null:e}function efe(){function t(){const e=document.createElement("p"),n=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",n.position="fixed",n.width="100%",n.backgroundColor="#ffffff",n.border=".1em solid #000000",n.color="#b50000",n.bottom="0px",n.left="0px",n.margin="0px",n.zIndex="10000",n.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",t):t())}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 X4{constructor(e,n){this.providerId=e,this.signInMethod=n}toJSON(){return Jl("not implemented")}_getIdTokenResponse(e){return Jl("not implemented")}_linkToIdToken(e,n){return Jl("not implemented")}_getReauthenticationResolver(e){return Jl("not implemented")}}async function tfe(t,e){return Fu(t,"POST","/v1/accounts:signUp",e)}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 nfe(t,e){return pv(t,"POST","/v1/accounts:signInWithPassword",Uu(t,e))}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 rfe(t,e){return pv(t,"POST","/v1/accounts:signInWithEmailLink",Uu(t,e))}async function ife(t,e){return pv(t,"POST","/v1/accounts:signInWithEmailLink",Uu(t,e))}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 _1 extends X4{constructor(e,n,r,i=null){super("password",r),this._email=e,this._password=n,this._tenantId=i}static _fromEmailAndPassword(e,n){return new _1(e,n,"password")}static _fromEmailAndCode(e,n,r=null){return new _1(e,n,"emailLink",r)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){const n=typeof e=="string"?JSON.parse(e):e;if(n!=null&&n.email&&(n!=null&&n.password)){if(n.signInMethod==="password")return this._fromEmailAndPassword(n.email,n.password);if(n.signInMethod==="emailLink")return this._fromEmailAndCode(n.email,n.password,n.tenantId)}return null}async _getIdTokenResponse(e){switch(this.signInMethod){case"password":const n={returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return eI(e,n,"signInWithPassword",nfe);case"emailLink":return rfe(e,{email:this._email,oobCode:this._password});default:oa(e,"internal-error")}}async _linkToIdToken(e,n){switch(this.signInMethod){case"password":const r={idToken:n,returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return eI(e,r,"signUpPassword",tfe);case"emailLink":return ife(e,{idToken:n,email:this._email,oobCode:this._password});default:oa(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Ep(t,e){return pv(t,"POST","/v1/accounts:signInWithIdp",Uu(t,e))}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 sfe="http://localhost";class _d extends X4{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const n=new _d(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(n.idToken=e.idToken),e.accessToken&&(n.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(n.nonce=e.nonce),e.pendingToken&&(n.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(n.accessToken=e.oauthToken,n.secret=e.oauthTokenSecret):oa("argument-error"),n}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){const n=typeof e=="string"?JSON.parse(e):e,{providerId:r,signInMethod:i}=n,s=V4(n,["providerId","signInMethod"]);if(!r||!i)return null;const o=new _d(r,i);return o.idToken=s.idToken||void 0,o.accessToken=s.accessToken||void 0,o.secret=s.secret,o.nonce=s.nonce,o.pendingToken=s.pendingToken||null,o}_getIdTokenResponse(e){const n=this.buildRequest();return Ep(e,n)}_linkToIdToken(e,n){const r=this.buildRequest();return r.idToken=n,Ep(e,r)}_getReauthenticationResolver(e){const n=this.buildRequest();return n.autoCreate=!1,Ep(e,n)}buildRequest(){const e={requestUri:sfe,returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const n={};this.idToken&&(n.id_token=this.idToken),this.accessToken&&(n.access_token=this.accessToken),this.secret&&(n.oauth_token_secret=this.secret),n.providerId=this.providerId,this.nonce&&!this.pendingToken&&(n.nonce=this.nonce),e.postBody=dv(n)}return e}}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 ofe(t){switch(t){case"recoverEmail":return"RECOVER_EMAIL";case"resetPassword":return"PASSWORD_RESET";case"signIn":return"EMAIL_SIGNIN";case"verifyEmail":return"VERIFY_EMAIL";case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL";case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION";default:return null}}function afe(t){const e=cg(ug(t)).link,n=e?cg(ug(e)).deep_link_id:null,r=cg(ug(t)).deep_link_id;return(r?cg(ug(r)).link:null)||r||n||e||t}class K4{constructor(e){var n,r,i,s,o,a;const l=cg(ug(e)),c=(n=l.apiKey)!==null&&n!==void 0?n:null,u=(r=l.oobCode)!==null&&r!==void 0?r:null,f=ofe((i=l.mode)!==null&&i!==void 0?i:null);sn(c&&u&&f,"argument-error"),this.apiKey=c,this.operation=f,this.code=u,this.continueUrl=(s=l.continueUrl)!==null&&s!==void 0?s:null,this.languageCode=(o=l.languageCode)!==null&&o!==void 0?o:null,this.tenantId=(a=l.tenantId)!==null&&a!==void 0?a:null}static parseLink(e){const n=afe(e);try{return new K4(n)}catch{return null}}}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Lm{constructor(){this.providerId=Lm.PROVIDER_ID}static credential(e,n){return _1._fromEmailAndPassword(e,n)}static credentialWithLink(e,n){const r=K4.parseLink(n);return sn(r,"argument-error"),_1._fromEmailAndCode(e,r.code,r.tenantId)}}Lm.PROVIDER_ID="password";Lm.EMAIL_PASSWORD_SIGN_IN_METHOD="password";Lm.EMAIL_LINK_SIGN_IN_METHOD="emailLink";/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Z4{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
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 mv extends Z4{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
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Qc extends mv{constructor(){super("facebook.com")}static credential(e){return _d._fromParams({providerId:Qc.PROVIDER_ID,signInMethod:Qc.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return Qc.credentialFromTaggedObject(e)}static credentialFromError(e){return Qc.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return Qc.credential(e.oauthAccessToken)}catch{return null}}}Qc.FACEBOOK_SIGN_IN_METHOD="facebook.com";Qc.PROVIDER_ID="facebook.com";/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Hl extends mv{constructor(){super("google.com"),this.addScope("profile")}static credential(e,n){return _d._fromParams({providerId:Hl.PROVIDER_ID,signInMethod:Hl.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:n})}static credentialFromResult(e){return Hl.credentialFromTaggedObject(e)}static credentialFromError(e){return Hl.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:n,oauthAccessToken:r}=e;if(!n&&!r)return null;try{return Hl.credential(n,r)}catch{return null}}}Hl.GOOGLE_SIGN_IN_METHOD="google.com";Hl.PROVIDER_ID="google.com";/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Xc extends mv{constructor(){super("github.com")}static credential(e){return _d._fromParams({providerId:Xc.PROVIDER_ID,signInMethod:Xc.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return Xc.credentialFromTaggedObject(e)}static credentialFromError(e){return Xc.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return Xc.credential(e.oauthAccessToken)}catch{return null}}}Xc.GITHUB_SIGN_IN_METHOD="github.com";Xc.PROVIDER_ID="github.com";/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Kc extends mv{constructor(){super("twitter.com")}static credential(e,n){return _d._fromParams({providerId:Kc.PROVIDER_ID,signInMethod:Kc.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:n})}static credentialFromResult(e){return Kc.credentialFromTaggedObject(e)}static credentialFromError(e){return Kc.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthAccessToken:n,oauthTokenSecret:r}=e;if(!n||!r)return null;try{return Kc.credential(n,r)}catch{return null}}}Kc.TWITTER_SIGN_IN_METHOD="twitter.com";Kc.PROVIDER_ID="twitter.com";/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 lfe(t,e){return pv(t,"POST","/v1/accounts:signUp",Uu(t,e))}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Md{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,n,r,i=!1){const s=await Yl._fromIdTokenResponse(e,r,i),o=lB(r);return new Md({user:s,providerId:o,_tokenResponse:r,operationType:n})}static async _forOperation(e,n,r){await e._updateTokensIfNecessary(r,!0);const i=lB(r);return new Md({user:e,providerId:i,_tokenResponse:r,operationType:n})}}function lB(t){return t.providerId?t.providerId:"phoneNumber"in t?"phone":null}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 VM extends Ml{constructor(e,n,r,i){var s;super(n.code,n.message),this.operationType=r,this.user=i,Object.setPrototypeOf(this,VM.prototype),this.customData={appName:e.name,tenantId:(s=e.tenantId)!==null&&s!==void 0?s:void 0,_serverResponse:n.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(e,n,r,i){return new VM(e,n,r,i)}}function O8(t,e,n,r){return(e==="reauthenticate"?n._getReauthenticationResolver(t):n._getIdTokenResponse(t)).catch(s=>{throw s.code==="auth/multi-factor-auth-required"?VM._fromErrorAndOperation(t,s,e,r):s})}async function cfe(t,e,n=!1){const r=await w1(t,e._linkToIdToken(t.auth,await t.getIdToken()),n);return Md._forOperation(t,"link",r)}/**
+ * @license
+ * Copyright 2019 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 ufe(t,e,n=!1){const{auth:r}=t;if(La(r.app))return Promise.reject(ql(r));const i="reauthenticate";try{const s=await w1(t,O8(r,i,e,t),n);sn(s.idToken,r,"internal-error");const o=Y4(s.idToken);sn(o,r,"internal-error");const{sub:a}=o;return sn(t.uid===a,r,"user-mismatch"),Md._forOperation(t,i,s)}catch(s){throw(s==null?void 0:s.code)==="auth/user-not-found"&&oa(r,"user-mismatch"),s}}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 U8(t,e,n=!1){if(La(t.app))return Promise.reject(ql(t));const r="signIn",i=await O8(t,r,e),s=await Md._fromIdTokenResponse(t,r,i);return n||await t._updateCurrentUser(s.user),s}async function ffe(t,e){return U8(ju(t),e)}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 F8(t){const e=ju(t);e._getPasswordPolicyInternal()&&await e._updatePasswordPolicy()}async function dfe(t,e,n){if(La(t.app))return Promise.reject(ql(t));const r=ju(t),o=await eI(r,{returnSecureToken:!0,email:e,password:n,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",lfe).catch(l=>{throw l.code==="auth/password-does-not-meet-requirements"&&F8(t),l}),a=await Md._fromIdTokenResponse(r,"signIn",o);return await r._updateCurrentUser(a.user),a}function hfe(t,e,n){return La(t.app)?Promise.reject(ql(t)):ffe(mr(t),Lm.credential(e,n)).catch(async r=>{throw r.code==="auth/password-does-not-meet-requirements"&&F8(t),r})}function pfe(t,e,n,r){return mr(t).onIdTokenChanged(e,n,r)}function mfe(t,e,n){return mr(t).beforeAuthStateChanged(e,n)}function gfe(t,e,n,r){return mr(t).onAuthStateChanged(e,n,r)}function vfe(t){return mr(t).signOut()}const WM="__sak";/**
+ * @license
+ * Copyright 2019 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 j8{constructor(e,n){this.storageRetriever=e,this.type=n}_isAvailable(){try{return this.storage?(this.storage.setItem(WM,"1"),this.storage.removeItem(WM),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(e,n){return this.storage.setItem(e,JSON.stringify(n)),Promise.resolve()}_get(e){const n=this.storage.getItem(e);return Promise.resolve(n?JSON.parse(n):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 yfe(){const t=Ki();return Q4(t)||d2(t)}const wfe=1e3,_fe=10;class z8 extends j8{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,n)=>this.onStorageEvent(e,n),this.listeners={},this.localCache={},this.pollTimer=null,this.safariLocalStorageNotSynced=yfe()&&Oue(),this.fallbackToPolling=D8(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const n of Object.keys(this.listeners)){const r=this.storage.getItem(n),i=this.localCache[n];r!==i&&e(n,i,r)}}onStorageEvent(e,n=!1){if(!e.key){this.forAllChangedKeys((o,a,l)=>{this.notifyListeners(o,l)});return}const r=e.key;if(n?this.detachListener():this.stopPolling(),this.safariLocalStorageNotSynced){const o=this.storage.getItem(r);if(e.newValue!==o)e.newValue!==null?this.storage.setItem(r,e.newValue):this.storage.removeItem(r);else if(this.localCache[r]===e.newValue&&!n)return}const i=()=>{const o=this.storage.getItem(r);!n&&this.localCache[r]===o||this.notifyListeners(r,o)},s=this.storage.getItem(r);Bue()&&s!==e.newValue&&e.newValue!==e.oldValue?setTimeout(i,_fe):i()}notifyListeners(e,n){this.localCache[e]=n;const r=this.listeners[e];if(r)for(const i of Array.from(r))i(n&&JSON.parse(n))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,n,r)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:n,newValue:r}),!0)})},wfe)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,n){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(n)}_removeListener(e,n){this.listeners[e]&&(this.listeners[e].delete(n),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(e,n){await super._set(e,n),this.localCache[e]=JSON.stringify(n)}async _get(e){const n=await super._get(e);return this.localCache[e]=JSON.stringify(n),n}async _remove(e){await super._remove(e),delete this.localCache[e]}}z8.type="LOCAL";const Mfe=z8;/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 H8 extends j8{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,n){}_removeListener(e,n){}}H8.type="SESSION";const G8=H8;/**
+ * @license
+ * Copyright 2019 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 xfe(t){return Promise.all(t.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(n){return{fulfilled:!1,reason:n}}}))}/**
+ * @license
+ * Copyright 2019 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 p2{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const n=this.receivers.find(i=>i.isListeningto(e));if(n)return n;const r=new p2(e);return this.receivers.push(r),r}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const n=e,{eventId:r,eventType:i,data:s}=n.data,o=this.handlersMap[i];if(!(o!=null&&o.size))return;n.ports[0].postMessage({status:"ack",eventId:r,eventType:i});const a=Array.from(o).map(async c=>c(n.origin,s)),l=await xfe(a);n.ports[0].postMessage({status:"done",eventId:r,eventType:i,response:l})}_subscribe(e,n){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(n)}_unsubscribe(e,n){this.handlersMap[e]&&n&&this.handlersMap[e].delete(n),(!n||this.handlersMap[e].size===0)&&delete this.handlersMap[e],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}p2.receivers=[];/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 q4(t="",e=10){let n="";for(let r=0;r{const c=q4("",20);i.port1.start();const u=setTimeout(()=>{l(new Error("unsupported_event"))},r);o={messageChannel:i,onMessage(f){const h=f;if(h.data.eventId===c)switch(h.data.status){case"ack":clearTimeout(u),s=setTimeout(()=>{l(new Error("timeout"))},3e3);break;case"done":clearTimeout(s),a(h.data.response);break;default:clearTimeout(u),clearTimeout(s),l(new Error("invalid_response"));break}}},this.handlers.add(o),i.port1.addEventListener("message",o.onMessage),this.target.postMessage({eventType:e,eventId:c,data:n},[i.port2])}).finally(()=>{o&&this.removeMessageHandler(o)})}}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 ol(){return window}function Sfe(t){ol().location.href=t}/**
+ * @license
+ * Copyright 2020 Google LLC.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 V8(){return typeof ol().WorkerGlobalScope<"u"&&typeof ol().importScripts=="function"}async function Cfe(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function Efe(){var t;return((t=navigator==null?void 0:navigator.serviceWorker)===null||t===void 0?void 0:t.controller)||null}function Afe(){return V8()?self:null}/**
+ * @license
+ * Copyright 2019 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 W8="firebaseLocalStorageDb",Tfe=1,$M="firebaseLocalStorage",$8="fbase_key";class gv{constructor(e){this.request=e}toPromise(){return new Promise((e,n)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{n(this.request.error)})})}}function m2(t,e){return t.transaction([$M],e?"readwrite":"readonly").objectStore($M)}function Ife(){const t=indexedDB.deleteDatabase(W8);return new gv(t).toPromise()}function tI(){const t=indexedDB.open(W8,Tfe);return new Promise((e,n)=>{t.addEventListener("error",()=>{n(t.error)}),t.addEventListener("upgradeneeded",()=>{const r=t.result;try{r.createObjectStore($M,{keyPath:$8})}catch(i){n(i)}}),t.addEventListener("success",async()=>{const r=t.result;r.objectStoreNames.contains($M)?e(r):(r.close(),await Ife(),e(await tI()))})})}async function cB(t,e,n){const r=m2(t,!0).put({[$8]:e,value:n});return new gv(r).toPromise()}async function Lfe(t,e){const n=m2(t,!1).get(e),r=await new gv(n).toPromise();return r===void 0?null:r.value}function uB(t,e){const n=m2(t,!0).delete(e);return new gv(n).toPromise()}const Rfe=800,Pfe=3;class J8{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 tI(),this.db)}async _withRetries(e){let n=0;for(;;)try{const r=await this._openDb();return await e(r)}catch(r){if(n++>Pfe)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return V8()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=p2._getInstance(Afe()),this.receiver._subscribe("keyChanged",async(e,n)=>({keyProcessed:(await this._poll()).includes(n.key)})),this.receiver._subscribe("ping",async(e,n)=>["keyChanged"])}async initializeSender(){var e,n;if(this.activeServiceWorker=await Cfe(),!this.activeServiceWorker)return;this.sender=new bfe(this.activeServiceWorker);const r=await this.sender._send("ping",{},800);r&&!((e=r[0])===null||e===void 0)&&e.fulfilled&&!((n=r[0])===null||n===void 0)&&n.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(!(!this.sender||!this.activeServiceWorker||Efe()!==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 tI();return await cB(e,WM,"1"),await uB(e,WM),!0}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,n){return this._withPendingWrite(async()=>(await this._withRetries(r=>cB(r,e,n)),this.localCache[e]=n,this.notifyServiceWorker(e)))}async _get(e){const n=await this._withRetries(r=>Lfe(r,e));return this.localCache[e]=n,n}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(n=>uB(n,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){const e=await this._withRetries(i=>{const s=m2(i,!1).getAll();return new gv(s).toPromise()});if(!e)return[];if(this.pendingWrites!==0)return[];const n=[],r=new Set;if(e.length!==0)for(const{fbase_key:i,value:s}of e)r.add(i),JSON.stringify(this.localCache[i])!==JSON.stringify(s)&&(this.notifyListeners(i,s),n.push(i));for(const i of Object.keys(this.localCache))this.localCache[i]&&!r.has(i)&&(this.notifyListeners(i,null),n.push(i));return n}notifyListeners(e,n){this.localCache[e]=n;const r=this.listeners[e];if(r)for(const i of Array.from(r))i(n)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),Rfe)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,n){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(n)}_removeListener(e,n){this.listeners[e]&&(this.listeners[e].delete(n),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&this.stopPolling()}}J8.type="LOCAL";const Dfe=J8;new hv(3e4,6e4);/**
+ * @license
+ * Copyright 2021 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Y8(t,e){return e?Ql(e):(sn(t._popupRedirectResolver,t,"argument-error"),t._popupRedirectResolver)}/**
+ * @license
+ * Copyright 2019 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 e3 extends X4{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return Ep(e,this._buildIdpRequest())}_linkToIdToken(e,n){return Ep(e,this._buildIdpRequest(n))}_getReauthenticationResolver(e){return Ep(e,this._buildIdpRequest())}_buildIdpRequest(e){const n={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&&(n.idToken=e),n}}function Nfe(t){return U8(t.auth,new e3(t),t.bypassAuthState)}function kfe(t){const{auth:e,user:n}=t;return sn(n,e,"internal-error"),ufe(n,new e3(t),t.bypassAuthState)}async function Bfe(t){const{auth:e,user:n}=t;return sn(n,e,"internal-error"),cfe(n,new e3(t),t.bypassAuthState)}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Q8{constructor(e,n,r,i,s=!1){this.auth=e,this.resolver=r,this.user=i,this.bypassAuthState=s,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(n)?n:[n]}execute(){return new Promise(async(e,n)=>{this.pendingPromise={resolve:e,reject:n};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(r){this.reject(r)}})}async onAuthEvent(e){const{urlResponse:n,sessionId:r,postBody:i,tenantId:s,error:o,type:a}=e;if(o){this.reject(o);return}const l={auth:this.auth,requestUri:n,sessionId:r,tenantId:s||void 0,postBody:i||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 Nfe;case"linkViaPopup":case"linkViaRedirect":return Bfe;case"reauthViaPopup":case"reauthViaRedirect":return kfe;default:oa(this.auth,"internal-error")}}resolve(e){cc(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){cc(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
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Ofe=new hv(2e3,1e4);async function Ufe(t,e,n){if(La(t.app))return Promise.reject(Da(t,"operation-not-supported-in-this-environment"));const r=ju(t);vue(t,e,Z4);const i=Y8(r,n);return new Vf(r,"signInViaPopup",e,i).executeNotNull()}class Vf extends Q8{constructor(e,n,r,i,s){super(e,n,i,s),this.provider=r,this.authWindow=null,this.pollId=null,Vf.currentPopupAction&&Vf.currentPopupAction.cancel(),Vf.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return sn(e,this.auth,"internal-error"),e}async onExecution(){cc(this.filter.length===1,"Popup operations only handle one event");const e=q4();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(n=>{this.reject(n)}),this.resolver._isIframeWebStorageSupported(this.auth,n=>{n||this.reject(Da(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(Da(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,Vf.currentPopupAction=null}pollUserCancellation(){const e=()=>{var n,r;if(!((r=(n=this.authWindow)===null||n===void 0?void 0:n.window)===null||r===void 0)&&r.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(Da(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(e,Ofe.get())};e()}}Vf.currentPopupAction=null;/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Ffe="pendingRedirect",z_=new Map;class jfe extends Q8{constructor(e,n,r=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],n,void 0,r),this.eventId=null}async execute(){let e=z_.get(this.auth._key());if(!e){try{const r=await zfe(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(r)}catch(n){e=()=>Promise.reject(n)}z_.set(this.auth._key(),e)}return this.bypassAuthState||z_.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 n=await this.auth._redirectUserForId(e.eventId);if(n)return this.user=n,super.onAuthEvent(e);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function zfe(t,e){const n=Vfe(e),r=Gfe(t);if(!await r._isAvailable())return!1;const i=await r._get(n)==="true";return await r._remove(n),i}function Hfe(t,e){z_.set(t._key(),e)}function Gfe(t){return Ql(t._redirectPersistence)}function Vfe(t){return j_(Ffe,t.config.apiKey,t.name)}async function Wfe(t,e,n=!1){if(La(t.app))return Promise.reject(ql(t));const r=ju(t),i=Y8(r,e),o=await new jfe(r,i,n).execute();return o&&!n&&(delete o.user._redirectEventId,await r._persistUserIfCurrent(o.user),await r._setRedirectUser(null,e)),o}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 $fe=10*60*1e3;class Jfe{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 n=!1;return this.consumers.forEach(r=>{this.isEventForConsumer(e,r)&&(n=!0,this.sendToConsumer(e,r),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!Yfe(e)||(this.hasHandledPotentialRedirect=!0,n||(this.queuedRedirectEvent=e,n=!0)),n}sendToConsumer(e,n){var r;if(e.error&&!X8(e)){const i=((r=e.error.code)===null||r===void 0?void 0:r.split("auth/")[1])||"internal-error";n.onError(Da(this.auth,i))}else n.onAuthEvent(e)}isEventForConsumer(e,n){const r=n.eventId===null||!!e.eventId&&e.eventId===n.eventId;return n.filter.includes(e.type)&&r}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=$fe&&this.cachedEventUids.clear(),this.cachedEventUids.has(fB(e))}saveEventToCache(e){this.cachedEventUids.add(fB(e)),this.lastProcessedEventTime=Date.now()}}function fB(t){return[t.type,t.eventId,t.sessionId,t.tenantId].filter(e=>e).join("-")}function X8({type:t,error:e}){return t==="unknown"&&(e==null?void 0:e.code)==="auth/no-auth-event"}function Yfe(t){switch(t.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return X8(t);default:return!1}}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Qfe(t,e={}){return Fu(t,"GET","/v1/projects",e)}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Xfe=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,Kfe=/^https?/;async function Zfe(t){if(t.config.emulator)return;const{authorizedDomains:e}=await Qfe(t);for(const n of e)try{if(qfe(n))return}catch{}oa(t,"unauthorized-domain")}function qfe(t){const e=ZT(),{protocol:n,hostname:r}=new URL(e);if(t.startsWith("chrome-extension://")){const o=new URL(t);return o.hostname===""&&r===""?n==="chrome-extension:"&&t.replace("chrome-extension://","")===e.replace("chrome-extension://",""):n==="chrome-extension:"&&o.hostname===r}if(!Kfe.test(n))return!1;if(Xfe.test(t))return r===t;const i=t.replace(/\./g,"\\.");return new RegExp("^(.+\\."+i+"|"+i+")$","i").test(r)}/**
+ * @license
+ * Copyright 2020 Google LLC.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 ede=new hv(3e4,6e4);function dB(){const t=ol().___jsl;if(t!=null&&t.H){for(const e of Object.keys(t.H))if(t.H[e].r=t.H[e].r||[],t.H[e].L=t.H[e].L||[],t.H[e].r=[...t.H[e].L],t.CP)for(let n=0;n{var r,i,s;function o(){dB(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{dB(),n(Da(t,"network-request-failed"))},timeout:ede.get()})}if(!((i=(r=ol().gapi)===null||r===void 0?void 0:r.iframes)===null||i===void 0)&&i.Iframe)e(gapi.iframes.getContext());else if(!((s=ol().gapi)===null||s===void 0)&&s.load)o();else{const a=$ue("iframefcb");return ol()[a]=()=>{gapi.load?o():n(Da(t,"network-request-failed"))},k8(`${Wue()}?onload=${a}`).catch(l=>n(l))}}).catch(e=>{throw H_=null,e})}let H_=null;function nde(t){return H_=H_||tde(t),H_}/**
+ * @license
+ * Copyright 2020 Google LLC.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 rde=new hv(5e3,15e3),ide="__/auth/iframe",sde="emulator/auth/iframe",ode={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},ade=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function lde(t){const e=t.config;sn(e.authDomain,t,"auth-domain-config-required");const n=e.emulator?J4(e,sde):`https://${t.config.authDomain}/${ide}`,r={apiKey:e.apiKey,appName:t.name,v:Bd},i=ade.get(t.config.apiHost);i&&(r.eid=i);const s=t._getFrameworks();return s.length&&(r.fw=s.join(",")),`${n}?${dv(r).slice(1)}`}async function cde(t){const e=await nde(t),n=ol().gapi;return sn(n,t,"internal-error"),e.open({where:document.body,url:lde(t),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:ode,dontclear:!0},r=>new Promise(async(i,s)=>{await r.restyle({setHideOnLeave:!1});const o=Da(t,"network-request-failed"),a=ol().setTimeout(()=>{s(o)},rde.get());function l(){ol().clearTimeout(a),i(r)}r.ping(l).then(l,()=>{s(o)})}))}/**
+ * @license
+ * Copyright 2020 Google LLC.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 ude={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},fde=500,dde=600,hde="_blank",pde="http://localhost";class hB{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function mde(t,e,n,r=fde,i=dde){const s=Math.max((window.screen.availHeight-i)/2,0).toString(),o=Math.max((window.screen.availWidth-r)/2,0).toString();let a="";const l=Object.assign(Object.assign({},ude),{width:r.toString(),height:i.toString(),top:s,left:o}),c=Ki().toLowerCase();n&&(a=T8(c)?hde:n),A8(c)&&(e=e||pde,l.scrollbars="yes");const u=Object.entries(l).reduce((h,[m,v])=>`${h}${m}=${v},`,"");if(kue(c)&&a!=="_self")return gde(e||"",a),new hB(null);const f=window.open(e||"",a,u);sn(f,t,"popup-blocked");try{f.focus()}catch{}return new hB(f)}function gde(t,e){const n=document.createElement("a");n.href=t,n.target=e;const r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(r)}/**
+ * @license
+ * Copyright 2021 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 vde="__/auth/handler",yde="emulator/auth/handler",wde=encodeURIComponent("fac");async function pB(t,e,n,r,i,s){sn(t.config.authDomain,t,"auth-domain-config-required"),sn(t.config.apiKey,t,"invalid-api-key");const o={apiKey:t.config.apiKey,appName:t.name,authType:n,redirectUrl:r,v:Bd,eventId:i};if(e instanceof Z4){e.setDefaultLanguage(t.languageCode),o.providerId=e.providerId||"",sce(e.getCustomParameters())||(o.customParameters=JSON.stringify(e.getCustomParameters()));for(const[u,f]of Object.entries({}))o[u]=f}if(e instanceof mv){const u=e.getScopes().filter(f=>f!=="");u.length>0&&(o.scopes=u.join(","))}t.tenantId&&(o.tid=t.tenantId);const a=o;for(const u of Object.keys(a))a[u]===void 0&&delete a[u];const l=await t._getAppCheckToken(),c=l?`#${wde}=${encodeURIComponent(l)}`:"";return`${_de(t)}?${dv(a).slice(1)}${c}`}function _de({config:t}){return t.emulator?J4(t,yde):`https://${t.authDomain}/${vde}`}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 vE="webStorageSupport";class Mde{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=G8,this._completeRedirectFn=Wfe,this._overrideRedirectResult=Hfe}async _openPopup(e,n,r,i){var s;cc((s=this.eventManagers[e._key()])===null||s===void 0?void 0:s.manager,"_initialize() not called before _openPopup()");const o=await pB(e,n,r,ZT(),i);return mde(e,o,q4())}async _openRedirect(e,n,r,i){await this._originValidation(e);const s=await pB(e,n,r,ZT(),i);return Sfe(s),new Promise(()=>{})}_initialize(e){const n=e._key();if(this.eventManagers[n]){const{manager:i,promise:s}=this.eventManagers[n];return i?Promise.resolve(i):(cc(s,"If manager is not set, promise should be"),s)}const r=this.initAndGetManager(e);return this.eventManagers[n]={promise:r},r.catch(()=>{delete this.eventManagers[n]}),r}async initAndGetManager(e){const n=await cde(e),r=new Jfe(e);return n.register("authEvent",i=>(sn(i==null?void 0:i.authEvent,e,"invalid-auth-event"),{status:r.onEvent(i.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:r},this.iframes[e._key()]=n,r}_isIframeWebStorageSupported(e,n){this.iframes[e._key()].send(vE,{type:vE},i=>{var s;const o=(s=i==null?void 0:i[0])===null||s===void 0?void 0:s[vE];o!==void 0&&n(!!o),oa(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const n=e._key();return this.originValidationPromises[n]||(this.originValidationPromises[n]=Zfe(e)),this.originValidationPromises[n]}get _shouldInitProactively(){return D8()||Q4()||d2()}}const xde=Mde;var mB="@firebase/auth",gB="1.7.5";/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 bde{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),((e=this.auth.currentUser)===null||e===void 0?void 0:e.uid)||null}async getToken(e){return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{accessToken:await this.auth.currentUser.getIdToken(e)}:null}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;const n=this.auth.onIdTokenChanged(r=>{e((r==null?void 0:r.stsTokenManager.accessToken)||null)});this.internalListeners.set(e,n),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const n=this.internalListeners.get(e);n&&(this.internalListeners.delete(e),n(),this.updateProactiveRefresh())}assertAuthConfigured(){sn(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Sde(t){switch(t){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}function Cde(t){wd(new _u("auth",(e,{options:n})=>{const r=e.getProvider("app").getImmediate(),i=e.getProvider("heartbeat"),s=e.getProvider("app-check-internal"),{apiKey:o,authDomain:a}=r.options;sn(o&&!o.includes(":"),"invalid-api-key",{appName:r.name});const l={apiKey:o,authDomain:a,clientPlatform:t,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:N8(t)},c=new Hue(r,i,s,l);return Kue(c,n),c},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,n,r)=>{e.getProvider("auth-internal").initialize()})),wd(new _u("auth-internal",e=>{const n=ju(e.getProvider("auth").getImmediate());return(r=>new bde(r))(n)},"PRIVATE").setInstantiationMode("EXPLICIT")),sl(mB,gB,Sde(t)),sl(mB,gB,"esm2017")}/**
+ * @license
+ * Copyright 2021 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Ede=5*60,Ade=d8("authIdTokenMaxAge")||Ede;let vB=null;const Tde=t=>async e=>{const n=e&&await e.getIdTokenResult(),r=n&&(new Date().getTime()-Date.parse(n.issuedAtTime))/1e3;if(r&&r>Ade)return;const i=n==null?void 0:n.token;vB!==i&&(vB=i,await fetch(t,{method:i?"POST":"DELETE",headers:i?{Authorization:`Bearer ${i}`}:{}}))};function Ide(t=G4()){const e=f2(t,"auth");if(e.isInitialized())return e.getImmediate();const n=Xue(t,{popupRedirectResolver:xde,persistence:[Dfe,Mfe,G8]}),r=d8("authTokenSyncURL");if(r&&typeof isSecureContext=="boolean"&&isSecureContext){const s=new URL(r,location.origin);if(location.origin===s.origin){const o=Tde(s.toString());mfe(n,o,()=>o(n.currentUser)),pfe(n,a=>o(a))}}const i=c8("auth");return i&&Zue(n,`http://${i}`),n}function Lde(){var t,e;return(e=(t=document.getElementsByTagName("head"))===null||t===void 0?void 0:t[0])!==null&&e!==void 0?e:document}Gue({loadJS(t){return new Promise((e,n)=>{const r=document.createElement("script");r.setAttribute("src",t),r.onload=e,r.onerror=i=>{const s=Da("internal-error");s.customData=i,n(s)},r.type="text/javascript",r.charset="UTF-8",Lde().appendChild(r)})},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="});Cde("Browser");var yB=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 nd,K8;(function(){var t;/** @license
+
+ Copyright The Closure Library Authors.
+ SPDX-License-Identifier: Apache-2.0
+*/function e(E,R){function C(){}C.prototype=R.prototype,E.D=R.prototype,E.prototype=new C,E.prototype.constructor=E,E.C=function(L,P,z){for(var B=Array(arguments.length-2),Y=2;YP;++P)L[P]=R.charCodeAt(C++)|R.charCodeAt(C++)<<8|R.charCodeAt(C++)<<16|R.charCodeAt(C++)<<24;else for(P=0;16>P;++P)L[P]=R[C++]|R[C++]<<8|R[C++]<<16|R[C++]<<24;R=E.g[0],C=E.g[1],P=E.g[2];var z=E.g[3],B=R+(z^C&(P^z))+L[0]+3614090360&4294967295;R=C+(B<<7&4294967295|B>>>25),B=z+(P^R&(C^P))+L[1]+3905402710&4294967295,z=R+(B<<12&4294967295|B>>>20),B=P+(C^z&(R^C))+L[2]+606105819&4294967295,P=z+(B<<17&4294967295|B>>>15),B=C+(R^P&(z^R))+L[3]+3250441966&4294967295,C=P+(B<<22&4294967295|B>>>10),B=R+(z^C&(P^z))+L[4]+4118548399&4294967295,R=C+(B<<7&4294967295|B>>>25),B=z+(P^R&(C^P))+L[5]+1200080426&4294967295,z=R+(B<<12&4294967295|B>>>20),B=P+(C^z&(R^C))+L[6]+2821735955&4294967295,P=z+(B<<17&4294967295|B>>>15),B=C+(R^P&(z^R))+L[7]+4249261313&4294967295,C=P+(B<<22&4294967295|B>>>10),B=R+(z^C&(P^z))+L[8]+1770035416&4294967295,R=C+(B<<7&4294967295|B>>>25),B=z+(P^R&(C^P))+L[9]+2336552879&4294967295,z=R+(B<<12&4294967295|B>>>20),B=P+(C^z&(R^C))+L[10]+4294925233&4294967295,P=z+(B<<17&4294967295|B>>>15),B=C+(R^P&(z^R))+L[11]+2304563134&4294967295,C=P+(B<<22&4294967295|B>>>10),B=R+(z^C&(P^z))+L[12]+1804603682&4294967295,R=C+(B<<7&4294967295|B>>>25),B=z+(P^R&(C^P))+L[13]+4254626195&4294967295,z=R+(B<<12&4294967295|B>>>20),B=P+(C^z&(R^C))+L[14]+2792965006&4294967295,P=z+(B<<17&4294967295|B>>>15),B=C+(R^P&(z^R))+L[15]+1236535329&4294967295,C=P+(B<<22&4294967295|B>>>10),B=R+(P^z&(C^P))+L[1]+4129170786&4294967295,R=C+(B<<5&4294967295|B>>>27),B=z+(C^P&(R^C))+L[6]+3225465664&4294967295,z=R+(B<<9&4294967295|B>>>23),B=P+(R^C&(z^R))+L[11]+643717713&4294967295,P=z+(B<<14&4294967295|B>>>18),B=C+(z^R&(P^z))+L[0]+3921069994&4294967295,C=P+(B<<20&4294967295|B>>>12),B=R+(P^z&(C^P))+L[5]+3593408605&4294967295,R=C+(B<<5&4294967295|B>>>27),B=z+(C^P&(R^C))+L[10]+38016083&4294967295,z=R+(B<<9&4294967295|B>>>23),B=P+(R^C&(z^R))+L[15]+3634488961&4294967295,P=z+(B<<14&4294967295|B>>>18),B=C+(z^R&(P^z))+L[4]+3889429448&4294967295,C=P+(B<<20&4294967295|B>>>12),B=R+(P^z&(C^P))+L[9]+568446438&4294967295,R=C+(B<<5&4294967295|B>>>27),B=z+(C^P&(R^C))+L[14]+3275163606&4294967295,z=R+(B<<9&4294967295|B>>>23),B=P+(R^C&(z^R))+L[3]+4107603335&4294967295,P=z+(B<<14&4294967295|B>>>18),B=C+(z^R&(P^z))+L[8]+1163531501&4294967295,C=P+(B<<20&4294967295|B>>>12),B=R+(P^z&(C^P))+L[13]+2850285829&4294967295,R=C+(B<<5&4294967295|B>>>27),B=z+(C^P&(R^C))+L[2]+4243563512&4294967295,z=R+(B<<9&4294967295|B>>>23),B=P+(R^C&(z^R))+L[7]+1735328473&4294967295,P=z+(B<<14&4294967295|B>>>18),B=C+(z^R&(P^z))+L[12]+2368359562&4294967295,C=P+(B<<20&4294967295|B>>>12),B=R+(C^P^z)+L[5]+4294588738&4294967295,R=C+(B<<4&4294967295|B>>>28),B=z+(R^C^P)+L[8]+2272392833&4294967295,z=R+(B<<11&4294967295|B>>>21),B=P+(z^R^C)+L[11]+1839030562&4294967295,P=z+(B<<16&4294967295|B>>>16),B=C+(P^z^R)+L[14]+4259657740&4294967295,C=P+(B<<23&4294967295|B>>>9),B=R+(C^P^z)+L[1]+2763975236&4294967295,R=C+(B<<4&4294967295|B>>>28),B=z+(R^C^P)+L[4]+1272893353&4294967295,z=R+(B<<11&4294967295|B>>>21),B=P+(z^R^C)+L[7]+4139469664&4294967295,P=z+(B<<16&4294967295|B>>>16),B=C+(P^z^R)+L[10]+3200236656&4294967295,C=P+(B<<23&4294967295|B>>>9),B=R+(C^P^z)+L[13]+681279174&4294967295,R=C+(B<<4&4294967295|B>>>28),B=z+(R^C^P)+L[0]+3936430074&4294967295,z=R+(B<<11&4294967295|B>>>21),B=P+(z^R^C)+L[3]+3572445317&4294967295,P=z+(B<<16&4294967295|B>>>16),B=C+(P^z^R)+L[6]+76029189&4294967295,C=P+(B<<23&4294967295|B>>>9),B=R+(C^P^z)+L[9]+3654602809&4294967295,R=C+(B<<4&4294967295|B>>>28),B=z+(R^C^P)+L[12]+3873151461&4294967295,z=R+(B<<11&4294967295|B>>>21),B=P+(z^R^C)+L[15]+530742520&4294967295,P=z+(B<<16&4294967295|B>>>16),B=C+(P^z^R)+L[2]+3299628645&4294967295,C=P+(B<<23&4294967295|B>>>9),B=R+(P^(C|~z))+L[0]+4096336452&4294967295,R=C+(B<<6&4294967295|B>>>26),B=z+(C^(R|~P))+L[7]+1126891415&4294967295,z=R+(B<<10&4294967295|B>>>22),B=P+(R^(z|~C))+L[14]+2878612391&4294967295,P=z+(B<<15&4294967295|B>>>17),B=C+(z^(P|~R))+L[5]+4237533241&4294967295,C=P+(B<<21&4294967295|B>>>11),B=R+(P^(C|~z))+L[12]+1700485571&4294967295,R=C+(B<<6&4294967295|B>>>26),B=z+(C^(R|~P))+L[3]+2399980690&4294967295,z=R+(B<<10&4294967295|B>>>22),B=P+(R^(z|~C))+L[10]+4293915773&4294967295,P=z+(B<<15&4294967295|B>>>17),B=C+(z^(P|~R))+L[1]+2240044497&4294967295,C=P+(B<<21&4294967295|B>>>11),B=R+(P^(C|~z))+L[8]+1873313359&4294967295,R=C+(B<<6&4294967295|B>>>26),B=z+(C^(R|~P))+L[15]+4264355552&4294967295,z=R+(B<<10&4294967295|B>>>22),B=P+(R^(z|~C))+L[6]+2734768916&4294967295,P=z+(B<<15&4294967295|B>>>17),B=C+(z^(P|~R))+L[13]+1309151649&4294967295,C=P+(B<<21&4294967295|B>>>11),B=R+(P^(C|~z))+L[4]+4149444226&4294967295,R=C+(B<<6&4294967295|B>>>26),B=z+(C^(R|~P))+L[11]+3174756917&4294967295,z=R+(B<<10&4294967295|B>>>22),B=P+(R^(z|~C))+L[2]+718787259&4294967295,P=z+(B<<15&4294967295|B>>>17),B=C+(z^(P|~R))+L[9]+3951481745&4294967295,E.g[0]=E.g[0]+R&4294967295,E.g[1]=E.g[1]+(P+(B<<21&4294967295|B>>>11))&4294967295,E.g[2]=E.g[2]+P&4294967295,E.g[3]=E.g[3]+z&4294967295}r.prototype.u=function(E,R){R===void 0&&(R=E.length);for(var C=R-this.blockSize,L=this.B,P=this.h,z=0;zthis.h?this.blockSize:2*this.blockSize)-this.h);E[0]=128;for(var R=1;RR;++R)for(var L=0;32>L;L+=8)E[C++]=this.g[R]>>>L&255;return E};function s(E,R){var C=a;return Object.prototype.hasOwnProperty.call(C,E)?C[E]:C[E]=R(E)}function o(E,R){this.h=R;for(var C=[],L=!0,P=E.length-1;0<=P;P--){var z=E[P]|0;L&&z==R||(C[P]=z,L=!1)}this.g=C}var a={};function l(E){return-128<=E&&128>E?s(E,function(R){return new o([R|0],0>R?-1:0)}):new o([E|0],0>E?-1:0)}function c(E){if(isNaN(E)||!isFinite(E))return f;if(0>E)return y(c(-E));for(var R=[],C=1,L=0;E>=C;L++)R[L]=E/C|0,C*=4294967296;return new o(R,0)}function u(E,R){if(E.length==0)throw Error("number format error: empty string");if(R=R||10,2>R||36z?(z=c(Math.pow(R,z)),L=L.j(z).add(c(B))):(L=L.j(C),L=L.add(c(B)))}return L}var f=l(0),h=l(1),m=l(16777216);t=o.prototype,t.m=function(){if(w(this))return-y(this).m();for(var E=0,R=1,C=0;CE||36>>0).toString(E);if(C=P,v(C))return z+L;for(;6>z.length;)z="0"+z;L=z+L}},t.i=function(E){return 0>E?0:E>>16)+(this.i(P)>>>16)+(E.i(P)>>>16);L=B>>>16,z&=65535,B&=65535,C[P]=B<<16|z}return new o(C,C[C.length-1]&-2147483648?-1:0)};function g(E,R){return E.add(y(R))}t.j=function(E){if(v(this)||v(E))return f;if(w(this))return w(E)?y(this).j(y(E)):y(y(this).j(E));if(w(E))return y(this.j(y(E)));if(0>this.l(m)&&0>E.l(m))return c(this.m()*E.m());for(var R=this.g.length+E.g.length,C=[],L=0;L<2*R;L++)C[L]=0;for(L=0;L>>16,B=this.i(L)&65535,Y=E.i(P)>>>16,ie=E.i(P)&65535;C[2*L+2*P]+=B*ie,_(C,2*L+2*P),C[2*L+2*P+1]+=z*ie,_(C,2*L+2*P+1),C[2*L+2*P+1]+=B*Y,_(C,2*L+2*P+1),C[2*L+2*P+2]+=z*Y,_(C,2*L+2*P+2)}for(L=0;L>>16,E[R]&=65535,R++}function x(E,R){this.g=E,this.h=R}function S(E,R){if(v(R))throw Error("division by zero");if(v(E))return new x(f,f);if(w(E))return R=S(y(E),R),new x(y(R.g),y(R.h));if(w(R))return R=S(E,y(R)),new x(y(R.g),R.h);if(30=L.l(E);)C=D(C),L=D(L);var P=T(C,1),z=T(L,1);for(L=T(L,2),C=T(C,2);!v(L);){var B=z.add(L);0>=B.l(E)&&(P=P.add(C),z=B),L=T(L,1),C=T(C,1)}return R=g(E,P.j(R)),new x(P,R)}for(P=f;0<=E.l(R);){for(C=Math.max(1,Math.floor(E.m()/R.m())),L=Math.ceil(Math.log(C)/Math.LN2),L=48>=L?1:Math.pow(2,L-48),z=c(C),B=z.j(R);w(B)||0>>31;return new o(C,E.h)}function T(E,R){var C=R>>5;R%=32;for(var L=E.g.length-C,P=[],z=0;z>>R|E.i(z+C+1)<<32-R:E.i(z+C);return new o(P,E.h)}r.prototype.digest=r.prototype.v,r.prototype.reset=r.prototype.s,r.prototype.update=r.prototype.u,K8=r,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=u,nd=o}).apply(typeof yB<"u"?yB:typeof self<"u"?self:typeof window<"u"?window:{});var cw=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 Z8,q8,fg,eH,G_,nI,tH,nH,rH;(function(){var t,e=typeof Object.defineProperties=="function"?Object.defineProperty:function(M,k,H){return M==Array.prototype||M==Object.prototype||(M[k]=H.value),M};function n(M){M=[typeof globalThis=="object"&&globalThis,M,typeof window=="object"&&window,typeof self=="object"&&self,typeof cw=="object"&&cw];for(var k=0;k{throw M},0)}function B(){var M=q;let k=null;return M.g&&(k=M.g,M.g=M.g.next,M.g||(M.h=null),k.next=null),k}class Y{constructor(){this.h=this.g=null}add(k,H){const Q=ie.get();Q.set(k,H),this.h?this.h.next=Q:this.g=Q,this.h=Q}}var ie=new g(()=>new ee,M=>M.reset());class ee{constructor(){this.next=this.g=this.h=null}set(k,H){this.h=k,this.g=H,this.next=null}reset(){this.next=this.g=this.h=null}}let le,j=!1,q=new Y,ne=()=>{const M=a.Promise.resolve(void 0);le=()=>{M.then(de)}};var de=()=>{for(var M;M=B();){try{M.h.call(M.g)}catch(H){z(H)}var k=ie;k.j(M),100>k.h&&(k.h++,M.next=k.g,k.g=M)}j=!1};function _e(){this.s=this.s,this.C=this.C}_e.prototype.s=!1,_e.prototype.ma=function(){this.s||(this.s=!0,this.N())},_e.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()};function ge(M,k){this.type=M,this.g=this.target=k,this.defaultPrevented=!1}ge.prototype.h=function(){this.defaultPrevented=!0};var ce=function(){if(!a.addEventListener||!Object.defineProperty)return!1;var M=!1,k=Object.defineProperty({},"passive",{get:function(){M=!0}});try{const H=()=>{};a.addEventListener("test",H,k),a.removeEventListener("test",H,k)}catch{}return M}();function we(M,k){if(ge.call(this,M?M.type:""),this.relatedTarget=this.g=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.i=null,M){var H=this.type=M.type,Q=M.changedTouches&&M.changedTouches.length?M.changedTouches[0]:null;if(this.target=M.target||M.srcElement,this.g=k,k=M.relatedTarget){if(D){e:{try{S(k.nodeName);var be=!0;break e}catch{}be=!1}be||(k=null)}}else H=="mouseover"?k=M.fromElement:H=="mouseout"&&(k=M.toElement);this.relatedTarget=k,Q?(this.clientX=Q.clientX!==void 0?Q.clientX:Q.pageX,this.clientY=Q.clientY!==void 0?Q.clientY:Q.pageY,this.screenX=Q.screenX||0,this.screenY=Q.screenY||0):(this.clientX=M.clientX!==void 0?M.clientX:M.pageX,this.clientY=M.clientY!==void 0?M.clientY:M.pageY,this.screenX=M.screenX||0,this.screenY=M.screenY||0),this.button=M.button,this.key=M.key||"",this.ctrlKey=M.ctrlKey,this.altKey=M.altKey,this.shiftKey=M.shiftKey,this.metaKey=M.metaKey,this.pointerId=M.pointerId||0,this.pointerType=typeof M.pointerType=="string"?M.pointerType:he[M.pointerType]||"",this.state=M.state,this.i=M,M.defaultPrevented&&we.aa.h.call(this)}}v(we,ge);var he={2:"touch",3:"pen",4:"mouse"};we.prototype.h=function(){we.aa.h.call(this);var M=this.i;M.preventDefault?M.preventDefault():M.returnValue=!1};var Ie="closure_listenable_"+(1e6*Math.random()|0),et=0;function ct(M,k,H,Q,be){this.listener=M,this.proxy=null,this.src=k,this.type=H,this.capture=!!Q,this.ha=be,this.key=++et,this.da=this.fa=!1}function it(M){M.da=!0,M.listener=null,M.proxy=null,M.src=null,M.ha=null}function ut(M){this.src=M,this.g={},this.h=0}ut.prototype.add=function(M,k,H,Q,be){var ke=M.toString();M=this.g[ke],M||(M=this.g[ke]=[],this.h++);var wt=Ce(M,k,Q,be);return-1>>0);function He(M){return typeof M=="function"?M:(M[De]||(M[De]=function(k){return M.handleEvent(k)}),M[De])}function pt(){_e.call(this),this.i=new ut(this),this.M=this,this.F=null}v(pt,_e),pt.prototype[Ie]=!0,pt.prototype.removeEventListener=function(M,k,H,Q){yt(this,M,k,H,Q)};function Qe(M,k){var H,Q=M.F;if(Q)for(H=[];Q;Q=Q.F)H.push(Q);if(M=M.M,Q=k.type||k,typeof k=="string")k=new ge(k,M);else if(k instanceof ge)k.target=k.target||M;else{var be=k;k=new ge(Q,M),L(k,be)}if(be=!0,H)for(var ke=H.length-1;0<=ke;ke--){var wt=k.g=H[ke];be=Ye(wt,Q,!0,k)&&be}if(wt=k.g=M,be=Ye(wt,Q,!0,k)&&be,be=Ye(wt,Q,!1,k)&&be,H)for(ke=0;ke{M.g=null,M.i&&(M.i=!1,nt(M))},M.l);const k=M.h;M.h=null,M.m.apply(null,k)}class _t extends _e{constructor(k,H){super(),this.m=k,this.l=H,this.h=null,this.i=!1,this.g=null}j(k){this.h=arguments,this.g?this.i=!0:nt(this)}N(){super.N(),this.g&&(a.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function Qt(M){_e.call(this),this.h=M,this.g={}}v(Qt,_e);var We=[];function Ze(M){T(M.g,function(k,H){this.g.hasOwnProperty(H)&&re(k)},M),M.g={}}Qt.prototype.N=function(){Qt.aa.N.call(this),Ze(this)},Qt.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var Tt=a.JSON.stringify,Ft=a.JSON.parse,en=class{stringify(M){return a.JSON.stringify(M,void 0)}parse(M){return a.JSON.parse(M,void 0)}};function pe(){}pe.prototype.h=null;function st(M){return M.h||(M.h=M.i())}function fe(){}var Pe={OPEN:"a",kb:"b",Ja:"c",wb:"d"};function rt(){ge.call(this,"d")}v(rt,ge);function It(){ge.call(this,"c")}v(It,ge);var Le={},At=null;function Jt(){return At=At||new pt}Le.La="serverreachability";function rn(M){ge.call(this,Le.La,M)}v(rn,ge);function Jn(M){const k=Jt();Qe(k,new rn(k))}Le.STAT_EVENT="statevent";function jn(M,k){ge.call(this,Le.STAT_EVENT,M),this.stat=k}v(jn,ge);function vn(M){const k=Jt();Qe(k,new jn(k,M))}Le.Ma="timingevent";function ue(M,k){ge.call(this,Le.Ma,M),this.size=k}v(ue,ge);function me(M,k){if(typeof M!="function")throw Error("Fn must not be null and must be a function");return a.setTimeout(function(){M()},k)}function Se(){this.g=!0}Se.prototype.xa=function(){this.g=!1};function Ge(M,k,H,Q,be,ke){M.info(function(){if(M.g)if(ke)for(var wt="",Hn=ke.split("&"),ai=0;aiQ.length)){var be=Q[1];if(Array.isArray(be)&&!(1>be.length)){var ke=be[0];if(ke!="noop"&&ke!="stop"&&ke!="close")for(var wt=1;wtsr)&&(sr!=3||this.g&&(this.h.h||this.g.oa()||qu(this.g)))){this.J||sr!=4||k==7||(k==8||0>=ci?Jn(3):Jn(2)),Ve(this);var H=this.g.Z();this.X=H;t:if(xe(this)){var Q=qu(this.g);M="";var be=Q.length,ke=Yr(this.g)==4;if(!this.h.i){if(typeof TextDecoder>"u"){ft(this),$e(this);var wt="";break t}this.h.i=new a.TextDecoder}for(k=0;kk.length?se:(k=k.slice(Q,Q+H),M.C=Q+H,k)))}U.prototype.cancel=function(){this.J=!0,ft(this)};function Ae(M){M.S=Date.now()+M.I,ht(M,M.I)}function ht(M,k){if(M.B!=null)throw Error("WatchDog timer not null");M.B=me(h(M.ba,M),k)}function Ve(M){M.B&&(a.clearTimeout(M.B),M.B=null)}U.prototype.ba=function(){this.B=null;const M=Date.now();0<=M-this.S?(ot(this.i,this.A),this.L!=2&&(Jn(),vn(17)),ft(this),this.s=2,$e(this)):ht(this,this.S-M)};function $e(M){M.j.G==0||M.J||Km(M.j,M)}function ft(M){Ve(M);var k=M.M;k&&typeof k.ma=="function"&&k.ma(),M.M=null,Ze(M.U),M.g&&(k=M.g,M.g=null,k.abort(),k.ma())}function Mt(M,k){try{var H=M.j;if(H.G!=0&&(H.g==M||kt(H.h,M))){if(!M.K&&kt(H.h,M)&&H.G==3){try{var Q=H.Da.g.parse(k)}catch{Q=null}if(Array.isArray(Q)&&Q.length==3){var be=Q;if(be[0]==0){e:if(!H.u){if(H.g)if(H.g.F+3e3be[2]&&H.F&&H.v==0&&!H.C&&(H.C=me(h(H.Za,H),6e3));if(1>=Oe(H.h)&&H.ca){try{H.ca()}catch{}H.ca=void 0}}else Va(H,11)}else if((M.K||H.g==M)&&Al(H),!_(k))for(be=H.Da.g.parse(k),k=0;k=M.j:!1}function Oe(M){return M.h?1:M.g?M.g.size:0}function kt(M,k){return M.h?M.h==k:M.g?M.g.has(k):!1}function Pt(M,k){M.g?M.g.add(k):M.h=k}function Ut(M,k){M.h&&M.h==k?M.h=null:M.g&&M.g.has(k)&&M.g.delete(k)}St.prototype.cancel=function(){if(this.i=yn(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&this.g.size!==0){for(const M of this.g.values())M.cancel();this.g.clear()}};function yn(M){if(M.h!=null)return M.i.concat(M.h.D);if(M.g!=null&&M.g.size!==0){let k=M.i;for(const H of M.g.values())k=k.concat(H.D);return k}return w(M.i)}function Tn(M){if(M.V&&typeof M.V=="function")return M.V();if(typeof Map<"u"&&M instanceof Map||typeof Set<"u"&&M instanceof Set)return Array.from(M.values());if(typeof M=="string")return M.split("");if(l(M)){for(var k=[],H=M.length,Q=0;Qk)throw Error("Bad port number "+k);M.s=k}else M.s=null}function Ri(M,k,H){k instanceof Qu?(M.i=k,LS(M.i,M.h)):(H||(k=ma(k,Jm)),M.i=new Qu(k,M.h))}function kn(M,k,H){M.i.set(k,H)}function bl(M){return kn(M,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),M}function Ga(M,k){return M?k?decodeURI(M.replace(/%25/g,"%2525")):decodeURIComponent(M):""}function ma(M,k,H){return typeof M=="string"?(M=encodeURI(M).replace(k,Kd),H&&(M=M.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),M):null}function Kd(M){return M=M.charCodeAt(0),"%"+(M>>4&15).toString(16)+(M&15).toString(16)}var qv=/[#\/\?@]/g,IS=/[#\?:]/g,$m=/[#\?]/g,Jm=/[#\?@]/g,Yu=/#/g;function Qu(M,k){this.h=this.g=null,this.i=M||null,this.j=!!k}function No(M){M.g||(M.g=new Map,M.h=0,M.i&&dr(M.i,function(k,H){M.add(decodeURIComponent(k.replace(/\+/g," ")),H)}))}t=Qu.prototype,t.add=function(M,k){No(this),this.i=null,M=Sl(this,M);var H=this.g.get(M);return H||this.g.set(M,H=[]),H.push(k),this.h+=1,this};function zn(M,k){No(M),k=Sl(M,k),M.g.has(k)&&(M.i=null,M.h-=M.g.get(k).length,M.g.delete(k))}function Ym(M,k){return No(M),k=Sl(M,k),M.g.has(k)}t.forEach=function(M,k){No(this),this.g.forEach(function(H,Q){H.forEach(function(be){M.call(k,be,Q,this)},this)},this)},t.na=function(){No(this);const M=Array.from(this.g.values()),k=Array.from(this.g.keys()),H=[];for(let Q=0;Q{Q.abort(),ko(H,"TestPingServer: timeout",!1,k)},1e4);fetch(M,{signal:Q.signal}).then(ke=>{clearTimeout(be),ke.ok?ko(H,"TestPingServer: ok",!0,k):ko(H,"TestPingServer: server error",!1,k)}).catch(()=>{clearTimeout(be),ko(H,"TestPingServer: error",!1,k)})}function ko(M,k,H,Q,be){try{be&&(be.onload=null,be.onerror=null,be.onabort=null,be.ontimeout=null),Q(H)}catch{}}function PS(){this.g=new en}function Qm(M,k,H){const Q=H||"";try{cn(M,function(be,ke){let wt=be;c(be)&&(wt=Tt(be)),k.push(Q+ke+"="+encodeURIComponent(wt))})}catch(be){throw k.push(Q+"type="+encodeURIComponent("_badmap")),be}}function Xu(M){this.l=M.Ub||null,this.j=M.eb||!1}v(Xu,pe),Xu.prototype.g=function(){return new Cl(this.l,this.j)},Xu.prototype.i=function(M){return function(){return M}}({});function Cl(M,k){pt.call(this),this.D=M,this.o=k,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}v(Cl,pt),t=Cl.prototype,t.open=function(M,k){if(this.readyState!=0)throw this.abort(),Error("Error reopening a connection");this.B=M,this.A=k,this.readyState=1,Zu(this)},t.send=function(M){if(this.readyState!=1)throw this.abort(),Error("need to call open() first. ");this.g=!0;const k={headers:this.u,method:this.B,credentials:this.m,cache:void 0};M&&(k.body=M),(this.D||a).fetch(new Request(this.A,k)).then(this.Sa.bind(this),this.ga.bind(this))},t.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,Ku(this)),this.readyState=0},t.Sa=function(M){if(this.g&&(this.l=M,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=M.headers,this.readyState=2,Zu(this)),this.g&&(this.readyState=3,Zu(this),this.g)))if(this.responseType==="arraybuffer")M.arrayBuffer().then(this.Qa.bind(this),this.ga.bind(this));else if(typeof a.ReadableStream<"u"&&"body"in M){if(this.j=M.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;eo(this)}else M.text().then(this.Ra.bind(this),this.ga.bind(this))};function eo(M){M.j.read().then(M.Pa.bind(M)).catch(M.ga.bind(M))}t.Pa=function(M){if(this.g){if(this.o&&M.value)this.response.push(M.value);else if(!this.o){var k=M.value?M.value:new Uint8Array(0);(k=this.v.decode(k,{stream:!M.done}))&&(this.response=this.responseText+=k)}M.done?Ku(this):Zu(this),this.readyState==3&&eo(this)}},t.Ra=function(M){this.g&&(this.response=this.responseText=M,Ku(this))},t.Qa=function(M){this.g&&(this.response=M,Ku(this))},t.ga=function(){this.g&&Ku(this)};function Ku(M){M.readyState=4,M.l=null,M.j=null,M.v=null,Zu(M)}t.setRequestHeader=function(M,k){this.u.append(M,k)},t.getResponseHeader=function(M){return this.h&&this.h.get(M.toLowerCase())||""},t.getAllResponseHeaders=function(){if(!this.h)return"";const M=[],k=this.h.entries();for(var H=k.next();!H.done;)H=H.value,M.push(H[0]+": "+H[1]),H=k.next();return M.join(`\r
+`)};function Zu(M){M.onreadystatechange&&M.onreadystatechange.call(M)}Object.defineProperty(Cl.prototype,"withCredentials",{get:function(){return this.m==="include"},set:function(M){this.m=M?"include":"same-origin"}});function to(M){let k="";return T(M,function(H,Q){k+=Q,k+=":",k+=H,k+=`\r
+`}),k}function no(M,k,H){e:{for(Q in H){var Q=!1;break e}Q=!0}Q||(H=to(H),typeof M=="string"?H!=null&&encodeURIComponent(String(H)):kn(M,k,H))}function hr(M){pt.call(this),this.headers=new Map,this.o=M||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}v(hr,pt);var Xm=/^https?$/i,ey=["POST","PUT"];t=hr.prototype,t.Ha=function(M){this.J=M},t.ea=function(M,k,H,Q){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+M);k=k?k.toUpperCase():"GET",this.D=M,this.l="",this.m=0,this.A=!1,this.h=!0,this.g=this.o?this.o.g():W.g(),this.v=this.o?st(this.o):st(W),this.g.onreadystatechange=h(this.Ea,this);try{this.B=!0,this.g.open(k,String(M),!0),this.B=!1}catch(ke){ty(this,ke);return}if(M=H||"",H=new Map(this.headers),Q)if(Object.getPrototypeOf(Q)===Object.prototype)for(var be in Q)H.set(be,Q[be]);else if(typeof Q.keys=="function"&&typeof Q.get=="function")for(const ke of Q.keys())H.set(ke,Q.get(ke));else throw Error("Unknown input type for opt_headers: "+String(Q));Q=Array.from(H.keys()).find(ke=>ke.toLowerCase()=="content-type"),be=a.FormData&&M instanceof a.FormData,!(0<=Array.prototype.indexOf.call(ey,k,void 0))||Q||be||H.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[ke,wt]of H)this.g.setRequestHeader(ke,wt);this.H&&(this.g.responseType=this.H),"withCredentials"in this.g&&this.g.withCredentials!==this.J&&(this.g.withCredentials=this.J);try{ry(this),this.u=!0,this.g.send(M),this.u=!1}catch(ke){ty(this,ke)}};function ty(M,k){M.h=!1,M.g&&(M.j=!0,M.g.abort(),M.j=!1),M.l=k,M.m=5,ro(M),El(M)}function ro(M){M.A||(M.A=!0,Qe(M,"complete"),Qe(M,"error"))}t.abort=function(M){this.g&&this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1,this.m=M||7,Qe(this,"complete"),Qe(this,"abort"),El(this))},t.N=function(){this.g&&(this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1),El(this,!0)),hr.aa.N.call(this)},t.Ea=function(){this.s||(this.B||this.u||this.j?ny(this):this.bb())},t.bb=function(){ny(this)};function ny(M){if(M.h&&typeof o<"u"&&(!M.v[1]||Yr(M)!=4||M.Z()!=2)){if(M.u&&Yr(M)==4)Ke(M.Ea,0,M);else if(Qe(M,"readystatechange"),Yr(M)==4){M.h=!1;try{const wt=M.Z();e:switch(wt){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var k=!0;break e;default:k=!1}var H;if(!(H=k)){var Q;if(Q=wt===0){var be=String(M.D).match(ln)[1]||null;!be&&a.self&&a.self.location&&(be=a.self.location.protocol.slice(0,-1)),Q=!Xm.test(be?be.toLowerCase():"")}H=Q}if(H)Qe(M,"complete"),Qe(M,"success");else{M.m=6;try{var ke=2{}:null;M.g=null,M.v=null,k||Qe(M,"ready");try{H.onreadystatechange=Q}catch{}}}function ry(M){M.I&&(a.clearTimeout(M.I),M.I=null)}t.isActive=function(){return!!this.g};function Yr(M){return M.g?M.g.readyState:0}t.Z=function(){try{return 2=M.h.j-(M.s?1:0)?!1:M.s?(M.i=k.D.concat(M.i),!0):M.G==1||M.G==2||M.B>=(M.Va?0:M.Wa)?!1:(M.s=me(h(M.Ga,M,k),nf(M,M.B)),M.B++,!0)}t.Ga=function(M){if(this.s)if(this.s=null,this.G==1){if(!M){this.U=Math.floor(1e5*Math.random()),M=this.U++;const be=new U(this,this.j,M);let ke=this.o;if(this.S&&(ke?(ke=R(ke),L(ke,this.S)):ke=this.S),this.m!==null||this.O||(be.H=ke,ke=null),this.P)e:{for(var k=0,H=0;HBn)ke=Math.max(0,be[ai].g-100),Hn=!1;else try{Qm(li,wt,"req"+Bn+"_")}catch{Q&&Q(li)}}if(Hn){Q=wt.join("&");break e}}}return M=M.i.splice(0,H),k.D=M,Q}function nh(M){if(!M.g&&!M.u){M.Y=1;var k=M.Fa;le||ne(),j||(le(),j=!0),q.add(k,M),M.v=0}}function rh(M){return M.g||M.u||3<=M.v?!1:(M.Y++,M.u=me(h(M.Fa,M),nf(M,M.v)),M.v++,!0)}t.Fa=function(){if(this.u=null,va(this),this.ba&&!(this.M||this.g==null||0>=this.R)){var M=2*this.R;this.j.info("BP detection timer enabled: "+M),this.A=me(h(this.ab,this),M)}},t.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,vn(10),tf(this),va(this))};function io(M){M.A!=null&&(a.clearTimeout(M.A),M.A=null)}function va(M){M.g=new U(M,M.j,"rpc",M.Y),M.m===null&&(M.g.H=M.o),M.g.O=0;var k=on(M.qa);kn(k,"RID","rpc"),kn(k,"SID",M.K),kn(k,"AID",M.T),kn(k,"CI",M.F?"0":"1"),!M.F&&M.ja&&kn(k,"TO",M.ja),kn(k,"TYPE","xmlhttp"),ts(M,k),M.m&&M.o&&no(k,M.m,M.o),M.L&&(M.g.I=M.L);var H=M.g;M=M.ia,H.L=1,H.v=bl(on(k)),H.m=null,H.P=!0,ve(H,M)}t.Za=function(){this.C!=null&&(this.C=null,tf(this),rh(this),vn(19))};function Al(M){M.C!=null&&(a.clearTimeout(M.C),M.C=null)}function Km(M,k){var H=null;if(M.g==k){Al(M),io(M),M.g=null;var Q=2}else if(kt(M.h,k))H=k.D,Ut(M.h,k),Q=1;else return;if(M.G!=0){if(k.o)if(Q==1){H=k.m?k.m.length:0,k=Date.now()-k.F;var be=M.B;Q=Jt(),Qe(Q,new ue(Q,H)),yc(M)}else nh(M);else if(be=k.s,be==3||be==0&&0`${this.name}: [code=${this.code}]: ${this.message}`}}/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 ec{constructor(){this.promise=new Promise((e,n)=>{this.resolve=e,this.reject=n})}}/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 iH{constructor(e,n){this.user=n,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${e}`)}}class Rde{getToken(){return Promise.resolve(null)}invalidateToken(){}start(e,n){e.enqueueRetryable(()=>n(ps.UNAUTHENTICATED))}shutdown(){}}class Pde{constructor(e){this.token=e,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(e,n){this.changeListener=n,e.enqueueRetryable(()=>n(this.token.user))}shutdown(){this.changeListener=null}}class Dde{constructor(e){this.t=e,this.currentUser=ps.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(e,n){let r=this.i;const i=l=>this.i!==r?(r=this.i,n(l)):Promise.resolve();let s=new ec;this.o=()=>{this.i++,this.currentUser=this.u(),s.resolve(),s=new ec,e.enqueueRetryable(()=>i(this.currentUser))};const o=()=>{const l=s;e.enqueueRetryable(async()=>{await l.promise,await i(this.currentUser)})},a=l=>{Wt("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=l,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):(Wt("FirebaseAuthCredentialsProvider","Auth not yet detected"),s.resolve(),s=new ec)}},0),o()}getToken(){const e=this.i,n=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(n).then(r=>this.i!==e?(Wt("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):r?(Mr(typeof r.accessToken=="string"),new iH(r.accessToken,this.currentUser)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.auth.removeAuthTokenListener(this.o)}u(){const e=this.auth&&this.auth.getUid();return Mr(e===null||typeof e=="string"),new ps(e)}}class Nde{constructor(e,n,r){this.l=e,this.h=n,this.P=r,this.type="FirstParty",this.user=ps.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 kde{constructor(e,n,r){this.l=e,this.h=n,this.P=r}getToken(){return Promise.resolve(new Nde(this.l,this.h,this.P))}start(e,n){e.enqueueRetryable(()=>n(ps.FIRST_PARTY))}shutdown(){}invalidateToken(){}}class Bde{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 Ode{constructor(e){this.A=e,this.forceRefresh=!1,this.appCheck=null,this.R=null}start(e,n){const r=s=>{s.error!=null&&Wt("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,Wt("FirebaseAppCheckTokenProvider",`Received ${o?"new":"existing"} token.`),o?n(s.token):Promise.resolve()};this.o=s=>{e.enqueueRetryable(()=>r(s))};const i=s=>{Wt("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=s,this.appCheck.addTokenListener(this.o)};this.A.onInit(s=>i(s)),setTimeout(()=>{if(!this.appCheck){const s=this.A.getImmediate({optional:!0});s?i(s):Wt("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}},0)}getToken(){const e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then(n=>n?(Mr(typeof n.token=="string"),this.R=n.token,new Bde(n.token)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.appCheck.removeTokenListener(this.o)}}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Ude(t){const e=typeof self<"u"&&(self.crypto||self.msCrypto),n=new Uint8Array(t);if(e&&typeof e.getRandomValues=="function")e.getRandomValues(n);else for(let r=0;re?1:0}function Kp(t,e,n){return t.length===e.length&&t.every((r,i)=>n(r,e[i]))}/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 _i{constructor(e,n){if(this.seconds=e,this.nanoseconds=n,n<0)throw new Rt(Xe.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+n);if(n>=1e9)throw new Rt(Xe.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+n);if(e<-62135596800)throw new Rt(Xe.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e);if(e>=253402300800)throw new Rt(Xe.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}static now(){return _i.fromMillis(Date.now())}static fromDate(e){return _i.fromMillis(e.getTime())}static fromMillis(e){const n=Math.floor(e/1e3),r=Math.floor(1e6*(e-1e3*n));return new _i(n,r)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/1e6}_compareTo(e){return this.seconds===e.seconds?ir(this.nanoseconds,e.nanoseconds):ir(this.seconds,e.seconds)}isEqual(e){return e.seconds===this.seconds&&e.nanoseconds===this.nanoseconds}toString(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"}toJSON(){return{seconds:this.seconds,nanoseconds:this.nanoseconds}}valueOf(){const e=this.seconds- -62135596800;return String(e).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}}/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 un{constructor(e){this.timestamp=e}static fromTimestamp(e){return new un(e)}static min(){return new un(new _i(0,0))}static max(){return new un(new _i(253402300799,999999999))}compareTo(e){return this.timestamp._compareTo(e.timestamp)}isEqual(e){return this.timestamp.isEqual(e.timestamp)}toMicroseconds(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3}toString(){return"SnapshotVersion("+this.timestamp.toString()+")"}toTimestamp(){return this.timestamp}}/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 M1{constructor(e,n,r){n===void 0?n=0:n>e.length&&an(),r===void 0?r=e.length-n:r>e.length-n&&an(),this.segments=e,this.offset=n,this.len=r}get length(){return this.len}isEqual(e){return M1.comparator(this,e)===0}child(e){const n=this.segments.slice(this.offset,this.limit());return e instanceof M1?e.forEach(r=>{n.push(r)}):n.push(e),this.construct(n)}limit(){return this.offset+this.length}popFirst(e){return e=e===void 0?1:e,this.construct(this.segments,this.offset+e,this.length-e)}popLast(){return this.construct(this.segments,this.offset,this.length-1)}firstSegment(){return this.segments[this.offset]}lastSegment(){return this.get(this.length-1)}get(e){return this.segments[this.offset+e]}isEmpty(){return this.length===0}isPrefixOf(e){if(e.lengtho)return 1}return e.lengthn.length?1:0}}class wr extends M1{construct(e,n,r){return new wr(e,n,r)}canonicalString(){return this.toArray().join("/")}toString(){return this.canonicalString()}toUriEncodedString(){return this.toArray().map(encodeURIComponent).join("/")}static fromString(...e){const n=[];for(const r of e){if(r.indexOf("//")>=0)throw new Rt(Xe.INVALID_ARGUMENT,`Invalid segment (${r}). Paths must not contain // in them.`);n.push(...r.split("/").filter(i=>i.length>0))}return new wr(n)}static emptyPath(){return new wr([])}}const Fde=/^[_a-zA-Z][_a-zA-Z0-9]*$/;class $i extends M1{construct(e,n,r){return new $i(e,n,r)}static isValidIdentifier(e){return Fde.test(e)}canonicalString(){return this.toArray().map(e=>(e=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),$i.isValidIdentifier(e)||(e="`"+e+"`"),e)).join(".")}toString(){return this.canonicalString()}isKeyField(){return this.length===1&&this.get(0)==="__name__"}static keyField(){return new $i(["__name__"])}static fromServerFormat(e){const n=[];let r="",i=0;const s=()=>{if(r.length===0)throw new Rt(Xe.INVALID_ARGUMENT,`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);n.push(r),r=""};let o=!1;for(;i=2&&this.path.get(this.path.length-2)===e}getCollectionGroup(){return this.path.get(this.path.length-2)}getCollectionPath(){return this.path.popLast()}isEqual(e){return e!==null&&wr.comparator(this.path,e.path)===0}toString(){return this.path.toString()}static comparator(e,n){return wr.comparator(e.path,n.path)}static isDocumentKey(e){return e.length%2==0}static fromSegments(e){return new Zt(new wr(e.slice()))}}function jde(t,e){const n=t.toTimestamp().seconds,r=t.toTimestamp().nanoseconds+1,i=un.fromTimestamp(r===1e9?new _i(n+1,0):new _i(n,r));return new Mu(i,Zt.empty(),e)}function zde(t){return new Mu(t.readTime,t.key,-1)}class Mu{constructor(e,n,r){this.readTime=e,this.documentKey=n,this.largestBatchId=r}static min(){return new Mu(un.min(),Zt.empty(),-1)}static max(){return new Mu(un.max(),Zt.empty(),-1)}}function Hde(t,e){let n=t.readTime.compareTo(e.readTime);return n!==0?n:(n=Zt.comparator(t.documentKey,e.documentKey),n!==0?n:ir(t.largestBatchId,e.largestBatchId))}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Gde="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.";class Vde{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(e){this.onCommittedListeners.push(e)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach(e=>e())}}/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 vv(t){if(t.code!==Xe.FAILED_PRECONDITION||t.message!==Gde)throw t;Wt("LocalStore","Unexpectedly lost primary lease")}/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 dt{constructor(e){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e(n=>{this.isDone=!0,this.result=n,this.nextCallback&&this.nextCallback(n)},n=>{this.isDone=!0,this.error=n,this.catchCallback&&this.catchCallback(n)})}catch(e){return this.next(void 0,e)}next(e,n){return this.callbackAttached&&an(),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(n,this.error):this.wrapSuccess(e,this.result):new dt((r,i)=>{this.nextCallback=s=>{this.wrapSuccess(e,s).next(r,i)},this.catchCallback=s=>{this.wrapFailure(n,s).next(r,i)}})}toPromise(){return new Promise((e,n)=>{this.next(e,n)})}wrapUserFunction(e){try{const n=e();return n instanceof dt?n:dt.resolve(n)}catch(n){return dt.reject(n)}}wrapSuccess(e,n){return e?this.wrapUserFunction(()=>e(n)):dt.resolve(n)}wrapFailure(e,n){return e?this.wrapUserFunction(()=>e(n)):dt.reject(n)}static resolve(e){return new dt((n,r)=>{n(e)})}static reject(e){return new dt((n,r)=>{r(e)})}static waitFor(e){return new dt((n,r)=>{let i=0,s=0,o=!1;e.forEach(a=>{++i,a.next(()=>{++s,o&&s===i&&n()},l=>r(l))}),o=!0,s===i&&n()})}static or(e){let n=dt.resolve(!1);for(const r of e)n=n.next(i=>i?dt.resolve(i):r());return n}static forEach(e,n){const r=[];return e.forEach((i,s)=>{r.push(n.call(this,i,s))}),this.waitFor(r)}static mapArray(e,n){return new dt((r,i)=>{const s=e.length,o=new Array(s);let a=0;for(let l=0;l{o[c]=u,++a,a===s&&r(o)},u=>i(u))}})}static doWhile(e,n){return new dt((r,i)=>{const s=()=>{e()===!0?n().next(()=>{s()},i):r()};s()})}}function Wde(t){const e=t.match(/Android ([\d.]+)/i),n=e?e[1].split(".").slice(0,2).join("."):"-1";return Number(n)}function yv(t){return t.name==="IndexedDbTransactionError"}/**
+ * @license
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 n3{constructor(e,n){this.previousValue=e,n&&(n.sequenceNumberHandler=r=>this.ie(r),this.se=r=>n.writeSequenceNumber(r))}ie(e){return this.previousValue=Math.max(e,this.previousValue),this.previousValue}next(){const e=++this.previousValue;return this.se&&this.se(e),e}}n3.oe=-1;function g2(t){return t==null}function JM(t){return t===0&&1/t==-1/0}function $de(t){return typeof t=="number"&&Number.isInteger(t)&&!JM(t)&&t<=Number.MAX_SAFE_INTEGER&&t>=Number.MIN_SAFE_INTEGER}/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 _B(t){let e=0;for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&e++;return e}function Od(t,e){for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&e(n,t[n])}function oH(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Or{constructor(e,n){this.comparator=e,this.root=n||Vi.EMPTY}insert(e,n){return new Or(this.comparator,this.root.insert(e,n,this.comparator).copy(null,null,Vi.BLACK,null,null))}remove(e){return new Or(this.comparator,this.root.remove(e,this.comparator).copy(null,null,Vi.BLACK,null,null))}get(e){let n=this.root;for(;!n.isEmpty();){const r=this.comparator(e,n.key);if(r===0)return n.value;r<0?n=n.left:r>0&&(n=n.right)}return null}indexOf(e){let n=0,r=this.root;for(;!r.isEmpty();){const i=this.comparator(e,r.key);if(i===0)return n+r.left.size;i<0?r=r.left:(n+=r.left.size+1,r=r.right)}return-1}isEmpty(){return this.root.isEmpty()}get size(){return this.root.size}minKey(){return this.root.minKey()}maxKey(){return this.root.maxKey()}inorderTraversal(e){return this.root.inorderTraversal(e)}forEach(e){this.inorderTraversal((n,r)=>(e(n,r),!1))}toString(){const e=[];return this.inorderTraversal((n,r)=>(e.push(`${n}:${r}`),!1)),`{${e.join(", ")}}`}reverseTraversal(e){return this.root.reverseTraversal(e)}getIterator(){return new uw(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new uw(this.root,e,this.comparator,!1)}getReverseIterator(){return new uw(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new uw(this.root,e,this.comparator,!0)}}class uw{constructor(e,n,r,i){this.isReverse=i,this.nodeStack=[];let s=1;for(;!e.isEmpty();)if(s=n?r(e.key,n):1,n&&i&&(s*=-1),s<0)e=this.isReverse?e.left:e.right;else{if(s===0){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}getNext(){let e=this.nodeStack.pop();const n={key:e.key,value:e.value};if(this.isReverse)for(e=e.left;!e.isEmpty();)this.nodeStack.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack.push(e),e=e.left;return n}hasNext(){return this.nodeStack.length>0}peek(){if(this.nodeStack.length===0)return null;const e=this.nodeStack[this.nodeStack.length-1];return{key:e.key,value:e.value}}}class Vi{constructor(e,n,r,i,s){this.key=e,this.value=n,this.color=r??Vi.RED,this.left=i??Vi.EMPTY,this.right=s??Vi.EMPTY,this.size=this.left.size+1+this.right.size}copy(e,n,r,i,s){return new Vi(e??this.key,n??this.value,r??this.color,i??this.left,s??this.right)}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min(){return this.left.isEmpty()?this:this.left.min()}minKey(){return this.min().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,n,r){let i=this;const s=r(e,i.key);return i=s<0?i.copy(null,null,null,i.left.insert(e,n,r),null):s===0?i.copy(null,n,null,null,null):i.copy(null,null,null,null,i.right.insert(e,n,r)),i.fixUp()}removeMin(){if(this.left.isEmpty())return Vi.EMPTY;let e=this;return e.left.isRed()||e.left.left.isRed()||(e=e.moveRedLeft()),e=e.copy(null,null,null,e.left.removeMin(),null),e.fixUp()}remove(e,n){let r,i=this;if(n(e,i.key)<0)i.left.isEmpty()||i.left.isRed()||i.left.left.isRed()||(i=i.moveRedLeft()),i=i.copy(null,null,null,i.left.remove(e,n),null);else{if(i.left.isRed()&&(i=i.rotateRight()),i.right.isEmpty()||i.right.isRed()||i.right.left.isRed()||(i=i.moveRedRight()),n(e,i.key)===0){if(i.right.isEmpty())return Vi.EMPTY;r=i.right.min(),i=i.copy(r.key,r.value,null,null,i.right.removeMin())}i=i.copy(null,null,null,null,i.right.remove(e,n))}return i.fixUp()}isRed(){return this.color}fixUp(){let e=this;return e.right.isRed()&&!e.left.isRed()&&(e=e.rotateLeft()),e.left.isRed()&&e.left.left.isRed()&&(e=e.rotateRight()),e.left.isRed()&&e.right.isRed()&&(e=e.colorFlip()),e}moveRedLeft(){let e=this.colorFlip();return e.right.left.isRed()&&(e=e.copy(null,null,null,null,e.right.rotateRight()),e=e.rotateLeft(),e=e.colorFlip()),e}moveRedRight(){let e=this.colorFlip();return e.left.left.isRed()&&(e=e.rotateRight(),e=e.colorFlip()),e}rotateLeft(){const e=this.copy(null,null,Vi.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight(){const e=this.copy(null,null,Vi.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip(){const e=this.left.copy(null,null,!this.left.color,null,null),n=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,n)}checkMaxDepth(){const e=this.check();return Math.pow(2,e)<=this.size+1}check(){if(this.isRed()&&this.left.isRed()||this.right.isRed())throw an();const e=this.left.check();if(e!==this.right.check())throw an();return e+(this.isRed()?0:1)}}Vi.EMPTY=null,Vi.RED=!0,Vi.BLACK=!1;Vi.EMPTY=new class{constructor(){this.size=0}get key(){throw an()}get value(){throw an()}get color(){throw an()}get left(){throw an()}get right(){throw an()}copy(e,n,r,i,s){return this}insert(e,n,r){return new Vi(e,n)}remove(e,n){return this}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}};/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Yi{constructor(e){this.comparator=e,this.data=new Or(this.comparator)}has(e){return this.data.get(e)!==null}first(){return this.data.minKey()}last(){return this.data.maxKey()}get size(){return this.data.size}indexOf(e){return this.data.indexOf(e)}forEach(e){this.data.inorderTraversal((n,r)=>(e(n),!1))}forEachInRange(e,n){const r=this.data.getIteratorFrom(e[0]);for(;r.hasNext();){const i=r.getNext();if(this.comparator(i.key,e[1])>=0)return;n(i.key)}}forEachWhile(e,n){let r;for(r=n!==void 0?this.data.getIteratorFrom(n):this.data.getIterator();r.hasNext();)if(!e(r.getNext().key))return}firstAfterOrEqual(e){const n=this.data.getIteratorFrom(e);return n.hasNext()?n.getNext().key:null}getIterator(){return new MB(this.data.getIterator())}getIteratorFrom(e){return new MB(this.data.getIteratorFrom(e))}add(e){return this.copy(this.data.remove(e).insert(e,!0))}delete(e){return this.has(e)?this.copy(this.data.remove(e)):this}isEmpty(){return this.data.isEmpty()}unionWith(e){let n=this;return n.size{n=n.add(r)}),n}isEqual(e){if(!(e instanceof Yi)||this.size!==e.size)return!1;const n=this.data.getIterator(),r=e.data.getIterator();for(;n.hasNext();){const i=n.getNext().key,s=r.getNext().key;if(this.comparator(i,s)!==0)return!1}return!0}toArray(){const e=[];return this.forEach(n=>{e.push(n)}),e}toString(){const e=[];return this.forEach(n=>e.push(n)),"SortedSet("+e.toString()+")"}copy(e){const n=new Yi(this.comparator);return n.data=e,n}}class MB{constructor(e){this.iter=e}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 wo{constructor(e){this.fields=e,e.sort($i.comparator)}static empty(){return new wo([])}unionWith(e){let n=new Yi($i.comparator);for(const r of this.fields)n=n.add(r);for(const r of e)n=n.add(r);return new wo(n.toArray())}covers(e){for(const n of this.fields)if(n.isPrefixOf(e))return!0;return!1}isEqual(e){return Kp(this.fields,e.fields,(n,r)=>n.isEqual(r))}}/**
+ * @license
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 aH extends Error{constructor(){super(...arguments),this.name="Base64DecodeError"}}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 ws{constructor(e){this.binaryString=e}static fromBase64String(e){const n=function(i){try{return atob(i)}catch(s){throw typeof DOMException<"u"&&s instanceof DOMException?new aH("Invalid base64 string: "+s):s}}(e);return new ws(n)}static fromUint8Array(e){const n=function(i){let s="";for(let o=0;oehl(n,e))!==void 0}function Zp(t,e){if(t===e)return 0;const n=Sd(t),r=Sd(e);if(n!==r)return ir(n,r);switch(n){case 0:case 9007199254740991:return 0;case 1:return ir(t.booleanValue,e.booleanValue);case 2:return function(s,o){const a=mi(s.integerValue||s.doubleValue),l=mi(o.integerValue||o.doubleValue);return al?1:a===l?0:isNaN(a)?isNaN(l)?0:-1:1}(t,e);case 3:return xB(t.timestampValue,e.timestampValue);case 4:return xB(x1(t),x1(e));case 5:return ir(t.stringValue,e.stringValue);case 6:return function(s,o){const a=bd(s),l=bd(o);return a.compareTo(l)}(t.bytesValue,e.bytesValue);case 7:return function(s,o){const a=s.split("/"),l=o.split("/");for(let c=0;ce.mapValue.fields[n]=Ng(r)),e}if(t.arrayValue){const e={arrayValue:{values:[]}};for(let n=0;n<(t.arrayValue.values||[]).length;++n)e.arrayValue.values[n]=Ng(t.arrayValue.values[n]);return e}return Object.assign({},t)}function Qde(t){return(((t.mapValue||{}).fields||{}).__type__||{}).stringValue==="__max__"}/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Ws{constructor(e){this.value=e}static empty(){return new Ws({mapValue:{}})}field(e){if(e.isEmpty())return this.value;{let n=this.value;for(let r=0;r{if(!n.isImmediateParentOf(a)){const l=this.getFieldsMap(n);this.applyChanges(l,r,i),r={},i=[],n=a.popLast()}o?r[a.lastSegment()]=Ng(o):i.push(a.lastSegment())});const s=this.getFieldsMap(n);this.applyChanges(s,r,i)}delete(e){const n=this.field(e.popLast());V_(n)&&n.mapValue.fields&&delete n.mapValue.fields[e.lastSegment()]}isEqual(e){return hl(this.value,e.value)}getFieldsMap(e){let n=this.value;n.mapValue.fields||(n.mapValue={fields:{}});for(let r=0;re[i]=s);for(const i of r)delete e[i]}clone(){return new Ws(Ng(this.value))}}function lH(t){const e=[];return Od(t.fields,(n,r)=>{const i=new $i([n]);if(V_(r)){const s=lH(r.mapValue).fields;if(s.length===0)e.push(i);else for(const o of s)e.push(i.child(o))}else e.push(i)}),new wo(e)}/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 gs{constructor(e,n,r,i,s,o,a){this.key=e,this.documentType=n,this.version=r,this.readTime=i,this.createTime=s,this.data=o,this.documentState=a}static newInvalidDocument(e){return new gs(e,0,un.min(),un.min(),un.min(),Ws.empty(),0)}static newFoundDocument(e,n,r,i){return new gs(e,1,n,un.min(),r,i,0)}static newNoDocument(e,n){return new gs(e,2,n,un.min(),un.min(),Ws.empty(),0)}static newUnknownDocument(e,n){return new gs(e,3,n,un.min(),un.min(),Ws.empty(),2)}convertToFoundDocument(e,n){return!this.createTime.isEqual(un.min())||this.documentType!==2&&this.documentType!==0||(this.createTime=e),this.version=e,this.documentType=1,this.data=n,this.documentState=0,this}convertToNoDocument(e){return this.version=e,this.documentType=2,this.data=Ws.empty(),this.documentState=0,this}convertToUnknownDocument(e){return this.version=e,this.documentType=3,this.data=Ws.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this.version=un.min(),this}setReadTime(e){return this.readTime=e,this}get hasLocalMutations(){return this.documentState===1}get hasCommittedMutations(){return this.documentState===2}get hasPendingWrites(){return this.hasLocalMutations||this.hasCommittedMutations}isValidDocument(){return this.documentType!==0}isFoundDocument(){return this.documentType===1}isNoDocument(){return this.documentType===2}isUnknownDocument(){return this.documentType===3}isEqual(e){return e instanceof gs&&this.key.isEqual(e.key)&&this.version.isEqual(e.version)&&this.documentType===e.documentType&&this.documentState===e.documentState&&this.data.isEqual(e.data)}mutableCopy(){return new gs(this.key,this.documentType,this.version,this.readTime,this.createTime,this.data.clone(),this.documentState)}toString(){return`Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {createTime: ${this.createTime}}), {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`}}/**
+ * @license
+ * Copyright 2022 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 em{constructor(e,n){this.position=e,this.inclusive=n}}function CB(t,e,n){let r=0;for(let i=0;i":return e>0;case">=":return e>=0;default:return an()}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}}class Ua extends cH{constructor(e,n){super(),this.filters=e,this.op=n,this.ae=null}static create(e,n){return new Ua(e,n)}matches(e){return uH(this)?this.filters.find(n=>!n.matches(e))===void 0:this.filters.find(n=>n.matches(e))!==void 0}getFlattenedFilters(){return this.ae!==null||(this.ae=this.filters.reduce((e,n)=>e.concat(n.getFlattenedFilters()),[])),this.ae}getFilters(){return Object.assign([],this.filters)}}function uH(t){return t.op==="and"}function fH(t){return Kde(t)&&uH(t)}function Kde(t){for(const e of t.filters)if(e instanceof Ua)return!1;return!0}function sI(t){if(t instanceof yi)return t.field.canonicalString()+t.op.toString()+qp(t.value);if(fH(t))return t.filters.map(e=>sI(e)).join(",");{const e=t.filters.map(n=>sI(n)).join(",");return`${t.op}(${e})`}}function dH(t,e){return t instanceof yi?function(r,i){return i instanceof yi&&r.op===i.op&&r.field.isEqual(i.field)&&hl(r.value,i.value)}(t,e):t instanceof Ua?function(r,i){return i instanceof Ua&&r.op===i.op&&r.filters.length===i.filters.length?r.filters.reduce((s,o,a)=>s&&dH(o,i.filters[a]),!0):!1}(t,e):void an()}function hH(t){return t instanceof yi?function(n){return`${n.field.canonicalString()} ${n.op} ${qp(n.value)}`}(t):t instanceof Ua?function(n){return n.op.toString()+" {"+n.getFilters().map(hH).join(" ,")+"}"}(t):"Filter"}class Zde extends yi{constructor(e,n,r){super(e,n,r),this.key=Zt.fromName(r.referenceValue)}matches(e){const n=Zt.comparator(e.key,this.key);return this.matchesComparison(n)}}class qde extends yi{constructor(e,n){super(e,"in",n),this.keys=pH("in",n)}matches(e){return this.keys.some(n=>n.isEqual(e.key))}}class ehe extends yi{constructor(e,n){super(e,"not-in",n),this.keys=pH("not-in",n)}matches(e){return!this.keys.some(n=>n.isEqual(e.key))}}function pH(t,e){var n;return(((n=e.arrayValue)===null||n===void 0?void 0:n.values)||[]).map(r=>Zt.fromName(r.referenceValue))}class the extends yi{constructor(e,n){super(e,"array-contains",n)}matches(e){const n=e.data.field(this.field);return i3(n)&&S1(n.arrayValue,this.value)}}class nhe extends yi{constructor(e,n){super(e,"in",n)}matches(e){const n=e.data.field(this.field);return n!==null&&S1(this.value.arrayValue,n)}}class rhe extends yi{constructor(e,n){super(e,"not-in",n)}matches(e){if(S1(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const n=e.data.field(this.field);return n!==null&&!S1(this.value.arrayValue,n)}}class ihe extends yi{constructor(e,n){super(e,"array-contains-any",n)}matches(e){const n=e.data.field(this.field);return!(!i3(n)||!n.arrayValue.values)&&n.arrayValue.values.some(r=>S1(this.value.arrayValue,r))}}/**
+ * @license
+ * Copyright 2019 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 she{constructor(e,n=null,r=[],i=[],s=null,o=null,a=null){this.path=e,this.collectionGroup=n,this.orderBy=r,this.filters=i,this.limit=s,this.startAt=o,this.endAt=a,this.ue=null}}function AB(t,e=null,n=[],r=[],i=null,s=null,o=null){return new she(t,e,n,r,i,s,o)}function s3(t){const e=pn(t);if(e.ue===null){let n=e.path.canonicalString();e.collectionGroup!==null&&(n+="|cg:"+e.collectionGroup),n+="|f:",n+=e.filters.map(r=>sI(r)).join(","),n+="|ob:",n+=e.orderBy.map(r=>function(s){return s.field.canonicalString()+s.dir}(r)).join(","),g2(e.limit)||(n+="|l:",n+=e.limit),e.startAt&&(n+="|lb:",n+=e.startAt.inclusive?"b:":"a:",n+=e.startAt.position.map(r=>qp(r)).join(",")),e.endAt&&(n+="|ub:",n+=e.endAt.inclusive?"a:":"b:",n+=e.endAt.position.map(r=>qp(r)).join(",")),e.ue=n}return e.ue}function o3(t,e){if(t.limit!==e.limit||t.orderBy.length!==e.orderBy.length)return!1;for(let n=0;n0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";(function(o){let a=new Yi($i.comparator);return o.filters.forEach(l=>{l.getFlattenedFilters().forEach(c=>{c.isInequality()&&(a=a.add(c.field))})}),a})(e).forEach(s=>{n.has(s.canonicalString())||s.isKeyField()||e.ce.push(new C1(s,r))}),n.has($i.keyField().canonicalString())||e.ce.push(new C1($i.keyField(),r))}return e.ce}function al(t){const e=pn(t);return e.le||(e.le=ahe(e,Ap(t))),e.le}function ahe(t,e){if(t.limitType==="F")return AB(t.path,t.collectionGroup,e,t.filters,t.limit,t.startAt,t.endAt);{e=e.map(i=>{const s=i.dir==="desc"?"asc":"desc";return new C1(i.field,s)});const n=t.endAt?new em(t.endAt.position,t.endAt.inclusive):null,r=t.startAt?new em(t.startAt.position,t.startAt.inclusive):null;return AB(t.path,t.collectionGroup,e,t.filters,t.limit,n,r)}}function aI(t,e){const n=t.filters.concat([e]);return new Ud(t.path,t.collectionGroup,t.explicitOrderBy.slice(),n,t.limit,t.limitType,t.startAt,t.endAt)}function QM(t,e,n){return new Ud(t.path,t.collectionGroup,t.explicitOrderBy.slice(),t.filters.slice(),e,n,t.startAt,t.endAt)}function w2(t,e){return o3(al(t),al(e))&&t.limitType===e.limitType}function mH(t){return`${s3(al(t))}|lt:${t.limitType}`}function Jh(t){return`Query(target=${function(n){let r=n.path.canonicalString();return n.collectionGroup!==null&&(r+=" collectionGroup="+n.collectionGroup),n.filters.length>0&&(r+=`, filters: [${n.filters.map(i=>hH(i)).join(", ")}]`),g2(n.limit)||(r+=", limit: "+n.limit),n.orderBy.length>0&&(r+=`, orderBy: [${n.orderBy.map(i=>function(o){return`${o.field.canonicalString()} (${o.dir})`}(i)).join(", ")}]`),n.startAt&&(r+=", startAt: ",r+=n.startAt.inclusive?"b:":"a:",r+=n.startAt.position.map(i=>qp(i)).join(",")),n.endAt&&(r+=", endAt: ",r+=n.endAt.inclusive?"a:":"b:",r+=n.endAt.position.map(i=>qp(i)).join(",")),`Target(${r})`}(al(t))}; limitType=${t.limitType})`}function _2(t,e){return e.isFoundDocument()&&function(r,i){const s=i.key.path;return r.collectionGroup!==null?i.key.hasCollectionId(r.collectionGroup)&&r.path.isPrefixOf(s):Zt.isDocumentKey(r.path)?r.path.isEqual(s):r.path.isImmediateParentOf(s)}(t,e)&&function(r,i){for(const s of Ap(r))if(!s.field.isKeyField()&&i.data.field(s.field)===null)return!1;return!0}(t,e)&&function(r,i){for(const s of r.filters)if(!s.matches(i))return!1;return!0}(t,e)&&function(r,i){return!(r.startAt&&!function(o,a,l){const c=CB(o,a,l);return o.inclusive?c<=0:c<0}(r.startAt,Ap(r),i)||r.endAt&&!function(o,a,l){const c=CB(o,a,l);return o.inclusive?c>=0:c>0}(r.endAt,Ap(r),i))}(t,e)}function lhe(t){return t.collectionGroup||(t.path.length%2==1?t.path.lastSegment():t.path.get(t.path.length-2))}function gH(t){return(e,n)=>{let r=!1;for(const i of Ap(t)){const s=che(i,e,n);if(s!==0)return s;r=r||i.field.isKeyField()}return 0}}function che(t,e,n){const r=t.field.isKeyField()?Zt.comparator(e.key,n.key):function(s,o,a){const l=o.data.field(s),c=a.data.field(s);return l!==null&&c!==null?Zp(l,c):an()}(t.field,e,n);switch(t.dir){case"asc":return r;case"desc":return-1*r;default:return an()}}/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Pm{constructor(e,n){this.mapKeyFn=e,this.equalsFn=n,this.inner={},this.innerSize=0}get(e){const n=this.mapKeyFn(e),r=this.inner[n];if(r!==void 0){for(const[i,s]of r)if(this.equalsFn(i,e))return s}}has(e){return this.get(e)!==void 0}set(e,n){const r=this.mapKeyFn(e),i=this.inner[r];if(i===void 0)return this.inner[r]=[[e,n]],void this.innerSize++;for(let s=0;s{for(const[i,s]of r)e(i,s)})}isEmpty(){return oH(this.inner)}size(){return this.innerSize}}/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 uhe=new Or(Zt.comparator);function fc(){return uhe}const vH=new Or(Zt.comparator);function dg(...t){let e=vH;for(const n of t)e=e.insert(n.key,n);return e}function yH(t){let e=vH;return t.forEach((n,r)=>e=e.insert(n,r.overlayedDocument)),e}function Wf(){return kg()}function wH(){return kg()}function kg(){return new Pm(t=>t.toString(),(t,e)=>t.isEqual(e))}const fhe=new Or(Zt.comparator),dhe=new Yi(Zt.comparator);function Un(...t){let e=dhe;for(const n of t)e=e.add(n);return e}const hhe=new Yi(ir);function phe(){return hhe}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 _H(t,e){if(t.useProto3Json){if(isNaN(e))return{doubleValue:"NaN"};if(e===1/0)return{doubleValue:"Infinity"};if(e===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:JM(e)?"-0":e}}function MH(t){return{integerValue:""+t}}function mhe(t,e){return $de(e)?MH(e):_H(t,e)}/**
+ * @license
+ * Copyright 2018 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 M2{constructor(){this._=void 0}}function ghe(t,e,n){return t instanceof XM?function(i,s){const o={fields:{__type__:{stringValue:"server_timestamp"},__local_write_time__:{timestampValue:{seconds:i.seconds,nanos:i.nanoseconds}}}};return s&&v2(s)&&(s=r3(s)),s&&(o.fields.__previous_value__=s),{mapValue:o}}(n,e):t instanceof tm?bH(t,e):t instanceof nm?SH(t,e):function(i,s){const o=xH(i,s),a=IB(o)+IB(i.Pe);return iI(o)&&iI(i.Pe)?MH(a):_H(i.serializer,a)}(t,e)}function vhe(t,e,n){return t instanceof tm?bH(t,e):t instanceof nm?SH(t,e):n}function xH(t,e){return t instanceof KM?function(r){return iI(r)||function(s){return!!s&&"doubleValue"in s}(r)}(e)?e:{integerValue:0}:null}class XM extends M2{}class tm extends M2{constructor(e){super(),this.elements=e}}function bH(t,e){const n=CH(e);for(const r of t.elements)n.some(i=>hl(i,r))||n.push(r);return{arrayValue:{values:n}}}class nm extends M2{constructor(e){super(),this.elements=e}}function SH(t,e){let n=CH(e);for(const r of t.elements)n=n.filter(i=>!hl(i,r));return{arrayValue:{values:n}}}class KM extends M2{constructor(e,n){super(),this.serializer=e,this.Pe=n}}function IB(t){return mi(t.integerValue||t.doubleValue)}function CH(t){return i3(t)&&t.arrayValue.values?t.arrayValue.values.slice():[]}/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 EH{constructor(e,n){this.field=e,this.transform=n}}function yhe(t,e){return t.field.isEqual(e.field)&&function(r,i){return r instanceof tm&&i instanceof tm||r instanceof nm&&i instanceof nm?Kp(r.elements,i.elements,hl):r instanceof KM&&i instanceof KM?hl(r.Pe,i.Pe):r instanceof XM&&i instanceof XM}(t.transform,e.transform)}class whe{constructor(e,n){this.version=e,this.transformResults=n}}class Ns{constructor(e,n){this.updateTime=e,this.exists=n}static none(){return new Ns}static exists(e){return new Ns(void 0,e)}static updateTime(e){return new Ns(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 W_(t,e){return t.updateTime!==void 0?e.isFoundDocument()&&e.version.isEqual(t.updateTime):t.exists===void 0||t.exists===e.isFoundDocument()}class x2{}function AH(t,e){if(!t.hasLocalMutations||e&&e.fields.length===0)return null;if(e===null)return t.isNoDocument()?new b2(t.key,Ns.none()):new wv(t.key,t.data,Ns.none());{const n=t.data,r=Ws.empty();let i=new Yi($i.comparator);for(let s of e.fields)if(!i.has(s)){let o=n.field(s);o===null&&s.length>1&&(s=s.popLast(),o=n.field(s)),o===null?r.delete(s):r.set(s,o),i=i.add(s)}return new zu(t.key,r,new wo(i.toArray()),Ns.none())}}function _he(t,e,n){t instanceof wv?function(i,s,o){const a=i.value.clone(),l=RB(i.fieldTransforms,s,o.transformResults);a.setAll(l),s.convertToFoundDocument(o.version,a).setHasCommittedMutations()}(t,e,n):t instanceof zu?function(i,s,o){if(!W_(i.precondition,s))return void s.convertToUnknownDocument(o.version);const a=RB(i.fieldTransforms,s,o.transformResults),l=s.data;l.setAll(TH(i)),l.setAll(a),s.convertToFoundDocument(o.version,l).setHasCommittedMutations()}(t,e,n):function(i,s,o){s.convertToNoDocument(o.version).setHasCommittedMutations()}(0,e,n)}function Bg(t,e,n,r){return t instanceof wv?function(s,o,a,l){if(!W_(s.precondition,o))return a;const c=s.value.clone(),u=PB(s.fieldTransforms,l,o);return c.setAll(u),o.convertToFoundDocument(o.version,c).setHasLocalMutations(),null}(t,e,n,r):t instanceof zu?function(s,o,a,l){if(!W_(s.precondition,o))return a;const c=PB(s.fieldTransforms,l,o),u=o.data;return u.setAll(TH(s)),u.setAll(c),o.convertToFoundDocument(o.version,u).setHasLocalMutations(),a===null?null:a.unionWith(s.fieldMask.fields).unionWith(s.fieldTransforms.map(f=>f.field))}(t,e,n,r):function(s,o,a){return W_(s.precondition,o)?(o.convertToNoDocument(o.version).setHasLocalMutations(),null):a}(t,e,n)}function Mhe(t,e){let n=null;for(const r of t.fieldTransforms){const i=e.data.field(r.field),s=xH(r.transform,i||null);s!=null&&(n===null&&(n=Ws.empty()),n.set(r.field,s))}return n||null}function LB(t,e){return t.type===e.type&&!!t.key.isEqual(e.key)&&!!t.precondition.isEqual(e.precondition)&&!!function(r,i){return r===void 0&&i===void 0||!(!r||!i)&&Kp(r,i,(s,o)=>yhe(s,o))}(t.fieldTransforms,e.fieldTransforms)&&(t.type===0?t.value.isEqual(e.value):t.type!==1||t.data.isEqual(e.data)&&t.fieldMask.isEqual(e.fieldMask))}class wv extends x2{constructor(e,n,r,i=[]){super(),this.key=e,this.value=n,this.precondition=r,this.fieldTransforms=i,this.type=0}getFieldMask(){return null}}class zu extends x2{constructor(e,n,r,i,s=[]){super(),this.key=e,this.data=n,this.fieldMask=r,this.precondition=i,this.fieldTransforms=s,this.type=1}getFieldMask(){return this.fieldMask}}function TH(t){const e=new Map;return t.fieldMask.fields.forEach(n=>{if(!n.isEmpty()){const r=t.data.field(n);e.set(n,r)}}),e}function RB(t,e,n){const r=new Map;Mr(t.length===n.length);for(let i=0;i{const s=e.get(i.key),o=s.overlayedDocument;let a=this.applyToLocalView(o,s.mutatedFields);a=n.has(i.key)?null:a;const l=AH(o,a);l!==null&&r.set(i.key,l),o.isValidDocument()||o.convertToNoDocument(un.min())}),r}keys(){return this.mutations.reduce((e,n)=>e.add(n.key),Un())}isEqual(e){return this.batchId===e.batchId&&Kp(this.mutations,e.mutations,(n,r)=>LB(n,r))&&Kp(this.baseMutations,e.baseMutations,(n,r)=>LB(n,r))}}class l3{constructor(e,n,r,i){this.batch=e,this.commitVersion=n,this.mutationResults=r,this.docVersions=i}static from(e,n,r){Mr(e.mutations.length===r.length);let i=function(){return fhe}();const s=e.mutations;for(let o=0;o=8)throw new hg(`Invalid padding: ${n}`);if(r<0)throw new hg(`Invalid hash count: ${r}`);if(e.length>0&&this.hashCount===0)throw new hg(`Invalid hash count: ${r}`);if(e.length===0&&n!==0)throw new hg(`Invalid padding when bitmap length is 0: ${n}`);this.Ie=8*e.length-n,this.Te=nd.fromNumber(this.Ie)}Ee(e,n,r){let i=e.add(n.multiply(nd.fromNumber(r)));return i.compare(The)===1&&(i=new nd([i.getBits(0),i.getBits(1)],0)),i.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 n=DB(e),[r,i]=NB(n);for(let s=0;s0&&(this.we=!0,this.pe=e)}Ce(){let e=Un(),n=Un(),r=Un();return this.ge.forEach((i,s)=>{switch(s){case 0:e=e.add(i);break;case 2:n=n.add(i);break;case 1:r=r.add(i);break;default:an()}}),new _v(this.pe,this.ye,e,n,r)}ve(){this.we=!1,this.ge=OB()}Fe(e,n){this.we=!0,this.ge=this.ge.insert(e,n)}Me(e){this.we=!0,this.ge=this.ge.remove(e)}xe(){this.fe+=1}Oe(){this.fe-=1,Mr(this.fe>=0)}Ne(){this.we=!0,this.ye=!0}}class Ihe{constructor(e){this.Le=e,this.Be=new Map,this.ke=fc(),this.qe=BB(),this.Qe=new Or(ir)}Ke(e){for(const n of e.Re)e.Ve&&e.Ve.isFoundDocument()?this.$e(n,e.Ve):this.Ue(n,e.key,e.Ve);for(const n of e.removedTargetIds)this.Ue(n,e.key,e.Ve)}We(e){this.forEachTarget(e,n=>{const r=this.Ge(n);switch(e.state){case 0:this.ze(n)&&r.De(e.resumeToken);break;case 1:r.Oe(),r.Se||r.ve(),r.De(e.resumeToken);break;case 2:r.Oe(),r.Se||this.removeTarget(n);break;case 3:this.ze(n)&&(r.Ne(),r.De(e.resumeToken));break;case 4:this.ze(n)&&(this.je(n),r.De(e.resumeToken));break;default:an()}})}forEachTarget(e,n){e.targetIds.length>0?e.targetIds.forEach(n):this.Be.forEach((r,i)=>{this.ze(i)&&n(i)})}He(e){const n=e.targetId,r=e.me.count,i=this.Je(n);if(i){const s=i.target;if(oI(s))if(r===0){const o=new Zt(s.path);this.Ue(n,o,gs.newNoDocument(o,un.min()))}else Mr(r===1);else{const o=this.Ye(n);if(o!==r){const a=this.Ze(e),l=a?this.Xe(a,e,o):1;if(l!==0){this.je(n);const c=l===2?"TargetPurposeExistenceFilterMismatchBloom":"TargetPurposeExistenceFilterMismatch";this.Qe=this.Qe.insert(n,c)}}}}}Ze(e){const n=e.me.unchangedNames;if(!n||!n.bits)return null;const{bits:{bitmap:r="",padding:i=0},hashCount:s=0}=n;let o,a;try{o=bd(r).toUint8Array()}catch(l){if(l instanceof aH)return Xp("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 c3(o,i,s)}catch(l){return Xp(l instanceof hg?"BloomFilter error: ":"Applying bloom filter failed: ",l),null}return a.Ie===0?null:a}Xe(e,n,r){return n.me.count===r-this.nt(e,n.targetId)?0:2}nt(e,n){const r=this.Le.getRemoteKeysForTarget(n);let i=0;return r.forEach(s=>{const o=this.Le.tt(),a=`projects/${o.projectId}/databases/${o.database}/documents/${s.path.canonicalString()}`;e.mightContain(a)||(this.Ue(n,s,null),i++)}),i}rt(e){const n=new Map;this.Be.forEach((s,o)=>{const a=this.Je(o);if(a){if(s.current&&oI(a.target)){const l=new Zt(a.target.path);this.ke.get(l)!==null||this.it(o,l)||this.Ue(o,l,gs.newNoDocument(l,e))}s.be&&(n.set(o,s.Ce()),s.ve())}});let r=Un();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&&(r=r.add(s))}),this.ke.forEach((s,o)=>o.setReadTime(e));const i=new S2(e,n,this.Qe,this.ke,r);return this.ke=fc(),this.qe=BB(),this.Qe=new Or(ir),i}$e(e,n){if(!this.ze(e))return;const r=this.it(e,n.key)?2:0;this.Ge(e).Fe(n.key,r),this.ke=this.ke.insert(n.key,n),this.qe=this.qe.insert(n.key,this.st(n.key).add(e))}Ue(e,n,r){if(!this.ze(e))return;const i=this.Ge(e);this.it(e,n)?i.Fe(n,1):i.Me(n),this.qe=this.qe.insert(n,this.st(n).delete(e)),r&&(this.ke=this.ke.insert(n,r))}removeTarget(e){this.Be.delete(e)}Ye(e){const n=this.Ge(e).Ce();return this.Le.getRemoteKeysForTarget(e).size+n.addedDocuments.size-n.removedDocuments.size}xe(e){this.Ge(e).xe()}Ge(e){let n=this.Be.get(e);return n||(n=new kB,this.Be.set(e,n)),n}st(e){let n=this.qe.get(e);return n||(n=new Yi(ir),this.qe=this.qe.insert(e,n)),n}ze(e){const n=this.Je(e)!==null;return n||Wt("WatchChangeAggregator","Detected inactive target",e),n}Je(e){const n=this.Be.get(e);return n&&n.Se?null:this.Le.ot(e)}je(e){this.Be.set(e,new kB),this.Le.getRemoteKeysForTarget(e).forEach(n=>{this.Ue(e,n,null)})}it(e,n){return this.Le.getRemoteKeysForTarget(e).has(n)}}function BB(){return new Or(Zt.comparator)}function OB(){return new Or(Zt.comparator)}const Lhe={asc:"ASCENDING",desc:"DESCENDING"},Rhe={"<":"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"},Phe={and:"AND",or:"OR"};class Dhe{constructor(e,n){this.databaseId=e,this.useProto3Json=n}}function lI(t,e){return t.useProto3Json||g2(e)?e:{value:e}}function ZM(t,e){return t.useProto3Json?`${new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+e.nanoseconds).slice(-9)}Z`:{seconds:""+e.seconds,nanos:e.nanoseconds}}function PH(t,e){return t.useProto3Json?e.toBase64():e.toUint8Array()}function Nhe(t,e){return ZM(t,e.toTimestamp())}function ll(t){return Mr(!!t),un.fromTimestamp(function(n){const r=xu(n);return new _i(r.seconds,r.nanos)}(t))}function u3(t,e){return cI(t,e).canonicalString()}function cI(t,e){const n=function(i){return new wr(["projects",i.projectId,"databases",i.database])}(t).child("documents");return e===void 0?n:n.child(e)}function DH(t){const e=wr.fromString(t);return Mr(UH(e)),e}function uI(t,e){return u3(t.databaseId,e.path)}function yE(t,e){const n=DH(e);if(n.get(1)!==t.databaseId.projectId)throw new Rt(Xe.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+n.get(1)+" vs "+t.databaseId.projectId);if(n.get(3)!==t.databaseId.database)throw new Rt(Xe.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+n.get(3)+" vs "+t.databaseId.database);return new Zt(kH(n))}function NH(t,e){return u3(t.databaseId,e)}function khe(t){const e=DH(t);return e.length===4?wr.emptyPath():kH(e)}function fI(t){return new wr(["projects",t.databaseId.projectId,"databases",t.databaseId.database]).canonicalString()}function kH(t){return Mr(t.length>4&&t.get(4)==="documents"),t.popFirst(5)}function UB(t,e,n){return{name:uI(t,e),fields:n.value.mapValue.fields}}function Bhe(t,e){let n;if("targetChange"in e){e.targetChange;const r=function(c){return c==="NO_CHANGE"?0:c==="ADD"?1:c==="REMOVE"?2:c==="CURRENT"?3:c==="RESET"?4:an()}(e.targetChange.targetChangeType||"NO_CHANGE"),i=e.targetChange.targetIds||[],s=function(c,u){return c.useProto3Json?(Mr(u===void 0||typeof u=="string"),ws.fromBase64String(u||"")):(Mr(u===void 0||u instanceof Buffer||u instanceof Uint8Array),ws.fromUint8Array(u||new Uint8Array))}(t,e.targetChange.resumeToken),o=e.targetChange.cause,a=o&&function(c){const u=c.code===void 0?Xe.UNKNOWN:IH(c.code);return new Rt(u,c.message||"")}(o);n=new RH(r,i,s,a||null)}else if("documentChange"in e){e.documentChange;const r=e.documentChange;r.document,r.document.name,r.document.updateTime;const i=yE(t,r.document.name),s=ll(r.document.updateTime),o=r.document.createTime?ll(r.document.createTime):un.min(),a=new Ws({mapValue:{fields:r.document.fields}}),l=gs.newFoundDocument(i,s,o,a),c=r.targetIds||[],u=r.removedTargetIds||[];n=new $_(c,u,l.key,l)}else if("documentDelete"in e){e.documentDelete;const r=e.documentDelete;r.document;const i=yE(t,r.document),s=r.readTime?ll(r.readTime):un.min(),o=gs.newNoDocument(i,s),a=r.removedTargetIds||[];n=new $_([],a,o.key,o)}else if("documentRemove"in e){e.documentRemove;const r=e.documentRemove;r.document;const i=yE(t,r.document),s=r.removedTargetIds||[];n=new $_([],s,i,null)}else{if(!("filter"in e))return an();{e.filter;const r=e.filter;r.targetId;const{count:i=0,unchangedNames:s}=r,o=new Che(i,s),a=r.targetId;n=new LH(a,o)}}return n}function Ohe(t,e){let n;if(e instanceof wv)n={update:UB(t,e.key,e.value)};else if(e instanceof b2)n={delete:uI(t,e.key)};else if(e instanceof zu)n={update:UB(t,e.key,e.data),updateMask:$he(e.fieldMask)};else{if(!(e instanceof xhe))return an();n={verify:uI(t,e.key)}}return e.fieldTransforms.length>0&&(n.updateTransforms=e.fieldTransforms.map(r=>function(s,o){const a=o.transform;if(a instanceof XM)return{fieldPath:o.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(a instanceof tm)return{fieldPath:o.field.canonicalString(),appendMissingElements:{values:a.elements}};if(a instanceof nm)return{fieldPath:o.field.canonicalString(),removeAllFromArray:{values:a.elements}};if(a instanceof KM)return{fieldPath:o.field.canonicalString(),increment:a.Pe};throw an()}(0,r))),e.precondition.isNone||(n.currentDocument=function(i,s){return s.updateTime!==void 0?{updateTime:Nhe(i,s.updateTime)}:s.exists!==void 0?{exists:s.exists}:an()}(t,e.precondition)),n}function Uhe(t,e){return t&&t.length>0?(Mr(e!==void 0),t.map(n=>function(i,s){let o=i.updateTime?ll(i.updateTime):ll(s);return o.isEqual(un.min())&&(o=ll(s)),new whe(o,i.transformResults||[])}(n,e))):[]}function Fhe(t,e){return{documents:[NH(t,e.path)]}}function jhe(t,e){const n={structuredQuery:{}},r=e.path;let i;e.collectionGroup!==null?(i=r,n.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(i=r.popLast(),n.structuredQuery.from=[{collectionId:r.lastSegment()}]),n.parent=NH(t,i);const s=function(c){if(c.length!==0)return OH(Ua.create(c,"and"))}(e.filters);s&&(n.structuredQuery.where=s);const o=function(c){if(c.length!==0)return c.map(u=>function(h){return{field:Yh(h.field),direction:Ghe(h.dir)}}(u))}(e.orderBy);o&&(n.structuredQuery.orderBy=o);const a=lI(t,e.limit);return a!==null&&(n.structuredQuery.limit=a),e.startAt&&(n.structuredQuery.startAt=function(c){return{before:c.inclusive,values:c.position}}(e.startAt)),e.endAt&&(n.structuredQuery.endAt=function(c){return{before:!c.inclusive,values:c.position}}(e.endAt)),{_t:n,parent:i}}function zhe(t){let e=khe(t.parent);const n=t.structuredQuery,r=n.from?n.from.length:0;let i=null;if(r>0){Mr(r===1);const u=n.from[0];u.allDescendants?i=u.collectionId:e=e.child(u.collectionId)}let s=[];n.where&&(s=function(f){const h=BH(f);return h instanceof Ua&&fH(h)?h.getFilters():[h]}(n.where));let o=[];n.orderBy&&(o=function(f){return f.map(h=>function(v){return new C1(Qh(v.field),function(y){switch(y){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(v.direction))}(h))}(n.orderBy));let a=null;n.limit&&(a=function(f){let h;return h=typeof f=="object"?f.value:f,g2(h)?null:h}(n.limit));let l=null;n.startAt&&(l=function(f){const h=!!f.before,m=f.values||[];return new em(m,h)}(n.startAt));let c=null;return n.endAt&&(c=function(f){const h=!f.before,m=f.values||[];return new em(m,h)}(n.endAt)),ohe(e,i,o,s,a,"F",l,c)}function Hhe(t,e){const n=function(i){switch(i){case"TargetPurposeListen":return null;case"TargetPurposeExistenceFilterMismatch":return"existence-filter-mismatch";case"TargetPurposeExistenceFilterMismatchBloom":return"existence-filter-mismatch-bloom";case"TargetPurposeLimboResolution":return"limbo-document";default:return an()}}(e.purpose);return n==null?null:{"goog-listen-tags":n}}function BH(t){return t.unaryFilter!==void 0?function(n){switch(n.unaryFilter.op){case"IS_NAN":const r=Qh(n.unaryFilter.field);return yi.create(r,"==",{doubleValue:NaN});case"IS_NULL":const i=Qh(n.unaryFilter.field);return yi.create(i,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":const s=Qh(n.unaryFilter.field);return yi.create(s,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const o=Qh(n.unaryFilter.field);return yi.create(o,"!=",{nullValue:"NULL_VALUE"});default:return an()}}(t):t.fieldFilter!==void 0?function(n){return yi.create(Qh(n.fieldFilter.field),function(i){switch(i){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 an()}}(n.fieldFilter.op),n.fieldFilter.value)}(t):t.compositeFilter!==void 0?function(n){return Ua.create(n.compositeFilter.filters.map(r=>BH(r)),function(i){switch(i){case"AND":return"and";case"OR":return"or";default:return an()}}(n.compositeFilter.op))}(t):an()}function Ghe(t){return Lhe[t]}function Vhe(t){return Rhe[t]}function Whe(t){return Phe[t]}function Yh(t){return{fieldPath:t.canonicalString()}}function Qh(t){return $i.fromServerFormat(t.fieldPath)}function OH(t){return t instanceof yi?function(n){if(n.op==="=="){if(SB(n.value))return{unaryFilter:{field:Yh(n.field),op:"IS_NAN"}};if(bB(n.value))return{unaryFilter:{field:Yh(n.field),op:"IS_NULL"}}}else if(n.op==="!="){if(SB(n.value))return{unaryFilter:{field:Yh(n.field),op:"IS_NOT_NAN"}};if(bB(n.value))return{unaryFilter:{field:Yh(n.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:Yh(n.field),op:Vhe(n.op),value:n.value}}}(t):t instanceof Ua?function(n){const r=n.getFilters().map(i=>OH(i));return r.length===1?r[0]:{compositeFilter:{op:Whe(n.op),filters:r}}}(t):an()}function $he(t){const e=[];return t.fields.forEach(n=>e.push(n.canonicalString())),{fieldPaths:e}}function UH(t){return t.length>=4&&t.get(0)==="projects"&&t.get(2)==="databases"}/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 ru{constructor(e,n,r,i,s=un.min(),o=un.min(),a=ws.EMPTY_BYTE_STRING,l=null){this.target=e,this.targetId=n,this.purpose=r,this.sequenceNumber=i,this.snapshotVersion=s,this.lastLimboFreeSnapshotVersion=o,this.resumeToken=a,this.expectedCount=l}withSequenceNumber(e){return new ru(this.target,this.targetId,this.purpose,e,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,this.expectedCount)}withResumeToken(e,n){return new ru(this.target,this.targetId,this.purpose,this.sequenceNumber,n,this.lastLimboFreeSnapshotVersion,e,null)}withExpectedCount(e){return new ru(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,e)}withLastLimboFreeSnapshotVersion(e){return new ru(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,e,this.resumeToken,this.expectedCount)}}/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Jhe{constructor(e){this.ct=e}}function Yhe(t){const e=zhe({parent:t.parent,structuredQuery:t.structuredQuery});return t.limitType==="LAST"?QM(e,e.limit,"L"):e}/**
+ * @license
+ * Copyright 2019 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Qhe{constructor(){this._n=new Xhe}addToCollectionParentIndex(e,n){return this._n.add(n),dt.resolve()}getCollectionParents(e,n){return dt.resolve(this._n.getEntries(n))}addFieldIndex(e,n){return dt.resolve()}deleteFieldIndex(e,n){return dt.resolve()}deleteAllFieldIndexes(e){return dt.resolve()}createTargetIndexes(e,n){return dt.resolve()}getDocumentsMatchingTarget(e,n){return dt.resolve(null)}getIndexType(e,n){return dt.resolve(0)}getFieldIndexes(e,n){return dt.resolve([])}getNextCollectionGroupToUpdate(e){return dt.resolve(null)}getMinOffset(e,n){return dt.resolve(Mu.min())}getMinOffsetFromCollectionGroup(e,n){return dt.resolve(Mu.min())}updateCollectionGroup(e,n,r){return dt.resolve()}updateIndexEntries(e,n){return dt.resolve()}}class Xhe{constructor(){this.index={}}add(e){const n=e.lastSegment(),r=e.popLast(),i=this.index[n]||new Yi(wr.comparator),s=!i.has(r);return this.index[n]=i.add(r),s}has(e){const n=e.lastSegment(),r=e.popLast(),i=this.index[n];return i&&i.has(r)}getEntries(e){return(this.index[e]||new Yi(wr.comparator)).toArray()}}/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 rm{constructor(e){this.On=e}next(){return this.On+=2,this.On}static Nn(){return new rm(0)}static Ln(){return new rm(-1)}}/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Khe{constructor(){this.changes=new Pm(e=>e.toString(),(e,n)=>e.isEqual(n)),this.changesApplied=!1}addEntry(e){this.assertNotApplied(),this.changes.set(e.key,e)}removeEntry(e,n){this.assertNotApplied(),this.changes.set(e,gs.newInvalidDocument(e).setReadTime(n))}getEntry(e,n){this.assertNotApplied();const r=this.changes.get(n);return r!==void 0?dt.resolve(r):this.getFromCache(e,n)}getEntries(e,n){return this.getAllFromCache(e,n)}apply(e){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(e)}assertNotApplied(){}}/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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.
+ *//**
+ * @license
+ * Copyright 2022 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Zhe{constructor(e,n){this.overlayedDocument=e,this.mutatedFields=n}}/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 qhe{constructor(e,n,r,i){this.remoteDocumentCache=e,this.mutationQueue=n,this.documentOverlayCache=r,this.indexManager=i}getDocument(e,n){let r=null;return this.documentOverlayCache.getOverlay(e,n).next(i=>(r=i,this.remoteDocumentCache.getEntry(e,n))).next(i=>(r!==null&&Bg(r.mutation,i,wo.empty(),_i.now()),i))}getDocuments(e,n){return this.remoteDocumentCache.getEntries(e,n).next(r=>this.getLocalViewOfDocuments(e,r,Un()).next(()=>r))}getLocalViewOfDocuments(e,n,r=Un()){const i=Wf();return this.populateOverlays(e,i,n).next(()=>this.computeViews(e,n,i,r).next(s=>{let o=dg();return s.forEach((a,l)=>{o=o.insert(a,l.overlayedDocument)}),o}))}getOverlayedDocuments(e,n){const r=Wf();return this.populateOverlays(e,r,n).next(()=>this.computeViews(e,n,r,Un()))}populateOverlays(e,n,r){const i=[];return r.forEach(s=>{n.has(s)||i.push(s)}),this.documentOverlayCache.getOverlays(e,i).next(s=>{s.forEach((o,a)=>{n.set(o,a)})})}computeViews(e,n,r,i){let s=fc();const o=kg(),a=function(){return kg()}();return n.forEach((l,c)=>{const u=r.get(c.key);i.has(c.key)&&(u===void 0||u.mutation instanceof zu)?s=s.insert(c.key,c):u!==void 0?(o.set(c.key,u.mutation.getFieldMask()),Bg(u.mutation,c,u.mutation.getFieldMask(),_i.now())):o.set(c.key,wo.empty())}),this.recalculateAndSaveOverlays(e,s).next(l=>(l.forEach((c,u)=>o.set(c,u)),n.forEach((c,u)=>{var f;return a.set(c,new Zhe(u,(f=o.get(c))!==null&&f!==void 0?f:null))}),a))}recalculateAndSaveOverlays(e,n){const r=kg();let i=new Or((o,a)=>o-a),s=Un();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,n).next(o=>{for(const a of o)a.keys().forEach(l=>{const c=n.get(l);if(c===null)return;let u=r.get(l)||wo.empty();u=a.applyToLocalView(c,u),r.set(l,u);const f=(i.get(a.batchId)||Un()).add(l);i=i.insert(a.batchId,f)})}).next(()=>{const o=[],a=i.getReverseIterator();for(;a.hasNext();){const l=a.getNext(),c=l.key,u=l.value,f=wH();u.forEach(h=>{if(!s.has(h)){const m=AH(n.get(h),r.get(h));m!==null&&f.set(h,m),s=s.add(h)}}),o.push(this.documentOverlayCache.saveOverlays(e,c,f))}return dt.waitFor(o)}).next(()=>r)}recalculateAndSaveOverlaysForDocumentKeys(e,n){return this.remoteDocumentCache.getEntries(e,n).next(r=>this.recalculateAndSaveOverlays(e,r))}getDocumentsMatchingQuery(e,n,r,i){return function(o){return Zt.isDocumentKey(o.path)&&o.collectionGroup===null&&o.filters.length===0}(n)?this.getDocumentsMatchingDocumentQuery(e,n.path):a3(n)?this.getDocumentsMatchingCollectionGroupQuery(e,n,r,i):this.getDocumentsMatchingCollectionQuery(e,n,r,i)}getNextDocuments(e,n,r,i){return this.remoteDocumentCache.getAllFromCollectionGroup(e,n,r,i).next(s=>{const o=i-s.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(e,n,r.largestBatchId,i-s.size):dt.resolve(Wf());let a=-1,l=s;return o.next(c=>dt.forEach(c,(u,f)=>(a{l=l.insert(u,h)}))).next(()=>this.populateOverlays(e,c,s)).next(()=>this.computeViews(e,l,c,Un())).next(u=>({batchId:a,changes:yH(u)})))})}getDocumentsMatchingDocumentQuery(e,n){return this.getDocument(e,new Zt(n)).next(r=>{let i=dg();return r.isFoundDocument()&&(i=i.insert(r.key,r)),i})}getDocumentsMatchingCollectionGroupQuery(e,n,r,i){const s=n.collectionGroup;let o=dg();return this.indexManager.getCollectionParents(e,s).next(a=>dt.forEach(a,l=>{const c=function(f,h){return new Ud(h,null,f.explicitOrderBy.slice(),f.filters.slice(),f.limit,f.limitType,f.startAt,f.endAt)}(n,l.child(s));return this.getDocumentsMatchingCollectionQuery(e,c,r,i).next(u=>{u.forEach((f,h)=>{o=o.insert(f,h)})})}).next(()=>o))}getDocumentsMatchingCollectionQuery(e,n,r,i){let s;return this.documentOverlayCache.getOverlaysForCollection(e,n.path,r.largestBatchId).next(o=>(s=o,this.remoteDocumentCache.getDocumentsMatchingQuery(e,n,r,s,i))).next(o=>{s.forEach((l,c)=>{const u=c.getKey();o.get(u)===null&&(o=o.insert(u,gs.newInvalidDocument(u)))});let a=dg();return o.forEach((l,c)=>{const u=s.get(l);u!==void 0&&Bg(u.mutation,c,wo.empty(),_i.now()),_2(n,c)&&(a=a.insert(l,c))}),a})}}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 epe{constructor(e){this.serializer=e,this.cr=new Map,this.lr=new Map}getBundleMetadata(e,n){return dt.resolve(this.cr.get(n))}saveBundleMetadata(e,n){return this.cr.set(n.id,function(i){return{id:i.id,version:i.version,createTime:ll(i.createTime)}}(n)),dt.resolve()}getNamedQuery(e,n){return dt.resolve(this.lr.get(n))}saveNamedQuery(e,n){return this.lr.set(n.name,function(i){return{name:i.name,query:Yhe(i.bundledQuery),readTime:ll(i.readTime)}}(n)),dt.resolve()}}/**
+ * @license
+ * Copyright 2022 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 tpe{constructor(){this.overlays=new Or(Zt.comparator),this.hr=new Map}getOverlay(e,n){return dt.resolve(this.overlays.get(n))}getOverlays(e,n){const r=Wf();return dt.forEach(n,i=>this.getOverlay(e,i).next(s=>{s!==null&&r.set(i,s)})).next(()=>r)}saveOverlays(e,n,r){return r.forEach((i,s)=>{this.ht(e,n,s)}),dt.resolve()}removeOverlaysForBatchId(e,n,r){const i=this.hr.get(r);return i!==void 0&&(i.forEach(s=>this.overlays=this.overlays.remove(s)),this.hr.delete(r)),dt.resolve()}getOverlaysForCollection(e,n,r){const i=Wf(),s=n.length+1,o=new Zt(n.child("")),a=this.overlays.getIteratorFrom(o);for(;a.hasNext();){const l=a.getNext().value,c=l.getKey();if(!n.isPrefixOf(c.path))break;c.path.length===s&&l.largestBatchId>r&&i.set(l.getKey(),l)}return dt.resolve(i)}getOverlaysForCollectionGroup(e,n,r,i){let s=new Or((c,u)=>c-u);const o=this.overlays.getIterator();for(;o.hasNext();){const c=o.getNext().value;if(c.getKey().getCollectionGroup()===n&&c.largestBatchId>r){let u=s.get(c.largestBatchId);u===null&&(u=Wf(),s=s.insert(c.largestBatchId,u)),u.set(c.getKey(),c)}}const a=Wf(),l=s.getIterator();for(;l.hasNext()&&(l.getNext().value.forEach((c,u)=>a.set(c,u)),!(a.size()>=i)););return dt.resolve(a)}ht(e,n,r){const i=this.overlays.get(r.key);if(i!==null){const o=this.hr.get(i.largestBatchId).delete(r.key);this.hr.set(i.largestBatchId,o)}this.overlays=this.overlays.insert(r.key,new She(n,r));let s=this.hr.get(n);s===void 0&&(s=Un(),this.hr.set(n,s)),this.hr.set(n,s.add(r.key))}}/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 f3{constructor(){this.Pr=new Yi(ki.Ir),this.Tr=new Yi(ki.Er)}isEmpty(){return this.Pr.isEmpty()}addReference(e,n){const r=new ki(e,n);this.Pr=this.Pr.add(r),this.Tr=this.Tr.add(r)}dr(e,n){e.forEach(r=>this.addReference(r,n))}removeReference(e,n){this.Ar(new ki(e,n))}Rr(e,n){e.forEach(r=>this.removeReference(r,n))}Vr(e){const n=new Zt(new wr([])),r=new ki(n,e),i=new ki(n,e+1),s=[];return this.Tr.forEachInRange([r,i],o=>{this.Ar(o),s.push(o.key)}),s}mr(){this.Pr.forEach(e=>this.Ar(e))}Ar(e){this.Pr=this.Pr.delete(e),this.Tr=this.Tr.delete(e)}gr(e){const n=new Zt(new wr([])),r=new ki(n,e),i=new ki(n,e+1);let s=Un();return this.Tr.forEachInRange([r,i],o=>{s=s.add(o.key)}),s}containsKey(e){const n=new ki(e,0),r=this.Pr.firstAfterOrEqual(n);return r!==null&&e.isEqual(r.key)}}class ki{constructor(e,n){this.key=e,this.pr=n}static Ir(e,n){return Zt.comparator(e.key,n.key)||ir(e.pr,n.pr)}static Er(e,n){return ir(e.pr,n.pr)||Zt.comparator(e.key,n.key)}}/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 npe{constructor(e,n){this.indexManager=e,this.referenceDelegate=n,this.mutationQueue=[],this.yr=1,this.wr=new Yi(ki.Ir)}checkEmpty(e){return dt.resolve(this.mutationQueue.length===0)}addMutationBatch(e,n,r,i){const s=this.yr;this.yr++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];const o=new bhe(s,n,r,i);this.mutationQueue.push(o);for(const a of i)this.wr=this.wr.add(new ki(a.key,s)),this.indexManager.addToCollectionParentIndex(e,a.key.path.popLast());return dt.resolve(o)}lookupMutationBatch(e,n){return dt.resolve(this.Sr(n))}getNextMutationBatchAfterBatchId(e,n){const r=n+1,i=this.br(r),s=i<0?0:i;return dt.resolve(this.mutationQueue.length>s?this.mutationQueue[s]:null)}getHighestUnacknowledgedBatchId(){return dt.resolve(this.mutationQueue.length===0?-1:this.yr-1)}getAllMutationBatches(e){return dt.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(e,n){const r=new ki(n,0),i=new ki(n,Number.POSITIVE_INFINITY),s=[];return this.wr.forEachInRange([r,i],o=>{const a=this.Sr(o.pr);s.push(a)}),dt.resolve(s)}getAllMutationBatchesAffectingDocumentKeys(e,n){let r=new Yi(ir);return n.forEach(i=>{const s=new ki(i,0),o=new ki(i,Number.POSITIVE_INFINITY);this.wr.forEachInRange([s,o],a=>{r=r.add(a.pr)})}),dt.resolve(this.Dr(r))}getAllMutationBatchesAffectingQuery(e,n){const r=n.path,i=r.length+1;let s=r;Zt.isDocumentKey(s)||(s=s.child(""));const o=new ki(new Zt(s),0);let a=new Yi(ir);return this.wr.forEachWhile(l=>{const c=l.key.path;return!!r.isPrefixOf(c)&&(c.length===i&&(a=a.add(l.pr)),!0)},o),dt.resolve(this.Dr(a))}Dr(e){const n=[];return e.forEach(r=>{const i=this.Sr(r);i!==null&&n.push(i)}),n}removeMutationBatch(e,n){Mr(this.Cr(n.batchId,"removed")===0),this.mutationQueue.shift();let r=this.wr;return dt.forEach(n.mutations,i=>{const s=new ki(i.key,n.batchId);return r=r.delete(s),this.referenceDelegate.markPotentiallyOrphaned(e,i.key)}).next(()=>{this.wr=r})}Mn(e){}containsKey(e,n){const r=new ki(n,0),i=this.wr.firstAfterOrEqual(r);return dt.resolve(n.isEqual(i&&i.key))}performConsistencyCheck(e){return this.mutationQueue.length,dt.resolve()}Cr(e,n){return this.br(e)}br(e){return this.mutationQueue.length===0?0:e-this.mutationQueue[0].batchId}Sr(e){const n=this.br(e);return n<0||n>=this.mutationQueue.length?null:this.mutationQueue[n]}}/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 rpe{constructor(e){this.vr=e,this.docs=function(){return new Or(Zt.comparator)}(),this.size=0}setIndexManager(e){this.indexManager=e}addEntry(e,n){const r=n.key,i=this.docs.get(r),s=i?i.size:0,o=this.vr(n);return this.docs=this.docs.insert(r,{document:n.mutableCopy(),size:o}),this.size+=o-s,this.indexManager.addToCollectionParentIndex(e,r.path.popLast())}removeEntry(e){const n=this.docs.get(e);n&&(this.docs=this.docs.remove(e),this.size-=n.size)}getEntry(e,n){const r=this.docs.get(n);return dt.resolve(r?r.document.mutableCopy():gs.newInvalidDocument(n))}getEntries(e,n){let r=fc();return n.forEach(i=>{const s=this.docs.get(i);r=r.insert(i,s?s.document.mutableCopy():gs.newInvalidDocument(i))}),dt.resolve(r)}getDocumentsMatchingQuery(e,n,r,i){let s=fc();const o=n.path,a=new Zt(o.child("")),l=this.docs.getIteratorFrom(a);for(;l.hasNext();){const{key:c,value:{document:u}}=l.getNext();if(!o.isPrefixOf(c.path))break;c.path.length>o.length+1||Hde(zde(u),r)<=0||(i.has(u.key)||_2(n,u))&&(s=s.insert(u.key,u.mutableCopy()))}return dt.resolve(s)}getAllFromCollectionGroup(e,n,r,i){an()}Fr(e,n){return dt.forEach(this.docs,r=>n(r))}newChangeBuffer(e){return new ipe(this)}getSize(e){return dt.resolve(this.size)}}class ipe extends Khe{constructor(e){super(),this.ar=e}applyChanges(e){const n=[];return this.changes.forEach((r,i)=>{i.isValidDocument()?n.push(this.ar.addEntry(e,i)):this.ar.removeEntry(r)}),dt.waitFor(n)}getFromCache(e,n){return this.ar.getEntry(e,n)}getAllFromCache(e,n){return this.ar.getEntries(e,n)}}/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 spe{constructor(e){this.persistence=e,this.Mr=new Pm(n=>s3(n),o3),this.lastRemoteSnapshotVersion=un.min(),this.highestTargetId=0,this.Or=0,this.Nr=new f3,this.targetCount=0,this.Lr=rm.Nn()}forEachTarget(e,n){return this.Mr.forEach((r,i)=>n(i)),dt.resolve()}getLastRemoteSnapshotVersion(e){return dt.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(e){return dt.resolve(this.Or)}allocateTargetId(e){return this.highestTargetId=this.Lr.next(),dt.resolve(this.highestTargetId)}setTargetsMetadata(e,n,r){return r&&(this.lastRemoteSnapshotVersion=r),n>this.Or&&(this.Or=n),dt.resolve()}qn(e){this.Mr.set(e.target,e);const n=e.targetId;n>this.highestTargetId&&(this.Lr=new rm(n),this.highestTargetId=n),e.sequenceNumber>this.Or&&(this.Or=e.sequenceNumber)}addTargetData(e,n){return this.qn(n),this.targetCount+=1,dt.resolve()}updateTargetData(e,n){return this.qn(n),dt.resolve()}removeTargetData(e,n){return this.Mr.delete(n.target),this.Nr.Vr(n.targetId),this.targetCount-=1,dt.resolve()}removeTargets(e,n,r){let i=0;const s=[];return this.Mr.forEach((o,a)=>{a.sequenceNumber<=n&&r.get(a.targetId)===null&&(this.Mr.delete(o),s.push(this.removeMatchingKeysForTargetId(e,a.targetId)),i++)}),dt.waitFor(s).next(()=>i)}getTargetCount(e){return dt.resolve(this.targetCount)}getTargetData(e,n){const r=this.Mr.get(n)||null;return dt.resolve(r)}addMatchingKeys(e,n,r){return this.Nr.dr(n,r),dt.resolve()}removeMatchingKeys(e,n,r){this.Nr.Rr(n,r);const i=this.persistence.referenceDelegate,s=[];return i&&n.forEach(o=>{s.push(i.markPotentiallyOrphaned(e,o))}),dt.waitFor(s)}removeMatchingKeysForTargetId(e,n){return this.Nr.Vr(n),dt.resolve()}getMatchingKeysForTargetId(e,n){const r=this.Nr.gr(n);return dt.resolve(r)}containsKey(e,n){return dt.resolve(this.Nr.containsKey(n))}}/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 ope{constructor(e,n){this.Br={},this.overlays={},this.kr=new n3(0),this.qr=!1,this.qr=!0,this.referenceDelegate=e(this),this.Qr=new spe(this),this.indexManager=new Qhe,this.remoteDocumentCache=function(i){return new rpe(i)}(r=>this.referenceDelegate.Kr(r)),this.serializer=new Jhe(n),this.$r=new epe(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.qr=!1,Promise.resolve()}get started(){return this.qr}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(e){return this.indexManager}getDocumentOverlayCache(e){let n=this.overlays[e.toKey()];return n||(n=new tpe,this.overlays[e.toKey()]=n),n}getMutationQueue(e,n){let r=this.Br[e.toKey()];return r||(r=new npe(n,this.referenceDelegate),this.Br[e.toKey()]=r),r}getTargetCache(){return this.Qr}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.$r}runTransaction(e,n,r){Wt("MemoryPersistence","Starting transaction:",e);const i=new ape(this.kr.next());return this.referenceDelegate.Ur(),r(i).next(s=>this.referenceDelegate.Wr(i).next(()=>s)).toPromise().then(s=>(i.raiseOnCommittedEvent(),s))}Gr(e,n){return dt.or(Object.values(this.Br).map(r=>()=>r.containsKey(e,n)))}}class ape extends Vde{constructor(e){super(),this.currentSequenceNumber=e}}class d3{constructor(e){this.persistence=e,this.zr=new f3,this.jr=null}static Hr(e){return new d3(e)}get Jr(){if(this.jr)return this.jr;throw an()}addReference(e,n,r){return this.zr.addReference(r,n),this.Jr.delete(r.toString()),dt.resolve()}removeReference(e,n,r){return this.zr.removeReference(r,n),this.Jr.add(r.toString()),dt.resolve()}markPotentiallyOrphaned(e,n){return this.Jr.add(n.toString()),dt.resolve()}removeTarget(e,n){this.zr.Vr(n.targetId).forEach(i=>this.Jr.add(i.toString()));const r=this.persistence.getTargetCache();return r.getMatchingKeysForTargetId(e,n.targetId).next(i=>{i.forEach(s=>this.Jr.add(s.toString()))}).next(()=>r.removeTargetData(e,n))}Ur(){this.jr=new Set}Wr(e){const n=this.persistence.getRemoteDocumentCache().newChangeBuffer();return dt.forEach(this.Jr,r=>{const i=Zt.fromPath(r);return this.Yr(e,i).next(s=>{s||n.removeEntry(i,un.min())})}).next(()=>(this.jr=null,n.apply(e)))}updateLimboDocument(e,n){return this.Yr(e,n).next(r=>{r?this.Jr.delete(n.toString()):this.Jr.add(n.toString())})}Kr(e){return 0}Yr(e,n){return dt.or([()=>dt.resolve(this.zr.containsKey(n)),()=>this.persistence.getTargetCache().containsKey(e,n),()=>this.persistence.Gr(e,n)])}}/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 h3{constructor(e,n,r,i){this.targetId=e,this.fromCache=n,this.qi=r,this.Qi=i}static Ki(e,n){let r=Un(),i=Un();for(const s of n.docChanges)switch(s.type){case 0:r=r.add(s.doc.key);break;case 1:i=i.add(s.doc.key)}return new h3(e,n.fromCache,r,i)}}/**
+ * @license
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 lpe{constructor(){this._documentReadCount=0}get documentReadCount(){return this._documentReadCount}incrementDocumentReadCount(e){this._documentReadCount+=e}}/**
+ * @license
+ * Copyright 2019 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 cpe{constructor(){this.$i=!1,this.Ui=!1,this.Wi=100,this.Gi=function(){return qle()?8:Wde(Ki())>0?6:4}()}initialize(e,n){this.zi=e,this.indexManager=n,this.$i=!0}getDocumentsMatchingQuery(e,n,r,i){const s={result:null};return this.ji(e,n).next(o=>{s.result=o}).next(()=>{if(!s.result)return this.Hi(e,n,i,r).next(o=>{s.result=o})}).next(()=>{if(s.result)return;const o=new lpe;return this.Ji(e,n,o).next(a=>{if(s.result=a,this.Ui)return this.Yi(e,n,o,a.size)})}).next(()=>s.result)}Yi(e,n,r,i){return r.documentReadCountthis.Gi*i?(D0()<=Gn.DEBUG&&Wt("QueryEngine","The SDK decides to create cache indexes for query:",Jh(n),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(e,al(n))):dt.resolve())}ji(e,n){if(TB(n))return dt.resolve(null);let r=al(n);return this.indexManager.getIndexType(e,r).next(i=>i===0?null:(n.limit!==null&&i===1&&(n=QM(n,null,"F"),r=al(n)),this.indexManager.getDocumentsMatchingTarget(e,r).next(s=>{const o=Un(...s);return this.zi.getDocuments(e,o).next(a=>this.indexManager.getMinOffset(e,r).next(l=>{const c=this.Zi(n,a);return this.Xi(n,c,o,l.readTime)?this.ji(e,QM(n,null,"F")):this.es(e,c,n,l)}))})))}Hi(e,n,r,i){return TB(n)||i.isEqual(un.min())?dt.resolve(null):this.zi.getDocuments(e,r).next(s=>{const o=this.Zi(n,s);return this.Xi(n,o,r,i)?dt.resolve(null):(D0()<=Gn.DEBUG&&Wt("QueryEngine","Re-using previous result from %s to execute query: %s",i.toString(),Jh(n)),this.es(e,o,n,jde(i,-1)).next(a=>a))})}Zi(e,n){let r=new Yi(gH(e));return n.forEach((i,s)=>{_2(e,s)&&(r=r.add(s))}),r}Xi(e,n,r,i){if(e.limit===null)return!1;if(r.size!==n.size)return!0;const s=e.limitType==="F"?n.last():n.first();return!!s&&(s.hasPendingWrites||s.version.compareTo(i)>0)}Ji(e,n,r){return D0()<=Gn.DEBUG&&Wt("QueryEngine","Using full collection scan to execute query:",Jh(n)),this.zi.getDocumentsMatchingQuery(e,n,Mu.min(),r)}es(e,n,r,i){return this.zi.getDocumentsMatchingQuery(e,r,i).next(s=>(n.forEach(o=>{s=s.insert(o.key,o)}),s))}}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 upe{constructor(e,n,r,i){this.persistence=e,this.ts=n,this.serializer=i,this.ns=new Or(ir),this.rs=new Pm(s=>s3(s),o3),this.ss=new Map,this.os=e.getRemoteDocumentCache(),this.Qr=e.getTargetCache(),this.$r=e.getBundleCache(),this._s(r)}_s(e){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(e),this.indexManager=this.persistence.getIndexManager(e),this.mutationQueue=this.persistence.getMutationQueue(e,this.indexManager),this.localDocuments=new qhe(this.os,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.os.setIndexManager(this.indexManager),this.ts.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",n=>e.collect(n,this.ns))}}function fpe(t,e,n,r){return new upe(t,e,n,r)}async function FH(t,e){const n=pn(t);return await n.persistence.runTransaction("Handle user change","readonly",r=>{let i;return n.mutationQueue.getAllMutationBatches(r).next(s=>(i=s,n._s(e),n.mutationQueue.getAllMutationBatches(r))).next(s=>{const o=[],a=[];let l=Un();for(const c of i){o.push(c.batchId);for(const u of c.mutations)l=l.add(u.key)}for(const c of s){a.push(c.batchId);for(const u of c.mutations)l=l.add(u.key)}return n.localDocuments.getDocuments(r,l).next(c=>({us:c,removedBatchIds:o,addedBatchIds:a}))})})}function dpe(t,e){const n=pn(t);return n.persistence.runTransaction("Acknowledge batch","readwrite-primary",r=>{const i=e.batch.keys(),s=n.os.newChangeBuffer({trackRemovals:!0});return function(a,l,c,u){const f=c.batch,h=f.keys();let m=dt.resolve();return h.forEach(v=>{m=m.next(()=>u.getEntry(l,v)).next(w=>{const y=c.docVersions.get(v);Mr(y!==null),w.version.compareTo(y)<0&&(f.applyToRemoteDocument(w,c),w.isValidDocument()&&(w.setReadTime(c.commitVersion),u.addEntry(w)))})}),m.next(()=>a.mutationQueue.removeMutationBatch(l,f))}(n,r,e,s).next(()=>s.apply(r)).next(()=>n.mutationQueue.performConsistencyCheck(r)).next(()=>n.documentOverlayCache.removeOverlaysForBatchId(r,i,e.batch.batchId)).next(()=>n.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(r,function(a){let l=Un();for(let c=0;c0&&(l=l.add(a.batch.mutations[c].key));return l}(e))).next(()=>n.localDocuments.getDocuments(r,i))})}function jH(t){const e=pn(t);return e.persistence.runTransaction("Get last remote snapshot version","readonly",n=>e.Qr.getLastRemoteSnapshotVersion(n))}function hpe(t,e){const n=pn(t),r=e.snapshotVersion;let i=n.ns;return n.persistence.runTransaction("Apply remote event","readwrite-primary",s=>{const o=n.os.newChangeBuffer({trackRemovals:!0});i=n.ns;const a=[];e.targetChanges.forEach((u,f)=>{const h=i.get(f);if(!h)return;a.push(n.Qr.removeMatchingKeys(s,u.removedDocuments,f).next(()=>n.Qr.addMatchingKeys(s,u.addedDocuments,f)));let m=h.withSequenceNumber(s.currentSequenceNumber);e.targetMismatches.get(f)!==null?m=m.withResumeToken(ws.EMPTY_BYTE_STRING,un.min()).withLastLimboFreeSnapshotVersion(un.min()):u.resumeToken.approximateByteSize()>0&&(m=m.withResumeToken(u.resumeToken,r)),i=i.insert(f,m),function(w,y,g){return w.resumeToken.approximateByteSize()===0||y.snapshotVersion.toMicroseconds()-w.snapshotVersion.toMicroseconds()>=3e8?!0:g.addedDocuments.size+g.modifiedDocuments.size+g.removedDocuments.size>0}(h,m,u)&&a.push(n.Qr.updateTargetData(s,m))});let l=fc(),c=Un();if(e.documentUpdates.forEach(u=>{e.resolvedLimboDocuments.has(u)&&a.push(n.persistence.referenceDelegate.updateLimboDocument(s,u))}),a.push(ppe(s,o,e.documentUpdates).next(u=>{l=u.cs,c=u.ls})),!r.isEqual(un.min())){const u=n.Qr.getLastRemoteSnapshotVersion(s).next(f=>n.Qr.setTargetsMetadata(s,s.currentSequenceNumber,r));a.push(u)}return dt.waitFor(a).next(()=>o.apply(s)).next(()=>n.localDocuments.getLocalViewOfDocuments(s,l,c)).next(()=>l)}).then(s=>(n.ns=i,s))}function ppe(t,e,n){let r=Un(),i=Un();return n.forEach(s=>r=r.add(s)),e.getEntries(t,r).next(s=>{let o=fc();return n.forEach((a,l)=>{const c=s.get(a);l.isFoundDocument()!==c.isFoundDocument()&&(i=i.add(a)),l.isNoDocument()&&l.version.isEqual(un.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)):Wt("LocalStore","Ignoring outdated watch update for ",a,". Current version:",c.version," Watch version:",l.version)}),{cs:o,ls:i}})}function mpe(t,e){const n=pn(t);return n.persistence.runTransaction("Get next mutation batch","readonly",r=>(e===void 0&&(e=-1),n.mutationQueue.getNextMutationBatchAfterBatchId(r,e)))}function gpe(t,e){const n=pn(t);return n.persistence.runTransaction("Allocate target","readwrite",r=>{let i;return n.Qr.getTargetData(r,e).next(s=>s?(i=s,dt.resolve(i)):n.Qr.allocateTargetId(r).next(o=>(i=new ru(e,o,"TargetPurposeListen",r.currentSequenceNumber),n.Qr.addTargetData(r,i).next(()=>i))))}).then(r=>{const i=n.ns.get(r.targetId);return(i===null||r.snapshotVersion.compareTo(i.snapshotVersion)>0)&&(n.ns=n.ns.insert(r.targetId,r),n.rs.set(e,r.targetId)),r})}async function dI(t,e,n){const r=pn(t),i=r.ns.get(e),s=n?"readwrite":"readwrite-primary";try{n||await r.persistence.runTransaction("Release target",s,o=>r.persistence.referenceDelegate.removeTarget(o,i))}catch(o){if(!yv(o))throw o;Wt("LocalStore",`Failed to update sequence numbers for target ${e}: ${o}`)}r.ns=r.ns.remove(e),r.rs.delete(i.target)}function FB(t,e,n){const r=pn(t);let i=un.min(),s=Un();return r.persistence.runTransaction("Execute query","readwrite",o=>function(l,c,u){const f=pn(l),h=f.rs.get(u);return h!==void 0?dt.resolve(f.ns.get(h)):f.Qr.getTargetData(c,u)}(r,o,al(e)).next(a=>{if(a)return i=a.lastLimboFreeSnapshotVersion,r.Qr.getMatchingKeysForTargetId(o,a.targetId).next(l=>{s=l})}).next(()=>r.ts.getDocumentsMatchingQuery(o,e,n?i:un.min(),n?s:Un())).next(a=>(vpe(r,lhe(e),a),{documents:a,hs:s})))}function vpe(t,e,n){let r=t.ss.get(e)||un.min();n.forEach((i,s)=>{s.readTime.compareTo(r)>0&&(r=s.readTime)}),t.ss.set(e,r)}class jB{constructor(){this.activeTargetIds=phe()}As(e){this.activeTargetIds=this.activeTargetIds.add(e)}Rs(e){this.activeTargetIds=this.activeTargetIds.delete(e)}ds(){const e={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(e)}}class ype{constructor(){this.no=new jB,this.ro={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,n,r){}addLocalQueryTarget(e){return this.no.As(e),this.ro[e]||"not-current"}updateQueryState(e,n,r){this.ro[e]=n}removeLocalQueryTarget(e){this.no.Rs(e)}isLocalQueryTarget(e){return this.no.activeTargetIds.has(e)}clearQueryState(e){delete this.ro[e]}getAllActiveQueryTargets(){return this.no.activeTargetIds}isActiveQueryTarget(e){return this.no.activeTargetIds.has(e)}start(){return this.no=new jB,Promise.resolve()}handleUserChange(e,n,r){}setOnlineState(e){}shutdown(){}writeSequenceNumber(e){}notifyBundleLoaded(e){}}/**
+ * @license
+ * Copyright 2019 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 wpe{io(e){}shutdown(){}}/**
+ * @license
+ * Copyright 2019 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 zB{constructor(){this.so=()=>this.oo(),this._o=()=>this.ao(),this.uo=[],this.co()}io(e){this.uo.push(e)}shutdown(){window.removeEventListener("online",this.so),window.removeEventListener("offline",this._o)}co(){window.addEventListener("online",this.so),window.addEventListener("offline",this._o)}oo(){Wt("ConnectivityMonitor","Network connectivity changed: AVAILABLE");for(const e of this.uo)e(0)}ao(){Wt("ConnectivityMonitor","Network connectivity changed: UNAVAILABLE");for(const e of this.uo)e(1)}static D(){return typeof window<"u"&&window.addEventListener!==void 0&&window.removeEventListener!==void 0}}/**
+ * @license
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 dw=null;function wE(){return dw===null?dw=function(){return 268435456+Math.round(2147483648*Math.random())}():dw++,"0x"+dw.toString(16)}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 _pe={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregationQuery:"runAggregationQuery"};/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Mpe{constructor(e){this.lo=e.lo,this.ho=e.ho}Po(e){this.Io=e}To(e){this.Eo=e}Ao(e){this.Ro=e}onMessage(e){this.Vo=e}close(){this.ho()}send(e){this.lo(e)}mo(){this.Io()}fo(){this.Eo()}po(e){this.Ro(e)}yo(e){this.Vo(e)}}/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 cs="WebChannelConnection";class xpe extends class{constructor(n){this.databaseInfo=n,this.databaseId=n.databaseId;const r=n.ssl?"https":"http",i=encodeURIComponent(this.databaseId.projectId),s=encodeURIComponent(this.databaseId.database);this.wo=r+"://"+n.host,this.So=`projects/${i}/databases/${s}`,this.bo=this.databaseId.database==="(default)"?`project_id=${i}`:`project_id=${i}&database_id=${s}`}get Do(){return!1}Co(n,r,i,s,o){const a=wE(),l=this.vo(n,r.toUriEncodedString());Wt("RestConnection",`Sending RPC '${n}' ${a}:`,l,i);const c={"google-cloud-resource-prefix":this.So,"x-goog-request-params":this.bo};return this.Fo(c,s,o),this.Mo(n,l,c,i).then(u=>(Wt("RestConnection",`Received RPC '${n}' ${a}: `,u),u),u=>{throw Xp("RestConnection",`RPC '${n}' ${a} failed with error: `,u,"url: ",l,"request:",i),u})}xo(n,r,i,s,o,a){return this.Co(n,r,i,s,o)}Fo(n,r,i){n["X-Goog-Api-Client"]=function(){return"gl-js/ fire/"+Rm}(),n["Content-Type"]="text/plain",this.databaseInfo.appId&&(n["X-Firebase-GMPID"]=this.databaseInfo.appId),r&&r.headers.forEach((s,o)=>n[o]=s),i&&i.headers.forEach((s,o)=>n[o]=s)}vo(n,r){const i=_pe[n];return`${this.wo}/v1/${r}:${i}`}terminate(){}}{constructor(e){super(e),this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams,this.longPollingOptions=e.longPollingOptions}Mo(e,n,r,i){const s=wE();return new Promise((o,a)=>{const l=new Z8;l.setWithCredentials(!0),l.listenOnce(eH.COMPLETE,()=>{try{switch(l.getLastErrorCode()){case G_.NO_ERROR:const u=l.getResponseJson();Wt(cs,`XHR for RPC '${e}' ${s} received:`,JSON.stringify(u)),o(u);break;case G_.TIMEOUT:Wt(cs,`RPC '${e}' ${s} timed out`),a(new Rt(Xe.DEADLINE_EXCEEDED,"Request time out"));break;case G_.HTTP_ERROR:const f=l.getStatus();if(Wt(cs,`RPC '${e}' ${s} failed with status:`,f,"response text:",l.getResponseText()),f>0){let h=l.getResponseJson();Array.isArray(h)&&(h=h[0]);const m=h==null?void 0:h.error;if(m&&m.status&&m.message){const v=function(y){const g=y.toLowerCase().replace(/_/g,"-");return Object.values(Xe).indexOf(g)>=0?g:Xe.UNKNOWN}(m.status);a(new Rt(v,m.message))}else a(new Rt(Xe.UNKNOWN,"Server responded with status "+l.getStatus()))}else a(new Rt(Xe.UNAVAILABLE,"Connection failed."));break;default:an()}}finally{Wt(cs,`RPC '${e}' ${s} completed.`)}});const c=JSON.stringify(i);Wt(cs,`RPC '${e}' ${s} sending request:`,i),l.send(n,"POST",c,r,15)})}Oo(e,n,r){const i=wE(),s=[this.wo,"/","google.firestore.v1.Firestore","/",e,"/channel"],o=rH(),a=nH(),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.xmlHttpFactory=new q8({})),this.Fo(l.initMessageHeaders,n,r),l.encodeInitMessageHeaders=!0;const u=s.join("");Wt(cs,`Creating RPC '${e}' stream ${i}: ${u}`,l);const f=o.createWebChannel(u,l);let h=!1,m=!1;const v=new Mpe({lo:y=>{m?Wt(cs,`Not sending because RPC '${e}' stream ${i} is closed:`,y):(h||(Wt(cs,`Opening RPC '${e}' stream ${i} transport.`),f.open(),h=!0),Wt(cs,`RPC '${e}' stream ${i} sending:`,y),f.send(y))},ho:()=>f.close()}),w=(y,g,_)=>{y.listen(g,x=>{try{_(x)}catch(S){setTimeout(()=>{throw S},0)}})};return w(f,fg.EventType.OPEN,()=>{m||(Wt(cs,`RPC '${e}' stream ${i} transport opened.`),v.mo())}),w(f,fg.EventType.CLOSE,()=>{m||(m=!0,Wt(cs,`RPC '${e}' stream ${i} transport closed`),v.po())}),w(f,fg.EventType.ERROR,y=>{m||(m=!0,Xp(cs,`RPC '${e}' stream ${i} transport errored:`,y),v.po(new Rt(Xe.UNAVAILABLE,"The operation could not be completed")))}),w(f,fg.EventType.MESSAGE,y=>{var g;if(!m){const _=y.data[0];Mr(!!_);const x=_,S=x.error||((g=x[0])===null||g===void 0?void 0:g.error);if(S){Wt(cs,`RPC '${e}' stream ${i} received error:`,S);const D=S.status;let T=function(C){const L=hi[C];if(L!==void 0)return IH(L)}(D),E=S.message;T===void 0&&(T=Xe.INTERNAL,E="Unknown error status: "+D+" with message "+S.message),m=!0,v.po(new Rt(T,E)),f.close()}else Wt(cs,`RPC '${e}' stream ${i} received:`,_),v.yo(_)}}),w(a,tH.STAT_EVENT,y=>{y.stat===nI.PROXY?Wt(cs,`RPC '${e}' stream ${i} detected buffering proxy`):y.stat===nI.NOPROXY&&Wt(cs,`RPC '${e}' stream ${i} detected no buffering proxy`)}),setTimeout(()=>{v.fo()},0),v}}function _E(){return typeof document<"u"?document:null}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 C2(t){return new Dhe(t,!0)}/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 zH{constructor(e,n,r=1e3,i=1.5,s=6e4){this.oi=e,this.timerId=n,this.No=r,this.Lo=i,this.Bo=s,this.ko=0,this.qo=null,this.Qo=Date.now(),this.reset()}reset(){this.ko=0}Ko(){this.ko=this.Bo}$o(e){this.cancel();const n=Math.floor(this.ko+this.Uo()),r=Math.max(0,Date.now()-this.Qo),i=Math.max(0,n-r);i>0&&Wt("ExponentialBackoff",`Backing off for ${i} ms (base delay: ${this.ko} ms, delay with jitter: ${n} ms, last attempt: ${r} ms ago)`),this.qo=this.oi.enqueueAfterDelay(this.timerId,i,()=>(this.Qo=Date.now(),e())),this.ko*=this.Lo,this.kothis.Bo&&(this.ko=this.Bo)}Wo(){this.qo!==null&&(this.qo.skipDelay(),this.qo=null)}cancel(){this.qo!==null&&(this.qo.cancel(),this.qo=null)}Uo(){return(Math.random()-.5)*this.ko}}/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 HH{constructor(e,n,r,i,s,o,a,l){this.oi=e,this.Go=r,this.zo=i,this.connection=s,this.authCredentialsProvider=o,this.appCheckCredentialsProvider=a,this.listener=l,this.state=0,this.jo=0,this.Ho=null,this.Jo=null,this.stream=null,this.Yo=new zH(e,n)}Zo(){return this.state===1||this.state===5||this.Xo()}Xo(){return this.state===2||this.state===3}start(){this.state!==4?this.auth():this.e_()}async stop(){this.Zo()&&await this.close(0)}t_(){this.state=0,this.Yo.reset()}n_(){this.Xo()&&this.Ho===null&&(this.Ho=this.oi.enqueueAfterDelay(this.Go,6e4,()=>this.r_()))}i_(e){this.s_(),this.stream.send(e)}async r_(){if(this.Xo())return this.close(0)}s_(){this.Ho&&(this.Ho.cancel(),this.Ho=null)}o_(){this.Jo&&(this.Jo.cancel(),this.Jo=null)}async close(e,n){this.s_(),this.o_(),this.Yo.cancel(),this.jo++,e!==4?this.Yo.reset():n&&n.code===Xe.RESOURCE_EXHAUSTED?(uc(n.toString()),uc("Using maximum backoff delay to prevent overloading the backend."),this.Yo.Ko()):n&&n.code===Xe.UNAUTHENTICATED&&this.state!==3&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),this.stream!==null&&(this.__(),this.stream.close(),this.stream=null),this.state=e,await this.listener.Ao(n)}__(){}auth(){this.state=1;const e=this.a_(this.jo),n=this.jo;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then(([r,i])=>{this.jo===n&&this.u_(r,i)},r=>{e(()=>{const i=new Rt(Xe.UNKNOWN,"Fetching auth token failed: "+r.message);return this.c_(i)})})}u_(e,n){const r=this.a_(this.jo);this.stream=this.l_(e,n),this.stream.Po(()=>{r(()=>this.listener.Po())}),this.stream.To(()=>{r(()=>(this.state=2,this.Jo=this.oi.enqueueAfterDelay(this.zo,1e4,()=>(this.Xo()&&(this.state=3),Promise.resolve())),this.listener.To()))}),this.stream.Ao(i=>{r(()=>this.c_(i))}),this.stream.onMessage(i=>{r(()=>this.onMessage(i))})}e_(){this.state=5,this.Yo.$o(async()=>{this.state=0,this.start()})}c_(e){return Wt("PersistentStream",`close with error: ${e}`),this.stream=null,this.close(4,e)}a_(e){return n=>{this.oi.enqueueAndForget(()=>this.jo===e?n():(Wt("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve()))}}}class bpe extends HH{constructor(e,n,r,i,s,o){super(e,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",n,r,i,o),this.serializer=s}l_(e,n){return this.connection.Oo("Listen",e,n)}onMessage(e){this.Yo.reset();const n=Bhe(this.serializer,e),r=function(s){if(!("targetChange"in s))return un.min();const o=s.targetChange;return o.targetIds&&o.targetIds.length?un.min():o.readTime?ll(o.readTime):un.min()}(e);return this.listener.h_(n,r)}P_(e){const n={};n.database=fI(this.serializer),n.addTarget=function(s,o){let a;const l=o.target;if(a=oI(l)?{documents:Fhe(s,l)}:{query:jhe(s,l)._t},a.targetId=o.targetId,o.resumeToken.approximateByteSize()>0){a.resumeToken=PH(s,o.resumeToken);const c=lI(s,o.expectedCount);c!==null&&(a.expectedCount=c)}else if(o.snapshotVersion.compareTo(un.min())>0){a.readTime=ZM(s,o.snapshotVersion.toTimestamp());const c=lI(s,o.expectedCount);c!==null&&(a.expectedCount=c)}return a}(this.serializer,e);const r=Hhe(this.serializer,e);r&&(n.labels=r),this.i_(n)}I_(e){const n={};n.database=fI(this.serializer),n.removeTarget=e,this.i_(n)}}class Spe extends HH{constructor(e,n,r,i,s,o){super(e,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",n,r,i,o),this.serializer=s,this.T_=!1}get E_(){return this.T_}start(){this.T_=!1,this.lastStreamToken=void 0,super.start()}__(){this.T_&&this.d_([])}l_(e,n){return this.connection.Oo("Write",e,n)}onMessage(e){if(Mr(!!e.streamToken),this.lastStreamToken=e.streamToken,this.T_){this.Yo.reset();const n=Uhe(e.writeResults,e.commitTime),r=ll(e.commitTime);return this.listener.A_(r,n)}return Mr(!e.writeResults||e.writeResults.length===0),this.T_=!0,this.listener.R_()}V_(){const e={};e.database=fI(this.serializer),this.i_(e)}d_(e){const n={streamToken:this.lastStreamToken,writes:e.map(r=>Ohe(this.serializer,r))};this.i_(n)}}/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Cpe extends class{}{constructor(e,n,r,i){super(),this.authCredentials=e,this.appCheckCredentials=n,this.connection=r,this.serializer=i,this.m_=!1}f_(){if(this.m_)throw new Rt(Xe.FAILED_PRECONDITION,"The client has already been terminated.")}Co(e,n,r,i){return this.f_(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([s,o])=>this.connection.Co(e,cI(n,r),i,s,o)).catch(s=>{throw s.name==="FirebaseError"?(s.code===Xe.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),s):new Rt(Xe.UNKNOWN,s.toString())})}xo(e,n,r,i,s){return this.f_(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([o,a])=>this.connection.xo(e,cI(n,r),i,o,a,s)).catch(o=>{throw o.name==="FirebaseError"?(o.code===Xe.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),o):new Rt(Xe.UNKNOWN,o.toString())})}terminate(){this.m_=!0,this.connection.terminate()}}class Epe{constructor(e,n){this.asyncQueue=e,this.onlineStateHandler=n,this.state="Unknown",this.g_=0,this.p_=null,this.y_=!0}w_(){this.g_===0&&(this.S_("Unknown"),this.p_=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,()=>(this.p_=null,this.b_("Backend didn't respond within 10 seconds."),this.S_("Offline"),Promise.resolve())))}D_(e){this.state==="Online"?this.S_("Unknown"):(this.g_++,this.g_>=1&&(this.C_(),this.b_(`Connection failed 1 times. Most recent error: ${e.toString()}`),this.S_("Offline")))}set(e){this.C_(),this.g_=0,e==="Online"&&(this.y_=!1),this.S_(e)}S_(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))}b_(e){const n=`Could not reach Cloud Firestore backend. ${e}
+This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.`;this.y_?(uc(n),this.y_=!1):Wt("OnlineStateTracker",n)}C_(){this.p_!==null&&(this.p_.cancel(),this.p_=null)}}/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Ape{constructor(e,n,r,i,s){this.localStore=e,this.datastore=n,this.asyncQueue=r,this.remoteSyncer={},this.v_=[],this.F_=new Map,this.M_=new Set,this.x_=[],this.O_=s,this.O_.io(o=>{r.enqueueAndForget(async()=>{Fd(this)&&(Wt("RemoteStore","Restarting streams for network reachability change."),await async function(l){const c=pn(l);c.M_.add(4),await Mv(c),c.N_.set("Unknown"),c.M_.delete(4),await E2(c)}(this))})}),this.N_=new Epe(r,i)}}async function E2(t){if(Fd(t))for(const e of t.x_)await e(!0)}async function Mv(t){for(const e of t.x_)await e(!1)}function GH(t,e){const n=pn(t);n.F_.has(e.targetId)||(n.F_.set(e.targetId,e),v3(n)?g3(n):Dm(n).Xo()&&m3(n,e))}function p3(t,e){const n=pn(t),r=Dm(n);n.F_.delete(e),r.Xo()&&VH(n,e),n.F_.size===0&&(r.Xo()?r.n_():Fd(n)&&n.N_.set("Unknown"))}function m3(t,e){if(t.L_.xe(e.targetId),e.resumeToken.approximateByteSize()>0||e.snapshotVersion.compareTo(un.min())>0){const n=t.remoteSyncer.getRemoteKeysForTarget(e.targetId).size;e=e.withExpectedCount(n)}Dm(t).P_(e)}function VH(t,e){t.L_.xe(e),Dm(t).I_(e)}function g3(t){t.L_=new Ihe({getRemoteKeysForTarget:e=>t.remoteSyncer.getRemoteKeysForTarget(e),ot:e=>t.F_.get(e)||null,tt:()=>t.datastore.serializer.databaseId}),Dm(t).start(),t.N_.w_()}function v3(t){return Fd(t)&&!Dm(t).Zo()&&t.F_.size>0}function Fd(t){return pn(t).M_.size===0}function WH(t){t.L_=void 0}async function Tpe(t){t.N_.set("Online")}async function Ipe(t){t.F_.forEach((e,n)=>{m3(t,e)})}async function Lpe(t,e){WH(t),v3(t)?(t.N_.D_(e),g3(t)):t.N_.set("Unknown")}async function Rpe(t,e,n){if(t.N_.set("Online"),e instanceof RH&&e.state===2&&e.cause)try{await async function(i,s){const o=s.cause;for(const a of s.targetIds)i.F_.has(a)&&(await i.remoteSyncer.rejectListen(a,o),i.F_.delete(a),i.L_.removeTarget(a))}(t,e)}catch(r){Wt("RemoteStore","Failed to remove targets %s: %s ",e.targetIds.join(","),r),await qM(t,r)}else if(e instanceof $_?t.L_.Ke(e):e instanceof LH?t.L_.He(e):t.L_.We(e),!n.isEqual(un.min()))try{const r=await jH(t.localStore);n.compareTo(r)>=0&&await function(s,o){const a=s.L_.rt(o);return a.targetChanges.forEach((l,c)=>{if(l.resumeToken.approximateByteSize()>0){const u=s.F_.get(c);u&&s.F_.set(c,u.withResumeToken(l.resumeToken,o))}}),a.targetMismatches.forEach((l,c)=>{const u=s.F_.get(l);if(!u)return;s.F_.set(l,u.withResumeToken(ws.EMPTY_BYTE_STRING,u.snapshotVersion)),VH(s,l);const f=new ru(u.target,l,c,u.sequenceNumber);m3(s,f)}),s.remoteSyncer.applyRemoteEvent(a)}(t,n)}catch(r){Wt("RemoteStore","Failed to raise snapshot:",r),await qM(t,r)}}async function qM(t,e,n){if(!yv(e))throw e;t.M_.add(1),await Mv(t),t.N_.set("Offline"),n||(n=()=>jH(t.localStore)),t.asyncQueue.enqueueRetryable(async()=>{Wt("RemoteStore","Retrying IndexedDB access"),await n(),t.M_.delete(1),await E2(t)})}function $H(t,e){return e().catch(n=>qM(t,n,e))}async function A2(t){const e=pn(t),n=bu(e);let r=e.v_.length>0?e.v_[e.v_.length-1].batchId:-1;for(;Ppe(e);)try{const i=await mpe(e.localStore,r);if(i===null){e.v_.length===0&&n.n_();break}r=i.batchId,Dpe(e,i)}catch(i){await qM(e,i)}JH(e)&&YH(e)}function Ppe(t){return Fd(t)&&t.v_.length<10}function Dpe(t,e){t.v_.push(e);const n=bu(t);n.Xo()&&n.E_&&n.d_(e.mutations)}function JH(t){return Fd(t)&&!bu(t).Zo()&&t.v_.length>0}function YH(t){bu(t).start()}async function Npe(t){bu(t).V_()}async function kpe(t){const e=bu(t);for(const n of t.v_)e.d_(n.mutations)}async function Bpe(t,e,n){const r=t.v_.shift(),i=l3.from(r,e,n);await $H(t,()=>t.remoteSyncer.applySuccessfulWrite(i)),await A2(t)}async function Ope(t,e){e&&bu(t).E_&&await async function(r,i){if(function(o){return Ehe(o)&&o!==Xe.ABORTED}(i.code)){const s=r.v_.shift();bu(r).t_(),await $H(r,()=>r.remoteSyncer.rejectFailedWrite(s.batchId,i)),await A2(r)}}(t,e),JH(t)&&YH(t)}async function HB(t,e){const n=pn(t);n.asyncQueue.verifyOperationInProgress(),Wt("RemoteStore","RemoteStore received new credentials");const r=Fd(n);n.M_.add(3),await Mv(n),r&&n.N_.set("Unknown"),await n.remoteSyncer.handleCredentialChange(e),n.M_.delete(3),await E2(n)}async function Upe(t,e){const n=pn(t);e?(n.M_.delete(2),await E2(n)):e||(n.M_.add(2),await Mv(n),n.N_.set("Unknown"))}function Dm(t){return t.B_||(t.B_=function(n,r,i){const s=pn(n);return s.f_(),new bpe(r,s.connection,s.authCredentials,s.appCheckCredentials,s.serializer,i)}(t.datastore,t.asyncQueue,{Po:Tpe.bind(null,t),To:Ipe.bind(null,t),Ao:Lpe.bind(null,t),h_:Rpe.bind(null,t)}),t.x_.push(async e=>{e?(t.B_.t_(),v3(t)?g3(t):t.N_.set("Unknown")):(await t.B_.stop(),WH(t))})),t.B_}function bu(t){return t.k_||(t.k_=function(n,r,i){const s=pn(n);return s.f_(),new Spe(r,s.connection,s.authCredentials,s.appCheckCredentials,s.serializer,i)}(t.datastore,t.asyncQueue,{Po:()=>Promise.resolve(),To:Npe.bind(null,t),Ao:Ope.bind(null,t),R_:kpe.bind(null,t),A_:Bpe.bind(null,t)}),t.x_.push(async e=>{e?(t.k_.t_(),await A2(t)):(await t.k_.stop(),t.v_.length>0&&(Wt("RemoteStore",`Stopping write stream with ${t.v_.length} pending writes`),t.v_=[]))})),t.k_}/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 y3{constructor(e,n,r,i,s){this.asyncQueue=e,this.timerId=n,this.targetTimeMs=r,this.op=i,this.removalCallback=s,this.deferred=new ec,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(o=>{})}get promise(){return this.deferred.promise}static createAndSchedule(e,n,r,i,s){const o=Date.now()+r,a=new y3(e,n,o,i,s);return a.start(r),a}start(e){this.timerHandle=setTimeout(()=>this.handleDelayElapsed(),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){this.timerHandle!==null&&(this.clearTimeout(),this.deferred.reject(new Rt(Xe.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 w3(t,e){if(uc("AsyncQueue",`${e}: ${t}`),yv(t))return new Rt(Xe.UNAVAILABLE,`${e}: ${t}`);throw t}/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Tp{constructor(e){this.comparator=e?(n,r)=>e(n,r)||Zt.comparator(n.key,r.key):(n,r)=>Zt.comparator(n.key,r.key),this.keyedMap=dg(),this.sortedSet=new Or(this.comparator)}static emptySet(e){return new Tp(e.comparator)}has(e){return this.keyedMap.get(e)!=null}get(e){return this.keyedMap.get(e)}first(){return this.sortedSet.minKey()}last(){return this.sortedSet.maxKey()}isEmpty(){return this.sortedSet.isEmpty()}indexOf(e){const n=this.keyedMap.get(e);return n?this.sortedSet.indexOf(n):-1}get size(){return this.sortedSet.size}forEach(e){this.sortedSet.inorderTraversal((n,r)=>(e(n),!1))}add(e){const n=this.delete(e.key);return n.copy(n.keyedMap.insert(e.key,e),n.sortedSet.insert(e,null))}delete(e){const n=this.get(e);return n?this.copy(this.keyedMap.remove(e),this.sortedSet.remove(n)):this}isEqual(e){if(!(e instanceof Tp)||this.size!==e.size)return!1;const n=this.sortedSet.getIterator(),r=e.sortedSet.getIterator();for(;n.hasNext();){const i=n.getNext().key,s=r.getNext().key;if(!i.isEqual(s))return!1}return!0}toString(){const e=[];return this.forEach(n=>{e.push(n.toString())}),e.length===0?"DocumentSet ()":`DocumentSet (
+ `+e.join(`
+`)+`
+)`}copy(e,n){const r=new Tp;return r.comparator=this.comparator,r.keyedMap=e,r.sortedSet=n,r}}/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 GB{constructor(){this.q_=new Or(Zt.comparator)}track(e){const n=e.doc.key,r=this.q_.get(n);r?e.type!==0&&r.type===3?this.q_=this.q_.insert(n,e):e.type===3&&r.type!==1?this.q_=this.q_.insert(n,{type:r.type,doc:e.doc}):e.type===2&&r.type===2?this.q_=this.q_.insert(n,{type:2,doc:e.doc}):e.type===2&&r.type===0?this.q_=this.q_.insert(n,{type:0,doc:e.doc}):e.type===1&&r.type===0?this.q_=this.q_.remove(n):e.type===1&&r.type===2?this.q_=this.q_.insert(n,{type:1,doc:r.doc}):e.type===0&&r.type===1?this.q_=this.q_.insert(n,{type:2,doc:e.doc}):an():this.q_=this.q_.insert(n,e)}Q_(){const e=[];return this.q_.inorderTraversal((n,r)=>{e.push(r)}),e}}class im{constructor(e,n,r,i,s,o,a,l,c){this.query=e,this.docs=n,this.oldDocs=r,this.docChanges=i,this.mutatedKeys=s,this.fromCache=o,this.syncStateChanged=a,this.excludesMetadataChanges=l,this.hasCachedResults=c}static fromInitialDocuments(e,n,r,i,s){const o=[];return n.forEach(a=>{o.push({type:0,doc:a})}),new im(e,n,Tp.emptySet(n),o,r,i,!0,!1,s)}get hasPendingWrites(){return!this.mutatedKeys.isEmpty()}isEqual(e){if(!(this.fromCache===e.fromCache&&this.hasCachedResults===e.hasCachedResults&&this.syncStateChanged===e.syncStateChanged&&this.mutatedKeys.isEqual(e.mutatedKeys)&&w2(this.query,e.query)&&this.docs.isEqual(e.docs)&&this.oldDocs.isEqual(e.oldDocs)))return!1;const n=this.docChanges,r=e.docChanges;if(n.length!==r.length)return!1;for(let i=0;ie.G_())}}class jpe{constructor(){this.queries=new Pm(e=>mH(e),w2),this.onlineState="Unknown",this.z_=new Set}}async function _3(t,e){const n=pn(t);let r=3;const i=e.query;let s=n.queries.get(i);s?!s.W_()&&e.G_()&&(r=2):(s=new Fpe,r=e.G_()?0:1);try{switch(r){case 0:s.K_=await n.onListen(i,!0);break;case 1:s.K_=await n.onListen(i,!1);break;case 2:await n.onFirstRemoteStoreListen(i)}}catch(o){const a=w3(o,`Initialization of query '${Jh(e.query)}' failed`);return void e.onError(a)}n.queries.set(i,s),s.U_.push(e),e.j_(n.onlineState),s.K_&&e.H_(s.K_)&&x3(n)}async function M3(t,e){const n=pn(t),r=e.query;let i=3;const s=n.queries.get(r);if(s){const o=s.U_.indexOf(e);o>=0&&(s.U_.splice(o,1),s.U_.length===0?i=e.G_()?0:1:!s.W_()&&e.G_()&&(i=2))}switch(i){case 0:return n.queries.delete(r),n.onUnlisten(r,!0);case 1:return n.queries.delete(r),n.onUnlisten(r,!1);case 2:return n.onLastRemoteStoreUnlisten(r);default:return}}function zpe(t,e){const n=pn(t);let r=!1;for(const i of e){const s=i.query,o=n.queries.get(s);if(o){for(const a of o.U_)a.H_(i)&&(r=!0);o.K_=i}}r&&x3(n)}function Hpe(t,e,n){const r=pn(t),i=r.queries.get(e);if(i)for(const s of i.U_)s.onError(n);r.queries.delete(e)}function x3(t){t.z_.forEach(e=>{e.next()})}var hI,VB;(VB=hI||(hI={})).J_="default",VB.Cache="cache";class b3{constructor(e,n,r){this.query=e,this.Y_=n,this.Z_=!1,this.X_=null,this.onlineState="Unknown",this.options=r||{}}H_(e){if(!this.options.includeMetadataChanges){const r=[];for(const i of e.docChanges)i.type!==3&&r.push(i);e=new im(e.query,e.docs,e.oldDocs,r,e.mutatedKeys,e.fromCache,e.syncStateChanged,!0,e.hasCachedResults)}let n=!1;return this.Z_?this.ea(e)&&(this.Y_.next(e),n=!0):this.ta(e,this.onlineState)&&(this.na(e),n=!0),this.X_=e,n}onError(e){this.Y_.error(e)}j_(e){this.onlineState=e;let n=!1;return this.X_&&!this.Z_&&this.ta(this.X_,e)&&(this.na(this.X_),n=!0),n}ta(e,n){if(!e.fromCache||!this.G_())return!0;const r=n!=="Offline";return(!this.options.ra||!r)&&(!e.docs.isEmpty()||e.hasCachedResults||n==="Offline")}ea(e){if(e.docChanges.length>0)return!0;const n=this.X_&&this.X_.hasPendingWrites!==e.hasPendingWrites;return!(!e.syncStateChanged&&!n)&&this.options.includeMetadataChanges===!0}na(e){e=im.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache,e.hasCachedResults),this.Z_=!0,this.Y_.next(e)}G_(){return this.options.source!==hI.Cache}}/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 QH{constructor(e){this.key=e}}class XH{constructor(e){this.key=e}}class Gpe{constructor(e,n){this.query=e,this.la=n,this.ha=null,this.hasCachedResults=!1,this.current=!1,this.Pa=Un(),this.mutatedKeys=Un(),this.Ia=gH(e),this.Ta=new Tp(this.Ia)}get Ea(){return this.la}da(e,n){const r=n?n.Aa:new GB,i=n?n.Ta:this.Ta;let s=n?n.mutatedKeys:this.mutatedKeys,o=i,a=!1;const l=this.query.limitType==="F"&&i.size===this.query.limit?i.last():null,c=this.query.limitType==="L"&&i.size===this.query.limit?i.first():null;if(e.inorderTraversal((u,f)=>{const h=i.get(u),m=_2(this.query,f)?f:null,v=!!h&&this.mutatedKeys.has(h.key),w=!!m&&(m.hasLocalMutations||this.mutatedKeys.has(m.key)&&m.hasCommittedMutations);let y=!1;h&&m?h.data.isEqual(m.data)?v!==w&&(r.track({type:3,doc:m}),y=!0):this.Ra(h,m)||(r.track({type:2,doc:m}),y=!0,(l&&this.Ia(m,l)>0||c&&this.Ia(m,c)<0)&&(a=!0)):!h&&m?(r.track({type:0,doc:m}),y=!0):h&&!m&&(r.track({type:1,doc:h}),y=!0,(l||c)&&(a=!0)),y&&(m?(o=o.add(m),s=w?s.add(u):s.delete(u)):(o=o.delete(u),s=s.delete(u)))}),this.query.limit!==null)for(;o.size>this.query.limit;){const u=this.query.limitType==="F"?o.last():o.first();o=o.delete(u.key),s=s.delete(u.key),r.track({type:1,doc:u})}return{Ta:o,Aa:r,Xi:a,mutatedKeys:s}}Ra(e,n){return e.hasLocalMutations&&n.hasCommittedMutations&&!n.hasLocalMutations}applyChanges(e,n,r,i){const s=this.Ta;this.Ta=e.Ta,this.mutatedKeys=e.mutatedKeys;const o=e.Aa.Q_();o.sort((u,f)=>function(m,v){const w=y=>{switch(y){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return an()}};return w(m)-w(v)}(u.type,f.type)||this.Ia(u.doc,f.doc)),this.Va(r),i=i!=null&&i;const a=n&&!i?this.ma():[],l=this.Pa.size===0&&this.current&&!i?1:0,c=l!==this.ha;return this.ha=l,o.length!==0||c?{snapshot:new im(this.query,e.Ta,s,o,e.mutatedKeys,l===0,c,!1,!!r&&r.resumeToken.approximateByteSize()>0),fa:a}:{fa:a}}j_(e){return this.current&&e==="Offline"?(this.current=!1,this.applyChanges({Ta:this.Ta,Aa:new GB,mutatedKeys:this.mutatedKeys,Xi:!1},!1)):{fa:[]}}ga(e){return!this.la.has(e)&&!!this.Ta.has(e)&&!this.Ta.get(e).hasLocalMutations}Va(e){e&&(e.addedDocuments.forEach(n=>this.la=this.la.add(n)),e.modifiedDocuments.forEach(n=>{}),e.removedDocuments.forEach(n=>this.la=this.la.delete(n)),this.current=e.current)}ma(){if(!this.current)return[];const e=this.Pa;this.Pa=Un(),this.Ta.forEach(r=>{this.ga(r.key)&&(this.Pa=this.Pa.add(r.key))});const n=[];return e.forEach(r=>{this.Pa.has(r)||n.push(new XH(r))}),this.Pa.forEach(r=>{e.has(r)||n.push(new QH(r))}),n}pa(e){this.la=e.hs,this.Pa=Un();const n=this.da(e.documents);return this.applyChanges(n,!0)}ya(){return im.fromInitialDocuments(this.query,this.Ta,this.mutatedKeys,this.ha===0,this.hasCachedResults)}}class Vpe{constructor(e,n,r){this.query=e,this.targetId=n,this.view=r}}class Wpe{constructor(e){this.key=e,this.wa=!1}}class $pe{constructor(e,n,r,i,s,o){this.localStore=e,this.remoteStore=n,this.eventManager=r,this.sharedClientState=i,this.currentUser=s,this.maxConcurrentLimboResolutions=o,this.Sa={},this.ba=new Pm(a=>mH(a),w2),this.Da=new Map,this.Ca=new Set,this.va=new Or(Zt.comparator),this.Fa=new Map,this.Ma=new f3,this.xa={},this.Oa=new Map,this.Na=rm.Ln(),this.onlineState="Unknown",this.La=void 0}get isPrimaryClient(){return this.La===!0}}async function Jpe(t,e,n=!0){const r=nG(t);let i;const s=r.ba.get(e);return s?(r.sharedClientState.addLocalQueryTarget(s.targetId),i=s.view.ya()):i=await KH(r,e,n,!0),i}async function Ype(t,e){const n=nG(t);await KH(n,e,!0,!1)}async function KH(t,e,n,r){const i=await gpe(t.localStore,al(e)),s=i.targetId,o=n?t.sharedClientState.addLocalQueryTarget(s):"not-current";let a;return r&&(a=await Qpe(t,e,s,o==="current",i.resumeToken)),t.isPrimaryClient&&n&&GH(t.remoteStore,i),a}async function Qpe(t,e,n,r,i){t.Ba=(f,h,m)=>async function(w,y,g,_){let x=y.view.da(g);x.Xi&&(x=await FB(w.localStore,y.query,!1).then(({documents:E})=>y.view.da(E,x)));const S=_&&_.targetChanges.get(y.targetId),D=_&&_.targetMismatches.get(y.targetId)!=null,T=y.view.applyChanges(x,w.isPrimaryClient,S,D);return $B(w,y.targetId,T.fa),T.snapshot}(t,f,h,m);const s=await FB(t.localStore,e,!0),o=new Gpe(e,s.hs),a=o.da(s.documents),l=_v.createSynthesizedTargetChangeForCurrentChange(n,r&&t.onlineState!=="Offline",i),c=o.applyChanges(a,t.isPrimaryClient,l);$B(t,n,c.fa);const u=new Vpe(e,n,o);return t.ba.set(e,u),t.Da.has(n)?t.Da.get(n).push(e):t.Da.set(n,[e]),c.snapshot}async function Xpe(t,e,n){const r=pn(t),i=r.ba.get(e),s=r.Da.get(i.targetId);if(s.length>1)return r.Da.set(i.targetId,s.filter(o=>!w2(o,e))),void r.ba.delete(e);r.isPrimaryClient?(r.sharedClientState.removeLocalQueryTarget(i.targetId),r.sharedClientState.isActiveQueryTarget(i.targetId)||await dI(r.localStore,i.targetId,!1).then(()=>{r.sharedClientState.clearQueryState(i.targetId),n&&p3(r.remoteStore,i.targetId),pI(r,i.targetId)}).catch(vv)):(pI(r,i.targetId),await dI(r.localStore,i.targetId,!0))}async function Kpe(t,e){const n=pn(t),r=n.ba.get(e),i=n.Da.get(r.targetId);n.isPrimaryClient&&i.length===1&&(n.sharedClientState.removeLocalQueryTarget(r.targetId),p3(n.remoteStore,r.targetId))}async function Zpe(t,e,n){const r=sme(t);try{const i=await function(o,a){const l=pn(o),c=_i.now(),u=a.reduce((m,v)=>m.add(v.key),Un());let f,h;return l.persistence.runTransaction("Locally write mutations","readwrite",m=>{let v=fc(),w=Un();return l.os.getEntries(m,u).next(y=>{v=y,v.forEach((g,_)=>{_.isValidDocument()||(w=w.add(g))})}).next(()=>l.localDocuments.getOverlayedDocuments(m,v)).next(y=>{f=y;const g=[];for(const _ of a){const x=Mhe(_,f.get(_.key).overlayedDocument);x!=null&&g.push(new zu(_.key,x,lH(x.value.mapValue),Ns.exists(!0)))}return l.mutationQueue.addMutationBatch(m,c,g,a)}).next(y=>{h=y;const g=y.applyToLocalDocumentSet(f,w);return l.documentOverlayCache.saveOverlays(m,y.batchId,g)})}).then(()=>({batchId:h.batchId,changes:yH(f)}))}(r.localStore,e);r.sharedClientState.addPendingMutation(i.batchId),function(o,a,l){let c=o.xa[o.currentUser.toKey()];c||(c=new Or(ir)),c=c.insert(a,l),o.xa[o.currentUser.toKey()]=c}(r,i.batchId,n),await xv(r,i.changes),await A2(r.remoteStore)}catch(i){const s=w3(i,"Failed to persist write");n.reject(s)}}async function ZH(t,e){const n=pn(t);try{const r=await hpe(n.localStore,e);e.targetChanges.forEach((i,s)=>{const o=n.Fa.get(s);o&&(Mr(i.addedDocuments.size+i.modifiedDocuments.size+i.removedDocuments.size<=1),i.addedDocuments.size>0?o.wa=!0:i.modifiedDocuments.size>0?Mr(o.wa):i.removedDocuments.size>0&&(Mr(o.wa),o.wa=!1))}),await xv(n,r,e)}catch(r){await vv(r)}}function WB(t,e,n){const r=pn(t);if(r.isPrimaryClient&&n===0||!r.isPrimaryClient&&n===1){const i=[];r.ba.forEach((s,o)=>{const a=o.view.j_(e);a.snapshot&&i.push(a.snapshot)}),function(o,a){const l=pn(o);l.onlineState=a;let c=!1;l.queries.forEach((u,f)=>{for(const h of f.U_)h.j_(a)&&(c=!0)}),c&&x3(l)}(r.eventManager,e),i.length&&r.Sa.h_(i),r.onlineState=e,r.isPrimaryClient&&r.sharedClientState.setOnlineState(e)}}async function qpe(t,e,n){const r=pn(t);r.sharedClientState.updateQueryState(e,"rejected",n);const i=r.Fa.get(e),s=i&&i.key;if(s){let o=new Or(Zt.comparator);o=o.insert(s,gs.newNoDocument(s,un.min()));const a=Un().add(s),l=new S2(un.min(),new Map,new Or(ir),o,a);await ZH(r,l),r.va=r.va.remove(s),r.Fa.delete(e),S3(r)}else await dI(r.localStore,e,!1).then(()=>pI(r,e,n)).catch(vv)}async function eme(t,e){const n=pn(t),r=e.batch.batchId;try{const i=await dpe(n.localStore,e);eG(n,r,null),qH(n,r),n.sharedClientState.updateMutationState(r,"acknowledged"),await xv(n,i)}catch(i){await vv(i)}}async function tme(t,e,n){const r=pn(t);try{const i=await function(o,a){const l=pn(o);return l.persistence.runTransaction("Reject batch","readwrite-primary",c=>{let u;return l.mutationQueue.lookupMutationBatch(c,a).next(f=>(Mr(f!==null),u=f.keys(),l.mutationQueue.removeMutationBatch(c,f))).next(()=>l.mutationQueue.performConsistencyCheck(c)).next(()=>l.documentOverlayCache.removeOverlaysForBatchId(c,u,a)).next(()=>l.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(c,u)).next(()=>l.localDocuments.getDocuments(c,u))})}(r.localStore,e);eG(r,e,n),qH(r,e),r.sharedClientState.updateMutationState(e,"rejected",n),await xv(r,i)}catch(i){await vv(i)}}function qH(t,e){(t.Oa.get(e)||[]).forEach(n=>{n.resolve()}),t.Oa.delete(e)}function eG(t,e,n){const r=pn(t);let i=r.xa[r.currentUser.toKey()];if(i){const s=i.get(e);s&&(n?s.reject(n):s.resolve(),i=i.remove(e)),r.xa[r.currentUser.toKey()]=i}}function pI(t,e,n=null){t.sharedClientState.removeLocalQueryTarget(e);for(const r of t.Da.get(e))t.ba.delete(r),n&&t.Sa.ka(r,n);t.Da.delete(e),t.isPrimaryClient&&t.Ma.Vr(e).forEach(r=>{t.Ma.containsKey(r)||tG(t,r)})}function tG(t,e){t.Ca.delete(e.path.canonicalString());const n=t.va.get(e);n!==null&&(p3(t.remoteStore,n),t.va=t.va.remove(e),t.Fa.delete(n),S3(t))}function $B(t,e,n){for(const r of n)r instanceof QH?(t.Ma.addReference(r.key,e),nme(t,r)):r instanceof XH?(Wt("SyncEngine","Document no longer in limbo: "+r.key),t.Ma.removeReference(r.key,e),t.Ma.containsKey(r.key)||tG(t,r.key)):an()}function nme(t,e){const n=e.key,r=n.path.canonicalString();t.va.get(n)||t.Ca.has(r)||(Wt("SyncEngine","New document in limbo: "+n),t.Ca.add(r),S3(t))}function S3(t){for(;t.Ca.size>0&&t.va.size{o.push(r.Ba(l,e,n).then(c=>{var u;if((c||n)&&r.isPrimaryClient){const f=c?!c.fromCache:(u=n==null?void 0:n.targetChanges.get(l.targetId))===null||u===void 0?void 0:u.current;r.sharedClientState.updateQueryState(l.targetId,f?"current":"not-current")}if(c){i.push(c);const f=h3.Ki(l.targetId,c);s.push(f)}}))}),await Promise.all(o),r.Sa.h_(i),await async function(l,c){const u=pn(l);try{await u.persistence.runTransaction("notifyLocalViewChanges","readwrite",f=>dt.forEach(c,h=>dt.forEach(h.qi,m=>u.persistence.referenceDelegate.addReference(f,h.targetId,m)).next(()=>dt.forEach(h.Qi,m=>u.persistence.referenceDelegate.removeReference(f,h.targetId,m)))))}catch(f){if(!yv(f))throw f;Wt("LocalStore","Failed to update sequence numbers: "+f)}for(const f of c){const h=f.targetId;if(!f.fromCache){const m=u.ns.get(h),v=m.snapshotVersion,w=m.withLastLimboFreeSnapshotVersion(v);u.ns=u.ns.insert(h,w)}}}(r.localStore,s))}async function rme(t,e){const n=pn(t);if(!n.currentUser.isEqual(e)){Wt("SyncEngine","User change. New user:",e.toKey());const r=await FH(n.localStore,e);n.currentUser=e,function(s,o){s.Oa.forEach(a=>{a.forEach(l=>{l.reject(new Rt(Xe.CANCELLED,o))})}),s.Oa.clear()}(n,"'waitForPendingWrites' promise is rejected due to a user change."),n.sharedClientState.handleUserChange(e,r.removedBatchIds,r.addedBatchIds),await xv(n,r.us)}}function ime(t,e){const n=pn(t),r=n.Fa.get(e);if(r&&r.wa)return Un().add(r.key);{let i=Un();const s=n.Da.get(e);if(!s)return i;for(const o of s){const a=n.ba.get(o);i=i.unionWith(a.view.Ea)}return i}}function nG(t){const e=pn(t);return e.remoteStore.remoteSyncer.applyRemoteEvent=ZH.bind(null,e),e.remoteStore.remoteSyncer.getRemoteKeysForTarget=ime.bind(null,e),e.remoteStore.remoteSyncer.rejectListen=qpe.bind(null,e),e.Sa.h_=zpe.bind(null,e.eventManager),e.Sa.ka=Hpe.bind(null,e.eventManager),e}function sme(t){const e=pn(t);return e.remoteStore.remoteSyncer.applySuccessfulWrite=eme.bind(null,e),e.remoteStore.remoteSyncer.rejectFailedWrite=tme.bind(null,e),e}class JB{constructor(){this.synchronizeTabs=!1}async initialize(e){this.serializer=C2(e.databaseInfo.databaseId),this.sharedClientState=this.createSharedClientState(e),this.persistence=this.createPersistence(e),await this.persistence.start(),this.localStore=this.createLocalStore(e),this.gcScheduler=this.createGarbageCollectionScheduler(e,this.localStore),this.indexBackfillerScheduler=this.createIndexBackfillerScheduler(e,this.localStore)}createGarbageCollectionScheduler(e,n){return null}createIndexBackfillerScheduler(e,n){return null}createLocalStore(e){return fpe(this.persistence,new cpe,e.initialUser,this.serializer)}createPersistence(e){return new ope(d3.Hr,this.serializer)}createSharedClientState(e){return new ype}async terminate(){var e,n;(e=this.gcScheduler)===null||e===void 0||e.stop(),(n=this.indexBackfillerScheduler)===null||n===void 0||n.stop(),this.sharedClientState.shutdown(),await this.persistence.shutdown()}}class ome{async initialize(e,n){this.localStore||(this.localStore=e.localStore,this.sharedClientState=e.sharedClientState,this.datastore=this.createDatastore(n),this.remoteStore=this.createRemoteStore(n),this.eventManager=this.createEventManager(n),this.syncEngine=this.createSyncEngine(n,!e.synchronizeTabs),this.sharedClientState.onlineStateHandler=r=>WB(this.syncEngine,r,1),this.remoteStore.remoteSyncer.handleCredentialChange=rme.bind(null,this.syncEngine),await Upe(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(e){return function(){return new jpe}()}createDatastore(e){const n=C2(e.databaseInfo.databaseId),r=function(s){return new xpe(s)}(e.databaseInfo);return function(s,o,a,l){return new Cpe(s,o,a,l)}(e.authCredentials,e.appCheckCredentials,r,n)}createRemoteStore(e){return function(r,i,s,o,a){return new Ape(r,i,s,o,a)}(this.localStore,this.datastore,e.asyncQueue,n=>WB(this.syncEngine,n,0),function(){return zB.D()?new zB:new wpe}())}createSyncEngine(e,n){return function(i,s,o,a,l,c,u){const f=new $pe(i,s,o,a,l,c);return u&&(f.La=!0),f}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,e.initialUser,e.maxConcurrentLimboResolutions,n)}async terminate(){var e;await async function(r){const i=pn(r);Wt("RemoteStore","RemoteStore shutting down."),i.M_.add(5),await Mv(i),i.O_.shutdown(),i.N_.set("Unknown")}(this.remoteStore),(e=this.datastore)===null||e===void 0||e.terminate()}}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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.
+ *//**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 C3{constructor(e){this.observer=e,this.muted=!1}next(e){this.observer.next&&this.Ka(this.observer.next,e)}error(e){this.observer.error?this.Ka(this.observer.error,e):uc("Uncaught Error in snapshot listener:",e.toString())}$a(){this.muted=!0}Ka(e,n){this.muted||setTimeout(()=>{this.muted||e(n)},0)}}/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 ame{constructor(e,n,r,i){this.authCredentials=e,this.appCheckCredentials=n,this.asyncQueue=r,this.databaseInfo=i,this.user=ps.UNAUTHENTICATED,this.clientId=sH.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this.authCredentials.start(r,async s=>{Wt("FirestoreClient","Received user=",s.uid),await this.authCredentialListener(s),this.user=s}),this.appCheckCredentials.start(r,s=>(Wt("FirestoreClient","Received new app check token=",s),this.appCheckCredentialListener(s,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}verifyNotTerminated(){if(this.asyncQueue.isShuttingDown)throw new Rt(Xe.FAILED_PRECONDITION,"The client has already been terminated.")}terminate(){this.asyncQueue.enterRestrictedMode();const e=new ec;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(n){const r=w3(n,"Failed to shutdown persistence");e.reject(r)}}),e.promise}}async function ME(t,e){t.asyncQueue.verifyOperationInProgress(),Wt("FirestoreClient","Initializing OfflineComponentProvider");const n=t.configuration;await e.initialize(n);let r=n.initialUser;t.setCredentialChangeListener(async i=>{r.isEqual(i)||(await FH(e.localStore,i),r=i)}),e.persistence.setDatabaseDeletedListener(()=>t.terminate()),t._offlineComponents=e}async function YB(t,e){t.asyncQueue.verifyOperationInProgress();const n=await cme(t);Wt("FirestoreClient","Initializing OnlineComponentProvider"),await e.initialize(n,t.configuration),t.setCredentialChangeListener(r=>HB(e.remoteStore,r)),t.setAppCheckTokenChangeListener((r,i)=>HB(e.remoteStore,i)),t._onlineComponents=e}function lme(t){return t.name==="FirebaseError"?t.code===Xe.FAILED_PRECONDITION||t.code===Xe.UNIMPLEMENTED:!(typeof DOMException<"u"&&t instanceof DOMException)||t.code===22||t.code===20||t.code===11}async function cme(t){if(!t._offlineComponents)if(t._uninitializedComponentsProvider){Wt("FirestoreClient","Using user provided OfflineComponentProvider");try{await ME(t,t._uninitializedComponentsProvider._offline)}catch(e){const n=e;if(!lme(n))throw n;Xp("Error using user provided cache. Falling back to memory cache: "+n),await ME(t,new JB)}}else Wt("FirestoreClient","Using default OfflineComponentProvider"),await ME(t,new JB);return t._offlineComponents}async function rG(t){return t._onlineComponents||(t._uninitializedComponentsProvider?(Wt("FirestoreClient","Using user provided OnlineComponentProvider"),await YB(t,t._uninitializedComponentsProvider._online)):(Wt("FirestoreClient","Using default OnlineComponentProvider"),await YB(t,new ome))),t._onlineComponents}function ume(t){return rG(t).then(e=>e.syncEngine)}async function ex(t){const e=await rG(t),n=e.eventManager;return n.onListen=Jpe.bind(null,e.syncEngine),n.onUnlisten=Xpe.bind(null,e.syncEngine),n.onFirstRemoteStoreListen=Ype.bind(null,e.syncEngine),n.onLastRemoteStoreUnlisten=Kpe.bind(null,e.syncEngine),n}function fme(t,e,n={}){const r=new ec;return t.asyncQueue.enqueueAndForget(async()=>function(s,o,a,l,c){const u=new C3({next:h=>{o.enqueueAndForget(()=>M3(s,f));const m=h.docs.has(a);!m&&h.fromCache?c.reject(new Rt(Xe.UNAVAILABLE,"Failed to get document because the client is offline.")):m&&h.fromCache&&l&&l.source==="server"?c.reject(new Rt(Xe.UNAVAILABLE,'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')):c.resolve(h)},error:h=>c.reject(h)}),f=new b3(y2(a.path),u,{includeMetadataChanges:!0,ra:!0});return _3(s,f)}(await ex(t),t.asyncQueue,e,n,r)),r.promise}function dme(t,e,n={}){const r=new ec;return t.asyncQueue.enqueueAndForget(async()=>function(s,o,a,l,c){const u=new C3({next:h=>{o.enqueueAndForget(()=>M3(s,f)),h.fromCache&&l.source==="server"?c.reject(new Rt(Xe.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(h)},error:h=>c.reject(h)}),f=new b3(a,u,{includeMetadataChanges:!0,ra:!0});return _3(s,f)}(await ex(t),t.asyncQueue,e,n,r)),r.promise}/**
+ * @license
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 iG(t){const e={};return t.timeoutSeconds!==void 0&&(e.timeoutSeconds=t.timeoutSeconds),e}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 QB=new Map;/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 sG(t,e,n){if(!n)throw new Rt(Xe.INVALID_ARGUMENT,`Function ${t}() cannot be called with an empty ${e}.`)}function hme(t,e,n,r){if(e===!0&&r===!0)throw new Rt(Xe.INVALID_ARGUMENT,`${t} and ${n} cannot be used together.`)}function XB(t){if(!Zt.isDocumentKey(t))throw new Rt(Xe.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${t} has ${t.length}.`)}function KB(t){if(Zt.isDocumentKey(t))throw new Rt(Xe.INVALID_ARGUMENT,`Invalid collection reference. Collection references must have an odd number of segments, but ${t} has ${t.length}.`)}function T2(t){if(t===void 0)return"undefined";if(t===null)return"null";if(typeof t=="string")return t.length>20&&(t=`${t.substring(0,20)}...`),JSON.stringify(t);if(typeof t=="number"||typeof t=="boolean")return""+t;if(typeof t=="object"){if(t instanceof Array)return"an array";{const e=function(r){return r.constructor?r.constructor.name:null}(t);return e?`a custom ${e} object`:"an object"}}return typeof t=="function"?"a function":an()}function ks(t,e){if("_delegate"in t&&(t=t._delegate),!(t instanceof e)){if(e.name===t.constructor.name)throw new Rt(Xe.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const n=T2(t);throw new Rt(Xe.INVALID_ARGUMENT,`Expected type '${e.name}', but it was: ${n}`)}}return t}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 ZB{constructor(e){var n,r;if(e.host===void 0){if(e.ssl!==void 0)throw new Rt(Xe.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=(n=e.ssl)===null||n===void 0||n;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 Rt(Xe.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}hme("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=iG((r=e.experimentalLongPollingOptions)!==null&&r!==void 0?r:{}),function(s){if(s.timeoutSeconds!==void 0){if(isNaN(s.timeoutSeconds))throw new Rt(Xe.INVALID_ARGUMENT,`invalid long polling timeout: ${s.timeoutSeconds} (must not be NaN)`);if(s.timeoutSeconds<5)throw new Rt(Xe.INVALID_ARGUMENT,`invalid long polling timeout: ${s.timeoutSeconds} (minimum allowed value is 5)`);if(s.timeoutSeconds>30)throw new Rt(Xe.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(r,i){return r.timeoutSeconds===i.timeoutSeconds}(this.experimentalLongPollingOptions,e.experimentalLongPollingOptions)&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams}}class I2{constructor(e,n,r,i){this._authCredentials=e,this._appCheckCredentials=n,this._databaseId=r,this._app=i,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new ZB({}),this._settingsFrozen=!1}get app(){if(!this._app)throw new Rt(Xe.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!==void 0}_setSettings(e){if(this._settingsFrozen)throw new Rt(Xe.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 ZB(e),e.credentials!==void 0&&(this._authCredentials=function(r){if(!r)return new Rde;switch(r.type){case"firstParty":return new kde(r.sessionIndex||"0",r.iamToken||null,r.authTokenFactory||null);case"provider":return r.client;default:throw new Rt(Xe.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||(this._terminateTask=this._terminate()),this._terminateTask}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return function(n){const r=QB.get(n);r&&(Wt("ComponentProvider","Removing Datastore"),QB.delete(n),r.terminate())}(this),Promise.resolve()}}function pme(t,e,n,r={}){var i;const s=(t=ks(t,I2))._getSettings(),o=`${e}:${n}`;if(s.host!=="firestore.googleapis.com"&&s.host!==o&&Xp("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used."),t._setSettings(Object.assign(Object.assign({},s),{host:o,ssl:!1})),r.mockUserToken){let a,l;if(typeof r.mockUserToken=="string")a=r.mockUserToken,l=ps.MOCK_USER;else{a=h8(r.mockUserToken,(i=t._app)===null||i===void 0?void 0:i.options.projectId);const c=r.mockUserToken.sub||r.mockUserToken.user_id;if(!c)throw new Rt(Xe.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");l=new ps(c)}t._authCredentials=new Pde(new iH(a,l))}}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 xl{constructor(e,n,r){this.converter=n,this._query=r,this.type="query",this.firestore=e}withConverter(e){return new xl(this.firestore,e,this._query)}}class vs{constructor(e,n,r){this.converter=n,this._key=r,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 gu(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new vs(this.firestore,e,this._key)}}class gu extends xl{constructor(e,n,r){super(e,n,y2(r)),this._path=r,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 vs(this.firestore,null,new Zt(e))}withConverter(e){return new gu(this.firestore,e,this._path)}}function oG(t,e,...n){if(t=mr(t),sG("collection","path",e),t instanceof I2){const r=wr.fromString(e,...n);return KB(r),new gu(t,null,r)}{if(!(t instanceof vs||t instanceof gu))throw new Rt(Xe.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const r=t._path.child(wr.fromString(e,...n));return KB(r),new gu(t.firestore,null,r)}}function Nm(t,e,...n){if(t=mr(t),arguments.length===1&&(e=sH.newId()),sG("doc","path",e),t instanceof I2){const r=wr.fromString(e,...n);return XB(r),new vs(t,null,new Zt(r))}{if(!(t instanceof vs||t instanceof gu))throw new Rt(Xe.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const r=t._path.child(wr.fromString(e,...n));return XB(r),new vs(t.firestore,t instanceof gu?t.converter:null,new Zt(r))}}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 mme{constructor(){this.iu=Promise.resolve(),this.su=[],this.ou=!1,this._u=[],this.au=null,this.uu=!1,this.cu=!1,this.lu=[],this.Yo=new zH(this,"async_queue_retry"),this.hu=()=>{const n=_E();n&&Wt("AsyncQueue","Visibility state changed to "+n.visibilityState),this.Yo.Wo()};const e=_E();e&&typeof e.addEventListener=="function"&&e.addEventListener("visibilitychange",this.hu)}get isShuttingDown(){return this.ou}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.Pu(),this.Iu(e)}enterRestrictedMode(e){if(!this.ou){this.ou=!0,this.cu=e||!1;const n=_E();n&&typeof n.removeEventListener=="function"&&n.removeEventListener("visibilitychange",this.hu)}}enqueue(e){if(this.Pu(),this.ou)return new Promise(()=>{});const n=new ec;return this.Iu(()=>this.ou&&this.cu?Promise.resolve():(e().then(n.resolve,n.reject),n.promise)).then(()=>n.promise)}enqueueRetryable(e){this.enqueueAndForget(()=>(this.su.push(e),this.Tu()))}async Tu(){if(this.su.length!==0){try{await this.su[0](),this.su.shift(),this.Yo.reset()}catch(e){if(!yv(e))throw e;Wt("AsyncQueue","Operation failed with retryable error: "+e)}this.su.length>0&&this.Yo.$o(()=>this.Tu())}}Iu(e){const n=this.iu.then(()=>(this.uu=!0,e().catch(r=>{this.au=r,this.uu=!1;const i=function(o){let a=o.message||"";return o.stack&&(a=o.stack.includes(o.message)?o.stack:o.message+`
+`+o.stack),a}(r);throw uc("INTERNAL UNHANDLED ERROR: ",i),r}).then(r=>(this.uu=!1,r))));return this.iu=n,n}enqueueAfterDelay(e,n,r){this.Pu(),this.lu.indexOf(e)>-1&&(n=0);const i=y3.createAndSchedule(this,e,n,r,s=>this.Eu(s));return this._u.push(i),i}Pu(){this.au&&an()}verifyOperationInProgress(){}async du(){let e;do e=this.iu,await e;while(e!==this.iu)}Au(e){for(const n of this._u)if(n.timerId===e)return!0;return!1}Ru(e){return this.du().then(()=>{this._u.sort((n,r)=>n.targetTimeMs-r.targetTimeMs);for(const n of this._u)if(n.skipDelay(),e!=="all"&&n.timerId===e)break;return this.du()})}Vu(e){this.lu.push(e)}Eu(e){const n=this._u.indexOf(e);this._u.splice(n,1)}}function qB(t){return function(n,r){if(typeof n!="object"||n===null)return!1;const i=n;for(const s of r)if(s in i&&typeof i[s]=="function")return!0;return!1}(t,["next","error","complete"])}class pl extends I2{constructor(e,n,r,i){super(e,n,r,i),this.type="firestore",this._queue=function(){return new mme}(),this._persistenceKey=(i==null?void 0:i.name)||"[DEFAULT]"}_terminate(){return this._firestoreClient||aG(this),this._firestoreClient.terminate()}}function gme(t,e){const n=typeof t=="object"?t:G4(),r=typeof t=="string"?t:"(default)",i=f2(n,"firestore").getImmediate({identifier:r});if(!i._initialized){const s=u8("firestore");s&&pme(i,...s)}return i}function bv(t){return t._firestoreClient||aG(t),t._firestoreClient.verifyNotTerminated(),t._firestoreClient}function aG(t){var e,n,r;const i=t._freezeSettings(),s=function(a,l,c,u){return new Yde(a,l,c,u.host,u.ssl,u.experimentalForceLongPolling,u.experimentalAutoDetectLongPolling,iG(u.experimentalLongPollingOptions),u.useFetchStreams)}(t._databaseId,((e=t._app)===null||e===void 0?void 0:e.options.appId)||"",t._persistenceKey,i);t._firestoreClient=new ame(t._authCredentials,t._appCheckCredentials,t._queue,s),!((n=i.localCache)===null||n===void 0)&&n._offlineComponentProvider&&(!((r=i.localCache)===null||r===void 0)&&r._onlineComponentProvider)&&(t._firestoreClient._uninitializedComponentsProvider={_offlineKind:i.localCache.kind,_offline:i.localCache._offlineComponentProvider,_online:i.localCache._onlineComponentProvider})}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 sm{constructor(e){this._byteString=e}static fromBase64String(e){try{return new sm(ws.fromBase64String(e))}catch(n){throw new Rt(Xe.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+n)}}static fromUint8Array(e){return new sm(ws.fromUint8Array(e))}toBase64(){return this._byteString.toBase64()}toUint8Array(){return this._byteString.toUint8Array()}toString(){return"Bytes(base64: "+this.toBase64()+")"}isEqual(e){return this._byteString.isEqual(e._byteString)}}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Sv{constructor(...e){for(let n=0;n90)throw new Rt(Xe.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(n)||n<-180||n>180)throw new Rt(Xe.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+n);this._lat=e,this._long=n}get latitude(){return this._lat}get longitude(){return this._long}isEqual(e){return this._lat===e._lat&&this._long===e._long}toJSON(){return{latitude:this._lat,longitude:this._long}}_compareTo(e){return ir(this._lat,e._lat)||ir(this._long,e._long)}}/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 vme=/^__.*__$/;class yme{constructor(e,n,r){this.data=e,this.fieldMask=n,this.fieldTransforms=r}toMutation(e,n){return this.fieldMask!==null?new zu(e,this.data,this.fieldMask,n,this.fieldTransforms):new wv(e,this.data,n,this.fieldTransforms)}}class lG{constructor(e,n,r){this.data=e,this.fieldMask=n,this.fieldTransforms=r}toMutation(e,n){return new zu(e,this.data,this.fieldMask,n,this.fieldTransforms)}}function cG(t){switch(t){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw an()}}class L2{constructor(e,n,r,i,s,o){this.settings=e,this.databaseId=n,this.serializer=r,this.ignoreUndefinedProperties=i,s===void 0&&this.mu(),this.fieldTransforms=s||[],this.fieldMask=o||[]}get path(){return this.settings.path}get fu(){return this.settings.fu}gu(e){return new L2(Object.assign(Object.assign({},this.settings),e),this.databaseId,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}pu(e){var n;const r=(n=this.path)===null||n===void 0?void 0:n.child(e),i=this.gu({path:r,yu:!1});return i.wu(e),i}Su(e){var n;const r=(n=this.path)===null||n===void 0?void 0:n.child(e),i=this.gu({path:r,yu:!1});return i.mu(),i}bu(e){return this.gu({path:void 0,yu:!0})}Du(e){return tx(e,this.settings.methodName,this.settings.Cu||!1,this.path,this.settings.vu)}contains(e){return this.fieldMask.find(n=>e.isPrefixOf(n))!==void 0||this.fieldTransforms.find(n=>e.isPrefixOf(n.field))!==void 0}mu(){if(this.path)for(let e=0;el.covers(f.field))}else l=null,c=o.fieldTransforms;return new yme(new Ws(a),l,c)}class R2 extends Cv{_toFieldTransform(e){if(e.fu!==2)throw e.fu===1?e.Du(`${this._methodName}() can only appear at the top level of your update data`):e.Du(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);return e.fieldMask.push(e.path),null}isEqual(e){return e instanceof R2}}function uG(t,e,n){return new L2({fu:3,vu:e.settings.vu,methodName:t._methodName,yu:n},e.databaseId,e.serializer,e.ignoreUndefinedProperties)}class T3 extends Cv{constructor(e,n){super(e),this.Mu=n}_toFieldTransform(e){const n=uG(this,e,!0),r=this.Mu.map(s=>jd(s,n)),i=new tm(r);return new EH(e.path,i)}isEqual(e){return e instanceof T3&&Qp(this.Mu,e.Mu)}}class I3 extends Cv{constructor(e,n){super(e),this.Mu=n}_toFieldTransform(e){const n=uG(this,e,!0),r=this.Mu.map(s=>jd(s,n)),i=new nm(r);return new EH(e.path,i)}isEqual(e){return e instanceof I3&&Qp(this.Mu,e.Mu)}}function fG(t,e,n,r){const i=t.Fu(1,e,n);L3("Data must be an object, but it was:",i,r);const s=[],o=Ws.empty();Od(r,(l,c)=>{const u=R3(e,l,n);c=mr(c);const f=i.Su(u);if(c instanceof R2)s.push(u);else{const h=jd(c,f);h!=null&&(s.push(u),o.set(u,h))}});const a=new wo(s);return new lG(o,a,i.fieldTransforms)}function dG(t,e,n,r,i,s){const o=t.Fu(1,e,n),a=[mI(e,r,n)],l=[i];if(s.length%2!=0)throw new Rt(Xe.INVALID_ARGUMENT,`Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);for(let h=0;h=0;--h)if(!gG(c,a[h])){const m=a[h];let v=l[h];v=mr(v);const w=o.Su(m);if(v instanceof R2)c.push(m);else{const y=jd(v,w);y!=null&&(c.push(m),u.set(m,y))}}const f=new wo(c);return new lG(u,f,o.fieldTransforms)}function hG(t,e,n,r=!1){return jd(n,t.Fu(r?4:3,e))}function jd(t,e){if(mG(t=mr(t)))return L3("Unsupported field value:",e,t),pG(t,e);if(t instanceof Cv)return function(r,i){if(!cG(i.fu))throw i.Du(`${r._methodName}() can only be used with update() and set()`);if(!i.path)throw i.Du(`${r._methodName}() is not currently supported inside arrays`);const s=r._toFieldTransform(i);s&&i.fieldTransforms.push(s)}(t,e),null;if(t===void 0&&e.ignoreUndefinedProperties)return null;if(e.path&&e.fieldMask.push(e.path),t instanceof Array){if(e.settings.yu&&e.fu!==4)throw e.Du("Nested arrays are not supported");return function(r,i){const s=[];let o=0;for(const a of r){let l=jd(a,i.bu(o));l==null&&(l={nullValue:"NULL_VALUE"}),s.push(l),o++}return{arrayValue:{values:s}}}(t,e)}return function(r,i){if((r=mr(r))===null)return{nullValue:"NULL_VALUE"};if(typeof r=="number")return mhe(i.serializer,r);if(typeof r=="boolean")return{booleanValue:r};if(typeof r=="string")return{stringValue:r};if(r instanceof Date){const s=_i.fromDate(r);return{timestampValue:ZM(i.serializer,s)}}if(r instanceof _i){const s=new _i(r.seconds,1e3*Math.floor(r.nanoseconds/1e3));return{timestampValue:ZM(i.serializer,s)}}if(r instanceof E3)return{geoPointValue:{latitude:r.latitude,longitude:r.longitude}};if(r instanceof sm)return{bytesValue:PH(i.serializer,r._byteString)};if(r instanceof vs){const s=i.databaseId,o=r.firestore._databaseId;if(!o.isEqual(s))throw i.Du(`Document reference is for database ${o.projectId}/${o.database} but should be for database ${s.projectId}/${s.database}`);return{referenceValue:u3(r.firestore._databaseId||i.databaseId,r._key.path)}}throw i.Du(`Unsupported field value: ${T2(r)}`)}(t,e)}function pG(t,e){const n={};return oH(t)?e.path&&e.path.length>0&&e.fieldMask.push(e.path):Od(t,(r,i)=>{const s=jd(i,e.pu(r));s!=null&&(n[r]=s)}),{mapValue:{fields:n}}}function mG(t){return!(typeof t!="object"||t===null||t instanceof Array||t instanceof Date||t instanceof _i||t instanceof E3||t instanceof sm||t instanceof vs||t instanceof Cv)}function L3(t,e,n){if(!mG(n)||!function(i){return typeof i=="object"&&i!==null&&(Object.getPrototypeOf(i)===Object.prototype||Object.getPrototypeOf(i)===null)}(n)){const r=T2(n);throw r==="an object"?e.Du(t+" a custom object"):e.Du(t+" "+r)}}function mI(t,e,n){if((e=mr(e))instanceof Sv)return e._internalPath;if(typeof e=="string")return R3(t,e);throw tx("Field path arguments must be of type string or ",t,!1,void 0,n)}const _me=new RegExp("[~\\*/\\[\\]]");function R3(t,e,n){if(e.search(_me)>=0)throw tx(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`,t,!1,void 0,n);try{return new Sv(...e.split("."))._internalPath}catch{throw tx(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,t,!1,void 0,n)}}function tx(t,e,n,r,i){const s=r&&!r.isEmpty(),o=i!==void 0;let a=`Function ${e}() called with invalid data`;n&&(a+=" (via `toFirestore()`)"),a+=". ";let l="";return(s||o)&&(l+=" (found",s&&(l+=` in field ${r}`),o&&(l+=` in document ${i}`),l+=")"),new Rt(Xe.INVALID_ARGUMENT,a+t+l)}function gG(t,e){return t.some(n=>n.isEqual(e))}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 P3{constructor(e,n,r,i,s){this._firestore=e,this._userDataWriter=n,this._key=r,this._document=i,this._converter=s}get id(){return this._key.path.lastSegment()}get ref(){return new vs(this._firestore,this._converter,this._key)}exists(){return this._document!==null}data(){if(this._document){if(this._converter){const e=new Mme(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 n=this._document.data.field(P2("DocumentSnapshot.get",e));if(n!==null)return this._userDataWriter.convertValue(n)}}}class Mme extends P3{data(){return super.data()}}function P2(t,e){return typeof e=="string"?R3(t,e):e instanceof Sv?e._internalPath:e._delegate._internalPath}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 vG(t){if(t.limitType==="L"&&t.explicitOrderBy.length===0)throw new Rt(Xe.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}class D3{}class D2 extends D3{}function eO(t,e,...n){let r=[];e instanceof D3&&r.push(e),r=r.concat(n),function(s){const o=s.filter(l=>l instanceof Av).length,a=s.filter(l=>l instanceof Ev).length;if(o>1||o>0&&a>0)throw new Rt(Xe.INVALID_ARGUMENT,"InvalidQuery. When using composite filters, you cannot use more than one filter at the top level. Consider nesting the multiple filters within an `and(...)` statement. For example: change `query(query, where(...), or(...))` to `query(query, and(where(...), or(...)))`.")}(r);for(const i of r)t=i._apply(t);return t}class Ev extends D2{constructor(e,n,r){super(),this._field=e,this._op=n,this._value=r,this.type="where"}static _create(e,n,r){return new Ev(e,n,r)}_apply(e){const n=this._parse(e);return wG(e._query,n),new xl(e.firestore,e.converter,aI(e._query,n))}_parse(e){const n=km(e.firestore);return function(s,o,a,l,c,u,f){let h;if(c.isKeyField()){if(u==="array-contains"||u==="array-contains-any")throw new Rt(Xe.INVALID_ARGUMENT,`Invalid Query. You can't perform '${u}' queries on documentId().`);if(u==="in"||u==="not-in"){nO(f,u);const m=[];for(const v of f)m.push(tO(l,s,v));h={arrayValue:{values:m}}}else h=tO(l,s,f)}else u!=="in"&&u!=="not-in"&&u!=="array-contains-any"||nO(f,u),h=hG(a,o,f,u==="in"||u==="not-in");return yi.create(c,u,h)}(e._query,"where",n,e.firestore._databaseId,this._field,this._op,this._value)}}function xme(t,e,n){const r=e,i=P2("where",t);return Ev._create(i,r,n)}class Av extends D3{constructor(e,n){super(),this.type=e,this._queryConstraints=n}static _create(e,n){return new Av(e,n)}_parse(e){const n=this._queryConstraints.map(r=>r._parse(e)).filter(r=>r.getFilters().length>0);return n.length===1?n[0]:Ua.create(n,this._getOperator())}_apply(e){const n=this._parse(e);return n.getFilters().length===0?e:(function(i,s){let o=i;const a=s.getFlattenedFilters();for(const l of a)wG(o,l),o=aI(o,l)}(e._query,n),new xl(e.firestore,e.converter,aI(e._query,n)))}_getQueryConstraints(){return this._queryConstraints}_getOperator(){return this.type==="and"?"and":"or"}}function bme(...t){return t.forEach(e=>Cme("or",e)),Av._create("or",t)}class N3 extends D2{constructor(e,n){super(),this._field=e,this._direction=n,this.type="orderBy"}static _create(e,n){return new N3(e,n)}_apply(e){const n=function(i,s,o){if(i.startAt!==null)throw new Rt(Xe.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(i.endAt!==null)throw new Rt(Xe.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");return new C1(s,o)}(e._query,this._field,this._direction);return new xl(e.firestore,e.converter,function(i,s){const o=i.explicitOrderBy.concat([s]);return new Ud(i.path,i.collectionGroup,o,i.filters.slice(),i.limit,i.limitType,i.startAt,i.endAt)}(e._query,n))}}function nx(t,e="asc"){const n=e,r=P2("orderBy",t);return N3._create(r,n)}class k3 extends D2{constructor(e,n,r){super(),this.type=e,this._limit=n,this._limitType=r}static _create(e,n,r){return new k3(e,n,r)}_apply(e){return new xl(e.firestore,e.converter,QM(e._query,this._limit,this._limitType))}}function rx(t){return k3._create("limit",t,"F")}class B3 extends D2{constructor(e,n,r){super(),this.type=e,this._docOrFields=n,this._inclusive=r}static _create(e,n,r){return new B3(e,n,r)}_apply(e){const n=Sme(e,this.type,this._docOrFields,this._inclusive);return new xl(e.firestore,e.converter,function(i,s){return new Ud(i.path,i.collectionGroup,i.explicitOrderBy.slice(),i.filters.slice(),i.limit,i.limitType,s,i.endAt)}(e._query,n))}}function yG(...t){return B3._create("startAfter",t,!1)}function Sme(t,e,n,r){if(n[0]=mr(n[0]),n[0]instanceof P3)return function(s,o,a,l,c){if(!l)throw new Rt(Xe.NOT_FOUND,`Can't use a DocumentSnapshot that doesn't exist for ${a}().`);const u=[];for(const f of Ap(s))if(f.field.isKeyField())u.push(YM(o,l.key));else{const h=l.data.field(f.field);if(v2(h))throw new Rt(Xe.INVALID_ARGUMENT,'Invalid query. You are trying to start or end a query using a document for which the field "'+f.field+'" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');if(h===null){const m=f.field.canonicalString();throw new Rt(Xe.INVALID_ARGUMENT,`Invalid query. You are trying to start or end a query using a document for which the field '${m}' (used as the orderBy) does not exist.`)}u.push(h)}return new em(u,c)}(t._query,t.firestore._databaseId,e,n[0]._document,r);{const i=km(t.firestore);return function(o,a,l,c,u,f){const h=o.explicitOrderBy;if(u.length>h.length)throw new Rt(Xe.INVALID_ARGUMENT,`Too many arguments provided to ${c}(). The number of arguments must be less than or equal to the number of orderBy() clauses`);const m=[];for(let v=0;v=0)return a.op;return null}(t.filters,function(i){switch(i){case"!=":return["!=","not-in"];case"array-contains-any":case"in":return["not-in"];case"not-in":return["array-contains-any","in","not-in","!="];default:return[]}}(e.op));if(n!==null)throw n===e.op?new Rt(Xe.INVALID_ARGUMENT,`Invalid query. You cannot use more than one '${e.op.toString()}' filter.`):new Rt(Xe.INVALID_ARGUMENT,`Invalid query. You cannot use '${e.op.toString()}' filters with '${n.toString()}' filters.`)}function Cme(t,e){if(!(e instanceof Ev||e instanceof Av))throw new Rt(Xe.INVALID_ARGUMENT,`Function ${t}() requires AppliableConstraints created with a call to 'where(...)', 'or(...)', or 'and(...)'.`)}class Eme{convertValue(e,n="none"){switch(Sd(e)){case 0:return null;case 1:return e.booleanValue;case 2:return mi(e.integerValue||e.doubleValue);case 3:return this.convertTimestamp(e.timestampValue);case 4:return this.convertServerTimestamp(e,n);case 5:return e.stringValue;case 6:return this.convertBytes(bd(e.bytesValue));case 7:return this.convertReference(e.referenceValue);case 8:return this.convertGeoPoint(e.geoPointValue);case 9:return this.convertArray(e.arrayValue,n);case 10:return this.convertObject(e.mapValue,n);default:throw an()}}convertObject(e,n){return this.convertObjectMap(e.fields,n)}convertObjectMap(e,n="none"){const r={};return Od(e,(i,s)=>{r[i]=this.convertValue(s,n)}),r}convertGeoPoint(e){return new E3(mi(e.latitude),mi(e.longitude))}convertArray(e,n){return(e.values||[]).map(r=>this.convertValue(r,n))}convertServerTimestamp(e,n){switch(n){case"previous":const r=r3(e);return r==null?null:this.convertValue(r,n);case"estimate":return this.convertTimestamp(x1(e));default:return null}}convertTimestamp(e){const n=xu(e);return new _i(n.seconds,n.nanos)}convertDocumentKey(e,n){const r=wr.fromString(e);Mr(UH(r));const i=new b1(r.get(1),r.get(3)),s=new Zt(r.popFirst(5));return i.isEqual(n)||uc(`Document ${s} contains a document reference within a different database (${i.projectId}/${i.database}) which is not supported. It will be treated as a reference in the current database (${n.projectId}/${n.database}) instead.`),s}}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 O3(t,e,n){let r;return r=t?n&&(n.merge||n.mergeFields)?t.toFirestore(e,n):t.toFirestore(e):e,r}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 pg{constructor(e,n){this.hasPendingWrites=e,this.fromCache=n}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}}class _G extends P3{constructor(e,n,r,i,s,o){super(e,n,r,i,o),this._firestore=e,this._firestoreImpl=e,this.metadata=s}exists(){return super.exists()}data(e={}){if(this._document){if(this._converter){const n=new J_(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(n,e)}return this._userDataWriter.convertValue(this._document.data.value,e.serverTimestamps)}}get(e,n={}){if(this._document){const r=this._document.data.field(P2("DocumentSnapshot.get",e));if(r!==null)return this._userDataWriter.convertValue(r,n.serverTimestamps)}}}class J_ extends _G{data(e={}){return super.data(e)}}class MG{constructor(e,n,r,i){this._firestore=e,this._userDataWriter=n,this._snapshot=i,this.metadata=new pg(i.hasPendingWrites,i.fromCache),this.query=r}get docs(){const e=[];return this.forEach(n=>e.push(n)),e}get size(){return this._snapshot.docs.size}get empty(){return this.size===0}forEach(e,n){this._snapshot.docs.forEach(r=>{e.call(n,new J_(this._firestore,this._userDataWriter,r.key,r,new pg(this._snapshot.mutatedKeys.has(r.key),this._snapshot.fromCache),this.query.converter))})}docChanges(e={}){const n=!!e.includeMetadataChanges;if(n&&this._snapshot.excludesMetadataChanges)throw new Rt(Xe.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===n||(this._cachedChanges=function(i,s){if(i._snapshot.oldDocs.isEmpty()){let o=0;return i._snapshot.docChanges.map(a=>{const l=new J_(i._firestore,i._userDataWriter,a.doc.key,a.doc,new pg(i._snapshot.mutatedKeys.has(a.doc.key),i._snapshot.fromCache),i.query.converter);return a.doc,{type:"added",doc:l,oldIndex:-1,newIndex:o++}})}{let o=i._snapshot.oldDocs;return i._snapshot.docChanges.filter(a=>s||a.type!==3).map(a=>{const l=new J_(i._firestore,i._userDataWriter,a.doc.key,a.doc,new pg(i._snapshot.mutatedKeys.has(a.doc.key),i._snapshot.fromCache),i.query.converter);let c=-1,u=-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),u=o.indexOf(a.doc.key)),{type:Ame(a.type),doc:l,oldIndex:c,newIndex:u}})}}(this,n),this._cachedChangesIncludeMetadataChanges=n),this._cachedChanges}}function Ame(t){switch(t){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return an()}}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Tme(t){t=ks(t,vs);const e=ks(t.firestore,pl);return fme(bv(e),t._key).then(n=>xG(e,t,n))}class U3 extends Eme{constructor(e){super(),this.firestore=e}convertBytes(e){return new sm(e)}convertReference(e){const n=this.convertDocumentKey(e,this.firestore._databaseId);return new vs(this.firestore,null,n)}}function Ime(t){t=ks(t,xl);const e=ks(t.firestore,pl),n=bv(e),r=new U3(e);return vG(t._query),dme(n,t._query).then(i=>new MG(e,r,t,i))}function Lme(t,e,n){t=ks(t,vs);const r=ks(t.firestore,pl),i=O3(t.converter,e,n);return Tv(r,[A3(km(r),"setDoc",t._key,i,t.converter!==null,n).toMutation(t._key,Ns.none())])}function Rme(t,e,n,...r){t=ks(t,vs);const i=ks(t.firestore,pl),s=km(i);let o;return o=typeof(e=mr(e))=="string"||e instanceof Sv?dG(s,"updateDoc",t._key,e,n,r):fG(s,"updateDoc",t._key,e),Tv(i,[o.toMutation(t._key,Ns.exists(!0))])}function Pme(t){return Tv(ks(t.firestore,pl),[new b2(t._key,Ns.none())])}function Dme(t,e){const n=ks(t.firestore,pl),r=Nm(t),i=O3(t.converter,e);return Tv(n,[A3(km(t.firestore),"addDoc",r._key,i,t.converter!==null,{}).toMutation(r._key,Ns.exists(!1))]).then(()=>r)}function Nme(t,...e){var n,r,i;t=mr(t);let s={includeMetadataChanges:!1,source:"default"},o=0;typeof e[o]!="object"||qB(e[o])||(s=e[o],o++);const a={includeMetadataChanges:s.includeMetadataChanges,source:s.source};if(qB(e[o])){const f=e[o];e[o]=(n=f.next)===null||n===void 0?void 0:n.bind(f),e[o+1]=(r=f.error)===null||r===void 0?void 0:r.bind(f),e[o+2]=(i=f.complete)===null||i===void 0?void 0:i.bind(f)}let l,c,u;if(t instanceof vs)c=ks(t.firestore,pl),u=y2(t._key.path),l={next:f=>{e[o]&&e[o](xG(c,t,f))},error:e[o+1],complete:e[o+2]};else{const f=ks(t,xl);c=ks(f.firestore,pl),u=f._query;const h=new U3(c);l={next:m=>{e[o]&&e[o](new MG(c,h,f,m))},error:e[o+1],complete:e[o+2]},vG(t._query)}return function(h,m,v,w){const y=new C3(w),g=new b3(m,y,v);return h.asyncQueue.enqueueAndForget(async()=>_3(await ex(h),g)),()=>{y.$a(),h.asyncQueue.enqueueAndForget(async()=>M3(await ex(h),g))}}(bv(c),u,a,l)}function Tv(t,e){return function(r,i){const s=new ec;return r.asyncQueue.enqueueAndForget(async()=>Zpe(await ume(r),i,s)),s.promise}(bv(t),e)}function xG(t,e,n){const r=n.docs.get(e._key),i=new U3(t);return new _G(t,i,e._key,r,new pg(n.hasPendingWrites,n.fromCache),e.converter)}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 kme{constructor(e,n){this._firestore=e,this._commitHandler=n,this._mutations=[],this._committed=!1,this._dataReader=km(e)}set(e,n,r){this._verifyNotCommitted();const i=xE(e,this._firestore),s=O3(i.converter,n,r),o=A3(this._dataReader,"WriteBatch.set",i._key,s,i.converter!==null,r);return this._mutations.push(o.toMutation(i._key,Ns.none())),this}update(e,n,r,...i){this._verifyNotCommitted();const s=xE(e,this._firestore);let o;return o=typeof(n=mr(n))=="string"||n instanceof Sv?dG(this._dataReader,"WriteBatch.update",s._key,n,r,i):fG(this._dataReader,"WriteBatch.update",s._key,n),this._mutations.push(o.toMutation(s._key,Ns.exists(!0))),this}delete(e){this._verifyNotCommitted();const n=xE(e,this._firestore);return this._mutations=this._mutations.concat(new b2(n._key,Ns.none())),this}commit(){return this._verifyNotCommitted(),this._committed=!0,this._mutations.length>0?this._commitHandler(this._mutations):Promise.resolve()}_verifyNotCommitted(){if(this._committed)throw new Rt(Xe.FAILED_PRECONDITION,"A write batch can no longer be used after commit() has been called.")}}function xE(t,e){if((t=mr(t)).firestore!==e)throw new Rt(Xe.INVALID_ARGUMENT,"Provided document reference is from a different Firestore instance.");return t}function gI(...t){return new T3("arrayUnion",t)}function ix(...t){return new I3("arrayRemove",t)}/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Bme(t){return bv(t=ks(t,pl)),new kme(t,e=>Tv(t,e))}(function(e,n=!0){(function(i){Rm=i})(Bd),wd(new _u("firestore",(r,{instanceIdentifier:i,options:s})=>{const o=r.getProvider("app").getImmediate(),a=new pl(new Dde(r.getProvider("auth-internal")),new Ode(r.getProvider("app-check-internal")),function(c,u){if(!Object.prototype.hasOwnProperty.apply(c.options,["projectId"]))throw new Rt(Xe.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new b1(c.options.projectId,u)}(o,i),o);return s=Object.assign({useFetchStreams:n},s),a._setSettings(s),a},"PUBLIC").setMultipleInstances(!0)),sl(wB,"4.6.4",e),sl(wB,"4.6.4","esm2017")})();var Ome="firebase",Ume="10.12.3";/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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(Ome,Ume,"app");const Fme={apiKey:"AIzaSyA9rwmAgjAlIC-gitEJi7lm5c8xlpgeOdY",authDomain:"connection-280f7.firebaseapp.com",projectId:"connection-280f7",storageBucket:"connection-280f7.appspot.com",messagingSenderId:"514095534536",appId:"1:514095534536:web:6bca02ef3459c41bde70fd",databaseURL:"https://connection-280f7-default-rtdb.europe-west1.firebasedatabase.app"},F3=g8(Fme),Su=gme(F3),bG=(t=[])=>t?t.map(e=>xme(...e)):[],SG=(t=[])=>t?t.map(n=>bme(...bG(n.wheres),...SG(n.ors))):[],jme=t=>t||[],CG=(t,e)=>{let n=[];return e&&n.push(...bG(e.wheres),...SG(e.ors),...jme(e.other)),!t.length%2?eO(Nm(Su,...t),...n):eO(oG(Su,...t),...n)};async function zme(t,e){try{await Lme(Nm(Su,...t),e)}catch(n){console.error("Error adding document: ",n)}}async function rO(t,e){try{return await Dme(oG(Su,...t),e)}catch(n){console.error("Error adding document: ",n)}}async function tc(t,e,n={}){try{const r=CG(t,e),i=await Ime(r),s={};return n.getDoc?s.data=i.docs:n.id?s.data=i.docs.map(o=>({id:o.id,...o.data()})):s.data=i.docs.map(o=>o.data()),n.last&&(s.last=i.docs[i.docs.length-1]),s}catch(r){console.error(r)}}async function om(t,e={}){const n=await Tme(Nm(Su,...t));return e.getDoc?n.docs:n.data()}async function cl(t,e,n){if(n&&(t.length%3||t.length==1)){const r=Bme(Su),{data:i}=await tc(t,n,{getDoc:!0});return i.forEach(async s=>{r.update(s.ref,e)}),await r.commit(),{type:"success",message:"Update is complete"}}else return await Rme(Nm(Su,...t),e),await om(t)}async function Hme(t,e){return await Pme(Nm(Su,...t)),null}function EG(t,e,n){let r=CG(t,n);return Nme(r,i=>{e(i)})}const Bm=Ide(F3);Bm.useDeviceLanguage();const Gme=new Hl,Vme=t=>String(t).toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|.(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/),Wme=t=>String(t).trim().length>=6,$me=(t,e)=>t==e,AG=(t,e)=>{let n={success:!0,type:"success",errors:{}};return Vme(t)||(n.success=!1,n.type="error",n.errors.email={message:"Email is not valid"}),Wme(e)||(n.success=!1,n.type="error",n.errors.password={message:"Password must be at least 6 characters"}),n},Jme=()=>{const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let e="";const n=async()=>{e="#";for(let r=0;r<6;r++)e+=t.charAt(Math.floor(Math.random()*t.length));(await tc(["users"],{wheres:[["tag","==",e]]})).data.length&&n()};return n(),e},TG=t=>zme(["users",t.uid],{displayName:t.displayName,email:t.email,phoneNumber:t.phoneNumber,photoURL:t.photoURL,invitations:[],chats:[],tag:Jme(),uid:t.uid,friends:[]}),IG=t=>{const e=Ms.getState().setUser;e(t),localStorage.setItem("uid",t.uid)};async function Yme({email:t,password:e,confirmPassword:n},r){const i=AG(t,e);if($me(e,n)||(i.success=!1,i.type="error",i.errors.confirmPassword={message:"Сonfirmation password is incorrect"}),i.type=="error")return i;try{const o=(await dfe(Bm,t,e)).user;o.displayName=o.email.split("@")[0],await TG(o),r()}catch(s){console.error(s)}}async function Qme({email:t,password:e},n){const r=AG(t,e);if(r.type=="error")return r;try{await hfe(Bm,t,e),n()}catch(i){console.error(i)}}async function Xme(){try{await vfe(Bm)}catch(t){console.error(t)}}async function LG(t){try{const n=(await Ufe(Bm,Gme)).user;await om(["users",n.uid])||(TG(n),IG(await om(["users",n.uid]))),t()}catch(e){console.error(e)}}gfe(Bm,async t=>{try{if(t){const e=await om(["users",t.uid]);if(e)IG(e);else return}else{Ms.getState().setUser(t);return}}catch(e){console.error(e)}});const Ms=j4(t=>({user:void 0,setUser:e=>t({user:e}),logOut:async()=>{await Xme(),t({user:void 0})}}));mc.propTypes={sx:Cn.object,user:Cn.object,size:Cn.number,current:Cn.bool,adaptiv:Cn.bool};function mc({user:t,current:e,size:n=60,adaptiv:r=!1,...i}){const{user:s}=Ms();function o(l){let c=0,u;for(u=0;u>u*8&255;f+=`00${h.toString(16)}`.slice(-2)}return f}function a(l){return{sx:{bgcolor:o(l),...i.sx,width:r?`calc(${n*.75+"px"} + ${n-n*.75} * ((100vw - 320px) / 1600))`:n,height:r?`calc(${n*.75+"px"} + ${n-n*.75} * ((100vw - 320px) / 1600))`:n,adaptiv:r},children:`${l.split(" ").map(c=>c[0]).join(" ")}`}}return O.jsx(O.Fragment,{children:O.jsx(Pie,{src:t&&t.photoURL||e&&s&&s.photoURL,...i,...t&&a(t.displayName)||s&&a(s.displayName)})})}var j3={},Kme=Ur;Object.defineProperty(j3,"__esModule",{value:!0});var RG=j3.default=void 0,Zme=Kme(si()),qme=O;RG=j3.default=(0,Zme.default)((0,qme.jsx)("path",{d:"M14 8c0-2.21-1.79-4-4-4S6 5.79 6 8s1.79 4 4 4 4-1.79 4-4m3 2v2h6v-2zM2 18v2h16v-2c0-2.66-5.33-4-8-4s-8 1.34-8 4"}),"PersonRemove");const Om=j4(t=>({userSidebar:(()=>{if(window.outerWidth<=1140)return!1;if(localStorage.getItem("userSidebar")=="true")return!0;if(localStorage.getItem("userSidebar")=="false")return!1})(),setUserSidebar:e=>t(()=>(localStorage.setItem("userSidebar",e),{userSidebar:e})),chatList:localStorage.getItem("chatList")=="true"?!0:localStorage.getItem("chatList")!="false",setChatList:e=>t(()=>(localStorage.setItem("chatList",e),{chatList:e})),sidebar:location.pathname.split("/")[1]!="chat",setSidebar:e=>t({sidebar:e})}));let bE=!1;const Fa=j4((t,e)=>({chat:null,setChat:n=>{if(Om.getState().setSidebar(!1),!n){t({chat:n});return}t(r=>{r.messagesWatch&&r.messagesWatch(),bE=!0;const i=EG(["chats",n.id,"messages"],s=>{const o=s.docChanges();if(bE){bE=!1,r.setMessages(o.reverse().map(a=>({id:a.doc.id,...a.doc.data()}))),r.setLastMessageDoc(o[0]?o[0].doc:null);return}t(a=>{const l=[...a.messages];return o.forEach(c=>{if(c.type==="added")l.push({id:c.doc.id,...c.doc.data()});else if(c.type==="modified"){const u=l.findIndex(f=>f.id===c.doc.id);u!==-1&&(l[u]={id:c.doc.id,...c.doc.data()})}}),{messages:l}})},{other:[nx("date","desc"),rx(30)]});return r.setMessagesWatch(i),{chat:n}})},user:null,setUser:n=>t({user:n}),chatList:null,setChatList:n=>{const r=e().setChatScroll;r(n.scrollHeight),setTimeout(()=>{n.scrollTop=n.scrollHeight},500),t({chatList:n})},scrollDown:()=>{const n=e().chatList;n.scrollTop=n.scrollHeight;const r=e().setChatScroll;r(n.scrollHeight)},chatScroll:0,setChatScroll:n=>t({chatScroll:n}),messages:[],setMessages:n=>t({messages:n}),lastMessageDoc:null,setLastMessageDoc:n=>t({lastMessageDoc:n}),messagesWatch:null,setMessagesWatch:n=>t({messagesWatch:n}),setValue:n=>t(n)}));function e0e(){const{user:t,chat:e,setUser:n}=Fa(),{setUserSidebar:r}=Om(),{user:i}=Ms(),s=yl();async function o(){await cl(["users",i.uid],{friends:ix(t.uid)}),await cl(["users",t.uid],{friends:ix(i.uid)}),e&&await Hme(["chats",e.id]),n(null),s("/")}return O.jsxs(t0e,{children:[O.jsx(r0e,{onClick:()=>r(!1)}),O.jsxs(n0e,{children:[O.jsxs(i0e,{children:[O.jsx(s0e,{children:"Information"}),O.jsx(o0e,{onClick:()=>r(!1)})]}),O.jsxs(a0e,{children:[O.jsx(mc,{current:!0,size:70,user:t}),O.jsx(l0e,{children:O.jsx(c0e,{children:t.displayName})})]}),O.jsx(u0e,{children:O.jsxs(m0e,{onClick:o,children:[O.jsxs(h0e,{children:[O.jsx(RG,{css:d0e}),O.jsx("span",{children:"Remove from friends"})]}),O.jsx(p0e,{})]})})]})]})}const t0e=Be.div`
+ @media (max-width: 1140px) {
+ position: absolute;
+ z-index: 10000;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: 100%;
+ height: 100%;
+ padding: 0 5px;
+ }
+`,n0e=Be.aside`
+ display: flex;
+ flex-direction: column;
+ width: 100%;
+ height: 100%;
+ max-width: 350px;
+ background-color: ${Dn.$colorChat};
+ ${En("padding",20,15,1)}
+ ${En("column-gap",15,7.5,1)}
+
+ & * {
+ user-select: none;
+ }
+
+ @media (max-width: 1140px) {
+ height: auto;
+ }
+`,r0e=Be.div`
+ display: none;
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ background: rgba(0, 0, 0, 0.5);
+ z-index: -1;
+ @media (max-width: 1140px) {
+ display: block;
+ }
+`,i0e=Be.div`
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+`,s0e=Be.h2`
+ ${En("font-size",20,18,1)}
+`,o0e=Be(C4)`
+ ${En("font-size",35,24,1)}
+
+ @media (any-hover:hover) {
+ & {
+ cursor: pointer;
+ transition: all 0.3s ease 0s;
+ }
+ &:hover {
+ color: ${Dn.$colorMain};
+ }
+ }
+`,a0e=Be.div`
+ display: flex;
+ align-items: center;
+ ${En("column-gap",15,7.5,1)}
+ ${_l("padding",15,7.5,0,0)}
+ border-bottom: 9px solid #3151A3;
+ ${En("border-bottom-width",9,3,1)}
+`,l0e=Be.div`
+ display: flex;
+ flex-direction: column;
+ overflow: hidden;
+ row-gap: 1px;
+`,c0e=Be.span`
+ ${En("font-size",18,16,1)}
+ display: inline-block;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+`,u0e=Be(uv)`
+ display: flex;
+ flex-direction: column;
+ ${En("row-gap",8,4,1)}
+`,f0e=Be(l2)`
+ border-radius: 999px;
+
+ @media (any-hover: hover) {
+ & {
+ cursor: pointer;
+ transition: all 0.3s ease 0s;
+ }
+ &:hover {
+ background-color: #2d3855;
+ }
+ }
+`,d0e=wl`
+ ${En("font-size",26,22,1)}
+`,h0e=Be.div`
+ display: flex;
+ align-items: center;
+ column-gap: 5px;
+
+ & span {
+ ${En("font-size",18,16,1)}
+ }
+`,p0e=Be.div`
+ display: flex;
+ align-items: center;
+`,m0e=Be(f0e)`
+ color: #be4646;
+`,PG="/Connection/assets/logo-BAk-MPAP.png";var z3={},g0e=Ur;Object.defineProperty(z3,"__esModule",{value:!0});var DG=z3.default=void 0,v0e=g0e(si()),y0e=O;DG=z3.default=(0,v0e.default)((0,y0e.jsx)("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"}),"Search");var H3={},w0e=Ur;Object.defineProperty(H3,"__esModule",{value:!0});var NG=H3.default=void 0,_0e=w0e(si()),M0e=O;NG=H3.default=(0,_0e.default)((0,M0e.jsx)("path",{d:"M13 8c0-2.21-1.79-4-4-4S5 5.79 5 8s1.79 4 4 4 4-1.79 4-4m-2 0c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2M1 18v2h16v-2c0-2.66-5.33-4-8-4s-8 1.34-8 4m2 0c.2-.71 3.3-2 6-2 2.69 0 5.78 1.28 6 2zm17-3v-3h3v-2h-3V7h-2v3h-3v2h3v3z"}),"PersonAddAlt");kG.propTypes={onClose:Cn.func,open:Cn.bool};function kG({onClose:t,open:e}){const n=Ms(),[r,i]=I.useState(""),[s,o]=I.useState({type:"ok",message:"ok"});async function a(){try{const l=r.trim().slice(1,r.trim().length);if(r.trim()[0]!="#"){o({type:"error",message:"The # symbol is required"});return}else if(l.length>6||l.length<6){o({type:"error",message:"Tag should be length 6"});return}o({type:"ok",message:"ok"}),r.trim()!=n.user.tag&&await cl(["users"],{invitations:gI(n.user.uid)},{wheres:[["tag","==",r.trim()]]}),o({type:"success",message:"Invite sent"})}catch(l){console.error(l)}}return O.jsxs(z5,{open:e,onClose:t,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[O.jsx(V5,{id:"alert-dialog-title",children:"Search friends"}),O.jsxs(G5,{children:[O.jsxs(b0e,{children:[O.jsx(x0e,{placeholder:"#User tag",value:r,onChange:l=>i(l.target.value)}),O.jsx(FM,{onClick:a,children:"Invite to friends"})]}),s.type=="error"&&O.jsx(S0e,{children:s.message}),s.type=="success"&&O.jsx(C0e,{children:s.message})]}),O.jsx(H5,{children:O.jsx(FM,{onClick:t,children:"Cancel"})})]})}const x0e=Be(a2)`
+ font-size: 20px;
+`,b0e=Be.div`
+ display: flex;
+ align-items: center;
+ column-gap: 5px;
+`,S0e=Be.div`
+ color: ${Dn.$colorError};
+ margin-top: 10px;
+ font-size: 16px;
+`,C0e=Be.div`
+ color: ${Dn.$colorSuccess};
+ margin-top: 10px;
+ font-size: 16px;
+`;function E0e(){const[t,e]=I.useState(!1),[n,r]=I.useState(""),[i,s]=I.useState(!1),[o,a]=I.useState(null),l=I.useRef(null),{user:c}=Ms(),{setUser:u,setChat:f,chat:h}=Fa(),m=yl();function v(){e(!0)}function w(){e(!1)}function y(_){l.current&&clearTimeout(l.current),l.current=setTimeout(async()=>{const{data:x}=await tc(["users"],{wheres:[["uid","in",c.friends],["displayName",">=",_.target.value]]});a(x)},500)}function g(_){return async()=>{if(h&&h.pair.includes(_.uid)&&h.pair.includes(c.uid))return;const x=[_.uid,c.uid],S=(await tc(["chats"],{ors:[{wheres:[["pair","==",x],["pair","==",x.toReversed()]]}]})).data[0];f(S),u(_),m(S?`/chat/${S.id}`:`/friend/${_.uid}`)}}return O.jsxs(O.Fragment,{children:[O.jsx(A0e,{position:"sticky",children:O.jsxs(T0e,{children:[O.jsx(I0e,{src:PG,alt:"Logo",className:i&&"none"}),O.jsxs(L0e,{children:[O.jsx(R0e,{placeholder:"Search...",value:n,onChange:_=>r(_.target.value),onFocus:()=>s(!0),onBlur:()=>s(!1),onInput:y}),O.jsx(k0e,{}),O.jsx(P0e,{className:i&&o&&"visible",children:o&&O.jsx(O.Fragment,{children:o.length?o.map(_=>O.jsxs(D0e,{onClick:g(_),children:[O.jsx(mc,{user:_,size:50}),O.jsx(N0e,{children:_.displayName})]},_.uid)):O.jsx(O0e,{children:"Not found"})})})]}),O.jsx(B0e,{onClick:v,className:i&&"none"})]})}),O.jsx(kG,{open:t,onClose:w})]})}const A0e=Be(zre)`
+ background-color: transparent;
+ background-image: none;
+ box-shadow: none;
+`,T0e=Be(ale)`
+ ${En("column-gap",10,6,1)}
+ padding: 0 10px !important;
+`,I0e=Be.img`
+ width: 100%;
+ max-width: 45px;
+ object-fit: cover;
+ transition: all 0.2s ease-in-out 0s;
+
+ &.none {
+ max-width: 0;
+ }
+`,L0e=Be.div`
+ background-color: #303030;
+ border-radius: 999px;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ ${_l("padding",6,4,10,6)}
+ flex: 1 1 auto;
+ transition: all 0.3s ease 0s;
+ position: relative;
+`,R0e=Be.input`
+ ${En("font-size",16,14,1)}
+ background: transparent;
+ width: 100%;
+ padding-right: 10px;
+`,P0e=Be.ul`
+ position: absolute;
+ display: flex;
+ flex-direction: column;
+ top: calc(100% + 5px);
+ width: 100%;
+ left: 0;
+ border-radius: 15px;
+ background: #333;
+ padding: 5px 0;
+ overflow: auto;
+ max-height: 40vh;
+ opacity: 0;
+ transition: all 0.1s ease 0.1s;
+
+ &.visible {
+ opacity: 1;
+ }
+`,D0e=Be.li`
+ display: flex;
+ align-items: center;
+ column-gap: 5px;
+ padding: 5px 10px;
+
+ @media (any-hover: hover) {
+ & {
+ cursor: pointer;
+ transition: all 0.3s ease 0s;
+ }
+ &:hover {
+ background: #444;
+ }
+ }
+`,N0e=Be.span`
+ font-size: 15px;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ overflow: hidden;
+`,k0e=Be(DG)`
+ ${En("font-size",30,24,1)}
+`,B0e=Be(NG)`
+ ${En("font-size",30,28,1)}
+ transition: all 0.2s ease 0s;
+
+ &.none {
+ width: 0;
+ }
+ @media (any-hover: hover) {
+ & {
+ cursor: pointer;
+ transition: all 0.3s ease 0s;
+ }
+ &:hover {
+ color: ${Dn.$colorMain};
+ }
+ }
+`,O0e=Be.div`
+ font-size: 20px;
+ text-align: center;
+ padding: 20px 0;
+`;var G3={},U0e=Ur;Object.defineProperty(G3,"__esModule",{value:!0});var BG=G3.default=void 0,F0e=U0e(si()),j0e=O;BG=G3.default=(0,F0e.default)((0,j0e.jsx)("path",{d:"M20 2H4.01c-1.1 0-2 .9-2 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-8 4c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2m4 8H8v-.57c0-.81.48-1.53 1.22-1.85.85-.37 1.79-.58 2.78-.58.99 0 1.93.21 2.78.58.74.32 1.22 1.04 1.22 1.85z"}),"ThreeP");var V3={},z0e=Ur;Object.defineProperty(V3,"__esModule",{value:!0});var OG=V3.default=void 0,H0e=z0e(si()),G0e=O;OG=V3.default=(0,H0e.default)((0,G0e.jsx)("path",{d:"M12 12.75c1.63 0 3.07.39 4.24.9 1.08.48 1.76 1.56 1.76 2.73V18H6v-1.61c0-1.18.68-2.26 1.76-2.73 1.17-.52 2.61-.91 4.24-.91M4 13c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m1.13 1.1c-.37-.06-.74-.1-1.13-.1-.99 0-1.93.21-2.78.58C.48 14.9 0 15.62 0 16.43V18h4.5v-1.61c0-.83.23-1.61.63-2.29M20 13c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m4 3.43c0-.81-.48-1.53-1.22-1.85-.85-.37-1.79-.58-2.78-.58-.39 0-.76.04-1.13.1.4.68.63 1.46.63 2.29V18H24zM12 6c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3"}),"Groups");var W3={},V0e=Ur;Object.defineProperty(W3,"__esModule",{value:!0});var UG=W3.default=void 0,W0e=V0e(si()),$0e=O;UG=W3.default=(0,W0e.default)((0,$0e.jsx)("path",{d:"M3 18h18v-2H3zm0-5h18v-2H3zm0-7v2h18V6z"}),"Menu");var $3={},J0e=Ur;Object.defineProperty($3,"__esModule",{value:!0});var FG=$3.default=void 0,Y0e=J0e(si()),Q0e=O;FG=$3.default=(0,Y0e.default)((0,Q0e.jsx)("path",{d:"m17 7-1.41 1.41L18.17 11H8v2h10.17l-2.58 2.58L17 17l5-5zM4 5h8V3H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h8v-2H4z"}),"Logout");var N2={},X0e=function(){var t=document.getSelection();if(!t.rangeCount)return function(){};for(var e=document.activeElement,n=[],r=0;r"u"){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var f=iO[e.format]||iO.default;window.clipboardData.setData(f,t)}else u.clipboardData.clearData(),u.clipboardData.setData(e.format,t);e.onCopy&&(u.preventDefault(),e.onCopy(u.clipboardData))}),document.body.appendChild(a),s.selectNodeContents(a),o.addRange(s);var c=document.execCommand("copy");if(!c)throw new Error("copy command was unsuccessful");l=!0}catch(u){n&&console.error("unable to copy using execCommand: ",u),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(e.format||"text",t),e.onCopy&&e.onCopy(window.clipboardData),l=!0}catch(f){n&&console.error("unable to copy using clipboardData: ",f),n&&console.error("falling back to prompt"),r=q0e("message"in e?e.message:Z0e),window.prompt(r,t)}}finally{o&&(typeof o.removeRange=="function"?o.removeRange(s):o.removeAllRanges()),a&&document.body.removeChild(a),i()}return l}var tge=ege;function vI(t){"@babel/helpers - typeof";return vI=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vI(t)}Object.defineProperty(N2,"__esModule",{value:!0});N2.CopyToClipboard=void 0;var hw=jG(I),nge=jG(tge),rge=["text","onCopy","options","children"];function jG(t){return t&&t.__esModule?t:{default:t}}function sO(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function oO(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function sge(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,s;for(s=0;s=0)&&(n[i]=t[i]);return n}function oge(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function age(t,e){for(var n=0;n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function sx(t){return sx=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},sx(t)}function J3(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var HG=function(t){cge(n,t);var e=uge(n);function n(){var r;oge(this,n);for(var i=arguments.length,s=new Array(i),o=0;oEn("font-size",t,t-2,1)}
+`,_ge=Be.input`
+ background-color: transparent;
+ color: #fff;
+ position: relative;
+ width: 100%;
+ border-bottom: 1px solid #fff;
+ z-index: 1;
+ ${({size:t})=>En("font-size",t,t-2,1)}
+
+ &:focus ~ label,
+ &:valid ~ label {
+ /* transform: translateY(calc(-100% - 0px)); */
+ bottom: calc(70%);
+ font-size: 80%;
+ }
+ ${t=>t.error&&"border-color:red"}
+`,Mge=Be.span`
+ font-size: 16px;
+ color: ${Dn.$colorError};
+`;var Q3={},xge=Ur;Object.defineProperty(Q3,"__esModule",{value:!0});var VG=Q3.default=void 0,bge=xge(si()),Sge=O;VG=Q3.default=(0,bge.default)((0,Sge.jsx)("path",{d:"M5 20h14v-2H5zm0-10h4v6h6v-6h4l-7-7z"}),"Upload");/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 WG="firebasestorage.googleapis.com",$G="storageBucket",Cge=2*60*1e3,Ege=10*60*1e3;/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 $r extends Ml{constructor(e,n,r=0){super(SE(e),`Firebase Storage: ${n} (${SE(e)})`),this.status_=r,this.customData={serverResponse:null},this._baseMessage=this.message,Object.setPrototypeOf(this,$r.prototype)}get status(){return this.status_}set status(e){this.status_=e}_codeEquals(e){return SE(e)===this.code}get serverResponse(){return this.customData.serverResponse}set serverResponse(e){this.customData.serverResponse=e,this.customData.serverResponse?this.message=`${this._baseMessage}
+${this.customData.serverResponse}`:this.message=this._baseMessage}}var Wr;(function(t){t.UNKNOWN="unknown",t.OBJECT_NOT_FOUND="object-not-found",t.BUCKET_NOT_FOUND="bucket-not-found",t.PROJECT_NOT_FOUND="project-not-found",t.QUOTA_EXCEEDED="quota-exceeded",t.UNAUTHENTICATED="unauthenticated",t.UNAUTHORIZED="unauthorized",t.UNAUTHORIZED_APP="unauthorized-app",t.RETRY_LIMIT_EXCEEDED="retry-limit-exceeded",t.INVALID_CHECKSUM="invalid-checksum",t.CANCELED="canceled",t.INVALID_EVENT_NAME="invalid-event-name",t.INVALID_URL="invalid-url",t.INVALID_DEFAULT_BUCKET="invalid-default-bucket",t.NO_DEFAULT_BUCKET="no-default-bucket",t.CANNOT_SLICE_BLOB="cannot-slice-blob",t.SERVER_FILE_WRONG_SIZE="server-file-wrong-size",t.NO_DOWNLOAD_URL="no-download-url",t.INVALID_ARGUMENT="invalid-argument",t.INVALID_ARGUMENT_COUNT="invalid-argument-count",t.APP_DELETED="app-deleted",t.INVALID_ROOT_OPERATION="invalid-root-operation",t.INVALID_FORMAT="invalid-format",t.INTERNAL_ERROR="internal-error",t.UNSUPPORTED_ENVIRONMENT="unsupported-environment"})(Wr||(Wr={}));function SE(t){return"storage/"+t}function X3(){const t="An unknown error occurred, please check the error payload for server response.";return new $r(Wr.UNKNOWN,t)}function Age(t){return new $r(Wr.OBJECT_NOT_FOUND,"Object '"+t+"' does not exist.")}function Tge(t){return new $r(Wr.QUOTA_EXCEEDED,"Quota for bucket '"+t+"' exceeded, please view quota on https://firebase.google.com/pricing/.")}function Ige(){const t="User is not authenticated, please authenticate using Firebase Authentication and try again.";return new $r(Wr.UNAUTHENTICATED,t)}function Lge(){return new $r(Wr.UNAUTHORIZED_APP,"This app does not have permission to access Firebase Storage on this project.")}function Rge(t){return new $r(Wr.UNAUTHORIZED,"User does not have permission to access '"+t+"'.")}function Pge(){return new $r(Wr.RETRY_LIMIT_EXCEEDED,"Max retry time for operation exceeded, please try again.")}function Dge(){return new $r(Wr.CANCELED,"User canceled the upload/download.")}function Nge(t){return new $r(Wr.INVALID_URL,"Invalid URL '"+t+"'.")}function kge(t){return new $r(Wr.INVALID_DEFAULT_BUCKET,"Invalid default bucket '"+t+"'.")}function Bge(){return new $r(Wr.NO_DEFAULT_BUCKET,"No default bucket found. Did you set the '"+$G+"' property when initializing the app?")}function Oge(){return new $r(Wr.CANNOT_SLICE_BLOB,"Cannot slice blob for upload. Please retry the upload.")}function Uge(){return new $r(Wr.NO_DOWNLOAD_URL,"The given file does not have any download URLs.")}function Fge(t){return new $r(Wr.UNSUPPORTED_ENVIRONMENT,`${t} is missing. Make sure to install the required polyfills. See https://firebase.google.com/docs/web/environments-js-sdk#polyfills for more information.`)}function _I(t){return new $r(Wr.INVALID_ARGUMENT,t)}function JG(){return new $r(Wr.APP_DELETED,"The Firebase app was deleted.")}function jge(t){return new $r(Wr.INVALID_ROOT_OPERATION,"The operation '"+t+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}function Og(t,e){return new $r(Wr.INVALID_FORMAT,"String does not match format '"+t+"': "+e)}function N0(t){throw new $r(Wr.INTERNAL_ERROR,"Internal error: "+t)}/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 _o{constructor(e,n){this.bucket=e,this.path_=n}get path(){return this.path_}get isRoot(){return this.path.length===0}fullServerUrl(){const e=encodeURIComponent;return"/b/"+e(this.bucket)+"/o/"+e(this.path)}bucketOnlyServerUrl(){return"/b/"+encodeURIComponent(this.bucket)+"/o"}static makeFromBucketSpec(e,n){let r;try{r=_o.makeFromUrl(e,n)}catch{return new _o(e,"")}if(r.path==="")return r;throw kge(e)}static makeFromUrl(e,n){let r=null;const i="([A-Za-z0-9.\\-_]+)";function s(S){S.path.charAt(S.path.length-1)==="/"&&(S.path_=S.path_.slice(0,-1))}const o="(/(.*))?$",a=new RegExp("^gs://"+i+o,"i"),l={bucket:1,path:3};function c(S){S.path_=decodeURIComponent(S.path)}const u="v[A-Za-z0-9_]+",f=n.replace(/[.]/g,"\\."),h="(/([^?#]*).*)?$",m=new RegExp(`^https?://${f}/${u}/b/${i}/o${h}`,"i"),v={bucket:1,path:3},w=n===WG?"(?:storage.googleapis.com|storage.cloud.google.com)":n,y="([^?#]*)",g=new RegExp(`^https?://${w}/${i}/${y}`,"i"),x=[{regex:a,indices:l,postModify:s},{regex:m,indices:v,postModify:c},{regex:g,indices:{bucket:1,path:2},postModify:c}];for(let S=0;S{i=null,t(m,l())},y)}function h(){s&&clearTimeout(s)}function m(y,...g){if(c){h();return}if(y){h(),u.call(null,y,...g);return}if(l()||o){h(),u.call(null,y,...g);return}r<64&&(r*=2);let x;a===1?(a=2,x=0):x=(r+Math.random())*1e3,f(x)}let v=!1;function w(y){v||(v=!0,h(),!c&&(i!==null?(y||(a=2),clearTimeout(i),f(0)):y||(a=1)))}return f(0),s=setTimeout(()=>{o=!0,w(!0)},n),w}function Gge(t){t(!1)}/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Vge(t){return t!==void 0}function Wge(t){return typeof t=="object"&&!Array.isArray(t)}function K3(t){return typeof t=="string"||t instanceof String}function aO(t){return Z3()&&t instanceof Blob}function Z3(){return typeof Blob<"u"}function lO(t,e,n,r){if(rn)throw _I(`Invalid value for '${t}'. Expected ${n} or less.`)}/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 k2(t,e,n){let r=e;return n==null&&(r=`https://${e}`),`${n}://${r}/v0${t}`}function YG(t){const e=encodeURIComponent;let n="?";for(const r in t)if(t.hasOwnProperty(r)){const i=e(r)+"="+e(t[r]);n=n+i+"&"}return n=n.slice(0,-1),n}/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 rd;(function(t){t[t.NO_ERROR=0]="NO_ERROR",t[t.NETWORK_ERROR=1]="NETWORK_ERROR",t[t.ABORT=2]="ABORT"})(rd||(rd={}));/**
+ * @license
+ * Copyright 2022 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 $ge(t,e){const n=t>=500&&t<600,i=[408,429].indexOf(t)!==-1,s=e.indexOf(t)!==-1;return n||i||s}/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Jge{constructor(e,n,r,i,s,o,a,l,c,u,f,h=!0){this.url_=e,this.method_=n,this.headers_=r,this.body_=i,this.successCodes_=s,this.additionalRetryCodes_=o,this.callback_=a,this.errorCallback_=l,this.timeout_=c,this.progressCallback_=u,this.connectionFactory_=f,this.retry=h,this.pendingConnection_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.promise_=new Promise((m,v)=>{this.resolve_=m,this.reject_=v,this.start_()})}start_(){const e=(r,i)=>{if(i){r(!1,new pw(!1,null,!0));return}const s=this.connectionFactory_();this.pendingConnection_=s;const o=a=>{const l=a.loaded,c=a.lengthComputable?a.total:-1;this.progressCallback_!==null&&this.progressCallback_(l,c)};this.progressCallback_!==null&&s.addUploadProgressListener(o),s.send(this.url_,this.method_,this.body_,this.headers_).then(()=>{this.progressCallback_!==null&&s.removeUploadProgressListener(o),this.pendingConnection_=null;const a=s.getErrorCode()===rd.NO_ERROR,l=s.getStatus();if(!a||$ge(l,this.additionalRetryCodes_)&&this.retry){const u=s.getErrorCode()===rd.ABORT;r(!1,new pw(!1,null,u));return}const c=this.successCodes_.indexOf(l)!==-1;r(!0,new pw(c,s))})},n=(r,i)=>{const s=this.resolve_,o=this.reject_,a=i.connection;if(i.wasSuccessCode)try{const l=this.callback_(a,a.getResponse());Vge(l)?s(l):s()}catch(l){o(l)}else if(a!==null){const l=X3();l.serverResponse=a.getErrorText(),this.errorCallback_?o(this.errorCallback_(a,l)):o(l)}else if(i.canceled){const l=this.appDelete_?JG():Dge();o(l)}else{const l=Pge();o(l)}};this.canceled_?n(!1,new pw(!1,null,!0)):this.backoffId_=Hge(e,n,this.timeout_)}getPromise(){return this.promise_}cancel(e){this.canceled_=!0,this.appDelete_=e||!1,this.backoffId_!==null&&Gge(this.backoffId_),this.pendingConnection_!==null&&this.pendingConnection_.abort()}}class pw{constructor(e,n,r){this.wasSuccessCode=e,this.connection=n,this.canceled=!!r}}function Yge(t,e){e!==null&&e.length>0&&(t.Authorization="Firebase "+e)}function Qge(t,e){t["X-Firebase-Storage-Version"]="webjs/"+(e??"AppManager")}function Xge(t,e){e&&(t["X-Firebase-GMPID"]=e)}function Kge(t,e){e!==null&&(t["X-Firebase-AppCheck"]=e)}function Zge(t,e,n,r,i,s,o=!0){const a=YG(t.urlParams),l=t.url+a,c=Object.assign({},t.headers);return Xge(c,e),Yge(c,n),Qge(c,s),Kge(c,r),new Jge(l,t.method,c,t.body,t.successCodes,t.additionalRetryCodes,t.handler,t.errorHandler,t.timeout,t.progressCallback,i,o)}/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 qge(){return typeof BlobBuilder<"u"?BlobBuilder:typeof WebKitBlobBuilder<"u"?WebKitBlobBuilder:void 0}function e1e(...t){const e=qge();if(e!==void 0){const n=new e;for(let r=0;r"u")throw Fge("base-64");return atob(t)}/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 el={RAW:"raw",BASE64:"base64",BASE64URL:"base64url",DATA_URL:"data_url"};class CE{constructor(e,n){this.data=e,this.contentType=n||null}}function r1e(t,e){switch(t){case el.RAW:return new CE(QG(e));case el.BASE64:case el.BASE64URL:return new CE(XG(t,e));case el.DATA_URL:return new CE(s1e(e),o1e(e))}throw X3()}function QG(t){const e=[];for(let n=0;n>6,128|r&63);else if((r&64512)===55296)if(!(n>18,128|r>>12&63,128|r>>6&63,128|r&63)}else(r&64512)===56320?e.push(239,191,189):e.push(224|r>>12,128|r>>6&63,128|r&63)}return new Uint8Array(e)}function i1e(t){let e;try{e=decodeURIComponent(t)}catch{throw Og(el.DATA_URL,"Malformed data URL.")}return QG(e)}function XG(t,e){switch(t){case el.BASE64:{const i=e.indexOf("-")!==-1,s=e.indexOf("_")!==-1;if(i||s)throw Og(t,"Invalid character '"+(i?"-":"_")+"' found: is it base64url encoded?");break}case el.BASE64URL:{const i=e.indexOf("+")!==-1,s=e.indexOf("/")!==-1;if(i||s)throw Og(t,"Invalid character '"+(i?"+":"/")+"' found: is it base64 encoded?");e=e.replace(/-/g,"+").replace(/_/g,"/");break}}let n;try{n=n1e(e)}catch(i){throw i.message.includes("polyfill")?i:Og(t,"Invalid character found")}const r=new Uint8Array(n.length);for(let i=0;i][;base64],");const r=n[1]||null;r!=null&&(this.base64=a1e(r,";base64"),this.contentType=this.base64?r.substring(0,r.length-7):r),this.rest=e.substring(e.indexOf(",")+1)}}function s1e(t){const e=new KG(t);return e.base64?XG(el.BASE64,e.rest):i1e(e.rest)}function o1e(t){return new KG(t).contentType}function a1e(t,e){return t.length>=e.length?t.substring(t.length-e.length)===e:!1}/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 qc{constructor(e,n){let r=0,i="";aO(e)?(this.data_=e,r=e.size,i=e.type):e instanceof ArrayBuffer?(n?this.data_=new Uint8Array(e):(this.data_=new Uint8Array(e.byteLength),this.data_.set(new Uint8Array(e))),r=this.data_.length):e instanceof Uint8Array&&(n?this.data_=e:(this.data_=new Uint8Array(e.length),this.data_.set(e)),r=e.length),this.size_=r,this.type_=i}size(){return this.size_}type(){return this.type_}slice(e,n){if(aO(this.data_)){const r=this.data_,i=t1e(r,e,n);return i===null?null:new qc(i)}else{const r=new Uint8Array(this.data_.buffer,e,n-e);return new qc(r,!0)}}static getBlob(...e){if(Z3()){const n=e.map(r=>r instanceof qc?r.data_:r);return new qc(e1e.apply(null,n))}else{const n=e.map(o=>K3(o)?r1e(el.RAW,o).data:o.data_);let r=0;n.forEach(o=>{r+=o.byteLength});const i=new Uint8Array(r);let s=0;return n.forEach(o=>{for(let a=0;ar.length>0).join("/");return t.length===0?n:t+"/"+n}function qG(t){const e=t.lastIndexOf("/",t.length-2);return e===-1?t:t.slice(e+1)}/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 u1e(t,e){return e}class As{constructor(e,n,r,i){this.server=e,this.local=n||e,this.writable=!!r,this.xform=i||u1e}}let mw=null;function f1e(t){return!K3(t)||t.length<2?t:qG(t)}function eV(){if(mw)return mw;const t=[];t.push(new As("bucket")),t.push(new As("generation")),t.push(new As("metageneration")),t.push(new As("name","fullPath",!0));function e(s,o){return f1e(o)}const n=new As("name");n.xform=e,t.push(n);function r(s,o){return o!==void 0?Number(o):o}const i=new As("size");return i.xform=r,t.push(i),t.push(new As("timeCreated")),t.push(new As("updated")),t.push(new As("md5Hash",null,!0)),t.push(new As("cacheControl",null,!0)),t.push(new As("contentDisposition",null,!0)),t.push(new As("contentEncoding",null,!0)),t.push(new As("contentLanguage",null,!0)),t.push(new As("contentType",null,!0)),t.push(new As("metadata","customMetadata",!0)),mw=t,mw}function d1e(t,e){function n(){const r=t.bucket,i=t.fullPath,s=new _o(r,i);return e._makeStorageReference(s)}Object.defineProperty(t,"ref",{get:n})}function h1e(t,e,n){const r={};r.type="file";const i=n.length;for(let s=0;s{const u=t.bucket,f=t.fullPath,h="/b/"+o(u)+"/o/"+o(f),m=k2(h,n,r),v=YG({alt:"media",token:c});return m+v})[0]}function m1e(t,e){const n={},r=e.length;for(let i=0;i{this.xhr_.addEventListener("abort",()=>{this.errorCode_=rd.ABORT,e()}),this.xhr_.addEventListener("error",()=>{this.errorCode_=rd.NETWORK_ERROR,e()}),this.xhr_.addEventListener("load",()=>{e()})})}send(e,n,r,i){if(this.sent_)throw N0("cannot .send() more than once");if(this.sent_=!0,this.xhr_.open(n,e,!0),i!==void 0)for(const s in i)i.hasOwnProperty(s)&&this.xhr_.setRequestHeader(s,i[s].toString());return r!==void 0?this.xhr_.send(r):this.xhr_.send(),this.sendPromise_}getErrorCode(){if(!this.sent_)throw N0("cannot .getErrorCode() before sending");return this.errorCode_}getStatus(){if(!this.sent_)throw N0("cannot .getStatus() before sending");try{return this.xhr_.status}catch{return-1}}getResponse(){if(!this.sent_)throw N0("cannot .getResponse() before sending");return this.xhr_.response}getErrorText(){if(!this.sent_)throw N0("cannot .getErrorText() before sending");return this.xhr_.statusText}abort(){this.xhr_.abort()}getResponseHeader(e){return this.xhr_.getResponseHeader(e)}addUploadProgressListener(e){this.xhr_.upload!=null&&this.xhr_.upload.addEventListener("progress",e)}removeUploadProgressListener(e){this.xhr_.upload!=null&&this.xhr_.upload.removeEventListener("progress",e)}}class S1e extends b1e{initXhr(){this.xhr_.responseType="text"}}function eR(){return new S1e}/**
+ * @license
+ * Copyright 2019 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 Cd{constructor(e,n){this._service=e,n instanceof _o?this._location=n:this._location=_o.makeFromUrl(n,e.host)}toString(){return"gs://"+this._location.bucket+"/"+this._location.path}_newRef(e,n){return new Cd(e,n)}get root(){const e=new _o(this._location.bucket,"");return this._newRef(this._service,e)}get bucket(){return this._location.bucket}get fullPath(){return this._location.path}get name(){return qG(this._location.path)}get storage(){return this._service}get parent(){const e=l1e(this._location.path);if(e===null)return null;const n=new _o(this._location.bucket,e);return new Cd(this._service,n)}_throwIfRoot(e){if(this._location.path==="")throw jge(e)}}function C1e(t,e,n){t._throwIfRoot("uploadBytes");const r=x1e(t.storage,t._location,eV(),new qc(e,!0),n);return t.storage.makeRequestWithTokens(r,eR).then(i=>({metadata:i,ref:t}))}function E1e(t){t._throwIfRoot("getDownloadURL");const e=y1e(t.storage,t._location,eV());return t.storage.makeRequestWithTokens(e,eR).then(n=>{if(n===null)throw Uge();return n})}function A1e(t){t._throwIfRoot("deleteObject");const e=w1e(t.storage,t._location);return t.storage.makeRequestWithTokens(e,eR)}function T1e(t,e){const n=c1e(t._location.path,e),r=new _o(t._location.bucket,n);return new Cd(t.storage,r)}/**
+ * @license
+ * Copyright 2017 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 I1e(t){return/^[A-Za-z]+:\/\//.test(t)}function L1e(t,e){return new Cd(t,e)}function sV(t,e){if(t instanceof tR){const n=t;if(n._bucket==null)throw Bge();const r=new Cd(n,n._bucket);return e!=null?sV(r,e):r}else return e!==void 0?T1e(t,e):t}function R1e(t,e){if(e&&I1e(e)){if(t instanceof tR)return L1e(t,e);throw _I("To use ref(service, url), the first argument must be a Storage instance.")}else return sV(t,e)}function cO(t,e){const n=e==null?void 0:e[$G];return n==null?null:_o.makeFromBucketSpec(n,t)}function P1e(t,e,n,r={}){t.host=`${e}:${n}`,t._protocol="http";const{mockUserToken:i}=r;i&&(t._overrideAuthToken=typeof i=="string"?i:h8(i,t.app.options.projectId))}class tR{constructor(e,n,r,i,s){this.app=e,this._authProvider=n,this._appCheckProvider=r,this._url=i,this._firebaseVersion=s,this._bucket=null,this._host=WG,this._protocol="https",this._appId=null,this._deleted=!1,this._maxOperationRetryTime=Cge,this._maxUploadRetryTime=Ege,this._requests=new Set,i!=null?this._bucket=_o.makeFromBucketSpec(i,this._host):this._bucket=cO(this._host,this.app.options)}get host(){return this._host}set host(e){this._host=e,this._url!=null?this._bucket=_o.makeFromBucketSpec(this._url,e):this._bucket=cO(e,this.app.options)}get maxUploadRetryTime(){return this._maxUploadRetryTime}set maxUploadRetryTime(e){lO("time",0,Number.POSITIVE_INFINITY,e),this._maxUploadRetryTime=e}get maxOperationRetryTime(){return this._maxOperationRetryTime}set maxOperationRetryTime(e){lO("time",0,Number.POSITIVE_INFINITY,e),this._maxOperationRetryTime=e}async _getAuthToken(){if(this._overrideAuthToken)return this._overrideAuthToken;const e=this._authProvider.getImmediate({optional:!0});if(e){const n=await e.getToken();if(n!==null)return n.accessToken}return null}async _getAppCheckToken(){const e=this._appCheckProvider.getImmediate({optional:!0});return e?(await e.getToken()).token:null}_delete(){return this._deleted||(this._deleted=!0,this._requests.forEach(e=>e.cancel()),this._requests.clear()),Promise.resolve()}_makeStorageReference(e){return new Cd(this,e)}_makeRequest(e,n,r,i,s=!0){if(this._deleted)return new zge(JG());{const o=Zge(e,this._appId,r,i,n,this._firebaseVersion,s);return this._requests.add(o),o.getPromise().then(()=>this._requests.delete(o),()=>this._requests.delete(o)),o}}async makeRequestWithTokens(e,n){const[r,i]=await Promise.all([this._getAuthToken(),this._getAppCheckToken()]);return this._makeRequest(e,n,r,i).getPromise()}}const uO="@firebase/storage",fO="0.12.6";/**
+ * @license
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 oV="storage";function D1e(t,e,n){return t=mr(t),C1e(t,e,n)}function N1e(t){return t=mr(t),E1e(t)}function k1e(t){return t=mr(t),A1e(t)}function aV(t,e){return t=mr(t),R1e(t,e)}function B1e(t=G4(),e){t=mr(t);const r=f2(t,oV).getImmediate({identifier:e}),i=u8("storage");return i&&O1e(r,...i),r}function O1e(t,e,n,r={}){P1e(t,e,n,r)}function U1e(t,{instanceIdentifier:e}){const n=t.getProvider("app").getImmediate(),r=t.getProvider("auth-internal"),i=t.getProvider("app-check-internal");return new tR(n,r,i,e,Bd)}function F1e(){wd(new _u(oV,U1e,"PUBLIC").setMultipleInstances(!0)),sl(uO,fO,""),sl(uO,fO,"esm2017")}F1e();const lV=B1e(F3);async function MI(t,e=[]){try{if(!e.length)return[];const{user:n}=Ms.getState(),r=Array.from(e).map(async i=>new Promise(s=>{const o=aV(lV,[...t,i.name+"-"+n.uid+new Date().toISOString()].join("/"));D1e(o,i).then(a=>{N1e(a.ref).then(l=>{s(l)})})}));return Promise.all(r)}catch(n){console.error(n)}}async function dO(t){try{const e=aV(lV,t.join("/"));await k1e(e)}catch(e){return{type:"error",error:e}}}cV.propTypes={open:Cn.bool,onClose:Cn.func};function cV({open:t,onClose:e}){const{user:n,setUser:r}=Ms(),[i,s]=I.useState(n),[o,a]=I.useState(),[l,c]=I.useState(!1),[u,f]=I.useState(!1),h=()=>y=>s({...i,displayName:y.target.value}),m=()=>y=>s({...i,phoneNumber:y.target.value}),v=y=>{const g=y.target.files[0];if(c(!1),!FileReader)return;if(!g){c(!0),a(null),s({...i,photoURL:null});return}a(g);const _=new FileReader;_.onload=()=>{s({...i,photoURL:_.result})},_.readAsDataURL(g)},w=async()=>{const y=i;if(o){await dO([n.photoURL]);const[g]=await MI(["avatars"],[o]);y.photoURL=g}else l&&await dO([n.photoURL]);await cl(["users",n.uid],y),await cl(["chats"],{["users."+[n.uid]]:y},{wheres:[["pair","array-contains",n.uid]]}),r(y),f(!0),e(),setTimeout(()=>{f(!1)},2e3)};return O.jsxs(O.Fragment,{children:[O.jsxs(z5,{open:t,onClose:e,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[O.jsx(V5,{id:"alert-dialog-title",children:"Edit profile"}),O.jsxs(j1e,{sx:{overflow:"visible"},children:[O.jsxs(H1e,{children:[O.jsxs(z1e,{htmlFor:"avatar",children:[O.jsx(mc,{src:i.photoURL,size:80}),O.jsx(G1e,{})]}),O.jsx(V1e,{type:"file",name:"avatar",id:"avatar",onChange:v,accept:".png, .jpg, .jpeg, .webp, .avif, .heic, .gif"})]}),O.jsx(Zc,{id:"username",placeholder:"Username",value:i.displayName,onChange:h()}),O.jsx(Zc,{id:"phone",placeholder:"Phone",value:i.phoneNumber||"",onChange:m()})]}),O.jsxs(H5,{children:[O.jsx(FM,{onClick:e,children:"Cancel"}),O.jsx(FM,{onClick:w,autoFocus:!0,children:"Confirm"})]})]}),O.jsx(e8,{open:u,children:O.jsx(k5,{severity:"success",children:"Profile changed!"})})]})}const j1e=Be(G5)`
+ display: flex;
+ flex-direction: column;
+ align-items: start;
+ row-gap: 15px;
+`,z1e=Be.label`
+ cursor: pointer;
+`,H1e=Be.div`
+ position: relative;
+
+ .avatar {
+ transition: all 0.3s ease 0s;
+ }
+
+ @media (any-hover: hover) {
+ & {
+ cursor: pointer;
+ transition: all 0.3s ease 0s;
+ }
+ &:hover {
+ & svg {
+ opacity: 1;
+ }
+
+ & .avatar {
+ filter: brightness(0.5);
+ }
+ }
+ }
+`,G1e=Be(VG)`
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ font-size: 40px;
+ opacity: 0;
+ z-index: 2;
+`,V1e=Be.input`
+ display: none;
+`;uV.propTypes={open:Cn.bool,toggle:Cn.func};function uV({open:t,toggle:e}){const{user:n}=Ms(),[r,i]=I.useState(!1),[s,o]=I.useState(!1);function a(){i(!0),setTimeout(()=>{i(!1)},2e3)}return O.jsxs(O.Fragment,{children:[O.jsx(cV,{open:s,onClose:()=>o(!1)}),O.jsx(nle,{sx:{paper:{background:"red"}},swipeAreaWidth:5,open:t,anchor:"left",onOpen:e(!0),onClose:e(!1),PaperProps:{sx:{backgroundColor:Dn.$colorAside,backgroundImage:"none"}},children:O.jsx(W1e,{role:"presentation",children:n&&O.jsxs($1e,{children:[O.jsxs(X1e,{justifyBetween:!0,itemsStart:!0,children:[O.jsx(Q1e,{size:80,current:!0}),O.jsx(K1e,{onClick:()=>o(!0)})]}),O.jsx(J1e,{children:n.displayName}),O.jsx(pge.CopyToClipboard,{text:n.tag,onCopy:a,children:O.jsx(Y1e,{className:r&&"copied",children:n.tag})}),O.jsx(e8,{open:r,children:O.jsx(k5,{severity:"success",children:"Tag copied!"})})]})})})]})}const W1e=Be(zie)`
+ width: 300px;
+ padding: 10px 0;
+ overflow: hidden;
+`,$1e=Be.div`
+ display: flex;
+ flex-direction: column;
+ row-gap: 5px;
+ padding: 0 15px;
+`,J1e=Be.span`
+ color: #fff;
+ font-size: 18px;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+`,Y1e=Be.span`
+ color: ${Dn.$colorMain};
+ font-size: 16px;
+ user-select: none;
+ transition: all 0.3s ease 0s;
+
+ &.copied {
+ color: ${Dn.$colorSuccess};
+ }
+
+ @media (any-hover: hover) {
+ & {
+ cursor: pointer;
+ transition: all 0.3s ease 0s;
+ }
+ &:hover {
+ text-decoration: underline;
+ }
+ }
+`,Q1e=Be(mc)`
+ margin-bottom: 5px;
+`,X1e=Be.div(t=>`
+ display: flex;
+ ${t.justifyBetween&&"justify-content: space-between;"||t.justifyAround&&"justify-content: space-around;"||t.justifyEvenly&&"justify-content: space-evenly;"}
+ ${t.itemsCenter&&"align-items: center;"||t.itemsStart&&"align-items: flex-start;"||t.itemsEnd&&"align-items: flex-end;"}
+ `),K1e=Be(GG)`
+ padding: 5px;
+ border-radius: 50%;
+ font-size: 33px;
+
+ @media (any-hover: hover) {
+ & {
+ cursor: pointer;
+ transition: all 0.3s ease 0s;
+ }
+ &:hover {
+ background-color: rgba(124, 124, 124, 0.3);
+ }
+ }
+
+ &:active {
+ background-color: rgba(124, 124, 124, 0.5);
+ }
+`;nR.propTypes={size:Cn.number,sx:Cn.object};function nR({size:t,...e}){return O.jsx(W5,{sx:{width:"100%",height:t,background:"rgba(255, 255, 255, 0.12)",...e.sx}})}function Z1e(){const[t,e]=I.useState(!1),{logOut:n}=Ms(),{setChatList:r,setSidebar:i}=Om(),s=yl(),o=c=>()=>{e(c)};function a(){n(),s("/authentication")}function l(c){c(),i(!0)}return O.jsxs(q1e,{children:[O.jsx(uV,{open:t,toggle:o}),O.jsx(gw,{onClick:o(!0),children:O.jsx(UG,{})}),O.jsx(gw,{onClick:()=>l(()=>r(!0)),children:O.jsx(BG,{})}),O.jsx(gw,{onClick:()=>l(()=>r(!1)),children:O.jsx(OG,{})}),O.jsx(nR,{}),O.jsx(gw,{onClick:a,children:O.jsx(FG,{})})]})}const q1e=Be.aside`
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ ${_l("padding",5,0,10,6)}
+
+ row-gap: 10px;
+ background: color-mix(in srgb, ${Dn.$colorAside}, #111);
+`,eve=wl`
+ svg {
+ font-size: 30px;
+ }
+`,gw=Be.button`
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ padding: 4px;
+ cursor: pointer;
+ border-radius: 5px;
+ ${eve}
+
+ @media (any-hover: hover) {
+ & {
+ cursor: pointer;
+ transition: all 0.3s ease 0s;
+ }
+ &:hover {
+ background: #2d364b;
+ }
+ }
+`;var rR={},tve=Ur;Object.defineProperty(rR,"__esModule",{value:!0});var fV=rR.default=void 0,nve=tve(si()),rve=O;fV=rR.default=(0,nve.default)((0,rve.jsx)("path",{d:"M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z"}),"Done");var iR={},ive=Ur;Object.defineProperty(iR,"__esModule",{value:!0});var dV=iR.default=void 0,sve=ive(si()),ove=O;dV=iR.default=(0,sve.default)((0,ove.jsx)("path",{d:"m18 7-1.41-1.41-6.34 6.34 1.41 1.41zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12zM.41 13.41 6 19l1.41-1.41L1.83 12z"}),"DoneAll");hV.propTypes={chat:Cn.object};function hV({chat:t,...e}){const{user:n}=Ms(),r=I.useRef(t.users[t.pair.filter(i=>i!=n.uid)[0]]);return O.jsxs(ave,{...e,children:[O.jsx(lve,{user:r.current,size:60,adaptiv:!0,alt:r.current.displayName}),O.jsxs(cve,{children:[O.jsxs(uve,{children:[O.jsx(fve,{children:r.current.displayName}),O.jsx(dve,{children:t.lastMessage.text})]}),O.jsxs(hve,{children:[O.jsx(pve,{children:t.lastMessage.date.toDate().toLocaleTimeString().split(":").slice(0,2).join(":")}),t.lastMessage.check?O.jsx(hO,{as:dV}):O.jsx(hO,{as:fV})]})]})]})}const ave=Be(l2)`
+ display: flex;
+ align-items: center;
+ width: 100%;
+ ${En("column-gap",15,10,1)}
+ ${_l("padding",8,8,16,8)}
+
+ @media (any-hover:hover) {
+ & {
+ cursor: pointer;
+ transition: all 0.3s ease 0s;
+ }
+ &:hover {
+ background-color: #222233;
+ }
+ }
+`,lve=Be(mc)`
+ width: 60px;
+ height: 60px;
+`,cve=Be.div`
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ width: 100%;
+ overflow: hidden;
+`,uve=Be.div`
+ display: flex;
+ flex-direction: column;
+ max-width: 80%;
+`,fve=Be.span`
+ ${En("font-size",16,14,1)}
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ overflow: hidden;
+`,dve=Be.span`
+ color: ${Dn.$colorMain};
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+`,hve=Be.div`
+ display: flex;
+ flex-direction: column;
+ align-items: flex-end;
+`,pve=Be.div`
+ ${En("font-size",16,14,1)}
+`,hO=Be.div`
+ ${En("font-size",22,18,1)}
+ color:${Dn.$colorMain}
+`;function mve(){const[t,e]=I.useState([]),{user:n}=Ms(),{chat:r,setChat:i,setUser:s}=Fa(),o=yl(),[a,l]=I.useState(!1),c=I.useRef(null),u=I.useRef(!1),f=I.useRef(null);I.useEffect(()=>{let m=!0;return EG(["chats"],w=>{const y=w.docChanges();if(y.length)l(!1);else{l(!0),m=!1;return}if(m){m=!1,e(y.map(g=>g.doc.data())),f.current=y[y.length-1].doc;return}e(g=>{const _=[...g];return y.forEach(x=>{x.type=="added"?_.unshift(x.doc.data()):x.type=="modified"&&(_.findIndex(S=>S.id==x.doc.id)<0?_.unshift(x.doc.data()):_[_.findIndex(S=>S.id==x.doc.id)]=x.doc.data())}),_.sort((x,S)=>S.lastMessage.date.seconds-x.lastMessage.date.seconds),_})},{wheres:[["pair","array-contains",n.uid]],other:[rx(30),nx("lastMessage.date","desc")]})},[n.uid]),I.useEffect(()=>{const m=c.current;async function v(w){const y=w.target,g=w.target.scrollTop;if(f.current&&!u.current&&g+y.offsetHeight>=y.scrollHeight-350){u.current=!0;const{data:_,last:x}=await tc(["chats"],{wheres:[["pair","array-contains",n.uid]],other:[rx(30),nx("lastMessage.date","desc"),yG(f.current)]},{last:!0});e([...t,..._]),f.current=x,u.current=!1}}return m.addEventListener("scroll",v),()=>{m.removeEventListener("scroll",v)}},[t,n.uid]);const h=m=>()=>{if((r==null?void 0:r.id)==m.id){i(m);return}const v=m.users[m.pair.filter(w=>w!=n.uid)[0]];i(m),s(v),o("/chat/"+m.id)};return O.jsx(O.Fragment,{children:O.jsx(gve,{ref:c,children:a?O.jsx(vve,{children:"No chats"}):t.map(m=>O.jsx(hV,{onClick:h(m),chat:m},m.id))})})}const gve=Be(uv)`
+ width: 100%;
+ overflow: auto;
+ ${xb(5,"#252c41","transparent",50)}
+`,vve=Be.div`
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ font-size: 28px;
+ height: 100%;
+`;var sR={},yve=Ur;Object.defineProperty(sR,"__esModule",{value:!0});var pV=sR.default=void 0,wve=yve(si()),_ve=O;pV=sR.default=(0,wve.default)((0,_ve.jsx)("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}),"Check");var oR={},Mve=Ur;Object.defineProperty(oR,"__esModule",{value:!0});var mV=oR.default=void 0,xve=Mve(si()),bve=O;mV=oR.default=(0,xve.default)((0,bve.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Clear");xI.propTypes={invite:Cn.bool,user:Cn.object,onAccept:Cn.func,onReject:Cn.func};function xI({invite:t,user:e,onAccept:n,onReject:r,...i}){return O.jsx(Sve,{invite:t,children:O.jsxs(Cve,{...i,children:[O.jsxs(Eve,{children:[O.jsx(mc,{user:e}),O.jsx(Ave,{children:e.displayName})]}),t&&O.jsxs(Tve,{children:[O.jsx(Ive,{onClick:n,children:O.jsx(pV,{sx:pO})}),O.jsx(Lve,{onClick:r,children:O.jsx(mV,{sx:pO})})]})]})})}const Sve=Be.div`
+ ${({invite:t})=>!t&&`@media (any-hover:hover){
+ &{
+ cursor: pointer;
+ transition: all 0.3s ease 0s;
+ }
+ &:hover{
+ background:#293248;
+ }
+ }`}
+`,Cve=Be(l2)`
+ display: flex;
+ justify-content: space-between;
+ column-gap: 10px;
+`,Eve=Be.div`
+ display: flex;
+ column-gap: 10px;
+ align-items: center;
+ overflow: hidden;
+`,Ave=Be.span`
+ font-size: 20px;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ overflow: hidden;
+`,Tve=Be.div`
+ display: flex;
+ align-items: center;
+ column-gap: 10px;
+`,gV=Be.button`
+ padding: 5px;
+ border-radius: 50%;
+ border: 1px solid #464646;
+ @media (any-hover: hover) {
+ & {
+ cursor: pointer;
+ transition: all 0.3s ease 0s;
+ }
+ &:hover {
+ transform: translateY(-2px);
+ }
+ }
+`,pO=wl`
+ font-size: 30px;
+`,Ive=Be(gV)`
+ color: ${Dn.$colorSuccess};
+
+ @media (any-hover: hover) {
+ &:hover {
+ box-shadow: inset 0 0 0 2px ${Dn.$colorSuccess};
+ }
+ }
+`,Lve=Be(gV)`
+ color: ${Dn.$colorError};
+
+ @media (any-hover: hover) {
+ &:hover {
+ box-shadow: inset 0 0 0 2px ${Dn.$colorError};
+ }
+ }
+`;var aR={},Rve=Ur;Object.defineProperty(aR,"__esModule",{value:!0});var vV=aR.default=void 0,Pve=Rve(si()),Dve=O;vV=aR.default=(0,Pve.default)((0,Dve.jsx)("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore");function Nve(){const{user:t,setUser:e}=Ms(),{setUser:n,setChat:r,chat:i}=Fa(),[s,o]=I.useState([]),[a,l]=I.useState([]),[c,u]=I.useState(!1),[f,h]=I.useState(!1),m=yl();I.useEffect(()=>{async function x(){l((await tc(["users"],{wheres:[["uid","in",t.invitations]]})).data)}async function S(){o((await tc(["users"],{wheres:[["uid","in",t.friends]]})).data)}t.invitations.length&&x(),t.friends.length&&S()},[t.invitations,t.friends]),I.useEffect(()=>{u(localStorage.getItem("invitationsAccordion")=="true"),h(localStorage.getItem("friendsAccordion")=="true")},[]);function v(x,S){u(S),localStorage.setItem("invitationsAccordion",S)}function w(x,S){h(S),localStorage.setItem("friendsAccordion",S)}function y(x){return async()=>{const S=await cl(["users",t.uid],{invitations:ix(x),friends:gI(x)});await cl(["users",x],{friends:gI(t.uid)}),l(a.filter(D=>D.uid!=x)),e(S)}}function g(x){return async()=>{const S=await cl(["users",t.uid],{invitations:ix(x)});l(a.filter(D=>D.uid!=x)),e(S)}}function _(x){return async()=>{if(i&&i.pair.includes(x.uid)&&i.pair.includes(t.uid))return;const S=[x.uid,t.uid],D=(await tc(["chats"],{ors:[{wheres:[["pair","==",S],["pair","==",S.toReversed()]]}]})).data[0];r(D),n(x),m(D?`/chat/${D.id}`:`/friend/${x.uid}`)}}return O.jsxs(O.Fragment,{children:[O.jsxs(mO,{expanded:!!(c&&a.length),onChange:v,children:[O.jsxs(gO,{expandIcon:!!a.length&&O.jsx(vO,{}),children:["Friend invitations (",t.invitations.length,")"]}),O.jsx(yO,{children:O.jsx(wO,{children:a.map(x=>O.jsx(xI,{invite:!0,user:x,onAccept:y(x.uid),onReject:g(x.uid)},x.uid))})})]}),O.jsx(nR,{size:3}),O.jsxs(mO,{expanded:!!(f&&s.length),onChange:w,children:[O.jsxs(gO,{expandIcon:!!s.length&&O.jsx(vO,{}),children:["Friends (",t.friends.length,")"]}),O.jsx(yO,{children:O.jsx(wO,{children:s.map(x=>O.jsx(xI,{user:x,onClick:_(x)},x.uid))})})]})]})}const mO=Be(jne)`
+ background: transparent;
+ &,
+ &.Mui-expanded {
+ margin: 0;
+ }
+`,gO=Be(dre)`
+ &,
+ &.Mui-expanded {
+ min-height: auto;
+ }
+ & .MuiAccordionSummary-content,
+ & .MuiAccordionSummary-content.Mui-expanded {
+ margin: 5px 0;
+ }
+`,vO=Be(vV)`
+ font-size: 25px;
+`,yO=Be(Wne)`
+ padding: 0;
+`,wO=Be(uv)`
+ width: 100%;
+`;function kve(){const{chatList:t,sidebar:e}=Om();return O.jsxs(Bve,{sidebar:e,children:[O.jsx(Z1e,{}),O.jsxs(Ove,{children:[O.jsx(E0e,{}),t?O.jsx(mve,{}):O.jsx(Nve,{})]})]})}const Bve=Be.aside`
+ width: 100%;
+ max-width: 400px;
+ background: ${Dn.$colorAside};
+ display: flex;
+ user-select: none;
+ @media (max-width: 960px) {
+ max-width: 100%;
+ ${({sidebar:t})=>!t&&"display:none;"}
+ }
+`,Ove=Be.div`
+ display: flex;
+ flex-direction: column;
+ overflow: hidden;
+ width: 100%;
+`;yV.propTypes={children:Cn.oneOfType([Cn.element,Cn.string,Cn.number])};function yV({children:t,...e}){const[n,r]=I.useState(".");return I.useEffect(()=>{const i=setInterval(()=>r(s=>s.length==3?".":s+"."),300);return()=>clearInterval(i)},[n]),O.jsxs(O.Fragment,{children:[O.jsx("svg",{width:0,height:0,children:O.jsx("defs",{children:O.jsxs("linearGradient",{id:"my_gradient",x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[O.jsx("stop",{offset:"0%",stopColor:"#08d2f6"}),O.jsx("stop",{offset:"100%",stopColor:"#1b66a9"})]})})}),O.jsxs(Uve,{children:[O.jsx(ise,{sx:{"svg circle":{stroke:"url(#my_gradient)"}},...e}),t&&O.jsxs(Fve,{children:[t,n]})]})]})}const Uve=Be.div`
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ flex: 1 1 auto;
+ row-gap: 10px;
+`,Fve=Be.span`
+ font-size: 25px;
+ letter-spacing: 5px;
+`;wV.propTypes={children:Cn.element};function wV({children:t}){const{user:e}=Ms();return O.jsx(O.Fragment,{children:e!==null?O.jsx(O.Fragment,{children:e?O.jsx(O.Fragment,{children:t}):O.jsx(yV,{size:100,children:"Loading"})}):O.jsx(VK,{to:"/authentication"})})}function jve(){const{userSidebar:t}=Om(),{user:e}=Fa();return O.jsx(wV,{children:O.jsxs("div",{className:"app",children:[O.jsx(kve,{}),O.jsx(WK,{}),t&&e&&O.jsx(e0e,{})]})})}function zve(){const t=Ez();console.error(t);const e=yl();return O.jsx(O.Fragment,{children:O.jsxs("div",{className:"error",children:[O.jsx("div",{className:"noise"}),O.jsx("div",{className:"overlay"}),O.jsxs("div",{className:"terminal",children:[O.jsxs("h1",{children:["Error ",O.jsx("span",{className:"errorcode",children:"404"})]}),O.jsx("p",{className:"output",children:"The page you are looking for might have been removed, had its name changed or is temporarily unavailable."}),O.jsxs("p",{className:"output",children:["Please try to"," ",O.jsx("span",{className:"link",onClick:()=>e(-1),children:"go back"})," ","or"," ",O.jsx("span",{className:"link",onClick:()=>e("/"),children:"return to the homepage"}),"."]}),O.jsx("p",{className:"output",children:"Good luck."})]})]})})}const _V="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='24'%20viewBox='0%200%2024%2024'%20width='24'%3e%3cpath%20d='M22.56%2012.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26%201.37-1.04%202.53-2.21%203.31v2.77h3.57c2.08-1.92%203.28-4.74%203.28-8.09z'%20fill='%234285F4'/%3e%3cpath%20d='M12%2023c2.97%200%205.46-.98%207.28-2.66l-3.57-2.77c-.98.66-2.23%201.06-3.71%201.06-2.86%200-5.29-1.93-6.16-4.53H2.18v2.84C3.99%2020.53%207.7%2023%2012%2023z'%20fill='%2334A853'/%3e%3cpath%20d='M5.84%2014.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43%208.55%201%2010.22%201%2012s.43%203.45%201.18%204.93l2.85-2.22.81-.62z'%20fill='%23FBBC05'/%3e%3cpath%20d='M12%205.38c1.62%200%203.06.56%204.21%201.64l3.15-3.15C17.45%202.09%2014.97%201%2012%201%207.7%201%203.99%203.47%202.18%207.07l3.66%202.84c.87-2.6%203.3-4.53%206.16-4.53z'%20fill='%23EA4335'/%3e%3cpath%20d='M1%201h22v22H1z'%20fill='none'/%3e%3c/svg%3e";bI.propTypes={children:Cn.oneOfType([Cn.number,Cn.string,Cn.element]),onClick:Cn.func};function bI({children:t,onClick:e=()=>{},...n}){return O.jsx(Hve,{onClick:r=>{r.preventDefault(),e()},...n,children:t})}const Hve=Be.button`
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ ${En("font-size",20,18,1)}
+ ${_l("padding",8,4,10,5)}
+ background: #2c2c50;
+ border-radius: 5px;
+
+ @media (any-hover: hover) {
+ & {
+ cursor: pointer;
+ transition: all 0.3s ease 0s;
+ }
+ &:hover {
+ background: #3a3a66;
+ }
+ }
+
+ &:disabled {
+ color: #9b9b9b;
+ background: #23233a;
+ cursor: not-allowed;
+ }
+`;function Gve(){const[t,e]=I.useState(!0),[n,r]=I.useState(""),[i,s]=I.useState(""),[o,a]=I.useState(""),[l,c]=I.useState({}),u=yl();function f(g){e(g),h()}function h(){r(""),s(""),c({}),a("")}const m=!(n.trim()&&i.trim());async function v(){c({});const g=await Qme({email:n,password:i},()=>u("/"));g&&g.type=="error"&&c(g.errors)}async function w(){c({});const g=await Yme({email:n,password:i,confirmPassword:o},()=>u("/"));g&&g.type=="error"&&c(g.errors)}function y(){LG(()=>u("/"))}return O.jsxs(Vve,{children:[O.jsxs(Wve,{login:t,children:[O.jsx(_O,{onClick:()=>f(!0),children:"Log in"}),O.jsx(_O,{onClick:()=>f(!1),children:"Sig up"})]}),O.jsxs($ve,{onClick:y,children:[O.jsx(Jve,{children:"Authentication with Google"}),O.jsx(Yve,{src:_V,alt:"google auth"})]}),t?O.jsxs(MO,{children:[O.jsx(Zc,{error:l.email,name:"email",placeholder:"Email",value:n,onChange:g=>r(g.target.value)}),O.jsx(Zc,{type:"password",error:l.password,name:"password",placeholder:"Password",value:i,onChange:g=>s(g.target.value)}),O.jsx(bI,{disabled:m,onClick:v,children:"Log in"})]}):O.jsxs(MO,{children:[O.jsx(Zc,{error:l.email,name:"email",placeholder:"Email",value:n,onChange:g=>r(g.target.value)}),O.jsx(Zc,{type:"password",error:l.password,name:"password",placeholder:"Password",value:i,onChange:g=>s(g.target.value)}),O.jsx(Zc,{type:"password",error:l.confirmPassword,name:"confirmPassword",placeholder:"Confirm password",value:o,onChange:g=>a(g.target.value)}),O.jsx(bI,{disabled:m||!o.trim(),onClick:w,children:"Sign up"})]})]})}const Vve=Be.div`
+ display: flex;
+ flex-direction: column;
+ width: 100%;
+ max-width: 400px;
+ ${En("padding",30,6,1)}
+ background-color:#1d1d38;
+ border-radius: 10px;
+`,Wve=Be.div(t=>`
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ width: 100%;
+ padding: 5px;
+ background-color: #16162b;
+ border-radius: 5px;
+ overflow: hidden;
+ position: relative;
+ ${En("margin-bottom",15,10,1)}
+
+ &::before {
+ content: '';
+ position: absolute;
+ z-index: 1;
+ background: #252544;
+ width: calc(50% - 10px);
+ height: calc(100% - 4px * 2);
+ left: 5px;
+ top: 4px;
+ border-radius: 5px;
+ transition: all 0.3s ease 0s;
+ ${!t.login&&"left: calc(50% + 5px)"}
+ }
+`),_O=Be.div`
+ text-align: center;
+ ${En("font-size",25,20,1)}
+ position: relative;
+ z-index: 2;
+ width: 100%;
+ cursor: pointer;
+`,$ve=Be.button`
+ align-self: center;
+ width: 100%;
+ max-width: 300px;
+ background: #303055;
+ border-radius: 10px;
+ padding: 6px 10px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ column-gap: 20px;
+ margin-bottom: 10px;
+
+ @media (any-hover: hover) {
+ & {
+ cursor: pointer;
+ transition: all 0.3s ease 0s;
+ }
+ &:hover {
+ transform: translateY(3px);
+ }
+ }
+`,Jve=Be.span`
+ ${En("font-size",18,16,1)}
+`,Yve=Be.img`
+ width: 100%;
+ max-width: 30px;
+`,MO=Be.form`
+ display: flex;
+ flex-direction: column;
+ row-gap: 10px;
+`;function Qve(){return O.jsx(Xve,{children:O.jsx(Gve,{})})}const Xve=Be.div`
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex: 1 1 auto;
+ padding: 0 10px;
+`;var lR={},Kve=Ur;Object.defineProperty(lR,"__esModule",{value:!0});var MV=lR.default=void 0,Zve=Kve(si()),qve=O;MV=lR.default=(0,Zve.default)((0,qve.jsx)("path",{d:"M14.59 7.41 18.17 11H6v2h12.17l-3.59 3.59L16 18l6-6-6-6zM2 6v12h2V6z"}),"StartOutlined");var cR={},eye=Ur;Object.defineProperty(cR,"__esModule",{value:!0});var xV=cR.default=void 0,tye=eye(si()),nye=O;xV=cR.default=(0,tye.default)((0,nye.jsx)("path",{d:"M21 11H6.83l3.58-3.59L9 6l-6 6 6 6 1.41-1.41L6.83 13H21z"}),"KeyboardBackspace");function rye(){const{user:t,setChat:e,setUser:n}=Fa(),{userSidebar:r,setUserSidebar:i,setSidebar:s}=Om(),o=yl();function a(){e(null),n(null),s(!0),o("/")}return O.jsxs(iye,{children:[O.jsx(uye,{onClick:a}),O.jsxs(sye,{onClick:()=>i(!r),children:[O.jsx(mc,{size:60,user:t,adaptiv:!0}),O.jsx(oye,{children:O.jsx(lye,{children:t.displayName})})]}),O.jsx(cye,{onClick:()=>i(!r),sx:{transform:!r&&"scaleX(-1)"}})]})}const iye=Be.div`
+ user-select: none;
+ background-color: ${Dn.$colorChat};
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ ${_l("padding",10,6,20,10)}
+ column-gap: 10px;
+`,sye=Be.div`
+ display: flex;
+ ${En("column-gap",20,5,1)}
+ align-items: center;
+ width: 100%;
+ overflow: hidden;
+ @media (any-hover: hover) {
+ & {
+ cursor: pointer;
+ }
+ }
+`,oye=Be.div`
+ display: flex;
+ flex-direction: column;
+ overflow: hidden;
+`,aye=wl`
+ ${En("font-size",18,16,1)}
+`,lye=Be.span`
+ ${aye}
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ overflow: hidden;
+`,cye=Be(MV)`
+ ${En("font-size",30,25,1)}
+
+ @media (any-hover:hover) {
+ & {
+ cursor: pointer;
+ transition: color 0.3s ease 0s;
+ }
+ &:hover {
+ color: ${Dn.$colorMain};
+ }
+ }
+
+ @media (max-width: 1140px) {
+ display: none;
+ }
+`,uye=Be(xV)`
+ display: none;
+ ${En("font-size",35,27,1,null,960)}
+
+ @media (max-width: 960px) {
+ display: block;
+ }
+`;var uR={},fye=Ur;Object.defineProperty(uR,"__esModule",{value:!0});var bV=uR.default=void 0,dye=fye(si()),hye=O;bV=uR.default=(0,dye.default)((0,hye.jsx)("path",{d:"M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5c0 1.38 1.12 2.5 2.5 2.5s2.5-1.12 2.5-2.5V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6z"}),"AttachFileOutlined");var fR={},pye=Ur;Object.defineProperty(fR,"__esModule",{value:!0});var SV=fR.default=void 0,mye=pye(si()),EE=O;SV=fR.default=(0,mye.default)([(0,EE.jsx)("circle",{cx:"15.5",cy:"9.5",r:"1.5"},"0"),(0,EE.jsx)("circle",{cx:"8.5",cy:"9.5",r:"1.5"},"1"),(0,EE.jsx)("path",{d:"M12 16c-1.48 0-2.75-.81-3.45-2H6.88c.8 2.05 2.79 3.5 5.12 3.5s4.32-1.45 5.12-3.5h-1.67c-.7 1.19-1.97 2-3.45 2m-.01-14C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"},"2")],"SentimentSatisfiedOutlined");var dR={},gye=Ur;Object.defineProperty(dR,"__esModule",{value:!0});var CV=dR.default=void 0,vye=gye(si()),yye=O;CV=dR.default=(0,vye.default)((0,yye.jsx)("path",{d:"m4.01 6.03 7.51 3.22-7.52-1zm7.5 8.72L4 17.97v-2.22zM2.01 3 2 10l15 2-15 2 .01 7L23 12z"}),"SendOutlined");function SI(t){return[].concat(t)}function hR(t){return t.startsWith(":")}function EV(t){return B2(t)&&(t==="*"||t.length>1&&":>~.+*".includes(t.slice(0,1))||LV(t))}function AV(t,e){return(B2(e)||typeof e=="number")&&!IV(t)&&!hR(t)&&!TV(t)}function TV(t){return t.startsWith("@media")}function wye(t){return t==="."}function IV(t){return t==="--"}function B2(t){return t+""===t}function LV(t){return B2(t)&&(t.startsWith("&")||hR(t))}function ox(t,e=""){return t.filter(Boolean).join(e)}function RV(t,e){let n=0;if(e.length===0)return n.toString();for(let r=0;rhR(s)?i+s:LV(s)?i+s.slice(1):ox([i,s]," "),e);return ox([r,xye(n)]," ")}var Sye=class Y_{constructor(e,n=null,{preconditions:r,postconditions:i}={}){this.sheet=e,this.preconditions=[],this.scopeClassName=null,this.scopeName=null,this.postconditions=[],this.preconditions=r?SI(r):[],this.postconditions=i?SI(i):[],this.setScope(n)}setScope(e){return e?(this.scopeClassName||(this.scopeName=e,this.scopeClassName=RV(this.sheet.name,e+this.sheet.count)),this):this}get hasConditions(){return this.preconditions.length>0||this.postconditions.length>0}addScope(e){return new Y_(this.sheet,e,{preconditions:this.preconditions,postconditions:this.postconditions})}addPrecondition(e){return new Y_(this.sheet,this.scopeClassName,{postconditions:this.postconditions,preconditions:this.preconditions.concat(e)})}addPostcondition(e){return new Y_(this.sheet,this.scopeClassName,{preconditions:this.preconditions,postconditions:this.postconditions.concat(e)})}createRule(e,n){return new PV(this.sheet,e,n,this)}},Cye=class{constructor(t,e){this.name=t,this.rootNode=e,this.storedStyles={},this.storedClasses={},this.style="",this.count=0,this.id=`flairup-${t}`,this.styleTag=this.createStyleTag()}getStyle(){return this.style}append(t){this.style=bye(this.style,t)}apply(){this.count++,this.styleTag&&(this.styleTag.innerHTML=this.style)}isApplied(){return!!this.styleTag}createStyleTag(){if(typeof document>"u"||this.isApplied()||this.rootNode===null)return this.styleTag;const t=document.createElement("style");return t.type="text/css",t.id=this.id,(this.rootNode??document.head).appendChild(t),t}addRule(t){const e=this.storedClasses[t.key];return B2(e)?e:(this.storedClasses[t.key]=t.hash,this.storedStyles[t.hash]=[t.property,t.value],this.append(t.toString()),t.hash)}};function pR(t,e){for(const n in t)e(n.trim(),t[n])}function Fn(...t){const e=t.reduce((n,r)=>(r instanceof Set?n.push(...r):typeof r=="string"?n.push(r):Array.isArray(r)?n.push(Fn(...r)):typeof r=="object"&&Object.entries(r).forEach(([i,s])=>{s&&n.push(i)}),n),[]);return ox(e," ").trim()}function Eye(t,e){const n=new Cye(t,e);return{create:r,getStyle:n.getStyle.bind(n),isApplied:n.isApplied.bind(n)};function r(i){const s={};return NV(n,i,new Sye(n)).forEach(([a,l,c])=>{O2(n,l,c).forEach(u=>{o(a,u)})}),n.apply(),s;function o(a,l){s[a]=s[a]??new Set,s[a].add(l)}}}function NV(t,e,n){const r=[];return pR(e,(i,s)=>{if(EV(i))return NV(t,s,n.addPrecondition(i)).forEach(o=>r.push(o));r.push([i,e[i],n.addScope(i)])}),r}function O2(t,e,n){const r=new Set;return pR(e,(i,s)=>{let o=[];if(EV(i))o=O2(t,s,n.addPostcondition(i));else if(wye(i))o=SI(s);else if(TV(i))o=Tye(t,s,i,n);else if(IV(i))o=Aye(t,s,n);else if(AV(i,s)){const a=n.createRule(i,s);t.addRule(a),r.add(a.hash)}return kV(o,r)}),r}function kV(t,e){return t.forEach(n=>e.add(n)),e}function Aye(t,e,n){const r=new Set,i=[];if(pR(e,(s,o)=>{if(AV(s,o)){i.push(PV.genRule(s,o));return}const a=O2(t,o??{},n);kV(a,r)}),!n.scopeClassName)return r;if(i.length){const s=i.join(" ");t.append(`${CI(n.preconditions,{right:n.scopeClassName})} {${s}}`)}return r.add(n.scopeClassName),r}function Tye(t,e,n,r){t.append(n+" {");const i=O2(t,e,r);return t.append("}"),i}function kr(){return kr=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function Lye(t,e){if(t){if(typeof t=="string")return bO(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return bO(t,e)}}function bO(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Rn;(function(t){t.hiddenOnSearch="epr-hidden-on-search",t.searchActive="epr-search-active",t.hidden="epr-hidden",t.visible="epr-visible",t.active="epr-active",t.emoji="epr-emoji",t.category="epr-emoji-category",t.label="epr-emoji-category-label",t.categoryContent="epr-emoji-category-content",t.emojiHasVariations="epr-emoji-has-variations",t.scrollBody="epr-body",t.emojiList="epr-emoji-list",t.external="__EmojiPicker__",t.emojiPicker="EmojiPickerReact",t.open="epr-open",t.vertical="epr-vertical",t.horizontal="epr-horizontal",t.variationPicker="epr-emoji-variation-picker",t.darkTheme="epr-dark-theme",t.autoTheme="epr-auto-theme"})(Rn||(Rn={}));function _s(){for(var t=arguments.length,e=new Array(t),n=0;n0}function twe(t,e){return e?Lv(t).find(function(n){return n.includes(e)}):Bs(t)}function lm(t){if(t){if(Ip[t])return Ip[t];var e=vR(t);return Ip[e]}}var U2=Object.values(T1).flat();function nwe(t){T1[In.CUSTOM].length=0,t.forEach(function(e){var n=rwe(e);T1[In.CUSTOM].push(n),!Ip[n[ea.unified]]&&(U2.push(n),Ip[n[ea.unified]]=n,zV(n))})}function rwe(t){var e;return e={},e[ea.name]=t.names.map(function(n){return n.toLowerCase()}),e[ea.unified]=t.id.toLowerCase(),e[ea.added_in]="0",e[ea.imgUrl]=t.imgUrl,e}var Ip={};setTimeout(function(){U2.reduce(function(t,e){return t[Bs(e)]=e,Um(e)&&Lv(e).forEach(function(n){t[n]=e}),t},Ip)});function iwe(t){var e=t.split("-"),n=e[1];return ax.includes(n)?n:null}var swe=["2640-fe0f","2642-fe0f","2695-fe0f"],lx="Search",owe="No results found",GV=" found. Use up and down arrow keys to navigate.",awe="1 result"+GV,lwe="%n results"+GV;function CO(t){var e,n;t===void 0&&(t={});var r=VV(),i=Object.assign(r.previewConfig,(e=t.previewConfig)!=null?e:{}),s=Object.assign(r,t),o=Bye(t.categories,{suggestionMode:s.suggestedEmojisMode});s.hiddenEmojis.forEach(function(l){s.unicodeToHide.add(l)}),nwe((n=s.customEmojis)!=null?n:[]);var a=s.searchDisabled?am.PREVIEW:s.skinTonePickerLocation;return kr({},s,{categories:o,previewConfig:i,skinTonePickerLocation:a})}function VV(){return{autoFocusSearch:!0,categories:FV(),className:"",customEmojis:[],defaultSkinTone:Ta.NEUTRAL,emojiStyle:Mo.APPLE,emojiVersion:null,getEmojiUrl:HV,height:450,lazyLoadEmojis:!1,previewConfig:kr({},cwe),searchDisabled:!1,searchPlaceHolder:lx,searchPlaceholder:lx,skinTonePickerLocation:am.SEARCH,skinTonesDisabled:!1,style:{},suggestedEmojisMode:E1.FREQUENT,theme:A1.LIGHT,unicodeToHide:new Set(swe),width:350,reactionsDefaultOpen:!1,reactions:Dye,open:!0,allowExpandReactions:!0,hiddenEmojis:[]}}var cwe={defaultEmoji:"1f60a",defaultCaption:"What's your mood?",showPreview:!0},uwe=["children"],WV=I.createContext(VV());function fwe(t){var e=t.children,n=BV(t,uwe),r=dwe(n);return I.createElement(WV.Provider,{value:r},e)}function dwe(t){var e,n=I.useState(function(){return CO(t)}),r=n[0],i=n[1];return I.useEffect(function(){OV(r,t)||i(CO(t))},[(e=t.customEmojis)==null?void 0:e.length,t.open,t.emojiVersion,t.reactionsDefaultOpen,t.searchPlaceHolder,t.searchPlaceholder,t.defaultSkinTone,t.skinTonesDisabled,t.autoFocusSearch,t.emojiStyle,t.theme,t.suggestedEmojisMode,t.lazyLoadEmojis,t.className,t.height,t.width,t.searchDisabled,t.skinTonePickerLocation,t.allowExpandReactions]),r}function Jr(){return I.useContext(WV)}var $V=qt.createContext({});function JV(){var t=qt.useContext($V);return t}function hwe(t){var e=qt.useRef({onEmojiClick:t.onEmojiClick||vw,onReactionClick:t.onReactionClick||t.onEmojiClick,onSkinToneChange:t.onSkinToneChange||vw});return qt.useEffect(function(){e.current.onEmojiClick=t.onEmojiClick||vw,e.current.onReactionClick=t.onReactionClick||t.onEmojiClick},[t.onEmojiClick,t.onReactionClick]),qt.useEffect(function(){e.current.onSkinToneChange=t.onSkinToneChange||vw},[t.onSkinToneChange]),e}function vw(){}var I1;(function(t){t.REACTIONS="reactions",t.PICKER="picker"})(I1||(I1={}));function pwe(){var t,e=Jr(),n=e.searchPlaceHolder,r=e.searchPlaceholder;return(t=[n,r].find(function(i){return i!==lx}))!=null?t:lx}function mwe(){var t=Jr(),e=t.defaultSkinTone;return e}function YV(){var t=Jr(),e=t.allowExpandReactions;return e}function QV(){var t=Jr(),e=t.skinTonesDisabled;return e}function Hd(){var t=Jr(),e=t.emojiStyle;return e}function gwe(){var t=Jr(),e=t.autoFocusSearch;return e}function XV(){var t=Jr(),e=t.categories;return e}function vwe(){var t=Jr(),e=t.customEmojis;return e}function ywe(){var t=Jr(),e=t.open;return e}function wwe(t){var e,n=JV(),r=n.current,i=(e=t===I1.REACTIONS?r.onReactionClick:r.onEmojiClick)!=null?e:r.onEmojiClick;return i||function(){}}function _we(){var t=JV(),e=t.current;return e.onSkinToneChange||function(){}}function KV(){var t=Jr(),e=t.previewConfig;return e}function Mwe(){var t=Jr(),e=t.theme;return e}function xwe(){var t=Jr(),e=t.suggestedEmojisMode;return e}function bwe(){var t=Jr(),e=t.lazyLoadEmojis;return e}function Swe(){var t=Jr(),e=t.className;return e}function Cwe(){var t=Jr(),e=t.height,n=t.width,r=t.style;return kr({height:EO(e),width:EO(n)},r)}function Ewe(){var t=Jr(),e=t.reactionsDefaultOpen;return e}function Awe(){var t=Jr(),e=t.emojiVersion;return e}function ZV(){var t=Jr(),e=t.searchDisabled;return e}function qV(){var t=Jr(),e=t.skinTonePickerLocation;return e}function Twe(){var t=Jr(),e=t.unicodeToHide;return e}function Iwe(){var t=Jr(),e=t.reactions;return e}function Fm(){var t=Jr(),e=t.getEmojiUrl;return e}function EO(t){return typeof t=="number"?t+"px":t}function Lwe(t){var e=t>0,n=t>1;return e?n?lwe.replace("%n",t.toString()):awe:owe}function AO(t,e){e===void 0&&(e=0);var n=I.useState(t),r=n[0],i=n[1],s=I.useRef(null);function o(a){return new Promise(function(l){var c;s.current&&clearTimeout(s.current),s.current=(c=window)==null?void 0:c.setTimeout(function(){i(a),l(a)},e)})}return[r,o]}function Rwe(){var t=Twe();return function(e){return t.has(e)}}function e7(){var t=I.useRef({}),e=Awe();return I.useMemo(function(){var n=parseFloat(""+e);return!e||Number.isNaN(n)?t.current:U2.reduce(function(r,i){return Dwe(i,n)&&(r[Bs(i)]=!0),r},t.current)},[e])}function Pwe(){var t=e7(),e=Rwe();return function(r){var i=vR(Bs(r));return!!(t[i]||e(i))}}function Dwe(t,e){return qye(t)>e}function Nwe(t){I.useEffect(function(){t(!0)},[t])}function kwe(t){var e=t.children,n=e7(),r=mwe(),i=Ewe(),s=I.useRef(Ug),o=I.useRef(!1),a=I.useRef(!1),l=I.useRef(n),c=AO(Date.now(),200),u=AO("",100),f=I.useState(!1),h=I.useState(r),m=I.useState(null),v=I.useState(new Set),w=I.useState(null),y=I.useState(i),g=I.useState(!1),_=g[0],x=g[1];return Nwe(x),I.createElement(da.Provider,{value:{activeCategoryState:m,activeSkinTone:h,disallowClickRef:o,disallowMouseRef:a,disallowedEmojisRef:l,emojiVariationPickerState:w,emojisThatFailedToLoadState:v,filterRef:s,isPastInitialLoad:_,searchTerm:u,skinToneFanOpenState:f,suggestedUpdateState:c,reactionsModeState:y}},e)}var da=I.createContext({activeCategoryState:[null,function(){}],activeSkinTone:[Ta.NEUTRAL,function(){}],disallowClickRef:{current:!1},disallowMouseRef:{current:!1},disallowedEmojisRef:{current:{}},emojiVariationPickerState:[null,function(){}],emojisThatFailedToLoadState:[new Set,function(){}],filterRef:{current:{}},isPastInitialLoad:!0,searchTerm:["",function(){return new Promise(function(){})}],skinToneFanOpenState:[!1,function(){}],suggestedUpdateState:[Date.now(),function(){}],reactionsModeState:[!1,function(){}]});function yR(){var t=I.useContext(da),e=t.filterRef;return e}function Bwe(){var t=I.useContext(da),e=t.disallowClickRef;return e}function wR(){var t=I.useContext(da),e=t.disallowMouseRef;return e}function F2(){var t=I.useContext(da),e=t.reactionsModeState;return e}function j2(){var t=I.useContext(da),e=t.searchTerm;return e}function _R(){var t=I.useContext(da),e=t.activeSkinTone;return e}function t7(){var t=I.useContext(da),e=t.emojisThatFailedToLoadState;return e}function Owe(){var t=I.useContext(da),e=t.isPastInitialLoad;return e}function jm(){var t=I.useContext(da),e=t.emojiVariationPickerState;return e}function Rv(){var t=I.useContext(da),e=t.skinToneFanOpenState;return e}function n7(){var t=I.useContext(da),e=t.suggestedUpdateState,n=e[0],r=e[1];return[n,function(){r(Date.now())}]}function z2(){var t=j2(),e=t[0];return!!e}function Do(t){t&&requestAnimationFrame(function(){t.focus()})}function r7(t){if(t){var e=t.previousElementSibling;Do(e)}}function i7(t){if(t){var e=t.nextElementSibling;Do(e)}}function s7(t){if(t){var e=t.firstElementChild;Do(e)}}function L1(){return document.activeElement}function Uwe(t){var e=t.children,n=I.useRef(null),r=I.useRef(null),i=I.useRef(null),s=I.useRef(null),o=I.useRef(null),a=I.useRef(null),l=I.useRef(null),c=I.useRef(null);return I.createElement(o7.Provider,{value:{AnchoredEmojiRef:r,BodyRef:i,CategoryNavigationRef:a,PickerMainRef:n,SearchInputRef:s,SkinTonePickerRef:o,VariationPickerRef:l,ReactionsRef:c}},e)}var o7=I.createContext({AnchoredEmojiRef:I.createRef(),BodyRef:I.createRef(),CategoryNavigationRef:I.createRef(),PickerMainRef:I.createRef(),SearchInputRef:I.createRef(),SkinTonePickerRef:I.createRef(),VariationPickerRef:I.createRef(),ReactionsRef:I.createRef()});function Hu(){return I.useContext(o7)}function Pv(){return Hu().PickerMainRef}function H2(){return Hu().AnchoredEmojiRef}function a7(){var t=H2();return function(e){e===null&&t.current!==null&&Do(t.current),t.current=e}}function ha(){return Hu().BodyRef}function Fwe(){return Hu().ReactionsRef}function Gu(){return Hu().SearchInputRef}function MR(){return Hu().SkinTonePickerRef}function xR(){return Hu().CategoryNavigationRef}function jwe(){return Hu().VariationPickerRef}function l7(t,e){e===void 0&&(e=0);var n=b7(t);n&&requestAnimationFrame(function(){n.scrollTop=e})}function zwe(t,e){var n=b7(t);n&&requestAnimationFrame(function(){n.scrollTop=n.scrollTop+e})}function Hwe(){var t=ha();return I.useCallback(function(e){requestAnimationFrame(function(){t.current&&(t.current.scrollTop=e)})},[t])}function G2(t){if(!(!t||!P_e(t))&&!t.closest(_s(Rn.variationPicker))){var e=C7(t),n=S7(t);zwe(e,-(TR(Vu(t))-n))}}function V2(t){var e=PR(t);Do(e),G2(e)}function Gwe(t){var e=PR(t);Do(e),e==null||e.click()}function Vwe(t){Do(I7(t))}function Wwe(t){if(t){var e=L7(t);if(!e)return V2($2(t));Do(e),G2(e)}}function $we(t){if(t){var e=RR(t);if(!e)return Vwe(W2(t));Do(e),G2(e)}}function Jwe(t,e){if(t){var n=Qwe(t);if(!n)return e();Do(n),G2(n)}}function Ywe(t){if(t){var e=Xwe(t);return Do(e)}}function Qwe(t){if(!t)return null;var e=R7(t),n=Vu(e),r=w7(e,t),i=_7(e,t),s=y7(e,t);if(i===0){var o=W2(n);return o?M7(cm(o),-1,s,r):null}return E_e(cm(e),i,s,r)}function Xwe(t){if(!t)return null;var e=R7(t),n=Vu(e),r=w7(e,t),i=_7(e,t),s=y7(e,t);if(!b_e(e,t)){var o=$2(n);return o?M7(cm(o),0,s,r):null}var a=C_e(cm(e),i,s,r);return a}function Gd(){var t=jm(),e=t[0],n=t[1],r=Rv(),i=r[0],s=r[1],o=I.useCallback(function(){e&&n(null),i&&s(!1)},[e,i,n,s]);return o}function c7(){var t=jm(),e=t[0],n=Rv(),r=n[0];return function(){return!!e||r}}function Kwe(){var t=wR();return function(){t.current=!0}}function u7(){var t=wR();return function(){t.current=!1}}function f7(){var t=wR();return function(){return t.current}}function Zwe(){var t=ha(),e=u7(),n=f7();I.useEffect(function(){var r=t.current;r==null||r.addEventListener("mousemove",i,{passive:!0});function i(){n()&&e()}return function(){r==null||r.removeEventListener("mousemove",i)}},[t,e,n])}function Vd(){var t=Gu();return I.useCallback(function(){Do(t.current)},[t])}function qwe(){var t=MR();return I.useCallback(function(){t.current&&s7(t.current)},[t])}function d7(){var t=xR();return I.useCallback(function(){t.current&&s7(t.current)},[t])}function e_e(){var t=yR();return function e(n){if(typeof n=="function")return e(n(t.current));t.current=n}}function h7(){var t=bR(),e=Gu(),n=Vd();return function(){e.current&&(e.current.value=""),t(""),n()}}function t_e(){var t=Gu(),e=bR();return function(r){t.current?(t.current.value=""+t.current.value+r,e(TI(t.current.value))):e(TI(r))}}function n_e(){var t=Gu(),e=yR(),n=e_e(),r=bR(),i=j2(),s=i[0],o=l_e(e.current,s);return{onChange:a,searchTerm:s,SearchInputRef:t,statusSearchResults:o};function a(l){var c=e.current,u=l.toLowerCase();if(c!=null&&c[u]||u.length<=1)return r(u);var f=a_e(u,c);if(!f)return r(u);n(function(h){var m;return Object.assign(h,(m={},m[u]=r_e(f,u),m))}),r(u)}}function bR(){var t=j2(),e=t[1],n=Pv();return function(i){requestAnimationFrame(function(){e(i&&(i==null?void 0:i.toLowerCase())).then(function(){l7(n.current,0)})})}}function r_e(t,e){var n={};for(var r in t){var i=t[r];i_e(i,e)&&(n[r]=i)}return n}function i_e(t,e){return Iv(t).some(function(n){return n.includes(e)})}function s_e(){var t=yR(),e=t.current,n=j2(),r=n[0];return function(i){return o_e(i,e,r)}}function o_e(t,e,n){var r;return!e||!n?!1:!((r=e[n])!=null&&r[t])}function a_e(t,e){if(!e)return null;if(e[t])return e[t];var n=Object.keys(e).sort(function(r,i){return i.length-r.length}).find(function(r){return t.includes(r)});return n?e[n]:null}function TI(t){return!t||typeof t!="string"?"":t.trim().toLowerCase()}function l_e(t,e){var n;if(!(t!=null&&t[e]))return"";var r=((n=Object.entries(t==null?void 0:t[e]))==null?void 0:n.length)||0;return Lwe(r)}function p7(){var t=a7(),e=jm(),n=e[1];return function(i){var s=AR(i),o=s[0];o&&(t(i),n(o))}}function SR(){var t=qV();return t===am.SEARCH}function m7(){var t=qV();return t===am.PREVIEW}var wi;(function(t){t.ArrowDown="ArrowDown",t.ArrowUp="ArrowUp",t.ArrowLeft="ArrowLeft",t.ArrowRight="ArrowRight",t.Escape="Escape",t.Enter="Enter",t.Space=" "})(wi||(wi={}));function c_e(){u_e(),f_e(),d_e(),h_e(),p_e()}function u_e(){var t=Pv(),e=h7(),n=Hwe(),r=Gu(),i=Vd(),s=c7(),o=Kwe(),a=Gd(),l=I.useMemo(function(){return function(u){var f=u.key;switch(o(),f){case wi.Escape:if(u.preventDefault(),s()){a();return}e(),n(0),i();break}}},[n,e,a,i,s,o]);I.useEffect(function(){var c=t.current;if(c)return c.addEventListener("keydown",l),function(){c.removeEventListener("keydown",l)}},[t,r,n,l])}function f_e(){var t=qwe(),e=Pv(),n=ha(),r=Gu(),i=Rv(),s=i[1],o=g7(),a=SR(),l=I.useMemo(function(){return function(u){var f=u.key;switch(f){case wi.ArrowRight:if(!a)return;u.preventDefault(),s(!0),t();break;case wi.ArrowDown:u.preventDefault(),o();break;case wi.Enter:u.preventDefault(),Gwe(n.current);break}}},[t,o,s,n,a]);I.useEffect(function(){var c=r.current;if(c)return c.addEventListener("keydown",l),function(){c.removeEventListener("keydown",l)}},[e,r,l])}function d_e(){var t=MR(),e=Vd(),n=Gu(),r=g7(),i=Rv(),s=i[0],o=i[1],a=m7(),l=SR(),c=CR(),u=I.useMemo(function(){return function(h){var m=h.key;if(l)switch(m){case wi.ArrowLeft:if(h.preventDefault(),!s)return e();TO(e);break;case wi.ArrowRight:if(h.preventDefault(),!s)return e();IO();break;case wi.ArrowDown:h.preventDefault(),s&&o(!1),r();break;default:c(h);break}if(a)switch(m){case wi.ArrowUp:if(h.preventDefault(),!s)return e();TO(e);break;case wi.ArrowDown:if(h.preventDefault(),!s)return e();IO();break;default:c(h);break}}},[s,e,o,r,c,a,l]);I.useEffect(function(){var f=t.current;if(f)return f.addEventListener("keydown",u),function(){f.removeEventListener("keydown",u)}},[t,n,s,u])}function h_e(){var t=Vd(),e=xR(),n=ha(),r=CR(),i=I.useMemo(function(){return function(o){var a=o.key;switch(a){case wi.ArrowUp:o.preventDefault(),t();break;case wi.ArrowRight:o.preventDefault(),i7(L1());break;case wi.ArrowLeft:o.preventDefault(),r7(L1());break;case wi.ArrowDown:o.preventDefault(),V2(n.current);break;default:r(o);break}}},[n,t,r]);I.useEffect(function(){var s=e.current;if(s)return s.addEventListener("keydown",i),function(){s.removeEventListener("keydown",i)}},[e,n,i])}function p_e(){var t=ha(),e=m_e(),n=p7(),r=c7(),i=Gd(),s=CR(),o=I.useMemo(function(){return function(l){var c=l.key,u=Na(L1());switch(c){case wi.ArrowRight:l.preventDefault(),Wwe(u);break;case wi.ArrowLeft:l.preventDefault(),$we(u);break;case wi.ArrowDown:if(l.preventDefault(),r()){i();break}Ywe(u);break;case wi.ArrowUp:if(l.preventDefault(),r()){i();break}Jwe(u,e);break;case wi.Space:l.preventDefault(),n(l.target);break;default:s(l);break}}},[e,s,n,r,i]);I.useEffect(function(){var a=t.current;if(a)return a.addEventListener("keydown",o),function(){a.removeEventListener("keydown",o)}},[t,o])}function g7(){var t=d7(),e=z2(),n=ha();return I.useCallback(function(){return e?V2(n.current):t()},[n,t,e])}function m_e(){var t=Vd(),e=d7(),n=z2();return I.useCallback(function(){return n?t():e()},[t,n,e])}function TO(t){var e=L1();e&&(T_e(e)||t(),i7(e))}function IO(){var t=L1();t&&r7(t)}function CR(){var t=t_e(),e=Vd(),n=ZV(),r=Gd();return function(s){var o=s.key;g_e(s)||n||o.match(/(^[a-zA-Z0-9]$){1}/)&&(s.preventDefault(),r(),e(),t(o))}}function g_e(t){var e=t.metaKey,n=t.ctrlKey,r=t.altKey;return e||n||r}function v_e(t,e,n){if(e&&n!==Mo.NATIVE){var r=Bs(e);LO.has(r)||(Lv(e).forEach(function(i){var s=t(i,n);y_e(s)}),LO.add(r))}}var LO=new Set;function y_e(t){var e=new Image;e.src=t}function w_e(){var t=ha(),e=Hd(),n=Fm();I.useEffect(function(){if(e===Mo.NATIVE)return;var r=t.current;return r==null||r.addEventListener("focusin",i),function(){r==null||r.removeEventListener("focusin",i)};function i(s){var o=Na(s.target);if(o){var a=AR(o),l=a[0];l&&Um(l)&&v_e(n,l,e)}}},[t,e,n])}var __e=["width","height"],v7=40;function M_e(t){var e=t.children;return I.createElement(kwe,null,I.createElement(x_e,null,e))}function x_e(t){var e,n=t.children,r=F2(),i=r[0],s=Mwe(),o=z2(),a=Pv(),l=Swe(),c=Cwe();c_e(),w_e();var u=c||{},f=u.width,h=u.height,m=BV(u,__e);return I.createElement("aside",{className:Fn(k0.main,k0.baseVariables,s===A1.DARK&&k0.darkTheme,s===A1.AUTO&&k0.autoThemeDark,(e={},e[Rn.searchActive]=o,e),i&&k0.reactionsMenu,l),ref:a,style:kr({},m,!i&&{height:h,width:f})},n)}var RO={"--epr-emoji-variation-picker-bg-color":"var(--epr-dark-emoji-variation-picker-bg-color)","--epr-hover-bg-color-reduced-opacity":"var(--epr-dark-hover-bg-color-reduced-opacity)","--epr-highlight-color":"var(--epr-dark-highlight-color)","--epr-text-color":"var(--epr-dark-text-color)","--epr-hover-bg-color":"var(--epr-dark-hover-bg-color)","--epr-focus-bg-color":"var(--epr-dark-focus-bg-color)","--epr-search-input-bg-color":"var(--epr-dark-search-input-bg-color)","--epr-category-label-bg-color":"var(--epr-dark-category-label-bg-color)","--epr-picker-border-color":"var(--epr-dark-picker-border-color)","--epr-bg-color":"var(--epr-dark-bg-color)","--epr-reactions-bg-color":"var(--epr-dark-reactions-bg-color)","--epr-search-input-bg-color-active":"var(--epr-dark-search-input-bg-color-active)","--epr-emoji-variation-indicator-color":"var(--epr-dark-emoji-variation-indicator-color)","--epr-category-icon-active-color":"var(--epr-dark-category-icon-active-color)","--epr-skin-tone-picker-menu-color":"var(--epr-dark-skin-tone-picker-menu-color)"},k0=Tr.create({main:{".":["epr-main",Rn.emojiPicker],position:"relative",display:"flex",flexDirection:"column",borderWidth:"1px",borderStyle:"solid",borderRadius:"var(--epr-picker-border-radius)",borderColor:"var(--epr-picker-border-color)",backgroundColor:"var(--epr-bg-color)",overflow:"hidden",transition:"all 0.3s ease-in-out, background-color 0.1s ease-in-out","*":{boxSizing:"border-box",fontFamily:"sans-serif"}},baseVariables:{"--":{"--epr-highlight-color":"#007aeb","--epr-hover-bg-color":"#f1f8ff","--epr-hover-bg-color-reduced-opacity":"#f1f8ff80","--epr-focus-bg-color":"#e0f0ff","--epr-text-color":"#858585","--epr-search-input-bg-color":"#f6f6f6","--epr-picker-border-color":"#e7e7e7","--epr-bg-color":"#fff","--epr-reactions-bg-color":"#ffffff90","--epr-category-icon-active-color":"#6aa8de","--epr-skin-tone-picker-menu-color":"#ffffff95","--epr-horizontal-padding":"10px","--epr-picker-border-radius":"8px","--epr-search-border-color":"var(--epr-highlight-color)","--epr-header-padding":"15px var(--epr-horizontal-padding)","--epr-active-skin-tone-indicator-border-color":"var(--epr-highlight-color)","--epr-active-skin-hover-color":"var(--epr-hover-bg-color)","--epr-search-input-bg-color-active":"var(--epr-search-input-bg-color)","--epr-search-input-padding":"0 30px","--epr-search-input-border-radius":"8px","--epr-search-input-height":"40px","--epr-search-input-text-color":"var(--epr-text-color)","--epr-search-input-placeholder-color":"var(--epr-text-color)","--epr-search-bar-inner-padding":"var(--epr-horizontal-padding)","--epr-category-navigation-button-size":"30px","--epr-emoji-variation-picker-height":"45px","--epr-emoji-variation-picker-bg-color":"var(--epr-bg-color)","--epr-preview-height":"70px","--epr-preview-text-size":"14px","--epr-preview-text-padding":"0 var(--epr-horizontal-padding)","--epr-preview-border-color":"var(--epr-picker-border-color)","--epr-preview-text-color":"var(--epr-text-color)","--epr-category-padding":"0 var(--epr-horizontal-padding)","--epr-category-label-bg-color":"#ffffffe6","--epr-category-label-text-color":"var(--epr-text-color)","--epr-category-label-padding":"0 var(--epr-horizontal-padding)","--epr-category-label-height":v7+"px","--epr-emoji-size":"30px","--epr-emoji-padding":"5px","--epr-emoji-fullsize":"calc(var(--epr-emoji-size) + var(--epr-emoji-padding) * 2)","--epr-emoji-hover-color":"var(--epr-hover-bg-color)","--epr-emoji-variation-indicator-color":"var(--epr-picker-border-color)","--epr-emoji-variation-indicator-color-hover":"var(--epr-text-color)","--epr-header-overlay-z-index":"3","--epr-emoji-variations-indictator-z-index":"1","--epr-category-label-z-index":"2","--epr-skin-variation-picker-z-index":"5","--epr-preview-z-index":"6","--epr-dark":"#000","--epr-dark-emoji-variation-picker-bg-color":"var(--epr-dark)","--epr-dark-highlight-color":"#c0c0c0","--epr-dark-text-color":"var(--epr-highlight-color)","--epr-dark-hover-bg-color":"#363636f6","--epr-dark-hover-bg-color-reduced-opacity":"#36363680","--epr-dark-focus-bg-color":"#474747","--epr-dark-search-input-bg-color":"#333333","--epr-dark-category-label-bg-color":"#222222e6","--epr-dark-picker-border-color":"#151617","--epr-dark-bg-color":"#222222","--epr-dark-reactions-bg-color":"#22222290","--epr-dark-search-input-bg-color-active":"var(--epr-dark)","--epr-dark-emoji-variation-indicator-color":"#444","--epr-dark-category-icon-active-color":"#3271b7","--epr-dark-skin-tone-picker-menu-color":"#22222295"}},autoThemeDark:{".":Rn.autoTheme,"@media (prefers-color-scheme: dark)":{"--":RO}},darkTheme:{".":Rn.darkTheme,"--":RO},reactionsMenu:{".":"epr-reactions",height:"50px",display:"inline-flex",backgroundColor:"var(--epr-reactions-bg-color)",backdropFilter:"blur(8px)","--":{"--epr-picker-border-radius":"50px"}}});function y7(t,e){if(!t||!e)return 0;var n=t.getBoundingClientRect().width,r=e.getBoundingClientRect().width;return Math.floor(n/r)}function w7(t,e){if(!t||!e)return 0;var n=e.getBoundingClientRect().width,r=e.getBoundingClientRect().left,i=t.getBoundingClientRect().left;return Math.floor((r-i)/n)}function _7(t,e){if(!t||!e)return 0;var n=e.getBoundingClientRect().height,r=e.getBoundingClientRect().top,i=t.getBoundingClientRect().top;return Math.round((r-i)/n)}function b_e(t,e){if(!t||!e)return!1;var n=e.getBoundingClientRect().height,r=e.getBoundingClientRect().top,i=t.getBoundingClientRect().top,s=t.getBoundingClientRect().height;return Math.round(r-i+n)t.length?[]:ER(t,r,n)}function M7(t,e,n,r){var i=ER(t,e,n);return i[r]||i[i.length-1]||null}function C_e(t,e,n,r){var i=S_e(t,e,n);return i[r]||i[i.length-1]||null}function E_e(t,e,n,r){var i=ER(t,e-1,n);return i[r]||i[i.length-1]||null}function A_e(t,e,n){if(!t||!e.length)return null;var r=t.getBoundingClientRect().top,i=t.getBoundingClientRect().bottom,s=r+I_e(t),o=e.find(function(a){var l=a.getBoundingClientRect().top,c=a.getBoundingClientRect().bottom,u=a.clientHeight*n,f=l+u,h=c-u;return f=r&&f<=i||h>=r&&h<=i});return o||null}function T_e(t){return!!t.nextElementSibling}function I_e(t){for(var e=Array.from(t.querySelectorAll(_s(Rn.label))),n=0,r=e;n0)return s}return v7}var cx="button"+_s(Rn.emoji),L_e=[cx,_s(Rn.visible),":not("+_s(Rn.hidden)+")"].join("");function Na(t){var e;return(e=t==null?void 0:t.closest(cx))!=null?e:null}function AR(t){var e=E7(t),n=IR(t);if(!e)return[];var r=lm(n??e);return r?[r,n]:[]}function R_e(t){var e;return!!(t!=null&&t.matches(cx)||!(t==null||(e=t.parentElement)==null)&&e.matches(cx))}function PO(t){var e;return(e=t==null?void 0:t.clientHeight)!=null?e:0}function x7(t){if(!t)return 0;var e=Na(t),n=Vu(e),r=TR(n);return DO(e)+DO(n)+r}function TR(t){var e,n;if(!t)return 0;var r=t.querySelector(_s(Rn.categoryContent));return((e=t==null?void 0:t.clientHeight)!=null?e:0)-((n=r==null?void 0:r.clientHeight)!=null?n:0)}function P_e(t){return t?S7(t)0?[]:ewe(e);m.length>0&&r.current++;var v=0,w=m.map(function(y){var g=Bs(y,c),_=i(y),x=_.failedToLoad,S=_.filteredOut,D=_.hidden,T=u(y);return(D||T)&&v++,T?null:I.createElement(J2,{showVariations:h,key:g,emoji:y,unified:g,hidden:x,hiddenOnSearch:S,emojiStyle:o,lazyLoad:s,getEmojiUrl:f})});return I.createElement(O7,{categoryConfig:n,hidden:v===w.length},w)}var tMe=Tr.create({emojiList:{".":Rn.emojiList,listStyle:"none",margin:"0",padding:"0"}}),nMe="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI2LjMuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSI1MHB4IgoJIGhlaWdodD0iMTVweCIgdmlld0JveD0iMCAwIDUwIDE1IiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCA1MCAxNSIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxnIGlkPSJMYXllcl8xIj4KPC9nPgo8ZyBpZD0iTGF5ZXJfMiI+Cgk8cGF0aCBmaWxsPSIjRkZGRkZGIiBzdHJva2U9IiNFOEU3RTciIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgZD0iTTEuODYtMC40M2w5LjgzLDExLjUzYzAuNTksMC42OSwxLjU2LDAuNjksMi4xNCwwbDkuODMtMTEuNTMiLz4KCTxwYXRoIGZpbGw9IiMwMTAyMDIiIHN0cm9rZT0iIzE1MTYxNyIgc3Ryb2tlLW1pdGVybGltaXQ9IjEwIiBkPSJNMjYuODYtMC40M2w5LjgzLDExLjUzYzAuNTksMC42OSwxLjU2LDAuNjksMi4xNCwwbDkuODMtMTEuNTMiLz4KPC9nPgo8L3N2Zz4=",Lp;(function(t){t[t.Up=0]="Up",t[t.Down=1]="Down"})(Lp||(Lp={}));function rMe(){var t=H2(),e=jwe(),n=jm(),r=n[0],i=Hd(),s=sMe(e),o=s.getTop,a=s.getMenuDirection,l=a7(),c=iMe(e),u=Fm(),f=Na(t.current),h=!!(r&&f&&Um(r)&&f.classList.contains(Rn.emojiHasVariations));I.useEffect(function(){h&&V2(e.current)},[e,h,t]);var m,v;return!h&&t.current?l(null):(m=o(),v=c()),I.createElement("div",{ref:e,className:Fn(yw.variationPicker,a()===Lp.Down&&yw.pointingUp,h&&yw.visible),style:{top:m}},h&&r?[Bs(r)].concat(Lv(r)).slice(0,6).map(function(w){return I.createElement(J2,{key:w,emoji:r,unified:w,emojiStyle:i,showVariations:!1,getEmojiUrl:u})}):null,I.createElement("div",{className:Fn(yw.pointer),style:v}))}function iMe(t){var e=H2();return function(){var r={};if(!t.current)return r;if(e.current){var i=Na(e.current),s=D_e(i);if(!i)return r;r.left=s+(i==null?void 0:i.clientWidth)/2}return r}}function sMe(t){var e=H2(),n=ha(),r=Lp.Up;return{getMenuDirection:i,getTop:s};function i(){return r}function s(){r=Lp.Up;var o=0;if(!t.current)return 0;var a=PO(t.current);if(e.current){var l,c=n.current,u=Na(e.current),f=PO(u);o=x7(u);var h=(l=c==null?void 0:c.scrollTop)!=null?l:0;h>o-a&&(r=Lp.Down,o+=f+a)}return o-a}}var yw=Tr.create(kr({variationPicker:{".":Rn.variationPicker,position:"absolute",right:"15px",left:"15px",padding:"5px",boxShadow:"0px 2px 5px rgba(0, 0, 0, 0.2)",borderRadius:"3px",display:"flex",alignItems:"center",justifyContent:"space-around",opacity:"0",visibility:"hidden",pointerEvents:"none",top:"-100%",border:"1px solid var(--epr-picker-border-color)",height:"var(--epr-emoji-variation-picker-height)",zIndex:"var(--epr-skin-variation-picker-z-index)",background:"var(--epr-emoji-variation-picker-bg-color)",transform:"scale(0.9)",transition:"transform 0.1s ease-out, opacity 0.2s ease-out"},visible:{opacity:"1",visibility:"visible",pointerEvents:"all",transform:"scale(1)"},pointingUp:{".":"pointing-up",transformOrigin:"center 0%",transform:"scale(0.9)"},".pointing-up":{pointer:{top:"0",transform:"rotate(180deg) translateY(100%) translateX(18px)"}},pointer:{".":"epr-emoji-pointer",content:"",position:"absolute",width:"25px",height:"15px",backgroundRepeat:"no-repeat",backgroundPosition:"0 0",backgroundSize:"50px 15px",top:"100%",transform:"translateX(-18px)",backgroundImage:"url("+nMe+")"}},Cu("pointer",{backgroundPosition:"-25px 0"})));function oMe(){var t=ha();return Q_e(t),B7(t,I1.PICKER),Zwe(),I.createElement("div",{className:Fn(aMe.body,zd.hiddenOnReactions),ref:t},I.createElement(rMe,null),I.createElement(q_e,null))}var aMe=Tr.create({body:{".":Rn.scrollBody,flex:"1",overflowY:"scroll",overflowX:"hidden",position:"relative"}});function lMe(t,e){if(!t||!e)return 0;var n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return r.height-(n.y-r.y)}function cMe(t,e){var n=ha(),r=f7(),i=u7();I.useEffect(function(){if(!t)return;var s=n.current;s==null||s.addEventListener("keydown",l,{passive:!0}),s==null||s.addEventListener("mouseover",c,!0),s==null||s.addEventListener("focus",o,!0),s==null||s.addEventListener("mouseout",a,{passive:!0}),s==null||s.addEventListener("blur",a,!0);function o(u){var f=Na(u.target);if(!f)return a();var h=A7(f),m=h.unified,v=h.originalUnified;if(!m||!v)return a();e({unified:m,originalUnified:v})}function a(u){if(u){var f=u.relatedTarget;if(!Na(f))return e(null)}e(null)}function l(u){u.key==="Escape"&&e(null)}function c(u){if(!r()){var f=Na(u.target);if(f){var h=lMe(f,s),m=f.getBoundingClientRect().height;if(h button":{width:"var(--epr-skin-tone-size)",display:"block",cursor:"pointer",borderRadius:"4px",height:"var(--epr-skin-tone-size)",position:"absolute",right:"0",transition:"transform 0.3s ease-in-out, opacity 0.35s ease-in-out",zIndex:"0",boxShadow:"0 0 0 0px var(--epr-active-skin-hover-color)"}}});function mMe(){var t=KV(),e=m7();return t.showPreview?I.createElement(U7,{className:Fn(X_.preview,zd.hiddenOnReactions)},I.createElement(gMe,null),I.createElement(fMe,null),e?I.createElement(pMe,null):null):null}function gMe(){var t,e=KV(),n=I.useState(null),r=n[0],i=n[1],s=Hd(),o=jm(),a=o[0],l=Fm();cMe(e.showPreview,i);var c=lm((t=r==null?void 0:r.unified)!=null?t:r==null?void 0:r.originalUnified),u=c!=null&&r!=null;return I.createElement(f,null);function f(){var h=a??lm(e.defaultEmoji);if(!h)return null;var m=a?AI(a):e.defaultCaption;return I.createElement(I.Fragment,null,I.createElement("div",null,u?I.createElement(II,{unified:r==null?void 0:r.unified,emoji:c,emojiStyle:s,size:45,getEmojiUrl:l,className:Fn(X_.emoji)}):h?I.createElement(II,{unified:Bs(h),emoji:h,emojiStyle:s,size:45,getEmojiUrl:l,className:Fn(X_.emoji)}):null),I.createElement("div",{className:Fn(X_.label)},u?AI(c):m))}}var X_=Tr.create({preview:{alignItems:"center",borderTop:"1px solid var(--epr-preview-border-color)",height:"var(--epr-preview-height)",padding:"0 var(--epr-horizontal-padding)",position:"relative",zIndex:"var(--epr-preview-z-index)"},label:{color:"var(--epr-preview-text-color)",fontSize:"var(--epr-preview-text-size)",padding:"var(--epr-preview-text-padding)",textTransform:"capitalize"},emoji:{padding:"0"}});function vMe(t){var e;return(e=t==null?void 0:t.getAttribute("data-name"))!=null?e:null}function yMe(t){var e=ha();I.useEffect(function(){var n=new Map,r=e.current,i=new IntersectionObserver(function(s){if(r){for(var o=Rye(s),a;!(a=o()).done;){var l=a.value,c=vMe(l.target);n.set(c,l.intersectionRatio)}var u=Array.from(n),f=u[u.length-1];if(f[1]==1)return t(f[0]);for(var h=0,m=u;h .epr-icn-clear-search":{backgroundPositionY:"-60px"}}},zO=Tr.create(kr({btnClearSearch:{".":"epr-btn-clear-search",position:"absolute",right:"var(--epr-search-bar-inner-padding)",height:"30px",width:"30px",display:"flex",alignItems:"center",justifyContent:"center",top:"50%",transform:"translateY(-50%)",padding:"0",borderRadius:"50%",":hover":{background:"var(--epr-hover-bg-color)"},":focus":{background:"var(--epr-hover-bg-color)"}},icnClearnSearch:{".":"epr-icn-clear-search",backgroundColor:"transparent",backgroundRepeat:"no-repeat",backgroundSize:"20px",height:"20px",width:"20px",backgroundImage:"url("+j7+")",":hover":{backgroundPositionY:"-20px"},":focus":{backgroundPositionY:"-20px"}}},Cu("icnClearnSearch",{backgroundPositionY:"-40px"}),Cu("btnClearSearch",TMe))),RE=_s(Rn.emojiPicker)+" "+_s(Rn.emojiList),z7=["button",_s(Rn.emoji)].join(""),IMe=_s(Rn.category);function LMe(t){var e=t.value;if(!e)return null;var n=RMe(e);return I.createElement("style",null,`
+ `+RE+" "+z7+` {
+ display: none;
+ }
+
+
+ `+RE+" "+n+` {
+ display: flex;
+ }
+
+ `+RE+" "+IMe+":not(:has("+n+`)) {
+ display: none;
+ }
+ `)}function RMe(t){return[z7,'[data-full-name*="',TI(t),'"]'].join("")}var PMe="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI2LjMuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjQwcHgiIHZpZXdCb3g9IjAgMCAyMCA0MCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMjAgNDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZmlsbD0iIzg2ODY4NiIgZD0iTTEyLDguODFjMCwyLjA4LTEuNjgsMy43Ni0zLjc2LDMuNzZjLTIuMDgsMC0zLjc2LTEuNjgtMy43Ni0zLjc2CgljMC0yLjA4LDEuNjgtMy43NiwzLjc2LTMuNzZDMTAuMzIsNS4wNSwxMiw2LjczLDEyLDguODF6IE0xMS4yMywxMi43MmMtMC44MywwLjY0LTEuODcsMS4wMS0yLjk5LDEuMDFjLTIuNzIsMC00LjkyLTIuMi00LjkyLTQuOTIKCWMwLTIuNzIsMi4yLTQuOTIsNC45Mi00LjkyYzIuNzIsMCw0LjkyLDIuMiw0LjkyLDQuOTJjMCwxLjEzLTAuMzgsMi4xNi0xLjAxLDIuOTlsMy45NCwzLjkzYzAuMjUsMC4yNSwwLjI1LDAuNjYsMCwwLjkyCgljLTAuMjUsMC4yNS0wLjY2LDAuMjUtMC45MiwwTDExLjIzLDEyLjcyeiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZmlsbD0iI0MwQzBCRiIgZD0iTTEyLDI4LjgxYzAsMi4wOC0xLjY4LDMuNzYtMy43NiwzLjc2Yy0yLjA4LDAtMy43Ni0xLjY4LTMuNzYtMy43NgoJYzAtMi4wOCwxLjY4LTMuNzYsMy43Ni0zLjc2QzEwLjMyLDI1LjA1LDEyLDI2LjczLDEyLDI4LjgxeiBNMTEuMjMsMzIuNzJjLTAuODMsMC42NC0xLjg3LDEuMDEtMi45OSwxLjAxCgljLTIuNzIsMC00LjkyLTIuMi00LjkyLTQuOTJjMC0yLjcyLDIuMi00LjkyLDQuOTItNC45MmMyLjcyLDAsNC45MiwyLjIsNC45Miw0LjkyYzAsMS4xMy0wLjM4LDIuMTYtMS4wMSwyLjk5bDMuOTQsMy45MwoJYzAuMjUsMC4yNSwwLjI1LDAuNjYsMCwwLjkyYy0wLjI1LDAuMjUtMC42NiwwLjI1LTAuOTIsMEwxMS4yMywzMi43MnoiLz4KPC9zdmc+";function DMe(){return I.createElement("div",{className:Fn(NMe.icnSearch)})}var NMe=Tr.create(kr({icnSearch:{".":"epr-icn-search",content:"",position:"absolute",top:"50%",left:"var(--epr-search-bar-inner-padding)",transform:"translateY(-50%)",width:"20px",height:"20px",backgroundRepeat:"no-repeat",backgroundPosition:"0 0",backgroundSize:"20px",backgroundImage:"url("+PMe+")"}},Cu("icnSearch",{backgroundPositionY:"-20px"})));function kMe(){var t=ZV(),e=SR();return t?null:I.createElement(U7,{className:Fn(K_.overlay)},I.createElement(BMe,null),e?I.createElement(F7,null):null)}function BMe(){var t=I.useState(0),e=t[0],n=t[1],r=Gd(),i=Gu(),s=pwe(),o=gwe(),a=n_e(),l=a.statusSearchResults,c=a.searchTerm,u=a.onChange,f=i==null?void 0:i.current,h=f==null?void 0:f.value;return I.createElement(Y2,{className:Fn(K_.searchContainer)},I.createElement(LMe,{value:h}),I.createElement("input",{autoFocus:o,"aria-label":"Type to search for an emoji",onFocus:r,className:Fn(K_.search),type:"text","aria-controls":"epr-search-id",placeholder:s,onChange:function(v){n(e+1),setTimeout(function(){var w,y;u((w=v==null||(y=v.target)==null?void 0:y.value)!=null?w:h)})},ref:i}),c?I.createElement("div",{role:"status",className:Fn("epr-status-search-results",K_.visuallyHidden),"aria-live":"polite",id:"epr-search-id","aria-atomic":"true"},l):null,I.createElement(DMe,null),I.createElement(AMe,null))}var K_=Tr.create(kr({overlay:{padding:"var(--epr-header-padding)",zIndex:"var(--epr-header-overlay-z-index)"},searchContainer:{".":"epr-search-container",flex:"1",display:"block",minWidth:"0"},visuallyHidden:{clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",overflow:"hidden",position:"absolute",whiteSpace:"nowrap",width:"1px"},search:{outline:"none",transition:"all 0.2s ease-in-out",color:"var(--epr-search-input-text-color)",borderRadius:"var(--epr-search-input-border-radius)",padding:"var(--epr-search-input-padding)",height:"var(--epr-search-input-height)",backgroundColor:"var(--epr-search-input-bg-color)",border:"1px solid var(--epr-search-input-bg-color)",width:"100%",":focus":{backgroundColor:"var(--epr-search-input-bg-color-active)",border:"1px solid var(--epr-search-border-color)"},"::placeholder":{color:"var(--epr-search-input-placeholder-color)"}},btnClearSearch:{".":"epr-btn-clear-search",position:"absolute",right:"var(--epr-search-bar-inner-padding)",height:"30px",width:"30px",display:"flex",alignItems:"center",justifyContent:"center",top:"50%",transform:"translateY(-50%)",padding:"0",borderRadius:"50%",":hover":{background:"var(--epr-hover-bg-color)"},":focus":{background:"var(--epr-hover-bg-color)"}},icnClearnSearch:{".":"epr-icn-clear-search",backgroundColor:"transparent",backgroundRepeat:"no-repeat",backgroundSize:"20px",height:"20px",width:"20px",backgroundImage:"url("+j7+")",":hover":{backgroundPositionY:"-20px"},":focus":{backgroundPositionY:"-20px"}}},Cu("icnClearnSearch",{backgroundPositionY:"-40px"}),Cu("btnClearSearch",{":hover > .epr-icn-clear-search":{backgroundPositionY:"-60px"}})));function OMe(){return I.createElement(Y2,{className:Fn("epr-header",zd.hiddenOnReactions)},I.createElement(kMe,null),I.createElement(CMe,null))}function UMe(t){return I.createElement(Uwe,null,I.createElement(Pye,null),I.createElement(fwe,Object.assign({},t),I.createElement(FMe,null)))}function FMe(){var t=F2(),e=t[0],n=YV(),r=I.useState(!e),i=r[0],s=r[1],o=ywe();return I.useEffect(function(){e&&!n||i||s(!0)},[i,n,e]),o?I.createElement(M_e,null,I.createElement(Y_e,null),I.createElement(jMe,{renderAll:i})):null}function jMe(t){var e=t.renderAll;return e?I.createElement(I.Fragment,null,I.createElement(OMe,null),I.createElement(oMe,null),I.createElement(mMe,null)):null}var zMe=I.memo(UMe,OV),HMe=function(t){Iye(e,t);function e(r){var i;return i=t.call(this,r)||this,i.state={hasError:!1},i}e.getDerivedStateFromError=function(){return{hasError:!0}};var n=e.prototype;return n.componentDidCatch=function(i,s){console.error("Emoji Picker React failed to render:",i,s)},n.render=function(){return this.state.hasError?null:this.props.children},e}(I.Component);function GMe(t){var e=hwe({onEmojiClick:t.onEmojiClick,onReactionClick:t.onReactionClick,onSkinToneChange:t.onSkinToneChange});return I.createElement(HMe,null,I.createElement($V.Provider,{value:e},I.createElement(zMe,Object.assign({},t))))}var DR={},VMe=Ur;Object.defineProperty(DR,"__esModule",{value:!0});var NR=DR.default=void 0,WMe=VMe(si()),$Me=O;NR=DR.default=(0,WMe.default)((0,$Me.jsx)("path",{d:"M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm7 7V3.5L18.5 9z"}),"InsertDriveFile");function JMe(){const[t,e]=I.useState(""),[n,r]=I.useState([]),[i,s]=I.useState(null),[o,a]=I.useState(!1),{chat:l,user:c,setChat:u,scrollDown:f}=Fa(),{user:h}=Ms(),m=I.useRef(null);function v(S){e(t+S.emoji)}function w(S){r(S.target.files),x(S.target.files[0])}function y(){m.current.value="",r([])}function g(S){S.keyCode==13&&(S.preventDefault(),S.shiftKey==!0?e(t+`
+`):_())}async function _(){let S;if(!t.trim()&&!n.length)return;l||(S=(await rO(["chats"],{pair:[h.uid,c.uid],users:{[h.uid]:h,[c.uid]:c}})).id,await cl(["chats",S],{id:S}),u(await om(["chats",S])));const D=[],T=[];if(n.length){const R=Array.from(n);D.push(...await MI(["chats",l.id],R.filter(C=>C.type.includes("image")))),T.push(...await MI(["chats",l.id],R.filter(C=>!C.type.includes("image"))))}e(""),r([]);const E={text:t,date:_i.fromDate(new Date),check:!1,userUid:h.uid,media:T,imgs:D};await cl(["chats",S||l.id],{lastMessage:E}),await rO(["chats",S||l.id,"messages"],E),f()}function x(S){const D=new FileReader;D.onload=()=>{s(D.result)},D.readAsDataURL(S)}return O.jsxs(YMe,{children:[!!n.length&&O.jsx(QMe,{children:O.jsxs(oxe,{children:[O.jsxs(axe,{children:[n[0].type.includes("image")?O.jsx(cxe,{src:i}):O.jsxs(uxe,{children:[O.jsx(NR,{}),n[0].name]}),!!(n.length-1)&&O.jsxs(lxe,{children:["+",n.length-1," files"]})]}),O.jsx(fxe,{onClick:y})]})}),O.jsxs(XMe,{children:[O.jsx(sxe,{ref:m,id:"files",type:"file",multiple:!0,onChange:w}),O.jsx("label",{htmlFor:"files",children:O.jsx(KMe,{})}),O.jsx(exe,{value:t,onChange:S=>e(S.target.value),placeholder:"Input message...",multiline:!0,maxRows:4,onKeyDown:g}),O.jsxs(txe,{children:[O.jsxs(nxe,{onMouseLeave:()=>a(!1),children:[O.jsx(ZMe,{onClick:()=>a(!o),onMouseMove:()=>a(!0)}),O.jsx(rxe,{children:O.jsx(ixe,{autoFocusSearch:!1,lazyLoadEmojis:!0,open:o,theme:"light",onEmojiClick:v,style:{"--epr-bg-color":"#212c49","--epr-picker-border-color":"#1a233a","--epr-search-input-bg-color":"#151c2e","--epr-light":"#11192e","--epr-skin-tone-picker-menu-color":"rgba(17, 25, 46, 0.6)","--epr-category-label-bg-color":"rgba(17, 25, 46, 0.902)","--epr-hover-bg-color":"#35487c","--epr-focus-bg-color":"#35487c"}})})]}),O.jsx(qMe,{onClick:_,disabled:!(t||n.length)})]})]})]})}const YMe=Be.div`
+ display: flex;
+ flex-direction: column;
+ row-gap: 10px;
+
+ background: ${Dn.$colorChat};
+ ${_l("padding",17,12,20,16)}
+`,QMe=Be.div`
+ display: flex;
+ align-items: center;
+`,XMe=Be.div`
+ display: flex;
+ align-items: flex-end;
+`,kR=wl`
+ ${En("font-size",30,25,1)}
+
+ @media (any-hover:hover) {
+ & {
+ cursor: pointer;
+ transition: all 0.3s ease 0s;
+ }
+ &:hover {
+ color: ${Dn.$colorMain};
+ }
+ }
+`,KMe=Be(bV)`
+ ${kR}
+`,ZMe=Be(SV)`
+ ${kR}
+`,qMe=Be(CV)`
+ ${kR}
+
+ &[disabled] {
+ color: #838383;
+ pointer-events: none;
+ }
+`,exe=Be(hle)`
+ flex: 1 1 auto;
+ background: transparent;
+ margin-right: 10px;
+ margin-left: 10px;
+
+ & .MuiInputBase-root {
+ padding: 0;
+ }
+
+ & textarea {
+ ${En("font-size",21,18,1)}
+ ${xb(5,Dn.$colorMain,"#334881",5)}
+ }
+
+ & * {
+ border: none;
+ border-color: transparent !important;
+ }
+`,txe=Be.div`
+ display: flex;
+ align-items: center;
+ column-gap: 10px;
+`,nxe=Be.div`
+ position: relative;
+`,rxe=Be.div`
+ position: absolute;
+ right: -20px;
+ bottom: calc(100% - 5px);
+ padding: 10px;
+`,ixe=Be(GMe)`
+ & * {
+ ${xb(5,Dn.$colorMain,"#334881",5)}
+ }
+`,sxe=Be.input`
+ display: none;
+`,oxe=Be.div`
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ width: 100%;
+`,axe=Be.div`
+ display: flex;
+ align-items: center;
+ column-gap: 5px;
+`,lxe=Be.span`
+ color: #fff;
+`,cxe=Be.img`
+ width: 50px;
+ height: 50px;
+ object-fit: contain;
+`,uxe=Be.div`
+ display: flex;
+ align-items: center;
+`,fxe=Be(C4)`
+ font-size: 30px;
+ @media (any-hover: hover) {
+ & {
+ cursor: pointer;
+ transition: all 0.3s ease 0s;
+ }
+ &:hover {
+ color: ${Dn.$colorMain};
+ }
+ }
+`;function Si(){return Si=Object.assign||function(t){for(var e=1;e=0||(i[n]=t[n]);return i}function id(t){var e=I.useRef({fn:t,curr:void 0}).current;if(e.fn=t,!e.curr){var n=Object.create(null);Object.keys(t).forEach(function(r){n[r]=function(){var i;return(i=e.fn[r]).call.apply(i,[e.fn].concat([].slice.call(arguments)))}}),e.curr=n}return e.curr}function fx(t){return I.useReducer(function(e,n){return Si({},e,typeof n=="function"?n(e):n)},t)}var H7=I.createContext(void 0),Ul=typeof window<"u"&&"ontouchstart"in window,LI=function(t,e,n){return Math.max(Math.min(t,n),e)},_w=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=0),LI(t,1*(1-n),Math.max(6,e)*(1+n))},RI=typeof window>"u"||/ServerSideRendering/.test(navigator&&navigator.userAgent)?I.useEffect:I.useLayoutEffect;function Xh(t,e,n){var r=I.useRef(e);r.current=e,I.useEffect(function(){function i(s){r.current(s)}return t&&window.addEventListener(t,i,n),function(){t&&window.removeEventListener(t,i)}},[t])}var dxe=["container"];function hxe(t){var e=t.container,n=e===void 0?document.body:e,r=Q2(t,dxe);return md.createPortal(qt.createElement("div",Si({},r)),n)}function pxe(t){return qt.createElement("svg",Si({width:"44",height:"44",viewBox:"0 0 768 768"},t),qt.createElement("path",{d:"M607.5 205.5l-178.5 178.5 178.5 178.5-45 45-178.5-178.5-178.5 178.5-45-45 178.5-178.5-178.5-178.5 45-45 178.5 178.5 178.5-178.5z"}))}function mxe(t){return qt.createElement("svg",Si({width:"44",height:"44",viewBox:"0 0 768 768"},t),qt.createElement("path",{d:"M640.5 352.5v63h-390l178.5 180-45 45-256.5-256.5 256.5-256.5 45 45-178.5 180h390z"}))}function gxe(t){return qt.createElement("svg",Si({width:"44",height:"44",viewBox:"0 0 768 768"},t),qt.createElement("path",{d:"M384 127.5l256.5 256.5-256.5 256.5-45-45 178.5-180h-390v-63h390l-178.5-180z"}))}function vxe(){return I.useEffect(function(){var t=document.body.style,e=t.overflow;return t.overflow="hidden",function(){t.overflow=e}},[]),null}function HO(t){var e=t.touches[0],n=e.clientX,r=e.clientY;if(t.touches.length>=2){var i=t.touches[1],s=i.clientX,o=i.clientY;return[(n+s)/2,(r+o)/2,Math.sqrt(Math.pow(s-n,2)+Math.pow(o-r,2))]}return[n,r,0]}var Gc=function(t,e,n,r){var i,s=n*e,o=(s-r)/2,a=t;return s<=r?(i=1,a=0):t>0&&o-t<=0?(i=2,a=o):t<0&&o+t<=0&&(i=3,a=-o),[i,a]};function PE(t,e,n,r,i,s,o,a,l,c){o===void 0&&(o=innerWidth/2),a===void 0&&(a=innerHeight/2),l===void 0&&(l=0),c===void 0&&(c=0);var u=Gc(t,s,n,innerWidth)[0],f=Gc(e,s,r,innerHeight),h=innerWidth/2,m=innerHeight/2;return{x:o-s/i*(o-(h+t))-h+(r/n>=3&&n*s===innerWidth?0:u?l/2:l),y:a-s/i*(a-(m+e))-m+(f[0]?c/2:c),lastCX:o,lastCY:a}}function PI(t,e,n){var r=t%180!=0;return r?[n,e,r]:[e,n,r]}function DE(t,e,n){var r=PI(n,innerWidth,innerHeight),i=r[0],s=r[1],o=0,a=i,l=s,c=t/e*s,u=e/t*i;return t=s?a=c:t>=i&&ei/s?l=u:e/t>=3&&!r[2]?o=((l=u)-s)/2:a=c,{width:a,height:l,x:0,y:o,pause:!0}}function Mw(t,e){var n=e.leading,r=n!==void 0&&n,i=e.maxWait,s=e.wait,o=s===void 0?i||0:s,a=I.useRef(t);a.current=t;var l=I.useRef(0),c=I.useRef(),u=function(){return c.current&&clearTimeout(c.current)},f=I.useCallback(function(){var h=[].slice.call(arguments),m=Date.now();function v(){l.current=m,u(),a.current.apply(null,h)}var w=l.current,y=m-w;if(w===0&&(r&&v(),l.current=m),i!==void 0){if(y>i)return void v()}else y=1&&s&&s())};u()}function u(){l=requestAnimationFrame(c)}}var wxe={T:0,L:0,W:0,H:0,FIT:void 0},G7=function(){var t=I.useRef(!1);return I.useEffect(function(){return t.current=!0,function(){t.current=!1}},[]),t},_xe=["className"];function Mxe(t){var e=t.className,n=e===void 0?"":e,r=Q2(t,_xe);return qt.createElement("div",Si({className:"PhotoView__Spinner "+n},r),qt.createElement("svg",{viewBox:"0 0 32 32",width:"36",height:"36",fill:"white"},qt.createElement("path",{opacity:".25",d:"M16 0 A16 16 0 0 0 16 32 A16 16 0 0 0 16 0 M16 4 A12 12 0 0 1 16 28 A12 12 0 0 1 16 4"}),qt.createElement("path",{d:"M16 0 A16 16 0 0 1 32 16 L28 16 A12 12 0 0 0 16 4z"})))}var xxe=["src","loaded","broken","className","onPhotoLoad","loadingElement","brokenElement"];function bxe(t){var e=t.src,n=t.loaded,r=t.broken,i=t.className,s=t.onPhotoLoad,o=t.loadingElement,a=t.brokenElement,l=Q2(t,xxe),c=G7();return e&&!r?qt.createElement(qt.Fragment,null,qt.createElement("img",Si({className:"PhotoView__Photo"+(i?" "+i:""),src:e,onLoad:function(u){var f=u.target;c.current&&s({loaded:!0,naturalWidth:f.naturalWidth,naturalHeight:f.naturalHeight})},onError:function(){c.current&&s({broken:!0})},alt:""},l)),!n&&(qt.createElement("span",{className:"PhotoView__icon"},o)||qt.createElement(Mxe,{className:"PhotoView__icon"}))):a?qt.createElement("span",{className:"PhotoView__icon"},typeof a=="function"?a({src:e}):a):null}var Sxe={naturalWidth:void 0,naturalHeight:void 0,width:void 0,height:void 0,loaded:void 0,broken:!1,x:0,y:0,touched:!1,maskTouched:!1,rotate:0,scale:1,CX:0,CY:0,lastX:0,lastY:0,lastCX:0,lastCY:0,lastScale:1,touchTime:0,touchLength:0,pause:!0,stopRaf:!0,reach:void 0};function Cxe(t){var e=t.item,n=e.src,r=e.render,i=e.width,s=i===void 0?0:i,o=e.height,a=o===void 0?0:o,l=e.originRef,c=t.visible,u=t.speed,f=t.easing,h=t.wrapClassName,m=t.className,v=t.style,w=t.loadingElement,y=t.brokenElement,g=t.onPhotoTap,_=t.onMaskTap,x=t.onReachMove,S=t.onReachUp,D=t.onPhotoResize,T=t.isActive,E=t.expose,R=fx(Sxe),C=R[0],L=R[1],P=I.useRef(0),z=G7(),B=C.naturalWidth,Y=B===void 0?s:B,ie=C.naturalHeight,ee=ie===void 0?a:ie,le=C.width,j=le===void 0?s:le,q=C.height,ne=q===void 0?a:q,de=C.loaded,_e=de===void 0?!n:de,ge=C.broken,ce=C.x,we=C.y,he=C.touched,Ie=C.stopRaf,et=C.maskTouched,ct=C.rotate,it=C.scale,ut=C.CX,$=C.CY,Ce=C.lastX,Ne=C.lastY,ze=C.lastCX,Ue=C.lastCY,Et=C.lastScale,lt=C.touchTime,yt=C.touchLength,re=C.pause,V=C.reach,Ee=id({onScale:function(Le){return je(_w(Le))},onRotate:function(Le){ct!==Le&&(E({rotate:Le}),L(Si({rotate:Le},DE(Y,ee,Le))))}});function je(Le,At,Jt){it!==Le&&(E({scale:Le}),L(Si({scale:Le},PE(ce,we,j,ne,it,Le,At,Jt),Le<=1&&{x:0,y:0})))}var De=Mw(function(Le,At,Jt){if(Jt===void 0&&(Jt=0),(he||et)&&T){var rn=PI(ct,j,ne),Jn=rn[0],jn=rn[1];if(Jt===0&&P.current===0){var vn=Math.abs(Le-ut)<=20,ue=Math.abs(At-$)<=20;if(vn&&ue)return void L({lastCX:Le,lastCY:At});P.current=vn?At>$?3:2:1}var me,Se=Le-ze,Ge=At-Ue;if(Jt===0){var mt=Gc(Se+Ce,it,Jn,innerWidth)[0],bt=Gc(Ge+Ne,it,jn,innerHeight);me=function(gt,Gt,F,W){return Gt&>===1||W==="x"?"x":F&>>1||W==="y"?"y":void 0}(P.current,mt,bt[0],V),me!==void 0&&x(me,Le,At,it)}if(me==="x"||et)return void L({reach:"x"});var ot=_w(it+(Jt-yt)/100/2*it,Y/j,.2);E({scale:ot}),L(Si({touchLength:Jt,reach:me,scale:ot},PE(ce,we,j,ne,it,ot,Le,At,Se,Ge)))}},{maxWait:8});function He(Le){return!Ie&&!he&&(z.current&&L(Si({},Le,{pause:c})),z.current)}var pt,Qe,Ye,Ke,nt,_t,Qt,We,Ze=(nt=function(Le){return He({x:Le})},_t=function(Le){return He({y:Le})},Qt=function(Le){return z.current&&(E({scale:Le}),L({scale:Le})),!he&&z.current},We=id({X:function(Le){return nt(Le)},Y:function(Le){return _t(Le)},S:function(Le){return Qt(Le)}}),function(Le,At,Jt,rn,Jn,jn,vn,ue,me,Se,Ge){var mt=PI(Se,Jn,jn),bt=mt[0],ot=mt[1],gt=Gc(Le,ue,bt,innerWidth),Gt=gt[0],F=gt[1],W=Gc(At,ue,ot,innerHeight),ae=W[0],U=W[1],J=Date.now()-Ge;if(J>=200||ue!==vn||Math.abs(me-vn)>1){var K=PE(Le,At,Jn,jn,vn,ue),se=K.x,te=K.y,ve=Gt?F:se!==Le?se:null,xe=ae?U:te!==At?te:null;return ve!==null&&Bf(Le,ve,We.X),xe!==null&&Bf(At,xe,We.Y),void(ue!==vn&&Bf(vn,ue,We.S))}var Te=(Le-Jt)/J,Ae=(At-rn)/J,ht=Math.sqrt(Math.pow(Te,2)+Math.pow(Ae,2)),Ve=!1,$e=!1;(function(ft,Mt){var qe,St=ft,at=0,Oe=0,kt=function(yn){qe||(qe=yn);var Tn=yn-qe,ar=Math.sign(ft),cn=-.001*ar,ln=Math.sign(-St)*Math.pow(St,2)*2e-4,dr=St*Tn+(cn+ln)*Math.pow(Tn,2)/2;at+=dr,qe=yn,ar*(St+=(cn+ln)*Tn)<=0?Ut():Mt(at)?Pt():Ut()};function Pt(){Oe=requestAnimationFrame(kt)}function Ut(){cancelAnimationFrame(Oe)}Pt()})(ht,function(ft){var Mt=Le+ft*(Te/ht),qe=At+ft*(Ae/ht),St=Gc(Mt,vn,bt,innerWidth),at=St[0],Oe=St[1],kt=Gc(qe,vn,ot,innerHeight),Pt=kt[0],Ut=kt[1];if(at&&!Ve&&(Ve=!0,Gt?Bf(Mt,Oe,We.X):GO(Oe,Mt+(Mt-Oe),We.X)),Pt&&!$e&&($e=!0,ae?Bf(qe,Ut,We.Y):GO(Ut,qe+(qe-Ut),We.Y)),Ve&&$e)return!1;var yn=Ve||We.X(Oe),Tn=$e||We.Y(Ut);return yn&&Tn})}),Tt=(pt=g,Qe=function(Le,At){V||je(it!==1?1:Math.max(2,Y/j),Le,At)},Ye=I.useRef(0),Ke=Mw(function(){Ye.current=0,pt.apply(void 0,[].slice.call(arguments))},{wait:300}),function(){var Le=[].slice.call(arguments);Ye.current+=1,Ke.apply(void 0,Le),Ye.current>=2&&(Ke.cancel(),Ye.current=0,Qe.apply(void 0,Le))});function Ft(Le,At){if(P.current=0,(he||et)&&T){L({touched:!1,maskTouched:!1,pause:!1,stopRaf:!1,reach:void 0});var Jt=_w(it,Y/j);if(Ze(ce,we,Ce,Ne,j,ne,it,Jt,Et,ct,lt),S(Le,At),ut===Le&&$===At){if(he)return void Tt(Le,At);et&&_(Le,At)}}}function en(Le,At,Jt){Jt===void 0&&(Jt=0),L({touched:!0,CX:Le,CY:At,lastCX:Le,lastCY:At,lastX:ce,lastY:we,lastScale:it,touchLength:Jt,touchTime:Date.now()})}function pe(Le){L({maskTouched:!0,CX:Le.clientX,CY:Le.clientY,lastX:ce,lastY:we})}Xh(Ul?void 0:"mousemove",function(Le){Le.preventDefault(),De(Le.clientX,Le.clientY)}),Xh(Ul?void 0:"mouseup",function(Le){Ft(Le.clientX,Le.clientY)}),Xh(Ul?"touchmove":void 0,function(Le){Le.preventDefault();var At=HO(Le);De.apply(void 0,At)},{passive:!1}),Xh(Ul?"touchend":void 0,function(Le){var At=Le.changedTouches[0];Ft(At.clientX,At.clientY)},{passive:!1}),Xh("resize",Mw(function(){_e&&!he&&(L(DE(Y,ee,ct)),D())},{maxWait:8})),RI(function(){T&&E(Si({scale:it,rotate:ct},Ee))},[T]);var st=function(Le,At,Jt,rn,Jn,jn,vn,ue,me,Se){var Ge=function(se,te,ve,xe,Te){var Ae=I.useRef(!1),ht=fx({lead:!0,scale:ve}),Ve=ht[0],$e=Ve.lead,ft=Ve.scale,Mt=ht[1],qe=Mw(function(St){try{return Te(!0),Mt({lead:!1,scale:St}),Promise.resolve()}catch(at){return Promise.reject(at)}},{wait:xe});return RI(function(){Ae.current?(Te(!1),Mt({lead:!0}),qe(ve)):Ae.current=!0},[ve]),$e?[se*ft,te*ft,ve/ft]:[se*ve,te*ve,1]}(jn,vn,ue,me,Se),mt=Ge[0],bt=Ge[1],ot=Ge[2],gt=function(se,te,ve,xe,Te){var Ae=I.useState(wxe),ht=Ae[0],Ve=Ae[1],$e=I.useState(0),ft=$e[0],Mt=$e[1],qe=I.useRef(),St=id({OK:function(){return se&&Mt(4)}});function at(Oe){Te(!1),Mt(Oe)}return I.useEffect(function(){if(qe.current||(qe.current=Date.now()),ve){if(function(Oe,kt){var Pt=Oe&&Oe.current;if(Pt&&Pt.nodeType===1){var Ut=Pt.getBoundingClientRect();kt({T:Ut.top,L:Ut.left,W:Ut.width,H:Ut.height,FIT:Pt.tagName==="IMG"?getComputedStyle(Pt).objectFit:void 0})}}(te,Ve),se)return Date.now()-qe.current<250?(Mt(1),requestAnimationFrame(function(){Mt(2),requestAnimationFrame(function(){return at(3)})}),void setTimeout(St.OK,xe)):void Mt(4);at(5)}},[se,ve]),[ft,ht]}(Le,At,Jt,me,Se),Gt=gt[0],F=gt[1],W=F.W,ae=F.FIT,U=innerWidth/2,J=innerHeight/2,K=Gt<3||Gt>4;return[K?W?F.L:U:rn+(U-jn*ue/2),K?W?F.T:J:Jn+(J-vn*ue/2),mt,K&&ae?mt*(F.H/W):bt,Gt===0?ot:K?W/(jn*ue)||.01:ot,K?ae?1:0:1,Gt,ae]}(c,l,_e,ce,we,j,ne,it,u,function(Le){return L({pause:Le})}),fe=st[4],Pe=st[6],rt="transform "+u+"ms "+f,It={className:m,onMouseDown:Ul?void 0:function(Le){Le.stopPropagation(),Le.button===0&&en(Le.clientX,Le.clientY,0)},onTouchStart:Ul?function(Le){Le.stopPropagation(),en.apply(void 0,HO(Le))}:void 0,onWheel:function(Le){if(!V){var At=_w(it-Le.deltaY/100/2,Y/j);L({stopRaf:!0}),je(At,Le.clientX,Le.clientY)}},style:{width:st[2]+"px",height:st[3]+"px",opacity:st[5],objectFit:Pe===4?void 0:st[7],transform:ct?"rotate("+ct+"deg)":void 0,transition:Pe>2?rt+", opacity "+u+"ms ease, height "+(Pe<4?u/2:Pe>4?u:0)+"ms "+f:void 0}};return qt.createElement("div",{className:"PhotoView__PhotoWrap"+(h?" "+h:""),style:v,onMouseDown:!Ul&&T?pe:void 0,onTouchStart:Ul&&T?function(Le){return pe(Le.touches[0])}:void 0},qt.createElement("div",{className:"PhotoView__PhotoBox",style:{transform:"matrix("+fe+", 0, 0, "+fe+", "+st[0]+", "+st[1]+")",transition:he||re?void 0:rt,willChange:T?"transform":void 0}},n?qt.createElement(bxe,Si({src:n,loaded:_e,broken:ge},It,{onPhotoLoad:function(Le){L(Si({},Le,Le.loaded&&DE(Le.naturalWidth||0,Le.naturalHeight||0,ct)))},loadingElement:w,brokenElement:y})):r&&r({attrs:It,scale:fe,rotate:ct})))}var VO={x:0,touched:!1,pause:!1,lastCX:void 0,lastCY:void 0,bg:void 0,lastBg:void 0,overlay:!0,minimal:!0,scale:1,rotate:0};function Exe(t){var e=t.loop,n=e===void 0?3:e,r=t.speed,i=t.easing,s=t.photoClosable,o=t.maskClosable,a=o===void 0||o,l=t.maskOpacity,c=l===void 0?1:l,u=t.pullClosable,f=u===void 0||u,h=t.bannerVisible,m=h===void 0||h,v=t.overlayRender,w=t.toolbarRender,y=t.className,g=t.maskClassName,_=t.photoClassName,x=t.photoWrapClassName,S=t.loadingElement,D=t.brokenElement,T=t.images,E=t.index,R=E===void 0?0:E,C=t.onIndexChange,L=t.visible,P=t.onClose,z=t.afterClose,B=t.portalContainer,Y=fx(VO),ie=Y[0],ee=Y[1],le=I.useState(0),j=le[0],q=le[1],ne=ie.x,de=ie.touched,_e=ie.pause,ge=ie.lastCX,ce=ie.lastCY,we=ie.bg,he=we===void 0?c:we,Ie=ie.lastBg,et=ie.overlay,ct=ie.minimal,it=ie.scale,ut=ie.rotate,$=ie.onScale,Ce=ie.onRotate,Ne=t.hasOwnProperty("index"),ze=Ne?R:j,Ue=Ne?C:q,Et=I.useRef(ze),lt=T.length,yt=T[ze],re=typeof n=="boolean"?n:lt>n,V=function(fe,Pe){var rt=I.useReducer(function(Jt){return!Jt},!1)[1],It=I.useRef(0),Le=function(Jt,rn){var Jn=I.useRef(Jt);function jn(vn){Jn.current=vn}return I.useMemo(function(){(function(vn){fe?(vn(fe),It.current=1):It.current=2})(jn)},[Jt]),[Jn.current,jn]}(fe),At=Le[1];return[Le[0],It.current,function(){rt(),It.current===2&&(At(!1),Pe&&Pe()),It.current=0}]}(L,z),Ee=V[0],je=V[1],De=V[2];RI(function(){if(Ee)return ee({pause:!0,x:ze*-(innerWidth+20)}),void(Et.current=ze);ee(VO)},[Ee]);var He=id({close:function(fe){Ce&&Ce(0),ee({overlay:!0,lastBg:he}),P(fe)},changeIndex:function(fe,Pe){Pe===void 0&&(Pe=!1);var rt=re?Et.current+(fe-ze):fe,It=lt-1,Le=LI(rt,0,It),At=re?rt:Le,Jt=innerWidth+20;ee({touched:!1,lastCX:void 0,lastCY:void 0,x:-Jt*At,pause:Pe}),Et.current=At,Ue&&Ue(re?fe<0?It:fe>It?0:fe:Le)}}),pt=He.close,Qe=He.changeIndex;function Ye(fe){return fe?pt():ee({overlay:!et})}function Ke(){ee({x:-(innerWidth+20)*ze,lastCX:void 0,lastCY:void 0,pause:!0}),Et.current=ze}function nt(fe,Pe,rt,It){fe==="x"?function(Le){if(ge!==void 0){var At=Le-ge,Jt=At;!re&&(ze===0&&At>0||ze===lt-1&&At<0)&&(Jt=At/2),ee({touched:!0,lastCX:ge,x:-(innerWidth+20)*Et.current+Jt,pause:!1})}else ee({touched:!0,lastCX:Le,x:ne,pause:!1})}(Pe):fe==="y"&&function(Le,At){if(ce!==void 0){var Jt=c===null?null:LI(c,.01,c-Math.abs(Le-ce)/100/4);ee({touched:!0,lastCY:ce,bg:At===1?Jt:c,minimal:At===1})}else ee({touched:!0,lastCY:Le,bg:he,minimal:!0})}(rt,It)}function _t(fe,Pe){var rt=fe-(ge??fe),It=Pe-(ce??Pe),Le=!1;if(rt<-40)Qe(ze+1);else if(rt>40)Qe(ze-1);else{var At=-(innerWidth+20)*Et.current;Math.abs(It)>100&&ct&&f&&(Le=!0,pt()),ee({touched:!1,x:At,lastCX:void 0,lastCY:void 0,bg:c,overlay:!!Le||et})}}Xh("keydown",function(fe){if(L)switch(fe.key){case"ArrowLeft":Qe(ze-1,!0);break;case"ArrowRight":Qe(ze+1,!0);break;case"Escape":pt()}});var Qt=function(fe,Pe,rt){return I.useMemo(function(){var It=fe.length;return rt?fe.concat(fe).concat(fe).slice(It+Pe-1,It+Pe+2):fe.slice(Math.max(Pe-1,0),Math.min(Pe+2,It+1))},[fe,Pe,rt])}(T,ze,re);if(!Ee)return null;var We=et&&!je,Ze=L?he:Ie,Tt=$&&Ce&&{images:T,index:ze,visible:L,onClose:pt,onIndexChange:Qe,overlayVisible:We,overlay:yt&&yt.overlay,scale:it,rotate:ut,onScale:$,onRotate:Ce},Ft=r?r(je):400,en=i?i(je):"cubic-bezier(0.25, 0.8, 0.25, 1)",pe=r?r(3):600,st=i?i(3):"cubic-bezier(0.25, 0.8, 0.25, 1)";return qt.createElement(hxe,{className:"PhotoView-Portal"+(We?"":" PhotoView-Slider__clean")+(L?"":" PhotoView-Slider__willClose")+(y?" "+y:""),role:"dialog",onClick:function(fe){return fe.stopPropagation()},container:B},L&&qt.createElement(vxe,null),qt.createElement("div",{className:"PhotoView-Slider__Backdrop"+(g?" "+g:"")+(je===1?" PhotoView-Slider__fadeIn":je===2?" PhotoView-Slider__fadeOut":""),style:{background:Ze?"rgba(0, 0, 0, "+Ze+")":void 0,transitionTimingFunction:en,transitionDuration:(de?0:Ft)+"ms",animationDuration:Ft+"ms"},onAnimationEnd:De}),m&&qt.createElement("div",{className:"PhotoView-Slider__BannerWrap"},qt.createElement("div",{className:"PhotoView-Slider__Counter"},ze+1," / ",lt),qt.createElement("div",{className:"PhotoView-Slider__BannerRight"},w&&Tt&&w(Tt),qt.createElement(pxe,{className:"PhotoView-Slider__toolbarIcon",onClick:pt}))),Qt.map(function(fe,Pe){var rt=re||ze!==0?Et.current-1+Pe:ze+Pe;return qt.createElement(Cxe,{key:re?fe.key+"/"+fe.src+"/"+rt:fe.key,item:fe,speed:Ft,easing:en,visible:L,onReachMove:nt,onReachUp:_t,onPhotoTap:function(){return Ye(s)},onMaskTap:function(){return Ye(a)},wrapClassName:x,className:_,style:{left:(innerWidth+20)*rt+"px",transform:"translate3d("+ne+"px, 0px, 0)",transition:de||_e?void 0:"transform "+pe+"ms "+st},loadingElement:S,brokenElement:D,onPhotoResize:Ke,isActive:Et.current===rt,expose:ee})}),!Ul&&m&&qt.createElement(qt.Fragment,null,(re||ze!==0)&&qt.createElement("div",{className:"PhotoView-Slider__ArrowLeft",onClick:function(){return Qe(ze-1,!0)}},qt.createElement(mxe,null)),(re||ze+1-1){var g=c.slice();return g.splice(y,1,w),void a({images:g})}a(function(_){return{images:_.images.concat(w)}})},remove:function(w){a(function(y){var g=y.images.filter(function(_){return _.key!==w});return{images:g,index:Math.min(g.length-1,f)}})},show:function(w){var y=c.findIndex(function(g){return g.key===w});a({visible:!0,index:y}),r&&r(!0,y,o)}}),m=id({close:function(){a({visible:!1}),r&&r(!1,f,o)},changeIndex:function(w){a({index:w}),n&&n(w,o)}}),v=I.useMemo(function(){return Si({},o,h)},[o,h]);return qt.createElement(H7.Provider,{value:v},e,qt.createElement(Exe,Si({images:c,visible:u,index:f,onIndexChange:m.changeIndex,onClose:m.close},i)))}var Lxe=function(t){var e,n,r=t.src,i=t.render,s=t.overlay,o=t.width,a=t.height,l=t.triggers,c=l===void 0?["onClick"]:l,u=t.children,f=I.useContext(H7),h=(e=function(){return f.nextId()},(n=I.useRef({sign:!1,fn:void 0}).current).sign||(n.sign=!0,n.fn=e()),n.fn),m=I.useRef(null);I.useImperativeHandle(u==null?void 0:u.ref,function(){return m.current}),I.useEffect(function(){return function(){f.remove(h)}},[]);var v=id({render:function(y){return i&&i(y)},show:function(y,g){f.show(h),function(_,x){if(u){var S=u.props[_];S&&S(x)}}(y,g)}}),w=I.useMemo(function(){var y={};return c.forEach(function(g){y[g]=v.show.bind(null,g)}),y},[]);return I.useEffect(function(){f.update({key:h,src:r,originRef:m,render:v.render,overlay:s,width:o,height:a})},[r]),u?I.Children.only(I.cloneElement(u,Si({},w,{ref:m}))):null};V7.propTypes={data:Cn.object,showAvatar:Cn.bool};function V7({data:t,showAvatar:e=!0}){const{user:n}=Fa(),{user:r}=Ms();return O.jsxs(Rxe,{children:[e&&O.jsx(mc,{size:45,user:r.uid!=t.userUid?n:r,alt:"avatar",adaptiv:!0}),O.jsxs(Pxe,{blue:r.uid==t.userUid,noAvatar:!e,children:[O.jsxs(Dxe,{blue:r.uid==t.userUid,children:[t.imgs&&O.jsx(Ixe,{children:t.imgs.map(i=>O.jsx(Lxe,{src:i,children:O.jsx(Bxe,{src:i})},i))}),t.media&&t.media.map(i=>O.jsxs(Oxe,{children:[O.jsx(Uxe,{href:i,download:!0,children:O.jsx(NR,{})}),i.split("name")[i.split("name").length-2]]},i)),t.text&&O.jsx(kxe,{children:t.text})]}),t.text&&e&&O.jsxs(Nxe,{className:"vector",xmlns:"http://www.w3.org/2000/svg",width:"28",height:"15",viewBox:"0 0 28 15",fill:"none",children:[O.jsx("link",{xmlns:"",type:"text/css",rel:"stylesheet",id:"dark-mode-custom-link"}),O.jsx("link",{xmlns:"",type:"text/css",rel:"stylesheet",id:"dark-mode-general-link"}),O.jsx("style",{xmlns:"",lang:"en",type:"text/css",id:"dark-mode-custom-style"}),O.jsx("style",{xmlns:"",lang:"en",type:"text/css",id:"dark-mode-native-style"}),O.jsx("style",{xmlns:"",lang:"en",type:"text/css",id:"dark-mode-native-sheet"}),O.jsx("script",{xmlns:""}),O.jsx("path",{d:"M0.936997 12.2567L14 0.5L27.5 14L1.60596 14C0.689477 14 0.255779 12.8698 0.936997 12.2567Z",fill:"white",stroke:"white"}),O.jsx("script",{xmlns:""}),O.jsx("script",{xmlns:""})]}),O.jsx(Fxe,{className:"time",children:t.date.toDate().toLocaleTimeString().split(":").slice(0,2).join(":")})]})]})}const Rxe=Be(l2)`
+ display: flex;
+ align-items: flex-end;
+ width: 100%;
+ max-width: 60%;
+ ${_l("padding",4,4,16,4)}
+`,Pxe=Be.div`
+ /* padding: 9.5px 9px; */
+ & .vector path {
+ ${t=>t.blue&&"fill: #85a7fc; stroke: #85a7fc;"}
+ }
+ position: relative;
+ min-height: 40px;
+ display: flex;
+ align-items: flex-end;
+ color: #000;
+ ${En("margin-left",20,15,1)}
+ ${En("font-size",17,14,1)} /* ${t=>t.noAvatar&&En("margin-left",70,60,1)} */
+ ${t=>t.noAvatar&&"margin-left: 60px !important;"}
+
+ @media (any-hover: hover) {
+ &:hover {
+ & .time {
+ opacity: 1;
+ }
+ }
+ }
+`,Dxe=Be.div`
+ display: flex;
+ flex-direction: column;
+ border-radius: 14px;
+ overflow: hidden;
+ background: #fff;
+ ${t=>t.blue&&"background: #85a7fc;"}
+`,Nxe=Be.svg`
+ position: absolute;
+ left: 0;
+ bottom: 3px;
+ transform: translateX(-50%);
+`,kxe=Be.pre`
+ font-size: 16px;
+ padding: 7px 10px;
+ font-family: 'Roboto';
+`,Bxe=Be.img`
+ max-height: 30vh;
+ object-fit: cover;
+ cursor: grab;
+`,Oxe=Be.div`
+ display: flex;
+ align-items: center;
+ font-size: 20px;
+ column-gap: 10px;
+ padding: 7px 10px;
+
+ svg {
+ font-size: 30px;
+ cursor: pointer;
+ }
+`,Uxe=Be.a`
+ display: inline-block;
+`,Fxe=Be.span`
+ position: absolute;
+ color: #666;
+ right: 0%;
+ top: 50%;
+ transform: translateY(-50%) translateX(calc(100% + 10px));
+ font-size: 12px;
+ opacity: 0;
+ user-select: none;
+`;function jxe(){const{chat:t,messages:e,setMessages:n,chatScroll:r,setChatList:i,scrollDown:s,lastMessageDoc:o,setLastMessageDoc:a}=Fa(),l=I.useRef(),c=I.useRef(!1);return I.useEffect(()=>{l.current&&i(l.current)},[i]),I.useEffect(()=>{e.length&&l.current.scrollTop+l.current.offsetHeight==r&&s()},[r,s,e.length]),I.useEffect(()=>{const u=l.current;async function f(h){const m=h.target.scrollTop;if(o&&m<150&&!c.current){c.current=!0;const{data:v,last:w}=await tc(["chats",t.id,"messages"],{other:[nx("date","desc"),rx(30),yG(o)]},{last:!0,id:!0});n([...v.reverse(),...e]),a(w),c.current=!1}}return u.addEventListener("scroll",f),()=>{u.removeEventListener("scroll",f)}},[t,o,e,n,a]),O.jsx(O.Fragment,{children:O.jsx(zxe,{ref:l,className:"test",children:t&&(()=>{let u=!0;return e.map((f,h)=>(e[h+1]&&f.userUid==e[h+1].userUid?u=!1:u=!0,O.jsx(V7,{showAvatar:u,data:f},f.id)))})()})})}const zxe=Be(uv)`
+ display: flex;
+ flex-direction: column;
+ overflow: auto;
+ /* justify-content: flex-end; */
+ flex: 1 1 auto;
+ ${xb(5,Dn.$colorMain,"#111")}
+ ${_l("padding",19,15,15,5)}
+`;function WO(){const{user:t}=Fa();return O.jsx(Hxe,{children:t&&O.jsxs(O.Fragment,{children:[O.jsx(rye,{}),O.jsx(Gxe,{}),O.jsx(JMe,{})]})})}const Hxe=Be.div`
+ display: flex;
+ flex-direction: column;
+ flex: 1 1 auto;
+ overflow: hidden;
+ background: #161628;
+`,Gxe=Be(jxe)`
+ flex: 1 1 auto;
+ max-height: 100vh;
+ overflow: auto;
+`;function Vxe(){return O.jsx(Wxe,{children:"Choose who you would like to write to"})}const Wxe=Be.div`
+ flex: 1 1 auto;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ font-size: 25px;
+ color: ${Dn.$colorMain};
+
+ @media (max-width: 960px) {
+ display: none;
+ }
+`;/**
+ * @license
+ * Copyright 2010-2024 Three.js Authors
+ * SPDX-License-Identifier: MIT
+ */const Wd="167",$xe={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Jxe={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},W7=0,DI=1,$7=2,Yxe=3,J7=0,X2=1,Fg=2,Sa=3,ml=0,Os=1,Ko=2,ul=0,sd=1,NI=2,kI=3,BI=4,Y7=5,eu=100,Q7=101,X7=102,K7=103,Z7=104,q7=200,eW=201,tW=202,nW=203,dx=204,hx=205,rW=206,iW=207,sW=208,oW=209,aW=210,lW=211,cW=212,uW=213,fW=214,dW=0,hW=1,pW=2,D1=3,mW=4,gW=5,vW=6,yW=7,Nv=0,wW=1,_W=2,fl=0,MW=1,xW=2,bW=3,BR=4,SW=5,CW=6,EW=7,OI="attached",AW="detached",Eu=300,gl=301,Au=302,um=303,N1=304,zm=306,Tu=1e3,qr=1001,fm=1002,ei=1003,K2=1004,Qxe=1004,$f=1005,Xxe=1005,qn=1006,Rp=1007,Kxe=1007,ta=1008,UI=1008,qs=1009,Z2=1010,q2=1011,dm=1012,kv=1013,vl=1014,Dr=1015,Ai=1016,eS=1017,tS=1018,Ed=1020,OR=35902,UR=1021,FR=1022,ti=1023,jR=1024,zR=1025,od=1026,Ad=1027,Bv=1028,Ov=1029,HR=1030,nS=1031,Zxe=1032,rS=1033,jg=33776,zg=33777,Hg=33778,Gg=33779,px=35840,mx=35841,gx=35842,vx=35843,yx=36196,wx=37492,_x=37496,Mx=37808,xx=37809,bx=37810,Sx=37811,Cx=37812,Ex=37813,Ax=37814,Tx=37815,Ix=37816,Lx=37817,Rx=37818,Px=37819,Dx=37820,Nx=37821,Vg=36492,kx=36494,Bx=36495,GR=36283,Ox=36284,Ux=36285,Fx=36286,TW=2200,IW=2201,LW=2202,hm=2300,pm=2301,Z_=2302,Jf=2400,Yf=2401,k1=2402,iS=2500,VR=2501,RW=0,WR=1,jx=2,PW=3200,DW=3201,qxe=3202,ebe=3203,Wu=0,NW=1,Gl="",ho="srgb",aa="srgb-linear",sS="display-p3",Uv="display-p3-linear",B1="linear",gr="srgb",O1="rec709",U1="p3",tbe=0,Pf=7680,nbe=7681,rbe=7682,ibe=7683,sbe=34055,obe=34056,abe=5386,lbe=512,cbe=513,ube=514,fbe=515,dbe=516,hbe=517,pbe=518,FI=519,kW=512,BW=513,OW=514,$R=515,UW=516,FW=517,jW=518,zW=519,F1=35044,mbe=35048,gbe=35040,vbe=35045,ybe=35049,wbe=35041,_be=35046,Mbe=35050,xbe=35042,bbe="100",jI="300 es",tl=2e3,j1=2001;class gc{addEventListener(e,n){this._listeners===void 0&&(this._listeners={});const r=this._listeners;r[e]===void 0&&(r[e]=[]),r[e].indexOf(n)===-1&&r[e].push(n)}hasEventListener(e,n){if(this._listeners===void 0)return!1;const r=this._listeners;return r[e]!==void 0&&r[e].indexOf(n)!==-1}removeEventListener(e,n){if(this._listeners===void 0)return;const i=this._listeners[e];if(i!==void 0){const s=i.indexOf(n);s!==-1&&i.splice(s,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const r=this._listeners[e.type];if(r!==void 0){e.target=this;const i=r.slice(0);for(let s=0,o=i.length;s>8&255]+us[t>>16&255]+us[t>>24&255]+"-"+us[e&255]+us[e>>8&255]+"-"+us[e>>16&15|64]+us[e>>24&255]+"-"+us[n&63|128]+us[n>>8&255]+"-"+us[n>>16&255]+us[n>>24&255]+us[r&255]+us[r>>8&255]+us[r>>16&255]+us[r>>24&255]).toLowerCase()}function Vr(t,e,n){return Math.max(e,Math.min(n,t))}function JR(t,e){return(t%e+e)%e}function Sbe(t,e,n,r,i){return r+(t-e)*(i-r)/(n-e)}function Cbe(t,e,n){return t!==e?(n-t)/(e-t):0}function Wg(t,e,n){return(1-n)*t+n*e}function Ebe(t,e,n,r){return Wg(t,e,1-Math.exp(-n*r))}function Abe(t,e=1){return e-Math.abs(JR(t,e*2)-e)}function Tbe(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*(3-2*t))}function Ibe(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*t*(t*(t*6-15)+10))}function Lbe(t,e){return t+Math.floor(Math.random()*(e-t+1))}function Rbe(t,e){return t+Math.random()*(e-t)}function Pbe(t){return t*(.5-Math.random())}function Dbe(t){t!==void 0&&($O=t);let e=$O+=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 Nbe(t){return t*ad}function kbe(t){return t*mm}function Bbe(t){return(t&t-1)===0&&t!==0}function Obe(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function Ube(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function Fbe(t,e,n,r,i){const s=Math.cos,o=Math.sin,a=s(n/2),l=o(n/2),c=s((e+r)/2),u=o((e+r)/2),f=s((e-r)/2),h=o((e-r)/2),m=s((r-e)/2),v=o((r-e)/2);switch(i){case"XYX":t.set(a*u,l*f,l*h,a*c);break;case"YZY":t.set(l*h,a*u,l*f,a*c);break;case"ZXZ":t.set(l*f,l*h,a*u,a*c);break;case"XZX":t.set(a*u,l*v,l*m,a*c);break;case"YXY":t.set(l*m,a*u,l*v,a*c);break;case"ZYZ":t.set(l*v,l*m,a*u,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function Ps(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function _n(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(t*4294967295);case Uint16Array:return Math.round(t*65535);case Uint8Array:return Math.round(t*255);case Int32Array:return Math.round(t*2147483647);case Int16Array:return Math.round(t*32767);case Int8Array:return Math.round(t*127);default:throw new Error("Invalid component type.")}}const Pp={DEG2RAD:ad,RAD2DEG:mm,generateUUID:Eo,clamp:Vr,euclideanModulo:JR,mapLinear:Sbe,inverseLerp:Cbe,lerp:Wg,damp:Ebe,pingpong:Abe,smoothstep:Tbe,smootherstep:Ibe,randInt:Lbe,randFloat:Rbe,randFloatSpread:Pbe,seededRandom:Dbe,degToRad:Nbe,radToDeg:kbe,isPowerOfTwo:Bbe,ceilPowerOfTwo:Obe,floorPowerOfTwo:Ube,setQuaternionFromProperEuler:Fbe,normalize:_n,denormalize:Ps};class tt{constructor(e=0,n=0){tt.prototype.isVector2=!0,this.x=e,this.y=n}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,n){return this.x=e,this.y=n,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,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;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,n){return this.x=e.x+n.x,this.y=e.y+n.y,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,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,n){return this.x=e.x-n.x,this.y=e.y-n.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 n=this.x,r=this.y,i=e.elements;return this.x=i[0]*n+i[3]*r+i[6],this.y=i[1]*n+i[4]*r+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(n,r)))}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 n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const r=this.dot(e)/n;return Math.acos(Vr(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,r=this.y-e.y;return n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this}rotateAround(e,n){const r=Math.cos(n),i=Math.sin(n),s=this.x-e.x,o=this.y-e.y;return this.x=s*r-o*i+e.x,this.y=s*i+o*r+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class wn{constructor(e,n,r,i,s,o,a,l,c){wn.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,n,r,i,s,o,a,l,c)}set(e,n,r,i,s,o,a,l,c){const u=this.elements;return u[0]=e,u[1]=i,u[2]=a,u[3]=n,u[4]=s,u[5]=l,u[6]=r,u[7]=o,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const n=this.elements,r=e.elements;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],this}extractBasis(e,n,r){return e.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),r.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const n=e.elements;return this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const r=e.elements,i=n.elements,s=this.elements,o=r[0],a=r[3],l=r[6],c=r[1],u=r[4],f=r[7],h=r[2],m=r[5],v=r[8],w=i[0],y=i[3],g=i[6],_=i[1],x=i[4],S=i[7],D=i[2],T=i[5],E=i[8];return s[0]=o*w+a*_+l*D,s[3]=o*y+a*x+l*T,s[6]=o*g+a*S+l*E,s[1]=c*w+u*_+f*D,s[4]=c*y+u*x+f*T,s[7]=c*g+u*S+f*E,s[2]=h*w+m*_+v*D,s[5]=h*y+m*x+v*T,s[8]=h*g+m*S+v*E,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=e,n[4]*=e,n[7]*=e,n[2]*=e,n[5]*=e,n[8]*=e,this}determinant(){const e=this.elements,n=e[0],r=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return n*o*u-n*a*c-r*s*u+r*a*l+i*s*c-i*o*l}invert(){const e=this.elements,n=e[0],r=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],f=u*o-a*c,h=a*l-u*s,m=c*s-o*l,v=n*f+r*h+i*m;if(v===0)return this.set(0,0,0,0,0,0,0,0,0);const w=1/v;return e[0]=f*w,e[1]=(i*c-u*r)*w,e[2]=(a*r-i*o)*w,e[3]=h*w,e[4]=(u*n-i*l)*w,e[5]=(i*s-a*n)*w,e[6]=m*w,e[7]=(r*l-c*n)*w,e[8]=(o*n-r*s)*w,this}transpose(){let e;const n=this.elements;return e=n[1],n[1]=n[3],n[3]=e,e=n[2],n[2]=n[6],n[6]=e,e=n[5],n[5]=n[7],n[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const n=this.elements;return e[0]=n[0],e[1]=n[3],e[2]=n[6],e[3]=n[1],e[4]=n[4],e[5]=n[7],e[6]=n[2],e[7]=n[5],e[8]=n[8],this}setUvTransform(e,n,r,i,s,o,a){const l=Math.cos(s),c=Math.sin(s);return this.set(r*l,r*c,-r*(l*o+c*a)+o+e,-i*c,i*l,-i*(-c*o+l*a)+a+n,0,0,1),this}scale(e,n){return this.premultiply(NE.makeScale(e,n)),this}rotate(e){return this.premultiply(NE.makeRotation(-e)),this}translate(e,n){return this.premultiply(NE.makeTranslation(e,n)),this}makeTranslation(e,n){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,n,0,0,1),this}makeRotation(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,-r,0,r,n,0,0,0,1),this}makeScale(e,n){return this.set(e,0,0,0,n,0,0,0,1),this}equals(e){const n=this.elements,r=e.elements;for(let i=0;i<9;i++)if(n[i]!==r[i])return!1;return!0}fromArray(e,n=0){for(let r=0;r<9;r++)this.elements[r]=e[r+n];return this}toArray(e=[],n=0){const r=this.elements;return e[n]=r[0],e[n+1]=r[1],e[n+2]=r[2],e[n+3]=r[3],e[n+4]=r[4],e[n+5]=r[5],e[n+6]=r[6],e[n+7]=r[7],e[n+8]=r[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const NE=new wn;function HW(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}const jbe={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function dp(t,e){return new jbe[t](e)}function z1(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function GW(){const t=z1("canvas");return t.style.display="block",t}const JO={};function Dp(t){t in JO||(JO[t]=!0,console.warn(t))}function zbe(t,e,n){return new Promise(function(r,i){function s(){switch(t.clientWaitSync(e,t.SYNC_FLUSH_COMMANDS_BIT,0)){case t.WAIT_FAILED:i();break;case t.TIMEOUT_EXPIRED:setTimeout(s,n);break;default:r()}}setTimeout(s,n)})}const YO=new wn().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),QO=new wn().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),O0={[aa]:{transfer:B1,primaries:O1,luminanceCoefficients:[.2126,.7152,.0722],toReference:t=>t,fromReference:t=>t},[ho]:{transfer:gr,primaries:O1,luminanceCoefficients:[.2126,.7152,.0722],toReference:t=>t.convertSRGBToLinear(),fromReference:t=>t.convertLinearToSRGB()},[Uv]:{transfer:B1,primaries:U1,luminanceCoefficients:[.2289,.6917,.0793],toReference:t=>t.applyMatrix3(QO),fromReference:t=>t.applyMatrix3(YO)},[sS]:{transfer:gr,primaries:U1,luminanceCoefficients:[.2289,.6917,.0793],toReference:t=>t.convertSRGBToLinear().applyMatrix3(QO),fromReference:t=>t.applyMatrix3(YO).convertLinearToSRGB()}},Hbe=new Set([aa,Uv]),Zn={enabled:!0,_workingColorSpace:aa,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(t){if(!Hbe.has(t))throw new Error(`Unsupported working color space, "${t}".`);this._workingColorSpace=t},convert:function(t,e,n){if(this.enabled===!1||e===n||!e||!n)return t;const r=O0[e].toReference,i=O0[n].fromReference;return i(r(t))},fromWorkingColorSpace:function(t,e){return this.convert(t,this._workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this._workingColorSpace)},getPrimaries:function(t){return O0[t].primaries},getTransfer:function(t){return t===Gl?B1:O0[t].transfer},getLuminanceCoefficients:function(t,e=this._workingColorSpace){return t.fromArray(O0[e].luminanceCoefficients)}};function Np(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function kE(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}let xh;class VW{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{xh===void 0&&(xh=z1("canvas")),xh.width=e.width,xh.height=e.height;const r=xh.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),n=xh}return n.width>2048||n.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),n.toDataURL("image/jpeg",.6)):n.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 n=z1("canvas");n.width=e.width,n.height=e.height;const r=n.getContext("2d");r.drawImage(e,0,0,e.width,e.height);const i=r.getImageData(0,0,e.width,e.height),s=i.data;for(let o=0;o0&&(r.userData=this.userData),n||(e.textures[this.uuid]=r),r}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Eu)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Tu:e.x=e.x-Math.floor(e.x);break;case qr:e.x=e.x<0?0:1;break;case fm: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 Tu:e.y=e.y-Math.floor(e.y);break;case qr:e.y=e.y<0?0:1;break;case fm: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++}}er.DEFAULT_IMAGE=null;er.DEFAULT_MAPPING=Eu;er.DEFAULT_ANISOTROPY=1;class or{constructor(e=0,n=0,r=0,i=1){or.prototype.isVector4=!0,this.x=e,this.y=n,this.z=r,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,n,r,i){return this.x=e,this.y=n,this.z=r,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;case 3:this.w=n;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,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this.w=e.w+n.w,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this.w+=e.w*n,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,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this.w=e.w-n.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 n=this.x,r=this.y,i=this.z,s=this.w,o=e.elements;return this.x=o[0]*n+o[4]*r+o[8]*i+o[12]*s,this.y=o[1]*n+o[5]*r+o[9]*i+o[13]*s,this.z=o[2]*n+o[6]*r+o[10]*i+o[14]*s,this.w=o[3]*n+o[7]*r+o[11]*i+o[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const n=Math.sqrt(1-e.w*e.w);return n<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/n,this.y=e.y/n,this.z=e.z/n),this}setAxisAngleFromRotationMatrix(e){let n,r,i,s;const l=e.elements,c=l[0],u=l[4],f=l[8],h=l[1],m=l[5],v=l[9],w=l[2],y=l[6],g=l[10];if(Math.abs(u-h)<.01&&Math.abs(f-w)<.01&&Math.abs(v-y)<.01){if(Math.abs(u+h)<.1&&Math.abs(f+w)<.1&&Math.abs(v+y)<.1&&Math.abs(c+m+g-3)<.1)return this.set(1,0,0,0),this;n=Math.PI;const x=(c+1)/2,S=(m+1)/2,D=(g+1)/2,T=(u+h)/4,E=(f+w)/4,R=(v+y)/4;return x>S&&x>D?x<.01?(r=0,i=.707106781,s=.707106781):(r=Math.sqrt(x),i=T/r,s=E/r):S>D?S<.01?(r=.707106781,i=0,s=.707106781):(i=Math.sqrt(S),r=T/i,s=R/i):D<.01?(r=.707106781,i=.707106781,s=0):(s=Math.sqrt(D),r=E/s,i=R/s),this.set(r,i,s,n),this}let _=Math.sqrt((y-v)*(y-v)+(f-w)*(f-w)+(h-u)*(h-u));return Math.abs(_)<.001&&(_=1),this.x=(y-v)/_,this.y=(f-w)/_,this.z=(h-u)/_,this.w=Math.acos((c+m+g-1)/2),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this.w=n[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,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this.z=Math.max(e.z,Math.min(n.z,this.z)),this.w=Math.max(e.w,Math.min(n.w,this.w)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this.z=Math.max(e,Math.min(n,this.z)),this.w=Math.max(e,Math.min(n,this.w)),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(n,r)))}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,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this.w+=(e.w-this.w)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this.z=e.z+(n.z-e.z)*r,this.w=e.w+(n.w-e.w)*r,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this.w=e[n+3],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e[n+3]=this.w,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this.w=e.getW(n),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 WW extends gc{constructor(e=1,n=1,r={}){super(),this.isRenderTarget=!0,this.width=e,this.height=n,this.depth=1,this.scissor=new or(0,0,e,n),this.scissorTest=!1,this.viewport=new or(0,0,e,n);const i={width:e,height:n,depth:1};r=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:qn,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},r);const s=new er(i,r.mapping,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy,r.colorSpace);s.flipY=!1,s.generateMipmaps=r.generateMipmaps,s.internalFormat=r.internalFormat,this.textures=[];const o=r.count;for(let a=0;a=0?1:-1,x=1-g*g;if(x>Number.EPSILON){const D=Math.sqrt(x),T=Math.atan2(D,g*_);y=Math.sin(y*T)/D,a=Math.sin(a*T)/D}const S=a*_;if(l=l*y+h*S,c=c*y+m*S,u=u*y+v*S,f=f*y+w*S,y===1-a){const D=1/Math.sqrt(l*l+c*c+u*u+f*f);l*=D,c*=D,u*=D,f*=D}}e[n]=l,e[n+1]=c,e[n+2]=u,e[n+3]=f}static multiplyQuaternionsFlat(e,n,r,i,s,o){const a=r[i],l=r[i+1],c=r[i+2],u=r[i+3],f=s[o],h=s[o+1],m=s[o+2],v=s[o+3];return e[n]=a*v+u*f+l*m-c*h,e[n+1]=l*v+u*h+c*f-a*m,e[n+2]=c*v+u*m+a*h-l*f,e[n+3]=u*v-a*f-l*h-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,n,r,i){return this._x=e,this._y=n,this._z=r,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,n=!0){const r=e._x,i=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(r/2),u=a(i/2),f=a(s/2),h=l(r/2),m=l(i/2),v=l(s/2);switch(o){case"XYZ":this._x=h*u*f+c*m*v,this._y=c*m*f-h*u*v,this._z=c*u*v+h*m*f,this._w=c*u*f-h*m*v;break;case"YXZ":this._x=h*u*f+c*m*v,this._y=c*m*f-h*u*v,this._z=c*u*v-h*m*f,this._w=c*u*f+h*m*v;break;case"ZXY":this._x=h*u*f-c*m*v,this._y=c*m*f+h*u*v,this._z=c*u*v+h*m*f,this._w=c*u*f-h*m*v;break;case"ZYX":this._x=h*u*f-c*m*v,this._y=c*m*f+h*u*v,this._z=c*u*v-h*m*f,this._w=c*u*f+h*m*v;break;case"YZX":this._x=h*u*f+c*m*v,this._y=c*m*f+h*u*v,this._z=c*u*v-h*m*f,this._w=c*u*f-h*m*v;break;case"XZY":this._x=h*u*f-c*m*v,this._y=c*m*f-h*u*v,this._z=c*u*v+h*m*f,this._w=c*u*f+h*m*v;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return n===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,n){const r=n/2,i=Math.sin(r);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(r),this._onChangeCallback(),this}setFromRotationMatrix(e){const n=e.elements,r=n[0],i=n[4],s=n[8],o=n[1],a=n[5],l=n[9],c=n[2],u=n[6],f=n[10],h=r+a+f;if(h>0){const m=.5/Math.sqrt(h+1);this._w=.25/m,this._x=(u-l)*m,this._y=(s-c)*m,this._z=(o-i)*m}else if(r>a&&r>f){const m=2*Math.sqrt(1+r-a-f);this._w=(u-l)/m,this._x=.25*m,this._y=(i+o)/m,this._z=(s+c)/m}else if(a>f){const m=2*Math.sqrt(1+a-r-f);this._w=(s-c)/m,this._x=(i+o)/m,this._y=.25*m,this._z=(l+u)/m}else{const m=2*Math.sqrt(1+f-r-a);this._w=(o-i)/m,this._x=(s+c)/m,this._y=(l+u)/m,this._z=.25*m}return this._onChangeCallback(),this}setFromUnitVectors(e,n){let r=e.dot(n)+1;return rMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=r):(this._x=0,this._y=-e.z,this._z=e.y,this._w=r)):(this._x=e.y*n.z-e.z*n.y,this._y=e.z*n.x-e.x*n.z,this._z=e.x*n.y-e.y*n.x,this._w=r),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Vr(this.dot(e),-1,1)))}rotateTowards(e,n){const r=this.angleTo(e);if(r===0)return this;const i=Math.min(1,n/r);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,n){const r=e._x,i=e._y,s=e._z,o=e._w,a=n._x,l=n._y,c=n._z,u=n._w;return this._x=r*u+o*a+i*c-s*l,this._y=i*u+o*l+s*a-r*c,this._z=s*u+o*c+r*l-i*a,this._w=o*u-r*a-i*l-s*c,this._onChangeCallback(),this}slerp(e,n){if(n===0)return this;if(n===1)return this.copy(e);const r=this._x,i=this._y,s=this._z,o=this._w;let a=o*e._w+r*e._x+i*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=r,this._y=i,this._z=s,this;const l=1-a*a;if(l<=Number.EPSILON){const m=1-n;return this._w=m*o+n*this._w,this._x=m*r+n*this._x,this._y=m*i+n*this._y,this._z=m*s+n*this._z,this.normalize(),this}const c=Math.sqrt(l),u=Math.atan2(c,a),f=Math.sin((1-n)*u)/c,h=Math.sin(n*u)/c;return this._w=o*f+this._w*h,this._x=r*f+this._x*h,this._y=i*f+this._y*h,this._z=s*f+this._z*h,this._onChangeCallback(),this}slerpQuaternions(e,n,r){return this.copy(e).slerp(n,r)}random(){const e=2*Math.PI*Math.random(),n=2*Math.PI*Math.random(),r=Math.random(),i=Math.sqrt(1-r),s=Math.sqrt(r);return this.set(i*Math.sin(e),i*Math.cos(e),s*Math.sin(n),s*Math.cos(n))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,n=0){return this._x=e[n],this._y=e[n+1],this._z=e[n+2],this._w=e[n+3],this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._w,e}fromBufferAttribute(e,n){return this._x=e.getX(n),this._y=e.getY(n),this._z=e.getZ(n),this._w=e.getW(n),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Z{constructor(e=0,n=0,r=0){Z.prototype.isVector3=!0,this.x=e,this.y=n,this.z=r}set(e,n,r){return r===void 0&&(r=this.z),this.x=e,this.y=n,this.z=r,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,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;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,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,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,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.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,n){return this.x=e.x*n.x,this.y=e.y*n.y,this.z=e.z*n.z,this}applyEuler(e){return this.applyQuaternion(XO.setFromEuler(e))}applyAxisAngle(e,n){return this.applyQuaternion(XO.setFromAxisAngle(e,n))}applyMatrix3(e){const n=this.x,r=this.y,i=this.z,s=e.elements;return this.x=s[0]*n+s[3]*r+s[6]*i,this.y=s[1]*n+s[4]*r+s[7]*i,this.z=s[2]*n+s[5]*r+s[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const n=this.x,r=this.y,i=this.z,s=e.elements,o=1/(s[3]*n+s[7]*r+s[11]*i+s[15]);return this.x=(s[0]*n+s[4]*r+s[8]*i+s[12])*o,this.y=(s[1]*n+s[5]*r+s[9]*i+s[13])*o,this.z=(s[2]*n+s[6]*r+s[10]*i+s[14])*o,this}applyQuaternion(e){const n=this.x,r=this.y,i=this.z,s=e.x,o=e.y,a=e.z,l=e.w,c=2*(o*i-a*r),u=2*(a*n-s*i),f=2*(s*r-o*n);return this.x=n+l*c+o*f-a*u,this.y=r+l*u+a*c-s*f,this.z=i+l*f+s*u-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 n=this.x,r=this.y,i=this.z,s=e.elements;return this.x=s[0]*n+s[4]*r+s[8]*i,this.y=s[1]*n+s[5]*r+s[9]*i,this.z=s[2]*n+s[6]*r+s[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this.z=Math.max(e.z,Math.min(n.z,this.z)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this.z=Math.max(e,Math.min(n,this.z)),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(n,r)))}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,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this.z=e.z+(n.z-e.z)*r,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,n){const r=e.x,i=e.y,s=e.z,o=n.x,a=n.y,l=n.z;return this.x=i*l-s*a,this.y=s*o-r*l,this.z=r*a-i*o,this}projectOnVector(e){const n=e.lengthSq();if(n===0)return this.set(0,0,0);const r=e.dot(this)/n;return this.copy(e).multiplyScalar(r)}projectOnPlane(e){return OE.copy(this).projectOnVector(e),this.sub(OE)}reflect(e){return this.sub(OE.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const r=this.dot(e)/n;return Math.acos(Vr(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,r=this.y-e.y,i=this.z-e.z;return n*n+r*r+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,n,r){const i=Math.sin(n)*e;return this.x=i*Math.sin(r),this.y=Math.cos(n)*e,this.z=i*Math.cos(r),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,n,r){return this.x=e*Math.sin(n),this.y=r,this.z=e*Math.cos(n),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setFromMatrixScale(e){const n=this.setFromMatrixColumn(e,0).length(),r=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=n,this.y=r,this.z=i,this}setFromMatrixColumn(e,n){return this.fromArray(e.elements,n*4)}setFromMatrix3Column(e,n){return this.fromArray(e.elements,n*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,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,n=Math.random()*2-1,r=Math.sqrt(1-n*n);return this.x=r*Math.cos(e),this.y=n,this.z=r*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const OE=new Z,XO=new Ti;class Ui{constructor(e=new Z(1/0,1/0,1/0),n=new Z(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=n}set(e,n){return this.min.copy(e),this.max.copy(n),this}setFromArray(e){this.makeEmpty();for(let n=0,r=e.length;n=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,n){return n.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,wa),wa.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let n,r;return e.normal.x>0?(n=e.normal.x*this.min.x,r=e.normal.x*this.max.x):(n=e.normal.x*this.max.x,r=e.normal.x*this.min.x),e.normal.y>0?(n+=e.normal.y*this.min.y,r+=e.normal.y*this.max.y):(n+=e.normal.y*this.max.y,r+=e.normal.y*this.min.y),e.normal.z>0?(n+=e.normal.z*this.min.z,r+=e.normal.z*this.max.z):(n+=e.normal.z*this.max.z,r+=e.normal.z*this.min.z),n<=-e.constant&&r>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(U0),bw.subVectors(this.max,U0),bh.subVectors(e.a,U0),Sh.subVectors(e.b,U0),Ch.subVectors(e.c,U0),Lc.subVectors(Sh,bh),Rc.subVectors(Ch,Sh),pf.subVectors(bh,Ch);let n=[0,-Lc.z,Lc.y,0,-Rc.z,Rc.y,0,-pf.z,pf.y,Lc.z,0,-Lc.x,Rc.z,0,-Rc.x,pf.z,0,-pf.x,-Lc.y,Lc.x,0,-Rc.y,Rc.x,0,-pf.y,pf.x,0];return!UE(n,bh,Sh,Ch,bw)||(n=[1,0,0,0,1,0,0,0,1],!UE(n,bh,Sh,Ch,bw))?!1:(Sw.crossVectors(Lc,Rc),n=[Sw.x,Sw.y,Sw.z],UE(n,bh,Sh,Ch,bw))}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,wa).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(wa).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:(Pl[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Pl[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Pl[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Pl[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Pl[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Pl[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Pl[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Pl[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Pl),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 Pl=[new Z,new Z,new Z,new Z,new Z,new Z,new Z,new Z],wa=new Z,xw=new Ui,bh=new Z,Sh=new Z,Ch=new Z,Lc=new Z,Rc=new Z,pf=new Z,U0=new Z,bw=new Z,Sw=new Z,mf=new Z;function UE(t,e,n,r,i){for(let s=0,o=t.length-3;s<=o;s+=3){mf.fromArray(t,s);const a=i.x*Math.abs(mf.x)+i.y*Math.abs(mf.y)+i.z*Math.abs(mf.z),l=e.dot(mf),c=n.dot(mf),u=r.dot(mf);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}const Jbe=new Ui,F0=new Z,FE=new Z;class Fi{constructor(e=new Z,n=-1){this.isSphere=!0,this.center=e,this.radius=n}set(e,n){return this.center.copy(e),this.radius=n,this}setFromPoints(e,n){const r=this.center;n!==void 0?r.copy(n):Jbe.setFromPoints(e).getCenter(r);let i=0;for(let s=0,o=e.length;sthis.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n}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;F0.subVectors(e,this.center);const n=F0.lengthSq();if(n>this.radius*this.radius){const r=Math.sqrt(n),i=(r-this.radius)*.5;this.center.addScaledVector(F0,i/r),this.radius+=i}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(FE.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(F0.copy(e.center).add(FE)),this.expandByPoint(F0.copy(e.center).sub(FE))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Dl=new Z,jE=new Z,Cw=new Z,Pc=new Z,zE=new Z,Ew=new Z,HE=new Z;class Hm{constructor(e=new Z,n=new Z(0,0,-1)){this.origin=e,this.direction=n}set(e,n){return this.origin.copy(e),this.direction.copy(n),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,n){return n.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,Dl)),this}closestPointToPoint(e,n){n.subVectors(e,this.origin);const r=n.dot(this.direction);return r<0?n.copy(this.origin):n.copy(this.origin).addScaledVector(this.direction,r)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const n=Dl.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(Dl.copy(this.origin).addScaledVector(this.direction,n),Dl.distanceToSquared(e))}distanceSqToSegment(e,n,r,i){jE.copy(e).add(n).multiplyScalar(.5),Cw.copy(n).sub(e).normalize(),Pc.copy(this.origin).sub(jE);const s=e.distanceTo(n)*.5,o=-this.direction.dot(Cw),a=Pc.dot(this.direction),l=-Pc.dot(Cw),c=Pc.lengthSq(),u=Math.abs(1-o*o);let f,h,m,v;if(u>0)if(f=o*l-a,h=o*a-l,v=s*u,f>=0)if(h>=-v)if(h<=v){const w=1/u;f*=w,h*=w,m=f*(f+o*h+2*a)+h*(o*f+h+2*l)+c}else h=s,f=Math.max(0,-(o*h+a)),m=-f*f+h*(h+2*l)+c;else h=-s,f=Math.max(0,-(o*h+a)),m=-f*f+h*(h+2*l)+c;else h<=-v?(f=Math.max(0,-(-o*s+a)),h=f>0?-s:Math.min(Math.max(-s,-l),s),m=-f*f+h*(h+2*l)+c):h<=v?(f=0,h=Math.min(Math.max(-s,-l),s),m=h*(h+2*l)+c):(f=Math.max(0,-(o*s+a)),h=f>0?s:Math.min(Math.max(-s,-l),s),m=-f*f+h*(h+2*l)+c);else h=o>0?-s:s,f=Math.max(0,-(o*h+a)),m=-f*f+h*(h+2*l)+c;return r&&r.copy(this.origin).addScaledVector(this.direction,f),i&&i.copy(jE).addScaledVector(Cw,h),m}intersectSphere(e,n){Dl.subVectors(e.center,this.origin);const r=Dl.dot(this.direction),i=Dl.dot(Dl)-r*r,s=e.radius*e.radius;if(i>s)return null;const o=Math.sqrt(s-i),a=r-o,l=r+o;return l<0?null:a<0?this.at(l,n):this.at(a,n)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const n=e.normal.dot(this.direction);if(n===0)return e.distanceToPoint(this.origin)===0?0:null;const r=-(this.origin.dot(e.normal)+e.constant)/n;return r>=0?r:null}intersectPlane(e,n){const r=this.distanceToPlane(e);return r===null?null:this.at(r,n)}intersectsPlane(e){const n=e.distanceToPoint(this.origin);return n===0||e.normal.dot(this.direction)*n<0}intersectBox(e,n){let r,i,s,o,a,l;const c=1/this.direction.x,u=1/this.direction.y,f=1/this.direction.z,h=this.origin;return c>=0?(r=(e.min.x-h.x)*c,i=(e.max.x-h.x)*c):(r=(e.max.x-h.x)*c,i=(e.min.x-h.x)*c),u>=0?(s=(e.min.y-h.y)*u,o=(e.max.y-h.y)*u):(s=(e.max.y-h.y)*u,o=(e.min.y-h.y)*u),r>o||s>i||((s>r||isNaN(r))&&(r=s),(o=0?(a=(e.min.z-h.z)*f,l=(e.max.z-h.z)*f):(a=(e.max.z-h.z)*f,l=(e.min.z-h.z)*f),r>l||a>i)||((a>r||r!==r)&&(r=a),(l=0?r:i,n)}intersectsBox(e){return this.intersectBox(e,Dl)!==null}intersectTriangle(e,n,r,i,s){zE.subVectors(n,e),Ew.subVectors(r,e),HE.crossVectors(zE,Ew);let o=this.direction.dot(HE),a;if(o>0){if(i)return null;a=1}else if(o<0)a=-1,o=-o;else return null;Pc.subVectors(this.origin,e);const l=a*this.direction.dot(Ew.crossVectors(Pc,Ew));if(l<0)return null;const c=a*this.direction.dot(zE.cross(Pc));if(c<0||l+c>o)return null;const u=-a*Pc.dot(HE);return u<0?null:this.at(u/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 Kt{constructor(e,n,r,i,s,o,a,l,c,u,f,h,m,v,w,y){Kt.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,n,r,i,s,o,a,l,c,u,f,h,m,v,w,y)}set(e,n,r,i,s,o,a,l,c,u,f,h,m,v,w,y){const g=this.elements;return g[0]=e,g[4]=n,g[8]=r,g[12]=i,g[1]=s,g[5]=o,g[9]=a,g[13]=l,g[2]=c,g[6]=u,g[10]=f,g[14]=h,g[3]=m,g[7]=v,g[11]=w,g[15]=y,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 Kt().fromArray(this.elements)}copy(e){const n=this.elements,r=e.elements;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],n[9]=r[9],n[10]=r[10],n[11]=r[11],n[12]=r[12],n[13]=r[13],n[14]=r[14],n[15]=r[15],this}copyPosition(e){const n=this.elements,r=e.elements;return n[12]=r[12],n[13]=r[13],n[14]=r[14],this}setFromMatrix3(e){const n=e.elements;return this.set(n[0],n[3],n[6],0,n[1],n[4],n[7],0,n[2],n[5],n[8],0,0,0,0,1),this}extractBasis(e,n,r){return e.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this}makeBasis(e,n,r){return this.set(e.x,n.x,r.x,0,e.y,n.y,r.y,0,e.z,n.z,r.z,0,0,0,0,1),this}extractRotation(e){const n=this.elements,r=e.elements,i=1/Eh.setFromMatrixColumn(e,0).length(),s=1/Eh.setFromMatrixColumn(e,1).length(),o=1/Eh.setFromMatrixColumn(e,2).length();return n[0]=r[0]*i,n[1]=r[1]*i,n[2]=r[2]*i,n[3]=0,n[4]=r[4]*s,n[5]=r[5]*s,n[6]=r[6]*s,n[7]=0,n[8]=r[8]*o,n[9]=r[9]*o,n[10]=r[10]*o,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromEuler(e){const n=this.elements,r=e.x,i=e.y,s=e.z,o=Math.cos(r),a=Math.sin(r),l=Math.cos(i),c=Math.sin(i),u=Math.cos(s),f=Math.sin(s);if(e.order==="XYZ"){const h=o*u,m=o*f,v=a*u,w=a*f;n[0]=l*u,n[4]=-l*f,n[8]=c,n[1]=m+v*c,n[5]=h-w*c,n[9]=-a*l,n[2]=w-h*c,n[6]=v+m*c,n[10]=o*l}else if(e.order==="YXZ"){const h=l*u,m=l*f,v=c*u,w=c*f;n[0]=h+w*a,n[4]=v*a-m,n[8]=o*c,n[1]=o*f,n[5]=o*u,n[9]=-a,n[2]=m*a-v,n[6]=w+h*a,n[10]=o*l}else if(e.order==="ZXY"){const h=l*u,m=l*f,v=c*u,w=c*f;n[0]=h-w*a,n[4]=-o*f,n[8]=v+m*a,n[1]=m+v*a,n[5]=o*u,n[9]=w-h*a,n[2]=-o*c,n[6]=a,n[10]=o*l}else if(e.order==="ZYX"){const h=o*u,m=o*f,v=a*u,w=a*f;n[0]=l*u,n[4]=v*c-m,n[8]=h*c+w,n[1]=l*f,n[5]=w*c+h,n[9]=m*c-v,n[2]=-c,n[6]=a*l,n[10]=o*l}else if(e.order==="YZX"){const h=o*l,m=o*c,v=a*l,w=a*c;n[0]=l*u,n[4]=w-h*f,n[8]=v*f+m,n[1]=f,n[5]=o*u,n[9]=-a*u,n[2]=-c*u,n[6]=m*f+v,n[10]=h-w*f}else if(e.order==="XZY"){const h=o*l,m=o*c,v=a*l,w=a*c;n[0]=l*u,n[4]=-f,n[8]=c*u,n[1]=h*f+w,n[5]=o*u,n[9]=m*f-v,n[2]=v*f-m,n[6]=a*u,n[10]=w*f+h}return n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromQuaternion(e){return this.compose(Ybe,e,Qbe)}lookAt(e,n,r){const i=this.elements;return lo.subVectors(e,n),lo.lengthSq()===0&&(lo.z=1),lo.normalize(),Dc.crossVectors(r,lo),Dc.lengthSq()===0&&(Math.abs(r.z)===1?lo.x+=1e-4:lo.z+=1e-4,lo.normalize(),Dc.crossVectors(r,lo)),Dc.normalize(),Aw.crossVectors(lo,Dc),i[0]=Dc.x,i[4]=Aw.x,i[8]=lo.x,i[1]=Dc.y,i[5]=Aw.y,i[9]=lo.y,i[2]=Dc.z,i[6]=Aw.z,i[10]=lo.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const r=e.elements,i=n.elements,s=this.elements,o=r[0],a=r[4],l=r[8],c=r[12],u=r[1],f=r[5],h=r[9],m=r[13],v=r[2],w=r[6],y=r[10],g=r[14],_=r[3],x=r[7],S=r[11],D=r[15],T=i[0],E=i[4],R=i[8],C=i[12],L=i[1],P=i[5],z=i[9],B=i[13],Y=i[2],ie=i[6],ee=i[10],le=i[14],j=i[3],q=i[7],ne=i[11],de=i[15];return s[0]=o*T+a*L+l*Y+c*j,s[4]=o*E+a*P+l*ie+c*q,s[8]=o*R+a*z+l*ee+c*ne,s[12]=o*C+a*B+l*le+c*de,s[1]=u*T+f*L+h*Y+m*j,s[5]=u*E+f*P+h*ie+m*q,s[9]=u*R+f*z+h*ee+m*ne,s[13]=u*C+f*B+h*le+m*de,s[2]=v*T+w*L+y*Y+g*j,s[6]=v*E+w*P+y*ie+g*q,s[10]=v*R+w*z+y*ee+g*ne,s[14]=v*C+w*B+y*le+g*de,s[3]=_*T+x*L+S*Y+D*j,s[7]=_*E+x*P+S*ie+D*q,s[11]=_*R+x*z+S*ee+D*ne,s[15]=_*C+x*B+S*le+D*de,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[4]*=e,n[8]*=e,n[12]*=e,n[1]*=e,n[5]*=e,n[9]*=e,n[13]*=e,n[2]*=e,n[6]*=e,n[10]*=e,n[14]*=e,n[3]*=e,n[7]*=e,n[11]*=e,n[15]*=e,this}determinant(){const e=this.elements,n=e[0],r=e[4],i=e[8],s=e[12],o=e[1],a=e[5],l=e[9],c=e[13],u=e[2],f=e[6],h=e[10],m=e[14],v=e[3],w=e[7],y=e[11],g=e[15];return v*(+s*l*f-i*c*f-s*a*h+r*c*h+i*a*m-r*l*m)+w*(+n*l*m-n*c*h+s*o*h-i*o*m+i*c*u-s*l*u)+y*(+n*c*f-n*a*m-s*o*f+r*o*m+s*a*u-r*c*u)+g*(-i*a*u-n*l*f+n*a*h+i*o*f-r*o*h+r*l*u)}transpose(){const e=this.elements;let n;return n=e[1],e[1]=e[4],e[4]=n,n=e[2],e[2]=e[8],e[8]=n,n=e[6],e[6]=e[9],e[9]=n,n=e[3],e[3]=e[12],e[12]=n,n=e[7],e[7]=e[13],e[13]=n,n=e[11],e[11]=e[14],e[14]=n,this}setPosition(e,n,r){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=n,i[14]=r),this}invert(){const e=this.elements,n=e[0],r=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],f=e[9],h=e[10],m=e[11],v=e[12],w=e[13],y=e[14],g=e[15],_=f*y*c-w*h*c+w*l*m-a*y*m-f*l*g+a*h*g,x=v*h*c-u*y*c-v*l*m+o*y*m+u*l*g-o*h*g,S=u*w*c-v*f*c+v*a*m-o*w*m-u*a*g+o*f*g,D=v*f*l-u*w*l-v*a*h+o*w*h+u*a*y-o*f*y,T=n*_+r*x+i*S+s*D;if(T===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const E=1/T;return e[0]=_*E,e[1]=(w*h*s-f*y*s-w*i*m+r*y*m+f*i*g-r*h*g)*E,e[2]=(a*y*s-w*l*s+w*i*c-r*y*c-a*i*g+r*l*g)*E,e[3]=(f*l*s-a*h*s-f*i*c+r*h*c+a*i*m-r*l*m)*E,e[4]=x*E,e[5]=(u*y*s-v*h*s+v*i*m-n*y*m-u*i*g+n*h*g)*E,e[6]=(v*l*s-o*y*s-v*i*c+n*y*c+o*i*g-n*l*g)*E,e[7]=(o*h*s-u*l*s+u*i*c-n*h*c-o*i*m+n*l*m)*E,e[8]=S*E,e[9]=(v*f*s-u*w*s-v*r*m+n*w*m+u*r*g-n*f*g)*E,e[10]=(o*w*s-v*a*s+v*r*c-n*w*c-o*r*g+n*a*g)*E,e[11]=(u*a*s-o*f*s-u*r*c+n*f*c+o*r*m-n*a*m)*E,e[12]=D*E,e[13]=(u*w*i-v*f*i+v*r*h-n*w*h-u*r*y+n*f*y)*E,e[14]=(v*a*i-o*w*i-v*r*l+n*w*l+o*r*y-n*a*y)*E,e[15]=(o*f*i-u*a*i+u*r*l-n*f*l-o*r*h+n*a*h)*E,this}scale(e){const n=this.elements,r=e.x,i=e.y,s=e.z;return n[0]*=r,n[4]*=i,n[8]*=s,n[1]*=r,n[5]*=i,n[9]*=s,n[2]*=r,n[6]*=i,n[10]*=s,n[3]*=r,n[7]*=i,n[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,n=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(n,r,i))}makeTranslation(e,n,r){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,n,0,0,1,r,0,0,0,1),this}makeRotationX(e){const n=Math.cos(e),r=Math.sin(e);return this.set(1,0,0,0,0,n,-r,0,0,r,n,0,0,0,0,1),this}makeRotationY(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,0,r,0,0,1,0,0,-r,0,n,0,0,0,0,1),this}makeRotationZ(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,-r,0,0,r,n,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,n){const r=Math.cos(n),i=Math.sin(n),s=1-r,o=e.x,a=e.y,l=e.z,c=s*o,u=s*a;return this.set(c*o+r,c*a-i*l,c*l+i*a,0,c*a+i*l,u*a+r,u*l-i*o,0,c*l-i*a,u*l+i*o,s*l*l+r,0,0,0,0,1),this}makeScale(e,n,r){return this.set(e,0,0,0,0,n,0,0,0,0,r,0,0,0,0,1),this}makeShear(e,n,r,i,s,o){return this.set(1,r,s,0,e,1,o,0,n,i,1,0,0,0,0,1),this}compose(e,n,r){const i=this.elements,s=n._x,o=n._y,a=n._z,l=n._w,c=s+s,u=o+o,f=a+a,h=s*c,m=s*u,v=s*f,w=o*u,y=o*f,g=a*f,_=l*c,x=l*u,S=l*f,D=r.x,T=r.y,E=r.z;return i[0]=(1-(w+g))*D,i[1]=(m+S)*D,i[2]=(v-x)*D,i[3]=0,i[4]=(m-S)*T,i[5]=(1-(h+g))*T,i[6]=(y+_)*T,i[7]=0,i[8]=(v+x)*E,i[9]=(y-_)*E,i[10]=(1-(h+w))*E,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,n,r){const i=this.elements;let s=Eh.set(i[0],i[1],i[2]).length();const o=Eh.set(i[4],i[5],i[6]).length(),a=Eh.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),e.x=i[12],e.y=i[13],e.z=i[14],_a.copy(this);const c=1/s,u=1/o,f=1/a;return _a.elements[0]*=c,_a.elements[1]*=c,_a.elements[2]*=c,_a.elements[4]*=u,_a.elements[5]*=u,_a.elements[6]*=u,_a.elements[8]*=f,_a.elements[9]*=f,_a.elements[10]*=f,n.setFromRotationMatrix(_a),r.x=s,r.y=o,r.z=a,this}makePerspective(e,n,r,i,s,o,a=tl){const l=this.elements,c=2*s/(n-e),u=2*s/(r-i),f=(n+e)/(n-e),h=(r+i)/(r-i);let m,v;if(a===tl)m=-(o+s)/(o-s),v=-2*o*s/(o-s);else if(a===j1)m=-o/(o-s),v=-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]=u,l[9]=h,l[13]=0,l[2]=0,l[6]=0,l[10]=m,l[14]=v,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,n,r,i,s,o,a=tl){const l=this.elements,c=1/(n-e),u=1/(r-i),f=1/(o-s),h=(n+e)*c,m=(r+i)*u;let v,w;if(a===tl)v=(o+s)*f,w=-2*f;else if(a===j1)v=s*f,w=-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]=-h,l[1]=0,l[5]=2*u,l[9]=0,l[13]=-m,l[2]=0,l[6]=0,l[10]=w,l[14]=-v,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const n=this.elements,r=e.elements;for(let i=0;i<16;i++)if(n[i]!==r[i])return!1;return!0}fromArray(e,n=0){for(let r=0;r<16;r++)this.elements[r]=e[r+n];return this}toArray(e=[],n=0){const r=this.elements;return e[n]=r[0],e[n+1]=r[1],e[n+2]=r[2],e[n+3]=r[3],e[n+4]=r[4],e[n+5]=r[5],e[n+6]=r[6],e[n+7]=r[7],e[n+8]=r[8],e[n+9]=r[9],e[n+10]=r[10],e[n+11]=r[11],e[n+12]=r[12],e[n+13]=r[13],e[n+14]=r[14],e[n+15]=r[15],e}}const Eh=new Z,_a=new Kt,Ybe=new Z(0,0,0),Qbe=new Z(1,1,1),Dc=new Z,Aw=new Z,lo=new Z,KO=new Kt,ZO=new Ti;class To{constructor(e=0,n=0,r=0,i=To.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=n,this._z=r,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,n,r,i=this._order){return this._x=e,this._y=n,this._z=r,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,n=this._order,r=!0){const i=e.elements,s=i[0],o=i[4],a=i[8],l=i[1],c=i[5],u=i[9],f=i[2],h=i[6],m=i[10];switch(n){case"XYZ":this._y=Math.asin(Vr(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,m),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(h,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Vr(u,-1,1)),Math.abs(u)<.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(Vr(h,-1,1)),Math.abs(h)<.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(-Vr(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(h,m),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(Vr(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-f,s)):(this._x=0,this._y=Math.atan2(a,m));break;case"XZY":this._z=Math.asin(-Vr(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(h,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-u,m),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,r===!0&&this._onChangeCallback(),this}setFromQuaternion(e,n,r){return KO.makeRotationFromQuaternion(e),this.setFromRotationMatrix(KO,n,r)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return ZO.setFromEuler(this),this.setFromQuaternion(ZO,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=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+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}}To.DEFAULT_ORDER="XYZ";class ld{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let n=0;n1){for(let r=0;r0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.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()})),i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(e),this._colorsTexture!==null&&(i.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),this.boundingBox!==null&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.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?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=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,u=l.length;c0){i.children=[];for(let a=0;a0){i.animations=[];for(let a=0;a0&&(r.geometries=a),l.length>0&&(r.materials=l),c.length>0&&(r.textures=c),u.length>0&&(r.images=u),f.length>0&&(r.shapes=f),h.length>0&&(r.skeletons=h),m.length>0&&(r.animations=m),v.length>0&&(r.nodes=v)}return r.object=i,r;function o(a){const l=[];for(const c in a){const u=a[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,n=!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)),n===!0)for(let r=0;r0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(e,n,r,i,s){Ma.subVectors(i,n),kl.subVectors(r,n),VE.subVectors(e,n);const o=Ma.dot(Ma),a=Ma.dot(kl),l=Ma.dot(VE),c=kl.dot(kl),u=kl.dot(VE),f=o*c-a*a;if(f===0)return s.set(0,0,0),null;const h=1/f,m=(c*l-a*u)*h,v=(o*u-a*l)*h;return s.set(1-m-v,v,m)}static containsPoint(e,n,r,i){return this.getBarycoord(e,n,r,i,Bl)===null?!1:Bl.x>=0&&Bl.y>=0&&Bl.x+Bl.y<=1}static getInterpolation(e,n,r,i,s,o,a,l){return this.getBarycoord(e,n,r,i,Bl)===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,Bl.x),l.addScaledVector(o,Bl.y),l.addScaledVector(a,Bl.z),l)}static isFrontFacing(e,n,r,i){return Ma.subVectors(r,n),kl.subVectors(e,n),Ma.cross(kl).dot(i)<0}set(e,n,r){return this.a.copy(e),this.b.copy(n),this.c.copy(r),this}setFromPointsAndIndices(e,n,r,i){return this.a.copy(e[n]),this.b.copy(e[r]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,n,r,i){return this.a.fromBufferAttribute(e,n),this.b.fromBufferAttribute(e,r),this.c.fromBufferAttribute(e,i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Ma.subVectors(this.c,this.b),kl.subVectors(this.a,this.b),Ma.cross(kl).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return mo.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,n){return mo.getBarycoord(e,this.a,this.b,this.c,n)}getInterpolation(e,n,r,i,s){return mo.getInterpolation(e,this.a,this.b,this.c,n,r,i,s)}containsPoint(e){return mo.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return mo.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,n){const r=this.a,i=this.b,s=this.c;let o,a;Ih.subVectors(i,r),Lh.subVectors(s,r),WE.subVectors(e,r);const l=Ih.dot(WE),c=Lh.dot(WE);if(l<=0&&c<=0)return n.copy(r);$E.subVectors(e,i);const u=Ih.dot($E),f=Lh.dot($E);if(u>=0&&f<=u)return n.copy(i);const h=l*f-u*c;if(h<=0&&l>=0&&u<=0)return o=l/(l-u),n.copy(r).addScaledVector(Ih,o);JE.subVectors(e,s);const m=Ih.dot(JE),v=Lh.dot(JE);if(v>=0&&m<=v)return n.copy(s);const w=m*c-l*v;if(w<=0&&c>=0&&v<=0)return a=c/(c-v),n.copy(r).addScaledVector(Lh,a);const y=u*v-m*f;if(y<=0&&f-u>=0&&m-v>=0)return i9.subVectors(s,i),a=(f-u)/(f-u+(m-v)),n.copy(i).addScaledVector(i9,a);const g=1/(y+w+h);return o=w*g,a=h*g,n.copy(r).addScaledVector(Ih,o).addScaledVector(Lh,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const $W={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},Nc={h:0,s:0,l:0},Iw={h:0,s:0,l:0};function YE(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*6*(2/3-n):t}class Lt{constructor(e,n,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,n,r)}set(e,n,r){if(n===void 0&&r===void 0){const i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,n,r);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,n=ho){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Zn.toWorkingColorSpace(this,n),this}setRGB(e,n,r,i=Zn.workingColorSpace){return this.r=e,this.g=n,this.b=r,Zn.toWorkingColorSpace(this,i),this}setHSL(e,n,r,i=Zn.workingColorSpace){if(e=JR(e,1),n=Vr(n,0,1),r=Vr(r,0,1),n===0)this.r=this.g=this.b=r;else{const s=r<=.5?r*(1+n):r+n-r*n,o=2*r-s;this.r=YE(o,s,e+1/3),this.g=YE(o,s,e),this.b=YE(o,s,e-1/3)}return Zn.toWorkingColorSpace(this,i),this}setStyle(e,n=ho){function r(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const o=i[1],a=i[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 r(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,n);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return r(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,n);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 r(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,n);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=i[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,n);if(o===6)return this.setHex(parseInt(s,16),n);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,n);return this}setColorName(e,n=ho){const r=$W[e.toLowerCase()];return r!==void 0?this.setHex(r,n):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=Np(e.r),this.g=Np(e.g),this.b=Np(e.b),this}copyLinearToSRGB(e){return this.r=kE(e.r),this.g=kE(e.g),this.b=kE(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=ho){return Zn.fromWorkingColorSpace(fs.copy(this),e),Math.round(Vr(fs.r*255,0,255))*65536+Math.round(Vr(fs.g*255,0,255))*256+Math.round(Vr(fs.b*255,0,255))}getHexString(e=ho){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,n=Zn.workingColorSpace){Zn.fromWorkingColorSpace(fs.copy(this),n);const r=fs.r,i=fs.g,s=fs.b,o=Math.max(r,i,s),a=Math.min(r,i,s);let l,c;const u=(a+o)/2;if(a===o)l=0,c=0;else{const f=o-a;switch(c=u<=.5?f/(o+a):f/(2-o-a),o){case r:l=(i-s)/f+(i0!=e>0&&this.version++,this._alphaTest=e}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const n in e){const r=e[n];if(r===void 0){console.warn(`THREE.Material: parameter '${n}' has value of undefined.`);continue}const i=this[n];if(i===void 0){console.warn(`THREE.Material: '${n}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(r):i&&i.isVector3&&r&&r.isVector3?i.copy(r):this[n]=r}}toJSON(e){const n=e===void 0||typeof e=="string";n&&(e={textures:{},images:{}});const r={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),this.roughness!==void 0&&(r.roughness=this.roughness),this.metalness!==void 0&&(r.metalness=this.metalness),this.sheen!==void 0&&(r.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(r.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(r.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(r.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(r.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(r.shininess=this.shininess),this.clearcoat!==void 0&&(r.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(r.dispersion=this.dispersion),this.iridescence!==void 0&&(r.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(r.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(r.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(r.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(r.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(r.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(r.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(r.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(r.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(e).uuid,r.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(r.aoMap=this.aoMap.toJSON(e).uuid,r.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(e).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(e).uuid,r.normalMapType=this.normalMapType,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(e).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(r.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(r.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(r.combine=this.combine)),this.envMapRotation!==void 0&&(r.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(r.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(r.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(r.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(r.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(r.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(r.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(r.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(r.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(r.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(r.size=this.size),this.shadowSide!==null&&(r.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(r.sizeAttenuation=this.sizeAttenuation),this.blending!==sd&&(r.blending=this.blending),this.side!==ml&&(r.side=this.side),this.vertexColors===!0&&(r.vertexColors=!0),this.opacity<1&&(r.opacity=this.opacity),this.transparent===!0&&(r.transparent=!0),this.blendSrc!==dx&&(r.blendSrc=this.blendSrc),this.blendDst!==hx&&(r.blendDst=this.blendDst),this.blendEquation!==eu&&(r.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(r.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(r.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(r.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(r.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(r.blendAlpha=this.blendAlpha),this.depthFunc!==D1&&(r.depthFunc=this.depthFunc),this.depthTest===!1&&(r.depthTest=this.depthTest),this.depthWrite===!1&&(r.depthWrite=this.depthWrite),this.colorWrite===!1&&(r.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(r.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==FI&&(r.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(r.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(r.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Pf&&(r.stencilFail=this.stencilFail),this.stencilZFail!==Pf&&(r.stencilZFail=this.stencilZFail),this.stencilZPass!==Pf&&(r.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(r.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(r.rotation=this.rotation),this.polygonOffset===!0&&(r.polygonOffset=!0),this.polygonOffsetFactor!==0&&(r.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(r.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(r.linewidth=this.linewidth),this.dashSize!==void 0&&(r.dashSize=this.dashSize),this.gapSize!==void 0&&(r.gapSize=this.gapSize),this.scale!==void 0&&(r.scale=this.scale),this.dithering===!0&&(r.dithering=!0),this.alphaTest>0&&(r.alphaTest=this.alphaTest),this.alphaHash===!0&&(r.alphaHash=!0),this.alphaToCoverage===!0&&(r.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(r.premultipliedAlpha=!0),this.forceSinglePass===!0&&(r.forceSinglePass=!0),this.wireframe===!0&&(r.wireframe=!0),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(r.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(r.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(r.flatShading=!0),this.visible===!1&&(r.visible=!1),this.toneMapped===!1&&(r.toneMapped=!1),this.fog===!1&&(r.fog=!1),Object.keys(this.userData).length>0&&(r.userData=this.userData);function i(s){const o=[];for(const a in s){const l=s[a];delete l.metadata,o.push(l)}return o}if(n){const s=i(e.textures),o=i(e.images);s.length>0&&(r.textures=s),o.length>0&&(r.images=o)}return r}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 n=e.clippingPlanes;let r=null;if(n!==null){const i=n.length;r=new Array(i);for(let s=0;s!==i;++s)r[s]=n[s].clone()}return this.clippingPlanes=r,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}onBeforeRender(){console.warn("Material: onBeforeRender() has been removed.")}}class Js extends Mi{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Lt(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 To,this.combine=Nv,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 Vl=t2e();function t2e(){const t=new ArrayBuffer(4),e=new Float32Array(t),n=new Uint32Array(t),r=new Uint32Array(512),i=new Uint32Array(512);for(let l=0;l<256;++l){const c=l-127;c<-27?(r[l]=0,r[l|256]=32768,i[l]=24,i[l|256]=24):c<-14?(r[l]=1024>>-c-14,r[l|256]=1024>>-c-14|32768,i[l]=-c-1,i[l|256]=-c-1):c<=15?(r[l]=c+15<<10,r[l|256]=c+15<<10|32768,i[l]=13,i[l|256]=13):c<128?(r[l]=31744,r[l|256]=64512,i[l]=24,i[l|256]=24):(r[l]=31744,r[l|256]=64512,i[l]=13,i[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,u=0;for(;!(c&8388608);)c<<=1,u-=8388608;c&=-8388609,u+=947912704,s[l]=c|u}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:n,baseTable:r,shiftTable:i,mantissaTable:s,exponentTable:o,offsetTable:a}}function Gs(t){Math.abs(t)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),t=Vr(t,-65504,65504),Vl.floatView[0]=t;const e=Vl.uint32View[0],n=e>>23&511;return Vl.baseTable[n]+((e&8388607)>>Vl.shiftTable[n])}function gg(t){const e=t>>10;return Vl.uint32View[0]=Vl.mantissaTable[Vl.offsetTable[e]+(t&1023)]+Vl.exponentTable[e],Vl.floatView[0]}const Xf={toHalfFloat:Gs,fromHalfFloat:gg},di=new Z,Lw=new tt;class Qn{constructor(e,n,r=!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=n,this.count=e!==void 0?e.length/n:0,this.normalized=r,this.usage=F1,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=Dr,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return Dp("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}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,n,r){e*=this.itemSize,r*=n.itemSize;for(let i=0,s=this.itemSize;i0&&(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 n=this.index;n!==null&&(e.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});const r=this.attributes;for(const l in r){const c=r[l];e.data.attributes[l]=c.toJSON(e.data)}const i={};let s=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let f=0,h=c.length;f0&&(i[l]=u,s=!0)}s&&(e.data.morphAttributes=i,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 n={};this.name=e.name;const r=e.index;r!==null&&this.setIndex(r.clone(n));const i=e.attributes;for(const c in i){const u=i[c];this.setAttribute(c,u.clone(n))}const s=e.morphAttributes;for(const c in s){const u=[],f=s[c];for(let h=0,m=f.length;h0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s(e.far-e.near)**2))&&(s9.copy(s).invert(),gf.copy(e.ray).applyMatrix4(s9),!(r.boundingBox!==null&&gf.intersectsBox(r.boundingBox)===!1)&&this._computeIntersections(e,n,gf)))}_computeIntersections(e,n,r){let i;const s=this.geometry,o=this.material,a=s.index,l=s.attributes.position,c=s.attributes.uv,u=s.attributes.uv1,f=s.attributes.normal,h=s.groups,m=s.drawRange;if(a!==null)if(Array.isArray(o))for(let v=0,w=h.length;vn.far?null:{distance:c,point:Ow.clone(),object:t}}function Uw(t,e,n,r,i,s,o,a,l,c){t.getVertexPosition(a,Ph),t.getVertexPosition(l,Dh),t.getVertexPosition(c,Nh);const u=c2e(t,e,n,r,Ph,Dh,Nh,Bw);if(u){i&&(Dw.fromBufferAttribute(i,a),Nw.fromBufferAttribute(i,l),kw.fromBufferAttribute(i,c),u.uv=mo.getInterpolation(Bw,Ph,Dh,Nh,Dw,Nw,kw,new tt)),s&&(Dw.fromBufferAttribute(s,a),Nw.fromBufferAttribute(s,l),kw.fromBufferAttribute(s,c),u.uv1=mo.getInterpolation(Bw,Ph,Dh,Nh,Dw,Nw,kw,new tt)),o&&(a9.fromBufferAttribute(o,a),l9.fromBufferAttribute(o,l),c9.fromBufferAttribute(o,c),u.normal=mo.getInterpolation(Bw,Ph,Dh,Nh,a9,l9,c9,new Z),u.normal.dot(r.direction)>0&&u.normal.multiplyScalar(-1));const f={a,b:l,c,normal:new Z,materialIndex:0};mo.getNormal(Ph,Dh,Nh,f.normal),u.face=f}return u}class $d extends mn{constructor(e=1,n=1,r=1,i=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:n,depth:r,widthSegments:i,heightSegments:s,depthSegments:o};const a=this;i=Math.floor(i),s=Math.floor(s),o=Math.floor(o);const l=[],c=[],u=[],f=[];let h=0,m=0;v("z","y","x",-1,-1,r,n,e,o,s,0),v("z","y","x",1,-1,r,n,-e,o,s,1),v("x","z","y",1,1,e,r,n,i,o,2),v("x","z","y",1,-1,e,r,-n,i,o,3),v("x","y","z",1,-1,e,n,r,i,s,4),v("x","y","z",-1,-1,e,n,-r,i,s,5),this.setIndex(l),this.setAttribute("position",new $t(c,3)),this.setAttribute("normal",new $t(u,3)),this.setAttribute("uv",new $t(f,2));function v(w,y,g,_,x,S,D,T,E,R,C){const L=S/E,P=D/R,z=S/2,B=D/2,Y=T/2,ie=E+1,ee=R+1;let le=0,j=0;const q=new Z;for(let ne=0;ne0?1:-1,u.push(q.x,q.y,q.z),f.push(_e/E),f.push(1-ne/R),le+=1}}for(let ne=0;ne0&&(n.defines=this.defines),n.vertexShader=this.vertexShader,n.fragmentShader=this.fragmentShader,n.lights=this.lights,n.clipping=this.clipping;const r={};for(const i in this.extensions)this.extensions[i]===!0&&(r[i]=!0);return Object.keys(r).length>0&&(n.extensions=r),n}}class Fv extends Vn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Kt,this.projectionMatrix=new Kt,this.projectionMatrixInverse=new Kt,this.coordinateSystem=tl}copy(e,n){return super.copy(e,n),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,n){super.updateWorldMatrix(e,n),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const kc=new Z,u9=new tt,f9=new tt;class Ci extends Fv{constructor(e=50,n=1,r=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=r,this.far=i,this.focus=10,this.aspect=n,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const n=.5*this.getFilmHeight()/e;this.fov=mm*2*Math.atan(n),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(ad*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return mm*2*Math.atan(Math.tan(ad*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,n,r){kc.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(kc.x,kc.y).multiplyScalar(-e/kc.z),kc.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),r.set(kc.x,kc.y).multiplyScalar(-e/kc.z)}getViewSize(e,n){return this.getViewBounds(e,u9,f9),n.subVectors(f9,u9)}setViewOffset(e,n,r,i,s,o){this.aspect=e/n,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=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let n=e*Math.tan(ad*.5*this.fov)/this.zoom,r=2*n,i=this.aspect*r,s=-.5*i;const o=this.view;if(this.view!==null&&this.view.enabled){const l=o.fullWidth,c=o.fullHeight;s+=o.offsetX*i/l,n-=o.offsetY*r/c,i*=o.width/l,r*=o.height/c}const a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+i,n,n-r,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.fov=this.fov,n.object.zoom=this.zoom,n.object.near=this.near,n.object.far=this.far,n.object.focus=this.focus,n.object.aspect=this.aspect,this.view!==null&&(n.object.view=Object.assign({},this.view)),n.object.filmGauge=this.filmGauge,n.object.filmOffset=this.filmOffset,n}}const kh=-90,Bh=1;class YW extends Vn{constructor(e,n,r){super(),this.type="CubeCamera",this.renderTarget=r,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new Ci(kh,Bh,e,n);i.layers=this.layers,this.add(i);const s=new Ci(kh,Bh,e,n);s.layers=this.layers,this.add(s);const o=new Ci(kh,Bh,e,n);o.layers=this.layers,this.add(o);const a=new Ci(kh,Bh,e,n);a.layers=this.layers,this.add(a);const l=new Ci(kh,Bh,e,n);l.layers=this.layers,this.add(l);const c=new Ci(kh,Bh,e,n);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const e=this.coordinateSystem,n=this.children.concat(),[r,i,s,o,a,l]=n;for(const c of n)this.remove(c);if(e===tl)r.up.set(0,1,0),r.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===j1)r.up.set(0,-1,0),r.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const c of n)this.add(c),c.updateMatrixWorld()}update(e,n){this.parent===null&&this.updateMatrixWorld();const{renderTarget:r,activeMipmapLevel:i}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[s,o,a,l,c,u]=this.children,f=e.getRenderTarget(),h=e.getActiveCubeFace(),m=e.getActiveMipmapLevel(),v=e.xr.enabled;e.xr.enabled=!1;const w=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,e.setRenderTarget(r,0,i),e.render(n,s),e.setRenderTarget(r,1,i),e.render(n,o),e.setRenderTarget(r,2,i),e.render(n,a),e.setRenderTarget(r,3,i),e.render(n,l),e.setRenderTarget(r,4,i),e.render(n,c),r.texture.generateMipmaps=w,e.setRenderTarget(r,5,i),e.render(n,u),e.setRenderTarget(f,h,m),e.xr.enabled=v,r.texture.needsPMREMUpdate=!0}}class jv extends er{constructor(e,n,r,i,s,o,a,l,c,u){e=e!==void 0?e:[],n=n!==void 0?n:gl,super(e,n,r,i,s,o,a,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class ZR extends Zi{constructor(e=1,n={}){super(e,e,n),this.isWebGLCubeRenderTarget=!0;const r={width:e,height:e,depth:1},i=[r,r,r,r,r,r];this.texture=new jv(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=n.generateMipmaps!==void 0?n.generateMipmaps:!1,this.texture.minFilter=n.minFilter!==void 0?n.minFilter:qn}fromEquirectangularTexture(e,n){this.texture.type=n.type,this.texture.colorSpace=n.colorSpace,this.texture.generateMipmaps=n.generateMipmaps,this.texture.minFilter=n.minFilter,this.texture.magFilter=n.magFilter;const r={uniforms:{tEquirect:{value:null}},vertexShader:`
+
+ varying vec3 vWorldDirection;
+
+ vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
+
+ return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
+
+ }
+
+ void main() {
+
+ vWorldDirection = transformDirection( position, modelMatrix );
+
+ #include
+ #include
+
+ }
+ `,fragmentShader:`
+
+ uniform sampler2D tEquirect;
+
+ varying vec3 vWorldDirection;
+
+ #include
+
+ void main() {
+
+ vec3 direction = normalize( vWorldDirection );
+
+ vec2 sampleUV = equirectUv( direction );
+
+ gl_FragColor = texture2D( tEquirect, sampleUV );
+
+ }
+ `},i=new $d(5,5,5),s=new qi({name:"CubemapFromEquirect",uniforms:gm(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:Os,blending:ul});s.uniforms.tEquirect.value=n;const o=new Cr(i,s),a=n.minFilter;return n.minFilter===ta&&(n.minFilter=qn),new YW(1,10,this).update(e,o),n.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,n,r,i){const s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(n,r,i);e.setRenderTarget(s)}}const KE=new Z,h2e=new Z,p2e=new wn;class Vc{constructor(e=new Z(1,0,0),n=0){this.isPlane=!0,this.normal=e,this.constant=n}set(e,n){return this.normal.copy(e),this.constant=n,this}setComponents(e,n,r,i){return this.normal.set(e,n,r),this.constant=i,this}setFromNormalAndCoplanarPoint(e,n){return this.normal.copy(e),this.constant=-n.dot(this.normal),this}setFromCoplanarPoints(e,n,r){const i=KE.subVectors(r,n).cross(h2e.subVectors(e,n)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,n){return n.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,n){const r=e.delta(KE),i=this.normal.dot(r);if(i===0)return this.distanceToPoint(e.start)===0?n.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:n.copy(e.start).addScaledVector(r,s)}intersectsLine(e){const n=this.distanceToPoint(e.start),r=this.distanceToPoint(e.end);return n<0&&r>0||r<0&&n>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,n){const r=n||p2e.getNormalMatrix(e),i=this.coplanarPoint(KE).applyMatrix4(e),s=this.normal.applyMatrix3(r).normalize();return this.constant=-i.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 vf=new Fi,Fw=new Z;class zv{constructor(e=new Vc,n=new Vc,r=new Vc,i=new Vc,s=new Vc,o=new Vc){this.planes=[e,n,r,i,s,o]}set(e,n,r,i,s,o){const a=this.planes;return a[0].copy(e),a[1].copy(n),a[2].copy(r),a[3].copy(i),a[4].copy(s),a[5].copy(o),this}copy(e){const n=this.planes;for(let r=0;r<6;r++)n[r].copy(e.planes[r]);return this}setFromProjectionMatrix(e,n=tl){const r=this.planes,i=e.elements,s=i[0],o=i[1],a=i[2],l=i[3],c=i[4],u=i[5],f=i[6],h=i[7],m=i[8],v=i[9],w=i[10],y=i[11],g=i[12],_=i[13],x=i[14],S=i[15];if(r[0].setComponents(l-s,h-c,y-m,S-g).normalize(),r[1].setComponents(l+s,h+c,y+m,S+g).normalize(),r[2].setComponents(l+o,h+u,y+v,S+_).normalize(),r[3].setComponents(l-o,h-u,y-v,S-_).normalize(),r[4].setComponents(l-a,h-f,y-w,S-x).normalize(),n===tl)r[5].setComponents(l+a,h+f,y+w,S+x).normalize();else if(n===j1)r[5].setComponents(a,f,w,x).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+n);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),vf.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const n=e.geometry;n.boundingSphere===null&&n.computeBoundingSphere(),vf.copy(n.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(vf)}intersectsSprite(e){return vf.center.set(0,0,0),vf.radius=.7071067811865476,vf.applyMatrix4(e.matrixWorld),this.intersectsSphere(vf)}intersectsSphere(e){const n=this.planes,r=e.center,i=-e.radius;for(let s=0;s<6;s++)if(n[s].distanceToPoint(r)0?e.max.x:e.min.x,Fw.y=i.normal.y>0?e.max.y:e.min.y,Fw.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Fw)<0)return!1}return!0}containsPoint(e){const n=this.planes;for(let r=0;r<6;r++)if(n[r].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function QW(){let t=null,e=!1,n=null,r=null;function i(s,o){n(s,o),r=t.requestAnimationFrame(i)}return{start:function(){e!==!0&&n!==null&&(r=t.requestAnimationFrame(i),e=!0)},stop:function(){t.cancelAnimationFrame(r),e=!1},setAnimationLoop:function(s){n=s},setContext:function(s){t=s}}}function m2e(t){const e=new WeakMap;function n(a,l){const c=a.array,u=a.usage,f=c.byteLength,h=t.createBuffer();t.bindBuffer(l,h),t.bufferData(l,c,u),a.onUploadCallback();let m;if(c instanceof Float32Array)m=t.FLOAT;else if(c instanceof Uint16Array)a.isFloat16BufferAttribute?m=t.HALF_FLOAT:m=t.UNSIGNED_SHORT;else if(c instanceof Int16Array)m=t.SHORT;else if(c instanceof Uint32Array)m=t.UNSIGNED_INT;else if(c instanceof Int32Array)m=t.INT;else if(c instanceof Int8Array)m=t.BYTE;else if(c instanceof Uint8Array)m=t.UNSIGNED_BYTE;else if(c instanceof Uint8ClampedArray)m=t.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+c);return{buffer:h,type:m,bytesPerElement:c.BYTES_PER_ELEMENT,version:a.version,size:f}}function r(a,l,c){const u=l.array,f=l._updateRange,h=l.updateRanges;if(t.bindBuffer(c,a),f.count===-1&&h.length===0&&t.bufferSubData(c,0,u),h.length!==0){for(let m=0,v=h.length;m 0
+ vec4 plane;
+ #ifdef ALPHA_TO_COVERAGE
+ float distanceToPlane, distanceGradient;
+ float clipOpacity = 1.0;
+ #pragma unroll_loop_start
+ for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
+ plane = clippingPlanes[ i ];
+ distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;
+ distanceGradient = fwidth( distanceToPlane ) / 2.0;
+ clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );
+ if ( clipOpacity == 0.0 ) discard;
+ }
+ #pragma unroll_loop_end
+ #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
+ float unionClipOpacity = 1.0;
+ #pragma unroll_loop_start
+ for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
+ plane = clippingPlanes[ i ];
+ distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;
+ distanceGradient = fwidth( distanceToPlane ) / 2.0;
+ unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );
+ }
+ #pragma unroll_loop_end
+ clipOpacity *= 1.0 - unionClipOpacity;
+ #endif
+ diffuseColor.a *= clipOpacity;
+ if ( diffuseColor.a == 0.0 ) discard;
+ #else
+ #pragma unroll_loop_start
+ for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
+ plane = clippingPlanes[ i ];
+ if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;
+ }
+ #pragma unroll_loop_end
+ #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
+ bool clipped = true;
+ #pragma unroll_loop_start
+ for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
+ plane = clippingPlanes[ i ];
+ clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;
+ }
+ #pragma unroll_loop_end
+ if ( clipped ) discard;
+ #endif
+ #endif
+#endif`,P2e=`#if NUM_CLIPPING_PLANES > 0
+ varying vec3 vClipPosition;
+ uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
+#endif`,D2e=`#if NUM_CLIPPING_PLANES > 0
+ varying vec3 vClipPosition;
+#endif`,N2e=`#if NUM_CLIPPING_PLANES > 0
+ vClipPosition = - mvPosition.xyz;
+#endif`,k2e=`#if defined( USE_COLOR_ALPHA )
+ diffuseColor *= vColor;
+#elif defined( USE_COLOR )
+ diffuseColor.rgb *= vColor;
+#endif`,B2e=`#if defined( USE_COLOR_ALPHA )
+ varying vec4 vColor;
+#elif defined( USE_COLOR )
+ varying vec3 vColor;
+#endif`,O2e=`#if defined( USE_COLOR_ALPHA )
+ varying vec4 vColor;
+#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
+ varying vec3 vColor;
+#endif`,U2e=`#if defined( USE_COLOR_ALPHA )
+ vColor = vec4( 1.0 );
+#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
+ vColor = vec3( 1.0 );
+#endif
+#ifdef USE_COLOR
+ vColor *= color;
+#endif
+#ifdef USE_INSTANCING_COLOR
+ vColor.xyz *= instanceColor.xyz;
+#endif
+#ifdef USE_BATCHING_COLOR
+ vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) );
+ vColor.xyz *= batchingColor.xyz;
+#endif`,F2e=`#define PI 3.141592653589793
+#define PI2 6.283185307179586
+#define PI_HALF 1.5707963267948966
+#define RECIPROCAL_PI 0.3183098861837907
+#define RECIPROCAL_PI2 0.15915494309189535
+#define EPSILON 1e-6
+#ifndef saturate
+#define saturate( a ) clamp( a, 0.0, 1.0 )
+#endif
+#define whiteComplement( a ) ( 1.0 - saturate( a ) )
+float pow2( const in float x ) { return x*x; }
+vec3 pow2( const in vec3 x ) { return x*x; }
+float pow3( const in float x ) { return x*x*x; }
+float pow4( const in float x ) { float x2 = x*x; return x2*x2; }
+float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }
+float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }
+highp float rand( const in vec2 uv ) {
+ const highp float a = 12.9898, b = 78.233, c = 43758.5453;
+ highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );
+ return fract( sin( sn ) * c );
+}
+#ifdef HIGH_PRECISION
+ float precisionSafeLength( vec3 v ) { return length( v ); }
+#else
+ float precisionSafeLength( vec3 v ) {
+ float maxComponent = max3( abs( v ) );
+ return length( v / maxComponent ) * maxComponent;
+ }
+#endif
+struct IncidentLight {
+ vec3 color;
+ vec3 direction;
+ bool visible;
+};
+struct ReflectedLight {
+ vec3 directDiffuse;
+ vec3 directSpecular;
+ vec3 indirectDiffuse;
+ vec3 indirectSpecular;
+};
+#ifdef USE_ALPHAHASH
+ varying vec3 vPosition;
+#endif
+vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
+ return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
+}
+vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {
+ return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );
+}
+mat3 transposeMat3( const in mat3 m ) {
+ mat3 tmp;
+ tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );
+ tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );
+ tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );
+ return tmp;
+}
+bool isPerspectiveMatrix( mat4 m ) {
+ return m[ 2 ][ 3 ] == - 1.0;
+}
+vec2 equirectUv( in vec3 dir ) {
+ float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;
+ float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;
+ return vec2( u, v );
+}
+vec3 BRDF_Lambert( const in vec3 diffuseColor ) {
+ return RECIPROCAL_PI * diffuseColor;
+}
+vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {
+ float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
+ return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
+}
+float F_Schlick( const in float f0, const in float f90, const in float dotVH ) {
+ float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
+ return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
+} // validated`,j2e=`#ifdef ENVMAP_TYPE_CUBE_UV
+ #define cubeUV_minMipLevel 4.0
+ #define cubeUV_minTileSize 16.0
+ float getFace( vec3 direction ) {
+ vec3 absDirection = abs( direction );
+ float face = - 1.0;
+ if ( absDirection.x > absDirection.z ) {
+ if ( absDirection.x > absDirection.y )
+ face = direction.x > 0.0 ? 0.0 : 3.0;
+ else
+ face = direction.y > 0.0 ? 1.0 : 4.0;
+ } else {
+ if ( absDirection.z > absDirection.y )
+ face = direction.z > 0.0 ? 2.0 : 5.0;
+ else
+ face = direction.y > 0.0 ? 1.0 : 4.0;
+ }
+ return face;
+ }
+ vec2 getUV( vec3 direction, float face ) {
+ vec2 uv;
+ if ( face == 0.0 ) {
+ uv = vec2( direction.z, direction.y ) / abs( direction.x );
+ } else if ( face == 1.0 ) {
+ uv = vec2( - direction.x, - direction.z ) / abs( direction.y );
+ } else if ( face == 2.0 ) {
+ uv = vec2( - direction.x, direction.y ) / abs( direction.z );
+ } else if ( face == 3.0 ) {
+ uv = vec2( - direction.z, direction.y ) / abs( direction.x );
+ } else if ( face == 4.0 ) {
+ uv = vec2( - direction.x, direction.z ) / abs( direction.y );
+ } else {
+ uv = vec2( direction.x, direction.y ) / abs( direction.z );
+ }
+ return 0.5 * ( uv + 1.0 );
+ }
+ vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {
+ float face = getFace( direction );
+ float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );
+ mipInt = max( mipInt, cubeUV_minMipLevel );
+ float faceSize = exp2( mipInt );
+ highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;
+ if ( face > 2.0 ) {
+ uv.y += faceSize;
+ face -= 3.0;
+ }
+ uv.x += face * faceSize;
+ uv.x += filterInt * 3.0 * cubeUV_minTileSize;
+ uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );
+ uv.x *= CUBEUV_TEXEL_WIDTH;
+ uv.y *= CUBEUV_TEXEL_HEIGHT;
+ #ifdef texture2DGradEXT
+ return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;
+ #else
+ return texture2D( envMap, uv ).rgb;
+ #endif
+ }
+ #define cubeUV_r0 1.0
+ #define cubeUV_m0 - 2.0
+ #define cubeUV_r1 0.8
+ #define cubeUV_m1 - 1.0
+ #define cubeUV_r4 0.4
+ #define cubeUV_m4 2.0
+ #define cubeUV_r5 0.305
+ #define cubeUV_m5 3.0
+ #define cubeUV_r6 0.21
+ #define cubeUV_m6 4.0
+ float roughnessToMip( float roughness ) {
+ float mip = 0.0;
+ if ( roughness >= cubeUV_r1 ) {
+ mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;
+ } else if ( roughness >= cubeUV_r4 ) {
+ mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;
+ } else if ( roughness >= cubeUV_r5 ) {
+ mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;
+ } else if ( roughness >= cubeUV_r6 ) {
+ mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;
+ } else {
+ mip = - 2.0 * log2( 1.16 * roughness ); }
+ return mip;
+ }
+ vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {
+ float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );
+ float mipF = fract( mip );
+ float mipInt = floor( mip );
+ vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );
+ if ( mipF == 0.0 ) {
+ return vec4( color0, 1.0 );
+ } else {
+ vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );
+ return vec4( mix( color0, color1, mipF ), 1.0 );
+ }
+ }
+#endif`,z2e=`vec3 transformedNormal = objectNormal;
+#ifdef USE_TANGENT
+ vec3 transformedTangent = objectTangent;
+#endif
+#ifdef USE_BATCHING
+ mat3 bm = mat3( batchingMatrix );
+ transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );
+ transformedNormal = bm * transformedNormal;
+ #ifdef USE_TANGENT
+ transformedTangent = bm * transformedTangent;
+ #endif
+#endif
+#ifdef USE_INSTANCING
+ mat3 im = mat3( instanceMatrix );
+ transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );
+ transformedNormal = im * transformedNormal;
+ #ifdef USE_TANGENT
+ transformedTangent = im * transformedTangent;
+ #endif
+#endif
+transformedNormal = normalMatrix * transformedNormal;
+#ifdef FLIP_SIDED
+ transformedNormal = - transformedNormal;
+#endif
+#ifdef USE_TANGENT
+ transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;
+ #ifdef FLIP_SIDED
+ transformedTangent = - transformedTangent;
+ #endif
+#endif`,H2e=`#ifdef USE_DISPLACEMENTMAP
+ uniform sampler2D displacementMap;
+ uniform float displacementScale;
+ uniform float displacementBias;
+#endif`,G2e=`#ifdef USE_DISPLACEMENTMAP
+ transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );
+#endif`,V2e=`#ifdef USE_EMISSIVEMAP
+ vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );
+ totalEmissiveRadiance *= emissiveColor.rgb;
+#endif`,W2e=`#ifdef USE_EMISSIVEMAP
+ uniform sampler2D emissiveMap;
+#endif`,$2e="gl_FragColor = linearToOutputTexel( gl_FragColor );",J2e=`
+const mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3(
+ vec3( 0.8224621, 0.177538, 0.0 ),
+ vec3( 0.0331941, 0.9668058, 0.0 ),
+ vec3( 0.0170827, 0.0723974, 0.9105199 )
+);
+const mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3(
+ vec3( 1.2249401, - 0.2249404, 0.0 ),
+ vec3( - 0.0420569, 1.0420571, 0.0 ),
+ vec3( - 0.0196376, - 0.0786361, 1.0982735 )
+);
+vec4 LinearSRGBToLinearDisplayP3( in vec4 value ) {
+ return vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a );
+}
+vec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) {
+ return vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a );
+}
+vec4 LinearTransferOETF( in vec4 value ) {
+ return value;
+}
+vec4 sRGBTransferOETF( in vec4 value ) {
+ return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );
+}`,Y2e=`#ifdef USE_ENVMAP
+ #ifdef ENV_WORLDPOS
+ vec3 cameraToFrag;
+ if ( isOrthographic ) {
+ cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
+ } else {
+ cameraToFrag = normalize( vWorldPosition - cameraPosition );
+ }
+ vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
+ #ifdef ENVMAP_MODE_REFLECTION
+ vec3 reflectVec = reflect( cameraToFrag, worldNormal );
+ #else
+ vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );
+ #endif
+ #else
+ vec3 reflectVec = vReflect;
+ #endif
+ #ifdef ENVMAP_TYPE_CUBE
+ vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );
+ #else
+ vec4 envColor = vec4( 0.0 );
+ #endif
+ #ifdef ENVMAP_BLENDING_MULTIPLY
+ outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );
+ #elif defined( ENVMAP_BLENDING_MIX )
+ outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );
+ #elif defined( ENVMAP_BLENDING_ADD )
+ outgoingLight += envColor.xyz * specularStrength * reflectivity;
+ #endif
+#endif`,Q2e=`#ifdef USE_ENVMAP
+ uniform float envMapIntensity;
+ uniform float flipEnvMap;
+ uniform mat3 envMapRotation;
+ #ifdef ENVMAP_TYPE_CUBE
+ uniform samplerCube envMap;
+ #else
+ uniform sampler2D envMap;
+ #endif
+
+#endif`,X2e=`#ifdef USE_ENVMAP
+ uniform float reflectivity;
+ #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
+ #define ENV_WORLDPOS
+ #endif
+ #ifdef ENV_WORLDPOS
+ varying vec3 vWorldPosition;
+ uniform float refractionRatio;
+ #else
+ varying vec3 vReflect;
+ #endif
+#endif`,K2e=`#ifdef USE_ENVMAP
+ #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
+ #define ENV_WORLDPOS
+ #endif
+ #ifdef ENV_WORLDPOS
+
+ varying vec3 vWorldPosition;
+ #else
+ varying vec3 vReflect;
+ uniform float refractionRatio;
+ #endif
+#endif`,Z2e=`#ifdef USE_ENVMAP
+ #ifdef ENV_WORLDPOS
+ vWorldPosition = worldPosition.xyz;
+ #else
+ vec3 cameraToVertex;
+ if ( isOrthographic ) {
+ cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
+ } else {
+ cameraToVertex = normalize( worldPosition.xyz - cameraPosition );
+ }
+ vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
+ #ifdef ENVMAP_MODE_REFLECTION
+ vReflect = reflect( cameraToVertex, worldNormal );
+ #else
+ vReflect = refract( cameraToVertex, worldNormal, refractionRatio );
+ #endif
+ #endif
+#endif`,q2e=`#ifdef USE_FOG
+ vFogDepth = - mvPosition.z;
+#endif`,eSe=`#ifdef USE_FOG
+ varying float vFogDepth;
+#endif`,tSe=`#ifdef USE_FOG
+ #ifdef FOG_EXP2
+ float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );
+ #else
+ float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );
+ #endif
+ gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );
+#endif`,nSe=`#ifdef USE_FOG
+ uniform vec3 fogColor;
+ varying float vFogDepth;
+ #ifdef FOG_EXP2
+ uniform float fogDensity;
+ #else
+ uniform float fogNear;
+ uniform float fogFar;
+ #endif
+#endif`,rSe=`#ifdef USE_GRADIENTMAP
+ uniform sampler2D gradientMap;
+#endif
+vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {
+ float dotNL = dot( normal, lightDirection );
+ vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );
+ #ifdef USE_GRADIENTMAP
+ return vec3( texture2D( gradientMap, coord ).r );
+ #else
+ vec2 fw = fwidth( coord ) * 0.5;
+ return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );
+ #endif
+}`,iSe=`#ifdef USE_LIGHTMAP
+ uniform sampler2D lightMap;
+ uniform float lightMapIntensity;
+#endif`,sSe=`LambertMaterial material;
+material.diffuseColor = diffuseColor.rgb;
+material.specularStrength = specularStrength;`,oSe=`varying vec3 vViewPosition;
+struct LambertMaterial {
+ vec3 diffuseColor;
+ float specularStrength;
+};
+void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {
+ float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
+ vec3 irradiance = dotNL * directLight.color;
+ reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
+}
+void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {
+ reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
+}
+#define RE_Direct RE_Direct_Lambert
+#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,aSe=`uniform bool receiveShadow;
+uniform vec3 ambientLightColor;
+#if defined( USE_LIGHT_PROBES )
+ uniform vec3 lightProbe[ 9 ];
+#endif
+vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {
+ float x = normal.x, y = normal.y, z = normal.z;
+ vec3 result = shCoefficients[ 0 ] * 0.886227;
+ result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;
+ result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;
+ result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;
+ result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;
+ result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;
+ result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );
+ result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;
+ result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );
+ return result;
+}
+vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {
+ vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
+ vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );
+ return irradiance;
+}
+vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {
+ vec3 irradiance = ambientLightColor;
+ return irradiance;
+}
+float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {
+ float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );
+ if ( cutoffDistance > 0.0 ) {
+ distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );
+ }
+ return distanceFalloff;
+}
+float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {
+ return smoothstep( coneCosine, penumbraCosine, angleCosine );
+}
+#if NUM_DIR_LIGHTS > 0
+ struct DirectionalLight {
+ vec3 direction;
+ vec3 color;
+ };
+ uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];
+ void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {
+ light.color = directionalLight.color;
+ light.direction = directionalLight.direction;
+ light.visible = true;
+ }
+#endif
+#if NUM_POINT_LIGHTS > 0
+ struct PointLight {
+ vec3 position;
+ vec3 color;
+ float distance;
+ float decay;
+ };
+ uniform PointLight pointLights[ NUM_POINT_LIGHTS ];
+ void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {
+ vec3 lVector = pointLight.position - geometryPosition;
+ light.direction = normalize( lVector );
+ float lightDistance = length( lVector );
+ light.color = pointLight.color;
+ light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );
+ light.visible = ( light.color != vec3( 0.0 ) );
+ }
+#endif
+#if NUM_SPOT_LIGHTS > 0
+ struct SpotLight {
+ vec3 position;
+ vec3 direction;
+ vec3 color;
+ float distance;
+ float decay;
+ float coneCos;
+ float penumbraCos;
+ };
+ uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];
+ void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {
+ vec3 lVector = spotLight.position - geometryPosition;
+ light.direction = normalize( lVector );
+ float angleCos = dot( light.direction, spotLight.direction );
+ float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );
+ if ( spotAttenuation > 0.0 ) {
+ float lightDistance = length( lVector );
+ light.color = spotLight.color * spotAttenuation;
+ light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );
+ light.visible = ( light.color != vec3( 0.0 ) );
+ } else {
+ light.color = vec3( 0.0 );
+ light.visible = false;
+ }
+ }
+#endif
+#if NUM_RECT_AREA_LIGHTS > 0
+ struct RectAreaLight {
+ vec3 color;
+ vec3 position;
+ vec3 halfWidth;
+ vec3 halfHeight;
+ };
+ uniform sampler2D ltc_1; uniform sampler2D ltc_2;
+ uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];
+#endif
+#if NUM_HEMI_LIGHTS > 0
+ struct HemisphereLight {
+ vec3 direction;
+ vec3 skyColor;
+ vec3 groundColor;
+ };
+ uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];
+ vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {
+ float dotNL = dot( normal, hemiLight.direction );
+ float hemiDiffuseWeight = 0.5 * dotNL + 0.5;
+ vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );
+ return irradiance;
+ }
+#endif`,lSe=`#ifdef USE_ENVMAP
+ vec3 getIBLIrradiance( const in vec3 normal ) {
+ #ifdef ENVMAP_TYPE_CUBE_UV
+ vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
+ vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );
+ return PI * envMapColor.rgb * envMapIntensity;
+ #else
+ return vec3( 0.0 );
+ #endif
+ }
+ vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {
+ #ifdef ENVMAP_TYPE_CUBE_UV
+ vec3 reflectVec = reflect( - viewDir, normal );
+ reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );
+ reflectVec = inverseTransformDirection( reflectVec, viewMatrix );
+ vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );
+ return envMapColor.rgb * envMapIntensity;
+ #else
+ return vec3( 0.0 );
+ #endif
+ }
+ #ifdef USE_ANISOTROPY
+ vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {
+ #ifdef ENVMAP_TYPE_CUBE_UV
+ vec3 bentNormal = cross( bitangent, viewDir );
+ bentNormal = normalize( cross( bentNormal, bitangent ) );
+ bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );
+ return getIBLRadiance( viewDir, bentNormal, roughness );
+ #else
+ return vec3( 0.0 );
+ #endif
+ }
+ #endif
+#endif`,cSe=`ToonMaterial material;
+material.diffuseColor = diffuseColor.rgb;`,uSe=`varying vec3 vViewPosition;
+struct ToonMaterial {
+ vec3 diffuseColor;
+};
+void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
+ vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;
+ reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
+}
+void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
+ reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
+}
+#define RE_Direct RE_Direct_Toon
+#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,fSe=`BlinnPhongMaterial material;
+material.diffuseColor = diffuseColor.rgb;
+material.specularColor = specular;
+material.specularShininess = shininess;
+material.specularStrength = specularStrength;`,dSe=`varying vec3 vViewPosition;
+struct BlinnPhongMaterial {
+ vec3 diffuseColor;
+ vec3 specularColor;
+ float specularShininess;
+ float specularStrength;
+};
+void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
+ float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
+ vec3 irradiance = dotNL * directLight.color;
+ reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
+ reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;
+}
+void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
+ reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
+}
+#define RE_Direct RE_Direct_BlinnPhong
+#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,hSe=`PhysicalMaterial material;
+material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );
+vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );
+float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );
+material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;
+material.roughness = min( material.roughness, 1.0 );
+#ifdef IOR
+ material.ior = ior;
+ #ifdef USE_SPECULAR
+ float specularIntensityFactor = specularIntensity;
+ vec3 specularColorFactor = specularColor;
+ #ifdef USE_SPECULAR_COLORMAP
+ specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;
+ #endif
+ #ifdef USE_SPECULAR_INTENSITYMAP
+ specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;
+ #endif
+ material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );
+ #else
+ float specularIntensityFactor = 1.0;
+ vec3 specularColorFactor = vec3( 1.0 );
+ material.specularF90 = 1.0;
+ #endif
+ material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );
+#else
+ material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );
+ material.specularF90 = 1.0;
+#endif
+#ifdef USE_CLEARCOAT
+ material.clearcoat = clearcoat;
+ material.clearcoatRoughness = clearcoatRoughness;
+ material.clearcoatF0 = vec3( 0.04 );
+ material.clearcoatF90 = 1.0;
+ #ifdef USE_CLEARCOATMAP
+ material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;
+ #endif
+ #ifdef USE_CLEARCOAT_ROUGHNESSMAP
+ material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;
+ #endif
+ material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );
+ material.clearcoatRoughness += geometryRoughness;
+ material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );
+#endif
+#ifdef USE_DISPERSION
+ material.dispersion = dispersion;
+#endif
+#ifdef USE_IRIDESCENCE
+ material.iridescence = iridescence;
+ material.iridescenceIOR = iridescenceIOR;
+ #ifdef USE_IRIDESCENCEMAP
+ material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;
+ #endif
+ #ifdef USE_IRIDESCENCE_THICKNESSMAP
+ material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;
+ #else
+ material.iridescenceThickness = iridescenceThicknessMaximum;
+ #endif
+#endif
+#ifdef USE_SHEEN
+ material.sheenColor = sheenColor;
+ #ifdef USE_SHEEN_COLORMAP
+ material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;
+ #endif
+ material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );
+ #ifdef USE_SHEEN_ROUGHNESSMAP
+ material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;
+ #endif
+#endif
+#ifdef USE_ANISOTROPY
+ #ifdef USE_ANISOTROPYMAP
+ mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );
+ vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;
+ vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;
+ #else
+ vec2 anisotropyV = anisotropyVector;
+ #endif
+ material.anisotropy = length( anisotropyV );
+ if( material.anisotropy == 0.0 ) {
+ anisotropyV = vec2( 1.0, 0.0 );
+ } else {
+ anisotropyV /= material.anisotropy;
+ material.anisotropy = saturate( material.anisotropy );
+ }
+ material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );
+ material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;
+ material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;
+#endif`,pSe=`struct PhysicalMaterial {
+ vec3 diffuseColor;
+ float roughness;
+ vec3 specularColor;
+ float specularF90;
+ float dispersion;
+ #ifdef USE_CLEARCOAT
+ float clearcoat;
+ float clearcoatRoughness;
+ vec3 clearcoatF0;
+ float clearcoatF90;
+ #endif
+ #ifdef USE_IRIDESCENCE
+ float iridescence;
+ float iridescenceIOR;
+ float iridescenceThickness;
+ vec3 iridescenceFresnel;
+ vec3 iridescenceF0;
+ #endif
+ #ifdef USE_SHEEN
+ vec3 sheenColor;
+ float sheenRoughness;
+ #endif
+ #ifdef IOR
+ float ior;
+ #endif
+ #ifdef USE_TRANSMISSION
+ float transmission;
+ float transmissionAlpha;
+ float thickness;
+ float attenuationDistance;
+ vec3 attenuationColor;
+ #endif
+ #ifdef USE_ANISOTROPY
+ float anisotropy;
+ float alphaT;
+ vec3 anisotropyT;
+ vec3 anisotropyB;
+ #endif
+};
+vec3 clearcoatSpecularDirect = vec3( 0.0 );
+vec3 clearcoatSpecularIndirect = vec3( 0.0 );
+vec3 sheenSpecularDirect = vec3( 0.0 );
+vec3 sheenSpecularIndirect = vec3(0.0 );
+vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {
+ float x = clamp( 1.0 - dotVH, 0.0, 1.0 );
+ float x2 = x * x;
+ float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );
+ return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );
+}
+float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {
+ float a2 = pow2( alpha );
+ float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );
+ float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );
+ return 0.5 / max( gv + gl, EPSILON );
+}
+float D_GGX( const in float alpha, const in float dotNH ) {
+ float a2 = pow2( alpha );
+ float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;
+ return RECIPROCAL_PI * a2 / pow2( denom );
+}
+#ifdef USE_ANISOTROPY
+ float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {
+ float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );
+ float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );
+ float v = 0.5 / ( gv + gl );
+ return saturate(v);
+ }
+ float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {
+ float a2 = alphaT * alphaB;
+ highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );
+ highp float v2 = dot( v, v );
+ float w2 = a2 / v2;
+ return RECIPROCAL_PI * a2 * pow2 ( w2 );
+ }
+#endif
+#ifdef USE_CLEARCOAT
+ vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {
+ vec3 f0 = material.clearcoatF0;
+ float f90 = material.clearcoatF90;
+ float roughness = material.clearcoatRoughness;
+ float alpha = pow2( roughness );
+ vec3 halfDir = normalize( lightDir + viewDir );
+ float dotNL = saturate( dot( normal, lightDir ) );
+ float dotNV = saturate( dot( normal, viewDir ) );
+ float dotNH = saturate( dot( normal, halfDir ) );
+ float dotVH = saturate( dot( viewDir, halfDir ) );
+ vec3 F = F_Schlick( f0, f90, dotVH );
+ float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
+ float D = D_GGX( alpha, dotNH );
+ return F * ( V * D );
+ }
+#endif
+vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {
+ vec3 f0 = material.specularColor;
+ float f90 = material.specularF90;
+ float roughness = material.roughness;
+ float alpha = pow2( roughness );
+ vec3 halfDir = normalize( lightDir + viewDir );
+ float dotNL = saturate( dot( normal, lightDir ) );
+ float dotNV = saturate( dot( normal, viewDir ) );
+ float dotNH = saturate( dot( normal, halfDir ) );
+ float dotVH = saturate( dot( viewDir, halfDir ) );
+ vec3 F = F_Schlick( f0, f90, dotVH );
+ #ifdef USE_IRIDESCENCE
+ F = mix( F, material.iridescenceFresnel, material.iridescence );
+ #endif
+ #ifdef USE_ANISOTROPY
+ float dotTL = dot( material.anisotropyT, lightDir );
+ float dotTV = dot( material.anisotropyT, viewDir );
+ float dotTH = dot( material.anisotropyT, halfDir );
+ float dotBL = dot( material.anisotropyB, lightDir );
+ float dotBV = dot( material.anisotropyB, viewDir );
+ float dotBH = dot( material.anisotropyB, halfDir );
+ float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );
+ float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );
+ #else
+ float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
+ float D = D_GGX( alpha, dotNH );
+ #endif
+ return F * ( V * D );
+}
+vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {
+ const float LUT_SIZE = 64.0;
+ const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;
+ const float LUT_BIAS = 0.5 / LUT_SIZE;
+ float dotNV = saturate( dot( N, V ) );
+ vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );
+ uv = uv * LUT_SCALE + LUT_BIAS;
+ return uv;
+}
+float LTC_ClippedSphereFormFactor( const in vec3 f ) {
+ float l = length( f );
+ return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );
+}
+vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {
+ float x = dot( v1, v2 );
+ float y = abs( x );
+ float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;
+ float b = 3.4175940 + ( 4.1616724 + y ) * y;
+ float v = a / b;
+ float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;
+ return cross( v1, v2 ) * theta_sintheta;
+}
+vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {
+ vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];
+ vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];
+ vec3 lightNormal = cross( v1, v2 );
+ if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );
+ vec3 T1, T2;
+ T1 = normalize( V - N * dot( V, N ) );
+ T2 = - cross( N, T1 );
+ mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );
+ vec3 coords[ 4 ];
+ coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );
+ coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );
+ coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );
+ coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );
+ coords[ 0 ] = normalize( coords[ 0 ] );
+ coords[ 1 ] = normalize( coords[ 1 ] );
+ coords[ 2 ] = normalize( coords[ 2 ] );
+ coords[ 3 ] = normalize( coords[ 3 ] );
+ vec3 vectorFormFactor = vec3( 0.0 );
+ vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );
+ vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );
+ vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );
+ vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );
+ float result = LTC_ClippedSphereFormFactor( vectorFormFactor );
+ return vec3( result );
+}
+#if defined( USE_SHEEN )
+float D_Charlie( float roughness, float dotNH ) {
+ float alpha = pow2( roughness );
+ float invAlpha = 1.0 / alpha;
+ float cos2h = dotNH * dotNH;
+ float sin2h = max( 1.0 - cos2h, 0.0078125 );
+ return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );
+}
+float V_Neubelt( float dotNV, float dotNL ) {
+ return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );
+}
+vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {
+ vec3 halfDir = normalize( lightDir + viewDir );
+ float dotNL = saturate( dot( normal, lightDir ) );
+ float dotNV = saturate( dot( normal, viewDir ) );
+ float dotNH = saturate( dot( normal, halfDir ) );
+ float D = D_Charlie( sheenRoughness, dotNH );
+ float V = V_Neubelt( dotNV, dotNL );
+ return sheenColor * ( D * V );
+}
+#endif
+float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {
+ float dotNV = saturate( dot( normal, viewDir ) );
+ float r2 = roughness * roughness;
+ float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;
+ float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;
+ float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );
+ return saturate( DG * RECIPROCAL_PI );
+}
+vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {
+ float dotNV = saturate( dot( normal, viewDir ) );
+ const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );
+ const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );
+ vec4 r = roughness * c0 + c1;
+ float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;
+ vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;
+ return fab;
+}
+vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {
+ vec2 fab = DFGApprox( normal, viewDir, roughness );
+ return specularColor * fab.x + specularF90 * fab.y;
+}
+#ifdef USE_IRIDESCENCE
+void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {
+#else
+void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {
+#endif
+ vec2 fab = DFGApprox( normal, viewDir, roughness );
+ #ifdef USE_IRIDESCENCE
+ vec3 Fr = mix( specularColor, iridescenceF0, iridescence );
+ #else
+ vec3 Fr = specularColor;
+ #endif
+ vec3 FssEss = Fr * fab.x + specularF90 * fab.y;
+ float Ess = fab.x + fab.y;
+ float Ems = 1.0 - Ess;
+ vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );
+ singleScatter += FssEss;
+ multiScatter += Fms * Ems;
+}
+#if NUM_RECT_AREA_LIGHTS > 0
+ void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
+ vec3 normal = geometryNormal;
+ vec3 viewDir = geometryViewDir;
+ vec3 position = geometryPosition;
+ vec3 lightPos = rectAreaLight.position;
+ vec3 halfWidth = rectAreaLight.halfWidth;
+ vec3 halfHeight = rectAreaLight.halfHeight;
+ vec3 lightColor = rectAreaLight.color;
+ float roughness = material.roughness;
+ vec3 rectCoords[ 4 ];
+ rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;
+ rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;
+ rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;
+ vec2 uv = LTC_Uv( normal, viewDir, roughness );
+ vec4 t1 = texture2D( ltc_1, uv );
+ vec4 t2 = texture2D( ltc_2, uv );
+ mat3 mInv = mat3(
+ vec3( t1.x, 0, t1.y ),
+ vec3( 0, 1, 0 ),
+ vec3( t1.z, 0, t1.w )
+ );
+ vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );
+ reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );
+ reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );
+ }
+#endif
+void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
+ float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
+ vec3 irradiance = dotNL * directLight.color;
+ #ifdef USE_CLEARCOAT
+ float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );
+ vec3 ccIrradiance = dotNLcc * directLight.color;
+ clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );
+ #endif
+ #ifdef USE_SHEEN
+ sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );
+ #endif
+ reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );
+ reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
+}
+void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
+ reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
+}
+void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {
+ #ifdef USE_CLEARCOAT
+ clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );
+ #endif
+ #ifdef USE_SHEEN
+ sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );
+ #endif
+ vec3 singleScattering = vec3( 0.0 );
+ vec3 multiScattering = vec3( 0.0 );
+ vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;
+ #ifdef USE_IRIDESCENCE
+ computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );
+ #else
+ computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );
+ #endif
+ vec3 totalScattering = singleScattering + multiScattering;
+ vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );
+ reflectedLight.indirectSpecular += radiance * singleScattering;
+ reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;
+ reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;
+}
+#define RE_Direct RE_Direct_Physical
+#define RE_Direct_RectArea RE_Direct_RectArea_Physical
+#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical
+#define RE_IndirectSpecular RE_IndirectSpecular_Physical
+float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {
+ return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );
+}`,mSe=`
+vec3 geometryPosition = - vViewPosition;
+vec3 geometryNormal = normal;
+vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );
+vec3 geometryClearcoatNormal = vec3( 0.0 );
+#ifdef USE_CLEARCOAT
+ geometryClearcoatNormal = clearcoatNormal;
+#endif
+#ifdef USE_IRIDESCENCE
+ float dotNVi = saturate( dot( normal, geometryViewDir ) );
+ if ( material.iridescenceThickness == 0.0 ) {
+ material.iridescence = 0.0;
+ } else {
+ material.iridescence = saturate( material.iridescence );
+ }
+ if ( material.iridescence > 0.0 ) {
+ material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );
+ material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );
+ }
+#endif
+IncidentLight directLight;
+#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )
+ PointLight pointLight;
+ #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0
+ PointLightShadow pointLightShadow;
+ #endif
+ #pragma unroll_loop_start
+ for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {
+ pointLight = pointLights[ i ];
+ getPointLightInfo( pointLight, geometryPosition, directLight );
+ #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )
+ pointLightShadow = pointLightShadows[ i ];
+ directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;
+ #endif
+ RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
+ }
+ #pragma unroll_loop_end
+#endif
+#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )
+ SpotLight spotLight;
+ vec4 spotColor;
+ vec3 spotLightCoord;
+ bool inSpotLightMap;
+ #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0
+ SpotLightShadow spotLightShadow;
+ #endif
+ #pragma unroll_loop_start
+ for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {
+ spotLight = spotLights[ i ];
+ getSpotLightInfo( spotLight, geometryPosition, directLight );
+ #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
+ #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX
+ #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
+ #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS
+ #else
+ #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
+ #endif
+ #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )
+ spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;
+ inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );
+ spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );
+ directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;
+ #endif
+ #undef SPOT_LIGHT_MAP_INDEX
+ #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
+ spotLightShadow = spotLightShadows[ i ];
+ directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
+ #endif
+ RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
+ }
+ #pragma unroll_loop_end
+#endif
+#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )
+ DirectionalLight directionalLight;
+ #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0
+ DirectionalLightShadow directionalLightShadow;
+ #endif
+ #pragma unroll_loop_start
+ for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
+ directionalLight = directionalLights[ i ];
+ getDirectionalLightInfo( directionalLight, directLight );
+ #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )
+ directionalLightShadow = directionalLightShadows[ i ];
+ directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
+ #endif
+ RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
+ }
+ #pragma unroll_loop_end
+#endif
+#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )
+ RectAreaLight rectAreaLight;
+ #pragma unroll_loop_start
+ for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {
+ rectAreaLight = rectAreaLights[ i ];
+ RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
+ }
+ #pragma unroll_loop_end
+#endif
+#if defined( RE_IndirectDiffuse )
+ vec3 iblIrradiance = vec3( 0.0 );
+ vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );
+ #if defined( USE_LIGHT_PROBES )
+ irradiance += getLightProbeIrradiance( lightProbe, geometryNormal );
+ #endif
+ #if ( NUM_HEMI_LIGHTS > 0 )
+ #pragma unroll_loop_start
+ for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {
+ irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );
+ }
+ #pragma unroll_loop_end
+ #endif
+#endif
+#if defined( RE_IndirectSpecular )
+ vec3 radiance = vec3( 0.0 );
+ vec3 clearcoatRadiance = vec3( 0.0 );
+#endif`,gSe=`#if defined( RE_IndirectDiffuse )
+ #ifdef USE_LIGHTMAP
+ vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
+ vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;
+ irradiance += lightMapIrradiance;
+ #endif
+ #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )
+ iblIrradiance += getIBLIrradiance( geometryNormal );
+ #endif
+#endif
+#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )
+ #ifdef USE_ANISOTROPY
+ radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );
+ #else
+ radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );
+ #endif
+ #ifdef USE_CLEARCOAT
+ clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );
+ #endif
+#endif`,vSe=`#if defined( RE_IndirectDiffuse )
+ RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
+#endif
+#if defined( RE_IndirectSpecular )
+ RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
+#endif`,ySe=`#if defined( USE_LOGDEPTHBUF )
+ gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
+#endif`,wSe=`#if defined( USE_LOGDEPTHBUF )
+ uniform float logDepthBufFC;
+ varying float vFragDepth;
+ varying float vIsPerspective;
+#endif`,_Se=`#ifdef USE_LOGDEPTHBUF
+ varying float vFragDepth;
+ varying float vIsPerspective;
+#endif`,MSe=`#ifdef USE_LOGDEPTHBUF
+ vFragDepth = 1.0 + gl_Position.w;
+ vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );
+#endif`,xSe=`#ifdef USE_MAP
+ vec4 sampledDiffuseColor = texture2D( map, vMapUv );
+ #ifdef DECODE_VIDEO_TEXTURE
+ sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );
+
+ #endif
+ diffuseColor *= sampledDiffuseColor;
+#endif`,bSe=`#ifdef USE_MAP
+ uniform sampler2D map;
+#endif`,SSe=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
+ #if defined( USE_POINTS_UV )
+ vec2 uv = vUv;
+ #else
+ vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;
+ #endif
+#endif
+#ifdef USE_MAP
+ diffuseColor *= texture2D( map, uv );
+#endif
+#ifdef USE_ALPHAMAP
+ diffuseColor.a *= texture2D( alphaMap, uv ).g;
+#endif`,CSe=`#if defined( USE_POINTS_UV )
+ varying vec2 vUv;
+#else
+ #if defined( USE_MAP ) || defined( USE_ALPHAMAP )
+ uniform mat3 uvTransform;
+ #endif
+#endif
+#ifdef USE_MAP
+ uniform sampler2D map;
+#endif
+#ifdef USE_ALPHAMAP
+ uniform sampler2D alphaMap;
+#endif`,ESe=`float metalnessFactor = metalness;
+#ifdef USE_METALNESSMAP
+ vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );
+ metalnessFactor *= texelMetalness.b;
+#endif`,ASe=`#ifdef USE_METALNESSMAP
+ uniform sampler2D metalnessMap;
+#endif`,TSe=`#ifdef USE_INSTANCING_MORPH
+ float morphTargetInfluences[ MORPHTARGETS_COUNT ];
+ float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;
+ for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
+ morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;
+ }
+#endif`,ISe=`#if defined( USE_MORPHCOLORS )
+ vColor *= morphTargetBaseInfluence;
+ for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
+ #if defined( USE_COLOR_ALPHA )
+ if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];
+ #elif defined( USE_COLOR )
+ if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];
+ #endif
+ }
+#endif`,LSe=`#ifdef USE_MORPHNORMALS
+ objectNormal *= morphTargetBaseInfluence;
+ for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
+ if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];
+ }
+#endif`,RSe=`#ifdef USE_MORPHTARGETS
+ #ifndef USE_INSTANCING_MORPH
+ uniform float morphTargetBaseInfluence;
+ uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];
+ #endif
+ uniform sampler2DArray morphTargetsTexture;
+ uniform ivec2 morphTargetsTextureSize;
+ vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {
+ int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;
+ int y = texelIndex / morphTargetsTextureSize.x;
+ int x = texelIndex - y * morphTargetsTextureSize.x;
+ ivec3 morphUV = ivec3( x, y, morphTargetIndex );
+ return texelFetch( morphTargetsTexture, morphUV, 0 );
+ }
+#endif`,PSe=`#ifdef USE_MORPHTARGETS
+ transformed *= morphTargetBaseInfluence;
+ for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
+ if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];
+ }
+#endif`,DSe=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;
+#ifdef FLAT_SHADED
+ vec3 fdx = dFdx( vViewPosition );
+ vec3 fdy = dFdy( vViewPosition );
+ vec3 normal = normalize( cross( fdx, fdy ) );
+#else
+ vec3 normal = normalize( vNormal );
+ #ifdef DOUBLE_SIDED
+ normal *= faceDirection;
+ #endif
+#endif
+#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )
+ #ifdef USE_TANGENT
+ mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );
+ #else
+ mat3 tbn = getTangentFrame( - vViewPosition, normal,
+ #if defined( USE_NORMALMAP )
+ vNormalMapUv
+ #elif defined( USE_CLEARCOAT_NORMALMAP )
+ vClearcoatNormalMapUv
+ #else
+ vUv
+ #endif
+ );
+ #endif
+ #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )
+ tbn[0] *= faceDirection;
+ tbn[1] *= faceDirection;
+ #endif
+#endif
+#ifdef USE_CLEARCOAT_NORMALMAP
+ #ifdef USE_TANGENT
+ mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );
+ #else
+ mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );
+ #endif
+ #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )
+ tbn2[0] *= faceDirection;
+ tbn2[1] *= faceDirection;
+ #endif
+#endif
+vec3 nonPerturbedNormal = normal;`,NSe=`#ifdef USE_NORMALMAP_OBJECTSPACE
+ normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
+ #ifdef FLIP_SIDED
+ normal = - normal;
+ #endif
+ #ifdef DOUBLE_SIDED
+ normal = normal * faceDirection;
+ #endif
+ normal = normalize( normalMatrix * normal );
+#elif defined( USE_NORMALMAP_TANGENTSPACE )
+ vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
+ mapN.xy *= normalScale;
+ normal = normalize( tbn * mapN );
+#elif defined( USE_BUMPMAP )
+ normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );
+#endif`,kSe=`#ifndef FLAT_SHADED
+ varying vec3 vNormal;
+ #ifdef USE_TANGENT
+ varying vec3 vTangent;
+ varying vec3 vBitangent;
+ #endif
+#endif`,BSe=`#ifndef FLAT_SHADED
+ varying vec3 vNormal;
+ #ifdef USE_TANGENT
+ varying vec3 vTangent;
+ varying vec3 vBitangent;
+ #endif
+#endif`,OSe=`#ifndef FLAT_SHADED
+ vNormal = normalize( transformedNormal );
+ #ifdef USE_TANGENT
+ vTangent = normalize( transformedTangent );
+ vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );
+ #endif
+#endif`,USe=`#ifdef USE_NORMALMAP
+ uniform sampler2D normalMap;
+ uniform vec2 normalScale;
+#endif
+#ifdef USE_NORMALMAP_OBJECTSPACE
+ uniform mat3 normalMatrix;
+#endif
+#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )
+ mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {
+ vec3 q0 = dFdx( eye_pos.xyz );
+ vec3 q1 = dFdy( eye_pos.xyz );
+ vec2 st0 = dFdx( uv.st );
+ vec2 st1 = dFdy( uv.st );
+ vec3 N = surf_norm;
+ vec3 q1perp = cross( q1, N );
+ vec3 q0perp = cross( N, q0 );
+ vec3 T = q1perp * st0.x + q0perp * st1.x;
+ vec3 B = q1perp * st0.y + q0perp * st1.y;
+ float det = max( dot( T, T ), dot( B, B ) );
+ float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );
+ return mat3( T * scale, B * scale, N );
+ }
+#endif`,FSe=`#ifdef USE_CLEARCOAT
+ vec3 clearcoatNormal = nonPerturbedNormal;
+#endif`,jSe=`#ifdef USE_CLEARCOAT_NORMALMAP
+ vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;
+ clearcoatMapN.xy *= clearcoatNormalScale;
+ clearcoatNormal = normalize( tbn2 * clearcoatMapN );
+#endif`,zSe=`#ifdef USE_CLEARCOATMAP
+ uniform sampler2D clearcoatMap;
+#endif
+#ifdef USE_CLEARCOAT_NORMALMAP
+ uniform sampler2D clearcoatNormalMap;
+ uniform vec2 clearcoatNormalScale;
+#endif
+#ifdef USE_CLEARCOAT_ROUGHNESSMAP
+ uniform sampler2D clearcoatRoughnessMap;
+#endif`,HSe=`#ifdef USE_IRIDESCENCEMAP
+ uniform sampler2D iridescenceMap;
+#endif
+#ifdef USE_IRIDESCENCE_THICKNESSMAP
+ uniform sampler2D iridescenceThicknessMap;
+#endif`,GSe=`#ifdef OPAQUE
+diffuseColor.a = 1.0;
+#endif
+#ifdef USE_TRANSMISSION
+diffuseColor.a *= material.transmissionAlpha;
+#endif
+gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,VSe=`vec3 packNormalToRGB( const in vec3 normal ) {
+ return normalize( normal ) * 0.5 + 0.5;
+}
+vec3 unpackRGBToNormal( const in vec3 rgb ) {
+ return 2.0 * rgb.xyz - 1.0;
+}
+const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.;
+const float Inv255 = 1. / 255.;
+const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );
+const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );
+const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );
+const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );
+vec4 packDepthToRGBA( const in float v ) {
+ if( v <= 0.0 )
+ return vec4( 0., 0., 0., 0. );
+ if( v >= 1.0 )
+ return vec4( 1., 1., 1., 1. );
+ float vuf;
+ float af = modf( v * PackFactors.a, vuf );
+ float bf = modf( vuf * ShiftRight8, vuf );
+ float gf = modf( vuf * ShiftRight8, vuf );
+ return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );
+}
+vec3 packDepthToRGB( const in float v ) {
+ if( v <= 0.0 )
+ return vec3( 0., 0., 0. );
+ if( v >= 1.0 )
+ return vec3( 1., 1., 1. );
+ float vuf;
+ float bf = modf( v * PackFactors.b, vuf );
+ float gf = modf( vuf * ShiftRight8, vuf );
+ return vec3( vuf * Inv255, gf * PackUpscale, bf );
+}
+vec2 packDepthToRG( const in float v ) {
+ if( v <= 0.0 )
+ return vec2( 0., 0. );
+ if( v >= 1.0 )
+ return vec2( 1., 1. );
+ float vuf;
+ float gf = modf( v * 256., vuf );
+ return vec2( vuf * Inv255, gf );
+}
+float unpackRGBAToDepth( const in vec4 v ) {
+ return dot( v, UnpackFactors4 );
+}
+float unpackRGBToDepth( const in vec3 v ) {
+ return dot( v, UnpackFactors3 );
+}
+float unpackRGToDepth( const in vec2 v ) {
+ return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;
+}
+vec4 pack2HalfToRGBA( const in vec2 v ) {
+ vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );
+ return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );
+}
+vec2 unpackRGBATo2Half( const in vec4 v ) {
+ return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );
+}
+float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {
+ return ( viewZ + near ) / ( near - far );
+}
+float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {
+ return depth * ( near - far ) - near;
+}
+float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {
+ return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );
+}
+float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {
+ return ( near * far ) / ( ( far - near ) * depth - far );
+}`,WSe=`#ifdef PREMULTIPLIED_ALPHA
+ gl_FragColor.rgb *= gl_FragColor.a;
+#endif`,$Se=`vec4 mvPosition = vec4( transformed, 1.0 );
+#ifdef USE_BATCHING
+ mvPosition = batchingMatrix * mvPosition;
+#endif
+#ifdef USE_INSTANCING
+ mvPosition = instanceMatrix * mvPosition;
+#endif
+mvPosition = modelViewMatrix * mvPosition;
+gl_Position = projectionMatrix * mvPosition;`,JSe=`#ifdef DITHERING
+ gl_FragColor.rgb = dithering( gl_FragColor.rgb );
+#endif`,YSe=`#ifdef DITHERING
+ vec3 dithering( vec3 color ) {
+ float grid_position = rand( gl_FragCoord.xy );
+ vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );
+ dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );
+ return color + dither_shift_RGB;
+ }
+#endif`,QSe=`float roughnessFactor = roughness;
+#ifdef USE_ROUGHNESSMAP
+ vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );
+ roughnessFactor *= texelRoughness.g;
+#endif`,XSe=`#ifdef USE_ROUGHNESSMAP
+ uniform sampler2D roughnessMap;
+#endif`,KSe=`#if NUM_SPOT_LIGHT_COORDS > 0
+ varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
+#endif
+#if NUM_SPOT_LIGHT_MAPS > 0
+ uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];
+#endif
+#ifdef USE_SHADOWMAP
+ #if NUM_DIR_LIGHT_SHADOWS > 0
+ uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];
+ varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
+ struct DirectionalLightShadow {
+ float shadowIntensity;
+ float shadowBias;
+ float shadowNormalBias;
+ float shadowRadius;
+ vec2 shadowMapSize;
+ };
+ uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
+ #endif
+ #if NUM_SPOT_LIGHT_SHADOWS > 0
+ uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];
+ struct SpotLightShadow {
+ float shadowIntensity;
+ float shadowBias;
+ float shadowNormalBias;
+ float shadowRadius;
+ vec2 shadowMapSize;
+ };
+ uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
+ #endif
+ #if NUM_POINT_LIGHT_SHADOWS > 0
+ uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];
+ varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
+ struct PointLightShadow {
+ float shadowIntensity;
+ float shadowBias;
+ float shadowNormalBias;
+ float shadowRadius;
+ vec2 shadowMapSize;
+ float shadowCameraNear;
+ float shadowCameraFar;
+ };
+ uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
+ #endif
+ float texture2DCompare( sampler2D depths, vec2 uv, float compare ) {
+ return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );
+ }
+ vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {
+ return unpackRGBATo2Half( texture2D( shadow, uv ) );
+ }
+ float VSMShadow (sampler2D shadow, vec2 uv, float compare ){
+ float occlusion = 1.0;
+ vec2 distribution = texture2DDistribution( shadow, uv );
+ float hard_shadow = step( compare , distribution.x );
+ if (hard_shadow != 1.0 ) {
+ float distance = compare - distribution.x ;
+ float variance = max( 0.00000, distribution.y * distribution.y );
+ float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );
+ }
+ return occlusion;
+ }
+ float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
+ float shadow = 1.0;
+ shadowCoord.xyz /= shadowCoord.w;
+ shadowCoord.z += shadowBias;
+ bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;
+ bool frustumTest = inFrustum && shadowCoord.z <= 1.0;
+ if ( frustumTest ) {
+ #if defined( SHADOWMAP_TYPE_PCF )
+ vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
+ float dx0 = - texelSize.x * shadowRadius;
+ float dy0 = - texelSize.y * shadowRadius;
+ float dx1 = + texelSize.x * shadowRadius;
+ float dy1 = + texelSize.y * shadowRadius;
+ float dx2 = dx0 / 2.0;
+ float dy2 = dy0 / 2.0;
+ float dx3 = dx1 / 2.0;
+ float dy3 = dy1 / 2.0;
+ shadow = (
+ texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +
+ texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +
+ texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +
+ texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +
+ texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +
+ texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +
+ texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +
+ texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +
+ texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +
+ texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +
+ texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +
+ texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +
+ texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +
+ texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +
+ texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +
+ texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +
+ texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )
+ ) * ( 1.0 / 17.0 );
+ #elif defined( SHADOWMAP_TYPE_PCF_SOFT )
+ vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
+ float dx = texelSize.x;
+ float dy = texelSize.y;
+ vec2 uv = shadowCoord.xy;
+ vec2 f = fract( uv * shadowMapSize + 0.5 );
+ uv -= f * texelSize;
+ shadow = (
+ texture2DCompare( shadowMap, uv, shadowCoord.z ) +
+ texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +
+ texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +
+ texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +
+ mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),
+ texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),
+ f.x ) +
+ mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),
+ texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),
+ f.x ) +
+ mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),
+ texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),
+ f.y ) +
+ mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),
+ texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),
+ f.y ) +
+ mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),
+ texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),
+ f.x ),
+ mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),
+ texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),
+ f.x ),
+ f.y )
+ ) * ( 1.0 / 9.0 );
+ #elif defined( SHADOWMAP_TYPE_VSM )
+ shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );
+ #else
+ shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );
+ #endif
+ }
+ return mix( 1.0, shadow, shadowIntensity );
+ }
+ vec2 cubeToUV( vec3 v, float texelSizeY ) {
+ vec3 absV = abs( v );
+ float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );
+ absV *= scaleToCube;
+ v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );
+ vec2 planar = v.xy;
+ float almostATexel = 1.5 * texelSizeY;
+ float almostOne = 1.0 - almostATexel;
+ if ( absV.z >= almostOne ) {
+ if ( v.z > 0.0 )
+ planar.x = 4.0 - v.x;
+ } else if ( absV.x >= almostOne ) {
+ float signX = sign( v.x );
+ planar.x = v.z * signX + 2.0 * signX;
+ } else if ( absV.y >= almostOne ) {
+ float signY = sign( v.y );
+ planar.x = v.x + 2.0 * signY + 2.0;
+ planar.y = v.z * signY - 2.0;
+ }
+ return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );
+ }
+ float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {
+ float shadow = 1.0;
+ vec3 lightToPosition = shadowCoord.xyz;
+
+ float lightToPositionLength = length( lightToPosition );
+ if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {
+ float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias;
+ vec3 bd3D = normalize( lightToPosition );
+ vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );
+ #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )
+ vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;
+ shadow = (
+ texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +
+ texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +
+ texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +
+ texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +
+ texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +
+ texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +
+ texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +
+ texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +
+ texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )
+ ) * ( 1.0 / 9.0 );
+ #else
+ shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );
+ #endif
+ }
+ return mix( 1.0, shadow, shadowIntensity );
+ }
+#endif`,ZSe=`#if NUM_SPOT_LIGHT_COORDS > 0
+ uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];
+ varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
+#endif
+#ifdef USE_SHADOWMAP
+ #if NUM_DIR_LIGHT_SHADOWS > 0
+ uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];
+ varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
+ struct DirectionalLightShadow {
+ float shadowIntensity;
+ float shadowBias;
+ float shadowNormalBias;
+ float shadowRadius;
+ vec2 shadowMapSize;
+ };
+ uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
+ #endif
+ #if NUM_SPOT_LIGHT_SHADOWS > 0
+ struct SpotLightShadow {
+ float shadowIntensity;
+ float shadowBias;
+ float shadowNormalBias;
+ float shadowRadius;
+ vec2 shadowMapSize;
+ };
+ uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
+ #endif
+ #if NUM_POINT_LIGHT_SHADOWS > 0
+ uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];
+ varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
+ struct PointLightShadow {
+ float shadowIntensity;
+ float shadowBias;
+ float shadowNormalBias;
+ float shadowRadius;
+ vec2 shadowMapSize;
+ float shadowCameraNear;
+ float shadowCameraFar;
+ };
+ uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
+ #endif
+#endif`,qSe=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )
+ vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
+ vec4 shadowWorldPosition;
+#endif
+#if defined( USE_SHADOWMAP )
+ #if NUM_DIR_LIGHT_SHADOWS > 0
+ #pragma unroll_loop_start
+ for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
+ shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );
+ vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;
+ }
+ #pragma unroll_loop_end
+ #endif
+ #if NUM_POINT_LIGHT_SHADOWS > 0
+ #pragma unroll_loop_start
+ for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
+ shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );
+ vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;
+ }
+ #pragma unroll_loop_end
+ #endif
+#endif
+#if NUM_SPOT_LIGHT_COORDS > 0
+ #pragma unroll_loop_start
+ for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {
+ shadowWorldPosition = worldPosition;
+ #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
+ shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;
+ #endif
+ vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;
+ }
+ #pragma unroll_loop_end
+#endif`,eCe=`float getShadowMask() {
+ float shadow = 1.0;
+ #ifdef USE_SHADOWMAP
+ #if NUM_DIR_LIGHT_SHADOWS > 0
+ DirectionalLightShadow directionalLight;
+ #pragma unroll_loop_start
+ for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
+ directionalLight = directionalLightShadows[ i ];
+ shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
+ }
+ #pragma unroll_loop_end
+ #endif
+ #if NUM_SPOT_LIGHT_SHADOWS > 0
+ SpotLightShadow spotLight;
+ #pragma unroll_loop_start
+ for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {
+ spotLight = spotLightShadows[ i ];
+ shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
+ }
+ #pragma unroll_loop_end
+ #endif
+ #if NUM_POINT_LIGHT_SHADOWS > 0
+ PointLightShadow pointLight;
+ #pragma unroll_loop_start
+ for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
+ pointLight = pointLightShadows[ i ];
+ shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;
+ }
+ #pragma unroll_loop_end
+ #endif
+ #endif
+ return shadow;
+}`,tCe=`#ifdef USE_SKINNING
+ mat4 boneMatX = getBoneMatrix( skinIndex.x );
+ mat4 boneMatY = getBoneMatrix( skinIndex.y );
+ mat4 boneMatZ = getBoneMatrix( skinIndex.z );
+ mat4 boneMatW = getBoneMatrix( skinIndex.w );
+#endif`,nCe=`#ifdef USE_SKINNING
+ uniform mat4 bindMatrix;
+ uniform mat4 bindMatrixInverse;
+ uniform highp sampler2D boneTexture;
+ mat4 getBoneMatrix( const in float i ) {
+ int size = textureSize( boneTexture, 0 ).x;
+ int j = int( i ) * 4;
+ int x = j % size;
+ int y = j / size;
+ vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );
+ vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );
+ vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );
+ vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );
+ return mat4( v1, v2, v3, v4 );
+ }
+#endif`,rCe=`#ifdef USE_SKINNING
+ vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );
+ vec4 skinned = vec4( 0.0 );
+ skinned += boneMatX * skinVertex * skinWeight.x;
+ skinned += boneMatY * skinVertex * skinWeight.y;
+ skinned += boneMatZ * skinVertex * skinWeight.z;
+ skinned += boneMatW * skinVertex * skinWeight.w;
+ transformed = ( bindMatrixInverse * skinned ).xyz;
+#endif`,iCe=`#ifdef USE_SKINNING
+ mat4 skinMatrix = mat4( 0.0 );
+ skinMatrix += skinWeight.x * boneMatX;
+ skinMatrix += skinWeight.y * boneMatY;
+ skinMatrix += skinWeight.z * boneMatZ;
+ skinMatrix += skinWeight.w * boneMatW;
+ skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;
+ objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;
+ #ifdef USE_TANGENT
+ objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;
+ #endif
+#endif`,sCe=`float specularStrength;
+#ifdef USE_SPECULARMAP
+ vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );
+ specularStrength = texelSpecular.r;
+#else
+ specularStrength = 1.0;
+#endif`,oCe=`#ifdef USE_SPECULARMAP
+ uniform sampler2D specularMap;
+#endif`,aCe=`#if defined( TONE_MAPPING )
+ gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );
+#endif`,lCe=`#ifndef saturate
+#define saturate( a ) clamp( a, 0.0, 1.0 )
+#endif
+uniform float toneMappingExposure;
+vec3 LinearToneMapping( vec3 color ) {
+ return saturate( toneMappingExposure * color );
+}
+vec3 ReinhardToneMapping( vec3 color ) {
+ color *= toneMappingExposure;
+ return saturate( color / ( vec3( 1.0 ) + color ) );
+}
+vec3 OptimizedCineonToneMapping( vec3 color ) {
+ color *= toneMappingExposure;
+ color = max( vec3( 0.0 ), color - 0.004 );
+ return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );
+}
+vec3 RRTAndODTFit( vec3 v ) {
+ vec3 a = v * ( v + 0.0245786 ) - 0.000090537;
+ vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;
+ return a / b;
+}
+vec3 ACESFilmicToneMapping( vec3 color ) {
+ const mat3 ACESInputMat = mat3(
+ vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ),
+ vec3( 0.04823, 0.01566, 0.83777 )
+ );
+ const mat3 ACESOutputMat = mat3(
+ vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ),
+ vec3( -0.07367, -0.00605, 1.07602 )
+ );
+ color *= toneMappingExposure / 0.6;
+ color = ACESInputMat * color;
+ color = RRTAndODTFit( color );
+ color = ACESOutputMat * color;
+ return saturate( color );
+}
+const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(
+ vec3( 1.6605, - 0.1246, - 0.0182 ),
+ vec3( - 0.5876, 1.1329, - 0.1006 ),
+ vec3( - 0.0728, - 0.0083, 1.1187 )
+);
+const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(
+ vec3( 0.6274, 0.0691, 0.0164 ),
+ vec3( 0.3293, 0.9195, 0.0880 ),
+ vec3( 0.0433, 0.0113, 0.8956 )
+);
+vec3 agxDefaultContrastApprox( vec3 x ) {
+ vec3 x2 = x * x;
+ vec3 x4 = x2 * x2;
+ return + 15.5 * x4 * x2
+ - 40.14 * x4 * x
+ + 31.96 * x4
+ - 6.868 * x2 * x
+ + 0.4298 * x2
+ + 0.1191 * x
+ - 0.00232;
+}
+vec3 AgXToneMapping( vec3 color ) {
+ const mat3 AgXInsetMatrix = mat3(
+ vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),
+ vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),
+ vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )
+ );
+ const mat3 AgXOutsetMatrix = mat3(
+ vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),
+ vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),
+ vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )
+ );
+ const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069;
+ color *= toneMappingExposure;
+ color = LINEAR_SRGB_TO_LINEAR_REC2020 * color;
+ color = AgXInsetMatrix * color;
+ color = max( color, 1e-10 ); color = log2( color );
+ color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );
+ color = clamp( color, 0.0, 1.0 );
+ color = agxDefaultContrastApprox( color );
+ color = AgXOutsetMatrix * color;
+ color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );
+ color = LINEAR_REC2020_TO_LINEAR_SRGB * color;
+ color = clamp( color, 0.0, 1.0 );
+ return color;
+}
+vec3 NeutralToneMapping( vec3 color ) {
+ const float StartCompression = 0.8 - 0.04;
+ const float Desaturation = 0.15;
+ color *= toneMappingExposure;
+ float x = min( color.r, min( color.g, color.b ) );
+ float offset = x < 0.08 ? x - 6.25 * x * x : 0.04;
+ color -= offset;
+ float peak = max( color.r, max( color.g, color.b ) );
+ if ( peak < StartCompression ) return color;
+ float d = 1. - StartCompression;
+ float newPeak = 1. - d * d / ( peak + d - StartCompression );
+ color *= newPeak / peak;
+ float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );
+ return mix( color, vec3( newPeak ), g );
+}
+vec3 CustomToneMapping( vec3 color ) { return color; }`,cCe=`#ifdef USE_TRANSMISSION
+ material.transmission = transmission;
+ material.transmissionAlpha = 1.0;
+ material.thickness = thickness;
+ material.attenuationDistance = attenuationDistance;
+ material.attenuationColor = attenuationColor;
+ #ifdef USE_TRANSMISSIONMAP
+ material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;
+ #endif
+ #ifdef USE_THICKNESSMAP
+ material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;
+ #endif
+ vec3 pos = vWorldPosition;
+ vec3 v = normalize( cameraPosition - pos );
+ vec3 n = inverseTransformDirection( normal, viewMatrix );
+ vec4 transmitted = getIBLVolumeRefraction(
+ n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,
+ pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,
+ material.attenuationColor, material.attenuationDistance );
+ material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );
+ totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );
+#endif`,uCe=`#ifdef USE_TRANSMISSION
+ uniform float transmission;
+ uniform float thickness;
+ uniform float attenuationDistance;
+ uniform vec3 attenuationColor;
+ #ifdef USE_TRANSMISSIONMAP
+ uniform sampler2D transmissionMap;
+ #endif
+ #ifdef USE_THICKNESSMAP
+ uniform sampler2D thicknessMap;
+ #endif
+ uniform vec2 transmissionSamplerSize;
+ uniform sampler2D transmissionSamplerMap;
+ uniform mat4 modelMatrix;
+ uniform mat4 projectionMatrix;
+ varying vec3 vWorldPosition;
+ float w0( float a ) {
+ return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );
+ }
+ float w1( float a ) {
+ return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );
+ }
+ float w2( float a ){
+ return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );
+ }
+ float w3( float a ) {
+ return ( 1.0 / 6.0 ) * ( a * a * a );
+ }
+ float g0( float a ) {
+ return w0( a ) + w1( a );
+ }
+ float g1( float a ) {
+ return w2( a ) + w3( a );
+ }
+ float h0( float a ) {
+ return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );
+ }
+ float h1( float a ) {
+ return 1.0 + w3( a ) / ( w2( a ) + w3( a ) );
+ }
+ vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {
+ uv = uv * texelSize.zw + 0.5;
+ vec2 iuv = floor( uv );
+ vec2 fuv = fract( uv );
+ float g0x = g0( fuv.x );
+ float g1x = g1( fuv.x );
+ float h0x = h0( fuv.x );
+ float h1x = h1( fuv.x );
+ float h0y = h0( fuv.y );
+ float h1y = h1( fuv.y );
+ vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;
+ vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;
+ vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;
+ vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;
+ return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +
+ g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );
+ }
+ vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {
+ vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );
+ vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );
+ vec2 fLodSizeInv = 1.0 / fLodSize;
+ vec2 cLodSizeInv = 1.0 / cLodSize;
+ vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );
+ vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );
+ return mix( fSample, cSample, fract( lod ) );
+ }
+ vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {
+ vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );
+ vec3 modelScale;
+ modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );
+ modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );
+ modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );
+ return normalize( refractionVector ) * thickness * modelScale;
+ }
+ float applyIorToRoughness( const in float roughness, const in float ior ) {
+ return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );
+ }
+ vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {
+ float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );
+ return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );
+ }
+ vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {
+ if ( isinf( attenuationDistance ) ) {
+ return vec3( 1.0 );
+ } else {
+ vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;
+ vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance;
+ }
+ }
+ vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,
+ const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,
+ const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,
+ const in vec3 attenuationColor, const in float attenuationDistance ) {
+ vec4 transmittedLight;
+ vec3 transmittance;
+ #ifdef USE_DISPERSION
+ float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;
+ vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );
+ for ( int i = 0; i < 3; i ++ ) {
+ vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );
+ vec3 refractedRayExit = position + transmissionRay;
+
+ vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );
+ vec2 refractionCoords = ndcPos.xy / ndcPos.w;
+ refractionCoords += 1.0;
+ refractionCoords /= 2.0;
+
+ vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );
+ transmittedLight[ i ] = transmissionSample[ i ];
+ transmittedLight.a += transmissionSample.a;
+ transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];
+ }
+ transmittedLight.a /= 3.0;
+
+ #else
+
+ vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );
+ vec3 refractedRayExit = position + transmissionRay;
+ vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );
+ vec2 refractionCoords = ndcPos.xy / ndcPos.w;
+ refractionCoords += 1.0;
+ refractionCoords /= 2.0;
+ transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );
+ transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );
+
+ #endif
+ vec3 attenuatedColor = transmittance * transmittedLight.rgb;
+ vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );
+ float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;
+ return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );
+ }
+#endif`,fCe=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
+ varying vec2 vUv;
+#endif
+#ifdef USE_MAP
+ varying vec2 vMapUv;
+#endif
+#ifdef USE_ALPHAMAP
+ varying vec2 vAlphaMapUv;
+#endif
+#ifdef USE_LIGHTMAP
+ varying vec2 vLightMapUv;
+#endif
+#ifdef USE_AOMAP
+ varying vec2 vAoMapUv;
+#endif
+#ifdef USE_BUMPMAP
+ varying vec2 vBumpMapUv;
+#endif
+#ifdef USE_NORMALMAP
+ varying vec2 vNormalMapUv;
+#endif
+#ifdef USE_EMISSIVEMAP
+ varying vec2 vEmissiveMapUv;
+#endif
+#ifdef USE_METALNESSMAP
+ varying vec2 vMetalnessMapUv;
+#endif
+#ifdef USE_ROUGHNESSMAP
+ varying vec2 vRoughnessMapUv;
+#endif
+#ifdef USE_ANISOTROPYMAP
+ varying vec2 vAnisotropyMapUv;
+#endif
+#ifdef USE_CLEARCOATMAP
+ varying vec2 vClearcoatMapUv;
+#endif
+#ifdef USE_CLEARCOAT_NORMALMAP
+ varying vec2 vClearcoatNormalMapUv;
+#endif
+#ifdef USE_CLEARCOAT_ROUGHNESSMAP
+ varying vec2 vClearcoatRoughnessMapUv;
+#endif
+#ifdef USE_IRIDESCENCEMAP
+ varying vec2 vIridescenceMapUv;
+#endif
+#ifdef USE_IRIDESCENCE_THICKNESSMAP
+ varying vec2 vIridescenceThicknessMapUv;
+#endif
+#ifdef USE_SHEEN_COLORMAP
+ varying vec2 vSheenColorMapUv;
+#endif
+#ifdef USE_SHEEN_ROUGHNESSMAP
+ varying vec2 vSheenRoughnessMapUv;
+#endif
+#ifdef USE_SPECULARMAP
+ varying vec2 vSpecularMapUv;
+#endif
+#ifdef USE_SPECULAR_COLORMAP
+ varying vec2 vSpecularColorMapUv;
+#endif
+#ifdef USE_SPECULAR_INTENSITYMAP
+ varying vec2 vSpecularIntensityMapUv;
+#endif
+#ifdef USE_TRANSMISSIONMAP
+ uniform mat3 transmissionMapTransform;
+ varying vec2 vTransmissionMapUv;
+#endif
+#ifdef USE_THICKNESSMAP
+ uniform mat3 thicknessMapTransform;
+ varying vec2 vThicknessMapUv;
+#endif`,dCe=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
+ varying vec2 vUv;
+#endif
+#ifdef USE_MAP
+ uniform mat3 mapTransform;
+ varying vec2 vMapUv;
+#endif
+#ifdef USE_ALPHAMAP
+ uniform mat3 alphaMapTransform;
+ varying vec2 vAlphaMapUv;
+#endif
+#ifdef USE_LIGHTMAP
+ uniform mat3 lightMapTransform;
+ varying vec2 vLightMapUv;
+#endif
+#ifdef USE_AOMAP
+ uniform mat3 aoMapTransform;
+ varying vec2 vAoMapUv;
+#endif
+#ifdef USE_BUMPMAP
+ uniform mat3 bumpMapTransform;
+ varying vec2 vBumpMapUv;
+#endif
+#ifdef USE_NORMALMAP
+ uniform mat3 normalMapTransform;
+ varying vec2 vNormalMapUv;
+#endif
+#ifdef USE_DISPLACEMENTMAP
+ uniform mat3 displacementMapTransform;
+ varying vec2 vDisplacementMapUv;
+#endif
+#ifdef USE_EMISSIVEMAP
+ uniform mat3 emissiveMapTransform;
+ varying vec2 vEmissiveMapUv;
+#endif
+#ifdef USE_METALNESSMAP
+ uniform mat3 metalnessMapTransform;
+ varying vec2 vMetalnessMapUv;
+#endif
+#ifdef USE_ROUGHNESSMAP
+ uniform mat3 roughnessMapTransform;
+ varying vec2 vRoughnessMapUv;
+#endif
+#ifdef USE_ANISOTROPYMAP
+ uniform mat3 anisotropyMapTransform;
+ varying vec2 vAnisotropyMapUv;
+#endif
+#ifdef USE_CLEARCOATMAP
+ uniform mat3 clearcoatMapTransform;
+ varying vec2 vClearcoatMapUv;
+#endif
+#ifdef USE_CLEARCOAT_NORMALMAP
+ uniform mat3 clearcoatNormalMapTransform;
+ varying vec2 vClearcoatNormalMapUv;
+#endif
+#ifdef USE_CLEARCOAT_ROUGHNESSMAP
+ uniform mat3 clearcoatRoughnessMapTransform;
+ varying vec2 vClearcoatRoughnessMapUv;
+#endif
+#ifdef USE_SHEEN_COLORMAP
+ uniform mat3 sheenColorMapTransform;
+ varying vec2 vSheenColorMapUv;
+#endif
+#ifdef USE_SHEEN_ROUGHNESSMAP
+ uniform mat3 sheenRoughnessMapTransform;
+ varying vec2 vSheenRoughnessMapUv;
+#endif
+#ifdef USE_IRIDESCENCEMAP
+ uniform mat3 iridescenceMapTransform;
+ varying vec2 vIridescenceMapUv;
+#endif
+#ifdef USE_IRIDESCENCE_THICKNESSMAP
+ uniform mat3 iridescenceThicknessMapTransform;
+ varying vec2 vIridescenceThicknessMapUv;
+#endif
+#ifdef USE_SPECULARMAP
+ uniform mat3 specularMapTransform;
+ varying vec2 vSpecularMapUv;
+#endif
+#ifdef USE_SPECULAR_COLORMAP
+ uniform mat3 specularColorMapTransform;
+ varying vec2 vSpecularColorMapUv;
+#endif
+#ifdef USE_SPECULAR_INTENSITYMAP
+ uniform mat3 specularIntensityMapTransform;
+ varying vec2 vSpecularIntensityMapUv;
+#endif
+#ifdef USE_TRANSMISSIONMAP
+ uniform mat3 transmissionMapTransform;
+ varying vec2 vTransmissionMapUv;
+#endif
+#ifdef USE_THICKNESSMAP
+ uniform mat3 thicknessMapTransform;
+ varying vec2 vThicknessMapUv;
+#endif`,hCe=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
+ vUv = vec3( uv, 1 ).xy;
+#endif
+#ifdef USE_MAP
+ vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;
+#endif
+#ifdef USE_ALPHAMAP
+ vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;
+#endif
+#ifdef USE_LIGHTMAP
+ vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;
+#endif
+#ifdef USE_AOMAP
+ vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;
+#endif
+#ifdef USE_BUMPMAP
+ vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;
+#endif
+#ifdef USE_NORMALMAP
+ vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;
+#endif
+#ifdef USE_DISPLACEMENTMAP
+ vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;
+#endif
+#ifdef USE_EMISSIVEMAP
+ vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;
+#endif
+#ifdef USE_METALNESSMAP
+ vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;
+#endif
+#ifdef USE_ROUGHNESSMAP
+ vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;
+#endif
+#ifdef USE_ANISOTROPYMAP
+ vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;
+#endif
+#ifdef USE_CLEARCOATMAP
+ vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;
+#endif
+#ifdef USE_CLEARCOAT_NORMALMAP
+ vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;
+#endif
+#ifdef USE_CLEARCOAT_ROUGHNESSMAP
+ vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;
+#endif
+#ifdef USE_IRIDESCENCEMAP
+ vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;
+#endif
+#ifdef USE_IRIDESCENCE_THICKNESSMAP
+ vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;
+#endif
+#ifdef USE_SHEEN_COLORMAP
+ vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;
+#endif
+#ifdef USE_SHEEN_ROUGHNESSMAP
+ vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;
+#endif
+#ifdef USE_SPECULARMAP
+ vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;
+#endif
+#ifdef USE_SPECULAR_COLORMAP
+ vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;
+#endif
+#ifdef USE_SPECULAR_INTENSITYMAP
+ vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;
+#endif
+#ifdef USE_TRANSMISSIONMAP
+ vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;
+#endif
+#ifdef USE_THICKNESSMAP
+ vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;
+#endif`,pCe=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0
+ vec4 worldPosition = vec4( transformed, 1.0 );
+ #ifdef USE_BATCHING
+ worldPosition = batchingMatrix * worldPosition;
+ #endif
+ #ifdef USE_INSTANCING
+ worldPosition = instanceMatrix * worldPosition;
+ #endif
+ worldPosition = modelMatrix * worldPosition;
+#endif`;const mCe=`varying vec2 vUv;
+uniform mat3 uvTransform;
+void main() {
+ vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
+ gl_Position = vec4( position.xy, 1.0, 1.0 );
+}`,gCe=`uniform sampler2D t2D;
+uniform float backgroundIntensity;
+varying vec2 vUv;
+void main() {
+ vec4 texColor = texture2D( t2D, vUv );
+ #ifdef DECODE_VIDEO_TEXTURE
+ texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );
+ #endif
+ texColor.rgb *= backgroundIntensity;
+ gl_FragColor = texColor;
+ #include
+ #include
+}`,vCe=`varying vec3 vWorldDirection;
+#include
+void main() {
+ vWorldDirection = transformDirection( position, modelMatrix );
+ #include
+ #include
+ gl_Position.z = gl_Position.w;
+}`,yCe=`#ifdef ENVMAP_TYPE_CUBE
+ uniform samplerCube envMap;
+#elif defined( ENVMAP_TYPE_CUBE_UV )
+ uniform sampler2D envMap;
+#endif
+uniform float flipEnvMap;
+uniform float backgroundBlurriness;
+uniform float backgroundIntensity;
+uniform mat3 backgroundRotation;
+varying vec3 vWorldDirection;
+#include
+void main() {
+ #ifdef ENVMAP_TYPE_CUBE
+ vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );
+ #elif defined( ENVMAP_TYPE_CUBE_UV )
+ vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );
+ #else
+ vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );
+ #endif
+ texColor.rgb *= backgroundIntensity;
+ gl_FragColor = texColor;
+ #include
+ #include
+}`,wCe=`varying vec3 vWorldDirection;
+#include
+void main() {
+ vWorldDirection = transformDirection( position, modelMatrix );
+ #include
+ #include
+ gl_Position.z = gl_Position.w;
+}`,_Ce=`uniform samplerCube tCube;
+uniform float tFlip;
+uniform float opacity;
+varying vec3 vWorldDirection;
+void main() {
+ vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );
+ gl_FragColor = texColor;
+ gl_FragColor.a *= opacity;
+ #include
+ #include
+}`,MCe=`#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+varying vec2 vHighPrecisionZW;
+void main() {
+ #include
+ #include
+ #include
+ #include
+ #ifdef USE_DISPLACEMENTMAP
+ #include
+ #include
+ #include
+ #endif
+ #include
+ #include
+ #include
+ #include
+ #include
+ #include
+ #include
+ vHighPrecisionZW = gl_Position.zw;
+}`,xCe=`#if DEPTH_PACKING == 3200
+ uniform float opacity;
+#endif
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+varying vec2 vHighPrecisionZW;
+void main() {
+ vec4 diffuseColor = vec4( 1.0 );
+ #include
+ #if DEPTH_PACKING == 3200
+ diffuseColor.a = opacity;
+ #endif
+ #include
+ #include
+ #include
+ #include
+ #include
+ float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;
+ #if DEPTH_PACKING == 3200
+ gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );
+ #elif DEPTH_PACKING == 3201
+ gl_FragColor = packDepthToRGBA( fragCoordZ );
+ #elif DEPTH_PACKING == 3202
+ gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );
+ #elif DEPTH_PACKING == 3203
+ gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );
+ #endif
+}`,bCe=`#define DISTANCE
+varying vec3 vWorldPosition;
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+void main() {
+ #include
+ #include
+ #include
+ #include
+ #ifdef USE_DISPLACEMENTMAP
+ #include
+ #include
+ #include
+ #endif
+ #include
+ #include
+ #include
+ #include
+ #include
+ #include
+ #include
+ vWorldPosition = worldPosition.xyz;
+}`,SCe=`#define DISTANCE
+uniform vec3 referencePosition;
+uniform float nearDistance;
+uniform float farDistance;
+varying vec3 vWorldPosition;
+#include
+#include