diff --git a/_redirects b/_redirects new file mode 100644 index 0000000000000000000000000000000000000000..50a463356b7d89bc7f17cfe56003eab71b56d8ad --- /dev/null +++ b/_redirects @@ -0,0 +1 @@ +/* /index.html 200 \ No newline at end of file diff --git a/assets/example_images/Anime/1.jpg b/assets/example_images/Anime/1.jpg new file mode 100644 index 0000000000000000000000000000000000000000..3cdcd19c723762f461387d9673b4506e4acbf89e --- /dev/null +++ b/assets/example_images/Anime/1.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:85ecfa23e86c37e9bbcd24893ace2f07e1cce12b834316df055f6d44acc8851b +size 187704 diff --git a/assets/example_images/Anime/2.jpg b/assets/example_images/Anime/2.jpg new file mode 100644 index 0000000000000000000000000000000000000000..9259f1a8f589c395b658a25ba18335a1252bc785 --- /dev/null +++ b/assets/example_images/Anime/2.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:520cbbfddd4fa99c1a598ec204b9c1795a6e7cfe41222e4a0a38ed7ffe487e6d +size 106655 diff --git a/assets/example_images/Anime/3.jpg b/assets/example_images/Anime/3.jpg new file mode 100644 index 0000000000000000000000000000000000000000..15ccd7c17b0878913fc521a1e40a6e1b2c449a73 --- /dev/null +++ b/assets/example_images/Anime/3.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d0d7338c3942a7f840bb2b6aeeacba58cef4d0863afb4632329005b48f3a6c79 +size 108077 diff --git a/assets/example_images/Anime/4.jpg b/assets/example_images/Anime/4.jpg new file mode 100644 index 0000000000000000000000000000000000000000..2d9ea37c1124055fe3faec2af84d6643ef136b1a --- /dev/null +++ b/assets/example_images/Anime/4.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:54345eef3a8b477fc2841f1d8dc6a4f933395f13bebb5f9501cd8c56c745533a +size 144856 diff --git a/assets/example_images/Ghibli-Pixar/1.jpg b/assets/example_images/Ghibli-Pixar/1.jpg new file mode 100644 index 0000000000000000000000000000000000000000..99daedc3c61e093067560d3ec08539d6937001b8 --- /dev/null +++ b/assets/example_images/Ghibli-Pixar/1.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:be94d7baced0398ff6c8dcb3e3b04259ca33a1cf54e51480c1024d9a32f403e7 +size 109564 diff --git a/assets/example_images/Ghibli-Pixar/2.jpg b/assets/example_images/Ghibli-Pixar/2.jpg new file mode 100644 index 0000000000000000000000000000000000000000..6a65eeef9fca741448a4a472c56f08b339a5f83a --- /dev/null +++ b/assets/example_images/Ghibli-Pixar/2.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:33da31880d577332758d4a659db0aaecfe43fae386435e11a07e1cae21e1e0c3 +size 111995 diff --git a/assets/example_images/Ghibli-Pixar/3.jpg b/assets/example_images/Ghibli-Pixar/3.jpg new file mode 100644 index 0000000000000000000000000000000000000000..14d0092859182e2fe4e84709fbc091977e030fed Binary files /dev/null and b/assets/example_images/Ghibli-Pixar/3.jpg differ diff --git a/assets/example_images/Ghibli-Pixar/4.jpg b/assets/example_images/Ghibli-Pixar/4.jpg new file mode 100644 index 0000000000000000000000000000000000000000..6136f2503ca5bc47cbf789b894b7f0bd251a6070 --- /dev/null +++ b/assets/example_images/Ghibli-Pixar/4.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:745500fc4564c77d014c861877995ecfd36df6f6aa1f598cf96c9b1067593c67 +size 100756 diff --git a/assets/example_images/Misc/1.jpg b/assets/example_images/Misc/1.jpg new file mode 100644 index 0000000000000000000000000000000000000000..c26547e998496f26b6648eeea8700728d398ee2e --- /dev/null +++ b/assets/example_images/Misc/1.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2bdceb2f1688e5e26a6db49fbac8adcb82969b0c38d59e19e18e825916fdb238 +size 138706 diff --git a/assets/example_images/Misc/2.jpg b/assets/example_images/Misc/2.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ca89844a903f37f971780e611c3e1b9973ac3e34 Binary files /dev/null and b/assets/example_images/Misc/2.jpg differ diff --git a/assets/example_images/Misc/3.jpg b/assets/example_images/Misc/3.jpg new file mode 100644 index 0000000000000000000000000000000000000000..d87ffac1fde49531c5eb0cb31b83af46603fdc0b Binary files /dev/null and b/assets/example_images/Misc/3.jpg differ diff --git a/assets/example_images/Misc/4.jpg b/assets/example_images/Misc/4.jpg new file mode 100644 index 0000000000000000000000000000000000000000..8e09a6bda53755ff75f6dcda6428a7b21231a630 Binary files /dev/null and b/assets/example_images/Misc/4.jpg differ diff --git a/assets/example_images/Nature/1.jpg b/assets/example_images/Nature/1.jpg new file mode 100644 index 0000000000000000000000000000000000000000..de7084242fdda077def5651d48994f2e9f6b4595 --- /dev/null +++ b/assets/example_images/Nature/1.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f7f7a83c2ea2994449438fdbe6cc389b174b5704751ef32114e629d6450d09f5 +size 312821 diff --git a/assets/example_images/Nature/2.jpg b/assets/example_images/Nature/2.jpg new file mode 100644 index 0000000000000000000000000000000000000000..27f26ec25dd6e1adcce23179ad30d956565fc4d8 --- /dev/null +++ b/assets/example_images/Nature/2.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b888f620e2141a9c074f346ba0c5acd53b277617f6d287ca97625ec3dfc0723d +size 168218 diff --git a/assets/example_images/Nature/3.jpg b/assets/example_images/Nature/3.jpg new file mode 100644 index 0000000000000000000000000000000000000000..f4b8cad640621e4a9371497fee57d7a39131e908 Binary files /dev/null and b/assets/example_images/Nature/3.jpg differ diff --git a/assets/example_images/Nature/4.jpg b/assets/example_images/Nature/4.jpg new file mode 100644 index 0000000000000000000000000000000000000000..cb7dcc186055c9d25efb0f69d6b55cd0a5b3bfdd --- /dev/null +++ b/assets/example_images/Nature/4.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:48d1a8f31d41124acd1618af5a42de00a2f8eb273cf54bb309dacb7baafe5534 +size 172798 diff --git a/assets/example_images/Space/1.jpg b/assets/example_images/Space/1.jpg new file mode 100644 index 0000000000000000000000000000000000000000..fcb7ea9fdc83d23c5855df95288a8a7e67f521a1 Binary files /dev/null and b/assets/example_images/Space/1.jpg differ diff --git a/assets/example_images/Space/2.jpg b/assets/example_images/Space/2.jpg new file mode 100644 index 0000000000000000000000000000000000000000..5bdf25560705d9d22c8e727716fa2c13d19bdb52 --- /dev/null +++ b/assets/example_images/Space/2.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5b40e0b3fc2f7bd130480aa237861ede4e883edd3a93a4185ae4fdbe5c4f64d0 +size 197020 diff --git a/assets/example_images/Space/3.jpg b/assets/example_images/Space/3.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ec8598e8656b566a4621d5ff1854b5894166e7c2 --- /dev/null +++ b/assets/example_images/Space/3.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:46e76246b5982bc244e396211f14f1892f45ac733e0fdb8c3218c1603a8e3cc4 +size 167241 diff --git a/assets/example_images/Space/4.jpg b/assets/example_images/Space/4.jpg new file mode 100644 index 0000000000000000000000000000000000000000..4626ca58b28c49d45f92ce4e029a0027f6c252f5 --- /dev/null +++ b/assets/example_images/Space/4.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5c66bfd42db0d852b89f34297c2e745ca8026afd66b195ad83c301eca00d62ca +size 124201 diff --git a/assets/example_images/Streets/1.jpg b/assets/example_images/Streets/1.jpg new file mode 100644 index 0000000000000000000000000000000000000000..6bd7487a91f9ef486732f177f89ea700472fac40 --- /dev/null +++ b/assets/example_images/Streets/1.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1f4a9b156c22514f7c5e169de962f6aa5768576be677337388b252f86dafb222 +size 208379 diff --git a/assets/example_images/Streets/2.jpg b/assets/example_images/Streets/2.jpg new file mode 100644 index 0000000000000000000000000000000000000000..767989574dede8c816a48e64a000ac7e0c1b2fa9 --- /dev/null +++ b/assets/example_images/Streets/2.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:881dea8ff6871dc0e7125311454ec6198783465e1d4a1e4dd4693052271f72cb +size 233149 diff --git a/assets/example_images/Streets/3.jpg b/assets/example_images/Streets/3.jpg new file mode 100644 index 0000000000000000000000000000000000000000..c25913d7cec77c46b9e9bb5f20c8fb02d86e1a73 --- /dev/null +++ b/assets/example_images/Streets/3.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5a442ee68c08a31f7b6d7ea2ba06e5fccba8541dd5d93acf5b8825c9c525df63 +size 188737 diff --git a/assets/example_images/Streets/4.jpg b/assets/example_images/Streets/4.jpg new file mode 100644 index 0000000000000000000000000000000000000000..0dbdfc4dda4dc7d2d89f61bc693c05e7b19d6316 --- /dev/null +++ b/assets/example_images/Streets/4.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:29e5a0ba0e6e1d3d4311c95184a76247a9c7436714cb0e1b1f2c93e2a2d034e4 +size 117914 diff --git a/assets/firebase-CWl4LEc7.js b/assets/firebase-CWl4LEc7.js new file mode 100644 index 0000000000000000000000000000000000000000..1b11dd812f7248960c49095a9513fc5aaf894bc9 --- /dev/null +++ b/assets/firebase-CWl4LEc7.js @@ -0,0 +1,3231 @@ +import{o as Ed}from"./vendor-other-B0VykD61.js";const Td=()=>{};var ja={};/** + * @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 _u=function(n){const e=[];let t=0;for(let r=0;r>6|192,e[t++]=s&63|128):(s&64512)===55296&&r+1>18|240,e[t++]=s>>12&63|128,e[t++]=s>>6&63|128,e[t++]=s&63|128):(e[t++]=s>>12|224,e[t++]=s>>6&63|128,e[t++]=s&63|128)}return e},Id=function(n){const e=[];let t=0,r=0;for(;t191&&s<224){const o=n[t++];e[r++]=String.fromCharCode((s&31)<<6|o&63)}else if(s>239&&s<365){const o=n[t++],a=n[t++],u=n[t++],h=((s&7)<<18|(o&63)<<12|(a&63)<<6|u&63)-65536;e[r++]=String.fromCharCode(55296+(h>>10)),e[r++]=String.fromCharCode(56320+(h&1023))}else{const o=n[t++],a=n[t++];e[r++]=String.fromCharCode((s&15)<<12|(o&63)<<6|a&63)}}return e.join("")},yu={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(n,e){if(!Array.isArray(n))throw Error("encodeByteArray takes an array as a parameter");this.init_();const t=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let s=0;s>2,y=(o&3)<<4|u>>4;let E=(u&15)<<2|d>>6,P=d&63;h||(P=64,a||(E=64)),r.push(t[p],t[y],t[E],t[P])}return r.join("")},encodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(n):this.encodeByteArray(_u(n),e)},decodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(n):Id(this.decodeStringToByteArray(n,e))},decodeStringToByteArray(n,e){this.init_();const t=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let s=0;s>4;if(r.push(E),d!==64){const P=u<<4&240|d>>2;if(r.push(P),y!==64){const b=d<<6&192|y;r.push(b)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let n=0;n=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(n)]=n,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(n)]=n)}}};class vd extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const wd=function(n){const e=_u(n);return yu.encodeByteArray(e,!0)},Jr=function(n){return wd(n).replace(/\./g,"")},Eu=function(n){try{return yu.decodeString(n,!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 Ad(){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 Rd=()=>Ad().__FIREBASE_DEFAULTS__,Sd=()=>{if(typeof process>"u"||typeof ja>"u")return;const n=ja.__FIREBASE_DEFAULTS__;if(n)return JSON.parse(n)},Pd=()=>{if(typeof document>"u")return;let n;try{n=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const e=n&&Eu(n[1]);return e&&JSON.parse(e)},Es=()=>{try{return Td()||Rd()||Sd()||Pd()}catch(n){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${n}`);return}},Tu=n=>Es()?.emulatorHosts?.[n],Iu=n=>{const e=Tu(n);if(!e)return;const t=e.lastIndexOf(":");if(t<=0||t+1===e.length)throw new Error(`Invalid host ${e} with no separate hostname and port!`);const r=parseInt(e.substring(t+1),10);return e[0]==="["?[e.substring(1,t-1),r]:[e.substring(0,t),r]},vu=()=>Es()?.config,wu=n=>Es()?.[`_${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 Cd{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(e){return(t,r)=>{t?this.reject(t):this.resolve(r),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(t):e(t,r))}}}/** + * @license + * Copyright 2025 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 $t(n){try{return(n.startsWith("http://")||n.startsWith("https://")?new URL(n).hostname:n).endsWith(".cloudworkstations.dev")}catch{return!1}}async function ji(n){return(await fetch(n,{credentials:"include"})).ok}/** + * @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 Au(n,e){if(n.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const t={alg:"none",type:"JWT"},r=e||"demo-project",s=n.iat||0,o=n.sub||n.user_id;if(!o)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const a={iss:`https://securetoken.google.com/${r}`,aud:r,iat:s,exp:s+3600,auth_time:s,sub:o,user_id:o,firebase:{sign_in_provider:"custom",identities:{}},...n};return[Jr(JSON.stringify(t)),Jr(JSON.stringify(a)),""].join(".")}const $n={};function bd(){const n={prod:[],emulator:[]};for(const e of Object.keys($n))$n[e]?n.emulator.push(e):n.prod.push(e);return n}function kd(n){let e=document.getElementById(n),t=!1;return e||(e=document.createElement("div"),e.setAttribute("id",n),t=!0),{created:t,element:e}}let $a=!1;function $i(n,e){if(typeof window>"u"||typeof document>"u"||!$t(window.location.host)||$n[n]===e||$n[n]||$a)return;$n[n]=e;function t(E){return`__firebase__banner__${E}`}const r="__firebase__banner",o=bd().prod.length>0;function a(){const E=document.getElementById(r);E&&E.remove()}function u(E){E.style.display="flex",E.style.background="#7faaf0",E.style.position="fixed",E.style.bottom="5px",E.style.left="5px",E.style.padding=".5em",E.style.borderRadius="5px",E.style.alignItems="center"}function h(E,P){E.setAttribute("width","24"),E.setAttribute("id",P),E.setAttribute("height","24"),E.setAttribute("viewBox","0 0 24 24"),E.setAttribute("fill","none"),E.style.marginLeft="-6px"}function d(){const E=document.createElement("span");return E.style.cursor="pointer",E.style.marginLeft="16px",E.style.fontSize="24px",E.innerHTML=" ×",E.onclick=()=>{$a=!0,a()},E}function p(E,P){E.setAttribute("id",P),E.innerText="Learn more",E.href="https://firebase.google.com/docs/studio/preview-apps#preview-backend",E.setAttribute("target","__blank"),E.style.paddingLeft="5px",E.style.textDecoration="underline"}function y(){const E=kd(r),P=t("text"),b=document.getElementById(P)||document.createElement("span"),O=t("learnmore"),k=document.getElementById(O)||document.createElement("a"),q=t("preprendIcon"),j=document.getElementById(q)||document.createElementNS("http://www.w3.org/2000/svg","svg");if(E.created){const B=E.element;u(B),p(k,O);const Q=d();h(j,q),B.append(j,b,k,Q),document.body.appendChild(B)}o?(b.innerText="Preview backend disconnected.",j.innerHTML=` + + + + + + +`):(j.innerHTML=` + + + + + + +`,b.innerText="Preview backend running in this workspace."),b.setAttribute("id",P)}document.readyState==="loading"?window.addEventListener("DOMContentLoaded",y):y()}/** + * @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 ve(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function Vd(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(ve())}function Nd(){const n=Es()?.forceEnvironment;if(n==="node")return!0;if(n==="browser")return!1;try{return Object.prototype.toString.call(global.process)==="[object process]"}catch{return!1}}function Dd(){return typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"}function Od(){const n=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof n=="object"&&n.id!==void 0}function Md(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function Ld(){const n=ve();return n.indexOf("MSIE ")>=0||n.indexOf("Trident/")>=0}function xd(){return!Nd()&&!!navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function Ud(){try{return typeof indexedDB=="object"}catch{return!1}}function Fd(){return new Promise((n,e)=>{try{let t=!0;const r="validate-browser-context-for-indexeddb-analytics-module",s=self.indexedDB.open(r);s.onsuccess=()=>{s.result.close(),t||self.indexedDB.deleteDatabase(r),n(!0)},s.onupgradeneeded=()=>{t=!1},s.onerror=()=>{e(s.error?.message||"")}}catch(t){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. + */const Bd="FirebaseError";class Ke extends Error{constructor(e,t,r){super(t),this.code=e,this.customData=r,this.name=Bd,Object.setPrototypeOf(this,Ke.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,ir.prototype.create)}}class ir{constructor(e,t,r){this.service=e,this.serviceName=t,this.errors=r}create(e,...t){const r=t[0]||{},s=`${this.service}/${e}`,o=this.errors[e],a=o?qd(o,r):"Error",u=`${this.serviceName}: ${a} (${s}).`;return new Ke(s,u,r)}}function qd(n,e){return n.replace(jd,(t,r)=>{const s=e[r];return s!=null?String(s):`<${r}?>`})}const jd=/\{\$([^}]+)}/g;function $d(n){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e))return!1;return!0}function Ut(n,e){if(n===e)return!0;const t=Object.keys(n),r=Object.keys(e);for(const s of t){if(!r.includes(s))return!1;const o=n[s],a=e[s];if(za(o)&&za(a)){if(!Ut(o,a))return!1}else if(o!==a)return!1}for(const s of r)if(!t.includes(s))return!1;return!0}function za(n){return n!==null&&typeof n=="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 or(n){const e=[];for(const[t,r]of Object.entries(n))Array.isArray(r)?r.forEach(s=>{e.push(encodeURIComponent(t)+"="+encodeURIComponent(s))}):e.push(encodeURIComponent(t)+"="+encodeURIComponent(r));return e.length?"&"+e.join("&"):""}function zd(n,e){const t=new Hd(n,e);return t.subscribe.bind(t)}class Hd{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(()=>{e(this)}).catch(r=>{this.error(r)})}next(e){this.forEachObserver(t=>{t.next(e)})}error(e){this.forEachObserver(t=>{t.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,t,r){let s;if(e===void 0&&t===void 0&&r===void 0)throw new Error("Missing Observer.");Gd(e,["next","error","complete"])?s=e:s={next:e,error:t,complete:r},s.next===void 0&&(s.next=ui),s.error===void 0&&(s.error=ui),s.complete===void 0&&(s.complete=ui);const o=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?s.error(this.finalError):s.complete()}catch{}}),this.observers.push(s),o}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 t=0;t{if(this.observers!==void 0&&this.observers[e]!==void 0)try{t(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 Gd(n,e){if(typeof n!="object"||n===null)return!1;for(const t of e)if(t in n&&typeof n[t]=="function")return!0;return!1}function ui(){}/** + * @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 fe(n){return n&&n._delegate?n._delegate:n}class Tt{constructor(e,t,r){this.name=e,this.instanceFactory=t,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 Ot="[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. + */class Wd{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){const r=new Cd;if(this.instancesDeferred.set(t,r),this.isInitialized(t)||this.shouldAutoInitialize())try{const s=this.getOrInitializeService({instanceIdentifier:t});s&&r.resolve(s)}catch{}}return this.instancesDeferred.get(t).promise}getImmediate(e){const t=this.normalizeInstanceIdentifier(e?.identifier),r=e?.optional??!1;if(this.isInitialized(t)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:t})}catch(s){if(r)return null;throw s}else{if(r)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(Qd(e))try{this.getOrInitializeService({instanceIdentifier:Ot})}catch{}for(const[t,r]of this.instancesDeferred.entries()){const s=this.normalizeInstanceIdentifier(t);try{const o=this.getOrInitializeService({instanceIdentifier:s});r.resolve(o)}catch{}}}}clearInstance(e=Ot){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(t=>"INTERNAL"in t).map(t=>t.INTERNAL.delete()),...e.filter(t=>"_delete"in t).map(t=>t._delete())])}isComponentSet(){return this.component!=null}isInitialized(e=Ot){return this.instances.has(e)}getOptions(e=Ot){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:t={}}=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 s=this.getOrInitializeService({instanceIdentifier:r,options:t});for(const[o,a]of this.instancesDeferred.entries()){const u=this.normalizeInstanceIdentifier(o);r===u&&a.resolve(s)}return s}onInit(e,t){const r=this.normalizeInstanceIdentifier(t),s=this.onInitCallbacks.get(r)??new Set;s.add(e),this.onInitCallbacks.set(r,s);const o=this.instances.get(r);return o&&e(o,r),()=>{s.delete(e)}}invokeOnInitCallbacks(e,t){const r=this.onInitCallbacks.get(t);if(r)for(const s of r)try{s(e,t)}catch{}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let r=this.instances.get(e);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:Kd(e),options:t}),this.instances.set(e,r),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(r,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,r)}catch{}return r||null}normalizeInstanceIdentifier(e=Ot){return this.component?this.component.multipleInstances?e:Ot:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function Kd(n){return n===Ot?void 0:n}function Qd(n){return n.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 Xd{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const t=this.getProvider(e.name);if(t.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);t.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 t=new Wd(e,this);return this.providers.set(e,t),t}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 $;(function(n){n[n.DEBUG=0]="DEBUG",n[n.VERBOSE=1]="VERBOSE",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.SILENT=5]="SILENT"})($||($={}));const Yd={debug:$.DEBUG,verbose:$.VERBOSE,info:$.INFO,warn:$.WARN,error:$.ERROR,silent:$.SILENT},Jd=$.INFO,Zd={[$.DEBUG]:"log",[$.VERBOSE]:"log",[$.INFO]:"info",[$.WARN]:"warn",[$.ERROR]:"error"},ef=(n,e,...t)=>{if(e{if(nf(t)){const r=t.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(t=>t).join(" ")}}function nf(n){return n.getComponent()?.type==="VERSION"}const Ei="@firebase/app",Ha="0.14.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 nt=new zi("@firebase/app"),rf="@firebase/app-compat",sf="@firebase/analytics-compat",of="@firebase/analytics",af="@firebase/app-check-compat",cf="@firebase/app-check",uf="@firebase/auth",lf="@firebase/auth-compat",hf="@firebase/database",df="@firebase/data-connect",ff="@firebase/database-compat",pf="@firebase/functions",mf="@firebase/functions-compat",gf="@firebase/installations",_f="@firebase/installations-compat",yf="@firebase/messaging",Ef="@firebase/messaging-compat",Tf="@firebase/performance",If="@firebase/performance-compat",vf="@firebase/remote-config",wf="@firebase/remote-config-compat",Af="@firebase/storage",Rf="@firebase/storage-compat",Sf="@firebase/firestore",Pf="@firebase/ai",Cf="@firebase/firestore-compat",bf="firebase",kf="12.0.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 Ti="[DEFAULT]",Vf={[Ei]:"fire-core",[rf]:"fire-core-compat",[of]:"fire-analytics",[sf]:"fire-analytics-compat",[cf]:"fire-app-check",[af]:"fire-app-check-compat",[uf]:"fire-auth",[lf]:"fire-auth-compat",[hf]:"fire-rtdb",[df]:"fire-data-connect",[ff]:"fire-rtdb-compat",[pf]:"fire-fn",[mf]:"fire-fn-compat",[gf]:"fire-iid",[_f]:"fire-iid-compat",[yf]:"fire-fcm",[Ef]:"fire-fcm-compat",[Tf]:"fire-perf",[If]:"fire-perf-compat",[vf]:"fire-rc",[wf]:"fire-rc-compat",[Af]:"fire-gcs",[Rf]:"fire-gcs-compat",[Sf]:"fire-fst",[Cf]:"fire-fst-compat",[Pf]:"fire-vertex","fire-js":"fire-js",[bf]:"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 Zr=new Map,Nf=new Map,Ii=new Map;function Ga(n,e){try{n.container.addComponent(e)}catch(t){nt.debug(`Component ${e.name} failed to register with FirebaseApp ${n.name}`,t)}}function Ft(n){const e=n.name;if(Ii.has(e))return nt.debug(`There were multiple attempts to register component ${e}.`),!1;Ii.set(e,n);for(const t of Zr.values())Ga(t,n);for(const t of Nf.values())Ga(t,n);return!0}function Ts(n,e){const t=n.container.getProvider("heartbeat").getImmediate({optional:!0});return t&&t.triggerHeartbeat(),n.container.getProvider(e)}function Ne(n){return n==null?!1:n.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 Df={"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."},_t=new ir("app","Firebase",Df);/** + * @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 Of{constructor(e,t,r){this._isDeleted=!1,this._options={...e},this._config={...t},this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new Tt("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 _t.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 zt=kf;function Mf(n,e={}){let t=n;typeof e!="object"&&(e={name:e});const r={name:Ti,automaticDataCollectionEnabled:!0,...e},s=r.name;if(typeof s!="string"||!s)throw _t.create("bad-app-name",{appName:String(s)});if(t||(t=vu()),!t)throw _t.create("no-options");const o=Zr.get(s);if(o){if(Ut(t,o.options)&&Ut(r,o.config))return o;throw _t.create("duplicate-app",{appName:s})}const a=new Xd(s);for(const h of Ii.values())a.addComponent(h);const u=new Of(t,r,a);return Zr.set(s,u),u}function Hi(n=Ti){const e=Zr.get(n);if(!e&&n===Ti&&vu())return Mf();if(!e)throw _t.create("no-app",{appName:n});return e}function Ue(n,e,t){let r=Vf[n]??n;t&&(r+=`-${t}`);const s=r.match(/\s|\//),o=e.match(/\s|\//);if(s||o){const a=[`Unable to register library "${r}" with version "${e}":`];s&&a.push(`library name "${r}" contains illegal characters (whitespace or "/")`),s&&o&&a.push("and"),o&&a.push(`version name "${e}" contains illegal characters (whitespace or "/")`),nt.warn(a.join(" "));return}Ft(new Tt(`${r}-version`,()=>({library:r,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 Lf="firebase-heartbeat-database",xf=1,Qn="firebase-heartbeat-store";let li=null;function Ru(){return li||(li=Ed(Lf,xf,{upgrade:(n,e)=>{switch(e){case 0:try{n.createObjectStore(Qn)}catch(t){console.warn(t)}}}}).catch(n=>{throw _t.create("idb-open",{originalErrorMessage:n.message})})),li}async function Uf(n){try{const t=(await Ru()).transaction(Qn),r=await t.objectStore(Qn).get(Su(n));return await t.done,r}catch(e){if(e instanceof Ke)nt.warn(e.message);else{const t=_t.create("idb-get",{originalErrorMessage:e?.message});nt.warn(t.message)}}}async function Wa(n,e){try{const r=(await Ru()).transaction(Qn,"readwrite");await r.objectStore(Qn).put(e,Su(n)),await r.done}catch(t){if(t instanceof Ke)nt.warn(t.message);else{const r=_t.create("idb-set",{originalErrorMessage:t?.message});nt.warn(r.message)}}}function Su(n){return`${n.name}!${n.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 Ff=1024,Bf=30;class qf{constructor(e){this.container=e,this._heartbeatsCache=null;const t=this.container.getProvider("app").getImmediate();this._storage=new $f(t),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}async triggerHeartbeat(){try{const t=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),r=Ka();if(this._heartbeatsCache?.heartbeats==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,this._heartbeatsCache?.heartbeats==null)||this._heartbeatsCache.lastSentHeartbeatDate===r||this._heartbeatsCache.heartbeats.some(s=>s.date===r))return;if(this._heartbeatsCache.heartbeats.push({date:r,agent:t}),this._heartbeatsCache.heartbeats.length>Bf){const s=zf(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(s,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(e){nt.warn(e)}}async getHeartbeatsHeader(){try{if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,this._heartbeatsCache?.heartbeats==null||this._heartbeatsCache.heartbeats.length===0)return"";const e=Ka(),{heartbeatsToSend:t,unsentEntries:r}=jf(this._heartbeatsCache.heartbeats),s=Jr(JSON.stringify({version:2,heartbeats:t}));return this._heartbeatsCache.lastSentHeartbeatDate=e,r.length>0?(this._heartbeatsCache.heartbeats=r,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),s}catch(e){return nt.warn(e),""}}}function Ka(){return new Date().toISOString().substring(0,10)}function jf(n,e=Ff){const t=[];let r=n.slice();for(const s of n){const o=t.find(a=>a.agent===s.agent);if(o){if(o.dates.push(s.date),Qa(t)>e){o.dates.pop();break}}else if(t.push({agent:s.agent,dates:[s.date]}),Qa(t)>e){t.pop();break}r=r.slice(1)}return{heartbeatsToSend:t,unsentEntries:r}}class $f{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return Ud()?Fd().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const t=await Uf(this.app);return t?.heartbeats?t:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(e){if(await this._canUseIndexedDBPromise){const r=await this.read();return Wa(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??r.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){if(await this._canUseIndexedDBPromise){const r=await this.read();return Wa(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??r.lastSentHeartbeatDate,heartbeats:[...r.heartbeats,...e.heartbeats]})}else return}}function Qa(n){return Jr(JSON.stringify({version:2,heartbeats:n})).length}function zf(n){if(n.length===0)return-1;let e=0,t=n[0].date;for(let r=1;rnew tf(e),"PRIVATE")),Ft(new Tt("heartbeat",e=>new qf(e),"PRIVATE")),Ue(Ei,Ha,n),Ue(Ei,Ha,"esm2020"),Ue("fire-js","")}Hf("");function Pu(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}const Gf=Pu,Cu=new ir("auth","Firebase",Pu());/** + * @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 es=new zi("@firebase/auth");function Wf(n,...e){es.logLevel<=$.WARN&&es.warn(`Auth (${zt}): ${n}`,...e)}function jr(n,...e){es.logLevel<=$.ERROR&&es.error(`Auth (${zt}): ${n}`,...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 rt(n,...e){throw Gi(n,...e)}function Fe(n,...e){return Gi(n,...e)}function bu(n,e,t){const r={...Gf(),[e]:t};return new ir("auth","Firebase",r).create(e,{appName:n.name})}function Lt(n){return bu(n,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function Gi(n,...e){if(typeof n!="string"){const t=e[0],r=[...e.slice(1)];return r[0]&&(r[0].appName=n.name),n._errorFactory.create(t,...r)}return Cu.create(n,...e)}function x(n,e,...t){if(!n)throw Gi(e,...t)}function Ze(n){const e="INTERNAL ASSERTION FAILED: "+n;throw jr(e),new Error(e)}function st(n,e){n||Ze(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 vi(){return typeof self<"u"&&self.location?.href||""}function Kf(){return Xa()==="http:"||Xa()==="https:"}function Xa(){return typeof self<"u"&&self.location?.protocol||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 Qf(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(Kf()||Od()||"connection"in navigator)?navigator.onLine:!0}function Xf(){if(typeof navigator>"u")return null;const n=navigator;return n.languages&&n.languages[0]||n.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 ar{constructor(e,t){this.shortDelay=e,this.longDelay=t,st(t>e,"Short delay should be less than long delay!"),this.isMobile=Vd()||Md()}get(){return Qf()?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 Wi(n,e){st(n.emulator,"Emulator should always be set here");const{url:t}=n.emulator;return e?`${t}${e.startsWith("/")?e.slice(1):e}`: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 ku{static initialize(e,t,r){this.fetchImpl=e,t&&(this.headersImpl=t),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;Ze("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;Ze("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;Ze("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 Yf={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 Jf=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],Zf=new ar(3e4,6e4);function Ki(n,e){return n.tenantId&&!e.tenantId?{...e,tenantId:n.tenantId}:e}async function mn(n,e,t,r,s={}){return Vu(n,s,async()=>{let o={},a={};r&&(e==="GET"?a=r:o={body:JSON.stringify(r)});const u=or({key:n.config.apiKey,...a}).slice(1),h=await n._getAdditionalHeaders();h["Content-Type"]="application/json",n.languageCode&&(h["X-Firebase-Locale"]=n.languageCode);const d={method:e,headers:h,...o};return Dd()||(d.referrerPolicy="no-referrer"),n.emulatorConfig&&$t(n.emulatorConfig.host)&&(d.credentials="include"),ku.fetch()(await Nu(n,n.config.apiHost,t,u),d)})}async function Vu(n,e,t){n._canInitEmulator=!1;const r={...Yf,...e};try{const s=new tp(n),o=await Promise.race([t(),s.promise]);s.clearNetworkTimeout();const a=await o.json();if("needConfirmation"in a)throw Mr(n,"account-exists-with-different-credential",a);if(o.ok&&!("errorMessage"in a))return a;{const u=o.ok?a.errorMessage:a.error.message,[h,d]=u.split(" : ");if(h==="FEDERATED_USER_ID_ALREADY_LINKED")throw Mr(n,"credential-already-in-use",a);if(h==="EMAIL_EXISTS")throw Mr(n,"email-already-in-use",a);if(h==="USER_DISABLED")throw Mr(n,"user-disabled",a);const p=r[h]||h.toLowerCase().replace(/[_\s]+/g,"-");if(d)throw bu(n,p,d);rt(n,p)}}catch(s){if(s instanceof Ke)throw s;rt(n,"network-request-failed",{message:String(s)})}}async function ep(n,e,t,r,s={}){const o=await mn(n,e,t,r,s);return"mfaPendingCredential"in o&&rt(n,"multi-factor-auth-required",{_serverResponse:o}),o}async function Nu(n,e,t,r){const s=`${e}${t}?${r}`,o=n,a=o.config.emulator?Wi(n.config,s):`${n.config.apiScheme}://${s}`;return Jf.includes(t)&&(await o._persistenceManagerAvailable,o._getPersistenceType()==="COOKIE")?o._getPersistence()._getFinalTarget(a).toString():a}class tp{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((t,r)=>{this.timer=setTimeout(()=>r(Fe(this.auth,"network-request-failed")),Zf.get())})}}function Mr(n,e,t){const r={appName:n.name};t.email&&(r.email=t.email),t.phoneNumber&&(r.phoneNumber=t.phoneNumber);const s=Fe(n,e,r);return s.customData._tokenResponse=t,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 np(n,e){return mn(n,"POST","/v1/accounts:delete",e)}async function ts(n,e){return mn(n,"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 zn(n){if(n)try{const e=new Date(Number(n));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}async function rp(n,e=!1){const t=fe(n),r=await t.getIdToken(e),s=Qi(r);x(s&&s.exp&&s.auth_time&&s.iat,t.auth,"internal-error");const o=typeof s.firebase=="object"?s.firebase:void 0,a=o?.sign_in_provider;return{claims:s,token:r,authTime:zn(hi(s.auth_time)),issuedAtTime:zn(hi(s.iat)),expirationTime:zn(hi(s.exp)),signInProvider:a||null,signInSecondFactor:o?.sign_in_second_factor||null}}function hi(n){return Number(n)*1e3}function Qi(n){const[e,t,r]=n.split(".");if(e===void 0||t===void 0||r===void 0)return jr("JWT malformed, contained fewer than 3 sections"),null;try{const s=Eu(t);return s?JSON.parse(s):(jr("Failed to decode base64 JWT payload"),null)}catch(s){return jr("Caught error parsing JWT payload as JSON",s?.toString()),null}}function Ya(n){const e=Qi(n);return x(e,"internal-error"),x(typeof e.exp<"u","internal-error"),x(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 Xn(n,e,t=!1){if(t)return e;try{return await e}catch(r){throw r instanceof Ke&&sp(r)&&n.auth.currentUser===n&&await n.auth.signOut(),r}}function sp({code:n}){return n==="auth/user-disabled"||n==="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 ip{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){if(e){const t=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),t}else{this.errorBackoff=3e4;const r=(this.user.stsTokenManager.expirationTime??0)-Date.now()-3e5;return Math.max(0,r)}}schedule(e=!1){if(!this.isRunning)return;const t=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},t)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){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 wi{constructor(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}_initializeTime(){this.lastSignInTime=zn(this.lastLoginAt),this.creationTime=zn(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 ns(n){const e=n.auth,t=await n.getIdToken(),r=await Xn(n,ts(e,{idToken:t}));x(r?.users.length,e,"internal-error");const s=r.users[0];n._notifyReloadListener(s);const o=s.providerUserInfo?.length?Du(s.providerUserInfo):[],a=ap(n.providerData,o),u=n.isAnonymous,h=!(n.email&&s.passwordHash)&&!a?.length,d=u?h:!1,p={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 wi(s.createdAt,s.lastLoginAt),isAnonymous:d};Object.assign(n,p)}async function op(n){const e=fe(n);await ns(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}function ap(n,e){return[...n.filter(r=>!e.some(s=>s.providerId===r.providerId)),...e]}function Du(n){return n.map(({providerId:e,...t})=>({providerId:e,uid:t.rawId||"",displayName:t.displayName||null,email:t.email||null,phoneNumber:t.phoneNumber||null,photoURL:t.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 cp(n,e){const t=await Vu(n,{},async()=>{const r=or({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:s,apiKey:o}=n.config,a=await Nu(n,s,"/v1/token",`key=${o}`),u=await n._getAdditionalHeaders();u["Content-Type"]="application/x-www-form-urlencoded";const h={method:"POST",headers:u,body:r};return n.emulatorConfig&&$t(n.emulatorConfig.host)&&(h.credentials="include"),ku.fetch()(a,h)});return{accessToken:t.access_token,expiresIn:t.expires_in,refreshToken:t.refresh_token}}async function up(n,e){return mn(n,"POST","/v2/accounts:revokeToken",Ki(n,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 nn{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){x(e.idToken,"internal-error"),x(typeof e.idToken<"u","internal-error"),x(typeof e.refreshToken<"u","internal-error");const t="expiresIn"in e&&typeof e.expiresIn<"u"?Number(e.expiresIn):Ya(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}updateFromIdToken(e){x(e.length!==0,"internal-error");const t=Ya(e);this.updateTokensAndExpiration(e,null,t)}async getToken(e,t=!1){return!t&&this.accessToken&&!this.isExpired?this.accessToken:(x(this.refreshToken,e,"user-token-expired"),this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null)}clearRefreshToken(){this.refreshToken=null}async refresh(e,t){const{accessToken:r,refreshToken:s,expiresIn:o}=await cp(e,t);this.updateTokensAndExpiration(r,s,Number(o))}updateTokensAndExpiration(e,t,r){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+r*1e3}static fromJSON(e,t){const{refreshToken:r,accessToken:s,expirationTime:o}=t,a=new nn;return r&&(x(typeof r=="string","internal-error",{appName:e}),a.refreshToken=r),s&&(x(typeof s=="string","internal-error",{appName:e}),a.accessToken=s),o&&(x(typeof o=="number","internal-error",{appName:e}),a.expirationTime=o),a}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 nn,this.toJSON())}_performRefresh(){return Ze("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 ht(n,e){x(typeof n=="string"||typeof n>"u","internal-error",{appName:e})}class De{constructor({uid:e,auth:t,stsTokenManager:r,...s}){this.providerId="firebase",this.proactiveRefresh=new ip(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=e,this.auth=t,this.stsTokenManager=r,this.accessToken=r.accessToken,this.displayName=s.displayName||null,this.email=s.email||null,this.emailVerified=s.emailVerified||!1,this.phoneNumber=s.phoneNumber||null,this.photoURL=s.photoURL||null,this.isAnonymous=s.isAnonymous||!1,this.tenantId=s.tenantId||null,this.providerData=s.providerData?[...s.providerData]:[],this.metadata=new wi(s.createdAt||void 0,s.lastLoginAt||void 0)}async getIdToken(e){const t=await Xn(this,this.stsTokenManager.getToken(this.auth,e));return x(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return rp(this,e)}reload(){return op(this)}_assign(e){this!==e&&(x(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(t=>({...t})),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const t=new De({...this,auth:e,stsTokenManager:this.stsTokenManager._clone()});return t.metadata._copy(this.metadata),t}_onReload(e){x(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,t=!1){let r=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),r=!0),t&&await ns(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(Ne(this.auth.app))return Promise.reject(Lt(this.auth));const e=await this.getIdToken();return await Xn(this,np(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return{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=>({...e})),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId,...this.metadata.toJSON(),apiKey:this.auth.config.apiKey,appName:this.auth.name}}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,t){const r=t.displayName??void 0,s=t.email??void 0,o=t.phoneNumber??void 0,a=t.photoURL??void 0,u=t.tenantId??void 0,h=t._redirectEventId??void 0,d=t.createdAt??void 0,p=t.lastLoginAt??void 0,{uid:y,emailVerified:E,isAnonymous:P,providerData:b,stsTokenManager:O}=t;x(y&&O,e,"internal-error");const k=nn.fromJSON(this.name,O);x(typeof y=="string",e,"internal-error"),ht(r,e.name),ht(s,e.name),x(typeof E=="boolean",e,"internal-error"),x(typeof P=="boolean",e,"internal-error"),ht(o,e.name),ht(a,e.name),ht(u,e.name),ht(h,e.name),ht(d,e.name),ht(p,e.name);const q=new De({uid:y,auth:e,email:s,emailVerified:E,displayName:r,isAnonymous:P,photoURL:a,phoneNumber:o,tenantId:u,stsTokenManager:k,createdAt:d,lastLoginAt:p});return b&&Array.isArray(b)&&(q.providerData=b.map(j=>({...j}))),h&&(q._redirectEventId=h),q}static async _fromIdTokenResponse(e,t,r=!1){const s=new nn;s.updateFromServerResponse(t);const o=new De({uid:t.localId,auth:e,stsTokenManager:s,isAnonymous:r});return await ns(o),o}static async _fromGetAccountInfoResponse(e,t,r){const s=t.users[0];x(s.localId!==void 0,"internal-error");const o=s.providerUserInfo!==void 0?Du(s.providerUserInfo):[],a=!(s.email&&s.passwordHash)&&!o?.length,u=new nn;u.updateFromIdToken(r);const h=new De({uid:s.localId,auth:e,stsTokenManager:u,isAnonymous:a}),d={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:o,metadata:new wi(s.createdAt,s.lastLoginAt),isAnonymous:!(s.email&&s.passwordHash)&&!o?.length};return Object.assign(h,d),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 Ja=new Map;function et(n){st(n instanceof Function,"Expected a class definition");let e=Ja.get(n);return e?(st(e instanceof n,"Instance stored in cache mismatched with class"),e):(e=new n,Ja.set(n,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 Ou{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,t){this.storage[e]=t}async _get(e){const t=this.storage[e];return t===void 0?null:t}async _remove(e){delete this.storage[e]}_addListener(e,t){}_removeListener(e,t){}}Ou.type="NONE";const Za=Ou;/** + * @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 $r(n,e,t){return`firebase:${n}:${e}:${t}`}class rn{constructor(e,t,r){this.persistence=e,this.auth=t,this.userKey=r;const{config:s,name:o}=this.auth;this.fullUserKey=$r(this.userKey,s.apiKey,o),this.fullPersistenceKey=$r("persistence",s.apiKey,o),this.boundEventHandler=t._onStorageEvent.bind(t),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);if(!e)return null;if(typeof e=="string"){const t=await ts(this.auth,{idToken:e}).catch(()=>{});return t?De._fromGetAccountInfoResponse(this.auth,t,e):null}return De._fromJSON(this.auth,e)}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 t=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=e,t)return this.setCurrentUser(t)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,t,r="authUser"){if(!t.length)return new rn(et(Za),e,r);const s=(await Promise.all(t.map(async d=>{if(await d._isAvailable())return d}))).filter(d=>d);let o=s[0]||et(Za);const a=$r(r,e.config.apiKey,e.name);let u=null;for(const d of t)try{const p=await d._get(a);if(p){let y;if(typeof p=="string"){const E=await ts(e,{idToken:p}).catch(()=>{});if(!E)break;y=await De._fromGetAccountInfoResponse(e,E,p)}else y=De._fromJSON(e,p);d!==o&&(u=y),o=d;break}}catch{}const h=s.filter(d=>d._shouldAllowMigration);return!o._shouldAllowMigration||!h.length?new rn(o,e,r):(o=h[0],u&&await o._set(a,u.toJSON()),await Promise.all(t.map(async d=>{if(d!==o)try{await d._remove(a)}catch{}})),new rn(o,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 ec(n){const e=n.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(Uu(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(Mu(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(Bu(e))return"Blackberry";if(qu(e))return"Webos";if(Lu(e))return"Safari";if((e.includes("chrome/")||xu(e))&&!e.includes("edge/"))return"Chrome";if(Fu(e))return"Android";{const t=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,r=n.match(t);if(r?.length===2)return r[1]}return"Other"}function Mu(n=ve()){return/firefox\//i.test(n)}function Lu(n=ve()){const e=n.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function xu(n=ve()){return/crios\//i.test(n)}function Uu(n=ve()){return/iemobile/i.test(n)}function Fu(n=ve()){return/android/i.test(n)}function Bu(n=ve()){return/blackberry/i.test(n)}function qu(n=ve()){return/webos/i.test(n)}function Xi(n=ve()){return/iphone|ipad|ipod/i.test(n)||/macintosh/i.test(n)&&/mobile/i.test(n)}function lp(n=ve()){return Xi(n)&&!!window.navigator?.standalone}function hp(){return Ld()&&document.documentMode===10}function ju(n=ve()){return Xi(n)||Fu(n)||qu(n)||Bu(n)||/windows phone/i.test(n)||Uu(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. + */function $u(n,e=[]){let t;switch(n){case"Browser":t=ec(ve());break;case"Worker":t=`${ec(ve())}-${n}`;break;default:t=n}const r=e.length?e.join(","):"FirebaseCore-web";return`${t}/JsCore/${zt}/${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 dp{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,t){const r=o=>new Promise((a,u)=>{try{const h=e(o);a(h)}catch(h){u(h)}});r.onAbort=t,this.queue.push(r);const s=this.queue.length-1;return()=>{this.queue[s]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;const t=[];try{for(const r of this.queue)await r(e),r.onAbort&&t.push(r.onAbort)}catch(r){t.reverse();for(const s of t)try{s()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage: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 fp(n,e={}){return mn(n,"GET","/v2/passwordPolicy",Ki(n,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 pp=6;class mp{constructor(e){const t=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=t.minPasswordLength??pp,t.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=t.maxPasswordLength),t.containsLowercaseCharacter!==void 0&&(this.customStrengthOptions.containsLowercaseLetter=t.containsLowercaseCharacter),t.containsUppercaseCharacter!==void 0&&(this.customStrengthOptions.containsUppercaseLetter=t.containsUppercaseCharacter),t.containsNumericCharacter!==void 0&&(this.customStrengthOptions.containsNumericCharacter=t.containsNumericCharacter),t.containsNonAlphanumericCharacter!==void 0&&(this.customStrengthOptions.containsNonAlphanumericCharacter=t.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,this.enforcementState==="ENFORCEMENT_STATE_UNSPECIFIED"&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=e.allowedNonAlphanumericCharacters?.join("")??"",this.forceUpgradeOnSignin=e.forceUpgradeOnSignin??!1,this.schemaVersion=e.schemaVersion}validatePassword(e){const t={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,t),this.validatePasswordCharacterOptions(e,t),t.isValid&&(t.isValid=t.meetsMinPasswordLength??!0),t.isValid&&(t.isValid=t.meetsMaxPasswordLength??!0),t.isValid&&(t.isValid=t.containsLowercaseLetter??!0),t.isValid&&(t.isValid=t.containsUppercaseLetter??!0),t.isValid&&(t.isValid=t.containsNumericCharacter??!0),t.isValid&&(t.isValid=t.containsNonAlphanumericCharacter??!0),t}validatePasswordLengthOptions(e,t){const r=this.customStrengthOptions.minPasswordLength,s=this.customStrengthOptions.maxPasswordLength;r&&(t.meetsMinPasswordLength=e.length>=r),s&&(t.meetsMaxPasswordLength=e.length<=s)}validatePasswordCharacterOptions(e,t){this.updatePasswordCharacterOptionsStatuses(t,!1,!1,!1,!1);let r;for(let s=0;s="a"&&r<="z",r>="A"&&r<="Z",r>="0"&&r<="9",this.allowedNonAlphanumericCharacters.includes(r))}updatePasswordCharacterOptionsStatuses(e,t,r,s,o){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=t)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=r)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=s)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=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. + */class gp{constructor(e,t,r,s){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=r,this.config=s,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new tc(this),this.idTokenSubscription=new tc(this),this.beforeStateQueue=new dp(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=Cu,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this._resolvePersistenceManagerAvailable=void 0,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=s.sdkClientVersion,this._persistenceManagerAvailable=new Promise(o=>this._resolvePersistenceManagerAvailable=o)}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=et(t)),this._initializationPromise=this.queue(async()=>{if(!this._deleted&&(this.persistenceManager=await rn.create(this,e),this._resolvePersistenceManagerAvailable?.(),!this._deleted)){if(this._popupRedirectResolver?._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(t),this.lastNotifiedUid=this.currentUser?.uid||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const e=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!e)){if(this.currentUser&&e&&this.currentUser.uid===e.uid){this._currentUser._assign(e),await this.currentUser.getIdToken();return}await this._updateCurrentUser(e,!0)}}async initializeCurrentUserFromIdToken(e){try{const t=await ts(this,{idToken:e}),r=await De._fromGetAccountInfoResponse(this,t,e);await this.directlySetCurrentUser(r)}catch(t){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",t),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){if(Ne(this.app)){const o=this.app.settings.authIdToken;return o?new Promise(a=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(o).then(a,a))}):this.directlySetCurrentUser(null)}const t=await this.assertedPersistence.getCurrentUser();let r=t,s=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const o=this.redirectUser?._redirectEventId,a=r?._redirectEventId,u=await this.tryRedirectSignIn(e);(!o||o===a)&&u?.user&&(r=u.user,s=!0)}if(!r)return this.directlySetCurrentUser(null);if(!r._redirectEventId){if(s)try{await this.beforeStateQueue.runMiddleware(r)}catch(o){r=t,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(o))}return r?this.reloadAndSetCurrentUserOrClear(r):this.directlySetCurrentUser(null)}return x(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===r._redirectEventId?this.directlySetCurrentUser(r):this.reloadAndSetCurrentUserOrClear(r)}async tryRedirectSignIn(e){let t=null;try{t=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch{await this._setRedirectUser(null)}return t}async reloadAndSetCurrentUserOrClear(e){try{await ns(e)}catch(t){if(t?.code!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=Xf()}async _delete(){this._deleted=!0}async updateCurrentUser(e){if(Ne(this.app))return Promise.reject(Lt(this));const t=e?fe(e):null;return t&&x(t.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(t&&t._clone(this))}async _updateCurrentUser(e,t=!1){if(!this._deleted)return e&&x(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),t||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return Ne(this.app)?Promise.reject(Lt(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return Ne(this.app)?Promise.reject(Lt(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(et(e))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const t=this._getPasswordPolicyInternal();return t.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):t.validatePassword(e)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const e=await fp(this),t=new mp(e);this.tenantId===null?this._projectPasswordPolicy=t:this._tenantPasswordPolicies[this.tenantId]=t}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(e){this._errorFactory=new ir("auth","Firebase",e())}onAuthStateChanged(e,t,r){return this.registerStateListener(this.authStateSubscription,e,t,r)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,r){return this.registerStateListener(this.idTokenSubscription,e,t,r)}authStateReady(){return new Promise((e,t)=>{if(this.currentUser)e();else{const r=this.onAuthStateChanged(()=>{r(),e()},t)}})}async revokeAccessToken(e){if(this.currentUser){const t=await this.currentUser.getIdToken(),r={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:t};this.tenantId!=null&&(r.tenantId=this.tenantId),await up(this,r)}}toJSON(){return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:this._currentUser?.toJSON()}}async _setRedirectUser(e,t){const r=await this.getOrInitRedirectPersistenceManager(t);return e===null?r.removeCurrentUser():r.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const t=e&&et(e)||this._popupRedirectResolver;x(t,this,"argument-error"),this.redirectPersistenceManager=await rn.create(this,[et(t._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){return this._isInitialized&&await this.queue(async()=>{}),this._currentUser?._redirectEventId===e?this._currentUser:this.redirectUser?._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(){if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const e=this.currentUser?.uid??null;this.lastNotifiedUid!==e&&(this.lastNotifiedUid=e,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,r,s){if(this._deleted)return()=>{};const o=typeof t=="function"?t:t.next.bind(t);let a=!1;const u=this._isInitialized?Promise.resolve():this._initializationPromise;if(x(u,this,"internal-error"),u.then(()=>{a||o(this.currentUser)}),typeof t=="function"){const h=e.addObserver(t,r,s);return()=>{a=!0,h()}}else{const h=e.addObserver(t);return()=>{a=!0,h()}}}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 x(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=$u(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){const e={"X-Client-Version":this.clientVersion};this.app.options.appId&&(e["X-Firebase-gmpid"]=this.app.options.appId);const t=await this.heartbeatServiceProvider.getImmediate({optional:!0})?.getHeartbeatsHeader();t&&(e["X-Firebase-Client"]=t);const r=await this._getAppCheckToken();return r&&(e["X-Firebase-AppCheck"]=r),e}async _getAppCheckToken(){if(Ne(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const e=await this.appCheckServiceProvider.getImmediate({optional:!0})?.getToken();return e?.error&&Wf(`Error while retrieving App Check token: ${e.error}`),e?.token}}function Yi(n){return fe(n)}class tc{constructor(e){this.auth=e,this.observer=null,this.addObserver=zd(t=>this.observer=t)}get next(){return x(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 Ji={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function _p(n){Ji=n}function yp(n){return Ji.loadJS(n)}function Ep(){return Ji.gapiScript}function Tp(n){return`__${n}${Math.floor(Math.random()*1e6)}`}/** + * @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 Ip(n,e){const t=Ts(n,"auth");if(t.isInitialized()){const s=t.getImmediate(),o=t.getOptions();if(Ut(o,e??{}))return s;rt(s,"already-initialized")}return t.initialize({options:e})}function vp(n,e){const t=e?.persistence||[],r=(Array.isArray(t)?t:[t]).map(et);e?.errorMap&&n._updateErrorMap(e.errorMap),n._initializeWithPersistence(r,e?.popupRedirectResolver)}function wp(n,e,t){const r=Yi(n);x(/^https?:\/\//.test(e),r,"invalid-emulator-scheme");const s=!1,o=zu(e),{host:a,port:u}=Ap(e),h=u===null?"":`:${u}`,d={url:`${o}//${a}${h}/`},p=Object.freeze({host:a,port:u,protocol:o.replace(":",""),options:Object.freeze({disableWarnings:s})});if(!r._canInitEmulator){x(r.config.emulator&&r.emulatorConfig,r,"emulator-config-failed"),x(Ut(d,r.config.emulator)&&Ut(p,r.emulatorConfig),r,"emulator-config-failed");return}r.config.emulator=d,r.emulatorConfig=p,r.settings.appVerificationDisabledForTesting=!0,$t(a)?(ji(`${o}//${a}${h}`),$i("Auth",!0)):Rp()}function zu(n){const e=n.indexOf(":");return e<0?"":n.substr(0,e+1)}function Ap(n){const e=zu(n),t=/(\/\/)?([^?#/]+)/.exec(n.substr(e.length));if(!t)return{host:"",port:null};const r=t[2].split("@").pop()||"",s=/^(\[[^\]]+\])(:|$)/.exec(r);if(s){const o=s[1];return{host:o,port:nc(r.substr(o.length+1))}}else{const[o,a]=r.split(":");return{host:o,port:nc(a)}}}function nc(n){if(!n)return null;const e=Number(n);return isNaN(e)?null:e}function Rp(){function n(){const e=document.createElement("p"),t=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",t.position="fixed",t.width="100%",t.backgroundColor="#ffffff",t.border=".1em solid #000000",t.color="#b50000",t.bottom="0px",t.left="0px",t.margin="0px",t.zIndex="10000",t.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",n):n())}/** + * @license + * Copyright 2020 Google LLC + * + * 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 Hu{constructor(e,t){this.providerId=e,this.signInMethod=t}toJSON(){return Ze("not implemented")}_getIdTokenResponse(e){return Ze("not implemented")}_linkToIdToken(e,t){return Ze("not implemented")}_getReauthenticationResolver(e){return Ze("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. + */async function sn(n,e){return ep(n,"POST","/v1/accounts:signInWithIdp",Ki(n,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 Sp="http://localhost";class Bt extends Hu{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const t=new Bt(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(t.idToken=e.idToken),e.accessToken&&(t.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(t.nonce=e.nonce),e.pendingToken&&(t.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(t.accessToken=e.oauthToken,t.secret=e.oauthTokenSecret):rt("argument-error"),t}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 t=typeof e=="string"?JSON.parse(e):e,{providerId:r,signInMethod:s,...o}=t;if(!r||!s)return null;const a=new Bt(r,s);return a.idToken=o.idToken||void 0,a.accessToken=o.accessToken||void 0,a.secret=o.secret,a.nonce=o.nonce,a.pendingToken=o.pendingToken||null,a}_getIdTokenResponse(e){const t=this.buildRequest();return sn(e,t)}_linkToIdToken(e,t){const r=this.buildRequest();return r.idToken=t,sn(e,r)}_getReauthenticationResolver(e){const t=this.buildRequest();return t.autoCreate=!1,sn(e,t)}buildRequest(){const e={requestUri:Sp,returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const t={};this.idToken&&(t.id_token=this.idToken),this.accessToken&&(t.access_token=this.accessToken),this.secret&&(t.oauth_token_secret=this.secret),t.providerId=this.providerId,this.nonce&&!this.pendingToken&&(t.nonce=this.nonce),e.postBody=or(t)}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. + */class Gu{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 cr extends Gu{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 dt extends cr{constructor(){super("facebook.com")}static credential(e){return Bt._fromParams({providerId:dt.PROVIDER_ID,signInMethod:dt.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return dt.credentialFromTaggedObject(e)}static credentialFromError(e){return dt.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return dt.credential(e.oauthAccessToken)}catch{return null}}}dt.FACEBOOK_SIGN_IN_METHOD="facebook.com";dt.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 ft extends cr{constructor(){super("google.com"),this.addScope("profile")}static credential(e,t){return Bt._fromParams({providerId:ft.PROVIDER_ID,signInMethod:ft.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:t})}static credentialFromResult(e){return ft.credentialFromTaggedObject(e)}static credentialFromError(e){return ft.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:t,oauthAccessToken:r}=e;if(!t&&!r)return null;try{return ft.credential(t,r)}catch{return null}}}ft.GOOGLE_SIGN_IN_METHOD="google.com";ft.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 pt extends cr{constructor(){super("github.com")}static credential(e){return Bt._fromParams({providerId:pt.PROVIDER_ID,signInMethod:pt.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return pt.credentialFromTaggedObject(e)}static credentialFromError(e){return pt.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return pt.credential(e.oauthAccessToken)}catch{return null}}}pt.GITHUB_SIGN_IN_METHOD="github.com";pt.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 mt extends cr{constructor(){super("twitter.com")}static credential(e,t){return Bt._fromParams({providerId:mt.PROVIDER_ID,signInMethod:mt.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:t})}static credentialFromResult(e){return mt.credentialFromTaggedObject(e)}static credentialFromError(e){return mt.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthAccessToken:t,oauthTokenSecret:r}=e;if(!t||!r)return null;try{return mt.credential(t,r)}catch{return null}}}mt.TWITTER_SIGN_IN_METHOD="twitter.com";mt.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. + */class cn{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,t,r,s=!1){const o=await De._fromIdTokenResponse(e,r,s),a=rc(r);return new cn({user:o,providerId:a,_tokenResponse:r,operationType:t})}static async _forOperation(e,t,r){await e._updateTokensIfNecessary(r,!0);const s=rc(r);return new cn({user:e,providerId:s,_tokenResponse:r,operationType:t})}}function rc(n){return n.providerId?n.providerId:"phoneNumber"in n?"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 rs extends Ke{constructor(e,t,r,s){super(t.code,t.message),this.operationType=r,this.user=s,Object.setPrototypeOf(this,rs.prototype),this.customData={appName:e.name,tenantId:e.tenantId??void 0,_serverResponse:t.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(e,t,r,s){return new rs(e,t,r,s)}}function Wu(n,e,t,r){return(e==="reauthenticate"?t._getReauthenticationResolver(n):t._getIdTokenResponse(n)).catch(o=>{throw o.code==="auth/multi-factor-auth-required"?rs._fromErrorAndOperation(n,o,e,r):o})}async function Pp(n,e,t=!1){const r=await Xn(n,e._linkToIdToken(n.auth,await n.getIdToken()),t);return cn._forOperation(n,"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 Cp(n,e,t=!1){const{auth:r}=n;if(Ne(r.app))return Promise.reject(Lt(r));const s="reauthenticate";try{const o=await Xn(n,Wu(r,s,e,n),t);x(o.idToken,r,"internal-error");const a=Qi(o.idToken);x(a,r,"internal-error");const{sub:u}=a;return x(n.uid===u,r,"user-mismatch"),cn._forOperation(n,s,o)}catch(o){throw o?.code==="auth/user-not-found"&&rt(r,"user-mismatch"),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. + */async function bp(n,e,t=!1){if(Ne(n.app))return Promise.reject(Lt(n));const r="signIn",s=await Wu(n,r,e),o=await cn._fromIdTokenResponse(n,r,s);return t||await n._updateCurrentUser(o.user),o}function kp(n,e,t,r){return fe(n).onIdTokenChanged(e,t,r)}function Vp(n,e,t){return fe(n).beforeAuthStateChanged(e,t)}function DE(n,e,t,r){return fe(n).onAuthStateChanged(e,t,r)}const ss="__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 Ku{constructor(e,t){this.storageRetriever=e,this.type=t}_isAvailable(){try{return this.storage?(this.storage.setItem(ss,"1"),this.storage.removeItem(ss),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(e,t){return this.storage.setItem(e,JSON.stringify(t)),Promise.resolve()}_get(e){const t=this.storage.getItem(e);return Promise.resolve(t?JSON.parse(t):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}/** + * @license + * Copyright 2020 Google LLC + * + * 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 Np=1e3,Dp=10;class Qu extends Ku{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,t)=>this.onStorageEvent(e,t),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=ju(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const t of Object.keys(this.listeners)){const r=this.storage.getItem(t),s=this.localCache[t];r!==s&&e(t,s,r)}}onStorageEvent(e,t=!1){if(!e.key){this.forAllChangedKeys((a,u,h)=>{this.notifyListeners(a,h)});return}const r=e.key;t?this.detachListener():this.stopPolling();const s=()=>{const a=this.storage.getItem(r);!t&&this.localCache[r]===a||this.notifyListeners(r,a)},o=this.storage.getItem(r);hp()&&o!==e.newValue&&e.newValue!==e.oldValue?setTimeout(s,Dp):s()}notifyListeners(e,t){this.localCache[e]=t;const r=this.listeners[e];if(r)for(const s of Array.from(r))s(t&&JSON.parse(t))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,t,r)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:t,newValue:r}),!0)})},Np)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,t){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(e,t){await super._set(e,t),this.localCache[e]=JSON.stringify(t)}async _get(e){const t=await super._get(e);return this.localCache[e]=JSON.stringify(t),t}async _remove(e){await super._remove(e),delete this.localCache[e]}}Qu.type="LOCAL";const Op=Qu;/** + * @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 Xu extends Ku{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,t){}_removeListener(e,t){}}Xu.type="SESSION";const Yu=Xu;/** + * @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 Mp(n){return Promise.all(n.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(t){return{fulfilled:!1,reason:t}}}))}/** + * @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 Is{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const t=this.receivers.find(s=>s.isListeningto(e));if(t)return t;const r=new Is(e);return this.receivers.push(r),r}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const t=e,{eventId:r,eventType:s,data:o}=t.data,a=this.handlersMap[s];if(!a?.size)return;t.ports[0].postMessage({status:"ack",eventId:r,eventType:s});const u=Array.from(a).map(async d=>d(t.origin,o)),h=await Mp(u);t.ports[0].postMessage({status:"done",eventId:r,eventType:s,response:h})}_subscribe(e,t){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(t)}_unsubscribe(e,t){this.handlersMap[e]&&t&&this.handlersMap[e].delete(t),(!t||this.handlersMap[e].size===0)&&delete this.handlersMap[e],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}Is.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 Zi(n="",e=10){let t="";for(let r=0;r{const d=Zi("",20);s.port1.start();const p=setTimeout(()=>{h(new Error("unsupported_event"))},r);a={messageChannel:s,onMessage(y){const E=y;if(E.data.eventId===d)switch(E.data.status){case"ack":clearTimeout(p),o=setTimeout(()=>{h(new Error("timeout"))},3e3);break;case"done":clearTimeout(o),u(E.data.response);break;default:clearTimeout(p),clearTimeout(o),h(new Error("invalid_response"));break}}},this.handlers.add(a),s.port1.addEventListener("message",a.onMessage),this.target.postMessage({eventType:e,eventId:d,data:t},[s.port2])}).finally(()=>{a&&this.removeMessageHandler(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. + */function Be(){return window}function xp(n){Be().location.href=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. + */function Ju(){return typeof Be().WorkerGlobalScope<"u"&&typeof Be().importScripts=="function"}async function Up(){if(!navigator?.serviceWorker)return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function Fp(){return navigator?.serviceWorker?.controller||null}function Bp(){return Ju()?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 Zu="firebaseLocalStorageDb",qp=1,is="firebaseLocalStorage",el="fbase_key";class ur{constructor(e){this.request=e}toPromise(){return new Promise((e,t)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{t(this.request.error)})})}}function vs(n,e){return n.transaction([is],e?"readwrite":"readonly").objectStore(is)}function jp(){const n=indexedDB.deleteDatabase(Zu);return new ur(n).toPromise()}function Ai(){const n=indexedDB.open(Zu,qp);return new Promise((e,t)=>{n.addEventListener("error",()=>{t(n.error)}),n.addEventListener("upgradeneeded",()=>{const r=n.result;try{r.createObjectStore(is,{keyPath:el})}catch(s){t(s)}}),n.addEventListener("success",async()=>{const r=n.result;r.objectStoreNames.contains(is)?e(r):(r.close(),await jp(),e(await Ai()))})})}async function sc(n,e,t){const r=vs(n,!0).put({[el]:e,value:t});return new ur(r).toPromise()}async function $p(n,e){const t=vs(n,!1).get(e),r=await new ur(t).toPromise();return r===void 0?null:r.value}function ic(n,e){const t=vs(n,!0).delete(e);return new ur(t).toPromise()}const zp=800,Hp=3;class tl{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 Ai(),this.db)}async _withRetries(e){let t=0;for(;;)try{const r=await this._openDb();return await e(r)}catch(r){if(t++>Hp)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return Ju()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=Is._getInstance(Bp()),this.receiver._subscribe("keyChanged",async(e,t)=>({keyProcessed:(await this._poll()).includes(t.key)})),this.receiver._subscribe("ping",async(e,t)=>["keyChanged"])}async initializeSender(){if(this.activeServiceWorker=await Up(),!this.activeServiceWorker)return;this.sender=new Lp(this.activeServiceWorker);const e=await this.sender._send("ping",{},800);e&&e[0]?.fulfilled&&e[0]?.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(!(!this.sender||!this.activeServiceWorker||Fp()!==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 Ai();return await sc(e,ss,"1"),await ic(e,ss),!0}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,t){return this._withPendingWrite(async()=>(await this._withRetries(r=>sc(r,e,t)),this.localCache[e]=t,this.notifyServiceWorker(e)))}async _get(e){const t=await this._withRetries(r=>$p(r,e));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(t=>ic(t,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){const e=await this._withRetries(s=>{const o=vs(s,!1).getAll();return new ur(o).toPromise()});if(!e)return[];if(this.pendingWrites!==0)return[];const t=[],r=new Set;if(e.length!==0)for(const{fbase_key:s,value:o}of e)r.add(s),JSON.stringify(this.localCache[s])!==JSON.stringify(o)&&(this.notifyListeners(s,o),t.push(s));for(const s of Object.keys(this.localCache))this.localCache[s]&&!r.has(s)&&(this.notifyListeners(s,null),t.push(s));return t}notifyListeners(e,t){this.localCache[e]=t;const r=this.listeners[e];if(r)for(const s of Array.from(r))s(t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),zp)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,t){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&this.stopPolling()}}tl.type="LOCAL";const Gp=tl;new ar(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 Wp(n,e){return e?et(e):(x(n._popupRedirectResolver,n,"argument-error"),n._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 eo extends Hu{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return sn(e,this._buildIdpRequest())}_linkToIdToken(e,t){return sn(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return sn(e,this._buildIdpRequest())}_buildIdpRequest(e){const t={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(t.idToken=e),t}}function Kp(n){return bp(n.auth,new eo(n),n.bypassAuthState)}function Qp(n){const{auth:e,user:t}=n;return x(t,e,"internal-error"),Cp(t,new eo(n),n.bypassAuthState)}async function Xp(n){const{auth:e,user:t}=n;return x(t,e,"internal-error"),Pp(t,new eo(n),n.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 nl{constructor(e,t,r,s,o=!1){this.auth=e,this.resolver=r,this.user=s,this.bypassAuthState=o,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(t)?t:[t]}execute(){return new Promise(async(e,t)=>{this.pendingPromise={resolve:e,reject:t};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(r){this.reject(r)}})}async onAuthEvent(e){const{urlResponse:t,sessionId:r,postBody:s,tenantId:o,error:a,type:u}=e;if(a){this.reject(a);return}const h={auth:this.auth,requestUri:t,sessionId:r,tenantId:o||void 0,postBody:s||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(u)(h))}catch(d){this.reject(d)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return Kp;case"linkViaPopup":case"linkViaRedirect":return Xp;case"reauthViaPopup":case"reauthViaRedirect":return Qp;default:rt(this.auth,"internal-error")}}resolve(e){st(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){st(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 Yp=new ar(2e3,1e4);class tn extends nl{constructor(e,t,r,s,o){super(e,t,s,o),this.provider=r,this.authWindow=null,this.pollId=null,tn.currentPopupAction&&tn.currentPopupAction.cancel(),tn.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return x(e,this.auth,"internal-error"),e}async onExecution(){st(this.filter.length===1,"Popup operations only handle one event");const e=Zi();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(t=>{this.reject(t)}),this.resolver._isIframeWebStorageSupported(this.auth,t=>{t||this.reject(Fe(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){return this.authWindow?.associatedEvent||null}cancel(){this.reject(Fe(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,tn.currentPopupAction=null}pollUserCancellation(){const e=()=>{if(this.authWindow?.window?.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(Fe(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(e,Yp.get())};e()}}tn.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 Jp="pendingRedirect",zr=new Map;class Zp extends nl{constructor(e,t,r=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,r),this.eventId=null}async execute(){let e=zr.get(this.auth._key());if(!e){try{const r=await em(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(r)}catch(t){e=()=>Promise.reject(t)}zr.set(this.auth._key(),e)}return this.bypassAuthState||zr.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if(e.type==="signInViaRedirect")return super.onAuthEvent(e);if(e.type==="unknown"){this.resolve(null);return}if(e.eventId){const t=await this.auth._redirectUserForId(e.eventId);if(t)return this.user=t,super.onAuthEvent(e);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function em(n,e){const t=rm(e),r=nm(n);if(!await r._isAvailable())return!1;const s=await r._get(t)==="true";return await r._remove(t),s}function tm(n,e){zr.set(n._key(),e)}function nm(n){return et(n._redirectPersistence)}function rm(n){return $r(Jp,n.config.apiKey,n.name)}async function sm(n,e,t=!1){if(Ne(n.app))return Promise.reject(Lt(n));const r=Yi(n),s=Wp(r,e),a=await new Zp(r,s,t).execute();return a&&!t&&(delete a.user._redirectEventId,await r._persistUserIfCurrent(a.user),await r._setRedirectUser(null,e)),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. + */const im=600*1e3;class om{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let t=!1;return this.consumers.forEach(r=>{this.isEventForConsumer(e,r)&&(t=!0,this.sendToConsumer(e,r),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!am(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){if(e.error&&!rl(e)){const r=e.error.code?.split("auth/")[1]||"internal-error";t.onError(Fe(this.auth,r))}else t.onAuthEvent(e)}isEventForConsumer(e,t){const r=t.eventId===null||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&r}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=im&&this.cachedEventUids.clear(),this.cachedEventUids.has(oc(e))}saveEventToCache(e){this.cachedEventUids.add(oc(e)),this.lastProcessedEventTime=Date.now()}}function oc(n){return[n.type,n.eventId,n.sessionId,n.tenantId].filter(e=>e).join("-")}function rl({type:n,error:e}){return n==="unknown"&&e?.code==="auth/no-auth-event"}function am(n){switch(n.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return rl(n);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 cm(n,e={}){return mn(n,"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 um=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,lm=/^https?/;async function hm(n){if(n.config.emulator)return;const{authorizedDomains:e}=await cm(n);for(const t of e)try{if(dm(t))return}catch{}rt(n,"unauthorized-domain")}function dm(n){const e=vi(),{protocol:t,hostname:r}=new URL(e);if(n.startsWith("chrome-extension://")){const a=new URL(n);return a.hostname===""&&r===""?t==="chrome-extension:"&&n.replace("chrome-extension://","")===e.replace("chrome-extension://",""):t==="chrome-extension:"&&a.hostname===r}if(!lm.test(t))return!1;if(um.test(n))return r===n;const s=n.replace(/\./g,"\\.");return new RegExp("^(.+\\."+s+"|"+s+")$","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 fm=new ar(3e4,6e4);function ac(){const n=Be().___jsl;if(n?.H){for(const e of Object.keys(n.H))if(n.H[e].r=n.H[e].r||[],n.H[e].L=n.H[e].L||[],n.H[e].r=[...n.H[e].L],n.CP)for(let t=0;t{function r(){ac(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{ac(),t(Fe(n,"network-request-failed"))},timeout:fm.get()})}if(Be().gapi?.iframes?.Iframe)e(gapi.iframes.getContext());else if(Be().gapi?.load)r();else{const s=Tp("iframefcb");return Be()[s]=()=>{gapi.load?r():t(Fe(n,"network-request-failed"))},yp(`${Ep()}?onload=${s}`).catch(o=>t(o))}}).catch(e=>{throw Hr=null,e})}let Hr=null;function mm(n){return Hr=Hr||pm(n),Hr}/** + * @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 gm=new ar(5e3,15e3),_m="__/auth/iframe",ym="emulator/auth/iframe",Em={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},Tm=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function Im(n){const e=n.config;x(e.authDomain,n,"auth-domain-config-required");const t=e.emulator?Wi(e,ym):`https://${n.config.authDomain}/${_m}`,r={apiKey:e.apiKey,appName:n.name,v:zt},s=Tm.get(n.config.apiHost);s&&(r.eid=s);const o=n._getFrameworks();return o.length&&(r.fw=o.join(",")),`${t}?${or(r).slice(1)}`}async function vm(n){const e=await mm(n),t=Be().gapi;return x(t,n,"internal-error"),e.open({where:document.body,url:Im(n),messageHandlersFilter:t.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:Em,dontclear:!0},r=>new Promise(async(s,o)=>{await r.restyle({setHideOnLeave:!1});const a=Fe(n,"network-request-failed"),u=Be().setTimeout(()=>{o(a)},gm.get());function h(){Be().clearTimeout(u),s(r)}r.ping(h).then(h,()=>{o(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. + */const wm={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},Am=500,Rm=600,Sm="_blank",Pm="http://localhost";class cc{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function Cm(n,e,t,r=Am,s=Rm){const o=Math.max((window.screen.availHeight-s)/2,0).toString(),a=Math.max((window.screen.availWidth-r)/2,0).toString();let u="";const h={...wm,width:r.toString(),height:s.toString(),top:o,left:a},d=ve().toLowerCase();t&&(u=xu(d)?Sm:t),Mu(d)&&(e=e||Pm,h.scrollbars="yes");const p=Object.entries(h).reduce((E,[P,b])=>`${E}${P}=${b},`,"");if(lp(d)&&u!=="_self")return bm(e||"",u),new cc(null);const y=window.open(e||"",u,p);x(y,n,"popup-blocked");try{y.focus()}catch{}return new cc(y)}function bm(n,e){const t=document.createElement("a");t.href=n,t.target=e;const r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),t.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 km="__/auth/handler",Vm="emulator/auth/handler",Nm=encodeURIComponent("fac");async function uc(n,e,t,r,s,o){x(n.config.authDomain,n,"auth-domain-config-required"),x(n.config.apiKey,n,"invalid-api-key");const a={apiKey:n.config.apiKey,appName:n.name,authType:t,redirectUrl:r,v:zt,eventId:s};if(e instanceof Gu){e.setDefaultLanguage(n.languageCode),a.providerId=e.providerId||"",$d(e.getCustomParameters())||(a.customParameters=JSON.stringify(e.getCustomParameters()));for(const[p,y]of Object.entries({}))a[p]=y}if(e instanceof cr){const p=e.getScopes().filter(y=>y!=="");p.length>0&&(a.scopes=p.join(","))}n.tenantId&&(a.tid=n.tenantId);const u=a;for(const p of Object.keys(u))u[p]===void 0&&delete u[p];const h=await n._getAppCheckToken(),d=h?`#${Nm}=${encodeURIComponent(h)}`:"";return`${Dm(n)}?${or(u).slice(1)}${d}`}function Dm({config:n}){return n.emulator?Wi(n,Vm):`https://${n.authDomain}/${km}`}/** + * @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 di="webStorageSupport";class Om{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=Yu,this._completeRedirectFn=sm,this._overrideRedirectResult=tm}async _openPopup(e,t,r,s){st(this.eventManagers[e._key()]?.manager,"_initialize() not called before _openPopup()");const o=await uc(e,t,r,vi(),s);return Cm(e,o,Zi())}async _openRedirect(e,t,r,s){await this._originValidation(e);const o=await uc(e,t,r,vi(),s);return xp(o),new Promise(()=>{})}_initialize(e){const t=e._key();if(this.eventManagers[t]){const{manager:s,promise:o}=this.eventManagers[t];return s?Promise.resolve(s):(st(o,"If manager is not set, promise should be"),o)}const r=this.initAndGetManager(e);return this.eventManagers[t]={promise:r},r.catch(()=>{delete this.eventManagers[t]}),r}async initAndGetManager(e){const t=await vm(e),r=new om(e);return t.register("authEvent",s=>(x(s?.authEvent,e,"invalid-auth-event"),{status:r.onEvent(s.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:r},this.iframes[e._key()]=t,r}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send(di,{type:di},s=>{const o=s?.[0]?.[di];o!==void 0&&t(!!o),rt(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=hm(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return ju()||Lu()||Xi()}}const Mm=Om;var lc="@firebase/auth",hc="1.11.0";/** + * @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(e){this.auth=e,this.internalListeners=new Map}getUid(){return this.assertAuthConfigured(),this.auth.currentUser?.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 t=this.auth.onIdTokenChanged(r=>{e(r?.stsTokenManager.accessToken||null)});this.internalListeners.set(e,t),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}assertAuthConfigured(){x(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 xm(n){switch(n){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}function Um(n){Ft(new Tt("auth",(e,{options:t})=>{const r=e.getProvider("app").getImmediate(),s=e.getProvider("heartbeat"),o=e.getProvider("app-check-internal"),{apiKey:a,authDomain:u}=r.options;x(a&&!a.includes(":"),"invalid-api-key",{appName:r.name});const h={apiKey:a,authDomain:u,clientPlatform:n,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:$u(n)},d=new gp(r,s,o,h);return vp(d,t),d},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,r)=>{e.getProvider("auth-internal").initialize()})),Ft(new Tt("auth-internal",e=>{const t=Yi(e.getProvider("auth").getImmediate());return(r=>new Lm(r))(t)},"PRIVATE").setInstantiationMode("EXPLICIT")),Ue(lc,hc,xm(n)),Ue(lc,hc,"esm2020")}/** + * @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 Fm=300,Bm=wu("authIdTokenMaxAge")||Fm;let dc=null;const qm=n=>async e=>{const t=e&&await e.getIdTokenResult(),r=t&&(new Date().getTime()-Date.parse(t.issuedAtTime))/1e3;if(r&&r>Bm)return;const s=t?.token;dc!==s&&(dc=s,await fetch(n,{method:s?"POST":"DELETE",headers:s?{Authorization:`Bearer ${s}`}:{}}))};function OE(n=Hi()){const e=Ts(n,"auth");if(e.isInitialized())return e.getImmediate();const t=Ip(n,{popupRedirectResolver:Mm,persistence:[Gp,Op,Yu]}),r=wu("authTokenSyncURL");if(r&&typeof isSecureContext=="boolean"&&isSecureContext){const o=new URL(r,location.origin);if(location.origin===o.origin){const a=qm(o.toString());Vp(t,a,()=>a(t.currentUser)),kp(t,u=>a(u))}}const s=Tu("auth");return s&&wp(t,`http://${s}`),t}function jm(){return document.getElementsByTagName("head")?.[0]??document}_p({loadJS(n){return new Promise((e,t)=>{const r=document.createElement("script");r.setAttribute("src",n),r.onload=e,r.onerror=s=>{const o=Fe("internal-error");o.customData=s,t(o)},r.type="text/javascript",r.charset="UTF-8",jm().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="});Um("Browser");var $m="firebase",zm="12.0.0";/** + * @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. + */Ue($m,zm,"app");var fc=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 yt,sl;(function(){var n;/** @license + + Copyright The Closure Library Authors. + SPDX-License-Identifier: Apache-2.0 +*/function e(v,m){function _(){}_.prototype=m.prototype,v.D=m.prototype,v.prototype=new _,v.prototype.constructor=v,v.C=function(T,I,A){for(var g=Array(arguments.length-2),Xe=2;XeI;++I)T[I]=m.charCodeAt(_++)|m.charCodeAt(_++)<<8|m.charCodeAt(_++)<<16|m.charCodeAt(_++)<<24;else for(I=0;16>I;++I)T[I]=m[_++]|m[_++]<<8|m[_++]<<16|m[_++]<<24;m=v.g[0],_=v.g[1],I=v.g[2];var A=v.g[3],g=m+(A^_&(I^A))+T[0]+3614090360&4294967295;m=_+(g<<7&4294967295|g>>>25),g=A+(I^m&(_^I))+T[1]+3905402710&4294967295,A=m+(g<<12&4294967295|g>>>20),g=I+(_^A&(m^_))+T[2]+606105819&4294967295,I=A+(g<<17&4294967295|g>>>15),g=_+(m^I&(A^m))+T[3]+3250441966&4294967295,_=I+(g<<22&4294967295|g>>>10),g=m+(A^_&(I^A))+T[4]+4118548399&4294967295,m=_+(g<<7&4294967295|g>>>25),g=A+(I^m&(_^I))+T[5]+1200080426&4294967295,A=m+(g<<12&4294967295|g>>>20),g=I+(_^A&(m^_))+T[6]+2821735955&4294967295,I=A+(g<<17&4294967295|g>>>15),g=_+(m^I&(A^m))+T[7]+4249261313&4294967295,_=I+(g<<22&4294967295|g>>>10),g=m+(A^_&(I^A))+T[8]+1770035416&4294967295,m=_+(g<<7&4294967295|g>>>25),g=A+(I^m&(_^I))+T[9]+2336552879&4294967295,A=m+(g<<12&4294967295|g>>>20),g=I+(_^A&(m^_))+T[10]+4294925233&4294967295,I=A+(g<<17&4294967295|g>>>15),g=_+(m^I&(A^m))+T[11]+2304563134&4294967295,_=I+(g<<22&4294967295|g>>>10),g=m+(A^_&(I^A))+T[12]+1804603682&4294967295,m=_+(g<<7&4294967295|g>>>25),g=A+(I^m&(_^I))+T[13]+4254626195&4294967295,A=m+(g<<12&4294967295|g>>>20),g=I+(_^A&(m^_))+T[14]+2792965006&4294967295,I=A+(g<<17&4294967295|g>>>15),g=_+(m^I&(A^m))+T[15]+1236535329&4294967295,_=I+(g<<22&4294967295|g>>>10),g=m+(I^A&(_^I))+T[1]+4129170786&4294967295,m=_+(g<<5&4294967295|g>>>27),g=A+(_^I&(m^_))+T[6]+3225465664&4294967295,A=m+(g<<9&4294967295|g>>>23),g=I+(m^_&(A^m))+T[11]+643717713&4294967295,I=A+(g<<14&4294967295|g>>>18),g=_+(A^m&(I^A))+T[0]+3921069994&4294967295,_=I+(g<<20&4294967295|g>>>12),g=m+(I^A&(_^I))+T[5]+3593408605&4294967295,m=_+(g<<5&4294967295|g>>>27),g=A+(_^I&(m^_))+T[10]+38016083&4294967295,A=m+(g<<9&4294967295|g>>>23),g=I+(m^_&(A^m))+T[15]+3634488961&4294967295,I=A+(g<<14&4294967295|g>>>18),g=_+(A^m&(I^A))+T[4]+3889429448&4294967295,_=I+(g<<20&4294967295|g>>>12),g=m+(I^A&(_^I))+T[9]+568446438&4294967295,m=_+(g<<5&4294967295|g>>>27),g=A+(_^I&(m^_))+T[14]+3275163606&4294967295,A=m+(g<<9&4294967295|g>>>23),g=I+(m^_&(A^m))+T[3]+4107603335&4294967295,I=A+(g<<14&4294967295|g>>>18),g=_+(A^m&(I^A))+T[8]+1163531501&4294967295,_=I+(g<<20&4294967295|g>>>12),g=m+(I^A&(_^I))+T[13]+2850285829&4294967295,m=_+(g<<5&4294967295|g>>>27),g=A+(_^I&(m^_))+T[2]+4243563512&4294967295,A=m+(g<<9&4294967295|g>>>23),g=I+(m^_&(A^m))+T[7]+1735328473&4294967295,I=A+(g<<14&4294967295|g>>>18),g=_+(A^m&(I^A))+T[12]+2368359562&4294967295,_=I+(g<<20&4294967295|g>>>12),g=m+(_^I^A)+T[5]+4294588738&4294967295,m=_+(g<<4&4294967295|g>>>28),g=A+(m^_^I)+T[8]+2272392833&4294967295,A=m+(g<<11&4294967295|g>>>21),g=I+(A^m^_)+T[11]+1839030562&4294967295,I=A+(g<<16&4294967295|g>>>16),g=_+(I^A^m)+T[14]+4259657740&4294967295,_=I+(g<<23&4294967295|g>>>9),g=m+(_^I^A)+T[1]+2763975236&4294967295,m=_+(g<<4&4294967295|g>>>28),g=A+(m^_^I)+T[4]+1272893353&4294967295,A=m+(g<<11&4294967295|g>>>21),g=I+(A^m^_)+T[7]+4139469664&4294967295,I=A+(g<<16&4294967295|g>>>16),g=_+(I^A^m)+T[10]+3200236656&4294967295,_=I+(g<<23&4294967295|g>>>9),g=m+(_^I^A)+T[13]+681279174&4294967295,m=_+(g<<4&4294967295|g>>>28),g=A+(m^_^I)+T[0]+3936430074&4294967295,A=m+(g<<11&4294967295|g>>>21),g=I+(A^m^_)+T[3]+3572445317&4294967295,I=A+(g<<16&4294967295|g>>>16),g=_+(I^A^m)+T[6]+76029189&4294967295,_=I+(g<<23&4294967295|g>>>9),g=m+(_^I^A)+T[9]+3654602809&4294967295,m=_+(g<<4&4294967295|g>>>28),g=A+(m^_^I)+T[12]+3873151461&4294967295,A=m+(g<<11&4294967295|g>>>21),g=I+(A^m^_)+T[15]+530742520&4294967295,I=A+(g<<16&4294967295|g>>>16),g=_+(I^A^m)+T[2]+3299628645&4294967295,_=I+(g<<23&4294967295|g>>>9),g=m+(I^(_|~A))+T[0]+4096336452&4294967295,m=_+(g<<6&4294967295|g>>>26),g=A+(_^(m|~I))+T[7]+1126891415&4294967295,A=m+(g<<10&4294967295|g>>>22),g=I+(m^(A|~_))+T[14]+2878612391&4294967295,I=A+(g<<15&4294967295|g>>>17),g=_+(A^(I|~m))+T[5]+4237533241&4294967295,_=I+(g<<21&4294967295|g>>>11),g=m+(I^(_|~A))+T[12]+1700485571&4294967295,m=_+(g<<6&4294967295|g>>>26),g=A+(_^(m|~I))+T[3]+2399980690&4294967295,A=m+(g<<10&4294967295|g>>>22),g=I+(m^(A|~_))+T[10]+4293915773&4294967295,I=A+(g<<15&4294967295|g>>>17),g=_+(A^(I|~m))+T[1]+2240044497&4294967295,_=I+(g<<21&4294967295|g>>>11),g=m+(I^(_|~A))+T[8]+1873313359&4294967295,m=_+(g<<6&4294967295|g>>>26),g=A+(_^(m|~I))+T[15]+4264355552&4294967295,A=m+(g<<10&4294967295|g>>>22),g=I+(m^(A|~_))+T[6]+2734768916&4294967295,I=A+(g<<15&4294967295|g>>>17),g=_+(A^(I|~m))+T[13]+1309151649&4294967295,_=I+(g<<21&4294967295|g>>>11),g=m+(I^(_|~A))+T[4]+4149444226&4294967295,m=_+(g<<6&4294967295|g>>>26),g=A+(_^(m|~I))+T[11]+3174756917&4294967295,A=m+(g<<10&4294967295|g>>>22),g=I+(m^(A|~_))+T[2]+718787259&4294967295,I=A+(g<<15&4294967295|g>>>17),g=_+(A^(I|~m))+T[9]+3951481745&4294967295,v.g[0]=v.g[0]+m&4294967295,v.g[1]=v.g[1]+(I+(g<<21&4294967295|g>>>11))&4294967295,v.g[2]=v.g[2]+I&4294967295,v.g[3]=v.g[3]+A&4294967295}r.prototype.u=function(v,m){m===void 0&&(m=v.length);for(var _=m-this.blockSize,T=this.B,I=this.h,A=0;Athis.h?this.blockSize:2*this.blockSize)-this.h);v[0]=128;for(var m=1;mm;++m)for(var T=0;32>T;T+=8)v[_++]=this.g[m]>>>T&255;return v};function o(v,m){var _=u;return Object.prototype.hasOwnProperty.call(_,v)?_[v]:_[v]=m(v)}function a(v,m){this.h=m;for(var _=[],T=!0,I=v.length-1;0<=I;I--){var A=v[I]|0;T&&A==m||(_[I]=A,T=!1)}this.g=_}var u={};function h(v){return-128<=v&&128>v?o(v,function(m){return new a([m|0],0>m?-1:0)}):new a([v|0],0>v?-1:0)}function d(v){if(isNaN(v)||!isFinite(v))return y;if(0>v)return k(d(-v));for(var m=[],_=1,T=0;v>=_;T++)m[T]=v/_|0,_*=4294967296;return new a(m,0)}function p(v,m){if(v.length==0)throw Error("number format error: empty string");if(m=m||10,2>m||36A?(A=d(Math.pow(m,A)),T=T.j(A).add(d(g))):(T=T.j(_),T=T.add(d(g)))}return T}var y=h(0),E=h(1),P=h(16777216);n=a.prototype,n.m=function(){if(O(this))return-k(this).m();for(var v=0,m=1,_=0;_v||36>>0).toString(v);if(_=I,b(_))return A+T;for(;6>A.length;)A="0"+A;T=A+T}},n.i=function(v){return 0>v?0:v>>16)+(this.i(I)>>>16)+(v.i(I)>>>16);T=g>>>16,A&=65535,g&=65535,_[I]=g<<16|A}return new a(_,_[_.length-1]&-2147483648?-1:0)};function q(v,m){return v.add(k(m))}n.j=function(v){if(b(this)||b(v))return y;if(O(this))return O(v)?k(this).j(k(v)):k(k(this).j(v));if(O(v))return k(this.j(k(v)));if(0>this.l(P)&&0>v.l(P))return d(this.m()*v.m());for(var m=this.g.length+v.g.length,_=[],T=0;T<2*m;T++)_[T]=0;for(T=0;T>>16,g=this.i(T)&65535,Xe=v.i(I)>>>16,vn=v.i(I)&65535;_[2*T+2*I]+=g*vn,j(_,2*T+2*I),_[2*T+2*I+1]+=A*vn,j(_,2*T+2*I+1),_[2*T+2*I+1]+=g*Xe,j(_,2*T+2*I+1),_[2*T+2*I+2]+=A*Xe,j(_,2*T+2*I+2)}for(T=0;T>>16,v[m]&=65535,m++}function B(v,m){this.g=v,this.h=m}function Q(v,m){if(b(m))throw Error("division by zero");if(b(v))return new B(y,y);if(O(v))return m=Q(k(v),m),new B(k(m.g),k(m.h));if(O(m))return m=Q(v,k(m)),new B(k(m.g),m.h);if(30=T.l(v);)_=we(_),T=we(T);var I=se(_,1),A=se(T,1);for(T=se(T,2),_=se(_,2);!b(T);){var g=A.add(T);0>=g.l(v)&&(I=I.add(_),A=g),T=se(T,1),_=se(_,1)}return m=q(v,I.j(m)),new B(I,m)}for(I=y;0<=v.l(m);){for(_=Math.max(1,Math.floor(v.m()/m.m())),T=Math.ceil(Math.log(_)/Math.LN2),T=48>=T?1:Math.pow(2,T-48),A=d(_),g=A.j(m);O(g)||0>>31;return new a(_,v.h)}function se(v,m){var _=m>>5;m%=32;for(var T=v.g.length-_,I=[],A=0;A>>m|v.i(A+_+1)<<32-m:v.i(A+_);return new a(I,v.h)}r.prototype.digest=r.prototype.v,r.prototype.reset=r.prototype.s,r.prototype.update=r.prototype.u,sl=r,a.prototype.add=a.prototype.add,a.prototype.multiply=a.prototype.j,a.prototype.modulo=a.prototype.A,a.prototype.compare=a.prototype.l,a.prototype.toNumber=a.prototype.m,a.prototype.toString=a.prototype.toString,a.prototype.getBits=a.prototype.i,a.fromNumber=d,a.fromString=p,yt=a}).apply(typeof fc<"u"?fc:typeof self<"u"?self:typeof window<"u"?window:{});var Lr=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 il,Fn,ol,Gr,Ri,al,cl,ul;(function(){var n,e=typeof Object.defineProperties=="function"?Object.defineProperty:function(i,c,l){return i==Array.prototype||i==Object.prototype||(i[c]=l.value),i};function t(i){i=[typeof globalThis=="object"&&globalThis,i,typeof window=="object"&&window,typeof self=="object"&&self,typeof Lr=="object"&&Lr];for(var c=0;c{throw i},0)}function g(){var i=Fs;let c=null;return i.g&&(c=i.g,i.g=i.g.next,i.g||(i.h=null),c.next=null),c}class Xe{constructor(){this.h=this.g=null}add(c,l){const f=vn.get();f.set(c,l),this.h?this.h.next=f:this.g=f,this.h=f}}var vn=new q(()=>new Uh,i=>i.reset());class Uh{constructor(){this.next=this.g=this.h=null}set(c,l){this.h=c,this.g=l,this.next=null}reset(){this.next=this.g=this.h=null}}let wn,An=!1,Fs=new Xe,jo=()=>{const i=u.Promise.resolve(void 0);wn=()=>{i.then(Fh)}};var Fh=()=>{for(var i;i=g();){try{i.h.call(i.g)}catch(l){A(l)}var c=vn;c.j(i),100>c.h&&(c.h++,i.next=c.g,c.g=i)}An=!1};function at(){this.s=this.s,this.C=this.C}at.prototype.s=!1,at.prototype.ma=function(){this.s||(this.s=!0,this.N())},at.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()};function me(i,c){this.type=i,this.g=this.target=c,this.defaultPrevented=!1}me.prototype.h=function(){this.defaultPrevented=!0};var Bh=function(){if(!u.addEventListener||!Object.defineProperty)return!1;var i=!1,c=Object.defineProperty({},"passive",{get:function(){i=!0}});try{const l=()=>{};u.addEventListener("test",l,c),u.removeEventListener("test",l,c)}catch{}return i}();function Rn(i,c){if(me.call(this,i?i.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,i){var l=this.type=i.type,f=i.changedTouches&&i.changedTouches.length?i.changedTouches[0]:null;if(this.target=i.target||i.srcElement,this.g=c,c=i.relatedTarget){if(we){e:{try{Q(c.nodeName);var w=!0;break e}catch{}w=!1}w||(c=null)}}else l=="mouseover"?c=i.fromElement:l=="mouseout"&&(c=i.toElement);this.relatedTarget=c,f?(this.clientX=f.clientX!==void 0?f.clientX:f.pageX,this.clientY=f.clientY!==void 0?f.clientY:f.pageY,this.screenX=f.screenX||0,this.screenY=f.screenY||0):(this.clientX=i.clientX!==void 0?i.clientX:i.pageX,this.clientY=i.clientY!==void 0?i.clientY:i.pageY,this.screenX=i.screenX||0,this.screenY=i.screenY||0),this.button=i.button,this.key=i.key||"",this.ctrlKey=i.ctrlKey,this.altKey=i.altKey,this.shiftKey=i.shiftKey,this.metaKey=i.metaKey,this.pointerId=i.pointerId||0,this.pointerType=typeof i.pointerType=="string"?i.pointerType:qh[i.pointerType]||"",this.state=i.state,this.i=i,i.defaultPrevented&&Rn.aa.h.call(this)}}b(Rn,me);var qh={2:"touch",3:"pen",4:"mouse"};Rn.prototype.h=function(){Rn.aa.h.call(this);var i=this.i;i.preventDefault?i.preventDefault():i.returnValue=!1};var gr="closure_listenable_"+(1e6*Math.random()|0),jh=0;function $h(i,c,l,f,w){this.listener=i,this.proxy=null,this.src=c,this.type=l,this.capture=!!f,this.ha=w,this.key=++jh,this.da=this.fa=!1}function _r(i){i.da=!0,i.listener=null,i.proxy=null,i.src=null,i.ha=null}function yr(i){this.src=i,this.g={},this.h=0}yr.prototype.add=function(i,c,l,f,w){var R=i.toString();i=this.g[R],i||(i=this.g[R]=[],this.h++);var V=qs(i,c,f,w);return-1>>0);function Go(i){return typeof i=="function"?i:(i[Gs]||(i[Gs]=function(c){return i.handleEvent(c)}),i[Gs])}function ge(){at.call(this),this.i=new yr(this),this.M=this,this.F=null}b(ge,at),ge.prototype[gr]=!0,ge.prototype.removeEventListener=function(i,c,l,f){zo(this,i,c,l,f)};function Ae(i,c){var l,f=i.F;if(f)for(l=[];f;f=f.F)l.push(f);if(i=i.M,f=c.type||c,typeof c=="string")c=new me(c,i);else if(c instanceof me)c.target=c.target||i;else{var w=c;c=new me(f,i),T(c,w)}if(w=!0,l)for(var R=l.length-1;0<=R;R--){var V=c.g=l[R];w=Er(V,f,!0,c)&&w}if(V=c.g=i,w=Er(V,f,!0,c)&&w,w=Er(V,f,!1,c)&&w,l)for(R=0;R{i.g=null,i.i&&(i.i=!1,Ko(i))},i.l);const c=i.h;i.h=null,i.m.apply(null,c)}class Wh extends at{constructor(c,l){super(),this.m=c,this.l=l,this.h=null,this.i=!1,this.g=null}j(c){this.h=arguments,this.g?this.i=!0:Ko(this)}N(){super.N(),this.g&&(u.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function Sn(i){at.call(this),this.h=i,this.g={}}b(Sn,at);var Qo=[];function Xo(i){se(i.g,function(c,l){this.g.hasOwnProperty(l)&&zs(c)},i),i.g={}}Sn.prototype.N=function(){Sn.aa.N.call(this),Xo(this)},Sn.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var Ws=u.JSON.stringify,Kh=u.JSON.parse,Qh=class{stringify(i){return u.JSON.stringify(i,void 0)}parse(i){return u.JSON.parse(i,void 0)}};function Ks(){}Ks.prototype.h=null;function Yo(i){return i.h||(i.h=i.i())}function Jo(){}var Pn={OPEN:"a",kb:"b",Ja:"c",wb:"d"};function Qs(){me.call(this,"d")}b(Qs,me);function Xs(){me.call(this,"c")}b(Xs,me);var kt={},Zo=null;function Tr(){return Zo=Zo||new ge}kt.La="serverreachability";function ea(i){me.call(this,kt.La,i)}b(ea,me);function Cn(i){const c=Tr();Ae(c,new ea(c))}kt.STAT_EVENT="statevent";function ta(i,c){me.call(this,kt.STAT_EVENT,i),this.stat=c}b(ta,me);function Re(i){const c=Tr();Ae(c,new ta(c,i))}kt.Ma="timingevent";function na(i,c){me.call(this,kt.Ma,i),this.size=c}b(na,me);function bn(i,c){if(typeof i!="function")throw Error("Fn must not be null and must be a function");return u.setTimeout(function(){i()},c)}function kn(){this.g=!0}kn.prototype.xa=function(){this.g=!1};function Xh(i,c,l,f,w,R){i.info(function(){if(i.g)if(R)for(var V="",X=R.split("&"),le=0;lef.length)){var w=f[1];if(Array.isArray(w)&&!(1>w.length)){var R=w[0];if(R!="noop"&&R!="stop"&&R!="close")for(var V=1;Vye)&&(ye!=3||this.g&&(this.h.h||this.g.oa()||Pa(this.g)))){this.J||ye!=4||c==7||(c==8||0>=Xt?Cn(3):Cn(2)),ei(this);var l=this.g.Z();this.X=l;t:if(aa(this)){var f=Pa(this.g);i="";var w=f.length,R=Je(this.g)==4;if(!this.h.i){if(typeof TextDecoder>"u"){Vt(this),Vn(this);var V="";break t}this.h.i=new u.TextDecoder}for(c=0;cc.length?Js:(c=c.slice(f,f+l),i.C=f+l,c)))}ct.prototype.cancel=function(){this.J=!0,Vt(this)};function wr(i){i.S=Date.now()+i.I,ca(i,i.I)}function ca(i,c){if(i.B!=null)throw Error("WatchDog timer not null");i.B=bn(E(i.ba,i),c)}function ei(i){i.B&&(u.clearTimeout(i.B),i.B=null)}ct.prototype.ba=function(){this.B=null;const i=Date.now();0<=i-this.S?(Jh(this.i,this.A),this.L!=2&&(Cn(),Re(17)),Vt(this),this.s=2,Vn(this)):ca(this,this.S-i)};function Vn(i){i.j.G==0||i.J||Oa(i.j,i)}function Vt(i){ei(i);var c=i.M;c&&typeof c.ma=="function"&&c.ma(),i.M=null,Xo(i.U),i.g&&(c=i.g,i.g=null,c.abort(),c.ma())}function ti(i,c){try{var l=i.j;if(l.G!=0&&(l.g==i||ni(l.h,i))){if(!i.K&&ni(l.h,i)&&l.G==3){try{var f=l.Da.g.parse(c)}catch{f=null}if(Array.isArray(f)&&f.length==3){var w=f;if(w[0]==0){e:if(!l.u){if(l.g)if(l.g.F+3e3w[2]&&l.F&&l.v==0&&!l.C&&(l.C=bn(E(l.Za,l),6e3));if(1>=ha(l.h)&&l.ca){try{l.ca()}catch{}l.ca=void 0}}else Dt(l,11)}else if((i.K||l.g==i)&&Nr(l),!j(c))for(w=l.Da.g.parse(c),c=0;c=i.j:!1}function ha(i){return i.h?1:i.g?i.g.size:0}function ni(i,c){return i.h?i.h==c:i.g?i.g.has(c):!1}function ri(i,c){i.g?i.g.add(c):i.h=c}function da(i,c){i.h&&i.h==c?i.h=null:i.g&&i.g.has(c)&&i.g.delete(c)}ua.prototype.cancel=function(){if(this.i=fa(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&this.g.size!==0){for(const i of this.g.values())i.cancel();this.g.clear()}};function fa(i){if(i.h!=null)return i.i.concat(i.h.D);if(i.g!=null&&i.g.size!==0){let c=i.i;for(const l of i.g.values())c=c.concat(l.D);return c}return O(i.i)}function nd(i){if(i.V&&typeof i.V=="function")return i.V();if(typeof Map<"u"&&i instanceof Map||typeof Set<"u"&&i instanceof Set)return Array.from(i.values());if(typeof i=="string")return i.split("");if(h(i)){for(var c=[],l=i.length,f=0;fc)throw Error("Bad port number "+c);i.s=c}else i.s=null}function ga(i,c,l){c instanceof On?(i.i=c,ld(i.i,i.h)):(l||(c=Dn(c,cd)),i.i=new On(c,i.h))}function J(i,c,l){i.i.set(c,l)}function Sr(i){return J(i,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),i}function Nn(i,c){return i?c?decodeURI(i.replace(/%25/g,"%2525")):decodeURIComponent(i):""}function Dn(i,c,l){return typeof i=="string"?(i=encodeURI(i).replace(c,id),l&&(i=i.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),i):null}function id(i){return i=i.charCodeAt(0),"%"+(i>>4&15).toString(16)+(i&15).toString(16)}var _a=/[#\/\?@]/g,od=/[#\?:]/g,ad=/[#\?]/g,cd=/[#\?@]/g,ud=/#/g;function On(i,c){this.h=this.g=null,this.i=i||null,this.j=!!c}function ut(i){i.g||(i.g=new Map,i.h=0,i.i&&sd(i.i,function(c,l){i.add(decodeURIComponent(c.replace(/\+/g," ")),l)}))}n=On.prototype,n.add=function(i,c){ut(this),this.i=null,i=Kt(this,i);var l=this.g.get(i);return l||this.g.set(i,l=[]),l.push(c),this.h+=1,this};function ya(i,c){ut(i),c=Kt(i,c),i.g.has(c)&&(i.i=null,i.h-=i.g.get(c).length,i.g.delete(c))}function Ea(i,c){return ut(i),c=Kt(i,c),i.g.has(c)}n.forEach=function(i,c){ut(this),this.g.forEach(function(l,f){l.forEach(function(w){i.call(c,w,f,this)},this)},this)},n.na=function(){ut(this);const i=Array.from(this.g.values()),c=Array.from(this.g.keys()),l=[];for(let f=0;f{f.abort(),lt(l,"TestPingServer: timeout",!1,c)},1e4);fetch(i,{signal:f.signal}).then(R=>{clearTimeout(w),R.ok?lt(l,"TestPingServer: ok",!0,c):lt(l,"TestPingServer: server error",!1,c)}).catch(()=>{clearTimeout(w),lt(l,"TestPingServer: error",!1,c)})}function lt(i,c,l,f,w){try{w&&(w.onload=null,w.onerror=null,w.onabort=null,w.ontimeout=null),f(l)}catch{}}function fd(){this.g=new Qh}function pd(i,c,l){const f=l||"";try{pa(i,function(w,R){let V=w;d(w)&&(V=Ws(w)),c.push(f+R+"="+encodeURIComponent(V))})}catch(w){throw c.push(f+"type="+encodeURIComponent("_badmap")),w}}function Pr(i){this.l=i.Ub||null,this.j=i.eb||!1}b(Pr,Ks),Pr.prototype.g=function(){return new Cr(this.l,this.j)},Pr.prototype.i=function(i){return function(){return i}}({});function Cr(i,c){ge.call(this),this.D=i,this.o=c,this.m=void 0,this.status=this.readyState=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.u=new Headers,this.h=null,this.B="GET",this.A="",this.g=!1,this.v=this.j=this.l=null}b(Cr,ge),n=Cr.prototype,n.open=function(i,c){if(this.readyState!=0)throw this.abort(),Error("Error reopening a connection");this.B=i,this.A=c,this.readyState=1,Ln(this)},n.send=function(i){if(this.readyState!=1)throw this.abort(),Error("need to call open() first. ");this.g=!0;const c={headers:this.u,method:this.B,credentials:this.m,cache:void 0};i&&(c.body=i),(this.D||u).fetch(new Request(this.A,c)).then(this.Sa.bind(this),this.ga.bind(this))},n.abort=function(){this.response=this.responseText="",this.u=new Headers,this.status=0,this.j&&this.j.cancel("Request was aborted.").catch(()=>{}),1<=this.readyState&&this.g&&this.readyState!=4&&(this.g=!1,Mn(this)),this.readyState=0},n.Sa=function(i){if(this.g&&(this.l=i,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=i.headers,this.readyState=2,Ln(this)),this.g&&(this.readyState=3,Ln(this),this.g)))if(this.responseType==="arraybuffer")i.arrayBuffer().then(this.Qa.bind(this),this.ga.bind(this));else if(typeof u.ReadableStream<"u"&&"body"in i){if(this.j=i.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;Ia(this)}else i.text().then(this.Ra.bind(this),this.ga.bind(this))};function Ia(i){i.j.read().then(i.Pa.bind(i)).catch(i.ga.bind(i))}n.Pa=function(i){if(this.g){if(this.o&&i.value)this.response.push(i.value);else if(!this.o){var c=i.value?i.value:new Uint8Array(0);(c=this.v.decode(c,{stream:!i.done}))&&(this.response=this.responseText+=c)}i.done?Mn(this):Ln(this),this.readyState==3&&Ia(this)}},n.Ra=function(i){this.g&&(this.response=this.responseText=i,Mn(this))},n.Qa=function(i){this.g&&(this.response=i,Mn(this))},n.ga=function(){this.g&&Mn(this)};function Mn(i){i.readyState=4,i.l=null,i.j=null,i.v=null,Ln(i)}n.setRequestHeader=function(i,c){this.u.append(i,c)},n.getResponseHeader=function(i){return this.h&&this.h.get(i.toLowerCase())||""},n.getAllResponseHeaders=function(){if(!this.h)return"";const i=[],c=this.h.entries();for(var l=c.next();!l.done;)l=l.value,i.push(l[0]+": "+l[1]),l=c.next();return i.join(`\r +`)};function Ln(i){i.onreadystatechange&&i.onreadystatechange.call(i)}Object.defineProperty(Cr.prototype,"withCredentials",{get:function(){return this.m==="include"},set:function(i){this.m=i?"include":"same-origin"}});function va(i){let c="";return se(i,function(l,f){c+=f,c+=":",c+=l,c+=`\r +`}),c}function si(i,c,l){e:{for(f in l){var f=!1;break e}f=!0}f||(l=va(l),typeof i=="string"?l!=null&&encodeURIComponent(String(l)):J(i,c,l))}function te(i){ge.call(this),this.headers=new Map,this.o=i||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}b(te,ge);var md=/^https?$/i,gd=["POST","PUT"];n=te.prototype,n.Ha=function(i){this.J=i},n.ea=function(i,c,l,f){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+i);c=c?c.toUpperCase():"GET",this.D=i,this.l="",this.m=0,this.A=!1,this.h=!0,this.g=this.o?this.o.g():Ys.g(),this.v=this.o?Yo(this.o):Yo(Ys),this.g.onreadystatechange=E(this.Ea,this);try{this.B=!0,this.g.open(c,String(i),!0),this.B=!1}catch(R){wa(this,R);return}if(i=l||"",l=new Map(this.headers),f)if(Object.getPrototypeOf(f)===Object.prototype)for(var w in f)l.set(w,f[w]);else if(typeof f.keys=="function"&&typeof f.get=="function")for(const R of f.keys())l.set(R,f.get(R));else throw Error("Unknown input type for opt_headers: "+String(f));f=Array.from(l.keys()).find(R=>R.toLowerCase()=="content-type"),w=u.FormData&&i instanceof u.FormData,!(0<=Array.prototype.indexOf.call(gd,c,void 0))||f||w||l.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[R,V]of l)this.g.setRequestHeader(R,V);this.H&&(this.g.responseType=this.H),"withCredentials"in this.g&&this.g.withCredentials!==this.J&&(this.g.withCredentials=this.J);try{Sa(this),this.u=!0,this.g.send(i),this.u=!1}catch(R){wa(this,R)}};function wa(i,c){i.h=!1,i.g&&(i.j=!0,i.g.abort(),i.j=!1),i.l=c,i.m=5,Aa(i),br(i)}function Aa(i){i.A||(i.A=!0,Ae(i,"complete"),Ae(i,"error"))}n.abort=function(i){this.g&&this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1,this.m=i||7,Ae(this,"complete"),Ae(this,"abort"),br(this))},n.N=function(){this.g&&(this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1),br(this,!0)),te.aa.N.call(this)},n.Ea=function(){this.s||(this.B||this.u||this.j?Ra(this):this.bb())},n.bb=function(){Ra(this)};function Ra(i){if(i.h&&typeof a<"u"&&(!i.v[1]||Je(i)!=4||i.Z()!=2)){if(i.u&&Je(i)==4)Wo(i.Ea,0,i);else if(Ae(i,"readystatechange"),Je(i)==4){i.h=!1;try{const V=i.Z();e:switch(V){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var c=!0;break e;default:c=!1}var l;if(!(l=c)){var f;if(f=V===0){var w=String(i.D).match(ma)[1]||null;!w&&u.self&&u.self.location&&(w=u.self.location.protocol.slice(0,-1)),f=!md.test(w?w.toLowerCase():"")}l=f}if(l)Ae(i,"complete"),Ae(i,"success");else{i.m=6;try{var R=2{}:null;i.g=null,i.v=null,c||Ae(i,"ready");try{l.onreadystatechange=f}catch{}}}function Sa(i){i.I&&(u.clearTimeout(i.I),i.I=null)}n.isActive=function(){return!!this.g};function Je(i){return i.g?i.g.readyState:0}n.Z=function(){try{return 2=i.h.j-(i.s?1:0)?!1:i.s?(i.i=c.D.concat(i.i),!0):i.G==1||i.G==2||i.B>=(i.Va?0:i.Wa)?!1:(i.s=bn(E(i.Ga,i,c),Ma(i,i.B)),i.B++,!0)}n.Ga=function(i){if(this.s)if(this.s=null,this.G==1){if(!i){this.U=Math.floor(1e5*Math.random()),i=this.U++;const w=new ct(this,this.j,i);let R=this.o;if(this.S&&(R?(R=m(R),T(R,this.S)):R=this.S),this.m!==null||this.O||(w.H=R,R=null),this.P)e:{for(var c=0,l=0;lW)R=Math.max(0,w[le].g-100),X=!1;else try{pd(_e,V,"req"+W+"_")}catch{f&&f(_e)}}if(X){f=V.join("&");break e}}}return i=i.i.splice(0,l),c.D=i,f}function Na(i){if(!i.g&&!i.u){i.Y=1;var c=i.Fa;wn||jo(),An||(wn(),An=!0),Fs.add(c,i),i.v=0}}function oi(i){return i.g||i.u||3<=i.v?!1:(i.Y++,i.u=bn(E(i.Fa,i),Ma(i,i.v)),i.v++,!0)}n.Fa=function(){if(this.u=null,Da(this),this.ba&&!(this.M||this.g==null||0>=this.R)){var i=2*this.R;this.j.info("BP detection timer enabled: "+i),this.A=bn(E(this.ab,this),i)}},n.ab=function(){this.A&&(this.A=null,this.j.info("BP detection timeout reached."),this.j.info("Buffering proxy detected and switch to long-polling!"),this.F=!1,this.M=!0,Re(10),kr(this),Da(this))};function ai(i){i.A!=null&&(u.clearTimeout(i.A),i.A=null)}function Da(i){i.g=new ct(i,i.j,"rpc",i.Y),i.m===null&&(i.g.H=i.o),i.g.O=0;var c=Ye(i.qa);J(c,"RID","rpc"),J(c,"SID",i.K),J(c,"AID",i.T),J(c,"CI",i.F?"0":"1"),!i.F&&i.ja&&J(c,"TO",i.ja),J(c,"TYPE","xmlhttp"),Un(i,c),i.m&&i.o&&si(c,i.m,i.o),i.L&&(i.g.I=i.L);var l=i.g;i=i.ia,l.L=1,l.v=Sr(Ye(c)),l.m=null,l.P=!0,oa(l,i)}n.Za=function(){this.C!=null&&(this.C=null,kr(this),oi(this),Re(19))};function Nr(i){i.C!=null&&(u.clearTimeout(i.C),i.C=null)}function Oa(i,c){var l=null;if(i.g==c){Nr(i),ai(i),i.g=null;var f=2}else if(ni(i.h,c))l=c.D,da(i.h,c),f=1;else return;if(i.G!=0){if(c.o)if(f==1){l=c.m?c.m.length:0,c=Date.now()-c.F;var w=i.B;f=Tr(),Ae(f,new na(f,l)),Vr(i)}else Na(i);else if(w=c.s,w==3||w==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 tt{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=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 hl{constructor(e,t){this.user=t,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${e}`)}}class Hm{getToken(){return Promise.resolve(null)}invalidateToken(){}start(e,t){e.enqueueRetryable(()=>t(Te.UNAUTHENTICATED))}shutdown(){}}class Gm{constructor(e){this.token=e,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(e,t){this.changeListener=t,e.enqueueRetryable(()=>t(this.token.user))}shutdown(){this.changeListener=null}}class Wm{constructor(e){this.t=e,this.currentUser=Te.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(e,t){K(this.o===void 0,42304);let r=this.i;const s=h=>this.i!==r?(r=this.i,t(h)):Promise.resolve();let o=new tt;this.o=()=>{this.i++,this.currentUser=this.u(),o.resolve(),o=new tt,e.enqueueRetryable(()=>s(this.currentUser))};const a=()=>{const h=o;e.enqueueRetryable(async()=>{await h.promise,await s(this.currentUser)})},u=h=>{D("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=h,this.o&&(this.auth.addAuthTokenListener(this.o),a())};this.t.onInit(h=>u(h)),setTimeout(()=>{if(!this.auth){const h=this.t.getImmediate({optional:!0});h?u(h):(D("FirebaseAuthCredentialsProvider","Auth not yet detected"),o.resolve(),o=new tt)}},0),a()}getToken(){const e=this.i,t=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(t).then(r=>this.i!==e?(D("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):r?(K(typeof r.accessToken=="string",31837,{l:r}),new hl(r.accessToken,this.currentUser)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.o&&this.auth.removeAuthTokenListener(this.o),this.o=void 0}u(){const e=this.auth&&this.auth.getUid();return K(e===null||typeof e=="string",2055,{h:e}),new Te(e)}}class Km{constructor(e,t,r){this.P=e,this.T=t,this.I=r,this.type="FirstParty",this.user=Te.FIRST_PARTY,this.A=new Map}R(){return this.I?this.I():null}get headers(){this.A.set("X-Goog-AuthUser",this.P);const e=this.R();return e&&this.A.set("Authorization",e),this.T&&this.A.set("X-Goog-Iam-Authorization-Token",this.T),this.A}}class Qm{constructor(e,t,r){this.P=e,this.T=t,this.I=r}getToken(){return Promise.resolve(new Km(this.P,this.T,this.I))}start(e,t){e.enqueueRetryable(()=>t(Te.FIRST_PARTY))}shutdown(){}invalidateToken(){}}class gc{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 Xm{constructor(e,t){this.V=t,this.forceRefresh=!1,this.appCheck=null,this.m=null,this.p=null,Ne(e)&&e.settings.appCheckToken&&(this.p=e.settings.appCheckToken)}start(e,t){K(this.o===void 0,3512);const r=o=>{o.error!=null&&D("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${o.error.message}`);const a=o.token!==this.m;return this.m=o.token,D("FirebaseAppCheckTokenProvider",`Received ${a?"new":"existing"} token.`),a?t(o.token):Promise.resolve()};this.o=o=>{e.enqueueRetryable(()=>r(o))};const s=o=>{D("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=o,this.o&&this.appCheck.addTokenListener(this.o)};this.V.onInit(o=>s(o)),setTimeout(()=>{if(!this.appCheck){const o=this.V.getImmediate({optional:!0});o?s(o):D("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}},0)}getToken(){if(this.p)return Promise.resolve(new gc(this.p));const e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then(t=>t?(K(typeof t.token=="string",44558,{tokenResult:t}),this.m=t.token,new gc(t.token)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.o&&this.appCheck.removeTokenListener(this.o),this.o=void 0}}/** + * @license + * Copyright 2020 Google LLC + * + * 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 Ym(n){const e=typeof self<"u"&&(self.crypto||self.msCrypto),t=new Uint8Array(n);if(e&&typeof e.getRandomValues=="function")e.getRandomValues(t);else for(let r=0;re?1:0}function Si(n,e){const t=Math.min(n.length,e.length);for(let r=0;r=Jm&&e<=Zm}function ln(n,e,t){return n.length===e.length&&n.every((r,s)=>t(r,e[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. + */const _c="__name__";class xe{constructor(e,t,r){t===void 0?t=0:t>e.length&&L(637,{offset:t,range:e.length}),r===void 0?r=e.length-t:r>e.length-t&&L(1746,{length:r,range:e.length-t}),this.segments=e,this.offset=t,this.len=r}get length(){return this.len}isEqual(e){return xe.comparator(this,e)===0}child(e){const t=this.segments.slice(this.offset,this.limit());return e instanceof xe?e.forEach(r=>{t.push(r)}):t.push(e),this.construct(t)}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.length=0)throw new N(S.INVALID_ARGUMENT,`Invalid segment (${r}). Paths must not contain // in them.`);t.push(...r.split("/").filter(s=>s.length>0))}return new Y(t)}static emptyPath(){return new Y([])}}const eg=/^[_a-zA-Z][_a-zA-Z0-9]*$/;class de extends xe{construct(e,t,r){return new de(e,t,r)}static isValidIdentifier(e){return eg.test(e)}canonicalString(){return this.toArray().map(e=>(e=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),de.isValidIdentifier(e)||(e="`"+e+"`"),e)).join(".")}toString(){return this.canonicalString()}isKeyField(){return this.length===1&&this.get(0)===_c}static keyField(){return new de([_c])}static fromServerFormat(e){const t=[];let r="",s=0;const o=()=>{if(r.length===0)throw new N(S.INVALID_ARGUMENT,`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);t.push(r),r=""};let a=!1;for(;s=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&&Y.comparator(this.path,e.path)===0}toString(){return this.path.toString()}static comparator(e,t){return Y.comparator(e.path,t.path)}static isDocumentKey(e){return e.length%2==0}static fromSegments(e){return new M(new Y(e.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. + */function dl(n,e,t){if(!t)throw new N(S.INVALID_ARGUMENT,`Function ${n}() cannot be called with an empty ${e}.`)}function tg(n,e,t,r){if(e===!0&&r===!0)throw new N(S.INVALID_ARGUMENT,`${n} and ${t} cannot be used together.`)}function yc(n){if(!M.isDocumentKey(n))throw new N(S.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${n} has ${n.length}.`)}function Ec(n){if(M.isDocumentKey(n))throw new N(S.INVALID_ARGUMENT,`Invalid collection reference. Collection references must have an odd number of segments, but ${n} has ${n.length}.`)}function fl(n){return typeof n=="object"&&n!==null&&(Object.getPrototypeOf(n)===Object.prototype||Object.getPrototypeOf(n)===null)}function ws(n){if(n===void 0)return"undefined";if(n===null)return"null";if(typeof n=="string")return n.length>20&&(n=`${n.substring(0,20)}...`),JSON.stringify(n);if(typeof n=="number"||typeof n=="boolean")return""+n;if(typeof n=="object"){if(n instanceof Array)return"an array";{const e=function(r){return r.constructor?r.constructor.name:null}(n);return e?`a custom ${e} object`:"an object"}}return typeof n=="function"?"a function":L(12329,{type:typeof n})}function He(n,e){if("_delegate"in n&&(n=n._delegate),!(n instanceof e)){if(e.name===n.constructor.name)throw new N(S.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const t=ws(n);throw new N(S.INVALID_ARGUMENT,`Expected type '${e.name}', but it was: ${t}`)}}return n}function ng(n,e){if(e<=0)throw new N(S.INVALID_ARGUMENT,`Function ${n}() requires a positive number, but it was: ${e}.`)}/** + * @license + * Copyright 2025 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 ae(n,e){const t={typeString:n};return e&&(t.value=e),t}function lr(n,e){if(!fl(n))throw new N(S.INVALID_ARGUMENT,"JSON must be an object");let t;for(const r in e)if(e[r]){const s=e[r].typeString,o="value"in e[r]?{value:e[r].value}:void 0;if(!(r in n)){t=`JSON missing required field: '${r}'`;break}const a=n[r];if(s&&typeof a!==s){t=`JSON field '${r}' must be a ${s}.`;break}if(o!==void 0&&a!==o.value){t=`Expected '${r}' field to equal '${o.value}'`;break}}if(t)throw new N(S.INVALID_ARGUMENT,t);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. + */const Tc=-62135596800,Ic=1e6;class Z{static now(){return Z.fromMillis(Date.now())}static fromDate(e){return Z.fromMillis(e.getTime())}static fromMillis(e){const t=Math.floor(e/1e3),r=Math.floor((e-1e3*t)*Ic);return new Z(t,r)}constructor(e,t){if(this.seconds=e,this.nanoseconds=t,t<0)throw new N(S.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(t>=1e9)throw new N(S.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(e=253402300800)throw new N(S.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/Ic}_compareTo(e){return this.seconds===e.seconds?z(this.nanoseconds,e.nanoseconds):z(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{type:Z._jsonSchemaVersion,seconds:this.seconds,nanoseconds:this.nanoseconds}}static fromJSON(e){if(lr(e,Z._jsonSchema))return new Z(e.seconds,e.nanoseconds)}valueOf(){const e=this.seconds-Tc;return String(e).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}}Z._jsonSchemaVersion="firestore/timestamp/1.0",Z._jsonSchema={type:ae("string",Z._jsonSchemaVersion),seconds:ae("number"),nanoseconds:ae("number")};/** + * @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 U{static fromTimestamp(e){return new U(e)}static min(){return new U(new Z(0,0))}static max(){return new U(new Z(253402300799,999999999))}constructor(e){this.timestamp=e}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 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 Yn=-1;function rg(n,e){const t=n.toTimestamp().seconds,r=n.toTimestamp().nanoseconds+1,s=U.fromTimestamp(r===1e9?new Z(t+1,0):new Z(t,r));return new It(s,M.empty(),e)}function sg(n){return new It(n.readTime,n.key,Yn)}class It{constructor(e,t,r){this.readTime=e,this.documentKey=t,this.largestBatchId=r}static min(){return new It(U.min(),M.empty(),Yn)}static max(){return new It(U.max(),M.empty(),Yn)}}function ig(n,e){let t=n.readTime.compareTo(e.readTime);return t!==0?t:(t=M.comparator(n.documentKey,e.documentKey),t!==0?t:z(n.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 og="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.";class ag{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 _n(n){if(n.code!==S.FAILED_PRECONDITION||n.message!==og)throw n;D("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 C{constructor(e){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e(t=>{this.isDone=!0,this.result=t,this.nextCallback&&this.nextCallback(t)},t=>{this.isDone=!0,this.error=t,this.catchCallback&&this.catchCallback(t)})}catch(e){return this.next(void 0,e)}next(e,t){return this.callbackAttached&&L(59440),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(t,this.error):this.wrapSuccess(e,this.result):new C((r,s)=>{this.nextCallback=o=>{this.wrapSuccess(e,o).next(r,s)},this.catchCallback=o=>{this.wrapFailure(t,o).next(r,s)}})}toPromise(){return new Promise((e,t)=>{this.next(e,t)})}wrapUserFunction(e){try{const t=e();return t instanceof C?t:C.resolve(t)}catch(t){return C.reject(t)}}wrapSuccess(e,t){return e?this.wrapUserFunction(()=>e(t)):C.resolve(t)}wrapFailure(e,t){return e?this.wrapUserFunction(()=>e(t)):C.reject(t)}static resolve(e){return new C((t,r)=>{t(e)})}static reject(e){return new C((t,r)=>{r(e)})}static waitFor(e){return new C((t,r)=>{let s=0,o=0,a=!1;e.forEach(u=>{++s,u.next(()=>{++o,a&&o===s&&t()},h=>r(h))}),a=!0,o===s&&t()})}static or(e){let t=C.resolve(!1);for(const r of e)t=t.next(s=>s?C.resolve(s):r());return t}static forEach(e,t){const r=[];return e.forEach((s,o)=>{r.push(t.call(this,s,o))}),this.waitFor(r)}static mapArray(e,t){return new C((r,s)=>{const o=e.length,a=new Array(o);let u=0;for(let h=0;h{a[d]=p,++u,u===o&&r(a)},p=>s(p))}})}static doWhile(e,t){return new C((r,s)=>{const o=()=>{e()===!0?t().next(()=>{o()},s):r()};o()})}}function cg(n){const e=n.match(/Android ([\d.]+)/i),t=e?e[1].split(".").slice(0,2).join("."):"-1";return Number(t)}function yn(n){return n.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 As{constructor(e,t){this.previousValue=e,t&&(t.sequenceNumberHandler=r=>this.ae(r),this.ue=r=>t.writeSequenceNumber(r))}ae(e){return this.previousValue=Math.max(e,this.previousValue),this.previousValue}next(){const e=++this.previousValue;return this.ue&&this.ue(e),e}}As.ce=-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. + */const ro=-1;function Rs(n){return n==null}function os(n){return n===0&&1/n==-1/0}function ug(n){return typeof n=="number"&&Number.isInteger(n)&&!os(n)&&n<=Number.MAX_SAFE_INTEGER&&n>=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. + */const pl="";function lg(n){let e="";for(let t=0;t0&&(e=vc(e)),e=hg(n.get(t),e);return vc(e)}function hg(n,e){let t=e;const r=n.length;for(let s=0;s0&&(t=t.right)}return null}indexOf(e){let t=0,r=this.root;for(;!r.isEmpty();){const s=this.comparator(e,r.key);if(s===0)return t+r.left.size;s<0?r=r.left:(t+=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((t,r)=>(e(t,r),!1))}toString(){const e=[];return this.inorderTraversal((t,r)=>(e.push(`${t}:${r}`),!1)),`{${e.join(", ")}}`}reverseTraversal(e){return this.root.reverseTraversal(e)}getIterator(){return new xr(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new xr(this.root,e,this.comparator,!1)}getReverseIterator(){return new xr(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new xr(this.root,e,this.comparator,!0)}}class xr{constructor(e,t,r,s){this.isReverse=s,this.nodeStack=[];let o=1;for(;!e.isEmpty();)if(o=t?r(e.key,t):1,t&&s&&(o*=-1),o<0)e=this.isReverse?e.left:e.right;else{if(o===0){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}getNext(){let e=this.nodeStack.pop();const t={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 t}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 he{constructor(e,t,r,s,o){this.key=e,this.value=t,this.color=r??he.RED,this.left=s??he.EMPTY,this.right=o??he.EMPTY,this.size=this.left.size+1+this.right.size}copy(e,t,r,s,o){return new he(e??this.key,t??this.value,r??this.color,s??this.left,o??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,t,r){let s=this;const o=r(e,s.key);return s=o<0?s.copy(null,null,null,s.left.insert(e,t,r),null):o===0?s.copy(null,t,null,null,null):s.copy(null,null,null,null,s.right.insert(e,t,r)),s.fixUp()}removeMin(){if(this.left.isEmpty())return he.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,t){let r,s=this;if(t(e,s.key)<0)s.left.isEmpty()||s.left.isRed()||s.left.left.isRed()||(s=s.moveRedLeft()),s=s.copy(null,null,null,s.left.remove(e,t),null);else{if(s.left.isRed()&&(s=s.rotateRight()),s.right.isEmpty()||s.right.isRed()||s.right.left.isRed()||(s=s.moveRedRight()),t(e,s.key)===0){if(s.right.isEmpty())return he.EMPTY;r=s.right.min(),s=s.copy(r.key,r.value,null,null,s.right.removeMin())}s=s.copy(null,null,null,null,s.right.remove(e,t))}return s.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,he.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight(){const e=this.copy(null,null,he.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),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,t)}checkMaxDepth(){const e=this.check();return Math.pow(2,e)<=this.size+1}check(){if(this.isRed()&&this.left.isRed())throw L(43730,{key:this.key,value:this.value});if(this.right.isRed())throw L(14113,{key:this.key,value:this.value});const e=this.left.check();if(e!==this.right.check())throw L(27949);return e+(this.isRed()?0:1)}}he.EMPTY=null,he.RED=!0,he.BLACK=!1;he.EMPTY=new class{constructor(){this.size=0}get key(){throw L(57766)}get value(){throw L(16141)}get color(){throw L(16727)}get left(){throw L(29726)}get right(){throw L(36894)}copy(e,t,r,s,o){return this}insert(e,t,r){return new he(e,t)}remove(e,t){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 ce{constructor(e){this.comparator=e,this.data=new ee(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((t,r)=>(e(t),!1))}forEachInRange(e,t){const r=this.data.getIteratorFrom(e[0]);for(;r.hasNext();){const s=r.getNext();if(this.comparator(s.key,e[1])>=0)return;t(s.key)}}forEachWhile(e,t){let r;for(r=t!==void 0?this.data.getIteratorFrom(t):this.data.getIterator();r.hasNext();)if(!e(r.getNext().key))return}firstAfterOrEqual(e){const t=this.data.getIteratorFrom(e);return t.hasNext()?t.getNext().key:null}getIterator(){return new Ac(this.data.getIterator())}getIteratorFrom(e){return new Ac(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 t=this;return t.size{t=t.add(r)}),t}isEqual(e){if(!(e instanceof ce)||this.size!==e.size)return!1;const t=this.data.getIterator(),r=e.data.getIterator();for(;t.hasNext();){const s=t.getNext().key,o=r.getNext().key;if(this.comparator(s,o)!==0)return!1}return!0}toArray(){const e=[];return this.forEach(t=>{e.push(t)}),e}toString(){const e=[];return this.forEach(t=>e.push(t)),"SortedSet("+e.toString()+")"}copy(e){const t=new ce(this.comparator);return t.data=e,t}}class Ac{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 be{constructor(e){this.fields=e,e.sort(de.comparator)}static empty(){return new be([])}unionWith(e){let t=new ce(de.comparator);for(const r of this.fields)t=t.add(r);for(const r of e)t=t.add(r);return new be(t.toArray())}covers(e){for(const t of this.fields)if(t.isPrefixOf(e))return!0;return!1}isEqual(e){return ln(this.fields,e.fields,(t,r)=>t.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 gl 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 pe{constructor(e){this.binaryString=e}static fromBase64String(e){const t=function(s){try{return atob(s)}catch(o){throw typeof DOMException<"u"&&o instanceof DOMException?new gl("Invalid base64 string: "+o):o}}(e);return new pe(t)}static fromUint8Array(e){const t=function(s){let o="";for(let a=0;aeGe(t,e))!==void 0}function hn(n,e){if(n===e)return 0;const t=At(n),r=At(e);if(t!==r)return z(t,r);switch(t){case 0:case 9007199254740991:return 0;case 1:return z(n.booleanValue,e.booleanValue);case 2:return function(o,a){const u=ne(o.integerValue||o.doubleValue),h=ne(a.integerValue||a.doubleValue);return uh?1:u===h?0:isNaN(u)?isNaN(h)?0:-1:1}(n,e);case 3:return Rc(n.timestampValue,e.timestampValue);case 4:return Rc(Jn(n),Jn(e));case 5:return Si(n.stringValue,e.stringValue);case 6:return function(o,a){const u=wt(o),h=wt(a);return u.compareTo(h)}(n.bytesValue,e.bytesValue);case 7:return function(o,a){const u=o.split("/"),h=a.split("/");for(let d=0;ds+Wr(o),0)}(n.arrayValue);case 10:case 11:return function(r){let s=0;return Pt(r.fields,(o,a)=>{s+=o.length+Wr(a)}),s}(n.mapValue);default:throw L(13486,{value:n})}}function Pc(n,e){return{referenceValue:`projects/${n.projectId}/databases/${n.database}/documents/${e.path.canonicalString()}`}}function Ci(n){return!!n&&"integerValue"in n}function io(n){return!!n&&"arrayValue"in n}function Cc(n){return!!n&&"nullValue"in n}function bc(n){return!!n&&"doubleValue"in n&&isNaN(Number(n.doubleValue))}function Kr(n){return!!n&&"mapValue"in n}function mg(n){return(n?.mapValue?.fields||{})[Il]?.stringValue===vl}function Hn(n){if(n.geoPointValue)return{geoPointValue:{...n.geoPointValue}};if(n.timestampValue&&typeof n.timestampValue=="object")return{timestampValue:{...n.timestampValue}};if(n.mapValue){const e={mapValue:{fields:{}}};return Pt(n.mapValue.fields,(t,r)=>e.mapValue.fields[t]=Hn(r)),e}if(n.arrayValue){const e={arrayValue:{values:[]}};for(let t=0;t<(n.arrayValue.values||[]).length;++t)e.arrayValue.values[t]=Hn(n.arrayValue.values[t]);return e}return{...n}}function gg(n){return(((n.mapValue||{}).fields||{}).__type__||{}).stringValue===pg}/** + * @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 Pe{constructor(e){this.value=e}static empty(){return new Pe({mapValue:{}})}field(e){if(e.isEmpty())return this.value;{let t=this.value;for(let r=0;r{if(!t.isImmediateParentOf(u)){const h=this.getFieldsMap(t);this.applyChanges(h,r,s),r={},s=[],t=u.popLast()}a?r[u.lastSegment()]=Hn(a):s.push(u.lastSegment())});const o=this.getFieldsMap(t);this.applyChanges(o,r,s)}delete(e){const t=this.field(e.popLast());Kr(t)&&t.mapValue.fields&&delete t.mapValue.fields[e.lastSegment()]}isEqual(e){return Ge(this.value,e.value)}getFieldsMap(e){let t=this.value;t.mapValue.fields||(t.mapValue={fields:{}});for(let r=0;re[s]=o);for(const s of r)delete e[s]}clone(){return new Pe(Hn(this.value))}}function wl(n){const e=[];return Pt(n.fields,(t,r)=>{const s=new de([t]);if(Kr(r)){const o=wl(r.mapValue).fields;if(o.length===0)e.push(s);else for(const a of o)e.push(s.child(a))}else e.push(s)}),new be(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 Ie{constructor(e,t,r,s,o,a,u){this.key=e,this.documentType=t,this.version=r,this.readTime=s,this.createTime=o,this.data=a,this.documentState=u}static newInvalidDocument(e){return new Ie(e,0,U.min(),U.min(),U.min(),Pe.empty(),0)}static newFoundDocument(e,t,r,s){return new Ie(e,1,t,U.min(),r,s,0)}static newNoDocument(e,t){return new Ie(e,2,t,U.min(),U.min(),Pe.empty(),0)}static newUnknownDocument(e,t){return new Ie(e,3,t,U.min(),U.min(),Pe.empty(),2)}convertToFoundDocument(e,t){return!this.createTime.isEqual(U.min())||this.documentType!==2&&this.documentType!==0||(this.createTime=e),this.version=e,this.documentType=1,this.data=t,this.documentState=0,this}convertToNoDocument(e){return this.version=e,this.documentType=2,this.data=Pe.empty(),this.documentState=0,this}convertToUnknownDocument(e){return this.version=e,this.documentType=3,this.data=Pe.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this.version=U.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 Ie&&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 Ie(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 us{constructor(e,t){this.position=e,this.inclusive=t}}function kc(n,e,t){let r=0;for(let s=0;s":return e>0;case">=":return e>=0;default:return L(47266,{operator:this.op})}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}}class Le extends Al{constructor(e,t){super(),this.filters=e,this.op=t,this.Pe=null}static create(e,t){return new Le(e,t)}matches(e){return Rl(this)?this.filters.find(t=>!t.matches(e))===void 0:this.filters.find(t=>t.matches(e))!==void 0}getFlattenedFilters(){return this.Pe!==null||(this.Pe=this.filters.reduce((e,t)=>e.concat(t.getFlattenedFilters()),[])),this.Pe}getFilters(){return Object.assign([],this.filters)}}function Rl(n){return n.op==="and"}function Sl(n){return yg(n)&&Rl(n)}function yg(n){for(const e of n.filters)if(e instanceof Le)return!1;return!0}function bi(n){if(n instanceof oe)return n.field.canonicalString()+n.op.toString()+dn(n.value);if(Sl(n))return n.filters.map(e=>bi(e)).join(",");{const e=n.filters.map(t=>bi(t)).join(",");return`${n.op}(${e})`}}function Pl(n,e){return n instanceof oe?function(r,s){return s instanceof oe&&r.op===s.op&&r.field.isEqual(s.field)&&Ge(r.value,s.value)}(n,e):n instanceof Le?function(r,s){return s instanceof Le&&r.op===s.op&&r.filters.length===s.filters.length?r.filters.reduce((o,a,u)=>o&&Pl(a,s.filters[u]),!0):!1}(n,e):void L(19439)}function Cl(n){return n instanceof oe?function(t){return`${t.field.canonicalString()} ${t.op} ${dn(t.value)}`}(n):n instanceof Le?function(t){return t.op.toString()+" {"+t.getFilters().map(Cl).join(" ,")+"}"}(n):"Filter"}class Eg extends oe{constructor(e,t,r){super(e,t,r),this.key=M.fromName(r.referenceValue)}matches(e){const t=M.comparator(e.key,this.key);return this.matchesComparison(t)}}class Tg extends oe{constructor(e,t){super(e,"in",t),this.keys=bl("in",t)}matches(e){return this.keys.some(t=>t.isEqual(e.key))}}class Ig extends oe{constructor(e,t){super(e,"not-in",t),this.keys=bl("not-in",t)}matches(e){return!this.keys.some(t=>t.isEqual(e.key))}}function bl(n,e){return(e.arrayValue?.values||[]).map(t=>M.fromName(t.referenceValue))}class vg extends oe{constructor(e,t){super(e,"array-contains",t)}matches(e){const t=e.data.field(this.field);return io(t)&&er(t.arrayValue,this.value)}}class wg extends oe{constructor(e,t){super(e,"in",t)}matches(e){const t=e.data.field(this.field);return t!==null&&er(this.value.arrayValue,t)}}class Ag extends oe{constructor(e,t){super(e,"not-in",t)}matches(e){if(er(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const t=e.data.field(this.field);return t!==null&&t.nullValue===void 0&&!er(this.value.arrayValue,t)}}class Rg extends oe{constructor(e,t){super(e,"array-contains-any",t)}matches(e){const t=e.data.field(this.field);return!(!io(t)||!t.arrayValue.values)&&t.arrayValue.values.some(r=>er(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 Sg{constructor(e,t=null,r=[],s=[],o=null,a=null,u=null){this.path=e,this.collectionGroup=t,this.orderBy=r,this.filters=s,this.limit=o,this.startAt=a,this.endAt=u,this.Te=null}}function Nc(n,e=null,t=[],r=[],s=null,o=null,a=null){return new Sg(n,e,t,r,s,o,a)}function oo(n){const e=F(n);if(e.Te===null){let t=e.path.canonicalString();e.collectionGroup!==null&&(t+="|cg:"+e.collectionGroup),t+="|f:",t+=e.filters.map(r=>bi(r)).join(","),t+="|ob:",t+=e.orderBy.map(r=>function(o){return o.field.canonicalString()+o.dir}(r)).join(","),Rs(e.limit)||(t+="|l:",t+=e.limit),e.startAt&&(t+="|lb:",t+=e.startAt.inclusive?"b:":"a:",t+=e.startAt.position.map(r=>dn(r)).join(",")),e.endAt&&(t+="|ub:",t+=e.endAt.inclusive?"a:":"b:",t+=e.endAt.position.map(r=>dn(r)).join(",")),e.Te=t}return e.Te}function ao(n,e){if(n.limit!==e.limit||n.orderBy.length!==e.orderBy.length)return!1;for(let t=0;t0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";(function(a){let u=new ce(de.comparator);return a.filters.forEach(h=>{h.getFlattenedFilters().forEach(d=>{d.isInequality()&&(u=u.add(d.field))})}),u})(e).forEach(o=>{t.has(o.canonicalString())||o.isKeyField()||e.Ie.push(new tr(o,r))}),t.has(de.keyField().canonicalString())||e.Ie.push(new tr(de.keyField(),r))}return e.Ie}function qe(n){const e=F(n);return e.Ee||(e.Ee=Cg(e,Gn(n))),e.Ee}function Cg(n,e){if(n.limitType==="F")return Nc(n.path,n.collectionGroup,e,n.filters,n.limit,n.startAt,n.endAt);{e=e.map(s=>{const o=s.dir==="desc"?"asc":"desc";return new tr(s.field,o)});const t=n.endAt?new us(n.endAt.position,n.endAt.inclusive):null,r=n.startAt?new us(n.startAt.position,n.startAt.inclusive):null;return Nc(n.path,n.collectionGroup,e,n.filters,n.limit,t,r)}}function Vi(n,e){const t=n.filters.concat([e]);return new En(n.path,n.collectionGroup,n.explicitOrderBy.slice(),t,n.limit,n.limitType,n.startAt,n.endAt)}function ls(n,e,t){return new En(n.path,n.collectionGroup,n.explicitOrderBy.slice(),n.filters.slice(),e,t,n.startAt,n.endAt)}function Ps(n,e){return ao(qe(n),qe(e))&&n.limitType===e.limitType}function Vl(n){return`${oo(qe(n))}|lt:${n.limitType}`}function Jt(n){return`Query(target=${function(t){let r=t.path.canonicalString();return t.collectionGroup!==null&&(r+=" collectionGroup="+t.collectionGroup),t.filters.length>0&&(r+=`, filters: [${t.filters.map(s=>Cl(s)).join(", ")}]`),Rs(t.limit)||(r+=", limit: "+t.limit),t.orderBy.length>0&&(r+=`, orderBy: [${t.orderBy.map(s=>function(a){return`${a.field.canonicalString()} (${a.dir})`}(s)).join(", ")}]`),t.startAt&&(r+=", startAt: ",r+=t.startAt.inclusive?"b:":"a:",r+=t.startAt.position.map(s=>dn(s)).join(",")),t.endAt&&(r+=", endAt: ",r+=t.endAt.inclusive?"a:":"b:",r+=t.endAt.position.map(s=>dn(s)).join(",")),`Target(${r})`}(qe(n))}; limitType=${n.limitType})`}function Cs(n,e){return e.isFoundDocument()&&function(r,s){const o=s.key.path;return r.collectionGroup!==null?s.key.hasCollectionId(r.collectionGroup)&&r.path.isPrefixOf(o):M.isDocumentKey(r.path)?r.path.isEqual(o):r.path.isImmediateParentOf(o)}(n,e)&&function(r,s){for(const o of Gn(r))if(!o.field.isKeyField()&&s.data.field(o.field)===null)return!1;return!0}(n,e)&&function(r,s){for(const o of r.filters)if(!o.matches(s))return!1;return!0}(n,e)&&function(r,s){return!(r.startAt&&!function(a,u,h){const d=kc(a,u,h);return a.inclusive?d<=0:d<0}(r.startAt,Gn(r),s)||r.endAt&&!function(a,u,h){const d=kc(a,u,h);return a.inclusive?d>=0:d>0}(r.endAt,Gn(r),s))}(n,e)}function bg(n){return n.collectionGroup||(n.path.length%2==1?n.path.lastSegment():n.path.get(n.path.length-2))}function Nl(n){return(e,t)=>{let r=!1;for(const s of Gn(n)){const o=kg(s,e,t);if(o!==0)return o;r=r||s.field.isKeyField()}return 0}}function kg(n,e,t){const r=n.field.isKeyField()?M.comparator(e.key,t.key):function(o,a,u){const h=a.data.field(o),d=u.data.field(o);return h!==null&&d!==null?hn(h,d):L(42886)}(n.field,e,t);switch(n.dir){case"asc":return r;case"desc":return-1*r;default:return L(19790,{direction:n.dir})}}/** + * @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 Ht{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.innerSize=0}get(e){const t=this.mapKeyFn(e),r=this.inner[t];if(r!==void 0){for(const[s,o]of r)if(this.equalsFn(s,e))return o}}has(e){return this.get(e)!==void 0}set(e,t){const r=this.mapKeyFn(e),s=this.inner[r];if(s===void 0)return this.inner[r]=[[e,t]],void this.innerSize++;for(let o=0;o{for(const[s,o]of r)e(s,o)})}isEmpty(){return ml(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 Vg=new ee(M.comparator);function ot(){return Vg}const Dl=new ee(M.comparator);function Bn(...n){let e=Dl;for(const t of n)e=e.insert(t.key,t);return e}function Ol(n){let e=Dl;return n.forEach((t,r)=>e=e.insert(t,r.overlayedDocument)),e}function Mt(){return Wn()}function Ml(){return Wn()}function Wn(){return new Ht(n=>n.toString(),(n,e)=>n.isEqual(e))}const Ng=new ee(M.comparator),Dg=new ce(M.comparator);function H(...n){let e=Dg;for(const t of n)e=e.add(t);return e}const Og=new ce(z);function Mg(){return Og}/** + * @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 uo(n,e){if(n.useProto3Json){if(isNaN(e))return{doubleValue:"NaN"};if(e===1/0)return{doubleValue:"Infinity"};if(e===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:os(e)?"-0":e}}function Ll(n){return{integerValue:""+n}}function Lg(n,e){return ug(e)?Ll(e):uo(n,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 bs{constructor(){this._=void 0}}function xg(n,e,t){return n instanceof nr?function(s,o){const a={fields:{[yl]:{stringValue:_l},[Tl]:{timestampValue:{seconds:s.seconds,nanos:s.nanoseconds}}}};return o&&so(o)&&(o=Ss(o)),o&&(a.fields[El]=o),{mapValue:a}}(t,e):n instanceof rr?Ul(n,e):n instanceof sr?Fl(n,e):function(s,o){const a=xl(s,o),u=Oc(a)+Oc(s.Ae);return Ci(a)&&Ci(s.Ae)?Ll(u):uo(s.serializer,u)}(n,e)}function Ug(n,e,t){return n instanceof rr?Ul(n,e):n instanceof sr?Fl(n,e):t}function xl(n,e){return n instanceof hs?function(r){return Ci(r)||function(o){return!!o&&"doubleValue"in o}(r)}(e)?e:{integerValue:0}:null}class nr extends bs{}class rr extends bs{constructor(e){super(),this.elements=e}}function Ul(n,e){const t=Bl(e);for(const r of n.elements)t.some(s=>Ge(s,r))||t.push(r);return{arrayValue:{values:t}}}class sr extends bs{constructor(e){super(),this.elements=e}}function Fl(n,e){let t=Bl(e);for(const r of n.elements)t=t.filter(s=>!Ge(s,r));return{arrayValue:{values:t}}}class hs extends bs{constructor(e,t){super(),this.serializer=e,this.Ae=t}}function Oc(n){return ne(n.integerValue||n.doubleValue)}function Bl(n){return io(n)&&n.arrayValue.values?n.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 Fg{constructor(e,t){this.field=e,this.transform=t}}function Bg(n,e){return n.field.isEqual(e.field)&&function(r,s){return r instanceof rr&&s instanceof rr||r instanceof sr&&s instanceof sr?ln(r.elements,s.elements,Ge):r instanceof hs&&s instanceof hs?Ge(r.Ae,s.Ae):r instanceof nr&&s instanceof nr}(n.transform,e.transform)}class qg{constructor(e,t){this.version=e,this.transformResults=t}}class Me{constructor(e,t){this.updateTime=e,this.exists=t}static none(){return new Me}static exists(e){return new Me(void 0,e)}static updateTime(e){return new Me(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 Qr(n,e){return n.updateTime!==void 0?e.isFoundDocument()&&e.version.isEqual(n.updateTime):n.exists===void 0||n.exists===e.isFoundDocument()}class ks{}function ql(n,e){if(!n.hasLocalMutations||e&&e.fields.length===0)return null;if(e===null)return n.isNoDocument()?new lo(n.key,Me.none()):new hr(n.key,n.data,Me.none());{const t=n.data,r=Pe.empty();let s=new ce(de.comparator);for(let o of e.fields)if(!s.has(o)){let a=t.field(o);a===null&&o.length>1&&(o=o.popLast(),a=t.field(o)),a===null?r.delete(o):r.set(o,a),s=s.add(o)}return new Ct(n.key,r,new be(s.toArray()),Me.none())}}function jg(n,e,t){n instanceof hr?function(s,o,a){const u=s.value.clone(),h=Lc(s.fieldTransforms,o,a.transformResults);u.setAll(h),o.convertToFoundDocument(a.version,u).setHasCommittedMutations()}(n,e,t):n instanceof Ct?function(s,o,a){if(!Qr(s.precondition,o))return void o.convertToUnknownDocument(a.version);const u=Lc(s.fieldTransforms,o,a.transformResults),h=o.data;h.setAll(jl(s)),h.setAll(u),o.convertToFoundDocument(a.version,h).setHasCommittedMutations()}(n,e,t):function(s,o,a){o.convertToNoDocument(a.version).setHasCommittedMutations()}(0,e,t)}function Kn(n,e,t,r){return n instanceof hr?function(o,a,u,h){if(!Qr(o.precondition,a))return u;const d=o.value.clone(),p=xc(o.fieldTransforms,h,a);return d.setAll(p),a.convertToFoundDocument(a.version,d).setHasLocalMutations(),null}(n,e,t,r):n instanceof Ct?function(o,a,u,h){if(!Qr(o.precondition,a))return u;const d=xc(o.fieldTransforms,h,a),p=a.data;return p.setAll(jl(o)),p.setAll(d),a.convertToFoundDocument(a.version,p).setHasLocalMutations(),u===null?null:u.unionWith(o.fieldMask.fields).unionWith(o.fieldTransforms.map(y=>y.field))}(n,e,t,r):function(o,a,u){return Qr(o.precondition,a)?(a.convertToNoDocument(a.version).setHasLocalMutations(),null):u}(n,e,t)}function $g(n,e){let t=null;for(const r of n.fieldTransforms){const s=e.data.field(r.field),o=xl(r.transform,s||null);o!=null&&(t===null&&(t=Pe.empty()),t.set(r.field,o))}return t||null}function Mc(n,e){return n.type===e.type&&!!n.key.isEqual(e.key)&&!!n.precondition.isEqual(e.precondition)&&!!function(r,s){return r===void 0&&s===void 0||!(!r||!s)&&ln(r,s,(o,a)=>Bg(o,a))}(n.fieldTransforms,e.fieldTransforms)&&(n.type===0?n.value.isEqual(e.value):n.type!==1||n.data.isEqual(e.data)&&n.fieldMask.isEqual(e.fieldMask))}class hr extends ks{constructor(e,t,r,s=[]){super(),this.key=e,this.value=t,this.precondition=r,this.fieldTransforms=s,this.type=0}getFieldMask(){return null}}class Ct extends ks{constructor(e,t,r,s,o=[]){super(),this.key=e,this.data=t,this.fieldMask=r,this.precondition=s,this.fieldTransforms=o,this.type=1}getFieldMask(){return this.fieldMask}}function jl(n){const e=new Map;return n.fieldMask.fields.forEach(t=>{if(!t.isEmpty()){const r=n.data.field(t);e.set(t,r)}}),e}function Lc(n,e,t){const r=new Map;K(n.length===t.length,32656,{Re:t.length,Ve:n.length});for(let s=0;s{const o=e.get(s.key),a=o.overlayedDocument;let u=this.applyToLocalView(a,o.mutatedFields);u=t.has(s.key)?null:u;const h=ql(a,u);h!==null&&r.set(s.key,h),a.isValidDocument()||a.convertToNoDocument(U.min())}),r}keys(){return this.mutations.reduce((e,t)=>e.add(t.key),H())}isEqual(e){return this.batchId===e.batchId&&ln(this.mutations,e.mutations,(t,r)=>Mc(t,r))&&ln(this.baseMutations,e.baseMutations,(t,r)=>Mc(t,r))}}class ho{constructor(e,t,r,s){this.batch=e,this.commitVersion=t,this.mutationResults=r,this.docVersions=s}static from(e,t,r){K(e.mutations.length===r.length,58842,{me:e.mutations.length,fe:r.length});let s=function(){return Ng}();const o=e.mutations;for(let a=0;a=8)throw new qn(`Invalid padding: ${t}`);if(r<0)throw new qn(`Invalid hash count: ${r}`);if(e.length>0&&this.hashCount===0)throw new qn(`Invalid hash count: ${r}`);if(e.length===0&&t!==0)throw new qn(`Invalid padding when bitmap length is 0: ${t}`);this.ge=8*e.length-t,this.pe=yt.fromNumber(this.ge)}ye(e,t,r){let s=e.add(t.multiply(yt.fromNumber(r)));return s.compare(Xg)===1&&(s=new yt([s.getBits(0),s.getBits(1)],0)),s.modulo(this.pe).toNumber()}we(e){return!!(this.bitmap[Math.floor(e/8)]&1<a.insert(u)),a}insert(e){if(this.ge===0)return;const t=Uc(e),[r,s]=Fc(t);for(let o=0;o0&&(this.Oe=!0,this.Me=e)}ke(){let e=H(),t=H(),r=H();return this.Fe.forEach((s,o)=>{switch(o){case 0:e=e.add(s);break;case 2:t=t.add(s);break;case 1:r=r.add(s);break;default:L(38017,{changeType:o})}}),new dr(this.Me,this.xe,e,t,r)}qe(){this.Oe=!1,this.Fe=qc()}Qe(e,t){this.Oe=!0,this.Fe=this.Fe.insert(e,t)}$e(e){this.Oe=!0,this.Fe=this.Fe.remove(e)}Ue(){this.ve+=1}Ke(){this.ve-=1,K(this.ve>=0,3241,{ve:this.ve})}We(){this.Oe=!0,this.xe=!0}}class Yg{constructor(e){this.Ge=e,this.ze=new Map,this.je=ot(),this.Je=Fr(),this.He=Fr(),this.Ye=new ee(z)}Ze(e){for(const t of e.be)e.De&&e.De.isFoundDocument()?this.Xe(t,e.De):this.et(t,e.key,e.De);for(const t of e.removedTargetIds)this.et(t,e.key,e.De)}tt(e){this.forEachTarget(e,t=>{const r=this.nt(t);switch(e.state){case 0:this.rt(t)&&r.Le(e.resumeToken);break;case 1:r.Ke(),r.Ne||r.qe(),r.Le(e.resumeToken);break;case 2:r.Ke(),r.Ne||this.removeTarget(t);break;case 3:this.rt(t)&&(r.We(),r.Le(e.resumeToken));break;case 4:this.rt(t)&&(this.it(t),r.Le(e.resumeToken));break;default:L(56790,{state:e.state})}})}forEachTarget(e,t){e.targetIds.length>0?e.targetIds.forEach(t):this.ze.forEach((r,s)=>{this.rt(s)&&t(s)})}st(e){const t=e.targetId,r=e.Ce.count,s=this.ot(t);if(s){const o=s.target;if(ki(o))if(r===0){const a=new M(o.path);this.et(t,a,Ie.newNoDocument(a,U.min()))}else K(r===1,20013,{expectedCount:r});else{const a=this._t(t);if(a!==r){const u=this.ut(e),h=u?this.ct(u,e,a):1;if(h!==0){this.it(t);const d=h===2?"TargetPurposeExistenceFilterMismatchBloom":"TargetPurposeExistenceFilterMismatch";this.Ye=this.Ye.insert(t,d)}}}}}ut(e){const t=e.Ce.unchangedNames;if(!t||!t.bits)return null;const{bits:{bitmap:r="",padding:s=0},hashCount:o=0}=t;let a,u;try{a=wt(r).toUint8Array()}catch(h){if(h instanceof gl)return un("Decoding the base64 bloom filter in existence filter failed ("+h.message+"); ignoring the bloom filter and falling back to full re-query."),null;throw h}try{u=new fo(a,s,o)}catch(h){return un(h instanceof qn?"BloomFilter error: ":"Applying bloom filter failed: ",h),null}return u.ge===0?null:u}ct(e,t,r){return t.Ce.count===r-this.Pt(e,t.targetId)?0:2}Pt(e,t){const r=this.Ge.getRemoteKeysForTarget(t);let s=0;return r.forEach(o=>{const a=this.Ge.ht(),u=`projects/${a.projectId}/databases/${a.database}/documents/${o.path.canonicalString()}`;e.mightContain(u)||(this.et(t,o,null),s++)}),s}Tt(e){const t=new Map;this.ze.forEach((o,a)=>{const u=this.ot(a);if(u){if(o.current&&ki(u.target)){const h=new M(u.target.path);this.It(h).has(a)||this.Et(a,h)||this.et(a,h,Ie.newNoDocument(h,e))}o.Be&&(t.set(a,o.ke()),o.qe())}});let r=H();this.He.forEach((o,a)=>{let u=!0;a.forEachWhile(h=>{const d=this.ot(h);return!d||d.purpose==="TargetPurposeLimboResolution"||(u=!1,!1)}),u&&(r=r.add(o))}),this.je.forEach((o,a)=>a.setReadTime(e));const s=new Vs(e,t,this.Ye,this.je,r);return this.je=ot(),this.Je=Fr(),this.He=Fr(),this.Ye=new ee(z),s}Xe(e,t){if(!this.rt(e))return;const r=this.Et(e,t.key)?2:0;this.nt(e).Qe(t.key,r),this.je=this.je.insert(t.key,t),this.Je=this.Je.insert(t.key,this.It(t.key).add(e)),this.He=this.He.insert(t.key,this.dt(t.key).add(e))}et(e,t,r){if(!this.rt(e))return;const s=this.nt(e);this.Et(e,t)?s.Qe(t,1):s.$e(t),this.He=this.He.insert(t,this.dt(t).delete(e)),this.He=this.He.insert(t,this.dt(t).add(e)),r&&(this.je=this.je.insert(t,r))}removeTarget(e){this.ze.delete(e)}_t(e){const t=this.nt(e).ke();return this.Ge.getRemoteKeysForTarget(e).size+t.addedDocuments.size-t.removedDocuments.size}Ue(e){this.nt(e).Ue()}nt(e){let t=this.ze.get(e);return t||(t=new Bc,this.ze.set(e,t)),t}dt(e){let t=this.He.get(e);return t||(t=new ce(z),this.He=this.He.insert(e,t)),t}It(e){let t=this.Je.get(e);return t||(t=new ce(z),this.Je=this.Je.insert(e,t)),t}rt(e){const t=this.ot(e)!==null;return t||D("WatchChangeAggregator","Detected inactive target",e),t}ot(e){const t=this.ze.get(e);return t&&t.Ne?null:this.Ge.At(e)}it(e){this.ze.set(e,new Bc),this.Ge.getRemoteKeysForTarget(e).forEach(t=>{this.et(e,t,null)})}Et(e,t){return this.Ge.getRemoteKeysForTarget(e).has(t)}}function Fr(){return new ee(M.comparator)}function qc(){return new ee(M.comparator)}const Jg={asc:"ASCENDING",desc:"DESCENDING"},Zg={"<":"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"},e_={and:"AND",or:"OR"};class t_{constructor(e,t){this.databaseId=e,this.useProto3Json=t}}function Ni(n,e){return n.useProto3Json||Rs(e)?e:{value:e}}function ds(n,e){return n.useProto3Json?`${new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+e.nanoseconds).slice(-9)}Z`:{seconds:""+e.seconds,nanos:e.nanoseconds}}function Gl(n,e){return n.useProto3Json?e.toBase64():e.toUint8Array()}function n_(n,e){return ds(n,e.toTimestamp())}function je(n){return K(!!n,49232),U.fromTimestamp(function(t){const r=vt(t);return new Z(r.seconds,r.nanos)}(n))}function po(n,e){return Di(n,e).canonicalString()}function Di(n,e){const t=function(s){return new Y(["projects",s.projectId,"databases",s.database])}(n).child("documents");return e===void 0?t:t.child(e)}function Wl(n){const e=Y.fromString(n);return K(Jl(e),10190,{key:e.toString()}),e}function Oi(n,e){return po(n.databaseId,e.path)}function pi(n,e){const t=Wl(e);if(t.get(1)!==n.databaseId.projectId)throw new N(S.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+t.get(1)+" vs "+n.databaseId.projectId);if(t.get(3)!==n.databaseId.database)throw new N(S.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+t.get(3)+" vs "+n.databaseId.database);return new M(Ql(t))}function Kl(n,e){return po(n.databaseId,e)}function r_(n){const e=Wl(n);return e.length===4?Y.emptyPath():Ql(e)}function Mi(n){return new Y(["projects",n.databaseId.projectId,"databases",n.databaseId.database]).canonicalString()}function Ql(n){return K(n.length>4&&n.get(4)==="documents",29091,{key:n.toString()}),n.popFirst(5)}function jc(n,e,t){return{name:Oi(n,e),fields:t.value.mapValue.fields}}function s_(n,e){let t;if("targetChange"in e){e.targetChange;const r=function(d){return d==="NO_CHANGE"?0:d==="ADD"?1:d==="REMOVE"?2:d==="CURRENT"?3:d==="RESET"?4:L(39313,{state:d})}(e.targetChange.targetChangeType||"NO_CHANGE"),s=e.targetChange.targetIds||[],o=function(d,p){return d.useProto3Json?(K(p===void 0||typeof p=="string",58123),pe.fromBase64String(p||"")):(K(p===void 0||p instanceof Buffer||p instanceof Uint8Array,16193),pe.fromUint8Array(p||new Uint8Array))}(n,e.targetChange.resumeToken),a=e.targetChange.cause,u=a&&function(d){const p=d.code===void 0?S.UNKNOWN:$l(d.code);return new N(p,d.message||"")}(a);t=new Hl(r,s,o,u||null)}else if("documentChange"in e){e.documentChange;const r=e.documentChange;r.document,r.document.name,r.document.updateTime;const s=pi(n,r.document.name),o=je(r.document.updateTime),a=r.document.createTime?je(r.document.createTime):U.min(),u=new Pe({mapValue:{fields:r.document.fields}}),h=Ie.newFoundDocument(s,o,a,u),d=r.targetIds||[],p=r.removedTargetIds||[];t=new Xr(d,p,h.key,h)}else if("documentDelete"in e){e.documentDelete;const r=e.documentDelete;r.document;const s=pi(n,r.document),o=r.readTime?je(r.readTime):U.min(),a=Ie.newNoDocument(s,o),u=r.removedTargetIds||[];t=new Xr([],u,a.key,a)}else if("documentRemove"in e){e.documentRemove;const r=e.documentRemove;r.document;const s=pi(n,r.document),o=r.removedTargetIds||[];t=new Xr([],o,s,null)}else{if(!("filter"in e))return L(11601,{Rt:e});{e.filter;const r=e.filter;r.targetId;const{count:s=0,unchangedNames:o}=r,a=new Wg(s,o),u=r.targetId;t=new zl(u,a)}}return t}function i_(n,e){let t;if(e instanceof hr)t={update:jc(n,e.key,e.value)};else if(e instanceof lo)t={delete:Oi(n,e.key)};else if(e instanceof Ct)t={update:jc(n,e.key,e.data),updateMask:p_(e.fieldMask)};else{if(!(e instanceof zg))return L(16599,{Vt:e.type});t={verify:Oi(n,e.key)}}return e.fieldTransforms.length>0&&(t.updateTransforms=e.fieldTransforms.map(r=>function(o,a){const u=a.transform;if(u instanceof nr)return{fieldPath:a.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(u instanceof rr)return{fieldPath:a.field.canonicalString(),appendMissingElements:{values:u.elements}};if(u instanceof sr)return{fieldPath:a.field.canonicalString(),removeAllFromArray:{values:u.elements}};if(u instanceof hs)return{fieldPath:a.field.canonicalString(),increment:u.Ae};throw L(20930,{transform:a.transform})}(0,r))),e.precondition.isNone||(t.currentDocument=function(s,o){return o.updateTime!==void 0?{updateTime:n_(s,o.updateTime)}:o.exists!==void 0?{exists:o.exists}:L(27497)}(n,e.precondition)),t}function o_(n,e){return n&&n.length>0?(K(e!==void 0,14353),n.map(t=>function(s,o){let a=s.updateTime?je(s.updateTime):je(o);return a.isEqual(U.min())&&(a=je(o)),new qg(a,s.transformResults||[])}(t,e))):[]}function a_(n,e){return{documents:[Kl(n,e.path)]}}function c_(n,e){const t={structuredQuery:{}},r=e.path;let s;e.collectionGroup!==null?(s=r,t.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(s=r.popLast(),t.structuredQuery.from=[{collectionId:r.lastSegment()}]),t.parent=Kl(n,s);const o=function(d){if(d.length!==0)return Yl(Le.create(d,"and"))}(e.filters);o&&(t.structuredQuery.where=o);const a=function(d){if(d.length!==0)return d.map(p=>function(E){return{field:Zt(E.field),direction:h_(E.dir)}}(p))}(e.orderBy);a&&(t.structuredQuery.orderBy=a);const u=Ni(n,e.limit);return u!==null&&(t.structuredQuery.limit=u),e.startAt&&(t.structuredQuery.startAt=function(d){return{before:d.inclusive,values:d.position}}(e.startAt)),e.endAt&&(t.structuredQuery.endAt=function(d){return{before:!d.inclusive,values:d.position}}(e.endAt)),{ft:t,parent:s}}function u_(n){let e=r_(n.parent);const t=n.structuredQuery,r=t.from?t.from.length:0;let s=null;if(r>0){K(r===1,65062);const p=t.from[0];p.allDescendants?s=p.collectionId:e=e.child(p.collectionId)}let o=[];t.where&&(o=function(y){const E=Xl(y);return E instanceof Le&&Sl(E)?E.getFilters():[E]}(t.where));let a=[];t.orderBy&&(a=function(y){return y.map(E=>function(b){return new tr(en(b.field),function(k){switch(k){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(b.direction))}(E))}(t.orderBy));let u=null;t.limit&&(u=function(y){let E;return E=typeof y=="object"?y.value:y,Rs(E)?null:E}(t.limit));let h=null;t.startAt&&(h=function(y){const E=!!y.before,P=y.values||[];return new us(P,E)}(t.startAt));let d=null;return t.endAt&&(d=function(y){const E=!y.before,P=y.values||[];return new us(P,E)}(t.endAt)),Pg(e,s,a,o,u,"F",h,d)}function l_(n,e){const t=function(s){switch(s){case"TargetPurposeListen":return null;case"TargetPurposeExistenceFilterMismatch":return"existence-filter-mismatch";case"TargetPurposeExistenceFilterMismatchBloom":return"existence-filter-mismatch-bloom";case"TargetPurposeLimboResolution":return"limbo-document";default:return L(28987,{purpose:s})}}(e.purpose);return t==null?null:{"goog-listen-tags":t}}function Xl(n){return n.unaryFilter!==void 0?function(t){switch(t.unaryFilter.op){case"IS_NAN":const r=en(t.unaryFilter.field);return oe.create(r,"==",{doubleValue:NaN});case"IS_NULL":const s=en(t.unaryFilter.field);return oe.create(s,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":const o=en(t.unaryFilter.field);return oe.create(o,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const a=en(t.unaryFilter.field);return oe.create(a,"!=",{nullValue:"NULL_VALUE"});case"OPERATOR_UNSPECIFIED":return L(61313);default:return L(60726)}}(n):n.fieldFilter!==void 0?function(t){return oe.create(en(t.fieldFilter.field),function(s){switch(s){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";case"OPERATOR_UNSPECIFIED":return L(58110);default:return L(50506)}}(t.fieldFilter.op),t.fieldFilter.value)}(n):n.compositeFilter!==void 0?function(t){return Le.create(t.compositeFilter.filters.map(r=>Xl(r)),function(s){switch(s){case"AND":return"and";case"OR":return"or";default:return L(1026)}}(t.compositeFilter.op))}(n):L(30097,{filter:n})}function h_(n){return Jg[n]}function d_(n){return Zg[n]}function f_(n){return e_[n]}function Zt(n){return{fieldPath:n.canonicalString()}}function en(n){return de.fromServerFormat(n.fieldPath)}function Yl(n){return n instanceof oe?function(t){if(t.op==="=="){if(bc(t.value))return{unaryFilter:{field:Zt(t.field),op:"IS_NAN"}};if(Cc(t.value))return{unaryFilter:{field:Zt(t.field),op:"IS_NULL"}}}else if(t.op==="!="){if(bc(t.value))return{unaryFilter:{field:Zt(t.field),op:"IS_NOT_NAN"}};if(Cc(t.value))return{unaryFilter:{field:Zt(t.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:Zt(t.field),op:d_(t.op),value:t.value}}}(n):n instanceof Le?function(t){const r=t.getFilters().map(s=>Yl(s));return r.length===1?r[0]:{compositeFilter:{op:f_(t.op),filters:r}}}(n):L(54877,{filter:n})}function p_(n){const e=[];return n.fields.forEach(t=>e.push(t.canonicalString())),{fieldPaths:e}}function Jl(n){return n.length>=4&&n.get(0)==="projects"&&n.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 gt{constructor(e,t,r,s,o=U.min(),a=U.min(),u=pe.EMPTY_BYTE_STRING,h=null){this.target=e,this.targetId=t,this.purpose=r,this.sequenceNumber=s,this.snapshotVersion=o,this.lastLimboFreeSnapshotVersion=a,this.resumeToken=u,this.expectedCount=h}withSequenceNumber(e){return new gt(this.target,this.targetId,this.purpose,e,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,this.expectedCount)}withResumeToken(e,t){return new gt(this.target,this.targetId,this.purpose,this.sequenceNumber,t,this.lastLimboFreeSnapshotVersion,e,null)}withExpectedCount(e){return new gt(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,e)}withLastLimboFreeSnapshotVersion(e){return new gt(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 m_{constructor(e){this.yt=e}}function g_(n){const e=u_({parent:n.parent,structuredQuery:n.structuredQuery});return n.limitType==="LAST"?ls(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 __{constructor(){this.Cn=new y_}addToCollectionParentIndex(e,t){return this.Cn.add(t),C.resolve()}getCollectionParents(e,t){return C.resolve(this.Cn.getEntries(t))}addFieldIndex(e,t){return C.resolve()}deleteFieldIndex(e,t){return C.resolve()}deleteAllFieldIndexes(e){return C.resolve()}createTargetIndexes(e,t){return C.resolve()}getDocumentsMatchingTarget(e,t){return C.resolve(null)}getIndexType(e,t){return C.resolve(0)}getFieldIndexes(e,t){return C.resolve([])}getNextCollectionGroupToUpdate(e){return C.resolve(null)}getMinOffset(e,t){return C.resolve(It.min())}getMinOffsetFromCollectionGroup(e,t){return C.resolve(It.min())}updateCollectionGroup(e,t,r){return C.resolve()}updateIndexEntries(e,t){return C.resolve()}}class y_{constructor(){this.index={}}add(e){const t=e.lastSegment(),r=e.popLast(),s=this.index[t]||new ce(Y.comparator),o=!s.has(r);return this.index[t]=s.add(r),o}has(e){const t=e.lastSegment(),r=e.popLast(),s=this.index[t];return s&&s.has(r)}getEntries(e){return(this.index[e]||new ce(Y.comparator)).toArray()}}/** + * @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. + */const $c={didRun:!1,sequenceNumbersCollected:0,targetsRemoved:0,documentsRemoved:0},Zl=41943040;class Se{static withCacheSize(e){return new Se(e,Se.DEFAULT_COLLECTION_PERCENTILE,Se.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)}constructor(e,t,r){this.cacheSizeCollectionThreshold=e,this.percentileToCollect=t,this.maximumSequenceNumbersToCollect=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. + */Se.DEFAULT_COLLECTION_PERCENTILE=10,Se.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,Se.DEFAULT=new Se(Zl,Se.DEFAULT_COLLECTION_PERCENTILE,Se.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),Se.DISABLED=new Se(-1,0,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 fn{constructor(e){this.ar=e}next(){return this.ar+=2,this.ar}static ur(){return new fn(0)}static cr(){return new fn(-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. + */const zc="LruGarbageCollector",E_=1048576;function Hc([n,e],[t,r]){const s=z(n,t);return s===0?z(e,r):s}class T_{constructor(e){this.Ir=e,this.buffer=new ce(Hc),this.Er=0}dr(){return++this.Er}Ar(e){const t=[e,this.dr()];if(this.buffer.size{this.Rr=null;try{await this.localStore.collectGarbage(this.garbageCollector)}catch(t){yn(t)?D(zc,"Ignoring IndexedDB error during garbage collection: ",t):await _n(t)}await this.Vr(3e5)})}}class v_{constructor(e,t){this.mr=e,this.params=t}calculateTargetCount(e,t){return this.mr.gr(e).next(r=>Math.floor(t/100*r))}nthSequenceNumber(e,t){if(t===0)return C.resolve(As.ce);const r=new T_(t);return this.mr.forEachTarget(e,s=>r.Ar(s.sequenceNumber)).next(()=>this.mr.pr(e,s=>r.Ar(s))).next(()=>r.maxValue)}removeTargets(e,t,r){return this.mr.removeTargets(e,t,r)}removeOrphanedDocuments(e,t){return this.mr.removeOrphanedDocuments(e,t)}collect(e,t){return this.params.cacheSizeCollectionThreshold===-1?(D("LruGarbageCollector","Garbage collection skipped; disabled"),C.resolve($c)):this.getCacheSize(e).next(r=>r(y>this.params.maximumSequenceNumbersToCollect?(D("LruGarbageCollector",`Capping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${y}`),s=this.params.maximumSequenceNumbersToCollect):s=y,a=Date.now(),this.nthSequenceNumber(e,s))).next(y=>(r=y,u=Date.now(),this.removeTargets(e,r,t))).next(y=>(o=y,h=Date.now(),this.removeOrphanedDocuments(e,r))).next(y=>(d=Date.now(),Yt()<=$.DEBUG&&D("LruGarbageCollector",`LRU Garbage Collection + Counted targets in ${a-p}ms + Determined least recently used ${s} in `+(u-a)+`ms + Removed ${o} targets in `+(h-u)+`ms + Removed ${y} documents in `+(d-h)+`ms +Total Duration: ${d-p}ms`),C.resolve({didRun:!0,sequenceNumbersCollected:s,targetsRemoved:o,documentsRemoved:y})))}}function w_(n,e){return new v_(n,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 A_{constructor(){this.changes=new Ht(e=>e.toString(),(e,t)=>e.isEqual(t)),this.changesApplied=!1}addEntry(e){this.assertNotApplied(),this.changes.set(e.key,e)}removeEntry(e,t){this.assertNotApplied(),this.changes.set(e,Ie.newInvalidDocument(e).setReadTime(t))}getEntry(e,t){this.assertNotApplied();const r=this.changes.get(t);return r!==void 0?C.resolve(r):this.getFromCache(e,t)}getEntries(e,t){return this.getAllFromCache(e,t)}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 R_{constructor(e,t){this.overlayedDocument=e,this.mutatedFields=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 S_{constructor(e,t,r,s){this.remoteDocumentCache=e,this.mutationQueue=t,this.documentOverlayCache=r,this.indexManager=s}getDocument(e,t){let r=null;return this.documentOverlayCache.getOverlay(e,t).next(s=>(r=s,this.remoteDocumentCache.getEntry(e,t))).next(s=>(r!==null&&Kn(r.mutation,s,be.empty(),Z.now()),s))}getDocuments(e,t){return this.remoteDocumentCache.getEntries(e,t).next(r=>this.getLocalViewOfDocuments(e,r,H()).next(()=>r))}getLocalViewOfDocuments(e,t,r=H()){const s=Mt();return this.populateOverlays(e,s,t).next(()=>this.computeViews(e,t,s,r).next(o=>{let a=Bn();return o.forEach((u,h)=>{a=a.insert(u,h.overlayedDocument)}),a}))}getOverlayedDocuments(e,t){const r=Mt();return this.populateOverlays(e,r,t).next(()=>this.computeViews(e,t,r,H()))}populateOverlays(e,t,r){const s=[];return r.forEach(o=>{t.has(o)||s.push(o)}),this.documentOverlayCache.getOverlays(e,s).next(o=>{o.forEach((a,u)=>{t.set(a,u)})})}computeViews(e,t,r,s){let o=ot();const a=Wn(),u=function(){return Wn()}();return t.forEach((h,d)=>{const p=r.get(d.key);s.has(d.key)&&(p===void 0||p.mutation instanceof Ct)?o=o.insert(d.key,d):p!==void 0?(a.set(d.key,p.mutation.getFieldMask()),Kn(p.mutation,d,p.mutation.getFieldMask(),Z.now())):a.set(d.key,be.empty())}),this.recalculateAndSaveOverlays(e,o).next(h=>(h.forEach((d,p)=>a.set(d,p)),t.forEach((d,p)=>u.set(d,new R_(p,a.get(d)??null))),u))}recalculateAndSaveOverlays(e,t){const r=Wn();let s=new ee((a,u)=>a-u),o=H();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,t).next(a=>{for(const u of a)u.keys().forEach(h=>{const d=t.get(h);if(d===null)return;let p=r.get(h)||be.empty();p=u.applyToLocalView(d,p),r.set(h,p);const y=(s.get(u.batchId)||H()).add(h);s=s.insert(u.batchId,y)})}).next(()=>{const a=[],u=s.getReverseIterator();for(;u.hasNext();){const h=u.getNext(),d=h.key,p=h.value,y=Ml();p.forEach(E=>{if(!o.has(E)){const P=ql(t.get(E),r.get(E));P!==null&&y.set(E,P),o=o.add(E)}}),a.push(this.documentOverlayCache.saveOverlays(e,d,y))}return C.waitFor(a)}).next(()=>r)}recalculateAndSaveOverlaysForDocumentKeys(e,t){return this.remoteDocumentCache.getEntries(e,t).next(r=>this.recalculateAndSaveOverlays(e,r))}getDocumentsMatchingQuery(e,t,r,s){return function(a){return M.isDocumentKey(a.path)&&a.collectionGroup===null&&a.filters.length===0}(t)?this.getDocumentsMatchingDocumentQuery(e,t.path):kl(t)?this.getDocumentsMatchingCollectionGroupQuery(e,t,r,s):this.getDocumentsMatchingCollectionQuery(e,t,r,s)}getNextDocuments(e,t,r,s){return this.remoteDocumentCache.getAllFromCollectionGroup(e,t,r,s).next(o=>{const a=s-o.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(e,t,r.largestBatchId,s-o.size):C.resolve(Mt());let u=Yn,h=o;return a.next(d=>C.forEach(d,(p,y)=>(u{h=h.insert(p,E)}))).next(()=>this.populateOverlays(e,d,o)).next(()=>this.computeViews(e,h,d,H())).next(p=>({batchId:u,changes:Ol(p)})))})}getDocumentsMatchingDocumentQuery(e,t){return this.getDocument(e,new M(t)).next(r=>{let s=Bn();return r.isFoundDocument()&&(s=s.insert(r.key,r)),s})}getDocumentsMatchingCollectionGroupQuery(e,t,r,s){const o=t.collectionGroup;let a=Bn();return this.indexManager.getCollectionParents(e,o).next(u=>C.forEach(u,h=>{const d=function(y,E){return new En(E,null,y.explicitOrderBy.slice(),y.filters.slice(),y.limit,y.limitType,y.startAt,y.endAt)}(t,h.child(o));return this.getDocumentsMatchingCollectionQuery(e,d,r,s).next(p=>{p.forEach((y,E)=>{a=a.insert(y,E)})})}).next(()=>a))}getDocumentsMatchingCollectionQuery(e,t,r,s){let o;return this.documentOverlayCache.getOverlaysForCollection(e,t.path,r.largestBatchId).next(a=>(o=a,this.remoteDocumentCache.getDocumentsMatchingQuery(e,t,r,o,s))).next(a=>{o.forEach((h,d)=>{const p=d.getKey();a.get(p)===null&&(a=a.insert(p,Ie.newInvalidDocument(p)))});let u=Bn();return a.forEach((h,d)=>{const p=o.get(h);p!==void 0&&Kn(p.mutation,d,be.empty(),Z.now()),Cs(t,d)&&(u=u.insert(h,d))}),u})}}/** + * @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 P_{constructor(e){this.serializer=e,this.Lr=new Map,this.kr=new Map}getBundleMetadata(e,t){return C.resolve(this.Lr.get(t))}saveBundleMetadata(e,t){return this.Lr.set(t.id,function(s){return{id:s.id,version:s.version,createTime:je(s.createTime)}}(t)),C.resolve()}getNamedQuery(e,t){return C.resolve(this.kr.get(t))}saveNamedQuery(e,t){return this.kr.set(t.name,function(s){return{name:s.name,query:g_(s.bundledQuery),readTime:je(s.readTime)}}(t)),C.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 C_{constructor(){this.overlays=new ee(M.comparator),this.qr=new Map}getOverlay(e,t){return C.resolve(this.overlays.get(t))}getOverlays(e,t){const r=Mt();return C.forEach(t,s=>this.getOverlay(e,s).next(o=>{o!==null&&r.set(s,o)})).next(()=>r)}saveOverlays(e,t,r){return r.forEach((s,o)=>{this.St(e,t,o)}),C.resolve()}removeOverlaysForBatchId(e,t,r){const s=this.qr.get(r);return s!==void 0&&(s.forEach(o=>this.overlays=this.overlays.remove(o)),this.qr.delete(r)),C.resolve()}getOverlaysForCollection(e,t,r){const s=Mt(),o=t.length+1,a=new M(t.child("")),u=this.overlays.getIteratorFrom(a);for(;u.hasNext();){const h=u.getNext().value,d=h.getKey();if(!t.isPrefixOf(d.path))break;d.path.length===o&&h.largestBatchId>r&&s.set(h.getKey(),h)}return C.resolve(s)}getOverlaysForCollectionGroup(e,t,r,s){let o=new ee((d,p)=>d-p);const a=this.overlays.getIterator();for(;a.hasNext();){const d=a.getNext().value;if(d.getKey().getCollectionGroup()===t&&d.largestBatchId>r){let p=o.get(d.largestBatchId);p===null&&(p=Mt(),o=o.insert(d.largestBatchId,p)),p.set(d.getKey(),d)}}const u=Mt(),h=o.getIterator();for(;h.hasNext()&&(h.getNext().value.forEach((d,p)=>u.set(d,p)),!(u.size()>=s)););return C.resolve(u)}St(e,t,r){const s=this.overlays.get(r.key);if(s!==null){const a=this.qr.get(s.largestBatchId).delete(r.key);this.qr.set(s.largestBatchId,a)}this.overlays=this.overlays.insert(r.key,new Gg(t,r));let o=this.qr.get(t);o===void 0&&(o=H(),this.qr.set(t,o)),this.qr.set(t,o.add(r.key))}}/** + * @license + * Copyright 2024 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 b_{constructor(){this.sessionToken=pe.EMPTY_BYTE_STRING}getSessionToken(e){return C.resolve(this.sessionToken)}setSessionToken(e,t){return this.sessionToken=t,C.resolve()}}/** + * @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 mo{constructor(){this.Qr=new ce(ue.$r),this.Ur=new ce(ue.Kr)}isEmpty(){return this.Qr.isEmpty()}addReference(e,t){const r=new ue(e,t);this.Qr=this.Qr.add(r),this.Ur=this.Ur.add(r)}Wr(e,t){e.forEach(r=>this.addReference(r,t))}removeReference(e,t){this.Gr(new ue(e,t))}zr(e,t){e.forEach(r=>this.removeReference(r,t))}jr(e){const t=new M(new Y([])),r=new ue(t,e),s=new ue(t,e+1),o=[];return this.Ur.forEachInRange([r,s],a=>{this.Gr(a),o.push(a.key)}),o}Jr(){this.Qr.forEach(e=>this.Gr(e))}Gr(e){this.Qr=this.Qr.delete(e),this.Ur=this.Ur.delete(e)}Hr(e){const t=new M(new Y([])),r=new ue(t,e),s=new ue(t,e+1);let o=H();return this.Ur.forEachInRange([r,s],a=>{o=o.add(a.key)}),o}containsKey(e){const t=new ue(e,0),r=this.Qr.firstAfterOrEqual(t);return r!==null&&e.isEqual(r.key)}}class ue{constructor(e,t){this.key=e,this.Yr=t}static $r(e,t){return M.comparator(e.key,t.key)||z(e.Yr,t.Yr)}static Kr(e,t){return z(e.Yr,t.Yr)||M.comparator(e.key,t.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 k_{constructor(e,t){this.indexManager=e,this.referenceDelegate=t,this.mutationQueue=[],this.tr=1,this.Zr=new ce(ue.$r)}checkEmpty(e){return C.resolve(this.mutationQueue.length===0)}addMutationBatch(e,t,r,s){const o=this.tr;this.tr++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];const a=new Hg(o,t,r,s);this.mutationQueue.push(a);for(const u of s)this.Zr=this.Zr.add(new ue(u.key,o)),this.indexManager.addToCollectionParentIndex(e,u.key.path.popLast());return C.resolve(a)}lookupMutationBatch(e,t){return C.resolve(this.Xr(t))}getNextMutationBatchAfterBatchId(e,t){const r=t+1,s=this.ei(r),o=s<0?0:s;return C.resolve(this.mutationQueue.length>o?this.mutationQueue[o]:null)}getHighestUnacknowledgedBatchId(){return C.resolve(this.mutationQueue.length===0?ro:this.tr-1)}getAllMutationBatches(e){return C.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(e,t){const r=new ue(t,0),s=new ue(t,Number.POSITIVE_INFINITY),o=[];return this.Zr.forEachInRange([r,s],a=>{const u=this.Xr(a.Yr);o.push(u)}),C.resolve(o)}getAllMutationBatchesAffectingDocumentKeys(e,t){let r=new ce(z);return t.forEach(s=>{const o=new ue(s,0),a=new ue(s,Number.POSITIVE_INFINITY);this.Zr.forEachInRange([o,a],u=>{r=r.add(u.Yr)})}),C.resolve(this.ti(r))}getAllMutationBatchesAffectingQuery(e,t){const r=t.path,s=r.length+1;let o=r;M.isDocumentKey(o)||(o=o.child(""));const a=new ue(new M(o),0);let u=new ce(z);return this.Zr.forEachWhile(h=>{const d=h.key.path;return!!r.isPrefixOf(d)&&(d.length===s&&(u=u.add(h.Yr)),!0)},a),C.resolve(this.ti(u))}ti(e){const t=[];return e.forEach(r=>{const s=this.Xr(r);s!==null&&t.push(s)}),t}removeMutationBatch(e,t){K(this.ni(t.batchId,"removed")===0,55003),this.mutationQueue.shift();let r=this.Zr;return C.forEach(t.mutations,s=>{const o=new ue(s.key,t.batchId);return r=r.delete(o),this.referenceDelegate.markPotentiallyOrphaned(e,s.key)}).next(()=>{this.Zr=r})}ir(e){}containsKey(e,t){const r=new ue(t,0),s=this.Zr.firstAfterOrEqual(r);return C.resolve(t.isEqual(s&&s.key))}performConsistencyCheck(e){return this.mutationQueue.length,C.resolve()}ni(e,t){return this.ei(e)}ei(e){return this.mutationQueue.length===0?0:e-this.mutationQueue[0].batchId}Xr(e){const t=this.ei(e);return t<0||t>=this.mutationQueue.length?null:this.mutationQueue[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 V_{constructor(e){this.ri=e,this.docs=function(){return new ee(M.comparator)}(),this.size=0}setIndexManager(e){this.indexManager=e}addEntry(e,t){const r=t.key,s=this.docs.get(r),o=s?s.size:0,a=this.ri(t);return this.docs=this.docs.insert(r,{document:t.mutableCopy(),size:a}),this.size+=a-o,this.indexManager.addToCollectionParentIndex(e,r.path.popLast())}removeEntry(e){const t=this.docs.get(e);t&&(this.docs=this.docs.remove(e),this.size-=t.size)}getEntry(e,t){const r=this.docs.get(t);return C.resolve(r?r.document.mutableCopy():Ie.newInvalidDocument(t))}getEntries(e,t){let r=ot();return t.forEach(s=>{const o=this.docs.get(s);r=r.insert(s,o?o.document.mutableCopy():Ie.newInvalidDocument(s))}),C.resolve(r)}getDocumentsMatchingQuery(e,t,r,s){let o=ot();const a=t.path,u=new M(a.child("__id-9223372036854775808__")),h=this.docs.getIteratorFrom(u);for(;h.hasNext();){const{key:d,value:{document:p}}=h.getNext();if(!a.isPrefixOf(d.path))break;d.path.length>a.length+1||ig(sg(p),r)<=0||(s.has(p.key)||Cs(t,p))&&(o=o.insert(p.key,p.mutableCopy()))}return C.resolve(o)}getAllFromCollectionGroup(e,t,r,s){L(9500)}ii(e,t){return C.forEach(this.docs,r=>t(r))}newChangeBuffer(e){return new N_(this)}getSize(e){return C.resolve(this.size)}}class N_ extends A_{constructor(e){super(),this.Nr=e}applyChanges(e){const t=[];return this.changes.forEach((r,s)=>{s.isValidDocument()?t.push(this.Nr.addEntry(e,s)):this.Nr.removeEntry(r)}),C.waitFor(t)}getFromCache(e,t){return this.Nr.getEntry(e,t)}getAllFromCache(e,t){return this.Nr.getEntries(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 D_{constructor(e){this.persistence=e,this.si=new Ht(t=>oo(t),ao),this.lastRemoteSnapshotVersion=U.min(),this.highestTargetId=0,this.oi=0,this._i=new mo,this.targetCount=0,this.ai=fn.ur()}forEachTarget(e,t){return this.si.forEach((r,s)=>t(s)),C.resolve()}getLastRemoteSnapshotVersion(e){return C.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(e){return C.resolve(this.oi)}allocateTargetId(e){return this.highestTargetId=this.ai.next(),C.resolve(this.highestTargetId)}setTargetsMetadata(e,t,r){return r&&(this.lastRemoteSnapshotVersion=r),t>this.oi&&(this.oi=t),C.resolve()}Pr(e){this.si.set(e.target,e);const t=e.targetId;t>this.highestTargetId&&(this.ai=new fn(t),this.highestTargetId=t),e.sequenceNumber>this.oi&&(this.oi=e.sequenceNumber)}addTargetData(e,t){return this.Pr(t),this.targetCount+=1,C.resolve()}updateTargetData(e,t){return this.Pr(t),C.resolve()}removeTargetData(e,t){return this.si.delete(t.target),this._i.jr(t.targetId),this.targetCount-=1,C.resolve()}removeTargets(e,t,r){let s=0;const o=[];return this.si.forEach((a,u)=>{u.sequenceNumber<=t&&r.get(u.targetId)===null&&(this.si.delete(a),o.push(this.removeMatchingKeysForTargetId(e,u.targetId)),s++)}),C.waitFor(o).next(()=>s)}getTargetCount(e){return C.resolve(this.targetCount)}getTargetData(e,t){const r=this.si.get(t)||null;return C.resolve(r)}addMatchingKeys(e,t,r){return this._i.Wr(t,r),C.resolve()}removeMatchingKeys(e,t,r){this._i.zr(t,r);const s=this.persistence.referenceDelegate,o=[];return s&&t.forEach(a=>{o.push(s.markPotentiallyOrphaned(e,a))}),C.waitFor(o)}removeMatchingKeysForTargetId(e,t){return this._i.jr(t),C.resolve()}getMatchingKeysForTargetId(e,t){const r=this._i.Hr(t);return C.resolve(r)}containsKey(e,t){return C.resolve(this._i.containsKey(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 eh{constructor(e,t){this.ui={},this.overlays={},this.ci=new As(0),this.li=!1,this.li=!0,this.hi=new b_,this.referenceDelegate=e(this),this.Pi=new D_(this),this.indexManager=new __,this.remoteDocumentCache=function(s){return new V_(s)}(r=>this.referenceDelegate.Ti(r)),this.serializer=new m_(t),this.Ii=new P_(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.li=!1,Promise.resolve()}get started(){return this.li}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(e){return this.indexManager}getDocumentOverlayCache(e){let t=this.overlays[e.toKey()];return t||(t=new C_,this.overlays[e.toKey()]=t),t}getMutationQueue(e,t){let r=this.ui[e.toKey()];return r||(r=new k_(t,this.referenceDelegate),this.ui[e.toKey()]=r),r}getGlobalsCache(){return this.hi}getTargetCache(){return this.Pi}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.Ii}runTransaction(e,t,r){D("MemoryPersistence","Starting transaction:",e);const s=new O_(this.ci.next());return this.referenceDelegate.Ei(),r(s).next(o=>this.referenceDelegate.di(s).next(()=>o)).toPromise().then(o=>(s.raiseOnCommittedEvent(),o))}Ai(e,t){return C.or(Object.values(this.ui).map(r=>()=>r.containsKey(e,t)))}}class O_ extends ag{constructor(e){super(),this.currentSequenceNumber=e}}class go{constructor(e){this.persistence=e,this.Ri=new mo,this.Vi=null}static mi(e){return new go(e)}get fi(){if(this.Vi)return this.Vi;throw L(60996)}addReference(e,t,r){return this.Ri.addReference(r,t),this.fi.delete(r.toString()),C.resolve()}removeReference(e,t,r){return this.Ri.removeReference(r,t),this.fi.add(r.toString()),C.resolve()}markPotentiallyOrphaned(e,t){return this.fi.add(t.toString()),C.resolve()}removeTarget(e,t){this.Ri.jr(t.targetId).forEach(s=>this.fi.add(s.toString()));const r=this.persistence.getTargetCache();return r.getMatchingKeysForTargetId(e,t.targetId).next(s=>{s.forEach(o=>this.fi.add(o.toString()))}).next(()=>r.removeTargetData(e,t))}Ei(){this.Vi=new Set}di(e){const t=this.persistence.getRemoteDocumentCache().newChangeBuffer();return C.forEach(this.fi,r=>{const s=M.fromPath(r);return this.gi(e,s).next(o=>{o||t.removeEntry(s,U.min())})}).next(()=>(this.Vi=null,t.apply(e)))}updateLimboDocument(e,t){return this.gi(e,t).next(r=>{r?this.fi.delete(t.toString()):this.fi.add(t.toString())})}Ti(e){return 0}gi(e,t){return C.or([()=>C.resolve(this.Ri.containsKey(t)),()=>this.persistence.getTargetCache().containsKey(e,t),()=>this.persistence.Ai(e,t)])}}class fs{constructor(e,t){this.persistence=e,this.pi=new Ht(r=>lg(r.path),(r,s)=>r.isEqual(s)),this.garbageCollector=w_(this,t)}static mi(e,t){return new fs(e,t)}Ei(){}di(e){return C.resolve()}forEachTarget(e,t){return this.persistence.getTargetCache().forEachTarget(e,t)}gr(e){const t=this.wr(e);return this.persistence.getTargetCache().getTargetCount(e).next(r=>t.next(s=>r+s))}wr(e){let t=0;return this.pr(e,r=>{t++}).next(()=>t)}pr(e,t){return C.forEach(this.pi,(r,s)=>this.br(e,r,s).next(o=>o?C.resolve():t(s)))}removeTargets(e,t,r){return this.persistence.getTargetCache().removeTargets(e,t,r)}removeOrphanedDocuments(e,t){let r=0;const s=this.persistence.getRemoteDocumentCache(),o=s.newChangeBuffer();return s.ii(e,a=>this.br(e,a,t).next(u=>{u||(r++,o.removeEntry(a,U.min()))})).next(()=>o.apply(e)).next(()=>r)}markPotentiallyOrphaned(e,t){return this.pi.set(t,e.currentSequenceNumber),C.resolve()}removeTarget(e,t){const r=t.withSequenceNumber(e.currentSequenceNumber);return this.persistence.getTargetCache().updateTargetData(e,r)}addReference(e,t,r){return this.pi.set(r,e.currentSequenceNumber),C.resolve()}removeReference(e,t,r){return this.pi.set(r,e.currentSequenceNumber),C.resolve()}updateLimboDocument(e,t){return this.pi.set(t,e.currentSequenceNumber),C.resolve()}Ti(e){let t=e.key.toString().length;return e.isFoundDocument()&&(t+=Wr(e.data.value)),t}br(e,t,r){return C.or([()=>this.persistence.Ai(e,t),()=>this.persistence.getTargetCache().containsKey(e,t),()=>{const s=this.pi.get(t);return C.resolve(s!==void 0&&s>r)}])}getCacheSize(e){return this.persistence.getRemoteDocumentCache().getSize(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 _o{constructor(e,t,r,s){this.targetId=e,this.fromCache=t,this.Es=r,this.ds=s}static As(e,t){let r=H(),s=H();for(const o of t.docChanges)switch(o.type){case 0:r=r.add(o.doc.key);break;case 1:s=s.add(o.doc.key)}return new _o(e,t.fromCache,r,s)}}/** + * @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 M_{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 L_{constructor(){this.Rs=!1,this.Vs=!1,this.fs=100,this.gs=function(){return xd()?8:cg(ve())>0?6:4}()}initialize(e,t){this.ps=e,this.indexManager=t,this.Rs=!0}getDocumentsMatchingQuery(e,t,r,s){const o={result:null};return this.ys(e,t).next(a=>{o.result=a}).next(()=>{if(!o.result)return this.ws(e,t,s,r).next(a=>{o.result=a})}).next(()=>{if(o.result)return;const a=new M_;return this.Ss(e,t,a).next(u=>{if(o.result=u,this.Vs)return this.bs(e,t,a,u.size)})}).next(()=>o.result)}bs(e,t,r,s){return r.documentReadCountthis.gs*s?(Yt()<=$.DEBUG&&D("QueryEngine","The SDK decides to create cache indexes for query:",Jt(t),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(e,qe(t))):C.resolve())}ys(e,t){if(Dc(t))return C.resolve(null);let r=qe(t);return this.indexManager.getIndexType(e,r).next(s=>s===0?null:(t.limit!==null&&s===1&&(t=ls(t,null,"F"),r=qe(t)),this.indexManager.getDocumentsMatchingTarget(e,r).next(o=>{const a=H(...o);return this.ps.getDocuments(e,a).next(u=>this.indexManager.getMinOffset(e,r).next(h=>{const d=this.Ds(t,u);return this.Cs(t,d,a,h.readTime)?this.ys(e,ls(t,null,"F")):this.vs(e,d,t,h)}))})))}ws(e,t,r,s){return Dc(t)||s.isEqual(U.min())?C.resolve(null):this.ps.getDocuments(e,r).next(o=>{const a=this.Ds(t,o);return this.Cs(t,a,r,s)?C.resolve(null):(Yt()<=$.DEBUG&&D("QueryEngine","Re-using previous result from %s to execute query: %s",s.toString(),Jt(t)),this.vs(e,a,t,rg(s,Yn)).next(u=>u))})}Ds(e,t){let r=new ce(Nl(e));return t.forEach((s,o)=>{Cs(e,o)&&(r=r.add(o))}),r}Cs(e,t,r,s){if(e.limit===null)return!1;if(r.size!==t.size)return!0;const o=e.limitType==="F"?t.last():t.first();return!!o&&(o.hasPendingWrites||o.version.compareTo(s)>0)}Ss(e,t,r){return Yt()<=$.DEBUG&&D("QueryEngine","Using full collection scan to execute query:",Jt(t)),this.ps.getDocumentsMatchingQuery(e,t,It.min(),r)}vs(e,t,r,s){return this.ps.getDocumentsMatchingQuery(e,r,s).next(o=>(t.forEach(a=>{o=o.insert(a.key,a)}),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 yo="LocalStore",x_=3e8;class U_{constructor(e,t,r,s){this.persistence=e,this.Fs=t,this.serializer=s,this.Ms=new ee(z),this.xs=new Ht(o=>oo(o),ao),this.Os=new Map,this.Ns=e.getRemoteDocumentCache(),this.Pi=e.getTargetCache(),this.Ii=e.getBundleCache(),this.Bs(r)}Bs(e){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(e),this.indexManager=this.persistence.getIndexManager(e),this.mutationQueue=this.persistence.getMutationQueue(e,this.indexManager),this.localDocuments=new S_(this.Ns,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.Ns.setIndexManager(this.indexManager),this.Fs.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",t=>e.collect(t,this.Ms))}}function F_(n,e,t,r){return new U_(n,e,t,r)}async function th(n,e){const t=F(n);return await t.persistence.runTransaction("Handle user change","readonly",r=>{let s;return t.mutationQueue.getAllMutationBatches(r).next(o=>(s=o,t.Bs(e),t.mutationQueue.getAllMutationBatches(r))).next(o=>{const a=[],u=[];let h=H();for(const d of s){a.push(d.batchId);for(const p of d.mutations)h=h.add(p.key)}for(const d of o){u.push(d.batchId);for(const p of d.mutations)h=h.add(p.key)}return t.localDocuments.getDocuments(r,h).next(d=>({Ls:d,removedBatchIds:a,addedBatchIds:u}))})})}function B_(n,e){const t=F(n);return t.persistence.runTransaction("Acknowledge batch","readwrite-primary",r=>{const s=e.batch.keys(),o=t.Ns.newChangeBuffer({trackRemovals:!0});return function(u,h,d,p){const y=d.batch,E=y.keys();let P=C.resolve();return E.forEach(b=>{P=P.next(()=>p.getEntry(h,b)).next(O=>{const k=d.docVersions.get(b);K(k!==null,48541),O.version.compareTo(k)<0&&(y.applyToRemoteDocument(O,d),O.isValidDocument()&&(O.setReadTime(d.commitVersion),p.addEntry(O)))})}),P.next(()=>u.mutationQueue.removeMutationBatch(h,y))}(t,r,e,o).next(()=>o.apply(r)).next(()=>t.mutationQueue.performConsistencyCheck(r)).next(()=>t.documentOverlayCache.removeOverlaysForBatchId(r,s,e.batch.batchId)).next(()=>t.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(r,function(u){let h=H();for(let d=0;d0&&(h=h.add(u.batch.mutations[d].key));return h}(e))).next(()=>t.localDocuments.getDocuments(r,s))})}function nh(n){const e=F(n);return e.persistence.runTransaction("Get last remote snapshot version","readonly",t=>e.Pi.getLastRemoteSnapshotVersion(t))}function q_(n,e){const t=F(n),r=e.snapshotVersion;let s=t.Ms;return t.persistence.runTransaction("Apply remote event","readwrite-primary",o=>{const a=t.Ns.newChangeBuffer({trackRemovals:!0});s=t.Ms;const u=[];e.targetChanges.forEach((p,y)=>{const E=s.get(y);if(!E)return;u.push(t.Pi.removeMatchingKeys(o,p.removedDocuments,y).next(()=>t.Pi.addMatchingKeys(o,p.addedDocuments,y)));let P=E.withSequenceNumber(o.currentSequenceNumber);e.targetMismatches.get(y)!==null?P=P.withResumeToken(pe.EMPTY_BYTE_STRING,U.min()).withLastLimboFreeSnapshotVersion(U.min()):p.resumeToken.approximateByteSize()>0&&(P=P.withResumeToken(p.resumeToken,r)),s=s.insert(y,P),function(O,k,q){return O.resumeToken.approximateByteSize()===0||k.snapshotVersion.toMicroseconds()-O.snapshotVersion.toMicroseconds()>=x_?!0:q.addedDocuments.size+q.modifiedDocuments.size+q.removedDocuments.size>0}(E,P,p)&&u.push(t.Pi.updateTargetData(o,P))});let h=ot(),d=H();if(e.documentUpdates.forEach(p=>{e.resolvedLimboDocuments.has(p)&&u.push(t.persistence.referenceDelegate.updateLimboDocument(o,p))}),u.push(j_(o,a,e.documentUpdates).next(p=>{h=p.ks,d=p.qs})),!r.isEqual(U.min())){const p=t.Pi.getLastRemoteSnapshotVersion(o).next(y=>t.Pi.setTargetsMetadata(o,o.currentSequenceNumber,r));u.push(p)}return C.waitFor(u).next(()=>a.apply(o)).next(()=>t.localDocuments.getLocalViewOfDocuments(o,h,d)).next(()=>h)}).then(o=>(t.Ms=s,o))}function j_(n,e,t){let r=H(),s=H();return t.forEach(o=>r=r.add(o)),e.getEntries(n,r).next(o=>{let a=ot();return t.forEach((u,h)=>{const d=o.get(u);h.isFoundDocument()!==d.isFoundDocument()&&(s=s.add(u)),h.isNoDocument()&&h.version.isEqual(U.min())?(e.removeEntry(u,h.readTime),a=a.insert(u,h)):!d.isValidDocument()||h.version.compareTo(d.version)>0||h.version.compareTo(d.version)===0&&d.hasPendingWrites?(e.addEntry(h),a=a.insert(u,h)):D(yo,"Ignoring outdated watch update for ",u,". Current version:",d.version," Watch version:",h.version)}),{ks:a,qs:s}})}function $_(n,e){const t=F(n);return t.persistence.runTransaction("Get next mutation batch","readonly",r=>(e===void 0&&(e=ro),t.mutationQueue.getNextMutationBatchAfterBatchId(r,e)))}function z_(n,e){const t=F(n);return t.persistence.runTransaction("Allocate target","readwrite",r=>{let s;return t.Pi.getTargetData(r,e).next(o=>o?(s=o,C.resolve(s)):t.Pi.allocateTargetId(r).next(a=>(s=new gt(e,a,"TargetPurposeListen",r.currentSequenceNumber),t.Pi.addTargetData(r,s).next(()=>s))))}).then(r=>{const s=t.Ms.get(r.targetId);return(s===null||r.snapshotVersion.compareTo(s.snapshotVersion)>0)&&(t.Ms=t.Ms.insert(r.targetId,r),t.xs.set(e,r.targetId)),r})}async function Li(n,e,t){const r=F(n),s=r.Ms.get(e),o=t?"readwrite":"readwrite-primary";try{t||await r.persistence.runTransaction("Release target",o,a=>r.persistence.referenceDelegate.removeTarget(a,s))}catch(a){if(!yn(a))throw a;D(yo,`Failed to update sequence numbers for target ${e}: ${a}`)}r.Ms=r.Ms.remove(e),r.xs.delete(s.target)}function Gc(n,e,t){const r=F(n);let s=U.min(),o=H();return r.persistence.runTransaction("Execute query","readwrite",a=>function(h,d,p){const y=F(h),E=y.xs.get(p);return E!==void 0?C.resolve(y.Ms.get(E)):y.Pi.getTargetData(d,p)}(r,a,qe(e)).next(u=>{if(u)return s=u.lastLimboFreeSnapshotVersion,r.Pi.getMatchingKeysForTargetId(a,u.targetId).next(h=>{o=h})}).next(()=>r.Fs.getDocumentsMatchingQuery(a,e,t?s:U.min(),t?o:H())).next(u=>(H_(r,bg(e),u),{documents:u,Qs:o})))}function H_(n,e,t){let r=n.Os.get(e)||U.min();t.forEach((s,o)=>{o.readTime.compareTo(r)>0&&(r=o.readTime)}),n.Os.set(e,r)}class Wc{constructor(){this.activeTargetIds=Mg()}zs(e){this.activeTargetIds=this.activeTargetIds.add(e)}js(e){this.activeTargetIds=this.activeTargetIds.delete(e)}Gs(){const e={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(e)}}class G_{constructor(){this.Mo=new Wc,this.xo={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,t,r){}addLocalQueryTarget(e,t=!0){return t&&this.Mo.zs(e),this.xo[e]||"not-current"}updateQueryState(e,t,r){this.xo[e]=t}removeLocalQueryTarget(e){this.Mo.js(e)}isLocalQueryTarget(e){return this.Mo.activeTargetIds.has(e)}clearQueryState(e){delete this.xo[e]}getAllActiveQueryTargets(){return this.Mo.activeTargetIds}isActiveQueryTarget(e){return this.Mo.activeTargetIds.has(e)}start(){return this.Mo=new Wc,Promise.resolve()}handleUserChange(e,t,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 W_{Oo(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. + */const Kc="ConnectivityMonitor";class Qc{constructor(){this.No=()=>this.Bo(),this.Lo=()=>this.ko(),this.qo=[],this.Qo()}Oo(e){this.qo.push(e)}shutdown(){window.removeEventListener("online",this.No),window.removeEventListener("offline",this.Lo)}Qo(){window.addEventListener("online",this.No),window.addEventListener("offline",this.Lo)}Bo(){D(Kc,"Network connectivity changed: AVAILABLE");for(const e of this.qo)e(0)}ko(){D(Kc,"Network connectivity changed: UNAVAILABLE");for(const e of this.qo)e(1)}static v(){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 Br=null;function xi(){return Br===null?Br=function(){return 268435456+Math.round(2147483648*Math.random())}():Br++,"0x"+Br.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 mi="RestConnection",K_={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregationQuery:"runAggregationQuery"};class Q_{get $o(){return!1}constructor(e){this.databaseInfo=e,this.databaseId=e.databaseId;const t=e.ssl?"https":"http",r=encodeURIComponent(this.databaseId.projectId),s=encodeURIComponent(this.databaseId.database);this.Uo=t+"://"+e.host,this.Ko=`projects/${r}/databases/${s}`,this.Wo=this.databaseId.database===as?`project_id=${r}`:`project_id=${r}&database_id=${s}`}Go(e,t,r,s,o){const a=xi(),u=this.zo(e,t.toUriEncodedString());D(mi,`Sending RPC '${e}' ${a}:`,u,r);const h={"google-cloud-resource-prefix":this.Ko,"x-goog-request-params":this.Wo};this.jo(h,s,o);const{host:d}=new URL(u),p=$t(d);return this.Jo(e,u,h,r,p).then(y=>(D(mi,`Received RPC '${e}' ${a}: `,y),y),y=>{throw un(mi,`RPC '${e}' ${a} failed with error: `,y,"url: ",u,"request:",r),y})}Ho(e,t,r,s,o,a){return this.Go(e,t,r,s,o)}jo(e,t,r){e["X-Goog-Api-Client"]=function(){return"gl-js/ fire/"+gn}(),e["Content-Type"]="text/plain",this.databaseInfo.appId&&(e["X-Firebase-GMPID"]=this.databaseInfo.appId),t&&t.headers.forEach((s,o)=>e[o]=s),r&&r.headers.forEach((s,o)=>e[o]=s)}zo(e,t){const r=K_[e];return`${this.Uo}/v1/${t}:${r}`}terminate(){}}/** + * @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 X_{constructor(e){this.Yo=e.Yo,this.Zo=e.Zo}Xo(e){this.e_=e}t_(e){this.n_=e}r_(e){this.i_=e}onMessage(e){this.s_=e}close(){this.Zo()}send(e){this.Yo(e)}o_(){this.e_()}__(){this.n_()}a_(e){this.i_(e)}u_(e){this.s_(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 Ee="WebChannelConnection";class Y_ extends Q_{constructor(e){super(e),this.c_=[],this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams,this.longPollingOptions=e.longPollingOptions}Jo(e,t,r,s,o){const a=xi();return new Promise((u,h)=>{const d=new il;d.setWithCredentials(!0),d.listenOnce(ol.COMPLETE,()=>{try{switch(d.getLastErrorCode()){case Gr.NO_ERROR:const y=d.getResponseJson();D(Ee,`XHR for RPC '${e}' ${a} received:`,JSON.stringify(y)),u(y);break;case Gr.TIMEOUT:D(Ee,`RPC '${e}' ${a} timed out`),h(new N(S.DEADLINE_EXCEEDED,"Request time out"));break;case Gr.HTTP_ERROR:const E=d.getStatus();if(D(Ee,`RPC '${e}' ${a} failed with status:`,E,"response text:",d.getResponseText()),E>0){let P=d.getResponseJson();Array.isArray(P)&&(P=P[0]);const b=P?.error;if(b&&b.status&&b.message){const O=function(q){const j=q.toLowerCase().replace(/_/g,"-");return Object.values(S).indexOf(j)>=0?j:S.UNKNOWN}(b.status);h(new N(O,b.message))}else h(new N(S.UNKNOWN,"Server responded with status "+d.getStatus()))}else h(new N(S.UNAVAILABLE,"Connection failed."));break;default:L(9055,{l_:e,streamId:a,h_:d.getLastErrorCode(),P_:d.getLastError()})}}finally{D(Ee,`RPC '${e}' ${a} completed.`)}});const p=JSON.stringify(s);D(Ee,`RPC '${e}' ${a} sending request:`,s),d.send(t,"POST",p,r,15)})}T_(e,t,r){const s=xi(),o=[this.Uo,"/","google.firestore.v1.Firestore","/",e,"/channel"],a=ul(),u=cl(),h={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},d=this.longPollingOptions.timeoutSeconds;d!==void 0&&(h.longPollingTimeout=Math.round(1e3*d)),this.useFetchStreams&&(h.useFetchStreams=!0),this.jo(h.initMessageHeaders,t,r),h.encodeInitMessageHeaders=!0;const p=o.join("");D(Ee,`Creating RPC '${e}' stream ${s}: ${p}`,h);const y=a.createWebChannel(p,h);this.I_(y);let E=!1,P=!1;const b=new X_({Yo:k=>{P?D(Ee,`Not sending because RPC '${e}' stream ${s} is closed:`,k):(E||(D(Ee,`Opening RPC '${e}' stream ${s} transport.`),y.open(),E=!0),D(Ee,`RPC '${e}' stream ${s} sending:`,k),y.send(k))},Zo:()=>y.close()}),O=(k,q,j)=>{k.listen(q,B=>{try{j(B)}catch(Q){setTimeout(()=>{throw Q},0)}})};return O(y,Fn.EventType.OPEN,()=>{P||(D(Ee,`RPC '${e}' stream ${s} transport opened.`),b.o_())}),O(y,Fn.EventType.CLOSE,()=>{P||(P=!0,D(Ee,`RPC '${e}' stream ${s} transport closed`),b.a_(),this.E_(y))}),O(y,Fn.EventType.ERROR,k=>{P||(P=!0,un(Ee,`RPC '${e}' stream ${s} transport errored. Name:`,k.name,"Message:",k.message),b.a_(new N(S.UNAVAILABLE,"The operation could not be completed")))}),O(y,Fn.EventType.MESSAGE,k=>{if(!P){const q=k.data[0];K(!!q,16349);const j=q,B=j?.error||j[0]?.error;if(B){D(Ee,`RPC '${e}' stream ${s} received error:`,B);const Q=B.status;let we=function(m){const _=ie[m];if(_!==void 0)return $l(_)}(Q),se=B.message;we===void 0&&(we=S.INTERNAL,se="Unknown error status: "+Q+" with message "+B.message),P=!0,b.a_(new N(we,se)),y.close()}else D(Ee,`RPC '${e}' stream ${s} received:`,q),b.u_(q)}}),O(u,al.STAT_EVENT,k=>{k.stat===Ri.PROXY?D(Ee,`RPC '${e}' stream ${s} detected buffering proxy`):k.stat===Ri.NOPROXY&&D(Ee,`RPC '${e}' stream ${s} detected no buffering proxy`)}),setTimeout(()=>{b.__()},0),b}terminate(){this.c_.forEach(e=>e.close()),this.c_=[]}I_(e){this.c_.push(e)}E_(e){this.c_=this.c_.filter(t=>t===e)}}function gi(){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 Ns(n){return new t_(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 rh{constructor(e,t,r=1e3,s=1.5,o=6e4){this.Mi=e,this.timerId=t,this.d_=r,this.A_=s,this.R_=o,this.V_=0,this.m_=null,this.f_=Date.now(),this.reset()}reset(){this.V_=0}g_(){this.V_=this.R_}p_(e){this.cancel();const t=Math.floor(this.V_+this.y_()),r=Math.max(0,Date.now()-this.f_),s=Math.max(0,t-r);s>0&&D("ExponentialBackoff",`Backing off for ${s} ms (base delay: ${this.V_} ms, delay with jitter: ${t} ms, last attempt: ${r} ms ago)`),this.m_=this.Mi.enqueueAfterDelay(this.timerId,s,()=>(this.f_=Date.now(),e())),this.V_*=this.A_,this.V_this.R_&&(this.V_=this.R_)}w_(){this.m_!==null&&(this.m_.skipDelay(),this.m_=null)}cancel(){this.m_!==null&&(this.m_.cancel(),this.m_=null)}y_(){return(Math.random()-.5)*this.V_}}/** + * @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 Xc="PersistentStream";class sh{constructor(e,t,r,s,o,a,u,h){this.Mi=e,this.S_=r,this.b_=s,this.connection=o,this.authCredentialsProvider=a,this.appCheckCredentialsProvider=u,this.listener=h,this.state=0,this.D_=0,this.C_=null,this.v_=null,this.stream=null,this.F_=0,this.M_=new rh(e,t)}x_(){return this.state===1||this.state===5||this.O_()}O_(){return this.state===2||this.state===3}start(){this.F_=0,this.state!==4?this.auth():this.N_()}async stop(){this.x_()&&await this.close(0)}B_(){this.state=0,this.M_.reset()}L_(){this.O_()&&this.C_===null&&(this.C_=this.Mi.enqueueAfterDelay(this.S_,6e4,()=>this.k_()))}q_(e){this.Q_(),this.stream.send(e)}async k_(){if(this.O_())return this.close(0)}Q_(){this.C_&&(this.C_.cancel(),this.C_=null)}U_(){this.v_&&(this.v_.cancel(),this.v_=null)}async close(e,t){this.Q_(),this.U_(),this.M_.cancel(),this.D_++,e!==4?this.M_.reset():t&&t.code===S.RESOURCE_EXHAUSTED?(it(t.toString()),it("Using maximum backoff delay to prevent overloading the backend."),this.M_.g_()):t&&t.code===S.UNAUTHENTICATED&&this.state!==3&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),this.stream!==null&&(this.K_(),this.stream.close(),this.stream=null),this.state=e,await this.listener.r_(t)}K_(){}auth(){this.state=1;const e=this.W_(this.D_),t=this.D_;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then(([r,s])=>{this.D_===t&&this.G_(r,s)},r=>{e(()=>{const s=new N(S.UNKNOWN,"Fetching auth token failed: "+r.message);return this.z_(s)})})}G_(e,t){const r=this.W_(this.D_);this.stream=this.j_(e,t),this.stream.Xo(()=>{r(()=>this.listener.Xo())}),this.stream.t_(()=>{r(()=>(this.state=2,this.v_=this.Mi.enqueueAfterDelay(this.b_,1e4,()=>(this.O_()&&(this.state=3),Promise.resolve())),this.listener.t_()))}),this.stream.r_(s=>{r(()=>this.z_(s))}),this.stream.onMessage(s=>{r(()=>++this.F_==1?this.J_(s):this.onNext(s))})}N_(){this.state=5,this.M_.p_(async()=>{this.state=0,this.start()})}z_(e){return D(Xc,`close with error: ${e}`),this.stream=null,this.close(4,e)}W_(e){return t=>{this.Mi.enqueueAndForget(()=>this.D_===e?t():(D(Xc,"stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve()))}}}class J_ extends sh{constructor(e,t,r,s,o,a){super(e,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",t,r,s,a),this.serializer=o}j_(e,t){return this.connection.T_("Listen",e,t)}J_(e){return this.onNext(e)}onNext(e){this.M_.reset();const t=s_(this.serializer,e),r=function(o){if(!("targetChange"in o))return U.min();const a=o.targetChange;return a.targetIds&&a.targetIds.length?U.min():a.readTime?je(a.readTime):U.min()}(e);return this.listener.H_(t,r)}Y_(e){const t={};t.database=Mi(this.serializer),t.addTarget=function(o,a){let u;const h=a.target;if(u=ki(h)?{documents:a_(o,h)}:{query:c_(o,h).ft},u.targetId=a.targetId,a.resumeToken.approximateByteSize()>0){u.resumeToken=Gl(o,a.resumeToken);const d=Ni(o,a.expectedCount);d!==null&&(u.expectedCount=d)}else if(a.snapshotVersion.compareTo(U.min())>0){u.readTime=ds(o,a.snapshotVersion.toTimestamp());const d=Ni(o,a.expectedCount);d!==null&&(u.expectedCount=d)}return u}(this.serializer,e);const r=l_(this.serializer,e);r&&(t.labels=r),this.q_(t)}Z_(e){const t={};t.database=Mi(this.serializer),t.removeTarget=e,this.q_(t)}}class Z_ extends sh{constructor(e,t,r,s,o,a){super(e,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",t,r,s,a),this.serializer=o}get X_(){return this.F_>0}start(){this.lastStreamToken=void 0,super.start()}K_(){this.X_&&this.ea([])}j_(e,t){return this.connection.T_("Write",e,t)}J_(e){return K(!!e.streamToken,31322),this.lastStreamToken=e.streamToken,K(!e.writeResults||e.writeResults.length===0,55816),this.listener.ta()}onNext(e){K(!!e.streamToken,12678),this.lastStreamToken=e.streamToken,this.M_.reset();const t=o_(e.writeResults,e.commitTime),r=je(e.commitTime);return this.listener.na(r,t)}ra(){const e={};e.database=Mi(this.serializer),this.q_(e)}ea(e){const t={streamToken:this.lastStreamToken,writes:e.map(r=>i_(this.serializer,r))};this.q_(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 ey{}class ty extends ey{constructor(e,t,r,s){super(),this.authCredentials=e,this.appCheckCredentials=t,this.connection=r,this.serializer=s,this.ia=!1}sa(){if(this.ia)throw new N(S.FAILED_PRECONDITION,"The client has already been terminated.")}Go(e,t,r,s){return this.sa(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([o,a])=>this.connection.Go(e,Di(t,r),s,o,a)).catch(o=>{throw o.name==="FirebaseError"?(o.code===S.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),o):new N(S.UNKNOWN,o.toString())})}Ho(e,t,r,s,o){return this.sa(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([a,u])=>this.connection.Ho(e,Di(t,r),s,a,u,o)).catch(a=>{throw a.name==="FirebaseError"?(a.code===S.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),a):new N(S.UNKNOWN,a.toString())})}terminate(){this.ia=!0,this.connection.terminate()}}class ny{constructor(e,t){this.asyncQueue=e,this.onlineStateHandler=t,this.state="Unknown",this.oa=0,this._a=null,this.aa=!0}ua(){this.oa===0&&(this.ca("Unknown"),this._a=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,()=>(this._a=null,this.la("Backend didn't respond within 10 seconds."),this.ca("Offline"),Promise.resolve())))}ha(e){this.state==="Online"?this.ca("Unknown"):(this.oa++,this.oa>=1&&(this.Pa(),this.la(`Connection failed 1 times. Most recent error: ${e.toString()}`),this.ca("Offline")))}set(e){this.Pa(),this.oa=0,e==="Online"&&(this.aa=!1),this.ca(e)}ca(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))}la(e){const t=`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.aa?(it(t),this.aa=!1):D("OnlineStateTracker",t)}Pa(){this._a!==null&&(this._a.cancel(),this._a=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. + */const jt="RemoteStore";class ry{constructor(e,t,r,s,o){this.localStore=e,this.datastore=t,this.asyncQueue=r,this.remoteSyncer={},this.Ta=[],this.Ia=new Map,this.Ea=new Set,this.da=[],this.Aa=o,this.Aa.Oo(a=>{r.enqueueAndForget(async()=>{Gt(this)&&(D(jt,"Restarting streams for network reachability change."),await async function(h){const d=F(h);d.Ea.add(4),await fr(d),d.Ra.set("Unknown"),d.Ea.delete(4),await Ds(d)}(this))})}),this.Ra=new ny(r,s)}}async function Ds(n){if(Gt(n))for(const e of n.da)await e(!0)}async function fr(n){for(const e of n.da)await e(!1)}function ih(n,e){const t=F(n);t.Ia.has(e.targetId)||(t.Ia.set(e.targetId,e),vo(t)?Io(t):Tn(t).O_()&&To(t,e))}function Eo(n,e){const t=F(n),r=Tn(t);t.Ia.delete(e),r.O_()&&oh(t,e),t.Ia.size===0&&(r.O_()?r.L_():Gt(t)&&t.Ra.set("Unknown"))}function To(n,e){if(n.Va.Ue(e.targetId),e.resumeToken.approximateByteSize()>0||e.snapshotVersion.compareTo(U.min())>0){const t=n.remoteSyncer.getRemoteKeysForTarget(e.targetId).size;e=e.withExpectedCount(t)}Tn(n).Y_(e)}function oh(n,e){n.Va.Ue(e),Tn(n).Z_(e)}function Io(n){n.Va=new Yg({getRemoteKeysForTarget:e=>n.remoteSyncer.getRemoteKeysForTarget(e),At:e=>n.Ia.get(e)||null,ht:()=>n.datastore.serializer.databaseId}),Tn(n).start(),n.Ra.ua()}function vo(n){return Gt(n)&&!Tn(n).x_()&&n.Ia.size>0}function Gt(n){return F(n).Ea.size===0}function ah(n){n.Va=void 0}async function sy(n){n.Ra.set("Online")}async function iy(n){n.Ia.forEach((e,t)=>{To(n,e)})}async function oy(n,e){ah(n),vo(n)?(n.Ra.ha(e),Io(n)):n.Ra.set("Unknown")}async function ay(n,e,t){if(n.Ra.set("Online"),e instanceof Hl&&e.state===2&&e.cause)try{await async function(s,o){const a=o.cause;for(const u of o.targetIds)s.Ia.has(u)&&(await s.remoteSyncer.rejectListen(u,a),s.Ia.delete(u),s.Va.removeTarget(u))}(n,e)}catch(r){D(jt,"Failed to remove targets %s: %s ",e.targetIds.join(","),r),await ps(n,r)}else if(e instanceof Xr?n.Va.Ze(e):e instanceof zl?n.Va.st(e):n.Va.tt(e),!t.isEqual(U.min()))try{const r=await nh(n.localStore);t.compareTo(r)>=0&&await function(o,a){const u=o.Va.Tt(a);return u.targetChanges.forEach((h,d)=>{if(h.resumeToken.approximateByteSize()>0){const p=o.Ia.get(d);p&&o.Ia.set(d,p.withResumeToken(h.resumeToken,a))}}),u.targetMismatches.forEach((h,d)=>{const p=o.Ia.get(h);if(!p)return;o.Ia.set(h,p.withResumeToken(pe.EMPTY_BYTE_STRING,p.snapshotVersion)),oh(o,h);const y=new gt(p.target,h,d,p.sequenceNumber);To(o,y)}),o.remoteSyncer.applyRemoteEvent(u)}(n,t)}catch(r){D(jt,"Failed to raise snapshot:",r),await ps(n,r)}}async function ps(n,e,t){if(!yn(e))throw e;n.Ea.add(1),await fr(n),n.Ra.set("Offline"),t||(t=()=>nh(n.localStore)),n.asyncQueue.enqueueRetryable(async()=>{D(jt,"Retrying IndexedDB access"),await t(),n.Ea.delete(1),await Ds(n)})}function ch(n,e){return e().catch(t=>ps(n,t,e))}async function Os(n){const e=F(n),t=Rt(e);let r=e.Ta.length>0?e.Ta[e.Ta.length-1].batchId:ro;for(;cy(e);)try{const s=await $_(e.localStore,r);if(s===null){e.Ta.length===0&&t.L_();break}r=s.batchId,uy(e,s)}catch(s){await ps(e,s)}uh(e)&&lh(e)}function cy(n){return Gt(n)&&n.Ta.length<10}function uy(n,e){n.Ta.push(e);const t=Rt(n);t.O_()&&t.X_&&t.ea(e.mutations)}function uh(n){return Gt(n)&&!Rt(n).x_()&&n.Ta.length>0}function lh(n){Rt(n).start()}async function ly(n){Rt(n).ra()}async function hy(n){const e=Rt(n);for(const t of n.Ta)e.ea(t.mutations)}async function dy(n,e,t){const r=n.Ta.shift(),s=ho.from(r,e,t);await ch(n,()=>n.remoteSyncer.applySuccessfulWrite(s)),await Os(n)}async function fy(n,e){e&&Rt(n).X_&&await async function(r,s){if(function(a){return Kg(a)&&a!==S.ABORTED}(s.code)){const o=r.Ta.shift();Rt(r).B_(),await ch(r,()=>r.remoteSyncer.rejectFailedWrite(o.batchId,s)),await Os(r)}}(n,e),uh(n)&&lh(n)}async function Yc(n,e){const t=F(n);t.asyncQueue.verifyOperationInProgress(),D(jt,"RemoteStore received new credentials");const r=Gt(t);t.Ea.add(3),await fr(t),r&&t.Ra.set("Unknown"),await t.remoteSyncer.handleCredentialChange(e),t.Ea.delete(3),await Ds(t)}async function py(n,e){const t=F(n);e?(t.Ea.delete(2),await Ds(t)):e||(t.Ea.add(2),await fr(t),t.Ra.set("Unknown"))}function Tn(n){return n.ma||(n.ma=function(t,r,s){const o=F(t);return o.sa(),new J_(r,o.connection,o.authCredentials,o.appCheckCredentials,o.serializer,s)}(n.datastore,n.asyncQueue,{Xo:sy.bind(null,n),t_:iy.bind(null,n),r_:oy.bind(null,n),H_:ay.bind(null,n)}),n.da.push(async e=>{e?(n.ma.B_(),vo(n)?Io(n):n.Ra.set("Unknown")):(await n.ma.stop(),ah(n))})),n.ma}function Rt(n){return n.fa||(n.fa=function(t,r,s){const o=F(t);return o.sa(),new Z_(r,o.connection,o.authCredentials,o.appCheckCredentials,o.serializer,s)}(n.datastore,n.asyncQueue,{Xo:()=>Promise.resolve(),t_:ly.bind(null,n),r_:fy.bind(null,n),ta:hy.bind(null,n),na:dy.bind(null,n)}),n.da.push(async e=>{e?(n.fa.B_(),await Os(n)):(await n.fa.stop(),n.Ta.length>0&&(D(jt,`Stopping write stream with ${n.Ta.length} pending writes`),n.Ta=[]))})),n.fa}/** + * @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 wo{constructor(e,t,r,s,o){this.asyncQueue=e,this.timerId=t,this.targetTimeMs=r,this.op=s,this.removalCallback=o,this.deferred=new tt,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(a=>{})}get promise(){return this.deferred.promise}static createAndSchedule(e,t,r,s,o){const a=Date.now()+r,u=new wo(e,t,a,s,o);return u.start(r),u}start(e){this.timerHandle=setTimeout(()=>this.handleDelayElapsed(),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){this.timerHandle!==null&&(this.clearTimeout(),this.deferred.reject(new N(S.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 Ao(n,e){if(it("AsyncQueue",`${e}: ${n}`),yn(n))return new N(S.UNAVAILABLE,`${e}: ${n}`);throw 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 on{static emptySet(e){return new on(e.comparator)}constructor(e){this.comparator=e?(t,r)=>e(t,r)||M.comparator(t.key,r.key):(t,r)=>M.comparator(t.key,r.key),this.keyedMap=Bn(),this.sortedSet=new ee(this.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 t=this.keyedMap.get(e);return t?this.sortedSet.indexOf(t):-1}get size(){return this.sortedSet.size}forEach(e){this.sortedSet.inorderTraversal((t,r)=>(e(t),!1))}add(e){const t=this.delete(e.key);return t.copy(t.keyedMap.insert(e.key,e),t.sortedSet.insert(e,null))}delete(e){const t=this.get(e);return t?this.copy(this.keyedMap.remove(e),this.sortedSet.remove(t)):this}isEqual(e){if(!(e instanceof on)||this.size!==e.size)return!1;const t=this.sortedSet.getIterator(),r=e.sortedSet.getIterator();for(;t.hasNext();){const s=t.getNext().key,o=r.getNext().key;if(!s.isEqual(o))return!1}return!0}toString(){const e=[];return this.forEach(t=>{e.push(t.toString())}),e.length===0?"DocumentSet ()":`DocumentSet ( + `+e.join(` +`)+` +)`}copy(e,t){const r=new on;return r.comparator=this.comparator,r.keyedMap=e,r.sortedSet=t,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 Jc{constructor(){this.ga=new ee(M.comparator)}track(e){const t=e.doc.key,r=this.ga.get(t);r?e.type!==0&&r.type===3?this.ga=this.ga.insert(t,e):e.type===3&&r.type!==1?this.ga=this.ga.insert(t,{type:r.type,doc:e.doc}):e.type===2&&r.type===2?this.ga=this.ga.insert(t,{type:2,doc:e.doc}):e.type===2&&r.type===0?this.ga=this.ga.insert(t,{type:0,doc:e.doc}):e.type===1&&r.type===0?this.ga=this.ga.remove(t):e.type===1&&r.type===2?this.ga=this.ga.insert(t,{type:1,doc:r.doc}):e.type===0&&r.type===1?this.ga=this.ga.insert(t,{type:2,doc:e.doc}):L(63341,{Rt:e,pa:r}):this.ga=this.ga.insert(t,e)}ya(){const e=[];return this.ga.inorderTraversal((t,r)=>{e.push(r)}),e}}class pn{constructor(e,t,r,s,o,a,u,h,d){this.query=e,this.docs=t,this.oldDocs=r,this.docChanges=s,this.mutatedKeys=o,this.fromCache=a,this.syncStateChanged=u,this.excludesMetadataChanges=h,this.hasCachedResults=d}static fromInitialDocuments(e,t,r,s,o){const a=[];return t.forEach(u=>{a.push({type:0,doc:u})}),new pn(e,t,on.emptySet(t),a,r,s,!0,!1,o)}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)&&Ps(this.query,e.query)&&this.docs.isEqual(e.docs)&&this.oldDocs.isEqual(e.oldDocs)))return!1;const t=this.docChanges,r=e.docChanges;if(t.length!==r.length)return!1;for(let s=0;se.Da())}}class gy{constructor(){this.queries=Zc(),this.onlineState="Unknown",this.Ca=new Set}terminate(){(function(t,r){const s=F(t),o=s.queries;s.queries=Zc(),o.forEach((a,u)=>{for(const h of u.Sa)h.onError(r)})})(this,new N(S.ABORTED,"Firestore shutting down"))}}function Zc(){return new Ht(n=>Vl(n),Ps)}async function hh(n,e){const t=F(n);let r=3;const s=e.query;let o=t.queries.get(s);o?!o.ba()&&e.Da()&&(r=2):(o=new my,r=e.Da()?0:1);try{switch(r){case 0:o.wa=await t.onListen(s,!0);break;case 1:o.wa=await t.onListen(s,!1);break;case 2:await t.onFirstRemoteStoreListen(s)}}catch(a){const u=Ao(a,`Initialization of query '${Jt(e.query)}' failed`);return void e.onError(u)}t.queries.set(s,o),o.Sa.push(e),e.va(t.onlineState),o.wa&&e.Fa(o.wa)&&Ro(t)}async function dh(n,e){const t=F(n),r=e.query;let s=3;const o=t.queries.get(r);if(o){const a=o.Sa.indexOf(e);a>=0&&(o.Sa.splice(a,1),o.Sa.length===0?s=e.Da()?0:1:!o.ba()&&e.Da()&&(s=2))}switch(s){case 0:return t.queries.delete(r),t.onUnlisten(r,!0);case 1:return t.queries.delete(r),t.onUnlisten(r,!1);case 2:return t.onLastRemoteStoreUnlisten(r);default:return}}function _y(n,e){const t=F(n);let r=!1;for(const s of e){const o=s.query,a=t.queries.get(o);if(a){for(const u of a.Sa)u.Fa(s)&&(r=!0);a.wa=s}}r&&Ro(t)}function yy(n,e,t){const r=F(n),s=r.queries.get(e);if(s)for(const o of s.Sa)o.onError(t);r.queries.delete(e)}function Ro(n){n.Ca.forEach(e=>{e.next()})}var Ui,eu;(eu=Ui||(Ui={})).Ma="default",eu.Cache="cache";class fh{constructor(e,t,r){this.query=e,this.xa=t,this.Oa=!1,this.Na=null,this.onlineState="Unknown",this.options=r||{}}Fa(e){if(!this.options.includeMetadataChanges){const r=[];for(const s of e.docChanges)s.type!==3&&r.push(s);e=new pn(e.query,e.docs,e.oldDocs,r,e.mutatedKeys,e.fromCache,e.syncStateChanged,!0,e.hasCachedResults)}let t=!1;return this.Oa?this.Ba(e)&&(this.xa.next(e),t=!0):this.La(e,this.onlineState)&&(this.ka(e),t=!0),this.Na=e,t}onError(e){this.xa.error(e)}va(e){this.onlineState=e;let t=!1;return this.Na&&!this.Oa&&this.La(this.Na,e)&&(this.ka(this.Na),t=!0),t}La(e,t){if(!e.fromCache||!this.Da())return!0;const r=t!=="Offline";return(!this.options.qa||!r)&&(!e.docs.isEmpty()||e.hasCachedResults||t==="Offline")}Ba(e){if(e.docChanges.length>0)return!0;const t=this.Na&&this.Na.hasPendingWrites!==e.hasPendingWrites;return!(!e.syncStateChanged&&!t)&&this.options.includeMetadataChanges===!0}ka(e){e=pn.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache,e.hasCachedResults),this.Oa=!0,this.xa.next(e)}Da(){return this.options.source!==Ui.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 ph{constructor(e){this.key=e}}class mh{constructor(e){this.key=e}}class Ey{constructor(e,t){this.query=e,this.Ya=t,this.Za=null,this.hasCachedResults=!1,this.current=!1,this.Xa=H(),this.mutatedKeys=H(),this.eu=Nl(e),this.tu=new on(this.eu)}get nu(){return this.Ya}ru(e,t){const r=t?t.iu:new Jc,s=t?t.tu:this.tu;let o=t?t.mutatedKeys:this.mutatedKeys,a=s,u=!1;const h=this.query.limitType==="F"&&s.size===this.query.limit?s.last():null,d=this.query.limitType==="L"&&s.size===this.query.limit?s.first():null;if(e.inorderTraversal((p,y)=>{const E=s.get(p),P=Cs(this.query,y)?y:null,b=!!E&&this.mutatedKeys.has(E.key),O=!!P&&(P.hasLocalMutations||this.mutatedKeys.has(P.key)&&P.hasCommittedMutations);let k=!1;E&&P?E.data.isEqual(P.data)?b!==O&&(r.track({type:3,doc:P}),k=!0):this.su(E,P)||(r.track({type:2,doc:P}),k=!0,(h&&this.eu(P,h)>0||d&&this.eu(P,d)<0)&&(u=!0)):!E&&P?(r.track({type:0,doc:P}),k=!0):E&&!P&&(r.track({type:1,doc:E}),k=!0,(h||d)&&(u=!0)),k&&(P?(a=a.add(P),o=O?o.add(p):o.delete(p)):(a=a.delete(p),o=o.delete(p)))}),this.query.limit!==null)for(;a.size>this.query.limit;){const p=this.query.limitType==="F"?a.last():a.first();a=a.delete(p.key),o=o.delete(p.key),r.track({type:1,doc:p})}return{tu:a,iu:r,Cs:u,mutatedKeys:o}}su(e,t){return e.hasLocalMutations&&t.hasCommittedMutations&&!t.hasLocalMutations}applyChanges(e,t,r,s){const o=this.tu;this.tu=e.tu,this.mutatedKeys=e.mutatedKeys;const a=e.iu.ya();a.sort((p,y)=>function(P,b){const O=k=>{switch(k){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return L(20277,{Rt:k})}};return O(P)-O(b)}(p.type,y.type)||this.eu(p.doc,y.doc)),this.ou(r),s=s??!1;const u=t&&!s?this._u():[],h=this.Xa.size===0&&this.current&&!s?1:0,d=h!==this.Za;return this.Za=h,a.length!==0||d?{snapshot:new pn(this.query,e.tu,o,a,e.mutatedKeys,h===0,d,!1,!!r&&r.resumeToken.approximateByteSize()>0),au:u}:{au:u}}va(e){return this.current&&e==="Offline"?(this.current=!1,this.applyChanges({tu:this.tu,iu:new Jc,mutatedKeys:this.mutatedKeys,Cs:!1},!1)):{au:[]}}uu(e){return!this.Ya.has(e)&&!!this.tu.has(e)&&!this.tu.get(e).hasLocalMutations}ou(e){e&&(e.addedDocuments.forEach(t=>this.Ya=this.Ya.add(t)),e.modifiedDocuments.forEach(t=>{}),e.removedDocuments.forEach(t=>this.Ya=this.Ya.delete(t)),this.current=e.current)}_u(){if(!this.current)return[];const e=this.Xa;this.Xa=H(),this.tu.forEach(r=>{this.uu(r.key)&&(this.Xa=this.Xa.add(r.key))});const t=[];return e.forEach(r=>{this.Xa.has(r)||t.push(new mh(r))}),this.Xa.forEach(r=>{e.has(r)||t.push(new ph(r))}),t}cu(e){this.Ya=e.Qs,this.Xa=H();const t=this.ru(e.documents);return this.applyChanges(t,!0)}lu(){return pn.fromInitialDocuments(this.query,this.tu,this.mutatedKeys,this.Za===0,this.hasCachedResults)}}const So="SyncEngine";class Ty{constructor(e,t,r){this.query=e,this.targetId=t,this.view=r}}class Iy{constructor(e){this.key=e,this.hu=!1}}class vy{constructor(e,t,r,s,o,a){this.localStore=e,this.remoteStore=t,this.eventManager=r,this.sharedClientState=s,this.currentUser=o,this.maxConcurrentLimboResolutions=a,this.Pu={},this.Tu=new Ht(u=>Vl(u),Ps),this.Iu=new Map,this.Eu=new Set,this.du=new ee(M.comparator),this.Au=new Map,this.Ru=new mo,this.Vu={},this.mu=new Map,this.fu=fn.cr(),this.onlineState="Unknown",this.gu=void 0}get isPrimaryClient(){return this.gu===!0}}async function wy(n,e,t=!0){const r=Ih(n);let s;const o=r.Tu.get(e);return o?(r.sharedClientState.addLocalQueryTarget(o.targetId),s=o.view.lu()):s=await gh(r,e,t,!0),s}async function Ay(n,e){const t=Ih(n);await gh(t,e,!0,!1)}async function gh(n,e,t,r){const s=await z_(n.localStore,qe(e)),o=s.targetId,a=n.sharedClientState.addLocalQueryTarget(o,t);let u;return r&&(u=await Ry(n,e,o,a==="current",s.resumeToken)),n.isPrimaryClient&&t&&ih(n.remoteStore,s),u}async function Ry(n,e,t,r,s){n.pu=(y,E,P)=>async function(O,k,q,j){let B=k.view.ru(q);B.Cs&&(B=await Gc(O.localStore,k.query,!1).then(({documents:v})=>k.view.ru(v,B)));const Q=j&&j.targetChanges.get(k.targetId),we=j&&j.targetMismatches.get(k.targetId)!=null,se=k.view.applyChanges(B,O.isPrimaryClient,Q,we);return nu(O,k.targetId,se.au),se.snapshot}(n,y,E,P);const o=await Gc(n.localStore,e,!0),a=new Ey(e,o.Qs),u=a.ru(o.documents),h=dr.createSynthesizedTargetChangeForCurrentChange(t,r&&n.onlineState!=="Offline",s),d=a.applyChanges(u,n.isPrimaryClient,h);nu(n,t,d.au);const p=new Ty(e,t,a);return n.Tu.set(e,p),n.Iu.has(t)?n.Iu.get(t).push(e):n.Iu.set(t,[e]),d.snapshot}async function Sy(n,e,t){const r=F(n),s=r.Tu.get(e),o=r.Iu.get(s.targetId);if(o.length>1)return r.Iu.set(s.targetId,o.filter(a=>!Ps(a,e))),void r.Tu.delete(e);r.isPrimaryClient?(r.sharedClientState.removeLocalQueryTarget(s.targetId),r.sharedClientState.isActiveQueryTarget(s.targetId)||await Li(r.localStore,s.targetId,!1).then(()=>{r.sharedClientState.clearQueryState(s.targetId),t&&Eo(r.remoteStore,s.targetId),Fi(r,s.targetId)}).catch(_n)):(Fi(r,s.targetId),await Li(r.localStore,s.targetId,!0))}async function Py(n,e){const t=F(n),r=t.Tu.get(e),s=t.Iu.get(r.targetId);t.isPrimaryClient&&s.length===1&&(t.sharedClientState.removeLocalQueryTarget(r.targetId),Eo(t.remoteStore,r.targetId))}async function Cy(n,e,t){const r=My(n);try{const s=await function(a,u){const h=F(a),d=Z.now(),p=u.reduce((P,b)=>P.add(b.key),H());let y,E;return h.persistence.runTransaction("Locally write mutations","readwrite",P=>{let b=ot(),O=H();return h.Ns.getEntries(P,p).next(k=>{b=k,b.forEach((q,j)=>{j.isValidDocument()||(O=O.add(q))})}).next(()=>h.localDocuments.getOverlayedDocuments(P,b)).next(k=>{y=k;const q=[];for(const j of u){const B=$g(j,y.get(j.key).overlayedDocument);B!=null&&q.push(new Ct(j.key,B,wl(B.value.mapValue),Me.exists(!0)))}return h.mutationQueue.addMutationBatch(P,d,q,u)}).next(k=>{E=k;const q=k.applyToLocalDocumentSet(y,O);return h.documentOverlayCache.saveOverlays(P,k.batchId,q)})}).then(()=>({batchId:E.batchId,changes:Ol(y)}))}(r.localStore,e);r.sharedClientState.addPendingMutation(s.batchId),function(a,u,h){let d=a.Vu[a.currentUser.toKey()];d||(d=new ee(z)),d=d.insert(u,h),a.Vu[a.currentUser.toKey()]=d}(r,s.batchId,t),await pr(r,s.changes),await Os(r.remoteStore)}catch(s){const o=Ao(s,"Failed to persist write");t.reject(o)}}async function _h(n,e){const t=F(n);try{const r=await q_(t.localStore,e);e.targetChanges.forEach((s,o)=>{const a=t.Au.get(o);a&&(K(s.addedDocuments.size+s.modifiedDocuments.size+s.removedDocuments.size<=1,22616),s.addedDocuments.size>0?a.hu=!0:s.modifiedDocuments.size>0?K(a.hu,14607):s.removedDocuments.size>0&&(K(a.hu,42227),a.hu=!1))}),await pr(t,r,e)}catch(r){await _n(r)}}function tu(n,e,t){const r=F(n);if(r.isPrimaryClient&&t===0||!r.isPrimaryClient&&t===1){const s=[];r.Tu.forEach((o,a)=>{const u=a.view.va(e);u.snapshot&&s.push(u.snapshot)}),function(a,u){const h=F(a);h.onlineState=u;let d=!1;h.queries.forEach((p,y)=>{for(const E of y.Sa)E.va(u)&&(d=!0)}),d&&Ro(h)}(r.eventManager,e),s.length&&r.Pu.H_(s),r.onlineState=e,r.isPrimaryClient&&r.sharedClientState.setOnlineState(e)}}async function by(n,e,t){const r=F(n);r.sharedClientState.updateQueryState(e,"rejected",t);const s=r.Au.get(e),o=s&&s.key;if(o){let a=new ee(M.comparator);a=a.insert(o,Ie.newNoDocument(o,U.min()));const u=H().add(o),h=new Vs(U.min(),new Map,new ee(z),a,u);await _h(r,h),r.du=r.du.remove(o),r.Au.delete(e),Po(r)}else await Li(r.localStore,e,!1).then(()=>Fi(r,e,t)).catch(_n)}async function ky(n,e){const t=F(n),r=e.batch.batchId;try{const s=await B_(t.localStore,e);Eh(t,r,null),yh(t,r),t.sharedClientState.updateMutationState(r,"acknowledged"),await pr(t,s)}catch(s){await _n(s)}}async function Vy(n,e,t){const r=F(n);try{const s=await function(a,u){const h=F(a);return h.persistence.runTransaction("Reject batch","readwrite-primary",d=>{let p;return h.mutationQueue.lookupMutationBatch(d,u).next(y=>(K(y!==null,37113),p=y.keys(),h.mutationQueue.removeMutationBatch(d,y))).next(()=>h.mutationQueue.performConsistencyCheck(d)).next(()=>h.documentOverlayCache.removeOverlaysForBatchId(d,p,u)).next(()=>h.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(d,p)).next(()=>h.localDocuments.getDocuments(d,p))})}(r.localStore,e);Eh(r,e,t),yh(r,e),r.sharedClientState.updateMutationState(e,"rejected",t),await pr(r,s)}catch(s){await _n(s)}}function yh(n,e){(n.mu.get(e)||[]).forEach(t=>{t.resolve()}),n.mu.delete(e)}function Eh(n,e,t){const r=F(n);let s=r.Vu[r.currentUser.toKey()];if(s){const o=s.get(e);o&&(t?o.reject(t):o.resolve(),s=s.remove(e)),r.Vu[r.currentUser.toKey()]=s}}function Fi(n,e,t=null){n.sharedClientState.removeLocalQueryTarget(e);for(const r of n.Iu.get(e))n.Tu.delete(r),t&&n.Pu.yu(r,t);n.Iu.delete(e),n.isPrimaryClient&&n.Ru.jr(e).forEach(r=>{n.Ru.containsKey(r)||Th(n,r)})}function Th(n,e){n.Eu.delete(e.path.canonicalString());const t=n.du.get(e);t!==null&&(Eo(n.remoteStore,t),n.du=n.du.remove(e),n.Au.delete(t),Po(n))}function nu(n,e,t){for(const r of t)r instanceof ph?(n.Ru.addReference(r.key,e),Ny(n,r)):r instanceof mh?(D(So,"Document no longer in limbo: "+r.key),n.Ru.removeReference(r.key,e),n.Ru.containsKey(r.key)||Th(n,r.key)):L(19791,{wu:r})}function Ny(n,e){const t=e.key,r=t.path.canonicalString();n.du.get(t)||n.Eu.has(r)||(D(So,"New document in limbo: "+t),n.Eu.add(r),Po(n))}function Po(n){for(;n.Eu.size>0&&n.du.size{a.push(r.pu(h,e,t).then(d=>{if((d||t)&&r.isPrimaryClient){const p=d?!d.fromCache:t?.targetChanges.get(h.targetId)?.current;r.sharedClientState.updateQueryState(h.targetId,p?"current":"not-current")}if(d){s.push(d);const p=_o.As(h.targetId,d);o.push(p)}}))}),await Promise.all(a),r.Pu.H_(s),await async function(h,d){const p=F(h);try{await p.persistence.runTransaction("notifyLocalViewChanges","readwrite",y=>C.forEach(d,E=>C.forEach(E.Es,P=>p.persistence.referenceDelegate.addReference(y,E.targetId,P)).next(()=>C.forEach(E.ds,P=>p.persistence.referenceDelegate.removeReference(y,E.targetId,P)))))}catch(y){if(!yn(y))throw y;D(yo,"Failed to update sequence numbers: "+y)}for(const y of d){const E=y.targetId;if(!y.fromCache){const P=p.Ms.get(E),b=P.snapshotVersion,O=P.withLastLimboFreeSnapshotVersion(b);p.Ms=p.Ms.insert(E,O)}}}(r.localStore,o))}async function Dy(n,e){const t=F(n);if(!t.currentUser.isEqual(e)){D(So,"User change. New user:",e.toKey());const r=await th(t.localStore,e);t.currentUser=e,function(o,a){o.mu.forEach(u=>{u.forEach(h=>{h.reject(new N(S.CANCELLED,a))})}),o.mu.clear()}(t,"'waitForPendingWrites' promise is rejected due to a user change."),t.sharedClientState.handleUserChange(e,r.removedBatchIds,r.addedBatchIds),await pr(t,r.Ls)}}function Oy(n,e){const t=F(n),r=t.Au.get(e);if(r&&r.hu)return H().add(r.key);{let s=H();const o=t.Iu.get(e);if(!o)return s;for(const a of o){const u=t.Tu.get(a);s=s.unionWith(u.view.nu)}return s}}function Ih(n){const e=F(n);return e.remoteStore.remoteSyncer.applyRemoteEvent=_h.bind(null,e),e.remoteStore.remoteSyncer.getRemoteKeysForTarget=Oy.bind(null,e),e.remoteStore.remoteSyncer.rejectListen=by.bind(null,e),e.Pu.H_=_y.bind(null,e.eventManager),e.Pu.yu=yy.bind(null,e.eventManager),e}function My(n){const e=F(n);return e.remoteStore.remoteSyncer.applySuccessfulWrite=ky.bind(null,e),e.remoteStore.remoteSyncer.rejectFailedWrite=Vy.bind(null,e),e}class ms{constructor(){this.kind="memory",this.synchronizeTabs=!1}async initialize(e){this.serializer=Ns(e.databaseInfo.databaseId),this.sharedClientState=this.Du(e),this.persistence=this.Cu(e),await this.persistence.start(),this.localStore=this.vu(e),this.gcScheduler=this.Fu(e,this.localStore),this.indexBackfillerScheduler=this.Mu(e,this.localStore)}Fu(e,t){return null}Mu(e,t){return null}vu(e){return F_(this.persistence,new L_,e.initialUser,this.serializer)}Cu(e){return new eh(go.mi,this.serializer)}Du(e){return new G_}async terminate(){this.gcScheduler?.stop(),this.indexBackfillerScheduler?.stop(),this.sharedClientState.shutdown(),await this.persistence.shutdown()}}ms.provider={build:()=>new ms};class Ly extends ms{constructor(e){super(),this.cacheSizeBytes=e}Fu(e,t){K(this.persistence.referenceDelegate instanceof fs,46915);const r=this.persistence.referenceDelegate.garbageCollector;return new I_(r,e.asyncQueue,t)}Cu(e){const t=this.cacheSizeBytes!==void 0?Se.withCacheSize(this.cacheSizeBytes):Se.DEFAULT;return new eh(r=>fs.mi(r,t),this.serializer)}}class Bi{async initialize(e,t){this.localStore||(this.localStore=e.localStore,this.sharedClientState=e.sharedClientState,this.datastore=this.createDatastore(t),this.remoteStore=this.createRemoteStore(t),this.eventManager=this.createEventManager(t),this.syncEngine=this.createSyncEngine(t,!e.synchronizeTabs),this.sharedClientState.onlineStateHandler=r=>tu(this.syncEngine,r,1),this.remoteStore.remoteSyncer.handleCredentialChange=Dy.bind(null,this.syncEngine),await py(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(e){return function(){return new gy}()}createDatastore(e){const t=Ns(e.databaseInfo.databaseId),r=function(o){return new Y_(o)}(e.databaseInfo);return function(o,a,u,h){return new ty(o,a,u,h)}(e.authCredentials,e.appCheckCredentials,r,t)}createRemoteStore(e){return function(r,s,o,a,u){return new ry(r,s,o,a,u)}(this.localStore,this.datastore,e.asyncQueue,t=>tu(this.syncEngine,t,0),function(){return Qc.v()?new Qc:new W_}())}createSyncEngine(e,t){return function(s,o,a,u,h,d,p){const y=new vy(s,o,a,u,h,d);return p&&(y.gu=!0),y}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,e.initialUser,e.maxConcurrentLimboResolutions,t)}async terminate(){await async function(t){const r=F(t);D(jt,"RemoteStore shutting down."),r.Ea.add(5),await fr(r),r.Aa.shutdown(),r.Ra.set("Unknown")}(this.remoteStore),this.datastore?.terminate(),this.eventManager?.terminate()}}Bi.provider={build:()=>new Bi};/** + * @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 vh{constructor(e){this.observer=e,this.muted=!1}next(e){this.muted||this.observer.next&&this.Ou(this.observer.next,e)}error(e){this.muted||(this.observer.error?this.Ou(this.observer.error,e):it("Uncaught Error in snapshot listener:",e.toString()))}Nu(){this.muted=!0}Ou(e,t){setTimeout(()=>{this.muted||e(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. + */const St="FirestoreClient";class xy{constructor(e,t,r,s,o){this.authCredentials=e,this.appCheckCredentials=t,this.asyncQueue=r,this.databaseInfo=s,this.user=Te.UNAUTHENTICATED,this.clientId=no.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this._uninitializedComponentsProvider=o,this.authCredentials.start(r,async a=>{D(St,"Received user=",a.uid),await this.authCredentialListener(a),this.user=a}),this.appCheckCredentials.start(r,a=>(D(St,"Received new app check token=",a),this.appCheckCredentialListener(a,this.user)))}get configuration(){return{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,authCredentials:this.authCredentials,appCheckCredentials:this.appCheckCredentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(e){this.authCredentialListener=e}setAppCheckTokenChangeListener(e){this.appCheckCredentialListener=e}terminate(){this.asyncQueue.enterRestrictedMode();const e=new tt;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted(async()=>{try{this._onlineComponents&&await this._onlineComponents.terminate(),this._offlineComponents&&await this._offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),e.resolve()}catch(t){const r=Ao(t,"Failed to shutdown persistence");e.reject(r)}}),e.promise}}async function _i(n,e){n.asyncQueue.verifyOperationInProgress(),D(St,"Initializing OfflineComponentProvider");const t=n.configuration;await e.initialize(t);let r=t.initialUser;n.setCredentialChangeListener(async s=>{r.isEqual(s)||(await th(e.localStore,s),r=s)}),e.persistence.setDatabaseDeletedListener(()=>n.terminate()),n._offlineComponents=e}async function ru(n,e){n.asyncQueue.verifyOperationInProgress();const t=await Uy(n);D(St,"Initializing OnlineComponentProvider"),await e.initialize(t,n.configuration),n.setCredentialChangeListener(r=>Yc(e.remoteStore,r)),n.setAppCheckTokenChangeListener((r,s)=>Yc(e.remoteStore,s)),n._onlineComponents=e}async function Uy(n){if(!n._offlineComponents)if(n._uninitializedComponentsProvider){D(St,"Using user provided OfflineComponentProvider");try{await _i(n,n._uninitializedComponentsProvider._offline)}catch(e){const t=e;if(!function(s){return s.name==="FirebaseError"?s.code===S.FAILED_PRECONDITION||s.code===S.UNIMPLEMENTED:!(typeof DOMException<"u"&&s instanceof DOMException)||s.code===22||s.code===20||s.code===11}(t))throw t;un("Error using user provided cache. Falling back to memory cache: "+t),await _i(n,new ms)}}else D(St,"Using default OfflineComponentProvider"),await _i(n,new Ly(void 0));return n._offlineComponents}async function wh(n){return n._onlineComponents||(n._uninitializedComponentsProvider?(D(St,"Using user provided OnlineComponentProvider"),await ru(n,n._uninitializedComponentsProvider._online)):(D(St,"Using default OnlineComponentProvider"),await ru(n,new Bi))),n._onlineComponents}function Fy(n){return wh(n).then(e=>e.syncEngine)}async function Ah(n){const e=await wh(n),t=e.eventManager;return t.onListen=wy.bind(null,e.syncEngine),t.onUnlisten=Sy.bind(null,e.syncEngine),t.onFirstRemoteStoreListen=Ay.bind(null,e.syncEngine),t.onLastRemoteStoreUnlisten=Py.bind(null,e.syncEngine),t}function By(n,e,t={}){const r=new tt;return n.asyncQueue.enqueueAndForget(async()=>function(o,a,u,h,d){const p=new vh({next:E=>{p.Nu(),a.enqueueAndForget(()=>dh(o,y));const P=E.docs.has(u);!P&&E.fromCache?d.reject(new N(S.UNAVAILABLE,"Failed to get document because the client is offline.")):P&&E.fromCache&&h&&h.source==="server"?d.reject(new N(S.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.)')):d.resolve(E)},error:E=>d.reject(E)}),y=new fh(co(u.path),p,{includeMetadataChanges:!0,qa:!0});return hh(o,y)}(await Ah(n),n.asyncQueue,e,t,r)),r.promise}function qy(n,e,t={}){const r=new tt;return n.asyncQueue.enqueueAndForget(async()=>function(o,a,u,h,d){const p=new vh({next:E=>{p.Nu(),a.enqueueAndForget(()=>dh(o,y)),E.fromCache&&h.source==="server"?d.reject(new N(S.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.)')):d.resolve(E)},error:E=>d.reject(E)}),y=new fh(u,p,{includeMetadataChanges:!0,qa:!0});return hh(o,y)}(await Ah(n),n.asyncQueue,e,t,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 Rh(n){const e={};return n.timeoutSeconds!==void 0&&(e.timeoutSeconds=n.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 su=new Map;/** + * @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 Sh="firestore.googleapis.com",iu=!0;class ou{constructor(e){if(e.host===void 0){if(e.ssl!==void 0)throw new N(S.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host=Sh,this.ssl=iu}else this.host=e.host,this.ssl=e.ssl??iu;if(this.isUsingEmulator=e.emulatorOptions!==void 0,this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,this.localCache=e.localCache,e.cacheSizeBytes===void 0)this.cacheSizeBytes=Zl;else{if(e.cacheSizeBytes!==-1&&e.cacheSizeBytes30)throw new N(S.INVALID_ARGUMENT,`invalid long polling timeout: ${r.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,s){return r.timeoutSeconds===s.timeoutSeconds}(this.experimentalLongPollingOptions,e.experimentalLongPollingOptions)&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams}}class Ms{constructor(e,t,r,s){this._authCredentials=e,this._appCheckCredentials=t,this._databaseId=r,this._app=s,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new ou({}),this._settingsFrozen=!1,this._emulatorOptions={},this._terminateTask="notTerminated"}get app(){if(!this._app)throw new N(S.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app}get _initialized(){return this._settingsFrozen}get _terminated(){return this._terminateTask!=="notTerminated"}_setSettings(e){if(this._settingsFrozen)throw new N(S.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 ou(e),this._emulatorOptions=e.emulatorOptions||{},e.credentials!==void 0&&(this._authCredentials=function(r){if(!r)return new Hm;switch(r.type){case"firstParty":return new Qm(r.sessionIndex||"0",r.iamToken||null,r.authTokenFactory||null);case"provider":return r.client;default:throw new N(S.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invalid credential type")}}(e.credentials))}_getSettings(){return this._settings}_getEmulatorOptions(){return this._emulatorOptions}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return this._terminateTask==="notTerminated"&&(this._terminateTask=this._terminate()),this._terminateTask}async _restart(){this._terminateTask==="notTerminated"?await this._terminate():this._terminateTask="notTerminated"}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return function(t){const r=su.get(t);r&&(D("ComponentProvider","Removing Datastore"),su.delete(t),r.terminate())}(this),Promise.resolve()}}function jy(n,e,t,r={}){n=He(n,Ms);const s=$t(e),o=n._getSettings(),a={...o,emulatorOptions:n._getEmulatorOptions()},u=`${e}:${t}`;s&&(ji(`https://${u}`),$i("Firestore",!0)),o.host!==Sh&&o.host!==u&&un("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used.");const h={...o,host:u,ssl:s,emulatorOptions:r};if(!Ut(h,a)&&(n._setSettings(h),r.mockUserToken)){let d,p;if(typeof r.mockUserToken=="string")d=r.mockUserToken,p=Te.MOCK_USER;else{d=Au(r.mockUserToken,n._app?.options.projectId);const y=r.mockUserToken.sub||r.mockUserToken.user_id;if(!y)throw new N(S.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");p=new Te(y)}n._authCredentials=new Gm(new hl(d,p))}}/** + * @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 bt{constructor(e,t,r){this.converter=t,this._query=r,this.type="query",this.firestore=e}withConverter(e){return new bt(this.firestore,e,this._query)}}class re{constructor(e,t,r){this.converter=t,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 Et(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new re(this.firestore,e,this._key)}toJSON(){return{type:re._jsonSchemaVersion,referencePath:this._key.toString()}}static fromJSON(e,t,r){if(lr(t,re._jsonSchema))return new re(e,r||null,new M(Y.fromString(t.referencePath)))}}re._jsonSchemaVersion="firestore/documentReference/1.0",re._jsonSchema={type:ae("string",re._jsonSchemaVersion),referencePath:ae("string")};class Et extends bt{constructor(e,t,r){super(e,t,co(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 re(this.firestore,null,new M(e))}withConverter(e){return new Et(this.firestore,e,this._path)}}function LE(n,e,...t){if(n=fe(n),dl("collection","path",e),n instanceof Ms){const r=Y.fromString(e,...t);return Ec(r),new Et(n,null,r)}{if(!(n instanceof re||n instanceof Et))throw new N(S.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const r=n._path.child(Y.fromString(e,...t));return Ec(r),new Et(n.firestore,null,r)}}function xE(n,e,...t){if(n=fe(n),arguments.length===1&&(e=no.newId()),dl("doc","path",e),n instanceof Ms){const r=Y.fromString(e,...t);return yc(r),new re(n,null,new M(r))}{if(!(n instanceof re||n instanceof Et))throw new N(S.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const r=n._path.child(Y.fromString(e,...t));return yc(r),new re(n.firestore,n instanceof Et?n.converter:null,new M(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 au="AsyncQueue";class cu{constructor(e=Promise.resolve()){this.Xu=[],this.ec=!1,this.tc=[],this.nc=null,this.rc=!1,this.sc=!1,this.oc=[],this.M_=new rh(this,"async_queue_retry"),this._c=()=>{const r=gi();r&&D(au,"Visibility state changed to "+r.visibilityState),this.M_.w_()},this.ac=e;const t=gi();t&&typeof t.addEventListener=="function"&&t.addEventListener("visibilitychange",this._c)}get isShuttingDown(){return this.ec}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.uc(),this.cc(e)}enterRestrictedMode(e){if(!this.ec){this.ec=!0,this.sc=e||!1;const t=gi();t&&typeof t.removeEventListener=="function"&&t.removeEventListener("visibilitychange",this._c)}}enqueue(e){if(this.uc(),this.ec)return new Promise(()=>{});const t=new tt;return this.cc(()=>this.ec&&this.sc?Promise.resolve():(e().then(t.resolve,t.reject),t.promise)).then(()=>t.promise)}enqueueRetryable(e){this.enqueueAndForget(()=>(this.Xu.push(e),this.lc()))}async lc(){if(this.Xu.length!==0){try{await this.Xu[0](),this.Xu.shift(),this.M_.reset()}catch(e){if(!yn(e))throw e;D(au,"Operation failed with retryable error: "+e)}this.Xu.length>0&&this.M_.p_(()=>this.lc())}}cc(e){const t=this.ac.then(()=>(this.rc=!0,e().catch(r=>{throw this.nc=r,this.rc=!1,it("INTERNAL UNHANDLED ERROR: ",uu(r)),r}).then(r=>(this.rc=!1,r))));return this.ac=t,t}enqueueAfterDelay(e,t,r){this.uc(),this.oc.indexOf(e)>-1&&(t=0);const s=wo.createAndSchedule(this,e,t,r,o=>this.hc(o));return this.tc.push(s),s}uc(){this.nc&&L(47125,{Pc:uu(this.nc)})}verifyOperationInProgress(){}async Tc(){let e;do e=this.ac,await e;while(e!==this.ac)}Ic(e){for(const t of this.tc)if(t.timerId===e)return!0;return!1}Ec(e){return this.Tc().then(()=>{this.tc.sort((t,r)=>t.targetTimeMs-r.targetTimeMs);for(const t of this.tc)if(t.skipDelay(),e!=="all"&&t.timerId===e)break;return this.Tc()})}dc(e){this.oc.push(e)}hc(e){const t=this.tc.indexOf(e);this.tc.splice(t,1)}}function uu(n){let e=n.message||"";return n.stack&&(e=n.stack.includes(n.message)?n.stack:n.message+` +`+n.stack),e}class In extends Ms{constructor(e,t,r,s){super(e,t,r,s),this.type="firestore",this._queue=new cu,this._persistenceKey=s?.name||"[DEFAULT]"}async _terminate(){if(this._firestoreClient){const e=this._firestoreClient.terminate();this._queue=new cu(e),this._firestoreClient=void 0,await e}}}function UE(n,e){const t=typeof n=="object"?n:Hi(),r=typeof n=="string"?n:as,s=Ts(t,"firestore").getImmediate({identifier:r});if(!s._initialized){const o=Iu("firestore");o&&jy(s,...o)}return s}function Co(n){if(n._terminated)throw new N(S.FAILED_PRECONDITION,"The client has already been terminated.");return n._firestoreClient||$y(n),n._firestoreClient}function $y(n){const e=n._freezeSettings(),t=function(s,o,a,u){return new fg(s,o,a,u.host,u.ssl,u.experimentalForceLongPolling,u.experimentalAutoDetectLongPolling,Rh(u.experimentalLongPollingOptions),u.useFetchStreams,u.isUsingEmulator)}(n._databaseId,n._app?.options.appId||"",n._persistenceKey,e);n._componentsProvider||e.localCache?._offlineComponentProvider&&e.localCache?._onlineComponentProvider&&(n._componentsProvider={_offline:e.localCache._offlineComponentProvider,_online:e.localCache._onlineComponentProvider}),n._firestoreClient=new xy(n._authCredentials,n._appCheckCredentials,n._queue,t,n._componentsProvider&&function(s){const o=s?._online.build();return{_offline:s?._offline.build(o),_online:o}}(n._componentsProvider))}/** + * @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 ke{constructor(e){this._byteString=e}static fromBase64String(e){try{return new ke(pe.fromBase64String(e))}catch(t){throw new N(S.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+t)}}static fromUint8Array(e){return new ke(pe.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)}toJSON(){return{type:ke._jsonSchemaVersion,bytes:this.toBase64()}}static fromJSON(e){if(lr(e,ke._jsonSchema))return ke.fromBase64String(e.bytes)}}ke._jsonSchemaVersion="firestore/bytes/1.0",ke._jsonSchema={type:ae("string",ke._jsonSchemaVersion),bytes:ae("string")};/** + * @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 Ls{constructor(...e){for(let t=0;t90)throw new N(S.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(t)||t<-180||t>180)throw new N(S.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+t);this._lat=e,this._long=t}get latitude(){return this._lat}get longitude(){return this._long}isEqual(e){return this._lat===e._lat&&this._long===e._long}_compareTo(e){return z(this._lat,e._lat)||z(this._long,e._long)}toJSON(){return{latitude:this._lat,longitude:this._long,type:$e._jsonSchemaVersion}}static fromJSON(e){if(lr(e,$e._jsonSchema))return new $e(e.latitude,e.longitude)}}$e._jsonSchemaVersion="firestore/geoPoint/1.0",$e._jsonSchema={type:ae("string",$e._jsonSchemaVersion),latitude:ae("number"),longitude:ae("number")};/** + * @license + * Copyright 2024 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 ze{constructor(e){this._values=(e||[]).map(t=>t)}toArray(){return this._values.map(e=>e)}isEqual(e){return function(r,s){if(r.length!==s.length)return!1;for(let o=0;otypeof t=="number"))return new ze(e.vectorValues);throw new N(S.INVALID_ARGUMENT,"Expected 'vectorValues' field to be a number array")}}}ze._jsonSchemaVersion="firestore/vectorValue/1.0",ze._jsonSchema={type:ae("string",ze._jsonSchemaVersion),vectorValues:ae("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. + */const zy=/^__.*__$/;class Hy{constructor(e,t,r){this.data=e,this.fieldMask=t,this.fieldTransforms=r}toMutation(e,t){return this.fieldMask!==null?new Ct(e,this.data,this.fieldMask,t,this.fieldTransforms):new hr(e,this.data,t,this.fieldTransforms)}}class Ph{constructor(e,t,r){this.data=e,this.fieldMask=t,this.fieldTransforms=r}toMutation(e,t){return new Ct(e,this.data,this.fieldMask,t,this.fieldTransforms)}}function Ch(n){switch(n){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw L(40011,{Ac:n})}}class bo{constructor(e,t,r,s,o,a){this.settings=e,this.databaseId=t,this.serializer=r,this.ignoreUndefinedProperties=s,o===void 0&&this.Rc(),this.fieldTransforms=o||[],this.fieldMask=a||[]}get path(){return this.settings.path}get Ac(){return this.settings.Ac}Vc(e){return new bo({...this.settings,...e},this.databaseId,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}mc(e){const t=this.path?.child(e),r=this.Vc({path:t,fc:!1});return r.gc(e),r}yc(e){const t=this.path?.child(e),r=this.Vc({path:t,fc:!1});return r.Rc(),r}wc(e){return this.Vc({path:void 0,fc:!0})}Sc(e){return gs(e,this.settings.methodName,this.settings.bc||!1,this.path,this.settings.Dc)}contains(e){return this.fieldMask.find(t=>e.isPrefixOf(t))!==void 0||this.fieldTransforms.find(t=>e.isPrefixOf(t.field))!==void 0}Rc(){if(this.path)for(let e=0;eh.covers(y.field))}else h=null,d=a.fieldTransforms;return new Hy(new Pe(u),h,d)}class Us extends xs{_toFieldTransform(e){if(e.Ac!==2)throw e.Ac===1?e.Sc(`${this._methodName}() can only appear at the top level of your update data`):e.Sc(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);return e.fieldMask.push(e.path),null}isEqual(e){return e instanceof Us}}class Vo extends xs{_toFieldTransform(e){return new Fg(e.path,new nr)}isEqual(e){return e instanceof Vo}}function Ky(n,e,t,r){const s=n.Cc(1,e,t);No("Data must be an object, but it was:",s,r);const o=[],a=Pe.empty();Pt(r,(h,d)=>{const p=Do(e,h,t);d=fe(d);const y=s.yc(p);if(d instanceof Us)o.push(p);else{const E=mr(d,y);E!=null&&(o.push(p),a.set(p,E))}});const u=new be(o);return new Ph(a,u,s.fieldTransforms)}function Qy(n,e,t,r,s,o){const a=n.Cc(1,e,t),u=[qi(e,r,t)],h=[s];if(o.length%2!=0)throw new N(S.INVALID_ARGUMENT,`Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);for(let E=0;E=0;--E)if(!Vh(d,u[E])){const P=u[E];let b=h[E];b=fe(b);const O=a.yc(P);if(b instanceof Us)d.push(P);else{const k=mr(b,O);k!=null&&(d.push(P),p.set(P,k))}}const y=new be(d);return new Ph(p,y,a.fieldTransforms)}function Xy(n,e,t,r=!1){return mr(t,n.Cc(r?4:3,e))}function mr(n,e){if(kh(n=fe(n)))return No("Unsupported field value:",e,n),bh(n,e);if(n instanceof xs)return function(r,s){if(!Ch(s.Ac))throw s.Sc(`${r._methodName}() can only be used with update() and set()`);if(!s.path)throw s.Sc(`${r._methodName}() is not currently supported inside arrays`);const o=r._toFieldTransform(s);o&&s.fieldTransforms.push(o)}(n,e),null;if(n===void 0&&e.ignoreUndefinedProperties)return null;if(e.path&&e.fieldMask.push(e.path),n instanceof Array){if(e.settings.fc&&e.Ac!==4)throw e.Sc("Nested arrays are not supported");return function(r,s){const o=[];let a=0;for(const u of r){let h=mr(u,s.wc(a));h==null&&(h={nullValue:"NULL_VALUE"}),o.push(h),a++}return{arrayValue:{values:o}}}(n,e)}return function(r,s){if((r=fe(r))===null)return{nullValue:"NULL_VALUE"};if(typeof r=="number")return Lg(s.serializer,r);if(typeof r=="boolean")return{booleanValue:r};if(typeof r=="string")return{stringValue:r};if(r instanceof Date){const o=Z.fromDate(r);return{timestampValue:ds(s.serializer,o)}}if(r instanceof Z){const o=new Z(r.seconds,1e3*Math.floor(r.nanoseconds/1e3));return{timestampValue:ds(s.serializer,o)}}if(r instanceof $e)return{geoPointValue:{latitude:r.latitude,longitude:r.longitude}};if(r instanceof ke)return{bytesValue:Gl(s.serializer,r._byteString)};if(r instanceof re){const o=s.databaseId,a=r.firestore._databaseId;if(!a.isEqual(o))throw s.Sc(`Document reference is for database ${a.projectId}/${a.database} but should be for database ${o.projectId}/${o.database}`);return{referenceValue:po(r.firestore._databaseId||s.databaseId,r._key.path)}}if(r instanceof ze)return function(a,u){return{mapValue:{fields:{[Il]:{stringValue:vl},[cs]:{arrayValue:{values:a.toArray().map(d=>{if(typeof d!="number")throw u.Sc("VectorValues must only contain numeric values.");return uo(u.serializer,d)})}}}}}}(r,s);throw s.Sc(`Unsupported field value: ${ws(r)}`)}(n,e)}function bh(n,e){const t={};return ml(n)?e.path&&e.path.length>0&&e.fieldMask.push(e.path):Pt(n,(r,s)=>{const o=mr(s,e.mc(r));o!=null&&(t[r]=o)}),{mapValue:{fields:t}}}function kh(n){return!(typeof n!="object"||n===null||n instanceof Array||n instanceof Date||n instanceof Z||n instanceof $e||n instanceof ke||n instanceof re||n instanceof xs||n instanceof ze)}function No(n,e,t){if(!kh(t)||!fl(t)){const r=ws(t);throw r==="an object"?e.Sc(n+" a custom object"):e.Sc(n+" "+r)}}function qi(n,e,t){if((e=fe(e))instanceof Ls)return e._internalPath;if(typeof e=="string")return Do(n,e);throw gs("Field path arguments must be of type string or ",n,!1,void 0,t)}const Yy=new RegExp("[~\\*/\\[\\]]");function Do(n,e,t){if(e.search(Yy)>=0)throw gs(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`,n,!1,void 0,t);try{return new Ls(...e.split("."))._internalPath}catch{throw gs(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,n,!1,void 0,t)}}function gs(n,e,t,r,s){const o=r&&!r.isEmpty(),a=s!==void 0;let u=`Function ${e}() called with invalid data`;t&&(u+=" (via `toFirestore()`)"),u+=". ";let h="";return(o||a)&&(h+=" (found",o&&(h+=` in field ${r}`),a&&(h+=` in document ${s}`),h+=")"),new N(S.INVALID_ARGUMENT,u+n+h)}function Vh(n,e){return n.some(t=>t.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 Nh{constructor(e,t,r,s,o){this._firestore=e,this._userDataWriter=t,this._key=r,this._document=s,this._converter=o}get id(){return this._key.path.lastSegment()}get ref(){return new re(this._firestore,this._converter,this._key)}exists(){return this._document!==null}data(){if(this._document){if(this._converter){const e=new Jy(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(e)}return this._userDataWriter.convertValue(this._document.data.value)}}get(e){if(this._document){const t=this._document.data.field(Oo("DocumentSnapshot.get",e));if(t!==null)return this._userDataWriter.convertValue(t)}}}class Jy extends Nh{data(){return super.data()}}function Oo(n,e){return typeof e=="string"?Do(n,e):e instanceof Ls?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 Zy(n){if(n.limitType==="L"&&n.explicitOrderBy.length===0)throw new N(S.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}class Mo{}class Lo extends Mo{}function FE(n,e,...t){let r=[];e instanceof Mo&&r.push(e),r=r.concat(t),function(o){const a=o.filter(h=>h instanceof Uo).length,u=o.filter(h=>h instanceof xo).length;if(a>1||a>0&&u>0)throw new N(S.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 s of r)n=s._apply(n);return n}class xo extends Lo{constructor(e,t,r){super(),this._field=e,this._op=t,this._value=r,this.type="where"}static _create(e,t,r){return new xo(e,t,r)}_apply(e){const t=this._parse(e);return Dh(e._query,t),new bt(e.firestore,e.converter,Vi(e._query,t))}_parse(e){const t=ko(e.firestore);return function(o,a,u,h,d,p,y){let E;if(d.isKeyField()){if(p==="array-contains"||p==="array-contains-any")throw new N(S.INVALID_ARGUMENT,`Invalid Query. You can't perform '${p}' queries on documentId().`);if(p==="in"||p==="not-in"){hu(y,p);const b=[];for(const O of y)b.push(lu(h,o,O));E={arrayValue:{values:b}}}else E=lu(h,o,y)}else p!=="in"&&p!=="not-in"&&p!=="array-contains-any"||hu(y,p),E=Xy(u,a,y,p==="in"||p==="not-in");return oe.create(d,p,E)}(e._query,"where",t,e.firestore._databaseId,this._field,this._op,this._value)}}class Uo extends Mo{constructor(e,t){super(),this.type=e,this._queryConstraints=t}static _create(e,t){return new Uo(e,t)}_parse(e){const t=this._queryConstraints.map(r=>r._parse(e)).filter(r=>r.getFilters().length>0);return t.length===1?t[0]:Le.create(t,this._getOperator())}_apply(e){const t=this._parse(e);return t.getFilters().length===0?e:(function(s,o){let a=s;const u=o.getFlattenedFilters();for(const h of u)Dh(a,h),a=Vi(a,h)}(e._query,t),new bt(e.firestore,e.converter,Vi(e._query,t)))}_getQueryConstraints(){return this._queryConstraints}_getOperator(){return this.type==="and"?"and":"or"}}class Fo extends Lo{constructor(e,t){super(),this._field=e,this._direction=t,this.type="orderBy"}static _create(e,t){return new Fo(e,t)}_apply(e){const t=function(s,o,a){if(s.startAt!==null)throw new N(S.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(s.endAt!==null)throw new N(S.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");return new tr(o,a)}(e._query,this._field,this._direction);return new bt(e.firestore,e.converter,function(s,o){const a=s.explicitOrderBy.concat([o]);return new En(s.path,s.collectionGroup,a,s.filters.slice(),s.limit,s.limitType,s.startAt,s.endAt)}(e._query,t))}}function BE(n,e="asc"){const t=e,r=Oo("orderBy",n);return Fo._create(r,t)}class Bo extends Lo{constructor(e,t,r){super(),this.type=e,this._limit=t,this._limitType=r}static _create(e,t,r){return new Bo(e,t,r)}_apply(e){return new bt(e.firestore,e.converter,ls(e._query,this._limit,this._limitType))}}function qE(n){return ng("limit",n),Bo._create("limit",n,"F")}function lu(n,e,t){if(typeof(t=fe(t))=="string"){if(t==="")throw new N(S.INVALID_ARGUMENT,"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");if(!kl(e)&&t.indexOf("/")!==-1)throw new N(S.INVALID_ARGUMENT,`Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${t}' contains a '/' character.`);const r=e.path.child(Y.fromString(t));if(!M.isDocumentKey(r))throw new N(S.INVALID_ARGUMENT,`Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${r}' is not because it has an odd number of segments (${r.length}).`);return Pc(n,new M(r))}if(t instanceof re)return Pc(n,t._key);throw new N(S.INVALID_ARGUMENT,`Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${ws(t)}.`)}function hu(n,e){if(!Array.isArray(n)||n.length===0)throw new N(S.INVALID_ARGUMENT,`Invalid Query. A non-empty array is required for '${e.toString()}' filters.`)}function Dh(n,e){const t=function(s,o){for(const a of s)for(const u of a.getFlattenedFilters())if(o.indexOf(u.op)>=0)return u.op;return null}(n.filters,function(s){switch(s){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(t!==null)throw t===e.op?new N(S.INVALID_ARGUMENT,`Invalid query. You cannot use more than one '${e.op.toString()}' filter.`):new N(S.INVALID_ARGUMENT,`Invalid query. You cannot use '${e.op.toString()}' filters with '${t.toString()}' filters.`)}class eE{convertValue(e,t="none"){switch(At(e)){case 0:return null;case 1:return e.booleanValue;case 2:return ne(e.integerValue||e.doubleValue);case 3:return this.convertTimestamp(e.timestampValue);case 4:return this.convertServerTimestamp(e,t);case 5:return e.stringValue;case 6:return this.convertBytes(wt(e.bytesValue));case 7:return this.convertReference(e.referenceValue);case 8:return this.convertGeoPoint(e.geoPointValue);case 9:return this.convertArray(e.arrayValue,t);case 11:return this.convertObject(e.mapValue,t);case 10:return this.convertVectorValue(e.mapValue);default:throw L(62114,{value:e})}}convertObject(e,t){return this.convertObjectMap(e.fields,t)}convertObjectMap(e,t="none"){const r={};return Pt(e,(s,o)=>{r[s]=this.convertValue(o,t)}),r}convertVectorValue(e){const t=e.fields?.[cs].arrayValue?.values?.map(r=>ne(r.doubleValue));return new ze(t)}convertGeoPoint(e){return new $e(ne(e.latitude),ne(e.longitude))}convertArray(e,t){return(e.values||[]).map(r=>this.convertValue(r,t))}convertServerTimestamp(e,t){switch(t){case"previous":const r=Ss(e);return r==null?null:this.convertValue(r,t);case"estimate":return this.convertTimestamp(Jn(e));default:return null}}convertTimestamp(e){const t=vt(e);return new Z(t.seconds,t.nanos)}convertDocumentKey(e,t){const r=Y.fromString(e);K(Jl(r),9688,{name:e});const s=new Zn(r.get(1),r.get(3)),o=new M(r.popFirst(5));return s.isEqual(t)||it(`Document ${o} contains a document reference within a different database (${s.projectId}/${s.database}) which is not supported. It will be treated as a reference in the current database (${t.projectId}/${t.database}) instead.`),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 tE(n,e,t){let r;return r=n?t&&(t.merge||t.mergeFields)?n.toFirestore(e,t):n.toFirestore(e):e,r}class jn{constructor(e,t){this.hasPendingWrites=e,this.fromCache=t}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}}class xt extends Nh{constructor(e,t,r,s,o,a){super(e,t,r,s,a),this._firestore=e,this._firestoreImpl=e,this.metadata=o}exists(){return super.exists()}data(e={}){if(this._document){if(this._converter){const t=new Yr(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(t,e)}return this._userDataWriter.convertValue(this._document.data.value,e.serverTimestamps)}}get(e,t={}){if(this._document){const r=this._document.data.field(Oo("DocumentSnapshot.get",e));if(r!==null)return this._userDataWriter.convertValue(r,t.serverTimestamps)}}toJSON(){if(this.metadata.hasPendingWrites)throw new N(S.FAILED_PRECONDITION,"DocumentSnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");const e=this._document,t={};return t.type=xt._jsonSchemaVersion,t.bundle="",t.bundleSource="DocumentSnapshot",t.bundleName=this._key.toString(),!e||!e.isValidDocument()||!e.isFoundDocument()?t:(this._userDataWriter.convertObjectMap(e.data.value.mapValue.fields,"previous"),t.bundle=(this._firestore,this.ref.path,"NOT SUPPORTED"),t)}}xt._jsonSchemaVersion="firestore/documentSnapshot/1.0",xt._jsonSchema={type:ae("string",xt._jsonSchemaVersion),bundleSource:ae("string","DocumentSnapshot"),bundleName:ae("string"),bundle:ae("string")};class Yr extends xt{data(e={}){return super.data(e)}}class an{constructor(e,t,r,s){this._firestore=e,this._userDataWriter=t,this._snapshot=s,this.metadata=new jn(s.hasPendingWrites,s.fromCache),this.query=r}get docs(){const e=[];return this.forEach(t=>e.push(t)),e}get size(){return this._snapshot.docs.size}get empty(){return this.size===0}forEach(e,t){this._snapshot.docs.forEach(r=>{e.call(t,new Yr(this._firestore,this._userDataWriter,r.key,r,new jn(this._snapshot.mutatedKeys.has(r.key),this._snapshot.fromCache),this.query.converter))})}docChanges(e={}){const t=!!e.includeMetadataChanges;if(t&&this._snapshot.excludesMetadataChanges)throw new N(S.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===t||(this._cachedChanges=function(s,o){if(s._snapshot.oldDocs.isEmpty()){let a=0;return s._snapshot.docChanges.map(u=>{const h=new Yr(s._firestore,s._userDataWriter,u.doc.key,u.doc,new jn(s._snapshot.mutatedKeys.has(u.doc.key),s._snapshot.fromCache),s.query.converter);return u.doc,{type:"added",doc:h,oldIndex:-1,newIndex:a++}})}{let a=s._snapshot.oldDocs;return s._snapshot.docChanges.filter(u=>o||u.type!==3).map(u=>{const h=new Yr(s._firestore,s._userDataWriter,u.doc.key,u.doc,new jn(s._snapshot.mutatedKeys.has(u.doc.key),s._snapshot.fromCache),s.query.converter);let d=-1,p=-1;return u.type!==0&&(d=a.indexOf(u.doc.key),a=a.delete(u.doc.key)),u.type!==1&&(a=a.add(u.doc),p=a.indexOf(u.doc.key)),{type:nE(u.type),doc:h,oldIndex:d,newIndex:p}})}}(this,t),this._cachedChangesIncludeMetadataChanges=t),this._cachedChanges}toJSON(){if(this.metadata.hasPendingWrites)throw new N(S.FAILED_PRECONDITION,"QuerySnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");const e={};e.type=an._jsonSchemaVersion,e.bundleSource="QuerySnapshot",e.bundleName=no.newId(),this._firestore._databaseId.database,this._firestore._databaseId.projectId;const t=[],r=[],s=[];return this.docs.forEach(o=>{o._document!==null&&(t.push(o._document),r.push(this._userDataWriter.convertObjectMap(o._document.data.value.mapValue.fields,"previous")),s.push(o.ref.path))}),e.bundle=(this._firestore,this.query._query,e.bundleName,"NOT SUPPORTED"),e}}function nE(n){switch(n){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return L(61501,{type: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. + */function jE(n){n=He(n,re);const e=He(n.firestore,In);return By(Co(e),n._key).then(t=>rE(e,n,t))}an._jsonSchemaVersion="firestore/querySnapshot/1.0",an._jsonSchema={type:ae("string",an._jsonSchemaVersion),bundleSource:ae("string","QuerySnapshot"),bundleName:ae("string"),bundle:ae("string")};class Oh extends eE{constructor(e){super(),this.firestore=e}convertBytes(e){return new ke(e)}convertReference(e){const t=this.convertDocumentKey(e,this.firestore._databaseId);return new re(this.firestore,null,t)}}function $E(n){n=He(n,bt);const e=He(n.firestore,In),t=Co(e),r=new Oh(e);return Zy(n._query),qy(t,n._query).then(s=>new an(e,r,n,s))}function zE(n,e,t){n=He(n,re);const r=He(n.firestore,In),s=tE(n.converter,e,t);return qo(r,[Wy(ko(r),"setDoc",n._key,s,n.converter!==null,t).toMutation(n._key,Me.none())])}function HE(n,e,t,...r){n=He(n,re);const s=He(n.firestore,In),o=ko(s);let a;return a=typeof(e=fe(e))=="string"||e instanceof Ls?Qy(o,"updateDoc",n._key,e,t,r):Ky(o,"updateDoc",n._key,e),qo(s,[a.toMutation(n._key,Me.exists(!0))])}function GE(n){return qo(He(n.firestore,In),[new lo(n._key,Me.none())])}function qo(n,e){return function(r,s){const o=new tt;return r.asyncQueue.enqueueAndForget(async()=>Cy(await Fy(r),s,o)),o.promise}(Co(n),e)}function rE(n,e,t){const r=t.docs.get(e._key),s=new Oh(n);return new xt(n,s,e._key,r,new jn(t.hasPendingWrites,t.fromCache),e.converter)}function WE(){return new Vo("serverTimestamp")}(function(e,t=!0){(function(s){gn=s})(zt),Ft(new Tt("firestore",(r,{instanceIdentifier:s,options:o})=>{const a=r.getProvider("app").getImmediate(),u=new In(new Wm(r.getProvider("auth-internal")),new Xm(a,r.getProvider("app-check-internal")),function(d,p){if(!Object.prototype.hasOwnProperty.apply(d.options,["projectId"]))throw new N(S.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new Zn(d.options.projectId,p)}(a,s),a);return o={useFetchStreams:t,...o},u._setSettings(o),u},"PUBLIC").setMultipleInstances(!0)),Ue(pc,mc,e),Ue(pc,mc,"esm2020")})();/** + * @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 Mh="firebasestorage.googleapis.com",sE="storageBucket",iE=120*1e3,oE=600*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 Qe extends Ke{constructor(e,t,r=0){super(yi(e),`Firebase Storage: ${t} (${yi(e)})`),this.status_=r,this.customData={serverResponse:null},this._baseMessage=this.message,Object.setPrototypeOf(this,Qe.prototype)}get status(){return this.status_}set status(e){this.status_=e}_codeEquals(e){return yi(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 We;(function(n){n.UNKNOWN="unknown",n.OBJECT_NOT_FOUND="object-not-found",n.BUCKET_NOT_FOUND="bucket-not-found",n.PROJECT_NOT_FOUND="project-not-found",n.QUOTA_EXCEEDED="quota-exceeded",n.UNAUTHENTICATED="unauthenticated",n.UNAUTHORIZED="unauthorized",n.UNAUTHORIZED_APP="unauthorized-app",n.RETRY_LIMIT_EXCEEDED="retry-limit-exceeded",n.INVALID_CHECKSUM="invalid-checksum",n.CANCELED="canceled",n.INVALID_EVENT_NAME="invalid-event-name",n.INVALID_URL="invalid-url",n.INVALID_DEFAULT_BUCKET="invalid-default-bucket",n.NO_DEFAULT_BUCKET="no-default-bucket",n.CANNOT_SLICE_BLOB="cannot-slice-blob",n.SERVER_FILE_WRONG_SIZE="server-file-wrong-size",n.NO_DOWNLOAD_URL="no-download-url",n.INVALID_ARGUMENT="invalid-argument",n.INVALID_ARGUMENT_COUNT="invalid-argument-count",n.APP_DELETED="app-deleted",n.INVALID_ROOT_OPERATION="invalid-root-operation",n.INVALID_FORMAT="invalid-format",n.INTERNAL_ERROR="internal-error",n.UNSUPPORTED_ENVIRONMENT="unsupported-environment"})(We||(We={}));function yi(n){return"storage/"+n}function aE(){const n="An unknown error occurred, please check the error payload for server response.";return new Qe(We.UNKNOWN,n)}function cE(){return new Qe(We.RETRY_LIMIT_EXCEEDED,"Max retry time for operation exceeded, please try again.")}function uE(){return new Qe(We.CANCELED,"User canceled the upload/download.")}function lE(n){return new Qe(We.INVALID_URL,"Invalid URL '"+n+"'.")}function hE(n){return new Qe(We.INVALID_DEFAULT_BUCKET,"Invalid default bucket '"+n+"'.")}function du(n){return new Qe(We.INVALID_ARGUMENT,n)}function Lh(){return new Qe(We.APP_DELETED,"The Firebase app was deleted.")}function dE(n){return new Qe(We.INVALID_ROOT_OPERATION,"The operation '"+n+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}/** + * @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 Oe{constructor(e,t){this.bucket=e,this.path_=t}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,t){let r;try{r=Oe.makeFromUrl(e,t)}catch{return new Oe(e,"")}if(r.path==="")return r;throw hE(e)}static makeFromUrl(e,t){let r=null;const s="([A-Za-z0-9.\\-_]+)";function o(Q){Q.path.charAt(Q.path.length-1)==="/"&&(Q.path_=Q.path_.slice(0,-1))}const a="(/(.*))?$",u=new RegExp("^gs://"+s+a,"i"),h={bucket:1,path:3};function d(Q){Q.path_=decodeURIComponent(Q.path)}const p="v[A-Za-z0-9_]+",y=t.replace(/[.]/g,"\\."),E="(/([^?#]*).*)?$",P=new RegExp(`^https?://${y}/${p}/b/${s}/o${E}`,"i"),b={bucket:1,path:3},O=t===Mh?"(?:storage.googleapis.com|storage.cloud.google.com)":t,k="([^?#]*)",q=new RegExp(`^https?://${O}/${s}/${k}`,"i"),B=[{regex:u,indices:h,postModify:o},{regex:P,indices:b,postModify:d},{regex:q,indices:{bucket:1,path:2},postModify:d}];for(let Q=0;Q{s=null,n(P,h())},k)}function E(){o&&clearTimeout(o)}function P(k,...q){if(d){E();return}if(k){E(),p.call(null,k,...q);return}if(h()||a){E(),p.call(null,k,...q);return}r<64&&(r*=2);let B;u===1?(u=2,B=0):B=(r+Math.random())*1e3,y(B)}let b=!1;function O(k){b||(b=!0,E(),!d&&(s!==null?(k||(u=2),clearTimeout(s),y(0)):k||(u=1)))}return y(0),o=setTimeout(()=>{a=!0,O(!0)},t),O}function mE(n){n(!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 gE(n){return n!==void 0}function fu(n,e,t,r){if(rt)throw du(`Invalid value for '${n}'. Expected ${t} or less.`)}function _E(n){const e=encodeURIComponent;let t="?";for(const r in n)if(n.hasOwnProperty(r)){const s=e(r)+"="+e(n[r]);t=t+s+"&"}return t=t.slice(0,-1),t}var _s;(function(n){n[n.NO_ERROR=0]="NO_ERROR",n[n.NETWORK_ERROR=1]="NETWORK_ERROR",n[n.ABORT=2]="ABORT"})(_s||(_s={}));/** + * @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 yE(n,e){const t=n>=500&&n<600,s=[408,429].indexOf(n)!==-1,o=e.indexOf(n)!==-1;return t||s||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. + */class EE{constructor(e,t,r,s,o,a,u,h,d,p,y,E=!0,P=!1){this.url_=e,this.method_=t,this.headers_=r,this.body_=s,this.successCodes_=o,this.additionalRetryCodes_=a,this.callback_=u,this.errorCallback_=h,this.timeout_=d,this.progressCallback_=p,this.connectionFactory_=y,this.retry=E,this.isUsingEmulator=P,this.pendingConnection_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.promise_=new Promise((b,O)=>{this.resolve_=b,this.reject_=O,this.start_()})}start_(){const e=(r,s)=>{if(s){r(!1,new qr(!1,null,!0));return}const o=this.connectionFactory_();this.pendingConnection_=o;const a=u=>{const h=u.loaded,d=u.lengthComputable?u.total:-1;this.progressCallback_!==null&&this.progressCallback_(h,d)};this.progressCallback_!==null&&o.addUploadProgressListener(a),o.send(this.url_,this.method_,this.isUsingEmulator,this.body_,this.headers_).then(()=>{this.progressCallback_!==null&&o.removeUploadProgressListener(a),this.pendingConnection_=null;const u=o.getErrorCode()===_s.NO_ERROR,h=o.getStatus();if(!u||yE(h,this.additionalRetryCodes_)&&this.retry){const p=o.getErrorCode()===_s.ABORT;r(!1,new qr(!1,null,p));return}const d=this.successCodes_.indexOf(h)!==-1;r(!0,new qr(d,o))})},t=(r,s)=>{const o=this.resolve_,a=this.reject_,u=s.connection;if(s.wasSuccessCode)try{const h=this.callback_(u,u.getResponse());gE(h)?o(h):o()}catch(h){a(h)}else if(u!==null){const h=aE();h.serverResponse=u.getErrorText(),this.errorCallback_?a(this.errorCallback_(u,h)):a(h)}else if(s.canceled){const h=this.appDelete_?Lh():uE();a(h)}else{const h=cE();a(h)}};this.canceled_?t(!1,new qr(!1,null,!0)):this.backoffId_=pE(e,t,this.timeout_)}getPromise(){return this.promise_}cancel(e){this.canceled_=!0,this.appDelete_=e||!1,this.backoffId_!==null&&mE(this.backoffId_),this.pendingConnection_!==null&&this.pendingConnection_.abort()}}class qr{constructor(e,t,r){this.wasSuccessCode=e,this.connection=t,this.canceled=!!r}}function TE(n,e){e!==null&&e.length>0&&(n.Authorization="Firebase "+e)}function IE(n,e){n["X-Firebase-Storage-Version"]="webjs/"+(e??"AppManager")}function vE(n,e){e&&(n["X-Firebase-GMPID"]=e)}function wE(n,e){e!==null&&(n["X-Firebase-AppCheck"]=e)}function AE(n,e,t,r,s,o,a=!0,u=!1){const h=_E(n.urlParams),d=n.url+h,p=Object.assign({},n.headers);return vE(p,e),TE(p,t),IE(p,o),wE(p,r),new EE(d,n.method,p,n.body,n.successCodes,n.additionalRetryCodes,n.handler,n.errorHandler,n.timeout,n.progressCallback,s,a,u)}/** + * @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 RE(n){if(n.length===0)return null;const e=n.lastIndexOf("/");return e===-1?"":n.slice(0,e)}function SE(n){const e=n.lastIndexOf("/",n.length-2);return e===-1?n:n.slice(e+1)}/** + * @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 ys{constructor(e,t){this._service=e,t instanceof Oe?this._location=t:this._location=Oe.makeFromUrl(t,e.host)}toString(){return"gs://"+this._location.bucket+"/"+this._location.path}_newRef(e,t){return new ys(e,t)}get root(){const e=new Oe(this._location.bucket,"");return this._newRef(this._service,e)}get bucket(){return this._location.bucket}get fullPath(){return this._location.path}get name(){return SE(this._location.path)}get storage(){return this._service}get parent(){const e=RE(this._location.path);if(e===null)return null;const t=new Oe(this._location.bucket,e);return new ys(this._service,t)}_throwIfRoot(e){if(this._location.path==="")throw dE(e)}}function pu(n,e){const t=e?.[sE];return t==null?null:Oe.makeFromBucketSpec(t,n)}function PE(n,e,t,r={}){n.host=`${e}:${t}`;const s=$t(e);s&&(ji(`https://${n.host}/b`),$i("Storage",!0)),n._isUsingEmulator=!0,n._protocol=s?"https":"http";const{mockUserToken:o}=r;o&&(n._overrideAuthToken=typeof o=="string"?o:Au(o,n.app.options.projectId))}class CE{constructor(e,t,r,s,o,a=!1){this.app=e,this._authProvider=t,this._appCheckProvider=r,this._url=s,this._firebaseVersion=o,this._isUsingEmulator=a,this._bucket=null,this._host=Mh,this._protocol="https",this._appId=null,this._deleted=!1,this._maxOperationRetryTime=iE,this._maxUploadRetryTime=oE,this._requests=new Set,s!=null?this._bucket=Oe.makeFromBucketSpec(s,this._host):this._bucket=pu(this._host,this.app.options)}get host(){return this._host}set host(e){this._host=e,this._url!=null?this._bucket=Oe.makeFromBucketSpec(this._url,e):this._bucket=pu(e,this.app.options)}get maxUploadRetryTime(){return this._maxUploadRetryTime}set maxUploadRetryTime(e){fu("time",0,Number.POSITIVE_INFINITY,e),this._maxUploadRetryTime=e}get maxOperationRetryTime(){return this._maxOperationRetryTime}set maxOperationRetryTime(e){fu("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 t=await e.getToken();if(t!==null)return t.accessToken}return null}async _getAppCheckToken(){if(Ne(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;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 ys(this,e)}_makeRequest(e,t,r,s,o=!0){if(this._deleted)return new fE(Lh());{const a=AE(e,this._appId,r,s,t,this._firebaseVersion,o,this._isUsingEmulator);return this._requests.add(a),a.getPromise().then(()=>this._requests.delete(a),()=>this._requests.delete(a)),a}}async makeRequestWithTokens(e,t){const[r,s]=await Promise.all([this._getAuthToken(),this._getAppCheckToken()]);return this._makeRequest(e,t,r,s).getPromise()}}const mu="@firebase/storage",gu="0.14.0";/** + * @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 xh="storage";function KE(n=Hi(),e){n=fe(n);const r=Ts(n,xh).getImmediate({identifier:e}),s=Iu("storage");return s&&bE(r,...s),r}function bE(n,e,t,r={}){PE(n,e,t,r)}function kE(n,{instanceIdentifier:e}){const t=n.getProvider("app").getImmediate(),r=n.getProvider("auth-internal"),s=n.getProvider("app-check-internal");return new CE(t,r,s,e,zt)}function VE(){Ft(new Tt(xh,kE,"PUBLIC").setMultipleInstances(!0)),Ue(mu,gu,""),Ue(mu,gu,"esm2020")}VE();export{UE as a,KE as b,jE as c,xE as d,zE as e,LE as f,OE as g,BE as h,Mf as i,$E as j,GE as k,qE as l,DE as o,FE as q,WE as s,HE as u}; diff --git a/assets/index-CQhYMIc5.js b/assets/index-CQhYMIc5.js new file mode 100644 index 0000000000000000000000000000000000000000..6c1a630995b8a5207586e9d11af1026a700684ec --- /dev/null +++ b/assets/index-CQhYMIc5.js @@ -0,0 +1,81 @@ +import{r as c,R as L,j as e,S as He,M as Ve,a as J,W as Ae,Z as Ye,F as qe,I as We,b as Ke,c as Je,L as Xe,Y as Ze,d as Qe,H as he,C as et,e as tt,f as st,g as rt,h as at,D as _e,i as Ne,T as Ce,k as it,E as nt,X as ot,l as lt,m as dt,n as ct,o as mt}from"./vendor-CjHduoA4.js";import{i as ut,g as pt,a as ht,b as ft,o as gt,d as T,c as S,s as b,e as z,u as R,f as xt,q as bt,h as wt,l as yt,j as vt,k as jt}from"./firebase-CWl4LEc7.js";import{Z as Te,_ as Re}from"./vendor-other-B0VykD61.js";import{m as f,A as U}from"./ui-BjUdCpih.js";(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))a(i);new MutationObserver(i=>{for(const n of i)if(n.type==="childList")for(const o of n.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&a(o)}).observe(document,{childList:!0,subtree:!0});function t(i){const n={};return i.integrity&&(n.integrity=i.integrity),i.referrerPolicy&&(n.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?n.credentials="include":i.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function a(i){if(i.ep)return;i.ep=!0;const n=t(i);fetch(i.href,n)}})();const Se="visiora-theme",kt=()=>{const[s,r]=c.useState(()=>{if(typeof window>"u")return!0;const n=localStorage.getItem(Se);return n?JSON.parse(n):window.matchMedia("(prefers-color-scheme: dark)").matches}),t=c.useCallback(n=>{const o=document.documentElement;o.style.setProperty("transition","none","important"),n?(o.classList.add("dark"),o.setAttribute("data-theme","dark")):(o.classList.remove("dark"),o.setAttribute("data-theme","light")),o.offsetHeight,requestAnimationFrame(()=>{requestAnimationFrame(()=>{o.style.removeProperty("transition")})}),localStorage.setItem(Se,JSON.stringify(n))},[]);c.useEffect(()=>{t(s)},[]);const a=c.useCallback(()=>{r(n=>{const o=!n;return t(o),o})},[t]),i=c.useCallback(n=>{r(n),t(n)},[t]);return{isDarkMode:s,toggleTheme:a,setTheme:i}},Nt=(s,r)=>{const[t,a]=c.useState(()=>{try{const o=window.localStorage.getItem(s);return o?JSON.parse(o):r}catch(o){return console.error(`Error reading localStorage key "${s}":`,o),r}}),i=c.useCallback(o=>{try{const h=o instanceof Function?o(t):o;a(h),h!==void 0?window.localStorage.setItem(s,JSON.stringify(h)):window.localStorage.removeItem(s)}catch(h){console.error(`Error setting localStorage key "${s}":`,h)}},[s,t]),n=c.useCallback(()=>{try{window.localStorage.removeItem(s),a(r)}catch(o){console.error(`Error removing localStorage key "${s}":`,o)}},[s,r]);return[t,i,n]},Ct={BASE_URL:"./",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_FIREBASE_API_KEY:"AIzaSyDIh6HYT44xvzhr4WJhH8FzprBrNgL7Szs",VITE_FIREBASE_APP_ID:"1:407125000154:web:375e7e11837a41a87e0ae3",VITE_FIREBASE_AUTH_DOMAIN:"my-img-pro.firebaseapp.com",VITE_FIREBASE_MESSAGING_SENDER_ID:"407125000154",VITE_FIREBASE_PROJECT_ID:"my-img-pro",VITE_FIREBASE_STORAGE_BUCKET:"my-img-pro.firebasestorage.app"},St={apiKey:"AIzaSyDIh6HYT44xvzhr4WJhH8FzprBrNgL7Szs",authDomain:"my-img-pro.firebaseapp.com",projectId:"my-img-pro",storageBucket:"my-img-pro.firebasestorage.app",messagingSenderId:"407125000154",appId:"1:407125000154:web:375e7e11837a41a87e0ae3",measurementId:void 0},It=["VITE_FIREBASE_API_KEY","VITE_FIREBASE_AUTH_DOMAIN","VITE_FIREBASE_PROJECT_ID","VITE_FIREBASE_STORAGE_BUCKET","VITE_FIREBASE_MESSAGING_SENDER_ID","VITE_FIREBASE_APP_ID"],ce=It.filter(s=>!Ct[s]);if(ce.length>0)throw console.error("Missing required environment variables:",ce),new Error(`Missing Firebase configuration: ${ce.join(", ")}`);const fe=ut(St),V=pt(fe),I=ht(fe);ft(fe);V.settings={appVerificationDisabledForTesting:!1};V.onAuthStateChanged(s=>{s&&console.log("User authenticated successfully")},s=>{console.error("Auth state change error:",s)});function Et(){const[s,r]=c.useState(null),[t,a]=c.useState(!0),[i,n]=c.useState(null);return c.useEffect(()=>gt(V,h=>{r(u=>!u||!h||u.uid!==h.uid?h:u),a(!1)}),[]),{user:s,loading:t,error:i}}const ee=0,me=0,De=async(s,r={})=>{if(s)try{const t=T(I,"users",s.uid),a=await S(t);if(a.exists()){const i=a.data(),n={lastLogin:b()};return i.credits===void 0?(n.credits={free:ee,paid:me},n.lastCreditRefresh=b()):typeof i.credits=="number"&&(n.credits={free:ee,paid:i.credits},n.lastCreditRefresh=b()),await R(t,n),{id:s.uid,...i,...n}}else{const{email:i,displayName:n,photoURL:o}=s,h=n||r.displayName||(i?i.split("@")[0]:"User"),u={email:i||"anonymous@user.com",name:h,photoURL:o||null,createdAt:b(),lastLogin:b(),lastCreditRefresh:b(),credits:{free:ee,paid:me},preferences:{defaultModel:"flux",defaultShape:"landscape",notifications:!0},...r};try{await z(T(I,"users",s.uid),u)}catch(d){console.error("Initial write attempt failed:",d),console.error("Error details:",d.code,d.message),await new Promise(g=>setTimeout(g,800)),await z(T(I,"users",s.uid),u)}let m;try{await new Promise(d=>setTimeout(d,500)),m=await S(t)}catch(d){console.error("Error verifying user creation:",d),await new Promise(g=>setTimeout(g,1e3)),m=await S(t)}return m&&m.exists()||(console.error("Failed to verify user creation - unexpected database behavior"),await z(t,u,{merge:!0})),{id:s.uid,...u}}}catch(t){console.error("Error creating/updating user profile",t),console.error("Error details:",t.code,t.message);try{await new Promise(o=>setTimeout(o,1e3));const a=T(I,"users",s.uid),i={email:s.email||"anonymous@user.com",name:s.displayName||"User",createdAt:b(),lastLogin:b(),credits:{free:ee,paid:me},lastCreditRefresh:b()};if(await z(a,i,{merge:!0}),(await S(a)).exists())return At(s.uid);throw new Error("Failed to verify document creation after retry")}catch(a){throw console.error("Retry also failed:",a),console.error("Retry error details:",a.code,a.message),t}}},At=async s=>{if(!s)return null;try{const r=T(I,"users",s),t=await S(r);if(t.exists()){const a=t.data();if(typeof a.credits=="number"){const i={credits:{free:ee,paid:a.credits},lastCreditRefresh:b()};return await R(r,i),{id:s,...a,credits:i.credits}}return{id:s,...a}}else{const a=V.currentUser;if(a&&a.uid===s)return De(a)}return null}catch(r){throw console.error("Error getting user profile",r),r}},X=5,te=0,se=0,G=5,re=()=>{const s=localStorage.getItem("miragic_anonymous_credits");if(s===null)return localStorage.setItem("miragic_anonymous_credits",X.toString()),X;const r=parseInt(s,5);return isNaN(r)?X:r},_t=()=>{try{let s=localStorage.getItem("miragic_anonymous_credits");(s===null||isNaN(parseInt(s,5)))&&(localStorage.setItem("miragic_anonymous_credits",X.toString()),s=X.toString());const r=parseInt(s,5);if(console.log("Anonymous credits before decrease (direct):",r),r<=0)return localStorage.setItem("miragic_anonymous_credits","0"),0;const t=r-1;return localStorage.setItem("miragic_anonymous_credits",t.toString()),parseInt(localStorage.getItem("miragic_anonymous_credits"),5)}catch(s){return console.error("Error decreasing anonymous credits:",s),0}},Ie=async s=>{if(!s){const r=re();return{freeCredits:r,paidCredits:0,total:r}}try{const r=T(I,"users",s),t=await S(r);if(console.log("User document exists:",t.exists()),!t.exists()||t.data().credits===void 0){const d={credits:{free:te,paid:se},lastCreditRefresh:b(),lastLogin:b()};return t.exists()||(d.email=V.currentUser?.email||"unknown@user.com",d.name=V.currentUser?.displayName||"User",d.createdAt=b()),await z(r,d,{merge:!0}),{freeCredits:te,paidCredits:se,total:te+se}}const a=t.data();if(typeof a.credits=="number"){const d=a.credits||0,g={free:G,paid:d};return await R(r,{credits:g,lastCreditRefresh:b()}),{freeCredits:g.free,paidCredits:g.paid,total:g.free+g.paid}}const i=a.credits||{free:0,paid:0},n=a.lastCreditRefresh?.toDate()||new Date(0),o=new Date;if(n.getDate()!==o.getDate()||n.getMonth()!==o.getMonth()||n.getFullYear()!==o.getFullYear()){const d={free:G,paid:i.paid||0};return await R(r,{credits:d,lastCreditRefresh:b()}),{freeCredits:d.free,paidCredits:d.paid,total:d.free+d.paid}}const u=i.free||0,m=i.paid||0;return{freeCredits:u,paidCredits:m,total:u+m}}catch(r){return console.error("Error fetching user credits:",r),{freeCredits:0,paidCredits:0,total:0}}},Tt=async s=>{if(!s){const r=_t();return{freeCredits:r,paidCredits:0,total:r}}try{const r=T(I,"users",s);let t;try{t=await S(r)}catch(m){console.error("Error fetching user document:",m),await new Promise(d=>setTimeout(d,800)),t=await S(r)}if(!t.exists()){console.error("User document not found when spending credit");const m=V.currentUser;if(m&&m.uid===s){const d={free:te-1,paid:se};return await z(r,{email:m.email||"unknown@user.com",name:m.displayName||"User",createdAt:b(),lastLogin:b(),credits:d,lastCreditRefresh:b()}),{freeCredits:d.free,paidCredits:d.paid,total:d.free+d.paid}}return!1}const a=t.data();if(typeof a.credits=="number"){const m=a.credits||0;if(m<=0)return{freeCredits:0,paidCredits:0,total:0};const d={free:G-1,paid:m};return await R(r,{credits:d,lastCreditRefresh:b()}),{freeCredits:d.free,paidCredits:d.paid,total:d.free+d.paid}}const i=a.credits||{free:0,paid:0},n=i.free||0,o=i.paid||0;if(n+o<=0)return{freeCredits:0,paidCredits:0,total:0};const u={...i};n>0?u.free=n-1:u.paid=o-1;try{await R(r,{credits:u})}catch(m){console.error("Error updating credits:",m),await z(r,{credits:u},{merge:!0})}try{const d=(await S(r)).data().credits;return{freeCredits:d.free||0,paidCredits:d.paid||0,total:(d.free||0)+(d.paid||0)}}catch(m){return console.error("Error verifying credit update:",m),{freeCredits:u.free,paidCredits:u.paid,total:u.free+u.paid}}}catch(r){return console.error("Error using credit:",r),!1}},Rt=async(s,r)=>{if(!s||!r||r<=0)return!1;try{const t=T(I,"users",s),a=await S(t);if(!a.exists())return console.error("User document not found when adding paid credits"),!1;const i=a.data();if(typeof i.credits=="number"){const u=i.credits||0,m={free:G,paid:u+r};return await R(t,{credits:m,lastCreditRefresh:b()}),{freeCredits:m.free,paidCredits:m.paid,total:m.free+m.paid}}const n=i.credits||{free:0,paid:0},o=n.paid||0,h={...n,paid:o+r};return await R(t,{credits:h}),{freeCredits:h.free||0,paidCredits:h.paid,total:(h.free||0)+h.paid}}catch(t){return console.error("Error adding paid credits:",t),!1}},Dt=async s=>{if(!s)return!1;try{const r=T(I,"users",s),t=await S(r),a=re();if(t.exists()){const i=t.data(),n=new Date;if(typeof i.credits=="number"){const g=i.credits||0,w={free:G,paid:g};return await R(r,{credits:w,lastCreditRefresh:b(),lastLogin:b()}),{freeCredits:w.free,paidCredits:w.paid,total:w.free+w.paid}}const o=i.credits||{free:0,paid:0},h=i.lastLogin?.toDate()||new Date(0),u=i.lastCreditRefresh?.toDate()||new Date(0),m=u.getDate()!==n.getDate()||u.getMonth()!==n.getMonth()||u.getFullYear()!==n.getFullYear();let d={...o};return m&&(d.free=G,console.log(`Free credits reset to daily maximum (${G})`)),await R(r,{lastLogin:b(),credits:d,...m&&{lastCreditRefresh:b()}}),{freeCredits:d.free,paidCredits:d.paid,total:d.free+d.paid}}else{const i={free:te,paid:se};return await z(r,{credits:i,lastCreditRefresh:b(),lastLogin:b(),createdAt:b()},{merge:!0}),{freeCredits:i.free,paidCredits:i.paid,total:i.free+i.paid}}}catch(r){return console.error("Error initializing credits on login:",r),!1}},Me=c.createContext();function Mt({children:s}){const r=Et(),[t,a]=c.useState({freeCredits:0,paidCredits:0,total:0}),[i,n]=c.useState(!0);c.useEffect(()=>{if(!r.user&&!r.loading){localStorage.getItem("visiora_anonymous_credits")===null&&localStorage.setItem("visiora_anonymous_credits",X.toString());const x=re();a({freeCredits:x,paidCredits:0,total:x}),n(!1)}},[r.user,r.loading]),c.useEffect(()=>{(async()=>{if(r.user)try{n(!0);let p=null,y=0;const v=3;for(;ysetTimeout(E,1e3))}if(!p)throw new Error(`Failed to create user profile after ${v} attempts`);await new Promise(N=>setTimeout(N,1e3));const k=await Dt(r.user.uid);k?a(k):p&&p.credits&&(typeof p.credits=="number"?a({freeCredits:0,paidCredits:p.credits,total:p.credits}):a({freeCredits:p.credits.free||0,paidCredits:p.credits.paid||0,total:(p.credits.free||0)+(p.credits.paid||0)}))}catch{}finally{n(!1)}})()},[r.user]);const[o,h]=c.useState(0),u=5e3,m=async()=>{const x=Date.now();if(x-o{try{let x;if(r.user)try{x=await Ie(r.user.uid)}catch{x=t}else{const v=re();x={freeCredits:v,paidCredits:0,total:v}}if(x.total<=0)return a({freeCredits:0,paidCredits:0,total:0}),!1;const p={...x};p.freeCredits>0?p.freeCredits-=1:p.paidCredits-=1,p.total=p.freeCredits+p.paidCredits,a(p);const y=await Tt(r.user?.uid);return y?(a(y),!0):(y===!1&&a(x),!1)}catch{return m(),!1}},g=async x=>{if(!r.user)return!1;try{const p=await Rt(r.user.uid,x);return p?(a(p),!0):!1}catch{return!1}},w=L.useMemo(()=>{if(typeof t=="object"&&t!==null){const p={free:t.free||t.freeCredits||0,paid:t.paid||t.paidCredits||0,total:t.total||(t.free||t.freeCredits||0)+(t.paid||t.paidCredits||0),...t};return p.toString=function(){return String(this.total)},p}if(typeof t=="number"){const p={free:t,paid:0,total:t};return p.toString=function(){return String(this.total)},p}const x={free:0,paid:0,total:0};return x.toString=function(){return"0"},x},[t]);return e.jsx(Me.Provider,{value:{...r,credits:w,isLoadingCredits:i,refreshCredits:m,spendCredit:d,addCredits:g},children:s})}function ae(){return c.useContext(Me)}function F(...s){return Te(Re(s))}const Lt=({isDarkMode:s,onToggle:r,className:t=""})=>e.jsxs(f.button,{onClick:r,className:F("relative w-10 h-10 sm:w-12 sm:h-12 rounded-full border border-white/20 backdrop-blur-md overflow-hidden flex-shrink-0","bg-gradient-to-br from-white/10 to-white/5","hover:from-white/20 hover:to-white/10 hover:border-white/30","focus:outline-none focus:ring-2 focus:ring-purple-500/50 focus:ring-offset-2 focus:ring-offset-transparent","transition-colors duration-150 ease-out","touch-manipulation",t),whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:25,duration:.1},"aria-label":`Switch to ${s?"dark":"light"} mode`,children:[e.jsx(f.div,{className:"absolute inset-0 rounded-full bg-gradient-to-br from-purple-500/15 to-pink-500/15",animate:{opacity:s?.2:.4},transition:{duration:.15,ease:"easeOut"}}),e.jsx("div",{className:"relative w-full h-full flex items-center justify-center",children:e.jsx(U,{mode:"wait",initial:!1,children:s?e.jsx(f.div,{initial:{opacity:0,rotate:-30,scale:.9},animate:{opacity:1,rotate:0,scale:1},exit:{opacity:0,rotate:30,scale:.9},transition:{duration:.12,ease:"easeOut"},children:e.jsx(He,{className:"w-4 h-4 sm:w-5 sm:h-5 text-yellow-400"})},"sun"):e.jsx(f.div,{initial:{opacity:0,rotate:30,scale:.9},animate:{opacity:1,rotate:0,scale:1},exit:{opacity:0,rotate:-30,scale:.9},transition:{duration:.12,ease:"easeOut"},children:e.jsx(Ve,{className:"w-4 h-4 sm:w-5 sm:h-5 text-blue-400"})},"moon")})})]});function Ut({onLoginClick:s}){const{user:r,logout:t,credits:a,isLoadingCredits:i,refreshCredits:n}=ae(),[o,h]=L.useState(!1);L.useEffect(()=>{console.log("UserProfileButton: user or refreshCredits changed"),r&&n&&(console.log("Refreshing credits on mount or user change"),n())},[r,n]),L.useEffect(()=>{console.log("Credits updated:",a)},[a]);const u=L.useMemo(()=>a?typeof a=="object"?{free:a.free||a.freeCredits||0,paid:a.paid||a.paidCredits||0,total:a.total||(a.free||a.freeCredits||0)+(a.paid||a.paidCredits||0)}:typeof a=="number"?{free:0,paid:a,total:a}:{free:0,paid:0,total:0}:{free:0,paid:0,total:0},[a]);return r?e.jsx("div",{className:"flex items-center space-x-3",children:e.jsx("div",{className:"flex flex-col items-start",children:e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-yellow-500 mr-1",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{d:"M10 2a8 8 0 100 16 8 8 0 000-16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z"})}),e.jsxs("span",{className:"text-xs font-medium",children:["Free: ",i?"...":u.free]})]})})}):e.jsx("div",{className:"flex items-center gap-3",children:e.jsx("div",{className:"flex flex-col items-start mr-2",children:e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-yellow-500 mr-1",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{d:"M10 2a8 8 0 100 16 8 8 0 000-16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z"})}),e.jsxs("span",{className:"text-xs font-medium",children:["Free: ",i?"...":u.free]})]})})})}const Pt=({isDarkMode:s,onThemeChange:r})=>{const[t,a]=c.useState(!1),[i,n]=c.useState("login"),[o,h]=c.useState(!1),{user:u}=ae();return L.useEffect(()=>{const m=()=>{h(window.innerWidth<768)};return m(),window.addEventListener("resize",m),()=>window.removeEventListener("resize",m)},[]),e.jsx(f.header,{className:"fixed top-0 left-0 right-0 z-50 border-b border-slate-200/20 dark:border-white/10 bg-white/80 dark:bg-white/5 backdrop-blur-md w-full",initial:{y:-100},animate:{y:0},transition:{type:"spring",stiffness:300,damping:30},children:e.jsx("div",{className:"container mx-auto px-4 sm:px-6 py-4 w-full",children:e.jsxs("div",{className:"flex items-center justify-between w-full",children:[e.jsxs(f.div,{className:"flex items-center gap-2 sm:gap-3 flex-shrink-0",whileHover:{scale:1.05},transition:{type:"spring",stiffness:400,damping:25},children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-8 h-8 sm:w-10 sm:h-10 rounded-full overflow-hidden shadow-lg",children:e.jsx("img",{src:"/assets/logo/logo.jpg",alt:"Miragic Logo",className:"w-full h-full object-cover"})}),e.jsx("div",{className:"absolute inset-0 rounded-full bg-gradient-to-br from-purple-500 to-pink-500 blur-md opacity-30 animate-pulse"})]}),e.jsxs("div",{className:"hidden sm:block",children:[e.jsx("h1",{className:"text-lg sm:text-xl font-bold bg-gradient-to-r from-slate-800 to-slate-600 dark:from-white dark:to-white/80 bg-clip-text text-transparent",children:"Miragic"}),e.jsx("p",{className:"text-xs text-slate-600 dark:text-white/60",children:"AI Image Generator"})]})]}),e.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[e.jsx(Ut,{onLoginClick:()=>{a(!0),n("login")}}),e.jsx(Lt,{isDarkMode:s,onToggle:r,className:"relative"})]})]})})})},zt=({texts:s,speed:r=150,delay:t=1500})=>{const[a,i]=c.useState(0),[n,o]=c.useState(""),[h,u]=c.useState(!1);return c.useEffect(()=>{const m=s[a],d=setTimeout(()=>{h?(o(m.substring(0,n.length-1)),n===""&&(u(!1),i(g=>(g+1)%s.length))):(o(m.substring(0,n.length+1)),n===m&&setTimeout(()=>u(!0),t))},h?r/2:r);return()=>clearTimeout(d)},[n,h,a,s,r,t]),e.jsxs("span",{className:"font-semibold text-purple-600 dark:text-purple-400",children:[n,e.jsx("span",{className:"animate-pulse",children:"|"})]})};function Ft(...s){return Te(Re(s))}const Ot=()=>{const s={hidden:{opacity:0,y:20},visible:t=>({opacity:1,y:0,transition:{delay:t*.1,duration:.6,ease:"easeOut"}})},r=["Generate","Enhance","Transform","Create","Inspire","Design","Imagine","Visualize","Dream","Craft","Build","Invent","Paint","Sketch","Art","Magic"];return e.jsxs("section",{className:"relative min-h-screen flex items-center justify-center pt-20 overflow-hidden -translate-y-[20vh]",children:[e.jsxs("div",{className:"absolute inset-0 overflow-hidden",children:[e.jsx("div",{className:Ft("absolute inset-0","[background-size:40px_40px]","[background-image:radial-gradient(#d4d4d4_2px,transparent_2px)]","dark:[background-image:radial-gradient(#404040_2px,transparent_2px)]","opacity-80 dark:opacity-60")}),e.jsx("div",{className:"pointer-events-none absolute inset-0 bg-white [mask-image:radial-gradient(ellipse_at_center,transparent_20%,black)] dark:bg-black opacity-40"})]}),e.jsxs("div",{className:"container mx-auto px-6 text-center relative z-10",children:[e.jsxs(f.div,{className:"space-y-6",initial:"hidden",animate:"visible",children:[e.jsx(f.div,{custom:0,variants:s,className:"space-y-4",children:e.jsxs("div",{className:"inline-flex items-center gap-2 px-4 py-2 rounded-full bg-slate-200/50 dark:bg-white/10 border border-slate-300/50 dark:border-white/20 backdrop-blur-md text-sm text-slate-700 dark:text-white/80",children:[e.jsx(J,{className:"w-4 h-4"}),e.jsx("span",{children:"Where imagination meets AI"})]})}),e.jsxs(f.h1,{custom:1,variants:s,className:"text-4xl md:text-6xl lg:text-7xl font-bold",children:[e.jsx("span",{className:"bg-gradient-to-r from-slate-800 via-slate-600 to-slate-700 dark:from-white dark:via-purple-200 dark:to-pink-200 bg-clip-text text-transparent",children:"Create Stunning"}),e.jsx("br",{}),e.jsx("span",{className:"bg-gradient-to-r from-purple-600 via-pink-600 to-cyan-600 dark:from-purple-400 dark:via-pink-400 dark:to-cyan-400 bg-clip-text text-transparent",children:"Images with AI"})]}),e.jsxs(f.p,{custom:2,variants:s,className:"text-lg md:text-xl text-slate-600 dark:text-white/70 max-w-2xl mx-auto leading-relaxed",children:["Built for"," ",e.jsx(zt,{texts:["creators","dreamers","visionaries","you.."],speed:150,delay:1500})]}),e.jsx(f.div,{custom:3,variants:s,className:"flex flex-wrap gap-3 justify-center mt-8",children:[{icon:Ae,text:"AI Generation"},{icon:J,text:"Smart Enhancement"},{icon:Ye,text:"Lightning Fast"}].map(({icon:t,text:a},i)=>e.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 rounded-full bg-slate-200/30 dark:bg-white/5 border border-slate-300/30 dark:border-white/10 backdrop-blur-md text-slate-700 dark:text-white/80 hover:bg-slate-300/40 dark:hover:bg-white/10 transition-all duration-300",children:[e.jsx(t,{className:"w-4 h-4"}),e.jsx("span",{className:"text-sm",children:a})]},a))})]}),e.jsx("div",{className:"fixed inset-0 pointer-events-none z-5 overflow-hidden",children:r.map((t,a)=>{const i=[{left:5+Math.random()*15,top:10+Math.random()*80},{left:80+Math.random()*15,top:10+Math.random()*80},{left:20+Math.random()*60,top:5+Math.random()*15},{left:20+Math.random()*60,top:80+Math.random()*15},{left:30+Math.random()*40,top:30+Math.random()*40}],n=i[a%i.length],o={left:Math.max(2,Math.min(85,n.left+(Math.random()-.5)*10)),top:Math.max(5,Math.min(90,n.top+(Math.random()-.5)*10))};return e.jsx(f.div,{className:"absolute text-slate-300/10 dark:text-white/8 font-bold text-xl md:text-3xl lg:text-5xl select-none will-change-transform",style:{left:`${o.left}%`,top:`${o.top}%`,transform:"translate(-50%, -50%)"},animate:{y:[-10,10,-10],rotate:[-4,4,-4],scale:[.95,1.05,.95],x:[-8,8,-8]},transition:{duration:15+a*1.5,repeat:1/0,ease:"easeInOut",delay:a*.8},children:t},t)})})]})]})},H=({children:s,className:r="",hover:t=!0,blur:a="md",...i})=>{const n={sm:"backdrop-blur-sm",md:"backdrop-blur-md",lg:"backdrop-blur-lg",xl:"backdrop-blur-xl"};return e.jsx(f.div,{className:F("relative overflow-hidden rounded-2xl border border-slate-300/30 dark:border-white/10 bg-slate-100/30 dark:bg-white/5 p-6 shadow-2xl",n[a],"before:absolute before:inset-0 before:rounded-2xl before:border before:border-slate-200/40 dark:before:border-white/20 before:bg-gradient-to-br before:from-slate-200/20 dark:before:from-white/10 before:to-transparent before:opacity-50",t&&"transition-all duration-300 hover:border-slate-400/40 dark:hover:border-white/20 hover:bg-slate-200/40 dark:hover:bg-white/10 hover:shadow-2xl hover:shadow-purple-500/10",r),whileHover:t?{y:-2,scale:1.02}:{},transition:{type:"spring",stiffness:300,damping:30},...i,children:e.jsx("div",{className:"relative z-10",children:s})})},$t=()=>{new Date().getFullYear();const s="Miragic",r=`https://huggingface.co/spaces/${s}-AI/${s}-AI-Image-Generator`;return e.jsx(e.Fragment,{children:e.jsxs("footer",{className:"relative py-10",children:[e.jsx("div",{className:"container mx-auto px-6",children:e.jsx(H,{className:"text-center",children:e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex items-center justify-center gap-3",children:e.jsx("h3",{className:"text-2xl font-bold text-slate-800 dark:text-white",children:"About US"})}),e.jsx("p",{className:"text-slate-600 dark:text-white/70 leading-relaxed",children:"Miragic is a Generative AI company providing innovative solutions including Virtual Try-On clothes, AI SpeedPainting, Sales Pilot, and Free Background Remover tools."})]}),e.jsx("div",{className:"pt-4 flex justify-center",children:e.jsx("a",{href:`https://visitorbadge.io/status?path=${encodeURIComponent(r)}`,target:"_blank",rel:"noopener noreferrer",className:"inline-block",children:e.jsx("img",{src:`https://api.visitorbadge.io/api/combined?path=${encodeURIComponent(r)}&label=VISITORS&labelColor=%2337d67a&countColor=%23f47373&style=plastic&labelStyle=upper`,alt:"Visitor Badge",className:"h-5 w-auto"})})}),e.jsxs("div",{className:"pt-6",children:[e.jsx("h4",{className:"text-lg font-semibold text-slate-800 dark:text-white mb-4",children:"Follow Us"}),e.jsxs("div",{className:"flex justify-center space-x-4 flex-wrap",children:[e.jsx("a",{href:"https://www.facebook.com/miragic2025/",target:"_blank",rel:"noopener noreferrer",className:"text-slate-600 hover:text-blue-600 dark:text-white/70 dark:hover:text-blue-400 transition-colors p-2","aria-label":"Facebook",children:e.jsx(qe,{className:"w-6 h-6"})}),e.jsx("a",{href:"https://www.instagram.com/miragic.ai",target:"_blank",rel:"noopener noreferrer",className:"text-slate-600 hover:text-pink-600 dark:text-white/70 dark:hover:text-pink-400 transition-colors p-2","aria-label":"Instagram",children:e.jsx(We,{className:"w-6 h-6"})}),e.jsx("a",{href:"https://www.tiktok.com/@miragic.ai",target:"_blank",rel:"noopener noreferrer",className:"text-slate-600 hover:text-black dark:text-white/70 dark:hover:text-cyan-300 transition-colors p-2","aria-label":"TikTok",children:e.jsx(Ke,{className:"w-6 h-6"})}),e.jsx("a",{href:"https://x.com/miragic2025",target:"_blank",rel:"noopener noreferrer",className:"text-slate-600 hover:text-black dark:text-white/70 dark:hover:text-white transition-colors p-2","aria-label":"X (Twitter)",children:e.jsx(Je,{className:"w-6 h-6"})}),e.jsx("a",{href:"https://www.linkedin.com/company/miragic-ai",target:"_blank",rel:"noopener noreferrer",className:"text-slate-600 hover:text-blue-700 dark:text-white/70 dark:hover:text-blue-500 transition-colors p-2","aria-label":"LinkedIn",children:e.jsx(Xe,{className:"w-6 h-6"})}),e.jsx("a",{href:"https://youtube.com/@Miragic-ai",target:"_blank",rel:"noopener noreferrer",className:"text-slate-600 hover:text-red-600 dark:text-white/70 dark:hover:text-red-500 transition-colors p-2","aria-label":"YouTube",children:e.jsx(Ze,{className:"w-6 h-6"})}),e.jsx("a",{href:"https://www.reddit.com/r/TryOutfits/",target:"_blank",rel:"noopener noreferrer",className:"text-slate-600 hover:text-orange-600 dark:text-white/70 dark:hover:text-orange-500 transition-colors p-2","aria-label":"Reddit",children:e.jsx(Qe,{className:"w-6 h-6"})})]})]})]})})}),e.jsx("div",{className:"absolute inset-0 -z-10",children:e.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-px bg-gradient-to-r from-transparent via-white/20 to-transparent"})})]})})},Bt=({activeTab:s,onTabChange:r,historyCount:t=0})=>{let a=[{id:"generate",label:"Generate",icon:Ae,description:"Create new images"},{id:"history",label:"History",icon:he,description:"View past creations",badge:t}];return e.jsx("div",{className:"w-full max-w-sm sm:max-w-md mx-auto mb-8 px-4",children:e.jsxs("div",{className:"relative p-1 rounded-2xl bg-white/0 border border-white/10 backdrop-blur-md w-full",children:[e.jsx(f.div,{className:"absolute top-1 bottom-1 rounded-xl bg-gradient-to-r from-purple-600/80 to-pink-600/80 shadow-lg",layoutId:"activeTab",initial:!1,animate:{left:`${a.findIndex(i=>i.id===s)/a.length*100}%`},style:{width:`${100/a.length}%`},transition:{type:"spring",stiffness:300,damping:30}}),e.jsx("div",{className:F("relative z-10 grid gap-0 w-full","grid-cols-2"),children:a.map(i=>{const n=s===i.id,o=i.icon;return e.jsxs(f.button,{onClick:()=>r(i.id),className:F("relative flex flex-col items-center gap-1 px-2 sm:px-4 py-3 text-xs sm:text-sm font-medium transition-all duration-200 w-full","hover:text-slate-800 dark:hover:text-white focus:outline-none focus:text-slate-800 dark:focus:text-white","touch-manipulation",n?"text-slate-900 dark:text-white":"text-slate-600 dark:text-white/60"),whileHover:{scale:1.02},whileTap:{scale:.98},transition:{duration:.1},children:[e.jsxs("div",{className:"relative",children:[e.jsx(o,{className:"w-5 h-5"}),i.badge!==void 0&&e.jsx(f.div,{className:"absolute -top-2 -right-2 w-5 h-5 bg-red-500 rounded-full flex items-center justify-center text-xs font-bold text-white",initial:{scale:0},animate:{scale:1},transition:{type:"spring",stiffness:500,damping:25},children:i.badge>99?"99+":i.badge})]}),e.jsx("span",{className:"text-xs",children:i.label})]},i.id)})})]})})},M=({children:s,variant:r="primary",size:t="md",disabled:a=!1,loading:i=!1,className:n="",icon:o,...h})=>{const u={primary:"bg-gradient-to-r from-purple-600 to-pink-600 hover:from-purple-700 hover:to-pink-700 text-white shadow-lg hover:shadow-purple-500/25",secondary:"bg-slate-200/50 dark:bg-white/10 hover:bg-slate-200/70 dark:hover:bg-white/20 border border-slate-300/50 dark:border-white/20 hover:border-slate-400/60 dark:hover:border-white/30 text-slate-700 dark:text-white backdrop-blur-md",ghost:"hover:bg-slate-100 dark:hover:bg-white/10 text-slate-600 dark:text-white/80 hover:text-slate-800 dark:hover:text-white",outline:"border-2 border-purple-500/50 hover:border-purple-500 text-purple-600 dark:text-purple-400 hover:text-purple-700 dark:hover:text-purple-300 hover:bg-purple-500/10"},m={sm:"px-3 py-1.5 text-sm",md:"px-6 py-2.5 text-base",lg:"px-8 py-3 text-lg",xl:"px-10 py-4 text-xl"};return e.jsxs(f.button,{className:F("relative inline-flex items-center justify-center gap-2 rounded-xl font-medium transition-all duration-200","focus:outline-none focus:ring-2 focus:ring-purple-500/50 focus:ring-offset-2 focus:ring-offset-transparent","disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:scale-100",u[r],m[t],n),whileHover:{scale:a?1:1.02},whileTap:{scale:a?1:.98},transition:{type:"spring",stiffness:400,damping:25},disabled:a||i,style:{touchAction:"manipulation",WebkitTapHighlightColor:"transparent"},...h,children:[i&&e.jsx("div",{className:"w-4 h-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),o&&!i&&e.jsx(o,{size:18}),s&&e.jsx("span",{children:s}),r==="primary"&&e.jsx("div",{className:"absolute inset-0 rounded-xl bg-gradient-to-r from-transparent via-white/20 to-transparent opacity-0 hover:opacity-100 transition-opacity duration-500 animate-shimmer"})]})},ue=({type:s="text",placeholder:r,value:t,onChange:a,className:i="",icon:n,error:o,label:h,...u})=>e.jsxs("div",{className:"space-y-2",children:[h&&e.jsx("label",{className:"block text-sm font-medium text-slate-700 dark:text-white/90",children:h}),e.jsxs("div",{className:"relative",children:[n&&e.jsx("div",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500 dark:text-white/50",children:e.jsx(n,{size:18})}),e.jsx(f.input,{type:s,value:t,onChange:a,placeholder:r,className:F("w-full rounded-xl border border-slate-300/50 dark:border-white/10 bg-slate-100/50 dark:bg-white/5 px-4 py-3 text-slate-800 dark:text-white placeholder-slate-500 dark:placeholder-white/50 backdrop-blur-md transition-all duration-200","focus:border-purple-500/50 focus:bg-slate-200/50 dark:focus:bg-white/10 focus:outline-none focus:ring-2 focus:ring-purple-500/20","hover:border-slate-400/60 dark:hover:border-white/20 hover:bg-slate-200/60 dark:hover:bg-white/10",n&&"pl-10",o&&"border-red-500/50 focus:border-red-500/50 focus:ring-red-500/20",i),whileFocus:{scale:1.01},transition:{type:"spring",stiffness:300,damping:25},...u})]}),o&&e.jsx(f.p,{className:"text-sm text-red-400",initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{duration:.2},children:o})]}),Gt=({onPromptSelect:s})=>{const r=[{id:"anime",title:"Anime",emoji:"🎌",gradient:"from-pink-500 to-red-500",examples:[{image:"/assets/example_images/Anime/1.jpg",prompt:"Anime-style pirate girl with wind-swept coat standing on the bow of a ship soaring over giant waves, colorful sky with drifting clouds and soaring seagulls, steampunk-inspired goggles on her head, treasure map in one hand, confident smirk on her face, uniquely designed crew flag fluttering behind, stylized ship with fantastical elements like rotating propellers and wooden dragon carvings, vivid cel-shaded coloring, dynamic angle, 4K anime cinematic quality"},{image:"/assets/example_images/Anime/2.jpg",prompt:"Epic anime-style samurai duel on a misty mountain cliff at sunset, fiery sky in the background, cherry blossom petals flying, both warriors with torn haori and glowing swords, high-speed motion lines, cinematic composition, rich traditional Japanese color palette, 8K stylized anime painting"},{image:"/assets/example_images/Anime/3.jpg",prompt:"Anime-style cozy indoor scene of a girl sitting by the window sipping tea, raindrops on the glass, soft ambient light, bookshelf in the background, cat sleeping nearby, warm color tones, gentle expression, aesthetic Ghibli-style art, ultra-detailed, 4K resolution"},{image:"/assets/example_images/Anime/4.jpg",prompt:"Anime-style magical girl in a ruined city, glowing magical circle beneath her feet, shattered buildings in the background, floating embers, scarred face and broken wand, duality of innocence and power, dark clouds above, cinematic angle, moody lighting, stylized in detailed anime art"}]},{id:"nature",title:"Nature",emoji:"🌲",gradient:"from-green-500 to-emerald-500",examples:[{image:"/assets/example_images/Nature/1.jpg",prompt:"A serene forest with dew-covered grass, golden morning sunlight piercing through tall trees, photorealistic textures, soft mist, birds in flight, 8K natural scenery"},{image:"/assets/example_images/Nature/2.jpg",prompt:"Massive floating islands covered with lush green forests and cascading waterfalls, connected by glowing vines, warm sky tones, fantasy artwork, painterly style, high detail"},{image:"/assets/example_images/Nature/3.jpg",prompt:"A moody cinematic scene of storm clouds rolling over a rugged mountain valley, with lightning strikes and wind-blown trees, epic lighting, dramatic realism, 4K scene composition"},{image:"/assets/example_images/Nature/4.jpg",prompt:"A peaceful Japanese Zen garden with white gravel patterns, bonsai trees, a small wooden bridge over a koi pond, minimalist art style with soft pastel tones and clean aesthetic"}]},{id:"space",title:"Space",emoji:"🌌",gradient:"from-purple-500 to-indigo-500",examples:[{image:"/assets/example_images/Space/1.jpg",prompt:"A lone astronaut standing under a violet sky, strange glowing rocks surrounding them, twin moons in the background, detailed sci-fi concept art, cinematic lighting"},{image:"/assets/example_images/Space/2.jpg",prompt:"Looking out from a futuristic space station window at a massive spiral galaxy, glowing star systems, 3D rendered, high contrast and clarity, sci-fi ambience"},{image:"/assets/example_images/Space/3.jpg",prompt:"A surreal floating garden in space, with plants growing in zero gravity, stars shimmering all around, painterly fantasy style, dreamlike and vibrant, concept design aesthetic"},{image:"/assets/example_images/Space/4.jpg",prompt:"A spacecraft being pulled into a wormhole, intense color distortion, glowing particles, bending light physics, ultra-detailed visualization in science-illustration style"}]},{id:"streets",title:"Streets",emoji:"🏙️",gradient:"from-cyan-500 to-blue-500",examples:[{image:"/assets/example_images/Streets/1.jpg",prompt:"A neon-lit street with holographic ads, flying cars above, people in glowing techwear, reflections on wet asphalt, Blade Runner vibes, ultra-detailed cyberpunk concept art"},{image:"/assets/example_images/Streets/2.jpg",prompt:"Old cobblestone street in Paris during rain, people with umbrellas, warm shop lights reflecting off wet pavement, photorealistic lighting, cozy and cinematic mood"},{image:"/assets/example_images/Streets/3.jpg",prompt:"Busy street in 1980s Manhattan, yellow cabs, neon signs, vintage billboards, grainy photo style, rich in retro detail"},{image:"/assets/example_images/Streets/4.jpg",prompt:"A quiet urban alley lit by a golden sunset, long shadows, dust particles in the air, strong depth and lighting, DSLR photography look, cinematic framing"}]},{id:"ghibli-pixar",title:"Ghibli/Pixar",emoji:"🎥",gradient:"from-orange-500 to-red-500",examples:[{image:"/assets/example_images/Ghibli-Pixar/1.jpg",prompt:"A cozy rural village with windmills, green hills, and warm sunlight, stylized painterly textures, whimsical Ghibli charm, clouds drifting in a blue sky, animated vibe"},{image:"/assets/example_images/Ghibli-Pixar/2.jpg",prompt:"A cute, round robot with expressive digital eyes, rolling through a futuristic lab, 3D Pixar-style rendering, bright color palette, stylized metallic textures"},{image:"/assets/example_images/Ghibli-Pixar/3.jpg",prompt:"A magical bakery floating on a cloud, smoke puffing from its chimney, flying pastries around, pastel color scheme, Ghibli-Pixar fusion, fantasy 3D cartoon look"},{image:"/assets/example_images/Ghibli-Pixar/4.jpg",prompt:"A young explorer sailing a colorful boat across calm cartoon oceans, stylized waves and sky, expressive character design, Pixar short-film quality"}]},{id:"misc",title:"Misc",emoji:"🌀",gradient:"from-yellow-500 to-pink-500",examples:[{image:"/assets/example_images/Misc/1.jpg",prompt:"A human head split open with galaxies and memories spilling out, surreal art style, symbolic, dreamlike elements, soft brushwork and contrast"},{image:"/assets/example_images/Misc/2.jpg",prompt:"A minimalist futuristic living room with smooth white surfaces, floating furniture, ambient lighting, clean design aesthetics, 3D architectural render"},{image:"/assets/example_images/Misc/3.jpg",prompt:"A dark, twisted forest under a blood moon, thick fog covering the ground, shadowy figures in the background, horror aesthetic, cinematic thriller tone"},{image:"/assets/example_images/Misc/4.jpg",prompt:"Floating neon geometric shapes over a dark background, glowing edges, vaporwave-inspired color palette, high-tech abstract art, sharp lighting effects"}]}];return e.jsx(H,{children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx(J,{className:"w-5 h-5 text-purple-400"}),e.jsx("h3",{className:"text-lg font-semibold text-slate-800 dark:text-white",children:"Example Prompts"})]}),e.jsx("div",{className:"grid grid-cols-1 min-[620px]:grid-cols-3 md:grid-cols-2 gap-3",children:r.map((t,a)=>e.jsx(Ht,{category:t,onPromptSelect:s,delay:a*.1},t.id))})]})})},Ht=({category:s,onPromptSelect:r,delay:t})=>{const[a,i]=c.useState(0),[n,o]=c.useState(!0);c.useEffect(()=>{if(!n)return;const d=setInterval(()=>{i(g=>g===s.examples.length-1?0:g+1)},4e3);return()=>clearInterval(d)},[n,s.examples.length]);const h=d=>{i(d),o(!1),setTimeout(()=>o(!0),1e4)},u=()=>{i(d=>d===s.examples.length-1?0:d+1),o(!1),setTimeout(()=>o(!0),1e4)},m=()=>{i(d=>d===0?s.examples.length-1:d-1),o(!1),setTimeout(()=>o(!0),1e4)};return e.jsxs(f.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.6,delay:t},className:"group relative bg-slate-100/50 dark:bg-white/5 backdrop-blur-md rounded-xl border border-slate-300/50 dark:border-white/10 overflow-hidden hover:border-slate-400/60 dark:hover:border-white/20 transition-all duration-300",children:[e.jsx("div",{className:"p-3 border-b border-slate-300/30 dark:border-white/10",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:`w-6 h-6 rounded-full bg-gradient-to-r ${s.gradient} flex items-center justify-center text-sm`,children:s.emoji}),e.jsx("h4",{className:"font-medium text-sm text-slate-800 dark:text-white",children:s.title})]})}),e.jsxs("div",{className:"relative h-56 overflow-hidden p-2",children:[e.jsx(U,{mode:"popLayout",children:e.jsx(f.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"-100%"},transition:{type:"tween",duration:.5,ease:"easeInOut"},className:"absolute inset-2",children:e.jsx("img",{src:s.examples[a].image,alt:s.title,className:"w-full h-full object-cover rounded-lg",loading:"lazy"})},a)}),e.jsx("button",{onClick:m,className:"absolute left-2 top-1/2 -translate-y-1/2 w-6 h-6 bg-black/50 backdrop-blur-sm rounded-full flex items-center justify-center text-white opacity-0 group-hover:opacity-100 transition-all duration-300 hover:bg-black/70",children:e.jsx(et,{className:"w-3 h-3"})}),e.jsx("button",{onClick:u,className:"absolute right-2 top-1/2 -translate-y-1/2 w-6 h-6 bg-black/50 backdrop-blur-sm rounded-full flex items-center justify-center text-white opacity-0 group-hover:opacity-100 transition-all duration-300 hover:bg-black/70",children:e.jsx(tt,{className:"w-3 h-3"})})]}),e.jsxs("div",{className:"p-3 space-y-2",children:[e.jsxs("p",{className:"text-xs text-slate-600 dark:text-white/70 line-clamp-2 leading-relaxed min-h-[2rem]",children:['"',s.examples[a].prompt.substring(0,80),'..."']}),e.jsx("div",{className:"flex justify-center gap-1 mb-2",children:s.examples.map((d,g)=>e.jsx("button",{onClick:()=>h(g),className:`h-1 rounded-full transition-all duration-300 ${g===a?`bg-gradient-to-r ${s.gradient} w-4`:"bg-slate-300 dark:bg-white/30 hover:bg-slate-400 dark:hover:bg-white/50 w-1"}`},g))}),e.jsxs("button",{onClick:()=>r(s.examples[a].prompt),className:`w-full py-2 px-3 rounded-lg bg-gradient-to-r ${s.gradient} text-white text-xs font-medium hover:opacity-90 transition-opacity duration-200 flex items-center justify-center gap-1`,children:[e.jsx(st,{className:"w-3 h-3"}),"TRY THIS PROMPT"]})]})]})},Le=c.memo(({inputPrompt:s,setInputPrompt:r,imageUrl:t,isLoading:a,imageLoaded:i,error:n,progress:o,selectedModel:h,setSelectedModel:u,selectedShape:m,setSelectedShape:d,seed:g,setSeed:w,width:x,height:p,setWidth:y,setHeight:v,shapes:k,models:N,handleGenerateClick:E,handleImageLoadComplete:Y,handleImageLoadError:O,isGeneratingRandom:ie})=>{const[A,Z]=c.useState(!1),{user:$}=ae(),q=async()=>{if(t)try{const j=await(await fetch(t)).blob(),D=URL.createObjectURL(j),_=document.createElement("a");_.href=D,_.download=`miragic-${Date.now()}.jpg`,_.style.display="none",document.body.appendChild(_),_.click(),setTimeout(()=>{URL.revokeObjectURL(D),document.body.removeChild(_)},100)}catch(l){console.error("Download failed:",l)}};return e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"grid lg:grid-cols-2 gap-8",children:[e.jsxs("div",{className:"space-y-6",children:[e.jsx(H,{className:"border-slate-300 dark:border-white/10",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(J,{className:"w-5 h-5 text-purple-400"}),e.jsx("h3",{className:"text-lg font-semibold text-slate-800 dark:text-white",children:"Describe Your Vision"})]})}),e.jsx(f.textarea,{value:s,onChange:l=>r(l.target.value),placeholder:"A majestic dragon soaring through storm clouds, lightning illuminating its scales, cinematic lighting, ultra detailed...",className:"w-full h-64 resize-none rounded-xl border border-slate-300/50 dark:border-white/10 bg-slate-100/50 dark:bg-white/5 px-4 py-3 text-slate-800 dark:text-white placeholder-slate-500 dark:placeholder-white/50 backdrop-blur-md transition-all duration-200 focus:border-purple-500/50 focus:bg-slate-200/50 dark:focus:bg-white/10 focus:outline-none focus:ring-2 focus:ring-purple-500/20",whileFocus:{scale:1.01},transition:{type:"spring",stiffness:300,damping:25}})]})}),e.jsx(H,{className:"border-slate-300 dark:border-white/10",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(rt,{className:"w-5 h-5 text-purple-400"}),e.jsx("h3",{className:"text-lg font-semibold text-slate-800 dark:text-white",children:"Generation Settings"})]}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"block text-sm font-medium text-slate-700 dark:text-white/80",children:"AI Model"}),e.jsx("select",{value:h,onChange:l=>u(l.target.value),className:"w-full rounded-xl border border-slate-300/50 dark:border-white/10 bg-slate-100/50 dark:bg-white/5 px-3 py-2 text-slate-800 dark:text-white backdrop-blur-md transition-all duration-200 focus:border-purple-500/50 focus:bg-slate-200/50 dark:focus:bg-white/10 focus:outline-none focus:ring-2 focus:ring-purple-500/20",children:N.map(l=>e.jsx("option",{value:l.value,className:"bg-slate-200 dark:bg-slate-800 text-slate-800 dark:text-white",children:l.label},l.value))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"block text-sm font-medium text-slate-700 dark:text-white/80",children:"Dimensions"}),e.jsx("select",{value:m,onChange:l=>d(l.target.value),className:"w-full rounded-xl border border-slate-300/50 dark:border-white/10 bg-slate-100/50 dark:bg-white/5 px-3 py-2 text-slate-800 dark:text-white backdrop-blur-md transition-all duration-200 focus:border-purple-500/50 focus:bg-slate-200/50 dark:focus:bg-white/10 focus:outline-none focus:ring-2 focus:ring-purple-500/20",children:Object.entries(k).map(([l,j])=>e.jsx("option",{value:l,className:"bg-slate-200 dark:bg-slate-800 text-slate-800 dark:text-white",children:j.label},l))})]})]}),e.jsx(U,{children:m==="manual"&&e.jsxs(f.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.3},className:"grid grid-cols-2 gap-4",children:[e.jsx(ue,{type:"number",label:"Width",value:x,onChange:l=>y(Number(l.target.value)),min:"256",max:"2048",step:"64"}),e.jsx(ue,{type:"number",label:"Height",value:p,onChange:l=>v(Number(l.target.value)),min:"256",max:"2048",step:"64"})]})}),e.jsx("div",{className:"space-y-4",children:e.jsx(ue,{label:"Seed (Optional)",value:g,onChange:l=>w(l.target.value),placeholder:"Random seed for reproducible results"})})]})}),e.jsx(M,{onClick:E,disabled:a||!s.trim(),loading:a,size:"lg",className:"w-full",icon:a?null:J,children:a?`Generating... ${Math.round(o)}%`:"Generate Image"})]}),e.jsxs("div",{className:"flex flex-col justify-center",children:[e.jsx(H,{className:"flex-1 border-slate-300 dark:border-white/10",children:e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(at,{className:"w-5 h-5 text-purple-400"}),e.jsx("h3",{className:"text-lg font-semibold text-slate-800 dark:text-white",children:"Generated Image"})]}),t&&i&&e.jsx("div",{className:"flex space-x-1",children:e.jsx(M,{variant:"ghost",size:"sm",onClick:q,icon:_e,children:"Download"})})]}),e.jsxs("div",{className:"relative flex-1 w-full rounded-xl overflow-hidden bg-white/5 border border-white/10 min-h-[400px] flex items-center justify-center",children:[e.jsx(U,{mode:"wait",children:t?e.jsxs(f.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.5},className:"relative w-full h-full flex items-center justify-center",children:[e.jsx("img",{src:t,alt:"Generated",className:"max-w-full max-h-full object-contain",onLoad:Y,onError:O,loading:"lazy",decoding:"async",style:{maxWidth:"100%",height:"auto",imageRendering:"crisp-edges"}}),e.jsx(U,{children:a&&e.jsx(f.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"absolute inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center",children:e.jsxs("div",{className:"text-center space-y-4",children:[e.jsx("div",{className:"w-12 h-12 border-4 border-purple-500/30 border-t-purple-500 rounded-full animate-spin mx-auto"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-slate-800 dark:text-white text-sm",children:"Generating your image..."}),e.jsx("div",{className:"w-48 h-2 bg-slate-300/50 dark:bg-white/10 rounded-full overflow-hidden",children:e.jsx(f.div,{className:"h-full bg-gradient-to-r from-purple-500 to-pink-500",initial:{width:0},animate:{width:`${o}%`},transition:{duration:.3}})}),e.jsxs("p",{className:"text-slate-600 dark:text-white/60 text-xs",children:[Math.round(o),"% complete"]})]})]})})})]},t):e.jsx(f.div,{initial:{opacity:0},animate:{opacity:1},className:"flex items-center justify-center h-full text-center",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-gradient-to-br from-purple-500/20 to-pink-500/20 flex items-center justify-center mx-auto",children:e.jsx(J,{className:"w-8 h-8 text-purple-400"})}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-lg font-medium text-slate-800 dark:text-white/90 mb-2",children:"Ready to Create"}),e.jsx("p",{className:"text-sm text-slate-600 dark:text-white/60 max-w-xs",children:"Enter a prompt and click generate to create your first AI image"})]})]})},"empty")}),e.jsx(U,{children:n&&e.jsx(f.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"absolute inset-0 bg-red-500/10 border border-red-500/20 rounded-xl flex items-center justify-center",children:e.jsxs("div",{className:"text-center p-6",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-red-500/20 flex items-center justify-center mx-auto mb-3",children:e.jsx("span",{className:"text-red-400 text-xl",children:"⚠️"})}),e.jsx("p",{className:"text-red-400 text-sm",children:n})]})})})]})]})}),e.jsx("div",{className:"mt-6 text-center",children:e.jsxs("div",{className:"bg-gradient-to-r from-purple-500/10 to-pink-500/10 p-4 rounded-xl border border-purple-500/20",children:[e.jsx("h3",{className:"text-lg font-semibold text-slate-800 dark:text-white mb-2",children:"🚀 Want more AI tools?"}),e.jsx("p",{className:"text-sm text-slate-600 dark:text-white/70 mb-4",children:"Visit Miragic.ai for unlimited access to all our AI tools!"}),e.jsx("a",{href:"https://miragic.ai/products/image-generator",target:"_blank",rel:"noopener noreferrer",style:{background:"linear-gradient(45deg, #ff416c, #ff4b2b, #ff9b00, #ff416c)",backgroundSize:"400% 400%",border:"none",padding:"14px 28px",fontSize:"16px",fontWeight:"bold",color:"white",borderRadius:"10px",cursor:"pointer",transition:"0.3s ease-in-out",animation:"gradientAnimation 2s infinite linear",boxShadow:"0 4px 10px rgba(255, 65, 108, 0.6)",textDecoration:"none",display:"inline-block"},onMouseOver:l=>{l.target.style.transform="scale(1.05)",l.target.style.boxShadow="0 6px 15px rgba(255, 75, 43, 0.8)"},onMouseOut:l=>{l.target.style.transform="scale(1)",l.target.style.boxShadow="0 4px 10px rgba(255, 65, 108, 0.6)"},children:"Explore More Tools 🚀"})]})})]})]}),e.jsx(Gt,{onPromptSelect:r})]})});Le.displayName="ModernGenerateTab";const Vt=async(s,r=50)=>{if(!s)return[];try{const t=xt(I,"users",s,"generatedImages"),a=bt(t,wt("createdAt","desc"),yt(r)),i=await vt(a),n=[];for(const o of i.docs){const h=o.id,u=o.data();n.push({imageId:h,path:`users/${s}/generatedImages/${h}`,...u,createdAt:u.createdAt?.toDate()})}return n}catch(t){return console.error("Error fetching user generated images:",t),[]}},Yt=async(s,r)=>{if(!s||!r)return!1;try{const t=T(I,"users",s,"generatedImages",r);return await jt(t),!0}catch(t){return console.error("Error deleting generated image:",t),!1}},Ue=c.memo(({history:s,setInputPrompt:r,setActiveTab:t,handleDeleteHistoryItem:a,handleClearAllHistory:i})=>{const{user:n}=ae(),[o,h]=c.useState(null),[u,m]=c.useState(null),[d,g]=c.useState([]),[w,x]=c.useState(!1),[p,y]=c.useState("local");c.useEffect(()=>{n&&p==="cloud"&&v()},[n,p]);const v=async()=>{if(n){x(!0);try{const l=await Vt(n.uid);g(l)}catch(l){console.error("Error fetching cloud images:",l)}finally{x(!1)}}},k=l=>{h(l)},N=()=>{h(null)},E=l=>{r(l),t("generate")},Y=async(l,j)=>{if(l)try{const _=await(await fetch(l)).blob(),W=URL.createObjectURL(_),C=document.createElement("a");C.href=W,C.download=`miragic-${Date.now()}.jpg`,C.style.display="none",document.body.appendChild(C),C.click(),setTimeout(()=>{URL.revokeObjectURL(W),document.body.removeChild(C)},100)}catch(D){console.error("Download failed:",D)}},O=l=>{if(!l)return"";if(typeof l=="string")try{return l}catch{return l}try{return l instanceof Date?l.toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):new Date(l).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return"Unknown date"}},ie=async l=>{if(n)try{await Yt(n.uid,l.imageId),g(j=>j.filter(D=>D.imageId!==l.imageId)),m(null)}catch(j){console.error("Error deleting cloud image:",j)}},A=p==="cloud"?d.map(l=>({id:l.imageId||l.id,imageId:l.imageId,prompt:l.prompt,imageUrl:l.imageURL,timestamp:O(l.createdAt),model:l.modelUsed,dimensions:`${l.width||0}x${l.height||0}`,path:l.path,isCloud:!0})):s,Z={default:3,1280:3,1024:2,768:2,640:1},$={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}},q={hidden:{y:20,opacity:0},show:{y:0,opacity:1}};return e.jsxs("div",{className:"space-y-8",children:[e.jsx(H,{className:"border-slate-300 dark:border-white/10 p-5",children:e.jsxs("div",{className:"flex flex-col md:flex-row items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(he,{className:"w-5 h-5 text-purple-500"}),e.jsx("h2",{className:"text-xl font-semibold text-slate-800 dark:text-white",children:"Image History"})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[n&&e.jsxs("div",{className:"bg-slate-100 dark:bg-slate-800 rounded-full p-1 flex",children:[e.jsx("button",{className:F("px-4 py-1 rounded-full text-sm font-medium transition-all",p==="local"?"bg-white dark:bg-slate-700 text-slate-800 dark:text-white shadow-sm":"text-slate-600 dark:text-slate-300 hover:text-slate-800 dark:hover:text-white"),onClick:()=>y("local"),children:"Local"}),e.jsxs("button",{className:F("px-4 py-1 rounded-full text-sm font-medium transition-all flex items-center gap-1",p==="cloud"?"bg-white dark:bg-slate-700 text-slate-800 dark:text-white shadow-sm":"text-slate-600 dark:text-slate-300 hover:text-slate-800 dark:hover:text-white"),onClick:()=>y("cloud"),children:[e.jsx(Ne,{size:14}),"Cloud"]})]}),p==="local"&&s.length>0&&e.jsx(M,{variant:"destructive",size:"sm",onClick:()=>m("all"),icon:Ce,children:"Clear All"})]})]})}),w&&e.jsx("div",{className:"flex justify-center my-12",children:e.jsxs("div",{className:"space-y-4 text-center",children:[e.jsx("div",{className:"w-10 h-10 border-4 border-purple-500/30 border-t-purple-500 rounded-full animate-spin mx-auto"}),e.jsx("p",{className:"text-slate-600 dark:text-slate-300",children:"Loading your images..."})]})}),!w&&A.length===0&&e.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:e.jsx(H,{className:"text-center max-w-md mx-auto",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-gradient-to-br from-purple-500/20 to-pink-500/20 flex items-center justify-center mx-auto",children:p==="cloud"?e.jsx(Ne,{className:"w-8 h-8 text-purple-400"}):e.jsx(he,{className:"w-8 h-8 text-purple-400"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-xl font-semibold text-slate-800 dark:text-white mb-2",children:p==="cloud"?"No Cloud Images":"No History Yet"}),e.jsx("p",{className:"text-slate-600 dark:text-white/60 leading-relaxed",children:p==="cloud"?"Images you generate while logged in will be saved to your cloud history.":"Your generated images will appear here. Start creating to build your collection!"})]}),e.jsx(M,{onClick:()=>t("generate"),variant:"primary",children:"Generate an Image"})]})})}),!w&&A.length>0&&e.jsx(f.div,{variants:$,initial:"hidden",animate:"show",className:"overflow-hidden",children:e.jsx(it,{breakpointCols:Z,className:"masonry-grid",columnClassName:"masonry-grid-column",children:A.map(l=>e.jsx(f.div,{variants:q,className:"masonry-item",children:e.jsx("div",{className:"break-inside-avoid rounded-xl overflow-hidden relative group",children:e.jsxs("div",{className:"relative",children:[e.jsx("img",{src:l.imageUrl,alt:l.prompt,className:"w-full h-auto object-contain transition-transform duration-300 ease-in-out group-hover:scale-105",onClick:()=>k(l),onError:j=>{j.target.onerror=null,j.target.src="https://via.placeholder.com/400x225?text=Image+Unavailable"}}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/60 to-transparent opacity-0 group-hover:opacity-100 transition-opacity flex items-end justify-end p-3",children:e.jsx("div",{className:"flex items-center gap-1",children:e.jsx("button",{className:"bg-white/20 hover:bg-white/30 text-white p-2 rounded-full flex items-center justify-center transition-all",onClick:j=>{j.stopPropagation(),k(l)},children:e.jsx(nt,{size:14})})})})]})})},l.id))})}),e.jsx(U,{children:o&&e.jsx(f.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-50 flex items-center justify-center p-4 md:p-6 bg-black/80 backdrop-blur",onClick:N,children:e.jsxs(f.div,{initial:{scale:.9,opacity:0,y:10},animate:{scale:1,opacity:1,y:0},exit:{scale:.9,opacity:0,y:10},className:"relative max-w-4xl w-full bg-white dark:bg-slate-900 rounded-xl overflow-hidden shadow-2xl mx-auto border border-white/10",onClick:l=>l.stopPropagation(),children:[e.jsxs("div",{className:"flex justify-between items-center p-4 border-b border-slate-200 dark:border-slate-700",children:[e.jsx("h3",{className:"text-lg font-semibold text-slate-900 dark:text-white line-clamp-1",children:o.prompt}),e.jsx("button",{onClick:N,className:"p-1 rounded-full hover:bg-slate-100 dark:hover:bg-slate-800 text-slate-500",children:e.jsx(ot,{size:20})})]}),e.jsxs("div",{className:"p-2 md:p-6 flex flex-col md:flex-row gap-6",children:[e.jsx("div",{className:"flex-1",children:e.jsx("div",{className:"rounded-lg overflow-hidden bg-slate-200 dark:bg-slate-800/50 flex items-center justify-center",children:e.jsx("img",{src:o.imageUrl,alt:o.prompt,className:"w-full h-auto object-contain max-h-[70vh]",onError:l=>{l.target.onerror=null,l.target.src="https://via.placeholder.com/800x450?text=Image+Unavailable"}})})}),e.jsxs("div",{className:"w-full md:w-72 space-y-4",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400",children:"Prompt"}),e.jsx("p",{className:"text-sm text-slate-900 dark:text-white",children:o.prompt||"No prompt available"})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400",children:"Model"}),e.jsx("p",{className:"text-sm text-slate-900 dark:text-white",children:o.model||"Flux"})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400",children:"Dimensions"}),e.jsx("p",{className:"text-sm text-slate-900 dark:text-white",children:o.dimensions||"1024x1024"})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400",children:"Generated on"}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(lt,{size:14,className:"text-slate-500 dark:text-slate-400"}),e.jsx("p",{className:"text-sm text-slate-900 dark:text-white",children:o.timestamp})]})]})]}),e.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[e.jsx(M,{variant:"primary",size:"sm",onClick:()=>E(o.prompt),icon:dt,children:"Use This Prompt"}),e.jsx(M,{variant:"secondary",size:"sm",onClick:()=>Y(o.imageUrl,o.prompt),icon:_e,children:"Download Image"}),e.jsx(M,{variant:"destructive",size:"sm",onClick:l=>{l.stopPropagation(),N(),m(o.id)},icon:Ce,children:"Delete Image"})]})]})]})]})})}),e.jsx(U,{children:u&&e.jsx(f.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/70 backdrop-blur",onClick:()=>m(null),children:e.jsx(f.div,{initial:{scale:.95,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.95,opacity:0},className:"relative max-w-md w-full bg-white dark:bg-slate-900 rounded-xl overflow-hidden shadow-2xl",onClick:l=>l.stopPropagation(),children:e.jsxs("div",{className:"p-6 text-center",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-red-100 dark:bg-red-900/20 flex items-center justify-center mx-auto mb-4",children:e.jsx(ct,{className:"h-6 w-6 text-red-500"})}),e.jsx("h3",{className:"text-lg font-medium text-slate-900 dark:text-white mb-2",children:u==="all"?"Clear All History":"Delete This Image"}),e.jsx("p",{className:"text-slate-500 dark:text-slate-300 mb-6",children:u==="all"?"Are you sure you want to clear your entire generation history? This action cannot be undone.":"Are you sure you want to delete this image from your history? This action cannot be undone."}),e.jsxs("div",{className:"flex justify-center gap-3",children:[e.jsx(M,{variant:"outline",onClick:()=>m(null),children:"Cancel"}),e.jsx(M,{variant:"destructive",onClick:()=>{if(u==="all")p==="local"?i():p==="cloud"&&n&&console.log("Bulk cloud deletion not supported");else{const l=A.find(j=>j.id===u);l&&(p==="local"||!l.isCloud?a(u):p==="cloud"&&l.isCloud&&ie(l))}m(null)},children:"Delete"})]})]})})})})]})});Ue.displayName="ModernMasonryHistoryTab";const qt=L.memo(()=>e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsxs("div",{className:"space-y-4 text-center",children:[e.jsx("div",{className:"w-8 h-8 border-4 border-purple-500/30 border-t-purple-500 rounded-full animate-spin mx-auto"}),e.jsx("p",{className:"text-slate-600 dark:text-white/60 text-sm",children:"Loading..."})]})}));qt.displayName="TabLoader";function Wt({authContext:s}){const[r,t]=c.useState(""),[a,i]=c.useState(null),[n,o]=c.useState(!1),[h,u]=c.useState(!1),[m,d]=c.useState(null),[g,w]=c.useState(0),[x,p]=c.useState("generate"),[y,v]=c.useState("flux"),[k,N]=c.useState("landscape"),[E,Y]=c.useState(""),[O,ie]=c.useState(!0),[A,Z]=c.useState(1024),[$,q]=c.useState(1024),[l,j]=c.useState(!1),{isDarkMode:D,toggleTheme:_}=kt(),[W,C,ge]=Nt("miragic-history",[]),ne=c.useMemo(()=>({landscape:{width:1344,height:768,label:"Landscape (16:9)"},portrait:{width:768,height:1344,label:"Portrait (9:16)"},square:{width:1024,height:1024,label:"Square (1:1)"},wide:{width:1536,height:640,label:"Wide (21:9)"},story:{width:576,height:1024,label:"Story (9:16)"},manual:{width:1024,height:1024,label:"Manual"}}),[]),xe=c.useMemo(()=>[{value:"flux",label:"Flux (Best Quality)"},{value:"turbo",label:"Turbo (Fastest)"},{value:"kontext",label:"Kontext (Artistic)"}],[]),be=c.useCallback(()=>{w(0);const P=setInterval(()=>{w(B=>B>=95?(clearInterval(P),95):B+Math.random()*15)},300);return P},[]),we=c.useCallback(async()=>{if(!r.trim()){alert("Please enter a prompt!");return}if(!await s.spendCredit()){s.user,d("You don't have enough credits. Please sign up at Miragic.ai for unlimited access to all our AI tools!");return}o(!0),d(null),u(!1);const B=be();try{const Q=encodeURIComponent(r.trim());let K,oe;if(k==="manual")K=A,oe=$;else{const le=ne[k];K=le.width,oe=le.height}const $e=E||Math.floor(Math.random()*1e3);let de=`https://image.pollinations.ai/prompt/${Q}?width=${K}&height=${oe}&model=${y}&enhance=true&seed=${$e}`;O&&(de+="&nologo=true"),i(de),w(100);const Be={id:Date.now(),prompt:r.trim(),imageUrl:de,timestamp:new Date().toLocaleString(),model:y,shape:k,dimensions:`${K}x${oe}`};C(le=>[Be,...le.slice(0,100)]),clearInterval(B);const Ge=setTimeout(()=>{o(!1),w(0)},8e3);window.imageLoadTimeout=Ge}catch(Q){d(Q.message),o(!1),u(!1),w(0),clearInterval(B)}},[r,y,k,E,O,A,$,ne,be,C]),ye=c.useCallback(()=>{u(!0),o(!1),w(0),window.imageLoadTimeout&&(clearTimeout(window.imageLoadTimeout),window.imageLoadTimeout=null)},[]),ve=c.useCallback(()=>{d("Failed to load the generated image"),o(!1),u(!1),w(0),window.imageLoadTimeout&&(clearTimeout(window.imageLoadTimeout),window.imageLoadTimeout=null)},[]);c.useCallback(P=>{t(P.prompt),i(P.imageUrl),p("generate")},[]);const je=c.useCallback((P,B)=>{B?.stopPropagation(),C(Q=>Q.filter(K=>K.id!==P))},[C]),ke=c.useCallback(()=>{ge()},[ge]),Oe=c.useMemo(()=>{switch(x){case"generate":return e.jsx("div",{children:e.jsx(Le,{inputPrompt:r,setInputPrompt:t,imageUrl:a,isLoading:n,imageLoaded:h,error:m,progress:g,selectedModel:y,setSelectedModel:v,selectedShape:k,setSelectedShape:N,seed:E,setSeed:Y,width:A,height:$,setWidth:Z,setHeight:q,shapes:ne,models:xe,handleGenerateClick:we,handleImageLoadComplete:ye,handleImageLoadError:ve,isGeneratingRandom:l})});case"history":return e.jsx(Ue,{history:W,setInputPrompt:t,setActiveTab:p,handleDeleteHistoryItem:je,handleClearAllHistory:ke});default:return null}},[x,r,a,n,h,m,g,y,k,E,O,A,$,ne,xe,W,l,we,ye,ve,je,ke,v,N,Y,ie,Z,q]);return e.jsxs("div",{className:"min-h-screen w-full overflow-x-hidden bg-white dark:bg-slate-950 text-slate-900 dark:text-white font-sans transition-colors duration-300",children:[e.jsx(Pt,{isDarkMode:D,onThemeChange:_}),e.jsx(Ot,{}),e.jsx("main",{className:"relative -translate-y-[30vh] w-full",children:e.jsxs("div",{className:"container mx-auto px-6 w-full",children:[e.jsx("div",{className:"flex justify-center mb-12",children:e.jsx(Bt,{activeTab:x,onTabChange:p,historyCount:W.length})}),e.jsx(U,{mode:"wait",children:e.jsx(f.div,{className:"w-full",initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{duration:.3},children:Oe},x)})]})}),e.jsx($t,{})]})}function Kt(){const s=ae();return c.useEffect(()=>{s.user&&s.loading},[s.user,s.loading]),e.jsx(e.Fragment,{children:e.jsx(Wt,{authContext:s})})}function Jt(){return e.jsx(Mt,{children:e.jsx(Kt,{})})}let pe=null,Ee=!1;const Xt=()=>{if(pe)return pe;const s=document.createElement("div");s.id="miragic-background",s.style.cssText=` + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: -10; + overflow: hidden; + pointer-events: none; + `;const r=document.createElement("div");r.style.cssText=` + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: linear-gradient(135deg, #0f172a 0%, rgba(88, 28, 135, 0.2) 50%, #0f172a 100%); + `,s.appendChild(r);const t=document.createElement("div");t.style.cssText=` + position: absolute; + top: 0; + left: 0; + width: 18rem; + height: 18rem; + background: rgba(168, 85, 247, 0.3); + border-radius: 50%; + mix-blend-mode: multiply; + filter: blur(40px); + transform: translate(-25%, -25%); + animation: float1 20s ease-in-out infinite; + `;const a=document.createElement("div");a.style.cssText=` + position: absolute; + top: 0; + right: 0; + width: 18rem; + height: 18rem; + background: rgba(34, 197, 94, 0.3); + border-radius: 50%; + mix-blend-mode: multiply; + filter: blur(40px); + transform: translate(25%, -25%); + animation: float2 25s ease-in-out infinite; + `;const i=document.createElement("div");i.style.cssText=` + position: absolute; + bottom: -2rem; + left: 5rem; + width: 18rem; + height: 18rem; + background: rgba(236, 72, 153, 0.3); + border-radius: 50%; + mix-blend-mode: multiply; + filter: blur(40px); + animation: float3 30s ease-in-out infinite; + `,s.appendChild(t),s.appendChild(a),s.appendChild(i);for(let n=0;n<20;n++){const o=document.createElement("div"),h=Math.random()*100,u=Math.random()*100,m=10+Math.random()*10,d=Math.random()*10;o.style.cssText=` + position: absolute; + left: ${h}%; + top: ${u}%; + width: 0.5rem; + height: 0.5rem; + background: rgba(255, 255, 255, 0.1); + border-radius: 50%; + animation: particle${n} ${m}s ease-in-out infinite; + animation-delay: ${d}s; + `,s.appendChild(o)}return pe=s,s},Zt=()=>{if(document.getElementById("miragic-bg-styles"))return;const s=document.createElement("style");s.id="miragic-bg-styles",s.textContent=` + @keyframes float1 { + 0%, 100% { transform: translate(-25%, -25%) translate(0, 0); } + 50% { transform: translate(-25%, -25%) translate(50px, -25px); } + } + @keyframes float2 { + 0%, 100% { transform: translate(25%, -25%) translate(0, 0); } + 50% { transform: translate(25%, -25%) translate(-50px, 25px); } + } + @keyframes float3 { + 0%, 100% { transform: translate(0, 0); } + 50% { transform: translate(-50px, -100px); } + } + ${Array.from({length:20},(r,t)=>` + @keyframes particle${t} { + 0%, 100% { transform: translateY(0); opacity: 0; } + 50% { transform: translateY(-100px); opacity: 1; } + } + `).join("")} + `,document.head.appendChild(s)},Pe=c.memo(()=>{const s=c.useRef(null);return c.useEffect(()=>{if(Ee)return;Ee=!0,Zt();const r=Xt();return document.body.firstChild?document.body.insertBefore(r,document.body.firstChild):document.body.appendChild(r),()=>{}},[]),e.jsx("div",{ref:s,style:{display:"none"}})});Pe.displayName="AnimatedBackground";const Qt=L.memo(Pe,()=>!0),ze=L.memo(()=>e.jsx(Qt,{}),()=>!0);ze.displayName="MemoizedBackground";const Fe=window.fetch,es=window.XMLHttpRequest,ts=console.log,ss=console.error,rs=console.debug;async function as(s,r={}){try{let t,a=!1;if(typeof s=="string")a=/api|key|token|secret|auth|password|credential|firebase|firestore|pollinations/i.test(s),t=s.replace(/https?:\/\/([^\/]+)\/.*/,"https://$1/****");else if(s instanceof Request)try{s.url?(a=/api|key|token|secret|auth|password|credential|firebase|firestore|pollinations/i.test(s.url),t=s.url.replace(/https?:\/\/([^\/]+)\/.*/,"https://$1/****")):t="Firebase request"}catch{t="Firebase request"}else t="Internal request";return await Fe(s,r)}catch(t){throw t}}function is(){window._secureConsoleSetup||(window._secureConsoleSetup=!0,console.log=function(...s){if(s.some(t=>typeof t=="string"&&(t.includes("firebase")||t.includes("firestore")||t.includes("User document")||t.includes("credits")||t.includes("Fetching credits")||t.includes("User logged in")||t.includes("User ID")||t.includes("pollinations.ai")||t.includes("API_URL")||t.includes("api.")||t.includes("API URL"))))return;const r=s.map(t=>typeof t=="string"?t.includes("pollinations.ai")||t.includes("image.pollinations.ai")?t.replace(/https?:\/\/[^\s"']*pollinations\.ai[^\s"']*/gi,"[IMAGE API URL HIDDEN]"):t.replace(/(https?:\/\/[^\s"']*)(api|key|token|secret|auth|password|credential|firebase|firestore)/gi,"$1****"):t);ts.apply(console,r)},console.error=function(...s){if(s.some(t=>typeof t=="string"&&(t.includes("firebase")||t.includes("firestore")||t.includes("WebChannelConnection")||t.includes("url.replace")||t.includes("Error making request")||t.includes("pollinations.ai")||t.includes("API_URL")||t.includes("api.")||t.includes("API URL"))))return;const r=s.map(t=>typeof t=="string"?t.includes("pollinations.ai")||t.includes("image.pollinations.ai")?t.replace(/https?:\/\/[^\s"']*pollinations\.ai[^\s"']*/gi,"[IMAGE API URL HIDDEN]"):t.replace(/(https?:\/\/[^\s"']*)(api|key|token|secret|auth|password|credential|firebase|firestore)/gi,"$1****"):t);ss.apply(console,r)},console.debug=function(...s){if(s.some(t=>typeof t=="string"&&(t.includes("pollinations.ai")||t.includes("API_URL")||t.includes("api.")||t.includes("API URL"))))return;const r=s.map(t=>typeof t=="string"?t.includes("pollinations.ai")||t.includes("image.pollinations.ai")?t.replace(/https?:\/\/[^\s"']*pollinations\.ai[^\s"']*/gi,"[IMAGE API URL HIDDEN]"):t.replace(/(https?:\/\/[^\s"']*)(api|key|token|secret|auth|password|credential|firebase|firestore)/gi,"$1****"):t);rs.apply(console,r)},window.fetch=function(s,r){return typeof s=="object"&&s instanceof Request||typeof s=="string"&&s.includes("firestore")?Fe(s,r):as(s,r)},window.XMLHttpRequest=class extends es{open(s,r,...t){this._secureUrl=r;try{if(typeof r=="string"&&!(r.includes("firestore")||r.includes("firebase"))){const a=r.replace(/https?:\/\/([^\/]+)\/.*/,"https://$1/****")}}catch{}super.open(s,r,...t)}})}console.log=()=>{},console.debug=()=>{},console.info=()=>{};is();mt.createRoot(document.getElementById("root")).render(e.jsxs(e.Fragment,{children:[e.jsx(ze,{},"persistent-background"),e.jsx(c.StrictMode,{children:e.jsx(Jt,{})})]})); diff --git a/assets/index-DfLbT_5b.css b/assets/index-DfLbT_5b.css new file mode 100644 index 0000000000000000000000000000000000000000..5c7dd5d3de38a53f6327479a0c07712ec1d2c61b --- /dev/null +++ b/assets/index-DfLbT_5b.css @@ -0,0 +1 @@ +*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Montserrat,system-ui,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:Roboto Mono,ui-monospace,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--background: 0 0% 100%;--foreground: 240 10% 3.9%;--card: 0 0% 100%;--card-foreground: 240 10% 3.9%;--popover: 0 0% 100%;--popover-foreground: 240 10% 3.9%;--primary: 240 5.9% 10%;--primary-foreground: 0 0% 98%;--secondary: 240 4.8% 95.9%;--secondary-foreground: 240 5.9% 10%;--muted: 240 4.8% 95.9%;--muted-foreground: 240 3.8% 46.1%;--accent: 240 4.8% 95.9%;--accent-foreground: 240 5.9% 10%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 0 0% 98%;--border: 240 5.9% 90%;--input: 240 5.9% 90%;--ring: 240 10% 3.9%;--chart-1: 12 76% 61%;--chart-2: 173 58% 39%;--chart-3: 197 37% 24%;--chart-4: 43 74% 66%;--chart-5: 27 87% 67%;--radius: .5rem}.dark{--background: 240 10% 3.9%;--foreground: 0 0% 98%;--card: 240 10% 3.9%;--card-foreground: 0 0% 98%;--popover: 240 10% 3.9%;--popover-foreground: 0 0% 98%;--primary: 0 0% 98%;--primary-foreground: 240 5.9% 10%;--secondary: 240 3.7% 15.9%;--secondary-foreground: 0 0% 98%;--muted: 240 3.7% 15.9%;--muted-foreground: 240 5% 64.9%;--accent: 240 3.7% 15.9%;--accent-foreground: 0 0% 98%;--destructive: 0 62.8% 30.6%;--destructive-foreground: 0 0% 98%;--border: 240 3.7% 15.9%;--input: 240 3.7% 15.9%;--ring: 240 4.9% 83.9%;--chart-1: 220 70% 50%;--chart-2: 160 60% 45%;--chart-3: 30 80% 55%;--chart-4: 280 65% 60%;--chart-5: 340 75% 55%}*{border-color:hsl(var(--border))}html{overflow-x:hidden;scroll-behavior:smooth;font-family:Montserrat,sans-serif}body{background-color:hsl(var(--background));color:hsl(var(--foreground));overflow-x:hidden;width:100%;position:relative;-webkit-overflow-scrolling:touch;font-family:Montserrat,sans-serif;font-optical-sizing:auto;font-weight:400;font-style:normal}#root{overflow-x:hidden;width:100%;min-height:100vh;font-family:Montserrat,sans-serif}h1,h2,h3,h4,h5,h6{font-family:Montserrat,sans-serif;font-optical-sizing:auto;font-weight:600;font-style:normal}p,span,div,label,input,textarea,select,button{font-family:Montserrat,sans-serif;font-optical-sizing:auto;font-style:normal}code,pre{font-family:Roboto Mono,monospace}button,[role=button]{touch-action:manipulation;font-family:Montserrat,sans-serif}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.inset-2{inset:.5rem}.-right-1{right:-.25rem}.-right-2{right:-.5rem}.-top-1{top:-.25rem}.-top-2{top:-.5rem}.bottom-0{bottom:0}.bottom-1{bottom:.25rem}.left-0{left:0}.left-2{left:.5rem}.left-3{left:.75rem}.right-0{right:0}.right-2{right:.5rem}.top-0{top:0}.top-1{top:.25rem}.top-1\/2{top:50%}.-z-10{z-index:-10}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.z-\[10000\]{z-index:10000}.z-\[9999\]{z-index:9999}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-12{margin-top:3rem;margin-bottom:3rem}.my-4{margin-top:1rem;margin-bottom:1rem}.mb-1{margin-bottom:.25rem}.mb-12{margin-bottom:3rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mt-0\.5{margin-top:.125rem}.mt-2{margin-top:.5rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.hidden{display:none}.h-1{height:.25rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-16{height:4rem}.h-2{height:.5rem}.h-20{height:5rem}.h-3{height:.75rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-56{height:14rem}.h-6{height:1.5rem}.h-64{height:16rem}.h-8{height:2rem}.h-\[50rem\]{height:50rem}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.max-h-\[70vh\]{max-height:70vh}.max-h-full{max-height:100%}.min-h-\[2rem\]{min-height:2rem}.min-h-\[400px\]{min-height:400px}.min-h-screen{min-height:100vh}.w-1{width:.25rem}.w-10{width:2.5rem}.w-12{width:3rem}.w-16{width:4rem}.w-20{width:5rem}.w-3{width:.75rem}.w-4{width:1rem}.w-40{width:10rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-8{width:2rem}.w-auto{width:auto}.w-full{width:100%}.min-w-\[80px\]{min-width:80px}.max-w-2xl{max-width:42rem}.max-w-4xl{max-width:56rem}.max-w-\[768px\]{max-width:768px}.max-w-full{max-width:100%}.max-w-md{max-width:28rem}.max-w-sm{max-width:24rem}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-\[20vh\]{--tw-translate-y: -20vh;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-\[30vh\]{--tw-translate-y: -30vh;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-110{--tw-scale-x: 1.1;--tw-scale-y: 1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes shimmer{0%{transform:translate(-100%)}to{transform:translate(100%)}}.animate-shimmer{animation:shimmer 2s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.touch-manipulation{touch-action:manipulation}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.resize{resize:both}.break-inside-avoid{-moz-column-break-inside:avoid;break-inside:avoid}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0px}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.25rem * var(--tw-space-x-reverse));margin-left:calc(.25rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-3>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.75rem * var(--tw-space-x-reverse));margin-left:calc(.75rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.whitespace-pre-line{white-space:pre-line}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-2{border-width:2px}.border-4{border-width:4px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-r{border-right-width:1px}.border-blue-200{--tw-border-opacity: 1;border-color:rgb(191 219 254 / var(--tw-border-opacity, 1))}.border-current{border-color:currentColor}.border-purple-200{--tw-border-opacity: 1;border-color:rgb(233 213 255 / var(--tw-border-opacity, 1))}.border-purple-200\/20{border-color:#e9d5ff33}.border-purple-400{--tw-border-opacity: 1;border-color:rgb(192 132 252 / var(--tw-border-opacity, 1))}.border-purple-400\/30{border-color:#c084fc4d}.border-purple-400\/50{border-color:#c084fc80}.border-purple-500\/20{border-color:#a855f733}.border-purple-500\/30{border-color:#a855f74d}.border-purple-500\/50{border-color:#a855f780}.border-purple-600{--tw-border-opacity: 1;border-color:rgb(147 51 234 / var(--tw-border-opacity, 1))}.border-purple-600\/30{border-color:#9333ea4d}.border-red-500\/20{border-color:#ef444433}.border-red-500\/30{border-color:#ef44444d}.border-red-500\/50{border-color:#ef444480}.border-slate-200{--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity, 1))}.border-slate-200\/20{border-color:#e2e8f033}.border-slate-300{--tw-border-opacity: 1;border-color:rgb(203 213 225 / var(--tw-border-opacity, 1))}.border-slate-300\/30{border-color:#cbd5e14d}.border-slate-300\/50{border-color:#cbd5e180}.border-white{--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1))}.border-white\/10{border-color:#ffffff1a}.border-white\/20{border-color:#fff3}.border-white\/5{border-color:#ffffff0d}.border-yellow-500\/30{border-color:#eab3084d}.border-t-purple-500{--tw-border-opacity: 1;border-top-color:rgb(168 85 247 / var(--tw-border-opacity, 1))}.border-t-purple-600{--tw-border-opacity: 1;border-top-color:rgb(147 51 234 / var(--tw-border-opacity, 1))}.border-t-transparent{border-top-color:transparent}.bg-\[rgba\(30\,41\,59\,0\.75\)\]{background-color:#1e293bbf}.bg-black\/30{background-color:#0000004d}.bg-black\/50{background-color:#00000080}.bg-black\/70{background-color:#000000b3}.bg-black\/80{background-color:#000c}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-purple-50{--tw-bg-opacity: 1;background-color:rgb(250 245 255 / var(--tw-bg-opacity, 1))}.bg-purple-500{--tw-bg-opacity: 1;background-color:rgb(168 85 247 / var(--tw-bg-opacity, 1))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-500\/10{background-color:#ef44441a}.bg-red-500\/20{background-color:#ef444433}.bg-slate-100{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity, 1))}.bg-slate-100\/30{background-color:#f1f5f94d}.bg-slate-100\/50{background-color:#f1f5f980}.bg-slate-200{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.bg-slate-200\/30{background-color:#e2e8f04d}.bg-slate-200\/50{background-color:#e2e8f080}.bg-slate-300{--tw-bg-opacity: 1;background-color:rgb(203 213 225 / var(--tw-bg-opacity, 1))}.bg-slate-300\/50{background-color:#cbd5e180}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\/0{background-color:#fff0}.bg-white\/10{background-color:#ffffff1a}.bg-white\/20{background-color:#fff3}.bg-white\/5{background-color:#ffffff0d}.bg-white\/80{background-color:#fffc}.bg-yellow-500\/20{background-color:#eab30833}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.bg-gradient-to-t{background-image:linear-gradient(to top,var(--tw-gradient-stops))}.from-black\/60{--tw-gradient-from: rgb(0 0 0 / .6) var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-blue-50{--tw-gradient-from: #eff6ff var(--tw-gradient-from-position);--tw-gradient-to: rgb(239 246 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-cyan-500{--tw-gradient-from: #06b6d4 var(--tw-gradient-from-position);--tw-gradient-to: rgb(6 182 212 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-green-400{--tw-gradient-from: #4ade80 var(--tw-gradient-from-position);--tw-gradient-to: rgb(74 222 128 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-green-500{--tw-gradient-from: #22c55e var(--tw-gradient-from-position);--tw-gradient-to: rgb(34 197 94 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-neutral-200{--tw-gradient-from: #e5e5e5 var(--tw-gradient-from-position);--tw-gradient-to: rgb(229 229 229 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-orange-500{--tw-gradient-from: #f97316 var(--tw-gradient-from-position);--tw-gradient-to: rgb(249 115 22 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-pink-500{--tw-gradient-from: #ec4899 var(--tw-gradient-from-position);--tw-gradient-to: rgb(236 72 153 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-purple-400{--tw-gradient-from: #c084fc var(--tw-gradient-from-position);--tw-gradient-to: rgb(192 132 252 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-purple-500{--tw-gradient-from: #a855f7 var(--tw-gradient-from-position);--tw-gradient-to: rgb(168 85 247 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-purple-500\/10{--tw-gradient-from: rgb(168 85 247 / .1) var(--tw-gradient-from-position);--tw-gradient-to: rgb(168 85 247 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-purple-500\/15{--tw-gradient-from: rgb(168 85 247 / .15) var(--tw-gradient-from-position);--tw-gradient-to: rgb(168 85 247 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-purple-500\/20{--tw-gradient-from: rgb(168 85 247 / .2) var(--tw-gradient-from-position);--tw-gradient-to: rgb(168 85 247 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-purple-600{--tw-gradient-from: #9333ea var(--tw-gradient-from-position);--tw-gradient-to: rgb(147 51 234 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-purple-600\/80{--tw-gradient-from: rgb(147 51 234 / .8) var(--tw-gradient-from-position);--tw-gradient-to: rgb(147 51 234 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-slate-800{--tw-gradient-from: #1e293b var(--tw-gradient-from-position);--tw-gradient-to: rgb(30 41 59 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-transparent{--tw-gradient-from: transparent var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-white\/10{--tw-gradient-from: rgb(255 255 255 / .1) var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-yellow-500{--tw-gradient-from: #eab308 var(--tw-gradient-from-position);--tw-gradient-to: rgb(234 179 8 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.via-pink-600{--tw-gradient-to: rgb(219 39 119 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #db2777 var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-slate-600{--tw-gradient-to: rgb(71 85 105 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #475569 var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-white\/20{--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), rgb(255 255 255 / .2) var(--tw-gradient-via-position), var(--tw-gradient-to)}.to-blue-500{--tw-gradient-to: #3b82f6 var(--tw-gradient-to-position)}.to-cyan-600{--tw-gradient-to: #0891b2 var(--tw-gradient-to-position)}.to-emerald-500{--tw-gradient-to: #10b981 var(--tw-gradient-to-position)}.to-indigo-50{--tw-gradient-to: #eef2ff var(--tw-gradient-to-position)}.to-indigo-500{--tw-gradient-to: #6366f1 var(--tw-gradient-to-position)}.to-neutral-500{--tw-gradient-to: #737373 var(--tw-gradient-to-position)}.to-pink-500{--tw-gradient-to: #ec4899 var(--tw-gradient-to-position)}.to-pink-500\/10{--tw-gradient-to: rgb(236 72 153 / .1) var(--tw-gradient-to-position)}.to-pink-500\/15{--tw-gradient-to: rgb(236 72 153 / .15) var(--tw-gradient-to-position)}.to-pink-500\/20{--tw-gradient-to: rgb(236 72 153 / .2) var(--tw-gradient-to-position)}.to-pink-600{--tw-gradient-to: #db2777 var(--tw-gradient-to-position)}.to-pink-600\/80{--tw-gradient-to: rgb(219 39 119 / .8) var(--tw-gradient-to-position)}.to-red-500{--tw-gradient-to: #ef4444 var(--tw-gradient-to-position)}.to-slate-600{--tw-gradient-to: #475569 var(--tw-gradient-to-position)}.to-slate-700{--tw-gradient-to: #334155 var(--tw-gradient-to-position)}.to-transparent{--tw-gradient-to: transparent var(--tw-gradient-to-position)}.to-white\/5{--tw-gradient-to: rgb(255 255 255 / .05) var(--tw-gradient-to-position)}.bg-clip-text{-webkit-background-clip:text;background-clip:text}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-10{padding-left:2.5rem;padding-right:2.5rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-12{padding-bottom:3rem}.pl-10{padding-left:2.5rem}.pt-2{padding-top:.5rem}.pt-20{padding-top:5rem}.pt-4{padding-top:1rem}.pt-6{padding-top:1.5rem}.text-center{text-align:center}.font-sans{font-family:Montserrat,system-ui,sans-serif}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-\[10px\]{font-size:10px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-extrabold{font-weight:800}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.leading-relaxed{line-height:1.625}.tracking-wider{letter-spacing:.05em}.text-blue-400{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-green-400{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.text-purple-400{--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.text-purple-400\/60{color:#c084fc99}.text-purple-500{--tw-text-opacity: 1;color:rgb(168 85 247 / var(--tw-text-opacity, 1))}.text-purple-600{--tw-text-opacity: 1;color:rgb(147 51 234 / var(--tw-text-opacity, 1))}.text-purple-700{--tw-text-opacity: 1;color:rgb(126 34 206 / var(--tw-text-opacity, 1))}.text-purple-800{--tw-text-opacity: 1;color:rgb(107 33 168 / var(--tw-text-opacity, 1))}.text-red-200{--tw-text-opacity: 1;color:rgb(254 202 202 / var(--tw-text-opacity, 1))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-slate-300\/10{color:#cbd5e11a}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.text-slate-800{--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1))}.text-slate-900{--tw-text-opacity: 1;color:rgb(15 23 42 / var(--tw-text-opacity, 1))}.text-transparent{color:transparent}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-white\/80{color:#fffc}.text-yellow-200{--tw-text-opacity: 1;color:rgb(254 240 138 / var(--tw-text-opacity, 1))}.text-yellow-400{--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.text-yellow-500{--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity, 1))}.placeholder-slate-500::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(100 116 139 / var(--tw-placeholder-opacity, 1))}.placeholder-slate-500::placeholder{--tw-placeholder-opacity: 1;color:rgb(100 116 139 / var(--tw-placeholder-opacity, 1))}.opacity-0{opacity:0}.opacity-30{opacity:.3}.opacity-40{opacity:.4}.opacity-60{opacity:.6}.opacity-80{opacity:.8}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-purple-500\/20{--tw-shadow-color: rgb(168 85 247 / .2);--tw-shadow: var(--tw-shadow-colored)}.outline{outline-style:solid}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.blur-md{--tw-blur: blur(12px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur{--tw-backdrop-blur: blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-lg{--tw-backdrop-blur: blur(16px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-md{--tw-backdrop-blur: blur(12px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-xl{--tw-backdrop-blur: blur(24px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.will-change-transform{will-change:transform}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.duration-150{animation-duration:.15s}.duration-200{animation-duration:.2s}.duration-300{animation-duration:.3s}.duration-500{animation-duration:.5s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.ease-out{animation-timing-function:cubic-bezier(0,0,.2,1)}.\[-T\:Z\.\]{--t: Z.}.\[background-image\:radial-gradient\(\#d4d4d4_2px\,transparent_2px\)\]{background-image:radial-gradient(#d4d4d4 2px,transparent 2px)}.\[background-size\:40px_40px\]{background-size:40px 40px}.\[mask-image\:radial-gradient\(ellipse_at_center\,transparent_20\%\,black\)\]{-webkit-mask-image:radial-gradient(ellipse at center,transparent 20%,black);mask-image:radial-gradient(ellipse at center,transparent 20%,black)}*{-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}input,textarea,[contenteditable],.selectable{-webkit-user-select:text;-moz-user-select:text;user-select:text}html{scroll-behavior:smooth;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility;overscroll-behavior:none}img{image-rendering:-webkit-optimize-contrast;image-rendering:crisp-edges}.animate-spin,.animate-pulse,[class*=animate-]{will-change:transform;transform:translateZ(0)}.before\:absolute:before{content:var(--tw-content);position:absolute}.before\:inset-0:before{content:var(--tw-content);inset:0}.before\:rounded-2xl:before{content:var(--tw-content);border-radius:1rem}.before\:border:before{content:var(--tw-content);border-width:1px}.before\:border-slate-200\/40:before{content:var(--tw-content);border-color:#e2e8f066}.before\:bg-gradient-to-br:before{content:var(--tw-content);background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.before\:from-slate-200\/20:before{content:var(--tw-content);--tw-gradient-from: rgb(226 232 240 / .2) var(--tw-gradient-from-position);--tw-gradient-to: rgb(226 232 240 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.before\:to-transparent:before{content:var(--tw-content);--tw-gradient-to: transparent var(--tw-gradient-to-position)}.before\:opacity-50:before{content:var(--tw-content);opacity:.5}.hover\:scale-105:hover{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:border-purple-500:hover{--tw-border-opacity: 1;border-color:rgb(168 85 247 / var(--tw-border-opacity, 1))}.hover\:border-slate-400\/40:hover{border-color:#94a3b866}.hover\:border-slate-400\/60:hover{border-color:#94a3b899}.hover\:border-white\/30:hover{border-color:#ffffff4d}.hover\:bg-black\/70:hover{background-color:#000000b3}.hover\:bg-purple-50:hover{--tw-bg-opacity: 1;background-color:rgb(250 245 255 / var(--tw-bg-opacity, 1))}.hover\:bg-purple-500\/10:hover{background-color:#a855f71a}.hover\:bg-purple-600\/20:hover{background-color:#9333ea33}.hover\:bg-purple-600\/30:hover{background-color:#9333ea4d}.hover\:bg-slate-100:hover{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-200\/40:hover{background-color:#e2e8f066}.hover\:bg-slate-200\/60:hover{background-color:#e2e8f099}.hover\:bg-slate-200\/70:hover{background-color:#e2e8f0b3}.hover\:bg-slate-300\/40:hover{background-color:#cbd5e166}.hover\:bg-slate-400:hover{--tw-bg-opacity: 1;background-color:rgb(148 163 184 / var(--tw-bg-opacity, 1))}.hover\:bg-white:hover{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.hover\:bg-white\/30:hover{background-color:#ffffff4d}.hover\:from-purple-700:hover{--tw-gradient-from: #7e22ce var(--tw-gradient-from-position);--tw-gradient-to: rgb(126 34 206 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\:from-white\/20:hover{--tw-gradient-from: rgb(255 255 255 / .2) var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\:to-pink-700:hover{--tw-gradient-to: #be185d var(--tw-gradient-to-position)}.hover\:to-white\/10:hover{--tw-gradient-to: rgb(255 255 255 / .1) var(--tw-gradient-to-position)}.hover\:text-black:hover{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.hover\:text-blue-600:hover{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.hover\:text-blue-700:hover{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.hover\:text-gray-800:hover{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.hover\:text-orange-600:hover{--tw-text-opacity: 1;color:rgb(234 88 12 / var(--tw-text-opacity, 1))}.hover\:text-pink-600:hover{--tw-text-opacity: 1;color:rgb(219 39 119 / var(--tw-text-opacity, 1))}.hover\:text-purple-300:hover{--tw-text-opacity: 1;color:rgb(216 180 254 / var(--tw-text-opacity, 1))}.hover\:text-purple-600:hover{--tw-text-opacity: 1;color:rgb(147 51 234 / var(--tw-text-opacity, 1))}.hover\:text-purple-700:hover{--tw-text-opacity: 1;color:rgb(126 34 206 / var(--tw-text-opacity, 1))}.hover\:text-red-600:hover{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.hover\:text-slate-600:hover{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.hover\:text-slate-700:hover{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.hover\:text-slate-800:hover{--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1))}.hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.hover\:opacity-100:hover{opacity:1}.hover\:opacity-90:hover{opacity:.9}.hover\:shadow-2xl:hover{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-xl:hover{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-purple-500\/10:hover{--tw-shadow-color: rgb(168 85 247 / .1);--tw-shadow: var(--tw-shadow-colored)}.hover\:shadow-purple-500\/25:hover{--tw-shadow-color: rgb(168 85 247 / .25);--tw-shadow: var(--tw-shadow-colored)}.focus\:border-purple-500\/50:focus{border-color:#a855f780}.focus\:border-red-500\/50:focus{border-color:#ef444480}.focus\:bg-slate-200\/50:focus{background-color:#e2e8f080}.focus\:text-slate-800:focus{--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-purple-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(168 85 247 / var(--tw-ring-opacity, 1))}.focus\:ring-purple-500\/20:focus{--tw-ring-color: rgb(168 85 247 / .2)}.focus\:ring-purple-500\/50:focus{--tw-ring-color: rgb(168 85 247 / .5)}.focus\:ring-red-500\/20:focus{--tw-ring-color: rgb(239 68 68 / .2)}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus\:ring-offset-transparent:focus{--tw-ring-offset-color: transparent}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.disabled\:hover\:scale-100:hover:disabled{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:scale-105{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:opacity-100{opacity:1}.dark\:border-blue-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(30 64 175 / var(--tw-border-opacity, 1))}.dark\:border-purple-400:is(.dark *){--tw-border-opacity: 1;border-color:rgb(192 132 252 / var(--tw-border-opacity, 1))}.dark\:border-purple-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(107 33 168 / var(--tw-border-opacity, 1))}.dark\:border-slate-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity, 1))}.dark\:border-white\/10:is(.dark *){border-color:#ffffff1a}.dark\:border-white\/20:is(.dark *){border-color:#fff3}.dark\:bg-\[rgba\(15\,23\,42\,0\.75\)\]:is(.dark *){background-color:#0f172abf}.dark\:bg-black:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.dark\:bg-purple-900\/20:is(.dark *){background-color:#581c8733}.dark\:bg-red-900\/20:is(.dark *){background-color:#7f1d1d33}.dark\:bg-slate-700:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity, 1))}.dark\:bg-slate-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1))}.dark\:bg-slate-800\/50:is(.dark *){background-color:#1e293b80}.dark\:bg-slate-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1))}.dark\:bg-slate-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(2 6 23 / var(--tw-bg-opacity, 1))}.dark\:bg-white\/10:is(.dark *){background-color:#ffffff1a}.dark\:bg-white\/30:is(.dark *){background-color:#ffffff4d}.dark\:bg-white\/5:is(.dark *){background-color:#ffffff0d}.dark\:from-blue-900\/20:is(.dark *){--tw-gradient-from: rgb(30 58 138 / .2) var(--tw-gradient-from-position);--tw-gradient-to: rgb(30 58 138 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.dark\:from-purple-400:is(.dark *){--tw-gradient-from: #c084fc var(--tw-gradient-from-position);--tw-gradient-to: rgb(192 132 252 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.dark\:from-white:is(.dark *){--tw-gradient-from: #fff var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.dark\:via-pink-400:is(.dark *){--tw-gradient-to: rgb(244 114 182 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #f472b6 var(--tw-gradient-via-position), var(--tw-gradient-to)}.dark\:via-purple-200:is(.dark *){--tw-gradient-to: rgb(233 213 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #e9d5ff var(--tw-gradient-via-position), var(--tw-gradient-to)}.dark\:to-cyan-400:is(.dark *){--tw-gradient-to: #22d3ee var(--tw-gradient-to-position)}.dark\:to-indigo-900\/20:is(.dark *){--tw-gradient-to: rgb(49 46 129 / .2) var(--tw-gradient-to-position)}.dark\:to-pink-200:is(.dark *){--tw-gradient-to: #fbcfe8 var(--tw-gradient-to-position)}.dark\:to-white\/80:is(.dark *){--tw-gradient-to: rgb(255 255 255 / .8) var(--tw-gradient-to-position)}.dark\:text-blue-200:is(.dark *){--tw-text-opacity: 1;color:rgb(191 219 254 / var(--tw-text-opacity, 1))}.dark\:text-blue-300:is(.dark *){--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.dark\:text-gray-400:is(.dark *){--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.dark\:text-purple-200:is(.dark *){--tw-text-opacity: 1;color:rgb(233 213 255 / var(--tw-text-opacity, 1))}.dark\:text-purple-300:is(.dark *){--tw-text-opacity: 1;color:rgb(216 180 254 / var(--tw-text-opacity, 1))}.dark\:text-purple-400:is(.dark *){--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.dark\:text-slate-300:is(.dark *){--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.dark\:text-slate-400:is(.dark *){--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.dark\:text-white:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.dark\:text-white\/50:is(.dark *){color:#ffffff80}.dark\:text-white\/60:is(.dark *){color:#fff9}.dark\:text-white\/70:is(.dark *){color:#ffffffb3}.dark\:text-white\/80:is(.dark *){color:#fffc}.dark\:text-white\/90:is(.dark *){color:#ffffffe6}.dark\:placeholder-white\/50:is(.dark *)::-moz-placeholder{color:#ffffff80}.dark\:placeholder-white\/50:is(.dark *)::placeholder{color:#ffffff80}.dark\:opacity-60:is(.dark *){opacity:.6}.dark\:\[background-image\:radial-gradient\(\#404040_2px\,transparent_2px\)\]:is(.dark *){background-image:radial-gradient(#404040 2px,transparent 2px)}.dark\:before\:border-white\/20:is(.dark *):before{content:var(--tw-content);border-color:#fff3}.dark\:before\:from-white\/10:is(.dark *):before{content:var(--tw-content);--tw-gradient-from: rgb(255 255 255 / .1) var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.dark\:hover\:border-white\/20:hover:is(.dark *){border-color:#fff3}.dark\:hover\:border-white\/30:hover:is(.dark *){border-color:#ffffff4d}.dark\:hover\:bg-purple-900\/20:hover:is(.dark *){background-color:#581c8733}.dark\:hover\:bg-slate-800:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-white\/10:hover:is(.dark *){background-color:#ffffff1a}.dark\:hover\:bg-white\/20:hover:is(.dark *){background-color:#fff3}.dark\:hover\:bg-white\/50:hover:is(.dark *){background-color:#ffffff80}.dark\:hover\:text-blue-400:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.dark\:hover\:text-blue-500:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.dark\:hover\:text-cyan-300:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(103 232 249 / var(--tw-text-opacity, 1))}.dark\:hover\:text-orange-500:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(249 115 22 / var(--tw-text-opacity, 1))}.dark\:hover\:text-pink-400:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(244 114 182 / var(--tw-text-opacity, 1))}.dark\:hover\:text-purple-300:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(216 180 254 / var(--tw-text-opacity, 1))}.dark\:hover\:text-red-500:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.dark\:hover\:text-slate-300:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.dark\:hover\:text-white:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.dark\:focus\:bg-white\/10:focus:is(.dark *){background-color:#ffffff1a}.dark\:focus\:text-white:focus:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}@media (min-width: 620px){.min-\[620px\]\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@media (min-width: 640px){.sm\:block{display:block}.sm\:h-10{height:2.5rem}.sm\:h-12{height:3rem}.sm\:h-5{height:1.25rem}.sm\:w-10{width:2.5rem}.sm\:w-12{width:3rem}.sm\:w-5{width:1.25rem}.sm\:max-w-md{max-width:28rem}.sm\:gap-3{gap:.75rem}.sm\:px-4{padding-left:1rem;padding-right:1rem}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\:text-7xl{font-size:4.5rem;line-height:1}.sm\:text-sm{font-size:.875rem;line-height:1.25rem}.sm\:text-xl{font-size:1.25rem;line-height:1.75rem}}@media (min-width: 768px){.md\:w-72{width:18rem}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:p-6{padding:1.5rem}.md\:text-3xl{font-size:1.875rem;line-height:2.25rem}.md\:text-6xl{font-size:3.75rem;line-height:1}.md\:text-xl{font-size:1.25rem;line-height:1.75rem}}@media (min-width: 1024px){.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:text-5xl{font-size:3rem;line-height:1}.lg\:text-7xl{font-size:4.5rem;line-height:1}}.masonry-grid{display:flex;width:auto;margin-left:-16px}.masonry-grid-column{padding-left:16px;background-clip:padding-box;width:100%}.masonry-item{margin-bottom:16px;-moz-column-break-inside:avoid;break-inside:avoid}.masonry-image-container{position:relative;overflow:hidden;border-radius:8px;background:#0000000d}.masonry-image{width:100%;height:auto;display:block;transition:transform .3s ease}.masonry-image-container:hover .masonry-image{transform:scale(1.03)}.masonry-overlay{position:absolute;inset:0;background:#0006;opacity:0;transition:opacity .3s ease;display:flex;align-items:flex-end;padding:16px}.masonry-image-container:hover .masonry-overlay{opacity:1}.masonry-placeholder{position:absolute;inset:0;background-color:#0000001a;display:flex;align-items:center;justify-content:center}@supports (-webkit-appearance:none){.masonry-grid{width:calc(100% + 16px)}}.masonry-fade-in{animation:fadeIn .5s ease}@keyframes fadeIn{0%{opacity:0}to{opacity:1}} diff --git a/assets/logo/logo.jpg b/assets/logo/logo.jpg new file mode 100644 index 0000000000000000000000000000000000000000..83ef0514d5bf928656c521400192622e930e29d4 Binary files /dev/null and b/assets/logo/logo.jpg differ diff --git a/assets/ui-BjUdCpih.js b/assets/ui-BjUdCpih.js new file mode 100644 index 0000000000000000000000000000000000000000..c24c061e15d434b1501b4b02f63fd5ee258f4dc8 --- /dev/null +++ b/assets/ui-BjUdCpih.js @@ -0,0 +1,9 @@ +import{r as p,j as k}from"./vendor-CjHduoA4.js";import{i as ii,a as Ht,t as Q,b as Gt,g as on,n as rn,c as D,p as nt,m as V,d as Z,K as si,e as zt,f as S,h as $,j as oi,k as ri,l as ai,q as jt,r as li,S as an,s as Kt,D as ui,u as ci,v as hi,w as fi,M as pt,x as _t,y as ft,z as ce,J as di,A as mi,B as pi,C as ln,E as L,F as un,G as gi,H as Bt,I as cn,L as yi,N as gt,O as Y,P as hn,Q as fn,R as vi,T as xi,U as Pi,V as Vt,W as Ti,X as Si}from"./vendor-other-B0VykD61.js";const Xt=p.createContext({});function Yt(t){const e=p.useRef(null);return e.current===null&&(e.current=t()),e.current}const qt=typeof window<"u",dn=qt?p.useLayoutEffect:p.useEffect,xt=p.createContext(null),Zt=p.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});class Vi extends p.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(n&&e.isPresent&&!this.props.isPresent){const i=n.offsetParent,o=ii(i)&&i.offsetWidth||0,r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft,r.right=o-r.width-r.left}return null}componentDidUpdate(){}render(){return this.props.children}}function Ci({children:t,isPresent:e,anchorX:n,root:i}){const o=p.useId(),r=p.useRef(null),s=p.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:a}=p.useContext(Zt);return p.useInsertionEffect(()=>{const{width:l,height:c,top:u,left:h,right:f}=s.current;if(e||!r.current||!l||!c)return;const d=n==="left"?`left: ${h}`:`right: ${f}`;r.current.dataset.motionPopId=o;const m=document.createElement("style");a&&(m.nonce=a);const x=i??document.head;return x.appendChild(m),m.sheet&&m.sheet.insertRule(` + [data-motion-pop-id="${o}"] { + position: absolute !important; + width: ${l}px !important; + height: ${c}px !important; + ${d}px !important; + top: ${u}px !important; + } + `),()=>{x.contains(m)&&x.removeChild(m)}},[e]),k.jsx(Vi,{isPresent:e,childRef:r,sizeRef:s,children:p.cloneElement(t,{ref:r})})}const Ai=({children:t,initial:e,isPresent:n,onExitComplete:i,custom:o,presenceAffectsLayout:r,mode:s,anchorX:a,root:l})=>{const c=Yt(wi),u=p.useId();let h=!0,f=p.useMemo(()=>(h=!1,{id:u,initial:e,isPresent:n,custom:o,onExitComplete:d=>{c.set(d,!0);for(const m of c.values())if(!m)return;i&&i()},register:d=>(c.set(d,!1),()=>c.delete(d))}),[n,c,i]);return r&&h&&(f={...f}),p.useMemo(()=>{c.forEach((d,m)=>c.set(m,!1))},[n]),p.useEffect(()=>{!n&&!c.size&&i&&i()},[n]),s==="popLayout"&&(t=k.jsx(Ci,{isPresent:n,anchorX:a,root:l,children:t})),k.jsx(xt.Provider,{value:f,children:t})};function wi(){return new Map}function mn(t=!0){const e=p.useContext(xt);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:i,register:o}=e,r=p.useId();p.useEffect(()=>{if(t)return o(r)},[t]);const s=p.useCallback(()=>t&&i&&i(r),[r,i,t]);return!n&&i?[!1,s]:[!0]}const ct=t=>t.key||"";function he(t){const e=[];return p.Children.forEach(t,n=>{p.isValidElement(n)&&e.push(n)}),e}const ur=({children:t,custom:e,initial:n=!0,onExitComplete:i,presenceAffectsLayout:o=!0,mode:r="sync",propagate:s=!1,anchorX:a="left",root:l})=>{const[c,u]=mn(s),h=p.useMemo(()=>he(t),[t]),f=s&&!c?[]:h.map(ct),d=p.useRef(!0),m=p.useRef(h),x=Yt(()=>new Map),[P,y]=p.useState(h),[g,v]=p.useState(h);dn(()=>{d.current=!1,m.current=h;for(let M=0;M{const A=ct(M),I=s&&!c?!1:h===g||f.includes(A),H=()=>{if(x.has(A))x.set(A,!0);else return;let tt=!0;x.forEach(O=>{O||(tt=!1)}),tt&&(E?.(),v(m.current),s&&u?.(),i&&i())};return k.jsx(Ai,{isPresent:I,initial:!d.current||n?void 0:!1,custom:e,presenceAffectsLayout:o,mode:r,root:l,onExitComplete:I?void 0:H,anchorX:a,children:M},A)})})},pn=p.createContext({strict:!1}),fe={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},J={};for(const t in fe)J[t]={isEnabled:e=>fe[t].some(n=>!!e[n])};function Di(t){for(const e in t)J[e]={...J[e],...t[e]}}const Mi=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function yt(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Mi.has(t)}let gn=t=>!yt(t);function Ri(t){typeof t=="function"&&(gn=e=>e.startsWith("on")?!yt(e):t(e))}try{Ri(require("@emotion/is-prop-valid").default)}catch{}function Li(t,e,n){const i={};for(const o in t)o==="values"&&typeof t.values=="object"||(gn(o)||n===!0&&yt(o)||!e&&!yt(o)||t.draggable&&o.startsWith("onDrag"))&&(i[o]=t[o]);return i}const Pt=p.createContext({});function Tt(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function rt(t){return typeof t=="string"||Array.isArray(t)}const Jt=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Qt=["initial",...Jt];function St(t){return Tt(t.animate)||Qt.some(e=>rt(t[e]))}function yn(t){return!!(St(t)||t.variants)}function Ei(t,e){if(St(t)){const{initial:n,animate:i}=t;return{initial:n===!1||rt(n)?n:void 0,animate:rt(i)?i:void 0}}return t.inherit!==!1?e:{}}function bi(t){const{initial:e,animate:n}=Ei(t,p.useContext(Pt));return p.useMemo(()=>({initial:e,animate:n}),[de(e),de(n)])}function de(t){return Array.isArray(t)?t.join(" "):t}const at={};function ji(t){for(const e in t)at[e]=t[e],Ht(e)&&(at[e].isCSSVariable=!0)}function vn(t,{layout:e,layoutId:n}){return Q.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!at[t]||t==="opacity")}const Bi={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Ii=Gt.length;function ki(t,e,n){let i="",o=!0;for(let r=0;r({style:{},transform:{},transformOrigin:{},vars:{}});function xn(t,e,n){for(const i in e)!D(e[i])&&!vn(i,n)&&(t[i]=e[i])}function Fi({transformTemplate:t},e){return p.useMemo(()=>{const n=ee();return te(n,e,t),Object.assign({},n.vars,n.style)},[e])}function Oi(t,e){const n=t.style||{},i={};return xn(i,n,t),Object.assign(i,Fi(t,e)),i}function Ui(t,e){const n={},i=Oi(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=i,n}const Ni={offset:"stroke-dashoffset",array:"stroke-dasharray"},Wi={offset:"strokeDashoffset",array:"strokeDasharray"};function $i(t,e,n=1,i=0,o=!0){t.pathLength=1;const r=o?Ni:Wi;t[r.offset]=nt.transform(-i);const s=nt.transform(e),a=nt.transform(n);t[r.array]=`${s} ${a}`}function Pn(t,{attrX:e,attrY:n,attrScale:i,pathLength:o,pathSpacing:r=1,pathOffset:s=0,...a},l,c,u){if(te(t,a,c),l){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:f}=t;h.transform&&(f.transform=h.transform,delete h.transform),(f.transform||h.transformOrigin)&&(f.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??"fill-box",delete h.transformBox),e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),i!==void 0&&(h.scale=i),o!==void 0&&$i(h,o,r,s,!1)}const Tn=()=>({...ee(),attrs:{}}),Sn=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Hi(t,e,n,i){const o=p.useMemo(()=>{const r=Tn();return Pn(r,e,Sn(i),t.transformTemplate,t.style),{...r.attrs,style:{...r.style}}},[e]);if(t.style){const r={};xn(r,t.style,t),o.style={...r,...o.style}}return o}const Gi=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function ne(t){return typeof t!="string"||t.includes("-")?!1:!!(Gi.indexOf(t)>-1||/[A-Z]/u.test(t))}function zi(t,e,n,{latestValues:i},o,r=!1){const a=(ne(t)?Hi:Ui)(e,i,o,t),l=Li(e,typeof t=="string",r),c=t!==p.Fragment?{...l,...a,ref:n}:{},{children:u}=e,h=p.useMemo(()=>D(u)?u.get():u,[u]);return p.createElement(t,{...c,children:h})}function me(t){const e=[{},{}];return t?.values.forEach((n,i)=>{e[0][i]=n.get(),e[1][i]=n.getVelocity()}),e}function ie(t,e,n,i){if(typeof e=="function"){const[o,r]=me(i);e=e(n!==void 0?n:t.custom,o,r)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[o,r]=me(i);e=e(n!==void 0?n:t.custom,o,r)}return e}function dt(t){return D(t)?t.get():t}function Ki({scrapeMotionValuesFromProps:t,createRenderState:e},n,i,o){return{latestValues:_i(n,i,o,t),renderState:e()}}function _i(t,e,n,i){const o={},r=i(t,{});for(const f in r)o[f]=dt(r[f]);let{initial:s,animate:a}=t;const l=St(t),c=yn(t);e&&c&&!l&&t.inherit!==!1&&(s===void 0&&(s=e.initial),a===void 0&&(a=e.animate));let u=n?n.initial===!1:!1;u=u||s===!1;const h=u?a:s;if(h&&typeof h!="boolean"&&!Tt(h)){const f=Array.isArray(h)?h:[h];for(let d=0;d(e,n)=>{const i=p.useContext(Pt),o=p.useContext(xt),r=()=>Ki(t,e,i,o);return n?r():Yt(r)};function se(t,e,n){const{style:i}=t,o={};for(const r in i)(D(i[r])||e.style&&D(e.style[r])||vn(r,t)||n?.getValue(r)?.liveStyle!==void 0)&&(o[r]=i[r]);return o}const Xi=Vn({scrapeMotionValuesFromProps:se,createRenderState:ee});function Cn(t,e,n){const i=se(t,e,n);for(const o in t)if(D(t[o])||D(e[o])){const r=Gt.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;i[r]=t[o]}return i}const Yi=Vn({scrapeMotionValuesFromProps:Cn,createRenderState:Tn}),qi=Symbol.for("motionComponentSymbol");function z(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Zi(t,e,n){return p.useCallback(i=>{i&&t.onMount&&t.onMount(i),e&&(i?e.mount(i):e.unmount()),n&&(typeof n=="function"?n(i):z(n)&&(n.current=i))},[e])}const oe=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Ji="framerAppearId",An="data-"+oe(Ji),wn=p.createContext({});function Qi(t,e,n,i,o){const{visualElement:r}=p.useContext(Pt),s=p.useContext(pn),a=p.useContext(xt),l=p.useContext(Zt).reducedMotion,c=p.useRef(null);i=i||s.renderer,!c.current&&i&&(c.current=i(t,{visualState:e,parent:r,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const u=c.current,h=p.useContext(wn);u&&!u.projection&&o&&(u.type==="html"||u.type==="svg")&&ts(c.current,n,o,h);const f=p.useRef(!1);p.useInsertionEffect(()=>{u&&f.current&&u.update(n,a)});const d=n[An],m=p.useRef(!!d&&!window.MotionHandoffIsComplete?.(d)&&window.MotionHasOptimisedAnimation?.(d));return dn(()=>{u&&(f.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),m.current&&u.animationState&&u.animationState.animateChanges())}),p.useEffect(()=>{u&&(!m.current&&u.animationState&&u.animationState.animateChanges(),m.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(d)}),m.current=!1),u.enteringChildren=void 0)}),u}function ts(t,e,n,i){const{layoutId:o,layout:r,drag:s,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutCrossfade:u}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Dn(t.parent)),t.projection.setOptions({layoutId:o,layout:r,alwaysMeasureLayout:!!s||a&&z(a),visualElement:t,animationType:typeof r=="string"?r:"both",initialPromotionConfig:i,crossfade:u,layoutScroll:l,layoutRoot:c})}function Dn(t){if(t)return t.options.allowProjection!==!1?t.projection:Dn(t.parent)}function Ct(t,{forwardMotionProps:e=!1}={},n,i){n&&Di(n);const o=ne(t)?Yi:Xi;function r(a,l){let c;const u={...p.useContext(Zt),...a,layoutId:es(a)},{isStatic:h}=u,f=bi(a),d=o(a,h);if(!h&&qt){ns();const m=is(u);c=m.MeasureLayout,f.visualElement=Qi(t,d,u,i,m.ProjectionNode)}return k.jsxs(Pt.Provider,{value:f,children:[c&&f.visualElement?k.jsx(c,{visualElement:f.visualElement,...u}):null,zi(t,a,Zi(d,f.visualElement,l),d,h,e)]})}r.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const s=p.forwardRef(r);return s[qi]=t,s}function es({layoutId:t}){const e=p.useContext(Xt).id;return e&&t!==void 0?e+"-"+t:t}function ns(t,e){p.useContext(pn).strict}function is(t){const{drag:e,layout:n}=J;if(!e&&!n)return{};const i={...e,...n};return{MeasureLayout:e?.isEnabled(t)||n?.isEnabled(t)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function ss(t,e){if(typeof Proxy>"u")return Ct;const n=new Map,i=(r,s)=>Ct(r,s,t,e),o=(r,s)=>i(r,s);return new Proxy(o,{get:(r,s)=>s==="create"?i:(n.has(s)||n.set(s,Ct(s,void 0,t,e)),n.get(s))})}function Mn({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function os({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function rs(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function At(t){return t===void 0||t===1}function It({scale:t,scaleX:e,scaleY:n}){return!At(t)||!At(e)||!At(n)}function W(t){return It(t)||Rn(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Rn(t){return pe(t.x)||pe(t.y)}function pe(t){return t&&t!=="0%"}function vt(t,e,n){const i=t-n,o=e*i;return n+o}function ge(t,e,n,i,o){return o!==void 0&&(t=vt(t,o,i)),vt(t,n,i)+e}function kt(t,e=0,n=1,i,o){t.min=ge(t.min,e,n,i,o),t.max=ge(t.max,e,n,i,o)}function Ln(t,{x:e,y:n}){kt(t.x,e.translate,e.scale,e.originPoint),kt(t.y,n.translate,n.scale,n.originPoint)}const ye=.999999999999,ve=1.0000000000001;function as(t,e,n,i=!1){const o=n.length;if(!o)return;e.x=e.y=1;let r,s;for(let a=0;aye&&(e.x=1),e.yye&&(e.y=1)}function K(t,e){t.min=t.min+e,t.max=t.max+e}function xe(t,e,n,i,o=.5){const r=V(t.min,t.max,o);kt(t,e,n,r,i)}function _(t,e){xe(t.x,e.x,e.scaleX,e.scale,e.originX),xe(t.y,e.y,e.scaleY,e.scale,e.originY)}function En(t,e){return Mn(rs(t.getBoundingClientRect(),e))}function ls(t,e,n){const i=En(t,n),{scroll:o}=e;return o&&(K(i.x,o.offset.x),K(i.y,o.offset.y)),i}const Pe=()=>({translate:0,scale:1,origin:0,originPoint:0}),X=()=>({x:Pe(),y:Pe()}),Te=()=>({min:0,max:0}),T=()=>({x:Te(),y:Te()}),Ft={current:null},bn={current:!1};function us(){if(bn.current=!0,!!qt)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Ft.current=t.matches;t.addEventListener("change",e),e()}else Ft.current=!1}const cs=new WeakMap;function hs(t,e,n){for(const i in e){const o=e[i],r=n[i];if(D(o))t.addValue(i,o);else if(D(r))t.addValue(i,Z(o,{owner:t}));else if(r!==o)if(t.hasValue(i)){const s=t.getValue(i);s.liveStyle===!0?s.jump(o):s.hasAnimated||s.set(o)}else{const s=t.getStaticValue(i);t.addValue(i,Z(s!==void 0?s:o,{owner:t}))}}for(const i in n)e[i]===void 0&&t.removeValue(i);return e}const Se=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class fs{scrapeMotionValuesFromProps(e,n,i){return{}}constructor({parent:e,props:n,presenceContext:i,reducedMotionConfig:o,blockInitialAnimation:r,visualState:s},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=si,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const f=zt.now();this.renderScheduledAtthis.bindToMotionValue(i,n)),bn.current||us(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Ft.current,this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),$(this.notifyUpdate),$(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const i=Q.has(e);i&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",s=>{this.latestValues[e]=s,this.props.onUpdate&&S.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let r;window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{o(),r&&r(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in J){const n=J[e];if(!n)continue;const{isEnabled:i,Feature:o}=n;if(!this.features[e]&&o&&i(this.props)&&(this.features[e]=new o(this)),this.features[e]){const r=this.features[e];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):T()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let i=0;in.variantChildren.delete(e)}addValue(e,n){const i=this.values.get(e);n!==i&&(i&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let i=this.values.get(e);return i===void 0&&n!==void 0&&(i=Z(n===null?void 0:n,{owner:this}),this.addValue(e,i)),i}readValue(e,n){let i=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return i!=null&&(typeof i=="string"&&(oi(i)||ri(i))?i=parseFloat(i):!ai(i)&&jt.test(n)&&(i=li(e,n)),this.setBaseTarget(e,D(i)?i.get():i)),D(i)?i.get():i}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){const{initial:n}=this.props;let i;if(typeof n=="string"||typeof n=="object"){const r=ie(this.props,n,this.presenceContext?.custom);r&&(i=r[e])}if(n&&i!==void 0)return i;const o=this.getBaseTargetFromProps(this.props,e);return o!==void 0&&!D(o)?o:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new an),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){Kt.render(this.render)}}class jn extends fs{constructor(){super(...arguments),this.KeyframeResolver=ui}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:i}){delete n[e],delete i[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;D(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Bn(t,{style:e,vars:n},i,o){const r=t.style;let s;for(s in e)r[s]=e[s];o?.applyProjectionStyles(r,i);for(s in n)r.setProperty(s,n[s])}function ds(t){return window.getComputedStyle(t)}class ms extends jn{constructor(){super(...arguments),this.type="html",this.renderInstance=Bn}readValueFromInstance(e,n){if(Q.has(n))return this.projection?.isProjecting?ci(n):hi(e,n);{const i=ds(e),o=(Ht(n)?i.getPropertyValue(n):i[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(e,{transformPagePoint:n}){return En(e,n)}build(e,n,i){te(e,n,i.transformTemplate)}scrapeMotionValuesFromProps(e,n,i){return se(e,n,i)}}const In=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function ps(t,e,n,i){Bn(t,e,void 0,i);for(const o in e.attrs)t.setAttribute(In.has(o)?o:oe(o),e.attrs[o])}class gs extends jn{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=T}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Q.has(n)){const i=fi(n);return i&&i.default||0}return n=In.has(n)?n:oe(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,i){return Cn(e,n,i)}build(e,n,i){Pn(e,n,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(e,n,i,o){ps(e,n,i,o)}mount(e){this.isSVGTag=Sn(e.tagName),super.mount(e)}}const ys=(t,e)=>ne(t)?new gs(e):new ms(e,{allowProjection:t!==p.Fragment});function q(t,e,n){const i=t.getProps();return ie(i,e,n!==void 0?n:i.custom,t)}const Ot=t=>Array.isArray(t);function vs(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Z(n))}function xs(t){return Ot(t)?t[t.length-1]||0:t}function Ps(t,e){const n=q(t,e);let{transitionEnd:i={},transition:o={},...r}=n||{};r={...r,...i};for(const s in r){const a=xs(r[s]);vs(t,s,a)}}function Ts(t){return!!(D(t)&&t.add)}function Ut(t,e){const n=t.getValue("willChange");if(Ts(n))return n.add(e);if(!n&&pt.WillChange){const i=new pt.WillChange("auto");t.addValue("willChange",i),i.add(e)}}function kn(t){return t.props[An]}const Ss=t=>t!==null;function Vs(t,{repeat:e,repeatType:n="loop"},i){const o=t.filter(Ss),r=e&&n!=="loop"&&e%2===1?0:o.length-1;return o[r]}const Cs={type:"spring",stiffness:500,damping:25,restSpeed:10},As=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),ws={type:"keyframes",duration:.8},Ds={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Ms=(t,{keyframes:e})=>e.length>2?ws:Q.has(t)?t.startsWith("scale")?As(e[1]):Cs:Ds;function Rs({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:o,repeat:r,repeatType:s,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const re=(t,e,n,i={},o,r)=>s=>{const a=_t(i,t)||{},l=a.delay||i.delay||0;let{elapsed:c=0}=i;c=c-ft(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-c,onUpdate:f=>{e.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{s(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:r?void 0:o};Rs(a)||Object.assign(u,Ms(t,u)),u.duration&&(u.duration=ft(u.duration)),u.repeatDelay&&(u.repeatDelay=ft(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let h=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(ce(u),u.delay===0&&(h=!0)),(pt.instantAnimations||pt.skipAnimations)&&(h=!0,ce(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,h&&!r&&e.get()!==void 0){const f=Vs(u.keyframes,a);if(f!==void 0){S.update(()=>{u.onUpdate(f),u.onComplete()});return}}return a.isSync?new di(u):new mi(u)};function Ls({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,i}function Fn(t,e,{delay:n=0,transitionOverride:i,type:o}={}){let{transition:r=t.getDefaultTransition(),transitionEnd:s,...a}=e;i&&(r=i);const l=[],c=o&&t.animationState&&t.animationState.getState()[o];for(const u in a){const h=t.getValue(u,t.latestValues[u]??null),f=a[u];if(f===void 0||c&&Ls(c,u))continue;const d={delay:n,..._t(r||{},u)},m=h.get();if(m!==void 0&&!h.isAnimating&&!Array.isArray(f)&&f===m&&!d.velocity)continue;let x=!1;if(window.MotionHandoffAnimation){const y=kn(t);if(y){const g=window.MotionHandoffAnimation(y,u,S);g!==null&&(d.startTime=g,x=!0)}}Ut(t,u),h.start(re(u,h,f,t.shouldReduceMotion&&pi.has(u)?{type:!1}:d,t,x));const P=h.animation;P&&l.push(P)}return s&&Promise.all(l).then(()=>{S.update(()=>{s&&Ps(t,s)})}),l}function On(t,e,n,i=0,o=1){const r=Array.from(t).sort((c,u)=>c.sortNodePosition(u)).indexOf(e),s=t.size,a=(s-1)*i;return typeof n=="function"?n(r,s):o===1?r*i:a-r*i}function Nt(t,e,n={}){const i=q(t,e,n.type==="exit"?t.presenceContext?.custom:void 0);let{transition:o=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(o=n.transitionOverride);const r=i?()=>Promise.all(Fn(t,i,n)):()=>Promise.resolve(),s=t.variantChildren&&t.variantChildren.size?(l=0)=>{const{delayChildren:c=0,staggerChildren:u,staggerDirection:h}=o;return Es(t,e,l,c,u,h,n)}:()=>Promise.resolve(),{when:a}=o;if(a){const[l,c]=a==="beforeChildren"?[r,s]:[s,r];return l().then(()=>c())}else return Promise.all([r(),s(n.delay)])}function Es(t,e,n=0,i=0,o=0,r=1,s){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(Nt(l,e,{...s,delay:n+(typeof i=="function"?0:i)+On(t.variantChildren,l,i,o,r)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}function bs(t,e,n={}){t.notify("AnimationStart",e);let i;if(Array.isArray(e)){const o=e.map(r=>Nt(t,r,n));i=Promise.all(o)}else if(typeof e=="string")i=Nt(t,e,n);else{const o=typeof e=="function"?q(t,e,n.custom):e;i=Promise.all(Fn(t,o,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}function Un(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let i=0;iPromise.all(e.map(({animation:n,options:i})=>bs(t,n,i)))}function Fs(t){let e=ks(t),n=Ve(),i=!0;const o=l=>(c,u)=>{const h=q(t,u,l==="exit"?t.presenceContext?.custom:void 0);if(h){const{transition:f,transitionEnd:d,...m}=h;c={...c,...m,...d}}return c};function r(l){e=l(t)}function s(l){const{props:c}=t,u=Nn(t.parent)||{},h=[],f=new Set;let d={},m=1/0;for(let P=0;Pm&&C,H=!1;const tt=Array.isArray(v)?v:[v];let O=tt.reduce(o(y),{});E===!1&&(O={});const{prevResolvedValues:ae={}}=g,ei={...ae,...O},le=w=>{I=!0,f.has(w)&&(H=!0,f.delete(w)),g.needsAnimating[w]=!0;const b=t.getValue(w);b&&(b.liveStyle=!1)};for(const w in ei){const b=O[w],U=ae[w];if(d.hasOwnProperty(w))continue;let G=!1;Ot(b)&&Ot(U)?G=!Un(b,U):G=b!==U,G?b!=null?le(w):f.add(w):b!==void 0&&f.has(w)?le(w):g.protectedKeys[w]=!0}g.prevProp=v,g.prevResolvedValues=O,g.isActive&&(d={...d,...O}),i&&t.blockInitialAnimation&&(I=!1);const ue=M&&A;I&&(!ue||H)&&h.push(...tt.map(w=>{const b={type:y};if(typeof w=="string"&&i&&!ue&&t.manuallyAnimateOnMount&&t.parent){const{parent:U}=t,G=q(U,w);if(U.enteringChildren&&G){const{delayChildren:ni}=G.transition||{};b.delay=On(U.enteringChildren,t,ni)}}return{animation:w,options:b}}))}if(f.size){const P={};if(typeof c.initial!="boolean"){const y=q(t,Array.isArray(c.initial)?c.initial[0]:c.initial);y&&y.transition&&(P.transition=y.transition)}f.forEach(y=>{const g=t.getBaseTarget(y),v=t.getValue(y);v&&(v.liveStyle=!0),P[y]=g??null}),h.push({animation:P})}let x=!!h.length;return i&&(c.initial===!1||c.initial===c.animate)&&!t.manuallyAnimateOnMount&&(x=!1),i=!1,x?e(h):Promise.resolve()}function a(l,c){if(n[l].isActive===c)return Promise.resolve();t.variantChildren?.forEach(h=>h.animationState?.setActive(l,c)),n[l].isActive=c;const u=s(l);for(const h in n)n[h].protectedKeys={};return u}return{animateChanges:s,setActive:a,setAnimateFunction:r,getState:()=>n,reset:()=>{n=Ve(),i=!0}}}function Os(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Un(e,t):!1}function N(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ve(){return{animate:N(!0),whileInView:N(),whileHover:N(),whileTap:N(),whileDrag:N(),whileFocus:N(),exit:N()}}class F{constructor(e){this.isMounted=!1,this.node=e}update(){}}class Us extends F{constructor(e){super(e),e.animationState||(e.animationState=Fs(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Tt(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let Ns=0;class Ws extends F{constructor(){super(...arguments),this.id=Ns++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===i)return;const o=this.node.animationState.setActive("exit",!e);n&&!e&&o.then(()=>{n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const $s={animation:{Feature:Us},exit:{Feature:Ws}};function lt(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}function ut(t){return{point:{x:t.pageX,y:t.pageY}}}const Hs=t=>e=>ln(e)&&t(e,ut(e));function it(t,e,n,i){return lt(t,e,Hs(n),i)}const Wn=1e-4,Gs=1-Wn,zs=1+Wn,$n=.01,Ks=0-$n,_s=0+$n;function R(t){return t.max-t.min}function Xs(t,e,n){return Math.abs(t-e)<=n}function Ce(t,e,n,i=.5){t.origin=i,t.originPoint=V(e.min,e.max,t.origin),t.scale=R(n)/R(e),t.translate=V(n.min,n.max,t.origin)-t.originPoint,(t.scale>=Gs&&t.scale<=zs||isNaN(t.scale))&&(t.scale=1),(t.translate>=Ks&&t.translate<=_s||isNaN(t.translate))&&(t.translate=0)}function st(t,e,n,i){Ce(t.x,e.x,n.x,i?i.originX:void 0),Ce(t.y,e.y,n.y,i?i.originY:void 0)}function Ae(t,e,n){t.min=n.min+e.min,t.max=t.min+R(e)}function Ys(t,e,n){Ae(t.x,e.x,n.x),Ae(t.y,e.y,n.y)}function we(t,e,n){t.min=e.min-n.min,t.max=t.min+R(e)}function ot(t,e,n){we(t.x,e.x,n.x),we(t.y,e.y,n.y)}function B(t){return[t("x"),t("y")]}const Hn=({current:t})=>t?t.ownerDocument.defaultView:null,De=(t,e)=>Math.abs(t-e);function qs(t,e){const n=De(t.x,e.x),i=De(t.y,e.y);return Math.sqrt(n**2+i**2)}class Gn{constructor(e,n,{transformPagePoint:i,contextWindow:o=window,dragSnapToOrigin:r=!1,distanceThreshold:s=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=Dt(this.lastMoveEventInfo,this.history),d=this.startEvent!==null,m=qs(f.offset,{x:0,y:0})>=this.distanceThreshold;if(!d&&!m)return;const{point:x}=f,{timestamp:P}=L;this.history.push({...x,timestamp:P});const{onStart:y,onMove:g}=this.handlers;d||(y&&y(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),g&&g(this.lastMoveEvent,f)},this.handlePointerMove=(f,d)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=wt(d,this.transformPagePoint),S.update(this.updatePoint,!0)},this.handlePointerUp=(f,d)=>{this.end();const{onEnd:m,onSessionEnd:x,resumeAnimation:P}=this.handlers;if(this.dragSnapToOrigin&&P&&P(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=Dt(f.type==="pointercancel"?this.lastMoveEventInfo:wt(d,this.transformPagePoint),this.history);this.startEvent&&m&&m(f,y),x&&x(f,y)},!ln(e))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=i,this.distanceThreshold=s,this.contextWindow=o||window;const a=ut(e),l=wt(a,this.transformPagePoint),{point:c}=l,{timestamp:u}=L;this.history=[{...c,timestamp:u}];const{onSessionStart:h}=n;h&&h(e,Dt(l,this.history)),this.removeListeners=un(it(this.contextWindow,"pointermove",this.handlePointerMove),it(this.contextWindow,"pointerup",this.handlePointerUp),it(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),$(this.updatePoint)}}function wt(t,e){return e?{point:e(t.point)}:t}function Me(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Dt({point:t},e){return{point:t,delta:Me(t,zn(e)),offset:Me(t,Zs(e)),velocity:Js(e,.1)}}function Zs(t){return t[0]}function zn(t){return t[t.length-1]}function Js(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const o=zn(t);for(;n>=0&&(i=t[n],!(o.timestamp-i.timestamp>ft(e)));)n--;if(!i)return{x:0,y:0};const r=gi(o.timestamp-i.timestamp);if(r===0)return{x:0,y:0};const s={x:(o.x-i.x)/r,y:(o.y-i.y)/r};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function Qs(t,{min:e,max:n},i){return e!==void 0&&tn&&(t=i?V(n,t,i.max):Math.min(t,n)),t}function Re(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function to(t,{top:e,left:n,bottom:i,right:o}){return{x:Re(t.x,n,o),y:Re(t.y,e,i)}}function Le(t,e){let n=e.min-t.min,i=e.max-t.max;return e.max-e.mini?n=Bt(e.min,e.max-i,t.min):i>o&&(n=Bt(t.min,t.max-o,e.min)),cn(0,1,n)}function io(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const Wt=.35;function so(t=Wt){return t===!1?t=0:t===!0&&(t=Wt),{x:Ee(t,"left","right"),y:Ee(t,"top","bottom")}}function Ee(t,e,n){return{min:be(t,e),max:be(t,n)}}function be(t,e){return typeof t=="number"?t:t[e]||0}const oo=new WeakMap;class ro{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=T(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:i}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const r=h=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(ut(h).point)},s=(h,f)=>{const{drag:d,dragPropagation:m,onDragStart:x}=this.getProps();if(d&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=yi(d),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),B(y=>{let g=this.getAxisMotionValue(y).get()||0;if(gt.test(g)){const{projection:v}=this.visualElement;if(v&&v.layout){const C=v.layout.layoutBox[y];C&&(g=R(C)*(parseFloat(g)/100))}}this.originPoint[y]=g}),x&&S.postRender(()=>x(h,f)),Ut(this.visualElement,"transform");const{animationState:P}=this.visualElement;P&&P.setActive("whileDrag",!0)},a=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f;const{dragPropagation:d,dragDirectionLock:m,onDirectionLock:x,onDrag:P}=this.getProps();if(!d&&!this.openDragLock)return;const{offset:y}=f;if(m&&this.currentDirection===null){this.currentDirection=ao(y),this.currentDirection!==null&&x&&x(this.currentDirection);return}this.updateAxis("x",f.point,y),this.updateAxis("y",f.point,y),this.visualElement.render(),P&&P(h,f)},l=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f,this.stop(h,f),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>B(h=>this.getAnimationState(h)==="paused"&&this.getAxisMotionValue(h).animation?.play()),{dragSnapToOrigin:u}=this.getProps();this.panSession=new Gn(e,{onSessionStart:r,onStart:s,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:i,contextWindow:Hn(this.visualElement)})}stop(e,n){const i=e||this.latestPointerEvent,o=n||this.latestPanInfo,r=this.isDragging;if(this.cancel(),!r||!o||!i)return;const{velocity:s}=o;this.startAnimation(s);const{onDragEnd:a}=this.getProps();a&&S.postRender(()=>a(i,o))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(e,n,i){const{drag:o}=this.getProps();if(!i||!ht(e,o,this.currentDirection))return;const r=this.getAxisMotionValue(e);let s=this.originPoint[e]+i[e];this.constraints&&this.constraints[e]&&(s=Qs(s,this.constraints[e],this.elastic[e])),r.set(s)}resolveConstraints(){const{dragConstraints:e,dragElastic:n}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,o=this.constraints;e&&z(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&i?this.constraints=to(i.layoutBox,e):this.constraints=!1,this.elastic=so(n),o!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&B(r=>{this.constraints!==!1&&this.getAxisMotionValue(r)&&(this.constraints[r]=io(i.layoutBox[r],this.constraints[r]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!z(e))return!1;const i=e.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const r=ls(i,o.root,this.visualElement.getTransformPagePoint());let s=eo(o.layout.layoutBox,r);if(n){const a=n(os(s));this.hasMutatedConstraints=!!a,a&&(s=Mn(a))}return s}startAnimation(e){const{drag:n,dragMomentum:i,dragElastic:o,dragTransition:r,dragSnapToOrigin:s,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=B(u=>{if(!ht(u,n,this.currentDirection))return;let h=l&&l[u]||{};s&&(h={min:0,max:0});const f=o?200:1e6,d=o?40:1e7,m={type:"inertia",velocity:i?e[u]:0,bounceStiffness:f,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...r,...h};return this.startAxisValueAnimation(u,m)});return Promise.all(c).then(a)}startAxisValueAnimation(e,n){const i=this.getAxisMotionValue(e);return Ut(this.visualElement,e),i.start(re(e,i,0,n,this.visualElement,!1))}stopAnimation(){B(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){B(e=>this.getAxisMotionValue(e).animation?.pause())}getAnimationState(e){return this.getAxisMotionValue(e).animation?.state}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,i=this.visualElement.getProps(),o=i[n];return o||this.visualElement.getValue(e,(i.initial?i.initial[e]:void 0)||0)}snapToCursor(e){B(n=>{const{drag:i}=this.getProps();if(!ht(n,i,this.currentDirection))return;const{projection:o}=this.visualElement,r=this.getAxisMotionValue(n);if(o&&o.layout){const{min:s,max:a}=o.layout.layoutBox[n];r.set(e[n]-V(s,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!z(n)||!i||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};B(s=>{const a=this.getAxisMotionValue(s);if(a&&this.constraints!==!1){const l=a.get();o[s]=no({min:l,max:l},this.constraints[s])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),B(s=>{if(!ht(s,e,null))return;const a=this.getAxisMotionValue(s),{min:l,max:c}=this.constraints[s];a.set(V(l,c,o[s]))})}addListeners(){if(!this.visualElement.current)return;oo.set(this.visualElement,this);const e=this.visualElement.current,n=it(e,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),i=()=>{const{dragConstraints:l}=this.getProps();z(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,r=o.addEventListener("measure",i);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),S.read(i);const s=lt(window,"resize",()=>this.scalePositionWithinConstraints()),a=o.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(B(u=>{const h=this.getAxisMotionValue(u);h&&(this.originPoint[u]+=l[u].translate,h.set(h.get()+l[u].translate))}),this.visualElement.render())});return()=>{s(),n(),r(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:i=!1,dragPropagation:o=!1,dragConstraints:r=!1,dragElastic:s=Wt,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:i,dragPropagation:o,dragConstraints:r,dragElastic:s,dragMomentum:a}}}function ht(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function ao(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class lo extends F{constructor(e){super(e),this.removeGroupControls=Y,this.removeListeners=Y,this.controls=new ro(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Y}unmount(){this.removeGroupControls(),this.removeListeners()}}const je=t=>(e,n)=>{t&&S.postRender(()=>t(e,n))};class uo extends F{constructor(){super(...arguments),this.removePointerDownListener=Y}onPointerDown(e){this.session=new Gn(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Hn(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:i,onPanEnd:o}=this.node.getProps();return{onSessionStart:je(e),onStart:je(n),onMove:i,onEnd:(r,s)=>{delete this.session,o&&S.postRender(()=>o(r,s))}}}mount(){this.removePointerDownListener=it(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const mt={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Be(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const et={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(nt.test(t))t=parseFloat(t);else return t;const n=Be(t,e.target.x),i=Be(t,e.target.y);return`${n}% ${i}%`}},co={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,o=jt.parse(t);if(o.length>5)return i;const r=jt.createTransformer(t),s=typeof o[0]!="number"?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;o[0+s]/=a,o[1+s]/=l;const c=V(a,l,.5);return typeof o[2+s]=="number"&&(o[2+s]/=c),typeof o[3+s]=="number"&&(o[3+s]/=c),r(o)}};let Mt=!1;class ho extends p.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:i,layoutId:o}=this.props,{projection:r}=e;ji(fo),r&&(n.group&&n.group.add(r),i&&i.register&&o&&i.register(r),Mt&&r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,onExitComplete:()=>this.safeToRemove()})),mt.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:i,drag:o,isPresent:r}=this.props,{projection:s}=i;return s&&(s.isPresent=r,Mt=!0,o||e.layoutDependency!==n||n===void 0||e.isPresent!==r?s.willUpdate():this.safeToRemove(),e.isPresent!==r&&(r?s.promote():s.relegate()||S.postRender(()=>{const a=s.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),Kt.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:i}=this.props,{projection:o}=e;Mt=!0,o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),i&&i.deregister&&i.deregister(o))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function Kn(t){const[e,n]=mn(),i=p.useContext(Xt);return k.jsx(ho,{...t,layoutGroup:i,switchLayoutGroup:p.useContext(wn),isPresent:e,safeToRemove:n})}const fo={borderRadius:{...et,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:et,borderTopRightRadius:et,borderBottomLeftRadius:et,borderBottomRightRadius:et,boxShadow:co};function mo(t,e,n){const i=D(t)?t:Z(t);return i.start(re("",i,e,n)),i.animation}const po=(t,e)=>t.depth-e.depth;class go{constructor(){this.children=[],this.isDirty=!1}add(e){hn(this.children,e),this.isDirty=!0}remove(e){fn(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(po),this.isDirty=!1,this.children.forEach(e)}}function yo(t,e){const n=zt.now(),i=({timestamp:o})=>{const r=o-n;r>=e&&($(i),t(r-e))};return S.setup(i,!0),()=>$(i)}const _n=["TopLeft","TopRight","BottomLeft","BottomRight"],vo=_n.length,Ie=t=>typeof t=="string"?parseFloat(t):t,ke=t=>typeof t=="number"||nt.test(t);function xo(t,e,n,i,o,r){o?(t.opacity=V(0,n.opacity??1,Po(i)),t.opacityExit=V(e.opacity??1,0,To(i))):r&&(t.opacity=V(e.opacity??1,n.opacity??1,i));for(let s=0;sie?1:n(Bt(t,e,i))}function Oe(t,e){t.min=e.min,t.max=e.max}function j(t,e){Oe(t.x,e.x),Oe(t.y,e.y)}function Ue(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function Ne(t,e,n,i,o){return t-=e,t=vt(t,1/n,i),o!==void 0&&(t=vt(t,1/o,i)),t}function So(t,e=0,n=1,i=.5,o,r=t,s=t){if(gt.test(e)&&(e=parseFloat(e),e=V(s.min,s.max,e/100)-s.min),typeof e!="number")return;let a=V(r.min,r.max,i);t===r&&(a-=e),t.min=Ne(t.min,e,n,a,o),t.max=Ne(t.max,e,n,a,o)}function We(t,e,[n,i,o],r,s){So(t,e[n],e[i],e[o],e.scale,r,s)}const Vo=["x","scaleX","originX"],Co=["y","scaleY","originY"];function $e(t,e,n,i){We(t.x,e,Vo,n?n.x:void 0,i?i.x:void 0),We(t.y,e,Co,n?n.y:void 0,i?i.y:void 0)}function He(t){return t.translate===0&&t.scale===1}function Yn(t){return He(t.x)&&He(t.y)}function Ge(t,e){return t.min===e.min&&t.max===e.max}function Ao(t,e){return Ge(t.x,e.x)&&Ge(t.y,e.y)}function ze(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function qn(t,e){return ze(t.x,e.x)&&ze(t.y,e.y)}function Ke(t){return R(t.x)/R(t.y)}function _e(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class wo{constructor(){this.members=[]}add(e){hn(this.members,e),e.scheduleRender()}remove(e){if(fn(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(o=>e===o);if(n===0)return!1;let i;for(let o=n;o>=0;o--){const r=this.members[o];if(r.isPresent!==!1){i=r;break}}return i?(this.promote(i),!0):!1}promote(e,n){const i=this.lead;if(e!==i&&(this.prevLead=i,this.lead=e,e.show(),i)){i.instance&&i.scheduleRender(),e.scheduleRender(),e.resumeFrom=i,n&&(e.resumeFrom.preserveOpacity=!0),i.snapshot&&(e.snapshot=i.snapshot,e.snapshot.latestValues=i.animationValues||i.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:o}=e.options;o===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:i}=e;n.onExitComplete&&n.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Do(t,e,n){let i="";const o=t.x.translate/e.x,r=t.y.translate/e.y,s=n?.z||0;if((o||r||s)&&(i=`translate3d(${o}px, ${r}px, ${s}px) `),(e.x!==1||e.y!==1)&&(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:h,rotateY:f,skewX:d,skewY:m}=n;c&&(i=`perspective(${c}px) ${i}`),u&&(i+=`rotate(${u}deg) `),h&&(i+=`rotateX(${h}deg) `),f&&(i+=`rotateY(${f}deg) `),d&&(i+=`skewX(${d}deg) `),m&&(i+=`skewY(${m}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return(a!==1||l!==1)&&(i+=`scale(${a}, ${l})`),i||"none"}const Rt=["","X","Y","Z"],Mo=1e3;let Ro=0;function Lt(t,e,n,i){const{latestValues:o}=e;o[t]&&(n[t]=o[t],e.setStaticValue(t,0),i&&(i[t]=0))}function Zn(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=kn(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:r}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",S,!(o||r))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&Zn(i)}function Jn({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:o}){return class{constructor(s={},a=e?.()){this.id=Ro++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(bo),this.nodes.forEach(ko),this.nodes.forEach(Fo),this.nodes.forEach(jo)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;lthis.root.updateBlockedByResize=!1;S.read(()=>{h=window.innerWidth}),t(s,()=>{const d=window.innerWidth;d!==h&&(h=d,this.root.updateBlockedByResize=!0,u&&u(),u=yo(f,250),mt.hasAnimatedSinceResize&&(mt.hasAnimatedSinceResize=!1,this.nodes.forEach(qe)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:h,hasRelativeLayoutChanged:f,layout:d})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||c.getDefaultTransition()||$o,{onLayoutAnimationStart:x,onLayoutAnimationComplete:P}=c.getProps(),y=!this.targetLayout||!qn(this.targetLayout,d),g=!h&&f;if(this.options.layoutRoot||this.resumeFrom||g||h&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const v={..._t(m,"layout"),onPlay:x,onComplete:P};(c.shouldReduceMotion||this.options.layoutRoot)&&(v.delay=0,v.type=!1),this.startAnimation(v),this.setAnimationOrigin(u,g)}else h||qe(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=d})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),$(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Oo),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Zn(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!R(this.snapshot.measuredBox.x)&&!R(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{const E=C/1e3;Ze(h.x,s.x,E),Ze(h.y,s.y,E),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ot(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),No(this.relativeTarget,this.relativeTargetOrigin,f,E),v&&Ao(this.relativeTarget,v)&&(this.isProjectionDirty=!1),v||(v=T()),j(v,this.relativeTarget)),x&&(this.animationValues=u,xo(u,c,this.latestValues,E,g,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=E},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&($(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=S.update(()=>{mt.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Z(0)),this.currentAnimation=mo(this.motionValue,[0,1e3],{...s,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),s.onUpdate&&s.onUpdate(a)},onStop:()=>{},onComplete:()=>{s.onComplete&&s.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Mo),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=s;if(!(!a||!l||!c)){if(this!==s&&this.layout&&c&&Qn(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||T();const h=R(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+h;const f=R(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+f}j(a,l),_(a,u),st(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(s,a){this.sharedNodes.has(s)||this.sharedNodes.set(s,new wo),this.sharedNodes.get(s).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){const{layoutId:s}=this.options;return s?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:s}=this.options;return s?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),s&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let a=!1;const{latestValues:l}=s;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&Lt("z",s,c,this.animationValues);for(let u=0;us.currentAnimation?.stop()),this.root.nodes.forEach(Xe),this.root.sharedNodes.clear()}}}function Lo(t){t.updateLayout()}function Eo(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:o}=t.options,r=e.source!==t.layout.source;o==="size"?B(u=>{const h=r?e.measuredBox[u]:e.layoutBox[u],f=R(h);h.min=n[u].min,h.max=h.min+f}):Qn(o,e.layoutBox,n)&&B(u=>{const h=r?e.measuredBox[u]:e.layoutBox[u],f=R(n[u]);h.max=h.min+f,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[u].max=t.relativeTarget[u].min+f)});const s=X();st(s,n,e.layoutBox);const a=X();r?st(a,t.applyTransform(i,!0),e.measuredBox):st(a,n,e.layoutBox);const l=!Yn(s);let c=!1;if(!t.resumeFrom){const u=t.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:h,layout:f}=u;if(h&&f){const d=T();ot(d,e.layoutBox,h.layoutBox);const m=T();ot(m,n,f.layoutBox),qn(d,m)||(c=!0),u.options.layoutRoot&&(t.relativeTarget=m,t.relativeTargetOrigin=d,t.relativeParent=u)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:s,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function bo(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function jo(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Bo(t){t.clearSnapshot()}function Xe(t){t.clearMeasurements()}function Ye(t){t.isLayoutDirty=!1}function Io(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function qe(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function ko(t){t.resolveTargetDelta()}function Fo(t){t.calcProjection()}function Oo(t){t.resetSkewAndRotation()}function Uo(t){t.removeLeadSnapshot()}function Ze(t,e,n){t.translate=V(e.translate,0,n),t.scale=V(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Je(t,e,n,i){t.min=V(e.min,n.min,i),t.max=V(e.max,n.max,i)}function No(t,e,n,i){Je(t.x,e.x,n.x,i),Je(t.y,e.y,n.y,i)}function Wo(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const $o={duration:.45,ease:[.4,0,.1,1]},Qe=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),tn=Qe("applewebkit/")&&!Qe("chrome/")?Math.round:Y;function en(t){t.min=tn(t.min),t.max=tn(t.max)}function Ho(t){en(t.x),en(t.y)}function Qn(t,e,n){return t==="position"||t==="preserve-aspect"&&!Xs(Ke(e),Ke(n),.2)}function Go(t){return t!==t.root&&t.scroll?.wasRoot}const zo=Jn({attachResizeListener:(t,e)=>lt(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Et={current:void 0},ti=Jn({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Et.current){const t=new zo({});t.mount(window),t.setOptions({layoutScroll:!0}),Et.current=t}return Et.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Ko={pan:{Feature:uo},drag:{Feature:lo,ProjectionNode:ti,MeasureLayout:Kn}};function nn(t,e,n){const{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,r=i[o];r&&S.postRender(()=>r(e,ut(e)))}class _o extends F{mount(){const{current:e}=this.node;e&&(this.unmount=Ti(e,(n,i)=>(nn(this.node,i,"Start"),o=>nn(this.node,o,"End"))))}unmount(){}}class Xo extends F{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=un(lt(this.node.current,"focus",()=>this.onFocus()),lt(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function sn(t,e,n){const{props:i}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&i.whileTap&&t.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),r=i[o];r&&S.postRender(()=>r(e,ut(e)))}class Yo extends F{mount(){const{current:e}=this.node;e&&(this.unmount=Si(e,(n,i)=>(sn(this.node,i,"Start"),(o,{success:r})=>sn(this.node,o,r?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const $t=new WeakMap,bt=new WeakMap,qo=t=>{const e=$t.get(t.target);e&&e(t)},Zo=t=>{t.forEach(qo)};function Jo({root:t,...e}){const n=t||document;bt.has(n)||bt.set(n,{});const i=bt.get(n),o=JSON.stringify(e);return i[o]||(i[o]=new IntersectionObserver(Zo,{root:t,...e})),i[o]}function Qo(t,e,n){const i=Jo(e);return $t.set(t,n),i.observe(t),()=>{$t.delete(t),i.unobserve(t)}}const tr={some:0,all:1};class er extends F{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:i,amount:o="some",once:r}=e,s={root:n?n.current:void 0,rootMargin:i,threshold:typeof o=="number"?o:tr[o]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,r&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:h}=this.node.getProps(),f=c?u:h;f&&f(l)};return Qo(this.node.current,s,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(nr(e,n))&&this.startObserver()}unmount(){}}function nr({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const ir={inView:{Feature:er},tap:{Feature:Yo},focus:{Feature:Xo},hover:{Feature:_o}},sr={layout:{ProjectionNode:ti,MeasureLayout:Kn}},or={...$s,...ir,...Ko,...sr},hr=ss(or,ys);export{ur as A,hr as m}; diff --git a/assets/vendor-CjHduoA4.js b/assets/vendor-CjHduoA4.js new file mode 100644 index 0000000000000000000000000000000000000000..18c3b611f585045a4e6cfc0bd65e03e2496ffd3e --- /dev/null +++ b/assets/vendor-CjHduoA4.js @@ -0,0 +1,167 @@ +import{Y as Vf}from"./vendor-other-B0VykD61.js";function Bf(h){return h&&h.__esModule&&Object.prototype.hasOwnProperty.call(h,"default")?h.default:h}var Lo={exports:{}},yr={},Oo={exports:{}},R={};/** + * @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 La;function Hf(){if(La)return R;La=1;var h=Symbol.for("react.element"),v=Symbol.for("react.portal"),c=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),O=Symbol.for("react.profiler"),M=Symbol.for("react.provider"),H=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),V=Symbol.for("react.suspense"),ze=Symbol.for("react.memo"),he=Symbol.for("react.lazy"),Ge=Symbol.iterator;function Rt(p){return p===null||typeof p!="object"?null:(p=Ge&&p[Ge]||p["@@iterator"],typeof p=="function"?p:null)}var jt={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},wr=Object.assign,se={};function X(p,S,j){this.props=p,this.context=S,this.refs=se,this.updater=j||jt}X.prototype.isReactComponent={},X.prototype.setState=function(p,S){if(typeof p!="object"&&typeof p!="function"&&p!=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,p,S,"setState")},X.prototype.forceUpdate=function(p){this.updater.enqueueForceUpdate(this,p,"forceUpdate")};function en(){}en.prototype=X.prototype;function Dt(p,S,j){this.props=p,this.context=S,this.refs=se,this.updater=j||jt}var It=Dt.prototype=new en;It.constructor=Dt,wr(It,X.prototype),It.isPureReactComponent=!0;var je=Array.isArray,Ft=Object.prototype.hasOwnProperty,Ze={current:null},rt={key:!0,ref:!0,__self:!0,__source:!0};function tn(p,S,j){var U,B={},G=null,ne=null;if(S!=null)for(U in S.ref!==void 0&&(ne=S.ref),S.key!==void 0&&(G=""+S.key),S)Ft.call(S,U)&&!rt.hasOwnProperty(U)&&(B[U]=S[U]);var A=arguments.length-2;if(A===1)B.children=j;else if(1"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),V=Object.prototype.hasOwnProperty,ze=/^[: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]*$/,he={},Ge={};function Rt(e){return V.call(Ge,e)?!0:V.call(he,e)?!1:ze.test(e)?Ge[e]=!0:(he[e]=!0,!1)}function jt(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function wr(e,t,n,r){if(t===null||typeof t>"u"||jt(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function se(e,t,n,r,l,u,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=u,this.removeEmptyString=o}var X={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){X[e]=new se(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];X[t]=new se(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){X[e]=new se(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){X[e]=new se(e,2,!1,e,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(e){X[e]=new se(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){X[e]=new se(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){X[e]=new se(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){X[e]=new se(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){X[e]=new se(e,5,!1,e.toLowerCase(),null,!1,!1)});var en=/[\-:]([a-z])/g;function Dt(e){return e[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(e){var t=e.replace(en,Dt);X[t]=new se(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(en,Dt);X[t]=new se(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(en,Dt);X[t]=new se(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){X[e]=new se(e,1,!1,e.toLowerCase(),null,!1,!1)}),X.xlinkHref=new se("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){X[e]=new se(e,1,!1,e.toLowerCase(),null,!0,!0)});function It(e,t,n,r){var l=X.hasOwnProperty(t)?X[t]:null;(l!==null?l.type!==0:r||!(2i||l[o]!==u[i]){var s=` +`+l[o].replace(" at new "," at ");return e.displayName&&s.includes("")&&(s=s.replace("",e.displayName)),s}while(1<=o&&0<=i);break}}}finally{j=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?S(e):""}function B(e){switch(e.tag){case 5:return S(e.type);case 16:return S("Lazy");case 13:return S("Suspense");case 19:return S("SuspenseList");case 0:case 2:case 15:return e=U(e.type,!1),e;case 11:return e=U(e.type.render,!1),e;case 1:return e=U(e.type,!0),e;default:return""}}function G(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case rt:return"Fragment";case Ze:return"Portal";case Tn:return"Profiler";case tn:return"StrictMode";case Ut:return"Suspense";case dt:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case kr:return(e.displayName||"Context")+".Consumer";case nn:return(e._context.displayName||"Context")+".Provider";case rn:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case pt:return t=e.displayName||null,t!==null?t:G(e.type)||"Memo";case Je:t=e._payload,e=e._init;try{return G(e(t))}catch{}}return null}function ne(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return G(t);case 8:return t===tn?"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 t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function A(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Z(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Le(e){var t=Z(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,u=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(o){r=""+o,u.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Sr(e){e._valueTracker||(e._valueTracker=Le(e))}function Do(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Z(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Cr(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Dl(e,t){var n=t.checked;return W({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Io(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=A(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Fo(e,t){t=t.checked,t!=null&&It(e,"checked",t,!1)}function Il(e,t){Fo(e,t);var n=A(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Fl(e,t.type,n):t.hasOwnProperty("defaultValue")&&Fl(e,t.type,A(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Uo(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Fl(e,t,n){(t!=="number"||Cr(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Mn=Array.isArray;function ln(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=Er.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Rn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var jn={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},Wa=["Webkit","ms","Moz","O"];Object.keys(jn).forEach(function(e){Wa.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),jn[t]=jn[e]})});function Wo(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||jn.hasOwnProperty(e)&&jn[e]?(""+t).trim():t+"px"}function Qo(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=Wo(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var Qa=W({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 $l(e,t){if(t){if(Qa[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(c(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(c(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(c(61))}if(t.style!=null&&typeof t.style!="object")throw Error(c(62))}}function Vl(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){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 Bl=null;function Hl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Wl=null,un=null,on=null;function Ko(e){if(e=nr(e)){if(typeof Wl!="function")throw Error(c(280));var t=e.stateNode;t&&(t=Kr(t),Wl(e.stateNode,e.type,t))}}function Yo(e){un?on?on.push(e):on=[e]:un=e}function Xo(){if(un){var e=un,t=on;if(on=un=null,Ko(e),t)for(e=0;e>>=0,e===0?32:31-(nc(e)/rc|0)|0}var zr=64,Lr=4194304;function Un(e){switch(e&-e){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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Or(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,u=e.pingedLanes,o=n&268435455;if(o!==0){var i=o&~l;i!==0?r=Un(i):(u&=o,u!==0&&(r=Un(u)))}else o=n&~l,o!==0?r=Un(o):u!==0&&(r=Un(u));if(r===0)return 0;if(t!==0&&t!==r&&(t&l)===0&&(l=r&-r,u=t&-t,l>=u||l===16&&(u&4194240)!==0))return t;if((r&4)!==0&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function An(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ve(t),e[t]=n}function ic(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Yn),Ci=" ",Ei=!1;function _i(e,t){switch(e){case"keyup":return Dc.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function xi(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var cn=!1;function Fc(e,t){switch(e){case"compositionend":return xi(t);case"keypress":return t.which!==32?null:(Ei=!0,Ci);case"textInput":return e=t.data,e===Ci&&Ei?null:e;default:return null}}function Uc(e,t){if(cn)return e==="compositionend"||!su&&_i(e,t)?(e=vi(),Dr=nu=gt=null,cn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Mi(n)}}function ji(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ji(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Di(){for(var e=window,t=Cr();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Cr(e.document)}return t}function fu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Yc(e){var t=Di(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ji(n.ownerDocument.documentElement,n)){if(r!==null&&fu(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,u=Math.min(r.start,l);r=r.end===void 0?u:Math.min(r.end,l),!e.extend&&u>r&&(l=r,r=u,u=l),l=Ri(n,u);var o=Ri(n,r);l&&o&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),u>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,fn=null,du=null,Jn=null,pu=!1;function Ii(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;pu||fn==null||fn!==Cr(r)||(r=fn,"selectionStart"in r&&fu(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}),Jn&&Zn(Jn,r)||(Jn=r,r=Hr(du,"onSelect"),0vn||(e.current=xu[vn],xu[vn]=null,vn--)}function Q(e,t){vn++,xu[vn]=e.current,e.current=t}var Ct={},ve=St(Ct),Ce=St(!1),Ht=Ct;function yn(e,t){var n=e.type.contextTypes;if(!n)return Ct;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},u;for(u in n)l[u]=t[u];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function Ee(e){return e=e.childContextTypes,e!=null}function Yr(){Y(Ce),Y(ve)}function Ji(e,t,n){if(ve.current!==Ct)throw Error(c(168));Q(ve,t),Q(Ce,n)}function qi(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(c(108,ne(e)||"Unknown",l));return W({},n,r)}function Xr(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ct,Ht=ve.current,Q(ve,e),Q(Ce,Ce.current),!0}function bi(e,t,n){var r=e.stateNode;if(!r)throw Error(c(169));n?(e=qi(e,t,Ht),r.__reactInternalMemoizedMergedChildContext=e,Y(Ce),Y(ve),Q(ve,e)):Y(Ce),Q(Ce,n)}var ut=null,Gr=!1,Nu=!1;function es(e){ut===null?ut=[e]:ut.push(e)}function uf(e){Gr=!0,es(e)}function Et(){if(!Nu&&ut!==null){Nu=!0;var e=0,t=$;try{var n=ut;for($=1;e>=o,l-=o,ot=1<<32-Ve(t)+l|n<T?(de=L,L=null):de=L.sibling;var I=y(f,L,d[T],k);if(I===null){L===null&&(L=de);break}e&&L&&I.alternate===null&&t(f,L),a=u(I,a,T),z===null?P=I:z.sibling=I,z=I,L=de}if(T===d.length)return n(f,L),J&&Qt(f,T),P;if(L===null){for(;TT?(de=L,L=null):de=L.sibling;var Mt=y(f,L,I.value,k);if(Mt===null){L===null&&(L=de);break}e&&L&&Mt.alternate===null&&t(f,L),a=u(Mt,a,T),z===null?P=Mt:z.sibling=Mt,z=Mt,L=de}if(I.done)return n(f,L),J&&Qt(f,T),P;if(L===null){for(;!I.done;T++,I=d.next())I=w(f,I.value,k),I!==null&&(a=u(I,a,T),z===null?P=I:z.sibling=I,z=I);return J&&Qt(f,T),P}for(L=r(f,L);!I.done;T++,I=d.next())I=E(L,f,T,I.value,k),I!==null&&(e&&I.alternate!==null&&L.delete(I.key===null?T:I.key),a=u(I,a,T),z===null?P=I:z.sibling=I,z=I);return e&&L.forEach(function($f){return t(f,$f)}),J&&Qt(f,T),P}function le(f,a,d,k){if(typeof d=="object"&&d!==null&&d.type===rt&&d.key===null&&(d=d.props.children),typeof d=="object"&&d!==null){switch(d.$$typeof){case Ft:e:{for(var P=d.key,z=a;z!==null;){if(z.key===P){if(P=d.type,P===rt){if(z.tag===7){n(f,z.sibling),a=l(z,d.props.children),a.return=f,f=a;break e}}else if(z.elementType===P||typeof P=="object"&&P!==null&&P.$$typeof===Je&&os(P)===z.type){n(f,z.sibling),a=l(z,d.props),a.ref=rr(f,z,d),a.return=f,f=a;break e}n(f,z);break}else t(f,z);z=z.sibling}d.type===rt?(a=bt(d.props.children,f.mode,k,d.key),a.return=f,f=a):(k=El(d.type,d.key,d.props,null,f.mode,k),k.ref=rr(f,a,d),k.return=f,f=k)}return o(f);case Ze:e:{for(z=d.key;a!==null;){if(a.key===z)if(a.tag===4&&a.stateNode.containerInfo===d.containerInfo&&a.stateNode.implementation===d.implementation){n(f,a.sibling),a=l(a,d.children||[]),a.return=f,f=a;break e}else{n(f,a);break}else t(f,a);a=a.sibling}a=_o(d,f.mode,k),a.return=f,f=a}return o(f);case Je:return z=d._init,le(f,a,z(d._payload),k)}if(Mn(d))return x(f,a,d,k);if($t(d))return N(f,a,d,k);br(f,d)}return typeof d=="string"&&d!==""||typeof d=="number"?(d=""+d,a!==null&&a.tag===6?(n(f,a.sibling),a=l(a,d),a.return=f,f=a):(n(f,a),a=Eo(d,f.mode,k),a.return=f,f=a),o(f)):n(f,a)}return le}var Sn=is(!0),ss=is(!1),el=St(null),tl=null,Cn=null,Mu=null;function Ru(){Mu=Cn=tl=null}function ju(e){var t=el.current;Y(el),e._currentValue=t}function Du(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function En(e,t){tl=e,Mu=Cn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(_e=!0),e.firstContext=null)}function Fe(e){var t=e._currentValue;if(Mu!==e)if(e={context:e,memoizedValue:t,next:null},Cn===null){if(tl===null)throw Error(c(308));Cn=e,tl.dependencies={lanes:0,firstContext:e}}else Cn=Cn.next=e;return t}var Kt=null;function Iu(e){Kt===null?Kt=[e]:Kt.push(e)}function as(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,Iu(t)):(n.next=l.next,l.next=n),t.interleaved=n,st(e,r)}function st(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var _t=!1;function Fu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function cs(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function at(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function xt(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(D&2)!==0){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,st(e,n)}return l=r.interleaved,l===null?(t.next=t,Iu(r)):(t.next=l.next,l.next=t),r.interleaved=t,st(e,n)}function nl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Jl(e,n)}}function fs(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,u=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};u===null?l=u=o:u=u.next=o,n=n.next}while(n!==null);u===null?l=u=t:u=u.next=t}else l=u=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:u,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function rl(e,t,n,r){var l=e.updateQueue;_t=!1;var u=l.firstBaseUpdate,o=l.lastBaseUpdate,i=l.shared.pending;if(i!==null){l.shared.pending=null;var s=i,m=s.next;s.next=null,o===null?u=m:o.next=m,o=s;var g=e.alternate;g!==null&&(g=g.updateQueue,i=g.lastBaseUpdate,i!==o&&(i===null?g.firstBaseUpdate=m:i.next=m,g.lastBaseUpdate=s))}if(u!==null){var w=l.baseState;o=0,g=m=s=null,i=u;do{var y=i.lane,E=i.eventTime;if((r&y)===y){g!==null&&(g=g.next={eventTime:E,lane:0,tag:i.tag,payload:i.payload,callback:i.callback,next:null});e:{var x=e,N=i;switch(y=t,E=n,N.tag){case 1:if(x=N.payload,typeof x=="function"){w=x.call(E,w,y);break e}w=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=N.payload,y=typeof x=="function"?x.call(E,w,y):x,y==null)break e;w=W({},w,y);break e;case 2:_t=!0}}i.callback!==null&&i.lane!==0&&(e.flags|=64,y=l.effects,y===null?l.effects=[i]:y.push(i))}else E={eventTime:E,lane:y,tag:i.tag,payload:i.payload,callback:i.callback,next:null},g===null?(m=g=E,s=w):g=g.next=E,o|=y;if(i=i.next,i===null){if(i=l.shared.pending,i===null)break;y=i,i=y.next,y.next=null,l.lastBaseUpdate=y,l.shared.pending=null}}while(!0);if(g===null&&(s=w),l.baseState=s,l.firstBaseUpdate=m,l.lastBaseUpdate=g,t=l.shared.interleaved,t!==null){l=t;do o|=l.lane,l=l.next;while(l!==t)}else u===null&&(l.shared.lanes=0);Gt|=o,e.lanes=o,e.memoizedState=w}}function ds(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Bu.transition;Bu.transition={};try{e(!1),t()}finally{$=n,Bu.transition=r}}function Ts(){return Ue().memoizedState}function cf(e,t,n){var r=Lt(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Ms(e))Rs(t,n);else if(n=as(e,t,n,r),n!==null){var l=Se();Ye(n,e,r,l),js(n,t,r)}}function ff(e,t,n){var r=Lt(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ms(e))Rs(t,l);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var o=t.lastRenderedState,i=u(o,n);if(l.hasEagerState=!0,l.eagerState=i,Be(i,o)){var s=t.interleaved;s===null?(l.next=l,Iu(t)):(l.next=s.next,s.next=l),t.interleaved=l;return}}catch{}finally{}n=as(e,t,l,r),n!==null&&(l=Se(),Ye(n,e,r,l),js(n,t,r))}}function Ms(e){var t=e.alternate;return e===b||t!==null&&t===b}function Rs(e,t){ir=ol=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function js(e,t,n){if((n&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Jl(e,n)}}var al={readContext:Fe,useCallback:ye,useContext:ye,useEffect:ye,useImperativeHandle:ye,useInsertionEffect:ye,useLayoutEffect:ye,useMemo:ye,useReducer:ye,useRef:ye,useState:ye,useDebugValue:ye,useDeferredValue:ye,useTransition:ye,useMutableSource:ye,useSyncExternalStore:ye,useId:ye,unstable_isNewReconciler:!1},df={readContext:Fe,useCallback:function(e,t){return tt().memoizedState=[e,t===void 0?null:t],e},useContext:Fe,useEffect:Es,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,il(4194308,4,Ns.bind(null,t,e),n)},useLayoutEffect:function(e,t){return il(4194308,4,e,t)},useInsertionEffect:function(e,t){return il(4,2,e,t)},useMemo:function(e,t){var n=tt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=tt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=cf.bind(null,b,e),[r.memoizedState,e]},useRef:function(e){var t=tt();return e={current:e},t.memoizedState=e},useState:Ss,useDebugValue:Gu,useDeferredValue:function(e){return tt().memoizedState=e},useTransition:function(){var e=Ss(!1),t=e[0];return e=af.bind(null,e[1]),tt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=b,l=tt();if(J){if(n===void 0)throw Error(c(407));n=n()}else{if(n=t(),fe===null)throw Error(c(349));(Xt&30)!==0||vs(r,t,n)}l.memoizedState=n;var u={value:n,getSnapshot:t};return l.queue=u,Es(gs.bind(null,r,u,e),[e]),r.flags|=2048,cr(9,ys.bind(null,r,u,n,t),void 0,null),n},useId:function(){var e=tt(),t=fe.identifierPrefix;if(J){var n=it,r=ot;n=(r&~(1<<32-Ve(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=sr++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[be]=t,e[tr]=r,ea(e,t,!1,!1),t.stateNode=e;e:{switch(o=Vl(n,r),n){case"dialog":K("cancel",e),K("close",e),l=r;break;case"iframe":case"object":case"embed":K("load",e),l=r;break;case"video":case"audio":for(l=0;lzn&&(t.flags|=128,r=!0,fr(u,!1),t.lanes=4194304)}else{if(!r)if(e=ll(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),fr(u,!0),u.tail===null&&u.tailMode==="hidden"&&!o.alternate&&!J)return ge(t),null}else 2*re()-u.renderingStartTime>zn&&n!==1073741824&&(t.flags|=128,r=!0,fr(u,!1),t.lanes=4194304);u.isBackwards?(o.sibling=t.child,t.child=o):(n=u.last,n!==null?n.sibling=o:t.child=o,u.last=o)}return u.tail!==null?(t=u.tail,u.rendering=t,u.tail=t.sibling,u.renderingStartTime=re(),t.sibling=null,n=q.current,Q(q,r?n&1|2:n&1),t):(ge(t),null);case 22:case 23:return ko(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(Re&1073741824)!==0&&(ge(t),t.subtreeFlags&6&&(t.flags|=8192)):ge(t),null;case 24:return null;case 25:return null}throw Error(c(156,t.tag))}function kf(e,t){switch(zu(t),t.tag){case 1:return Ee(t.type)&&Yr(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return _n(),Y(Ce),Y(ve),Vu(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Au(t),null;case 13:if(Y(q),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));kn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Y(q),null;case 4:return _n(),null;case 10:return ju(t.type._context),null;case 22:case 23:return ko(),null;case 24:return null;default:return null}}var pl=!1,we=!1,Sf=typeof WeakSet=="function"?WeakSet:Set,_=null;function Nn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){te(e,t,r)}else n.current=null}function io(e,t,n){try{n()}catch(r){te(e,t,r)}}var ra=!1;function Cf(e,t){if(wu=Rr,e=Di(),fu(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,u=r.focusNode;r=r.focusOffset;try{n.nodeType,u.nodeType}catch{n=null;break e}var o=0,i=-1,s=-1,m=0,g=0,w=e,y=null;t:for(;;){for(var E;w!==n||l!==0&&w.nodeType!==3||(i=o+l),w!==u||r!==0&&w.nodeType!==3||(s=o+r),w.nodeType===3&&(o+=w.nodeValue.length),(E=w.firstChild)!==null;)y=w,w=E;for(;;){if(w===e)break t;if(y===n&&++m===l&&(i=o),y===u&&++g===r&&(s=o),(E=w.nextSibling)!==null)break;w=y,y=w.parentNode}w=E}n=i===-1||s===-1?null:{start:i,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(ku={focusedElem:e,selectionRange:n},Rr=!1,_=t;_!==null;)if(t=_,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,_=e;else for(;_!==null;){t=_;try{var x=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var N=x.memoizedProps,le=x.memoizedState,f=t.stateNode,a=f.getSnapshotBeforeUpdate(t.elementType===t.type?N:We(t.type,N),le);f.__reactInternalSnapshotBeforeUpdate=a}break;case 3:var d=t.stateNode.containerInfo;d.nodeType===1?d.textContent="":d.nodeType===9&&d.documentElement&&d.removeChild(d.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(c(163))}}catch(k){te(t,t.return,k)}if(e=t.sibling,e!==null){e.return=t.return,_=e;break}_=t.return}return x=ra,ra=!1,x}function dr(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var u=l.destroy;l.destroy=void 0,u!==void 0&&io(t,n,u)}l=l.next}while(l!==r)}}function ml(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function so(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function la(e){var t=e.alternate;t!==null&&(e.alternate=null,la(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[be],delete t[tr],delete t[_u],delete t[rf],delete t[lf])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function ua(e){return e.tag===5||e.tag===3||e.tag===4}function oa(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ua(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function ao(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Qr));else if(r!==4&&(e=e.child,e!==null))for(ao(e,t,n),e=e.sibling;e!==null;)ao(e,t,n),e=e.sibling}function co(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(co(e,t,n),e=e.sibling;e!==null;)co(e,t,n),e=e.sibling}var pe=null,Qe=!1;function Nt(e,t,n){for(n=n.child;n!==null;)ia(e,t,n),n=n.sibling}function ia(e,t,n){if(qe&&typeof qe.onCommitFiberUnmount=="function")try{qe.onCommitFiberUnmount(Pr,n)}catch{}switch(n.tag){case 5:we||Nn(n,t);case 6:var r=pe,l=Qe;pe=null,Nt(e,t,n),pe=r,Qe=l,pe!==null&&(Qe?(e=pe,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):pe.removeChild(n.stateNode));break;case 18:pe!==null&&(Qe?(e=pe,n=n.stateNode,e.nodeType===8?Eu(e.parentNode,n):e.nodeType===1&&Eu(e,n),Wn(e)):Eu(pe,n.stateNode));break;case 4:r=pe,l=Qe,pe=n.stateNode.containerInfo,Qe=!0,Nt(e,t,n),pe=r,Qe=l;break;case 0:case 11:case 14:case 15:if(!we&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var u=l,o=u.destroy;u=u.tag,o!==void 0&&((u&2)!==0||(u&4)!==0)&&io(n,t,o),l=l.next}while(l!==r)}Nt(e,t,n);break;case 1:if(!we&&(Nn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(i){te(n,t,i)}Nt(e,t,n);break;case 21:Nt(e,t,n);break;case 22:n.mode&1?(we=(r=we)||n.memoizedState!==null,Nt(e,t,n),we=r):Nt(e,t,n);break;default:Nt(e,t,n)}}function sa(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Sf),t.forEach(function(r){var l=Tf.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function Ke(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=o),r&=~u}if(r=l,r=re()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*_f(r/1960))-r,10e?16:e,zt===null)var r=!1;else{if(e=zt,zt=null,wl=0,(D&6)!==0)throw Error(c(331));var l=D;for(D|=4,_=e.current;_!==null;){var u=_,o=u.child;if((_.flags&16)!==0){var i=u.deletions;if(i!==null){for(var s=0;sre()-mo?Jt(e,0):po|=n),Ne(e,t)}function Sa(e,t){t===0&&((e.mode&1)===0?t=1:(t=Lr,Lr<<=1,(Lr&130023424)===0&&(Lr=4194304)));var n=Se();e=st(e,t),e!==null&&(An(e,t,n),Ne(e,n))}function Of(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Sa(e,n)}function Tf(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(c(314))}r!==null&&r.delete(t),Sa(e,n)}var Ca;Ca=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ce.current)_e=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return _e=!1,gf(e,t,n);_e=(e.flags&131072)!==0}else _e=!1,J&&(t.flags&1048576)!==0&&ts(t,Jr,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;dl(e,t),e=t.pendingProps;var l=yn(t,ve.current);En(t,n),l=Wu(null,t,r,e,l,n);var u=Qu();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ee(r)?(u=!0,Xr(t)):u=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,Fu(t),l.updater=cl,t.stateNode=l,l._reactInternals=t,Ju(t,r,e,n),t=to(null,t,r,!0,u,n)):(t.tag=0,J&&u&&Pu(t),ke(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(dl(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=Rf(r),e=We(r,e),l){case 0:t=eo(null,t,r,e,n);break e;case 1:t=Xs(null,t,r,e,n);break e;case 11:t=Hs(null,t,r,e,n);break e;case 14:t=Ws(null,t,r,We(r.type,e),n);break e}throw Error(c(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:We(r,l),eo(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:We(r,l),Xs(e,t,r,l,n);case 3:e:{if(Gs(t),e===null)throw Error(c(387));r=t.pendingProps,u=t.memoizedState,l=u.element,cs(e,t),rl(t,r,null,n);var o=t.memoizedState;if(r=o.element,u.isDehydrated)if(u={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){l=xn(Error(c(423)),t),t=Zs(e,t,r,n,l);break e}else if(r!==l){l=xn(Error(c(424)),t),t=Zs(e,t,r,n,l);break e}else for(Me=kt(t.stateNode.containerInfo.firstChild),Te=t,J=!0,He=null,n=ss(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(kn(),r===l){t=ct(e,t,n);break e}ke(e,t,r,n)}t=t.child}return t;case 5:return ps(t),e===null&&Ou(t),r=t.type,l=t.pendingProps,u=e!==null?e.memoizedProps:null,o=l.children,Su(r,l)?o=null:u!==null&&Su(r,u)&&(t.flags|=32),Ys(e,t),ke(e,t,o,n),t.child;case 6:return e===null&&Ou(t),null;case 13:return Js(e,t,n);case 4:return Uu(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Sn(t,null,r,n):ke(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:We(r,l),Hs(e,t,r,l,n);case 7:return ke(e,t,t.pendingProps,n),t.child;case 8:return ke(e,t,t.pendingProps.children,n),t.child;case 12:return ke(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,u=t.memoizedProps,o=l.value,Q(el,r._currentValue),r._currentValue=o,u!==null)if(Be(u.value,o)){if(u.children===l.children&&!Ce.current){t=ct(e,t,n);break e}}else for(u=t.child,u!==null&&(u.return=t);u!==null;){var i=u.dependencies;if(i!==null){o=u.child;for(var s=i.firstContext;s!==null;){if(s.context===r){if(u.tag===1){s=at(-1,n&-n),s.tag=2;var m=u.updateQueue;if(m!==null){m=m.shared;var g=m.pending;g===null?s.next=s:(s.next=g.next,g.next=s),m.pending=s}}u.lanes|=n,s=u.alternate,s!==null&&(s.lanes|=n),Du(u.return,n,t),i.lanes|=n;break}s=s.next}}else if(u.tag===10)o=u.type===t.type?null:u.child;else if(u.tag===18){if(o=u.return,o===null)throw Error(c(341));o.lanes|=n,i=o.alternate,i!==null&&(i.lanes|=n),Du(o,n,t),o=u.sibling}else o=u.child;if(o!==null)o.return=u;else for(o=u;o!==null;){if(o===t){o=null;break}if(u=o.sibling,u!==null){u.return=o.return,o=u;break}o=o.return}u=o}ke(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,En(t,n),l=Fe(l),r=r(l),t.flags|=1,ke(e,t,r,n),t.child;case 14:return r=t.type,l=We(r,t.pendingProps),l=We(r.type,l),Ws(e,t,r,l,n);case 15:return Qs(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:We(r,l),dl(e,t),t.tag=1,Ee(r)?(e=!0,Xr(t)):e=!1,En(t,n),Is(t,r,l),Ju(t,r,l,n),to(null,t,r,!0,e,n);case 19:return bs(e,t,n);case 22:return Ks(e,t,n)}throw Error(c(156,t.tag))};function Ea(e,t){return ni(e,t)}function Mf(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,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 $e(e,t,n,r){return new Mf(e,t,n,r)}function Co(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Rf(e){if(typeof e=="function")return Co(e)?1:0;if(e!=null){if(e=e.$$typeof,e===rn)return 11;if(e===pt)return 14}return 2}function Tt(e,t){var n=e.alternate;return n===null?(n=$e(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function El(e,t,n,r,l,u){var o=2;if(r=e,typeof e=="function")Co(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case rt:return bt(n.children,l,u,t);case tn:o=8,l|=8;break;case Tn:return e=$e(12,n,t,l|2),e.elementType=Tn,e.lanes=u,e;case Ut:return e=$e(13,n,t,l),e.elementType=Ut,e.lanes=u,e;case dt:return e=$e(19,n,t,l),e.elementType=dt,e.lanes=u,e;case ae:return _l(n,l,u,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case nn:o=10;break e;case kr:o=9;break e;case rn:o=11;break e;case pt:o=14;break e;case Je:o=16,r=null;break e}throw Error(c(130,e==null?e:typeof e,""))}return t=$e(o,n,t,l),t.elementType=e,t.type=r,t.lanes=u,t}function bt(e,t,n,r){return e=$e(7,e,r,t),e.lanes=n,e}function _l(e,t,n,r){return e=$e(22,e,r,t),e.elementType=ae,e.lanes=n,e.stateNode={isHidden:!1},e}function Eo(e,t,n){return e=$e(6,e,null,t),e.lanes=n,e}function _o(e,t,n){return t=$e(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function jf(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Zl(0),this.expirationTimes=Zl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Zl(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function xo(e,t,n,r,l,u,o,i,s){return e=new jf(e,t,n,i,s),t===1?(t=1,u===!0&&(t|=8)):t=0,u=$e(3,null,null,t),e.current=u,u.stateNode=e,u.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Fu(u),e}function Df(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(h)}catch(v){console.error(v)}}return h(),To.exports=Kf(),To.exports}var Da;function Yf(){if(Da)return Tl;Da=1;var h=$a();return Tl.createRoot=h.createRoot,Tl.hydrateRoot=h.hydrateRoot,Tl}var Id=Yf();/** + * @license lucide-react v0.535.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Xf=h=>h.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Gf=h=>h.replace(/^([A-Z])|[\s-_]+(\w)/g,(v,c,C)=>C?C.toUpperCase():c.toLowerCase()),Ia=h=>{const v=Gf(h);return v.charAt(0).toUpperCase()+v.slice(1)},Va=(...h)=>h.filter((v,c,C)=>!!v&&v.trim()!==""&&C.indexOf(v)===c).join(" ").trim(),Zf=h=>{for(const v in h)if(v.startsWith("aria-")||v==="role"||v==="title")return!0};/** + * @license lucide-react v0.535.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var Jf={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + * @license lucide-react v0.535.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const qf=On.forwardRef(({color:h="currentColor",size:v=24,strokeWidth:c=2,absoluteStrokeWidth:C,className:O="",children:M,iconNode:H,...F},V)=>On.createElement("svg",{ref:V,...Jf,width:v,height:v,stroke:h,strokeWidth:C?Number(c)*24/Number(v):c,className:Va("lucide",O),...!M&&!Zf(F)&&{"aria-hidden":"true"},...F},[...H.map(([ze,he])=>On.createElement(ze,he)),...Array.isArray(M)?M:[M]]));/** + * @license lucide-react v0.535.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ee=(h,v)=>{const c=On.forwardRef(({className:C,...O},M)=>On.createElement(qf,{ref:M,iconNode:v,className:Va(`lucide-${Xf(Ia(h))}`,`lucide-${h}`,C),...O}));return c.displayName=Ia(h),c};/** + * @license lucide-react v0.535.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const bf=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],Fd=ee("calendar",bf);/** + * @license lucide-react v0.535.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ed=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Ud=ee("chevron-left",ed);/** + * @license lucide-react v0.535.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const td=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Ad=ee("chevron-right",td);/** + * @license lucide-react v0.535.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const nd=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],$d=ee("cloud",nd);/** + * @license lucide-react v0.535.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const rd=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Vd=ee("copy",rd);/** + * @license lucide-react v0.535.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ld=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],Bd=ee("download",ld);/** + * @license lucide-react v0.535.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ud=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Hd=ee("eye",ud);/** + * @license lucide-react v0.535.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const od=[["path",{d:"M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z",key:"1jg4f8"}]],Wd=ee("facebook",od);/** + * @license lucide-react v0.535.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const id=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],Qd=ee("history",id);/** + * @license lucide-react v0.535.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const sd=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],Kd=ee("image",sd);/** + * @license lucide-react v0.535.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ad=[["rect",{width:"20",height:"20",x:"2",y:"2",rx:"5",ry:"5",key:"2e1cvw"}],["path",{d:"M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z",key:"9exkf1"}],["line",{x1:"17.5",x2:"17.51",y1:"6.5",y2:"6.5",key:"r4j83e"}]],Yd=ee("instagram",ad);/** + * @license lucide-react v0.535.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const cd=[["path",{d:"M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z",key:"c2jq9f"}],["rect",{width:"4",height:"12",x:"2",y:"9",key:"mk3on5"}],["circle",{cx:"4",cy:"4",r:"2",key:"bt5ra8"}]],Xd=ee("linkedin",cd);/** + * @license lucide-react v0.535.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const fd=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],Gd=ee("moon",fd);/** + * @license lucide-react v0.535.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const dd=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Zd=ee("settings",dd);/** + * @license lucide-react v0.535.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const pd=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],Jd=ee("sparkles",pd);/** + * @license lucide-react v0.535.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const md=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],qd=ee("star",md);/** + * @license lucide-react v0.535.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const hd=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],bd=ee("sun",hd);/** + * @license lucide-react v0.535.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const vd=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],ep=ee("trash-2",vd);/** + * @license lucide-react v0.535.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const yd=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],tp=ee("triangle-alert",yd);/** + * @license lucide-react v0.535.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const gd=[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],np=ee("wand-sparkles",gd);/** + * @license lucide-react v0.535.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const wd=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],rp=ee("x",wd);/** + * @license lucide-react v0.535.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const kd=[["path",{d:"M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17",key:"1q2vi4"}],["path",{d:"m10 15 5-3-5-3z",key:"1jp15x"}]],lp=ee("youtube",kd);/** + * @license lucide-react v0.535.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Sd=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],up=ee("zap",Sd);$a();var Ba={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Fa=Xe.createContext&&Xe.createContext(Ba),Cd=["attr","size","title"];function Ed(h,v){if(h==null)return{};var c=_d(h,v),C,O;if(Object.getOwnPropertySymbols){var M=Object.getOwnPropertySymbols(h);for(O=0;O=0)&&Object.prototype.propertyIsEnumerable.call(h,C)&&(c[C]=h[C])}return c}function _d(h,v){if(h==null)return{};var c={};for(var C in h)if(Object.prototype.hasOwnProperty.call(h,C)){if(v.indexOf(C)>=0)continue;c[C]=h[C]}return c}function Ml(){return Ml=Object.assign?Object.assign.bind():function(h){for(var v=1;vXe.createElement(v.tag,Rl({key:c},v.attr),Ha(v.child)))}function jo(h){return v=>Xe.createElement(zd,Ml({attr:Rl({},h.attr)},v),Ha(h.child))}function zd(h){var v=c=>{var{attr:C,size:O,title:M}=h,H=Ed(h,Cd),F=O||c.size||"1em",V;return c.className&&(V=c.className),h.className&&(V=(V?V+" ":"")+h.className),Xe.createElement("svg",Ml({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},c.attr,C,H,{className:V,style:Rl(Rl({color:h.color||c.color},c.style),h.style),height:F,width:F,xmlns:"http://www.w3.org/2000/svg"}),M&&Xe.createElement("title",null,M),h.children)};return Fa!==void 0?Xe.createElement(Fa.Consumer,null,c=>v(c)):v(Ba)}function op(h){return jo({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M0 256C0 114.6 114.6 0 256 0S512 114.6 512 256s-114.6 256-256 256L37.1 512c-13.7 0-20.5-16.5-10.9-26.2L75 437C28.7 390.7 0 326.7 0 256zM349.6 153.6c23.6 0 42.7-19.1 42.7-42.7s-19.1-42.7-42.7-42.7c-20.6 0-37.8 14.6-41.8 34c-34.5 3.7-61.4 33-61.4 68.4l0 .2c-37.5 1.6-71.8 12.3-99 29.1c-10.1-7.8-22.8-12.5-36.5-12.5c-33 0-59.8 26.8-59.8 59.8c0 24 14.1 44.6 34.4 54.1c2 69.4 77.6 125.2 170.6 125.2s168.7-55.9 170.6-125.3c20.2-9.6 34.1-30.2 34.1-54c0-33-26.8-59.8-59.8-59.8c-13.7 0-26.3 4.6-36.4 12.4c-27.4-17-62.1-27.7-100-29.1l0-.2c0-25.4 18.9-46.5 43.4-49.9l0 0c4.4 18.8 21.3 32.8 41.5 32.8zM177.1 246.9c16.7 0 29.5 17.6 28.5 39.3s-13.5 29.6-30.3 29.6s-31.4-8.8-30.4-30.5s15.4-38.3 32.1-38.3zm190.1 38.3c1 21.7-13.7 30.5-30.4 30.5s-29.3-7.9-30.3-29.6c-1-21.7 11.8-39.3 28.5-39.3s31.2 16.6 32.1 38.3zm-48.1 56.7c-10.3 24.6-34.6 41.9-63 41.9s-52.7-17.3-63-41.9c-1.2-2.9 .8-6.2 3.9-6.5c18.4-1.9 38.3-2.9 59.1-2.9s40.7 1 59.1 2.9c3.1 .3 5.1 3.6 3.9 6.5z"},child:[]}]})(h)}function ip(h){return jo({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M448,209.91a210.06,210.06,0,0,1-122.77-39.25V349.38A162.55,162.55,0,1,1,185,188.31V278.2a74.62,74.62,0,1,0,52.23,71.18V0l88,0a121.18,121.18,0,0,0,1.86,22.17h0A122.18,122.18,0,0,0,381,102.39a121.43,121.43,0,0,0,67,20.14Z"},child:[]}]})(h)}function sp(h){return jo({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M389.2 48h70.6L305.6 224.2 487 464H345L233.7 318.6 106.5 464H35.8L200.7 275.5 26.8 48H172.4L272.9 180.9 389.2 48zM364.4 421.8h39.1L151.1 88h-42L364.4 421.8z"},child:[]}]})(h)}function Ld(h,v){if(h==null)return{};var c=Od(h,v),C,O;if(Object.getOwnPropertySymbols){var M=Object.getOwnPropertySymbols(h);for(O=0;O=0)&&Object.prototype.propertyIsEnumerable.call(h,C)&&(c[C]=h[C])}return c}function Od(h,v){if(h==null)return{};var c={},C=Object.keys(h),O,M;for(M=0;M=0)&&(c[O]=h[O]);return c}function jl(){return jl=Object.assign||function(h){for(var v=1;v{this.reCalculateColumnCount()})}reCalculateColumnCount(){const v=window&&window.innerWidth||1/0;let c=this.props.breakpointCols;typeof c!="object"&&(c={default:parseInt(c)||Mo});let C=1/0,O=c.default||Mo;for(let M in c){const H=parseInt(M);H>0&&v<=H&&H"u"&&(H="my-masonry-grid_column"));const F=gr(gr(gr({},v),c),{},{style:gr(gr({},c.style),{},{width:M}),className:H});return O.map((V,ze)=>Xe.createElement("div",jl({},F,{key:ze}),V))}logDeprecated(v){console.error("[Masonry]",v)}render(){const v=this.props,{children:c,breakpointCols:C,columnClassName:O,columnAttrs:M,column:H,className:F}=v,V=Ld(v,["children","breakpointCols","columnClassName","columnAttrs","column","className"]);let ze=F;return typeof F!="string"&&(this.logDeprecated('The property "className" requires a string'),typeof F>"u"&&(ze="my-masonry-grid")),Xe.createElement("div",jl({},V,{className:ze}),this.renderColumns())}}Rd.defaultProps=Md;export{Ud as C,Bd as D,Hd as E,Wd as F,Qd as H,Yd as I,Xd as L,Gd as M,Xe as R,bd as S,ep as T,np as W,rp as X,lp as Y,up as Z,Jd as a,ip as b,sp as c,op as d,Ad as e,qd as f,Zd as g,Kd as h,$d as i,Dd as j,Rd as k,Fd as l,Vd as m,tp as n,Id as o,On as r}; diff --git a/assets/vendor-other-B0VykD61.js b/assets/vendor-other-B0VykD61.js new file mode 100644 index 0000000000000000000000000000000000000000..fa14c1634f38d423d565667ff48587d500411558 --- /dev/null +++ b/assets/vendor-other-B0VykD61.js @@ -0,0 +1,9 @@ +var je={exports:{}},Ue={};/** + * @license React + * scheduler.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Ft;function ar(){return Ft||(Ft=1,function(e){function t(c,y){var k=c.length;c.push(y);e:for(;0>>1,F=c[V];if(0>>1;Vs(J,k))$s(D,J)?(c[V]=D,c[$]=k,V=$):(c[V]=J,c[z]=k,V=z);else if($s(D,k))c[V]=D,c[$]=k,V=$;else break e}}return y}function s(c,y){var k=c.sortIndex-y.sortIndex;return k!==0?k:c.id-y.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var i=Date,l=i.now();e.unstable_now=function(){return i.now()-l}}var a=[],u=[],d=1,m=null,g=3,T=!1,w=!1,x=!1,I=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,K=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function S(c){for(var y=n(u);y!==null;){if(y.callback===null)r(u);else if(y.startTime<=c)r(u),y.sortIndex=y.expirationTime,t(a,y);else break;y=n(u)}}function P(c){if(x=!1,S(c),!w)if(n(a)!==null)w=!0,G(b);else{var y=n(u);y!==null&&W(P,y.startTime-c)}}function b(c,y){w=!1,x&&(x=!1,E(f),f=-1),T=!0;var k=g;try{for(S(y),m=n(a);m!==null&&(!(m.expirationTime>y)||c&&!le());){var V=m.callback;if(typeof V=="function"){m.callback=null,g=m.priorityLevel;var F=V(m.expirationTime<=y);y=e.unstable_now(),typeof F=="function"?m.callback=F:m===n(a)&&r(a),S(y)}else r(a);m=n(a)}if(m!==null)var L=!0;else{var z=n(u);z!==null&&W(P,z.startTime-y),L=!1}return L}finally{m=null,g=k,T=!1}}var A=!1,C=null,f=-1,R=5,B=-1;function le(){return!(e.unstable_now()-Bc||125V?(c.sortIndex=k,t(u,c),n(a)===null&&c===n(u)&&(x?(E(f),f=-1):x=!0,W(P,k-V))):(c.sortIndex=F,t(a,c),w||T||(w=!0,G(b))),c},e.unstable_shouldYield=le,e.unstable_wrapCallback=function(c){var y=g;return function(){var k=g;g=y;try{return c.apply(this,arguments)}finally{g=k}}}}(Ue)),Ue}var Nt;function ti(){return Nt||(Nt=1,je.exports=ar()),je.exports}function lr(e,t){e.indexOf(t)===-1&&e.push(t)}function cr(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const ae=(e,t,n)=>n>t?t:n{};const ke={},ur=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function un(e){return typeof e=="object"&&e!==null}const dr=e=>/^0[^.\s]+$/u.test(e);function wt(e){let t;return()=>(t===void 0&&(t=e()),t)}const me=e=>e,fr=(e,t)=>n=>t(e(n)),vt=(...e)=>e.reduce(fr),dn=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class mr{constructor(){this.subscriptions=[]}add(t){return lr(this.subscriptions,t),()=>cr(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let o=0;oe*1e3,X=e=>e/1e3;function fn(e,t){return t?e*(1e3/t):0}const mn=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,hr=1e-7,pr=12;function gr(e,t,n,r,s){let o,i,l=0;do i=t+(n-t)/2,o=mn(i,r,s)-e,o>0?n=i:t=i;while(Math.abs(o)>hr&&++lgr(o,0,1,e,n);return o=>o===0||o===1?o:mn(s(o),t,r)}const hn=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,pn=e=>t=>1-e(1-t),gn=Ae(.33,1.53,.69,.99),xt=pn(gn),bn=hn(xt),yn=e=>(e*=2)<1?.5*xt(e):.5*(2-Math.pow(2,-10*(e-1))),kt=e=>1-Math.sin(Math.acos(e)),br=pn(kt),wn=hn(kt),yr=Ae(.42,0,1,1),wr=Ae(0,0,.58,1),vn=Ae(.42,0,.58,1),vr=e=>Array.isArray(e)&&typeof e[0]!="number",xn=e=>Array.isArray(e)&&typeof e[0]=="number",xr={linear:me,easeIn:yr,easeInOut:vn,easeOut:wr,circIn:kt,circInOut:wn,circOut:br,backIn:xt,backInOut:bn,backOut:gn,anticipate:yn},kr=e=>typeof e=="string",zt=e=>{if(xn(e)){yt(e.length===4);const[t,n,r,s]=e;return Ae(t,n,r,s)}else if(kr(e))return xr[e];return e},Re=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Tr(e,t){let n=new Set,r=new Set,s=!1,o=!1;const i=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1};function a(d){i.has(d)&&(u.schedule(d),e()),d(l)}const u={schedule:(d,m=!1,g=!1)=>{const w=g&&s?n:r;return m&&i.add(d),w.has(d)||w.add(d),d},cancel:d=>{r.delete(d),i.delete(d)},process:d=>{if(l=d,s){o=!0;return}s=!0,[n,r]=[r,n],n.forEach(a),n.clear(),s=!1,o&&(o=!1,u.process(d))}};return u}const Mr=40;function kn(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,i=Re.reduce((S,P)=>(S[P]=Tr(o),S),{}),{setup:l,read:a,resolveKeyframes:u,preUpdate:d,update:m,preRender:g,render:T,postRender:w}=i,x=()=>{const S=ke.useManualTiming?s.timestamp:performance.now();n=!1,ke.useManualTiming||(s.delta=r?1e3/60:Math.max(Math.min(S-s.timestamp,Mr),1)),s.timestamp=S,s.isProcessing=!0,l.process(s),a.process(s),u.process(s),d.process(s),m.process(s),g.process(s),T.process(s),w.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(x))},I=()=>{n=!0,r=!0,s.isProcessing||e(x)};return{schedule:Re.reduce((S,P)=>{const b=i[P];return S[P]=(A,C=!1,f=!1)=>(n||I(),b.schedule(A,C,f)),S},{}),cancel:S=>{for(let P=0;P(Ne===void 0&&U.set(Oe.isProcessing||ke.useManualTiming?Oe.timestamp:performance.now()),Ne),set:e=>{Ne=e,queueMicrotask(Sr)}},Tn=e=>t=>typeof t=="string"&&t.startsWith(e),ri=Tn("--"),Er=Tn("var(--"),Tt=e=>Er(e)?Pr.test(e.split("/*")[0].trim()):!1,Pr=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,pe={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Te={...pe,transform:e=>ae(0,1,e)},Ve={...pe,default:1},ve=e=>Math.round(e*1e5)/1e5,Mt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Ir(e){return e==null}const Cr=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,At=(e,t)=>n=>!!(typeof n=="string"&&Cr.test(n)&&n.startsWith(e)||t&&!Ir(n)&&Object.prototype.hasOwnProperty.call(n,t)),Mn=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,o,i,l]=r.match(Mt);return{[e]:parseFloat(s),[t]:parseFloat(o),[n]:parseFloat(i),alpha:l!==void 0?parseFloat(l):1}},Rr=e=>ae(0,255,e),$e={...pe,transform:e=>Math.round(Rr(e))},re={test:At("rgb","red"),parse:Mn("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+$e.transform(e)+", "+$e.transform(t)+", "+$e.transform(n)+", "+ve(Te.transform(r))+")"};function Vr(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const nt={test:At("#"),parse:Vr,transform:re.transform},Se=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),ee=Se("deg"),fe=Se("%"),v=Se("px"),Dr=Se("vh"),Fr=Se("vw"),Lt={...fe,parse:e=>fe.parse(e)/100,transform:e=>fe.transform(e*100)},de={test:At("hsl","hue"),parse:Mn("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+fe.transform(ve(t))+", "+fe.transform(ve(n))+", "+ve(Te.transform(r))+")"},O={test:e=>re.test(e)||nt.test(e)||de.test(e),parse:e=>re.test(e)?re.parse(e):de.test(e)?de.parse(e):nt.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?re.transform(e):de.transform(e),getAnimatableNone:e=>{const t=O.parse(e);return t.alpha=0,O.transform(t)}},Nr=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function zr(e){return isNaN(e)&&typeof e=="string"&&(e.match(Mt)?.length||0)+(e.match(Nr)?.length||0)>0}const An="number",Sn="color",Lr="var",Or="var(",Ot="${}",_r=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Me(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let o=0;const l=t.replace(_r,a=>(O.test(a)?(r.color.push(o),s.push(Sn),n.push(O.parse(a))):a.startsWith(Or)?(r.var.push(o),s.push(Lr),n.push(a)):(r.number.push(o),s.push(An),n.push(parseFloat(a))),++o,Ot)).split(Ot);return{values:n,split:l,indexes:r,types:s}}function En(e){return Me(e).values}function Pn(e){const{split:t,types:n}=Me(e),r=t.length;return s=>{let o="";for(let i=0;itypeof e=="number"?0:O.test(e)?O.getAnimatableNone(e):e;function Br(e){const t=En(e);return Pn(e)(t.map(Kr))}const Ee={test:zr,parse:En,createTransformer:Pn,getAnimatableNone:Br};function Ye(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Gr({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,o=0,i=0;if(!t)s=o=i=n;else{const l=n<.5?n*(1+t):n+t-n*t,a=2*n-l;s=Ye(a,l,e+1/3),o=Ye(a,l,e),i=Ye(a,l,e-1/3)}return{red:Math.round(s*255),green:Math.round(o*255),blue:Math.round(i*255),alpha:r}}function _e(e,t){return n=>n>0?t:e}const Ge=(e,t,n)=>e+(t-e)*n,Xe=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},Wr=[nt,re,de],jr=e=>Wr.find(t=>t.test(e));function _t(e){const t=jr(e);if(!t)return!1;let n=t.parse(e);return t===de&&(n=Gr(n)),n}const Kt=(e,t)=>{const n=_t(e),r=_t(t);if(!n||!r)return _e(e,t);const s={...n};return o=>(s.red=Xe(n.red,r.red,o),s.green=Xe(n.green,r.green,o),s.blue=Xe(n.blue,r.blue,o),s.alpha=Ge(n.alpha,r.alpha,o),re.transform(s))},rt=new Set(["none","hidden"]);function Ur(e,t){return rt.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function $r(e,t){return n=>Ge(e,t,n)}function St(e){return typeof e=="number"?$r:typeof e=="string"?Tt(e)?_e:O.test(e)?Kt:qr:Array.isArray(e)?In:typeof e=="object"?O.test(e)?Kt:Yr:_e}function In(e,t){const n=[...e],r=n.length,s=e.map((o,i)=>St(o)(o,t[i]));return o=>{for(let i=0;i{for(const o in r)n[o]=r[o](s);return n}}function Xr(e,t){const n=[],r={color:0,var:0,number:0};for(let s=0;s{const n=Ee.createTransformer(t),r=Me(e),s=Me(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?rt.has(e)&&!s.values.length||rt.has(t)&&!r.values.length?Ur(e,t):vt(In(Xr(r,s),s.values),n):_e(e,t)};function Cn(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Ge(e,t,n):St(e)(e,t)}const Zr=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>Le.update(t,n),stop:()=>Ar(t),now:()=>Oe.isProcessing?Oe.timestamp:U.now()}},Rn=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let o=0;o=Ke?1/0:t}function Hr(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min(Et(r),Ke);return{type:"keyframes",ease:o=>r.next(s*o).value/t,duration:X(s)}}const Jr=5;function Vn(e,t,n){const r=Math.max(t-Jr,0);return fn(n-e(r),t-r)}const N={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},qe=.001;function Qr({duration:e=N.duration,bounce:t=N.bounce,velocity:n=N.velocity,mass:r=N.mass}){let s,o,i=1-t;i=ae(N.minDamping,N.maxDamping,i),e=ae(N.minDuration,N.maxDuration,X(e)),i<1?(s=u=>{const d=u*i,m=d*e,g=d-n,T=st(u,i),w=Math.exp(-m);return qe-g/T*w},o=u=>{const m=u*i*e,g=m*n+n,T=Math.pow(i,2)*Math.pow(u,2)*e,w=Math.exp(-m),x=st(Math.pow(u,2),i);return(-s(u)+qe>0?-1:1)*((g-T)*w)/x}):(s=u=>{const d=Math.exp(-u*e),m=(u-n)*e+1;return-qe+d*m},o=u=>{const d=Math.exp(-u*e),m=(n-u)*(e*e);return d*m});const l=5/e,a=ts(s,o,l);if(e=he(e),isNaN(a))return{stiffness:N.stiffness,damping:N.damping,duration:e};{const u=Math.pow(a,2)*r;return{stiffness:u,damping:i*2*Math.sqrt(r*u),duration:e}}}const es=12;function ts(e,t,n){let r=n;for(let s=1;se[n]!==void 0)}function ss(e){let t={velocity:N.velocity,stiffness:N.stiffness,damping:N.damping,mass:N.mass,isResolvedFromDuration:!1,...e};if(!Bt(e,rs)&&Bt(e,ns))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,o=2*ae(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:N.mass,stiffness:s,damping:o}}else{const n=Qr(e);t={...t,...n,mass:N.mass},t.isResolvedFromDuration=!0}return t}function Be(e=N.visualDuration,t=N.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const o=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],l={done:!1,value:o},{stiffness:a,damping:u,mass:d,duration:m,velocity:g,isResolvedFromDuration:T}=ss({...n,velocity:-X(n.velocity||0)}),w=g||0,x=u/(2*Math.sqrt(a*d)),I=i-o,E=X(Math.sqrt(a/d)),K=Math.abs(I)<5;r||(r=K?N.restSpeed.granular:N.restSpeed.default),s||(s=K?N.restDelta.granular:N.restDelta.default);let S;if(x<1){const b=st(E,x);S=A=>{const C=Math.exp(-x*E*A);return i-C*((w+x*E*I)/b*Math.sin(b*A)+I*Math.cos(b*A))}}else if(x===1)S=b=>i-Math.exp(-E*b)*(I+(w+E*I)*b);else{const b=E*Math.sqrt(x*x-1);S=A=>{const C=Math.exp(-x*E*A),f=Math.min(b*A,300);return i-C*((w+x*E*I)*Math.sinh(f)+b*I*Math.cosh(f))/b}}const P={calculatedDuration:T&&m||null,next:b=>{const A=S(b);if(T)l.done=b>=m;else{let C=b===0?w:0;x<1&&(C=b===0?he(w):Vn(S,b,A));const f=Math.abs(C)<=r,R=Math.abs(i-A)<=s;l.done=f&&R}return l.value=l.done?i:A,l},toString:()=>{const b=Math.min(Et(P),Ke),A=Rn(C=>P.next(b*C).value,b,30);return b+"ms "+A},toTransition:()=>{}};return P}Be.applyToOptions=e=>{const t=Hr(e,100,Be);return e.ease=t.ease,e.duration=he(t.duration),e.type="keyframes",e};function ot({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:i,min:l,max:a,restDelta:u=.5,restSpeed:d}){const m=e[0],g={done:!1,value:m},T=f=>l!==void 0&&fa,w=f=>l===void 0?a:a===void 0||Math.abs(l-f)-x*Math.exp(-f/r),S=f=>E+K(f),P=f=>{const R=K(f),B=S(f);g.done=Math.abs(R)<=u,g.value=g.done?E:B};let b,A;const C=f=>{T(g.value)&&(b=f,A=Be({keyframes:[g.value,w(g.value)],velocity:Vn(S,f,g.value),damping:s,stiffness:o,restDelta:u,restSpeed:d}))};return C(0),{calculatedDuration:null,next:f=>{let R=!1;return!A&&b===void 0&&(R=!0,P(f),C(f)),b!==void 0&&f>=b?A.next(f-b):(!R&&P(f),g)}}}function os(e,t,n){const r=[],s=n||ke.mix||Cn,o=e.length-1;for(let i=0;it[0];if(o===2&&t[0]===t[1])return()=>t[1];const i=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=os(t,r,s),a=l.length,u=d=>{if(i&&d1)for(;mu(ae(e[0],e[o-1],d)):u}function as(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=dn(0,t,r);e.push(Ge(n,1,s))}}function ls(e){const t=[0];return as(t,e.length-1),t}function cs(e,t){return e.map(n=>n*t)}function us(e,t){return e.map(()=>t||vn).splice(0,e.length-1)}function xe({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=vr(r)?r.map(zt):zt(r),o={done:!1,value:t[0]},i=cs(n&&n.length===t.length?n:ls(t),e),l=is(i,t,{ease:Array.isArray(s)?s:us(t,s)});return{calculatedDuration:e,next:a=>(o.value=l(a),o.done=a>=e,o)}}const ds=e=>e!==null;function Pt(e,{repeat:t,repeatType:n="loop"},r,s=1){const o=e.filter(ds),l=s<0||t&&n!=="loop"&&t%2===1?0:o.length-1;return!l||r===void 0?o[l]:r}const fs={decay:ot,inertia:ot,tween:xe,keyframes:xe,spring:Be};function Dn(e){typeof e.type=="string"&&(e.type=fs[e.type])}class It{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const ms=e=>e/100;class Fn extends It{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==U.now()&&this.tick(U.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;Dn(t);const{type:n=xe,repeat:r=0,repeatDelay:s=0,repeatType:o,velocity:i=0}=t;let{keyframes:l}=t;const a=n||xe;a!==xe&&typeof l[0]!="number"&&(this.mixKeyframes=vt(ms,Cn(l[0],l[1])),l=[0,100]);const u=a({...t,keyframes:l});o==="mirror"&&(this.mirroredGenerator=a({...t,keyframes:[...l].reverse(),velocity:-i})),u.calculatedDuration===null&&(u.calculatedDuration=Et(u));const{calculatedDuration:d}=u;this.calculatedDuration=d,this.resolvedDuration=d+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=u}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:s,mixKeyframes:o,mirroredGenerator:i,resolvedDuration:l,calculatedDuration:a}=this;if(this.startTime===null)return r.next(0);const{delay:u=0,keyframes:d,repeat:m,repeatType:g,repeatDelay:T,type:w,onUpdate:x,finalKeyframe:I}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const E=this.currentTime-u*(this.playbackSpeed>=0?1:-1),K=this.playbackSpeed>=0?E<0:E>s;this.currentTime=Math.max(E,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let S=this.currentTime,P=r;if(m){const f=Math.min(this.currentTime,s)/l;let R=Math.floor(f),B=f%1;!B&&f>=1&&(B=1),B===1&&R--,R=Math.min(R,m+1),!!(R%2)&&(g==="reverse"?(B=1-B,T&&(B-=T/l)):g==="mirror"&&(P=i)),S=ae(0,1,B)*l}const b=K?{done:!1,value:d[0]}:P.next(S);o&&(b.value=o(b.value));let{done:A}=b;!K&&a!==null&&(A=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const C=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&A);return C&&w!==ot&&(b.value=Pt(d,this.options,I,this.speed)),x&&x(b.value),C&&this.finish(),b}then(t,n){return this.finished.then(t,n)}get duration(){return X(this.calculatedDuration)}get time(){return X(this.currentTime)}set time(t){t=he(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(U.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=X(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=Zr,startTime:n}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),this.options.onPlay?.();const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(U.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function hs(e){for(let t=1;te*180/Math.PI,it=e=>{const t=se(Math.atan2(e[1],e[0]));return at(t)},ps={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:it,rotateZ:it,skewX:e=>se(Math.atan(e[1])),skewY:e=>se(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},at=e=>(e=e%360,e<0&&(e+=360),e),Gt=it,Wt=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),jt=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),gs={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Wt,scaleY:jt,scale:e=>(Wt(e)+jt(e))/2,rotateX:e=>at(se(Math.atan2(e[6],e[5]))),rotateY:e=>at(se(Math.atan2(-e[2],e[0]))),rotateZ:Gt,rotate:Gt,skewX:e=>se(Math.atan(e[4])),skewY:e=>se(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Ut(e){return e.includes("scale")?1:0}function lt(e,t){if(!e||e==="none")return Ut(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=gs,s=n;else{const l=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=ps,s=l}if(!s)return Ut(t);const o=r[t],i=s[1].split(",").map(bs);return typeof o=="function"?o(i):i[o]}const si=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return lt(n,t)};function bs(e){return parseFloat(e.trim())}const Ct=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],oi=new Set(Ct),$t=e=>e===pe||e===v,ys=new Set(["x","y","z"]),ws=Ct.filter(e=>!ys.has(e));function vs(e){const t=[];return ws.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const oe={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>lt(t,"x"),y:(e,{transform:t})=>lt(t,"y")};oe.translateX=oe.x;oe.translateY=oe.y;const ie=new Set;let ct=!1,ut=!1,dt=!1;function Nn(){if(ut){const e=Array.from(ie).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=vs(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([o,i])=>{r.getValue(o)?.set(i)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}ut=!1,ct=!1,ie.forEach(e=>e.complete(dt)),ie.clear()}function zn(){ie.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(ut=!0)})}function xs(){dt=!0,zn(),Nn(),dt=!1}class Ln{constructor(t,n,r,s,o,i=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=o,this.isAsync=i}scheduleResolve(){this.state="scheduled",this.isAsync?(ie.add(this),ct||(ct=!0,Le.read(zn),Le.resolveKeyframes(Nn))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;if(t[0]===null){const o=s?.get(),i=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const l=r.readValue(n,i);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=i),s&&o===void 0&&s.set(t[0])}hs(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),ie.delete(this)}cancel(){this.state==="scheduled"&&(ie.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const ks=e=>e.startsWith("--");function Ts(e,t,n){ks(t)?e.style.setProperty(t,n):e.style[t]=n}const Ms=wt(()=>window.ScrollTimeline!==void 0),As={};function Ss(e,t){const n=wt(e);return()=>As[t]??n()}const On=Ss(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),we=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Yt={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:we([0,.65,.55,1]),circOut:we([.55,0,1,.45]),backIn:we([.31,.01,.66,-.59]),backOut:we([.33,1.53,.69,.99])};function _n(e,t){if(e)return typeof e=="function"?On()?Rn(e,t):"ease-out":xn(e)?we(e):Array.isArray(e)?e.map(n=>_n(n,t)||Yt.easeOut):Yt[e]}function Es(e,t,n,{delay:r=0,duration:s=300,repeat:o=0,repeatType:i="loop",ease:l="easeOut",times:a}={},u=void 0){const d={[t]:n};a&&(d.offset=a);const m=_n(l,s);Array.isArray(m)&&(d.easing=m);const g={delay:r,duration:s,easing:Array.isArray(m)?"linear":m,fill:"both",iterations:o+1,direction:i==="reverse"?"alternate":"normal"};return u&&(g.pseudoElement=u),e.animate(d,g)}function Kn(e){return typeof e=="function"&&"applyToOptions"in e}function Ps({type:e,...t}){return Kn(e)&&On()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class Is extends It{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:r,keyframes:s,pseudoElement:o,allowFlatten:i=!1,finalKeyframe:l,onComplete:a}=t;this.isPseudoElement=!!o,this.allowFlatten=i,this.options=t,yt(typeof t.type!="string");const u=Ps(t);this.animation=Es(n,r,s,u,o),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const d=Pt(s,this.options,l,this.speed);this.updateMotionValue?this.updateMotionValue(d):Ts(n,r,d),this.animation.cancel()}a?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return X(Number(t))}get time(){return X(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=he(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&Ms()?(this.animation.timeline=t,me):n(this)}}const Bn={anticipate:yn,backInOut:bn,circInOut:wn};function Cs(e){return e in Bn}function Rs(e){typeof e.ease=="string"&&Cs(e.ease)&&(e.ease=Bn[e.ease])}const Xt=10;class Vs extends Is{constructor(t){Rs(t),Dn(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:s,element:o,...i}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const l=new Fn({...i,autoplay:!1}),a=he(this.finishedTime??this.time);n.setWithVelocity(l.sample(a-Xt).value,l.sample(a).value,Xt),l.stop()}}const qt=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Ee.test(e)||e==="0")&&!e.startsWith("url("));function Ds(e){const t=e[0];if(e.length===1)return!0;for(let n=0;nObject.hasOwnProperty.call(Element.prototype,"animate"));function Os(e){const{motionValue:t,name:n,repeatDelay:r,repeatType:s,damping:o,type:i}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:a,transformTemplate:u}=t.owner.getProps();return Ls()&&n&&zs.has(n)&&(n!=="transform"||!u)&&!a&&!r&&s!=="mirror"&&o!==0&&i!=="inertia"}const _s=40;class ii extends It{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:o=0,repeatType:i="loop",keyframes:l,name:a,motionValue:u,element:d,...m}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=U.now();const g={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:o,repeatType:i,name:a,motionValue:u,element:d,...m},T=d?.KeyframeResolver||Ln;this.keyframeResolver=new T(l,(w,x,I)=>this.onKeyframesResolved(w,x,g,!I),a,u,d),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,r,s){this.keyframeResolver=void 0;const{name:o,type:i,velocity:l,delay:a,isHandoff:u,onUpdate:d}=r;this.resolvedAt=U.now(),Fs(t,o,i,l)||((ke.instantAnimations||!a)&&d?.(Pt(t,r,n)),t[0]=t[t.length-1],Ns(r),r.repeat=0);const g={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>_s?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},T=!u&&Os(g)?new Vs({...g,element:g.motionValue.owner.current}):new Fn(g);T.finished.then(()=>this.notifyFinished()).catch(me),this.pendingTimeline&&(this.stopTimeline=T.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=T}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),xs()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const Ks=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Bs(e){const t=Ks.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function Gn(e,t,n=1){const[r,s]=Bs(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);if(o){const i=o.trim();return ur(i)?parseFloat(i):i}return Tt(s)?Gn(s,t,n+1):s}function ai(e,t){return e?.[t]??e?.default??e}const Gs=new Set(["width","height","top","left","right","bottom",...Ct]),Ws={test:e=>e==="auto",parse:e=>e},Wn=e=>t=>t.test(e),jn=[pe,v,fe,ee,Fr,Dr,Ws],Zt=e=>jn.find(Wn(e));function js(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||dr(e):!0}const Us=new Set(["brightness","contrast","saturate","opacity"]);function $s(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Mt)||[];if(!r)return e;const s=n.replace(r,"");let o=Us.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+s+")"}const Ys=/\b([a-z-]*)\(.*?\)/gu,ft={...Ee,getAnimatableNone:e=>{const t=e.match(Ys);return t?t.map($s).join(" "):e}},Ht={...pe,transform:Math.round},Xs={rotate:ee,rotateX:ee,rotateY:ee,rotateZ:ee,scale:Ve,scaleX:Ve,scaleY:Ve,scaleZ:Ve,skew:ee,skewX:ee,skewY:ee,distance:v,translateX:v,translateY:v,translateZ:v,x:v,y:v,z:v,perspective:v,transformPerspective:v,opacity:Te,originX:Lt,originY:Lt,originZ:v},qs={borderWidth:v,borderTopWidth:v,borderRightWidth:v,borderBottomWidth:v,borderLeftWidth:v,borderRadius:v,radius:v,borderTopLeftRadius:v,borderTopRightRadius:v,borderBottomRightRadius:v,borderBottomLeftRadius:v,width:v,maxWidth:v,height:v,maxHeight:v,top:v,right:v,bottom:v,left:v,padding:v,paddingTop:v,paddingRight:v,paddingBottom:v,paddingLeft:v,margin:v,marginTop:v,marginRight:v,marginBottom:v,marginLeft:v,backgroundPositionX:v,backgroundPositionY:v,...Xs,zIndex:Ht,fillOpacity:Te,strokeOpacity:Te,numOctaves:Ht},Zs={...qs,color:O,backgroundColor:O,outlineColor:O,fill:O,stroke:O,borderColor:O,borderTopColor:O,borderRightColor:O,borderBottomColor:O,borderLeftColor:O,filter:ft,WebkitFilter:ft},Hs=e=>Zs[e];function Js(e,t){let n=Hs(e);return n!==ft&&(n=Ee),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Qs=new Set(["auto","none","0"]);function eo(e,t,n){let r=0,s;for(;r{t.getValue(l).set(a)}),this.resolveNoneKeyframes()}}function to(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const s=n?.[e]??r.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e)}const ci=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function no(e){return un(e)&&"offsetHeight"in e}const Jt=30,ro=e=>!isNaN(parseFloat(e));class so{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{const s=U.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=U.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=ro(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new mr);const r=this.events[t].add(n);return t==="change"?()=>{r(),Le.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=U.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Jt)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Jt);return fn(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function ui(e,t){return new so(e,t)}const{schedule:di}=kn(queueMicrotask,!1),j={x:!1,y:!1};function Un(){return j.x||j.y}function fi(e){return e==="x"||e==="y"?j[e]?null:(j[e]=!0,()=>{j[e]=!1}):j.x||j.y?null:(j.x=j.y=!0,()=>{j.x=j.y=!1})}function $n(e,t){const n=to(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function Qt(e){return!(e.pointerType==="touch"||Un())}function mi(e,t,n={}){const[r,s,o]=$n(e,n),i=l=>{if(!Qt(l))return;const{target:a}=l,u=t(a,l);if(typeof u!="function"||!a)return;const d=m=>{Qt(m)&&(u(m),a.removeEventListener("pointerleave",d))};a.addEventListener("pointerleave",d,s)};return r.forEach(l=>{l.addEventListener("pointerenter",i,s)}),o}const Yn=(e,t)=>t?e===t?!0:Yn(e,t.parentElement):!1,oo=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,io=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function ao(e){return io.has(e.tagName)||e.tabIndex!==-1}const ze=new WeakSet;function en(e){return t=>{t.key==="Enter"&&e(t)}}function Ze(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const lo=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=en(()=>{if(ze.has(n))return;Ze(n,"down");const s=en(()=>{Ze(n,"up")}),o=()=>Ze(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",o,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function tn(e){return oo(e)&&!Un()}function hi(e,t,n={}){const[r,s,o]=$n(e,n),i=l=>{const a=l.currentTarget;if(!tn(l))return;ze.add(a);const u=t(a,l),d=(T,w)=>{window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",g),ze.has(a)&&ze.delete(a),tn(T)&&typeof u=="function"&&u(T,{success:w})},m=T=>{d(T,a===window||a===document||n.useGlobalTarget||Yn(a,T.target))},g=T=>{d(T,!1)};window.addEventListener("pointerup",m,s),window.addEventListener("pointercancel",g,s)};return r.forEach(l=>{(n.useGlobalTarget?window:l).addEventListener("pointerdown",i,s),no(l)&&(l.addEventListener("focus",u=>lo(u,s)),!ao(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),o}function co(e){return un(e)&&"ownerSVGElement"in e}function pi(e){return co(e)&&e.tagName==="svg"}const gi=e=>!!(e&&e.getVelocity),uo=[...jn,O,Ee],bi=e=>uo.find(Wn(e)),fo=(e,t)=>t.some(n=>e instanceof n);let nn,rn;function mo(){return nn||(nn=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function ho(){return rn||(rn=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Xn=new WeakMap,mt=new WeakMap,qn=new WeakMap,He=new WeakMap,Rt=new WeakMap;function po(e){const t=new Promise((n,r)=>{const s=()=>{e.removeEventListener("success",o),e.removeEventListener("error",i)},o=()=>{n(te(e.result)),s()},i=()=>{r(e.error),s()};e.addEventListener("success",o),e.addEventListener("error",i)});return t.then(n=>{n instanceof IDBCursor&&Xn.set(n,e)}).catch(()=>{}),Rt.set(t,e),t}function go(e){if(mt.has(e))return;const t=new Promise((n,r)=>{const s=()=>{e.removeEventListener("complete",o),e.removeEventListener("error",i),e.removeEventListener("abort",i)},o=()=>{n(),s()},i=()=>{r(e.error||new DOMException("AbortError","AbortError")),s()};e.addEventListener("complete",o),e.addEventListener("error",i),e.addEventListener("abort",i)});mt.set(e,t)}let ht={get(e,t,n){if(e instanceof IDBTransaction){if(t==="done")return mt.get(e);if(t==="objectStoreNames")return e.objectStoreNames||qn.get(e);if(t==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return te(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in e}};function bo(e){ht=e(ht)}function yo(e){return e===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(t,...n){const r=e.call(Je(this),t,...n);return qn.set(r,t.sort?t.sort():[t]),te(r)}:ho().includes(e)?function(...t){return e.apply(Je(this),t),te(Xn.get(this))}:function(...t){return te(e.apply(Je(this),t))}}function wo(e){return typeof e=="function"?yo(e):(e instanceof IDBTransaction&&go(e),fo(e,mo())?new Proxy(e,ht):e)}function te(e){if(e instanceof IDBRequest)return po(e);if(He.has(e))return He.get(e);const t=wo(e);return t!==e&&(He.set(e,t),Rt.set(t,e)),t}const Je=e=>Rt.get(e);function yi(e,t,{blocked:n,upgrade:r,blocking:s,terminated:o}={}){const i=indexedDB.open(e,t),l=te(i);return r&&i.addEventListener("upgradeneeded",a=>{r(te(i.result),a.oldVersion,a.newVersion,te(i.transaction),a)}),n&&i.addEventListener("blocked",a=>n(a.oldVersion,a.newVersion,a)),l.then(a=>{o&&a.addEventListener("close",()=>o()),s&&a.addEventListener("versionchange",u=>s(u.oldVersion,u.newVersion,u))}).catch(()=>{}),l}const vo=["get","getKey","getAll","getAllKeys","count"],xo=["put","add","delete","clear"],Qe=new Map;function sn(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(Qe.get(t))return Qe.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,s=xo.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(s||vo.includes(n)))return;const o=async function(i,...l){const a=this.transaction(i,s?"readwrite":"readonly");let u=a.store;return r&&(u=u.index(l.shift())),(await Promise.all([u[n](...l),s&&a.done]))[0]};return Qe.set(t,o),o}bo(e=>({...e,get:(t,n,r)=>sn(t,n)||e.get(t,n,r),has:(t,n)=>!!sn(t,n)||e.has(t,n)}));function Zn(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t{const t=Mo(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const l=i.split(Vt);return l[0]===""&&l.length!==1&&l.shift(),Hn(l,t)||To(i)},getConflictingClassGroupIds:(i,l)=>{const a=n[i]||[];return l&&r[i]?[...a,...r[i]]:a}}},Hn=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?Hn(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const o=e.join(Vt);return t.validators.find(({validator:i})=>i(o))?.classGroupId},on=/^\[(.+)\]$/,To=e=>{if(on.test(e)){const t=on.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Mo=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const s in n)pt(n[s],r,s,t);return r},pt=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:an(t,s);o.classGroupId=n;return}if(typeof s=="function"){if(Ao(s)){pt(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([o,i])=>{pt(i,an(t,o),n,r)})})},an=(e,t)=>{let n=e;return t.split(Vt).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Ao=e=>e.isThemeGetter,So=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(o,i)=>{n.set(o,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let i=n.get(o);if(i!==void 0)return i;if((i=r.get(o))!==void 0)return s(o,i),i},set(o,i){n.has(o)?n.set(o,i):s(o,i)}}},gt="!",bt=":",Eo=bt.length,Po=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const o=[];let i=0,l=0,a=0,u;for(let w=0;wa?u-a:void 0;return{modifiers:o,hasImportantModifier:g,baseClassName:m,maybePostfixModifierPosition:T}};if(t){const s=t+bt,o=r;r=i=>i.startsWith(s)?o(i.substring(s.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:i,maybePostfixModifierPosition:void 0}}if(n){const s=r;r=o=>n({className:o,parseClassName:s})}return r},Io=e=>e.endsWith(gt)?e.substring(0,e.length-1):e.startsWith(gt)?e.substring(1):e,Co=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const s=[];let o=[];return r.forEach(i=>{i[0]==="["||t[i]?(s.push(...o.sort(),i),o=[]):o.push(i)}),s.push(...o.sort()),s}},Ro=e=>({cache:So(e.cacheSize),parseClassName:Po(e),sortModifiers:Co(e),...ko(e)}),Vo=/\s+/,Do=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:o}=t,i=[],l=e.trim().split(Vo);let a="";for(let u=l.length-1;u>=0;u-=1){const d=l[u],{isExternal:m,modifiers:g,hasImportantModifier:T,baseClassName:w,maybePostfixModifierPosition:x}=n(d);if(m){a=d+(a.length>0?" "+a:a);continue}let I=!!x,E=r(I?w.substring(0,x):w);if(!E){if(!I){a=d+(a.length>0?" "+a:a);continue}if(E=r(w),!E){a=d+(a.length>0?" "+a:a);continue}I=!1}const K=o(g).join(":"),S=T?K+gt:K,P=S+E;if(i.includes(P))continue;i.push(P);const b=s(E,I);for(let A=0;A0?" "+a:a)}return a};function Fo(){let e=0,t,n,r="";for(;e{if(typeof e=="string")return e;let t,n="";for(let r=0;rm(d),e());return n=Ro(u),r=n.cache.get,s=n.cache.set,o=l,l(a)}function l(a){const u=r(a);if(u)return u;const d=Do(a,n);return s(a,d),d}return function(){return o(Fo.apply(null,arguments))}}const _=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Qn=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,er=/^\((?:(\w[\w-]*):)?(.+)\)$/i,zo=/^\d+\/\d+$/,Lo=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Oo=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,_o=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Ko=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Bo=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ue=e=>zo.test(e),M=e=>!!e&&!Number.isNaN(Number(e)),Q=e=>!!e&&Number.isInteger(Number(e)),et=e=>e.endsWith("%")&&M(e.slice(0,-1)),Y=e=>Lo.test(e),Go=()=>!0,Wo=e=>Oo.test(e)&&!_o.test(e),tr=()=>!1,jo=e=>Ko.test(e),Uo=e=>Bo.test(e),$o=e=>!h(e)&&!p(e),Yo=e=>ge(e,sr,tr),h=e=>Qn.test(e),ne=e=>ge(e,or,Wo),tt=e=>ge(e,Jo,M),ln=e=>ge(e,nr,tr),Xo=e=>ge(e,rr,Uo),De=e=>ge(e,ir,jo),p=e=>er.test(e),ye=e=>be(e,or),qo=e=>be(e,Qo),cn=e=>be(e,nr),Zo=e=>be(e,sr),Ho=e=>be(e,rr),Fe=e=>be(e,ir,!0),ge=(e,t,n)=>{const r=Qn.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},be=(e,t,n=!1)=>{const r=er.exec(e);return r?r[1]?t(r[1]):n:!1},nr=e=>e==="position"||e==="percentage",rr=e=>e==="image"||e==="url",sr=e=>e==="length"||e==="size"||e==="bg-size",or=e=>e==="length",Jo=e=>e==="number",Qo=e=>e==="family-name",ir=e=>e==="shadow",ei=()=>{const e=_("color"),t=_("font"),n=_("text"),r=_("font-weight"),s=_("tracking"),o=_("leading"),i=_("breakpoint"),l=_("container"),a=_("spacing"),u=_("radius"),d=_("shadow"),m=_("inset-shadow"),g=_("text-shadow"),T=_("drop-shadow"),w=_("blur"),x=_("perspective"),I=_("aspect"),E=_("ease"),K=_("animate"),S=()=>["auto","avoid","all","avoid-page","page","left","right","column"],P=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],b=()=>[...P(),p,h],A=()=>["auto","hidden","clip","visible","scroll"],C=()=>["auto","contain","none"],f=()=>[p,h,a],R=()=>[ue,"full","auto",...f()],B=()=>[Q,"none","subgrid",p,h],le=()=>["auto",{span:["full",Q,p,h]},Q,p,h],q=()=>[Q,"auto",p,h],Z=()=>["auto","min","max","fr",p,h],ce=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],H=()=>["start","end","center","stretch","center-safe","end-safe"],G=()=>["auto",...f()],W=()=>[ue,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...f()],c=()=>[e,p,h],y=()=>[...P(),cn,ln,{position:[p,h]}],k=()=>["no-repeat",{repeat:["","x","y","space","round"]}],V=()=>["auto","cover","contain",Zo,Yo,{size:[p,h]}],F=()=>[et,ye,ne],L=()=>["","none","full",u,p,h],z=()=>["",M,ye,ne],J=()=>["solid","dashed","dotted","double"],$=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],D=()=>[M,et,cn,ln],Dt=()=>["","none",w,p,h],Pe=()=>["none",M,p,h],Ie=()=>["none",M,p,h],We=()=>[M,p,h],Ce=()=>[ue,"full",...f()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Y],breakpoint:[Y],color:[Go],container:[Y],"drop-shadow":[Y],ease:["in","out","in-out"],font:[$o],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Y],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Y],shadow:[Y],spacing:["px",M],text:[Y],"text-shadow":[Y],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ue,h,p,I]}],container:["container"],columns:[{columns:[M,h,p,l]}],"break-after":[{"break-after":S()}],"break-before":[{"break-before":S()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:b()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:R()}],"inset-x":[{"inset-x":R()}],"inset-y":[{"inset-y":R()}],start:[{start:R()}],end:[{end:R()}],top:[{top:R()}],right:[{right:R()}],bottom:[{bottom:R()}],left:[{left:R()}],visibility:["visible","invisible","collapse"],z:[{z:[Q,"auto",p,h]}],basis:[{basis:[ue,"full","auto",l,...f()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[M,ue,"auto","initial","none",h]}],grow:[{grow:["",M,p,h]}],shrink:[{shrink:["",M,p,h]}],order:[{order:[Q,"first","last","none",p,h]}],"grid-cols":[{"grid-cols":B()}],"col-start-end":[{col:le()}],"col-start":[{"col-start":q()}],"col-end":[{"col-end":q()}],"grid-rows":[{"grid-rows":B()}],"row-start-end":[{row:le()}],"row-start":[{"row-start":q()}],"row-end":[{"row-end":q()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Z()}],"auto-rows":[{"auto-rows":Z()}],gap:[{gap:f()}],"gap-x":[{"gap-x":f()}],"gap-y":[{"gap-y":f()}],"justify-content":[{justify:[...ce(),"normal"]}],"justify-items":[{"justify-items":[...H(),"normal"]}],"justify-self":[{"justify-self":["auto",...H()]}],"align-content":[{content:["normal",...ce()]}],"align-items":[{items:[...H(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...H(),{baseline:["","last"]}]}],"place-content":[{"place-content":ce()}],"place-items":[{"place-items":[...H(),"baseline"]}],"place-self":[{"place-self":["auto",...H()]}],p:[{p:f()}],px:[{px:f()}],py:[{py:f()}],ps:[{ps:f()}],pe:[{pe:f()}],pt:[{pt:f()}],pr:[{pr:f()}],pb:[{pb:f()}],pl:[{pl:f()}],m:[{m:G()}],mx:[{mx:G()}],my:[{my:G()}],ms:[{ms:G()}],me:[{me:G()}],mt:[{mt:G()}],mr:[{mr:G()}],mb:[{mb:G()}],ml:[{ml:G()}],"space-x":[{"space-x":f()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":f()}],"space-y-reverse":["space-y-reverse"],size:[{size:W()}],w:[{w:[l,"screen",...W()]}],"min-w":[{"min-w":[l,"screen","none",...W()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...W()]}],h:[{h:["screen","lh",...W()]}],"min-h":[{"min-h":["screen","lh","none",...W()]}],"max-h":[{"max-h":["screen","lh",...W()]}],"font-size":[{text:["base",n,ye,ne]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,p,tt]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",et,h]}],"font-family":[{font:[qo,h,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,p,h]}],"line-clamp":[{"line-clamp":[M,"none",p,tt]}],leading:[{leading:[o,...f()]}],"list-image":[{"list-image":["none",p,h]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",p,h]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:c()}],"text-color":[{text:c()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...J(),"wavy"]}],"text-decoration-thickness":[{decoration:[M,"from-font","auto",p,ne]}],"text-decoration-color":[{decoration:c()}],"underline-offset":[{"underline-offset":[M,"auto",p,h]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:f()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",p,h]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",p,h]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:y()}],"bg-repeat":[{bg:k()}],"bg-size":[{bg:V()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Q,p,h],radial:["",p,h],conic:[Q,p,h]},Ho,Xo]}],"bg-color":[{bg:c()}],"gradient-from-pos":[{from:F()}],"gradient-via-pos":[{via:F()}],"gradient-to-pos":[{to:F()}],"gradient-from":[{from:c()}],"gradient-via":[{via:c()}],"gradient-to":[{to:c()}],rounded:[{rounded:L()}],"rounded-s":[{"rounded-s":L()}],"rounded-e":[{"rounded-e":L()}],"rounded-t":[{"rounded-t":L()}],"rounded-r":[{"rounded-r":L()}],"rounded-b":[{"rounded-b":L()}],"rounded-l":[{"rounded-l":L()}],"rounded-ss":[{"rounded-ss":L()}],"rounded-se":[{"rounded-se":L()}],"rounded-ee":[{"rounded-ee":L()}],"rounded-es":[{"rounded-es":L()}],"rounded-tl":[{"rounded-tl":L()}],"rounded-tr":[{"rounded-tr":L()}],"rounded-br":[{"rounded-br":L()}],"rounded-bl":[{"rounded-bl":L()}],"border-w":[{border:z()}],"border-w-x":[{"border-x":z()}],"border-w-y":[{"border-y":z()}],"border-w-s":[{"border-s":z()}],"border-w-e":[{"border-e":z()}],"border-w-t":[{"border-t":z()}],"border-w-r":[{"border-r":z()}],"border-w-b":[{"border-b":z()}],"border-w-l":[{"border-l":z()}],"divide-x":[{"divide-x":z()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":z()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...J(),"hidden","none"]}],"divide-style":[{divide:[...J(),"hidden","none"]}],"border-color":[{border:c()}],"border-color-x":[{"border-x":c()}],"border-color-y":[{"border-y":c()}],"border-color-s":[{"border-s":c()}],"border-color-e":[{"border-e":c()}],"border-color-t":[{"border-t":c()}],"border-color-r":[{"border-r":c()}],"border-color-b":[{"border-b":c()}],"border-color-l":[{"border-l":c()}],"divide-color":[{divide:c()}],"outline-style":[{outline:[...J(),"none","hidden"]}],"outline-offset":[{"outline-offset":[M,p,h]}],"outline-w":[{outline:["",M,ye,ne]}],"outline-color":[{outline:c()}],shadow:[{shadow:["","none",d,Fe,De]}],"shadow-color":[{shadow:c()}],"inset-shadow":[{"inset-shadow":["none",m,Fe,De]}],"inset-shadow-color":[{"inset-shadow":c()}],"ring-w":[{ring:z()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:c()}],"ring-offset-w":[{"ring-offset":[M,ne]}],"ring-offset-color":[{"ring-offset":c()}],"inset-ring-w":[{"inset-ring":z()}],"inset-ring-color":[{"inset-ring":c()}],"text-shadow":[{"text-shadow":["none",g,Fe,De]}],"text-shadow-color":[{"text-shadow":c()}],opacity:[{opacity:[M,p,h]}],"mix-blend":[{"mix-blend":[...$(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":$()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[M]}],"mask-image-linear-from-pos":[{"mask-linear-from":D()}],"mask-image-linear-to-pos":[{"mask-linear-to":D()}],"mask-image-linear-from-color":[{"mask-linear-from":c()}],"mask-image-linear-to-color":[{"mask-linear-to":c()}],"mask-image-t-from-pos":[{"mask-t-from":D()}],"mask-image-t-to-pos":[{"mask-t-to":D()}],"mask-image-t-from-color":[{"mask-t-from":c()}],"mask-image-t-to-color":[{"mask-t-to":c()}],"mask-image-r-from-pos":[{"mask-r-from":D()}],"mask-image-r-to-pos":[{"mask-r-to":D()}],"mask-image-r-from-color":[{"mask-r-from":c()}],"mask-image-r-to-color":[{"mask-r-to":c()}],"mask-image-b-from-pos":[{"mask-b-from":D()}],"mask-image-b-to-pos":[{"mask-b-to":D()}],"mask-image-b-from-color":[{"mask-b-from":c()}],"mask-image-b-to-color":[{"mask-b-to":c()}],"mask-image-l-from-pos":[{"mask-l-from":D()}],"mask-image-l-to-pos":[{"mask-l-to":D()}],"mask-image-l-from-color":[{"mask-l-from":c()}],"mask-image-l-to-color":[{"mask-l-to":c()}],"mask-image-x-from-pos":[{"mask-x-from":D()}],"mask-image-x-to-pos":[{"mask-x-to":D()}],"mask-image-x-from-color":[{"mask-x-from":c()}],"mask-image-x-to-color":[{"mask-x-to":c()}],"mask-image-y-from-pos":[{"mask-y-from":D()}],"mask-image-y-to-pos":[{"mask-y-to":D()}],"mask-image-y-from-color":[{"mask-y-from":c()}],"mask-image-y-to-color":[{"mask-y-to":c()}],"mask-image-radial":[{"mask-radial":[p,h]}],"mask-image-radial-from-pos":[{"mask-radial-from":D()}],"mask-image-radial-to-pos":[{"mask-radial-to":D()}],"mask-image-radial-from-color":[{"mask-radial-from":c()}],"mask-image-radial-to-color":[{"mask-radial-to":c()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":P()}],"mask-image-conic-pos":[{"mask-conic":[M]}],"mask-image-conic-from-pos":[{"mask-conic-from":D()}],"mask-image-conic-to-pos":[{"mask-conic-to":D()}],"mask-image-conic-from-color":[{"mask-conic-from":c()}],"mask-image-conic-to-color":[{"mask-conic-to":c()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:y()}],"mask-repeat":[{mask:k()}],"mask-size":[{mask:V()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",p,h]}],filter:[{filter:["","none",p,h]}],blur:[{blur:Dt()}],brightness:[{brightness:[M,p,h]}],contrast:[{contrast:[M,p,h]}],"drop-shadow":[{"drop-shadow":["","none",T,Fe,De]}],"drop-shadow-color":[{"drop-shadow":c()}],grayscale:[{grayscale:["",M,p,h]}],"hue-rotate":[{"hue-rotate":[M,p,h]}],invert:[{invert:["",M,p,h]}],saturate:[{saturate:[M,p,h]}],sepia:[{sepia:["",M,p,h]}],"backdrop-filter":[{"backdrop-filter":["","none",p,h]}],"backdrop-blur":[{"backdrop-blur":Dt()}],"backdrop-brightness":[{"backdrop-brightness":[M,p,h]}],"backdrop-contrast":[{"backdrop-contrast":[M,p,h]}],"backdrop-grayscale":[{"backdrop-grayscale":["",M,p,h]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[M,p,h]}],"backdrop-invert":[{"backdrop-invert":["",M,p,h]}],"backdrop-opacity":[{"backdrop-opacity":[M,p,h]}],"backdrop-saturate":[{"backdrop-saturate":[M,p,h]}],"backdrop-sepia":[{"backdrop-sepia":["",M,p,h]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":f()}],"border-spacing-x":[{"border-spacing-x":f()}],"border-spacing-y":[{"border-spacing-y":f()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",p,h]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[M,"initial",p,h]}],ease:[{ease:["linear","initial",E,p,h]}],delay:[{delay:[M,p,h]}],animate:[{animate:["none",K,p,h]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[x,p,h]}],"perspective-origin":[{"perspective-origin":b()}],rotate:[{rotate:Pe()}],"rotate-x":[{"rotate-x":Pe()}],"rotate-y":[{"rotate-y":Pe()}],"rotate-z":[{"rotate-z":Pe()}],scale:[{scale:Ie()}],"scale-x":[{"scale-x":Ie()}],"scale-y":[{"scale-y":Ie()}],"scale-z":[{"scale-z":Ie()}],"scale-3d":["scale-3d"],skew:[{skew:We()}],"skew-x":[{"skew-x":We()}],"skew-y":[{"skew-y":We()}],transform:[{transform:[p,h,"","none","gpu","cpu"]}],"transform-origin":[{origin:b()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ce()}],"translate-x":[{"translate-x":Ce()}],"translate-y":[{"translate-y":Ce()}],"translate-z":[{"translate-z":Ce()}],"translate-none":["translate-none"],accent:[{accent:c()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:c()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",p,h]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":f()}],"scroll-mx":[{"scroll-mx":f()}],"scroll-my":[{"scroll-my":f()}],"scroll-ms":[{"scroll-ms":f()}],"scroll-me":[{"scroll-me":f()}],"scroll-mt":[{"scroll-mt":f()}],"scroll-mr":[{"scroll-mr":f()}],"scroll-mb":[{"scroll-mb":f()}],"scroll-ml":[{"scroll-ml":f()}],"scroll-p":[{"scroll-p":f()}],"scroll-px":[{"scroll-px":f()}],"scroll-py":[{"scroll-py":f()}],"scroll-ps":[{"scroll-ps":f()}],"scroll-pe":[{"scroll-pe":f()}],"scroll-pt":[{"scroll-pt":f()}],"scroll-pr":[{"scroll-pr":f()}],"scroll-pb":[{"scroll-pb":f()}],"scroll-pl":[{"scroll-pl":f()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",p,h]}],fill:[{fill:["none",...c()]}],"stroke-w":[{stroke:[M,ye,ne,tt]}],stroke:[{stroke:["none",...c()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},vi=No(ei);export{ii as A,Gs as B,oo as C,li as D,Oe as E,vt as F,X as G,dn as H,ae as I,Fn as J,Ln as K,fi as L,ke as M,fe as N,me as O,lr as P,cr as Q,br as R,mr as S,co as T,pi as U,ni as V,mi as W,hi as X,ti as Y,vi as Z,wi as _,ri as a,Ct as b,gi as c,ui as d,U as e,Le as f,ci as g,Ar as h,no as i,ur as j,dr as k,bi as l,Ge as m,qs as n,yi as o,v as p,Ee as q,Js as r,di as s,oi as t,Ut as u,si as v,Hs as w,ai as x,he as y,Ns as z}; diff --git a/index.html b/index.html new file mode 100644 index 0000000000000000000000000000000000000000..e2e43fb9c9994666bf51fc1642f414dd0e5b721a --- /dev/null +++ b/index.html @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + Miragic - Where Every Image Radiates an Aura of Imagination + + + + + + + + +
+ +