3908 lines
800 KiB
JavaScript
3908 lines
800 KiB
JavaScript
(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();function bk(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var A0={exports:{}},xd={},N0={exports:{}},pe={};/**
|
|
* @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 Kl=Symbol.for("react.element"),Sk=Symbol.for("react.portal"),Ik=Symbol.for("react.fragment"),Ck=Symbol.for("react.strict_mode"),Ak=Symbol.for("react.profiler"),Nk=Symbol.for("react.provider"),Pk=Symbol.for("react.context"),Rk=Symbol.for("react.forward_ref"),Dk=Symbol.for("react.suspense"),jk=Symbol.for("react.memo"),Ok=Symbol.for("react.lazy"),jg=Symbol.iterator;function Lk(t){return t===null||typeof t!="object"?null:(t=jg&&t[jg]||t["@@iterator"],typeof t=="function"?t:null)}var P0={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},R0=Object.assign,D0={};function ea(t,e,n){this.props=t,this.context=e,this.refs=D0,this.updater=n||P0}ea.prototype.isReactComponent={};ea.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};ea.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function j0(){}j0.prototype=ea.prototype;function Pp(t,e,n){this.props=t,this.context=e,this.refs=D0,this.updater=n||P0}var Rp=Pp.prototype=new j0;Rp.constructor=Pp;R0(Rp,ea.prototype);Rp.isPureReactComponent=!0;var Og=Array.isArray,O0=Object.prototype.hasOwnProperty,Dp={current:null},L0={key:!0,ref:!0,__self:!0,__source:!0};function M0(t,e,n){var r,i={},s=null,o=null;if(e!=null)for(r in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(s=""+e.key),e)O0.call(e,r)&&!L0.hasOwnProperty(r)&&(i[r]=e[r]);var l=arguments.length-2;if(l===1)i.children=n;else if(1<l){for(var u=Array(l),h=0;h<l;h++)u[h]=arguments[h+2];i.children=u}if(t&&t.defaultProps)for(r in l=t.defaultProps,l)i[r]===void 0&&(i[r]=l[r]);return{$$typeof:Kl,type:t,key:s,ref:o,props:i,_owner:Dp.current}}function Mk(t,e){return{$$typeof:Kl,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function jp(t){return typeof t=="object"&&t!==null&&t.$$typeof===Kl}function Vk(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var Lg=/\/+/g;function gh(t,e){return typeof t=="object"&&t!==null&&t.key!=null?Vk(""+t.key):e.toString(36)}function uu(t,e,n,r,i){var s=typeof t;(s==="undefined"||s==="boolean")&&(t=null);var o=!1;if(t===null)o=!0;else switch(s){case"string":case"number":o=!0;break;case"object":switch(t.$$typeof){case Kl:case Sk:o=!0}}if(o)return o=t,i=i(o),t=r===""?"."+gh(o,0):r,Og(i)?(n="",t!=null&&(n=t.replace(Lg,"$&/")+"/"),uu(i,e,n,"",function(h){return h})):i!=null&&(jp(i)&&(i=Mk(i,n+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(Lg,"$&/")+"/")+t)),e.push(i)),1;if(o=0,r=r===""?".":r+":",Og(t))for(var l=0;l<t.length;l++){s=t[l];var u=r+gh(s,l);o+=uu(s,e,n,u,i)}else if(u=Lk(t),typeof u=="function")for(t=u.call(t),l=0;!(s=t.next()).done;)s=s.value,u=r+gh(s,l++),o+=uu(s,e,n,u,i);else if(s==="object")throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return o}function Mc(t,e,n){if(t==null)return t;var r=[],i=0;return uu(t,r,"","",function(s){return e.call(n,s,i++)}),r}function Fk(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n)},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var Kt={current:null},du={transition:null},Uk={ReactCurrentDispatcher:Kt,ReactCurrentBatchConfig:du,ReactCurrentOwner:Dp};function V0(){throw Error("act(...) is not supported in production builds of React.")}pe.Children={map:Mc,forEach:function(t,e,n){Mc(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return Mc(t,function(){e++}),e},toArray:function(t){return Mc(t,function(e){return e})||[]},only:function(t){if(!jp(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};pe.Component=ea;pe.Fragment=Ik;pe.Profiler=Ak;pe.PureComponent=Pp;pe.StrictMode=Ck;pe.Suspense=Dk;pe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Uk;pe.act=V0;pe.cloneElement=function(t,e,n){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var r=R0({},t.props),i=t.key,s=t.ref,o=t._owner;if(e!=null){if(e.ref!==void 0&&(s=e.ref,o=Dp.current),e.key!==void 0&&(i=""+e.key),t.type&&t.type.defaultProps)var l=t.type.defaultProps;for(u in e)O0.call(e,u)&&!L0.hasOwnProperty(u)&&(r[u]=e[u]===void 0&&l!==void 0?l[u]:e[u])}var u=arguments.length-2;if(u===1)r.children=n;else if(1<u){l=Array(u);for(var h=0;h<u;h++)l[h]=arguments[h+2];r.children=l}return{$$typeof:Kl,type:t.type,key:i,ref:s,props:r,_owner:o}};pe.createContext=function(t){return t={$$typeof:Pk,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:Nk,_context:t},t.Consumer=t};pe.createElement=M0;pe.createFactory=function(t){var e=M0.bind(null,t);return e.type=t,e};pe.createRef=function(){return{current:null}};pe.forwardRef=function(t){return{$$typeof:Rk,render:t}};pe.isValidElement=jp;pe.lazy=function(t){return{$$typeof:Ok,_payload:{_status:-1,_result:t},_init:Fk}};pe.memo=function(t,e){return{$$typeof:jk,type:t,compare:e===void 0?null:e}};pe.startTransition=function(t){var e=du.transition;du.transition={};try{t()}finally{du.transition=e}};pe.unstable_act=V0;pe.useCallback=function(t,e){return Kt.current.useCallback(t,e)};pe.useContext=function(t){return Kt.current.useContext(t)};pe.useDebugValue=function(){};pe.useDeferredValue=function(t){return Kt.current.useDeferredValue(t)};pe.useEffect=function(t,e){return Kt.current.useEffect(t,e)};pe.useId=function(){return Kt.current.useId()};pe.useImperativeHandle=function(t,e,n){return Kt.current.useImperativeHandle(t,e,n)};pe.useInsertionEffect=function(t,e){return Kt.current.useInsertionEffect(t,e)};pe.useLayoutEffect=function(t,e){return Kt.current.useLayoutEffect(t,e)};pe.useMemo=function(t,e){return Kt.current.useMemo(t,e)};pe.useReducer=function(t,e,n){return Kt.current.useReducer(t,e,n)};pe.useRef=function(t){return Kt.current.useRef(t)};pe.useState=function(t){return Kt.current.useState(t)};pe.useSyncExternalStore=function(t,e,n){return Kt.current.useSyncExternalStore(t,e,n)};pe.useTransition=function(){return Kt.current.useTransition()};pe.version="18.3.1";N0.exports=pe;var q=N0.exports;const zk=bk(q);/**
|
|
* @license React
|
|
* react-jsx-runtime.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 Bk=q,$k=Symbol.for("react.element"),qk=Symbol.for("react.fragment"),Wk=Object.prototype.hasOwnProperty,Hk=Bk.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Kk={key:!0,ref:!0,__self:!0,__source:!0};function F0(t,e,n){var r,i={},s=null,o=null;n!==void 0&&(s=""+n),e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(o=e.ref);for(r in e)Wk.call(e,r)&&!Kk.hasOwnProperty(r)&&(i[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps,e)i[r]===void 0&&(i[r]=e[r]);return{$$typeof:$k,type:t,key:s,ref:o,props:i,_owner:Hk.current}}xd.Fragment=qk;xd.jsx=F0;xd.jsxs=F0;A0.exports=xd;var c=A0.exports,ff={},U0={exports:{}},pn={},z0={exports:{}},B0={};/**
|
|
* @license React
|
|
* scheduler.production.min.js
|
|
*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/(function(t){function e(Y,ae){var se=Y.length;Y.push(ae);e:for(;0<se;){var Ce=se-1>>>1,Te=Y[Ce];if(0<i(Te,ae))Y[Ce]=ae,Y[se]=Te,se=Ce;else break e}}function n(Y){return Y.length===0?null:Y[0]}function r(Y){if(Y.length===0)return null;var ae=Y[0],se=Y.pop();if(se!==ae){Y[0]=se;e:for(var Ce=0,Te=Y.length,Ae=Te>>>1;Ce<Ae;){var Qe=2*(Ce+1)-1,At=Y[Qe],Oe=Qe+1,Jt=Y[Oe];if(0>i(At,se))Oe<Te&&0>i(Jt,At)?(Y[Ce]=Jt,Y[Oe]=se,Ce=Oe):(Y[Ce]=At,Y[Qe]=se,Ce=Qe);else if(Oe<Te&&0>i(Jt,se))Y[Ce]=Jt,Y[Oe]=se,Ce=Oe;else break e}}return ae}function i(Y,ae){var se=Y.sortIndex-ae.sortIndex;return se!==0?se:Y.id-ae.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();t.unstable_now=function(){return o.now()-l}}var u=[],h=[],m=1,v=null,g=3,N=!1,j=!1,L=!1,B=typeof setTimeout=="function"?setTimeout:null,I=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 C(Y){for(var ae=n(h);ae!==null;){if(ae.callback===null)r(h);else if(ae.startTime<=Y)r(h),ae.sortIndex=ae.expirationTime,e(u,ae);else break;ae=n(h)}}function V(Y){if(L=!1,C(Y),!j)if(n(u)!==null)j=!0,Qt(G);else{var ae=n(h);ae!==null&&Yt(V,ae.startTime-Y)}}function G(Y,ae){j=!1,L&&(L=!1,I(w),w=-1),N=!0;var se=g;try{for(C(ae),v=n(u);v!==null&&(!(v.expirationTime>ae)||Y&&!A());){var Ce=v.callback;if(typeof Ce=="function"){v.callback=null,g=v.priorityLevel;var Te=Ce(v.expirationTime<=ae);ae=t.unstable_now(),typeof Te=="function"?v.callback=Te:v===n(u)&&r(u),C(ae)}else r(u);v=n(u)}if(v!==null)var Ae=!0;else{var Qe=n(h);Qe!==null&&Yt(V,Qe.startTime-ae),Ae=!1}return Ae}finally{v=null,g=se,N=!1}}var H=!1,T=null,w=-1,E=5,S=-1;function A(){return!(t.unstable_now()-S<E)}function R(){if(T!==null){var Y=t.unstable_now();S=Y;var ae=!0;try{ae=T(!0,Y)}finally{ae?b():(H=!1,T=null)}}else H=!1}var b;if(typeof k=="function")b=function(){k(R)};else if(typeof MessageChannel<"u"){var Xe=new MessageChannel,An=Xe.port2;Xe.port1.onmessage=R,b=function(){An.postMessage(null)}}else b=function(){B(R,0)};function Qt(Y){T=Y,H||(H=!0,b())}function Yt(Y,ae){w=B(function(){Y(t.unstable_now())},ae)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(Y){Y.callback=null},t.unstable_continueExecution=function(){j||N||(j=!0,Qt(G))},t.unstable_forceFrameRate=function(Y){0>Y||125<Y?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<Y?Math.floor(1e3/Y):5},t.unstable_getCurrentPriorityLevel=function(){return g},t.unstable_getFirstCallbackNode=function(){return n(u)},t.unstable_next=function(Y){switch(g){case 1:case 2:case 3:var ae=3;break;default:ae=g}var se=g;g=ae;try{return Y()}finally{g=se}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(Y,ae){switch(Y){case 1:case 2:case 3:case 4:case 5:break;default:Y=3}var se=g;g=Y;try{return ae()}finally{g=se}},t.unstable_scheduleCallback=function(Y,ae,se){var Ce=t.unstable_now();switch(typeof se=="object"&&se!==null?(se=se.delay,se=typeof se=="number"&&0<se?Ce+se:Ce):se=Ce,Y){case 1:var Te=-1;break;case 2:Te=250;break;case 5:Te=1073741823;break;case 4:Te=1e4;break;default:Te=5e3}return Te=se+Te,Y={id:m++,callback:ae,priorityLevel:Y,startTime:se,expirationTime:Te,sortIndex:-1},se>Ce?(Y.sortIndex=se,e(h,Y),n(u)===null&&Y===n(h)&&(L?(I(w),w=-1):L=!0,Yt(V,se-Ce))):(Y.sortIndex=Te,e(u,Y),j||N||(j=!0,Qt(G))),Y},t.unstable_shouldYield=A,t.unstable_wrapCallback=function(Y){var ae=g;return function(){var se=g;g=ae;try{return Y.apply(this,arguments)}finally{g=se}}}})(B0);z0.exports=B0;var Gk=z0.exports;/**
|
|
* @license React
|
|
* react-dom.production.min.js
|
|
*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/var Qk=q,fn=Gk;function W(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var $0=new Set,wl={};function Ns(t,e){Uo(t,e),Uo(t+"Capture",e)}function Uo(t,e){for(wl[t]=e,t=0;t<e.length;t++)$0.add(e[t])}var zr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),pf=Object.prototype.hasOwnProperty,Yk=/^[: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]*$/,Mg={},Vg={};function Jk(t){return pf.call(Vg,t)?!0:pf.call(Mg,t)?!1:Yk.test(t)?Vg[t]=!0:(Mg[t]=!0,!1)}function Xk(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function Zk(t,e,n,r){if(e===null||typeof e>"u"||Xk(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Gt(t,e,n,r,i,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var It={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){It[t]=new Gt(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];It[e]=new Gt(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){It[t]=new Gt(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){It[t]=new Gt(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){It[t]=new Gt(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){It[t]=new Gt(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){It[t]=new Gt(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){It[t]=new Gt(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){It[t]=new Gt(t,5,!1,t.toLowerCase(),null,!1,!1)});var Op=/[\-:]([a-z])/g;function Lp(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(Op,Lp);It[e]=new Gt(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(Op,Lp);It[e]=new Gt(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(Op,Lp);It[e]=new Gt(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){It[t]=new Gt(t,1,!1,t.toLowerCase(),null,!1,!1)});It.xlinkHref=new Gt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){It[t]=new Gt(t,1,!1,t.toLowerCase(),null,!0,!0)});function Mp(t,e,n,r){var i=It.hasOwnProperty(e)?It[e]:null;(i!==null?i.type!==0:r||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(Zk(e,n,i,r)&&(n=null),r||i===null?Jk(e)&&(n===null?t.removeAttribute(e):t.setAttribute(e,""+n)):i.mustUseProperty?t[i.propertyName]=n===null?i.type===3?!1:"":n:(e=i.attributeName,r=i.attributeNamespace,n===null?t.removeAttribute(e):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?t.setAttributeNS(r,e,n):t.setAttribute(e,n))))}var Qr=Qk.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Vc=Symbol.for("react.element"),yo=Symbol.for("react.portal"),vo=Symbol.for("react.fragment"),Vp=Symbol.for("react.strict_mode"),mf=Symbol.for("react.profiler"),q0=Symbol.for("react.provider"),W0=Symbol.for("react.context"),Fp=Symbol.for("react.forward_ref"),gf=Symbol.for("react.suspense"),yf=Symbol.for("react.suspense_list"),Up=Symbol.for("react.memo"),di=Symbol.for("react.lazy"),H0=Symbol.for("react.offscreen"),Fg=Symbol.iterator;function Ra(t){return t===null||typeof t!="object"?null:(t=Fg&&t[Fg]||t["@@iterator"],typeof t=="function"?t:null)}var $e=Object.assign,yh;function Qa(t){if(yh===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);yh=e&&e[1]||""}return`
|
|
`+yh+t}var vh=!1;function wh(t,e){if(!t||vh)return"";vh=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(h){var r=h}Reflect.construct(t,[],e)}else{try{e.call()}catch(h){r=h}t.call(e.prototype)}else{try{throw Error()}catch(h){r=h}t()}}catch(h){if(h&&r&&typeof h.stack=="string"){for(var i=h.stack.split(`
|
|
`),s=r.stack.split(`
|
|
`),o=i.length-1,l=s.length-1;1<=o&&0<=l&&i[o]!==s[l];)l--;for(;1<=o&&0<=l;o--,l--)if(i[o]!==s[l]){if(o!==1||l!==1)do if(o--,l--,0>l||i[o]!==s[l]){var u=`
|
|
`+i[o].replace(" at new "," at ");return t.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",t.displayName)),u}while(1<=o&&0<=l);break}}}finally{vh=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?Qa(t):""}function eT(t){switch(t.tag){case 5:return Qa(t.type);case 16:return Qa("Lazy");case 13:return Qa("Suspense");case 19:return Qa("SuspenseList");case 0:case 2:case 15:return t=wh(t.type,!1),t;case 11:return t=wh(t.type.render,!1),t;case 1:return t=wh(t.type,!0),t;default:return""}}function vf(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case vo:return"Fragment";case yo:return"Portal";case mf:return"Profiler";case Vp:return"StrictMode";case gf:return"Suspense";case yf:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case W0:return(t.displayName||"Context")+".Consumer";case q0:return(t._context.displayName||"Context")+".Provider";case Fp:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Up:return e=t.displayName||null,e!==null?e:vf(t.type)||"Memo";case di:e=t._payload,t=t._init;try{return vf(t(e))}catch{}}return null}function tT(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return vf(e);case 8:return e===Vp?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Ri(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function K0(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function nT(t){var e=K0(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Fc(t){t._valueTracker||(t._valueTracker=nT(t))}function G0(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=K0(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function Pu(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function wf(t,e){var n=e.checked;return $e({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function Ug(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=Ri(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function Q0(t,e){e=e.checked,e!=null&&Mp(t,"checked",e,!1)}function _f(t,e){Q0(t,e);var n=Ri(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?xf(t,e.type,n):e.hasOwnProperty("defaultValue")&&xf(t,e.type,Ri(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function zg(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function xf(t,e,n){(e!=="number"||Pu(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var Ya=Array.isArray;function No(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i<n.length;i++)e["$"+n[i]]=!0;for(n=0;n<t.length;n++)i=e.hasOwnProperty("$"+t[n].value),t[n].selected!==i&&(t[n].selected=i),i&&r&&(t[n].defaultSelected=!0)}else{for(n=""+Ri(n),e=null,i=0;i<t.length;i++){if(t[i].value===n){t[i].selected=!0,r&&(t[i].defaultSelected=!0);return}e!==null||t[i].disabled||(e=t[i])}e!==null&&(e.selected=!0)}}function Ef(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(W(91));return $e({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function Bg(t,e){var n=e.value;if(n==null){if(n=e.children,e=e.defaultValue,n!=null){if(e!=null)throw Error(W(92));if(Ya(n)){if(1<n.length)throw Error(W(93));n=n[0]}e=n}e==null&&(e=""),n=e}t._wrapperState={initialValue:Ri(n)}}function Y0(t,e){var n=Ri(e.value),r=Ri(e.defaultValue);n!=null&&(n=""+n,n!==t.value&&(t.value=n),e.defaultValue==null&&t.defaultValue!==n&&(t.defaultValue=n)),r!=null&&(t.defaultValue=""+r)}function $g(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function J0(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function kf(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?J0(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var Uc,X0=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,n,r,i){MSApp.execUnsafeLocalFunction(function(){return t(e,n,r,i)})}:t}(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for(Uc=Uc||document.createElement("div"),Uc.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=Uc.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function _l(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var sl={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},rT=["Webkit","ms","Moz","O"];Object.keys(sl).forEach(function(t){rT.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),sl[e]=sl[t]})});function Z0(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||sl.hasOwnProperty(t)&&sl[t]?(""+e).trim():e+"px"}function ew(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Z0(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var iT=$e({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 Tf(t,e){if(e){if(iT[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(W(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(W(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(W(61))}if(e.style!=null&&typeof e.style!="object")throw Error(W(62))}}function bf(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Sf=null;function zp(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var If=null,Po=null,Ro=null;function qg(t){if(t=Yl(t)){if(typeof If!="function")throw Error(W(280));var e=t.stateNode;e&&(e=Sd(e),If(t.stateNode,t.type,e))}}function tw(t){Po?Ro?Ro.push(t):Ro=[t]:Po=t}function nw(){if(Po){var t=Po,e=Ro;if(Ro=Po=null,qg(t),e)for(t=0;t<e.length;t++)qg(e[t])}}function rw(t,e){return t(e)}function iw(){}var _h=!1;function sw(t,e,n){if(_h)return t(e,n);_h=!0;try{return rw(t,e,n)}finally{_h=!1,(Po!==null||Ro!==null)&&(iw(),nw())}}function xl(t,e){var n=t.stateNode;if(n===null)return null;var r=Sd(n);if(r===null)return null;n=r[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(t=t.type,r=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!r;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(W(231,e,typeof n));return n}var Cf=!1;if(zr)try{var Da={};Object.defineProperty(Da,"passive",{get:function(){Cf=!0}}),window.addEventListener("test",Da,Da),window.removeEventListener("test",Da,Da)}catch{Cf=!1}function sT(t,e,n,r,i,s,o,l,u){var h=Array.prototype.slice.call(arguments,3);try{e.apply(n,h)}catch(m){this.onError(m)}}var ol=!1,Ru=null,Du=!1,Af=null,oT={onError:function(t){ol=!0,Ru=t}};function aT(t,e,n,r,i,s,o,l,u){ol=!1,Ru=null,sT.apply(oT,arguments)}function lT(t,e,n,r,i,s,o,l,u){if(aT.apply(this,arguments),ol){if(ol){var h=Ru;ol=!1,Ru=null}else throw Error(W(198));Du||(Du=!0,Af=h)}}function Ps(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,e.flags&4098&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function ow(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function Wg(t){if(Ps(t)!==t)throw Error(W(188))}function cT(t){var e=t.alternate;if(!e){if(e=Ps(t),e===null)throw Error(W(188));return e!==t?null:t}for(var n=t,r=e;;){var i=n.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return Wg(i),t;if(s===r)return Wg(i),e;s=s.sibling}throw Error(W(188))}if(n.return!==r.return)n=i,r=s;else{for(var o=!1,l=i.child;l;){if(l===n){o=!0,n=i,r=s;break}if(l===r){o=!0,r=i,n=s;break}l=l.sibling}if(!o){for(l=s.child;l;){if(l===n){o=!0,n=s,r=i;break}if(l===r){o=!0,r=s,n=i;break}l=l.sibling}if(!o)throw Error(W(189))}}if(n.alternate!==r)throw Error(W(190))}if(n.tag!==3)throw Error(W(188));return n.stateNode.current===n?t:e}function aw(t){return t=cT(t),t!==null?lw(t):null}function lw(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=lw(t);if(e!==null)return e;t=t.sibling}return null}var cw=fn.unstable_scheduleCallback,Hg=fn.unstable_cancelCallback,uT=fn.unstable_shouldYield,dT=fn.unstable_requestPaint,Je=fn.unstable_now,hT=fn.unstable_getCurrentPriorityLevel,Bp=fn.unstable_ImmediatePriority,uw=fn.unstable_UserBlockingPriority,ju=fn.unstable_NormalPriority,fT=fn.unstable_LowPriority,dw=fn.unstable_IdlePriority,Ed=null,ir=null;function pT(t){if(ir&&typeof ir.onCommitFiberRoot=="function")try{ir.onCommitFiberRoot(Ed,t,void 0,(t.current.flags&128)===128)}catch{}}var Mn=Math.clz32?Math.clz32:yT,mT=Math.log,gT=Math.LN2;function yT(t){return t>>>=0,t===0?32:31-(mT(t)/gT|0)|0}var zc=64,Bc=4194304;function Ja(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Ou(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,s=t.pingedLanes,o=n&268435455;if(o!==0){var l=o&~i;l!==0?r=Ja(l):(s&=o,s!==0&&(r=Ja(s)))}else o=n&~i,o!==0?r=Ja(o):s!==0&&(r=Ja(s));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0<e;)n=31-Mn(e),i=1<<n,r|=t[n],e&=~i;return r}function vT(t,e){switch(t){case 1:case 2:case 4:return e+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function wT(t,e){for(var n=t.suspendedLanes,r=t.pingedLanes,i=t.expirationTimes,s=t.pendingLanes;0<s;){var o=31-Mn(s),l=1<<o,u=i[o];u===-1?(!(l&n)||l&r)&&(i[o]=vT(l,e)):u<=e&&(t.expiredLanes|=l),s&=~l}}function Nf(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function hw(){var t=zc;return zc<<=1,!(zc&4194240)&&(zc=64),t}function xh(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Gl(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Mn(e),t[e]=n}function _T(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0<n;){var i=31-Mn(n),s=1<<i;e[i]=0,r[i]=-1,t[i]=-1,n&=~s}}function $p(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var r=31-Mn(n),i=1<<r;i&e|t[r]&e&&(t[r]|=e),n&=~i}}var be=0;function fw(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var pw,qp,mw,gw,yw,Pf=!1,$c=[],Ei=null,ki=null,Ti=null,El=new Map,kl=new Map,fi=[],xT="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Kg(t,e){switch(t){case"focusin":case"focusout":Ei=null;break;case"dragenter":case"dragleave":ki=null;break;case"mouseover":case"mouseout":Ti=null;break;case"pointerover":case"pointerout":El.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":kl.delete(e.pointerId)}}function ja(t,e,n,r,i,s){return t===null||t.nativeEvent!==s?(t={blockedOn:e,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},e!==null&&(e=Yl(e),e!==null&&qp(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,i!==null&&e.indexOf(i)===-1&&e.push(i),t)}function ET(t,e,n,r,i){switch(e){case"focusin":return Ei=ja(Ei,t,e,n,r,i),!0;case"dragenter":return ki=ja(ki,t,e,n,r,i),!0;case"mouseover":return Ti=ja(Ti,t,e,n,r,i),!0;case"pointerover":var s=i.pointerId;return El.set(s,ja(El.get(s)||null,t,e,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,kl.set(s,ja(kl.get(s)||null,t,e,n,r,i)),!0}return!1}function vw(t){var e=us(t.target);if(e!==null){var n=Ps(e);if(n!==null){if(e=n.tag,e===13){if(e=ow(n),e!==null){t.blockedOn=e,yw(t.priority,function(){mw(n)});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function hu(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=Rf(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(n===null){n=t.nativeEvent;var r=new n.constructor(n.type,n);Sf=r,n.target.dispatchEvent(r),Sf=null}else return e=Yl(n),e!==null&&qp(e),t.blockedOn=n,!1;e.shift()}return!0}function Gg(t,e,n){hu(t)&&n.delete(e)}function kT(){Pf=!1,Ei!==null&&hu(Ei)&&(Ei=null),ki!==null&&hu(ki)&&(ki=null),Ti!==null&&hu(Ti)&&(Ti=null),El.forEach(Gg),kl.forEach(Gg)}function Oa(t,e){t.blockedOn===e&&(t.blockedOn=null,Pf||(Pf=!0,fn.unstable_scheduleCallback(fn.unstable_NormalPriority,kT)))}function Tl(t){function e(i){return Oa(i,t)}if(0<$c.length){Oa($c[0],t);for(var n=1;n<$c.length;n++){var r=$c[n];r.blockedOn===t&&(r.blockedOn=null)}}for(Ei!==null&&Oa(Ei,t),ki!==null&&Oa(ki,t),Ti!==null&&Oa(Ti,t),El.forEach(e),kl.forEach(e),n=0;n<fi.length;n++)r=fi[n],r.blockedOn===t&&(r.blockedOn=null);for(;0<fi.length&&(n=fi[0],n.blockedOn===null);)vw(n),n.blockedOn===null&&fi.shift()}var Do=Qr.ReactCurrentBatchConfig,Lu=!0;function TT(t,e,n,r){var i=be,s=Do.transition;Do.transition=null;try{be=1,Wp(t,e,n,r)}finally{be=i,Do.transition=s}}function bT(t,e,n,r){var i=be,s=Do.transition;Do.transition=null;try{be=4,Wp(t,e,n,r)}finally{be=i,Do.transition=s}}function Wp(t,e,n,r){if(Lu){var i=Rf(t,e,n,r);if(i===null)Ph(t,e,r,Mu,n),Kg(t,r);else if(ET(i,t,e,n,r))r.stopPropagation();else if(Kg(t,r),e&4&&-1<xT.indexOf(t)){for(;i!==null;){var s=Yl(i);if(s!==null&&pw(s),s=Rf(t,e,n,r),s===null&&Ph(t,e,r,Mu,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else Ph(t,e,r,null,n)}}var Mu=null;function Rf(t,e,n,r){if(Mu=null,t=zp(r),t=us(t),t!==null)if(e=Ps(t),e===null)t=null;else if(n=e.tag,n===13){if(t=ow(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null);return Mu=t,null}function ww(t){switch(t){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(hT()){case Bp:return 1;case uw:return 4;case ju:case fT:return 16;case dw:return 536870912;default:return 16}default:return 16}}var wi=null,Hp=null,fu=null;function _w(){if(fu)return fu;var t,e=Hp,n=e.length,r,i="value"in wi?wi.value:wi.textContent,s=i.length;for(t=0;t<n&&e[t]===i[t];t++);var o=n-t;for(r=1;r<=o&&e[n-r]===i[s-r];r++);return fu=i.slice(t,1<r?1-r:void 0)}function pu(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function qc(){return!0}function Qg(){return!1}function mn(t){function e(n,r,i,s,o){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var l in t)t.hasOwnProperty(l)&&(n=t[l],this[l]=n?n(s):s[l]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?qc:Qg,this.isPropagationStopped=Qg,this}return $e(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=qc)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=qc)},persist:function(){},isPersistent:qc}),e}var ta={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Kp=mn(ta),Ql=$e({},ta,{view:0,detail:0}),ST=mn(Ql),Eh,kh,La,kd=$e({},Ql,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Gp,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==La&&(La&&t.type==="mousemove"?(Eh=t.screenX-La.screenX,kh=t.screenY-La.screenY):kh=Eh=0,La=t),Eh)},movementY:function(t){return"movementY"in t?t.movementY:kh}}),Yg=mn(kd),IT=$e({},kd,{dataTransfer:0}),CT=mn(IT),AT=$e({},Ql,{relatedTarget:0}),Th=mn(AT),NT=$e({},ta,{animationName:0,elapsedTime:0,pseudoElement:0}),PT=mn(NT),RT=$e({},ta,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),DT=mn(RT),jT=$e({},ta,{data:0}),Jg=mn(jT),OT={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},LT={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},MT={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function VT(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=MT[t])?!!e[t]:!1}function Gp(){return VT}var FT=$e({},Ql,{key:function(t){if(t.key){var e=OT[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=pu(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?LT[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Gp,charCode:function(t){return t.type==="keypress"?pu(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?pu(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),UT=mn(FT),zT=$e({},kd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Xg=mn(zT),BT=$e({},Ql,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Gp}),$T=mn(BT),qT=$e({},ta,{propertyName:0,elapsedTime:0,pseudoElement:0}),WT=mn(qT),HT=$e({},kd,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),KT=mn(HT),GT=[9,13,27,32],Qp=zr&&"CompositionEvent"in window,al=null;zr&&"documentMode"in document&&(al=document.documentMode);var QT=zr&&"TextEvent"in window&&!al,xw=zr&&(!Qp||al&&8<al&&11>=al),Zg=" ",ey=!1;function Ew(t,e){switch(t){case"keyup":return GT.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function kw(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var wo=!1;function YT(t,e){switch(t){case"compositionend":return kw(e);case"keypress":return e.which!==32?null:(ey=!0,Zg);case"textInput":return t=e.data,t===Zg&&ey?null:t;default:return null}}function JT(t,e){if(wo)return t==="compositionend"||!Qp&&Ew(t,e)?(t=_w(),fu=Hp=wi=null,wo=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return xw&&e.locale!=="ko"?null:e.data;default:return null}}var XT={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function ty(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!XT[t.type]:e==="textarea"}function Tw(t,e,n,r){tw(r),e=Vu(e,"onChange"),0<e.length&&(n=new Kp("onChange","change",null,n,r),t.push({event:n,listeners:e}))}var ll=null,bl=null;function ZT(t){Ow(t,0)}function Td(t){var e=Eo(t);if(G0(e))return t}function e1(t,e){if(t==="change")return e}var bw=!1;if(zr){var bh;if(zr){var Sh="oninput"in document;if(!Sh){var ny=document.createElement("div");ny.setAttribute("oninput","return;"),Sh=typeof ny.oninput=="function"}bh=Sh}else bh=!1;bw=bh&&(!document.documentMode||9<document.documentMode)}function ry(){ll&&(ll.detachEvent("onpropertychange",Sw),bl=ll=null)}function Sw(t){if(t.propertyName==="value"&&Td(bl)){var e=[];Tw(e,bl,t,zp(t)),sw(ZT,e)}}function t1(t,e,n){t==="focusin"?(ry(),ll=e,bl=n,ll.attachEvent("onpropertychange",Sw)):t==="focusout"&&ry()}function n1(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Td(bl)}function r1(t,e){if(t==="click")return Td(e)}function i1(t,e){if(t==="input"||t==="change")return Td(e)}function s1(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Fn=typeof Object.is=="function"?Object.is:s1;function Sl(t,e){if(Fn(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!pf.call(e,i)||!Fn(t[i],e[i]))return!1}return!0}function iy(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function sy(t,e){var n=iy(t);t=0;for(var r;n;){if(n.nodeType===3){if(r=t+n.textContent.length,t<=e&&r>=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=iy(n)}}function Iw(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Iw(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Cw(){for(var t=window,e=Pu();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Pu(t.document)}return e}function Yp(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function o1(t){var e=Cw(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&Iw(n.ownerDocument.documentElement,n)){if(r!==null&&Yp(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!t.extend&&s>r&&(i=r,r=s,s=i),i=sy(n,s);var o=sy(n,r);i&&o&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),s>r?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<e.length;n++)t=e[n],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var a1=zr&&"documentMode"in document&&11>=document.documentMode,_o=null,Df=null,cl=null,jf=!1;function oy(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;jf||_o==null||_o!==Pu(r)||(r=_o,"selectionStart"in r&&Yp(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}),cl&&Sl(cl,r)||(cl=r,r=Vu(Df,"onSelect"),0<r.length&&(e=new Kp("onSelect","select",null,e,n),t.push({event:e,listeners:r}),e.target=_o)))}function Wc(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var xo={animationend:Wc("Animation","AnimationEnd"),animationiteration:Wc("Animation","AnimationIteration"),animationstart:Wc("Animation","AnimationStart"),transitionend:Wc("Transition","TransitionEnd")},Ih={},Aw={};zr&&(Aw=document.createElement("div").style,"AnimationEvent"in window||(delete xo.animationend.animation,delete xo.animationiteration.animation,delete xo.animationstart.animation),"TransitionEvent"in window||delete xo.transitionend.transition);function bd(t){if(Ih[t])return Ih[t];if(!xo[t])return t;var e=xo[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in Aw)return Ih[t]=e[n];return t}var Nw=bd("animationend"),Pw=bd("animationiteration"),Rw=bd("animationstart"),Dw=bd("transitionend"),jw=new Map,ay="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Mi(t,e){jw.set(t,e),Ns(e,[t])}for(var Ch=0;Ch<ay.length;Ch++){var Ah=ay[Ch],l1=Ah.toLowerCase(),c1=Ah[0].toUpperCase()+Ah.slice(1);Mi(l1,"on"+c1)}Mi(Nw,"onAnimationEnd");Mi(Pw,"onAnimationIteration");Mi(Rw,"onAnimationStart");Mi("dblclick","onDoubleClick");Mi("focusin","onFocus");Mi("focusout","onBlur");Mi(Dw,"onTransitionEnd");Uo("onMouseEnter",["mouseout","mouseover"]);Uo("onMouseLeave",["mouseout","mouseover"]);Uo("onPointerEnter",["pointerout","pointerover"]);Uo("onPointerLeave",["pointerout","pointerover"]);Ns("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Ns("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Ns("onBeforeInput",["compositionend","keypress","textInput","paste"]);Ns("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Ns("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Ns("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Xa="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),u1=new Set("cancel close invalid load scroll toggle".split(" ").concat(Xa));function ly(t,e,n){var r=t.type||"unknown-event";t.currentTarget=n,lT(r,e,void 0,t),t.currentTarget=null}function Ow(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var r=t[n],i=r.event;r=r.listeners;e:{var s=void 0;if(e)for(var o=r.length-1;0<=o;o--){var l=r[o],u=l.instance,h=l.currentTarget;if(l=l.listener,u!==s&&i.isPropagationStopped())break e;ly(i,l,h),s=u}else for(o=0;o<r.length;o++){if(l=r[o],u=l.instance,h=l.currentTarget,l=l.listener,u!==s&&i.isPropagationStopped())break e;ly(i,l,h),s=u}}}if(Du)throw t=Af,Du=!1,Af=null,t}function Re(t,e){var n=e[Ff];n===void 0&&(n=e[Ff]=new Set);var r=t+"__bubble";n.has(r)||(Lw(e,t,2,!1),n.add(r))}function Nh(t,e,n){var r=0;e&&(r|=4),Lw(n,t,r,e)}var Hc="_reactListening"+Math.random().toString(36).slice(2);function Il(t){if(!t[Hc]){t[Hc]=!0,$0.forEach(function(n){n!=="selectionchange"&&(u1.has(n)||Nh(n,!1,t),Nh(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Hc]||(e[Hc]=!0,Nh("selectionchange",!1,e))}}function Lw(t,e,n,r){switch(ww(e)){case 1:var i=TT;break;case 4:i=bT;break;default:i=Wp}n=i.bind(null,e,n,t),i=void 0,!Cf||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(i=!0),r?i!==void 0?t.addEventListener(e,n,{capture:!0,passive:i}):t.addEventListener(e,n,!0):i!==void 0?t.addEventListener(e,n,{passive:i}):t.addEventListener(e,n,!1)}function Ph(t,e,n,r,i){var s=r;if(!(e&1)&&!(e&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var l=r.stateNode.containerInfo;if(l===i||l.nodeType===8&&l.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var u=o.tag;if((u===3||u===4)&&(u=o.stateNode.containerInfo,u===i||u.nodeType===8&&u.parentNode===i))return;o=o.return}for(;l!==null;){if(o=us(l),o===null)return;if(u=o.tag,u===5||u===6){r=s=o;continue e}l=l.parentNode}}r=r.return}sw(function(){var h=s,m=zp(n),v=[];e:{var g=jw.get(t);if(g!==void 0){var N=Kp,j=t;switch(t){case"keypress":if(pu(n)===0)break e;case"keydown":case"keyup":N=UT;break;case"focusin":j="focus",N=Th;break;case"focusout":j="blur",N=Th;break;case"beforeblur":case"afterblur":N=Th;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":N=Yg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":N=CT;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":N=$T;break;case Nw:case Pw:case Rw:N=PT;break;case Dw:N=WT;break;case"scroll":N=ST;break;case"wheel":N=KT;break;case"copy":case"cut":case"paste":N=DT;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":N=Xg}var L=(e&4)!==0,B=!L&&t==="scroll",I=L?g!==null?g+"Capture":null:g;L=[];for(var k=h,C;k!==null;){C=k;var V=C.stateNode;if(C.tag===5&&V!==null&&(C=V,I!==null&&(V=xl(k,I),V!=null&&L.push(Cl(k,V,C)))),B)break;k=k.return}0<L.length&&(g=new N(g,j,null,n,m),v.push({event:g,listeners:L}))}}if(!(e&7)){e:{if(g=t==="mouseover"||t==="pointerover",N=t==="mouseout"||t==="pointerout",g&&n!==Sf&&(j=n.relatedTarget||n.fromElement)&&(us(j)||j[Br]))break e;if((N||g)&&(g=m.window===m?m:(g=m.ownerDocument)?g.defaultView||g.parentWindow:window,N?(j=n.relatedTarget||n.toElement,N=h,j=j?us(j):null,j!==null&&(B=Ps(j),j!==B||j.tag!==5&&j.tag!==6)&&(j=null)):(N=null,j=h),N!==j)){if(L=Yg,V="onMouseLeave",I="onMouseEnter",k="mouse",(t==="pointerout"||t==="pointerover")&&(L=Xg,V="onPointerLeave",I="onPointerEnter",k="pointer"),B=N==null?g:Eo(N),C=j==null?g:Eo(j),g=new L(V,k+"leave",N,n,m),g.target=B,g.relatedTarget=C,V=null,us(m)===h&&(L=new L(I,k+"enter",j,n,m),L.target=C,L.relatedTarget=B,V=L),B=V,N&&j)t:{for(L=N,I=j,k=0,C=L;C;C=uo(C))k++;for(C=0,V=I;V;V=uo(V))C++;for(;0<k-C;)L=uo(L),k--;for(;0<C-k;)I=uo(I),C--;for(;k--;){if(L===I||I!==null&&L===I.alternate)break t;L=uo(L),I=uo(I)}L=null}else L=null;N!==null&&cy(v,g,N,L,!1),j!==null&&B!==null&&cy(v,B,j,L,!0)}}e:{if(g=h?Eo(h):window,N=g.nodeName&&g.nodeName.toLowerCase(),N==="select"||N==="input"&&g.type==="file")var G=e1;else if(ty(g))if(bw)G=i1;else{G=n1;var H=t1}else(N=g.nodeName)&&N.toLowerCase()==="input"&&(g.type==="checkbox"||g.type==="radio")&&(G=r1);if(G&&(G=G(t,h))){Tw(v,G,n,m);break e}H&&H(t,g,h),t==="focusout"&&(H=g._wrapperState)&&H.controlled&&g.type==="number"&&xf(g,"number",g.value)}switch(H=h?Eo(h):window,t){case"focusin":(ty(H)||H.contentEditable==="true")&&(_o=H,Df=h,cl=null);break;case"focusout":cl=Df=_o=null;break;case"mousedown":jf=!0;break;case"contextmenu":case"mouseup":case"dragend":jf=!1,oy(v,n,m);break;case"selectionchange":if(a1)break;case"keydown":case"keyup":oy(v,n,m)}var T;if(Qp)e:{switch(t){case"compositionstart":var w="onCompositionStart";break e;case"compositionend":w="onCompositionEnd";break e;case"compositionupdate":w="onCompositionUpdate";break e}w=void 0}else wo?Ew(t,n)&&(w="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(w="onCompositionStart");w&&(xw&&n.locale!=="ko"&&(wo||w!=="onCompositionStart"?w==="onCompositionEnd"&&wo&&(T=_w()):(wi=m,Hp="value"in wi?wi.value:wi.textContent,wo=!0)),H=Vu(h,w),0<H.length&&(w=new Jg(w,t,null,n,m),v.push({event:w,listeners:H}),T?w.data=T:(T=kw(n),T!==null&&(w.data=T)))),(T=QT?YT(t,n):JT(t,n))&&(h=Vu(h,"onBeforeInput"),0<h.length&&(m=new Jg("onBeforeInput","beforeinput",null,n,m),v.push({event:m,listeners:h}),m.data=T))}Ow(v,e)})}function Cl(t,e,n){return{instance:t,listener:e,currentTarget:n}}function Vu(t,e){for(var n=e+"Capture",r=[];t!==null;){var i=t,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=xl(t,n),s!=null&&r.unshift(Cl(t,s,i)),s=xl(t,e),s!=null&&r.push(Cl(t,s,i))),t=t.return}return r}function uo(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function cy(t,e,n,r,i){for(var s=e._reactName,o=[];n!==null&&n!==r;){var l=n,u=l.alternate,h=l.stateNode;if(u!==null&&u===r)break;l.tag===5&&h!==null&&(l=h,i?(u=xl(n,s),u!=null&&o.unshift(Cl(n,u,l))):i||(u=xl(n,s),u!=null&&o.push(Cl(n,u,l)))),n=n.return}o.length!==0&&t.push({event:e,listeners:o})}var d1=/\r\n?/g,h1=/\u0000|\uFFFD/g;function uy(t){return(typeof t=="string"?t:""+t).replace(d1,`
|
|
`).replace(h1,"")}function Kc(t,e,n){if(e=uy(e),uy(t)!==e&&n)throw Error(W(425))}function Fu(){}var Of=null,Lf=null;function Mf(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var Vf=typeof setTimeout=="function"?setTimeout:void 0,f1=typeof clearTimeout=="function"?clearTimeout:void 0,dy=typeof Promise=="function"?Promise:void 0,p1=typeof queueMicrotask=="function"?queueMicrotask:typeof dy<"u"?function(t){return dy.resolve(null).then(t).catch(m1)}:Vf;function m1(t){setTimeout(function(){throw t})}function Rh(t,e){var n=e,r=0;do{var i=n.nextSibling;if(t.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){t.removeChild(i),Tl(e);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);Tl(e)}function bi(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return t}function hy(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"){if(e===0)return t;e--}else n==="/$"&&e++}t=t.previousSibling}return null}var na=Math.random().toString(36).slice(2),nr="__reactFiber$"+na,Al="__reactProps$"+na,Br="__reactContainer$"+na,Ff="__reactEvents$"+na,g1="__reactListeners$"+na,y1="__reactHandles$"+na;function us(t){var e=t[nr];if(e)return e;for(var n=t.parentNode;n;){if(e=n[Br]||n[nr]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=hy(t);t!==null;){if(n=t[nr])return n;t=hy(t)}return e}t=n,n=t.parentNode}return null}function Yl(t){return t=t[nr]||t[Br],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function Eo(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(W(33))}function Sd(t){return t[Al]||null}var Uf=[],ko=-1;function Vi(t){return{current:t}}function je(t){0>ko||(t.current=Uf[ko],Uf[ko]=null,ko--)}function Pe(t,e){ko++,Uf[ko]=t.current,t.current=e}var Di={},Ft=Vi(Di),rn=Vi(!1),vs=Di;function zo(t,e){var n=t.type.contextTypes;if(!n)return Di;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=e[s];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function sn(t){return t=t.childContextTypes,t!=null}function Uu(){je(rn),je(Ft)}function fy(t,e,n){if(Ft.current!==Di)throw Error(W(168));Pe(Ft,e),Pe(rn,n)}function Mw(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(W(108,tT(t)||"Unknown",i));return $e({},n,r)}function zu(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Di,vs=Ft.current,Pe(Ft,t),Pe(rn,rn.current),!0}function py(t,e,n){var r=t.stateNode;if(!r)throw Error(W(169));n?(t=Mw(t,e,vs),r.__reactInternalMemoizedMergedChildContext=t,je(rn),je(Ft),Pe(Ft,t)):je(rn),Pe(rn,n)}var Pr=null,Id=!1,Dh=!1;function Vw(t){Pr===null?Pr=[t]:Pr.push(t)}function v1(t){Id=!0,Vw(t)}function Fi(){if(!Dh&&Pr!==null){Dh=!0;var t=0,e=be;try{var n=Pr;for(be=1;t<n.length;t++){var r=n[t];do r=r(!0);while(r!==null)}Pr=null,Id=!1}catch(i){throw Pr!==null&&(Pr=Pr.slice(t+1)),cw(Bp,Fi),i}finally{be=e,Dh=!1}}return null}var To=[],bo=0,Bu=null,$u=0,En=[],kn=0,ws=null,Rr=1,Dr="";function as(t,e){To[bo++]=$u,To[bo++]=Bu,Bu=t,$u=e}function Fw(t,e,n){En[kn++]=Rr,En[kn++]=Dr,En[kn++]=ws,ws=t;var r=Rr;t=Dr;var i=32-Mn(r)-1;r&=~(1<<i),n+=1;var s=32-Mn(e)+i;if(30<s){var o=i-i%5;s=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Rr=1<<32-Mn(e)+i|n<<i|r,Dr=s+t}else Rr=1<<s|n<<i|r,Dr=t}function Jp(t){t.return!==null&&(as(t,1),Fw(t,1,0))}function Xp(t){for(;t===Bu;)Bu=To[--bo],To[bo]=null,$u=To[--bo],To[bo]=null;for(;t===ws;)ws=En[--kn],En[kn]=null,Dr=En[--kn],En[kn]=null,Rr=En[--kn],En[kn]=null}var hn=null,un=null,Fe=!1,Ln=null;function Uw(t,e){var n=Tn(5,null,null,0);n.elementType="DELETED",n.stateNode=e,n.return=t,e=t.deletions,e===null?(t.deletions=[n],t.flags|=16):e.push(n)}function my(t,e){switch(t.tag){case 5:var n=t.type;return e=e.nodeType!==1||n.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,hn=t,un=bi(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,hn=t,un=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(n=ws!==null?{id:Rr,overflow:Dr}:null,t.memoizedState={dehydrated:e,treeContext:n,retryLane:1073741824},n=Tn(18,null,null,0),n.stateNode=e,n.return=t,t.child=n,hn=t,un=null,!0):!1;default:return!1}}function zf(t){return(t.mode&1)!==0&&(t.flags&128)===0}function Bf(t){if(Fe){var e=un;if(e){var n=e;if(!my(t,e)){if(zf(t))throw Error(W(418));e=bi(n.nextSibling);var r=hn;e&&my(t,e)?Uw(r,n):(t.flags=t.flags&-4097|2,Fe=!1,hn=t)}}else{if(zf(t))throw Error(W(418));t.flags=t.flags&-4097|2,Fe=!1,hn=t}}}function gy(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;hn=t}function Gc(t){if(t!==hn)return!1;if(!Fe)return gy(t),Fe=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!Mf(t.type,t.memoizedProps)),e&&(e=un)){if(zf(t))throw zw(),Error(W(418));for(;e;)Uw(t,e),e=bi(e.nextSibling)}if(gy(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(W(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"){if(e===0){un=bi(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++}t=t.nextSibling}un=null}}else un=hn?bi(t.stateNode.nextSibling):null;return!0}function zw(){for(var t=un;t;)t=bi(t.nextSibling)}function Bo(){un=hn=null,Fe=!1}function Zp(t){Ln===null?Ln=[t]:Ln.push(t)}var w1=Qr.ReactCurrentBatchConfig;function Ma(t,e,n){if(t=n.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(W(309));var r=n.stateNode}if(!r)throw Error(W(147,t));var i=r,s=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===s?e.ref:(e=function(o){var l=i.refs;o===null?delete l[s]:l[s]=o},e._stringRef=s,e)}if(typeof t!="string")throw Error(W(284));if(!n._owner)throw Error(W(290,t))}return t}function Qc(t,e){throw t=Object.prototype.toString.call(e),Error(W(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function yy(t){var e=t._init;return e(t._payload)}function Bw(t){function e(I,k){if(t){var C=I.deletions;C===null?(I.deletions=[k],I.flags|=16):C.push(k)}}function n(I,k){if(!t)return null;for(;k!==null;)e(I,k),k=k.sibling;return null}function r(I,k){for(I=new Map;k!==null;)k.key!==null?I.set(k.key,k):I.set(k.index,k),k=k.sibling;return I}function i(I,k){return I=Ai(I,k),I.index=0,I.sibling=null,I}function s(I,k,C){return I.index=C,t?(C=I.alternate,C!==null?(C=C.index,C<k?(I.flags|=2,k):C):(I.flags|=2,k)):(I.flags|=1048576,k)}function o(I){return t&&I.alternate===null&&(I.flags|=2),I}function l(I,k,C,V){return k===null||k.tag!==6?(k=Uh(C,I.mode,V),k.return=I,k):(k=i(k,C),k.return=I,k)}function u(I,k,C,V){var G=C.type;return G===vo?m(I,k,C.props.children,V,C.key):k!==null&&(k.elementType===G||typeof G=="object"&&G!==null&&G.$$typeof===di&&yy(G)===k.type)?(V=i(k,C.props),V.ref=Ma(I,k,C),V.return=I,V):(V=xu(C.type,C.key,C.props,null,I.mode,V),V.ref=Ma(I,k,C),V.return=I,V)}function h(I,k,C,V){return k===null||k.tag!==4||k.stateNode.containerInfo!==C.containerInfo||k.stateNode.implementation!==C.implementation?(k=zh(C,I.mode,V),k.return=I,k):(k=i(k,C.children||[]),k.return=I,k)}function m(I,k,C,V,G){return k===null||k.tag!==7?(k=gs(C,I.mode,V,G),k.return=I,k):(k=i(k,C),k.return=I,k)}function v(I,k,C){if(typeof k=="string"&&k!==""||typeof k=="number")return k=Uh(""+k,I.mode,C),k.return=I,k;if(typeof k=="object"&&k!==null){switch(k.$$typeof){case Vc:return C=xu(k.type,k.key,k.props,null,I.mode,C),C.ref=Ma(I,null,k),C.return=I,C;case yo:return k=zh(k,I.mode,C),k.return=I,k;case di:var V=k._init;return v(I,V(k._payload),C)}if(Ya(k)||Ra(k))return k=gs(k,I.mode,C,null),k.return=I,k;Qc(I,k)}return null}function g(I,k,C,V){var G=k!==null?k.key:null;if(typeof C=="string"&&C!==""||typeof C=="number")return G!==null?null:l(I,k,""+C,V);if(typeof C=="object"&&C!==null){switch(C.$$typeof){case Vc:return C.key===G?u(I,k,C,V):null;case yo:return C.key===G?h(I,k,C,V):null;case di:return G=C._init,g(I,k,G(C._payload),V)}if(Ya(C)||Ra(C))return G!==null?null:m(I,k,C,V,null);Qc(I,C)}return null}function N(I,k,C,V,G){if(typeof V=="string"&&V!==""||typeof V=="number")return I=I.get(C)||null,l(k,I,""+V,G);if(typeof V=="object"&&V!==null){switch(V.$$typeof){case Vc:return I=I.get(V.key===null?C:V.key)||null,u(k,I,V,G);case yo:return I=I.get(V.key===null?C:V.key)||null,h(k,I,V,G);case di:var H=V._init;return N(I,k,C,H(V._payload),G)}if(Ya(V)||Ra(V))return I=I.get(C)||null,m(k,I,V,G,null);Qc(k,V)}return null}function j(I,k,C,V){for(var G=null,H=null,T=k,w=k=0,E=null;T!==null&&w<C.length;w++){T.index>w?(E=T,T=null):E=T.sibling;var S=g(I,T,C[w],V);if(S===null){T===null&&(T=E);break}t&&T&&S.alternate===null&&e(I,T),k=s(S,k,w),H===null?G=S:H.sibling=S,H=S,T=E}if(w===C.length)return n(I,T),Fe&&as(I,w),G;if(T===null){for(;w<C.length;w++)T=v(I,C[w],V),T!==null&&(k=s(T,k,w),H===null?G=T:H.sibling=T,H=T);return Fe&&as(I,w),G}for(T=r(I,T);w<C.length;w++)E=N(T,I,w,C[w],V),E!==null&&(t&&E.alternate!==null&&T.delete(E.key===null?w:E.key),k=s(E,k,w),H===null?G=E:H.sibling=E,H=E);return t&&T.forEach(function(A){return e(I,A)}),Fe&&as(I,w),G}function L(I,k,C,V){var G=Ra(C);if(typeof G!="function")throw Error(W(150));if(C=G.call(C),C==null)throw Error(W(151));for(var H=G=null,T=k,w=k=0,E=null,S=C.next();T!==null&&!S.done;w++,S=C.next()){T.index>w?(E=T,T=null):E=T.sibling;var A=g(I,T,S.value,V);if(A===null){T===null&&(T=E);break}t&&T&&A.alternate===null&&e(I,T),k=s(A,k,w),H===null?G=A:H.sibling=A,H=A,T=E}if(S.done)return n(I,T),Fe&&as(I,w),G;if(T===null){for(;!S.done;w++,S=C.next())S=v(I,S.value,V),S!==null&&(k=s(S,k,w),H===null?G=S:H.sibling=S,H=S);return Fe&&as(I,w),G}for(T=r(I,T);!S.done;w++,S=C.next())S=N(T,I,w,S.value,V),S!==null&&(t&&S.alternate!==null&&T.delete(S.key===null?w:S.key),k=s(S,k,w),H===null?G=S:H.sibling=S,H=S);return t&&T.forEach(function(R){return e(I,R)}),Fe&&as(I,w),G}function B(I,k,C,V){if(typeof C=="object"&&C!==null&&C.type===vo&&C.key===null&&(C=C.props.children),typeof C=="object"&&C!==null){switch(C.$$typeof){case Vc:e:{for(var G=C.key,H=k;H!==null;){if(H.key===G){if(G=C.type,G===vo){if(H.tag===7){n(I,H.sibling),k=i(H,C.props.children),k.return=I,I=k;break e}}else if(H.elementType===G||typeof G=="object"&&G!==null&&G.$$typeof===di&&yy(G)===H.type){n(I,H.sibling),k=i(H,C.props),k.ref=Ma(I,H,C),k.return=I,I=k;break e}n(I,H);break}else e(I,H);H=H.sibling}C.type===vo?(k=gs(C.props.children,I.mode,V,C.key),k.return=I,I=k):(V=xu(C.type,C.key,C.props,null,I.mode,V),V.ref=Ma(I,k,C),V.return=I,I=V)}return o(I);case yo:e:{for(H=C.key;k!==null;){if(k.key===H)if(k.tag===4&&k.stateNode.containerInfo===C.containerInfo&&k.stateNode.implementation===C.implementation){n(I,k.sibling),k=i(k,C.children||[]),k.return=I,I=k;break e}else{n(I,k);break}else e(I,k);k=k.sibling}k=zh(C,I.mode,V),k.return=I,I=k}return o(I);case di:return H=C._init,B(I,k,H(C._payload),V)}if(Ya(C))return j(I,k,C,V);if(Ra(C))return L(I,k,C,V);Qc(I,C)}return typeof C=="string"&&C!==""||typeof C=="number"?(C=""+C,k!==null&&k.tag===6?(n(I,k.sibling),k=i(k,C),k.return=I,I=k):(n(I,k),k=Uh(C,I.mode,V),k.return=I,I=k),o(I)):n(I,k)}return B}var $o=Bw(!0),$w=Bw(!1),qu=Vi(null),Wu=null,So=null,em=null;function tm(){em=So=Wu=null}function nm(t){var e=qu.current;je(qu),t._currentValue=e}function $f(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function jo(t,e){Wu=t,em=So=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(nn=!0),t.firstContext=null)}function In(t){var e=t._currentValue;if(em!==t)if(t={context:t,memoizedValue:e,next:null},So===null){if(Wu===null)throw Error(W(308));So=t,Wu.dependencies={lanes:0,firstContext:t}}else So=So.next=t;return e}var ds=null;function rm(t){ds===null?ds=[t]:ds.push(t)}function qw(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,rm(e)):(n.next=i.next,i.next=n),e.interleaved=n,$r(t,r)}function $r(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var hi=!1;function im(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ww(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Mr(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Si(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,we&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,$r(t,n)}return i=r.interleaved,i===null?(e.next=e,rm(r)):(e.next=i.next,i.next=e),r.interleaved=e,$r(t,n)}function mu(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,$p(t,n)}}function vy(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?i=s=e:s=s.next=e}else i=s=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function Hu(t,e,n,r){var i=t.updateQueue;hi=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var u=l,h=u.next;u.next=null,o===null?s=h:o.next=h,o=u;var m=t.alternate;m!==null&&(m=m.updateQueue,l=m.lastBaseUpdate,l!==o&&(l===null?m.firstBaseUpdate=h:l.next=h,m.lastBaseUpdate=u))}if(s!==null){var v=i.baseState;o=0,m=h=u=null,l=s;do{var g=l.lane,N=l.eventTime;if((r&g)===g){m!==null&&(m=m.next={eventTime:N,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var j=t,L=l;switch(g=e,N=n,L.tag){case 1:if(j=L.payload,typeof j=="function"){v=j.call(N,v,g);break e}v=j;break e;case 3:j.flags=j.flags&-65537|128;case 0:if(j=L.payload,g=typeof j=="function"?j.call(N,v,g):j,g==null)break e;v=$e({},v,g);break e;case 2:hi=!0}}l.callback!==null&&l.lane!==0&&(t.flags|=64,g=i.effects,g===null?i.effects=[l]:g.push(l))}else N={eventTime:N,lane:g,tag:l.tag,payload:l.payload,callback:l.callback,next:null},m===null?(h=m=N,u=v):m=m.next=N,o|=g;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;g=l,l=g.next,g.next=null,i.lastBaseUpdate=g,i.shared.pending=null}}while(!0);if(m===null&&(u=v),i.baseState=u,i.firstBaseUpdate=h,i.lastBaseUpdate=m,e=i.shared.interleaved,e!==null){i=e;do o|=i.lane,i=i.next;while(i!==e)}else s===null&&(i.shared.lanes=0);xs|=o,t.lanes=o,t.memoizedState=v}}function wy(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var r=t[e],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(W(191,i));i.call(r)}}}var Jl={},sr=Vi(Jl),Nl=Vi(Jl),Pl=Vi(Jl);function hs(t){if(t===Jl)throw Error(W(174));return t}function sm(t,e){switch(Pe(Pl,e),Pe(Nl,t),Pe(sr,Jl),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:kf(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=kf(e,t)}je(sr),Pe(sr,e)}function qo(){je(sr),je(Nl),je(Pl)}function Hw(t){hs(Pl.current);var e=hs(sr.current),n=kf(e,t.type);e!==n&&(Pe(Nl,t),Pe(sr,n))}function om(t){Nl.current===t&&(je(sr),je(Nl))}var ze=Vi(0);function Ku(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var jh=[];function am(){for(var t=0;t<jh.length;t++)jh[t]._workInProgressVersionPrimary=null;jh.length=0}var gu=Qr.ReactCurrentDispatcher,Oh=Qr.ReactCurrentBatchConfig,_s=0,Be=null,ut=null,mt=null,Gu=!1,ul=!1,Rl=0,_1=0;function Rt(){throw Error(W(321))}function lm(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!Fn(t[n],e[n]))return!1;return!0}function cm(t,e,n,r,i,s){if(_s=s,Be=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,gu.current=t===null||t.memoizedState===null?T1:b1,t=n(r,i),ul){s=0;do{if(ul=!1,Rl=0,25<=s)throw Error(W(301));s+=1,mt=ut=null,e.updateQueue=null,gu.current=S1,t=n(r,i)}while(ul)}if(gu.current=Qu,e=ut!==null&&ut.next!==null,_s=0,mt=ut=Be=null,Gu=!1,e)throw Error(W(300));return t}function um(){var t=Rl!==0;return Rl=0,t}function tr(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return mt===null?Be.memoizedState=mt=t:mt=mt.next=t,mt}function Cn(){if(ut===null){var t=Be.alternate;t=t!==null?t.memoizedState:null}else t=ut.next;var e=mt===null?Be.memoizedState:mt.next;if(e!==null)mt=e,ut=t;else{if(t===null)throw Error(W(310));ut=t,t={memoizedState:ut.memoizedState,baseState:ut.baseState,baseQueue:ut.baseQueue,queue:ut.queue,next:null},mt===null?Be.memoizedState=mt=t:mt=mt.next=t}return mt}function Dl(t,e){return typeof e=="function"?e(t):e}function Lh(t){var e=Cn(),n=e.queue;if(n===null)throw Error(W(311));n.lastRenderedReducer=t;var r=ut,i=r.baseQueue,s=n.pending;if(s!==null){if(i!==null){var o=i.next;i.next=s.next,s.next=o}r.baseQueue=i=s,n.pending=null}if(i!==null){s=i.next,r=r.baseState;var l=o=null,u=null,h=s;do{var m=h.lane;if((_s&m)===m)u!==null&&(u=u.next={lane:0,action:h.action,hasEagerState:h.hasEagerState,eagerState:h.eagerState,next:null}),r=h.hasEagerState?h.eagerState:t(r,h.action);else{var v={lane:m,action:h.action,hasEagerState:h.hasEagerState,eagerState:h.eagerState,next:null};u===null?(l=u=v,o=r):u=u.next=v,Be.lanes|=m,xs|=m}h=h.next}while(h!==null&&h!==s);u===null?o=r:u.next=l,Fn(r,e.memoizedState)||(nn=!0),e.memoizedState=r,e.baseState=o,e.baseQueue=u,n.lastRenderedState=r}if(t=n.interleaved,t!==null){i=t;do s=i.lane,Be.lanes|=s,xs|=s,i=i.next;while(i!==t)}else i===null&&(n.lanes=0);return[e.memoizedState,n.dispatch]}function Mh(t){var e=Cn(),n=e.queue;if(n===null)throw Error(W(311));n.lastRenderedReducer=t;var r=n.dispatch,i=n.pending,s=e.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do s=t(s,o.action),o=o.next;while(o!==i);Fn(s,e.memoizedState)||(nn=!0),e.memoizedState=s,e.baseQueue===null&&(e.baseState=s),n.lastRenderedState=s}return[s,r]}function Kw(){}function Gw(t,e){var n=Be,r=Cn(),i=e(),s=!Fn(r.memoizedState,i);if(s&&(r.memoizedState=i,nn=!0),r=r.queue,dm(Jw.bind(null,n,r,t),[t]),r.getSnapshot!==e||s||mt!==null&&mt.memoizedState.tag&1){if(n.flags|=2048,jl(9,Yw.bind(null,n,r,i,e),void 0,null),gt===null)throw Error(W(349));_s&30||Qw(n,e,i)}return i}function Qw(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=Be.updateQueue,e===null?(e={lastEffect:null,stores:null},Be.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function Yw(t,e,n,r){e.value=n,e.getSnapshot=r,Xw(e)&&Zw(t)}function Jw(t,e,n){return n(function(){Xw(e)&&Zw(t)})}function Xw(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!Fn(t,n)}catch{return!0}}function Zw(t){var e=$r(t,1);e!==null&&Vn(e,t,1,-1)}function _y(t){var e=tr();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Dl,lastRenderedState:t},e.queue=t,t=t.dispatch=k1.bind(null,Be,t),[e.memoizedState,t]}function jl(t,e,n,r){return t={tag:t,create:e,destroy:n,deps:r,next:null},e=Be.updateQueue,e===null?(e={lastEffect:null,stores:null},Be.updateQueue=e,e.lastEffect=t.next=t):(n=e.lastEffect,n===null?e.lastEffect=t.next=t:(r=n.next,n.next=t,t.next=r,e.lastEffect=t)),t}function e_(){return Cn().memoizedState}function yu(t,e,n,r){var i=tr();Be.flags|=t,i.memoizedState=jl(1|e,n,void 0,r===void 0?null:r)}function Cd(t,e,n,r){var i=Cn();r=r===void 0?null:r;var s=void 0;if(ut!==null){var o=ut.memoizedState;if(s=o.destroy,r!==null&&lm(r,o.deps)){i.memoizedState=jl(e,n,s,r);return}}Be.flags|=t,i.memoizedState=jl(1|e,n,s,r)}function xy(t,e){return yu(8390656,8,t,e)}function dm(t,e){return Cd(2048,8,t,e)}function t_(t,e){return Cd(4,2,t,e)}function n_(t,e){return Cd(4,4,t,e)}function r_(t,e){if(typeof e=="function")return t=t(),e(t),function(){e(null)};if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function i_(t,e,n){return n=n!=null?n.concat([t]):null,Cd(4,4,r_.bind(null,e,t),n)}function hm(){}function s_(t,e){var n=Cn();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&lm(e,r[1])?r[0]:(n.memoizedState=[t,e],t)}function o_(t,e){var n=Cn();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&lm(e,r[1])?r[0]:(t=t(),n.memoizedState=[t,e],t)}function a_(t,e,n){return _s&21?(Fn(n,e)||(n=hw(),Be.lanes|=n,xs|=n,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,nn=!0),t.memoizedState=n)}function x1(t,e){var n=be;be=n!==0&&4>n?n:4,t(!0);var r=Oh.transition;Oh.transition={};try{t(!1),e()}finally{be=n,Oh.transition=r}}function l_(){return Cn().memoizedState}function E1(t,e,n){var r=Ci(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},c_(t))u_(e,n);else if(n=qw(t,e,n,r),n!==null){var i=$t();Vn(n,t,r,i),d_(n,e,r)}}function k1(t,e,n){var r=Ci(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(c_(t))u_(e,i);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,l=s(o,n);if(i.hasEagerState=!0,i.eagerState=l,Fn(l,o)){var u=e.interleaved;u===null?(i.next=i,rm(e)):(i.next=u.next,u.next=i),e.interleaved=i;return}}catch{}finally{}n=qw(t,e,i,r),n!==null&&(i=$t(),Vn(n,t,r,i),d_(n,e,r))}}function c_(t){var e=t.alternate;return t===Be||e!==null&&e===Be}function u_(t,e){ul=Gu=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function d_(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,$p(t,n)}}var Qu={readContext:In,useCallback:Rt,useContext:Rt,useEffect:Rt,useImperativeHandle:Rt,useInsertionEffect:Rt,useLayoutEffect:Rt,useMemo:Rt,useReducer:Rt,useRef:Rt,useState:Rt,useDebugValue:Rt,useDeferredValue:Rt,useTransition:Rt,useMutableSource:Rt,useSyncExternalStore:Rt,useId:Rt,unstable_isNewReconciler:!1},T1={readContext:In,useCallback:function(t,e){return tr().memoizedState=[t,e===void 0?null:e],t},useContext:In,useEffect:xy,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,yu(4194308,4,r_.bind(null,e,t),n)},useLayoutEffect:function(t,e){return yu(4194308,4,t,e)},useInsertionEffect:function(t,e){return yu(4,2,t,e)},useMemo:function(t,e){var n=tr();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=tr();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=E1.bind(null,Be,t),[r.memoizedState,t]},useRef:function(t){var e=tr();return t={current:t},e.memoizedState=t},useState:_y,useDebugValue:hm,useDeferredValue:function(t){return tr().memoizedState=t},useTransition:function(){var t=_y(!1),e=t[0];return t=x1.bind(null,t[1]),tr().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=Be,i=tr();if(Fe){if(n===void 0)throw Error(W(407));n=n()}else{if(n=e(),gt===null)throw Error(W(349));_s&30||Qw(r,e,n)}i.memoizedState=n;var s={value:n,getSnapshot:e};return i.queue=s,xy(Jw.bind(null,r,s,t),[t]),r.flags|=2048,jl(9,Yw.bind(null,r,s,n,e),void 0,null),n},useId:function(){var t=tr(),e=gt.identifierPrefix;if(Fe){var n=Dr,r=Rr;n=(r&~(1<<32-Mn(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=Rl++,0<n&&(e+="H"+n.toString(32)),e+=":"}else n=_1++,e=":"+e+"r"+n.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},b1={readContext:In,useCallback:s_,useContext:In,useEffect:dm,useImperativeHandle:i_,useInsertionEffect:t_,useLayoutEffect:n_,useMemo:o_,useReducer:Lh,useRef:e_,useState:function(){return Lh(Dl)},useDebugValue:hm,useDeferredValue:function(t){var e=Cn();return a_(e,ut.memoizedState,t)},useTransition:function(){var t=Lh(Dl)[0],e=Cn().memoizedState;return[t,e]},useMutableSource:Kw,useSyncExternalStore:Gw,useId:l_,unstable_isNewReconciler:!1},S1={readContext:In,useCallback:s_,useContext:In,useEffect:dm,useImperativeHandle:i_,useInsertionEffect:t_,useLayoutEffect:n_,useMemo:o_,useReducer:Mh,useRef:e_,useState:function(){return Mh(Dl)},useDebugValue:hm,useDeferredValue:function(t){var e=Cn();return ut===null?e.memoizedState=t:a_(e,ut.memoizedState,t)},useTransition:function(){var t=Mh(Dl)[0],e=Cn().memoizedState;return[t,e]},useMutableSource:Kw,useSyncExternalStore:Gw,useId:l_,unstable_isNewReconciler:!1};function jn(t,e){if(t&&t.defaultProps){e=$e({},e),t=t.defaultProps;for(var n in t)e[n]===void 0&&(e[n]=t[n]);return e}return e}function qf(t,e,n,r){e=t.memoizedState,n=n(r,e),n=n==null?e:$e({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var Ad={isMounted:function(t){return(t=t._reactInternals)?Ps(t)===t:!1},enqueueSetState:function(t,e,n){t=t._reactInternals;var r=$t(),i=Ci(t),s=Mr(r,i);s.payload=e,n!=null&&(s.callback=n),e=Si(t,s,i),e!==null&&(Vn(e,t,i,r),mu(e,t,i))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var r=$t(),i=Ci(t),s=Mr(r,i);s.tag=1,s.payload=e,n!=null&&(s.callback=n),e=Si(t,s,i),e!==null&&(Vn(e,t,i,r),mu(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=$t(),r=Ci(t),i=Mr(n,r);i.tag=2,e!=null&&(i.callback=e),e=Si(t,i,r),e!==null&&(Vn(e,t,r,n),mu(e,t,r))}};function Ey(t,e,n,r,i,s,o){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(r,s,o):e.prototype&&e.prototype.isPureReactComponent?!Sl(n,r)||!Sl(i,s):!0}function h_(t,e,n){var r=!1,i=Di,s=e.contextType;return typeof s=="object"&&s!==null?s=In(s):(i=sn(e)?vs:Ft.current,r=e.contextTypes,s=(r=r!=null)?zo(t,i):Di),e=new e(n,s),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=Ad,t.stateNode=e,e._reactInternals=t,r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=i,t.__reactInternalMemoizedMaskedChildContext=s),e}function ky(t,e,n,r){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,r),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,r),e.state!==t&&Ad.enqueueReplaceState(e,e.state,null)}function Wf(t,e,n,r){var i=t.stateNode;i.props=n,i.state=t.memoizedState,i.refs={},im(t);var s=e.contextType;typeof s=="object"&&s!==null?i.context=In(s):(s=sn(e)?vs:Ft.current,i.context=zo(t,s)),i.state=t.memoizedState,s=e.getDerivedStateFromProps,typeof s=="function"&&(qf(t,e,s,n),i.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(e=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),e!==i.state&&Ad.enqueueReplaceState(i,i.state,null),Hu(t,n,i,r),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308)}function Wo(t,e){try{var n="",r=e;do n+=eT(r),r=r.return;while(r);var i=n}catch(s){i=`
|
|
Error generating stack: `+s.message+`
|
|
`+s.stack}return{value:t,source:e,stack:i,digest:null}}function Vh(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function Hf(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var I1=typeof WeakMap=="function"?WeakMap:Map;function f_(t,e,n){n=Mr(-1,n),n.tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){Ju||(Ju=!0,np=r),Hf(t,e)},n}function p_(t,e,n){n=Mr(-1,n),n.tag=3;var r=t.type.getDerivedStateFromError;if(typeof r=="function"){var i=e.value;n.payload=function(){return r(i)},n.callback=function(){Hf(t,e)}}var s=t.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){Hf(t,e),typeof r!="function"&&(Ii===null?Ii=new Set([this]):Ii.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),n}function Ty(t,e,n){var r=t.pingCache;if(r===null){r=t.pingCache=new I1;var i=new Set;r.set(e,i)}else i=r.get(e),i===void 0&&(i=new Set,r.set(e,i));i.has(n)||(i.add(n),t=z1.bind(null,t,e,n),e.then(t,t))}function by(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function Sy(t,e,n,r,i){return t.mode&1?(t.flags|=65536,t.lanes=i,t):(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(e=Mr(-1,1),e.tag=2,Si(n,e,1))),n.lanes|=1),t)}var C1=Qr.ReactCurrentOwner,nn=!1;function Bt(t,e,n,r){e.child=t===null?$w(e,null,n,r):$o(e,t.child,n,r)}function Iy(t,e,n,r,i){n=n.render;var s=e.ref;return jo(e,i),r=cm(t,e,n,r,s,i),n=um(),t!==null&&!nn?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,qr(t,e,i)):(Fe&&n&&Jp(e),e.flags|=1,Bt(t,e,r,i),e.child)}function Cy(t,e,n,r,i){if(t===null){var s=n.type;return typeof s=="function"&&!_m(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=s,m_(t,e,s,r,i)):(t=xu(n.type,null,r,e,e.mode,i),t.ref=e.ref,t.return=e,e.child=t)}if(s=t.child,!(t.lanes&i)){var o=s.memoizedProps;if(n=n.compare,n=n!==null?n:Sl,n(o,r)&&t.ref===e.ref)return qr(t,e,i)}return e.flags|=1,t=Ai(s,r),t.ref=e.ref,t.return=e,e.child=t}function m_(t,e,n,r,i){if(t!==null){var s=t.memoizedProps;if(Sl(s,r)&&t.ref===e.ref)if(nn=!1,e.pendingProps=r=s,(t.lanes&i)!==0)t.flags&131072&&(nn=!0);else return e.lanes=t.lanes,qr(t,e,i)}return Kf(t,e,n,r,i)}function g_(t,e,n){var r=e.pendingProps,i=r.children,s=t!==null?t.memoizedState:null;if(r.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},Pe(Co,cn),cn|=n;else{if(!(n&1073741824))return t=s!==null?s.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,Pe(Co,cn),cn|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,Pe(Co,cn),cn|=r}else s!==null?(r=s.baseLanes|n,e.memoizedState=null):r=n,Pe(Co,cn),cn|=r;return Bt(t,e,i,n),e.child}function y_(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function Kf(t,e,n,r,i){var s=sn(n)?vs:Ft.current;return s=zo(e,s),jo(e,i),n=cm(t,e,n,r,s,i),r=um(),t!==null&&!nn?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,qr(t,e,i)):(Fe&&r&&Jp(e),e.flags|=1,Bt(t,e,n,i),e.child)}function Ay(t,e,n,r,i){if(sn(n)){var s=!0;zu(e)}else s=!1;if(jo(e,i),e.stateNode===null)vu(t,e),h_(e,n,r),Wf(e,n,r,i),r=!0;else if(t===null){var o=e.stateNode,l=e.memoizedProps;o.props=l;var u=o.context,h=n.contextType;typeof h=="object"&&h!==null?h=In(h):(h=sn(n)?vs:Ft.current,h=zo(e,h));var m=n.getDerivedStateFromProps,v=typeof m=="function"||typeof o.getSnapshotBeforeUpdate=="function";v||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==r||u!==h)&&ky(e,o,r,h),hi=!1;var g=e.memoizedState;o.state=g,Hu(e,r,o,i),u=e.memoizedState,l!==r||g!==u||rn.current||hi?(typeof m=="function"&&(qf(e,n,m,r),u=e.memoizedState),(l=hi||Ey(e,n,l,r,g,u,h))?(v||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=u),o.props=r,o.state=u,o.context=h,r=l):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{o=e.stateNode,Ww(t,e),l=e.memoizedProps,h=e.type===e.elementType?l:jn(e.type,l),o.props=h,v=e.pendingProps,g=o.context,u=n.contextType,typeof u=="object"&&u!==null?u=In(u):(u=sn(n)?vs:Ft.current,u=zo(e,u));var N=n.getDerivedStateFromProps;(m=typeof N=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==v||g!==u)&&ky(e,o,r,u),hi=!1,g=e.memoizedState,o.state=g,Hu(e,r,o,i);var j=e.memoizedState;l!==v||g!==j||rn.current||hi?(typeof N=="function"&&(qf(e,n,N,r),j=e.memoizedState),(h=hi||Ey(e,n,h,r,g,j,u)||!1)?(m||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,j,u),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,j,u)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===t.memoizedProps&&g===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===t.memoizedProps&&g===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=j),o.props=r,o.state=j,o.context=u,r=h):(typeof o.componentDidUpdate!="function"||l===t.memoizedProps&&g===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===t.memoizedProps&&g===t.memoizedState||(e.flags|=1024),r=!1)}return Gf(t,e,n,r,s,i)}function Gf(t,e,n,r,i,s){y_(t,e);var o=(e.flags&128)!==0;if(!r&&!o)return i&&py(e,n,!1),qr(t,e,s);r=e.stateNode,C1.current=e;var l=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,t!==null&&o?(e.child=$o(e,t.child,null,s),e.child=$o(e,null,l,s)):Bt(t,e,l,s),e.memoizedState=r.state,i&&py(e,n,!0),e.child}function v_(t){var e=t.stateNode;e.pendingContext?fy(t,e.pendingContext,e.pendingContext!==e.context):e.context&&fy(t,e.context,!1),sm(t,e.containerInfo)}function Ny(t,e,n,r,i){return Bo(),Zp(i),e.flags|=256,Bt(t,e,n,r),e.child}var Qf={dehydrated:null,treeContext:null,retryLane:0};function Yf(t){return{baseLanes:t,cachePool:null,transitions:null}}function w_(t,e,n){var r=e.pendingProps,i=ze.current,s=!1,o=(e.flags&128)!==0,l;if((l=o)||(l=t!==null&&t.memoizedState===null?!1:(i&2)!==0),l?(s=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(i|=1),Pe(ze,i&1),t===null)return Bf(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(o=r.children,t=r.fallback,s?(r=e.mode,s=e.child,o={mode:"hidden",children:o},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=Rd(o,r,0,null),t=gs(t,r,n,null),s.return=e,t.return=e,s.sibling=t,e.child=s,e.child.memoizedState=Yf(n),e.memoizedState=Qf,t):fm(e,o));if(i=t.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return A1(t,e,o,r,l,i,n);if(s){s=r.fallback,o=e.mode,i=t.child,l=i.sibling;var u={mode:"hidden",children:r.children};return!(o&1)&&e.child!==i?(r=e.child,r.childLanes=0,r.pendingProps=u,e.deletions=null):(r=Ai(i,u),r.subtreeFlags=i.subtreeFlags&14680064),l!==null?s=Ai(l,s):(s=gs(s,o,n,null),s.flags|=2),s.return=e,r.return=e,r.sibling=s,e.child=r,r=s,s=e.child,o=t.child.memoizedState,o=o===null?Yf(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=t.childLanes&~n,e.memoizedState=Qf,r}return s=t.child,t=s.sibling,r=Ai(s,{mode:"visible",children:r.children}),!(e.mode&1)&&(r.lanes=n),r.return=e,r.sibling=null,t!==null&&(n=e.deletions,n===null?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=r,e.memoizedState=null,r}function fm(t,e){return e=Rd({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function Yc(t,e,n,r){return r!==null&&Zp(r),$o(e,t.child,null,n),t=fm(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function A1(t,e,n,r,i,s,o){if(n)return e.flags&256?(e.flags&=-257,r=Vh(Error(W(422))),Yc(t,e,o,r)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(s=r.fallback,i=e.mode,r=Rd({mode:"visible",children:r.children},i,0,null),s=gs(s,i,o,null),s.flags|=2,r.return=e,s.return=e,r.sibling=s,e.child=r,e.mode&1&&$o(e,t.child,null,o),e.child.memoizedState=Yf(o),e.memoizedState=Qf,s);if(!(e.mode&1))return Yc(t,e,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var l=r.dgst;return r=l,s=Error(W(419)),r=Vh(s,r,void 0),Yc(t,e,o,r)}if(l=(o&t.childLanes)!==0,nn||l){if(r=gt,r!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,$r(t,i),Vn(r,t,i,-1))}return wm(),r=Vh(Error(W(421))),Yc(t,e,o,r)}return i.data==="$?"?(e.flags|=128,e.child=t.child,e=B1.bind(null,t),i._reactRetry=e,null):(t=s.treeContext,un=bi(i.nextSibling),hn=e,Fe=!0,Ln=null,t!==null&&(En[kn++]=Rr,En[kn++]=Dr,En[kn++]=ws,Rr=t.id,Dr=t.overflow,ws=e),e=fm(e,r.children),e.flags|=4096,e)}function Py(t,e,n){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),$f(t.return,e,n)}function Fh(t,e,n,r,i){var s=t.memoizedState;s===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function __(t,e,n){var r=e.pendingProps,i=r.revealOrder,s=r.tail;if(Bt(t,e,r.children,n),r=ze.current,r&2)r=r&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Py(t,n,e);else if(t.tag===19)Py(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}r&=1}if(Pe(ze,r),!(e.mode&1))e.memoizedState=null;else switch(i){case"forwards":for(n=e.child,i=null;n!==null;)t=n.alternate,t!==null&&Ku(t)===null&&(i=n),n=n.sibling;n=i,n===null?(i=e.child,e.child=null):(i=n.sibling,n.sibling=null),Fh(e,!1,i,n,s);break;case"backwards":for(n=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&Ku(t)===null){e.child=i;break}t=i.sibling,i.sibling=n,n=i,i=t}Fh(e,!0,n,null,s);break;case"together":Fh(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function vu(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function qr(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),xs|=e.lanes,!(n&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(W(153));if(e.child!==null){for(t=e.child,n=Ai(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=Ai(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function N1(t,e,n){switch(e.tag){case 3:v_(e),Bo();break;case 5:Hw(e);break;case 1:sn(e.type)&&zu(e);break;case 4:sm(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,i=e.memoizedProps.value;Pe(qu,r._currentValue),r._currentValue=i;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(Pe(ze,ze.current&1),e.flags|=128,null):n&e.child.childLanes?w_(t,e,n):(Pe(ze,ze.current&1),t=qr(t,e,n),t!==null?t.sibling:null);Pe(ze,ze.current&1);break;case 19:if(r=(n&e.childLanes)!==0,t.flags&128){if(r)return __(t,e,n);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Pe(ze,ze.current),r)break;return null;case 22:case 23:return e.lanes=0,g_(t,e,n)}return qr(t,e,n)}var x_,Jf,E_,k_;x_=function(t,e){for(var n=e.child;n!==null;){if(n.tag===5||n.tag===6)t.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Jf=function(){};E_=function(t,e,n,r){var i=t.memoizedProps;if(i!==r){t=e.stateNode,hs(sr.current);var s=null;switch(n){case"input":i=wf(t,i),r=wf(t,r),s=[];break;case"select":i=$e({},i,{value:void 0}),r=$e({},r,{value:void 0}),s=[];break;case"textarea":i=Ef(t,i),r=Ef(t,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(t.onclick=Fu)}Tf(n,r);var o;n=null;for(h in i)if(!r.hasOwnProperty(h)&&i.hasOwnProperty(h)&&i[h]!=null)if(h==="style"){var l=i[h];for(o in l)l.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else h!=="dangerouslySetInnerHTML"&&h!=="children"&&h!=="suppressContentEditableWarning"&&h!=="suppressHydrationWarning"&&h!=="autoFocus"&&(wl.hasOwnProperty(h)?s||(s=[]):(s=s||[]).push(h,null));for(h in r){var u=r[h];if(l=i!=null?i[h]:void 0,r.hasOwnProperty(h)&&u!==l&&(u!=null||l!=null))if(h==="style")if(l){for(o in l)!l.hasOwnProperty(o)||u&&u.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in u)u.hasOwnProperty(o)&&l[o]!==u[o]&&(n||(n={}),n[o]=u[o])}else n||(s||(s=[]),s.push(h,n)),n=u;else h==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,l=l?l.__html:void 0,u!=null&&l!==u&&(s=s||[]).push(h,u)):h==="children"?typeof u!="string"&&typeof u!="number"||(s=s||[]).push(h,""+u):h!=="suppressContentEditableWarning"&&h!=="suppressHydrationWarning"&&(wl.hasOwnProperty(h)?(u!=null&&h==="onScroll"&&Re("scroll",t),s||l===u||(s=[])):(s=s||[]).push(h,u))}n&&(s=s||[]).push("style",n);var h=s;(e.updateQueue=h)&&(e.flags|=4)}};k_=function(t,e,n,r){n!==r&&(e.flags|=4)};function Va(t,e){if(!Fe)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function Dt(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,r=0;if(e)for(var i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=t,i=i.sibling;else for(i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=r,t.childLanes=n,e}function P1(t,e,n){var r=e.pendingProps;switch(Xp(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Dt(e),null;case 1:return sn(e.type)&&Uu(),Dt(e),null;case 3:return r=e.stateNode,qo(),je(rn),je(Ft),am(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(Gc(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,Ln!==null&&(sp(Ln),Ln=null))),Jf(t,e),Dt(e),null;case 5:om(e);var i=hs(Pl.current);if(n=e.type,t!==null&&e.stateNode!=null)E_(t,e,n,r,i),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(W(166));return Dt(e),null}if(t=hs(sr.current),Gc(e)){r=e.stateNode,n=e.type;var s=e.memoizedProps;switch(r[nr]=e,r[Al]=s,t=(e.mode&1)!==0,n){case"dialog":Re("cancel",r),Re("close",r);break;case"iframe":case"object":case"embed":Re("load",r);break;case"video":case"audio":for(i=0;i<Xa.length;i++)Re(Xa[i],r);break;case"source":Re("error",r);break;case"img":case"image":case"link":Re("error",r),Re("load",r);break;case"details":Re("toggle",r);break;case"input":Ug(r,s),Re("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},Re("invalid",r);break;case"textarea":Bg(r,s),Re("invalid",r)}Tf(n,s),i=null;for(var o in s)if(s.hasOwnProperty(o)){var l=s[o];o==="children"?typeof l=="string"?r.textContent!==l&&(s.suppressHydrationWarning!==!0&&Kc(r.textContent,l,t),i=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(s.suppressHydrationWarning!==!0&&Kc(r.textContent,l,t),i=["children",""+l]):wl.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&Re("scroll",r)}switch(n){case"input":Fc(r),zg(r,s,!0);break;case"textarea":Fc(r),$g(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=Fu)}r=i,e.updateQueue=r,r!==null&&(e.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=J0(n)),t==="http://www.w3.org/1999/xhtml"?n==="script"?(t=o.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=o.createElement(n,{is:r.is}):(t=o.createElement(n),n==="select"&&(o=t,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):t=o.createElementNS(t,n),t[nr]=e,t[Al]=r,x_(t,e,!1,!1),e.stateNode=t;e:{switch(o=bf(n,r),n){case"dialog":Re("cancel",t),Re("close",t),i=r;break;case"iframe":case"object":case"embed":Re("load",t),i=r;break;case"video":case"audio":for(i=0;i<Xa.length;i++)Re(Xa[i],t);i=r;break;case"source":Re("error",t),i=r;break;case"img":case"image":case"link":Re("error",t),Re("load",t),i=r;break;case"details":Re("toggle",t),i=r;break;case"input":Ug(t,r),i=wf(t,r),Re("invalid",t);break;case"option":i=r;break;case"select":t._wrapperState={wasMultiple:!!r.multiple},i=$e({},r,{value:void 0}),Re("invalid",t);break;case"textarea":Bg(t,r),i=Ef(t,r),Re("invalid",t);break;default:i=r}Tf(n,i),l=i;for(s in l)if(l.hasOwnProperty(s)){var u=l[s];s==="style"?ew(t,u):s==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&X0(t,u)):s==="children"?typeof u=="string"?(n!=="textarea"||u!=="")&&_l(t,u):typeof u=="number"&&_l(t,""+u):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(wl.hasOwnProperty(s)?u!=null&&s==="onScroll"&&Re("scroll",t):u!=null&&Mp(t,s,u,o))}switch(n){case"input":Fc(t),zg(t,r,!1);break;case"textarea":Fc(t),$g(t);break;case"option":r.value!=null&&t.setAttribute("value",""+Ri(r.value));break;case"select":t.multiple=!!r.multiple,s=r.value,s!=null?No(t,!!r.multiple,s,!1):r.defaultValue!=null&&No(t,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(t.onclick=Fu)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return Dt(e),null;case 6:if(t&&e.stateNode!=null)k_(t,e,t.memoizedProps,r);else{if(typeof r!="string"&&e.stateNode===null)throw Error(W(166));if(n=hs(Pl.current),hs(sr.current),Gc(e)){if(r=e.stateNode,n=e.memoizedProps,r[nr]=e,(s=r.nodeValue!==n)&&(t=hn,t!==null))switch(t.tag){case 3:Kc(r.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&Kc(r.nodeValue,n,(t.mode&1)!==0)}s&&(e.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[nr]=e,e.stateNode=r}return Dt(e),null;case 13:if(je(ze),r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(Fe&&un!==null&&e.mode&1&&!(e.flags&128))zw(),Bo(),e.flags|=98560,s=!1;else if(s=Gc(e),r!==null&&r.dehydrated!==null){if(t===null){if(!s)throw Error(W(318));if(s=e.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(W(317));s[nr]=e}else Bo(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Dt(e),s=!1}else Ln!==null&&(sp(Ln),Ln=null),s=!0;if(!s)return e.flags&65536?e:null}return e.flags&128?(e.lanes=n,e):(r=r!==null,r!==(t!==null&&t.memoizedState!==null)&&r&&(e.child.flags|=8192,e.mode&1&&(t===null||ze.current&1?dt===0&&(dt=3):wm())),e.updateQueue!==null&&(e.flags|=4),Dt(e),null);case 4:return qo(),Jf(t,e),t===null&&Il(e.stateNode.containerInfo),Dt(e),null;case 10:return nm(e.type._context),Dt(e),null;case 17:return sn(e.type)&&Uu(),Dt(e),null;case 19:if(je(ze),s=e.memoizedState,s===null)return Dt(e),null;if(r=(e.flags&128)!==0,o=s.rendering,o===null)if(r)Va(s,!1);else{if(dt!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(o=Ku(t),o!==null){for(e.flags|=128,Va(s,!1),r=o.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),e.subtreeFlags=0,r=n,n=e.child;n!==null;)s=n,t=r,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=t,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,t=o.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),n=n.sibling;return Pe(ze,ze.current&1|2),e.child}t=t.sibling}s.tail!==null&&Je()>Ho&&(e.flags|=128,r=!0,Va(s,!1),e.lanes=4194304)}else{if(!r)if(t=Ku(o),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),Va(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Fe)return Dt(e),null}else 2*Je()-s.renderingStartTime>Ho&&n!==1073741824&&(e.flags|=128,r=!0,Va(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(n=s.last,n!==null?n.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Je(),e.sibling=null,n=ze.current,Pe(ze,r?n&1|2:n&1),e):(Dt(e),null);case 22:case 23:return vm(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?cn&1073741824&&(Dt(e),e.subtreeFlags&6&&(e.flags|=8192)):Dt(e),null;case 24:return null;case 25:return null}throw Error(W(156,e.tag))}function R1(t,e){switch(Xp(e),e.tag){case 1:return sn(e.type)&&Uu(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return qo(),je(rn),je(Ft),am(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return om(e),null;case 13:if(je(ze),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(W(340));Bo()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return je(ze),null;case 4:return qo(),null;case 10:return nm(e.type._context),null;case 22:case 23:return vm(),null;case 24:return null;default:return null}}var Jc=!1,Lt=!1,D1=typeof WeakSet=="function"?WeakSet:Set,ee=null;function Io(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ge(t,e,r)}else n.current=null}function Xf(t,e,n){try{n()}catch(r){Ge(t,e,r)}}var Ry=!1;function j1(t,e){if(Of=Lu,t=Cw(),Yp(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,l=-1,u=-1,h=0,m=0,v=t,g=null;t:for(;;){for(var N;v!==n||i!==0&&v.nodeType!==3||(l=o+i),v!==s||r!==0&&v.nodeType!==3||(u=o+r),v.nodeType===3&&(o+=v.nodeValue.length),(N=v.firstChild)!==null;)g=v,v=N;for(;;){if(v===t)break t;if(g===n&&++h===i&&(l=o),g===s&&++m===r&&(u=o),(N=v.nextSibling)!==null)break;v=g,g=v.parentNode}v=N}n=l===-1||u===-1?null:{start:l,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(Lf={focusedElem:t,selectionRange:n},Lu=!1,ee=e;ee!==null;)if(e=ee,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,ee=t;else for(;ee!==null;){e=ee;try{var j=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(j!==null){var L=j.memoizedProps,B=j.memoizedState,I=e.stateNode,k=I.getSnapshotBeforeUpdate(e.elementType===e.type?L:jn(e.type,L),B);I.__reactInternalSnapshotBeforeUpdate=k}break;case 3:var C=e.stateNode.containerInfo;C.nodeType===1?C.textContent="":C.nodeType===9&&C.documentElement&&C.removeChild(C.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(W(163))}}catch(V){Ge(e,e.return,V)}if(t=e.sibling,t!==null){t.return=e.return,ee=t;break}ee=e.return}return j=Ry,Ry=!1,j}function dl(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var s=i.destroy;i.destroy=void 0,s!==void 0&&Xf(e,n,s)}i=i.next}while(i!==r)}}function Nd(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function Zf(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function T_(t){var e=t.alternate;e!==null&&(t.alternate=null,T_(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[nr],delete e[Al],delete e[Ff],delete e[g1],delete e[y1])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function b_(t){return t.tag===5||t.tag===3||t.tag===4}function Dy(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||b_(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function ep(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=Fu));else if(r!==4&&(t=t.child,t!==null))for(ep(t,e,n),t=t.sibling;t!==null;)ep(t,e,n),t=t.sibling}function tp(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(tp(t,e,n),t=t.sibling;t!==null;)tp(t,e,n),t=t.sibling}var Et=null,On=!1;function ci(t,e,n){for(n=n.child;n!==null;)S_(t,e,n),n=n.sibling}function S_(t,e,n){if(ir&&typeof ir.onCommitFiberUnmount=="function")try{ir.onCommitFiberUnmount(Ed,n)}catch{}switch(n.tag){case 5:Lt||Io(n,e);case 6:var r=Et,i=On;Et=null,ci(t,e,n),Et=r,On=i,Et!==null&&(On?(t=Et,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Et.removeChild(n.stateNode));break;case 18:Et!==null&&(On?(t=Et,n=n.stateNode,t.nodeType===8?Rh(t.parentNode,n):t.nodeType===1&&Rh(t,n),Tl(t)):Rh(Et,n.stateNode));break;case 4:r=Et,i=On,Et=n.stateNode.containerInfo,On=!0,ci(t,e,n),Et=r,On=i;break;case 0:case 11:case 14:case 15:if(!Lt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&Xf(n,e,o),i=i.next}while(i!==r)}ci(t,e,n);break;case 1:if(!Lt&&(Io(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Ge(n,e,l)}ci(t,e,n);break;case 21:ci(t,e,n);break;case 22:n.mode&1?(Lt=(r=Lt)||n.memoizedState!==null,ci(t,e,n),Lt=r):ci(t,e,n);break;default:ci(t,e,n)}}function jy(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new D1),e.forEach(function(r){var i=$1.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Dn(t,e){var n=e.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var s=t,o=e,l=o;e:for(;l!==null;){switch(l.tag){case 5:Et=l.stateNode,On=!1;break e;case 3:Et=l.stateNode.containerInfo,On=!0;break e;case 4:Et=l.stateNode.containerInfo,On=!0;break e}l=l.return}if(Et===null)throw Error(W(160));S_(s,o,i),Et=null,On=!1;var u=i.alternate;u!==null&&(u.return=null),i.return=null}catch(h){Ge(i,e,h)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)I_(e,t),e=e.sibling}function I_(t,e){var n=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Dn(e,t),Jn(t),r&4){try{dl(3,t,t.return),Nd(3,t)}catch(L){Ge(t,t.return,L)}try{dl(5,t,t.return)}catch(L){Ge(t,t.return,L)}}break;case 1:Dn(e,t),Jn(t),r&512&&n!==null&&Io(n,n.return);break;case 5:if(Dn(e,t),Jn(t),r&512&&n!==null&&Io(n,n.return),t.flags&32){var i=t.stateNode;try{_l(i,"")}catch(L){Ge(t,t.return,L)}}if(r&4&&(i=t.stateNode,i!=null)){var s=t.memoizedProps,o=n!==null?n.memoizedProps:s,l=t.type,u=t.updateQueue;if(t.updateQueue=null,u!==null)try{l==="input"&&s.type==="radio"&&s.name!=null&&Q0(i,s),bf(l,o);var h=bf(l,s);for(o=0;o<u.length;o+=2){var m=u[o],v=u[o+1];m==="style"?ew(i,v):m==="dangerouslySetInnerHTML"?X0(i,v):m==="children"?_l(i,v):Mp(i,m,v,h)}switch(l){case"input":_f(i,s);break;case"textarea":Y0(i,s);break;case"select":var g=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var N=s.value;N!=null?No(i,!!s.multiple,N,!1):g!==!!s.multiple&&(s.defaultValue!=null?No(i,!!s.multiple,s.defaultValue,!0):No(i,!!s.multiple,s.multiple?[]:"",!1))}i[Al]=s}catch(L){Ge(t,t.return,L)}}break;case 6:if(Dn(e,t),Jn(t),r&4){if(t.stateNode===null)throw Error(W(162));i=t.stateNode,s=t.memoizedProps;try{i.nodeValue=s}catch(L){Ge(t,t.return,L)}}break;case 3:if(Dn(e,t),Jn(t),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Tl(e.containerInfo)}catch(L){Ge(t,t.return,L)}break;case 4:Dn(e,t),Jn(t);break;case 13:Dn(e,t),Jn(t),i=t.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(gm=Je())),r&4&&jy(t);break;case 22:if(m=n!==null&&n.memoizedState!==null,t.mode&1?(Lt=(h=Lt)||m,Dn(e,t),Lt=h):Dn(e,t),Jn(t),r&8192){if(h=t.memoizedState!==null,(t.stateNode.isHidden=h)&&!m&&t.mode&1)for(ee=t,m=t.child;m!==null;){for(v=ee=m;ee!==null;){switch(g=ee,N=g.child,g.tag){case 0:case 11:case 14:case 15:dl(4,g,g.return);break;case 1:Io(g,g.return);var j=g.stateNode;if(typeof j.componentWillUnmount=="function"){r=g,n=g.return;try{e=r,j.props=e.memoizedProps,j.state=e.memoizedState,j.componentWillUnmount()}catch(L){Ge(r,n,L)}}break;case 5:Io(g,g.return);break;case 22:if(g.memoizedState!==null){Ly(v);continue}}N!==null?(N.return=g,ee=N):Ly(v)}m=m.sibling}e:for(m=null,v=t;;){if(v.tag===5){if(m===null){m=v;try{i=v.stateNode,h?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(l=v.stateNode,u=v.memoizedProps.style,o=u!=null&&u.hasOwnProperty("display")?u.display:null,l.style.display=Z0("display",o))}catch(L){Ge(t,t.return,L)}}}else if(v.tag===6){if(m===null)try{v.stateNode.nodeValue=h?"":v.memoizedProps}catch(L){Ge(t,t.return,L)}}else if((v.tag!==22&&v.tag!==23||v.memoizedState===null||v===t)&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===t)break e;for(;v.sibling===null;){if(v.return===null||v.return===t)break e;m===v&&(m=null),v=v.return}m===v&&(m=null),v.sibling.return=v.return,v=v.sibling}}break;case 19:Dn(e,t),Jn(t),r&4&&jy(t);break;case 21:break;default:Dn(e,t),Jn(t)}}function Jn(t){var e=t.flags;if(e&2){try{e:{for(var n=t.return;n!==null;){if(b_(n)){var r=n;break e}n=n.return}throw Error(W(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(_l(i,""),r.flags&=-33);var s=Dy(t);tp(t,s,i);break;case 3:case 4:var o=r.stateNode.containerInfo,l=Dy(t);ep(t,l,o);break;default:throw Error(W(161))}}catch(u){Ge(t,t.return,u)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function O1(t,e,n){ee=t,C_(t)}function C_(t,e,n){for(var r=(t.mode&1)!==0;ee!==null;){var i=ee,s=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||Jc;if(!o){var l=i.alternate,u=l!==null&&l.memoizedState!==null||Lt;l=Jc;var h=Lt;if(Jc=o,(Lt=u)&&!h)for(ee=i;ee!==null;)o=ee,u=o.child,o.tag===22&&o.memoizedState!==null?My(i):u!==null?(u.return=o,ee=u):My(i);for(;s!==null;)ee=s,C_(s),s=s.sibling;ee=i,Jc=l,Lt=h}Oy(t)}else i.subtreeFlags&8772&&s!==null?(s.return=i,ee=s):Oy(t)}}function Oy(t){for(;ee!==null;){var e=ee;if(e.flags&8772){var n=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:Lt||Nd(5,e);break;case 1:var r=e.stateNode;if(e.flags&4&&!Lt)if(n===null)r.componentDidMount();else{var i=e.elementType===e.type?n.memoizedProps:jn(e.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=e.updateQueue;s!==null&&wy(e,s,r);break;case 3:var o=e.updateQueue;if(o!==null){if(n=null,e.child!==null)switch(e.child.tag){case 5:n=e.child.stateNode;break;case 1:n=e.child.stateNode}wy(e,o,n)}break;case 5:var l=e.stateNode;if(n===null&&e.flags&4){n=l;var u=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&n.focus();break;case"img":u.src&&(n.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var h=e.alternate;if(h!==null){var m=h.memoizedState;if(m!==null){var v=m.dehydrated;v!==null&&Tl(v)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(W(163))}Lt||e.flags&512&&Zf(e)}catch(g){Ge(e,e.return,g)}}if(e===t){ee=null;break}if(n=e.sibling,n!==null){n.return=e.return,ee=n;break}ee=e.return}}function Ly(t){for(;ee!==null;){var e=ee;if(e===t){ee=null;break}var n=e.sibling;if(n!==null){n.return=e.return,ee=n;break}ee=e.return}}function My(t){for(;ee!==null;){var e=ee;try{switch(e.tag){case 0:case 11:case 15:var n=e.return;try{Nd(4,e)}catch(u){Ge(e,n,u)}break;case 1:var r=e.stateNode;if(typeof r.componentDidMount=="function"){var i=e.return;try{r.componentDidMount()}catch(u){Ge(e,i,u)}}var s=e.return;try{Zf(e)}catch(u){Ge(e,s,u)}break;case 5:var o=e.return;try{Zf(e)}catch(u){Ge(e,o,u)}}}catch(u){Ge(e,e.return,u)}if(e===t){ee=null;break}var l=e.sibling;if(l!==null){l.return=e.return,ee=l;break}ee=e.return}}var L1=Math.ceil,Yu=Qr.ReactCurrentDispatcher,pm=Qr.ReactCurrentOwner,bn=Qr.ReactCurrentBatchConfig,we=0,gt=null,it=null,bt=0,cn=0,Co=Vi(0),dt=0,Ol=null,xs=0,Pd=0,mm=0,hl=null,en=null,gm=0,Ho=1/0,Ar=null,Ju=!1,np=null,Ii=null,Xc=!1,_i=null,Xu=0,fl=0,rp=null,wu=-1,_u=0;function $t(){return we&6?Je():wu!==-1?wu:wu=Je()}function Ci(t){return t.mode&1?we&2&&bt!==0?bt&-bt:w1.transition!==null?(_u===0&&(_u=hw()),_u):(t=be,t!==0||(t=window.event,t=t===void 0?16:ww(t.type)),t):1}function Vn(t,e,n,r){if(50<fl)throw fl=0,rp=null,Error(W(185));Gl(t,n,r),(!(we&2)||t!==gt)&&(t===gt&&(!(we&2)&&(Pd|=n),dt===4&&pi(t,bt)),on(t,r),n===1&&we===0&&!(e.mode&1)&&(Ho=Je()+500,Id&&Fi()))}function on(t,e){var n=t.callbackNode;wT(t,e);var r=Ou(t,t===gt?bt:0);if(r===0)n!==null&&Hg(n),t.callbackNode=null,t.callbackPriority=0;else if(e=r&-r,t.callbackPriority!==e){if(n!=null&&Hg(n),e===1)t.tag===0?v1(Vy.bind(null,t)):Vw(Vy.bind(null,t)),p1(function(){!(we&6)&&Fi()}),n=null;else{switch(fw(r)){case 1:n=Bp;break;case 4:n=uw;break;case 16:n=ju;break;case 536870912:n=dw;break;default:n=ju}n=L_(n,A_.bind(null,t))}t.callbackPriority=e,t.callbackNode=n}}function A_(t,e){if(wu=-1,_u=0,we&6)throw Error(W(327));var n=t.callbackNode;if(Oo()&&t.callbackNode!==n)return null;var r=Ou(t,t===gt?bt:0);if(r===0)return null;if(r&30||r&t.expiredLanes||e)e=Zu(t,r);else{e=r;var i=we;we|=2;var s=P_();(gt!==t||bt!==e)&&(Ar=null,Ho=Je()+500,ms(t,e));do try{F1();break}catch(l){N_(t,l)}while(!0);tm(),Yu.current=s,we=i,it!==null?e=0:(gt=null,bt=0,e=dt)}if(e!==0){if(e===2&&(i=Nf(t),i!==0&&(r=i,e=ip(t,i))),e===1)throw n=Ol,ms(t,0),pi(t,r),on(t,Je()),n;if(e===6)pi(t,r);else{if(i=t.current.alternate,!(r&30)&&!M1(i)&&(e=Zu(t,r),e===2&&(s=Nf(t),s!==0&&(r=s,e=ip(t,s))),e===1))throw n=Ol,ms(t,0),pi(t,r),on(t,Je()),n;switch(t.finishedWork=i,t.finishedLanes=r,e){case 0:case 1:throw Error(W(345));case 2:ls(t,en,Ar);break;case 3:if(pi(t,r),(r&130023424)===r&&(e=gm+500-Je(),10<e)){if(Ou(t,0)!==0)break;if(i=t.suspendedLanes,(i&r)!==r){$t(),t.pingedLanes|=t.suspendedLanes&i;break}t.timeoutHandle=Vf(ls.bind(null,t,en,Ar),e);break}ls(t,en,Ar);break;case 4:if(pi(t,r),(r&4194240)===r)break;for(e=t.eventTimes,i=-1;0<r;){var o=31-Mn(r);s=1<<o,o=e[o],o>i&&(i=o),r&=~s}if(r=i,r=Je()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*L1(r/1960))-r,10<r){t.timeoutHandle=Vf(ls.bind(null,t,en,Ar),r);break}ls(t,en,Ar);break;case 5:ls(t,en,Ar);break;default:throw Error(W(329))}}}return on(t,Je()),t.callbackNode===n?A_.bind(null,t):null}function ip(t,e){var n=hl;return t.current.memoizedState.isDehydrated&&(ms(t,e).flags|=256),t=Zu(t,e),t!==2&&(e=en,en=n,e!==null&&sp(e)),t}function sp(t){en===null?en=t:en.push.apply(en,t)}function M1(t){for(var e=t;;){if(e.flags&16384){var n=e.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],s=i.getSnapshot;i=i.value;try{if(!Fn(s(),i))return!1}catch{return!1}}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function pi(t,e){for(e&=~mm,e&=~Pd,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-Mn(e),r=1<<n;t[n]=-1,e&=~r}}function Vy(t){if(we&6)throw Error(W(327));Oo();var e=Ou(t,0);if(!(e&1))return on(t,Je()),null;var n=Zu(t,e);if(t.tag!==0&&n===2){var r=Nf(t);r!==0&&(e=r,n=ip(t,r))}if(n===1)throw n=Ol,ms(t,0),pi(t,e),on(t,Je()),n;if(n===6)throw Error(W(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,ls(t,en,Ar),on(t,Je()),null}function ym(t,e){var n=we;we|=1;try{return t(e)}finally{we=n,we===0&&(Ho=Je()+500,Id&&Fi())}}function Es(t){_i!==null&&_i.tag===0&&!(we&6)&&Oo();var e=we;we|=1;var n=bn.transition,r=be;try{if(bn.transition=null,be=1,t)return t()}finally{be=r,bn.transition=n,we=e,!(we&6)&&Fi()}}function vm(){cn=Co.current,je(Co)}function ms(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==-1&&(t.timeoutHandle=-1,f1(n)),it!==null)for(n=it.return;n!==null;){var r=n;switch(Xp(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Uu();break;case 3:qo(),je(rn),je(Ft),am();break;case 5:om(r);break;case 4:qo();break;case 13:je(ze);break;case 19:je(ze);break;case 10:nm(r.type._context);break;case 22:case 23:vm()}n=n.return}if(gt=t,it=t=Ai(t.current,null),bt=cn=e,dt=0,Ol=null,mm=Pd=xs=0,en=hl=null,ds!==null){for(e=0;e<ds.length;e++)if(n=ds[e],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,s=n.pending;if(s!==null){var o=s.next;s.next=i,r.next=o}n.pending=r}ds=null}return t}function N_(t,e){do{var n=it;try{if(tm(),gu.current=Qu,Gu){for(var r=Be.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Gu=!1}if(_s=0,mt=ut=Be=null,ul=!1,Rl=0,pm.current=null,n===null||n.return===null){dt=1,Ol=e,it=null;break}e:{var s=t,o=n.return,l=n,u=e;if(e=bt,l.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var h=u,m=l,v=m.tag;if(!(m.mode&1)&&(v===0||v===11||v===15)){var g=m.alternate;g?(m.updateQueue=g.updateQueue,m.memoizedState=g.memoizedState,m.lanes=g.lanes):(m.updateQueue=null,m.memoizedState=null)}var N=by(o);if(N!==null){N.flags&=-257,Sy(N,o,l,s,e),N.mode&1&&Ty(s,h,e),e=N,u=h;var j=e.updateQueue;if(j===null){var L=new Set;L.add(u),e.updateQueue=L}else j.add(u);break e}else{if(!(e&1)){Ty(s,h,e),wm();break e}u=Error(W(426))}}else if(Fe&&l.mode&1){var B=by(o);if(B!==null){!(B.flags&65536)&&(B.flags|=256),Sy(B,o,l,s,e),Zp(Wo(u,l));break e}}s=u=Wo(u,l),dt!==4&&(dt=2),hl===null?hl=[s]:hl.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,e&=-e,s.lanes|=e;var I=f_(s,u,e);vy(s,I);break e;case 1:l=u;var k=s.type,C=s.stateNode;if(!(s.flags&128)&&(typeof k.getDerivedStateFromError=="function"||C!==null&&typeof C.componentDidCatch=="function"&&(Ii===null||!Ii.has(C)))){s.flags|=65536,e&=-e,s.lanes|=e;var V=p_(s,l,e);vy(s,V);break e}}s=s.return}while(s!==null)}D_(n)}catch(G){e=G,it===n&&n!==null&&(it=n=n.return);continue}break}while(!0)}function P_(){var t=Yu.current;return Yu.current=Qu,t===null?Qu:t}function wm(){(dt===0||dt===3||dt===2)&&(dt=4),gt===null||!(xs&268435455)&&!(Pd&268435455)||pi(gt,bt)}function Zu(t,e){var n=we;we|=2;var r=P_();(gt!==t||bt!==e)&&(Ar=null,ms(t,e));do try{V1();break}catch(i){N_(t,i)}while(!0);if(tm(),we=n,Yu.current=r,it!==null)throw Error(W(261));return gt=null,bt=0,dt}function V1(){for(;it!==null;)R_(it)}function F1(){for(;it!==null&&!uT();)R_(it)}function R_(t){var e=O_(t.alternate,t,cn);t.memoizedProps=t.pendingProps,e===null?D_(t):it=e,pm.current=null}function D_(t){var e=t;do{var n=e.alternate;if(t=e.return,e.flags&32768){if(n=R1(n,e),n!==null){n.flags&=32767,it=n;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{dt=6,it=null;return}}else if(n=P1(n,e,cn),n!==null){it=n;return}if(e=e.sibling,e!==null){it=e;return}it=e=t}while(e!==null);dt===0&&(dt=5)}function ls(t,e,n){var r=be,i=bn.transition;try{bn.transition=null,be=1,U1(t,e,n,r)}finally{bn.transition=i,be=r}return null}function U1(t,e,n,r){do Oo();while(_i!==null);if(we&6)throw Error(W(327));n=t.finishedWork;var i=t.finishedLanes;if(n===null)return null;if(t.finishedWork=null,t.finishedLanes=0,n===t.current)throw Error(W(177));t.callbackNode=null,t.callbackPriority=0;var s=n.lanes|n.childLanes;if(_T(t,s),t===gt&&(it=gt=null,bt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Xc||(Xc=!0,L_(ju,function(){return Oo(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=bn.transition,bn.transition=null;var o=be;be=1;var l=we;we|=4,pm.current=null,j1(t,n),I_(n,t),o1(Lf),Lu=!!Of,Lf=Of=null,t.current=n,O1(n),dT(),we=l,be=o,bn.transition=s}else t.current=n;if(Xc&&(Xc=!1,_i=t,Xu=i),s=t.pendingLanes,s===0&&(Ii=null),pT(n.stateNode),on(t,Je()),e!==null)for(r=t.onRecoverableError,n=0;n<e.length;n++)i=e[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(Ju)throw Ju=!1,t=np,np=null,t;return Xu&1&&t.tag!==0&&Oo(),s=t.pendingLanes,s&1?t===rp?fl++:(fl=0,rp=t):fl=0,Fi(),null}function Oo(){if(_i!==null){var t=fw(Xu),e=bn.transition,n=be;try{if(bn.transition=null,be=16>t?16:t,_i===null)var r=!1;else{if(t=_i,_i=null,Xu=0,we&6)throw Error(W(331));var i=we;for(we|=4,ee=t.current;ee!==null;){var s=ee,o=s.child;if(ee.flags&16){var l=s.deletions;if(l!==null){for(var u=0;u<l.length;u++){var h=l[u];for(ee=h;ee!==null;){var m=ee;switch(m.tag){case 0:case 11:case 15:dl(8,m,s)}var v=m.child;if(v!==null)v.return=m,ee=v;else for(;ee!==null;){m=ee;var g=m.sibling,N=m.return;if(T_(m),m===h){ee=null;break}if(g!==null){g.return=N,ee=g;break}ee=N}}}var j=s.alternate;if(j!==null){var L=j.child;if(L!==null){j.child=null;do{var B=L.sibling;L.sibling=null,L=B}while(L!==null)}}ee=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,ee=o;else e:for(;ee!==null;){if(s=ee,s.flags&2048)switch(s.tag){case 0:case 11:case 15:dl(9,s,s.return)}var I=s.sibling;if(I!==null){I.return=s.return,ee=I;break e}ee=s.return}}var k=t.current;for(ee=k;ee!==null;){o=ee;var C=o.child;if(o.subtreeFlags&2064&&C!==null)C.return=o,ee=C;else e:for(o=k;ee!==null;){if(l=ee,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Nd(9,l)}}catch(G){Ge(l,l.return,G)}if(l===o){ee=null;break e}var V=l.sibling;if(V!==null){V.return=l.return,ee=V;break e}ee=l.return}}if(we=i,Fi(),ir&&typeof ir.onPostCommitFiberRoot=="function")try{ir.onPostCommitFiberRoot(Ed,t)}catch{}r=!0}return r}finally{be=n,bn.transition=e}}return!1}function Fy(t,e,n){e=Wo(n,e),e=f_(t,e,1),t=Si(t,e,1),e=$t(),t!==null&&(Gl(t,1,e),on(t,e))}function Ge(t,e,n){if(t.tag===3)Fy(t,t,n);else for(;e!==null;){if(e.tag===3){Fy(e,t,n);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ii===null||!Ii.has(r))){t=Wo(n,t),t=p_(e,t,1),e=Si(e,t,1),t=$t(),e!==null&&(Gl(e,1,t),on(e,t));break}}e=e.return}}function z1(t,e,n){var r=t.pingCache;r!==null&&r.delete(e),e=$t(),t.pingedLanes|=t.suspendedLanes&n,gt===t&&(bt&n)===n&&(dt===4||dt===3&&(bt&130023424)===bt&&500>Je()-gm?ms(t,0):mm|=n),on(t,e)}function j_(t,e){e===0&&(t.mode&1?(e=Bc,Bc<<=1,!(Bc&130023424)&&(Bc=4194304)):e=1);var n=$t();t=$r(t,e),t!==null&&(Gl(t,e,n),on(t,n))}function B1(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),j_(t,n)}function $1(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(W(314))}r!==null&&r.delete(e),j_(t,n)}var O_;O_=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||rn.current)nn=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return nn=!1,N1(t,e,n);nn=!!(t.flags&131072)}else nn=!1,Fe&&e.flags&1048576&&Fw(e,$u,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;vu(t,e),t=e.pendingProps;var i=zo(e,Ft.current);jo(e,n),i=cm(null,e,r,t,i,n);var s=um();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,sn(r)?(s=!0,zu(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,im(e),i.updater=Ad,e.stateNode=i,i._reactInternals=e,Wf(e,r,t,n),e=Gf(null,e,r,!0,s,n)):(e.tag=0,Fe&&s&&Jp(e),Bt(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(vu(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=W1(r),t=jn(r,t),i){case 0:e=Kf(null,e,r,t,n);break e;case 1:e=Ay(null,e,r,t,n);break e;case 11:e=Iy(null,e,r,t,n);break e;case 14:e=Cy(null,e,r,jn(r.type,t),n);break e}throw Error(W(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:jn(r,i),Kf(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:jn(r,i),Ay(t,e,r,i,n);case 3:e:{if(v_(e),t===null)throw Error(W(387));r=e.pendingProps,s=e.memoizedState,i=s.element,Ww(t,e),Hu(e,r,null,n);var o=e.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=Wo(Error(W(423)),e),e=Ny(t,e,r,n,i);break e}else if(r!==i){i=Wo(Error(W(424)),e),e=Ny(t,e,r,n,i);break e}else for(un=bi(e.stateNode.containerInfo.firstChild),hn=e,Fe=!0,Ln=null,n=$w(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Bo(),r===i){e=qr(t,e,n);break e}Bt(t,e,r,n)}e=e.child}return e;case 5:return Hw(e),t===null&&Bf(e),r=e.type,i=e.pendingProps,s=t!==null?t.memoizedProps:null,o=i.children,Mf(r,i)?o=null:s!==null&&Mf(r,s)&&(e.flags|=32),y_(t,e),Bt(t,e,o,n),e.child;case 6:return t===null&&Bf(e),null;case 13:return w_(t,e,n);case 4:return sm(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=$o(e,null,r,n):Bt(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:jn(r,i),Iy(t,e,r,i,n);case 7:return Bt(t,e,e.pendingProps,n),e.child;case 8:return Bt(t,e,e.pendingProps.children,n),e.child;case 12:return Bt(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value,Pe(qu,r._currentValue),r._currentValue=o,s!==null)if(Fn(s.value,o)){if(s.children===i.children&&!rn.current){e=qr(t,e,n);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var l=s.dependencies;if(l!==null){o=s.child;for(var u=l.firstContext;u!==null;){if(u.context===r){if(s.tag===1){u=Mr(-1,n&-n),u.tag=2;var h=s.updateQueue;if(h!==null){h=h.shared;var m=h.pending;m===null?u.next=u:(u.next=m.next,m.next=u),h.pending=u}}s.lanes|=n,u=s.alternate,u!==null&&(u.lanes|=n),$f(s.return,n,e),l.lanes|=n;break}u=u.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(W(341));o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),$f(o,n,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Bt(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,jo(e,n),i=In(i),r=r(i),e.flags|=1,Bt(t,e,r,n),e.child;case 14:return r=e.type,i=jn(r,e.pendingProps),i=jn(r.type,i),Cy(t,e,r,i,n);case 15:return m_(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:jn(r,i),vu(t,e),e.tag=1,sn(r)?(t=!0,zu(e)):t=!1,jo(e,n),h_(e,r,i),Wf(e,r,i,n),Gf(null,e,r,!0,t,n);case 19:return __(t,e,n);case 22:return g_(t,e,n)}throw Error(W(156,e.tag))};function L_(t,e){return cw(t,e)}function q1(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Tn(t,e,n,r){return new q1(t,e,n,r)}function _m(t){return t=t.prototype,!(!t||!t.isReactComponent)}function W1(t){if(typeof t=="function")return _m(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Fp)return 11;if(t===Up)return 14}return 2}function Ai(t,e){var n=t.alternate;return n===null?(n=Tn(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function xu(t,e,n,r,i,s){var o=2;if(r=t,typeof t=="function")_m(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case vo:return gs(n.children,i,s,e);case Vp:o=8,i|=8;break;case mf:return t=Tn(12,n,e,i|2),t.elementType=mf,t.lanes=s,t;case gf:return t=Tn(13,n,e,i),t.elementType=gf,t.lanes=s,t;case yf:return t=Tn(19,n,e,i),t.elementType=yf,t.lanes=s,t;case H0:return Rd(n,i,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case q0:o=10;break e;case W0:o=9;break e;case Fp:o=11;break e;case Up:o=14;break e;case di:o=16,r=null;break e}throw Error(W(130,t==null?t:typeof t,""))}return e=Tn(o,n,e,i),e.elementType=t,e.type=r,e.lanes=s,e}function gs(t,e,n,r){return t=Tn(7,t,r,e),t.lanes=n,t}function Rd(t,e,n,r){return t=Tn(22,t,r,e),t.elementType=H0,t.lanes=n,t.stateNode={isHidden:!1},t}function Uh(t,e,n){return t=Tn(6,t,null,e),t.lanes=n,t}function zh(t,e,n){return e=Tn(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function H1(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=xh(0),this.expirationTimes=xh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xh(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function xm(t,e,n,r,i,s,o,l,u){return t=new H1(t,e,n,l,u),e===1?(e=1,s===!0&&(e|=8)):e=0,s=Tn(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},im(s),t}function K1(t,e,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:yo,key:r==null?null:""+r,children:t,containerInfo:e,implementation:n}}function M_(t){if(!t)return Di;t=t._reactInternals;e:{if(Ps(t)!==t||t.tag!==1)throw Error(W(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(sn(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(W(171))}if(t.tag===1){var n=t.type;if(sn(n))return Mw(t,n,e)}return e}function V_(t,e,n,r,i,s,o,l,u){return t=xm(n,r,!0,t,i,s,o,l,u),t.context=M_(null),n=t.current,r=$t(),i=Ci(n),s=Mr(r,i),s.callback=e??null,Si(n,s,i),t.current.lanes=i,Gl(t,i,r),on(t,r),t}function Dd(t,e,n,r){var i=e.current,s=$t(),o=Ci(i);return n=M_(n),e.context===null?e.context=n:e.pendingContext=n,e=Mr(s,o),e.payload={element:t},r=r===void 0?null:r,r!==null&&(e.callback=r),t=Si(i,e,o),t!==null&&(Vn(t,i,o,s),mu(t,i,o)),o}function ed(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function Uy(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function Em(t,e){Uy(t,e),(t=t.alternate)&&Uy(t,e)}function G1(){return null}var F_=typeof reportError=="function"?reportError:function(t){console.error(t)};function km(t){this._internalRoot=t}jd.prototype.render=km.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(W(409));Dd(t,e,null,null)};jd.prototype.unmount=km.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;Es(function(){Dd(null,t,null,null)}),e[Br]=null}};function jd(t){this._internalRoot=t}jd.prototype.unstable_scheduleHydration=function(t){if(t){var e=gw();t={blockedOn:null,target:t,priority:e};for(var n=0;n<fi.length&&e!==0&&e<fi[n].priority;n++);fi.splice(n,0,t),n===0&&vw(t)}};function Tm(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Od(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function zy(){}function Q1(t,e,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var h=ed(o);s.call(h)}}var o=V_(e,r,t,0,null,!1,!1,"",zy);return t._reactRootContainer=o,t[Br]=o.current,Il(t.nodeType===8?t.parentNode:t),Es(),o}for(;i=t.lastChild;)t.removeChild(i);if(typeof r=="function"){var l=r;r=function(){var h=ed(u);l.call(h)}}var u=xm(t,0,!1,null,null,!1,!1,"",zy);return t._reactRootContainer=u,t[Br]=u.current,Il(t.nodeType===8?t.parentNode:t),Es(function(){Dd(e,u,n,r)}),u}function Ld(t,e,n,r,i){var s=n._reactRootContainer;if(s){var o=s;if(typeof i=="function"){var l=i;i=function(){var u=ed(o);l.call(u)}}Dd(e,o,t,i)}else o=Q1(n,e,t,i,r);return ed(o)}pw=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var n=Ja(e.pendingLanes);n!==0&&($p(e,n|1),on(e,Je()),!(we&6)&&(Ho=Je()+500,Fi()))}break;case 13:Es(function(){var r=$r(t,1);if(r!==null){var i=$t();Vn(r,t,1,i)}}),Em(t,1)}};qp=function(t){if(t.tag===13){var e=$r(t,134217728);if(e!==null){var n=$t();Vn(e,t,134217728,n)}Em(t,134217728)}};mw=function(t){if(t.tag===13){var e=Ci(t),n=$r(t,e);if(n!==null){var r=$t();Vn(n,t,e,r)}Em(t,e)}};gw=function(){return be};yw=function(t,e){var n=be;try{return be=t,e()}finally{be=n}};If=function(t,e,n){switch(e){case"input":if(_f(t,n),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<n.length;e++){var r=n[e];if(r!==t&&r.form===t.form){var i=Sd(r);if(!i)throw Error(W(90));G0(r),_f(r,i)}}}break;case"textarea":Y0(t,n);break;case"select":e=n.value,e!=null&&No(t,!!n.multiple,e,!1)}};rw=ym;iw=Es;var Y1={usingClientEntryPoint:!1,Events:[Yl,Eo,Sd,tw,nw,ym]},Fa={findFiberByHostInstance:us,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},J1={bundleType:Fa.bundleType,version:Fa.version,rendererPackageName:Fa.rendererPackageName,rendererConfig:Fa.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Qr.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=aw(t),t===null?null:t.stateNode},findFiberByHostInstance:Fa.findFiberByHostInstance||G1,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Zc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Zc.isDisabled&&Zc.supportsFiber)try{Ed=Zc.inject(J1),ir=Zc}catch{}}pn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Y1;pn.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Tm(e))throw Error(W(200));return K1(t,e,null,n)};pn.createRoot=function(t,e){if(!Tm(t))throw Error(W(299));var n=!1,r="",i=F_;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onRecoverableError!==void 0&&(i=e.onRecoverableError)),e=xm(t,1,!1,null,null,n,!1,r,i),t[Br]=e.current,Il(t.nodeType===8?t.parentNode:t),new km(e)};pn.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(W(188)):(t=Object.keys(t).join(","),Error(W(268,t)));return t=aw(e),t=t===null?null:t.stateNode,t};pn.flushSync=function(t){return Es(t)};pn.hydrate=function(t,e,n){if(!Od(e))throw Error(W(200));return Ld(null,t,e,!0,n)};pn.hydrateRoot=function(t,e,n){if(!Tm(t))throw Error(W(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",o=F_;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),e=V_(e,null,t,1,n??null,i,!1,s,o),t[Br]=e.current,Il(t),r)for(t=0;t<r.length;t++)n=r[t],i=n._getVersion,i=i(n._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[n,i]:e.mutableSourceEagerHydrationData.push(n,i);return new jd(e)};pn.render=function(t,e,n){if(!Od(e))throw Error(W(200));return Ld(null,t,e,!1,n)};pn.unmountComponentAtNode=function(t){if(!Od(t))throw Error(W(40));return t._reactRootContainer?(Es(function(){Ld(null,null,t,!1,function(){t._reactRootContainer=null,t[Br]=null})}),!0):!1};pn.unstable_batchedUpdates=ym;pn.unstable_renderSubtreeIntoContainer=function(t,e,n,r){if(!Od(n))throw Error(W(200));if(t==null||t._reactInternals===void 0)throw Error(W(38));return Ld(t,e,n,!1,r)};pn.version="18.3.1-next-f1338f8080-20240426";function U_(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(U_)}catch(t){console.error(t)}}U_(),U0.exports=pn;var X1=U0.exports,By=X1;ff.createRoot=By.createRoot,ff.hydrateRoot=By.hydrateRoot;/**
|
|
* @license lucide-react v0.344.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/var Z1={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.344.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const eb=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),fe=(t,e)=>{const n=q.forwardRef(({color:r="currentColor",size:i=24,strokeWidth:s=2,absoluteStrokeWidth:o,className:l="",children:u,...h},m)=>q.createElement("svg",{ref:m,...Z1,width:i,height:i,stroke:r,strokeWidth:o?Number(s)*24/Number(i):s,className:["lucide",`lucide-${eb(t)}`,l].join(" "),...h},[...e.map(([v,g])=>q.createElement(v,g)),...Array.isArray(u)?u:[u]]));return n.displayName=`${t}`,n};/**
|
|
* @license lucide-react v0.344.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const tb=fe("AlertCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
|
|
* @license lucide-react v0.344.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const nb=fe("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
|
|
* @license lucide-react v0.344.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const Ua=fe("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/**
|
|
* @license lucide-react v0.344.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const $y=fe("Calendar",[["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"}]]);/**
|
|
* @license lucide-react v0.344.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const qy=fe("CheckCircle2",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
* @license lucide-react v0.344.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const Xn=fe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
* @license lucide-react v0.344.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const Bh=fe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
* @license lucide-react v0.344.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const Wy=fe("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
* @license lucide-react v0.344.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const rb=fe("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
* @license lucide-react v0.344.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const Hy=fe("CircleUser",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]]);/**
|
|
* @license lucide-react v0.344.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const Ky=fe("CloudSun",[["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}],["path",{d:"M15.947 12.65a4 4 0 0 0-5.925-4.128",key:"dpwdj0"}],["path",{d:"M13 22H7a5 5 0 1 1 4.9-6H13a3 3 0 0 1 0 6Z",key:"s09mg5"}]]);/**
|
|
* @license lucide-react v0.344.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const za=fe("Copy",[["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"}]]);/**
|
|
* @license lucide-react v0.344.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const ss=fe("Droplets",[["path",{d:"M7 16.3c2.2 0 4-1.83 4-4.05 0-1.16-.57-2.26-1.71-3.19S7.29 6.75 7 5.3c-.29 1.45-1.14 2.84-2.29 3.76S3 11.1 3 12.25c0 2.22 1.8 4.05 4 4.05z",key:"1ptgy4"}],["path",{d:"M12.56 6.6A10.97 10.97 0 0 0 14 3.02c.5 2.5 2 4.9 4 6.5s3 3.5 3 5.5a6.98 6.98 0 0 1-11.91 4.97",key:"1sl1rz"}]]);/**
|
|
* @license lucide-react v0.344.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const $h=fe("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
|
|
* @license lucide-react v0.344.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const Gy=fe("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
|
|
* @license lucide-react v0.344.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const qh=fe("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]);/**
|
|
* @license lucide-react v0.344.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const Wh=fe("Image",[["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"}]]);/**
|
|
* @license lucide-react v0.344.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const ib=fe("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
|
|
* @license lucide-react v0.344.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const sb=fe("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/**
|
|
* @license lucide-react v0.344.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const Qy=fe("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
* @license lucide-react v0.344.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const ob=fe("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
|
|
* @license lucide-react v0.344.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const ab=fe("MapPin",[["path",{d:"M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z",key:"2oe9fu"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/**
|
|
* @license lucide-react v0.344.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const lb=fe("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
* @license lucide-react v0.344.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const cb=fe("PanelLeftClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]);/**
|
|
* @license lucide-react v0.344.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const ub=fe("PanelLeftOpen",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]]);/**
|
|
* @license lucide-react v0.344.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const eu=fe("Pen",[["path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z",key:"5qss01"}]]);/**
|
|
* @license lucide-react v0.344.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const db=fe("PieChart",[["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}],["path",{d:"M22 12A10 10 0 0 0 12 2v10z",key:"1rfc4y"}]]);/**
|
|
* @license lucide-react v0.344.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const Ba=fe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
* @license lucide-react v0.344.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const hb=fe("RotateCcw",[["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"}]]);/**
|
|
* @license lucide-react v0.344.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const ho=fe("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
* @license lucide-react v0.344.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const Hh=fe("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
* @license lucide-react v0.344.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const Yy=fe("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/**
|
|
* @license lucide-react v0.344.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const Jy=fe("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/**
|
|
* @license lucide-react v0.344.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const $a=fe("Shirt",[["path",{d:"M20.38 3.46 16 2a4 4 0 0 1-8 0L3.62 3.46a2 2 0 0 0-1.34 2.23l.58 3.47a1 1 0 0 0 .99.84H6v10c0 1.1.9 2 2 2h8a2 2 0 0 0 2-2V10h2.15a1 1 0 0 0 .99-.84l.58-3.47a2 2 0 0 0-1.34-2.23z",key:"1wgbhj"}]]);/**
|
|
* @license lucide-react v0.344.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const Xy=fe("ShoppingBag",[["path",{d:"M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z",key:"hou9p0"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}]]);/**
|
|
* @license lucide-react v0.344.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const qa=fe("Sparkles",[["path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z",key:"17u4zn"}],["path",{d:"M5 3v4",key:"bklmnn"}],["path",{d:"M19 17v4",key:"iiml17"}],["path",{d:"M3 5h4",key:"nem4j1"}],["path",{d:"M17 19h4",key:"lbex7p"}]]);/**
|
|
* @license lucide-react v0.344.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const fb=fe("Sun",[["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"}]]);/**
|
|
* @license lucide-react v0.344.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const Zy=fe("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
|
|
* @license lucide-react v0.344.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const ev=fe("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
* @license lucide-react v0.344.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const tu=fe("Trash",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]]);/**
|
|
* @license lucide-react v0.344.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const pb=fe("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
|
|
* @license lucide-react v0.344.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const Cr=fe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);var tv={};/**
|
|
* @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 z_=function(t){const e=[];let n=0;for(let r=0;r<t.length;r++){let i=t.charCodeAt(r);i<128?e[n++]=i:i<2048?(e[n++]=i>>6|192,e[n++]=i&63|128):(i&64512)===55296&&r+1<t.length&&(t.charCodeAt(r+1)&64512)===56320?(i=65536+((i&1023)<<10)+(t.charCodeAt(++r)&1023),e[n++]=i>>18|240,e[n++]=i>>12&63|128,e[n++]=i>>6&63|128,e[n++]=i&63|128):(e[n++]=i>>12|224,e[n++]=i>>6&63|128,e[n++]=i&63|128)}return e},mb=function(t){const e=[];let n=0,r=0;for(;n<t.length;){const i=t[n++];if(i<128)e[r++]=String.fromCharCode(i);else if(i>191&&i<224){const s=t[n++];e[r++]=String.fromCharCode((i&31)<<6|s&63)}else if(i>239&&i<365){const s=t[n++],o=t[n++],l=t[n++],u=((i&7)<<18|(s&63)<<12|(o&63)<<6|l&63)-65536;e[r++]=String.fromCharCode(55296+(u>>10)),e[r++]=String.fromCharCode(56320+(u&1023))}else{const s=t[n++],o=t[n++];e[r++]=String.fromCharCode((i&15)<<12|(s&63)<<6|o&63)}}return e.join("")},B_={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let i=0;i<t.length;i+=3){const s=t[i],o=i+1<t.length,l=o?t[i+1]:0,u=i+2<t.length,h=u?t[i+2]:0,m=s>>2,v=(s&3)<<4|l>>4;let g=(l&15)<<2|h>>6,N=h&63;u||(N=64,o||(g=64)),r.push(n[m],n[v],n[g],n[N])}return r.join("")},encodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(z_(t),e)},decodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):mb(this.decodeStringToByteArray(t,e))},decodeStringToByteArray(t,e){this.init_();const n=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let i=0;i<t.length;){const s=n[t.charAt(i++)],l=i<t.length?n[t.charAt(i)]:0;++i;const h=i<t.length?n[t.charAt(i)]:64;++i;const v=i<t.length?n[t.charAt(i)]:64;if(++i,s==null||l==null||h==null||v==null)throw new gb;const g=s<<2|l>>4;if(r.push(g),h!==64){const N=l<<4&240|h>>2;if(r.push(N),v!==64){const j=h<<6&192|v;r.push(j)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let t=0;t<this.ENCODED_VALS.length;t++)this.byteToCharMap_[t]=this.ENCODED_VALS.charAt(t),this.charToByteMap_[this.byteToCharMap_[t]]=t,this.byteToCharMapWebSafe_[t]=this.ENCODED_VALS_WEBSAFE.charAt(t),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[t]]=t,t>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}};class gb extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const yb=function(t){const e=z_(t);return B_.encodeByteArray(e,!0)},td=function(t){return yb(t).replace(/\./g,"")},$_=function(t){try{return B_.decodeString(t,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};/**
|
|
* @license
|
|
* Copyright 2022 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/function vb(){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 wb=()=>vb().__FIREBASE_DEFAULTS__,_b=()=>{if(typeof process>"u"||typeof tv>"u")return;const t=tv.__FIREBASE_DEFAULTS__;if(t)return JSON.parse(t)},xb=()=>{if(typeof document>"u")return;let t;try{t=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const e=t&&$_(t[1]);return e&&JSON.parse(e)},Md=()=>{try{return wb()||_b()||xb()}catch(t){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${t}`);return}},q_=t=>{var e,n;return(n=(e=Md())===null||e===void 0?void 0:e.emulatorHosts)===null||n===void 0?void 0:n[t]},Eb=t=>{const e=q_(t);if(!e)return;const n=e.lastIndexOf(":");if(n<=0||n+1===e.length)throw new Error(`Invalid host ${e} with no separate hostname and port!`);const r=parseInt(e.substring(n+1),10);return e[0]==="["?[e.substring(1,n-1),r]:[e.substring(0,n),r]},W_=()=>{var t;return(t=Md())===null||t===void 0?void 0:t.config},H_=t=>{var e;return(e=Md())===null||e===void 0?void 0:e[`_${t}`]};/**
|
|
* @license
|
|
* Copyright 2017 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class kb{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,n)=>{this.resolve=e,this.reject=n})}wrapCallback(e){return(n,r)=>{n?this.reject(n):this.resolve(r),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(n):e(n,r))}}}/**
|
|
* @license
|
|
* Copyright 2021 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/function Tb(t,e){if(t.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const n={alg:"none",type:"JWT"},r=e||"demo-project",i=t.iat||0,s=t.sub||t.user_id;if(!s)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const o=Object.assign({iss:`https://securetoken.google.com/${r}`,aud:r,iat:i,exp:i+3600,auth_time:i,sub:s,user_id:s,firebase:{sign_in_provider:"custom",identities:{}}},t);return[td(JSON.stringify(n)),td(JSON.stringify(o)),""].join(".")}/**
|
|
* @license
|
|
* Copyright 2017 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/function Ut(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function bb(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(Ut())}function Sb(){var t;const e=(t=Md())===null||t===void 0?void 0:t.forceEnvironment;if(e==="node")return!0;if(e==="browser")return!1;try{return Object.prototype.toString.call(global.process)==="[object process]"}catch{return!1}}function Ib(){return typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"}function Cb(){const t=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof t=="object"&&t.id!==void 0}function Ab(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function Nb(){const t=Ut();return t.indexOf("MSIE ")>=0||t.indexOf("Trident/")>=0}function Pb(){return!Sb()&&!!navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function K_(){try{return typeof indexedDB=="object"}catch{return!1}}function G_(){return new Promise((t,e)=>{try{let n=!0;const r="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(r);i.onsuccess=()=>{i.result.close(),n||self.indexedDB.deleteDatabase(r),t(!0)},i.onupgradeneeded=()=>{n=!1},i.onerror=()=>{var s;e(((s=i.error)===null||s===void 0?void 0:s.message)||"")}}catch(n){e(n)}})}function Rb(){return!(typeof navigator>"u"||!navigator.cookieEnabled)}/**
|
|
* @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 Db="FirebaseError";class fr extends Error{constructor(e,n,r){super(n),this.code=e,this.customData=r,this.name=Db,Object.setPrototypeOf(this,fr.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,Rs.prototype.create)}}class Rs{constructor(e,n,r){this.service=e,this.serviceName=n,this.errors=r}create(e,...n){const r=n[0]||{},i=`${this.service}/${e}`,s=this.errors[e],o=s?jb(s,r):"Error",l=`${this.serviceName}: ${o} (${i}).`;return new fr(i,l,r)}}function jb(t,e){return t.replace(Ob,(n,r)=>{const i=e[r];return i!=null?String(i):`<${r}?>`})}const Ob=/\{\$([^}]+)}/g;function Lb(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}function nd(t,e){if(t===e)return!0;const n=Object.keys(t),r=Object.keys(e);for(const i of n){if(!r.includes(i))return!1;const s=t[i],o=e[i];if(nv(s)&&nv(o)){if(!nd(s,o))return!1}else if(s!==o)return!1}for(const i of r)if(!n.includes(i))return!1;return!0}function nv(t){return t!==null&&typeof t=="object"}/**
|
|
* @license
|
|
* Copyright 2017 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/function Xl(t){const e=[];for(const[n,r]of Object.entries(t))Array.isArray(r)?r.forEach(i=>{e.push(encodeURIComponent(n)+"="+encodeURIComponent(i))}):e.push(encodeURIComponent(n)+"="+encodeURIComponent(r));return e.length?"&"+e.join("&"):""}function Za(t){const e={};return t.replace(/^\?/,"").split("&").forEach(r=>{if(r){const[i,s]=r.split("=");e[decodeURIComponent(i)]=decodeURIComponent(s)}}),e}function el(t){const e=t.indexOf("?");if(!e)return"";const n=t.indexOf("#",e);return t.substring(e,n>0?n:void 0)}function Mb(t,e){const n=new Vb(t,e);return n.subscribe.bind(n)}class Vb{constructor(e,n){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=n,this.task.then(()=>{e(this)}).catch(r=>{this.error(r)})}next(e){this.forEachObserver(n=>{n.next(e)})}error(e){this.forEachObserver(n=>{n.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,n,r){let i;if(e===void 0&&n===void 0&&r===void 0)throw new Error("Missing Observer.");Fb(e,["next","error","complete"])?i=e:i={next:e,error:n,complete:r},i.next===void 0&&(i.next=Kh),i.error===void 0&&(i.error=Kh),i.complete===void 0&&(i.complete=Kh);const s=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?i.error(this.finalError):i.complete()}catch{}}),this.observers.push(i),s}unsubscribeOne(e){this.observers===void 0||this.observers[e]===void 0||(delete this.observers[e],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let n=0;n<this.observers.length;n++)this.sendOne(n,e)}sendOne(e,n){this.task.then(()=>{if(this.observers!==void 0&&this.observers[e]!==void 0)try{n(this.observers[e])}catch(r){typeof console<"u"&&console.error&&console.error(r)}})}close(e){this.finalized||(this.finalized=!0,e!==void 0&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function Fb(t,e){if(typeof t!="object"||t===null)return!1;for(const n of e)if(n in t&&typeof t[n]=="function")return!0;return!1}function Kh(){}/**
|
|
* @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 qe(t){return t&&t._delegate?t._delegate:t}class Un{constructor(e,n,r){this.name=e,this.instanceFactory=n,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}/**
|
|
* @license
|
|
* Copyright 2019 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/const cs="[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 Ub{constructor(e,n){this.name=e,this.container=n,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const n=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(n)){const r=new kb;if(this.instancesDeferred.set(n,r),this.isInitialized(n)||this.shouldAutoInitialize())try{const i=this.getOrInitializeService({instanceIdentifier:n});i&&r.resolve(i)}catch{}}return this.instancesDeferred.get(n).promise}getImmediate(e){var n;const r=this.normalizeInstanceIdentifier(e==null?void 0:e.identifier),i=(n=e==null?void 0:e.optional)!==null&&n!==void 0?n:!1;if(this.isInitialized(r)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:r})}catch(s){if(i)return null;throw s}else{if(i)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,!!this.shouldAutoInitialize()){if(Bb(e))try{this.getOrInitializeService({instanceIdentifier:cs})}catch{}for(const[n,r]of this.instancesDeferred.entries()){const i=this.normalizeInstanceIdentifier(n);try{const s=this.getOrInitializeService({instanceIdentifier:i});r.resolve(s)}catch{}}}}clearInstance(e=cs){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter(n=>"INTERNAL"in n).map(n=>n.INTERNAL.delete()),...e.filter(n=>"_delete"in n).map(n=>n._delete())])}isComponentSet(){return this.component!=null}isInitialized(e=cs){return this.instances.has(e)}getOptions(e=cs){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:n={}}=e,r=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(r))throw Error(`${this.name}(${r}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const i=this.getOrInitializeService({instanceIdentifier:r,options:n});for(const[s,o]of this.instancesDeferred.entries()){const l=this.normalizeInstanceIdentifier(s);r===l&&o.resolve(i)}return i}onInit(e,n){var r;const i=this.normalizeInstanceIdentifier(n),s=(r=this.onInitCallbacks.get(i))!==null&&r!==void 0?r:new Set;s.add(e),this.onInitCallbacks.set(i,s);const o=this.instances.get(i);return o&&e(o,i),()=>{s.delete(e)}}invokeOnInitCallbacks(e,n){const r=this.onInitCallbacks.get(n);if(r)for(const i of r)try{i(e,n)}catch{}}getOrInitializeService({instanceIdentifier:e,options:n={}}){let r=this.instances.get(e);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:zb(e),options:n}),this.instances.set(e,r),this.instancesOptions.set(e,n),this.invokeOnInitCallbacks(r,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,r)}catch{}return r||null}normalizeInstanceIdentifier(e=cs){return this.component?this.component.multipleInstances?e:cs:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function zb(t){return t===cs?void 0:t}function Bb(t){return t.instantiationMode==="EAGER"}/**
|
|
* @license
|
|
* Copyright 2019 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class $b{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const n=this.getProvider(e.name);if(n.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);n.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const n=new Ub(e,this);return this.providers.set(e,n),n}getProviders(){return Array.from(this.providers.values())}}/**
|
|
* @license
|
|
* Copyright 2017 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/var ye;(function(t){t[t.DEBUG=0]="DEBUG",t[t.VERBOSE=1]="VERBOSE",t[t.INFO=2]="INFO",t[t.WARN=3]="WARN",t[t.ERROR=4]="ERROR",t[t.SILENT=5]="SILENT"})(ye||(ye={}));const qb={debug:ye.DEBUG,verbose:ye.VERBOSE,info:ye.INFO,warn:ye.WARN,error:ye.ERROR,silent:ye.SILENT},Wb=ye.INFO,Hb={[ye.DEBUG]:"log",[ye.VERBOSE]:"log",[ye.INFO]:"info",[ye.WARN]:"warn",[ye.ERROR]:"error"},Kb=(t,e,...n)=>{if(e<t.logLevel)return;const r=new Date().toISOString(),i=Hb[e];if(i)console[i](`[${r}] ${t.name}:`,...n);else throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`)};class bm{constructor(e){this.name=e,this._logLevel=Wb,this._logHandler=Kb,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in ye))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel=typeof e=="string"?qb[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if(typeof e!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,ye.DEBUG,...e),this._logHandler(this,ye.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,ye.VERBOSE,...e),this._logHandler(this,ye.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,ye.INFO,...e),this._logHandler(this,ye.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,ye.WARN,...e),this._logHandler(this,ye.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,ye.ERROR,...e),this._logHandler(this,ye.ERROR,...e)}}const Gb=(t,e)=>e.some(n=>t instanceof n);let rv,iv;function Qb(){return rv||(rv=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Yb(){return iv||(iv=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Q_=new WeakMap,op=new WeakMap,Y_=new WeakMap,Gh=new WeakMap,Sm=new WeakMap;function Jb(t){const e=new Promise((n,r)=>{const i=()=>{t.removeEventListener("success",s),t.removeEventListener("error",o)},s=()=>{n(Vr(t.result)),i()},o=()=>{r(t.error),i()};t.addEventListener("success",s),t.addEventListener("error",o)});return e.then(n=>{n instanceof IDBCursor&&Q_.set(n,t)}).catch(()=>{}),Sm.set(e,t),e}function Xb(t){if(op.has(t))return;const e=new Promise((n,r)=>{const i=()=>{t.removeEventListener("complete",s),t.removeEventListener("error",o),t.removeEventListener("abort",o)},s=()=>{n(),i()},o=()=>{r(t.error||new DOMException("AbortError","AbortError")),i()};t.addEventListener("complete",s),t.addEventListener("error",o),t.addEventListener("abort",o)});op.set(t,e)}let ap={get(t,e,n){if(t instanceof IDBTransaction){if(e==="done")return op.get(t);if(e==="objectStoreNames")return t.objectStoreNames||Y_.get(t);if(e==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return Vr(t[e])},set(t,e,n){return t[e]=n,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};function Zb(t){ap=t(ap)}function eS(t){return t===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...n){const r=t.call(Qh(this),e,...n);return Y_.set(r,e.sort?e.sort():[e]),Vr(r)}:Yb().includes(t)?function(...e){return t.apply(Qh(this),e),Vr(Q_.get(this))}:function(...e){return Vr(t.apply(Qh(this),e))}}function tS(t){return typeof t=="function"?eS(t):(t instanceof IDBTransaction&&Xb(t),Gb(t,Qb())?new Proxy(t,ap):t)}function Vr(t){if(t instanceof IDBRequest)return Jb(t);if(Gh.has(t))return Gh.get(t);const e=tS(t);return e!==t&&(Gh.set(t,e),Sm.set(e,t)),e}const Qh=t=>Sm.get(t);function Vd(t,e,{blocked:n,upgrade:r,blocking:i,terminated:s}={}){const o=indexedDB.open(t,e),l=Vr(o);return r&&o.addEventListener("upgradeneeded",u=>{r(Vr(o.result),u.oldVersion,u.newVersion,Vr(o.transaction),u)}),n&&o.addEventListener("blocked",u=>n(u.oldVersion,u.newVersion,u)),l.then(u=>{s&&u.addEventListener("close",()=>s()),i&&u.addEventListener("versionchange",h=>i(h.oldVersion,h.newVersion,h))}).catch(()=>{}),l}function Yh(t,{blocked:e}={}){const n=indexedDB.deleteDatabase(t);return e&&n.addEventListener("blocked",r=>e(r.oldVersion,r)),Vr(n).then(()=>{})}const nS=["get","getKey","getAll","getAllKeys","count"],rS=["put","add","delete","clear"],Jh=new Map;function sv(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(Jh.get(e))return Jh.get(e);const n=e.replace(/FromIndex$/,""),r=e!==n,i=rS.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(i||nS.includes(n)))return;const s=async function(o,...l){const u=this.transaction(o,i?"readwrite":"readonly");let h=u.store;return r&&(h=h.index(l.shift())),(await Promise.all([h[n](...l),i&&u.done]))[0]};return Jh.set(e,s),s}Zb(t=>({...t,get:(e,n,r)=>sv(e,n)||t.get(e,n,r),has:(e,n)=>!!sv(e,n)||t.has(e,n)}));/**
|
|
* @license
|
|
* Copyright 2019 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class iS{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(n=>{if(sS(n)){const r=n.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(n=>n).join(" ")}}function sS(t){const e=t.getComponent();return(e==null?void 0:e.type)==="VERSION"}const lp="@firebase/app",ov="0.10.13";/**
|
|
* @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 Wr=new bm("@firebase/app"),oS="@firebase/app-compat",aS="@firebase/analytics-compat",lS="@firebase/analytics",cS="@firebase/app-check-compat",uS="@firebase/app-check",dS="@firebase/auth",hS="@firebase/auth-compat",fS="@firebase/database",pS="@firebase/data-connect",mS="@firebase/database-compat",gS="@firebase/functions",yS="@firebase/functions-compat",vS="@firebase/installations",wS="@firebase/installations-compat",_S="@firebase/messaging",xS="@firebase/messaging-compat",ES="@firebase/performance",kS="@firebase/performance-compat",TS="@firebase/remote-config",bS="@firebase/remote-config-compat",SS="@firebase/storage",IS="@firebase/storage-compat",CS="@firebase/firestore",AS="@firebase/vertexai-preview",NS="@firebase/firestore-compat",PS="firebase",RS="10.14.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.
|
|
*/const cp="[DEFAULT]",DS={[lp]:"fire-core",[oS]:"fire-core-compat",[lS]:"fire-analytics",[aS]:"fire-analytics-compat",[uS]:"fire-app-check",[cS]:"fire-app-check-compat",[dS]:"fire-auth",[hS]:"fire-auth-compat",[fS]:"fire-rtdb",[pS]:"fire-data-connect",[mS]:"fire-rtdb-compat",[gS]:"fire-fn",[yS]:"fire-fn-compat",[vS]:"fire-iid",[wS]:"fire-iid-compat",[_S]:"fire-fcm",[xS]:"fire-fcm-compat",[ES]:"fire-perf",[kS]:"fire-perf-compat",[TS]:"fire-rc",[bS]:"fire-rc-compat",[SS]:"fire-gcs",[IS]:"fire-gcs-compat",[CS]:"fire-fst",[NS]:"fire-fst-compat",[AS]:"fire-vertex","fire-js":"fire-js",[PS]:"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 rd=new Map,jS=new Map,up=new Map;function av(t,e){try{t.container.addComponent(e)}catch(n){Wr.debug(`Component ${e.name} failed to register with FirebaseApp ${t.name}`,n)}}function ur(t){const e=t.name;if(up.has(e))return Wr.debug(`There were multiple attempts to register component ${e}.`),!1;up.set(e,t);for(const n of rd.values())av(n,t);for(const n of jS.values())av(n,t);return!0}function ra(t,e){const n=t.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),t.container.getProvider(e)}function rr(t){return t.settings!==void 0}/**
|
|
* @license
|
|
* Copyright 2019 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/const OS={"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."},Ni=new Rs("app","Firebase",OS);/**
|
|
* @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 LS{constructor(e,n,r){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},n),this._name=n.name,this._automaticDataCollectionEnabled=n.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new Un("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 Ni.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 ia=RS;function J_(t,e={}){let n=t;typeof e!="object"&&(e={name:e});const r=Object.assign({name:cp,automaticDataCollectionEnabled:!1},e),i=r.name;if(typeof i!="string"||!i)throw Ni.create("bad-app-name",{appName:String(i)});if(n||(n=W_()),!n)throw Ni.create("no-options");const s=rd.get(i);if(s){if(nd(n,s.options)&&nd(r,s.config))return s;throw Ni.create("duplicate-app",{appName:i})}const o=new $b(i);for(const u of up.values())o.addComponent(u);const l=new LS(n,r,o);return rd.set(i,l),l}function Im(t=cp){const e=rd.get(t);if(!e&&t===cp&&W_())return J_();if(!e)throw Ni.create("no-app",{appName:t});return e}function Sn(t,e,n){var r;let i=(r=DS[t])!==null&&r!==void 0?r:t;n&&(i+=`-${n}`);const s=i.match(/\s|\//),o=e.match(/\s|\//);if(s||o){const l=[`Unable to register library "${i}" with version "${e}":`];s&&l.push(`library name "${i}" contains illegal characters (whitespace or "/")`),s&&o&&l.push("and"),o&&l.push(`version name "${e}" contains illegal characters (whitespace or "/")`),Wr.warn(l.join(" "));return}ur(new Un(`${i}-version`,()=>({library:i,version:e}),"VERSION"))}/**
|
|
* @license
|
|
* Copyright 2021 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/const MS="firebase-heartbeat-database",VS=1,Ll="firebase-heartbeat-store";let Xh=null;function X_(){return Xh||(Xh=Vd(MS,VS,{upgrade:(t,e)=>{switch(e){case 0:try{t.createObjectStore(Ll)}catch(n){console.warn(n)}}}}).catch(t=>{throw Ni.create("idb-open",{originalErrorMessage:t.message})})),Xh}async function FS(t){try{const n=(await X_()).transaction(Ll),r=await n.objectStore(Ll).get(Z_(t));return await n.done,r}catch(e){if(e instanceof fr)Wr.warn(e.message);else{const n=Ni.create("idb-get",{originalErrorMessage:e==null?void 0:e.message});Wr.warn(n.message)}}}async function lv(t,e){try{const r=(await X_()).transaction(Ll,"readwrite");await r.objectStore(Ll).put(e,Z_(t)),await r.done}catch(n){if(n instanceof fr)Wr.warn(n.message);else{const r=Ni.create("idb-set",{originalErrorMessage:n==null?void 0:n.message});Wr.warn(r.message)}}}function Z_(t){return`${t.name}!${t.options.appId}`}/**
|
|
* @license
|
|
* Copyright 2021 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/const US=1024,zS=30*24*60*60*1e3;class BS{constructor(e){this.container=e,this._heartbeatsCache=null;const n=this.container.getProvider("app").getImmediate();this._storage=new qS(n),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}async triggerHeartbeat(){var e,n;try{const i=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),s=cv();return((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,((n=this._heartbeatsCache)===null||n===void 0?void 0:n.heartbeats)==null)||this._heartbeatsCache.lastSentHeartbeatDate===s||this._heartbeatsCache.heartbeats.some(o=>o.date===s)?void 0:(this._heartbeatsCache.heartbeats.push({date:s,agent:i}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter(o=>{const l=new Date(o.date).valueOf();return Date.now()-l<=zS}),this._storage.overwrite(this._heartbeatsCache))}catch(r){Wr.warn(r)}}async getHeartbeatsHeader(){var e;try{if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";const n=cv(),{heartbeatsToSend:r,unsentEntries:i}=$S(this._heartbeatsCache.heartbeats),s=td(JSON.stringify({version:2,heartbeats:r}));return this._heartbeatsCache.lastSentHeartbeatDate=n,i.length>0?(this._heartbeatsCache.heartbeats=i,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),s}catch(n){return Wr.warn(n),""}}}function cv(){return new Date().toISOString().substring(0,10)}function $S(t,e=US){const n=[];let r=t.slice();for(const i of t){const s=n.find(o=>o.agent===i.agent);if(s){if(s.dates.push(i.date),uv(n)>e){s.dates.pop();break}}else if(n.push({agent:i.agent,dates:[i.date]}),uv(n)>e){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}class qS{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return K_()?G_().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const n=await FS(this.app);return n!=null&&n.heartbeats?n:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(e){var n;if(await this._canUseIndexedDBPromise){const i=await this.read();return lv(this.app,{lastSentHeartbeatDate:(n=e.lastSentHeartbeatDate)!==null&&n!==void 0?n:i.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){var n;if(await this._canUseIndexedDBPromise){const i=await this.read();return lv(this.app,{lastSentHeartbeatDate:(n=e.lastSentHeartbeatDate)!==null&&n!==void 0?n:i.lastSentHeartbeatDate,heartbeats:[...i.heartbeats,...e.heartbeats]})}else return}}function uv(t){return td(JSON.stringify({version:2,heartbeats:t})).length}/**
|
|
* @license
|
|
* Copyright 2019 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/function WS(t){ur(new Un("platform-logger",e=>new iS(e),"PRIVATE")),ur(new Un("heartbeat",e=>new BS(e),"PRIVATE")),Sn(lp,ov,t),Sn(lp,ov,"esm2017"),Sn("fire-js","")}WS("");function Cm(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function ex(){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 HS=ex,tx=new Rs("auth","Firebase",ex());/**
|
|
* @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 id=new bm("@firebase/auth");function KS(t,...e){id.logLevel<=ye.WARN&&id.warn(`Auth (${ia}): ${t}`,...e)}function Eu(t,...e){id.logLevel<=ye.ERROR&&id.error(`Auth (${ia}): ${t}`,...e)}/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/function zn(t,...e){throw Am(t,...e)}function or(t,...e){return Am(t,...e)}function nx(t,e,n){const r=Object.assign(Object.assign({},HS()),{[e]:n});return new Rs("auth","Firebase",r).create(e,{appName:t.name})}function Fr(t){return nx(t,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function Am(t,...e){if(typeof t!="string"){const n=e[0],r=[...e.slice(1)];return r[0]&&(r[0].appName=t.name),t._errorFactory.create(n,...r)}return tx.create(t,...e)}function le(t,e,...n){if(!t)throw Am(e,...n)}function jr(t){const e="INTERNAL ASSERTION FAILED: "+t;throw Eu(e),new Error(e)}function Hr(t,e){t||jr(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 dp(){var t;return typeof self<"u"&&((t=self.location)===null||t===void 0?void 0:t.href)||""}function GS(){return dv()==="http:"||dv()==="https:"}function dv(){var t;return typeof self<"u"&&((t=self.location)===null||t===void 0?void 0:t.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 QS(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(GS()||Cb()||"connection"in navigator)?navigator.onLine:!0}function YS(){if(typeof navigator>"u")return null;const t=navigator;return t.languages&&t.languages[0]||t.language||null}/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class Zl{constructor(e,n){this.shortDelay=e,this.longDelay=n,Hr(n>e,"Short delay should be less than long delay!"),this.isMobile=bb()||Ab()}get(){return QS()?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 Nm(t,e){Hr(t.emulator,"Emulator should always be set here");const{url:n}=t.emulator;return e?`${n}${e.startsWith("/")?e.slice(1):e}`:n}/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class rx{static initialize(e,n,r){this.fetchImpl=e,n&&(this.headersImpl=n),r&&(this.responseImpl=r)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self<"u"&&"fetch"in self)return self.fetch;if(typeof globalThis<"u"&&globalThis.fetch)return globalThis.fetch;if(typeof fetch<"u")return fetch;jr("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;jr("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;jr("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 JS={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 XS=new Zl(3e4,6e4);function Yr(t,e){return t.tenantId&&!e.tenantId?Object.assign(Object.assign({},e),{tenantId:t.tenantId}):e}async function Jr(t,e,n,r,i={}){return ix(t,i,async()=>{let s={},o={};r&&(e==="GET"?o=r:s={body:JSON.stringify(r)});const l=Xl(Object.assign({key:t.config.apiKey},o)).slice(1),u=await t._getAdditionalHeaders();u["Content-Type"]="application/json",t.languageCode&&(u["X-Firebase-Locale"]=t.languageCode);const h=Object.assign({method:e,headers:u},s);return Ib()||(h.referrerPolicy="no-referrer"),rx.fetch()(sx(t,t.config.apiHost,n,l),h)})}async function ix(t,e,n){t._canInitEmulator=!1;const r=Object.assign(Object.assign({},JS),e);try{const i=new eI(t),s=await Promise.race([n(),i.promise]);i.clearNetworkTimeout();const o=await s.json();if("needConfirmation"in o)throw nu(t,"account-exists-with-different-credential",o);if(s.ok&&!("errorMessage"in o))return o;{const l=s.ok?o.errorMessage:o.error.message,[u,h]=l.split(" : ");if(u==="FEDERATED_USER_ID_ALREADY_LINKED")throw nu(t,"credential-already-in-use",o);if(u==="EMAIL_EXISTS")throw nu(t,"email-already-in-use",o);if(u==="USER_DISABLED")throw nu(t,"user-disabled",o);const m=r[u]||u.toLowerCase().replace(/[_\s]+/g,"-");if(h)throw nx(t,m,h);zn(t,m)}}catch(i){if(i instanceof fr)throw i;zn(t,"network-request-failed",{message:String(i)})}}async function ec(t,e,n,r,i={}){const s=await Jr(t,e,n,r,i);return"mfaPendingCredential"in s&&zn(t,"multi-factor-auth-required",{_serverResponse:s}),s}function sx(t,e,n,r){const i=`${e}${n}?${r}`;return t.config.emulator?Nm(t.config,i):`${t.config.apiScheme}://${i}`}function ZS(t){switch(t){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}class eI{constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((n,r)=>{this.timer=setTimeout(()=>r(or(this.auth,"network-request-failed")),XS.get())})}clearNetworkTimeout(){clearTimeout(this.timer)}}function nu(t,e,n){const r={appName:t.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);const i=or(t,e,r);return i.customData._tokenResponse=n,i}function hv(t){return t!==void 0&&t.enterprise!==void 0}class tI{constructor(e){if(this.siteKey="",this.recaptchaEnforcementState=[],e.recaptchaKey===void 0)throw new Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.recaptchaEnforcementState=e.recaptchaEnforcementState}getProviderEnforcementState(e){if(!this.recaptchaEnforcementState||this.recaptchaEnforcementState.length===0)return null;for(const n of this.recaptchaEnforcementState)if(n.provider&&n.provider===e)return ZS(n.enforcementState);return null}isProviderEnabled(e){return this.getProviderEnforcementState(e)==="ENFORCE"||this.getProviderEnforcementState(e)==="AUDIT"}}async function nI(t,e){return Jr(t,"GET","/v2/recaptchaConfig",Yr(t,e))}/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/async function rI(t,e){return Jr(t,"POST","/v1/accounts:delete",e)}async function ox(t,e){return Jr(t,"POST","/v1/accounts:lookup",e)}/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/function pl(t){if(t)try{const e=new Date(Number(t));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}async function iI(t,e=!1){const n=qe(t),r=await n.getIdToken(e),i=Pm(r);le(i&&i.exp&&i.auth_time&&i.iat,n.auth,"internal-error");const s=typeof i.firebase=="object"?i.firebase:void 0,o=s==null?void 0:s.sign_in_provider;return{claims:i,token:r,authTime:pl(Zh(i.auth_time)),issuedAtTime:pl(Zh(i.iat)),expirationTime:pl(Zh(i.exp)),signInProvider:o||null,signInSecondFactor:(s==null?void 0:s.sign_in_second_factor)||null}}function Zh(t){return Number(t)*1e3}function Pm(t){const[e,n,r]=t.split(".");if(e===void 0||n===void 0||r===void 0)return Eu("JWT malformed, contained fewer than 3 sections"),null;try{const i=$_(n);return i?JSON.parse(i):(Eu("Failed to decode base64 JWT payload"),null)}catch(i){return Eu("Caught error parsing JWT payload as JSON",i==null?void 0:i.toString()),null}}function fv(t){const e=Pm(t);return le(e,"internal-error"),le(typeof e.exp<"u","internal-error"),le(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 Ml(t,e,n=!1){if(n)return e;try{return await e}catch(r){throw r instanceof fr&&sI(r)&&t.auth.currentUser===t&&await t.auth.signOut(),r}}function sI({code:t}){return t==="auth/user-disabled"||t==="auth/user-token-expired"}/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class oI{constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,this.timerId!==null&&clearTimeout(this.timerId))}getInterval(e){var n;if(e){const r=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),r}else{this.errorBackoff=3e4;const i=((n=this.user.stsTokenManager.expirationTime)!==null&&n!==void 0?n:0)-Date.now()-3e5;return Math.max(0,i)}}schedule(e=!1){if(!this.isRunning)return;const n=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},n)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){(e==null?void 0:e.code)==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}}/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class hp{constructor(e,n){this.createdAt=e,this.lastLoginAt=n,this._initializeTime()}_initializeTime(){this.lastSignInTime=pl(this.lastLoginAt),this.creationTime=pl(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 sd(t){var e;const n=t.auth,r=await t.getIdToken(),i=await Ml(t,ox(n,{idToken:r}));le(i==null?void 0:i.users.length,n,"internal-error");const s=i.users[0];t._notifyReloadListener(s);const o=!((e=s.providerUserInfo)===null||e===void 0)&&e.length?ax(s.providerUserInfo):[],l=lI(t.providerData,o),u=t.isAnonymous,h=!(t.email&&s.passwordHash)&&!(l!=null&&l.length),m=u?h:!1,v={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:l,metadata:new hp(s.createdAt,s.lastLoginAt),isAnonymous:m};Object.assign(t,v)}async function aI(t){const e=qe(t);await sd(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}function lI(t,e){return[...t.filter(r=>!e.some(i=>i.providerId===r.providerId)),...e]}function ax(t){return t.map(e=>{var{providerId:n}=e,r=Cm(e,["providerId"]);return{providerId:n,uid:r.rawId||"",displayName:r.displayName||null,email:r.email||null,phoneNumber:r.phoneNumber||null,photoURL:r.photoUrl||null}})}/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/async function cI(t,e){const n=await ix(t,{},async()=>{const r=Xl({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:i,apiKey:s}=t.config,o=sx(t,i,"/v1/token",`key=${s}`),l=await t._getAdditionalHeaders();return l["Content-Type"]="application/x-www-form-urlencoded",rx.fetch()(o,{method:"POST",headers:l,body:r})});return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}async function uI(t,e){return Jr(t,"POST","/v2/accounts:revokeToken",Yr(t,e))}/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class Lo{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){le(e.idToken,"internal-error"),le(typeof e.idToken<"u","internal-error"),le(typeof e.refreshToken<"u","internal-error");const n="expiresIn"in e&&typeof e.expiresIn<"u"?Number(e.expiresIn):fv(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,n)}updateFromIdToken(e){le(e.length!==0,"internal-error");const n=fv(e);this.updateTokensAndExpiration(e,null,n)}async getToken(e,n=!1){return!n&&this.accessToken&&!this.isExpired?this.accessToken:(le(this.refreshToken,e,"user-token-expired"),this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null)}clearRefreshToken(){this.refreshToken=null}async refresh(e,n){const{accessToken:r,refreshToken:i,expiresIn:s}=await cI(e,n);this.updateTokensAndExpiration(r,i,Number(s))}updateTokensAndExpiration(e,n,r){this.refreshToken=n||null,this.accessToken=e||null,this.expirationTime=Date.now()+r*1e3}static fromJSON(e,n){const{refreshToken:r,accessToken:i,expirationTime:s}=n,o=new Lo;return r&&(le(typeof r=="string","internal-error",{appName:e}),o.refreshToken=r),i&&(le(typeof i=="string","internal-error",{appName:e}),o.accessToken=i),s&&(le(typeof s=="number","internal-error",{appName:e}),o.expirationTime=s),o}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new Lo,this.toJSON())}_performRefresh(){return jr("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 ui(t,e){le(typeof t=="string"||typeof t>"u","internal-error",{appName:e})}class Or{constructor(e){var{uid:n,auth:r,stsTokenManager:i}=e,s=Cm(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new oI(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=n,this.auth=r,this.stsTokenManager=i,this.accessToken=i.accessToken,this.displayName=s.displayName||null,this.email=s.email||null,this.emailVerified=s.emailVerified||!1,this.phoneNumber=s.phoneNumber||null,this.photoURL=s.photoURL||null,this.isAnonymous=s.isAnonymous||!1,this.tenantId=s.tenantId||null,this.providerData=s.providerData?[...s.providerData]:[],this.metadata=new hp(s.createdAt||void 0,s.lastLoginAt||void 0)}async getIdToken(e){const n=await Ml(this,this.stsTokenManager.getToken(this.auth,e));return le(n,this.auth,"internal-error"),this.accessToken!==n&&(this.accessToken=n,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),n}getIdTokenResult(e){return iI(this,e)}reload(){return aI(this)}_assign(e){this!==e&&(le(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(n=>Object.assign({},n)),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const n=new Or(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}));return n.metadata._copy(this.metadata),n}_onReload(e){le(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,n=!1){let r=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),r=!0),n&&await sd(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(rr(this.auth.app))return Promise.reject(Fr(this.auth));const e=await this.getIdToken();return await Ml(this,rI(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return Object.assign(Object.assign({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>Object.assign({},e)),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{apiKey:this.auth.config.apiKey,appName:this.auth.name})}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,n){var r,i,s,o,l,u,h,m;const v=(r=n.displayName)!==null&&r!==void 0?r:void 0,g=(i=n.email)!==null&&i!==void 0?i:void 0,N=(s=n.phoneNumber)!==null&&s!==void 0?s:void 0,j=(o=n.photoURL)!==null&&o!==void 0?o:void 0,L=(l=n.tenantId)!==null&&l!==void 0?l:void 0,B=(u=n._redirectEventId)!==null&&u!==void 0?u:void 0,I=(h=n.createdAt)!==null&&h!==void 0?h:void 0,k=(m=n.lastLoginAt)!==null&&m!==void 0?m:void 0,{uid:C,emailVerified:V,isAnonymous:G,providerData:H,stsTokenManager:T}=n;le(C&&T,e,"internal-error");const w=Lo.fromJSON(this.name,T);le(typeof C=="string",e,"internal-error"),ui(v,e.name),ui(g,e.name),le(typeof V=="boolean",e,"internal-error"),le(typeof G=="boolean",e,"internal-error"),ui(N,e.name),ui(j,e.name),ui(L,e.name),ui(B,e.name),ui(I,e.name),ui(k,e.name);const E=new Or({uid:C,auth:e,email:g,emailVerified:V,displayName:v,isAnonymous:G,photoURL:j,phoneNumber:N,tenantId:L,stsTokenManager:w,createdAt:I,lastLoginAt:k});return H&&Array.isArray(H)&&(E.providerData=H.map(S=>Object.assign({},S))),B&&(E._redirectEventId=B),E}static async _fromIdTokenResponse(e,n,r=!1){const i=new Lo;i.updateFromServerResponse(n);const s=new Or({uid:n.localId,auth:e,stsTokenManager:i,isAnonymous:r});return await sd(s),s}static async _fromGetAccountInfoResponse(e,n,r){const i=n.users[0];le(i.localId!==void 0,"internal-error");const s=i.providerUserInfo!==void 0?ax(i.providerUserInfo):[],o=!(i.email&&i.passwordHash)&&!(s!=null&&s.length),l=new Lo;l.updateFromIdToken(r);const u=new Or({uid:i.localId,auth:e,stsTokenManager:l,isAnonymous:o}),h={uid:i.localId,displayName:i.displayName||null,photoURL:i.photoUrl||null,email:i.email||null,emailVerified:i.emailVerified||!1,phoneNumber:i.phoneNumber||null,tenantId:i.tenantId||null,providerData:s,metadata:new hp(i.createdAt,i.lastLoginAt),isAnonymous:!(i.email&&i.passwordHash)&&!(s!=null&&s.length)};return Object.assign(u,h),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.
|
|
*/const pv=new Map;function Lr(t){Hr(t instanceof Function,"Expected a class definition");let e=pv.get(t);return e?(Hr(e instanceof t,"Instance stored in cache mismatched with class"),e):(e=new t,pv.set(t,e),e)}/**
|
|
* @license
|
|
* Copyright 2019 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class lx{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,n){this.storage[e]=n}async _get(e){const n=this.storage[e];return n===void 0?null:n}async _remove(e){delete this.storage[e]}_addListener(e,n){}_removeListener(e,n){}}lx.type="NONE";const mv=lx;/**
|
|
* @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 ku(t,e,n){return`firebase:${t}:${e}:${n}`}class Mo{constructor(e,n,r){this.persistence=e,this.auth=n,this.userKey=r;const{config:i,name:s}=this.auth;this.fullUserKey=ku(this.userKey,i.apiKey,s),this.fullPersistenceKey=ku("persistence",i.apiKey,s),this.boundEventHandler=n._onStorageEvent.bind(n),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){const e=await this.persistence._get(this.fullUserKey);return e?Or._fromJSON(this.auth,e):null}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;const n=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=e,n)return this.setCurrentUser(n)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,n,r="authUser"){if(!n.length)return new Mo(Lr(mv),e,r);const i=(await Promise.all(n.map(async h=>{if(await h._isAvailable())return h}))).filter(h=>h);let s=i[0]||Lr(mv);const o=ku(r,e.config.apiKey,e.name);let l=null;for(const h of n)try{const m=await h._get(o);if(m){const v=Or._fromJSON(e,m);h!==s&&(l=v),s=h;break}}catch{}const u=i.filter(h=>h._shouldAllowMigration);return!s._shouldAllowMigration||!u.length?new Mo(s,e,r):(s=u[0],l&&await s._set(o,l.toJSON()),await Promise.all(n.map(async h=>{if(h!==s)try{await h._remove(o)}catch{}})),new Mo(s,e,r))}}/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/function gv(t){const e=t.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(hx(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(cx(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(px(e))return"Blackberry";if(mx(e))return"Webos";if(ux(e))return"Safari";if((e.includes("chrome/")||dx(e))&&!e.includes("edge/"))return"Chrome";if(fx(e))return"Android";{const n=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,r=t.match(n);if((r==null?void 0:r.length)===2)return r[1]}return"Other"}function cx(t=Ut()){return/firefox\//i.test(t)}function ux(t=Ut()){const e=t.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function dx(t=Ut()){return/crios\//i.test(t)}function hx(t=Ut()){return/iemobile/i.test(t)}function fx(t=Ut()){return/android/i.test(t)}function px(t=Ut()){return/blackberry/i.test(t)}function mx(t=Ut()){return/webos/i.test(t)}function Rm(t=Ut()){return/iphone|ipad|ipod/i.test(t)||/macintosh/i.test(t)&&/mobile/i.test(t)}function dI(t=Ut()){var e;return Rm(t)&&!!(!((e=window.navigator)===null||e===void 0)&&e.standalone)}function hI(){return Nb()&&document.documentMode===10}function gx(t=Ut()){return Rm(t)||fx(t)||mx(t)||px(t)||/windows phone/i.test(t)||hx(t)}/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/function yx(t,e=[]){let n;switch(t){case"Browser":n=gv(Ut());break;case"Worker":n=`${gv(Ut())}-${t}`;break;default:n=t}const r=e.length?e.join(","):"FirebaseCore-web";return`${n}/JsCore/${ia}/${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 fI{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,n){const r=s=>new Promise((o,l)=>{try{const u=e(s);o(u)}catch(u){l(u)}});r.onAbort=n,this.queue.push(r);const i=this.queue.length-1;return()=>{this.queue[i]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;const n=[];try{for(const r of this.queue)await r(e),r.onAbort&&n.push(r.onAbort)}catch(r){n.reverse();for(const i of n)try{i()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:r==null?void 0:r.message})}}}/**
|
|
* @license
|
|
* Copyright 2023 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/async function pI(t,e={}){return Jr(t,"GET","/v2/passwordPolicy",Yr(t,e))}/**
|
|
* @license
|
|
* Copyright 2023 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/const mI=6;class gI{constructor(e){var n,r,i,s;const o=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=(n=o.minPasswordLength)!==null&&n!==void 0?n:mI,o.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=o.maxPasswordLength),o.containsLowercaseCharacter!==void 0&&(this.customStrengthOptions.containsLowercaseLetter=o.containsLowercaseCharacter),o.containsUppercaseCharacter!==void 0&&(this.customStrengthOptions.containsUppercaseLetter=o.containsUppercaseCharacter),o.containsNumericCharacter!==void 0&&(this.customStrengthOptions.containsNumericCharacter=o.containsNumericCharacter),o.containsNonAlphanumericCharacter!==void 0&&(this.customStrengthOptions.containsNonAlphanumericCharacter=o.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,this.enforcementState==="ENFORCEMENT_STATE_UNSPECIFIED"&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=(i=(r=e.allowedNonAlphanumericCharacters)===null||r===void 0?void 0:r.join(""))!==null&&i!==void 0?i:"",this.forceUpgradeOnSignin=(s=e.forceUpgradeOnSignin)!==null&&s!==void 0?s:!1,this.schemaVersion=e.schemaVersion}validatePassword(e){var n,r,i,s,o,l;const u={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,u),this.validatePasswordCharacterOptions(e,u),u.isValid&&(u.isValid=(n=u.meetsMinPasswordLength)!==null&&n!==void 0?n:!0),u.isValid&&(u.isValid=(r=u.meetsMaxPasswordLength)!==null&&r!==void 0?r:!0),u.isValid&&(u.isValid=(i=u.containsLowercaseLetter)!==null&&i!==void 0?i:!0),u.isValid&&(u.isValid=(s=u.containsUppercaseLetter)!==null&&s!==void 0?s:!0),u.isValid&&(u.isValid=(o=u.containsNumericCharacter)!==null&&o!==void 0?o:!0),u.isValid&&(u.isValid=(l=u.containsNonAlphanumericCharacter)!==null&&l!==void 0?l:!0),u}validatePasswordLengthOptions(e,n){const r=this.customStrengthOptions.minPasswordLength,i=this.customStrengthOptions.maxPasswordLength;r&&(n.meetsMinPasswordLength=e.length>=r),i&&(n.meetsMaxPasswordLength=e.length<=i)}validatePasswordCharacterOptions(e,n){this.updatePasswordCharacterOptionsStatuses(n,!1,!1,!1,!1);let r;for(let i=0;i<e.length;i++)r=e.charAt(i),this.updatePasswordCharacterOptionsStatuses(n,r>="a"&&r<="z",r>="A"&&r<="Z",r>="0"&&r<="9",this.allowedNonAlphanumericCharacters.includes(r))}updatePasswordCharacterOptionsStatuses(e,n,r,i,s){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=n)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=r)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=i)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=s))}}/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class yI{constructor(e,n,r,i){this.app=e,this.heartbeatServiceProvider=n,this.appCheckServiceProvider=r,this.config=i,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new yv(this),this.idTokenSubscription=new yv(this),this.beforeStateQueue=new fI(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=tx,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=i.sdkClientVersion}_initializeWithPersistence(e,n){return n&&(this._popupRedirectResolver=Lr(n)),this._initializationPromise=this.queue(async()=>{var r,i;if(!this._deleted&&(this.persistenceManager=await Mo.create(this,e),!this._deleted)){if(!((r=this._popupRedirectResolver)===null||r===void 0)&&r._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(n),this.lastNotifiedUid=((i=this.currentUser)===null||i===void 0?void 0:i.uid)||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const e=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!e)){if(this.currentUser&&e&&this.currentUser.uid===e.uid){this._currentUser._assign(e),await this.currentUser.getIdToken();return}await this._updateCurrentUser(e,!0)}}async initializeCurrentUserFromIdToken(e){try{const n=await ox(this,{idToken:e}),r=await Or._fromGetAccountInfoResponse(this,n,e);await this.directlySetCurrentUser(r)}catch(n){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",n),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){var n;if(rr(this.app)){const o=this.app.settings.authIdToken;return o?new Promise(l=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(o).then(l,l))}):this.directlySetCurrentUser(null)}const r=await this.assertedPersistence.getCurrentUser();let i=r,s=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const o=(n=this.redirectUser)===null||n===void 0?void 0:n._redirectEventId,l=i==null?void 0:i._redirectEventId,u=await this.tryRedirectSignIn(e);(!o||o===l)&&(u!=null&&u.user)&&(i=u.user,s=!0)}if(!i)return this.directlySetCurrentUser(null);if(!i._redirectEventId){if(s)try{await this.beforeStateQueue.runMiddleware(i)}catch(o){i=r,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(o))}return i?this.reloadAndSetCurrentUserOrClear(i):this.directlySetCurrentUser(null)}return le(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===i._redirectEventId?this.directlySetCurrentUser(i):this.reloadAndSetCurrentUserOrClear(i)}async tryRedirectSignIn(e){let n=null;try{n=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch{await this._setRedirectUser(null)}return n}async reloadAndSetCurrentUserOrClear(e){try{await sd(e)}catch(n){if((n==null?void 0:n.code)!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=YS()}async _delete(){this._deleted=!0}async updateCurrentUser(e){if(rr(this.app))return Promise.reject(Fr(this));const n=e?qe(e):null;return n&&le(n.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(n&&n._clone(this))}async _updateCurrentUser(e,n=!1){if(!this._deleted)return e&&le(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),n||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return rr(this.app)?Promise.reject(Fr(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return rr(this.app)?Promise.reject(Fr(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(Lr(e))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const n=this._getPasswordPolicyInternal();return n.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):n.validatePassword(e)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const e=await pI(this),n=new gI(e);this.tenantId===null?this._projectPasswordPolicy=n:this._tenantPasswordPolicies[this.tenantId]=n}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(e){this._errorFactory=new Rs("auth","Firebase",e())}onAuthStateChanged(e,n,r){return this.registerStateListener(this.authStateSubscription,e,n,r)}beforeAuthStateChanged(e,n){return this.beforeStateQueue.pushCallback(e,n)}onIdTokenChanged(e,n,r){return this.registerStateListener(this.idTokenSubscription,e,n,r)}authStateReady(){return new Promise((e,n)=>{if(this.currentUser)e();else{const r=this.onAuthStateChanged(()=>{r(),e()},n)}})}async revokeAccessToken(e){if(this.currentUser){const n=await this.currentUser.getIdToken(),r={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:n};this.tenantId!=null&&(r.tenantId=this.tenantId),await uI(this,r)}}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(e=this._currentUser)===null||e===void 0?void 0:e.toJSON()}}async _setRedirectUser(e,n){const r=await this.getOrInitRedirectPersistenceManager(n);return e===null?r.removeCurrentUser():r.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const n=e&&Lr(e)||this._popupRedirectResolver;le(n,this,"argument-error"),this.redirectPersistenceManager=await Mo.create(this,[Lr(n._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var n,r;return this._isInitialized&&await this.queue(async()=>{}),((n=this._currentUser)===null||n===void 0?void 0:n._redirectEventId)===e?this._currentUser:((r=this.redirectUser)===null||r===void 0?void 0:r._redirectEventId)===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(e))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var e,n;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const r=(n=(e=this.currentUser)===null||e===void 0?void 0:e.uid)!==null&&n!==void 0?n:null;this.lastNotifiedUid!==r&&(this.lastNotifiedUid=r,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,n,r,i){if(this._deleted)return()=>{};const s=typeof n=="function"?n:n.next.bind(n);let o=!1;const l=this._isInitialized?Promise.resolve():this._initializationPromise;if(le(l,this,"internal-error"),l.then(()=>{o||s(this.currentUser)}),typeof n=="function"){const u=e.addObserver(n,r,i);return()=>{o=!0,u()}}else{const u=e.addObserver(n);return()=>{o=!0,u()}}}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 le(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=yx(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var e;const n={"X-Client-Version":this.clientVersion};this.app.options.appId&&(n["X-Firebase-gmpid"]=this.app.options.appId);const r=await((e=this.heartbeatServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getHeartbeatsHeader());r&&(n["X-Firebase-Client"]=r);const i=await this._getAppCheckToken();return i&&(n["X-Firebase-AppCheck"]=i),n}async _getAppCheckToken(){var e;const n=await((e=this.appCheckServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getToken());return n!=null&&n.error&&KS(`Error while retrieving App Check token: ${n.error}`),n==null?void 0:n.token}}function Ui(t){return qe(t)}class yv{constructor(e){this.auth=e,this.observer=null,this.addObserver=Mb(n=>this.observer=n)}get next(){return le(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 Fd={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function vI(t){Fd=t}function vx(t){return Fd.loadJS(t)}function wI(){return Fd.recaptchaEnterpriseScript}function _I(){return Fd.gapiScript}function xI(t){return`__${t}${Math.floor(Math.random()*1e6)}`}const EI="recaptcha-enterprise",kI="NO_RECAPTCHA";class TI{constructor(e){this.type=EI,this.auth=Ui(e)}async verify(e="verify",n=!1){async function r(s){if(!n){if(s.tenantId==null&&s._agentRecaptchaConfig!=null)return s._agentRecaptchaConfig.siteKey;if(s.tenantId!=null&&s._tenantRecaptchaConfigs[s.tenantId]!==void 0)return s._tenantRecaptchaConfigs[s.tenantId].siteKey}return new Promise(async(o,l)=>{nI(s,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(u=>{if(u.recaptchaKey===void 0)l(new Error("recaptcha Enterprise site key undefined"));else{const h=new tI(u);return s.tenantId==null?s._agentRecaptchaConfig=h:s._tenantRecaptchaConfigs[s.tenantId]=h,o(h.siteKey)}}).catch(u=>{l(u)})})}function i(s,o,l){const u=window.grecaptcha;hv(u)?u.enterprise.ready(()=>{u.enterprise.execute(s,{action:e}).then(h=>{o(h)}).catch(()=>{o(kI)})}):l(Error("No reCAPTCHA enterprise script loaded."))}return new Promise((s,o)=>{r(this.auth).then(l=>{if(!n&&hv(window.grecaptcha))i(l,s,o);else{if(typeof window>"u"){o(new Error("RecaptchaVerifier is only supported in browser"));return}let u=wI();u.length!==0&&(u+=l),vx(u).then(()=>{i(l,s,o)}).catch(h=>{o(h)})}}).catch(l=>{o(l)})})}}async function vv(t,e,n,r=!1){const i=new TI(t);let s;try{s=await i.verify(n)}catch{s=await i.verify(n,!0)}const o=Object.assign({},e);return r?Object.assign(o,{captchaResp:s}):Object.assign(o,{captchaResponse:s}),Object.assign(o,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(o,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),o}async function od(t,e,n,r){var i;if(!((i=t._getRecaptchaConfig())===null||i===void 0)&&i.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")){const s=await vv(t,e,n,n==="getOobCode");return r(t,s)}else return r(t,e).catch(async s=>{if(s.code==="auth/missing-recaptcha-token"){console.log(`${n} is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow.`);const o=await vv(t,e,n,n==="getOobCode");return r(t,o)}else return Promise.reject(s)})}/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/function bI(t,e){const n=ra(t,"auth");if(n.isInitialized()){const i=n.getImmediate(),s=n.getOptions();if(nd(s,e??{}))return i;zn(i,"already-initialized")}return n.initialize({options:e})}function SI(t,e){const n=(e==null?void 0:e.persistence)||[],r=(Array.isArray(n)?n:[n]).map(Lr);e!=null&&e.errorMap&&t._updateErrorMap(e.errorMap),t._initializeWithPersistence(r,e==null?void 0:e.popupRedirectResolver)}function II(t,e,n){const r=Ui(t);le(r._canInitEmulator,r,"emulator-config-failed"),le(/^https?:\/\//.test(e),r,"invalid-emulator-scheme");const i=!1,s=wx(e),{host:o,port:l}=CI(e),u=l===null?"":`:${l}`;r.config.emulator={url:`${s}//${o}${u}/`},r.settings.appVerificationDisabledForTesting=!0,r.emulatorConfig=Object.freeze({host:o,port:l,protocol:s.replace(":",""),options:Object.freeze({disableWarnings:i})}),AI()}function wx(t){const e=t.indexOf(":");return e<0?"":t.substr(0,e+1)}function CI(t){const e=wx(t),n=/(\/\/)?([^?#/]+)/.exec(t.substr(e.length));if(!n)return{host:"",port:null};const r=n[2].split("@").pop()||"",i=/^(\[[^\]]+\])(:|$)/.exec(r);if(i){const s=i[1];return{host:s,port:wv(r.substr(s.length+1))}}else{const[s,o]=r.split(":");return{host:s,port:wv(o)}}}function wv(t){if(!t)return null;const e=Number(t);return isNaN(e)?null:e}function AI(){function t(){const e=document.createElement("p"),n=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",n.position="fixed",n.width="100%",n.backgroundColor="#ffffff",n.border=".1em solid #000000",n.color="#b50000",n.bottom="0px",n.left="0px",n.margin="0px",n.zIndex="10000",n.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",t):t())}/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class Dm{constructor(e,n){this.providerId=e,this.signInMethod=n}toJSON(){return jr("not implemented")}_getIdTokenResponse(e){return jr("not implemented")}_linkToIdToken(e,n){return jr("not implemented")}_getReauthenticationResolver(e){return jr("not implemented")}}async function NI(t,e){return Jr(t,"POST","/v1/accounts:signUp",e)}/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/async function PI(t,e){return ec(t,"POST","/v1/accounts:signInWithPassword",Yr(t,e))}async function RI(t,e){return Jr(t,"POST","/v1/accounts:sendOobCode",Yr(t,e))}async function DI(t,e){return RI(t,e)}/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/async function jI(t,e){return ec(t,"POST","/v1/accounts:signInWithEmailLink",Yr(t,e))}async function OI(t,e){return ec(t,"POST","/v1/accounts:signInWithEmailLink",Yr(t,e))}/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class Vl extends Dm{constructor(e,n,r,i=null){super("password",r),this._email=e,this._password=n,this._tenantId=i}static _fromEmailAndPassword(e,n){return new Vl(e,n,"password")}static _fromEmailAndCode(e,n,r=null){return new Vl(e,n,"emailLink",r)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){const n=typeof e=="string"?JSON.parse(e):e;if(n!=null&&n.email&&(n!=null&&n.password)){if(n.signInMethod==="password")return this._fromEmailAndPassword(n.email,n.password);if(n.signInMethod==="emailLink")return this._fromEmailAndCode(n.email,n.password,n.tenantId)}return null}async _getIdTokenResponse(e){switch(this.signInMethod){case"password":const n={returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return od(e,n,"signInWithPassword",PI);case"emailLink":return jI(e,{email:this._email,oobCode:this._password});default:zn(e,"internal-error")}}async _linkToIdToken(e,n){switch(this.signInMethod){case"password":const r={idToken:n,returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return od(e,r,"signUpPassword",NI);case"emailLink":return OI(e,{idToken:n,email:this._email,oobCode:this._password});default:zn(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/async function Vo(t,e){return ec(t,"POST","/v1/accounts:signInWithIdp",Yr(t,e))}/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/const LI="http://localhost";class ks extends Dm{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const n=new ks(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(n.idToken=e.idToken),e.accessToken&&(n.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(n.nonce=e.nonce),e.pendingToken&&(n.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(n.accessToken=e.oauthToken,n.secret=e.oauthTokenSecret):zn("argument-error"),n}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){const n=typeof e=="string"?JSON.parse(e):e,{providerId:r,signInMethod:i}=n,s=Cm(n,["providerId","signInMethod"]);if(!r||!i)return null;const o=new ks(r,i);return o.idToken=s.idToken||void 0,o.accessToken=s.accessToken||void 0,o.secret=s.secret,o.nonce=s.nonce,o.pendingToken=s.pendingToken||null,o}_getIdTokenResponse(e){const n=this.buildRequest();return Vo(e,n)}_linkToIdToken(e,n){const r=this.buildRequest();return r.idToken=n,Vo(e,r)}_getReauthenticationResolver(e){const n=this.buildRequest();return n.autoCreate=!1,Vo(e,n)}buildRequest(){const e={requestUri:LI,returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const n={};this.idToken&&(n.id_token=this.idToken),this.accessToken&&(n.access_token=this.accessToken),this.secret&&(n.oauth_token_secret=this.secret),n.providerId=this.providerId,this.nonce&&!this.pendingToken&&(n.nonce=this.nonce),e.postBody=Xl(n)}return e}}/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/function MI(t){switch(t){case"recoverEmail":return"RECOVER_EMAIL";case"resetPassword":return"PASSWORD_RESET";case"signIn":return"EMAIL_SIGNIN";case"verifyEmail":return"VERIFY_EMAIL";case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL";case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION";default:return null}}function VI(t){const e=Za(el(t)).link,n=e?Za(el(e)).deep_link_id:null,r=Za(el(t)).deep_link_id;return(r?Za(el(r)).link:null)||r||n||e||t}class jm{constructor(e){var n,r,i,s,o,l;const u=Za(el(e)),h=(n=u.apiKey)!==null&&n!==void 0?n:null,m=(r=u.oobCode)!==null&&r!==void 0?r:null,v=MI((i=u.mode)!==null&&i!==void 0?i:null);le(h&&m&&v,"argument-error"),this.apiKey=h,this.operation=v,this.code=m,this.continueUrl=(s=u.continueUrl)!==null&&s!==void 0?s:null,this.languageCode=(o=u.languageCode)!==null&&o!==void 0?o:null,this.tenantId=(l=u.tenantId)!==null&&l!==void 0?l:null}static parseLink(e){const n=VI(e);try{return new jm(n)}catch{return null}}}/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class sa{constructor(){this.providerId=sa.PROVIDER_ID}static credential(e,n){return Vl._fromEmailAndPassword(e,n)}static credentialWithLink(e,n){const r=jm.parseLink(n);return le(r,"argument-error"),Vl._fromEmailAndCode(e,r.code,r.tenantId)}}sa.PROVIDER_ID="password";sa.EMAIL_PASSWORD_SIGN_IN_METHOD="password";sa.EMAIL_LINK_SIGN_IN_METHOD="emailLink";/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class _x{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 tc extends _x{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 mi extends tc{constructor(){super("facebook.com")}static credential(e){return ks._fromParams({providerId:mi.PROVIDER_ID,signInMethod:mi.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return mi.credentialFromTaggedObject(e)}static credentialFromError(e){return mi.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return mi.credential(e.oauthAccessToken)}catch{return null}}}mi.FACEBOOK_SIGN_IN_METHOD="facebook.com";mi.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 gi extends tc{constructor(){super("google.com"),this.addScope("profile")}static credential(e,n){return ks._fromParams({providerId:gi.PROVIDER_ID,signInMethod:gi.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:n})}static credentialFromResult(e){return gi.credentialFromTaggedObject(e)}static credentialFromError(e){return gi.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:n,oauthAccessToken:r}=e;if(!n&&!r)return null;try{return gi.credential(n,r)}catch{return null}}}gi.GOOGLE_SIGN_IN_METHOD="google.com";gi.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 yi extends tc{constructor(){super("github.com")}static credential(e){return ks._fromParams({providerId:yi.PROVIDER_ID,signInMethod:yi.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return yi.credentialFromTaggedObject(e)}static credentialFromError(e){return yi.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return yi.credential(e.oauthAccessToken)}catch{return null}}}yi.GITHUB_SIGN_IN_METHOD="github.com";yi.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 vi extends tc{constructor(){super("twitter.com")}static credential(e,n){return ks._fromParams({providerId:vi.PROVIDER_ID,signInMethod:vi.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:n})}static credentialFromResult(e){return vi.credentialFromTaggedObject(e)}static credentialFromError(e){return vi.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthAccessToken:n,oauthTokenSecret:r}=e;if(!n||!r)return null;try{return vi.credential(n,r)}catch{return null}}}vi.TWITTER_SIGN_IN_METHOD="twitter.com";vi.PROVIDER_ID="twitter.com";/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/async function FI(t,e){return ec(t,"POST","/v1/accounts:signUp",Yr(t,e))}/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class Ts{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,n,r,i=!1){const s=await Or._fromIdTokenResponse(e,r,i),o=_v(r);return new Ts({user:s,providerId:o,_tokenResponse:r,operationType:n})}static async _forOperation(e,n,r){await e._updateTokensIfNecessary(r,!0);const i=_v(r);return new Ts({user:e,providerId:i,_tokenResponse:r,operationType:n})}}function _v(t){return t.providerId?t.providerId:"phoneNumber"in t?"phone":null}/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class ad extends fr{constructor(e,n,r,i){var s;super(n.code,n.message),this.operationType=r,this.user=i,Object.setPrototypeOf(this,ad.prototype),this.customData={appName:e.name,tenantId:(s=e.tenantId)!==null&&s!==void 0?s:void 0,_serverResponse:n.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(e,n,r,i){return new ad(e,n,r,i)}}function xx(t,e,n,r){return(e==="reauthenticate"?n._getReauthenticationResolver(t):n._getIdTokenResponse(t)).catch(s=>{throw s.code==="auth/multi-factor-auth-required"?ad._fromErrorAndOperation(t,s,e,r):s})}async function UI(t,e,n=!1){const r=await Ml(t,e._linkToIdToken(t.auth,await t.getIdToken()),n);return Ts._forOperation(t,"link",r)}/**
|
|
* @license
|
|
* Copyright 2019 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/async function zI(t,e,n=!1){const{auth:r}=t;if(rr(r.app))return Promise.reject(Fr(r));const i="reauthenticate";try{const s=await Ml(t,xx(r,i,e,t),n);le(s.idToken,r,"internal-error");const o=Pm(s.idToken);le(o,r,"internal-error");const{sub:l}=o;return le(t.uid===l,r,"user-mismatch"),Ts._forOperation(t,i,s)}catch(s){throw(s==null?void 0:s.code)==="auth/user-not-found"&&zn(r,"user-mismatch"),s}}/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/async function Ex(t,e,n=!1){if(rr(t.app))return Promise.reject(Fr(t));const r="signIn",i=await xx(t,r,e),s=await Ts._fromIdTokenResponse(t,r,i);return n||await t._updateCurrentUser(s.user),s}async function BI(t,e){return Ex(Ui(t),e)}/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/async function kx(t){const e=Ui(t);e._getPasswordPolicyInternal()&&await e._updatePasswordPolicy()}async function $I(t,e,n){const r=Ui(t);await od(r,{requestType:"PASSWORD_RESET",email:e,clientType:"CLIENT_TYPE_WEB"},"getOobCode",DI)}async function qI(t,e,n){if(rr(t.app))return Promise.reject(Fr(t));const r=Ui(t),o=await od(r,{returnSecureToken:!0,email:e,password:n,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",FI).catch(u=>{throw u.code==="auth/password-does-not-meet-requirements"&&kx(t),u}),l=await Ts._fromIdTokenResponse(r,"signIn",o);return await r._updateCurrentUser(l.user),l}function WI(t,e,n){return rr(t.app)?Promise.reject(Fr(t)):BI(qe(t),sa.credential(e,n)).catch(async r=>{throw r.code==="auth/password-does-not-meet-requirements"&&kx(t),r})}function HI(t,e,n,r){return qe(t).onIdTokenChanged(e,n,r)}function KI(t,e,n){return qe(t).beforeAuthStateChanged(e,n)}function GI(t,e,n,r){return qe(t).onAuthStateChanged(e,n,r)}function QI(t){return qe(t).signOut()}const ld="__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 Tx{constructor(e,n){this.storageRetriever=e,this.type=n}_isAvailable(){try{return this.storage?(this.storage.setItem(ld,"1"),this.storage.removeItem(ld),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(e,n){return this.storage.setItem(e,JSON.stringify(n)),Promise.resolve()}_get(e){const n=this.storage.getItem(e);return Promise.resolve(n?JSON.parse(n):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/const YI=1e3,JI=10;class bx extends Tx{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,n)=>this.onStorageEvent(e,n),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=gx(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const n of Object.keys(this.listeners)){const r=this.storage.getItem(n),i=this.localCache[n];r!==i&&e(n,i,r)}}onStorageEvent(e,n=!1){if(!e.key){this.forAllChangedKeys((o,l,u)=>{this.notifyListeners(o,u)});return}const r=e.key;n?this.detachListener():this.stopPolling();const i=()=>{const o=this.storage.getItem(r);!n&&this.localCache[r]===o||this.notifyListeners(r,o)},s=this.storage.getItem(r);hI()&&s!==e.newValue&&e.newValue!==e.oldValue?setTimeout(i,JI):i()}notifyListeners(e,n){this.localCache[e]=n;const r=this.listeners[e];if(r)for(const i of Array.from(r))i(n&&JSON.parse(n))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,n,r)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:n,newValue:r}),!0)})},YI)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,n){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(n)}_removeListener(e,n){this.listeners[e]&&(this.listeners[e].delete(n),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(e,n){await super._set(e,n),this.localCache[e]=JSON.stringify(n)}async _get(e){const n=await super._get(e);return this.localCache[e]=JSON.stringify(n),n}async _remove(e){await super._remove(e),delete this.localCache[e]}}bx.type="LOCAL";const XI=bx;/**
|
|
* @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 Sx extends Tx{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,n){}_removeListener(e,n){}}Sx.type="SESSION";const Ix=Sx;/**
|
|
* @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 ZI(t){return Promise.all(t.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(n){return{fulfilled:!1,reason:n}}}))}/**
|
|
* @license
|
|
* Copyright 2019 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class Ud{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const n=this.receivers.find(i=>i.isListeningto(e));if(n)return n;const r=new Ud(e);return this.receivers.push(r),r}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const n=e,{eventId:r,eventType:i,data:s}=n.data,o=this.handlersMap[i];if(!(o!=null&&o.size))return;n.ports[0].postMessage({status:"ack",eventId:r,eventType:i});const l=Array.from(o).map(async h=>h(n.origin,s)),u=await ZI(l);n.ports[0].postMessage({status:"done",eventId:r,eventType:i,response:u})}_subscribe(e,n){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(n)}_unsubscribe(e,n){this.handlersMap[e]&&n&&this.handlersMap[e].delete(n),(!n||this.handlersMap[e].size===0)&&delete this.handlersMap[e],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}Ud.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 Om(t="",e=10){let n="";for(let r=0;r<e;r++)n+=Math.floor(Math.random()*10);return t+n}/**
|
|
* @license
|
|
* Copyright 2019 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class eC{constructor(e){this.target=e,this.handlers=new Set}removeMessageHandler(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}async _send(e,n,r=50){const i=typeof MessageChannel<"u"?new MessageChannel:null;if(!i)throw new Error("connection_unavailable");let s,o;return new Promise((l,u)=>{const h=Om("",20);i.port1.start();const m=setTimeout(()=>{u(new Error("unsupported_event"))},r);o={messageChannel:i,onMessage(v){const g=v;if(g.data.eventId===h)switch(g.data.status){case"ack":clearTimeout(m),s=setTimeout(()=>{u(new Error("timeout"))},3e3);break;case"done":clearTimeout(s),l(g.data.response);break;default:clearTimeout(m),clearTimeout(s),u(new Error("invalid_response"));break}}},this.handlers.add(o),i.port1.addEventListener("message",o.onMessage),this.target.postMessage({eventType:e,eventId:h,data:n},[i.port2])}).finally(()=>{o&&this.removeMessageHandler(o)})}}/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/function ar(){return window}function tC(t){ar().location.href=t}/**
|
|
* @license
|
|
* Copyright 2020 Google LLC.
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/function Cx(){return typeof ar().WorkerGlobalScope<"u"&&typeof ar().importScripts=="function"}async function nC(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function rC(){var t;return((t=navigator==null?void 0:navigator.serviceWorker)===null||t===void 0?void 0:t.controller)||null}function iC(){return Cx()?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 Ax="firebaseLocalStorageDb",sC=1,cd="firebaseLocalStorage",Nx="fbase_key";class nc{constructor(e){this.request=e}toPromise(){return new Promise((e,n)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{n(this.request.error)})})}}function zd(t,e){return t.transaction([cd],e?"readwrite":"readonly").objectStore(cd)}function oC(){const t=indexedDB.deleteDatabase(Ax);return new nc(t).toPromise()}function fp(){const t=indexedDB.open(Ax,sC);return new Promise((e,n)=>{t.addEventListener("error",()=>{n(t.error)}),t.addEventListener("upgradeneeded",()=>{const r=t.result;try{r.createObjectStore(cd,{keyPath:Nx})}catch(i){n(i)}}),t.addEventListener("success",async()=>{const r=t.result;r.objectStoreNames.contains(cd)?e(r):(r.close(),await oC(),e(await fp()))})})}async function xv(t,e,n){const r=zd(t,!0).put({[Nx]:e,value:n});return new nc(r).toPromise()}async function aC(t,e){const n=zd(t,!1).get(e),r=await new nc(n).toPromise();return r===void 0?null:r.value}function Ev(t,e){const n=zd(t,!0).delete(e);return new nc(n).toPromise()}const lC=800,cC=3;class Px{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 fp(),this.db)}async _withRetries(e){let n=0;for(;;)try{const r=await this._openDb();return await e(r)}catch(r){if(n++>cC)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return Cx()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=Ud._getInstance(iC()),this.receiver._subscribe("keyChanged",async(e,n)=>({keyProcessed:(await this._poll()).includes(n.key)})),this.receiver._subscribe("ping",async(e,n)=>["keyChanged"])}async initializeSender(){var e,n;if(this.activeServiceWorker=await nC(),!this.activeServiceWorker)return;this.sender=new eC(this.activeServiceWorker);const r=await this.sender._send("ping",{},800);r&&!((e=r[0])===null||e===void 0)&&e.fulfilled&&!((n=r[0])===null||n===void 0)&&n.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(!(!this.sender||!this.activeServiceWorker||rC()!==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 fp();return await xv(e,ld,"1"),await Ev(e,ld),!0}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,n){return this._withPendingWrite(async()=>(await this._withRetries(r=>xv(r,e,n)),this.localCache[e]=n,this.notifyServiceWorker(e)))}async _get(e){const n=await this._withRetries(r=>aC(r,e));return this.localCache[e]=n,n}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(n=>Ev(n,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){const e=await this._withRetries(i=>{const s=zd(i,!1).getAll();return new nc(s).toPromise()});if(!e)return[];if(this.pendingWrites!==0)return[];const n=[],r=new Set;if(e.length!==0)for(const{fbase_key:i,value:s}of e)r.add(i),JSON.stringify(this.localCache[i])!==JSON.stringify(s)&&(this.notifyListeners(i,s),n.push(i));for(const i of Object.keys(this.localCache))this.localCache[i]&&!r.has(i)&&(this.notifyListeners(i,null),n.push(i));return n}notifyListeners(e,n){this.localCache[e]=n;const r=this.listeners[e];if(r)for(const i of Array.from(r))i(n)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),lC)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,n){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(n)}_removeListener(e,n){this.listeners[e]&&(this.listeners[e].delete(n),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&this.stopPolling()}}Px.type="LOCAL";const uC=Px;new Zl(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 dC(t,e){return e?Lr(e):(le(t._popupRedirectResolver,t,"argument-error"),t._popupRedirectResolver)}/**
|
|
* @license
|
|
* Copyright 2019 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class Lm extends Dm{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return Vo(e,this._buildIdpRequest())}_linkToIdToken(e,n){return Vo(e,this._buildIdpRequest(n))}_getReauthenticationResolver(e){return Vo(e,this._buildIdpRequest())}_buildIdpRequest(e){const n={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(n.idToken=e),n}}function hC(t){return Ex(t.auth,new Lm(t),t.bypassAuthState)}function fC(t){const{auth:e,user:n}=t;return le(n,e,"internal-error"),zI(n,new Lm(t),t.bypassAuthState)}async function pC(t){const{auth:e,user:n}=t;return le(n,e,"internal-error"),UI(n,new Lm(t),t.bypassAuthState)}/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class Rx{constructor(e,n,r,i,s=!1){this.auth=e,this.resolver=r,this.user=i,this.bypassAuthState=s,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(n)?n:[n]}execute(){return new Promise(async(e,n)=>{this.pendingPromise={resolve:e,reject:n};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(r){this.reject(r)}})}async onAuthEvent(e){const{urlResponse:n,sessionId:r,postBody:i,tenantId:s,error:o,type:l}=e;if(o){this.reject(o);return}const u={auth:this.auth,requestUri:n,sessionId:r,tenantId:s||void 0,postBody:i||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(l)(u))}catch(h){this.reject(h)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return hC;case"linkViaPopup":case"linkViaRedirect":return pC;case"reauthViaPopup":case"reauthViaRedirect":return fC;default:zn(this.auth,"internal-error")}}resolve(e){Hr(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){Hr(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 mC=new Zl(2e3,1e4);class Ao extends Rx{constructor(e,n,r,i,s){super(e,n,i,s),this.provider=r,this.authWindow=null,this.pollId=null,Ao.currentPopupAction&&Ao.currentPopupAction.cancel(),Ao.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return le(e,this.auth,"internal-error"),e}async onExecution(){Hr(this.filter.length===1,"Popup operations only handle one event");const e=Om();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(n=>{this.reject(n)}),this.resolver._isIframeWebStorageSupported(this.auth,n=>{n||this.reject(or(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var e;return((e=this.authWindow)===null||e===void 0?void 0:e.associatedEvent)||null}cancel(){this.reject(or(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,Ao.currentPopupAction=null}pollUserCancellation(){const e=()=>{var n,r;if(!((r=(n=this.authWindow)===null||n===void 0?void 0:n.window)===null||r===void 0)&&r.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(or(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(e,mC.get())};e()}}Ao.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 gC="pendingRedirect",Tu=new Map;class yC extends Rx{constructor(e,n,r=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],n,void 0,r),this.eventId=null}async execute(){let e=Tu.get(this.auth._key());if(!e){try{const r=await vC(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(r)}catch(n){e=()=>Promise.reject(n)}Tu.set(this.auth._key(),e)}return this.bypassAuthState||Tu.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if(e.type==="signInViaRedirect")return super.onAuthEvent(e);if(e.type==="unknown"){this.resolve(null);return}if(e.eventId){const n=await this.auth._redirectUserForId(e.eventId);if(n)return this.user=n,super.onAuthEvent(e);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function vC(t,e){const n=xC(e),r=_C(t);if(!await r._isAvailable())return!1;const i=await r._get(n)==="true";return await r._remove(n),i}function wC(t,e){Tu.set(t._key(),e)}function _C(t){return Lr(t._redirectPersistence)}function xC(t){return ku(gC,t.config.apiKey,t.name)}async function EC(t,e,n=!1){if(rr(t.app))return Promise.reject(Fr(t));const r=Ui(t),i=dC(r,e),o=await new yC(r,i,n).execute();return o&&!n&&(delete o.user._redirectEventId,await r._persistUserIfCurrent(o.user),await r._setRedirectUser(null,e)),o}/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/const kC=10*60*1e3;class TC{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let n=!1;return this.consumers.forEach(r=>{this.isEventForConsumer(e,r)&&(n=!0,this.sendToConsumer(e,r),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!bC(e)||(this.hasHandledPotentialRedirect=!0,n||(this.queuedRedirectEvent=e,n=!0)),n}sendToConsumer(e,n){var r;if(e.error&&!Dx(e)){const i=((r=e.error.code)===null||r===void 0?void 0:r.split("auth/")[1])||"internal-error";n.onError(or(this.auth,i))}else n.onAuthEvent(e)}isEventForConsumer(e,n){const r=n.eventId===null||!!e.eventId&&e.eventId===n.eventId;return n.filter.includes(e.type)&&r}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=kC&&this.cachedEventUids.clear(),this.cachedEventUids.has(kv(e))}saveEventToCache(e){this.cachedEventUids.add(kv(e)),this.lastProcessedEventTime=Date.now()}}function kv(t){return[t.type,t.eventId,t.sessionId,t.tenantId].filter(e=>e).join("-")}function Dx({type:t,error:e}){return t==="unknown"&&(e==null?void 0:e.code)==="auth/no-auth-event"}function bC(t){switch(t.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return Dx(t);default:return!1}}/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/async function SC(t,e={}){return Jr(t,"GET","/v1/projects",e)}/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/const IC=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,CC=/^https?/;async function AC(t){if(t.config.emulator)return;const{authorizedDomains:e}=await SC(t);for(const n of e)try{if(NC(n))return}catch{}zn(t,"unauthorized-domain")}function NC(t){const e=dp(),{protocol:n,hostname:r}=new URL(e);if(t.startsWith("chrome-extension://")){const o=new URL(t);return o.hostname===""&&r===""?n==="chrome-extension:"&&t.replace("chrome-extension://","")===e.replace("chrome-extension://",""):n==="chrome-extension:"&&o.hostname===r}if(!CC.test(n))return!1;if(IC.test(t))return r===t;const i=t.replace(/\./g,"\\.");return new RegExp("^(.+\\."+i+"|"+i+")$","i").test(r)}/**
|
|
* @license
|
|
* Copyright 2020 Google LLC.
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/const PC=new Zl(3e4,6e4);function Tv(){const t=ar().___jsl;if(t!=null&&t.H){for(const e of Object.keys(t.H))if(t.H[e].r=t.H[e].r||[],t.H[e].L=t.H[e].L||[],t.H[e].r=[...t.H[e].L],t.CP)for(let n=0;n<t.CP.length;n++)t.CP[n]=null}}function RC(t){return new Promise((e,n)=>{var r,i,s;function o(){Tv(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{Tv(),n(or(t,"network-request-failed"))},timeout:PC.get()})}if(!((i=(r=ar().gapi)===null||r===void 0?void 0:r.iframes)===null||i===void 0)&&i.Iframe)e(gapi.iframes.getContext());else if(!((s=ar().gapi)===null||s===void 0)&&s.load)o();else{const l=xI("iframefcb");return ar()[l]=()=>{gapi.load?o():n(or(t,"network-request-failed"))},vx(`${_I()}?onload=${l}`).catch(u=>n(u))}}).catch(e=>{throw bu=null,e})}let bu=null;function DC(t){return bu=bu||RC(t),bu}/**
|
|
* @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 jC=new Zl(5e3,15e3),OC="__/auth/iframe",LC="emulator/auth/iframe",MC={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},VC=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function FC(t){const e=t.config;le(e.authDomain,t,"auth-domain-config-required");const n=e.emulator?Nm(e,LC):`https://${t.config.authDomain}/${OC}`,r={apiKey:e.apiKey,appName:t.name,v:ia},i=VC.get(t.config.apiHost);i&&(r.eid=i);const s=t._getFrameworks();return s.length&&(r.fw=s.join(",")),`${n}?${Xl(r).slice(1)}`}async function UC(t){const e=await DC(t),n=ar().gapi;return le(n,t,"internal-error"),e.open({where:document.body,url:FC(t),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:MC,dontclear:!0},r=>new Promise(async(i,s)=>{await r.restyle({setHideOnLeave:!1});const o=or(t,"network-request-failed"),l=ar().setTimeout(()=>{s(o)},jC.get());function u(){ar().clearTimeout(l),i(r)}r.ping(u).then(u,()=>{s(o)})}))}/**
|
|
* @license
|
|
* Copyright 2020 Google LLC.
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/const zC={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},BC=500,$C=600,qC="_blank",WC="http://localhost";class bv{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function HC(t,e,n,r=BC,i=$C){const s=Math.max((window.screen.availHeight-i)/2,0).toString(),o=Math.max((window.screen.availWidth-r)/2,0).toString();let l="";const u=Object.assign(Object.assign({},zC),{width:r.toString(),height:i.toString(),top:s,left:o}),h=Ut().toLowerCase();n&&(l=dx(h)?qC:n),cx(h)&&(e=e||WC,u.scrollbars="yes");const m=Object.entries(u).reduce((g,[N,j])=>`${g}${N}=${j},`,"");if(dI(h)&&l!=="_self")return KC(e||"",l),new bv(null);const v=window.open(e||"",l,m);le(v,t,"popup-blocked");try{v.focus()}catch{}return new bv(v)}function KC(t,e){const n=document.createElement("a");n.href=t,n.target=e;const r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(r)}/**
|
|
* @license
|
|
* Copyright 2021 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/const GC="__/auth/handler",QC="emulator/auth/handler",YC=encodeURIComponent("fac");async function Sv(t,e,n,r,i,s){le(t.config.authDomain,t,"auth-domain-config-required"),le(t.config.apiKey,t,"invalid-api-key");const o={apiKey:t.config.apiKey,appName:t.name,authType:n,redirectUrl:r,v:ia,eventId:i};if(e instanceof _x){e.setDefaultLanguage(t.languageCode),o.providerId=e.providerId||"",Lb(e.getCustomParameters())||(o.customParameters=JSON.stringify(e.getCustomParameters()));for(const[m,v]of Object.entries({}))o[m]=v}if(e instanceof tc){const m=e.getScopes().filter(v=>v!=="");m.length>0&&(o.scopes=m.join(","))}t.tenantId&&(o.tid=t.tenantId);const l=o;for(const m of Object.keys(l))l[m]===void 0&&delete l[m];const u=await t._getAppCheckToken(),h=u?`#${YC}=${encodeURIComponent(u)}`:"";return`${JC(t)}?${Xl(l).slice(1)}${h}`}function JC({config:t}){return t.emulator?Nm(t,QC):`https://${t.authDomain}/${GC}`}/**
|
|
* @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 ef="webStorageSupport";class XC{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=Ix,this._completeRedirectFn=EC,this._overrideRedirectResult=wC}async _openPopup(e,n,r,i){var s;Hr((s=this.eventManagers[e._key()])===null||s===void 0?void 0:s.manager,"_initialize() not called before _openPopup()");const o=await Sv(e,n,r,dp(),i);return HC(e,o,Om())}async _openRedirect(e,n,r,i){await this._originValidation(e);const s=await Sv(e,n,r,dp(),i);return tC(s),new Promise(()=>{})}_initialize(e){const n=e._key();if(this.eventManagers[n]){const{manager:i,promise:s}=this.eventManagers[n];return i?Promise.resolve(i):(Hr(s,"If manager is not set, promise should be"),s)}const r=this.initAndGetManager(e);return this.eventManagers[n]={promise:r},r.catch(()=>{delete this.eventManagers[n]}),r}async initAndGetManager(e){const n=await UC(e),r=new TC(e);return n.register("authEvent",i=>(le(i==null?void 0:i.authEvent,e,"invalid-auth-event"),{status:r.onEvent(i.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:r},this.iframes[e._key()]=n,r}_isIframeWebStorageSupported(e,n){this.iframes[e._key()].send(ef,{type:ef},i=>{var s;const o=(s=i==null?void 0:i[0])===null||s===void 0?void 0:s[ef];o!==void 0&&n(!!o),zn(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const n=e._key();return this.originValidationPromises[n]||(this.originValidationPromises[n]=AC(e)),this.originValidationPromises[n]}get _shouldInitProactively(){return gx()||ux()||Rm()}}const ZC=XC;var Iv="@firebase/auth",Cv="1.7.9";/**
|
|
* @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 eA{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),((e=this.auth.currentUser)===null||e===void 0?void 0:e.uid)||null}async getToken(e){return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{accessToken:await this.auth.currentUser.getIdToken(e)}:null}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;const n=this.auth.onIdTokenChanged(r=>{e((r==null?void 0:r.stsTokenManager.accessToken)||null)});this.internalListeners.set(e,n),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const n=this.internalListeners.get(e);n&&(this.internalListeners.delete(e),n(),this.updateProactiveRefresh())}assertAuthConfigured(){le(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 tA(t){switch(t){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}function nA(t){ur(new Un("auth",(e,{options:n})=>{const r=e.getProvider("app").getImmediate(),i=e.getProvider("heartbeat"),s=e.getProvider("app-check-internal"),{apiKey:o,authDomain:l}=r.options;le(o&&!o.includes(":"),"invalid-api-key",{appName:r.name});const u={apiKey:o,authDomain:l,clientPlatform:t,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:yx(t)},h=new yI(r,i,s,u);return SI(h,n),h},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,n,r)=>{e.getProvider("auth-internal").initialize()})),ur(new Un("auth-internal",e=>{const n=Ui(e.getProvider("auth").getImmediate());return(r=>new eA(r))(n)},"PRIVATE").setInstantiationMode("EXPLICIT")),Sn(Iv,Cv,tA(t)),Sn(Iv,Cv,"esm2017")}/**
|
|
* @license
|
|
* Copyright 2021 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/const rA=5*60,iA=H_("authIdTokenMaxAge")||rA;let Av=null;const sA=t=>async e=>{const n=e&&await e.getIdTokenResult(),r=n&&(new Date().getTime()-Date.parse(n.issuedAtTime))/1e3;if(r&&r>iA)return;const i=n==null?void 0:n.token;Av!==i&&(Av=i,await fetch(t,{method:i?"POST":"DELETE",headers:i?{Authorization:`Bearer ${i}`}:{}}))};function oA(t=Im()){const e=ra(t,"auth");if(e.isInitialized())return e.getImmediate();const n=bI(t,{popupRedirectResolver:ZC,persistence:[uC,XI,Ix]}),r=H_("authTokenSyncURL");if(r&&typeof isSecureContext=="boolean"&&isSecureContext){const s=new URL(r,location.origin);if(location.origin===s.origin){const o=sA(s.toString());KI(n,o,()=>o(n.currentUser)),HI(n,l=>o(l))}}const i=q_("auth");return i&&II(n,`http://${i}`),n}function aA(){var t,e;return(e=(t=document.getElementsByTagName("head"))===null||t===void 0?void 0:t[0])!==null&&e!==void 0?e:document}vI({loadJS(t){return new Promise((e,n)=>{const r=document.createElement("script");r.setAttribute("src",t),r.onload=e,r.onerror=i=>{const s=or("internal-error");s.customData=i,n(s)},r.type="text/javascript",r.charset="UTF-8",aA().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="});nA("Browser");var Nv=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 ys,jx;(function(){var t;/** @license
|
|
|
|
Copyright The Closure Library Authors.
|
|
SPDX-License-Identifier: Apache-2.0
|
|
*/function e(T,w){function E(){}E.prototype=w.prototype,T.D=w.prototype,T.prototype=new E,T.prototype.constructor=T,T.C=function(S,A,R){for(var b=Array(arguments.length-2),Xe=2;Xe<arguments.length;Xe++)b[Xe-2]=arguments[Xe];return w.prototype[A].apply(S,b)}}function n(){this.blockSize=-1}function r(){this.blockSize=-1,this.blockSize=64,this.g=Array(4),this.B=Array(this.blockSize),this.o=this.h=0,this.s()}e(r,n),r.prototype.s=function(){this.g[0]=1732584193,this.g[1]=4023233417,this.g[2]=2562383102,this.g[3]=271733878,this.o=this.h=0};function i(T,w,E){E||(E=0);var S=Array(16);if(typeof w=="string")for(var A=0;16>A;++A)S[A]=w.charCodeAt(E++)|w.charCodeAt(E++)<<8|w.charCodeAt(E++)<<16|w.charCodeAt(E++)<<24;else for(A=0;16>A;++A)S[A]=w[E++]|w[E++]<<8|w[E++]<<16|w[E++]<<24;w=T.g[0],E=T.g[1],A=T.g[2];var R=T.g[3],b=w+(R^E&(A^R))+S[0]+3614090360&4294967295;w=E+(b<<7&4294967295|b>>>25),b=R+(A^w&(E^A))+S[1]+3905402710&4294967295,R=w+(b<<12&4294967295|b>>>20),b=A+(E^R&(w^E))+S[2]+606105819&4294967295,A=R+(b<<17&4294967295|b>>>15),b=E+(w^A&(R^w))+S[3]+3250441966&4294967295,E=A+(b<<22&4294967295|b>>>10),b=w+(R^E&(A^R))+S[4]+4118548399&4294967295,w=E+(b<<7&4294967295|b>>>25),b=R+(A^w&(E^A))+S[5]+1200080426&4294967295,R=w+(b<<12&4294967295|b>>>20),b=A+(E^R&(w^E))+S[6]+2821735955&4294967295,A=R+(b<<17&4294967295|b>>>15),b=E+(w^A&(R^w))+S[7]+4249261313&4294967295,E=A+(b<<22&4294967295|b>>>10),b=w+(R^E&(A^R))+S[8]+1770035416&4294967295,w=E+(b<<7&4294967295|b>>>25),b=R+(A^w&(E^A))+S[9]+2336552879&4294967295,R=w+(b<<12&4294967295|b>>>20),b=A+(E^R&(w^E))+S[10]+4294925233&4294967295,A=R+(b<<17&4294967295|b>>>15),b=E+(w^A&(R^w))+S[11]+2304563134&4294967295,E=A+(b<<22&4294967295|b>>>10),b=w+(R^E&(A^R))+S[12]+1804603682&4294967295,w=E+(b<<7&4294967295|b>>>25),b=R+(A^w&(E^A))+S[13]+4254626195&4294967295,R=w+(b<<12&4294967295|b>>>20),b=A+(E^R&(w^E))+S[14]+2792965006&4294967295,A=R+(b<<17&4294967295|b>>>15),b=E+(w^A&(R^w))+S[15]+1236535329&4294967295,E=A+(b<<22&4294967295|b>>>10),b=w+(A^R&(E^A))+S[1]+4129170786&4294967295,w=E+(b<<5&4294967295|b>>>27),b=R+(E^A&(w^E))+S[6]+3225465664&4294967295,R=w+(b<<9&4294967295|b>>>23),b=A+(w^E&(R^w))+S[11]+643717713&4294967295,A=R+(b<<14&4294967295|b>>>18),b=E+(R^w&(A^R))+S[0]+3921069994&4294967295,E=A+(b<<20&4294967295|b>>>12),b=w+(A^R&(E^A))+S[5]+3593408605&4294967295,w=E+(b<<5&4294967295|b>>>27),b=R+(E^A&(w^E))+S[10]+38016083&4294967295,R=w+(b<<9&4294967295|b>>>23),b=A+(w^E&(R^w))+S[15]+3634488961&4294967295,A=R+(b<<14&4294967295|b>>>18),b=E+(R^w&(A^R))+S[4]+3889429448&4294967295,E=A+(b<<20&4294967295|b>>>12),b=w+(A^R&(E^A))+S[9]+568446438&4294967295,w=E+(b<<5&4294967295|b>>>27),b=R+(E^A&(w^E))+S[14]+3275163606&4294967295,R=w+(b<<9&4294967295|b>>>23),b=A+(w^E&(R^w))+S[3]+4107603335&4294967295,A=R+(b<<14&4294967295|b>>>18),b=E+(R^w&(A^R))+S[8]+1163531501&4294967295,E=A+(b<<20&4294967295|b>>>12),b=w+(A^R&(E^A))+S[13]+2850285829&4294967295,w=E+(b<<5&4294967295|b>>>27),b=R+(E^A&(w^E))+S[2]+4243563512&4294967295,R=w+(b<<9&4294967295|b>>>23),b=A+(w^E&(R^w))+S[7]+1735328473&4294967295,A=R+(b<<14&4294967295|b>>>18),b=E+(R^w&(A^R))+S[12]+2368359562&4294967295,E=A+(b<<20&4294967295|b>>>12),b=w+(E^A^R)+S[5]+4294588738&4294967295,w=E+(b<<4&4294967295|b>>>28),b=R+(w^E^A)+S[8]+2272392833&4294967295,R=w+(b<<11&4294967295|b>>>21),b=A+(R^w^E)+S[11]+1839030562&4294967295,A=R+(b<<16&4294967295|b>>>16),b=E+(A^R^w)+S[14]+4259657740&4294967295,E=A+(b<<23&4294967295|b>>>9),b=w+(E^A^R)+S[1]+2763975236&4294967295,w=E+(b<<4&4294967295|b>>>28),b=R+(w^E^A)+S[4]+1272893353&4294967295,R=w+(b<<11&4294967295|b>>>21),b=A+(R^w^E)+S[7]+4139469664&4294967295,A=R+(b<<16&4294967295|b>>>16),b=E+(A^R^w)+S[10]+3200236656&4294967295,E=A+(b<<23&4294967295|b>>>9),b=w+(E^A^R)+S[13]+681279174&4294967295,w=E+(b<<4&4294967295|b>>>28),b=R+(w^E^A)+S[0]+3936430074&4294967295,R=w+(b<<11&4294967295|b>>>21),b=A+(R^w^E)+S[3]+3572445317&4294967295,A=R+(b<<16&4294967295|b>>>16),b=E+(A^R^w)+S[6]+76029189&4294967295,E=A+(b<<23&4294967295|b>>>9),b=w+(E^A^R)+S[9]+3654602809&4294967295,w=E+(b<<4&4294967295|b>>>28),b=R+(w^E^A)+S[12]+3873151461&4294967295,R=w+(b<<11&4294967295|b>>>21),b=A+(R^w^E)+S[15]+530742520&4294967295,A=R+(b<<16&4294967295|b>>>16),b=E+(A^R^w)+S[2]+3299628645&4294967295,E=A+(b<<23&4294967295|b>>>9),b=w+(A^(E|~R))+S[0]+4096336452&4294967295,w=E+(b<<6&4294967295|b>>>26),b=R+(E^(w|~A))+S[7]+1126891415&4294967295,R=w+(b<<10&4294967295|b>>>22),b=A+(w^(R|~E))+S[14]+2878612391&4294967295,A=R+(b<<15&4294967295|b>>>17),b=E+(R^(A|~w))+S[5]+4237533241&4294967295,E=A+(b<<21&4294967295|b>>>11),b=w+(A^(E|~R))+S[12]+1700485571&4294967295,w=E+(b<<6&4294967295|b>>>26),b=R+(E^(w|~A))+S[3]+2399980690&4294967295,R=w+(b<<10&4294967295|b>>>22),b=A+(w^(R|~E))+S[10]+4293915773&4294967295,A=R+(b<<15&4294967295|b>>>17),b=E+(R^(A|~w))+S[1]+2240044497&4294967295,E=A+(b<<21&4294967295|b>>>11),b=w+(A^(E|~R))+S[8]+1873313359&4294967295,w=E+(b<<6&4294967295|b>>>26),b=R+(E^(w|~A))+S[15]+4264355552&4294967295,R=w+(b<<10&4294967295|b>>>22),b=A+(w^(R|~E))+S[6]+2734768916&4294967295,A=R+(b<<15&4294967295|b>>>17),b=E+(R^(A|~w))+S[13]+1309151649&4294967295,E=A+(b<<21&4294967295|b>>>11),b=w+(A^(E|~R))+S[4]+4149444226&4294967295,w=E+(b<<6&4294967295|b>>>26),b=R+(E^(w|~A))+S[11]+3174756917&4294967295,R=w+(b<<10&4294967295|b>>>22),b=A+(w^(R|~E))+S[2]+718787259&4294967295,A=R+(b<<15&4294967295|b>>>17),b=E+(R^(A|~w))+S[9]+3951481745&4294967295,T.g[0]=T.g[0]+w&4294967295,T.g[1]=T.g[1]+(A+(b<<21&4294967295|b>>>11))&4294967295,T.g[2]=T.g[2]+A&4294967295,T.g[3]=T.g[3]+R&4294967295}r.prototype.u=function(T,w){w===void 0&&(w=T.length);for(var E=w-this.blockSize,S=this.B,A=this.h,R=0;R<w;){if(A==0)for(;R<=E;)i(this,T,R),R+=this.blockSize;if(typeof T=="string"){for(;R<w;)if(S[A++]=T.charCodeAt(R++),A==this.blockSize){i(this,S),A=0;break}}else for(;R<w;)if(S[A++]=T[R++],A==this.blockSize){i(this,S),A=0;break}}this.h=A,this.o+=w},r.prototype.v=function(){var T=Array((56>this.h?this.blockSize:2*this.blockSize)-this.h);T[0]=128;for(var w=1;w<T.length-8;++w)T[w]=0;var E=8*this.o;for(w=T.length-8;w<T.length;++w)T[w]=E&255,E/=256;for(this.u(T),T=Array(16),w=E=0;4>w;++w)for(var S=0;32>S;S+=8)T[E++]=this.g[w]>>>S&255;return T};function s(T,w){var E=l;return Object.prototype.hasOwnProperty.call(E,T)?E[T]:E[T]=w(T)}function o(T,w){this.h=w;for(var E=[],S=!0,A=T.length-1;0<=A;A--){var R=T[A]|0;S&&R==w||(E[A]=R,S=!1)}this.g=E}var l={};function u(T){return-128<=T&&128>T?s(T,function(w){return new o([w|0],0>w?-1:0)}):new o([T|0],0>T?-1:0)}function h(T){if(isNaN(T)||!isFinite(T))return v;if(0>T)return B(h(-T));for(var w=[],E=1,S=0;T>=E;S++)w[S]=T/E|0,E*=4294967296;return new o(w,0)}function m(T,w){if(T.length==0)throw Error("number format error: empty string");if(w=w||10,2>w||36<w)throw Error("radix out of range: "+w);if(T.charAt(0)=="-")return B(m(T.substring(1),w));if(0<=T.indexOf("-"))throw Error('number format error: interior "-" character');for(var E=h(Math.pow(w,8)),S=v,A=0;A<T.length;A+=8){var R=Math.min(8,T.length-A),b=parseInt(T.substring(A,A+R),w);8>R?(R=h(Math.pow(w,R)),S=S.j(R).add(h(b))):(S=S.j(E),S=S.add(h(b)))}return S}var v=u(0),g=u(1),N=u(16777216);t=o.prototype,t.m=function(){if(L(this))return-B(this).m();for(var T=0,w=1,E=0;E<this.g.length;E++){var S=this.i(E);T+=(0<=S?S:4294967296+S)*w,w*=4294967296}return T},t.toString=function(T){if(T=T||10,2>T||36<T)throw Error("radix out of range: "+T);if(j(this))return"0";if(L(this))return"-"+B(this).toString(T);for(var w=h(Math.pow(T,6)),E=this,S="";;){var A=V(E,w).g;E=I(E,A.j(w));var R=((0<E.g.length?E.g[0]:E.h)>>>0).toString(T);if(E=A,j(E))return R+S;for(;6>R.length;)R="0"+R;S=R+S}},t.i=function(T){return 0>T?0:T<this.g.length?this.g[T]:this.h};function j(T){if(T.h!=0)return!1;for(var w=0;w<T.g.length;w++)if(T.g[w]!=0)return!1;return!0}function L(T){return T.h==-1}t.l=function(T){return T=I(this,T),L(T)?-1:j(T)?0:1};function B(T){for(var w=T.g.length,E=[],S=0;S<w;S++)E[S]=~T.g[S];return new o(E,~T.h).add(g)}t.abs=function(){return L(this)?B(this):this},t.add=function(T){for(var w=Math.max(this.g.length,T.g.length),E=[],S=0,A=0;A<=w;A++){var R=S+(this.i(A)&65535)+(T.i(A)&65535),b=(R>>>16)+(this.i(A)>>>16)+(T.i(A)>>>16);S=b>>>16,R&=65535,b&=65535,E[A]=b<<16|R}return new o(E,E[E.length-1]&-2147483648?-1:0)};function I(T,w){return T.add(B(w))}t.j=function(T){if(j(this)||j(T))return v;if(L(this))return L(T)?B(this).j(B(T)):B(B(this).j(T));if(L(T))return B(this.j(B(T)));if(0>this.l(N)&&0>T.l(N))return h(this.m()*T.m());for(var w=this.g.length+T.g.length,E=[],S=0;S<2*w;S++)E[S]=0;for(S=0;S<this.g.length;S++)for(var A=0;A<T.g.length;A++){var R=this.i(S)>>>16,b=this.i(S)&65535,Xe=T.i(A)>>>16,An=T.i(A)&65535;E[2*S+2*A]+=b*An,k(E,2*S+2*A),E[2*S+2*A+1]+=R*An,k(E,2*S+2*A+1),E[2*S+2*A+1]+=b*Xe,k(E,2*S+2*A+1),E[2*S+2*A+2]+=R*Xe,k(E,2*S+2*A+2)}for(S=0;S<w;S++)E[S]=E[2*S+1]<<16|E[2*S];for(S=w;S<2*w;S++)E[S]=0;return new o(E,0)};function k(T,w){for(;(T[w]&65535)!=T[w];)T[w+1]+=T[w]>>>16,T[w]&=65535,w++}function C(T,w){this.g=T,this.h=w}function V(T,w){if(j(w))throw Error("division by zero");if(j(T))return new C(v,v);if(L(T))return w=V(B(T),w),new C(B(w.g),B(w.h));if(L(w))return w=V(T,B(w)),new C(B(w.g),w.h);if(30<T.g.length){if(L(T)||L(w))throw Error("slowDivide_ only works with positive integers.");for(var E=g,S=w;0>=S.l(T);)E=G(E),S=G(S);var A=H(E,1),R=H(S,1);for(S=H(S,2),E=H(E,2);!j(S);){var b=R.add(S);0>=b.l(T)&&(A=A.add(E),R=b),S=H(S,1),E=H(E,1)}return w=I(T,A.j(w)),new C(A,w)}for(A=v;0<=T.l(w);){for(E=Math.max(1,Math.floor(T.m()/w.m())),S=Math.ceil(Math.log(E)/Math.LN2),S=48>=S?1:Math.pow(2,S-48),R=h(E),b=R.j(w);L(b)||0<b.l(T);)E-=S,R=h(E),b=R.j(w);j(R)&&(R=g),A=A.add(R),T=I(T,b)}return new C(A,T)}t.A=function(T){return V(this,T).h},t.and=function(T){for(var w=Math.max(this.g.length,T.g.length),E=[],S=0;S<w;S++)E[S]=this.i(S)&T.i(S);return new o(E,this.h&T.h)},t.or=function(T){for(var w=Math.max(this.g.length,T.g.length),E=[],S=0;S<w;S++)E[S]=this.i(S)|T.i(S);return new o(E,this.h|T.h)},t.xor=function(T){for(var w=Math.max(this.g.length,T.g.length),E=[],S=0;S<w;S++)E[S]=this.i(S)^T.i(S);return new o(E,this.h^T.h)};function G(T){for(var w=T.g.length+1,E=[],S=0;S<w;S++)E[S]=T.i(S)<<1|T.i(S-1)>>>31;return new o(E,T.h)}function H(T,w){var E=w>>5;w%=32;for(var S=T.g.length-E,A=[],R=0;R<S;R++)A[R]=0<w?T.i(R+E)>>>w|T.i(R+E+1)<<32-w:T.i(R+E);return new o(A,T.h)}r.prototype.digest=r.prototype.v,r.prototype.reset=r.prototype.s,r.prototype.update=r.prototype.u,jx=r,o.prototype.add=o.prototype.add,o.prototype.multiply=o.prototype.j,o.prototype.modulo=o.prototype.A,o.prototype.compare=o.prototype.l,o.prototype.toNumber=o.prototype.m,o.prototype.toString=o.prototype.toString,o.prototype.getBits=o.prototype.i,o.fromNumber=h,o.fromString=m,ys=o}).apply(typeof Nv<"u"?Nv:typeof self<"u"?self:typeof window<"u"?window:{});var ru=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 Ox,tl,Lx,Su,pp,Mx,Vx,Fx;(function(){var t,e=typeof Object.defineProperties=="function"?Object.defineProperty:function(a,d,f){return a==Array.prototype||a==Object.prototype||(a[d]=f.value),a};function n(a){a=[typeof globalThis=="object"&&globalThis,a,typeof window=="object"&&window,typeof self=="object"&&self,typeof ru=="object"&&ru];for(var d=0;d<a.length;++d){var f=a[d];if(f&&f.Math==Math)return f}throw Error("Cannot find global object")}var r=n(this);function i(a,d){if(d)e:{var f=r;a=a.split(".");for(var y=0;y<a.length-1;y++){var P=a[y];if(!(P in f))break e;f=f[P]}a=a[a.length-1],y=f[a],d=d(y),d!=y&&d!=null&&e(f,a,{configurable:!0,writable:!0,value:d})}}function s(a,d){a instanceof String&&(a+="");var f=0,y=!1,P={next:function(){if(!y&&f<a.length){var O=f++;return{value:d(O,a[O]),done:!1}}return y=!0,{done:!0,value:void 0}}};return P[Symbol.iterator]=function(){return P},P}i("Array.prototype.values",function(a){return a||function(){return s(this,function(d,f){return f})}});/** @license
|
|
|
|
Copyright The Closure Library Authors.
|
|
SPDX-License-Identifier: Apache-2.0
|
|
*/var o=o||{},l=this||self;function u(a){var d=typeof a;return d=d!="object"?d:a?Array.isArray(a)?"array":d:"null",d=="array"||d=="object"&&typeof a.length=="number"}function h(a){var d=typeof a;return d=="object"&&a!=null||d=="function"}function m(a,d,f){return a.call.apply(a.bind,arguments)}function v(a,d,f){if(!a)throw Error();if(2<arguments.length){var y=Array.prototype.slice.call(arguments,2);return function(){var P=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(P,y),a.apply(d,P)}}return function(){return a.apply(d,arguments)}}function g(a,d,f){return g=Function.prototype.bind&&Function.prototype.bind.toString().indexOf("native code")!=-1?m:v,g.apply(null,arguments)}function N(a,d){var f=Array.prototype.slice.call(arguments,1);return function(){var y=f.slice();return y.push.apply(y,arguments),a.apply(this,y)}}function j(a,d){function f(){}f.prototype=d.prototype,a.aa=d.prototype,a.prototype=new f,a.prototype.constructor=a,a.Qb=function(y,P,O){for(var Q=Array(arguments.length-2),Ee=2;Ee<arguments.length;Ee++)Q[Ee-2]=arguments[Ee];return d.prototype[P].apply(y,Q)}}function L(a){const d=a.length;if(0<d){const f=Array(d);for(let y=0;y<d;y++)f[y]=a[y];return f}return[]}function B(a,d){for(let f=1;f<arguments.length;f++){const y=arguments[f];if(u(y)){const P=a.length||0,O=y.length||0;a.length=P+O;for(let Q=0;Q<O;Q++)a[P+Q]=y[Q]}else a.push(y)}}class I{constructor(d,f){this.i=d,this.j=f,this.h=0,this.g=null}get(){let d;return 0<this.h?(this.h--,d=this.g,this.g=d.next,d.next=null):d=this.i(),d}}function k(a){return/^[\s\xa0]*$/.test(a)}function C(){var a=l.navigator;return a&&(a=a.userAgent)?a:""}function V(a){return V[" "](a),a}V[" "]=function(){};var G=C().indexOf("Gecko")!=-1&&!(C().toLowerCase().indexOf("webkit")!=-1&&C().indexOf("Edge")==-1)&&!(C().indexOf("Trident")!=-1||C().indexOf("MSIE")!=-1)&&C().indexOf("Edge")==-1;function H(a,d,f){for(const y in a)d.call(f,a[y],y,a)}function T(a,d){for(const f in a)d.call(void 0,a[f],f,a)}function w(a){const d={};for(const f in a)d[f]=a[f];return d}const E="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function S(a,d){let f,y;for(let P=1;P<arguments.length;P++){y=arguments[P];for(f in y)a[f]=y[f];for(let O=0;O<E.length;O++)f=E[O],Object.prototype.hasOwnProperty.call(y,f)&&(a[f]=y[f])}}function A(a){var d=1;a=a.split(":");const f=[];for(;0<d&&a.length;)f.push(a.shift()),d--;return a.length&&f.push(a.join(":")),f}function R(a){l.setTimeout(()=>{throw a},0)}function b(){var a=ae;let d=null;return a.g&&(d=a.g,a.g=a.g.next,a.g||(a.h=null),d.next=null),d}class Xe{constructor(){this.h=this.g=null}add(d,f){const y=An.get();y.set(d,f),this.h?this.h.next=y:this.g=y,this.h=y}}var An=new I(()=>new Qt,a=>a.reset());class Qt{constructor(){this.next=this.g=this.h=null}set(d,f){this.h=d,this.g=f,this.next=null}reset(){this.next=this.g=this.h=null}}let Yt,Y=!1,ae=new Xe,se=()=>{const a=l.Promise.resolve(void 0);Yt=()=>{a.then(Ce)}};var Ce=()=>{for(var a;a=b();){try{a.h.call(a.g)}catch(f){R(f)}var d=An;d.j(a),100>d.h&&(d.h++,a.next=d.g,d.g=a)}Y=!1};function Te(){this.s=this.s,this.C=this.C}Te.prototype.s=!1,Te.prototype.ma=function(){this.s||(this.s=!0,this.N())},Te.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()};function Ae(a,d){this.type=a,this.g=this.target=d,this.defaultPrevented=!1}Ae.prototype.h=function(){this.defaultPrevented=!0};var Qe=function(){if(!l.addEventListener||!Object.defineProperty)return!1;var a=!1,d=Object.defineProperty({},"passive",{get:function(){a=!0}});try{const f=()=>{};l.addEventListener("test",f,d),l.removeEventListener("test",f,d)}catch{}return a}();function At(a,d){if(Ae.call(this,a?a.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,a){var f=this.type=a.type,y=a.changedTouches&&a.changedTouches.length?a.changedTouches[0]:null;if(this.target=a.target||a.srcElement,this.g=d,d=a.relatedTarget){if(G){e:{try{V(d.nodeName);var P=!0;break e}catch{}P=!1}P||(d=null)}}else f=="mouseover"?d=a.fromElement:f=="mouseout"&&(d=a.toElement);this.relatedTarget=d,y?(this.clientX=y.clientX!==void 0?y.clientX:y.pageX,this.clientY=y.clientY!==void 0?y.clientY:y.pageY,this.screenX=y.screenX||0,this.screenY=y.screenY||0):(this.clientX=a.clientX!==void 0?a.clientX:a.pageX,this.clientY=a.clientY!==void 0?a.clientY:a.pageY,this.screenX=a.screenX||0,this.screenY=a.screenY||0),this.button=a.button,this.key=a.key||"",this.ctrlKey=a.ctrlKey,this.altKey=a.altKey,this.shiftKey=a.shiftKey,this.metaKey=a.metaKey,this.pointerId=a.pointerId||0,this.pointerType=typeof a.pointerType=="string"?a.pointerType:Oe[a.pointerType]||"",this.state=a.state,this.i=a,a.defaultPrevented&&At.aa.h.call(this)}}j(At,Ae);var Oe={2:"touch",3:"pen",4:"mouse"};At.prototype.h=function(){At.aa.h.call(this);var a=this.i;a.preventDefault?a.preventDefault():a.returnValue=!1};var Jt="closure_listenable_"+(1e6*Math.random()|0),F=0;function ca(a,d,f,y,P){this.listener=a,this.proxy=null,this.src=d,this.type=f,this.capture=!!y,this.ha=P,this.key=++F,this.da=this.fa=!1}function Bi(a){a.da=!0,a.listener=null,a.proxy=null,a.src=null,a.ha=null}function Xr(a){this.src=a,this.g={},this.h=0}Xr.prototype.add=function(a,d,f,y,P){var O=a.toString();a=this.g[O],a||(a=this.g[O]=[],this.h++);var Q=qi(a,d,y,P);return-1<Q?(d=a[Q],f||(d.fa=!1)):(d=new ca(d,this.src,O,!!y,P),d.fa=f,a.push(d)),d};function $i(a,d){var f=d.type;if(f in a.g){var y=a.g[f],P=Array.prototype.indexOf.call(y,d,void 0),O;(O=0<=P)&&Array.prototype.splice.call(y,P,1),O&&(Bi(d),a.g[f].length==0&&(delete a.g[f],a.h--))}}function qi(a,d,f,y){for(var P=0;P<a.length;++P){var O=a[P];if(!O.da&&O.listener==d&&O.capture==!!f&&O.ha==y)return P}return-1}var $n="closure_lm_"+(1e6*Math.random()|0),Ls={};function pr(a,d,f,y,P){if(Array.isArray(d)){for(var O=0;O<d.length;O++)pr(a,d[O],f,y,P);return null}return f=Wi(f),a&&a[Jt]?a.K(d,f,h(y)?!!y.capture:!1,P):mc(a,d,f,!1,y,P)}function mc(a,d,f,y,P,O){if(!d)throw Error("Invalid event type");var Q=h(P)?!!P.capture:!!P,Ee=ei(a);if(Ee||(a[$n]=Ee=new Xr(a)),f=Ee.add(d,f,y,Q,O),f.proxy)return f;if(y=ua(),f.proxy=y,y.src=a,y.listener=f,a.addEventListener)Qe||(P=Q),P===void 0&&(P=!1),a.addEventListener(d.toString(),y,P);else if(a.attachEvent)a.attachEvent(Vs(d.toString()),y);else if(a.addListener&&a.removeListener)a.addListener(y);else throw Error("addEventListener and attachEvent are unavailable.");return f}function ua(){function a(f){return d.call(a.src,a.listener,f)}const d=yt;return a}function Ms(a,d,f,y,P){if(Array.isArray(d))for(var O=0;O<d.length;O++)Ms(a,d[O],f,y,P);else y=h(y)?!!y.capture:!!y,f=Wi(f),a&&a[Jt]?(a=a.i,d=String(d).toString(),d in a.g&&(O=a.g[d],f=qi(O,f,y,P),-1<f&&(Bi(O[f]),Array.prototype.splice.call(O,f,1),O.length==0&&(delete a.g[d],a.h--)))):a&&(a=ei(a))&&(d=a.g[d.toString()],a=-1,d&&(a=qi(d,f,y,P)),(f=-1<a?d[a]:null)&&Zr(f))}function Zr(a){if(typeof a!="number"&&a&&!a.da){var d=a.src;if(d&&d[Jt])$i(d.i,a);else{var f=a.type,y=a.proxy;d.removeEventListener?d.removeEventListener(f,y,a.capture):d.detachEvent?d.detachEvent(Vs(f),y):d.addListener&&d.removeListener&&d.removeListener(y),(f=ei(d))?($i(f,a),f.h==0&&(f.src=null,d[$n]=null)):Bi(a)}}}function Vs(a){return a in Ls?Ls[a]:Ls[a]="on"+a}function yt(a,d){if(a.da)a=!0;else{d=new At(d,this);var f=a.listener,y=a.ha||a.src;a.fa&&Zr(a),a=f.call(y,d)}return a}function ei(a){return a=a[$n],a instanceof Xr?a:null}var da="__closure_events_fn_"+(1e9*Math.random()>>>0);function Wi(a){return typeof a=="function"?a:(a[da]||(a[da]=function(d){return a.handleEvent(d)}),a[da])}function He(){Te.call(this),this.i=new Xr(this),this.M=this,this.F=null}j(He,Te),He.prototype[Jt]=!0,He.prototype.removeEventListener=function(a,d,f,y){Ms(this,a,d,f,y)};function Ze(a,d){var f,y=a.F;if(y)for(f=[];y;y=y.F)f.push(y);if(a=a.M,y=d.type||d,typeof d=="string")d=new Ae(d,a);else if(d instanceof Ae)d.target=d.target||a;else{var P=d;d=new Ae(y,a),S(d,P)}if(P=!0,f)for(var O=f.length-1;0<=O;O--){var Q=d.g=f[O];P=Nn(Q,y,!0,d)&&P}if(Q=d.g=a,P=Nn(Q,y,!0,d)&&P,P=Nn(Q,y,!1,d)&&P,f)for(O=0;O<f.length;O++)Q=d.g=f[O],P=Nn(Q,y,!1,d)&&P}He.prototype.N=function(){if(He.aa.N.call(this),this.i){var a=this.i,d;for(d in a.g){for(var f=a.g[d],y=0;y<f.length;y++)Bi(f[y]);delete a.g[d],a.h--}}this.F=null},He.prototype.K=function(a,d,f,y){return this.i.add(String(a),d,!1,f,y)},He.prototype.L=function(a,d,f,y){return this.i.add(String(a),d,!0,f,y)};function Nn(a,d,f,y){if(d=a.i.g[String(d)],!d)return!0;d=d.concat();for(var P=!0,O=0;O<d.length;++O){var Q=d[O];if(Q&&!Q.da&&Q.capture==f){var Ee=Q.listener,tt=Q.ha||Q.src;Q.fa&&$i(a.i,Q),P=Ee.call(tt,y)!==!1&&P}}return P&&!y.defaultPrevented}function ha(a,d,f){if(typeof a=="function")f&&(a=g(a,f));else if(a&&typeof a.handleEvent=="function")a=g(a.handleEvent,a);else throw Error("Invalid listener argument");return 2147483647<Number(d)?-1:l.setTimeout(a,d||0)}function gc(a){a.g=ha(()=>{a.g=null,a.i&&(a.i=!1,gc(a))},a.l);const d=a.h;a.h=null,a.m.apply(null,d)}class fa extends Te{constructor(d,f){super(),this.m=d,this.l=f,this.h=null,this.i=!1,this.g=null}j(d){this.h=arguments,this.g?this.i=!0:gc(this)}N(){super.N(),this.g&&(l.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function vt(a){Te.call(this),this.h=a,this.g={}}j(vt,Te);var pa=[];function Fs(a){H(a.g,function(d,f){this.g.hasOwnProperty(f)&&Zr(d)},a),a.g={}}vt.prototype.N=function(){vt.aa.N.call(this),Fs(this)},vt.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var Us=l.JSON.stringify,mr=l.JSON.parse,yc=class{stringify(a){return l.JSON.stringify(a,void 0)}parse(a){return l.JSON.parse(a,void 0)}};function ti(){}ti.prototype.h=null;function ma(a){return a.h||(a.h=a.i())}function Hi(){}var ni={OPEN:"a",kb:"b",Ja:"c",wb:"d"};function gr(){Ae.call(this,"d")}j(gr,Ae);function zs(){Ae.call(this,"c")}j(zs,Ae);var qn={},Ki=null;function Ue(){return Ki=Ki||new He}qn.La="serverreachability";function ga(a){Ae.call(this,qn.La,a)}j(ga,Ae);function et(a){const d=Ue();Ze(d,new ga(d))}qn.STAT_EVENT="statevent";function Bs(a,d){Ae.call(this,qn.STAT_EVENT,a),this.stat=d}j(Bs,Ae);function wt(a){const d=Ue();Ze(d,new Bs(d,a))}qn.Ma="timingevent";function Gi(a,d){Ae.call(this,qn.Ma,a),this.size=d}j(Gi,Ae);function Xt(a,d){if(typeof a!="function")throw Error("Fn must not be null and must be a function");return l.setTimeout(function(){a()},d)}function ri(){this.g=!0}ri.prototype.xa=function(){this.g=!1};function ya(a,d,f,y,P,O){a.info(function(){if(a.g)if(O)for(var Q="",Ee=O.split("&"),tt=0;tt<Ee.length;tt++){var ge=Ee[tt].split("=");if(1<ge.length){var ot=ge[0];ge=ge[1];var at=ot.split("_");Q=2<=at.length&&at[1]=="type"?Q+(ot+"="+ge+"&"):Q+(ot+"=redacted&")}}else Q=null;else Q=O;return"XMLHTTP REQ ("+y+") [attempt "+P+"]: "+d+`
|
|
`+f+`
|
|
`+Q})}function vc(a,d,f,y,P,O,Q){a.info(function(){return"XMLHTTP RESP ("+y+") [ attempt "+P+"]: "+d+`
|
|
`+f+`
|
|
`+O+" "+Q})}function an(a,d,f,y){a.info(function(){return"XMLHTTP TEXT ("+d+"): "+ii(a,f)+(y?" "+y:"")})}function $s(a,d){a.info(function(){return"TIMEOUT: "+d})}ri.prototype.info=function(){};function ii(a,d){if(!a.g)return d;if(!d)return null;try{var f=JSON.parse(d);if(f){for(a=0;a<f.length;a++)if(Array.isArray(f[a])){var y=f[a];if(!(2>y.length)){var P=y[1];if(Array.isArray(P)&&!(1>P.length)){var O=P[0];if(O!="noop"&&O!="stop"&&O!="close")for(var Q=1;Q<P.length;Q++)P[Q]=""}}}}return Us(f)}catch{return d}}var yr={NO_ERROR:0,gb:1,tb:2,sb:3,nb:4,rb:5,ub:6,Ia:7,TIMEOUT:8,xb:9},va={lb:"complete",Hb:"success",Ja:"error",Ia:"abort",zb:"ready",Ab:"readystatechange",TIMEOUT:"timeout",vb:"incrementaldata",yb:"progress",ob:"downloadprogress",Pb:"uploadprogress"},ft;function vr(){}j(vr,ti),vr.prototype.g=function(){return new XMLHttpRequest},vr.prototype.i=function(){return{}},ft=new vr;function Wn(a,d,f,y){this.j=a,this.i=d,this.l=f,this.R=y||1,this.U=new vt(this),this.I=45e3,this.H=null,this.o=!1,this.m=this.A=this.v=this.L=this.F=this.S=this.B=null,this.D=[],this.g=null,this.C=0,this.s=this.u=null,this.X=-1,this.J=!1,this.O=0,this.M=null,this.W=this.K=this.T=this.P=!1,this.h=new Qi}function Qi(){this.i=null,this.g="",this.h=!1}var wa={},qs={};function Yi(a,d,f){a.L=1,a.v=Js(Pn(d)),a.m=f,a.P=!0,_a(a,null)}function _a(a,d){a.F=Date.now(),Nt(a),a.A=Pn(a.v);var f=a.A,y=a.R;Array.isArray(y)||(y=[String(y)]),Tc(f.i,"t",y),a.C=0,f=a.j.J,a.h=new Qi,a.g=Dc(a.j,f?d:null,!a.m),0<a.O&&(a.M=new fa(g(a.Y,a,a.g),a.O)),d=a.U,f=a.g,y=a.ca;var P="readystatechange";Array.isArray(P)||(P&&(pa[0]=P.toString()),P=pa);for(var O=0;O<P.length;O++){var Q=pr(f,P[O],y||d.handleEvent,!1,d.h||d);if(!Q)break;d.g[Q.key]=Q}d=a.H?w(a.H):{},a.m?(a.u||(a.u="POST"),d["Content-Type"]="application/x-www-form-urlencoded",a.g.ea(a.A,a.u,a.m,d)):(a.u="GET",a.g.ea(a.A,a.u,null,d)),et(),ya(a.i,a.u,a.A,a.l,a.R,a.m)}Wn.prototype.ca=function(a){a=a.target;const d=this.M;d&&_n(a)==3?d.j():this.Y(a)},Wn.prototype.Y=function(a){try{if(a==this.g)e:{const at=_n(this.g);var d=this.g.Ba();const Sr=this.g.Z();if(!(3>at)&&(at!=3||this.g&&(this.h.h||this.g.oa()||Sa(this.g)))){this.J||at!=4||d==7||(d==8||0>=Sr?et(3):et(2)),xa(this);var f=this.g.Z();this.X=f;t:if(gn(this)){var y=Sa(this.g);a="";var P=y.length,O=_n(this.g)==4;if(!this.h.i){if(typeof TextDecoder>"u"){vn(this),yn(this);var Q="";break t}this.h.i=new l.TextDecoder}for(d=0;d<P;d++)this.h.h=!0,a+=this.h.i.decode(y[d],{stream:!(O&&d==P-1)});y.length=0,this.h.g+=a,this.C=0,Q=this.h.g}else Q=this.g.oa();if(this.o=f==200,vc(this.i,this.u,this.A,this.l,this.R,at,f),this.o){if(this.T&&!this.K){t:{if(this.g){var Ee,tt=this.g;if((Ee=tt.g?tt.g.getResponseHeader("X-HTTP-Initial-Response"):null)&&!k(Ee)){var ge=Ee;break t}}ge=null}if(f=ge)an(this.i,this.l,f,"Initial handshake response via X-HTTP-Initial-Response"),this.K=!0,Hs(this,f);else{this.o=!1,this.s=3,wt(12),vn(this),yn(this);break e}}if(this.P){f=!0;let Zt;for(;!this.J&&this.C<Q.length;)if(Zt=wc(this,Q),Zt==qs){at==4&&(this.s=4,wt(14),f=!1),an(this.i,this.l,null,"[Incomplete Response]");break}else if(Zt==wa){this.s=4,wt(15),an(this.i,this.l,Q,"[Invalid Chunk]"),f=!1;break}else an(this.i,this.l,Zt,null),Hs(this,Zt);if(gn(this)&&this.C!=0&&(this.h.g=this.h.g.slice(this.C),this.C=0),at!=4||Q.length!=0||this.h.h||(this.s=1,wt(16),f=!1),this.o=this.o&&f,!f)an(this.i,this.l,Q,"[Invalid Chunked Response]"),vn(this),yn(this);else if(0<Q.length&&!this.W){this.W=!0;var ot=this.j;ot.g==this&&ot.ba&&!ot.M&&(ot.j.info("Great, no buffering proxy detected. Bytes received: "+Q.length),Na(ot),ot.M=!0,wt(11))}}else an(this.i,this.l,Q,null),Hs(this,Q);at==4&&vn(this),this.o&&!this.J&&(at==4?Pa(this.j,this):(this.o=!1,Nt(this)))}else ph(this.g),f==400&&0<Q.indexOf("Unknown SID")?(this.s=3,wt(12)):(this.s=0,wt(13)),vn(this),yn(this)}}}catch{}finally{}};function gn(a){return a.g?a.u=="GET"&&a.L!=2&&a.j.Ca:!1}function wc(a,d){var f=a.C,y=d.indexOf(`
|
|
`,f);return y==-1?qs:(f=Number(d.substring(f,y)),isNaN(f)?wa:(y+=1,y+f>d.length?qs:(d=d.slice(y,y+f),a.C=y+f,d)))}Wn.prototype.cancel=function(){this.J=!0,vn(this)};function Nt(a){a.S=Date.now()+a.I,Ws(a,a.I)}function Ws(a,d){if(a.B!=null)throw Error("WatchDog timer not null");a.B=Xt(g(a.ba,a),d)}function xa(a){a.B&&(l.clearTimeout(a.B),a.B=null)}Wn.prototype.ba=function(){this.B=null;const a=Date.now();0<=a-this.S?($s(this.i,this.A),this.L!=2&&(et(),wt(17)),vn(this),this.s=2,yn(this)):Ws(this,this.S-a)};function yn(a){a.j.G==0||a.J||Pa(a.j,a)}function vn(a){xa(a);var d=a.M;d&&typeof d.ma=="function"&&d.ma(),a.M=null,Fs(a.U),a.g&&(d=a.g,a.g=null,d.abort(),d.ma())}function Hs(a,d){try{var f=a.j;if(f.G!=0&&(f.g==a||Hn(f.h,a))){if(!a.K&&Hn(f.h,a)&&f.G==3){try{var y=f.Da.g.parse(d)}catch{y=null}if(Array.isArray(y)&&y.length==3){var P=y;if(P[0]==0){e:if(!f.u){if(f.g)if(f.g.F+3e3<a.F)oo(f),ai(f);else break e;Aa(f),wt(18)}}else f.za=P[1],0<f.za-f.T&&37500>P[2]&&f.F&&f.v==0&&!f.C&&(f.C=Xt(g(f.Za,f),6e3));if(1>=Ks(f.h)&&f.ca){try{f.ca()}catch{}f.ca=void 0}}else br(f,11)}else if((a.K||f.g==a)&&oo(f),!k(d))for(P=f.Da.g.parse(d),d=0;d<P.length;d++){let ge=P[d];if(f.T=ge[0],ge=ge[1],f.G==2)if(ge[0]=="c"){f.K=ge[1],f.ia=ge[2];const ot=ge[3];ot!=null&&(f.la=ot,f.j.info("VER="+f.la));const at=ge[4];at!=null&&(f.Aa=at,f.j.info("SVER="+f.Aa));const Sr=ge[5];Sr!=null&&typeof Sr=="number"&&0<Sr&&(y=1.5*Sr,f.L=y,f.j.info("backChannelRequestTimeoutMs_="+y)),y=f;const Zt=a.g;if(Zt){const rs=Zt.g?Zt.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(rs){var O=y.h;O.g||rs.indexOf("spdy")==-1&&rs.indexOf("quic")==-1&&rs.indexOf("h2")==-1||(O.j=O.l,O.g=new Set,O.h&&(Ji(O,O.h),O.h=null))}if(y.D){const lo=Zt.g?Zt.g.getResponseHeader("X-HTTP-Session-Id"):null;lo&&(y.ya=lo,_e(y.I,y.D,lo))}}f.G=3,f.l&&f.l.ua(),f.ba&&(f.R=Date.now()-a.F,f.j.info("Handshake RTT: "+f.R+"ms")),y=f;var Q=a;if(y.qa=Rc(y,y.J?y.ia:null,y.W),Q.K){Gs(y.h,Q);var Ee=Q,tt=y.L;tt&&(Ee.I=tt),Ee.B&&(xa(Ee),Nt(Ee)),y.g=Q}else Cc(y);0<f.i.length&&kr(f)}else ge[0]!="stop"&&ge[0]!="close"||br(f,7);else f.G==3&&(ge[0]=="stop"||ge[0]=="close"?ge[0]=="stop"?br(f,7):so(f):ge[0]!="noop"&&f.l&&f.l.ta(ge),f.v=0)}}et(4)}catch{}}var sh=class{constructor(a,d){this.g=a,this.map=d}};function _c(a){this.l=a||10,l.PerformanceNavigationTiming?(a=l.performance.getEntriesByType("navigation"),a=0<a.length&&(a[0].nextHopProtocol=="hq"||a[0].nextHopProtocol=="h2")):a=!!(l.chrome&&l.chrome.loadTimes&&l.chrome.loadTimes()&&l.chrome.loadTimes().wasFetchedViaSpdy),this.j=a?this.l:1,this.g=null,1<this.j&&(this.g=new Set),this.h=null,this.i=[]}function wr(a){return a.h?!0:a.g?a.g.size>=a.j:!1}function Ks(a){return a.h?1:a.g?a.g.size:0}function Hn(a,d){return a.h?a.h==d:a.g?a.g.has(d):!1}function Ji(a,d){a.g?a.g.add(d):a.h=d}function Gs(a,d){a.h&&a.h==d?a.h=null:a.g&&a.g.has(d)&&a.g.delete(d)}_c.prototype.cancel=function(){if(this.i=Qs(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&this.g.size!==0){for(const a of this.g.values())a.cancel();this.g.clear()}};function Qs(a){if(a.h!=null)return a.i.concat(a.h.D);if(a.g!=null&&a.g.size!==0){let d=a.i;for(const f of a.g.values())d=d.concat(f.D);return d}return L(a.i)}function Ys(a){if(a.V&&typeof a.V=="function")return a.V();if(typeof Map<"u"&&a instanceof Map||typeof Set<"u"&&a instanceof Set)return Array.from(a.values());if(typeof a=="string")return a.split("");if(u(a)){for(var d=[],f=a.length,y=0;y<f;y++)d.push(a[y]);return d}d=[],f=0;for(y in a)d[f++]=a[y];return d}function Ea(a){if(a.na&&typeof a.na=="function")return a.na();if(!a.V||typeof a.V!="function"){if(typeof Map<"u"&&a instanceof Map)return Array.from(a.keys());if(!(typeof Set<"u"&&a instanceof Set)){if(u(a)||typeof a=="string"){var d=[];a=a.length;for(var f=0;f<a;f++)d.push(f);return d}d=[],f=0;for(const y in a)d[f++]=y;return d}}}function xc(a,d){if(a.forEach&&typeof a.forEach=="function")a.forEach(d,void 0);else if(u(a)||typeof a=="string")Array.prototype.forEach.call(a,d,void 0);else for(var f=Ea(a),y=Ys(a),P=y.length,O=0;O<P;O++)d.call(void 0,y[O],f&&f[O],a)}var ka=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function _r(a,d){if(a){a=a.split("&");for(var f=0;f<a.length;f++){var y=a[f].indexOf("="),P=null;if(0<=y){var O=a[f].substring(0,y);P=a[f].substring(y+1)}else O=a[f];d(O,P?decodeURIComponent(P.replace(/\+/g," ")):"")}}}function xr(a){if(this.g=this.o=this.j="",this.s=null,this.m=this.l="",this.h=!1,a instanceof xr){this.h=a.h,si(this,a.j),this.o=a.o,this.g=a.g,Xi(this,a.s),this.l=a.l;var d=a.i,f=new wn;f.i=d.i,d.g&&(f.g=new Map(d.g),f.h=d.h),Le(this,f),this.m=a.m}else a&&(d=String(a).match(ka))?(this.h=!1,si(this,d[1]||"",!0),this.o=Rn(d[2]||""),this.g=Rn(d[3]||"",!0),Xi(this,d[4]),this.l=Rn(d[5]||"",!0),Le(this,d[6]||"",!0),this.m=Rn(d[7]||"")):(this.h=!1,this.i=new wn(null,this.h))}xr.prototype.toString=function(){var a=[],d=this.j;d&&a.push(Er(d,Ec,!0),":");var f=this.g;return(f||d=="file")&&(a.push("//"),(d=this.o)&&a.push(Er(d,Ec,!0),"@"),a.push(encodeURIComponent(String(f)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),f=this.s,f!=null&&a.push(":",String(f))),(f=this.l)&&(this.g&&f.charAt(0)!="/"&&a.push("/"),a.push(Er(f,f.charAt(0)=="/"?Ta:oh,!0))),(f=this.i.toString())&&a.push("?",f),(f=this.m)&&a.push("#",Er(f,Xs)),a.join("")};function Pn(a){return new xr(a)}function si(a,d,f){a.j=f?Rn(d,!0):d,a.j&&(a.j=a.j.replace(/:$/,""))}function Xi(a,d){if(d){if(d=Number(d),isNaN(d)||0>d)throw Error("Bad port number "+d);a.s=d}else a.s=null}function Le(a,d,f){d instanceof wn?(a.i=d,ba(a.i,a.h)):(f||(d=Er(d,ah)),a.i=new wn(d,a.h))}function _e(a,d,f){a.i.set(d,f)}function Js(a){return _e(a,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),a}function Rn(a,d){return a?d?decodeURI(a.replace(/%25/g,"%2525")):decodeURIComponent(a):""}function Er(a,d,f){return typeof a=="string"?(a=encodeURI(a).replace(d,Zi),f&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),a):null}function Zi(a){return a=a.charCodeAt(0),"%"+(a>>4&15).toString(16)+(a&15).toString(16)}var Ec=/[#\/\?@]/g,oh=/[#\?:]/g,Ta=/[#\?]/g,ah=/[#\?@]/g,Xs=/#/g;function wn(a,d){this.h=this.g=null,this.i=a||null,this.j=!!d}function Kn(a){a.g||(a.g=new Map,a.h=0,a.i&&_r(a.i,function(d,f){a.add(decodeURIComponent(d.replace(/\+/g," ")),f)}))}t=wn.prototype,t.add=function(a,d){Kn(this),this.i=null,a=Ke(this,a);var f=this.g.get(a);return f||this.g.set(a,f=[]),f.push(d),this.h+=1,this};function _(a,d){Kn(a),d=Ke(a,d),a.g.has(d)&&(a.i=null,a.h-=a.g.get(d).length,a.g.delete(d))}function kc(a,d){return Kn(a),d=Ke(a,d),a.g.has(d)}t.forEach=function(a,d){Kn(this),this.g.forEach(function(f,y){f.forEach(function(P){a.call(d,P,y,this)},this)},this)},t.na=function(){Kn(this);const a=Array.from(this.g.values()),d=Array.from(this.g.keys()),f=[];for(let y=0;y<d.length;y++){const P=a[y];for(let O=0;O<P.length;O++)f.push(d[y])}return f},t.V=function(a){Kn(this);let d=[];if(typeof a=="string")kc(this,a)&&(d=d.concat(this.g.get(Ke(this,a))));else{a=Array.from(this.g.values());for(let f=0;f<a.length;f++)d=d.concat(a[f])}return d},t.set=function(a,d){return Kn(this),this.i=null,a=Ke(this,a),kc(this,a)&&(this.h-=this.g.get(a).length),this.g.set(a,[d]),this.h+=1,this},t.get=function(a,d){return a?(a=this.V(a),0<a.length?String(a[0]):d):d};function Tc(a,d,f){_(a,d),0<f.length&&(a.i=null,a.g.set(Ke(a,d),L(f)),a.h+=f.length)}t.toString=function(){if(this.i)return this.i;if(!this.g)return"";const a=[],d=Array.from(this.g.keys());for(var f=0;f<d.length;f++){var y=d[f];const O=encodeURIComponent(String(y)),Q=this.V(y);for(y=0;y<Q.length;y++){var P=O;Q[y]!==""&&(P+="="+encodeURIComponent(String(Q[y]))),a.push(P)}}return this.i=a.join("&")};function Ke(a,d){return d=String(d),a.j&&(d=d.toLowerCase()),d}function ba(a,d){d&&!a.j&&(Kn(a),a.i=null,a.g.forEach(function(f,y){var P=y.toLowerCase();y!=P&&(_(this,y),Tc(this,P,f))},a)),a.j=d}function lh(a,d){const f=new ri;if(l.Image){const y=new Image;y.onload=N(Gn,f,"TestLoadImage: loaded",!0,d,y),y.onerror=N(Gn,f,"TestLoadImage: error",!1,d,y),y.onabort=N(Gn,f,"TestLoadImage: abort",!1,d,y),y.ontimeout=N(Gn,f,"TestLoadImage: timeout",!1,d,y),l.setTimeout(function(){y.ontimeout&&y.ontimeout()},1e4),y.src=a}else d(!1)}function ch(a,d){const f=new ri,y=new AbortController,P=setTimeout(()=>{y.abort(),Gn(f,"TestPingServer: timeout",!1,d)},1e4);fetch(a,{signal:y.signal}).then(O=>{clearTimeout(P),O.ok?Gn(f,"TestPingServer: ok",!0,d):Gn(f,"TestPingServer: server error",!1,d)}).catch(()=>{clearTimeout(P),Gn(f,"TestPingServer: error",!1,d)})}function Gn(a,d,f,y,P){try{P&&(P.onload=null,P.onerror=null,P.onabort=null,P.ontimeout=null),y(f)}catch{}}function uh(){this.g=new yc}function dh(a,d,f){const y=f||"";try{xc(a,function(P,O){let Q=P;h(P)&&(Q=Us(P)),d.push(y+O+"="+encodeURIComponent(Q))})}catch(P){throw d.push(y+"type="+encodeURIComponent("_badmap")),P}}function Zs(a){this.l=a.Ub||null,this.j=a.eb||!1}j(Zs,ti),Zs.prototype.g=function(){return new eo(this.l,this.j)},Zs.prototype.i=function(a){return function(){return a}}({});function eo(a,d){He.call(this),this.D=a,this.o=d,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}j(eo,He),t=eo.prototype,t.open=function(a,d){if(this.readyState!=0)throw this.abort(),Error("Error reopening a connection");this.B=a,this.A=d,this.readyState=1,Qn(this)},t.send=function(a){if(this.readyState!=1)throw this.abort(),Error("need to call open() first. ");this.g=!0;const d={headers:this.u,method:this.B,credentials:this.m,cache:void 0};a&&(d.body=a),(this.D||l).fetch(new Request(this.A,d)).then(this.Sa.bind(this),this.ga.bind(this))},t.abort=function(){this.response=this.responseText="",this.u=new Headers,this.status=0,this.j&&this.j.cancel("Request was aborted.").catch(()=>{}),1<=this.readyState&&this.g&&this.readyState!=4&&(this.g=!1,es(this)),this.readyState=0},t.Sa=function(a){if(this.g&&(this.l=a,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=a.headers,this.readyState=2,Qn(this)),this.g&&(this.readyState=3,Qn(this),this.g)))if(this.responseType==="arraybuffer")a.arrayBuffer().then(this.Qa.bind(this),this.ga.bind(this));else if(typeof l.ReadableStream<"u"&&"body"in a){if(this.j=a.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;bc(this)}else a.text().then(this.Ra.bind(this),this.ga.bind(this))};function bc(a){a.j.read().then(a.Pa.bind(a)).catch(a.ga.bind(a))}t.Pa=function(a){if(this.g){if(this.o&&a.value)this.response.push(a.value);else if(!this.o){var d=a.value?a.value:new Uint8Array(0);(d=this.v.decode(d,{stream:!a.done}))&&(this.response=this.responseText+=d)}a.done?es(this):Qn(this),this.readyState==3&&bc(this)}},t.Ra=function(a){this.g&&(this.response=this.responseText=a,es(this))},t.Qa=function(a){this.g&&(this.response=a,es(this))},t.ga=function(){this.g&&es(this)};function es(a){a.readyState=4,a.l=null,a.j=null,a.v=null,Qn(a)}t.setRequestHeader=function(a,d){this.u.append(a,d)},t.getResponseHeader=function(a){return this.h&&this.h.get(a.toLowerCase())||""},t.getAllResponseHeaders=function(){if(!this.h)return"";const a=[],d=this.h.entries();for(var f=d.next();!f.done;)f=f.value,a.push(f[0]+": "+f[1]),f=d.next();return a.join(`\r
|
|
`)};function Qn(a){a.onreadystatechange&&a.onreadystatechange.call(a)}Object.defineProperty(eo.prototype,"withCredentials",{get:function(){return this.m==="include"},set:function(a){this.m=a?"include":"same-origin"}});function Sc(a){let d="";return H(a,function(f,y){d+=y,d+=":",d+=f,d+=`\r
|
|
`}),d}function to(a,d,f){e:{for(y in f){var y=!1;break e}y=!0}y||(f=Sc(f),typeof a=="string"?f!=null&&encodeURIComponent(String(f)):_e(a,d,f))}function Me(a){He.call(this),this.headers=new Map,this.o=a||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}j(Me,He);var hh=/^https?$/i,fh=["POST","PUT"];t=Me.prototype,t.Ha=function(a){this.J=a},t.ea=function(a,d,f,y){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+a);d=d?d.toUpperCase():"GET",this.D=a,this.l="",this.m=0,this.A=!1,this.h=!0,this.g=this.o?this.o.g():ft.g(),this.v=this.o?ma(this.o):ma(ft),this.g.onreadystatechange=g(this.Ea,this);try{this.B=!0,this.g.open(d,String(a),!0),this.B=!1}catch(O){Yn(this,O);return}if(a=f||"",f=new Map(this.headers),y)if(Object.getPrototypeOf(y)===Object.prototype)for(var P in y)f.set(P,y[P]);else if(typeof y.keys=="function"&&typeof y.get=="function")for(const O of y.keys())f.set(O,y.get(O));else throw Error("Unknown input type for opt_headers: "+String(y));y=Array.from(f.keys()).find(O=>O.toLowerCase()=="content-type"),P=l.FormData&&a instanceof l.FormData,!(0<=Array.prototype.indexOf.call(fh,d,void 0))||y||P||f.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[O,Q]of f)this.g.setRequestHeader(O,Q);this.H&&(this.g.responseType=this.H),"withCredentials"in this.g&&this.g.withCredentials!==this.J&&(this.g.withCredentials=this.J);try{Ic(this),this.u=!0,this.g.send(a),this.u=!1}catch(O){Yn(this,O)}};function Yn(a,d){a.h=!1,a.g&&(a.j=!0,a.g.abort(),a.j=!1),a.l=d,a.m=5,no(a),io(a)}function no(a){a.A||(a.A=!0,Ze(a,"complete"),Ze(a,"error"))}t.abort=function(a){this.g&&this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1,this.m=a||7,Ze(this,"complete"),Ze(this,"abort"),io(this))},t.N=function(){this.g&&(this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1),io(this,!0)),Me.aa.N.call(this)},t.Ea=function(){this.s||(this.B||this.u||this.j?ro(this):this.bb())},t.bb=function(){ro(this)};function ro(a){if(a.h&&typeof o<"u"&&(!a.v[1]||_n(a)!=4||a.Z()!=2)){if(a.u&&_n(a)==4)ha(a.Ea,0,a);else if(Ze(a,"readystatechange"),_n(a)==4){a.h=!1;try{const Q=a.Z();e:switch(Q){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var d=!0;break e;default:d=!1}var f;if(!(f=d)){var y;if(y=Q===0){var P=String(a.D).match(ka)[1]||null;!P&&l.self&&l.self.location&&(P=l.self.location.protocol.slice(0,-1)),y=!hh.test(P?P.toLowerCase():"")}f=y}if(f)Ze(a,"complete"),Ze(a,"success");else{a.m=6;try{var O=2<_n(a)?a.g.statusText:""}catch{O=""}a.l=O+" ["+a.Z()+"]",no(a)}}finally{io(a)}}}}function io(a,d){if(a.g){Ic(a);const f=a.g,y=a.v[0]?()=>{}:null;a.g=null,a.v=null,d||Ze(a,"ready");try{f.onreadystatechange=y}catch{}}}function Ic(a){a.I&&(l.clearTimeout(a.I),a.I=null)}t.isActive=function(){return!!this.g};function _n(a){return a.g?a.g.readyState:0}t.Z=function(){try{return 2<_n(this)?this.g.status:-1}catch{return-1}},t.oa=function(){try{return this.g?this.g.responseText:""}catch{return""}},t.Oa=function(a){if(this.g){var d=this.g.responseText;return a&&d.indexOf(a)==0&&(d=d.substring(a.length)),mr(d)}};function Sa(a){try{if(!a.g)return null;if("response"in a.g)return a.g.response;switch(a.H){case"":case"text":return a.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in a.g)return a.g.mozResponseArrayBuffer}return null}catch{return null}}function ph(a){const d={};a=(a.g&&2<=_n(a)&&a.g.getAllResponseHeaders()||"").split(`\r
|
|
`);for(let y=0;y<a.length;y++){if(k(a[y]))continue;var f=A(a[y]);const P=f[0];if(f=f[1],typeof f!="string")continue;f=f.trim();const O=d[P]||[];d[P]=O,O.push(f)}T(d,function(y){return y.join(", ")})}t.Ba=function(){return this.m},t.Ka=function(){return typeof this.l=="string"?this.l:String(this.l)};function oi(a,d,f){return f&&f.internalChannelParams&&f.internalChannelParams[a]||d}function ts(a){this.Aa=0,this.i=[],this.j=new ri,this.ia=this.qa=this.I=this.W=this.g=this.ya=this.D=this.H=this.m=this.S=this.o=null,this.Ya=this.U=0,this.Va=oi("failFast",!1,a),this.F=this.C=this.u=this.s=this.l=null,this.X=!0,this.za=this.T=-1,this.Y=this.v=this.B=0,this.Ta=oi("baseRetryDelayMs",5e3,a),this.cb=oi("retryDelaySeedMs",1e4,a),this.Wa=oi("forwardChannelMaxRetries",2,a),this.wa=oi("forwardChannelRequestTimeoutMs",2e4,a),this.pa=a&&a.xmlHttpFactory||void 0,this.Xa=a&&a.Tb||void 0,this.Ca=a&&a.useFetchStreams||!1,this.L=void 0,this.J=a&&a.supportsCrossDomainXhr||!1,this.K="",this.h=new _c(a&&a.concurrentRequestLimit),this.Da=new uh,this.P=a&&a.fastHandshake||!1,this.O=a&&a.encodeInitMessageHeaders||!1,this.P&&this.O&&(this.O=!1),this.Ua=a&&a.Rb||!1,a&&a.xa&&this.j.xa(),a&&a.forceLongPolling&&(this.X=!1),this.ba=!this.P&&this.X&&a&&a.detectBufferingProxy||!1,this.ja=void 0,a&&a.longPollingTimeout&&0<a.longPollingTimeout&&(this.ja=a.longPollingTimeout),this.ca=void 0,this.R=0,this.M=!1,this.ka=this.A=null}t=ts.prototype,t.la=8,t.G=1,t.connect=function(a,d,f,y){wt(0),this.W=a,this.H=d||{},f&&y!==void 0&&(this.H.OSID=f,this.H.OAID=y),this.F=this.X,this.I=Rc(this,null,this.W),kr(this)};function so(a){if(Ia(a),a.G==3){var d=a.U++,f=Pn(a.I);if(_e(f,"SID",a.K),_e(f,"RID",d),_e(f,"TYPE","terminate"),ns(a,f),d=new Wn(a,a.j,d),d.L=2,d.v=Js(Pn(f)),f=!1,l.navigator&&l.navigator.sendBeacon)try{f=l.navigator.sendBeacon(d.v.toString(),"")}catch{}!f&&l.Image&&(new Image().src=d.v,f=!0),f||(d.g=Dc(d.j,null),d.g.ea(d.v)),d.F=Date.now(),Nt(d)}Pc(a)}function ai(a){a.g&&(Na(a),a.g.cancel(),a.g=null)}function Ia(a){ai(a),a.u&&(l.clearTimeout(a.u),a.u=null),oo(a),a.h.cancel(),a.s&&(typeof a.s=="number"&&l.clearTimeout(a.s),a.s=null)}function kr(a){if(!wr(a.h)&&!a.s){a.s=!0;var d=a.Ga;Yt||se(),Y||(Yt(),Y=!0),ae.add(d,a),a.B=0}}function mh(a,d){return Ks(a.h)>=a.h.j-(a.s?1:0)?!1:a.s?(a.i=d.D.concat(a.i),!0):a.G==1||a.G==2||a.B>=(a.Va?0:a.Wa)?!1:(a.s=Xt(g(a.Ga,a,d),Nc(a,a.B)),a.B++,!0)}t.Ga=function(a){if(this.s)if(this.s=null,this.G==1){if(!a){this.U=Math.floor(1e5*Math.random()),a=this.U++;const P=new Wn(this,this.j,a);let O=this.o;if(this.S&&(O?(O=w(O),S(O,this.S)):O=this.S),this.m!==null||this.O||(P.H=O,O=null),this.P)e:{for(var d=0,f=0;f<this.i.length;f++){t:{var y=this.i[f];if("__data__"in y.map&&(y=y.map.__data__,typeof y=="string")){y=y.length;break t}y=void 0}if(y===void 0)break;if(d+=y,4096<d){d=f;break e}if(d===4096||f===this.i.length-1){d=f+1;break e}}d=1e3}else d=1e3;d=Tr(this,P,d),f=Pn(this.I),_e(f,"RID",a),_e(f,"CVER",22),this.D&&_e(f,"X-HTTP-Session-Id",this.D),ns(this,f),O&&(this.O?d="headers="+encodeURIComponent(String(Sc(O)))+"&"+d:this.m&&to(f,this.m,O)),Ji(this.h,P),this.Ua&&_e(f,"TYPE","init"),this.P?(_e(f,"$req",d),_e(f,"SID","null"),P.T=!0,Yi(P,f,null)):Yi(P,f,d),this.G=2}}else this.G==3&&(a?Ca(this,a):this.i.length==0||wr(this.h)||Ca(this))};function Ca(a,d){var f;d?f=d.l:f=a.U++;const y=Pn(a.I);_e(y,"SID",a.K),_e(y,"RID",f),_e(y,"AID",a.T),ns(a,y),a.m&&a.o&&to(y,a.m,a.o),f=new Wn(a,a.j,f,a.B+1),a.m===null&&(f.H=a.o),d&&(a.i=d.D.concat(a.i)),d=Tr(a,f,1e3),f.I=Math.round(.5*a.wa)+Math.round(.5*a.wa*Math.random()),Ji(a.h,f),Yi(f,y,d)}function ns(a,d){a.H&&H(a.H,function(f,y){_e(d,y,f)}),a.l&&xc({},function(f,y){_e(d,y,f)})}function Tr(a,d,f){f=Math.min(a.i.length,f);var y=a.l?g(a.l.Na,a.l,a):null;e:{var P=a.i;let O=-1;for(;;){const Q=["count="+f];O==-1?0<f?(O=P[0].g,Q.push("ofs="+O)):O=0:Q.push("ofs="+O);let Ee=!0;for(let tt=0;tt<f;tt++){let ge=P[tt].g;const ot=P[tt].map;if(ge-=O,0>ge)O=Math.max(0,P[tt].g-100),Ee=!1;else try{dh(ot,Q,"req"+ge+"_")}catch{y&&y(ot)}}if(Ee){y=Q.join("&");break e}}}return a=a.i.splice(0,f),d.D=a,y}function Cc(a){if(!a.g&&!a.u){a.Y=1;var d=a.Fa;Yt||se(),Y||(Yt(),Y=!0),ae.add(d,a),a.v=0}}function Aa(a){return a.g||a.u||3<=a.v?!1:(a.Y++,a.u=Xt(g(a.Fa,a),Nc(a,a.v)),a.v++,!0)}t.Fa=function(){if(this.u=null,Ac(this),this.ba&&!(this.M||this.g==null||0>=this.R)){var a=2*this.R;this.j.info("BP detection timer enabled: "+a),this.A=Xt(g(this.ab,this),a)}},t.ab=function(){this.A&&(this.A=null,this.j.info("BP detection timeout reached."),this.j.info("Buffering proxy detected and switch to long-polling!"),this.F=!1,this.M=!0,wt(10),ai(this),Ac(this))};function Na(a){a.A!=null&&(l.clearTimeout(a.A),a.A=null)}function Ac(a){a.g=new Wn(a,a.j,"rpc",a.Y),a.m===null&&(a.g.H=a.o),a.g.O=0;var d=Pn(a.qa);_e(d,"RID","rpc"),_e(d,"SID",a.K),_e(d,"AID",a.T),_e(d,"CI",a.F?"0":"1"),!a.F&&a.ja&&_e(d,"TO",a.ja),_e(d,"TYPE","xmlhttp"),ns(a,d),a.m&&a.o&&to(d,a.m,a.o),a.L&&(a.g.I=a.L);var f=a.g;a=a.ia,f.L=1,f.v=Js(Pn(d)),f.m=null,f.P=!0,_a(f,a)}t.Za=function(){this.C!=null&&(this.C=null,ai(this),Aa(this),wt(19))};function oo(a){a.C!=null&&(l.clearTimeout(a.C),a.C=null)}function Pa(a,d){var f=null;if(a.g==d){oo(a),Na(a),a.g=null;var y=2}else if(Hn(a.h,d))f=d.D,Gs(a.h,d),y=1;else return;if(a.G!=0){if(d.o)if(y==1){f=d.m?d.m.length:0,d=Date.now()-d.F;var P=a.B;y=Ue(),Ze(y,new Gi(y,f)),kr(a)}else Cc(a);else if(P=d.s,P==3||P==0&&0<d.X||!(y==1&&mh(a,d)||y==2&&Aa(a)))switch(f&&0<f.length&&(d=a.h,d.i=d.i.concat(f)),P){case 1:br(a,5);break;case 4:br(a,10);break;case 3:br(a,6);break;default:br(a,2)}}}function Nc(a,d){let f=a.Ta+Math.floor(Math.random()*a.cb);return a.isActive()||(f*=2),f*d}function br(a,d){if(a.j.info("Error code "+d),d==2){var f=g(a.fb,a),y=a.Xa;const P=!y;y=new xr(y||"//www.google.com/images/cleardot.gif"),l.location&&l.location.protocol=="http"||si(y,"https"),Js(y),P?lh(y.toString(),f):ch(y.toString(),f)}else wt(2);a.G=0,a.l&&a.l.sa(d),Pc(a),Ia(a)}t.fb=function(a){a?(this.j.info("Successfully pinged google.com"),wt(2)):(this.j.info("Failed to ping google.com"),wt(1))};function Pc(a){if(a.G=0,a.ka=[],a.l){const d=Qs(a.h);(d.length!=0||a.i.length!=0)&&(B(a.ka,d),B(a.ka,a.i),a.h.i.length=0,L(a.i),a.i.length=0),a.l.ra()}}function Rc(a,d,f){var y=f instanceof xr?Pn(f):new xr(f);if(y.g!="")d&&(y.g=d+"."+y.g),Xi(y,y.s);else{var P=l.location;y=P.protocol,d=d?d+"."+P.hostname:P.hostname,P=+P.port;var O=new xr(null);y&&si(O,y),d&&(O.g=d),P&&Xi(O,P),f&&(O.l=f),y=O}return f=a.D,d=a.ya,f&&d&&_e(y,f,d),_e(y,"VER",a.la),ns(a,y),y}function Dc(a,d,f){if(d&&!a.J)throw Error("Can't create secondary domain capable XhrIo object.");return d=a.Ca&&!a.pa?new Me(new Zs({eb:f})):new Me(a.pa),d.Ha(a.J),d}t.isActive=function(){return!!this.l&&this.l.isActive(this)};function jc(){}t=jc.prototype,t.ua=function(){},t.ta=function(){},t.sa=function(){},t.ra=function(){},t.isActive=function(){return!0},t.Na=function(){};function ao(){}ao.prototype.g=function(a,d){return new zt(a,d)};function zt(a,d){He.call(this),this.g=new ts(d),this.l=a,this.h=d&&d.messageUrlParams||null,a=d&&d.messageHeaders||null,d&&d.clientProtocolHeaderRequired&&(a?a["X-Client-Protocol"]="webchannel":a={"X-Client-Protocol":"webchannel"}),this.g.o=a,a=d&&d.initMessageHeaders||null,d&&d.messageContentType&&(a?a["X-WebChannel-Content-Type"]=d.messageContentType:a={"X-WebChannel-Content-Type":d.messageContentType}),d&&d.va&&(a?a["X-WebChannel-Client-Profile"]=d.va:a={"X-WebChannel-Client-Profile":d.va}),this.g.S=a,(a=d&&d.Sb)&&!k(a)&&(this.g.m=a),this.v=d&&d.supportsCrossDomainXhr||!1,this.u=d&&d.sendRawJson||!1,(d=d&&d.httpSessionIdParam)&&!k(d)&&(this.g.D=d,a=this.h,a!==null&&d in a&&(a=this.h,d in a&&delete a[d])),this.j=new li(this)}j(zt,He),zt.prototype.m=function(){this.g.l=this.j,this.v&&(this.g.J=!0),this.g.connect(this.l,this.h||void 0)},zt.prototype.close=function(){so(this.g)},zt.prototype.o=function(a){var d=this.g;if(typeof a=="string"){var f={};f.__data__=a,a=f}else this.u&&(f={},f.__data__=Us(a),a=f);d.i.push(new sh(d.Ya++,a)),d.G==3&&kr(d)},zt.prototype.N=function(){this.g.l=null,delete this.j,so(this.g),delete this.g,zt.aa.N.call(this)};function Oc(a){gr.call(this),a.__headers__&&(this.headers=a.__headers__,this.statusCode=a.__status__,delete a.__headers__,delete a.__status__);var d=a.__sm__;if(d){e:{for(const f in d){a=f;break e}a=void 0}(this.i=a)&&(a=this.i,d=d!==null&&a in d?d[a]:void 0),this.data=d}else this.data=a}j(Oc,gr);function Lc(){zs.call(this),this.status=1}j(Lc,zs);function li(a){this.g=a}j(li,jc),li.prototype.ua=function(){Ze(this.g,"a")},li.prototype.ta=function(a){Ze(this.g,new Oc(a))},li.prototype.sa=function(a){Ze(this.g,new Lc)},li.prototype.ra=function(){Ze(this.g,"b")},ao.prototype.createWebChannel=ao.prototype.g,zt.prototype.send=zt.prototype.o,zt.prototype.open=zt.prototype.m,zt.prototype.close=zt.prototype.close,Fx=function(){return new ao},Vx=function(){return Ue()},Mx=qn,pp={mb:0,pb:1,qb:2,Jb:3,Ob:4,Lb:5,Mb:6,Kb:7,Ib:8,Nb:9,PROXY:10,NOPROXY:11,Gb:12,Cb:13,Db:14,Bb:15,Eb:16,Fb:17,ib:18,hb:19,jb:20},yr.NO_ERROR=0,yr.TIMEOUT=8,yr.HTTP_ERROR=6,Su=yr,va.COMPLETE="complete",Lx=va,Hi.EventType=ni,ni.OPEN="a",ni.CLOSE="b",ni.ERROR="c",ni.MESSAGE="d",He.prototype.listen=He.prototype.K,tl=Hi,Me.prototype.listenOnce=Me.prototype.L,Me.prototype.getLastError=Me.prototype.Ka,Me.prototype.getLastErrorCode=Me.prototype.Ba,Me.prototype.getStatus=Me.prototype.Z,Me.prototype.getResponseJson=Me.prototype.Oa,Me.prototype.getResponseText=Me.prototype.oa,Me.prototype.send=Me.prototype.ea,Me.prototype.setWithCredentials=Me.prototype.Ha,Ox=Me}).apply(typeof ru<"u"?ru:typeof self<"u"?self:typeof window<"u"?window:{});const Pv="@firebase/firestore";/**
|
|
* @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 Ot{constructor(e){this.uid=e}isAuthenticated(){return this.uid!=null}toKey(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"}isEqual(e){return e.uid===this.uid}}Ot.UNAUTHENTICATED=new Ot(null),Ot.GOOGLE_CREDENTIALS=new Ot("google-credentials-uid"),Ot.FIRST_PARTY=new Ot("first-party-uid"),Ot.MOCK_USER=new Ot("mock-user");/**
|
|
* @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.
|
|
*/let oa="10.14.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 bs=new bm("@firebase/firestore");function Wa(){return bs.logLevel}function re(t,...e){if(bs.logLevel<=ye.DEBUG){const n=e.map(Mm);bs.debug(`Firestore (${oa}): ${t}`,...n)}}function Kr(t,...e){if(bs.logLevel<=ye.ERROR){const n=e.map(Mm);bs.error(`Firestore (${oa}): ${t}`,...n)}}function Ko(t,...e){if(bs.logLevel<=ye.WARN){const n=e.map(Mm);bs.warn(`Firestore (${oa}): ${t}`,...n)}}function Mm(t){if(typeof t=="string")return t;try{/**
|
|
* @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.
|
|
*/return function(n){return JSON.stringify(n)}(t)}catch{return 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.
|
|
*/function ce(t="Unexpected state"){const e=`FIRESTORE (${oa}) INTERNAL ASSERTION FAILED: `+t;throw Kr(e),new Error(e)}function Se(t,e){t||ce()}function he(t,e){return 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 U={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"};class Z extends fr{constructor(e,n){super(e,n),this.code=e,this.message=n,this.toString=()=>`${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 Ur{constructor(){this.promise=new Promise((e,n)=>{this.resolve=e,this.reject=n})}}/**
|
|
* @license
|
|
* Copyright 2017 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class Ux{constructor(e,n){this.user=n,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${e}`)}}class lA{getToken(){return Promise.resolve(null)}invalidateToken(){}start(e,n){e.enqueueRetryable(()=>n(Ot.UNAUTHENTICATED))}shutdown(){}}class cA{constructor(e){this.token=e,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(e,n){this.changeListener=n,e.enqueueRetryable(()=>n(this.token.user))}shutdown(){this.changeListener=null}}class uA{constructor(e){this.t=e,this.currentUser=Ot.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(e,n){Se(this.o===void 0);let r=this.i;const i=u=>this.i!==r?(r=this.i,n(u)):Promise.resolve();let s=new Ur;this.o=()=>{this.i++,this.currentUser=this.u(),s.resolve(),s=new Ur,e.enqueueRetryable(()=>i(this.currentUser))};const o=()=>{const u=s;e.enqueueRetryable(async()=>{await u.promise,await i(this.currentUser)})},l=u=>{re("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=u,this.o&&(this.auth.addAuthTokenListener(this.o),o())};this.t.onInit(u=>l(u)),setTimeout(()=>{if(!this.auth){const u=this.t.getImmediate({optional:!0});u?l(u):(re("FirebaseAuthCredentialsProvider","Auth not yet detected"),s.resolve(),s=new Ur)}},0),o()}getToken(){const e=this.i,n=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(n).then(r=>this.i!==e?(re("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):r?(Se(typeof r.accessToken=="string"),new Ux(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 Se(e===null||typeof e=="string"),new Ot(e)}}class dA{constructor(e,n,r){this.l=e,this.h=n,this.P=r,this.type="FirstParty",this.user=Ot.FIRST_PARTY,this.I=new Map}T(){return this.P?this.P():null}get headers(){this.I.set("X-Goog-AuthUser",this.l);const e=this.T();return e&&this.I.set("Authorization",e),this.h&&this.I.set("X-Goog-Iam-Authorization-Token",this.h),this.I}}class hA{constructor(e,n,r){this.l=e,this.h=n,this.P=r}getToken(){return Promise.resolve(new dA(this.l,this.h,this.P))}start(e,n){e.enqueueRetryable(()=>n(Ot.FIRST_PARTY))}shutdown(){}invalidateToken(){}}class fA{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 pA{constructor(e){this.A=e,this.forceRefresh=!1,this.appCheck=null,this.R=null}start(e,n){Se(this.o===void 0);const r=s=>{s.error!=null&&re("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${s.error.message}`);const o=s.token!==this.R;return this.R=s.token,re("FirebaseAppCheckTokenProvider",`Received ${o?"new":"existing"} token.`),o?n(s.token):Promise.resolve()};this.o=s=>{e.enqueueRetryable(()=>r(s))};const i=s=>{re("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=s,this.o&&this.appCheck.addTokenListener(this.o)};this.A.onInit(s=>i(s)),setTimeout(()=>{if(!this.appCheck){const s=this.A.getImmediate({optional:!0});s?i(s):re("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}},0)}getToken(){const e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then(n=>n?(Se(typeof n.token=="string"),this.R=n.token,new fA(n.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 mA(t){const e=typeof self<"u"&&(self.crypto||self.msCrypto),n=new Uint8Array(t);if(e&&typeof e.getRandomValues=="function")e.getRandomValues(n);else for(let r=0;r<t;r++)n[r]=Math.floor(256*Math.random());return 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 zx{static newId(){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=Math.floor(256/e.length)*e.length;let r="";for(;r.length<20;){const i=mA(40);for(let s=0;s<i.length;++s)r.length<20&&i[s]<n&&(r+=e.charAt(i[s]%e.length))}return r}}function xe(t,e){return t<e?-1:t>e?1:0}function Go(t,e,n){return t.length===e.length&&t.every((r,i)=>n(r,e[i]))}/**
|
|
* @license
|
|
* Copyright 2017 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class ht{constructor(e,n){if(this.seconds=e,this.nanoseconds=n,n<0)throw new Z(U.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+n);if(n>=1e9)throw new Z(U.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+n);if(e<-62135596800)throw new Z(U.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e);if(e>=253402300800)throw new Z(U.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}static now(){return ht.fromMillis(Date.now())}static fromDate(e){return ht.fromMillis(e.getTime())}static fromMillis(e){const n=Math.floor(e/1e3),r=Math.floor(1e6*(e-1e3*n));return new ht(n,r)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/1e6}_compareTo(e){return this.seconds===e.seconds?xe(this.nanoseconds,e.nanoseconds):xe(this.seconds,e.seconds)}isEqual(e){return e.seconds===this.seconds&&e.nanoseconds===this.nanoseconds}toString(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"}toJSON(){return{seconds:this.seconds,nanoseconds:this.nanoseconds}}valueOf(){const e=this.seconds- -62135596800;return String(e).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}}/**
|
|
* @license
|
|
* Copyright 2017 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class de{constructor(e){this.timestamp=e}static fromTimestamp(e){return new de(e)}static min(){return new de(new ht(0,0))}static max(){return new de(new ht(253402300799,999999999))}compareTo(e){return this.timestamp._compareTo(e.timestamp)}isEqual(e){return this.timestamp.isEqual(e.timestamp)}toMicroseconds(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3}toString(){return"SnapshotVersion("+this.timestamp.toString()+")"}toTimestamp(){return this.timestamp}}/**
|
|
* @license
|
|
* Copyright 2017 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class Fl{constructor(e,n,r){n===void 0?n=0:n>e.length&&ce(),r===void 0?r=e.length-n:r>e.length-n&&ce(),this.segments=e,this.offset=n,this.len=r}get length(){return this.len}isEqual(e){return Fl.comparator(this,e)===0}child(e){const n=this.segments.slice(this.offset,this.limit());return e instanceof Fl?e.forEach(r=>{n.push(r)}):n.push(e),this.construct(n)}limit(){return this.offset+this.length}popFirst(e){return e=e===void 0?1:e,this.construct(this.segments,this.offset+e,this.length-e)}popLast(){return this.construct(this.segments,this.offset,this.length-1)}firstSegment(){return this.segments[this.offset]}lastSegment(){return this.get(this.length-1)}get(e){return this.segments[this.offset+e]}isEmpty(){return this.length===0}isPrefixOf(e){if(e.length<this.length)return!1;for(let n=0;n<this.length;n++)if(this.get(n)!==e.get(n))return!1;return!0}isImmediateParentOf(e){if(this.length+1!==e.length)return!1;for(let n=0;n<this.length;n++)if(this.get(n)!==e.get(n))return!1;return!0}forEach(e){for(let n=this.offset,r=this.limit();n<r;n++)e(this.segments[n])}toArray(){return this.segments.slice(this.offset,this.limit())}static comparator(e,n){const r=Math.min(e.length,n.length);for(let i=0;i<r;i++){const s=e.get(i),o=n.get(i);if(s<o)return-1;if(s>o)return 1}return e.length<n.length?-1:e.length>n.length?1:0}}class De extends Fl{construct(e,n,r){return new De(e,n,r)}canonicalString(){return this.toArray().join("/")}toString(){return this.canonicalString()}toUriEncodedString(){return this.toArray().map(encodeURIComponent).join("/")}static fromString(...e){const n=[];for(const r of e){if(r.indexOf("//")>=0)throw new Z(U.INVALID_ARGUMENT,`Invalid segment (${r}). Paths must not contain // in them.`);n.push(...r.split("/").filter(i=>i.length>0))}return new De(n)}static emptyPath(){return new De([])}}const gA=/^[_a-zA-Z][_a-zA-Z0-9]*$/;class Tt extends Fl{construct(e,n,r){return new Tt(e,n,r)}static isValidIdentifier(e){return gA.test(e)}canonicalString(){return this.toArray().map(e=>(e=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),Tt.isValidIdentifier(e)||(e="`"+e+"`"),e)).join(".")}toString(){return this.canonicalString()}isKeyField(){return this.length===1&&this.get(0)==="__name__"}static keyField(){return new Tt(["__name__"])}static fromServerFormat(e){const n=[];let r="",i=0;const s=()=>{if(r.length===0)throw new Z(U.INVALID_ARGUMENT,`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);n.push(r),r=""};let o=!1;for(;i<e.length;){const l=e[i];if(l==="\\"){if(i+1===e.length)throw new Z(U.INVALID_ARGUMENT,"Path has trailing escape character: "+e);const u=e[i+1];if(u!=="\\"&&u!=="."&&u!=="`")throw new Z(U.INVALID_ARGUMENT,"Path has invalid escape sequence: "+e);r+=u,i+=2}else l==="`"?(o=!o,i++):l!=="."||o?(r+=l,i++):(s(),i++)}if(s(),o)throw new Z(U.INVALID_ARGUMENT,"Unterminated ` in path: "+e);return new Tt(n)}static emptyPath(){return new Tt([])}}/**
|
|
* @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){this.path=e}static fromPath(e){return new ie(De.fromString(e))}static fromName(e){return new ie(De.fromString(e).popFirst(5))}static empty(){return new ie(De.emptyPath())}get collectionGroup(){return this.path.popLast().lastSegment()}hasCollectionId(e){return this.path.length>=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&&De.comparator(this.path,e.path)===0}toString(){return this.path.toString()}static comparator(e,n){return De.comparator(e.path,n.path)}static isDocumentKey(e){return e.length%2==0}static fromSegments(e){return new ie(new De(e.slice()))}}function yA(t,e){const n=t.toTimestamp().seconds,r=t.toTimestamp().nanoseconds+1,i=de.fromTimestamp(r===1e9?new ht(n+1,0):new ht(n,r));return new ji(i,ie.empty(),e)}function vA(t){return new ji(t.readTime,t.key,-1)}class ji{constructor(e,n,r){this.readTime=e,this.documentKey=n,this.largestBatchId=r}static min(){return new ji(de.min(),ie.empty(),-1)}static max(){return new ji(de.max(),ie.empty(),-1)}}function wA(t,e){let n=t.readTime.compareTo(e.readTime);return n!==0?n:(n=ie.comparator(t.documentKey,e.documentKey),n!==0?n:xe(t.largestBatchId,e.largestBatchId))}/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/const _A="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.";class xA{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 rc(t){if(t.code!==U.FAILED_PRECONDITION||t.message!==_A)throw t;re("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 ${constructor(e){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e(n=>{this.isDone=!0,this.result=n,this.nextCallback&&this.nextCallback(n)},n=>{this.isDone=!0,this.error=n,this.catchCallback&&this.catchCallback(n)})}catch(e){return this.next(void 0,e)}next(e,n){return this.callbackAttached&&ce(),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(n,this.error):this.wrapSuccess(e,this.result):new $((r,i)=>{this.nextCallback=s=>{this.wrapSuccess(e,s).next(r,i)},this.catchCallback=s=>{this.wrapFailure(n,s).next(r,i)}})}toPromise(){return new Promise((e,n)=>{this.next(e,n)})}wrapUserFunction(e){try{const n=e();return n instanceof $?n:$.resolve(n)}catch(n){return $.reject(n)}}wrapSuccess(e,n){return e?this.wrapUserFunction(()=>e(n)):$.resolve(n)}wrapFailure(e,n){return e?this.wrapUserFunction(()=>e(n)):$.reject(n)}static resolve(e){return new $((n,r)=>{n(e)})}static reject(e){return new $((n,r)=>{r(e)})}static waitFor(e){return new $((n,r)=>{let i=0,s=0,o=!1;e.forEach(l=>{++i,l.next(()=>{++s,o&&s===i&&n()},u=>r(u))}),o=!0,s===i&&n()})}static or(e){let n=$.resolve(!1);for(const r of e)n=n.next(i=>i?$.resolve(i):r());return n}static forEach(e,n){const r=[];return e.forEach((i,s)=>{r.push(n.call(this,i,s))}),this.waitFor(r)}static mapArray(e,n){return new $((r,i)=>{const s=e.length,o=new Array(s);let l=0;for(let u=0;u<s;u++){const h=u;n(e[h]).next(m=>{o[h]=m,++l,l===s&&r(o)},m=>i(m))}})}static doWhile(e,n){return new $((r,i)=>{const s=()=>{e()===!0?n().next(()=>{s()},i):r()};s()})}}function EA(t){const e=t.match(/Android ([\d.]+)/i),n=e?e[1].split(".").slice(0,2).join("."):"-1";return Number(n)}function ic(t){return t.name==="IndexedDbTransactionError"}/**
|
|
* @license
|
|
* Copyright 2018 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class Vm{constructor(e,n){this.previousValue=e,n&&(n.sequenceNumberHandler=r=>this.ie(r),this.se=r=>n.writeSequenceNumber(r))}ie(e){return this.previousValue=Math.max(e,this.previousValue),this.previousValue}next(){const e=++this.previousValue;return this.se&&this.se(e),e}}Vm.oe=-1;function Bd(t){return t==null}function ud(t){return t===0&&1/t==-1/0}function kA(t){return typeof t=="number"&&Number.isInteger(t)&&!ud(t)&&t<=Number.MAX_SAFE_INTEGER&&t>=Number.MIN_SAFE_INTEGER}/**
|
|
* @license
|
|
* Copyright 2017 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/function Rv(t){let e=0;for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&e++;return e}function Ds(t,e){for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&e(n,t[n])}function Bx(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}/**
|
|
* @license
|
|
* Copyright 2017 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class We{constructor(e,n){this.comparator=e,this.root=n||kt.EMPTY}insert(e,n){return new We(this.comparator,this.root.insert(e,n,this.comparator).copy(null,null,kt.BLACK,null,null))}remove(e){return new We(this.comparator,this.root.remove(e,this.comparator).copy(null,null,kt.BLACK,null,null))}get(e){let n=this.root;for(;!n.isEmpty();){const r=this.comparator(e,n.key);if(r===0)return n.value;r<0?n=n.left:r>0&&(n=n.right)}return null}indexOf(e){let n=0,r=this.root;for(;!r.isEmpty();){const i=this.comparator(e,r.key);if(i===0)return n+r.left.size;i<0?r=r.left:(n+=r.left.size+1,r=r.right)}return-1}isEmpty(){return this.root.isEmpty()}get size(){return this.root.size}minKey(){return this.root.minKey()}maxKey(){return this.root.maxKey()}inorderTraversal(e){return this.root.inorderTraversal(e)}forEach(e){this.inorderTraversal((n,r)=>(e(n,r),!1))}toString(){const e=[];return this.inorderTraversal((n,r)=>(e.push(`${n}:${r}`),!1)),`{${e.join(", ")}}`}reverseTraversal(e){return this.root.reverseTraversal(e)}getIterator(){return new iu(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new iu(this.root,e,this.comparator,!1)}getReverseIterator(){return new iu(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new iu(this.root,e,this.comparator,!0)}}class iu{constructor(e,n,r,i){this.isReverse=i,this.nodeStack=[];let s=1;for(;!e.isEmpty();)if(s=n?r(e.key,n):1,n&&i&&(s*=-1),s<0)e=this.isReverse?e.left:e.right;else{if(s===0){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}getNext(){let e=this.nodeStack.pop();const n={key:e.key,value:e.value};if(this.isReverse)for(e=e.left;!e.isEmpty();)this.nodeStack.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack.push(e),e=e.left;return n}hasNext(){return this.nodeStack.length>0}peek(){if(this.nodeStack.length===0)return null;const e=this.nodeStack[this.nodeStack.length-1];return{key:e.key,value:e.value}}}class kt{constructor(e,n,r,i,s){this.key=e,this.value=n,this.color=r??kt.RED,this.left=i??kt.EMPTY,this.right=s??kt.EMPTY,this.size=this.left.size+1+this.right.size}copy(e,n,r,i,s){return new kt(e??this.key,n??this.value,r??this.color,i??this.left,s??this.right)}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min(){return this.left.isEmpty()?this:this.left.min()}minKey(){return this.min().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,n,r){let i=this;const s=r(e,i.key);return i=s<0?i.copy(null,null,null,i.left.insert(e,n,r),null):s===0?i.copy(null,n,null,null,null):i.copy(null,null,null,null,i.right.insert(e,n,r)),i.fixUp()}removeMin(){if(this.left.isEmpty())return kt.EMPTY;let e=this;return e.left.isRed()||e.left.left.isRed()||(e=e.moveRedLeft()),e=e.copy(null,null,null,e.left.removeMin(),null),e.fixUp()}remove(e,n){let r,i=this;if(n(e,i.key)<0)i.left.isEmpty()||i.left.isRed()||i.left.left.isRed()||(i=i.moveRedLeft()),i=i.copy(null,null,null,i.left.remove(e,n),null);else{if(i.left.isRed()&&(i=i.rotateRight()),i.right.isEmpty()||i.right.isRed()||i.right.left.isRed()||(i=i.moveRedRight()),n(e,i.key)===0){if(i.right.isEmpty())return kt.EMPTY;r=i.right.min(),i=i.copy(r.key,r.value,null,null,i.right.removeMin())}i=i.copy(null,null,null,null,i.right.remove(e,n))}return i.fixUp()}isRed(){return this.color}fixUp(){let e=this;return e.right.isRed()&&!e.left.isRed()&&(e=e.rotateLeft()),e.left.isRed()&&e.left.left.isRed()&&(e=e.rotateRight()),e.left.isRed()&&e.right.isRed()&&(e=e.colorFlip()),e}moveRedLeft(){let e=this.colorFlip();return e.right.left.isRed()&&(e=e.copy(null,null,null,null,e.right.rotateRight()),e=e.rotateLeft(),e=e.colorFlip()),e}moveRedRight(){let e=this.colorFlip();return e.left.left.isRed()&&(e=e.rotateRight(),e=e.colorFlip()),e}rotateLeft(){const e=this.copy(null,null,kt.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight(){const e=this.copy(null,null,kt.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip(){const e=this.left.copy(null,null,!this.left.color,null,null),n=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,n)}checkMaxDepth(){const e=this.check();return Math.pow(2,e)<=this.size+1}check(){if(this.isRed()&&this.left.isRed()||this.right.isRed())throw ce();const e=this.left.check();if(e!==this.right.check())throw ce();return e+(this.isRed()?0:1)}}kt.EMPTY=null,kt.RED=!0,kt.BLACK=!1;kt.EMPTY=new class{constructor(){this.size=0}get key(){throw ce()}get value(){throw ce()}get color(){throw ce()}get left(){throw ce()}get right(){throw ce()}copy(e,n,r,i,s){return this}insert(e,n,r){return new kt(e,n)}remove(e,n){return this}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}};/**
|
|
* @license
|
|
* Copyright 2017 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class St{constructor(e){this.comparator=e,this.data=new We(this.comparator)}has(e){return this.data.get(e)!==null}first(){return this.data.minKey()}last(){return this.data.maxKey()}get size(){return this.data.size}indexOf(e){return this.data.indexOf(e)}forEach(e){this.data.inorderTraversal((n,r)=>(e(n),!1))}forEachInRange(e,n){const r=this.data.getIteratorFrom(e[0]);for(;r.hasNext();){const i=r.getNext();if(this.comparator(i.key,e[1])>=0)return;n(i.key)}}forEachWhile(e,n){let r;for(r=n!==void 0?this.data.getIteratorFrom(n):this.data.getIterator();r.hasNext();)if(!e(r.getNext().key))return}firstAfterOrEqual(e){const n=this.data.getIteratorFrom(e);return n.hasNext()?n.getNext().key:null}getIterator(){return new Dv(this.data.getIterator())}getIteratorFrom(e){return new Dv(this.data.getIteratorFrom(e))}add(e){return this.copy(this.data.remove(e).insert(e,!0))}delete(e){return this.has(e)?this.copy(this.data.remove(e)):this}isEmpty(){return this.data.isEmpty()}unionWith(e){let n=this;return n.size<e.size&&(n=e,e=this),e.forEach(r=>{n=n.add(r)}),n}isEqual(e){if(!(e instanceof St)||this.size!==e.size)return!1;const n=this.data.getIterator(),r=e.data.getIterator();for(;n.hasNext();){const i=n.getNext().key,s=r.getNext().key;if(this.comparator(i,s)!==0)return!1}return!0}toArray(){const e=[];return this.forEach(n=>{e.push(n)}),e}toString(){const e=[];return this.forEach(n=>e.push(n)),"SortedSet("+e.toString()+")"}copy(e){const n=new St(this.comparator);return n.data=e,n}}class Dv{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 dn{constructor(e){this.fields=e,e.sort(Tt.comparator)}static empty(){return new dn([])}unionWith(e){let n=new St(Tt.comparator);for(const r of this.fields)n=n.add(r);for(const r of e)n=n.add(r);return new dn(n.toArray())}covers(e){for(const n of this.fields)if(n.isPrefixOf(e))return!0;return!1}isEqual(e){return Go(this.fields,e.fields,(n,r)=>n.isEqual(r))}}/**
|
|
* @license
|
|
* Copyright 2023 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class $x 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 Ct{constructor(e){this.binaryString=e}static fromBase64String(e){const n=function(i){try{return atob(i)}catch(s){throw typeof DOMException<"u"&&s instanceof DOMException?new $x("Invalid base64 string: "+s):s}}(e);return new Ct(n)}static fromUint8Array(e){const n=function(i){let s="";for(let o=0;o<i.length;++o)s+=String.fromCharCode(i[o]);return s}(e);return new Ct(n)}[Symbol.iterator](){let e=0;return{next:()=>e<this.binaryString.length?{value:this.binaryString.charCodeAt(e++),done:!1}:{value:void 0,done:!0}}}toBase64(){return function(n){return btoa(n)}(this.binaryString)}toUint8Array(){return function(n){const r=new Uint8Array(n.length);for(let i=0;i<n.length;i++)r[i]=n.charCodeAt(i);return r}(this.binaryString)}approximateByteSize(){return 2*this.binaryString.length}compareTo(e){return xe(this.binaryString,e.binaryString)}isEqual(e){return this.binaryString===e.binaryString}}Ct.EMPTY_BYTE_STRING=new Ct("");const TA=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function Oi(t){if(Se(!!t),typeof t=="string"){let e=0;const n=TA.exec(t);if(Se(!!n),n[1]){let i=n[1];i=(i+"000000000").substr(0,9),e=Number(i)}const r=new Date(t);return{seconds:Math.floor(r.getTime()/1e3),nanos:e}}return{seconds:Ye(t.seconds),nanos:Ye(t.nanos)}}function Ye(t){return typeof t=="number"?t:typeof t=="string"?Number(t):0}function Ss(t){return typeof t=="string"?Ct.fromBase64String(t):Ct.fromUint8Array(t)}/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/function Fm(t){var e,n;return((n=(((e=t==null?void 0:t.mapValue)===null||e===void 0?void 0:e.fields)||{}).__type__)===null||n===void 0?void 0:n.stringValue)==="server_timestamp"}function Um(t){const e=t.mapValue.fields.__previous_value__;return Fm(e)?Um(e):e}function Ul(t){const e=Oi(t.mapValue.fields.__local_write_time__.timestampValue);return new ht(e.seconds,e.nanos)}/**
|
|
* @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 bA{constructor(e,n,r,i,s,o,l,u,h){this.databaseId=e,this.appId=n,this.persistenceKey=r,this.host=i,this.ssl=s,this.forceLongPolling=o,this.autoDetectLongPolling=l,this.longPollingOptions=u,this.useFetchStreams=h}}class zl{constructor(e,n){this.projectId=e,this.database=n||"(default)"}static empty(){return new zl("","")}get isDefaultDatabase(){return this.database==="(default)"}isEqual(e){return e instanceof zl&&e.projectId===this.projectId&&e.database===this.database}}/**
|
|
* @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={mapValue:{}};function Is(t){return"nullValue"in t?0:"booleanValue"in t?1:"integerValue"in t||"doubleValue"in t?2:"timestampValue"in t?3:"stringValue"in t?5:"bytesValue"in t?6:"referenceValue"in t?7:"geoPointValue"in t?8:"arrayValue"in t?9:"mapValue"in t?Fm(t)?4:IA(t)?9007199254740991:SA(t)?10:11:ce()}function dr(t,e){if(t===e)return!0;const n=Is(t);if(n!==Is(e))return!1;switch(n){case 0:case 9007199254740991:return!0;case 1:return t.booleanValue===e.booleanValue;case 4:return Ul(t).isEqual(Ul(e));case 3:return function(i,s){if(typeof i.timestampValue=="string"&&typeof s.timestampValue=="string"&&i.timestampValue.length===s.timestampValue.length)return i.timestampValue===s.timestampValue;const o=Oi(i.timestampValue),l=Oi(s.timestampValue);return o.seconds===l.seconds&&o.nanos===l.nanos}(t,e);case 5:return t.stringValue===e.stringValue;case 6:return function(i,s){return Ss(i.bytesValue).isEqual(Ss(s.bytesValue))}(t,e);case 7:return t.referenceValue===e.referenceValue;case 8:return function(i,s){return Ye(i.geoPointValue.latitude)===Ye(s.geoPointValue.latitude)&&Ye(i.geoPointValue.longitude)===Ye(s.geoPointValue.longitude)}(t,e);case 2:return function(i,s){if("integerValue"in i&&"integerValue"in s)return Ye(i.integerValue)===Ye(s.integerValue);if("doubleValue"in i&&"doubleValue"in s){const o=Ye(i.doubleValue),l=Ye(s.doubleValue);return o===l?ud(o)===ud(l):isNaN(o)&&isNaN(l)}return!1}(t,e);case 9:return Go(t.arrayValue.values||[],e.arrayValue.values||[],dr);case 10:case 11:return function(i,s){const o=i.mapValue.fields||{},l=s.mapValue.fields||{};if(Rv(o)!==Rv(l))return!1;for(const u in o)if(o.hasOwnProperty(u)&&(l[u]===void 0||!dr(o[u],l[u])))return!1;return!0}(t,e);default:return ce()}}function Bl(t,e){return(t.values||[]).find(n=>dr(n,e))!==void 0}function Qo(t,e){if(t===e)return 0;const n=Is(t),r=Is(e);if(n!==r)return xe(n,r);switch(n){case 0:case 9007199254740991:return 0;case 1:return xe(t.booleanValue,e.booleanValue);case 2:return function(s,o){const l=Ye(s.integerValue||s.doubleValue),u=Ye(o.integerValue||o.doubleValue);return l<u?-1:l>u?1:l===u?0:isNaN(l)?isNaN(u)?0:-1:1}(t,e);case 3:return jv(t.timestampValue,e.timestampValue);case 4:return jv(Ul(t),Ul(e));case 5:return xe(t.stringValue,e.stringValue);case 6:return function(s,o){const l=Ss(s),u=Ss(o);return l.compareTo(u)}(t.bytesValue,e.bytesValue);case 7:return function(s,o){const l=s.split("/"),u=o.split("/");for(let h=0;h<l.length&&h<u.length;h++){const m=xe(l[h],u[h]);if(m!==0)return m}return xe(l.length,u.length)}(t.referenceValue,e.referenceValue);case 8:return function(s,o){const l=xe(Ye(s.latitude),Ye(o.latitude));return l!==0?l:xe(Ye(s.longitude),Ye(o.longitude))}(t.geoPointValue,e.geoPointValue);case 9:return Ov(t.arrayValue,e.arrayValue);case 10:return function(s,o){var l,u,h,m;const v=s.fields||{},g=o.fields||{},N=(l=v.value)===null||l===void 0?void 0:l.arrayValue,j=(u=g.value)===null||u===void 0?void 0:u.arrayValue,L=xe(((h=N==null?void 0:N.values)===null||h===void 0?void 0:h.length)||0,((m=j==null?void 0:j.values)===null||m===void 0?void 0:m.length)||0);return L!==0?L:Ov(N,j)}(t.mapValue,e.mapValue);case 11:return function(s,o){if(s===su.mapValue&&o===su.mapValue)return 0;if(s===su.mapValue)return 1;if(o===su.mapValue)return-1;const l=s.fields||{},u=Object.keys(l),h=o.fields||{},m=Object.keys(h);u.sort(),m.sort();for(let v=0;v<u.length&&v<m.length;++v){const g=xe(u[v],m[v]);if(g!==0)return g;const N=Qo(l[u[v]],h[m[v]]);if(N!==0)return N}return xe(u.length,m.length)}(t.mapValue,e.mapValue);default:throw ce()}}function jv(t,e){if(typeof t=="string"&&typeof e=="string"&&t.length===e.length)return xe(t,e);const n=Oi(t),r=Oi(e),i=xe(n.seconds,r.seconds);return i!==0?i:xe(n.nanos,r.nanos)}function Ov(t,e){const n=t.values||[],r=e.values||[];for(let i=0;i<n.length&&i<r.length;++i){const s=Qo(n[i],r[i]);if(s)return s}return xe(n.length,r.length)}function Yo(t){return mp(t)}function mp(t){return"nullValue"in t?"null":"booleanValue"in t?""+t.booleanValue:"integerValue"in t?""+t.integerValue:"doubleValue"in t?""+t.doubleValue:"timestampValue"in t?function(n){const r=Oi(n);return`time(${r.seconds},${r.nanos})`}(t.timestampValue):"stringValue"in t?t.stringValue:"bytesValue"in t?function(n){return Ss(n).toBase64()}(t.bytesValue):"referenceValue"in t?function(n){return ie.fromName(n).toString()}(t.referenceValue):"geoPointValue"in t?function(n){return`geo(${n.latitude},${n.longitude})`}(t.geoPointValue):"arrayValue"in t?function(n){let r="[",i=!0;for(const s of n.values||[])i?i=!1:r+=",",r+=mp(s);return r+"]"}(t.arrayValue):"mapValue"in t?function(n){const r=Object.keys(n.fields||{}).sort();let i="{",s=!0;for(const o of r)s?s=!1:i+=",",i+=`${o}:${mp(n.fields[o])}`;return i+"}"}(t.mapValue):ce()}function Lv(t,e){return{referenceValue:`projects/${t.projectId}/databases/${t.database}/documents/${e.path.canonicalString()}`}}function gp(t){return!!t&&"integerValue"in t}function zm(t){return!!t&&"arrayValue"in t}function Mv(t){return!!t&&"nullValue"in t}function Vv(t){return!!t&&"doubleValue"in t&&isNaN(Number(t.doubleValue))}function Iu(t){return!!t&&"mapValue"in t}function SA(t){var e,n;return((n=(((e=t==null?void 0:t.mapValue)===null||e===void 0?void 0:e.fields)||{}).__type__)===null||n===void 0?void 0:n.stringValue)==="__vector__"}function ml(t){if(t.geoPointValue)return{geoPointValue:Object.assign({},t.geoPointValue)};if(t.timestampValue&&typeof t.timestampValue=="object")return{timestampValue:Object.assign({},t.timestampValue)};if(t.mapValue){const e={mapValue:{fields:{}}};return Ds(t.mapValue.fields,(n,r)=>e.mapValue.fields[n]=ml(r)),e}if(t.arrayValue){const e={arrayValue:{values:[]}};for(let n=0;n<(t.arrayValue.values||[]).length;++n)e.arrayValue.values[n]=ml(t.arrayValue.values[n]);return e}return Object.assign({},t)}function IA(t){return(((t.mapValue||{}).fields||{}).__type__||{}).stringValue==="__max__"}/**
|
|
* @license
|
|
* Copyright 2017 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class tn{constructor(e){this.value=e}static empty(){return new tn({mapValue:{}})}field(e){if(e.isEmpty())return this.value;{let n=this.value;for(let r=0;r<e.length-1;++r)if(n=(n.mapValue.fields||{})[e.get(r)],!Iu(n))return null;return n=(n.mapValue.fields||{})[e.lastSegment()],n||null}}set(e,n){this.getFieldsMap(e.popLast())[e.lastSegment()]=ml(n)}setAll(e){let n=Tt.emptyPath(),r={},i=[];e.forEach((o,l)=>{if(!n.isImmediateParentOf(l)){const u=this.getFieldsMap(n);this.applyChanges(u,r,i),r={},i=[],n=l.popLast()}o?r[l.lastSegment()]=ml(o):i.push(l.lastSegment())});const s=this.getFieldsMap(n);this.applyChanges(s,r,i)}delete(e){const n=this.field(e.popLast());Iu(n)&&n.mapValue.fields&&delete n.mapValue.fields[e.lastSegment()]}isEqual(e){return dr(this.value,e.value)}getFieldsMap(e){let n=this.value;n.mapValue.fields||(n.mapValue={fields:{}});for(let r=0;r<e.length;++r){let i=n.mapValue.fields[e.get(r)];Iu(i)&&i.mapValue.fields||(i={mapValue:{fields:{}}},n.mapValue.fields[e.get(r)]=i),n=i}return n.mapValue.fields}applyChanges(e,n,r){Ds(n,(i,s)=>e[i]=s);for(const i of r)delete e[i]}clone(){return new tn(ml(this.value))}}function qx(t){const e=[];return Ds(t.fields,(n,r)=>{const i=new Tt([n]);if(Iu(r)){const s=qx(r.mapValue).fields;if(s.length===0)e.push(i);else for(const o of s)e.push(i.child(o))}else e.push(i)}),new dn(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 Mt{constructor(e,n,r,i,s,o,l){this.key=e,this.documentType=n,this.version=r,this.readTime=i,this.createTime=s,this.data=o,this.documentState=l}static newInvalidDocument(e){return new Mt(e,0,de.min(),de.min(),de.min(),tn.empty(),0)}static newFoundDocument(e,n,r,i){return new Mt(e,1,n,de.min(),r,i,0)}static newNoDocument(e,n){return new Mt(e,2,n,de.min(),de.min(),tn.empty(),0)}static newUnknownDocument(e,n){return new Mt(e,3,n,de.min(),de.min(),tn.empty(),2)}convertToFoundDocument(e,n){return!this.createTime.isEqual(de.min())||this.documentType!==2&&this.documentType!==0||(this.createTime=e),this.version=e,this.documentType=1,this.data=n,this.documentState=0,this}convertToNoDocument(e){return this.version=e,this.documentType=2,this.data=tn.empty(),this.documentState=0,this}convertToUnknownDocument(e){return this.version=e,this.documentType=3,this.data=tn.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this.version=de.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 Mt&&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 Mt(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 dd{constructor(e,n){this.position=e,this.inclusive=n}}function Fv(t,e,n){let r=0;for(let i=0;i<t.position.length;i++){const s=e[i],o=t.position[i];if(s.field.isKeyField()?r=ie.comparator(ie.fromName(o.referenceValue),n.key):r=Qo(o,n.data.field(s.field)),s.dir==="desc"&&(r*=-1),r!==0)break}return r}function Uv(t,e){if(t===null)return e===null;if(e===null||t.inclusive!==e.inclusive||t.position.length!==e.position.length)return!1;for(let n=0;n<t.position.length;n++)if(!dr(t.position[n],e.position[n]))return!1;return!0}/**
|
|
* @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 hd{constructor(e,n="asc"){this.field=e,this.dir=n}}function CA(t,e){return t.dir===e.dir&&t.field.isEqual(e.field)}/**
|
|
* @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 Wx{}class st extends Wx{constructor(e,n,r){super(),this.field=e,this.op=n,this.value=r}static create(e,n,r){return e.isKeyField()?n==="in"||n==="not-in"?this.createKeyFieldInFilter(e,n,r):new NA(e,n,r):n==="array-contains"?new DA(e,r):n==="in"?new jA(e,r):n==="not-in"?new OA(e,r):n==="array-contains-any"?new LA(e,r):new st(e,n,r)}static createKeyFieldInFilter(e,n,r){return n==="in"?new PA(e,r):new RA(e,r)}matches(e){const n=e.data.field(this.field);return this.op==="!="?n!==null&&this.matchesComparison(Qo(n,this.value)):n!==null&&Is(this.value)===Is(n)&&this.matchesComparison(Qo(n,this.value))}matchesComparison(e){switch(this.op){case"<":return e<0;case"<=":return e<=0;case"==":return e===0;case"!=":return e!==0;case">":return e>0;case">=":return e>=0;default:return ce()}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}}class Bn extends Wx{constructor(e,n){super(),this.filters=e,this.op=n,this.ae=null}static create(e,n){return new Bn(e,n)}matches(e){return Hx(this)?this.filters.find(n=>!n.matches(e))===void 0:this.filters.find(n=>n.matches(e))!==void 0}getFlattenedFilters(){return this.ae!==null||(this.ae=this.filters.reduce((e,n)=>e.concat(n.getFlattenedFilters()),[])),this.ae}getFilters(){return Object.assign([],this.filters)}}function Hx(t){return t.op==="and"}function Kx(t){return AA(t)&&Hx(t)}function AA(t){for(const e of t.filters)if(e instanceof Bn)return!1;return!0}function yp(t){if(t instanceof st)return t.field.canonicalString()+t.op.toString()+Yo(t.value);if(Kx(t))return t.filters.map(e=>yp(e)).join(",");{const e=t.filters.map(n=>yp(n)).join(",");return`${t.op}(${e})`}}function Gx(t,e){return t instanceof st?function(r,i){return i instanceof st&&r.op===i.op&&r.field.isEqual(i.field)&&dr(r.value,i.value)}(t,e):t instanceof Bn?function(r,i){return i instanceof Bn&&r.op===i.op&&r.filters.length===i.filters.length?r.filters.reduce((s,o,l)=>s&&Gx(o,i.filters[l]),!0):!1}(t,e):void ce()}function Qx(t){return t instanceof st?function(n){return`${n.field.canonicalString()} ${n.op} ${Yo(n.value)}`}(t):t instanceof Bn?function(n){return n.op.toString()+" {"+n.getFilters().map(Qx).join(" ,")+"}"}(t):"Filter"}class NA extends st{constructor(e,n,r){super(e,n,r),this.key=ie.fromName(r.referenceValue)}matches(e){const n=ie.comparator(e.key,this.key);return this.matchesComparison(n)}}class PA extends st{constructor(e,n){super(e,"in",n),this.keys=Yx("in",n)}matches(e){return this.keys.some(n=>n.isEqual(e.key))}}class RA extends st{constructor(e,n){super(e,"not-in",n),this.keys=Yx("not-in",n)}matches(e){return!this.keys.some(n=>n.isEqual(e.key))}}function Yx(t,e){var n;return(((n=e.arrayValue)===null||n===void 0?void 0:n.values)||[]).map(r=>ie.fromName(r.referenceValue))}class DA extends st{constructor(e,n){super(e,"array-contains",n)}matches(e){const n=e.data.field(this.field);return zm(n)&&Bl(n.arrayValue,this.value)}}class jA extends st{constructor(e,n){super(e,"in",n)}matches(e){const n=e.data.field(this.field);return n!==null&&Bl(this.value.arrayValue,n)}}class OA extends st{constructor(e,n){super(e,"not-in",n)}matches(e){if(Bl(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const n=e.data.field(this.field);return n!==null&&!Bl(this.value.arrayValue,n)}}class LA extends st{constructor(e,n){super(e,"array-contains-any",n)}matches(e){const n=e.data.field(this.field);return!(!zm(n)||!n.arrayValue.values)&&n.arrayValue.values.some(r=>Bl(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 MA{constructor(e,n=null,r=[],i=[],s=null,o=null,l=null){this.path=e,this.collectionGroup=n,this.orderBy=r,this.filters=i,this.limit=s,this.startAt=o,this.endAt=l,this.ue=null}}function zv(t,e=null,n=[],r=[],i=null,s=null,o=null){return new MA(t,e,n,r,i,s,o)}function Bm(t){const e=he(t);if(e.ue===null){let n=e.path.canonicalString();e.collectionGroup!==null&&(n+="|cg:"+e.collectionGroup),n+="|f:",n+=e.filters.map(r=>yp(r)).join(","),n+="|ob:",n+=e.orderBy.map(r=>function(s){return s.field.canonicalString()+s.dir}(r)).join(","),Bd(e.limit)||(n+="|l:",n+=e.limit),e.startAt&&(n+="|lb:",n+=e.startAt.inclusive?"b:":"a:",n+=e.startAt.position.map(r=>Yo(r)).join(",")),e.endAt&&(n+="|ub:",n+=e.endAt.inclusive?"a:":"b:",n+=e.endAt.position.map(r=>Yo(r)).join(",")),e.ue=n}return e.ue}function $m(t,e){if(t.limit!==e.limit||t.orderBy.length!==e.orderBy.length)return!1;for(let n=0;n<t.orderBy.length;n++)if(!CA(t.orderBy[n],e.orderBy[n]))return!1;if(t.filters.length!==e.filters.length)return!1;for(let n=0;n<t.filters.length;n++)if(!Gx(t.filters[n],e.filters[n]))return!1;return t.collectionGroup===e.collectionGroup&&!!t.path.isEqual(e.path)&&!!Uv(t.startAt,e.startAt)&&Uv(t.endAt,e.endAt)}function vp(t){return ie.isDocumentKey(t.path)&&t.collectionGroup===null&&t.filters.length===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 sc{constructor(e,n=null,r=[],i=[],s=null,o="F",l=null,u=null){this.path=e,this.collectionGroup=n,this.explicitOrderBy=r,this.filters=i,this.limit=s,this.limitType=o,this.startAt=l,this.endAt=u,this.ce=null,this.le=null,this.he=null,this.startAt,this.endAt}}function VA(t,e,n,r,i,s,o,l){return new sc(t,e,n,r,i,s,o,l)}function $d(t){return new sc(t)}function Bv(t){return t.filters.length===0&&t.limit===null&&t.startAt==null&&t.endAt==null&&(t.explicitOrderBy.length===0||t.explicitOrderBy.length===1&&t.explicitOrderBy[0].field.isKeyField())}function Jx(t){return t.collectionGroup!==null}function gl(t){const e=he(t);if(e.ce===null){e.ce=[];const n=new Set;for(const s of e.explicitOrderBy)e.ce.push(s),n.add(s.field.canonicalString());const r=e.explicitOrderBy.length>0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";(function(o){let l=new St(Tt.comparator);return o.filters.forEach(u=>{u.getFlattenedFilters().forEach(h=>{h.isInequality()&&(l=l.add(h.field))})}),l})(e).forEach(s=>{n.has(s.canonicalString())||s.isKeyField()||e.ce.push(new hd(s,r))}),n.has(Tt.keyField().canonicalString())||e.ce.push(new hd(Tt.keyField(),r))}return e.ce}function lr(t){const e=he(t);return e.le||(e.le=FA(e,gl(t))),e.le}function FA(t,e){if(t.limitType==="F")return zv(t.path,t.collectionGroup,e,t.filters,t.limit,t.startAt,t.endAt);{e=e.map(i=>{const s=i.dir==="desc"?"asc":"desc";return new hd(i.field,s)});const n=t.endAt?new dd(t.endAt.position,t.endAt.inclusive):null,r=t.startAt?new dd(t.startAt.position,t.startAt.inclusive):null;return zv(t.path,t.collectionGroup,e,t.filters,t.limit,n,r)}}function wp(t,e){const n=t.filters.concat([e]);return new sc(t.path,t.collectionGroup,t.explicitOrderBy.slice(),n,t.limit,t.limitType,t.startAt,t.endAt)}function _p(t,e,n){return new sc(t.path,t.collectionGroup,t.explicitOrderBy.slice(),t.filters.slice(),e,n,t.startAt,t.endAt)}function qd(t,e){return $m(lr(t),lr(e))&&t.limitType===e.limitType}function Xx(t){return`${Bm(lr(t))}|lt:${t.limitType}`}function po(t){return`Query(target=${function(n){let r=n.path.canonicalString();return n.collectionGroup!==null&&(r+=" collectionGroup="+n.collectionGroup),n.filters.length>0&&(r+=`, filters: [${n.filters.map(i=>Qx(i)).join(", ")}]`),Bd(n.limit)||(r+=", limit: "+n.limit),n.orderBy.length>0&&(r+=`, orderBy: [${n.orderBy.map(i=>function(o){return`${o.field.canonicalString()} (${o.dir})`}(i)).join(", ")}]`),n.startAt&&(r+=", startAt: ",r+=n.startAt.inclusive?"b:":"a:",r+=n.startAt.position.map(i=>Yo(i)).join(",")),n.endAt&&(r+=", endAt: ",r+=n.endAt.inclusive?"a:":"b:",r+=n.endAt.position.map(i=>Yo(i)).join(",")),`Target(${r})`}(lr(t))}; limitType=${t.limitType})`}function Wd(t,e){return e.isFoundDocument()&&function(r,i){const s=i.key.path;return r.collectionGroup!==null?i.key.hasCollectionId(r.collectionGroup)&&r.path.isPrefixOf(s):ie.isDocumentKey(r.path)?r.path.isEqual(s):r.path.isImmediateParentOf(s)}(t,e)&&function(r,i){for(const s of gl(r))if(!s.field.isKeyField()&&i.data.field(s.field)===null)return!1;return!0}(t,e)&&function(r,i){for(const s of r.filters)if(!s.matches(i))return!1;return!0}(t,e)&&function(r,i){return!(r.startAt&&!function(o,l,u){const h=Fv(o,l,u);return o.inclusive?h<=0:h<0}(r.startAt,gl(r),i)||r.endAt&&!function(o,l,u){const h=Fv(o,l,u);return o.inclusive?h>=0:h>0}(r.endAt,gl(r),i))}(t,e)}function UA(t){return t.collectionGroup||(t.path.length%2==1?t.path.lastSegment():t.path.get(t.path.length-2))}function Zx(t){return(e,n)=>{let r=!1;for(const i of gl(t)){const s=zA(i,e,n);if(s!==0)return s;r=r||i.field.isKeyField()}return 0}}function zA(t,e,n){const r=t.field.isKeyField()?ie.comparator(e.key,n.key):function(s,o,l){const u=o.data.field(s),h=l.data.field(s);return u!==null&&h!==null?Qo(u,h):ce()}(t.field,e,n);switch(t.dir){case"asc":return r;case"desc":return-1*r;default:return ce()}}/**
|
|
* @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 aa{constructor(e,n){this.mapKeyFn=e,this.equalsFn=n,this.inner={},this.innerSize=0}get(e){const n=this.mapKeyFn(e),r=this.inner[n];if(r!==void 0){for(const[i,s]of r)if(this.equalsFn(i,e))return s}}has(e){return this.get(e)!==void 0}set(e,n){const r=this.mapKeyFn(e),i=this.inner[r];if(i===void 0)return this.inner[r]=[[e,n]],void this.innerSize++;for(let s=0;s<i.length;s++)if(this.equalsFn(i[s][0],e))return void(i[s]=[e,n]);i.push([e,n]),this.innerSize++}delete(e){const n=this.mapKeyFn(e),r=this.inner[n];if(r===void 0)return!1;for(let i=0;i<r.length;i++)if(this.equalsFn(r[i][0],e))return r.length===1?delete this.inner[n]:r.splice(i,1),this.innerSize--,!0;return!1}forEach(e){Ds(this.inner,(n,r)=>{for(const[i,s]of r)e(i,s)})}isEmpty(){return Bx(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 BA=new We(ie.comparator);function Gr(){return BA}const eE=new We(ie.comparator);function nl(...t){let e=eE;for(const n of t)e=e.insert(n.key,n);return e}function tE(t){let e=eE;return t.forEach((n,r)=>e=e.insert(n,r.overlayedDocument)),e}function fs(){return yl()}function nE(){return yl()}function yl(){return new aa(t=>t.toString(),(t,e)=>t.isEqual(e))}const $A=new We(ie.comparator),qA=new St(ie.comparator);function me(...t){let e=qA;for(const n of t)e=e.add(n);return e}const WA=new St(xe);function HA(){return WA}/**
|
|
* @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 qm(t,e){if(t.useProto3Json){if(isNaN(e))return{doubleValue:"NaN"};if(e===1/0)return{doubleValue:"Infinity"};if(e===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:ud(e)?"-0":e}}function rE(t){return{integerValue:""+t}}function KA(t,e){return kA(e)?rE(e):qm(t,e)}/**
|
|
* @license
|
|
* Copyright 2018 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class Hd{constructor(){this._=void 0}}function GA(t,e,n){return t instanceof fd?function(i,s){const o={fields:{__type__:{stringValue:"server_timestamp"},__local_write_time__:{timestampValue:{seconds:i.seconds,nanos:i.nanoseconds}}}};return s&&Fm(s)&&(s=Um(s)),s&&(o.fields.__previous_value__=s),{mapValue:o}}(n,e):t instanceof $l?sE(t,e):t instanceof ql?oE(t,e):function(i,s){const o=iE(i,s),l=$v(o)+$v(i.Pe);return gp(o)&&gp(i.Pe)?rE(l):qm(i.serializer,l)}(t,e)}function QA(t,e,n){return t instanceof $l?sE(t,e):t instanceof ql?oE(t,e):n}function iE(t,e){return t instanceof pd?function(r){return gp(r)||function(s){return!!s&&"doubleValue"in s}(r)}(e)?e:{integerValue:0}:null}class fd extends Hd{}class $l extends Hd{constructor(e){super(),this.elements=e}}function sE(t,e){const n=aE(e);for(const r of t.elements)n.some(i=>dr(i,r))||n.push(r);return{arrayValue:{values:n}}}class ql extends Hd{constructor(e){super(),this.elements=e}}function oE(t,e){let n=aE(e);for(const r of t.elements)n=n.filter(i=>!dr(i,r));return{arrayValue:{values:n}}}class pd extends Hd{constructor(e,n){super(),this.serializer=e,this.Pe=n}}function $v(t){return Ye(t.integerValue||t.doubleValue)}function aE(t){return zm(t)&&t.arrayValue.values?t.arrayValue.values.slice():[]}function YA(t,e){return t.field.isEqual(e.field)&&function(r,i){return r instanceof $l&&i instanceof $l||r instanceof ql&&i instanceof ql?Go(r.elements,i.elements,dr):r instanceof pd&&i instanceof pd?dr(r.Pe,i.Pe):r instanceof fd&&i instanceof fd}(t.transform,e.transform)}class JA{constructor(e,n){this.version=e,this.transformResults=n}}class qt{constructor(e,n){this.updateTime=e,this.exists=n}static none(){return new qt}static exists(e){return new qt(void 0,e)}static updateTime(e){return new qt(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 Cu(t,e){return t.updateTime!==void 0?e.isFoundDocument()&&e.version.isEqual(t.updateTime):t.exists===void 0||t.exists===e.isFoundDocument()}class Kd{}function lE(t,e){if(!t.hasLocalMutations||e&&e.fields.length===0)return null;if(e===null)return t.isNoDocument()?new Gd(t.key,qt.none()):new oc(t.key,t.data,qt.none());{const n=t.data,r=tn.empty();let i=new St(Tt.comparator);for(let s of e.fields)if(!i.has(s)){let o=n.field(s);o===null&&s.length>1&&(s=s.popLast(),o=n.field(s)),o===null?r.delete(s):r.set(s,o),i=i.add(s)}return new zi(t.key,r,new dn(i.toArray()),qt.none())}}function XA(t,e,n){t instanceof oc?function(i,s,o){const l=i.value.clone(),u=Wv(i.fieldTransforms,s,o.transformResults);l.setAll(u),s.convertToFoundDocument(o.version,l).setHasCommittedMutations()}(t,e,n):t instanceof zi?function(i,s,o){if(!Cu(i.precondition,s))return void s.convertToUnknownDocument(o.version);const l=Wv(i.fieldTransforms,s,o.transformResults),u=s.data;u.setAll(cE(i)),u.setAll(l),s.convertToFoundDocument(o.version,u).setHasCommittedMutations()}(t,e,n):function(i,s,o){s.convertToNoDocument(o.version).setHasCommittedMutations()}(0,e,n)}function vl(t,e,n,r){return t instanceof oc?function(s,o,l,u){if(!Cu(s.precondition,o))return l;const h=s.value.clone(),m=Hv(s.fieldTransforms,u,o);return h.setAll(m),o.convertToFoundDocument(o.version,h).setHasLocalMutations(),null}(t,e,n,r):t instanceof zi?function(s,o,l,u){if(!Cu(s.precondition,o))return l;const h=Hv(s.fieldTransforms,u,o),m=o.data;return m.setAll(cE(s)),m.setAll(h),o.convertToFoundDocument(o.version,m).setHasLocalMutations(),l===null?null:l.unionWith(s.fieldMask.fields).unionWith(s.fieldTransforms.map(v=>v.field))}(t,e,n,r):function(s,o,l){return Cu(s.precondition,o)?(o.convertToNoDocument(o.version).setHasLocalMutations(),null):l}(t,e,n)}function ZA(t,e){let n=null;for(const r of t.fieldTransforms){const i=e.data.field(r.field),s=iE(r.transform,i||null);s!=null&&(n===null&&(n=tn.empty()),n.set(r.field,s))}return n||null}function qv(t,e){return t.type===e.type&&!!t.key.isEqual(e.key)&&!!t.precondition.isEqual(e.precondition)&&!!function(r,i){return r===void 0&&i===void 0||!(!r||!i)&&Go(r,i,(s,o)=>YA(s,o))}(t.fieldTransforms,e.fieldTransforms)&&(t.type===0?t.value.isEqual(e.value):t.type!==1||t.data.isEqual(e.data)&&t.fieldMask.isEqual(e.fieldMask))}class oc extends Kd{constructor(e,n,r,i=[]){super(),this.key=e,this.value=n,this.precondition=r,this.fieldTransforms=i,this.type=0}getFieldMask(){return null}}class zi extends Kd{constructor(e,n,r,i,s=[]){super(),this.key=e,this.data=n,this.fieldMask=r,this.precondition=i,this.fieldTransforms=s,this.type=1}getFieldMask(){return this.fieldMask}}function cE(t){const e=new Map;return t.fieldMask.fields.forEach(n=>{if(!n.isEmpty()){const r=t.data.field(n);e.set(n,r)}}),e}function Wv(t,e,n){const r=new Map;Se(t.length===n.length);for(let i=0;i<n.length;i++){const s=t[i],o=s.transform,l=e.data.field(s.field);r.set(s.field,QA(o,l,n[i]))}return r}function Hv(t,e,n){const r=new Map;for(const i of t){const s=i.transform,o=n.data.field(i.field);r.set(i.field,GA(s,o,e))}return r}class Gd extends Kd{constructor(e,n){super(),this.key=e,this.precondition=n,this.type=2,this.fieldTransforms=[]}getFieldMask(){return null}}class eN extends Kd{constructor(e,n){super(),this.key=e,this.precondition=n,this.type=3,this.fieldTransforms=[]}getFieldMask(){return null}}/**
|
|
* @license
|
|
* Copyright 2017 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class tN{constructor(e,n,r,i){this.batchId=e,this.localWriteTime=n,this.baseMutations=r,this.mutations=i}applyToRemoteDocument(e,n){const r=n.mutationResults;for(let i=0;i<this.mutations.length;i++){const s=this.mutations[i];s.key.isEqual(e.key)&&XA(s,e,r[i])}}applyToLocalView(e,n){for(const r of this.baseMutations)r.key.isEqual(e.key)&&(n=vl(r,e,n,this.localWriteTime));for(const r of this.mutations)r.key.isEqual(e.key)&&(n=vl(r,e,n,this.localWriteTime));return n}applyToLocalDocumentSet(e,n){const r=nE();return this.mutations.forEach(i=>{const s=e.get(i.key),o=s.overlayedDocument;let l=this.applyToLocalView(o,s.mutatedFields);l=n.has(i.key)?null:l;const u=lE(o,l);u!==null&&r.set(i.key,u),o.isValidDocument()||o.convertToNoDocument(de.min())}),r}keys(){return this.mutations.reduce((e,n)=>e.add(n.key),me())}isEqual(e){return this.batchId===e.batchId&&Go(this.mutations,e.mutations,(n,r)=>qv(n,r))&&Go(this.baseMutations,e.baseMutations,(n,r)=>qv(n,r))}}class Wm{constructor(e,n,r,i){this.batch=e,this.commitVersion=n,this.mutationResults=r,this.docVersions=i}static from(e,n,r){Se(e.mutations.length===r.length);let i=function(){return $A}();const s=e.mutations;for(let o=0;o<s.length;o++)i=i.insert(s[o].key,r[o].version);return new Wm(e,n,r,i)}}/**
|
|
* @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 nN{constructor(e,n){this.largestBatchId=e,this.mutation=n}getKey(){return this.mutation.key}isEqual(e){return e!==null&&this.mutation===e.mutation}toString(){return`Overlay{
|
|
largestBatchId: ${this.largestBatchId},
|
|
mutation: ${this.mutation.toString()}
|
|
}`}}/**
|
|
* @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 rN{constructor(e,n){this.count=e,this.unchangedNames=n}}/**
|
|
* @license
|
|
* Copyright 2017 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/var rt,ve;function iN(t){switch(t){default:return ce();case U.CANCELLED:case U.UNKNOWN:case U.DEADLINE_EXCEEDED:case U.RESOURCE_EXHAUSTED:case U.INTERNAL:case U.UNAVAILABLE:case U.UNAUTHENTICATED:return!1;case U.INVALID_ARGUMENT:case U.NOT_FOUND:case U.ALREADY_EXISTS:case U.PERMISSION_DENIED:case U.FAILED_PRECONDITION:case U.ABORTED:case U.OUT_OF_RANGE:case U.UNIMPLEMENTED:case U.DATA_LOSS:return!0}}function uE(t){if(t===void 0)return Kr("GRPC error has no .code"),U.UNKNOWN;switch(t){case rt.OK:return U.OK;case rt.CANCELLED:return U.CANCELLED;case rt.UNKNOWN:return U.UNKNOWN;case rt.DEADLINE_EXCEEDED:return U.DEADLINE_EXCEEDED;case rt.RESOURCE_EXHAUSTED:return U.RESOURCE_EXHAUSTED;case rt.INTERNAL:return U.INTERNAL;case rt.UNAVAILABLE:return U.UNAVAILABLE;case rt.UNAUTHENTICATED:return U.UNAUTHENTICATED;case rt.INVALID_ARGUMENT:return U.INVALID_ARGUMENT;case rt.NOT_FOUND:return U.NOT_FOUND;case rt.ALREADY_EXISTS:return U.ALREADY_EXISTS;case rt.PERMISSION_DENIED:return U.PERMISSION_DENIED;case rt.FAILED_PRECONDITION:return U.FAILED_PRECONDITION;case rt.ABORTED:return U.ABORTED;case rt.OUT_OF_RANGE:return U.OUT_OF_RANGE;case rt.UNIMPLEMENTED:return U.UNIMPLEMENTED;case rt.DATA_LOSS:return U.DATA_LOSS;default:return ce()}}(ve=rt||(rt={}))[ve.OK=0]="OK",ve[ve.CANCELLED=1]="CANCELLED",ve[ve.UNKNOWN=2]="UNKNOWN",ve[ve.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",ve[ve.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",ve[ve.NOT_FOUND=5]="NOT_FOUND",ve[ve.ALREADY_EXISTS=6]="ALREADY_EXISTS",ve[ve.PERMISSION_DENIED=7]="PERMISSION_DENIED",ve[ve.UNAUTHENTICATED=16]="UNAUTHENTICATED",ve[ve.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",ve[ve.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",ve[ve.ABORTED=10]="ABORTED",ve[ve.OUT_OF_RANGE=11]="OUT_OF_RANGE",ve[ve.UNIMPLEMENTED=12]="UNIMPLEMENTED",ve[ve.INTERNAL=13]="INTERNAL",ve[ve.UNAVAILABLE=14]="UNAVAILABLE",ve[ve.DATA_LOSS=15]="DATA_LOSS";/**
|
|
* @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 sN(){return new TextEncoder}/**
|
|
* @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 oN=new ys([4294967295,4294967295],0);function Kv(t){const e=sN().encode(t),n=new jx;return n.update(e),new Uint8Array(n.digest())}function Gv(t){const e=new DataView(t.buffer),n=e.getUint32(0,!0),r=e.getUint32(4,!0),i=e.getUint32(8,!0),s=e.getUint32(12,!0);return[new ys([n,r],0),new ys([i,s],0)]}class Hm{constructor(e,n,r){if(this.bitmap=e,this.padding=n,this.hashCount=r,n<0||n>=8)throw new rl(`Invalid padding: ${n}`);if(r<0)throw new rl(`Invalid hash count: ${r}`);if(e.length>0&&this.hashCount===0)throw new rl(`Invalid hash count: ${r}`);if(e.length===0&&n!==0)throw new rl(`Invalid padding when bitmap length is 0: ${n}`);this.Ie=8*e.length-n,this.Te=ys.fromNumber(this.Ie)}Ee(e,n,r){let i=e.add(n.multiply(ys.fromNumber(r)));return i.compare(oN)===1&&(i=new ys([i.getBits(0),i.getBits(1)],0)),i.modulo(this.Te).toNumber()}de(e){return(this.bitmap[Math.floor(e/8)]&1<<e%8)!=0}mightContain(e){if(this.Ie===0)return!1;const n=Kv(e),[r,i]=Gv(n);for(let s=0;s<this.hashCount;s++){const o=this.Ee(r,i,s);if(!this.de(o))return!1}return!0}static create(e,n,r){const i=e%8==0?0:8-e%8,s=new Uint8Array(Math.ceil(e/8)),o=new Hm(s,i,n);return r.forEach(l=>o.insert(l)),o}insert(e){if(this.Ie===0)return;const n=Kv(e),[r,i]=Gv(n);for(let s=0;s<this.hashCount;s++){const o=this.Ee(r,i,s);this.Ae(o)}}Ae(e){const n=Math.floor(e/8),r=e%8;this.bitmap[n]|=1<<r}}class rl extends Error{constructor(){super(...arguments),this.name="BloomFilterError"}}/**
|
|
* @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 Qd{constructor(e,n,r,i,s){this.snapshotVersion=e,this.targetChanges=n,this.targetMismatches=r,this.documentUpdates=i,this.resolvedLimboDocuments=s}static createSynthesizedRemoteEventForCurrentChange(e,n,r){const i=new Map;return i.set(e,ac.createSynthesizedTargetChangeForCurrentChange(e,n,r)),new Qd(de.min(),i,new We(xe),Gr(),me())}}class ac{constructor(e,n,r,i,s){this.resumeToken=e,this.current=n,this.addedDocuments=r,this.modifiedDocuments=i,this.removedDocuments=s}static createSynthesizedTargetChangeForCurrentChange(e,n,r){return new ac(r,n,me(),me(),me())}}/**
|
|
* @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 Au{constructor(e,n,r,i){this.Re=e,this.removedTargetIds=n,this.key=r,this.Ve=i}}class dE{constructor(e,n){this.targetId=e,this.me=n}}class hE{constructor(e,n,r=Ct.EMPTY_BYTE_STRING,i=null){this.state=e,this.targetIds=n,this.resumeToken=r,this.cause=i}}class Qv{constructor(){this.fe=0,this.ge=Jv(),this.pe=Ct.EMPTY_BYTE_STRING,this.ye=!1,this.we=!0}get current(){return this.ye}get resumeToken(){return this.pe}get Se(){return this.fe!==0}get be(){return this.we}De(e){e.approximateByteSize()>0&&(this.we=!0,this.pe=e)}ve(){let e=me(),n=me(),r=me();return this.ge.forEach((i,s)=>{switch(s){case 0:e=e.add(i);break;case 2:n=n.add(i);break;case 1:r=r.add(i);break;default:ce()}}),new ac(this.pe,this.ye,e,n,r)}Ce(){this.we=!1,this.ge=Jv()}Fe(e,n){this.we=!0,this.ge=this.ge.insert(e,n)}Me(e){this.we=!0,this.ge=this.ge.remove(e)}xe(){this.fe+=1}Oe(){this.fe-=1,Se(this.fe>=0)}Ne(){this.we=!0,this.ye=!0}}class aN{constructor(e){this.Le=e,this.Be=new Map,this.ke=Gr(),this.qe=Yv(),this.Qe=new We(xe)}Ke(e){for(const n of e.Re)e.Ve&&e.Ve.isFoundDocument()?this.$e(n,e.Ve):this.Ue(n,e.key,e.Ve);for(const n of e.removedTargetIds)this.Ue(n,e.key,e.Ve)}We(e){this.forEachTarget(e,n=>{const r=this.Ge(n);switch(e.state){case 0:this.ze(n)&&r.De(e.resumeToken);break;case 1:r.Oe(),r.Se||r.Ce(),r.De(e.resumeToken);break;case 2:r.Oe(),r.Se||this.removeTarget(n);break;case 3:this.ze(n)&&(r.Ne(),r.De(e.resumeToken));break;case 4:this.ze(n)&&(this.je(n),r.De(e.resumeToken));break;default:ce()}})}forEachTarget(e,n){e.targetIds.length>0?e.targetIds.forEach(n):this.Be.forEach((r,i)=>{this.ze(i)&&n(i)})}He(e){const n=e.targetId,r=e.me.count,i=this.Je(n);if(i){const s=i.target;if(vp(s))if(r===0){const o=new ie(s.path);this.Ue(n,o,Mt.newNoDocument(o,de.min()))}else Se(r===1);else{const o=this.Ye(n);if(o!==r){const l=this.Ze(e),u=l?this.Xe(l,e,o):1;if(u!==0){this.je(n);const h=u===2?"TargetPurposeExistenceFilterMismatchBloom":"TargetPurposeExistenceFilterMismatch";this.Qe=this.Qe.insert(n,h)}}}}}Ze(e){const n=e.me.unchangedNames;if(!n||!n.bits)return null;const{bits:{bitmap:r="",padding:i=0},hashCount:s=0}=n;let o,l;try{o=Ss(r).toUint8Array()}catch(u){if(u instanceof $x)return Ko("Decoding the base64 bloom filter in existence filter failed ("+u.message+"); ignoring the bloom filter and falling back to full re-query."),null;throw u}try{l=new Hm(o,i,s)}catch(u){return Ko(u instanceof rl?"BloomFilter error: ":"Applying bloom filter failed: ",u),null}return l.Ie===0?null:l}Xe(e,n,r){return n.me.count===r-this.nt(e,n.targetId)?0:2}nt(e,n){const r=this.Le.getRemoteKeysForTarget(n);let i=0;return r.forEach(s=>{const o=this.Le.tt(),l=`projects/${o.projectId}/databases/${o.database}/documents/${s.path.canonicalString()}`;e.mightContain(l)||(this.Ue(n,s,null),i++)}),i}rt(e){const n=new Map;this.Be.forEach((s,o)=>{const l=this.Je(o);if(l){if(s.current&&vp(l.target)){const u=new ie(l.target.path);this.ke.get(u)!==null||this.it(o,u)||this.Ue(o,u,Mt.newNoDocument(u,e))}s.be&&(n.set(o,s.ve()),s.Ce())}});let r=me();this.qe.forEach((s,o)=>{let l=!0;o.forEachWhile(u=>{const h=this.Je(u);return!h||h.purpose==="TargetPurposeLimboResolution"||(l=!1,!1)}),l&&(r=r.add(s))}),this.ke.forEach((s,o)=>o.setReadTime(e));const i=new Qd(e,n,this.Qe,this.ke,r);return this.ke=Gr(),this.qe=Yv(),this.Qe=new We(xe),i}$e(e,n){if(!this.ze(e))return;const r=this.it(e,n.key)?2:0;this.Ge(e).Fe(n.key,r),this.ke=this.ke.insert(n.key,n),this.qe=this.qe.insert(n.key,this.st(n.key).add(e))}Ue(e,n,r){if(!this.ze(e))return;const i=this.Ge(e);this.it(e,n)?i.Fe(n,1):i.Me(n),this.qe=this.qe.insert(n,this.st(n).delete(e)),r&&(this.ke=this.ke.insert(n,r))}removeTarget(e){this.Be.delete(e)}Ye(e){const n=this.Ge(e).ve();return this.Le.getRemoteKeysForTarget(e).size+n.addedDocuments.size-n.removedDocuments.size}xe(e){this.Ge(e).xe()}Ge(e){let n=this.Be.get(e);return n||(n=new Qv,this.Be.set(e,n)),n}st(e){let n=this.qe.get(e);return n||(n=new St(xe),this.qe=this.qe.insert(e,n)),n}ze(e){const n=this.Je(e)!==null;return n||re("WatchChangeAggregator","Detected inactive target",e),n}Je(e){const n=this.Be.get(e);return n&&n.Se?null:this.Le.ot(e)}je(e){this.Be.set(e,new Qv),this.Le.getRemoteKeysForTarget(e).forEach(n=>{this.Ue(e,n,null)})}it(e,n){return this.Le.getRemoteKeysForTarget(e).has(n)}}function Yv(){return new We(ie.comparator)}function Jv(){return new We(ie.comparator)}const lN={asc:"ASCENDING",desc:"DESCENDING"},cN={"<":"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"},uN={and:"AND",or:"OR"};class dN{constructor(e,n){this.databaseId=e,this.useProto3Json=n}}function xp(t,e){return t.useProto3Json||Bd(e)?e:{value:e}}function md(t,e){return t.useProto3Json?`${new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+e.nanoseconds).slice(-9)}Z`:{seconds:""+e.seconds,nanos:e.nanoseconds}}function fE(t,e){return t.useProto3Json?e.toBase64():e.toUint8Array()}function hN(t,e){return md(t,e.toTimestamp())}function cr(t){return Se(!!t),de.fromTimestamp(function(n){const r=Oi(n);return new ht(r.seconds,r.nanos)}(t))}function Km(t,e){return Ep(t,e).canonicalString()}function Ep(t,e){const n=function(i){return new De(["projects",i.projectId,"databases",i.database])}(t).child("documents");return e===void 0?n:n.child(e)}function pE(t){const e=De.fromString(t);return Se(wE(e)),e}function kp(t,e){return Km(t.databaseId,e.path)}function tf(t,e){const n=pE(e);if(n.get(1)!==t.databaseId.projectId)throw new Z(U.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+n.get(1)+" vs "+t.databaseId.projectId);if(n.get(3)!==t.databaseId.database)throw new Z(U.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+n.get(3)+" vs "+t.databaseId.database);return new ie(gE(n))}function mE(t,e){return Km(t.databaseId,e)}function fN(t){const e=pE(t);return e.length===4?De.emptyPath():gE(e)}function Tp(t){return new De(["projects",t.databaseId.projectId,"databases",t.databaseId.database]).canonicalString()}function gE(t){return Se(t.length>4&&t.get(4)==="documents"),t.popFirst(5)}function Xv(t,e,n){return{name:kp(t,e),fields:n.value.mapValue.fields}}function pN(t,e){let n;if("targetChange"in e){e.targetChange;const r=function(h){return h==="NO_CHANGE"?0:h==="ADD"?1:h==="REMOVE"?2:h==="CURRENT"?3:h==="RESET"?4:ce()}(e.targetChange.targetChangeType||"NO_CHANGE"),i=e.targetChange.targetIds||[],s=function(h,m){return h.useProto3Json?(Se(m===void 0||typeof m=="string"),Ct.fromBase64String(m||"")):(Se(m===void 0||m instanceof Buffer||m instanceof Uint8Array),Ct.fromUint8Array(m||new Uint8Array))}(t,e.targetChange.resumeToken),o=e.targetChange.cause,l=o&&function(h){const m=h.code===void 0?U.UNKNOWN:uE(h.code);return new Z(m,h.message||"")}(o);n=new hE(r,i,s,l||null)}else if("documentChange"in e){e.documentChange;const r=e.documentChange;r.document,r.document.name,r.document.updateTime;const i=tf(t,r.document.name),s=cr(r.document.updateTime),o=r.document.createTime?cr(r.document.createTime):de.min(),l=new tn({mapValue:{fields:r.document.fields}}),u=Mt.newFoundDocument(i,s,o,l),h=r.targetIds||[],m=r.removedTargetIds||[];n=new Au(h,m,u.key,u)}else if("documentDelete"in e){e.documentDelete;const r=e.documentDelete;r.document;const i=tf(t,r.document),s=r.readTime?cr(r.readTime):de.min(),o=Mt.newNoDocument(i,s),l=r.removedTargetIds||[];n=new Au([],l,o.key,o)}else if("documentRemove"in e){e.documentRemove;const r=e.documentRemove;r.document;const i=tf(t,r.document),s=r.removedTargetIds||[];n=new Au([],s,i,null)}else{if(!("filter"in e))return ce();{e.filter;const r=e.filter;r.targetId;const{count:i=0,unchangedNames:s}=r,o=new rN(i,s),l=r.targetId;n=new dE(l,o)}}return n}function mN(t,e){let n;if(e instanceof oc)n={update:Xv(t,e.key,e.value)};else if(e instanceof Gd)n={delete:kp(t,e.key)};else if(e instanceof zi)n={update:Xv(t,e.key,e.data),updateMask:TN(e.fieldMask)};else{if(!(e instanceof eN))return ce();n={verify:kp(t,e.key)}}return e.fieldTransforms.length>0&&(n.updateTransforms=e.fieldTransforms.map(r=>function(s,o){const l=o.transform;if(l instanceof fd)return{fieldPath:o.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(l instanceof $l)return{fieldPath:o.field.canonicalString(),appendMissingElements:{values:l.elements}};if(l instanceof ql)return{fieldPath:o.field.canonicalString(),removeAllFromArray:{values:l.elements}};if(l instanceof pd)return{fieldPath:o.field.canonicalString(),increment:l.Pe};throw ce()}(0,r))),e.precondition.isNone||(n.currentDocument=function(i,s){return s.updateTime!==void 0?{updateTime:hN(i,s.updateTime)}:s.exists!==void 0?{exists:s.exists}:ce()}(t,e.precondition)),n}function gN(t,e){return t&&t.length>0?(Se(e!==void 0),t.map(n=>function(i,s){let o=i.updateTime?cr(i.updateTime):cr(s);return o.isEqual(de.min())&&(o=cr(s)),new JA(o,i.transformResults||[])}(n,e))):[]}function yN(t,e){return{documents:[mE(t,e.path)]}}function vN(t,e){const n={structuredQuery:{}},r=e.path;let i;e.collectionGroup!==null?(i=r,n.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(i=r.popLast(),n.structuredQuery.from=[{collectionId:r.lastSegment()}]),n.parent=mE(t,i);const s=function(h){if(h.length!==0)return vE(Bn.create(h,"and"))}(e.filters);s&&(n.structuredQuery.where=s);const o=function(h){if(h.length!==0)return h.map(m=>function(g){return{field:mo(g.field),direction:xN(g.dir)}}(m))}(e.orderBy);o&&(n.structuredQuery.orderBy=o);const l=xp(t,e.limit);return l!==null&&(n.structuredQuery.limit=l),e.startAt&&(n.structuredQuery.startAt=function(h){return{before:h.inclusive,values:h.position}}(e.startAt)),e.endAt&&(n.structuredQuery.endAt=function(h){return{before:!h.inclusive,values:h.position}}(e.endAt)),{_t:n,parent:i}}function wN(t){let e=fN(t.parent);const n=t.structuredQuery,r=n.from?n.from.length:0;let i=null;if(r>0){Se(r===1);const m=n.from[0];m.allDescendants?i=m.collectionId:e=e.child(m.collectionId)}let s=[];n.where&&(s=function(v){const g=yE(v);return g instanceof Bn&&Kx(g)?g.getFilters():[g]}(n.where));let o=[];n.orderBy&&(o=function(v){return v.map(g=>function(j){return new hd(go(j.field),function(B){switch(B){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(j.direction))}(g))}(n.orderBy));let l=null;n.limit&&(l=function(v){let g;return g=typeof v=="object"?v.value:v,Bd(g)?null:g}(n.limit));let u=null;n.startAt&&(u=function(v){const g=!!v.before,N=v.values||[];return new dd(N,g)}(n.startAt));let h=null;return n.endAt&&(h=function(v){const g=!v.before,N=v.values||[];return new dd(N,g)}(n.endAt)),VA(e,i,o,s,l,"F",u,h)}function _N(t,e){const n=function(i){switch(i){case"TargetPurposeListen":return null;case"TargetPurposeExistenceFilterMismatch":return"existence-filter-mismatch";case"TargetPurposeExistenceFilterMismatchBloom":return"existence-filter-mismatch-bloom";case"TargetPurposeLimboResolution":return"limbo-document";default:return ce()}}(e.purpose);return n==null?null:{"goog-listen-tags":n}}function yE(t){return t.unaryFilter!==void 0?function(n){switch(n.unaryFilter.op){case"IS_NAN":const r=go(n.unaryFilter.field);return st.create(r,"==",{doubleValue:NaN});case"IS_NULL":const i=go(n.unaryFilter.field);return st.create(i,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":const s=go(n.unaryFilter.field);return st.create(s,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const o=go(n.unaryFilter.field);return st.create(o,"!=",{nullValue:"NULL_VALUE"});default:return ce()}}(t):t.fieldFilter!==void 0?function(n){return st.create(go(n.fieldFilter.field),function(i){switch(i){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";default:return ce()}}(n.fieldFilter.op),n.fieldFilter.value)}(t):t.compositeFilter!==void 0?function(n){return Bn.create(n.compositeFilter.filters.map(r=>yE(r)),function(i){switch(i){case"AND":return"and";case"OR":return"or";default:return ce()}}(n.compositeFilter.op))}(t):ce()}function xN(t){return lN[t]}function EN(t){return cN[t]}function kN(t){return uN[t]}function mo(t){return{fieldPath:t.canonicalString()}}function go(t){return Tt.fromServerFormat(t.fieldPath)}function vE(t){return t instanceof st?function(n){if(n.op==="=="){if(Vv(n.value))return{unaryFilter:{field:mo(n.field),op:"IS_NAN"}};if(Mv(n.value))return{unaryFilter:{field:mo(n.field),op:"IS_NULL"}}}else if(n.op==="!="){if(Vv(n.value))return{unaryFilter:{field:mo(n.field),op:"IS_NOT_NAN"}};if(Mv(n.value))return{unaryFilter:{field:mo(n.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:mo(n.field),op:EN(n.op),value:n.value}}}(t):t instanceof Bn?function(n){const r=n.getFilters().map(i=>vE(i));return r.length===1?r[0]:{compositeFilter:{op:kN(n.op),filters:r}}}(t):ce()}function TN(t){const e=[];return t.fields.forEach(n=>e.push(n.canonicalString())),{fieldPaths:e}}function wE(t){return t.length>=4&&t.get(0)==="projects"&&t.get(2)==="databases"}/**
|
|
* @license
|
|
* Copyright 2017 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class xi{constructor(e,n,r,i,s=de.min(),o=de.min(),l=Ct.EMPTY_BYTE_STRING,u=null){this.target=e,this.targetId=n,this.purpose=r,this.sequenceNumber=i,this.snapshotVersion=s,this.lastLimboFreeSnapshotVersion=o,this.resumeToken=l,this.expectedCount=u}withSequenceNumber(e){return new xi(this.target,this.targetId,this.purpose,e,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,this.expectedCount)}withResumeToken(e,n){return new xi(this.target,this.targetId,this.purpose,this.sequenceNumber,n,this.lastLimboFreeSnapshotVersion,e,null)}withExpectedCount(e){return new xi(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,e)}withLastLimboFreeSnapshotVersion(e){return new xi(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 bN{constructor(e){this.ct=e}}function SN(t){const e=wN({parent:t.parent,structuredQuery:t.structuredQuery});return t.limitType==="LAST"?_p(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 IN{constructor(){this.un=new CN}addToCollectionParentIndex(e,n){return this.un.add(n),$.resolve()}getCollectionParents(e,n){return $.resolve(this.un.getEntries(n))}addFieldIndex(e,n){return $.resolve()}deleteFieldIndex(e,n){return $.resolve()}deleteAllFieldIndexes(e){return $.resolve()}createTargetIndexes(e,n){return $.resolve()}getDocumentsMatchingTarget(e,n){return $.resolve(null)}getIndexType(e,n){return $.resolve(0)}getFieldIndexes(e,n){return $.resolve([])}getNextCollectionGroupToUpdate(e){return $.resolve(null)}getMinOffset(e,n){return $.resolve(ji.min())}getMinOffsetFromCollectionGroup(e,n){return $.resolve(ji.min())}updateCollectionGroup(e,n,r){return $.resolve()}updateIndexEntries(e,n){return $.resolve()}}class CN{constructor(){this.index={}}add(e){const n=e.lastSegment(),r=e.popLast(),i=this.index[n]||new St(De.comparator),s=!i.has(r);return this.index[n]=i.add(r),s}has(e){const n=e.lastSegment(),r=e.popLast(),i=this.index[n];return i&&i.has(r)}getEntries(e){return(this.index[e]||new St(De.comparator)).toArray()}}/**
|
|
* @license
|
|
* Copyright 2017 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class Jo{constructor(e){this.Ln=e}next(){return this.Ln+=2,this.Ln}static Bn(){return new Jo(0)}static kn(){return new Jo(-1)}}/**
|
|
* @license
|
|
* Copyright 2017 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class AN{constructor(){this.changes=new aa(e=>e.toString(),(e,n)=>e.isEqual(n)),this.changesApplied=!1}addEntry(e){this.assertNotApplied(),this.changes.set(e.key,e)}removeEntry(e,n){this.assertNotApplied(),this.changes.set(e,Mt.newInvalidDocument(e).setReadTime(n))}getEntry(e,n){this.assertNotApplied();const r=this.changes.get(n);return r!==void 0?$.resolve(r):this.getFromCache(e,n)}getEntries(e,n){return this.getAllFromCache(e,n)}apply(e){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(e)}assertNotApplied(){}}/**
|
|
* @license
|
|
* Copyright 2017 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*//**
|
|
* @license
|
|
* Copyright 2022 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class NN{constructor(e,n){this.overlayedDocument=e,this.mutatedFields=n}}/**
|
|
* @license
|
|
* Copyright 2017 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class PN{constructor(e,n,r,i){this.remoteDocumentCache=e,this.mutationQueue=n,this.documentOverlayCache=r,this.indexManager=i}getDocument(e,n){let r=null;return this.documentOverlayCache.getOverlay(e,n).next(i=>(r=i,this.remoteDocumentCache.getEntry(e,n))).next(i=>(r!==null&&vl(r.mutation,i,dn.empty(),ht.now()),i))}getDocuments(e,n){return this.remoteDocumentCache.getEntries(e,n).next(r=>this.getLocalViewOfDocuments(e,r,me()).next(()=>r))}getLocalViewOfDocuments(e,n,r=me()){const i=fs();return this.populateOverlays(e,i,n).next(()=>this.computeViews(e,n,i,r).next(s=>{let o=nl();return s.forEach((l,u)=>{o=o.insert(l,u.overlayedDocument)}),o}))}getOverlayedDocuments(e,n){const r=fs();return this.populateOverlays(e,r,n).next(()=>this.computeViews(e,n,r,me()))}populateOverlays(e,n,r){const i=[];return r.forEach(s=>{n.has(s)||i.push(s)}),this.documentOverlayCache.getOverlays(e,i).next(s=>{s.forEach((o,l)=>{n.set(o,l)})})}computeViews(e,n,r,i){let s=Gr();const o=yl(),l=function(){return yl()}();return n.forEach((u,h)=>{const m=r.get(h.key);i.has(h.key)&&(m===void 0||m.mutation instanceof zi)?s=s.insert(h.key,h):m!==void 0?(o.set(h.key,m.mutation.getFieldMask()),vl(m.mutation,h,m.mutation.getFieldMask(),ht.now())):o.set(h.key,dn.empty())}),this.recalculateAndSaveOverlays(e,s).next(u=>(u.forEach((h,m)=>o.set(h,m)),n.forEach((h,m)=>{var v;return l.set(h,new NN(m,(v=o.get(h))!==null&&v!==void 0?v:null))}),l))}recalculateAndSaveOverlays(e,n){const r=yl();let i=new We((o,l)=>o-l),s=me();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,n).next(o=>{for(const l of o)l.keys().forEach(u=>{const h=n.get(u);if(h===null)return;let m=r.get(u)||dn.empty();m=l.applyToLocalView(h,m),r.set(u,m);const v=(i.get(l.batchId)||me()).add(u);i=i.insert(l.batchId,v)})}).next(()=>{const o=[],l=i.getReverseIterator();for(;l.hasNext();){const u=l.getNext(),h=u.key,m=u.value,v=nE();m.forEach(g=>{if(!s.has(g)){const N=lE(n.get(g),r.get(g));N!==null&&v.set(g,N),s=s.add(g)}}),o.push(this.documentOverlayCache.saveOverlays(e,h,v))}return $.waitFor(o)}).next(()=>r)}recalculateAndSaveOverlaysForDocumentKeys(e,n){return this.remoteDocumentCache.getEntries(e,n).next(r=>this.recalculateAndSaveOverlays(e,r))}getDocumentsMatchingQuery(e,n,r,i){return function(o){return ie.isDocumentKey(o.path)&&o.collectionGroup===null&&o.filters.length===0}(n)?this.getDocumentsMatchingDocumentQuery(e,n.path):Jx(n)?this.getDocumentsMatchingCollectionGroupQuery(e,n,r,i):this.getDocumentsMatchingCollectionQuery(e,n,r,i)}getNextDocuments(e,n,r,i){return this.remoteDocumentCache.getAllFromCollectionGroup(e,n,r,i).next(s=>{const o=i-s.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(e,n,r.largestBatchId,i-s.size):$.resolve(fs());let l=-1,u=s;return o.next(h=>$.forEach(h,(m,v)=>(l<v.largestBatchId&&(l=v.largestBatchId),s.get(m)?$.resolve():this.remoteDocumentCache.getEntry(e,m).next(g=>{u=u.insert(m,g)}))).next(()=>this.populateOverlays(e,h,s)).next(()=>this.computeViews(e,u,h,me())).next(m=>({batchId:l,changes:tE(m)})))})}getDocumentsMatchingDocumentQuery(e,n){return this.getDocument(e,new ie(n)).next(r=>{let i=nl();return r.isFoundDocument()&&(i=i.insert(r.key,r)),i})}getDocumentsMatchingCollectionGroupQuery(e,n,r,i){const s=n.collectionGroup;let o=nl();return this.indexManager.getCollectionParents(e,s).next(l=>$.forEach(l,u=>{const h=function(v,g){return new sc(g,null,v.explicitOrderBy.slice(),v.filters.slice(),v.limit,v.limitType,v.startAt,v.endAt)}(n,u.child(s));return this.getDocumentsMatchingCollectionQuery(e,h,r,i).next(m=>{m.forEach((v,g)=>{o=o.insert(v,g)})})}).next(()=>o))}getDocumentsMatchingCollectionQuery(e,n,r,i){let s;return this.documentOverlayCache.getOverlaysForCollection(e,n.path,r.largestBatchId).next(o=>(s=o,this.remoteDocumentCache.getDocumentsMatchingQuery(e,n,r,s,i))).next(o=>{s.forEach((u,h)=>{const m=h.getKey();o.get(m)===null&&(o=o.insert(m,Mt.newInvalidDocument(m)))});let l=nl();return o.forEach((u,h)=>{const m=s.get(u);m!==void 0&&vl(m.mutation,h,dn.empty(),ht.now()),Wd(n,h)&&(l=l.insert(u,h))}),l})}}/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class RN{constructor(e){this.serializer=e,this.hr=new Map,this.Pr=new Map}getBundleMetadata(e,n){return $.resolve(this.hr.get(n))}saveBundleMetadata(e,n){return this.hr.set(n.id,function(i){return{id:i.id,version:i.version,createTime:cr(i.createTime)}}(n)),$.resolve()}getNamedQuery(e,n){return $.resolve(this.Pr.get(n))}saveNamedQuery(e,n){return this.Pr.set(n.name,function(i){return{name:i.name,query:SN(i.bundledQuery),readTime:cr(i.readTime)}}(n)),$.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 DN{constructor(){this.overlays=new We(ie.comparator),this.Ir=new Map}getOverlay(e,n){return $.resolve(this.overlays.get(n))}getOverlays(e,n){const r=fs();return $.forEach(n,i=>this.getOverlay(e,i).next(s=>{s!==null&&r.set(i,s)})).next(()=>r)}saveOverlays(e,n,r){return r.forEach((i,s)=>{this.ht(e,n,s)}),$.resolve()}removeOverlaysForBatchId(e,n,r){const i=this.Ir.get(r);return i!==void 0&&(i.forEach(s=>this.overlays=this.overlays.remove(s)),this.Ir.delete(r)),$.resolve()}getOverlaysForCollection(e,n,r){const i=fs(),s=n.length+1,o=new ie(n.child("")),l=this.overlays.getIteratorFrom(o);for(;l.hasNext();){const u=l.getNext().value,h=u.getKey();if(!n.isPrefixOf(h.path))break;h.path.length===s&&u.largestBatchId>r&&i.set(u.getKey(),u)}return $.resolve(i)}getOverlaysForCollectionGroup(e,n,r,i){let s=new We((h,m)=>h-m);const o=this.overlays.getIterator();for(;o.hasNext();){const h=o.getNext().value;if(h.getKey().getCollectionGroup()===n&&h.largestBatchId>r){let m=s.get(h.largestBatchId);m===null&&(m=fs(),s=s.insert(h.largestBatchId,m)),m.set(h.getKey(),h)}}const l=fs(),u=s.getIterator();for(;u.hasNext()&&(u.getNext().value.forEach((h,m)=>l.set(h,m)),!(l.size()>=i)););return $.resolve(l)}ht(e,n,r){const i=this.overlays.get(r.key);if(i!==null){const o=this.Ir.get(i.largestBatchId).delete(r.key);this.Ir.set(i.largestBatchId,o)}this.overlays=this.overlays.insert(r.key,new nN(n,r));let s=this.Ir.get(n);s===void 0&&(s=me(),this.Ir.set(n,s)),this.Ir.set(n,s.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 jN{constructor(){this.sessionToken=Ct.EMPTY_BYTE_STRING}getSessionToken(e){return $.resolve(this.sessionToken)}setSessionToken(e,n){return this.sessionToken=n,$.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 Gm{constructor(){this.Tr=new St(pt.Er),this.dr=new St(pt.Ar)}isEmpty(){return this.Tr.isEmpty()}addReference(e,n){const r=new pt(e,n);this.Tr=this.Tr.add(r),this.dr=this.dr.add(r)}Rr(e,n){e.forEach(r=>this.addReference(r,n))}removeReference(e,n){this.Vr(new pt(e,n))}mr(e,n){e.forEach(r=>this.removeReference(r,n))}gr(e){const n=new ie(new De([])),r=new pt(n,e),i=new pt(n,e+1),s=[];return this.dr.forEachInRange([r,i],o=>{this.Vr(o),s.push(o.key)}),s}pr(){this.Tr.forEach(e=>this.Vr(e))}Vr(e){this.Tr=this.Tr.delete(e),this.dr=this.dr.delete(e)}yr(e){const n=new ie(new De([])),r=new pt(n,e),i=new pt(n,e+1);let s=me();return this.dr.forEachInRange([r,i],o=>{s=s.add(o.key)}),s}containsKey(e){const n=new pt(e,0),r=this.Tr.firstAfterOrEqual(n);return r!==null&&e.isEqual(r.key)}}class pt{constructor(e,n){this.key=e,this.wr=n}static Er(e,n){return ie.comparator(e.key,n.key)||xe(e.wr,n.wr)}static Ar(e,n){return xe(e.wr,n.wr)||ie.comparator(e.key,n.key)}}/**
|
|
* @license
|
|
* Copyright 2017 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class ON{constructor(e,n){this.indexManager=e,this.referenceDelegate=n,this.mutationQueue=[],this.Sr=1,this.br=new St(pt.Er)}checkEmpty(e){return $.resolve(this.mutationQueue.length===0)}addMutationBatch(e,n,r,i){const s=this.Sr;this.Sr++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];const o=new tN(s,n,r,i);this.mutationQueue.push(o);for(const l of i)this.br=this.br.add(new pt(l.key,s)),this.indexManager.addToCollectionParentIndex(e,l.key.path.popLast());return $.resolve(o)}lookupMutationBatch(e,n){return $.resolve(this.Dr(n))}getNextMutationBatchAfterBatchId(e,n){const r=n+1,i=this.vr(r),s=i<0?0:i;return $.resolve(this.mutationQueue.length>s?this.mutationQueue[s]:null)}getHighestUnacknowledgedBatchId(){return $.resolve(this.mutationQueue.length===0?-1:this.Sr-1)}getAllMutationBatches(e){return $.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(e,n){const r=new pt(n,0),i=new pt(n,Number.POSITIVE_INFINITY),s=[];return this.br.forEachInRange([r,i],o=>{const l=this.Dr(o.wr);s.push(l)}),$.resolve(s)}getAllMutationBatchesAffectingDocumentKeys(e,n){let r=new St(xe);return n.forEach(i=>{const s=new pt(i,0),o=new pt(i,Number.POSITIVE_INFINITY);this.br.forEachInRange([s,o],l=>{r=r.add(l.wr)})}),$.resolve(this.Cr(r))}getAllMutationBatchesAffectingQuery(e,n){const r=n.path,i=r.length+1;let s=r;ie.isDocumentKey(s)||(s=s.child(""));const o=new pt(new ie(s),0);let l=new St(xe);return this.br.forEachWhile(u=>{const h=u.key.path;return!!r.isPrefixOf(h)&&(h.length===i&&(l=l.add(u.wr)),!0)},o),$.resolve(this.Cr(l))}Cr(e){const n=[];return e.forEach(r=>{const i=this.Dr(r);i!==null&&n.push(i)}),n}removeMutationBatch(e,n){Se(this.Fr(n.batchId,"removed")===0),this.mutationQueue.shift();let r=this.br;return $.forEach(n.mutations,i=>{const s=new pt(i.key,n.batchId);return r=r.delete(s),this.referenceDelegate.markPotentiallyOrphaned(e,i.key)}).next(()=>{this.br=r})}On(e){}containsKey(e,n){const r=new pt(n,0),i=this.br.firstAfterOrEqual(r);return $.resolve(n.isEqual(i&&i.key))}performConsistencyCheck(e){return this.mutationQueue.length,$.resolve()}Fr(e,n){return this.vr(e)}vr(e){return this.mutationQueue.length===0?0:e-this.mutationQueue[0].batchId}Dr(e){const n=this.vr(e);return n<0||n>=this.mutationQueue.length?null:this.mutationQueue[n]}}/**
|
|
* @license
|
|
* Copyright 2017 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class LN{constructor(e){this.Mr=e,this.docs=function(){return new We(ie.comparator)}(),this.size=0}setIndexManager(e){this.indexManager=e}addEntry(e,n){const r=n.key,i=this.docs.get(r),s=i?i.size:0,o=this.Mr(n);return this.docs=this.docs.insert(r,{document:n.mutableCopy(),size:o}),this.size+=o-s,this.indexManager.addToCollectionParentIndex(e,r.path.popLast())}removeEntry(e){const n=this.docs.get(e);n&&(this.docs=this.docs.remove(e),this.size-=n.size)}getEntry(e,n){const r=this.docs.get(n);return $.resolve(r?r.document.mutableCopy():Mt.newInvalidDocument(n))}getEntries(e,n){let r=Gr();return n.forEach(i=>{const s=this.docs.get(i);r=r.insert(i,s?s.document.mutableCopy():Mt.newInvalidDocument(i))}),$.resolve(r)}getDocumentsMatchingQuery(e,n,r,i){let s=Gr();const o=n.path,l=new ie(o.child("")),u=this.docs.getIteratorFrom(l);for(;u.hasNext();){const{key:h,value:{document:m}}=u.getNext();if(!o.isPrefixOf(h.path))break;h.path.length>o.length+1||wA(vA(m),r)<=0||(i.has(m.key)||Wd(n,m))&&(s=s.insert(m.key,m.mutableCopy()))}return $.resolve(s)}getAllFromCollectionGroup(e,n,r,i){ce()}Or(e,n){return $.forEach(this.docs,r=>n(r))}newChangeBuffer(e){return new MN(this)}getSize(e){return $.resolve(this.size)}}class MN extends AN{constructor(e){super(),this.cr=e}applyChanges(e){const n=[];return this.changes.forEach((r,i)=>{i.isValidDocument()?n.push(this.cr.addEntry(e,i)):this.cr.removeEntry(r)}),$.waitFor(n)}getFromCache(e,n){return this.cr.getEntry(e,n)}getAllFromCache(e,n){return this.cr.getEntries(e,n)}}/**
|
|
* @license
|
|
* Copyright 2017 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class VN{constructor(e){this.persistence=e,this.Nr=new aa(n=>Bm(n),$m),this.lastRemoteSnapshotVersion=de.min(),this.highestTargetId=0,this.Lr=0,this.Br=new Gm,this.targetCount=0,this.kr=Jo.Bn()}forEachTarget(e,n){return this.Nr.forEach((r,i)=>n(i)),$.resolve()}getLastRemoteSnapshotVersion(e){return $.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(e){return $.resolve(this.Lr)}allocateTargetId(e){return this.highestTargetId=this.kr.next(),$.resolve(this.highestTargetId)}setTargetsMetadata(e,n,r){return r&&(this.lastRemoteSnapshotVersion=r),n>this.Lr&&(this.Lr=n),$.resolve()}Kn(e){this.Nr.set(e.target,e);const n=e.targetId;n>this.highestTargetId&&(this.kr=new Jo(n),this.highestTargetId=n),e.sequenceNumber>this.Lr&&(this.Lr=e.sequenceNumber)}addTargetData(e,n){return this.Kn(n),this.targetCount+=1,$.resolve()}updateTargetData(e,n){return this.Kn(n),$.resolve()}removeTargetData(e,n){return this.Nr.delete(n.target),this.Br.gr(n.targetId),this.targetCount-=1,$.resolve()}removeTargets(e,n,r){let i=0;const s=[];return this.Nr.forEach((o,l)=>{l.sequenceNumber<=n&&r.get(l.targetId)===null&&(this.Nr.delete(o),s.push(this.removeMatchingKeysForTargetId(e,l.targetId)),i++)}),$.waitFor(s).next(()=>i)}getTargetCount(e){return $.resolve(this.targetCount)}getTargetData(e,n){const r=this.Nr.get(n)||null;return $.resolve(r)}addMatchingKeys(e,n,r){return this.Br.Rr(n,r),$.resolve()}removeMatchingKeys(e,n,r){this.Br.mr(n,r);const i=this.persistence.referenceDelegate,s=[];return i&&n.forEach(o=>{s.push(i.markPotentiallyOrphaned(e,o))}),$.waitFor(s)}removeMatchingKeysForTargetId(e,n){return this.Br.gr(n),$.resolve()}getMatchingKeysForTargetId(e,n){const r=this.Br.yr(n);return $.resolve(r)}containsKey(e,n){return $.resolve(this.Br.containsKey(n))}}/**
|
|
* @license
|
|
* Copyright 2017 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class FN{constructor(e,n){this.qr={},this.overlays={},this.Qr=new Vm(0),this.Kr=!1,this.Kr=!0,this.$r=new jN,this.referenceDelegate=e(this),this.Ur=new VN(this),this.indexManager=new IN,this.remoteDocumentCache=function(i){return new LN(i)}(r=>this.referenceDelegate.Wr(r)),this.serializer=new bN(n),this.Gr=new RN(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.Kr=!1,Promise.resolve()}get started(){return this.Kr}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(e){return this.indexManager}getDocumentOverlayCache(e){let n=this.overlays[e.toKey()];return n||(n=new DN,this.overlays[e.toKey()]=n),n}getMutationQueue(e,n){let r=this.qr[e.toKey()];return r||(r=new ON(n,this.referenceDelegate),this.qr[e.toKey()]=r),r}getGlobalsCache(){return this.$r}getTargetCache(){return this.Ur}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.Gr}runTransaction(e,n,r){re("MemoryPersistence","Starting transaction:",e);const i=new UN(this.Qr.next());return this.referenceDelegate.zr(),r(i).next(s=>this.referenceDelegate.jr(i).next(()=>s)).toPromise().then(s=>(i.raiseOnCommittedEvent(),s))}Hr(e,n){return $.or(Object.values(this.qr).map(r=>()=>r.containsKey(e,n)))}}class UN extends xA{constructor(e){super(),this.currentSequenceNumber=e}}class Qm{constructor(e){this.persistence=e,this.Jr=new Gm,this.Yr=null}static Zr(e){return new Qm(e)}get Xr(){if(this.Yr)return this.Yr;throw ce()}addReference(e,n,r){return this.Jr.addReference(r,n),this.Xr.delete(r.toString()),$.resolve()}removeReference(e,n,r){return this.Jr.removeReference(r,n),this.Xr.add(r.toString()),$.resolve()}markPotentiallyOrphaned(e,n){return this.Xr.add(n.toString()),$.resolve()}removeTarget(e,n){this.Jr.gr(n.targetId).forEach(i=>this.Xr.add(i.toString()));const r=this.persistence.getTargetCache();return r.getMatchingKeysForTargetId(e,n.targetId).next(i=>{i.forEach(s=>this.Xr.add(s.toString()))}).next(()=>r.removeTargetData(e,n))}zr(){this.Yr=new Set}jr(e){const n=this.persistence.getRemoteDocumentCache().newChangeBuffer();return $.forEach(this.Xr,r=>{const i=ie.fromPath(r);return this.ei(e,i).next(s=>{s||n.removeEntry(i,de.min())})}).next(()=>(this.Yr=null,n.apply(e)))}updateLimboDocument(e,n){return this.ei(e,n).next(r=>{r?this.Xr.delete(n.toString()):this.Xr.add(n.toString())})}Wr(e){return 0}ei(e,n){return $.or([()=>$.resolve(this.Jr.containsKey(n)),()=>this.persistence.getTargetCache().containsKey(e,n),()=>this.persistence.Hr(e,n)])}}/**
|
|
* @license
|
|
* Copyright 2017 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class Ym{constructor(e,n,r,i){this.targetId=e,this.fromCache=n,this.$i=r,this.Ui=i}static Wi(e,n){let r=me(),i=me();for(const s of n.docChanges)switch(s.type){case 0:r=r.add(s.doc.key);break;case 1:i=i.add(s.doc.key)}return new Ym(e,n.fromCache,r,i)}}/**
|
|
* @license
|
|
* Copyright 2023 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class zN{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 BN{constructor(){this.Gi=!1,this.zi=!1,this.ji=100,this.Hi=function(){return Pb()?8:EA(Ut())>0?6:4}()}initialize(e,n){this.Ji=e,this.indexManager=n,this.Gi=!0}getDocumentsMatchingQuery(e,n,r,i){const s={result:null};return this.Yi(e,n).next(o=>{s.result=o}).next(()=>{if(!s.result)return this.Zi(e,n,i,r).next(o=>{s.result=o})}).next(()=>{if(s.result)return;const o=new zN;return this.Xi(e,n,o).next(l=>{if(s.result=l,this.zi)return this.es(e,n,o,l.size)})}).next(()=>s.result)}es(e,n,r,i){return r.documentReadCount<this.ji?(Wa()<=ye.DEBUG&&re("QueryEngine","SDK will not create cache indexes for query:",po(n),"since it only creates cache indexes for collection contains","more than or equal to",this.ji,"documents"),$.resolve()):(Wa()<=ye.DEBUG&&re("QueryEngine","Query:",po(n),"scans",r.documentReadCount,"local documents and returns",i,"documents as results."),r.documentReadCount>this.Hi*i?(Wa()<=ye.DEBUG&&re("QueryEngine","The SDK decides to create cache indexes for query:",po(n),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(e,lr(n))):$.resolve())}Yi(e,n){if(Bv(n))return $.resolve(null);let r=lr(n);return this.indexManager.getIndexType(e,r).next(i=>i===0?null:(n.limit!==null&&i===1&&(n=_p(n,null,"F"),r=lr(n)),this.indexManager.getDocumentsMatchingTarget(e,r).next(s=>{const o=me(...s);return this.Ji.getDocuments(e,o).next(l=>this.indexManager.getMinOffset(e,r).next(u=>{const h=this.ts(n,l);return this.ns(n,h,o,u.readTime)?this.Yi(e,_p(n,null,"F")):this.rs(e,h,n,u)}))})))}Zi(e,n,r,i){return Bv(n)||i.isEqual(de.min())?$.resolve(null):this.Ji.getDocuments(e,r).next(s=>{const o=this.ts(n,s);return this.ns(n,o,r,i)?$.resolve(null):(Wa()<=ye.DEBUG&&re("QueryEngine","Re-using previous result from %s to execute query: %s",i.toString(),po(n)),this.rs(e,o,n,yA(i,-1)).next(l=>l))})}ts(e,n){let r=new St(Zx(e));return n.forEach((i,s)=>{Wd(e,s)&&(r=r.add(s))}),r}ns(e,n,r,i){if(e.limit===null)return!1;if(r.size!==n.size)return!0;const s=e.limitType==="F"?n.last():n.first();return!!s&&(s.hasPendingWrites||s.version.compareTo(i)>0)}Xi(e,n,r){return Wa()<=ye.DEBUG&&re("QueryEngine","Using full collection scan to execute query:",po(n)),this.Ji.getDocumentsMatchingQuery(e,n,ji.min(),r)}rs(e,n,r,i){return this.Ji.getDocumentsMatchingQuery(e,r,i).next(s=>(n.forEach(o=>{s=s.insert(o.key,o)}),s))}}/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class $N{constructor(e,n,r,i){this.persistence=e,this.ss=n,this.serializer=i,this.os=new We(xe),this._s=new aa(s=>Bm(s),$m),this.us=new Map,this.cs=e.getRemoteDocumentCache(),this.Ur=e.getTargetCache(),this.Gr=e.getBundleCache(),this.ls(r)}ls(e){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(e),this.indexManager=this.persistence.getIndexManager(e),this.mutationQueue=this.persistence.getMutationQueue(e,this.indexManager),this.localDocuments=new PN(this.cs,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.cs.setIndexManager(this.indexManager),this.ss.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",n=>e.collect(n,this.os))}}function qN(t,e,n,r){return new $N(t,e,n,r)}async function _E(t,e){const n=he(t);return await n.persistence.runTransaction("Handle user change","readonly",r=>{let i;return n.mutationQueue.getAllMutationBatches(r).next(s=>(i=s,n.ls(e),n.mutationQueue.getAllMutationBatches(r))).next(s=>{const o=[],l=[];let u=me();for(const h of i){o.push(h.batchId);for(const m of h.mutations)u=u.add(m.key)}for(const h of s){l.push(h.batchId);for(const m of h.mutations)u=u.add(m.key)}return n.localDocuments.getDocuments(r,u).next(h=>({hs:h,removedBatchIds:o,addedBatchIds:l}))})})}function WN(t,e){const n=he(t);return n.persistence.runTransaction("Acknowledge batch","readwrite-primary",r=>{const i=e.batch.keys(),s=n.cs.newChangeBuffer({trackRemovals:!0});return function(l,u,h,m){const v=h.batch,g=v.keys();let N=$.resolve();return g.forEach(j=>{N=N.next(()=>m.getEntry(u,j)).next(L=>{const B=h.docVersions.get(j);Se(B!==null),L.version.compareTo(B)<0&&(v.applyToRemoteDocument(L,h),L.isValidDocument()&&(L.setReadTime(h.commitVersion),m.addEntry(L)))})}),N.next(()=>l.mutationQueue.removeMutationBatch(u,v))}(n,r,e,s).next(()=>s.apply(r)).next(()=>n.mutationQueue.performConsistencyCheck(r)).next(()=>n.documentOverlayCache.removeOverlaysForBatchId(r,i,e.batch.batchId)).next(()=>n.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(r,function(l){let u=me();for(let h=0;h<l.mutationResults.length;++h)l.mutationResults[h].transformResults.length>0&&(u=u.add(l.batch.mutations[h].key));return u}(e))).next(()=>n.localDocuments.getDocuments(r,i))})}function xE(t){const e=he(t);return e.persistence.runTransaction("Get last remote snapshot version","readonly",n=>e.Ur.getLastRemoteSnapshotVersion(n))}function HN(t,e){const n=he(t),r=e.snapshotVersion;let i=n.os;return n.persistence.runTransaction("Apply remote event","readwrite-primary",s=>{const o=n.cs.newChangeBuffer({trackRemovals:!0});i=n.os;const l=[];e.targetChanges.forEach((m,v)=>{const g=i.get(v);if(!g)return;l.push(n.Ur.removeMatchingKeys(s,m.removedDocuments,v).next(()=>n.Ur.addMatchingKeys(s,m.addedDocuments,v)));let N=g.withSequenceNumber(s.currentSequenceNumber);e.targetMismatches.get(v)!==null?N=N.withResumeToken(Ct.EMPTY_BYTE_STRING,de.min()).withLastLimboFreeSnapshotVersion(de.min()):m.resumeToken.approximateByteSize()>0&&(N=N.withResumeToken(m.resumeToken,r)),i=i.insert(v,N),function(L,B,I){return L.resumeToken.approximateByteSize()===0||B.snapshotVersion.toMicroseconds()-L.snapshotVersion.toMicroseconds()>=3e8?!0:I.addedDocuments.size+I.modifiedDocuments.size+I.removedDocuments.size>0}(g,N,m)&&l.push(n.Ur.updateTargetData(s,N))});let u=Gr(),h=me();if(e.documentUpdates.forEach(m=>{e.resolvedLimboDocuments.has(m)&&l.push(n.persistence.referenceDelegate.updateLimboDocument(s,m))}),l.push(KN(s,o,e.documentUpdates).next(m=>{u=m.Ps,h=m.Is})),!r.isEqual(de.min())){const m=n.Ur.getLastRemoteSnapshotVersion(s).next(v=>n.Ur.setTargetsMetadata(s,s.currentSequenceNumber,r));l.push(m)}return $.waitFor(l).next(()=>o.apply(s)).next(()=>n.localDocuments.getLocalViewOfDocuments(s,u,h)).next(()=>u)}).then(s=>(n.os=i,s))}function KN(t,e,n){let r=me(),i=me();return n.forEach(s=>r=r.add(s)),e.getEntries(t,r).next(s=>{let o=Gr();return n.forEach((l,u)=>{const h=s.get(l);u.isFoundDocument()!==h.isFoundDocument()&&(i=i.add(l)),u.isNoDocument()&&u.version.isEqual(de.min())?(e.removeEntry(l,u.readTime),o=o.insert(l,u)):!h.isValidDocument()||u.version.compareTo(h.version)>0||u.version.compareTo(h.version)===0&&h.hasPendingWrites?(e.addEntry(u),o=o.insert(l,u)):re("LocalStore","Ignoring outdated watch update for ",l,". Current version:",h.version," Watch version:",u.version)}),{Ps:o,Is:i}})}function GN(t,e){const n=he(t);return n.persistence.runTransaction("Get next mutation batch","readonly",r=>(e===void 0&&(e=-1),n.mutationQueue.getNextMutationBatchAfterBatchId(r,e)))}function QN(t,e){const n=he(t);return n.persistence.runTransaction("Allocate target","readwrite",r=>{let i;return n.Ur.getTargetData(r,e).next(s=>s?(i=s,$.resolve(i)):n.Ur.allocateTargetId(r).next(o=>(i=new xi(e,o,"TargetPurposeListen",r.currentSequenceNumber),n.Ur.addTargetData(r,i).next(()=>i))))}).then(r=>{const i=n.os.get(r.targetId);return(i===null||r.snapshotVersion.compareTo(i.snapshotVersion)>0)&&(n.os=n.os.insert(r.targetId,r),n._s.set(e,r.targetId)),r})}async function bp(t,e,n){const r=he(t),i=r.os.get(e),s=n?"readwrite":"readwrite-primary";try{n||await r.persistence.runTransaction("Release target",s,o=>r.persistence.referenceDelegate.removeTarget(o,i))}catch(o){if(!ic(o))throw o;re("LocalStore",`Failed to update sequence numbers for target ${e}: ${o}`)}r.os=r.os.remove(e),r._s.delete(i.target)}function Zv(t,e,n){const r=he(t);let i=de.min(),s=me();return r.persistence.runTransaction("Execute query","readwrite",o=>function(u,h,m){const v=he(u),g=v._s.get(m);return g!==void 0?$.resolve(v.os.get(g)):v.Ur.getTargetData(h,m)}(r,o,lr(e)).next(l=>{if(l)return i=l.lastLimboFreeSnapshotVersion,r.Ur.getMatchingKeysForTargetId(o,l.targetId).next(u=>{s=u})}).next(()=>r.ss.getDocumentsMatchingQuery(o,e,n?i:de.min(),n?s:me())).next(l=>(YN(r,UA(e),l),{documents:l,Ts:s})))}function YN(t,e,n){let r=t.us.get(e)||de.min();n.forEach((i,s)=>{s.readTime.compareTo(r)>0&&(r=s.readTime)}),t.us.set(e,r)}class e0{constructor(){this.activeTargetIds=HA()}fs(e){this.activeTargetIds=this.activeTargetIds.add(e)}gs(e){this.activeTargetIds=this.activeTargetIds.delete(e)}Vs(){const e={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(e)}}class JN{constructor(){this.so=new e0,this.oo={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,n,r){}addLocalQueryTarget(e,n=!0){return n&&this.so.fs(e),this.oo[e]||"not-current"}updateQueryState(e,n,r){this.oo[e]=n}removeLocalQueryTarget(e){this.so.gs(e)}isLocalQueryTarget(e){return this.so.activeTargetIds.has(e)}clearQueryState(e){delete this.oo[e]}getAllActiveQueryTargets(){return this.so.activeTargetIds}isActiveQueryTarget(e){return this.so.activeTargetIds.has(e)}start(){return this.so=new e0,Promise.resolve()}handleUserChange(e,n,r){}setOnlineState(e){}shutdown(){}writeSequenceNumber(e){}notifyBundleLoaded(e){}}/**
|
|
* @license
|
|
* Copyright 2019 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class XN{_o(e){}shutdown(){}}/**
|
|
* @license
|
|
* Copyright 2019 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class t0{constructor(){this.ao=()=>this.uo(),this.co=()=>this.lo(),this.ho=[],this.Po()}_o(e){this.ho.push(e)}shutdown(){window.removeEventListener("online",this.ao),window.removeEventListener("offline",this.co)}Po(){window.addEventListener("online",this.ao),window.addEventListener("offline",this.co)}uo(){re("ConnectivityMonitor","Network connectivity changed: AVAILABLE");for(const e of this.ho)e(0)}lo(){re("ConnectivityMonitor","Network connectivity changed: UNAVAILABLE");for(const e of this.ho)e(1)}static D(){return typeof window<"u"&&window.addEventListener!==void 0&&window.removeEventListener!==void 0}}/**
|
|
* @license
|
|
* Copyright 2023 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/let ou=null;function nf(){return ou===null?ou=function(){return 268435456+Math.round(2147483648*Math.random())}():ou++,"0x"+ou.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 ZN={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregationQuery:"runAggregationQuery"};/**
|
|
* @license
|
|
* Copyright 2017 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class e2{constructor(e){this.Io=e.Io,this.To=e.To}Eo(e){this.Ao=e}Ro(e){this.Vo=e}mo(e){this.fo=e}onMessage(e){this.po=e}close(){this.To()}send(e){this.Io(e)}yo(){this.Ao()}wo(){this.Vo()}So(e){this.fo(e)}bo(e){this.po(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 jt="WebChannelConnection";class t2 extends class{constructor(n){this.databaseInfo=n,this.databaseId=n.databaseId;const r=n.ssl?"https":"http",i=encodeURIComponent(this.databaseId.projectId),s=encodeURIComponent(this.databaseId.database);this.Do=r+"://"+n.host,this.vo=`projects/${i}/databases/${s}`,this.Co=this.databaseId.database==="(default)"?`project_id=${i}`:`project_id=${i}&database_id=${s}`}get Fo(){return!1}Mo(n,r,i,s,o){const l=nf(),u=this.xo(n,r.toUriEncodedString());re("RestConnection",`Sending RPC '${n}' ${l}:`,u,i);const h={"google-cloud-resource-prefix":this.vo,"x-goog-request-params":this.Co};return this.Oo(h,s,o),this.No(n,u,h,i).then(m=>(re("RestConnection",`Received RPC '${n}' ${l}: `,m),m),m=>{throw Ko("RestConnection",`RPC '${n}' ${l} failed with error: `,m,"url: ",u,"request:",i),m})}Lo(n,r,i,s,o,l){return this.Mo(n,r,i,s,o)}Oo(n,r,i){n["X-Goog-Api-Client"]=function(){return"gl-js/ fire/"+oa}(),n["Content-Type"]="text/plain",this.databaseInfo.appId&&(n["X-Firebase-GMPID"]=this.databaseInfo.appId),r&&r.headers.forEach((s,o)=>n[o]=s),i&&i.headers.forEach((s,o)=>n[o]=s)}xo(n,r){const i=ZN[n];return`${this.Do}/v1/${r}:${i}`}terminate(){}}{constructor(e){super(e),this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams,this.longPollingOptions=e.longPollingOptions}No(e,n,r,i){const s=nf();return new Promise((o,l)=>{const u=new Ox;u.setWithCredentials(!0),u.listenOnce(Lx.COMPLETE,()=>{try{switch(u.getLastErrorCode()){case Su.NO_ERROR:const m=u.getResponseJson();re(jt,`XHR for RPC '${e}' ${s} received:`,JSON.stringify(m)),o(m);break;case Su.TIMEOUT:re(jt,`RPC '${e}' ${s} timed out`),l(new Z(U.DEADLINE_EXCEEDED,"Request time out"));break;case Su.HTTP_ERROR:const v=u.getStatus();if(re(jt,`RPC '${e}' ${s} failed with status:`,v,"response text:",u.getResponseText()),v>0){let g=u.getResponseJson();Array.isArray(g)&&(g=g[0]);const N=g==null?void 0:g.error;if(N&&N.status&&N.message){const j=function(B){const I=B.toLowerCase().replace(/_/g,"-");return Object.values(U).indexOf(I)>=0?I:U.UNKNOWN}(N.status);l(new Z(j,N.message))}else l(new Z(U.UNKNOWN,"Server responded with status "+u.getStatus()))}else l(new Z(U.UNAVAILABLE,"Connection failed."));break;default:ce()}}finally{re(jt,`RPC '${e}' ${s} completed.`)}});const h=JSON.stringify(i);re(jt,`RPC '${e}' ${s} sending request:`,i),u.send(n,"POST",h,r,15)})}Bo(e,n,r){const i=nf(),s=[this.Do,"/","google.firestore.v1.Firestore","/",e,"/channel"],o=Fx(),l=Vx(),u={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},h=this.longPollingOptions.timeoutSeconds;h!==void 0&&(u.longPollingTimeout=Math.round(1e3*h)),this.useFetchStreams&&(u.useFetchStreams=!0),this.Oo(u.initMessageHeaders,n,r),u.encodeInitMessageHeaders=!0;const m=s.join("");re(jt,`Creating RPC '${e}' stream ${i}: ${m}`,u);const v=o.createWebChannel(m,u);let g=!1,N=!1;const j=new e2({Io:B=>{N?re(jt,`Not sending because RPC '${e}' stream ${i} is closed:`,B):(g||(re(jt,`Opening RPC '${e}' stream ${i} transport.`),v.open(),g=!0),re(jt,`RPC '${e}' stream ${i} sending:`,B),v.send(B))},To:()=>v.close()}),L=(B,I,k)=>{B.listen(I,C=>{try{k(C)}catch(V){setTimeout(()=>{throw V},0)}})};return L(v,tl.EventType.OPEN,()=>{N||(re(jt,`RPC '${e}' stream ${i} transport opened.`),j.yo())}),L(v,tl.EventType.CLOSE,()=>{N||(N=!0,re(jt,`RPC '${e}' stream ${i} transport closed`),j.So())}),L(v,tl.EventType.ERROR,B=>{N||(N=!0,Ko(jt,`RPC '${e}' stream ${i} transport errored:`,B),j.So(new Z(U.UNAVAILABLE,"The operation could not be completed")))}),L(v,tl.EventType.MESSAGE,B=>{var I;if(!N){const k=B.data[0];Se(!!k);const C=k,V=C.error||((I=C[0])===null||I===void 0?void 0:I.error);if(V){re(jt,`RPC '${e}' stream ${i} received error:`,V);const G=V.status;let H=function(E){const S=rt[E];if(S!==void 0)return uE(S)}(G),T=V.message;H===void 0&&(H=U.INTERNAL,T="Unknown error status: "+G+" with message "+V.message),N=!0,j.So(new Z(H,T)),v.close()}else re(jt,`RPC '${e}' stream ${i} received:`,k),j.bo(k)}}),L(l,Mx.STAT_EVENT,B=>{B.stat===pp.PROXY?re(jt,`RPC '${e}' stream ${i} detected buffering proxy`):B.stat===pp.NOPROXY&&re(jt,`RPC '${e}' stream ${i} detected no buffering proxy`)}),setTimeout(()=>{j.wo()},0),j}}function rf(){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 Yd(t){return new dN(t,!0)}/**
|
|
* @license
|
|
* Copyright 2017 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class EE{constructor(e,n,r=1e3,i=1.5,s=6e4){this.ui=e,this.timerId=n,this.ko=r,this.qo=i,this.Qo=s,this.Ko=0,this.$o=null,this.Uo=Date.now(),this.reset()}reset(){this.Ko=0}Wo(){this.Ko=this.Qo}Go(e){this.cancel();const n=Math.floor(this.Ko+this.zo()),r=Math.max(0,Date.now()-this.Uo),i=Math.max(0,n-r);i>0&&re("ExponentialBackoff",`Backing off for ${i} ms (base delay: ${this.Ko} ms, delay with jitter: ${n} ms, last attempt: ${r} ms ago)`),this.$o=this.ui.enqueueAfterDelay(this.timerId,i,()=>(this.Uo=Date.now(),e())),this.Ko*=this.qo,this.Ko<this.ko&&(this.Ko=this.ko),this.Ko>this.Qo&&(this.Ko=this.Qo)}jo(){this.$o!==null&&(this.$o.skipDelay(),this.$o=null)}cancel(){this.$o!==null&&(this.$o.cancel(),this.$o=null)}zo(){return(Math.random()-.5)*this.Ko}}/**
|
|
* @license
|
|
* Copyright 2017 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT 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,n,r,i,s,o,l,u){this.ui=e,this.Ho=r,this.Jo=i,this.connection=s,this.authCredentialsProvider=o,this.appCheckCredentialsProvider=l,this.listener=u,this.state=0,this.Yo=0,this.Zo=null,this.Xo=null,this.stream=null,this.e_=0,this.t_=new EE(e,n)}n_(){return this.state===1||this.state===5||this.r_()}r_(){return this.state===2||this.state===3}start(){this.e_=0,this.state!==4?this.auth():this.i_()}async stop(){this.n_()&&await this.close(0)}s_(){this.state=0,this.t_.reset()}o_(){this.r_()&&this.Zo===null&&(this.Zo=this.ui.enqueueAfterDelay(this.Ho,6e4,()=>this.__()))}a_(e){this.u_(),this.stream.send(e)}async __(){if(this.r_())return this.close(0)}u_(){this.Zo&&(this.Zo.cancel(),this.Zo=null)}c_(){this.Xo&&(this.Xo.cancel(),this.Xo=null)}async close(e,n){this.u_(),this.c_(),this.t_.cancel(),this.Yo++,e!==4?this.t_.reset():n&&n.code===U.RESOURCE_EXHAUSTED?(Kr(n.toString()),Kr("Using maximum backoff delay to prevent overloading the backend."),this.t_.Wo()):n&&n.code===U.UNAUTHENTICATED&&this.state!==3&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),this.stream!==null&&(this.l_(),this.stream.close(),this.stream=null),this.state=e,await this.listener.mo(n)}l_(){}auth(){this.state=1;const e=this.h_(this.Yo),n=this.Yo;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then(([r,i])=>{this.Yo===n&&this.P_(r,i)},r=>{e(()=>{const i=new Z(U.UNKNOWN,"Fetching auth token failed: "+r.message);return this.I_(i)})})}P_(e,n){const r=this.h_(this.Yo);this.stream=this.T_(e,n),this.stream.Eo(()=>{r(()=>this.listener.Eo())}),this.stream.Ro(()=>{r(()=>(this.state=2,this.Xo=this.ui.enqueueAfterDelay(this.Jo,1e4,()=>(this.r_()&&(this.state=3),Promise.resolve())),this.listener.Ro()))}),this.stream.mo(i=>{r(()=>this.I_(i))}),this.stream.onMessage(i=>{r(()=>++this.e_==1?this.E_(i):this.onNext(i))})}i_(){this.state=5,this.t_.Go(async()=>{this.state=0,this.start()})}I_(e){return re("PersistentStream",`close with error: ${e}`),this.stream=null,this.close(4,e)}h_(e){return n=>{this.ui.enqueueAndForget(()=>this.Yo===e?n():(re("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve()))}}}class n2 extends kE{constructor(e,n,r,i,s,o){super(e,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",n,r,i,o),this.serializer=s}T_(e,n){return this.connection.Bo("Listen",e,n)}E_(e){return this.onNext(e)}onNext(e){this.t_.reset();const n=pN(this.serializer,e),r=function(s){if(!("targetChange"in s))return de.min();const o=s.targetChange;return o.targetIds&&o.targetIds.length?de.min():o.readTime?cr(o.readTime):de.min()}(e);return this.listener.d_(n,r)}A_(e){const n={};n.database=Tp(this.serializer),n.addTarget=function(s,o){let l;const u=o.target;if(l=vp(u)?{documents:yN(s,u)}:{query:vN(s,u)._t},l.targetId=o.targetId,o.resumeToken.approximateByteSize()>0){l.resumeToken=fE(s,o.resumeToken);const h=xp(s,o.expectedCount);h!==null&&(l.expectedCount=h)}else if(o.snapshotVersion.compareTo(de.min())>0){l.readTime=md(s,o.snapshotVersion.toTimestamp());const h=xp(s,o.expectedCount);h!==null&&(l.expectedCount=h)}return l}(this.serializer,e);const r=_N(this.serializer,e);r&&(n.labels=r),this.a_(n)}R_(e){const n={};n.database=Tp(this.serializer),n.removeTarget=e,this.a_(n)}}class r2 extends kE{constructor(e,n,r,i,s,o){super(e,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",n,r,i,o),this.serializer=s}get V_(){return this.e_>0}start(){this.lastStreamToken=void 0,super.start()}l_(){this.V_&&this.m_([])}T_(e,n){return this.connection.Bo("Write",e,n)}E_(e){return Se(!!e.streamToken),this.lastStreamToken=e.streamToken,Se(!e.writeResults||e.writeResults.length===0),this.listener.f_()}onNext(e){Se(!!e.streamToken),this.lastStreamToken=e.streamToken,this.t_.reset();const n=gN(e.writeResults,e.commitTime),r=cr(e.commitTime);return this.listener.g_(r,n)}p_(){const e={};e.database=Tp(this.serializer),this.a_(e)}m_(e){const n={streamToken:this.lastStreamToken,writes:e.map(r=>mN(this.serializer,r))};this.a_(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 i2 extends class{}{constructor(e,n,r,i){super(),this.authCredentials=e,this.appCheckCredentials=n,this.connection=r,this.serializer=i,this.y_=!1}w_(){if(this.y_)throw new Z(U.FAILED_PRECONDITION,"The client has already been terminated.")}Mo(e,n,r,i){return this.w_(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([s,o])=>this.connection.Mo(e,Ep(n,r),i,s,o)).catch(s=>{throw s.name==="FirebaseError"?(s.code===U.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),s):new Z(U.UNKNOWN,s.toString())})}Lo(e,n,r,i,s){return this.w_(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([o,l])=>this.connection.Lo(e,Ep(n,r),i,o,l,s)).catch(o=>{throw o.name==="FirebaseError"?(o.code===U.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),o):new Z(U.UNKNOWN,o.toString())})}terminate(){this.y_=!0,this.connection.terminate()}}class s2{constructor(e,n){this.asyncQueue=e,this.onlineStateHandler=n,this.state="Unknown",this.S_=0,this.b_=null,this.D_=!0}v_(){this.S_===0&&(this.C_("Unknown"),this.b_=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,()=>(this.b_=null,this.F_("Backend didn't respond within 10 seconds."),this.C_("Offline"),Promise.resolve())))}M_(e){this.state==="Online"?this.C_("Unknown"):(this.S_++,this.S_>=1&&(this.x_(),this.F_(`Connection failed 1 times. Most recent error: ${e.toString()}`),this.C_("Offline")))}set(e){this.x_(),this.S_=0,e==="Online"&&(this.D_=!1),this.C_(e)}C_(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))}F_(e){const n=`Could not reach Cloud Firestore backend. ${e}
|
|
This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.`;this.D_?(Kr(n),this.D_=!1):re("OnlineStateTracker",n)}x_(){this.b_!==null&&(this.b_.cancel(),this.b_=null)}}/**
|
|
* @license
|
|
* Copyright 2017 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class o2{constructor(e,n,r,i,s){this.localStore=e,this.datastore=n,this.asyncQueue=r,this.remoteSyncer={},this.O_=[],this.N_=new Map,this.L_=new Set,this.B_=[],this.k_=s,this.k_._o(o=>{r.enqueueAndForget(async()=>{js(this)&&(re("RemoteStore","Restarting streams for network reachability change."),await async function(u){const h=he(u);h.L_.add(4),await lc(h),h.q_.set("Unknown"),h.L_.delete(4),await Jd(h)}(this))})}),this.q_=new s2(r,i)}}async function Jd(t){if(js(t))for(const e of t.B_)await e(!0)}async function lc(t){for(const e of t.B_)await e(!1)}function TE(t,e){const n=he(t);n.N_.has(e.targetId)||(n.N_.set(e.targetId,e),eg(n)?Zm(n):la(n).r_()&&Xm(n,e))}function Jm(t,e){const n=he(t),r=la(n);n.N_.delete(e),r.r_()&&bE(n,e),n.N_.size===0&&(r.r_()?r.o_():js(n)&&n.q_.set("Unknown"))}function Xm(t,e){if(t.Q_.xe(e.targetId),e.resumeToken.approximateByteSize()>0||e.snapshotVersion.compareTo(de.min())>0){const n=t.remoteSyncer.getRemoteKeysForTarget(e.targetId).size;e=e.withExpectedCount(n)}la(t).A_(e)}function bE(t,e){t.Q_.xe(e),la(t).R_(e)}function Zm(t){t.Q_=new aN({getRemoteKeysForTarget:e=>t.remoteSyncer.getRemoteKeysForTarget(e),ot:e=>t.N_.get(e)||null,tt:()=>t.datastore.serializer.databaseId}),la(t).start(),t.q_.v_()}function eg(t){return js(t)&&!la(t).n_()&&t.N_.size>0}function js(t){return he(t).L_.size===0}function SE(t){t.Q_=void 0}async function a2(t){t.q_.set("Online")}async function l2(t){t.N_.forEach((e,n)=>{Xm(t,e)})}async function c2(t,e){SE(t),eg(t)?(t.q_.M_(e),Zm(t)):t.q_.set("Unknown")}async function u2(t,e,n){if(t.q_.set("Online"),e instanceof hE&&e.state===2&&e.cause)try{await async function(i,s){const o=s.cause;for(const l of s.targetIds)i.N_.has(l)&&(await i.remoteSyncer.rejectListen(l,o),i.N_.delete(l),i.Q_.removeTarget(l))}(t,e)}catch(r){re("RemoteStore","Failed to remove targets %s: %s ",e.targetIds.join(","),r),await gd(t,r)}else if(e instanceof Au?t.Q_.Ke(e):e instanceof dE?t.Q_.He(e):t.Q_.We(e),!n.isEqual(de.min()))try{const r=await xE(t.localStore);n.compareTo(r)>=0&&await function(s,o){const l=s.Q_.rt(o);return l.targetChanges.forEach((u,h)=>{if(u.resumeToken.approximateByteSize()>0){const m=s.N_.get(h);m&&s.N_.set(h,m.withResumeToken(u.resumeToken,o))}}),l.targetMismatches.forEach((u,h)=>{const m=s.N_.get(u);if(!m)return;s.N_.set(u,m.withResumeToken(Ct.EMPTY_BYTE_STRING,m.snapshotVersion)),bE(s,u);const v=new xi(m.target,u,h,m.sequenceNumber);Xm(s,v)}),s.remoteSyncer.applyRemoteEvent(l)}(t,n)}catch(r){re("RemoteStore","Failed to raise snapshot:",r),await gd(t,r)}}async function gd(t,e,n){if(!ic(e))throw e;t.L_.add(1),await lc(t),t.q_.set("Offline"),n||(n=()=>xE(t.localStore)),t.asyncQueue.enqueueRetryable(async()=>{re("RemoteStore","Retrying IndexedDB access"),await n(),t.L_.delete(1),await Jd(t)})}function IE(t,e){return e().catch(n=>gd(t,n,e))}async function Xd(t){const e=he(t),n=Li(e);let r=e.O_.length>0?e.O_[e.O_.length-1].batchId:-1;for(;d2(e);)try{const i=await GN(e.localStore,r);if(i===null){e.O_.length===0&&n.o_();break}r=i.batchId,h2(e,i)}catch(i){await gd(e,i)}CE(e)&&AE(e)}function d2(t){return js(t)&&t.O_.length<10}function h2(t,e){t.O_.push(e);const n=Li(t);n.r_()&&n.V_&&n.m_(e.mutations)}function CE(t){return js(t)&&!Li(t).n_()&&t.O_.length>0}function AE(t){Li(t).start()}async function f2(t){Li(t).p_()}async function p2(t){const e=Li(t);for(const n of t.O_)e.m_(n.mutations)}async function m2(t,e,n){const r=t.O_.shift(),i=Wm.from(r,e,n);await IE(t,()=>t.remoteSyncer.applySuccessfulWrite(i)),await Xd(t)}async function g2(t,e){e&&Li(t).V_&&await async function(r,i){if(function(o){return iN(o)&&o!==U.ABORTED}(i.code)){const s=r.O_.shift();Li(r).s_(),await IE(r,()=>r.remoteSyncer.rejectFailedWrite(s.batchId,i)),await Xd(r)}}(t,e),CE(t)&&AE(t)}async function n0(t,e){const n=he(t);n.asyncQueue.verifyOperationInProgress(),re("RemoteStore","RemoteStore received new credentials");const r=js(n);n.L_.add(3),await lc(n),r&&n.q_.set("Unknown"),await n.remoteSyncer.handleCredentialChange(e),n.L_.delete(3),await Jd(n)}async function y2(t,e){const n=he(t);e?(n.L_.delete(2),await Jd(n)):e||(n.L_.add(2),await lc(n),n.q_.set("Unknown"))}function la(t){return t.K_||(t.K_=function(n,r,i){const s=he(n);return s.w_(),new n2(r,s.connection,s.authCredentials,s.appCheckCredentials,s.serializer,i)}(t.datastore,t.asyncQueue,{Eo:a2.bind(null,t),Ro:l2.bind(null,t),mo:c2.bind(null,t),d_:u2.bind(null,t)}),t.B_.push(async e=>{e?(t.K_.s_(),eg(t)?Zm(t):t.q_.set("Unknown")):(await t.K_.stop(),SE(t))})),t.K_}function Li(t){return t.U_||(t.U_=function(n,r,i){const s=he(n);return s.w_(),new r2(r,s.connection,s.authCredentials,s.appCheckCredentials,s.serializer,i)}(t.datastore,t.asyncQueue,{Eo:()=>Promise.resolve(),Ro:f2.bind(null,t),mo:g2.bind(null,t),f_:p2.bind(null,t),g_:m2.bind(null,t)}),t.B_.push(async e=>{e?(t.U_.s_(),await Xd(t)):(await t.U_.stop(),t.O_.length>0&&(re("RemoteStore",`Stopping write stream with ${t.O_.length} pending writes`),t.O_=[]))})),t.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.
|
|
*/class tg{constructor(e,n,r,i,s){this.asyncQueue=e,this.timerId=n,this.targetTimeMs=r,this.op=i,this.removalCallback=s,this.deferred=new Ur,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(o=>{})}get promise(){return this.deferred.promise}static createAndSchedule(e,n,r,i,s){const o=Date.now()+r,l=new tg(e,n,o,i,s);return l.start(r),l}start(e){this.timerHandle=setTimeout(()=>this.handleDelayElapsed(),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){this.timerHandle!==null&&(this.clearTimeout(),this.deferred.reject(new Z(U.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 ng(t,e){if(Kr("AsyncQueue",`${e}: ${t}`),ic(t))return new Z(U.UNAVAILABLE,`${e}: ${t}`);throw t}/**
|
|
* @license
|
|
* Copyright 2017 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class Fo{constructor(e){this.comparator=e?(n,r)=>e(n,r)||ie.comparator(n.key,r.key):(n,r)=>ie.comparator(n.key,r.key),this.keyedMap=nl(),this.sortedSet=new We(this.comparator)}static emptySet(e){return new Fo(e.comparator)}has(e){return this.keyedMap.get(e)!=null}get(e){return this.keyedMap.get(e)}first(){return this.sortedSet.minKey()}last(){return this.sortedSet.maxKey()}isEmpty(){return this.sortedSet.isEmpty()}indexOf(e){const n=this.keyedMap.get(e);return n?this.sortedSet.indexOf(n):-1}get size(){return this.sortedSet.size}forEach(e){this.sortedSet.inorderTraversal((n,r)=>(e(n),!1))}add(e){const n=this.delete(e.key);return n.copy(n.keyedMap.insert(e.key,e),n.sortedSet.insert(e,null))}delete(e){const n=this.get(e);return n?this.copy(this.keyedMap.remove(e),this.sortedSet.remove(n)):this}isEqual(e){if(!(e instanceof Fo)||this.size!==e.size)return!1;const n=this.sortedSet.getIterator(),r=e.sortedSet.getIterator();for(;n.hasNext();){const i=n.getNext().key,s=r.getNext().key;if(!i.isEqual(s))return!1}return!0}toString(){const e=[];return this.forEach(n=>{e.push(n.toString())}),e.length===0?"DocumentSet ()":`DocumentSet (
|
|
`+e.join(`
|
|
`)+`
|
|
)`}copy(e,n){const r=new Fo;return r.comparator=this.comparator,r.keyedMap=e,r.sortedSet=n,r}}/**
|
|
* @license
|
|
* Copyright 2017 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class r0{constructor(){this.W_=new We(ie.comparator)}track(e){const n=e.doc.key,r=this.W_.get(n);r?e.type!==0&&r.type===3?this.W_=this.W_.insert(n,e):e.type===3&&r.type!==1?this.W_=this.W_.insert(n,{type:r.type,doc:e.doc}):e.type===2&&r.type===2?this.W_=this.W_.insert(n,{type:2,doc:e.doc}):e.type===2&&r.type===0?this.W_=this.W_.insert(n,{type:0,doc:e.doc}):e.type===1&&r.type===0?this.W_=this.W_.remove(n):e.type===1&&r.type===2?this.W_=this.W_.insert(n,{type:1,doc:r.doc}):e.type===0&&r.type===1?this.W_=this.W_.insert(n,{type:2,doc:e.doc}):ce():this.W_=this.W_.insert(n,e)}G_(){const e=[];return this.W_.inorderTraversal((n,r)=>{e.push(r)}),e}}class Xo{constructor(e,n,r,i,s,o,l,u,h){this.query=e,this.docs=n,this.oldDocs=r,this.docChanges=i,this.mutatedKeys=s,this.fromCache=o,this.syncStateChanged=l,this.excludesMetadataChanges=u,this.hasCachedResults=h}static fromInitialDocuments(e,n,r,i,s){const o=[];return n.forEach(l=>{o.push({type:0,doc:l})}),new Xo(e,n,Fo.emptySet(n),o,r,i,!0,!1,s)}get hasPendingWrites(){return!this.mutatedKeys.isEmpty()}isEqual(e){if(!(this.fromCache===e.fromCache&&this.hasCachedResults===e.hasCachedResults&&this.syncStateChanged===e.syncStateChanged&&this.mutatedKeys.isEqual(e.mutatedKeys)&&qd(this.query,e.query)&&this.docs.isEqual(e.docs)&&this.oldDocs.isEqual(e.oldDocs)))return!1;const n=this.docChanges,r=e.docChanges;if(n.length!==r.length)return!1;for(let i=0;i<n.length;i++)if(n[i].type!==r[i].type||!n[i].doc.isEqual(r[i].doc))return!1;return!0}}/**
|
|
* @license
|
|
* Copyright 2017 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class v2{constructor(){this.z_=void 0,this.j_=[]}H_(){return this.j_.some(e=>e.J_())}}class w2{constructor(){this.queries=i0(),this.onlineState="Unknown",this.Y_=new Set}terminate(){(function(n,r){const i=he(n),s=i.queries;i.queries=i0(),s.forEach((o,l)=>{for(const u of l.j_)u.onError(r)})})(this,new Z(U.ABORTED,"Firestore shutting down"))}}function i0(){return new aa(t=>Xx(t),qd)}async function rg(t,e){const n=he(t);let r=3;const i=e.query;let s=n.queries.get(i);s?!s.H_()&&e.J_()&&(r=2):(s=new v2,r=e.J_()?0:1);try{switch(r){case 0:s.z_=await n.onListen(i,!0);break;case 1:s.z_=await n.onListen(i,!1);break;case 2:await n.onFirstRemoteStoreListen(i)}}catch(o){const l=ng(o,`Initialization of query '${po(e.query)}' failed`);return void e.onError(l)}n.queries.set(i,s),s.j_.push(e),e.Z_(n.onlineState),s.z_&&e.X_(s.z_)&&sg(n)}async function ig(t,e){const n=he(t),r=e.query;let i=3;const s=n.queries.get(r);if(s){const o=s.j_.indexOf(e);o>=0&&(s.j_.splice(o,1),s.j_.length===0?i=e.J_()?0:1:!s.H_()&&e.J_()&&(i=2))}switch(i){case 0:return n.queries.delete(r),n.onUnlisten(r,!0);case 1:return n.queries.delete(r),n.onUnlisten(r,!1);case 2:return n.onLastRemoteStoreUnlisten(r);default:return}}function _2(t,e){const n=he(t);let r=!1;for(const i of e){const s=i.query,o=n.queries.get(s);if(o){for(const l of o.j_)l.X_(i)&&(r=!0);o.z_=i}}r&&sg(n)}function x2(t,e,n){const r=he(t),i=r.queries.get(e);if(i)for(const s of i.j_)s.onError(n);r.queries.delete(e)}function sg(t){t.Y_.forEach(e=>{e.next()})}var Sp,s0;(s0=Sp||(Sp={})).ea="default",s0.Cache="cache";class og{constructor(e,n,r){this.query=e,this.ta=n,this.na=!1,this.ra=null,this.onlineState="Unknown",this.options=r||{}}X_(e){if(!this.options.includeMetadataChanges){const r=[];for(const i of e.docChanges)i.type!==3&&r.push(i);e=new Xo(e.query,e.docs,e.oldDocs,r,e.mutatedKeys,e.fromCache,e.syncStateChanged,!0,e.hasCachedResults)}let n=!1;return this.na?this.ia(e)&&(this.ta.next(e),n=!0):this.sa(e,this.onlineState)&&(this.oa(e),n=!0),this.ra=e,n}onError(e){this.ta.error(e)}Z_(e){this.onlineState=e;let n=!1;return this.ra&&!this.na&&this.sa(this.ra,e)&&(this.oa(this.ra),n=!0),n}sa(e,n){if(!e.fromCache||!this.J_())return!0;const r=n!=="Offline";return(!this.options._a||!r)&&(!e.docs.isEmpty()||e.hasCachedResults||n==="Offline")}ia(e){if(e.docChanges.length>0)return!0;const n=this.ra&&this.ra.hasPendingWrites!==e.hasPendingWrites;return!(!e.syncStateChanged&&!n)&&this.options.includeMetadataChanges===!0}oa(e){e=Xo.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache,e.hasCachedResults),this.na=!0,this.ta.next(e)}J_(){return this.options.source!==Sp.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 NE{constructor(e){this.key=e}}class PE{constructor(e){this.key=e}}class E2{constructor(e,n){this.query=e,this.Ta=n,this.Ea=null,this.hasCachedResults=!1,this.current=!1,this.da=me(),this.mutatedKeys=me(),this.Aa=Zx(e),this.Ra=new Fo(this.Aa)}get Va(){return this.Ta}ma(e,n){const r=n?n.fa:new r0,i=n?n.Ra:this.Ra;let s=n?n.mutatedKeys:this.mutatedKeys,o=i,l=!1;const u=this.query.limitType==="F"&&i.size===this.query.limit?i.last():null,h=this.query.limitType==="L"&&i.size===this.query.limit?i.first():null;if(e.inorderTraversal((m,v)=>{const g=i.get(m),N=Wd(this.query,v)?v:null,j=!!g&&this.mutatedKeys.has(g.key),L=!!N&&(N.hasLocalMutations||this.mutatedKeys.has(N.key)&&N.hasCommittedMutations);let B=!1;g&&N?g.data.isEqual(N.data)?j!==L&&(r.track({type:3,doc:N}),B=!0):this.ga(g,N)||(r.track({type:2,doc:N}),B=!0,(u&&this.Aa(N,u)>0||h&&this.Aa(N,h)<0)&&(l=!0)):!g&&N?(r.track({type:0,doc:N}),B=!0):g&&!N&&(r.track({type:1,doc:g}),B=!0,(u||h)&&(l=!0)),B&&(N?(o=o.add(N),s=L?s.add(m):s.delete(m)):(o=o.delete(m),s=s.delete(m)))}),this.query.limit!==null)for(;o.size>this.query.limit;){const m=this.query.limitType==="F"?o.last():o.first();o=o.delete(m.key),s=s.delete(m.key),r.track({type:1,doc:m})}return{Ra:o,fa:r,ns:l,mutatedKeys:s}}ga(e,n){return e.hasLocalMutations&&n.hasCommittedMutations&&!n.hasLocalMutations}applyChanges(e,n,r,i){const s=this.Ra;this.Ra=e.Ra,this.mutatedKeys=e.mutatedKeys;const o=e.fa.G_();o.sort((m,v)=>function(N,j){const L=B=>{switch(B){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return ce()}};return L(N)-L(j)}(m.type,v.type)||this.Aa(m.doc,v.doc)),this.pa(r),i=i!=null&&i;const l=n&&!i?this.ya():[],u=this.da.size===0&&this.current&&!i?1:0,h=u!==this.Ea;return this.Ea=u,o.length!==0||h?{snapshot:new Xo(this.query,e.Ra,s,o,e.mutatedKeys,u===0,h,!1,!!r&&r.resumeToken.approximateByteSize()>0),wa:l}:{wa:l}}Z_(e){return this.current&&e==="Offline"?(this.current=!1,this.applyChanges({Ra:this.Ra,fa:new r0,mutatedKeys:this.mutatedKeys,ns:!1},!1)):{wa:[]}}Sa(e){return!this.Ta.has(e)&&!!this.Ra.has(e)&&!this.Ra.get(e).hasLocalMutations}pa(e){e&&(e.addedDocuments.forEach(n=>this.Ta=this.Ta.add(n)),e.modifiedDocuments.forEach(n=>{}),e.removedDocuments.forEach(n=>this.Ta=this.Ta.delete(n)),this.current=e.current)}ya(){if(!this.current)return[];const e=this.da;this.da=me(),this.Ra.forEach(r=>{this.Sa(r.key)&&(this.da=this.da.add(r.key))});const n=[];return e.forEach(r=>{this.da.has(r)||n.push(new PE(r))}),this.da.forEach(r=>{e.has(r)||n.push(new NE(r))}),n}ba(e){this.Ta=e.Ts,this.da=me();const n=this.ma(e.documents);return this.applyChanges(n,!0)}Da(){return Xo.fromInitialDocuments(this.query,this.Ra,this.mutatedKeys,this.Ea===0,this.hasCachedResults)}}class k2{constructor(e,n,r){this.query=e,this.targetId=n,this.view=r}}class T2{constructor(e){this.key=e,this.va=!1}}class b2{constructor(e,n,r,i,s,o){this.localStore=e,this.remoteStore=n,this.eventManager=r,this.sharedClientState=i,this.currentUser=s,this.maxConcurrentLimboResolutions=o,this.Ca={},this.Fa=new aa(l=>Xx(l),qd),this.Ma=new Map,this.xa=new Set,this.Oa=new We(ie.comparator),this.Na=new Map,this.La=new Gm,this.Ba={},this.ka=new Map,this.qa=Jo.kn(),this.onlineState="Unknown",this.Qa=void 0}get isPrimaryClient(){return this.Qa===!0}}async function S2(t,e,n=!0){const r=ME(t);let i;const s=r.Fa.get(e);return s?(r.sharedClientState.addLocalQueryTarget(s.targetId),i=s.view.Da()):i=await RE(r,e,n,!0),i}async function I2(t,e){const n=ME(t);await RE(n,e,!0,!1)}async function RE(t,e,n,r){const i=await QN(t.localStore,lr(e)),s=i.targetId,o=t.sharedClientState.addLocalQueryTarget(s,n);let l;return r&&(l=await C2(t,e,s,o==="current",i.resumeToken)),t.isPrimaryClient&&n&&TE(t.remoteStore,i),l}async function C2(t,e,n,r,i){t.Ka=(v,g,N)=>async function(L,B,I,k){let C=B.view.ma(I);C.ns&&(C=await Zv(L.localStore,B.query,!1).then(({documents:T})=>B.view.ma(T,C)));const V=k&&k.targetChanges.get(B.targetId),G=k&&k.targetMismatches.get(B.targetId)!=null,H=B.view.applyChanges(C,L.isPrimaryClient,V,G);return a0(L,B.targetId,H.wa),H.snapshot}(t,v,g,N);const s=await Zv(t.localStore,e,!0),o=new E2(e,s.Ts),l=o.ma(s.documents),u=ac.createSynthesizedTargetChangeForCurrentChange(n,r&&t.onlineState!=="Offline",i),h=o.applyChanges(l,t.isPrimaryClient,u);a0(t,n,h.wa);const m=new k2(e,n,o);return t.Fa.set(e,m),t.Ma.has(n)?t.Ma.get(n).push(e):t.Ma.set(n,[e]),h.snapshot}async function A2(t,e,n){const r=he(t),i=r.Fa.get(e),s=r.Ma.get(i.targetId);if(s.length>1)return r.Ma.set(i.targetId,s.filter(o=>!qd(o,e))),void r.Fa.delete(e);r.isPrimaryClient?(r.sharedClientState.removeLocalQueryTarget(i.targetId),r.sharedClientState.isActiveQueryTarget(i.targetId)||await bp(r.localStore,i.targetId,!1).then(()=>{r.sharedClientState.clearQueryState(i.targetId),n&&Jm(r.remoteStore,i.targetId),Ip(r,i.targetId)}).catch(rc)):(Ip(r,i.targetId),await bp(r.localStore,i.targetId,!0))}async function N2(t,e){const n=he(t),r=n.Fa.get(e),i=n.Ma.get(r.targetId);n.isPrimaryClient&&i.length===1&&(n.sharedClientState.removeLocalQueryTarget(r.targetId),Jm(n.remoteStore,r.targetId))}async function P2(t,e,n){const r=V2(t);try{const i=await function(o,l){const u=he(o),h=ht.now(),m=l.reduce((N,j)=>N.add(j.key),me());let v,g;return u.persistence.runTransaction("Locally write mutations","readwrite",N=>{let j=Gr(),L=me();return u.cs.getEntries(N,m).next(B=>{j=B,j.forEach((I,k)=>{k.isValidDocument()||(L=L.add(I))})}).next(()=>u.localDocuments.getOverlayedDocuments(N,j)).next(B=>{v=B;const I=[];for(const k of l){const C=ZA(k,v.get(k.key).overlayedDocument);C!=null&&I.push(new zi(k.key,C,qx(C.value.mapValue),qt.exists(!0)))}return u.mutationQueue.addMutationBatch(N,h,I,l)}).next(B=>{g=B;const I=B.applyToLocalDocumentSet(v,L);return u.documentOverlayCache.saveOverlays(N,B.batchId,I)})}).then(()=>({batchId:g.batchId,changes:tE(v)}))}(r.localStore,e);r.sharedClientState.addPendingMutation(i.batchId),function(o,l,u){let h=o.Ba[o.currentUser.toKey()];h||(h=new We(xe)),h=h.insert(l,u),o.Ba[o.currentUser.toKey()]=h}(r,i.batchId,n),await cc(r,i.changes),await Xd(r.remoteStore)}catch(i){const s=ng(i,"Failed to persist write");n.reject(s)}}async function DE(t,e){const n=he(t);try{const r=await HN(n.localStore,e);e.targetChanges.forEach((i,s)=>{const o=n.Na.get(s);o&&(Se(i.addedDocuments.size+i.modifiedDocuments.size+i.removedDocuments.size<=1),i.addedDocuments.size>0?o.va=!0:i.modifiedDocuments.size>0?Se(o.va):i.removedDocuments.size>0&&(Se(o.va),o.va=!1))}),await cc(n,r,e)}catch(r){await rc(r)}}function o0(t,e,n){const r=he(t);if(r.isPrimaryClient&&n===0||!r.isPrimaryClient&&n===1){const i=[];r.Fa.forEach((s,o)=>{const l=o.view.Z_(e);l.snapshot&&i.push(l.snapshot)}),function(o,l){const u=he(o);u.onlineState=l;let h=!1;u.queries.forEach((m,v)=>{for(const g of v.j_)g.Z_(l)&&(h=!0)}),h&&sg(u)}(r.eventManager,e),i.length&&r.Ca.d_(i),r.onlineState=e,r.isPrimaryClient&&r.sharedClientState.setOnlineState(e)}}async function R2(t,e,n){const r=he(t);r.sharedClientState.updateQueryState(e,"rejected",n);const i=r.Na.get(e),s=i&&i.key;if(s){let o=new We(ie.comparator);o=o.insert(s,Mt.newNoDocument(s,de.min()));const l=me().add(s),u=new Qd(de.min(),new Map,new We(xe),o,l);await DE(r,u),r.Oa=r.Oa.remove(s),r.Na.delete(e),ag(r)}else await bp(r.localStore,e,!1).then(()=>Ip(r,e,n)).catch(rc)}async function D2(t,e){const n=he(t),r=e.batch.batchId;try{const i=await WN(n.localStore,e);OE(n,r,null),jE(n,r),n.sharedClientState.updateMutationState(r,"acknowledged"),await cc(n,i)}catch(i){await rc(i)}}async function j2(t,e,n){const r=he(t);try{const i=await function(o,l){const u=he(o);return u.persistence.runTransaction("Reject batch","readwrite-primary",h=>{let m;return u.mutationQueue.lookupMutationBatch(h,l).next(v=>(Se(v!==null),m=v.keys(),u.mutationQueue.removeMutationBatch(h,v))).next(()=>u.mutationQueue.performConsistencyCheck(h)).next(()=>u.documentOverlayCache.removeOverlaysForBatchId(h,m,l)).next(()=>u.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(h,m)).next(()=>u.localDocuments.getDocuments(h,m))})}(r.localStore,e);OE(r,e,n),jE(r,e),r.sharedClientState.updateMutationState(e,"rejected",n),await cc(r,i)}catch(i){await rc(i)}}function jE(t,e){(t.ka.get(e)||[]).forEach(n=>{n.resolve()}),t.ka.delete(e)}function OE(t,e,n){const r=he(t);let i=r.Ba[r.currentUser.toKey()];if(i){const s=i.get(e);s&&(n?s.reject(n):s.resolve(),i=i.remove(e)),r.Ba[r.currentUser.toKey()]=i}}function Ip(t,e,n=null){t.sharedClientState.removeLocalQueryTarget(e);for(const r of t.Ma.get(e))t.Fa.delete(r),n&&t.Ca.$a(r,n);t.Ma.delete(e),t.isPrimaryClient&&t.La.gr(e).forEach(r=>{t.La.containsKey(r)||LE(t,r)})}function LE(t,e){t.xa.delete(e.path.canonicalString());const n=t.Oa.get(e);n!==null&&(Jm(t.remoteStore,n),t.Oa=t.Oa.remove(e),t.Na.delete(n),ag(t))}function a0(t,e,n){for(const r of n)r instanceof NE?(t.La.addReference(r.key,e),O2(t,r)):r instanceof PE?(re("SyncEngine","Document no longer in limbo: "+r.key),t.La.removeReference(r.key,e),t.La.containsKey(r.key)||LE(t,r.key)):ce()}function O2(t,e){const n=e.key,r=n.path.canonicalString();t.Oa.get(n)||t.xa.has(r)||(re("SyncEngine","New document in limbo: "+n),t.xa.add(r),ag(t))}function ag(t){for(;t.xa.size>0&&t.Oa.size<t.maxConcurrentLimboResolutions;){const e=t.xa.values().next().value;t.xa.delete(e);const n=new ie(De.fromString(e)),r=t.qa.next();t.Na.set(r,new T2(n)),t.Oa=t.Oa.insert(n,r),TE(t.remoteStore,new xi(lr($d(n.path)),r,"TargetPurposeLimboResolution",Vm.oe))}}async function cc(t,e,n){const r=he(t),i=[],s=[],o=[];r.Fa.isEmpty()||(r.Fa.forEach((l,u)=>{o.push(r.Ka(u,e,n).then(h=>{var m;if((h||n)&&r.isPrimaryClient){const v=h?!h.fromCache:(m=n==null?void 0:n.targetChanges.get(u.targetId))===null||m===void 0?void 0:m.current;r.sharedClientState.updateQueryState(u.targetId,v?"current":"not-current")}if(h){i.push(h);const v=Ym.Wi(u.targetId,h);s.push(v)}}))}),await Promise.all(o),r.Ca.d_(i),await async function(u,h){const m=he(u);try{await m.persistence.runTransaction("notifyLocalViewChanges","readwrite",v=>$.forEach(h,g=>$.forEach(g.$i,N=>m.persistence.referenceDelegate.addReference(v,g.targetId,N)).next(()=>$.forEach(g.Ui,N=>m.persistence.referenceDelegate.removeReference(v,g.targetId,N)))))}catch(v){if(!ic(v))throw v;re("LocalStore","Failed to update sequence numbers: "+v)}for(const v of h){const g=v.targetId;if(!v.fromCache){const N=m.os.get(g),j=N.snapshotVersion,L=N.withLastLimboFreeSnapshotVersion(j);m.os=m.os.insert(g,L)}}}(r.localStore,s))}async function L2(t,e){const n=he(t);if(!n.currentUser.isEqual(e)){re("SyncEngine","User change. New user:",e.toKey());const r=await _E(n.localStore,e);n.currentUser=e,function(s,o){s.ka.forEach(l=>{l.forEach(u=>{u.reject(new Z(U.CANCELLED,o))})}),s.ka.clear()}(n,"'waitForPendingWrites' promise is rejected due to a user change."),n.sharedClientState.handleUserChange(e,r.removedBatchIds,r.addedBatchIds),await cc(n,r.hs)}}function M2(t,e){const n=he(t),r=n.Na.get(e);if(r&&r.va)return me().add(r.key);{let i=me();const s=n.Ma.get(e);if(!s)return i;for(const o of s){const l=n.Fa.get(o);i=i.unionWith(l.view.Va)}return i}}function ME(t){const e=he(t);return e.remoteStore.remoteSyncer.applyRemoteEvent=DE.bind(null,e),e.remoteStore.remoteSyncer.getRemoteKeysForTarget=M2.bind(null,e),e.remoteStore.remoteSyncer.rejectListen=R2.bind(null,e),e.Ca.d_=_2.bind(null,e.eventManager),e.Ca.$a=x2.bind(null,e.eventManager),e}function V2(t){const e=he(t);return e.remoteStore.remoteSyncer.applySuccessfulWrite=D2.bind(null,e),e.remoteStore.remoteSyncer.rejectFailedWrite=j2.bind(null,e),e}class yd{constructor(){this.kind="memory",this.synchronizeTabs=!1}async initialize(e){this.serializer=Yd(e.databaseInfo.databaseId),this.sharedClientState=this.Wa(e),this.persistence=this.Ga(e),await this.persistence.start(),this.localStore=this.za(e),this.gcScheduler=this.ja(e,this.localStore),this.indexBackfillerScheduler=this.Ha(e,this.localStore)}ja(e,n){return null}Ha(e,n){return null}za(e){return qN(this.persistence,new BN,e.initialUser,this.serializer)}Ga(e){return new FN(Qm.Zr,this.serializer)}Wa(e){return new JN}async terminate(){var e,n;(e=this.gcScheduler)===null||e===void 0||e.stop(),(n=this.indexBackfillerScheduler)===null||n===void 0||n.stop(),this.sharedClientState.shutdown(),await this.persistence.shutdown()}}yd.provider={build:()=>new yd};class Cp{async initialize(e,n){this.localStore||(this.localStore=e.localStore,this.sharedClientState=e.sharedClientState,this.datastore=this.createDatastore(n),this.remoteStore=this.createRemoteStore(n),this.eventManager=this.createEventManager(n),this.syncEngine=this.createSyncEngine(n,!e.synchronizeTabs),this.sharedClientState.onlineStateHandler=r=>o0(this.syncEngine,r,1),this.remoteStore.remoteSyncer.handleCredentialChange=L2.bind(null,this.syncEngine),await y2(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(e){return function(){return new w2}()}createDatastore(e){const n=Yd(e.databaseInfo.databaseId),r=function(s){return new t2(s)}(e.databaseInfo);return function(s,o,l,u){return new i2(s,o,l,u)}(e.authCredentials,e.appCheckCredentials,r,n)}createRemoteStore(e){return function(r,i,s,o,l){return new o2(r,i,s,o,l)}(this.localStore,this.datastore,e.asyncQueue,n=>o0(this.syncEngine,n,0),function(){return t0.D()?new t0:new XN}())}createSyncEngine(e,n){return function(i,s,o,l,u,h,m){const v=new b2(i,s,o,l,u,h);return m&&(v.Qa=!0),v}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,e.initialUser,e.maxConcurrentLimboResolutions,n)}async terminate(){var e,n;await async function(i){const s=he(i);re("RemoteStore","RemoteStore shutting down."),s.L_.add(5),await lc(s),s.k_.shutdown(),s.q_.set("Unknown")}(this.remoteStore),(e=this.datastore)===null||e===void 0||e.terminate(),(n=this.eventManager)===null||n===void 0||n.terminate()}}Cp.provider={build:()=>new Cp};/**
|
|
* @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 lg{constructor(e){this.observer=e,this.muted=!1}next(e){this.muted||this.observer.next&&this.Ya(this.observer.next,e)}error(e){this.muted||(this.observer.error?this.Ya(this.observer.error,e):Kr("Uncaught Error in snapshot listener:",e.toString()))}Za(){this.muted=!0}Ya(e,n){setTimeout(()=>{this.muted||e(n)},0)}}/**
|
|
* @license
|
|
* Copyright 2017 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class F2{constructor(e,n,r,i,s){this.authCredentials=e,this.appCheckCredentials=n,this.asyncQueue=r,this.databaseInfo=i,this.user=Ot.UNAUTHENTICATED,this.clientId=zx.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this._uninitializedComponentsProvider=s,this.authCredentials.start(r,async o=>{re("FirestoreClient","Received user=",o.uid),await this.authCredentialListener(o),this.user=o}),this.appCheckCredentials.start(r,o=>(re("FirestoreClient","Received new app check token=",o),this.appCheckCredentialListener(o,this.user)))}get configuration(){return{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,authCredentials:this.authCredentials,appCheckCredentials:this.appCheckCredentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(e){this.authCredentialListener=e}setAppCheckTokenChangeListener(e){this.appCheckCredentialListener=e}terminate(){this.asyncQueue.enterRestrictedMode();const e=new Ur;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted(async()=>{try{this._onlineComponents&&await this._onlineComponents.terminate(),this._offlineComponents&&await this._offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),e.resolve()}catch(n){const r=ng(n,"Failed to shutdown persistence");e.reject(r)}}),e.promise}}async function sf(t,e){t.asyncQueue.verifyOperationInProgress(),re("FirestoreClient","Initializing OfflineComponentProvider");const n=t.configuration;await e.initialize(n);let r=n.initialUser;t.setCredentialChangeListener(async i=>{r.isEqual(i)||(await _E(e.localStore,i),r=i)}),e.persistence.setDatabaseDeletedListener(()=>t.terminate()),t._offlineComponents=e}async function l0(t,e){t.asyncQueue.verifyOperationInProgress();const n=await U2(t);re("FirestoreClient","Initializing OnlineComponentProvider"),await e.initialize(n,t.configuration),t.setCredentialChangeListener(r=>n0(e.remoteStore,r)),t.setAppCheckTokenChangeListener((r,i)=>n0(e.remoteStore,i)),t._onlineComponents=e}async function U2(t){if(!t._offlineComponents)if(t._uninitializedComponentsProvider){re("FirestoreClient","Using user provided OfflineComponentProvider");try{await sf(t,t._uninitializedComponentsProvider._offline)}catch(e){const n=e;if(!function(i){return i.name==="FirebaseError"?i.code===U.FAILED_PRECONDITION||i.code===U.UNIMPLEMENTED:!(typeof DOMException<"u"&&i instanceof DOMException)||i.code===22||i.code===20||i.code===11}(n))throw n;Ko("Error using user provided cache. Falling back to memory cache: "+n),await sf(t,new yd)}}else re("FirestoreClient","Using default OfflineComponentProvider"),await sf(t,new yd);return t._offlineComponents}async function VE(t){return t._onlineComponents||(t._uninitializedComponentsProvider?(re("FirestoreClient","Using user provided OnlineComponentProvider"),await l0(t,t._uninitializedComponentsProvider._online)):(re("FirestoreClient","Using default OnlineComponentProvider"),await l0(t,new Cp))),t._onlineComponents}function z2(t){return VE(t).then(e=>e.syncEngine)}async function vd(t){const e=await VE(t),n=e.eventManager;return n.onListen=S2.bind(null,e.syncEngine),n.onUnlisten=A2.bind(null,e.syncEngine),n.onFirstRemoteStoreListen=I2.bind(null,e.syncEngine),n.onLastRemoteStoreUnlisten=N2.bind(null,e.syncEngine),n}function B2(t,e,n={}){const r=new Ur;return t.asyncQueue.enqueueAndForget(async()=>function(s,o,l,u,h){const m=new lg({next:g=>{m.Za(),o.enqueueAndForget(()=>ig(s,v));const N=g.docs.has(l);!N&&g.fromCache?h.reject(new Z(U.UNAVAILABLE,"Failed to get document because the client is offline.")):N&&g.fromCache&&u&&u.source==="server"?h.reject(new Z(U.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.)')):h.resolve(g)},error:g=>h.reject(g)}),v=new og($d(l.path),m,{includeMetadataChanges:!0,_a:!0});return rg(s,v)}(await vd(t),t.asyncQueue,e,n,r)),r.promise}function $2(t,e,n={}){const r=new Ur;return t.asyncQueue.enqueueAndForget(async()=>function(s,o,l,u,h){const m=new lg({next:g=>{m.Za(),o.enqueueAndForget(()=>ig(s,v)),g.fromCache&&u.source==="server"?h.reject(new Z(U.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.)')):h.resolve(g)},error:g=>h.reject(g)}),v=new og(l,m,{includeMetadataChanges:!0,_a:!0});return rg(s,v)}(await vd(t),t.asyncQueue,e,n,r)),r.promise}/**
|
|
* @license
|
|
* Copyright 2023 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/function FE(t){const e={};return t.timeoutSeconds!==void 0&&(e.timeoutSeconds=t.timeoutSeconds),e}/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/const c0=new Map;/**
|
|
* @license
|
|
* Copyright 2017 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/function UE(t,e,n){if(!n)throw new Z(U.INVALID_ARGUMENT,`Function ${t}() cannot be called with an empty ${e}.`)}function q2(t,e,n,r){if(e===!0&&r===!0)throw new Z(U.INVALID_ARGUMENT,`${t} and ${n} cannot be used together.`)}function u0(t){if(!ie.isDocumentKey(t))throw new Z(U.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${t} has ${t.length}.`)}function d0(t){if(ie.isDocumentKey(t))throw new Z(U.INVALID_ARGUMENT,`Invalid collection reference. Collection references must have an odd number of segments, but ${t} has ${t.length}.`)}function Zd(t){if(t===void 0)return"undefined";if(t===null)return"null";if(typeof t=="string")return t.length>20&&(t=`${t.substring(0,20)}...`),JSON.stringify(t);if(typeof t=="number"||typeof t=="boolean")return""+t;if(typeof t=="object"){if(t instanceof Array)return"an array";{const e=function(r){return r.constructor?r.constructor.name:null}(t);return e?`a custom ${e} object`:"an object"}}return typeof t=="function"?"a function":ce()}function Wt(t,e){if("_delegate"in t&&(t=t._delegate),!(t instanceof e)){if(e.name===t.constructor.name)throw new Z(U.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const n=Zd(t);throw new Z(U.INVALID_ARGUMENT,`Expected type '${e.name}', but it was: ${n}`)}}return t}/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class h0{constructor(e){var n,r;if(e.host===void 0){if(e.ssl!==void 0)throw new Z(U.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com",this.ssl=!0}else this.host=e.host,this.ssl=(n=e.ssl)===null||n===void 0||n;if(this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,this.localCache=e.localCache,e.cacheSizeBytes===void 0)this.cacheSizeBytes=41943040;else{if(e.cacheSizeBytes!==-1&&e.cacheSizeBytes<1048576)throw new Z(U.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}q2("experimentalForceLongPolling",e.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",e.experimentalAutoDetectLongPolling),this.experimentalForceLongPolling=!!e.experimentalForceLongPolling,this.experimentalForceLongPolling?this.experimentalAutoDetectLongPolling=!1:e.experimentalAutoDetectLongPolling===void 0?this.experimentalAutoDetectLongPolling=!0:this.experimentalAutoDetectLongPolling=!!e.experimentalAutoDetectLongPolling,this.experimentalLongPollingOptions=FE((r=e.experimentalLongPollingOptions)!==null&&r!==void 0?r:{}),function(s){if(s.timeoutSeconds!==void 0){if(isNaN(s.timeoutSeconds))throw new Z(U.INVALID_ARGUMENT,`invalid long polling timeout: ${s.timeoutSeconds} (must not be NaN)`);if(s.timeoutSeconds<5)throw new Z(U.INVALID_ARGUMENT,`invalid long polling timeout: ${s.timeoutSeconds} (minimum allowed value is 5)`);if(s.timeoutSeconds>30)throw new Z(U.INVALID_ARGUMENT,`invalid long polling timeout: ${s.timeoutSeconds} (maximum allowed value is 30)`)}}(this.experimentalLongPollingOptions),this.useFetchStreams=!!e.useFetchStreams}isEqual(e){return this.host===e.host&&this.ssl===e.ssl&&this.credentials===e.credentials&&this.cacheSizeBytes===e.cacheSizeBytes&&this.experimentalForceLongPolling===e.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===e.experimentalAutoDetectLongPolling&&function(r,i){return r.timeoutSeconds===i.timeoutSeconds}(this.experimentalLongPollingOptions,e.experimentalLongPollingOptions)&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams}}class eh{constructor(e,n,r,i){this._authCredentials=e,this._appCheckCredentials=n,this._databaseId=r,this._app=i,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new h0({}),this._settingsFrozen=!1,this._terminateTask="notTerminated"}get app(){if(!this._app)throw new Z(U.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 Z(U.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 h0(e),e.credentials!==void 0&&(this._authCredentials=function(r){if(!r)return new lA;switch(r.type){case"firstParty":return new hA(r.sessionIndex||"0",r.iamToken||null,r.authTokenFactory||null);case"provider":return r.client;default:throw new Z(U.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invalid credential type")}}(e.credentials))}_getSettings(){return this._settings}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return this._terminateTask==="notTerminated"&&(this._terminateTask=this._terminate()),this._terminateTask}async _restart(){this._terminateTask==="notTerminated"?await this._terminate():this._terminateTask="notTerminated"}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return function(n){const r=c0.get(n);r&&(re("ComponentProvider","Removing Datastore"),c0.delete(n),r.terminate())}(this),Promise.resolve()}}function W2(t,e,n,r={}){var i;const s=(t=Wt(t,eh))._getSettings(),o=`${e}:${n}`;if(s.host!=="firestore.googleapis.com"&&s.host!==o&&Ko("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used."),t._setSettings(Object.assign(Object.assign({},s),{host:o,ssl:!1})),r.mockUserToken){let l,u;if(typeof r.mockUserToken=="string")l=r.mockUserToken,u=Ot.MOCK_USER;else{l=Tb(r.mockUserToken,(i=t._app)===null||i===void 0?void 0:i.options.projectId);const h=r.mockUserToken.sub||r.mockUserToken.user_id;if(!h)throw new Z(U.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");u=new Ot(h)}t._authCredentials=new cA(new Ux(l,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 Os{constructor(e,n,r){this.converter=n,this._query=r,this.type="query",this.firestore=e}withConverter(e){return new Os(this.firestore,e,this._query)}}class Vt{constructor(e,n,r){this.converter=n,this._key=r,this.type="document",this.firestore=e}get _path(){return this._key.path}get id(){return this._key.path.lastSegment()}get path(){return this._key.path.canonicalString()}get parent(){return new Pi(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new Vt(this.firestore,e,this._key)}}class Pi extends Os{constructor(e,n,r){super(e,n,$d(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 Vt(this.firestore,null,new ie(e))}withConverter(e){return new Pi(this.firestore,e,this._path)}}function nt(t,e,...n){if(t=qe(t),UE("collection","path",e),t instanceof eh){const r=De.fromString(e,...n);return d0(r),new Pi(t,null,r)}{if(!(t instanceof Vt||t instanceof Pi))throw new Z(U.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const r=t._path.child(De.fromString(e,...n));return d0(r),new Pi(t.firestore,null,r)}}function Ne(t,e,...n){if(t=qe(t),arguments.length===1&&(e=zx.newId()),UE("doc","path",e),t instanceof eh){const r=De.fromString(e,...n);return u0(r),new Vt(t,null,new ie(r))}{if(!(t instanceof Vt||t instanceof Pi))throw new Z(U.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const r=t._path.child(De.fromString(e,...n));return u0(r),new Vt(t.firestore,t instanceof Pi?t.converter:null,new ie(r))}}/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class f0{constructor(e=Promise.resolve()){this.Pu=[],this.Iu=!1,this.Tu=[],this.Eu=null,this.du=!1,this.Au=!1,this.Ru=[],this.t_=new EE(this,"async_queue_retry"),this.Vu=()=>{const r=rf();r&&re("AsyncQueue","Visibility state changed to "+r.visibilityState),this.t_.jo()},this.mu=e;const n=rf();n&&typeof n.addEventListener=="function"&&n.addEventListener("visibilitychange",this.Vu)}get isShuttingDown(){return this.Iu}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.fu(),this.gu(e)}enterRestrictedMode(e){if(!this.Iu){this.Iu=!0,this.Au=e||!1;const n=rf();n&&typeof n.removeEventListener=="function"&&n.removeEventListener("visibilitychange",this.Vu)}}enqueue(e){if(this.fu(),this.Iu)return new Promise(()=>{});const n=new Ur;return this.gu(()=>this.Iu&&this.Au?Promise.resolve():(e().then(n.resolve,n.reject),n.promise)).then(()=>n.promise)}enqueueRetryable(e){this.enqueueAndForget(()=>(this.Pu.push(e),this.pu()))}async pu(){if(this.Pu.length!==0){try{await this.Pu[0](),this.Pu.shift(),this.t_.reset()}catch(e){if(!ic(e))throw e;re("AsyncQueue","Operation failed with retryable error: "+e)}this.Pu.length>0&&this.t_.Go(()=>this.pu())}}gu(e){const n=this.mu.then(()=>(this.du=!0,e().catch(r=>{this.Eu=r,this.du=!1;const i=function(o){let l=o.message||"";return o.stack&&(l=o.stack.includes(o.message)?o.stack:o.message+`
|
|
`+o.stack),l}(r);throw Kr("INTERNAL UNHANDLED ERROR: ",i),r}).then(r=>(this.du=!1,r))));return this.mu=n,n}enqueueAfterDelay(e,n,r){this.fu(),this.Ru.indexOf(e)>-1&&(n=0);const i=tg.createAndSchedule(this,e,n,r,s=>this.yu(s));return this.Tu.push(i),i}fu(){this.Eu&&ce()}verifyOperationInProgress(){}async wu(){let e;do e=this.mu,await e;while(e!==this.mu)}Su(e){for(const n of this.Tu)if(n.timerId===e)return!0;return!1}bu(e){return this.wu().then(()=>{this.Tu.sort((n,r)=>n.targetTimeMs-r.targetTimeMs);for(const n of this.Tu)if(n.skipDelay(),e!=="all"&&n.timerId===e)break;return this.wu()})}Du(e){this.Ru.push(e)}yu(e){const n=this.Tu.indexOf(e);this.Tu.splice(n,1)}}function p0(t){return function(n,r){if(typeof n!="object"||n===null)return!1;const i=n;for(const s of r)if(s in i&&typeof i[s]=="function")return!0;return!1}(t,["next","error","complete"])}class hr extends eh{constructor(e,n,r,i){super(e,n,r,i),this.type="firestore",this._queue=new f0,this._persistenceKey=(i==null?void 0:i.name)||"[DEFAULT]"}async _terminate(){if(this._firestoreClient){const e=this._firestoreClient.terminate();this._queue=new f0(e),this._firestoreClient=void 0,await e}}}function H2(t,e){const n=typeof t=="object"?t:Im(),r=typeof t=="string"?t:"(default)",i=ra(n,"firestore").getImmediate({identifier:r});if(!i._initialized){const s=Eb("firestore");s&&W2(i,...s)}return i}function uc(t){if(t._terminated)throw new Z(U.FAILED_PRECONDITION,"The client has already been terminated.");return t._firestoreClient||K2(t),t._firestoreClient}function K2(t){var e,n,r;const i=t._freezeSettings(),s=function(l,u,h,m){return new bA(l,u,h,m.host,m.ssl,m.experimentalForceLongPolling,m.experimentalAutoDetectLongPolling,FE(m.experimentalLongPollingOptions),m.useFetchStreams)}(t._databaseId,((e=t._app)===null||e===void 0?void 0:e.options.appId)||"",t._persistenceKey,i);t._componentsProvider||!((n=i.localCache)===null||n===void 0)&&n._offlineComponentProvider&&(!((r=i.localCache)===null||r===void 0)&&r._onlineComponentProvider)&&(t._componentsProvider={_offline:i.localCache._offlineComponentProvider,_online:i.localCache._onlineComponentProvider}),t._firestoreClient=new F2(t._authCredentials,t._appCheckCredentials,t._queue,s,t._componentsProvider&&function(l){const u=l==null?void 0:l._online.build();return{_offline:l==null?void 0:l._offline.build(u),_online:u}}(t._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 Zo{constructor(e){this._byteString=e}static fromBase64String(e){try{return new Zo(Ct.fromBase64String(e))}catch(n){throw new Z(U.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+n)}}static fromUint8Array(e){return new Zo(Ct.fromUint8Array(e))}toBase64(){return this._byteString.toBase64()}toUint8Array(){return this._byteString.toUint8Array()}toString(){return"Bytes(base64: "+this.toBase64()+")"}isEqual(e){return this._byteString.isEqual(e._byteString)}}/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class dc{constructor(...e){for(let n=0;n<e.length;++n)if(e[n].length===0)throw new Z(U.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new Tt(e)}isEqual(e){return this._internalPath.isEqual(e._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.
|
|
*/class cg{constructor(e){this._methodName=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 ug{constructor(e,n){if(!isFinite(e)||e<-90||e>90)throw new Z(U.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(n)||n<-180||n>180)throw new Z(U.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+n);this._lat=e,this._long=n}get latitude(){return this._lat}get longitude(){return this._long}isEqual(e){return this._lat===e._lat&&this._long===e._long}toJSON(){return{latitude:this._lat,longitude:this._long}}_compareTo(e){return xe(this._lat,e._lat)||xe(this._long,e._long)}}/**
|
|
* @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 dg{constructor(e){this._values=(e||[]).map(n=>n)}toArray(){return this._values.map(e=>e)}isEqual(e){return function(r,i){if(r.length!==i.length)return!1;for(let s=0;s<r.length;++s)if(r[s]!==i[s])return!1;return!0}(this._values,e._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.
|
|
*/const G2=/^__.*__$/;class Q2{constructor(e,n,r){this.data=e,this.fieldMask=n,this.fieldTransforms=r}toMutation(e,n){return this.fieldMask!==null?new zi(e,this.data,this.fieldMask,n,this.fieldTransforms):new oc(e,this.data,n,this.fieldTransforms)}}class zE{constructor(e,n,r){this.data=e,this.fieldMask=n,this.fieldTransforms=r}toMutation(e,n){return new zi(e,this.data,this.fieldMask,n,this.fieldTransforms)}}function BE(t){switch(t){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw ce()}}class hg{constructor(e,n,r,i,s,o){this.settings=e,this.databaseId=n,this.serializer=r,this.ignoreUndefinedProperties=i,s===void 0&&this.vu(),this.fieldTransforms=s||[],this.fieldMask=o||[]}get path(){return this.settings.path}get Cu(){return this.settings.Cu}Fu(e){return new hg(Object.assign(Object.assign({},this.settings),e),this.databaseId,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}Mu(e){var n;const r=(n=this.path)===null||n===void 0?void 0:n.child(e),i=this.Fu({path:r,xu:!1});return i.Ou(e),i}Nu(e){var n;const r=(n=this.path)===null||n===void 0?void 0:n.child(e),i=this.Fu({path:r,xu:!1});return i.vu(),i}Lu(e){return this.Fu({path:void 0,xu:!0})}Bu(e){return wd(e,this.settings.methodName,this.settings.ku||!1,this.path,this.settings.qu)}contains(e){return this.fieldMask.find(n=>e.isPrefixOf(n))!==void 0||this.fieldTransforms.find(n=>e.isPrefixOf(n.field))!==void 0}vu(){if(this.path)for(let e=0;e<this.path.length;e++)this.Ou(this.path.get(e))}Ou(e){if(e.length===0)throw this.Bu("Document fields must not be empty");if(BE(this.Cu)&&G2.test(e))throw this.Bu('Document fields cannot begin and end with "__"')}}class Y2{constructor(e,n,r){this.databaseId=e,this.ignoreUndefinedProperties=n,this.serializer=r||Yd(e)}Qu(e,n,r,i=!1){return new hg({Cu:e,methodName:n,qu:r,path:Tt.emptyPath(),xu:!1,ku:i},this.databaseId,this.serializer,this.ignoreUndefinedProperties)}}function hc(t){const e=t._freezeSettings(),n=Yd(t._databaseId);return new Y2(t._databaseId,!!e.ignoreUndefinedProperties,n)}function fg(t,e,n,r,i,s={}){const o=t.Qu(s.merge||s.mergeFields?2:0,e,n,i);pg("Data must be an object, but it was:",o,r);const l=WE(r,o);let u,h;if(s.merge)u=new dn(o.fieldMask),h=o.fieldTransforms;else if(s.mergeFields){const m=[];for(const v of s.mergeFields){const g=Ap(e,v,n);if(!o.contains(g))throw new Z(U.INVALID_ARGUMENT,`Field '${g}' is specified in your field mask but missing from your input data.`);KE(m,g)||m.push(g)}u=new dn(m),h=o.fieldTransforms.filter(v=>u.covers(v.field))}else u=null,h=o.fieldTransforms;return new Q2(new tn(l),u,h)}class th extends cg{_toFieldTransform(e){if(e.Cu!==2)throw e.Cu===1?e.Bu(`${this._methodName}() can only appear at the top level of your update data`):e.Bu(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);return e.fieldMask.push(e.path),null}isEqual(e){return e instanceof th}}function $E(t,e,n,r){const i=t.Qu(1,e,n);pg("Data must be an object, but it was:",i,r);const s=[],o=tn.empty();Ds(r,(u,h)=>{const m=mg(e,u,n);h=qe(h);const v=i.Nu(m);if(h instanceof th)s.push(m);else{const g=fc(h,v);g!=null&&(s.push(m),o.set(m,g))}});const l=new dn(s);return new zE(o,l,i.fieldTransforms)}function qE(t,e,n,r,i,s){const o=t.Qu(1,e,n),l=[Ap(e,r,n)],u=[i];if(s.length%2!=0)throw new Z(U.INVALID_ARGUMENT,`Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);for(let g=0;g<s.length;g+=2)l.push(Ap(e,s[g])),u.push(s[g+1]);const h=[],m=tn.empty();for(let g=l.length-1;g>=0;--g)if(!KE(h,l[g])){const N=l[g];let j=u[g];j=qe(j);const L=o.Nu(N);if(j instanceof th)h.push(N);else{const B=fc(j,L);B!=null&&(h.push(N),m.set(N,B))}}const v=new dn(h);return new zE(m,v,o.fieldTransforms)}function J2(t,e,n,r=!1){return fc(n,t.Qu(r?4:3,e))}function fc(t,e){if(HE(t=qe(t)))return pg("Unsupported field value:",e,t),WE(t,e);if(t instanceof cg)return function(r,i){if(!BE(i.Cu))throw i.Bu(`${r._methodName}() can only be used with update() and set()`);if(!i.path)throw i.Bu(`${r._methodName}() is not currently supported inside arrays`);const s=r._toFieldTransform(i);s&&i.fieldTransforms.push(s)}(t,e),null;if(t===void 0&&e.ignoreUndefinedProperties)return null;if(e.path&&e.fieldMask.push(e.path),t instanceof Array){if(e.settings.xu&&e.Cu!==4)throw e.Bu("Nested arrays are not supported");return function(r,i){const s=[];let o=0;for(const l of r){let u=fc(l,i.Lu(o));u==null&&(u={nullValue:"NULL_VALUE"}),s.push(u),o++}return{arrayValue:{values:s}}}(t,e)}return function(r,i){if((r=qe(r))===null)return{nullValue:"NULL_VALUE"};if(typeof r=="number")return KA(i.serializer,r);if(typeof r=="boolean")return{booleanValue:r};if(typeof r=="string")return{stringValue:r};if(r instanceof Date){const s=ht.fromDate(r);return{timestampValue:md(i.serializer,s)}}if(r instanceof ht){const s=new ht(r.seconds,1e3*Math.floor(r.nanoseconds/1e3));return{timestampValue:md(i.serializer,s)}}if(r instanceof ug)return{geoPointValue:{latitude:r.latitude,longitude:r.longitude}};if(r instanceof Zo)return{bytesValue:fE(i.serializer,r._byteString)};if(r instanceof Vt){const s=i.databaseId,o=r.firestore._databaseId;if(!o.isEqual(s))throw i.Bu(`Document reference is for database ${o.projectId}/${o.database} but should be for database ${s.projectId}/${s.database}`);return{referenceValue:Km(r.firestore._databaseId||i.databaseId,r._key.path)}}if(r instanceof dg)return function(o,l){return{mapValue:{fields:{__type__:{stringValue:"__vector__"},value:{arrayValue:{values:o.toArray().map(u=>{if(typeof u!="number")throw l.Bu("VectorValues must only contain numeric values.");return qm(l.serializer,u)})}}}}}}(r,i);throw i.Bu(`Unsupported field value: ${Zd(r)}`)}(t,e)}function WE(t,e){const n={};return Bx(t)?e.path&&e.path.length>0&&e.fieldMask.push(e.path):Ds(t,(r,i)=>{const s=fc(i,e.Mu(r));s!=null&&(n[r]=s)}),{mapValue:{fields:n}}}function HE(t){return!(typeof t!="object"||t===null||t instanceof Array||t instanceof Date||t instanceof ht||t instanceof ug||t instanceof Zo||t instanceof Vt||t instanceof cg||t instanceof dg)}function pg(t,e,n){if(!HE(n)||!function(i){return typeof i=="object"&&i!==null&&(Object.getPrototypeOf(i)===Object.prototype||Object.getPrototypeOf(i)===null)}(n)){const r=Zd(n);throw r==="an object"?e.Bu(t+" a custom object"):e.Bu(t+" "+r)}}function Ap(t,e,n){if((e=qe(e))instanceof dc)return e._internalPath;if(typeof e=="string")return mg(t,e);throw wd("Field path arguments must be of type string or ",t,!1,void 0,n)}const X2=new RegExp("[~\\*/\\[\\]]");function mg(t,e,n){if(e.search(X2)>=0)throw wd(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`,t,!1,void 0,n);try{return new dc(...e.split("."))._internalPath}catch{throw wd(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,t,!1,void 0,n)}}function wd(t,e,n,r,i){const s=r&&!r.isEmpty(),o=i!==void 0;let l=`Function ${e}() called with invalid data`;n&&(l+=" (via `toFirestore()`)"),l+=". ";let u="";return(s||o)&&(u+=" (found",s&&(u+=` in field ${r}`),o&&(u+=` in document ${i}`),u+=")"),new Z(U.INVALID_ARGUMENT,l+t+u)}function KE(t,e){return t.some(n=>n.isEqual(e))}/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class GE{constructor(e,n,r,i,s){this._firestore=e,this._userDataWriter=n,this._key=r,this._document=i,this._converter=s}get id(){return this._key.path.lastSegment()}get ref(){return new Vt(this._firestore,this._converter,this._key)}exists(){return this._document!==null}data(){if(this._document){if(this._converter){const e=new Z2(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(e)}return this._userDataWriter.convertValue(this._document.data.value)}}get(e){if(this._document){const n=this._document.data.field(gg("DocumentSnapshot.get",e));if(n!==null)return this._userDataWriter.convertValue(n)}}}class Z2 extends GE{data(){return super.data()}}function gg(t,e){return typeof e=="string"?mg(t,e):e instanceof dc?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 QE(t){if(t.limitType==="L"&&t.explicitOrderBy.length===0)throw new Z(U.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}class yg{}class eP extends yg{}function m0(t,e,...n){let r=[];e instanceof yg&&r.push(e),r=r.concat(n),function(s){const o=s.filter(u=>u instanceof vg).length,l=s.filter(u=>u instanceof nh).length;if(o>1||o>0&&l>0)throw new Z(U.INVALID_ARGUMENT,"InvalidQuery. When using composite filters, you cannot use more than one filter at the top level. Consider nesting the multiple filters within an `and(...)` statement. For example: change `query(query, where(...), or(...))` to `query(query, and(where(...), or(...)))`.")}(r);for(const i of r)t=i._apply(t);return t}class nh extends eP{constructor(e,n,r){super(),this._field=e,this._op=n,this._value=r,this.type="where"}static _create(e,n,r){return new nh(e,n,r)}_apply(e){const n=this._parse(e);return YE(e._query,n),new Os(e.firestore,e.converter,wp(e._query,n))}_parse(e){const n=hc(e.firestore);return function(s,o,l,u,h,m,v){let g;if(h.isKeyField()){if(m==="array-contains"||m==="array-contains-any")throw new Z(U.INVALID_ARGUMENT,`Invalid Query. You can't perform '${m}' queries on documentId().`);if(m==="in"||m==="not-in"){v0(v,m);const N=[];for(const j of v)N.push(y0(u,s,j));g={arrayValue:{values:N}}}else g=y0(u,s,v)}else m!=="in"&&m!=="not-in"&&m!=="array-contains-any"||v0(v,m),g=J2(l,o,v,m==="in"||m==="not-in");return st.create(h,m,g)}(e._query,"where",n,e.firestore._databaseId,this._field,this._op,this._value)}}function g0(t,e,n){const r=e,i=gg("where",t);return nh._create(i,r,n)}class vg extends yg{constructor(e,n){super(),this.type=e,this._queryConstraints=n}static _create(e,n){return new vg(e,n)}_parse(e){const n=this._queryConstraints.map(r=>r._parse(e)).filter(r=>r.getFilters().length>0);return n.length===1?n[0]:Bn.create(n,this._getOperator())}_apply(e){const n=this._parse(e);return n.getFilters().length===0?e:(function(i,s){let o=i;const l=s.getFlattenedFilters();for(const u of l)YE(o,u),o=wp(o,u)}(e._query,n),new Os(e.firestore,e.converter,wp(e._query,n)))}_getQueryConstraints(){return this._queryConstraints}_getOperator(){return this.type==="and"?"and":"or"}}function y0(t,e,n){if(typeof(n=qe(n))=="string"){if(n==="")throw new Z(U.INVALID_ARGUMENT,"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");if(!Jx(e)&&n.indexOf("/")!==-1)throw new Z(U.INVALID_ARGUMENT,`Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${n}' contains a '/' character.`);const r=e.path.child(De.fromString(n));if(!ie.isDocumentKey(r))throw new Z(U.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 Lv(t,new ie(r))}if(n instanceof Vt)return Lv(t,n._key);throw new Z(U.INVALID_ARGUMENT,`Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${Zd(n)}.`)}function v0(t,e){if(!Array.isArray(t)||t.length===0)throw new Z(U.INVALID_ARGUMENT,`Invalid Query. A non-empty array is required for '${e.toString()}' filters.`)}function YE(t,e){const n=function(i,s){for(const o of i)for(const l of o.getFlattenedFilters())if(s.indexOf(l.op)>=0)return l.op;return null}(t.filters,function(i){switch(i){case"!=":return["!=","not-in"];case"array-contains-any":case"in":return["not-in"];case"not-in":return["array-contains-any","in","not-in","!="];default:return[]}}(e.op));if(n!==null)throw n===e.op?new Z(U.INVALID_ARGUMENT,`Invalid query. You cannot use more than one '${e.op.toString()}' filter.`):new Z(U.INVALID_ARGUMENT,`Invalid query. You cannot use '${e.op.toString()}' filters with '${n.toString()}' filters.`)}class tP{convertValue(e,n="none"){switch(Is(e)){case 0:return null;case 1:return e.booleanValue;case 2:return Ye(e.integerValue||e.doubleValue);case 3:return this.convertTimestamp(e.timestampValue);case 4:return this.convertServerTimestamp(e,n);case 5:return e.stringValue;case 6:return this.convertBytes(Ss(e.bytesValue));case 7:return this.convertReference(e.referenceValue);case 8:return this.convertGeoPoint(e.geoPointValue);case 9:return this.convertArray(e.arrayValue,n);case 11:return this.convertObject(e.mapValue,n);case 10:return this.convertVectorValue(e.mapValue);default:throw ce()}}convertObject(e,n){return this.convertObjectMap(e.fields,n)}convertObjectMap(e,n="none"){const r={};return Ds(e,(i,s)=>{r[i]=this.convertValue(s,n)}),r}convertVectorValue(e){var n,r,i;const s=(i=(r=(n=e.fields)===null||n===void 0?void 0:n.value.arrayValue)===null||r===void 0?void 0:r.values)===null||i===void 0?void 0:i.map(o=>Ye(o.doubleValue));return new dg(s)}convertGeoPoint(e){return new ug(Ye(e.latitude),Ye(e.longitude))}convertArray(e,n){return(e.values||[]).map(r=>this.convertValue(r,n))}convertServerTimestamp(e,n){switch(n){case"previous":const r=Um(e);return r==null?null:this.convertValue(r,n);case"estimate":return this.convertTimestamp(Ul(e));default:return null}}convertTimestamp(e){const n=Oi(e);return new ht(n.seconds,n.nanos)}convertDocumentKey(e,n){const r=De.fromString(e);Se(wE(r));const i=new zl(r.get(1),r.get(3)),s=new ie(r.popFirst(5));return i.isEqual(n)||Kr(`Document ${s} contains a document reference within a different database (${i.projectId}/${i.database}) which is not supported. It will be treated as a reference in the current database (${n.projectId}/${n.database}) instead.`),s}}/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/function wg(t,e,n){let r;return r=t?n&&(n.merge||n.mergeFields)?t.toFirestore(e,n):t.toFirestore(e):e,r}/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class il{constructor(e,n){this.hasPendingWrites=e,this.fromCache=n}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}}class JE extends GE{constructor(e,n,r,i,s,o){super(e,n,r,i,o),this._firestore=e,this._firestoreImpl=e,this.metadata=s}exists(){return super.exists()}data(e={}){if(this._document){if(this._converter){const n=new Nu(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(n,e)}return this._userDataWriter.convertValue(this._document.data.value,e.serverTimestamps)}}get(e,n={}){if(this._document){const r=this._document.data.field(gg("DocumentSnapshot.get",e));if(r!==null)return this._userDataWriter.convertValue(r,n.serverTimestamps)}}}class Nu extends JE{data(e={}){return super.data(e)}}class XE{constructor(e,n,r,i){this._firestore=e,this._userDataWriter=n,this._snapshot=i,this.metadata=new il(i.hasPendingWrites,i.fromCache),this.query=r}get docs(){const e=[];return this.forEach(n=>e.push(n)),e}get size(){return this._snapshot.docs.size}get empty(){return this.size===0}forEach(e,n){this._snapshot.docs.forEach(r=>{e.call(n,new Nu(this._firestore,this._userDataWriter,r.key,r,new il(this._snapshot.mutatedKeys.has(r.key),this._snapshot.fromCache),this.query.converter))})}docChanges(e={}){const n=!!e.includeMetadataChanges;if(n&&this._snapshot.excludesMetadataChanges)throw new Z(U.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===n||(this._cachedChanges=function(i,s){if(i._snapshot.oldDocs.isEmpty()){let o=0;return i._snapshot.docChanges.map(l=>{const u=new Nu(i._firestore,i._userDataWriter,l.doc.key,l.doc,new il(i._snapshot.mutatedKeys.has(l.doc.key),i._snapshot.fromCache),i.query.converter);return l.doc,{type:"added",doc:u,oldIndex:-1,newIndex:o++}})}{let o=i._snapshot.oldDocs;return i._snapshot.docChanges.filter(l=>s||l.type!==3).map(l=>{const u=new Nu(i._firestore,i._userDataWriter,l.doc.key,l.doc,new il(i._snapshot.mutatedKeys.has(l.doc.key),i._snapshot.fromCache),i.query.converter);let h=-1,m=-1;return l.type!==0&&(h=o.indexOf(l.doc.key),o=o.delete(l.doc.key)),l.type!==1&&(o=o.add(l.doc),m=o.indexOf(l.doc.key)),{type:nP(l.type),doc:u,oldIndex:h,newIndex:m}})}}(this,n),this._cachedChangesIncludeMetadataChanges=n),this._cachedChanges}}function nP(t){switch(t){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return ce()}}/**
|
|
* @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 of(t){t=Wt(t,Vt);const e=Wt(t.firestore,hr);return B2(uc(e),t._key).then(n=>ZE(e,t,n))}class _g extends tP{constructor(e){super(),this.firestore=e}convertBytes(e){return new Zo(e)}convertReference(e){const n=this.convertDocumentKey(e,this.firestore._databaseId);return new Vt(this.firestore,null,n)}}function au(t){t=Wt(t,Os);const e=Wt(t.firestore,hr),n=uc(e),r=new _g(e);return QE(t._query),$2(n,t._query).then(i=>new XE(e,r,t,i))}function os(t,e,n){t=Wt(t,Vt);const r=Wt(t.firestore,hr),i=wg(t.converter,e,n);return pc(r,[fg(hc(r),"setDoc",t._key,i,t.converter!==null,n).toMutation(t._key,qt.none())])}function Zn(t,e,n,...r){t=Wt(t,Vt);const i=Wt(t.firestore,hr),s=hc(i);let o;return o=typeof(e=qe(e))=="string"||e instanceof dc?qE(s,"updateDoc",t._key,e,n,r):$E(s,"updateDoc",t._key,e),pc(i,[o.toMutation(t._key,qt.exists(!0))])}function Ha(t){return pc(Wt(t.firestore,hr),[new Gd(t._key,qt.none())])}function er(t,e){const n=Wt(t.firestore,hr),r=Ne(t),i=wg(t.converter,e);return pc(n,[fg(hc(t.firestore),"addDoc",r._key,i,t.converter!==null,{}).toMutation(r._key,qt.exists(!1))]).then(()=>r)}function fo(t,...e){var n,r,i;t=qe(t);let s={includeMetadataChanges:!1,source:"default"},o=0;typeof e[o]!="object"||p0(e[o])||(s=e[o],o++);const l={includeMetadataChanges:s.includeMetadataChanges,source:s.source};if(p0(e[o])){const v=e[o];e[o]=(n=v.next)===null||n===void 0?void 0:n.bind(v),e[o+1]=(r=v.error)===null||r===void 0?void 0:r.bind(v),e[o+2]=(i=v.complete)===null||i===void 0?void 0:i.bind(v)}let u,h,m;if(t instanceof Vt)h=Wt(t.firestore,hr),m=$d(t._key.path),u={next:v=>{e[o]&&e[o](ZE(h,t,v))},error:e[o+1],complete:e[o+2]};else{const v=Wt(t,Os);h=Wt(v.firestore,hr),m=v._query;const g=new _g(h);u={next:N=>{e[o]&&e[o](new XE(h,g,v,N))},error:e[o+1],complete:e[o+2]},QE(t._query)}return function(g,N,j,L){const B=new lg(L),I=new og(N,B,j);return g.asyncQueue.enqueueAndForget(async()=>rg(await vd(g),I)),()=>{B.Za(),g.asyncQueue.enqueueAndForget(async()=>ig(await vd(g),I))}}(uc(h),m,l,u)}function pc(t,e){return function(r,i){const s=new Ur;return r.asyncQueue.enqueueAndForget(async()=>P2(await z2(r),i,s)),s.promise}(uc(t),e)}function ZE(t,e,n){const r=n.docs.get(e._key),i=new _g(t);return new JE(t,i,e._key,r,new il(n.hasPendingWrites,n.fromCache),e.converter)}/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/class rP{constructor(e,n){this._firestore=e,this._commitHandler=n,this._mutations=[],this._committed=!1,this._dataReader=hc(e)}set(e,n,r){this._verifyNotCommitted();const i=af(e,this._firestore),s=wg(i.converter,n,r),o=fg(this._dataReader,"WriteBatch.set",i._key,s,i.converter!==null,r);return this._mutations.push(o.toMutation(i._key,qt.none())),this}update(e,n,r,...i){this._verifyNotCommitted();const s=af(e,this._firestore);let o;return o=typeof(n=qe(n))=="string"||n instanceof dc?qE(this._dataReader,"WriteBatch.update",s._key,n,r,i):$E(this._dataReader,"WriteBatch.update",s._key,n),this._mutations.push(o.toMutation(s._key,qt.exists(!0))),this}delete(e){this._verifyNotCommitted();const n=af(e,this._firestore);return this._mutations=this._mutations.concat(new Gd(n._key,qt.none())),this}commit(){return this._verifyNotCommitted(),this._committed=!0,this._mutations.length>0?this._commitHandler(this._mutations):Promise.resolve()}_verifyNotCommitted(){if(this._committed)throw new Z(U.FAILED_PRECONDITION,"A write batch can no longer be used after commit() has been called.")}}function af(t,e){if((t=qe(t)).firestore!==e)throw new Z(U.INVALID_ARGUMENT,"Provided document reference is from a different Firestore instance.");return t}/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/function Ka(t){return uc(t=Wt(t,hr)),new rP(t,e=>pc(t,e))}(function(e,n=!0){(function(i){oa=i})(ia),ur(new Un("firestore",(r,{instanceIdentifier:i,options:s})=>{const o=r.getProvider("app").getImmediate(),l=new hr(new uA(r.getProvider("auth-internal")),new pA(r.getProvider("app-check-internal")),function(h,m){if(!Object.prototype.hasOwnProperty.apply(h.options,["projectId"]))throw new Z(U.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new zl(h.options.projectId,m)}(o,i),o);return s=Object.assign({useFetchStreams:n},s),l._setSettings(s),l},"PUBLIC").setMultipleInstances(!0)),Sn(Pv,"4.7.3",e),Sn(Pv,"4.7.3","esm2017")})();var iP="firebase",sP="10.14.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.
|
|
*/Sn(iP,sP,"app");const ek="@firebase/installations",xg="0.6.9";/**
|
|
* @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 tk=1e4,nk=`w:${xg}`,rk="FIS_v2",oP="https://firebaseinstallations.googleapis.com/v1",aP=60*60*1e3,lP="installations",cP="Installations";/**
|
|
* @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 uP={"missing-app-config-values":'Missing App configuration value: "{$valueName}"',"not-registered":"Firebase Installation is not registered.","installation-not-found":"Firebase Installation not found.","request-failed":'{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',"app-offline":"Could not process request. Application offline.","delete-pending-registration":"Can't delete installation while there is a pending registration request."},Cs=new Rs(lP,cP,uP);function ik(t){return t instanceof fr&&t.code.includes("request-failed")}/**
|
|
* @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 sk({projectId:t}){return`${oP}/projects/${t}/installations`}function ok(t){return{token:t.token,requestStatus:2,expiresIn:hP(t.expiresIn),creationTime:Date.now()}}async function ak(t,e){const r=(await e.json()).error;return Cs.create("request-failed",{requestName:t,serverCode:r.code,serverMessage:r.message,serverStatus:r.status})}function lk({apiKey:t}){return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":t})}function dP(t,{refreshToken:e}){const n=lk(t);return n.append("Authorization",fP(e)),n}async function ck(t){const e=await t();return e.status>=500&&e.status<600?t():e}function hP(t){return Number(t.replace("s","000"))}function fP(t){return`${rk} ${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.
|
|
*/async function pP({appConfig:t,heartbeatServiceProvider:e},{fid:n}){const r=sk(t),i=lk(t),s=e.getImmediate({optional:!0});if(s){const h=await s.getHeartbeatsHeader();h&&i.append("x-firebase-client",h)}const o={fid:n,authVersion:rk,appId:t.appId,sdkVersion:nk},l={method:"POST",headers:i,body:JSON.stringify(o)},u=await ck(()=>fetch(r,l));if(u.ok){const h=await u.json();return{fid:h.fid||n,registrationStatus:2,refreshToken:h.refreshToken,authToken:ok(h.authToken)}}else throw await ak("Create Installation",u)}/**
|
|
* @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 uk(t){return new Promise(e=>{setTimeout(e,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.
|
|
*/function mP(t){return btoa(String.fromCharCode(...t)).replace(/\+/g,"-").replace(/\//g,"_")}/**
|
|
* @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 gP=/^[cdef][\w-]{21}$/,Np="";function yP(){try{const t=new Uint8Array(17);(self.crypto||self.msCrypto).getRandomValues(t),t[0]=112+t[0]%16;const n=vP(t);return gP.test(n)?n:Np}catch{return Np}}function vP(t){return mP(t).substr(0,22)}/**
|
|
* @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 rh(t){return`${t.appName}!${t.appId}`}/**
|
|
* @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 dk=new Map;function hk(t,e){const n=rh(t);fk(n,e),wP(n,e)}function fk(t,e){const n=dk.get(t);if(n)for(const r of n)r(e)}function wP(t,e){const n=_P();n&&n.postMessage({key:t,fid:e}),xP()}let ps=null;function _P(){return!ps&&"BroadcastChannel"in self&&(ps=new BroadcastChannel("[Firebase] FID Change"),ps.onmessage=t=>{fk(t.data.key,t.data.fid)}),ps}function xP(){dk.size===0&&ps&&(ps.close(),ps=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 EP="firebase-installations-database",kP=1,As="firebase-installations-store";let lf=null;function Eg(){return lf||(lf=Vd(EP,kP,{upgrade:(t,e)=>{switch(e){case 0:t.createObjectStore(As)}}})),lf}async function _d(t,e){const n=rh(t),i=(await Eg()).transaction(As,"readwrite"),s=i.objectStore(As),o=await s.get(n);return await s.put(e,n),await i.done,(!o||o.fid!==e.fid)&&hk(t,e.fid),e}async function pk(t){const e=rh(t),r=(await Eg()).transaction(As,"readwrite");await r.objectStore(As).delete(e),await r.done}async function ih(t,e){const n=rh(t),i=(await Eg()).transaction(As,"readwrite"),s=i.objectStore(As),o=await s.get(n),l=e(o);return l===void 0?await s.delete(n):await s.put(l,n),await i.done,l&&(!o||o.fid!==l.fid)&&hk(t,l.fid),l}/**
|
|
* @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 kg(t){let e;const n=await ih(t.appConfig,r=>{const i=TP(r),s=bP(t,i);return e=s.registrationPromise,s.installationEntry});return n.fid===Np?{installationEntry:await e}:{installationEntry:n,registrationPromise:e}}function TP(t){const e=t||{fid:yP(),registrationStatus:0};return mk(e)}function bP(t,e){if(e.registrationStatus===0){if(!navigator.onLine){const i=Promise.reject(Cs.create("app-offline"));return{installationEntry:e,registrationPromise:i}}const n={fid:e.fid,registrationStatus:1,registrationTime:Date.now()},r=SP(t,n);return{installationEntry:n,registrationPromise:r}}else return e.registrationStatus===1?{installationEntry:e,registrationPromise:IP(t)}:{installationEntry:e}}async function SP(t,e){try{const n=await pP(t,e);return _d(t.appConfig,n)}catch(n){throw ik(n)&&n.customData.serverCode===409?await pk(t.appConfig):await _d(t.appConfig,{fid:e.fid,registrationStatus:0}),n}}async function IP(t){let e=await w0(t.appConfig);for(;e.registrationStatus===1;)await uk(100),e=await w0(t.appConfig);if(e.registrationStatus===0){const{installationEntry:n,registrationPromise:r}=await kg(t);return r||n}return e}function w0(t){return ih(t,e=>{if(!e)throw Cs.create("installation-not-found");return mk(e)})}function mk(t){return CP(t)?{fid:t.fid,registrationStatus:0}:t}function CP(t){return t.registrationStatus===1&&t.registrationTime+tk<Date.now()}/**
|
|
* @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 AP({appConfig:t,heartbeatServiceProvider:e},n){const r=NP(t,n),i=dP(t,n),s=e.getImmediate({optional:!0});if(s){const h=await s.getHeartbeatsHeader();h&&i.append("x-firebase-client",h)}const o={installation:{sdkVersion:nk,appId:t.appId}},l={method:"POST",headers:i,body:JSON.stringify(o)},u=await ck(()=>fetch(r,l));if(u.ok){const h=await u.json();return ok(h)}else throw await ak("Generate Auth Token",u)}function NP(t,{fid:e}){return`${sk(t)}/${e}/authTokens:generate`}/**
|
|
* @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 Tg(t,e=!1){let n;const r=await ih(t.appConfig,s=>{if(!gk(s))throw Cs.create("not-registered");const o=s.authToken;if(!e&&DP(o))return s;if(o.requestStatus===1)return n=PP(t,e),s;{if(!navigator.onLine)throw Cs.create("app-offline");const l=OP(s);return n=RP(t,l),l}});return n?await n:r.authToken}async function PP(t,e){let n=await _0(t.appConfig);for(;n.authToken.requestStatus===1;)await uk(100),n=await _0(t.appConfig);const r=n.authToken;return r.requestStatus===0?Tg(t,e):r}function _0(t){return ih(t,e=>{if(!gk(e))throw Cs.create("not-registered");const n=e.authToken;return LP(n)?Object.assign(Object.assign({},e),{authToken:{requestStatus:0}}):e})}async function RP(t,e){try{const n=await AP(t,e),r=Object.assign(Object.assign({},e),{authToken:n});return await _d(t.appConfig,r),n}catch(n){if(ik(n)&&(n.customData.serverCode===401||n.customData.serverCode===404))await pk(t.appConfig);else{const r=Object.assign(Object.assign({},e),{authToken:{requestStatus:0}});await _d(t.appConfig,r)}throw n}}function gk(t){return t!==void 0&&t.registrationStatus===2}function DP(t){return t.requestStatus===2&&!jP(t)}function jP(t){const e=Date.now();return e<t.creationTime||t.creationTime+t.expiresIn<e+aP}function OP(t){const e={requestStatus:1,requestTime:Date.now()};return Object.assign(Object.assign({},t),{authToken:e})}function LP(t){return t.requestStatus===1&&t.requestTime+tk<Date.now()}/**
|
|
* @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 MP(t){const e=t,{installationEntry:n,registrationPromise:r}=await kg(e);return r?r.catch(console.error):Tg(e).catch(console.error),n.fid}/**
|
|
* @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 VP(t,e=!1){const n=t;return await FP(n),(await Tg(n,e)).token}async function FP(t){const{registrationPromise:e}=await kg(t);e&&await 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.
|
|
*/function UP(t){if(!t||!t.options)throw cf("App Configuration");if(!t.name)throw cf("App Name");const e=["projectId","apiKey","appId"];for(const n of e)if(!t.options[n])throw cf(n);return{appName:t.name,projectId:t.options.projectId,apiKey:t.options.apiKey,appId:t.options.appId}}function cf(t){return Cs.create("missing-app-config-values",{valueName: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.
|
|
*/const yk="installations",zP="installations-internal",BP=t=>{const e=t.getProvider("app").getImmediate(),n=UP(e),r=ra(e,"heartbeat");return{app:e,appConfig:n,heartbeatServiceProvider:r,_delete:()=>Promise.resolve()}},$P=t=>{const e=t.getProvider("app").getImmediate(),n=ra(e,yk).getImmediate();return{getId:()=>MP(n),getToken:i=>VP(n,i)}};function qP(){ur(new Un(yk,BP,"PUBLIC")),ur(new Un(zP,$P,"PRIVATE"))}qP();Sn(ek,xg);Sn(ek,xg,"esm2017");/**
|
|
* @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 WP="/firebase-messaging-sw.js",HP="/firebase-cloud-messaging-push-scope",vk="BDOU99-h67HcA6JeFXHbSNMu7e2yNNu3RzoMj8TM4W88jITfq7ZmPvIM1Iv-4_l2LxQcYwhqby2xGpWwzjfAnG4",KP="https://fcmregistrations.googleapis.com/v1",wk="google.c.a.c_id",GP="google.c.a.c_l",QP="google.c.a.ts",YP="google.c.a.e";var x0;(function(t){t[t.DATA_MESSAGE=1]="DATA_MESSAGE",t[t.DISPLAY_NOTIFICATION=3]="DISPLAY_NOTIFICATION"})(x0||(x0={}));/**
|
|
* @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.
|
|
*/var Wl;(function(t){t.PUSH_RECEIVED="push-received",t.NOTIFICATION_CLICKED="notification-clicked"})(Wl||(Wl={}));/**
|
|
* @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 Nr(t){const e=new Uint8Array(t);return btoa(String.fromCharCode(...e)).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function JP(t){const e="=".repeat((4-t.length%4)%4),n=(t+e).replace(/\-/g,"+").replace(/_/g,"/"),r=atob(n),i=new Uint8Array(r.length);for(let s=0;s<r.length;++s)i[s]=r.charCodeAt(s);return i}/**
|
|
* @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 uf="fcm_token_details_db",XP=5,E0="fcm_token_object_Store";async function ZP(t){if("databases"in indexedDB&&!(await indexedDB.databases()).map(s=>s.name).includes(uf))return null;let e=null;return(await Vd(uf,XP,{upgrade:async(r,i,s,o)=>{var l;if(i<2||!r.objectStoreNames.contains(E0))return;const u=o.objectStore(E0),h=await u.index("fcmSenderId").get(t);if(await u.clear(),!!h){if(i===2){const m=h;if(!m.auth||!m.p256dh||!m.endpoint)return;e={token:m.fcmToken,createTime:(l=m.createTime)!==null&&l!==void 0?l:Date.now(),subscriptionOptions:{auth:m.auth,p256dh:m.p256dh,endpoint:m.endpoint,swScope:m.swScope,vapidKey:typeof m.vapidKey=="string"?m.vapidKey:Nr(m.vapidKey)}}}else if(i===3){const m=h;e={token:m.fcmToken,createTime:m.createTime,subscriptionOptions:{auth:Nr(m.auth),p256dh:Nr(m.p256dh),endpoint:m.endpoint,swScope:m.swScope,vapidKey:Nr(m.vapidKey)}}}else if(i===4){const m=h;e={token:m.fcmToken,createTime:m.createTime,subscriptionOptions:{auth:Nr(m.auth),p256dh:Nr(m.p256dh),endpoint:m.endpoint,swScope:m.swScope,vapidKey:Nr(m.vapidKey)}}}}}})).close(),await Yh(uf),await Yh("fcm_vapid_details_db"),await Yh("undefined"),eR(e)?e:null}function eR(t){if(!t||!t.subscriptionOptions)return!1;const{subscriptionOptions:e}=t;return typeof t.createTime=="number"&&t.createTime>0&&typeof t.token=="string"&&t.token.length>0&&typeof e.auth=="string"&&e.auth.length>0&&typeof e.p256dh=="string"&&e.p256dh.length>0&&typeof e.endpoint=="string"&&e.endpoint.length>0&&typeof e.swScope=="string"&&e.swScope.length>0&&typeof e.vapidKey=="string"&&e.vapidKey.length>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 tR="firebase-messaging-database",nR=1,Hl="firebase-messaging-store";let df=null;function _k(){return df||(df=Vd(tR,nR,{upgrade:(t,e)=>{switch(e){case 0:t.createObjectStore(Hl)}}})),df}async function rR(t){const e=xk(t),r=await(await _k()).transaction(Hl).objectStore(Hl).get(e);if(r)return r;{const i=await ZP(t.appConfig.senderId);if(i)return await bg(t,i),i}}async function bg(t,e){const n=xk(t),i=(await _k()).transaction(Hl,"readwrite");return await i.objectStore(Hl).put(e,n),await i.done,e}function xk({appConfig:t}){return t.appId}/**
|
|
* @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 iR={"missing-app-config-values":'Missing App configuration value: "{$valueName}"',"only-available-in-window":"This method is available in a Window context.","only-available-in-sw":"This method is available in a service worker context.","permission-default":"The notification permission was not granted and dismissed instead.","permission-blocked":"The notification permission was not granted and blocked instead.","unsupported-browser":"This browser doesn't support the API's required to use the Firebase SDK.","indexed-db-unsupported":"This browser doesn't support indexedDb.open() (ex. Safari iFrame, Firefox Private Browsing, etc)","failed-service-worker-registration":"We are unable to register the default service worker. {$browserErrorMessage}","token-subscribe-failed":"A problem occurred while subscribing the user to FCM: {$errorInfo}","token-subscribe-no-token":"FCM returned no token when subscribing the user to push.","token-unsubscribe-failed":"A problem occurred while unsubscribing the user from FCM: {$errorInfo}","token-update-failed":"A problem occurred while updating the user from FCM: {$errorInfo}","token-update-no-token":"FCM returned no token when updating the user to push.","use-sw-after-get-token":"The useServiceWorker() method may only be called once and must be called before calling getToken() to ensure your service worker is used.","invalid-sw-registration":"The input to useServiceWorker() must be a ServiceWorkerRegistration.","invalid-bg-handler":"The input to setBackgroundMessageHandler() must be a function.","invalid-vapid-key":"The public VAPID key must be a string.","use-vapid-key-after-get-token":"The usePublicVapidKey() method may only be called once and must be called before calling getToken() to ensure your VAPID key is used."},Ht=new Rs("messaging","Messaging",iR);/**
|
|
* @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 sR(t,e){const n=await Ig(t),r=Ek(e),i={method:"POST",headers:n,body:JSON.stringify(r)};let s;try{s=await(await fetch(Sg(t.appConfig),i)).json()}catch(o){throw Ht.create("token-subscribe-failed",{errorInfo:o==null?void 0:o.toString()})}if(s.error){const o=s.error.message;throw Ht.create("token-subscribe-failed",{errorInfo:o})}if(!s.token)throw Ht.create("token-subscribe-no-token");return s.token}async function oR(t,e){const n=await Ig(t),r=Ek(e.subscriptionOptions),i={method:"PATCH",headers:n,body:JSON.stringify(r)};let s;try{s=await(await fetch(`${Sg(t.appConfig)}/${e.token}`,i)).json()}catch(o){throw Ht.create("token-update-failed",{errorInfo:o==null?void 0:o.toString()})}if(s.error){const o=s.error.message;throw Ht.create("token-update-failed",{errorInfo:o})}if(!s.token)throw Ht.create("token-update-no-token");return s.token}async function aR(t,e){const r={method:"DELETE",headers:await Ig(t)};try{const s=await(await fetch(`${Sg(t.appConfig)}/${e}`,r)).json();if(s.error){const o=s.error.message;throw Ht.create("token-unsubscribe-failed",{errorInfo:o})}}catch(i){throw Ht.create("token-unsubscribe-failed",{errorInfo:i==null?void 0:i.toString()})}}function Sg({projectId:t}){return`${KP}/projects/${t}/registrations`}async function Ig({appConfig:t,installations:e}){const n=await e.getToken();return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":t.apiKey,"x-goog-firebase-installations-auth":`FIS ${n}`})}function Ek({p256dh:t,auth:e,endpoint:n,vapidKey:r}){const i={web:{endpoint:n,auth:e,p256dh:t}};return r!==vk&&(i.web.applicationPubKey=r),i}/**
|
|
* @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 lR=7*24*60*60*1e3;async function cR(t){const e=await dR(t.swRegistration,t.vapidKey),n={vapidKey:t.vapidKey,swScope:t.swRegistration.scope,endpoint:e.endpoint,auth:Nr(e.getKey("auth")),p256dh:Nr(e.getKey("p256dh"))},r=await rR(t.firebaseDependencies);if(r){if(hR(r.subscriptionOptions,n))return Date.now()>=r.createTime+lR?uR(t,{token:r.token,createTime:Date.now(),subscriptionOptions:n}):r.token;try{await aR(t.firebaseDependencies,r.token)}catch(i){console.warn(i)}return k0(t.firebaseDependencies,n)}else return k0(t.firebaseDependencies,n)}async function uR(t,e){try{const n=await oR(t.firebaseDependencies,e),r=Object.assign(Object.assign({},e),{token:n,createTime:Date.now()});return await bg(t.firebaseDependencies,r),n}catch(n){throw n}}async function k0(t,e){const r={token:await sR(t,e),createTime:Date.now(),subscriptionOptions:e};return await bg(t,r),r.token}async function dR(t,e){const n=await t.pushManager.getSubscription();return n||t.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:JP(e)})}function hR(t,e){const n=e.vapidKey===t.vapidKey,r=e.endpoint===t.endpoint,i=e.auth===t.auth,s=e.p256dh===t.p256dh;return n&&r&&i&&s}/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/function T0(t){const e={from:t.from,collapseKey:t.collapse_key,messageId:t.fcmMessageId};return fR(e,t),pR(e,t),mR(e,t),e}function fR(t,e){if(!e.notification)return;t.notification={};const n=e.notification.title;n&&(t.notification.title=n);const r=e.notification.body;r&&(t.notification.body=r);const i=e.notification.image;i&&(t.notification.image=i);const s=e.notification.icon;s&&(t.notification.icon=s)}function pR(t,e){e.data&&(t.data=e.data)}function mR(t,e){var n,r,i,s,o;if(!e.fcmOptions&&!(!((n=e.notification)===null||n===void 0)&&n.click_action))return;t.fcmOptions={};const l=(i=(r=e.fcmOptions)===null||r===void 0?void 0:r.link)!==null&&i!==void 0?i:(s=e.notification)===null||s===void 0?void 0:s.click_action;l&&(t.fcmOptions.link=l);const u=(o=e.fcmOptions)===null||o===void 0?void 0:o.analytics_label;u&&(t.fcmOptions.analyticsLabel=u)}/**
|
|
* @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 gR(t){return typeof t=="object"&&!!t&&wk in 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.
|
|
*/function yR(t){if(!t||!t.options)throw hf("App Configuration Object");if(!t.name)throw hf("App Name");const e=["projectId","apiKey","appId","messagingSenderId"],{options:n}=t;for(const r of e)if(!n[r])throw hf(r);return{appName:t.name,projectId:n.projectId,apiKey:n.apiKey,appId:n.appId,senderId:n.messagingSenderId}}function hf(t){return Ht.create("missing-app-config-values",{valueName: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 vR{constructor(e,n,r){this.deliveryMetricsExportedToBigQueryEnabled=!1,this.onBackgroundMessageHandler=null,this.onMessageHandler=null,this.logEvents=[],this.isLogServiceStarted=!1;const i=yR(e);this.firebaseDependencies={app:e,appConfig:i,installations:n,analyticsProvider:r}}_delete(){return Promise.resolve()}}/**
|
|
* @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 wR(t){try{t.swRegistration=await navigator.serviceWorker.register(WP,{scope:HP}),t.swRegistration.update().catch(()=>{})}catch(e){throw Ht.create("failed-service-worker-registration",{browserErrorMessage:e==null?void 0:e.message})}}/**
|
|
* @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 _R(t,e){if(!e&&!t.swRegistration&&await wR(t),!(!e&&t.swRegistration)){if(!(e instanceof ServiceWorkerRegistration))throw Ht.create("invalid-sw-registration");t.swRegistration=e}}/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/async function xR(t,e){e?t.vapidKey=e:t.vapidKey||(t.vapidKey=vk)}/**
|
|
* @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 kk(t,e){if(!navigator)throw Ht.create("only-available-in-window");if(Notification.permission==="default"&&await Notification.requestPermission(),Notification.permission!=="granted")throw Ht.create("permission-blocked");return await xR(t,e==null?void 0:e.vapidKey),await _R(t,e==null?void 0:e.serviceWorkerRegistration),cR(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.
|
|
*/async function ER(t,e,n){const r=kR(e);(await t.firebaseDependencies.analyticsProvider.get()).logEvent(r,{message_id:n[wk],message_name:n[GP],message_time:n[QP],message_device_time:Math.floor(Date.now()/1e3)})}function kR(t){switch(t){case Wl.NOTIFICATION_CLICKED:return"notification_open";case Wl.PUSH_RECEIVED:return"notification_foreground";default:throw new Error}}/**
|
|
* @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 TR(t,e){const n=e.data;if(!n.isFirebaseMessaging)return;t.onMessageHandler&&n.messageType===Wl.PUSH_RECEIVED&&(typeof t.onMessageHandler=="function"?t.onMessageHandler(T0(n)):t.onMessageHandler.next(T0(n)));const r=n.data;gR(r)&&r[YP]==="1"&&await ER(t,n.messageType,r)}const b0="@firebase/messaging",S0="0.12.12";/**
|
|
* @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 bR=t=>{const e=new vR(t.getProvider("app").getImmediate(),t.getProvider("installations-internal").getImmediate(),t.getProvider("analytics-internal"));return navigator.serviceWorker.addEventListener("message",n=>TR(e,n)),e},SR=t=>{const e=t.getProvider("messaging").getImmediate();return{getToken:r=>kk(e,r)}};function IR(){ur(new Un("messaging",bR,"PUBLIC")),ur(new Un("messaging-internal",SR,"PRIVATE")),Sn(b0,S0),Sn(b0,S0,"esm2017")}/**
|
|
* @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 CR(){try{await G_()}catch{return!1}return typeof window<"u"&&K_()&&Rb()&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window&&"fetch"in window&&ServiceWorkerRegistration.prototype.hasOwnProperty("showNotification")&&PushSubscription.prototype.hasOwnProperty("getKey")}/**
|
|
* @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 AR(t=Im()){return CR().then(e=>{if(!e)throw Ht.create("unsupported-browser")},e=>{throw Ht.create("indexed-db-unsupported")}),ra(qe(t),"messaging").getImmediate()}async function NR(t,e){return t=qe(t),kk(t,e)}IR();const PR={apiKey:"AIzaSyBBitFgNKnJ_3B0aqJgbbhGL_erufKd9lk",authDomain:"mycloset1-864c4.firebaseapp.com",projectId:"mycloset1-864c4",storageBucket:"mycloset1-864c4.firebasestorage.app",messagingSenderId:"219982610263",appId:"1:219982610263:web:0ebe67d9cf0e7d2753c812"},Cg=J_(PR),Ga=oA(Cg),oe=H2(Cg),I0=typeof window<"u"?AR(Cg):null,ue="my-closet-app",Ve=({children:t,className:e="",darkMode:n,...r})=>c.jsx("div",{className:`rounded-[2rem] border transition-all duration-300 ${n?"bg-gray-800/40 border-gray-700/50 backdrop-blur-md":"bg-white/80 border-gray-200/50 backdrop-blur-md shadow-sm"} ${e}`,...r,children:t}),lu=({children:t,variant:e="default"})=>{const n={default:"bg-indigo-100 text-indigo-700 dark:bg-indigo-900/30 dark:text-indigo-300",success:"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-300",danger:"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-300",warning:"bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-300"};return c.jsx("span",{className:`px-3 py-1 rounded-full text-[10px] font-black uppercase tracking-widest whitespace-nowrap ${n[e]}`,children:t})},cu=({label:t,type:e="text",value:n,onChange:r,placeholder:i,required:s=!1,name:o,minLength:l,defaultValue:u})=>{const h=n!==void 0;return c.jsxs("div",{className:"flex flex-col gap-1 w-full",children:[t&&c.jsx("label",{className:"text-sm font-black uppercase tracking-widest opacity-40 ml-1",children:t}),c.jsx("input",{type:e,name:o,...h?{value:n}:{defaultValue:u},onChange:m=>r?r(m.target.value):null,placeholder:i,required:s,minLength:l,className:"w-full p-5 rounded-2xl border-none outline-none focus:ring-4 focus:ring-indigo-500/10 font-bold bg-gray-100 dark:bg-gray-700 text-inherit transition-all"})]})},C0={PT:{loginModeIntro:"O Futuro do Teu Estilo",emailPlaceholder:"E-mail",passwordPlaceholder:"Palavra-passe",loginBtn:"ENTRAR",registerBtn:"REGISTAR",createAccount:"Criar Conta",haveAccount:"Já tenho conta",authErrorDisabled:"Este método de login está desativado na base de dados.",forgotPassword:"Esqueceu-se da palavra-passe?",forgotPasswordPrompt:"Introduza o seu e-mail para recuperar a palavra-passe:",passwordResetSent:"E-mail de recuperação enviado! Verifique a sua caixa de entrada.",sendEmailBtn:"Enviar Email",dashboard:"Painel",closet:"Armário",laundry:"Lavandaria",outfits:"Outfits",settings:"Definições",online:"Online",away:"Ausente",offline:"Offline",dailyOutfit:"Outfit Diário",noOutfitPlanned:"Nenhum Outfit Planeado",goToPlanning:"Vá ao planeamento para adicionar",onlyFavorites:"Apenas Favoritos",logout:"Sair",overview:"Visão Geral",myCloset:"O Meu Armário",outfitsAndStyle:"Outfits",readyClothes:"Roupas Prontas",inLaundry:"Na Lavandaria",myLooks:"Meus Outfits",favorites:"Favoritos",todayIn:"Hoje em Portugal",weatherUpdate:"22°C - Ensolarado",weatherCurrentAvg:"{current}°C Atual • Média {avg}°C",registeredPieces:"Peças Registadas",createdOutfits:"Outfits Criados",accountRegistrationDate:"Data de Registo da Conta",keyboardShortcuts:"Atalhos de Teclado",enableNavigationQE:"Ativar navegação com Q e E",dailyOutfitNotification:"Notificação do Outfit Diário",receiveNotificationAtScheduledTime:"Receber notificação com o outfit planeado à hora marcada",up:"Cima",down:"Baixo",weatherForecastDesc:"O dia de hoje tem máximas de {max}°C e mínimas de {min}°C.",weatherMsg:"Está um dia fantástico! Recomendamos as tuas peças leves. Que tal um visual casual com as tuas sapatilhas favoritas?",exploreSuggestions:"Explorar Sugestões",topColors:"Top Cores",searchPlaceholder:"Procurar no meu guarda-roupa...",all:"Todos",tops:"Tops",bottoms:"Bottoms",footwear:"Calçado",coats:"Casacos",accessories:"Acessórios",edit:"Editar",makeDirty:"Lavar",moveToTrash:"Mover para Lixo",laundryBasket:"Cesto da Roupa",lookSentToLaundry:"Peças enviadas para a lavandaria!",laundryMsg:"Aqui encontras as peças que marcaste como sujas. Lava-as para que voltem ao armário principal.",washing:"A lavar",emptyBasket:"Cesto Vazio",createNewLook:"Criar Novo Outfit",lookName:"Nome do Outfit",selectedPieces:"Peças Selecionadas",selectPieces:"Seleciona peças...",saveLook:"Guardar Outfit",closetLabel:"Armário",lookHistory:"Histórico de Outfits",pieces:"Peças",newItem:"Novo Item",preview:"Preview",name:"Nome",category:"Categoria",color:"Cor",imageUrl:"URL da Imagem",cancel:"Cancelar",save:"Guardar",register:"Registar",yourAccount:"A Tua Conta",papMode:"Modo PAP",preferences:"Preferências",darkMode:"Modo Escuro",interfaceAppearance:"Aparência da interface",notifications:"Notificações",lookReminders:"Lembretes de outfits",weatherAlerts:"Alertas de Clima",weatherSuggestions:"Sugestões pelo tempo",systemAndData:"Sistema e Dados",appLanguage:"Idioma da Aplicação",portuguese:"Português (PT)",english:"English (EN)",spanish:"Español (ES)",french:"Français (FR)",german:"Deutsch (DE)",exportData:"Exportar Dados (JSON)",exportDataAlert:"Os teus dados seriam exportados agora em formato JSON.",privacyPolicy:"Política de Privacidade",recycleBin:"Reciclagem",empty:"Esvaziar",deleted:"Eliminado",criticalZone:"Zona Crítica",fullCleanActions:"Ações de limpeza total do armário.",clearAll:"Limpar Tudo",confirmDeletePerm:"Apagar permanentemente?",confirmDeleteLook:"Apagar este Outfit?",confirmEmptyTrash:"Esvaziar o lixo permanentemente?",confirmClearAll:"Mover todas as peças ativas para o lixo?",colorBlack:"Preto",colorWhite:"Branco",colorBlue:"Azul",colorRed:"Vermelho",colorGreen:"Verde",colorYellow:"Amarelo",colorPink:"Rosa",colorPurple:"Roxo",colorOrange:"Laranja",colorBrown:"Marrom",colorBeige:"Bege",colorGray:"Cinza",userTitle:"Utilizador",themeColor:"Cor do Tema",personalizeColor:"Personalizar a cor",advancedFilters:"Filtros",filterByColor:"Cor",filterByAge:"Idade da Peça",anyAge:"Qualquer Idade",lessThanMonth:"Menos de 1 Mês",lessThan6Months:"Menos de 6 Meses",lessThanYear:"Menos de 1 Ano",older:"Mais antigo",applyFilters:"Aplicar Filtros",profileInfo:"Informações da Conta",username:"Nome de Utilizador",fullName:"Nome Completo",dob:"Data de Nascimento",bio:"Bio / Sobre mim",optional:"(Opcional)",saving:"A guardar...",sections:"Secções",manageSections:"Gerir Secções",newSection:"Nova Secção",sectionName:"Nome da Secção",sectionEmoji:"Emoji",noSections:"Nenhuma secção criada ainda.",addSection:"Adicionar Secção",deleteSection:"Apagar",assignSections:"Atribuir a Secções",allSections:"Todas",confirmDeleteSection:"Apagar esta secção?",sectionPlaceholder:"Ex: Trabalho, Festa...",emojiPlaceholder:"Ex: 💼",createSection:"Criar Secção",noSectionsCreated:"Ainda não tem secções criadas",linkCopied:"Link copiado!",share:"Partilhar",piecesInLaundry:"peça(s) na lavandaria",toBeWashed:"A ser lavados",unavailable:"Indisponíveis",availableLooks:"Disponíveis",noLooksAvailable:"Nenhum outfit disponível",location:"Localidade",locationEx:"Ex: Lisboa, Portugal",ideaSuggestion:"Ideia / Sugestão",bugError:"Bug / Erro",writeMessage:"Escreva aqui a sua mensagem...",sendMessage:"Enviar Mensagem",notificationsModal:"Notificações",noNotifications:"Sem Notificações",markAllRead:"Marcar todas como lidas",lookCopiedBy:"copiou o seu outfit",userSavedLook:"guardou o seu outfit",inTheirCloset:"no armário dele!",sharedLookTitle:"Outfit Partilhado",sharedBy:"Partilhado por",includedPieces:"Peças incluídas",ignore:"Ignorar",copying:"A copiar...",copyToMyCloset:"Copiar para o meu armário",msgSentSuccess:"Mensagem enviada com sucesso!",msgSendError:"Erro ao enviar mensagem. Verifica a tua ligação.",wishlist:"Carrinho",addFuturePurchase:"Adicionar peça como compra futura",wishlistDesc:"Carrinho",someone:"alguém",feedbackTitle:"Suporte e Feedback",feedbackDesc:"Tem alguma ideia, sugestão ou encontrou algum problema? Envie uma mensagem diretamente para nós!",themeColorTitle:"Cor do Tema",personalizeColorDesc:"Personalize a cor",saveChanges:"Guardar Alterações",pasteLink:"Colar Link",pasteSharedLookLink:"Cole o link do outfit partilhado:",invalidSharedLink:"Link inválido. Certifique-se de copiar o link completo.",planning:"Planeamento",today:"Hoje",monthLabel:"Mês",weekLabel:"Semana",chooseOutfit:"Escolher Outfit",removeOutfitDay:"Remover Outfit deste Dia",noOutfitCreated:"Nenhum outfit criado",piecesShort:"peças",editLook:"Editar Outfit",uploadGallery:"Upload da Galeria / Ficheiros",selectOneColor:"Selecione pelo menos uma cor",addColorsToItems:"Adicione cores aos seus itens.",or:"OU",cardSize:"Tamanho dos itens",cardSizeDesc:"Tamanho no armário/carrinho",small:"Pequeno",medium:"Médio",large:"Grande",defaultPage:"Página Inicial",defaultPageDesc:"Página que aparece após o login",community:"Comunidade",searchUsers:"Procurar por @username...",privateProfile:"Perfil Privado",privateProfileDesc:"Ocultar armário de outros utilizadores",viewProfile:"Ver Perfil",noUsersFound:"Nenhum utilizador encontrado",isPrivateUser:"Este perfil é privado.",userOutfits:"Outfits do Utilizador",userCloset:"Armário",usernameTaken:"Este nome de utilizador já está em uso."},EN:{loginModeIntro:"The Future of Your Style",emailPlaceholder:"Email",passwordPlaceholder:"Password",loginBtn:"LOGIN",registerBtn:"REGISTER",createAccount:"Create Account",haveAccount:"I already have an account",authErrorDisabled:"This login method is disabled in the database.",forgotPassword:"Forgot password?",forgotPasswordPrompt:"Enter your email to reset your password:",passwordResetSent:"Password reset email sent! Check your inbox.",sendEmailBtn:"Send Email",dashboard:"Dashboard",closet:"Closet",laundry:"Laundry",outfits:"Outfits",settings:"Settings",online:"Online",away:"Away",offline:"Offline",dailyOutfit:"Daily Outfit",noOutfitPlanned:"No Outfit Planned",goToPlanning:"Go to planning to add one",onlyFavorites:"Favorites Only",logout:"Logout",overview:"Overview",myCloset:"My Closet",outfitsAndStyle:"Outfits & Style",readyClothes:"Ready Clothes",inLaundry:"In Laundry",myLooks:"My Outfits",favorites:"Favorites",todayIn:"Today in Portugal",weatherUpdate:"22°C - Sunny",weatherCurrentAvg:"{current}°C Current • Average {avg}°C",registeredPieces:"Registered Pieces",createdOutfits:"Created Outfits",accountRegistrationDate:"Account Registration Date",keyboardShortcuts:"Keyboard Shortcuts",enableNavigationQE:"Enable navigation with Q and E",dailyOutfitNotification:"Daily Outfit Notification",receiveNotificationAtScheduledTime:"Receive notification with the planned outfit at the scheduled time",up:"Up",down:"Down",weatherForecastDesc:"Today has highs of {max}°C and lows of {min}°C.",weatherMsg:"It's a fantastic day! We recommend your light pieces. How about a casual look with your favorite sneakers?",exploreSuggestions:"Explore Suggestions",topColors:"Top Colors",searchPlaceholder:"Search my wardrobe...",all:"All",tops:"Tops",bottoms:"Bottoms",footwear:"Footwear",coats:"Coats",accessories:"Accessories",edit:"Edit",makeDirty:"Make Dirty",moveToTrash:"Move to Trash",laundryBasket:"Laundry Basket",lookSentToLaundry:"Pieces sent to the laundry!",laundryMsg:"Here you find the pieces you marked as dirty. Wash them to return them to the main closet.",washing:"Washing",emptyBasket:"Empty Basket",createNewLook:"Create New Outfit",lookName:"Outfit Name",selectedPieces:"Selected Pieces",selectPieces:"Select pieces...",saveLook:"Save Outfit",closetLabel:"Closet",lookHistory:"Outfit History",pieces:"Pieces",newItem:"New Item",preview:"Preview",name:"Name",category:"Category",color:"Color",imageUrl:"Image URL",cancel:"Cancel",save:"Save",register:"Register",yourAccount:"Your Account",papMode:"PAP Mode",preferences:"Preferences",darkMode:"Dark Mode",interfaceAppearance:"Interface Appearance",notifications:"Notifications",lookReminders:"Outfit reminders",weatherAlerts:"Weather Alerts",weatherSuggestions:"Weather-based suggestions",systemAndData:"System and Data",appLanguage:"App Language",portuguese:"Português (PT)",english:"English (EN)",spanish:"Español (ES)",french:"Français (FR)",german:"Deutsch (DE)",exportData:"Export Data (JSON)",exportDataAlert:"Your data would be exported now in JSON format.",privacyPolicy:"Privacy Policy",recycleBin:"Recycle Bin",empty:"Empty",deleted:"Deleted",criticalZone:"Critical Zone",fullCleanActions:"Full closet wipe actions.",clearAll:"Clear All",confirmDeletePerm:"Delete permanently?",confirmDeleteLook:"Delete this Outfit?",confirmEmptyTrash:"Empty trash permanently?",confirmClearAll:"Move all active pieces to trash?",colorBlack:"Black",colorWhite:"White",colorBlue:"Blue",colorRed:"Red",colorGreen:"Green",colorYellow:"Yellow",colorPink:"Pink",colorPurple:"Purple",colorOrange:"Orange",colorBrown:"Brown",colorBeige:"Beige",colorGray:"Gray",userTitle:"User",themeColor:"Theme Color",personalizeColor:"Personalize the color",advancedFilters:"Filters",filterByColor:"Color",filterByAge:"Item Age",anyAge:"Any Age",lessThanMonth:"Less than 1 Month",lessThan6Months:"Less than 6 Months",lessThanYear:"Less than 1 Year",older:"Older",applyFilters:"Apply Filters",profileInfo:"Account Information",username:"Username",fullName:"Full Name",dob:"Date of Birth",bio:"Bio / About me",optional:"(Optional)",saving:"Saving...",sections:"Sections",manageSections:"Manage Sections",newSection:"New Section",sectionName:"Section Name",sectionEmoji:"Emoji",noSections:"No sections created yet.",addSection:"Add Section",deleteSection:"Delete",assignSections:"Assign to Sections",allSections:"All",confirmDeleteSection:"Delete this section?",sectionPlaceholder:"E.g.: Work, Party...",emojiPlaceholder:"E.g.: 💼",createSection:"Create Section",noSectionsCreated:"No sections created yet",linkCopied:"Link copied!",share:"Share",piecesInLaundry:"piece(s) in laundry",toBeWashed:"To be washed",unavailable:"Unavailable",availableLooks:"Available",noLooksAvailable:"No outfit available",location:"Location",locationEx:"E.g.: Lisbon, Portugal",ideaSuggestion:"Idea / Suggestion",bugError:"Bug / Error",writeMessage:"Write your message here...",sendMessage:"Send Message",notificationsModal:"Notifications",noNotifications:"No Notifications",markAllRead:"Mark all as read",lookCopiedBy:"copied your outfit",userSavedLook:"saved your outfit",inTheirCloset:"in their closet!",sharedLookTitle:"Shared Outfit",sharedBy:"Shared by",includedPieces:"Included Pieces",ignore:"Ignore",copying:"Copying...",copyToMyCloset:"Copy to my closet",msgSentSuccess:"Message sent successfully!",msgSendError:"Error sending message. Check your connection.",addFuturePurchase:"Add piece as future purchase",wishlist:"Wishlist",wishlistDesc:"Wishlist",someone:"someone",feedbackTitle:"Support and Feedback",feedbackDesc:"Do you have any ideas, suggestions, or found a problem? Send a message directly to us!",themeColorTitle:"Theme Color",personalizeColorDesc:"Personalize the color",saveChanges:"Save Changes",pasteLink:"Paste Link",pasteSharedLookLink:"Paste the shared outfit link:",invalidSharedLink:"Invalid link. Make sure you copied the full link.",planning:"Planning",today:"Today",monthLabel:"Month",weekLabel:"Week",chooseOutfit:"Choose Outfit",removeOutfitDay:"Remove Outfit from this Day",noOutfitCreated:"No outfit created",piecesShort:"pieces",editLook:"Edit Outfit",uploadGallery:"Upload from Gallery / Files",selectOneColor:"Select at least one color",addColorsToItems:"Add colors to your items.",or:"OR",cardSize:"Item Size",cardSizeDesc:"Size in closet/cart",small:"Small",medium:"Medium",large:"Large",defaultPage:"Home Page",defaultPageDesc:"Page that appears after login",community:"Community",searchUsers:"Search by @username...",privateProfile:"Private Profile",privateProfileDesc:"Hide closet from other users",viewProfile:"View Profile",noUsersFound:"No users found",isPrivateUser:"This profile is private.",userOutfits:"User's Outfits",userCloset:"Closet",usernameTaken:"This username is already taken."},ES:{loginModeIntro:"El Futuro de Tu Estilo",emailPlaceholder:"Correo electrónico",passwordPlaceholder:"Contraseña",loginBtn:"ENTRAR",registerBtn:"REGISTRAR",createAccount:"Crear Cuenta",haveAccount:"Ya tengo cuenta",authErrorDisabled:"Este método de inicio de sesión está desactivado en la base de datos.",forgotPassword:"¿Olvidaste tu contraseña?",forgotPasswordPrompt:"Introduce tu correo electrónico para recuperar la contraseña:",passwordResetSent:"¡Correo de recuperación enviado! Revisa tu bandeja de entrada.",sendEmailBtn:"Enviar Correo",dashboard:"Panel",closet:"Armario",laundry:"Lavandería",outfits:"Outfits",settings:"Ajustes",online:"En línea",away:"Ausente",offline:"Desconectado",dailyOutfit:"Outfit Diario",noOutfitPlanned:"Sin Outfit Planeado",goToPlanning:"Ve a planificación para añadir",onlyFavorites:"Solo Favoritos",logout:"Cerrar Sesión",overview:"Visión General",myCloset:"Mi Armario",outfitsAndStyle:"Outfits y Estilo",readyClothes:"Ropa Lista",inLaundry:"En la Lavandería",myLooks:"Mis Outfits",favorites:"Favoritos",todayIn:"Hoy en Portugal",weatherUpdate:"22°C - Soleado",weatherCurrentAvg:"{current}°C Actual • Media {avg}°C",registeredPieces:"Piezas Registradas",createdOutfits:"Outfits Creados",accountRegistrationDate:"Fecha de Registro de la Cuenta",keyboardShortcuts:"Atajos de Teclado",enableNavigationQE:"Habilitar navegación con Q y E",dailyOutfitNotification:"Notificación del Outfit Diario",receiveNotificationAtScheduledTime:"Recibir notificación con el outfit planeado a la hora programada",up:"Arriba",down:"Abajo",weatherForecastDesc:"El día de hoy tiene máximas de {max}°C y mínimas de {min}°C.",weatherMsg:"¡Es un día fantástico! Recomendamos tus piezas ligeras. ¿Qué tal un look casual con tus zapatillas favoritas?",exploreSuggestions:"Explorar Sugerencias",topColors:"Colores Principales",searchPlaceholder:"Buscar en mi guardarropa...",all:"Todos",tops:"Tops",bottoms:"Partes Inferiores",footwear:"Calzado",coats:"Abrigos",accessories:"Accesorios",edit:"Editar",makeDirty:"Ensuciar",moveToTrash:"Mover a la Papelera",laundryBasket:"Cesto de Ropa",lookSentToLaundry:"¡Piezas enviadas a la lavandería!",laundryMsg:"Aquí encuentras las piezas que marcaste como sucias. Lávalas para que vuelvan al armario principal.",washing:"Lavando",emptyBasket:"Cesto Vacío",createNewLook:"Crear Nuevo Outfit",lookName:"Nombre del Outfit",selectedPieces:"Piezas Seleccionadas",selectPieces:"Elige piezas...",saveLook:"Guardar Outfit",closetLabel:"Armario",lookHistory:"Historial de Outfits",pieces:"Piezas",newItem:"Nuevo Artículo",preview:"Vista Previa",name:"Nombre",category:"Categoría",color:"Color",imageUrl:"URL de la Imagen",cancel:"Cancelar",save:"Guardar",register:"Registrar",yourAccount:"Tu Cuenta",papMode:"Modo PAP",preferences:"Preferencias",darkMode:"Modo Oscuro",interfaceAppearance:"Apariencia de la interfaz",notifications:"Notificaciones",lookReminders:"Recordatorios de looks",weatherAlerts:"Alertas del Clima",weatherSuggestions:"Sugerencias por clima",systemAndData:"Sistema y Datos",appLanguage:"Idioma de la Aplicación",portuguese:"Português (PT)",english:"English (EN)",spanish:"Español (ES)",french:"Français (FR)",german:"Deutsch (DE)",exportData:"Exportar Datos (JSON)",exportDataAlert:"Tus datos se exportarían ahora en formato JSON.",privacyPolicy:"Política de Privacidad",recycleBin:"Papelera de Reciclaje",empty:"Vaciar",deleted:"Eliminado",criticalZone:"Zona Crítica",fullCleanActions:"Acciones de limpieza total.",clearAll:"Limpiar Todo",confirmDeletePerm:"¿Borrar permanentemente?",confirmDeleteLook:"¿Borrar este Outfit?",confirmEmptyTrash:"¿Vaciar la papelera permanentemente?",confirmClearAll:"¿Mover todas las piezas activas a la papelera?",colorBlack:"Negro",colorWhite:"Blanco",colorBlue:"Azul",colorRed:"Rojo",colorGreen:"Verde",colorYellow:"Amarillo",colorPink:"Rosa",colorPurple:"Morado",colorOrange:"Naranja",colorBrown:"Marrón",colorBeige:"Beige",colorGray:"Gris",userTitle:"Usuario",themeColor:"Color del Tema",personalizeColor:"Personaliza el color",advancedFilters:"Filtros",filterByColor:"Color",filterByAge:"Edad de la Prenda",anyAge:"Cualquier Edad",lessThanMonth:"Menos de 1 Mes",lessThan6Months:"Menos de 6 Meses",lessThanYear:"Menos de 1 Año",older:"Más Antiguo",applyFilters:"Aplicar Filtros",profileInfo:"Información de la Cuenta",username:"Nombre de Usuario",fullName:"Nombre Completo",dob:"Fecha de Nacimiento",bio:"Bio / Sobre mí",optional:"(Opcional)",saving:"Guardando...",sections:"Secciones",manageSections:"Gestionar Secciones",newSection:"Nueva Sección",sectionName:"Nombre de la Sección",sectionEmoji:"Emoji",noSections:"Aún no hay secciones creadas.",addSection:"Añadir Sección",deleteSection:"Eliminar",assignSections:"Asignar a Secciones",allSections:"Todas",confirmDeleteSection:"¿Eliminar esta sección?",sectionPlaceholder:"Ej: Trabajo, Fiesta...",emojiPlaceholder:"Ej: 💼",createSection:"Crear Sección",noSectionsCreated:"Aún no hay secciones creadas",linkCopied:"¡Enlace copiado!",share:"Compartir",piecesInLaundry:"pieza(s) en la lavandería",toBeWashed:"Por lavar",unavailable:"No disponibles",availableLooks:"Disponibles",noLooksAvailable:"Ningún outfit disponible",location:"Ubicación",locationEx:"Ej: Lisboa, Portugal",ideaSuggestion:"Idea / Sugerencia",bugError:"Error / Fallo",writeMessage:"Escribe aquí tu mensaje...",sendMessage:"Enviar Mensaje",notificationsModal:"Notificaciones",noNotifications:"Sin Notificaciones",markAllRead:"Marcar todas como leídas",lookCopiedBy:"copió tu outfit",userSavedLook:"guardó tu outfit",inTheirCloset:"en su armario!",sharedLookTitle:"Outfit Compartido",sharedBy:"Compartido por",includedPieces:"Piezas incluidas",ignore:"Ignorar",copying:"Copiando...",copyToMyCloset:"Copiar a mi armario",msgSentSuccess:"¡Mensaje enviado con éxito!",msgSendError:"Error al enviar. Revisa tu conexión.",addFuturePurchase:"Añadir pieza como compra futura",wishlist:"Lista de Deseos",wishlistDesc:"Lista de Deseos",someone:"alguien",feedbackTitle:"Soporte y Comentarios",feedbackDesc:"¿Tienes alguna idea, sugerencia o encontraste un problema? ¡Envíanos un mensaje directamente!",themeColorTitle:"Color del Tema",personalizeColorDesc:"Personaliza el color",saveChanges:"Guardar Cambios",pasteLink:"Pegar Enlace",pasteSharedLookLink:"Pega el enlace del outfit compartido:",invalidSharedLink:"Enlace no válido. Asegúrate de copiar el enlace completo.",planning:"Planificación",today:"Hoy",monthLabel:"Mes",weekLabel:"Semana",chooseOutfit:"Elegir Outfit",removeOutfitDay:"Quitar Outfit de este Día",noOutfitCreated:"Ningún outfit creado",piecesShort:"piezas",editLook:"Editar Outfit",uploadGallery:"Subir desde la Galería / Archivos",selectOneColor:"Selecciona al menos un color",addColorsToItems:"Añade colores a tus artículos.",or:"O",cardSize:"Tamaño de los ítems",cardSizeDesc:"Tamaño en armario/carrito",small:"Pequeño",medium:"Medio",large:"Grande",defaultPage:"Página de Inicio",defaultPageDesc:"Página que aparece después de iniciar sesión",community:"Comunidad",searchUsers:"Buscar por @username...",privateProfile:"Perfil Privado",privateProfileDesc:"Ocultar armario de otros usuarios",viewProfile:"Ver Perfil",noUsersFound:"Ningún usuario encontrado",isPrivateUser:"Este perfil es privado.",userOutfits:"Outfits del Usuario",userCloset:"Armario",usernameTaken:"Este nombre de usuario ya está en uso."},FR:{loginModeIntro:"Le Futur de Ton Style",emailPlaceholder:"E-mail",passwordPlaceholder:"Mot de passe",loginBtn:"CONNEXION",registerBtn:"S'INSCRIRE",createAccount:"Créer un Compte",haveAccount:"J'ai déjà un compte",authErrorDisabled:"Cette méthode de connexion est désactivée dans la base de données.",forgotPassword:"Mot de passe oublié ?",forgotPasswordPrompt:"Entrez votre e-mail pour réinitialiser votre mot de passe :",passwordResetSent:"E-mail de réinitialisation envoyé ! Vérifiez votre boîte de réception.",sendEmailBtn:"Envoyer l'E-mail",dashboard:"Tableau de bord",closet:"Placard",laundry:"Blanchisserie",outfits:"Tenues",settings:"Paramètres",online:"En ligne",away:"Absent",offline:"Hors ligne",dailyOutfit:"Tenue du Jour",noOutfitPlanned:"Aucune Tenue Prévue",goToPlanning:"Allez dans planification pour ajouter",onlyFavorites:"Favoris Uniquement",logout:"Déconnexion",overview:"Vue d'ensemble",myCloset:"Mon Placard",outfitsAndStyle:"Tenues & Style",readyClothes:"Vêtements Prêts",inLaundry:"À la Blanchisserie",myLooks:"Mes Outfits",favorites:"Favoris",todayIn:"Aujourd'hui au Portugal",weatherUpdate:"22°C - Ensoleillé",weatherCurrentAvg:"{current}°C Actuel • Moyenne {avg}°C",registeredPieces:"Pièces Enregistrées",createdOutfits:"Outfits Créés",accountRegistrationDate:"Date d'Inscription du Compte",keyboardShortcuts:"Raccourcis Clavier",enableNavigationQE:"Activer la navigation avec Q et E",dailyOutfitNotification:"Notification de Tenue Quotidienne",receiveNotificationAtScheduledTime:"Recevoir une notification avec la tenue prévue à l'heure programmée",up:"Haut",down:"Bas",weatherForecastDesc:"Aujourd'hui a des maximales de {max}°C et des minimales de {min}°C.",weatherMsg:"C'est une journée fantastique ! Nous recommandons vos pièces légères. Que diriez-vous d'un look décontracté avec vos baskets préférées ?",exploreSuggestions:"Explorer les Suggestions",topColors:"Couleurs Principales",searchPlaceholder:"Chercher dans ma garde-robe...",all:"Tout",tops:"Hauts",bottoms:"Bas",footwear:"Chaussures",coats:"Manteaux",accessories:"Accessoires",edit:"Modifier",makeDirty:"Salir",moveToTrash:"Mettre à la corbeille",laundryBasket:"Panier à linge",lookSentToLaundry:"Pièces envoyées à la blanchisserie !",laundryMsg:"Ici vous trouvez les pièces que vous avez marquées comme sales. Lavez-les pour les remettre dans le placard principal.",washing:"En lavage",emptyBasket:"Panier Vide",createNewLook:"Créer un Nouvel Outfit",lookName:"Nom de l'Outfit",selectedPieces:"Pièces Sélectionnées",selectPieces:"Sélectionnez des pièces...",saveLook:"Enregistrer l'Outfit",closetLabel:"Placard",lookHistory:"Historique des Outfits",pieces:"Pièces",newItem:"Nouvel Article",preview:"Aperçu",name:"Nom",category:"Catégorie",color:"Couleur",imageUrl:"URL de l'image",cancel:"Annuler",save:"Enregistrer",register:"S'inscrire",yourAccount:"Votre Compte",papMode:"Mode PAP",preferences:"Préférences",darkMode:"Mode Sombre",interfaceAppearance:"Apparence de l'interface",notifications:"Notifications",lookReminders:"Rappels d'outfits",weatherAlerts:"Alertes Météo",weatherSuggestions:"Suggestions selon la météo",systemAndData:"Système et Données",appLanguage:"Langue de l'application",portuguese:"Português (PT)",english:"English (EN)",spanish:"Español (ES)",french:"Français (FR)",german:"Deutsch (DE)",exportData:"Exporter les Données (JSON)",exportDataAlert:"Vos données seraient exportées maintenant au format JSON.",privacyPolicy:"Politique de Confidentialité",recycleBin:"Corbeille",empty:"Vider",deleted:"Supprimé",criticalZone:"Zone Critique",fullCleanActions:"Actions de nettoyage total.",clearAll:"Tout Effacer",confirmDeletePerm:"Supprimer définitivement ?",confirmDeleteLook:"Supprimer cet Outfit ?",confirmEmptyTrash:"Vider la corbeille définitivement ?",confirmClearAll:"Déplacer toutes les pièces actives vers la corbeille ?",colorBlack:"Noir",colorWhite:"Blanc",colorBlue:"Bleu",colorRed:"Rouge",colorGreen:"Vert",colorYellow:"Jaune",colorPink:"Rose",colorPurple:"Violet",colorOrange:"Orange",colorBrown:"Marron",colorBeige:"Beige",colorGray:"Gris",userTitle:"Utilisateur",themeColor:"Couleur du Thème",personalizeColor:"Personnaliser la couleur",advancedFilters:"Filtres",filterByColor:"Couleur",filterByAge:"Âge de l'article",anyAge:"Tout âge",lessThanMonth:"Moins d'un mois",lessThan6Months:"Moins de 6 mois",lessThanYear:"Moins d'un an",older:"Plus ancien",applyFilters:"Appliquer les filtres",profileInfo:"Informations du Compte",username:"Nom d'utilisateur",fullName:"Nom Complet",dob:"Date de Naissance",bio:"Bio / À propos",optional:"(Optionnel)",saving:"Enregistrement...",sections:"Sections",manageSections:"Gérer les Sections",newSection:"Nouvelle Section",sectionName:"Nom de la Section",sectionEmoji:"Emoji",noSections:"Aucune section créée pour l'instant.",addSection:"Ajouter une Section",deleteSection:"Supprimer",assignSections:"Attribuer aux Sections",allSections:"Toutes",confirmDeleteSection:"Supprimer cette section ?",sectionPlaceholder:"Ex: Travail, Fête...",emojiPlaceholder:"Ex: 💼",createSection:"Créer une Section",noSectionsCreated:"Aucune section créée",linkCopied:"Lien copié !",share:"Partager",piecesInLaundry:"pièce(s) à la blanchisserie",toBeWashed:"À laver",unavailable:"Indisponibles",availableLooks:"Disponibles",noLooksAvailable:"Aucun outfit disponible",location:"Emplacement",locationEx:"Ex: Lisbonne, Portugal",ideaSuggestion:"Idée / Suggestion",bugError:"Bug / Erreur",writeMessage:"Écrivez votre message ici...",sendMessage:"Envoyer le Message",notificationsModal:"Notifications",noNotifications:"Aucune Notification",markAllRead:"Tout marquer comme lu",lookCopiedBy:"a copié votre outfit",userSavedLook:"a sauvegardé votre outfit",inTheirCloset:"dans son placard !",sharedLookTitle:"Outfit Partagé",sharedBy:"Partagé par",includedPieces:"Pièces incluses",ignore:"Ignorer",copying:"Copie en cours...",copyToMyCloset:"Copier dans mon placard",msgSentSuccess:"Message envoyé avec succès !",msgSendError:"Erreur d'envoi. Vérifiez votre connexion.",addFuturePurchase:"Ajouter comme achat futur",wishlist:"Liste de Souhaits",wishlistDesc:"Liste de Souhaits",someone:"quelqu'un",feedbackTitle:"Support et Commentaires",feedbackDesc:"Avez-vous des idées, des suggestions ou trouvé un problème ? Envoyez-nous un message directement !",themeColorTitle:"Couleur du Thème",personalizeColorDesc:"Personnaliser la couleur",saveChanges:"Enregistrer les Modifications",pasteLink:"Coller le Lien",pasteSharedLookLink:"Collez le lien de l'outfit partagé :",invalidSharedLink:"Lien invalide. Assurez-vous d'avoir copié le lien complet.",planning:"Planification",today:"Aujourd'hui",monthLabel:"Mois",weekLabel:"Semaine",chooseOutfit:"Choisir un Outfit",removeOutfitDay:"Retirer l'Outfit de ce Jour",noOutfitCreated:"Aucun outfit créé",piecesShort:"pièces",editLook:"Modifier l'Outfit",uploadGallery:"Télécharger depuis la Galerie / Fichiers",selectOneColor:"Sélectionnez au moins une couleur",addColorsToItems:"Ajoutez des couleurs à vos articles.",or:"OU",cardSize:"Taille des articles",cardSizeDesc:"Taille dans placard/panier",small:"Petit",medium:"Moyen",large:"Grand",defaultPage:"Page d'Accueil",defaultPageDesc:"Page qui apparaît après la connexion",community:"Communauté",searchUsers:"Rechercher par @username...",privateProfile:"Profil Privé",privateProfileDesc:"Cacher le placard aux autres utilisateurs",viewProfile:"Voir le Profil",noUsersFound:"Aucun utilisateur trouvé",isPrivateUser:"Ce profil est privé.",userOutfits:"Outfits de l'Utilisateur",userCloset:"Placard",usernameTaken:"Ce nom d'utilisateur est déjà utilisé."},DE:{loginModeIntro:"Die Zukunft deines Stils",emailPlaceholder:"E-Mail",passwordPlaceholder:"Passwort",loginBtn:"ANMELDEN",registerBtn:"REGISTRIEREN",createAccount:"Konto Erstellen",haveAccount:"Ich habe bereits ein Konto",authErrorDisabled:"Diese Anmeldemethode ist in der Datenbank deaktiviert.",forgotPassword:"Passwort vergessen?",forgotPasswordPrompt:"Gib deine E-Mail-Adresse ein, um dein Passwort zurückzusetzen:",passwordResetSent:"E-mail zum Zurücksetzen des Passworts gesendet! Überprüfe deinen Posteingang.",sendEmailBtn:"E-Mail Senden",dashboard:"Startseite",closet:"Schrank",laundry:"Wäsche",outfits:"Outfits",settings:"Einstellungen",online:"Online",away:"Abwesend",offline:"Offline",dailyOutfit:"Tägliches Outfit",noOutfitPlanned:"Kein Outfit Geplant",goToPlanning:"Gehen Sie zur Planung, um eins hinzuzufügen",onlyFavorites:"Nur Favoriten",logout:"Abmelden",overview:"Übersicht",myCloset:"Mein Schrank",outfitsAndStyle:"Outfits & Stil",readyClothes:"Fertige Kleidung",inLaundry:"In der Wäsche",myLooks:"Meine Outfits",favorites:"Favoriten",todayIn:"Heute in Portugal",weatherUpdate:"22°C - Sonnig",weatherCurrentAvg:"{current}°C Aktuell • Durchschnitt {avg}°C",registeredPieces:"Registrierte Stücke",createdOutfits:"Erstellte Outfits",accountRegistrationDate:"Konto-Registrierungsdatum",keyboardShortcuts:"Tastenkombinationen",enableNavigationQE:"Navigation mit Q und E aktivieren",dailyOutfitNotification:"Tägliche Outfit-Benachrichtigung",receiveNotificationAtScheduledTime:"Benachrichtigung mit dem geplanten Outfit zur geplanten Zeit erhalten",up:"Oben",down:"Unten",weatherForecastDesc:"Der heutige Tag hat Höchstwerte von {max}°C und Tiefstwerte von {min}°C.",weatherMsg:"Es ist ein fantastischer Tag! Wir empfehlen leichte Stücke. Wie wäre es mit einem lässigen Look mit deinen Lieblings-Sneakern?",exploreSuggestions:"Vorschläge entdecken",topColors:"Top Farben",searchPlaceholder:"In meiner Garderobe suchen...",all:"Alle",tops:"Oberteile",bottoms:"Unterteile",footwear:"Schuhe",coats:"Mäntel",accessories:"Accessoires",edit:"Bearbeiten",makeDirty:"Schmutzig machen",moveToTrash:"In den Papierkorb verschieben",laundryBasket:"Wäschekorb",lookSentToLaundry:"Stücke in die Wäsche geschickt!",laundryMsg:"Hier findest du die Stücke, die du als schmutzig markiert hast. Wasche sie, um sie in den Hauptschrank zurückzulegen.",washing:"Waschen",emptyBasket:"Leerer Korb",createNewLook:"Neues Outfit erstellen",lookName:"Outfit Name",selectedPieces:"Ausgewählte Stücke",selectPieces:"Stücke auswählen...",saveLook:"Outfit speichern",closetLabel:"Schrank",lookHistory:"Outfit-Verlauf",pieces:"Stücke",newItem:"Neuer Artikel",preview:"Vorschau",name:"Name",category:"Kategorie",color:"Farbe",imageUrl:"Bild-URL",cancel:"Abbrechen",save:"Speichern",register:"Registrieren",yourAccount:"Dein Konto",papMode:"PAP-Modus",preferences:"Präferenzen",darkMode:"Dunkelmodus",interfaceAppearance:"Erscheinungsbild der Schnittstelle",notifications:"Benachrichtigungen",lookReminders:"Outfit-Erinnerungen",weatherAlerts:"Wetterwarnungen",weatherSuggestions:"Wetterbasierte Vorschläge",systemAndData:"System und Daten",appLanguage:"App-Sprache",portuguese:"Português (PT)",english:"English (EN)",spanish:"Español (ES)",french:"Français (FR)",german:"Deutsch (DE)",exportData:"Daten exportieren (JSON)",exportDataAlert:"Deine Daten würden jetzt im JSON-Format exportiert werden.",privacyPolicy:"Datenschutzrichtlinie",recycleBin:"Papierkorb",empty:"Leeren",deleted:"Gelöscht",criticalZone:"Kritische Zone",fullCleanActions:"Aktionen zur vollständigen Bereinigung.",clearAll:"Alles löschen",confirmDeletePerm:"Dauerhaft löschen?",confirmDeleteLook:"Dieses Outfit löschen?",confirmEmptyTrash:"Papierkorb dauerhaft leeren?",confirmClearAll:"Alle aktiven Stücke in den Papierkorb verschieben?",colorBlack:"Schwarz",colorWhite:"Weiß",colorBlue:"Blau",colorRed:"Rot",colorGreen:"Grün",colorYellow:"Gelb",colorPink:"Rosa",colorPurple:"Lila",colorOrange:"Orange",colorBrown:"Braun",colorBeige:"Beige",colorGray:"Grau",userTitle:"Benutzer",themeColor:"Themenfarbe",personalizeColor:"Farbe anpassen",advancedFilters:"Filter",filterByColor:"Farbe",filterByAge:"Artikelalter",anyAge:"Jedes Alter",lessThanMonth:"Weniger als 1 Monat",lessThan6Months:"Weniger als 6 Monate",lessThanYear:"Weniger als 1 Jahr",older:"Älter",applyFilters:"Filter anwenden",profileInfo:"Kontoinformationen",username:"Benutzername",fullName:"Vollständiger Name",dob:"Geburtsdatum",bio:"Biografie / Über mich",optional:"(Optional)",saving:"Speichern...",sections:"Bereiche",manageSections:"Bereiche verwalten",newSection:"Neuer Bereich",sectionName:"Bereichsname",sectionEmoji:"Emoji",noSections:"Noch keine Bereiche erstellt.",addSection:"Bereich hinzufügen",deleteSection:"Löschen",assignSections:"Bereichen zuweisen",allSections:"Alle",confirmDeleteSection:"Diesen Bereich löschen?",sectionPlaceholder:"Zb: Arbeit, Party...",emojiPlaceholder:"Zb: 💼",createSection:"Bereich erstellen",noSectionsCreated:"Noch keine Bereiche erstellt",linkCopied:"Link kopiert!",share:"Teilen",piecesInLaundry:"Stück(e) in der Wäsche",toBeWashed:"Zum Waschen",unavailable:"Nicht verfügbar",availableLooks:"Verfügbar",noLooksAvailable:"Kein Outfit verfügbar",location:"Ort",locationEx:"Z.B.: Lissabon, Portugal",ideaSuggestion:"Idee / Vorschlag",bugError:"Fehler / Bug",writeMessage:"Schreibe hier deine Nachricht...",sendMessage:"Nachricht Senden",notificationsModal:"Benachrichtigungen",noNotifications:"Keine Benachrichtigungen",markAllRead:"Alle als gelesen markieren",lookCopiedBy:"hat dein Outfit kopiert",userSavedLook:"hat dein Outfit gespeichert",inTheirCloset:"in seinem Schrank!",sharedLookTitle:"Geteiltes Outfit",sharedBy:"Geteilt von",includedPieces:"Enthaltene Stücke",ignore:"Ignorieren",copying:"Kopieren...",copyToMyCloset:"In meinen Schrank kopieren",msgSentSuccess:"Nachricht erfolgreich gesendet!",msgSendError:"Fehler beim Senden. Überprüfe deine Verbindung.",addFuturePurchase:"Als zukünftigen Kauf hinzufügen",wishlist:"Wunschzettel",wishlistDesc:"Wunschzettel",someone:"jemand",feedbackTitle:"Support und Feedback",feedbackDesc:"Hast du Ideen, Vorschläge oder ein Problem gefunden? Sende uns direkt eine Nachricht!",themeColorTitle:"Themenfarbe",personalizeColorDesc:"Farbe anpassen",saveChanges:"Änderungen Speichern",pasteLink:"Link Einfügen",pasteSharedLookLink:"Fügen Sie den Link zum geteilten Outfit ein:",invalidSharedLink:"Ungültiger Link. Stellen Sie sicher, dass Sie den vollständigen Link kopiert haben.",planning:"Planung",today:"Heute",monthLabel:"Monat",weekLabel:"Woche",chooseOutfit:"Outfit Wählen",removeOutfitDay:"Outfit von diesem Tag entfernen",noOutfitCreated:"Kein Outfit erstellt",piecesShort:"Stücke",editLook:"Outfit bearbeiten",uploadGallery:"Aus Galerie / Dateien hochladen",selectOneColor:"Wählen Sie mindestens eine Farbe",addColorsToItems:"Fügen Sie Ihren Artikeln Farben hinzu.",or:"ODER",cardSize:"Artikelgröße",cardSizeDesc:"Größe in Schrank/Warenkorb",small:"Klein",medium:"Mittel",large:"Groß",defaultPage:"Startseite",defaultPageDesc:"Seite, die nach der Anmeldung angezeigt wird",community:"Gemeinschaft",searchUsers:"Nach @username suchen...",privateProfile:"Privates Profil",privateProfileDesc:"Kleiderschrank vor anderen Benutzern verbergen",viewProfile:"Profil anzeigen",noUsersFound:"Keine Benutzer gefunden",isPrivateUser:"Dieses Profil ist privat.",userOutfits:"Outfits des Benutzers",userCloset:"Kleiderschrank",usernameTaken:"Dieser Benutzername ist bereits vergeben."}};function RR(){var a,d,f,y,P,O,Q,Ee,tt,ge,ot,at,Sr,Zt,rs,lo,Ag,Ng,Pg;const[t,e]=q.useState("auth"),[n,r]=q.useState(null),[i,s]=q.useState(!0),[o,l]=q.useState([]),[u,h]=q.useState([]),[m,v]=q.useState(null),[g,N]=q.useState(!1),[j,L]=q.useState(""),[B,I]=q.useState(""),[k,C]=q.useState([]),[V,G]=q.useState(window.innerWidth>768),[H,T]=q.useState("login"),[w,E]=q.useState(""),[S,A]=q.useState(!1),[R,b]=q.useState(""),[Xe,An]=q.useState("Todos"),[Qt,Yt]=q.useState(""),[Y,ae]=q.useState("any"),[se,Ce]=q.useState(!1),[Te,Ae]=q.useState(!1),[Qe,At]=q.useState([]),[Oe,Jt]=q.useState(null),[F,ca]=q.useState({}),[Bi,Xr]=q.useState(!1),[$i,qi]=q.useState(!0),[$n,Ls]=q.useState("08:00"),[pr,mc]=q.useState(!1),[ua,Ms]=q.useState(""),[Zr,Vs]=q.useState(!0),[yt,ei]=q.useState("PT"),[da,Wi]=q.useState(!1),[He,Ze]=q.useState("theme-indigo"),[Nn,ha]=q.useState("large"),[gc,fa]=q.useState("dashboard"),[vt,pa]=q.useState(null),[Fs,Us]=q.useState(!1),[mr,yc]=q.useState(!1),[ti,ma]=q.useState("online"),[Hi,ni]=q.useState(""),[gr,zs]=q.useState(!1),[qn,Ki]=q.useState([]),[Ue,ga]=q.useState(null),[et,Bs]=q.useState(null),[wt,Gi]=q.useState(!1),[Xt,ri]=q.useState([]),[ya,vc]=q.useState([]),[an,$s]=q.useState(null),[ii,yr]=q.useState(null),va=q.useRef(""),[ft,vr]=q.useState(null),[Wn,Qi]=q.useState(!1),[wa,qs]=q.useState(!1),[Yi,_a]=q.useState(null),[gn,wc]=q.useState([]),[Nt,Ws]=q.useState("all"),[xa,yn]=q.useState(!1),[vn,Hs]=q.useState(""),[sh,_c]=q.useState(""),[wr,Ks]=q.useState([]),[Hn,Ji]=q.useState([]),[Gs,Qs]=q.useState(null),[Ys,Ea]=q.useState(""),[xc,ka]=q.useState(""),[_r,xr]=q.useState([]),[Pn,si]=q.useState(!1),[Xi,Le]=q.useState(null),[_e,Js]=q.useState("month"),[Rn,Er]=q.useState(new Date),[Zi,Ec]=q.useState([]),[oh,Ta]=q.useState(!1),[ah,Xs]=q.useState(!1),[wn,Kn]=q.useState(null),_=p=>{var x;return((x=C0[yt])==null?void 0:x[p])||C0.PT[p]||p},kc={Vermelho:"#ef4444",Azul:"#3b82f6",Amarelo:"#eab308",Verde:"#22c55e",Laranja:"#f97316",Roxo:"#a855f7",Branco:"#f8fafc",Preto:"#0f172a",Cinzento:"#6b7280",Bege:"#d4b896"},Tc=p=>{if(!p)return{backgroundColor:"#e5e7eb"};const D=p.split(",").map(z=>z.trim()).filter(Boolean).map(z=>kc[z]||z.toLowerCase());return D.length===1?{backgroundColor:D[0]}:{background:`linear-gradient(135deg, ${D.join(", ")})`}},Ke=async(p,x)=>{if(n)try{const D=Ne(oe,"artifacts",ue,"users",n.uid,"profile","data");if(await os(D,{settings:{[p]:x}},{merge:!0}),p==="isPrivate"){const z=Ne(oe,"artifacts",ue,"publicProfiles",n.uid);await os(z,{isPrivate:x,uid:n.uid},{merge:!0})}}catch(D){console.error("Error saving setting:",D)}},ba=p=>{N(p),Ke("darkMode",p)},lh=p=>{Ze(p),Ke("theme",p)},ch=p=>{ei(p),Ke("language",p),Wi(!1)},Gn=p=>{qi(p),Ke("notificationsEnabled",p)},uh=async p=>{if(p)if("Notification"in window){if(await Notification.requestPermission()!=="granted"){alert("Permissão recusada. Ative as notificações no browser para usar esta funcionalidade.");return}if(I0)try{const D="BM55REBdX3g7x4JT7C6sN0uBDLATqsCnvgvx3mJnVmgU2dFvZL1przcV-V-Kl50Ao6-i8OA-5PZFWTuhETL9-v4";if(D){const z=await NR(I0,{vapidKey:D});z&&Ke("fcmToken",z)}}catch(D){console.error("Erro ao obter token FCM:",D)}}else{alert("O seu browser não suporta notificações.");return}mc(p),Ke("dailyOutfitNotifEnabled",p)},dh=p=>{Vs(p),Ke("weatherAlerts",p)},Zs=p=>{ha(p),Ke("cardSize",p)},eo=p=>{fa(p),Ke("defaultPage",p)},bc=p=>{Us(p),Ke("isPrivate",p)},es=p=>{yc(p),Ke("shortcutsEnabled",p)},Qn=p=>{const x=["dashboard","closet","wishlist","laundry","outfits","planner","community","settings"],D=x.indexOf(t);if(D===-1)return;let z;p==="up"?z=D===0?x.length-1:D-1:z=D===x.length-1?0:D+1,e(x[z]),window.innerWidth<768&&G(!1)},Sc=p=>{p.stopPropagation(),p.preventDefault();const x=["online","away","offline"],D=x.indexOf(ti),z=x[(D+1)%x.length];ma(z),Ke("status",z)},to=async p=>{if(p)try{const x=Ne(oe,"artifacts",ue,"sharedLooks",p),D=await of(x);D.exists()&&(vr({id:D.id,...D.data()}),Qi(!0),window.history.replaceState({},"",window.location.pathname))}catch(x){console.error("Erro ao buscar look partilhado:",x)}},Me=()=>{const p=window.prompt(_("pasteSharedLookLink")||"Cole o link do look partilhado:");if(p)try{const D=new URL(p).searchParams.get("shared");D?to(D):alert(_("invalidSharedLink")||"Link inválido. Certifique-se de copiar o link completo.")}catch{alert(_("invalidSharedLink")||"Link inválido. Certifique-se de copiar o link completo.")}};q.useEffect(()=>{if(!mr)return;const p=x=>{x.target.tagName==="INPUT"||x.target.tagName==="TEXTAREA"||(x.key.toLowerCase()==="q"?Qn("up"):x.key.toLowerCase()==="e"&&Qn("down"))};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[mr,t]),q.useEffect(()=>{m&&m.color?C(m.color.split(",").map(p=>p.trim()).filter(Boolean)):C([]),Ks((m==null?void 0:m.sections)||[])},[m]),q.useEffect(()=>{const p=()=>{window.innerWidth<768?G(!1):G(!0)};return window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[]),q.useEffect(()=>{Ji((Oe==null?void 0:Oe.sections)||[])},[Oe]),q.useEffect(()=>{document.documentElement.classList.remove("theme-indigo","theme-rose","theme-emerald","theme-amber","theme-slate");const p=t==="auth"?"theme-indigo":He;document.documentElement.classList.add(p),t!=="auth"&&(n!=null&&n.uid)&&localStorage.setItem(`app-theme-${n.uid}`,He)},[He,t,n==null?void 0:n.uid]),q.useEffect(()=>{(async()=>{})();const x=GI(Ga,async D=>{if(!D)r(null),l([]),h([]),wc([]),ca({}),N(!1),Ze("theme-indigo"),ei("PT"),qi(!0),Vs(!0),pa(null),e("auth"),s(!1);else{const z=localStorage.getItem(`app-theme-${D.uid}`)||"theme-indigo";Ze(z),r(D);try{const J=Ne(oe,"artifacts",ue,"users",D.uid,"profile","data"),te=await of(J);let X="dashboard";if(te.exists()){const ne=te.data();ne.settings&&ne.settings.defaultPage&&(X=ne.settings.defaultPage==="planning"?"planner":ne.settings.defaultPage,fa(X))}e(X)}catch{e("dashboard")}const M=va.current||new URLSearchParams(window.location.search).get("shared");va.current="",M&&to(M),s(!1)}});return()=>x()},[]),q.useEffect(()=>{if(!n)return;const p=nt(oe,"artifacts",ue,"users",n.uid,"clothes"),x=fo(p,Ie=>{l(Ie.docs.map(K=>({id:K.id,...K.data()})))},Ie=>console.error(Ie)),D=nt(oe,"artifacts",ue,"users",n.uid,"looks"),z=fo(D,Ie=>{h(Ie.docs.map(K=>({id:K.id,...K.data()})))},Ie=>console.error(Ie)),M=nt(oe,"artifacts",ue,"users",n.uid,"sections"),J=fo(M,Ie=>{wc(Ie.docs.map(K=>({id:K.id,...K.data()})).sort((K,Pt)=>K.createdAt-Pt.createdAt))},Ie=>console.error(Ie)),te=nt(oe,"artifacts",ue,"users",n.uid,"outfitPlans"),X=fo(te,Ie=>{Ec(Ie.docs.map(K=>({id:K.id,...K.data()})))},Ie=>console.error(Ie)),ne=Ne(oe,"artifacts",ue,"users",n.uid,"profile","data"),ke=fo(ne,Ie=>{if(Ie.exists()){const K=Ie.data();ca(K),K.settings&&(K.settings.language!==void 0&&ei(K.settings.language),K.settings.darkMode!==void 0&&N(K.settings.darkMode),K.settings.theme!==void 0&&Ze(K.settings.theme),K.settings.notificationsEnabled!==void 0&&qi(K.settings.notificationsEnabled),K.settings.dailyOutfitTime!==void 0&&Ls(K.settings.dailyOutfitTime),K.settings.dailyOutfitNotifEnabled!==void 0&&mc(K.settings.dailyOutfitNotifEnabled),K.settings.lastNotifiedDate!==void 0&&Ms(K.settings.lastNotifiedDate),K.settings.weatherAlerts!==void 0&&Vs(K.settings.weatherAlerts),K.settings.cardSize!==void 0&&ha(K.settings.cardSize),K.settings.defaultPage!==void 0&&fa(K.settings.defaultPage==="planning"?"planner":K.settings.defaultPage),K.settings.isPrivate!==void 0&&Us(K.settings.isPrivate),K.settings.shortcutsEnabled!==void 0&&yc(K.settings.shortcutsEnabled),K.settings.status!==void 0&&ma(K.settings.status))}else ca({})},Ie=>console.error(Ie)),_t=nt(oe,"artifacts",ue,"inboxNotifications"),lt=m0(_t,g0("recipientUid","==",n.uid)),xt=fo(lt,Ie=>{xr(Ie.docs.map(K=>({id:K.id,...K.data()})).sort((K,Pt)=>Pt.createdAt-K.createdAt))},Ie=>console.error("Notif listener error:",Ie));return()=>{x(),z(),J(),ke(),xt(),X()}},[n]);const hh=p=>p===0?"☀️":[1,2,3].includes(p)?"⛅":[45,48].includes(p)?"🌫️":[51,53,55,56,57,61,63,65,66,67].includes(p)?"🌧️":[71,73,75,77,85,86].includes(p)?"❄️":[80,81,82].includes(p)?"🌦️":[95,96,99].includes(p)?"⛈️":"☀️";q.useEffect(()=>{if(!n)return;(async()=>{try{const x=(F==null?void 0:F.location)||"Lisboa, Portugal",z=await(await fetch(`https://geocoding-api.open-meteo.com/v1/search?name=${encodeURIComponent(x)}&count=1&language=pt&format=json`)).json();if(z.results&&z.results.length>0){const{latitude:M,longitude:J,name:te,country:X}=z.results[0],ke=await(await fetch(`https://api.open-meteo.com/v1/forecast?latitude=${M}&longitude=${J}¤t_weather=true&daily=temperature_2m_max,temperature_2m_min,weathercode&timezone=auto`)).json();if(ke.current_weather&&ke.daily){const _t=ke.daily.time.map((lt,xt)=>({date:lt,min:Math.round(ke.daily.temperature_2m_min[xt]),max:Math.round(ke.daily.temperature_2m_max[xt]),weathercode:ke.daily.weathercode[xt]}));pa({name:`${te}, ${X||""}`.replace(/,\s*$/,""),currentTemp:Math.round(ke.current_weather.temperature),minTemp:Math.round(ke.daily.temperature_2m_min[0]),maxTemp:Math.round(ke.daily.temperature_2m_max[0]),avgTemp:Math.round((ke.daily.temperature_2m_min[0]+ke.daily.temperature_2m_max[0])/2),forecast:_t})}}}catch(x){console.error("Error fetching weather",x)}})()},[F==null?void 0:F.location,n]),q.useEffect(()=>{var p;if(n&&F){const x=Ne(oe,"artifacts",ue,"publicProfiles",n.uid);os(x,{uid:n.uid,username:F.username||"",fullName:F.fullName||"",avatar:F.avatar||null,isPrivate:((p=F.settings)==null?void 0:p.isPrivate)||!1,location:F.location||""},{merge:!0}).catch(D=>{console.error("Erro ao sincronizar perfil público:",D),D.code==="permission-denied"&&alert("Aviso: O seu perfil não ficou visível na comunidade devido a regras de segurança do Firebase (permission-denied).")})}},[n,F==null?void 0:F.username,F==null?void 0:F.fullName,F==null?void 0:F.avatar,(a=F==null?void 0:F.settings)==null?void 0:a.isPrivate,F==null?void 0:F.location]),q.useEffect(()=>{if(t!=="community")return;(async()=>{try{const x=nt(oe,"artifacts",ue,"publicProfiles"),z=(await au(x)).docs.map(M=>M.data()).filter(M=>M.uid!==(n==null?void 0:n.uid));if(gr){const M=te=>te?te.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim():"",J=M(F==null?void 0:F.location);Ki(J?z.filter(te=>M(te.location)===J):[])}else if(Hi.trim()){let M=Hi.trim().toLowerCase();M.startsWith("@")&&(M=M.substring(1)),Ki(z.filter(J=>(J.username?J.username.toLowerCase():"").includes(M)))}else Ki([])}catch(x){console.error("Erro ao buscar comunidade",x),alert("Erro ao carregar comunidade: "+x.message)}})()},[t,Hi,gr,n==null?void 0:n.uid,F==null?void 0:F.location]);const fh=async p=>{if(ga(p),p.isPrivate){ri([]),vc([]),Bs(null);return}try{const x=nt(oe,"artifacts",ue,"users",p.uid,"clothes"),D=await au(x);ri(D.docs.map(X=>({id:X.id,...X.data()})).filter(X=>X.status!=="trash"));const z=nt(oe,"artifacts",ue,"users",p.uid,"looks"),M=await au(z);vc(M.docs.map(X=>({id:X.id,...X.data()})));const J=Ne(oe,"artifacts",ue,"users",p.uid,"profile","data"),te=await of(J);te.exists()?Bs(te.data()):Bs({})}catch(x){console.error("Erro ao carregar perfil do utilizador",x)}},Yn=q.useMemo(()=>o.filter(p=>p.status==="active"),[o]),no=q.useMemo(()=>o.filter(p=>p.status==="laundry"),[o]),ro=q.useMemo(()=>o.filter(p=>p.status==="trash"),[o]),io=q.useMemo(()=>o.filter(p=>p.status==="wishlist"),[o]),Ic=q.useMemo(()=>o.filter(p=>{const x=p.status!=="trash",D=Nt==="all"||p.sections&&p.sections.includes(Nt);return x&&D}),[o,Nt]),_n=async()=>{if(!Ys.trim()||!n||!Gs)return;const p=Ne(oe,"artifacts",ue,"users",n.uid,"sections",Gs);await Zn(p,{name:Ys.trim(),emoji:xc.trim()||"💼"}),Qs(null),Ea(""),ka("")},Sa=async()=>{if(!vn.trim()||!n)return;const p=nt(oe,"artifacts",ue,"users",n.uid,"sections");await er(p,{name:vn.trim(),emoji:sh.trim()||"💼",createdAt:new Date().getTime()}),Hs(""),_c("")},ph=async p=>{if(!window.confirm(_("confirmDeleteSection")))return;const x=Ne(oe,"artifacts",ue,"users",n.uid,"sections",p);await Ha(x);const D=Ka(oe);o.forEach(z=>{if(z.sections&&z.sections.includes(p)){const M=Ne(oe,"artifacts",ue,"users",n.uid,"clothes",z.id);D.update(M,{sections:z.sections.filter(J=>J!==p)})}}),u.forEach(z=>{if(z.sections&&z.sections.includes(p)){const M=Ne(oe,"artifacts",ue,"users",n.uid,"looks",z.id);D.update(M,{sections:z.sections.filter(J=>J!==p)})}}),await D.commit(),Nt===p&&Ws("all")},oi=async(p,x)=>{if(!n)return;const D=Ne(oe,"artifacts",ue,"users",n.uid,"outfitPlans",p),z=Zi.find(J=>J.date===p);let M=[];if(z&&(M=z.lookIds||(z.lookId?[z.lookId]:[])),x===null){await Ha(D);return}M.includes(x)?M=M.filter(J=>J!==x):M=[...M,x],M.length>0?await os(D,{date:p,lookIds:M,updatedAt:new Date().getTime()},{merge:!0}):await Ha(D)},ts=new Date;ts.setHours(0,0,0,0);const so=`${ts.getFullYear()}-${String(ts.getMonth()+1).padStart(2,"0")}-${String(ts.getDate()).padStart(2,"0")}`,ai=p=>{const x=Zi.find(z=>z.date===p);return x?(x.lookIds||(x.lookId?[x.lookId]:[])).map(z=>u.find(M=>M.id===z)).filter(Boolean):[]},Ia=ai(so);q.useEffect(()=>{if(!n||!pr||!$n)return;console.log("[Daily Outfit] Notification system initialized. Scheduled for:",$n);const p=setInterval(()=>{var z;const x=new Date,D=`${x.getFullYear()}-${String(x.getMonth()+1).padStart(2,"0")}-${String(x.getDate()).padStart(2,"0")}`;if(console.log(`[Daily Outfit] Checking... Time now: ${x.getHours()}:${x.getMinutes()}, Scheduled: ${$n}. Last notified: ${ua}`),ua!==D){const M=x.getHours()*60+x.getMinutes(),[J,te]=$n.split(":").map(Number),X=J*60+te;if(M>=X){console.log("[Daily Outfit] Time matched! Checking for outfits today...");const ne=ai(D);if(ne.length>0){const ke=ne[0];if(console.log(`[Daily Outfit] Found outfit: ${ke.name}. Attempting to send notification...`),"Notification"in window)if(Notification.permission==="granted"){const _t="MyCloset - Outfit Diário",lt={body:`O seu outfit planeado "${ke.name}" está pronto para hoje!`,icon:"/favicon.ico"};try{(z=navigator.serviceWorker)==null||z.getRegistration().then(xt=>{xt&&xt.showNotification?(console.log("[Daily Outfit] Using Service Worker to show notification."),xt.showNotification(_t,lt)):(console.log("[Daily Outfit] Using standard Notification API."),new Notification(_t,lt))}).catch(xt=>{console.error("[Daily Outfit] Service Worker registration failed, using standard API.",xt),new Notification(_t,lt)})}catch(xt){console.error("[Daily Outfit] Fallback notification error:",xt),new Notification(_t,lt)}Ms(D),Ke("lastNotifiedDate",D)}else console.log("[Daily Outfit] Permission not granted. Current state:",Notification.permission);else console.log("[Daily Outfit] Notifications API not supported in this browser.")}else console.log("[Daily Outfit] No outfits planned for today.")}}else console.log("[Daily Outfit] Already notified today.")},3e4);return()=>clearInterval(p)},[n,pr,$n,ua,Zi,u]);const kr=t==="wishlist"?io:Yn,mh=q.useMemo(()=>{const p=new Set(kr.map(x=>x.color).filter(Boolean));return Array.from(p)},[kr]),Ca=q.useMemo(()=>{if(!Yn.length)return[];const p={};let x=0;return Yn.forEach(D=>{D.color&&(p[D.color]=(p[D.color]||0)+1,x++)}),x===0?[]:Object.entries(p).sort((D,z)=>z[1]-D[1]).slice(0,3).map(([D,z])=>({color:D,count:z,percentage:Math.round(z/x*100)}))},[Yn]),ns=q.useMemo(()=>kr.filter(p=>{const x=(p.name||"").toLowerCase().includes(j.toLowerCase())||(p.color||"").toLowerCase().includes(j.toLowerCase()),D=Xe==="Todos"||Xe===_("all")||p.category===Xe,z=!Qt||p.color&&p.color.includes(Qt),M=Nt==="all"||p.sections&&p.sections.includes(Nt);let J=!0;if(Y!=="any"){const ne=(new Date().getTime()-(p.createdAt||new Date().getTime()))/(1e3*60*60*24);Y==="month"?J=ne<=30:Y==="6months"?J=ne<=180:Y==="1year"?J=ne<=365:Y==="older"&&(J=ne>365)}const te=!se||p.favorite;return x&&D&&z&&J&&M&&te}),[kr,j,Xe,Qt,Y,_,Nt,se]),Tr=async(p,x)=>{if(!n)return;const D=Ne(oe,"artifacts",ue,"users",n.uid,"clothes",x.id||x);switch(p){case"favorite":await Zn(D,{favorite:!x.favorite});break;case"trash":await Zn(D,{status:"trash",trashedAt:new Date().getTime()});break;case"restore":await Zn(D,{status:"active",trashedAt:null});break;case"laundry":await Zn(D,{status:"laundry"});break;case"clean":await Zn(D,{status:"active"});break;case"delete":window.confirm(_("confirmDeletePerm"))&&await Ha(D);break}},Cc=async(p,x)=>{if(!n)return;const D=Ne(oe,"artifacts",ue,"users",n.uid,"looks",x.id||x);switch(p){case"favorite":await Zn(D,{favorite:!x.favorite});break}},Aa=async p=>{if(p.preventDefault(),!n)return;const x=new FormData(p.target),D=x.get("color");if(!D||D.trim()===""){alert("Por favor selecione pelo menos uma cor.");return}s(!0);const z={name:x.get("name"),category:x.get("category"),color:x.get("color"),imageUrl:x.get("imageUrl")||"https://images.unsplash.com/photo-1521572267360-ee0c2909d518?q=80&w=500&auto=format&fit=crop",status:x.get("isWishlist")?"wishlist":m&&m.status==="wishlist"?"active":m?m.status:"active",favorite:m&&m.favorite||!1,sections:wr,updatedAt:new Date().getTime()};try{const M=m?m.id:null;if(v(null),I(""),An("Todos"),Yt(""),ae("any"),L(""),e(x.get("isWishlist")?"wishlist":"closet"),M){const J=Ne(oe,"artifacts",ue,"users",n.uid,"clothes",M);await Zn(J,z)}else{z.createdAt=new Date().getTime();const J=nt(oe,"artifacts",ue,"users",n.uid,"clothes");await er(J,z)}}catch(M){console.error(M)}finally{s(!1)}},Na=async p=>{if(p.preventDefault(),Qe.length<2)return;s(!0);const D={name:new FormData(p.target).get("lookName"),items:Qe,sections:Hn,updatedAt:new Date().getTime()};try{if(Oe){const z=Ne(oe,"artifacts",ue,"users",n.uid,"looks",Oe.id);await Zn(z,D)}else{D.createdAt=new Date().getTime();const z=nt(oe,"artifacts",ue,"users",n.uid,"looks");await er(z,D)}At([]),Jt(null),e("outfits")}catch(z){console.error(z)}finally{s(!1)}},Ac=async p=>{if(!window.confirm(_("confirmDeleteLook")))return;const x=Ne(oe,"artifacts",ue,"users",n.uid,"looks",p);await Ha(x)},oo=async p=>{if(n)try{const x=p.items.map(X=>{const ne=o.find(ke=>ke.id===X);return ne?{name:ne.name,category:ne.category,color:ne.color,imageUrl:ne.imageUrl}:null}).filter(Boolean),D=nt(oe,"artifacts",ue,"sharedLooks"),z=Ne(D),J=`${window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"?"https://mycloset.epvc.pt":window.location.origin}${window.location.pathname}?shared=${z.id}`;let te=!1;try{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(J),te=!0;else throw new Error("Clipboard API indisponível")}catch{try{const ne=document.createElement("textarea");ne.value=J,ne.style.position="fixed",ne.style.left="-9999px",document.body.appendChild(ne),ne.focus(),ne.select(),te=document.execCommand("copy"),document.body.removeChild(ne)}catch(ne){console.error("Erro no fallback de clipboard:",ne)}}await os(z,{lookName:p.name,ownerUid:n.uid,ownerEmail:n.email||"",items:x,createdAt:new Date().getTime()}),te?(_a(p.id),setTimeout(()=>_a(null),3e3)):alert("Link de partilha: "+J)}catch(x){console.error("Erro ao partilhar look:",x),alert("Erro ao gerar link de partilha.")}},Pa=async p=>{if(n){Le(_("copying")||"A copiar...");try{const x=nt(oe,"artifacts",ue,"users",n.uid,"clothes");await er(x,{name:p.name,category:p.category,color:p.color,imageUrl:p.imageUrl,status:"active",favorite:!1,createdAt:new Date().getTime(),updatedAt:new Date().getTime()}),Le(_("itemCopied")||"Peça copiada para o seu armário!"),setTimeout(()=>Le(null),3e3)}catch(x){console.error("Erro ao copiar peça:",x),Le("Erro ao copiar peça."),setTimeout(()=>Le(null),3e3)}}},Nc=async p=>{if(!(!n||!Ue)){Le(_("copying")||"A copiar...");try{const x=[];for(const z of p.items){const M=Xt.find(J=>J.id===z);if(M){const J=nt(oe,"artifacts",ue,"users",n.uid,"clothes"),te=await er(J,{name:M.name,category:M.category,color:M.color,imageUrl:M.imageUrl,status:"active",favorite:!1,createdAt:new Date().getTime(),updatedAt:new Date().getTime()});x.push(te.id)}}const D=nt(oe,"artifacts",ue,"users",n.uid,"looks");await er(D,{name:p.name,items:x,createdAt:new Date().getTime(),updatedAt:new Date().getTime()});try{const z=nt(oe,"artifacts",ue,"inboxNotifications");await er(z,{type:"look_copied",recipientUid:Ue.uid,lookName:p.name,copiedByEmail:(F==null?void 0:F.username)||n.email||"Alguém",createdAt:new Date().getTime(),read:!1})}catch(z){console.error("Não foi possível enviar notificação ao dono do look:",z)}Le(_("lookCopied")||"Look copiado para o seu armário!"),setTimeout(()=>Le(null),3e3)}catch(x){console.error("Erro ao copiar look:",x),Le("Erro ao copiar look."),setTimeout(()=>Le(null),3e3)}}},br=async()=>{if(!(!n||!ft)){qs(!0);try{const p=[];for(const D of ft.items){const z=nt(oe,"artifacts",ue,"users",n.uid,"clothes"),M=await er(z,{name:D.name,category:D.category,color:D.color,imageUrl:D.imageUrl,status:"active",favorite:!1,createdAt:new Date().getTime(),updatedAt:new Date().getTime()});p.push(M.id)}const x=nt(oe,"artifacts",ue,"users",n.uid,"looks");if(await er(x,{name:ft.lookName,items:p,createdAt:new Date().getTime(),updatedAt:new Date().getTime()}),ft.ownerUid&&ft.ownerUid!==n.uid)try{const D=nt(oe,"artifacts",ue,"inboxNotifications");await er(D,{type:"look_copied",recipientUid:ft.ownerUid,lookName:ft.lookName,copiedByEmail:(F==null?void 0:F.username)||n.email||"Alguém",createdAt:new Date().getTime(),read:!1})}catch(D){console.error("Não foi possível enviar notificação ao dono do look:",D)}Qi(!1),vr(null),e("outfits")}catch(p){console.error("Erro ao copiar look:",p),alert("Erro ao copiar look.")}finally{qs(!1)}}},Pc=async p=>{s(!0);try{const x=Ka(oe);p.items.forEach(D=>{const z=Ne(oe,"artifacts",ue,"users",n.uid,"clothes",D);x.update(z,{status:"laundry"})}),await x.commit(),Le(_("lookSentToLaundry")||"Peças enviadas para a lavandaria!"),setTimeout(()=>Le(null),3e3)}catch(x){console.error(x)}finally{s(!1)}},Rc=async p=>{p.preventDefault(),E(""),s(!0);const x=new FormData(p.target),D=x.get("email"),z=x.get("password");try{H==="login"?await WI(Ga,D,z):await qI(Ga,D,z)}catch(M){console.error(M),M.code==="auth/operation-not-allowed"?E(_("authErrorDisabled")):E(M.message)}finally{s(!1)}},Dc=()=>{E(""),A(!0)},jc=async p=>{p.preventDefault();const x=R;if(x){s(!0),E("");try{await $I(Ga,x),A(!1),b(""),Le(_("passwordResetSent")||"E-mail de recuperação enviado! Verifique a sua caixa de entrada.")}catch(D){console.error(D),E(D.message)}finally{s(!1)}}},ao=async()=>{if(!(!n||!window.confirm(_("confirmEmptyTrash")))){s(!0);try{const p=Ka(oe);ro.forEach(x=>{const D=Ne(oe,"artifacts",ue,"users",n.uid,"clothes",x.id);p.delete(D)}),await p.commit()}catch(p){console.error(p)}finally{s(!1)}}},zt=async()=>{if(!(!n||!window.confirm(_("confirmClearAll")))){s(!0);try{const p=Ka(oe);Yn.forEach(x=>{const D=Ne(oe,"artifacts",ue,"users",n.uid,"clothes",x.id);p.update(D,{status:"trash",trashedAt:new Date().getTime()})}),await p.commit()}catch(p){console.error(p)}finally{s(!1)}}},Oc=p=>{const x=p.target.files[0];if(!x||!n)return;const D=new FileReader;D.onload=z=>{const M=new Image;M.onload=async()=>{const J=document.createElement("canvas"),te=400;let X=M.width,ne=M.height;X>ne?X>te&&(ne*=te/X,X=te):ne>te&&(X*=te/ne,ne=te),J.width=X,J.height=ne,J.getContext("2d").drawImage(M,0,0,X,ne);const _t=J.toDataURL("image/jpeg",.8);try{const lt=Ne(oe,"artifacts",ue,"users",n.uid,"profile","data");await os(lt,{avatar:_t},{merge:!0})}catch(lt){console.error("Error uploading image:",lt)}},M.src=z.target.result},D.readAsDataURL(x)},Lc=p=>{const x=p.target.files[0];if(!x)return;const D=new FileReader;D.onload=z=>{const M=new Image;M.onload=()=>{const J=document.createElement("canvas"),te=800;let X=M.width,ne=M.height;X>ne?X>te&&(ne*=te/X,X=te):ne>te&&(X*=te/ne,ne=te),J.width=X,J.height=ne,J.getContext("2d").drawImage(M,0,0,X,ne);const _t=J.toDataURL("image/jpeg",.8);I(_t)},M.src=z.target.result},D.readAsDataURL(x)},li=async p=>{p.preventDefault(),Xr(!0);const x=new FormData(p.target);try{let D=(x.get("username")||"").trim();if(D.startsWith("@")&&(D=D.substring(1)),D){const ne=nt(oe,"artifacts",ue,"publicProfiles"),ke=m0(ne,g0("username","==",D));if((await au(ke)).docs.some(xt=>xt.data().uid!==n.uid)){alert(_("usernameTaken")||"Este nome de utilizador já está em uso."),Xr(!1);return}}const z=Ne(oe,"artifacts",ue,"users",n.uid,"profile","data"),M=x.get("dobDay"),J=x.get("dobMonth"),te=x.get("dobYear");let X=x.get("dob")||"";M&&J&&te&&(X=`${te}-${J}-${M}`),os(z,{username:D,fullName:x.get("fullName")||"",dob:X,bio:x.get("bio")||"",location:x.get("location")||"",createdAt:(F==null?void 0:F.createdAt)||new Date().getTime()},{merge:!0}).catch(ne=>{console.error(ne)})}catch(D){console.error(D)}finally{setTimeout(()=>{Xr(!1)},600)}};return i&&!n?c.jsx("div",{className:"h-screen flex items-center justify-center bg-primary-50 dark:bg-gray-950",children:c.jsx(Qy,{className:"animate-spin text-primary-600",size:40})}):t==="auth"?c.jsxs("div",{className:`min-h-screen bg-gradient-to-br from-primary-100 via-white to-purple-50 dark:from-gray-950 dark:to-gray-900 flex items-center justify-center p-6 text-gray-900 ${g?"dark":""}`,children:[c.jsx(Ve,{className:"max-w-md w-full p-6 md:p-12 border-none shadow-2xl overflow-hidden",darkMode:g,children:c.jsxs("div",{className:"animate-custom-zoom",children:[c.jsxs("div",{className:"text-center mb-6 md:mb-10",children:[c.jsx("div",{className:"inline-flex p-5 bg-primary-600 rounded-3xl md:rounded-[2rem] shadow-2xl shadow-primary-600/40 mb-6 transition-all duration-300",children:H==="login"?c.jsx($a,{className:"text-white w-12 h-12"}):c.jsx(Hy,{className:"text-white w-12 h-12"})}),c.jsx("h1",{className:"text-5xl font-black tracking-tighter italic",children:"MyCloset"})]}),w&&c.jsxs("div",{className:"mb-6 p-4 bg-red-50 text-red-600 text-[10px] rounded-2xl flex items-center gap-2 font-black uppercase tracking-widest border border-red-100",children:[c.jsx(tb,{size:16})," ",w]}),c.jsxs("form",{onSubmit:Rc,className:"space-y-4",children:[c.jsx("input",{name:"email",type:"email",placeholder:_("emailPlaceholder"),required:!0,className:"w-full p-5 rounded-2xl bg-gray-50 dark:bg-gray-800 border-none focus:ring-2 focus:ring-primary-500 outline-none font-bold"}),c.jsx("input",{name:"password",type:"password",placeholder:_("passwordPlaceholder"),required:!0,className:"w-full p-5 rounded-2xl bg-gray-50 dark:bg-gray-800 border-none focus:ring-2 focus:ring-primary-500 outline-none font-bold"}),H==="login"&&c.jsx("div",{className:"text-right",children:c.jsx("button",{type:"button",onClick:Dc,className:"text-[10px] font-black text-primary-500 hover:text-primary-600 uppercase tracking-widest transition-colors",children:_("forgotPassword")||"Esqueceu-se da palavra-passe?"})}),c.jsx("button",{className:"w-full py-5 bg-primary-600 text-white rounded-3xl md:rounded-[2rem] font-black text-lg shadow-2xl hover:scale-[1.02] active:scale-95 transition-all",children:_(H==="login"?"loginBtn":"registerBtn")})]}),c.jsx("div",{className:"mt-6 md:mt-10 text-center",children:c.jsx("button",{type:"button",onClick:()=>T(H==="login"?"register":"login"),className:"text-gray-400 font-black text-[10px] uppercase tracking-[0.3em] hover:text-primary-600 transition-colors text-inherit",children:_(H==="login"?"createAccount":"haveAccount")})}),c.jsx("div",{className:"mt-6 md:mt-12 flex justify-center gap-5 pt-8 border-t border-gray-100 dark:border-gray-800/50",children:[{id:"PT",flag:"🇵🇹"},{id:"EN",flag:"🇬🇧"},{id:"ES",flag:"🇪🇸"},{id:"FR",flag:"🇫🇷"},{id:"DE",flag:"🇩🇪"}].map(p=>c.jsx("button",{type:"button",onClick:()=>ei(p.id),className:`text-2xl transition-all duration-500 hover:scale-150 active:scale-95 ${yt===p.id?"scale-125 drop-shadow-[0_0_8px_rgba(79,70,229,0.3)]":"grayscale opacity-30 hover:grayscale-0 hover:opacity-100"}`,title:p.id,children:p.flag},p.id))})]},H)}),S&&c.jsx("div",{className:"fixed inset-0 z-[200] flex items-center justify-center bg-black/60 backdrop-blur-sm p-6",onClick:()=>A(!1),children:c.jsxs(Ve,{className:"w-full max-w-md p-5 md:p-8 animate-in zoom-in-95",darkMode:g,onClick:p=>p.stopPropagation(),children:[c.jsx("h3",{className:"text-2xl font-black mb-4 text-center text-inherit",children:_("forgotPassword")}),c.jsx("p",{className:"text-center opacity-70 mb-5 md:mb-8 text-sm text-inherit",children:_("forgotPasswordPrompt")}),c.jsxs("form",{onSubmit:jc,className:"space-y-4",children:[c.jsx("input",{name:"resetEmail",type:"email",placeholder:_("emailPlaceholder"),required:!0,value:R,onChange:p=>b(p.target.value),className:"w-full p-5 rounded-2xl bg-gray-50 dark:bg-gray-800 border-none focus:ring-2 focus:ring-primary-500 outline-none font-bold text-inherit"}),c.jsx("button",{type:"submit",disabled:i,className:"w-full py-5 bg-primary-600 text-white rounded-3xl md:rounded-[2rem] font-black text-lg shadow-2xl hover:scale-[1.02] active:scale-95 transition-all disabled:opacity-50",children:_(i?"saving":"sendEmailBtn")})]}),c.jsx("button",{type:"button",onClick:()=>A(!1),className:"w-full mt-6 py-4 uppercase font-black text-[10px] tracking-widest text-gray-500 hover:text-gray-900 dark:hover:text-white transition-colors",children:_("cancel")})]})})]}):c.jsxs("div",{className:`min-h-screen flex transition-all duration-700 ${g?"bg-gray-950 text-white dark":"bg-[#FDFDFF] text-gray-900"}`,children:[c.jsx("aside",{className:`
|
|
fixed md:relative inset-y-0 left-0 z-[100] transition-all duration-500 ease-in-out border-r overflow-hidden
|
|
${g?"bg-gray-900/80 border-gray-800":"bg-white border-gray-100"}
|
|
${V?"w-80 translate-x-0":"w-0 -translate-x-full md:w-0 md:opacity-0"}
|
|
`,children:c.jsxs("div",{className:"p-6 md:p-10 h-full flex flex-col backdrop-blur-xl",children:[c.jsxs("button",{onClick:()=>e("closet"),className:"flex items-center gap-4 mb-5 md:mb-8 md:mb-16 hover:scale-[1.02] transition-transform text-left cursor-pointer w-full",children:[c.jsx("div",{className:"p-3 bg-primary-600 rounded-2xl shadow-xl shadow-primary-600/30",children:c.jsx($a,{className:"text-white",size:24})}),c.jsx("span",{className:"text-3xl font-black tracking-tighter italic",children:"MyCloset"})]}),mr&&c.jsxs("button",{onClick:()=>Qn("up"),className:"w-full flex items-center justify-center gap-2 p-2 bg-gray-100 dark:bg-gray-800 rounded-xl mb-3 text-xs font-bold hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors",children:[c.jsx("span",{className:"px-2 py-1 bg-white dark:bg-gray-900 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700",children:"Q"})," ",_("up")]}),c.jsx("nav",{className:"flex-1 space-y-3",children:[{id:"dashboard",label:_("dashboard"),icon:ib},{id:"closet",label:_("closet"),icon:$a},{id:"wishlist",label:_("wishlist")||"Carrinho",icon:Xy},{id:"laundry",label:_("laundry"),icon:ss},{id:"outfits",label:_("outfits"),icon:qa},{id:"planner",label:_("planning"),icon:$y},{id:"community",label:_("community"),icon:pb},{id:"settings",label:_("settings"),icon:Hh}].map(p=>c.jsxs("button",{onClick:()=>{e(p.id),window.innerWidth<768&&G(!1)},className:`w-full flex items-center gap-4 px-6 py-4 rounded-2xl transition-all font-black text-[11px] uppercase tracking-widest ${t===p.id?"bg-primary-600 text-white shadow-2xl shadow-primary-600/30 scale-105":"opacity-40 hover:opacity-100 hover:bg-primary-500/5"}`,children:[c.jsx(p.icon,{size:20}),c.jsx("span",{children:p.label})]},p.id))}),mr&&c.jsxs("button",{onClick:()=>Qn("down"),className:"w-full flex items-center justify-center gap-2 p-2 bg-gray-100 dark:bg-gray-800 rounded-xl mt-3 text-xs font-bold hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors",children:[c.jsx("span",{className:"px-2 py-1 bg-white dark:bg-gray-900 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700",children:"E"})," ",_("down")]}),c.jsxs("div",{className:"mt-auto pt-10 border-t border-inherit",children:[c.jsxs("div",{onClick:()=>e("profile"),className:"w-full flex items-center gap-4 mb-5 md:mb-8 px-2 text-left hover:bg-gray-100 dark:hover:bg-gray-800 py-3 rounded-2xl transition-all cursor-pointer",children:[c.jsx("div",{className:`w-12 h-12 rounded-2xl shrink-0 flex items-center justify-center font-black text-white shadow-xl overflow-hidden ${g?"bg-primary-500":"bg-primary-600"}`,children:F!=null&&F.avatar?c.jsx("img",{src:F.avatar,className:"w-full h-full object-cover",alt:"Avatar"}):(((d=F==null?void 0:F.fullName)==null?void 0:d[0])||((f=F==null?void 0:F.username)==null?void 0:f[0])||((y=n==null?void 0:n.email)==null?void 0:y[0])||"U").toUpperCase()}),c.jsxs("div",{className:"flex-1 min-w-0 text-left",children:[c.jsxs("p",{className:"text-sm font-black truncate text-inherit",children:["@",(F==null?void 0:F.username)||((P=n==null?void 0:n.email)==null?void 0:P.split("@")[0])||_("userTitle")]}),c.jsx("div",{onClick:Sc,className:"inline-block mt-1 cursor-pointer hover:opacity-80 transition-opacity",title:"Mudar estado",children:c.jsx(lu,{variant:ti==="online"?"success":ti==="away"?"warning":"default",children:_(ti)})})]})]}),c.jsxs("button",{onClick:()=>{n!=null&&n.uid&&localStorage.removeItem(`app-theme-${n.uid}`),QI(Ga)},className:"w-full py-4 text-red-500 font-black uppercase tracking-widest text-[10px] hover:bg-red-500/10 rounded-2xl transition-all flex items-center justify-center gap-3",children:[c.jsx(ob,{size:16})," ",_("logout")]})]})]})}),V&&c.jsx("div",{className:"fixed inset-0 bg-black/50 z-[90] md:hidden backdrop-blur-sm",onClick:()=>G(!1)}),c.jsxs("main",{className:"flex-1 flex flex-col h-screen overflow-hidden",children:[c.jsxs("header",{className:`h-20 md:h-24 shrink-0 flex items-center justify-between px-4 md:px-12 transition-all border-b border-inherit ${g?"bg-gray-950/50":"bg-white/50"} backdrop-blur-xl`,children:[c.jsxs("div",{className:"flex items-center gap-3 md:gap-6",children:[c.jsx("button",{onClick:()=>G(!V),className:`p-2 md:p-3 rounded-xl md:rounded-2xl transition-all border ${g?"bg-gray-800 border-gray-700":"bg-gray-50 border-gray-200"}`,children:V?c.jsx(cb,{size:20,className:"md:w-6 md:h-6"}):c.jsx(ub,{size:20,className:"md:w-6 md:h-6"})}),c.jsxs("h2",{className:"text-xl md:text-3xl font-black tracking-tighter truncate max-w-[150px] md:max-w-none",children:[t==="dashboard"&&_("overview"),t==="closet"&&_("myCloset"),t==="wishlist"&&(_("wishlist")||"Carrinho"),t==="laundry"&&_("laundry"),t==="outfits"&&_("outfitsAndStyle"),t==="planner"&&_("planning"),t==="community"&&_("community"),t==="settings"&&_("settings"),t==="profile"&&_("profileInfo")]})]}),c.jsxs("div",{className:"flex items-center gap-2 md:gap-4",children:[c.jsx("button",{onClick:()=>Ta(!0),className:"p-2 md:p-3 bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-200 rounded-xl md:rounded-2xl hover:scale-105 active:scale-95 transition-all",children:c.jsx(qa,{size:20,className:"w-5 h-5 md:w-6 md:h-6"})}),c.jsxs("div",{className:"hidden sm:flex bg-gray-100 dark:bg-gray-800 p-1.5 rounded-xl md:rounded-2xl",children:[c.jsx("button",{onClick:()=>ba(!1),className:`p-1.5 md:p-2 rounded-lg md:rounded-xl ${g?"text-gray-500":"bg-white shadow-md text-primary-600"}`,children:c.jsx(fb,{size:16,className:"md:w-[18px] md:h-[18px]"})}),c.jsx("button",{onClick:()=>ba(!0),className:`p-1.5 md:p-2 rounded-lg md:rounded-xl ${g?"bg-gray-900 shadow-md text-primary-400":"text-gray-500"}`,children:c.jsx(lb,{size:16,className:"md:w-[18px] md:h-[18px]"})})]}),c.jsxs("button",{onClick:()=>si(!0),className:"relative p-2 md:p-4 bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-200 rounded-xl md:rounded-2xl hover:scale-105 active:scale-95 transition-all",children:[c.jsx(Ua,{size:20,className:"w-5 h-5 md:w-6 md:h-6"}),_r.filter(p=>!p.read).length>0&&c.jsx("span",{className:"absolute top-1 md:top-2 right-1 md:right-2 w-2.5 h-2.5 md:w-3 md:h-3 bg-red-500 rounded-full border-2 border-white dark:border-gray-800"})]}),c.jsx("button",{onClick:()=>{v(null),I(""),e("add"),Jt(null),At([])},className:"p-2 md:p-4 bg-primary-600 text-white rounded-xl md:rounded-2xl shadow-xl shadow-primary-600/30 hover:scale-105 active:scale-95 transition-all",children:c.jsx(Ba,{size:20,className:"w-5 h-5 md:w-6 md:h-6"})})]})]}),c.jsxs("div",{className:"flex-1 overflow-y-auto p-4 md:p-12 space-y-5 md:space-y-8 md:space-y-12",children:[t==="dashboard"&&c.jsxs("div",{className:"space-y-5 md:space-y-8 md:space-y-12 animate-in fade-in duration-700",children:[c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 md:gap-8",children:[{label:_("readyClothes"),val:Yn.length,icon:$a,col:"primary"},{label:_("inLaundry"),val:no.length,icon:ss,col:"blue"},{label:_("myLooks"),val:u.length,icon:qa,col:"purple"}].map((p,x)=>c.jsxs(Ve,{className:"p-5 md:p-8 group hover:-translate-y-2",darkMode:g,children:[c.jsx("div",{className:`w-14 h-14 rounded-2xl flex items-center justify-center mb-6 shadow-inner ${g?"bg-gray-700 text-primary-400":"bg-primary-50 text-primary-600"}`,children:c.jsx(p.icon,{size:28})}),c.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest opacity-40 mb-1",children:p.label}),c.jsx("h4",{className:"text-4xl font-black tracking-tight",children:p.val})]},x))}),c.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4 md:gap-8",children:[c.jsxs("div",{className:"lg:col-span-2 p-6 md:p-10 rounded-3xl md:rounded-[2rem] relative overflow-hidden shadow-2xl",style:{backgroundColor:"hsl(var(--primary-600))",color:"white"},children:[c.jsxs("div",{className:"relative z-10 flex flex-col justify-between h-full",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[c.jsx(Ky,{size:28,style:{color:"rgba(255,255,255,0.7)"}}),c.jsx(lu,{variant:"warning",children:vt?vt.name:_("todayIn")})]}),c.jsx("h3",{className:"text-5xl font-black tracking-tighter mb-4",style:{color:"white"},children:vt?_("weatherCurrentAvg").replace("{current}",vt.currentTemp).replace("{avg}",vt.avgTemp):_("weatherUpdate")}),c.jsx("p",{className:"text-lg font-medium max-w-lg leading-relaxed",style:{color:"rgba(255,255,255,0.8)"},children:vt?`${_("weatherForecastDesc").replace("{max}",vt.maxTemp).replace("{min}",vt.minTemp)} ${_("weatherMsg")}`:_("weatherMsg")})]}),c.jsxs("div",{className:"mt-6 md:mt-10 flex gap-4 items-center",children:[Yn.filter(p=>p.category==="Tops").slice(0,2).map(p=>c.jsx("div",{className:"w-16 h-16 rounded-xl overflow-hidden border-2",style:{borderColor:"rgba(255,255,255,0.4)"},children:c.jsx("img",{src:p.imageUrl,className:"w-full h-full object-cover",alt:""})},p.id)),c.jsxs("button",{onClick:()=>e("closet"),className:"flex items-center gap-2 font-black uppercase text-xs tracking-widest hover:translate-x-2 transition-transform",style:{color:"white"},children:[_("exploreSuggestions")," ",c.jsx(nb,{size:18})]})]})]}),c.jsx(Ky,{size:350,className:"absolute -bottom-20 -right-20",style:{color:"rgba(255,255,255,0.1)"}})]}),c.jsxs(Ve,{className:"p-5 md:p-8",darkMode:g,children:[c.jsxs("h3",{className:"text-lg font-black tracking-tight mb-5 md:mb-8 flex items-center gap-2 text-inherit",children:[c.jsx(db,{size:20})," ",_("topColors")]}),c.jsx("div",{className:"space-y-6",children:Ca.length>0?Ca.map(p=>c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex justify-between text-[10px] font-black uppercase tracking-widest opacity-50",children:[c.jsx("span",{children:p.color}),c.jsxs("span",{children:[p.percentage,"% (",p.count,")"]})]}),c.jsx("div",{className:"h-2 w-full bg-gray-100 dark:bg-gray-700 rounded-full overflow-hidden",children:c.jsx("div",{className:"h-full bg-primary-600",style:{width:`${p.percentage}%`}})})]},p.color)):c.jsx("p",{className:"text-xs opacity-50 italic",children:_("addColorsToItems")})})]})]})]}),(t==="closet"||t==="wishlist")&&c.jsxs("div",{className:"space-y-6 md:space-y-10 animate-in slide-in-from-bottom-8 duration-700",children:[c.jsxs("div",{className:"flex flex-col xl:flex-row gap-4 md:gap-8 items-center justify-between",children:[c.jsxs("div",{className:"relative w-full max-w-2xl",children:[c.jsx(ho,{className:"absolute left-6 top-1/2 -translate-y-1/2 text-gray-400",size:24}),c.jsx("input",{placeholder:_("searchPlaceholder"),className:`w-full pl-16 pr-8 py-6 rounded-3xl md:rounded-[2rem] shadow-inner outline-none border-none focus:ring-4 focus:ring-primary-500/10 font-bold text-lg ${g?"bg-gray-800":"bg-gray-100"}`,onChange:p=>L(p.target.value)})]}),c.jsx("div",{className:"flex gap-3 w-full xl:w-auto",children:c.jsxs("button",{onClick:()=>Ae(!0),className:"flex items-center gap-3 px-5 md:px-8 py-4 bg-primary-600 text-white rounded-3xl md:rounded-[2rem] font-black uppercase text-[10px] tracking-widest shadow-xl shadow-primary-600/30 hover:scale-105 transition-all",children:[c.jsx($h,{size:18})," ",_("advancedFilters"),(Qt||se||Y!=="any"||Xe!=="Todos"&&Xe!==_("all"))&&c.jsx("span",{className:"w-2 h-2 rounded-full bg-white animate-pulse"})]})})]}),(t==="closet"||t==="wishlist"||t==="outfits")&&c.jsxs("div",{className:"flex items-center gap-3 overflow-x-auto pb-1 custom-scrollbar",children:[c.jsxs("button",{onClick:()=>Ws("all"),className:`shrink-0 flex items-center gap-2 px-5 py-2.5 rounded-2xl font-black text-[10px] uppercase tracking-widest transition-all ${Nt==="all"?"bg-primary-600 text-white shadow-lg shadow-primary-600/30":g?"bg-gray-800 text-gray-400 hover:bg-gray-700":"bg-gray-100 text-gray-500 hover:bg-gray-200"}`,children:[c.jsx(Gy,{size:14})," ",_("allSections")]}),gn.map(p=>c.jsx("button",{onClick:()=>Ws(p.id),className:`shrink-0 flex items-center gap-2 px-5 py-2.5 rounded-2xl font-black text-[10px] uppercase tracking-widest transition-all ${Nt===p.id?"bg-primary-600 text-white shadow-lg shadow-primary-600/30 scale-105":g?"bg-gray-800 text-gray-400 hover:bg-gray-700":"bg-gray-100 text-gray-500 hover:bg-gray-200"}`,children:p.name},p.id)),c.jsxs("button",{onClick:()=>yn(!0),className:`shrink-0 flex items-center gap-2 px-4 py-2.5 rounded-2xl font-black text-[10px] uppercase tracking-widest transition-all border-2 border-dashed ${g?"border-gray-700 text-gray-500 hover:border-primary-500 hover:text-primary-400":"border-gray-200 text-gray-400 hover:border-primary-400 hover:text-primary-600"}`,children:[c.jsx(Hh,{size:14})," ",_("manageSections")]})]}),c.jsx("div",{className:Nn==="small"?"grid grid-cols-2 sm:grid-cols-4 lg:grid-cols-5 2xl:grid-cols-6 gap-6":Nn==="medium"?"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 2xl:grid-cols-5 gap-4 md:gap-8":"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 2xl:grid-cols-4 gap-6 md:gap-10",children:ns.map(p=>{const x={small:{badgeClass:"top-2 left-2 scale-[0.65] origin-top-left",heartContClass:"top-2 right-2",heartBtnClass:"p-1.5 rounded-lg",heartIcon:10,overlayContClass:"p-2 pb-[50px]",btnPyClass:"py-1 px-1",btnTextClass:"hidden",btnIcon:10,btnGap:"gap-1",btnRadius:"rounded-md",infoContClass:"bottom-2 left-2 right-2 p-2 rounded-xl",titleClass:"text-xs",colorDotClass:"w-2 h-2",colorTextClass:"text-[8px]",secTextClass:"text-[8px] px-1 py-0 rounded"},medium:{badgeClass:"top-4 left-4 scale-90 origin-top-left",heartContClass:"top-4 right-4",heartBtnClass:"p-2 rounded-xl",heartIcon:14,overlayContClass:"p-4 pb-[90px]",btnPyClass:"py-2 px-2",btnTextClass:"text-[8px]",btnIcon:12,btnGap:"gap-1.5",btnRadius:"rounded-xl",infoContClass:"bottom-4 left-4 right-4 p-4 rounded-2xl",titleClass:"text-sm",colorDotClass:"w-3 h-3",colorTextClass:"text-[9px]",secTextClass:"text-[9px] px-1.5 py-0.5 rounded-md"},large:{badgeClass:"top-6 left-6",heartContClass:"top-6 right-6",heartBtnClass:"p-3 rounded-2xl",heartIcon:18,overlayContClass:"p-6 pb-[136px]",btnPyClass:"py-3 px-2",btnTextClass:"text-[9px]",btnIcon:14,btnGap:"gap-2",btnRadius:"rounded-xl",infoContClass:"bottom-6 left-6 right-6 p-6 rounded-3xl",titleClass:"text-xl",colorDotClass:"w-4 h-4",colorTextClass:"text-[10px]",secTextClass:"text-[10px] px-2 py-0.5 rounded-md"}}[Nn]||{badgeClass:"top-6 left-6",heartContClass:"top-6 right-6",heartBtnClass:"p-3 rounded-2xl",heartIcon:18,overlayContClass:"p-6 pb-[136px]",btnPyClass:"py-3 px-2",btnTextClass:"text-[9px]",btnIcon:14,btnGap:"gap-2",btnRadius:"rounded-xl",infoContClass:"bottom-6 left-6 right-6 p-6 rounded-3xl",titleClass:"text-xl",colorDotClass:"w-4 h-4",colorTextClass:"text-[10px]",secTextClass:"text-[10px] px-2 py-0.5 rounded-md"};return c.jsx("div",{className:"group",children:c.jsxs(Ve,{className:`overflow-hidden p-0 relative border-none hover:shadow-2xl transition-all duration-500 ${Nn==="small"?"h-[180px]":Nn==="medium"?"h-[320px]":"h-[480px]"}`,darkMode:g,children:[c.jsx("img",{src:p.imageUrl,className:"w-full h-full object-cover transition-transform duration-1000 group-hover:scale-110",alt:p.name}),c.jsx("div",{className:`absolute inset-0 bg-gradient-to-t from-black/80 via-transparent opacity-0 group-hover:opacity-100 transition-all duration-300 flex flex-col justify-end text-white z-10 pointer-events-none ${x.overlayContClass}`,children:c.jsxs("div",{className:`grid grid-cols-2 ${x.btnGap} pointer-events-auto`,children:[c.jsxs("button",{onClick:()=>{v(p),I(p.imageUrl||""),e("edit")},className:`${x.btnPyClass} bg-white text-primary-600 ${x.btnRadius} font-black uppercase flex items-center justify-center gap-1.5 hover:bg-primary-50`,children:[c.jsx(eu,{size:x.btnIcon})," ",c.jsx("span",{className:x.btnTextClass,children:_("edit")})]}),c.jsxs("button",{onClick:()=>Tr("laundry",p),className:`${x.btnPyClass} bg-blue-600 text-white ${x.btnRadius} font-black uppercase flex items-center justify-center gap-1.5 hover:bg-blue-700`,children:[c.jsx(ss,{size:x.btnIcon})," ",c.jsx("span",{className:x.btnTextClass,children:_("makeDirty")})]}),c.jsxs("button",{onClick:()=>Tr("trash",p),className:`${x.btnPyClass} bg-red-600/20 text-red-100 backdrop-blur-md ${x.btnRadius} font-black uppercase flex items-center justify-center gap-1.5 hover:bg-red-600 transition-colors col-span-2`,children:[c.jsx(ev,{size:x.btnIcon})," ",c.jsx("span",{className:x.btnTextClass,children:_("moveToTrash")})]})]})}),c.jsx("div",{className:`absolute z-20 ${x.badgeClass}`,children:c.jsx(lu,{children:p.category})}),c.jsx("div",{className:`absolute z-20 pointer-events-auto ${x.heartContClass}`,children:c.jsx("button",{onClick:()=>Tr("favorite",p),className:`${x.heartBtnClass} shadow-xl backdrop-blur-md transition-all ${p.favorite?"bg-rose-500 text-white":"bg-white/90 text-gray-400"}`,children:c.jsx(qh,{size:x.heartIcon,fill:p.favorite?"currentColor":"none"})})}),c.jsxs("div",{className:`absolute bg-white/95 dark:bg-gray-900/95 backdrop-blur-2xl shadow-2xl transform transition-transform group-hover:-translate-y-2 z-20 pointer-events-auto ${x.infoContClass}`,children:[c.jsx("h4",{className:`${x.titleClass} font-black tracking-tighter truncate`,children:p.name}),c.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[c.jsxs("div",{className:"flex items-center gap-1.5 border-r border-gray-200 dark:border-gray-700 pr-2",children:[c.jsx("div",{className:`${x.colorDotClass} rounded-full border border-black/10 shrink-0`,style:Tc(p.color)}),c.jsx("span",{className:`${x.colorTextClass} font-black opacity-40 uppercase tracking-widest`,children:p.color})]}),p.sections&&p.sections.length>0&&c.jsx("div",{className:"flex items-center gap-1 overflow-x-auto custom-scrollbar no-scrollbar",children:p.sections.map(D=>{const z=gn.find(M=>M.id===D);return z?c.jsx("span",{className:`${x.secTextClass} font-bold bg-gray-100 dark:bg-gray-800 text-gray-500 whitespace-nowrap`,children:z.name},z.id):null})})]})]})]})},p.id)})})]}),t==="laundry"&&c.jsxs("div",{className:"space-y-5 md:space-y-8 md:space-y-12 animate-in fade-in duration-700",children:[c.jsxs("div",{className:"text-center max-w-2xl mx-auto space-y-4 text-inherit",children:[c.jsx("div",{className:"w-20 h-20 bg-blue-100 dark:bg-blue-900/30 rounded-3xl md:rounded-[2rem] flex items-center justify-center mx-auto text-blue-600 shadow-inner",children:c.jsx(ss,{size:40})}),c.jsx("h3",{className:"text-4xl font-black tracking-tight",children:_("laundryBasket")})]}),c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4 md:gap-8",children:[no.map(p=>c.jsxs(Ve,{className:"p-4 flex items-center gap-4 border-blue-200 dark:border-blue-900/50",darkMode:g,children:[c.jsx("img",{src:p.imageUrl,className:"w-16 h-16 rounded-2xl object-cover shadow-sm shrink-0",alt:""}),c.jsxs("div",{className:"flex-1 min-w-0 flex flex-col justify-center items-start",children:[c.jsx("p",{className:"font-black text-sm truncate w-full text-inherit",children:p.name}),c.jsx("div",{className:"mt-1.5",children:c.jsx(lu,{variant:"warning",children:_("washing")})})]}),c.jsx("button",{onClick:()=>Tr("clean",p),className:"p-3 bg-green-500 text-white rounded-xl shadow-md hover:scale-105 transition-all shrink-0",children:c.jsx(qy,{size:20})})]},p.id)),no.length===0&&c.jsx("div",{className:"col-span-full py-20 text-center opacity-20 font-black uppercase tracking-[0.5em] text-sm",children:_("emptyBasket")})]})]}),t==="outfits"&&c.jsx("div",{className:"space-y-5 md:space-y-8 md:space-y-12 animate-in fade-in duration-700 pb-20",children:c.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 md:gap-12",children:[c.jsxs("div",{className:"lg:col-span-1 space-y-5 md:space-y-8",children:[c.jsxs(Ve,{className:"p-5 md:p-8 border-primary-200",darkMode:g,children:[c.jsxs("h3",{className:"text-2xl font-black tracking-tighter mb-6 flex items-center gap-3 text-inherit",children:[c.jsx(qa,{className:"text-primary-600"})," ",Oe?_("editLook")||"Editar Outfit":_("createNewLook")]}),c.jsxs("form",{onSubmit:Na,className:"space-y-6",children:[c.jsx("input",{name:"lookName",placeholder:_("lookName"),defaultValue:(Oe==null?void 0:Oe.name)||"",required:!0,className:`w-full p-4 rounded-xl border-none shadow-inner font-bold ${g?"bg-gray-700":"bg-gray-100"}`}),c.jsxs("div",{className:"space-y-3",children:[c.jsxs("p",{className:"text-[10px] font-black uppercase opacity-40 tracking-widest",children:[_("selectedPieces")," (",Qe.length,")"]}),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[Qe.map(p=>{const x=o.find(D=>D.id===p);return c.jsxs("div",{className:"relative group",children:[c.jsx("img",{src:x==null?void 0:x.imageUrl,className:"w-12 h-12 rounded-lg object-cover border-2 border-primary-500",alt:""}),c.jsx("button",{type:"button",onClick:()=>At(Qe.filter(D=>D!==p)),className:"absolute -top-1 -right-1 bg-red-500 text-white rounded-full p-0.5 opacity-0 group-hover:opacity-100 transition-opacity",children:c.jsx(Cr,{size:10})})]},p)}),Qe.length===0&&c.jsx("p",{className:"text-xs text-gray-400 italic",children:_("selectPieces")})]})]}),c.jsxs("div",{className:"space-y-3 pt-3 border-t border-inherit",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("label",{className:"text-[10px] font-black uppercase tracking-widest opacity-50 flex items-center gap-2",children:[c.jsx(Zy,{size:12})," ",_("assignSections")]}),c.jsxs("button",{type:"button",onClick:()=>yn(!0),className:"text-[10px] font-black uppercase tracking-widest text-primary-600 hover:text-primary-700 flex items-center gap-1",children:[c.jsx(Ba,{size:10})," ",_("createSection")]})]}),gn.length===0?c.jsx("div",{className:"p-4 border-2 border-dashed border-gray-200 dark:border-gray-800 rounded-2xl text-center",children:c.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest opacity-40",children:_("noSectionsCreated")})}):c.jsx("div",{className:"flex flex-wrap gap-2",children:gn.map(p=>c.jsxs("button",{type:"button",onClick:()=>{Hn.includes(p.id)?Ji(Hn.filter(x=>x!==p.id)):Ji([...Hn,p.id])},className:`flex items-center gap-2 px-3 py-1.5 rounded-xl text-xs font-bold transition-all border-2 ${Hn.includes(p.id)?"border-primary-600 bg-primary-600 text-white shadow-md shadow-primary-600/30":"border-transparent bg-gray-100 dark:bg-gray-800 text-gray-500 hover:bg-gray-200 dark:hover:bg-gray-700"}`,children:[p.name,Hn.includes(p.id)&&c.jsx(Xn,{size:12})]},p.id))})]}),c.jsxs("div",{className:"flex gap-4",children:[Oe&&c.jsx("button",{type:"button",onClick:()=>{Jt(null),At([])},className:"flex-1 py-4 font-black uppercase text-[10px] tracking-widest text-gray-500 hover:text-gray-900 transition-colors",children:_("cancel")}),c.jsx("button",{disabled:Qe.length<2,className:"flex-[2] py-4 bg-primary-600 text-white rounded-2xl font-black uppercase tracking-widest text-xs shadow-xl shadow-primary-600/30 disabled:opacity-30 transition-all",children:Oe?_("saveChanges")||"Guardar":_("saveLook")})]})]},Oe?Oe.id:"new")]}),c.jsxs("div",{className:"space-y-4",children:[c.jsx("p",{className:"text-xs font-black uppercase opacity-50 tracking-widest px-2",children:_("closetLabel")}),c.jsx("div",{className:"grid grid-cols-4 gap-3 max-h-96 overflow-y-auto pr-2 custom-scrollbar",children:Ic.map(p=>c.jsxs("button",{onClick:()=>!Qe.includes(p.id)&&At([...Qe,p.id]),className:`relative rounded-xl overflow-hidden aspect-square border-2 transition-all ${Qe.includes(p.id)?"border-primary-600 scale-90":"border-transparent hover:border-primary-200"}`,children:[c.jsx("img",{src:p.imageUrl,className:"w-full h-full object-cover",alt:""}),p.status==="wishlist"&&c.jsx("div",{className:"absolute top-1 left-1 bg-yellow-500 text-white p-1 rounded-md shadow-md",children:c.jsx(Xy,{size:10})}),Qe.includes(p.id)&&c.jsx("div",{className:"absolute inset-0 bg-primary-600/40 flex items-center justify-center text-white",children:c.jsx(Xn,{size:20})})]},p.id))})]})]}),c.jsx("div",{className:"lg:col-span-2 space-y-6 md:space-y-10",children:(()=>{const p=u.filter(M=>{const J=Nt==="all"||M.sections&&M.sections.includes(Nt);let te=!0;Qt&&(te=M.items.some(ne=>{const ke=o.find(_t=>_t.id===ne);return ke&&ke.color&&ke.color.includes(Qt)}));const X=!se||M.favorite;return J&&te&&X}),x=p.filter(M=>M.items.every(J=>{const te=o.find(X=>X.id===J);return!te||te.status!=="laundry"})),D=p.filter(M=>M.items.some(J=>{const te=o.find(X=>X.id===J);return te&&te.status==="laundry"})),z=M=>{const J=M.items.some(te=>{const X=o.find(ne=>ne.id===te);return X&&X.status==="laundry"});return c.jsxs(Ve,{className:`p-5 md:p-8 group hover:shadow-2xl transition-all border-none shadow-md ${J?"opacity-75":""}`,darkMode:g,children:[c.jsxs("div",{className:"flex justify-between items-start mb-6",children:[c.jsxs("div",{className:"text-inherit",children:[c.jsx("h4",{className:"text-xl font-black tracking-tight",children:M.name}),c.jsxs("p",{className:"text-[10px] opacity-40 font-bold uppercase tracking-widest",children:[M.items.length," ",_("pieces")," • ",new Date(M.createdAt).toLocaleDateString()]})]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsxs("button",{onClick:()=>oo(M),className:`p-2 transition-colors relative group/share ${Yi===M.id?"text-green-500":"text-gray-300 hover:text-green-500"}`,title:"Partilhar outfit",children:[Yi===M.id?c.jsx(Xn,{size:18}):c.jsx(Yy,{size:18}),c.jsx("span",{className:"absolute -top-8 left-1/2 -translate-x-1/2 bg-gray-900 text-white text-[9px] font-black uppercase tracking-widest px-2 py-1 rounded-lg whitespace-nowrap opacity-0 group-hover/share:opacity-100 transition-opacity pointer-events-none",children:Yi===M.id?_("linkCopied"):_("share")})]}),c.jsx("button",{onClick:()=>Cc("favorite",M),className:`p-2 transition-colors relative group/fav ${M.favorite?"text-rose-500":"text-gray-300 hover:text-rose-500"}`,title:"Favorito",children:c.jsx(qh,{size:18,fill:M.favorite?"currentColor":"none"})}),c.jsx("button",{onClick:()=>{Jt(M),At(M.items)},className:"p-2 text-gray-300 hover:text-primary-500 transition-colors",children:c.jsx(eu,{size:18})}),c.jsx("button",{onClick:()=>Pc(M),className:"p-2 text-gray-300 hover:text-blue-500 transition-colors",title:"Lavar outfit inteiro",children:c.jsx(ss,{size:18})}),c.jsx("button",{onClick:()=>Ac(M.id),className:"p-2 text-gray-300 hover:text-red-500 transition-colors",children:c.jsx(tu,{size:18})})]})]}),c.jsx("div",{className:"flex -space-x-4 mb-4",children:M.items.map(te=>{const X=o.find(ke=>ke.id===te),ne=(X==null?void 0:X.status)==="laundry";return c.jsxs("div",{className:`relative w-20 h-20 rounded-2xl border-4 overflow-hidden shadow-lg transform group-hover:rotate-6 transition-transform ${ne?"border-blue-400":"border-white dark:border-gray-800"}`,children:[c.jsx("img",{src:X==null?void 0:X.imageUrl,className:`w-full h-full object-cover ${ne?"brightness-75":""}`,alt:""}),ne&&c.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-blue-500/30 backdrop-blur-[1px]",children:c.jsx(ss,{size:18,className:"text-white drop-shadow"})})]},te)})}),J&&c.jsxs("div",{className:"flex items-center gap-2 mt-2 px-3 py-2 bg-blue-50 dark:bg-blue-900/20 rounded-xl",children:[c.jsx(ss,{size:14,className:"text-blue-500 shrink-0"}),c.jsxs("p",{className:"text-[10px] font-black uppercase tracking-widest text-blue-500",children:[M.items.filter(te=>{const X=o.find(ne=>ne.id===te);return(X==null?void 0:X.status)==="laundry"}).length," ",_("piecesInLaundry")]})]}),M.sections&&M.sections.length>0&&c.jsx("div",{className:"flex items-center gap-1 mt-4 overflow-x-auto custom-scrollbar no-scrollbar",children:M.sections.map(te=>{const X=gn.find(ne=>ne.id===te);return X?c.jsx("span",{className:"text-[10px] font-bold px-2 py-0.5 rounded-md bg-gray-100 dark:bg-gray-800 text-gray-500 whitespace-nowrap",children:X.name},X.id):null})})]},M.id)};return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex items-center justify-between px-2 flex-wrap gap-4",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-green-500"}),c.jsxs("h3",{className:"text-2xl font-black tracking-tighter text-inherit",children:[_("lookHistory")," ",c.jsxs("span",{className:"text-sm font-bold opacity-40",children:["— ",_("availableLooks")," (",x.length,")"]})]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs("button",{onClick:Me,className:`flex items-center gap-2 px-4 py-2 rounded-xl font-black text-[10px] uppercase tracking-widest transition-colors ${g?"bg-primary-900/30 text-primary-400 hover:bg-primary-900/50":"bg-primary-50 text-primary-600 hover:bg-primary-100"}`,title:_("pasteSharedLookLink")||"Colar link de look",children:[c.jsx(sb,{size:14})," ",c.jsx("span",{className:"hidden sm:inline",children:_("pasteLink")||"Colar Link"})]}),c.jsx($h,{size:16,className:"text-gray-400 ml-2"}),c.jsxs("select",{value:Qt,onChange:M=>Yt(M.target.value),className:`p-2 rounded-xl border-none outline-none focus:ring-2 focus:ring-primary-500 font-bold text-xs ${g?"bg-gray-800 text-white":"bg-gray-100"}`,children:[c.jsx("option",{value:"",children:_("all")||"Todas as cores"}),["Vermelho","Azul","Amarelo","Verde","Laranja","Roxo","Branco","Preto","Cinzento","Bege"].map(M=>c.jsx("option",{value:M,children:M},M))]})]})]}),x.length>0?c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 md:gap-8",children:x.map(z)}):c.jsx("div",{className:"py-6 md:py-12 text-center opacity-20 font-black uppercase tracking-[0.3em] text-sm",children:_("noLooksAvailable")})]}),D.length>0&&c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex items-center gap-3 px-2",children:[c.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-blue-400"}),c.jsxs("h3",{className:"text-2xl font-black tracking-tighter text-inherit",children:[_("toBeWashed")," ",c.jsxs("span",{className:"text-sm font-bold opacity-40",children:["— ",_("unavailable")," (",D.length,")"]})]})]}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 md:gap-8",children:D.map(z)})]})]})})()})]})}),t==="planner"&&(()=>{const p=Rn.getFullYear(),x=Rn.getMonth(),D=K=>`${K.getFullYear()}-${String(K.getMonth()+1).padStart(2,"0")}-${String(K.getDate()).padStart(2,"0")}`,z=()=>{const K=new Date(p,x,1),Pt=new Date(p,x+1,0),ln=(K.getDay()+6)%7,xn=[];for(let ct=0;ct<ln;ct++)xn.push({date:new Date(p,x,1-ln+ct),cur:!1});for(let ct=1;ct<=Pt.getDate();ct++)xn.push({date:new Date(p,x,ct),cur:!0});const Ir=(7-xn.length%7)%7;for(let ct=1;ct<=Ir;ct++)xn.push({date:new Date(p,x+1,ct),cur:!1});return xn},M=()=>{const K=new Date(Rn),Pt=(K.getDay()+6)%7,ln=new Date(K);return ln.setDate(K.getDate()-Pt),Array.from({length:7},(xn,Ir)=>{const ct=new Date(ln);return ct.setDate(ln.getDate()+Ir),ct})},te={PT:"pt-PT",EN:"en-GB",ES:"es-ES",FR:"fr-FR",DE:"de-DE"}[yt]||"pt-PT",X=Array.from({length:12},(K,Pt)=>{const xn=new Date(2e3,Pt,1).toLocaleDateString(te,{month:"long"});return xn.charAt(0).toUpperCase()+xn.slice(1)}),ne=Array.from({length:7},(K,Pt)=>new Date(2024,0,Pt+1).toLocaleDateString(te,{weekday:"short"}).replace(".","")),ke=()=>{const K=new Date(Rn);_e==="month"?K.setMonth(x-1):K.setDate(K.getDate()-7),Er(K)},_t=()=>{const K=new Date(Rn);_e==="month"?K.setMonth(x+1):K.setDate(K.getDate()+7),Er(K)},lt=M(),xt=`${lt[0].getDate()} ${X[lt[0].getMonth()]} — ${lt[6].getDate()} ${X[lt[6].getMonth()]} ${lt[6].getFullYear()}`,Ie=({date:K,cur:Pt=!0})=>{const ln=D(K),xn=ai(ln),Ir=ln===so,ct=_e==="week";let is=null;return Zr&&vt&&vt.forecast&&(is=vt.forecast.find(co=>co.date===ln)),c.jsxs("div",{onClick:()=>{Kn(ln),Xs(!0)},className:`relative rounded-2xl overflow-hidden cursor-pointer transition-all group border-2 flex flex-col ${Ir?"border-primary-600 shadow-lg shadow-primary-600/20":Pt?"border-transparent hover:border-primary-300 dark:hover:border-primary-700":"border-transparent opacity-30"} ${g?"bg-gray-800/80":"bg-gray-50"}`,style:{minHeight:ct?"180px":"100px"},children:[c.jsxs("div",{className:`px-3 py-2 flex items-center justify-between shrink-0 ${Ir?"bg-primary-600":""}`,children:[c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx("span",{className:`text-xs font-black ${Ir?"text-white":""}`,children:K.getDate()}),is&&c.jsxs("div",{className:"flex items-center gap-1 text-xs",title:`${is.min}ºC - ${is.max}ºC`,children:[c.jsx("span",{className:"text-sm drop-shadow-sm",children:hh(is.weathercode)}),c.jsxs("span",{className:`text-[10px] font-black ${Ir?"text-white/90":"text-gray-500 dark:text-gray-400"}`,children:[Math.round((is.min+is.max)/2),"°C"]})]})]}),Ir&&c.jsx("span",{className:"text-[8px] font-black text-white/80 uppercase tracking-widest",children:_("today")})]}),xn.length>0?c.jsx("div",{className:"px-2 pb-2 pt-1 flex-1 overflow-y-auto custom-scrollbar space-y-3",children:xn.map(co=>c.jsxs("div",{className:"space-y-1",children:[c.jsx("div",{className:"flex -space-x-2",children:co.items.slice(0,ct?4:3).map(Rg=>{const Dg=o.find(Tk=>Tk.id===Rg);return Dg?c.jsx("div",{className:`${ct?"w-10 h-10":"w-7 h-7"} rounded-lg overflow-hidden border-2 border-white dark:border-gray-700 shrink-0`,children:c.jsx("img",{src:Dg.imageUrl,className:"w-full h-full object-cover",alt:""})},Rg):null})}),c.jsx("p",{className:"text-[9px] font-black uppercase tracking-widest opacity-50 truncate",children:co.name}),ct&&c.jsxs("p",{className:"text-[9px] opacity-40 font-bold",children:[co.items.length," ",_("piecesShort")]})]},co.id))}):Pt&&c.jsx("div",{className:"absolute inset-0 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity",children:c.jsxs("div",{className:`flex items-center gap-1 px-3 py-1.5 rounded-xl text-[9px] font-black uppercase tracking-widest ${g?"bg-gray-700 text-primary-400":"bg-white text-primary-600 shadow-sm"}`,children:[c.jsx(Ba,{size:10})," Outfit"]})})]})};return c.jsxs("div",{className:"space-y-6 animate-in fade-in duration-700 pb-20",children:[c.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-4",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("button",{onClick:ke,className:`p-3 rounded-2xl transition-all border ${g?"bg-gray-800 border-gray-700 hover:bg-gray-700":"bg-white border-gray-200 hover:bg-gray-50"} shadow-sm`,children:c.jsx(Wy,{size:20})}),c.jsx("h3",{className:"text-lg font-black tracking-tight min-w-[220px] text-center",children:_e==="month"?`${X[x]} ${p}`:xt}),c.jsx("button",{onClick:_t,className:`p-3 rounded-2xl transition-all border ${g?"bg-gray-800 border-gray-700 hover:bg-gray-700":"bg-white border-gray-200 hover:bg-gray-50"} shadow-sm`,children:c.jsx(rb,{size:20})}),c.jsx("button",{onClick:()=>Er(new Date),className:"px-4 py-2 text-[10px] font-black uppercase tracking-widest text-primary-600 bg-primary-50 dark:bg-primary-900/20 rounded-xl hover:bg-primary-100 dark:hover:bg-primary-900/40 transition-colors",children:_("today")})]}),c.jsx("div",{className:`flex p-1.5 rounded-2xl gap-1 ${g?"bg-gray-800":"bg-gray-100"}`,children:["month","week"].map(K=>c.jsx("button",{onClick:()=>Js(K),className:`px-5 py-2 rounded-xl font-black text-[10px] uppercase tracking-widest transition-all ${_e===K?`${g?"bg-gray-700":"bg-white"} shadow-md text-primary-600`:"text-gray-500 hover:text-gray-700"}`,children:_(K==="month"?"monthLabel":"weekLabel")},K))})]}),c.jsx("div",{className:"grid grid-cols-7 gap-2",children:ne.map(K=>c.jsx("div",{className:"text-center text-[10px] font-black uppercase tracking-widest opacity-40 py-1",children:K},K))}),_e==="month"?c.jsx("div",{className:"grid grid-cols-7 gap-2",children:z().map(({date:K,cur:Pt})=>c.jsx(Ie,{date:K,cur:Pt},D(K)))}):c.jsx("div",{className:"grid grid-cols-7 gap-3",children:M().map(K=>c.jsx(Ie,{date:K,cur:!0},D(K)))})]})})(),(t==="add"||t==="edit")&&c.jsx("div",{className:"max-w-4xl mx-auto animate-in zoom-in-95 duration-500",children:c.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6 md:gap-12 items-start",children:[c.jsxs("div",{className:"space-y-5 md:space-y-8",children:[c.jsx("h3",{className:"text-5xl font-black tracking-tighter text-inherit",children:_(m?"edit":"newItem")}),c.jsx(Ve,{className:"aspect-[3/4] overflow-hidden shadow-2xl relative",darkMode:g,children:B?c.jsx("img",{src:B,className:"w-full h-full object-cover",alt:""}):c.jsxs("div",{className:"h-full flex flex-col items-center justify-center opacity-10",children:[c.jsx(Wh,{size:100}),c.jsx("p",{className:"font-black uppercase tracking-[0.5em] mt-6",children:_("preview")})]})})]}),c.jsx(Ve,{className:"p-6 md:p-10 shadow-2xl",darkMode:g,children:c.jsxs("form",{onSubmit:Aa,className:"space-y-5 md:space-y-8",children:[c.jsx(cu,{label:_("name"),name:"name",defaultValue:m==null?void 0:m.name,required:!0}),c.jsxs("div",{className:"space-y-2",children:[c.jsx("label",{className:"text-[10px] font-black uppercase opacity-40 tracking-widest ml-1 text-inherit",children:_("category")}),c.jsxs("select",{name:"category",defaultValue:(m==null?void 0:m.category)||"Tops",className:`w-full p-5 rounded-2xl border-none outline-none focus:ring-4 focus:ring-primary-500/10 font-bold ${g?"bg-gray-700 text-white":"bg-gray-100"}`,children:[c.jsx("option",{children:_("tops")}),c.jsx("option",{children:_("bottoms")}),c.jsx("option",{children:_("footwear")}),c.jsx("option",{children:_("coats")}),c.jsx("option",{children:_("accessories")})]})]}),c.jsxs("label",{className:"flex items-center gap-3 p-4 rounded-xl border border-gray-100 dark:border-gray-800 cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors",children:[c.jsx("input",{type:"checkbox",name:"isWishlist",defaultChecked:(m==null?void 0:m.status)==="wishlist",className:"w-5 h-5 text-primary-600 focus:ring-primary-500 rounded-lg"}),c.jsxs("div",{children:[c.jsx("span",{className:"font-bold text-sm text-inherit",children:_("wishlist")||_("wishlistDesc")}),c.jsx("p",{className:"text-[10px] uppercase tracking-widest opacity-50",children:_("addFuturePurchase")})]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsxs("label",{className:"text-[10px] font-black uppercase opacity-40 tracking-widest ml-1 text-inherit",children:[_("color")," *"]}),c.jsx("div",{className:"flex flex-wrap gap-2",children:["Vermelho","Azul","Amarelo","Verde","Laranja","Roxo","Branco","Preto","Cinzento","Bege"].map(p=>c.jsx("button",{type:"button",onClick:()=>{k.includes(p)?C(k.filter(x=>x!==p)):C([...k,p])},className:`px-4 py-2 rounded-xl text-xs font-bold transition-all border-2 ${k.includes(p)?"border-primary-600 bg-primary-600 text-white shadow-lg shadow-primary-600/30":"border-transparent bg-gray-100 dark:bg-gray-800 text-gray-500 hover:bg-gray-200 dark:hover:bg-gray-700"}`,children:p},p))}),c.jsx("input",{type:"hidden",name:"color",value:k.join(", ")}),k.length===0&&c.jsx("p",{className:"text-[10px] text-red-500 uppercase tracking-widest font-black mt-2",children:_("selectOneColor")})]}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("label",{className:"text-[10px] font-black uppercase opacity-40 tracking-widest ml-1 text-inherit flex items-center gap-2",children:[c.jsx(Wh,{size:12})," ",_("imageUrl")," ou Upload"]}),c.jsxs("div",{className:"flex flex-col gap-3",children:[c.jsx("input",{type:"text",name:"imageUrl",value:B,onChange:p=>I(p.target.value),placeholder:"https://...",className:`w-full p-5 rounded-2xl border-none outline-none focus:ring-4 focus:ring-primary-500/10 font-bold transition-all ${g?"bg-gray-700 text-white":"bg-gray-100 text-gray-900"}`}),c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsx("div",{className:"h-px bg-gray-200 dark:bg-gray-700 flex-1"}),c.jsx("span",{className:"text-[10px] font-black uppercase tracking-widest opacity-30",children:_("or")}),c.jsx("div",{className:"h-px bg-gray-200 dark:bg-gray-700 flex-1"})]}),c.jsxs("label",{className:`flex items-center justify-center gap-3 p-5 rounded-2xl cursor-pointer transition-all font-black text-[10px] uppercase tracking-widest border-2 border-dashed ${g?"bg-gray-800 border-gray-700 hover:border-primary-500 hover:text-primary-400":"bg-gray-50 border-gray-200 hover:border-primary-400 hover:text-primary-600"}`,children:[c.jsx(Wh,{size:16}),c.jsx("span",{children:_("uploadGallery")}),c.jsx("input",{type:"file",accept:"image/*",className:"hidden",onChange:Lc})]})]})]}),c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("label",{className:"text-[10px] font-black uppercase opacity-40 tracking-widest ml-1 text-inherit flex items-center gap-2",children:[c.jsx(Zy,{size:12})," ",_("assignSections")]}),c.jsxs("button",{type:"button",onClick:()=>yn(!0),className:"text-[10px] font-black uppercase tracking-widest text-primary-600 hover:text-primary-700 flex items-center gap-1",children:[c.jsx(Ba,{size:10})," ",_("createSection")]})]}),gn.length===0?c.jsx("div",{className:"p-4 border-2 border-dashed border-gray-200 dark:border-gray-800 rounded-2xl text-center",children:c.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest opacity-40",children:_("noSectionsCreated")})}):c.jsx("div",{className:"flex flex-wrap gap-2",children:gn.map(p=>c.jsxs("button",{type:"button",onClick:()=>{wr.includes(p.id)?Ks(wr.filter(x=>x!==p.id)):Ks([...wr,p.id])},className:`flex items-center gap-2 px-4 py-2 rounded-xl text-xs font-bold transition-all border-2 ${wr.includes(p.id)?"border-primary-600 bg-primary-600 text-white shadow-lg shadow-primary-600/30":"border-transparent bg-gray-100 dark:bg-gray-800 text-gray-500 hover:bg-gray-200 dark:hover:bg-gray-700"}`,children:[p.name,wr.includes(p.id)&&c.jsx(Xn,{size:12})]},p.id))})]}),c.jsxs("div",{className:"flex gap-4 pt-6",children:[c.jsx("button",{type:"button",onClick:()=>{v(null),I(""),e("closet")},className:"flex-1 font-black uppercase text-[10px] opacity-40 hover:opacity-100 tracking-widest transition-all text-inherit",children:_("cancel")}),c.jsx("button",{type:"submit",className:"flex-1 py-5 bg-primary-600 text-white rounded-3xl md:rounded-[2rem] font-black uppercase tracking-widest text-[10px] shadow-2xl shadow-primary-600/40 hover:scale-[1.02] active:scale-95 transition-all",children:_(m?"save":"register")})]})]})})]})}),t==="profile"&&c.jsxs("div",{className:"max-w-4xl mx-auto space-y-5 md:space-y-8 md:space-y-12 animate-in fade-in duration-700 pb-20",children:[c.jsx(Ve,{className:"p-6 md:p-10 border-primary-100 relative overflow-hidden",darkMode:g,children:c.jsxs("div",{className:"flex items-center gap-4 md:gap-8 relative z-10 text-inherit",children:[c.jsxs("div",{className:"w-24 h-24 rounded-[2.5rem] bg-primary-600 flex items-center justify-center text-white text-4xl font-black shadow-2xl relative overflow-hidden group cursor-pointer",children:[F!=null&&F.avatar?c.jsx("img",{src:F.avatar,className:"w-full h-full object-cover",alt:"Profile"}):c.jsx("span",{children:(((O=F==null?void 0:F.fullName)==null?void 0:O[0])||((Q=F==null?void 0:F.username)==null?void 0:Q[0])||((Ee=n==null?void 0:n.email)==null?void 0:Ee[0])||"U").toUpperCase()}),c.jsxs("label",{className:"absolute inset-0 bg-black/50 flex flex-col items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity cursor-pointer text-white",children:[c.jsx(eu,{size:20}),c.jsx("span",{className:"text-[8px] uppercase font-black mt-1 tracking-widest",children:_("edit")}),c.jsx("input",{type:"file",accept:"image/*",className:"hidden",onChange:Oc})]})]}),c.jsxs("div",{children:[c.jsx("h3",{className:"text-3xl font-black tracking-tighter",children:(F==null?void 0:F.fullName)||_("yourAccount")}),c.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[c.jsxs("p",{className:"opacity-60 font-bold text-sm",children:["@",(F==null?void 0:F.username)||((tt=n==null?void 0:n.email)==null?void 0:tt.split("@")[0])||_("papMode")]}),c.jsx("button",{onClick:p=>{var x;p.stopPropagation(),navigator.clipboard.writeText(`@${(F==null?void 0:F.username)||((x=n==null?void 0:n.email)==null?void 0:x.split("@")[0])||_("papMode")}`),Le("Username copiado!"),setTimeout(()=>Le(null),2e3)},className:"text-blue-500 hover:text-blue-600 bg-blue-500/10 p-1.5 rounded-md transition-colors",title:"Copiar Username",children:c.jsx(za,{size:14})})]})]})]})}),c.jsxs(Ve,{className:"p-5 md:p-8",darkMode:g,children:[c.jsxs("h3",{className:"text-xl font-black mb-6 flex items-center gap-3 text-inherit",children:[c.jsx(Hy,{className:"text-primary-600"})," ",_("profileInfo")]}),c.jsxs("form",{onSubmit:li,className:"space-y-6",children:[c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[c.jsxs("div",{className:"space-y-2 relative",children:[c.jsx("label",{className:"text-[10px] font-black uppercase opacity-40 tracking-widest ml-1 text-inherit",children:_("username")}),c.jsxs("div",{className:"relative",children:[c.jsx("span",{className:"absolute left-4 top-1/2 -translate-y-1/2 opacity-40 font-black",children:"@"}),c.jsx("input",{name:"username",defaultValue:(F==null?void 0:F.username)||"",placeholder:"amari",className:`w-full p-4 pl-10 rounded-xl border-none outline-none focus:ring-2 focus:ring-primary-500 font-bold ${g?"bg-gray-800 text-white":"bg-gray-50"}`})]})]}),c.jsx(cu,{label:_("fullName"),name:"fullName",defaultValue:(F==null?void 0:F.fullName)||"",placeholder:"Ex: Amari Rodriguez"}),c.jsxs("div",{className:"space-y-2",children:[c.jsxs("label",{className:"text-[10px] font-black uppercase opacity-40 tracking-widest ml-1 text-inherit",children:[_("dob")," ",_("optional")]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsxs("div",{className:"relative flex-1",children:[c.jsxs("select",{name:"dobDay",defaultValue:((ge=F==null?void 0:F.dob)==null?void 0:ge.split("-")[2])||"",className:`w-full appearance-none p-4 pr-10 rounded-xl border-none outline-none focus:ring-2 focus:ring-primary-500/40 font-bold transition-all cursor-pointer ${g?"bg-gray-800 text-white hover:bg-gray-700":"bg-gray-100 text-gray-900 hover:bg-gray-200"}`,children:[c.jsx("option",{value:"",children:"DD"}),Array.from({length:31},(p,x)=>String(x+1).padStart(2,"0")).map(p=>c.jsx("option",{value:p,children:p},p))]}),c.jsx(Bh,{size:14,className:"absolute right-3 top-1/2 -translate-y-1/2 opacity-40 pointer-events-none"})]}),c.jsxs("div",{className:"relative flex-1",children:[c.jsxs("select",{name:"dobMonth",defaultValue:((ot=F==null?void 0:F.dob)==null?void 0:ot.split("-")[1])||"",className:`w-full appearance-none p-4 pr-10 rounded-xl border-none outline-none focus:ring-2 focus:ring-primary-500/40 font-bold transition-all cursor-pointer ${g?"bg-gray-800 text-white hover:bg-gray-700":"bg-gray-100 text-gray-900 hover:bg-gray-200"}`,children:[c.jsx("option",{value:"",children:"MM"}),Array.from({length:12},(p,x)=>String(x+1).padStart(2,"0")).map(p=>c.jsx("option",{value:p,children:p},p))]}),c.jsx(Bh,{size:14,className:"absolute right-3 top-1/2 -translate-y-1/2 opacity-40 pointer-events-none"})]}),c.jsxs("div",{className:"relative flex-[1.5]",children:[c.jsxs("select",{name:"dobYear",defaultValue:((at=F==null?void 0:F.dob)==null?void 0:at.split("-")[0])||"",className:`w-full appearance-none p-4 pr-10 rounded-xl border-none outline-none focus:ring-2 focus:ring-primary-500/40 font-bold transition-all cursor-pointer ${g?"bg-gray-800 text-white hover:bg-gray-700":"bg-gray-100 text-gray-900 hover:bg-gray-200"}`,children:[c.jsx("option",{value:"",children:"YYYY"}),Array.from({length:100},(p,x)=>new Date().getFullYear()-x).map(p=>c.jsx("option",{value:p,children:p},p))]}),c.jsx(Bh,{size:14,className:"absolute right-3 top-1/2 -translate-y-1/2 opacity-40 pointer-events-none"})]})]})]}),c.jsx(cu,{label:`${_("bio")} ${_("optional")}`,name:"bio",defaultValue:(F==null?void 0:F.bio)||"",placeholder:"..."}),c.jsx(cu,{label:_("location"),name:"location",defaultValue:(F==null?void 0:F.location)||"",placeholder:_("locationEx")})]}),c.jsx("button",{disabled:Bi,type:"submit",className:"w-full py-4 bg-primary-600 text-white rounded-xl font-black uppercase text-[10px] tracking-widest shadow-xl shadow-primary-600/30 disabled:opacity-50 hover:scale-[1.01] transition-all",children:_(Bi?"saving":"save")})]},`${F==null?void 0:F.username}-${F==null?void 0:F.fullName}-${F==null?void 0:F.dob}-${F==null?void 0:F.bio}-${F==null?void 0:F.location}`)]})]}),t==="community"&&c.jsx("div",{className:"max-w-7xl mx-auto space-y-5 md:space-y-8 md:space-y-12 animate-in fade-in duration-700 pb-20",children:Ue?c.jsxs("div",{className:"space-y-5 md:space-y-8",children:[c.jsxs("button",{onClick:()=>{ga(null),Gi(!1)},className:"flex items-center gap-2 opacity-60 hover:opacity-100 transition-opacity font-black text-inherit uppercase text-xs tracking-widest",children:[c.jsx(Wy,{size:16})," Voltar"]}),c.jsx(Ve,{className:"p-5 md:p-8 border-primary-100 relative overflow-hidden",darkMode:g,children:c.jsxs("div",{className:"flex items-center gap-4 md:gap-8 relative z-10 text-inherit",children:[c.jsx("div",{className:"w-24 h-24 rounded-[2.5rem] bg-primary-600 text-white flex items-center justify-center font-black text-4xl overflow-hidden",children:Ue.avatar?c.jsx("img",{src:Ue.avatar,className:"w-full h-full object-cover",alt:"Avatar"}):c.jsx("span",{children:(((Sr=Ue.fullName)==null?void 0:Sr[0])||((Zt=Ue.username)==null?void 0:Zt[0])||"U").toUpperCase()})}),c.jsxs("div",{className:"flex-1 flex justify-between items-start sm:items-center flex-col sm:flex-row gap-4",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-3xl font-black tracking-tighter",children:Ue.fullName||_("userTitle")}),c.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[c.jsxs("p",{className:"opacity-60 font-bold text-sm",children:["@",Ue.username||"user"]}),c.jsx("button",{onClick:p=>{p.stopPropagation(),navigator.clipboard.writeText(`@${Ue.username||"user"}`),Le("Username copiado!"),setTimeout(()=>Le(null),2e3)},className:"text-blue-500 hover:text-blue-600 bg-blue-500/10 p-1.5 rounded-md transition-colors",title:"Copiar Username",children:c.jsx(za,{size:14})})]})]}),c.jsxs("button",{onClick:()=>Gi(!0),className:"px-5 py-3 bg-primary-100 text-primary-700 dark:bg-primary-900/50 dark:text-primary-300 rounded-2xl font-black text-sm transition-all hover:scale-105 flex items-center gap-2",children:[c.jsx(ho,{size:16})," Inspecionar"]})]})]})}),wt&&c.jsx("div",{className:"fixed inset-0 z-[200] flex items-center justify-center bg-black/60 backdrop-blur-sm p-6",onClick:()=>Gi(!1),children:c.jsxs(Ve,{className:"w-full max-w-lg p-5 md:p-8 animate-in zoom-in-95 relative",darkMode:g,onClick:p=>p.stopPropagation(),children:[c.jsx("button",{onClick:()=>Gi(!1),className:"absolute top-6 right-6 opacity-50 hover:opacity-100 text-inherit",children:c.jsx(Cr,{size:24})}),c.jsxs("div",{className:"flex items-center gap-6 mb-5 md:mb-8 text-inherit",children:[c.jsx("div",{className:"w-20 h-20 rounded-3xl md:rounded-[2rem] bg-primary-600 text-white flex items-center justify-center font-black text-3xl overflow-hidden",children:Ue.avatar?c.jsx("img",{src:Ue.avatar,className:"w-full h-full object-cover",alt:"Avatar"}):c.jsx("span",{children:(((rs=Ue.fullName)==null?void 0:rs[0])||((lo=Ue.username)==null?void 0:lo[0])||"U").toUpperCase()})}),c.jsxs("div",{children:[c.jsx("h3",{className:"text-2xl font-black",children:Ue.fullName||_("userTitle")}),c.jsxs("p",{className:"opacity-60 font-bold",children:["@",Ue.username||"user"]})]})]}),c.jsxs("div",{className:"space-y-6 text-inherit bg-gray-50 dark:bg-gray-800/50 p-6 rounded-3xl",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-black uppercase tracking-widest opacity-50 mb-1",children:_("dob")}),c.jsx("p",{className:"font-bold",children:et!=null&&et.dob?new Date(et.dob).toLocaleDateString():"Não especificada"})]}),c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-black uppercase tracking-widest opacity-50 mb-1",children:_("location")}),c.jsx("p",{className:"font-bold",children:(et==null?void 0:et.location)||Ue.location||"Não especificada"})]}),c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-black uppercase tracking-widest opacity-50 mb-1",children:_("bio")}),c.jsx("p",{className:"font-bold opacity-80",children:(et==null?void 0:et.bio)||"Sem biografia"})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-4 pt-4 border-t border-gray-200 dark:border-gray-700",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-black uppercase tracking-widest opacity-50 mb-1",children:_("registeredPieces")}),c.jsx("p",{className:"text-2xl font-black",children:Xt.length})]}),c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-black uppercase tracking-widest opacity-50 mb-1",children:_("createdOutfits")}),c.jsx("p",{className:"text-2xl font-black",children:ya.length})]})]}),c.jsxs("div",{className:"pt-4 border-t border-gray-200 dark:border-gray-700",children:[c.jsx("p",{className:"text-xs font-black uppercase tracking-widest opacity-50 mb-1",children:_("accountRegistrationDate")}),c.jsx("p",{className:"font-bold",children:et!=null&&et.createdAt?new Date(et.createdAt).toLocaleDateString():"Desconhecida"})]})]})]})}),Ue.isPrivate?c.jsxs("div",{className:"text-center py-20 opacity-50 font-black text-2xl text-inherit",children:[c.jsx(Jy,{className:"w-16 h-16 mx-auto mb-4 opacity-50"}),_("isPrivateUser")]}):c.jsxs("div",{className:"space-y-5 md:space-y-8 md:space-y-12 text-inherit",children:[c.jsxs("div",{children:[c.jsxs("h3",{className:"text-xl font-black mb-6 uppercase tracking-widest text-[11px] opacity-50",children:[_("userOutfits")," (",ya.length,")"]}),c.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-6",children:ya.map(p=>c.jsxs("div",{className:"group relative aspect-[3/4] rounded-3xl md:rounded-[2rem] overflow-hidden bg-gray-100 dark:bg-gray-800 cursor-pointer shadow-lg",children:[p.items&&p.items[0]&&Xt.find(x=>x.id===p.items[0])&&c.jsx("img",{src:Xt.find(x=>x.id===p.items[0]).imageUrl,className:"w-full h-full object-cover group-hover:scale-110 transition-transform duration-700",alt:"Look"}),c.jsxs("div",{className:"absolute inset-0 bg-gradient-to-t from-black/80 via-black/20 to-transparent flex items-end p-6",children:[c.jsx("span",{className:"text-white font-black text-sm flex-1",children:p.name}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{onClick:x=>{x.stopPropagation(),$s(p)},className:"p-2 bg-white/20 hover:bg-white/40 rounded-xl backdrop-blur-sm transition-colors text-white",title:"Inspecionar Outfit",children:c.jsx(ho,{size:16})}),c.jsx("button",{onClick:x=>{x.stopPropagation(),Nc(p)},className:"p-2 bg-white/20 hover:bg-white/40 rounded-xl backdrop-blur-sm transition-colors text-white",title:"Copiar para o meu armário",children:c.jsx(za,{size:16})})]})]})]},p.id))})]}),c.jsxs("div",{children:[c.jsxs("h3",{className:"text-xl font-black mb-6 uppercase tracking-widest text-[11px] opacity-50",children:[_("userCloset")," (",Xt.length,")"]}),c.jsx("div",{className:"grid grid-cols-3 sm:grid-cols-4 md:grid-cols-5 lg:grid-cols-6 gap-4",children:Xt.map(p=>c.jsxs("div",{className:"aspect-square rounded-2xl overflow-hidden bg-gray-100 dark:bg-gray-800 shadow-md group relative",children:[c.jsx("img",{src:p.imageUrl,className:"w-full h-full object-cover group-hover:scale-110 transition-transform duration-700",alt:"Item"}),c.jsxs("div",{className:"absolute inset-0 bg-black/40 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center gap-2",children:[c.jsx("button",{onClick:x=>{x.stopPropagation(),yr(p)},className:"p-2.5 bg-white/20 hover:bg-white/40 rounded-xl backdrop-blur-sm transition-colors text-white",title:"Inspecionar Peça",children:c.jsx(ho,{size:18})}),c.jsx("button",{onClick:x=>{x.stopPropagation(),Pa(p)},className:"p-2.5 bg-white/20 hover:bg-white/40 rounded-xl backdrop-blur-sm transition-colors text-white",title:"Copiar para o meu armário",children:c.jsx(za,{size:18})})]})]},p.id))})]})]})]}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"relative mb-5 md:mb-8 flex gap-4",children:[c.jsxs("div",{className:"relative flex-1",children:[c.jsx(ho,{className:"absolute left-6 top-1/2 -translate-y-1/2 opacity-40 text-inherit",size:24}),c.jsx("input",{type:"text",placeholder:_("searchUsers"),value:Hi,onChange:p=>{ni(p.target.value),p.target.value&&zs(!1)},className:`w-full p-6 pl-16 rounded-3xl font-black text-lg outline-none focus:ring-4 focus:ring-primary-500/20 transition-all shadow-xl shadow-black/5 text-inherit ${g?"bg-gray-800":"bg-white"}`})]}),c.jsxs("button",{onClick:()=>{zs(!gr),gr||ni("")},className:`px-5 md:px-8 rounded-3xl font-black transition-all shadow-xl shadow-black/5 flex items-center justify-center gap-2 whitespace-nowrap ${gr?"bg-primary-600 text-white":g?"bg-gray-800 text-inherit hover:bg-gray-700":"bg-white text-inherit hover:bg-gray-50"}`,children:[c.jsx(ab,{size:20}),c.jsx("span",{className:"hidden sm:inline",children:_("recommended")||"Recomendados"})]})]}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:qn.length===0?c.jsx("div",{className:"col-span-full text-center py-6 md:py-12 opacity-50 text-inherit font-black text-xl",children:_("noUsersFound")}):qn.map(p=>{var x,D;return c.jsx(Ve,{className:"p-6 cursor-pointer hover:scale-105 transition-transform",darkMode:g,onClick:()=>fh(p),children:c.jsxs("div",{className:"flex items-center gap-4 text-inherit",children:[c.jsx("div",{className:"w-16 h-16 rounded-2xl bg-primary-600 text-white flex items-center justify-center font-black text-2xl overflow-hidden",children:p.avatar?c.jsx("img",{src:p.avatar,className:"w-full h-full object-cover",alt:"Avatar"}):c.jsx("span",{children:(((x=p.fullName)==null?void 0:x[0])||((D=p.username)==null?void 0:D[0])||"U").toUpperCase()})}),c.jsxs("div",{children:[c.jsx("h3",{className:"font-black text-lg",children:p.fullName||_("userTitle")}),c.jsxs("p",{className:"text-sm opacity-60 font-bold",children:["@",p.username||"user"]})]})]})},p.uid)})})]})}),t==="settings"&&c.jsxs("div",{className:"max-w-4xl mx-auto space-y-5 md:space-y-8 md:space-y-12 animate-in fade-in duration-700 pb-20",children:[c.jsxs("div",{className:"flex flex-col gap-4 md:gap-8",children:[c.jsxs(Ve,{className:"p-5 md:p-8",darkMode:g,children:[c.jsxs("h3",{className:"text-xl font-black mb-6 flex items-center gap-3 text-inherit",children:[c.jsx(Hh,{className:"text-primary-600"})," ",_("preferences")]}),c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-bold text-inherit",children:_("darkMode")}),c.jsx("p",{className:"text-[10px] uppercase tracking-widest opacity-50 text-inherit",children:_("interfaceAppearance")})]}),c.jsx("button",{onClick:()=>ba(!g),className:`w-14 h-8 rounded-full transition-colors relative ${g?"bg-primary-600":"bg-gray-200"}`,children:c.jsx("div",{className:`w-6 h-6 rounded-full bg-white absolute top-1 transition-all ${g?"left-7":"left-1"}`})})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-bold text-inherit",children:_("themeColor")||"Cor do Tema"}),c.jsx("p",{className:"text-[10px] uppercase tracking-widest opacity-50 text-inherit",children:_("personalizeColor")||"Personalize a cor"})]}),c.jsx("div",{className:"flex gap-2",children:[{id:"theme-indigo",color:"#4f46e5"},{id:"theme-rose",color:"#e11d48"},{id:"theme-emerald",color:"#10b981"},{id:"theme-amber",color:"#f59e0b"},{id:"theme-slate",color:"#64748b"}].map(p=>c.jsx("button",{onClick:()=>lh(p.id),className:`w-6 h-6 rounded-full transition-all flex items-center justify-center ${He===p.id?"ring-2 ring-offset-2 ring-offset-white dark:ring-offset-gray-900 ring-primary-500 scale-110":"hover:scale-110"}`,style:{backgroundColor:p.color},children:He===p.id&&c.jsx(Xn,{size:12,className:"text-white"})},p.id))})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-bold text-inherit flex items-center gap-2",children:_("notifications")}),c.jsx("p",{className:"text-[10px] uppercase tracking-widest opacity-50 text-inherit",children:_("lookReminders")})]}),c.jsx("button",{onClick:()=>Gn(!$i),className:`w-14 h-8 rounded-full transition-colors relative ${$i?"bg-primary-600":"bg-gray-200"}`,children:c.jsx("div",{className:`w-6 h-6 rounded-full bg-white absolute top-1 transition-all ${$i?"left-7":"left-1"}`})})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-bold text-inherit flex items-center gap-2",children:_("keyboardShortcuts")}),c.jsx("p",{className:"text-[10px] uppercase tracking-widest opacity-50 text-inherit",children:_("enableNavigationQE")})]}),c.jsx("button",{onClick:()=>es(!mr),className:`w-14 h-8 rounded-full transition-colors relative ${mr?"bg-primary-600":"bg-gray-200"}`,children:c.jsx("div",{className:`w-6 h-6 rounded-full bg-white absolute top-1 transition-all ${mr?"left-7":"left-1"}`})})]}),c.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-bold text-inherit flex items-center gap-2",children:_("dailyOutfitNotification")}),c.jsx("p",{className:"text-[10px] uppercase tracking-widest opacity-50 text-inherit",children:_("receiveNotificationAtScheduledTime")})]}),c.jsxs("div",{className:"flex items-center gap-4 w-full sm:w-auto justify-between sm:justify-end",children:[pr&&c.jsx("input",{type:"time",value:$n,onChange:p=>{Ls(p.target.value),Ke("dailyOutfitTime",p.target.value),Ms(""),Ke("lastNotifiedDate","")},className:`px-3 py-1.5 rounded-xl text-sm outline-none border font-bold ${g?"bg-gray-800 border-gray-700 text-white":"bg-white border-gray-200 text-gray-900"}`}),c.jsx("button",{onClick:()=>uh(!pr),className:`w-14 h-8 rounded-full transition-colors relative shrink-0 ${pr?"bg-primary-600":"bg-gray-200"}`,children:c.jsx("div",{className:`w-6 h-6 rounded-full bg-white absolute top-1 transition-all ${pr?"left-7":"left-1"}`})})]})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-bold text-inherit flex items-center gap-2",children:_("weatherAlerts")}),c.jsx("p",{className:"text-[10px] uppercase tracking-widest opacity-50 text-inherit",children:_("weatherSuggestions")})]}),c.jsx("button",{onClick:()=>dh(!Zr),className:`w-14 h-8 rounded-full transition-colors relative ${Zr?"bg-primary-600":"bg-gray-200"}`,children:c.jsx("div",{className:`w-6 h-6 rounded-full bg-white absolute top-1 transition-all ${Zr?"left-7":"left-1"}`})})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-bold text-inherit flex items-center gap-2",children:_("privateProfile")}),c.jsx("p",{className:"text-[10px] uppercase tracking-widest opacity-50 text-inherit",children:_("privateProfileDesc")})]}),c.jsx("button",{onClick:()=>bc(!Fs),className:`w-14 h-8 rounded-full transition-colors relative ${Fs?"bg-primary-600":"bg-gray-200"}`,children:c.jsx("div",{className:`w-6 h-6 rounded-full bg-white absolute top-1 transition-all ${Fs?"left-7":"left-1"}`})})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-bold text-inherit",children:_("cardSize")||"Tamanho do Card"}),c.jsx("p",{className:"text-[10px] uppercase tracking-widest opacity-50 text-inherit",children:_("cardSizeDesc")||"Tamanho no armário/carrinho"})]}),c.jsx("div",{className:"flex gap-2",children:["small","medium","large"].map(p=>c.jsx("button",{onClick:()=>Zs(p),className:`px-3 py-1.5 rounded-xl text-[10px] font-black uppercase tracking-widest transition-all border-2 ${Nn===p?"border-primary-600 bg-primary-600 text-white shadow-lg shadow-primary-600/30 scale-105":"border-transparent bg-gray-100 dark:bg-gray-800 text-gray-500 hover:bg-gray-200 dark:hover:bg-gray-700"}`,children:p==="small"?_("small")||"Pequeno":p==="medium"?_("medium")||"Médio":_("large")||"Grande"},p))})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-bold text-inherit",children:_("defaultPage")||"Página Inicial"}),c.jsx("p",{className:"text-[10px] uppercase tracking-widest opacity-50 text-inherit",children:_("defaultPageDesc")||"Página que aparece após o login"})]}),c.jsx("div",{className:"flex gap-2",children:["dashboard","closet","outfits","planner"].map(p=>c.jsx("button",{onClick:()=>eo(p),className:`px-3 py-1.5 rounded-xl text-[10px] font-black uppercase tracking-widest transition-all border-2 ${gc===p?"border-primary-600 bg-primary-600 text-white shadow-lg shadow-primary-600/30 scale-105":"border-transparent bg-gray-100 dark:bg-gray-800 text-gray-500 hover:bg-gray-200 dark:hover:bg-gray-700"}`,children:_(p==="dashboard"?"dashboard":p==="closet"?"myCloset":p==="outfits"?"outfits":"planning")},p))})]}),c.jsxs("div",{className:"flex items-center justify-between pt-4 border-t border-gray-100 dark:border-gray-800",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-bold text-inherit",children:_("appLanguage")}),c.jsx("p",{className:"text-[10px] uppercase tracking-widest opacity-50 text-inherit",children:yt==="PT"?"🇵🇹 "+_("portuguese"):yt==="EN"?"🇬🇧 "+_("english"):yt==="ES"?"🇪🇸 "+_("spanish"):yt==="FR"?"🇫🇷 "+_("french"):yt==="DE"?"🇩🇪 "+_("german"):yt})]}),c.jsx("button",{onClick:()=>Wi(!0),className:"px-5 py-2 font-black text-[10px] uppercase tracking-widest bg-primary-50 text-primary-600 rounded-xl hover:bg-primary-100 transition-colors dark:bg-primary-900/40 dark:text-primary-400",children:_("edit")})]})]})]}),c.jsxs(Ve,{className:"p-5 md:p-8",darkMode:g,children:[c.jsxs("h3",{className:"text-xl font-black mb-6 flex items-center gap-3 text-inherit",children:[c.jsx(Ua,{className:"text-primary-600"})," ",_("feedbackTitle")||"Suporte e Feedback"]}),c.jsx("p",{className:"opacity-60 text-sm font-medium mb-6",children:_("feedbackDesc")||"Tem alguma ideia, sugestão ou encontrou algum problema? Envie uma mensagem diretamente para nós!"}),c.jsxs("form",{onSubmit:async p=>{p.preventDefault();const x=new FormData(p.target),D=x.get("type"),z=x.get("message"),M="faiker027@gmail.com";try{if((await fetch(`https://formsubmit.co/ajax/${M}`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({Tipo:D,Mensagem:z,Utilizador:(n==null?void 0:n.email)||"Desconhecido",_subject:`MyCloset Feedback: ${D}`})})).ok)Le(_("msgSentSuccess")),setTimeout(()=>Le(null),4e3),p.target.reset();else throw new Error("Falha no envio")}catch(J){console.error("Erro ao enviar feedback:",J),Le(_("msgSendError")),setTimeout(()=>Le(null),4e3)}},className:"space-y-4",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsxs("label",{className:"flex items-center gap-3 p-4 rounded-xl border border-gray-100 dark:border-gray-800 cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors",children:[c.jsx("input",{type:"radio",name:"type",value:"Ideia/Sugestão",defaultChecked:!0,className:"text-primary-600 focus:ring-primary-500"}),c.jsx("span",{className:"font-bold text-sm text-inherit",children:_("ideaSuggestion")})]}),c.jsxs("label",{className:"flex items-center gap-3 p-4 rounded-xl border border-gray-100 dark:border-gray-800 cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors",children:[c.jsx("input",{type:"radio",name:"type",value:"Bug/Erro",className:"text-primary-600 focus:ring-primary-500"}),c.jsx("span",{className:"font-bold text-sm text-inherit",children:_("bugError")})]})]}),c.jsx("textarea",{name:"message",required:!0,placeholder:_("writeMessage"),rows:4,className:`w-full p-4 rounded-xl border-none outline-none focus:ring-2 focus:ring-primary-500 font-bold resize-none ${g?"bg-gray-800 text-white":"bg-gray-50"}`}),c.jsx("button",{type:"submit",className:"w-full py-4 bg-primary-600 text-white rounded-xl font-black uppercase text-[10px] tracking-widest shadow-xl shadow-primary-600/30 hover:scale-[1.01] transition-all",children:_("sendMessage")})]})]})]}),c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex items-center justify-between px-2 text-inherit",children:[c.jsxs("h3",{className:"text-xl font-black text-red-500 flex items-center gap-3 tracking-widest uppercase",children:[c.jsx(ev,{size:24})," ",_("recycleBin")]}),ro.length>0&&c.jsx("button",{onClick:ao,className:"text-[10px] font-black text-red-500 uppercase tracking-widest hover:underline",children:_("empty")})]}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:ro.map(p=>c.jsxs(Ve,{className:"p-4 flex items-center gap-5 border-red-50",darkMode:g,children:[c.jsx("img",{src:p.imageUrl,className:"w-16 h-16 rounded-2xl object-cover grayscale opacity-40",alt:""}),c.jsxs("div",{className:"flex-1 min-w-0 text-inherit",children:[c.jsx("p",{className:"font-black text-sm truncate",children:p.name}),c.jsx("p",{className:"text-[10px] font-black text-red-400 uppercase tracking-tighter",children:_("deleted")})]}),c.jsxs("div",{className:"flex gap-1",children:[c.jsx("button",{onClick:()=>Tr("restore",p),className:"p-3 text-primary-600 hover:bg-primary-50 rounded-2xl transition-all",children:c.jsx(hb,{size:18})}),c.jsx("button",{onClick:()=>Tr("delete",p.id),className:"p-3 text-red-600 hover:bg-red-50 rounded-2xl transition-all",children:c.jsx(tu,{size:18})})]})]},p.id))})]}),c.jsx(Ve,{className:"p-6 md:p-10 border-red-200 bg-red-50/10",darkMode:g,children:c.jsxs("div",{className:"flex flex-col md:flex-row items-center justify-between gap-4 md:gap-8",children:[c.jsxs("div",{className:"text-inherit",children:[c.jsxs("h4",{className:"text-xl font-black text-red-700 flex items-center gap-3",children:[c.jsx(Jy,{})," ",_("criticalZone")]}),c.jsx("p",{className:"opacity-60 font-bold text-sm mt-2",children:_("fullCleanActions")})]}),c.jsx("button",{onClick:zt,className:"px-5 md:px-8 py-4 bg-red-600 text-white rounded-2xl font-black uppercase text-[10px] tracking-widest hover:bg-red-700 transition-all",children:_("clearAll")})]})})]})]})]}),ah&&wn&&c.jsx("div",{className:"fixed inset-0 z-[200] flex items-center justify-center bg-black/60 backdrop-blur-sm p-6",onClick:()=>Xs(!1),children:c.jsxs(Ve,{className:"w-full max-w-lg p-5 md:p-8 animate-in zoom-in-95 flex flex-col max-h-[80vh]",darkMode:g,onClick:p=>p.stopPropagation(),children:[c.jsxs("div",{className:"flex items-center justify-between mb-6",children:[c.jsxs("div",{children:[c.jsxs("h3",{className:"text-xl font-black text-inherit flex items-center gap-3",children:[c.jsx($y,{size:22,className:"text-primary-600"})," ",_("chooseOutfit")]}),c.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest opacity-40 mt-1",children:(()=>{const p={PT:"pt-PT",EN:"en-GB",ES:"es-ES",FR:"fr-FR",DE:"de-DE"};return new Date(wn+"T12:00:00").toLocaleDateString(p[yt]||"pt-PT",{weekday:"long",day:"numeric",month:"long"})})()})]}),c.jsx("button",{onClick:()=>Xs(!1),className:"p-2 bg-gray-100 dark:bg-gray-800 rounded-full hover:scale-110 transition-all text-inherit",children:c.jsx(Cr,{size:20})})]}),Zi.find(p=>p.date===wn)&&c.jsxs("button",{onClick:async()=>{await oi(wn,null),Xs(!1)},className:"mb-4 w-full py-3 border-2 border-dashed border-red-200 dark:border-red-900/50 text-red-400 rounded-2xl font-black text-[10px] uppercase tracking-widest hover:border-red-400 hover:text-red-500 transition-all flex items-center justify-center gap-2",children:[c.jsx(tu,{size:14})," ",_("removeOutfitDay")]}),c.jsx("div",{className:"flex-1 overflow-y-auto space-y-3 custom-scrollbar",children:u.length===0?c.jsx("div",{className:"py-6 md:py-12 text-center opacity-30 font-black uppercase tracking-[0.3em] text-sm",children:_("noOutfitCreated")}):u.map(p=>{const x=Zi.find(M=>M.date===wn),z=(x?x.lookIds||(x.lookId?[x.lookId]:[]):[]).includes(p.id);return c.jsxs("button",{onClick:async()=>{await oi(wn,p.id)},className:`w-full flex items-center gap-4 p-4 rounded-2xl transition-all border-2 text-left ${z?"border-primary-600 bg-primary-50 dark:bg-primary-900/20":`border-transparent ${g?"bg-gray-800 hover:bg-gray-700":"bg-gray-50 hover:bg-gray-100"}`}`,children:[c.jsx("div",{className:"flex -space-x-2 shrink-0",children:p.items.slice(0,3).map(M=>{const J=o.find(te=>te.id===M);return J?c.jsx("div",{className:"w-12 h-12 rounded-xl overflow-hidden border-2 border-white dark:border-gray-700",children:c.jsx("img",{src:J.imageUrl,className:"w-full h-full object-cover",alt:""})},M):null})}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("p",{className:"font-black text-sm truncate text-inherit",children:p.name}),c.jsxs("p",{className:"text-[10px] uppercase tracking-widest opacity-40 font-bold",children:[p.items.length," ",_("piecesShort")]})]}),z&&c.jsx(Xn,{size:18,className:"text-primary-600 shrink-0"})]},p.id)})})]})}),Xi&&c.jsx("div",{className:"fixed bottom-8 left-1/2 transform -translate-x-1/2 z-[300] animate-in slide-in-from-bottom-5",children:c.jsxs("div",{className:"bg-gray-900 text-white px-6 py-3 rounded-full shadow-2xl font-bold text-sm tracking-wide flex items-center gap-3",children:[c.jsx(qy,{size:18,className:"text-green-400"}),Xi]})}),Pn&&c.jsx("div",{className:"fixed inset-0 z-[200] flex items-center justify-center bg-black/60 backdrop-blur-sm p-6",onClick:()=>si(!1),children:c.jsxs(Ve,{className:"w-full max-w-md p-5 md:p-8 animate-in zoom-in-95 flex flex-col max-h-[80vh]",darkMode:g,onClick:p=>p.stopPropagation(),children:[c.jsxs("div",{className:"flex items-center justify-between mb-6",children:[c.jsxs("div",{children:[c.jsxs("h3",{className:"text-2xl font-black text-inherit flex items-center gap-3",children:[c.jsx(Ua,{size:24,className:"text-primary-600"})," ",_("notificationsModal")]}),_r.filter(p=>!p.read).length>0&&c.jsxs("p",{className:"text-[10px] font-black uppercase tracking-widest text-primary-600 mt-1",children:[_r.filter(p=>!p.read).length," ",yt==="PT"?"nova(s)":yt==="EN"?"new":yt==="ES"?"nueva(s)":yt==="FR"?"nouvelle(s)":"neue"]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[_r.filter(p=>!p.read).length>0&&c.jsx("button",{onClick:async()=>{const p=Ka(oe);_r.filter(x=>!x.read).forEach(x=>{const D=Ne(oe,"artifacts",ue,"inboxNotifications",x.id);p.update(D,{read:!0})}),await p.commit()},className:"text-[9px] font-black uppercase tracking-widest text-primary-600 hover:underline px-3 py-2 hover:bg-primary-50 dark:hover:bg-primary-900/20 rounded-xl transition-all",children:_("markAllRead")}),c.jsx("button",{onClick:()=>si(!1),className:"p-2 bg-gray-100 dark:bg-gray-800 rounded-full hover:scale-110 transition-all text-inherit",children:c.jsx(Cr,{size:20})})]})]}),c.jsx("div",{className:"flex-1 overflow-y-auto space-y-3 custom-scrollbar",children:_r.length===0?c.jsxs("div",{className:"py-8 md:py-16 text-center flex flex-col items-center gap-4 opacity-30",children:[c.jsx(Ua,{size:40}),c.jsx("span",{className:"font-black uppercase tracking-[0.3em] text-sm",children:_("noNotifications")})]}):_r.map(p=>c.jsxs("div",{className:`p-4 rounded-2xl flex items-start gap-4 transition-all ${p.read?g?"bg-gray-800/60":"bg-gray-50":"bg-primary-50 dark:bg-primary-900/20 border border-primary-100 dark:border-primary-800/40"}`,children:[c.jsx("div",{className:`shrink-0 w-12 h-12 flex items-center justify-center rounded-2xl text-xl shadow-sm ${p.read?g?"bg-gray-700":"bg-gray-200":"bg-primary-100 dark:bg-primary-900/50"}`,children:p.type==="look_copied"?"✂️":c.jsx(Ua,{size:20})}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("p",{className:"font-bold text-sm leading-snug text-inherit",children:p.type==="look_copied"&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-primary-600 font-black",children:p.copiedByEmail})," ",_("lookCopiedBy")," ",c.jsxs("span",{className:"italic",children:['"',p.lookName,'"']})]})}),c.jsxs("p",{className:"text-[10px] uppercase font-black tracking-widest opacity-40 mt-1.5",children:[new Date(p.createdAt).toLocaleDateString()," às ",new Date(p.createdAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})]})]}),!p.read&&c.jsx("button",{onClick:async()=>{const x=Ne(oe,"artifacts",ue,"inboxNotifications",p.id);await Zn(x,{read:!0})},className:"shrink-0 p-2 text-primary-600 hover:bg-primary-100 dark:hover:bg-primary-900/40 rounded-xl transition-all",title:"Marcar como lida",children:c.jsx(Xn,{size:16})})]},p.id))})]})}),xa&&c.jsx("div",{className:"fixed inset-0 z-[200] flex items-center justify-center bg-black/60 backdrop-blur-sm p-6",onClick:()=>yn(!1),children:c.jsxs(Ve,{className:"w-full max-w-lg p-5 md:p-8 animate-in zoom-in-95 flex flex-col max-h-[90vh]",darkMode:g,onClick:p=>p.stopPropagation(),children:[c.jsxs("div",{className:"flex items-center justify-between mb-5 md:mb-8",children:[c.jsxs("h3",{className:"text-2xl font-black text-inherit flex items-center gap-3",children:[c.jsx(Gy,{size:24,className:"text-primary-600"})," ",_("manageSections")]}),c.jsx("button",{onClick:()=>yn(!1),className:"p-2 bg-gray-100 dark:bg-gray-800 rounded-full hover:scale-110 transition-all text-inherit",children:c.jsx(Cr,{size:20})})]}),c.jsxs("div",{className:`flex gap-3 mb-5 md:mb-8 p-4 rounded-2xl ${g?"bg-gray-800":"bg-gray-50"}`,children:[c.jsx("input",{value:vn,onChange:p=>Hs(p.target.value),placeholder:_("sectionPlaceholder"),onKeyDown:p=>p.key==="Enter"&&Sa(),className:`flex-1 p-3 rounded-xl border-none outline-none font-bold ${g?"bg-gray-700 text-white":"bg-white"} shadow-sm`}),c.jsx("button",{onClick:Sa,disabled:!vn.trim(),className:"px-5 py-3 bg-primary-600 text-white rounded-xl font-black text-[10px] uppercase tracking-widest shadow-lg shadow-primary-600/30 hover:scale-105 active:scale-95 transition-all disabled:opacity-30",children:c.jsx(Ba,{size:18})})]}),c.jsx("div",{className:"flex-1 overflow-y-auto space-y-3 custom-scrollbar",children:gn.length===0?c.jsx("div",{className:"py-6 md:py-12 text-center opacity-30 font-black uppercase tracking-[0.3em] text-sm",children:_("noSections")}):gn.map(p=>c.jsx("div",{className:`flex items-center gap-4 p-4 rounded-2xl transition-all ${g?"bg-gray-800":"bg-gray-50"}`,children:Gs===p.id?c.jsxs(c.Fragment,{children:[c.jsx("input",{value:Ys,onChange:x=>Ea(x.target.value),onKeyDown:x=>x.key==="Enter"&&_n(),className:`flex-1 p-2 rounded-xl border-none outline-none font-bold text-sm ${g?"bg-gray-700 text-white":"bg-white"} shadow-sm`}),c.jsx("button",{onClick:_n,disabled:!Ys.trim(),className:"p-2 bg-green-500 text-white rounded-xl shadow-md hover:scale-105 disabled:opacity-30",children:c.jsx(Xn,{size:16})}),c.jsx("button",{onClick:()=>Qs(null),className:"p-2 bg-gray-200 dark:bg-gray-700 text-gray-500 dark:text-gray-400 rounded-xl hover:scale-105",children:c.jsx(Cr,{size:16})})]}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("p",{className:"font-black text-sm truncate",children:p.name}),c.jsxs("p",{className:"text-[10px] opacity-40 font-bold uppercase tracking-widest",children:[o.filter(x=>x.sections&&x.sections.includes(p.id)).length," ",_("pieces")," • ",u.filter(x=>x.sections&&x.sections.includes(p.id)).length," look(s)"]})]}),c.jsx("button",{onClick:()=>{Qs(p.id),Ea(p.name),ka(p.emoji)},className:"p-2 text-gray-400 hover:text-primary-600 hover:bg-primary-50 dark:hover:bg-primary-900/20 rounded-xl transition-all",children:c.jsx(eu,{size:16})}),c.jsx("button",{onClick:()=>ph(p.id),className:"p-2 text-red-400 hover:text-red-600 hover:bg-red-50 dark:hover:bg-red-900/20 rounded-xl transition-all",children:c.jsx(tu,{size:16})})]})},p.id))}),c.jsx("button",{onClick:()=>yn(!1),className:"mt-5 md:mt-8 w-full py-4 font-black uppercase text-[10px] tracking-widest text-gray-500 hover:text-gray-900 dark:hover:text-white transition-colors",children:_("cancel")})]})}),Te&&c.jsx("div",{className:"fixed inset-0 z-[200] flex items-center justify-center bg-black/60 backdrop-blur-sm p-6",onClick:()=>Ae(!1),children:c.jsxs(Ve,{className:"w-full max-w-lg p-5 md:p-8 animate-in zoom-in-95 flex flex-col max-h-[90vh]",darkMode:g,onClick:p=>p.stopPropagation(),children:[c.jsxs("div",{className:"flex items-center justify-between mb-5 md:mb-8",children:[c.jsxs("h3",{className:"text-2xl font-black text-inherit flex items-center gap-3",children:[c.jsx($h,{size:24,className:"text-primary-600"})," ",_("advancedFilters")]}),c.jsx("button",{onClick:()=>Ae(!1),className:"p-2 bg-gray-100 dark:bg-gray-800 rounded-full hover:scale-110 transition-all text-inherit",children:c.jsx(Cr,{size:20})})]}),c.jsxs("div",{className:"flex-1 overflow-y-auto space-y-5 md:space-y-8 pr-2 custom-scrollbar",children:[c.jsxs("div",{className:"space-y-4",children:[c.jsx("label",{className:"text-[10px] font-black uppercase opacity-40 tracking-widest ml-1 text-inherit",children:_("closet")}),c.jsx("div",{className:"flex flex-wrap gap-2",children:[_("all"),_("tops"),_("bottoms"),_("footwear"),_("coats"),_("accessories")].map(p=>c.jsx("button",{onClick:()=>An(p),className:`px-5 py-3 rounded-xl font-black text-[10px] uppercase tracking-widest transition-all ${Xe===p?"bg-primary-600 text-white shadow-xl shadow-primary-600/30":g?"bg-gray-800 text-gray-400":"bg-gray-50 text-gray-500 shadow-sm border border-gray-100"} hover:scale-[1.02]`,children:p},p))})]}),c.jsxs("div",{className:"space-y-4",children:[c.jsx("label",{className:"text-[10px] font-black uppercase opacity-40 tracking-widest ml-1 text-inherit",children:_("filterByColor")}),c.jsxs("select",{value:Qt,onChange:p=>Yt(p.target.value),className:`w-full p-4 rounded-2xl border-none outline-none focus:ring-2 focus:ring-primary-500 font-bold ${g?"bg-gray-800 text-white":"bg-gray-50"}`,children:[c.jsx("option",{value:"",children:_("all")}),mh.map(p=>c.jsx("option",{value:p,children:p},p))]})]}),c.jsxs("div",{className:"space-y-4",children:[c.jsx("label",{className:"text-[10px] font-black uppercase opacity-40 tracking-widest ml-1 text-inherit",children:_("favorites")}),c.jsxs("button",{onClick:()=>Ce(!se),className:`w-full p-4 rounded-2xl flex items-center justify-between font-bold transition-all border-2 ${se?"border-rose-500 bg-rose-50 text-rose-600 dark:bg-rose-900/20 dark:text-rose-400":`border-transparent ${g?"bg-gray-800 text-gray-400 hover:bg-gray-700":"bg-gray-50 text-gray-500 hover:bg-gray-100"}`}`,children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(qh,{size:20,fill:se?"currentColor":"none"}),c.jsx("span",{children:_("onlyFavorites")})]}),se&&c.jsx(Xn,{size:20})]})]})]}),c.jsxs("div",{className:"pt-8 flex gap-4 border-t mt-5 md:mt-8 border-gray-100 dark:border-gray-800",children:[c.jsx("button",{onClick:()=>{An("Todos"),Yt(""),ae("any"),Ce(!1)},className:"flex-1 py-4 font-black uppercase text-[10px] tracking-widest text-gray-500 hover:text-gray-900 dark:hover:text-white transition-colors",children:_("clearAll")}),c.jsx("button",{onClick:()=>Ae(!1),className:"flex-1 py-4 bg-primary-600 text-white rounded-2xl font-black uppercase text-[10px] tracking-widest shadow-xl shadow-primary-600/30 hover:scale-105 transition-all",children:_("applyFilters")})]})]})}),da&&c.jsx("div",{className:"fixed inset-0 z-[200] flex items-center justify-center bg-black/60 backdrop-blur-sm p-6",onClick:()=>Wi(!1),children:c.jsxs(Ve,{className:"w-full max-w-lg p-5 md:p-8 animate-in zoom-in-95",darkMode:g,onClick:p=>p.stopPropagation(),children:[c.jsx("h3",{className:"text-2xl font-black mb-5 md:mb-8 text-center text-inherit",children:_("appLanguage")}),c.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4",children:[{id:"PT",flag:"🇵🇹",label:_("portuguese")},{id:"EN",flag:"🇬🇧",label:_("english")},{id:"ES",flag:"🇪🇸",label:_("spanish")},{id:"FR",flag:"🇫🇷",label:_("french")},{id:"DE",flag:"🇩🇪",label:_("german")}].map(p=>c.jsxs("button",{onClick:()=>ch(p.id),className:`p-6 rounded-2xl flex flex-col items-center justify-center gap-4 transition-all ${yt===p.id?"bg-primary-600 text-white shadow-xl shadow-primary-600/30 scale-105":"bg-gray-50 text-gray-600 hover:bg-gray-100 dark:bg-gray-800 dark:text-gray-300 dark:hover:bg-gray-700"}`,children:[c.jsx("span",{className:"text-4xl",children:p.flag}),c.jsx("span",{className:"font-black text-[10px] uppercase tracking-widest text-center",children:p.label})]},p.id))}),c.jsx("button",{onClick:()=>Wi(!1),className:"w-full mt-5 md:mt-8 py-4 uppercase font-black text-[10px] tracking-widest text-gray-500 hover:text-gray-900 dark:hover:text-white transition-colors",children:_("cancel")})]})}),Wn&&ft&&c.jsx("div",{className:"fixed inset-0 z-[300] flex items-center justify-center bg-black/70 backdrop-blur-md p-6",onClick:()=>{Qi(!1),vr(null)},children:c.jsxs("div",{className:`w-full max-w-lg rounded-3xl md:rounded-[2rem] shadow-2xl overflow-hidden animate-in zoom-in-95 duration-300 ${g?"bg-gray-900":"bg-white"}`,onClick:p=>p.stopPropagation(),children:[c.jsxs("div",{className:"relative p-5 md:p-8 pb-6",style:{background:"linear-gradient(135deg, hsl(var(--primary-600)), hsl(var(--primary-400)))"},children:[c.jsx("div",{className:"absolute inset-0 opacity-20",style:{backgroundImage:"radial-gradient(circle at 80% 20%, white 0%, transparent 60%)"}}),c.jsxs("div",{className:"relative z-10",children:[c.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[c.jsx("div",{className:"p-2 bg-white/20 rounded-xl backdrop-blur-sm",children:c.jsx(Yy,{size:20,className:"text-white"})}),c.jsx("span",{className:"text-white/80 font-black uppercase text-[10px] tracking-widest",children:_("sharedLookTitle")})]}),c.jsx("h2",{className:"text-3xl font-black text-white tracking-tight",children:ft.lookName}),c.jsxs("p",{className:"text-white/60 text-sm font-bold mt-1",children:[ft.items.length," peça",ft.items.length!==1?"s":""," • ",_("sharedBy")," ",((Ag=ft.ownerEmail)==null?void 0:Ag.split("@")[0])||_("someone")]})]})]}),c.jsxs("div",{className:`p-5 md:p-8 ${g?"bg-gray-900":"bg-white"}`,children:[c.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest opacity-40 mb-4",children:_("includedPieces")}),c.jsx("div",{className:"flex flex-wrap gap-3 mb-5 md:mb-8",children:ft.items.map((p,x)=>c.jsxs("div",{className:"relative group/item",children:[c.jsx("div",{className:"w-20 h-20 rounded-2xl overflow-hidden border-2 border-gray-100 dark:border-gray-700 shadow-lg",children:c.jsx("img",{src:p.imageUrl,alt:p.name,className:"w-full h-full object-cover group-hover/item:scale-110 transition-transform duration-500"})}),c.jsx("div",{className:"absolute -bottom-1 left-1/2 -translate-x-1/2 bg-gray-900/90 text-white text-[8px] font-black uppercase tracking-wide px-2 py-0.5 rounded-full whitespace-nowrap opacity-0 group-hover/item:opacity-100 transition-opacity",children:p.name})]},x))}),c.jsx("div",{className:"space-y-2 mb-5 md:mb-8 max-h-32 overflow-y-auto custom-scrollbar",children:ft.items.map((p,x)=>c.jsxs("div",{className:`flex items-center gap-3 px-4 py-2.5 rounded-xl ${g?"bg-gray-800":"bg-gray-50"}`,children:[c.jsx("span",{className:"text-xs font-black truncate flex-1",children:p.name}),c.jsx("span",{className:"text-[9px] font-black uppercase tracking-widest opacity-40 shrink-0",children:p.category})]},x))}),c.jsxs("div",{className:"flex gap-3",children:[c.jsx("button",{onClick:()=>{Qi(!1),vr(null)},className:`flex-1 py-4 font-black uppercase text-[10px] tracking-widest rounded-2xl transition-all ${g?"bg-gray-800 text-gray-400 hover:bg-gray-700":"bg-gray-100 text-gray-500 hover:bg-gray-200"}`,children:"Ignorar"}),c.jsx("button",{onClick:br,disabled:wa,className:"flex-[2] py-4 font-black uppercase text-[10px] tracking-widest rounded-2xl text-white shadow-xl transition-all hover:scale-[1.02] active:scale-95 disabled:opacity-60 flex items-center justify-center gap-2",style:{background:"linear-gradient(135deg, hsl(var(--primary-600)), hsl(var(--primary-500)))"},children:wa?c.jsxs(c.Fragment,{children:[c.jsx(Qy,{size:16,className:"animate-spin"})," ",_("copying")]}):c.jsxs(c.Fragment,{children:[c.jsx(Xn,{size:16})," ",_("copyToMyCloset")]})})]})]})]})}),oh&&c.jsx("div",{className:"fixed inset-0 z-[300] flex items-center justify-center bg-black/70 backdrop-blur-md p-6",onClick:()=>Ta(!1),children:c.jsxs("div",{className:`w-full max-w-lg rounded-3xl md:rounded-[2rem] shadow-2xl overflow-hidden animate-in zoom-in-95 duration-300 ${g?"bg-gray-900":"bg-white"}`,onClick:p=>p.stopPropagation(),children:[c.jsxs("div",{className:"relative p-5 md:p-8 pb-6 bg-gradient-to-br from-primary-600 to-primary-400",children:[c.jsx("div",{className:"absolute inset-0 opacity-20",style:{backgroundImage:"radial-gradient(circle at 80% 20%, white 0%, transparent 60%)"}}),c.jsxs("div",{className:"relative z-10",children:[c.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[c.jsx("div",{className:"p-2 bg-white/20 rounded-xl backdrop-blur-sm",children:c.jsx(qa,{size:20,className:"text-white"})}),c.jsx("span",{className:"text-white/80 font-black uppercase text-[10px] tracking-widest",children:_("dailyOutfit")})]}),c.jsx("h2",{className:"text-3xl font-black text-white tracking-tight",children:_("today")})]})]}),c.jsx("div",{className:`p-5 md:p-8 ${g?"bg-gray-900":"bg-white"} max-h-[60vh] overflow-y-auto custom-scrollbar`,children:Ia.length>0?c.jsx("div",{className:"space-y-6",children:Ia.map(p=>c.jsxs("div",{className:`p-4 rounded-2xl border-2 border-gray-100 dark:border-gray-800 ${g?"bg-gray-800/50":"bg-gray-50"}`,children:[c.jsxs("div",{className:"flex items-center justify-between mb-4",children:[c.jsx("h4",{className:"font-black text-lg text-inherit",children:p.name}),c.jsxs("span",{className:"text-[10px] font-black uppercase tracking-widest opacity-40",children:[p.items.length," ",_("piecesShort")]})]}),c.jsx("div",{className:"flex -space-x-4 overflow-x-auto custom-scrollbar pb-2",children:p.items.map(x=>{const D=o.find(z=>z.id===x);return D?c.jsx("div",{className:"w-16 h-16 rounded-xl overflow-hidden border-2 border-white dark:border-gray-700 shrink-0 shadow-sm relative group",children:c.jsx("img",{src:D.imageUrl,className:"w-full h-full object-cover",alt:""})},x):null})})]},p.id))}):c.jsxs("div",{className:"py-6 md:py-12 flex flex-col items-center justify-center text-center opacity-50",children:[c.jsx($a,{size:48,className:"mb-4 text-gray-400"}),c.jsx("p",{className:"font-black text-lg text-inherit",children:_("noOutfitPlanned")}),c.jsx("p",{className:"text-xs mt-2 uppercase tracking-widest",children:_("goToPlanning")})]})}),c.jsx("div",{className:`p-4 border-t ${g?"border-gray-800 bg-gray-900":"border-gray-100 bg-gray-50"}`,children:c.jsx("button",{onClick:()=>Ta(!1),className:"w-full py-4 bg-gray-200 dark:bg-gray-800 hover:bg-gray-300 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300 rounded-2xl font-black uppercase text-[10px] tracking-widest transition-all",children:_("close")})})]})}),an&&c.jsx("div",{className:"fixed inset-0 z-[300] flex items-center justify-center bg-black/70 backdrop-blur-md p-6",onClick:()=>$s(null),children:c.jsxs("div",{className:`w-full max-w-lg rounded-3xl md:rounded-[2rem] shadow-2xl overflow-hidden animate-in zoom-in-95 duration-300 ${g?"bg-gray-900":"bg-white"}`,onClick:p=>p.stopPropagation(),children:[c.jsxs("div",{className:"relative p-5 md:p-8 pb-6",style:{background:"linear-gradient(135deg, hsl(var(--primary-600)), hsl(var(--primary-400)))"},children:[c.jsx("div",{className:"absolute inset-0 opacity-20",style:{backgroundImage:"radial-gradient(circle at 80% 20%, white 0%, transparent 60%)"}}),c.jsxs("div",{className:"relative z-10",children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("div",{className:"p-2 bg-white/20 rounded-xl backdrop-blur-sm",children:c.jsx(ho,{size:20,className:"text-white"})}),c.jsx("span",{className:"text-white/80 font-black uppercase text-[10px] tracking-widest",children:_("inspectOutfit")||"Inspecionar Outfit"})]}),c.jsx("button",{onClick:()=>$s(null),className:"text-white/80 hover:text-white transition-colors",children:c.jsx(Cr,{size:20})})]}),c.jsx("h2",{className:"text-3xl font-black text-white tracking-tight",children:an.name}),c.jsxs("p",{className:"text-white/60 text-sm font-bold mt-1",children:[((Ng=an.items)==null?void 0:Ng.length)||0," peça",((Pg=an.items)==null?void 0:Pg.length)!==1?"s":""]})]})]}),c.jsxs("div",{className:`p-5 md:p-8 ${g?"bg-gray-900":"bg-white"}`,children:[c.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest opacity-40 mb-4",children:_("includedPieces")||"Peças incluídas"}),c.jsx("div",{className:"flex flex-wrap gap-3 mb-5 md:mb-8",children:(an.items||[]).map((p,x)=>{const D=Xt.find(z=>z.id===p);return D?c.jsxs("div",{className:"relative group/item",children:[c.jsx("div",{className:"w-20 h-20 rounded-2xl overflow-hidden border-2 border-gray-100 dark:border-gray-700 shadow-lg",children:c.jsx("img",{src:D.imageUrl,alt:D.name,className:"w-full h-full object-cover group-hover/item:scale-110 transition-transform duration-500"})}),c.jsx("div",{className:"absolute -bottom-1 left-1/2 -translate-x-1/2 bg-gray-900/90 text-white text-[8px] font-black uppercase tracking-wide px-2 py-0.5 rounded-full whitespace-nowrap opacity-0 group-hover/item:opacity-100 transition-opacity",children:D.name})]},x):null})}),c.jsx("div",{className:"space-y-2 mb-5 md:mb-8 max-h-32 overflow-y-auto custom-scrollbar",children:(an.items||[]).map((p,x)=>{const D=Xt.find(z=>z.id===p);return D?c.jsxs("div",{className:`flex items-center gap-3 px-4 py-2.5 rounded-xl ${g?"bg-gray-800":"bg-gray-50"}`,children:[c.jsx("span",{className:"text-xs font-black truncate flex-1",children:D.name}),c.jsx("span",{className:"text-[9px] font-black uppercase tracking-widest opacity-40 shrink-0",children:D.category})]},x):null})}),c.jsx("button",{onClick:()=>$s(null),className:`w-full py-4 font-black uppercase text-[10px] tracking-widest rounded-2xl transition-all ${g?"bg-gray-800 text-gray-400 hover:bg-gray-700":"bg-gray-100 text-gray-500 hover:bg-gray-200"}`,children:_("close")||"Fechar"})]})]})}),ii&&c.jsx("div",{className:"fixed inset-0 z-[300] flex items-center justify-center bg-black/70 backdrop-blur-md p-6",onClick:()=>yr(null),children:c.jsxs("div",{className:`w-full max-w-sm rounded-3xl md:rounded-[2rem] shadow-2xl overflow-hidden animate-in zoom-in-95 duration-300 ${g?"bg-gray-900":"bg-white"}`,onClick:p=>p.stopPropagation(),children:[c.jsxs("div",{className:"relative aspect-square",children:[c.jsx("img",{src:ii.imageUrl,className:"w-full h-full object-cover",alt:"Item"}),c.jsx("button",{onClick:()=>yr(null),className:"absolute top-4 right-4 p-2 bg-black/50 hover:bg-black/70 rounded-full text-white transition-colors",children:c.jsx(Cr,{size:20})})]}),c.jsxs("div",{className:"p-5 md:p-8 text-center space-y-4",children:[c.jsx("h3",{className:"text-2xl font-black text-inherit",children:ii.name}),c.jsxs("div",{className:"flex items-center justify-center gap-2 opacity-60 font-bold uppercase tracking-widest text-[10px] text-inherit",children:[c.jsx("span",{children:ii.category}),c.jsx("span",{children:"•"}),c.jsx("span",{children:ii.color})]}),c.jsxs("button",{onClick:()=>{Pa(ii),yr(null)},className:"w-full py-4 mt-4 bg-primary-600 text-white rounded-2xl font-black uppercase text-[10px] tracking-widest shadow-xl shadow-primary-600/30 hover:scale-105 transition-all flex items-center justify-center gap-2",children:[c.jsx(za,{size:16})," ",_("copyToMyCloset")||"Copiar para Armário"]})]})]})})]})}"serviceWorker"in navigator&&window.addEventListener("load",()=>{navigator.serviceWorker.register("/firebase-messaging-sw.js").catch(t=>{console.error("Service worker registration failed",t)})});ff.createRoot(document.getElementById("root")).render(c.jsx(zk.StrictMode,{children:c.jsx(RR,{})}));
|