pwa-auth 3.5.1 → 3.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/README.md +8 -15
  2. package/base/firebase/google.d.ts +9 -0
  3. package/base/firebase/google.d.ts.map +1 -0
  4. package/base/firebase/google.js +56 -0
  5. package/base/firebase/google.js.map +1 -0
  6. package/base/firebase/interface.d.ts.map +1 -1
  7. package/base/firebase/interface.js +2 -0
  8. package/base/firebase/interface.js.map +1 -1
  9. package/base/firebase/message.d.ts.map +1 -1
  10. package/base/firebase/message.js +1 -0
  11. package/base/firebase/message.js.map +1 -1
  12. package/base/webcomponents/css/animation.d.ts +2 -0
  13. package/base/webcomponents/css/animation.d.ts.map +1 -1
  14. package/base/webcomponents/css/animation.js +83 -17
  15. package/base/webcomponents/css/animation.js.map +1 -1
  16. package/base/webcomponents/drawer/css/drawer.d.ts.map +1 -1
  17. package/base/webcomponents/drawer/css/drawer.js +0 -48
  18. package/base/webcomponents/drawer/css/drawer.js.map +1 -1
  19. package/base/webcomponents/drawer/drawer.d.ts +1 -0
  20. package/base/webcomponents/drawer/drawer.d.ts.map +1 -1
  21. package/base/webcomponents/drawer/drawer.js +11 -3
  22. package/base/webcomponents/drawer/drawer.js.map +1 -1
  23. package/base/webcomponents/form/css/button.d.ts.map +1 -1
  24. package/base/webcomponents/form/css/button.js +39 -0
  25. package/base/webcomponents/form/css/button.js.map +1 -1
  26. package/base/webcomponents/form/google-button.d.ts +3 -0
  27. package/base/webcomponents/form/google-button.d.ts.map +1 -0
  28. package/base/webcomponents/form/google-button.js +23 -0
  29. package/base/webcomponents/form/google-button.js.map +1 -0
  30. package/base/webcomponents/form/login.d.ts +5 -0
  31. package/base/webcomponents/form/login.d.ts.map +1 -1
  32. package/base/webcomponents/form/login.js +40 -0
  33. package/base/webcomponents/form/login.js.map +1 -1
  34. package/base/webcomponents/form/signup.d.ts +5 -0
  35. package/base/webcomponents/form/signup.d.ts.map +1 -1
  36. package/base/webcomponents/form/signup.js +40 -0
  37. package/base/webcomponents/form/signup.js.map +1 -1
  38. package/base/webcomponents/login/css/auth.d.ts +2 -2
  39. package/base/webcomponents/login/css/auth.d.ts.map +1 -1
  40. package/base/webcomponents/login/css/auth.js +3 -9
  41. package/base/webcomponents/login/css/auth.js.map +1 -1
  42. package/base/webcomponents/login/page.d.ts +1 -0
  43. package/base/webcomponents/login/page.d.ts.map +1 -1
  44. package/base/webcomponents/login/page.js +9 -2
  45. package/base/webcomponents/login/page.js.map +1 -1
  46. package/docs/sliders.md +66 -0
  47. package/firebase.md +18 -0
  48. package/intro.md +1 -1
  49. package/package.json +2 -1
  50. package/source/pwa-auth.js +256 -183
@@ -4,61 +4,7 @@
4
4
  * Licensed under MIT
5
5
  */
6
6
 
7
- const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,n=Symbol(),s=new WeakMap;let r=class{constructor(e,t,s){if(this._$cssResult$=!0,s!==n)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const n=this.t;if(t&&void 0===e){const t=void 0!==n&&1===n.length;t&&(e=s.get(n)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),t&&s.set(n,e))}return e}toString(){return this.cssText}};const i=(e,...t)=>{const s=1===e.length?e[0]:t.reduce((t,n,s)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+e[s+1],e[0]);return new r(s,e,n)},a=t?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const n of e.cssRules)t+=n.cssText;return(e=>new r("string"==typeof e?e:e+"",void 0,n))(t)})(e):e,{is:o,defineProperty:B,getOwnPropertyDescriptor:c,getOwnPropertyNames:l,getOwnPropertySymbols:u,getPrototypeOf:h}=Object,p=globalThis,d=p.trustedTypes,f=d?d.emptyScript:"",C=p.reactiveElementPolyfillSupport,g=(e,t)=>e,m={toAttribute(e,t){switch(t){case Boolean:e=e?f:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=null!==e;break;case Number:n=null===e?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch(e){n=null}}return n}},w=(e,t)=>!o(e,t),E={attribute:!0,type:String,converter:m,reflect:!1,useDefault:!1,hasChanged:w};Symbol.metadata??=Symbol("metadata"),p.litPropertyMetadata??=new WeakMap;let y=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=E){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const n=Symbol(),s=this.getPropertyDescriptor(e,n,t);void 0!==s&&B(this.prototype,e,s)}}static getPropertyDescriptor(e,t,n){const{get:s,set:r}=c(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:s,set(t){const i=s?.call(this);r?.call(this,t),this.requestUpdate(e,i,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??E}static _$Ei(){if(this.hasOwnProperty(g("elementProperties")))return;const e=h(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(g("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(g("properties"))){const e=this.properties,t=[...l(e),...u(e)];for(const n of t)this.createProperty(n,e[n])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const n=this._$Eu(e,t);void 0!==n&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const e of n)t.unshift(a(e))}else void 0!==e&&t.push(a(e));return t}static _$Eu(e,t){const n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const n=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((n,s)=>{if(t)n.adoptedStyleSheets=s.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const t of s){const s=document.createElement("style"),r=e.litNonce;void 0!==r&&s.setAttribute("nonce",r),s.textContent=t.cssText,n.appendChild(s)}})(n,this.constructor.elementStyles),n}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){const n=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,n);if(void 0!==s&&!0===n.reflect){const r=(void 0!==n.converter?.toAttribute?n.converter:m).toAttribute(t,n.type);this._$Em=e,null==r?this.removeAttribute(s):this.setAttribute(s,r),this._$Em=null}}_$AK(e,t){const n=this.constructor,s=n._$Eh.get(e);if(void 0!==s&&this._$Em!==s){const e=n.getPropertyOptions(s),r="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:m;this._$Em=s;const i=r.fromAttribute(t,e.type);this[s]=i??this._$Ej?.get(s)??i,this._$Em=null}}requestUpdate(e,t,n){if(void 0!==e){const s=this.constructor,r=this[e];if(n??=s.getPropertyOptions(e),!((n.hasChanged??w)(r,t)||n.useDefault&&n.reflect&&r===this._$Ej?.get(e)&&!this.hasAttribute(s._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:s,wrapped:r},i){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,i??t??this[e]),!0!==r||void 0!==i)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),!0===s&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,n]of e){const{wrapped:e}=n,s=this[t];!0!==e||this._$AL.has(t)||void 0===s||this.C(t,void 0,n,s)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}};y.elementStyles=[],y.shadowRootOptions={mode:"open"},y[g("elementProperties")]=new Map,y[g("finalized")]=new Map,C?.({ReactiveElement:y}),(p.reactiveElementVersions??=[]).push("2.1.1");const D=globalThis,_=D.trustedTypes,b=_?_.createPolicy("lit-html",{createHTML:e=>e}):void 0,v="$lit$",I=`lit$${Math.random().toFixed(9).slice(2)}$`,T="?"+I,O=`<${T}>`,A=document,S=()=>A.createComment(""),N=e=>null===e||"object"!=typeof e&&"function"!=typeof e,R=Array.isArray,k="[ \t\n\f\r]",L=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,x=/-->/g,F=/>/g,P=RegExp(`>|${k}(?:([^\\s"'>=/]+)(${k}*=${k}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),M=/'/g,G=/"/g,U=/^(?:script|style|textarea|title)$/i,H=(e=>(t,...n)=>({_$litType$:e,strings:t,values:n}))(1),V=Symbol.for("lit-noChange"),j=Symbol.for("lit-nothing"),$=new WeakMap,J=A.createTreeWalker(A,129);function q(e,t){if(!R(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==b?b.createHTML(t):t}const z=(e,t)=>{const n=e.length-1,s=[];let r,i=2===t?"<svg>":3===t?"<math>":"",a=L;for(let t=0;t<n;t++){const n=e[t];let o,B,c=-1,l=0;for(;l<n.length&&(a.lastIndex=l,B=a.exec(n),null!==B);)l=a.lastIndex,a===L?"!--"===B[1]?a=x:void 0!==B[1]?a=F:void 0!==B[2]?(U.test(B[2])&&(r=RegExp("</"+B[2],"g")),a=P):void 0!==B[3]&&(a=P):a===P?">"===B[0]?(a=r??L,c=-1):void 0===B[1]?c=-2:(c=a.lastIndex-B[2].length,o=B[1],a=void 0===B[3]?P:'"'===B[3]?G:M):a===G||a===M?a=P:a===x||a===F?a=L:(a=P,r=void 0);const u=a===P&&e[t+1].startsWith("/>")?" ":"";i+=a===L?n+O:c>=0?(s.push(o),n.slice(0,c)+v+n.slice(c)+I+u):n+I+(-2===c?t:u)}return[q(e,i+(e[n]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),s]};class K{constructor({strings:e,_$litType$:t},n){let s;this.parts=[];let r=0,i=0;const a=e.length-1,o=this.parts,[B,c]=z(e,t);if(this.el=K.createElement(B,n),J.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(s=J.nextNode())&&o.length<a;){if(1===s.nodeType){if(s.hasAttributes())for(const e of s.getAttributeNames())if(e.endsWith(v)){const t=c[i++],n=s.getAttribute(e).split(I),a=/([.?@])?(.*)/.exec(t);o.push({type:1,index:r,name:a[2],strings:n,ctor:"."===a[1]?Z:"?"===a[1]?ee:"@"===a[1]?te:X}),s.removeAttribute(e)}else e.startsWith(I)&&(o.push({type:6,index:r}),s.removeAttribute(e));if(U.test(s.tagName)){const e=s.textContent.split(I),t=e.length-1;if(t>0){s.textContent=_?_.emptyScript:"";for(let n=0;n<t;n++)s.append(e[n],S()),J.nextNode(),o.push({type:2,index:++r});s.append(e[t],S())}}}else if(8===s.nodeType)if(s.data===T)o.push({type:2,index:r});else{let e=-1;for(;-1!==(e=s.data.indexOf(I,e+1));)o.push({type:7,index:r}),e+=I.length-1}r++}}static createElement(e,t){const n=A.createElement("template");return n.innerHTML=e,n}}function Q(e,t,n=e,s){if(t===V)return t;let r=void 0!==s?n._$Co?.[s]:n._$Cl;const i=N(t)?void 0:t._$litDirective$;return r?.constructor!==i&&(r?._$AO?.(!1),void 0===i?r=void 0:(r=new i(e),r._$AT(e,n,s)),void 0!==s?(n._$Co??=[])[s]=r:n._$Cl=r),void 0!==r&&(t=Q(e,r._$AS(e,t.values),r,s)),t}let W=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:n}=this._$AD,s=(e?.creationScope??A).importNode(t,!0);J.currentNode=s;let r=J.nextNode(),i=0,a=0,o=n[0];for(;void 0!==o;){if(i===o.index){let t;2===o.type?t=new Y(r,r.nextSibling,this,e):1===o.type?t=new o.ctor(r,o.name,o.strings,this,e):6===o.type&&(t=new ne(r,this,e)),this._$AV.push(t),o=n[++a]}i!==o?.index&&(r=J.nextNode(),i++)}return J.currentNode=A,s}p(e){let t=0;for(const n of this._$AV)void 0!==n&&(void 0!==n.strings?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}},Y=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,s){this.type=2,this._$AH=j,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Q(this,e,t),N(e)?e===j||null==e||""===e?(this._$AH!==j&&this._$AR(),this._$AH=j):e!==this._$AH&&e!==V&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>R(e)||"function"==typeof e?.[Symbol.iterator])(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==j&&N(this._$AH)?this._$AA.nextSibling.data=e:this.T(A.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:n}=e,s="number"==typeof n?this._$AC(e):(void 0===n.el&&(n.el=K.createElement(q(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===s)this._$AH.p(t);else{const e=new W(s,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=$.get(e.strings);return void 0===t&&$.set(e.strings,t=new K(e)),t}k(t){R(this._$AH)||(this._$AH=[],this._$AR());const n=this._$AH;let s,r=0;for(const i of t)r===n.length?n.push(s=new e(this.O(S()),this.O(S()),this,this.options)):s=n[r],s._$AI(i),r++;r<n.length&&(this._$AR(s&&s._$AB.nextSibling,r),n.length=r)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){const t=e.nextSibling;e.remove(),e=t}}setConnected(e){void 0===this._$AM&&(this._$Cv=e,this._$AP?.(e))}},X=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,s,r){this.type=1,this._$AH=j,this._$AN=void 0,this.element=e,this.name=t,this._$AM=s,this.options=r,n.length>2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=j}_$AI(e,t=this,n,s){const r=this.strings;let i=!1;if(void 0===r)e=Q(this,e,t,0),i=!N(e)||e!==this._$AH&&e!==V,i&&(this._$AH=e);else{const s=e;let a,o;for(e=r[0],a=0;a<r.length-1;a++)o=Q(this,s[n+a],t,a),o===V&&(o=this._$AH[a]),i||=!N(o)||o!==this._$AH[a],o===j?e=j:e!==j&&(e+=(o??"")+r[a+1]),this._$AH[a]=o}i&&!s&&this.j(e)}j(e){e===j?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}};class Z extends X{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===j?void 0:e}}let ee=class extends X{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==j)}},te=class extends X{constructor(e,t,n,s,r){super(e,t,n,s,r),this.type=5}_$AI(e,t=this){if((e=Q(this,e,t,0)??j)===V)return;const n=this._$AH,s=e===j&&n!==j||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,r=e!==j&&(n===j||s);s&&this.element.removeEventListener(this.name,this,n),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}};class ne{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){Q(this,e)}}const se=D.litHtmlPolyfillSupport;se?.(K,Y),(D.litHtmlVersions??=[]).push("3.3.1");const re=globalThis;let ie=class extends y{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=((e,t,n)=>{const s=n?.renderBefore??t;let r=s._$litPart$;if(void 0===r){const e=n?.renderBefore??null;s._$litPart$=r=new Y(t.insertBefore(S(),e),e,void 0,n??{})}return r._$AI(e),r})(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return V}};ie._$litElement$=!0,ie.finalized=!0,re.litElementHydrateSupport?.({LitElement:ie});const ae=re.litElementPolyfillSupport;ae?.({LitElement:ie}),(re.litElementVersions??=[]).push("4.2.1");const oe=e=>(t,n)=>{void 0!==n?n.addInitializer(()=>{customElements.define(e,t)}):customElements.define(e,t)},Be={attribute:!0,type:String,converter:m,reflect:!1,hasChanged:w},ce=(e=Be,t,n)=>{const{kind:s,metadata:r}=n;let i=globalThis.litPropertyMetadata.get(r);if(void 0===i&&globalThis.litPropertyMetadata.set(r,i=new Map),"setter"===s&&((e=Object.create(e)).wrapped=!0),i.set(n.name,e),"accessor"===s){const{name:s}=n;return{set(n){const r=t.get.call(this);t.set.call(this,n),this.requestUpdate(s,r,e)},init(t){return void 0!==t&&this.C(s,void 0,e,t),t}}}if("setter"===s){const{name:s}=n;return function(n){const r=this[s];t.call(this,n),this.requestUpdate(s,r,e)}}throw Error("Unsupported decorator location: "+s)};function le(e){return(t,n)=>"object"==typeof n?ce(e,t,n):((e,t,n)=>{const s=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),s?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}function ue(e){return le({...e,state:!0,attribute:!1})}const he=e=>t=>class extends t{connectedCallback(){super.connectedCallback&&super.connectedCallback(),this._storeUnsubscribe=e.subscribe(()=>this.stateChanged(e.getState())),this.stateChanged(e.getState())}disconnectedCallback(){this._storeUnsubscribe(),super.disconnectedCallback&&super.disconnectedCallback()}stateChanged(e){}};function pe(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var de=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),fe=()=>Math.random().toString(36).substring(7).split("").join("."),Ce={INIT:`@@redux/INIT${fe()}`,REPLACE:`@@redux/REPLACE${fe()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${fe()}`};function ge(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}function me(e,t,n){if("function"!=typeof e)throw new Error(pe(2));if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(pe(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(pe(1));return n(me)(e,t)}let s=e,r=t,i=new Map,a=i,o=0,B=!1;function c(){a===i&&(a=new Map,i.forEach((e,t)=>{a.set(t,e)}))}function l(){if(B)throw new Error(pe(3));return r}function u(e){if("function"!=typeof e)throw new Error(pe(4));if(B)throw new Error(pe(5));let t=!0;c();const n=o++;return a.set(n,e),function(){if(t){if(B)throw new Error(pe(6));t=!1,c(),a.delete(n),i=null}}}function h(e){if(!ge(e))throw new Error(pe(7));if(void 0===e.type)throw new Error(pe(8));if("string"!=typeof e.type)throw new Error(pe(17));if(B)throw new Error(pe(9));try{B=!0,r=s(r,e)}finally{B=!1}return(i=a).forEach(e=>{e()}),e}h({type:Ce.INIT});return{dispatch:h,subscribe:u,getState:l,replaceReducer:function(e){if("function"!=typeof e)throw new Error(pe(10));s=e,h({type:Ce.REPLACE})},[de]:function(){const e=u;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error(pe(11));function n(){const e=t;e.next&&e.next(l())}n();return{unsubscribe:e(n)}},[de](){return this}}}}}function we(e){const t=Object.keys(e),n={};for(let s=0;s<t.length;s++){const r=t[s];"function"==typeof e[r]&&(n[r]=e[r])}const s=Object.keys(n);let r;try{!function(e){Object.keys(e).forEach(t=>{const n=e[t];if(void 0===n(void 0,{type:Ce.INIT}))throw new Error(pe(12));if(void 0===n(void 0,{type:Ce.PROBE_UNKNOWN_ACTION()}))throw new Error(pe(13))})}(n)}catch(e){r=e}return function(e={},t){if(r)throw r;let i=!1;const a={};for(let r=0;r<s.length;r++){const o=s[r],B=n[o],c=e[o],l=B(c,t);if(void 0===l)throw t&&t.type,new Error(pe(14));a[o]=l,i=i||l!==c}return i=i||s.length!==Object.keys(e).length,i?a:e}}function Ee(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce((e,t)=>(...n)=>e(t(...n)))}var ye=Symbol.for("immer-nothing"),De=Symbol.for("immer-draftable"),_e=Symbol.for("immer-state");function be(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ve=Object,Ie=ve.getPrototypeOf,Te="constructor",Oe="prototype",Ae="configurable",Se="enumerable",Ne="writable",Re="value",ke=e=>!!e&&!!e[_e];function Le(e){return!!e&&(Pe(e)||je(e)||!!e[De]||!!e[Te]?.[De]||$e(e)||Je(e))}var xe=ve[Oe][Te].toString(),Fe=new WeakMap;function Pe(e){if(!e||!qe(e))return!1;const t=Ie(e);if(null===t||t===ve[Oe])return!0;const n=ve.hasOwnProperty.call(t,Te)&&t[Te];if(n===Object)return!0;if(!ze(n))return!1;let s=Fe.get(n);return void 0===s&&(s=Function.toString.call(n),Fe.set(n,s)),s===xe}function Me(e,t,n=!0){if(0===Ge(e)){(n?Reflect.ownKeys(e):ve.keys(e)).forEach(n=>{t(n,e[n],e)})}else e.forEach((n,s)=>t(s,n,e))}function Ge(e){const t=e[_e];return t?t.type_:je(e)?1:$e(e)?2:Je(e)?3:0}var Ue=(e,t,n=Ge(e))=>2===n?e.has(t):ve[Oe].hasOwnProperty.call(e,t),He=(e,t,n=Ge(e))=>2===n?e.get(t):e[t],Ve=(e,t,n,s=Ge(e))=>{2===s?e.set(t,n):3===s?e.add(n):e[t]=n};var je=Array.isArray,$e=e=>e instanceof Map,Je=e=>e instanceof Set,qe=e=>"object"==typeof e,ze=e=>"function"==typeof e,Ke=e=>"boolean"==typeof e;var Qe=e=>e.copy_||e.base_,We=e=>e.modified_?e.copy_:e.base_;function Ye(e,t){if($e(e))return new Map(e);if(Je(e))return new Set(e);if(je(e))return Array[Oe].slice.call(e);const n=Pe(e);if(!0===t||"class_only"===t&&!n){const t=ve.getOwnPropertyDescriptors(e);delete t[_e];let n=Reflect.ownKeys(t);for(let s=0;s<n.length;s++){const r=n[s],i=t[r];!1===i[Ne]&&(i[Ne]=!0,i[Ae]=!0),(i.get||i.set)&&(t[r]={[Ae]:!0,[Ne]:!0,[Se]:i[Se],[Re]:e[r]})}return ve.create(Ie(e),t)}{const t=Ie(e);if(null!==t&&n)return{...e};const s=ve.create(t);return ve.assign(s,e)}}function Xe(e,t=!1){return et(e)||ke(e)||!Le(e)||(Ge(e)>1&&ve.defineProperties(e,{set:Ze,add:Ze,clear:Ze,delete:Ze}),ve.freeze(e),t&&Me(e,(e,t)=>{Xe(t,!0)},!1)),e}var Ze={[Re]:function(){be(2)}};function et(e){return null===e||!qe(e)||ve.isFrozen(e)}var tt="MapSet",nt="Patches",st="ArrayMethods",rt={};function it(e){const t=rt[e];return t||be(0),t}var at,ot=e=>!!rt[e],Bt=()=>at;function ct(e,t){t&&(e.patchPlugin_=it(nt),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function lt(e){ut(e),e.drafts_.forEach(pt),e.drafts_=null}function ut(e){e===at&&(at=e.parent_)}var ht=e=>at={drafts_:[],parent_:at,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:ot(tt)?it(tt):void 0,arrayMethodsPlugin_:ot(st)?it(st):void 0};function pt(e){const t=e[_e];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function dt(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(void 0!==e&&e!==n){n[_e].modified_&&(lt(t),be(4)),Le(e)&&(e=ft(t,e));const{patchPlugin_:s}=t;s&&s.generateReplacementPatches_(n[_e].base_,e,t)}else e=ft(t,n);return function(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Xe(t,n)}(t,e,!0),lt(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==ye?e:void 0}function ft(e,t){if(et(t))return t;const n=t[_e];if(!n){return yt(t,e.handledSet_,e)}if(!gt(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:t}=n;if(t)for(;t.length>0;){t.pop()(e)}Et(n,e)}return n.copy_}function Ct(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var gt=(e,t)=>e.scope_===t,mt=[];function wt(e,t,n,s){const r=Qe(e),i=e.type_;if(void 0!==s){if(He(r,s,i)===t)return void Ve(r,s,n,i)}if(!e.draftLocations_){const t=e.draftLocations_=new Map;Me(r,(e,n)=>{if(ke(n)){const s=t.get(n)||[];s.push(e),t.set(n,s)}})}const a=e.draftLocations_.get(t)??mt;for(const e of a)Ve(r,e,n,i)}function Et(e,t){if(e.modified_&&!e.finalized_&&(3===e.type_||1===e.type_&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){const{patchPlugin_:n}=t;if(n){const s=n.getPath(e);s&&n.generatePatches_(e,s,t)}Ct(e)}}function yt(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||ke(e)||t.has(e)||!Le(e)||et(e)||(t.add(e),Me(e,(s,r)=>{if(ke(r)){const t=r[_e];if(gt(t,n)){const n=We(t);Ve(e,s,n,e.type_),Ct(t)}}else Le(r)&&yt(r,t,n)})),e}var Dt={get(e,t){if(t===_e)return e;let n=e.scope_.arrayMethodsPlugin_;const s=1===e.type_&&"string"==typeof t;if(s&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const r=Qe(e);if(!Ue(r,t,e.type_))return function(e,t,n){const s=vt(t,n);return s?Re in s?s[Re]:s.get?.call(e.draft_):void 0}(e,r,t);const i=r[t];if(e.finalized_||!Le(i))return i;if(s&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&function(e){const t=+e;return Number.isInteger(t)&&String(t)===e}(t))return i;if(i===bt(e.base_,t)){Tt(e);const n=1===e.type_?+t:t,s=Ot(e.scope_,i,e,n);return e.copy_[n]=s}return i},has:(e,t)=>t in Qe(e),ownKeys:e=>Reflect.ownKeys(Qe(e)),set(e,t,n){const s=vt(Qe(e),t);if(s?.set)return s.set.call(e.draft_,n),!0;if(!e.modified_){const s=bt(Qe(e),t),r=s?.[_e];if(r&&r.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}(n,s)&&(void 0!==n||Ue(e.base_,t,e.type_)))return!0;Tt(e),It(e)}return e.copy_[t]===n&&(void 0!==n||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),function(e,t,n){const{scope_:s}=e;if(ke(n)){const r=n[_e];gt(r,s)&&r.callbacks_.push(function(){Tt(e);const s=We(r);wt(e,n,s,t)})}else Le(n)&&e.callbacks_.push(function(){const r=Qe(e);3===e.type_?r.has(n)&&yt(n,s.handledSet_,s):He(r,t,e.type_)===n&&s.drafts_.length>1&&!0===(e.assigned_.get(t)??!1)&&e.copy_&&yt(He(e.copy_,t,e.type_),s.handledSet_,s)})}(e,t,n)),!0},deleteProperty:(e,t)=>(Tt(e),void 0!==bt(e.base_,t)||t in e.base_?(e.assigned_.set(t,!1),It(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=Qe(e),s=Reflect.getOwnPropertyDescriptor(n,t);return s?{[Ne]:!0,[Ae]:1!==e.type_||"length"!==t,[Se]:s[Se],[Re]:n[t]}:s},defineProperty(){be(11)},getPrototypeOf:e=>Ie(e.base_),setPrototypeOf(){be(12)}},_t={};for(let e in Dt){let t=Dt[e];_t[e]=function(){const e=arguments;return e[0]=e[0][0],t.apply(this,e)}}function bt(e,t){const n=e[_e];return(n?Qe(n):e)[t]}function vt(e,t){if(!(t in e))return;let n=Ie(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=Ie(n)}}function It(e){e.modified_||(e.modified_=!0,e.parent_&&It(e.parent_))}function Tt(e){e.copy_||(e.assigned_=new Map,e.copy_=Ye(e.base_,e.scope_.immer_.useStrictShallowCopy_))}_t.deleteProperty=function(e,t){return _t.set.call(this,e,t,void 0)},_t.set=function(e,t,n){return Dt.set.call(this,e[0],t,n,e[0])};function Ot(e,t,n,s){const[r,i]=$e(t)?it(tt).proxyMap_(t,n):Je(t)?it(tt).proxySet_(t,n):function(e,t){const n=je(e),s={type_:n?1:0,scope_:t?t.scope_:Bt(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let r=s,i=Dt;n&&(r=[s],i=_t);const{revoke:a,proxy:o}=Proxy.revocable(r,i);return s.draft_=o,s.revoke_=a,[o,s]}(t,n);return(n?.scope_??Bt()).drafts_.push(r),i.callbacks_=n?.callbacks_??[],i.key_=s,n&&void 0!==s?function(e,t,n){e.callbacks_.push(function(s){const r=t;if(!r||!gt(r,s))return;s.mapSetPlugin_?.fixSetContents(r);const i=We(r);wt(e,r.draft_??r,i,n),Et(r,s)})}(n,i,s):i.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(i);const{patchPlugin_:t}=e;i.modified_&&t&&t.generatePatches_(i,[],e)}),r}function At(e){if(!Le(e)||et(e))return e;const t=e[_e];let n,s=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Ye(e,t.scope_.immer_.useStrictShallowCopy_),s=t.scope_.immer_.shouldUseStrictIteration()}else n=Ye(e,!0);return Me(n,(e,t)=>{Ve(n,e,At(t))},s),t&&(t.finalized_=!1),n}var St=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{if(ze(e)&&!ze(t)){const n=t;t=e;const s=this;return function(e=n,...r){return s.produce(e,e=>t.call(this,e,...r))}}let s;if(ze(t)||be(6),void 0===n||ze(n)||be(7),Le(e)){const r=ht(this),i=Ot(r,e,void 0);let a=!0;try{s=t(i),a=!1}finally{a?lt(r):ut(r)}return ct(r,n),dt(s,r)}if(!e||!qe(e)){if(s=t(e),void 0===s&&(s=e),s===ye&&(s=void 0),this.autoFreeze_&&Xe(s,!0),n){const t=[],r=[];it(nt).generateReplacementPatches_(e,s,{patches_:t,inversePatches_:r}),n(t,r)}return s}be(1)},this.produceWithPatches=(e,t)=>{if(ze(e))return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,s;const r=this.produce(e,t,(e,t)=>{n=e,s=t});return[r,n,s]},Ke(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),Ke(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),Ke(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Le(e)||be(8),ke(e)&&(e=function(e){ke(e)||be(10);return At(e)}(e));const t=ht(this),n=Ot(t,e,void 0);return n[_e].isManual_=!0,ut(t),n}finishDraft(e,t){const n=e&&e[_e];n&&n.isManual_||be(9);const{scope_:s}=n;return ct(s,t),dt(void 0,s)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const s=t[n];if(0===s.path.length&&"replace"===s.op){e=s.value;break}}n>-1&&(t=t.slice(n+1));const s=it(nt).applyPatches_;return ke(e)?s(e,t):this.produce(e,e=>s(e,t))}},Nt=St.produce;function Rt(e){return({dispatch:t,getState:n})=>s=>r=>"function"==typeof r?r(t,n,e):s(r)}var kt=Rt(),Lt=Rt;const xt="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?Ee:Ee.apply(null,arguments)};function Ft(e,t){function n(...n){if(t){let s=t(...n);if(!s)throw new Error(Qt(0));return{type:e,payload:s.payload,..."meta"in s&&{meta:s.meta},..."error"in s&&{error:s.error}}}return{type:e,payload:n[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=t=>function(e){return ge(e)&&"type"in e&&"string"==typeof e.type}(t)&&t.type===e,n}var Pt=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return 1===t.length&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function Mt(e){return Le(e)?Nt(e,()=>{}):e}function Gt(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}const Ut=e=>t=>{setTimeout(t,e)},Ht=(e={type:"raf"})=>t=>(...n)=>{const s=t(...n);let r=!0,i=!1,a=!1;const o=new Set,B="tick"===e.type?queueMicrotask:"raf"===e.type?"undefined"!=typeof window&&window.requestAnimationFrame?(c=window.requestAnimationFrame,l=100,e=>{let t,n,s=!1;const r=()=>{s||(s=!0,cancelAnimationFrame(t),clearTimeout(n),e())};t=c(r),n=setTimeout(r,l)}):Ut(10):"callback"===e.type?e.queueNotification:Ut(e.timeout);var c,l;const u=()=>{a=!1,i&&(i=!1,o.forEach(e=>e()))};return Object.assign({},s,{subscribe(e){const t=s.subscribe(()=>r&&e());return o.add(e),()=>{t(),o.delete(e)}},dispatch(e){try{return r=!e?.meta?.RTK_autoBatch,i=!r,i&&(a||(a=!0,B(u))),s.dispatch(e)}finally{r=!0}}})};function Vt(e){const t={},n=[];let s;const r={addCase(e,n){const s="string"==typeof e?e:e.type;if(!s)throw new Error(Qt(28));if(s in t)throw new Error(Qt(29));return t[s]=n,r},addAsyncThunk:(e,s)=>(s.pending&&(t[e.pending.type]=s.pending),s.rejected&&(t[e.rejected.type]=s.rejected),s.fulfilled&&(t[e.fulfilled.type]=s.fulfilled),s.settled&&n.push({matcher:e.settled,reducer:s.settled}),r),addMatcher:(e,t)=>(n.push({matcher:e,reducer:t}),r),addDefaultCase:e=>(s=e,r)};return e(r),[t,n,s]}const jt=Symbol.for("rtk-slice-createasyncthunk");function $t(e,t){return`${e}/${t}`}function Jt({creators:e}={}){const t=e?.asyncThunk?.[jt];return function(e){const{name:n,reducerPath:s=n}=e;if(!n)throw new Error(Qt(11));const r=("function"==typeof e.reducers?e.reducers(function(){function e(e,t){return{_reducerDefinitionType:"asyncThunk",payloadCreator:e,...t}}return e.withTypes=()=>e,{reducer:e=>Object.assign({[e.name]:(...t)=>e(...t)}[e.name],{_reducerDefinitionType:"reducer"}),preparedReducer:(e,t)=>({_reducerDefinitionType:"reducerWithPrepare",prepare:e,reducer:t}),asyncThunk:e}}()):e.reducers)||{},i=Object.keys(r),a={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},o={addCase(e,t){const n="string"==typeof e?e:e.type;if(!n)throw new Error(Qt(12));if(n in a.sliceCaseReducersByType)throw new Error(Qt(13));return a.sliceCaseReducersByType[n]=t,o},addMatcher:(e,t)=>(a.sliceMatchers.push({matcher:e,reducer:t}),o),exposeAction:(e,t)=>(a.actionCreators[e]=t,o),exposeCaseReducer:(e,t)=>(a.sliceCaseReducersByName[e]=t,o)};function B(){const[t={},n=[],s]="function"==typeof e.extraReducers?Vt(e.extraReducers):[e.extraReducers],r={...t,...a.sliceCaseReducersByType};return function(e,t){let n,[s,r,i]=Vt(t);if(function(e){return"function"==typeof e}(e))n=()=>Mt(e());else{const t=Mt(e);n=()=>t}function a(e=n(),t){let a=[s[t.type],...r.filter(({matcher:e})=>e(t)).map(({reducer:e})=>e)];return 0===a.filter(e=>!!e).length&&(a=[i]),a.reduce((e,n)=>{if(n){if(ke(e)){const s=n(e,t);return void 0===s?e:s}if(Le(e))return Nt(e,e=>n(e,t));{const s=n(e,t);if(void 0===s){if(null===e)return e;throw new Error(Qt(9))}return s}}return e},e)}return a.getInitialState=n,a}(e.initialState,e=>{for(let t in r)e.addCase(t,r[t]);for(let t of a.sliceMatchers)e.addMatcher(t.matcher,t.reducer);for(let t of n)e.addMatcher(t.matcher,t.reducer);s&&e.addDefaultCase(s)})}i.forEach(s=>{const i=r[s],a={reducerName:s,type:$t(n,s),createNotation:"function"==typeof e.reducers};!function(e){return"asyncThunk"===e._reducerDefinitionType}(i)?function({type:e,reducerName:t,createNotation:n},s,r){let i,a;if("reducer"in s){if(n&&!function(e){return"reducerWithPrepare"===e._reducerDefinitionType}(s))throw new Error(Qt(17));i=s.reducer,a=s.prepare}else i=s;r.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,a?Ft(e,a):Ft(e))}(a,i,o):function({type:e,reducerName:t},n,s,r){if(!r)throw new Error(Qt(18));const{payloadCreator:i,fulfilled:a,pending:o,rejected:B,settled:c,options:l}=n,u=r(e,i,l);s.exposeAction(t,u),a&&s.addCase(u.fulfilled,a);o&&s.addCase(u.pending,o);B&&s.addCase(u.rejected,B);c&&s.addMatcher(u.settled,c);s.exposeCaseReducer(t,{fulfilled:a||Kt,pending:o||Kt,rejected:B||Kt,settled:c||Kt})}(a,i,o,t)});const c=e=>e,l=new Map,u=new WeakMap;let h;function p(e,t){return h||(h=B()),h(e,t)}function d(){return h||(h=B()),h.getInitialState()}function f(t,n=!1){function s(e){let r=e[t];return void 0===r&&n&&(r=Gt(u,s,d)),r}function r(t=c){return Gt(Gt(l,n,()=>new WeakMap),t,()=>{const s={};for(const[r,i]of Object.entries(e.selectors??{}))s[r]=qt(i,t,()=>Gt(u,t,d),n);return s})}return{reducerPath:t,getSelectors:r,get selectors(){return r(s)},selectSlice:s}}const C={name:n,reducer:p,actions:a.actionCreators,caseReducers:a.sliceCaseReducersByName,getInitialState:d,...f(s),injectInto(e,{reducerPath:t,...n}={}){const r=t??s;return e.inject({reducerPath:r,reducer:p},n),{...C,...f(r,!0)}}};return C}}function qt(e,t,n,s){function r(r,...i){let a=t(r);return void 0===a&&s&&(a=n()),e(a,...i)}return r.unwrapped=e,r}const zt=Jt();function Kt(){}function Qt(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}const Wt=zt({name:"user",initialState:{settings:"profile",login:!1,drawer:!1,registerOne:!1,registerTwo:!1,userId:"user",customer:"",profileChoice:"unChosen",name:"",photoURL:"",phone:"(...) ... - ....",email:""},reducers:{navigateAuth:(e,t)=>{switch(t.payload){case"profile":case"verification":case"password":case"delete":break;default:t.payload="profile"}e.settings=t.payload},userAuth:(e,t)=>{e.login=t.payload},toggleSign:e=>{!0===e.drawer?e.drawer=!1:e.drawer=!0},openSign:e=>{e.drawer=!0},closeSign:e=>{e.drawer=!1},signUpAction:e=>{!1===e.registerOne?e.registerOne=!0:e.registerOne=!1},universalToggle:(e,t)=>{"drawer"===t.payload?!1===e.registerOne?e.registerOne=!0:e.registerOne=!1:!1===e.registerTwo?e.registerTwo=!0:e.registerTwo=!1},signUpClose:(e,t)=>{e.registerOne=t.payload},iconAuth:(e,t)=>{e.photoURL=t.payload},nameAuth:(e,t)=>{e.name=t.payload}}}),{universalToggle:Yt,navigateAuth:Xt,iconAuth:Zt,nameAuth:en,userAuth:tn,toggleSign:nn,openSign:sn,closeSign:rn,signUpAction:an,signUpClose:on}=Wt.actions,Bn=zt({name:"backend",initialState:{verified:!1,anon:!1,userId:"",name:"",email:"",photoURL:"",phone:"",msgToken:""},reducers:{accVerified:(e,t)=>{e.verified=t.payload},accAnon:(e,t)=>{e.anon=t.payload},accID:(e,t)=>{e.userId=t.payload},accName:(e,t)=>{e.name=t.payload},accPhone:(e,t)=>{e.phone=t.payload},accEmail:(e,t)=>{e.email=t.payload},accImage:(e,t)=>{e.photoURL=t.payload},messageId:(e,t)=>{e.msgToken=t.payload}}}),{accVerified:cn,accID:ln,accName:un,accPhone:hn,accEmail:pn,accImage:dn,accAnon:fn,messageId:Cn}=Bn.actions,gn=function(e){const t=function(e){const{thunk:t=!0,immutableCheck:n=!0,serializableCheck:s=!0,actionCreatorCheck:r=!0}=e??{};let i=new Pt;return t&&(function(e){return"boolean"==typeof e}(t)?i.push(kt):i.push(Lt(t.extraArgument))),i},{reducer:n,middleware:s,devTools:r=!0,preloadedState:i,enhancers:a}=e||{};let o,B;if("function"==typeof n)o=n;else{if(!ge(n))throw new Error(Qt(1));o=we(n)}B="function"==typeof s?s(t):t();let c=Ee;r&&(c=xt({trace:!1,..."object"==typeof r&&r}));const l=function(...e){return t=>(n,s)=>{const r=t(n,s);let i=()=>{throw new Error(pe(15))};const a={getState:r.getState,dispatch:(e,...t)=>i(e,...t)},o=e.map(e=>e(a));return i=Ee(...o)(r.dispatch),{...r,dispatch:i}}}(...B),u=(e=>function(t){const{autoBatch:n=!0}=t??{};let s=new Pt(e);return n&&s.push(Ht("object"==typeof n?n:void 0)),s})(l);return me(o,i,c(..."function"==typeof a?a(u):u()))}({reducer:{frontend:Wt.reducer,backend:Bn.reducer},devTools:!0}),mn=i`
8
-
9
- :host {
10
- transition: max-height 1.4s ease-out;
11
- overflow: hidden;
12
- display: grid;
13
- }
14
-
15
- .spec[on] {
16
- display: grid;
17
- }
18
-
19
- .spec {
20
- display: none;
21
- }
22
-
23
- .service {
24
- display: grid;
25
- overflow: hidden;
26
- color: var(--pwa_drawer_text_color, #1c2430);
27
- background-color: var(--section_background_color, #fffdf8);
28
- }
29
-
30
- :host([animation]) {
31
- transition-duration: 1.4s;
32
- max-height: 100%;
33
- transition: max-height 1.4s ease-out;
34
- }
35
-
36
- h3 {
37
- margin: 0;
38
- padding: 18px 16px 14px;
39
- font-size: 1.15rem;
40
- font-weight: 600;
41
- border-bottom: 1px solid var(--pwa_line_color, #e3daca);
42
- }
43
-
44
- `,wn=i`
45
-
46
- a {
47
- font-size: 0.95rem;
48
- color: var(--pwa_label_text_color, #1c2430);
49
- font-weight: 600;
50
- text-decoration: none;
51
- }
52
-
53
- `,En=i`
54
-
55
- .setLog > p {
56
- margin: 12px;
57
- box-sizing: border-box;
58
- text-align: center;
59
- }
60
-
61
- `,yn=i`
7
+ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,n=Symbol(),s=new WeakMap;let r=class{constructor(e,t,s){if(this._$cssResult$=!0,s!==n)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const n=this.t;if(t&&void 0===e){const t=void 0!==n&&1===n.length;t&&(e=s.get(n)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),t&&s.set(n,e))}return e}toString(){return this.cssText}};const i=(e,...t)=>{const s=1===e.length?e[0]:t.reduce((t,n,s)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+e[s+1],e[0]);return new r(s,e,n)},a=t?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const n of e.cssRules)t+=n.cssText;return(e=>new r("string"==typeof e?e:e+"",void 0,n))(t)})(e):e,{is:o,defineProperty:B,getOwnPropertyDescriptor:c,getOwnPropertyNames:l,getOwnPropertySymbols:u,getPrototypeOf:h}=Object,p=globalThis,d=p.trustedTypes,f=d?d.emptyScript:"",C=p.reactiveElementPolyfillSupport,g=(e,t)=>e,m={toAttribute(e,t){switch(t){case Boolean:e=e?f:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=null!==e;break;case Number:n=null===e?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch(e){n=null}}return n}},w=(e,t)=>!o(e,t),E={attribute:!0,type:String,converter:m,reflect:!1,useDefault:!1,hasChanged:w};Symbol.metadata??=Symbol("metadata"),p.litPropertyMetadata??=new WeakMap;let y=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=E){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const n=Symbol(),s=this.getPropertyDescriptor(e,n,t);void 0!==s&&B(this.prototype,e,s)}}static getPropertyDescriptor(e,t,n){const{get:s,set:r}=c(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:s,set(t){const i=s?.call(this);r?.call(this,t),this.requestUpdate(e,i,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??E}static _$Ei(){if(this.hasOwnProperty(g("elementProperties")))return;const e=h(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(g("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(g("properties"))){const e=this.properties,t=[...l(e),...u(e)];for(const n of t)this.createProperty(n,e[n])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const n=this._$Eu(e,t);void 0!==n&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const e of n)t.unshift(a(e))}else void 0!==e&&t.push(a(e));return t}static _$Eu(e,t){const n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const n=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((n,s)=>{if(t)n.adoptedStyleSheets=s.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const t of s){const s=document.createElement("style"),r=e.litNonce;void 0!==r&&s.setAttribute("nonce",r),s.textContent=t.cssText,n.appendChild(s)}})(n,this.constructor.elementStyles),n}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){const n=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,n);if(void 0!==s&&!0===n.reflect){const r=(void 0!==n.converter?.toAttribute?n.converter:m).toAttribute(t,n.type);this._$Em=e,null==r?this.removeAttribute(s):this.setAttribute(s,r),this._$Em=null}}_$AK(e,t){const n=this.constructor,s=n._$Eh.get(e);if(void 0!==s&&this._$Em!==s){const e=n.getPropertyOptions(s),r="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:m;this._$Em=s;const i=r.fromAttribute(t,e.type);this[s]=i??this._$Ej?.get(s)??i,this._$Em=null}}requestUpdate(e,t,n){if(void 0!==e){const s=this.constructor,r=this[e];if(n??=s.getPropertyOptions(e),!((n.hasChanged??w)(r,t)||n.useDefault&&n.reflect&&r===this._$Ej?.get(e)&&!this.hasAttribute(s._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:s,wrapped:r},i){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,i??t??this[e]),!0!==r||void 0!==i)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),!0===s&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,n]of e){const{wrapped:e}=n,s=this[t];!0!==e||this._$AL.has(t)||void 0===s||this.C(t,void 0,n,s)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}};y.elementStyles=[],y.shadowRootOptions={mode:"open"},y[g("elementProperties")]=new Map,y[g("finalized")]=new Map,C?.({ReactiveElement:y}),(p.reactiveElementVersions??=[]).push("2.1.1");const D=globalThis,_=D.trustedTypes,b=_?_.createPolicy("lit-html",{createHTML:e=>e}):void 0,v="$lit$",I=`lit$${Math.random().toFixed(9).slice(2)}$`,T="?"+I,A=`<${T}>`,O=document,S=()=>O.createComment(""),N=e=>null===e||"object"!=typeof e&&"function"!=typeof e,R=Array.isArray,k="[ \t\n\f\r]",L=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,x=/-->/g,F=/>/g,P=RegExp(`>|${k}(?:([^\\s"'>=/]+)(${k}*=${k}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),M=/'/g,G=/"/g,U=/^(?:script|style|textarea|title)$/i,H=(e=>(t,...n)=>({_$litType$:e,strings:t,values:n}))(1),V=Symbol.for("lit-noChange"),j=Symbol.for("lit-nothing"),$=new WeakMap,J=O.createTreeWalker(O,129);function q(e,t){if(!R(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==b?b.createHTML(t):t}const z=(e,t)=>{const n=e.length-1,s=[];let r,i=2===t?"<svg>":3===t?"<math>":"",a=L;for(let t=0;t<n;t++){const n=e[t];let o,B,c=-1,l=0;for(;l<n.length&&(a.lastIndex=l,B=a.exec(n),null!==B);)l=a.lastIndex,a===L?"!--"===B[1]?a=x:void 0!==B[1]?a=F:void 0!==B[2]?(U.test(B[2])&&(r=RegExp("</"+B[2],"g")),a=P):void 0!==B[3]&&(a=P):a===P?">"===B[0]?(a=r??L,c=-1):void 0===B[1]?c=-2:(c=a.lastIndex-B[2].length,o=B[1],a=void 0===B[3]?P:'"'===B[3]?G:M):a===G||a===M?a=P:a===x||a===F?a=L:(a=P,r=void 0);const u=a===P&&e[t+1].startsWith("/>")?" ":"";i+=a===L?n+A:c>=0?(s.push(o),n.slice(0,c)+v+n.slice(c)+I+u):n+I+(-2===c?t:u)}return[q(e,i+(e[n]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),s]};class K{constructor({strings:e,_$litType$:t},n){let s;this.parts=[];let r=0,i=0;const a=e.length-1,o=this.parts,[B,c]=z(e,t);if(this.el=K.createElement(B,n),J.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(s=J.nextNode())&&o.length<a;){if(1===s.nodeType){if(s.hasAttributes())for(const e of s.getAttributeNames())if(e.endsWith(v)){const t=c[i++],n=s.getAttribute(e).split(I),a=/([.?@])?(.*)/.exec(t);o.push({type:1,index:r,name:a[2],strings:n,ctor:"."===a[1]?Z:"?"===a[1]?ee:"@"===a[1]?te:X}),s.removeAttribute(e)}else e.startsWith(I)&&(o.push({type:6,index:r}),s.removeAttribute(e));if(U.test(s.tagName)){const e=s.textContent.split(I),t=e.length-1;if(t>0){s.textContent=_?_.emptyScript:"";for(let n=0;n<t;n++)s.append(e[n],S()),J.nextNode(),o.push({type:2,index:++r});s.append(e[t],S())}}}else if(8===s.nodeType)if(s.data===T)o.push({type:2,index:r});else{let e=-1;for(;-1!==(e=s.data.indexOf(I,e+1));)o.push({type:7,index:r}),e+=I.length-1}r++}}static createElement(e,t){const n=O.createElement("template");return n.innerHTML=e,n}}function Q(e,t,n=e,s){if(t===V)return t;let r=void 0!==s?n._$Co?.[s]:n._$Cl;const i=N(t)?void 0:t._$litDirective$;return r?.constructor!==i&&(r?._$AO?.(!1),void 0===i?r=void 0:(r=new i(e),r._$AT(e,n,s)),void 0!==s?(n._$Co??=[])[s]=r:n._$Cl=r),void 0!==r&&(t=Q(e,r._$AS(e,t.values),r,s)),t}let W=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:n}=this._$AD,s=(e?.creationScope??O).importNode(t,!0);J.currentNode=s;let r=J.nextNode(),i=0,a=0,o=n[0];for(;void 0!==o;){if(i===o.index){let t;2===o.type?t=new Y(r,r.nextSibling,this,e):1===o.type?t=new o.ctor(r,o.name,o.strings,this,e):6===o.type&&(t=new ne(r,this,e)),this._$AV.push(t),o=n[++a]}i!==o?.index&&(r=J.nextNode(),i++)}return J.currentNode=O,s}p(e){let t=0;for(const n of this._$AV)void 0!==n&&(void 0!==n.strings?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}},Y=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,s){this.type=2,this._$AH=j,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Q(this,e,t),N(e)?e===j||null==e||""===e?(this._$AH!==j&&this._$AR(),this._$AH=j):e!==this._$AH&&e!==V&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>R(e)||"function"==typeof e?.[Symbol.iterator])(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==j&&N(this._$AH)?this._$AA.nextSibling.data=e:this.T(O.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:n}=e,s="number"==typeof n?this._$AC(e):(void 0===n.el&&(n.el=K.createElement(q(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===s)this._$AH.p(t);else{const e=new W(s,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=$.get(e.strings);return void 0===t&&$.set(e.strings,t=new K(e)),t}k(t){R(this._$AH)||(this._$AH=[],this._$AR());const n=this._$AH;let s,r=0;for(const i of t)r===n.length?n.push(s=new e(this.O(S()),this.O(S()),this,this.options)):s=n[r],s._$AI(i),r++;r<n.length&&(this._$AR(s&&s._$AB.nextSibling,r),n.length=r)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){const t=e.nextSibling;e.remove(),e=t}}setConnected(e){void 0===this._$AM&&(this._$Cv=e,this._$AP?.(e))}},X=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,s,r){this.type=1,this._$AH=j,this._$AN=void 0,this.element=e,this.name=t,this._$AM=s,this.options=r,n.length>2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=j}_$AI(e,t=this,n,s){const r=this.strings;let i=!1;if(void 0===r)e=Q(this,e,t,0),i=!N(e)||e!==this._$AH&&e!==V,i&&(this._$AH=e);else{const s=e;let a,o;for(e=r[0],a=0;a<r.length-1;a++)o=Q(this,s[n+a],t,a),o===V&&(o=this._$AH[a]),i||=!N(o)||o!==this._$AH[a],o===j?e=j:e!==j&&(e+=(o??"")+r[a+1]),this._$AH[a]=o}i&&!s&&this.j(e)}j(e){e===j?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}};class Z extends X{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===j?void 0:e}}let ee=class extends X{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==j)}},te=class extends X{constructor(e,t,n,s,r){super(e,t,n,s,r),this.type=5}_$AI(e,t=this){if((e=Q(this,e,t,0)??j)===V)return;const n=this._$AH,s=e===j&&n!==j||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,r=e!==j&&(n===j||s);s&&this.element.removeEventListener(this.name,this,n),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}};class ne{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){Q(this,e)}}const se=D.litHtmlPolyfillSupport;se?.(K,Y),(D.litHtmlVersions??=[]).push("3.3.1");const re=globalThis;let ie=class extends y{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=((e,t,n)=>{const s=n?.renderBefore??t;let r=s._$litPart$;if(void 0===r){const e=n?.renderBefore??null;s._$litPart$=r=new Y(t.insertBefore(S(),e),e,void 0,n??{})}return r._$AI(e),r})(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return V}};ie._$litElement$=!0,ie.finalized=!0,re.litElementHydrateSupport?.({LitElement:ie});const ae=re.litElementPolyfillSupport;ae?.({LitElement:ie}),(re.litElementVersions??=[]).push("4.2.1");const oe=e=>(t,n)=>{void 0!==n?n.addInitializer(()=>{customElements.define(e,t)}):customElements.define(e,t)},Be={attribute:!0,type:String,converter:m,reflect:!1,hasChanged:w},ce=(e=Be,t,n)=>{const{kind:s,metadata:r}=n;let i=globalThis.litPropertyMetadata.get(r);if(void 0===i&&globalThis.litPropertyMetadata.set(r,i=new Map),"setter"===s&&((e=Object.create(e)).wrapped=!0),i.set(n.name,e),"accessor"===s){const{name:s}=n;return{set(n){const r=t.get.call(this);t.set.call(this,n),this.requestUpdate(s,r,e)},init(t){return void 0!==t&&this.C(s,void 0,e,t),t}}}if("setter"===s){const{name:s}=n;return function(n){const r=this[s];t.call(this,n),this.requestUpdate(s,r,e)}}throw Error("Unsupported decorator location: "+s)};function le(e){return(t,n)=>"object"==typeof n?ce(e,t,n):((e,t,n)=>{const s=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),s?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}function ue(e){return le({...e,state:!0,attribute:!1})}const he=e=>t=>class extends t{connectedCallback(){super.connectedCallback&&super.connectedCallback(),this._storeUnsubscribe=e.subscribe(()=>this.stateChanged(e.getState())),this.stateChanged(e.getState())}disconnectedCallback(){this._storeUnsubscribe(),super.disconnectedCallback&&super.disconnectedCallback()}stateChanged(e){}};function pe(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var de=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),fe=()=>Math.random().toString(36).substring(7).split("").join("."),Ce={INIT:`@@redux/INIT${fe()}`,REPLACE:`@@redux/REPLACE${fe()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${fe()}`};function ge(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}function me(e,t,n){if("function"!=typeof e)throw new Error(pe(2));if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(pe(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(pe(1));return n(me)(e,t)}let s=e,r=t,i=new Map,a=i,o=0,B=!1;function c(){a===i&&(a=new Map,i.forEach((e,t)=>{a.set(t,e)}))}function l(){if(B)throw new Error(pe(3));return r}function u(e){if("function"!=typeof e)throw new Error(pe(4));if(B)throw new Error(pe(5));let t=!0;c();const n=o++;return a.set(n,e),function(){if(t){if(B)throw new Error(pe(6));t=!1,c(),a.delete(n),i=null}}}function h(e){if(!ge(e))throw new Error(pe(7));if(void 0===e.type)throw new Error(pe(8));if("string"!=typeof e.type)throw new Error(pe(17));if(B)throw new Error(pe(9));try{B=!0,r=s(r,e)}finally{B=!1}return(i=a).forEach(e=>{e()}),e}h({type:Ce.INIT});return{dispatch:h,subscribe:u,getState:l,replaceReducer:function(e){if("function"!=typeof e)throw new Error(pe(10));s=e,h({type:Ce.REPLACE})},[de]:function(){const e=u;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error(pe(11));function n(){const e=t;e.next&&e.next(l())}n();return{unsubscribe:e(n)}},[de](){return this}}}}}function we(e){const t=Object.keys(e),n={};for(let s=0;s<t.length;s++){const r=t[s];"function"==typeof e[r]&&(n[r]=e[r])}const s=Object.keys(n);let r;try{!function(e){Object.keys(e).forEach(t=>{const n=e[t];if(void 0===n(void 0,{type:Ce.INIT}))throw new Error(pe(12));if(void 0===n(void 0,{type:Ce.PROBE_UNKNOWN_ACTION()}))throw new Error(pe(13))})}(n)}catch(e){r=e}return function(e={},t){if(r)throw r;let i=!1;const a={};for(let r=0;r<s.length;r++){const o=s[r],B=n[o],c=e[o],l=B(c,t);if(void 0===l)throw t&&t.type,new Error(pe(14));a[o]=l,i=i||l!==c}return i=i||s.length!==Object.keys(e).length,i?a:e}}function Ee(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce((e,t)=>(...n)=>e(t(...n)))}var ye=Symbol.for("immer-nothing"),De=Symbol.for("immer-draftable"),_e=Symbol.for("immer-state");function be(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ve=Object,Ie=ve.getPrototypeOf,Te="constructor",Ae="prototype",Oe="configurable",Se="enumerable",Ne="writable",Re="value",ke=e=>!!e&&!!e[_e];function Le(e){return!!e&&(Pe(e)||je(e)||!!e[De]||!!e[Te]?.[De]||$e(e)||Je(e))}var xe=ve[Ae][Te].toString(),Fe=new WeakMap;function Pe(e){if(!e||!qe(e))return!1;const t=Ie(e);if(null===t||t===ve[Ae])return!0;const n=ve.hasOwnProperty.call(t,Te)&&t[Te];if(n===Object)return!0;if(!ze(n))return!1;let s=Fe.get(n);return void 0===s&&(s=Function.toString.call(n),Fe.set(n,s)),s===xe}function Me(e,t,n=!0){if(0===Ge(e)){(n?Reflect.ownKeys(e):ve.keys(e)).forEach(n=>{t(n,e[n],e)})}else e.forEach((n,s)=>t(s,n,e))}function Ge(e){const t=e[_e];return t?t.type_:je(e)?1:$e(e)?2:Je(e)?3:0}var Ue=(e,t,n=Ge(e))=>2===n?e.has(t):ve[Ae].hasOwnProperty.call(e,t),He=(e,t,n=Ge(e))=>2===n?e.get(t):e[t],Ve=(e,t,n,s=Ge(e))=>{2===s?e.set(t,n):3===s?e.add(n):e[t]=n};var je=Array.isArray,$e=e=>e instanceof Map,Je=e=>e instanceof Set,qe=e=>"object"==typeof e,ze=e=>"function"==typeof e,Ke=e=>"boolean"==typeof e;var Qe=e=>e.copy_||e.base_,We=e=>e.modified_?e.copy_:e.base_;function Ye(e,t){if($e(e))return new Map(e);if(Je(e))return new Set(e);if(je(e))return Array[Ae].slice.call(e);const n=Pe(e);if(!0===t||"class_only"===t&&!n){const t=ve.getOwnPropertyDescriptors(e);delete t[_e];let n=Reflect.ownKeys(t);for(let s=0;s<n.length;s++){const r=n[s],i=t[r];!1===i[Ne]&&(i[Ne]=!0,i[Oe]=!0),(i.get||i.set)&&(t[r]={[Oe]:!0,[Ne]:!0,[Se]:i[Se],[Re]:e[r]})}return ve.create(Ie(e),t)}{const t=Ie(e);if(null!==t&&n)return{...e};const s=ve.create(t);return ve.assign(s,e)}}function Xe(e,t=!1){return et(e)||ke(e)||!Le(e)||(Ge(e)>1&&ve.defineProperties(e,{set:Ze,add:Ze,clear:Ze,delete:Ze}),ve.freeze(e),t&&Me(e,(e,t)=>{Xe(t,!0)},!1)),e}var Ze={[Re]:function(){be(2)}};function et(e){return null===e||!qe(e)||ve.isFrozen(e)}var tt="MapSet",nt="Patches",st="ArrayMethods",rt={};function it(e){const t=rt[e];return t||be(0),t}var at,ot=e=>!!rt[e],Bt=()=>at;function ct(e,t){t&&(e.patchPlugin_=it(nt),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function lt(e){ut(e),e.drafts_.forEach(pt),e.drafts_=null}function ut(e){e===at&&(at=e.parent_)}var ht=e=>at={drafts_:[],parent_:at,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:ot(tt)?it(tt):void 0,arrayMethodsPlugin_:ot(st)?it(st):void 0};function pt(e){const t=e[_e];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function dt(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(void 0!==e&&e!==n){n[_e].modified_&&(lt(t),be(4)),Le(e)&&(e=ft(t,e));const{patchPlugin_:s}=t;s&&s.generateReplacementPatches_(n[_e].base_,e,t)}else e=ft(t,n);return function(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Xe(t,n)}(t,e,!0),lt(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==ye?e:void 0}function ft(e,t){if(et(t))return t;const n=t[_e];if(!n){return yt(t,e.handledSet_,e)}if(!gt(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:t}=n;if(t)for(;t.length>0;){t.pop()(e)}Et(n,e)}return n.copy_}function Ct(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var gt=(e,t)=>e.scope_===t,mt=[];function wt(e,t,n,s){const r=Qe(e),i=e.type_;if(void 0!==s){if(He(r,s,i)===t)return void Ve(r,s,n,i)}if(!e.draftLocations_){const t=e.draftLocations_=new Map;Me(r,(e,n)=>{if(ke(n)){const s=t.get(n)||[];s.push(e),t.set(n,s)}})}const a=e.draftLocations_.get(t)??mt;for(const e of a)Ve(r,e,n,i)}function Et(e,t){if(e.modified_&&!e.finalized_&&(3===e.type_||1===e.type_&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){const{patchPlugin_:n}=t;if(n){const s=n.getPath(e);s&&n.generatePatches_(e,s,t)}Ct(e)}}function yt(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||ke(e)||t.has(e)||!Le(e)||et(e)||(t.add(e),Me(e,(s,r)=>{if(ke(r)){const t=r[_e];if(gt(t,n)){const n=We(t);Ve(e,s,n,e.type_),Ct(t)}}else Le(r)&&yt(r,t,n)})),e}var Dt={get(e,t){if(t===_e)return e;let n=e.scope_.arrayMethodsPlugin_;const s=1===e.type_&&"string"==typeof t;if(s&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const r=Qe(e);if(!Ue(r,t,e.type_))return function(e,t,n){const s=vt(t,n);return s?Re in s?s[Re]:s.get?.call(e.draft_):void 0}(e,r,t);const i=r[t];if(e.finalized_||!Le(i))return i;if(s&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&function(e){const t=+e;return Number.isInteger(t)&&String(t)===e}(t))return i;if(i===bt(e.base_,t)){Tt(e);const n=1===e.type_?+t:t,s=At(e.scope_,i,e,n);return e.copy_[n]=s}return i},has:(e,t)=>t in Qe(e),ownKeys:e=>Reflect.ownKeys(Qe(e)),set(e,t,n){const s=vt(Qe(e),t);if(s?.set)return s.set.call(e.draft_,n),!0;if(!e.modified_){const s=bt(Qe(e),t),r=s?.[_e];if(r&&r.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}(n,s)&&(void 0!==n||Ue(e.base_,t,e.type_)))return!0;Tt(e),It(e)}return e.copy_[t]===n&&(void 0!==n||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),function(e,t,n){const{scope_:s}=e;if(ke(n)){const r=n[_e];gt(r,s)&&r.callbacks_.push(function(){Tt(e);const s=We(r);wt(e,n,s,t)})}else Le(n)&&e.callbacks_.push(function(){const r=Qe(e);3===e.type_?r.has(n)&&yt(n,s.handledSet_,s):He(r,t,e.type_)===n&&s.drafts_.length>1&&!0===(e.assigned_.get(t)??!1)&&e.copy_&&yt(He(e.copy_,t,e.type_),s.handledSet_,s)})}(e,t,n)),!0},deleteProperty:(e,t)=>(Tt(e),void 0!==bt(e.base_,t)||t in e.base_?(e.assigned_.set(t,!1),It(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=Qe(e),s=Reflect.getOwnPropertyDescriptor(n,t);return s?{[Ne]:!0,[Oe]:1!==e.type_||"length"!==t,[Se]:s[Se],[Re]:n[t]}:s},defineProperty(){be(11)},getPrototypeOf:e=>Ie(e.base_),setPrototypeOf(){be(12)}},_t={};for(let e in Dt){let t=Dt[e];_t[e]=function(){const e=arguments;return e[0]=e[0][0],t.apply(this,e)}}function bt(e,t){const n=e[_e];return(n?Qe(n):e)[t]}function vt(e,t){if(!(t in e))return;let n=Ie(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=Ie(n)}}function It(e){e.modified_||(e.modified_=!0,e.parent_&&It(e.parent_))}function Tt(e){e.copy_||(e.assigned_=new Map,e.copy_=Ye(e.base_,e.scope_.immer_.useStrictShallowCopy_))}_t.deleteProperty=function(e,t){return _t.set.call(this,e,t,void 0)},_t.set=function(e,t,n){return Dt.set.call(this,e[0],t,n,e[0])};function At(e,t,n,s){const[r,i]=$e(t)?it(tt).proxyMap_(t,n):Je(t)?it(tt).proxySet_(t,n):function(e,t){const n=je(e),s={type_:n?1:0,scope_:t?t.scope_:Bt(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let r=s,i=Dt;n&&(r=[s],i=_t);const{revoke:a,proxy:o}=Proxy.revocable(r,i);return s.draft_=o,s.revoke_=a,[o,s]}(t,n);return(n?.scope_??Bt()).drafts_.push(r),i.callbacks_=n?.callbacks_??[],i.key_=s,n&&void 0!==s?function(e,t,n){e.callbacks_.push(function(s){const r=t;if(!r||!gt(r,s))return;s.mapSetPlugin_?.fixSetContents(r);const i=We(r);wt(e,r.draft_??r,i,n),Et(r,s)})}(n,i,s):i.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(i);const{patchPlugin_:t}=e;i.modified_&&t&&t.generatePatches_(i,[],e)}),r}function Ot(e){if(!Le(e)||et(e))return e;const t=e[_e];let n,s=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Ye(e,t.scope_.immer_.useStrictShallowCopy_),s=t.scope_.immer_.shouldUseStrictIteration()}else n=Ye(e,!0);return Me(n,(e,t)=>{Ve(n,e,Ot(t))},s),t&&(t.finalized_=!1),n}var St=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{if(ze(e)&&!ze(t)){const n=t;t=e;const s=this;return function(e=n,...r){return s.produce(e,e=>t.call(this,e,...r))}}let s;if(ze(t)||be(6),void 0===n||ze(n)||be(7),Le(e)){const r=ht(this),i=At(r,e,void 0);let a=!0;try{s=t(i),a=!1}finally{a?lt(r):ut(r)}return ct(r,n),dt(s,r)}if(!e||!qe(e)){if(s=t(e),void 0===s&&(s=e),s===ye&&(s=void 0),this.autoFreeze_&&Xe(s,!0),n){const t=[],r=[];it(nt).generateReplacementPatches_(e,s,{patches_:t,inversePatches_:r}),n(t,r)}return s}be(1)},this.produceWithPatches=(e,t)=>{if(ze(e))return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,s;const r=this.produce(e,t,(e,t)=>{n=e,s=t});return[r,n,s]},Ke(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),Ke(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),Ke(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Le(e)||be(8),ke(e)&&(e=function(e){ke(e)||be(10);return Ot(e)}(e));const t=ht(this),n=At(t,e,void 0);return n[_e].isManual_=!0,ut(t),n}finishDraft(e,t){const n=e&&e[_e];n&&n.isManual_||be(9);const{scope_:s}=n;return ct(s,t),dt(void 0,s)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const s=t[n];if(0===s.path.length&&"replace"===s.op){e=s.value;break}}n>-1&&(t=t.slice(n+1));const s=it(nt).applyPatches_;return ke(e)?s(e,t):this.produce(e,e=>s(e,t))}},Nt=St.produce;function Rt(e){return({dispatch:t,getState:n})=>s=>r=>"function"==typeof r?r(t,n,e):s(r)}var kt=Rt(),Lt=Rt;const xt="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?Ee:Ee.apply(null,arguments)};function Ft(e,t){function n(...n){if(t){let s=t(...n);if(!s)throw new Error(Qt(0));return{type:e,payload:s.payload,..."meta"in s&&{meta:s.meta},..."error"in s&&{error:s.error}}}return{type:e,payload:n[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=t=>function(e){return ge(e)&&"type"in e&&"string"==typeof e.type}(t)&&t.type===e,n}var Pt=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return 1===t.length&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function Mt(e){return Le(e)?Nt(e,()=>{}):e}function Gt(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}const Ut=e=>t=>{setTimeout(t,e)},Ht=(e={type:"raf"})=>t=>(...n)=>{const s=t(...n);let r=!0,i=!1,a=!1;const o=new Set,B="tick"===e.type?queueMicrotask:"raf"===e.type?"undefined"!=typeof window&&window.requestAnimationFrame?(c=window.requestAnimationFrame,l=100,e=>{let t,n,s=!1;const r=()=>{s||(s=!0,cancelAnimationFrame(t),clearTimeout(n),e())};t=c(r),n=setTimeout(r,l)}):Ut(10):"callback"===e.type?e.queueNotification:Ut(e.timeout);var c,l;const u=()=>{a=!1,i&&(i=!1,o.forEach(e=>e()))};return Object.assign({},s,{subscribe(e){const t=s.subscribe(()=>r&&e());return o.add(e),()=>{t(),o.delete(e)}},dispatch(e){try{return r=!e?.meta?.RTK_autoBatch,i=!r,i&&(a||(a=!0,B(u))),s.dispatch(e)}finally{r=!0}}})};function Vt(e){const t={},n=[];let s;const r={addCase(e,n){const s="string"==typeof e?e:e.type;if(!s)throw new Error(Qt(28));if(s in t)throw new Error(Qt(29));return t[s]=n,r},addAsyncThunk:(e,s)=>(s.pending&&(t[e.pending.type]=s.pending),s.rejected&&(t[e.rejected.type]=s.rejected),s.fulfilled&&(t[e.fulfilled.type]=s.fulfilled),s.settled&&n.push({matcher:e.settled,reducer:s.settled}),r),addMatcher:(e,t)=>(n.push({matcher:e,reducer:t}),r),addDefaultCase:e=>(s=e,r)};return e(r),[t,n,s]}const jt=Symbol.for("rtk-slice-createasyncthunk");function $t(e,t){return`${e}/${t}`}function Jt({creators:e}={}){const t=e?.asyncThunk?.[jt];return function(e){const{name:n,reducerPath:s=n}=e;if(!n)throw new Error(Qt(11));const r=("function"==typeof e.reducers?e.reducers(function(){function e(e,t){return{_reducerDefinitionType:"asyncThunk",payloadCreator:e,...t}}return e.withTypes=()=>e,{reducer:e=>Object.assign({[e.name]:(...t)=>e(...t)}[e.name],{_reducerDefinitionType:"reducer"}),preparedReducer:(e,t)=>({_reducerDefinitionType:"reducerWithPrepare",prepare:e,reducer:t}),asyncThunk:e}}()):e.reducers)||{},i=Object.keys(r),a={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},o={addCase(e,t){const n="string"==typeof e?e:e.type;if(!n)throw new Error(Qt(12));if(n in a.sliceCaseReducersByType)throw new Error(Qt(13));return a.sliceCaseReducersByType[n]=t,o},addMatcher:(e,t)=>(a.sliceMatchers.push({matcher:e,reducer:t}),o),exposeAction:(e,t)=>(a.actionCreators[e]=t,o),exposeCaseReducer:(e,t)=>(a.sliceCaseReducersByName[e]=t,o)};function B(){const[t={},n=[],s]="function"==typeof e.extraReducers?Vt(e.extraReducers):[e.extraReducers],r={...t,...a.sliceCaseReducersByType};return function(e,t){let n,[s,r,i]=Vt(t);if(function(e){return"function"==typeof e}(e))n=()=>Mt(e());else{const t=Mt(e);n=()=>t}function a(e=n(),t){let a=[s[t.type],...r.filter(({matcher:e})=>e(t)).map(({reducer:e})=>e)];return 0===a.filter(e=>!!e).length&&(a=[i]),a.reduce((e,n)=>{if(n){if(ke(e)){const s=n(e,t);return void 0===s?e:s}if(Le(e))return Nt(e,e=>n(e,t));{const s=n(e,t);if(void 0===s){if(null===e)return e;throw new Error(Qt(9))}return s}}return e},e)}return a.getInitialState=n,a}(e.initialState,e=>{for(let t in r)e.addCase(t,r[t]);for(let t of a.sliceMatchers)e.addMatcher(t.matcher,t.reducer);for(let t of n)e.addMatcher(t.matcher,t.reducer);s&&e.addDefaultCase(s)})}i.forEach(s=>{const i=r[s],a={reducerName:s,type:$t(n,s),createNotation:"function"==typeof e.reducers};!function(e){return"asyncThunk"===e._reducerDefinitionType}(i)?function({type:e,reducerName:t,createNotation:n},s,r){let i,a;if("reducer"in s){if(n&&!function(e){return"reducerWithPrepare"===e._reducerDefinitionType}(s))throw new Error(Qt(17));i=s.reducer,a=s.prepare}else i=s;r.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,a?Ft(e,a):Ft(e))}(a,i,o):function({type:e,reducerName:t},n,s,r){if(!r)throw new Error(Qt(18));const{payloadCreator:i,fulfilled:a,pending:o,rejected:B,settled:c,options:l}=n,u=r(e,i,l);s.exposeAction(t,u),a&&s.addCase(u.fulfilled,a);o&&s.addCase(u.pending,o);B&&s.addCase(u.rejected,B);c&&s.addMatcher(u.settled,c);s.exposeCaseReducer(t,{fulfilled:a||Kt,pending:o||Kt,rejected:B||Kt,settled:c||Kt})}(a,i,o,t)});const c=e=>e,l=new Map,u=new WeakMap;let h;function p(e,t){return h||(h=B()),h(e,t)}function d(){return h||(h=B()),h.getInitialState()}function f(t,n=!1){function s(e){let r=e[t];return void 0===r&&n&&(r=Gt(u,s,d)),r}function r(t=c){return Gt(Gt(l,n,()=>new WeakMap),t,()=>{const s={};for(const[r,i]of Object.entries(e.selectors??{}))s[r]=qt(i,t,()=>Gt(u,t,d),n);return s})}return{reducerPath:t,getSelectors:r,get selectors(){return r(s)},selectSlice:s}}const C={name:n,reducer:p,actions:a.actionCreators,caseReducers:a.sliceCaseReducersByName,getInitialState:d,...f(s),injectInto(e,{reducerPath:t,...n}={}){const r=t??s;return e.inject({reducerPath:r,reducer:p},n),{...C,...f(r,!0)}}};return C}}function qt(e,t,n,s){function r(r,...i){let a=t(r);return void 0===a&&s&&(a=n()),e(a,...i)}return r.unwrapped=e,r}const zt=Jt();function Kt(){}function Qt(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}const Wt=zt({name:"user",initialState:{settings:"profile",login:!1,drawer:!1,registerOne:!1,registerTwo:!1,userId:"user",customer:"",profileChoice:"unChosen",name:"",photoURL:"",phone:"(...) ... - ....",email:""},reducers:{navigateAuth:(e,t)=>{switch(t.payload){case"profile":case"verification":case"password":case"delete":break;default:t.payload="profile"}e.settings=t.payload},userAuth:(e,t)=>{e.login=t.payload},toggleSign:e=>{!0===e.drawer?e.drawer=!1:e.drawer=!0},openSign:e=>{e.drawer=!0},closeSign:e=>{e.drawer=!1},signUpAction:e=>{!1===e.registerOne?e.registerOne=!0:e.registerOne=!1},universalToggle:(e,t)=>{"drawer"===t.payload?!1===e.registerOne?e.registerOne=!0:e.registerOne=!1:!1===e.registerTwo?e.registerTwo=!0:e.registerTwo=!1},signUpClose:(e,t)=>{e.registerOne=t.payload},iconAuth:(e,t)=>{e.photoURL=t.payload},nameAuth:(e,t)=>{e.name=t.payload}}}),{universalToggle:Yt,navigateAuth:Xt,iconAuth:Zt,nameAuth:en,userAuth:tn,toggleSign:nn,openSign:sn,closeSign:rn,signUpAction:an,signUpClose:on}=Wt.actions,Bn=zt({name:"backend",initialState:{verified:!1,anon:!1,userId:"",name:"",email:"",photoURL:"",phone:"",msgToken:""},reducers:{accVerified:(e,t)=>{e.verified=t.payload},accAnon:(e,t)=>{e.anon=t.payload},accID:(e,t)=>{e.userId=t.payload},accName:(e,t)=>{e.name=t.payload},accPhone:(e,t)=>{e.phone=t.payload},accEmail:(e,t)=>{e.email=t.payload},accImage:(e,t)=>{e.photoURL=t.payload},messageId:(e,t)=>{e.msgToken=t.payload}}}),{accVerified:cn,accID:ln,accName:un,accPhone:hn,accEmail:pn,accImage:dn,accAnon:fn,messageId:Cn}=Bn.actions,gn=function(e){const t=function(e){const{thunk:t=!0,immutableCheck:n=!0,serializableCheck:s=!0,actionCreatorCheck:r=!0}=e??{};let i=new Pt;return t&&(function(e){return"boolean"==typeof e}(t)?i.push(kt):i.push(Lt(t.extraArgument))),i},{reducer:n,middleware:s,devTools:r=!0,preloadedState:i,enhancers:a}=e||{};let o,B;if("function"==typeof n)o=n;else{if(!ge(n))throw new Error(Qt(1));o=we(n)}B="function"==typeof s?s(t):t();let c=Ee;r&&(c=xt({trace:!1,..."object"==typeof r&&r}));const l=function(...e){return t=>(n,s)=>{const r=t(n,s);let i=()=>{throw new Error(pe(15))};const a={getState:r.getState,dispatch:(e,...t)=>i(e,...t)},o=e.map(e=>e(a));return i=Ee(...o)(r.dispatch),{...r,dispatch:i}}}(...B),u=(e=>function(t){const{autoBatch:n=!0}=t??{};let s=new Pt(e);return n&&s.push(Ht("object"==typeof n?n:void 0)),s})(l);return me(o,i,c(..."function"==typeof a?a(u):u()))}({reducer:{frontend:Wt.reducer,backend:Bn.reducer},devTools:!0}),mn=i`
62
8
 
63
9
  .wrapper {
64
10
  display: grid;
@@ -82,7 +28,7 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
82
28
  display: grid;
83
29
  grid-gap: 20px;
84
30
  grid-area: pages;
85
- padding: 8px 0 20px; /* Required - room under the heading */
31
+ padding: 8px 0 0; /* Required - room under the heading */
86
32
 
87
33
  box-sizing: border-box;
88
34
  -webkit-box-sizing: border-box;
@@ -91,11 +37,12 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
91
37
 
92
38
  backface-visibility: hidden;
93
39
 
94
- /* Optional - --pwa_slide_time: 1.4s. Optional - --pwa_slide_ease: ease-in-out. */
95
- /* Required - form swap is 1.4s * 1.429, about 2s. Hide after the slide. */
96
- transition:
97
- transform calc(var(--pwa_slide_time, 1.4s) * 1.429) var(--pwa_slide_ease, ease-in-out),
98
- visibility 0s linear calc(var(--pwa_slide_time, 1.4s) * 1.429);
40
+ transition-property: transform;
41
+ -webkit-transition-property: transform;
42
+ transition-timing-function: ease-in-out;
43
+ -webkit-transition-timing-function: ease-in-out;
44
+ transition-duration: 2s;
45
+ -webkit-transition-duration: 2s;
99
46
 
100
47
  position:relative;
101
48
  z-index: 1;
@@ -113,31 +60,141 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
113
60
  position: relative; /* Required - this form sets the panel height */
114
61
  align-self: start; /* Required - keep the Update button under its field */
115
62
  z-index: 3;
116
- transition:
117
- transform calc(var(--pwa_slide_time, 1.4s) * 1.429) var(--pwa_slide_ease, ease-in-out),
118
- visibility 0s linear 0s;
119
63
  }
120
64
 
121
65
  .closed {
122
- /* Required - same cell, full width, slid up. Absolute so it does not stretch the row. */
123
- transform: translate3d(0, -100%, 0);
124
- visibility: hidden;
66
+ /* Required - max-height slide-out runs with the transform. */
67
+ transform: translate3d(0, -102%, 0);
68
+ animation: slide-out 2s ease-out forwards;
69
+ visibility: visible;
125
70
  pointer-events: none;
126
- position: absolute;
127
- top: 0;
128
- left: 0;
71
+ position: relative;
72
+ overflow: hidden;
129
73
  width: 100%;
130
- height: auto; /* Required - a stretched row pulls Update to the top */
74
+ height: auto;
131
75
  align-self: start;
132
76
  justify-self: start;
133
77
  z-index: 2;
134
78
  }
135
79
 
136
80
  @media (prefers-reduced-motion: reduce) {
137
- :host { --pwa_slide_time: 0s; }
81
+ :host,
82
+ .content,
83
+ .opened,
84
+ .closed {
85
+ transition-duration: 0s;
86
+ animation-duration: 0s;
87
+ }
138
88
  }
139
89
 
90
+ `,wn=i`
91
+
92
+ :host {
93
+ max-height: 0px;
94
+ transition: max-height 1.4s ease-in-out;
95
+ }
96
+
97
+ :host([drawer]) {
98
+ max-height: 100%;
99
+ transition: max-height 1.4s ease-in-out;
100
+ }
101
+
102
+ .in {
103
+ max-height: 0px;
104
+ visibility: hidden;
105
+ transition: max-height 1.4s ease-in-out, visibility 0s linear 1.4s;
106
+ }
107
+
108
+ .spec-in {
109
+ transform: translate3d(0, -100%, 0);
110
+ transition: transform 1.5s;
111
+ z-index: -1;
112
+ animation-timing-function: linear;
113
+ }
114
+
115
+ .out {
116
+ max-height: 100%;
117
+ visibility: visible;
118
+ transition: max-height 1.4s ease-in-out, visibility 0s;
119
+ }
120
+
121
+ .spec-out {
122
+ transform: translate3d(0, 0, 0);
123
+ transition: transform 2.2s;
124
+ z-index: -1;
125
+ animation-timing-function: linear;
126
+ }
127
+
128
+ @media (prefers-reduced-motion: reduce) {
129
+ :host,
130
+ .in,
131
+ .out,
132
+ .spec-in,
133
+ .spec-out {
134
+ transition-duration: 0s;
135
+ animation-duration: 0s;
136
+ }
137
+ }
138
+
139
+ `,En=[i`
140
+
141
+ :host {
142
+ transition: max-height 1.4s ease-in-out;
143
+ }
144
+
145
+ :host([animation]) {
146
+ max-height: 100%;
147
+ transition: max-height 1.4s ease-in-out;
148
+ }
149
+
150
+ `,i`
151
+
152
+ :host {
153
+ overflow: hidden;
154
+ display: grid;
155
+ }
156
+
157
+ .spec[on] {
158
+ display: grid;
159
+ }
160
+
161
+ .spec {
162
+ display: none;
163
+ }
164
+
165
+ .service {
166
+ display: grid;
167
+ overflow: hidden;
168
+ color: var(--pwa_drawer_text_color, #1c2430);
169
+ background-color: var(--section_background_color, #fffdf8);
170
+ }
171
+
172
+ h3 {
173
+ margin: 0;
174
+ padding: 18px 16px 14px;
175
+ font-size: 1.15rem;
176
+ font-weight: 600;
177
+ border-bottom: 1px solid var(--pwa_line_color, #e3daca);
178
+ }
179
+
180
+ `],yn=i`
181
+
182
+ a {
183
+ font-size: 0.95rem;
184
+ color: var(--pwa_label_text_color, #1c2430);
185
+ font-weight: 600;
186
+ text-decoration: none;
187
+ }
188
+
140
189
  `,Dn=i`
190
+
191
+ .setLog > p {
192
+ margin: 12px;
193
+ box-sizing: border-box;
194
+ text-align: center;
195
+ }
196
+
197
+ `,_n=i`
141
198
 
142
199
  ul {
143
200
  list-style-type: none;
@@ -156,7 +213,7 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
156
213
  margin: 0 16px;
157
214
  }
158
215
 
159
- `,_n=function(e){const t=[];let n=0;for(let s=0;s<e.length;s++){let r=e.charCodeAt(s);r<128?t[n++]=r:r<2048?(t[n++]=r>>6|192,t[n++]=63&r|128):55296==(64512&r)&&s+1<e.length&&56320==(64512&e.charCodeAt(s+1))?(r=65536+((1023&r)<<10)+(1023&e.charCodeAt(++s)),t[n++]=r>>18|240,t[n++]=r>>12&63|128,t[n++]=r>>6&63|128,t[n++]=63&r|128):(t[n++]=r>>12|224,t[n++]=r>>6&63|128,t[n++]=63&r|128)}return t},bn={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:"function"==typeof atob,encodeByteArray(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,s=[];for(let t=0;t<e.length;t+=3){const r=e[t],i=t+1<e.length,a=i?e[t+1]:0,o=t+2<e.length,B=o?e[t+2]:0,c=r>>2,l=(3&r)<<4|a>>4;let u=(15&a)<<2|B>>6,h=63&B;o||(h=64,i||(u=64)),s.push(n[c],n[l],n[u],n[h])}return s.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(_n(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):function(e){const t=[];let n=0,s=0;for(;n<e.length;){const r=e[n++];if(r<128)t[s++]=String.fromCharCode(r);else if(r>191&&r<224){const i=e[n++];t[s++]=String.fromCharCode((31&r)<<6|63&i)}else if(r>239&&r<365){const i=((7&r)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536;t[s++]=String.fromCharCode(55296+(i>>10)),t[s++]=String.fromCharCode(56320+(1023&i))}else{const i=e[n++],a=e[n++];t[s++]=String.fromCharCode((15&r)<<12|(63&i)<<6|63&a)}}return t.join("")}(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();const n=t?this.charToByteMapWebSafe_:this.charToByteMap_,s=[];for(let t=0;t<e.length;){const r=n[e.charAt(t++)],i=t<e.length?n[e.charAt(t)]:0;++t;const a=t<e.length?n[e.charAt(t)]:64;++t;const o=t<e.length?n[e.charAt(t)]:64;if(++t,null==r||null==i||null==a||null==o)throw new vn;const B=r<<2|i>>4;if(s.push(B),64!==a){const e=i<<4&240|a>>2;if(s.push(e),64!==o){const e=a<<6&192|o;s.push(e)}}}return s},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};class vn extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const In=function(e){return function(e){const t=_n(e);return bn.encodeByteArray(t,!0)}(e).replace(/\./g,"")},Tn=function(e){try{return bn.decodeString(e,!0)}catch(e){}return null};const On=()=>function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("Unable to locate global object.")}().__FIREBASE_DEFAULTS__,An=()=>{try{return On()||(()=>{if("undefined"==typeof process||void 0===process.env)return;const e=process.env.__FIREBASE_DEFAULTS__;return e?JSON.parse(e):void 0})()||(()=>{if("undefined"==typeof document)return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch(e){return}const t=e&&Tn(e[1]);return t&&JSON.parse(t)})()}catch(e){return}},Sn=e=>An()?.emulatorHosts?.[e],Nn=e=>{const t=Sn(e);if(!t)return;const n=t.lastIndexOf(":");if(n<=0||n+1===t.length)throw new Error(`Invalid host ${t} with no separate hostname and port!`);const s=parseInt(t.substring(n+1),10);return"["===t[0]?[t.substring(1,n-1),s]:[t.substring(0,n),s]},Rn=()=>An()?.config,kn=e=>An()?.[`_${e}`];class Ln{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(e){return(t,n)=>{t?this.reject(t):this.resolve(n),"function"==typeof e&&(this.promise.catch(()=>{}),1===e.length?e(t):e(t,n))}}}function xn(e,t){if(e.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const n=t||"demo-project",s=e.iat||0,r=e.sub||e.user_id;if(!r)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const i={iss:`https://securetoken.google.com/${n}`,aud:n,iat:s,exp:s+3600,auth_time:s,sub:r,user_id:r,firebase:{sign_in_provider:"custom",identities:{}},...e};return[In(JSON.stringify({alg:"none",type:"JWT"})),In(JSON.stringify(i)),""].join(".")}function Fn(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function Pn(){const e="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0;return"object"==typeof e&&void 0!==e.id}function Mn(){return!function(){const e=An()?.forceEnvironment;if("node"===e)return!0;if("browser"===e)return!1;try{return"[object process]"===Object.prototype.toString.call(global.process)}catch(e){return!1}}()&&!!navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function Gn(){try{return"object"==typeof indexedDB}catch(e){return!1}}function Un(){return new Promise((e,t)=>{try{let n=!0;const s="validate-browser-context-for-indexeddb-analytics-module",r=self.indexedDB.open(s);r.onsuccess=()=>{r.result.close(),n||self.indexedDB.deleteDatabase(s),e(!0)},r.onupgradeneeded=()=>{n=!1},r.onerror=()=>{t(r.error?.message||"")}}catch(e){t(e)}})}function Hn(){return!("undefined"==typeof navigator||!navigator.cookieEnabled)}class Vn extends Error{constructor(e,t,n){super(t),this.code=e,this.customData=n,this.name="FirebaseError",Object.setPrototypeOf(this,Vn.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,jn.prototype.create)}}class jn{constructor(e,t,n){this.service=e,this.serviceName=t,this.errors=n}create(e,...t){const n=t[0]||{},s=`${this.service}/${e}`,r=this.errors[e],i=r?function(e,t){try{let n=0,s="";for(;n<e.length;){const r=e.indexOf("{$",n);if(-1===r){s+=e.substring(n);break}const i=e.indexOf("}",r+2);if(-1===i){s+=e.substring(n);break}const a=e.substring(r+2,i),o=t[a];s+=e.substring(n,r)+(null!=o?String(o):`<${a}?>`),n=i+1}return s}catch(t){return e}}(r,n):"Error",a=`${this.serviceName}: ${i} (${s}).`;return new Vn(s,a,n)}}function $n(e,t){if(e===t)return!0;const n=Object.keys(e),s=Object.keys(t);for(const r of n){if(!s.includes(r))return!1;const n=e[r],i=t[r];if(Jn(n)&&Jn(i)){if(!$n(n,i))return!1}else if(n!==i)return!1}for(const e of s)if(!n.includes(e))return!1;return!0}function Jn(e){return null!==e&&"object"==typeof e}function qn(e){const t=[];for(const[n,s]of Object.entries(e))Array.isArray(s)?s.forEach(e=>{t.push(encodeURIComponent(n)+"="+encodeURIComponent(e))}):t.push(encodeURIComponent(n)+"="+encodeURIComponent(s));return t.length?"&"+t.join("&"):""}function zn(e){const t={};return e.replace(/^\?/,"").split("&").forEach(e=>{if(e){const[n,s]=e.split("=");t[decodeURIComponent(n)]=decodeURIComponent(s)}}),t}function Kn(e){const t=e.indexOf("?");if(!t)return"";const n=e.indexOf("#",t);return e.substring(t,n>0?n:void 0)}class Qn{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(()=>{e(this)}).catch(e=>{this.error(e)})}next(e){this.forEachObserver(t=>{t.next(e)})}error(e){this.forEachObserver(t=>{t.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,t,n){let s;if(void 0===e&&void 0===t&&void 0===n)throw new Error("Missing Observer.");s=function(e,t){if("object"!=typeof e||null===e)return!1;for(const n of t)if(n in e&&"function"==typeof e[n])return!0;return!1}(e,["next","error","complete"])?e:{next:e,error:t,complete:n},void 0===s.next&&(s.next=Wn),void 0===s.error&&(s.error=Wn),void 0===s.complete&&(s.complete=Wn);const r=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?s.error(this.finalError):s.complete()}catch(e){}}),this.observers.push(s),r}unsubscribeOne(e){void 0!==this.observers&&void 0!==this.observers[e]&&(delete this.observers[e],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t<this.observers.length;t++)this.sendOne(t,e)}sendOne(e,t){this.task.then(()=>{if(void 0!==this.observers&&void 0!==this.observers[e])try{t(this.observers[e])}catch(e){"undefined"!=typeof console&&console.error}})}close(e){this.finalized||(this.finalized=!0,void 0!==e&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function Wn(){}function Yn(e,t=1e3,n=2){const s=t*Math.pow(n,e),r=Math.round(.5*s*(Math.random()-.5)*2);return Math.min(144e5,s+r)}function Xn(e){return e&&e._delegate?e._delegate:e}function Zn(e){try{return(e.startsWith("http://")||e.startsWith("https://")?new URL(e).hostname:e).endsWith(".cloudworkstations.dev")}catch{return!1}}async function es(e){return(await fetch(e,{credentials:"include"})).ok}class ts{constructor(e,t,n){this.name=e,this.instanceFactory=t,this.type=n,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}}const ns="[DEFAULT]";class ss{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){const e=new Ln;if(this.instancesDeferred.set(t,e),this.isInitialized(t)||this.shouldAutoInitialize())try{const n=this.getOrInitializeService({instanceIdentifier:t});n&&e.resolve(n)}catch(e){}}return this.instancesDeferred.get(t).promise}getImmediate(e){const t=this.normalizeInstanceIdentifier(e?.identifier),n=e?.optional??!1;if(!this.isInitialized(t)&&!this.shouldAutoInitialize()){if(n)return null;throw Error(`Service ${this.name} is not available`)}try{return this.getOrInitializeService({instanceIdentifier:t})}catch(e){if(n)return null;throw e}}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(function(e){return"EAGER"===e.instantiationMode}(e))try{this.getOrInitializeService({instanceIdentifier:ns})}catch(e){}for(const[e,t]of this.instancesDeferred.entries()){const n=this.normalizeInstanceIdentifier(e);try{const e=this.getOrInitializeService({instanceIdentifier:n});t.resolve(e)}catch(e){}}}}clearInstance(e=ns){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(e=>"INTERNAL"in e).map(e=>e.INTERNAL.delete()),...e.filter(e=>"_delete"in e).map(e=>e._delete())])}isComponentSet(){return null!=this.component}isInitialized(e=ns){return this.instances.has(e)}getOptions(e=ns){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:t={}}=e,n=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(n))throw Error(`${this.name}(${n}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const s=this.getOrInitializeService({instanceIdentifier:n,options:t});for(const[e,t]of this.instancesDeferred.entries()){n===this.normalizeInstanceIdentifier(e)&&t.resolve(s)}return s}onInit(e,t){const n=this.normalizeInstanceIdentifier(t),s=this.onInitCallbacks.get(n)??new Set;s.add(e),this.onInitCallbacks.set(n,s);const r=this.instances.get(n);return r&&e(r,n),()=>{s.delete(e)}}invokeOnInitCallbacks(e,t){const n=this.onInitCallbacks.get(t);if(n)for(const s of n)try{s(e,t)}catch{}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let n=this.instances.get(e);if(!n&&this.component&&(n=this.component.instanceFactory(this.container,{instanceIdentifier:(s=e,s===ns?void 0:s),options:t}),this.instances.set(e,n),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(n,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,n)}catch{}var s;return n||null}normalizeInstanceIdentifier(e=ns){return this.component?this.component.multipleInstances?e:ns:e}shouldAutoInitialize(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode}}class rs{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const t=this.getProvider(e.name);if(t.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const t=new ss(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}var is;!function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"}(is||(is={}));const as={debug:is.DEBUG,verbose:is.VERBOSE,info:is.INFO,warn:is.WARN,error:is.ERROR,silent:is.SILENT},os=is.INFO,Bs={[is.DEBUG]:"log",[is.VERBOSE]:"log",[is.INFO]:"info",[is.WARN]:"warn",[is.ERROR]:"error"},cs=(e,t,...n)=>{if(t<e.logLevel)return;(new Date).toISOString();if(!Bs[t])throw new Error(`Attempted to log a message with an invalid logType (value: ${t})`)};class ls{constructor(e){this.name=e,this._logLevel=os,this._logHandler=cs,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in is))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel="string"==typeof e?as[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if("function"!=typeof e)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,is.DEBUG,...e),this._logHandler(this,is.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,is.VERBOSE,...e),this._logHandler(this,is.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,is.INFO,...e),this._logHandler(this,is.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,is.WARN,...e),this._logHandler(this,is.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,is.ERROR,...e),this._logHandler(this,is.ERROR,...e)}}let us,hs;const ps=new WeakMap,ds=new WeakMap,fs=new WeakMap,Cs=new WeakMap,gs=new WeakMap;let ms={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return ds.get(e);if("objectStoreNames"===t)return e.objectStoreNames||fs.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return ys(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function ws(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(hs||(hs=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(Ds(this),t),ys(ps.get(this))}:function(...t){return ys(e.apply(Ds(this),t))}:function(t,...n){const s=e.call(Ds(this),t,...n);return fs.set(s,t.sort?t.sort():[t]),ys(s)}}function Es(e){return"function"==typeof e?ws(e):(e instanceof IDBTransaction&&function(e){if(ds.has(e))return;const t=new Promise((t,n)=>{const s=()=>{e.removeEventListener("complete",r),e.removeEventListener("error",i),e.removeEventListener("abort",i)},r=()=>{t(),s()},i=()=>{n(e.error||new DOMException("AbortError","AbortError")),s()};e.addEventListener("complete",r),e.addEventListener("error",i),e.addEventListener("abort",i)});ds.set(e,t)}(e),t=e,(us||(us=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some(e=>t instanceof e)?new Proxy(e,ms):e);var t}function ys(e){if(e instanceof IDBRequest)return function(e){const t=new Promise((t,n)=>{const s=()=>{e.removeEventListener("success",r),e.removeEventListener("error",i)},r=()=>{t(ys(e.result)),s()},i=()=>{n(e.error),s()};e.addEventListener("success",r),e.addEventListener("error",i)});return t.then(t=>{t instanceof IDBCursor&&ps.set(t,e)}).catch(()=>{}),gs.set(t,e),t}(e);if(Cs.has(e))return Cs.get(e);const t=Es(e);return t!==e&&(Cs.set(e,t),gs.set(t,e)),t}const Ds=e=>gs.get(e);function _s(e,t,{blocked:n,upgrade:s,blocking:r,terminated:i}={}){const a=indexedDB.open(e,t),o=ys(a);return s&&a.addEventListener("upgradeneeded",e=>{s(ys(a.result),e.oldVersion,e.newVersion,ys(a.transaction),e)}),n&&a.addEventListener("blocked",e=>n(e.oldVersion,e.newVersion,e)),o.then(e=>{i&&e.addEventListener("close",()=>i()),r&&e.addEventListener("versionchange",e=>r(e.oldVersion,e.newVersion,e))}).catch(()=>{}),o}const bs=["get","getKey","getAll","getAllKeys","count"],vs=["put","add","delete","clear"],Is=new Map;function Ts(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(Is.get(t))return Is.get(t);const n=t.replace(/FromIndex$/,""),s=t!==n,r=vs.includes(n);if(!(n in(s?IDBIndex:IDBObjectStore).prototype)||!r&&!bs.includes(n))return;const i=async function(e,...t){const i=this.transaction(e,r?"readwrite":"readonly");let a=i.store;return s&&(a=a.index(t.shift())),(await Promise.all([a[n](...t),r&&i.done]))[0]};return Is.set(t,i),i}ms=(e=>({...e,get:(t,n,s)=>Ts(t,n)||e.get(t,n,s),has:(t,n)=>!!Ts(t,n)||e.has(t,n)}))(ms);class Os{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(e=>{if(function(e){const t=e.getComponent();return"VERSION"===t?.type}(e)){const t=e.getImmediate();return`${t.library}/${t.version}`}return null}).filter(e=>e).join(" ")}}const As="@firebase/app",Ss="0.16.2",Ns=new ls("@firebase/app"),Rs="@firebase/app-compat",ks="@firebase/analytics-compat",Ls="@firebase/analytics",xs="@firebase/app-check-compat",Fs="@firebase/app-check",Ps="@firebase/auth",Ms="@firebase/auth-compat",Gs="@firebase/database",Us="@firebase/data-connect",Hs="@firebase/database-compat",Vs="@firebase/functions",js="@firebase/functions-compat",$s="@firebase/installations",Js="@firebase/installations-compat",qs="@firebase/messaging",zs="@firebase/messaging-compat",Ks="@firebase/performance",Qs="@firebase/performance-compat",Ws="@firebase/remote-config",Ys="@firebase/remote-config-compat",Xs="@firebase/storage",Zs="@firebase/storage-compat",er="@firebase/firestore",tr="@firebase/ai",nr="@firebase/firestore-compat",sr="firebase",rr="[DEFAULT]",ir={[As]:"fire-core",[Rs]:"fire-core-compat",[Ls]:"fire-analytics",[ks]:"fire-analytics-compat",[Fs]:"fire-app-check",[xs]:"fire-app-check-compat",[Ps]:"fire-auth",[Ms]:"fire-auth-compat",[Gs]:"fire-rtdb",[Us]:"fire-data-connect",[Hs]:"fire-rtdb-compat",[Vs]:"fire-fn",[js]:"fire-fn-compat",[$s]:"fire-iid",[Js]:"fire-iid-compat",[qs]:"fire-fcm",[zs]:"fire-fcm-compat",[Ks]:"fire-perf",[Qs]:"fire-perf-compat",[Ws]:"fire-rc",[Ys]:"fire-rc-compat",[Xs]:"fire-gcs",[Zs]:"fire-gcs-compat",[er]:"fire-fst",[nr]:"fire-fst-compat",[tr]:"fire-vertex","fire-js":"fire-js",[sr]:"fire-js-all"},ar=new Map,or=new Map,Br=new Map;function cr(e,t){try{e.container.addComponent(t)}catch(n){Ns.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,n)}}function lr(e){const t=e.name;if(Br.has(t))return Ns.debug(`There were multiple attempts to register component ${t}.`),!1;Br.set(t,e);for(const t of ar.values())cr(t,e);for(const t of or.values())cr(t,e);return!0}function ur(e,t){const n=e.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),e.container.getProvider(t)}function hr(e){return null!=e&&void 0!==e.settings}const pr=new jn("app","Firebase",{"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 {$mismatchedParam}. Existing: '{$oldValue}'. New: '{$newValue}'.","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."});class dr{constructor(e,t,n){this._isDeleted=!1,this._options={...e},this._config={...t},this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=n,this.container.addComponent(new ts("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 pr.create("app-deleted",{appName:this._name})}}const fr="12.19.0";function Cr(e,t={}){let n=e;if("object"!=typeof t){t={name:t}}const s={name:rr,automaticDataCollectionEnabled:!0,...t},r=s.name;if("string"!=typeof r||!r)throw pr.create("bad-app-name",{appName:String(r)});if(n||(n=Rn()),!n)throw pr.create("no-options");const i=ar.get(r);if(i){if($n(n,i.options)){if($n(s,i.config))return i;throw pr.create("duplicate-app",{appName:r,mismatchedParam:"config",oldValue:JSON.stringify(i.config),newValue:JSON.stringify(s)})}throw pr.create("duplicate-app",{appName:r,mismatchedParam:"options",oldValue:JSON.stringify(i.options),newValue:JSON.stringify(n)})}const a=new rs(r);for(const e of Br.values())a.addComponent(e);const o=new dr(n,s,a);return ar.set(r,o),o}function gr(e=rr){const t=ar.get(e);if(!t&&e===rr&&Rn())return Cr();if(!t)throw pr.create("no-app",{appName:e});return t}function mr(e,t,n){let s=ir[e]??e;n&&(s+=`-${n}`);const r=s.match(/\s|\//),i=t.match(/\s|\//);if(r||i){const e=[`Unable to register library "${s}" with version "${t}":`];return r&&e.push(`library name "${s}" contains illegal characters (whitespace or "/")`),r&&i&&e.push("and"),i&&e.push(`version name "${t}" contains illegal characters (whitespace or "/")`),void Ns.warn(e.join(" "))}lr(new ts(`${s}-version`,()=>({library:s,version:t}),"VERSION"))}const wr="firebase-heartbeat-store";let Er=null;function yr(){return Er||(Er=_s("firebase-heartbeat-database",1,{upgrade:(e,t)=>{if(0===t)try{e.createObjectStore(wr)}catch(e){}}}).catch(e=>{throw pr.create("idb-open",{originalErrorMessage:e.message})})),Er}async function Dr(e,t){try{const n=(await yr()).transaction(wr,"readwrite"),s=n.objectStore(wr);await s.put(t,_r(e)),await n.done}catch(e){if(e instanceof Vn)Ns.warn(e.message);else{const t=pr.create("idb-set",{originalErrorMessage:e?.message});Ns.warn(t.message)}}}function _r(e){return`${e.name}!${e.options.appId}`}class br{constructor(e){this.container=e,this._heartbeatsCache=null;const t=this.container.getProvider("app").getImmediate();this._storage=new Ir(t),this._heartbeatsCachePromise=this._storage.read().then(e=>(this._heartbeatsCache=e,e))}async triggerHeartbeat(){try{const e=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),t=vr();if(null==this._heartbeatsCache?.heartbeats&&(this._heartbeatsCache=await this._heartbeatsCachePromise,null==this._heartbeatsCache?.heartbeats))return;if(this._heartbeatsCache.lastSentHeartbeatDate===t||this._heartbeatsCache.heartbeats.some(e=>e.date===t))return;if(this._heartbeatsCache.heartbeats.push({date:t,agent:e}),this._heartbeatsCache.heartbeats.length>30){const e=function(e){if(0===e.length)return-1;let t=0,n=e[0].date;for(let s=1;s<e.length;s++)e[s].date<n&&(n=e[s].date,t=s);return t}(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(e,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(e){Ns.warn(e)}}async getHeartbeatsHeader(){try{if(null===this._heartbeatsCache&&await this._heartbeatsCachePromise,null==this._heartbeatsCache?.heartbeats||0===this._heartbeatsCache.heartbeats.length)return"";const e=vr(),{heartbeatsToSend:t,unsentEntries:n}=function(e,t=1024){const n=[];let s=e.slice();for(const r of e){const e=n.find(e=>e.agent===r.agent);if(e){if(e.dates.push(r.date),Tr(n)>t){e.dates.pop();break}}else if(n.push({agent:r.agent,dates:[r.date]}),Tr(n)>t){n.pop();break}s=s.slice(1)}return{heartbeatsToSend:n,unsentEntries:s}}(this._heartbeatsCache.heartbeats),s=In(JSON.stringify({version:2,heartbeats:t}));return this._heartbeatsCache.lastSentHeartbeatDate=e,n.length>0?(this._heartbeatsCache.heartbeats=n,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),s}catch(e){return Ns.warn(e),""}}}function vr(){return(new Date).toISOString().substring(0,10)}class Ir{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return!!Gn()&&Un().then(()=>!0).catch(()=>!1)}async read(){if(await this._canUseIndexedDBPromise){const e=await async function(e){try{const t=(await yr()).transaction(wr),n=await t.objectStore(wr).get(_r(e));return await t.done,n}catch(e){if(e instanceof Vn)Ns.warn(e.message);else{const t=pr.create("idb-get",{originalErrorMessage:e?.message});Ns.warn(t.message)}}}(this.app);return e?.heartbeats?e:{heartbeats:[]}}return{heartbeats:[]}}async overwrite(e){if(await this._canUseIndexedDBPromise){const t=await this.read();return Dr(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??t.lastSentHeartbeatDate,heartbeats:e.heartbeats})}}async add(e){if(await this._canUseIndexedDBPromise){const t=await this.read();return Dr(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??t.lastSentHeartbeatDate,heartbeats:[...t.heartbeats,...e.heartbeats]})}}}function Tr(e){return In(JSON.stringify({version:2,heartbeats:e})).length}var Or;function Ar(){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."}}Or="",lr(new ts("platform-logger",e=>new Os(e),"PRIVATE")),lr(new ts("heartbeat",e=>new br(e),"PRIVATE")),mr(As,Ss,Or),mr(As,Ss,"esm2020"),mr("fire-js","");const Sr=Ar,Nr=new jn("auth","Firebase",{"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."}),Rr=new ls("@firebase/auth");function kr(e,...t){Rr.logLevel<=is.WARN&&Rr.warn(`Auth (${fr}): ${e}`,...t)}function Lr(e,...t){Rr.logLevel<=is.ERROR&&Rr.error(`Auth (${fr}): ${e}`,...t)}function xr(e,...t){throw Gr(e,...t)}function Fr(e,...t){return Gr(e,...t)}function Pr(e,t,n){const s={...Sr(),[t]:n};return new jn("auth","Firebase",s).create(t,{appName:e.name})}function Mr(e){return Pr(e,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function Gr(e,...t){if("string"!=typeof e){const n=t[0],s=[...t.slice(1)];return s[0]&&(s[0].appName=e.name),e._errorFactory.create(n,...s)}return Nr.create(e,...t)}function Ur(e,t,...n){if(!e)throw Gr(t,...n)}function Hr(e){const t="INTERNAL ASSERTION FAILED: "+e;throw Lr(t),new Error(t)}function Vr(e,t){e||Hr(t)}function jr(){return"undefined"!=typeof self&&self.location?.href||""}function $r(){return"undefined"!=typeof self&&self.location?.protocol||null}function Jr(){return"undefined"==typeof navigator||!navigator||!("onLine"in navigator)||"boolean"!=typeof navigator.onLine||"http:"!==$r()&&"https:"!==$r()&&!Pn()&&!("connection"in navigator)||navigator.onLine}class qr{constructor(e,t){this.shortDelay=e,this.longDelay=t,Vr(t>e,"Short delay should be less than long delay!"),this.isMobile="undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(Fn())||"object"==typeof navigator&&"ReactNative"===navigator.product}get(){return Jr()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}function zr(e,t){Vr(e.emulator,"Emulator should always be set here");const{url:n}=e.emulator;return t?`${n}${t.startsWith("/")?t.slice(1):t}`:n}class Kr{static initialize(e,t,n){this.fetchImpl=e,t&&(this.headersImpl=t),n&&(this.responseImpl=n)}static fetch(){return this.fetchImpl?this.fetchImpl:"undefined"!=typeof self&&"fetch"in self?self.fetch:"undefined"!=typeof globalThis&&globalThis.fetch?globalThis.fetch:"undefined"!=typeof fetch?fetch:void Hr("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){return this.headersImpl?this.headersImpl:"undefined"!=typeof self&&"Headers"in self?self.Headers:"undefined"!=typeof globalThis&&globalThis.Headers?globalThis.Headers:"undefined"!=typeof Headers?Headers:void Hr("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){return this.responseImpl?this.responseImpl:"undefined"!=typeof self&&"Response"in self?self.Response:"undefined"!=typeof globalThis&&globalThis.Response?globalThis.Response:"undefined"!=typeof Response?Response:void Hr("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}const Qr={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"},Wr=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],Yr=new qr(3e4,6e4);function Xr(e,t){return e.tenantId&&!t.tenantId?{...t,tenantId:e.tenantId}:t}async function Zr(e,t,n,s,r={}){return ei(e,r,async()=>{let r={},i={};s&&("GET"===t?i=s:r={body:JSON.stringify(s)});const a=qn({...i,key:e.config.apiKey}).slice(1),o=await e._getAdditionalHeaders();o["Content-Type"]="application/json",e.languageCode&&(o["X-Firebase-Locale"]=e.languageCode);const B={method:t,headers:o,...r};return"undefined"!=typeof navigator&&"Cloudflare-Workers"===navigator.userAgent||(B.referrerPolicy="strict-origin-when-cross-origin"),e.emulatorConfig&&Zn(e.emulatorConfig.host)&&(B.credentials="include"),Kr.fetch()(await ni(e,e.config.apiHost,n,a),B)})}async function ei(e,t,n){e._canInitEmulator=!1;const s={...Qr,...t};try{const t=new ri(e),r=await Promise.race([n(),t.promise]);t.clearNetworkTimeout();const i=await r.json();if("needConfirmation"in i)throw ii(e,"account-exists-with-different-credential",i);if(r.ok&&!("errorMessage"in i))return i;{const t=r.ok?i.errorMessage:i.error.message,[n,a]=t.split(" : ");if("FEDERATED_USER_ID_ALREADY_LINKED"===n)throw ii(e,"credential-already-in-use",i);if("EMAIL_EXISTS"===n)throw ii(e,"email-already-in-use",i);if("USER_DISABLED"===n)throw ii(e,"user-disabled",i);const o=s[n]||n.toLowerCase().replace(/[_\s]+/g,"-");if(a)throw Pr(e,o,a);xr(e,o)}}catch(t){if(t instanceof Vn)throw t;xr(e,"network-request-failed",{message:String(t)})}}async function ti(e,t,n,s,r={}){const i=await Zr(e,t,n,s,r);return"mfaPendingCredential"in i&&xr(e,"multi-factor-auth-required",{_serverResponse:i}),i}async function ni(e,t,n,s){const r=`${t}${n}?${s}`,i=e,a=i.config.emulator?zr(e.config,r):`${e.config.apiScheme}://${r}`;if(Wr.includes(n)&&(await i._persistenceManagerAvailable,"COOKIE"===i._getPersistenceType())){return i._getPersistence()._getFinalTarget(a).toString()}return a}function si(e){switch(e){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}class ri{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((e,t)=>{this.timer=setTimeout(()=>t(Fr(this.auth,"network-request-failed")),Yr.get())})}}function ii(e,t,n){const s={appName:e.name};n.email&&(s.email=n.email),n.phoneNumber&&(s.phoneNumber=n.phoneNumber);const r=Fr(e,t,s);return r.customData._tokenResponse=n,r}function ai(e){return void 0!==e&&void 0!==e.enterprise}class oi{constructor(e){if(this.siteKey="",this.recaptchaEnforcementState=[],void 0===e.recaptchaKey)throw new Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.recaptchaEnforcementState=e.recaptchaEnforcementState}getProviderEnforcementState(e){if(!this.recaptchaEnforcementState||0===this.recaptchaEnforcementState.length)return null;for(const t of this.recaptchaEnforcementState)if(t.provider&&t.provider===e)return si(t.enforcementState);return null}isProviderEnabled(e){return"ENFORCE"===this.getProviderEnforcementState(e)||"AUDIT"===this.getProviderEnforcementState(e)}isAnyProviderEnabled(){return this.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")||this.isProviderEnabled("PHONE_PROVIDER")}}async function Bi(e,t){return Zr(e,"POST","/v1/accounts:lookup",t)}function ci(e){if(e)try{const t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch(e){}}function li(e){return 1e3*Number(e)}function ui(e){const[t,n,s]=e.split(".");if(void 0===t||void 0===n||void 0===s)return Lr("JWT malformed, contained fewer than 3 sections"),null;try{const e=Tn(n);return e?JSON.parse(e):(Lr("Failed to decode base64 JWT payload"),null)}catch(e){return Lr("Caught error parsing JWT payload as JSON",e?.toString()),null}}function hi(e){const t=ui(e);return Ur(t,"internal-error"),Ur(void 0!==t.exp,"internal-error"),Ur(void 0!==t.iat,"internal-error"),Number(t.exp)-Number(t.iat)}async function pi(e,t,n=!1){if(n)return t;try{return await t}catch(t){throw t instanceof Vn&&function({code:e}){return"auth/user-disabled"===e||"auth/user-token-expired"===e}(t)&&e.auth.currentUser===e&&await e.auth.signOut(),t}}class di{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,null!==this.timerId&&clearTimeout(this.timerId))}getInterval(e){if(e){const e=this.errorBackoff;return this.errorBackoff=Math.min(2*this.errorBackoff,96e4),e}{this.errorBackoff=3e4;const e=(this.user.stsTokenManager.expirationTime??0)-Date.now()-3e5;return Math.max(0,e)}}schedule(e=!1){if(!this.isRunning)return;const t=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},t)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){return void("auth/network-request-failed"===e?.code&&this.schedule(!0))}this.schedule()}}class fi{constructor(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}_initializeTime(){this.lastSignInTime=ci(this.lastLoginAt),this.creationTime=ci(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}async function Ci(e){const t=e.auth,n=await e.getIdToken(),s=await pi(e,Bi(t,{idToken:n}));Ur(s?.users.length,t,"internal-error");const r=s.users[0];e._notifyReloadListener(r);const i=r.providerUserInfo?.length?gi(r.providerUserInfo):[],a=function(e,t){const n=e.filter(e=>!t.some(t=>t.providerId===e.providerId));return[...n,...t]}(e.providerData,i),o=e.isAnonymous,B=!(e.email&&r.passwordHash||a?.length),c=!!o&&B,l={uid:r.localId,displayName:r.displayName||null,photoURL:r.photoUrl||null,email:r.email||null,emailVerified:r.emailVerified||!1,phoneNumber:r.phoneNumber||null,tenantId:r.tenantId||null,providerData:a,metadata:new fi(r.createdAt,r.lastLoginAt),isAnonymous:c};Object.assign(e,l)}function gi(e){return e.map(({providerId:e,...t})=>({providerId:e,uid:t.rawId||"",displayName:t.displayName||null,email:t.email||null,phoneNumber:t.phoneNumber||null,photoURL:t.photoUrl||null}))}class mi{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){Ur(e.idToken,"internal-error"),Ur(void 0!==e.idToken,"internal-error"),Ur(void 0!==e.refreshToken,"internal-error");const t="expiresIn"in e&&void 0!==e.expiresIn?Number(e.expiresIn):hi(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}updateFromIdToken(e){Ur(0!==e.length,"internal-error");const t=hi(e);this.updateTokensAndExpiration(e,null,t)}async getToken(e,t=!1){return t||!this.accessToken||this.isExpired?(Ur(this.refreshToken,e,"user-token-expired"),this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null):this.accessToken}clearRefreshToken(){this.refreshToken=null}async refresh(e,t){const{accessToken:n,refreshToken:s,expiresIn:r}=await async function(e,t){const n=await ei(e,{},async()=>{const n=qn({grant_type:"refresh_token",refresh_token:t}).slice(1),{tokenApiHost:s,apiKey:r}=e.config,i=await ni(e,s,"/v1/token",`key=${r}`),a=await e._getAdditionalHeaders();a["Content-Type"]="application/x-www-form-urlencoded";const o={method:"POST",headers:a,body:n};return e.emulatorConfig&&Zn(e.emulatorConfig.host)&&(o.credentials="include"),Kr.fetch()(i,o)});return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}(e,t);this.updateTokensAndExpiration(n,s,Number(r))}updateTokensAndExpiration(e,t,n){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+1e3*n}static fromJSON(e,t){const{refreshToken:n,accessToken:s,expirationTime:r}=t,i=new mi;return n&&(Ur("string"==typeof n,"internal-error",{appName:e}),i.refreshToken=n),s&&(Ur("string"==typeof s,"internal-error",{appName:e}),i.accessToken=s),r&&(Ur("number"==typeof r,"internal-error",{appName:e}),i.expirationTime=r),i}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 mi,this.toJSON())}_performRefresh(){return Hr("not implemented")}}function wi(e,t){Ur("string"==typeof e||void 0===e,"internal-error",{appName:t})}class Ei{constructor({uid:e,auth:t,stsTokenManager:n,...s}){this.providerId="firebase",this.proactiveRefresh=new di(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=e,this.auth=t,this.stsTokenManager=n,this.accessToken=n.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 fi(s.createdAt||void 0,s.lastLoginAt||void 0)}async getIdToken(e){const t=await pi(this,this.stsTokenManager.getToken(this.auth,e));return Ur(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return async function(e,t=!1){const n=Xn(e),s=await n.getIdToken(t),r=ui(s);Ur(r&&r.exp&&r.auth_time&&r.iat,n.auth,"internal-error");const i="object"==typeof r.firebase?r.firebase:void 0,a=i?.sign_in_provider;return{claims:r,token:s,authTime:ci(li(r.auth_time)),issuedAtTime:ci(li(r.iat)),expirationTime:ci(li(r.exp)),signInProvider:a||null,signInSecondFactor:i?.sign_in_second_factor||null}}(this,e)}reload(){return async function(e){const t=Xn(e);await Ci(t),await t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)}(this)}_assign(e){this!==e&&(Ur(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(e=>({...e})),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const t=new Ei({...this,auth:e,stsTokenManager:this.stsTokenManager._clone()});return t.metadata._copy(this.metadata),t}_onReload(e){Ur(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,t=!1){let n=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),n=!0),t&&await Ci(this),await this.auth._persistUserIfCurrent(this),n&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(hr(this.auth.app))return Promise.reject(Mr(this.auth));const e=await this.getIdToken();return await pi(this,async function(e,t){return Zr(e,"POST","/v1/accounts:delete",t)}(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return{uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>({...e})),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId,...this.metadata.toJSON(),apiKey:this.auth.config.apiKey,appName:this.auth.name}}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,t){const n=t.displayName??void 0,s=t.email??void 0,r=t.phoneNumber??void 0,i=t.photoURL??void 0,a=t.tenantId??void 0,o=t._redirectEventId??void 0,B=t.createdAt??void 0,c=t.lastLoginAt??void 0,{uid:l,emailVerified:u,isAnonymous:h,providerData:p,stsTokenManager:d}=t;Ur(l&&d,e,"internal-error");const f=mi.fromJSON(this.name,d);Ur("string"==typeof l,e,"internal-error"),wi(n,e.name),wi(s,e.name),Ur("boolean"==typeof u,e,"internal-error"),Ur("boolean"==typeof h,e,"internal-error"),wi(r,e.name),wi(i,e.name),wi(a,e.name),wi(o,e.name),wi(B,e.name),wi(c,e.name);const C=new Ei({uid:l,auth:e,email:s,emailVerified:u,displayName:n,isAnonymous:h,photoURL:i,phoneNumber:r,tenantId:a,stsTokenManager:f,createdAt:B,lastLoginAt:c});return p&&Array.isArray(p)&&(C.providerData=p.map(e=>({...e}))),o&&(C._redirectEventId=o),C}static async _fromIdTokenResponse(e,t,n=!1){const s=new mi;s.updateFromServerResponse(t);const r=new Ei({uid:t.localId,auth:e,stsTokenManager:s,isAnonymous:n});return await Ci(r),r}static async _fromGetAccountInfoResponse(e,t,n){const s=t.users[0];Ur(void 0!==s.localId,"internal-error");const r=void 0!==s.providerUserInfo?gi(s.providerUserInfo):[],i=!(s.email&&s.passwordHash||r?.length),a=new mi;a.updateFromIdToken(n);const o=new Ei({uid:s.localId,auth:e,stsTokenManager:a,isAnonymous:i}),B={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:r,metadata:new fi(s.createdAt,s.lastLoginAt),isAnonymous:!(s.email&&s.passwordHash||r?.length)};return Object.assign(o,B),o}}const yi=new Map;function Di(e){Vr(e instanceof Function,"Expected a class definition");let t=yi.get(e);return t?(Vr(t instanceof e,"Instance stored in cache mismatched with class"),t):(t=new e,yi.set(e,t),t)}class _i{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,t){this.storage[e]=t}async _get(e){const t=this.storage[e];return void 0===t?null:t}async _remove(e){delete this.storage[e]}_addListener(e,t){}_removeListener(e,t){}}_i.type="NONE";const bi=_i;function vi(e,t,n){return`firebase:${e}:${t}:${n}`}class Ii{constructor(e,t,n){this.persistence=e,this.auth=t,this.userKey=n;const{config:s,name:r}=this.auth;this.fullUserKey=vi(this.userKey,s.apiKey,r),this.fullPersistenceKey=vi("persistence",s.apiKey,r),this.boundEventHandler=t._onStorageEvent.bind(t);try{this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}catch{}}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){const e=await this.persistence._get(this.fullUserKey);if(!e)return null;if("string"==typeof e){const t=await Bi(this.auth,{idToken:e}).catch(()=>{});return t?Ei._fromGetAccountInfoResponse(this.auth,t,e):null}return Ei._fromJSON(this.auth,e)}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;const t=await this.getCurrentUser();return await this.removeCurrentUser(),this.persistence=e,t?this.setCurrentUser(t):void 0}delete(){try{this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}catch{}}static async create(e,t,n="authUser"){if(!t.length)return new Ii(Di(bi),e,n);const s=(await Promise.all(t.map(async e=>{try{if(await e._isAvailable())return e}catch{return}}))).filter(e=>e);let r=s[0]||Di(bi);const i=vi(n,e.config.apiKey,e.name);let a=null;for(const n of t)try{const t=await n._get(i);if(t){let s;if("string"==typeof t){const n=await Bi(e,{idToken:t}).catch(()=>{});if(!n)break;s=await Ei._fromGetAccountInfoResponse(e,n,t)}else s=Ei._fromJSON(e,t);n!==r&&(a=s),r=n;break}}catch{}const o=s.filter(e=>e._shouldAllowMigration);return r._shouldAllowMigration&&o.length?(r=o[0],a&&await r._set(i,a.toJSON()),await Promise.all(t.map(async e=>{if(e!==r)try{await e._remove(i)}catch{}})),new Ii(r,e,n)):new Ii(r,e,n)}}function Ti(e){const t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";if(Ni(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";if(t.includes("edge/"))return"Edge";if(Oi(t))return"Firefox";if(t.includes("silk/"))return"Silk";if(ki(t))return"Blackberry";if(Li(t))return"Webos";if(Ai(t))return"Safari";if((t.includes("chrome/")||Si(t))&&!t.includes("edge/"))return"Chrome";if(Ri(t))return"Android";{const t=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,n=e.match(t);if(2===n?.length)return n[1]}return"Other"}function Oi(e=Fn()){return/firefox\//i.test(e)}function Ai(e=Fn()){const t=e.toLowerCase();return t.includes("safari/")&&!t.includes("chrome/")&&!t.includes("crios/")&&!t.includes("android")}function Si(e=Fn()){return/crios\//i.test(e)}function Ni(e=Fn()){return/iemobile/i.test(e)}function Ri(e=Fn()){return/android/i.test(e)}function ki(e=Fn()){return/blackberry/i.test(e)}function Li(e=Fn()){return/webos/i.test(e)}function xi(e=Fn()){return/iphone|ipad|ipod/i.test(e)||/macintosh/i.test(e)&&/mobile/i.test(e)}function Fi(){return function(){const e=Fn();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0}()&&10===document.documentMode}function Pi(e=Fn()){return xi(e)||Ri(e)||Li(e)||ki(e)||/windows phone/i.test(e)||Ni(e)}function Mi(e,t=[]){let n;switch(e){case"Browser":n=Ti(Fn());break;case"Worker":n=`${Ti(Fn())}-${e}`;break;default:n=e}const s=t.length?t.join(","):"FirebaseCore-web";return`${n}/JsCore/${fr}/${s}`}class Gi{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,t){const n=t=>new Promise((n,s)=>{try{n(e(t))}catch(e){s(e)}});n.onAbort=t,this.queue.push(n);const s=this.queue.length-1;return()=>{this.queue[s]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;const t=[];try{for(const n of this.queue)await n(e),n.onAbort&&t.push(n.onAbort)}catch(e){t.reverse();for(const e of t)try{e()}catch(e){}throw this.auth._errorFactory.create("login-blocked",{originalMessage:e?.message})}}}class Ui{constructor(e){const t=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=t.minPasswordLength??6,t.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=t.maxPasswordLength),void 0!==t.containsLowercaseCharacter&&(this.customStrengthOptions.containsLowercaseLetter=t.containsLowercaseCharacter),void 0!==t.containsUppercaseCharacter&&(this.customStrengthOptions.containsUppercaseLetter=t.containsUppercaseCharacter),void 0!==t.containsNumericCharacter&&(this.customStrengthOptions.containsNumericCharacter=t.containsNumericCharacter),void 0!==t.containsNonAlphanumericCharacter&&(this.customStrengthOptions.containsNonAlphanumericCharacter=t.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,"ENFORCEMENT_STATE_UNSPECIFIED"===this.enforcementState&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=e.allowedNonAlphanumericCharacters?.join("")??"",this.forceUpgradeOnSignin=e.forceUpgradeOnSignin??!1,this.schemaVersion=e.schemaVersion}validatePassword(e){const t={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,t),this.validatePasswordCharacterOptions(e,t),t.isValid&&(t.isValid=t.meetsMinPasswordLength??!0),t.isValid&&(t.isValid=t.meetsMaxPasswordLength??!0),t.isValid&&(t.isValid=t.containsLowercaseLetter??!0),t.isValid&&(t.isValid=t.containsUppercaseLetter??!0),t.isValid&&(t.isValid=t.containsNumericCharacter??!0),t.isValid&&(t.isValid=t.containsNonAlphanumericCharacter??!0),t}validatePasswordLengthOptions(e,t){const n=this.customStrengthOptions.minPasswordLength,s=this.customStrengthOptions.maxPasswordLength;n&&(t.meetsMinPasswordLength=e.length>=n),s&&(t.meetsMaxPasswordLength=e.length<=s)}validatePasswordCharacterOptions(e,t){let n;this.updatePasswordCharacterOptionsStatuses(t,!1,!1,!1,!1);for(let s=0;s<e.length;s++)n=e.charAt(s),this.updatePasswordCharacterOptionsStatuses(t,n>="a"&&n<="z",n>="A"&&n<="Z",n>="0"&&n<="9",this.allowedNonAlphanumericCharacters.includes(n))}updatePasswordCharacterOptionsStatuses(e,t,n,s,r){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=t)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=n)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=s)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=r))}}class Hi{constructor(e,t,n,s){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=n,this.config=s,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new ji(this),this.idTokenSubscription=new ji(this),this.beforeStateQueue=new Gi(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=Nr,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this._resolvePersistenceManagerAvailable=void 0,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=s.sdkClientVersion,this._persistenceManagerAvailable=new Promise(e=>this._resolvePersistenceManagerAvailable=e)}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=Di(t)),this._initializationPromise=this.queue(async()=>{if(!this._deleted){try{this.persistenceManager=await Ii.create(this,e)}catch(e){kr(`Failed to initialize persistence: ${e}`),this.persistenceManager=await Ii.create(this,[])}finally{this._resolvePersistenceManagerAvailable?.()}if(!this._deleted){if(this._popupRedirectResolver?._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch(e){}try{await this.initializeCurrentUser(t)}catch(e){kr(`Failed to initialize current user: ${e}`),await this.directlySetCurrentUser(null).catch(()=>{})}this.lastNotifiedUid=this.currentUser?.uid||null,this._deleted||(this._isInitialized=!0)}}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const e=await this.assertedPersistence.getCurrentUser();return this.currentUser||e?this.currentUser&&e&&this.currentUser.uid===e.uid?(this._currentUser._assign(e),void await this.currentUser.getIdToken()):void await this._updateCurrentUser(e,!0):void 0}async initializeCurrentUserFromIdToken(e){try{const t=await Bi(this,{idToken:e}),n=await Ei._fromGetAccountInfoResponse(this,t,e);await this.directlySetCurrentUser(n)}catch(e){await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){if(hr(this.app)){const e=this.app.settings.authIdToken;return e?new Promise(t=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(e).then(t,t))}):this.directlySetCurrentUser(null)}const t=await this.assertedPersistence.getCurrentUser();let n=t,s=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const t=this.redirectUser?._redirectEventId,r=n?._redirectEventId,i=await this.tryRedirectSignIn(e);t&&t!==r||!i?.user||(n=i.user,s=!0)}if(!n)return this.directlySetCurrentUser(null);if(!n._redirectEventId){if(s)try{await this.beforeStateQueue.runMiddleware(n)}catch(e){n=t,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(e))}return n?this.reloadAndSetCurrentUserOrClear(n):this.directlySetCurrentUser(null)}return Ur(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===n._redirectEventId?this.directlySetCurrentUser(n):this.reloadAndSetCurrentUserOrClear(n)}async tryRedirectSignIn(e){let t=null;try{t=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch(e){await this._setRedirectUser(null)}return t}async reloadAndSetCurrentUserOrClear(e){try{await Ci(e)}catch(e){if("auth/network-request-failed"!==e?.code)return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=function(){if("undefined"==typeof navigator)return null;const e=navigator;return e.languages&&e.languages[0]||e.language||null}()}async _delete(){this._deleted=!0}async updateCurrentUser(e){if(hr(this.app))return Promise.reject(Mr(this));const t=e?Xn(e):null;return t&&Ur(t.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(t&&t._clone(this))}async _updateCurrentUser(e,t=!1){if(!this._deleted)return e&&Ur(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),t||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return hr(this.app)?Promise.reject(Mr(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return hr(this.app)?Promise.reject(Mr(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(Di(e))})}_getRecaptchaConfig(){return null==this.tenantId?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const t=this._getPasswordPolicyInternal();return t.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):t.validatePassword(e)}_getPasswordPolicyInternal(){return null===this.tenantId?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const e=await async function(e,t={}){return Zr(e,"GET","/v2/passwordPolicy",Xr(e,t))}(this),t=new Ui(e);null===this.tenantId?this._projectPasswordPolicy=t:this._tenantPasswordPolicies[this.tenantId]=t}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(e){this._errorFactory=new jn("auth","Firebase",e())}onAuthStateChanged(e,t,n){return this.registerStateListener(this.authStateSubscription,e,t,n)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,n){return this.registerStateListener(this.idTokenSubscription,e,t,n)}authStateReady(){return new Promise((e,t)=>{if(this.currentUser)e();else{const n=this.onAuthStateChanged(()=>{n(),e()},t)}})}async revokeAccessToken(e){if(this.currentUser){const t={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:await this.currentUser.getIdToken()};null!=this.tenantId&&(t.tenantId=this.tenantId),await async function(e,t){return Zr(e,"POST","/v2/accounts:revokeToken",Xr(e,t))}(this,t)}}toJSON(){return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:this._currentUser?.toJSON()}}async _setRedirectUser(e,t){const n=await this.getOrInitRedirectPersistenceManager(t);return null===e?n.removeCurrentUser():n.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const t=e&&Di(e)||this._popupRedirectResolver;Ur(t,this,"argument-error"),this.redirectPersistenceManager=await Ii.create(this,[Di(t._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){return this._isInitialized&&await this.queue(async()=>{}),this._currentUser?._redirectEventId===e?this._currentUser:this.redirectUser?._redirectEventId===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(e))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const e=this.currentUser?.uid??null;this.lastNotifiedUid!==e&&(this.lastNotifiedUid=e,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,n,s){if(this._deleted)return()=>{};const r="function"==typeof t?t:t.next.bind(t);let i=!1;const a=this._isInitialized?Promise.resolve():this._initializationPromise;if(Ur(a,this,"internal-error"),a.then(()=>{i||r(this.currentUser)}).catch(e=>{if(!i)if("function"!=typeof t&&t.error)t.error(e);else{if(!n)throw e;n(e)}}),"function"==typeof t){const r=e.addObserver(t,n,s);return()=>{i=!0,r()}}{const n=e.addObserver(t);return()=>{i=!0,n()}}}async directlySetCurrentUser(e){if(this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,this.persistenceManager)try{e?await this.persistenceManager.setCurrentUser(e):await this.persistenceManager.removeCurrentUser()}catch(e){const t=Pr(this,"internal-error",`An internal AuthError has occurred: ${e?.message||String(e)}`);throw t.customData={originalError:e},t}}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return Ur(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){e&&!this.frameworks.includes(e)&&(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=Mi(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){const e={"X-Client-Version":this.clientVersion};this.app.options.appId&&(e["X-Firebase-gmpid"]=this.app.options.appId);const t=await(this.heartbeatServiceProvider.getImmediate({optional:!0})?.getHeartbeatsHeader());t&&(e["X-Firebase-Client"]=t);const n=await this._getAppCheckToken();return n&&(e["X-Firebase-AppCheck"]=n),e}async _getAppCheckToken(){if(hr(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const e=await(this.appCheckServiceProvider.getImmediate({optional:!0})?.getToken());return e?.error&&kr(`Error while retrieving App Check token: ${e.error}`),e?.token}}function Vi(e){return Xn(e)}class ji{constructor(e){this.auth=e,this.observer=null,this.addObserver=function(e,t){const n=new Qn(e,t);return n.subscribe.bind(n)}(e=>this.observer=e)}get next(){return Ur(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}let $i={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function Ji(e){return $i.loadJS(e)}class qi{constructor(){this.enterprise=new zi}ready(e){e()}execute(e,t){return Promise.resolve("token")}render(e,t){return""}}class zi{ready(e){e()}execute(e,t){return Promise.resolve("token")}render(e,t){return""}}const Ki="NO_RECAPTCHA",Qi="onFirebaseAuthREInstanceReady";class Wi{constructor(e){this.type="recaptcha-enterprise",this.auth=Vi(e)}async verify(e="verify",t=!1){async function n(e){if(!t){if(null==e.tenantId&&null!=e._agentRecaptchaConfig)return e._agentRecaptchaConfig.siteKey;if(null!=e.tenantId&&void 0!==e._tenantRecaptchaConfigs[e.tenantId])return e._tenantRecaptchaConfigs[e.tenantId].siteKey}return new Promise(async(t,n)=>{(async function(e,t){return Zr(e,"GET","/v2/recaptchaConfig",Xr(e,t))})(e,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(s=>{if(void 0!==s.recaptchaKey){const n=new oi(s);return null==e.tenantId?e._agentRecaptchaConfig=n:e._tenantRecaptchaConfigs[e.tenantId]=n,t(n.siteKey)}n(new Error("recaptcha Enterprise site key undefined"))}).catch(e=>{n(e)})})}function s(t,n,s){const r=window.grecaptcha;ai(r)?r.enterprise.ready(()=>{r.enterprise.execute(t,{action:e}).then(e=>{n(e)}).catch(()=>{n(Ki)})}):s(Error("No reCAPTCHA enterprise script loaded."))}if(this.auth.settings.appVerificationDisabledForTesting){return(new qi).execute("siteKey",{action:"verify"})}return new Promise((e,r)=>{n(this.auth).then(async n=>{if(!t&&ai(window.grecaptcha)&&Wi.scriptInjectionDeferred)await Wi.scriptInjectionDeferred.promise,s(n,e,r);else{if("undefined"==typeof window)return void r(new Error("RecaptchaVerifier is only supported in browser"));let t=$i.recaptchaEnterpriseScript;0!==t.length&&(t+=n+`&onload=${Qi}`),Wi.scriptInjectionDeferred=new Ln,window[Qi]=()=>{Wi.scriptInjectionDeferred?.resolve()},Ji(t).then(()=>Wi.scriptInjectionDeferred?.promise).then(()=>{s(n,e,r)}).catch(e=>{r(e)})}}).catch(e=>{r(e)})})}}async function Yi(e,t,n,s=!1,r=!1){const i=new Wi(e);let a;if(r)a=Ki;else try{a=await i.verify(n)}catch(e){a=await i.verify(n,!0)}const o={...t};if("mfaSmsEnrollment"===n||"mfaSmsSignIn"===n){if("phoneEnrollmentInfo"in o){const e=o.phoneEnrollmentInfo.phoneNumber,t=o.phoneEnrollmentInfo.recaptchaToken;Object.assign(o,{phoneEnrollmentInfo:{phoneNumber:e,recaptchaToken:t,captchaResponse:a,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}else if("phoneSignInInfo"in o){const e=o.phoneSignInInfo.recaptchaToken;Object.assign(o,{phoneSignInInfo:{recaptchaToken:e,captchaResponse:a,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}return o}return s?Object.assign(o,{captchaResp:a}):Object.assign(o,{captchaResponse:a}),Object.assign(o,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(o,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),o}async function Xi(e,t,n,s,r){if(e._getRecaptchaConfig()?.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")){const r=await Yi(e,t,n,"getOobCode"===n);return s(e,r)}return s(e,t).catch(async r=>{if("auth/missing-recaptcha-token"===r.code){const r=await Yi(e,t,n,"getOobCode"===n);return s(e,r)}return Promise.reject(r)})}function Zi(e,t,n){const s=Vi(e);Ur(/^https?:\/\//.test(t),s,"invalid-emulator-scheme");const r=ea(t),{host:i,port:a}=function(e){const t=ea(e),n=/(\/\/)?([^?#/]+)/.exec(e.substr(t.length));if(!n)return{host:"",port:null};const s=n[2].split("@").pop()||"",r=/^(\[[^\]]+\])(:|$)/.exec(s);if(r){const e=r[1];return{host:e,port:ta(s.substr(e.length+1))}}{const[e,t]=s.split(":");return{host:e,port:ta(t)}}}(t),o=null===a?"":`:${a}`,B={url:`${r}//${i}${o}/`},c=Object.freeze({host:i,port:a,protocol:r.replace(":",""),options:Object.freeze({disableWarnings:!1})});if(!s._canInitEmulator)return Ur(s.config.emulator&&s.emulatorConfig,s,"emulator-config-failed"),void Ur($n(B,s.config.emulator)&&$n(c,s.emulatorConfig),s,"emulator-config-failed");s.config.emulator=B,s.emulatorConfig=c,s.settings.appVerificationDisabledForTesting=!0,Zn(i)?es(`${r}//${i}${o}`):function(){function e(){const e=document.createElement("p"),t=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",t.position="fixed",t.width="100%",t.backgroundColor="#ffffff",t.border=".1em solid #000000",t.color="#b50000",t.bottom="0px",t.left="0px",t.margin="0px",t.zIndex="10000",t.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}"undefined"!=typeof console&&console.info;"undefined"!=typeof window&&"undefined"!=typeof document&&("loading"===document.readyState?window.addEventListener("DOMContentLoaded",e):e())}()}function ea(e){const t=e.indexOf(":");return t<0?"":e.substr(0,t+1)}function ta(e){if(!e)return null;const t=Number(e);return isNaN(t)?null:t}Wi.scriptInjectionDeferred=null;class na{constructor(e,t){this.providerId=e,this.signInMethod=t}toJSON(){return Hr("not implemented")}_getIdTokenResponse(e){return Hr("not implemented")}_linkToIdToken(e,t){return Hr("not implemented")}_getReauthenticationResolver(e){return Hr("not implemented")}}async function sa(e,t){return Zr(e,"POST","/v1/accounts:signUp",t)}async function ra(e,t){return ti(e,"POST","/v1/accounts:signInWithPassword",Xr(e,t))}async function ia(e,t){return Zr(e,"POST","/v1/accounts:sendOobCode",Xr(e,t))}async function aa(e,t){return ia(e,t)}class oa extends na{constructor(e,t,n,s=null){super("password",n),this._email=e,this._password=t,this._tenantId=s}static _fromEmailAndPassword(e,t){return new oa(e,t,"password")}static _fromEmailAndCode(e,t,n=null){return new oa(e,t,"emailLink",n)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){const t="string"==typeof e?JSON.parse(e):e;if(t?.email&&t?.password){if("password"===t.signInMethod)return this._fromEmailAndPassword(t.email,t.password);if("emailLink"===t.signInMethod)return this._fromEmailAndCode(t.email,t.password,t.tenantId)}return null}async _getIdTokenResponse(e){switch(this.signInMethod){case"password":return Xi(e,{returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"},"signInWithPassword",ra);case"emailLink":return async function(e,t){return ti(e,"POST","/v1/accounts:signInWithEmailLink",Xr(e,t))}(e,{email:this._email,oobCode:this._password});default:xr(e,"internal-error")}}async _linkToIdToken(e,t){switch(this.signInMethod){case"password":return Xi(e,{idToken:t,returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",sa);case"emailLink":return async function(e,t){return ti(e,"POST","/v1/accounts:signInWithEmailLink",Xr(e,t))}(e,{idToken:t,email:this._email,oobCode:this._password});default:xr(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}async function Ba(e,t){return ti(e,"POST","/v1/accounts:signInWithIdp",Xr(e,t))}class ca extends na{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const t=new ca(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(t.idToken=e.idToken),e.accessToken&&(t.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(t.nonce=e.nonce),e.pendingToken&&(t.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(t.accessToken=e.oauthToken,t.secret=e.oauthTokenSecret):xr("argument-error"),t}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){const t="string"==typeof e?JSON.parse(e):e,{providerId:n,signInMethod:s,...r}=t;if(!n||!s)return null;const i=new ca(n,s);return i.idToken=r.idToken||void 0,i.accessToken=r.accessToken||void 0,i.secret=r.secret,i.nonce=r.nonce,i.pendingToken=r.pendingToken||null,i}_getIdTokenResponse(e){return Ba(e,this.buildRequest())}_linkToIdToken(e,t){const n=this.buildRequest();return n.idToken=t,Ba(e,n)}_getReauthenticationResolver(e){const t=this.buildRequest();return t.autoCreate=!1,Ba(e,t)}buildRequest(){const e={requestUri:"http://localhost",returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const t={};this.idToken&&(t.id_token=this.idToken),this.accessToken&&(t.access_token=this.accessToken),this.secret&&(t.oauth_token_secret=this.secret),t.providerId=this.providerId,this.nonce&&!this.pendingToken&&(t.nonce=this.nonce),e.postBody=qn(t)}return e}}class la{constructor(e){const t=zn(Kn(e)),n=t.apiKey??null,s=t.oobCode??null,r=function(e){switch(e){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}}(t.mode??null);Ur(n&&s&&r,"argument-error"),this.apiKey=n,this.operation=r,this.code=s,this.continueUrl=t.continueUrl??null,this.languageCode=t.lang??null,this.tenantId=t.tenantId??null}static parseLink(e){const t=function(e){const t=zn(Kn(e)).link,n=t?zn(Kn(t)).deep_link_id:null,s=zn(Kn(e)).deep_link_id;return(s?zn(Kn(s)).link:null)||s||n||t||e}(e);try{return new la(t)}catch{return null}}}class ua{constructor(){this.providerId=ua.PROVIDER_ID}static credential(e,t){return oa._fromEmailAndPassword(e,t)}static credentialWithLink(e,t){const n=la.parseLink(t);return Ur(n,"argument-error"),oa._fromEmailAndCode(e,n.code,n.tenantId)}}ua.PROVIDER_ID="password",ua.EMAIL_PASSWORD_SIGN_IN_METHOD="password",ua.EMAIL_LINK_SIGN_IN_METHOD="emailLink";class ha{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}}class pa extends ha{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}class da extends pa{constructor(){super("facebook.com")}static credential(e){return ca._fromParams({providerId:da.PROVIDER_ID,signInMethod:da.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return da.credentialFromTaggedObject(e)}static credentialFromError(e){return da.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e))return null;if(!e.oauthAccessToken)return null;try{return da.credential(e.oauthAccessToken)}catch{return null}}}da.FACEBOOK_SIGN_IN_METHOD="facebook.com",da.PROVIDER_ID="facebook.com";class fa extends pa{constructor(){super("google.com"),this.addScope("profile")}static credential(e,t){return ca._fromParams({providerId:fa.PROVIDER_ID,signInMethod:fa.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:t})}static credentialFromResult(e){return fa.credentialFromTaggedObject(e)}static credentialFromError(e){return fa.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:t,oauthAccessToken:n}=e;if(!t&&!n)return null;try{return fa.credential(t,n)}catch{return null}}}fa.GOOGLE_SIGN_IN_METHOD="google.com",fa.PROVIDER_ID="google.com";class Ca extends pa{constructor(){super("github.com")}static credential(e){return ca._fromParams({providerId:Ca.PROVIDER_ID,signInMethod:Ca.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return Ca.credentialFromTaggedObject(e)}static credentialFromError(e){return Ca.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e))return null;if(!e.oauthAccessToken)return null;try{return Ca.credential(e.oauthAccessToken)}catch{return null}}}Ca.GITHUB_SIGN_IN_METHOD="github.com",Ca.PROVIDER_ID="github.com";class ga extends pa{constructor(){super("twitter.com")}static credential(e,t){return ca._fromParams({providerId:ga.PROVIDER_ID,signInMethod:ga.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:t})}static credentialFromResult(e){return ga.credentialFromTaggedObject(e)}static credentialFromError(e){return ga.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthAccessToken:t,oauthTokenSecret:n}=e;if(!t||!n)return null;try{return ga.credential(t,n)}catch{return null}}}async function ma(e,t){return ti(e,"POST","/v1/accounts:signUp",Xr(e,t))}ga.TWITTER_SIGN_IN_METHOD="twitter.com",ga.PROVIDER_ID="twitter.com";class wa{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,t,n,s=!1){const r=await Ei._fromIdTokenResponse(e,n,s),i=Ea(n);return new wa({user:r,providerId:i,_tokenResponse:n,operationType:t})}static async _forOperation(e,t,n){await e._updateTokensIfNecessary(n,!0);const s=Ea(n);return new wa({user:e,providerId:s,_tokenResponse:n,operationType:t})}}function Ea(e){return e.providerId?e.providerId:"phoneNumber"in e?"phone":null}class ya extends Vn{constructor(e,t,n,s){super(t.code,t.message),this.operationType=n,this.user=s,Object.setPrototypeOf(this,ya.prototype),this.customData={appName:e.name,tenantId:e.tenantId??void 0,_serverResponse:t.customData._serverResponse,operationType:n}}static _fromErrorAndOperation(e,t,n,s){return new ya(e,t,n,s)}}function Da(e,t,n,s){return("reauthenticate"===t?n._getReauthenticationResolver(e):n._getIdTokenResponse(e)).catch(n=>{if("auth/multi-factor-auth-required"===n.code)throw ya._fromErrorAndOperation(e,n,t,s);throw n})}async function _a(e,t,n=!1){const{auth:s}=e;if(hr(s.app))return Promise.reject(Mr(s));const r="reauthenticate";try{const i=await pi(e,Da(s,r,t,e),n);Ur(i.idToken,s,"internal-error");const a=ui(i.idToken);Ur(a,s,"internal-error");const{sub:o}=a;return Ur(e.uid===o,s,"user-mismatch"),wa._forOperation(e,r,i)}catch(e){throw"auth/user-not-found"===e?.code&&xr(s,"user-mismatch"),e}}async function ba(e,t,n=!1){if(hr(e.app))return Promise.reject(Mr(e));const s="signIn",r=await Da(e,s,t),i=await wa._fromIdTokenResponse(e,s,r);return n||await e._updateCurrentUser(i.user),i}function va(e,t,n){Ur(n.url?.length>0,e,"invalid-continue-uri"),Ur(void 0===n.dynamicLinkDomain||n.dynamicLinkDomain.length>0,e,"invalid-dynamic-link-domain"),Ur(void 0===n.linkDomain||n.linkDomain.length>0,e,"invalid-hosting-link-domain"),t.continueUrl=n.url,t.dynamicLinkDomain=n.dynamicLinkDomain,t.linkDomain=n.linkDomain,t.canHandleCodeInApp=n.handleCodeInApp,n.iOS&&(Ur(n.iOS.bundleId.length>0,e,"missing-ios-bundle-id"),t.iOSBundleId=n.iOS.bundleId),n.android&&(Ur(n.android.packageName.length>0,e,"missing-android-pkg-name"),t.androidInstallApp=n.android.installApp,t.androidMinimumVersionCode=n.android.minimumVersion,t.androidPackageName=n.android.packageName)}async function Ia(e){const t=Vi(e);t._getPasswordPolicyInternal()&&await t._updatePasswordPolicy()}async function Ta(e,t,n){const s=Vi(e),r={requestType:"PASSWORD_RESET",email:t,clientType:"CLIENT_TYPE_WEB"};await Xi(s,r,"getOobCode",aa)}function Oa(e,t,n){return hr(e.app)?Promise.reject(Mr(e)):async function(e,t){return ba(Vi(e),t)}(Xn(e),ua.credential(t,n)).catch(async t=>{throw"auth/password-does-not-meet-requirements"===t.code&&Ia(e),t})}async function Aa(e,t){const n=Xn(e),s={requestType:"VERIFY_EMAIL",idToken:await e.getIdToken()};t&&va(n.auth,s,t);const{email:r}=await async function(e,t){return ia(e,t)}(n.auth,s);r!==e.email&&await e.reload()}async function Sa(e,t,n){const s=Xn(e),r={requestType:"VERIFY_AND_CHANGE_EMAIL",idToken:await e.getIdToken(),newEmail:t};n&&va(s.auth,r,n);const{email:i}=await async function(e,t){return ia(e,t)}(s.auth,r);i!==e.email&&await e.reload()}async function Na(e,t){const{displayName:n,photoURL:s}=t;if(void 0===n&&void 0===s)return;const r=Xn(e),i={idToken:await r.getIdToken(),displayName:n,photoUrl:s,returnSecureToken:!0},a=await pi(r,async function(e,t){return Zr(e,"POST","/v1/accounts:update",t)}(r.auth,i));r.displayName=a.displayName||null,r.photoURL=a.photoUrl||null;const o=r.providerData.find(({providerId:e})=>"password"===e);o&&(o.displayName=r.displayName,o.photoURL=r.photoURL),await r._updateTokensIfNecessary(a)}function Ra(e,t){return async function(e,t,n){const{auth:s}=e,r=await e.getIdToken(),i={idToken:r,returnSecureToken:!0};n&&(i.password=n);const a=await pi(e,async function(e,t){return Zr(e,"POST","/v1/accounts:update",t)}(s,i));await e._updateTokensIfNecessary(a,!0)}(Xn(e),0,t)}function ka(e,t,n,s){return Xn(e).onAuthStateChanged(t,n,s)}const La="__sak";class xa{constructor(e,t){this.storageRetriever=e,this.type=t}_isAvailable(){try{return this.storage?(this.storage.setItem(La,"1"),this.storage.removeItem(La),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(e,t){return this.storage.setItem(e,JSON.stringify(t)),Promise.resolve()}_get(e){const t=this.storage.getItem(e);return Promise.resolve(t?JSON.parse(t):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}class Fa extends xa{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,t)=>this.onStorageEvent(e,t),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=Pi(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const t of Object.keys(this.listeners)){const n=this.storage.getItem(t),s=this.localCache[t];n!==s&&e(t,s,n)}}onStorageEvent(e,t=!1){if(!e.key)return void this.forAllChangedKeys((e,t,n)=>{this.notifyListeners(e,n)});const n=e.key;t?this.detachListener():this.stopPolling();const s=()=>{const e=this.storage.getItem(n);(t||this.localCache[n]!==e)&&this.notifyListeners(n,e)},r=this.storage.getItem(n);Fi()&&r!==e.newValue&&e.newValue!==e.oldValue?setTimeout(s,10):s()}notifyListeners(e,t){this.localCache[e]=t;const n=this.listeners[e];if(n)for(const e of Array.from(n))e(t?JSON.parse(t):t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,t,n)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:t,newValue:n}),!0)})},1e3)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,t){0===Object.keys(this.listeners).length&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),0===this.listeners[e].size&&delete this.listeners[e]),0===Object.keys(this.listeners).length&&(this.detachListener(),this.stopPolling())}async _set(e,t){await super._set(e,t),this.localCache[e]=JSON.stringify(t)}async _get(e){const t=await super._get(e);return this.localCache[e]=JSON.stringify(t),t}async _remove(e){await super._remove(e),delete this.localCache[e]}}Fa.type="LOCAL";const Pa=Fa;class Ma extends xa{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,t){}_removeListener(e,t){}}Ma.type="SESSION";const Ga=Ma;class Ua{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const t=this.receivers.find(t=>t.isListeningto(e));if(t)return t;const n=new Ua(e);return this.receivers.push(n),n}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const t=e,{eventId:n,eventType:s,data:r}=t.data,i=this.handlersMap[s];if(!i?.size)return;t.ports[0].postMessage({status:"ack",eventId:n,eventType:s});const a=Array.from(i).map(async e=>e(t.origin,r)),o=await function(e){return Promise.all(e.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(e){return{fulfilled:!1,reason:e}}}))}(a);t.ports[0].postMessage({status:"done",eventId:n,eventType:s,response:o})}_subscribe(e,t){0===Object.keys(this.handlersMap).length&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(t)}_unsubscribe(e,t){this.handlersMap[e]&&t&&this.handlersMap[e].delete(t),t&&0!==this.handlersMap[e].size||delete this.handlersMap[e],0===Object.keys(this.handlersMap).length&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}function Ha(e="",t=10){let n="";for(let e=0;e<t;e++)n+=Math.floor(10*Math.random());return e+n}Ua.receivers=[];class Va{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,t,n=50){const s="undefined"!=typeof MessageChannel?new MessageChannel:null;if(!s)throw new Error("connection_unavailable");let r,i;return new Promise((a,o)=>{const B=Ha("",20);s.port1.start();const c=setTimeout(()=>{o(new Error("unsupported_event"))},n);i={messageChannel:s,onMessage(e){const t=e;if(t.data.eventId===B)switch(t.data.status){case"ack":clearTimeout(c),r=setTimeout(()=>{o(new Error("timeout"))},3e3);break;case"done":clearTimeout(r),a(t.data.response);break;default:clearTimeout(c),clearTimeout(r),o(new Error("invalid_response"))}}},this.handlers.add(i),s.port1.addEventListener("message",i.onMessage),this.target.postMessage({eventType:e,eventId:B,data:t},[s.port2])}).finally(()=>{i&&this.removeMessageHandler(i)})}}function ja(){return window}function $a(){return void 0!==ja().WorkerGlobalScope&&"function"==typeof ja().importScripts}const Ja="firebaseLocalStorageDb",qa="firebaseLocalStorage",za="fbase_key";class Ka{constructor(e){this.request=e}toPromise(){return new Promise((e,t)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{t(this.request.error)})})}}function Qa(e,t){return e.transaction([qa],t?"readwrite":"readonly").objectStore(qa)}function Wa(){const e=indexedDB.open(Ja,1);return new Promise((t,n)=>{e.addEventListener("error",()=>{n(e.error)}),e.addEventListener("upgradeneeded",()=>{const t=e.result;try{t.createObjectStore(qa,{keyPath:za})}catch(e){n(e)}}),e.addEventListener("success",async()=>{const n=e.result;n.objectStoreNames.contains(qa)?t(n):(n.close(),await function(){const e=indexedDB.deleteDatabase(Ja);return new Ka(e).toPromise()}(),t(await Wa()))})})}async function Ya(e,t,n){const s=Qa(e,!0).put({[za]:t,value:n});return new Ka(s).toPromise()}function Xa(e,t){const n=Qa(e,!0).delete(t);return new Ka(n).toPromise()}class Za{registerLifecycleListeners(){"undefined"!=typeof window&&"function"==typeof window.addEventListener&&(window.addEventListener("pagehide",this.onPageHide),window.addEventListener("pageshow",this.onPageShow))}unregisterLifecycleListeners(){"undefined"!=typeof window&&"function"==typeof window.removeEventListener&&(window.removeEventListener("pagehide",this.onPageHide),window.removeEventListener("pageshow",this.onPageShow))}constructor(){this.type="LOCAL",this.dbPromise=null,this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.isClosing=!1,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this.onPageHide=()=>{this.isClosing=!0,this.stopPolling(),this.dbPromise&&(this.dbPromise.then(e=>e.close()).catch(()=>{}),this.dbPromise=null)},this.onPageShow=()=>{this.isClosing&&(this.isClosing=!1,Object.keys(this.listeners).length>0&&this.startPolling())},this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.dbPromise||(this.dbPromise=Wa(),this.dbPromise.catch(()=>{this.dbPromise=null})),this.dbPromise}async _withRetries(e){let t=0;for(;;)try{const t=await this._openDb();return await e(t)}catch(e){if(t++>3)throw e;if(this.dbPromise){const e=this.dbPromise;this.dbPromise=null;try{(await e).close()}catch{}}}}async initializeServiceWorkerMessaging(){return $a()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=Ua._getInstance($a()?self:null),this.receiver._subscribe("keyChanged",async(e,t)=>({keyProcessed:(await this._poll()).includes(t.key)})),this.receiver._subscribe("ping",async(e,t)=>["keyChanged"])}async initializeSender(){if(this.activeServiceWorker=await async function(){if(!navigator?.serviceWorker)return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}(),!this.activeServiceWorker)return;this.sender=new Va(this.activeServiceWorker);const e=await this.sender._send("ping",{},800);e&&e[0]?.fulfilled&&e[0]?.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(this.sender&&this.activeServiceWorker&&(navigator?.serviceWorker?.controller||null)===this.activeServiceWorker)try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{return!!indexedDB&&(await this._withRetries(async e=>{await Ya(e,La,"1"),await Xa(e,La)}),!0)}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,t){return this._withPendingWrite(async()=>(await this._withRetries(n=>Ya(n,e,t)),this.localCache[e]=t,this.notifyServiceWorker(e)))}async _get(e){const t=await this._withRetries(t=>async function(e,t){const n=Qa(e,!1).get(t),s=await new Ka(n).toPromise();return void 0===s?null:s.value}(t,e));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(t=>Xa(t,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){if(this.isClosing)return[];try{const e=await this._withRetries(e=>{const t=Qa(e,!1).getAll();return new Ka(t).toPromise()});if(this.isClosing)return[];if(!e)return[];if(0!==this.pendingWrites)return[];const t=[],n=new Set;if(0!==e.length)for(const{fbase_key:s,value:r}of e)n.add(s),JSON.stringify(this.localCache[s])!==JSON.stringify(r)&&(this.notifyListeners(s,r),t.push(s));for(const e of Object.keys(this.localCache))this.localCache[e]&&!n.has(e)&&(this.notifyListeners(e,null),t.push(e));return t}catch(e){return this.isClosing||kr(`Firebase Auth cross-tab polling failed with error: ${e}`),[]}}notifyListeners(e,t){this.localCache[e]=t;const n=this.listeners[e];if(n)for(const e of Array.from(n))e(t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),800)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,t){0===Object.keys(this.listeners).length&&(this.startPolling(),this.registerLifecycleListeners()),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),0===this.listeners[e].size&&delete this.listeners[e]),0===Object.keys(this.listeners).length&&(this.stopPolling(),this.unregisterLifecycleListeners())}}Za.type="LOCAL";const eo=Za;new qr(3e4,6e4);class to extends na{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return Ba(e,this._buildIdpRequest())}_linkToIdToken(e,t){return Ba(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return Ba(e,this._buildIdpRequest())}_buildIdpRequest(e){const t={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(t.idToken=e),t}}function no(e){return ba(e.auth,new to(e),e.bypassAuthState)}function so(e){const{auth:t,user:n}=e;return Ur(n,t,"internal-error"),_a(n,new to(e),e.bypassAuthState)}async function ro(e){const{auth:t,user:n}=e;return Ur(n,t,"internal-error"),async function(e,t,n=!1){const s=await pi(e,t._linkToIdToken(e.auth,await e.getIdToken()),n);return wa._forOperation(e,"link",s)}(n,new to(e),e.bypassAuthState)}class io{constructor(e,t,n,s,r=!1){this.auth=e,this.resolver=n,this.user=s,this.bypassAuthState=r,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(t)?t:[t]}execute(){return new Promise(async(e,t)=>{this.pendingPromise={resolve:e,reject:t};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(e){this.reject(e)}})}async onAuthEvent(e){const{urlResponse:t,sessionId:n,postBody:s,tenantId:r,error:i,type:a}=e;if(i)return void this.reject(i);const o={auth:this.auth,requestUri:t,sessionId:n,tenantId:r||void 0,postBody:s||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(a)(o))}catch(e){this.reject(e)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return no;case"linkViaPopup":case"linkViaRedirect":return ro;case"reauthViaPopup":case"reauthViaRedirect":return so;default:xr(this.auth,"internal-error")}}resolve(e){Vr(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){Vr(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()}}const ao=new qr(2e3,1e4);class oo extends io{constructor(e,t,n,s,r){super(e,t,s,r),this.provider=n,this.authWindow=null,this.pollId=null,oo.currentPopupAction&&oo.currentPopupAction.cancel(),oo.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return Ur(e,this.auth,"internal-error"),e}async onExecution(){Vr(1===this.filter.length,"Popup operations only handle one event");const e=Ha();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(e=>{this.reject(e)}),this.resolver._isIframeWebStorageSupported(this.auth,e=>{e||this.reject(Fr(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){return this.authWindow?.associatedEvent||null}cancel(){this.reject(Fr(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,oo.currentPopupAction=null}pollUserCancellation(){const e=()=>{this.authWindow?.window?.closed?this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(Fr(this.auth,"popup-closed-by-user"))},8e3):this.pollId=window.setTimeout(e,ao.get())};e()}}oo.currentPopupAction=null;const Bo="pendingRedirect",co=new Map;class lo extends io{constructor(e,t,n=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,n),this.eventId=null}async execute(){let e=co.get(this.auth._key());if(!e){try{const t=await async function(e,t){const n=function(e){return vi(Bo,e.config.apiKey,e.name)}(t),s=function(e){return Di(e._redirectPersistence)}(e);if(!await s._isAvailable())return!1;const r="true"===await s._get(n);return await s._remove(n),r}(this.resolver,this.auth),n=t?await super.execute():null;e=()=>Promise.resolve(n)}catch(t){e=()=>Promise.reject(t)}co.set(this.auth._key(),e)}return this.bypassAuthState||co.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if("signInViaRedirect"===e.type)return super.onAuthEvent(e);if("unknown"!==e.type){if(e.eventId){const t=await this.auth._redirectUserForId(e.eventId);if(t)return this.user=t,super.onAuthEvent(e);this.resolve(null)}}else this.resolve(null)}async onExecution(){}cleanUp(){}}function uo(e,t){co.set(e._key(),t)}async function ho(e,t,n=!1){if(hr(e.app))return Promise.reject(Mr(e));const s=Vi(e),r=function(e,t){return t?Di(t):(Ur(e._popupRedirectResolver,e,"argument-error"),e._popupRedirectResolver)}(s,t),i=new lo(s,r,n),a=await i.execute();return a&&!n&&(delete a.user._redirectEventId,await s._persistUserIfCurrent(a.user),await s._setRedirectUser(null,t)),a}class po{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let t=!1;return this.consumers.forEach(n=>{this.isEventForConsumer(e,n)&&(t=!0,this.sendToConsumer(e,n),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!function(e){switch(e.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return Co(e);default:return!1}}(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){if(e.error&&!Co(e)){const n=e.error.code?.split("auth/")[1]||"internal-error";t.onError(Fr(this.auth,n))}else t.onAuthEvent(e)}isEventForConsumer(e,t){const n=null===t.eventId||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&n}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=6e5&&this.cachedEventUids.clear(),this.cachedEventUids.has(fo(e))}saveEventToCache(e){this.cachedEventUids.add(fo(e)),this.lastProcessedEventTime=Date.now()}}function fo(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter(e=>e).join("-")}function Co({type:e,error:t}){return"unknown"===e&&"auth/no-auth-event"===t?.code}const go=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,mo=/^https?/;async function wo(e){if(e.config.emulator)return;const{authorizedDomains:t}=await async function(e,t={}){return Zr(e,"GET","/v1/projects",t)}(e);for(const e of t)try{if(Eo(e))return}catch{}xr(e,"unauthorized-domain")}function Eo(e){const t=jr(),{protocol:n,hostname:s}=new URL(t);if(e.startsWith("chrome-extension://")){const r=new URL(e);return""===r.hostname&&""===s?"chrome-extension:"===n&&e.replace("chrome-extension://","")===t.replace("chrome-extension://",""):"chrome-extension:"===n&&r.hostname===s}if(!mo.test(n))return!1;if(go.test(e))return s===e;const r=e.replace(/\./g,"\\.");return new RegExp("^(.+\\."+r+"|"+r+")$","i").test(s)}const yo=new qr(3e4,6e4);function Do(){const e=ja().___jsl;if(e?.H)for(const t of Object.keys(e.H))if(e.H[t].r=e.H[t].r||[],e.H[t].L=e.H[t].L||[],e.H[t].r=[...e.H[t].L],e.CP)for(let t=0;t<e.CP.length;t++)e.CP[t]=null}function _o(e){return new Promise((t,n)=>{function s(){Do(),gapi.load("gapi.iframes",{callback:()=>{t(gapi.iframes.getContext())},ontimeout:()=>{Do(),n(Fr(e,"network-request-failed"))},timeout:yo.get()})}if(ja().gapi?.iframes?.Iframe)t(gapi.iframes.getContext());else{if(!ja().gapi?.load){const t=`__${"iframefcb"}${Math.floor(1e6*Math.random())}`;return ja()[t]=()=>{gapi.load?s():n(Fr(e,"network-request-failed"))},Ji(`${$i.gapiScript}?onload=${t}`).catch(e=>n(e))}s()}}).catch(e=>{throw bo=null,e})}let bo=null;const vo=new qr(5e3,15e3),Io={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},To=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function Oo(e){const t=e.config;Ur(t.authDomain,e,"auth-domain-config-required");const n=t.emulator?zr(t,"emulator/auth/iframe"):`https://${e.config.authDomain}/__/auth/iframe`,s={apiKey:t.apiKey,appName:e.name,v:fr},r=To.get(e.config.apiHost);r&&(s.eid=r);const i=e._getFrameworks();return i.length&&(s.fw=i.join(",")),`${n}?${qn(s).slice(1)}`}async function Ao(e){const t=await function(e){return bo=bo||_o(e),bo}(e),n=ja().gapi;return Ur(n,e,"internal-error"),t.open({where:document.body,url:Oo(e),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:Io,dontclear:!0},t=>new Promise(async(n,s)=>{await t.restyle({setHideOnLeave:!1});const r=Fr(e,"network-request-failed"),i=ja().setTimeout(()=>{s(r)},vo.get());function a(){ja().clearTimeout(i),n(t)}t.ping(a).then(a,()=>{s(r)})}))}const So={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"};class No{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch(e){}}}function Ro(e,t,n,s=500,r=600){const i=Math.max((window.screen.availHeight-r)/2,0).toString(),a=Math.max((window.screen.availWidth-s)/2,0).toString();let o="";const B={...So,width:s.toString(),height:r.toString(),top:i,left:a},c=Fn().toLowerCase();n&&(o=Si(c)?"_blank":n),Oi(c)&&(t=t||"http://localhost",B.scrollbars="yes");const l=Object.entries(B).reduce((e,[t,n])=>`${e}${t}=${n},`,"");if(function(e=Fn()){return xi(e)&&!!window.navigator?.standalone}(c)&&"_self"!==o)return function(e,t){const n=document.createElement("a");n.href=e,n.target=t;const s=document.createEvent("MouseEvent");s.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(s)}(t||"",o),new No(null);const u=window.open(t||"",o,l);Ur(u,e,"popup-blocked");try{u.focus()}catch(e){}return new No(u)}const ko="__/auth/handler",Lo="emulator/auth/handler",xo=encodeURIComponent("fac");async function Fo(e,t,n,s,r,i){Ur(e.config.authDomain,e,"auth-domain-config-required"),Ur(e.config.apiKey,e,"invalid-api-key");const a={apiKey:e.config.apiKey,appName:e.name,authType:n,redirectUrl:s,v:fr,eventId:r};if(t instanceof ha){t.setDefaultLanguage(e.languageCode),a.providerId=t.providerId||"",function(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}(t.getCustomParameters())||(a.customParameters=JSON.stringify(t.getCustomParameters()));for(const[e,t]of Object.entries({}))a[e]=t}if(t instanceof pa){const e=t.getScopes().filter(e=>""!==e);e.length>0&&(a.scopes=e.join(","))}e.tenantId&&(a.tid=e.tenantId);const o=a;for(const e of Object.keys(o))void 0===o[e]&&delete o[e];const B=await e._getAppCheckToken(),c=B?`#${xo}=${encodeURIComponent(B)}`:"";return`${function({config:e}){if(!e.emulator)return`https://${e.authDomain}/${ko}`;return zr(e,Lo)}(e)}?${qn(o).slice(1)}${c}`}const Po="webStorageSupport";const Mo=class{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=Ga,this._completeRedirectFn=ho,this._overrideRedirectResult=uo}async _openPopup(e,t,n,s){Vr(this.eventManagers[e._key()]?.manager,"_initialize() not called before _openPopup()");return Ro(e,await Fo(e,t,n,jr(),s),Ha())}async _openRedirect(e,t,n,s){await this._originValidation(e);return function(e){ja().location.href=e}(await Fo(e,t,n,jr(),s)),new Promise(()=>{})}_initialize(e){const t=e._key();if(this.eventManagers[t]){const{manager:e,promise:n}=this.eventManagers[t];return e?Promise.resolve(e):(Vr(n,"If manager is not set, promise should be"),n)}const n=this.initAndGetManager(e);return this.eventManagers[t]={promise:n},n.catch(()=>{delete this.eventManagers[t]}),n}async initAndGetManager(e){const t=await Ao(e),n=new po(e);return t.register("authEvent",t=>{Ur(t?.authEvent,e,"invalid-auth-event");return{status:n.onEvent(t.authEvent)?"ACK":"ERROR"}},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:n},this.iframes[e._key()]=t,n}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send(Po,{type:Po},n=>{const s=n?.[0]?.[Po];void 0!==s&&t(!!s),xr(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=wo(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return Pi()||Ai()||xi()}};var Go="@firebase/auth",Uo="1.13.6";class Ho{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){return this.assertAuthConfigured(),this.auth.currentUser?.uid||null}async getToken(e){if(this.assertAuthConfigured(),await this.auth._initializationPromise,!this.auth.currentUser)return null;return{accessToken:await this.auth.currentUser.getIdToken(e)}}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;const t=this.auth.onIdTokenChanged(t=>{e(t?.stsTokenManager.accessToken||null)});this.internalListeners.set(e,t),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}assertAuthConfigured(){Ur(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}const Vo=kn("authIdTokenMaxAge")||300;let jo=null;function $o(e=gr()){const t=ur(e,"auth");if(t.isInitialized())return t.getImmediate();const n=function(e,t){const n=ur(e,"auth");if(n.isInitialized()){const e=n.getImmediate();if($n(n.getOptions(),t??{}))return e;xr(e,"already-initialized")}return n.initialize({options:t})}(e,{popupRedirectResolver:Mo,persistence:[eo,Pa,Ga]}),s=kn("authTokenSyncURL");if(s&&"boolean"==typeof isSecureContext&&isSecureContext){const e=new URL(s,location.origin);if(location.origin===e.origin){const t=(r=e.toString(),async e=>{const t=e&&await e.getIdTokenResult(),n=t&&((new Date).getTime()-Date.parse(t.issuedAtTime))/1e3;if(n&&n>Vo)return;const s=t?.token;jo!==s&&(jo=s,await fetch(r,{method:s?"POST":"DELETE",headers:s?{Authorization:`Bearer ${s}`}:{}}))});!function(e,t,n){Xn(e).beforeAuthStateChanged(t,n)}(n,t,()=>t(n.currentUser)),function(e,t,n,s){Xn(e).onIdTokenChanged(t,n,s)}(n,e=>t(e))}}var r;const i=Sn("auth");return i&&Zi(n,`http://${i}`),n}var Jo;!function(e){$i=e}({loadJS:e=>new Promise((t,n)=>{const s=document.createElement("script");s.setAttribute("src",e),s.onload=t,s.onerror=e=>{const t=Fr("internal-error");t.customData=e,n(t)},s.type="text/javascript",s.charset="UTF-8",(document.getElementsByTagName("head")?.[0]??document).appendChild(s)}),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="}),Jo="Browser",lr(new ts("auth",(e,{options:t})=>{const n=e.getProvider("app").getImmediate(),s=e.getProvider("heartbeat"),r=e.getProvider("app-check-internal"),{apiKey:i,authDomain:a}=n.options;Ur(i&&!i.includes(":"),"invalid-api-key",{appName:n.name});const o={apiKey:i,authDomain:a,clientPlatform:Jo,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:Mi(Jo)},B=new Hi(n,s,r,o);return function(e,t){const n=t?.persistence||[],s=(Array.isArray(n)?n:[n]).map(Di);t?.errorMap&&e._updateErrorMap(t.errorMap),e._initializeWithPersistence(s,t?.popupRedirectResolver)}(B,t),B},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,n)=>{e.getProvider("auth-internal").initialize()})),lr(new ts("auth-internal",e=>(e=>new Ho(e))(Vi(e.getProvider("auth").getImmediate())),"PRIVATE").setInstantiationMode("EXPLICIT")),mr(Go,Uo,function(e){switch(e){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}(Jo)),mr(Go,Uo,"esm2020");mr("firebase","12.19.0","app");var qo,zo="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};(function(){var e;function t(){this.blockSize=-1,this.blockSize=64,this.g=Array(4),this.C=Array(this.blockSize),this.o=this.h=0,this.u()}function n(e,t,n){n||(n=0);const s=Array(16);if("string"==typeof t)for(var r=0;r<16;++r)s[r]=t.charCodeAt(n++)|t.charCodeAt(n++)<<8|t.charCodeAt(n++)<<16|t.charCodeAt(n++)<<24;else for(r=0;r<16;++r)s[r]=t[n++]|t[n++]<<8|t[n++]<<16|t[n++]<<24;t=e.g[0],n=e.g[1],r=e.g[2];let i,a=e.g[3];i=t+(a^n&(r^a))+s[0]+3614090360&4294967295,i=a+(r^(t=n+(i<<7&4294967295|i>>>25))&(n^r))+s[1]+3905402710&4294967295,a=t+(i<<12&4294967295|i>>>20),i=r+(n^a&(t^n))+s[2]+606105819&4294967295,i=n+(t^(r=a+(i<<17&4294967295|i>>>15))&(a^t))+s[3]+3250441966&4294967295,i=t+(a^(n=r+(i<<22&4294967295|i>>>10))&(r^a))+s[4]+4118548399&4294967295,i=a+(r^(t=n+(i<<7&4294967295|i>>>25))&(n^r))+s[5]+1200080426&4294967295,a=t+(i<<12&4294967295|i>>>20),i=r+(n^a&(t^n))+s[6]+2821735955&4294967295,i=n+(t^(r=a+(i<<17&4294967295|i>>>15))&(a^t))+s[7]+4249261313&4294967295,i=t+(a^(n=r+(i<<22&4294967295|i>>>10))&(r^a))+s[8]+1770035416&4294967295,i=a+(r^(t=n+(i<<7&4294967295|i>>>25))&(n^r))+s[9]+2336552879&4294967295,a=t+(i<<12&4294967295|i>>>20),i=r+(n^a&(t^n))+s[10]+4294925233&4294967295,i=n+(t^(r=a+(i<<17&4294967295|i>>>15))&(a^t))+s[11]+2304563134&4294967295,i=t+(a^(n=r+(i<<22&4294967295|i>>>10))&(r^a))+s[12]+1804603682&4294967295,i=a+(r^(t=n+(i<<7&4294967295|i>>>25))&(n^r))+s[13]+4254626195&4294967295,a=t+(i<<12&4294967295|i>>>20),i=r+(n^a&(t^n))+s[14]+2792965006&4294967295,i=n+(t^(r=a+(i<<17&4294967295|i>>>15))&(a^t))+s[15]+1236535329&4294967295,i=t+(r^a&((n=r+(i<<22&4294967295|i>>>10))^r))+s[1]+4129170786&4294967295,i=a+(n^r&((t=n+(i<<5&4294967295|i>>>27))^n))+s[6]+3225465664&4294967295,a=t+(i<<9&4294967295|i>>>23),i=r+(t^n&(a^t))+s[11]+643717713&4294967295,i=n+(a^t&((r=a+(i<<14&4294967295|i>>>18))^a))+s[0]+3921069994&4294967295,i=t+(r^a&((n=r+(i<<20&4294967295|i>>>12))^r))+s[5]+3593408605&4294967295,i=a+(n^r&((t=n+(i<<5&4294967295|i>>>27))^n))+s[10]+38016083&4294967295,a=t+(i<<9&4294967295|i>>>23),i=r+(t^n&(a^t))+s[15]+3634488961&4294967295,i=n+(a^t&((r=a+(i<<14&4294967295|i>>>18))^a))+s[4]+3889429448&4294967295,i=t+(r^a&((n=r+(i<<20&4294967295|i>>>12))^r))+s[9]+568446438&4294967295,i=a+(n^r&((t=n+(i<<5&4294967295|i>>>27))^n))+s[14]+3275163606&4294967295,a=t+(i<<9&4294967295|i>>>23),i=r+(t^n&(a^t))+s[3]+4107603335&4294967295,i=n+(a^t&((r=a+(i<<14&4294967295|i>>>18))^a))+s[8]+1163531501&4294967295,i=t+(r^a&((n=r+(i<<20&4294967295|i>>>12))^r))+s[13]+2850285829&4294967295,i=a+(n^r&((t=n+(i<<5&4294967295|i>>>27))^n))+s[2]+4243563512&4294967295,a=t+(i<<9&4294967295|i>>>23),i=r+(t^n&(a^t))+s[7]+1735328473&4294967295,i=n+(a^t&((r=a+(i<<14&4294967295|i>>>18))^a))+s[12]+2368359562&4294967295,i=t+((n=r+(i<<20&4294967295|i>>>12))^r^a)+s[5]+4294588738&4294967295,i=a+((t=n+(i<<4&4294967295|i>>>28))^n^r)+s[8]+2272392833&4294967295,a=t+(i<<11&4294967295|i>>>21),i=r+(a^t^n)+s[11]+1839030562&4294967295,i=n+((r=a+(i<<16&4294967295|i>>>16))^a^t)+s[14]+4259657740&4294967295,i=t+((n=r+(i<<23&4294967295|i>>>9))^r^a)+s[1]+2763975236&4294967295,i=a+((t=n+(i<<4&4294967295|i>>>28))^n^r)+s[4]+1272893353&4294967295,a=t+(i<<11&4294967295|i>>>21),i=r+(a^t^n)+s[7]+4139469664&4294967295,i=n+((r=a+(i<<16&4294967295|i>>>16))^a^t)+s[10]+3200236656&4294967295,i=t+((n=r+(i<<23&4294967295|i>>>9))^r^a)+s[13]+681279174&4294967295,i=a+((t=n+(i<<4&4294967295|i>>>28))^n^r)+s[0]+3936430074&4294967295,a=t+(i<<11&4294967295|i>>>21),i=r+(a^t^n)+s[3]+3572445317&4294967295,i=n+((r=a+(i<<16&4294967295|i>>>16))^a^t)+s[6]+76029189&4294967295,i=t+((n=r+(i<<23&4294967295|i>>>9))^r^a)+s[9]+3654602809&4294967295,i=a+((t=n+(i<<4&4294967295|i>>>28))^n^r)+s[12]+3873151461&4294967295,a=t+(i<<11&4294967295|i>>>21),i=r+(a^t^n)+s[15]+530742520&4294967295,i=n+((r=a+(i<<16&4294967295|i>>>16))^a^t)+s[2]+3299628645&4294967295,i=t+(r^((n=r+(i<<23&4294967295|i>>>9))|~a))+s[0]+4096336452&4294967295,i=a+(n^((t=n+(i<<6&4294967295|i>>>26))|~r))+s[7]+1126891415&4294967295,a=t+(i<<10&4294967295|i>>>22),i=r+(t^(a|~n))+s[14]+2878612391&4294967295,i=n+(a^((r=a+(i<<15&4294967295|i>>>17))|~t))+s[5]+4237533241&4294967295,i=t+(r^((n=r+(i<<21&4294967295|i>>>11))|~a))+s[12]+1700485571&4294967295,i=a+(n^((t=n+(i<<6&4294967295|i>>>26))|~r))+s[3]+2399980690&4294967295,a=t+(i<<10&4294967295|i>>>22),i=r+(t^(a|~n))+s[10]+4293915773&4294967295,i=n+(a^((r=a+(i<<15&4294967295|i>>>17))|~t))+s[1]+2240044497&4294967295,i=t+(r^((n=r+(i<<21&4294967295|i>>>11))|~a))+s[8]+1873313359&4294967295,i=a+(n^((t=n+(i<<6&4294967295|i>>>26))|~r))+s[15]+4264355552&4294967295,a=t+(i<<10&4294967295|i>>>22),i=r+(t^(a|~n))+s[6]+2734768916&4294967295,i=n+(a^((r=a+(i<<15&4294967295|i>>>17))|~t))+s[13]+1309151649&4294967295,i=t+(r^((n=r+(i<<21&4294967295|i>>>11))|~a))+s[4]+4149444226&4294967295,i=a+(n^((t=n+(i<<6&4294967295|i>>>26))|~r))+s[11]+3174756917&4294967295,a=t+(i<<10&4294967295|i>>>22),i=r+(t^(a|~n))+s[2]+718787259&4294967295,i=n+(a^((r=a+(i<<15&4294967295|i>>>17))|~t))+s[9]+3951481745&4294967295,e.g[0]=e.g[0]+t&4294967295,e.g[1]=e.g[1]+(r+(i<<21&4294967295|i>>>11))&4294967295,e.g[2]=e.g[2]+r&4294967295,e.g[3]=e.g[3]+a&4294967295}function s(e,t){this.h=t;const n=[];let s=!0;for(let r=e.length-1;r>=0;r--){const i=0|e[r];s&&i==t||(n[r]=i,s=!1)}this.g=n}!function(e,t){function n(){}n.prototype=t.prototype,e.F=t.prototype,e.prototype=new n,e.prototype.constructor=e,e.D=function(e,n,s){for(var r=Array(arguments.length-2),i=2;i<arguments.length;i++)r[i-2]=arguments[i];return t.prototype[n].apply(e,r)}}(t,function(){this.blockSize=-1}),t.prototype.u=function(){this.g[0]=1732584193,this.g[1]=4023233417,this.g[2]=2562383102,this.g[3]=271733878,this.o=this.h=0},t.prototype.v=function(e,t){void 0===t&&(t=e.length);const s=t-this.blockSize,r=this.C;let i=this.h,a=0;for(;a<t;){if(0==i)for(;a<=s;)n(this,e,a),a+=this.blockSize;if("string"==typeof e){for(;a<t;)if(r[i++]=e.charCodeAt(a++),i==this.blockSize){n(this,r),i=0;break}}else for(;a<t;)if(r[i++]=e[a++],i==this.blockSize){n(this,r),i=0;break}}this.h=i,this.o+=t},t.prototype.A=function(){var e=Array((this.h<56?this.blockSize:2*this.blockSize)-this.h);e[0]=128;for(var t=1;t<e.length-8;++t)e[t]=0;t=8*this.o;for(var n=e.length-8;n<e.length;++n)e[n]=255&t,t/=256;for(this.v(e),e=Array(16),t=0,n=0;n<4;++n)for(let s=0;s<32;s+=8)e[t++]=this.g[n]>>>s&255;return e};var r={};function i(e){return-128<=e&&e<128?function(e,t){var n=r;return Object.prototype.hasOwnProperty.call(n,e)?n[e]:n[e]=t(e)}(e,function(e){return new s([0|e],e<0?-1:0)}):new s([0|e],e<0?-1:0)}function a(e){if(isNaN(e)||!isFinite(e))return o;if(e<0)return h(a(-e));const t=[];let n=1;for(let s=0;e>=n;s++)t[s]=e/n|0,n*=4294967296;return new s(t,0)}var o=i(0),B=i(1),c=i(16777216);function l(e){if(0!=e.h)return!1;for(let t=0;t<e.g.length;t++)if(0!=e.g[t])return!1;return!0}function u(e){return-1==e.h}function h(e){const t=e.g.length,n=[];for(let s=0;s<t;s++)n[s]=~e.g[s];return new s(n,~e.h).add(B)}function p(e,t){return e.add(h(t))}function d(e,t){for(;(65535&e[t])!=e[t];)e[t+1]+=e[t]>>>16,e[t]&=65535,t++}function f(e,t){this.g=e,this.h=t}function C(e,t){if(l(t))throw Error("division by zero");if(l(e))return new f(o,o);if(u(e))return t=C(h(e),t),new f(h(t.g),h(t.h));if(u(t))return t=C(e,h(t)),new f(h(t.g),t.h);if(e.g.length>30){if(u(e)||u(t))throw Error("slowDivide_ only works with positive integers.");for(var n=B,s=t;s.l(e)<=0;)n=g(n),s=g(s);var r=m(n,1),i=m(s,1);for(s=m(s,2),n=m(n,2);!l(s);){var c=i.add(s);c.l(e)<=0&&(r=r.add(n),i=c),s=m(s,1),n=m(n,1)}return t=p(e,r.j(t)),new f(r,t)}for(r=o;e.l(t)>=0;){for(n=Math.max(1,Math.floor(e.m()/t.m())),s=(s=Math.ceil(Math.log(n)/Math.LN2))<=48?1:Math.pow(2,s-48),c=(i=a(n)).j(t);u(c)||c.l(e)>0;)c=(i=a(n-=s)).j(t);l(i)&&(i=B),r=r.add(i),e=p(e,c)}return new f(r,e)}function g(e){const t=e.g.length+1,n=[];for(let s=0;s<t;s++)n[s]=e.i(s)<<1|e.i(s-1)>>>31;return new s(n,e.h)}function m(e,t){const n=t>>5;t%=32;const r=e.g.length-n,i=[];for(let s=0;s<r;s++)i[s]=t>0?e.i(s+n)>>>t|e.i(s+n+1)<<32-t:e.i(s+n);return new s(i,e.h)}(e=s.prototype).m=function(){if(u(this))return-h(this).m();let e=0,t=1;for(let n=0;n<this.g.length;n++){const s=this.i(n);e+=(s>=0?s:4294967296+s)*t,t*=4294967296}return e},e.toString=function(e){if((e=e||10)<2||36<e)throw Error("radix out of range: "+e);if(l(this))return"0";if(u(this))return"-"+h(this).toString(e);const t=a(Math.pow(e,6));var n=this;let s="";for(;;){const r=C(n,t).g;let i=(((n=p(n,r.j(t))).g.length>0?n.g[0]:n.h)>>>0).toString(e);if(l(n=r))return i+s;for(;i.length<6;)i="0"+i;s=i+s}},e.i=function(e){return e<0?0:e<this.g.length?this.g[e]:this.h},e.l=function(e){return u(e=p(this,e))?-1:l(e)?0:1},e.abs=function(){return u(this)?h(this):this},e.add=function(e){const t=Math.max(this.g.length,e.g.length),n=[];let r=0;for(let s=0;s<=t;s++){let t=r+(65535&this.i(s))+(65535&e.i(s)),i=(t>>>16)+(this.i(s)>>>16)+(e.i(s)>>>16);r=i>>>16,t&=65535,i&=65535,n[s]=i<<16|t}return new s(n,-2147483648&n[n.length-1]?-1:0)},e.j=function(e){if(l(this)||l(e))return o;if(u(this))return u(e)?h(this).j(h(e)):h(h(this).j(e));if(u(e))return h(this.j(h(e)));if(this.l(c)<0&&e.l(c)<0)return a(this.m()*e.m());const t=this.g.length+e.g.length,n=[];for(var r=0;r<2*t;r++)n[r]=0;for(r=0;r<this.g.length;r++)for(let t=0;t<e.g.length;t++){const s=this.i(r)>>>16,i=65535&this.i(r),a=e.i(t)>>>16,o=65535&e.i(t);n[2*r+2*t]+=i*o,d(n,2*r+2*t),n[2*r+2*t+1]+=s*o,d(n,2*r+2*t+1),n[2*r+2*t+1]+=i*a,d(n,2*r+2*t+1),n[2*r+2*t+2]+=s*a,d(n,2*r+2*t+2)}for(e=0;e<t;e++)n[e]=n[2*e+1]<<16|n[2*e];for(e=t;e<2*t;e++)n[e]=0;return new s(n,0)},e.B=function(e){return C(this,e).h},e.and=function(e){const t=Math.max(this.g.length,e.g.length),n=[];for(let s=0;s<t;s++)n[s]=this.i(s)&e.i(s);return new s(n,this.h&e.h)},e.or=function(e){const t=Math.max(this.g.length,e.g.length),n=[];for(let s=0;s<t;s++)n[s]=this.i(s)|e.i(s);return new s(n,this.h|e.h)},e.xor=function(e){const t=Math.max(this.g.length,e.g.length),n=[];for(let s=0;s<t;s++)n[s]=this.i(s)^e.i(s);return new s(n,this.h^e.h)},t.prototype.digest=t.prototype.A,t.prototype.reset=t.prototype.u,t.prototype.update=t.prototype.v,s.prototype.add=s.prototype.add,s.prototype.multiply=s.prototype.j,s.prototype.modulo=s.prototype.B,s.prototype.compare=s.prototype.l,s.prototype.toNumber=s.prototype.m,s.prototype.toString=s.prototype.toString,s.prototype.getBits=s.prototype.i,s.fromNumber=a,s.fromString=function e(t,n){if(0==t.length)throw Error("number format error: empty string");if((n=n||10)<2||36<n)throw Error("radix out of range: "+n);if("-"==t.charAt(0))return h(e(t.substring(1),n));if(t.indexOf("-")>=0)throw Error('number format error: interior "-" character');const s=a(Math.pow(n,8));let r=o;for(let e=0;e<t.length;e+=8){var i=Math.min(8,t.length-e);const o=parseInt(t.substring(e,e+i),n);i<8?(i=a(Math.pow(n,i)),r=r.j(i).add(a(o))):(r=r.j(s),r=r.add(a(o)))}return r},qo=s}).apply(void 0!==zo?zo:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var Ko,Qo,Wo,Yo,Xo,Zo,eB,tB,nB="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};(function(){var e,t=Object.defineProperty;var n=function(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof nB&&nB];for(var t=0;t<e.length;++t){var n=e[t];if(n&&n.Math==Math)return n}throw Error("Cannot find global object")}(this);function s(e,s){if(s)e:{var r=n;e=e.split(".");for(var i=0;i<e.length-1;i++){var a=e[i];if(!(a in r))break e;r=r[a]}(s=s(i=r[e=e[e.length-1]]))!=i&&null!=s&&t(r,e,{configurable:!0,writable:!0,value:s})}}s("Symbol.dispose",function(e){return e||Symbol("Symbol.dispose")}),s("Array.prototype.values",function(e){return e||function(){return this[Symbol.iterator]()}}),s("Object.entries",function(e){return e||function(e){var t,n=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.push([t,e[t]]);return n}});var r=r||{},i=this||self;function a(e){var t=typeof e;return"object"==t&&null!=e||"function"==t}function o(e,t,n){return e.call.apply(e.bind,arguments)}function B(e,t,n){return(B=o).apply(null,arguments)}function c(e,t){var n=Array.prototype.slice.call(arguments,1);return function(){var t=n.slice();return t.push.apply(t,arguments),e.apply(this,t)}}function l(e,t){function n(){}n.prototype=t.prototype,e.Z=t.prototype,e.prototype=new n,e.prototype.constructor=e,e.Ob=function(e,n,s){for(var r=Array(arguments.length-2),i=2;i<arguments.length;i++)r[i-2]=arguments[i];return t.prototype[n].apply(e,r)}}var u="undefined"!=typeof AsyncContext&&"function"==typeof AsyncContext.Snapshot?e=>e&&AsyncContext.Snapshot.wrap(e):e=>e;function h(e){const t=e.length;if(t>0){const n=Array(t);for(let s=0;s<t;s++)n[s]=e[s];return n}return[]}function p(e,t){for(let t=1;t<arguments.length;t++){const s=arguments[t];var n=typeof s;if("array"==(n="object"!=n?n:s?Array.isArray(s)?"array":n:"null")||"object"==n&&"number"==typeof s.length){n=e.length||0;const t=s.length||0;e.length=n+t;for(let r=0;r<t;r++)e[n+r]=s[r]}else e.push(s)}}function d(e){i.setTimeout(()=>{throw e},0)}function f(){var e=E;let t=null;return e.g&&(t=e.g,e.g=e.g.next,e.g||(e.h=null),t.next=null),t}var C=new class{constructor(e,t){this.i=e,this.j=t,this.h=0,this.g=null}get(){let e;return this.h>0?(this.h--,e=this.g,this.g=e.next,e.next=null):e=this.i(),e}}(()=>new g,e=>e.reset());class g{constructor(){this.next=this.g=this.h=null}set(e,t){this.h=e,this.g=t,this.next=null}reset(){this.next=this.g=this.h=null}}let m,w=!1,E=new class{constructor(){this.h=this.g=null}add(e,t){const n=C.get();n.set(e,t),this.h?this.h.next=n:this.g=n,this.h=n}},y=()=>{const e=Promise.resolve(void 0);m=()=>{e.then(D)}};function D(){for(var e;e=f();){try{e.h.call(e.g)}catch(e){d(e)}var t=C;t.j(e),t.h<100&&(t.h++,e.next=t.g,t.g=e)}w=!1}function _(){this.u=this.u,this.C=this.C}function b(e,t){this.type=e,this.g=this.target=t,this.defaultPrevented=!1}_.prototype.u=!1,_.prototype.dispose=function(){this.u||(this.u=!0,this.N())},_.prototype[Symbol.dispose]=function(){this.dispose()},_.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()},b.prototype.h=function(){this.defaultPrevented=!0};var v=function(){if(!i.addEventListener||!Object.defineProperty)return!1;var e=!1,t=Object.defineProperty({},"passive",{get:function(){e=!0}});try{const e=()=>{};i.addEventListener("test",e,t),i.removeEventListener("test",e,t)}catch(e){}return e}();function I(e){return/^[\s\xa0]*$/.test(e)}function T(e,t){b.call(this,e?e.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,e&&this.init(e,t)}l(T,b),T.prototype.init=function(e,t){const n=this.type=e.type,s=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:null;this.target=e.target||e.srcElement,this.g=t,(t=e.relatedTarget)||("mouseover"==n?t=e.fromElement:"mouseout"==n&&(t=e.toElement)),this.relatedTarget=t,s?(this.clientX=void 0!==s.clientX?s.clientX:s.pageX,this.clientY=void 0!==s.clientY?s.clientY:s.pageY,this.screenX=s.screenX||0,this.screenY=s.screenY||0):(this.clientX=void 0!==e.clientX?e.clientX:e.pageX,this.clientY=void 0!==e.clientY?e.clientY:e.pageY,this.screenX=e.screenX||0,this.screenY=e.screenY||0),this.button=e.button,this.key=e.key||"",this.ctrlKey=e.ctrlKey,this.altKey=e.altKey,this.shiftKey=e.shiftKey,this.metaKey=e.metaKey,this.pointerId=e.pointerId||0,this.pointerType=e.pointerType,this.state=e.state,this.i=e,e.defaultPrevented&&T.Z.h.call(this)},T.prototype.h=function(){T.Z.h.call(this);const e=this.i;e.preventDefault?e.preventDefault():e.returnValue=!1};var O="closure_listenable_"+(1e6*Math.random()|0),A=0;function S(e,t,n,s,r){this.listener=e,this.proxy=null,this.src=t,this.type=n,this.capture=!!s,this.ha=r,this.key=++A,this.da=this.fa=!1}function N(e){e.da=!0,e.listener=null,e.proxy=null,e.src=null,e.ha=null}function R(e,t,n){for(const s in e)t.call(n,e[s],s,e)}function k(e){const t={};for(const n in e)t[n]=e[n];return t}const L="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function x(e,t){let n,s;for(let t=1;t<arguments.length;t++){for(n in s=arguments[t],s)e[n]=s[n];for(let t=0;t<L.length;t++)n=L[t],Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n])}}function F(e){this.src=e,this.g={},this.h=0}function P(e,t){const n=t.type;if(n in e.g){var s,r=e.g[n],i=Array.prototype.indexOf.call(r,t,void 0);(s=i>=0)&&Array.prototype.splice.call(r,i,1),s&&(N(t),0==e.g[n].length&&(delete e.g[n],e.h--))}}function M(e,t,n,s){for(let r=0;r<e.length;++r){const i=e[r];if(!i.da&&i.listener==t&&i.capture==!!n&&i.ha==s)return r}return-1}F.prototype.add=function(e,t,n,s,r){const i=e.toString();(e=this.g[i])||(e=this.g[i]=[],this.h++);const a=M(e,t,s,r);return a>-1?(t=e[a],n||(t.fa=!1)):((t=new S(t,this.src,i,!!s,r)).fa=n,e.push(t)),t};var G="closure_lm_"+(1e6*Math.random()|0),U={};function H(e,t,n,s,r){if(Array.isArray(t)){for(let i=0;i<t.length;i++)H(e,t[i],n,s,r);return null}return n=K(n),e&&e[O]?e.J(t,n,!!a(s)&&!!s.capture,r):function(e,t,n,s,r,i){if(!t)throw Error("Invalid event type");const o=a(r)?!!r.capture:!!r;let B=q(e);if(B||(e[G]=B=new F(e)),n=B.add(t,n,s,o,i),n.proxy)return n;if(s=function(){function e(n){return t.call(e.src,e.listener,n)}const t=J;return e}(),n.proxy=s,s.src=e,s.listener=n,e.addEventListener)v||(r=o),void 0===r&&(r=!1),e.addEventListener(t.toString(),s,r);else if(e.attachEvent)e.attachEvent($(t.toString()),s);else{if(!e.addListener||!e.removeListener)throw Error("addEventListener and attachEvent are unavailable.");e.addListener(s)}return n}(e,t,n,!1,s,r)}function V(e,t,n,s,r){if(Array.isArray(t))for(var i=0;i<t.length;i++)V(e,t[i],n,s,r);else s=a(s)?!!s.capture:!!s,n=K(n),e&&e[O]?(e=e.i,(i=String(t).toString())in e.g&&((n=M(t=e.g[i],n,s,r))>-1&&(N(t[n]),Array.prototype.splice.call(t,n,1),0==t.length&&(delete e.g[i],e.h--)))):e&&(e=q(e))&&(t=e.g[t.toString()],e=-1,t&&(e=M(t,n,s,r)),(n=e>-1?t[e]:null)&&j(n))}function j(e){if("number"!=typeof e&&e&&!e.da){var t=e.src;if(t&&t[O])P(t.i,e);else{var n=e.type,s=e.proxy;t.removeEventListener?t.removeEventListener(n,s,e.capture):t.detachEvent?t.detachEvent($(n),s):t.addListener&&t.removeListener&&t.removeListener(s),(n=q(t))?(P(n,e),0==n.h&&(n.src=null,t[G]=null)):N(e)}}}function $(e){return e in U?U[e]:U[e]="on"+e}function J(e,t){if(e.da)e=!0;else{t=new T(t,this);const n=e.listener,s=e.ha||e.src;e.fa&&j(e),e=n.call(s,t)}return e}function q(e){return(e=e[G])instanceof F?e:null}var z="__closure_events_fn_"+(1e9*Math.random()>>>0);function K(e){return"function"==typeof e?e:(e[z]||(e[z]=function(t){return e.handleEvent(t)}),e[z])}function Q(){_.call(this),this.i=new F(this),this.M=this,this.G=null}function W(e,t){var n,s=e.G;if(s)for(n=[];s;s=s.G)n.push(s);if(e=e.M,s=t.type||t,"string"==typeof t)t=new b(t,e);else if(t instanceof b)t.target=t.target||e;else{var r=t;x(t=new b(s,e),r)}let i,a;if(r=!0,n)for(a=n.length-1;a>=0;a--)i=t.g=n[a],r=Y(i,s,!0,t)&&r;if(i=t.g=e,r=Y(i,s,!0,t)&&r,r=Y(i,s,!1,t)&&r,n)for(a=0;a<n.length;a++)i=t.g=n[a],r=Y(i,s,!1,t)&&r}function Y(e,t,n,s){if(!(t=e.i.g[String(t)]))return!0;t=t.concat();let r=!0;for(let i=0;i<t.length;++i){const a=t[i];if(a&&!a.da&&a.capture==n){const t=a.listener,n=a.ha||a.src;a.fa&&P(e.i,a),r=!1!==t.call(n,s)&&r}}return r&&!s.defaultPrevented}function X(e){e.g=function(e,t){if("function"!=typeof e){if(!e||"function"!=typeof e.handleEvent)throw Error("Invalid listener argument");e=B(e.handleEvent,e)}return Number(t)>2147483647?-1:i.setTimeout(e,t||0)}(()=>{e.g=null,e.i&&(e.i=!1,X(e))},e.l);const t=e.h;e.h=null,e.m.apply(null,t)}l(Q,_),Q.prototype[O]=!0,Q.prototype.removeEventListener=function(e,t,n,s){V(this,e,t,n,s)},Q.prototype.N=function(){if(Q.Z.N.call(this),this.i){var e=this.i;for(const t in e.g){const n=e.g[t];for(let e=0;e<n.length;e++)N(n[e]);delete e.g[t],e.h--}}this.G=null},Q.prototype.J=function(e,t,n,s){return this.i.add(String(e),t,!1,n,s)},Q.prototype.K=function(e,t,n,s){return this.i.add(String(e),t,!0,n,s)};class Z extends _{constructor(e,t){super(),this.m=e,this.l=t,this.h=null,this.i=!1,this.g=null}j(e){this.h=arguments,this.g?this.i=!0:X(this)}N(){super.N(),this.g&&(i.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function ee(e){_.call(this),this.h=e,this.g={}}l(ee,_);var te=[];function ne(e){R(e.g,function(e,t){this.g.hasOwnProperty(t)&&j(e)},e),e.g={}}ee.prototype.N=function(){ee.Z.N.call(this),ne(this)},ee.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var se=i.JSON.stringify,re=i.JSON.parse,ie=class{stringify(e){return i.JSON.stringify(e,void 0)}parse(e){return i.JSON.parse(e,void 0)}};function ae(){}function oe(){}var Be={OPEN:"a",hb:"b",ERROR:"c",tb:"d"};function ce(){b.call(this,"d")}function le(){b.call(this,"c")}l(ce,b),l(le,b);var ue={},he=null;function pe(){return he=he||new Q}function de(e){b.call(this,ue.Ia,e)}function fe(e){const t=pe();W(t,new de(t))}function Ce(e,t){b.call(this,ue.STAT_EVENT,e),this.stat=t}function ge(e){const t=pe();W(t,new Ce(t,e))}function me(e,t){b.call(this,ue.Ja,e),this.size=t}function we(e,t){if("function"!=typeof e)throw Error("Fn must not be null and must be a function");return i.setTimeout(function(){e()},t)}function Ee(){this.g=!0}function ye(e,t,n,s){e.info(function(){return"XMLHTTP TEXT ("+t+"): "+function(e,t){if(!e.g)return t;if(!t)return null;try{const i=JSON.parse(t);if(i)for(e=0;e<i.length;e++)if(Array.isArray(i[e])){var n=i[e];if(!(n.length<2)){var s=n[1];if(Array.isArray(s)&&!(s.length<1)){var r=s[0];if("noop"!=r&&"stop"!=r&&"close"!=r)for(let e=1;e<s.length;e++)s[e]=""}}}return se(i)}catch(e){return t}}(e,n)+(s?" "+s:"")})}ue.Ia="serverreachability",l(de,b),ue.STAT_EVENT="statevent",l(Ce,b),ue.Ja="timingevent",l(me,b),Ee.prototype.ua=function(){this.g=!1},Ee.prototype.info=function(){};var De,_e={NO_ERROR:0,cb:1,qb:2,pb:3,kb:4,ob:5,rb:6,Ga:7,TIMEOUT:8,ub:9},be={ib:"complete",Fb:"success",ERROR:"error",Ga:"abort",xb:"ready",yb:"readystatechange",TIMEOUT:"timeout",sb:"incrementaldata",wb:"progress",lb:"downloadprogress",Nb:"uploadprogress"};function ve(){}function Ie(e){return encodeURIComponent(String(e))}function Te(e){var t=1;e=e.split(":");const n=[];for(;t>0&&e.length;)n.push(e.shift()),t--;return e.length&&n.push(e.join(":")),n}function Oe(e,t,n,s){this.j=e,this.i=t,this.l=n,this.S=s||1,this.V=new ee(this),this.H=45e3,this.J=null,this.o=!1,this.u=this.B=this.A=this.M=this.F=this.T=this.D=null,this.G=[],this.g=null,this.C=0,this.m=this.v=null,this.X=-1,this.K=!1,this.P=0,this.O=null,this.W=this.L=this.U=this.R=!1,this.h=new Ae}function Ae(){this.i=null,this.g="",this.h=!1}l(ve,ae),ve.prototype.g=function(){return new XMLHttpRequest},De=new ve;var Se={},Ne={};function Re(e,t,n){e.M=1,e.A=st(Xe(t)),e.u=n,e.R=!0,ke(e,null)}function ke(e,t){e.F=Date.now(),Fe(e),e.B=Xe(e.A);var n=e.B,s=e.S;Array.isArray(s)||(s=[String(s)]),gt(n.i,"t",s),e.C=0,n=e.j.L,e.h=new Ae,e.g=sn(e.j,n?t:null,!e.u),e.P>0&&(e.O=new Z(B(e.Y,e,e.g),e.P)),t=e.V,n=e.g,s=e.ba;var r="readystatechange";Array.isArray(r)||(r&&(te[0]=r.toString()),r=te);for(let e=0;e<r.length;e++){const i=H(n,r[e],s||t.handleEvent,!1,t.h||t);if(!i)break;t.g[i.key]=i}t=e.J?k(e.J):{},e.u?(e.v||(e.v="POST"),t["Content-Type"]="application/x-www-form-urlencoded",e.g.ea(e.B,e.v,e.u,t)):(e.v="GET",e.g.ea(e.B,e.v,null,t)),fe(),function(e,t,n,s,r,i){e.info(function(){if(e.g)if(i){var a="",o=i.split("&");for(let e=0;e<o.length;e++){var B=o[e].split("=");if(B.length>1){const e=B[0];B=B[1];const t=e.split("_");a=t.length>=2&&"type"==t[1]?a+(e+"=")+B+"&":a+(e+"=redacted&")}}}else a=null;else a=i;return"XMLHTTP REQ ("+s+") [attempt "+r+"]: "+t+"\n"+n+"\n"+a})}(e.i,e.v,e.B,e.l,e.S,e.u)}function Le(e){return!!e.g&&("GET"==e.v&&2!=e.M&&e.j.Aa)}function xe(e,t){var n=e.C,s=t.indexOf("\n",n);return-1==s?Ne:(n=Number(t.substring(n,s)),isNaN(n)?Se:(s+=1)+n>t.length?Ne:(t=t.slice(s,s+n),e.C=s+n,t))}function Fe(e){e.T=Date.now()+e.H,Pe(e,e.H)}function Pe(e,t){if(null!=e.D)throw Error("WatchDog timer not null");e.D=we(B(e.aa,e),t)}function Me(e){e.D&&(i.clearTimeout(e.D),e.D=null)}function Ge(e){0==e.j.I||e.K||Xt(e.j,e)}function Ue(e){Me(e);var t=e.O;t&&"function"==typeof t.dispose&&t.dispose(),e.O=null,ne(e.V),e.g&&(t=e.g,e.g=null,t.abort(),t.dispose())}function He(e,t){try{var n=e.j;if(0!=n.I&&(n.g==e||qe(n.h,e)))if(!e.L&&qe(n.h,e)&&3==n.I){try{var s=n.Ba.g.parse(t)}catch(e){s=null}if(Array.isArray(s)&&3==s.length){var r=s;if(0==r[0]){e:if(!n.v){if(n.g){if(!(n.g.F+3e3<e.F))break e;Yt(n),Ht(n)}Kt(n),ge(18)}}else n.xa=r[1],0<n.xa-n.K&&r[2]<37500&&n.F&&0==n.A&&!n.C&&(n.C=we(B(n.Va,n),6e3));Je(n.h)<=1&&n.ta&&(n.ta=void 0)}else en(n,11)}else if((e.L||n.g==e)&&Yt(n),!I(t))for(r=n.Ba.g.parse(t),t=0;t<r.length;t++){let B=r[t];const l=B[0];if(!(l<=n.K))if(n.K=l,B=B[1],2==n.I)if("c"==B[0]){n.M=B[1],n.ba=B[2];const t=B[3];null!=t&&(n.ka=t,n.j.info("VER="+n.ka));const r=B[4];null!=r&&(n.za=r,n.j.info("SVER="+n.za));const l=B[5];null!=l&&"number"==typeof l&&l>0&&(s=1.5*l,n.O=s,n.j.info("backChannelRequestTimeoutMs_="+s)),s=n;const u=e.g;if(u){const e=u.g?u.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(e){var i=s.h;i.g||-1==e.indexOf("spdy")&&-1==e.indexOf("quic")&&-1==e.indexOf("h2")||(i.j=i.l,i.g=new Set,i.h&&(ze(i,i.h),i.h=null))}if(s.G){const e=u.g?u.g.getResponseHeader("X-HTTP-Session-Id"):null;e&&(s.wa=e,nt(s.J,s.G,e))}}n.I=3,n.l&&n.l.ra(),n.aa&&(n.T=Date.now()-e.F,n.j.info("Handshake RTT: "+n.T+"ms"));var a=e;if((s=n).na=nn(s,s.L?s.ba:null,s.W),a.L){Ke(s.h,a);var o=a,c=s.O;c&&(o.H=c),o.D&&(Me(o),Fe(o)),s.g=a}else zt(s);n.i.length>0&&jt(n)}else"stop"!=B[0]&&"close"!=B[0]||en(n,7);else 3==n.I&&("stop"==B[0]||"close"==B[0]?"stop"==B[0]?en(n,7):Ut(n):"noop"!=B[0]&&n.l&&n.l.qa(B),n.A=0)}fe()}catch(e){}}Oe.prototype.ba=function(e){e=e.target;const t=this.O;t&&3==Ft(e)?t.j():this.Y(e)},Oe.prototype.Y=function(e){try{if(e==this.g)e:{const B=Ft(this.g),c=this.g.ya();this.g.ca();if(!(B<3)&&(3!=B||this.g&&(this.h.h||this.g.la()||Pt(this.g)))){this.K||4!=B||7==c||fe(),Me(this);var t=this.g.ca();this.X=t;var n=function(e){if(!Le(e))return e.g.la();const t=Pt(e.g);if(""===t)return"";let n="";const s=t.length,r=4==Ft(e.g);if(!e.h.i){if("undefined"==typeof TextDecoder)return Ue(e),Ge(e),"";e.h.i=new i.TextDecoder}for(let i=0;i<s;i++)e.h.h=!0,n+=e.h.i.decode(t[i],{stream:!(r&&i==s-1)});return t.length=0,e.h.g+=n,e.C=0,e.h.g}(this);if(this.o=200==t,function(e,t,n,s,r,i,a){e.info(function(){return"XMLHTTP RESP ("+s+") [ attempt "+r+"]: "+t+"\n"+n+"\n"+i+" "+a})}(this.i,this.v,this.B,this.l,this.S,B,t),this.o){if(this.U&&!this.L){t:{if(this.g){var s,r=this.g;if((s=r.g?r.g.getResponseHeader("X-HTTP-Initial-Response"):null)&&!I(s)){var a=s;break t}}a=null}if(!(e=a)){this.o=!1,this.m=3,ge(12),Ue(this),Ge(this);break e}ye(this.i,this.l,e,"Initial handshake response via X-HTTP-Initial-Response"),this.L=!0,He(this,e)}if(this.R){let t;for(e=!0;!this.K&&this.C<n.length;){if(t=xe(this,n),t==Ne){4==B&&(this.m=4,ge(14),e=!1),ye(this.i,this.l,null,"[Incomplete Response]");break}if(t==Se){this.m=4,ge(15),ye(this.i,this.l,n,"[Invalid Chunk]"),e=!1;break}ye(this.i,this.l,t,null),He(this,t)}if(Le(this)&&0!=this.C&&(this.h.g=this.h.g.slice(this.C),this.C=0),4!=B||0!=n.length||this.h.h||(this.m=1,ge(16),e=!1),this.o=this.o&&e,e){if(n.length>0&&!this.W){this.W=!0;var o=this.j;o.g==this&&o.aa&&!o.P&&(o.j.info("Great, no buffering proxy detected. Bytes received: "+n.length),Qt(o),o.P=!0,ge(11))}}else ye(this.i,this.l,n,"[Invalid Chunked Response]"),Ue(this),Ge(this)}else ye(this.i,this.l,n,null),He(this,n);4==B&&Ue(this),this.o&&!this.K&&(4==B?Xt(this.j,this):(this.o=!1,Fe(this)))}else(function(e){const t={};e=(e.g&&Ft(e)>=2&&e.g.getAllResponseHeaders()||"").split("\r\n");for(let s=0;s<e.length;s++){if(I(e[s]))continue;var n=Te(e[s]);const r=n[0];if("string"!=typeof(n=n[1]))continue;n=n.trim();const i=t[r]||[];t[r]=i,i.push(n)}!function(e,t){for(const n in e)t.call(void 0,e[n],n,e)}(t,function(e){return e.join(", ")})})(this.g),400==t&&n.indexOf("Unknown SID")>0?(this.m=3,ge(12)):(this.m=0,ge(13)),Ue(this),Ge(this)}}}catch(e){}},Oe.prototype.cancel=function(){this.K=!0,Ue(this)},Oe.prototype.aa=function(){this.D=null;const e=Date.now();e-this.T>=0?(function(e,t){e.info(function(){return"TIMEOUT: "+t})}(this.i,this.B),2!=this.M&&(fe(),ge(17)),Ue(this),this.m=2,Ge(this)):Pe(this,this.T-e)};var Ve=class{constructor(e,t){this.g=e,this.map=t}};function je(e){this.l=e||10,i.PerformanceNavigationTiming?e=(e=i.performance.getEntriesByType("navigation")).length>0&&("hq"==e[0].nextHopProtocol||"h2"==e[0].nextHopProtocol):e=!!(i.chrome&&i.chrome.loadTimes&&i.chrome.loadTimes()&&i.chrome.loadTimes().wasFetchedViaSpdy),this.j=e?this.l:1,this.g=null,this.j>1&&(this.g=new Set),this.h=null,this.i=[]}function $e(e){return!!e.h||!!e.g&&e.g.size>=e.j}function Je(e){return e.h?1:e.g?e.g.size:0}function qe(e,t){return e.h?e.h==t:!!e.g&&e.g.has(t)}function ze(e,t){e.g?e.g.add(t):e.h=t}function Ke(e,t){e.h&&e.h==t?e.h=null:e.g&&e.g.has(t)&&e.g.delete(t)}function Qe(e){if(null!=e.h)return e.i.concat(e.h.G);if(null!=e.g&&0!==e.g.size){let t=e.i;for(const n of e.g.values())t=t.concat(n.G);return t}return h(e.i)}je.prototype.cancel=function(){if(this.i=Qe(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&0!==this.g.size){for(const e of this.g.values())e.cancel();this.g.clear()}};var We=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function Ye(e){let t;this.g=this.o=this.j="",this.u=null,this.m=this.h="",this.l=!1,e instanceof Ye?(this.l=e.l,Ze(this,e.j),this.o=e.o,this.g=e.g,et(this,e.u),this.h=e.h,tt(this,mt(e.i)),this.m=e.m):e&&(t=String(e).match(We))?(this.l=!1,Ze(this,t[1]||"",!0),this.o=rt(t[2]||""),this.g=rt(t[3]||"",!0),et(this,t[4]),this.h=rt(t[5]||"",!0),tt(this,t[6]||"",!0),this.m=rt(t[7]||"")):(this.l=!1,this.i=new ht(null,this.l))}function Xe(e){return new Ye(e)}function Ze(e,t,n){e.j=n?rt(t,!0):t,e.j&&(e.j=e.j.replace(/:$/,""))}function et(e,t){if(t){if(t=Number(t),isNaN(t)||t<0)throw Error("Bad port number "+t);e.u=t}else e.u=null}function tt(e,t,n){t instanceof ht?(e.i=t,function(e,t){t&&!e.j&&(pt(e),e.i=null,e.g.forEach(function(e,t){const n=t.toLowerCase();t!=n&&(dt(this,t),gt(this,n,e))},e)),e.j=t}(e.i,e.l)):(n||(t=it(t,lt)),e.i=new ht(t,e.l))}function nt(e,t,n){e.i.set(t,n)}function st(e){return nt(e,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),e}function rt(e,t){return e?t?decodeURI(e.replace(/%25/g,"%2525")):decodeURIComponent(e):""}function it(e,t,n){return"string"==typeof e?(e=encodeURI(e).replace(t,at),n&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function at(e){return"%"+((e=e.charCodeAt(0))>>4&15).toString(16)+(15&e).toString(16)}Ye.prototype.toString=function(){const e=[];var t=this.j;t&&e.push(it(t,ot,!0),":");var n=this.g;return(n||"file"==t)&&(e.push("//"),(t=this.o)&&e.push(it(t,ot,!0),"@"),e.push(Ie(n).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.u)&&e.push(":",String(n))),(n=this.h)&&(this.g&&"/"!=n.charAt(0)&&e.push("/"),e.push(it(n,"/"==n.charAt(0)?ct:Bt,!0))),(n=this.i.toString())&&e.push("?",n),(n=this.m)&&e.push("#",it(n,ut)),e.join("")},Ye.prototype.resolve=function(e){const t=Xe(this);let n=!!e.j;n?Ze(t,e.j):n=!!e.o,n?t.o=e.o:n=!!e.g,n?t.g=e.g:n=null!=e.u;var s=e.h;if(n)et(t,e.u);else if(n=!!e.h){if("/"!=s.charAt(0))if(this.g&&!this.h)s="/"+s;else{var r=t.h.lastIndexOf("/");-1!=r&&(s=t.h.slice(0,r+1)+s)}if(".."==(r=s)||"."==r)s="";else if(-1!=r.indexOf("./")||-1!=r.indexOf("/.")){s=0==r.lastIndexOf("/",0),r=r.split("/");const e=[];for(let t=0;t<r.length;){const n=r[t++];"."==n?s&&t==r.length&&e.push(""):".."==n?((e.length>1||1==e.length&&""!=e[0])&&e.pop(),s&&t==r.length&&e.push("")):(e.push(n),s=!0)}s=e.join("/")}else s=r}return n?t.h=s:n=""!==e.i.toString(),n?tt(t,mt(e.i)):n=!!e.m,n&&(t.m=e.m),t};var ot=/[#\/\?@]/g,Bt=/[#\?:]/g,ct=/[#\?]/g,lt=/[#\?@]/g,ut=/#/g;function ht(e,t){this.h=this.g=null,this.i=e||null,this.j=!!t}function pt(e){e.g||(e.g=new Map,e.h=0,e.i&&function(e,t){if(e){e=e.split("&");for(let n=0;n<e.length;n++){const s=e[n].indexOf("=");let r,i=null;s>=0?(r=e[n].substring(0,s),i=e[n].substring(s+1)):r=e[n],t(r,i?decodeURIComponent(i.replace(/\+/g," ")):"")}}}(e.i,function(t,n){e.add(decodeURIComponent(t.replace(/\+/g," ")),n)}))}function dt(e,t){pt(e),t=wt(e,t),e.g.has(t)&&(e.i=null,e.h-=e.g.get(t).length,e.g.delete(t))}function ft(e,t){return pt(e),t=wt(e,t),e.g.has(t)}function Ct(e,t){pt(e);let n=[];if("string"==typeof t)ft(e,t)&&(n=n.concat(e.g.get(wt(e,t))));else for(e=Array.from(e.g.values()),t=0;t<e.length;t++)n=n.concat(e[t]);return n}function gt(e,t,n){dt(e,t),n.length>0&&(e.i=null,e.g.set(wt(e,t),h(n)),e.h+=n.length)}function mt(e){const t=new ht;return t.i=e.i,e.g&&(t.g=new Map(e.g),t.h=e.h),t}function wt(e,t){return t=String(t),e.j&&(t=t.toLowerCase()),t}function Et(e,t,n,s,r){try{r&&(r.onload=null,r.onerror=null,r.onabort=null,r.ontimeout=null),s(n)}catch(e){}}function yt(){this.g=new ie}function Dt(e){this.i=e.Sb||null,this.h=e.ab||!1}function _t(e,t){Q.call(this),this.H=e,this.o=t,this.m=void 0,this.status=this.readyState=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.A=new Headers,this.h=null,this.F="GET",this.D="",this.g=!1,this.B=this.j=this.l=null,this.v=new AbortController}function bt(e){e.j.read().then(e.Ma.bind(e)).catch(e.ga.bind(e))}function vt(e){e.readyState=4,e.l=null,e.j=null,e.B=null,It(e)}function It(e){e.onreadystatechange&&e.onreadystatechange.call(e)}function Tt(e){let t="";return R(e,function(e,n){t+=n,t+=":",t+=e,t+="\r\n"}),t}function Ot(e,t,n){e:{for(s in n){var s=!1;break e}s=!0}s||(n=Tt(n),"string"==typeof e?null!=n&&Ie(n):nt(e,t,n))}function At(e){Q.call(this),this.headers=new Map,this.L=e||null,this.h=!1,this.g=null,this.D="",this.o=0,this.l="",this.j=this.B=this.v=this.A=!1,this.m=null,this.F="",this.H=!1}(e=ht.prototype).add=function(e,t){pt(this),this.i=null,e=wt(this,e);let n=this.g.get(e);return n||this.g.set(e,n=[]),n.push(t),this.h+=1,this},e.forEach=function(e,t){pt(this),this.g.forEach(function(n,s){n.forEach(function(n){e.call(t,n,s,this)},this)},this)},e.set=function(e,t){return pt(this),this.i=null,ft(this,e=wt(this,e))&&(this.h-=this.g.get(e).length),this.g.set(e,[t]),this.h+=1,this},e.get=function(e,t){return e&&(e=Ct(this,e)).length>0?String(e[0]):t},e.toString=function(){if(this.i)return this.i;if(!this.g)return"";const e=[],t=Array.from(this.g.keys());for(let s=0;s<t.length;s++){var n=t[s];const r=Ie(n);n=Ct(this,n);for(let t=0;t<n.length;t++){let s=r;""!==n[t]&&(s+="="+Ie(n[t])),e.push(s)}}return this.i=e.join("&")},l(Dt,ae),Dt.prototype.g=function(){return new _t(this.i,this.h)},l(_t,Q),(e=_t.prototype).open=function(e,t){if(0!=this.readyState)throw this.abort(),Error("Error reopening a connection");this.F=e,this.D=t,this.readyState=1,It(this)},e.send=function(e){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");if(this.v.signal.aborted)throw this.abort(),Error("Request was aborted.");this.g=!0;const t={headers:this.A,method:this.F,credentials:this.m,cache:void 0,signal:this.v.signal};e&&(t.body=e),(this.H||i).fetch(new Request(this.D,t)).then(this.Pa.bind(this),this.ga.bind(this))},e.abort=function(){this.response=this.responseText="",this.A=new Headers,this.status=0,this.v.abort(),this.j&&this.j.cancel("Request was aborted.").catch(()=>{}),this.readyState>=1&&this.g&&4!=this.readyState&&(this.g=!1,vt(this)),this.readyState=0},e.Pa=function(e){if(this.g&&(this.l=e,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=e.headers,this.readyState=2,It(this)),this.g&&(this.readyState=3,It(this),this.g)))if("arraybuffer"===this.responseType)e.arrayBuffer().then(this.Na.bind(this),this.ga.bind(this));else if(void 0!==i.ReadableStream&&"body"in e){if(this.j=e.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.B=new TextDecoder;bt(this)}else e.text().then(this.Oa.bind(this),this.ga.bind(this))},e.Ma=function(e){if(this.g){if(this.o&&e.value)this.response.push(e.value);else if(!this.o){var t=e.value?e.value:new Uint8Array(0);(t=this.B.decode(t,{stream:!e.done}))&&(this.response=this.responseText+=t)}e.done?vt(this):It(this),3==this.readyState&&bt(this)}},e.Oa=function(e){this.g&&(this.response=this.responseText=e,vt(this))},e.Na=function(e){this.g&&(this.response=e,vt(this))},e.ga=function(){this.g&&vt(this)},e.setRequestHeader=function(e,t){this.A.append(e,t)},e.getResponseHeader=function(e){return this.h&&this.h.get(e.toLowerCase())||""},e.getAllResponseHeaders=function(){if(!this.h)return"";const e=[],t=this.h.entries();for(var n=t.next();!n.done;)n=n.value,e.push(n[0]+": "+n[1]),n=t.next();return e.join("\r\n")},Object.defineProperty(_t.prototype,"withCredentials",{get:function(){return"include"===this.m},set:function(e){this.m=e?"include":"same-origin"}}),l(At,Q);var St=/^https?$/i,Nt=["POST","PUT"];function Rt(e,t){e.h=!1,e.g&&(e.j=!0,e.g.abort(),e.j=!1),e.l=t,e.o=5,kt(e),xt(e)}function kt(e){e.A||(e.A=!0,W(e,"complete"),W(e,"error"))}function Lt(e){if(e.h&&void 0!==r)if(e.v&&4==Ft(e))setTimeout(e.Ca.bind(e),0);else if(W(e,"readystatechange"),4==Ft(e)){e.h=!1;try{const r=e.ca();e:switch(r){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var t=!0;break e;default:t=!1}var n;if(!(n=t)){var s;if(s=0===r){let t=String(e.D).match(We)[1]||null;!t&&i.self&&i.self.location&&(t=i.self.location.protocol.slice(0,-1)),s=!St.test(t?t.toLowerCase():"")}n=s}if(n)W(e,"complete"),W(e,"success");else{e.o=6;try{var a=Ft(e)>2?e.g.statusText:""}catch(e){a=""}e.l=a+" ["+e.ca()+"]",kt(e)}}finally{xt(e)}}}function xt(e,t){if(e.g){e.m&&(clearTimeout(e.m),e.m=null);const n=e.g;e.g=null,t||W(e,"ready");try{n.onreadystatechange=null}catch(e){}}}function Ft(e){return e.g?e.g.readyState:0}function Pt(e){try{if(!e.g)return null;if("response"in e.g)return e.g.response;switch(e.F){case"":case"text":return e.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in e.g)return e.g.mozResponseArrayBuffer}return null}catch(e){return null}}function Mt(e,t,n){return n&&n.internalChannelParams&&n.internalChannelParams[e]||t}function Gt(e){this.za=0,this.i=[],this.j=new Ee,this.ba=this.na=this.J=this.W=this.g=this.wa=this.G=this.H=this.u=this.U=this.o=null,this.Ya=this.V=0,this.Sa=Mt("failFast",!1,e),this.F=this.C=this.v=this.m=this.l=null,this.X=!0,this.xa=this.K=-1,this.Y=this.A=this.D=0,this.Qa=Mt("baseRetryDelayMs",5e3,e),this.Za=Mt("retryDelaySeedMs",1e4,e),this.Ta=Mt("forwardChannelMaxRetries",2,e),this.va=Mt("forwardChannelRequestTimeoutMs",2e4,e),this.ma=e&&e.xmlHttpFactory||void 0,this.Ua=e&&e.Rb||void 0,this.Aa=e&&e.useFetchStreams||!1,this.O=void 0,this.L=e&&e.supportsCrossDomainXhr||!1,this.M="",this.h=new je(e&&e.concurrentRequestLimit),this.Ba=new yt,this.S=e&&e.fastHandshake||!1,this.R=e&&e.encodeInitMessageHeaders||!1,this.S&&this.R&&(this.R=!1),this.Ra=e&&e.Pb||!1,e&&e.ua&&this.j.ua(),e&&e.forceLongPolling&&(this.X=!1),this.aa=!this.S&&this.X&&e&&e.detectBufferingProxy||!1,this.ia=void 0,e&&e.longPollingTimeout&&e.longPollingTimeout>0&&(this.ia=e.longPollingTimeout),this.ta=void 0,this.T=0,this.P=!1,this.ja=this.B=null}function Ut(e){if(Vt(e),3==e.I){var t=e.V++,n=Xe(e.J);if(nt(n,"SID",e.M),nt(n,"RID",t),nt(n,"TYPE","terminate"),Jt(e,n),(t=new Oe(e,e.j,t)).M=2,t.A=st(Xe(n)),n=!1,i.navigator&&i.navigator.sendBeacon)try{n=i.navigator.sendBeacon(t.A.toString(),"")}catch(e){}!n&&i.Image&&((new Image).src=t.A,n=!0),n||(t.g=sn(t.j,null),t.g.ea(t.A)),t.F=Date.now(),Fe(t)}tn(e)}function Ht(e){e.g&&(Qt(e),e.g.cancel(),e.g=null)}function Vt(e){Ht(e),e.v&&(i.clearTimeout(e.v),e.v=null),Yt(e),e.h.cancel(),e.m&&("number"==typeof e.m&&i.clearTimeout(e.m),e.m=null)}function jt(e){if(!$e(e.h)&&!e.m){e.m=!0;var t=e.Ea;m||y(),w||(m(),w=!0),E.add(t,e),e.D=0}}function $t(e,t){var n;n=t?t.l:e.V++;const s=Xe(e.J);nt(s,"SID",e.M),nt(s,"RID",n),nt(s,"AID",e.K),Jt(e,s),e.u&&e.o&&Ot(s,e.u,e.o),n=new Oe(e,e.j,n,e.D+1),null===e.u&&(n.J=e.o),t&&(e.i=t.G.concat(e.i)),t=qt(e,n,1e3),n.H=Math.round(.5*e.va)+Math.round(.5*e.va*Math.random()),ze(e.h,n),Re(n,s,t)}function Jt(e,t){e.H&&R(e.H,function(e,n){nt(t,n,e)}),e.l&&R({},function(e,n){nt(t,n,e)})}function qt(e,t,n){n=Math.min(e.i.length,n);const s=e.l?B(e.l.Ka,e.l,e):null;e:{var r=e.i;let t=-1;for(;;){const e=["count="+n];-1==t?n>0?(t=r[0].g,e.push("ofs="+t)):t=0:e.push("ofs="+t);let B=!0;for(let c=0;c<n;c++){var i=r[c].g;const n=r[c].map;if((i-=t)<0)t=Math.max(0,r[c].g-100),B=!1;else try{i="req"+i+"_"||"";try{var o=n instanceof Map?n:Object.entries(n);for(const[t,n]of o){let s=n;a(n)&&(s=se(n)),e.push(i+t+"="+encodeURIComponent(s))}}catch(t){throw e.push(i+"type="+encodeURIComponent("_badmap")),t}}catch(e){s&&s(n)}}if(B){o=e.join("&");break e}}o=void 0}return e=e.i.splice(0,n),t.G=e,o}function zt(e){if(!e.g&&!e.v){e.Y=1;var t=e.Da;m||y(),w||(m(),w=!0),E.add(t,e),e.A=0}}function Kt(e){return!(e.g||e.v||e.A>=3)&&(e.Y++,e.v=we(B(e.Da,e),Zt(e,e.A)),e.A++,!0)}function Qt(e){null!=e.B&&(i.clearTimeout(e.B),e.B=null)}function Wt(e){e.g=new Oe(e,e.j,"rpc",e.Y),null===e.u&&(e.g.J=e.o),e.g.P=0;var t=Xe(e.na);nt(t,"RID","rpc"),nt(t,"SID",e.M),nt(t,"AID",e.K),nt(t,"CI",e.F?"0":"1"),!e.F&&e.ia&&nt(t,"TO",e.ia),nt(t,"TYPE","xmlhttp"),Jt(e,t),e.u&&e.o&&Ot(t,e.u,e.o),e.O&&(e.g.H=e.O);var n=e.g;e=e.ba,n.M=1,n.A=st(Xe(t)),n.u=null,n.R=!0,ke(n,e)}function Yt(e){null!=e.C&&(i.clearTimeout(e.C),e.C=null)}function Xt(e,t){var n=null;if(e.g==t){Yt(e),Qt(e),e.g=null;var s=2}else{if(!qe(e.h,t))return;n=t.G,Ke(e.h,t),s=1}if(0!=e.I)if(t.o)if(1==s){n=t.u?t.u.length:0,t=Date.now()-t.F;var r=e.D;W(s=pe(),new me(s,n)),jt(e)}else zt(e);else if(3==(r=t.m)||0==r&&t.X>0||!(1==s&&function(e,t){return!(Je(e.h)>=e.h.j-(e.m?1:0)||(e.m?(e.i=t.G.concat(e.i),0):1==e.I||2==e.I||e.D>=(e.Sa?0:e.Ta)||(e.m=we(B(e.Ea,e,t),Zt(e,e.D)),e.D++,0)))}(e,t)||2==s&&Kt(e)))switch(n&&n.length>0&&(t=e.h,t.i=t.i.concat(n)),r){case 1:en(e,5);break;case 4:en(e,10);break;case 3:en(e,6);break;default:en(e,2)}}function Zt(e,t){let n=e.Qa+Math.floor(Math.random()*e.Za);return e.isActive()||(n*=2),n*t}function en(e,t){if(e.j.info("Error code "+t),2==t){var n=B(e.bb,e),s=e.Ua;const t=!s;s=new Ye(s||"//www.google.com/images/cleardot.gif"),i.location&&"http"==i.location.protocol||Ze(s,"https"),st(s),t?function(e,t){const n=new Ee;if(i.Image){const s=new Image;s.onload=c(Et,n,"TestLoadImage: loaded",!0,t,s),s.onerror=c(Et,n,"TestLoadImage: error",!1,t,s),s.onabort=c(Et,n,"TestLoadImage: abort",!1,t,s),s.ontimeout=c(Et,n,"TestLoadImage: timeout",!1,t,s),i.setTimeout(function(){s.ontimeout&&s.ontimeout()},1e4),s.src=e}else t(!1)}(s.toString(),n):function(e,t){new Ee;const n=new AbortController,s=setTimeout(()=>{n.abort(),Et(0,0,!1,t)},1e4);fetch(e,{signal:n.signal}).then(e=>{clearTimeout(s),e.ok?Et(0,0,!0,t):Et(0,0,!1,t)}).catch(()=>{clearTimeout(s),Et(0,0,!1,t)})}(s.toString(),n)}else ge(2);e.I=0,e.l&&e.l.pa(t),tn(e),Vt(e)}function tn(e){if(e.I=0,e.ja=[],e.l){const t=Qe(e.h);0==t.length&&0==e.i.length||(p(e.ja,t),p(e.ja,e.i),e.h.i.length=0,h(e.i),e.i.length=0),e.l.oa()}}function nn(e,t,n){var s=n instanceof Ye?Xe(n):new Ye(n);if(""!=s.g)t&&(s.g=t+"."+s.g),et(s,s.u);else{var r=i.location;s=r.protocol,t=t?t+"."+r.hostname:r.hostname,r=+r.port;const e=new Ye(null);s&&Ze(e,s),t&&(e.g=t),r&&et(e,r),n&&(e.h=n),s=e}return n=e.G,t=e.wa,n&&t&&nt(s,n,t),nt(s,"VER",e.ka),Jt(e,s),s}function sn(e,t,n){if(t&&!e.L)throw Error("Can't create secondary domain capable XhrIo object.");return(t=e.Aa&&!e.ma?new At(new Dt({ab:n})):new At(e.ma)).Fa(e.L),t}function rn(){}function an(){}function on(e,t){Q.call(this),this.g=new Gt(t),this.l=e,this.h=t&&t.messageUrlParams||null,e=t&&t.messageHeaders||null,t&&t.clientProtocolHeaderRequired&&(e?e["X-Client-Protocol"]="webchannel":e={"X-Client-Protocol":"webchannel"}),this.g.o=e,e=t&&t.initMessageHeaders||null,t&&t.messageContentType&&(e?e["X-WebChannel-Content-Type"]=t.messageContentType:e={"X-WebChannel-Content-Type":t.messageContentType}),t&&t.sa&&(e?e["X-WebChannel-Client-Profile"]=t.sa:e={"X-WebChannel-Client-Profile":t.sa}),this.g.U=e,(e=t&&t.Qb)&&!I(e)&&(this.g.u=e),this.A=t&&t.supportsCrossDomainXhr||!1,this.v=t&&t.sendRawJson||!1,(t=t&&t.httpSessionIdParam)&&!I(t)&&(this.g.G=t,null!==(e=this.h)&&t in e&&(t in(e=this.h)&&delete e[t])),this.j=new ln(this)}function Bn(e){ce.call(this),e.__headers__&&(this.headers=e.__headers__,this.statusCode=e.__status__,delete e.__headers__,delete e.__status__);var t=e.__sm__;if(t){e:{for(const n in t){e=n;break e}e=void 0}(this.i=e)&&(e=this.i,t=null!==t&&e in t?t[e]:void 0),this.data=t}else this.data=e}function cn(){le.call(this),this.status=1}function ln(e){this.g=e}(e=At.prototype).Fa=function(e){this.H=e},e.ea=function(e,t,n,s){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+e);t=t?t.toUpperCase():"GET",this.D=e,this.l="",this.o=0,this.A=!1,this.h=!0,this.g=this.L?this.L.g():De.g(),this.g.onreadystatechange=u(B(this.Ca,this));try{this.B=!0,this.g.open(t,String(e),!0),this.B=!1}catch(e){return void Rt(this,e)}if(e=n||"",n=new Map(this.headers),s)if(Object.getPrototypeOf(s)===Object.prototype)for(var r in s)n.set(r,s[r]);else{if("function"!=typeof s.keys||"function"!=typeof s.get)throw Error("Unknown input type for opt_headers: "+String(s));for(const e of s.keys())n.set(e,s.get(e))}s=Array.from(n.keys()).find(e=>"content-type"==e.toLowerCase()),r=i.FormData&&e instanceof i.FormData,!(Array.prototype.indexOf.call(Nt,t,void 0)>=0)||s||r||n.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[e,t]of n)this.g.setRequestHeader(e,t);this.F&&(this.g.responseType=this.F),"withCredentials"in this.g&&this.g.withCredentials!==this.H&&(this.g.withCredentials=this.H);try{this.m&&(clearTimeout(this.m),this.m=null),this.v=!0,this.g.send(e),this.v=!1}catch(e){Rt(this,e)}},e.abort=function(e){this.g&&this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1,this.o=e||7,W(this,"complete"),W(this,"abort"),xt(this))},e.N=function(){this.g&&(this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1),xt(this,!0)),At.Z.N.call(this)},e.Ca=function(){this.u||(this.B||this.v||this.j?Lt(this):this.Xa())},e.Xa=function(){Lt(this)},e.isActive=function(){return!!this.g},e.ca=function(){try{return Ft(this)>2?this.g.status:-1}catch(e){return-1}},e.la=function(){try{return this.g?this.g.responseText:""}catch(e){return""}},e.La=function(e){if(this.g){var t=this.g.responseText;return e&&0==t.indexOf(e)&&(t=t.substring(e.length)),re(t)}},e.ya=function(){return this.o},e.Ha=function(){return"string"==typeof this.l?this.l:String(this.l)},(e=Gt.prototype).ka=8,e.I=1,e.connect=function(e,t,n,s){ge(0),this.W=e,this.H=t||{},n&&void 0!==s&&(this.H.OSID=n,this.H.OAID=s),this.F=this.X,this.J=nn(this,null,this.W),jt(this)},e.Ea=function(e){if(this.m)if(this.m=null,1==this.I){if(!e){this.V=Math.floor(1e5*Math.random()),e=this.V++;const r=new Oe(this,this.j,e);let i=this.o;if(this.U&&(i?(i=k(i),x(i,this.U)):i=this.U),null!==this.u||this.R||(r.J=i,i=null),this.S)e:{for(var t=0,n=0;n<this.i.length;n++){var s=this.i[n];if(void 0===(s="__data__"in s.map&&"string"==typeof(s=s.map.__data__)?s.length:void 0))break;if((t+=s)>4096){t=n;break e}if(4096===t||n===this.i.length-1){t=n+1;break e}}t=1e3}else t=1e3;t=qt(this,r,t),nt(n=Xe(this.J),"RID",e),nt(n,"CVER",22),this.G&&nt(n,"X-HTTP-Session-Id",this.G),Jt(this,n),i&&(this.R?t="headers="+Ie(Tt(i))+"&"+t:this.u&&Ot(n,this.u,i)),ze(this.h,r),this.Ra&&nt(n,"TYPE","init"),this.S?(nt(n,"$req",t),nt(n,"SID","null"),r.U=!0,Re(r,n,null)):Re(r,n,t),this.I=2}}else 3==this.I&&(e?$t(this,e):0==this.i.length||$e(this.h)||$t(this))},e.Da=function(){if(this.v=null,Wt(this),this.aa&&!(this.P||null==this.g||this.T<=0)){var e=4*this.T;this.j.info("BP detection timer enabled: "+e),this.B=we(B(this.Wa,this),e)}},e.Wa=function(){this.B&&(this.B=null,this.j.info("BP detection timeout reached."),this.j.info("Buffering proxy detected and switch to long-polling!"),this.F=!1,this.P=!0,ge(10),Ht(this),Wt(this))},e.Va=function(){null!=this.C&&(this.C=null,Ht(this),Kt(this),ge(19))},e.bb=function(e){e?(this.j.info("Successfully pinged google.com"),ge(2)):(this.j.info("Failed to ping google.com"),ge(1))},e.isActive=function(){return!!this.l&&this.l.isActive(this)},(e=rn.prototype).ra=function(){},e.qa=function(){},e.pa=function(){},e.oa=function(){},e.isActive=function(){return!0},e.Ka=function(){},an.prototype.g=function(e,t){return new on(e,t)},l(on,Q),on.prototype.m=function(){this.g.l=this.j,this.A&&(this.g.L=!0),this.g.connect(this.l,this.h||void 0)},on.prototype.close=function(){Ut(this.g)},on.prototype.o=function(e){var t=this.g;if("string"==typeof e){var n={};n.__data__=e,e=n}else this.v&&((n={}).__data__=se(e),e=n);t.i.push(new Ve(t.Ya++,e)),3==t.I&&jt(t)},on.prototype.N=function(){this.g.l=null,delete this.j,Ut(this.g),delete this.g,on.Z.N.call(this)},l(Bn,ce),l(cn,le),l(ln,rn),ln.prototype.ra=function(){W(this.g,"a")},ln.prototype.qa=function(e){W(this.g,new Bn(e))},ln.prototype.pa=function(e){W(this.g,new cn)},ln.prototype.oa=function(){W(this.g,"b")},an.prototype.createWebChannel=an.prototype.g,on.prototype.send=on.prototype.o,on.prototype.open=on.prototype.m,on.prototype.close=on.prototype.close,tB=function(){return new an},eB=function(){return pe()},Zo=ue,Xo={jb:0,mb:1,nb:2,Hb:3,Mb:4,Jb:5,Kb:6,Ib:7,Gb:8,Lb:9,PROXY:10,NOPROXY:11,Eb:12,Ab:13,Bb:14,zb:15,Cb:16,Db:17,fb:18,eb:19,gb:20},_e.NO_ERROR=0,_e.TIMEOUT=8,_e.HTTP_ERROR=6,Yo=_e,be.COMPLETE="complete",Wo=be,oe.EventType=Be,Be.OPEN="a",Be.CLOSE="b",Be.ERROR="c",Be.MESSAGE="d",Q.prototype.listen=Q.prototype.J,Qo=oe,At.prototype.listenOnce=At.prototype.K,At.prototype.getLastError=At.prototype.Ha,At.prototype.getLastErrorCode=At.prototype.ya,At.prototype.getStatus=At.prototype.ca,At.prototype.getResponseJson=At.prototype.La,At.prototype.getResponseText=At.prototype.la,At.prototype.send=At.prototype.ea,At.prototype.setWithCredentials=At.prototype.Fa,Ko=At}).apply(void 0!==nB?nB:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var sB=class e{static FOLD_CASE=1;static LITERAL=2;static CLASS_NL=4;static DOT_NL=8;static ONE_LINE=16;static NON_GREEDY=32;static PERL_X=64;static UNICODE_GROUPS=128;static WAS_DOLLAR=256;static LOOKBEHIND=512;static MATCH_NL=e.CLASS_NL|e.DOT_NL;static PERL=e.CLASS_NL|e.ONE_LINE|e.PERL_X|e.UNICODE_GROUPS;static POSIX=0;static UNANCHORED=0;static ANCHOR_START=1;static ANCHOR_BOTH=2};const rB=1,iB=2,aB=4,oB=8,BB=16,cB=512,lB=128,uB=new Int32Array(lB),hB=new Int32Array(lB),pB=65535;for(let e=0;e<lB;e++)uB[e]=e>=97&&e<=122?e-32:e,hB[e]=e>=65&&e<=90?e+32:e;var dB=class{static CODES=Object.freeze({"":7,"\b":8,"\t":9,"\n":10,"\v":11,"\f":12,"\r":13," ":32,'"':34,$:36,"&":38,"'":39,"(":40,")":41,"*":42,"+":43,"-":45,".":46,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,":":58,"<":60,">":62,"?":63,A:65,B:66,C:67,F:70,P:80,Q:81,U:85,Z:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,a:97,b:98,f:102,i:105,m:109,n:110,r:114,s:115,t:116,v:118,x:120,z:122,"{":123,"|":124,"}":125});static toUpperCase(e){if(e<lB)return uB[e];const t=String.fromCodePoint(e).toUpperCase(),n=t.codePointAt(0)>pB?2:1;if(t.length>n)return e;const s=String.fromCodePoint(t.codePointAt(0)).toLowerCase(),r=s.codePointAt(0)>pB?2:1;return s.length>r||s.codePointAt(0)!==e?e:t.codePointAt(0)}static toLowerCase(e){if(e<lB)return hB[e];const t=String.fromCodePoint(e).toLowerCase(),n=t.codePointAt(0)>pB?2:1;if(t.length>n)return e;const s=String.fromCodePoint(t.codePointAt(0)).toUpperCase(),r=s.codePointAt(0)>pB?2:1;return s.length>r||s.codePointAt(0)!==e?e:t.codePointAt(0)}},fB=class{constructor(e,t=!1){this.data=e,this.isStride1=t,this.SIZE=t?2:3}getLo(e){return this.data[e*this.SIZE]}getHi(e){return this.data[e*this.SIZE+1]}getStride(e){return this.isStride1?1:this.data[e*this.SIZE+2]}get length(){return this.data.length/this.SIZE}};const CB=new Uint8Array(256);for(let e=0;e<64;e++)CB["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-".charCodeAt(e)]=e;const gB=e=>{const t=[];let n=0,s=0;for(let r=0;r<e.length;r++){const i=CB[e.charCodeAt(r)];n|=(31&i)<<s,32&i?s+=5:(t.push(n),n=0,s=0)}return t},mB=(e,t)=>{const n=gB(e),s=t?n.length/2:n.length/3,r=new Uint32Array(3*s);let i=0,a=0;for(let e=0;e<s;e++)i+=n[a++],r[3*e]=i,i+=n[a++],r[3*e+1]=i,r[3*e+2]=t?1:n[a++];return r};var wB=class{constructor(e){this.initializer=e,this.cache=new Map}has(e){return e in this.initializer}get(e){if(this.cache.has(e))return this.cache.get(e);const t=this.initializer[e],n=t?t():null;return this.cache.set(e,n),n}},EB=class{static _CASE_ORBIT=null;static get CASE_ORBIT(){return this._CASE_ORBIT||(this._CASE_ORBIT=(e=>{const t=gB(e),n=new Map;let s=0;for(let e=0;e<t.length;e+=2){s+=t[e];const r=t[e+1],i=r>>>1^-(1&r);n.set(s,s+i)}return n})("rCgCIgCY+rQI4QiCuuBLgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCCgCBgCBgCBgCBgCBgCBgCB+7OB-BB-BB-BB-BB-BBskQB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BC-BB-BB-BB-BB-BB-BB-BByHBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBDCBBBCBBBCBBCCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBCCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBxHBCBBBCBBBCBBB3SBmMBkNBCBBBCBBB8MBCBBB6MB6MBCBBC+EB0MB2MBCBBB6MB+MBiGBmNBiNBCBBBmKBikzCBmNBqNBkIBsNBCBBBCBBBCBBB0NBCBBB0NDCBBB0NBCBBByNByNBCBBBCBBB2NBCBBDCBBCwDFCBCBDBCBCBDBCBCBDBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBB9EBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBCCBCBDBCBBBhGBvDBCBBBCB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r3ByBB+EVB75CfBhsVfBhCYBoqZZBbZBbZBbCCBGDBDDBCBCHBbZBbBBCDBDHBCGBcBBCDBCEBCEEBFBcZBbZBbZBbZBbZBbZBfYBiBYBiBYBiBYBiBYBiB2pE2pEBgBBvgCZBHZBHZB",!1)),White_Space:()=>new fB(mB("JEBTlDlDbgvFgvFgsCKBeBBGwBwBh9DAB",!1))});static SCRIPTS=new wB({Adlam:()=>new fB(mB("go6DrCFJFB",!0)),Ahom:()=>new fB(mB("g4lCaDOFW",!0)),Anatolian_Hieroglyphs:()=>new fB(mB("ggxCmS",!0)),Arabic:()=>new fB(mB("gwBEBCFBCNBCCBCfBCJBMZBCrDBChBBxCvBBxHhBBGqCBCcBxy8BtPBDvEBhBPBxDEBCmEBk7DeBkCFBJIBiBFBh43BDBCaBCBBCDDCJBCDBCCCHFFCECBBBCBBCDDCICBCCDDBCGBCDBCDBCCCBIBCQBGCBCEBCQB1BBB",!1)),Armenian:()=>new fB(mB("xpBlBDxBDCks9BE",!0)),Avestan:()=>new fB(mB("g4iC1BEG",!0)),Balinese:()=>new fB(mB("g4GsCCxB",!0)),Bamum:()=>new fB(mB("g1pB3CpowB4R",!0)),Bassa_Vah:()=>new fB(mB("w26CdDF",!0)),Batak:()=>new fB(mB("g+GzBJD",!0)),Bengali:()=>new fB(mB("gsCDBCHBDBBDVBCGBCEEBCBDIBDBBDDBJFFBCCBDBDYB",!1)),Beria_Erfe:()=>new fB(mB("g17CYDY",!0)),Bhaiksuki:()=>new fB(mB("ggnCICsBCNLc",!0)),Bopomofo:()=>new fB(mB("qXB6wLqBxDf",!0)),Brahmi:()=>new fB(mB("ggkCtCFjBKA",!0)),Braille:()=>new fB(mB("ggK-H",!0)),Buginese:()=>new fB(mB("gwGbDB",!0)),Buhid:()=>new fB(mB("g6FT",!0)),Canadian_Aboriginal:()=>new fB(mB("ggF-TxRlC7tgCP",!0)),Carian:()=>new fB(mB("g1gCwB",!0)),Caucasian_Albanian:()=>new fB(mB("wphCzBMA",!0)),Chakma:()=>new fB(mB("gokC0BCR",!0)),Cham:()=>new fB(mB("gwqB2BKNDJDD",!0)),Cherokee:()=>new fB(mB("g9E1CDFz7lBvC",!0)),Chorasmian:()=>new fB(mB("w9jCb",!0)),Common:()=>new fB(mB("AgCBbFBbuBBCOBCEBYgBgBiOmBBGEBDTB1DKKHCC+THHPEEhB9E9ElQiEiEB6mB6mB2MDBjJwvBwvBBBBoCBBsGBBCumBumBOIIBCBCFBCCBDmYmYBKBD2CBCKBEKBCOBShBB-BlBBCCBDFBCaBCQBqBCBF5UBXKBW-cBhIzTBDpEBhQ9CBzMUBCCCBXBQHBFDB8CBBE7C7CB0E0EBOBhBlBBKxBxBB+BBgBwCBwB5C5CBmFBhuG-BBhoWhBBnDCBmFJB1HhFhFsMPPBzuUzuUBxGxGBIBXiBBCSBCDB0ECCBeBbFBbKBLuBuBBhChCBFBCGBLEBjICBFsBBEIBxCMB0BsBBlHaBltuBDB96D8HBEzNBHWBQQBgDzDB9B1HBLmBBD9BBEQBJBBIdBF8BB2GTBNTBN2CBKYBoE0CBCmCBCBBDDDBDDBCBCLBCCCBFBCgCBCDBDHBCGBCbBCDBCEBCEEBFBCzKBDjJBDxBByjFjCBtC8BBjWrBBFjDBNOBDOBCOBCkBBLtFB5BZBCBBOrBBFIBIBBPFB7E4eBEQBEMBE5GBHLBFQQBKBF3BBJJBHnBBJdBDLBFBBPIBoB3KBJNBDMBEKBE4BBCFFBOBDLBFJBIyEBCmDBnghYffB+CB",!1)),Coptic:()=>new fB(mB("ifNxkKzDGG",!0)),Cuneiform:()=>new fB(mB("ggoC5cnDuDCEMjG",!0)),Cypriot:()=>new fB(mB("ggiCFBDCCBqBBCBBEDD",!1)),Cypro_Minoan:()=>new fB(mB("w8rCiD",!0)),Cyrillic:()=>new fB(mB("ggBkEBDoFBx6FKBhFtCtCojEfBhie-CBv8VBBhw4B9BBiBAB",!1)),Deseret:()=>new fB(mB("gghCvC",!0)),Devanagari:()=>new fB(mB("goCwCFODZh7nBfhwcJ",!0)),Dives_Akuru:()=>new fB(mB("gomCGBDDDBGBCBBCdBCBBDLBKJB",!1)),Dogra:()=>new fB(mB("ggmC7B",!0)),Duployan:()=>new fB(mB("ggvDqDGMEIIJDD",!0)),Egyptian_Hieroglyphs:()=>new fB(mB("ggsC1iBL68D",!0)),Elbasan:()=>new fB(mB("gohCnB",!0)),Elymaic:()=>new fB(mB("g-jCW",!0)),Ethiopic:()=>new fB(mB("gwEoCBCDBDGBCCCBCBDoBBCDBDgBBCDBDGBCCCBCBDOBC4BBCDBDiCBDfBEZBnvGWBKGBCGBCGBCGBCGBCGBCGBCGBjpfFBDFBDFBKGBCGBylvCGBCDBCBBCOB",!1)),Garay:()=>new fB(mB("gqjClBEcJB",!0)),Georgian:()=>new fB(mB("glElBBCGGDqBBCDBx8CqBBDCBhiElBBCGG",!1)),Glagolitic:()=>new fB(mB("ggL-Ch9sDGCQDGCBCE",!0)),Gothic:()=>new fB(mB("w5gCa",!0)),Grantha:()=>new fB(mB("g4kCDBCHBDBBDVBCGBCBBCEBDIBDBBDCBDHHGGBDGBEEB",!1)),Greek:()=>new fB(mB("wbDBCCBDDBCFFCCCBBBCCCBSBC+BBPPBnpGEBzBEBFEB1ChKhKBUBDFBDlBBDFBDHBCGCBdBD0BBCOBCNBDFBCSBDCBCIBoJ-xiB-xiB7uVuCBSgj0Bgj0BBkCB",!1)),Gujarati:()=>new fB(mB("h0CCBCIBCCBCVBCGBCBBCEBDJBCCBCCBDQQBCBDLBIGB",!1)),Gunjala_Gondi:()=>new fB(mB("grnCFCBCkBCBCFIJ",!0)),Gurmukhi:()=>new fB(mB("hwCCBCFBFBBDVBCGBCBBCBBCBBDCCBDBFBBDCBEIIBCBCIIBPB",!1)),Gurung_Khema:()=>new fB(mB("go4C5B",!0)),Han:()=>new fB(mB("g0LZBC4CBN1GBwBCCaIBPDBle-tGBhC-vUBhoWtLBDpDBpodBBNGBqgkB-2pBBhB9oEBDt0FBDwpHBQtTBjtC9QBjvBq6EBGppIB",!1)),Hangul:()=>new fB(mB("goE-HvxHBiI9CyDeiCei3dckUj9KNWFwBl9JeEFDFDFDC",!0)),Hanifi_Rohingya:()=>new fB(mB("gojCnBJJ",!0)),Hanunoo:()=>new fB(mB("g5FU",!0)),Hatran:()=>new fB(mB("gniCSCBGE",!0)),Hebrew:()=>new fB(mB("xsB2BBJaBFFBpp9BZBCEBCCCBCCBCCBIB",!1)),Hiragana:()=>new fB(mB("hiM1CBHCBi7-C+IBTeeBBBulQAB",!1)),Imperial_Aramaic:()=>new fB(mB("giiCVCI",!0)),Inherited:()=>new fB(mB("gYvDB2IBBlOKBbhXhXBCB8qEtBBDLBlPCBCMBCGBFHHEBBnG-BBtQBBjGgBB65DDBsDBBmrzBPBRNBwejHjH7iEl+uBl+uBBsBBDWBhRCBSHBDGBfDBz6rYvHB",!1)),Inscriptional_Pahlavi:()=>new fB(mB("g7iCSGH",!0)),Inscriptional_Parthian:()=>new fB(mB("g6iCVDH",!0)),Javanese:()=>new fB(mB("gsqBtCDJFB",!0)),Kaithi:()=>new fB(mB("gkkCiCLA",!0)),Kannada:()=>new fB(mB("gkDMCCCWCJCEDICCCDIBGCCDDJCC",!0)),Katakana:()=>new fB(mB("hlM5CBDCBxHPBxGuBBC3CBvgzBJBCsBBzisBDBCGBCBBCgJgJBBBzBPPBCB",!1)),Kawi:()=>new fB(mB("g4nCQCoBEc",!0)),Kayah_Li:()=>new fB(mB("goqBtBCA",!0)),Kharoshthi:()=>new fB(mB("gwiCDCBGHCCCcDCFJII",!0)),Khitan_Small_Script:()=>new fB(mB("k-7C84G84GB0OBqBAB",!1)),Khmer:()=>new fB(mB("g8F9CDJHJnPf",!0)),Khojki:()=>new fB(mB("gwkCRCuB",!0)),Khudawadi:()=>new fB(mB("w1kC6BGJ",!0)),Kirat_Rai:()=>new fB(mB("gq7C5B",!0)),Lao:()=>new fB(mB("h0DBBCCCBDBCXBCCCBVBDEBCCCBFBCJBDDB",!1)),Latin:()=>new fB(mB("hCZBHZBwBQQGWBCeBCgOBoBEB8wGlBBHwBBGDBGMBClCBiC-HByLOORMBuEBBHccSoBB42CfBj1elDBExCBVOBxZqBBCIBCDB38TGB7gBZBHZBmhCFBCpBBCIBm61BeBHFB",!1)),Lepcha:()=>new fB(mB("ggH3BEOEC",!0)),Limbu:()=>new fB(mB("goGeBCLBFLBFEEBKB",!1)),Linear_A:()=>new fB(mB("gwhC2JKVLH",!0)),Linear_B:()=>new fB(mB("gggCLCZCSCBCODNjB6D",!0)),Lisu:()=>new fB(mB("wmpBvBx1eA",!0)),Lycian:()=>new fB(mB("g0gCc",!0)),Lydian:()=>new fB(mB("gpiCZGA",!0)),Mahajani:()=>new fB(mB("wqkCmB",!0)),Makasar:()=>new fB(mB("g3nCY",!0)),Malayalam:()=>new fB(mB("goDMCCCyBCCCFFPDZ",!0)),Mandaic:()=>new fB(mB("giCbDA",!0)),Manichaean:()=>new fB(mB("g2iCmBFL",!0)),Marchen:()=>new fB(mB("wjnCfDVCN",!0)),Masaram_Gondi:()=>new fB(mB("gonCGBCBBCrBBECCBCCBHBJJB",!1)),Medefaidrin:()=>new fB(mB("gy7C6C",!0)),Meetei_Mayek:()=>new fB(mB("g3qBWqGtBDJ",!0)),Mende_Kikakui:()=>new fB(mB("gg6DkGDP",!0)),Meroitic_Cursive:()=>new fB(mB("gtiCXFTDtB",!0)),Meroitic_Hieroglyphs:()=>new fB(mB("gsiCf",!0)),Miao:()=>new fB(mB("g47CqCF4BIQ",!0)),Modi:()=>new fB(mB("gwlCkCMJ",!0)),Mongolian:()=>new fB(mB("ggGBBDCCBSBH4CBIqBB2t-BMB",!1)),Mro:()=>new fB(mB("gy6CeCJFB",!0)),Multani:()=>new fB(mB("g0kCGBCCCBCBCOBCKB",!1)),Myanmar:()=>new fB(mB("ggE-EhqmBeiDfxibT",!0)),Nabataean:()=>new fB(mB("gkiCeJI",!0)),Nag_Mundari:()=>new fB(mB("wm5DpB",!0)),Nandinagari:()=>new fB(mB("gtmCHDtBDK",!0)),New_Tai_Lue:()=>new fB(mB("gsGrBFZHKEB",!0)),Newa:()=>new fB(mB("gglC7CCE",!0)),Nko:()=>new fB(mB("g+B6BDC",!0)),Nushu:()=>new fB(mB("h-7CvsQvsQBqMB",!1)),Nyiakeng_Puachue_Hmong:()=>new fB(mB("go4DsBENDJFB",!0)),Ogham:()=>new fB(mB("g0Fc",!0)),Ol_Chiki:()=>new fB(mB("wiHvB",!0)),Ol_Onal:()=>new fB(mB("wu5DqBFA",!0)),Old_Hungarian:()=>new fB(mB("gkjCyBOyBIF",!0)),Old_Italic:()=>new fB(mB("g4gCjBKC",!0)),Old_North_Arabian:()=>new fB(mB("g0iCf",!0)),Old_Permic:()=>new fB(mB("w6gCqB",!0)),Old_Persian:()=>new fB(mB("g9gCjBFN",!0)),Old_Sogdian:()=>new fB(mB("g4jCnB",!0)),Old_South_Arabian:()=>new fB(mB("gziCf",!0)),Old_Turkic:()=>new fB(mB("ggjCoC",!0)),Old_Uyghur:()=>new fB(mB("w7jCZ",!0)),Oriya:()=>new fB(mB("h4CCCHDBDVCGCBCEDIDBDCICFBCEDR",!0)),Osage:()=>new fB(mB("wlhCjBFjB",!0)),Osmanya:()=>new fB(mB("gkhCdDJ",!0)),Pahawh_Hmong:()=>new fB(mB("g46ClCLJCGCUGS",!0)),Palmyrene:()=>new fB(mB("gjiCf",!0)),Pau_Cin_Hau:()=>new fB(mB("g2mC4B",!0)),Phags_Pa:()=>new fB(mB("giqB3B",!0)),Phoenician:()=>new fB(mB("goiCbEA",!0)),Psalter_Pahlavi:()=>new fB(mB("g8iCRIDNG",!0)),Rejang:()=>new fB(mB("wpqBjBMA",!0)),Runic:()=>new fB(mB("g1FqCEK",!0)),Samaritan:()=>new fB(mB("ggCtBDO",!0)),Saurashtra:()=>new fB(mB("gkqBlCJL",!0)),Sharada:()=>new fB(mB("gskC-ChsCH",!0)),Shavian:()=>new fB(mB("wihCvB",!0)),Siddham:()=>new fB(mB("gslC1BDlB",!0)),Sidetic:()=>new fB(mB("gqiCZ",!0)),SignWriting:()=>new fB(mB("gg2DrUQECO",!0)),Sinhala:()=>new fB(mB("hsDCBCRBEXBCIBCDDBFBEFFBEBCCCBGBHJBDCBt-gCTB",!1)),Sogdian:()=>new fB(mB("w5jCpB",!0)),Sora_Sompeng:()=>new fB(mB("wmkCYIJ",!0)),Soyombo:()=>new fB(mB("wymCyC",!0)),Sundanese:()=>new fB(mB("g8G-BhIH",!0)),Sunuwar:()=>new fB(mB("g+mChBPJ",!0)),Syloti_Nagri:()=>new fB(mB("ggqBsB",!0)),Syriac:()=>new fB(mB("g4BNC7BDCxIK",!0)),Tagalog:()=>new fB(mB("g4FVKA",!0)),Tagbanwa:()=>new fB(mB("g7FMCCCB",!0)),Tai_Le:()=>new fB(mB("wqGdDE",!0)),Tai_Tham:()=>new fB(mB("gxG+BCcDKHJHN",!0)),Tai_Viet:()=>new fB(mB("g0qBiCZE",!0)),Tai_Yo:()=>new fB(mB("g25DeCVJB",!0)),Takri:()=>new fB(mB("g0lC5BHJ",!0)),Tamil:()=>new fB(mB("i8CBBCFBECBCDBEBBCCCBEEBEEBBBELBFEBECBCDBDHHPUBm+kCxBBOAB",!1)),Tangsa:()=>new fB(mB("wz6CuCCJ",!0)),Tangut:()=>new fB(mB("g-7CgBgBB+3GBhQeBiDyDB",!1)),Telugu:()=>new fB(mB("ggDMCCCWCPDICCCDIBCCCBDDDJII",!0)),Thaana:()=>new fB(mB("g8BxB",!0)),Thai:()=>new fB(mB("hwD5BGb",!0)),Tibetan:()=>new fB(mB("g4DnCCjBFmBCjBCOCGFB",!0)),Tifinagh:()=>new fB(mB("wpL3BIBPA",!0)),Tirhuta:()=>new fB(mB("gklCnCJJ",!0)),Todhri:()=>new fB(mB("guhCzB",!0)),Tolong_Siki:()=>new fB(mB("wtnCrBFJ",!0)),Toto:()=>new fB(mB("w04De",!0)),Tulu_Tigalari:()=>new fB(mB("g8kCJBCDDClBBCJBCDDCDBCJBCBBJBB",!1)),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zBBDtIBtBDBlDLBQBBQQQmBJBvF3BBeMBtBDBKGBDNBH5EB6eCBSCBOCB7GFBNDBCOBNDB5BHBLFBpBHBfBBNDBDNBKmBB5KHBPBBOCBMCB6BCCBCBRBBNDBLGB0EoDoDBjgBBh3pBfB-oEBBv0FBBypHOBvThtCB-QhvBBs6EEBrpIm8yVBCdBhD-DBxHvw-FB",!1)),Vai:()=>new fB(mB("gopBrJ",!0)),Vithkuqi:()=>new fB(mB("wrhCKCOCGCBCKCOCGCB",!0)),Wancho:()=>new fB(mB("g24D5BGA",!0)),Warang_Citi:()=>new fB(mB("glmCyCNA",!0)),Yezidi:()=>new fB(mB("g0jCpBCCDB",!0)),Yi:()=>new fB(mB("ggoBskBE2B",!0)),Zanabazar_Square:()=>new fB(mB("gwmCnC",!0))});static FOLD_CATEGORIES=new wB({L:()=>new fB(mB("laA",!0)),LC:()=>new fB(mB("laA",!0)),Ll:()=>new fB(mB("hCZBmDWBCGBiBuBCEECDOCDuBCBECEBBCCCBCCBBBDDBCBBCCBEBBCBBCECBCCDCCBCCBBBCCCBEEIBBCBBCBBCOCDQCDBBCCCBBBC4BCIBBCBBDCCBCBCGC3HrBrBCEEJHHCCBCCCBCCBPBCIBkBJJCUCGDDCBBDyBBxBgBCK2BCBMCD+CCDlBBq6ClBBCGGzW1CB0kCHHBpBBDCBhK0ECKgDCKHBJFBLHBJHBJFBMGCJHBZHBJHBJHBJEBMEBMDBNEBMEBqJEEBHHxC9zC9zCBuBBxBCCBBBDGCBCBCDDJCBCgDCJCCFuqeuqeCqBCUaCoEMCE8BCLECBICFCCDCCEUCBDBCEBCOCBCBCCCBQCZs5Vs5VBYBmmBnBBpEjBB9EKBCOBCGBCBBr3ByBB+EVB75CfBhsVfBhCYBoyehBB",!1)),Lt:()=>new fB(mB("kOCCBCCBCClBCCtsHHBJHBJHBMQQwBAB",!1)),Lu:()=>new fB(mB("hDZB7BqBqBBWBCHBCuBCEECDOCDsBCDECBBBDCCDEEGDDECBDDDCC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DCCCDFFDEECDDECCGBBCBBCBBCOCBSCDBBCEECkBCEQCJDDBCCFICBEBCBBCCCBEEBCCBCBCEBDCCBDDIDDCBBEFBGLLBnFnFsBCCEEEBBBvBDBCdBCBBECBCWCBDBCGD1BvBBCgBCK0BCDMCBgDCyBlBBq6CqBBDCB5XFBjkCIBCvHvHERRzD0ECGGGC8CCBHBJFBLHBJHBJFBMGCJHBJNBzBBBNSSBPPBEEpLiBiBBOBFsasaBYBn6BvBBCEEBGCHDDLiDCJCCFNNBkBBCGG0oesBCUaCoEMCE8BCLCCDICFFFCBBDSCMOCFCCDOCb9a9advCBi8UZBumBnBBpEjBB8EKBCOBCGBCBBk4ByBB+DVB75CfBhsVfB8BYBvyehBB",!1))});static FOLD_SCRIPT=new wB({Common:()=>new fB(mB("8cgBgB",!1)),Greek:()=>new fB(mB("1FwUwU",!1)),Inherited:()=>new fB(mB("5cgBgBlgHAB",!1))})},yB=class e{static MAX_RUNE=1114111;static RUNE_ERROR=65533;static isUnsearchable(t){return t===e.RUNE_ERROR||t>=e.MIN_HIGH_SURROGATE&&t<=e.MAX_LOW_SURROGATE}static MAX_ASCII=127;static MAX_LATIN1=255;static MAX_BMP=65535;static MIN_FOLD=65;static MAX_FOLD=125251;static MIN_HIGH_SURROGATE=55296;static MAX_HIGH_SURROGATE=56319;static MIN_LOW_SURROGATE=56320;static MAX_LOW_SURROGATE=57343;static MIN_SUPPLEMENTARY_CODE_POINT=65536;static is32(e,t){let n=0,s=e.length;for(;n<s;){const r=n+Math.floor((s-n)/2),i=e.getLo(r),a=e.getHi(r);if(i<=t&&t<=a){return(t-i)%e.getStride(r)===0}t<i?s=r:n=r+1}return!1}static is(t,n){if(n<=e.MAX_LATIN1){for(let e=0;e<t.length;e++){if(n>t.getHi(e))continue;const s=t.getLo(e);if(n<s)return!1;return(n-s)%t.getStride(e)===0}return!1}return t.length>0&&n>=t.getLo(0)&&e.is32(t,n)}static isPrint(t){return t<=e.MAX_LATIN1?t>=32&&t<e.MAX_ASCII||t>=161&&173!==t:e.is(EB.Print,t)}static simpleFold(t){if(EB.CASE_ORBIT.has(t))return EB.CASE_ORBIT.get(t);if(t<=e.MAX_ASCII){const e=dB.toLowerCase(t);return e!==t?e:dB.toUpperCase(t)}return t}static equalsIgnoreCase(t,n){if(t===n)return!0;if(t<0||n<0)return!1;if(t<=e.MAX_ASCII&&n<=e.MAX_ASCII)return 65<=t&&t<=90&&(t|=32),65<=n&&n<=90&&(n|=32),t===n;for(let s=e.simpleFold(t);s!==t;s=e.simpleFold(s))if(s===n)return!0;return!1}};const DB=new Uint8Array(256);for(let e=0;e<256;e++)DB[e]=97<=e&&e<=122||65<=e&&e<=90||48<=e&&e<=57||95===e?1:0;let _B=null,bB=null;var vB=class e{static METACHARACTERS="\\.+*?()|[]{}^$";static EMPTY_BEGIN_LINE=1;static EMPTY_END_LINE=2;static EMPTY_BEGIN_TEXT=4;static EMPTY_END_TEXT=8;static EMPTY_WORD_BOUNDARY=16;static EMPTY_NO_WORD_BOUNDARY=32;static EMPTY_ALL=-1;static emptyInts(){return[]}static isByteArray(e){return Array.isArray(e)||"[object Uint8Array]"===Object.prototype.toString.call(e)}static isalnum(e){return dB.CODES[0]<=e&&e<=dB.CODES[9]||dB.CODES.a<=e&&e<=dB.CODES.z||dB.CODES.A<=e&&e<=dB.CODES.Z}static unhex(e){return dB.CODES[0]<=e&&e<=dB.CODES[9]?e-dB.CODES[0]:dB.CODES.a<=e&&e<=dB.CODES.f?e-dB.CODES.a+10:dB.CODES.A<=e&&e<=dB.CODES.F?e-dB.CODES.A+10:-1}static escapeRune(t){let n="";if(yB.isPrint(t))e.METACHARACTERS.indexOf(String.fromCodePoint(t))>=0&&(n+="\\"),n+=String.fromCodePoint(t);else switch(t){case dB.CODES['"']:n+='\\"';break;case dB.CODES["\\"]:n+="\\\\";break;case dB.CODES["\t"]:n+="\\t";break;case dB.CODES["\n"]:n+="\\n";break;case dB.CODES["\r"]:n+="\\r";break;case dB.CODES["\b"]:n+="\\b";break;case dB.CODES["\f"]:n+="\\f";break;default:{let e=t.toString(16);t<256?(n+="\\x",1===e.length&&(n+="0"),n+=e):n+=`\\x{${e}}`;break}}return n}static stringToRunes(e){const t=String(e),n=[];let s=0;for(;s<t.length;){const e=t.codePointAt(s);n.push(e),s+=e>yB.MAX_BMP?2:1}return new Int32Array(n)}static runeToString(e){return String.fromCodePoint(e)}static isWordRune(e){return e<256&&1===DB[e]}static emptyOpContext(t,n){let s=0;return t<0&&(s|=e.EMPTY_BEGIN_TEXT|e.EMPTY_BEGIN_LINE),10===t&&(s|=e.EMPTY_BEGIN_LINE),n<0&&(s|=e.EMPTY_END_TEXT|e.EMPTY_END_LINE),10===n&&(s|=e.EMPTY_END_LINE),e.isWordRune(t)!==e.isWordRune(n)?s|=e.EMPTY_WORD_BOUNDARY:s|=e.EMPTY_NO_WORD_BOUNDARY,s}static quoteMeta(t){return t.split("").map(t=>e.METACHARACTERS.indexOf(t)>=0?`\\${t}`:t).join("")}static charCount(e){return e>yB.MAX_BMP?2:1}static toArray(e){const t=e.length,n=new Array(t);for(let s=0;s<t;s++)n[s]=e[s];return n}static stringToUtf8ByteArray(e){if(globalThis.TextEncoder)return _B||(_B=new TextEncoder),_B.encode(e);{let t=[],n=0;for(let s=0;s<e.length;s++){let r=e.charCodeAt(s);r<128?t[n++]=r:r<2048?(t[n++]=r>>6|192,t[n++]=63&r|128):(64512&r)===yB.MIN_HIGH_SURROGATE&&s+1<e.length&&(64512&e.charCodeAt(s+1))===yB.MIN_LOW_SURROGATE?(r=yB.MIN_SUPPLEMENTARY_CODE_POINT+((1023&r)<<10)+(1023&e.charCodeAt(++s)),t[n++]=r>>18|240,t[n++]=r>>12&63|128,t[n++]=r>>6&63|128,t[n++]=63&r|128):(t[n++]=r>>12|224,t[n++]=r>>6&63|128,t[n++]=63&r|128)}return t}}static utf8ByteArrayToString(e){if(globalThis.TextDecoder){bB||(bB=new TextDecoder("utf-8"));const t=e instanceof Uint8Array?e:new Uint8Array(e);return bB.decode(t)}{let t=[],n=0,s=0;for(;n<e.length;){let r=e[n++];if(r<128)t[s++]=String.fromCharCode(r);else if(r>191&&r<224){let i=e[n++];t[s++]=String.fromCharCode((31&r)<<6|63&i)}else if(r>239&&r<365){let i=((7&r)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-yB.MIN_SUPPLEMENTARY_CODE_POINT;t[s++]=String.fromCharCode(yB.MIN_HIGH_SURROGATE+(i>>10)),t[s++]=String.fromCharCode(yB.MIN_LOW_SURROGATE+(1023&i))}else{let i=e[n++],a=e[n++];t[s++]=String.fromCharCode((15&r)<<12|(63&i)<<6|63&a)}}return t.join("")}}};const IB=(e=[],t=0)=>{const n=Object.create(null);for(let s=0;s<e.length;s++){const r=e[s],i=t+s;n[r]=i,n[i]=r}return Object.freeze(n)};var TB=class e{static Encoding=IB(["UTF_16","UTF_8"]);getEncoding(){throw Error("not implemented")}asCharSequence(){throw Error("not implemented")}asBytes(){throw Error("not implemented")}length(){throw Error("not implemented")}isUTF8Encoding(){return this.getEncoding()===e.Encoding.UTF_8}isUTF16Encoding(){return this.getEncoding()===e.Encoding.UTF_16}},OB=class extends TB{constructor(e=null){super(),this.bytes=e}getEncoding(){return TB.Encoding.UTF_8}asCharSequence(){return vB.utf8ByteArrayToString(this.bytes)}asBytes(){return this.bytes}length(){return this.bytes.length}},AB=class extends TB{constructor(e=null){super(),this.charSequence=e}getEncoding(){return TB.Encoding.UTF_16}asCharSequence(){return this.charSequence}asBytes(){return vB.stringToUtf8ByteArray(this.charSequence.toString())}length(){return this.charSequence.length}},SB=class{static utf16(e){return new AB(e)}static utf8(e){return vB.isByteArray(e)?new OB(e):new OB(vB.stringToUtf8ByteArray(e))}},NB=class{static EOF(){return-8}constructor(){this.start=0,this.end=0}canCheckPrefix(){return!0}endPos(){return this.end-this.start}hasString(){return!1}hasAnyString(){return!1}prefixLength(){return 0}},RB=class e extends NB{static RUNE_ERROR_STEP=yB.RUNE_ERROR<<3|1;constructor(e,t=0,n=e.length){super(),this.bytes=e,this.start=t,this.end=n}hasString(e,t){const n=e.bytes;if(0===n.length)return!0;const s=this.indexOf(this.bytes,n,this.start+t);return-1!==s&&s<=this.end-n.length}hasAnyString(e,t){return e.automaton8().searchUTF8(this.bytes,this.start+t,this.end)}step(t){if((t+=this.start)>=this.end)return NB.EOF();const n=255&this.bytes[t];if(n<128)return n<<3|1;let s,r,i=128,a=191;if(n>=194&&n<=223)s=2,r=31&n;else if(n>=224&&n<=239)s=3,r=15&n,224===n?i=160:237===n&&(a=159);else{if(!(n>=240&&n<=244))return e.RUNE_ERROR_STEP;s=4,r=7&n,240===n?i=144:244===n&&(a=143)}if(t+s>this.end)return e.RUNE_ERROR_STEP;const o=255&this.bytes[t+1];if(o<i||o>a)return e.RUNE_ERROR_STEP;if(r=r<<6|63&o,s>2){const n=255&this.bytes[t+2];if(128!=(192&n))return e.RUNE_ERROR_STEP;if(r=r<<6|63&n,s>3){const n=255&this.bytes[t+3];if(128!=(192&n))return e.RUNE_ERROR_STEP;r=r<<6|63&n}}return r<<3|s}index(e,t){t+=this.start;const n=this.indexOf(this.bytes,e.prefixUTF8,t);return n<0?n:n-t}context(e){let t=-1;if((e+=this.start)>this.start&&e<=this.end){let n=e-1;if(t=this.bytes[n--],t>=128){let s=e-4;for(s<this.start&&(s=this.start);n>=s&&128==(192&this.bytes[n]);)n--;n<this.start&&(n=this.start);const r=this.step(n-this.start);t=n+(7&r)===e?r>>3:yB.RUNE_ERROR}}const n=e<this.end?this.step(e-this.start)>>3:-1;return vB.emptyOpContext(t,n)}indexOf(e,t,n=0){let s=t.length;if(0===s)return n<=this.end?n:-1;const r=t[0];let i=this.end-s;const a="function"==typeof e.indexOf;let o=n;for(;o<=i;){if(a){if(o=e.indexOf(r,o),-1===o||o>i)return-1}else{for(;o<=i&&e[o]!==r;)o++;if(o>i)return-1}let n=!0;for(let r=1;r<s;r++)if(e[o+r]!==t[r]){n=!1;break}if(n)return o;o++}return-1}prefixLength(e){return e.prefixUTF8.length}},kB=class extends NB{constructor(e,t=0,n=e.length){super(),this.charSequence=e,this.start=t,this.end=n}hasString(e,t){const n=this.charSequence.indexOf(e.str,this.start+t);return-1!==n&&n<=this.end-e.str.length}hasAnyString(e,t){return e.automaton16().searchUTF16(this.charSequence,this.start+t,this.end)}step(e){if((e+=this.start)>=this.end)return NB.EOF();const t=this.charSequence.charCodeAt(e);if(t<yB.MIN_HIGH_SURROGATE||t>yB.MAX_HIGH_SURROGATE||e+1>=this.end)return t<<3|1;const n=this.charSequence.charCodeAt(e+1);return n>=yB.MIN_LOW_SURROGATE&&n<=yB.MAX_LOW_SURROGATE?1024*(t-yB.MIN_HIGH_SURROGATE)+(n-yB.MIN_LOW_SURROGATE)+yB.MIN_SUPPLEMENTARY_CODE_POINT<<3|2:t<<3|1}index(e,t){t+=this.start;const n=this.charSequence.indexOf(e.prefix,t);return n<0||n>this.end-e.prefix.length?-1:n-t}context(e){const t=(e+=this.start)>this.start&&e<=this.end?this.charSequence.charCodeAt(e-1):-1,n=e<this.end?this.charSequence.charCodeAt(e):-1;return vB.emptyOpContext(t,n)}prefixLength(e){return e.prefix.length}},LB=class{static fromUTF8(e,t=0,n=e.length){return new RB(e,t,n)}static fromUTF16(e,t=0,n=e.length){return new kB(e,t,n)}},xB=class extends Error{constructor(e){super(e),this.name="RE2JSException"}},FB=class extends xB{constructor(e,t=null){let n=`error parsing regexp: ${e}`;t&&(n+=`: \`${t}\``),super(n),this.name="RE2JSSyntaxException",this.message=n,this.error=e,this.input=t}getDescription(){return this.error}getPattern(){return this.input}},PB=class extends xB{constructor(e){super(e),this.name="RE2JSCompileException"}},MB=class extends xB{constructor(e){super(e),this.name="RE2JSGroupException"}},GB=class extends xB{constructor(e){super(e),this.name="RE2JSFlagsException"}},UB=class extends xB{constructor(e){super(e),this.name="RE2JSInternalException"}},HB=class e{static MAX_REPLACER_ARGS=65535;static quoteReplacement(e,t=!1){return t?e.indexOf("\\")<0&&e.indexOf("$")<0?e:e.split("").map(e=>{const t=e.codePointAt(0);return t===dB.CODES["\\"]||t===dB.CODES.$?`\\${e}`:e}).join(""):e.indexOf("$")<0?e:e.split("").map(e=>e.codePointAt(0)===dB.CODES.$?"$$":e).join("")}constructor(e,t){if(null===e)throw new Error("pattern is null");this.patternInput=e;const n=this.patternInput.re2();this.patternGroupCount=n.numberOfCapturingGroups(),this.groups=[],this.namedGroups=n.namedGroups,this.hasNamedGroups=Object.keys(this.namedGroups).length>0,this.numberOfInstructions=n.numberOfInstructions(),this.lookbehindState=null,t instanceof TB?this.resetMatcherInput(t):vB.isByteArray(t)?this.resetMatcherInput(SB.utf8(t)):this.resetMatcherInput(SB.utf16(t))}pattern(){return this.patternInput}reset(){return this.matcherInputLength=this.matcherInput.length(),this.appendPos=0,this.hasMatch=!1,this.hasGroups=!1,this.anchorFlag=0,this}resetMatcherInput(e){if(null===e)throw new Error("input is null");return e instanceof TB||(e=vB.isByteArray(e)?SB.utf8(e):SB.utf16(e)),this.matcherInput=e,null!==this.lookbehindState?this.lookbehindState.reset():this.lookbehindState=this.patternInput.re2().createLookbehindState(),this.reset(),this}start(e=0){if("string"==typeof e){const t=this.namedGroups[e];if(!Number.isFinite(t))throw new MB(`group '${e}' not found`);e=t}return this.loadGroup(e),this.groups[2*e]}end(e=0){if("string"==typeof e){const t=this.namedGroups[e];if(!Number.isFinite(t))throw new MB(`group '${e}' not found`);e=t}return this.loadGroup(e),this.groups[2*e+1]}programSize(){return this.numberOfInstructions}group(e=0){if("string"==typeof e){const t=this.namedGroups[e];if(!Number.isFinite(t))throw new MB(`group '${e}' not found`);e=t}const t=this.start(e),n=this.end(e);return t<0&&n<0?null:this.substring(t,n)}getNamedGroups(){if(!this.hasMatch)throw new MB("perhaps no match attempted");const e=Object.create(null);for(const t of Object.keys(this.namedGroups))e[t]=this.group(t);return e}groupCount(){return this.patternGroupCount}loadGroup(e){if(!Number.isInteger(e)||e<0||e>this.patternGroupCount)throw new MB(`Group index out of bounds: ${e}`);if(!this.hasMatch)throw new MB("perhaps no match attempted");if(0===e||this.hasGroups)return;const t=this.matcherInputLength,n=this.patternInput.re2().matchMachineInput(this.matcherInput,this.groups[0],t,this.anchorFlag,1+this.patternGroupCount,this.lookbehindState);if(!n[0])throw new MB("inconsistency in matching group data");this.groups=n[1],this.hasGroups=!0}matches(){return this.genMatch(0,sB.ANCHOR_BOTH)}lookingAt(){return this.genMatch(0,sB.ANCHOR_START)}find(e=null){if(null!==e){if(!Number.isInteger(e)||e<0||e>this.matcherInputLength)throw new MB(`start index out of bounds: ${e}`);return this.reset(),this.genMatch(e,0)}if(e=0,this.hasMatch&&(e=this.groups[1],this.groups[0]===this.groups[1])){const t=(this.matcherInput.isUTF16Encoding()?LB.fromUTF16(this.matcherInput.asCharSequence(),0,this.matcherInputLength):LB.fromUTF8(this.matcherInput.asBytes(),0,this.matcherInputLength)).step(e);t<0?e++:e+=7&t}return this.genMatch(e,sB.UNANCHORED)}genMatch(e,t){const n=this.patternInput.re2().matchMachineInput(this.matcherInput,e,this.matcherInputLength,t,1,this.lookbehindState);return n[0]?(this.groups=n[1],this.hasMatch=!0,this.hasGroups=0===this.patternGroupCount,this.anchorFlag=t,!0):(this.hasMatch=!1,!1)}substring(e,t){return this.matcherInput.isUTF8Encoding()?vB.utf8ByteArrayToString(this.matcherInput.asBytes().slice(e,t)):this.matcherInput.asCharSequence().substring(e,t).toString()}inputLength(){return this.matcherInputLength}appendReplacement(e,t=!1){let n="";const s=this.start(),r=this.end();return this.appendPos<s&&(n+=this.substring(this.appendPos,s)),this.appendPos=r,n+=t?this.appendReplacementInternalJava(e):this.appendReplacementInternalJs(e),n}appendReplacementInternalJava(e){let t="",n=0;const s=e.length;let r=0;for(;r<s;){const i=e.codePointAt(r);if(i!==dB.CODES["\\"]){if(i===dB.CODES.$){if(n<r&&(t+=e.substring(n,r)),r+1>=s)throw new MB("Illegal group reference: group index is missing");const i=e.codePointAt(r+1);if(dB.CODES[0]<=i&&i<=dB.CODES[9]){let a=i-dB.CODES[0],o=r+2;for(;o<s;o++){const t=e.codePointAt(o);if(t<dB.CODES[0]||t>dB.CODES[9]||10*a+t-dB.CODES[0]>this.patternGroupCount)break;a=10*a+t-dB.CODES[0]}if(a>this.patternGroupCount)throw new MB(`n > number of groups: ${a}`);const B=this.group(a);null!==B&&(t+=B),r=o,n=r}else{if(i!==dB.CODES["{"])throw new MB("Illegal group reference");{let i=r+2;for(;i<s&&e.codePointAt(i)!==dB.CODES["}"];)i++;if(i>=s)throw new MB("named capture group is missing trailing '}'");const a=e.substring(r+2,i),o=this.group(a);null!==o&&(t+=o),r=i+1,n=r}}continue}r++}else{if(n<r&&(t+=e.substring(n,r)),r++,r>=s)throw new MB("character to be escaped is missing");n=r,r++}}return n<s&&(t+=e.substring(n,s)),t}appendReplacementInternalJs(e){const t=e=>e>=48&&e<=57,n=this.patternGroupCount;let s="",r=0;for(;r<e.length;){const i=e.indexOf("$",r);if(i<0)break;s+=e.substring(r,i),r=i;const a=e.charCodeAt(r+1);if(a===dB.CODES.$)s+="$",r+=2;else if(a===dB.CODES["&"])s+=this.group(0),r+=2;else if(a===dB.CODES["`"])s+=this.substring(0,this.start(0)),r+=2;else if(a===dB.CODES["'"])s+=this.substring(this.end(0),this.matcherInputLength),r+=2;else if(t(a)){let i=1,o=a-48;const B=e.charCodeAt(r+2);if(t(B)&&10*o+B-48<=n&&(i=2,o=10*o+B-48),o>=1&&o<=n){const e=this.group(o);null!==e&&(s+=e)}else s+=e.substring(r,r+1+i);r+=1+i}else if(a===dB.CODES["<"]&&this.hasNamedGroups){const t=e.indexOf(">",r+2);if(t<0)s+="$<",r+=2;else{const n=e.substring(r+2,t);if(Object.prototype.hasOwnProperty.call(this.namedGroups,n)){const e=this.group(n);null!==e&&(s+=e)}r=t+1}}else s+="$",r+=1}return s+e.substring(r)}appendTail(){return this.substring(this.appendPos,this.matcherInputLength)}replaceAll(e,t=!1){return this.replace(e,!0,t)}replaceFirst(e,t=!1){return this.replace(e,!1,t)}replace(t,n=!0,s=!1){let r="";this.reset();const i="function"==typeof t;let a=null;if(i){if(this.groupCount()>=e.MAX_REPLACER_ARGS)throw new MB("Too many capture groups to safely invoke replacer function");a=this.matcherInput.isUTF8Encoding()?this.matcherInput.asBytes():this.matcherInput.asCharSequence()}for(;this.find()&&(r+=i?this.appendReplacementFunc(t,a):this.appendReplacement(t,s),n););return r+=this.appendTail(),r}appendReplacementFunc(e,t){let n="";const s=this.start(),r=this.end();this.appendPos<s&&(n+=this.substring(this.appendPos,s)),this.appendPos=r;const i=this.matchArray();return i.push(s,t),this.hasNamedGroups&&i.push(this.namedGroupsObject()),n+=String(e(...i)),n}matchArray(){const e=[this.group(0)];for(let t=1;t<=this.patternGroupCount;t++){const n=this.group(t);e.push(null===n?void 0:n)}return e}namedGroupsObject(){if(!this.hasNamedGroups)return;const e=this.getNamedGroups();for(const t in e)null===e[t]&&(e[t]=void 0);return e}},VB=class e{static ALT=1;static ALT_MATCH=2;static CAPTURE=3;static EMPTY_WIDTH=4;static FAIL=5;static MATCH=6;static NOP=7;static RUNE=8;static RUNE1=9;static RUNE_ANY=10;static RUNE_ANY_NOT_NL=11;static LB_WRITE=12;static LB_CHECK=13;static isRuneOp(t){return e.RUNE<=t&&t<=e.RUNE_ANY_NOT_NL}static escapeRunes(e){let t='"';for(let n of e)t+=vB.escapeRune(n);return t+='"',t}constructor(e){this.op=e,this.out=0,this.arg=0,this.runes=new Int32Array(0),this.next=null}matchRune(e){if(1===this.runes.length){const t=this.runes[0];return 0!==(this.arg&sB.FOLD_CASE)?yB.equalsIgnoreCase(t,e):e===t}const t=this.runes.length;if(0===t)return!1;if(2===t||4===t||6===t||8===t){for(let n=0;n<t;n+=2){if(e<this.runes[n])return!1;if(e<=this.runes[n+1])return!0}return!1}let n=0,s=t>>1;for(;s>1;){const t=s>>1;n+=this.runes[n+t<<1]<=e?t:0,s-=t}n+=this.runes[n<<1]<=e?1:0;const r=n-1;return r>=0&&e<=this.runes[r<<1|1]}matchRunePos(e){if(1===this.runes.length){const t=this.runes[0];return 0!==(this.arg&sB.FOLD_CASE)?yB.equalsIgnoreCase(t,e)?0:-1:e===t?0:-1}const t=this.runes.length;if(0===t)return-1;if(2===t||4===t||6===t||8===t){for(let n=0;n<t;n+=2){if(e<this.runes[n])return-1;if(e<=this.runes[n+1])return Math.floor(n/2)}return-1}let n=0,s=t>>1;for(;s>1;){const t=s>>1;n+=this.runes[n+t<<1]<=e?t:0,s-=t}n+=this.runes[n<<1]<=e?1:0;const r=n-1;return r>=0&&e<=this.runes[r<<1|1]?r:-1}toString(){switch(this.op){case e.ALT:return`alt -> ${this.out}, ${this.arg}`;case e.ALT_MATCH:return`altmatch -> ${this.out}, ${this.arg}`;case e.CAPTURE:return`cap ${this.arg} -> ${this.out}`;case e.EMPTY_WIDTH:return`empty ${this.arg} -> ${this.out}`;case e.MATCH:return"match"+(0!==this.arg?` ${this.arg}`:"");case e.FAIL:return"fail";case e.NOP:return`nop -> ${this.out}`;case e.LB_WRITE:return`lbwrite ${this.arg} -> ${this.out}`;case e.LB_CHECK:return`lbcheck ${this.arg} -> ${this.out}`;case e.RUNE:return null===this.runes?"rune <null>":["rune ",e.escapeRunes(this.runes),0!==(this.arg&sB.FOLD_CASE)?"/i":""," -> ",this.out].join("");case e.RUNE1:return`rune1 ${e.escapeRunes(this.runes)} -> ${this.out}`;case e.RUNE_ANY:return`any -> ${this.out}`;case e.RUNE_ANY_NOT_NL:return`anynotnl -> ${this.out}`;default:throw new Error("unhandled case in Inst.toString")}}},jB=class e{constructor(e){this.sparse=new Int32Array(e),this.densePcs=new Int32Array(e),this.denseCaps=null,this.size=0,this.ncap=0,this.mainThreads=0}static INITIAL_THREADS=32;init(t){this.ncap=t;const n=Math.min(this.densePcs.length,e.INITIAL_THREADS)*t;(!this.denseCaps||this.denseCaps.length<n)&&(this.denseCaps=new Int32Array(n))}growCaps(e){const t=this.densePcs.length*this.ncap,n=new Int32Array(Math.min(t,Math.max(e,2*this.denseCaps.length)));n.set(this.denseCaps),this.denseCaps=n}contains(e){const t=this.sparse[e];return t<this.size&&this.densePcs[t]===e}isEmpty(){return 0===this.size}add(e){const t=this.size++;return this.sparse[e]=t,this.densePcs[t]=e,t}clear(){this.size=0,this.mainThreads=0}toString(){let e="{";for(let t=0;t<this.size;t++)0!==t&&(e+=", "),e+=this.densePcs[t];return e+="}",e}},$B=class{constructor(e){this.pos=-1,this.pcs=new Int32Array(e.numInst()),this.size=0,this.lbTable=new Int32Array(e.numLb+1)}reset(){this.pos=-1,this.size=0}},JB=class e{static fromRE2(t){const n=new e;return n.prog=t.prog,n.re2=t,n.q0=new jB(n.prog.numInst()),n.q1=new jB(n.prog.numInst()),n.addStack=new Int32Array(2*(n.prog.numInst()+1)),n.matched=!1,n.matchcap=new Int32Array(n.prog.numCap<2?2:n.prog.numCap),n.ncap=0,n}constructor(){this.prog=null,this.re2=null,this.q0=null,this.q1=null,this.addStack=null,this.matched=!1,this.matchcap=null,this.ncap=0,this.lbTable=null}init(e){this.ncap=e,e>this.matchcap.length?this.matchcap=new Int32Array(e).fill(-1):this.matchcap.fill(-1),this.q0.init(e),this.q1.init(e),this.prog.numLb>0&&((!this.lbTable||this.lbTable.length<this.prog.numLb+1)&&(this.lbTable=new Int32Array(this.prog.numLb+1)),this.lbTable.fill(-1))}submatches(){return 0===this.ncap?vB.emptyInts():vB.toArray(this.matchcap.subarray(0,this.ncap))}match(e,t,n,s=null){const r=this.re2.cond;if(r===vB.EMPTY_ALL)return!1;if((n===sB.ANCHOR_START||n===sB.ANCHOR_BOTH)&&0!==t)return!1;this.matched=!1,this.matchcap.fill(-1);const i=this.prog.numLb>0,a=t;let o=t,B=!1;i&&(null!==s&&s.pos>=0&&s.pos<=t?(o=s.pos,B=!0):o=0);let c,l=i&&null!==s,u=this.q0,h=this.q1,p=e.step(o),d=p>>3,f=7&p,C=-1,g=0;for(p!==NB.EOF()&&(p=e.step(o+f),C=p>>3,g=7&p),c=0===o?vB.emptyOpContext(-1,d):e.context(o),i&&(B?this.restoreLookbehinds(s,u,c):this.spawnLookbehinds(u,o,c));;){if(0===u.mainThreads){if(0!==(r&vB.EMPTY_BEGIN_TEXT)&&0!==o)break;if((n===sB.ANCHOR_START||n===sB.ANCHOR_BOTH)&&0!==o)break;if(this.matched)break;if(0===this.prog.numLb&&u.isEmpty()&&0!==this.re2.prefix.length&&C!==this.re2.prefixRune&&e.canCheckPrefix()){const t=e.index(this.re2,o);if(t<0)break;o+=t,p=e.step(o),d=p>>3,f=7&p,p=e.step(o+f),C=p>>3,g=7&p,c=e.context(o)}}o>=a&&(l&&(this.saveLookbehinds(s,u,o),l=!1),this.matched||0!==o&&n!==sB.UNANCHORED||(this.ncap>0&&(this.matchcap[0]=o),this.add(u,this.prog.start,o,this.matchcap,0,c)));const t=o+f;if(c=e.context(t),this.step(u,h,o,t,d,c,n,o===e.endPos()),0===f)break;if(0===this.ncap&&this.matched)break;o+=f,d=C,f=g,-1!==d&&(p=e.step(o+f),C=p>>3,g=7&p);const i=u;u=h,h=i}return u.clear(),h.clear(),this.matched}matchSet(e,t,n){const s=this.re2.cond;if(s===vB.EMPTY_ALL)return[];if((n===sB.ANCHOR_START||n===sB.ANCHOR_BOTH)&&0!==t)return[];let r=this.prog.numLb>0?0:t,i=t,a=this.q0,o=this.q1,B=e.step(r),c=B>>3,l=7&B,u=-1,h=0;B!==NB.EOF()&&(B=e.step(r+l),u=B>>3,h=7&B);let p=0===r?vB.emptyOpContext(-1,c):e.context(r);const d=new Set;for(this.prog.numLb>0&&this.spawnLookbehinds(a,r,p);;){if(0===a.mainThreads){if(0!==(s&vB.EMPTY_BEGIN_TEXT)&&0!==r)break;if((n===sB.ANCHOR_START||n===sB.ANCHOR_BOTH)&&0!==r)break}0!==r&&n!==sB.UNANCHORED||r>=i&&this.add(a,this.prog.start,r,this.matchcap,0,p);const t=r+l;p=e.context(t);for(let s=0;s<a.size;s++){const i=a.densePcs[s],B=this.prog.inst[i],l=s*this.ncap;let u=!1;switch(B.op){case VB.MATCH:if(n===sB.ANCHOR_BOTH&&r!==e.endPos())break;d.add(B.arg);break;case VB.RUNE:u=B.matchRune(c);break;case VB.RUNE1:u=c===B.runes[0];break;case VB.RUNE_ANY:u=!0;break;case VB.RUNE_ANY_NOT_NL:u=10!==c;break;default:continue}u&&this.add(o,B.out,t,a.denseCaps,l,p)}if(a.clear(),0===l)break;r+=l,c=u,l=h,-1!==c&&(B=e.step(r+l),u=B>>3,h=7&B);const f=a;a=o,o=f}return o.clear(),Array.from(d).sort((e,t)=>e-t)}step(e,t,n,s,r,i,a,o){const B=this.re2.longest;for(let c=0;c<e.size;c++){const l=e.densePcs[c],u=c*this.ncap;if(B&&this.matched&&this.ncap>0&&this.matchcap[0]<e.denseCaps[u])continue;const h=this.prog.inst[l];let p=!1;switch(h.op){case VB.MATCH:if(a===sB.ANCHOR_BOTH&&!o)break;if(this.ncap>0&&(!B||!this.matched||this.matchcap[1]<n)){e.denseCaps[u+1]=n;for(let t=0;t<this.ncap;t++)this.matchcap[t]=e.denseCaps[u+t]}B||(e.size=0),this.matched=!0;break;case VB.RUNE:p=h.matchRune(r);break;case VB.RUNE1:p=r===h.runes[0];break;case VB.RUNE_ANY:p=!0;break;case VB.RUNE_ANY_NOT_NL:p=10!==r;break;default:continue}p&&this.add(t,h.out,s,e.denseCaps,u,i)}e.clear()}spawnLookbehinds(e,t,n){for(let s=0;s<this.prog.lbStarts.length;s++)this.add(e,this.prog.lbStarts[s],t,this.matchcap,0,n)}restoreLookbehinds(e,t,n){this.lbTable.set(e.lbTable);for(let s=0;s<e.size;s++)this.add(t,e.pcs[s],e.pos,this.matchcap,0,n)}saveLookbehinds(e,t,n){let s=0;for(let n=0;n<t.size;n++){const r=t.densePcs[n];1===this.prog.lbInst[r]&&VB.isRuneOp(this.prog.inst[r].op)&&(e.pcs[s++]=r)}e.size=s,e.pos=n,e.lbTable.set(this.lbTable)}add(e,t,n,s,r,i){const a=this.addStack;let o=0;for(;;){for(;0!==t&&!e.contains(t);){const B=e.add(t),c=this.prog.inst[t];switch(c.op){case VB.FAIL:t=0;break;case VB.ALT:case VB.ALT_MATCH:a[o++]=c.arg,a[o++]=0,t=c.out;break;case VB.EMPTY_WIDTH:t=0===(c.arg&~i)?c.out:0;break;case VB.NOP:t=c.out;break;case VB.CAPTURE:c.arg<this.ncap&&(a[o++]=-c.arg-1,a[o++]=s[r+c.arg],s[r+c.arg]=n),t=c.out;break;case VB.LB_WRITE:this.lbTable[Math.abs(c.arg)]=n,t=c.out;break;case VB.LB_CHECK:t=c.arg>0?this.lbTable[c.arg]===n?c.out:0:this.lbTable[-c.arg]!==n?c.out:0;break;case VB.MATCH:case VB.RUNE:case VB.RUNE1:case VB.RUNE_ANY:case VB.RUNE_ANY_NOT_NL:if(0===this.prog.lbInst[t]&&e.mainThreads++,this.ncap>0){const t=B*this.ncap;t+this.ncap>e.denseCaps.length&&e.growCaps(t+this.ncap);for(let n=0;n<this.ncap;n++)e.denseCaps[t+n]=s[r+n]}t=0;break;default:throw new UB("unhandled")}}if(0===o)return;o-=2;const B=a[o];B<0?(s[r-B-1]=a[o+1],t=0):t=B}}};const qB=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0},zB=(e,t,n,s)=>e.flag===n&&qB(e.nfaStates,t)&&qB(e.matchIDs,s),KB=[];var QB=class{constructor(e,t,n){this.nfaStates=e,this.flag=t,this.isMatch=0!==(t&WB.FLAG_MATCH),this.matchIDs=n,this.next=null,this.nextAnchored=null}},WB=class e{static FLAG_EMPTY_MASK=255;static FLAG_MATCH=256;static FLAG_LAST_WORD=512;static FLAG_NEED_SHIFT=16;static STATE_OVERHEAD=150;static ARRAY_OVERHEAD=40;static ELEMENT_SIZE=8;static TABLE_OVERHEAD=48;static PROGRESS_PER_STATE=10;constructor(e,t=8388608){this.prog=e,this.maxMem=t,this.stateCache=new Map,this.stateCount=0,this.startStates=new Map,this.failed=!1;for(let t=0;t<e.numInst();t++){const n=e.getInst(t).op;if(n===VB.LB_WRITE||n===VB.LB_CHECK){this.failed=!0;break}}this.computeRuneClasses(),this.stateBudget=t,this.memBudget=t}computeRuneClasses(){const e=new Set,t=(t,n)=>{e.add(t),e.add(n+1)};for(let e=0;e<this.prog.numInst();e++){const n=this.prog.getInst(e);switch(n.op){case VB.RUNE:case VB.RUNE1:if(1===n.runes.length){if(t(n.runes[0],n.runes[0]),0!==(n.arg&sB.FOLD_CASE))for(let e=yB.simpleFold(n.runes[0]);e!==n.runes[0];e=yB.simpleFold(e))t(e,e)}else for(let e=0;e<n.runes.length;e+=2)t(n.runes[e],n.runes[e+1]);break;case VB.RUNE_ANY_NOT_NL:t(10,10);break;case VB.EMPTY_WIDTH:0!==(n.arg&(vB.EMPTY_BEGIN_LINE|vB.EMPTY_END_LINE))&&t(10,10),0!==(n.arg&(vB.EMPTY_WORD_BOUNDARY|vB.EMPTY_NO_WORD_BOUNDARY))&&(t(48,57),t(65,90),t(95,95),t(97,122))}}e.delete(0),this.classBounds=Int32Array.from(e).sort(),this.numClasses=this.classBounds.length+1;const n=new Int32Array(yB.MAX_LATIN1+1);for(let e=0;e<=yB.MAX_LATIN1;e++)n[e]=this.searchClass(e);this.latin1Class=n}runeClass(e){return e<=yB.MAX_LATIN1?this.latin1Class[e]:this.searchClass(e)}searchClass(e){const t=this.classBounds;let n=0,s=t.length;for(;n<s;){const r=n+s>>1;t[r]<=e?n=r+1:s=r}return n}closure(e,t){const n=new Set,s=Array.from(e);let r=0;for(;s.length>0;){const e=s.pop();if(0===e||n.has(e))continue;n.add(e);const i=this.prog.getInst(e);switch(i.op){case VB.ALT:case VB.ALT_MATCH:s.push(i.out),s.push(i.arg);break;case VB.NOP:case VB.CAPTURE:s.push(i.out);break;case VB.EMPTY_WIDTH:r|=i.arg,0===(i.arg&~t)&&s.push(i.out)}}return{pcs:Array.from(n).sort((e,t)=>e-t),needflags:r}}getState(t,n,s){const r=((e,t,n)=>{let s=-2128831035;for(let t=0;t<e.length;t++)s^=e[t],s=Math.imul(s,16777619);s^=t,s=Math.imul(s,16777619);for(let e=0;e<n.length;e++)s^=n[e],s=Math.imul(s,16777619);return s})(t,n,s),i=this.stateCache.get(r);if(i instanceof QB){if(zB(i,t,n,s))return i}else if(void 0!==i)for(let e=0;e<i.length;e++)if(zB(i[e],t,n,s))return i[e];const a=e.stateCost(t,s);if(this.memBudget<a)return null;this.memBudget-=a;const o=new QB(t,n,s);return void 0===i?this.stateCache.set(r,o):i instanceof QB?this.stateCache.set(r,[i,o]):i.push(o),this.stateCount++,o}static stateCost(t,n){const s=0===n.length?0:e.ARRAY_OVERHEAD+e.ELEMENT_SIZE*n.length;return e.STATE_OVERHEAD+e.ELEMENT_SIZE*t.length+s}*cachedStates(){for(const e of this.stateCache.values())e instanceof QB?yield e:yield*e}makeState(t,n,s){const r=this.closure(t,n&e.FLAG_EMPTY_MASK);let i=n;return 0===r.needflags&&(i&=e.FLAG_MATCH),i|=r.needflags<<e.FLAG_NEED_SHIFT,this.getState(r.pcs,i,s)}allocTable(t,n){const s=this.numClasses+1,r=e.TABLE_OVERHEAD+e.ELEMENT_SIZE*s;if(this.memBudget<r)return null;this.memBudget-=r;const i=new Array(s).fill(null);return n===sB.UNANCHORED?t.next=i:t.nextAnchored=i,i}clearCache(){this.stateCache.clear(),this.stateCount=0,this.startStates.clear(),this.memBudget=this.stateBudget}resetCache(e){return this.clearCache(),this.getState(e.nfaStates,e.flag,e.matchIDs)}step(t,n,s,r){let i=r===sB.UNANCHORED?t.next:t.nextAnchored;if(null!==i){const e=i[n];if(null!==e)return e}else if(i=this.allocTable(t,r),null===i)return null;const a=t.flag>>>e.FLAG_NEED_SHIFT,o=t.flag&e.FLAG_EMPTY_MASK;let B=o,c=0;10===s&&(B|=vB.EMPTY_END_LINE,c|=vB.EMPTY_BEGIN_LINE),-1===s&&(B|=vB.EMPTY_END_LINE|vB.EMPTY_END_TEXT);const l=0!==(t.flag&e.FLAG_LAST_WORD),u=-1!==s&&vB.isWordRune(s);B|=u===l?vB.EMPTY_NO_WORD_BOUNDARY:vB.EMPTY_WORD_BOUNDARY;let h=t.nfaStates;0!==(B&~o&a)&&(h=this.closure(h,B).pcs);const p=[];let d=!1,f=KB;for(let e=0;e<h.length;e++){const t=this.prog.getInst(h[e]);t.op===VB.MATCH?(d||(d=!0,f=[]),f.push(t.arg)):-1!==s&&VB.isRuneOp(t.op)&&t.matchRune(s)&&p.push(t.out)}f.length>1&&f.sort((e,t)=>e-t),r===sB.UNANCHORED&&-1!==s&&p.push(this.prog.start);let C=c;d&&(C|=e.FLAG_MATCH),u&&(C|=e.FLAG_LAST_WORD);const g=this.makeState(p,C,f);return null===g?null:(i[n]=g,g)}start(t,n){const s=t.context(n);let r;if(0!==(s&vB.EMPTY_BEGIN_TEXT))r=vB.EMPTY_BEGIN_TEXT|vB.EMPTY_BEGIN_LINE;else if(0!==(s&vB.EMPTY_BEGIN_LINE))r=vB.EMPTY_BEGIN_LINE;else{const i=t.step(n),a=i>=0&&vB.isWordRune(i>>3);r=0!==(s&vB.EMPTY_WORD_BOUNDARY)!==a?e.FLAG_LAST_WORD:0}let i=this.startStates.get(r);if(void 0===i){if(i=this.makeState([this.prog.start],r,KB),null===i&&(this.clearCache(),i=this.makeState([this.prog.start],r,KB),null===i))return null;this.startStates.set(r,i)}return i}stepOrReset(t,n,s,r,i,a){let o=this.step(t,n,s,r);if(null!==o)return o;if(a.resetPos>=0&&i-a.resetPos<e.PROGRESS_PER_STATE*this.stateCount)return null;a.resetPos=i;const B=this.resetCache(t);return null===B?null:(o=this.step(B,n,s,r),o)}run(e,t,n,s,r){const i=e.endPos(),a=this.latin1Class,o=n===sB.UNANCHORED,B={resetPos:-1};let c=t;for(;c<i;){const t=e.step(c),i=t>>3,l=7&t;if(0===l)break;const u=i<=yB.MAX_LATIN1?a[i]:this.runeClass(i);let h=o&&null!==s.next?s.next[u]:null;if(null===h&&(h=this.stepOrReset(s,u,i,n,c,B),null===h))return null;if((s=h).isMatch&&r(s,!1))return!0;if(!o&&0===s.nfaStates.length)return!1;c+=l}return null===(s=this.stepOrReset(s,this.numClasses,-1,n,c,B))?null:s.isMatch&&r(s,!0)}match(e,t,n){if(this.failed)return null;if((n===sB.ANCHOR_START||n===sB.ANCHOR_BOTH)&&0!==t)return!1;const s=this.start(e,t);return null===s?null:this.run(e,t,n,s,(e,t)=>n!==sB.ANCHOR_BOTH||t)}matchSet(e,t,n){if(this.failed)return null;if((n===sB.ANCHOR_START||n===sB.ANCHOR_BOTH)&&0!==t)return[];const s=this.start(e,t);if(null===s)return null;const r=new Set;return null===this.run(e,t,n,s,(e,t)=>{if(n!==sB.ANCHOR_BOTH||t)for(let t=0;t<e.matchIDs.length;t++)r.add(e.matchIDs[t]);return!1})?null:Array.from(r).sort((e,t)=>e-t)}};var YB=class{constructor(){this.end=0,this.cap=new Int32Array(0),this.matchcap=new Int32Array(0),this.ncap=0,this.jobPc=new Int32Array(256),this.jobArg=new Uint8Array(256),this.jobPos=new Int32Array(256),this.jobLen=0,this.visited=new Uint32Array(0)}reset(e,t,n){this.end=t,this.jobLen=0,this.ncap=n;const s=e.numInst()*(t+1)+32-1>>>5;this.visited.length<s?this.visited=new Uint32Array(s):this.visited.fill(0,0,s),this.cap.length<n?this.cap=new Int32Array(n).fill(-1):this.cap.fill(-1,0,n),this.matchcap.length<n?this.matchcap=new Int32Array(n).fill(-1):this.matchcap.fill(-1,0,n)}shouldVisit(e,t){const n=e*(this.end+1)+t,s=n>>>5,r=1<<(31&n);return 0===(this.visited[s]&r)&&(this.visited[s]|=r,!0)}push(e,t,n,s){if(e.prog.getInst(t).op!==VB.FAIL&&(s||this.shouldVisit(t,n))){if(this.jobLen>=this.jobPc.length){const e=2*this.jobPc.length,t=new Int32Array(e);t.set(this.jobPc),this.jobPc=t;const n=new Uint8Array(e);n.set(this.jobArg),this.jobArg=n;const s=new Int32Array(e);s.set(this.jobPos),this.jobPos=s}this.jobPc[this.jobLen]=t,this.jobArg[this.jobLen]=s?1:0,this.jobPos[this.jobLen]=n,this.jobLen++}}tryBacktrack(e,t,n,s,r){const i=e.longest;for(this.push(e,n,s,!1);this.jobLen>0;){this.jobLen--;let n=this.jobPc[this.jobLen],s=1===this.jobArg[this.jobLen],a=this.jobPos[this.jobLen],o=!0;for(;o||this.shouldVisit(n,a);){o=!1;const B=e.prog.getInst(n);switch(B.op){case VB.FAIL:break;case VB.ALT:if(s){s=!1,n=B.arg;continue}this.push(e,n,a,!0),n=B.out;continue;case VB.ALT_MATCH:{const t=e.prog.getInst(B.out);if(VB.isRuneOp(t.op)){this.push(e,B.arg,a,!1),n=B.arg,a=this.end;continue}this.push(e,B.out,this.end,!1),n=B.out;continue}case VB.RUNE:{const e=t.step(a);if(e===NB.EOF())break;if(!B.matchRune(e>>3))break;a+=7&e,n=B.out;continue}case VB.RUNE1:{const e=t.step(a);if(e===NB.EOF())break;if(e>>3!==B.runes[0])break;a+=7&e,n=B.out;continue}case VB.RUNE_ANY_NOT_NL:{const e=t.step(a);if(e===NB.EOF())break;if(e>>3==10)break;a+=7&e,n=B.out;continue}case VB.RUNE_ANY:{const e=t.step(a);if(e===NB.EOF())break;a+=7&e,n=B.out;continue}case VB.CAPTURE:if(s){this.cap[B.arg]=a;break}B.arg<this.ncap&&(this.push(e,n,this.cap[B.arg],!0),this.cap[B.arg]=a),n=B.out;continue;case VB.EMPTY_WIDTH:{const e=t.context(a);if(0!==(B.arg&~e))break;n=B.out;continue}case VB.NOP:n=B.out;continue;case VB.MATCH:{if(r===sB.ANCHOR_BOTH&&a!==this.end)break;if(0===this.ncap)return!0;this.ncap>1&&(this.cap[1]=a);const e=this.matchcap[1];if((-1===e||i&&a>0&&a>e)&&this.matchcap.set(this.cap),!i)return!0;if(a===this.end)return!0;break}case VB.LB_WRITE:case VB.LB_CHECK:throw new UB("Backtracker cannot evaluate Lookbehind instructions");default:throw new UB("bad inst")}break}}return i&&this.matchcap.length>1&&this.matchcap[1]>=0}};const XB=[];var ZB=class e{static shouldBacktrack(e){return e.numInst()<=500}static maxBitStateLen(t){return e.shouldBacktrack(t)?Math.floor(262144/t.numInst()):0}static execute(e,t,n,s,r){const i=e.cond;if(i===vB.EMPTY_ALL)return null;if((s===sB.ANCHOR_START||s===sB.ANCHOR_BOTH)&&0!==n)return null;if(0!==(i&vB.EMPTY_BEGIN_TEXT)&&0!==n)return null;const a=XB.length>0?XB.pop():new YB,o=t.endPos();a.reset(e.prog,o,r);let B=!1;if(0!==(i&vB.EMPTY_BEGIN_TEXT)||s===sB.ANCHOR_START||s===sB.ANCHOR_BOTH)a.ncap>0&&(a.cap[0]=n),a.tryBacktrack(e,t,e.prog.start,n,s)&&(B=!0);else{let r=-1;for(;n<=o&&0!==r;n+=r){if(e.prefix.length>0){const s=t.index(e,n);if(s<0)break;n+=s}if(a.ncap>0&&(a.cap[0]=n),a.tryBacktrack(e,t,e.prog.start,n,s)){B=!0;break}const i=t.step(n);r=i===NB.EOF()?0:7&i}}if(!B)return XB.push(a),null;const c=0===r?[]:vB.toArray(a.matchcap.subarray(0,r));return XB.push(a),c}},ec=class{constructor(e){this.sparse=new Uint32Array(e),this.dense=new Uint32Array(e),this.size=0,this.nextIndex=0}empty(){return this.nextIndex>=this.size}next(){return this.dense[this.nextIndex++]}clear(){this.size=0,this.nextIndex=0}contains(e){return e<this.sparse.length&&this.sparse[e]<this.size&&this.dense[this.sparse[e]]===e}insert(e){this.contains(e)||this.insertNew(e)}insertNew(e){e>=this.sparse.length||(this.sparse[e]=this.size,this.dense[this.size]=e,this.size++)}};var tc=class{constructor(e){this.start=e.start,this.numCap=e.numCap,this.inst=new Array(e.inst.length);for(let t=0;t<e.inst.length;t++){const n=e.inst[t],s=new VB(n.op);s.out=n.out,s.arg=n.arg,s.runes=n.runes?new Int32Array(n.runes):new Int32Array(0),s.next=null,this.inst[t]=s}}};var nc=class e{static compile(e){if(0===e.start)return null;if(e.numLb>0)return null;const t=e.inst[e.start];if(t.op!==VB.EMPTY_WIDTH||0===(t.arg&vB.EMPTY_BEGIN_TEXT))return null;let n=!1;for(let t=0;t<e.inst.length;t++)if(e.inst[t].op===VB.ALT||e.inst[t].op===VB.ALT_MATCH){n=!0;break}for(let t=0;t<e.inst.length;t++){const s=e.inst[t],r=e.inst[s.out].op;switch(s.op){case VB.ALT:case VB.ALT_MATCH:if(r===VB.MATCH||e.inst[s.arg].op===VB.MATCH)return null;break;case VB.EMPTY_WIDTH:if(r===VB.MATCH){if((s.arg&vB.EMPTY_END_TEXT)===vB.EMPTY_END_TEXT)continue;return null}break;default:if(r===VB.MATCH&&n)return null}}let s=(e=>{const t=new tc(e);for(let e=0;e<t.inst.length;e++){const n=t.inst[e];if(n.op!==VB.ALT&&n.op!==VB.ALT_MATCH)continue;let s="out",r="arg",i=t.inst[n[r]];if(i.op!==VB.ALT&&i.op!==VB.ALT_MATCH&&(s="arg",r="out",i=t.inst[n[r]],i.op!==VB.ALT&&i.op!==VB.ALT_MATCH))continue;const a=t.inst[n[s]];if(a.op===VB.ALT||a.op===VB.ALT_MATCH)continue;let o="out",B="arg",c=!1;i.out===e?c=!0:i.arg===e&&(c=!0,o="arg",B="out"),c&&(i[o]=n[s]),n[s]===i[o]&&(n[r]=i[B])}return t})(e);return s=(e=>{if(e.inst.length>=1e3)return null;const t=new ec(e.inst.length),n=new ec(e.inst.length),s=new Array(e.inst.length),r=new Array(e.inst.length).fill(!1),i=a=>{let o=!0;const B=e.inst[a];if(n.contains(a))return!0;switch(n.insert(a),B.op){case VB.ALT:case VB.ALT_MATCH:{o=i(B.out)&&i(B.arg);let e=r[B.out],t=r[B.arg];if(e&&t)return!1;if(t){const n=B.out;B.out=B.arg,B.arg=n;const s=e;e=t,t=s}e&&(r[a]=!0,B.op=VB.ALT_MATCH);const n=((e,t,n,s)=>{const r=e.length,i=t.length;let a=0,o=0;const B=[],c=[];let l=!0,u=-1;const h=r=>{const i=r?e:t,l=r?a:o,h=r?n:s;return!(u>0&&i[l]<=B[u]||(B.push(i[l],i[l+1]),r?a+=2:o+=2,u+=2,c.push(h),0))};for(;a<r||o<i;)if(l=o>=i?h(!0):a>=r||t[o]<e[a]?h(!1):h(!0),!l)return null;return{merged:B,next:c}})(s[B.out]||[],s[B.arg]||[],B.out,B.arg);if(!n)return!1;s[a]=new Int32Array(n.merged),B.next=new Uint32Array(n.next);break}case VB.CAPTURE:case VB.EMPTY_WIDTH:case VB.NOP:o=i(B.out),r[a]=r[B.out],s[a]=s[B.out]?new Int32Array(s[B.out]):new Int32Array(0),B.next=new Uint32Array(Math.floor(s[a].length/2)+1).fill(B.out);break;case VB.MATCH:case VB.FAIL:r[a]=B.op===VB.MATCH;break;case VB.RUNE:{if(r[a]=!1,B.next&&B.next.length>0)break;if(t.insert(B.out),!B.runes||0===B.runes.length){s[a]=new Int32Array(0),B.next=new Uint32Array([B.out]);break}let e=[];if(1===B.runes.length&&0!==(B.arg&sB.FOLD_CASE)){const t=B.runes[0];e.push(t,t);for(let n=yB.simpleFold(t);n!==t;n=yB.simpleFold(n))e.push(n,n);e.sort((e,t)=>e-t)}else for(let t=0;t<B.runes.length;t++)e.push(B.runes[t]);s[a]=new Int32Array(e),B.next=new Uint32Array(Math.floor(e.length/2)+1).fill(B.out),B.op=VB.RUNE;break}case VB.RUNE1:{if(r[a]=!1,B.next&&B.next.length>0)break;t.insert(B.out);let e=[];if(0!==(B.arg&sB.FOLD_CASE)){const t=B.runes[0];e.push(t,t);for(let n=yB.simpleFold(t);n!==t;n=yB.simpleFold(n))e.push(n,n);e.sort((e,t)=>e-t)}else e.push(B.runes[0],B.runes[0]);s[a]=new Int32Array(e),B.next=new Uint32Array(Math.floor(e.length/2)+1).fill(B.out),B.op=VB.RUNE;break}case VB.RUNE_ANY:if(r[a]=!1,B.next&&B.next.length>0)break;t.insert(B.out),s[a]=new Int32Array([0,yB.MAX_RUNE]),B.next=new Uint32Array([B.out]);break;case VB.RUNE_ANY_NOT_NL:if(r[a]=!1,B.next&&B.next.length>0)break;t.insert(B.out),s[a]=new Int32Array([0,9,11,yB.MAX_RUNE]),B.next=new Uint32Array(Math.floor(s[a].length/2)+1).fill(B.out)}return o};for(t.clear(),t.insert(e.start);!t.empty();)if(n.clear(),!i(t.next()))return null;for(let t=0;t<e.inst.length;t++)s[t]&&(e.inst[t].runes=s[t]);return e})(s),null!==s&&((e,t)=>{for(let n=0;n<t.inst.length;n++){const s=t.inst[n];switch(s.op){case VB.ALT:case VB.ALT_MATCH:case VB.RUNE:break;case VB.CAPTURE:case VB.EMPTY_WIDTH:case VB.NOP:case VB.MATCH:case VB.FAIL:e.inst[n].next=null;break;case VB.RUNE1:case VB.RUNE_ANY:case VB.RUNE_ANY_NOT_NL:e.inst[n].next=null,e.inst[n].op=s.op,e.inst[n].runes=s.runes?new Int32Array(s.runes):new Int32Array(0)}}})(s,e),s}static next(e,t){const n=e.matchRunePos(t);return n>=0?e.next[n]:e.op===VB.ALT_MATCH?e.out:0}static execute(t,n,s,r,i){const a=t.onepass;if(!a)return null;const o=new Int32Array(i).fill(-1);let B=!1,c=n.step(s),l=c>>3,u=7&c,h=NB.EOF(),p=-1,d=0;c!==NB.EOF()&&(h=n.step(s+u),h!==NB.EOF()&&(p=h>>3,d=7&h));let f,C=0===s?vB.emptyOpContext(-1,l):n.context(s),g=a.start;for(;;){switch(f=a.inst[g],g=f.out,f.op){case VB.MATCH:return r===sB.ANCHOR_BOTH&&s!==n.endPos()?null:(B=!0,o.length>0&&(o[0]=0,o[1]=s),0===i?[]:vB.toArray(o));case VB.RUNE:if(!f.matchRune(l))return null;break;case VB.RUNE1:if(l!==f.runes[0])return null;break;case VB.RUNE_ANY:break;case VB.RUNE_ANY_NOT_NL:if(10===l)return null;break;case VB.ALT:case VB.ALT_MATCH:g=e.next(f,l);continue;case VB.FAIL:return null;case VB.NOP:continue;case VB.EMPTY_WIDTH:if(0!==(f.arg&~C))return null;continue;case VB.CAPTURE:f.arg<o.length&&(o[f.arg]=s);continue;default:throw new UB("bad inst")}if(0===u)break;C=vB.emptyOpContext(l,p),s+=u,l=p,u=d,-1!==l&&(h=n.step(s+u),h!==NB.EOF()?(p=h>>3,d=7&h):(p=-1,d=0))}return B?0===i?[]:vB.toArray(o):null}},sc=class e{static Op=IB(["NO_MATCH","EMPTY_MATCH","LITERAL","CHAR_CLASS","ANY_CHAR_NOT_NL","ANY_CHAR","BEGIN_LINE","END_LINE","BEGIN_TEXT","END_TEXT","WORD_BOUNDARY","NO_WORD_BOUNDARY","CAPTURE","STAR","PLUS","QUEST","REPEAT","CONCAT","ALTERNATE","PLB","NLB","LEFT_PAREN","VERTICAL_BAR"]);static isPseudoOp(t){return t>=e.Op.LEFT_PAREN}static emptySubs(){return[]}static quoteIfHyphen(e){return e===dB.CODES["-"]?"\\":""}static fromRegexp(t){const n=new e(t.op);return n.flags=t.flags,n.subs=t.subs,n.runes=t.runes,n.cap=t.cap,n.min=t.min,n.max=t.max,n.name=t.name,n.namedGroups=t.namedGroups,n.lb=t.lb,n}constructor(t){this.op=t,this.flags=0,this.subs=e.emptySubs(),this.runes=new Int32Array(0),this.min=0,this.max=0,this.cap=0,this.name=null,this.namedGroups=Object.create(null),this.lb=0}reinit(){this.flags=0,this.subs=e.emptySubs(),this.runes=new Int32Array(0),this.cap=0,this.min=0,this.max=0,this.name=null,this.namedGroups=Object.create(null),this.lb=0}toString(){return this.appendTo()}appendTo(){let t="";switch(this.op){case e.Op.NO_MATCH:t+="[^\\x00-\\x{10FFFF}]";break;case e.Op.EMPTY_MATCH:t+="(?:)";break;case e.Op.STAR:case e.Op.PLUS:case e.Op.QUEST:case e.Op.REPEAT:{const n=this.subs[0];switch(n.op>e.Op.CAPTURE||n.op===e.Op.LITERAL&&n.runes.length>1?t+=`(?:${n.appendTo()})`:t+=n.appendTo(),this.op){case e.Op.STAR:t+="*";break;case e.Op.PLUS:t+="+";break;case e.Op.QUEST:t+="?";break;case e.Op.REPEAT:t+=`{${this.min}`,this.min!==this.max&&(t+=",",this.max>=0&&(t+=this.max)),t+="}"}0!==(this.flags&sB.NON_GREEDY)&&(t+="?");break}case e.Op.CONCAT:for(let n of this.subs)n.op===e.Op.ALTERNATE?t+=`(?:${n.appendTo()})`:t+=n.appendTo();break;case e.Op.ALTERNATE:{let e="";for(let n of this.subs)t+=e,e="|",t+=n.appendTo();break}case e.Op.LITERAL:0!==(this.flags&sB.FOLD_CASE)&&(t+="(?i:");for(let e of this.runes)t+=vB.escapeRune(e);0!==(this.flags&sB.FOLD_CASE)&&(t+=")");break;case e.Op.ANY_CHAR_NOT_NL:t+="(?-s:.)";break;case e.Op.ANY_CHAR:t+="(?s:.)";break;case e.Op.PLB:t+=`(?<=${this.subs[0].appendTo()})`;break;case e.Op.NLB:t+=`(?<!${this.subs[0].appendTo()})`;break;case e.Op.CAPTURE:null===this.name||0===this.name.length?t+="(":t+=`(?P<${this.name}>`,this.subs[0].op!==e.Op.EMPTY_MATCH&&(t+=this.subs[0].appendTo()),t+=")";break;case e.Op.BEGIN_TEXT:t+="\\A";break;case e.Op.END_TEXT:0!==(this.flags&sB.WAS_DOLLAR)?t+="(?-m:$)":t+="\\z";break;case e.Op.BEGIN_LINE:t+="^";break;case e.Op.END_LINE:t+="$";break;case e.Op.WORD_BOUNDARY:t+="\\b";break;case e.Op.NO_WORD_BOUNDARY:t+="\\B";break;case e.Op.CHAR_CLASS:if(this.runes.length%2!=0){t+="[invalid char class]";break}if(t+="[",0===this.runes.length)t+="^\\x00-\\x{10FFFF}";else if(0===this.runes[0]&&this.runes[this.runes.length-1]===yB.MAX_RUNE){t+="^";for(let n=1;n<this.runes.length-1;n+=2){const s=this.runes[n]+1,r=this.runes[n+1]-1;t+=e.quoteIfHyphen(s),t+=vB.escapeRune(s),s!==r&&(t+="-",t+=e.quoteIfHyphen(r),t+=vB.escapeRune(r))}}else for(let n=0;n<this.runes.length;n+=2){const s=this.runes[n],r=this.runes[n+1];t+=e.quoteIfHyphen(s),t+=vB.escapeRune(s),s!==r&&(t+="-",t+=e.quoteIfHyphen(r),t+=vB.escapeRune(r))}t+="]";break;default:t+=this.op}return t}maxCap(){let t=0;if(this.op===e.Op.CAPTURE&&(t=this.cap),null!==this.subs)for(let e of this.subs){const n=e.maxCap();t<n&&(t=n)}return t}equals(t){if(!(null!==t&&t instanceof e))return!1;if(this.op!==t.op)return!1;switch(this.op){case e.Op.END_TEXT:if((this.flags&sB.WAS_DOLLAR)!==(t.flags&sB.WAS_DOLLAR))return!1;break;case e.Op.LITERAL:case e.Op.CHAR_CLASS:if((this.flags&sB.FOLD_CASE)!==(t.flags&sB.FOLD_CASE))return!1;if(null===this.runes&&null===t.runes)break;if(null===this.runes||null===t.runes)return!1;if(this.runes.length!==t.runes.length)return!1;for(let e=0;e<this.runes.length;e++)if(this.runes[e]!==t.runes[e])return!1;break;case e.Op.ALTERNATE:case e.Op.CONCAT:if(this.subs.length!==t.subs.length)return!1;for(let e=0;e<this.subs.length;++e)if(!this.subs[e].equals(t.subs[e]))return!1;break;case e.Op.STAR:case e.Op.PLUS:case e.Op.QUEST:if((this.flags&sB.NON_GREEDY)!==(t.flags&sB.NON_GREEDY)||!this.subs[0].equals(t.subs[0]))return!1;break;case e.Op.REPEAT:if((this.flags&sB.NON_GREEDY)!==(t.flags&sB.NON_GREEDY)||this.min!==t.min||this.max!==t.max||!this.subs[0].equals(t.subs[0]))return!1;break;case e.Op.CAPTURE:if(this.cap!==t.cap||(null===this.name?null!==t.name:this.name!==t.name)||!this.subs[0].equals(t.subs[0]))return!1;break;case e.Op.PLB:case e.Op.NLB:if(this.lb!==t.lb||!this.subs[0].equals(t.subs[0]))return!1}return!0}},rc=class{static walk(e,t){const n=[];let s,r=e;for(;;){if(0===r.subs.length)s=t.leaf(r);else{const e=t.enter(r);if(void 0===e.result){n.push({re:r,state:e,i:0}),r=r.subs[0];continue}s=e.result}for(;;){if(0===n.length)return s;const e=n[n.length-1];if(t.child(e.re,e.state,s,e.i),e.i++,void 0===e.state.result&&e.i<e.re.subs.length){r=e.re.subs[e.i];break}n.pop(),s=void 0!==e.state.result?e.state.result:t.leave(e.re,e.state)}}}},ic=class{constructor(e,t){const n=new Map,s=[0],r=[0],i=[0],a=[0];for(const o of e){let e=0;for(let B=0;B<o.length;B++){const c=e*t+o[B];let l=n.get(c);void 0===l&&(l=s.length,n.set(c,l),s.push(e),r.push(o[B]),i.push(i[e]+1),a.push(0)),e=l}a[e]=1}const o=s.length,B=new Int32Array(o-1);for(let e=1;e<o;e++)B[e-1]=e;B.sort((e,t)=>s[e]-s[t]||r[e]-r[t]);const c=new Int32Array(o+1);for(let e=1;e<o;e++)c[s[e]+1]++;for(let e=0;e<o;e++)c[e+1]+=c[e];const l=new Int32Array(o-1);for(let e=0;e<B.length;e++)l[e]=r[B[e]];this.childStart=c,this.childUnit=l,this.childNode=B;const u=new Int32Array(o);for(let e=0;e<o;e++)u[e]=e;u.sort((e,t)=>i[e]-i[t]);const h=new Int32Array(o),p=Uint8Array.from(a);for(let e=1;e<o;e++){const t=u[e],n=s[t];if(0!==n){let e=h[n],s=this.next(e,r[t]);for(;s<0&&0!==e;)e=h[e],s=this.next(e,r[t]);h[t]=s>=0?s:0}p[t]|=p[h[t]]}this.fail=h,this.match=p}next(e,t){let n=this.childStart[e],s=this.childStart[e+1];const r=this.childUnit;for(;n<s;){const e=n+s>>1,i=r[e];if(i===t)return this.childNode[e];i<t?n=e+1:s=e}return-1}advance(e,t){for(;;){const n=this.next(e,t);if(n>=0)return n;if(0===e)return 0;e=this.fail[e]}}searchUTF16(e,t,n){let s=0;for(let r=t;r<n;r++)if(s=this.advance(s,e.charCodeAt(r)),1===this.match[s])return!0;return!1}searchUTF8(e,t,n){let s=0;for(let r=t;r<n;r++)if(s=this.advance(s,e[r]),1===this.match[s])return!0;return!1}},ac=class e{static Type={NONE:0,EXACT:1,AND:2,OR:3};static MAX_SCANS=32;static MAX_AC_UNITS=1<<18;constructor(t){this.type=t,this.subs=[],this.str="",this.bytes=null,this.cost=t===e.Type.EXACT?1:0,this.allExact=!1,this.ac16=null,this.ac8=null}automaton16(){if(null===this.ac16){const e=this.subs.map(e=>{const t=new Array(e.str.length);for(let n=0;n<e.str.length;n++)t[n]=e.str.charCodeAt(n);return t});this.ac16=new ic(e,65536)}return this.ac16}automaton8(){return null===this.ac8&&(this.ac8=new ic(this.subs.map(e=>e.bytes),256)),this.ac8}eval(t,n){switch(this.type){case e.Type.NONE:return!0;case e.Type.EXACT:return t.hasString(this,n);case e.Type.AND:for(let e=0;e<this.subs.length;e++)if(!this.subs[e].eval(t,n))return!1;return!0;case e.Type.OR:if(this.allExact)return t.hasAnyString(this,n);for(let e=0;e<this.subs.length;e++)if(this.subs[e].eval(t,n))return!0;return!1;default:return!0}}},oc=class e{static build(t){return t?rc.walk(t,e.WALKER):new ac(ac.Type.NONE)}static WALKER={leaf:t=>e.leaf(t),enter:t=>e.enter(t),child:(t,n,s)=>e.child(t,n,s),leave:(t,n)=>e.leave(t,n)};static leaf(e){if(e.op!==sc.Op.LITERAL)return new ac(ac.Type.NONE);if(0===e.runes.length||0!==(e.flags&sB.FOLD_CASE))return new ac(ac.Type.NONE);let t="";for(let n=0;n<e.runes.length;n++){if(yB.isUnsearchable(e.runes[n]))return new ac(ac.Type.NONE);t+=String.fromCodePoint(e.runes[n])}const n=new ac(ac.Type.EXACT);return n.str=t,n.bytes=vB.stringToUtf8ByteArray(n.str),n}static enter(e){switch(e.op){case sc.Op.CAPTURE:case sc.Op.PLUS:return{sub:null};case sc.Op.REPEAT:return e.min>=1?{sub:null}:{result:new ac(ac.Type.NONE)};case sc.Op.CONCAT:return{pf:new ac(ac.Type.AND),subs:[]};case sc.Op.ALTERNATE:return{pf:new ac(ac.Type.OR),subs:[]};default:return{result:new ac(ac.Type.NONE)}}}static child(e,t,n){if(void 0!==t.subs)if(t.pf.type!==ac.Type.AND)if(n.type!==ac.Type.NONE)if(n.type!==ac.Type.OR)t.subs.push(n);else for(let e=0;e<n.subs.length;e++)t.subs.push(n.subs[e]);else t.result=new ac(ac.Type.NONE);else{if(n.type===ac.Type.NONE)return;if(n.type===ac.Type.AND){for(let e=0;e<n.subs.length;e++)t.subs.push(n.subs[e]);return}t.subs.push(n)}else t.sub=n}static leave(e,t){if(void 0===t.subs)return t.sub;const n=t.pf,s=new Set,r=[];for(const e of t.subs){if(e.type===ac.Type.EXACT){if(s.has(e.str))continue;s.add(e.str)}r.push(e)}if(n.type===ac.Type.AND){const e=[];let t=0;for(const n of r)t+n.cost>ac.MAX_SCANS||(e.push(n),t+=n.cost);return 0===e.length?new ac(ac.Type.NONE):1===e.length?e[0]:(n.subs=e,n.cost=t,n)}if(0===r.length)return new ac(ac.Type.NONE);if(1===r.length)return r[0];n.subs=r;let i=!0,a=0,o=0;for(const e of r)e.type!==ac.Type.EXACT?i=!1:o+=e.bytes.length,a+=e.cost;return i?o>ac.MAX_AC_UNITS?new ac(ac.Type.NONE):(n.allExact=!0,n.cost=1,n):a>ac.MAX_SCANS?new ac(ac.Type.NONE):(n.cost=a,n)}},Bc=class{constructor(e=0,t=0){this.head=e,this.tail=t}},cc=class{constructor(){this.inst=[],this.start=0,this.numCap=2,this.lbStarts=[],this.numLb=0,this.lbInst=null}getInst(e){return this.inst[e]}numInst(){return this.inst.length}addInst(e){this.inst.push(new VB(e))}markLookbehindInsts(){const e=new Uint8Array(this.inst.length),t=this.lbStarts.slice();for(;t.length>0;){const n=t.pop();if(0===n||1===e[n])continue;e[n]=1;const s=this.inst[n];switch(s.op){case VB.ALT:case VB.ALT_MATCH:t.push(s.out,s.arg);break;case VB.MATCH:case VB.FAIL:break;default:t.push(s.out)}}this.lbInst=e}skipNop(e){let t=this.inst[e];for(;t.op===VB.NOP||t.op===VB.CAPTURE;)t=this.inst[e],e=t.out;return t}prefix(){let e="",t=this.skipNop(this.start);if(!VB.isRuneOp(t.op)||1!==t.runes.length)return[t.op===VB.MATCH,e];for(;VB.isRuneOp(t.op)&&1===t.runes.length&&0===(t.arg&sB.FOLD_CASE)&&!yB.isUnsearchable(t.runes[0]);)e+=String.fromCodePoint(t.runes[0]),t=this.skipNop(t.out);return[t.op===VB.MATCH,e]}startCond(){let e=0,t=this.start;e:for(;;){const n=this.inst[t];switch(n.op){case VB.EMPTY_WIDTH:e|=n.arg;break;case VB.FAIL:return-1;case VB.CAPTURE:case VB.NOP:break;default:break e}t=n.out}return e}patch(e,t){let n=e.head;for(;0!==n;){const e=this.inst[n>>1];1&n?(n=e.arg,e.arg=t):(n=e.out,e.out=t)}}append(e,t){if(0===e.head)return t;if(0===t.head)return e;const n=this.inst[e.tail>>1];return 1&e.tail?n.arg=t.head:n.out=t.head,new Bc(e.head,t.tail)}toString(){let e="";for(let t=0;t<this.inst.length;t++){const n=e.length;e+=t,t===this.start&&(e+="*"),e+=" ".substring(e.length-n),e+=this.inst[t],e+="\n"}return e}};const lc=new Int32Array([0,dB.CODES["\n"]-1,dB.CODES["\n"]+1,yB.MAX_RUNE]),uc=new Int32Array([0,yB.MAX_RUNE]);var hc=class{constructor(e=0,t=new Bc,n=!1){this.i=e,this.out=t,this.nullable=n}},pc=class e{static compileRegexp(t){const n=new e,s=n.compile(t);return n.prog.patch(s.out,n.newInst(VB.MATCH).i),n.prog.start=s.i,n.prog.markLookbehindInsts(),n.prog}static compileSet(t){const n=new e;if(0===t.length)return n.prog.start=n.newInst(VB.FAIL).i,n.prog.markLookbehindInsts(),n.prog;let s=[];for(let e=0;e<t.length;e++){n.lbOffset=n.prog.numLb;const r=n.compile(t[e]),i=n.newInst(VB.MATCH);n.prog.getInst(i.i).arg=e,n.prog.patch(r.out,i.i),s.push(r.i)}let r=s[0];for(let e=1;e<s.length;e++){const t=n.newInst(VB.ALT),i=n.prog.getInst(t.i);i.out=r,i.arg=s[e],r=t.i}return n.prog.start=r,n.prog.markLookbehindInsts(),n.prog}constructor(){this.prog=new cc,this.newInst(VB.FAIL),this.lbOffset=0,this.runeCache=new Map,this.walker={leaf:e=>this.leaf(e),enter:e=>this.enter(e),child:(e,t,n)=>this.child(e,t,n),leave:(e,t)=>this.leave(e,t)}}newInst(e){return this.prog.addInst(e),new hc(this.prog.numInst()-1,new Bc,!0)}nop(){const e=this.newInst(VB.NOP);return e.out=new Bc(e.i<<1,e.i<<1),e}fail(){return new hc}cap(e){const t=this.newInst(VB.CAPTURE);return t.out=new Bc(t.i<<1,t.i<<1),this.prog.getInst(t.i).arg=e,this.prog.numCap<e+1&&(this.prog.numCap=e+1),t}cat(e,t){return 0===e.i||0===t.i?(this.prog.patch(e.out,0),this.prog.patch(t.out,0),this.fail()):(this.prog.patch(e.out,t.i),new hc(e.i,t.out,e.nullable&&t.nullable))}alt(e,t){if(0===e.i)return t;if(0===t.i)return e;const n=this.newInst(VB.ALT),s=this.prog.getInst(n.i);return s.out=e.i,s.arg=t.i,n.out=this.prog.append(e.out,t.out),n.nullable=e.nullable||t.nullable,n}loop(e,t){const n=this.newInst(VB.ALT),s=this.prog.getInst(n.i);return t?(s.arg=e.i,n.out=new Bc(n.i<<1,n.i<<1)):(s.out=e.i,n.out=new Bc(n.i<<1|1,n.i<<1|1)),this.prog.patch(e.out,n.i),n}quest(e,t){if(0===e.i)return this.nop();const n=this.newInst(VB.ALT),s=this.prog.getInst(n.i);return t?(s.arg=e.i,n.out=new Bc(n.i<<1,n.i<<1)):(s.out=e.i,n.out=new Bc(n.i<<1|1,n.i<<1|1)),n.out=this.prog.append(n.out,e.out),n}star(e,t){return 0===e.i?this.nop():e.nullable?this.quest(this.plus(e,t),t):this.loop(e,t)}plus(e,t){return 0===e.i?this.fail():new hc(e.i,this.loop(e,t).out,e.nullable)}empty(e){const t=this.newInst(VB.EMPTY_WIDTH);return this.prog.getInst(t.i).arg=e,t.out=new Bc(t.i<<1,t.i<<1),t}rune(e,t){const n=this.newInst(VB.RUNE);n.nullable=!1;const s=this.prog.getInst(n.i);return s.runes=e,t&=sB.FOLD_CASE,1===e.length&&yB.simpleFold(e[0])!==e[0]||(t&=-2),s.arg=t,n.out=new Bc(n.i<<1,n.i<<1),0===(t&sB.FOLD_CASE)&&1===e.length||2===e.length&&e[0]===e[1]?s.op=VB.RUNE1:2===e.length&&0===e[0]&&e[1]===yB.MAX_RUNE?s.op=VB.RUNE_ANY:4===e.length&&0===e[0]&&e[1]===dB.CODES["\n"]-1&&e[2]===dB.CODES["\n"]+1&&e[3]===yB.MAX_RUNE&&(s.op=VB.RUNE_ANY_NOT_NL),n}lookBehind(e,t){const n=Math.sign(t)*(Math.abs(t)+this.lbOffset),s=this.newInst(VB.LB_WRITE);this.prog.getInst(s.i).arg=n;const r=this.rune(uc,0),i=this.star(r,!0),a=this.cat(i,e);this.prog.patch(a.out,s.i);const o=this.newInst(VB.LB_CHECK);return this.prog.getInst(o.i).arg=n,this.prog.lbStarts.push(a.i),Math.abs(n)>this.prog.numLb&&(this.prog.numLb=Math.abs(n)),o.out=new Bc(o.i<<1,o.i<<1),o}compile(e){return rc.walk(e,this.walker)}leaf(e){switch(e.op){case sc.Op.NO_MATCH:return this.fail();case sc.Op.EMPTY_MATCH:return this.nop();case sc.Op.LITERAL:{if(0===e.runes.length)return this.nop();let t=null;for(let n of e.runes){let s=this.runeCache.get(n);void 0===s&&(s=new Int32Array([n]),this.runeCache.set(n,s));const r=this.rune(s,e.flags);t=null===t?r:this.cat(t,r)}return t}case sc.Op.CHAR_CLASS:return this.rune(e.runes,e.flags);case sc.Op.ANY_CHAR_NOT_NL:return this.rune(lc,0);case sc.Op.ANY_CHAR:return this.rune(uc,0);case sc.Op.BEGIN_LINE:return this.empty(vB.EMPTY_BEGIN_LINE);case sc.Op.END_LINE:return this.empty(vB.EMPTY_END_LINE);case sc.Op.BEGIN_TEXT:return this.empty(vB.EMPTY_BEGIN_TEXT);case sc.Op.END_TEXT:return this.empty(vB.EMPTY_END_TEXT);case sc.Op.WORD_BOUNDARY:return this.empty(vB.EMPTY_WORD_BOUNDARY);case sc.Op.NO_WORD_BOUNDARY:return this.empty(vB.EMPTY_NO_WORD_BOUNDARY);case sc.Op.CONCAT:case sc.Op.ALTERNATE:return this.nop();default:throw new PB("regexp: unhandled case in compile")}}enter(e){switch(e.op){case sc.Op.PLB:case sc.Op.NLB:case sc.Op.STAR:case sc.Op.PLUS:case sc.Op.QUEST:return{sub:null};case sc.Op.CAPTURE:return{bra:this.cap(e.cap<<1),sub:null};case sc.Op.CONCAT:case sc.Op.ALTERNATE:return{f:null};default:throw new PB("regexp: unhandled case in compile")}}child(e,t,n){e.op===sc.Op.CONCAT?t.f=null===t.f?n:this.cat(t.f,n):e.op===sc.Op.ALTERNATE?t.f=null===t.f?n:this.alt(t.f,n):t.sub=n}leave(e,t){switch(e.op){case sc.Op.PLB:case sc.Op.NLB:return this.lookBehind(t.sub,e.lb);case sc.Op.CAPTURE:{const n=this.cap(e.cap<<1|1);return this.cat(this.cat(t.bra,t.sub),n)}case sc.Op.STAR:return this.star(t.sub,0!==(e.flags&sB.NON_GREEDY));case sc.Op.PLUS:return this.plus(t.sub,0!==(e.flags&sB.NON_GREEDY));case sc.Op.QUEST:return this.quest(t.sub,0!==(e.flags&sB.NON_GREEDY));case sc.Op.CONCAT:case sc.Op.ALTERNATE:return t.f;default:throw new PB("regexp: unhandled case in compile")}}},dc=class e{static simplify(t){return null===t?null:rc.walk(t,e.WALKER)}static WALKER={leaf:t=>e.leaf(t),enter:t=>e.enter(t),child:(t,n,s,r)=>e.child(t,n,s,r),leave:(t,n)=>e.leave(t,n)};static leaf(e){if(e.op===sc.Op.CHAR_CLASS){if(null===e.runes)return e;if(0===e.runes.length)return new sc(sc.Op.NO_MATCH);if(2===e.runes.length&&0===e.runes[0]&&e.runes[1]===yB.MAX_RUNE)return new sc(sc.Op.ANY_CHAR);if(4===e.runes.length&&0===e.runes[0]&&e.runes[1]===dB.CODES["\n"]-1&&e.runes[2]===dB.CODES["\n"]+1&&e.runes[3]===yB.MAX_RUNE)return new sc(sc.Op.ANY_CHAR_NOT_NL)}return e}static enter(e){switch(e.op){case sc.Op.PLB:case sc.Op.NLB:case sc.Op.CAPTURE:case sc.Op.STAR:case sc.Op.PLUS:case sc.Op.QUEST:return{sub:null};case sc.Op.CONCAT:case sc.Op.ALTERNATE:return{subs:[],changed:!1};case sc.Op.REPEAT:return 0===e.min&&0===e.max?{result:new sc(sc.Op.EMPTY_MATCH)}:{sub:null};default:return{result:e}}}static child(e,t,n,s){if(void 0!==t.subs){if(n!==e.subs[s]&&(t.changed=!0),e.op===sc.Op.CONCAT){if(n.op===sc.Op.NO_MATCH)return void(t.result=new sc(sc.Op.NO_MATCH));if(n.op===sc.Op.EMPTY_MATCH)return void(t.changed=!0);if(n.op===sc.Op.CONCAT){t.changed=!0;for(let e=0;e<n.subs.length;e++)t.subs.push(n.subs[e]);return}}else{if(n.op===sc.Op.NO_MATCH)return void(t.changed=!0);if(n.op===sc.Op.ALTERNATE){t.changed=!0;for(let e=0;e<n.subs.length;e++)t.subs.push(n.subs[e]);return}}t.subs.push(n)}else t.sub=n}static leave(t,n){switch(t.op){case sc.Op.PLB:case sc.Op.NLB:case sc.Op.CAPTURE:{const e=n.sub;if(e!==t.subs[0]){const n=sc.fromRegexp(t);return n.runes=new Int32Array(0),n.subs=[e],n}return t}case sc.Op.CONCAT:case sc.Op.ALTERNATE:if(n.changed){const e=n.subs;if(0===e.length)return new sc(t.op===sc.Op.CONCAT?sc.Op.EMPTY_MATCH:sc.Op.NO_MATCH);if(1===e.length)return e[0];const s=sc.fromRegexp(t);return s.runes=new Int32Array(0),s.subs=e,s}return t;case sc.Op.STAR:case sc.Op.PLUS:case sc.Op.QUEST:return e.simplify1(t.op,t.flags,n.sub,t);case sc.Op.REPEAT:return e.simplifyRepeat(t,n.sub);default:return t}}static simplifyRepeat(t,n){if(-1===t.max){if(0===t.min)return e.simplify1(sc.Op.STAR,t.flags,n,null);if(1===t.min)return e.simplify1(sc.Op.PLUS,t.flags,n,null);const s=[];for(let e=0;e<t.min-1;e++)s.push(n);return s.push(e.simplify1(sc.Op.PLUS,t.flags,n,null)),e.concat(s)}if(1===t.min&&1===t.max)return n;let s=null;if(t.min>0){s=[];for(let e=0;e<t.min;e++)s.push(n)}if(t.max>t.min){let r=e.simplify1(sc.Op.QUEST,t.flags,n,null);for(let s=t.min+1;s<t.max;s++)r=e.simplify1(sc.Op.QUEST,t.flags,e.concat([n,r]),null);if(null===s)return r;s.push(r)}return null!==s?e.concat(s):new sc(sc.Op.NO_MATCH)}static concat(e){const t=[];for(let n=0;n<e.length;n++){const s=e[n];if(s.op===sc.Op.NO_MATCH)return new sc(sc.Op.NO_MATCH);if(s.op!==sc.Op.EMPTY_MATCH)if(s.op!==sc.Op.CONCAT)t.push(s);else for(let e=0;e<s.subs.length;e++)t.push(s.subs[e])}if(0===t.length)return new sc(sc.Op.EMPTY_MATCH);if(1===t.length)return t[0];const n=new sc(sc.Op.CONCAT);return n.subs=t,n}static simplify1(e,t,n,s){if(n.op===sc.Op.EMPTY_MATCH)return n;if(n.op===sc.Op.NO_MATCH)return e===sc.Op.PLUS?n:new sc(sc.Op.EMPTY_MATCH);if(e===n.op&&(t&sB.NON_GREEDY)===(n.flags&sB.NON_GREEDY))return n;if(null!==s&&s.op===e&&(s.flags&sB.NON_GREEDY)===(t&sB.NON_GREEDY)&&n===s.subs[0])return s;const r=new sc(e);return r.flags=t,r.subs=[n],r}},fc=class{constructor(e,t){this.sign=e,this.cls=t}};const Cc=[48,57],gc=[9,10,12,13,32,32],mc=[48,57,65,90,95,95,97,122],wc=new Map([["\\d",new fc(1,Cc)],["\\D",new fc(-1,Cc)],["\\s",new fc(1,gc)],["\\S",new fc(-1,gc)],["\\w",new fc(1,mc)],["\\W",new fc(-1,mc)]]),Ec=[48,57,65,90,97,122],yc=[65,90,97,122],Dc=[0,127],_c=[9,9,32,32],bc=[0,31,127,127],vc=[48,57],Ic=[33,126],Tc=[97,122],Oc=[32,126],Ac=[33,47,58,64,91,96,123,126],Sc=[9,13,32,32],Nc=[65,90],Rc=[48,57,65,90,95,95,97,122],kc=[48,57,65,70,97,102],Lc=new Map([["[:alnum:]",new fc(1,Ec)],["[:^alnum:]",new fc(-1,Ec)],["[:alpha:]",new fc(1,yc)],["[:^alpha:]",new fc(-1,yc)],["[:ascii:]",new fc(1,Dc)],["[:^ascii:]",new fc(-1,Dc)],["[:blank:]",new fc(1,_c)],["[:^blank:]",new fc(-1,_c)],["[:cntrl:]",new fc(1,bc)],["[:^cntrl:]",new fc(-1,bc)],["[:digit:]",new fc(1,vc)],["[:^digit:]",new fc(-1,vc)],["[:graph:]",new fc(1,Ic)],["[:^graph:]",new fc(-1,Ic)],["[:lower:]",new fc(1,Tc)],["[:^lower:]",new fc(-1,Tc)],["[:print:]",new fc(1,Oc)],["[:^print:]",new fc(-1,Oc)],["[:punct:]",new fc(1,Ac)],["[:^punct:]",new fc(-1,Ac)],["[:space:]",new fc(1,Sc)],["[:^space:]",new fc(-1,Sc)],["[:upper:]",new fc(1,Nc)],["[:^upper:]",new fc(-1,Nc)],["[:word:]",new fc(1,Rc)],["[:^word:]",new fc(-1,Rc)],["[:xdigit:]",new fc(1,kc)],["[:^xdigit:]",new fc(-1,kc)]]);var xc=class e{static charClassToString(e,t){let n="[";for(let s=0;s<t;s+=2){s>0&&(n+=" ");const t=e[s],r=e[s+1];n+=t===r?`0x${t.toString(16)}`:`0x${t.toString(16)}-0x${r.toString(16)}`}return n+="]",n}static sortRanges(e,t){const n=t>>1,s=new Array(n);for(let e=0;e<n;e++)s[e]=e;s.sort((t,n)=>e[2*t]-e[2*n]||e[2*n+1]-e[2*t+1]);const r=e.slice(0,t);for(let t=0;t<n;t++)e[2*t]=r[2*s[t]],e[2*t+1]=r[2*s[t]+1]}constructor(e=vB.emptyInts()){this.r=e,this.len=e.length}toArray(){return this.r instanceof Int32Array?this.len===this.r.length?this.r:this.r.subarray(0,this.len):new Int32Array(this.len===this.r.length?this.r:this.r.slice(0,this.len))}toGrowableArray(){return Array.isArray(this.r)?(this.r.length=this.len,this.r):Array.from(this.r.subarray(0,this.len))}cleanClass(){if(this.len<4)return this;e.sortRanges(this.r,this.len);let t=2;for(let e=2;e<this.len;e+=2){const n=this.r[e],s=this.r[e+1];n<=this.r[t-1]+1?s>this.r[t-1]&&(this.r[t-1]=s):(this.r[t]=n,this.r[t+1]=s,t+=2)}return this.len=t,this}appendLiteral(e,t){return 0!==(t&sB.FOLD_CASE)?this.appendFoldedRange(e,e):this.appendRange(e,e)}appendRange(e,t){if(this.len>0)for(let n=2;n<=4;n+=2)if(this.len>=n){const s=this.r[this.len-n],r=this.r[this.len-n+1];if(e<=r+1&&s<=t+1)return e<s&&(this.r[this.len-n]=e),t>r&&(this.r[this.len-n+1]=t),this}return this.r[this.len++]=e,this.r[this.len++]=t,this}appendFoldedRange(e,t){if(e<=yB.MIN_FOLD&&t>=yB.MAX_FOLD)return this.appendRange(e,t);if(t<yB.MIN_FOLD||e>yB.MAX_FOLD)return this.appendRange(e,t);e<yB.MIN_FOLD&&(this.appendRange(e,yB.MIN_FOLD-1),e=yB.MIN_FOLD),t>yB.MAX_FOLD&&(this.appendRange(yB.MAX_FOLD+1,t),t=yB.MAX_FOLD);for(let n=e;n<=t;n++){this.appendRange(n,n);for(let e=yB.simpleFold(n);e!==n;e=yB.simpleFold(e))this.appendRange(e,e)}return this}appendClass(e){for(let t=0;t<e.length;t+=2)this.appendRange(e[t],e[t+1]);return this}appendFoldedClass(e){for(let t=0;t<e.length;t+=2)this.appendFoldedRange(e[t],e[t+1]);return this}appendNegatedClass(e){let t=0;for(let n=0;n<e.length;n+=2){const s=e[n],r=e[n+1];t<=s-1&&this.appendRange(t,s-1),t=r+1}return t<=yB.MAX_RUNE&&this.appendRange(t,yB.MAX_RUNE),this}appendTable(e){for(let t=0;t<e.length;++t){const n=e.getLo(t),s=e.getHi(t),r=e.getStride(t);if(1!==r)for(let e=n;e<=s;e+=r)this.appendRange(e,e);else this.appendRange(n,s)}return this}appendNegatedTable(e){let t=0;for(let n=0;n<e.length;++n){const s=e.getLo(n),r=e.getHi(n),i=e.getStride(n);if(1!==i)for(let e=s;e<=r;e+=i)t<=e-1&&this.appendRange(t,e-1),t=e+1;else t<=s-1&&this.appendRange(t,s-1),t=r+1}return t<=yB.MAX_RUNE&&this.appendRange(t,yB.MAX_RUNE),this}appendTableWithSign(e,t){return t<0?this.appendNegatedTable(e):this.appendTable(e)}negateClass(){let e=0,t=0;for(let n=0;n<this.len;n+=2){const s=this.r[n],r=this.r[n+1];e<=s-1&&(this.r[t]=e,this.r[t+1]=s-1,t+=2),e=r+1}return this.len=t,e<=yB.MAX_RUNE&&(this.r[this.len++]=e,this.r[this.len++]=yB.MAX_RUNE),this}appendClassWithSign(e,t){return t<0?this.appendNegatedClass(e):this.appendClass(e)}appendGroup(t,n){let s=t.cls;return n&&(s=(new e).appendFoldedClass(s).cleanClass().toArray()),this.appendClassWithSign(s,t.sign)}toString(){return e.charClassToString(this.r,this.len)}},Fc=class{constructor(e){this.str=e,this.position=0}pos(){return this.position}rewindTo(e){this.position=e}more(){return this.position<this.str.length}peek(){return this.str.codePointAt(this.position)}skip(e){this.position+=e}skipString(e){this.position+=e.length}pop(){const e=this.str.codePointAt(this.position);return this.position+=vB.charCount(e),e}lookingAt(e){return this.str.startsWith(e,this.position)}rest(){return this.str.substring(this.position)}from(e){return this.str.substring(e,this.position)}toString(){return this.rest()}},Pc=class e{static ERR_INTERNAL_ERROR="regexp/syntax: internal error";static ERR_INVALID_CHAR_RANGE="invalid character class range";static ERR_INVALID_ESCAPE="invalid escape sequence";static ERR_INVALID_NAMED_CAPTURE="invalid named capture";static ERR_INVALID_PERL_OP="invalid or unsupported Perl syntax";static ERR_INVALID_REPEAT_OP="invalid nested repetition operator";static ERR_INVALID_REPEAT_SIZE="invalid repeat count";static ERR_MISSING_BRACKET="missing closing ]";static ERR_MISSING_PAREN="missing closing )";static ERR_MISSING_REPEAT_ARGUMENT="missing argument to repetition operator";static ERR_TRAILING_BACKSLASH="trailing backslash at end of expression";static ERR_DUPLICATE_NAMED_CAPTURE="duplicate capture group name";static ERR_UNEXPECTED_PAREN="unexpected )";static ERR_NESTING_DEPTH="expression nests too deeply";static ERR_LARGE="expression too large";static ERR_INVALID_CAPTURE_IN_LOOKBEHIND="invalid capture in lookbehind";static MAX_HEIGHT=1e3;static MAX_SIZE=1398101;static MAX_RUNES=33554432;static ANY_TABLE=new fB(new Uint32Array([0,yB.MAX_RUNE,1]));static ASCII_TABLE=new fB(new Uint32Array([0,127,1]));static ASCII_FOLD_TABLE=new fB(new Uint32Array([0,127,1,383,383,1,8490,8490,1]));static unicodeTable(t){return"Any"===t?{tab:e.ANY_TABLE,fold:e.ANY_TABLE,sign:1}:"Ascii"===t?{tab:e.ASCII_TABLE,fold:e.ASCII_FOLD_TABLE,sign:1}:"Assigned"===t?{tab:EB.CATEGORIES.get("Cn"),fold:EB.CATEGORIES.get("Cn"),sign:-1}:"Lc"===t?{tab:EB.CATEGORIES.get("LC"),fold:EB.FOLD_CATEGORIES.get("LC"),sign:1}:EB.CATEGORIES.has(t)?{tab:EB.CATEGORIES.get(t),fold:EB.FOLD_CATEGORIES.get(t),sign:1}:EB.SCRIPTS.has(t)?{tab:EB.SCRIPTS.get(t),fold:EB.FOLD_SCRIPT.get(t),sign:1}:null}static minFoldRune(e){if(e<yB.MIN_FOLD||e>yB.MAX_FOLD)return e;let t=e;const n=e;for(e=yB.simpleFold(e);e!==n;e=yB.simpleFold(e))t>e&&(t=e);return t}static leadingRegexp(e){if(e.op===sc.Op.EMPTY_MATCH)return null;if(e.op===sc.Op.CONCAT&&e.subs.length>0){const t=e.subs[0];return t.op===sc.Op.EMPTY_MATCH?null:t}return e}static literalRegexp(e,t){const n=new sc(sc.Op.LITERAL);return n.flags=t,n.runes=vB.stringToRunes(e),n}static parse(t,n){return new e(t,n).parseInternal()}static parseRepeat(t){const n=t.pos();if(!t.more()||!t.lookingAt("{"))return-1;t.skip(1);const s=e.parseInt(t);if(-1===s)return-1;if(!t.more())return-1;let r;if(t.lookingAt(",")){if(t.skip(1),!t.more())return-1;if(t.lookingAt("}"))r=-1;else if(-1===(r=e.parseInt(t)))return-1}else r=s;if(!t.more()||!t.lookingAt("}"))return-1;if(t.skip(1),s<0||s>1e3||-2===r||r>1e3||r>=0&&s>r)throw new FB(e.ERR_INVALID_REPEAT_SIZE,t.from(n));return s<<16|r&yB.MAX_BMP}static isValidCaptureName(e){if(0===e.length)return!1;for(let t=0;t<e.length;t++){const n=e.codePointAt(t);if(n!==dB.CODES._&&!vB.isalnum(n))return!1}return!0}static parseInt(e){const t=e.pos();for(;e.more()&&e.peek()>=dB.CODES[0]&&e.peek()<=dB.CODES[9];)e.skip(1);const n=e.from(t);return 0===n.length||n.length>1&&n.codePointAt(0)===dB.CODES[0]?-1:n.length>8?-2:parseInt(n,10)}static isCharClass(e){return e.op===sc.Op.LITERAL&&1===e.runes.length||e.op===sc.Op.CHAR_CLASS||e.op===sc.Op.ANY_CHAR_NOT_NL||e.op===sc.Op.ANY_CHAR}static matchRune(e,t){switch(e.op){case sc.Op.LITERAL:return 1===e.runes.length&&e.runes[0]===t;case sc.Op.CHAR_CLASS:for(let n=0;n<e.runes.length;n+=2)if(e.runes[n]<=t&&t<=e.runes[n+1])return!0;return!1;case sc.Op.ANY_CHAR_NOT_NL:return t!==dB.CODES["\n"];case sc.Op.ANY_CHAR:return!0}return!1}static mergeCharClass(t,n){switch(t.op){case sc.Op.ANY_CHAR:break;case sc.Op.ANY_CHAR_NOT_NL:e.matchRune(n,dB.CODES["\n"])&&(t.op=sc.Op.ANY_CHAR);break;case sc.Op.CHAR_CLASS:{const e=new xc(Array.isArray(t.runes)?t.runes:Array.from(t.runes));n.op===sc.Op.LITERAL?e.appendLiteral(n.runes[0],n.flags):e.appendClass(n.runes),t.runes=e.toGrowableArray();break}case sc.Op.LITERAL:if(n.runes[0]===t.runes[0]&&n.flags===t.flags)break;t.op=sc.Op.CHAR_CLASS,t.runes=(new xc).appendLiteral(t.runes[0],t.flags).appendLiteral(n.runes[0],n.flags).toGrowableArray()}}static parseEscape(t){const n=t.pos();if(t.skip(1),!t.more())throw new FB(e.ERR_TRAILING_BACKSLASH);let s=t.pop();e:switch(s){case dB.CODES[1]:case dB.CODES[2]:case dB.CODES[3]:case dB.CODES[4]:case dB.CODES[5]:case dB.CODES[6]:case dB.CODES[7]:if(!t.more()||t.peek()<dB.CODES[0]||t.peek()>dB.CODES[7])break;case dB.CODES[0]:{let e=s-dB.CODES[0];for(let n=1;n<3&&!(!t.more()||t.peek()<dB.CODES[0]||t.peek()>dB.CODES[7]);n++)e=8*e+t.peek()-dB.CODES[0],t.skip(1);return e}case dB.CODES.x:{if(!t.more())break;if(s=t.pop(),s===dB.CODES["{"]){let e=0,n=0;for(;;){if(!t.more())break e;if(s=t.pop(),s===dB.CODES["}"])break;const r=vB.unhex(s);if(r<0)break e;if(n=16*n+r,n>yB.MAX_RUNE)break e;e++}if(0===e)break e;return n}const e=vB.unhex(s);if(!t.more())break;s=t.pop();const n=vB.unhex(s);if(e<0||n<0)break;return 16*e+n}case dB.CODES.a:return dB.CODES[""];case dB.CODES.f:return dB.CODES["\f"];case dB.CODES.n:return dB.CODES["\n"];case dB.CODES.r:return dB.CODES["\r"];case dB.CODES.t:return dB.CODES["\t"];case dB.CODES.v:return dB.CODES["\v"];default:if(s<=yB.MAX_ASCII&&!vB.isalnum(s))return s}throw new FB(e.ERR_INVALID_ESCAPE,t.from(n))}static parseClassChar(t,n){if(!t.more())throw new FB(e.ERR_MISSING_BRACKET,t.from(n));return t.lookingAt("\\")?e.parseEscape(t):t.pop()}static hasCapture(t){if(null===t)return!1;if(t.op===sc.Op.CAPTURE)return!0;if(t.subs)for(let n of t.subs)if(e.hasCapture(n))return!0;return!1}constructor(e,t=0){this.wholeRegexp=e,this.flags=t,this.numCap=0,this.namedGroups=Object.create(null),this.stack=[],this.free=null,this.numRegexp=0,this.numRunes=0,this.repeats=0,this.height=null,this.size=null,this.nlb=0}newRegexp(e){let t=this.free;return null!==t&&null!==t.subs&&t.subs.length>0?(this.free=t.subs[0],t.reinit(),t.op=e):(t=new sc(e),this.numRegexp+=1),t}reuse(e){null!==this.height&&this.height.has(e)&&this.height.delete(e),null!==e.subs&&e.subs.length>0&&(e.subs[0]=this.free),this.free=e}checkLimits(t){if(this.numRunes>e.MAX_RUNES)throw new FB(e.ERR_LARGE);this.checkSize(t),this.checkHeight(t)}checkSize(t){if(null===this.size){if(0===this.repeats&&(this.repeats=1),t.op===sc.Op.REPEAT){let n=t.max;-1===n&&(n=t.min),n<=0&&(n=1),n>Math.floor(e.MAX_SIZE/this.repeats)?this.repeats=e.MAX_SIZE:this.repeats*=n}if(this.numRegexp<Math.floor(e.MAX_SIZE/this.repeats))return;this.size=new Map;for(let e of this.stack)this.checkSize(e)}if(this.calcSize(t,!0)>e.MAX_SIZE)throw new FB(e.ERR_LARGE)}calcSize(e,t=!1){if(!t&&null!==this.size&&this.size.has(e))return this.size.get(e);let n=0;switch(e.op){case sc.Op.LITERAL:n=e.runes.length;break;case sc.Op.PLB:case sc.Op.NLB:case sc.Op.CAPTURE:case sc.Op.STAR:n=2+this.calcSize(e.subs[0]);break;case sc.Op.PLUS:case sc.Op.QUEST:n=1+this.calcSize(e.subs[0]);break;case sc.Op.CONCAT:for(let t of e.subs)n+=this.calcSize(t);break;case sc.Op.ALTERNATE:for(let t of e.subs)n+=this.calcSize(t);e.subs.length>1&&(n=n+e.subs.length-1);break;case sc.Op.REPEAT:{let t=this.calcSize(e.subs[0]);if(-1===e.max){n=0===e.min?2+t:1+e.min*t;break}n=e.max*t+(e.max-e.min);break}}return n=Math.max(1,n),null===this.size&&(this.size=new Map),this.size.set(e,n),n}checkHeight(t){if(!(this.numRegexp<e.MAX_HEIGHT)){if(null===this.height){this.height=new Map;for(let e of this.stack)this.checkHeight(e)}if(this.calcHeight(t,!0)>e.MAX_HEIGHT)throw new FB(e.ERR_NESTING_DEPTH)}}calcHeight(e,t=!1){if(!t&&null!==this.height&&this.height.has(e))return this.height.get(e);let n=1;for(let t of e.subs){const e=this.calcHeight(t);n<1+e&&(n=1+e)}return null===this.height&&(this.height=new Map),this.height.set(e,n),n}pop(){return this.stack.pop()}popToPseudo(){const e=this.stack.length;let t=e;for(;t>0&&!sc.isPseudoOp(this.stack[t-1].op);)t--;return this.stack.splice(t,e-t)}push(e){if(this.numRunes+=e.runes.length,e.op===sc.Op.CHAR_CLASS&&2===e.runes.length&&e.runes[0]===e.runes[1]){if(this.maybeConcat(e.runes[0],-2&this.flags))return null;e.op=sc.Op.LITERAL,e.runes=[e.runes[0]],e.flags=-2&this.flags}else if(e.op===sc.Op.CHAR_CLASS&&4===e.runes.length&&e.runes[0]===e.runes[1]&&e.runes[2]===e.runes[3]&&yB.simpleFold(e.runes[0])===e.runes[2]&&yB.simpleFold(e.runes[2])===e.runes[0]||e.op===sc.Op.CHAR_CLASS&&2===e.runes.length&&e.runes[0]+1===e.runes[1]&&yB.simpleFold(e.runes[0])===e.runes[1]&&yB.simpleFold(e.runes[1])===e.runes[0]){if(this.maybeConcat(e.runes[0],this.flags|sB.FOLD_CASE))return null;e.op=sc.Op.LITERAL,e.runes=[e.runes[0]],e.flags=this.flags|sB.FOLD_CASE}else this.maybeConcat(-1,0);return this.stack.push(e),this.checkLimits(e),e}maybeConcat(e,t){const n=this.stack.length;if(n<2)return!1;const s=this.stack[n-1],r=this.stack[n-2];if(s.op!==sc.Op.LITERAL||r.op!==sc.Op.LITERAL||(s.flags&sB.FOLD_CASE)!==(r.flags&sB.FOLD_CASE))return!1;Array.isArray(r.runes)||(r.runes=Array.from(r.runes));for(let e=0;e<s.runes.length;e++)r.runes.push(s.runes[e]);return e>=0?(s.runes=[e],s.flags=t,!0):(this.pop(),this.reuse(s),!1)}newLiteral(t,n){const s=this.newRegexp(sc.Op.LITERAL);return s.flags=n,0!==(n&sB.FOLD_CASE)&&(t=e.minFoldRune(t)),s.runes=[t],s}literal(e){this.push(this.newLiteral(e,this.flags))}op(e){const t=this.newRegexp(e);return t.flags=this.flags,this.push(t)}repeat(t,n,s,r,i,a){let o=this.flags;if(0!==(o&sB.PERL_X)&&(i.more()&&i.lookingAt("?")&&(i.skip(1),o^=sB.NON_GREEDY),-1!==a))throw new FB(e.ERR_INVALID_REPEAT_OP,i.from(a));const B=this.stack.length;if(0===B)throw new FB(e.ERR_MISSING_REPEAT_ARGUMENT,i.from(r));const c=this.stack[B-1];if(sc.isPseudoOp(c.op))throw new FB(e.ERR_MISSING_REPEAT_ARGUMENT,i.from(r));const l=this.newRegexp(t);if(l.min=n,l.max=s,l.flags=o,l.subs=[c],this.stack[B-1]=l,this.checkLimits(l),t===sc.Op.REPEAT&&(n>=2||s>=2)&&!this.repeatIsValid(l,1e3))throw new FB(e.ERR_INVALID_REPEAT_SIZE,i.from(r))}repeatIsValid(e,t){if(e.op===sc.Op.REPEAT){let n=e.max;if(0===n)return!0;if(n<0&&(n=e.min),n>t)return!1;n>0&&(t=Math.trunc(t/n))}for(let n of e.subs)if(!this.repeatIsValid(n,t))return!1;return!0}concat(){this.maybeConcat(-1,0);const e=this.popToPseudo();return 0===e.length?this.push(this.newRegexp(sc.Op.EMPTY_MATCH)):this.push(this.collapse(e,sc.Op.CONCAT))}alternate(){const e=this.popToPseudo();return e.length>0&&this.cleanAlt(e[e.length-1]),0===e.length?this.push(this.newRegexp(sc.Op.NO_MATCH)):this.push(this.collapse(e,sc.Op.ALTERNATE))}cleanAlt(e){e.op===sc.Op.CHAR_CLASS&&(e.runes=new xc(Array.from(e.runes)).cleanClass().toArray(),2===e.runes.length&&0===e.runes[0]&&e.runes[1]===yB.MAX_RUNE?(e.runes=new Int32Array(0),e.op=sc.Op.ANY_CHAR):4===e.runes.length&&0===e.runes[0]&&e.runes[1]===dB.CODES["\n"]-1&&e.runes[2]===dB.CODES["\n"]+1&&e.runes[3]===yB.MAX_RUNE&&(e.runes=new Int32Array(0),e.op=sc.Op.ANY_CHAR_NOT_NL))}collapse(e,t){if(1===e.length)return e[0];let n=0;for(let s of e)n+=s.op===t?s.subs.length:1;let s=new Array(n).fill(null),r=0;for(let n of e)if(n.op===t){for(let e=0;e<n.subs.length;e++)s[r++]=n.subs[e];this.reuse(n)}else s[r++]=n;let i=this.newRegexp(t);if(i.subs=s,t===sc.Op.ALTERNATE&&(i.subs=this.factor(i.subs),1===i.subs.length)){const e=i;i=i.subs[0],this.reuse(e)}return i}factor(t){if(t.length<2)return t;let n=0,s=t.length,r=0,i=null,a=0,o=0,B=0;for(let e=0;e<=s;e++){let c=null,l=0,u=0;if(e<s){let s=t[n+e];if(s.op===sc.Op.CONCAT&&s.subs.length>0&&(s=s.subs[0]),s.op===sc.Op.LITERAL&&(c=s.runes,l=s.runes.length,u=s.flags&sB.FOLD_CASE),u===o){let e=0;for(;e<a&&e<l&&i[e]===c[e];)e++;if(e>0){a=e;continue}}}if(e===B);else if(e===B+1)t[r++]=t[n+B];else{const s=this.newRegexp(sc.Op.LITERAL);s.flags=o,s.runes=i.slice(0,a);for(let s=B;s<e;s++)t[n+s]=this.removeLeadingString(t[n+s],a),this.checkLimits(t[n+s]);const c=this.collapse(t.slice(n+B,n+e),sc.Op.ALTERNATE),l=this.newRegexp(sc.Op.CONCAT);l.subs=[s,c],t[r++]=l}B=e,i=c,a=l,o=u}s=r,n=0,B=0,r=0;let c=null;for(let i=0;i<=s;i++){let a=null;if(!(i<s&&(a=e.leadingRegexp(t[n+i]),null!==c&&c.equals(a)&&(e.isCharClass(c)||c.op===sc.Op.REPEAT&&c.min===c.max&&e.isCharClass(c.subs[0]))))){if(i===B);else if(i===B+1)t[r++]=t[n+B];else{const e=c;for(let e=B;e<i;e++){const s=e!==B;t[n+e]=this.removeLeadingRegexp(t[n+e],s),this.checkLimits(t[n+e])}const s=this.collapse(t.slice(n+B,n+i),sc.Op.ALTERNATE),a=this.newRegexp(sc.Op.CONCAT);a.subs=[e,s],t[r++]=a}B=i,c=a}}s=r,n=0,B=0,r=0;for(let i=0;i<=s;i++)if(!(i<s&&e.isCharClass(t[n+i]))){if(i===B);else if(i===B+1)t[r++]=t[n+B];else{let s=B;for(let e=B+1;e<i;e++){const r=t[n+s],i=t[n+e];(r.op<i.op||r.op===i.op&&(null!==r.runes?r.runes.length:0)<(null!==i.runes?i.runes.length:0))&&(s=e)}const a=t[n+B];t[n+B]=t[n+s],t[n+s]=a;for(let s=B+1;s<i;s++)e.mergeCharClass(t[n+B],t[n+s]),this.reuse(t[n+s]);this.cleanAlt(t[n+B]),t[r++]=t[n+B]}i<s&&(t[r++]=t[n+i]),B=i+1}s=r,n=0,B=0,r=0;for(let e=0;e<s;++e)e+1<s&&t[n+e].op===sc.Op.EMPTY_MATCH&&t[n+e+1].op===sc.Op.EMPTY_MATCH||(t[r++]=t[n+e]);return s=r,n=0,t.slice(n,s)}removeLeadingString(e,t){if(e.op===sc.Op.CONCAT&&e.subs.length>0){const n=this.removeLeadingString(e.subs[0],t);if(e.subs[0]=n,n.op===sc.Op.EMPTY_MATCH)switch(this.reuse(n),e.subs.length){case 0:case 1:e.op=sc.Op.EMPTY_MATCH,e.subs=sc.emptySubs();break;case 2:{const t=e;e=e.subs[1],this.reuse(t);break}default:e.subs=e.subs.slice(1,e.subs.length)}return e}return e.op===sc.Op.LITERAL&&(e.runes=e.runes.slice(t,e.runes.length),0===e.runes.length&&(e.op=sc.Op.EMPTY_MATCH)),e}removeLeadingRegexp(e,t){if(e.op===sc.Op.CONCAT&&e.subs.length>0){switch(t&&this.reuse(e.subs[0]),e.subs=e.subs.slice(1,e.subs.length),e.subs.length){case 0:e.op=sc.Op.EMPTY_MATCH,e.subs=sc.emptySubs();break;case 1:{const t=e;e=e.subs[0],this.reuse(t);break}}return e}return t&&this.reuse(e),this.newRegexp(sc.Op.EMPTY_MATCH)}parseInternal(){if(0!==(this.flags&sB.LITERAL))return e.literalRegexp(this.wholeRegexp,this.flags);let t=-1,n=-1,s=-1;const r=new Fc(this.wholeRegexp);for(;r.more();){let i=-1;e:switch(r.peek()){case dB.CODES["("]:if(0!==(this.flags&sB.LOOKBEHIND)){if(r.lookingAt("(?<=")){this.parsePosLookBehind(),r.skip(4);break}if(r.lookingAt("(?<!")){this.parseNegLookBehind(),r.skip(4);break}}if(0!==(this.flags&sB.PERL_X)&&r.lookingAt("(?")){this.parsePerlFlags(r);break}this.op(sc.Op.LEFT_PAREN).cap=++this.numCap,r.skip(1);break;case dB.CODES["|"]:this.parseVerticalBar(),r.skip(1);break;case dB.CODES[")"]:this.parseRightParen(),r.skip(1);break;case dB.CODES["^"]:0!==(this.flags&sB.ONE_LINE)?this.op(sc.Op.BEGIN_TEXT):this.op(sc.Op.BEGIN_LINE),r.skip(1);break;case dB.CODES.$:0!==(this.flags&sB.ONE_LINE)?this.op(sc.Op.END_TEXT).flags|=sB.WAS_DOLLAR:this.op(sc.Op.END_LINE),r.skip(1);break;case dB.CODES["."]:0!==(this.flags&sB.DOT_NL)?this.op(sc.Op.ANY_CHAR):this.op(sc.Op.ANY_CHAR_NOT_NL),r.skip(1);break;case dB.CODES["["]:this.parseClass(r);break;case dB.CODES["*"]:case dB.CODES["+"]:case dB.CODES["?"]:{i=r.pos();let e=null;switch(r.pop()){case dB.CODES["*"]:e=sc.Op.STAR;break;case dB.CODES["+"]:e=sc.Op.PLUS;break;case dB.CODES["?"]:e=sc.Op.QUEST}this.repeat(e,n,s,i,r,t);break}case dB.CODES["{"]:{const a=r.pos(),o=e.parseRepeat(r);if(o<0){r.rewindTo(a),this.literal(r.pop());break}i=a,n=o>>16,s=(o&yB.MAX_BMP)<<16>>16,this.repeat(sc.Op.REPEAT,n,s,i,r,t);break}case dB.CODES["\\"]:{const t=r.pos();if(r.skip(1),0!==(this.flags&sB.PERL_X)&&r.more())switch(r.pop()){case dB.CODES.A:this.op(sc.Op.BEGIN_TEXT);break e;case dB.CODES.b:this.op(sc.Op.WORD_BOUNDARY);break e;case dB.CODES.B:this.op(sc.Op.NO_WORD_BOUNDARY);break e;case dB.CODES.C:throw new FB(e.ERR_INVALID_ESCAPE,"\\C");case dB.CODES.Q:{let e=r.rest();const t=e.indexOf("\\E");t>=0?(e=e.substring(0,t),r.skipString(e),r.skipString("\\E")):r.skipString(e);let n=0;for(;n<e.length;){const t=e.codePointAt(n);this.literal(t),n+=vB.charCount(t)}break e}case dB.CODES.z:this.op(sc.Op.END_TEXT);break e;default:r.rewindTo(t)}else r.rewindTo(t);const n=this.newRegexp(sc.Op.CHAR_CLASS);if(n.flags=this.flags,r.lookingAt("\\p")||r.lookingAt("\\P")){const e=new xc;if(this.parseUnicodeClass(r,e)){n.runes=e.toArray(),this.push(n);break e}}const s=new xc;if(this.parsePerlClassEscape(r,s)){n.runes=s.toArray(),this.push(n);break e}r.rewindTo(t),this.reuse(n),this.literal(e.parseEscape(r));break}default:this.literal(r.pop())}t=i}if(this.concat(),this.swapVerticalBar()&&this.pop(),this.alternate(),1!==this.stack.length)throw new FB(e.ERR_MISSING_PAREN,this.wholeRegexp);return this.stack[0].namedGroups=this.namedGroups,this.stack[0]}parsePerlFlags(t){const n=t.pos(),s=t.rest();if(s.startsWith("(?P<")||s.startsWith("(?<")){const n="P"===s.charAt(2)?4:3,r=s.indexOf(">");if(r<0)throw new FB(e.ERR_INVALID_NAMED_CAPTURE,s);const i=s.substring(n,r);if(t.skipString(i),t.skip(n+1),!e.isValidCaptureName(i))throw new FB(e.ERR_INVALID_NAMED_CAPTURE,s.substring(0,r+1));const a=this.op(sc.Op.LEFT_PAREN);if(a.cap=++this.numCap,this.namedGroups[i])throw new FB(e.ERR_DUPLICATE_NAMED_CAPTURE,i);return this.namedGroups[i]=this.numCap,void(a.name=i)}t.skip(2);let r=this.flags,i=1,a=!1;e:for(;t.more();){const e=t.pop();switch(e){case dB.CODES.i:r|=sB.FOLD_CASE,a=!0;break;case dB.CODES.m:r&=-17,a=!0;break;case dB.CODES.s:r|=sB.DOT_NL,a=!0;break;case dB.CODES.U:r|=sB.NON_GREEDY,a=!0;break;case dB.CODES["-"]:if(i<0)break e;i=-1,r=~r,a=!1;break;case dB.CODES[":"]:case dB.CODES[")"]:if(i<0){if(!a)break e;r=~r}return e===dB.CODES[":"]&&this.op(sc.Op.LEFT_PAREN),void(this.flags=r);default:break e}}throw new FB(e.ERR_INVALID_PERL_OP,t.from(n))}parsePosLookBehind(){const e=this.newRegexp(sc.Op.LEFT_PAREN);return e.flags=this.flags,e.lb=++this.nlb,this.push(e)}parseNegLookBehind(){const e=this.newRegexp(sc.Op.LEFT_PAREN);return e.flags=this.flags,e.lb=-++this.nlb,this.push(e)}parseVerticalBar(){this.concat(),this.swapVerticalBar()||this.op(sc.Op.VERTICAL_BAR)}swapVerticalBar(){const t=this.stack.length;if(t>=3&&this.stack[t-2].op===sc.Op.VERTICAL_BAR&&e.isCharClass(this.stack[t-1])&&e.isCharClass(this.stack[t-3])){let n=this.stack[t-1],s=this.stack[t-3];if(n.op>s.op){const e=s;s=n,n=e,this.stack[t-3]=s}return e.mergeCharClass(s,n),this.reuse(n),this.pop(),!0}if(t>=2){const e=this.stack[t-1],n=this.stack[t-2];if(n.op===sc.Op.VERTICAL_BAR)return t>=3&&this.cleanAlt(this.stack[t-3]),this.stack[t-2]=e,this.stack[t-1]=n,!0}return!1}parseRightParen(){if(this.concat(),this.swapVerticalBar()&&this.pop(),this.alternate(),this.stack.length<2)throw new FB(e.ERR_UNEXPECTED_PAREN,this.wholeRegexp);const t=this.pop(),n=this.pop();if(n.op!==sc.Op.LEFT_PAREN)throw new FB(e.ERR_UNEXPECTED_PAREN,this.wholeRegexp);if(this.flags=n.flags,0!==n.lb){if(e.hasCapture(t))throw new FB(e.ERR_INVALID_CAPTURE_IN_LOOKBEHIND,this.wholeRegexp);return n.lb>0?n.op=sc.Op.PLB:n.op=sc.Op.NLB,n.subs=[t],void this.push(n)}0===n.cap?this.push(t):(n.op=sc.Op.CAPTURE,n.subs=[t],this.push(n))}parsePerlClassEscape(e,t){const n=e.pos();if(0===(this.flags&sB.PERL_X)||!e.more()||e.pop()!==dB.CODES["\\"]||!e.more())return!1;e.pop();const s=e.from(n),r=wc.has(s)?wc.get(s):null;return null!==r&&(t.appendGroup(r,0!==(this.flags&sB.FOLD_CASE)),!0)}parseNamedClass(t,n){const s=t.rest(),r=s.indexOf(":]");if(r<0)return!1;const i=s.substring(0,r+2);t.skipString(i);const a=Lc.has(i)?Lc.get(i):null;if(null===a)throw new FB(e.ERR_INVALID_CHAR_RANGE,i);return n.appendGroup(a,0!==(this.flags&sB.FOLD_CASE)),!0}parseUnicodeClass(t,n){const s=t.pos();if(0===(this.flags&sB.UNICODE_GROUPS)||!t.lookingAt("\\p")&&!t.lookingAt("\\P"))return!1;t.skip(1);let r,i=1,a=t.pop();if(a===dB.CODES.P&&(i=-1),!t.more())throw t.rewindTo(s),new FB(e.ERR_INVALID_CHAR_RANGE,t.rest());if(a=t.pop(),a!==dB.CODES["{"])r=vB.runeToString(a);else{const n=t.rest(),i=n.indexOf("}");if(i<0)throw t.rewindTo(s),new FB(e.ERR_INVALID_CHAR_RANGE,t.rest());r=n.substring(0,i),t.skipString(r),t.skip(1)}0!==r.length&&r.codePointAt(0)===dB.CODES["^"]&&(i=0-i,r=r.substring(1));const o=e.unicodeTable(r);if(null===o)throw new FB(e.ERR_INVALID_CHAR_RANGE,t.from(s));o.sign<0&&(i=0-i);const B=o.tab,c=o.fold;if(0===(this.flags&sB.FOLD_CASE)||null===c)n.appendTableWithSign(B,i);else{const e=(new xc).appendTable(B).appendTable(c).cleanClass().toArray();n.appendClassWithSign(Array.from(e),i)}return!0}parseClass(t){const n=t.pos();t.skip(1);const s=this.newRegexp(sc.Op.CHAR_CLASS);s.flags=this.flags;const r=new xc;let i=1;t.more()&&t.lookingAt("^")&&(i=-1,t.skip(1),0===(this.flags&sB.CLASS_NL)&&r.appendRange(dB.CODES["\n"],dB.CODES["\n"]));let a=!0;for(;!t.more()||t.peek()!==dB.CODES["]"]||a;){if(t.more()&&t.lookingAt("-")&&0===(this.flags&sB.PERL_X)&&!a){const s=t.rest();if("-"===s||!s.startsWith("-]"))throw t.rewindTo(n),new FB(e.ERR_INVALID_CHAR_RANGE,t.rest())}a=!1;const s=t.pos();if(t.lookingAt("[:")){if(this.parseNamedClass(t,r))continue;t.rewindTo(s)}if(this.parseUnicodeClass(t,r))continue;if(this.parsePerlClassEscape(t,r))continue;t.rewindTo(s);const i=e.parseClassChar(t,n);let o=i;if(t.more()&&t.lookingAt("-"))if(t.skip(1),t.more()&&t.lookingAt("]"))t.skip(-1);else if(o=e.parseClassChar(t,n),o<i)throw new FB(e.ERR_INVALID_CHAR_RANGE,t.from(s));0===(this.flags&sB.FOLD_CASE)?r.appendRange(i,o):r.appendFoldedRange(i,o)}t.skip(1),r.cleanClass(),i<0&&r.negateClass(),s.runes=r.toArray(),this.push(s)}},Mc=class e{static initTest(t){const n=e.compile(t),s=new e(n.expr,n.prog,n.numSubexp,n.longest);return s.cond=n.cond,s.prefix=n.prefix,s.prefixUTF8=n.prefixUTF8,s.prefixComplete=n.prefixComplete,s.prefixRune=n.prefixRune,s.prefilter=n.prefilter,s.namedGroups=n.namedGroups,s}static compile(t){return e.compileImpl(t,sB.PERL,!1)}static compilePOSIX(t){return e.compileImpl(t,sB.POSIX,!0)}static compileImpl(t,n,s){let r=Pc.parse(t,n);const i=r.maxCap(),a=r.namedGroups;r=dc.simplify(r);const o=oc.build(r),B=pc.compileRegexp(r),c=new e(t,B,i,s);c.prefilter=o.type===ac.Type.NONE?null:o;const[l,u]=B.prefix();return c.prefixComplete=l,c.prefix=u,c.prefixUTF8=vB.stringToUtf8ByteArray(c.prefix),c.prefix.length>0&&(c.prefixRune=c.prefix.codePointAt(0)),c.namedGroups=a,c}static match(t,n){return e.compile(t).match(n)}constructor(e,t,n=0,s=0){this.expr=e,this.prog=t,this.numSubexp=n,this.longest=s,this.cond=t.startCond(),this.prefix=null,this.prefixUTF8=null,this.prefixComplete=!1,this.prefixRune=0,this.namedGroups=Object.create(null),this.machinePool=[],this.lazyDFA=null,this.onepass=nc.compile(this.prog),this.prefilter=null}get dfa(){return null===this.lazyDFA&&(this.lazyDFA=new WB(this.prog)),this.lazyDFA}matchPrefixComplete(e,t,n,s){if((n===sB.ANCHOR_START||n===sB.ANCHOR_BOTH)&&0!==t)return null;let r=-1,i=-1;const a=e.prefixLength(this);if(n===sB.UNANCHORED){const n=e.index(this,t);if(n<0)return null;r=t+n,i=r+a}else if(n===sB.ANCHOR_BOTH){if(e.endPos()!==a)return null;if(0!==e.index(this,0))return null;r=0,i=a}else if(n===sB.ANCHOR_START){if(0!==e.index(this,0))return null;r=0,i=a}if(r<0)return null;if(s>0){const e=new Int32Array(s).fill(-1);return e[0]=r,e[1]=i,Array.from(e)}return[]}createLookbehindState(){return this.prog.numLb>0?new $B(this.prog):null}executeEngine(e,t,n,s,r=null){if(this.prefixComplete&&(0===s||0===this.numSubexp))return this.matchPrefixComplete(e,t,n,s);if(null!==this.prefilter&&n===sB.UNANCHORED&&!this.prefilter.eval(e,t))return null;if(null!==this.onepass)return nc.execute(this,e,t,n,s);if(s>0)return 0===this.prog.numLb&&e.endPos()<=ZB.maxBitStateLen(this.prog)?ZB.execute(this,e,t,n,s):this.doExecuteNFA(e,t,n,s,r);if(0===this.prog.numLb){const r=this.dfa.match(e,t,n);if(null!==r)return r?[]:null;if(e.endPos()<=ZB.maxBitStateLen(this.prog))return ZB.execute(this,e,t,n,s)}return this.doExecuteNFA(e,t,n,s,r)}numberOfCapturingGroups(){return this.numSubexp}numberOfInstructions(){return this.prog.numInst()}get(){return this.machinePool.length>0?this.machinePool.pop():null}reset(){this.machinePool.length=0}put(e){this.machinePool.push(e)}toString(){return this.expr}doExecuteNFA(e,t,n,s,r=null){let i=this.get();i||(i=JB.fromRE2(this)),i.init(s);const a=i.match(e,t,n,r)?i.submatches():null;return this.put(i),a}match(e){return null!==this.executeEngine(LB.fromUTF16(e),0,sB.UNANCHORED,0)}matchWithGroup(e,t,n,s,r,i=null){return e instanceof TB||(e=vB.isByteArray(e)?SB.utf8(e):SB.utf16(e)),this.matchMachineInput(e,t,n,s,r,i)}matchMachineInput(e,t,n,s,r,i=null){if(t>n)return[!1,null];const a=e.isUTF16Encoding()?LB.fromUTF16(e.asCharSequence(),0,n):LB.fromUTF8(e.asBytes(),0,n),o=this.executeEngine(a,t,s,2*r,i);return null===o?[!1,null]:[!0,o]}matchUTF8(e){return null!==this.executeEngine(LB.fromUTF8(e),0,sB.UNANCHORED,0)}replaceAll(e,t){return this.replaceAllFunc(e,()=>t,2*e.length+1)}replaceFirst(e,t){return this.replaceAllFunc(e,()=>t,1)}replaceAllFunc(e,t,n){let s=0,r=0,i="";const a=LB.fromUTF16(e),o=this.createLookbehindState();let B=0;for(;r<=e.length;){const c=this.executeEngine(a,r,sB.UNANCHORED,2,o);if(null===c||0===c.length)break;i+=e.substring(s,c[0]),(c[1]>s||0===c[0])&&(i+=t(e.substring(c[0],c[1])),B++),s=c[1];const l=7&a.step(r);if(r+l>c[1]?r+=l:r+1>c[1]?r++:r=c[1],B>=n)break}return i+=e.substring(s),i}pad(e){if(null===e)return null;let t=2*(1+this.numSubexp);if(e.length<t){let n=new Array(t).fill(-1);for(let t=0;t<e.length;t++)n[t]=e[t];e=n}return e}allMatches(e,t,n=e=>e){let s=[];const r=e.endPos();t<0&&(t=r+1);let i=0,a=0,o=-1;const B=this.createLookbehindState();for(;a<t&&i<=r;){const t=this.executeEngine(e,i,sB.UNANCHORED,this.prog.numCap,B);if(null===t||0===t.length)break;let c=!0;if(t[1]===i){t[0]===o&&(c=!1);const n=e.step(i);n<0?i=r+1:i+=7&n}else i=t[1];o=t[1],c&&(s.push(n(this.pad(t))),a++)}return s}findUTF8(e){const t=this.executeEngine(LB.fromUTF8(e),0,sB.UNANCHORED,2);return null===t?null:e.slice(t[0],t[1])}findUTF8Index(e){const t=this.executeEngine(LB.fromUTF8(e),0,sB.UNANCHORED,2);return null===t?null:t.slice(0,2)}find(e){const t=this.executeEngine(LB.fromUTF16(e),0,sB.UNANCHORED,2);return null===t?"":e.substring(t[0],t[1])}findIndex(e){return this.executeEngine(LB.fromUTF16(e),0,sB.UNANCHORED,2)}findUTF8Submatch(e){const t=this.executeEngine(LB.fromUTF8(e),0,sB.UNANCHORED,this.prog.numCap);if(null===t)return null;const n=new Array(1+this.numSubexp).fill(null);for(let s=0;s<n.length;s++)2*s<t.length&&t[2*s]>=0&&(n[s]=e.slice(t[2*s],t[2*s+1]));return n}findUTF8SubmatchIndex(e){return this.pad(this.executeEngine(LB.fromUTF8(e),0,sB.UNANCHORED,this.prog.numCap))}findSubmatch(e){const t=this.executeEngine(LB.fromUTF16(e),0,sB.UNANCHORED,this.prog.numCap);if(null===t)return null;const n=new Array(1+this.numSubexp).fill(null);for(let s=0;s<n.length;s++)2*s<t.length&&t[2*s]>=0&&(n[s]=e.substring(t[2*s],t[2*s+1]));return n}findSubmatchIndex(e){return this.pad(this.executeEngine(LB.fromUTF16(e),0,sB.UNANCHORED,this.prog.numCap))}findAllUTF8(e,t){const n=this.allMatches(LB.fromUTF8(e),t,t=>e.slice(t[0],t[1]));return 0===n.length?null:n}findAllUTF8Index(e,t){const n=this.allMatches(LB.fromUTF8(e),t,e=>e.slice(0,2));return 0===n.length?null:n}findAll(e,t){const n=this.allMatches(LB.fromUTF16(e),t,t=>e.substring(t[0],t[1]));return 0===n.length?null:n}findAllIndex(e,t){const n=this.allMatches(LB.fromUTF16(e),t,e=>e.slice(0,2));return 0===n.length?null:n}findAllUTF8Submatch(e,t){const n=this.allMatches(LB.fromUTF8(e),t,t=>{let n=new Array(t.length/2|0).fill(null);for(let s=0;s<n.length;s++)t[2*s]>=0&&(n[s]=e.slice(t[2*s],t[2*s+1]));return n});return 0===n.length?null:n}findAllUTF8SubmatchIndex(e,t){const n=this.allMatches(LB.fromUTF8(e),t);return 0===n.length?null:n}findAllSubmatch(e,t){const n=this.allMatches(LB.fromUTF16(e),t,t=>{let n=new Array(t.length/2|0).fill(null);for(let s=0;s<n.length;s++)t[2*s]>=0&&(n[s]=e.substring(t[2*s],t[2*s+1]));return n});return 0===n.length?null:n}findAllSubmatchIndex(e,t){const n=this.allMatches(LB.fromUTF16(e),t);return 0===n.length?null:n}},Gc=class e{static isHexadecimal(e){return"0"<=e&&e<="9"||"A"<=e&&e<="F"||"a"<=e&&e<="f"}static translate(t){let n="";if(t instanceof RegExp&&(t.ignoreCase&&(n+="i"),t.multiline&&(n+="m"),t.dotAll&&(n+="s"),t=t.source),"string"!=typeof t)return t;let s="",r=!1,i=t.length;0===i&&(s="(?:)",r=!0);let a=!1,o=0;for(;o<i;){let n=t[o];if("\\"===n){if(o+1<i)switch(n=t[o+1],n){case"\\":s+="\\\\",o+=2;continue;case"c":if(o+2<i){let e=t[o+2].charCodeAt(0);if(e>=65&&e<=90||e>=97&&e<=122){let t=e%32;s+="\\x",s+=(t>>4).toString(16).toUpperCase(),s+=(15&t).toString(16).toUpperCase(),o+=3,r=!0;continue}}s+="c",o+=2,r=!0;continue;case"u":if(o+2<i)if("{"===t[o+2]){let n=o+3,a=!1,B=!1;for(;n<i;){const s=t[n];if("}"===s){B=!0;break}if(!e.isHexadecimal(s))break;a=!0,n++}if(B&&a){s+="\\x",o+=2,r=!0;continue}}else if(o+5<i){let n=!0;for(let s=0;s<4;s++)if(!e.isHexadecimal(t[o+2+s])){n=!1;break}if(n){s+="\\x{"+t.substring(o+2,o+6)+"}",o+=6,r=!0;continue}}s+="u",o+=2,r=!0;continue;case"x":{let n=!1;if(o+2<i&&"{"===t[o+2]){let s=o+3,r=!1,a=!1;for(;s<i;){const n=t[s];if("}"===n){a=!0;break}if(!e.isHexadecimal(n))break;r=!0,s++}a&&r&&(n=!0)}else o+3<i&&e.isHexadecimal(t[o+2])&&e.isHexadecimal(t[o+3])&&(n=!0);n?(s+="\\x",o+=2):(s+="x",o+=2,r=!0);continue}case"n":case"r":case"t":case"a":case"f":case"v":case"d":case"D":case"s":case"S":case"w":case"W":case"b":case"B":case"p":case"P":case"A":case"z":case"Q":case"E":case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":s+="\\"+n,o+=2;continue;default:{let e=t.codePointAt(o+1);if(e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122){let n=vB.charCount(e);s+=t.substring(o+1,o+1+n),o+=n+1,r=!0}else{s+="\\";let n=vB.charCount(e);s+=t.substring(o+1,o+1+n),o+=n+1}continue}}}else{if("/"===n){s+="\\/",o+=1,r=!0;continue}if("["===n){if(!a&&"]"===t[o+1]){s+="[^\\x00-\\x{10FFFF}]",o+=2,r=!0;continue}if(!a&&"^"===t[o+1]&&"]"===t[o+2]){s+="[\\x00-\\x{10FFFF}]",o+=3,r=!0;continue}a=!0}else if("]"===n)a=!1;else if(!a&&"("===n&&o+2<i&&"?"===t[o+1]&&"<"===t[o+2]&&o+3<i&&!"=!>)".includes(t[o+3])){s+="(?P<",o+=3,r=!0;continue}}let B=t.codePointAt(o),c=vB.charCount(B);s+=t.substring(o,o+c),o+=c}const B=r?s:t;return n.length>0?`(?${n})${B}`:B}};const Uc=(e,t)=>{const n=e.matchArray();return n.index=e.start(0),n.input=t,n.groups=e.namedGroupsObject(),n};var Hc=class e{static CASE_INSENSITIVE=rB;static DOTALL=iB;static MULTILINE=aB;static DISABLE_UNICODE_GROUPS=oB;static LONGEST_MATCH=BB;static LOOKBEHINDS=cB;static quote(e){return vB.quoteMeta(e)}static quoteReplacement(e,t=!1){return HB.quoteReplacement(e,t)}static translateRegExp(e){return Gc.translate(e)}static compile(t,n=0){let s=t;if(0!==(n&e.CASE_INSENSITIVE)&&(s=`(?i)${s}`),0!==(n&e.DOTALL)&&(s=`(?s)${s}`),0!==(n&e.MULTILINE)&&(s=`(?m)${s}`),-544&n)throw new GB("Flags should only be a combination of MULTILINE, DOTALL, CASE_INSENSITIVE, DISABLE_UNICODE_GROUPS, LONGEST_MATCH, LOOKBEHINDS");let r=sB.PERL;0!==(n&e.DISABLE_UNICODE_GROUPS)&&(r&=-129),0!==(n&e.LOOKBEHINDS)&&(r|=sB.LOOKBEHIND);const i=new e(t,n);return i.re2Input=Mc.compileImpl(s,r,0!==(n&e.LONGEST_MATCH)),i}static matches(t,n){return e.compile(t).testExact(n)}static initTest(t,n,s){if(null==t)throw new Error("pattern is null");if(null==s)throw new Error("re2 is null");const r=new e(t,n);return r.re2Input=s,r}constructor(e,t){this.patternInput=e,this.flagsInput=t,this.re2Input=null}reset(){this.re2Input.reset()}flags(){return this.flagsInput}pattern(){return this.patternInput}re2(){return this.re2Input}matches(e){return this.testExact(e)}matcher(e){return vB.isByteArray(e)&&(e=SB.utf8(e)),new HB(this,e)}test(e){return vB.isByteArray(e)?this.re2Input.matchUTF8(e):this.re2Input.match(e)}testExact(e){const t=vB.isByteArray(e)?LB.fromUTF8(e):LB.fromUTF16(e);return null!==this.re2Input.executeEngine(t,0,sB.ANCHOR_BOTH,0)}exec(e){const t=this.matcher(e);return t.find()?Uc(t,e):null}split(e,t=0){const n=this.matcher(e),s=[];let r=0,i=0;for(;n.find();)if(0!==i||0!==n.end()){if(t>0&&s.length===t-1)break;if(i===n.start()){if(0===t){r+=1,i=n.end();continue}}else for(;r>0;)s.push(""),r-=1;s.push(n.substring(i,n.start())),i=n.end()}else i=n.end();if(0===t&&i!==n.inputLength()){for(;r>0;)s.push(""),r-=1;s.push(n.substring(i,n.inputLength()))}return 0===t&&(0!==s.length||i===n.inputLength()&&i>0)||s.push(n.substring(i,n.inputLength())),s}*matchAll(e){const t=this.matcher(e);for(;t.find();)yield Uc(t,e)}toString(){return this.patternInput}programSize(){return this.re2Input.numberOfInstructions()}groupCount(){return this.re2Input.numberOfCapturingGroups()}namedGroups(){return this.re2Input.namedGroups}equals(e){return this===e||null!==e&&this.constructor===e.constructor&&(this.flagsInput===e.flagsInput&&this.patternInput===e.patternInput)}};let Vc="12.19.0";const jc=new ls("@firebase/firestore");function $c(){return jc.logLevel}function Jc(e,...t){if(jc.logLevel<=is.DEBUG){const n=t.map(Kc);jc.debug(`Firestore (${Vc}): ${e}`,...n)}}function qc(e,...t){if(jc.logLevel<=is.ERROR){const n=t.map(Kc);jc.error(`Firestore (${Vc}): ${e}`,...n)}}function zc(e,...t){if(jc.logLevel<=is.WARN){const n=t.map(Kc);jc.warn(`Firestore (${Vc}): ${e}`,...n)}}function Kc(e){if("string"==typeof e)return e;try{return function(e){return JSON.stringify(e)}(e)}catch(t){return e}}function Qc(e,t,n){let s="Unexpected state";"string"==typeof t?s=t:n=t,Wc(e,s,n)}function Wc(e,t,n){let s=`FIRESTORE (${Vc}) INTERNAL ASSERTION FAILED: ${t} (ID: ${e.toString(16)})`;if(void 0!==n)try{s+=" CONTEXT: "+JSON.stringify(n)}catch(e){s+=" CONTEXT: "+n}throw qc(s),new Error(s)}function Yc(e,t,n,s){let r="Unexpected state";"string"==typeof n?r=n:s=n,e||Wc(t,r,s)}function Xc(e,t){return e}function Zc(e){const t="undefined"!=typeof self&&(self.crypto||self.msCrypto),n=new Uint8Array(e);if(t&&"function"==typeof t.getRandomValues)t.getRandomValues(n);else for(let t=0;t<e;t++)n[t]=Math.floor(256*Math.random());return n}class el{static newId(){const e=62*Math.floor(256/62);let t="";for(;t.length<20;){const n=Zc(40);for(let s=0;s<n.length;++s)t.length<20&&n[s]<e&&(t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(n[s]%62))}return t}}function tl(e,t){return e<t?-1:e>t?1:0}function nl(e,t){const n=Math.min(e.length,t.length);for(let s=0;s<n;s++){const n=e.charAt(s),r=t.charAt(s);if(n!==r)return il(n)===il(r)?tl(n,r):il(n)?1:-1}return tl(e.length,t.length)}const sl=55296,rl=57343;function il(e){const t=e.charCodeAt(0);return t>=sl&&t<=rl}function al(e,t,n){return e.length===t.length&&e.every((e,s)=>n(e,t[s]))}class ol{constructor(e,t){this.comparator=e,this.root=t||cl.EMPTY}insert(e,t){return new ol(this.comparator,this.root.insert(e,t,this.comparator).copy(null,null,cl.BLACK,null,null))}remove(e){return new ol(this.comparator,this.root.remove(e,this.comparator).copy(null,null,cl.BLACK,null,null))}get(e){let t=this.root;for(;!t.isEmpty();){const n=this.comparator(e,t.key);if(0===n)return t.value;n<0?t=t.left:n>0&&(t=t.right)}return null}indexOf(e){let t=0,n=this.root;for(;!n.isEmpty();){const s=this.comparator(e,n.key);if(0===s)return t+n.left.size;s<0?n=n.left:(t+=n.left.size+1,n=n.right)}return-1}isEmpty(){return this.root.isEmpty()}get size(){return this.root.size}minKey(){return this.root.minKey()}maxKey(){return this.root.maxKey()}inorderTraversal(e){return this.root.inorderTraversal(e)}forEach(e){this.inorderTraversal((t,n)=>(e(t,n),!1))}toString(){const e=[];return this.inorderTraversal((t,n)=>(e.push(`${t}:${n}`),!1)),`{${e.join(", ")}}`}reverseTraversal(e){return this.root.reverseTraversal(e)}getIterator(){return new Bl(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new Bl(this.root,e,this.comparator,!1)}getReverseIterator(){return new Bl(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new Bl(this.root,e,this.comparator,!0)}}class Bl{constructor(e,t,n,s){this.isReverse=s,this.nodeStack=[];let r=1;for(;!e.isEmpty();)if(r=t?n(e.key,t):1,t&&s&&(r*=-1),r<0)e=this.isReverse?e.left:e.right;else{if(0===r){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}getNext(){let e=this.nodeStack.pop();const t={key:e.key,value:e.value};if(this.isReverse)for(e=e.left;!e.isEmpty();)this.nodeStack.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack.push(e),e=e.left;return t}hasNext(){return this.nodeStack.length>0}peek(){if(0===this.nodeStack.length)return null;const e=this.nodeStack[this.nodeStack.length-1];return{key:e.key,value:e.value}}}class cl{constructor(e,t,n,s,r){this.key=e,this.value=t,this.color=null!=n?n:cl.RED,this.left=null!=s?s:cl.EMPTY,this.right=null!=r?r:cl.EMPTY,this.size=this.left.size+1+this.right.size}copy(e,t,n,s,r){return new cl(null!=e?e:this.key,null!=t?t:this.value,null!=n?n:this.color,null!=s?s:this.left,null!=r?r:this.right)}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min(){return this.left.isEmpty()?this:this.left.min()}minKey(){return this.min().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,t,n){let s=this;const r=n(e,s.key);return s=r<0?s.copy(null,null,null,s.left.insert(e,t,n),null):0===r?s.copy(null,t,null,null,null):s.copy(null,null,null,null,s.right.insert(e,t,n)),s.fixUp()}removeMin(){if(this.left.isEmpty())return cl.EMPTY;let e=this;return e.left.isRed()||e.left.left.isRed()||(e=e.moveRedLeft()),e=e.copy(null,null,null,e.left.removeMin(),null),e.fixUp()}remove(e,t){let n,s=this;if(t(e,s.key)<0)s.left.isEmpty()||s.left.isRed()||s.left.left.isRed()||(s=s.moveRedLeft()),s=s.copy(null,null,null,s.left.remove(e,t),null);else{if(s.left.isRed()&&(s=s.rotateRight()),s.right.isEmpty()||s.right.isRed()||s.right.left.isRed()||(s=s.moveRedRight()),0===t(e,s.key)){if(s.right.isEmpty())return cl.EMPTY;n=s.right.min(),s=s.copy(n.key,n.value,null,null,s.right.removeMin())}s=s.copy(null,null,null,null,s.right.remove(e,t))}return s.fixUp()}isRed(){return this.color}fixUp(){let e=this;return e.right.isRed()&&!e.left.isRed()&&(e=e.rotateLeft()),e.left.isRed()&&e.left.left.isRed()&&(e=e.rotateRight()),e.left.isRed()&&e.right.isRed()&&(e=e.colorFlip()),e}moveRedLeft(){let e=this.colorFlip();return e.right.left.isRed()&&(e=e.copy(null,null,null,null,e.right.rotateRight()),e=e.rotateLeft(),e=e.colorFlip()),e}moveRedRight(){let e=this.colorFlip();return e.left.left.isRed()&&(e=e.rotateRight(),e=e.colorFlip()),e}rotateLeft(){const e=this.copy(null,null,cl.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight(){const e=this.copy(null,null,cl.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip(){const e=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,t)}checkMaxDepth(){const e=this.check();return Math.pow(2,e)<=this.size+1}check(){if(this.isRed()&&this.left.isRed())throw Qc(43730,{key:this.key,value:this.value});if(this.right.isRed())throw Qc(14113,{key:this.key,value:this.value});const e=this.left.check();if(e!==this.right.check())throw Qc(27949);return e+(this.isRed()?0:1)}}cl.EMPTY=null,cl.RED=!0,cl.BLACK=!1,cl.EMPTY=new class{constructor(){this.size=0}get key(){throw Qc(57766)}get value(){throw Qc(16141)}get color(){throw Qc(16727)}get left(){throw Qc(29726)}get right(){throw Qc(36894)}copy(e,t,n,s,r){return this}insert(e,t,n){return new cl(e,t)}remove(e,t){return this}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}};class ll{constructor(e){this.comparator=e,this.data=new ol(this.comparator)}has(e){return null!==this.data.get(e)}first(){return this.data.minKey()}last(){return this.data.maxKey()}get size(){return this.data.size}indexOf(e){return this.data.indexOf(e)}forEach(e){this.data.inorderTraversal((t,n)=>(e(t),!1))}forEachInRange(e,t){const n=this.data.getIteratorFrom(e[0]);for(;n.hasNext();){const s=n.getNext();if(this.comparator(s.key,e[1])>=0)return;t(s.key)}}forEachWhile(e,t){let n;for(n=void 0!==t?this.data.getIteratorFrom(t):this.data.getIterator();n.hasNext();)if(!e(n.getNext().key))return}firstAfterOrEqual(e){const t=this.data.getIteratorFrom(e);return t.hasNext()?t.getNext().key:null}getIterator(){return new ul(this.data.getIterator())}getIteratorFrom(e){return new ul(this.data.getIteratorFrom(e))}add(e){return this.copy(this.data.remove(e).insert(e,!0))}delete(e){return this.has(e)?this.copy(this.data.remove(e)):this}isEmpty(){return this.data.isEmpty()}unionWith(e){let t=this;return t.size<e.size&&(t=e,e=this),e.forEach(e=>{t=t.add(e)}),t}isEqual(e){if(!(e instanceof ll))return!1;if(this.size!==e.size)return!1;const t=this.data.getIterator(),n=e.data.getIterator();for(;t.hasNext();){const e=t.getNext().key,s=n.getNext().key;if(0!==this.comparator(e,s))return!1}return!0}toArray(){const e=[];return this.forEach(t=>{e.push(t)}),e}toString(){const e=[];return this.forEach(t=>e.push(t)),"SortedSet("+e.toString()+")"}copy(e){const t=new ll(this.comparator);return t.data=e,t}}class ul{constructor(e){this.iter=e}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}}const hl={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 pl extends Vn{constructor(e,t){super(e,t),this.code=e,this.message=t,this.toString=()=>`${this.name}: [code=${this.code}]: ${this.message}`}}const dl="__name__";class fl{constructor(e,t,n){void 0===t?t=0:t>e.length&&Qc(637,{offset:t,range:e.length}),void 0===n?n=e.length-t:n>e.length-t&&Qc(1746,{length:n,range:e.length-t}),this.segments=e,this.offset=t,this.len=n}get length(){return this.len}isEqual(e){return 0===fl.comparator(this,e)}child(e){const t=this.segments.slice(this.offset,this.limit());return e instanceof fl?e.forEach(e=>{t.push(e)}):t.push(e),this.construct(t)}limit(){return this.offset+this.length}popFirst(e){return e=void 0===e?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 0===this.length}isPrefixOf(e){if(e.length<this.length)return!1;for(let t=0;t<this.length;t++)if(this.get(t)!==e.get(t))return!1;return!0}isImmediateParentOf(e){if(this.length+1!==e.length)return!1;for(let t=0;t<this.length;t++)if(this.get(t)!==e.get(t))return!1;return!0}forEach(e){for(let t=this.offset,n=this.limit();t<n;t++)e(this.segments[t])}toArray(){return this.segments.slice(this.offset,this.limit())}static comparator(e,t){const n=Math.min(e.length,t.length);for(let s=0;s<n;s++){const n=fl.compareSegments(e.get(s),t.get(s));if(0!==n)return n}return tl(e.length,t.length)}static compareSegments(e,t){const n=fl.isNumericId(e),s=fl.isNumericId(t);return n&&!s?-1:!n&&s?1:n&&s?fl.extractNumericId(e).compare(fl.extractNumericId(t)):nl(e,t)}static isNumericId(e){return e.startsWith("__id")&&e.endsWith("__")}static extractNumericId(e){return qo.fromString(e.substring(4,e.length-2))}}class Cl extends fl{construct(e,t,n){return new Cl(e,t,n)}canonicalString(){return this.toArray().join("/")}toString(){return this.canonicalString()}toStringWithLeadingSlash(){return`/${this.canonicalString()}`}toUriEncodedString(){return this.toArray().map(encodeURIComponent).join("/")}static fromString(...e){const t=[];for(const n of e){if(n.indexOf("//")>=0)throw new pl(hl.INVALID_ARGUMENT,`Invalid segment (${n}). Paths must not contain // in them.`);t.push(...n.split("/").filter(e=>e.length>0))}return new Cl(t)}static emptyPath(){return new Cl([])}}const gl=/^[_a-zA-Z][_a-zA-Z0-9]*$/;let ml=class e extends fl{construct(t,n,s){return new e(t,n,s)}static isValidIdentifier(e){return gl.test(e)}canonicalString(){return this.toArray().map(t=>(t=t.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),e.isValidIdentifier(t)||(t="`"+t+"`"),t)).join(".")}toString(){return this.canonicalString()}isKeyField(){return 1===this.length&&this.get(0)===dl}static keyField(){return new e([dl])}static fromServerFormat(t){const n=[];let s="",r=0;const i=()=>{if(0===s.length)throw new pl(hl.INVALID_ARGUMENT,`Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);n.push(s),s=""};let a=!1;for(;r<t.length;){const e=t[r];if("\\"===e){if(r+1===t.length)throw new pl(hl.INVALID_ARGUMENT,"Path has trailing escape character: "+t);const e=t[r+1];if("\\"!==e&&"."!==e&&"`"!==e)throw new pl(hl.INVALID_ARGUMENT,"Path has invalid escape sequence: "+t);s+=e,r+=2}else"`"===e?(a=!a,r++):"."!==e||a?(s+=e,r++):(i(),r++)}if(i(),a)throw new pl(hl.INVALID_ARGUMENT,"Unterminated ` in path: "+t);return new e(n)}static emptyPath(){return new e([])}};class wl{constructor(e){this.fields=e,e.sort(ml.comparator)}static empty(){return new wl([])}unionWith(e){let t=new ll(ml.comparator);for(const e of this.fields)t=t.add(e);for(const n of e)t=t.add(n);return new wl(t.toArray())}covers(e){for(const t of this.fields)if(t.isPrefixOf(e))return!0;return!1}isEqual(e){return al(this.fields,e.fields,(e,t)=>e.isEqual(t))}}function El(e){let t=0;for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}function yl(e,t){for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t(n,e[n])}function Dl(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}class _l{constructor(e){this.path=e}static fromPath(e){return new _l(Cl.fromString(e))}static fromName(e){return new _l(Cl.fromString(e).popFirst(5))}static empty(){return new _l(Cl.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 null!==e&&0===Cl.comparator(this.path,e.path)}toString(){return this.path.toString()}static comparator(e,t){return Cl.comparator(e.path,t.path)}static isDocumentKey(e){return e.length%2==0}static fromSegments(e){return new _l(new Cl(e.slice()))}}function bl(e){if(!_l.isDocumentKey(e))throw new pl(hl.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${e} has ${e.length}.`)}function vl(e){return"object"==typeof e&&null!==e&&(Object.getPrototypeOf(e)===Object.prototype||null===Object.getPrototypeOf(e))}function Il(e){if(void 0===e)return"undefined";if(null===e)return"null";if("string"==typeof e)return e.length>20&&(e=`${e.substring(0,20)}...`),JSON.stringify(e);if("number"==typeof e||"boolean"==typeof e)return""+e;if("object"==typeof e){if(e instanceof Array)return"an array";{const t=function(e){return e.constructor?e.constructor.name:null}(e);return t?`a custom ${t} object`:"an object"}}return"function"==typeof e?"a function":Qc(12329,{type:typeof e})}function Tl(e,t){if("_delegate"in e&&(e=e._delegate),!(e instanceof t)){if(t.name===e.constructor.name)throw new pl(hl.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const n=Il(e);throw new pl(hl.INVALID_ARGUMENT,`Expected type '${t.name}', but it was: ${n}`)}}return e}function Ol(e,t){const n={typeString:e};return t&&(n.value=t),n}function Al(e,t){if(!vl(e))throw new pl(hl.INVALID_ARGUMENT,"JSON must be an object");let n;for(const s in t)if(t[s]){const r=t[s].typeString,i="value"in t[s]?{value:t[s].value}:void 0;if(!(s in e)){n=`JSON missing required field: '${s}'`;break}const a=e[s];if(r&&typeof a!==r){n=`JSON field '${s}' must be a ${r}.`;break}if(void 0!==i&&a!==i.value){n=`Expected '${s}' field to equal '${i.value}'`;break}}if(n)throw new pl(hl.INVALID_ARGUMENT,n);return!0}const Sl=-62135596800,Nl=1e6;class Rl{static now(){return Rl.fromMillis(Date.now())}static fromDate(e){return Rl.fromMillis(e.getTime())}static fromMillis(e){const t=Math.floor(e/1e3),n=Math.floor((e-1e3*t)*Nl);return new Rl(t,n)}static fromInstant(e){if(!e||"bigint"!=typeof e.t)throw new pl(hl.INVALID_ARGUMENT,"Invalid Temporal.Instant object provided.");return Rl._fromEpochNanoseconds(e.t)}static _fromEpochNanoseconds(e){let t,n;if(e>=0n)t=Number(e/1000000000n),n=Number(e%1000000000n);else{const s=e%1000000000n;0n===s?(t=Number(e/1000000000n),n=0):(t=Number(e/1000000000n-1n),n=Number(s+1000000000n))}return new Rl(t,n)}constructor(e,t){if(this.seconds=e,this.nanoseconds=t,t<0)throw new pl(hl.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(t>=1e9)throw new pl(hl.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(e<Sl)throw new pl(hl.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e);if(e>=253402300800)throw new pl(hl.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/Nl}toInstant(){if("undefined"==typeof Temporal||!Temporal.Instant)throw new pl(hl.FAILED_PRECONDITION,"The Temporal object is not available in the current environment.");const e=1000000000n*BigInt(this.seconds)+BigInt(this.nanoseconds);return Temporal.Instant.__PRIVATE_fromEpochNanoseconds(e)}_compareTo(e){return this.seconds===e.seconds?tl(this.nanoseconds,e.nanoseconds):tl(this.seconds,e.seconds)}isEqual(e){return e.seconds===this.seconds&&e.nanoseconds===this.nanoseconds}toString(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"}toJSON(){return{type:Rl._jsonSchemaVersion,seconds:this.seconds,nanoseconds:this.nanoseconds}}static fromJSON(e){if(Al(e,Rl._jsonSchema))return new Rl(e.seconds,e.nanoseconds)}valueOf(){const e=this.seconds-Sl;return String(e).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}}Rl._jsonSchemaVersion="firestore/timestamp/1.0",Rl._jsonSchema={type:Ol("string",Rl._jsonSchemaVersion),seconds:Ol("number"),nanoseconds:Ol("number")};class kl extends Error{constructor(){super(...arguments),this.name="Base64DecodeError"}}class Ll{constructor(e){this.binaryString=e}static fromBase64String(e){const t=function(e){try{return atob(e)}catch(e){throw"undefined"!=typeof DOMException&&e instanceof DOMException?new kl("Invalid base64 string: "+e):e}}(e);return new Ll(t)}static fromUint8Array(e){const t=function(e){let t="";for(let n=0;n<e.length;++n)t+=String.fromCharCode(e[n]);return t}(e);return new Ll(t)}[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(e){return btoa(e)}(this.binaryString)}toUint8Array(){return function(e){const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}(this.binaryString)}approximateByteSize(){return 2*this.binaryString.length}compareTo(e){return tl(this.binaryString,e.binaryString)}isEqual(e){return this.binaryString===e.binaryString}}Ll.EMPTY_BYTE_STRING=new Ll("");const xl=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function Fl(e){if(Yc(!!e,39018),"string"==typeof e){let t=0;const n=xl.exec(e);if(Yc(!!n,46558,{timestamp:e}),n[1]){let e=n[1];e=(e+"000000000").substr(0,9),t=Number(e)}const s=new Date(e);return{seconds:Math.floor(s.getTime()/1e3),nanos:t}}return{seconds:Pl(e.seconds),nanos:Pl(e.nanos)}}function Pl(e){return"number"==typeof e?e:"string"==typeof e?Number(e):0}function Ml(e){return"string"==typeof e?Ll.fromBase64String(e):Ll.fromUint8Array(e)}const Gl="server_timestamp",Ul="__type__",Hl="__previous_value__",Vl="__local_write_time__";function jl(e){const t=(e?.mapValue?.fields||{})[Ul]?.stringValue;return t===Gl}function $l(e){const t=e.mapValue.fields[Hl];return jl(t)?$l(t):t}function Jl(e){const t=Fl(e.mapValue.fields[Vl].timestampValue);return new Rl(t.seconds,t.nanos)}class ql{constructor(e,t,n,s,r,i,a,o,B,c,l,u,h){this.databaseId=e,this.appId=t,this.persistenceKey=n,this.host=s,this.ssl=r,this.forceLongPolling=i,this.autoDetectLongPolling=a,this.longPollingOptions=o,this.useFetchStreams=B,this.isUsingEmulator=c,this.apiKey=l,this._customHeaders=u,this.grpcFlowControlWindow=h}}const zl="(default)";class Kl{constructor(e,t){this.projectId=e,this.database=t||zl}static empty(){return new Kl("","")}get isDefaultDatabase(){return this.database===zl}isEqual(e){return e instanceof Kl&&e.projectId===this.projectId&&e.database===this.database}}function Ql(e,t){if(!Object.prototype.hasOwnProperty.apply(e.options,["projectId"]))throw new pl(hl.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new Kl(e.options.projectId,t)}function Wl(e){return null==e}function Yl(e){return 0===e&&1/e==-1/0}const Xl="__type__",Zl="__max__",eu={},tu="__vector__",nu="value",su={nullValue:"NULL_VALUE"},ru={booleanValue:!0},iu={booleanValue:!1};function au(e){return"nullValue"in e?0:"booleanValue"in e?1:"integerValue"in e||"doubleValue"in e?2:"timestampValue"in e?3:"stringValue"in e?5:"bytesValue"in e?6:"referenceValue"in e?7:"geoPointValue"in e?8:"arrayValue"in e?9:"mapValue"in e?jl(e)?4:function(e){return(((e.mapValue||{}).fields||{}).__type__||{}).stringValue===Zl}(e)?9007199254740991:Du(e)?10:11:Qc(28295,{value:e})}function ou(e,t,n){if(e===t)return!0;const s=au(e);if(s!==au(t))return!1;switch(s){case 0:case 9007199254740991:return!0;case 1:return e.booleanValue===t.booleanValue;case 4:return Jl(e).isEqual(Jl(t));case 3:return function(e,t){if("string"==typeof e.timestampValue&&"string"==typeof t.timestampValue&&e.timestampValue.length===t.timestampValue.length)return e.timestampValue===t.timestampValue;const n=Fl(e.timestampValue),s=Fl(t.timestampValue);return n.seconds===s.seconds&&n.nanos===s.nanos}(e,t);case 5:return e.stringValue===t.stringValue;case 6:return function(e,t){return Ml(e.bytesValue).isEqual(Ml(t.bytesValue))}(e,t);case 7:return e.referenceValue===t.referenceValue;case 8:return function(e,t){return Pl(e.geoPointValue.latitude)===Pl(t.geoPointValue.latitude)&&Pl(e.geoPointValue.longitude)===Pl(t.geoPointValue.longitude)}(e,t);case 2:return function(e,t,n){if("integerValue"in e&&"integerValue"in t)return Pl(e.integerValue)===Pl(t.integerValue);let s,r;if("doubleValue"in e&&"doubleValue"in t)s=Pl(e.doubleValue),r=Pl(t.doubleValue);else{if(!n?.i)return!1;s=Pl(e.integerValue??e.doubleValue),r=Pl(t.integerValue??t.doubleValue)}return s===r?!!n?.o||Yl(s)===Yl(r):!(void 0!==n&&!n.u)&&isNaN(s)&&isNaN(r)}(e,t,n);case 9:return al(e.arrayValue.values||[],t.arrayValue.values||[],(e,t)=>ou(e,t,n));case 10:case 11:return function(e,t,n){const s=e.mapValue.fields||{},r=t.mapValue.fields||{};if(El(s)!==El(r))return!1;for(const e in s)if(s.hasOwnProperty(e)&&(void 0===r[e]||!ou(s[e],r[e],n)))return!1;return!0}(e,t,n);default:return Qc(52216,{left:e})}}function Bu(e,t){return void 0!==(e.values||[]).find(e=>ou(e,t))}function cu(e,t){if(e===t)return 0;const n=au(e),s=au(t);if(n!==s)return tl(n,s);switch(n){case 0:case 9007199254740991:return 0;case 1:return tl(e.booleanValue,t.booleanValue);case 2:return function(e,t){const n=Pl(e.integerValue||e.doubleValue),s=Pl(t.integerValue||t.doubleValue);return n<s?-1:n>s?1:n===s?0:isNaN(n)?isNaN(s)?0:-1:1}(e,t);case 3:return lu(e.timestampValue,t.timestampValue);case 4:return lu(Jl(e),Jl(t));case 5:return nl(e.stringValue,t.stringValue);case 6:return function(e,t){const n=Ml(e),s=Ml(t);return n.compareTo(s)}(e.bytesValue,t.bytesValue);case 7:return function(e,t){const n=e.split("/"),s=t.split("/");for(let e=0;e<n.length&&e<s.length;e++){const t=tl(n[e],s[e]);if(0!==t)return t}return tl(n.length,s.length)}(e.referenceValue,t.referenceValue);case 8:return function(e,t){const n=tl(Pl(e.latitude),Pl(t.latitude));return 0!==n?n:tl(Pl(e.longitude),Pl(t.longitude))}(e.geoPointValue,t.geoPointValue);case 9:return uu(e.arrayValue,t.arrayValue);case 10:return function(e,t){const n=e.fields||{},s=t.fields||{},r=n[nu]?.arrayValue,i=s[nu]?.arrayValue,a=tl(r?.values?.length||0,i?.values?.length||0);return 0!==a?a:uu(r,i)}(e.mapValue,t.mapValue);case 11:return function(e,t){if(e===eu&&t===eu)return 0;if(e===eu)return 1;if(t===eu)return-1;const n=e.fields||{},s=Object.keys(n),r=t.fields||{},i=Object.keys(r);s.sort(),i.sort();for(let e=0;e<s.length&&e<i.length;++e){const t=nl(s[e],i[e]);if(0!==t)return t;const a=cu(n[s[e]],r[i[e]]);if(0!==a)return a}return tl(s.length,i.length)}(e.mapValue,t.mapValue);default:throw Qc(23264,{l:n})}}function lu(e,t){if("string"==typeof e&&"string"==typeof t&&e.length===t.length)return tl(e,t);const n=Fl(e),s=Fl(t),r=tl(n.seconds,s.seconds);return 0!==r?r:tl(n.nanos,s.nanos)}function uu(e,t){const n=e.values||[],s=t.values||[];for(let e=0;e<n.length&&e<s.length;++e){const t=cu(n[e],s[e]);if(void 0!==t&&0!==t)return t}return tl(n.length,s.length)}function hu(e){return pu(e)}function pu(e){return"nullValue"in e?"null":"booleanValue"in e?""+e.booleanValue:"integerValue"in e?""+e.integerValue:"doubleValue"in e?""+e.doubleValue:"timestampValue"in e?function(e){const t=Fl(e);return`time(${t.seconds},${t.nanos})`}(e.timestampValue):"stringValue"in e?e.stringValue:"bytesValue"in e?function(e){return Ml(e).toBase64()}(e.bytesValue):"referenceValue"in e?function(e){return _l.fromName(e).toString()}(e.referenceValue):"geoPointValue"in e?function(e){return`geo(${e.latitude},${e.longitude})`}(e.geoPointValue):"arrayValue"in e?function(e){let t="[",n=!0;for(const s of e.values||[])n?n=!1:t+=",",t+=pu(s);return t+"]"}(e.arrayValue):"mapValue"in e?function(e){const t=Object.keys(e.fields||{}).sort();let n="{",s=!0;for(const r of t)s?s=!1:n+=",",n+=`${r}:${pu(e.fields[r])}`;return n+"}"}(e.mapValue):Qc(61005,{value:e})}function du(e){switch(au(e)){case 0:case 1:return 4;case 2:return 8;case 3:case 8:return 16;case 4:const t=$l(e);return t?16+du(t):16;case 5:return 2*e.stringValue.length;case 6:return Ml(e.bytesValue).approximateByteSize();case 7:return e.referenceValue.length;case 9:return function(e){return(e.values||[]).reduce((e,t)=>e+du(t),0)}(e.arrayValue);case 10:case 11:return function(e){let t=0;return yl(e.fields,(e,n)=>{t+=e.length+du(n)}),t}(e.mapValue);default:throw Qc(13486,{value:e})}}function fu(e){return!!e&&"integerValue"in e}function Cu(e){return!!e&&"doubleValue"in e}function gu(e){return fu(e)||Cu(e)}function mu(e){return!!e&&"arrayValue"in e}function wu(e){return!!e&&"nullValue"in e}function Eu(e){return!!e&&"doubleValue"in e&&isNaN(Number(e.doubleValue))}function yu(e){return!!e&&"mapValue"in e}function Du(e){const t=(e?.mapValue?.fields||{})[Xl]?.stringValue;return t===tu}function _u(e){return(e?.mapValue?.fields||{})[nu]?.arrayValue}function bu(e){if(e.geoPointValue)return{geoPointValue:{...e.geoPointValue}};if(e.timestampValue&&"object"==typeof e.timestampValue)return{timestampValue:{...e.timestampValue}};if(e.mapValue){const t={mapValue:{fields:{}}};return yl(e.mapValue.fields,(e,n)=>t.mapValue.fields[e]=bu(n)),t}if(e.arrayValue){const t={arrayValue:{values:[]}};for(let n=0;n<(e.arrayValue.values||[]).length;++n)t.arrayValue.values[n]=bu(e.arrayValue.values[n]);return t}return{...e}}class vu{constructor(e){this.value=e}static empty(){return new vu({mapValue:{}})}field(e){if(e.isEmpty())return this.value;{let t=this.value;for(let n=0;n<e.length-1;++n)if(t=(t.mapValue.fields||{})[e.get(n)],!yu(t))return null;return t=(t.mapValue.fields||{})[e.lastSegment()],t||null}}set(e,t){this.getFieldsMap(e.popLast())[e.lastSegment()]=bu(t)}setAll(e){let t=ml.emptyPath(),n={},s=[];e.forEach((e,r)=>{if(!t.isImmediateParentOf(r)){const e=this.getFieldsMap(t);this.applyChanges(e,n,s),n={},s=[],t=r.popLast()}e?n[r.lastSegment()]=bu(e):s.push(r.lastSegment())});const r=this.getFieldsMap(t);this.applyChanges(r,n,s)}delete(e){const t=this.field(e.popLast());yu(t)&&t.mapValue.fields&&delete t.mapValue.fields[e.lastSegment()]}isEqual(e){return ou(this.value,e.value)}getFieldsMap(e){let t=this.value;t.mapValue.fields||(t.mapValue={fields:{}});for(let n=0;n<e.length;++n){let s=t.mapValue.fields[e.get(n)];yu(s)&&s.mapValue.fields||(s={mapValue:{fields:{}}},t.mapValue.fields[e.get(n)]=s),t=s}return t.mapValue.fields}applyChanges(e,t,n){yl(t,(t,n)=>e[t]=n);for(const t of n)delete e[t]}clone(){return new vu(bu(this.value))}}function Iu(e){const t=[];return yl(e.fields,(e,n)=>{const s=new ml([e]);if(yu(n)){const e=Iu(n.mapValue).fields;if(0===e.length)t.push(s);else for(const n of e)t.push(s.child(n))}else t.push(s)}),new wl(t)}function Tu(e,t){if(e.useProto3Json){if(isNaN(t))return{doubleValue:"NaN"};if(t===1/0)return{doubleValue:"Infinity"};if(t===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:Yl(t)?"-0":t}}function Ou(e){return{integerValue:""+e}}function Au(e,t,n){return function(e){return"number"==typeof e&&Number.isInteger(e)&&!Yl(e)&&e<=Number.MAX_SAFE_INTEGER&&e>=Number.MIN_SAFE_INTEGER}(t)?Ou(t):Tu(e,t)}class Su{constructor(){this._=void 0}}function Nu(e,t,n){return e instanceof Lu?function(e,t){const n={fields:{[Ul]:{stringValue:Gl},[Vl]:{timestampValue:{seconds:e.seconds,nanos:e.nanoseconds}}}};return t&&jl(t)&&(t=$l(t)),t&&(n.fields[Hl]=t),{mapValue:n}}(n,t):e instanceof xu?Fu(e,t):e instanceof Pu?Mu(e,t):e instanceof Uu?function(e,t){const n=ku(e,t),s=$u(n)+$u(e.h);return fu(n)&&fu(e.h)?Ou(s):Tu(e.serializer,s)}(e,t):e instanceof Hu?function(e,t){return ju(e,t,Math.min)}(e,t):e instanceof Vu?function(e,t){return ju(e,t,Math.max)}(e,t):void 0}function Ru(e,t,n){return e instanceof xu?Fu(e,t):e instanceof Pu?Mu(e,t):n}function ku(e,t){return e instanceof Uu?gu(t)?t:{integerValue:0}:null}class Lu extends Su{}class xu extends Su{constructor(e){super(),this.elements=e}}function Fu(e,t){const n=Ju(t);for(const t of e.elements)n.some(e=>ou(e,t))||n.push(t);return{arrayValue:{values:n}}}class Pu extends Su{constructor(e){super(),this.elements=e}}function Mu(e,t){let n=Ju(t);for(const t of e.elements)n=n.filter(e=>!ou(e,t));return{arrayValue:{values:n}}}class Gu extends Su{constructor(e,t){super(),this.serializer=e,this.h=t}}class Uu extends Gu{}class Hu extends Gu{}class Vu extends Gu{}function ju(e,t,n){if(!gu(t))return e.h;const s=n($u(t),$u(e.h));return fu(t)&&fu(e.h)?Ou(s):Tu(e.serializer,s)}function $u(e){return Pl(e.integerValue||e.doubleValue)}function Ju(e){return mu(e)&&e.arrayValue.values?e.arrayValue.values.slice():[]}class qu{constructor(e,t){this.version=e,this.transformResults=t}}class zu{constructor(e,t){this.updateTime=e,this.exists=t}static none(){return new zu}static exists(e){return new zu(void 0,e)}static updateTime(e){return new zu(e)}get isNone(){return void 0===this.updateTime&&void 0===this.exists}isEqual(e){return this.exists===e.exists&&(this.updateTime?!!e.updateTime&&this.updateTime.isEqual(e.updateTime):!e.updateTime)}}function Ku(e,t){return void 0!==e.updateTime?t.isFoundDocument()&&t.version.isEqual(e.updateTime):void 0===e.exists||e.exists===t.isFoundDocument()}class Qu{}function Wu(e,t){if(!e.hasLocalMutations||t&&0===t.fields.length)return null;if(null===t)return e.isNoDocument()?new ah(e.key,zu.none()):new th(e.key,e.data,zu.none());{const n=e.data,s=vu.empty();let r=new ll(ml.comparator);for(let e of t.fields)if(!r.has(e)){let t=n.field(e);null===t&&e.length>1&&(e=e.popLast(),t=n.field(e)),null===t?s.delete(e):s.set(e,t),r=r.add(e)}return new nh(e.key,s,new wl(r.toArray()),zu.none())}}function Yu(e,t,n){e instanceof th?function(e,t,n){const s=e.value.clone(),r=rh(e.fieldTransforms,t,n.transformResults);s.setAll(r),t.convertToFoundDocument(n.version,s).setHasCommittedMutations()}(e,t,n):e instanceof nh?function(e,t,n){if(!Ku(e.precondition,t))return void t.convertToUnknownDocument(n.version);const s=rh(e.fieldTransforms,t,n.transformResults),r=t.data;r.setAll(sh(e)),r.setAll(s),t.convertToFoundDocument(n.version,r).setHasCommittedMutations()}(e,t,n):function(e,t,n){t.convertToNoDocument(n.version).setHasCommittedMutations()}(0,t,n)}function Xu(e,t,n,s){return e instanceof th?function(e,t,n,s){if(!Ku(e.precondition,t))return n;const r=e.value.clone(),i=ih(e.fieldTransforms,s,t);return r.setAll(i),t.convertToFoundDocument(t.version,r).setHasLocalMutations(),null}(e,t,n,s):e instanceof nh?function(e,t,n,s){if(!Ku(e.precondition,t))return n;const r=ih(e.fieldTransforms,s,t),i=t.data;return i.setAll(sh(e)),i.setAll(r),t.convertToFoundDocument(t.version,i).setHasLocalMutations(),null===n?null:n.unionWith(e.fieldMask.fields).unionWith(e.fieldTransforms.map(e=>e.field))}(e,t,n,s):function(e,t,n){return Ku(e.precondition,t)?(t.convertToNoDocument(t.version).setHasLocalMutations(),null):n}(e,t,n)}function Zu(e,t){let n=null;for(const s of e.fieldTransforms){const e=t.data.field(s.field),r=ku(s.transform,e||null);null!=r&&(null===n&&(n=vu.empty()),n.set(s.field,r))}return n||null}function eh(e,t){return e.type===t.type&&!!e.key.isEqual(t.key)&&!!e.precondition.isEqual(t.precondition)&&!!function(e,t){return void 0===e&&void 0===t||!(!e||!t)&&al(e,t,(e,t)=>function(e,t){return e.field.isEqual(t.field)&&function(e,t){return e instanceof xu&&t instanceof xu||e instanceof Pu&&t instanceof Pu?al(e.elements,t.elements,ou):e instanceof Uu&&t instanceof Uu||e instanceof Hu&&t instanceof Hu||e instanceof Vu&&t instanceof Vu?ou(e.h,t.h):e instanceof Lu&&t instanceof Lu}(e.transform,t.transform)}(e,t))}(e.fieldTransforms,t.fieldTransforms)&&(0===e.type?e.value.isEqual(t.value):1!==e.type||e.data.isEqual(t.data)&&e.fieldMask.isEqual(t.fieldMask))}class th extends Qu{constructor(e,t,n,s=[]){super(),this.key=e,this.value=t,this.precondition=n,this.fieldTransforms=s,this.type=0}getFieldMask(){return null}}class nh extends Qu{constructor(e,t,n,s,r=[]){super(),this.key=e,this.data=t,this.fieldMask=n,this.precondition=s,this.fieldTransforms=r,this.type=1}getFieldMask(){return this.fieldMask}}function sh(e){const t=new Map;return e.fieldMask.fields.forEach(n=>{if(!n.isEmpty()){const s=e.data.field(n);t.set(n,s)}}),t}function rh(e,t,n){const s=new Map;Yc(e.length===n.length,32656,{T:n.length,P:e.length});for(let r=0;r<n.length;r++){const i=e[r],a=i.transform,o=t.data.field(i.field);s.set(i.field,Ru(a,o,n[r]))}return s}function ih(e,t,n){const s=new Map;for(const r of e){const e=r.transform,i=n.data.field(r.field);s.set(r.field,Nu(e,i,t))}return s}class ah extends Qu{constructor(e,t){super(),this.key=e,this.precondition=t,this.type=2,this.fieldTransforms=[]}getFieldMask(){return null}}class oh extends Qu{constructor(e,t){super(),this.key=e,this.precondition=t,this.type=3,this.fieldTransforms=[]}getFieldMask(){return null}}class Bh{constructor(e,t){this.position=e,this.inclusive=t}}function ch(e,t,n){let s=0;for(let r=0;r<e.position.length;r++){const i=t[r],a=e.position[r];if(s=i.field.isKeyField()?_l.comparator(_l.fromName(a.referenceValue),n.key):cu(a,n.data.field(i.field)),"desc"===i.dir&&(s*=-1),0!==s)break}return s}function lh(e,t){if(null===e)return null===t;if(null===t)return!1;if(e.inclusive!==t.inclusive||e.position.length!==t.position.length)return!1;for(let n=0;n<e.position.length;n++)if(!ou(e.position[n],t.position[n]))return!1;return!0}class uh{}class hh extends uh{constructor(e,t,n){super(),this.field=e,this.op=t,this.value=n}static create(e,t,n){return e.isKeyField()?"in"===t||"not-in"===t?this.createKeyFieldInFilter(e,t,n):new wh(e,t,n):"array-contains"===t?new _h(e,n):"in"===t?new bh(e,n):"not-in"===t?new vh(e,n):"array-contains-any"===t?new Ih(e,n):new hh(e,t,n)}static createKeyFieldInFilter(e,t,n){return"in"===t?new Eh(e,n):new yh(e,n)}matches(e){const t=e.data.field(this.field);return"!="===this.op?null!==t&&void 0===t.nullValue&&this.matchesComparison(cu(t,this.value)):null!==t&&au(this.value)===au(t)&&this.matchesComparison(cu(t,this.value))}matchesComparison(e){switch(this.op){case"<":return e<0;case"<=":return e<=0;case"==":return 0===e;case"!=":return 0!==e;case">":return e>0;case">=":return e>=0;default:return Qc(47266,{operator:this.op})}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}}class ph extends uh{constructor(e,t){super(),this.filters=e,this.op=t,this.I=null}static create(e,t){return new ph(e,t)}matches(e){return dh(this)?void 0===this.filters.find(t=>!t.matches(e)):void 0!==this.filters.find(t=>t.matches(e))}getFlattenedFilters(){return null!==this.I||(this.I=this.filters.reduce((e,t)=>e.concat(t.getFlattenedFilters()),[])),this.I}getFilters(){return Object.assign([],this.filters)}}function dh(e){return"and"===e.op}function fh(e){return function(e){for(const t of e.filters)if(t instanceof ph)return!1;return!0}(e)&&dh(e)}function Ch(e){if(e instanceof hh)return e.field.canonicalString()+e.op.toString()+hu(e.value);if(fh(e))return e.filters.map(e=>Ch(e)).join(",");{const t=e.filters.map(e=>Ch(e)).join(",");return`${e.op}(${t})`}}function gh(e,t){return e instanceof hh?function(e,t){return t instanceof hh&&e.op===t.op&&e.field.isEqual(t.field)&&ou(e.value,t.value)}(e,t):e instanceof ph?function(e,t){return t instanceof ph&&e.op===t.op&&e.filters.length===t.filters.length&&e.filters.reduce((e,n,s)=>e&&gh(n,t.filters[s]),!0)}(e,t):void Qc(19439)}function mh(e){return e instanceof hh?function(e){return`${e.field.canonicalString()} ${e.op} ${hu(e.value)}`}(e):e instanceof ph?function(e){return e.op.toString()+" {"+e.getFilters().map(mh).join(" ,")+"}"}(e):"Filter"}class wh extends hh{constructor(e,t,n){super(e,t,n),this.key=_l.fromName(n.referenceValue)}matches(e){const t=_l.comparator(e.key,this.key);return this.matchesComparison(t)}}class Eh extends hh{constructor(e,t){super(e,"in",t),this.keys=Dh("in",t)}matches(e){return this.keys.some(t=>t.isEqual(e.key))}}class yh extends hh{constructor(e,t){super(e,"not-in",t),this.keys=Dh("not-in",t)}matches(e){return!this.keys.some(t=>t.isEqual(e.key))}}function Dh(e,t){return(t.arrayValue?.values||[]).map(e=>_l.fromName(e.referenceValue))}class _h extends hh{constructor(e,t){super(e,"array-contains",t)}matches(e){const t=e.data.field(this.field);return mu(t)&&Bu(t.arrayValue,this.value)}}class bh extends hh{constructor(e,t){super(e,"in",t)}matches(e){const t=e.data.field(this.field);return null!==t&&Bu(this.value.arrayValue,t)}}class vh extends hh{constructor(e,t){super(e,"not-in",t)}matches(e){if(Bu(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const t=e.data.field(this.field);return null!==t&&void 0===t.nullValue&&!Bu(this.value.arrayValue,t)}}class Ih extends hh{constructor(e,t){super(e,"array-contains-any",t)}matches(e){const t=e.data.field(this.field);return!(!mu(t)||!t.arrayValue.values)&&t.arrayValue.values.some(e=>Bu(this.value.arrayValue,e))}}class Th{constructor(e,t="asc"){this.field=e,this.dir=t}}function Oh(e,t){return e.dir===t.dir&&e.field.isEqual(t.field)}class Ah{static fromTimestamp(e){return new Ah(e)}static min(){return new Ah(new Rl(0,0))}static max(){return new Ah(new Rl(253402300799,999999999))}constructor(e){this.timestamp=e}compareTo(e){return this.timestamp._compareTo(e.timestamp)}isEqual(e){return this.timestamp.isEqual(e.timestamp)}toMicroseconds(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3}toString(){return"SnapshotVersion("+this.timestamp.toString()+")"}toTimestamp(){return this.timestamp}}class Sh{constructor(e,t,n,s,r,i,a){this.key=e,this.documentType=t,this.version=n,this.readTime=s,this.createTime=r,this.data=i,this.documentState=a}static newInvalidDocument(e){return new Sh(e,0,Ah.min(),Ah.min(),Ah.min(),vu.empty(),0)}static newFoundDocument(e,t,n,s){return new Sh(e,1,t,Ah.min(),n,s,0)}static newNoDocument(e,t){return new Sh(e,2,t,Ah.min(),Ah.min(),vu.empty(),0)}static newUnknownDocument(e,t){return new Sh(e,3,t,Ah.min(),Ah.min(),vu.empty(),2)}convertToFoundDocument(e,t){return!this.createTime.isEqual(Ah.min())||2!==this.documentType&&0!==this.documentType||(this.createTime=e),this.version=e,this.documentType=1,this.data=t,this.documentState=0,this}convertToNoDocument(e){return this.version=e,this.documentType=2,this.data=vu.empty(),this.documentState=0,this}convertToUnknownDocument(e){return this.version=e,this.documentType=3,this.data=vu.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this.version=Ah.min(),this}setReadTime(e){return this.readTime=e,this}get hasLocalMutations(){return 1===this.documentState}get hasCommittedMutations(){return 2===this.documentState}get hasPendingWrites(){return this.hasLocalMutations||this.hasCommittedMutations}isValidDocument(){return 0!==this.documentType}isFoundDocument(){return 1===this.documentType}isNoDocument(){return 2===this.documentType}isUnknownDocument(){return 3===this.documentType}isEqual(e){return e instanceof Sh&&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 Sh(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}})`}}function Nh(e){return new Rh(e.readTime,e.key,-1)}class Rh{constructor(e,t,n){this.readTime=e,this.documentKey=t,this.largestBatchId=n}static min(){return new Rh(Ah.min(),_l.empty(),-1)}static max(){return new Rh(Ah.max(),_l.empty(),-1)}}function kh(e,t){let n=e.readTime.compareTo(t.readTime);return 0!==n?n:(n=_l.comparator(e.documentKey,t.documentKey),0!==n?n:tl(e.largestBatchId,t.largestBatchId))}class Lh{constructor(e,t=null,n=[],s=[],r=null,i=null,a=null){this.path=e,this.collectionGroup=t,this.orderBy=n,this.filters=s,this.limit=r,this.startAt=i,this.endAt=a,this.R=null}}function xh(e,t=null,n=[],s=[],r=null,i=null,a=null){return new Lh(e,t,n,s,r,i,a)}function Fh(e){const t=Xc(e);if(null===t.R){let e=t.path.canonicalString();null!==t.collectionGroup&&(e+="|cg:"+t.collectionGroup),e+="|f:",e+=t.filters.map(e=>Ch(e)).join(","),e+="|ob:",e+=t.orderBy.map(e=>function(e){return e.field.canonicalString()+e.dir}(e)).join(","),Wl(t.limit)||(e+="|l:",e+=t.limit),t.startAt&&(e+="|lb:",e+=t.startAt.inclusive?"b:":"a:",e+=t.startAt.position.map(e=>hu(e)).join(",")),t.endAt&&(e+="|ub:",e+=t.endAt.inclusive?"a:":"b:",e+=t.endAt.position.map(e=>hu(e)).join(",")),t.R=e}return t.R}function Ph(e,t){if(e.limit!==t.limit)return!1;if(e.orderBy.length!==t.orderBy.length)return!1;for(let n=0;n<e.orderBy.length;n++)if(!Oh(e.orderBy[n],t.orderBy[n]))return!1;if(e.filters.length!==t.filters.length)return!1;for(let n=0;n<e.filters.length;n++)if(!gh(e.filters[n],t.filters[n]))return!1;return e.collectionGroup===t.collectionGroup&&!!e.path.isEqual(t.path)&&!!lh(e.startAt,t.startAt)&&lh(e.endAt,t.endAt)}class Mh{constructor(e,t=null,n=[],s=[],r=null,i="F",a=null,o=null){this.path=e,this.collectionGroup=t,this.explicitOrderBy=n,this.filters=s,this.limit=r,this.limitType=i,this.startAt=a,this.endAt=o,this.A=null,this.V=null,this.m=null,this.startAt,this.endAt}}function Gh(e){return 0===e.filters.length&&null===e.limit&&null==e.startAt&&null==e.endAt&&(0===e.explicitOrderBy.length||1===e.explicitOrderBy.length&&e.explicitOrderBy[0].field.isKeyField())}function Uh(e){const t=Xc(e);if(null===t.A){t.A=[];const e=new Set;for(const n of t.explicitOrderBy)t.A.push(n),e.add(n.field.canonicalString());const n=t.explicitOrderBy.length>0?t.explicitOrderBy[t.explicitOrderBy.length-1].dir:"asc",s=function(e){let t=new ll(ml.comparator);return e.filters.forEach(e=>{e.getFlattenedFilters().forEach(e=>{e.isInequality()&&(t=t.add(e.field))})}),t}(t);s.forEach(s=>{e.has(s.canonicalString())||s.isKeyField()||t.A.push(new Th(s,n))}),e.has(ml.keyField().canonicalString())||t.A.push(new Th(ml.keyField(),n))}return t.A}function Hh(e){const t=Xc(e);return t.V||(t.V=function(e,t){if("F"===e.limitType)return xh(e.path,e.collectionGroup,t,e.filters,e.limit,e.startAt,e.endAt);{t=t.map(e=>{const t="desc"===e.dir?"asc":"desc";return new Th(e.field,t)});const n=e.endAt?new Bh(e.endAt.position,e.endAt.inclusive):null,s=e.startAt?new Bh(e.startAt.position,e.startAt.inclusive):null;return xh(e.path,e.collectionGroup,t,e.filters,e.limit,n,s)}}(t,Uh(e))),t.V}function Vh(e,t,n){return new Mh(e.path,e.collectionGroup,e.explicitOrderBy.slice(),e.filters.slice(),t,n,e.startAt,e.endAt)}function jh(e){return`Query(target=${function(e){let t=e.path.canonicalString();return null!==e.collectionGroup&&(t+=" collectionGroup="+e.collectionGroup),e.filters.length>0&&(t+=`, filters: [${e.filters.map(e=>mh(e)).join(", ")}]`),Wl(e.limit)||(t+=", limit: "+e.limit),e.orderBy.length>0&&(t+=`, orderBy: [${e.orderBy.map(e=>function(e){return`${e.field.canonicalString()} (${e.dir})`}(e)).join(", ")}]`),e.startAt&&(t+=", startAt: ",t+=e.startAt.inclusive?"b:":"a:",t+=e.startAt.position.map(e=>hu(e)).join(",")),e.endAt&&(t+=", endAt: ",t+=e.endAt.inclusive?"a:":"b:",t+=e.endAt.position.map(e=>hu(e)).join(",")),`Target(${t})`}(Hh(e))}; limitType=${e.limitType})`}function $h(e,t){return t.isFoundDocument()&&function(e,t){const n=t.key.path;return null!==e.collectionGroup?t.key.hasCollectionId(e.collectionGroup)&&e.path.isPrefixOf(n):_l.isDocumentKey(e.path)?e.path.isEqual(n):e.path.isImmediateParentOf(n)}(e,t)&&function(e,t){for(const n of Uh(e))if(!n.field.isKeyField()&&null===t.data.field(n.field))return!1;return!0}(e,t)&&function(e,t){for(const n of e.filters)if(!n.matches(t))return!1;return!0}(e,t)&&function(e,t){return!(e.startAt&&!function(e,t,n){const s=ch(e,t,n);return e.inclusive?s<=0:s<0}(e.startAt,Uh(e),t))&&!(e.endAt&&!function(e,t,n){const s=ch(e,t,n);return e.inclusive?s>=0:s>0}(e.endAt,Uh(e),t))}(e,t)}function Jh(e){return(t,n)=>{let s=!1;for(const r of Uh(e)){const e=qh(r,t,n);if(0!==e)return e;s=s||r.field.isKeyField()}return 0}}function qh(e,t,n){const s=e.field.isKeyField()?_l.comparator(t.key,n.key):function(e,t,n){const s=t.data.field(e),r=n.data.field(e);return null!==s&&null!==r?cu(s,r):Qc(42886)}(e.field,t,n);switch(e.dir){case"asc":return s;case"desc":return-1*s;default:return Qc(19790,{direction:e.dir})}}var zh,Kh;function Qh(e){if(void 0===e)return qc("GRPC error has no .code"),hl.UNKNOWN;switch(e){case zh.OK:return hl.OK;case zh.CANCELLED:return hl.CANCELLED;case zh.UNKNOWN:return hl.UNKNOWN;case zh.DEADLINE_EXCEEDED:return hl.DEADLINE_EXCEEDED;case zh.RESOURCE_EXHAUSTED:return hl.RESOURCE_EXHAUSTED;case zh.INTERNAL:return hl.INTERNAL;case zh.UNAVAILABLE:return hl.UNAVAILABLE;case zh.UNAUTHENTICATED:return hl.UNAUTHENTICATED;case zh.INVALID_ARGUMENT:return hl.INVALID_ARGUMENT;case zh.NOT_FOUND:return hl.NOT_FOUND;case zh.ALREADY_EXISTS:return hl.ALREADY_EXISTS;case zh.PERMISSION_DENIED:return hl.PERMISSION_DENIED;case zh.FAILED_PRECONDITION:return hl.FAILED_PRECONDITION;case zh.ABORTED:return hl.ABORTED;case zh.OUT_OF_RANGE:return hl.OUT_OF_RANGE;case zh.UNIMPLEMENTED:return hl.UNIMPLEMENTED;case zh.DATA_LOSS:return hl.DATA_LOSS;default:return Qc(39323,{code:e})}}(Kh=zh||(zh={}))[Kh.OK=0]="OK",Kh[Kh.CANCELLED=1]="CANCELLED",Kh[Kh.UNKNOWN=2]="UNKNOWN",Kh[Kh.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",Kh[Kh.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",Kh[Kh.NOT_FOUND=5]="NOT_FOUND",Kh[Kh.ALREADY_EXISTS=6]="ALREADY_EXISTS",Kh[Kh.PERMISSION_DENIED=7]="PERMISSION_DENIED",Kh[Kh.UNAUTHENTICATED=16]="UNAUTHENTICATED",Kh[Kh.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",Kh[Kh.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",Kh[Kh.ABORTED=10]="ABORTED",Kh[Kh.OUT_OF_RANGE=11]="OUT_OF_RANGE",Kh[Kh.UNIMPLEMENTED=12]="UNIMPLEMENTED",Kh[Kh.INTERNAL=13]="INTERNAL",Kh[Kh.UNAVAILABLE=14]="UNAVAILABLE",Kh[Kh.DATA_LOSS=15]="DATA_LOSS";class Wh{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.innerSize=0}get(e){const t=this.mapKeyFn(e),n=this.inner[t];if(void 0!==n)for(const[t,s]of n)if(this.equalsFn(t,e))return s}has(e){return void 0!==this.get(e)}set(e,t){const n=this.mapKeyFn(e),s=this.inner[n];if(void 0===s)return this.inner[n]=[[e,t]],void this.innerSize++;for(let n=0;n<s.length;n++)if(this.equalsFn(s[n][0],e))return void(s[n]=[e,t]);s.push([e,t]),this.innerSize++}delete(e){const t=this.mapKeyFn(e),n=this.inner[t];if(void 0===n)return!1;for(let s=0;s<n.length;s++)if(this.equalsFn(n[s][0],e))return 1===n.length?delete this.inner[t]:n.splice(s,1),this.innerSize--,!0;return!1}forEach(e){yl(this.inner,(t,n)=>{for(const[t,s]of n)e(t,s)})}isEmpty(){return Dl(this.inner)}size(){return this.innerSize}}const Yh=new ol(_l.comparator);function Xh(){return Yh}const Zh=new ol(_l.comparator);function ep(...e){let t=Zh;for(const n of e)t=t.insert(n.key,n);return t}function tp(e){let t=Zh;return e.forEach((e,n)=>t=t.insert(e,n.overlayedDocument)),t}function np(){return rp()}function sp(){return rp()}function rp(){return new Wh(e=>e.toString(),(e,t)=>e.isEqual(t))}const ip=new ol(_l.comparator),ap=new ll(_l.comparator);function op(...e){let t=ap;for(const n of e)t=t.add(n);return t}const Bp=new ll(tl);new qo([4294967295,4294967295],0);class cp{constructor(e,t){this.databaseId=e,this.useProto3Json=t}}function lp(e,t){return e.useProto3Json?`${new Date(1e3*t.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+t.nanoseconds).slice(-9)}Z`:{seconds:""+t.seconds,nanos:t.nanoseconds}}function up(e){const t=Fl(e);return new Rl(t.seconds,t.nanos)}function hp(e,t){return e.useProto3Json?t.toBase64():t.toUint8Array()}function pp(e,t){return lp(e,t.toTimestamp())}function dp(e){return Yc(!!e,49232),Ah.fromTimestamp(up(e))}function fp(e,t){return Cp(e,t).canonicalString()}function Cp(e,t){const n=function(e){return new Cl(["projects",e.projectId,"databases",e.database])}(e).child("documents");return void 0===t?n:n.child(t)}function gp(e,t){return fp(e.databaseId,t.path)}function mp(e){const t=function(e){const t=Cl.fromString(e);return Yc(function(e){return e.length>=4&&"projects"===e.get(0)&&"databases"===e.get(2)}(t),10190,{key:t.toString()}),t}(e);return 4===t.length?Cl.emptyPath():function(e){return Yc(e.length>4&&"documents"===e.get(4),29091,{key:e.toString()}),e.popFirst(5)}(t)}function wp(e,t,n){return{name:gp(e,t),fields:n.value.mapValue.fields}}function Ep(e){let t=mp(e.parent);const n=e.structuredQuery,s=n.from?n.from.length:0;let r=null;if(s>0){Yc(1===s,65062);const e=n.from[0];e.allDescendants?r=e.collectionId:t=t.child(e.collectionId)}let i=[];n.where&&(i=function(e){const t=yp(e);return t instanceof ph&&fh(t)?t.getFilters():[t]}(n.where));let a=[];n.orderBy&&(a=function(e){return e.map(e=>function(e){return new Th(Dp(e.field),function(e){switch(e){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(e.direction))}(e))}(n.orderBy));let o=null;n.limit&&(o=function(e){let t;return t="object"==typeof e?e.value:e,Wl(t)?null:t}(n.limit));let B=null;n.startAt&&(B=function(e){const t=!!e.before,n=e.values||[];return new Bh(n,t)}(n.startAt));let c=null;return n.endAt&&(c=function(e){const t=!e.before,n=e.values||[];return new Bh(n,t)}(n.endAt)),function(e,t,n,s,r,i,a,o){return new Mh(e,t,n,s,r,i,a,o)}(t,r,a,i,o,"F",B,c)}function yp(e){return void 0!==e.unaryFilter?function(e){switch(e.unaryFilter.op){case"IS_NAN":const t=Dp(e.unaryFilter.field);return hh.create(t,"==",{doubleValue:NaN});case"IS_NULL":const n=Dp(e.unaryFilter.field);return hh.create(n,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":const s=Dp(e.unaryFilter.field);return hh.create(s,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const r=Dp(e.unaryFilter.field);return hh.create(r,"!=",{nullValue:"NULL_VALUE"});case"OPERATOR_UNSPECIFIED":return Qc(61313);default:return Qc(60726)}}(e):void 0!==e.fieldFilter?function(e){return hh.create(Dp(e.fieldFilter.field),function(e){switch(e){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";case"OPERATOR_UNSPECIFIED":return Qc(58110);default:return Qc(50506)}}(e.fieldFilter.op),e.fieldFilter.value)}(e):void 0!==e.compositeFilter?function(e){return ph.create(e.compositeFilter.filters.map(e=>yp(e)),function(e){switch(e){case"AND":return"and";case"OR":return"or";default:return Qc(1026)}}(e.compositeFilter.op))}(e):Qc(30097,{filter:e})}function Dp(e){return ml.fromServerFormat(e.fieldPath)}function _p(e){const t=[];return e.fields.forEach(e=>t.push(e.canonicalString())),{fieldPaths:t}}function bp(e){return!!e&&"function"==typeof e._toProto&&"ProtoValue"===e._protoValueType}function vp(e,t){const n={fields:{}};return t.forEach((t,s)=>{if("string"!=typeof s)throw new Error(`Cannot encode map with non-string key: ${s}`);n.fields[s]=t._toProto(e)}),{mapValue:n}}function Ip(e){return{stringValue:e}}function Tp(e){return new cp(e,!0)}class Op{constructor(e){this._byteString=e}static fromBase64String(e){try{return new Op(Ll.fromBase64String(e))}catch(e){throw new pl(hl.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+e)}}static fromUint8Array(e){return new Op(Ll.fromUint8Array(e))}toBase64(){return this._byteString.toBase64()}toUint8Array(){return this._byteString.toUint8Array()}toString(){return"Bytes(base64: "+this.toBase64()+")"}isEqual(e){return this._byteString.isEqual(e._byteString)}toJSON(){return{type:Op._jsonSchemaVersion,bytes:this.toBase64()}}static fromJSON(e){if(Al(e,Op._jsonSchema))return Op.fromBase64String(e.bytes)}}Op._jsonSchemaVersion="firestore/bytes/1.0",Op._jsonSchema={type:Ol("string",Op._jsonSchemaVersion),bytes:Ol("string")};class Ap{constructor(...e){for(let t=0;t<e.length;++t)if(0===e[t].length)throw new pl(hl.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new ml(e)}isEqual(e){return this._internalPath.isEqual(e._internalPath)}}class Sp{constructor(e){this._methodName=e}}class Np{constructor(e,t){if(!isFinite(e)||e<-90||e>90)throw new pl(hl.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(t)||t<-180||t>180)throw new pl(hl.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+t);this._lat=e,this._long=t}get latitude(){return this._lat}get longitude(){return this._long}isEqual(e){return this._lat===e._lat&&this._long===e._long}_compareTo(e){return tl(this._lat,e._lat)||tl(this._long,e._long)}toJSON(){return{latitude:this._lat,longitude:this._long,type:Np._jsonSchemaVersion}}static fromJSON(e){if(Al(e,Np._jsonSchema))return new Np(e.latitude,e.longitude)}}Np._jsonSchemaVersion="firestore/geoPoint/1.0",Np._jsonSchema={type:Ol("string",Np._jsonSchemaVersion),latitude:Ol("number"),longitude:Ol("number")};class Rp{constructor(e){this.uid=e}isAuthenticated(){return null!=this.uid}toKey(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"}isEqual(e){return e.uid===this.uid}}Rp.UNAUTHENTICATED=new Rp(null),Rp.GOOGLE_CREDENTIALS=new Rp("google-credentials-uid"),Rp.FIRST_PARTY=new Rp("first-party-uid"),Rp.MOCK_USER=new Rp("mock-user");class kp{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}}class Lp{constructor(e,t){this.user=t,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${e}`)}}class xp{getToken(){return Promise.resolve(null)}invalidateToken(){}start(e,t){e.enqueueRetryable(()=>t(Rp.UNAUTHENTICATED))}shutdown(){}}class Fp{constructor(e){this.token=e,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(e,t){this.changeListener=t,e.enqueueRetryable(()=>t(this.token.user))}shutdown(){this.changeListener=null}}class Pp{constructor(e){this.De=e,this.currentUser=Rp.UNAUTHENTICATED,this.xe=0,this.forceRefresh=!1,this.auth=null}start(e,t){Yc(void 0===this.Ce,42304);let n=this.xe;const s=e=>this.xe!==n?(n=this.xe,t(e)):Promise.resolve();let r=new kp;this.Ce=()=>{this.xe++,this.currentUser=this.Fe(),r.resolve(),r=new kp,e.enqueueRetryable(()=>s(this.currentUser))};const i=()=>{const t=r;e.enqueueRetryable(async()=>{await t.promise,await s(this.currentUser)})},a=e=>{Jc("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=e,this.Ce&&(this.auth.addAuthTokenListener(this.Ce),i())};this.De.onInit(e=>a(e)),setTimeout(()=>{if(!this.auth){const e=this.De.getImmediate({optional:!0});e?a(e):(Jc("FirebaseAuthCredentialsProvider","Auth not yet detected"),r.resolve(),r=new kp)}},0),i()}getToken(){const e=this.xe,t=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(t).then(t=>this.xe!==e?(Jc("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):t?(Yc("string"==typeof t.accessToken,31837,{Oe:t}),new Lp(t.accessToken,this.currentUser)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.Ce&&this.auth.removeAuthTokenListener(this.Ce),this.Ce=void 0}Fe(){const e=this.auth&&this.auth.getUid();return Yc(null===e||"string"==typeof e,2055,{Me:e}),new Rp(e)}}class Mp{constructor(e,t,n){this.Ne=e,this.Le=t,this.Be=n,this.type="FirstParty",this.user=Rp.FIRST_PARTY,this.Ue=new Map}ke(){return this.Be?this.Be():null}get headers(){this.Ue.set("X-Goog-AuthUser",this.Ne);const e=this.ke();return e&&this.Ue.set("Authorization",e),this.Le&&this.Ue.set("X-Goog-Iam-Authorization-Token",this.Le),this.Ue}}class Gp{constructor(e,t,n){this.Ne=e,this.Le=t,this.Be=n}getToken(){return Promise.resolve(new Mp(this.Ne,this.Le,this.Be))}start(e,t){e.enqueueRetryable(()=>t(Rp.FIRST_PARTY))}shutdown(){}invalidateToken(){}}class Up{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 Hp{constructor(e,t){this.qe=t,this.forceRefresh=!1,this.appCheck=null,this.$e=null,this.Ke=null,hr(e)&&e.settings.appCheckToken&&(this.Ke=e.settings.appCheckToken)}start(e,t){Yc(void 0===this.Ce,3512);const n=e=>{null!=e.error&&Jc("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${e.error.message}`);const n=e.token!==this.$e;return this.$e=e.token,Jc("FirebaseAppCheckTokenProvider",`Received ${n?"new":"existing"} token.`),n?t(e.token):Promise.resolve()};this.Ce=t=>{e.enqueueRetryable(()=>n(t))};const s=e=>{Jc("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=e,this.Ce&&this.appCheck.addTokenListener(this.Ce)};this.qe.onInit(e=>s(e)),setTimeout(()=>{if(!this.appCheck){const e=this.qe.getImmediate({optional:!0});e?s(e):Jc("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}},0)}getToken(){if(this.Ke)return Promise.resolve(new Up(this.Ke));const e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then(e=>e?(Yc("string"==typeof e.token,44558,{tokenResult:e}),this.$e=e.token,new Up(e.token)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.Ce&&this.appCheck.removeTokenListener(this.Ce),this.Ce=void 0}}function Vp(e){const t={};return void 0!==e.timeoutSeconds&&(t.timeoutSeconds=e.timeoutSeconds),t}class jp{Qe(e){}shutdown(){}}const $p="ConnectivityMonitor";class Jp{constructor(){this.We=()=>this.Ge(),this.ze=()=>this.je(),this.He=[],this.Je()}Qe(e){this.He.push(e)}shutdown(){window.removeEventListener("online",this.We),window.removeEventListener("offline",this.ze)}Je(){window.addEventListener("online",this.We),window.addEventListener("offline",this.ze)}Ge(){Jc($p,"Network connectivity changed: AVAILABLE");for(const e of this.He)e(0)}je(){Jc($p,"Network connectivity changed: UNAVAILABLE");for(const e of this.He)e(1)}static Ye(){return"undefined"!=typeof window&&void 0!==window.addEventListener&&void 0!==window.removeEventListener}}let qp=null;function zp(){return null===qp?qp=268435456+Math.round(2147483648*Math.random()):qp++,"0x"+qp.toString(16)}const Kp="RestConnection",Qp={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregationQuery:"runAggregationQuery",ExecutePipeline:"executePipeline"};class Wp{get Ze(){return!1}constructor(e){this.databaseInfo=e,this.databaseId=e.databaseId;const t=e.ssl?"https":"http",n=encodeURIComponent(this.databaseId.projectId),s=encodeURIComponent(this.databaseId.database);this.Xe=t+"://"+e.host,this.et=`projects/${n}/databases/${s}`,this.tt=this.databaseId.database===zl?`project_id=${n}`:`project_id=${n}&database_id=${s}`}nt(e,t,n,s,r){const i=zp(),a=this.rt(e,t.toUriEncodedString());Jc(Kp,`Sending RPC '${e}' ${i}:`,a,n);const o={"google-cloud-resource-prefix":this.et,"x-goog-request-params":this.tt};this.it(o,s,r);const{host:B}=new URL(a),c=Zn(B);return this.st(e,a,o,n,c).then(t=>(Jc(Kp,`Received RPC '${e}' ${i}: `,t),t),t=>{throw zc(Kp,`RPC '${e}' ${i} failed with error: `,t,"url: ",a,"request:",n),t})}_t(e,t,n,s,r,i){return this.nt(e,t,n,s,r)}it(e,t,n){if(e["X-Goog-Api-Client"]="gl-js/ fire/"+Vc,e["Content-Type"]="text/plain",this.databaseInfo.appId&&(e["X-Firebase-GMPID"]=this.databaseInfo.appId),t&&t.headers.forEach((t,n)=>e[n]=t),n&&n.headers.forEach((t,n)=>e[n]=t),this.databaseInfo._customHeaders)for(const t of Object.keys(this.databaseInfo._customHeaders))e[t]=this.databaseInfo._customHeaders[t]}rt(e,t){const n=Qp[e];let s=`${this.Xe}/v1/${t}:${n}`;return this.databaseInfo.apiKey&&(s=`${s}?key=${encodeURIComponent(this.databaseInfo.apiKey)}`),s}terminate(){}}class Yp{constructor(e){this.ot=e.ot,this.ut=e.ut}ct(e){this.lt=e}Et(e){this.ht=e}Tt(e){this.Pt=e}onMessage(e){this.It=e}close(){this.ut()}send(e){this.ot(e)}Rt(){this.lt()}At(){this.ht()}Vt(e){this.Pt(e)}dt(e){this.It(e)}}const Xp="WebChannelConnection",Zp=(e,t,n)=>{e.listen(t,e=>{try{n(e)}catch(e){setTimeout(()=>{throw e},0)}})};class ed extends Wp{constructor(e){super(e),this.ft=[],this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams,this.longPollingOptions=e.longPollingOptions}static gt(){if(!ed.yt){const e=eB();Zp(e,Zo.STAT_EVENT,e=>{e.stat===Xo.PROXY?Jc(Xp,"STAT_EVENT: detected buffering proxy"):e.stat===Xo.NOPROXY&&Jc(Xp,"STAT_EVENT: detected no buffering proxy")}),ed.yt=!0}}st(e,t,n,s,r){const i=zp();return new Promise((r,a)=>{const o=new Ko;o.setWithCredentials(!0),o.listenOnce(Wo.COMPLETE,()=>{try{switch(o.getLastErrorCode()){case Yo.NO_ERROR:const t=o.getResponseJson();Jc(Xp,`XHR for RPC '${e}' ${i} received:`,JSON.stringify(t)),r(t);break;case Yo.TIMEOUT:Jc(Xp,`RPC '${e}' ${i} timed out`),a(new pl(hl.DEADLINE_EXCEEDED,"Request time out"));break;case Yo.HTTP_ERROR:const n=o.getStatus();if(Jc(Xp,`RPC '${e}' ${i} failed with status:`,n,"response text:",o.getResponseText()),n>0){let e=o.getResponseJson();Array.isArray(e)&&(e=e[0]);const t=e?.error;if(t&&t.status&&t.message){const e=function(e){const t=e.toLowerCase().replace(/_/g,"-");return Object.values(hl).indexOf(t)>=0?t:hl.UNKNOWN}(t.status);a(new pl(e,t.message))}else a(new pl(hl.UNKNOWN,"Server responded with status "+o.getStatus()))}else a(new pl(hl.UNAVAILABLE,"Connection failed."));break;default:Qc(9055,{wt:e,streamId:i,bt:o.getLastErrorCode(),St:o.getLastError()})}}finally{Jc(Xp,`RPC '${e}' ${i} completed.`)}});const B=JSON.stringify(s);Jc(Xp,`RPC '${e}' ${i} sending request:`,s),o.send(t,"POST",B,n,15)})}vt(e,t,n){const s=zp(),r=[this.Xe,"/","google.firestore.v1.Firestore","/",e,"/channel"],i=this.createWebChannelTransport(),a={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},o=this.longPollingOptions.timeoutSeconds;void 0!==o&&(a.longPollingTimeout=Math.round(1e3*o)),this.useFetchStreams&&(a.useFetchStreams=!0),this.it(a.initMessageHeaders,t,n),a.encodeInitMessageHeaders=!0;const B=r.join("");Jc(Xp,`Creating RPC '${e}' stream ${s}: ${B}`,a);const c=i.createWebChannel(B,a);this.Dt(c);let l=!1,u=!1;const h=new Yp({ot:t=>{u?Jc(Xp,`Not sending because RPC '${e}' stream ${s} is closed:`,t):(l||(Jc(Xp,`Opening RPC '${e}' stream ${s} transport.`),c.open(),l=!0),Jc(Xp,`RPC '${e}' stream ${s} sending:`,t),c.send(t))},ut:()=>c.close()});return Zp(c,Qo.EventType.OPEN,()=>{u||(Jc(Xp,`RPC '${e}' stream ${s} transport opened.`),h.Rt())}),Zp(c,Qo.EventType.CLOSE,()=>{u||(u=!0,Jc(Xp,`RPC '${e}' stream ${s} transport closed`),h.Vt(),this.xt(c))}),Zp(c,Qo.EventType.ERROR,t=>{u||(u=!0,zc(Xp,`RPC '${e}' stream ${s} transport errored. Name:`,t.name,"Message:",t.message),h.Vt(new pl(hl.UNAVAILABLE,"The operation could not be completed")))}),Zp(c,Qo.EventType.MESSAGE,t=>{if(!u){const n=t.data[0];Yc(!!n,16349);const r=n,i=r?.error||r[0]?.error;if(i){Jc(Xp,`RPC '${e}' stream ${s} received error:`,i);const t=i.status;let n=function(e){const t=zh[e];if(void 0!==t)return Qh(t)}(t),r=i.message;"NOT_FOUND"===t&&r.includes("database")&&r.includes("does not exist")&&r.includes(this.databaseId.database)&&zc(`Database '${this.databaseId.database}' not found. Please check your project configuration.`),void 0===n&&(n=hl.INTERNAL,r="Unknown error status: "+t+" with message "+i.message),u=!0,h.Vt(new pl(n,r)),c.close()}else Jc(Xp,`RPC '${e}' stream ${s} received:`,n),h.dt(n)}}),ed.gt(),setTimeout(()=>{h.At()},0),h}terminate(){this.ft.forEach(e=>e.close()),this.ft=[]}Dt(e){this.ft.push(e)}xt(e){this.ft=this.ft.filter(t=>t===e)}it(e,t,n){super.it(e,t,n),this.databaseInfo.apiKey&&(e["x-goog-api-key"]=this.databaseInfo.apiKey)}createWebChannelTransport(){return tB()}}ed.yt=!1;class td{constructor(e,t,n=1e3,s=1.5,r=6e4){this.Ct=e,this.timerId=t,this.Ft=n,this.Ot=s,this.Mt=r,this.Nt=0,this.Lt=null,this.Bt=Date.now(),this.reset()}reset(){this.Nt=0}Ut(){this.Nt=this.Mt}kt(e){this.cancel();const t=Math.floor(this.Nt+this.qt()),n=Math.max(0,Date.now()-this.Bt),s=Math.max(0,t-n);s>0&&Jc("ExponentialBackoff",`Backing off for ${s} ms (base delay: ${this.Nt} ms, delay with jitter: ${t} ms, last attempt: ${n} ms ago)`),this.Lt=this.Ct.enqueueAfterDelay(this.timerId,s,()=>(this.Bt=Date.now(),e())),this.Nt*=this.Ot,this.Nt<this.Ft&&(this.Nt=this.Ft),this.Nt>this.Mt&&(this.Nt=this.Mt)}$t(){null!==this.Lt&&(this.Lt.skipDelay(),this.Lt=null)}cancel(){null!==this.Lt&&(this.Lt.cancel(),this.Lt=null)}qt(){return(Math.random()-.5)*this.Nt}}const nd="PersistentStream";class sd{constructor(e,t,n,s,r,i,a,o){this.Ct=e,this.Kt=n,this.Qt=s,this.connection=r,this.authCredentialsProvider=i,this.appCheckCredentialsProvider=a,this.listener=o,this.state=0,this.Wt=0,this.Gt=null,this.zt=null,this.stream=null,this.jt=0,this.Ht=new td(e,t)}Jt(){return 1===this.state||5===this.state||this.Yt()}Yt(){return 2===this.state||3===this.state}start(){this.jt=0,4!==this.state?this.auth():this.Zt()}async stop(){this.Jt()&&await this.close(0)}Xt(){this.state=0,this.Ht.reset()}en(){this.Yt()&&null===this.Gt&&(this.Gt=this.Ct.enqueueAfterDelay(this.Kt,6e4,()=>this.tn()))}nn(e){this.rn(),this.stream.send(e)}async tn(){if(this.Yt())return this.close(0)}rn(){this.Gt&&(this.Gt.cancel(),this.Gt=null)}sn(){this.zt&&(this.zt.cancel(),this.zt=null)}async close(e,t){this.rn(),this.sn(),this.Ht.cancel(),this.Wt++,4!==e?this.Ht.reset():t&&t.code===hl.RESOURCE_EXHAUSTED?(qc(t.toString()),qc("Using maximum backoff delay to prevent overloading the backend."),this.Ht.Ut()):t&&t.code===hl.UNAUTHENTICATED&&3!==this.state&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),null!==this.stream&&(this._n(),this.stream.close(),this.stream=null),this.state=e,await this.listener.Tt(t)}_n(){}auth(){this.state=1;const e=this.an(this.Wt),t=this.Wt;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then(([e,n])=>{this.Wt===t&&this.un(e,n)},t=>{e(()=>{const e=new pl(hl.UNKNOWN,"Fetching auth token failed: "+t.message);return this.cn(e)})})}un(e,t){const n=this.an(this.Wt);this.stream=this.En(e,t),this.stream.ct(()=>{n(()=>this.listener.ct())}),this.stream.Et(()=>{n(()=>(this.state=2,this.zt=this.Ct.enqueueAfterDelay(this.Qt,1e4,()=>(this.Yt()&&(this.state=3),Promise.resolve())),this.listener.Et()))}),this.stream.Tt(e=>{n(()=>this.cn(e))}),this.stream.onMessage(e=>{n(()=>1==++this.jt?this.hn(e):this.onNext(e))})}Zt(){this.state=5,this.Ht.kt(async()=>{this.state=0,this.start()})}cn(e){return Jc(nd,`close with error: ${e}`),this.stream=null,this.close(4,e)}an(e){return t=>{this.Ct.enqueueAndForget(()=>this.Wt===e?t():(Jc(nd,"stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve()))}}}class rd extends sd{constructor(e,t,n,s,r,i){super(e,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",t,n,s,i),this.serializer=r}get Rn(){return this.jt>0}start(){this.lastStreamToken=void 0,super.start()}_n(){this.Rn&&this.An([])}En(e,t){return this.connection.vt("Write",e,t)}hn(e){return Yc(!!e.streamToken,31322),this.lastStreamToken=e.streamToken,Yc(!e.writeResults||0===e.writeResults.length,55816),this.listener.Vn()}onNext(e){Yc(!!e.streamToken,12678),this.lastStreamToken=e.streamToken,this.Ht.reset();const t=function(e,t){return e&&e.length>0?(Yc(void 0!==t,14353),e.map(e=>function(e,t){let n=e.updateTime?dp(e.updateTime):dp(t);return n.isEqual(Ah.min())&&(n=dp(t)),new qu(n,e.transformResults||[])}(e,t))):[]}(e.writeResults,e.commitTime),n=dp(e.commitTime);return this.listener.dn(n,t)}fn(){const e={};e.database=function(e){return new Cl(["projects",e.databaseId.projectId,"databases",e.databaseId.database]).canonicalString()}(this.serializer),this.nn(e)}An(e){const t={streamToken:this.lastStreamToken,writes:e.map(e=>function(e,t){let n;if(t instanceof th)n={update:wp(e,t.key,t.value)};else if(t instanceof ah)n={delete:gp(e,t.key)};else if(t instanceof nh)n={update:wp(e,t.key,t.data),updateMask:_p(t.fieldMask)};else{if(!(t instanceof oh))return Qc(16599,{be:t.type});n={verify:gp(e,t.key)}}return t.fieldTransforms.length>0&&(n.updateTransforms=t.fieldTransforms.map(e=>function(e,t){const n=t.transform;if(n instanceof Lu)return{fieldPath:t.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(n instanceof xu)return{fieldPath:t.field.canonicalString(),appendMissingElements:{values:n.elements}};if(n instanceof Pu)return{fieldPath:t.field.canonicalString(),removeAllFromArray:{values:n.elements}};if(n instanceof Uu)return{fieldPath:t.field.canonicalString(),increment:n.h};if(n instanceof Hu)return{fieldPath:t.field.canonicalString(),minimum:n.h};if(n instanceof Vu)return{fieldPath:t.field.canonicalString(),maximum:n.h};throw Qc(20930,{transform:t.transform})}(0,e))),t.precondition.isNone||(n.currentDocument=function(e,t){return void 0!==t.updateTime?{updateTime:pp(e,t.updateTime)}:void 0!==t.exists?{exists:t.exists}:Qc(27497)}(e,t.precondition)),n}(this.serializer,e))};this.nn(t)}}class id{}class ad extends id{constructor(e,t,n,s){super(),this.authCredentials=e,this.appCheckCredentials=t,this.connection=n,this.serializer=s,this.mn=!1}pn(){if(this.mn)throw new pl(hl.FAILED_PRECONDITION,"The client has already been terminated.")}nt(e,t,n,s){return this.pn(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([r,i])=>this.connection.nt(e,Cp(t,n),s,r,i)).catch(e=>{throw"FirebaseError"===e.name?(e.code===hl.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),e):new pl(hl.UNKNOWN,e.toString())})}_t(e,t,n,s,r){return this.pn(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([i,a])=>this.connection._t(e,Cp(t,n),s,i,a,r)).catch(e=>{throw"FirebaseError"===e.name?(e.code===hl.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),e):new pl(hl.UNKNOWN,e.toString())})}terminate(){this.mn=!0,this.connection.terminate()}}const od=new Map;const Bd={didRun:!1,sequenceNumbersCollected:0,targetsRemoved:0,documentsRemoved:0},cd=41943040;class ld{static withCacheSize(e){return new ld(e,ld.DEFAULT_COLLECTION_PERCENTILE,ld.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)}constructor(e,t,n){this.cacheSizeCollectionThreshold=e,this.percentileToCollect=t,this.maximumSequenceNumbersToCollect=n}}ld.DEFAULT_COLLECTION_PERCENTILE=10,ld.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,ld.DEFAULT=new ld(cd,ld.DEFAULT_COLLECTION_PERCENTILE,ld.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),ld.DISABLED=new ld(-1,0,0);class ud{constructor(e,t){this.previousValue=e,t&&(t.sequenceNumberHandler=e=>this.gn(e),this.yn=e=>t.writeSequenceNumber(e))}gn(e){return this.previousValue=Math.max(e,this.previousValue),this.previousValue}next(){const e=++this.previousValue;return this.yn&&this.yn(e),e}}ud.wn=-1;class hd{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(e){this.onCommittedListeners.push(e)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach(e=>e())}}async function pd(e){if(e.code!==hl.FAILED_PRECONDITION||"The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab."!==e.message)throw e;Jc("LocalStore","Unexpectedly lost primary lease")}class dd{constructor(e){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e(e=>{this.isDone=!0,this.result=e,this.nextCallback&&this.nextCallback(e)},e=>{this.isDone=!0,this.error=e,this.catchCallback&&this.catchCallback(e)})}catch(e){return this.next(void 0,e)}next(e,t){return this.callbackAttached&&Qc(59440),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(t,this.error):this.wrapSuccess(e,this.result):new dd((n,s)=>{this.nextCallback=t=>{this.wrapSuccess(e,t).next(n,s)},this.catchCallback=e=>{this.wrapFailure(t,e).next(n,s)}})}toPromise(){return new Promise((e,t)=>{this.next(e,t)})}wrapUserFunction(e){try{const t=e();return t instanceof dd?t:dd.resolve(t)}catch(e){return dd.reject(e)}}wrapSuccess(e,t){return e?this.wrapUserFunction(()=>e(t)):dd.resolve(t)}wrapFailure(e,t){return e?this.wrapUserFunction(()=>e(t)):dd.reject(t)}static resolve(e){return new dd((t,n)=>{t(e)})}static reject(e){return new dd((t,n)=>{n(e)})}static waitFor(e){return new dd((t,n)=>{let s=0,r=0,i=!1;e.forEach(e=>{++s,e.next(()=>{++r,i&&r===s&&t()},e=>n(e))}),i=!0,r===s&&t()})}static or(e){let t=dd.resolve(!1);for(const n of e)t=t.next(e=>e?dd.resolve(e):n());return t}static forEach(e,t){const n=[];return e.forEach((e,s)=>{n.push(t.call(this,e,s))}),this.waitFor(n)}static mapArray(e,t){return new dd((n,s)=>{const r=e.length,i=new Array(r);let a=0;for(let o=0;o<r;o++){const B=o;t(e[B]).next(e=>{i[B]=e,++a,a===r&&n(i)},e=>s(e))}})}static doWhile(e,t){return new dd((n,s)=>{const r=()=>{!0===e()?t().next(()=>{r()},s):n()};r()})}}function fd(e){return"IndexedDbTransactionError"===e.name}const Cd="LruGarbageCollector";function gd([e,t],[n,s]){const r=tl(e,n);return 0===r?tl(t,s):r}class md{constructor(e){this.Yn=e,this.buffer=new ll(gd),this.Zn=0}Xn(){return++this.Zn}er(e){const t=[e,this.Xn()];if(this.buffer.size<this.Yn)this.buffer=this.buffer.add(t);else{const e=this.buffer.last();gd(t,e)<0&&(this.buffer=this.buffer.delete(e).add(t))}}get maxValue(){return this.buffer.last()[0]}}class wd{constructor(e,t,n){this.garbageCollector=e,this.asyncQueue=t,this.localStore=n,this.tr=null}start(){-1!==this.garbageCollector.params.cacheSizeCollectionThreshold&&this.nr(6e4)}stop(){this.tr&&(this.tr.cancel(),this.tr=null)}get started(){return null!==this.tr}nr(e){Jc(Cd,`Garbage collection scheduled in ${e}ms`),this.tr=this.asyncQueue.enqueueAfterDelay("lru_garbage_collection",e,async()=>{this.tr=null;try{await this.localStore.collectGarbage(this.garbageCollector)}catch(e){fd(e)?Jc(Cd,"Ignoring IndexedDB error during garbage collection: ",e):await pd(e)}await this.nr(3e5)})}}class Ed{constructor(e,t){this.rr=e,this.params=t}calculateTargetCount(e,t){return this.rr.ir(e).next(e=>Math.floor(t/100*e))}nthSequenceNumber(e,t){if(0===t)return dd.resolve(ud.wn);const n=new md(t);return this.rr.forEachTarget(e,e=>n.er(e.sequenceNumber)).next(()=>this.rr.sr(e,e=>n.er(e))).next(()=>n.maxValue)}removeTargets(e,t,n){return this.rr.removeTargets(e,t,n)}removeOrphanedDocuments(e,t){return this.rr.removeOrphanedDocuments(e,t)}collect(e,t){return-1===this.params.cacheSizeCollectionThreshold?(Jc("LruGarbageCollector","Garbage collection skipped; disabled"),dd.resolve(Bd)):this.getCacheSize(e).next(n=>n<this.params.cacheSizeCollectionThreshold?(Jc("LruGarbageCollector",`Garbage collection skipped; Cache size ${n} is lower than threshold ${this.params.cacheSizeCollectionThreshold}`),Bd):this._r(e,t))}getCacheSize(e){return this.rr.getCacheSize(e)}_r(e,t){let n,s,r,i,a,o,B;const c=Date.now();return this.calculateTargetCount(e,this.params.percentileToCollect).next(t=>(t>this.params.maximumSequenceNumbersToCollect?(Jc("LruGarbageCollector",`Capping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${t}`),s=this.params.maximumSequenceNumbersToCollect):s=t,i=Date.now(),this.nthSequenceNumber(e,s))).next(s=>(n=s,a=Date.now(),this.removeTargets(e,n,t))).next(t=>(r=t,o=Date.now(),this.removeOrphanedDocuments(e,n))).next(e=>(B=Date.now(),$c()<=is.DEBUG&&Jc("LruGarbageCollector",`LRU Garbage Collection\n\tCounted targets in ${i-c}ms\n\tDetermined least recently used ${s} in `+(a-i)+"ms\n"+`\tRemoved ${r} targets in `+(o-a)+"ms\n"+`\tRemoved ${e} documents in `+(B-o)+"ms\n"+`Total Duration: ${B-c}ms`),dd.resolve({didRun:!0,sequenceNumbersCollected:s,targetsRemoved:r,documentsRemoved:e})))}}const yd="firestore.googleapis.com",Dd=!0;class _d{constructor(e){if(void 0===e.host){if(void 0!==e.ssl)throw new pl(hl.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host=yd,this.ssl=Dd}else this.host=e.host,this.ssl=e.ssl??Dd;if(this.isUsingEmulator=void 0!==e.emulatorOptions,this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,this.localCache=e.localCache,e._customHeaders&&(this._customHeaders={...e._customHeaders}),void 0===e.cacheSizeBytes)this.cacheSizeBytes=cd;else{if(-1!==e.cacheSizeBytes&&e.cacheSizeBytes<1048576)throw new pl(hl.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}if(function(e,t,n,s){if(!0===t&&!0===s)throw new pl(hl.INVALID_ARGUMENT,`${e} and ${n} cannot be used together.`)}("experimentalForceLongPolling",e.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",e.experimentalAutoDetectLongPolling),this.experimentalForceLongPolling=!!e.experimentalForceLongPolling,this.experimentalForceLongPolling?this.experimentalAutoDetectLongPolling=!1:void 0===e.experimentalAutoDetectLongPolling?this.experimentalAutoDetectLongPolling=!0:this.experimentalAutoDetectLongPolling=!!e.experimentalAutoDetectLongPolling,this.experimentalLongPollingOptions=Vp(e.experimentalLongPollingOptions??{}),function(e){if(void 0!==e.timeoutSeconds){if(isNaN(e.timeoutSeconds))throw new pl(hl.INVALID_ARGUMENT,`invalid long polling timeout: ${e.timeoutSeconds} (must not be NaN)`);if(e.timeoutSeconds<5)throw new pl(hl.INVALID_ARGUMENT,`invalid long polling timeout: ${e.timeoutSeconds} (minimum allowed value is 5)`);if(e.timeoutSeconds>30)throw new pl(hl.INVALID_ARGUMENT,`invalid long polling timeout: ${e.timeoutSeconds} (maximum allowed value is 30)`)}}(this.experimentalLongPollingOptions),this.useFetchStreams=!!e.useFetchStreams,void 0!==e.grpcFlowControlWindow){if("number"!=typeof e.grpcFlowControlWindow||e.grpcFlowControlWindow<=0||e.grpcFlowControlWindow>2147483647||!Number.isInteger(e.grpcFlowControlWindow))throw new pl(hl.INVALID_ARGUMENT,"grpcFlowControlWindow must be a positive integer and cannot exceed 2147483647");this.grpcFlowControlWindow=e.grpcFlowControlWindow}}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(e,t){return e.timeoutSeconds===t.timeoutSeconds}(this.experimentalLongPollingOptions,e.experimentalLongPollingOptions)&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams&&this.grpcFlowControlWindow===e.grpcFlowControlWindow&&function(e,t){if(e===t)return!0;if(!e||!t)return!1;const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(const s of n)if(e[s]!==t[s])return!1;return!0}(this._customHeaders,e._customHeaders)}}let bd=class{constructor(e,t,n,s){this._authCredentials=e,this._appCheckCredentials=t,this._databaseId=n,this._app=s,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new _d({}),this._settingsFrozen=!1,this._emulatorOptions={},this._terminateTask="notTerminated"}get app(){if(!this._app)throw new pl(hl.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"notTerminated"!==this._terminateTask}_setSettings(e){if(this._settingsFrozen)throw new pl(hl.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 _d(e),this._emulatorOptions=e.emulatorOptions||{},void 0!==e.credentials&&(this._authCredentials=function(e){if(!e)return new xp;switch(e.type){case"firstParty":return new Gp(e.sessionIndex||"0",e.iamToken||null,e.authTokenFactory||null);case"provider":return e.client;default:throw new pl(hl.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invalid credential type")}}(e.credentials))}_getSettings(){return this._settings}_getEmulatorOptions(){return this._emulatorOptions}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return"notTerminated"===this._terminateTask&&(this._terminateTask=this._terminate()),this._terminateTask}async _restart(){"notTerminated"===this._terminateTask?await this._terminate():this._terminateTask="notTerminated"}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return function(e){const t=od.get(e);t&&(Jc("ComponentProvider","Removing Datastore"),od.delete(e),t.terminate())}(this),Promise.resolve()}};function vd(e,t,n,s={}){e=Tl(e,bd);const r=Zn(t),i=e._getSettings(),a={...i,emulatorOptions:e._getEmulatorOptions()},o=`${t}:${n}`;r&&es(`https://${o}`),i.host!==yd&&i.host!==o&&zc("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used.");const B={...i,host:o,ssl:r,emulatorOptions:s};if(!$n(B,a)&&(e._setSettings(B),s.mockUserToken)){let t,n;if("string"==typeof s.mockUserToken)t=s.mockUserToken,n=Rp.MOCK_USER;else{t=xn(s.mockUserToken,e._app?.options.projectId);const r=s.mockUserToken.sub||s.mockUserToken.user_id;if(!r)throw new pl(hl.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");n=new Rp(r)}e._authCredentials=new Fp(new Lp(t,n))}}class Id{constructor(e,t,n){this.converter=t,this._query=n,this.type="query",this.firestore=e}withConverter(e){return new Id(this.firestore,e,this._query)}}class Td{constructor(e,t,n){this.converter=t,this._key=n,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 Od(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new Td(this.firestore,e,this._key)}toJSON(){return{type:Td._jsonSchemaVersion,referencePath:this._key.toString()}}static fromJSON(e,t,n){if(Al(t,Td._jsonSchema))return new Td(e,n||null,new _l(Cl.fromString(t.referencePath)))}}Td._jsonSchemaVersion="firestore/documentReference/1.0",Td._jsonSchema={type:Ol("string",Td._jsonSchemaVersion),referencePath:Ol("string")};class Od extends Id{constructor(e,t,n){super(e,t,function(e){return new Mh(e)}(n)),this._path=n,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 Td(this.firestore,null,new _l(e))}withConverter(e){return new Od(this.firestore,e,this._path)}}function Ad(e,t,...n){if(e=Xn(e),1===arguments.length&&(t=el.newId()),function(e,t,n){if(!n)throw new pl(hl.INVALID_ARGUMENT,`Function ${e}() cannot be called with an empty ${t}.`)}("doc","path",t),e instanceof bd){const s=Cl.fromString(t,...n);return bl(s),new Td(e,null,new _l(s))}{if(!(e instanceof Td||e instanceof Od))throw new pl(hl.INVALID_ARGUMENT,"Expected first argument to doc() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const s=e._path.child(Cl.fromString(t,...n));return bl(s),new Td(e.firestore,e instanceof Od?e.converter:null,new _l(s))}}class Sd{constructor(e){this._values=(e||[]).map(e=>e)}toArray(){return this._values.map(e=>e)}isEqual(e){return function(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(e[n]!==t[n])return!1;return!0}(this._values,e._values)}toJSON(){return{type:Sd._jsonSchemaVersion,vectorValues:this._values}}static fromJSON(e){if(Al(e,Sd._jsonSchema)){if(Array.isArray(e.vectorValues)&&e.vectorValues.every(e=>"number"==typeof e))return new Sd(e.vectorValues);throw new pl(hl.INVALID_ARGUMENT,"Expected 'vectorValues' field to be a number array")}}}function Nd(e,t,n){if(kd(e=Xn(e)))return function(e,t,n){if(!kd(n)||!vl(n)){const s=Il(n);throw"an object"===s?t.createError(e+" a custom object"):t.createError(e+" "+s)}}("Unsupported field value:",t,e),function(e,t){const n={};return Dl(e)?t.path&&t.path.length>0&&t.fieldMask.push(t.path):yl(e,(e,s)=>{const r=Nd(s,t.childContextForField(e));null!=r&&(n[e]=r)}),{mapValue:{fields:n}}}(e,t);if(e instanceof Sp)return function(e,t){if(!function(e){switch(e){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw Qc(40011,{dataSource:e})}}(t.dataSource))throw t.createError(`${e._methodName}() can only be used with update() and set()`);if(!t.path)throw t.createError(`${e._methodName}() is not currently supported inside arrays`);const n=e._toFieldTransform(t);n&&t.fieldTransforms.push(n)}(e,t),null;if(void 0===e&&t.ignoreUndefinedProperties)return null;if(t.path&&t.fieldMask.push(t.path),e instanceof Array){if(t.settings.arrayElement&&4!==t.dataSource)throw t.createError("Nested arrays are not supported");return function(e,t){const n=[];let s=0;for(const r of e){let e=Nd(r,t.childContextForArray(s));null==e&&(e={nullValue:"NULL_VALUE"}),n.push(e),s++}return{arrayValue:{values:n}}}(e,t)}return function(e,t){if(null===(e=Xn(e)))return{nullValue:"NULL_VALUE"};if("number"==typeof e)return Au(t.serializer,e);if("boolean"==typeof e)return{booleanValue:e};if("string"==typeof e)return{stringValue:e};if(e instanceof Date){const n=Rl.fromDate(e);return{timestampValue:lp(t.serializer,n)}}if(e instanceof Rl){const n=new Rl(e.seconds,1e3*Math.floor(e.nanoseconds/1e3));return{timestampValue:lp(t.serializer,n)}}if(Rd(e)){const n=Rl.fromInstant(e),s=new Rl(n.seconds,1e3*Math.floor(n.nanoseconds/1e3));return{timestampValue:lp(t.serializer,s)}}if(e instanceof Np)return{geoPointValue:{latitude:e.latitude,longitude:e.longitude}};if(e instanceof Op)return{bytesValue:hp(t.serializer,e._byteString)};if(e instanceof Td){const n=t.databaseId,s=e.firestore._databaseId;if(!s.isEqual(n))throw t.createError(`Document reference is for database ${s.projectId}/${s.database} but should be for database ${n.projectId}/${n.database}`);return{referenceValue:fp(e.firestore._databaseId||t.databaseId,e._key.path)}}if(e instanceof Sd)return function(e,t){const n=e instanceof Sd?e.toArray():e,s={fields:{[Xl]:{stringValue:tu},[nu]:{arrayValue:{values:n.map(e=>{if("number"!=typeof e)throw t.createError("VectorValues must only contain numeric values.");return Tu(t.serializer,e)})}}}};return{mapValue:s}}(e,t);if(bp(e))return e._toProto(t.serializer);throw t.createError(`Unsupported field value: ${Il(e)}`)}(e,t)}function Rd(e){if("object"!=typeof e||null===e)return!1;if("undefined"!=typeof Temporal&&"function"==typeof Temporal.Instant&&e instanceof Temporal.Instant)return!0;const t=e;return"Temporal.Instant"===t[Symbol.toStringTag]&&"bigint"==typeof t.t}function kd(e){return!("object"!=typeof e||null===e||e instanceof Array||e instanceof Date||e instanceof Rl||e instanceof Np||e instanceof Op||e instanceof Td||e instanceof Sp||e instanceof Sd||Rd(e)||bp(e))}function Ld(e,t,n){if((t=Xn(t))instanceof Ap)return t._internalPath;if("string"==typeof t)return function(e,t){if(t.search(xd)>=0)throw Fd(`Invalid field path (${t}). Paths must not contain '~', '*', '/', '[', or ']'`,e);try{return new Ap(...t.split("."))._internalPath}catch(n){throw Fd(`Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,e)}}(e,t);throw Fd("Field path arguments must be of type string or ",e)}Sd._jsonSchemaVersion="firestore/vectorValue/1.0",Sd._jsonSchema={type:Ol("string",Sd._jsonSchemaVersion),vectorValues:Ol("object")};const xd=new RegExp("[~\\*/\\[\\]]");function Fd(e,t,n,s,r){let i=`Function ${t}() called with invalid data`;i+=". ";return new pl(hl.INVALID_ARGUMENT,i+e+"")}class Pd{constructor(e){this.optionDefinitions=e}_getKnownOptions(e,t){const n=vu.empty();for(const s in this.optionDefinitions)if(this.optionDefinitions.hasOwnProperty(s)){const r=this.optionDefinitions[s];if(s in e){const i=e[s];let a;r.nestedOptions&&vl(i)?a={mapValue:{fields:new Pd(r.nestedOptions).getOptionsProto(t,i)}}:i&&(a=Nd(i,t)??void 0),a&&n.set(ml.fromServerFormat(r.serverName),a)}}return n}getOptionsProto(e,t,n){const s=this._getKnownOptions(t,e);if(n){const t=new Map(function(e,t){const n=[];for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&n.push(t(e[s],s,e));return n}(n,(t,n)=>[ml.fromServerFormat(n),void 0!==t?Nd(t,e):null]));s.setAll(t)}return s.value.mapValue.fields??{}}}function Md(e){let t;return e instanceof Hd?e:(t=vl(e)?function(e){const t=[];for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)){const s=e[n];t.push(Kd(n)),t.push(Md(s))}return new Wd("map",t,"map")}(e):e instanceof Array?function(e){return function(e,t){return new Wd("array",e.map(e=>Md(e)),t)}(e,"array")}(e):Qd(e,void 0),t)}function Gd(e){if(e instanceof Hd)return e;if(e instanceof Sd)return Kd(e);if(Array.isArray(e))return Kd(function(e){return new Sd(e)}(e));throw new Error("Unsupported value: "+typeof e)}function Ud(e){return function(e){return"string"==typeof e}(e)?function(e){return function(e,t){return new qd("string"==typeof e?dl===e?new Ap(dl)._internalPath:Ld("field",e):e._internalPath,t)}(e,"field")}(e):Md(e)}class Hd{constructor(){this._protoValueType="ProtoValue"}add(e){return new Wd("add",[this,Md(e)],"add")}asBoolean(){if(this instanceof Yd)return this;if(this instanceof zd)return new Zd(this);if(this instanceof qd)return new ef(this);if(this instanceof Wd)return new Xd(this);throw new pl("invalid-argument",`Conversion of type ${typeof this} to BooleanExpression not supported.`)}subtract(e){return new Wd("subtract",[this,Md(e)],"subtract")}multiply(e){return new Wd("multiply",[this,Md(e)],"multiply")}divide(e){return new Wd("divide",[this,Md(e)],"divide")}mod(e){return new Wd("mod",[this,Md(e)],"mod")}equal(e){return new Wd("equal",[this,Md(e)],"equal").asBoolean()}notEqual(e){return new Wd("not_equal",[this,Md(e)],"notEqual").asBoolean()}lessThan(e){return new Wd("less_than",[this,Md(e)],"lessThan").asBoolean()}lessThanOrEqual(e){return new Wd("less_than_or_equal",[this,Md(e)],"lessThanOrEqual").asBoolean()}greaterThan(e){return new Wd("greater_than",[this,Md(e)],"greaterThan").asBoolean()}greaterThanOrEqual(e){return new Wd("greater_than_or_equal",[this,Md(e)],"greaterThanOrEqual").asBoolean()}arrayConcat(e,...t){const n=[e,...t].map(e=>Md(e));return new Wd("array_concat",[this,...n],"arrayConcat")}arrayContains(e){return new Wd("array_contains",[this,Md(e)],"arrayContains").asBoolean()}arrayContainsAll(e){const t=Array.isArray(e)?new Jd(e.map(Md),"arrayContainsAll"):e;return new Wd("array_contains_all",[this,t],"arrayContainsAll").asBoolean()}arrayContainsAny(e){const t=Array.isArray(e)?new Jd(e.map(Md),"arrayContainsAny"):e;return new Wd("array_contains_any",[this,t],"arrayContainsAny").asBoolean()}arrayReverse(){return new Wd("array_reverse",[this])}arrayLength(){return new Wd("array_length",[this],"arrayLength")}equalAny(e){const t=Array.isArray(e)?new Jd(e.map(Md),"equalAny"):e;return new Wd("equal_any",[this,t],"equalAny").asBoolean()}notEqualAny(e){const t=Array.isArray(e)?new Jd(e.map(Md),"notEqualAny"):e;return new Wd("not_equal_any",[this,t],"notEqualAny").asBoolean()}exists(){return new Wd("exists",[this],"exists").asBoolean()}charLength(){return new Wd("char_length",[this],"charLength")}like(e){return new Wd("like",[this,Md(e)],"like").asBoolean()}regexContains(e){return new Wd("regex_contains",[this,Md(e)],"regexContains").asBoolean()}regexFind(e){return new Wd("regex_find",[this,Md(e)],"regexFind")}regexFindAll(e){return new Wd("regex_find_all",[this,Md(e)],"regexFindAll")}regexMatch(e){return new Wd("regex_match",[this,Md(e)],"regexMatch").asBoolean()}stringContains(e){return new Wd("string_contains",[this,Md(e)],"stringContains").asBoolean()}startsWith(e){return new Wd("starts_with",[this,Md(e)],"startsWith").asBoolean()}endsWith(e){return new Wd("ends_with",[this,Md(e)],"endsWith").asBoolean()}toLower(){return new Wd("to_lower",[this],"toLower")}toUpper(){return new Wd("to_upper",[this],"toUpper")}trim(e){const t=[this];return e&&t.push(Md(e)),new Wd("trim",t,"trim")}ltrim(e){const t=[this];return e&&t.push(Md(e)),new Wd("ltrim",t,"ltrim")}rtrim(e){const t=[this];return e&&t.push(Md(e)),new Wd("rtrim",t,"rtrim")}type(){return new Wd("type",[this])}isType(e){return new Wd("is_type",[this,Kd(e)],"isType").asBoolean()}stringConcat(e,...t){const n=[e,...t].map(Md);return new Wd("string_concat",[this,...n],"stringConcat")}stringIndexOf(e){return new Wd("string_index_of",[this,Md(e)],"stringIndexOf")}stringRepeat(e){return new Wd("string_repeat",[this,Md(e)],"stringRepeat")}stringReplaceAll(e,t){return new Wd("string_replace_all",[this,Md(e),Md(t)],"stringReplaceAll")}stringReplaceOne(e,t){return new Wd("string_replace_one",[this,Md(e),Md(t)],"stringReplaceOne")}concat(e,...t){const n=[e,...t].map(Md);return new Wd("concat",[this,...n],"concat")}reverse(){return new Wd("reverse",[this],"reverse")}arrayFilter(e,t){return new Wd("array_filter",[this,Md(e),t],"arrayFilter")}arrayTransform(e,t){return new Wd("array_transform",[this,Md(e),t],"arrayTransform")}arrayTransformWithIndex(e,t,n){return new Wd("array_transform",[this,Md(e),Md(t),n],"arrayTransformWithIndex")}arraySlice(e,t){const n=[this,Md(e)];return void 0!==t&&n.push(Md(t)),new Wd("array_slice",n,"arraySlice")}arrayFirst(){return new Wd("array_first",[this],"arrayFirst")}arrayFirstN(e){return new Wd("array_first_n",[this,Md(e)],"arrayFirstN")}arrayLast(){return new Wd("array_last",[this],"arrayLast")}arrayLastN(e){return new Wd("array_last_n",[this,Md(e)],"arrayLastN")}arrayMaximum(){return new Wd("maximum",[this],"arrayMaximum")}arrayMaximumN(e){return new Wd("maximum_n",[this,Md(e)],"arrayMaximumN")}arrayMinimum(){return new Wd("minimum",[this],"arrayMinimum")}arrayMinimumN(e){return new Wd("minimum_n",[this,Md(e)],"arrayMinimumN")}arrayIndexOf(e){return new Wd("array_index_of",[this,Md(e),Md("first")],"arrayIndexOf")}arrayLastIndexOf(e){return new Wd("array_index_of",[this,Md(e),Md("last")],"arrayLastIndexOf")}arrayIndexOfAll(e){return new Wd("array_index_of_all",[this,Md(e)],"arrayIndexOfAll")}byteLength(){return new Wd("byte_length",[this],"byteLength")}ceil(){return new Wd("ceil",[this])}floor(){return new Wd("floor",[this])}abs(){return new Wd("abs",[this])}exp(){return new Wd("exp",[this])}mapGet(e){return new Wd("map_get",[this,Kd(e)],"mapGet")}mapSet(e,t,...n){const s=[this,Md(e),Md(t),...n.map(Md)];return new Wd("map_set",s,"mapSet")}mapKeys(){return new Wd("map_keys",[this],"mapKeys")}mapValues(){return new Wd("map_values",[this],"mapValues")}mapEntries(){return new Wd("map_entries",[this],"mapEntries")}getField(e){return new Wd("get_field",[this,Md(e)],"get_field")}count(){return Vd._create("count",[this],"count")}sum(){return Vd._create("sum",[this],"sum")}average(){return Vd._create("average",[this],"average")}minimum(){return Vd._create("minimum",[this],"minimum")}maximum(){return Vd._create("maximum",[this],"maximum")}first(){return Vd._create("first",[this],"first")}last(){return Vd._create("last",[this],"last")}arrayAgg(){return Vd._create("array_agg",[this],"arrayAgg")}arrayAggDistinct(){return Vd._create("array_agg_distinct",[this],"arrayAggDistinct")}countDistinct(){return Vd._create("count_distinct",[this],"countDistinct")}logicalMaximum(e,...t){const n=[e,...t];return new Wd("maximum",[this,...n.map(Md)],"logicalMaximum")}logicalMinimum(e,...t){const n=[e,...t];return new Wd("minimum",[this,...n.map(Md)],"minimum")}vectorLength(){return new Wd("vector_length",[this],"vectorLength")}cosineDistance(e){return new Wd("cosine_distance",[this,Gd(e)],"cosineDistance")}dotProduct(e){return new Wd("dot_product",[this,Gd(e)],"dotProduct")}euclideanDistance(e){return new Wd("euclidean_distance",[this,Gd(e)],"euclideanDistance")}unixMicrosToTimestamp(){return new Wd("unix_micros_to_timestamp",[this],"unixMicrosToTimestamp")}timestampToUnixMicros(){return new Wd("timestamp_to_unix_micros",[this],"timestampToUnixMicros")}unixMillisToTimestamp(){return new Wd("unix_millis_to_timestamp",[this],"unixMillisToTimestamp")}timestampToUnixMillis(){return new Wd("timestamp_to_unix_millis",[this],"timestampToUnixMillis")}unixSecondsToTimestamp(){return new Wd("unix_seconds_to_timestamp",[this],"unixSecondsToTimestamp")}timestampToUnixSeconds(){return new Wd("timestamp_to_unix_seconds",[this],"timestampToUnixSeconds")}timestampAdd(e,t){return new Wd("timestamp_add",[this,Md(e),Md(t)],"timestampAdd")}timestampSubtract(e,t){return new Wd("timestamp_subtract",[this,Md(e),Md(t)],"timestampSubtract")}timestampDiff(e,t){return new Wd("timestamp_diff",[this,Ud(e),Md(t)],"timestampDiff")}timestampExtract(e,t){const n=[this,Md(e)];return t&&n.push(Md(t)),new Wd("timestamp_extract",n,"timestampExtract")}documentId(){return new Wd("document_id",[this],"documentId")}parent(){return new Wd("parent",[this],"parent")}substring(e,t){const n=Md(e);return new Wd("substring",void 0===t?[this,n]:[this,n,Md(t)],"substring")}arrayGet(e){return new Wd("array_get",[this,Md(e)],"arrayGet")}isError(){return new Wd("is_error",[this],"isError").asBoolean()}ifError(e){const t=new Wd("if_error",[this,Md(e)],"ifError");return e instanceof Yd?t.asBoolean():t}isAbsent(){return new Wd("is_absent",[this],"isAbsent").asBoolean()}mapRemove(e){return new Wd("map_remove",[this,Md(e)],"mapRemove")}mapMerge(e,...t){const n=Md(e),s=t.map(Md);return new Wd("map_merge",[this,n,...s],"mapMerge")}pow(e){return new Wd("pow",[this,Md(e)])}trunc(e){return void 0===e?new Wd("trunc",[this]):new Wd("trunc",[this,Md(e)],"trunc")}round(e){return void 0===e?new Wd("round",[this]):new Wd("round",[this,Md(e)],"round")}collectionId(){return new Wd("collection_id",[this])}length(){return new Wd("length",[this])}ln(){return new Wd("ln",[this])}sqrt(){return new Wd("sqrt",[this])}stringReverse(){return new Wd("string_reverse",[this])}ifAbsent(e){return new Wd("if_absent",[this,Md(e)],"ifAbsent")}ifNull(e){return new Wd("if_null",[this,Md(e)],"ifNull")}coalesce(e,...t){return new Wd("coalesce",[this,Md(e),...t.map(Md)],"coalesce")}join(e){return new Wd("join",[this,Md(e)],"join")}log10(){return new Wd("log10",[this])}arraySum(){return new Wd("sum",[this])}split(e){return new Wd("split",[this,Md(e)])}timestampTruncate(e,t){const n=[this,Md(e)];return t&&n.push(Md(t)),new Wd("timestamp_trunc",n)}ascending(){return function(e){return new tf(Ud(e),"ascending","ascending")}(this)}descending(){return function(e){return new tf(Ud(e),"descending","descending")}(this)}as(e){return new $d(this,e,"as")}}class Vd{constructor(e,t){this.name=e,this.params=t,this.exprType="AggregateFunction",this._protoValueType="ProtoValue"}static _create(e,t,n){const s=new Vd(e,t);return s._methodName=n,s}as(e){return new jd(this,e,"as")}_toProto(e){return{functionValue:{name:this.name,args:this.params.map(t=>t._toProto(e))}}}_readUserData(e){e=this._methodName?e.contextWith({methodName:this._methodName}):e,this.params.forEach(t=>t._readUserData(e))}}class jd{constructor(e,t,n){this.aggregate=e,this.alias=t,this._methodName=n}_readUserData(e){this.aggregate._readUserData(e)}}class $d{constructor(e,t,n){this.expr=e,this.alias=t,this._methodName=n,this.exprType="AliasedExpression",this.selectable=!0}_readUserData(e){this.expr._readUserData(e)}}class Jd extends Hd{constructor(e,t){super(),this.cr=e,this._methodName=t,this.expressionType="ListOfExpressions"}_toProto(e){return{arrayValue:{values:this.cr.map(t=>t._toProto(e))}}}_readUserData(e){this.cr.forEach(t=>t._readUserData(e))}}class qd extends Hd{constructor(e,t){super(),this.fieldPath=e,this._methodName=t,this.expressionType="Field",this.selectable=!0}get _fieldPath(){return this.fieldPath}get fieldName(){return this.fieldPath.canonicalString()}get alias(){return this.fieldName}get expr(){return this}geoDistance(e){return new Wd("geo_distance",[this,Md(e)],"geoDistance")}_toProto(e){return{fieldReferenceValue:this.fieldPath.canonicalString()}}_readUserData(e){}}class zd extends Hd{constructor(e,t){super(),this.value=e,this._methodName=t,this.expressionType="Constant"}static _fromProto(e){const t=new zd(e,void 0);return t._protoValue=e,t}_toProto(e){return Yc(void 0!==this._protoValue,237),this._protoValue}_getValue(){return this._protoValue}_readUserData(e){e=this._methodName?e.contextWith({methodName:this._methodName}):e,function(e){return"object"==typeof e&&null!==e&&!!("nullValue"in e&&(null===e.nullValue||"NULL_VALUE"===e.nullValue)||"booleanValue"in e&&(null===e.booleanValue||"boolean"==typeof e.booleanValue)||"integerValue"in e&&(null===e.integerValue||"number"==typeof e.integerValue||"string"==typeof e.integerValue)||"doubleValue"in e&&(null===e.doubleValue||"number"==typeof e.doubleValue)||"timestampValue"in e&&(null===e.timestampValue||function(e){return"object"==typeof e&&null!==e&&"seconds"in e&&(null===e.seconds||"number"==typeof e.seconds||"string"==typeof e.seconds)&&"nanos"in e&&(null===e.nanos||"number"==typeof e.nanos)}(e.timestampValue))||"stringValue"in e&&(null===e.stringValue||"string"==typeof e.stringValue)||"bytesValue"in e&&(null===e.bytesValue||e.bytesValue instanceof Uint8Array)||"referenceValue"in e&&(null===e.referenceValue||"string"==typeof e.referenceValue)||"geoPointValue"in e&&(null===e.geoPointValue||function(e){return"object"==typeof e&&null!==e&&"latitude"in e&&(null===e.latitude||"number"==typeof e.latitude)&&"longitude"in e&&(null===e.longitude||"number"==typeof e.longitude)}(e.geoPointValue))||"arrayValue"in e&&(null===e.arrayValue||function(e){return"object"==typeof e&&null!==e&&!(!("values"in e)||null!==e.values&&!Array.isArray(e.values))}(e.arrayValue))||"mapValue"in e&&(null===e.mapValue||function(e){return"object"==typeof e&&null!==e&&!(!("fields"in e)||null!==e.fields&&!vl(e.fields))}(e.mapValue))||"fieldReferenceValue"in e&&(null===e.fieldReferenceValue||"string"==typeof e.fieldReferenceValue)||"functionValue"in e&&(null===e.functionValue||function(e){return"object"==typeof e&&null!==e&&!(!("name"in e)||null!==e.name&&"string"!=typeof e.name||!("args"in e)||null!==e.args&&!Array.isArray(e.args))}(e.functionValue))||"pipelineValue"in e&&(null===e.pipelineValue||function(e){return"object"==typeof e&&null!==e&&!(!("stages"in e)||null!==e.stages&&!Array.isArray(e.stages))}(e.pipelineValue)))}(this._protoValue)||(this._protoValue=Nd(this.value,e))}}function Kd(e,t){return Qd(e,"constant")}function Qd(e,t){const n=new zd(e,t);return"boolean"==typeof e?new Zd(n):n}class Wd extends Hd{constructor(e,t,n,s){super(),this.name=e,this.params=t,this.expressionType="Function",this._optionsProto=void 0,void 0!==n&&(this._methodName=n),void 0!==s&&(this._options=s)}get _optionsUtil(){return new Pd({})}_toProto(e){const t={functionValue:{name:this.name,args:this.params.map(t=>t._toProto(e))}};return this._optionsProto&&(t.functionValue.options=this._optionsProto),t}_readUserData(e){e=this._methodName?e.contextWith({methodName:this._methodName}):e,this.params.forEach(t=>t._readUserData(e)),this._options&&(this._optionsProto=this._optionsUtil.getOptionsProto(e,this._options))}}class Yd extends Hd{get _methodName(){return this._expr._methodName}countIf(){return Vd._create("count_if",[this],"countIf")}not(){return new Wd("not",[this],"not").asBoolean()}conditional(e,t){return new Wd("conditional",[this,e,t],"conditional")}ifError(e){const t=Md(e),n=new Wd("if_error",[this,t],"ifError");return t instanceof Yd?n.asBoolean():n}_toProto(e){return this._expr._toProto(e)}_readUserData(e){this._expr._readUserData(e)}}class Xd extends Yd{constructor(e){super(),this._expr=e,this.expressionType="Function"}}class Zd extends Yd{constructor(e){super(),this._expr=e,this.expressionType="Constant"}_getValue(){return this._expr._getValue()}}class ef extends Yd{constructor(e){super(),this._expr=e,this.expressionType="Field"}}class tf{constructor(e,t,n){this.expr=e,this.direction=t,this._methodName=n,this._protoValueType="ProtoValue"}_toProto(e){return{mapValue:{fields:{direction:Ip(this.direction),expression:this.expr._toProto(e)}}}}_readUserData(e){this.expr._readUserData(e)}}class nf{constructor(e){this.optionsProto=void 0,({rawOptions:this.rawOptions,...this.knownOptions}=e)}_readUserData(e){this.optionsProto=this._optionsUtil.getOptionsProto(e,this.knownOptions,this.rawOptions)}_toProto(e){return{name:this._name,options:this.optionsProto}}}class sf extends nf{get _name(){return"add_fields"}get _optionsUtil(){return new Pd({})}constructor(e,t){super(t),this.fields=e}_toProto(e){return{...super._toProto(e),args:[vp(e,this.fields)]}}_readUserData(e){super._readUserData(e),gf(this.fields,e)}}class rf extends nf{get _name(){return"aggregate"}get _optionsUtil(){return new Pd({})}constructor(e,t,n){super(n),this.groups=e,this.accumulators=t}_toProto(e){return{...super._toProto(e),args:[vp(e,this.accumulators),vp(e,this.groups)]}}_readUserData(e){super._readUserData(e),gf(this.groups,e),gf(this.accumulators,e)}}class af extends nf{get _name(){return"distinct"}get _optionsUtil(){return new Pd({})}constructor(e,t){super(t),this.groups=e}_toProto(e){return{...super._toProto(e),args:[vp(e,this.groups)]}}_readUserData(e){super._readUserData(e),gf(this.groups,e)}}class of extends nf{get _name(){return"collection"}get _optionsUtil(){return new Pd({forceIndex:{serverName:"force_index"}})}constructor(e,t){super(t),this.hr=e.startsWith("/")?e:"/"+e}_toProto(e){return{...super._toProto(e),args:[{referenceValue:this.hr}]}}_readUserData(e){super._readUserData(e)}}class Bf extends nf{get _name(){return"collection_group"}get _optionsUtil(){return new Pd({forceIndex:{serverName:"force_index"}})}constructor(e,t){super(t),this.collectionId=e}_toProto(e){return{...super._toProto(e),args:[{referenceValue:""},{stringValue:this.collectionId}]}}_readUserData(e){super._readUserData(e)}}class cf extends nf{get _name(){return"database"}get _optionsUtil(){return new Pd({})}_toProto(e){return{...super._toProto(e)}}_readUserData(e){super._readUserData(e)}}class lf extends nf{get _name(){return"documents"}get _optionsUtil(){return new Pd({})}constructor(e,t){if(super(t),!e||0===e.length)throw new pl(hl.INVALID_ARGUMENT,"Empty document paths are not allowed in DocumentsSource");const n=e.map(e=>e.startsWith("/")?e:"/"+e),s=new Set(n);if(s.size!==n.length)throw new pl(hl.INVALID_ARGUMENT,"Duplicate document paths are not allowed in DocumentsSource");this.Tr=n,this.Pr=s}_toProto(e){return{...super._toProto(e),args:this.Tr.map(e=>({referenceValue:e}))}}_readUserData(e){super._readUserData(e)}}class uf extends nf{get _name(){return"where"}get _optionsUtil(){return new Pd({})}constructor(e,t){super(t),this.condition=e}_toProto(e){return{...super._toProto(e),args:[this.condition._toProto(e)]}}_readUserData(e){super._readUserData(e),gf(this.condition,e)}}class hf extends nf{get _name(){return"limit"}get _optionsUtil(){return new Pd({})}constructor(e,t){Yc(!isNaN(e)&&e!==1/0&&e!==-1/0,34860),super(t),this.limit=e}_toProto(e){return{...super._toProto(e),args:[Au(e,this.limit)]}}}class pf extends nf{get _name(){return"offset"}get _optionsUtil(){return new Pd({})}constructor(e,t){super(t),this.offset=e}_toProto(e){return{...super._toProto(e),args:[Au(e,this.offset)]}}}class df extends nf{get _name(){return"select"}get _optionsUtil(){return new Pd({})}constructor(e,t){super(t),this.selections=e}_toProto(e){return{...super._toProto(e),args:[vp(e,this.selections)]}}_readUserData(e){super._readUserData(e),gf(this.selections,e)}}class ff extends nf{get _name(){return"sort"}get _optionsUtil(){return new Pd({})}constructor(e,t){super(t),this.orderings=e}_toProto(e){return{...super._toProto(e),args:this.orderings.map(t=>t._toProto(e))}}_readUserData(e){super._readUserData(e),gf(this.orderings,e)}}class Cf extends nf{get _name(){return"replace_with"}get _optionsUtil(){return new Pd({})}constructor(e,t){super(t),this.map=e}_toProto(e){return{...super._toProto(e),args:[this.map._toProto(e),Ip(Cf.Ir)]}}_readUserData(e){super._readUserData(e),gf(this.map,e)}}function gf(e,t){return function(e){return"function"==typeof e._readUserData}(e)?e._readUserData(t):Array.isArray(e)||e instanceof Map?e.forEach(e=>e._readUserData(t)):Object.values(e).forEach(e=>e._readUserData(t)),e}Cf.Ir="full_replace";class mf{constructor(e,t,n){this.serializer=e,this.stages=t,this.listenOptions=n,this.isCorePipeline=!0}getPipelineCollection(){return Ef(this)}getPipelineCollectionGroup(){return yf(this)}getPipelineCollectionId(){return function(e){switch(wf(e)){case"collection":return Cl.fromString(Ef(e)).lastSegment();case"collection_group":return yf(e);default:return}}(this)}getPipelineDocuments(){return Df(this)}getPipelineFlavor(){return function(e){let t="exact";return e.stages.forEach((n,s)=>{n._name!==af.name&&n._name!==rf.name||(t="keyless"),n._name===df.name&&"exact"===t&&(t="augmented"),n._name===sf.name&&s<e.stages.length-1&&"exact"===t&&(t="augmented")}),t}(this)}getPipelineSourceType(){return wf(this)}}function wf(e){const t=e.stages[0];return t instanceof of||t instanceof Bf||t instanceof cf||t instanceof lf?t._name:"unknown"}function Ef(e){if("collection"===wf(e))return e.stages[0].hr}function yf(e){if("collection_group"===wf(e))return e.stages[0].collectionId}function Df(e){if("documents"===wf(e))return e.stages[0].Tr}class _f{constructor(e,t){this.type=e,this.value=t}static mr(){return new _f("ERROR",void 0)}static pr(){return new _f("UNSET",void 0)}static gr(){return new _f("NULL",su)}static newValue(e){return wu(e)?new _f("NULL",su):function(e){return!!e&&"booleanValue"in e}(e)?new _f("BOOLEAN",e):fu(e)?new _f("INT",e):Cu(e)?new _f("DOUBLE",e):function(e){return!!e&&"timestampValue"in e&&!!e.timestampValue}(e)?new _f("TIMESTAMP",e):function(e){return!!e&&"stringValue"in e}(e)?new _f("STRING",e):function(e){return!!e&&"bytesValue"in e}(e)?new _f("BYTES",e):e.referenceValue?new _f("REFERENCE",e):e.geoPointValue?new _f("GEO_POINT",e):mu(e)?new _f("ARRAY",e):Du(e)?new _f("VECTOR",e):yu(e)?new _f("MAP",e):new _f("ERROR",void 0)}yr(){return"ERROR"===this.type||"UNSET"===this.type}wr(){return"NULL"===this.type}}function bf(e){if(!e.yr())return e.value}function vf(e){return e instanceof Yd?e._expr:e}function If(e){if((e=vf(e))instanceof qd)return new Tf(e);if(e instanceof zd)return new Of(e);if(e instanceof Jd)return new Af(e);if(e instanceof Wd){if("add"===e.name)return new Ff(e);if("subtract"===e.name)return new Pf(e);if("multiply"===e.name)return new Mf(e);if("divide"===e.name)return new Gf(e);if("mod"===e.name)return new Uf(e);if("and"===e.name)return new Hf(e);if("equal"===e.name)return new sC(e);if("not_equal"===e.name)return new rC(e);if("less_than"===e.name)return new iC(e);if("less_than_or_equal"===e.name)return new aC(e);if("greater_than"===e.name)return new oC(e);if("greater_than_or_equal"===e.name)return new BC(e);if("array_concat"===e.name)return new cC(e);if("array_reverse"===e.name)return new lC(e);if("array_contains"===e.name)return new uC(e);if("array_contains_all"===e.name)return new hC(e);if("array_contains_any"===e.name)return new pC(e);if("array_length"===e.name)return new dC(e);if("array_element"===e.name)return new fC(e);if("equal_any"===e.name)return new Jf(e);if("not_equal_any"===e.name)return new qf(e);if("is_nan"===e.name)return new zf(e);if("is_not_nan"===e.name)return new Kf(e);if("is_null"===e.name)return new Qf(e);if("is_not_null"===e.name)return new Wf(e);if("is_error"===e.name)return new Yf(e);if("exists"===e.name)return new Xf(e);if("not"===e.name)return new Vf(e);if("or"===e.name)return new jf(e);if("xor"===e.name)return new $f(e);if("conditional"===e.name)return new Zf(e);if("maximum"===e.name)return new eC(e);if("minimum"===e.name)return new tC(e);if("reverse"===e.name)return new CC(e);if("replace_first"===e.name)return new gC(e);if("replace_all"===e.name)return new mC(e);if("char_length"===e.name)return new wC(e);if("byte_length"===e.name)return new EC(e);if("like"===e.name)return new DC(e);if("regex_contains"===e.name)return new _C(e);if("regex_match"===e.name)return new bC(e);if("string_contains"===e.name)return new vC(e);if("starts_with"===e.name)return new IC(e);if("ends_with"===e.name)return new TC(e);if("to_lower"===e.name)return new OC(e);if("to_upper"===e.name)return new AC(e);if("trim"===e.name)return new SC(e);if("string_concat"===e.name)return new NC(e);if("map_get"===e.name)return new RC(e);if("cosine_distance"===e.name)return new LC(e);if("dot_product"===e.name)return new xC(e);if("euclidean_distance"===e.name)return new FC(e);if("vector_length"===e.name)return new PC(e);if("unix_micros_to_timestamp"===e.name)return new XC(e);if("timestamp_to_unix_micros"===e.name)return new ng(e);if("unix_millis_to_timestamp"===e.name)return new ZC(e);if("timestamp_to_unix_millis"===e.name)return new sg(e);if("unix_seconds_to_timestamp"===e.name)return new eg(e);if("timestamp_to_unix_seconds"===e.name)return new rg(e);if("timestamp_add"===e.name)return new ag(e);if("timestamp_subtract"===e.name)return new og(e)}throw new Error(`Unknown Expr : ${e}`)}class Tf{constructor(e){this.expr=e}evaluate(e,t){if(this.expr.fieldName===dl)return _f.newValue({referenceValue:gp(e.serializer,t.key)});if("__update_time__"===this.expr.fieldName)return _f.newValue({timestampValue:pp(e.serializer,t.version)});if("__create_time__"===this.expr.fieldName)return _f.newValue({timestampValue:pp(e.serializer,t.createTime)});const n=t.data.field(this.expr._fieldPath);return n?jl(n)?_f.newValue(function(e,t){if("estimate"===e.serverTimestampBehavior)return{timestampValue:pp(e.serializer,Ah.fromTimestamp(Jl(t)))};if("previous"===e.serverTimestampBehavior){const e=$l(t);if(e)return e}return{nullValue:"NULL_VALUE"}}(e,n)):_f.newValue(n):_f.pr()}}class Of{constructor(e){this.expr=e}evaluate(e,t){return _f.newValue(this.expr._getValue())}}class Af{constructor(e){this.expr=e}evaluate(e,t){const n=this.expr.cr.map(n=>If(n).evaluate(e,t));return n.some(e=>e.yr())?_f.mr():_f.newValue({arrayValue:{values:n.map(e=>e.value)}})}}function Sf(e){return Cu(e)?Number(e.doubleValue):Number(e.integerValue)}function Nf(e){return BigInt(e.integerValue)}const Rf=BigInt("0x7fffffffffffffff"),kf=-BigInt("0x8000000000000000");class Lf{constructor(e){this.expr=e}evaluate(e,t){Yc(this.expr.params.length>=2,24778);const n=If(this.expr.params[0]).evaluate(e,t),s=If(this.expr.params[1]).evaluate(e,t);let r=this.br(n,s);for(const n of this.expr.params.slice(2)){const s=If(n).evaluate(e,t);r=this.br(r,s)}return r}br(e,t){if(e.yr()||t.yr())return _f.mr();if(e.wr()||t.wr())return _f.gr();const n=e.value,s=t.value;if(!Cu(n)&&!fu(n)||!Cu(s)&&!fu(s))return _f.mr();if(Cu(n)||Cu(s)){const e=this.Sr(n,s);return e?_f.newValue(e):_f.mr()}if(fu(n)&&fu(s)){const e=this.vr(n,s);return void 0===e?_f.mr():"number"==typeof e?_f.newValue({doubleValue:e}):e<kf||e>Rf?_f.mr():_f.newValue({integerValue:`${e}`})}return _f.mr()}}function xf(e,t){return au(e)!==au(t)?"TYPE_MISMATCH":Eu(e)||Eu(t)?"NOT_EQ":wu(e)&&wu(t)?"EQ":wu(e)||wu(t)?"NULL":mu(e)&&mu(t)?function(e,t){if(e.values?.length!==t.values?.length)return"NOT_EQ";let n=!1;for(let s=0;s<(e.values?.length??0);s++){const r=e.values[s],i=t.values[s];switch(xf(r,i)){case"EQ":break;case"NOT_EQ":case"TYPE_MISMATCH":return"NOT_EQ";case"NULL":n=!0;break;default:Qc(44609,{Dr:r,Cr:i})}}return n?"NULL":"EQ"}(e.arrayValue,t.arrayValue):Du(e)&&Du(t)||yu(e)&&yu(t)?function(e,t){const n=e.fields||{},s=t.fields||{};if(El(n)!==El(s))return"NOT_EQ";let r=!1;for(const e in n)if(n.hasOwnProperty(e)){if(void 0===s[e])return"NOT_EQ";switch(xf(n[e],s[e])){case"NOT_EQ":case"TYPE_MISMATCH":return"NOT_EQ";case"NULL":r=!0}}return r?"NULL":"EQ"}(e.mapValue,t.mapValue):function(e,t){return ou(e,t,{u:!1,i:!0,o:!0})}(e,t)?"EQ":"NOT_EQ"}class Ff extends Lf{vr(e,t){return Nf(e)+Nf(t)}Sr(e,t){return{doubleValue:Sf(e)+Sf(t)}}}class Pf extends Lf{constructor(e){super(e),this.expr=e}vr(e,t){return Nf(e)-Nf(t)}Sr(e,t){return{doubleValue:Sf(e)-Sf(t)}}}class Mf extends Lf{constructor(e){super(e),this.expr=e}vr(e,t){return Nf(e)*Nf(t)}Sr(e,t){return{doubleValue:Sf(e)*Sf(t)}}}class Gf extends Lf{constructor(e){super(e),this.expr=e}vr(e,t){const n=Nf(t);if(n!==BigInt(0))return Nf(e)/n}Sr(e,t){const n=Sf(t);return 0===n?{doubleValue:Yl(n)?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY}:{doubleValue:Sf(e)/n}}}class Uf extends Lf{constructor(e){super(e),this.expr=e}vr(e,t){const n=Nf(t);if(n!==BigInt(0))return Nf(e)%n}Sr(e,t){const n=Sf(t);if(0!==n)return{doubleValue:Sf(e)%n}}}class Hf{constructor(e){this.expr=e}evaluate(e,t){let n=!1,s=!1;for(const r of this.expr.params){const i=If(r).evaluate(e,t);switch(i.type){case"BOOLEAN":if(!i.value?.booleanValue)return _f.newValue(iu);break;case"NULL":s=!0;break;default:n=!0}}return n?_f.mr():s?_f.gr():_f.newValue(ru)}}class Vf{constructor(e){this.expr=e}evaluate(e,t){Yc(1===this.expr.params.length,9634);const n=If(this.expr.params[0]).evaluate(e,t);switch(n.type){case"BOOLEAN":return _f.newValue({booleanValue:!n.value?.booleanValue});case"NULL":return _f.gr();default:return _f.mr()}}}class jf{constructor(e){this.expr=e}evaluate(e,t){let n=!1,s=!1;for(const r of this.expr.params){const i=If(r).evaluate(e,t);switch(i.type){case"BOOLEAN":if(i.value?.booleanValue)return _f.newValue(ru);break;case"NULL":s=!0;break;default:n=!0}}return n?_f.mr():s?_f.gr():_f.newValue(iu)}}class $f{constructor(e){this.expr=e}evaluate(e,t){let n=!1,s=!1;for(const r of this.expr.params){const i=If(r).evaluate(e,t);switch(i.type){case"BOOLEAN":n=$f.xor(n,!!i.value?.booleanValue);break;case"NULL":s=!0;break;default:return _f.mr()}}return s?_f.gr():_f.newValue({booleanValue:n})}static xor(e,t){return(e||t)&&!(e&&t)}}class Jf{constructor(e){this.expr=e}evaluate(e,t){Yc(2===this.expr.params.length,55094);let n=!1;const s=If(this.expr.params[0]).evaluate(e,t);switch(s.type){case"NULL":n=!0;break;case"ERROR":case"UNSET":return _f.mr()}const r=If(this.expr.params[1]).evaluate(e,t);switch(r.type){case"ARRAY":break;case"NULL":n=!0;break;default:return _f.mr()}if(n)return _f.gr();for(const e of r.value?.arrayValue?.values??[])switch(wu(s.value)&&wu(e)?"EQ":xf(s.value,e)){case"EQ":return _f.newValue(ru);case"NOT_EQ":case"TYPE_MISMATCH":break;case"NULL":n=!0;break;default:Qc(44608,{value:s.value,candidate:e})}return n?_f.gr():_f.newValue(iu)}}class qf{constructor(e){this.expr=e}evaluate(e,t){return new Vf(new Wd("not",[new Wd("equal_any",this.expr.params)])).evaluate(e,t)}}class zf{constructor(e){this.expr=e}evaluate(e,t){Yc(1===this.expr.params.length,23322);const n=If(this.expr.params[0]).evaluate(e,t);switch(n.type){case"INT":return _f.newValue(iu);case"DOUBLE":return _f.newValue({booleanValue:isNaN(Sf(n.value))});case"NULL":return _f.gr();default:return _f.mr()}}}class Kf{constructor(e){this.expr=e}evaluate(e,t){return Yc(1===this.expr.params.length,50406),new Vf(new Wd("not",[new Wd("is_nan",this.expr.params)])).evaluate(e,t)}}class Qf{constructor(e){this.expr=e}evaluate(e,t){switch(Yc(1===this.expr.params.length,23123),If(this.expr.params[0]).evaluate(e,t).type){case"NULL":return _f.newValue(ru);case"UNSET":case"ERROR":return _f.mr();default:return _f.newValue(iu)}}}class Wf{constructor(e){this.expr=e}evaluate(e,t){return Yc(1===this.expr.params.length,23167),new Vf(new Wd("not",[new Wd("is_null",this.expr.params)])).evaluate(e,t)}}class Yf{constructor(e){this.expr=e}evaluate(e,t){return Yc(1===this.expr.params.length,5228),"ERROR"===If(this.expr.params[0]).evaluate(e,t).type?_f.newValue(ru):_f.newValue(iu)}}class Xf{constructor(e){this.expr=e}evaluate(e,t){switch(Yc(1===this.expr.params.length,6877),If(this.expr.params[0]).evaluate(e,t).type){case"ERROR":return _f.mr();case"UNSET":return _f.newValue(iu);default:return _f.newValue(ru)}}}class Zf{constructor(e){this.expr=e}evaluate(e,t){Yc(3===this.expr.params.length,11706);const n=If(this.expr.params[0]).evaluate(e,t);switch(n.type){case"BOOLEAN":return n.value?.booleanValue?If(this.expr.params[1]).evaluate(e,t):If(this.expr.params[2]).evaluate(e,t);case"NULL":return If(this.expr.params[2]).evaluate(e,t);default:return _f.mr()}}}class eC{constructor(e){this.expr=e}evaluate(e,t){const n=this.expr.params.map(n=>If(n).evaluate(e,t));let s;for(const e of n)switch(e.type){case"ERROR":case"UNSET":case"NULL":continue;default:s=void 0===s||cu(e.value,s.value)>0?e:s}return void 0===s?_f.gr():s}}class tC{constructor(e){this.expr=e}evaluate(e,t){const n=this.expr.params.map(n=>If(n).evaluate(e,t));let s;for(const e of n)switch(e.type){case"ERROR":case"UNSET":case"NULL":continue;default:s=void 0===s||cu(e.value,s.value)<0?e:s}return void 0===s?_f.gr():s}}class nC{constructor(e){this.expr=e}evaluate(e,t){Yc(2===this.expr.params.length,31033,`${this.expr.name}() function should have exactly 2 params`);const n=If(this.expr.params[0]).evaluate(e,t);switch(n.type){case"ERROR":case"UNSET":return _f.mr()}const s=If(this.expr.params[1]).evaluate(e,t);switch(s.type){case"ERROR":case"UNSET":return _f.mr()}return this.Fr(n,s)}}class sC extends nC{constructor(e){super(e),this.expr=e}Fr(e,t){if(e.wr()&&t.wr())return _f.newValue(ru);if(e.wr()||t.wr())return _f.newValue(iu);if(Eu(e.value)||Eu(t.value))return _f.newValue(iu);if(au(e.value)!==au(t.value))return _f.newValue(iu);switch(xf(e.value,t.value)){case"EQ":return _f.newValue(ru);case"NOT_EQ":return _f.newValue(iu);case"NULL":return _f.gr();default:Qc(44615,{left:e,right:t})}}}class rC extends nC{constructor(e){super(e),this.expr=e}Fr(e,t){switch(xf(e.value,t.value)){case"EQ":return _f.newValue(iu);case"NOT_EQ":case"TYPE_MISMATCH":return _f.newValue(ru);case"NULL":return _f.gr();default:Qc(44614,{left:e,right:t})}}}class iC extends nC{constructor(e){super(e),this.expr=e}Fr(e,t){return au(e.value)!==au(t.value)||Eu(e.value)||Eu(t.value)?_f.newValue(iu):_f.newValue({booleanValue:cu(e.value,t.value)<0})}}class aC extends nC{constructor(e){super(e),this.expr=e}Fr(e,t){return au(e.value)!==au(t.value)||Eu(e.value)||Eu(t.value)?_f.newValue(iu):"EQ"===xf(e.value,t.value)?_f.newValue(ru):_f.newValue({booleanValue:cu(e.value,t.value)<0})}}class oC extends nC{constructor(e){super(e),this.expr=e}Fr(e,t){return au(e.value)!==au(t.value)||Eu(e.value)||Eu(t.value)?_f.newValue(iu):_f.newValue({booleanValue:cu(e.value,t.value)>0})}}class BC extends nC{constructor(e){super(e),this.expr=e}Fr(e,t){return au(e.value)!==au(t.value)||Eu(e.value)||Eu(t.value)?_f.newValue(iu):"EQ"===xf(e.value,t.value)?_f.newValue(ru):_f.newValue({booleanValue:cu(e.value,t.value)>0})}}class cC{constructor(e){this.expr=e}evaluate(e,t){throw new Error("Unimplemented")}}class lC{constructor(e){this.expr=e}evaluate(e,t){Yc(1===this.expr.params.length,216);const n=If(this.expr.params[0]).evaluate(e,t);switch(n.type){case"NULL":return _f.gr();case"ARRAY":{const e=n.value.arrayValue?.values??[];return _f.newValue({arrayValue:{values:[...e].reverse()}})}default:return _f.mr()}}}class uC{constructor(e){this.expr=e}evaluate(e,t){return Yc(2===this.expr.params.length,52884),new Jf(new Wd("eq_any",[this.expr.params[1],this.expr.params[0]])).evaluate(e,t)}}class hC{constructor(e){this.expr=e}evaluate(e,t){Yc(2===this.expr.params.length,1392);let n=!1;const s=If(this.expr.params[0]).evaluate(e,t);switch(s.type){case"ARRAY":break;case"NULL":n=!0;break;default:return _f.mr()}const r=If(this.expr.params[1]).evaluate(e,t);switch(r.type){case"ARRAY":break;case"NULL":n=!0;break;default:return _f.mr()}if(n)return _f.gr();const i=r.value?.arrayValue?.values??[],a=s.value?.arrayValue?.values??[];for(const e of i){let t=!1;n=!1;for(const s of a){switch(wu(e)&&wu(s)?"EQ":xf(e,s)){case"EQ":t=!0;break;case"NOT_EQ":case"TYPE_MISMATCH":break;case"NULL":n=!0;break;default:Qc(44613,{value:s,search:e})}if(t)break}if(!t)return _f.newValue(iu)}return _f.newValue(ru)}}class pC{constructor(e){this.expr=e}evaluate(e,t){Yc(2===this.expr.params.length,2680);let n=!1;const s=If(this.expr.params[0]).evaluate(e,t);switch(s.type){case"ARRAY":break;case"NULL":n=!0;break;default:return _f.mr()}const r=If(this.expr.params[1]).evaluate(e,t);switch(r.type){case"ARRAY":break;case"NULL":n=!0;break;default:return _f.mr()}if(n)return _f.gr();const i=r.value?.arrayValue?.values??[],a=s.value?.arrayValue?.values??[];for(const e of a)for(const t of i)switch(wu(e)&&wu(t)?"EQ":xf(e,t)){case"EQ":return _f.newValue(ru);case"NOT_EQ":case"TYPE_MISMATCH":break;case"NULL":n=!0;break;default:Qc(60403,{value:e,search:t})}return n?_f.gr():_f.newValue(iu)}}class dC{constructor(e){this.expr=e}evaluate(e,t){Yc(1===this.expr.params.length,38605);const n=If(this.expr.params[0]).evaluate(e,t);switch(n.type){case"NULL":return _f.gr();case"ARRAY":return _f.newValue({integerValue:`${n.value?.arrayValue?.values?.length??0}`});default:return _f.mr()}}}class fC{constructor(e){this.expr=e}evaluate(e,t){throw new Error("Unimplemented")}}class CC{constructor(e){this.expr=e}evaluate(e,t){Yc(1===this.expr.params.length,1508);const n=If(this.expr.params[0]).evaluate(e,t);switch(n.type){case"NULL":return _f.gr();case"BYTES":{const e=n.value?.bytesValue;if("string"==typeof e){const t=Ll.fromBase64String(e).toUint8Array();return t.reverse(),_f.newValue({bytesValue:Ll.fromUint8Array(t).toBase64()})}return _f.newValue({bytesValue:new Uint8Array(e).reverse()})}case"STRING":{const e=n.value?.stringValue,t=new Intl.__PRIVATE_Segmenter(void 0,{granularity:"grapheme"}).segment(e),s=Array.from(t,e=>e.segment).reverse();return _f.newValue({stringValue:s.join("")})}default:return _f.mr()}}}class gC{constructor(e){this.expr=e}evaluate(e,t){throw new Error("Unimplemented")}}class mC{constructor(e){this.expr=e}evaluate(e,t){throw new Error("Unimplemented")}}class wC{constructor(e){this.expr=e}evaluate(e,t){Yc(1===this.expr.params.length,19400);const n=If(this.expr.params[0]).evaluate(e,t);switch(n.type){case"NULL":return _f.gr();case"STRING":{const e=function(e){let t=0;for(let n=0;n<e.length;n++){const s=e.codePointAt(n);if(void 0===s)return;if(s<=65535)if(s>=55296&&s<=57343)if(s<=56319){const s=e.codePointAt(n+1);void 0!==s&&s>=56320&&s<=57343?(t+=1,n++):t+=1}else t+=1;else t+=1;else{if(!(s<=1114111))return;t+=1,n++}}return t}(n.value.stringValue);return void 0===e?_f.mr():_f.newValue({integerValue:e})}default:return _f.mr()}}}class EC{constructor(e){this.expr=e}evaluate(e,t){Yc(1===this.expr.params.length,8486);const n=If(this.expr.params[0]).evaluate(e,t);switch(n.type){case"BYTES":{const e=n.value?.bytesValue;return"string"==typeof e?_f.newValue({integerValue:Ll.fromBase64String(e).toUint8Array().length}):_f.newValue({integerValue:new Uint8Array(e).length})}case"STRING":{const e=function(e){let t=0;for(let n=0;n<e.length;n++){const s=e.codePointAt(n);if(void 0===s)return;if(s>=55296&&s<=57343){if(!(s<=56319))return;{const s=e.codePointAt(n+1);if(void 0===s||!(s>=56320&&s<=57343))return;t+=4,n++}}else if(s<=127)t+=1;else if(s<=2047)t+=2;else if(s<=65535)t+=3;else{if(!(s<=1114111))return;t+=4,n++}}return t}(n.value?.stringValue);return void 0===e?_f.mr():_f.newValue({integerValue:e})}case"NULL":return _f.gr();default:return _f.mr()}}}class yC{constructor(e){this.expr=e}evaluate(e,t){Yc(2===this.expr.params.length,39773,`${this.expr.name}() function should have exactly two parameters`);let n=!1;const s=If(this.expr.params[0]).evaluate(e,t);switch(s.type){case"STRING":break;case"NULL":n=!0;break;default:return _f.mr()}const r=If(this.expr.params[1]).evaluate(e,t);switch(r.type){case"STRING":break;case"NULL":n=!0;break;default:return _f.mr()}return n?_f.gr():this.Or(s.value?.stringValue,r.value?.stringValue)}}class DC extends yC{Or(e,t){try{const n=function(e){let t="";for(let n=0;n<e.length;n++){const s=e.charAt(n);switch(s){case"_":t+=".";break;case"%":t+=".*";break;case"\\":case".":case"*":case"?":case"+":case"^":case"$":case"|":case"(":case")":case"[":case"]":case"{":case"}":t+="\\"+s;break;default:t+=s}}return"^"+t+"$"}(t),s=Hc.compile(n);return _f.newValue({booleanValue:s.matches(e)})}catch(e){return zc(`Invalid LIKE pattern converted to regex: ${t}, returning error. Error: ${e}`),_f.mr()}}}class _C extends yC{Or(e,t){try{const n=Hc.compile(t);return _f.newValue({booleanValue:n.test(e)})}catch(e){return zc(`Invalid regex pattern found in regex_contains: ${t}, returning error`),_f.mr()}}}class bC extends yC{Or(e,t){try{return _f.newValue({booleanValue:Hc.compile(t).matches(e)})}catch(e){return zc(`Invalid regex pattern found in regex_match: ${t}, returning error`),_f.mr()}}}class vC extends yC{Or(e,t){return _f.newValue({booleanValue:e.includes(t)})}}class IC extends yC{Or(e,t){return _f.newValue({booleanValue:e.startsWith(t)})}}class TC extends yC{Or(e,t){return _f.newValue({booleanValue:e.endsWith(t)})}}class OC{constructor(e){this.expr=e}evaluate(e,t){Yc(1===this.expr.params.length,29079);const n=If(this.expr.params[0]).evaluate(e,t);switch(n.type){case"STRING":return _f.newValue({stringValue:n.value?.stringValue?.toLowerCase()});case"NULL":return _f.gr();default:return _f.mr()}}}class AC{constructor(e){this.expr=e}evaluate(e,t){Yc(1===this.expr.params.length,60487);const n=If(this.expr.params[0]).evaluate(e,t);switch(n.type){case"STRING":return _f.newValue({stringValue:n.value?.stringValue?.toUpperCase()});case"NULL":return _f.gr();default:return _f.mr()}}}class SC{constructor(e){this.expr=e}evaluate(e,t){Yc(1===this.expr.params.length,28544);const n=If(this.expr.params[0]).evaluate(e,t);switch(n.type){case"STRING":return _f.newValue({stringValue:n.value?.stringValue?.trim()});case"NULL":return _f.gr();default:return _f.mr()}}}class NC{constructor(e){this.expr=e}evaluate(e,t){const n=this.expr.params.map(n=>If(n).evaluate(e,t));let s="",r=!1;for(const e of n)switch(e.type){case"STRING":s+=e.value.stringValue;break;case"NULL":r=!0;break;default:return _f.mr()}return r?_f.gr():_f.newValue({stringValue:s})}}class RC{constructor(e){this.expr=e}evaluate(e,t){Yc(2===this.expr.params.length,4483);const n=If(this.expr.params[0]).evaluate(e,t);switch(n.type){case"UNSET":return _f.pr();case"MAP":break;default:return _f.mr()}const s=If(this.expr.params[1]).evaluate(e,t);if("STRING"!==s.type)return _f.mr();const r=n.value?.mapValue?.fields?.[s.value?.stringValue];return void 0===r?_f.pr():_f.newValue(r)}}class kC{constructor(e){this.expr=e}evaluate(e,t){Yc(2===this.expr.params.length,25231,`${this.expr.name}() function should have exactly 2 params`);let n=!1;const s=If(this.expr.params[0]).evaluate(e,t);switch(s.type){case"VECTOR":break;case"NULL":n=!0;break;default:return _f.mr()}const r=If(this.expr.params[1]).evaluate(e,t);switch(r.type){case"VECTOR":break;case"NULL":n=!0;break;default:return _f.mr()}if(n)return _f.gr();const i=_u(s.value),a=_u(r.value);if(void 0===i||void 0===a||i.values?.length!==a.values?.length)return _f.mr();const o=this.Mr(i,a);return void 0===o||isNaN(o)?_f.mr():_f.newValue({doubleValue:o})}}class LC extends kC{Mr(e,t){const n=e?.values??[],s=t?.values??[];if(0===n.length)return;let r=0,i=0,a=0;for(let e=0;e<n.length;e++){if(!gu(n[e])||!gu(s[e]))return;const t=Sf(n[e]),o=Sf(s[e]);r+=t*o,i+=t*t,a+=o*o}const o=Math.sqrt(i)*Math.sqrt(a);return 0!==o?1-Math.max(-1,Math.min(1,r/o)):void 0}}class xC extends kC{Mr(e,t){const n=e?.values??[],s=t?.values??[];if(0===n.length)return 0;let r=0;for(let e=0;e<n.length;e++){if(!gu(n[e])||!gu(s[e]))return;r+=Sf(n[e])*Sf(s[e])}return r}}class FC extends kC{Mr(e,t){const n=e?.values??[],s=t?.values??[];if(0===n.length)return 0;let r=0;for(let e=0;e<n.length;e++){if(!gu(n[e])||!gu(s[e]))return;const t=Sf(n[e]),i=Sf(s[e]);r+=Math.pow(t-i,2)}return Math.sqrt(r)}}class PC{constructor(e){this.expr=e}evaluate(e,t){Yc(1===this.expr.params.length,39044);const n=If(this.expr.params[0]).evaluate(e,t);switch(n.type){case"VECTOR":{const e=_u(n.value);return _f.newValue({integerValue:e?.values?.length??0})}case"NULL":return _f.gr();default:return _f.mr()}}}const MC=BigInt(-62135596800),GC=BigInt(253402300799),UC=BigInt(1e3),HC=BigInt(1e6),VC=MC*UC,jC=GC*UC+BigInt(999),$C=MC*HC,JC=GC*HC+BigInt(999999);function qC(e){return e>=$C&&e<=JC}function zC(e){return e>=MC&&e<=GC}function KC(e,t){const n=BigInt(e);return!(n<MC||n>GC||t<0||t>=1e9||n===MC&&0!==t||n===GC&&t>999999999)}function QC(e,t){return t<0?{seconds:e-1,nanos:t+1e9}:{seconds:e,nanos:t}}function WC(e){return BigInt(e.seconds)*HC+BigInt(Math.trunc(e.nanoseconds/1e3))}class YC{constructor(e){this.expr=e}evaluate(e,t){Yc(1===this.expr.params.length,49262,`${this.expr.name}() function should have exactly one parameter`);const n=If(this.expr.params[0]).evaluate(e,t);switch(n.type){case"INT":return this.toTimestamp(BigInt(n.value.integerValue));case"NULL":return _f.gr();default:return _f.mr()}}}class XC extends YC{toTimestamp(e){if(!qC(e))return _f.mr();let t=Number(e/HC),n=Number(e%HC*BigInt(1e3));const s=QC(t,n);return t=s.seconds,n=s.nanos,KC(t,n)?_f.newValue({timestampValue:{seconds:t,nanos:n}}):_f.mr()}}class ZC extends YC{toTimestamp(e){if(!function(e){return e>=VC&&e<=jC}(e))return _f.mr();let t=Number(e/UC),n=Number(e%UC*BigInt(1e6));const s=QC(t,n);return t=s.seconds,n=s.nanos,KC(t,n)?_f.newValue({timestampValue:{seconds:t,nanos:n}}):_f.mr()}}class eg extends YC{toTimestamp(e){if(!zC(e))return _f.mr();const t=Number(e);return _f.newValue({timestampValue:{seconds:t,nanos:0}})}}class tg{constructor(e){this.expr=e}evaluate(e,t){Yc(1===this.expr.params.length,1265,`${this.expr.name}() function should have exactly one parameter`);const n=If(this.expr.params[0]).evaluate(e,t);switch(n.type){case"TIMESTAMP":break;case"NULL":return _f.gr();default:return _f.mr()}const s=up(n.value.timestampValue);return KC(s.seconds,s.nanoseconds)?this.Nr(s):_f.mr()}}class ng extends tg{Nr(e){const t=WC(e);return qC(t)?_f.newValue({integerValue:`${t.toString()}`}):_f.mr()}}class sg extends tg{Nr(e){const t=WC(e),n=t/BigInt(1e3),s=t%BigInt(1e3);return n>BigInt(0)||s===BigInt(0)?_f.newValue({integerValue:n.toString()}):_f.newValue({integerValue:(n-BigInt(1)).toString()})}}class rg extends tg{Nr(e){const t=BigInt(e.seconds);return zC(t)?_f.newValue({integerValue:t.toString()}):_f.mr()}}class ig{constructor(e){this.expr=e}evaluate(e,t){Yc(3===this.expr.params.length,2775,`${this.expr.name}() function should have exactly 3 parameters`);let n=!1;const s=If(this.expr.params[0]).evaluate(e,t);switch(s.type){case"TIMESTAMP":break;case"NULL":n=!0;break;default:return _f.mr()}const r=If(this.expr.params[1]).evaluate(e,t);let i;switch(r.type){case"STRING":if(i=function(e){switch(e){case"microsecond":return"microsecond";case"millisecond":return"millisecond";case"second":return"second";case"minute":return"minute";case"hour":return"hour";case"day":return"day";default:return}}(r.value.stringValue),void 0===i)return _f.mr();break;case"NULL":n=!0;break;default:return _f.mr()}const a=If(this.expr.params[2]).evaluate(e,t);switch(a.type){case"INT":break;case"NULL":n=!0;break;default:return _f.mr()}if(n)return _f.gr();const o=BigInt(a.value.integerValue);let B;try{switch(i){case"microsecond":B=o;break;case"millisecond":B=o*BigInt(1e3);break;case"second":B=o*BigInt(1e6);break;case"minute":B=o*BigInt(6e7);break;case"hour":B=o*BigInt(36e8);break;case"day":B=o*BigInt(864e8);break;default:return _f.mr()}if("microsecond"!==i&&o!==BigInt(0)&&B/o!==BigInt(this.Lr(i)))return _f.mr()}catch(e){return zc(`Error during timestamp arithmetic: ${e}`),_f.mr()}const c=up(s.value.timestampValue);if(!KC(c.seconds,c.nanoseconds))return _f.mr();const l=WC(c),u=this.Br(l,B);if(!qC(u))return _f.mr();const h=Number(u/HC),p=u%HC,d=Number((p<0?p+HC:p)*BigInt(1e3)),f=p<0?h-1:h;return KC(f,d)?_f.newValue({timestampValue:{seconds:f,nanos:d}}):_f.mr()}Lr(e){switch(e){case"millisecond":return 1e3;case"second":return 1e6;case"minute":return 6e7;case"hour":return 36e8;case"day":return 864e8;default:return 1}}}class ag extends ig{Br(e,t){return e+t}}class og extends ig{Br(e,t){return e-t}}function Bg(e){if((e=vf(e))instanceof qd)return`fld(${e.fieldName})`;if(e instanceof zd)return`cst(${function(e){return null===e?"null":"number"==typeof e?e.toString():"string"==typeof e?`"${e}"`:e instanceof Td?`ref(${e.path})`:e instanceof Sd?`vec(${JSON.stringify(e)})`:JSON.stringify(e)}(e.value)})`;if(e instanceof Wd)return`fn(${e.name},[${e.params.map(Bg).join(",")}])`;if("ListOfExpressions"===e.expressionType)return`list([${e.cr.map(Bg).join(",")}])`;throw new Error(`Unrecognized expr ${JSON.stringify(e,null,2)}`)}function cg(e){return`${Array.from(e.entries()).sort().map(([e,t])=>`${e}=${Bg(t)}`).join(",")}`}function lg(e){return e.stages.map(e=>function(e){if(e instanceof sf)return`${e._name}(${cg(e.fields)})`;if(e instanceof rf){let t=`${e._name}(${cg(e.accumulators)})`;return e.groups.size>0&&(t+=`grouping(${cg(e.groups)})`),t}if(e instanceof af)return`${e._name}(${cg(e.groups)})`;if(e instanceof of)return`${e._name}(${e.hr})`;if(e instanceof Bf)return`${e._name}(${e.collectionId})`;if(e instanceof cf)return`${e._name}()`;if(e instanceof lf)return`${e._name}(${e.Tr.sort()})`;if(e instanceof uf)return`${e._name}(${Bg(e.condition)})`;if(e instanceof hf)return`${e._name}(${e.limit})`;if(e instanceof ff)return`${e._name}(${function(e){return e.map(e=>`${Bg(e.expr)}${e.direction}`).join(",")}(e.orderings)})`;throw new Error(`Unrecognized stage ${e._name}`)}(e)).join("|")}function ug(e,t){return lg(e)===lg(t)}function hg(e){return e instanceof mf}function pg(e){return hg(e)?lg(e):jh(e)}function dg(e){return hg(e)?lg(e):function(e){return`${Fh(Hh(e))}|lt:${e.limitType}`}(e)}function fg(e,t){return e instanceof mf&&t instanceof mf?ug(e,t):!(e instanceof mf&&!(t instanceof mf)||!(e instanceof mf)&&t instanceof mf)&&function(e,t){return Ph(Hh(e),Hh(t))&&e.limitType===t.limitType}(e,t)}function Cg(e){return function(e){return!!e.isCorePipeline}(e)?lg(e):Fh(e)}function gg(e,t){return e instanceof mf&&t instanceof mf?ug(e,t):!(e instanceof mf&&!(t instanceof mf)||!(e instanceof mf)&&t instanceof mf)&&Ph(e,t)}class mg{constructor(e,t,n,s){this.batchId=e,this.localWriteTime=t,this.baseMutations=n,this.mutations=s}applyToRemoteDocument(e,t){const n=t.mutationResults;for(let t=0;t<this.mutations.length;t++){const s=this.mutations[t];s.key.isEqual(e.key)&&Yu(s,e,n[t])}}applyToLocalView(e,t){for(const n of this.baseMutations)n.key.isEqual(e.key)&&(t=Xu(n,e,t,this.localWriteTime));for(const n of this.mutations)n.key.isEqual(e.key)&&(t=Xu(n,e,t,this.localWriteTime));return t}applyToLocalDocumentSet(e,t){const n=sp();return this.mutations.forEach(s=>{const r=e.get(s.key),i=r.overlayedDocument;let a=this.applyToLocalView(i,r.mutatedFields);a=t.has(s.key)?null:a;const o=Wu(i,a);null!==o&&n.set(s.key,o),i.isValidDocument()||i.convertToNoDocument(Ah.min())}),n}keys(){return this.mutations.reduce((e,t)=>e.add(t.key),op())}isEqual(e){return this.batchId===e.batchId&&al(this.mutations,e.mutations,(e,t)=>eh(e,t))&&al(this.baseMutations,e.baseMutations,(e,t)=>eh(e,t))}}class wg{constructor(e,t,n,s){this.batch=e,this.commitVersion=t,this.mutationResults=n,this.docVersions=s}static from(e,t,n){Yc(e.mutations.length===n.length,58842,{Ur:e.mutations.length,kr:n.length});let s=ip;const r=e.mutations;for(let e=0;e<r.length;e++)s=s.insert(r[e].key,n[e].version);return new wg(e,t,n,s)}}function Eg(e,t){let n=t;const s=e.length;for(let t=0;t<s;t++){const s=e.charAt(t);switch(s){case"\0":n+="";break;case"":n+="";break;default:n+=s}}return n}function yg(e){return e+""}class Dg{constructor(e,t){this.largestBatchId=e,this.mutation=t}getKey(){return this.mutation.key}isEqual(e){return null!==e&&this.mutation===e.mutation}toString(){return`Overlay{\n largestBatchId: ${this.largestBatchId},\n mutation: ${this.mutation.toString()}\n }`}}class _g{constructor(e){this.$r=e}}function bg(e){const t=Ep({parent:e.parent,structuredQuery:e.structuredQuery});return"LAST"===e.limitType?Vh(t,t.limit,"L"):t}class vg{constructor(){this.Zi=new Ig}addToCollectionParentIndex(e,t){return this.Zi.add(t),dd.resolve()}getCollectionParents(e,t){return dd.resolve(this.Zi.getEntries(t))}addFieldIndex(e,t){return dd.resolve()}deleteFieldIndex(e,t){return dd.resolve()}deleteAllFieldIndexes(e){return dd.resolve()}createTargetIndexes(e,t){return dd.resolve()}getDocumentsMatchingTarget(e,t){return dd.resolve(null)}getIndexType(e,t){return dd.resolve(0)}getFieldIndexes(e,t){return dd.resolve([])}getNextCollectionGroupToUpdate(e){return dd.resolve(null)}getMinOffset(e,t){return dd.resolve(Rh.min())}getMinOffsetFromCollectionGroup(e,t){return dd.resolve(Rh.min())}updateCollectionGroup(e,t,n){return dd.resolve()}updateIndexEntries(e,t){return dd.resolve()}}class Ig{constructor(){this.index={}}add(e){const t=e.lastSegment(),n=e.popLast(),s=this.index[t]||new ll(Cl.comparator),r=!s.has(n);return this.index[t]=s.add(n),r}has(e){const t=e.lastSegment(),n=e.popLast(),s=this.index[t];return s&&s.has(n)}getEntries(e){return(this.index[e]||new ll(Cl.comparator)).toArray()}}class Tg{constructor(e){this.ys=e}next(){return this.ys+=2,this.ys}static ws(){return new Tg(0)}static bs(){return new Tg(-1)}}function Og(e,t){return function(e,t){let n=t;for(const t of e.stages)n=Ag({serializer:e.serializer,serverTimestampBehavior:e.listenOptions?.serverTimestampBehavior},t,n);return n}(e,[t]).length>0}function Ag(e,t,n){if(t instanceof of)return function(e,t,n){return n.filter(e=>e.isFoundDocument()&&`/${e.key.getCollectionPath().canonicalString()}`===t.hr)}(0,t,n);if(t instanceof uf)return function(e,t,n){return n.filter(n=>{const s=bf(If(t.condition).evaluate(e,n));return void 0!==s&&ou(s,ru)})}(e,t,n);if(t instanceof Bf)return function(e,t,n){return n.filter(e=>e.isFoundDocument()&&e.key.getCollectionPath().lastSegment()===t.collectionId)}(0,t,n);if(t instanceof cf)return function(e,t,n){return n.filter(e=>e.isFoundDocument())}(0,0,n);if(t instanceof lf)return function(e,t,n){return n.filter(e=>e.isFoundDocument()&&t.Pr.has(e.key.path.toStringWithLeadingSlash()))}(0,t,n);if(t instanceof hf)return function(e,t,n){return n.slice(0,t.limit)}(0,t,n);if(t instanceof ff)return function(e,t,n){const s=t.orderings.map(e=>({Ms:If(e.expr),direction:e.direction}));return[...n].sort((t,n)=>{for(const{Ms:r,direction:i}of s){const s=bf(r.evaluate(e,t)),a=bf(r.evaluate(e,n)),o=cu(s??su,a??su);if(0!==o)return"ascending"===i?o:-o}return 0})}(e,t,n);throw new Error(`Unknown stage: ${t._name}`)}class Sg{constructor(){this.changes=new Wh(e=>e.toString(),(e,t)=>e.isEqual(t)),this.changesApplied=!1}addEntry(e){this.assertNotApplied(),this.changes.set(e.key,e)}removeEntry(e,t){this.assertNotApplied(),this.changes.set(e,Sh.newInvalidDocument(e).setReadTime(t))}getEntry(e,t){this.assertNotApplied();const n=this.changes.get(t);return void 0!==n?dd.resolve(n):this.getFromCache(e,t)}getEntries(e,t){return this.getAllFromCache(e,t)}apply(e){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(e)}assertNotApplied(){}}class Ng{constructor(e,t){this.overlayedDocument=e,this.mutatedFields=t}}class Rg{constructor(e,t,n,s){this.remoteDocumentCache=e,this.mutationQueue=t,this.documentOverlayCache=n,this.indexManager=s}getDocument(e,t){let n=null;return this.documentOverlayCache.getOverlay(e,t).next(s=>(n=s,this.remoteDocumentCache.getEntry(e,t))).next(e=>(null!==n&&Xu(n.mutation,e,wl.empty(),Rl.now()),e))}getDocuments(e,t){return this.remoteDocumentCache.getEntries(e,t).next(t=>this.getLocalViewOfDocuments(e,t,op()).next(()=>t))}getLocalViewOfDocuments(e,t,n=op()){const s=np();return this.populateOverlays(e,s,t).next(()=>this.computeViews(e,t,s,n).next(e=>{let t=ep();return e.forEach((e,n)=>{t=t.insert(e,n.overlayedDocument)}),t}))}getOverlayedDocuments(e,t){const n=np();return this.populateOverlays(e,n,t).next(()=>this.computeViews(e,t,n,op()))}populateOverlays(e,t,n){const s=[];return n.forEach(e=>{t.has(e)||s.push(e)}),this.documentOverlayCache.getOverlays(e,s).next(e=>{e.forEach((e,n)=>{t.set(e,n)})})}computeViews(e,t,n,s){let r=Xh();const i=rp(),a=rp();return t.forEach((e,t)=>{const a=n.get(t.key);s.has(t.key)&&(void 0===a||a.mutation instanceof nh)?r=r.insert(t.key,t):void 0!==a?(i.set(t.key,a.mutation.getFieldMask()),Xu(a.mutation,t,a.mutation.getFieldMask(),Rl.now())):i.set(t.key,wl.empty())}),this.recalculateAndSaveOverlays(e,r).next(e=>(e.forEach((e,t)=>i.set(e,t)),t.forEach((e,t)=>a.set(e,new Ng(t,i.get(e)??null))),a))}recalculateAndSaveOverlays(e,t){const n=rp();let s=new ol((e,t)=>e-t),r=op();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,t).next(e=>{for(const r of e)r.keys().forEach(e=>{const i=t.get(e);if(null===i)return;let a=n.get(e)||wl.empty();a=r.applyToLocalView(i,a),n.set(e,a);const o=(s.get(r.batchId)||op()).add(e);s=s.insert(r.batchId,o)})}).next(()=>{const i=[],a=s.getReverseIterator();for(;a.hasNext();){const s=a.getNext(),o=s.key,B=s.value,c=sp();B.forEach(e=>{if(!r.has(e)){const s=Wu(t.get(e),n.get(e));null!==s&&c.set(e,s),r=r.add(e)}}),i.push(this.documentOverlayCache.saveOverlays(e,o,c))}return dd.waitFor(i)}).next(()=>n)}recalculateAndSaveOverlaysForDocumentKeys(e,t){return this.remoteDocumentCache.getEntries(e,t).next(t=>this.recalculateAndSaveOverlays(e,t))}getDocumentsMatchingQuery(e,t,n,s){return hg(t)?this.getDocumentsMatchingPipeline(e,t,n,s):function(e){return _l.isDocumentKey(e.path)&&null===e.collectionGroup&&0===e.filters.length}(t)?this.getDocumentsMatchingDocumentQuery(e,t.path):function(e){return null!==e.collectionGroup}(t)?this.getDocumentsMatchingCollectionGroupQuery(e,t,n,s):this.getDocumentsMatchingCollectionQuery(e,t,n,s)}getNextDocuments(e,t,n,s){return this.remoteDocumentCache.getAllFromCollectionGroup(e,t,n,s).next(r=>{const i=s-r.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(e,t,n.largestBatchId,s-r.size):dd.resolve(np());let a=-1,o=r;return i.next(t=>dd.forEach(t,(t,n)=>(a<n.largestBatchId&&(a=n.largestBatchId),r.get(t)?dd.resolve():this.remoteDocumentCache.getEntry(e,t).next(e=>{o=o.insert(t,e)}))).next(()=>this.populateOverlays(e,t,r)).next(()=>this.computeViews(e,o,t,op())).next(e=>({batchId:a,changes:tp(e)})))})}getDocumentsMatchingDocumentQuery(e,t){return this.getDocument(e,new _l(t)).next(e=>{let t=ep();return e.isFoundDocument()&&(t=t.insert(e.key,e)),t})}getDocumentsMatchingCollectionGroupQuery(e,t,n,s){const r=t.collectionGroup;let i=ep();return this.indexManager.getCollectionParents(e,r).next(a=>dd.forEach(a,a=>{const o=function(e,t){return new Mh(t,null,e.explicitOrderBy.slice(),e.filters.slice(),e.limit,e.limitType,e.startAt,e.endAt)}(t,a.child(r));return this.getDocumentsMatchingCollectionQuery(e,o,n,s).next(e=>{e.forEach((e,t)=>{i=i.insert(e,t)})})}).next(()=>i))}getDocumentsMatchingCollectionQuery(e,t,n,s){let r;return this.documentOverlayCache.getOverlaysForCollection(e,t.path,n.largestBatchId).next(i=>(r=i,this.remoteDocumentCache.getDocumentsMatchingQuery(e,t,n,r,s))).next(e=>this.retrieveMatchingLocalDocuments(r,e,e=>$h(t,e)))}getDocumentsMatchingPipeline(e,t,n,s){if("collection_group"===wf(t)){const r=yf(t);let i=ep();return this.indexManager.getCollectionParents(e,r).next(a=>dd.forEach(a,a=>{const o=function(e,t){const n=e.stages.map(e=>e instanceof Bf?new of(t.canonicalString(),{}):e);return new mf(e.serializer,n)}(t,a.child(r));return this.getDocumentsMatchingPipeline(e,o,n,s).next(e=>{e.forEach((e,t)=>{i=i.insert(e,t)})})}).next(()=>i))}{let r;return this.getOverlaysForPipeline(e,t,n.largestBatchId).next(i=>{switch(r=i,wf(t)){case"collection":return this.remoteDocumentCache.getDocumentsMatchingQuery(e,t,n,r,s);case"documents":let i=op();for(const e of Df(t))i=i.add(_l.fromPath(e));return this.remoteDocumentCache.getEntries(e,i);case"database":return this.remoteDocumentCache.getAllEntries(e);default:throw new pl("invalid-argument",`Invalid pipeline source to execute offline: ${lg(t)}`)}}).next(e=>this.retrieveMatchingLocalDocuments(r,e,e=>Og(t,e)))}}retrieveMatchingLocalDocuments(e,t,n){e.forEach((e,n)=>{const s=n.getKey();null===t.get(s)&&(t=t.insert(s,Sh.newInvalidDocument(s)))});let s=ep();return t.forEach((t,r)=>{const i=e.get(t);void 0!==i&&Xu(i.mutation,r,wl.empty(),Rl.now()),n(r)&&(s=s.insert(t,r))}),s}getOverlaysForPipeline(e,t,n){switch(wf(t)){case"collection":return this.documentOverlayCache.getOverlaysForCollection(e,Cl.fromString(Ef(t)),n);case"collection_group":throw new pl("invalid-argument",`Unexpected collection group pipeline: ${lg(t)}`);case"documents":return this.documentOverlayCache.getOverlays(e,Df(t).map(e=>_l.fromPath(e)));case"database":return this.documentOverlayCache.getAllOverlays(e,n);default:throw new pl("invalid-argument",`Failed to get overlays for pipeline: ${lg(t)}`)}}}class kg{constructor(e){this.serializer=e,this.Qs=new Map,this.Ws=new Map}getBundleMetadata(e,t){return dd.resolve(this.Qs.get(t))}saveBundleMetadata(e,t){return this.Qs.set(t.id,function(e){return{id:e.id,version:e.version,createTime:dp(e.createTime)}}(t)),dd.resolve()}getNamedQuery(e,t){return dd.resolve(this.Ws.get(t))}saveNamedQuery(e,t){return this.Ws.set(t.name,function(e){return{name:e.name,query:bg(e.bundledQuery),readTime:dp(e.readTime)}}(t)),dd.resolve()}}class Lg{constructor(){this.overlays=new ol(_l.comparator),this.Gs=new Map}getOverlay(e,t){return dd.resolve(this.overlays.get(t))}getOverlays(e,t){const n=np();return dd.forEach(t,t=>this.getOverlay(e,t).next(e=>{null!==e&&n.set(t,e)})).next(()=>n)}getAllOverlays(e,t){const n=np();return this.overlays.forEach((e,s)=>{s.largestBatchId>t&&n.set(e,s)}),dd.resolve(n)}saveOverlays(e,t,n){return n.forEach((n,s)=>{this.Zr(e,t,s)}),dd.resolve()}removeOverlaysForBatchId(e,t,n){const s=this.Gs.get(n);return void 0!==s&&(s.forEach(e=>this.overlays=this.overlays.remove(e)),this.Gs.delete(n)),dd.resolve()}getOverlaysForCollection(e,t,n){const s=np(),r=t.length+1,i=new _l(t.child("")),a=this.overlays.getIteratorFrom(i);for(;a.hasNext();){const e=a.getNext().value,i=e.getKey();if(!t.isPrefixOf(i.path))break;i.path.length===r&&e.largestBatchId>n&&s.set(e.getKey(),e)}return dd.resolve(s)}getOverlaysForCollectionGroup(e,t,n,s){let r=new ol((e,t)=>e-t);const i=this.overlays.getIterator();for(;i.hasNext();){const e=i.getNext().value;if(e.getKey().getCollectionGroup()===t&&e.largestBatchId>n){let t=r.get(e.largestBatchId);null===t&&(t=np(),r=r.insert(e.largestBatchId,t)),t.set(e.getKey(),e)}}const a=np(),o=r.getIterator();for(;o.hasNext()&&(o.getNext().value.forEach((e,t)=>a.set(e,t)),!(a.size()>=s)););return dd.resolve(a)}Zr(e,t,n){const s=this.overlays.get(n.key);if(null!==s){const e=this.Gs.get(s.largestBatchId).delete(n.key);this.Gs.set(s.largestBatchId,e)}this.overlays=this.overlays.insert(n.key,new Dg(t,n));let r=this.Gs.get(t);void 0===r&&(r=op(),this.Gs.set(t,r)),this.Gs.set(t,r.add(n.key))}}class xg{constructor(){this.sessionToken=Ll.EMPTY_BYTE_STRING}getSessionToken(e){return dd.resolve(this.sessionToken)}setSessionToken(e,t){return this.sessionToken=t,dd.resolve()}}class Fg{constructor(){this.zs=new ll(Pg.js),this.Hs=new ll(Pg.Js)}isEmpty(){return this.zs.isEmpty()}addReference(e,t){const n=new Pg(e,t);this.zs=this.zs.add(n),this.Hs=this.Hs.add(n)}Ys(e,t){e.forEach(e=>this.addReference(e,t))}removeReference(e,t){this.Zs(new Pg(e,t))}Xs(e,t){e.forEach(e=>this.removeReference(e,t))}e_(e){const t=new _l(new Cl([])),n=new Pg(t,e),s=new Pg(t,e+1),r=[];return this.Hs.forEachInRange([n,s],e=>{this.Zs(e),r.push(e.key)}),r}t_(){this.zs.forEach(e=>this.Zs(e))}Zs(e){this.zs=this.zs.delete(e),this.Hs=this.Hs.delete(e)}n_(e){const t=new _l(new Cl([])),n=new Pg(t,e),s=new Pg(t,e+1);let r=op();return this.Hs.forEachInRange([n,s],e=>{r=r.add(e.key)}),r}containsKey(e){const t=new Pg(e,0),n=this.zs.firstAfterOrEqual(t);return null!==n&&e.isEqual(n.key)}}class Pg{constructor(e,t){this.key=e,this.r_=t}static js(e,t){return _l.comparator(e.key,t.key)||tl(e.r_,t.r_)}static Js(e,t){return tl(e.r_,t.r_)||_l.comparator(e.key,t.key)}}class Mg{constructor(e,t){this.indexManager=e,this.referenceDelegate=t,this.mutationQueue=[],this.Gr=1,this.i_=new ll(Pg.js)}checkEmpty(e){return dd.resolve(0===this.mutationQueue.length)}addMutationBatch(e,t,n,s){const r=this.Gr;this.Gr++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];const i=new mg(r,t,n,s);this.mutationQueue.push(i);for(const t of s)this.i_=this.i_.add(new Pg(t.key,r)),this.indexManager.addToCollectionParentIndex(e,t.key.path.popLast());return dd.resolve(i)}lookupMutationBatch(e,t){return dd.resolve(this.s_(t))}getNextMutationBatchAfterBatchId(e,t){const n=t+1,s=this.__(n),r=s<0?0:s;return dd.resolve(this.mutationQueue.length>r?this.mutationQueue[r]:null)}getHighestUnacknowledgedBatchId(){return dd.resolve(0===this.mutationQueue.length?-1:this.Gr-1)}getAllMutationBatches(e){return dd.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(e,t){const n=new Pg(t,0),s=new Pg(t,Number.POSITIVE_INFINITY),r=[];return this.i_.forEachInRange([n,s],e=>{const t=this.s_(e.r_);r.push(t)}),dd.resolve(r)}getAllMutationBatchesAffectingDocumentKeys(e,t){let n=new ll(tl);return t.forEach(e=>{const t=new Pg(e,0),s=new Pg(e,Number.POSITIVE_INFINITY);this.i_.forEachInRange([t,s],e=>{n=n.add(e.r_)})}),dd.resolve(this.o_(n))}getAllMutationBatchesAffectingQuery(e,t){const n=t.path,s=n.length+1;let r=n;_l.isDocumentKey(r)||(r=r.child(""));const i=new Pg(new _l(r),0);let a=new ll(tl);return this.i_.forEachWhile(e=>{const t=e.key.path;return!!n.isPrefixOf(t)&&(t.length===s&&(a=a.add(e.r_)),!0)},i),dd.resolve(this.o_(a))}o_(e){const t=[];return e.forEach(e=>{const n=this.s_(e);null!==n&&t.push(n)}),t}removeMutationBatch(e,t){Yc(0===this.a_(t.batchId,"removed"),55003),this.mutationQueue.shift();let n=this.i_;return dd.forEach(t.mutations,s=>{const r=new Pg(s.key,t.batchId);return n=n.delete(r),this.referenceDelegate.markPotentiallyOrphaned(e,s.key)}).next(()=>{this.i_=n})}Hr(e){}containsKey(e,t){const n=new Pg(t,0),s=this.i_.firstAfterOrEqual(n);return dd.resolve(t.isEqual(s&&s.key))}performConsistencyCheck(e){return this.mutationQueue.length,dd.resolve()}a_(e,t){return this.__(e)}__(e){return 0===this.mutationQueue.length?0:e-this.mutationQueue[0].batchId}s_(e){const t=this.__(e);return t<0||t>=this.mutationQueue.length?null:this.mutationQueue[t]}}class Gg{constructor(e){this.u_=e,this.docs=new ol(_l.comparator),this.size=0}setIndexManager(e){this.indexManager=e}addEntry(e,t){const n=t.key,s=this.docs.get(n),r=s?s.size:0,i=this.u_(t);return this.docs=this.docs.insert(n,{document:t.mutableCopy(),size:i}),this.size+=i-r,this.indexManager.addToCollectionParentIndex(e,n.path.popLast())}removeEntry(e){const t=this.docs.get(e);t&&(this.docs=this.docs.remove(e),this.size-=t.size)}getEntry(e,t){const n=this.docs.get(t);return dd.resolve(n?n.document.mutableCopy():Sh.newInvalidDocument(t))}getEntries(e,t){let n=Xh();return t.forEach(e=>{const t=this.docs.get(e);n=n.insert(e,t?t.document.mutableCopy():Sh.newInvalidDocument(e))}),dd.resolve(n)}getAllEntries(e){let t=Xh();return this.docs.forEach((e,n)=>{t=t.insert(e,n.document)}),dd.resolve(t)}getDocumentsMatchingQuery(e,t,n,s){let r,i;hg(t)?(r=Cl.fromString(Ef(t)),i=e=>Og(t,e)):(r=t.path,i=e=>$h(t,e));let a=Xh();const o=new _l(r.child("__id-9223372036854775808__")),B=this.docs.getIteratorFrom(o);for(;B.hasNext();){const{key:e,value:{document:t}}=B.getNext();if(!r.isPrefixOf(e.path))break;e.path.length>r.length+1||kh(Nh(t),n)<=0||(s.has(t.key)||i(t))&&(a=a.insert(t.key,t.mutableCopy()))}return dd.resolve(a)}getAllFromCollectionGroup(e,t,n,s){Qc(9500)}c_(e,t){return dd.forEach(this.docs,e=>t(e))}newChangeBuffer(e){return new Ug(this)}getSize(e){return dd.resolve(this.size)}}class Ug extends Sg{constructor(e){super(),this.$s=e}applyChanges(e){const t=[];return this.changes.forEach((n,s)=>{s.isValidDocument()?t.push(this.$s.addEntry(e,s)):this.$s.removeEntry(n)}),dd.waitFor(t)}getFromCache(e,t){return this.$s.getEntry(e,t)}getAllFromCache(e,t){return this.$s.getEntries(e,t)}}class Hg{constructor(e){this.persistence=e,this.l_=new Wh(e=>Cg(e),gg),this.lastRemoteSnapshotVersion=Ah.min(),this.highestTargetId=0,this.E_=0,this.h_=new Fg,this.targetCount=0,this.T_=Tg.ws()}forEachTarget(e,t){return this.l_.forEach((e,n)=>t(n)),dd.resolve()}getLastRemoteSnapshotVersion(e){return dd.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(e){return dd.resolve(this.E_)}allocateTargetId(e){return this.highestTargetId=this.T_.next(),dd.resolve(this.highestTargetId)}setTargetsMetadata(e,t,n){return n&&(this.lastRemoteSnapshotVersion=n),t>this.E_&&(this.E_=t),dd.resolve()}Ds(e){this.l_.set(e.target,e);const t=e.targetId;t>this.highestTargetId&&(this.T_=new Tg(t),this.highestTargetId=t),e.sequenceNumber>this.E_&&(this.E_=e.sequenceNumber)}addTargetData(e,t){return this.Ds(t),this.targetCount+=1,dd.resolve()}updateTargetData(e,t){return this.Ds(t),dd.resolve()}removeTargetData(e,t){return this.l_.delete(t.target),this.h_.e_(t.targetId),this.targetCount-=1,dd.resolve()}removeTargets(e,t,n){let s=0;const r=[];return this.l_.forEach((i,a)=>{a.sequenceNumber<=t&&null===n.get(a.targetId)&&(this.l_.delete(i),r.push(this.removeMatchingKeysForTargetId(e,a.targetId)),s++)}),dd.waitFor(r).next(()=>s)}getTargetCount(e){return dd.resolve(this.targetCount)}getTargetData(e,t){const n=this.l_.get(t)||null;return dd.resolve(n)}addMatchingKeys(e,t,n){return this.h_.Ys(t,n),dd.resolve()}removeMatchingKeys(e,t,n){this.h_.Xs(t,n);const s=this.persistence.referenceDelegate,r=[];return s&&t.forEach(t=>{r.push(s.markPotentiallyOrphaned(e,t))}),dd.waitFor(r)}removeMatchingKeysForTargetId(e,t){return this.h_.e_(t),dd.resolve()}getMatchingKeysForTargetId(e,t){const n=this.h_.n_(t);return dd.resolve(n)}containsKey(e,t){return dd.resolve(this.h_.containsKey(t))}}class Vg{constructor(e,t){this.P_={},this.overlays={},this.I_=new ud(0),this.R_=!1,this.R_=!0,this.A_=new xg,this.referenceDelegate=e(this),this.V_=new Hg(this),this.indexManager=new vg,this.remoteDocumentCache=function(e){return new Gg(e)}(e=>this.referenceDelegate.d_(e)),this.serializer=new _g(t),this.f_=new kg(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.R_=!1,Promise.resolve()}get started(){return this.R_}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(e){return this.indexManager}getDocumentOverlayCache(e){let t=this.overlays[e.toKey()];return t||(t=new Lg,this.overlays[e.toKey()]=t),t}getMutationQueue(e,t){let n=this.P_[e.toKey()];return n||(n=new Mg(t,this.referenceDelegate),this.P_[e.toKey()]=n),n}getGlobalsCache(){return this.A_}getTargetCache(){return this.V_}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.f_}runTransaction(e,t,n){Jc("MemoryPersistence","Starting transaction:",e);const s=new jg(this.I_.next());return this.referenceDelegate.m_(),n(s).next(e=>this.referenceDelegate.p_(s).next(()=>e)).toPromise().then(e=>(s.raiseOnCommittedEvent(),e))}g_(e,t){return dd.or(Object.values(this.P_).map(n=>()=>n.containsKey(e,t)))}}class jg extends hd{constructor(e){super(),this.currentSequenceNumber=e}}class $g{constructor(e){this.persistence=e,this.y_=new Fg,this.w_=null}static b_(e){return new $g(e)}get S_(){if(this.w_)return this.w_;throw Qc(60996)}addReference(e,t,n){return this.y_.addReference(n,t),this.S_.delete(n.toString()),dd.resolve()}removeReference(e,t,n){return this.y_.removeReference(n,t),this.S_.add(n.toString()),dd.resolve()}markPotentiallyOrphaned(e,t){return this.S_.add(t.toString()),dd.resolve()}removeTarget(e,t){this.y_.e_(t.targetId).forEach(e=>this.S_.add(e.toString()));const n=this.persistence.getTargetCache();return n.getMatchingKeysForTargetId(e,t.targetId).next(e=>{e.forEach(e=>this.S_.add(e.toString()))}).next(()=>n.removeTargetData(e,t))}m_(){this.w_=new Set}p_(e){const t=this.persistence.getRemoteDocumentCache().newChangeBuffer();return dd.forEach(this.S_,n=>{const s=_l.fromPath(n);return this.v_(e,s).next(e=>{e||t.removeEntry(s,Ah.min())})}).next(()=>(this.w_=null,t.apply(e)))}updateLimboDocument(e,t){return this.v_(e,t).next(e=>{e?this.S_.delete(t.toString()):this.S_.add(t.toString())})}d_(e){return 0}v_(e,t){return dd.or([()=>dd.resolve(this.y_.containsKey(t)),()=>this.persistence.getTargetCache().containsKey(e,t),()=>this.persistence.g_(e,t)])}}class Jg{constructor(e,t){this.persistence=e,this.D_=new Wh(e=>function(e){let t="";for(let n=0;n<e.length;n++)t.length>0&&(t=yg(t)),t=Eg(e.get(n),t);return yg(t)}(e.path),(e,t)=>e.isEqual(t)),this.garbageCollector=function(e,t){return new Ed(e,t)}(this,t)}static b_(e,t){return new Jg(e,t)}m_(){}p_(e){return dd.resolve()}forEachTarget(e,t){return this.persistence.getTargetCache().forEachTarget(e,t)}ir(e){const t=this.Cs(e);return this.persistence.getTargetCache().getTargetCount(e).next(e=>t.next(t=>e+t))}Cs(e){let t=0;return this.sr(e,e=>{t++}).next(()=>t)}sr(e,t){return dd.forEach(this.D_,(n,s)=>this.Os(e,n,s).next(e=>e?dd.resolve():t(s)))}removeTargets(e,t,n){return this.persistence.getTargetCache().removeTargets(e,t,n)}removeOrphanedDocuments(e,t){let n=0;const s=this.persistence.getRemoteDocumentCache(),r=s.newChangeBuffer();return s.c_(e,s=>this.Os(e,s,t).next(e=>{e||(n++,r.removeEntry(s,Ah.min()))})).next(()=>r.apply(e)).next(()=>n)}markPotentiallyOrphaned(e,t){return this.D_.set(t,e.currentSequenceNumber),dd.resolve()}removeTarget(e,t){const n=t.withSequenceNumber(e.currentSequenceNumber);return this.persistence.getTargetCache().updateTargetData(e,n)}addReference(e,t,n){return this.D_.set(n,e.currentSequenceNumber),dd.resolve()}removeReference(e,t,n){return this.D_.set(n,e.currentSequenceNumber),dd.resolve()}updateLimboDocument(e,t){return this.D_.set(t,e.currentSequenceNumber),dd.resolve()}d_(e){let t=e.key.toString().length;return e.isFoundDocument()&&(t+=du(e.data.value)),t}Os(e,t,n){return dd.or([()=>this.persistence.g_(e,t),()=>this.persistence.getTargetCache().containsKey(e,t),()=>{const e=this.D_.get(t);return dd.resolve(void 0!==e&&e>n)}])}getCacheSize(e){return this.persistence.getRemoteDocumentCache().getSize(e)}}class qg{constructor(e,t,n,s){this.targetId=e,this.fromCache=t,this.Vo=n,this.fo=s}static mo(e,t){let n=op(),s=op();for(const e of t.docChanges)switch(e.type){case 0:n=n.add(e.doc.key);break;case 1:s=s.add(e.doc.key)}return new qg(e,t.fromCache,n,s)}}function zg(e,t){return _l.comparator(e.key,t.key)}class Kg{constructor(){this._documentReadCount=0}get documentReadCount(){return this._documentReadCount}incrementDocumentReadCount(e){this._documentReadCount+=e}}class Qg{constructor(){this.po=!1,this.yo=!1,this.wo=100,this.bo=Mn()?8:function(e){const t=e.match(/Android ([\d.]+)/i),n=t?t[1].split(".").slice(0,2).join("."):"-1";return Number(n)}(Fn())>0?6:4}initialize(e,t){this.So=e,this.indexManager=t,this.po=!0}getDocumentsMatchingQuery(e,t,n,s){const r={result:null};return this.vo(e,t).next(e=>{r.result=e}).next(()=>{if(!r.result)return this.Do(e,t,s,n).next(e=>{r.result=e})}).next(()=>{if(r.result)return;const n=new Kg;return this.xo(e,t,n).next(s=>{if(r.result=s,this.yo)return this.Co(e,t,n,s.size)})}).next(()=>r.result)}Co(e,t,n,s){return hg(t)?dd.resolve():n.documentReadCount<this.wo?($c()<=is.DEBUG&&Jc("QueryEngine","SDK will not create cache indexes for query:",jh(t),"since it only creates cache indexes for collection contains","more than or equal to",this.wo,"documents"),dd.resolve()):($c()<=is.DEBUG&&Jc("QueryEngine","Query:",jh(t),"scans",n.documentReadCount,"local documents and returns",s,"documents as results."),n.documentReadCount>this.bo*s?($c()<=is.DEBUG&&Jc("QueryEngine","The SDK decides to create cache indexes for query:",jh(t),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(e,Hh(t))):dd.resolve())}vo(e,t){if(hg(t))return dd.resolve(null);let n=t;if(Gh(n))return dd.resolve(null);let s=Hh(n);return this.indexManager.getIndexType(e,s).next(t=>0===t?null:(null!==n.limit&&1===t&&(n=Vh(n,null,"F"),s=Hh(n)),this.indexManager.getDocumentsMatchingTarget(e,s).next(t=>{const r=op(...t);return this.So.getDocuments(e,r).next(t=>this.indexManager.getMinOffset(e,s).next(s=>{const i=this.Fo(n,t);return this.Oo(n,i,r,s.readTime)?this.vo(e,Vh(n,null,"F")):this.Mo(e,i,n,s)}))})))}Do(e,t,n,s){return(hg(t)?function(e){for(const t of e.stages){if(t instanceof hf||t instanceof pf)return!1;if(t instanceof uf){if(t.condition instanceof Xd&&"exists"===t.condition._expr.name&&t.condition._expr.params[0]instanceof qd&&t.condition._expr.params[0].fieldName===dl)continue;return!1}}return!0}(t):Gh(t))||s.isEqual(Ah.min())?dd.resolve(null):this.So.getDocuments(e,n).next(r=>{const i=this.Fo(t,r);return this.Oo(t,i,n,s)?dd.resolve(null):($c()<=is.DEBUG&&Jc("QueryEngine","Re-using previous result from %s to execute query: %s",s.toString(),pg(t)),this.Mo(e,i,t,function(e,t){const n=e.toTimestamp().seconds,s=e.toTimestamp().nanoseconds+1,r=Ah.fromTimestamp(1e9===s?new Rl(n+1,0):new Rl(n,s));return new Rh(r,_l.empty(),t)}(s,-1)).next(e=>e))})}Fo(e,t){let n,s;return hg(e)?(n=new ll(zg),s=t=>Og(e,t)):(n=new ll(Jh(e)),s=t=>$h(e,t)),t.forEach((e,t)=>{s(t)&&(n=n.add(t))}),n}Oo(e,t,n,s){if(hg(e))return function(e){return e.stages.some(e=>e instanceof hf||e instanceof pf)}(e);if(null===e.limit)return!1;if(n.size!==t.size)return!0;const r="F"===e.limitType?t.last():t.first();return!!r&&(r.hasPendingWrites||r.version.compareTo(s)>0)}xo(e,t,n){return $c()<=is.DEBUG&&Jc("QueryEngine","Using full collection scan to execute query:",pg(t)),this.So.getDocumentsMatchingQuery(e,t,Rh.min(),n)}Mo(e,t,n,s){return this.So.getDocumentsMatchingQuery(e,n,s).next(e=>(t.forEach(t=>{e=e.insert(t.key,t)}),e))}}class Wg{constructor(e,t,n,s){this.persistence=e,this.No=t,this.serializer=s,this.Lo=new ol(tl),this.Bo=new Wh(e=>Cg(e),gg),this.Uo=new Map,this.ko=e.getRemoteDocumentCache(),this.V_=e.getTargetCache(),this.f_=e.getBundleCache(),this.qo(n)}qo(e){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(e),this.indexManager=this.persistence.getIndexManager(e),this.mutationQueue=this.persistence.getMutationQueue(e,this.indexManager),this.localDocuments=new Rg(this.ko,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.ko.setIndexManager(this.indexManager),this.No.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",t=>e.collect(t,this.Lo))}}async function Yg(e,t){const n=Xc(e);return await n.persistence.runTransaction("Handle user change","readonly",e=>{let s;return n.mutationQueue.getAllMutationBatches(e).next(r=>(s=r,n.qo(t),n.mutationQueue.getAllMutationBatches(e))).next(t=>{const r=[],i=[];let a=op();for(const e of s){r.push(e.batchId);for(const t of e.mutations)a=a.add(t.key)}for(const e of t){i.push(e.batchId);for(const t of e.mutations)a=a.add(t.key)}return n.localDocuments.getDocuments(e,a).next(e=>({$o:e,removedBatchIds:r,addedBatchIds:i}))})})}function Xg(e,t){const n=Xc(e);return n.persistence.runTransaction("Get next mutation batch","readonly",e=>(void 0===t&&(t=-1),n.mutationQueue.getNextMutationBatchAfterBatchId(e,t)))}class Zg{constructor(e,t){this.asyncQueue=e,this.onlineStateHandler=t,this.state="Unknown",this.Yo=0,this.Zo=null,this.Xo=!0}ea(){0===this.Yo&&(this.ta("Unknown"),this.Zo=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,()=>(this.Zo=null,this.na("Backend didn't respond within 10 seconds."),this.ta("Offline"),Promise.resolve())))}ra(e){"Online"===this.state?this.ta("Unknown"):(this.Yo++,this.Yo>=1&&(this.ia(),this.na(`Connection failed 1 times. Most recent error: ${e.toString()}`),this.ta("Offline")))}set(e){this.ia(),this.Yo=0,"Online"===e&&(this.Xo=!1),this.ta(e)}ta(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))}na(e){const t=`Could not reach Cloud Firestore backend. ${e}\nThis 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.Xo?(qc(t),this.Xo=!1):Jc("OnlineStateTracker",t)}ia(){null!==this.Zo&&(this.Zo.cancel(),this.Zo=null)}}const em="RemoteStore";class tm{constructor(e,t,n,s,r){this.localStore=e,this.datastore=t,this.asyncQueue=n,this.remoteSyncer={},this.sa=[],this._a=new Map,this.oa=new Map,this.aa=new Map,this.ua=new Tg(1e3),this.ca=new Tg(1001),this.la=new Set,this.Ea=[],this.ha=r,this.ha.Qe(e=>{n.enqueueAndForget(async()=>{rm(this)&&(Jc(em,"Restarting streams for network reachability change."),await async function(e){const t=Xc(e);t.la.add(4),await sm(t),t.Ta.set("Unknown"),t.la.delete(4),await nm(t)}(this))})}),this.Ta=new Zg(n,s)}}async function nm(e){if(rm(e))for(const t of e.Ea)await t(!0)}async function sm(e){for(const t of e.Ea)await t(!1)}function rm(e){return 0===Xc(e).la.size}async function im(e,t,n){if(!fd(t))throw t;e.la.add(1),await sm(e),e.Ta.set("Offline"),n||(n=()=>function(e){const t=Xc(e);return t.persistence.runTransaction("Get last remote snapshot version","readonly",e=>t.V_.getLastRemoteSnapshotVersion(e))}(e.localStore)),e.asyncQueue.enqueueRetryable(async()=>{Jc(em,"Retrying IndexedDB access"),await n(),e.la.delete(1),await nm(e)})}function am(e,t){return t().catch(n=>im(e,n,t))}async function om(e){const t=Xc(e),n=gm(t);let s=t.sa.length>0?t.sa[t.sa.length-1].batchId:-1;for(;Bm(t);)try{const e=await Xg(t.localStore,s);if(null===e){0===t.sa.length&&n.en();break}s=e.batchId,cm(t,e)}catch(e){await im(t,e)}lm(t)&&um(t)}function Bm(e){return rm(e)&&e.sa.length<10}function cm(e,t){e.sa.push(t);const n=gm(e);n.Yt()&&n.Rn&&n.An(t.mutations)}function lm(e){return rm(e)&&!gm(e).Jt()&&e.sa.length>0}function um(e){gm(e).start()}async function hm(e){gm(e).fn()}async function pm(e){const t=gm(e);for(const n of e.sa)t.An(n.mutations)}async function dm(e,t,n){const s=e.sa.shift(),r=wg.from(s,t,n);await am(e,()=>e.remoteSyncer.applySuccessfulWrite(r)),await om(e)}async function fm(e,t){t&&gm(e).Rn&&await async function(e,t){if(function(e){return function(e){switch(e){case hl.OK:return Qc(64938);case hl.CANCELLED:case hl.UNKNOWN:case hl.DEADLINE_EXCEEDED:case hl.RESOURCE_EXHAUSTED:case hl.INTERNAL:case hl.UNAVAILABLE:case hl.UNAUTHENTICATED:return!1;case hl.INVALID_ARGUMENT:case hl.NOT_FOUND:case hl.ALREADY_EXISTS:case hl.PERMISSION_DENIED:case hl.FAILED_PRECONDITION:case hl.ABORTED:case hl.OUT_OF_RANGE:case hl.UNIMPLEMENTED:case hl.DATA_LOSS:return!0;default:return Qc(15467,{code:e})}}(e)&&e!==hl.ABORTED}(t.code)){const n=e.sa.shift();gm(e).Xt(),await am(e,()=>e.remoteSyncer.rejectFailedWrite(n.batchId,t)),await om(e)}}(e,t),lm(e)&&um(e)}async function Cm(e,t){const n=Xc(e);n.asyncQueue.verifyOperationInProgress(),Jc(em,"RemoteStore received new credentials");const s=rm(n);n.la.add(3),await sm(n),s&&n.Ta.set("Unknown"),await n.remoteSyncer.handleCredentialChange(t),n.la.delete(3),await nm(n)}function gm(e){return e.Ra||(e.Ra=function(e,t,n){const s=Xc(e);return s.pn(),new rd(t,s.connection,s.authCredentials,s.appCheckCredentials,s.serializer,n)}(e.datastore,e.asyncQueue,{ct:()=>Promise.resolve(),Et:hm.bind(null,e),Tt:fm.bind(null,e),Vn:pm.bind(null,e),dn:dm.bind(null,e)}),e.Ea.push(async t=>{t?(e.Ra.Xt(),await om(e)):(await e.Ra.stop(),e.sa.length>0&&(Jc(em,`Stopping write stream with ${e.sa.length} pending writes`),e.sa=[]))})),e.Ra}class mm{constructor(e,t,n,s,r){this.asyncQueue=e,this.timerId=t,this.targetTimeMs=n,this.op=s,this.removalCallback=r,this.deferred=new kp,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(e=>{})}get promise(){return this.deferred.promise}static createAndSchedule(e,t,n,s,r){const i=Date.now()+n,a=new mm(e,t,i,s,r);return a.start(n),a}start(e){this.timerHandle=setTimeout(()=>this.handleDelayElapsed(),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){null!==this.timerHandle&&(this.clearTimeout(),this.deferred.reject(new pl(hl.CANCELLED,"Operation cancelled"+(e?": "+e:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget(()=>null!==this.timerHandle?(this.clearTimeout(),this.op().then(e=>this.deferred.resolve(e))):Promise.resolve())}clearTimeout(){null!==this.timerHandle&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}}function wm(e,t){if(qc("AsyncQueue",`${t}: ${e}`),fd(e))return new pl(hl.UNAVAILABLE,`${t}: ${e}`);throw e}class Em{constructor(){this.activeTargetIds=Bp}Ba(e){this.activeTargetIds=this.activeTargetIds.add(e)}Ua(e){this.activeTargetIds=this.activeTargetIds.delete(e)}La(){const e={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(e)}}class ym{constructor(){this.fu=new Em,this.mu={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,t,n){}addLocalQueryTarget(e,t=!0){return t&&this.fu.Ba(e),this.mu[e]||"not-current"}updateQueryState(e,t,n){this.mu[e]=t}removeLocalQueryTarget(e){this.fu.Ua(e)}isLocalQueryTarget(e){return this.fu.activeTargetIds.has(e)}clearQueryState(e){delete this.mu[e]}getAllActiveQueryTargets(){return this.fu.activeTargetIds}isActiveQueryTarget(e){return this.fu.activeTargetIds.has(e)}start(){return this.fu=new Em,Promise.resolve()}handleUserChange(e,t,n){}setOnlineState(e){}shutdown(){}writeSequenceNumber(e){}notifyBundleLoaded(e){}}function Dm(){return"undefined"!=typeof document?document:null}class _m{constructor(){this.queries=bm(),this.onlineState="Unknown",this.Du=new Set}terminate(){!function(e,t){const n=Xc(e),s=n.queries;n.queries=bm(),s.forEach((e,n)=>{for(const e of n.bu)e.onError(t)})}(this,new pl(hl.ABORTED,"Firestore shutting down"))}}function bm(){return new Wh(e=>dg(e),fg)}var vm;!function(e){e.Default="default",e.Cache="cache"}(vm||(vm={}));class Im{constructor(e,t,n,s,r,i){this.localStore=e,this.remoteStore=t,this.eventManager=n,this.sharedClientState=s,this.currentUser=r,this.maxConcurrentLimboResolutions=i,this.hc={},this.Tc=new Wh(e=>dg(e),fg),this.Pc=new Map,this.Ic=new Set,this.Rc=new ol(_l.comparator),this.Ac=new Map,this.Vc=new Fg,this.dc={},this.fc=new Map,this.mc=Tg.bs(),this.onlineState="Unknown",this.gc=void 0}get isPrimaryClient(){return!0===this.gc}}async function Tm(e,t,n){const s=function(e){const t=Xc(e);return t.remoteStore.remoteSyncer.applySuccessfulWrite=Am.bind(null,t),t.remoteStore.remoteSyncer.rejectFailedWrite=Sm.bind(null,t),t}(e);try{const e=await function(e,t){const n=Xc(e),s=Rl.now(),r=t.reduce((e,t)=>e.add(t.key),op());let i,a;return n.persistence.runTransaction("Locally write mutations","readwrite",e=>{let o=Xh(),B=op();return n.ko.getEntries(e,r).next(e=>{o=e,o.forEach((e,t)=>{t.isValidDocument()||(B=B.add(e))})}).next(()=>n.localDocuments.getOverlayedDocuments(e,o)).next(r=>{i=r;const a=[];for(const e of t){const t=Zu(e,i.get(e.key).overlayedDocument);null!=t&&a.push(new nh(e.key,t,Iu(t.value.mapValue),zu.exists(!0)))}return n.mutationQueue.addMutationBatch(e,s,a,t)}).next(t=>{a=t;const s=t.applyToLocalDocumentSet(i,B);return n.documentOverlayCache.saveOverlays(e,t.batchId,s)})}).then(()=>({batchId:a.batchId,changes:tp(i)}))}(s.localStore,t);s.sharedClientState.addPendingMutation(e.batchId),function(e,t,n){let s=e.dc[e.currentUser.toKey()];s||(s=new ol(tl)),s=s.insert(t,n),e.dc[e.currentUser.toKey()]=s}(s,e.batchId,n),await km(s,e.changes),await om(s.remoteStore)}catch(e){const t=wm(e,"Failed to persist write");n.reject(t)}}function Om(e,t,n){const s=Xc(e);if(s.isPrimaryClient&&0===n||!s.isPrimaryClient&&1===n){const e=[];s.Tc.forEach((n,s)=>{const r=s.view.xu(t);r.snapshot&&e.push(r.snapshot)}),function(e,t){const n=Xc(e);n.onlineState=t;let s=!1;n.queries.forEach((e,n)=>{for(const e of n.bu)e.xu(t)&&(s=!0)}),s&&function(e){e.Du.forEach(e=>{e.next()})}(n)}(s.eventManager,t),e.length&&s.hc.Tn(e),s.onlineState=t,s.isPrimaryClient&&s.sharedClientState.setOnlineState(t)}}async function Am(e,t){const n=Xc(e),s=t.batch.batchId;try{const e=await function(e,t){const n=Xc(e);return n.persistence.runTransaction("Acknowledge batch","readwrite-primary",e=>{const s=t.batch.keys(),r=n.ko.newChangeBuffer({trackRemovals:!0});return function(e,t,n,s){const r=n.batch,i=r.keys();let a=dd.resolve();return i.forEach(e=>{a=a.next(()=>s.getEntry(t,e)).next(t=>{const i=n.docVersions.get(e);Yc(null!==i,48541),t.version.compareTo(i)<0&&(r.applyToRemoteDocument(t,n),t.isValidDocument()&&(t.setReadTime(n.commitVersion),s.addEntry(t)))})}),a.next(()=>e.mutationQueue.removeMutationBatch(t,r))}(n,e,t,r).next(()=>r.apply(e)).next(()=>n.mutationQueue.performConsistencyCheck(e)).next(()=>n.documentOverlayCache.removeOverlaysForBatchId(e,s,t.batch.batchId)).next(()=>n.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(e,function(e){let t=op();for(let n=0;n<e.mutationResults.length;++n)e.mutationResults[n].transformResults.length>0&&(t=t.add(e.batch.mutations[n].key));return t}(t))).next(()=>n.localDocuments.getDocuments(e,s))})}(n.localStore,t);Rm(n,s,null),Nm(n,s),n.sharedClientState.updateMutationState(s,"acknowledged"),await km(n,e)}catch(e){await pd(e)}}async function Sm(e,t,n){const s=Xc(e);try{const e=await function(e,t){const n=Xc(e);return n.persistence.runTransaction("Reject batch","readwrite-primary",e=>{let s;return n.mutationQueue.lookupMutationBatch(e,t).next(t=>(Yc(null!==t,37113),s=t.keys(),n.mutationQueue.removeMutationBatch(e,t))).next(()=>n.mutationQueue.performConsistencyCheck(e)).next(()=>n.documentOverlayCache.removeOverlaysForBatchId(e,s,t)).next(()=>n.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(e,s)).next(()=>n.localDocuments.getDocuments(e,s))})}(s.localStore,t);Rm(s,t,n),Nm(s,t),s.sharedClientState.updateMutationState(t,"rejected",n),await km(s,e)}catch(n){await pd(n)}}function Nm(e,t){(e.fc.get(t)||[]).forEach(e=>{e.resolve()}),e.fc.delete(t)}function Rm(e,t,n){const s=Xc(e);let r=s.dc[s.currentUser.toKey()];if(r){const e=r.get(t);e&&(n?e.reject(n):e.resolve(),r=r.remove(t)),s.dc[s.currentUser.toKey()]=r}}async function km(e,t,n){const s=Xc(e),r=[],i=[],a=[];s.Tc.isEmpty()||(s.Tc.forEach((e,o)=>{a.push(s.yc(o,t,n).then(e=>{if((e||n)&&s.isPrimaryClient){const t=e?!e.fromCache:n?.targetChanges.get(o.targetId)?.current;s.sharedClientState.updateQueryState(o.targetId,t?"current":"not-current")}if(e){r.push(e);const t=qg.mo(o.targetId,e);i.push(t)}}))}),await Promise.all(a),s.hc.Tn(r),await async function(e,t){const n=Xc(e);try{await n.persistence.runTransaction("notifyLocalViewChanges","readwrite",e=>dd.forEach(t,t=>dd.forEach(t.Vo,s=>n.persistence.referenceDelegate.addReference(e,t.targetId,s)).next(()=>dd.forEach(t.fo,s=>n.persistence.referenceDelegate.removeReference(e,t.targetId,s)))))}catch(e){if(!fd(e))throw e;Jc("LocalStore","Failed to update sequence numbers: "+e)}for(const e of t){const t=e.targetId;if(!e.fromCache){const e=n.Lo.get(t),s=e.snapshotVersion,r=e.withLastLimboFreeSnapshotVersion(s);n.Lo=n.Lo.insert(t,r)}}}(s.localStore,i))}async function Lm(e,t){const n=Xc(e);if(!n.currentUser.isEqual(t)){Jc("SyncEngine","User change. New user:",t.toKey());const e=await Yg(n.localStore,t);n.currentUser=t,function(e,t){e.fc.forEach(e=>{e.forEach(e=>{e.reject(new pl(hl.CANCELLED,t))})}),e.fc.clear()}(n,"'waitForPendingWrites' promise is rejected due to a user change."),n.sharedClientState.handleUserChange(t,e.removedBatchIds,e.addedBatchIds),await km(n,e.$o)}}class xm{constructor(){this.kind="memory",this.synchronizeTabs=!1}async initialize(e){this.serializer=Tp(e.databaseInfo.databaseId),this.sharedClientState=this.vc(e),this.persistence=this.Dc(e),await this.persistence.start(),this.localStore=this.xc(e),this.gcScheduler=this.Cc(e,this.localStore),this.indexBackfillerScheduler=this.Fc(e,this.localStore)}Cc(e,t){return null}Fc(e,t){return null}xc(e){return function(e,t,n,s){return new Wg(e,t,n,s)}(this.persistence,new Qg,e.initialUser,this.serializer)}Dc(e){return new Vg($g.b_,this.serializer)}vc(e){return new ym}async terminate(){this.gcScheduler?.stop(),this.indexBackfillerScheduler?.stop(),this.sharedClientState.shutdown(),await this.persistence.shutdown()}}xm.provider={build:()=>new xm};class Fm extends xm{constructor(e){super(),this.cacheSizeBytes=e}Cc(e,t){Yc(this.persistence.referenceDelegate instanceof Jg,46915);const n=this.persistence.referenceDelegate.garbageCollector;return new wd(n,e.asyncQueue,t)}Dc(e){const t=void 0!==this.cacheSizeBytes?ld.withCacheSize(this.cacheSizeBytes):ld.DEFAULT;return new Vg(e=>Jg.b_(e,t),this.serializer)}}class Pm{async initialize(e,t){this.localStore||(this.localStore=e.localStore,this.sharedClientState=e.sharedClientState,this.datastore=this.createDatastore(t),this.remoteStore=this.createRemoteStore(t),this.eventManager=this.createEventManager(t),this.syncEngine=this.createSyncEngine(t,!e.synchronizeTabs),this.sharedClientState.onlineStateHandler=e=>Om(this.syncEngine,e,1),this.remoteStore.remoteSyncer.handleCredentialChange=Lm.bind(null,this.syncEngine),await async function(e,t){const n=Xc(e);t?(n.la.delete(2),await nm(n)):t||(n.la.add(2),await sm(n),n.Ta.set("Unknown"))}(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(e){return new _m}createDatastore(e){const t=Tp(e.databaseInfo.databaseId),n=function(e){return new ed(e)}(e.databaseInfo);return function(e,t,n,s){return new ad(e,t,n,s)}(e.authCredentials,e.appCheckCredentials,n,t)}createRemoteStore(e){return function(e,t,n,s,r){return new tm(e,t,n,s,r)}(this.localStore,this.datastore,e.asyncQueue,e=>Om(this.syncEngine,e,0),Jp.Ye()?new Jp:new jp)}createSyncEngine(e,t){return function(e,t,n,s,r,i,a){const o=new Im(e,t,n,s,r,i);return a&&(o.gc=!0),o}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,e.initialUser,e.maxConcurrentLimboResolutions,t)}async terminate(){await async function(e){const t=Xc(e);Jc(em,"RemoteStore shutting down."),t.la.add(5),await sm(t),t.ha.shutdown(),t.Ta.set("Unknown")}(this.remoteStore),this.datastore?.terminate(),this.eventManager?.terminate()}}Pm.provider={build:()=>new Pm};const Mm="FirestoreClient";class Gm{constructor(e,t,n,s,r){this.authCredentials=e,this.appCheckCredentials=t,this.asyncQueue=n,this._databaseInfo=s,this.user=Rp.UNAUTHENTICATED,this.clientId=el.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this._uninitializedComponentsProvider=r,this.authCredentials.start(n,async e=>{Jc(Mm,"Received user=",e.uid),await this.authCredentialListener(e),this.user=e}),this.appCheckCredentials.start(n,e=>(Jc(Mm,"Received new app check token=",e),this.appCheckCredentialListener(e,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 kp;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted(async()=>{try{this._onlineComponents&&await this._onlineComponents.terminate(),this._offlineComponents&&await this._offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),e.resolve()}catch(t){const n=wm(t,"Failed to shutdown persistence");e.reject(n)}}),e.promise}}async function Um(e,t){e.asyncQueue.verifyOperationInProgress(),Jc(Mm,"Initializing OfflineComponentProvider");const n=e.configuration;await t.initialize(n);let s=n.initialUser;e.setCredentialChangeListener(async e=>{s.isEqual(e)||(await Yg(t.localStore,e),s=e)}),t.persistence.setDatabaseDeletedListener(()=>e.terminate()),e._offlineComponents=t}async function Hm(e,t){e.asyncQueue.verifyOperationInProgress();const n=await async function(e){if(!e._offlineComponents)if(e._uninitializedComponentsProvider){Jc(Mm,"Using user provided OfflineComponentProvider");try{await Um(e,e._uninitializedComponentsProvider._offline)}catch(t){const n=t;if(!function(e){return"FirebaseError"===e.name?e.code===hl.FAILED_PRECONDITION||e.code===hl.UNIMPLEMENTED:!("undefined"!=typeof DOMException&&e instanceof DOMException)||22===e.code||20===e.code||11===e.code}(n))throw n;zc("Error using user provided cache. Falling back to memory cache: "+n),await Um(e,new xm)}}else Jc(Mm,"Using default OfflineComponentProvider"),await Um(e,new Fm(void 0));return e._offlineComponents}(e);Jc(Mm,"Initializing OnlineComponentProvider"),await t.initialize(n,e.configuration),e.setCredentialChangeListener(e=>Cm(t.remoteStore,e)),e.setAppCheckTokenChangeListener((e,n)=>Cm(t.remoteStore,n)),e._onlineComponents=t}function Vm(e){return async function(e){return e._onlineComponents||(e._uninitializedComponentsProvider?(Jc(Mm,"Using user provided OnlineComponentProvider"),await Hm(e,e._uninitializedComponentsProvider._online)):(Jc(Mm,"Using default OnlineComponentProvider"),await Hm(e,new Pm))),e._onlineComponents}(e).then(e=>e.syncEngine)}let jm=class{constructor(e,t,n,s,r){this._firestore=e,this._userDataWriter=t,this._key=n,this._document=s,this._converter=r}get id(){return this._key.path.lastSegment()}get ref(){return new Td(this._firestore,this._converter,this._key)}exists(){return null!==this._document}data(){if(this._document){if(this._converter){const e=new $m(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(e)}return this._userDataWriter.convertValue(this._document.data.value)}}_fieldsProto(){return this._document?.data.clone().value.mapValue.fields??void 0}get(e){if(this._document){const t=this._document.data.field(Ld("DocumentSnapshot.get",e));if(null!==t)return this._userDataWriter.convertValue(t)}}},$m=class extends jm{data(){return super.data()}};const Jm="AsyncQueue";class qm{constructor(e=Promise.resolve()){this.$c=[],this.Kc=!1,this.Qc=[],this.Wc=null,this.Gc=!1,this.zc=!1,this.jc=[],this.Ht=new td(this,"async_queue_retry"),this.Hc=()=>{const e=Dm();e&&Jc(Jm,"Visibility state changed to "+e.visibilityState),this.Ht.$t()},this.Jc=e;const t=Dm();t&&"function"==typeof t.addEventListener&&t.addEventListener("visibilitychange",this.Hc)}get isShuttingDown(){return this.Kc}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.Yc(),this.Zc(e)}enterRestrictedMode(e){if(!this.Kc){this.Kc=!0,this.zc=e||!1;const t=Dm();t&&"function"==typeof t.removeEventListener&&t.removeEventListener("visibilitychange",this.Hc)}}enqueue(e){if(this.Yc(),this.Kc)return new Promise(()=>{});const t=new kp;return this.Zc(()=>this.Kc&&this.zc?Promise.resolve():(e().then(t.resolve,t.reject),t.promise)).then(()=>t.promise)}enqueueRetryable(e){this.enqueueAndForget(()=>(this.$c.push(e),this.Xc()))}async Xc(){if(0!==this.$c.length){try{await this.$c[0](),this.$c.shift(),this.Ht.reset()}catch(e){if(!fd(e))throw e;Jc(Jm,"Operation failed with retryable error: "+e)}this.$c.length>0&&this.Ht.kt(()=>this.Xc())}}Zc(e){const t=this.Jc.then(()=>(this.Gc=!0,e().catch(e=>{throw this.Wc=e,this.Gc=!1,qc("INTERNAL UNHANDLED ERROR: ",zm(e)),e}).then(e=>(this.Gc=!1,e))));return this.Jc=t,t}enqueueAfterDelay(e,t,n){this.Yc(),this.jc.indexOf(e)>-1&&(t=0);const s=mm.createAndSchedule(this,e,t,n,e=>this.el(e));return this.Qc.push(s),s}Yc(){this.Wc&&Qc(47125,{tl:zm(this.Wc)})}verifyOperationInProgress(){}async nl(){let e;do{e=this.Jc,await e}while(e!==this.Jc)}rl(e){for(const t of this.Qc)if(t.timerId===e)return!0;return!1}il(e){return this.nl().then(()=>{this.Qc.sort((e,t)=>e.targetTimeMs-t.targetTimeMs);for(const t of this.Qc)if(t.skipDelay(),"all"!==e&&t.timerId===e)break;return this.nl()})}sl(e){this.jc.push(e)}el(e){const t=this.Qc.indexOf(e);this.Qc.splice(t,1)}}function zm(e){let t=e.message||"";return e.stack&&(t=e.stack.includes(e.message)?e.stack:e.message+"\n"+e.stack),t}class Km extends bd{constructor(e,t,n,s){super(e,t,n,s),this.type="firestore",this._queue=new qm,this._persistenceKey=s?.name||"[DEFAULT]"}async _terminate(){if(this._firestoreClient){const e=this._firestoreClient.terminate();this._queue=new qm(e),this._firestoreClient=void 0,await e}}}function Qm(e){if(e._terminated)throw new pl(hl.FAILED_PRECONDITION,"The client has already been terminated.");return e._firestoreClient||function(e){const t=e._freezeSettings(),n=function(e,t,n,s,r){return new ql(e,t,n,r.host,r.ssl,r.experimentalForceLongPolling,r.experimentalAutoDetectLongPolling,Vp(r.experimentalLongPollingOptions),r.useFetchStreams,r.isUsingEmulator,s,r._customHeaders,r.grpcFlowControlWindow)}(e._databaseId,e._app?.options.appId||"",e._persistenceKey,e._app?.options.apiKey,t);e._componentsProvider||t.localCache?._offlineComponentProvider&&t.localCache?._onlineComponentProvider&&(e._componentsProvider={_offline:t.localCache._offlineComponentProvider,_online:t.localCache._onlineComponentProvider}),e._firestoreClient=new Gm(e._authCredentials,e._appCheckCredentials,e._queue,n,e._componentsProvider&&function(e){const t=e?._online.build();return{_offline:e?._offline.build(t),_online:t}}(e._componentsProvider))}(e),e._firestoreClient}class Wm{constructor(e,t){this.hasPendingWrites=e,this.fromCache=t}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}}class Ym extends jm{constructor(e,t,n,s,r,i){super(e,t,n,s,i),this._firestore=e,this._firestoreImpl=e,this.metadata=r}exists(){return super.exists()}data(e={}){if(this._document){if(this._converter){const t=new Xm(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(t,e)}return this._userDataWriter.convertValue(this._document.data.value,e.serverTimestamps)}}get(e,t={}){if(this._document){const n=this._document.data.field(Ld("DocumentSnapshot.get",e));if(null!==n)return this._userDataWriter.convertValue(n,t.serverTimestamps)}}toJSON(){if(this.metadata.hasPendingWrites)throw new pl(hl.FAILED_PRECONDITION,"DocumentSnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");const e=this._document,t={};return t.type=Ym._jsonSchemaVersion,t.bundle="",t.bundleSource="DocumentSnapshot",t.bundleName=this._key.toString(),e&&e.isValidDocument()&&e.isFoundDocument()?(this._userDataWriter.convertObjectMap(e.data.value.mapValue.fields,"previous"),t.bundle=(this._firestore,this.ref.path,"NOT SUPPORTED"),t):t}}Ym._jsonSchemaVersion="firestore/documentSnapshot/1.0",Ym._jsonSchema={type:Ol("string",Ym._jsonSchemaVersion),bundleSource:Ol("string","DocumentSnapshot"),bundleName:Ol("string"),bundle:Ol("string")};class Xm extends Ym{data(e={}){return super.data(e)}}class Zm{constructor(e,t,n,s){this._firestore=e,this._userDataWriter=t,this._snapshot=s,this.metadata=new Wm(s.hasPendingWrites,s.fromCache),this.query=n}get docs(){const e=[];return this.forEach(t=>e.push(t)),e}get size(){return this._snapshot.docs.size}get empty(){return 0===this.size}forEach(e,t){this._snapshot.docs.forEach(n=>{e.call(t,new Xm(this._firestore,this._userDataWriter,n.key,n,new Wm(this._snapshot.mutatedKeys.has(n.key),this._snapshot.fromCache),this.query.converter))})}docChanges(e={}){const t=!!e.includeMetadataChanges;if(t&&this._snapshot.excludesMetadataChanges)throw new pl(hl.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===t||(this._cachedChanges=function(e,t){if(e._snapshot.oldDocs.isEmpty()){let t=0;return e._snapshot.docChanges.map(n=>{hg(e._snapshot.query)?function(e){const t=function(e){for(let t=e.stages.length-1;t>=0;t--){const n=e.stages[t];if(n instanceof ff)return n.orderings}throw new Error("Pipeline must contain at least one Sort stage")}(e)}(e._snapshot.query):Jh(e.query._query);const s=new Xm(e._firestore,e._userDataWriter,n.doc.key,n.doc,new Wm(e._snapshot.mutatedKeys.has(n.doc.key),e._snapshot.fromCache),e.query.converter);return n.doc,{type:"added",doc:s,oldIndex:-1,newIndex:t++}})}{let n=e._snapshot.oldDocs;return e._snapshot.docChanges.filter(e=>t||3!==e.type).map(t=>{const s=new Xm(e._firestore,e._userDataWriter,t.doc.key,t.doc,new Wm(e._snapshot.mutatedKeys.has(t.doc.key),e._snapshot.fromCache),e.query.converter);let r=-1,i=-1;return 0!==t.type&&(r=n.indexOf(t.doc.key),n=n.delete(t.doc.key)),1!==t.type&&(n=n.add(t.doc),i=n.indexOf(t.doc.key)),{type:ew(t.type),doc:s,oldIndex:r,newIndex:i}})}}(this,t),this._cachedChangesIncludeMetadataChanges=t),this._cachedChanges}toJSON(){if(this.metadata.hasPendingWrites)throw new pl(hl.FAILED_PRECONDITION,"QuerySnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");const e={};e.type=Zm._jsonSchemaVersion,e.bundleSource="QuerySnapshot",e.bundleName=el.newId(),this._firestore._databaseId.database,this._firestore._databaseId.projectId;const t=[],n=[],s=[];return this.docs.forEach(e=>{null!==e._document&&(t.push(e._document),n.push(this._userDataWriter.convertObjectMap(e._document.data.value.mapValue.fields,"previous")),s.push(e.ref.path))}),e.bundle=(this._firestore,this.query._query,e.bundleName,"NOT SUPPORTED"),e}}function ew(e){switch(e){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return Qc(61501,{type:e})}}function tw(e){return function(e,t){const n=Qm(e);return function(e,t){const n=new kp;return e.asyncQueue.enqueueAndForget(async()=>Tm(await Vm(e),t,n)),n.promise}(n,t)}(Tl(e.firestore,Km),[new ah(e._key,zu.none())])}Zm._jsonSchemaVersion="firestore/querySnapshot/1.0",Zm._jsonSchema={type:Ol("string",Zm._jsonSchemaVersion),bundleSource:Ol("string","QuerySnapshot"),bundleName:Ol("string"),bundle:Ol("string")};const nw="@firebase/firestore",sw="4.17.2";!function(e,t=!0){(function(e){Vc=e})(fr),lr(new ts("firestore",(e,{instanceIdentifier:n,options:s})=>{const r=e.getProvider("app").getImmediate(),i=new Km(new Pp(e.getProvider("auth-internal")),new Hp(r,e.getProvider("app-check-internal")),Ql(r,n),r);return s={useFetchStreams:t,...s},i._setSettings(s),i},"PUBLIC").setMultipleInstances(!0)),mr(nw,sw,e),mr(nw,sw,"esm2020")}();const rw="firebasestorage.googleapis.com",iw="storageBucket";class aw extends Vn{constructor(e,t,n=0){super(cw(e),`Firebase Storage: ${t} (${cw(e)})`),this.status_=n,this.customData={serverResponse:null},this._baseMessage=this.message,Object.setPrototypeOf(this,aw.prototype)}get status(){return this.status_}set status(e){this.status_=e}_codeEquals(e){return cw(e)===this.code}get serverResponse(){return this.customData.serverResponse}set serverResponse(e){this.customData.serverResponse=e,this.customData.serverResponse?this.message=`${this._baseMessage}\n${this.customData.serverResponse}`:this.message=this._baseMessage}}var ow,Bw;function cw(e){return"storage/"+e}function lw(){return new aw(ow.UNKNOWN,"An unknown error occurred, please check the error payload for server response.")}function uw(){return new aw(ow.RETRY_LIMIT_EXCEEDED,"Max retry time for operation exceeded, please try again.")}function hw(){return new aw(ow.CANCELED,"User canceled the upload/download.")}function pw(){return new aw(ow.CANNOT_SLICE_BLOB,"Cannot slice blob for upload. Please retry the upload.")}function dw(e){return new aw(ow.INVALID_ARGUMENT,e)}function fw(){return new aw(ow.APP_DELETED,"The Firebase app was deleted.")}function Cw(e,t){return new aw(ow.INVALID_FORMAT,"String does not match format '"+e+"': "+t)}function gw(e){throw new aw(ow.INTERNAL_ERROR,"Internal error: "+e)}!function(e){e.UNKNOWN="unknown",e.OBJECT_NOT_FOUND="object-not-found",e.BUCKET_NOT_FOUND="bucket-not-found",e.PROJECT_NOT_FOUND="project-not-found",e.QUOTA_EXCEEDED="quota-exceeded",e.UNAUTHENTICATED="unauthenticated",e.UNAUTHORIZED="unauthorized",e.UNAUTHORIZED_APP="unauthorized-app",e.RETRY_LIMIT_EXCEEDED="retry-limit-exceeded",e.INVALID_CHECKSUM="invalid-checksum",e.CANCELED="canceled",e.INVALID_EVENT_NAME="invalid-event-name",e.INVALID_URL="invalid-url",e.INVALID_DEFAULT_BUCKET="invalid-default-bucket",e.NO_DEFAULT_BUCKET="no-default-bucket",e.CANNOT_SLICE_BLOB="cannot-slice-blob",e.SERVER_FILE_WRONG_SIZE="server-file-wrong-size",e.NO_DOWNLOAD_URL="no-download-url",e.INVALID_ARGUMENT="invalid-argument",e.INVALID_ARGUMENT_COUNT="invalid-argument-count",e.APP_DELETED="app-deleted",e.INVALID_ROOT_OPERATION="invalid-root-operation",e.INVALID_FORMAT="invalid-format",e.INTERNAL_ERROR="internal-error",e.UNSUPPORTED_ENVIRONMENT="unsupported-environment"}(ow||(ow={}));class mw{constructor(e,t){this.bucket=e,this.path_=t}get path(){return this.path_}get isRoot(){return 0===this.path.length}fullServerUrl(){const e=encodeURIComponent;return"/b/"+e(this.bucket)+"/o/"+e(this.path)}bucketOnlyServerUrl(){return"/b/"+encodeURIComponent(this.bucket)+"/o"}static makeFromBucketSpec(e,t){let n;try{n=mw.makeFromUrl(e,t)}catch(t){return new mw(e,"")}if(""===n.path)return n;throw s=e,new aw(ow.INVALID_DEFAULT_BUCKET,"Invalid default bucket '"+s+"'.");var s}static makeFromUrl(e,t){let n=null;const s="([A-Za-z0-9.\\-_]+)";const r=new RegExp("^gs://"+s+"(/(.*))?$","i");function i(e){e.path_=decodeURIComponent(e.path)}const a=t.replace(/[.]/g,"\\."),o=[{regex:r,indices:{bucket:1,path:3},postModify:function(e){"/"===e.path.charAt(e.path.length-1)&&(e.path_=e.path_.slice(0,-1))}},{regex:new RegExp(`^https?://${a}/v[A-Za-z0-9_]+/b/${s}/o(/([^?#]*).*)?$`,"i"),indices:{bucket:1,path:3},postModify:i},{regex:new RegExp(`^https?://${t===rw?"(?:storage.googleapis.com|storage.cloud.google.com)":t}/${s}/([^?#]*)`,"i"),indices:{bucket:1,path:2},postModify:i}];for(let t=0;t<o.length;t++){const s=o[t],r=s.regex.exec(e);if(r){const e=r[s.indices.bucket];let t=r[s.indices.path];t||(t=""),n=new mw(e,t),s.postModify(n);break}}if(null==n)throw function(e){return new aw(ow.INVALID_URL,"Invalid URL '"+e+"'.")}(e);return n}}class ww{constructor(e){this.promise_=Promise.reject(e)}getPromise(){return this.promise_}cancel(e=!1){}}function Ew(e){return"string"==typeof e||e instanceof String}function yw(e){return Dw()&&e instanceof Blob}function Dw(){return"undefined"!=typeof Blob}function _w(e,t,n,s){if(s<t)throw dw(`Invalid value for '${e}'. Expected ${t} or greater.`);if(s>n)throw dw(`Invalid value for '${e}'. Expected ${n} or less.`)}function bw(e,t,n){let s=t;return null==n&&(s=`https://${t}`),`${n}://${s}/v0${e}`}function vw(e){const t=encodeURIComponent;let n="?";for(const s in e)if(e.hasOwnProperty(s)){n=n+(t(s)+"="+t(e[s]))+"&"}return n=n.slice(0,-1),n}function Iw(e,t){const n=e>=500&&e<600,s=-1!==[408,429].indexOf(e),r=-1!==t.indexOf(e);return n||s||r}!function(e){e[e.NO_ERROR=0]="NO_ERROR",e[e.NETWORK_ERROR=1]="NETWORK_ERROR",e[e.ABORT=2]="ABORT"}(Bw||(Bw={}));class Tw{constructor(e,t,n,s,r,i,a,o,B,c,l,u=!0,h=!1){this.url_=e,this.method_=t,this.headers_=n,this.body_=s,this.successCodes_=r,this.additionalRetryCodes_=i,this.callback_=a,this.errorCallback_=o,this.timeout_=B,this.progressCallback_=c,this.connectionFactory_=l,this.retry=u,this.isUsingEmulator=h,this.pendingConnection_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.promise_=new Promise((e,t)=>{this.resolve_=e,this.reject_=t,this.start_()})}start_(){const e=(e,t)=>{if(t)return void e(!1,new Ow(!1,null,!0));const n=this.connectionFactory_();this.pendingConnection_=n;const s=e=>{const t=e.loaded,n=e.lengthComputable?e.total:-1;null!==this.progressCallback_&&this.progressCallback_(t,n)};null!==this.progressCallback_&&n.addUploadProgressListener(s),n.send(this.url_,this.method_,this.isUsingEmulator,this.body_,this.headers_).then(()=>{null!==this.progressCallback_&&n.removeUploadProgressListener(s),this.pendingConnection_=null;const t=n.getErrorCode()===Bw.NO_ERROR,r=n.getStatus();if(!t||Iw(r,this.additionalRetryCodes_)&&this.retry){const t=n.getErrorCode()===Bw.ABORT;return void e(!1,new Ow(!1,null,t))}const i=-1!==this.successCodes_.indexOf(r);e(!0,new Ow(i,n))})},t=(e,t)=>{const n=this.resolve_,s=this.reject_,r=t.connection;if(t.wasSuccessCode)try{const e=this.callback_(r,r.getResponse());!function(e){return void 0!==e}(e)?n():n(e)}catch(e){s(e)}else if(null!==r){const e=lw();e.serverResponse=r.getErrorText(),this.errorCallback_?s(this.errorCallback_(r,e)):s(e)}else if(t.canceled){s(this.appDelete_?fw():hw())}else{s(uw())}};this.canceled_?t(0,new Ow(!1,null,!0)):this.backoffId_=function(e,t,n){let s=1,r=null,i=null,a=!1,o=0;function B(){return 2===o}let c=!1;function l(...e){c||(c=!0,t.apply(null,e))}function u(t){r=setTimeout(()=>{r=null,e(p,B())},t)}function h(){i&&clearTimeout(i)}function p(e,...t){if(c)return void h();if(e)return h(),void l.call(null,e,...t);if(B()||a)return h(),void l.call(null,e,...t);let n;s<64&&(s*=2),1===o?(o=2,n=0):n=1e3*(s+Math.random()),u(n)}let d=!1;function f(e){d||(d=!0,h(),c||(null!==r?(e||(o=2),clearTimeout(r),u(0)):e||(o=1)))}return u(0),i=setTimeout(()=>{a=!0,f(!0)},n),f}(e,t,this.timeout_)}getPromise(){return this.promise_}cancel(e){this.canceled_=!0,this.appDelete_=e||!1,null!==this.backoffId_&&(0,this.backoffId_)(!1),null!==this.pendingConnection_&&this.pendingConnection_.abort()}}class Ow{constructor(e,t,n){this.wasSuccessCode=e,this.connection=t,this.canceled=!!n}}function Aw(){return"undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:void 0}function Sw(...e){const t=Aw();if(void 0!==t){const n=new t;for(let t=0;t<e.length;t++)n.append(e[t]);return n.getBlob()}if(Dw())return new Blob(e);throw new aw(ow.UNSUPPORTED_ENVIRONMENT,"This browser doesn't seem to support creating Blobs")}function Nw(e){if("undefined"==typeof atob)throw t="base-64",new aw(ow.UNSUPPORTED_ENVIRONMENT,`${t} is missing. Make sure to install the required polyfills. See https://firebase.google.com/docs/web/environments-js-sdk#polyfills for more information.`);var t;return atob(e)}const Rw="raw",kw="base64",Lw="base64url",xw="data_url";class Fw{constructor(e,t){this.data=e,this.contentType=t||null}}function Pw(e,t){switch(e){case Rw:return new Fw(Mw(t));case kw:case Lw:return new Fw(Gw(e,t));case xw:return new Fw(function(e){const t=new Uw(e);return t.base64?Gw(kw,t.rest):function(e){let t;try{t=decodeURIComponent(e)}catch(e){throw Cw(xw,"Malformed data URL.")}return Mw(t)}(t.rest)}(t),new Uw(t).contentType)}throw lw()}function Mw(e){const t=[];for(let n=0;n<e.length;n++){let s=e.charCodeAt(n);if(s<=127)t.push(s);else if(s<=2047)t.push(192|s>>6,128|63&s);else if(55296==(64512&s)){if(n<e.length-1&&56320==(64512&e.charCodeAt(n+1))){s=65536|(1023&s)<<10|1023&e.charCodeAt(++n),t.push(240|s>>18,128|s>>12&63,128|s>>6&63,128|63&s)}else t.push(239,191,189)}else 56320==(64512&s)?t.push(239,191,189):t.push(224|s>>12,128|s>>6&63,128|63&s)}return new Uint8Array(t)}function Gw(e,t){switch(e){case kw:{const n=-1!==t.indexOf("-"),s=-1!==t.indexOf("_");if(n||s){throw Cw(e,"Invalid character '"+(n?"-":"_")+"' found: is it base64url encoded?")}break}case Lw:{const n=-1!==t.indexOf("+"),s=-1!==t.indexOf("/");if(n||s){throw Cw(e,"Invalid character '"+(n?"+":"/")+"' found: is it base64 encoded?")}t=t.replace(/-/g,"+").replace(/_/g,"/");break}}let n;try{n=Nw(t)}catch(t){if(t.message.includes("polyfill"))throw t;throw Cw(e,"Invalid character found")}const s=new Uint8Array(n.length);for(let e=0;e<n.length;e++)s[e]=n.charCodeAt(e);return s}class Uw{constructor(e){this.base64=!1,this.contentType=null;const t=e.match(/^data:([^,]+)?,/);if(null===t)throw Cw(xw,"Must be formatted 'data:[<mediatype>][;base64],<data>");const n=t[1]||null;null!=n&&(this.base64=function(e,t){const n=e.length>=t.length;if(!n)return!1;return e.substring(e.length-t.length)===t}(n,";base64"),this.contentType=this.base64?n.substring(0,n.length-7):n),this.rest=e.substring(e.indexOf(",")+1)}}class Hw{constructor(e,t){let n=0,s="";yw(e)?(this.data_=e,n=e.size,s=e.type):e instanceof ArrayBuffer?(t?this.data_=new Uint8Array(e):(this.data_=new Uint8Array(e.byteLength),this.data_.set(new Uint8Array(e))),n=this.data_.length):e instanceof Uint8Array&&(t?this.data_=e:(this.data_=new Uint8Array(e.length),this.data_.set(e)),n=e.length),this.size_=n,this.type_=s}size(){return this.size_}type(){return this.type_}slice(e,t){if(yw(this.data_)){const n=function(e,t,n){return e.webkitSlice?e.webkitSlice(t,n):e.mozSlice?e.mozSlice(t,n):e.slice?e.slice(t,n):null}(this.data_,e,t);return null===n?null:new Hw(n)}{const n=new Uint8Array(this.data_.buffer,e,t-e);return new Hw(n,!0)}}static getBlob(...e){if(Dw()){const t=e.map(e=>e instanceof Hw?e.data_:e);return new Hw(Sw.apply(null,t))}{const t=e.map(e=>Ew(e)?Pw(Rw,e).data:e.data_);let n=0;t.forEach(e=>{n+=e.byteLength});const s=new Uint8Array(n);let r=0;return t.forEach(e=>{for(let t=0;t<e.length;t++)s[r++]=e[t]}),new Hw(s,!0)}}uploadData(){return this.data_}}function Vw(e){let t;try{t=JSON.parse(e)}catch(e){return null}return function(e){return"object"==typeof e&&!Array.isArray(e)}(t)?t:null}function jw(e){const t=e.lastIndexOf("/",e.length-2);return-1===t?e:e.slice(t+1)}function $w(e,t){return t}class Jw{constructor(e,t,n,s){this.server=e,this.local=t||e,this.writable=!!n,this.xform=s||$w}}let qw=null;function zw(){if(qw)return qw;const e=[];e.push(new Jw("bucket")),e.push(new Jw("generation")),e.push(new Jw("metageneration")),e.push(new Jw("name","fullPath",!0));const t=new Jw("name");t.xform=function(e,t){return function(e){return!Ew(e)||e.length<2?e:jw(e)}(t)},e.push(t);const n=new Jw("size");return n.xform=function(e,t){return void 0!==t?Number(t):t},e.push(n),e.push(new Jw("timeCreated")),e.push(new Jw("updated")),e.push(new Jw("md5Hash",null,!0)),e.push(new Jw("cacheControl",null,!0)),e.push(new Jw("contentDisposition",null,!0)),e.push(new Jw("contentEncoding",null,!0)),e.push(new Jw("contentLanguage",null,!0)),e.push(new Jw("contentType",null,!0)),e.push(new Jw("metadata","customMetadata",!0)),qw=e,qw}function Kw(e,t,n){const s={type:"file"},r=n.length;for(let e=0;e<r;e++){const r=n[e];s[r.local]=r.xform(s,t[r.server])}return function(e,t){Object.defineProperty(e,"ref",{get:function(){const n=e.bucket,s=e.fullPath,r=new mw(n,s);return t._makeStorageReference(r)}})}(s,e),s}function Qw(e,t,n){const s=Vw(t);if(null===s)return null;return Kw(e,s,n)}function Ww(e,t){const n={},s=t.length;for(let r=0;r<s;r++){const s=t[r];s.writable&&(n[s.server]=e[s.local])}return JSON.stringify(n)}const Yw="prefixes",Xw="items";function Zw(e,t,n){const s=Vw(n);if(null===s)return null;return function(e,t,n){const s={prefixes:[],items:[],nextPageToken:n.nextPageToken};if(n[Yw])for(const r of n[Yw]){const n=r.replace(/\/$/,""),i=e._makeStorageReference(new mw(t,n));s.prefixes.push(i)}if(n[Xw])for(const r of n[Xw]){const n=e._makeStorageReference(new mw(t,r.name));s.items.push(n)}return s}(e,t,s)}class eE{constructor(e,t,n,s){this.url=e,this.method=t,this.handler=n,this.timeout=s,this.urlParams={},this.headers={},this.body=null,this.errorHandler=null,this.progressCallback=null,this.successCodes=[200],this.additionalRetryCodes=[]}}function tE(e){if(!e)throw lw()}function nE(e,t){return function(n,s){const r=Qw(e,s,t);return tE(null!==r),r}}function sE(e,t){return function(n,s){const r=Qw(e,s,t);return tE(null!==r),function(e,t,n,s){const r=Vw(t);if(null===r)return null;if(!Ew(r.downloadTokens))return null;const i=r.downloadTokens;if(0===i.length)return null;const a=encodeURIComponent;return i.split(",").map(t=>{const r=e.bucket,i=e.fullPath;return bw("/b/"+a(r)+"/o/"+a(i),n,s)+vw({alt:"media",token:t})})[0]}(r,s,e.host,e._protocol)}}function rE(e){return function(t,n){let s;var r,i;return 401===t.getStatus()?s=t.getErrorText().includes("Firebase App Check token is invalid")?new aw(ow.UNAUTHORIZED_APP,"This app does not have permission to access Firebase Storage on this project."):new aw(ow.UNAUTHENTICATED,"User is not authenticated, please authenticate using Firebase Authentication and try again."):402===t.getStatus()?(i=e.bucket,s=new aw(ow.QUOTA_EXCEEDED,"Quota for bucket '"+i+"' exceeded, please view quota on https://firebase.google.com/pricing/.")):403===t.getStatus()?(r=e.path,s=new aw(ow.UNAUTHORIZED,"User does not have permission to access '"+r+"'.")):s=n,s.status=t.getStatus(),s.serverResponse=n.serverResponse,s}}function iE(e){const t=rE(e);return function(n,s){let r=t(n,s);var i;return 404===n.getStatus()&&(i=e.path,r=new aw(ow.OBJECT_NOT_FOUND,"Object '"+i+"' does not exist.")),r.serverResponse=s.serverResponse,r}}function aE(e,t,n,s,r){const i={};t.isRoot?i.prefix="":i.prefix=t.path+"/",n.length>0&&(i.delimiter=n),s&&(i.pageToken=s),r&&(i.maxResults=r);const a=bw(t.bucketOnlyServerUrl(),e.host,e._protocol),o=e.maxOperationRetryTime,B=new eE(a,"GET",function(e,t){return function(n,s){const r=Zw(e,t,s);return tE(null!==r),r}}(e,t.bucket),o);return B.urlParams=i,B.errorHandler=rE(t),B}function oE(e,t,n){const s=Object.assign({},n);return s.fullPath=e.path,s.size=t.size(),s.contentType||(s.contentType=function(e,t){return e&&e.contentType||t&&t.type()||"application/octet-stream"}(null,t)),s}class BE{constructor(e,t,n,s){this.current=e,this.total=t,this.finalized=!!n,this.metadata=s||null}}function cE(e,t){let n=null;try{n=e.getResponseHeader("X-Goog-Upload-Status")}catch(e){tE(!1)}return tE(!!n&&-1!==(t||["active"]).indexOf(n)),n}const lE=262144;function uE(e,t,n,s,r,i,a,o){const B=new BE(0,0);if(a?(B.current=a.current,B.total=a.total):(B.current=0,B.total=s.size()),s.size()!==B.total)throw new aw(ow.SERVER_FILE_WRONG_SIZE,"Server recorded incorrect upload file size, please retry the upload.");const c=B.total-B.current;let l=c;r>0&&(l=Math.min(l,r));const u=B.current,h=u+l;let p="";p=0===l?"finalize":c===l?"upload, finalize":"upload";const d={"X-Goog-Upload-Command":p,"X-Goog-Upload-Offset":`${B.current}`},f=s.slice(u,h);if(null===f)throw pw();const C=t.maxUploadRetryTime,g=new eE(n,"POST",function(e,n){const r=cE(e,["active","final"]),a=B.current+l,o=s.size();let c;return c="final"===r?nE(t,i)(e,n):null,new BE(a,o,"final"===r,c)},C);return g.headers=d,g.body=f.uploadData(),g.progressCallback=o||null,g.errorHandler=rE(e),g}const hE="running",pE="paused",dE="success",fE="canceled",CE="error";function gE(e){switch(e){case"running":case"pausing":case"canceling":return hE;case"paused":return pE;case"success":return dE;case"canceled":return fE;default:return CE}}class mE{constructor(e,t,n){const s=function(e){return"function"==typeof e}(e)||null!=t||null!=n;if(s)this.next=e,this.error=t??void 0,this.complete=n??void 0;else{const t=e;this.next=t.next,this.error=t.error,this.complete=t.complete}}}function wE(e){return(...t)=>{Promise.resolve().then(()=>e(...t))}}class EE{constructor(){this.sent_=!1,this.xhr_=new XMLHttpRequest,this.initXhr(),this.errorCode_=Bw.NO_ERROR,this.sendPromise_=new Promise(e=>{this.xhr_.addEventListener("abort",()=>{this.errorCode_=Bw.ABORT,e()}),this.xhr_.addEventListener("error",()=>{this.errorCode_=Bw.NETWORK_ERROR,e()}),this.xhr_.addEventListener("load",()=>{e()})})}send(e,t,n,s,r){if(this.sent_)throw gw("cannot .send() more than once");if(Zn(e)&&n&&(this.xhr_.withCredentials=!0),this.sent_=!0,this.xhr_.open(t,e,!0),void 0!==r)for(const e in r)r.hasOwnProperty(e)&&this.xhr_.setRequestHeader(e,r[e].toString());return void 0!==s?this.xhr_.send(s):this.xhr_.send(),this.sendPromise_}getErrorCode(){if(!this.sent_)throw gw("cannot .getErrorCode() before sending");return this.errorCode_}getStatus(){if(!this.sent_)throw gw("cannot .getStatus() before sending");try{return this.xhr_.status}catch(e){return-1}}getResponse(){if(!this.sent_)throw gw("cannot .getResponse() before sending");return this.xhr_.response}getErrorText(){if(!this.sent_)throw gw("cannot .getErrorText() before sending");return this.xhr_.statusText}abort(){this.xhr_.abort()}getResponseHeader(e){return this.xhr_.getResponseHeader(e)}addUploadProgressListener(e){null!=this.xhr_.upload&&this.xhr_.upload.addEventListener("progress",e)}removeUploadProgressListener(e){null!=this.xhr_.upload&&this.xhr_.upload.removeEventListener("progress",e)}}class yE extends EE{initXhr(){this.xhr_.responseType="text"}}function DE(){return new yE}class _E{isExponentialBackoffExpired(){return this.sleepTime>this.maxSleepTime}constructor(e,t,n=null){this._transferred=0,this._needToFetchStatus=!1,this._needToFetchMetadata=!1,this._observers=[],this._error=void 0,this._uploadUrl=void 0,this._request=void 0,this._chunkMultiplier=1,this._resolve=void 0,this._reject=void 0,this._ref=e,this._blob=t,this._metadata=n,this._mappings=zw(),this._resumable=this._shouldDoResumable(this._blob),this._state="running",this._errorHandler=e=>{if(this._request=void 0,this._chunkMultiplier=1,e._codeEquals(ow.CANCELED))this._needToFetchStatus=!0,this.completeTransitions_();else{const t=this.isExponentialBackoffExpired();if(Iw(e.status,[])){if(!t)return this.sleepTime=Math.max(2*this.sleepTime,1e3),this._needToFetchStatus=!0,void this.completeTransitions_();e=uw()}this._error=e,this._transition("error")}},this._metadataErrorHandler=e=>{this._request=void 0,e._codeEquals(ow.CANCELED)?this.completeTransitions_():(this._error=e,this._transition("error"))},this.sleepTime=0,this.maxSleepTime=this._ref.storage.maxUploadRetryTime,this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t,this._start()}),this._promise.then(null,()=>{})}_makeProgressCallback(){const e=this._transferred;return t=>this._updateProgress(e+t)}_shouldDoResumable(e){return e.size()>262144}_start(){"running"===this._state&&void 0===this._request&&(this._resumable?void 0===this._uploadUrl?this._createResumable():this._needToFetchStatus?this._fetchStatus():this._needToFetchMetadata?this._fetchMetadata():this.pendingTimeout=setTimeout(()=>{this.pendingTimeout=void 0,this._continueUpload()},this.sleepTime):this._oneShotUpload())}_resolveToken(e){Promise.all([this._ref.storage._getAuthToken(),this._ref.storage._getAppCheckToken()]).then(([t,n])=>{switch(this._state){case"running":e(t,n);break;case"canceling":this._transition("canceled");break;case"pausing":this._transition("paused")}})}_createResumable(){this._resolveToken((e,t)=>{const n=function(e,t,n,s,r){const i=t.bucketOnlyServerUrl(),a=oE(t,s,r),o={name:a.fullPath},B=bw(i,e.host,e._protocol),c={"X-Goog-Upload-Protocol":"resumable","X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":`${s.size()}`,"X-Goog-Upload-Header-Content-Type":a.contentType,"Content-Type":"application/json; charset=utf-8"},l=Ww(a,n),u=e.maxUploadRetryTime,h=new eE(B,"POST",function(e){let t;cE(e);try{t=e.getResponseHeader("X-Goog-Upload-URL")}catch(e){tE(!1)}return tE(Ew(t)),t},u);return h.urlParams=o,h.headers=c,h.body=l,h.errorHandler=rE(t),h}(this._ref.storage,this._ref._location,this._mappings,this._blob,this._metadata),s=this._ref.storage._makeRequest(n,DE,e,t);this._request=s,s.getPromise().then(e=>{this._request=void 0,this._uploadUrl=e,this._needToFetchStatus=!1,this.completeTransitions_()},this._errorHandler)})}_fetchStatus(){const e=this._uploadUrl;this._resolveToken((t,n)=>{const s=function(e,t,n,s){const r=e.maxUploadRetryTime,i=new eE(n,"POST",function(e){const t=cE(e,["active","final"]);let n=null;try{n=e.getResponseHeader("X-Goog-Upload-Size-Received")}catch(e){tE(!1)}n||tE(!1);const r=Number(n);return tE(!isNaN(r)),new BE(r,s.size(),"final"===t)},r);return i.headers={"X-Goog-Upload-Command":"query"},i.errorHandler=rE(t),i}(this._ref.storage,this._ref._location,e,this._blob),r=this._ref.storage._makeRequest(s,DE,t,n);this._request=r,r.getPromise().then(e=>{this._request=void 0,this._updateProgress(e.current),this._needToFetchStatus=!1,e.finalized&&(this._needToFetchMetadata=!0),this.completeTransitions_()},this._errorHandler)})}_continueUpload(){const e=lE*this._chunkMultiplier,t=new BE(this._transferred,this._blob.size()),n=this._uploadUrl;this._resolveToken((s,r)=>{let i;try{i=uE(this._ref._location,this._ref.storage,n,this._blob,e,this._mappings,t,this._makeProgressCallback())}catch(e){return this._error=e,void this._transition("error")}const a=this._ref.storage._makeRequest(i,DE,s,r,!1);this._request=a,a.getPromise().then(e=>{this._increaseMultiplier(),this._request=void 0,this._updateProgress(e.current),e.finalized?(this._metadata=e.metadata,this._transition("success")):this.completeTransitions_()},this._errorHandler)})}_increaseMultiplier(){2*(lE*this._chunkMultiplier)<33554432&&(this._chunkMultiplier*=2)}_fetchMetadata(){this._resolveToken((e,t)=>{const n=function(e,t,n){const s=bw(t.fullServerUrl(),e.host,e._protocol),r=e.maxOperationRetryTime,i=new eE(s,"GET",nE(e,n),r);return i.errorHandler=iE(t),i}(this._ref.storage,this._ref._location,this._mappings),s=this._ref.storage._makeRequest(n,DE,e,t);this._request=s,s.getPromise().then(e=>{this._request=void 0,this._metadata=e,this._transition("success")},this._metadataErrorHandler)})}_oneShotUpload(){this._resolveToken((e,t)=>{const n=function(e,t,n,s,r){const i=t.bucketOnlyServerUrl(),a={"X-Goog-Upload-Protocol":"multipart"},o=function(){let e="";for(let t=0;t<2;t++)e+=Math.random().toString().slice(2);return e}();a["Content-Type"]="multipart/related; boundary="+o;const B=oE(t,s,r),c="--"+o+"\r\nContent-Type: application/json; charset=utf-8\r\n\r\n"+Ww(B,n)+"\r\n--"+o+"\r\nContent-Type: "+B.contentType+"\r\n\r\n",l="\r\n--"+o+"--",u=Hw.getBlob(c,s,l);if(null===u)throw pw();const h={name:B.fullPath},p=bw(i,e.host,e._protocol),d=e.maxUploadRetryTime,f=new eE(p,"POST",nE(e,n),d);return f.urlParams=h,f.headers=a,f.body=u.uploadData(),f.errorHandler=rE(t),f}(this._ref.storage,this._ref._location,this._mappings,this._blob,this._metadata),s=this._ref.storage._makeRequest(n,DE,e,t);this._request=s,s.getPromise().then(e=>{this._request=void 0,this._metadata=e,this._updateProgress(this._blob.size()),this._transition("success")},this._errorHandler)})}_updateProgress(e){const t=this._transferred;this._transferred=e,this._transferred!==t&&this._notifyObservers()}_transition(e){if(this._state!==e)switch(e){case"canceling":case"pausing":this._state=e,void 0!==this._request?this._request.cancel():this.pendingTimeout&&(clearTimeout(this.pendingTimeout),this.pendingTimeout=void 0,this.completeTransitions_());break;case"running":const t="paused"===this._state;this._state=e,t&&(this._notifyObservers(),this._start());break;case"paused":case"error":case"success":this._state=e,this._notifyObservers();break;case"canceled":this._error=hw(),this._state=e,this._notifyObservers()}}completeTransitions_(){switch(this._state){case"pausing":this._transition("paused");break;case"canceling":this._transition("canceled");break;case"running":this._start()}}get snapshot(){const e=gE(this._state);return{bytesTransferred:this._transferred,totalBytes:this._blob.size(),state:e,metadata:this._metadata,task:this,ref:this._ref}}on(e,t,n,s){const r=new mE(t||void 0,n||void 0,s||void 0);return this._addObserver(r),()=>{this._removeObserver(r)}}then(e,t){return this._promise.then(e,t)}catch(e){return this.then(null,e)}_addObserver(e){this._observers.push(e),this._notifyObserver(e)}_removeObserver(e){const t=this._observers.indexOf(e);-1!==t&&this._observers.splice(t,1)}_notifyObservers(){this._finishPromise();this._observers.slice().forEach(e=>{this._notifyObserver(e)})}_finishPromise(){if(void 0!==this._resolve){let e=!0;switch(gE(this._state)){case dE:wE(this._resolve.bind(null,this.snapshot))();break;case fE:case CE:wE(this._reject.bind(null,this._error))();break;default:e=!1}e&&(this._resolve=void 0,this._reject=void 0)}}_notifyObserver(e){switch(gE(this._state)){case hE:case pE:e.next&&wE(e.next.bind(e,this.snapshot))();break;case dE:e.complete&&wE(e.complete.bind(e))();break;default:e.error&&wE(e.error.bind(e,this._error))()}}resume(){const e="paused"===this._state||"pausing"===this._state;return e&&this._transition("running"),e}pause(){const e="running"===this._state;return e&&this._transition("pausing"),e}cancel(){const e="running"===this._state||"pausing"===this._state;return e&&this._transition("canceling"),e}}class bE{constructor(e,t){this._service=e,this._location=t instanceof mw?t:mw.makeFromUrl(t,e.host)}toString(){return"gs://"+this._location.bucket+"/"+this._location.path}_newRef(e,t){return new bE(e,t)}get root(){const e=new mw(this._location.bucket,"");return this._newRef(this._service,e)}get bucket(){return this._location.bucket}get fullPath(){return this._location.path}get name(){return jw(this._location.path)}get storage(){return this._service}get parent(){const e=function(e){if(0===e.length)return null;const t=e.lastIndexOf("/");return-1===t?"":e.slice(0,t)}(this._location.path);if(null===e)return null;const t=new mw(this._location.bucket,e);return new bE(this._service,t)}_throwIfRoot(e){if(""===this._location.path)throw function(e){return new aw(ow.INVALID_ROOT_OPERATION,"The operation '"+e+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}(e)}}function vE(e){const t={prefixes:[],items:[]};return IE(e,t).then(()=>t)}async function IE(e,t,n){const s={pageToken:n},r=await function(e,t){null!=t&&"number"==typeof t.maxResults&&_w("options.maxResults",1,1e3,t.maxResults);const n=t||{},s=aE(e.storage,e._location,"/",n.pageToken,n.maxResults);return e.storage.makeRequestWithTokens(s,DE)}(e,s);t.prefixes.push(...r.prefixes),t.items.push(...r.items),null!=r.nextPageToken&&await IE(e,t,r.nextPageToken)}function TE(e){e._throwIfRoot("getDownloadURL");const t=function(e,t,n){const s=bw(t.fullServerUrl(),e.host,e._protocol),r=e.maxOperationRetryTime,i=new eE(s,"GET",sE(e,n),r);return i.errorHandler=iE(t),i}(e.storage,e._location,zw());return e.storage.makeRequestWithTokens(t,DE).then(e=>{if(null===e)throw new aw(ow.NO_DOWNLOAD_URL,"The given file does not have any download URLs.");return e})}function OE(e){e._throwIfRoot("deleteObject");const t=function(e,t){const n=bw(t.fullServerUrl(),e.host,e._protocol),s=e.maxOperationRetryTime,r=new eE(n,"DELETE",function(e,t){},s);return r.successCodes=[200,204],r.errorHandler=iE(t),r}(e.storage,e._location);return e.storage.makeRequestWithTokens(t,DE)}function AE(e,t){if(e instanceof RE){const n=e;if(null==n._bucket)throw new aw(ow.NO_DEFAULT_BUCKET,"No default bucket found. Did you set the '"+iw+"' property when initializing the app?");const s=new bE(n,n._bucket);return null!=t?AE(s,t):s}return void 0!==t?function(e,t){const n=function(e,t){const n=t.split("/").filter(e=>e.length>0).join("/");return 0===e.length?n:e+"/"+n}(e._location.path,t),s=new mw(e._location.bucket,n);return new bE(e.storage,s)}(e,t):e}function SE(e,t){if(t&&/^[A-Za-z]+:\/\//.test(t)){if(e instanceof RE)return new bE(e,t);throw dw("To use ref(service, url), the first argument must be a Storage instance.")}return AE(e,t)}function NE(e,t){const n=t?.[iw];return null==n?null:mw.makeFromBucketSpec(n,e)}class RE{constructor(e,t,n,s,r,i=!1){this.app=e,this._authProvider=t,this._appCheckProvider=n,this._url=s,this._firebaseVersion=r,this._isUsingEmulator=i,this._bucket=null,this._host=rw,this._protocol="https",this._appId=null,this._deleted=!1,this._maxOperationRetryTime=12e4,this._maxUploadRetryTime=6e5,this._requests=new Set,this._bucket=null!=s?mw.makeFromBucketSpec(s,this._host):NE(this._host,this.app.options)}get host(){return this._host}set host(e){this._host=e,null!=this._url?this._bucket=mw.makeFromBucketSpec(this._url,e):this._bucket=NE(e,this.app.options)}get maxUploadRetryTime(){return this._maxUploadRetryTime}set maxUploadRetryTime(e){_w("time",0,Number.POSITIVE_INFINITY,e),this._maxUploadRetryTime=e}get maxOperationRetryTime(){return this._maxOperationRetryTime}set maxOperationRetryTime(e){_w("time",0,Number.POSITIVE_INFINITY,e),this._maxOperationRetryTime=e}async _getAuthToken(){if(this._overrideAuthToken)return this._overrideAuthToken;const e=this._authProvider.getImmediate({optional:!0});if(e){const t=await e.getToken();if(null!==t)return t.accessToken}return null}async _getAppCheckToken(){if(hr(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const e=this._appCheckProvider.getImmediate({optional:!0});if(e){return(await e.getToken()).token}return null}_delete(){return this._deleted||(this._deleted=!0,this._requests.forEach(e=>e.cancel()),this._requests.clear()),Promise.resolve()}_makeStorageReference(e){return new bE(this,e)}_makeRequest(e,t,n,s,r=!0){if(this._deleted)return new ww(fw());{const i=function(e,t,n,s,r,i,a=!0,o=!1){const B=vw(e.urlParams),c=e.url+B,l=Object.assign({},e.headers);return function(e,t){t&&(e["X-Firebase-GMPID"]=t)}(l,t),function(e,t){null!==t&&t.length>0&&(e.Authorization="Firebase "+t)}(l,n),function(e,t){e["X-Firebase-Storage-Version"]="webjs/"+(t??"AppManager")}(l,i),function(e,t){null!==t&&(e["X-Firebase-AppCheck"]=t)}(l,s),new Tw(c,e.method,l,e.body,e.successCodes,e.additionalRetryCodes,e.handler,e.errorHandler,e.timeout,e.progressCallback,r,a,o)}(e,this._appId,n,s,t,this._firebaseVersion,r,this._isUsingEmulator);return this._requests.add(i),i.getPromise().then(()=>this._requests.delete(i),()=>this._requests.delete(i)),i}}async makeRequestWithTokens(e,t){const[n,s]=await Promise.all([this._getAuthToken(),this._getAppCheckToken()]);return this._makeRequest(e,t,n,s).getPromise()}}const kE="@firebase/storage",LE="0.14.5",xE="storage";function FE(e,t,n){return function(e,t,n){return e._throwIfRoot("uploadBytesResumable"),new _E(e,new Hw(t),n)}(e=Xn(e),t,n)}function PE(e){return vE(e=Xn(e))}function ME(e){return OE(e=Xn(e))}function GE(e,t){return SE(e=Xn(e),t)}function UE(e=gr(),t){const n=ur(e=Xn(e),xE).getImmediate({identifier:t}),s=Nn("storage");return s&&function(e,t,n,s={}){!function(e,t,n,s={}){e.host=`${t}:${n}`;const r=Zn(t);r&&es(`https://${e.host}/b`),e._isUsingEmulator=!0,e._protocol=r?"https":"http";const{mockUserToken:i}=s;i&&(e._overrideAuthToken="string"==typeof i?i:xn(i,e.app.options.projectId))}(e,t,n,s)}(n,...s),n}function HE(e,{instanceIdentifier:t}){const n=e.getProvider("app").getImmediate(),s=e.getProvider("auth-internal"),r=e.getProvider("app-check-internal");return new RE(n,s,r,t,fr)}lr(new ts(xE,HE,"PUBLIC").setMultipleInstances(!0)),mr(kE,LE,""),mr(kE,LE,"esm2020");let VE,jE,$E,JE,qE={},zE=null,KE=!1;const QE=[];let WE;function YE(){return WE}function XE(){return KE}function ZE(e){KE?e():QE.push(e)}function ey(){const e="undefined"==typeof process?void 0:process.env,t=e?.FIREBASE_CONFIG;if(!t)return null;const n=JSON.parse(t);return n&&n.apiKey?n:null}function ty(e){if(e&&Object.prototype.hasOwnProperty.call(e,"actionCodeSettings")&&(WE=e.actionCodeSettings),KE){if(e?.app&&e.app!==VE)throw new Error("pwa-auth: Firebase app is already set");return VE}if(e?.app)VE=e.app,qE=VE.options;else{const t=e?.config??ey();if(!t)throw new Error("pwa-auth: pass initialize({ config }) or set window.process.env.FIREBASE_CONFIG");qE=t,VE=Cr(qE)}return jE=function(e){const t="object"==typeof e?e:gr(),n="string"==typeof e?e:zl,s=ur(t,"firestore").getImmediate({identifier:n});if(!s._initialized){const e=Nn("firestore");e&&vd(s,...e)}return s}(VE),$E=UE(VE),JE=$o(VE),zE=JE.currentUser,KE=!0,QE.splice(0).forEach(e=>e()),VE}const ny=ey();ny&&ty({config:ny});const sy="pwa-auth-changed",ry="pwa-login",iy="pwa-logout",ay="pwa-signup",oy="pwa-account-deleted",By="pwa-profile-updated",cy="pwa-email-changed",ly="pwa-password-changed",uy="pwa-reset-sent",hy="pwa-drawer-toggle",py="pwa-settings",dy="pwa-auth-error",fy="pwa-verification-sent",Cy="pwa-email-verified",gy={authChanged:sy,login:ry,logout:iy,signup:ay,accountDeleted:oy,profileUpdated:By,emailChanged:cy,passwordChanged:ly,resetSent:uy,drawerToggle:hy,settings:py,authError:dy,verificationSent:fy,emailVerified:Cy},my={bubbles:!0,composed:!0};function wy(e){return e?{uid:e.uid,displayName:e.displayName,email:e.email,photoURL:e.photoURL,emailVerified:!0===e.emailVerified}:null}function Ey(e,t){window.dispatchEvent(new CustomEvent(e,{...my,detail:t}))}function yy(e){if("object"==typeof e&&null!==e&&"code"in e){const t=String(e.code);return{code:t,message:e instanceof Error?e.message:t}}return{code:"pwa/unknown",message:e instanceof Error?e.message:"Authentication failed"}}const Dy=128,_y="At least 8 characters. A passphrase works well.",by="Use at least 8 characters.",vy="Use at most 128 characters.",Iy="Passwords don't match.";function Ty(e){return e.length<8?{code:"pwa/short-password",message:by}:e.length>Dy?{code:"pwa/long-password",message:vy}:null}const Oy={"auth/invalid-email":"Enter a valid email address.","auth/user-not-found":"No account uses that email.","auth/wrong-password":"That password is wrong.","auth/invalid-credential":"That email or password is wrong.","auth/invalid-login-credentials":"That email or password is wrong.","auth/user-token-expired":"This account is no longer available.","auth/invalid-user-token":"This account is no longer available.","auth/user-disabled":"This account is disabled.","auth/email-already-in-use":"An account already uses that email.","auth/weak-password":by,"auth/too-many-requests":"Too many tries. Wait and try again.","auth/network-request-failed":"Network problem. Try again.","auth/requires-recent-login":"Sign in again, then retry.","pwa/missing-email":"Enter an email address.","pwa/invalid-email":"Enter a valid email address.","pwa/missing-password":"Enter a password.","pwa/short-password":by,"pwa/long-password":vy,"pwa/current-password":"Enter your current password.","pwa/password-mismatch":Iy,"pwa/weak-password":by,"pwa/signed-out":"Sign in first.","pwa/missing-file":"Choose a photo first.","pwa/not-ready":"Sign-in is not ready yet.","pwa/unknown":"Something went wrong. Try again."};function Ay(e){const t=yy(e);return Oy[t.code]??"Something went wrong. Try again."}const Sy=i`
216
+ `,bn=function(e){const t=[];let n=0;for(let s=0;s<e.length;s++){let r=e.charCodeAt(s);r<128?t[n++]=r:r<2048?(t[n++]=r>>6|192,t[n++]=63&r|128):55296==(64512&r)&&s+1<e.length&&56320==(64512&e.charCodeAt(s+1))?(r=65536+((1023&r)<<10)+(1023&e.charCodeAt(++s)),t[n++]=r>>18|240,t[n++]=r>>12&63|128,t[n++]=r>>6&63|128,t[n++]=63&r|128):(t[n++]=r>>12|224,t[n++]=r>>6&63|128,t[n++]=63&r|128)}return t},vn={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:"function"==typeof atob,encodeByteArray(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,s=[];for(let t=0;t<e.length;t+=3){const r=e[t],i=t+1<e.length,a=i?e[t+1]:0,o=t+2<e.length,B=o?e[t+2]:0,c=r>>2,l=(3&r)<<4|a>>4;let u=(15&a)<<2|B>>6,h=63&B;o||(h=64,i||(u=64)),s.push(n[c],n[l],n[u],n[h])}return s.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(bn(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):function(e){const t=[];let n=0,s=0;for(;n<e.length;){const r=e[n++];if(r<128)t[s++]=String.fromCharCode(r);else if(r>191&&r<224){const i=e[n++];t[s++]=String.fromCharCode((31&r)<<6|63&i)}else if(r>239&&r<365){const i=((7&r)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536;t[s++]=String.fromCharCode(55296+(i>>10)),t[s++]=String.fromCharCode(56320+(1023&i))}else{const i=e[n++],a=e[n++];t[s++]=String.fromCharCode((15&r)<<12|(63&i)<<6|63&a)}}return t.join("")}(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();const n=t?this.charToByteMapWebSafe_:this.charToByteMap_,s=[];for(let t=0;t<e.length;){const r=n[e.charAt(t++)],i=t<e.length?n[e.charAt(t)]:0;++t;const a=t<e.length?n[e.charAt(t)]:64;++t;const o=t<e.length?n[e.charAt(t)]:64;if(++t,null==r||null==i||null==a||null==o)throw new In;const B=r<<2|i>>4;if(s.push(B),64!==a){const e=i<<4&240|a>>2;if(s.push(e),64!==o){const e=a<<6&192|o;s.push(e)}}}return s},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};class In extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const Tn=function(e){return function(e){const t=bn(e);return vn.encodeByteArray(t,!0)}(e).replace(/\./g,"")},An=function(e){try{return vn.decodeString(e,!0)}catch(e){}return null};const On=()=>function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("Unable to locate global object.")}().__FIREBASE_DEFAULTS__,Sn=()=>{try{return On()||(()=>{if("undefined"==typeof process||void 0===process.env)return;const e=process.env.__FIREBASE_DEFAULTS__;return e?JSON.parse(e):void 0})()||(()=>{if("undefined"==typeof document)return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch(e){return}const t=e&&An(e[1]);return t&&JSON.parse(t)})()}catch(e){return}},Nn=e=>Sn()?.emulatorHosts?.[e],Rn=e=>{const t=Nn(e);if(!t)return;const n=t.lastIndexOf(":");if(n<=0||n+1===t.length)throw new Error(`Invalid host ${t} with no separate hostname and port!`);const s=parseInt(t.substring(n+1),10);return"["===t[0]?[t.substring(1,n-1),s]:[t.substring(0,n),s]},kn=()=>Sn()?.config,Ln=e=>Sn()?.[`_${e}`];class xn{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(e){return(t,n)=>{t?this.reject(t):this.resolve(n),"function"==typeof e&&(this.promise.catch(()=>{}),1===e.length?e(t):e(t,n))}}}function Fn(e,t){if(e.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const n=t||"demo-project",s=e.iat||0,r=e.sub||e.user_id;if(!r)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const i={iss:`https://securetoken.google.com/${n}`,aud:n,iat:s,exp:s+3600,auth_time:s,sub:r,user_id:r,firebase:{sign_in_provider:"custom",identities:{}},...e};return[Tn(JSON.stringify({alg:"none",type:"JWT"})),Tn(JSON.stringify(i)),""].join(".")}function Pn(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function Mn(){const e="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0;return"object"==typeof e&&void 0!==e.id}function Gn(){return!function(){const e=Sn()?.forceEnvironment;if("node"===e)return!0;if("browser"===e)return!1;try{return"[object process]"===Object.prototype.toString.call(global.process)}catch(e){return!1}}()&&!!navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function Un(){try{return"object"==typeof indexedDB}catch(e){return!1}}function Hn(){return new Promise((e,t)=>{try{let n=!0;const s="validate-browser-context-for-indexeddb-analytics-module",r=self.indexedDB.open(s);r.onsuccess=()=>{r.result.close(),n||self.indexedDB.deleteDatabase(s),e(!0)},r.onupgradeneeded=()=>{n=!1},r.onerror=()=>{t(r.error?.message||"")}}catch(e){t(e)}})}function Vn(){return!("undefined"==typeof navigator||!navigator.cookieEnabled)}class jn extends Error{constructor(e,t,n){super(t),this.code=e,this.customData=n,this.name="FirebaseError",Object.setPrototypeOf(this,jn.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,$n.prototype.create)}}class $n{constructor(e,t,n){this.service=e,this.serviceName=t,this.errors=n}create(e,...t){const n=t[0]||{},s=`${this.service}/${e}`,r=this.errors[e],i=r?function(e,t){try{let n=0,s="";for(;n<e.length;){const r=e.indexOf("{$",n);if(-1===r){s+=e.substring(n);break}const i=e.indexOf("}",r+2);if(-1===i){s+=e.substring(n);break}const a=e.substring(r+2,i),o=t[a];s+=e.substring(n,r)+(null!=o?String(o):`<${a}?>`),n=i+1}return s}catch(t){return e}}(r,n):"Error",a=`${this.serviceName}: ${i} (${s}).`;return new jn(s,a,n)}}function Jn(e,t){if(e===t)return!0;const n=Object.keys(e),s=Object.keys(t);for(const r of n){if(!s.includes(r))return!1;const n=e[r],i=t[r];if(qn(n)&&qn(i)){if(!Jn(n,i))return!1}else if(n!==i)return!1}for(const e of s)if(!n.includes(e))return!1;return!0}function qn(e){return null!==e&&"object"==typeof e}function zn(e){const t=[];for(const[n,s]of Object.entries(e))Array.isArray(s)?s.forEach(e=>{t.push(encodeURIComponent(n)+"="+encodeURIComponent(e))}):t.push(encodeURIComponent(n)+"="+encodeURIComponent(s));return t.length?"&"+t.join("&"):""}function Kn(e){const t={};return e.replace(/^\?/,"").split("&").forEach(e=>{if(e){const[n,s]=e.split("=");t[decodeURIComponent(n)]=decodeURIComponent(s)}}),t}function Qn(e){const t=e.indexOf("?");if(!t)return"";const n=e.indexOf("#",t);return e.substring(t,n>0?n:void 0)}class Wn{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(()=>{e(this)}).catch(e=>{this.error(e)})}next(e){this.forEachObserver(t=>{t.next(e)})}error(e){this.forEachObserver(t=>{t.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,t,n){let s;if(void 0===e&&void 0===t&&void 0===n)throw new Error("Missing Observer.");s=function(e,t){if("object"!=typeof e||null===e)return!1;for(const n of t)if(n in e&&"function"==typeof e[n])return!0;return!1}(e,["next","error","complete"])?e:{next:e,error:t,complete:n},void 0===s.next&&(s.next=Yn),void 0===s.error&&(s.error=Yn),void 0===s.complete&&(s.complete=Yn);const r=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?s.error(this.finalError):s.complete()}catch(e){}}),this.observers.push(s),r}unsubscribeOne(e){void 0!==this.observers&&void 0!==this.observers[e]&&(delete this.observers[e],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t<this.observers.length;t++)this.sendOne(t,e)}sendOne(e,t){this.task.then(()=>{if(void 0!==this.observers&&void 0!==this.observers[e])try{t(this.observers[e])}catch(e){"undefined"!=typeof console&&console.error}})}close(e){this.finalized||(this.finalized=!0,void 0!==e&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function Yn(){}function Xn(e,t=1e3,n=2){const s=t*Math.pow(n,e),r=Math.round(.5*s*(Math.random()-.5)*2);return Math.min(144e5,s+r)}function Zn(e){return e&&e._delegate?e._delegate:e}function es(e){try{return(e.startsWith("http://")||e.startsWith("https://")?new URL(e).hostname:e).endsWith(".cloudworkstations.dev")}catch{return!1}}async function ts(e){return(await fetch(e,{credentials:"include"})).ok}class ns{constructor(e,t,n){this.name=e,this.instanceFactory=t,this.type=n,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}}const ss="[DEFAULT]";class rs{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){const e=new xn;if(this.instancesDeferred.set(t,e),this.isInitialized(t)||this.shouldAutoInitialize())try{const n=this.getOrInitializeService({instanceIdentifier:t});n&&e.resolve(n)}catch(e){}}return this.instancesDeferred.get(t).promise}getImmediate(e){const t=this.normalizeInstanceIdentifier(e?.identifier),n=e?.optional??!1;if(!this.isInitialized(t)&&!this.shouldAutoInitialize()){if(n)return null;throw Error(`Service ${this.name} is not available`)}try{return this.getOrInitializeService({instanceIdentifier:t})}catch(e){if(n)return null;throw e}}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(function(e){return"EAGER"===e.instantiationMode}(e))try{this.getOrInitializeService({instanceIdentifier:ss})}catch(e){}for(const[e,t]of this.instancesDeferred.entries()){const n=this.normalizeInstanceIdentifier(e);try{const e=this.getOrInitializeService({instanceIdentifier:n});t.resolve(e)}catch(e){}}}}clearInstance(e=ss){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(e=>"INTERNAL"in e).map(e=>e.INTERNAL.delete()),...e.filter(e=>"_delete"in e).map(e=>e._delete())])}isComponentSet(){return null!=this.component}isInitialized(e=ss){return this.instances.has(e)}getOptions(e=ss){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:t={}}=e,n=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(n))throw Error(`${this.name}(${n}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const s=this.getOrInitializeService({instanceIdentifier:n,options:t});for(const[e,t]of this.instancesDeferred.entries()){n===this.normalizeInstanceIdentifier(e)&&t.resolve(s)}return s}onInit(e,t){const n=this.normalizeInstanceIdentifier(t),s=this.onInitCallbacks.get(n)??new Set;s.add(e),this.onInitCallbacks.set(n,s);const r=this.instances.get(n);return r&&e(r,n),()=>{s.delete(e)}}invokeOnInitCallbacks(e,t){const n=this.onInitCallbacks.get(t);if(n)for(const s of n)try{s(e,t)}catch{}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let n=this.instances.get(e);if(!n&&this.component&&(n=this.component.instanceFactory(this.container,{instanceIdentifier:(s=e,s===ss?void 0:s),options:t}),this.instances.set(e,n),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(n,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,n)}catch{}var s;return n||null}normalizeInstanceIdentifier(e=ss){return this.component?this.component.multipleInstances?e:ss:e}shouldAutoInitialize(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode}}class is{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const t=this.getProvider(e.name);if(t.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const t=new rs(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}var as;!function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"}(as||(as={}));const os={debug:as.DEBUG,verbose:as.VERBOSE,info:as.INFO,warn:as.WARN,error:as.ERROR,silent:as.SILENT},Bs=as.INFO,cs={[as.DEBUG]:"log",[as.VERBOSE]:"log",[as.INFO]:"info",[as.WARN]:"warn",[as.ERROR]:"error"},ls=(e,t,...n)=>{if(t<e.logLevel)return;(new Date).toISOString();if(!cs[t])throw new Error(`Attempted to log a message with an invalid logType (value: ${t})`)};class us{constructor(e){this.name=e,this._logLevel=Bs,this._logHandler=ls,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in as))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel="string"==typeof e?os[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if("function"!=typeof e)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,as.DEBUG,...e),this._logHandler(this,as.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,as.VERBOSE,...e),this._logHandler(this,as.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,as.INFO,...e),this._logHandler(this,as.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,as.WARN,...e),this._logHandler(this,as.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,as.ERROR,...e),this._logHandler(this,as.ERROR,...e)}}let hs,ps;const ds=new WeakMap,fs=new WeakMap,Cs=new WeakMap,gs=new WeakMap,ms=new WeakMap;let ws={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return fs.get(e);if("objectStoreNames"===t)return e.objectStoreNames||Cs.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return Ds(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function Es(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(ps||(ps=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(_s(this),t),Ds(ds.get(this))}:function(...t){return Ds(e.apply(_s(this),t))}:function(t,...n){const s=e.call(_s(this),t,...n);return Cs.set(s,t.sort?t.sort():[t]),Ds(s)}}function ys(e){return"function"==typeof e?Es(e):(e instanceof IDBTransaction&&function(e){if(fs.has(e))return;const t=new Promise((t,n)=>{const s=()=>{e.removeEventListener("complete",r),e.removeEventListener("error",i),e.removeEventListener("abort",i)},r=()=>{t(),s()},i=()=>{n(e.error||new DOMException("AbortError","AbortError")),s()};e.addEventListener("complete",r),e.addEventListener("error",i),e.addEventListener("abort",i)});fs.set(e,t)}(e),t=e,(hs||(hs=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some(e=>t instanceof e)?new Proxy(e,ws):e);var t}function Ds(e){if(e instanceof IDBRequest)return function(e){const t=new Promise((t,n)=>{const s=()=>{e.removeEventListener("success",r),e.removeEventListener("error",i)},r=()=>{t(Ds(e.result)),s()},i=()=>{n(e.error),s()};e.addEventListener("success",r),e.addEventListener("error",i)});return t.then(t=>{t instanceof IDBCursor&&ds.set(t,e)}).catch(()=>{}),ms.set(t,e),t}(e);if(gs.has(e))return gs.get(e);const t=ys(e);return t!==e&&(gs.set(e,t),ms.set(t,e)),t}const _s=e=>ms.get(e);function bs(e,t,{blocked:n,upgrade:s,blocking:r,terminated:i}={}){const a=indexedDB.open(e,t),o=Ds(a);return s&&a.addEventListener("upgradeneeded",e=>{s(Ds(a.result),e.oldVersion,e.newVersion,Ds(a.transaction),e)}),n&&a.addEventListener("blocked",e=>n(e.oldVersion,e.newVersion,e)),o.then(e=>{i&&e.addEventListener("close",()=>i()),r&&e.addEventListener("versionchange",e=>r(e.oldVersion,e.newVersion,e))}).catch(()=>{}),o}const vs=["get","getKey","getAll","getAllKeys","count"],Is=["put","add","delete","clear"],Ts=new Map;function As(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(Ts.get(t))return Ts.get(t);const n=t.replace(/FromIndex$/,""),s=t!==n,r=Is.includes(n);if(!(n in(s?IDBIndex:IDBObjectStore).prototype)||!r&&!vs.includes(n))return;const i=async function(e,...t){const i=this.transaction(e,r?"readwrite":"readonly");let a=i.store;return s&&(a=a.index(t.shift())),(await Promise.all([a[n](...t),r&&i.done]))[0]};return Ts.set(t,i),i}ws=(e=>({...e,get:(t,n,s)=>As(t,n)||e.get(t,n,s),has:(t,n)=>!!As(t,n)||e.has(t,n)}))(ws);class Os{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(e=>{if(function(e){const t=e.getComponent();return"VERSION"===t?.type}(e)){const t=e.getImmediate();return`${t.library}/${t.version}`}return null}).filter(e=>e).join(" ")}}const Ss="@firebase/app",Ns="0.16.2",Rs=new us("@firebase/app"),ks="@firebase/app-compat",Ls="@firebase/analytics-compat",xs="@firebase/analytics",Fs="@firebase/app-check-compat",Ps="@firebase/app-check",Ms="@firebase/auth",Gs="@firebase/auth-compat",Us="@firebase/database",Hs="@firebase/data-connect",Vs="@firebase/database-compat",js="@firebase/functions",$s="@firebase/functions-compat",Js="@firebase/installations",qs="@firebase/installations-compat",zs="@firebase/messaging",Ks="@firebase/messaging-compat",Qs="@firebase/performance",Ws="@firebase/performance-compat",Ys="@firebase/remote-config",Xs="@firebase/remote-config-compat",Zs="@firebase/storage",er="@firebase/storage-compat",tr="@firebase/firestore",nr="@firebase/ai",sr="@firebase/firestore-compat",rr="firebase",ir="[DEFAULT]",ar={[Ss]:"fire-core",[ks]:"fire-core-compat",[xs]:"fire-analytics",[Ls]:"fire-analytics-compat",[Ps]:"fire-app-check",[Fs]:"fire-app-check-compat",[Ms]:"fire-auth",[Gs]:"fire-auth-compat",[Us]:"fire-rtdb",[Hs]:"fire-data-connect",[Vs]:"fire-rtdb-compat",[js]:"fire-fn",[$s]:"fire-fn-compat",[Js]:"fire-iid",[qs]:"fire-iid-compat",[zs]:"fire-fcm",[Ks]:"fire-fcm-compat",[Qs]:"fire-perf",[Ws]:"fire-perf-compat",[Ys]:"fire-rc",[Xs]:"fire-rc-compat",[Zs]:"fire-gcs",[er]:"fire-gcs-compat",[tr]:"fire-fst",[sr]:"fire-fst-compat",[nr]:"fire-vertex","fire-js":"fire-js",[rr]:"fire-js-all"},or=new Map,Br=new Map,cr=new Map;function lr(e,t){try{e.container.addComponent(t)}catch(n){Rs.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,n)}}function ur(e){const t=e.name;if(cr.has(t))return Rs.debug(`There were multiple attempts to register component ${t}.`),!1;cr.set(t,e);for(const t of or.values())lr(t,e);for(const t of Br.values())lr(t,e);return!0}function hr(e,t){const n=e.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),e.container.getProvider(t)}function pr(e){return null!=e&&void 0!==e.settings}const dr=new $n("app","Firebase",{"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 {$mismatchedParam}. Existing: '{$oldValue}'. New: '{$newValue}'.","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."});class fr{constructor(e,t,n){this._isDeleted=!1,this._options={...e},this._config={...t},this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=n,this.container.addComponent(new ns("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 dr.create("app-deleted",{appName:this._name})}}const Cr="12.19.0";function gr(e,t={}){let n=e;if("object"!=typeof t){t={name:t}}const s={name:ir,automaticDataCollectionEnabled:!0,...t},r=s.name;if("string"!=typeof r||!r)throw dr.create("bad-app-name",{appName:String(r)});if(n||(n=kn()),!n)throw dr.create("no-options");const i=or.get(r);if(i){if(Jn(n,i.options)){if(Jn(s,i.config))return i;throw dr.create("duplicate-app",{appName:r,mismatchedParam:"config",oldValue:JSON.stringify(i.config),newValue:JSON.stringify(s)})}throw dr.create("duplicate-app",{appName:r,mismatchedParam:"options",oldValue:JSON.stringify(i.options),newValue:JSON.stringify(n)})}const a=new is(r);for(const e of cr.values())a.addComponent(e);const o=new fr(n,s,a);return or.set(r,o),o}function mr(e=ir){const t=or.get(e);if(!t&&e===ir&&kn())return gr();if(!t)throw dr.create("no-app",{appName:e});return t}function wr(e,t,n){let s=ar[e]??e;n&&(s+=`-${n}`);const r=s.match(/\s|\//),i=t.match(/\s|\//);if(r||i){const e=[`Unable to register library "${s}" with version "${t}":`];return r&&e.push(`library name "${s}" contains illegal characters (whitespace or "/")`),r&&i&&e.push("and"),i&&e.push(`version name "${t}" contains illegal characters (whitespace or "/")`),void Rs.warn(e.join(" "))}ur(new ns(`${s}-version`,()=>({library:s,version:t}),"VERSION"))}const Er="firebase-heartbeat-store";let yr=null;function Dr(){return yr||(yr=bs("firebase-heartbeat-database",1,{upgrade:(e,t)=>{if(0===t)try{e.createObjectStore(Er)}catch(e){}}}).catch(e=>{throw dr.create("idb-open",{originalErrorMessage:e.message})})),yr}async function _r(e,t){try{const n=(await Dr()).transaction(Er,"readwrite"),s=n.objectStore(Er);await s.put(t,br(e)),await n.done}catch(e){if(e instanceof jn)Rs.warn(e.message);else{const t=dr.create("idb-set",{originalErrorMessage:e?.message});Rs.warn(t.message)}}}function br(e){return`${e.name}!${e.options.appId}`}class vr{constructor(e){this.container=e,this._heartbeatsCache=null;const t=this.container.getProvider("app").getImmediate();this._storage=new Tr(t),this._heartbeatsCachePromise=this._storage.read().then(e=>(this._heartbeatsCache=e,e))}async triggerHeartbeat(){try{const e=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),t=Ir();if(null==this._heartbeatsCache?.heartbeats&&(this._heartbeatsCache=await this._heartbeatsCachePromise,null==this._heartbeatsCache?.heartbeats))return;if(this._heartbeatsCache.lastSentHeartbeatDate===t||this._heartbeatsCache.heartbeats.some(e=>e.date===t))return;if(this._heartbeatsCache.heartbeats.push({date:t,agent:e}),this._heartbeatsCache.heartbeats.length>30){const e=function(e){if(0===e.length)return-1;let t=0,n=e[0].date;for(let s=1;s<e.length;s++)e[s].date<n&&(n=e[s].date,t=s);return t}(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(e,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(e){Rs.warn(e)}}async getHeartbeatsHeader(){try{if(null===this._heartbeatsCache&&await this._heartbeatsCachePromise,null==this._heartbeatsCache?.heartbeats||0===this._heartbeatsCache.heartbeats.length)return"";const e=Ir(),{heartbeatsToSend:t,unsentEntries:n}=function(e,t=1024){const n=[];let s=e.slice();for(const r of e){const e=n.find(e=>e.agent===r.agent);if(e){if(e.dates.push(r.date),Ar(n)>t){e.dates.pop();break}}else if(n.push({agent:r.agent,dates:[r.date]}),Ar(n)>t){n.pop();break}s=s.slice(1)}return{heartbeatsToSend:n,unsentEntries:s}}(this._heartbeatsCache.heartbeats),s=Tn(JSON.stringify({version:2,heartbeats:t}));return this._heartbeatsCache.lastSentHeartbeatDate=e,n.length>0?(this._heartbeatsCache.heartbeats=n,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),s}catch(e){return Rs.warn(e),""}}}function Ir(){return(new Date).toISOString().substring(0,10)}class Tr{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return!!Un()&&Hn().then(()=>!0).catch(()=>!1)}async read(){if(await this._canUseIndexedDBPromise){const e=await async function(e){try{const t=(await Dr()).transaction(Er),n=await t.objectStore(Er).get(br(e));return await t.done,n}catch(e){if(e instanceof jn)Rs.warn(e.message);else{const t=dr.create("idb-get",{originalErrorMessage:e?.message});Rs.warn(t.message)}}}(this.app);return e?.heartbeats?e:{heartbeats:[]}}return{heartbeats:[]}}async overwrite(e){if(await this._canUseIndexedDBPromise){const t=await this.read();return _r(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??t.lastSentHeartbeatDate,heartbeats:e.heartbeats})}}async add(e){if(await this._canUseIndexedDBPromise){const t=await this.read();return _r(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??t.lastSentHeartbeatDate,heartbeats:[...t.heartbeats,...e.heartbeats]})}}}function Ar(e){return Tn(JSON.stringify({version:2,heartbeats:e})).length}var Or;function Sr(){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."}}Or="",ur(new ns("platform-logger",e=>new Os(e),"PRIVATE")),ur(new ns("heartbeat",e=>new vr(e),"PRIVATE")),wr(Ss,Ns,Or),wr(Ss,Ns,"esm2020"),wr("fire-js","");const Nr=Sr,Rr=new $n("auth","Firebase",{"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."}),kr=new us("@firebase/auth");function Lr(e,...t){kr.logLevel<=as.WARN&&kr.warn(`Auth (${Cr}): ${e}`,...t)}function xr(e,...t){kr.logLevel<=as.ERROR&&kr.error(`Auth (${Cr}): ${e}`,...t)}function Fr(e,...t){throw Hr(e,...t)}function Pr(e,...t){return Hr(e,...t)}function Mr(e,t,n){const s={...Nr(),[t]:n};return new $n("auth","Firebase",s).create(t,{appName:e.name})}function Gr(e){return Mr(e,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function Ur(e,t,n){if(!(t instanceof n))throw n.name!==t.constructor.name&&Fr(e,"argument-error"),Mr(e,"argument-error",`Type of ${t.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function Hr(e,...t){if("string"!=typeof e){const n=t[0],s=[...t.slice(1)];return s[0]&&(s[0].appName=e.name),e._errorFactory.create(n,...s)}return Rr.create(e,...t)}function Vr(e,t,...n){if(!e)throw Hr(t,...n)}function jr(e){const t="INTERNAL ASSERTION FAILED: "+e;throw xr(t),new Error(t)}function $r(e,t){e||jr(t)}function Jr(){return"undefined"!=typeof self&&self.location?.href||""}function qr(){return"undefined"!=typeof self&&self.location?.protocol||null}function zr(){return"undefined"==typeof navigator||!navigator||!("onLine"in navigator)||"boolean"!=typeof navigator.onLine||"http:"!==qr()&&"https:"!==qr()&&!Mn()&&!("connection"in navigator)||navigator.onLine}class Kr{constructor(e,t){this.shortDelay=e,this.longDelay=t,$r(t>e,"Short delay should be less than long delay!"),this.isMobile="undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(Pn())||"object"==typeof navigator&&"ReactNative"===navigator.product}get(){return zr()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}function Qr(e,t){$r(e.emulator,"Emulator should always be set here");const{url:n}=e.emulator;return t?`${n}${t.startsWith("/")?t.slice(1):t}`:n}class Wr{static initialize(e,t,n){this.fetchImpl=e,t&&(this.headersImpl=t),n&&(this.responseImpl=n)}static fetch(){return this.fetchImpl?this.fetchImpl:"undefined"!=typeof self&&"fetch"in self?self.fetch:"undefined"!=typeof globalThis&&globalThis.fetch?globalThis.fetch:"undefined"!=typeof fetch?fetch:void jr("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){return this.headersImpl?this.headersImpl:"undefined"!=typeof self&&"Headers"in self?self.Headers:"undefined"!=typeof globalThis&&globalThis.Headers?globalThis.Headers:"undefined"!=typeof Headers?Headers:void jr("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){return this.responseImpl?this.responseImpl:"undefined"!=typeof self&&"Response"in self?self.Response:"undefined"!=typeof globalThis&&globalThis.Response?globalThis.Response:"undefined"!=typeof Response?Response:void jr("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}const Yr={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"},Xr=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],Zr=new Kr(3e4,6e4);function ei(e,t){return e.tenantId&&!t.tenantId?{...t,tenantId:e.tenantId}:t}async function ti(e,t,n,s,r={}){return ni(e,r,async()=>{let r={},i={};s&&("GET"===t?i=s:r={body:JSON.stringify(s)});const a=zn({...i,key:e.config.apiKey}).slice(1),o=await e._getAdditionalHeaders();o["Content-Type"]="application/json",e.languageCode&&(o["X-Firebase-Locale"]=e.languageCode);const B={method:t,headers:o,...r};return"undefined"!=typeof navigator&&"Cloudflare-Workers"===navigator.userAgent||(B.referrerPolicy="strict-origin-when-cross-origin"),e.emulatorConfig&&es(e.emulatorConfig.host)&&(B.credentials="include"),Wr.fetch()(await ri(e,e.config.apiHost,n,a),B)})}async function ni(e,t,n){e._canInitEmulator=!1;const s={...Yr,...t};try{const t=new ai(e),r=await Promise.race([n(),t.promise]);t.clearNetworkTimeout();const i=await r.json();if("needConfirmation"in i)throw oi(e,"account-exists-with-different-credential",i);if(r.ok&&!("errorMessage"in i))return i;{const t=r.ok?i.errorMessage:i.error.message,[n,a]=t.split(" : ");if("FEDERATED_USER_ID_ALREADY_LINKED"===n)throw oi(e,"credential-already-in-use",i);if("EMAIL_EXISTS"===n)throw oi(e,"email-already-in-use",i);if("USER_DISABLED"===n)throw oi(e,"user-disabled",i);const o=s[n]||n.toLowerCase().replace(/[_\s]+/g,"-");if(a)throw Mr(e,o,a);Fr(e,o)}}catch(t){if(t instanceof jn)throw t;Fr(e,"network-request-failed",{message:String(t)})}}async function si(e,t,n,s,r={}){const i=await ti(e,t,n,s,r);return"mfaPendingCredential"in i&&Fr(e,"multi-factor-auth-required",{_serverResponse:i}),i}async function ri(e,t,n,s){const r=`${t}${n}?${s}`,i=e,a=i.config.emulator?Qr(e.config,r):`${e.config.apiScheme}://${r}`;if(Xr.includes(n)&&(await i._persistenceManagerAvailable,"COOKIE"===i._getPersistenceType())){return i._getPersistence()._getFinalTarget(a).toString()}return a}function ii(e){switch(e){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}class ai{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((e,t)=>{this.timer=setTimeout(()=>t(Pr(this.auth,"network-request-failed")),Zr.get())})}}function oi(e,t,n){const s={appName:e.name};n.email&&(s.email=n.email),n.phoneNumber&&(s.phoneNumber=n.phoneNumber);const r=Pr(e,t,s);return r.customData._tokenResponse=n,r}function Bi(e){return void 0!==e&&void 0!==e.enterprise}class ci{constructor(e){if(this.siteKey="",this.recaptchaEnforcementState=[],void 0===e.recaptchaKey)throw new Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.recaptchaEnforcementState=e.recaptchaEnforcementState}getProviderEnforcementState(e){if(!this.recaptchaEnforcementState||0===this.recaptchaEnforcementState.length)return null;for(const t of this.recaptchaEnforcementState)if(t.provider&&t.provider===e)return ii(t.enforcementState);return null}isProviderEnabled(e){return"ENFORCE"===this.getProviderEnforcementState(e)||"AUDIT"===this.getProviderEnforcementState(e)}isAnyProviderEnabled(){return this.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")||this.isProviderEnabled("PHONE_PROVIDER")}}async function li(e,t){return ti(e,"POST","/v1/accounts:lookup",t)}function ui(e){if(e)try{const t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch(e){}}function hi(e){return 1e3*Number(e)}function pi(e){const[t,n,s]=e.split(".");if(void 0===t||void 0===n||void 0===s)return xr("JWT malformed, contained fewer than 3 sections"),null;try{const e=An(n);return e?JSON.parse(e):(xr("Failed to decode base64 JWT payload"),null)}catch(e){return xr("Caught error parsing JWT payload as JSON",e?.toString()),null}}function di(e){const t=pi(e);return Vr(t,"internal-error"),Vr(void 0!==t.exp,"internal-error"),Vr(void 0!==t.iat,"internal-error"),Number(t.exp)-Number(t.iat)}async function fi(e,t,n=!1){if(n)return t;try{return await t}catch(t){throw t instanceof jn&&function({code:e}){return"auth/user-disabled"===e||"auth/user-token-expired"===e}(t)&&e.auth.currentUser===e&&await e.auth.signOut(),t}}class Ci{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,null!==this.timerId&&clearTimeout(this.timerId))}getInterval(e){if(e){const e=this.errorBackoff;return this.errorBackoff=Math.min(2*this.errorBackoff,96e4),e}{this.errorBackoff=3e4;const e=(this.user.stsTokenManager.expirationTime??0)-Date.now()-3e5;return Math.max(0,e)}}schedule(e=!1){if(!this.isRunning)return;const t=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},t)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){return void("auth/network-request-failed"===e?.code&&this.schedule(!0))}this.schedule()}}class gi{constructor(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}_initializeTime(){this.lastSignInTime=ui(this.lastLoginAt),this.creationTime=ui(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}async function mi(e){const t=e.auth,n=await e.getIdToken(),s=await fi(e,li(t,{idToken:n}));Vr(s?.users.length,t,"internal-error");const r=s.users[0];e._notifyReloadListener(r);const i=r.providerUserInfo?.length?wi(r.providerUserInfo):[],a=function(e,t){const n=e.filter(e=>!t.some(t=>t.providerId===e.providerId));return[...n,...t]}(e.providerData,i),o=e.isAnonymous,B=!(e.email&&r.passwordHash||a?.length),c=!!o&&B,l={uid:r.localId,displayName:r.displayName||null,photoURL:r.photoUrl||null,email:r.email||null,emailVerified:r.emailVerified||!1,phoneNumber:r.phoneNumber||null,tenantId:r.tenantId||null,providerData:a,metadata:new gi(r.createdAt,r.lastLoginAt),isAnonymous:c};Object.assign(e,l)}function wi(e){return e.map(({providerId:e,...t})=>({providerId:e,uid:t.rawId||"",displayName:t.displayName||null,email:t.email||null,phoneNumber:t.phoneNumber||null,photoURL:t.photoUrl||null}))}class Ei{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){Vr(e.idToken,"internal-error"),Vr(void 0!==e.idToken,"internal-error"),Vr(void 0!==e.refreshToken,"internal-error");const t="expiresIn"in e&&void 0!==e.expiresIn?Number(e.expiresIn):di(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}updateFromIdToken(e){Vr(0!==e.length,"internal-error");const t=di(e);this.updateTokensAndExpiration(e,null,t)}async getToken(e,t=!1){return t||!this.accessToken||this.isExpired?(Vr(this.refreshToken,e,"user-token-expired"),this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null):this.accessToken}clearRefreshToken(){this.refreshToken=null}async refresh(e,t){const{accessToken:n,refreshToken:s,expiresIn:r}=await async function(e,t){const n=await ni(e,{},async()=>{const n=zn({grant_type:"refresh_token",refresh_token:t}).slice(1),{tokenApiHost:s,apiKey:r}=e.config,i=await ri(e,s,"/v1/token",`key=${r}`),a=await e._getAdditionalHeaders();a["Content-Type"]="application/x-www-form-urlencoded";const o={method:"POST",headers:a,body:n};return e.emulatorConfig&&es(e.emulatorConfig.host)&&(o.credentials="include"),Wr.fetch()(i,o)});return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}(e,t);this.updateTokensAndExpiration(n,s,Number(r))}updateTokensAndExpiration(e,t,n){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+1e3*n}static fromJSON(e,t){const{refreshToken:n,accessToken:s,expirationTime:r}=t,i=new Ei;return n&&(Vr("string"==typeof n,"internal-error",{appName:e}),i.refreshToken=n),s&&(Vr("string"==typeof s,"internal-error",{appName:e}),i.accessToken=s),r&&(Vr("number"==typeof r,"internal-error",{appName:e}),i.expirationTime=r),i}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 Ei,this.toJSON())}_performRefresh(){return jr("not implemented")}}function yi(e,t){Vr("string"==typeof e||void 0===e,"internal-error",{appName:t})}class Di{constructor({uid:e,auth:t,stsTokenManager:n,...s}){this.providerId="firebase",this.proactiveRefresh=new Ci(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=e,this.auth=t,this.stsTokenManager=n,this.accessToken=n.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 gi(s.createdAt||void 0,s.lastLoginAt||void 0)}async getIdToken(e){const t=await fi(this,this.stsTokenManager.getToken(this.auth,e));return Vr(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return async function(e,t=!1){const n=Zn(e),s=await n.getIdToken(t),r=pi(s);Vr(r&&r.exp&&r.auth_time&&r.iat,n.auth,"internal-error");const i="object"==typeof r.firebase?r.firebase:void 0,a=i?.sign_in_provider;return{claims:r,token:s,authTime:ui(hi(r.auth_time)),issuedAtTime:ui(hi(r.iat)),expirationTime:ui(hi(r.exp)),signInProvider:a||null,signInSecondFactor:i?.sign_in_second_factor||null}}(this,e)}reload(){return async function(e){const t=Zn(e);await mi(t),await t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)}(this)}_assign(e){this!==e&&(Vr(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(e=>({...e})),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const t=new Di({...this,auth:e,stsTokenManager:this.stsTokenManager._clone()});return t.metadata._copy(this.metadata),t}_onReload(e){Vr(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,t=!1){let n=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),n=!0),t&&await mi(this),await this.auth._persistUserIfCurrent(this),n&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(pr(this.auth.app))return Promise.reject(Gr(this.auth));const e=await this.getIdToken();return await fi(this,async function(e,t){return ti(e,"POST","/v1/accounts:delete",t)}(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return{uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>({...e})),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId,...this.metadata.toJSON(),apiKey:this.auth.config.apiKey,appName:this.auth.name}}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,t){const n=t.displayName??void 0,s=t.email??void 0,r=t.phoneNumber??void 0,i=t.photoURL??void 0,a=t.tenantId??void 0,o=t._redirectEventId??void 0,B=t.createdAt??void 0,c=t.lastLoginAt??void 0,{uid:l,emailVerified:u,isAnonymous:h,providerData:p,stsTokenManager:d}=t;Vr(l&&d,e,"internal-error");const f=Ei.fromJSON(this.name,d);Vr("string"==typeof l,e,"internal-error"),yi(n,e.name),yi(s,e.name),Vr("boolean"==typeof u,e,"internal-error"),Vr("boolean"==typeof h,e,"internal-error"),yi(r,e.name),yi(i,e.name),yi(a,e.name),yi(o,e.name),yi(B,e.name),yi(c,e.name);const C=new Di({uid:l,auth:e,email:s,emailVerified:u,displayName:n,isAnonymous:h,photoURL:i,phoneNumber:r,tenantId:a,stsTokenManager:f,createdAt:B,lastLoginAt:c});return p&&Array.isArray(p)&&(C.providerData=p.map(e=>({...e}))),o&&(C._redirectEventId=o),C}static async _fromIdTokenResponse(e,t,n=!1){const s=new Ei;s.updateFromServerResponse(t);const r=new Di({uid:t.localId,auth:e,stsTokenManager:s,isAnonymous:n});return await mi(r),r}static async _fromGetAccountInfoResponse(e,t,n){const s=t.users[0];Vr(void 0!==s.localId,"internal-error");const r=void 0!==s.providerUserInfo?wi(s.providerUserInfo):[],i=!(s.email&&s.passwordHash||r?.length),a=new Ei;a.updateFromIdToken(n);const o=new Di({uid:s.localId,auth:e,stsTokenManager:a,isAnonymous:i}),B={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:r,metadata:new gi(s.createdAt,s.lastLoginAt),isAnonymous:!(s.email&&s.passwordHash||r?.length)};return Object.assign(o,B),o}}const _i=new Map;function bi(e){$r(e instanceof Function,"Expected a class definition");let t=_i.get(e);return t?($r(t instanceof e,"Instance stored in cache mismatched with class"),t):(t=new e,_i.set(e,t),t)}class vi{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,t){this.storage[e]=t}async _get(e){const t=this.storage[e];return void 0===t?null:t}async _remove(e){delete this.storage[e]}_addListener(e,t){}_removeListener(e,t){}}vi.type="NONE";const Ii=vi;function Ti(e,t,n){return`firebase:${e}:${t}:${n}`}class Ai{constructor(e,t,n){this.persistence=e,this.auth=t,this.userKey=n;const{config:s,name:r}=this.auth;this.fullUserKey=Ti(this.userKey,s.apiKey,r),this.fullPersistenceKey=Ti("persistence",s.apiKey,r),this.boundEventHandler=t._onStorageEvent.bind(t);try{this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}catch{}}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){const e=await this.persistence._get(this.fullUserKey);if(!e)return null;if("string"==typeof e){const t=await li(this.auth,{idToken:e}).catch(()=>{});return t?Di._fromGetAccountInfoResponse(this.auth,t,e):null}return Di._fromJSON(this.auth,e)}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;const t=await this.getCurrentUser();return await this.removeCurrentUser(),this.persistence=e,t?this.setCurrentUser(t):void 0}delete(){try{this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}catch{}}static async create(e,t,n="authUser"){if(!t.length)return new Ai(bi(Ii),e,n);const s=(await Promise.all(t.map(async e=>{try{if(await e._isAvailable())return e}catch{return}}))).filter(e=>e);let r=s[0]||bi(Ii);const i=Ti(n,e.config.apiKey,e.name);let a=null;for(const n of t)try{const t=await n._get(i);if(t){let s;if("string"==typeof t){const n=await li(e,{idToken:t}).catch(()=>{});if(!n)break;s=await Di._fromGetAccountInfoResponse(e,n,t)}else s=Di._fromJSON(e,t);n!==r&&(a=s),r=n;break}}catch{}const o=s.filter(e=>e._shouldAllowMigration);return r._shouldAllowMigration&&o.length?(r=o[0],a&&await r._set(i,a.toJSON()),await Promise.all(t.map(async e=>{if(e!==r)try{await e._remove(i)}catch{}})),new Ai(r,e,n)):new Ai(r,e,n)}}function Oi(e){const t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";if(ki(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";if(t.includes("edge/"))return"Edge";if(Si(t))return"Firefox";if(t.includes("silk/"))return"Silk";if(xi(t))return"Blackberry";if(Fi(t))return"Webos";if(Ni(t))return"Safari";if((t.includes("chrome/")||Ri(t))&&!t.includes("edge/"))return"Chrome";if(Li(t))return"Android";{const t=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,n=e.match(t);if(2===n?.length)return n[1]}return"Other"}function Si(e=Pn()){return/firefox\//i.test(e)}function Ni(e=Pn()){const t=e.toLowerCase();return t.includes("safari/")&&!t.includes("chrome/")&&!t.includes("crios/")&&!t.includes("android")}function Ri(e=Pn()){return/crios\//i.test(e)}function ki(e=Pn()){return/iemobile/i.test(e)}function Li(e=Pn()){return/android/i.test(e)}function xi(e=Pn()){return/blackberry/i.test(e)}function Fi(e=Pn()){return/webos/i.test(e)}function Pi(e=Pn()){return/iphone|ipad|ipod/i.test(e)||/macintosh/i.test(e)&&/mobile/i.test(e)}function Mi(){return function(){const e=Pn();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0}()&&10===document.documentMode}function Gi(e=Pn()){return Pi(e)||Li(e)||Fi(e)||xi(e)||/windows phone/i.test(e)||ki(e)}function Ui(e,t=[]){let n;switch(e){case"Browser":n=Oi(Pn());break;case"Worker":n=`${Oi(Pn())}-${e}`;break;default:n=e}const s=t.length?t.join(","):"FirebaseCore-web";return`${n}/JsCore/${Cr}/${s}`}class Hi{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,t){const n=t=>new Promise((n,s)=>{try{n(e(t))}catch(e){s(e)}});n.onAbort=t,this.queue.push(n);const s=this.queue.length-1;return()=>{this.queue[s]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;const t=[];try{for(const n of this.queue)await n(e),n.onAbort&&t.push(n.onAbort)}catch(e){t.reverse();for(const e of t)try{e()}catch(e){}throw this.auth._errorFactory.create("login-blocked",{originalMessage:e?.message})}}}class Vi{constructor(e){const t=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=t.minPasswordLength??6,t.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=t.maxPasswordLength),void 0!==t.containsLowercaseCharacter&&(this.customStrengthOptions.containsLowercaseLetter=t.containsLowercaseCharacter),void 0!==t.containsUppercaseCharacter&&(this.customStrengthOptions.containsUppercaseLetter=t.containsUppercaseCharacter),void 0!==t.containsNumericCharacter&&(this.customStrengthOptions.containsNumericCharacter=t.containsNumericCharacter),void 0!==t.containsNonAlphanumericCharacter&&(this.customStrengthOptions.containsNonAlphanumericCharacter=t.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,"ENFORCEMENT_STATE_UNSPECIFIED"===this.enforcementState&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=e.allowedNonAlphanumericCharacters?.join("")??"",this.forceUpgradeOnSignin=e.forceUpgradeOnSignin??!1,this.schemaVersion=e.schemaVersion}validatePassword(e){const t={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,t),this.validatePasswordCharacterOptions(e,t),t.isValid&&(t.isValid=t.meetsMinPasswordLength??!0),t.isValid&&(t.isValid=t.meetsMaxPasswordLength??!0),t.isValid&&(t.isValid=t.containsLowercaseLetter??!0),t.isValid&&(t.isValid=t.containsUppercaseLetter??!0),t.isValid&&(t.isValid=t.containsNumericCharacter??!0),t.isValid&&(t.isValid=t.containsNonAlphanumericCharacter??!0),t}validatePasswordLengthOptions(e,t){const n=this.customStrengthOptions.minPasswordLength,s=this.customStrengthOptions.maxPasswordLength;n&&(t.meetsMinPasswordLength=e.length>=n),s&&(t.meetsMaxPasswordLength=e.length<=s)}validatePasswordCharacterOptions(e,t){let n;this.updatePasswordCharacterOptionsStatuses(t,!1,!1,!1,!1);for(let s=0;s<e.length;s++)n=e.charAt(s),this.updatePasswordCharacterOptionsStatuses(t,n>="a"&&n<="z",n>="A"&&n<="Z",n>="0"&&n<="9",this.allowedNonAlphanumericCharacters.includes(n))}updatePasswordCharacterOptionsStatuses(e,t,n,s,r){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=t)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=n)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=s)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=r))}}class ji{constructor(e,t,n,s){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=n,this.config=s,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new Ji(this),this.idTokenSubscription=new Ji(this),this.beforeStateQueue=new Hi(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=Rr,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this._resolvePersistenceManagerAvailable=void 0,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=s.sdkClientVersion,this._persistenceManagerAvailable=new Promise(e=>this._resolvePersistenceManagerAvailable=e)}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=bi(t)),this._initializationPromise=this.queue(async()=>{if(!this._deleted){try{this.persistenceManager=await Ai.create(this,e)}catch(e){Lr(`Failed to initialize persistence: ${e}`),this.persistenceManager=await Ai.create(this,[])}finally{this._resolvePersistenceManagerAvailable?.()}if(!this._deleted){if(this._popupRedirectResolver?._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch(e){}try{await this.initializeCurrentUser(t)}catch(e){Lr(`Failed to initialize current user: ${e}`),await this.directlySetCurrentUser(null).catch(()=>{})}this.lastNotifiedUid=this.currentUser?.uid||null,this._deleted||(this._isInitialized=!0)}}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const e=await this.assertedPersistence.getCurrentUser();return this.currentUser||e?this.currentUser&&e&&this.currentUser.uid===e.uid?(this._currentUser._assign(e),void await this.currentUser.getIdToken()):void await this._updateCurrentUser(e,!0):void 0}async initializeCurrentUserFromIdToken(e){try{const t=await li(this,{idToken:e}),n=await Di._fromGetAccountInfoResponse(this,t,e);await this.directlySetCurrentUser(n)}catch(e){await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){if(pr(this.app)){const e=this.app.settings.authIdToken;return e?new Promise(t=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(e).then(t,t))}):this.directlySetCurrentUser(null)}const t=await this.assertedPersistence.getCurrentUser();let n=t,s=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const t=this.redirectUser?._redirectEventId,r=n?._redirectEventId,i=await this.tryRedirectSignIn(e);t&&t!==r||!i?.user||(n=i.user,s=!0)}if(!n)return this.directlySetCurrentUser(null);if(!n._redirectEventId){if(s)try{await this.beforeStateQueue.runMiddleware(n)}catch(e){n=t,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(e))}return n?this.reloadAndSetCurrentUserOrClear(n):this.directlySetCurrentUser(null)}return Vr(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===n._redirectEventId?this.directlySetCurrentUser(n):this.reloadAndSetCurrentUserOrClear(n)}async tryRedirectSignIn(e){let t=null;try{t=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch(e){await this._setRedirectUser(null)}return t}async reloadAndSetCurrentUserOrClear(e){try{await mi(e)}catch(e){if("auth/network-request-failed"!==e?.code)return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=function(){if("undefined"==typeof navigator)return null;const e=navigator;return e.languages&&e.languages[0]||e.language||null}()}async _delete(){this._deleted=!0}async updateCurrentUser(e){if(pr(this.app))return Promise.reject(Gr(this));const t=e?Zn(e):null;return t&&Vr(t.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(t&&t._clone(this))}async _updateCurrentUser(e,t=!1){if(!this._deleted)return e&&Vr(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),t||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return pr(this.app)?Promise.reject(Gr(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return pr(this.app)?Promise.reject(Gr(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(bi(e))})}_getRecaptchaConfig(){return null==this.tenantId?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const t=this._getPasswordPolicyInternal();return t.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):t.validatePassword(e)}_getPasswordPolicyInternal(){return null===this.tenantId?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const e=await async function(e,t={}){return ti(e,"GET","/v2/passwordPolicy",ei(e,t))}(this),t=new Vi(e);null===this.tenantId?this._projectPasswordPolicy=t:this._tenantPasswordPolicies[this.tenantId]=t}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(e){this._errorFactory=new $n("auth","Firebase",e())}onAuthStateChanged(e,t,n){return this.registerStateListener(this.authStateSubscription,e,t,n)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,n){return this.registerStateListener(this.idTokenSubscription,e,t,n)}authStateReady(){return new Promise((e,t)=>{if(this.currentUser)e();else{const n=this.onAuthStateChanged(()=>{n(),e()},t)}})}async revokeAccessToken(e){if(this.currentUser){const t={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:await this.currentUser.getIdToken()};null!=this.tenantId&&(t.tenantId=this.tenantId),await async function(e,t){return ti(e,"POST","/v2/accounts:revokeToken",ei(e,t))}(this,t)}}toJSON(){return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:this._currentUser?.toJSON()}}async _setRedirectUser(e,t){const n=await this.getOrInitRedirectPersistenceManager(t);return null===e?n.removeCurrentUser():n.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const t=e&&bi(e)||this._popupRedirectResolver;Vr(t,this,"argument-error"),this.redirectPersistenceManager=await Ai.create(this,[bi(t._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){return this._isInitialized&&await this.queue(async()=>{}),this._currentUser?._redirectEventId===e?this._currentUser:this.redirectUser?._redirectEventId===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(e))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const e=this.currentUser?.uid??null;this.lastNotifiedUid!==e&&(this.lastNotifiedUid=e,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,n,s){if(this._deleted)return()=>{};const r="function"==typeof t?t:t.next.bind(t);let i=!1;const a=this._isInitialized?Promise.resolve():this._initializationPromise;if(Vr(a,this,"internal-error"),a.then(()=>{i||r(this.currentUser)}).catch(e=>{if(!i)if("function"!=typeof t&&t.error)t.error(e);else{if(!n)throw e;n(e)}}),"function"==typeof t){const r=e.addObserver(t,n,s);return()=>{i=!0,r()}}{const n=e.addObserver(t);return()=>{i=!0,n()}}}async directlySetCurrentUser(e){if(this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,this.persistenceManager)try{e?await this.persistenceManager.setCurrentUser(e):await this.persistenceManager.removeCurrentUser()}catch(e){const t=Mr(this,"internal-error",`An internal AuthError has occurred: ${e?.message||String(e)}`);throw t.customData={originalError:e},t}}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return Vr(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){e&&!this.frameworks.includes(e)&&(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=Ui(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){const e={"X-Client-Version":this.clientVersion};this.app.options.appId&&(e["X-Firebase-gmpid"]=this.app.options.appId);const t=await(this.heartbeatServiceProvider.getImmediate({optional:!0})?.getHeartbeatsHeader());t&&(e["X-Firebase-Client"]=t);const n=await this._getAppCheckToken();return n&&(e["X-Firebase-AppCheck"]=n),e}async _getAppCheckToken(){if(pr(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const e=await(this.appCheckServiceProvider.getImmediate({optional:!0})?.getToken());return e?.error&&Lr(`Error while retrieving App Check token: ${e.error}`),e?.token}}function $i(e){return Zn(e)}class Ji{constructor(e){this.auth=e,this.observer=null,this.addObserver=function(e,t){const n=new Wn(e,t);return n.subscribe.bind(n)}(e=>this.observer=e)}get next(){return Vr(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}let qi={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function zi(e){return qi.loadJS(e)}class Ki{constructor(){this.enterprise=new Qi}ready(e){e()}execute(e,t){return Promise.resolve("token")}render(e,t){return""}}class Qi{ready(e){e()}execute(e,t){return Promise.resolve("token")}render(e,t){return""}}const Wi="NO_RECAPTCHA",Yi="onFirebaseAuthREInstanceReady";class Xi{constructor(e){this.type="recaptcha-enterprise",this.auth=$i(e)}async verify(e="verify",t=!1){async function n(e){if(!t){if(null==e.tenantId&&null!=e._agentRecaptchaConfig)return e._agentRecaptchaConfig.siteKey;if(null!=e.tenantId&&void 0!==e._tenantRecaptchaConfigs[e.tenantId])return e._tenantRecaptchaConfigs[e.tenantId].siteKey}return new Promise(async(t,n)=>{(async function(e,t){return ti(e,"GET","/v2/recaptchaConfig",ei(e,t))})(e,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(s=>{if(void 0!==s.recaptchaKey){const n=new ci(s);return null==e.tenantId?e._agentRecaptchaConfig=n:e._tenantRecaptchaConfigs[e.tenantId]=n,t(n.siteKey)}n(new Error("recaptcha Enterprise site key undefined"))}).catch(e=>{n(e)})})}function s(t,n,s){const r=window.grecaptcha;Bi(r)?r.enterprise.ready(()=>{r.enterprise.execute(t,{action:e}).then(e=>{n(e)}).catch(()=>{n(Wi)})}):s(Error("No reCAPTCHA enterprise script loaded."))}if(this.auth.settings.appVerificationDisabledForTesting){return(new Ki).execute("siteKey",{action:"verify"})}return new Promise((e,r)=>{n(this.auth).then(async n=>{if(!t&&Bi(window.grecaptcha)&&Xi.scriptInjectionDeferred)await Xi.scriptInjectionDeferred.promise,s(n,e,r);else{if("undefined"==typeof window)return void r(new Error("RecaptchaVerifier is only supported in browser"));let t=qi.recaptchaEnterpriseScript;0!==t.length&&(t+=n+`&onload=${Yi}`),Xi.scriptInjectionDeferred=new xn,window[Yi]=()=>{Xi.scriptInjectionDeferred?.resolve()},zi(t).then(()=>Xi.scriptInjectionDeferred?.promise).then(()=>{s(n,e,r)}).catch(e=>{r(e)})}}).catch(e=>{r(e)})})}}async function Zi(e,t,n,s=!1,r=!1){const i=new Xi(e);let a;if(r)a=Wi;else try{a=await i.verify(n)}catch(e){a=await i.verify(n,!0)}const o={...t};if("mfaSmsEnrollment"===n||"mfaSmsSignIn"===n){if("phoneEnrollmentInfo"in o){const e=o.phoneEnrollmentInfo.phoneNumber,t=o.phoneEnrollmentInfo.recaptchaToken;Object.assign(o,{phoneEnrollmentInfo:{phoneNumber:e,recaptchaToken:t,captchaResponse:a,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}else if("phoneSignInInfo"in o){const e=o.phoneSignInInfo.recaptchaToken;Object.assign(o,{phoneSignInInfo:{recaptchaToken:e,captchaResponse:a,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}return o}return s?Object.assign(o,{captchaResp:a}):Object.assign(o,{captchaResponse:a}),Object.assign(o,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(o,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),o}async function ea(e,t,n,s,r){if(e._getRecaptchaConfig()?.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")){const r=await Zi(e,t,n,"getOobCode"===n);return s(e,r)}return s(e,t).catch(async r=>{if("auth/missing-recaptcha-token"===r.code){const r=await Zi(e,t,n,"getOobCode"===n);return s(e,r)}return Promise.reject(r)})}function ta(e,t,n){const s=$i(e);Vr(/^https?:\/\//.test(t),s,"invalid-emulator-scheme");const r=na(t),{host:i,port:a}=function(e){const t=na(e),n=/(\/\/)?([^?#/]+)/.exec(e.substr(t.length));if(!n)return{host:"",port:null};const s=n[2].split("@").pop()||"",r=/^(\[[^\]]+\])(:|$)/.exec(s);if(r){const e=r[1];return{host:e,port:sa(s.substr(e.length+1))}}{const[e,t]=s.split(":");return{host:e,port:sa(t)}}}(t),o=null===a?"":`:${a}`,B={url:`${r}//${i}${o}/`},c=Object.freeze({host:i,port:a,protocol:r.replace(":",""),options:Object.freeze({disableWarnings:!1})});if(!s._canInitEmulator)return Vr(s.config.emulator&&s.emulatorConfig,s,"emulator-config-failed"),void Vr(Jn(B,s.config.emulator)&&Jn(c,s.emulatorConfig),s,"emulator-config-failed");s.config.emulator=B,s.emulatorConfig=c,s.settings.appVerificationDisabledForTesting=!0,es(i)?ts(`${r}//${i}${o}`):function(){function e(){const e=document.createElement("p"),t=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",t.position="fixed",t.width="100%",t.backgroundColor="#ffffff",t.border=".1em solid #000000",t.color="#b50000",t.bottom="0px",t.left="0px",t.margin="0px",t.zIndex="10000",t.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}"undefined"!=typeof console&&console.info;"undefined"!=typeof window&&"undefined"!=typeof document&&("loading"===document.readyState?window.addEventListener("DOMContentLoaded",e):e())}()}function na(e){const t=e.indexOf(":");return t<0?"":e.substr(0,t+1)}function sa(e){if(!e)return null;const t=Number(e);return isNaN(t)?null:t}Xi.scriptInjectionDeferred=null;class ra{constructor(e,t){this.providerId=e,this.signInMethod=t}toJSON(){return jr("not implemented")}_getIdTokenResponse(e){return jr("not implemented")}_linkToIdToken(e,t){return jr("not implemented")}_getReauthenticationResolver(e){return jr("not implemented")}}async function ia(e,t){return ti(e,"POST","/v1/accounts:signUp",t)}async function aa(e,t){return si(e,"POST","/v1/accounts:signInWithPassword",ei(e,t))}async function oa(e,t){return ti(e,"POST","/v1/accounts:sendOobCode",ei(e,t))}async function Ba(e,t){return oa(e,t)}class ca extends ra{constructor(e,t,n,s=null){super("password",n),this._email=e,this._password=t,this._tenantId=s}static _fromEmailAndPassword(e,t){return new ca(e,t,"password")}static _fromEmailAndCode(e,t,n=null){return new ca(e,t,"emailLink",n)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){const t="string"==typeof e?JSON.parse(e):e;if(t?.email&&t?.password){if("password"===t.signInMethod)return this._fromEmailAndPassword(t.email,t.password);if("emailLink"===t.signInMethod)return this._fromEmailAndCode(t.email,t.password,t.tenantId)}return null}async _getIdTokenResponse(e){switch(this.signInMethod){case"password":return ea(e,{returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"},"signInWithPassword",aa);case"emailLink":return async function(e,t){return si(e,"POST","/v1/accounts:signInWithEmailLink",ei(e,t))}(e,{email:this._email,oobCode:this._password});default:Fr(e,"internal-error")}}async _linkToIdToken(e,t){switch(this.signInMethod){case"password":return ea(e,{idToken:t,returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",ia);case"emailLink":return async function(e,t){return si(e,"POST","/v1/accounts:signInWithEmailLink",ei(e,t))}(e,{idToken:t,email:this._email,oobCode:this._password});default:Fr(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}async function la(e,t){return si(e,"POST","/v1/accounts:signInWithIdp",ei(e,t))}class ua extends ra{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const t=new ua(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(t.idToken=e.idToken),e.accessToken&&(t.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(t.nonce=e.nonce),e.pendingToken&&(t.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(t.accessToken=e.oauthToken,t.secret=e.oauthTokenSecret):Fr("argument-error"),t}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){const t="string"==typeof e?JSON.parse(e):e,{providerId:n,signInMethod:s,...r}=t;if(!n||!s)return null;const i=new ua(n,s);return i.idToken=r.idToken||void 0,i.accessToken=r.accessToken||void 0,i.secret=r.secret,i.nonce=r.nonce,i.pendingToken=r.pendingToken||null,i}_getIdTokenResponse(e){return la(e,this.buildRequest())}_linkToIdToken(e,t){const n=this.buildRequest();return n.idToken=t,la(e,n)}_getReauthenticationResolver(e){const t=this.buildRequest();return t.autoCreate=!1,la(e,t)}buildRequest(){const e={requestUri:"http://localhost",returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const t={};this.idToken&&(t.id_token=this.idToken),this.accessToken&&(t.access_token=this.accessToken),this.secret&&(t.oauth_token_secret=this.secret),t.providerId=this.providerId,this.nonce&&!this.pendingToken&&(t.nonce=this.nonce),e.postBody=zn(t)}return e}}class ha{constructor(e){const t=Kn(Qn(e)),n=t.apiKey??null,s=t.oobCode??null,r=function(e){switch(e){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}}(t.mode??null);Vr(n&&s&&r,"argument-error"),this.apiKey=n,this.operation=r,this.code=s,this.continueUrl=t.continueUrl??null,this.languageCode=t.lang??null,this.tenantId=t.tenantId??null}static parseLink(e){const t=function(e){const t=Kn(Qn(e)).link,n=t?Kn(Qn(t)).deep_link_id:null,s=Kn(Qn(e)).deep_link_id;return(s?Kn(Qn(s)).link:null)||s||n||t||e}(e);try{return new ha(t)}catch{return null}}}class pa{constructor(){this.providerId=pa.PROVIDER_ID}static credential(e,t){return ca._fromEmailAndPassword(e,t)}static credentialWithLink(e,t){const n=ha.parseLink(t);return Vr(n,"argument-error"),ca._fromEmailAndCode(e,n.code,n.tenantId)}}pa.PROVIDER_ID="password",pa.EMAIL_PASSWORD_SIGN_IN_METHOD="password",pa.EMAIL_LINK_SIGN_IN_METHOD="emailLink";class da{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}}class fa extends da{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}class Ca extends fa{constructor(){super("facebook.com")}static credential(e){return ua._fromParams({providerId:Ca.PROVIDER_ID,signInMethod:Ca.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return Ca.credentialFromTaggedObject(e)}static credentialFromError(e){return Ca.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e))return null;if(!e.oauthAccessToken)return null;try{return Ca.credential(e.oauthAccessToken)}catch{return null}}}Ca.FACEBOOK_SIGN_IN_METHOD="facebook.com",Ca.PROVIDER_ID="facebook.com";class ga extends fa{constructor(){super("google.com"),this.addScope("profile")}static credential(e,t){return ua._fromParams({providerId:ga.PROVIDER_ID,signInMethod:ga.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:t})}static credentialFromResult(e){return ga.credentialFromTaggedObject(e)}static credentialFromError(e){return ga.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:t,oauthAccessToken:n}=e;if(!t&&!n)return null;try{return ga.credential(t,n)}catch{return null}}}ga.GOOGLE_SIGN_IN_METHOD="google.com",ga.PROVIDER_ID="google.com";class ma extends fa{constructor(){super("github.com")}static credential(e){return ua._fromParams({providerId:ma.PROVIDER_ID,signInMethod:ma.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return ma.credentialFromTaggedObject(e)}static credentialFromError(e){return ma.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e))return null;if(!e.oauthAccessToken)return null;try{return ma.credential(e.oauthAccessToken)}catch{return null}}}ma.GITHUB_SIGN_IN_METHOD="github.com",ma.PROVIDER_ID="github.com";class wa extends fa{constructor(){super("twitter.com")}static credential(e,t){return ua._fromParams({providerId:wa.PROVIDER_ID,signInMethod:wa.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:t})}static credentialFromResult(e){return wa.credentialFromTaggedObject(e)}static credentialFromError(e){return wa.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthAccessToken:t,oauthTokenSecret:n}=e;if(!t||!n)return null;try{return wa.credential(t,n)}catch{return null}}}async function Ea(e,t){return si(e,"POST","/v1/accounts:signUp",ei(e,t))}wa.TWITTER_SIGN_IN_METHOD="twitter.com",wa.PROVIDER_ID="twitter.com";class ya{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,t,n,s=!1){const r=await Di._fromIdTokenResponse(e,n,s),i=Da(n);return new ya({user:r,providerId:i,_tokenResponse:n,operationType:t})}static async _forOperation(e,t,n){await e._updateTokensIfNecessary(n,!0);const s=Da(n);return new ya({user:e,providerId:s,_tokenResponse:n,operationType:t})}}function Da(e){return e.providerId?e.providerId:"phoneNumber"in e?"phone":null}class _a extends jn{constructor(e,t,n,s){super(t.code,t.message),this.operationType=n,this.user=s,Object.setPrototypeOf(this,_a.prototype),this.customData={appName:e.name,tenantId:e.tenantId??void 0,_serverResponse:t.customData._serverResponse,operationType:n}}static _fromErrorAndOperation(e,t,n,s){return new _a(e,t,n,s)}}function ba(e,t,n,s){return("reauthenticate"===t?n._getReauthenticationResolver(e):n._getIdTokenResponse(e)).catch(n=>{if("auth/multi-factor-auth-required"===n.code)throw _a._fromErrorAndOperation(e,n,t,s);throw n})}async function va(e,t,n=!1){const{auth:s}=e;if(pr(s.app))return Promise.reject(Gr(s));const r="reauthenticate";try{const i=await fi(e,ba(s,r,t,e),n);Vr(i.idToken,s,"internal-error");const a=pi(i.idToken);Vr(a,s,"internal-error");const{sub:o}=a;return Vr(e.uid===o,s,"user-mismatch"),ya._forOperation(e,r,i)}catch(e){throw"auth/user-not-found"===e?.code&&Fr(s,"user-mismatch"),e}}async function Ia(e,t,n=!1){if(pr(e.app))return Promise.reject(Gr(e));const s="signIn",r=await ba(e,s,t),i=await ya._fromIdTokenResponse(e,s,r);return n||await e._updateCurrentUser(i.user),i}function Ta(e,t,n){Vr(n.url?.length>0,e,"invalid-continue-uri"),Vr(void 0===n.dynamicLinkDomain||n.dynamicLinkDomain.length>0,e,"invalid-dynamic-link-domain"),Vr(void 0===n.linkDomain||n.linkDomain.length>0,e,"invalid-hosting-link-domain"),t.continueUrl=n.url,t.dynamicLinkDomain=n.dynamicLinkDomain,t.linkDomain=n.linkDomain,t.canHandleCodeInApp=n.handleCodeInApp,n.iOS&&(Vr(n.iOS.bundleId.length>0,e,"missing-ios-bundle-id"),t.iOSBundleId=n.iOS.bundleId),n.android&&(Vr(n.android.packageName.length>0,e,"missing-android-pkg-name"),t.androidInstallApp=n.android.installApp,t.androidMinimumVersionCode=n.android.minimumVersion,t.androidPackageName=n.android.packageName)}async function Aa(e){const t=$i(e);t._getPasswordPolicyInternal()&&await t._updatePasswordPolicy()}async function Oa(e,t,n){const s=$i(e),r={requestType:"PASSWORD_RESET",email:t,clientType:"CLIENT_TYPE_WEB"};await ea(s,r,"getOobCode",Ba)}function Sa(e,t,n){return pr(e.app)?Promise.reject(Gr(e)):async function(e,t){return Ia($i(e),t)}(Zn(e),pa.credential(t,n)).catch(async t=>{throw"auth/password-does-not-meet-requirements"===t.code&&Aa(e),t})}async function Na(e,t){const n=Zn(e),s={requestType:"VERIFY_EMAIL",idToken:await e.getIdToken()};t&&Ta(n.auth,s,t);const{email:r}=await async function(e,t){return oa(e,t)}(n.auth,s);r!==e.email&&await e.reload()}async function Ra(e,t,n){const s=Zn(e),r={requestType:"VERIFY_AND_CHANGE_EMAIL",idToken:await e.getIdToken(),newEmail:t};n&&Ta(s.auth,r,n);const{email:i}=await async function(e,t){return oa(e,t)}(s.auth,r);i!==e.email&&await e.reload()}async function ka(e,t){const{displayName:n,photoURL:s}=t;if(void 0===n&&void 0===s)return;const r=Zn(e),i={idToken:await r.getIdToken(),displayName:n,photoUrl:s,returnSecureToken:!0},a=await fi(r,async function(e,t){return ti(e,"POST","/v1/accounts:update",t)}(r.auth,i));r.displayName=a.displayName||null,r.photoURL=a.photoUrl||null;const o=r.providerData.find(({providerId:e})=>"password"===e);o&&(o.displayName=r.displayName,o.photoURL=r.photoURL),await r._updateTokensIfNecessary(a)}function La(e,t){return async function(e,t,n){const{auth:s}=e,r=await e.getIdToken(),i={idToken:r,returnSecureToken:!0};n&&(i.password=n);const a=await fi(e,async function(e,t){return ti(e,"POST","/v1/accounts:update",t)}(s,i));await e._updateTokensIfNecessary(a,!0)}(Zn(e),0,t)}function xa(e,t,n,s){return Zn(e).onAuthStateChanged(t,n,s)}const Fa="__sak";class Pa{constructor(e,t){this.storageRetriever=e,this.type=t}_isAvailable(){try{return this.storage?(this.storage.setItem(Fa,"1"),this.storage.removeItem(Fa),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(e,t){return this.storage.setItem(e,JSON.stringify(t)),Promise.resolve()}_get(e){const t=this.storage.getItem(e);return Promise.resolve(t?JSON.parse(t):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}class Ma extends Pa{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,t)=>this.onStorageEvent(e,t),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=Gi(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const t of Object.keys(this.listeners)){const n=this.storage.getItem(t),s=this.localCache[t];n!==s&&e(t,s,n)}}onStorageEvent(e,t=!1){if(!e.key)return void this.forAllChangedKeys((e,t,n)=>{this.notifyListeners(e,n)});const n=e.key;t?this.detachListener():this.stopPolling();const s=()=>{const e=this.storage.getItem(n);(t||this.localCache[n]!==e)&&this.notifyListeners(n,e)},r=this.storage.getItem(n);Mi()&&r!==e.newValue&&e.newValue!==e.oldValue?setTimeout(s,10):s()}notifyListeners(e,t){this.localCache[e]=t;const n=this.listeners[e];if(n)for(const e of Array.from(n))e(t?JSON.parse(t):t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,t,n)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:t,newValue:n}),!0)})},1e3)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,t){0===Object.keys(this.listeners).length&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),0===this.listeners[e].size&&delete this.listeners[e]),0===Object.keys(this.listeners).length&&(this.detachListener(),this.stopPolling())}async _set(e,t){await super._set(e,t),this.localCache[e]=JSON.stringify(t)}async _get(e){const t=await super._get(e);return this.localCache[e]=JSON.stringify(t),t}async _remove(e){await super._remove(e),delete this.localCache[e]}}Ma.type="LOCAL";const Ga=Ma;class Ua extends Pa{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,t){}_removeListener(e,t){}}Ua.type="SESSION";const Ha=Ua;class Va{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const t=this.receivers.find(t=>t.isListeningto(e));if(t)return t;const n=new Va(e);return this.receivers.push(n),n}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const t=e,{eventId:n,eventType:s,data:r}=t.data,i=this.handlersMap[s];if(!i?.size)return;t.ports[0].postMessage({status:"ack",eventId:n,eventType:s});const a=Array.from(i).map(async e=>e(t.origin,r)),o=await function(e){return Promise.all(e.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(e){return{fulfilled:!1,reason:e}}}))}(a);t.ports[0].postMessage({status:"done",eventId:n,eventType:s,response:o})}_subscribe(e,t){0===Object.keys(this.handlersMap).length&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(t)}_unsubscribe(e,t){this.handlersMap[e]&&t&&this.handlersMap[e].delete(t),t&&0!==this.handlersMap[e].size||delete this.handlersMap[e],0===Object.keys(this.handlersMap).length&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}function ja(e="",t=10){let n="";for(let e=0;e<t;e++)n+=Math.floor(10*Math.random());return e+n}Va.receivers=[];class $a{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,t,n=50){const s="undefined"!=typeof MessageChannel?new MessageChannel:null;if(!s)throw new Error("connection_unavailable");let r,i;return new Promise((a,o)=>{const B=ja("",20);s.port1.start();const c=setTimeout(()=>{o(new Error("unsupported_event"))},n);i={messageChannel:s,onMessage(e){const t=e;if(t.data.eventId===B)switch(t.data.status){case"ack":clearTimeout(c),r=setTimeout(()=>{o(new Error("timeout"))},3e3);break;case"done":clearTimeout(r),a(t.data.response);break;default:clearTimeout(c),clearTimeout(r),o(new Error("invalid_response"))}}},this.handlers.add(i),s.port1.addEventListener("message",i.onMessage),this.target.postMessage({eventType:e,eventId:B,data:t},[s.port2])}).finally(()=>{i&&this.removeMessageHandler(i)})}}function Ja(){return window}function qa(){return void 0!==Ja().WorkerGlobalScope&&"function"==typeof Ja().importScripts}const za="firebaseLocalStorageDb",Ka="firebaseLocalStorage",Qa="fbase_key";class Wa{constructor(e){this.request=e}toPromise(){return new Promise((e,t)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{t(this.request.error)})})}}function Ya(e,t){return e.transaction([Ka],t?"readwrite":"readonly").objectStore(Ka)}function Xa(){const e=indexedDB.open(za,1);return new Promise((t,n)=>{e.addEventListener("error",()=>{n(e.error)}),e.addEventListener("upgradeneeded",()=>{const t=e.result;try{t.createObjectStore(Ka,{keyPath:Qa})}catch(e){n(e)}}),e.addEventListener("success",async()=>{const n=e.result;n.objectStoreNames.contains(Ka)?t(n):(n.close(),await function(){const e=indexedDB.deleteDatabase(za);return new Wa(e).toPromise()}(),t(await Xa()))})})}async function Za(e,t,n){const s=Ya(e,!0).put({[Qa]:t,value:n});return new Wa(s).toPromise()}function eo(e,t){const n=Ya(e,!0).delete(t);return new Wa(n).toPromise()}class to{registerLifecycleListeners(){"undefined"!=typeof window&&"function"==typeof window.addEventListener&&(window.addEventListener("pagehide",this.onPageHide),window.addEventListener("pageshow",this.onPageShow))}unregisterLifecycleListeners(){"undefined"!=typeof window&&"function"==typeof window.removeEventListener&&(window.removeEventListener("pagehide",this.onPageHide),window.removeEventListener("pageshow",this.onPageShow))}constructor(){this.type="LOCAL",this.dbPromise=null,this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.isClosing=!1,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this.onPageHide=()=>{this.isClosing=!0,this.stopPolling(),this.dbPromise&&(this.dbPromise.then(e=>e.close()).catch(()=>{}),this.dbPromise=null)},this.onPageShow=()=>{this.isClosing&&(this.isClosing=!1,Object.keys(this.listeners).length>0&&this.startPolling())},this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.dbPromise||(this.dbPromise=Xa(),this.dbPromise.catch(()=>{this.dbPromise=null})),this.dbPromise}async _withRetries(e){let t=0;for(;;)try{const t=await this._openDb();return await e(t)}catch(e){if(t++>3)throw e;if(this.dbPromise){const e=this.dbPromise;this.dbPromise=null;try{(await e).close()}catch{}}}}async initializeServiceWorkerMessaging(){return qa()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=Va._getInstance(qa()?self:null),this.receiver._subscribe("keyChanged",async(e,t)=>({keyProcessed:(await this._poll()).includes(t.key)})),this.receiver._subscribe("ping",async(e,t)=>["keyChanged"])}async initializeSender(){if(this.activeServiceWorker=await async function(){if(!navigator?.serviceWorker)return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}(),!this.activeServiceWorker)return;this.sender=new $a(this.activeServiceWorker);const e=await this.sender._send("ping",{},800);e&&e[0]?.fulfilled&&e[0]?.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(this.sender&&this.activeServiceWorker&&(navigator?.serviceWorker?.controller||null)===this.activeServiceWorker)try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{return!!indexedDB&&(await this._withRetries(async e=>{await Za(e,Fa,"1"),await eo(e,Fa)}),!0)}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,t){return this._withPendingWrite(async()=>(await this._withRetries(n=>Za(n,e,t)),this.localCache[e]=t,this.notifyServiceWorker(e)))}async _get(e){const t=await this._withRetries(t=>async function(e,t){const n=Ya(e,!1).get(t),s=await new Wa(n).toPromise();return void 0===s?null:s.value}(t,e));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(t=>eo(t,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){if(this.isClosing)return[];try{const e=await this._withRetries(e=>{const t=Ya(e,!1).getAll();return new Wa(t).toPromise()});if(this.isClosing)return[];if(!e)return[];if(0!==this.pendingWrites)return[];const t=[],n=new Set;if(0!==e.length)for(const{fbase_key:s,value:r}of e)n.add(s),JSON.stringify(this.localCache[s])!==JSON.stringify(r)&&(this.notifyListeners(s,r),t.push(s));for(const e of Object.keys(this.localCache))this.localCache[e]&&!n.has(e)&&(this.notifyListeners(e,null),t.push(e));return t}catch(e){return this.isClosing||Lr(`Firebase Auth cross-tab polling failed with error: ${e}`),[]}}notifyListeners(e,t){this.localCache[e]=t;const n=this.listeners[e];if(n)for(const e of Array.from(n))e(t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),800)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,t){0===Object.keys(this.listeners).length&&(this.startPolling(),this.registerLifecycleListeners()),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),0===this.listeners[e].size&&delete this.listeners[e]),0===Object.keys(this.listeners).length&&(this.stopPolling(),this.unregisterLifecycleListeners())}}to.type="LOCAL";const no=to;function so(e,t){return t?bi(t):(Vr(e._popupRedirectResolver,e,"argument-error"),e._popupRedirectResolver)}new Kr(3e4,6e4);class ro extends ra{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return la(e,this._buildIdpRequest())}_linkToIdToken(e,t){return la(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return la(e,this._buildIdpRequest())}_buildIdpRequest(e){const t={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(t.idToken=e),t}}function io(e){return Ia(e.auth,new ro(e),e.bypassAuthState)}function ao(e){const{auth:t,user:n}=e;return Vr(n,t,"internal-error"),va(n,new ro(e),e.bypassAuthState)}async function oo(e){const{auth:t,user:n}=e;return Vr(n,t,"internal-error"),async function(e,t,n=!1){const s=await fi(e,t._linkToIdToken(e.auth,await e.getIdToken()),n);return ya._forOperation(e,"link",s)}(n,new ro(e),e.bypassAuthState)}class Bo{constructor(e,t,n,s,r=!1){this.auth=e,this.resolver=n,this.user=s,this.bypassAuthState=r,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(t)?t:[t]}execute(){return new Promise(async(e,t)=>{this.pendingPromise={resolve:e,reject:t};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(e){this.reject(e)}})}async onAuthEvent(e){const{urlResponse:t,sessionId:n,postBody:s,tenantId:r,error:i,type:a}=e;if(i)return void this.reject(i);const o={auth:this.auth,requestUri:t,sessionId:n,tenantId:r||void 0,postBody:s||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(a)(o))}catch(e){this.reject(e)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return io;case"linkViaPopup":case"linkViaRedirect":return oo;case"reauthViaPopup":case"reauthViaRedirect":return ao;default:Fr(this.auth,"internal-error")}}resolve(e){$r(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){$r(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()}}const co=new Kr(2e3,1e4);class lo extends Bo{constructor(e,t,n,s,r){super(e,t,s,r),this.provider=n,this.authWindow=null,this.pollId=null,lo.currentPopupAction&&lo.currentPopupAction.cancel(),lo.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return Vr(e,this.auth,"internal-error"),e}async onExecution(){$r(1===this.filter.length,"Popup operations only handle one event");const e=ja();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(e=>{this.reject(e)}),this.resolver._isIframeWebStorageSupported(this.auth,e=>{e||this.reject(Pr(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){return this.authWindow?.associatedEvent||null}cancel(){this.reject(Pr(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,lo.currentPopupAction=null}pollUserCancellation(){const e=()=>{this.authWindow?.window?.closed?this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(Pr(this.auth,"popup-closed-by-user"))},8e3):this.pollId=window.setTimeout(e,co.get())};e()}}lo.currentPopupAction=null;const uo=new Map;class ho extends Bo{constructor(e,t,n=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,n),this.eventId=null}async execute(){let e=uo.get(this.auth._key());if(!e){try{const t=await async function(e,t){const n=Co(t),s=fo(e);if(!await s._isAvailable())return!1;const r="true"===await s._get(n);return await s._remove(n),r}(this.resolver,this.auth),n=t?await super.execute():null;e=()=>Promise.resolve(n)}catch(t){e=()=>Promise.reject(t)}uo.set(this.auth._key(),e)}return this.bypassAuthState||uo.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if("signInViaRedirect"===e.type)return super.onAuthEvent(e);if("unknown"!==e.type){if(e.eventId){const t=await this.auth._redirectUserForId(e.eventId);if(t)return this.user=t,super.onAuthEvent(e);this.resolve(null)}}else this.resolve(null)}async onExecution(){}cleanUp(){}}function po(e,t){uo.set(e._key(),t)}function fo(e){return bi(e._redirectPersistence)}function Co(e){return Ti("pendingRedirect",e.config.apiKey,e.name)}function go(e,t,n){return async function(e,t,n){if(pr(e.app))return Promise.reject(Gr(e));const s=$i(e);Ur(e,t,da),await s._initializationPromise;const r=so(s,n);return await async function(e,t){return fo(e)._set(Co(t),"true")}(r,s),r._openRedirect(s,t,"signInViaRedirect")}(e,t,n)}async function mo(e,t,n=!1){if(pr(e.app))return Promise.reject(Gr(e));const s=$i(e),r=so(s,t),i=new ho(s,r,n),a=await i.execute();return a&&!n&&(delete a.user._redirectEventId,await s._persistUserIfCurrent(a.user),await s._setRedirectUser(null,t)),a}class wo{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let t=!1;return this.consumers.forEach(n=>{this.isEventForConsumer(e,n)&&(t=!0,this.sendToConsumer(e,n),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!function(e){switch(e.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return yo(e);default:return!1}}(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){if(e.error&&!yo(e)){const n=e.error.code?.split("auth/")[1]||"internal-error";t.onError(Pr(this.auth,n))}else t.onAuthEvent(e)}isEventForConsumer(e,t){const n=null===t.eventId||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&n}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=6e5&&this.cachedEventUids.clear(),this.cachedEventUids.has(Eo(e))}saveEventToCache(e){this.cachedEventUids.add(Eo(e)),this.lastProcessedEventTime=Date.now()}}function Eo(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter(e=>e).join("-")}function yo({type:e,error:t}){return"unknown"===e&&"auth/no-auth-event"===t?.code}const Do=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,_o=/^https?/;async function bo(e){if(e.config.emulator)return;const{authorizedDomains:t}=await async function(e,t={}){return ti(e,"GET","/v1/projects",t)}(e);for(const e of t)try{if(vo(e))return}catch{}Fr(e,"unauthorized-domain")}function vo(e){const t=Jr(),{protocol:n,hostname:s}=new URL(t);if(e.startsWith("chrome-extension://")){const r=new URL(e);return""===r.hostname&&""===s?"chrome-extension:"===n&&e.replace("chrome-extension://","")===t.replace("chrome-extension://",""):"chrome-extension:"===n&&r.hostname===s}if(!_o.test(n))return!1;if(Do.test(e))return s===e;const r=e.replace(/\./g,"\\.");return new RegExp("^(.+\\."+r+"|"+r+")$","i").test(s)}const Io=new Kr(3e4,6e4);function To(){const e=Ja().___jsl;if(e?.H)for(const t of Object.keys(e.H))if(e.H[t].r=e.H[t].r||[],e.H[t].L=e.H[t].L||[],e.H[t].r=[...e.H[t].L],e.CP)for(let t=0;t<e.CP.length;t++)e.CP[t]=null}function Ao(e){return new Promise((t,n)=>{function s(){To(),gapi.load("gapi.iframes",{callback:()=>{t(gapi.iframes.getContext())},ontimeout:()=>{To(),n(Pr(e,"network-request-failed"))},timeout:Io.get()})}if(Ja().gapi?.iframes?.Iframe)t(gapi.iframes.getContext());else{if(!Ja().gapi?.load){const t=`__${"iframefcb"}${Math.floor(1e6*Math.random())}`;return Ja()[t]=()=>{gapi.load?s():n(Pr(e,"network-request-failed"))},zi(`${qi.gapiScript}?onload=${t}`).catch(e=>n(e))}s()}}).catch(e=>{throw Oo=null,e})}let Oo=null;const So=new Kr(5e3,15e3),No={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},Ro=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function ko(e){const t=e.config;Vr(t.authDomain,e,"auth-domain-config-required");const n=t.emulator?Qr(t,"emulator/auth/iframe"):`https://${e.config.authDomain}/__/auth/iframe`,s={apiKey:t.apiKey,appName:e.name,v:Cr},r=Ro.get(e.config.apiHost);r&&(s.eid=r);const i=e._getFrameworks();return i.length&&(s.fw=i.join(",")),`${n}?${zn(s).slice(1)}`}async function Lo(e){const t=await function(e){return Oo=Oo||Ao(e),Oo}(e),n=Ja().gapi;return Vr(n,e,"internal-error"),t.open({where:document.body,url:ko(e),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:No,dontclear:!0},t=>new Promise(async(n,s)=>{await t.restyle({setHideOnLeave:!1});const r=Pr(e,"network-request-failed"),i=Ja().setTimeout(()=>{s(r)},So.get());function a(){Ja().clearTimeout(i),n(t)}t.ping(a).then(a,()=>{s(r)})}))}const xo={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"};class Fo{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch(e){}}}function Po(e,t,n,s=500,r=600){const i=Math.max((window.screen.availHeight-r)/2,0).toString(),a=Math.max((window.screen.availWidth-s)/2,0).toString();let o="";const B={...xo,width:s.toString(),height:r.toString(),top:i,left:a},c=Pn().toLowerCase();n&&(o=Ri(c)?"_blank":n),Si(c)&&(t=t||"http://localhost",B.scrollbars="yes");const l=Object.entries(B).reduce((e,[t,n])=>`${e}${t}=${n},`,"");if(function(e=Pn()){return Pi(e)&&!!window.navigator?.standalone}(c)&&"_self"!==o)return function(e,t){const n=document.createElement("a");n.href=e,n.target=t;const s=document.createEvent("MouseEvent");s.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(s)}(t||"",o),new Fo(null);const u=window.open(t||"",o,l);Vr(u,e,"popup-blocked");try{u.focus()}catch(e){}return new Fo(u)}const Mo="__/auth/handler",Go="emulator/auth/handler",Uo=encodeURIComponent("fac");async function Ho(e,t,n,s,r,i){Vr(e.config.authDomain,e,"auth-domain-config-required"),Vr(e.config.apiKey,e,"invalid-api-key");const a={apiKey:e.config.apiKey,appName:e.name,authType:n,redirectUrl:s,v:Cr,eventId:r};if(t instanceof da){t.setDefaultLanguage(e.languageCode),a.providerId=t.providerId||"",function(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}(t.getCustomParameters())||(a.customParameters=JSON.stringify(t.getCustomParameters()));for(const[e,t]of Object.entries({}))a[e]=t}if(t instanceof fa){const e=t.getScopes().filter(e=>""!==e);e.length>0&&(a.scopes=e.join(","))}e.tenantId&&(a.tid=e.tenantId);const o=a;for(const e of Object.keys(o))void 0===o[e]&&delete o[e];const B=await e._getAppCheckToken(),c=B?`#${Uo}=${encodeURIComponent(B)}`:"";return`${function({config:e}){if(!e.emulator)return`https://${e.authDomain}/${Mo}`;return Qr(e,Go)}(e)}?${zn(o).slice(1)}${c}`}const Vo="webStorageSupport";const jo=class{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=Ha,this._completeRedirectFn=mo,this._overrideRedirectResult=po}async _openPopup(e,t,n,s){$r(this.eventManagers[e._key()]?.manager,"_initialize() not called before _openPopup()");return Po(e,await Ho(e,t,n,Jr(),s),ja())}async _openRedirect(e,t,n,s){await this._originValidation(e);return function(e){Ja().location.href=e}(await Ho(e,t,n,Jr(),s)),new Promise(()=>{})}_initialize(e){const t=e._key();if(this.eventManagers[t]){const{manager:e,promise:n}=this.eventManagers[t];return e?Promise.resolve(e):($r(n,"If manager is not set, promise should be"),n)}const n=this.initAndGetManager(e);return this.eventManagers[t]={promise:n},n.catch(()=>{delete this.eventManagers[t]}),n}async initAndGetManager(e){const t=await Lo(e),n=new wo(e);return t.register("authEvent",t=>{Vr(t?.authEvent,e,"invalid-auth-event");return{status:n.onEvent(t.authEvent)?"ACK":"ERROR"}},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:n},this.iframes[e._key()]=t,n}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send(Vo,{type:Vo},n=>{const s=n?.[0]?.[Vo];void 0!==s&&t(!!s),Fr(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=bo(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return Gi()||Ni()||Pi()}};var $o="@firebase/auth",Jo="1.13.6";class qo{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){return this.assertAuthConfigured(),this.auth.currentUser?.uid||null}async getToken(e){if(this.assertAuthConfigured(),await this.auth._initializationPromise,!this.auth.currentUser)return null;return{accessToken:await this.auth.currentUser.getIdToken(e)}}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;const t=this.auth.onIdTokenChanged(t=>{e(t?.stsTokenManager.accessToken||null)});this.internalListeners.set(e,t),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}assertAuthConfigured(){Vr(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}const zo=Ln("authIdTokenMaxAge")||300;let Ko=null;function Qo(e=mr()){const t=hr(e,"auth");if(t.isInitialized())return t.getImmediate();const n=function(e,t){const n=hr(e,"auth");if(n.isInitialized()){const e=n.getImmediate();if(Jn(n.getOptions(),t??{}))return e;Fr(e,"already-initialized")}return n.initialize({options:t})}(e,{popupRedirectResolver:jo,persistence:[no,Ga,Ha]}),s=Ln("authTokenSyncURL");if(s&&"boolean"==typeof isSecureContext&&isSecureContext){const e=new URL(s,location.origin);if(location.origin===e.origin){const t=(r=e.toString(),async e=>{const t=e&&await e.getIdTokenResult(),n=t&&((new Date).getTime()-Date.parse(t.issuedAtTime))/1e3;if(n&&n>zo)return;const s=t?.token;Ko!==s&&(Ko=s,await fetch(r,{method:s?"POST":"DELETE",headers:s?{Authorization:`Bearer ${s}`}:{}}))});!function(e,t,n){Zn(e).beforeAuthStateChanged(t,n)}(n,t,()=>t(n.currentUser)),function(e,t,n,s){Zn(e).onIdTokenChanged(t,n,s)}(n,e=>t(e))}}var r;const i=Nn("auth");return i&&ta(n,`http://${i}`),n}var Wo;!function(e){qi=e}({loadJS:e=>new Promise((t,n)=>{const s=document.createElement("script");s.setAttribute("src",e),s.onload=t,s.onerror=e=>{const t=Pr("internal-error");t.customData=e,n(t)},s.type="text/javascript",s.charset="UTF-8",(document.getElementsByTagName("head")?.[0]??document).appendChild(s)}),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="}),Wo="Browser",ur(new ns("auth",(e,{options:t})=>{const n=e.getProvider("app").getImmediate(),s=e.getProvider("heartbeat"),r=e.getProvider("app-check-internal"),{apiKey:i,authDomain:a}=n.options;Vr(i&&!i.includes(":"),"invalid-api-key",{appName:n.name});const o={apiKey:i,authDomain:a,clientPlatform:Wo,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:Ui(Wo)},B=new ji(n,s,r,o);return function(e,t){const n=t?.persistence||[],s=(Array.isArray(n)?n:[n]).map(bi);t?.errorMap&&e._updateErrorMap(t.errorMap),e._initializeWithPersistence(s,t?.popupRedirectResolver)}(B,t),B},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,n)=>{e.getProvider("auth-internal").initialize()})),ur(new ns("auth-internal",e=>(e=>new qo(e))($i(e.getProvider("auth").getImmediate())),"PRIVATE").setInstantiationMode("EXPLICIT")),wr($o,Jo,function(e){switch(e){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}(Wo)),wr($o,Jo,"esm2020");wr("firebase","12.19.0","app");var Yo,Xo="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};(function(){var e;function t(){this.blockSize=-1,this.blockSize=64,this.g=Array(4),this.C=Array(this.blockSize),this.o=this.h=0,this.u()}function n(e,t,n){n||(n=0);const s=Array(16);if("string"==typeof t)for(var r=0;r<16;++r)s[r]=t.charCodeAt(n++)|t.charCodeAt(n++)<<8|t.charCodeAt(n++)<<16|t.charCodeAt(n++)<<24;else for(r=0;r<16;++r)s[r]=t[n++]|t[n++]<<8|t[n++]<<16|t[n++]<<24;t=e.g[0],n=e.g[1],r=e.g[2];let i,a=e.g[3];i=t+(a^n&(r^a))+s[0]+3614090360&4294967295,i=a+(r^(t=n+(i<<7&4294967295|i>>>25))&(n^r))+s[1]+3905402710&4294967295,a=t+(i<<12&4294967295|i>>>20),i=r+(n^a&(t^n))+s[2]+606105819&4294967295,i=n+(t^(r=a+(i<<17&4294967295|i>>>15))&(a^t))+s[3]+3250441966&4294967295,i=t+(a^(n=r+(i<<22&4294967295|i>>>10))&(r^a))+s[4]+4118548399&4294967295,i=a+(r^(t=n+(i<<7&4294967295|i>>>25))&(n^r))+s[5]+1200080426&4294967295,a=t+(i<<12&4294967295|i>>>20),i=r+(n^a&(t^n))+s[6]+2821735955&4294967295,i=n+(t^(r=a+(i<<17&4294967295|i>>>15))&(a^t))+s[7]+4249261313&4294967295,i=t+(a^(n=r+(i<<22&4294967295|i>>>10))&(r^a))+s[8]+1770035416&4294967295,i=a+(r^(t=n+(i<<7&4294967295|i>>>25))&(n^r))+s[9]+2336552879&4294967295,a=t+(i<<12&4294967295|i>>>20),i=r+(n^a&(t^n))+s[10]+4294925233&4294967295,i=n+(t^(r=a+(i<<17&4294967295|i>>>15))&(a^t))+s[11]+2304563134&4294967295,i=t+(a^(n=r+(i<<22&4294967295|i>>>10))&(r^a))+s[12]+1804603682&4294967295,i=a+(r^(t=n+(i<<7&4294967295|i>>>25))&(n^r))+s[13]+4254626195&4294967295,a=t+(i<<12&4294967295|i>>>20),i=r+(n^a&(t^n))+s[14]+2792965006&4294967295,i=n+(t^(r=a+(i<<17&4294967295|i>>>15))&(a^t))+s[15]+1236535329&4294967295,i=t+(r^a&((n=r+(i<<22&4294967295|i>>>10))^r))+s[1]+4129170786&4294967295,i=a+(n^r&((t=n+(i<<5&4294967295|i>>>27))^n))+s[6]+3225465664&4294967295,a=t+(i<<9&4294967295|i>>>23),i=r+(t^n&(a^t))+s[11]+643717713&4294967295,i=n+(a^t&((r=a+(i<<14&4294967295|i>>>18))^a))+s[0]+3921069994&4294967295,i=t+(r^a&((n=r+(i<<20&4294967295|i>>>12))^r))+s[5]+3593408605&4294967295,i=a+(n^r&((t=n+(i<<5&4294967295|i>>>27))^n))+s[10]+38016083&4294967295,a=t+(i<<9&4294967295|i>>>23),i=r+(t^n&(a^t))+s[15]+3634488961&4294967295,i=n+(a^t&((r=a+(i<<14&4294967295|i>>>18))^a))+s[4]+3889429448&4294967295,i=t+(r^a&((n=r+(i<<20&4294967295|i>>>12))^r))+s[9]+568446438&4294967295,i=a+(n^r&((t=n+(i<<5&4294967295|i>>>27))^n))+s[14]+3275163606&4294967295,a=t+(i<<9&4294967295|i>>>23),i=r+(t^n&(a^t))+s[3]+4107603335&4294967295,i=n+(a^t&((r=a+(i<<14&4294967295|i>>>18))^a))+s[8]+1163531501&4294967295,i=t+(r^a&((n=r+(i<<20&4294967295|i>>>12))^r))+s[13]+2850285829&4294967295,i=a+(n^r&((t=n+(i<<5&4294967295|i>>>27))^n))+s[2]+4243563512&4294967295,a=t+(i<<9&4294967295|i>>>23),i=r+(t^n&(a^t))+s[7]+1735328473&4294967295,i=n+(a^t&((r=a+(i<<14&4294967295|i>>>18))^a))+s[12]+2368359562&4294967295,i=t+((n=r+(i<<20&4294967295|i>>>12))^r^a)+s[5]+4294588738&4294967295,i=a+((t=n+(i<<4&4294967295|i>>>28))^n^r)+s[8]+2272392833&4294967295,a=t+(i<<11&4294967295|i>>>21),i=r+(a^t^n)+s[11]+1839030562&4294967295,i=n+((r=a+(i<<16&4294967295|i>>>16))^a^t)+s[14]+4259657740&4294967295,i=t+((n=r+(i<<23&4294967295|i>>>9))^r^a)+s[1]+2763975236&4294967295,i=a+((t=n+(i<<4&4294967295|i>>>28))^n^r)+s[4]+1272893353&4294967295,a=t+(i<<11&4294967295|i>>>21),i=r+(a^t^n)+s[7]+4139469664&4294967295,i=n+((r=a+(i<<16&4294967295|i>>>16))^a^t)+s[10]+3200236656&4294967295,i=t+((n=r+(i<<23&4294967295|i>>>9))^r^a)+s[13]+681279174&4294967295,i=a+((t=n+(i<<4&4294967295|i>>>28))^n^r)+s[0]+3936430074&4294967295,a=t+(i<<11&4294967295|i>>>21),i=r+(a^t^n)+s[3]+3572445317&4294967295,i=n+((r=a+(i<<16&4294967295|i>>>16))^a^t)+s[6]+76029189&4294967295,i=t+((n=r+(i<<23&4294967295|i>>>9))^r^a)+s[9]+3654602809&4294967295,i=a+((t=n+(i<<4&4294967295|i>>>28))^n^r)+s[12]+3873151461&4294967295,a=t+(i<<11&4294967295|i>>>21),i=r+(a^t^n)+s[15]+530742520&4294967295,i=n+((r=a+(i<<16&4294967295|i>>>16))^a^t)+s[2]+3299628645&4294967295,i=t+(r^((n=r+(i<<23&4294967295|i>>>9))|~a))+s[0]+4096336452&4294967295,i=a+(n^((t=n+(i<<6&4294967295|i>>>26))|~r))+s[7]+1126891415&4294967295,a=t+(i<<10&4294967295|i>>>22),i=r+(t^(a|~n))+s[14]+2878612391&4294967295,i=n+(a^((r=a+(i<<15&4294967295|i>>>17))|~t))+s[5]+4237533241&4294967295,i=t+(r^((n=r+(i<<21&4294967295|i>>>11))|~a))+s[12]+1700485571&4294967295,i=a+(n^((t=n+(i<<6&4294967295|i>>>26))|~r))+s[3]+2399980690&4294967295,a=t+(i<<10&4294967295|i>>>22),i=r+(t^(a|~n))+s[10]+4293915773&4294967295,i=n+(a^((r=a+(i<<15&4294967295|i>>>17))|~t))+s[1]+2240044497&4294967295,i=t+(r^((n=r+(i<<21&4294967295|i>>>11))|~a))+s[8]+1873313359&4294967295,i=a+(n^((t=n+(i<<6&4294967295|i>>>26))|~r))+s[15]+4264355552&4294967295,a=t+(i<<10&4294967295|i>>>22),i=r+(t^(a|~n))+s[6]+2734768916&4294967295,i=n+(a^((r=a+(i<<15&4294967295|i>>>17))|~t))+s[13]+1309151649&4294967295,i=t+(r^((n=r+(i<<21&4294967295|i>>>11))|~a))+s[4]+4149444226&4294967295,i=a+(n^((t=n+(i<<6&4294967295|i>>>26))|~r))+s[11]+3174756917&4294967295,a=t+(i<<10&4294967295|i>>>22),i=r+(t^(a|~n))+s[2]+718787259&4294967295,i=n+(a^((r=a+(i<<15&4294967295|i>>>17))|~t))+s[9]+3951481745&4294967295,e.g[0]=e.g[0]+t&4294967295,e.g[1]=e.g[1]+(r+(i<<21&4294967295|i>>>11))&4294967295,e.g[2]=e.g[2]+r&4294967295,e.g[3]=e.g[3]+a&4294967295}function s(e,t){this.h=t;const n=[];let s=!0;for(let r=e.length-1;r>=0;r--){const i=0|e[r];s&&i==t||(n[r]=i,s=!1)}this.g=n}!function(e,t){function n(){}n.prototype=t.prototype,e.F=t.prototype,e.prototype=new n,e.prototype.constructor=e,e.D=function(e,n,s){for(var r=Array(arguments.length-2),i=2;i<arguments.length;i++)r[i-2]=arguments[i];return t.prototype[n].apply(e,r)}}(t,function(){this.blockSize=-1}),t.prototype.u=function(){this.g[0]=1732584193,this.g[1]=4023233417,this.g[2]=2562383102,this.g[3]=271733878,this.o=this.h=0},t.prototype.v=function(e,t){void 0===t&&(t=e.length);const s=t-this.blockSize,r=this.C;let i=this.h,a=0;for(;a<t;){if(0==i)for(;a<=s;)n(this,e,a),a+=this.blockSize;if("string"==typeof e){for(;a<t;)if(r[i++]=e.charCodeAt(a++),i==this.blockSize){n(this,r),i=0;break}}else for(;a<t;)if(r[i++]=e[a++],i==this.blockSize){n(this,r),i=0;break}}this.h=i,this.o+=t},t.prototype.A=function(){var e=Array((this.h<56?this.blockSize:2*this.blockSize)-this.h);e[0]=128;for(var t=1;t<e.length-8;++t)e[t]=0;t=8*this.o;for(var n=e.length-8;n<e.length;++n)e[n]=255&t,t/=256;for(this.v(e),e=Array(16),t=0,n=0;n<4;++n)for(let s=0;s<32;s+=8)e[t++]=this.g[n]>>>s&255;return e};var r={};function i(e){return-128<=e&&e<128?function(e,t){var n=r;return Object.prototype.hasOwnProperty.call(n,e)?n[e]:n[e]=t(e)}(e,function(e){return new s([0|e],e<0?-1:0)}):new s([0|e],e<0?-1:0)}function a(e){if(isNaN(e)||!isFinite(e))return o;if(e<0)return h(a(-e));const t=[];let n=1;for(let s=0;e>=n;s++)t[s]=e/n|0,n*=4294967296;return new s(t,0)}var o=i(0),B=i(1),c=i(16777216);function l(e){if(0!=e.h)return!1;for(let t=0;t<e.g.length;t++)if(0!=e.g[t])return!1;return!0}function u(e){return-1==e.h}function h(e){const t=e.g.length,n=[];for(let s=0;s<t;s++)n[s]=~e.g[s];return new s(n,~e.h).add(B)}function p(e,t){return e.add(h(t))}function d(e,t){for(;(65535&e[t])!=e[t];)e[t+1]+=e[t]>>>16,e[t]&=65535,t++}function f(e,t){this.g=e,this.h=t}function C(e,t){if(l(t))throw Error("division by zero");if(l(e))return new f(o,o);if(u(e))return t=C(h(e),t),new f(h(t.g),h(t.h));if(u(t))return t=C(e,h(t)),new f(h(t.g),t.h);if(e.g.length>30){if(u(e)||u(t))throw Error("slowDivide_ only works with positive integers.");for(var n=B,s=t;s.l(e)<=0;)n=g(n),s=g(s);var r=m(n,1),i=m(s,1);for(s=m(s,2),n=m(n,2);!l(s);){var c=i.add(s);c.l(e)<=0&&(r=r.add(n),i=c),s=m(s,1),n=m(n,1)}return t=p(e,r.j(t)),new f(r,t)}for(r=o;e.l(t)>=0;){for(n=Math.max(1,Math.floor(e.m()/t.m())),s=(s=Math.ceil(Math.log(n)/Math.LN2))<=48?1:Math.pow(2,s-48),c=(i=a(n)).j(t);u(c)||c.l(e)>0;)c=(i=a(n-=s)).j(t);l(i)&&(i=B),r=r.add(i),e=p(e,c)}return new f(r,e)}function g(e){const t=e.g.length+1,n=[];for(let s=0;s<t;s++)n[s]=e.i(s)<<1|e.i(s-1)>>>31;return new s(n,e.h)}function m(e,t){const n=t>>5;t%=32;const r=e.g.length-n,i=[];for(let s=0;s<r;s++)i[s]=t>0?e.i(s+n)>>>t|e.i(s+n+1)<<32-t:e.i(s+n);return new s(i,e.h)}(e=s.prototype).m=function(){if(u(this))return-h(this).m();let e=0,t=1;for(let n=0;n<this.g.length;n++){const s=this.i(n);e+=(s>=0?s:4294967296+s)*t,t*=4294967296}return e},e.toString=function(e){if((e=e||10)<2||36<e)throw Error("radix out of range: "+e);if(l(this))return"0";if(u(this))return"-"+h(this).toString(e);const t=a(Math.pow(e,6));var n=this;let s="";for(;;){const r=C(n,t).g;let i=(((n=p(n,r.j(t))).g.length>0?n.g[0]:n.h)>>>0).toString(e);if(l(n=r))return i+s;for(;i.length<6;)i="0"+i;s=i+s}},e.i=function(e){return e<0?0:e<this.g.length?this.g[e]:this.h},e.l=function(e){return u(e=p(this,e))?-1:l(e)?0:1},e.abs=function(){return u(this)?h(this):this},e.add=function(e){const t=Math.max(this.g.length,e.g.length),n=[];let r=0;for(let s=0;s<=t;s++){let t=r+(65535&this.i(s))+(65535&e.i(s)),i=(t>>>16)+(this.i(s)>>>16)+(e.i(s)>>>16);r=i>>>16,t&=65535,i&=65535,n[s]=i<<16|t}return new s(n,-2147483648&n[n.length-1]?-1:0)},e.j=function(e){if(l(this)||l(e))return o;if(u(this))return u(e)?h(this).j(h(e)):h(h(this).j(e));if(u(e))return h(this.j(h(e)));if(this.l(c)<0&&e.l(c)<0)return a(this.m()*e.m());const t=this.g.length+e.g.length,n=[];for(var r=0;r<2*t;r++)n[r]=0;for(r=0;r<this.g.length;r++)for(let t=0;t<e.g.length;t++){const s=this.i(r)>>>16,i=65535&this.i(r),a=e.i(t)>>>16,o=65535&e.i(t);n[2*r+2*t]+=i*o,d(n,2*r+2*t),n[2*r+2*t+1]+=s*o,d(n,2*r+2*t+1),n[2*r+2*t+1]+=i*a,d(n,2*r+2*t+1),n[2*r+2*t+2]+=s*a,d(n,2*r+2*t+2)}for(e=0;e<t;e++)n[e]=n[2*e+1]<<16|n[2*e];for(e=t;e<2*t;e++)n[e]=0;return new s(n,0)},e.B=function(e){return C(this,e).h},e.and=function(e){const t=Math.max(this.g.length,e.g.length),n=[];for(let s=0;s<t;s++)n[s]=this.i(s)&e.i(s);return new s(n,this.h&e.h)},e.or=function(e){const t=Math.max(this.g.length,e.g.length),n=[];for(let s=0;s<t;s++)n[s]=this.i(s)|e.i(s);return new s(n,this.h|e.h)},e.xor=function(e){const t=Math.max(this.g.length,e.g.length),n=[];for(let s=0;s<t;s++)n[s]=this.i(s)^e.i(s);return new s(n,this.h^e.h)},t.prototype.digest=t.prototype.A,t.prototype.reset=t.prototype.u,t.prototype.update=t.prototype.v,s.prototype.add=s.prototype.add,s.prototype.multiply=s.prototype.j,s.prototype.modulo=s.prototype.B,s.prototype.compare=s.prototype.l,s.prototype.toNumber=s.prototype.m,s.prototype.toString=s.prototype.toString,s.prototype.getBits=s.prototype.i,s.fromNumber=a,s.fromString=function e(t,n){if(0==t.length)throw Error("number format error: empty string");if((n=n||10)<2||36<n)throw Error("radix out of range: "+n);if("-"==t.charAt(0))return h(e(t.substring(1),n));if(t.indexOf("-")>=0)throw Error('number format error: interior "-" character');const s=a(Math.pow(n,8));let r=o;for(let e=0;e<t.length;e+=8){var i=Math.min(8,t.length-e);const o=parseInt(t.substring(e,e+i),n);i<8?(i=a(Math.pow(n,i)),r=r.j(i).add(a(o))):(r=r.j(s),r=r.add(a(o)))}return r},Yo=s}).apply(void 0!==Xo?Xo:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var Zo,eB,tB,nB,sB,rB,iB,aB,oB="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};(function(){var e,t=Object.defineProperty;var n=function(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof oB&&oB];for(var t=0;t<e.length;++t){var n=e[t];if(n&&n.Math==Math)return n}throw Error("Cannot find global object")}(this);function s(e,s){if(s)e:{var r=n;e=e.split(".");for(var i=0;i<e.length-1;i++){var a=e[i];if(!(a in r))break e;r=r[a]}(s=s(i=r[e=e[e.length-1]]))!=i&&null!=s&&t(r,e,{configurable:!0,writable:!0,value:s})}}s("Symbol.dispose",function(e){return e||Symbol("Symbol.dispose")}),s("Array.prototype.values",function(e){return e||function(){return this[Symbol.iterator]()}}),s("Object.entries",function(e){return e||function(e){var t,n=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.push([t,e[t]]);return n}});var r=r||{},i=this||self;function a(e){var t=typeof e;return"object"==t&&null!=e||"function"==t}function o(e,t,n){return e.call.apply(e.bind,arguments)}function B(e,t,n){return(B=o).apply(null,arguments)}function c(e,t){var n=Array.prototype.slice.call(arguments,1);return function(){var t=n.slice();return t.push.apply(t,arguments),e.apply(this,t)}}function l(e,t){function n(){}n.prototype=t.prototype,e.Z=t.prototype,e.prototype=new n,e.prototype.constructor=e,e.Ob=function(e,n,s){for(var r=Array(arguments.length-2),i=2;i<arguments.length;i++)r[i-2]=arguments[i];return t.prototype[n].apply(e,r)}}var u="undefined"!=typeof AsyncContext&&"function"==typeof AsyncContext.Snapshot?e=>e&&AsyncContext.Snapshot.wrap(e):e=>e;function h(e){const t=e.length;if(t>0){const n=Array(t);for(let s=0;s<t;s++)n[s]=e[s];return n}return[]}function p(e,t){for(let t=1;t<arguments.length;t++){const s=arguments[t];var n=typeof s;if("array"==(n="object"!=n?n:s?Array.isArray(s)?"array":n:"null")||"object"==n&&"number"==typeof s.length){n=e.length||0;const t=s.length||0;e.length=n+t;for(let r=0;r<t;r++)e[n+r]=s[r]}else e.push(s)}}function d(e){i.setTimeout(()=>{throw e},0)}function f(){var e=E;let t=null;return e.g&&(t=e.g,e.g=e.g.next,e.g||(e.h=null),t.next=null),t}var C=new class{constructor(e,t){this.i=e,this.j=t,this.h=0,this.g=null}get(){let e;return this.h>0?(this.h--,e=this.g,this.g=e.next,e.next=null):e=this.i(),e}}(()=>new g,e=>e.reset());class g{constructor(){this.next=this.g=this.h=null}set(e,t){this.h=e,this.g=t,this.next=null}reset(){this.next=this.g=this.h=null}}let m,w=!1,E=new class{constructor(){this.h=this.g=null}add(e,t){const n=C.get();n.set(e,t),this.h?this.h.next=n:this.g=n,this.h=n}},y=()=>{const e=Promise.resolve(void 0);m=()=>{e.then(D)}};function D(){for(var e;e=f();){try{e.h.call(e.g)}catch(e){d(e)}var t=C;t.j(e),t.h<100&&(t.h++,e.next=t.g,t.g=e)}w=!1}function _(){this.u=this.u,this.C=this.C}function b(e,t){this.type=e,this.g=this.target=t,this.defaultPrevented=!1}_.prototype.u=!1,_.prototype.dispose=function(){this.u||(this.u=!0,this.N())},_.prototype[Symbol.dispose]=function(){this.dispose()},_.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()},b.prototype.h=function(){this.defaultPrevented=!0};var v=function(){if(!i.addEventListener||!Object.defineProperty)return!1;var e=!1,t=Object.defineProperty({},"passive",{get:function(){e=!0}});try{const e=()=>{};i.addEventListener("test",e,t),i.removeEventListener("test",e,t)}catch(e){}return e}();function I(e){return/^[\s\xa0]*$/.test(e)}function T(e,t){b.call(this,e?e.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,e&&this.init(e,t)}l(T,b),T.prototype.init=function(e,t){const n=this.type=e.type,s=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:null;this.target=e.target||e.srcElement,this.g=t,(t=e.relatedTarget)||("mouseover"==n?t=e.fromElement:"mouseout"==n&&(t=e.toElement)),this.relatedTarget=t,s?(this.clientX=void 0!==s.clientX?s.clientX:s.pageX,this.clientY=void 0!==s.clientY?s.clientY:s.pageY,this.screenX=s.screenX||0,this.screenY=s.screenY||0):(this.clientX=void 0!==e.clientX?e.clientX:e.pageX,this.clientY=void 0!==e.clientY?e.clientY:e.pageY,this.screenX=e.screenX||0,this.screenY=e.screenY||0),this.button=e.button,this.key=e.key||"",this.ctrlKey=e.ctrlKey,this.altKey=e.altKey,this.shiftKey=e.shiftKey,this.metaKey=e.metaKey,this.pointerId=e.pointerId||0,this.pointerType=e.pointerType,this.state=e.state,this.i=e,e.defaultPrevented&&T.Z.h.call(this)},T.prototype.h=function(){T.Z.h.call(this);const e=this.i;e.preventDefault?e.preventDefault():e.returnValue=!1};var A="closure_listenable_"+(1e6*Math.random()|0),O=0;function S(e,t,n,s,r){this.listener=e,this.proxy=null,this.src=t,this.type=n,this.capture=!!s,this.ha=r,this.key=++O,this.da=this.fa=!1}function N(e){e.da=!0,e.listener=null,e.proxy=null,e.src=null,e.ha=null}function R(e,t,n){for(const s in e)t.call(n,e[s],s,e)}function k(e){const t={};for(const n in e)t[n]=e[n];return t}const L="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function x(e,t){let n,s;for(let t=1;t<arguments.length;t++){for(n in s=arguments[t],s)e[n]=s[n];for(let t=0;t<L.length;t++)n=L[t],Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n])}}function F(e){this.src=e,this.g={},this.h=0}function P(e,t){const n=t.type;if(n in e.g){var s,r=e.g[n],i=Array.prototype.indexOf.call(r,t,void 0);(s=i>=0)&&Array.prototype.splice.call(r,i,1),s&&(N(t),0==e.g[n].length&&(delete e.g[n],e.h--))}}function M(e,t,n,s){for(let r=0;r<e.length;++r){const i=e[r];if(!i.da&&i.listener==t&&i.capture==!!n&&i.ha==s)return r}return-1}F.prototype.add=function(e,t,n,s,r){const i=e.toString();(e=this.g[i])||(e=this.g[i]=[],this.h++);const a=M(e,t,s,r);return a>-1?(t=e[a],n||(t.fa=!1)):((t=new S(t,this.src,i,!!s,r)).fa=n,e.push(t)),t};var G="closure_lm_"+(1e6*Math.random()|0),U={};function H(e,t,n,s,r){if(Array.isArray(t)){for(let i=0;i<t.length;i++)H(e,t[i],n,s,r);return null}return n=K(n),e&&e[A]?e.J(t,n,!!a(s)&&!!s.capture,r):function(e,t,n,s,r,i){if(!t)throw Error("Invalid event type");const o=a(r)?!!r.capture:!!r;let B=q(e);if(B||(e[G]=B=new F(e)),n=B.add(t,n,s,o,i),n.proxy)return n;if(s=function(){function e(n){return t.call(e.src,e.listener,n)}const t=J;return e}(),n.proxy=s,s.src=e,s.listener=n,e.addEventListener)v||(r=o),void 0===r&&(r=!1),e.addEventListener(t.toString(),s,r);else if(e.attachEvent)e.attachEvent($(t.toString()),s);else{if(!e.addListener||!e.removeListener)throw Error("addEventListener and attachEvent are unavailable.");e.addListener(s)}return n}(e,t,n,!1,s,r)}function V(e,t,n,s,r){if(Array.isArray(t))for(var i=0;i<t.length;i++)V(e,t[i],n,s,r);else s=a(s)?!!s.capture:!!s,n=K(n),e&&e[A]?(e=e.i,(i=String(t).toString())in e.g&&((n=M(t=e.g[i],n,s,r))>-1&&(N(t[n]),Array.prototype.splice.call(t,n,1),0==t.length&&(delete e.g[i],e.h--)))):e&&(e=q(e))&&(t=e.g[t.toString()],e=-1,t&&(e=M(t,n,s,r)),(n=e>-1?t[e]:null)&&j(n))}function j(e){if("number"!=typeof e&&e&&!e.da){var t=e.src;if(t&&t[A])P(t.i,e);else{var n=e.type,s=e.proxy;t.removeEventListener?t.removeEventListener(n,s,e.capture):t.detachEvent?t.detachEvent($(n),s):t.addListener&&t.removeListener&&t.removeListener(s),(n=q(t))?(P(n,e),0==n.h&&(n.src=null,t[G]=null)):N(e)}}}function $(e){return e in U?U[e]:U[e]="on"+e}function J(e,t){if(e.da)e=!0;else{t=new T(t,this);const n=e.listener,s=e.ha||e.src;e.fa&&j(e),e=n.call(s,t)}return e}function q(e){return(e=e[G])instanceof F?e:null}var z="__closure_events_fn_"+(1e9*Math.random()>>>0);function K(e){return"function"==typeof e?e:(e[z]||(e[z]=function(t){return e.handleEvent(t)}),e[z])}function Q(){_.call(this),this.i=new F(this),this.M=this,this.G=null}function W(e,t){var n,s=e.G;if(s)for(n=[];s;s=s.G)n.push(s);if(e=e.M,s=t.type||t,"string"==typeof t)t=new b(t,e);else if(t instanceof b)t.target=t.target||e;else{var r=t;x(t=new b(s,e),r)}let i,a;if(r=!0,n)for(a=n.length-1;a>=0;a--)i=t.g=n[a],r=Y(i,s,!0,t)&&r;if(i=t.g=e,r=Y(i,s,!0,t)&&r,r=Y(i,s,!1,t)&&r,n)for(a=0;a<n.length;a++)i=t.g=n[a],r=Y(i,s,!1,t)&&r}function Y(e,t,n,s){if(!(t=e.i.g[String(t)]))return!0;t=t.concat();let r=!0;for(let i=0;i<t.length;++i){const a=t[i];if(a&&!a.da&&a.capture==n){const t=a.listener,n=a.ha||a.src;a.fa&&P(e.i,a),r=!1!==t.call(n,s)&&r}}return r&&!s.defaultPrevented}function X(e){e.g=function(e,t){if("function"!=typeof e){if(!e||"function"!=typeof e.handleEvent)throw Error("Invalid listener argument");e=B(e.handleEvent,e)}return Number(t)>2147483647?-1:i.setTimeout(e,t||0)}(()=>{e.g=null,e.i&&(e.i=!1,X(e))},e.l);const t=e.h;e.h=null,e.m.apply(null,t)}l(Q,_),Q.prototype[A]=!0,Q.prototype.removeEventListener=function(e,t,n,s){V(this,e,t,n,s)},Q.prototype.N=function(){if(Q.Z.N.call(this),this.i){var e=this.i;for(const t in e.g){const n=e.g[t];for(let e=0;e<n.length;e++)N(n[e]);delete e.g[t],e.h--}}this.G=null},Q.prototype.J=function(e,t,n,s){return this.i.add(String(e),t,!1,n,s)},Q.prototype.K=function(e,t,n,s){return this.i.add(String(e),t,!0,n,s)};class Z extends _{constructor(e,t){super(),this.m=e,this.l=t,this.h=null,this.i=!1,this.g=null}j(e){this.h=arguments,this.g?this.i=!0:X(this)}N(){super.N(),this.g&&(i.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function ee(e){_.call(this),this.h=e,this.g={}}l(ee,_);var te=[];function ne(e){R(e.g,function(e,t){this.g.hasOwnProperty(t)&&j(e)},e),e.g={}}ee.prototype.N=function(){ee.Z.N.call(this),ne(this)},ee.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var se=i.JSON.stringify,re=i.JSON.parse,ie=class{stringify(e){return i.JSON.stringify(e,void 0)}parse(e){return i.JSON.parse(e,void 0)}};function ae(){}function oe(){}var Be={OPEN:"a",hb:"b",ERROR:"c",tb:"d"};function ce(){b.call(this,"d")}function le(){b.call(this,"c")}l(ce,b),l(le,b);var ue={},he=null;function pe(){return he=he||new Q}function de(e){b.call(this,ue.Ia,e)}function fe(e){const t=pe();W(t,new de(t))}function Ce(e,t){b.call(this,ue.STAT_EVENT,e),this.stat=t}function ge(e){const t=pe();W(t,new Ce(t,e))}function me(e,t){b.call(this,ue.Ja,e),this.size=t}function we(e,t){if("function"!=typeof e)throw Error("Fn must not be null and must be a function");return i.setTimeout(function(){e()},t)}function Ee(){this.g=!0}function ye(e,t,n,s){e.info(function(){return"XMLHTTP TEXT ("+t+"): "+function(e,t){if(!e.g)return t;if(!t)return null;try{const i=JSON.parse(t);if(i)for(e=0;e<i.length;e++)if(Array.isArray(i[e])){var n=i[e];if(!(n.length<2)){var s=n[1];if(Array.isArray(s)&&!(s.length<1)){var r=s[0];if("noop"!=r&&"stop"!=r&&"close"!=r)for(let e=1;e<s.length;e++)s[e]=""}}}return se(i)}catch(e){return t}}(e,n)+(s?" "+s:"")})}ue.Ia="serverreachability",l(de,b),ue.STAT_EVENT="statevent",l(Ce,b),ue.Ja="timingevent",l(me,b),Ee.prototype.ua=function(){this.g=!1},Ee.prototype.info=function(){};var De,_e={NO_ERROR:0,cb:1,qb:2,pb:3,kb:4,ob:5,rb:6,Ga:7,TIMEOUT:8,ub:9},be={ib:"complete",Fb:"success",ERROR:"error",Ga:"abort",xb:"ready",yb:"readystatechange",TIMEOUT:"timeout",sb:"incrementaldata",wb:"progress",lb:"downloadprogress",Nb:"uploadprogress"};function ve(){}function Ie(e){return encodeURIComponent(String(e))}function Te(e){var t=1;e=e.split(":");const n=[];for(;t>0&&e.length;)n.push(e.shift()),t--;return e.length&&n.push(e.join(":")),n}function Ae(e,t,n,s){this.j=e,this.i=t,this.l=n,this.S=s||1,this.V=new ee(this),this.H=45e3,this.J=null,this.o=!1,this.u=this.B=this.A=this.M=this.F=this.T=this.D=null,this.G=[],this.g=null,this.C=0,this.m=this.v=null,this.X=-1,this.K=!1,this.P=0,this.O=null,this.W=this.L=this.U=this.R=!1,this.h=new Oe}function Oe(){this.i=null,this.g="",this.h=!1}l(ve,ae),ve.prototype.g=function(){return new XMLHttpRequest},De=new ve;var Se={},Ne={};function Re(e,t,n){e.M=1,e.A=st(Xe(t)),e.u=n,e.R=!0,ke(e,null)}function ke(e,t){e.F=Date.now(),Fe(e),e.B=Xe(e.A);var n=e.B,s=e.S;Array.isArray(s)||(s=[String(s)]),gt(n.i,"t",s),e.C=0,n=e.j.L,e.h=new Oe,e.g=sn(e.j,n?t:null,!e.u),e.P>0&&(e.O=new Z(B(e.Y,e,e.g),e.P)),t=e.V,n=e.g,s=e.ba;var r="readystatechange";Array.isArray(r)||(r&&(te[0]=r.toString()),r=te);for(let e=0;e<r.length;e++){const i=H(n,r[e],s||t.handleEvent,!1,t.h||t);if(!i)break;t.g[i.key]=i}t=e.J?k(e.J):{},e.u?(e.v||(e.v="POST"),t["Content-Type"]="application/x-www-form-urlencoded",e.g.ea(e.B,e.v,e.u,t)):(e.v="GET",e.g.ea(e.B,e.v,null,t)),fe(),function(e,t,n,s,r,i){e.info(function(){if(e.g)if(i){var a="",o=i.split("&");for(let e=0;e<o.length;e++){var B=o[e].split("=");if(B.length>1){const e=B[0];B=B[1];const t=e.split("_");a=t.length>=2&&"type"==t[1]?a+(e+"=")+B+"&":a+(e+"=redacted&")}}}else a=null;else a=i;return"XMLHTTP REQ ("+s+") [attempt "+r+"]: "+t+"\n"+n+"\n"+a})}(e.i,e.v,e.B,e.l,e.S,e.u)}function Le(e){return!!e.g&&("GET"==e.v&&2!=e.M&&e.j.Aa)}function xe(e,t){var n=e.C,s=t.indexOf("\n",n);return-1==s?Ne:(n=Number(t.substring(n,s)),isNaN(n)?Se:(s+=1)+n>t.length?Ne:(t=t.slice(s,s+n),e.C=s+n,t))}function Fe(e){e.T=Date.now()+e.H,Pe(e,e.H)}function Pe(e,t){if(null!=e.D)throw Error("WatchDog timer not null");e.D=we(B(e.aa,e),t)}function Me(e){e.D&&(i.clearTimeout(e.D),e.D=null)}function Ge(e){0==e.j.I||e.K||Xt(e.j,e)}function Ue(e){Me(e);var t=e.O;t&&"function"==typeof t.dispose&&t.dispose(),e.O=null,ne(e.V),e.g&&(t=e.g,e.g=null,t.abort(),t.dispose())}function He(e,t){try{var n=e.j;if(0!=n.I&&(n.g==e||qe(n.h,e)))if(!e.L&&qe(n.h,e)&&3==n.I){try{var s=n.Ba.g.parse(t)}catch(e){s=null}if(Array.isArray(s)&&3==s.length){var r=s;if(0==r[0]){e:if(!n.v){if(n.g){if(!(n.g.F+3e3<e.F))break e;Yt(n),Ht(n)}Kt(n),ge(18)}}else n.xa=r[1],0<n.xa-n.K&&r[2]<37500&&n.F&&0==n.A&&!n.C&&(n.C=we(B(n.Va,n),6e3));Je(n.h)<=1&&n.ta&&(n.ta=void 0)}else en(n,11)}else if((e.L||n.g==e)&&Yt(n),!I(t))for(r=n.Ba.g.parse(t),t=0;t<r.length;t++){let B=r[t];const l=B[0];if(!(l<=n.K))if(n.K=l,B=B[1],2==n.I)if("c"==B[0]){n.M=B[1],n.ba=B[2];const t=B[3];null!=t&&(n.ka=t,n.j.info("VER="+n.ka));const r=B[4];null!=r&&(n.za=r,n.j.info("SVER="+n.za));const l=B[5];null!=l&&"number"==typeof l&&l>0&&(s=1.5*l,n.O=s,n.j.info("backChannelRequestTimeoutMs_="+s)),s=n;const u=e.g;if(u){const e=u.g?u.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(e){var i=s.h;i.g||-1==e.indexOf("spdy")&&-1==e.indexOf("quic")&&-1==e.indexOf("h2")||(i.j=i.l,i.g=new Set,i.h&&(ze(i,i.h),i.h=null))}if(s.G){const e=u.g?u.g.getResponseHeader("X-HTTP-Session-Id"):null;e&&(s.wa=e,nt(s.J,s.G,e))}}n.I=3,n.l&&n.l.ra(),n.aa&&(n.T=Date.now()-e.F,n.j.info("Handshake RTT: "+n.T+"ms"));var a=e;if((s=n).na=nn(s,s.L?s.ba:null,s.W),a.L){Ke(s.h,a);var o=a,c=s.O;c&&(o.H=c),o.D&&(Me(o),Fe(o)),s.g=a}else zt(s);n.i.length>0&&jt(n)}else"stop"!=B[0]&&"close"!=B[0]||en(n,7);else 3==n.I&&("stop"==B[0]||"close"==B[0]?"stop"==B[0]?en(n,7):Ut(n):"noop"!=B[0]&&n.l&&n.l.qa(B),n.A=0)}fe()}catch(e){}}Ae.prototype.ba=function(e){e=e.target;const t=this.O;t&&3==Ft(e)?t.j():this.Y(e)},Ae.prototype.Y=function(e){try{if(e==this.g)e:{const B=Ft(this.g),c=this.g.ya();this.g.ca();if(!(B<3)&&(3!=B||this.g&&(this.h.h||this.g.la()||Pt(this.g)))){this.K||4!=B||7==c||fe(),Me(this);var t=this.g.ca();this.X=t;var n=function(e){if(!Le(e))return e.g.la();const t=Pt(e.g);if(""===t)return"";let n="";const s=t.length,r=4==Ft(e.g);if(!e.h.i){if("undefined"==typeof TextDecoder)return Ue(e),Ge(e),"";e.h.i=new i.TextDecoder}for(let i=0;i<s;i++)e.h.h=!0,n+=e.h.i.decode(t[i],{stream:!(r&&i==s-1)});return t.length=0,e.h.g+=n,e.C=0,e.h.g}(this);if(this.o=200==t,function(e,t,n,s,r,i,a){e.info(function(){return"XMLHTTP RESP ("+s+") [ attempt "+r+"]: "+t+"\n"+n+"\n"+i+" "+a})}(this.i,this.v,this.B,this.l,this.S,B,t),this.o){if(this.U&&!this.L){t:{if(this.g){var s,r=this.g;if((s=r.g?r.g.getResponseHeader("X-HTTP-Initial-Response"):null)&&!I(s)){var a=s;break t}}a=null}if(!(e=a)){this.o=!1,this.m=3,ge(12),Ue(this),Ge(this);break e}ye(this.i,this.l,e,"Initial handshake response via X-HTTP-Initial-Response"),this.L=!0,He(this,e)}if(this.R){let t;for(e=!0;!this.K&&this.C<n.length;){if(t=xe(this,n),t==Ne){4==B&&(this.m=4,ge(14),e=!1),ye(this.i,this.l,null,"[Incomplete Response]");break}if(t==Se){this.m=4,ge(15),ye(this.i,this.l,n,"[Invalid Chunk]"),e=!1;break}ye(this.i,this.l,t,null),He(this,t)}if(Le(this)&&0!=this.C&&(this.h.g=this.h.g.slice(this.C),this.C=0),4!=B||0!=n.length||this.h.h||(this.m=1,ge(16),e=!1),this.o=this.o&&e,e){if(n.length>0&&!this.W){this.W=!0;var o=this.j;o.g==this&&o.aa&&!o.P&&(o.j.info("Great, no buffering proxy detected. Bytes received: "+n.length),Qt(o),o.P=!0,ge(11))}}else ye(this.i,this.l,n,"[Invalid Chunked Response]"),Ue(this),Ge(this)}else ye(this.i,this.l,n,null),He(this,n);4==B&&Ue(this),this.o&&!this.K&&(4==B?Xt(this.j,this):(this.o=!1,Fe(this)))}else(function(e){const t={};e=(e.g&&Ft(e)>=2&&e.g.getAllResponseHeaders()||"").split("\r\n");for(let s=0;s<e.length;s++){if(I(e[s]))continue;var n=Te(e[s]);const r=n[0];if("string"!=typeof(n=n[1]))continue;n=n.trim();const i=t[r]||[];t[r]=i,i.push(n)}!function(e,t){for(const n in e)t.call(void 0,e[n],n,e)}(t,function(e){return e.join(", ")})})(this.g),400==t&&n.indexOf("Unknown SID")>0?(this.m=3,ge(12)):(this.m=0,ge(13)),Ue(this),Ge(this)}}}catch(e){}},Ae.prototype.cancel=function(){this.K=!0,Ue(this)},Ae.prototype.aa=function(){this.D=null;const e=Date.now();e-this.T>=0?(function(e,t){e.info(function(){return"TIMEOUT: "+t})}(this.i,this.B),2!=this.M&&(fe(),ge(17)),Ue(this),this.m=2,Ge(this)):Pe(this,this.T-e)};var Ve=class{constructor(e,t){this.g=e,this.map=t}};function je(e){this.l=e||10,i.PerformanceNavigationTiming?e=(e=i.performance.getEntriesByType("navigation")).length>0&&("hq"==e[0].nextHopProtocol||"h2"==e[0].nextHopProtocol):e=!!(i.chrome&&i.chrome.loadTimes&&i.chrome.loadTimes()&&i.chrome.loadTimes().wasFetchedViaSpdy),this.j=e?this.l:1,this.g=null,this.j>1&&(this.g=new Set),this.h=null,this.i=[]}function $e(e){return!!e.h||!!e.g&&e.g.size>=e.j}function Je(e){return e.h?1:e.g?e.g.size:0}function qe(e,t){return e.h?e.h==t:!!e.g&&e.g.has(t)}function ze(e,t){e.g?e.g.add(t):e.h=t}function Ke(e,t){e.h&&e.h==t?e.h=null:e.g&&e.g.has(t)&&e.g.delete(t)}function Qe(e){if(null!=e.h)return e.i.concat(e.h.G);if(null!=e.g&&0!==e.g.size){let t=e.i;for(const n of e.g.values())t=t.concat(n.G);return t}return h(e.i)}je.prototype.cancel=function(){if(this.i=Qe(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&0!==this.g.size){for(const e of this.g.values())e.cancel();this.g.clear()}};var We=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function Ye(e){let t;this.g=this.o=this.j="",this.u=null,this.m=this.h="",this.l=!1,e instanceof Ye?(this.l=e.l,Ze(this,e.j),this.o=e.o,this.g=e.g,et(this,e.u),this.h=e.h,tt(this,mt(e.i)),this.m=e.m):e&&(t=String(e).match(We))?(this.l=!1,Ze(this,t[1]||"",!0),this.o=rt(t[2]||""),this.g=rt(t[3]||"",!0),et(this,t[4]),this.h=rt(t[5]||"",!0),tt(this,t[6]||"",!0),this.m=rt(t[7]||"")):(this.l=!1,this.i=new ht(null,this.l))}function Xe(e){return new Ye(e)}function Ze(e,t,n){e.j=n?rt(t,!0):t,e.j&&(e.j=e.j.replace(/:$/,""))}function et(e,t){if(t){if(t=Number(t),isNaN(t)||t<0)throw Error("Bad port number "+t);e.u=t}else e.u=null}function tt(e,t,n){t instanceof ht?(e.i=t,function(e,t){t&&!e.j&&(pt(e),e.i=null,e.g.forEach(function(e,t){const n=t.toLowerCase();t!=n&&(dt(this,t),gt(this,n,e))},e)),e.j=t}(e.i,e.l)):(n||(t=it(t,lt)),e.i=new ht(t,e.l))}function nt(e,t,n){e.i.set(t,n)}function st(e){return nt(e,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),e}function rt(e,t){return e?t?decodeURI(e.replace(/%25/g,"%2525")):decodeURIComponent(e):""}function it(e,t,n){return"string"==typeof e?(e=encodeURI(e).replace(t,at),n&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function at(e){return"%"+((e=e.charCodeAt(0))>>4&15).toString(16)+(15&e).toString(16)}Ye.prototype.toString=function(){const e=[];var t=this.j;t&&e.push(it(t,ot,!0),":");var n=this.g;return(n||"file"==t)&&(e.push("//"),(t=this.o)&&e.push(it(t,ot,!0),"@"),e.push(Ie(n).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.u)&&e.push(":",String(n))),(n=this.h)&&(this.g&&"/"!=n.charAt(0)&&e.push("/"),e.push(it(n,"/"==n.charAt(0)?ct:Bt,!0))),(n=this.i.toString())&&e.push("?",n),(n=this.m)&&e.push("#",it(n,ut)),e.join("")},Ye.prototype.resolve=function(e){const t=Xe(this);let n=!!e.j;n?Ze(t,e.j):n=!!e.o,n?t.o=e.o:n=!!e.g,n?t.g=e.g:n=null!=e.u;var s=e.h;if(n)et(t,e.u);else if(n=!!e.h){if("/"!=s.charAt(0))if(this.g&&!this.h)s="/"+s;else{var r=t.h.lastIndexOf("/");-1!=r&&(s=t.h.slice(0,r+1)+s)}if(".."==(r=s)||"."==r)s="";else if(-1!=r.indexOf("./")||-1!=r.indexOf("/.")){s=0==r.lastIndexOf("/",0),r=r.split("/");const e=[];for(let t=0;t<r.length;){const n=r[t++];"."==n?s&&t==r.length&&e.push(""):".."==n?((e.length>1||1==e.length&&""!=e[0])&&e.pop(),s&&t==r.length&&e.push("")):(e.push(n),s=!0)}s=e.join("/")}else s=r}return n?t.h=s:n=""!==e.i.toString(),n?tt(t,mt(e.i)):n=!!e.m,n&&(t.m=e.m),t};var ot=/[#\/\?@]/g,Bt=/[#\?:]/g,ct=/[#\?]/g,lt=/[#\?@]/g,ut=/#/g;function ht(e,t){this.h=this.g=null,this.i=e||null,this.j=!!t}function pt(e){e.g||(e.g=new Map,e.h=0,e.i&&function(e,t){if(e){e=e.split("&");for(let n=0;n<e.length;n++){const s=e[n].indexOf("=");let r,i=null;s>=0?(r=e[n].substring(0,s),i=e[n].substring(s+1)):r=e[n],t(r,i?decodeURIComponent(i.replace(/\+/g," ")):"")}}}(e.i,function(t,n){e.add(decodeURIComponent(t.replace(/\+/g," ")),n)}))}function dt(e,t){pt(e),t=wt(e,t),e.g.has(t)&&(e.i=null,e.h-=e.g.get(t).length,e.g.delete(t))}function ft(e,t){return pt(e),t=wt(e,t),e.g.has(t)}function Ct(e,t){pt(e);let n=[];if("string"==typeof t)ft(e,t)&&(n=n.concat(e.g.get(wt(e,t))));else for(e=Array.from(e.g.values()),t=0;t<e.length;t++)n=n.concat(e[t]);return n}function gt(e,t,n){dt(e,t),n.length>0&&(e.i=null,e.g.set(wt(e,t),h(n)),e.h+=n.length)}function mt(e){const t=new ht;return t.i=e.i,e.g&&(t.g=new Map(e.g),t.h=e.h),t}function wt(e,t){return t=String(t),e.j&&(t=t.toLowerCase()),t}function Et(e,t,n,s,r){try{r&&(r.onload=null,r.onerror=null,r.onabort=null,r.ontimeout=null),s(n)}catch(e){}}function yt(){this.g=new ie}function Dt(e){this.i=e.Sb||null,this.h=e.ab||!1}function _t(e,t){Q.call(this),this.H=e,this.o=t,this.m=void 0,this.status=this.readyState=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.A=new Headers,this.h=null,this.F="GET",this.D="",this.g=!1,this.B=this.j=this.l=null,this.v=new AbortController}function bt(e){e.j.read().then(e.Ma.bind(e)).catch(e.ga.bind(e))}function vt(e){e.readyState=4,e.l=null,e.j=null,e.B=null,It(e)}function It(e){e.onreadystatechange&&e.onreadystatechange.call(e)}function Tt(e){let t="";return R(e,function(e,n){t+=n,t+=":",t+=e,t+="\r\n"}),t}function At(e,t,n){e:{for(s in n){var s=!1;break e}s=!0}s||(n=Tt(n),"string"==typeof e?null!=n&&Ie(n):nt(e,t,n))}function Ot(e){Q.call(this),this.headers=new Map,this.L=e||null,this.h=!1,this.g=null,this.D="",this.o=0,this.l="",this.j=this.B=this.v=this.A=!1,this.m=null,this.F="",this.H=!1}(e=ht.prototype).add=function(e,t){pt(this),this.i=null,e=wt(this,e);let n=this.g.get(e);return n||this.g.set(e,n=[]),n.push(t),this.h+=1,this},e.forEach=function(e,t){pt(this),this.g.forEach(function(n,s){n.forEach(function(n){e.call(t,n,s,this)},this)},this)},e.set=function(e,t){return pt(this),this.i=null,ft(this,e=wt(this,e))&&(this.h-=this.g.get(e).length),this.g.set(e,[t]),this.h+=1,this},e.get=function(e,t){return e&&(e=Ct(this,e)).length>0?String(e[0]):t},e.toString=function(){if(this.i)return this.i;if(!this.g)return"";const e=[],t=Array.from(this.g.keys());for(let s=0;s<t.length;s++){var n=t[s];const r=Ie(n);n=Ct(this,n);for(let t=0;t<n.length;t++){let s=r;""!==n[t]&&(s+="="+Ie(n[t])),e.push(s)}}return this.i=e.join("&")},l(Dt,ae),Dt.prototype.g=function(){return new _t(this.i,this.h)},l(_t,Q),(e=_t.prototype).open=function(e,t){if(0!=this.readyState)throw this.abort(),Error("Error reopening a connection");this.F=e,this.D=t,this.readyState=1,It(this)},e.send=function(e){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");if(this.v.signal.aborted)throw this.abort(),Error("Request was aborted.");this.g=!0;const t={headers:this.A,method:this.F,credentials:this.m,cache:void 0,signal:this.v.signal};e&&(t.body=e),(this.H||i).fetch(new Request(this.D,t)).then(this.Pa.bind(this),this.ga.bind(this))},e.abort=function(){this.response=this.responseText="",this.A=new Headers,this.status=0,this.v.abort(),this.j&&this.j.cancel("Request was aborted.").catch(()=>{}),this.readyState>=1&&this.g&&4!=this.readyState&&(this.g=!1,vt(this)),this.readyState=0},e.Pa=function(e){if(this.g&&(this.l=e,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=e.headers,this.readyState=2,It(this)),this.g&&(this.readyState=3,It(this),this.g)))if("arraybuffer"===this.responseType)e.arrayBuffer().then(this.Na.bind(this),this.ga.bind(this));else if(void 0!==i.ReadableStream&&"body"in e){if(this.j=e.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.B=new TextDecoder;bt(this)}else e.text().then(this.Oa.bind(this),this.ga.bind(this))},e.Ma=function(e){if(this.g){if(this.o&&e.value)this.response.push(e.value);else if(!this.o){var t=e.value?e.value:new Uint8Array(0);(t=this.B.decode(t,{stream:!e.done}))&&(this.response=this.responseText+=t)}e.done?vt(this):It(this),3==this.readyState&&bt(this)}},e.Oa=function(e){this.g&&(this.response=this.responseText=e,vt(this))},e.Na=function(e){this.g&&(this.response=e,vt(this))},e.ga=function(){this.g&&vt(this)},e.setRequestHeader=function(e,t){this.A.append(e,t)},e.getResponseHeader=function(e){return this.h&&this.h.get(e.toLowerCase())||""},e.getAllResponseHeaders=function(){if(!this.h)return"";const e=[],t=this.h.entries();for(var n=t.next();!n.done;)n=n.value,e.push(n[0]+": "+n[1]),n=t.next();return e.join("\r\n")},Object.defineProperty(_t.prototype,"withCredentials",{get:function(){return"include"===this.m},set:function(e){this.m=e?"include":"same-origin"}}),l(Ot,Q);var St=/^https?$/i,Nt=["POST","PUT"];function Rt(e,t){e.h=!1,e.g&&(e.j=!0,e.g.abort(),e.j=!1),e.l=t,e.o=5,kt(e),xt(e)}function kt(e){e.A||(e.A=!0,W(e,"complete"),W(e,"error"))}function Lt(e){if(e.h&&void 0!==r)if(e.v&&4==Ft(e))setTimeout(e.Ca.bind(e),0);else if(W(e,"readystatechange"),4==Ft(e)){e.h=!1;try{const r=e.ca();e:switch(r){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var t=!0;break e;default:t=!1}var n;if(!(n=t)){var s;if(s=0===r){let t=String(e.D).match(We)[1]||null;!t&&i.self&&i.self.location&&(t=i.self.location.protocol.slice(0,-1)),s=!St.test(t?t.toLowerCase():"")}n=s}if(n)W(e,"complete"),W(e,"success");else{e.o=6;try{var a=Ft(e)>2?e.g.statusText:""}catch(e){a=""}e.l=a+" ["+e.ca()+"]",kt(e)}}finally{xt(e)}}}function xt(e,t){if(e.g){e.m&&(clearTimeout(e.m),e.m=null);const n=e.g;e.g=null,t||W(e,"ready");try{n.onreadystatechange=null}catch(e){}}}function Ft(e){return e.g?e.g.readyState:0}function Pt(e){try{if(!e.g)return null;if("response"in e.g)return e.g.response;switch(e.F){case"":case"text":return e.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in e.g)return e.g.mozResponseArrayBuffer}return null}catch(e){return null}}function Mt(e,t,n){return n&&n.internalChannelParams&&n.internalChannelParams[e]||t}function Gt(e){this.za=0,this.i=[],this.j=new Ee,this.ba=this.na=this.J=this.W=this.g=this.wa=this.G=this.H=this.u=this.U=this.o=null,this.Ya=this.V=0,this.Sa=Mt("failFast",!1,e),this.F=this.C=this.v=this.m=this.l=null,this.X=!0,this.xa=this.K=-1,this.Y=this.A=this.D=0,this.Qa=Mt("baseRetryDelayMs",5e3,e),this.Za=Mt("retryDelaySeedMs",1e4,e),this.Ta=Mt("forwardChannelMaxRetries",2,e),this.va=Mt("forwardChannelRequestTimeoutMs",2e4,e),this.ma=e&&e.xmlHttpFactory||void 0,this.Ua=e&&e.Rb||void 0,this.Aa=e&&e.useFetchStreams||!1,this.O=void 0,this.L=e&&e.supportsCrossDomainXhr||!1,this.M="",this.h=new je(e&&e.concurrentRequestLimit),this.Ba=new yt,this.S=e&&e.fastHandshake||!1,this.R=e&&e.encodeInitMessageHeaders||!1,this.S&&this.R&&(this.R=!1),this.Ra=e&&e.Pb||!1,e&&e.ua&&this.j.ua(),e&&e.forceLongPolling&&(this.X=!1),this.aa=!this.S&&this.X&&e&&e.detectBufferingProxy||!1,this.ia=void 0,e&&e.longPollingTimeout&&e.longPollingTimeout>0&&(this.ia=e.longPollingTimeout),this.ta=void 0,this.T=0,this.P=!1,this.ja=this.B=null}function Ut(e){if(Vt(e),3==e.I){var t=e.V++,n=Xe(e.J);if(nt(n,"SID",e.M),nt(n,"RID",t),nt(n,"TYPE","terminate"),Jt(e,n),(t=new Ae(e,e.j,t)).M=2,t.A=st(Xe(n)),n=!1,i.navigator&&i.navigator.sendBeacon)try{n=i.navigator.sendBeacon(t.A.toString(),"")}catch(e){}!n&&i.Image&&((new Image).src=t.A,n=!0),n||(t.g=sn(t.j,null),t.g.ea(t.A)),t.F=Date.now(),Fe(t)}tn(e)}function Ht(e){e.g&&(Qt(e),e.g.cancel(),e.g=null)}function Vt(e){Ht(e),e.v&&(i.clearTimeout(e.v),e.v=null),Yt(e),e.h.cancel(),e.m&&("number"==typeof e.m&&i.clearTimeout(e.m),e.m=null)}function jt(e){if(!$e(e.h)&&!e.m){e.m=!0;var t=e.Ea;m||y(),w||(m(),w=!0),E.add(t,e),e.D=0}}function $t(e,t){var n;n=t?t.l:e.V++;const s=Xe(e.J);nt(s,"SID",e.M),nt(s,"RID",n),nt(s,"AID",e.K),Jt(e,s),e.u&&e.o&&At(s,e.u,e.o),n=new Ae(e,e.j,n,e.D+1),null===e.u&&(n.J=e.o),t&&(e.i=t.G.concat(e.i)),t=qt(e,n,1e3),n.H=Math.round(.5*e.va)+Math.round(.5*e.va*Math.random()),ze(e.h,n),Re(n,s,t)}function Jt(e,t){e.H&&R(e.H,function(e,n){nt(t,n,e)}),e.l&&R({},function(e,n){nt(t,n,e)})}function qt(e,t,n){n=Math.min(e.i.length,n);const s=e.l?B(e.l.Ka,e.l,e):null;e:{var r=e.i;let t=-1;for(;;){const e=["count="+n];-1==t?n>0?(t=r[0].g,e.push("ofs="+t)):t=0:e.push("ofs="+t);let B=!0;for(let c=0;c<n;c++){var i=r[c].g;const n=r[c].map;if((i-=t)<0)t=Math.max(0,r[c].g-100),B=!1;else try{i="req"+i+"_"||"";try{var o=n instanceof Map?n:Object.entries(n);for(const[t,n]of o){let s=n;a(n)&&(s=se(n)),e.push(i+t+"="+encodeURIComponent(s))}}catch(t){throw e.push(i+"type="+encodeURIComponent("_badmap")),t}}catch(e){s&&s(n)}}if(B){o=e.join("&");break e}}o=void 0}return e=e.i.splice(0,n),t.G=e,o}function zt(e){if(!e.g&&!e.v){e.Y=1;var t=e.Da;m||y(),w||(m(),w=!0),E.add(t,e),e.A=0}}function Kt(e){return!(e.g||e.v||e.A>=3)&&(e.Y++,e.v=we(B(e.Da,e),Zt(e,e.A)),e.A++,!0)}function Qt(e){null!=e.B&&(i.clearTimeout(e.B),e.B=null)}function Wt(e){e.g=new Ae(e,e.j,"rpc",e.Y),null===e.u&&(e.g.J=e.o),e.g.P=0;var t=Xe(e.na);nt(t,"RID","rpc"),nt(t,"SID",e.M),nt(t,"AID",e.K),nt(t,"CI",e.F?"0":"1"),!e.F&&e.ia&&nt(t,"TO",e.ia),nt(t,"TYPE","xmlhttp"),Jt(e,t),e.u&&e.o&&At(t,e.u,e.o),e.O&&(e.g.H=e.O);var n=e.g;e=e.ba,n.M=1,n.A=st(Xe(t)),n.u=null,n.R=!0,ke(n,e)}function Yt(e){null!=e.C&&(i.clearTimeout(e.C),e.C=null)}function Xt(e,t){var n=null;if(e.g==t){Yt(e),Qt(e),e.g=null;var s=2}else{if(!qe(e.h,t))return;n=t.G,Ke(e.h,t),s=1}if(0!=e.I)if(t.o)if(1==s){n=t.u?t.u.length:0,t=Date.now()-t.F;var r=e.D;W(s=pe(),new me(s,n)),jt(e)}else zt(e);else if(3==(r=t.m)||0==r&&t.X>0||!(1==s&&function(e,t){return!(Je(e.h)>=e.h.j-(e.m?1:0)||(e.m?(e.i=t.G.concat(e.i),0):1==e.I||2==e.I||e.D>=(e.Sa?0:e.Ta)||(e.m=we(B(e.Ea,e,t),Zt(e,e.D)),e.D++,0)))}(e,t)||2==s&&Kt(e)))switch(n&&n.length>0&&(t=e.h,t.i=t.i.concat(n)),r){case 1:en(e,5);break;case 4:en(e,10);break;case 3:en(e,6);break;default:en(e,2)}}function Zt(e,t){let n=e.Qa+Math.floor(Math.random()*e.Za);return e.isActive()||(n*=2),n*t}function en(e,t){if(e.j.info("Error code "+t),2==t){var n=B(e.bb,e),s=e.Ua;const t=!s;s=new Ye(s||"//www.google.com/images/cleardot.gif"),i.location&&"http"==i.location.protocol||Ze(s,"https"),st(s),t?function(e,t){const n=new Ee;if(i.Image){const s=new Image;s.onload=c(Et,n,"TestLoadImage: loaded",!0,t,s),s.onerror=c(Et,n,"TestLoadImage: error",!1,t,s),s.onabort=c(Et,n,"TestLoadImage: abort",!1,t,s),s.ontimeout=c(Et,n,"TestLoadImage: timeout",!1,t,s),i.setTimeout(function(){s.ontimeout&&s.ontimeout()},1e4),s.src=e}else t(!1)}(s.toString(),n):function(e,t){new Ee;const n=new AbortController,s=setTimeout(()=>{n.abort(),Et(0,0,!1,t)},1e4);fetch(e,{signal:n.signal}).then(e=>{clearTimeout(s),e.ok?Et(0,0,!0,t):Et(0,0,!1,t)}).catch(()=>{clearTimeout(s),Et(0,0,!1,t)})}(s.toString(),n)}else ge(2);e.I=0,e.l&&e.l.pa(t),tn(e),Vt(e)}function tn(e){if(e.I=0,e.ja=[],e.l){const t=Qe(e.h);0==t.length&&0==e.i.length||(p(e.ja,t),p(e.ja,e.i),e.h.i.length=0,h(e.i),e.i.length=0),e.l.oa()}}function nn(e,t,n){var s=n instanceof Ye?Xe(n):new Ye(n);if(""!=s.g)t&&(s.g=t+"."+s.g),et(s,s.u);else{var r=i.location;s=r.protocol,t=t?t+"."+r.hostname:r.hostname,r=+r.port;const e=new Ye(null);s&&Ze(e,s),t&&(e.g=t),r&&et(e,r),n&&(e.h=n),s=e}return n=e.G,t=e.wa,n&&t&&nt(s,n,t),nt(s,"VER",e.ka),Jt(e,s),s}function sn(e,t,n){if(t&&!e.L)throw Error("Can't create secondary domain capable XhrIo object.");return(t=e.Aa&&!e.ma?new Ot(new Dt({ab:n})):new Ot(e.ma)).Fa(e.L),t}function rn(){}function an(){}function on(e,t){Q.call(this),this.g=new Gt(t),this.l=e,this.h=t&&t.messageUrlParams||null,e=t&&t.messageHeaders||null,t&&t.clientProtocolHeaderRequired&&(e?e["X-Client-Protocol"]="webchannel":e={"X-Client-Protocol":"webchannel"}),this.g.o=e,e=t&&t.initMessageHeaders||null,t&&t.messageContentType&&(e?e["X-WebChannel-Content-Type"]=t.messageContentType:e={"X-WebChannel-Content-Type":t.messageContentType}),t&&t.sa&&(e?e["X-WebChannel-Client-Profile"]=t.sa:e={"X-WebChannel-Client-Profile":t.sa}),this.g.U=e,(e=t&&t.Qb)&&!I(e)&&(this.g.u=e),this.A=t&&t.supportsCrossDomainXhr||!1,this.v=t&&t.sendRawJson||!1,(t=t&&t.httpSessionIdParam)&&!I(t)&&(this.g.G=t,null!==(e=this.h)&&t in e&&(t in(e=this.h)&&delete e[t])),this.j=new ln(this)}function Bn(e){ce.call(this),e.__headers__&&(this.headers=e.__headers__,this.statusCode=e.__status__,delete e.__headers__,delete e.__status__);var t=e.__sm__;if(t){e:{for(const n in t){e=n;break e}e=void 0}(this.i=e)&&(e=this.i,t=null!==t&&e in t?t[e]:void 0),this.data=t}else this.data=e}function cn(){le.call(this),this.status=1}function ln(e){this.g=e}(e=Ot.prototype).Fa=function(e){this.H=e},e.ea=function(e,t,n,s){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+e);t=t?t.toUpperCase():"GET",this.D=e,this.l="",this.o=0,this.A=!1,this.h=!0,this.g=this.L?this.L.g():De.g(),this.g.onreadystatechange=u(B(this.Ca,this));try{this.B=!0,this.g.open(t,String(e),!0),this.B=!1}catch(e){return void Rt(this,e)}if(e=n||"",n=new Map(this.headers),s)if(Object.getPrototypeOf(s)===Object.prototype)for(var r in s)n.set(r,s[r]);else{if("function"!=typeof s.keys||"function"!=typeof s.get)throw Error("Unknown input type for opt_headers: "+String(s));for(const e of s.keys())n.set(e,s.get(e))}s=Array.from(n.keys()).find(e=>"content-type"==e.toLowerCase()),r=i.FormData&&e instanceof i.FormData,!(Array.prototype.indexOf.call(Nt,t,void 0)>=0)||s||r||n.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[e,t]of n)this.g.setRequestHeader(e,t);this.F&&(this.g.responseType=this.F),"withCredentials"in this.g&&this.g.withCredentials!==this.H&&(this.g.withCredentials=this.H);try{this.m&&(clearTimeout(this.m),this.m=null),this.v=!0,this.g.send(e),this.v=!1}catch(e){Rt(this,e)}},e.abort=function(e){this.g&&this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1,this.o=e||7,W(this,"complete"),W(this,"abort"),xt(this))},e.N=function(){this.g&&(this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1),xt(this,!0)),Ot.Z.N.call(this)},e.Ca=function(){this.u||(this.B||this.v||this.j?Lt(this):this.Xa())},e.Xa=function(){Lt(this)},e.isActive=function(){return!!this.g},e.ca=function(){try{return Ft(this)>2?this.g.status:-1}catch(e){return-1}},e.la=function(){try{return this.g?this.g.responseText:""}catch(e){return""}},e.La=function(e){if(this.g){var t=this.g.responseText;return e&&0==t.indexOf(e)&&(t=t.substring(e.length)),re(t)}},e.ya=function(){return this.o},e.Ha=function(){return"string"==typeof this.l?this.l:String(this.l)},(e=Gt.prototype).ka=8,e.I=1,e.connect=function(e,t,n,s){ge(0),this.W=e,this.H=t||{},n&&void 0!==s&&(this.H.OSID=n,this.H.OAID=s),this.F=this.X,this.J=nn(this,null,this.W),jt(this)},e.Ea=function(e){if(this.m)if(this.m=null,1==this.I){if(!e){this.V=Math.floor(1e5*Math.random()),e=this.V++;const r=new Ae(this,this.j,e);let i=this.o;if(this.U&&(i?(i=k(i),x(i,this.U)):i=this.U),null!==this.u||this.R||(r.J=i,i=null),this.S)e:{for(var t=0,n=0;n<this.i.length;n++){var s=this.i[n];if(void 0===(s="__data__"in s.map&&"string"==typeof(s=s.map.__data__)?s.length:void 0))break;if((t+=s)>4096){t=n;break e}if(4096===t||n===this.i.length-1){t=n+1;break e}}t=1e3}else t=1e3;t=qt(this,r,t),nt(n=Xe(this.J),"RID",e),nt(n,"CVER",22),this.G&&nt(n,"X-HTTP-Session-Id",this.G),Jt(this,n),i&&(this.R?t="headers="+Ie(Tt(i))+"&"+t:this.u&&At(n,this.u,i)),ze(this.h,r),this.Ra&&nt(n,"TYPE","init"),this.S?(nt(n,"$req",t),nt(n,"SID","null"),r.U=!0,Re(r,n,null)):Re(r,n,t),this.I=2}}else 3==this.I&&(e?$t(this,e):0==this.i.length||$e(this.h)||$t(this))},e.Da=function(){if(this.v=null,Wt(this),this.aa&&!(this.P||null==this.g||this.T<=0)){var e=4*this.T;this.j.info("BP detection timer enabled: "+e),this.B=we(B(this.Wa,this),e)}},e.Wa=function(){this.B&&(this.B=null,this.j.info("BP detection timeout reached."),this.j.info("Buffering proxy detected and switch to long-polling!"),this.F=!1,this.P=!0,ge(10),Ht(this),Wt(this))},e.Va=function(){null!=this.C&&(this.C=null,Ht(this),Kt(this),ge(19))},e.bb=function(e){e?(this.j.info("Successfully pinged google.com"),ge(2)):(this.j.info("Failed to ping google.com"),ge(1))},e.isActive=function(){return!!this.l&&this.l.isActive(this)},(e=rn.prototype).ra=function(){},e.qa=function(){},e.pa=function(){},e.oa=function(){},e.isActive=function(){return!0},e.Ka=function(){},an.prototype.g=function(e,t){return new on(e,t)},l(on,Q),on.prototype.m=function(){this.g.l=this.j,this.A&&(this.g.L=!0),this.g.connect(this.l,this.h||void 0)},on.prototype.close=function(){Ut(this.g)},on.prototype.o=function(e){var t=this.g;if("string"==typeof e){var n={};n.__data__=e,e=n}else this.v&&((n={}).__data__=se(e),e=n);t.i.push(new Ve(t.Ya++,e)),3==t.I&&jt(t)},on.prototype.N=function(){this.g.l=null,delete this.j,Ut(this.g),delete this.g,on.Z.N.call(this)},l(Bn,ce),l(cn,le),l(ln,rn),ln.prototype.ra=function(){W(this.g,"a")},ln.prototype.qa=function(e){W(this.g,new Bn(e))},ln.prototype.pa=function(e){W(this.g,new cn)},ln.prototype.oa=function(){W(this.g,"b")},an.prototype.createWebChannel=an.prototype.g,on.prototype.send=on.prototype.o,on.prototype.open=on.prototype.m,on.prototype.close=on.prototype.close,aB=function(){return new an},iB=function(){return pe()},rB=ue,sB={jb:0,mb:1,nb:2,Hb:3,Mb:4,Jb:5,Kb:6,Ib:7,Gb:8,Lb:9,PROXY:10,NOPROXY:11,Eb:12,Ab:13,Bb:14,zb:15,Cb:16,Db:17,fb:18,eb:19,gb:20},_e.NO_ERROR=0,_e.TIMEOUT=8,_e.HTTP_ERROR=6,nB=_e,be.COMPLETE="complete",tB=be,oe.EventType=Be,Be.OPEN="a",Be.CLOSE="b",Be.ERROR="c",Be.MESSAGE="d",Q.prototype.listen=Q.prototype.J,eB=oe,Ot.prototype.listenOnce=Ot.prototype.K,Ot.prototype.getLastError=Ot.prototype.Ha,Ot.prototype.getLastErrorCode=Ot.prototype.ya,Ot.prototype.getStatus=Ot.prototype.ca,Ot.prototype.getResponseJson=Ot.prototype.La,Ot.prototype.getResponseText=Ot.prototype.la,Ot.prototype.send=Ot.prototype.ea,Ot.prototype.setWithCredentials=Ot.prototype.Fa,Zo=Ot}).apply(void 0!==oB?oB:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var BB=class e{static FOLD_CASE=1;static LITERAL=2;static CLASS_NL=4;static DOT_NL=8;static ONE_LINE=16;static NON_GREEDY=32;static PERL_X=64;static UNICODE_GROUPS=128;static WAS_DOLLAR=256;static LOOKBEHIND=512;static MATCH_NL=e.CLASS_NL|e.DOT_NL;static PERL=e.CLASS_NL|e.ONE_LINE|e.PERL_X|e.UNICODE_GROUPS;static POSIX=0;static UNANCHORED=0;static ANCHOR_START=1;static ANCHOR_BOTH=2};const cB=1,lB=2,uB=4,hB=8,pB=16,dB=512,fB=128,CB=new Int32Array(fB),gB=new Int32Array(fB),mB=65535;for(let e=0;e<fB;e++)CB[e]=e>=97&&e<=122?e-32:e,gB[e]=e>=65&&e<=90?e+32:e;var wB=class{static CODES=Object.freeze({"":7,"\b":8,"\t":9,"\n":10,"\v":11,"\f":12,"\r":13," ":32,'"':34,$:36,"&":38,"'":39,"(":40,")":41,"*":42,"+":43,"-":45,".":46,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,":":58,"<":60,">":62,"?":63,A:65,B:66,C:67,F:70,P:80,Q:81,U:85,Z:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,a:97,b:98,f:102,i:105,m:109,n:110,r:114,s:115,t:116,v:118,x:120,z:122,"{":123,"|":124,"}":125});static toUpperCase(e){if(e<fB)return CB[e];const t=String.fromCodePoint(e).toUpperCase(),n=t.codePointAt(0)>mB?2:1;if(t.length>n)return e;const s=String.fromCodePoint(t.codePointAt(0)).toLowerCase(),r=s.codePointAt(0)>mB?2:1;return s.length>r||s.codePointAt(0)!==e?e:t.codePointAt(0)}static toLowerCase(e){if(e<fB)return gB[e];const t=String.fromCodePoint(e).toLowerCase(),n=t.codePointAt(0)>mB?2:1;if(t.length>n)return e;const s=String.fromCodePoint(t.codePointAt(0)).toUpperCase(),r=s.codePointAt(0)>mB?2:1;return s.length>r||s.codePointAt(0)!==e?e:t.codePointAt(0)}},EB=class{constructor(e,t=!1){this.data=e,this.isStride1=t,this.SIZE=t?2:3}getLo(e){return this.data[e*this.SIZE]}getHi(e){return this.data[e*this.SIZE+1]}getStride(e){return this.isStride1?1:this.data[e*this.SIZE+2]}get length(){return this.data.length/this.SIZE}};const yB=new Uint8Array(256);for(let e=0;e<64;e++)yB["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-".charCodeAt(e)]=e;const DB=e=>{const t=[];let n=0,s=0;for(let r=0;r<e.length;r++){const i=yB[e.charCodeAt(r)];n|=(31&i)<<s,32&i?s+=5:(t.push(n),n=0,s=0)}return t},_B=(e,t)=>{const n=DB(e),s=t?n.length/2:n.length/3,r=new Uint32Array(3*s);let i=0,a=0;for(let e=0;e<s;e++)i+=n[a++],r[3*e]=i,i+=n[a++],r[3*e+1]=i,r[3*e+2]=t?1:n[a++];return r};var bB=class{constructor(e){this.initializer=e,this.cache=new Map}has(e){return e in this.initializer}get(e){if(this.cache.has(e))return this.cache.get(e);const t=this.initializer[e],n=t?t():null;return this.cache.set(e,n),n}},vB=class{static _CASE_ORBIT=null;static get CASE_ORBIT(){return this._CASE_ORBIT||(this._CASE_ORBIT=(e=>{const t=DB(e),n=new Map;let s=0;for(let e=0;e<t.length;e+=2){s+=t[e];const r=t[e+1],i=r>>>1^-(1&r);n.set(s,s+i)}return n})("rCgCIgCY+rQI4QiCuuBLgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCCgCBgCBgCBgCBgCBgCBgCB+7OB-BB-BB-BB-BB-BBskQB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BC-BB-BB-BB-BB-BB-BB-BByHBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBDCBBBCBBBCBBCCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBCCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBxHBCBBBCBBB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BBDyBBxBgBCK2BCBMCD+CCDlBBq6ClBBCGGzW1CB0kCHHBpBBDCBhK0ECKgDCKHBJFBLHBJHBJFBMGCJHBpCDBNDBNDBNEBMDBnIFFECBDCBDEEBDBHGCBCBDDBLBBGbbBOBUzZzZBYBx5BvBBxBCCBBBDGCBCBCDDJCBCgDCJCCFuqeuqeCqBCUaCoEMCE8BCLECBICFCCDCCEUCBDBCEBCOCBCBCCCBQCZs5Vs5VBYBmmBnBBpEjBB9EKBCOBCGBCBBr3ByBB+EVB75CfBhsVfBhCYBoqZZBbZBbZBbCCBGDBDDBCBCHBbZBbBBCDBDHBCGBcBBCDBCEBCEEBFBcZBbZBbZBbZBbZBbZBfYBiBYBiBYBiBYBiBYBiB2pE2pEBgBBvgCZBHZBHZB",!1)),White_Space:()=>new EB(_B("JEBTlDlDbgvFgvFgsCKBeBBGwBwBh9DAB",!1))});static SCRIPTS=new bB({Adlam:()=>new EB(_B("go6DrCFJFB",!0)),Ahom:()=>new EB(_B("g4lCaDOFW",!0)),Anatolian_Hieroglyphs:()=>new EB(_B("ggxCmS",!0)),Arabic:()=>new EB(_B("gwBEBCFBCNBCCBCfBCJBMZBCrDBChBBxCvBBxHhBBGqCBCcBxy8BtPBDvEBhBPBxDEBCmEBk7DeBkCFBJIBiBFBh43BDBCaBCBBCDDCJBCDBCCCHFFCECBBBCBBCDDCICBCCDDBCGBCDBCDBCCCBIBCQBGCBCEBCQB1BBB",!1)),Armenian:()=>new EB(_B("xpBlBDxBDCks9BE",!0)),Avestan:()=>new EB(_B("g4iC1BEG",!0)),Balinese:()=>new EB(_B("g4GsCCxB",!0)),Bamum:()=>new EB(_B("g1pB3CpowB4R",!0)),Bassa_Vah:()=>new EB(_B("w26CdDF",!0)),Batak:()=>new EB(_B("g+GzBJD",!0)),Bengali:()=>new EB(_B("gsCDBCHBDBBDVBCGBCEEBCBDIBDBBDDBJFFBCCBDBDYB",!1)),Beria_Erfe:()=>new EB(_B("g17CYDY",!0)),Bhaiksuki:()=>new EB(_B("ggnCICsBCNLc",!0)),Bopomofo:()=>new EB(_B("qXB6wLqBxDf",!0)),Brahmi:()=>new EB(_B("ggkCtCFjBKA",!0)),Braille:()=>new EB(_B("ggK-H",!0)),Buginese:()=>new EB(_B("gwGbDB",!0)),Buhid:()=>new EB(_B("g6FT",!0)),Canadian_Aboriginal:()=>new EB(_B("ggF-TxRlC7tgCP",!0)),Carian:()=>new EB(_B("g1gCwB",!0)),Caucasian_Albanian:()=>new EB(_B("wphCzBMA",!0)),Chakma:()=>new EB(_B("gokC0BCR",!0)),Cham:()=>new EB(_B("gwqB2BKNDJDD",!0)),Cherokee:()=>new EB(_B("g9E1CDFz7lBvC",!0)),Chorasmian:()=>new EB(_B("w9jCb",!0)),Common:()=>new EB(_B("AgCBbFBbuBBCOBCEBYgBgBiOmBBGEBDTB1DKKHCC+THHPEEhB9E9ElQiEiEB6mB6mB2MDBjJwvBwvBBBBoCBBsGBBCumBumBOIIBCBCFBCCBDmYmYBKBD2CBCKBEKBCOBShBB-BlBBCCBDFBCaBCQBqBCBF5UBXKBW-cBhIzTBDpEBhQ9CBzMUBCCCBXBQHBFDB8CBBE7C7CB0E0EBOBhBlBBKxBxBB+BBgBwCBwB5C5CBmFBhuG-BBhoWhBBnDCBmFJB1HhFhFsMPPBzuUzuUBxGxGBIBXiBBCSBCDB0ECCBeBbFBbKBLuBuBBhChCBFBCGBLEBjICBFsBBEIBxCMB0BsBBlHaBltuBDB96D8HBEzNBHWBQQBgDzDB9B1HBLmBBD9BBEQBJBBIdBF8BB2GTBNTBN2CBKYBoE0CBCmCBCBBDDDBDDBCBCLBCCCBFBCgCBCDBDHBCGBCbBCDBCEBCEEBFBCzKBDjJBDxBByjFjCBtC8BBjWrBBFjDBNOBDOBCOBCkBBLtFB5BZBCBBOrBBFIBIBBPFB7E4eBEQBEMBE5GBHLBFQQBKBF3BBJJBHnBBJdBDLBFBBPIBoB3KBJNBDMBEKBE4BBCFFBOBDLBFJBIyEBCmDBnghYffB+CB",!1)),Coptic:()=>new EB(_B("ifNxkKzDGG",!0)),Cuneiform:()=>new EB(_B("ggoC5cnDuDCEMjG",!0)),Cypriot:()=>new EB(_B("ggiCFBDCCBqBBCBBEDD",!1)),Cypro_Minoan:()=>new EB(_B("w8rCiD",!0)),Cyrillic:()=>new EB(_B("ggBkEBDoFBx6FKBhFtCtCojEfBhie-CBv8VBBhw4B9BBiBAB",!1)),Deseret:()=>new EB(_B("gghCvC",!0)),Devanagari:()=>new EB(_B("goCwCFODZh7nBfhwcJ",!0)),Dives_Akuru:()=>new EB(_B("gomCGBDDDBGBCBBCdBCBBDLBKJB",!1)),Dogra:()=>new EB(_B("ggmC7B",!0)),Duployan:()=>new EB(_B("ggvDqDGMEIIJDD",!0)),Egyptian_Hieroglyphs:()=>new EB(_B("ggsC1iBL68D",!0)),Elbasan:()=>new EB(_B("gohCnB",!0)),Elymaic:()=>new EB(_B("g-jCW",!0)),Ethiopic:()=>new EB(_B("gwEoCBCDBDGBCCCBCBDoBBCDBDgBBCDBDGBCCCBCBDOBC4BBCDBDiCBDfBEZBnvGWBKGBCGBCGBCGBCGBCGBCGBCGBjpfFBDFBDFBKGBCGBylvCGBCDBCBBCOB",!1)),Garay:()=>new EB(_B("gqjClBEcJB",!0)),Georgian:()=>new EB(_B("glElBBCGGDqBBCDBx8CqBBDCBhiElBBCGG",!1)),Glagolitic:()=>new EB(_B("ggL-Ch9sDGCQDGCBCE",!0)),Gothic:()=>new EB(_B("w5gCa",!0)),Grantha:()=>new EB(_B("g4kCDBCHBDBBDVBCGBCBBCEBDIBDBBDCBDHHGGBDGBEEB",!1)),Greek:()=>new EB(_B("wbDBCCBDDBCFFCCCBBBCCCBSBC+BBPPBnpGEBzBEBFEB1ChKhKBUBDFBDlBBDFBDHBCGCBdBD0BBCOBCNBDFBCSBDCBCIBoJ-xiB-xiB7uVuCBSgj0Bgj0BBkCB",!1)),Gujarati:()=>new EB(_B("h0CCBCIBCCBCVBCGBCBBCEBDJBCCBCCBDQQBCBDLBIGB",!1)),Gunjala_Gondi:()=>new EB(_B("grnCFCBCkBCBCFIJ",!0)),Gurmukhi:()=>new EB(_B("hwCCBCFBFBBDVBCGBCBBCBBCBBDCCBDBFBBDCBEIIBCBCIIBPB",!1)),Gurung_Khema:()=>new EB(_B("go4C5B",!0)),Han:()=>new EB(_B("g0LZBC4CBN1GBwBCCaIBPDBle-tGBhC-vUBhoWtLBDpDBpodBBNGBqgkB-2pBBhB9oEBDt0FBDwpHBQtTBjtC9QBjvBq6EBGppIB",!1)),Hangul:()=>new EB(_B("goE-HvxHBiI9CyDeiCei3dckUj9KNWFwBl9JeEFDFDFDC",!0)),Hanifi_Rohingya:()=>new EB(_B("gojCnBJJ",!0)),Hanunoo:()=>new EB(_B("g5FU",!0)),Hatran:()=>new EB(_B("gniCSCBGE",!0)),Hebrew:()=>new EB(_B("xsB2BBJaBFFBpp9BZBCEBCCCBCCBCCBIB",!1)),Hiragana:()=>new EB(_B("hiM1CBHCBi7-C+IBTeeBBBulQAB",!1)),Imperial_Aramaic:()=>new EB(_B("giiCVCI",!0)),Inherited:()=>new EB(_B("gYvDB2IBBlOKBbhXhXBCB8qEtBBDLBlPCBCMBCGBFHHEBBnG-BBtQBBjGgBB65DDBsDBBmrzBPBRNBwejHjH7iEl+uBl+uBBsBBDWBhRCBSHBDGBfDBz6rYvHB",!1)),Inscriptional_Pahlavi:()=>new EB(_B("g7iCSGH",!0)),Inscriptional_Parthian:()=>new EB(_B("g6iCVDH",!0)),Javanese:()=>new EB(_B("gsqBtCDJFB",!0)),Kaithi:()=>new EB(_B("gkkCiCLA",!0)),Kannada:()=>new EB(_B("gkDMCCCWCJCEDICCCDIBGCCDDJCC",!0)),Katakana:()=>new EB(_B("hlM5CBDCBxHPBxGuBBC3CBvgzBJBCsBBzisBDBCGBCBBCgJgJBBBzBPPBCB",!1)),Kawi:()=>new EB(_B("g4nCQCoBEc",!0)),Kayah_Li:()=>new EB(_B("goqBtBCA",!0)),Kharoshthi:()=>new EB(_B("gwiCDCBGHCCCcDCFJII",!0)),Khitan_Small_Script:()=>new EB(_B("k-7C84G84GB0OBqBAB",!1)),Khmer:()=>new EB(_B("g8F9CDJHJnPf",!0)),Khojki:()=>new EB(_B("gwkCRCuB",!0)),Khudawadi:()=>new EB(_B("w1kC6BGJ",!0)),Kirat_Rai:()=>new EB(_B("gq7C5B",!0)),Lao:()=>new EB(_B("h0DBBCCCBDBCXBCCCBVBDEBCCCBFBCJBDDB",!1)),Latin:()=>new EB(_B("hCZBHZBwBQQGWBCeBCgOBoBEB8wGlBBHwBBGDBGMBClCBiC-HByLOORMBuEBBHccSoBB42CfBj1elDBExCBVOBxZqBBCIBCDB38TGB7gBZBHZBmhCFBCpBBCIBm61BeBHFB",!1)),Lepcha:()=>new EB(_B("ggH3BEOEC",!0)),Limbu:()=>new EB(_B("goGeBCLBFLBFEEBKB",!1)),Linear_A:()=>new EB(_B("gwhC2JKVLH",!0)),Linear_B:()=>new EB(_B("gggCLCZCSCBCODNjB6D",!0)),Lisu:()=>new EB(_B("wmpBvBx1eA",!0)),Lycian:()=>new EB(_B("g0gCc",!0)),Lydian:()=>new EB(_B("gpiCZGA",!0)),Mahajani:()=>new EB(_B("wqkCmB",!0)),Makasar:()=>new EB(_B("g3nCY",!0)),Malayalam:()=>new EB(_B("goDMCCCyBCCCFFPDZ",!0)),Mandaic:()=>new EB(_B("giCbDA",!0)),Manichaean:()=>new EB(_B("g2iCmBFL",!0)),Marchen:()=>new EB(_B("wjnCfDVCN",!0)),Masaram_Gondi:()=>new EB(_B("gonCGBCBBCrBBECCBCCBHBJJB",!1)),Medefaidrin:()=>new EB(_B("gy7C6C",!0)),Meetei_Mayek:()=>new EB(_B("g3qBWqGtBDJ",!0)),Mende_Kikakui:()=>new EB(_B("gg6DkGDP",!0)),Meroitic_Cursive:()=>new EB(_B("gtiCXFTDtB",!0)),Meroitic_Hieroglyphs:()=>new EB(_B("gsiCf",!0)),Miao:()=>new EB(_B("g47CqCF4BIQ",!0)),Modi:()=>new EB(_B("gwlCkCMJ",!0)),Mongolian:()=>new EB(_B("ggGBBDCCBSBH4CBIqBB2t-BMB",!1)),Mro:()=>new EB(_B("gy6CeCJFB",!0)),Multani:()=>new EB(_B("g0kCGBCCCBCBCOBCKB",!1)),Myanmar:()=>new EB(_B("ggE-EhqmBeiDfxibT",!0)),Nabataean:()=>new EB(_B("gkiCeJI",!0)),Nag_Mundari:()=>new EB(_B("wm5DpB",!0)),Nandinagari:()=>new EB(_B("gtmCHDtBDK",!0)),New_Tai_Lue:()=>new EB(_B("gsGrBFZHKEB",!0)),Newa:()=>new EB(_B("gglC7CCE",!0)),Nko:()=>new EB(_B("g+B6BDC",!0)),Nushu:()=>new EB(_B("h-7CvsQvsQBqMB",!1)),Nyiakeng_Puachue_Hmong:()=>new EB(_B("go4DsBENDJFB",!0)),Ogham:()=>new EB(_B("g0Fc",!0)),Ol_Chiki:()=>new EB(_B("wiHvB",!0)),Ol_Onal:()=>new EB(_B("wu5DqBFA",!0)),Old_Hungarian:()=>new EB(_B("gkjCyBOyBIF",!0)),Old_Italic:()=>new EB(_B("g4gCjBKC",!0)),Old_North_Arabian:()=>new EB(_B("g0iCf",!0)),Old_Permic:()=>new EB(_B("w6gCqB",!0)),Old_Persian:()=>new EB(_B("g9gCjBFN",!0)),Old_Sogdian:()=>new EB(_B("g4jCnB",!0)),Old_South_Arabian:()=>new EB(_B("gziCf",!0)),Old_Turkic:()=>new EB(_B("ggjCoC",!0)),Old_Uyghur:()=>new EB(_B("w7jCZ",!0)),Oriya:()=>new EB(_B("h4CCCHDBDVCGCBCEDIDBDCICFBCEDR",!0)),Osage:()=>new EB(_B("wlhCjBFjB",!0)),Osmanya:()=>new EB(_B("gkhCdDJ",!0)),Pahawh_Hmong:()=>new EB(_B("g46ClCLJCGCUGS",!0)),Palmyrene:()=>new EB(_B("gjiCf",!0)),Pau_Cin_Hau:()=>new EB(_B("g2mC4B",!0)),Phags_Pa:()=>new EB(_B("giqB3B",!0)),Phoenician:()=>new EB(_B("goiCbEA",!0)),Psalter_Pahlavi:()=>new EB(_B("g8iCRIDNG",!0)),Rejang:()=>new EB(_B("wpqBjBMA",!0)),Runic:()=>new EB(_B("g1FqCEK",!0)),Samaritan:()=>new EB(_B("ggCtBDO",!0)),Saurashtra:()=>new EB(_B("gkqBlCJL",!0)),Sharada:()=>new EB(_B("gskC-ChsCH",!0)),Shavian:()=>new EB(_B("wihCvB",!0)),Siddham:()=>new EB(_B("gslC1BDlB",!0)),Sidetic:()=>new EB(_B("gqiCZ",!0)),SignWriting:()=>new EB(_B("gg2DrUQECO",!0)),Sinhala:()=>new EB(_B("hsDCBCRBEXBCIBCDDBFBEFFBEBCCCBGBHJBDCBt-gCTB",!1)),Sogdian:()=>new EB(_B("w5jCpB",!0)),Sora_Sompeng:()=>new EB(_B("wmkCYIJ",!0)),Soyombo:()=>new EB(_B("wymCyC",!0)),Sundanese:()=>new EB(_B("g8G-BhIH",!0)),Sunuwar:()=>new EB(_B("g+mChBPJ",!0)),Syloti_Nagri:()=>new EB(_B("ggqBsB",!0)),Syriac:()=>new EB(_B("g4BNC7BDCxIK",!0)),Tagalog:()=>new EB(_B("g4FVKA",!0)),Tagbanwa:()=>new EB(_B("g7FMCCCB",!0)),Tai_Le:()=>new EB(_B("wqGdDE",!0)),Tai_Tham:()=>new EB(_B("gxG+BCcDKHJHN",!0)),Tai_Viet:()=>new EB(_B("g0qBiCZE",!0)),Tai_Yo:()=>new EB(_B("g25DeCVJB",!0)),Takri:()=>new EB(_B("g0lC5BHJ",!0)),Tamil:()=>new EB(_B("i8CBBCFBECBCDBEBBCCCBEEBEEBBBELBFEBECBCDBDHHPUBm+kCxBBOAB",!1)),Tangsa:()=>new EB(_B("wz6CuCCJ",!0)),Tangut:()=>new EB(_B("g-7CgBgBB+3GBhQeBiDyDB",!1)),Telugu:()=>new EB(_B("ggDMCCCWCPDICCCDIBCCCBDDDJII",!0)),Thaana:()=>new EB(_B("g8BxB",!0)),Thai:()=>new EB(_B("hwD5BGb",!0)),Tibetan:()=>new EB(_B("g4DnCCjBFmBCjBCOCGFB",!0)),Tifinagh:()=>new EB(_B("wpL3BIBPA",!0)),Tirhuta:()=>new EB(_B("gklCnCJJ",!0)),Todhri:()=>new EB(_B("guhCzB",!0)),Tolong_Siki:()=>new EB(_B("wtnCrBFJ",!0)),Toto:()=>new EB(_B("w04De",!0)),Tulu_Tigalari:()=>new EB(_B("g8kCJBCDDClBBCJBCDDCDBCJBCBBJBB",!1)),Ugaritic:()=>new EB(_B("g8gCdCA",!0)),Unknown:()=>new EB(_B("4bBBHDBICCVuMuMnBBBzBBBE4B4BBGBcDBHKBvI9B9BBmDmDBMB8BBByBBBQddBCCMEBjBEBuHJJBDDBXXICCBBBFBBKBBDBBFHBCDBDGGBaaBEEHDBDBBXIIDGDBCCGDBDBBECBCGBFCCBFBSJBEKKEXXIDDGBBLIEBCCBNBFBBNGBIEEJBBDBBXIIDGGBKKBDDBEEBFBEDBDGGBTTBIBDHHBBBEFFBBBDCCDCBDCBECBNDBGCBEFFBCCBEBCNBWEBOEEYRRBKKEFFBFBDEEDBBFBBLGBXEEYLLGBBKEEFGBDEBEFFBLLELBOEE0BEEHDBRBBbEETCBZKKCBBICBCDBHCCJFBLBBELB7BDBekBBDCCGZZCYYBGGCIILBBFfBpClBlBBCBoBlBlBQOOBjBBnGCCBDBCBB6LFFBIICFFBqBqBFBBiBFFBIICFFBQQ6BFFBkCkCBhBhBBBBbFB3CBBHBB+UCB6CGBXIBZIBVLBOEEDLB-CBBLFBLFBbFB6CGBsBEBnCJBgBNNBCBNDBCCBrBBBGKBtBDBbFBMCB-BBBiCeeBMMBEBLFBPBBvBBBNTBuCnFnFBGB9BCBQCB-BEBsBBBMHBsBEB3QBBHBBnBBBHBBJGCgBBB2BQQPBBHUUBEEKmDmDNBBcOOBBBjBNBiBOBtEDB7UVBMUB14BBB-LEBuBCCBDBCBB5BGBDNBZIBI4BI-DhBBb6C6CBKB3GZBxC3C3CBoDo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1D7BB3HJBoBBBjGUBnC5DBVLBVLB4CIBamEB2CoCoCDBBCBBDBBFNNCIIiCFFBJJIddFGGCCBI1K1KBlJlJB-V-VBNBGQQBuiBBgBFBH0GBISSBIIDGGBDB-BgBBCvDBuBCBPBBLDBD-JBgBQB7BEBCvOBrB1GBsBDBC-FBgBXXBGBD-GBIFFDQQmGBBRoBBtCDBLDBDwYBlCrCB+BhGBFccDCCBCCLFFCCCBEBCDBCECEDDCBBCICDCCBFFIKFCLLSEBEGGSzBBDtIBtBDBlDLBQBBQQQmBJBvF3BBeMBtBDBKGBDNBH5EB6eCBSCBOCB7GFBNDBCOBNDB5BHBLFBpBHBfBBNDBDNBKmBB5KHBPBBOCBMCB6BCCBCBRBBNDBLGB0EoDoDBjgBBh3pBfB-oEBBv0FBBypHOBvThtCB-QhvBBs6EEBrpIm8yVBCdBhD-DBxHvw-FB",!1)),Vai:()=>new EB(_B("gopBrJ",!0)),Vithkuqi:()=>new EB(_B("wrhCKCOCGCBCKCOCGCB",!0)),Wancho:()=>new EB(_B("g24D5BGA",!0)),Warang_Citi:()=>new EB(_B("glmCyCNA",!0)),Yezidi:()=>new EB(_B("g0jCpBCCDB",!0)),Yi:()=>new EB(_B("ggoBskBE2B",!0)),Zanabazar_Square:()=>new EB(_B("gwmCnC",!0))});static FOLD_CATEGORIES=new bB({L:()=>new EB(_B("laA",!0)),LC:()=>new EB(_B("laA",!0)),Ll:()=>new EB(_B("hCZBmDWBCGBiBuBCEECDOCDuBCBECEBBCCCBCCBBBDDBCBBCCBEBBCBBCECBCCDCCBCCBBBCCCBEEIBBCBBCBBCOCDQCDBBCCCBBBC4BCIBBCBBDCCBCBCGC3HrBrBCEEJHHCCBCCCBCCBPBCIBkBJJCUCGDDCBBDyBBxBgBCK2BCBMCD+CCDlBBq6ClBBCGGzW1CB0kCHHBpBBDCBhK0ECKgDCKHBJFBLHBJHBJFBMGCJHBZHBJHBJHBJEBMEBMDBNEBMEBqJEEBHHxC9zC9zCBuBBxB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ZzZBYBx5BvBBxBCCBBBDGCBCBCDDJCBCgDCJCCFuqeuqeCqBCUaCoEMCE8BCLECBICFCCDCCEUCBDBCEBCOCBCBCCCBQCZs5Vs5VBYBmmBnBBpEjBB9EKBCOBCGBCBBr3ByBB+EVB75CfBhsVfBhCYBoyehBB",!1)),Math:()=>new EB(_B("ycGDCHHFMMDDDCHHFAB",!1)),Uppercase:()=>new EB(_B("hDZB7BqBqBBWBCHBCuBCEECDOCDsBCDECBBBDCCDEEGDDECBDDDCCCDFFDEECDDECCGBBCBBCBBCOCBSCDBBCEECkBCEQCJDDBCCFICBEBCBBCCCBEEBCCBCBCEBDCCBDDIDDCBBEFBGLLBnFnFsBCCEEEBBBvBDBCdBCBBECBCWCBDBCGD1BvBBCgBCK0BCDMCBgDCyBlBBq6CqBBDCB5XFBjkCIBCvHvHERRzD0ECGGGC8CCBHBJFBLHBJHBJFBMGCJHBJNBzBBBNSSBPPBEEpLiBiBBOBFsasaBYBn6BvBBCEEBGCHDDLiDCJCCFNNBkBBCGG0oesBCUaCoEMCE8BCLCCDICFFFCBBDSCMOCFCCDOCb9a9advCBi8UZBumBnBBpEjBB8EKBCOBCGBCBBk4ByBB+DVB75CfBhsVfB8BYBvyehBB",!1))});static FOLD_SCRIPT=new bB({Common:()=>new EB(_B("8cgBgB",!1)),Greek:()=>new EB(_B("1FwUwU",!1)),Inherited:()=>new EB(_B("5cgBgBlgHAB",!1))})},IB=class e{static MAX_RUNE=1114111;static RUNE_ERROR=65533;static isUnsearchable(t){return t===e.RUNE_ERROR||t>=e.MIN_HIGH_SURROGATE&&t<=e.MAX_LOW_SURROGATE}static MAX_ASCII=127;static MAX_LATIN1=255;static MAX_BMP=65535;static MIN_FOLD=65;static MAX_FOLD=125251;static MIN_HIGH_SURROGATE=55296;static MAX_HIGH_SURROGATE=56319;static MIN_LOW_SURROGATE=56320;static MAX_LOW_SURROGATE=57343;static MIN_SUPPLEMENTARY_CODE_POINT=65536;static is32(e,t){let n=0,s=e.length;for(;n<s;){const r=n+Math.floor((s-n)/2),i=e.getLo(r),a=e.getHi(r);if(i<=t&&t<=a){return(t-i)%e.getStride(r)===0}t<i?s=r:n=r+1}return!1}static is(t,n){if(n<=e.MAX_LATIN1){for(let e=0;e<t.length;e++){if(n>t.getHi(e))continue;const s=t.getLo(e);if(n<s)return!1;return(n-s)%t.getStride(e)===0}return!1}return t.length>0&&n>=t.getLo(0)&&e.is32(t,n)}static isPrint(t){return t<=e.MAX_LATIN1?t>=32&&t<e.MAX_ASCII||t>=161&&173!==t:e.is(vB.Print,t)}static simpleFold(t){if(vB.CASE_ORBIT.has(t))return vB.CASE_ORBIT.get(t);if(t<=e.MAX_ASCII){const e=wB.toLowerCase(t);return e!==t?e:wB.toUpperCase(t)}return t}static equalsIgnoreCase(t,n){if(t===n)return!0;if(t<0||n<0)return!1;if(t<=e.MAX_ASCII&&n<=e.MAX_ASCII)return 65<=t&&t<=90&&(t|=32),65<=n&&n<=90&&(n|=32),t===n;for(let s=e.simpleFold(t);s!==t;s=e.simpleFold(s))if(s===n)return!0;return!1}};const TB=new Uint8Array(256);for(let e=0;e<256;e++)TB[e]=97<=e&&e<=122||65<=e&&e<=90||48<=e&&e<=57||95===e?1:0;let AB=null,OB=null;var SB=class e{static METACHARACTERS="\\.+*?()|[]{}^$";static EMPTY_BEGIN_LINE=1;static EMPTY_END_LINE=2;static EMPTY_BEGIN_TEXT=4;static EMPTY_END_TEXT=8;static EMPTY_WORD_BOUNDARY=16;static EMPTY_NO_WORD_BOUNDARY=32;static EMPTY_ALL=-1;static emptyInts(){return[]}static isByteArray(e){return Array.isArray(e)||"[object Uint8Array]"===Object.prototype.toString.call(e)}static isalnum(e){return wB.CODES[0]<=e&&e<=wB.CODES[9]||wB.CODES.a<=e&&e<=wB.CODES.z||wB.CODES.A<=e&&e<=wB.CODES.Z}static unhex(e){return wB.CODES[0]<=e&&e<=wB.CODES[9]?e-wB.CODES[0]:wB.CODES.a<=e&&e<=wB.CODES.f?e-wB.CODES.a+10:wB.CODES.A<=e&&e<=wB.CODES.F?e-wB.CODES.A+10:-1}static escapeRune(t){let n="";if(IB.isPrint(t))e.METACHARACTERS.indexOf(String.fromCodePoint(t))>=0&&(n+="\\"),n+=String.fromCodePoint(t);else switch(t){case wB.CODES['"']:n+='\\"';break;case wB.CODES["\\"]:n+="\\\\";break;case wB.CODES["\t"]:n+="\\t";break;case wB.CODES["\n"]:n+="\\n";break;case wB.CODES["\r"]:n+="\\r";break;case wB.CODES["\b"]:n+="\\b";break;case wB.CODES["\f"]:n+="\\f";break;default:{let e=t.toString(16);t<256?(n+="\\x",1===e.length&&(n+="0"),n+=e):n+=`\\x{${e}}`;break}}return n}static stringToRunes(e){const t=String(e),n=[];let s=0;for(;s<t.length;){const e=t.codePointAt(s);n.push(e),s+=e>IB.MAX_BMP?2:1}return new Int32Array(n)}static runeToString(e){return String.fromCodePoint(e)}static isWordRune(e){return e<256&&1===TB[e]}static emptyOpContext(t,n){let s=0;return t<0&&(s|=e.EMPTY_BEGIN_TEXT|e.EMPTY_BEGIN_LINE),10===t&&(s|=e.EMPTY_BEGIN_LINE),n<0&&(s|=e.EMPTY_END_TEXT|e.EMPTY_END_LINE),10===n&&(s|=e.EMPTY_END_LINE),e.isWordRune(t)!==e.isWordRune(n)?s|=e.EMPTY_WORD_BOUNDARY:s|=e.EMPTY_NO_WORD_BOUNDARY,s}static quoteMeta(t){return t.split("").map(t=>e.METACHARACTERS.indexOf(t)>=0?`\\${t}`:t).join("")}static charCount(e){return e>IB.MAX_BMP?2:1}static toArray(e){const t=e.length,n=new Array(t);for(let s=0;s<t;s++)n[s]=e[s];return n}static stringToUtf8ByteArray(e){if(globalThis.TextEncoder)return AB||(AB=new TextEncoder),AB.encode(e);{let t=[],n=0;for(let s=0;s<e.length;s++){let r=e.charCodeAt(s);r<128?t[n++]=r:r<2048?(t[n++]=r>>6|192,t[n++]=63&r|128):(64512&r)===IB.MIN_HIGH_SURROGATE&&s+1<e.length&&(64512&e.charCodeAt(s+1))===IB.MIN_LOW_SURROGATE?(r=IB.MIN_SUPPLEMENTARY_CODE_POINT+((1023&r)<<10)+(1023&e.charCodeAt(++s)),t[n++]=r>>18|240,t[n++]=r>>12&63|128,t[n++]=r>>6&63|128,t[n++]=63&r|128):(t[n++]=r>>12|224,t[n++]=r>>6&63|128,t[n++]=63&r|128)}return t}}static utf8ByteArrayToString(e){if(globalThis.TextDecoder){OB||(OB=new TextDecoder("utf-8"));const t=e instanceof Uint8Array?e:new Uint8Array(e);return OB.decode(t)}{let t=[],n=0,s=0;for(;n<e.length;){let r=e[n++];if(r<128)t[s++]=String.fromCharCode(r);else if(r>191&&r<224){let i=e[n++];t[s++]=String.fromCharCode((31&r)<<6|63&i)}else if(r>239&&r<365){let i=((7&r)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-IB.MIN_SUPPLEMENTARY_CODE_POINT;t[s++]=String.fromCharCode(IB.MIN_HIGH_SURROGATE+(i>>10)),t[s++]=String.fromCharCode(IB.MIN_LOW_SURROGATE+(1023&i))}else{let i=e[n++],a=e[n++];t[s++]=String.fromCharCode((15&r)<<12|(63&i)<<6|63&a)}}return t.join("")}}};const NB=(e=[],t=0)=>{const n=Object.create(null);for(let s=0;s<e.length;s++){const r=e[s],i=t+s;n[r]=i,n[i]=r}return Object.freeze(n)};var RB=class e{static Encoding=NB(["UTF_16","UTF_8"]);getEncoding(){throw Error("not implemented")}asCharSequence(){throw Error("not implemented")}asBytes(){throw Error("not implemented")}length(){throw Error("not implemented")}isUTF8Encoding(){return this.getEncoding()===e.Encoding.UTF_8}isUTF16Encoding(){return this.getEncoding()===e.Encoding.UTF_16}},kB=class extends RB{constructor(e=null){super(),this.bytes=e}getEncoding(){return RB.Encoding.UTF_8}asCharSequence(){return SB.utf8ByteArrayToString(this.bytes)}asBytes(){return this.bytes}length(){return this.bytes.length}},LB=class extends RB{constructor(e=null){super(),this.charSequence=e}getEncoding(){return RB.Encoding.UTF_16}asCharSequence(){return this.charSequence}asBytes(){return SB.stringToUtf8ByteArray(this.charSequence.toString())}length(){return this.charSequence.length}},xB=class{static utf16(e){return new LB(e)}static utf8(e){return SB.isByteArray(e)?new kB(e):new kB(SB.stringToUtf8ByteArray(e))}},FB=class{static EOF(){return-8}constructor(){this.start=0,this.end=0}canCheckPrefix(){return!0}endPos(){return this.end-this.start}hasString(){return!1}hasAnyString(){return!1}prefixLength(){return 0}},PB=class e extends FB{static RUNE_ERROR_STEP=IB.RUNE_ERROR<<3|1;constructor(e,t=0,n=e.length){super(),this.bytes=e,this.start=t,this.end=n}hasString(e,t){const n=e.bytes;if(0===n.length)return!0;const s=this.indexOf(this.bytes,n,this.start+t);return-1!==s&&s<=this.end-n.length}hasAnyString(e,t){return e.automaton8().searchUTF8(this.bytes,this.start+t,this.end)}step(t){if((t+=this.start)>=this.end)return FB.EOF();const n=255&this.bytes[t];if(n<128)return n<<3|1;let s,r,i=128,a=191;if(n>=194&&n<=223)s=2,r=31&n;else if(n>=224&&n<=239)s=3,r=15&n,224===n?i=160:237===n&&(a=159);else{if(!(n>=240&&n<=244))return e.RUNE_ERROR_STEP;s=4,r=7&n,240===n?i=144:244===n&&(a=143)}if(t+s>this.end)return e.RUNE_ERROR_STEP;const o=255&this.bytes[t+1];if(o<i||o>a)return e.RUNE_ERROR_STEP;if(r=r<<6|63&o,s>2){const n=255&this.bytes[t+2];if(128!=(192&n))return e.RUNE_ERROR_STEP;if(r=r<<6|63&n,s>3){const n=255&this.bytes[t+3];if(128!=(192&n))return e.RUNE_ERROR_STEP;r=r<<6|63&n}}return r<<3|s}index(e,t){t+=this.start;const n=this.indexOf(this.bytes,e.prefixUTF8,t);return n<0?n:n-t}context(e){let t=-1;if((e+=this.start)>this.start&&e<=this.end){let n=e-1;if(t=this.bytes[n--],t>=128){let s=e-4;for(s<this.start&&(s=this.start);n>=s&&128==(192&this.bytes[n]);)n--;n<this.start&&(n=this.start);const r=this.step(n-this.start);t=n+(7&r)===e?r>>3:IB.RUNE_ERROR}}const n=e<this.end?this.step(e-this.start)>>3:-1;return SB.emptyOpContext(t,n)}indexOf(e,t,n=0){let s=t.length;if(0===s)return n<=this.end?n:-1;const r=t[0];let i=this.end-s;const a="function"==typeof e.indexOf;let o=n;for(;o<=i;){if(a){if(o=e.indexOf(r,o),-1===o||o>i)return-1}else{for(;o<=i&&e[o]!==r;)o++;if(o>i)return-1}let n=!0;for(let r=1;r<s;r++)if(e[o+r]!==t[r]){n=!1;break}if(n)return o;o++}return-1}prefixLength(e){return e.prefixUTF8.length}},MB=class extends FB{constructor(e,t=0,n=e.length){super(),this.charSequence=e,this.start=t,this.end=n}hasString(e,t){const n=this.charSequence.indexOf(e.str,this.start+t);return-1!==n&&n<=this.end-e.str.length}hasAnyString(e,t){return e.automaton16().searchUTF16(this.charSequence,this.start+t,this.end)}step(e){if((e+=this.start)>=this.end)return FB.EOF();const t=this.charSequence.charCodeAt(e);if(t<IB.MIN_HIGH_SURROGATE||t>IB.MAX_HIGH_SURROGATE||e+1>=this.end)return t<<3|1;const n=this.charSequence.charCodeAt(e+1);return n>=IB.MIN_LOW_SURROGATE&&n<=IB.MAX_LOW_SURROGATE?1024*(t-IB.MIN_HIGH_SURROGATE)+(n-IB.MIN_LOW_SURROGATE)+IB.MIN_SUPPLEMENTARY_CODE_POINT<<3|2:t<<3|1}index(e,t){t+=this.start;const n=this.charSequence.indexOf(e.prefix,t);return n<0||n>this.end-e.prefix.length?-1:n-t}context(e){const t=(e+=this.start)>this.start&&e<=this.end?this.charSequence.charCodeAt(e-1):-1,n=e<this.end?this.charSequence.charCodeAt(e):-1;return SB.emptyOpContext(t,n)}prefixLength(e){return e.prefix.length}},GB=class{static fromUTF8(e,t=0,n=e.length){return new PB(e,t,n)}static fromUTF16(e,t=0,n=e.length){return new MB(e,t,n)}},UB=class extends Error{constructor(e){super(e),this.name="RE2JSException"}},HB=class extends UB{constructor(e,t=null){let n=`error parsing regexp: ${e}`;t&&(n+=`: \`${t}\``),super(n),this.name="RE2JSSyntaxException",this.message=n,this.error=e,this.input=t}getDescription(){return this.error}getPattern(){return this.input}},VB=class extends UB{constructor(e){super(e),this.name="RE2JSCompileException"}},jB=class extends UB{constructor(e){super(e),this.name="RE2JSGroupException"}},$B=class extends UB{constructor(e){super(e),this.name="RE2JSFlagsException"}},JB=class extends UB{constructor(e){super(e),this.name="RE2JSInternalException"}},qB=class e{static MAX_REPLACER_ARGS=65535;static quoteReplacement(e,t=!1){return t?e.indexOf("\\")<0&&e.indexOf("$")<0?e:e.split("").map(e=>{const t=e.codePointAt(0);return t===wB.CODES["\\"]||t===wB.CODES.$?`\\${e}`:e}).join(""):e.indexOf("$")<0?e:e.split("").map(e=>e.codePointAt(0)===wB.CODES.$?"$$":e).join("")}constructor(e,t){if(null===e)throw new Error("pattern is null");this.patternInput=e;const n=this.patternInput.re2();this.patternGroupCount=n.numberOfCapturingGroups(),this.groups=[],this.namedGroups=n.namedGroups,this.hasNamedGroups=Object.keys(this.namedGroups).length>0,this.numberOfInstructions=n.numberOfInstructions(),this.lookbehindState=null,t instanceof RB?this.resetMatcherInput(t):SB.isByteArray(t)?this.resetMatcherInput(xB.utf8(t)):this.resetMatcherInput(xB.utf16(t))}pattern(){return this.patternInput}reset(){return this.matcherInputLength=this.matcherInput.length(),this.appendPos=0,this.hasMatch=!1,this.hasGroups=!1,this.anchorFlag=0,this}resetMatcherInput(e){if(null===e)throw new Error("input is null");return e instanceof RB||(e=SB.isByteArray(e)?xB.utf8(e):xB.utf16(e)),this.matcherInput=e,null!==this.lookbehindState?this.lookbehindState.reset():this.lookbehindState=this.patternInput.re2().createLookbehindState(),this.reset(),this}start(e=0){if("string"==typeof e){const t=this.namedGroups[e];if(!Number.isFinite(t))throw new jB(`group '${e}' not found`);e=t}return this.loadGroup(e),this.groups[2*e]}end(e=0){if("string"==typeof e){const t=this.namedGroups[e];if(!Number.isFinite(t))throw new jB(`group '${e}' not found`);e=t}return this.loadGroup(e),this.groups[2*e+1]}programSize(){return this.numberOfInstructions}group(e=0){if("string"==typeof e){const t=this.namedGroups[e];if(!Number.isFinite(t))throw new jB(`group '${e}' not found`);e=t}const t=this.start(e),n=this.end(e);return t<0&&n<0?null:this.substring(t,n)}getNamedGroups(){if(!this.hasMatch)throw new jB("perhaps no match attempted");const e=Object.create(null);for(const t of Object.keys(this.namedGroups))e[t]=this.group(t);return e}groupCount(){return this.patternGroupCount}loadGroup(e){if(!Number.isInteger(e)||e<0||e>this.patternGroupCount)throw new jB(`Group index out of bounds: ${e}`);if(!this.hasMatch)throw new jB("perhaps no match attempted");if(0===e||this.hasGroups)return;const t=this.matcherInputLength,n=this.patternInput.re2().matchMachineInput(this.matcherInput,this.groups[0],t,this.anchorFlag,1+this.patternGroupCount,this.lookbehindState);if(!n[0])throw new jB("inconsistency in matching group data");this.groups=n[1],this.hasGroups=!0}matches(){return this.genMatch(0,BB.ANCHOR_BOTH)}lookingAt(){return this.genMatch(0,BB.ANCHOR_START)}find(e=null){if(null!==e){if(!Number.isInteger(e)||e<0||e>this.matcherInputLength)throw new jB(`start index out of bounds: ${e}`);return this.reset(),this.genMatch(e,0)}if(e=0,this.hasMatch&&(e=this.groups[1],this.groups[0]===this.groups[1])){const t=(this.matcherInput.isUTF16Encoding()?GB.fromUTF16(this.matcherInput.asCharSequence(),0,this.matcherInputLength):GB.fromUTF8(this.matcherInput.asBytes(),0,this.matcherInputLength)).step(e);t<0?e++:e+=7&t}return this.genMatch(e,BB.UNANCHORED)}genMatch(e,t){const n=this.patternInput.re2().matchMachineInput(this.matcherInput,e,this.matcherInputLength,t,1,this.lookbehindState);return n[0]?(this.groups=n[1],this.hasMatch=!0,this.hasGroups=0===this.patternGroupCount,this.anchorFlag=t,!0):(this.hasMatch=!1,!1)}substring(e,t){return this.matcherInput.isUTF8Encoding()?SB.utf8ByteArrayToString(this.matcherInput.asBytes().slice(e,t)):this.matcherInput.asCharSequence().substring(e,t).toString()}inputLength(){return this.matcherInputLength}appendReplacement(e,t=!1){let n="";const s=this.start(),r=this.end();return this.appendPos<s&&(n+=this.substring(this.appendPos,s)),this.appendPos=r,n+=t?this.appendReplacementInternalJava(e):this.appendReplacementInternalJs(e),n}appendReplacementInternalJava(e){let t="",n=0;const s=e.length;let r=0;for(;r<s;){const i=e.codePointAt(r);if(i!==wB.CODES["\\"]){if(i===wB.CODES.$){if(n<r&&(t+=e.substring(n,r)),r+1>=s)throw new jB("Illegal group reference: group index is missing");const i=e.codePointAt(r+1);if(wB.CODES[0]<=i&&i<=wB.CODES[9]){let a=i-wB.CODES[0],o=r+2;for(;o<s;o++){const t=e.codePointAt(o);if(t<wB.CODES[0]||t>wB.CODES[9]||10*a+t-wB.CODES[0]>this.patternGroupCount)break;a=10*a+t-wB.CODES[0]}if(a>this.patternGroupCount)throw new jB(`n > number of groups: ${a}`);const B=this.group(a);null!==B&&(t+=B),r=o,n=r}else{if(i!==wB.CODES["{"])throw new jB("Illegal group reference");{let i=r+2;for(;i<s&&e.codePointAt(i)!==wB.CODES["}"];)i++;if(i>=s)throw new jB("named capture group is missing trailing '}'");const a=e.substring(r+2,i),o=this.group(a);null!==o&&(t+=o),r=i+1,n=r}}continue}r++}else{if(n<r&&(t+=e.substring(n,r)),r++,r>=s)throw new jB("character to be escaped is missing");n=r,r++}}return n<s&&(t+=e.substring(n,s)),t}appendReplacementInternalJs(e){const t=e=>e>=48&&e<=57,n=this.patternGroupCount;let s="",r=0;for(;r<e.length;){const i=e.indexOf("$",r);if(i<0)break;s+=e.substring(r,i),r=i;const a=e.charCodeAt(r+1);if(a===wB.CODES.$)s+="$",r+=2;else if(a===wB.CODES["&"])s+=this.group(0),r+=2;else if(a===wB.CODES["`"])s+=this.substring(0,this.start(0)),r+=2;else if(a===wB.CODES["'"])s+=this.substring(this.end(0),this.matcherInputLength),r+=2;else if(t(a)){let i=1,o=a-48;const B=e.charCodeAt(r+2);if(t(B)&&10*o+B-48<=n&&(i=2,o=10*o+B-48),o>=1&&o<=n){const e=this.group(o);null!==e&&(s+=e)}else s+=e.substring(r,r+1+i);r+=1+i}else if(a===wB.CODES["<"]&&this.hasNamedGroups){const t=e.indexOf(">",r+2);if(t<0)s+="$<",r+=2;else{const n=e.substring(r+2,t);if(Object.prototype.hasOwnProperty.call(this.namedGroups,n)){const e=this.group(n);null!==e&&(s+=e)}r=t+1}}else s+="$",r+=1}return s+e.substring(r)}appendTail(){return this.substring(this.appendPos,this.matcherInputLength)}replaceAll(e,t=!1){return this.replace(e,!0,t)}replaceFirst(e,t=!1){return this.replace(e,!1,t)}replace(t,n=!0,s=!1){let r="";this.reset();const i="function"==typeof t;let a=null;if(i){if(this.groupCount()>=e.MAX_REPLACER_ARGS)throw new jB("Too many capture groups to safely invoke replacer function");a=this.matcherInput.isUTF8Encoding()?this.matcherInput.asBytes():this.matcherInput.asCharSequence()}for(;this.find()&&(r+=i?this.appendReplacementFunc(t,a):this.appendReplacement(t,s),n););return r+=this.appendTail(),r}appendReplacementFunc(e,t){let n="";const s=this.start(),r=this.end();this.appendPos<s&&(n+=this.substring(this.appendPos,s)),this.appendPos=r;const i=this.matchArray();return i.push(s,t),this.hasNamedGroups&&i.push(this.namedGroupsObject()),n+=String(e(...i)),n}matchArray(){const e=[this.group(0)];for(let t=1;t<=this.patternGroupCount;t++){const n=this.group(t);e.push(null===n?void 0:n)}return e}namedGroupsObject(){if(!this.hasNamedGroups)return;const e=this.getNamedGroups();for(const t in e)null===e[t]&&(e[t]=void 0);return e}},zB=class e{static ALT=1;static ALT_MATCH=2;static CAPTURE=3;static EMPTY_WIDTH=4;static FAIL=5;static MATCH=6;static NOP=7;static RUNE=8;static RUNE1=9;static RUNE_ANY=10;static RUNE_ANY_NOT_NL=11;static LB_WRITE=12;static LB_CHECK=13;static isRuneOp(t){return e.RUNE<=t&&t<=e.RUNE_ANY_NOT_NL}static escapeRunes(e){let t='"';for(let n of e)t+=SB.escapeRune(n);return t+='"',t}constructor(e){this.op=e,this.out=0,this.arg=0,this.runes=new Int32Array(0),this.next=null}matchRune(e){if(1===this.runes.length){const t=this.runes[0];return 0!==(this.arg&BB.FOLD_CASE)?IB.equalsIgnoreCase(t,e):e===t}const t=this.runes.length;if(0===t)return!1;if(2===t||4===t||6===t||8===t){for(let n=0;n<t;n+=2){if(e<this.runes[n])return!1;if(e<=this.runes[n+1])return!0}return!1}let n=0,s=t>>1;for(;s>1;){const t=s>>1;n+=this.runes[n+t<<1]<=e?t:0,s-=t}n+=this.runes[n<<1]<=e?1:0;const r=n-1;return r>=0&&e<=this.runes[r<<1|1]}matchRunePos(e){if(1===this.runes.length){const t=this.runes[0];return 0!==(this.arg&BB.FOLD_CASE)?IB.equalsIgnoreCase(t,e)?0:-1:e===t?0:-1}const t=this.runes.length;if(0===t)return-1;if(2===t||4===t||6===t||8===t){for(let n=0;n<t;n+=2){if(e<this.runes[n])return-1;if(e<=this.runes[n+1])return Math.floor(n/2)}return-1}let n=0,s=t>>1;for(;s>1;){const t=s>>1;n+=this.runes[n+t<<1]<=e?t:0,s-=t}n+=this.runes[n<<1]<=e?1:0;const r=n-1;return r>=0&&e<=this.runes[r<<1|1]?r:-1}toString(){switch(this.op){case e.ALT:return`alt -> ${this.out}, ${this.arg}`;case e.ALT_MATCH:return`altmatch -> ${this.out}, ${this.arg}`;case e.CAPTURE:return`cap ${this.arg} -> ${this.out}`;case e.EMPTY_WIDTH:return`empty ${this.arg} -> ${this.out}`;case e.MATCH:return"match"+(0!==this.arg?` ${this.arg}`:"");case e.FAIL:return"fail";case e.NOP:return`nop -> ${this.out}`;case e.LB_WRITE:return`lbwrite ${this.arg} -> ${this.out}`;case e.LB_CHECK:return`lbcheck ${this.arg} -> ${this.out}`;case e.RUNE:return null===this.runes?"rune <null>":["rune ",e.escapeRunes(this.runes),0!==(this.arg&BB.FOLD_CASE)?"/i":""," -> ",this.out].join("");case e.RUNE1:return`rune1 ${e.escapeRunes(this.runes)} -> ${this.out}`;case e.RUNE_ANY:return`any -> ${this.out}`;case e.RUNE_ANY_NOT_NL:return`anynotnl -> ${this.out}`;default:throw new Error("unhandled case in Inst.toString")}}},KB=class e{constructor(e){this.sparse=new Int32Array(e),this.densePcs=new Int32Array(e),this.denseCaps=null,this.size=0,this.ncap=0,this.mainThreads=0}static INITIAL_THREADS=32;init(t){this.ncap=t;const n=Math.min(this.densePcs.length,e.INITIAL_THREADS)*t;(!this.denseCaps||this.denseCaps.length<n)&&(this.denseCaps=new Int32Array(n))}growCaps(e){const t=this.densePcs.length*this.ncap,n=new Int32Array(Math.min(t,Math.max(e,2*this.denseCaps.length)));n.set(this.denseCaps),this.denseCaps=n}contains(e){const t=this.sparse[e];return t<this.size&&this.densePcs[t]===e}isEmpty(){return 0===this.size}add(e){const t=this.size++;return this.sparse[e]=t,this.densePcs[t]=e,t}clear(){this.size=0,this.mainThreads=0}toString(){let e="{";for(let t=0;t<this.size;t++)0!==t&&(e+=", "),e+=this.densePcs[t];return e+="}",e}},QB=class{constructor(e){this.pos=-1,this.pcs=new Int32Array(e.numInst()),this.size=0,this.lbTable=new Int32Array(e.numLb+1)}reset(){this.pos=-1,this.size=0}},WB=class e{static fromRE2(t){const n=new e;return n.prog=t.prog,n.re2=t,n.q0=new KB(n.prog.numInst()),n.q1=new KB(n.prog.numInst()),n.addStack=new Int32Array(2*(n.prog.numInst()+1)),n.matched=!1,n.matchcap=new Int32Array(n.prog.numCap<2?2:n.prog.numCap),n.ncap=0,n}constructor(){this.prog=null,this.re2=null,this.q0=null,this.q1=null,this.addStack=null,this.matched=!1,this.matchcap=null,this.ncap=0,this.lbTable=null}init(e){this.ncap=e,e>this.matchcap.length?this.matchcap=new Int32Array(e).fill(-1):this.matchcap.fill(-1),this.q0.init(e),this.q1.init(e),this.prog.numLb>0&&((!this.lbTable||this.lbTable.length<this.prog.numLb+1)&&(this.lbTable=new Int32Array(this.prog.numLb+1)),this.lbTable.fill(-1))}submatches(){return 0===this.ncap?SB.emptyInts():SB.toArray(this.matchcap.subarray(0,this.ncap))}match(e,t,n,s=null){const r=this.re2.cond;if(r===SB.EMPTY_ALL)return!1;if((n===BB.ANCHOR_START||n===BB.ANCHOR_BOTH)&&0!==t)return!1;this.matched=!1,this.matchcap.fill(-1);const i=this.prog.numLb>0,a=t;let o=t,B=!1;i&&(null!==s&&s.pos>=0&&s.pos<=t?(o=s.pos,B=!0):o=0);let c,l=i&&null!==s,u=this.q0,h=this.q1,p=e.step(o),d=p>>3,f=7&p,C=-1,g=0;for(p!==FB.EOF()&&(p=e.step(o+f),C=p>>3,g=7&p),c=0===o?SB.emptyOpContext(-1,d):e.context(o),i&&(B?this.restoreLookbehinds(s,u,c):this.spawnLookbehinds(u,o,c));;){if(0===u.mainThreads){if(0!==(r&SB.EMPTY_BEGIN_TEXT)&&0!==o)break;if((n===BB.ANCHOR_START||n===BB.ANCHOR_BOTH)&&0!==o)break;if(this.matched)break;if(0===this.prog.numLb&&u.isEmpty()&&0!==this.re2.prefix.length&&C!==this.re2.prefixRune&&e.canCheckPrefix()){const t=e.index(this.re2,o);if(t<0)break;o+=t,p=e.step(o),d=p>>3,f=7&p,p=e.step(o+f),C=p>>3,g=7&p,c=e.context(o)}}o>=a&&(l&&(this.saveLookbehinds(s,u,o),l=!1),this.matched||0!==o&&n!==BB.UNANCHORED||(this.ncap>0&&(this.matchcap[0]=o),this.add(u,this.prog.start,o,this.matchcap,0,c)));const t=o+f;if(c=e.context(t),this.step(u,h,o,t,d,c,n,o===e.endPos()),0===f)break;if(0===this.ncap&&this.matched)break;o+=f,d=C,f=g,-1!==d&&(p=e.step(o+f),C=p>>3,g=7&p);const i=u;u=h,h=i}return u.clear(),h.clear(),this.matched}matchSet(e,t,n){const s=this.re2.cond;if(s===SB.EMPTY_ALL)return[];if((n===BB.ANCHOR_START||n===BB.ANCHOR_BOTH)&&0!==t)return[];let r=this.prog.numLb>0?0:t,i=t,a=this.q0,o=this.q1,B=e.step(r),c=B>>3,l=7&B,u=-1,h=0;B!==FB.EOF()&&(B=e.step(r+l),u=B>>3,h=7&B);let p=0===r?SB.emptyOpContext(-1,c):e.context(r);const d=new Set;for(this.prog.numLb>0&&this.spawnLookbehinds(a,r,p);;){if(0===a.mainThreads){if(0!==(s&SB.EMPTY_BEGIN_TEXT)&&0!==r)break;if((n===BB.ANCHOR_START||n===BB.ANCHOR_BOTH)&&0!==r)break}0!==r&&n!==BB.UNANCHORED||r>=i&&this.add(a,this.prog.start,r,this.matchcap,0,p);const t=r+l;p=e.context(t);for(let s=0;s<a.size;s++){const i=a.densePcs[s],B=this.prog.inst[i],l=s*this.ncap;let u=!1;switch(B.op){case zB.MATCH:if(n===BB.ANCHOR_BOTH&&r!==e.endPos())break;d.add(B.arg);break;case zB.RUNE:u=B.matchRune(c);break;case zB.RUNE1:u=c===B.runes[0];break;case zB.RUNE_ANY:u=!0;break;case zB.RUNE_ANY_NOT_NL:u=10!==c;break;default:continue}u&&this.add(o,B.out,t,a.denseCaps,l,p)}if(a.clear(),0===l)break;r+=l,c=u,l=h,-1!==c&&(B=e.step(r+l),u=B>>3,h=7&B);const f=a;a=o,o=f}return o.clear(),Array.from(d).sort((e,t)=>e-t)}step(e,t,n,s,r,i,a,o){const B=this.re2.longest;for(let c=0;c<e.size;c++){const l=e.densePcs[c],u=c*this.ncap;if(B&&this.matched&&this.ncap>0&&this.matchcap[0]<e.denseCaps[u])continue;const h=this.prog.inst[l];let p=!1;switch(h.op){case zB.MATCH:if(a===BB.ANCHOR_BOTH&&!o)break;if(this.ncap>0&&(!B||!this.matched||this.matchcap[1]<n)){e.denseCaps[u+1]=n;for(let t=0;t<this.ncap;t++)this.matchcap[t]=e.denseCaps[u+t]}B||(e.size=0),this.matched=!0;break;case zB.RUNE:p=h.matchRune(r);break;case zB.RUNE1:p=r===h.runes[0];break;case zB.RUNE_ANY:p=!0;break;case zB.RUNE_ANY_NOT_NL:p=10!==r;break;default:continue}p&&this.add(t,h.out,s,e.denseCaps,u,i)}e.clear()}spawnLookbehinds(e,t,n){for(let s=0;s<this.prog.lbStarts.length;s++)this.add(e,this.prog.lbStarts[s],t,this.matchcap,0,n)}restoreLookbehinds(e,t,n){this.lbTable.set(e.lbTable);for(let s=0;s<e.size;s++)this.add(t,e.pcs[s],e.pos,this.matchcap,0,n)}saveLookbehinds(e,t,n){let s=0;for(let n=0;n<t.size;n++){const r=t.densePcs[n];1===this.prog.lbInst[r]&&zB.isRuneOp(this.prog.inst[r].op)&&(e.pcs[s++]=r)}e.size=s,e.pos=n,e.lbTable.set(this.lbTable)}add(e,t,n,s,r,i){const a=this.addStack;let o=0;for(;;){for(;0!==t&&!e.contains(t);){const B=e.add(t),c=this.prog.inst[t];switch(c.op){case zB.FAIL:t=0;break;case zB.ALT:case zB.ALT_MATCH:a[o++]=c.arg,a[o++]=0,t=c.out;break;case zB.EMPTY_WIDTH:t=0===(c.arg&~i)?c.out:0;break;case zB.NOP:t=c.out;break;case zB.CAPTURE:c.arg<this.ncap&&(a[o++]=-c.arg-1,a[o++]=s[r+c.arg],s[r+c.arg]=n),t=c.out;break;case zB.LB_WRITE:this.lbTable[Math.abs(c.arg)]=n,t=c.out;break;case zB.LB_CHECK:t=c.arg>0?this.lbTable[c.arg]===n?c.out:0:this.lbTable[-c.arg]!==n?c.out:0;break;case zB.MATCH:case zB.RUNE:case zB.RUNE1:case zB.RUNE_ANY:case zB.RUNE_ANY_NOT_NL:if(0===this.prog.lbInst[t]&&e.mainThreads++,this.ncap>0){const t=B*this.ncap;t+this.ncap>e.denseCaps.length&&e.growCaps(t+this.ncap);for(let n=0;n<this.ncap;n++)e.denseCaps[t+n]=s[r+n]}t=0;break;default:throw new JB("unhandled")}}if(0===o)return;o-=2;const B=a[o];B<0?(s[r-B-1]=a[o+1],t=0):t=B}}};const YB=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0},XB=(e,t,n,s)=>e.flag===n&&YB(e.nfaStates,t)&&YB(e.matchIDs,s),ZB=[];var ec=class{constructor(e,t,n){this.nfaStates=e,this.flag=t,this.isMatch=0!==(t&tc.FLAG_MATCH),this.matchIDs=n,this.next=null,this.nextAnchored=null}},tc=class e{static FLAG_EMPTY_MASK=255;static FLAG_MATCH=256;static FLAG_LAST_WORD=512;static FLAG_NEED_SHIFT=16;static STATE_OVERHEAD=150;static ARRAY_OVERHEAD=40;static ELEMENT_SIZE=8;static TABLE_OVERHEAD=48;static PROGRESS_PER_STATE=10;constructor(e,t=8388608){this.prog=e,this.maxMem=t,this.stateCache=new Map,this.stateCount=0,this.startStates=new Map,this.failed=!1;for(let t=0;t<e.numInst();t++){const n=e.getInst(t).op;if(n===zB.LB_WRITE||n===zB.LB_CHECK){this.failed=!0;break}}this.computeRuneClasses(),this.stateBudget=t,this.memBudget=t}computeRuneClasses(){const e=new Set,t=(t,n)=>{e.add(t),e.add(n+1)};for(let e=0;e<this.prog.numInst();e++){const n=this.prog.getInst(e);switch(n.op){case zB.RUNE:case zB.RUNE1:if(1===n.runes.length){if(t(n.runes[0],n.runes[0]),0!==(n.arg&BB.FOLD_CASE))for(let e=IB.simpleFold(n.runes[0]);e!==n.runes[0];e=IB.simpleFold(e))t(e,e)}else for(let e=0;e<n.runes.length;e+=2)t(n.runes[e],n.runes[e+1]);break;case zB.RUNE_ANY_NOT_NL:t(10,10);break;case zB.EMPTY_WIDTH:0!==(n.arg&(SB.EMPTY_BEGIN_LINE|SB.EMPTY_END_LINE))&&t(10,10),0!==(n.arg&(SB.EMPTY_WORD_BOUNDARY|SB.EMPTY_NO_WORD_BOUNDARY))&&(t(48,57),t(65,90),t(95,95),t(97,122))}}e.delete(0),this.classBounds=Int32Array.from(e).sort(),this.numClasses=this.classBounds.length+1;const n=new Int32Array(IB.MAX_LATIN1+1);for(let e=0;e<=IB.MAX_LATIN1;e++)n[e]=this.searchClass(e);this.latin1Class=n}runeClass(e){return e<=IB.MAX_LATIN1?this.latin1Class[e]:this.searchClass(e)}searchClass(e){const t=this.classBounds;let n=0,s=t.length;for(;n<s;){const r=n+s>>1;t[r]<=e?n=r+1:s=r}return n}closure(e,t){const n=new Set,s=Array.from(e);let r=0;for(;s.length>0;){const e=s.pop();if(0===e||n.has(e))continue;n.add(e);const i=this.prog.getInst(e);switch(i.op){case zB.ALT:case zB.ALT_MATCH:s.push(i.out),s.push(i.arg);break;case zB.NOP:case zB.CAPTURE:s.push(i.out);break;case zB.EMPTY_WIDTH:r|=i.arg,0===(i.arg&~t)&&s.push(i.out)}}return{pcs:Array.from(n).sort((e,t)=>e-t),needflags:r}}getState(t,n,s){const r=((e,t,n)=>{let s=-2128831035;for(let t=0;t<e.length;t++)s^=e[t],s=Math.imul(s,16777619);s^=t,s=Math.imul(s,16777619);for(let e=0;e<n.length;e++)s^=n[e],s=Math.imul(s,16777619);return s})(t,n,s),i=this.stateCache.get(r);if(i instanceof ec){if(XB(i,t,n,s))return i}else if(void 0!==i)for(let e=0;e<i.length;e++)if(XB(i[e],t,n,s))return i[e];const a=e.stateCost(t,s);if(this.memBudget<a)return null;this.memBudget-=a;const o=new ec(t,n,s);return void 0===i?this.stateCache.set(r,o):i instanceof ec?this.stateCache.set(r,[i,o]):i.push(o),this.stateCount++,o}static stateCost(t,n){const s=0===n.length?0:e.ARRAY_OVERHEAD+e.ELEMENT_SIZE*n.length;return e.STATE_OVERHEAD+e.ELEMENT_SIZE*t.length+s}*cachedStates(){for(const e of this.stateCache.values())e instanceof ec?yield e:yield*e}makeState(t,n,s){const r=this.closure(t,n&e.FLAG_EMPTY_MASK);let i=n;return 0===r.needflags&&(i&=e.FLAG_MATCH),i|=r.needflags<<e.FLAG_NEED_SHIFT,this.getState(r.pcs,i,s)}allocTable(t,n){const s=this.numClasses+1,r=e.TABLE_OVERHEAD+e.ELEMENT_SIZE*s;if(this.memBudget<r)return null;this.memBudget-=r;const i=new Array(s).fill(null);return n===BB.UNANCHORED?t.next=i:t.nextAnchored=i,i}clearCache(){this.stateCache.clear(),this.stateCount=0,this.startStates.clear(),this.memBudget=this.stateBudget}resetCache(e){return this.clearCache(),this.getState(e.nfaStates,e.flag,e.matchIDs)}step(t,n,s,r){let i=r===BB.UNANCHORED?t.next:t.nextAnchored;if(null!==i){const e=i[n];if(null!==e)return e}else if(i=this.allocTable(t,r),null===i)return null;const a=t.flag>>>e.FLAG_NEED_SHIFT,o=t.flag&e.FLAG_EMPTY_MASK;let B=o,c=0;10===s&&(B|=SB.EMPTY_END_LINE,c|=SB.EMPTY_BEGIN_LINE),-1===s&&(B|=SB.EMPTY_END_LINE|SB.EMPTY_END_TEXT);const l=0!==(t.flag&e.FLAG_LAST_WORD),u=-1!==s&&SB.isWordRune(s);B|=u===l?SB.EMPTY_NO_WORD_BOUNDARY:SB.EMPTY_WORD_BOUNDARY;let h=t.nfaStates;0!==(B&~o&a)&&(h=this.closure(h,B).pcs);const p=[];let d=!1,f=ZB;for(let e=0;e<h.length;e++){const t=this.prog.getInst(h[e]);t.op===zB.MATCH?(d||(d=!0,f=[]),f.push(t.arg)):-1!==s&&zB.isRuneOp(t.op)&&t.matchRune(s)&&p.push(t.out)}f.length>1&&f.sort((e,t)=>e-t),r===BB.UNANCHORED&&-1!==s&&p.push(this.prog.start);let C=c;d&&(C|=e.FLAG_MATCH),u&&(C|=e.FLAG_LAST_WORD);const g=this.makeState(p,C,f);return null===g?null:(i[n]=g,g)}start(t,n){const s=t.context(n);let r;if(0!==(s&SB.EMPTY_BEGIN_TEXT))r=SB.EMPTY_BEGIN_TEXT|SB.EMPTY_BEGIN_LINE;else if(0!==(s&SB.EMPTY_BEGIN_LINE))r=SB.EMPTY_BEGIN_LINE;else{const i=t.step(n),a=i>=0&&SB.isWordRune(i>>3);r=0!==(s&SB.EMPTY_WORD_BOUNDARY)!==a?e.FLAG_LAST_WORD:0}let i=this.startStates.get(r);if(void 0===i){if(i=this.makeState([this.prog.start],r,ZB),null===i&&(this.clearCache(),i=this.makeState([this.prog.start],r,ZB),null===i))return null;this.startStates.set(r,i)}return i}stepOrReset(t,n,s,r,i,a){let o=this.step(t,n,s,r);if(null!==o)return o;if(a.resetPos>=0&&i-a.resetPos<e.PROGRESS_PER_STATE*this.stateCount)return null;a.resetPos=i;const B=this.resetCache(t);return null===B?null:(o=this.step(B,n,s,r),o)}run(e,t,n,s,r){const i=e.endPos(),a=this.latin1Class,o=n===BB.UNANCHORED,B={resetPos:-1};let c=t;for(;c<i;){const t=e.step(c),i=t>>3,l=7&t;if(0===l)break;const u=i<=IB.MAX_LATIN1?a[i]:this.runeClass(i);let h=o&&null!==s.next?s.next[u]:null;if(null===h&&(h=this.stepOrReset(s,u,i,n,c,B),null===h))return null;if((s=h).isMatch&&r(s,!1))return!0;if(!o&&0===s.nfaStates.length)return!1;c+=l}return null===(s=this.stepOrReset(s,this.numClasses,-1,n,c,B))?null:s.isMatch&&r(s,!0)}match(e,t,n){if(this.failed)return null;if((n===BB.ANCHOR_START||n===BB.ANCHOR_BOTH)&&0!==t)return!1;const s=this.start(e,t);return null===s?null:this.run(e,t,n,s,(e,t)=>n!==BB.ANCHOR_BOTH||t)}matchSet(e,t,n){if(this.failed)return null;if((n===BB.ANCHOR_START||n===BB.ANCHOR_BOTH)&&0!==t)return[];const s=this.start(e,t);if(null===s)return null;const r=new Set;return null===this.run(e,t,n,s,(e,t)=>{if(n!==BB.ANCHOR_BOTH||t)for(let t=0;t<e.matchIDs.length;t++)r.add(e.matchIDs[t]);return!1})?null:Array.from(r).sort((e,t)=>e-t)}};var nc=class{constructor(){this.end=0,this.cap=new Int32Array(0),this.matchcap=new Int32Array(0),this.ncap=0,this.jobPc=new Int32Array(256),this.jobArg=new Uint8Array(256),this.jobPos=new Int32Array(256),this.jobLen=0,this.visited=new Uint32Array(0)}reset(e,t,n){this.end=t,this.jobLen=0,this.ncap=n;const s=e.numInst()*(t+1)+32-1>>>5;this.visited.length<s?this.visited=new Uint32Array(s):this.visited.fill(0,0,s),this.cap.length<n?this.cap=new Int32Array(n).fill(-1):this.cap.fill(-1,0,n),this.matchcap.length<n?this.matchcap=new Int32Array(n).fill(-1):this.matchcap.fill(-1,0,n)}shouldVisit(e,t){const n=e*(this.end+1)+t,s=n>>>5,r=1<<(31&n);return 0===(this.visited[s]&r)&&(this.visited[s]|=r,!0)}push(e,t,n,s){if(e.prog.getInst(t).op!==zB.FAIL&&(s||this.shouldVisit(t,n))){if(this.jobLen>=this.jobPc.length){const e=2*this.jobPc.length,t=new Int32Array(e);t.set(this.jobPc),this.jobPc=t;const n=new Uint8Array(e);n.set(this.jobArg),this.jobArg=n;const s=new Int32Array(e);s.set(this.jobPos),this.jobPos=s}this.jobPc[this.jobLen]=t,this.jobArg[this.jobLen]=s?1:0,this.jobPos[this.jobLen]=n,this.jobLen++}}tryBacktrack(e,t,n,s,r){const i=e.longest;for(this.push(e,n,s,!1);this.jobLen>0;){this.jobLen--;let n=this.jobPc[this.jobLen],s=1===this.jobArg[this.jobLen],a=this.jobPos[this.jobLen],o=!0;for(;o||this.shouldVisit(n,a);){o=!1;const B=e.prog.getInst(n);switch(B.op){case zB.FAIL:break;case zB.ALT:if(s){s=!1,n=B.arg;continue}this.push(e,n,a,!0),n=B.out;continue;case zB.ALT_MATCH:{const t=e.prog.getInst(B.out);if(zB.isRuneOp(t.op)){this.push(e,B.arg,a,!1),n=B.arg,a=this.end;continue}this.push(e,B.out,this.end,!1),n=B.out;continue}case zB.RUNE:{const e=t.step(a);if(e===FB.EOF())break;if(!B.matchRune(e>>3))break;a+=7&e,n=B.out;continue}case zB.RUNE1:{const e=t.step(a);if(e===FB.EOF())break;if(e>>3!==B.runes[0])break;a+=7&e,n=B.out;continue}case zB.RUNE_ANY_NOT_NL:{const e=t.step(a);if(e===FB.EOF())break;if(e>>3==10)break;a+=7&e,n=B.out;continue}case zB.RUNE_ANY:{const e=t.step(a);if(e===FB.EOF())break;a+=7&e,n=B.out;continue}case zB.CAPTURE:if(s){this.cap[B.arg]=a;break}B.arg<this.ncap&&(this.push(e,n,this.cap[B.arg],!0),this.cap[B.arg]=a),n=B.out;continue;case zB.EMPTY_WIDTH:{const e=t.context(a);if(0!==(B.arg&~e))break;n=B.out;continue}case zB.NOP:n=B.out;continue;case zB.MATCH:{if(r===BB.ANCHOR_BOTH&&a!==this.end)break;if(0===this.ncap)return!0;this.ncap>1&&(this.cap[1]=a);const e=this.matchcap[1];if((-1===e||i&&a>0&&a>e)&&this.matchcap.set(this.cap),!i)return!0;if(a===this.end)return!0;break}case zB.LB_WRITE:case zB.LB_CHECK:throw new JB("Backtracker cannot evaluate Lookbehind instructions");default:throw new JB("bad inst")}break}}return i&&this.matchcap.length>1&&this.matchcap[1]>=0}};const sc=[];var rc=class e{static shouldBacktrack(e){return e.numInst()<=500}static maxBitStateLen(t){return e.shouldBacktrack(t)?Math.floor(262144/t.numInst()):0}static execute(e,t,n,s,r){const i=e.cond;if(i===SB.EMPTY_ALL)return null;if((s===BB.ANCHOR_START||s===BB.ANCHOR_BOTH)&&0!==n)return null;if(0!==(i&SB.EMPTY_BEGIN_TEXT)&&0!==n)return null;const a=sc.length>0?sc.pop():new nc,o=t.endPos();a.reset(e.prog,o,r);let B=!1;if(0!==(i&SB.EMPTY_BEGIN_TEXT)||s===BB.ANCHOR_START||s===BB.ANCHOR_BOTH)a.ncap>0&&(a.cap[0]=n),a.tryBacktrack(e,t,e.prog.start,n,s)&&(B=!0);else{let r=-1;for(;n<=o&&0!==r;n+=r){if(e.prefix.length>0){const s=t.index(e,n);if(s<0)break;n+=s}if(a.ncap>0&&(a.cap[0]=n),a.tryBacktrack(e,t,e.prog.start,n,s)){B=!0;break}const i=t.step(n);r=i===FB.EOF()?0:7&i}}if(!B)return sc.push(a),null;const c=0===r?[]:SB.toArray(a.matchcap.subarray(0,r));return sc.push(a),c}},ic=class{constructor(e){this.sparse=new Uint32Array(e),this.dense=new Uint32Array(e),this.size=0,this.nextIndex=0}empty(){return this.nextIndex>=this.size}next(){return this.dense[this.nextIndex++]}clear(){this.size=0,this.nextIndex=0}contains(e){return e<this.sparse.length&&this.sparse[e]<this.size&&this.dense[this.sparse[e]]===e}insert(e){this.contains(e)||this.insertNew(e)}insertNew(e){e>=this.sparse.length||(this.sparse[e]=this.size,this.dense[this.size]=e,this.size++)}};var ac=class{constructor(e){this.start=e.start,this.numCap=e.numCap,this.inst=new Array(e.inst.length);for(let t=0;t<e.inst.length;t++){const n=e.inst[t],s=new zB(n.op);s.out=n.out,s.arg=n.arg,s.runes=n.runes?new Int32Array(n.runes):new Int32Array(0),s.next=null,this.inst[t]=s}}};var oc=class e{static compile(e){if(0===e.start)return null;if(e.numLb>0)return null;const t=e.inst[e.start];if(t.op!==zB.EMPTY_WIDTH||0===(t.arg&SB.EMPTY_BEGIN_TEXT))return null;let n=!1;for(let t=0;t<e.inst.length;t++)if(e.inst[t].op===zB.ALT||e.inst[t].op===zB.ALT_MATCH){n=!0;break}for(let t=0;t<e.inst.length;t++){const s=e.inst[t],r=e.inst[s.out].op;switch(s.op){case zB.ALT:case zB.ALT_MATCH:if(r===zB.MATCH||e.inst[s.arg].op===zB.MATCH)return null;break;case zB.EMPTY_WIDTH:if(r===zB.MATCH){if((s.arg&SB.EMPTY_END_TEXT)===SB.EMPTY_END_TEXT)continue;return null}break;default:if(r===zB.MATCH&&n)return null}}let s=(e=>{const t=new ac(e);for(let e=0;e<t.inst.length;e++){const n=t.inst[e];if(n.op!==zB.ALT&&n.op!==zB.ALT_MATCH)continue;let s="out",r="arg",i=t.inst[n[r]];if(i.op!==zB.ALT&&i.op!==zB.ALT_MATCH&&(s="arg",r="out",i=t.inst[n[r]],i.op!==zB.ALT&&i.op!==zB.ALT_MATCH))continue;const a=t.inst[n[s]];if(a.op===zB.ALT||a.op===zB.ALT_MATCH)continue;let o="out",B="arg",c=!1;i.out===e?c=!0:i.arg===e&&(c=!0,o="arg",B="out"),c&&(i[o]=n[s]),n[s]===i[o]&&(n[r]=i[B])}return t})(e);return s=(e=>{if(e.inst.length>=1e3)return null;const t=new ic(e.inst.length),n=new ic(e.inst.length),s=new Array(e.inst.length),r=new Array(e.inst.length).fill(!1),i=a=>{let o=!0;const B=e.inst[a];if(n.contains(a))return!0;switch(n.insert(a),B.op){case zB.ALT:case zB.ALT_MATCH:{o=i(B.out)&&i(B.arg);let e=r[B.out],t=r[B.arg];if(e&&t)return!1;if(t){const n=B.out;B.out=B.arg,B.arg=n;const s=e;e=t,t=s}e&&(r[a]=!0,B.op=zB.ALT_MATCH);const n=((e,t,n,s)=>{const r=e.length,i=t.length;let a=0,o=0;const B=[],c=[];let l=!0,u=-1;const h=r=>{const i=r?e:t,l=r?a:o,h=r?n:s;return!(u>0&&i[l]<=B[u]||(B.push(i[l],i[l+1]),r?a+=2:o+=2,u+=2,c.push(h),0))};for(;a<r||o<i;)if(l=o>=i?h(!0):a>=r||t[o]<e[a]?h(!1):h(!0),!l)return null;return{merged:B,next:c}})(s[B.out]||[],s[B.arg]||[],B.out,B.arg);if(!n)return!1;s[a]=new Int32Array(n.merged),B.next=new Uint32Array(n.next);break}case zB.CAPTURE:case zB.EMPTY_WIDTH:case zB.NOP:o=i(B.out),r[a]=r[B.out],s[a]=s[B.out]?new Int32Array(s[B.out]):new Int32Array(0),B.next=new Uint32Array(Math.floor(s[a].length/2)+1).fill(B.out);break;case zB.MATCH:case zB.FAIL:r[a]=B.op===zB.MATCH;break;case zB.RUNE:{if(r[a]=!1,B.next&&B.next.length>0)break;if(t.insert(B.out),!B.runes||0===B.runes.length){s[a]=new Int32Array(0),B.next=new Uint32Array([B.out]);break}let e=[];if(1===B.runes.length&&0!==(B.arg&BB.FOLD_CASE)){const t=B.runes[0];e.push(t,t);for(let n=IB.simpleFold(t);n!==t;n=IB.simpleFold(n))e.push(n,n);e.sort((e,t)=>e-t)}else for(let t=0;t<B.runes.length;t++)e.push(B.runes[t]);s[a]=new Int32Array(e),B.next=new Uint32Array(Math.floor(e.length/2)+1).fill(B.out),B.op=zB.RUNE;break}case zB.RUNE1:{if(r[a]=!1,B.next&&B.next.length>0)break;t.insert(B.out);let e=[];if(0!==(B.arg&BB.FOLD_CASE)){const t=B.runes[0];e.push(t,t);for(let n=IB.simpleFold(t);n!==t;n=IB.simpleFold(n))e.push(n,n);e.sort((e,t)=>e-t)}else e.push(B.runes[0],B.runes[0]);s[a]=new Int32Array(e),B.next=new Uint32Array(Math.floor(e.length/2)+1).fill(B.out),B.op=zB.RUNE;break}case zB.RUNE_ANY:if(r[a]=!1,B.next&&B.next.length>0)break;t.insert(B.out),s[a]=new Int32Array([0,IB.MAX_RUNE]),B.next=new Uint32Array([B.out]);break;case zB.RUNE_ANY_NOT_NL:if(r[a]=!1,B.next&&B.next.length>0)break;t.insert(B.out),s[a]=new Int32Array([0,9,11,IB.MAX_RUNE]),B.next=new Uint32Array(Math.floor(s[a].length/2)+1).fill(B.out)}return o};for(t.clear(),t.insert(e.start);!t.empty();)if(n.clear(),!i(t.next()))return null;for(let t=0;t<e.inst.length;t++)s[t]&&(e.inst[t].runes=s[t]);return e})(s),null!==s&&((e,t)=>{for(let n=0;n<t.inst.length;n++){const s=t.inst[n];switch(s.op){case zB.ALT:case zB.ALT_MATCH:case zB.RUNE:break;case zB.CAPTURE:case zB.EMPTY_WIDTH:case zB.NOP:case zB.MATCH:case zB.FAIL:e.inst[n].next=null;break;case zB.RUNE1:case zB.RUNE_ANY:case zB.RUNE_ANY_NOT_NL:e.inst[n].next=null,e.inst[n].op=s.op,e.inst[n].runes=s.runes?new Int32Array(s.runes):new Int32Array(0)}}})(s,e),s}static next(e,t){const n=e.matchRunePos(t);return n>=0?e.next[n]:e.op===zB.ALT_MATCH?e.out:0}static execute(t,n,s,r,i){const a=t.onepass;if(!a)return null;const o=new Int32Array(i).fill(-1);let B=!1,c=n.step(s),l=c>>3,u=7&c,h=FB.EOF(),p=-1,d=0;c!==FB.EOF()&&(h=n.step(s+u),h!==FB.EOF()&&(p=h>>3,d=7&h));let f,C=0===s?SB.emptyOpContext(-1,l):n.context(s),g=a.start;for(;;){switch(f=a.inst[g],g=f.out,f.op){case zB.MATCH:return r===BB.ANCHOR_BOTH&&s!==n.endPos()?null:(B=!0,o.length>0&&(o[0]=0,o[1]=s),0===i?[]:SB.toArray(o));case zB.RUNE:if(!f.matchRune(l))return null;break;case zB.RUNE1:if(l!==f.runes[0])return null;break;case zB.RUNE_ANY:break;case zB.RUNE_ANY_NOT_NL:if(10===l)return null;break;case zB.ALT:case zB.ALT_MATCH:g=e.next(f,l);continue;case zB.FAIL:return null;case zB.NOP:continue;case zB.EMPTY_WIDTH:if(0!==(f.arg&~C))return null;continue;case zB.CAPTURE:f.arg<o.length&&(o[f.arg]=s);continue;default:throw new JB("bad inst")}if(0===u)break;C=SB.emptyOpContext(l,p),s+=u,l=p,u=d,-1!==l&&(h=n.step(s+u),h!==FB.EOF()?(p=h>>3,d=7&h):(p=-1,d=0))}return B?0===i?[]:SB.toArray(o):null}},Bc=class e{static Op=NB(["NO_MATCH","EMPTY_MATCH","LITERAL","CHAR_CLASS","ANY_CHAR_NOT_NL","ANY_CHAR","BEGIN_LINE","END_LINE","BEGIN_TEXT","END_TEXT","WORD_BOUNDARY","NO_WORD_BOUNDARY","CAPTURE","STAR","PLUS","QUEST","REPEAT","CONCAT","ALTERNATE","PLB","NLB","LEFT_PAREN","VERTICAL_BAR"]);static isPseudoOp(t){return t>=e.Op.LEFT_PAREN}static emptySubs(){return[]}static quoteIfHyphen(e){return e===wB.CODES["-"]?"\\":""}static fromRegexp(t){const n=new e(t.op);return n.flags=t.flags,n.subs=t.subs,n.runes=t.runes,n.cap=t.cap,n.min=t.min,n.max=t.max,n.name=t.name,n.namedGroups=t.namedGroups,n.lb=t.lb,n}constructor(t){this.op=t,this.flags=0,this.subs=e.emptySubs(),this.runes=new Int32Array(0),this.min=0,this.max=0,this.cap=0,this.name=null,this.namedGroups=Object.create(null),this.lb=0}reinit(){this.flags=0,this.subs=e.emptySubs(),this.runes=new Int32Array(0),this.cap=0,this.min=0,this.max=0,this.name=null,this.namedGroups=Object.create(null),this.lb=0}toString(){return this.appendTo()}appendTo(){let t="";switch(this.op){case e.Op.NO_MATCH:t+="[^\\x00-\\x{10FFFF}]";break;case e.Op.EMPTY_MATCH:t+="(?:)";break;case e.Op.STAR:case e.Op.PLUS:case e.Op.QUEST:case e.Op.REPEAT:{const n=this.subs[0];switch(n.op>e.Op.CAPTURE||n.op===e.Op.LITERAL&&n.runes.length>1?t+=`(?:${n.appendTo()})`:t+=n.appendTo(),this.op){case e.Op.STAR:t+="*";break;case e.Op.PLUS:t+="+";break;case e.Op.QUEST:t+="?";break;case e.Op.REPEAT:t+=`{${this.min}`,this.min!==this.max&&(t+=",",this.max>=0&&(t+=this.max)),t+="}"}0!==(this.flags&BB.NON_GREEDY)&&(t+="?");break}case e.Op.CONCAT:for(let n of this.subs)n.op===e.Op.ALTERNATE?t+=`(?:${n.appendTo()})`:t+=n.appendTo();break;case e.Op.ALTERNATE:{let e="";for(let n of this.subs)t+=e,e="|",t+=n.appendTo();break}case e.Op.LITERAL:0!==(this.flags&BB.FOLD_CASE)&&(t+="(?i:");for(let e of this.runes)t+=SB.escapeRune(e);0!==(this.flags&BB.FOLD_CASE)&&(t+=")");break;case e.Op.ANY_CHAR_NOT_NL:t+="(?-s:.)";break;case e.Op.ANY_CHAR:t+="(?s:.)";break;case e.Op.PLB:t+=`(?<=${this.subs[0].appendTo()})`;break;case e.Op.NLB:t+=`(?<!${this.subs[0].appendTo()})`;break;case e.Op.CAPTURE:null===this.name||0===this.name.length?t+="(":t+=`(?P<${this.name}>`,this.subs[0].op!==e.Op.EMPTY_MATCH&&(t+=this.subs[0].appendTo()),t+=")";break;case e.Op.BEGIN_TEXT:t+="\\A";break;case e.Op.END_TEXT:0!==(this.flags&BB.WAS_DOLLAR)?t+="(?-m:$)":t+="\\z";break;case e.Op.BEGIN_LINE:t+="^";break;case e.Op.END_LINE:t+="$";break;case e.Op.WORD_BOUNDARY:t+="\\b";break;case e.Op.NO_WORD_BOUNDARY:t+="\\B";break;case e.Op.CHAR_CLASS:if(this.runes.length%2!=0){t+="[invalid char class]";break}if(t+="[",0===this.runes.length)t+="^\\x00-\\x{10FFFF}";else if(0===this.runes[0]&&this.runes[this.runes.length-1]===IB.MAX_RUNE){t+="^";for(let n=1;n<this.runes.length-1;n+=2){const s=this.runes[n]+1,r=this.runes[n+1]-1;t+=e.quoteIfHyphen(s),t+=SB.escapeRune(s),s!==r&&(t+="-",t+=e.quoteIfHyphen(r),t+=SB.escapeRune(r))}}else for(let n=0;n<this.runes.length;n+=2){const s=this.runes[n],r=this.runes[n+1];t+=e.quoteIfHyphen(s),t+=SB.escapeRune(s),s!==r&&(t+="-",t+=e.quoteIfHyphen(r),t+=SB.escapeRune(r))}t+="]";break;default:t+=this.op}return t}maxCap(){let t=0;if(this.op===e.Op.CAPTURE&&(t=this.cap),null!==this.subs)for(let e of this.subs){const n=e.maxCap();t<n&&(t=n)}return t}equals(t){if(!(null!==t&&t instanceof e))return!1;if(this.op!==t.op)return!1;switch(this.op){case e.Op.END_TEXT:if((this.flags&BB.WAS_DOLLAR)!==(t.flags&BB.WAS_DOLLAR))return!1;break;case e.Op.LITERAL:case e.Op.CHAR_CLASS:if((this.flags&BB.FOLD_CASE)!==(t.flags&BB.FOLD_CASE))return!1;if(null===this.runes&&null===t.runes)break;if(null===this.runes||null===t.runes)return!1;if(this.runes.length!==t.runes.length)return!1;for(let e=0;e<this.runes.length;e++)if(this.runes[e]!==t.runes[e])return!1;break;case e.Op.ALTERNATE:case e.Op.CONCAT:if(this.subs.length!==t.subs.length)return!1;for(let e=0;e<this.subs.length;++e)if(!this.subs[e].equals(t.subs[e]))return!1;break;case e.Op.STAR:case e.Op.PLUS:case e.Op.QUEST:if((this.flags&BB.NON_GREEDY)!==(t.flags&BB.NON_GREEDY)||!this.subs[0].equals(t.subs[0]))return!1;break;case e.Op.REPEAT:if((this.flags&BB.NON_GREEDY)!==(t.flags&BB.NON_GREEDY)||this.min!==t.min||this.max!==t.max||!this.subs[0].equals(t.subs[0]))return!1;break;case e.Op.CAPTURE:if(this.cap!==t.cap||(null===this.name?null!==t.name:this.name!==t.name)||!this.subs[0].equals(t.subs[0]))return!1;break;case e.Op.PLB:case e.Op.NLB:if(this.lb!==t.lb||!this.subs[0].equals(t.subs[0]))return!1}return!0}},cc=class{static walk(e,t){const n=[];let s,r=e;for(;;){if(0===r.subs.length)s=t.leaf(r);else{const e=t.enter(r);if(void 0===e.result){n.push({re:r,state:e,i:0}),r=r.subs[0];continue}s=e.result}for(;;){if(0===n.length)return s;const e=n[n.length-1];if(t.child(e.re,e.state,s,e.i),e.i++,void 0===e.state.result&&e.i<e.re.subs.length){r=e.re.subs[e.i];break}n.pop(),s=void 0!==e.state.result?e.state.result:t.leave(e.re,e.state)}}}},lc=class{constructor(e,t){const n=new Map,s=[0],r=[0],i=[0],a=[0];for(const o of e){let e=0;for(let B=0;B<o.length;B++){const c=e*t+o[B];let l=n.get(c);void 0===l&&(l=s.length,n.set(c,l),s.push(e),r.push(o[B]),i.push(i[e]+1),a.push(0)),e=l}a[e]=1}const o=s.length,B=new Int32Array(o-1);for(let e=1;e<o;e++)B[e-1]=e;B.sort((e,t)=>s[e]-s[t]||r[e]-r[t]);const c=new Int32Array(o+1);for(let e=1;e<o;e++)c[s[e]+1]++;for(let e=0;e<o;e++)c[e+1]+=c[e];const l=new Int32Array(o-1);for(let e=0;e<B.length;e++)l[e]=r[B[e]];this.childStart=c,this.childUnit=l,this.childNode=B;const u=new Int32Array(o);for(let e=0;e<o;e++)u[e]=e;u.sort((e,t)=>i[e]-i[t]);const h=new Int32Array(o),p=Uint8Array.from(a);for(let e=1;e<o;e++){const t=u[e],n=s[t];if(0!==n){let e=h[n],s=this.next(e,r[t]);for(;s<0&&0!==e;)e=h[e],s=this.next(e,r[t]);h[t]=s>=0?s:0}p[t]|=p[h[t]]}this.fail=h,this.match=p}next(e,t){let n=this.childStart[e],s=this.childStart[e+1];const r=this.childUnit;for(;n<s;){const e=n+s>>1,i=r[e];if(i===t)return this.childNode[e];i<t?n=e+1:s=e}return-1}advance(e,t){for(;;){const n=this.next(e,t);if(n>=0)return n;if(0===e)return 0;e=this.fail[e]}}searchUTF16(e,t,n){let s=0;for(let r=t;r<n;r++)if(s=this.advance(s,e.charCodeAt(r)),1===this.match[s])return!0;return!1}searchUTF8(e,t,n){let s=0;for(let r=t;r<n;r++)if(s=this.advance(s,e[r]),1===this.match[s])return!0;return!1}},uc=class e{static Type={NONE:0,EXACT:1,AND:2,OR:3};static MAX_SCANS=32;static MAX_AC_UNITS=1<<18;constructor(t){this.type=t,this.subs=[],this.str="",this.bytes=null,this.cost=t===e.Type.EXACT?1:0,this.allExact=!1,this.ac16=null,this.ac8=null}automaton16(){if(null===this.ac16){const e=this.subs.map(e=>{const t=new Array(e.str.length);for(let n=0;n<e.str.length;n++)t[n]=e.str.charCodeAt(n);return t});this.ac16=new lc(e,65536)}return this.ac16}automaton8(){return null===this.ac8&&(this.ac8=new lc(this.subs.map(e=>e.bytes),256)),this.ac8}eval(t,n){switch(this.type){case e.Type.NONE:return!0;case e.Type.EXACT:return t.hasString(this,n);case e.Type.AND:for(let e=0;e<this.subs.length;e++)if(!this.subs[e].eval(t,n))return!1;return!0;case e.Type.OR:if(this.allExact)return t.hasAnyString(this,n);for(let e=0;e<this.subs.length;e++)if(this.subs[e].eval(t,n))return!0;return!1;default:return!0}}},hc=class e{static build(t){return t?cc.walk(t,e.WALKER):new uc(uc.Type.NONE)}static WALKER={leaf:t=>e.leaf(t),enter:t=>e.enter(t),child:(t,n,s)=>e.child(t,n,s),leave:(t,n)=>e.leave(t,n)};static leaf(e){if(e.op!==Bc.Op.LITERAL)return new uc(uc.Type.NONE);if(0===e.runes.length||0!==(e.flags&BB.FOLD_CASE))return new uc(uc.Type.NONE);let t="";for(let n=0;n<e.runes.length;n++){if(IB.isUnsearchable(e.runes[n]))return new uc(uc.Type.NONE);t+=String.fromCodePoint(e.runes[n])}const n=new uc(uc.Type.EXACT);return n.str=t,n.bytes=SB.stringToUtf8ByteArray(n.str),n}static enter(e){switch(e.op){case Bc.Op.CAPTURE:case Bc.Op.PLUS:return{sub:null};case Bc.Op.REPEAT:return e.min>=1?{sub:null}:{result:new uc(uc.Type.NONE)};case Bc.Op.CONCAT:return{pf:new uc(uc.Type.AND),subs:[]};case Bc.Op.ALTERNATE:return{pf:new uc(uc.Type.OR),subs:[]};default:return{result:new uc(uc.Type.NONE)}}}static child(e,t,n){if(void 0!==t.subs)if(t.pf.type!==uc.Type.AND)if(n.type!==uc.Type.NONE)if(n.type!==uc.Type.OR)t.subs.push(n);else for(let e=0;e<n.subs.length;e++)t.subs.push(n.subs[e]);else t.result=new uc(uc.Type.NONE);else{if(n.type===uc.Type.NONE)return;if(n.type===uc.Type.AND){for(let e=0;e<n.subs.length;e++)t.subs.push(n.subs[e]);return}t.subs.push(n)}else t.sub=n}static leave(e,t){if(void 0===t.subs)return t.sub;const n=t.pf,s=new Set,r=[];for(const e of t.subs){if(e.type===uc.Type.EXACT){if(s.has(e.str))continue;s.add(e.str)}r.push(e)}if(n.type===uc.Type.AND){const e=[];let t=0;for(const n of r)t+n.cost>uc.MAX_SCANS||(e.push(n),t+=n.cost);return 0===e.length?new uc(uc.Type.NONE):1===e.length?e[0]:(n.subs=e,n.cost=t,n)}if(0===r.length)return new uc(uc.Type.NONE);if(1===r.length)return r[0];n.subs=r;let i=!0,a=0,o=0;for(const e of r)e.type!==uc.Type.EXACT?i=!1:o+=e.bytes.length,a+=e.cost;return i?o>uc.MAX_AC_UNITS?new uc(uc.Type.NONE):(n.allExact=!0,n.cost=1,n):a>uc.MAX_SCANS?new uc(uc.Type.NONE):(n.cost=a,n)}},pc=class{constructor(e=0,t=0){this.head=e,this.tail=t}},dc=class{constructor(){this.inst=[],this.start=0,this.numCap=2,this.lbStarts=[],this.numLb=0,this.lbInst=null}getInst(e){return this.inst[e]}numInst(){return this.inst.length}addInst(e){this.inst.push(new zB(e))}markLookbehindInsts(){const e=new Uint8Array(this.inst.length),t=this.lbStarts.slice();for(;t.length>0;){const n=t.pop();if(0===n||1===e[n])continue;e[n]=1;const s=this.inst[n];switch(s.op){case zB.ALT:case zB.ALT_MATCH:t.push(s.out,s.arg);break;case zB.MATCH:case zB.FAIL:break;default:t.push(s.out)}}this.lbInst=e}skipNop(e){let t=this.inst[e];for(;t.op===zB.NOP||t.op===zB.CAPTURE;)t=this.inst[e],e=t.out;return t}prefix(){let e="",t=this.skipNop(this.start);if(!zB.isRuneOp(t.op)||1!==t.runes.length)return[t.op===zB.MATCH,e];for(;zB.isRuneOp(t.op)&&1===t.runes.length&&0===(t.arg&BB.FOLD_CASE)&&!IB.isUnsearchable(t.runes[0]);)e+=String.fromCodePoint(t.runes[0]),t=this.skipNop(t.out);return[t.op===zB.MATCH,e]}startCond(){let e=0,t=this.start;e:for(;;){const n=this.inst[t];switch(n.op){case zB.EMPTY_WIDTH:e|=n.arg;break;case zB.FAIL:return-1;case zB.CAPTURE:case zB.NOP:break;default:break e}t=n.out}return e}patch(e,t){let n=e.head;for(;0!==n;){const e=this.inst[n>>1];1&n?(n=e.arg,e.arg=t):(n=e.out,e.out=t)}}append(e,t){if(0===e.head)return t;if(0===t.head)return e;const n=this.inst[e.tail>>1];return 1&e.tail?n.arg=t.head:n.out=t.head,new pc(e.head,t.tail)}toString(){let e="";for(let t=0;t<this.inst.length;t++){const n=e.length;e+=t,t===this.start&&(e+="*"),e+=" ".substring(e.length-n),e+=this.inst[t],e+="\n"}return e}};const fc=new Int32Array([0,wB.CODES["\n"]-1,wB.CODES["\n"]+1,IB.MAX_RUNE]),Cc=new Int32Array([0,IB.MAX_RUNE]);var gc=class{constructor(e=0,t=new pc,n=!1){this.i=e,this.out=t,this.nullable=n}},mc=class e{static compileRegexp(t){const n=new e,s=n.compile(t);return n.prog.patch(s.out,n.newInst(zB.MATCH).i),n.prog.start=s.i,n.prog.markLookbehindInsts(),n.prog}static compileSet(t){const n=new e;if(0===t.length)return n.prog.start=n.newInst(zB.FAIL).i,n.prog.markLookbehindInsts(),n.prog;let s=[];for(let e=0;e<t.length;e++){n.lbOffset=n.prog.numLb;const r=n.compile(t[e]),i=n.newInst(zB.MATCH);n.prog.getInst(i.i).arg=e,n.prog.patch(r.out,i.i),s.push(r.i)}let r=s[0];for(let e=1;e<s.length;e++){const t=n.newInst(zB.ALT),i=n.prog.getInst(t.i);i.out=r,i.arg=s[e],r=t.i}return n.prog.start=r,n.prog.markLookbehindInsts(),n.prog}constructor(){this.prog=new dc,this.newInst(zB.FAIL),this.lbOffset=0,this.runeCache=new Map,this.walker={leaf:e=>this.leaf(e),enter:e=>this.enter(e),child:(e,t,n)=>this.child(e,t,n),leave:(e,t)=>this.leave(e,t)}}newInst(e){return this.prog.addInst(e),new gc(this.prog.numInst()-1,new pc,!0)}nop(){const e=this.newInst(zB.NOP);return e.out=new pc(e.i<<1,e.i<<1),e}fail(){return new gc}cap(e){const t=this.newInst(zB.CAPTURE);return t.out=new pc(t.i<<1,t.i<<1),this.prog.getInst(t.i).arg=e,this.prog.numCap<e+1&&(this.prog.numCap=e+1),t}cat(e,t){return 0===e.i||0===t.i?(this.prog.patch(e.out,0),this.prog.patch(t.out,0),this.fail()):(this.prog.patch(e.out,t.i),new gc(e.i,t.out,e.nullable&&t.nullable))}alt(e,t){if(0===e.i)return t;if(0===t.i)return e;const n=this.newInst(zB.ALT),s=this.prog.getInst(n.i);return s.out=e.i,s.arg=t.i,n.out=this.prog.append(e.out,t.out),n.nullable=e.nullable||t.nullable,n}loop(e,t){const n=this.newInst(zB.ALT),s=this.prog.getInst(n.i);return t?(s.arg=e.i,n.out=new pc(n.i<<1,n.i<<1)):(s.out=e.i,n.out=new pc(n.i<<1|1,n.i<<1|1)),this.prog.patch(e.out,n.i),n}quest(e,t){if(0===e.i)return this.nop();const n=this.newInst(zB.ALT),s=this.prog.getInst(n.i);return t?(s.arg=e.i,n.out=new pc(n.i<<1,n.i<<1)):(s.out=e.i,n.out=new pc(n.i<<1|1,n.i<<1|1)),n.out=this.prog.append(n.out,e.out),n}star(e,t){return 0===e.i?this.nop():e.nullable?this.quest(this.plus(e,t),t):this.loop(e,t)}plus(e,t){return 0===e.i?this.fail():new gc(e.i,this.loop(e,t).out,e.nullable)}empty(e){const t=this.newInst(zB.EMPTY_WIDTH);return this.prog.getInst(t.i).arg=e,t.out=new pc(t.i<<1,t.i<<1),t}rune(e,t){const n=this.newInst(zB.RUNE);n.nullable=!1;const s=this.prog.getInst(n.i);return s.runes=e,t&=BB.FOLD_CASE,1===e.length&&IB.simpleFold(e[0])!==e[0]||(t&=-2),s.arg=t,n.out=new pc(n.i<<1,n.i<<1),0===(t&BB.FOLD_CASE)&&1===e.length||2===e.length&&e[0]===e[1]?s.op=zB.RUNE1:2===e.length&&0===e[0]&&e[1]===IB.MAX_RUNE?s.op=zB.RUNE_ANY:4===e.length&&0===e[0]&&e[1]===wB.CODES["\n"]-1&&e[2]===wB.CODES["\n"]+1&&e[3]===IB.MAX_RUNE&&(s.op=zB.RUNE_ANY_NOT_NL),n}lookBehind(e,t){const n=Math.sign(t)*(Math.abs(t)+this.lbOffset),s=this.newInst(zB.LB_WRITE);this.prog.getInst(s.i).arg=n;const r=this.rune(Cc,0),i=this.star(r,!0),a=this.cat(i,e);this.prog.patch(a.out,s.i);const o=this.newInst(zB.LB_CHECK);return this.prog.getInst(o.i).arg=n,this.prog.lbStarts.push(a.i),Math.abs(n)>this.prog.numLb&&(this.prog.numLb=Math.abs(n)),o.out=new pc(o.i<<1,o.i<<1),o}compile(e){return cc.walk(e,this.walker)}leaf(e){switch(e.op){case Bc.Op.NO_MATCH:return this.fail();case Bc.Op.EMPTY_MATCH:return this.nop();case Bc.Op.LITERAL:{if(0===e.runes.length)return this.nop();let t=null;for(let n of e.runes){let s=this.runeCache.get(n);void 0===s&&(s=new Int32Array([n]),this.runeCache.set(n,s));const r=this.rune(s,e.flags);t=null===t?r:this.cat(t,r)}return t}case Bc.Op.CHAR_CLASS:return this.rune(e.runes,e.flags);case Bc.Op.ANY_CHAR_NOT_NL:return this.rune(fc,0);case Bc.Op.ANY_CHAR:return this.rune(Cc,0);case Bc.Op.BEGIN_LINE:return this.empty(SB.EMPTY_BEGIN_LINE);case Bc.Op.END_LINE:return this.empty(SB.EMPTY_END_LINE);case Bc.Op.BEGIN_TEXT:return this.empty(SB.EMPTY_BEGIN_TEXT);case Bc.Op.END_TEXT:return this.empty(SB.EMPTY_END_TEXT);case Bc.Op.WORD_BOUNDARY:return this.empty(SB.EMPTY_WORD_BOUNDARY);case Bc.Op.NO_WORD_BOUNDARY:return this.empty(SB.EMPTY_NO_WORD_BOUNDARY);case Bc.Op.CONCAT:case Bc.Op.ALTERNATE:return this.nop();default:throw new VB("regexp: unhandled case in compile")}}enter(e){switch(e.op){case Bc.Op.PLB:case Bc.Op.NLB:case Bc.Op.STAR:case Bc.Op.PLUS:case Bc.Op.QUEST:return{sub:null};case Bc.Op.CAPTURE:return{bra:this.cap(e.cap<<1),sub:null};case Bc.Op.CONCAT:case Bc.Op.ALTERNATE:return{f:null};default:throw new VB("regexp: unhandled case in compile")}}child(e,t,n){e.op===Bc.Op.CONCAT?t.f=null===t.f?n:this.cat(t.f,n):e.op===Bc.Op.ALTERNATE?t.f=null===t.f?n:this.alt(t.f,n):t.sub=n}leave(e,t){switch(e.op){case Bc.Op.PLB:case Bc.Op.NLB:return this.lookBehind(t.sub,e.lb);case Bc.Op.CAPTURE:{const n=this.cap(e.cap<<1|1);return this.cat(this.cat(t.bra,t.sub),n)}case Bc.Op.STAR:return this.star(t.sub,0!==(e.flags&BB.NON_GREEDY));case Bc.Op.PLUS:return this.plus(t.sub,0!==(e.flags&BB.NON_GREEDY));case Bc.Op.QUEST:return this.quest(t.sub,0!==(e.flags&BB.NON_GREEDY));case Bc.Op.CONCAT:case Bc.Op.ALTERNATE:return t.f;default:throw new VB("regexp: unhandled case in compile")}}},wc=class e{static simplify(t){return null===t?null:cc.walk(t,e.WALKER)}static WALKER={leaf:t=>e.leaf(t),enter:t=>e.enter(t),child:(t,n,s,r)=>e.child(t,n,s,r),leave:(t,n)=>e.leave(t,n)};static leaf(e){if(e.op===Bc.Op.CHAR_CLASS){if(null===e.runes)return e;if(0===e.runes.length)return new Bc(Bc.Op.NO_MATCH);if(2===e.runes.length&&0===e.runes[0]&&e.runes[1]===IB.MAX_RUNE)return new Bc(Bc.Op.ANY_CHAR);if(4===e.runes.length&&0===e.runes[0]&&e.runes[1]===wB.CODES["\n"]-1&&e.runes[2]===wB.CODES["\n"]+1&&e.runes[3]===IB.MAX_RUNE)return new Bc(Bc.Op.ANY_CHAR_NOT_NL)}return e}static enter(e){switch(e.op){case Bc.Op.PLB:case Bc.Op.NLB:case Bc.Op.CAPTURE:case Bc.Op.STAR:case Bc.Op.PLUS:case Bc.Op.QUEST:return{sub:null};case Bc.Op.CONCAT:case Bc.Op.ALTERNATE:return{subs:[],changed:!1};case Bc.Op.REPEAT:return 0===e.min&&0===e.max?{result:new Bc(Bc.Op.EMPTY_MATCH)}:{sub:null};default:return{result:e}}}static child(e,t,n,s){if(void 0!==t.subs){if(n!==e.subs[s]&&(t.changed=!0),e.op===Bc.Op.CONCAT){if(n.op===Bc.Op.NO_MATCH)return void(t.result=new Bc(Bc.Op.NO_MATCH));if(n.op===Bc.Op.EMPTY_MATCH)return void(t.changed=!0);if(n.op===Bc.Op.CONCAT){t.changed=!0;for(let e=0;e<n.subs.length;e++)t.subs.push(n.subs[e]);return}}else{if(n.op===Bc.Op.NO_MATCH)return void(t.changed=!0);if(n.op===Bc.Op.ALTERNATE){t.changed=!0;for(let e=0;e<n.subs.length;e++)t.subs.push(n.subs[e]);return}}t.subs.push(n)}else t.sub=n}static leave(t,n){switch(t.op){case Bc.Op.PLB:case Bc.Op.NLB:case Bc.Op.CAPTURE:{const e=n.sub;if(e!==t.subs[0]){const n=Bc.fromRegexp(t);return n.runes=new Int32Array(0),n.subs=[e],n}return t}case Bc.Op.CONCAT:case Bc.Op.ALTERNATE:if(n.changed){const e=n.subs;if(0===e.length)return new Bc(t.op===Bc.Op.CONCAT?Bc.Op.EMPTY_MATCH:Bc.Op.NO_MATCH);if(1===e.length)return e[0];const s=Bc.fromRegexp(t);return s.runes=new Int32Array(0),s.subs=e,s}return t;case Bc.Op.STAR:case Bc.Op.PLUS:case Bc.Op.QUEST:return e.simplify1(t.op,t.flags,n.sub,t);case Bc.Op.REPEAT:return e.simplifyRepeat(t,n.sub);default:return t}}static simplifyRepeat(t,n){if(-1===t.max){if(0===t.min)return e.simplify1(Bc.Op.STAR,t.flags,n,null);if(1===t.min)return e.simplify1(Bc.Op.PLUS,t.flags,n,null);const s=[];for(let e=0;e<t.min-1;e++)s.push(n);return s.push(e.simplify1(Bc.Op.PLUS,t.flags,n,null)),e.concat(s)}if(1===t.min&&1===t.max)return n;let s=null;if(t.min>0){s=[];for(let e=0;e<t.min;e++)s.push(n)}if(t.max>t.min){let r=e.simplify1(Bc.Op.QUEST,t.flags,n,null);for(let s=t.min+1;s<t.max;s++)r=e.simplify1(Bc.Op.QUEST,t.flags,e.concat([n,r]),null);if(null===s)return r;s.push(r)}return null!==s?e.concat(s):new Bc(Bc.Op.NO_MATCH)}static concat(e){const t=[];for(let n=0;n<e.length;n++){const s=e[n];if(s.op===Bc.Op.NO_MATCH)return new Bc(Bc.Op.NO_MATCH);if(s.op!==Bc.Op.EMPTY_MATCH)if(s.op!==Bc.Op.CONCAT)t.push(s);else for(let e=0;e<s.subs.length;e++)t.push(s.subs[e])}if(0===t.length)return new Bc(Bc.Op.EMPTY_MATCH);if(1===t.length)return t[0];const n=new Bc(Bc.Op.CONCAT);return n.subs=t,n}static simplify1(e,t,n,s){if(n.op===Bc.Op.EMPTY_MATCH)return n;if(n.op===Bc.Op.NO_MATCH)return e===Bc.Op.PLUS?n:new Bc(Bc.Op.EMPTY_MATCH);if(e===n.op&&(t&BB.NON_GREEDY)===(n.flags&BB.NON_GREEDY))return n;if(null!==s&&s.op===e&&(s.flags&BB.NON_GREEDY)===(t&BB.NON_GREEDY)&&n===s.subs[0])return s;const r=new Bc(e);return r.flags=t,r.subs=[n],r}},Ec=class{constructor(e,t){this.sign=e,this.cls=t}};const yc=[48,57],Dc=[9,10,12,13,32,32],_c=[48,57,65,90,95,95,97,122],bc=new Map([["\\d",new Ec(1,yc)],["\\D",new Ec(-1,yc)],["\\s",new Ec(1,Dc)],["\\S",new Ec(-1,Dc)],["\\w",new Ec(1,_c)],["\\W",new Ec(-1,_c)]]),vc=[48,57,65,90,97,122],Ic=[65,90,97,122],Tc=[0,127],Ac=[9,9,32,32],Oc=[0,31,127,127],Sc=[48,57],Nc=[33,126],Rc=[97,122],kc=[32,126],Lc=[33,47,58,64,91,96,123,126],xc=[9,13,32,32],Fc=[65,90],Pc=[48,57,65,90,95,95,97,122],Mc=[48,57,65,70,97,102],Gc=new Map([["[:alnum:]",new Ec(1,vc)],["[:^alnum:]",new Ec(-1,vc)],["[:alpha:]",new Ec(1,Ic)],["[:^alpha:]",new Ec(-1,Ic)],["[:ascii:]",new Ec(1,Tc)],["[:^ascii:]",new Ec(-1,Tc)],["[:blank:]",new Ec(1,Ac)],["[:^blank:]",new Ec(-1,Ac)],["[:cntrl:]",new Ec(1,Oc)],["[:^cntrl:]",new Ec(-1,Oc)],["[:digit:]",new Ec(1,Sc)],["[:^digit:]",new Ec(-1,Sc)],["[:graph:]",new Ec(1,Nc)],["[:^graph:]",new Ec(-1,Nc)],["[:lower:]",new Ec(1,Rc)],["[:^lower:]",new Ec(-1,Rc)],["[:print:]",new Ec(1,kc)],["[:^print:]",new Ec(-1,kc)],["[:punct:]",new Ec(1,Lc)],["[:^punct:]",new Ec(-1,Lc)],["[:space:]",new Ec(1,xc)],["[:^space:]",new Ec(-1,xc)],["[:upper:]",new Ec(1,Fc)],["[:^upper:]",new Ec(-1,Fc)],["[:word:]",new Ec(1,Pc)],["[:^word:]",new Ec(-1,Pc)],["[:xdigit:]",new Ec(1,Mc)],["[:^xdigit:]",new Ec(-1,Mc)]]);var Uc=class e{static charClassToString(e,t){let n="[";for(let s=0;s<t;s+=2){s>0&&(n+=" ");const t=e[s],r=e[s+1];n+=t===r?`0x${t.toString(16)}`:`0x${t.toString(16)}-0x${r.toString(16)}`}return n+="]",n}static sortRanges(e,t){const n=t>>1,s=new Array(n);for(let e=0;e<n;e++)s[e]=e;s.sort((t,n)=>e[2*t]-e[2*n]||e[2*n+1]-e[2*t+1]);const r=e.slice(0,t);for(let t=0;t<n;t++)e[2*t]=r[2*s[t]],e[2*t+1]=r[2*s[t]+1]}constructor(e=SB.emptyInts()){this.r=e,this.len=e.length}toArray(){return this.r instanceof Int32Array?this.len===this.r.length?this.r:this.r.subarray(0,this.len):new Int32Array(this.len===this.r.length?this.r:this.r.slice(0,this.len))}toGrowableArray(){return Array.isArray(this.r)?(this.r.length=this.len,this.r):Array.from(this.r.subarray(0,this.len))}cleanClass(){if(this.len<4)return this;e.sortRanges(this.r,this.len);let t=2;for(let e=2;e<this.len;e+=2){const n=this.r[e],s=this.r[e+1];n<=this.r[t-1]+1?s>this.r[t-1]&&(this.r[t-1]=s):(this.r[t]=n,this.r[t+1]=s,t+=2)}return this.len=t,this}appendLiteral(e,t){return 0!==(t&BB.FOLD_CASE)?this.appendFoldedRange(e,e):this.appendRange(e,e)}appendRange(e,t){if(this.len>0)for(let n=2;n<=4;n+=2)if(this.len>=n){const s=this.r[this.len-n],r=this.r[this.len-n+1];if(e<=r+1&&s<=t+1)return e<s&&(this.r[this.len-n]=e),t>r&&(this.r[this.len-n+1]=t),this}return this.r[this.len++]=e,this.r[this.len++]=t,this}appendFoldedRange(e,t){if(e<=IB.MIN_FOLD&&t>=IB.MAX_FOLD)return this.appendRange(e,t);if(t<IB.MIN_FOLD||e>IB.MAX_FOLD)return this.appendRange(e,t);e<IB.MIN_FOLD&&(this.appendRange(e,IB.MIN_FOLD-1),e=IB.MIN_FOLD),t>IB.MAX_FOLD&&(this.appendRange(IB.MAX_FOLD+1,t),t=IB.MAX_FOLD);for(let n=e;n<=t;n++){this.appendRange(n,n);for(let e=IB.simpleFold(n);e!==n;e=IB.simpleFold(e))this.appendRange(e,e)}return this}appendClass(e){for(let t=0;t<e.length;t+=2)this.appendRange(e[t],e[t+1]);return this}appendFoldedClass(e){for(let t=0;t<e.length;t+=2)this.appendFoldedRange(e[t],e[t+1]);return this}appendNegatedClass(e){let t=0;for(let n=0;n<e.length;n+=2){const s=e[n],r=e[n+1];t<=s-1&&this.appendRange(t,s-1),t=r+1}return t<=IB.MAX_RUNE&&this.appendRange(t,IB.MAX_RUNE),this}appendTable(e){for(let t=0;t<e.length;++t){const n=e.getLo(t),s=e.getHi(t),r=e.getStride(t);if(1!==r)for(let e=n;e<=s;e+=r)this.appendRange(e,e);else this.appendRange(n,s)}return this}appendNegatedTable(e){let t=0;for(let n=0;n<e.length;++n){const s=e.getLo(n),r=e.getHi(n),i=e.getStride(n);if(1!==i)for(let e=s;e<=r;e+=i)t<=e-1&&this.appendRange(t,e-1),t=e+1;else t<=s-1&&this.appendRange(t,s-1),t=r+1}return t<=IB.MAX_RUNE&&this.appendRange(t,IB.MAX_RUNE),this}appendTableWithSign(e,t){return t<0?this.appendNegatedTable(e):this.appendTable(e)}negateClass(){let e=0,t=0;for(let n=0;n<this.len;n+=2){const s=this.r[n],r=this.r[n+1];e<=s-1&&(this.r[t]=e,this.r[t+1]=s-1,t+=2),e=r+1}return this.len=t,e<=IB.MAX_RUNE&&(this.r[this.len++]=e,this.r[this.len++]=IB.MAX_RUNE),this}appendClassWithSign(e,t){return t<0?this.appendNegatedClass(e):this.appendClass(e)}appendGroup(t,n){let s=t.cls;return n&&(s=(new e).appendFoldedClass(s).cleanClass().toArray()),this.appendClassWithSign(s,t.sign)}toString(){return e.charClassToString(this.r,this.len)}},Hc=class{constructor(e){this.str=e,this.position=0}pos(){return this.position}rewindTo(e){this.position=e}more(){return this.position<this.str.length}peek(){return this.str.codePointAt(this.position)}skip(e){this.position+=e}skipString(e){this.position+=e.length}pop(){const e=this.str.codePointAt(this.position);return this.position+=SB.charCount(e),e}lookingAt(e){return this.str.startsWith(e,this.position)}rest(){return this.str.substring(this.position)}from(e){return this.str.substring(e,this.position)}toString(){return this.rest()}},Vc=class e{static ERR_INTERNAL_ERROR="regexp/syntax: internal error";static ERR_INVALID_CHAR_RANGE="invalid character class range";static ERR_INVALID_ESCAPE="invalid escape sequence";static ERR_INVALID_NAMED_CAPTURE="invalid named capture";static ERR_INVALID_PERL_OP="invalid or unsupported Perl syntax";static ERR_INVALID_REPEAT_OP="invalid nested repetition operator";static ERR_INVALID_REPEAT_SIZE="invalid repeat count";static ERR_MISSING_BRACKET="missing closing ]";static ERR_MISSING_PAREN="missing closing )";static ERR_MISSING_REPEAT_ARGUMENT="missing argument to repetition operator";static ERR_TRAILING_BACKSLASH="trailing backslash at end of expression";static ERR_DUPLICATE_NAMED_CAPTURE="duplicate capture group name";static ERR_UNEXPECTED_PAREN="unexpected )";static ERR_NESTING_DEPTH="expression nests too deeply";static ERR_LARGE="expression too large";static ERR_INVALID_CAPTURE_IN_LOOKBEHIND="invalid capture in lookbehind";static MAX_HEIGHT=1e3;static MAX_SIZE=1398101;static MAX_RUNES=33554432;static ANY_TABLE=new EB(new Uint32Array([0,IB.MAX_RUNE,1]));static ASCII_TABLE=new EB(new Uint32Array([0,127,1]));static ASCII_FOLD_TABLE=new EB(new Uint32Array([0,127,1,383,383,1,8490,8490,1]));static unicodeTable(t){return"Any"===t?{tab:e.ANY_TABLE,fold:e.ANY_TABLE,sign:1}:"Ascii"===t?{tab:e.ASCII_TABLE,fold:e.ASCII_FOLD_TABLE,sign:1}:"Assigned"===t?{tab:vB.CATEGORIES.get("Cn"),fold:vB.CATEGORIES.get("Cn"),sign:-1}:"Lc"===t?{tab:vB.CATEGORIES.get("LC"),fold:vB.FOLD_CATEGORIES.get("LC"),sign:1}:vB.CATEGORIES.has(t)?{tab:vB.CATEGORIES.get(t),fold:vB.FOLD_CATEGORIES.get(t),sign:1}:vB.SCRIPTS.has(t)?{tab:vB.SCRIPTS.get(t),fold:vB.FOLD_SCRIPT.get(t),sign:1}:null}static minFoldRune(e){if(e<IB.MIN_FOLD||e>IB.MAX_FOLD)return e;let t=e;const n=e;for(e=IB.simpleFold(e);e!==n;e=IB.simpleFold(e))t>e&&(t=e);return t}static leadingRegexp(e){if(e.op===Bc.Op.EMPTY_MATCH)return null;if(e.op===Bc.Op.CONCAT&&e.subs.length>0){const t=e.subs[0];return t.op===Bc.Op.EMPTY_MATCH?null:t}return e}static literalRegexp(e,t){const n=new Bc(Bc.Op.LITERAL);return n.flags=t,n.runes=SB.stringToRunes(e),n}static parse(t,n){return new e(t,n).parseInternal()}static parseRepeat(t){const n=t.pos();if(!t.more()||!t.lookingAt("{"))return-1;t.skip(1);const s=e.parseInt(t);if(-1===s)return-1;if(!t.more())return-1;let r;if(t.lookingAt(",")){if(t.skip(1),!t.more())return-1;if(t.lookingAt("}"))r=-1;else if(-1===(r=e.parseInt(t)))return-1}else r=s;if(!t.more()||!t.lookingAt("}"))return-1;if(t.skip(1),s<0||s>1e3||-2===r||r>1e3||r>=0&&s>r)throw new HB(e.ERR_INVALID_REPEAT_SIZE,t.from(n));return s<<16|r&IB.MAX_BMP}static isValidCaptureName(e){if(0===e.length)return!1;for(let t=0;t<e.length;t++){const n=e.codePointAt(t);if(n!==wB.CODES._&&!SB.isalnum(n))return!1}return!0}static parseInt(e){const t=e.pos();for(;e.more()&&e.peek()>=wB.CODES[0]&&e.peek()<=wB.CODES[9];)e.skip(1);const n=e.from(t);return 0===n.length||n.length>1&&n.codePointAt(0)===wB.CODES[0]?-1:n.length>8?-2:parseInt(n,10)}static isCharClass(e){return e.op===Bc.Op.LITERAL&&1===e.runes.length||e.op===Bc.Op.CHAR_CLASS||e.op===Bc.Op.ANY_CHAR_NOT_NL||e.op===Bc.Op.ANY_CHAR}static matchRune(e,t){switch(e.op){case Bc.Op.LITERAL:return 1===e.runes.length&&e.runes[0]===t;case Bc.Op.CHAR_CLASS:for(let n=0;n<e.runes.length;n+=2)if(e.runes[n]<=t&&t<=e.runes[n+1])return!0;return!1;case Bc.Op.ANY_CHAR_NOT_NL:return t!==wB.CODES["\n"];case Bc.Op.ANY_CHAR:return!0}return!1}static mergeCharClass(t,n){switch(t.op){case Bc.Op.ANY_CHAR:break;case Bc.Op.ANY_CHAR_NOT_NL:e.matchRune(n,wB.CODES["\n"])&&(t.op=Bc.Op.ANY_CHAR);break;case Bc.Op.CHAR_CLASS:{const e=new Uc(Array.isArray(t.runes)?t.runes:Array.from(t.runes));n.op===Bc.Op.LITERAL?e.appendLiteral(n.runes[0],n.flags):e.appendClass(n.runes),t.runes=e.toGrowableArray();break}case Bc.Op.LITERAL:if(n.runes[0]===t.runes[0]&&n.flags===t.flags)break;t.op=Bc.Op.CHAR_CLASS,t.runes=(new Uc).appendLiteral(t.runes[0],t.flags).appendLiteral(n.runes[0],n.flags).toGrowableArray()}}static parseEscape(t){const n=t.pos();if(t.skip(1),!t.more())throw new HB(e.ERR_TRAILING_BACKSLASH);let s=t.pop();e:switch(s){case wB.CODES[1]:case wB.CODES[2]:case wB.CODES[3]:case wB.CODES[4]:case wB.CODES[5]:case wB.CODES[6]:case wB.CODES[7]:if(!t.more()||t.peek()<wB.CODES[0]||t.peek()>wB.CODES[7])break;case wB.CODES[0]:{let e=s-wB.CODES[0];for(let n=1;n<3&&!(!t.more()||t.peek()<wB.CODES[0]||t.peek()>wB.CODES[7]);n++)e=8*e+t.peek()-wB.CODES[0],t.skip(1);return e}case wB.CODES.x:{if(!t.more())break;if(s=t.pop(),s===wB.CODES["{"]){let e=0,n=0;for(;;){if(!t.more())break e;if(s=t.pop(),s===wB.CODES["}"])break;const r=SB.unhex(s);if(r<0)break e;if(n=16*n+r,n>IB.MAX_RUNE)break e;e++}if(0===e)break e;return n}const e=SB.unhex(s);if(!t.more())break;s=t.pop();const n=SB.unhex(s);if(e<0||n<0)break;return 16*e+n}case wB.CODES.a:return wB.CODES[""];case wB.CODES.f:return wB.CODES["\f"];case wB.CODES.n:return wB.CODES["\n"];case wB.CODES.r:return wB.CODES["\r"];case wB.CODES.t:return wB.CODES["\t"];case wB.CODES.v:return wB.CODES["\v"];default:if(s<=IB.MAX_ASCII&&!SB.isalnum(s))return s}throw new HB(e.ERR_INVALID_ESCAPE,t.from(n))}static parseClassChar(t,n){if(!t.more())throw new HB(e.ERR_MISSING_BRACKET,t.from(n));return t.lookingAt("\\")?e.parseEscape(t):t.pop()}static hasCapture(t){if(null===t)return!1;if(t.op===Bc.Op.CAPTURE)return!0;if(t.subs)for(let n of t.subs)if(e.hasCapture(n))return!0;return!1}constructor(e,t=0){this.wholeRegexp=e,this.flags=t,this.numCap=0,this.namedGroups=Object.create(null),this.stack=[],this.free=null,this.numRegexp=0,this.numRunes=0,this.repeats=0,this.height=null,this.size=null,this.nlb=0}newRegexp(e){let t=this.free;return null!==t&&null!==t.subs&&t.subs.length>0?(this.free=t.subs[0],t.reinit(),t.op=e):(t=new Bc(e),this.numRegexp+=1),t}reuse(e){null!==this.height&&this.height.has(e)&&this.height.delete(e),null!==e.subs&&e.subs.length>0&&(e.subs[0]=this.free),this.free=e}checkLimits(t){if(this.numRunes>e.MAX_RUNES)throw new HB(e.ERR_LARGE);this.checkSize(t),this.checkHeight(t)}checkSize(t){if(null===this.size){if(0===this.repeats&&(this.repeats=1),t.op===Bc.Op.REPEAT){let n=t.max;-1===n&&(n=t.min),n<=0&&(n=1),n>Math.floor(e.MAX_SIZE/this.repeats)?this.repeats=e.MAX_SIZE:this.repeats*=n}if(this.numRegexp<Math.floor(e.MAX_SIZE/this.repeats))return;this.size=new Map;for(let e of this.stack)this.checkSize(e)}if(this.calcSize(t,!0)>e.MAX_SIZE)throw new HB(e.ERR_LARGE)}calcSize(e,t=!1){if(!t&&null!==this.size&&this.size.has(e))return this.size.get(e);let n=0;switch(e.op){case Bc.Op.LITERAL:n=e.runes.length;break;case Bc.Op.PLB:case Bc.Op.NLB:case Bc.Op.CAPTURE:case Bc.Op.STAR:n=2+this.calcSize(e.subs[0]);break;case Bc.Op.PLUS:case Bc.Op.QUEST:n=1+this.calcSize(e.subs[0]);break;case Bc.Op.CONCAT:for(let t of e.subs)n+=this.calcSize(t);break;case Bc.Op.ALTERNATE:for(let t of e.subs)n+=this.calcSize(t);e.subs.length>1&&(n=n+e.subs.length-1);break;case Bc.Op.REPEAT:{let t=this.calcSize(e.subs[0]);if(-1===e.max){n=0===e.min?2+t:1+e.min*t;break}n=e.max*t+(e.max-e.min);break}}return n=Math.max(1,n),null===this.size&&(this.size=new Map),this.size.set(e,n),n}checkHeight(t){if(!(this.numRegexp<e.MAX_HEIGHT)){if(null===this.height){this.height=new Map;for(let e of this.stack)this.checkHeight(e)}if(this.calcHeight(t,!0)>e.MAX_HEIGHT)throw new HB(e.ERR_NESTING_DEPTH)}}calcHeight(e,t=!1){if(!t&&null!==this.height&&this.height.has(e))return this.height.get(e);let n=1;for(let t of e.subs){const e=this.calcHeight(t);n<1+e&&(n=1+e)}return null===this.height&&(this.height=new Map),this.height.set(e,n),n}pop(){return this.stack.pop()}popToPseudo(){const e=this.stack.length;let t=e;for(;t>0&&!Bc.isPseudoOp(this.stack[t-1].op);)t--;return this.stack.splice(t,e-t)}push(e){if(this.numRunes+=e.runes.length,e.op===Bc.Op.CHAR_CLASS&&2===e.runes.length&&e.runes[0]===e.runes[1]){if(this.maybeConcat(e.runes[0],-2&this.flags))return null;e.op=Bc.Op.LITERAL,e.runes=[e.runes[0]],e.flags=-2&this.flags}else if(e.op===Bc.Op.CHAR_CLASS&&4===e.runes.length&&e.runes[0]===e.runes[1]&&e.runes[2]===e.runes[3]&&IB.simpleFold(e.runes[0])===e.runes[2]&&IB.simpleFold(e.runes[2])===e.runes[0]||e.op===Bc.Op.CHAR_CLASS&&2===e.runes.length&&e.runes[0]+1===e.runes[1]&&IB.simpleFold(e.runes[0])===e.runes[1]&&IB.simpleFold(e.runes[1])===e.runes[0]){if(this.maybeConcat(e.runes[0],this.flags|BB.FOLD_CASE))return null;e.op=Bc.Op.LITERAL,e.runes=[e.runes[0]],e.flags=this.flags|BB.FOLD_CASE}else this.maybeConcat(-1,0);return this.stack.push(e),this.checkLimits(e),e}maybeConcat(e,t){const n=this.stack.length;if(n<2)return!1;const s=this.stack[n-1],r=this.stack[n-2];if(s.op!==Bc.Op.LITERAL||r.op!==Bc.Op.LITERAL||(s.flags&BB.FOLD_CASE)!==(r.flags&BB.FOLD_CASE))return!1;Array.isArray(r.runes)||(r.runes=Array.from(r.runes));for(let e=0;e<s.runes.length;e++)r.runes.push(s.runes[e]);return e>=0?(s.runes=[e],s.flags=t,!0):(this.pop(),this.reuse(s),!1)}newLiteral(t,n){const s=this.newRegexp(Bc.Op.LITERAL);return s.flags=n,0!==(n&BB.FOLD_CASE)&&(t=e.minFoldRune(t)),s.runes=[t],s}literal(e){this.push(this.newLiteral(e,this.flags))}op(e){const t=this.newRegexp(e);return t.flags=this.flags,this.push(t)}repeat(t,n,s,r,i,a){let o=this.flags;if(0!==(o&BB.PERL_X)&&(i.more()&&i.lookingAt("?")&&(i.skip(1),o^=BB.NON_GREEDY),-1!==a))throw new HB(e.ERR_INVALID_REPEAT_OP,i.from(a));const B=this.stack.length;if(0===B)throw new HB(e.ERR_MISSING_REPEAT_ARGUMENT,i.from(r));const c=this.stack[B-1];if(Bc.isPseudoOp(c.op))throw new HB(e.ERR_MISSING_REPEAT_ARGUMENT,i.from(r));const l=this.newRegexp(t);if(l.min=n,l.max=s,l.flags=o,l.subs=[c],this.stack[B-1]=l,this.checkLimits(l),t===Bc.Op.REPEAT&&(n>=2||s>=2)&&!this.repeatIsValid(l,1e3))throw new HB(e.ERR_INVALID_REPEAT_SIZE,i.from(r))}repeatIsValid(e,t){if(e.op===Bc.Op.REPEAT){let n=e.max;if(0===n)return!0;if(n<0&&(n=e.min),n>t)return!1;n>0&&(t=Math.trunc(t/n))}for(let n of e.subs)if(!this.repeatIsValid(n,t))return!1;return!0}concat(){this.maybeConcat(-1,0);const e=this.popToPseudo();return 0===e.length?this.push(this.newRegexp(Bc.Op.EMPTY_MATCH)):this.push(this.collapse(e,Bc.Op.CONCAT))}alternate(){const e=this.popToPseudo();return e.length>0&&this.cleanAlt(e[e.length-1]),0===e.length?this.push(this.newRegexp(Bc.Op.NO_MATCH)):this.push(this.collapse(e,Bc.Op.ALTERNATE))}cleanAlt(e){e.op===Bc.Op.CHAR_CLASS&&(e.runes=new Uc(Array.from(e.runes)).cleanClass().toArray(),2===e.runes.length&&0===e.runes[0]&&e.runes[1]===IB.MAX_RUNE?(e.runes=new Int32Array(0),e.op=Bc.Op.ANY_CHAR):4===e.runes.length&&0===e.runes[0]&&e.runes[1]===wB.CODES["\n"]-1&&e.runes[2]===wB.CODES["\n"]+1&&e.runes[3]===IB.MAX_RUNE&&(e.runes=new Int32Array(0),e.op=Bc.Op.ANY_CHAR_NOT_NL))}collapse(e,t){if(1===e.length)return e[0];let n=0;for(let s of e)n+=s.op===t?s.subs.length:1;let s=new Array(n).fill(null),r=0;for(let n of e)if(n.op===t){for(let e=0;e<n.subs.length;e++)s[r++]=n.subs[e];this.reuse(n)}else s[r++]=n;let i=this.newRegexp(t);if(i.subs=s,t===Bc.Op.ALTERNATE&&(i.subs=this.factor(i.subs),1===i.subs.length)){const e=i;i=i.subs[0],this.reuse(e)}return i}factor(t){if(t.length<2)return t;let n=0,s=t.length,r=0,i=null,a=0,o=0,B=0;for(let e=0;e<=s;e++){let c=null,l=0,u=0;if(e<s){let s=t[n+e];if(s.op===Bc.Op.CONCAT&&s.subs.length>0&&(s=s.subs[0]),s.op===Bc.Op.LITERAL&&(c=s.runes,l=s.runes.length,u=s.flags&BB.FOLD_CASE),u===o){let e=0;for(;e<a&&e<l&&i[e]===c[e];)e++;if(e>0){a=e;continue}}}if(e===B);else if(e===B+1)t[r++]=t[n+B];else{const s=this.newRegexp(Bc.Op.LITERAL);s.flags=o,s.runes=i.slice(0,a);for(let s=B;s<e;s++)t[n+s]=this.removeLeadingString(t[n+s],a),this.checkLimits(t[n+s]);const c=this.collapse(t.slice(n+B,n+e),Bc.Op.ALTERNATE),l=this.newRegexp(Bc.Op.CONCAT);l.subs=[s,c],t[r++]=l}B=e,i=c,a=l,o=u}s=r,n=0,B=0,r=0;let c=null;for(let i=0;i<=s;i++){let a=null;if(!(i<s&&(a=e.leadingRegexp(t[n+i]),null!==c&&c.equals(a)&&(e.isCharClass(c)||c.op===Bc.Op.REPEAT&&c.min===c.max&&e.isCharClass(c.subs[0]))))){if(i===B);else if(i===B+1)t[r++]=t[n+B];else{const e=c;for(let e=B;e<i;e++){const s=e!==B;t[n+e]=this.removeLeadingRegexp(t[n+e],s),this.checkLimits(t[n+e])}const s=this.collapse(t.slice(n+B,n+i),Bc.Op.ALTERNATE),a=this.newRegexp(Bc.Op.CONCAT);a.subs=[e,s],t[r++]=a}B=i,c=a}}s=r,n=0,B=0,r=0;for(let i=0;i<=s;i++)if(!(i<s&&e.isCharClass(t[n+i]))){if(i===B);else if(i===B+1)t[r++]=t[n+B];else{let s=B;for(let e=B+1;e<i;e++){const r=t[n+s],i=t[n+e];(r.op<i.op||r.op===i.op&&(null!==r.runes?r.runes.length:0)<(null!==i.runes?i.runes.length:0))&&(s=e)}const a=t[n+B];t[n+B]=t[n+s],t[n+s]=a;for(let s=B+1;s<i;s++)e.mergeCharClass(t[n+B],t[n+s]),this.reuse(t[n+s]);this.cleanAlt(t[n+B]),t[r++]=t[n+B]}i<s&&(t[r++]=t[n+i]),B=i+1}s=r,n=0,B=0,r=0;for(let e=0;e<s;++e)e+1<s&&t[n+e].op===Bc.Op.EMPTY_MATCH&&t[n+e+1].op===Bc.Op.EMPTY_MATCH||(t[r++]=t[n+e]);return s=r,n=0,t.slice(n,s)}removeLeadingString(e,t){if(e.op===Bc.Op.CONCAT&&e.subs.length>0){const n=this.removeLeadingString(e.subs[0],t);if(e.subs[0]=n,n.op===Bc.Op.EMPTY_MATCH)switch(this.reuse(n),e.subs.length){case 0:case 1:e.op=Bc.Op.EMPTY_MATCH,e.subs=Bc.emptySubs();break;case 2:{const t=e;e=e.subs[1],this.reuse(t);break}default:e.subs=e.subs.slice(1,e.subs.length)}return e}return e.op===Bc.Op.LITERAL&&(e.runes=e.runes.slice(t,e.runes.length),0===e.runes.length&&(e.op=Bc.Op.EMPTY_MATCH)),e}removeLeadingRegexp(e,t){if(e.op===Bc.Op.CONCAT&&e.subs.length>0){switch(t&&this.reuse(e.subs[0]),e.subs=e.subs.slice(1,e.subs.length),e.subs.length){case 0:e.op=Bc.Op.EMPTY_MATCH,e.subs=Bc.emptySubs();break;case 1:{const t=e;e=e.subs[0],this.reuse(t);break}}return e}return t&&this.reuse(e),this.newRegexp(Bc.Op.EMPTY_MATCH)}parseInternal(){if(0!==(this.flags&BB.LITERAL))return e.literalRegexp(this.wholeRegexp,this.flags);let t=-1,n=-1,s=-1;const r=new Hc(this.wholeRegexp);for(;r.more();){let i=-1;e:switch(r.peek()){case wB.CODES["("]:if(0!==(this.flags&BB.LOOKBEHIND)){if(r.lookingAt("(?<=")){this.parsePosLookBehind(),r.skip(4);break}if(r.lookingAt("(?<!")){this.parseNegLookBehind(),r.skip(4);break}}if(0!==(this.flags&BB.PERL_X)&&r.lookingAt("(?")){this.parsePerlFlags(r);break}this.op(Bc.Op.LEFT_PAREN).cap=++this.numCap,r.skip(1);break;case wB.CODES["|"]:this.parseVerticalBar(),r.skip(1);break;case wB.CODES[")"]:this.parseRightParen(),r.skip(1);break;case wB.CODES["^"]:0!==(this.flags&BB.ONE_LINE)?this.op(Bc.Op.BEGIN_TEXT):this.op(Bc.Op.BEGIN_LINE),r.skip(1);break;case wB.CODES.$:0!==(this.flags&BB.ONE_LINE)?this.op(Bc.Op.END_TEXT).flags|=BB.WAS_DOLLAR:this.op(Bc.Op.END_LINE),r.skip(1);break;case wB.CODES["."]:0!==(this.flags&BB.DOT_NL)?this.op(Bc.Op.ANY_CHAR):this.op(Bc.Op.ANY_CHAR_NOT_NL),r.skip(1);break;case wB.CODES["["]:this.parseClass(r);break;case wB.CODES["*"]:case wB.CODES["+"]:case wB.CODES["?"]:{i=r.pos();let e=null;switch(r.pop()){case wB.CODES["*"]:e=Bc.Op.STAR;break;case wB.CODES["+"]:e=Bc.Op.PLUS;break;case wB.CODES["?"]:e=Bc.Op.QUEST}this.repeat(e,n,s,i,r,t);break}case wB.CODES["{"]:{const a=r.pos(),o=e.parseRepeat(r);if(o<0){r.rewindTo(a),this.literal(r.pop());break}i=a,n=o>>16,s=(o&IB.MAX_BMP)<<16>>16,this.repeat(Bc.Op.REPEAT,n,s,i,r,t);break}case wB.CODES["\\"]:{const t=r.pos();if(r.skip(1),0!==(this.flags&BB.PERL_X)&&r.more())switch(r.pop()){case wB.CODES.A:this.op(Bc.Op.BEGIN_TEXT);break e;case wB.CODES.b:this.op(Bc.Op.WORD_BOUNDARY);break e;case wB.CODES.B:this.op(Bc.Op.NO_WORD_BOUNDARY);break e;case wB.CODES.C:throw new HB(e.ERR_INVALID_ESCAPE,"\\C");case wB.CODES.Q:{let e=r.rest();const t=e.indexOf("\\E");t>=0?(e=e.substring(0,t),r.skipString(e),r.skipString("\\E")):r.skipString(e);let n=0;for(;n<e.length;){const t=e.codePointAt(n);this.literal(t),n+=SB.charCount(t)}break e}case wB.CODES.z:this.op(Bc.Op.END_TEXT);break e;default:r.rewindTo(t)}else r.rewindTo(t);const n=this.newRegexp(Bc.Op.CHAR_CLASS);if(n.flags=this.flags,r.lookingAt("\\p")||r.lookingAt("\\P")){const e=new Uc;if(this.parseUnicodeClass(r,e)){n.runes=e.toArray(),this.push(n);break e}}const s=new Uc;if(this.parsePerlClassEscape(r,s)){n.runes=s.toArray(),this.push(n);break e}r.rewindTo(t),this.reuse(n),this.literal(e.parseEscape(r));break}default:this.literal(r.pop())}t=i}if(this.concat(),this.swapVerticalBar()&&this.pop(),this.alternate(),1!==this.stack.length)throw new HB(e.ERR_MISSING_PAREN,this.wholeRegexp);return this.stack[0].namedGroups=this.namedGroups,this.stack[0]}parsePerlFlags(t){const n=t.pos(),s=t.rest();if(s.startsWith("(?P<")||s.startsWith("(?<")){const n="P"===s.charAt(2)?4:3,r=s.indexOf(">");if(r<0)throw new HB(e.ERR_INVALID_NAMED_CAPTURE,s);const i=s.substring(n,r);if(t.skipString(i),t.skip(n+1),!e.isValidCaptureName(i))throw new HB(e.ERR_INVALID_NAMED_CAPTURE,s.substring(0,r+1));const a=this.op(Bc.Op.LEFT_PAREN);if(a.cap=++this.numCap,this.namedGroups[i])throw new HB(e.ERR_DUPLICATE_NAMED_CAPTURE,i);return this.namedGroups[i]=this.numCap,void(a.name=i)}t.skip(2);let r=this.flags,i=1,a=!1;e:for(;t.more();){const e=t.pop();switch(e){case wB.CODES.i:r|=BB.FOLD_CASE,a=!0;break;case wB.CODES.m:r&=-17,a=!0;break;case wB.CODES.s:r|=BB.DOT_NL,a=!0;break;case wB.CODES.U:r|=BB.NON_GREEDY,a=!0;break;case wB.CODES["-"]:if(i<0)break e;i=-1,r=~r,a=!1;break;case wB.CODES[":"]:case wB.CODES[")"]:if(i<0){if(!a)break e;r=~r}return e===wB.CODES[":"]&&this.op(Bc.Op.LEFT_PAREN),void(this.flags=r);default:break e}}throw new HB(e.ERR_INVALID_PERL_OP,t.from(n))}parsePosLookBehind(){const e=this.newRegexp(Bc.Op.LEFT_PAREN);return e.flags=this.flags,e.lb=++this.nlb,this.push(e)}parseNegLookBehind(){const e=this.newRegexp(Bc.Op.LEFT_PAREN);return e.flags=this.flags,e.lb=-++this.nlb,this.push(e)}parseVerticalBar(){this.concat(),this.swapVerticalBar()||this.op(Bc.Op.VERTICAL_BAR)}swapVerticalBar(){const t=this.stack.length;if(t>=3&&this.stack[t-2].op===Bc.Op.VERTICAL_BAR&&e.isCharClass(this.stack[t-1])&&e.isCharClass(this.stack[t-3])){let n=this.stack[t-1],s=this.stack[t-3];if(n.op>s.op){const e=s;s=n,n=e,this.stack[t-3]=s}return e.mergeCharClass(s,n),this.reuse(n),this.pop(),!0}if(t>=2){const e=this.stack[t-1],n=this.stack[t-2];if(n.op===Bc.Op.VERTICAL_BAR)return t>=3&&this.cleanAlt(this.stack[t-3]),this.stack[t-2]=e,this.stack[t-1]=n,!0}return!1}parseRightParen(){if(this.concat(),this.swapVerticalBar()&&this.pop(),this.alternate(),this.stack.length<2)throw new HB(e.ERR_UNEXPECTED_PAREN,this.wholeRegexp);const t=this.pop(),n=this.pop();if(n.op!==Bc.Op.LEFT_PAREN)throw new HB(e.ERR_UNEXPECTED_PAREN,this.wholeRegexp);if(this.flags=n.flags,0!==n.lb){if(e.hasCapture(t))throw new HB(e.ERR_INVALID_CAPTURE_IN_LOOKBEHIND,this.wholeRegexp);return n.lb>0?n.op=Bc.Op.PLB:n.op=Bc.Op.NLB,n.subs=[t],void this.push(n)}0===n.cap?this.push(t):(n.op=Bc.Op.CAPTURE,n.subs=[t],this.push(n))}parsePerlClassEscape(e,t){const n=e.pos();if(0===(this.flags&BB.PERL_X)||!e.more()||e.pop()!==wB.CODES["\\"]||!e.more())return!1;e.pop();const s=e.from(n),r=bc.has(s)?bc.get(s):null;return null!==r&&(t.appendGroup(r,0!==(this.flags&BB.FOLD_CASE)),!0)}parseNamedClass(t,n){const s=t.rest(),r=s.indexOf(":]");if(r<0)return!1;const i=s.substring(0,r+2);t.skipString(i);const a=Gc.has(i)?Gc.get(i):null;if(null===a)throw new HB(e.ERR_INVALID_CHAR_RANGE,i);return n.appendGroup(a,0!==(this.flags&BB.FOLD_CASE)),!0}parseUnicodeClass(t,n){const s=t.pos();if(0===(this.flags&BB.UNICODE_GROUPS)||!t.lookingAt("\\p")&&!t.lookingAt("\\P"))return!1;t.skip(1);let r,i=1,a=t.pop();if(a===wB.CODES.P&&(i=-1),!t.more())throw t.rewindTo(s),new HB(e.ERR_INVALID_CHAR_RANGE,t.rest());if(a=t.pop(),a!==wB.CODES["{"])r=SB.runeToString(a);else{const n=t.rest(),i=n.indexOf("}");if(i<0)throw t.rewindTo(s),new HB(e.ERR_INVALID_CHAR_RANGE,t.rest());r=n.substring(0,i),t.skipString(r),t.skip(1)}0!==r.length&&r.codePointAt(0)===wB.CODES["^"]&&(i=0-i,r=r.substring(1));const o=e.unicodeTable(r);if(null===o)throw new HB(e.ERR_INVALID_CHAR_RANGE,t.from(s));o.sign<0&&(i=0-i);const B=o.tab,c=o.fold;if(0===(this.flags&BB.FOLD_CASE)||null===c)n.appendTableWithSign(B,i);else{const e=(new Uc).appendTable(B).appendTable(c).cleanClass().toArray();n.appendClassWithSign(Array.from(e),i)}return!0}parseClass(t){const n=t.pos();t.skip(1);const s=this.newRegexp(Bc.Op.CHAR_CLASS);s.flags=this.flags;const r=new Uc;let i=1;t.more()&&t.lookingAt("^")&&(i=-1,t.skip(1),0===(this.flags&BB.CLASS_NL)&&r.appendRange(wB.CODES["\n"],wB.CODES["\n"]));let a=!0;for(;!t.more()||t.peek()!==wB.CODES["]"]||a;){if(t.more()&&t.lookingAt("-")&&0===(this.flags&BB.PERL_X)&&!a){const s=t.rest();if("-"===s||!s.startsWith("-]"))throw t.rewindTo(n),new HB(e.ERR_INVALID_CHAR_RANGE,t.rest())}a=!1;const s=t.pos();if(t.lookingAt("[:")){if(this.parseNamedClass(t,r))continue;t.rewindTo(s)}if(this.parseUnicodeClass(t,r))continue;if(this.parsePerlClassEscape(t,r))continue;t.rewindTo(s);const i=e.parseClassChar(t,n);let o=i;if(t.more()&&t.lookingAt("-"))if(t.skip(1),t.more()&&t.lookingAt("]"))t.skip(-1);else if(o=e.parseClassChar(t,n),o<i)throw new HB(e.ERR_INVALID_CHAR_RANGE,t.from(s));0===(this.flags&BB.FOLD_CASE)?r.appendRange(i,o):r.appendFoldedRange(i,o)}t.skip(1),r.cleanClass(),i<0&&r.negateClass(),s.runes=r.toArray(),this.push(s)}},jc=class e{static initTest(t){const n=e.compile(t),s=new e(n.expr,n.prog,n.numSubexp,n.longest);return s.cond=n.cond,s.prefix=n.prefix,s.prefixUTF8=n.prefixUTF8,s.prefixComplete=n.prefixComplete,s.prefixRune=n.prefixRune,s.prefilter=n.prefilter,s.namedGroups=n.namedGroups,s}static compile(t){return e.compileImpl(t,BB.PERL,!1)}static compilePOSIX(t){return e.compileImpl(t,BB.POSIX,!0)}static compileImpl(t,n,s){let r=Vc.parse(t,n);const i=r.maxCap(),a=r.namedGroups;r=wc.simplify(r);const o=hc.build(r),B=mc.compileRegexp(r),c=new e(t,B,i,s);c.prefilter=o.type===uc.Type.NONE?null:o;const[l,u]=B.prefix();return c.prefixComplete=l,c.prefix=u,c.prefixUTF8=SB.stringToUtf8ByteArray(c.prefix),c.prefix.length>0&&(c.prefixRune=c.prefix.codePointAt(0)),c.namedGroups=a,c}static match(t,n){return e.compile(t).match(n)}constructor(e,t,n=0,s=0){this.expr=e,this.prog=t,this.numSubexp=n,this.longest=s,this.cond=t.startCond(),this.prefix=null,this.prefixUTF8=null,this.prefixComplete=!1,this.prefixRune=0,this.namedGroups=Object.create(null),this.machinePool=[],this.lazyDFA=null,this.onepass=oc.compile(this.prog),this.prefilter=null}get dfa(){return null===this.lazyDFA&&(this.lazyDFA=new tc(this.prog)),this.lazyDFA}matchPrefixComplete(e,t,n,s){if((n===BB.ANCHOR_START||n===BB.ANCHOR_BOTH)&&0!==t)return null;let r=-1,i=-1;const a=e.prefixLength(this);if(n===BB.UNANCHORED){const n=e.index(this,t);if(n<0)return null;r=t+n,i=r+a}else if(n===BB.ANCHOR_BOTH){if(e.endPos()!==a)return null;if(0!==e.index(this,0))return null;r=0,i=a}else if(n===BB.ANCHOR_START){if(0!==e.index(this,0))return null;r=0,i=a}if(r<0)return null;if(s>0){const e=new Int32Array(s).fill(-1);return e[0]=r,e[1]=i,Array.from(e)}return[]}createLookbehindState(){return this.prog.numLb>0?new QB(this.prog):null}executeEngine(e,t,n,s,r=null){if(this.prefixComplete&&(0===s||0===this.numSubexp))return this.matchPrefixComplete(e,t,n,s);if(null!==this.prefilter&&n===BB.UNANCHORED&&!this.prefilter.eval(e,t))return null;if(null!==this.onepass)return oc.execute(this,e,t,n,s);if(s>0)return 0===this.prog.numLb&&e.endPos()<=rc.maxBitStateLen(this.prog)?rc.execute(this,e,t,n,s):this.doExecuteNFA(e,t,n,s,r);if(0===this.prog.numLb){const r=this.dfa.match(e,t,n);if(null!==r)return r?[]:null;if(e.endPos()<=rc.maxBitStateLen(this.prog))return rc.execute(this,e,t,n,s)}return this.doExecuteNFA(e,t,n,s,r)}numberOfCapturingGroups(){return this.numSubexp}numberOfInstructions(){return this.prog.numInst()}get(){return this.machinePool.length>0?this.machinePool.pop():null}reset(){this.machinePool.length=0}put(e){this.machinePool.push(e)}toString(){return this.expr}doExecuteNFA(e,t,n,s,r=null){let i=this.get();i||(i=WB.fromRE2(this)),i.init(s);const a=i.match(e,t,n,r)?i.submatches():null;return this.put(i),a}match(e){return null!==this.executeEngine(GB.fromUTF16(e),0,BB.UNANCHORED,0)}matchWithGroup(e,t,n,s,r,i=null){return e instanceof RB||(e=SB.isByteArray(e)?xB.utf8(e):xB.utf16(e)),this.matchMachineInput(e,t,n,s,r,i)}matchMachineInput(e,t,n,s,r,i=null){if(t>n)return[!1,null];const a=e.isUTF16Encoding()?GB.fromUTF16(e.asCharSequence(),0,n):GB.fromUTF8(e.asBytes(),0,n),o=this.executeEngine(a,t,s,2*r,i);return null===o?[!1,null]:[!0,o]}matchUTF8(e){return null!==this.executeEngine(GB.fromUTF8(e),0,BB.UNANCHORED,0)}replaceAll(e,t){return this.replaceAllFunc(e,()=>t,2*e.length+1)}replaceFirst(e,t){return this.replaceAllFunc(e,()=>t,1)}replaceAllFunc(e,t,n){let s=0,r=0,i="";const a=GB.fromUTF16(e),o=this.createLookbehindState();let B=0;for(;r<=e.length;){const c=this.executeEngine(a,r,BB.UNANCHORED,2,o);if(null===c||0===c.length)break;i+=e.substring(s,c[0]),(c[1]>s||0===c[0])&&(i+=t(e.substring(c[0],c[1])),B++),s=c[1];const l=7&a.step(r);if(r+l>c[1]?r+=l:r+1>c[1]?r++:r=c[1],B>=n)break}return i+=e.substring(s),i}pad(e){if(null===e)return null;let t=2*(1+this.numSubexp);if(e.length<t){let n=new Array(t).fill(-1);for(let t=0;t<e.length;t++)n[t]=e[t];e=n}return e}allMatches(e,t,n=e=>e){let s=[];const r=e.endPos();t<0&&(t=r+1);let i=0,a=0,o=-1;const B=this.createLookbehindState();for(;a<t&&i<=r;){const t=this.executeEngine(e,i,BB.UNANCHORED,this.prog.numCap,B);if(null===t||0===t.length)break;let c=!0;if(t[1]===i){t[0]===o&&(c=!1);const n=e.step(i);n<0?i=r+1:i+=7&n}else i=t[1];o=t[1],c&&(s.push(n(this.pad(t))),a++)}return s}findUTF8(e){const t=this.executeEngine(GB.fromUTF8(e),0,BB.UNANCHORED,2);return null===t?null:e.slice(t[0],t[1])}findUTF8Index(e){const t=this.executeEngine(GB.fromUTF8(e),0,BB.UNANCHORED,2);return null===t?null:t.slice(0,2)}find(e){const t=this.executeEngine(GB.fromUTF16(e),0,BB.UNANCHORED,2);return null===t?"":e.substring(t[0],t[1])}findIndex(e){return this.executeEngine(GB.fromUTF16(e),0,BB.UNANCHORED,2)}findUTF8Submatch(e){const t=this.executeEngine(GB.fromUTF8(e),0,BB.UNANCHORED,this.prog.numCap);if(null===t)return null;const n=new Array(1+this.numSubexp).fill(null);for(let s=0;s<n.length;s++)2*s<t.length&&t[2*s]>=0&&(n[s]=e.slice(t[2*s],t[2*s+1]));return n}findUTF8SubmatchIndex(e){return this.pad(this.executeEngine(GB.fromUTF8(e),0,BB.UNANCHORED,this.prog.numCap))}findSubmatch(e){const t=this.executeEngine(GB.fromUTF16(e),0,BB.UNANCHORED,this.prog.numCap);if(null===t)return null;const n=new Array(1+this.numSubexp).fill(null);for(let s=0;s<n.length;s++)2*s<t.length&&t[2*s]>=0&&(n[s]=e.substring(t[2*s],t[2*s+1]));return n}findSubmatchIndex(e){return this.pad(this.executeEngine(GB.fromUTF16(e),0,BB.UNANCHORED,this.prog.numCap))}findAllUTF8(e,t){const n=this.allMatches(GB.fromUTF8(e),t,t=>e.slice(t[0],t[1]));return 0===n.length?null:n}findAllUTF8Index(e,t){const n=this.allMatches(GB.fromUTF8(e),t,e=>e.slice(0,2));return 0===n.length?null:n}findAll(e,t){const n=this.allMatches(GB.fromUTF16(e),t,t=>e.substring(t[0],t[1]));return 0===n.length?null:n}findAllIndex(e,t){const n=this.allMatches(GB.fromUTF16(e),t,e=>e.slice(0,2));return 0===n.length?null:n}findAllUTF8Submatch(e,t){const n=this.allMatches(GB.fromUTF8(e),t,t=>{let n=new Array(t.length/2|0).fill(null);for(let s=0;s<n.length;s++)t[2*s]>=0&&(n[s]=e.slice(t[2*s],t[2*s+1]));return n});return 0===n.length?null:n}findAllUTF8SubmatchIndex(e,t){const n=this.allMatches(GB.fromUTF8(e),t);return 0===n.length?null:n}findAllSubmatch(e,t){const n=this.allMatches(GB.fromUTF16(e),t,t=>{let n=new Array(t.length/2|0).fill(null);for(let s=0;s<n.length;s++)t[2*s]>=0&&(n[s]=e.substring(t[2*s],t[2*s+1]));return n});return 0===n.length?null:n}findAllSubmatchIndex(e,t){const n=this.allMatches(GB.fromUTF16(e),t);return 0===n.length?null:n}},$c=class e{static isHexadecimal(e){return"0"<=e&&e<="9"||"A"<=e&&e<="F"||"a"<=e&&e<="f"}static translate(t){let n="";if(t instanceof RegExp&&(t.ignoreCase&&(n+="i"),t.multiline&&(n+="m"),t.dotAll&&(n+="s"),t=t.source),"string"!=typeof t)return t;let s="",r=!1,i=t.length;0===i&&(s="(?:)",r=!0);let a=!1,o=0;for(;o<i;){let n=t[o];if("\\"===n){if(o+1<i)switch(n=t[o+1],n){case"\\":s+="\\\\",o+=2;continue;case"c":if(o+2<i){let e=t[o+2].charCodeAt(0);if(e>=65&&e<=90||e>=97&&e<=122){let t=e%32;s+="\\x",s+=(t>>4).toString(16).toUpperCase(),s+=(15&t).toString(16).toUpperCase(),o+=3,r=!0;continue}}s+="c",o+=2,r=!0;continue;case"u":if(o+2<i)if("{"===t[o+2]){let n=o+3,a=!1,B=!1;for(;n<i;){const s=t[n];if("}"===s){B=!0;break}if(!e.isHexadecimal(s))break;a=!0,n++}if(B&&a){s+="\\x",o+=2,r=!0;continue}}else if(o+5<i){let n=!0;for(let s=0;s<4;s++)if(!e.isHexadecimal(t[o+2+s])){n=!1;break}if(n){s+="\\x{"+t.substring(o+2,o+6)+"}",o+=6,r=!0;continue}}s+="u",o+=2,r=!0;continue;case"x":{let n=!1;if(o+2<i&&"{"===t[o+2]){let s=o+3,r=!1,a=!1;for(;s<i;){const n=t[s];if("}"===n){a=!0;break}if(!e.isHexadecimal(n))break;r=!0,s++}a&&r&&(n=!0)}else o+3<i&&e.isHexadecimal(t[o+2])&&e.isHexadecimal(t[o+3])&&(n=!0);n?(s+="\\x",o+=2):(s+="x",o+=2,r=!0);continue}case"n":case"r":case"t":case"a":case"f":case"v":case"d":case"D":case"s":case"S":case"w":case"W":case"b":case"B":case"p":case"P":case"A":case"z":case"Q":case"E":case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":s+="\\"+n,o+=2;continue;default:{let e=t.codePointAt(o+1);if(e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122){let n=SB.charCount(e);s+=t.substring(o+1,o+1+n),o+=n+1,r=!0}else{s+="\\";let n=SB.charCount(e);s+=t.substring(o+1,o+1+n),o+=n+1}continue}}}else{if("/"===n){s+="\\/",o+=1,r=!0;continue}if("["===n){if(!a&&"]"===t[o+1]){s+="[^\\x00-\\x{10FFFF}]",o+=2,r=!0;continue}if(!a&&"^"===t[o+1]&&"]"===t[o+2]){s+="[\\x00-\\x{10FFFF}]",o+=3,r=!0;continue}a=!0}else if("]"===n)a=!1;else if(!a&&"("===n&&o+2<i&&"?"===t[o+1]&&"<"===t[o+2]&&o+3<i&&!"=!>)".includes(t[o+3])){s+="(?P<",o+=3,r=!0;continue}}let B=t.codePointAt(o),c=SB.charCount(B);s+=t.substring(o,o+c),o+=c}const B=r?s:t;return n.length>0?`(?${n})${B}`:B}};const Jc=(e,t)=>{const n=e.matchArray();return n.index=e.start(0),n.input=t,n.groups=e.namedGroupsObject(),n};var qc=class e{static CASE_INSENSITIVE=cB;static DOTALL=lB;static MULTILINE=uB;static DISABLE_UNICODE_GROUPS=hB;static LONGEST_MATCH=pB;static LOOKBEHINDS=dB;static quote(e){return SB.quoteMeta(e)}static quoteReplacement(e,t=!1){return qB.quoteReplacement(e,t)}static translateRegExp(e){return $c.translate(e)}static compile(t,n=0){let s=t;if(0!==(n&e.CASE_INSENSITIVE)&&(s=`(?i)${s}`),0!==(n&e.DOTALL)&&(s=`(?s)${s}`),0!==(n&e.MULTILINE)&&(s=`(?m)${s}`),-544&n)throw new $B("Flags should only be a combination of MULTILINE, DOTALL, CASE_INSENSITIVE, DISABLE_UNICODE_GROUPS, LONGEST_MATCH, LOOKBEHINDS");let r=BB.PERL;0!==(n&e.DISABLE_UNICODE_GROUPS)&&(r&=-129),0!==(n&e.LOOKBEHINDS)&&(r|=BB.LOOKBEHIND);const i=new e(t,n);return i.re2Input=jc.compileImpl(s,r,0!==(n&e.LONGEST_MATCH)),i}static matches(t,n){return e.compile(t).testExact(n)}static initTest(t,n,s){if(null==t)throw new Error("pattern is null");if(null==s)throw new Error("re2 is null");const r=new e(t,n);return r.re2Input=s,r}constructor(e,t){this.patternInput=e,this.flagsInput=t,this.re2Input=null}reset(){this.re2Input.reset()}flags(){return this.flagsInput}pattern(){return this.patternInput}re2(){return this.re2Input}matches(e){return this.testExact(e)}matcher(e){return SB.isByteArray(e)&&(e=xB.utf8(e)),new qB(this,e)}test(e){return SB.isByteArray(e)?this.re2Input.matchUTF8(e):this.re2Input.match(e)}testExact(e){const t=SB.isByteArray(e)?GB.fromUTF8(e):GB.fromUTF16(e);return null!==this.re2Input.executeEngine(t,0,BB.ANCHOR_BOTH,0)}exec(e){const t=this.matcher(e);return t.find()?Jc(t,e):null}split(e,t=0){const n=this.matcher(e),s=[];let r=0,i=0;for(;n.find();)if(0!==i||0!==n.end()){if(t>0&&s.length===t-1)break;if(i===n.start()){if(0===t){r+=1,i=n.end();continue}}else for(;r>0;)s.push(""),r-=1;s.push(n.substring(i,n.start())),i=n.end()}else i=n.end();if(0===t&&i!==n.inputLength()){for(;r>0;)s.push(""),r-=1;s.push(n.substring(i,n.inputLength()))}return 0===t&&(0!==s.length||i===n.inputLength()&&i>0)||s.push(n.substring(i,n.inputLength())),s}*matchAll(e){const t=this.matcher(e);for(;t.find();)yield Jc(t,e)}toString(){return this.patternInput}programSize(){return this.re2Input.numberOfInstructions()}groupCount(){return this.re2Input.numberOfCapturingGroups()}namedGroups(){return this.re2Input.namedGroups}equals(e){return this===e||null!==e&&this.constructor===e.constructor&&(this.flagsInput===e.flagsInput&&this.patternInput===e.patternInput)}};let zc="12.19.0";const Kc=new us("@firebase/firestore");function Qc(){return Kc.logLevel}function Wc(e,...t){if(Kc.logLevel<=as.DEBUG){const n=t.map(Zc);Kc.debug(`Firestore (${zc}): ${e}`,...n)}}function Yc(e,...t){if(Kc.logLevel<=as.ERROR){const n=t.map(Zc);Kc.error(`Firestore (${zc}): ${e}`,...n)}}function Xc(e,...t){if(Kc.logLevel<=as.WARN){const n=t.map(Zc);Kc.warn(`Firestore (${zc}): ${e}`,...n)}}function Zc(e){if("string"==typeof e)return e;try{return function(e){return JSON.stringify(e)}(e)}catch(t){return e}}function el(e,t,n){let s="Unexpected state";"string"==typeof t?s=t:n=t,tl(e,s,n)}function tl(e,t,n){let s=`FIRESTORE (${zc}) INTERNAL ASSERTION FAILED: ${t} (ID: ${e.toString(16)})`;if(void 0!==n)try{s+=" CONTEXT: "+JSON.stringify(n)}catch(e){s+=" CONTEXT: "+n}throw Yc(s),new Error(s)}function nl(e,t,n,s){let r="Unexpected state";"string"==typeof n?r=n:s=n,e||tl(t,r,s)}function sl(e,t){return e}function rl(e){const t="undefined"!=typeof self&&(self.crypto||self.msCrypto),n=new Uint8Array(e);if(t&&"function"==typeof t.getRandomValues)t.getRandomValues(n);else for(let t=0;t<e;t++)n[t]=Math.floor(256*Math.random());return n}class il{static newId(){const e=62*Math.floor(256/62);let t="";for(;t.length<20;){const n=rl(40);for(let s=0;s<n.length;++s)t.length<20&&n[s]<e&&(t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(n[s]%62))}return t}}function al(e,t){return e<t?-1:e>t?1:0}function ol(e,t){const n=Math.min(e.length,t.length);for(let s=0;s<n;s++){const n=e.charAt(s),r=t.charAt(s);if(n!==r)return ll(n)===ll(r)?al(n,r):ll(n)?1:-1}return al(e.length,t.length)}const Bl=55296,cl=57343;function ll(e){const t=e.charCodeAt(0);return t>=Bl&&t<=cl}function ul(e,t,n){return e.length===t.length&&e.every((e,s)=>n(e,t[s]))}class hl{constructor(e,t){this.comparator=e,this.root=t||dl.EMPTY}insert(e,t){return new hl(this.comparator,this.root.insert(e,t,this.comparator).copy(null,null,dl.BLACK,null,null))}remove(e){return new hl(this.comparator,this.root.remove(e,this.comparator).copy(null,null,dl.BLACK,null,null))}get(e){let t=this.root;for(;!t.isEmpty();){const n=this.comparator(e,t.key);if(0===n)return t.value;n<0?t=t.left:n>0&&(t=t.right)}return null}indexOf(e){let t=0,n=this.root;for(;!n.isEmpty();){const s=this.comparator(e,n.key);if(0===s)return t+n.left.size;s<0?n=n.left:(t+=n.left.size+1,n=n.right)}return-1}isEmpty(){return this.root.isEmpty()}get size(){return this.root.size}minKey(){return this.root.minKey()}maxKey(){return this.root.maxKey()}inorderTraversal(e){return this.root.inorderTraversal(e)}forEach(e){this.inorderTraversal((t,n)=>(e(t,n),!1))}toString(){const e=[];return this.inorderTraversal((t,n)=>(e.push(`${t}:${n}`),!1)),`{${e.join(", ")}}`}reverseTraversal(e){return this.root.reverseTraversal(e)}getIterator(){return new pl(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new pl(this.root,e,this.comparator,!1)}getReverseIterator(){return new pl(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new pl(this.root,e,this.comparator,!0)}}class pl{constructor(e,t,n,s){this.isReverse=s,this.nodeStack=[];let r=1;for(;!e.isEmpty();)if(r=t?n(e.key,t):1,t&&s&&(r*=-1),r<0)e=this.isReverse?e.left:e.right;else{if(0===r){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}getNext(){let e=this.nodeStack.pop();const t={key:e.key,value:e.value};if(this.isReverse)for(e=e.left;!e.isEmpty();)this.nodeStack.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack.push(e),e=e.left;return t}hasNext(){return this.nodeStack.length>0}peek(){if(0===this.nodeStack.length)return null;const e=this.nodeStack[this.nodeStack.length-1];return{key:e.key,value:e.value}}}class dl{constructor(e,t,n,s,r){this.key=e,this.value=t,this.color=null!=n?n:dl.RED,this.left=null!=s?s:dl.EMPTY,this.right=null!=r?r:dl.EMPTY,this.size=this.left.size+1+this.right.size}copy(e,t,n,s,r){return new dl(null!=e?e:this.key,null!=t?t:this.value,null!=n?n:this.color,null!=s?s:this.left,null!=r?r:this.right)}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min(){return this.left.isEmpty()?this:this.left.min()}minKey(){return this.min().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,t,n){let s=this;const r=n(e,s.key);return s=r<0?s.copy(null,null,null,s.left.insert(e,t,n),null):0===r?s.copy(null,t,null,null,null):s.copy(null,null,null,null,s.right.insert(e,t,n)),s.fixUp()}removeMin(){if(this.left.isEmpty())return dl.EMPTY;let e=this;return e.left.isRed()||e.left.left.isRed()||(e=e.moveRedLeft()),e=e.copy(null,null,null,e.left.removeMin(),null),e.fixUp()}remove(e,t){let n,s=this;if(t(e,s.key)<0)s.left.isEmpty()||s.left.isRed()||s.left.left.isRed()||(s=s.moveRedLeft()),s=s.copy(null,null,null,s.left.remove(e,t),null);else{if(s.left.isRed()&&(s=s.rotateRight()),s.right.isEmpty()||s.right.isRed()||s.right.left.isRed()||(s=s.moveRedRight()),0===t(e,s.key)){if(s.right.isEmpty())return dl.EMPTY;n=s.right.min(),s=s.copy(n.key,n.value,null,null,s.right.removeMin())}s=s.copy(null,null,null,null,s.right.remove(e,t))}return s.fixUp()}isRed(){return this.color}fixUp(){let e=this;return e.right.isRed()&&!e.left.isRed()&&(e=e.rotateLeft()),e.left.isRed()&&e.left.left.isRed()&&(e=e.rotateRight()),e.left.isRed()&&e.right.isRed()&&(e=e.colorFlip()),e}moveRedLeft(){let e=this.colorFlip();return e.right.left.isRed()&&(e=e.copy(null,null,null,null,e.right.rotateRight()),e=e.rotateLeft(),e=e.colorFlip()),e}moveRedRight(){let e=this.colorFlip();return e.left.left.isRed()&&(e=e.rotateRight(),e=e.colorFlip()),e}rotateLeft(){const e=this.copy(null,null,dl.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight(){const e=this.copy(null,null,dl.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip(){const e=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,t)}checkMaxDepth(){const e=this.check();return Math.pow(2,e)<=this.size+1}check(){if(this.isRed()&&this.left.isRed())throw el(43730,{key:this.key,value:this.value});if(this.right.isRed())throw el(14113,{key:this.key,value:this.value});const e=this.left.check();if(e!==this.right.check())throw el(27949);return e+(this.isRed()?0:1)}}dl.EMPTY=null,dl.RED=!0,dl.BLACK=!1,dl.EMPTY=new class{constructor(){this.size=0}get key(){throw el(57766)}get value(){throw el(16141)}get color(){throw el(16727)}get left(){throw el(29726)}get right(){throw el(36894)}copy(e,t,n,s,r){return this}insert(e,t,n){return new dl(e,t)}remove(e,t){return this}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}};class fl{constructor(e){this.comparator=e,this.data=new hl(this.comparator)}has(e){return null!==this.data.get(e)}first(){return this.data.minKey()}last(){return this.data.maxKey()}get size(){return this.data.size}indexOf(e){return this.data.indexOf(e)}forEach(e){this.data.inorderTraversal((t,n)=>(e(t),!1))}forEachInRange(e,t){const n=this.data.getIteratorFrom(e[0]);for(;n.hasNext();){const s=n.getNext();if(this.comparator(s.key,e[1])>=0)return;t(s.key)}}forEachWhile(e,t){let n;for(n=void 0!==t?this.data.getIteratorFrom(t):this.data.getIterator();n.hasNext();)if(!e(n.getNext().key))return}firstAfterOrEqual(e){const t=this.data.getIteratorFrom(e);return t.hasNext()?t.getNext().key:null}getIterator(){return new Cl(this.data.getIterator())}getIteratorFrom(e){return new Cl(this.data.getIteratorFrom(e))}add(e){return this.copy(this.data.remove(e).insert(e,!0))}delete(e){return this.has(e)?this.copy(this.data.remove(e)):this}isEmpty(){return this.data.isEmpty()}unionWith(e){let t=this;return t.size<e.size&&(t=e,e=this),e.forEach(e=>{t=t.add(e)}),t}isEqual(e){if(!(e instanceof fl))return!1;if(this.size!==e.size)return!1;const t=this.data.getIterator(),n=e.data.getIterator();for(;t.hasNext();){const e=t.getNext().key,s=n.getNext().key;if(0!==this.comparator(e,s))return!1}return!0}toArray(){const e=[];return this.forEach(t=>{e.push(t)}),e}toString(){const e=[];return this.forEach(t=>e.push(t)),"SortedSet("+e.toString()+")"}copy(e){const t=new fl(this.comparator);return t.data=e,t}}class Cl{constructor(e){this.iter=e}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}}const gl={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 ml extends jn{constructor(e,t){super(e,t),this.code=e,this.message=t,this.toString=()=>`${this.name}: [code=${this.code}]: ${this.message}`}}const wl="__name__";class El{constructor(e,t,n){void 0===t?t=0:t>e.length&&el(637,{offset:t,range:e.length}),void 0===n?n=e.length-t:n>e.length-t&&el(1746,{length:n,range:e.length-t}),this.segments=e,this.offset=t,this.len=n}get length(){return this.len}isEqual(e){return 0===El.comparator(this,e)}child(e){const t=this.segments.slice(this.offset,this.limit());return e instanceof El?e.forEach(e=>{t.push(e)}):t.push(e),this.construct(t)}limit(){return this.offset+this.length}popFirst(e){return e=void 0===e?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 0===this.length}isPrefixOf(e){if(e.length<this.length)return!1;for(let t=0;t<this.length;t++)if(this.get(t)!==e.get(t))return!1;return!0}isImmediateParentOf(e){if(this.length+1!==e.length)return!1;for(let t=0;t<this.length;t++)if(this.get(t)!==e.get(t))return!1;return!0}forEach(e){for(let t=this.offset,n=this.limit();t<n;t++)e(this.segments[t])}toArray(){return this.segments.slice(this.offset,this.limit())}static comparator(e,t){const n=Math.min(e.length,t.length);for(let s=0;s<n;s++){const n=El.compareSegments(e.get(s),t.get(s));if(0!==n)return n}return al(e.length,t.length)}static compareSegments(e,t){const n=El.isNumericId(e),s=El.isNumericId(t);return n&&!s?-1:!n&&s?1:n&&s?El.extractNumericId(e).compare(El.extractNumericId(t)):ol(e,t)}static isNumericId(e){return e.startsWith("__id")&&e.endsWith("__")}static extractNumericId(e){return Yo.fromString(e.substring(4,e.length-2))}}class yl extends El{construct(e,t,n){return new yl(e,t,n)}canonicalString(){return this.toArray().join("/")}toString(){return this.canonicalString()}toStringWithLeadingSlash(){return`/${this.canonicalString()}`}toUriEncodedString(){return this.toArray().map(encodeURIComponent).join("/")}static fromString(...e){const t=[];for(const n of e){if(n.indexOf("//")>=0)throw new ml(gl.INVALID_ARGUMENT,`Invalid segment (${n}). Paths must not contain // in them.`);t.push(...n.split("/").filter(e=>e.length>0))}return new yl(t)}static emptyPath(){return new yl([])}}const Dl=/^[_a-zA-Z][_a-zA-Z0-9]*$/;let _l=class e extends El{construct(t,n,s){return new e(t,n,s)}static isValidIdentifier(e){return Dl.test(e)}canonicalString(){return this.toArray().map(t=>(t=t.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),e.isValidIdentifier(t)||(t="`"+t+"`"),t)).join(".")}toString(){return this.canonicalString()}isKeyField(){return 1===this.length&&this.get(0)===wl}static keyField(){return new e([wl])}static fromServerFormat(t){const n=[];let s="",r=0;const i=()=>{if(0===s.length)throw new ml(gl.INVALID_ARGUMENT,`Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);n.push(s),s=""};let a=!1;for(;r<t.length;){const e=t[r];if("\\"===e){if(r+1===t.length)throw new ml(gl.INVALID_ARGUMENT,"Path has trailing escape character: "+t);const e=t[r+1];if("\\"!==e&&"."!==e&&"`"!==e)throw new ml(gl.INVALID_ARGUMENT,"Path has invalid escape sequence: "+t);s+=e,r+=2}else"`"===e?(a=!a,r++):"."!==e||a?(s+=e,r++):(i(),r++)}if(i(),a)throw new ml(gl.INVALID_ARGUMENT,"Unterminated ` in path: "+t);return new e(n)}static emptyPath(){return new e([])}};class bl{constructor(e){this.fields=e,e.sort(_l.comparator)}static empty(){return new bl([])}unionWith(e){let t=new fl(_l.comparator);for(const e of this.fields)t=t.add(e);for(const n of e)t=t.add(n);return new bl(t.toArray())}covers(e){for(const t of this.fields)if(t.isPrefixOf(e))return!0;return!1}isEqual(e){return ul(this.fields,e.fields,(e,t)=>e.isEqual(t))}}function vl(e){let t=0;for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}function Il(e,t){for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t(n,e[n])}function Tl(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}class Al{constructor(e){this.path=e}static fromPath(e){return new Al(yl.fromString(e))}static fromName(e){return new Al(yl.fromString(e).popFirst(5))}static empty(){return new Al(yl.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 null!==e&&0===yl.comparator(this.path,e.path)}toString(){return this.path.toString()}static comparator(e,t){return yl.comparator(e.path,t.path)}static isDocumentKey(e){return e.length%2==0}static fromSegments(e){return new Al(new yl(e.slice()))}}function Ol(e){if(!Al.isDocumentKey(e))throw new ml(gl.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${e} has ${e.length}.`)}function Sl(e){return"object"==typeof e&&null!==e&&(Object.getPrototypeOf(e)===Object.prototype||null===Object.getPrototypeOf(e))}function Nl(e){if(void 0===e)return"undefined";if(null===e)return"null";if("string"==typeof e)return e.length>20&&(e=`${e.substring(0,20)}...`),JSON.stringify(e);if("number"==typeof e||"boolean"==typeof e)return""+e;if("object"==typeof e){if(e instanceof Array)return"an array";{const t=function(e){return e.constructor?e.constructor.name:null}(e);return t?`a custom ${t} object`:"an object"}}return"function"==typeof e?"a function":el(12329,{type:typeof e})}function Rl(e,t){if("_delegate"in e&&(e=e._delegate),!(e instanceof t)){if(t.name===e.constructor.name)throw new ml(gl.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const n=Nl(e);throw new ml(gl.INVALID_ARGUMENT,`Expected type '${t.name}', but it was: ${n}`)}}return e}function kl(e,t){const n={typeString:e};return t&&(n.value=t),n}function Ll(e,t){if(!Sl(e))throw new ml(gl.INVALID_ARGUMENT,"JSON must be an object");let n;for(const s in t)if(t[s]){const r=t[s].typeString,i="value"in t[s]?{value:t[s].value}:void 0;if(!(s in e)){n=`JSON missing required field: '${s}'`;break}const a=e[s];if(r&&typeof a!==r){n=`JSON field '${s}' must be a ${r}.`;break}if(void 0!==i&&a!==i.value){n=`Expected '${s}' field to equal '${i.value}'`;break}}if(n)throw new ml(gl.INVALID_ARGUMENT,n);return!0}const xl=-62135596800,Fl=1e6;class Pl{static now(){return Pl.fromMillis(Date.now())}static fromDate(e){return Pl.fromMillis(e.getTime())}static fromMillis(e){const t=Math.floor(e/1e3),n=Math.floor((e-1e3*t)*Fl);return new Pl(t,n)}static fromInstant(e){if(!e||"bigint"!=typeof e.t)throw new ml(gl.INVALID_ARGUMENT,"Invalid Temporal.Instant object provided.");return Pl._fromEpochNanoseconds(e.t)}static _fromEpochNanoseconds(e){let t,n;if(e>=0n)t=Number(e/1000000000n),n=Number(e%1000000000n);else{const s=e%1000000000n;0n===s?(t=Number(e/1000000000n),n=0):(t=Number(e/1000000000n-1n),n=Number(s+1000000000n))}return new Pl(t,n)}constructor(e,t){if(this.seconds=e,this.nanoseconds=t,t<0)throw new ml(gl.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(t>=1e9)throw new ml(gl.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(e<xl)throw new ml(gl.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e);if(e>=253402300800)throw new ml(gl.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/Fl}toInstant(){if("undefined"==typeof Temporal||!Temporal.Instant)throw new ml(gl.FAILED_PRECONDITION,"The Temporal object is not available in the current environment.");const e=1000000000n*BigInt(this.seconds)+BigInt(this.nanoseconds);return Temporal.Instant.__PRIVATE_fromEpochNanoseconds(e)}_compareTo(e){return this.seconds===e.seconds?al(this.nanoseconds,e.nanoseconds):al(this.seconds,e.seconds)}isEqual(e){return e.seconds===this.seconds&&e.nanoseconds===this.nanoseconds}toString(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"}toJSON(){return{type:Pl._jsonSchemaVersion,seconds:this.seconds,nanoseconds:this.nanoseconds}}static fromJSON(e){if(Ll(e,Pl._jsonSchema))return new Pl(e.seconds,e.nanoseconds)}valueOf(){const e=this.seconds-xl;return String(e).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}}Pl._jsonSchemaVersion="firestore/timestamp/1.0",Pl._jsonSchema={type:kl("string",Pl._jsonSchemaVersion),seconds:kl("number"),nanoseconds:kl("number")};class Ml extends Error{constructor(){super(...arguments),this.name="Base64DecodeError"}}class Gl{constructor(e){this.binaryString=e}static fromBase64String(e){const t=function(e){try{return atob(e)}catch(e){throw"undefined"!=typeof DOMException&&e instanceof DOMException?new Ml("Invalid base64 string: "+e):e}}(e);return new Gl(t)}static fromUint8Array(e){const t=function(e){let t="";for(let n=0;n<e.length;++n)t+=String.fromCharCode(e[n]);return t}(e);return new Gl(t)}[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(e){return btoa(e)}(this.binaryString)}toUint8Array(){return function(e){const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}(this.binaryString)}approximateByteSize(){return 2*this.binaryString.length}compareTo(e){return al(this.binaryString,e.binaryString)}isEqual(e){return this.binaryString===e.binaryString}}Gl.EMPTY_BYTE_STRING=new Gl("");const Ul=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function Hl(e){if(nl(!!e,39018),"string"==typeof e){let t=0;const n=Ul.exec(e);if(nl(!!n,46558,{timestamp:e}),n[1]){let e=n[1];e=(e+"000000000").substr(0,9),t=Number(e)}const s=new Date(e);return{seconds:Math.floor(s.getTime()/1e3),nanos:t}}return{seconds:Vl(e.seconds),nanos:Vl(e.nanos)}}function Vl(e){return"number"==typeof e?e:"string"==typeof e?Number(e):0}function jl(e){return"string"==typeof e?Gl.fromBase64String(e):Gl.fromUint8Array(e)}const $l="server_timestamp",Jl="__type__",ql="__previous_value__",zl="__local_write_time__";function Kl(e){const t=(e?.mapValue?.fields||{})[Jl]?.stringValue;return t===$l}function Ql(e){const t=e.mapValue.fields[ql];return Kl(t)?Ql(t):t}function Wl(e){const t=Hl(e.mapValue.fields[zl].timestampValue);return new Pl(t.seconds,t.nanos)}class Yl{constructor(e,t,n,s,r,i,a,o,B,c,l,u,h){this.databaseId=e,this.appId=t,this.persistenceKey=n,this.host=s,this.ssl=r,this.forceLongPolling=i,this.autoDetectLongPolling=a,this.longPollingOptions=o,this.useFetchStreams=B,this.isUsingEmulator=c,this.apiKey=l,this._customHeaders=u,this.grpcFlowControlWindow=h}}const Xl="(default)";class Zl{constructor(e,t){this.projectId=e,this.database=t||Xl}static empty(){return new Zl("","")}get isDefaultDatabase(){return this.database===Xl}isEqual(e){return e instanceof Zl&&e.projectId===this.projectId&&e.database===this.database}}function eu(e,t){if(!Object.prototype.hasOwnProperty.apply(e.options,["projectId"]))throw new ml(gl.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new Zl(e.options.projectId,t)}function tu(e){return null==e}function nu(e){return 0===e&&1/e==-1/0}const su="__type__",ru="__max__",iu={},au="__vector__",ou="value",Bu={nullValue:"NULL_VALUE"},cu={booleanValue:!0},lu={booleanValue:!1};function uu(e){return"nullValue"in e?0:"booleanValue"in e?1:"integerValue"in e||"doubleValue"in e?2:"timestampValue"in e?3:"stringValue"in e?5:"bytesValue"in e?6:"referenceValue"in e?7:"geoPointValue"in e?8:"arrayValue"in e?9:"mapValue"in e?Kl(e)?4:function(e){return(((e.mapValue||{}).fields||{}).__type__||{}).stringValue===ru}(e)?9007199254740991:Tu(e)?10:11:el(28295,{value:e})}function hu(e,t,n){if(e===t)return!0;const s=uu(e);if(s!==uu(t))return!1;switch(s){case 0:case 9007199254740991:return!0;case 1:return e.booleanValue===t.booleanValue;case 4:return Wl(e).isEqual(Wl(t));case 3:return function(e,t){if("string"==typeof e.timestampValue&&"string"==typeof t.timestampValue&&e.timestampValue.length===t.timestampValue.length)return e.timestampValue===t.timestampValue;const n=Hl(e.timestampValue),s=Hl(t.timestampValue);return n.seconds===s.seconds&&n.nanos===s.nanos}(e,t);case 5:return e.stringValue===t.stringValue;case 6:return function(e,t){return jl(e.bytesValue).isEqual(jl(t.bytesValue))}(e,t);case 7:return e.referenceValue===t.referenceValue;case 8:return function(e,t){return Vl(e.geoPointValue.latitude)===Vl(t.geoPointValue.latitude)&&Vl(e.geoPointValue.longitude)===Vl(t.geoPointValue.longitude)}(e,t);case 2:return function(e,t,n){if("integerValue"in e&&"integerValue"in t)return Vl(e.integerValue)===Vl(t.integerValue);let s,r;if("doubleValue"in e&&"doubleValue"in t)s=Vl(e.doubleValue),r=Vl(t.doubleValue);else{if(!n?.i)return!1;s=Vl(e.integerValue??e.doubleValue),r=Vl(t.integerValue??t.doubleValue)}return s===r?!!n?.o||nu(s)===nu(r):!(void 0!==n&&!n.u)&&isNaN(s)&&isNaN(r)}(e,t,n);case 9:return ul(e.arrayValue.values||[],t.arrayValue.values||[],(e,t)=>hu(e,t,n));case 10:case 11:return function(e,t,n){const s=e.mapValue.fields||{},r=t.mapValue.fields||{};if(vl(s)!==vl(r))return!1;for(const e in s)if(s.hasOwnProperty(e)&&(void 0===r[e]||!hu(s[e],r[e],n)))return!1;return!0}(e,t,n);default:return el(52216,{left:e})}}function pu(e,t){return void 0!==(e.values||[]).find(e=>hu(e,t))}function du(e,t){if(e===t)return 0;const n=uu(e),s=uu(t);if(n!==s)return al(n,s);switch(n){case 0:case 9007199254740991:return 0;case 1:return al(e.booleanValue,t.booleanValue);case 2:return function(e,t){const n=Vl(e.integerValue||e.doubleValue),s=Vl(t.integerValue||t.doubleValue);return n<s?-1:n>s?1:n===s?0:isNaN(n)?isNaN(s)?0:-1:1}(e,t);case 3:return fu(e.timestampValue,t.timestampValue);case 4:return fu(Wl(e),Wl(t));case 5:return ol(e.stringValue,t.stringValue);case 6:return function(e,t){const n=jl(e),s=jl(t);return n.compareTo(s)}(e.bytesValue,t.bytesValue);case 7:return function(e,t){const n=e.split("/"),s=t.split("/");for(let e=0;e<n.length&&e<s.length;e++){const t=al(n[e],s[e]);if(0!==t)return t}return al(n.length,s.length)}(e.referenceValue,t.referenceValue);case 8:return function(e,t){const n=al(Vl(e.latitude),Vl(t.latitude));return 0!==n?n:al(Vl(e.longitude),Vl(t.longitude))}(e.geoPointValue,t.geoPointValue);case 9:return Cu(e.arrayValue,t.arrayValue);case 10:return function(e,t){const n=e.fields||{},s=t.fields||{},r=n[ou]?.arrayValue,i=s[ou]?.arrayValue,a=al(r?.values?.length||0,i?.values?.length||0);return 0!==a?a:Cu(r,i)}(e.mapValue,t.mapValue);case 11:return function(e,t){if(e===iu&&t===iu)return 0;if(e===iu)return 1;if(t===iu)return-1;const n=e.fields||{},s=Object.keys(n),r=t.fields||{},i=Object.keys(r);s.sort(),i.sort();for(let e=0;e<s.length&&e<i.length;++e){const t=ol(s[e],i[e]);if(0!==t)return t;const a=du(n[s[e]],r[i[e]]);if(0!==a)return a}return al(s.length,i.length)}(e.mapValue,t.mapValue);default:throw el(23264,{l:n})}}function fu(e,t){if("string"==typeof e&&"string"==typeof t&&e.length===t.length)return al(e,t);const n=Hl(e),s=Hl(t),r=al(n.seconds,s.seconds);return 0!==r?r:al(n.nanos,s.nanos)}function Cu(e,t){const n=e.values||[],s=t.values||[];for(let e=0;e<n.length&&e<s.length;++e){const t=du(n[e],s[e]);if(void 0!==t&&0!==t)return t}return al(n.length,s.length)}function gu(e){return mu(e)}function mu(e){return"nullValue"in e?"null":"booleanValue"in e?""+e.booleanValue:"integerValue"in e?""+e.integerValue:"doubleValue"in e?""+e.doubleValue:"timestampValue"in e?function(e){const t=Hl(e);return`time(${t.seconds},${t.nanos})`}(e.timestampValue):"stringValue"in e?e.stringValue:"bytesValue"in e?function(e){return jl(e).toBase64()}(e.bytesValue):"referenceValue"in e?function(e){return Al.fromName(e).toString()}(e.referenceValue):"geoPointValue"in e?function(e){return`geo(${e.latitude},${e.longitude})`}(e.geoPointValue):"arrayValue"in e?function(e){let t="[",n=!0;for(const s of e.values||[])n?n=!1:t+=",",t+=mu(s);return t+"]"}(e.arrayValue):"mapValue"in e?function(e){const t=Object.keys(e.fields||{}).sort();let n="{",s=!0;for(const r of t)s?s=!1:n+=",",n+=`${r}:${mu(e.fields[r])}`;return n+"}"}(e.mapValue):el(61005,{value:e})}function wu(e){switch(uu(e)){case 0:case 1:return 4;case 2:return 8;case 3:case 8:return 16;case 4:const t=Ql(e);return t?16+wu(t):16;case 5:return 2*e.stringValue.length;case 6:return jl(e.bytesValue).approximateByteSize();case 7:return e.referenceValue.length;case 9:return function(e){return(e.values||[]).reduce((e,t)=>e+wu(t),0)}(e.arrayValue);case 10:case 11:return function(e){let t=0;return Il(e.fields,(e,n)=>{t+=e.length+wu(n)}),t}(e.mapValue);default:throw el(13486,{value:e})}}function Eu(e){return!!e&&"integerValue"in e}function yu(e){return!!e&&"doubleValue"in e}function Du(e){return Eu(e)||yu(e)}function _u(e){return!!e&&"arrayValue"in e}function bu(e){return!!e&&"nullValue"in e}function vu(e){return!!e&&"doubleValue"in e&&isNaN(Number(e.doubleValue))}function Iu(e){return!!e&&"mapValue"in e}function Tu(e){const t=(e?.mapValue?.fields||{})[su]?.stringValue;return t===au}function Au(e){return(e?.mapValue?.fields||{})[ou]?.arrayValue}function Ou(e){if(e.geoPointValue)return{geoPointValue:{...e.geoPointValue}};if(e.timestampValue&&"object"==typeof e.timestampValue)return{timestampValue:{...e.timestampValue}};if(e.mapValue){const t={mapValue:{fields:{}}};return Il(e.mapValue.fields,(e,n)=>t.mapValue.fields[e]=Ou(n)),t}if(e.arrayValue){const t={arrayValue:{values:[]}};for(let n=0;n<(e.arrayValue.values||[]).length;++n)t.arrayValue.values[n]=Ou(e.arrayValue.values[n]);return t}return{...e}}class Su{constructor(e){this.value=e}static empty(){return new Su({mapValue:{}})}field(e){if(e.isEmpty())return this.value;{let t=this.value;for(let n=0;n<e.length-1;++n)if(t=(t.mapValue.fields||{})[e.get(n)],!Iu(t))return null;return t=(t.mapValue.fields||{})[e.lastSegment()],t||null}}set(e,t){this.getFieldsMap(e.popLast())[e.lastSegment()]=Ou(t)}setAll(e){let t=_l.emptyPath(),n={},s=[];e.forEach((e,r)=>{if(!t.isImmediateParentOf(r)){const e=this.getFieldsMap(t);this.applyChanges(e,n,s),n={},s=[],t=r.popLast()}e?n[r.lastSegment()]=Ou(e):s.push(r.lastSegment())});const r=this.getFieldsMap(t);this.applyChanges(r,n,s)}delete(e){const t=this.field(e.popLast());Iu(t)&&t.mapValue.fields&&delete t.mapValue.fields[e.lastSegment()]}isEqual(e){return hu(this.value,e.value)}getFieldsMap(e){let t=this.value;t.mapValue.fields||(t.mapValue={fields:{}});for(let n=0;n<e.length;++n){let s=t.mapValue.fields[e.get(n)];Iu(s)&&s.mapValue.fields||(s={mapValue:{fields:{}}},t.mapValue.fields[e.get(n)]=s),t=s}return t.mapValue.fields}applyChanges(e,t,n){Il(t,(t,n)=>e[t]=n);for(const t of n)delete e[t]}clone(){return new Su(Ou(this.value))}}function Nu(e){const t=[];return Il(e.fields,(e,n)=>{const s=new _l([e]);if(Iu(n)){const e=Nu(n.mapValue).fields;if(0===e.length)t.push(s);else for(const n of e)t.push(s.child(n))}else t.push(s)}),new bl(t)}function Ru(e,t){if(e.useProto3Json){if(isNaN(t))return{doubleValue:"NaN"};if(t===1/0)return{doubleValue:"Infinity"};if(t===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:nu(t)?"-0":t}}function ku(e){return{integerValue:""+e}}function Lu(e,t,n){return function(e){return"number"==typeof e&&Number.isInteger(e)&&!nu(e)&&e<=Number.MAX_SAFE_INTEGER&&e>=Number.MIN_SAFE_INTEGER}(t)?ku(t):Ru(e,t)}class xu{constructor(){this._=void 0}}function Fu(e,t,n){return e instanceof Gu?function(e,t){const n={fields:{[Jl]:{stringValue:$l},[zl]:{timestampValue:{seconds:e.seconds,nanos:e.nanoseconds}}}};return t&&Kl(t)&&(t=Ql(t)),t&&(n.fields[ql]=t),{mapValue:n}}(n,t):e instanceof Uu?Hu(e,t):e instanceof Vu?ju(e,t):e instanceof Ju?function(e,t){const n=Mu(e,t),s=Qu(n)+Qu(e.h);return Eu(n)&&Eu(e.h)?ku(s):Ru(e.serializer,s)}(e,t):e instanceof qu?function(e,t){return Ku(e,t,Math.min)}(e,t):e instanceof zu?function(e,t){return Ku(e,t,Math.max)}(e,t):void 0}function Pu(e,t,n){return e instanceof Uu?Hu(e,t):e instanceof Vu?ju(e,t):n}function Mu(e,t){return e instanceof Ju?Du(t)?t:{integerValue:0}:null}class Gu extends xu{}class Uu extends xu{constructor(e){super(),this.elements=e}}function Hu(e,t){const n=Wu(t);for(const t of e.elements)n.some(e=>hu(e,t))||n.push(t);return{arrayValue:{values:n}}}class Vu extends xu{constructor(e){super(),this.elements=e}}function ju(e,t){let n=Wu(t);for(const t of e.elements)n=n.filter(e=>!hu(e,t));return{arrayValue:{values:n}}}class $u extends xu{constructor(e,t){super(),this.serializer=e,this.h=t}}class Ju extends $u{}class qu extends $u{}class zu extends $u{}function Ku(e,t,n){if(!Du(t))return e.h;const s=n(Qu(t),Qu(e.h));return Eu(t)&&Eu(e.h)?ku(s):Ru(e.serializer,s)}function Qu(e){return Vl(e.integerValue||e.doubleValue)}function Wu(e){return _u(e)&&e.arrayValue.values?e.arrayValue.values.slice():[]}class Yu{constructor(e,t){this.version=e,this.transformResults=t}}class Xu{constructor(e,t){this.updateTime=e,this.exists=t}static none(){return new Xu}static exists(e){return new Xu(void 0,e)}static updateTime(e){return new Xu(e)}get isNone(){return void 0===this.updateTime&&void 0===this.exists}isEqual(e){return this.exists===e.exists&&(this.updateTime?!!e.updateTime&&this.updateTime.isEqual(e.updateTime):!e.updateTime)}}function Zu(e,t){return void 0!==e.updateTime?t.isFoundDocument()&&t.version.isEqual(e.updateTime):void 0===e.exists||e.exists===t.isFoundDocument()}class eh{}function th(e,t){if(!e.hasLocalMutations||t&&0===t.fields.length)return null;if(null===t)return e.isNoDocument()?new uh(e.key,Xu.none()):new ah(e.key,e.data,Xu.none());{const n=e.data,s=Su.empty();let r=new fl(_l.comparator);for(let e of t.fields)if(!r.has(e)){let t=n.field(e);null===t&&e.length>1&&(e=e.popLast(),t=n.field(e)),null===t?s.delete(e):s.set(e,t),r=r.add(e)}return new oh(e.key,s,new bl(r.toArray()),Xu.none())}}function nh(e,t,n){e instanceof ah?function(e,t,n){const s=e.value.clone(),r=ch(e.fieldTransforms,t,n.transformResults);s.setAll(r),t.convertToFoundDocument(n.version,s).setHasCommittedMutations()}(e,t,n):e instanceof oh?function(e,t,n){if(!Zu(e.precondition,t))return void t.convertToUnknownDocument(n.version);const s=ch(e.fieldTransforms,t,n.transformResults),r=t.data;r.setAll(Bh(e)),r.setAll(s),t.convertToFoundDocument(n.version,r).setHasCommittedMutations()}(e,t,n):function(e,t,n){t.convertToNoDocument(n.version).setHasCommittedMutations()}(0,t,n)}function sh(e,t,n,s){return e instanceof ah?function(e,t,n,s){if(!Zu(e.precondition,t))return n;const r=e.value.clone(),i=lh(e.fieldTransforms,s,t);return r.setAll(i),t.convertToFoundDocument(t.version,r).setHasLocalMutations(),null}(e,t,n,s):e instanceof oh?function(e,t,n,s){if(!Zu(e.precondition,t))return n;const r=lh(e.fieldTransforms,s,t),i=t.data;return i.setAll(Bh(e)),i.setAll(r),t.convertToFoundDocument(t.version,i).setHasLocalMutations(),null===n?null:n.unionWith(e.fieldMask.fields).unionWith(e.fieldTransforms.map(e=>e.field))}(e,t,n,s):function(e,t,n){return Zu(e.precondition,t)?(t.convertToNoDocument(t.version).setHasLocalMutations(),null):n}(e,t,n)}function rh(e,t){let n=null;for(const s of e.fieldTransforms){const e=t.data.field(s.field),r=Mu(s.transform,e||null);null!=r&&(null===n&&(n=Su.empty()),n.set(s.field,r))}return n||null}function ih(e,t){return e.type===t.type&&!!e.key.isEqual(t.key)&&!!e.precondition.isEqual(t.precondition)&&!!function(e,t){return void 0===e&&void 0===t||!(!e||!t)&&ul(e,t,(e,t)=>function(e,t){return e.field.isEqual(t.field)&&function(e,t){return e instanceof Uu&&t instanceof Uu||e instanceof Vu&&t instanceof Vu?ul(e.elements,t.elements,hu):e instanceof Ju&&t instanceof Ju||e instanceof qu&&t instanceof qu||e instanceof zu&&t instanceof zu?hu(e.h,t.h):e instanceof Gu&&t instanceof Gu}(e.transform,t.transform)}(e,t))}(e.fieldTransforms,t.fieldTransforms)&&(0===e.type?e.value.isEqual(t.value):1!==e.type||e.data.isEqual(t.data)&&e.fieldMask.isEqual(t.fieldMask))}class ah extends eh{constructor(e,t,n,s=[]){super(),this.key=e,this.value=t,this.precondition=n,this.fieldTransforms=s,this.type=0}getFieldMask(){return null}}class oh extends eh{constructor(e,t,n,s,r=[]){super(),this.key=e,this.data=t,this.fieldMask=n,this.precondition=s,this.fieldTransforms=r,this.type=1}getFieldMask(){return this.fieldMask}}function Bh(e){const t=new Map;return e.fieldMask.fields.forEach(n=>{if(!n.isEmpty()){const s=e.data.field(n);t.set(n,s)}}),t}function ch(e,t,n){const s=new Map;nl(e.length===n.length,32656,{T:n.length,P:e.length});for(let r=0;r<n.length;r++){const i=e[r],a=i.transform,o=t.data.field(i.field);s.set(i.field,Pu(a,o,n[r]))}return s}function lh(e,t,n){const s=new Map;for(const r of e){const e=r.transform,i=n.data.field(r.field);s.set(r.field,Fu(e,i,t))}return s}class uh extends eh{constructor(e,t){super(),this.key=e,this.precondition=t,this.type=2,this.fieldTransforms=[]}getFieldMask(){return null}}class hh extends eh{constructor(e,t){super(),this.key=e,this.precondition=t,this.type=3,this.fieldTransforms=[]}getFieldMask(){return null}}class ph{constructor(e,t){this.position=e,this.inclusive=t}}function dh(e,t,n){let s=0;for(let r=0;r<e.position.length;r++){const i=t[r],a=e.position[r];if(s=i.field.isKeyField()?Al.comparator(Al.fromName(a.referenceValue),n.key):du(a,n.data.field(i.field)),"desc"===i.dir&&(s*=-1),0!==s)break}return s}function fh(e,t){if(null===e)return null===t;if(null===t)return!1;if(e.inclusive!==t.inclusive||e.position.length!==t.position.length)return!1;for(let n=0;n<e.position.length;n++)if(!hu(e.position[n],t.position[n]))return!1;return!0}class Ch{}class gh extends Ch{constructor(e,t,n){super(),this.field=e,this.op=t,this.value=n}static create(e,t,n){return e.isKeyField()?"in"===t||"not-in"===t?this.createKeyFieldInFilter(e,t,n):new bh(e,t,n):"array-contains"===t?new Ah(e,n):"in"===t?new Oh(e,n):"not-in"===t?new Sh(e,n):"array-contains-any"===t?new Nh(e,n):new gh(e,t,n)}static createKeyFieldInFilter(e,t,n){return"in"===t?new vh(e,n):new Ih(e,n)}matches(e){const t=e.data.field(this.field);return"!="===this.op?null!==t&&void 0===t.nullValue&&this.matchesComparison(du(t,this.value)):null!==t&&uu(this.value)===uu(t)&&this.matchesComparison(du(t,this.value))}matchesComparison(e){switch(this.op){case"<":return e<0;case"<=":return e<=0;case"==":return 0===e;case"!=":return 0!==e;case">":return e>0;case">=":return e>=0;default:return el(47266,{operator:this.op})}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}}class mh extends Ch{constructor(e,t){super(),this.filters=e,this.op=t,this.I=null}static create(e,t){return new mh(e,t)}matches(e){return wh(this)?void 0===this.filters.find(t=>!t.matches(e)):void 0!==this.filters.find(t=>t.matches(e))}getFlattenedFilters(){return null!==this.I||(this.I=this.filters.reduce((e,t)=>e.concat(t.getFlattenedFilters()),[])),this.I}getFilters(){return Object.assign([],this.filters)}}function wh(e){return"and"===e.op}function Eh(e){return function(e){for(const t of e.filters)if(t instanceof mh)return!1;return!0}(e)&&wh(e)}function yh(e){if(e instanceof gh)return e.field.canonicalString()+e.op.toString()+gu(e.value);if(Eh(e))return e.filters.map(e=>yh(e)).join(",");{const t=e.filters.map(e=>yh(e)).join(",");return`${e.op}(${t})`}}function Dh(e,t){return e instanceof gh?function(e,t){return t instanceof gh&&e.op===t.op&&e.field.isEqual(t.field)&&hu(e.value,t.value)}(e,t):e instanceof mh?function(e,t){return t instanceof mh&&e.op===t.op&&e.filters.length===t.filters.length&&e.filters.reduce((e,n,s)=>e&&Dh(n,t.filters[s]),!0)}(e,t):void el(19439)}function _h(e){return e instanceof gh?function(e){return`${e.field.canonicalString()} ${e.op} ${gu(e.value)}`}(e):e instanceof mh?function(e){return e.op.toString()+" {"+e.getFilters().map(_h).join(" ,")+"}"}(e):"Filter"}class bh extends gh{constructor(e,t,n){super(e,t,n),this.key=Al.fromName(n.referenceValue)}matches(e){const t=Al.comparator(e.key,this.key);return this.matchesComparison(t)}}class vh extends gh{constructor(e,t){super(e,"in",t),this.keys=Th("in",t)}matches(e){return this.keys.some(t=>t.isEqual(e.key))}}class Ih extends gh{constructor(e,t){super(e,"not-in",t),this.keys=Th("not-in",t)}matches(e){return!this.keys.some(t=>t.isEqual(e.key))}}function Th(e,t){return(t.arrayValue?.values||[]).map(e=>Al.fromName(e.referenceValue))}class Ah extends gh{constructor(e,t){super(e,"array-contains",t)}matches(e){const t=e.data.field(this.field);return _u(t)&&pu(t.arrayValue,this.value)}}class Oh extends gh{constructor(e,t){super(e,"in",t)}matches(e){const t=e.data.field(this.field);return null!==t&&pu(this.value.arrayValue,t)}}class Sh extends gh{constructor(e,t){super(e,"not-in",t)}matches(e){if(pu(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const t=e.data.field(this.field);return null!==t&&void 0===t.nullValue&&!pu(this.value.arrayValue,t)}}class Nh extends gh{constructor(e,t){super(e,"array-contains-any",t)}matches(e){const t=e.data.field(this.field);return!(!_u(t)||!t.arrayValue.values)&&t.arrayValue.values.some(e=>pu(this.value.arrayValue,e))}}class Rh{constructor(e,t="asc"){this.field=e,this.dir=t}}function kh(e,t){return e.dir===t.dir&&e.field.isEqual(t.field)}class Lh{static fromTimestamp(e){return new Lh(e)}static min(){return new Lh(new Pl(0,0))}static max(){return new Lh(new Pl(253402300799,999999999))}constructor(e){this.timestamp=e}compareTo(e){return this.timestamp._compareTo(e.timestamp)}isEqual(e){return this.timestamp.isEqual(e.timestamp)}toMicroseconds(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3}toString(){return"SnapshotVersion("+this.timestamp.toString()+")"}toTimestamp(){return this.timestamp}}class xh{constructor(e,t,n,s,r,i,a){this.key=e,this.documentType=t,this.version=n,this.readTime=s,this.createTime=r,this.data=i,this.documentState=a}static newInvalidDocument(e){return new xh(e,0,Lh.min(),Lh.min(),Lh.min(),Su.empty(),0)}static newFoundDocument(e,t,n,s){return new xh(e,1,t,Lh.min(),n,s,0)}static newNoDocument(e,t){return new xh(e,2,t,Lh.min(),Lh.min(),Su.empty(),0)}static newUnknownDocument(e,t){return new xh(e,3,t,Lh.min(),Lh.min(),Su.empty(),2)}convertToFoundDocument(e,t){return!this.createTime.isEqual(Lh.min())||2!==this.documentType&&0!==this.documentType||(this.createTime=e),this.version=e,this.documentType=1,this.data=t,this.documentState=0,this}convertToNoDocument(e){return this.version=e,this.documentType=2,this.data=Su.empty(),this.documentState=0,this}convertToUnknownDocument(e){return this.version=e,this.documentType=3,this.data=Su.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this.version=Lh.min(),this}setReadTime(e){return this.readTime=e,this}get hasLocalMutations(){return 1===this.documentState}get hasCommittedMutations(){return 2===this.documentState}get hasPendingWrites(){return this.hasLocalMutations||this.hasCommittedMutations}isValidDocument(){return 0!==this.documentType}isFoundDocument(){return 1===this.documentType}isNoDocument(){return 2===this.documentType}isUnknownDocument(){return 3===this.documentType}isEqual(e){return e instanceof xh&&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 xh(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}})`}}function Fh(e){return new Ph(e.readTime,e.key,-1)}class Ph{constructor(e,t,n){this.readTime=e,this.documentKey=t,this.largestBatchId=n}static min(){return new Ph(Lh.min(),Al.empty(),-1)}static max(){return new Ph(Lh.max(),Al.empty(),-1)}}function Mh(e,t){let n=e.readTime.compareTo(t.readTime);return 0!==n?n:(n=Al.comparator(e.documentKey,t.documentKey),0!==n?n:al(e.largestBatchId,t.largestBatchId))}class Gh{constructor(e,t=null,n=[],s=[],r=null,i=null,a=null){this.path=e,this.collectionGroup=t,this.orderBy=n,this.filters=s,this.limit=r,this.startAt=i,this.endAt=a,this.R=null}}function Uh(e,t=null,n=[],s=[],r=null,i=null,a=null){return new Gh(e,t,n,s,r,i,a)}function Hh(e){const t=sl(e);if(null===t.R){let e=t.path.canonicalString();null!==t.collectionGroup&&(e+="|cg:"+t.collectionGroup),e+="|f:",e+=t.filters.map(e=>yh(e)).join(","),e+="|ob:",e+=t.orderBy.map(e=>function(e){return e.field.canonicalString()+e.dir}(e)).join(","),tu(t.limit)||(e+="|l:",e+=t.limit),t.startAt&&(e+="|lb:",e+=t.startAt.inclusive?"b:":"a:",e+=t.startAt.position.map(e=>gu(e)).join(",")),t.endAt&&(e+="|ub:",e+=t.endAt.inclusive?"a:":"b:",e+=t.endAt.position.map(e=>gu(e)).join(",")),t.R=e}return t.R}function Vh(e,t){if(e.limit!==t.limit)return!1;if(e.orderBy.length!==t.orderBy.length)return!1;for(let n=0;n<e.orderBy.length;n++)if(!kh(e.orderBy[n],t.orderBy[n]))return!1;if(e.filters.length!==t.filters.length)return!1;for(let n=0;n<e.filters.length;n++)if(!Dh(e.filters[n],t.filters[n]))return!1;return e.collectionGroup===t.collectionGroup&&!!e.path.isEqual(t.path)&&!!fh(e.startAt,t.startAt)&&fh(e.endAt,t.endAt)}class jh{constructor(e,t=null,n=[],s=[],r=null,i="F",a=null,o=null){this.path=e,this.collectionGroup=t,this.explicitOrderBy=n,this.filters=s,this.limit=r,this.limitType=i,this.startAt=a,this.endAt=o,this.A=null,this.V=null,this.m=null,this.startAt,this.endAt}}function $h(e){return 0===e.filters.length&&null===e.limit&&null==e.startAt&&null==e.endAt&&(0===e.explicitOrderBy.length||1===e.explicitOrderBy.length&&e.explicitOrderBy[0].field.isKeyField())}function Jh(e){const t=sl(e);if(null===t.A){t.A=[];const e=new Set;for(const n of t.explicitOrderBy)t.A.push(n),e.add(n.field.canonicalString());const n=t.explicitOrderBy.length>0?t.explicitOrderBy[t.explicitOrderBy.length-1].dir:"asc",s=function(e){let t=new fl(_l.comparator);return e.filters.forEach(e=>{e.getFlattenedFilters().forEach(e=>{e.isInequality()&&(t=t.add(e.field))})}),t}(t);s.forEach(s=>{e.has(s.canonicalString())||s.isKeyField()||t.A.push(new Rh(s,n))}),e.has(_l.keyField().canonicalString())||t.A.push(new Rh(_l.keyField(),n))}return t.A}function qh(e){const t=sl(e);return t.V||(t.V=function(e,t){if("F"===e.limitType)return Uh(e.path,e.collectionGroup,t,e.filters,e.limit,e.startAt,e.endAt);{t=t.map(e=>{const t="desc"===e.dir?"asc":"desc";return new Rh(e.field,t)});const n=e.endAt?new ph(e.endAt.position,e.endAt.inclusive):null,s=e.startAt?new ph(e.startAt.position,e.startAt.inclusive):null;return Uh(e.path,e.collectionGroup,t,e.filters,e.limit,n,s)}}(t,Jh(e))),t.V}function zh(e,t,n){return new jh(e.path,e.collectionGroup,e.explicitOrderBy.slice(),e.filters.slice(),t,n,e.startAt,e.endAt)}function Kh(e){return`Query(target=${function(e){let t=e.path.canonicalString();return null!==e.collectionGroup&&(t+=" collectionGroup="+e.collectionGroup),e.filters.length>0&&(t+=`, filters: [${e.filters.map(e=>_h(e)).join(", ")}]`),tu(e.limit)||(t+=", limit: "+e.limit),e.orderBy.length>0&&(t+=`, orderBy: [${e.orderBy.map(e=>function(e){return`${e.field.canonicalString()} (${e.dir})`}(e)).join(", ")}]`),e.startAt&&(t+=", startAt: ",t+=e.startAt.inclusive?"b:":"a:",t+=e.startAt.position.map(e=>gu(e)).join(",")),e.endAt&&(t+=", endAt: ",t+=e.endAt.inclusive?"a:":"b:",t+=e.endAt.position.map(e=>gu(e)).join(",")),`Target(${t})`}(qh(e))}; limitType=${e.limitType})`}function Qh(e,t){return t.isFoundDocument()&&function(e,t){const n=t.key.path;return null!==e.collectionGroup?t.key.hasCollectionId(e.collectionGroup)&&e.path.isPrefixOf(n):Al.isDocumentKey(e.path)?e.path.isEqual(n):e.path.isImmediateParentOf(n)}(e,t)&&function(e,t){for(const n of Jh(e))if(!n.field.isKeyField()&&null===t.data.field(n.field))return!1;return!0}(e,t)&&function(e,t){for(const n of e.filters)if(!n.matches(t))return!1;return!0}(e,t)&&function(e,t){return!(e.startAt&&!function(e,t,n){const s=dh(e,t,n);return e.inclusive?s<=0:s<0}(e.startAt,Jh(e),t))&&!(e.endAt&&!function(e,t,n){const s=dh(e,t,n);return e.inclusive?s>=0:s>0}(e.endAt,Jh(e),t))}(e,t)}function Wh(e){return(t,n)=>{let s=!1;for(const r of Jh(e)){const e=Yh(r,t,n);if(0!==e)return e;s=s||r.field.isKeyField()}return 0}}function Yh(e,t,n){const s=e.field.isKeyField()?Al.comparator(t.key,n.key):function(e,t,n){const s=t.data.field(e),r=n.data.field(e);return null!==s&&null!==r?du(s,r):el(42886)}(e.field,t,n);switch(e.dir){case"asc":return s;case"desc":return-1*s;default:return el(19790,{direction:e.dir})}}var Xh,Zh;function ep(e){if(void 0===e)return Yc("GRPC error has no .code"),gl.UNKNOWN;switch(e){case Xh.OK:return gl.OK;case Xh.CANCELLED:return gl.CANCELLED;case Xh.UNKNOWN:return gl.UNKNOWN;case Xh.DEADLINE_EXCEEDED:return gl.DEADLINE_EXCEEDED;case Xh.RESOURCE_EXHAUSTED:return gl.RESOURCE_EXHAUSTED;case Xh.INTERNAL:return gl.INTERNAL;case Xh.UNAVAILABLE:return gl.UNAVAILABLE;case Xh.UNAUTHENTICATED:return gl.UNAUTHENTICATED;case Xh.INVALID_ARGUMENT:return gl.INVALID_ARGUMENT;case Xh.NOT_FOUND:return gl.NOT_FOUND;case Xh.ALREADY_EXISTS:return gl.ALREADY_EXISTS;case Xh.PERMISSION_DENIED:return gl.PERMISSION_DENIED;case Xh.FAILED_PRECONDITION:return gl.FAILED_PRECONDITION;case Xh.ABORTED:return gl.ABORTED;case Xh.OUT_OF_RANGE:return gl.OUT_OF_RANGE;case Xh.UNIMPLEMENTED:return gl.UNIMPLEMENTED;case Xh.DATA_LOSS:return gl.DATA_LOSS;default:return el(39323,{code:e})}}(Zh=Xh||(Xh={}))[Zh.OK=0]="OK",Zh[Zh.CANCELLED=1]="CANCELLED",Zh[Zh.UNKNOWN=2]="UNKNOWN",Zh[Zh.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",Zh[Zh.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",Zh[Zh.NOT_FOUND=5]="NOT_FOUND",Zh[Zh.ALREADY_EXISTS=6]="ALREADY_EXISTS",Zh[Zh.PERMISSION_DENIED=7]="PERMISSION_DENIED",Zh[Zh.UNAUTHENTICATED=16]="UNAUTHENTICATED",Zh[Zh.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",Zh[Zh.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",Zh[Zh.ABORTED=10]="ABORTED",Zh[Zh.OUT_OF_RANGE=11]="OUT_OF_RANGE",Zh[Zh.UNIMPLEMENTED=12]="UNIMPLEMENTED",Zh[Zh.INTERNAL=13]="INTERNAL",Zh[Zh.UNAVAILABLE=14]="UNAVAILABLE",Zh[Zh.DATA_LOSS=15]="DATA_LOSS";class tp{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.innerSize=0}get(e){const t=this.mapKeyFn(e),n=this.inner[t];if(void 0!==n)for(const[t,s]of n)if(this.equalsFn(t,e))return s}has(e){return void 0!==this.get(e)}set(e,t){const n=this.mapKeyFn(e),s=this.inner[n];if(void 0===s)return this.inner[n]=[[e,t]],void this.innerSize++;for(let n=0;n<s.length;n++)if(this.equalsFn(s[n][0],e))return void(s[n]=[e,t]);s.push([e,t]),this.innerSize++}delete(e){const t=this.mapKeyFn(e),n=this.inner[t];if(void 0===n)return!1;for(let s=0;s<n.length;s++)if(this.equalsFn(n[s][0],e))return 1===n.length?delete this.inner[t]:n.splice(s,1),this.innerSize--,!0;return!1}forEach(e){Il(this.inner,(t,n)=>{for(const[t,s]of n)e(t,s)})}isEmpty(){return Tl(this.inner)}size(){return this.innerSize}}const np=new hl(Al.comparator);function sp(){return np}const rp=new hl(Al.comparator);function ip(...e){let t=rp;for(const n of e)t=t.insert(n.key,n);return t}function ap(e){let t=rp;return e.forEach((e,n)=>t=t.insert(e,n.overlayedDocument)),t}function op(){return cp()}function Bp(){return cp()}function cp(){return new tp(e=>e.toString(),(e,t)=>e.isEqual(t))}const lp=new hl(Al.comparator),up=new fl(Al.comparator);function hp(...e){let t=up;for(const n of e)t=t.add(n);return t}const pp=new fl(al);new Yo([4294967295,4294967295],0);class dp{constructor(e,t){this.databaseId=e,this.useProto3Json=t}}function fp(e,t){return e.useProto3Json?`${new Date(1e3*t.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+t.nanoseconds).slice(-9)}Z`:{seconds:""+t.seconds,nanos:t.nanoseconds}}function Cp(e){const t=Hl(e);return new Pl(t.seconds,t.nanos)}function gp(e,t){return e.useProto3Json?t.toBase64():t.toUint8Array()}function mp(e,t){return fp(e,t.toTimestamp())}function wp(e){return nl(!!e,49232),Lh.fromTimestamp(Cp(e))}function Ep(e,t){return yp(e,t).canonicalString()}function yp(e,t){const n=function(e){return new yl(["projects",e.projectId,"databases",e.database])}(e).child("documents");return void 0===t?n:n.child(t)}function Dp(e,t){return Ep(e.databaseId,t.path)}function _p(e){const t=function(e){const t=yl.fromString(e);return nl(function(e){return e.length>=4&&"projects"===e.get(0)&&"databases"===e.get(2)}(t),10190,{key:t.toString()}),t}(e);return 4===t.length?yl.emptyPath():function(e){return nl(e.length>4&&"documents"===e.get(4),29091,{key:e.toString()}),e.popFirst(5)}(t)}function bp(e,t,n){return{name:Dp(e,t),fields:n.value.mapValue.fields}}function vp(e){let t=_p(e.parent);const n=e.structuredQuery,s=n.from?n.from.length:0;let r=null;if(s>0){nl(1===s,65062);const e=n.from[0];e.allDescendants?r=e.collectionId:t=t.child(e.collectionId)}let i=[];n.where&&(i=function(e){const t=Ip(e);return t instanceof mh&&Eh(t)?t.getFilters():[t]}(n.where));let a=[];n.orderBy&&(a=function(e){return e.map(e=>function(e){return new Rh(Tp(e.field),function(e){switch(e){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(e.direction))}(e))}(n.orderBy));let o=null;n.limit&&(o=function(e){let t;return t="object"==typeof e?e.value:e,tu(t)?null:t}(n.limit));let B=null;n.startAt&&(B=function(e){const t=!!e.before,n=e.values||[];return new ph(n,t)}(n.startAt));let c=null;return n.endAt&&(c=function(e){const t=!e.before,n=e.values||[];return new ph(n,t)}(n.endAt)),function(e,t,n,s,r,i,a,o){return new jh(e,t,n,s,r,i,a,o)}(t,r,a,i,o,"F",B,c)}function Ip(e){return void 0!==e.unaryFilter?function(e){switch(e.unaryFilter.op){case"IS_NAN":const t=Tp(e.unaryFilter.field);return gh.create(t,"==",{doubleValue:NaN});case"IS_NULL":const n=Tp(e.unaryFilter.field);return gh.create(n,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":const s=Tp(e.unaryFilter.field);return gh.create(s,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const r=Tp(e.unaryFilter.field);return gh.create(r,"!=",{nullValue:"NULL_VALUE"});case"OPERATOR_UNSPECIFIED":return el(61313);default:return el(60726)}}(e):void 0!==e.fieldFilter?function(e){return gh.create(Tp(e.fieldFilter.field),function(e){switch(e){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";case"OPERATOR_UNSPECIFIED":return el(58110);default:return el(50506)}}(e.fieldFilter.op),e.fieldFilter.value)}(e):void 0!==e.compositeFilter?function(e){return mh.create(e.compositeFilter.filters.map(e=>Ip(e)),function(e){switch(e){case"AND":return"and";case"OR":return"or";default:return el(1026)}}(e.compositeFilter.op))}(e):el(30097,{filter:e})}function Tp(e){return _l.fromServerFormat(e.fieldPath)}function Ap(e){const t=[];return e.fields.forEach(e=>t.push(e.canonicalString())),{fieldPaths:t}}function Op(e){return!!e&&"function"==typeof e._toProto&&"ProtoValue"===e._protoValueType}function Sp(e,t){const n={fields:{}};return t.forEach((t,s)=>{if("string"!=typeof s)throw new Error(`Cannot encode map with non-string key: ${s}`);n.fields[s]=t._toProto(e)}),{mapValue:n}}function Np(e){return{stringValue:e}}function Rp(e){return new dp(e,!0)}class kp{constructor(e){this._byteString=e}static fromBase64String(e){try{return new kp(Gl.fromBase64String(e))}catch(e){throw new ml(gl.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+e)}}static fromUint8Array(e){return new kp(Gl.fromUint8Array(e))}toBase64(){return this._byteString.toBase64()}toUint8Array(){return this._byteString.toUint8Array()}toString(){return"Bytes(base64: "+this.toBase64()+")"}isEqual(e){return this._byteString.isEqual(e._byteString)}toJSON(){return{type:kp._jsonSchemaVersion,bytes:this.toBase64()}}static fromJSON(e){if(Ll(e,kp._jsonSchema))return kp.fromBase64String(e.bytes)}}kp._jsonSchemaVersion="firestore/bytes/1.0",kp._jsonSchema={type:kl("string",kp._jsonSchemaVersion),bytes:kl("string")};class Lp{constructor(...e){for(let t=0;t<e.length;++t)if(0===e[t].length)throw new ml(gl.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new _l(e)}isEqual(e){return this._internalPath.isEqual(e._internalPath)}}class xp{constructor(e){this._methodName=e}}class Fp{constructor(e,t){if(!isFinite(e)||e<-90||e>90)throw new ml(gl.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(t)||t<-180||t>180)throw new ml(gl.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+t);this._lat=e,this._long=t}get latitude(){return this._lat}get longitude(){return this._long}isEqual(e){return this._lat===e._lat&&this._long===e._long}_compareTo(e){return al(this._lat,e._lat)||al(this._long,e._long)}toJSON(){return{latitude:this._lat,longitude:this._long,type:Fp._jsonSchemaVersion}}static fromJSON(e){if(Ll(e,Fp._jsonSchema))return new Fp(e.latitude,e.longitude)}}Fp._jsonSchemaVersion="firestore/geoPoint/1.0",Fp._jsonSchema={type:kl("string",Fp._jsonSchemaVersion),latitude:kl("number"),longitude:kl("number")};class Pp{constructor(e){this.uid=e}isAuthenticated(){return null!=this.uid}toKey(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"}isEqual(e){return e.uid===this.uid}}Pp.UNAUTHENTICATED=new Pp(null),Pp.GOOGLE_CREDENTIALS=new Pp("google-credentials-uid"),Pp.FIRST_PARTY=new Pp("first-party-uid"),Pp.MOCK_USER=new Pp("mock-user");class Mp{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}}class Gp{constructor(e,t){this.user=t,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${e}`)}}class Up{getToken(){return Promise.resolve(null)}invalidateToken(){}start(e,t){e.enqueueRetryable(()=>t(Pp.UNAUTHENTICATED))}shutdown(){}}class Hp{constructor(e){this.token=e,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(e,t){this.changeListener=t,e.enqueueRetryable(()=>t(this.token.user))}shutdown(){this.changeListener=null}}class Vp{constructor(e){this.De=e,this.currentUser=Pp.UNAUTHENTICATED,this.xe=0,this.forceRefresh=!1,this.auth=null}start(e,t){nl(void 0===this.Ce,42304);let n=this.xe;const s=e=>this.xe!==n?(n=this.xe,t(e)):Promise.resolve();let r=new Mp;this.Ce=()=>{this.xe++,this.currentUser=this.Fe(),r.resolve(),r=new Mp,e.enqueueRetryable(()=>s(this.currentUser))};const i=()=>{const t=r;e.enqueueRetryable(async()=>{await t.promise,await s(this.currentUser)})},a=e=>{Wc("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=e,this.Ce&&(this.auth.addAuthTokenListener(this.Ce),i())};this.De.onInit(e=>a(e)),setTimeout(()=>{if(!this.auth){const e=this.De.getImmediate({optional:!0});e?a(e):(Wc("FirebaseAuthCredentialsProvider","Auth not yet detected"),r.resolve(),r=new Mp)}},0),i()}getToken(){const e=this.xe,t=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(t).then(t=>this.xe!==e?(Wc("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):t?(nl("string"==typeof t.accessToken,31837,{Oe:t}),new Gp(t.accessToken,this.currentUser)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.Ce&&this.auth.removeAuthTokenListener(this.Ce),this.Ce=void 0}Fe(){const e=this.auth&&this.auth.getUid();return nl(null===e||"string"==typeof e,2055,{Me:e}),new Pp(e)}}class jp{constructor(e,t,n){this.Ne=e,this.Le=t,this.Be=n,this.type="FirstParty",this.user=Pp.FIRST_PARTY,this.Ue=new Map}ke(){return this.Be?this.Be():null}get headers(){this.Ue.set("X-Goog-AuthUser",this.Ne);const e=this.ke();return e&&this.Ue.set("Authorization",e),this.Le&&this.Ue.set("X-Goog-Iam-Authorization-Token",this.Le),this.Ue}}class $p{constructor(e,t,n){this.Ne=e,this.Le=t,this.Be=n}getToken(){return Promise.resolve(new jp(this.Ne,this.Le,this.Be))}start(e,t){e.enqueueRetryable(()=>t(Pp.FIRST_PARTY))}shutdown(){}invalidateToken(){}}class Jp{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 qp{constructor(e,t){this.qe=t,this.forceRefresh=!1,this.appCheck=null,this.$e=null,this.Ke=null,pr(e)&&e.settings.appCheckToken&&(this.Ke=e.settings.appCheckToken)}start(e,t){nl(void 0===this.Ce,3512);const n=e=>{null!=e.error&&Wc("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${e.error.message}`);const n=e.token!==this.$e;return this.$e=e.token,Wc("FirebaseAppCheckTokenProvider",`Received ${n?"new":"existing"} token.`),n?t(e.token):Promise.resolve()};this.Ce=t=>{e.enqueueRetryable(()=>n(t))};const s=e=>{Wc("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=e,this.Ce&&this.appCheck.addTokenListener(this.Ce)};this.qe.onInit(e=>s(e)),setTimeout(()=>{if(!this.appCheck){const e=this.qe.getImmediate({optional:!0});e?s(e):Wc("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}},0)}getToken(){if(this.Ke)return Promise.resolve(new Jp(this.Ke));const e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then(e=>e?(nl("string"==typeof e.token,44558,{tokenResult:e}),this.$e=e.token,new Jp(e.token)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.Ce&&this.appCheck.removeTokenListener(this.Ce),this.Ce=void 0}}function zp(e){const t={};return void 0!==e.timeoutSeconds&&(t.timeoutSeconds=e.timeoutSeconds),t}class Kp{Qe(e){}shutdown(){}}const Qp="ConnectivityMonitor";class Wp{constructor(){this.We=()=>this.Ge(),this.ze=()=>this.je(),this.He=[],this.Je()}Qe(e){this.He.push(e)}shutdown(){window.removeEventListener("online",this.We),window.removeEventListener("offline",this.ze)}Je(){window.addEventListener("online",this.We),window.addEventListener("offline",this.ze)}Ge(){Wc(Qp,"Network connectivity changed: AVAILABLE");for(const e of this.He)e(0)}je(){Wc(Qp,"Network connectivity changed: UNAVAILABLE");for(const e of this.He)e(1)}static Ye(){return"undefined"!=typeof window&&void 0!==window.addEventListener&&void 0!==window.removeEventListener}}let Yp=null;function Xp(){return null===Yp?Yp=268435456+Math.round(2147483648*Math.random()):Yp++,"0x"+Yp.toString(16)}const Zp="RestConnection",ed={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregationQuery:"runAggregationQuery",ExecutePipeline:"executePipeline"};class td{get Ze(){return!1}constructor(e){this.databaseInfo=e,this.databaseId=e.databaseId;const t=e.ssl?"https":"http",n=encodeURIComponent(this.databaseId.projectId),s=encodeURIComponent(this.databaseId.database);this.Xe=t+"://"+e.host,this.et=`projects/${n}/databases/${s}`,this.tt=this.databaseId.database===Xl?`project_id=${n}`:`project_id=${n}&database_id=${s}`}nt(e,t,n,s,r){const i=Xp(),a=this.rt(e,t.toUriEncodedString());Wc(Zp,`Sending RPC '${e}' ${i}:`,a,n);const o={"google-cloud-resource-prefix":this.et,"x-goog-request-params":this.tt};this.it(o,s,r);const{host:B}=new URL(a),c=es(B);return this.st(e,a,o,n,c).then(t=>(Wc(Zp,`Received RPC '${e}' ${i}: `,t),t),t=>{throw Xc(Zp,`RPC '${e}' ${i} failed with error: `,t,"url: ",a,"request:",n),t})}_t(e,t,n,s,r,i){return this.nt(e,t,n,s,r)}it(e,t,n){if(e["X-Goog-Api-Client"]="gl-js/ fire/"+zc,e["Content-Type"]="text/plain",this.databaseInfo.appId&&(e["X-Firebase-GMPID"]=this.databaseInfo.appId),t&&t.headers.forEach((t,n)=>e[n]=t),n&&n.headers.forEach((t,n)=>e[n]=t),this.databaseInfo._customHeaders)for(const t of Object.keys(this.databaseInfo._customHeaders))e[t]=this.databaseInfo._customHeaders[t]}rt(e,t){const n=ed[e];let s=`${this.Xe}/v1/${t}:${n}`;return this.databaseInfo.apiKey&&(s=`${s}?key=${encodeURIComponent(this.databaseInfo.apiKey)}`),s}terminate(){}}class nd{constructor(e){this.ot=e.ot,this.ut=e.ut}ct(e){this.lt=e}Et(e){this.ht=e}Tt(e){this.Pt=e}onMessage(e){this.It=e}close(){this.ut()}send(e){this.ot(e)}Rt(){this.lt()}At(){this.ht()}Vt(e){this.Pt(e)}dt(e){this.It(e)}}const sd="WebChannelConnection",rd=(e,t,n)=>{e.listen(t,e=>{try{n(e)}catch(e){setTimeout(()=>{throw e},0)}})};class id extends td{constructor(e){super(e),this.ft=[],this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams,this.longPollingOptions=e.longPollingOptions}static gt(){if(!id.yt){const e=iB();rd(e,rB.STAT_EVENT,e=>{e.stat===sB.PROXY?Wc(sd,"STAT_EVENT: detected buffering proxy"):e.stat===sB.NOPROXY&&Wc(sd,"STAT_EVENT: detected no buffering proxy")}),id.yt=!0}}st(e,t,n,s,r){const i=Xp();return new Promise((r,a)=>{const o=new Zo;o.setWithCredentials(!0),o.listenOnce(tB.COMPLETE,()=>{try{switch(o.getLastErrorCode()){case nB.NO_ERROR:const t=o.getResponseJson();Wc(sd,`XHR for RPC '${e}' ${i} received:`,JSON.stringify(t)),r(t);break;case nB.TIMEOUT:Wc(sd,`RPC '${e}' ${i} timed out`),a(new ml(gl.DEADLINE_EXCEEDED,"Request time out"));break;case nB.HTTP_ERROR:const n=o.getStatus();if(Wc(sd,`RPC '${e}' ${i} failed with status:`,n,"response text:",o.getResponseText()),n>0){let e=o.getResponseJson();Array.isArray(e)&&(e=e[0]);const t=e?.error;if(t&&t.status&&t.message){const e=function(e){const t=e.toLowerCase().replace(/_/g,"-");return Object.values(gl).indexOf(t)>=0?t:gl.UNKNOWN}(t.status);a(new ml(e,t.message))}else a(new ml(gl.UNKNOWN,"Server responded with status "+o.getStatus()))}else a(new ml(gl.UNAVAILABLE,"Connection failed."));break;default:el(9055,{wt:e,streamId:i,bt:o.getLastErrorCode(),St:o.getLastError()})}}finally{Wc(sd,`RPC '${e}' ${i} completed.`)}});const B=JSON.stringify(s);Wc(sd,`RPC '${e}' ${i} sending request:`,s),o.send(t,"POST",B,n,15)})}vt(e,t,n){const s=Xp(),r=[this.Xe,"/","google.firestore.v1.Firestore","/",e,"/channel"],i=this.createWebChannelTransport(),a={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},o=this.longPollingOptions.timeoutSeconds;void 0!==o&&(a.longPollingTimeout=Math.round(1e3*o)),this.useFetchStreams&&(a.useFetchStreams=!0),this.it(a.initMessageHeaders,t,n),a.encodeInitMessageHeaders=!0;const B=r.join("");Wc(sd,`Creating RPC '${e}' stream ${s}: ${B}`,a);const c=i.createWebChannel(B,a);this.Dt(c);let l=!1,u=!1;const h=new nd({ot:t=>{u?Wc(sd,`Not sending because RPC '${e}' stream ${s} is closed:`,t):(l||(Wc(sd,`Opening RPC '${e}' stream ${s} transport.`),c.open(),l=!0),Wc(sd,`RPC '${e}' stream ${s} sending:`,t),c.send(t))},ut:()=>c.close()});return rd(c,eB.EventType.OPEN,()=>{u||(Wc(sd,`RPC '${e}' stream ${s} transport opened.`),h.Rt())}),rd(c,eB.EventType.CLOSE,()=>{u||(u=!0,Wc(sd,`RPC '${e}' stream ${s} transport closed`),h.Vt(),this.xt(c))}),rd(c,eB.EventType.ERROR,t=>{u||(u=!0,Xc(sd,`RPC '${e}' stream ${s} transport errored. Name:`,t.name,"Message:",t.message),h.Vt(new ml(gl.UNAVAILABLE,"The operation could not be completed")))}),rd(c,eB.EventType.MESSAGE,t=>{if(!u){const n=t.data[0];nl(!!n,16349);const r=n,i=r?.error||r[0]?.error;if(i){Wc(sd,`RPC '${e}' stream ${s} received error:`,i);const t=i.status;let n=function(e){const t=Xh[e];if(void 0!==t)return ep(t)}(t),r=i.message;"NOT_FOUND"===t&&r.includes("database")&&r.includes("does not exist")&&r.includes(this.databaseId.database)&&Xc(`Database '${this.databaseId.database}' not found. Please check your project configuration.`),void 0===n&&(n=gl.INTERNAL,r="Unknown error status: "+t+" with message "+i.message),u=!0,h.Vt(new ml(n,r)),c.close()}else Wc(sd,`RPC '${e}' stream ${s} received:`,n),h.dt(n)}}),id.gt(),setTimeout(()=>{h.At()},0),h}terminate(){this.ft.forEach(e=>e.close()),this.ft=[]}Dt(e){this.ft.push(e)}xt(e){this.ft=this.ft.filter(t=>t===e)}it(e,t,n){super.it(e,t,n),this.databaseInfo.apiKey&&(e["x-goog-api-key"]=this.databaseInfo.apiKey)}createWebChannelTransport(){return aB()}}id.yt=!1;class ad{constructor(e,t,n=1e3,s=1.5,r=6e4){this.Ct=e,this.timerId=t,this.Ft=n,this.Ot=s,this.Mt=r,this.Nt=0,this.Lt=null,this.Bt=Date.now(),this.reset()}reset(){this.Nt=0}Ut(){this.Nt=this.Mt}kt(e){this.cancel();const t=Math.floor(this.Nt+this.qt()),n=Math.max(0,Date.now()-this.Bt),s=Math.max(0,t-n);s>0&&Wc("ExponentialBackoff",`Backing off for ${s} ms (base delay: ${this.Nt} ms, delay with jitter: ${t} ms, last attempt: ${n} ms ago)`),this.Lt=this.Ct.enqueueAfterDelay(this.timerId,s,()=>(this.Bt=Date.now(),e())),this.Nt*=this.Ot,this.Nt<this.Ft&&(this.Nt=this.Ft),this.Nt>this.Mt&&(this.Nt=this.Mt)}$t(){null!==this.Lt&&(this.Lt.skipDelay(),this.Lt=null)}cancel(){null!==this.Lt&&(this.Lt.cancel(),this.Lt=null)}qt(){return(Math.random()-.5)*this.Nt}}const od="PersistentStream";class Bd{constructor(e,t,n,s,r,i,a,o){this.Ct=e,this.Kt=n,this.Qt=s,this.connection=r,this.authCredentialsProvider=i,this.appCheckCredentialsProvider=a,this.listener=o,this.state=0,this.Wt=0,this.Gt=null,this.zt=null,this.stream=null,this.jt=0,this.Ht=new ad(e,t)}Jt(){return 1===this.state||5===this.state||this.Yt()}Yt(){return 2===this.state||3===this.state}start(){this.jt=0,4!==this.state?this.auth():this.Zt()}async stop(){this.Jt()&&await this.close(0)}Xt(){this.state=0,this.Ht.reset()}en(){this.Yt()&&null===this.Gt&&(this.Gt=this.Ct.enqueueAfterDelay(this.Kt,6e4,()=>this.tn()))}nn(e){this.rn(),this.stream.send(e)}async tn(){if(this.Yt())return this.close(0)}rn(){this.Gt&&(this.Gt.cancel(),this.Gt=null)}sn(){this.zt&&(this.zt.cancel(),this.zt=null)}async close(e,t){this.rn(),this.sn(),this.Ht.cancel(),this.Wt++,4!==e?this.Ht.reset():t&&t.code===gl.RESOURCE_EXHAUSTED?(Yc(t.toString()),Yc("Using maximum backoff delay to prevent overloading the backend."),this.Ht.Ut()):t&&t.code===gl.UNAUTHENTICATED&&3!==this.state&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),null!==this.stream&&(this._n(),this.stream.close(),this.stream=null),this.state=e,await this.listener.Tt(t)}_n(){}auth(){this.state=1;const e=this.an(this.Wt),t=this.Wt;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then(([e,n])=>{this.Wt===t&&this.un(e,n)},t=>{e(()=>{const e=new ml(gl.UNKNOWN,"Fetching auth token failed: "+t.message);return this.cn(e)})})}un(e,t){const n=this.an(this.Wt);this.stream=this.En(e,t),this.stream.ct(()=>{n(()=>this.listener.ct())}),this.stream.Et(()=>{n(()=>(this.state=2,this.zt=this.Ct.enqueueAfterDelay(this.Qt,1e4,()=>(this.Yt()&&(this.state=3),Promise.resolve())),this.listener.Et()))}),this.stream.Tt(e=>{n(()=>this.cn(e))}),this.stream.onMessage(e=>{n(()=>1==++this.jt?this.hn(e):this.onNext(e))})}Zt(){this.state=5,this.Ht.kt(async()=>{this.state=0,this.start()})}cn(e){return Wc(od,`close with error: ${e}`),this.stream=null,this.close(4,e)}an(e){return t=>{this.Ct.enqueueAndForget(()=>this.Wt===e?t():(Wc(od,"stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve()))}}}class cd extends Bd{constructor(e,t,n,s,r,i){super(e,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",t,n,s,i),this.serializer=r}get Rn(){return this.jt>0}start(){this.lastStreamToken=void 0,super.start()}_n(){this.Rn&&this.An([])}En(e,t){return this.connection.vt("Write",e,t)}hn(e){return nl(!!e.streamToken,31322),this.lastStreamToken=e.streamToken,nl(!e.writeResults||0===e.writeResults.length,55816),this.listener.Vn()}onNext(e){nl(!!e.streamToken,12678),this.lastStreamToken=e.streamToken,this.Ht.reset();const t=function(e,t){return e&&e.length>0?(nl(void 0!==t,14353),e.map(e=>function(e,t){let n=e.updateTime?wp(e.updateTime):wp(t);return n.isEqual(Lh.min())&&(n=wp(t)),new Yu(n,e.transformResults||[])}(e,t))):[]}(e.writeResults,e.commitTime),n=wp(e.commitTime);return this.listener.dn(n,t)}fn(){const e={};e.database=function(e){return new yl(["projects",e.databaseId.projectId,"databases",e.databaseId.database]).canonicalString()}(this.serializer),this.nn(e)}An(e){const t={streamToken:this.lastStreamToken,writes:e.map(e=>function(e,t){let n;if(t instanceof ah)n={update:bp(e,t.key,t.value)};else if(t instanceof uh)n={delete:Dp(e,t.key)};else if(t instanceof oh)n={update:bp(e,t.key,t.data),updateMask:Ap(t.fieldMask)};else{if(!(t instanceof hh))return el(16599,{be:t.type});n={verify:Dp(e,t.key)}}return t.fieldTransforms.length>0&&(n.updateTransforms=t.fieldTransforms.map(e=>function(e,t){const n=t.transform;if(n instanceof Gu)return{fieldPath:t.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(n instanceof Uu)return{fieldPath:t.field.canonicalString(),appendMissingElements:{values:n.elements}};if(n instanceof Vu)return{fieldPath:t.field.canonicalString(),removeAllFromArray:{values:n.elements}};if(n instanceof Ju)return{fieldPath:t.field.canonicalString(),increment:n.h};if(n instanceof qu)return{fieldPath:t.field.canonicalString(),minimum:n.h};if(n instanceof zu)return{fieldPath:t.field.canonicalString(),maximum:n.h};throw el(20930,{transform:t.transform})}(0,e))),t.precondition.isNone||(n.currentDocument=function(e,t){return void 0!==t.updateTime?{updateTime:mp(e,t.updateTime)}:void 0!==t.exists?{exists:t.exists}:el(27497)}(e,t.precondition)),n}(this.serializer,e))};this.nn(t)}}class ld{}class ud extends ld{constructor(e,t,n,s){super(),this.authCredentials=e,this.appCheckCredentials=t,this.connection=n,this.serializer=s,this.mn=!1}pn(){if(this.mn)throw new ml(gl.FAILED_PRECONDITION,"The client has already been terminated.")}nt(e,t,n,s){return this.pn(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([r,i])=>this.connection.nt(e,yp(t,n),s,r,i)).catch(e=>{throw"FirebaseError"===e.name?(e.code===gl.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),e):new ml(gl.UNKNOWN,e.toString())})}_t(e,t,n,s,r){return this.pn(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([i,a])=>this.connection._t(e,yp(t,n),s,i,a,r)).catch(e=>{throw"FirebaseError"===e.name?(e.code===gl.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),e):new ml(gl.UNKNOWN,e.toString())})}terminate(){this.mn=!0,this.connection.terminate()}}const hd=new Map;const pd={didRun:!1,sequenceNumbersCollected:0,targetsRemoved:0,documentsRemoved:0},dd=41943040;class fd{static withCacheSize(e){return new fd(e,fd.DEFAULT_COLLECTION_PERCENTILE,fd.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)}constructor(e,t,n){this.cacheSizeCollectionThreshold=e,this.percentileToCollect=t,this.maximumSequenceNumbersToCollect=n}}fd.DEFAULT_COLLECTION_PERCENTILE=10,fd.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,fd.DEFAULT=new fd(dd,fd.DEFAULT_COLLECTION_PERCENTILE,fd.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),fd.DISABLED=new fd(-1,0,0);class Cd{constructor(e,t){this.previousValue=e,t&&(t.sequenceNumberHandler=e=>this.gn(e),this.yn=e=>t.writeSequenceNumber(e))}gn(e){return this.previousValue=Math.max(e,this.previousValue),this.previousValue}next(){const e=++this.previousValue;return this.yn&&this.yn(e),e}}Cd.wn=-1;class gd{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(e){this.onCommittedListeners.push(e)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach(e=>e())}}async function md(e){if(e.code!==gl.FAILED_PRECONDITION||"The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab."!==e.message)throw e;Wc("LocalStore","Unexpectedly lost primary lease")}class wd{constructor(e){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e(e=>{this.isDone=!0,this.result=e,this.nextCallback&&this.nextCallback(e)},e=>{this.isDone=!0,this.error=e,this.catchCallback&&this.catchCallback(e)})}catch(e){return this.next(void 0,e)}next(e,t){return this.callbackAttached&&el(59440),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(t,this.error):this.wrapSuccess(e,this.result):new wd((n,s)=>{this.nextCallback=t=>{this.wrapSuccess(e,t).next(n,s)},this.catchCallback=e=>{this.wrapFailure(t,e).next(n,s)}})}toPromise(){return new Promise((e,t)=>{this.next(e,t)})}wrapUserFunction(e){try{const t=e();return t instanceof wd?t:wd.resolve(t)}catch(e){return wd.reject(e)}}wrapSuccess(e,t){return e?this.wrapUserFunction(()=>e(t)):wd.resolve(t)}wrapFailure(e,t){return e?this.wrapUserFunction(()=>e(t)):wd.reject(t)}static resolve(e){return new wd((t,n)=>{t(e)})}static reject(e){return new wd((t,n)=>{n(e)})}static waitFor(e){return new wd((t,n)=>{let s=0,r=0,i=!1;e.forEach(e=>{++s,e.next(()=>{++r,i&&r===s&&t()},e=>n(e))}),i=!0,r===s&&t()})}static or(e){let t=wd.resolve(!1);for(const n of e)t=t.next(e=>e?wd.resolve(e):n());return t}static forEach(e,t){const n=[];return e.forEach((e,s)=>{n.push(t.call(this,e,s))}),this.waitFor(n)}static mapArray(e,t){return new wd((n,s)=>{const r=e.length,i=new Array(r);let a=0;for(let o=0;o<r;o++){const B=o;t(e[B]).next(e=>{i[B]=e,++a,a===r&&n(i)},e=>s(e))}})}static doWhile(e,t){return new wd((n,s)=>{const r=()=>{!0===e()?t().next(()=>{r()},s):n()};r()})}}function Ed(e){return"IndexedDbTransactionError"===e.name}const yd="LruGarbageCollector";function Dd([e,t],[n,s]){const r=al(e,n);return 0===r?al(t,s):r}class _d{constructor(e){this.Yn=e,this.buffer=new fl(Dd),this.Zn=0}Xn(){return++this.Zn}er(e){const t=[e,this.Xn()];if(this.buffer.size<this.Yn)this.buffer=this.buffer.add(t);else{const e=this.buffer.last();Dd(t,e)<0&&(this.buffer=this.buffer.delete(e).add(t))}}get maxValue(){return this.buffer.last()[0]}}class bd{constructor(e,t,n){this.garbageCollector=e,this.asyncQueue=t,this.localStore=n,this.tr=null}start(){-1!==this.garbageCollector.params.cacheSizeCollectionThreshold&&this.nr(6e4)}stop(){this.tr&&(this.tr.cancel(),this.tr=null)}get started(){return null!==this.tr}nr(e){Wc(yd,`Garbage collection scheduled in ${e}ms`),this.tr=this.asyncQueue.enqueueAfterDelay("lru_garbage_collection",e,async()=>{this.tr=null;try{await this.localStore.collectGarbage(this.garbageCollector)}catch(e){Ed(e)?Wc(yd,"Ignoring IndexedDB error during garbage collection: ",e):await md(e)}await this.nr(3e5)})}}class vd{constructor(e,t){this.rr=e,this.params=t}calculateTargetCount(e,t){return this.rr.ir(e).next(e=>Math.floor(t/100*e))}nthSequenceNumber(e,t){if(0===t)return wd.resolve(Cd.wn);const n=new _d(t);return this.rr.forEachTarget(e,e=>n.er(e.sequenceNumber)).next(()=>this.rr.sr(e,e=>n.er(e))).next(()=>n.maxValue)}removeTargets(e,t,n){return this.rr.removeTargets(e,t,n)}removeOrphanedDocuments(e,t){return this.rr.removeOrphanedDocuments(e,t)}collect(e,t){return-1===this.params.cacheSizeCollectionThreshold?(Wc("LruGarbageCollector","Garbage collection skipped; disabled"),wd.resolve(pd)):this.getCacheSize(e).next(n=>n<this.params.cacheSizeCollectionThreshold?(Wc("LruGarbageCollector",`Garbage collection skipped; Cache size ${n} is lower than threshold ${this.params.cacheSizeCollectionThreshold}`),pd):this._r(e,t))}getCacheSize(e){return this.rr.getCacheSize(e)}_r(e,t){let n,s,r,i,a,o,B;const c=Date.now();return this.calculateTargetCount(e,this.params.percentileToCollect).next(t=>(t>this.params.maximumSequenceNumbersToCollect?(Wc("LruGarbageCollector",`Capping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${t}`),s=this.params.maximumSequenceNumbersToCollect):s=t,i=Date.now(),this.nthSequenceNumber(e,s))).next(s=>(n=s,a=Date.now(),this.removeTargets(e,n,t))).next(t=>(r=t,o=Date.now(),this.removeOrphanedDocuments(e,n))).next(e=>(B=Date.now(),Qc()<=as.DEBUG&&Wc("LruGarbageCollector",`LRU Garbage Collection\n\tCounted targets in ${i-c}ms\n\tDetermined least recently used ${s} in `+(a-i)+"ms\n"+`\tRemoved ${r} targets in `+(o-a)+"ms\n"+`\tRemoved ${e} documents in `+(B-o)+"ms\n"+`Total Duration: ${B-c}ms`),wd.resolve({didRun:!0,sequenceNumbersCollected:s,targetsRemoved:r,documentsRemoved:e})))}}const Id="firestore.googleapis.com",Td=!0;class Ad{constructor(e){if(void 0===e.host){if(void 0!==e.ssl)throw new ml(gl.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host=Id,this.ssl=Td}else this.host=e.host,this.ssl=e.ssl??Td;if(this.isUsingEmulator=void 0!==e.emulatorOptions,this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,this.localCache=e.localCache,e._customHeaders&&(this._customHeaders={...e._customHeaders}),void 0===e.cacheSizeBytes)this.cacheSizeBytes=dd;else{if(-1!==e.cacheSizeBytes&&e.cacheSizeBytes<1048576)throw new ml(gl.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}if(function(e,t,n,s){if(!0===t&&!0===s)throw new ml(gl.INVALID_ARGUMENT,`${e} and ${n} cannot be used together.`)}("experimentalForceLongPolling",e.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",e.experimentalAutoDetectLongPolling),this.experimentalForceLongPolling=!!e.experimentalForceLongPolling,this.experimentalForceLongPolling?this.experimentalAutoDetectLongPolling=!1:void 0===e.experimentalAutoDetectLongPolling?this.experimentalAutoDetectLongPolling=!0:this.experimentalAutoDetectLongPolling=!!e.experimentalAutoDetectLongPolling,this.experimentalLongPollingOptions=zp(e.experimentalLongPollingOptions??{}),function(e){if(void 0!==e.timeoutSeconds){if(isNaN(e.timeoutSeconds))throw new ml(gl.INVALID_ARGUMENT,`invalid long polling timeout: ${e.timeoutSeconds} (must not be NaN)`);if(e.timeoutSeconds<5)throw new ml(gl.INVALID_ARGUMENT,`invalid long polling timeout: ${e.timeoutSeconds} (minimum allowed value is 5)`);if(e.timeoutSeconds>30)throw new ml(gl.INVALID_ARGUMENT,`invalid long polling timeout: ${e.timeoutSeconds} (maximum allowed value is 30)`)}}(this.experimentalLongPollingOptions),this.useFetchStreams=!!e.useFetchStreams,void 0!==e.grpcFlowControlWindow){if("number"!=typeof e.grpcFlowControlWindow||e.grpcFlowControlWindow<=0||e.grpcFlowControlWindow>2147483647||!Number.isInteger(e.grpcFlowControlWindow))throw new ml(gl.INVALID_ARGUMENT,"grpcFlowControlWindow must be a positive integer and cannot exceed 2147483647");this.grpcFlowControlWindow=e.grpcFlowControlWindow}}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(e,t){return e.timeoutSeconds===t.timeoutSeconds}(this.experimentalLongPollingOptions,e.experimentalLongPollingOptions)&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams&&this.grpcFlowControlWindow===e.grpcFlowControlWindow&&function(e,t){if(e===t)return!0;if(!e||!t)return!1;const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(const s of n)if(e[s]!==t[s])return!1;return!0}(this._customHeaders,e._customHeaders)}}let Od=class{constructor(e,t,n,s){this._authCredentials=e,this._appCheckCredentials=t,this._databaseId=n,this._app=s,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new Ad({}),this._settingsFrozen=!1,this._emulatorOptions={},this._terminateTask="notTerminated"}get app(){if(!this._app)throw new ml(gl.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"notTerminated"!==this._terminateTask}_setSettings(e){if(this._settingsFrozen)throw new ml(gl.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 Ad(e),this._emulatorOptions=e.emulatorOptions||{},void 0!==e.credentials&&(this._authCredentials=function(e){if(!e)return new Up;switch(e.type){case"firstParty":return new $p(e.sessionIndex||"0",e.iamToken||null,e.authTokenFactory||null);case"provider":return e.client;default:throw new ml(gl.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invalid credential type")}}(e.credentials))}_getSettings(){return this._settings}_getEmulatorOptions(){return this._emulatorOptions}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return"notTerminated"===this._terminateTask&&(this._terminateTask=this._terminate()),this._terminateTask}async _restart(){"notTerminated"===this._terminateTask?await this._terminate():this._terminateTask="notTerminated"}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return function(e){const t=hd.get(e);t&&(Wc("ComponentProvider","Removing Datastore"),hd.delete(e),t.terminate())}(this),Promise.resolve()}};function Sd(e,t,n,s={}){e=Rl(e,Od);const r=es(t),i=e._getSettings(),a={...i,emulatorOptions:e._getEmulatorOptions()},o=`${t}:${n}`;r&&ts(`https://${o}`),i.host!==Id&&i.host!==o&&Xc("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used.");const B={...i,host:o,ssl:r,emulatorOptions:s};if(!Jn(B,a)&&(e._setSettings(B),s.mockUserToken)){let t,n;if("string"==typeof s.mockUserToken)t=s.mockUserToken,n=Pp.MOCK_USER;else{t=Fn(s.mockUserToken,e._app?.options.projectId);const r=s.mockUserToken.sub||s.mockUserToken.user_id;if(!r)throw new ml(gl.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");n=new Pp(r)}e._authCredentials=new Hp(new Gp(t,n))}}class Nd{constructor(e,t,n){this.converter=t,this._query=n,this.type="query",this.firestore=e}withConverter(e){return new Nd(this.firestore,e,this._query)}}class Rd{constructor(e,t,n){this.converter=t,this._key=n,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 kd(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new Rd(this.firestore,e,this._key)}toJSON(){return{type:Rd._jsonSchemaVersion,referencePath:this._key.toString()}}static fromJSON(e,t,n){if(Ll(t,Rd._jsonSchema))return new Rd(e,n||null,new Al(yl.fromString(t.referencePath)))}}Rd._jsonSchemaVersion="firestore/documentReference/1.0",Rd._jsonSchema={type:kl("string",Rd._jsonSchemaVersion),referencePath:kl("string")};class kd extends Nd{constructor(e,t,n){super(e,t,function(e){return new jh(e)}(n)),this._path=n,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 Rd(this.firestore,null,new Al(e))}withConverter(e){return new kd(this.firestore,e,this._path)}}function Ld(e,t,...n){if(e=Zn(e),1===arguments.length&&(t=il.newId()),function(e,t,n){if(!n)throw new ml(gl.INVALID_ARGUMENT,`Function ${e}() cannot be called with an empty ${t}.`)}("doc","path",t),e instanceof Od){const s=yl.fromString(t,...n);return Ol(s),new Rd(e,null,new Al(s))}{if(!(e instanceof Rd||e instanceof kd))throw new ml(gl.INVALID_ARGUMENT,"Expected first argument to doc() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const s=e._path.child(yl.fromString(t,...n));return Ol(s),new Rd(e.firestore,e instanceof kd?e.converter:null,new Al(s))}}class xd{constructor(e){this._values=(e||[]).map(e=>e)}toArray(){return this._values.map(e=>e)}isEqual(e){return function(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(e[n]!==t[n])return!1;return!0}(this._values,e._values)}toJSON(){return{type:xd._jsonSchemaVersion,vectorValues:this._values}}static fromJSON(e){if(Ll(e,xd._jsonSchema)){if(Array.isArray(e.vectorValues)&&e.vectorValues.every(e=>"number"==typeof e))return new xd(e.vectorValues);throw new ml(gl.INVALID_ARGUMENT,"Expected 'vectorValues' field to be a number array")}}}function Fd(e,t,n){if(Md(e=Zn(e)))return function(e,t,n){if(!Md(n)||!Sl(n)){const s=Nl(n);throw"an object"===s?t.createError(e+" a custom object"):t.createError(e+" "+s)}}("Unsupported field value:",t,e),function(e,t){const n={};return Tl(e)?t.path&&t.path.length>0&&t.fieldMask.push(t.path):Il(e,(e,s)=>{const r=Fd(s,t.childContextForField(e));null!=r&&(n[e]=r)}),{mapValue:{fields:n}}}(e,t);if(e instanceof xp)return function(e,t){if(!function(e){switch(e){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw el(40011,{dataSource:e})}}(t.dataSource))throw t.createError(`${e._methodName}() can only be used with update() and set()`);if(!t.path)throw t.createError(`${e._methodName}() is not currently supported inside arrays`);const n=e._toFieldTransform(t);n&&t.fieldTransforms.push(n)}(e,t),null;if(void 0===e&&t.ignoreUndefinedProperties)return null;if(t.path&&t.fieldMask.push(t.path),e instanceof Array){if(t.settings.arrayElement&&4!==t.dataSource)throw t.createError("Nested arrays are not supported");return function(e,t){const n=[];let s=0;for(const r of e){let e=Fd(r,t.childContextForArray(s));null==e&&(e={nullValue:"NULL_VALUE"}),n.push(e),s++}return{arrayValue:{values:n}}}(e,t)}return function(e,t){if(null===(e=Zn(e)))return{nullValue:"NULL_VALUE"};if("number"==typeof e)return Lu(t.serializer,e);if("boolean"==typeof e)return{booleanValue:e};if("string"==typeof e)return{stringValue:e};if(e instanceof Date){const n=Pl.fromDate(e);return{timestampValue:fp(t.serializer,n)}}if(e instanceof Pl){const n=new Pl(e.seconds,1e3*Math.floor(e.nanoseconds/1e3));return{timestampValue:fp(t.serializer,n)}}if(Pd(e)){const n=Pl.fromInstant(e),s=new Pl(n.seconds,1e3*Math.floor(n.nanoseconds/1e3));return{timestampValue:fp(t.serializer,s)}}if(e instanceof Fp)return{geoPointValue:{latitude:e.latitude,longitude:e.longitude}};if(e instanceof kp)return{bytesValue:gp(t.serializer,e._byteString)};if(e instanceof Rd){const n=t.databaseId,s=e.firestore._databaseId;if(!s.isEqual(n))throw t.createError(`Document reference is for database ${s.projectId}/${s.database} but should be for database ${n.projectId}/${n.database}`);return{referenceValue:Ep(e.firestore._databaseId||t.databaseId,e._key.path)}}if(e instanceof xd)return function(e,t){const n=e instanceof xd?e.toArray():e,s={fields:{[su]:{stringValue:au},[ou]:{arrayValue:{values:n.map(e=>{if("number"!=typeof e)throw t.createError("VectorValues must only contain numeric values.");return Ru(t.serializer,e)})}}}};return{mapValue:s}}(e,t);if(Op(e))return e._toProto(t.serializer);throw t.createError(`Unsupported field value: ${Nl(e)}`)}(e,t)}function Pd(e){if("object"!=typeof e||null===e)return!1;if("undefined"!=typeof Temporal&&"function"==typeof Temporal.Instant&&e instanceof Temporal.Instant)return!0;const t=e;return"Temporal.Instant"===t[Symbol.toStringTag]&&"bigint"==typeof t.t}function Md(e){return!("object"!=typeof e||null===e||e instanceof Array||e instanceof Date||e instanceof Pl||e instanceof Fp||e instanceof kp||e instanceof Rd||e instanceof xp||e instanceof xd||Pd(e)||Op(e))}function Gd(e,t,n){if((t=Zn(t))instanceof Lp)return t._internalPath;if("string"==typeof t)return function(e,t){if(t.search(Ud)>=0)throw Hd(`Invalid field path (${t}). Paths must not contain '~', '*', '/', '[', or ']'`,e);try{return new Lp(...t.split("."))._internalPath}catch(n){throw Hd(`Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,e)}}(e,t);throw Hd("Field path arguments must be of type string or ",e)}xd._jsonSchemaVersion="firestore/vectorValue/1.0",xd._jsonSchema={type:kl("string",xd._jsonSchemaVersion),vectorValues:kl("object")};const Ud=new RegExp("[~\\*/\\[\\]]");function Hd(e,t,n,s,r){let i=`Function ${t}() called with invalid data`;i+=". ";return new ml(gl.INVALID_ARGUMENT,i+e+"")}class Vd{constructor(e){this.optionDefinitions=e}_getKnownOptions(e,t){const n=Su.empty();for(const s in this.optionDefinitions)if(this.optionDefinitions.hasOwnProperty(s)){const r=this.optionDefinitions[s];if(s in e){const i=e[s];let a;r.nestedOptions&&Sl(i)?a={mapValue:{fields:new Vd(r.nestedOptions).getOptionsProto(t,i)}}:i&&(a=Fd(i,t)??void 0),a&&n.set(_l.fromServerFormat(r.serverName),a)}}return n}getOptionsProto(e,t,n){const s=this._getKnownOptions(t,e);if(n){const t=new Map(function(e,t){const n=[];for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&n.push(t(e[s],s,e));return n}(n,(t,n)=>[_l.fromServerFormat(n),void 0!==t?Fd(t,e):null]));s.setAll(t)}return s.value.mapValue.fields??{}}}function jd(e){let t;return e instanceof qd?e:(t=Sl(e)?function(e){const t=[];for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)){const s=e[n];t.push(Zd(n)),t.push(jd(s))}return new tf("map",t,"map")}(e):e instanceof Array?function(e){return function(e,t){return new tf("array",e.map(e=>jd(e)),t)}(e,"array")}(e):ef(e,void 0),t)}function $d(e){if(e instanceof qd)return e;if(e instanceof xd)return Zd(e);if(Array.isArray(e))return Zd(function(e){return new xd(e)}(e));throw new Error("Unsupported value: "+typeof e)}function Jd(e){return function(e){return"string"==typeof e}(e)?function(e){return function(e,t){return new Yd("string"==typeof e?wl===e?new Lp(wl)._internalPath:Gd("field",e):e._internalPath,t)}(e,"field")}(e):jd(e)}class qd{constructor(){this._protoValueType="ProtoValue"}add(e){return new tf("add",[this,jd(e)],"add")}asBoolean(){if(this instanceof nf)return this;if(this instanceof Xd)return new rf(this);if(this instanceof Yd)return new af(this);if(this instanceof tf)return new sf(this);throw new ml("invalid-argument",`Conversion of type ${typeof this} to BooleanExpression not supported.`)}subtract(e){return new tf("subtract",[this,jd(e)],"subtract")}multiply(e){return new tf("multiply",[this,jd(e)],"multiply")}divide(e){return new tf("divide",[this,jd(e)],"divide")}mod(e){return new tf("mod",[this,jd(e)],"mod")}equal(e){return new tf("equal",[this,jd(e)],"equal").asBoolean()}notEqual(e){return new tf("not_equal",[this,jd(e)],"notEqual").asBoolean()}lessThan(e){return new tf("less_than",[this,jd(e)],"lessThan").asBoolean()}lessThanOrEqual(e){return new tf("less_than_or_equal",[this,jd(e)],"lessThanOrEqual").asBoolean()}greaterThan(e){return new tf("greater_than",[this,jd(e)],"greaterThan").asBoolean()}greaterThanOrEqual(e){return new tf("greater_than_or_equal",[this,jd(e)],"greaterThanOrEqual").asBoolean()}arrayConcat(e,...t){const n=[e,...t].map(e=>jd(e));return new tf("array_concat",[this,...n],"arrayConcat")}arrayContains(e){return new tf("array_contains",[this,jd(e)],"arrayContains").asBoolean()}arrayContainsAll(e){const t=Array.isArray(e)?new Wd(e.map(jd),"arrayContainsAll"):e;return new tf("array_contains_all",[this,t],"arrayContainsAll").asBoolean()}arrayContainsAny(e){const t=Array.isArray(e)?new Wd(e.map(jd),"arrayContainsAny"):e;return new tf("array_contains_any",[this,t],"arrayContainsAny").asBoolean()}arrayReverse(){return new tf("array_reverse",[this])}arrayLength(){return new tf("array_length",[this],"arrayLength")}equalAny(e){const t=Array.isArray(e)?new Wd(e.map(jd),"equalAny"):e;return new tf("equal_any",[this,t],"equalAny").asBoolean()}notEqualAny(e){const t=Array.isArray(e)?new Wd(e.map(jd),"notEqualAny"):e;return new tf("not_equal_any",[this,t],"notEqualAny").asBoolean()}exists(){return new tf("exists",[this],"exists").asBoolean()}charLength(){return new tf("char_length",[this],"charLength")}like(e){return new tf("like",[this,jd(e)],"like").asBoolean()}regexContains(e){return new tf("regex_contains",[this,jd(e)],"regexContains").asBoolean()}regexFind(e){return new tf("regex_find",[this,jd(e)],"regexFind")}regexFindAll(e){return new tf("regex_find_all",[this,jd(e)],"regexFindAll")}regexMatch(e){return new tf("regex_match",[this,jd(e)],"regexMatch").asBoolean()}stringContains(e){return new tf("string_contains",[this,jd(e)],"stringContains").asBoolean()}startsWith(e){return new tf("starts_with",[this,jd(e)],"startsWith").asBoolean()}endsWith(e){return new tf("ends_with",[this,jd(e)],"endsWith").asBoolean()}toLower(){return new tf("to_lower",[this],"toLower")}toUpper(){return new tf("to_upper",[this],"toUpper")}trim(e){const t=[this];return e&&t.push(jd(e)),new tf("trim",t,"trim")}ltrim(e){const t=[this];return e&&t.push(jd(e)),new tf("ltrim",t,"ltrim")}rtrim(e){const t=[this];return e&&t.push(jd(e)),new tf("rtrim",t,"rtrim")}type(){return new tf("type",[this])}isType(e){return new tf("is_type",[this,Zd(e)],"isType").asBoolean()}stringConcat(e,...t){const n=[e,...t].map(jd);return new tf("string_concat",[this,...n],"stringConcat")}stringIndexOf(e){return new tf("string_index_of",[this,jd(e)],"stringIndexOf")}stringRepeat(e){return new tf("string_repeat",[this,jd(e)],"stringRepeat")}stringReplaceAll(e,t){return new tf("string_replace_all",[this,jd(e),jd(t)],"stringReplaceAll")}stringReplaceOne(e,t){return new tf("string_replace_one",[this,jd(e),jd(t)],"stringReplaceOne")}concat(e,...t){const n=[e,...t].map(jd);return new tf("concat",[this,...n],"concat")}reverse(){return new tf("reverse",[this],"reverse")}arrayFilter(e,t){return new tf("array_filter",[this,jd(e),t],"arrayFilter")}arrayTransform(e,t){return new tf("array_transform",[this,jd(e),t],"arrayTransform")}arrayTransformWithIndex(e,t,n){return new tf("array_transform",[this,jd(e),jd(t),n],"arrayTransformWithIndex")}arraySlice(e,t){const n=[this,jd(e)];return void 0!==t&&n.push(jd(t)),new tf("array_slice",n,"arraySlice")}arrayFirst(){return new tf("array_first",[this],"arrayFirst")}arrayFirstN(e){return new tf("array_first_n",[this,jd(e)],"arrayFirstN")}arrayLast(){return new tf("array_last",[this],"arrayLast")}arrayLastN(e){return new tf("array_last_n",[this,jd(e)],"arrayLastN")}arrayMaximum(){return new tf("maximum",[this],"arrayMaximum")}arrayMaximumN(e){return new tf("maximum_n",[this,jd(e)],"arrayMaximumN")}arrayMinimum(){return new tf("minimum",[this],"arrayMinimum")}arrayMinimumN(e){return new tf("minimum_n",[this,jd(e)],"arrayMinimumN")}arrayIndexOf(e){return new tf("array_index_of",[this,jd(e),jd("first")],"arrayIndexOf")}arrayLastIndexOf(e){return new tf("array_index_of",[this,jd(e),jd("last")],"arrayLastIndexOf")}arrayIndexOfAll(e){return new tf("array_index_of_all",[this,jd(e)],"arrayIndexOfAll")}byteLength(){return new tf("byte_length",[this],"byteLength")}ceil(){return new tf("ceil",[this])}floor(){return new tf("floor",[this])}abs(){return new tf("abs",[this])}exp(){return new tf("exp",[this])}mapGet(e){return new tf("map_get",[this,Zd(e)],"mapGet")}mapSet(e,t,...n){const s=[this,jd(e),jd(t),...n.map(jd)];return new tf("map_set",s,"mapSet")}mapKeys(){return new tf("map_keys",[this],"mapKeys")}mapValues(){return new tf("map_values",[this],"mapValues")}mapEntries(){return new tf("map_entries",[this],"mapEntries")}getField(e){return new tf("get_field",[this,jd(e)],"get_field")}count(){return zd._create("count",[this],"count")}sum(){return zd._create("sum",[this],"sum")}average(){return zd._create("average",[this],"average")}minimum(){return zd._create("minimum",[this],"minimum")}maximum(){return zd._create("maximum",[this],"maximum")}first(){return zd._create("first",[this],"first")}last(){return zd._create("last",[this],"last")}arrayAgg(){return zd._create("array_agg",[this],"arrayAgg")}arrayAggDistinct(){return zd._create("array_agg_distinct",[this],"arrayAggDistinct")}countDistinct(){return zd._create("count_distinct",[this],"countDistinct")}logicalMaximum(e,...t){const n=[e,...t];return new tf("maximum",[this,...n.map(jd)],"logicalMaximum")}logicalMinimum(e,...t){const n=[e,...t];return new tf("minimum",[this,...n.map(jd)],"minimum")}vectorLength(){return new tf("vector_length",[this],"vectorLength")}cosineDistance(e){return new tf("cosine_distance",[this,$d(e)],"cosineDistance")}dotProduct(e){return new tf("dot_product",[this,$d(e)],"dotProduct")}euclideanDistance(e){return new tf("euclidean_distance",[this,$d(e)],"euclideanDistance")}unixMicrosToTimestamp(){return new tf("unix_micros_to_timestamp",[this],"unixMicrosToTimestamp")}timestampToUnixMicros(){return new tf("timestamp_to_unix_micros",[this],"timestampToUnixMicros")}unixMillisToTimestamp(){return new tf("unix_millis_to_timestamp",[this],"unixMillisToTimestamp")}timestampToUnixMillis(){return new tf("timestamp_to_unix_millis",[this],"timestampToUnixMillis")}unixSecondsToTimestamp(){return new tf("unix_seconds_to_timestamp",[this],"unixSecondsToTimestamp")}timestampToUnixSeconds(){return new tf("timestamp_to_unix_seconds",[this],"timestampToUnixSeconds")}timestampAdd(e,t){return new tf("timestamp_add",[this,jd(e),jd(t)],"timestampAdd")}timestampSubtract(e,t){return new tf("timestamp_subtract",[this,jd(e),jd(t)],"timestampSubtract")}timestampDiff(e,t){return new tf("timestamp_diff",[this,Jd(e),jd(t)],"timestampDiff")}timestampExtract(e,t){const n=[this,jd(e)];return t&&n.push(jd(t)),new tf("timestamp_extract",n,"timestampExtract")}documentId(){return new tf("document_id",[this],"documentId")}parent(){return new tf("parent",[this],"parent")}substring(e,t){const n=jd(e);return new tf("substring",void 0===t?[this,n]:[this,n,jd(t)],"substring")}arrayGet(e){return new tf("array_get",[this,jd(e)],"arrayGet")}isError(){return new tf("is_error",[this],"isError").asBoolean()}ifError(e){const t=new tf("if_error",[this,jd(e)],"ifError");return e instanceof nf?t.asBoolean():t}isAbsent(){return new tf("is_absent",[this],"isAbsent").asBoolean()}mapRemove(e){return new tf("map_remove",[this,jd(e)],"mapRemove")}mapMerge(e,...t){const n=jd(e),s=t.map(jd);return new tf("map_merge",[this,n,...s],"mapMerge")}pow(e){return new tf("pow",[this,jd(e)])}trunc(e){return void 0===e?new tf("trunc",[this]):new tf("trunc",[this,jd(e)],"trunc")}round(e){return void 0===e?new tf("round",[this]):new tf("round",[this,jd(e)],"round")}collectionId(){return new tf("collection_id",[this])}length(){return new tf("length",[this])}ln(){return new tf("ln",[this])}sqrt(){return new tf("sqrt",[this])}stringReverse(){return new tf("string_reverse",[this])}ifAbsent(e){return new tf("if_absent",[this,jd(e)],"ifAbsent")}ifNull(e){return new tf("if_null",[this,jd(e)],"ifNull")}coalesce(e,...t){return new tf("coalesce",[this,jd(e),...t.map(jd)],"coalesce")}join(e){return new tf("join",[this,jd(e)],"join")}log10(){return new tf("log10",[this])}arraySum(){return new tf("sum",[this])}split(e){return new tf("split",[this,jd(e)])}timestampTruncate(e,t){const n=[this,jd(e)];return t&&n.push(jd(t)),new tf("timestamp_trunc",n)}ascending(){return function(e){return new of(Jd(e),"ascending","ascending")}(this)}descending(){return function(e){return new of(Jd(e),"descending","descending")}(this)}as(e){return new Qd(this,e,"as")}}class zd{constructor(e,t){this.name=e,this.params=t,this.exprType="AggregateFunction",this._protoValueType="ProtoValue"}static _create(e,t,n){const s=new zd(e,t);return s._methodName=n,s}as(e){return new Kd(this,e,"as")}_toProto(e){return{functionValue:{name:this.name,args:this.params.map(t=>t._toProto(e))}}}_readUserData(e){e=this._methodName?e.contextWith({methodName:this._methodName}):e,this.params.forEach(t=>t._readUserData(e))}}class Kd{constructor(e,t,n){this.aggregate=e,this.alias=t,this._methodName=n}_readUserData(e){this.aggregate._readUserData(e)}}class Qd{constructor(e,t,n){this.expr=e,this.alias=t,this._methodName=n,this.exprType="AliasedExpression",this.selectable=!0}_readUserData(e){this.expr._readUserData(e)}}class Wd extends qd{constructor(e,t){super(),this.cr=e,this._methodName=t,this.expressionType="ListOfExpressions"}_toProto(e){return{arrayValue:{values:this.cr.map(t=>t._toProto(e))}}}_readUserData(e){this.cr.forEach(t=>t._readUserData(e))}}class Yd extends qd{constructor(e,t){super(),this.fieldPath=e,this._methodName=t,this.expressionType="Field",this.selectable=!0}get _fieldPath(){return this.fieldPath}get fieldName(){return this.fieldPath.canonicalString()}get alias(){return this.fieldName}get expr(){return this}geoDistance(e){return new tf("geo_distance",[this,jd(e)],"geoDistance")}_toProto(e){return{fieldReferenceValue:this.fieldPath.canonicalString()}}_readUserData(e){}}class Xd extends qd{constructor(e,t){super(),this.value=e,this._methodName=t,this.expressionType="Constant"}static _fromProto(e){const t=new Xd(e,void 0);return t._protoValue=e,t}_toProto(e){return nl(void 0!==this._protoValue,237),this._protoValue}_getValue(){return this._protoValue}_readUserData(e){e=this._methodName?e.contextWith({methodName:this._methodName}):e,function(e){return"object"==typeof e&&null!==e&&!!("nullValue"in e&&(null===e.nullValue||"NULL_VALUE"===e.nullValue)||"booleanValue"in e&&(null===e.booleanValue||"boolean"==typeof e.booleanValue)||"integerValue"in e&&(null===e.integerValue||"number"==typeof e.integerValue||"string"==typeof e.integerValue)||"doubleValue"in e&&(null===e.doubleValue||"number"==typeof e.doubleValue)||"timestampValue"in e&&(null===e.timestampValue||function(e){return"object"==typeof e&&null!==e&&"seconds"in e&&(null===e.seconds||"number"==typeof e.seconds||"string"==typeof e.seconds)&&"nanos"in e&&(null===e.nanos||"number"==typeof e.nanos)}(e.timestampValue))||"stringValue"in e&&(null===e.stringValue||"string"==typeof e.stringValue)||"bytesValue"in e&&(null===e.bytesValue||e.bytesValue instanceof Uint8Array)||"referenceValue"in e&&(null===e.referenceValue||"string"==typeof e.referenceValue)||"geoPointValue"in e&&(null===e.geoPointValue||function(e){return"object"==typeof e&&null!==e&&"latitude"in e&&(null===e.latitude||"number"==typeof e.latitude)&&"longitude"in e&&(null===e.longitude||"number"==typeof e.longitude)}(e.geoPointValue))||"arrayValue"in e&&(null===e.arrayValue||function(e){return"object"==typeof e&&null!==e&&!(!("values"in e)||null!==e.values&&!Array.isArray(e.values))}(e.arrayValue))||"mapValue"in e&&(null===e.mapValue||function(e){return"object"==typeof e&&null!==e&&!(!("fields"in e)||null!==e.fields&&!Sl(e.fields))}(e.mapValue))||"fieldReferenceValue"in e&&(null===e.fieldReferenceValue||"string"==typeof e.fieldReferenceValue)||"functionValue"in e&&(null===e.functionValue||function(e){return"object"==typeof e&&null!==e&&!(!("name"in e)||null!==e.name&&"string"!=typeof e.name||!("args"in e)||null!==e.args&&!Array.isArray(e.args))}(e.functionValue))||"pipelineValue"in e&&(null===e.pipelineValue||function(e){return"object"==typeof e&&null!==e&&!(!("stages"in e)||null!==e.stages&&!Array.isArray(e.stages))}(e.pipelineValue)))}(this._protoValue)||(this._protoValue=Fd(this.value,e))}}function Zd(e,t){return ef(e,"constant")}function ef(e,t){const n=new Xd(e,t);return"boolean"==typeof e?new rf(n):n}class tf extends qd{constructor(e,t,n,s){super(),this.name=e,this.params=t,this.expressionType="Function",this._optionsProto=void 0,void 0!==n&&(this._methodName=n),void 0!==s&&(this._options=s)}get _optionsUtil(){return new Vd({})}_toProto(e){const t={functionValue:{name:this.name,args:this.params.map(t=>t._toProto(e))}};return this._optionsProto&&(t.functionValue.options=this._optionsProto),t}_readUserData(e){e=this._methodName?e.contextWith({methodName:this._methodName}):e,this.params.forEach(t=>t._readUserData(e)),this._options&&(this._optionsProto=this._optionsUtil.getOptionsProto(e,this._options))}}class nf extends qd{get _methodName(){return this._expr._methodName}countIf(){return zd._create("count_if",[this],"countIf")}not(){return new tf("not",[this],"not").asBoolean()}conditional(e,t){return new tf("conditional",[this,e,t],"conditional")}ifError(e){const t=jd(e),n=new tf("if_error",[this,t],"ifError");return t instanceof nf?n.asBoolean():n}_toProto(e){return this._expr._toProto(e)}_readUserData(e){this._expr._readUserData(e)}}class sf extends nf{constructor(e){super(),this._expr=e,this.expressionType="Function"}}class rf extends nf{constructor(e){super(),this._expr=e,this.expressionType="Constant"}_getValue(){return this._expr._getValue()}}class af extends nf{constructor(e){super(),this._expr=e,this.expressionType="Field"}}class of{constructor(e,t,n){this.expr=e,this.direction=t,this._methodName=n,this._protoValueType="ProtoValue"}_toProto(e){return{mapValue:{fields:{direction:Np(this.direction),expression:this.expr._toProto(e)}}}}_readUserData(e){this.expr._readUserData(e)}}class Bf{constructor(e){this.optionsProto=void 0,({rawOptions:this.rawOptions,...this.knownOptions}=e)}_readUserData(e){this.optionsProto=this._optionsUtil.getOptionsProto(e,this.knownOptions,this.rawOptions)}_toProto(e){return{name:this._name,options:this.optionsProto}}}class cf extends Bf{get _name(){return"add_fields"}get _optionsUtil(){return new Vd({})}constructor(e,t){super(t),this.fields=e}_toProto(e){return{...super._toProto(e),args:[Sp(e,this.fields)]}}_readUserData(e){super._readUserData(e),Df(this.fields,e)}}class lf extends Bf{get _name(){return"aggregate"}get _optionsUtil(){return new Vd({})}constructor(e,t,n){super(n),this.groups=e,this.accumulators=t}_toProto(e){return{...super._toProto(e),args:[Sp(e,this.accumulators),Sp(e,this.groups)]}}_readUserData(e){super._readUserData(e),Df(this.groups,e),Df(this.accumulators,e)}}class uf extends Bf{get _name(){return"distinct"}get _optionsUtil(){return new Vd({})}constructor(e,t){super(t),this.groups=e}_toProto(e){return{...super._toProto(e),args:[Sp(e,this.groups)]}}_readUserData(e){super._readUserData(e),Df(this.groups,e)}}class hf extends Bf{get _name(){return"collection"}get _optionsUtil(){return new Vd({forceIndex:{serverName:"force_index"}})}constructor(e,t){super(t),this.hr=e.startsWith("/")?e:"/"+e}_toProto(e){return{...super._toProto(e),args:[{referenceValue:this.hr}]}}_readUserData(e){super._readUserData(e)}}class pf extends Bf{get _name(){return"collection_group"}get _optionsUtil(){return new Vd({forceIndex:{serverName:"force_index"}})}constructor(e,t){super(t),this.collectionId=e}_toProto(e){return{...super._toProto(e),args:[{referenceValue:""},{stringValue:this.collectionId}]}}_readUserData(e){super._readUserData(e)}}class df extends Bf{get _name(){return"database"}get _optionsUtil(){return new Vd({})}_toProto(e){return{...super._toProto(e)}}_readUserData(e){super._readUserData(e)}}class ff extends Bf{get _name(){return"documents"}get _optionsUtil(){return new Vd({})}constructor(e,t){if(super(t),!e||0===e.length)throw new ml(gl.INVALID_ARGUMENT,"Empty document paths are not allowed in DocumentsSource");const n=e.map(e=>e.startsWith("/")?e:"/"+e),s=new Set(n);if(s.size!==n.length)throw new ml(gl.INVALID_ARGUMENT,"Duplicate document paths are not allowed in DocumentsSource");this.Tr=n,this.Pr=s}_toProto(e){return{...super._toProto(e),args:this.Tr.map(e=>({referenceValue:e}))}}_readUserData(e){super._readUserData(e)}}class Cf extends Bf{get _name(){return"where"}get _optionsUtil(){return new Vd({})}constructor(e,t){super(t),this.condition=e}_toProto(e){return{...super._toProto(e),args:[this.condition._toProto(e)]}}_readUserData(e){super._readUserData(e),Df(this.condition,e)}}class gf extends Bf{get _name(){return"limit"}get _optionsUtil(){return new Vd({})}constructor(e,t){nl(!isNaN(e)&&e!==1/0&&e!==-1/0,34860),super(t),this.limit=e}_toProto(e){return{...super._toProto(e),args:[Lu(e,this.limit)]}}}class mf extends Bf{get _name(){return"offset"}get _optionsUtil(){return new Vd({})}constructor(e,t){super(t),this.offset=e}_toProto(e){return{...super._toProto(e),args:[Lu(e,this.offset)]}}}class wf extends Bf{get _name(){return"select"}get _optionsUtil(){return new Vd({})}constructor(e,t){super(t),this.selections=e}_toProto(e){return{...super._toProto(e),args:[Sp(e,this.selections)]}}_readUserData(e){super._readUserData(e),Df(this.selections,e)}}class Ef extends Bf{get _name(){return"sort"}get _optionsUtil(){return new Vd({})}constructor(e,t){super(t),this.orderings=e}_toProto(e){return{...super._toProto(e),args:this.orderings.map(t=>t._toProto(e))}}_readUserData(e){super._readUserData(e),Df(this.orderings,e)}}class yf extends Bf{get _name(){return"replace_with"}get _optionsUtil(){return new Vd({})}constructor(e,t){super(t),this.map=e}_toProto(e){return{...super._toProto(e),args:[this.map._toProto(e),Np(yf.Ir)]}}_readUserData(e){super._readUserData(e),Df(this.map,e)}}function Df(e,t){return function(e){return"function"==typeof e._readUserData}(e)?e._readUserData(t):Array.isArray(e)||e instanceof Map?e.forEach(e=>e._readUserData(t)):Object.values(e).forEach(e=>e._readUserData(t)),e}yf.Ir="full_replace";class _f{constructor(e,t,n){this.serializer=e,this.stages=t,this.listenOptions=n,this.isCorePipeline=!0}getPipelineCollection(){return vf(this)}getPipelineCollectionGroup(){return If(this)}getPipelineCollectionId(){return function(e){switch(bf(e)){case"collection":return yl.fromString(vf(e)).lastSegment();case"collection_group":return If(e);default:return}}(this)}getPipelineDocuments(){return Tf(this)}getPipelineFlavor(){return function(e){let t="exact";return e.stages.forEach((n,s)=>{n._name!==uf.name&&n._name!==lf.name||(t="keyless"),n._name===wf.name&&"exact"===t&&(t="augmented"),n._name===cf.name&&s<e.stages.length-1&&"exact"===t&&(t="augmented")}),t}(this)}getPipelineSourceType(){return bf(this)}}function bf(e){const t=e.stages[0];return t instanceof hf||t instanceof pf||t instanceof df||t instanceof ff?t._name:"unknown"}function vf(e){if("collection"===bf(e))return e.stages[0].hr}function If(e){if("collection_group"===bf(e))return e.stages[0].collectionId}function Tf(e){if("documents"===bf(e))return e.stages[0].Tr}class Af{constructor(e,t){this.type=e,this.value=t}static mr(){return new Af("ERROR",void 0)}static pr(){return new Af("UNSET",void 0)}static gr(){return new Af("NULL",Bu)}static newValue(e){return bu(e)?new Af("NULL",Bu):function(e){return!!e&&"booleanValue"in e}(e)?new Af("BOOLEAN",e):Eu(e)?new Af("INT",e):yu(e)?new Af("DOUBLE",e):function(e){return!!e&&"timestampValue"in e&&!!e.timestampValue}(e)?new Af("TIMESTAMP",e):function(e){return!!e&&"stringValue"in e}(e)?new Af("STRING",e):function(e){return!!e&&"bytesValue"in e}(e)?new Af("BYTES",e):e.referenceValue?new Af("REFERENCE",e):e.geoPointValue?new Af("GEO_POINT",e):_u(e)?new Af("ARRAY",e):Tu(e)?new Af("VECTOR",e):Iu(e)?new Af("MAP",e):new Af("ERROR",void 0)}yr(){return"ERROR"===this.type||"UNSET"===this.type}wr(){return"NULL"===this.type}}function Of(e){if(!e.yr())return e.value}function Sf(e){return e instanceof nf?e._expr:e}function Nf(e){if((e=Sf(e))instanceof Yd)return new Rf(e);if(e instanceof Xd)return new kf(e);if(e instanceof Wd)return new Lf(e);if(e instanceof tf){if("add"===e.name)return new Hf(e);if("subtract"===e.name)return new Vf(e);if("multiply"===e.name)return new jf(e);if("divide"===e.name)return new $f(e);if("mod"===e.name)return new Jf(e);if("and"===e.name)return new qf(e);if("equal"===e.name)return new BC(e);if("not_equal"===e.name)return new cC(e);if("less_than"===e.name)return new lC(e);if("less_than_or_equal"===e.name)return new uC(e);if("greater_than"===e.name)return new hC(e);if("greater_than_or_equal"===e.name)return new pC(e);if("array_concat"===e.name)return new dC(e);if("array_reverse"===e.name)return new fC(e);if("array_contains"===e.name)return new CC(e);if("array_contains_all"===e.name)return new gC(e);if("array_contains_any"===e.name)return new mC(e);if("array_length"===e.name)return new wC(e);if("array_element"===e.name)return new EC(e);if("equal_any"===e.name)return new Wf(e);if("not_equal_any"===e.name)return new Yf(e);if("is_nan"===e.name)return new Xf(e);if("is_not_nan"===e.name)return new Zf(e);if("is_null"===e.name)return new eC(e);if("is_not_null"===e.name)return new tC(e);if("is_error"===e.name)return new nC(e);if("exists"===e.name)return new sC(e);if("not"===e.name)return new zf(e);if("or"===e.name)return new Kf(e);if("xor"===e.name)return new Qf(e);if("conditional"===e.name)return new rC(e);if("maximum"===e.name)return new iC(e);if("minimum"===e.name)return new aC(e);if("reverse"===e.name)return new yC(e);if("replace_first"===e.name)return new DC(e);if("replace_all"===e.name)return new _C(e);if("char_length"===e.name)return new bC(e);if("byte_length"===e.name)return new vC(e);if("like"===e.name)return new TC(e);if("regex_contains"===e.name)return new AC(e);if("regex_match"===e.name)return new OC(e);if("string_contains"===e.name)return new SC(e);if("starts_with"===e.name)return new NC(e);if("ends_with"===e.name)return new RC(e);if("to_lower"===e.name)return new kC(e);if("to_upper"===e.name)return new LC(e);if("trim"===e.name)return new xC(e);if("string_concat"===e.name)return new FC(e);if("map_get"===e.name)return new PC(e);if("cosine_distance"===e.name)return new GC(e);if("dot_product"===e.name)return new UC(e);if("euclidean_distance"===e.name)return new HC(e);if("vector_length"===e.name)return new VC(e);if("unix_micros_to_timestamp"===e.name)return new sg(e);if("timestamp_to_unix_micros"===e.name)return new og(e);if("unix_millis_to_timestamp"===e.name)return new rg(e);if("timestamp_to_unix_millis"===e.name)return new Bg(e);if("unix_seconds_to_timestamp"===e.name)return new ig(e);if("timestamp_to_unix_seconds"===e.name)return new cg(e);if("timestamp_add"===e.name)return new ug(e);if("timestamp_subtract"===e.name)return new hg(e)}throw new Error(`Unknown Expr : ${e}`)}class Rf{constructor(e){this.expr=e}evaluate(e,t){if(this.expr.fieldName===wl)return Af.newValue({referenceValue:Dp(e.serializer,t.key)});if("__update_time__"===this.expr.fieldName)return Af.newValue({timestampValue:mp(e.serializer,t.version)});if("__create_time__"===this.expr.fieldName)return Af.newValue({timestampValue:mp(e.serializer,t.createTime)});const n=t.data.field(this.expr._fieldPath);return n?Kl(n)?Af.newValue(function(e,t){if("estimate"===e.serverTimestampBehavior)return{timestampValue:mp(e.serializer,Lh.fromTimestamp(Wl(t)))};if("previous"===e.serverTimestampBehavior){const e=Ql(t);if(e)return e}return{nullValue:"NULL_VALUE"}}(e,n)):Af.newValue(n):Af.pr()}}class kf{constructor(e){this.expr=e}evaluate(e,t){return Af.newValue(this.expr._getValue())}}class Lf{constructor(e){this.expr=e}evaluate(e,t){const n=this.expr.cr.map(n=>Nf(n).evaluate(e,t));return n.some(e=>e.yr())?Af.mr():Af.newValue({arrayValue:{values:n.map(e=>e.value)}})}}function xf(e){return yu(e)?Number(e.doubleValue):Number(e.integerValue)}function Ff(e){return BigInt(e.integerValue)}const Pf=BigInt("0x7fffffffffffffff"),Mf=-BigInt("0x8000000000000000");class Gf{constructor(e){this.expr=e}evaluate(e,t){nl(this.expr.params.length>=2,24778);const n=Nf(this.expr.params[0]).evaluate(e,t),s=Nf(this.expr.params[1]).evaluate(e,t);let r=this.br(n,s);for(const n of this.expr.params.slice(2)){const s=Nf(n).evaluate(e,t);r=this.br(r,s)}return r}br(e,t){if(e.yr()||t.yr())return Af.mr();if(e.wr()||t.wr())return Af.gr();const n=e.value,s=t.value;if(!yu(n)&&!Eu(n)||!yu(s)&&!Eu(s))return Af.mr();if(yu(n)||yu(s)){const e=this.Sr(n,s);return e?Af.newValue(e):Af.mr()}if(Eu(n)&&Eu(s)){const e=this.vr(n,s);return void 0===e?Af.mr():"number"==typeof e?Af.newValue({doubleValue:e}):e<Mf||e>Pf?Af.mr():Af.newValue({integerValue:`${e}`})}return Af.mr()}}function Uf(e,t){return uu(e)!==uu(t)?"TYPE_MISMATCH":vu(e)||vu(t)?"NOT_EQ":bu(e)&&bu(t)?"EQ":bu(e)||bu(t)?"NULL":_u(e)&&_u(t)?function(e,t){if(e.values?.length!==t.values?.length)return"NOT_EQ";let n=!1;for(let s=0;s<(e.values?.length??0);s++){const r=e.values[s],i=t.values[s];switch(Uf(r,i)){case"EQ":break;case"NOT_EQ":case"TYPE_MISMATCH":return"NOT_EQ";case"NULL":n=!0;break;default:el(44609,{Dr:r,Cr:i})}}return n?"NULL":"EQ"}(e.arrayValue,t.arrayValue):Tu(e)&&Tu(t)||Iu(e)&&Iu(t)?function(e,t){const n=e.fields||{},s=t.fields||{};if(vl(n)!==vl(s))return"NOT_EQ";let r=!1;for(const e in n)if(n.hasOwnProperty(e)){if(void 0===s[e])return"NOT_EQ";switch(Uf(n[e],s[e])){case"NOT_EQ":case"TYPE_MISMATCH":return"NOT_EQ";case"NULL":r=!0}}return r?"NULL":"EQ"}(e.mapValue,t.mapValue):function(e,t){return hu(e,t,{u:!1,i:!0,o:!0})}(e,t)?"EQ":"NOT_EQ"}class Hf extends Gf{vr(e,t){return Ff(e)+Ff(t)}Sr(e,t){return{doubleValue:xf(e)+xf(t)}}}class Vf extends Gf{constructor(e){super(e),this.expr=e}vr(e,t){return Ff(e)-Ff(t)}Sr(e,t){return{doubleValue:xf(e)-xf(t)}}}class jf extends Gf{constructor(e){super(e),this.expr=e}vr(e,t){return Ff(e)*Ff(t)}Sr(e,t){return{doubleValue:xf(e)*xf(t)}}}class $f extends Gf{constructor(e){super(e),this.expr=e}vr(e,t){const n=Ff(t);if(n!==BigInt(0))return Ff(e)/n}Sr(e,t){const n=xf(t);return 0===n?{doubleValue:nu(n)?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY}:{doubleValue:xf(e)/n}}}class Jf extends Gf{constructor(e){super(e),this.expr=e}vr(e,t){const n=Ff(t);if(n!==BigInt(0))return Ff(e)%n}Sr(e,t){const n=xf(t);if(0!==n)return{doubleValue:xf(e)%n}}}class qf{constructor(e){this.expr=e}evaluate(e,t){let n=!1,s=!1;for(const r of this.expr.params){const i=Nf(r).evaluate(e,t);switch(i.type){case"BOOLEAN":if(!i.value?.booleanValue)return Af.newValue(lu);break;case"NULL":s=!0;break;default:n=!0}}return n?Af.mr():s?Af.gr():Af.newValue(cu)}}class zf{constructor(e){this.expr=e}evaluate(e,t){nl(1===this.expr.params.length,9634);const n=Nf(this.expr.params[0]).evaluate(e,t);switch(n.type){case"BOOLEAN":return Af.newValue({booleanValue:!n.value?.booleanValue});case"NULL":return Af.gr();default:return Af.mr()}}}class Kf{constructor(e){this.expr=e}evaluate(e,t){let n=!1,s=!1;for(const r of this.expr.params){const i=Nf(r).evaluate(e,t);switch(i.type){case"BOOLEAN":if(i.value?.booleanValue)return Af.newValue(cu);break;case"NULL":s=!0;break;default:n=!0}}return n?Af.mr():s?Af.gr():Af.newValue(lu)}}class Qf{constructor(e){this.expr=e}evaluate(e,t){let n=!1,s=!1;for(const r of this.expr.params){const i=Nf(r).evaluate(e,t);switch(i.type){case"BOOLEAN":n=Qf.xor(n,!!i.value?.booleanValue);break;case"NULL":s=!0;break;default:return Af.mr()}}return s?Af.gr():Af.newValue({booleanValue:n})}static xor(e,t){return(e||t)&&!(e&&t)}}class Wf{constructor(e){this.expr=e}evaluate(e,t){nl(2===this.expr.params.length,55094);let n=!1;const s=Nf(this.expr.params[0]).evaluate(e,t);switch(s.type){case"NULL":n=!0;break;case"ERROR":case"UNSET":return Af.mr()}const r=Nf(this.expr.params[1]).evaluate(e,t);switch(r.type){case"ARRAY":break;case"NULL":n=!0;break;default:return Af.mr()}if(n)return Af.gr();for(const e of r.value?.arrayValue?.values??[])switch(bu(s.value)&&bu(e)?"EQ":Uf(s.value,e)){case"EQ":return Af.newValue(cu);case"NOT_EQ":case"TYPE_MISMATCH":break;case"NULL":n=!0;break;default:el(44608,{value:s.value,candidate:e})}return n?Af.gr():Af.newValue(lu)}}class Yf{constructor(e){this.expr=e}evaluate(e,t){return new zf(new tf("not",[new tf("equal_any",this.expr.params)])).evaluate(e,t)}}class Xf{constructor(e){this.expr=e}evaluate(e,t){nl(1===this.expr.params.length,23322);const n=Nf(this.expr.params[0]).evaluate(e,t);switch(n.type){case"INT":return Af.newValue(lu);case"DOUBLE":return Af.newValue({booleanValue:isNaN(xf(n.value))});case"NULL":return Af.gr();default:return Af.mr()}}}class Zf{constructor(e){this.expr=e}evaluate(e,t){return nl(1===this.expr.params.length,50406),new zf(new tf("not",[new tf("is_nan",this.expr.params)])).evaluate(e,t)}}class eC{constructor(e){this.expr=e}evaluate(e,t){switch(nl(1===this.expr.params.length,23123),Nf(this.expr.params[0]).evaluate(e,t).type){case"NULL":return Af.newValue(cu);case"UNSET":case"ERROR":return Af.mr();default:return Af.newValue(lu)}}}class tC{constructor(e){this.expr=e}evaluate(e,t){return nl(1===this.expr.params.length,23167),new zf(new tf("not",[new tf("is_null",this.expr.params)])).evaluate(e,t)}}class nC{constructor(e){this.expr=e}evaluate(e,t){return nl(1===this.expr.params.length,5228),"ERROR"===Nf(this.expr.params[0]).evaluate(e,t).type?Af.newValue(cu):Af.newValue(lu)}}class sC{constructor(e){this.expr=e}evaluate(e,t){switch(nl(1===this.expr.params.length,6877),Nf(this.expr.params[0]).evaluate(e,t).type){case"ERROR":return Af.mr();case"UNSET":return Af.newValue(lu);default:return Af.newValue(cu)}}}class rC{constructor(e){this.expr=e}evaluate(e,t){nl(3===this.expr.params.length,11706);const n=Nf(this.expr.params[0]).evaluate(e,t);switch(n.type){case"BOOLEAN":return n.value?.booleanValue?Nf(this.expr.params[1]).evaluate(e,t):Nf(this.expr.params[2]).evaluate(e,t);case"NULL":return Nf(this.expr.params[2]).evaluate(e,t);default:return Af.mr()}}}class iC{constructor(e){this.expr=e}evaluate(e,t){const n=this.expr.params.map(n=>Nf(n).evaluate(e,t));let s;for(const e of n)switch(e.type){case"ERROR":case"UNSET":case"NULL":continue;default:s=void 0===s||du(e.value,s.value)>0?e:s}return void 0===s?Af.gr():s}}class aC{constructor(e){this.expr=e}evaluate(e,t){const n=this.expr.params.map(n=>Nf(n).evaluate(e,t));let s;for(const e of n)switch(e.type){case"ERROR":case"UNSET":case"NULL":continue;default:s=void 0===s||du(e.value,s.value)<0?e:s}return void 0===s?Af.gr():s}}class oC{constructor(e){this.expr=e}evaluate(e,t){nl(2===this.expr.params.length,31033,`${this.expr.name}() function should have exactly 2 params`);const n=Nf(this.expr.params[0]).evaluate(e,t);switch(n.type){case"ERROR":case"UNSET":return Af.mr()}const s=Nf(this.expr.params[1]).evaluate(e,t);switch(s.type){case"ERROR":case"UNSET":return Af.mr()}return this.Fr(n,s)}}class BC extends oC{constructor(e){super(e),this.expr=e}Fr(e,t){if(e.wr()&&t.wr())return Af.newValue(cu);if(e.wr()||t.wr())return Af.newValue(lu);if(vu(e.value)||vu(t.value))return Af.newValue(lu);if(uu(e.value)!==uu(t.value))return Af.newValue(lu);switch(Uf(e.value,t.value)){case"EQ":return Af.newValue(cu);case"NOT_EQ":return Af.newValue(lu);case"NULL":return Af.gr();default:el(44615,{left:e,right:t})}}}class cC extends oC{constructor(e){super(e),this.expr=e}Fr(e,t){switch(Uf(e.value,t.value)){case"EQ":return Af.newValue(lu);case"NOT_EQ":case"TYPE_MISMATCH":return Af.newValue(cu);case"NULL":return Af.gr();default:el(44614,{left:e,right:t})}}}class lC extends oC{constructor(e){super(e),this.expr=e}Fr(e,t){return uu(e.value)!==uu(t.value)||vu(e.value)||vu(t.value)?Af.newValue(lu):Af.newValue({booleanValue:du(e.value,t.value)<0})}}class uC extends oC{constructor(e){super(e),this.expr=e}Fr(e,t){return uu(e.value)!==uu(t.value)||vu(e.value)||vu(t.value)?Af.newValue(lu):"EQ"===Uf(e.value,t.value)?Af.newValue(cu):Af.newValue({booleanValue:du(e.value,t.value)<0})}}class hC extends oC{constructor(e){super(e),this.expr=e}Fr(e,t){return uu(e.value)!==uu(t.value)||vu(e.value)||vu(t.value)?Af.newValue(lu):Af.newValue({booleanValue:du(e.value,t.value)>0})}}class pC extends oC{constructor(e){super(e),this.expr=e}Fr(e,t){return uu(e.value)!==uu(t.value)||vu(e.value)||vu(t.value)?Af.newValue(lu):"EQ"===Uf(e.value,t.value)?Af.newValue(cu):Af.newValue({booleanValue:du(e.value,t.value)>0})}}class dC{constructor(e){this.expr=e}evaluate(e,t){throw new Error("Unimplemented")}}class fC{constructor(e){this.expr=e}evaluate(e,t){nl(1===this.expr.params.length,216);const n=Nf(this.expr.params[0]).evaluate(e,t);switch(n.type){case"NULL":return Af.gr();case"ARRAY":{const e=n.value.arrayValue?.values??[];return Af.newValue({arrayValue:{values:[...e].reverse()}})}default:return Af.mr()}}}class CC{constructor(e){this.expr=e}evaluate(e,t){return nl(2===this.expr.params.length,52884),new Wf(new tf("eq_any",[this.expr.params[1],this.expr.params[0]])).evaluate(e,t)}}class gC{constructor(e){this.expr=e}evaluate(e,t){nl(2===this.expr.params.length,1392);let n=!1;const s=Nf(this.expr.params[0]).evaluate(e,t);switch(s.type){case"ARRAY":break;case"NULL":n=!0;break;default:return Af.mr()}const r=Nf(this.expr.params[1]).evaluate(e,t);switch(r.type){case"ARRAY":break;case"NULL":n=!0;break;default:return Af.mr()}if(n)return Af.gr();const i=r.value?.arrayValue?.values??[],a=s.value?.arrayValue?.values??[];for(const e of i){let t=!1;n=!1;for(const s of a){switch(bu(e)&&bu(s)?"EQ":Uf(e,s)){case"EQ":t=!0;break;case"NOT_EQ":case"TYPE_MISMATCH":break;case"NULL":n=!0;break;default:el(44613,{value:s,search:e})}if(t)break}if(!t)return Af.newValue(lu)}return Af.newValue(cu)}}class mC{constructor(e){this.expr=e}evaluate(e,t){nl(2===this.expr.params.length,2680);let n=!1;const s=Nf(this.expr.params[0]).evaluate(e,t);switch(s.type){case"ARRAY":break;case"NULL":n=!0;break;default:return Af.mr()}const r=Nf(this.expr.params[1]).evaluate(e,t);switch(r.type){case"ARRAY":break;case"NULL":n=!0;break;default:return Af.mr()}if(n)return Af.gr();const i=r.value?.arrayValue?.values??[],a=s.value?.arrayValue?.values??[];for(const e of a)for(const t of i)switch(bu(e)&&bu(t)?"EQ":Uf(e,t)){case"EQ":return Af.newValue(cu);case"NOT_EQ":case"TYPE_MISMATCH":break;case"NULL":n=!0;break;default:el(60403,{value:e,search:t})}return n?Af.gr():Af.newValue(lu)}}class wC{constructor(e){this.expr=e}evaluate(e,t){nl(1===this.expr.params.length,38605);const n=Nf(this.expr.params[0]).evaluate(e,t);switch(n.type){case"NULL":return Af.gr();case"ARRAY":return Af.newValue({integerValue:`${n.value?.arrayValue?.values?.length??0}`});default:return Af.mr()}}}class EC{constructor(e){this.expr=e}evaluate(e,t){throw new Error("Unimplemented")}}class yC{constructor(e){this.expr=e}evaluate(e,t){nl(1===this.expr.params.length,1508);const n=Nf(this.expr.params[0]).evaluate(e,t);switch(n.type){case"NULL":return Af.gr();case"BYTES":{const e=n.value?.bytesValue;if("string"==typeof e){const t=Gl.fromBase64String(e).toUint8Array();return t.reverse(),Af.newValue({bytesValue:Gl.fromUint8Array(t).toBase64()})}return Af.newValue({bytesValue:new Uint8Array(e).reverse()})}case"STRING":{const e=n.value?.stringValue,t=new Intl.__PRIVATE_Segmenter(void 0,{granularity:"grapheme"}).segment(e),s=Array.from(t,e=>e.segment).reverse();return Af.newValue({stringValue:s.join("")})}default:return Af.mr()}}}class DC{constructor(e){this.expr=e}evaluate(e,t){throw new Error("Unimplemented")}}class _C{constructor(e){this.expr=e}evaluate(e,t){throw new Error("Unimplemented")}}class bC{constructor(e){this.expr=e}evaluate(e,t){nl(1===this.expr.params.length,19400);const n=Nf(this.expr.params[0]).evaluate(e,t);switch(n.type){case"NULL":return Af.gr();case"STRING":{const e=function(e){let t=0;for(let n=0;n<e.length;n++){const s=e.codePointAt(n);if(void 0===s)return;if(s<=65535)if(s>=55296&&s<=57343)if(s<=56319){const s=e.codePointAt(n+1);void 0!==s&&s>=56320&&s<=57343?(t+=1,n++):t+=1}else t+=1;else t+=1;else{if(!(s<=1114111))return;t+=1,n++}}return t}(n.value.stringValue);return void 0===e?Af.mr():Af.newValue({integerValue:e})}default:return Af.mr()}}}class vC{constructor(e){this.expr=e}evaluate(e,t){nl(1===this.expr.params.length,8486);const n=Nf(this.expr.params[0]).evaluate(e,t);switch(n.type){case"BYTES":{const e=n.value?.bytesValue;return"string"==typeof e?Af.newValue({integerValue:Gl.fromBase64String(e).toUint8Array().length}):Af.newValue({integerValue:new Uint8Array(e).length})}case"STRING":{const e=function(e){let t=0;for(let n=0;n<e.length;n++){const s=e.codePointAt(n);if(void 0===s)return;if(s>=55296&&s<=57343){if(!(s<=56319))return;{const s=e.codePointAt(n+1);if(void 0===s||!(s>=56320&&s<=57343))return;t+=4,n++}}else if(s<=127)t+=1;else if(s<=2047)t+=2;else if(s<=65535)t+=3;else{if(!(s<=1114111))return;t+=4,n++}}return t}(n.value?.stringValue);return void 0===e?Af.mr():Af.newValue({integerValue:e})}case"NULL":return Af.gr();default:return Af.mr()}}}class IC{constructor(e){this.expr=e}evaluate(e,t){nl(2===this.expr.params.length,39773,`${this.expr.name}() function should have exactly two parameters`);let n=!1;const s=Nf(this.expr.params[0]).evaluate(e,t);switch(s.type){case"STRING":break;case"NULL":n=!0;break;default:return Af.mr()}const r=Nf(this.expr.params[1]).evaluate(e,t);switch(r.type){case"STRING":break;case"NULL":n=!0;break;default:return Af.mr()}return n?Af.gr():this.Or(s.value?.stringValue,r.value?.stringValue)}}class TC extends IC{Or(e,t){try{const n=function(e){let t="";for(let n=0;n<e.length;n++){const s=e.charAt(n);switch(s){case"_":t+=".";break;case"%":t+=".*";break;case"\\":case".":case"*":case"?":case"+":case"^":case"$":case"|":case"(":case")":case"[":case"]":case"{":case"}":t+="\\"+s;break;default:t+=s}}return"^"+t+"$"}(t),s=qc.compile(n);return Af.newValue({booleanValue:s.matches(e)})}catch(e){return Xc(`Invalid LIKE pattern converted to regex: ${t}, returning error. Error: ${e}`),Af.mr()}}}class AC extends IC{Or(e,t){try{const n=qc.compile(t);return Af.newValue({booleanValue:n.test(e)})}catch(e){return Xc(`Invalid regex pattern found in regex_contains: ${t}, returning error`),Af.mr()}}}class OC extends IC{Or(e,t){try{return Af.newValue({booleanValue:qc.compile(t).matches(e)})}catch(e){return Xc(`Invalid regex pattern found in regex_match: ${t}, returning error`),Af.mr()}}}class SC extends IC{Or(e,t){return Af.newValue({booleanValue:e.includes(t)})}}class NC extends IC{Or(e,t){return Af.newValue({booleanValue:e.startsWith(t)})}}class RC extends IC{Or(e,t){return Af.newValue({booleanValue:e.endsWith(t)})}}class kC{constructor(e){this.expr=e}evaluate(e,t){nl(1===this.expr.params.length,29079);const n=Nf(this.expr.params[0]).evaluate(e,t);switch(n.type){case"STRING":return Af.newValue({stringValue:n.value?.stringValue?.toLowerCase()});case"NULL":return Af.gr();default:return Af.mr()}}}class LC{constructor(e){this.expr=e}evaluate(e,t){nl(1===this.expr.params.length,60487);const n=Nf(this.expr.params[0]).evaluate(e,t);switch(n.type){case"STRING":return Af.newValue({stringValue:n.value?.stringValue?.toUpperCase()});case"NULL":return Af.gr();default:return Af.mr()}}}class xC{constructor(e){this.expr=e}evaluate(e,t){nl(1===this.expr.params.length,28544);const n=Nf(this.expr.params[0]).evaluate(e,t);switch(n.type){case"STRING":return Af.newValue({stringValue:n.value?.stringValue?.trim()});case"NULL":return Af.gr();default:return Af.mr()}}}class FC{constructor(e){this.expr=e}evaluate(e,t){const n=this.expr.params.map(n=>Nf(n).evaluate(e,t));let s="",r=!1;for(const e of n)switch(e.type){case"STRING":s+=e.value.stringValue;break;case"NULL":r=!0;break;default:return Af.mr()}return r?Af.gr():Af.newValue({stringValue:s})}}class PC{constructor(e){this.expr=e}evaluate(e,t){nl(2===this.expr.params.length,4483);const n=Nf(this.expr.params[0]).evaluate(e,t);switch(n.type){case"UNSET":return Af.pr();case"MAP":break;default:return Af.mr()}const s=Nf(this.expr.params[1]).evaluate(e,t);if("STRING"!==s.type)return Af.mr();const r=n.value?.mapValue?.fields?.[s.value?.stringValue];return void 0===r?Af.pr():Af.newValue(r)}}class MC{constructor(e){this.expr=e}evaluate(e,t){nl(2===this.expr.params.length,25231,`${this.expr.name}() function should have exactly 2 params`);let n=!1;const s=Nf(this.expr.params[0]).evaluate(e,t);switch(s.type){case"VECTOR":break;case"NULL":n=!0;break;default:return Af.mr()}const r=Nf(this.expr.params[1]).evaluate(e,t);switch(r.type){case"VECTOR":break;case"NULL":n=!0;break;default:return Af.mr()}if(n)return Af.gr();const i=Au(s.value),a=Au(r.value);if(void 0===i||void 0===a||i.values?.length!==a.values?.length)return Af.mr();const o=this.Mr(i,a);return void 0===o||isNaN(o)?Af.mr():Af.newValue({doubleValue:o})}}class GC extends MC{Mr(e,t){const n=e?.values??[],s=t?.values??[];if(0===n.length)return;let r=0,i=0,a=0;for(let e=0;e<n.length;e++){if(!Du(n[e])||!Du(s[e]))return;const t=xf(n[e]),o=xf(s[e]);r+=t*o,i+=t*t,a+=o*o}const o=Math.sqrt(i)*Math.sqrt(a);return 0!==o?1-Math.max(-1,Math.min(1,r/o)):void 0}}class UC extends MC{Mr(e,t){const n=e?.values??[],s=t?.values??[];if(0===n.length)return 0;let r=0;for(let e=0;e<n.length;e++){if(!Du(n[e])||!Du(s[e]))return;r+=xf(n[e])*xf(s[e])}return r}}class HC extends MC{Mr(e,t){const n=e?.values??[],s=t?.values??[];if(0===n.length)return 0;let r=0;for(let e=0;e<n.length;e++){if(!Du(n[e])||!Du(s[e]))return;const t=xf(n[e]),i=xf(s[e]);r+=Math.pow(t-i,2)}return Math.sqrt(r)}}class VC{constructor(e){this.expr=e}evaluate(e,t){nl(1===this.expr.params.length,39044);const n=Nf(this.expr.params[0]).evaluate(e,t);switch(n.type){case"VECTOR":{const e=Au(n.value);return Af.newValue({integerValue:e?.values?.length??0})}case"NULL":return Af.gr();default:return Af.mr()}}}const jC=BigInt(-62135596800),$C=BigInt(253402300799),JC=BigInt(1e3),qC=BigInt(1e6),zC=jC*JC,KC=$C*JC+BigInt(999),QC=jC*qC,WC=$C*qC+BigInt(999999);function YC(e){return e>=QC&&e<=WC}function XC(e){return e>=jC&&e<=$C}function ZC(e,t){const n=BigInt(e);return!(n<jC||n>$C||t<0||t>=1e9||n===jC&&0!==t||n===$C&&t>999999999)}function eg(e,t){return t<0?{seconds:e-1,nanos:t+1e9}:{seconds:e,nanos:t}}function tg(e){return BigInt(e.seconds)*qC+BigInt(Math.trunc(e.nanoseconds/1e3))}class ng{constructor(e){this.expr=e}evaluate(e,t){nl(1===this.expr.params.length,49262,`${this.expr.name}() function should have exactly one parameter`);const n=Nf(this.expr.params[0]).evaluate(e,t);switch(n.type){case"INT":return this.toTimestamp(BigInt(n.value.integerValue));case"NULL":return Af.gr();default:return Af.mr()}}}class sg extends ng{toTimestamp(e){if(!YC(e))return Af.mr();let t=Number(e/qC),n=Number(e%qC*BigInt(1e3));const s=eg(t,n);return t=s.seconds,n=s.nanos,ZC(t,n)?Af.newValue({timestampValue:{seconds:t,nanos:n}}):Af.mr()}}class rg extends ng{toTimestamp(e){if(!function(e){return e>=zC&&e<=KC}(e))return Af.mr();let t=Number(e/JC),n=Number(e%JC*BigInt(1e6));const s=eg(t,n);return t=s.seconds,n=s.nanos,ZC(t,n)?Af.newValue({timestampValue:{seconds:t,nanos:n}}):Af.mr()}}class ig extends ng{toTimestamp(e){if(!XC(e))return Af.mr();const t=Number(e);return Af.newValue({timestampValue:{seconds:t,nanos:0}})}}class ag{constructor(e){this.expr=e}evaluate(e,t){nl(1===this.expr.params.length,1265,`${this.expr.name}() function should have exactly one parameter`);const n=Nf(this.expr.params[0]).evaluate(e,t);switch(n.type){case"TIMESTAMP":break;case"NULL":return Af.gr();default:return Af.mr()}const s=Cp(n.value.timestampValue);return ZC(s.seconds,s.nanoseconds)?this.Nr(s):Af.mr()}}class og extends ag{Nr(e){const t=tg(e);return YC(t)?Af.newValue({integerValue:`${t.toString()}`}):Af.mr()}}class Bg extends ag{Nr(e){const t=tg(e),n=t/BigInt(1e3),s=t%BigInt(1e3);return n>BigInt(0)||s===BigInt(0)?Af.newValue({integerValue:n.toString()}):Af.newValue({integerValue:(n-BigInt(1)).toString()})}}class cg extends ag{Nr(e){const t=BigInt(e.seconds);return XC(t)?Af.newValue({integerValue:t.toString()}):Af.mr()}}class lg{constructor(e){this.expr=e}evaluate(e,t){nl(3===this.expr.params.length,2775,`${this.expr.name}() function should have exactly 3 parameters`);let n=!1;const s=Nf(this.expr.params[0]).evaluate(e,t);switch(s.type){case"TIMESTAMP":break;case"NULL":n=!0;break;default:return Af.mr()}const r=Nf(this.expr.params[1]).evaluate(e,t);let i;switch(r.type){case"STRING":if(i=function(e){switch(e){case"microsecond":return"microsecond";case"millisecond":return"millisecond";case"second":return"second";case"minute":return"minute";case"hour":return"hour";case"day":return"day";default:return}}(r.value.stringValue),void 0===i)return Af.mr();break;case"NULL":n=!0;break;default:return Af.mr()}const a=Nf(this.expr.params[2]).evaluate(e,t);switch(a.type){case"INT":break;case"NULL":n=!0;break;default:return Af.mr()}if(n)return Af.gr();const o=BigInt(a.value.integerValue);let B;try{switch(i){case"microsecond":B=o;break;case"millisecond":B=o*BigInt(1e3);break;case"second":B=o*BigInt(1e6);break;case"minute":B=o*BigInt(6e7);break;case"hour":B=o*BigInt(36e8);break;case"day":B=o*BigInt(864e8);break;default:return Af.mr()}if("microsecond"!==i&&o!==BigInt(0)&&B/o!==BigInt(this.Lr(i)))return Af.mr()}catch(e){return Xc(`Error during timestamp arithmetic: ${e}`),Af.mr()}const c=Cp(s.value.timestampValue);if(!ZC(c.seconds,c.nanoseconds))return Af.mr();const l=tg(c),u=this.Br(l,B);if(!YC(u))return Af.mr();const h=Number(u/qC),p=u%qC,d=Number((p<0?p+qC:p)*BigInt(1e3)),f=p<0?h-1:h;return ZC(f,d)?Af.newValue({timestampValue:{seconds:f,nanos:d}}):Af.mr()}Lr(e){switch(e){case"millisecond":return 1e3;case"second":return 1e6;case"minute":return 6e7;case"hour":return 36e8;case"day":return 864e8;default:return 1}}}class ug extends lg{Br(e,t){return e+t}}class hg extends lg{Br(e,t){return e-t}}function pg(e){if((e=Sf(e))instanceof Yd)return`fld(${e.fieldName})`;if(e instanceof Xd)return`cst(${function(e){return null===e?"null":"number"==typeof e?e.toString():"string"==typeof e?`"${e}"`:e instanceof Rd?`ref(${e.path})`:e instanceof xd?`vec(${JSON.stringify(e)})`:JSON.stringify(e)}(e.value)})`;if(e instanceof tf)return`fn(${e.name},[${e.params.map(pg).join(",")}])`;if("ListOfExpressions"===e.expressionType)return`list([${e.cr.map(pg).join(",")}])`;throw new Error(`Unrecognized expr ${JSON.stringify(e,null,2)}`)}function dg(e){return`${Array.from(e.entries()).sort().map(([e,t])=>`${e}=${pg(t)}`).join(",")}`}function fg(e){return e.stages.map(e=>function(e){if(e instanceof cf)return`${e._name}(${dg(e.fields)})`;if(e instanceof lf){let t=`${e._name}(${dg(e.accumulators)})`;return e.groups.size>0&&(t+=`grouping(${dg(e.groups)})`),t}if(e instanceof uf)return`${e._name}(${dg(e.groups)})`;if(e instanceof hf)return`${e._name}(${e.hr})`;if(e instanceof pf)return`${e._name}(${e.collectionId})`;if(e instanceof df)return`${e._name}()`;if(e instanceof ff)return`${e._name}(${e.Tr.sort()})`;if(e instanceof Cf)return`${e._name}(${pg(e.condition)})`;if(e instanceof gf)return`${e._name}(${e.limit})`;if(e instanceof Ef)return`${e._name}(${function(e){return e.map(e=>`${pg(e.expr)}${e.direction}`).join(",")}(e.orderings)})`;throw new Error(`Unrecognized stage ${e._name}`)}(e)).join("|")}function Cg(e,t){return fg(e)===fg(t)}function gg(e){return e instanceof _f}function mg(e){return gg(e)?fg(e):Kh(e)}function wg(e){return gg(e)?fg(e):function(e){return`${Hh(qh(e))}|lt:${e.limitType}`}(e)}function Eg(e,t){return e instanceof _f&&t instanceof _f?Cg(e,t):!(e instanceof _f&&!(t instanceof _f)||!(e instanceof _f)&&t instanceof _f)&&function(e,t){return Vh(qh(e),qh(t))&&e.limitType===t.limitType}(e,t)}function yg(e){return function(e){return!!e.isCorePipeline}(e)?fg(e):Hh(e)}function Dg(e,t){return e instanceof _f&&t instanceof _f?Cg(e,t):!(e instanceof _f&&!(t instanceof _f)||!(e instanceof _f)&&t instanceof _f)&&Vh(e,t)}class _g{constructor(e,t,n,s){this.batchId=e,this.localWriteTime=t,this.baseMutations=n,this.mutations=s}applyToRemoteDocument(e,t){const n=t.mutationResults;for(let t=0;t<this.mutations.length;t++){const s=this.mutations[t];s.key.isEqual(e.key)&&nh(s,e,n[t])}}applyToLocalView(e,t){for(const n of this.baseMutations)n.key.isEqual(e.key)&&(t=sh(n,e,t,this.localWriteTime));for(const n of this.mutations)n.key.isEqual(e.key)&&(t=sh(n,e,t,this.localWriteTime));return t}applyToLocalDocumentSet(e,t){const n=Bp();return this.mutations.forEach(s=>{const r=e.get(s.key),i=r.overlayedDocument;let a=this.applyToLocalView(i,r.mutatedFields);a=t.has(s.key)?null:a;const o=th(i,a);null!==o&&n.set(s.key,o),i.isValidDocument()||i.convertToNoDocument(Lh.min())}),n}keys(){return this.mutations.reduce((e,t)=>e.add(t.key),hp())}isEqual(e){return this.batchId===e.batchId&&ul(this.mutations,e.mutations,(e,t)=>ih(e,t))&&ul(this.baseMutations,e.baseMutations,(e,t)=>ih(e,t))}}class bg{constructor(e,t,n,s){this.batch=e,this.commitVersion=t,this.mutationResults=n,this.docVersions=s}static from(e,t,n){nl(e.mutations.length===n.length,58842,{Ur:e.mutations.length,kr:n.length});let s=lp;const r=e.mutations;for(let e=0;e<r.length;e++)s=s.insert(r[e].key,n[e].version);return new bg(e,t,n,s)}}function vg(e,t){let n=t;const s=e.length;for(let t=0;t<s;t++){const s=e.charAt(t);switch(s){case"\0":n+="";break;case"":n+="";break;default:n+=s}}return n}function Ig(e){return e+""}class Tg{constructor(e,t){this.largestBatchId=e,this.mutation=t}getKey(){return this.mutation.key}isEqual(e){return null!==e&&this.mutation===e.mutation}toString(){return`Overlay{\n largestBatchId: ${this.largestBatchId},\n mutation: ${this.mutation.toString()}\n }`}}class Ag{constructor(e){this.$r=e}}function Og(e){const t=vp({parent:e.parent,structuredQuery:e.structuredQuery});return"LAST"===e.limitType?zh(t,t.limit,"L"):t}class Sg{constructor(){this.Zi=new Ng}addToCollectionParentIndex(e,t){return this.Zi.add(t),wd.resolve()}getCollectionParents(e,t){return wd.resolve(this.Zi.getEntries(t))}addFieldIndex(e,t){return wd.resolve()}deleteFieldIndex(e,t){return wd.resolve()}deleteAllFieldIndexes(e){return wd.resolve()}createTargetIndexes(e,t){return wd.resolve()}getDocumentsMatchingTarget(e,t){return wd.resolve(null)}getIndexType(e,t){return wd.resolve(0)}getFieldIndexes(e,t){return wd.resolve([])}getNextCollectionGroupToUpdate(e){return wd.resolve(null)}getMinOffset(e,t){return wd.resolve(Ph.min())}getMinOffsetFromCollectionGroup(e,t){return wd.resolve(Ph.min())}updateCollectionGroup(e,t,n){return wd.resolve()}updateIndexEntries(e,t){return wd.resolve()}}class Ng{constructor(){this.index={}}add(e){const t=e.lastSegment(),n=e.popLast(),s=this.index[t]||new fl(yl.comparator),r=!s.has(n);return this.index[t]=s.add(n),r}has(e){const t=e.lastSegment(),n=e.popLast(),s=this.index[t];return s&&s.has(n)}getEntries(e){return(this.index[e]||new fl(yl.comparator)).toArray()}}class Rg{constructor(e){this.ys=e}next(){return this.ys+=2,this.ys}static ws(){return new Rg(0)}static bs(){return new Rg(-1)}}function kg(e,t){return function(e,t){let n=t;for(const t of e.stages)n=Lg({serializer:e.serializer,serverTimestampBehavior:e.listenOptions?.serverTimestampBehavior},t,n);return n}(e,[t]).length>0}function Lg(e,t,n){if(t instanceof hf)return function(e,t,n){return n.filter(e=>e.isFoundDocument()&&`/${e.key.getCollectionPath().canonicalString()}`===t.hr)}(0,t,n);if(t instanceof Cf)return function(e,t,n){return n.filter(n=>{const s=Of(Nf(t.condition).evaluate(e,n));return void 0!==s&&hu(s,cu)})}(e,t,n);if(t instanceof pf)return function(e,t,n){return n.filter(e=>e.isFoundDocument()&&e.key.getCollectionPath().lastSegment()===t.collectionId)}(0,t,n);if(t instanceof df)return function(e,t,n){return n.filter(e=>e.isFoundDocument())}(0,0,n);if(t instanceof ff)return function(e,t,n){return n.filter(e=>e.isFoundDocument()&&t.Pr.has(e.key.path.toStringWithLeadingSlash()))}(0,t,n);if(t instanceof gf)return function(e,t,n){return n.slice(0,t.limit)}(0,t,n);if(t instanceof Ef)return function(e,t,n){const s=t.orderings.map(e=>({Ms:Nf(e.expr),direction:e.direction}));return[...n].sort((t,n)=>{for(const{Ms:r,direction:i}of s){const s=Of(r.evaluate(e,t)),a=Of(r.evaluate(e,n)),o=du(s??Bu,a??Bu);if(0!==o)return"ascending"===i?o:-o}return 0})}(e,t,n);throw new Error(`Unknown stage: ${t._name}`)}class xg{constructor(){this.changes=new tp(e=>e.toString(),(e,t)=>e.isEqual(t)),this.changesApplied=!1}addEntry(e){this.assertNotApplied(),this.changes.set(e.key,e)}removeEntry(e,t){this.assertNotApplied(),this.changes.set(e,xh.newInvalidDocument(e).setReadTime(t))}getEntry(e,t){this.assertNotApplied();const n=this.changes.get(t);return void 0!==n?wd.resolve(n):this.getFromCache(e,t)}getEntries(e,t){return this.getAllFromCache(e,t)}apply(e){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(e)}assertNotApplied(){}}class Fg{constructor(e,t){this.overlayedDocument=e,this.mutatedFields=t}}class Pg{constructor(e,t,n,s){this.remoteDocumentCache=e,this.mutationQueue=t,this.documentOverlayCache=n,this.indexManager=s}getDocument(e,t){let n=null;return this.documentOverlayCache.getOverlay(e,t).next(s=>(n=s,this.remoteDocumentCache.getEntry(e,t))).next(e=>(null!==n&&sh(n.mutation,e,bl.empty(),Pl.now()),e))}getDocuments(e,t){return this.remoteDocumentCache.getEntries(e,t).next(t=>this.getLocalViewOfDocuments(e,t,hp()).next(()=>t))}getLocalViewOfDocuments(e,t,n=hp()){const s=op();return this.populateOverlays(e,s,t).next(()=>this.computeViews(e,t,s,n).next(e=>{let t=ip();return e.forEach((e,n)=>{t=t.insert(e,n.overlayedDocument)}),t}))}getOverlayedDocuments(e,t){const n=op();return this.populateOverlays(e,n,t).next(()=>this.computeViews(e,t,n,hp()))}populateOverlays(e,t,n){const s=[];return n.forEach(e=>{t.has(e)||s.push(e)}),this.documentOverlayCache.getOverlays(e,s).next(e=>{e.forEach((e,n)=>{t.set(e,n)})})}computeViews(e,t,n,s){let r=sp();const i=cp(),a=cp();return t.forEach((e,t)=>{const a=n.get(t.key);s.has(t.key)&&(void 0===a||a.mutation instanceof oh)?r=r.insert(t.key,t):void 0!==a?(i.set(t.key,a.mutation.getFieldMask()),sh(a.mutation,t,a.mutation.getFieldMask(),Pl.now())):i.set(t.key,bl.empty())}),this.recalculateAndSaveOverlays(e,r).next(e=>(e.forEach((e,t)=>i.set(e,t)),t.forEach((e,t)=>a.set(e,new Fg(t,i.get(e)??null))),a))}recalculateAndSaveOverlays(e,t){const n=cp();let s=new hl((e,t)=>e-t),r=hp();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,t).next(e=>{for(const r of e)r.keys().forEach(e=>{const i=t.get(e);if(null===i)return;let a=n.get(e)||bl.empty();a=r.applyToLocalView(i,a),n.set(e,a);const o=(s.get(r.batchId)||hp()).add(e);s=s.insert(r.batchId,o)})}).next(()=>{const i=[],a=s.getReverseIterator();for(;a.hasNext();){const s=a.getNext(),o=s.key,B=s.value,c=Bp();B.forEach(e=>{if(!r.has(e)){const s=th(t.get(e),n.get(e));null!==s&&c.set(e,s),r=r.add(e)}}),i.push(this.documentOverlayCache.saveOverlays(e,o,c))}return wd.waitFor(i)}).next(()=>n)}recalculateAndSaveOverlaysForDocumentKeys(e,t){return this.remoteDocumentCache.getEntries(e,t).next(t=>this.recalculateAndSaveOverlays(e,t))}getDocumentsMatchingQuery(e,t,n,s){return gg(t)?this.getDocumentsMatchingPipeline(e,t,n,s):function(e){return Al.isDocumentKey(e.path)&&null===e.collectionGroup&&0===e.filters.length}(t)?this.getDocumentsMatchingDocumentQuery(e,t.path):function(e){return null!==e.collectionGroup}(t)?this.getDocumentsMatchingCollectionGroupQuery(e,t,n,s):this.getDocumentsMatchingCollectionQuery(e,t,n,s)}getNextDocuments(e,t,n,s){return this.remoteDocumentCache.getAllFromCollectionGroup(e,t,n,s).next(r=>{const i=s-r.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(e,t,n.largestBatchId,s-r.size):wd.resolve(op());let a=-1,o=r;return i.next(t=>wd.forEach(t,(t,n)=>(a<n.largestBatchId&&(a=n.largestBatchId),r.get(t)?wd.resolve():this.remoteDocumentCache.getEntry(e,t).next(e=>{o=o.insert(t,e)}))).next(()=>this.populateOverlays(e,t,r)).next(()=>this.computeViews(e,o,t,hp())).next(e=>({batchId:a,changes:ap(e)})))})}getDocumentsMatchingDocumentQuery(e,t){return this.getDocument(e,new Al(t)).next(e=>{let t=ip();return e.isFoundDocument()&&(t=t.insert(e.key,e)),t})}getDocumentsMatchingCollectionGroupQuery(e,t,n,s){const r=t.collectionGroup;let i=ip();return this.indexManager.getCollectionParents(e,r).next(a=>wd.forEach(a,a=>{const o=function(e,t){return new jh(t,null,e.explicitOrderBy.slice(),e.filters.slice(),e.limit,e.limitType,e.startAt,e.endAt)}(t,a.child(r));return this.getDocumentsMatchingCollectionQuery(e,o,n,s).next(e=>{e.forEach((e,t)=>{i=i.insert(e,t)})})}).next(()=>i))}getDocumentsMatchingCollectionQuery(e,t,n,s){let r;return this.documentOverlayCache.getOverlaysForCollection(e,t.path,n.largestBatchId).next(i=>(r=i,this.remoteDocumentCache.getDocumentsMatchingQuery(e,t,n,r,s))).next(e=>this.retrieveMatchingLocalDocuments(r,e,e=>Qh(t,e)))}getDocumentsMatchingPipeline(e,t,n,s){if("collection_group"===bf(t)){const r=If(t);let i=ip();return this.indexManager.getCollectionParents(e,r).next(a=>wd.forEach(a,a=>{const o=function(e,t){const n=e.stages.map(e=>e instanceof pf?new hf(t.canonicalString(),{}):e);return new _f(e.serializer,n)}(t,a.child(r));return this.getDocumentsMatchingPipeline(e,o,n,s).next(e=>{e.forEach((e,t)=>{i=i.insert(e,t)})})}).next(()=>i))}{let r;return this.getOverlaysForPipeline(e,t,n.largestBatchId).next(i=>{switch(r=i,bf(t)){case"collection":return this.remoteDocumentCache.getDocumentsMatchingQuery(e,t,n,r,s);case"documents":let i=hp();for(const e of Tf(t))i=i.add(Al.fromPath(e));return this.remoteDocumentCache.getEntries(e,i);case"database":return this.remoteDocumentCache.getAllEntries(e);default:throw new ml("invalid-argument",`Invalid pipeline source to execute offline: ${fg(t)}`)}}).next(e=>this.retrieveMatchingLocalDocuments(r,e,e=>kg(t,e)))}}retrieveMatchingLocalDocuments(e,t,n){e.forEach((e,n)=>{const s=n.getKey();null===t.get(s)&&(t=t.insert(s,xh.newInvalidDocument(s)))});let s=ip();return t.forEach((t,r)=>{const i=e.get(t);void 0!==i&&sh(i.mutation,r,bl.empty(),Pl.now()),n(r)&&(s=s.insert(t,r))}),s}getOverlaysForPipeline(e,t,n){switch(bf(t)){case"collection":return this.documentOverlayCache.getOverlaysForCollection(e,yl.fromString(vf(t)),n);case"collection_group":throw new ml("invalid-argument",`Unexpected collection group pipeline: ${fg(t)}`);case"documents":return this.documentOverlayCache.getOverlays(e,Tf(t).map(e=>Al.fromPath(e)));case"database":return this.documentOverlayCache.getAllOverlays(e,n);default:throw new ml("invalid-argument",`Failed to get overlays for pipeline: ${fg(t)}`)}}}class Mg{constructor(e){this.serializer=e,this.Qs=new Map,this.Ws=new Map}getBundleMetadata(e,t){return wd.resolve(this.Qs.get(t))}saveBundleMetadata(e,t){return this.Qs.set(t.id,function(e){return{id:e.id,version:e.version,createTime:wp(e.createTime)}}(t)),wd.resolve()}getNamedQuery(e,t){return wd.resolve(this.Ws.get(t))}saveNamedQuery(e,t){return this.Ws.set(t.name,function(e){return{name:e.name,query:Og(e.bundledQuery),readTime:wp(e.readTime)}}(t)),wd.resolve()}}class Gg{constructor(){this.overlays=new hl(Al.comparator),this.Gs=new Map}getOverlay(e,t){return wd.resolve(this.overlays.get(t))}getOverlays(e,t){const n=op();return wd.forEach(t,t=>this.getOverlay(e,t).next(e=>{null!==e&&n.set(t,e)})).next(()=>n)}getAllOverlays(e,t){const n=op();return this.overlays.forEach((e,s)=>{s.largestBatchId>t&&n.set(e,s)}),wd.resolve(n)}saveOverlays(e,t,n){return n.forEach((n,s)=>{this.Zr(e,t,s)}),wd.resolve()}removeOverlaysForBatchId(e,t,n){const s=this.Gs.get(n);return void 0!==s&&(s.forEach(e=>this.overlays=this.overlays.remove(e)),this.Gs.delete(n)),wd.resolve()}getOverlaysForCollection(e,t,n){const s=op(),r=t.length+1,i=new Al(t.child("")),a=this.overlays.getIteratorFrom(i);for(;a.hasNext();){const e=a.getNext().value,i=e.getKey();if(!t.isPrefixOf(i.path))break;i.path.length===r&&e.largestBatchId>n&&s.set(e.getKey(),e)}return wd.resolve(s)}getOverlaysForCollectionGroup(e,t,n,s){let r=new hl((e,t)=>e-t);const i=this.overlays.getIterator();for(;i.hasNext();){const e=i.getNext().value;if(e.getKey().getCollectionGroup()===t&&e.largestBatchId>n){let t=r.get(e.largestBatchId);null===t&&(t=op(),r=r.insert(e.largestBatchId,t)),t.set(e.getKey(),e)}}const a=op(),o=r.getIterator();for(;o.hasNext()&&(o.getNext().value.forEach((e,t)=>a.set(e,t)),!(a.size()>=s)););return wd.resolve(a)}Zr(e,t,n){const s=this.overlays.get(n.key);if(null!==s){const e=this.Gs.get(s.largestBatchId).delete(n.key);this.Gs.set(s.largestBatchId,e)}this.overlays=this.overlays.insert(n.key,new Tg(t,n));let r=this.Gs.get(t);void 0===r&&(r=hp(),this.Gs.set(t,r)),this.Gs.set(t,r.add(n.key))}}class Ug{constructor(){this.sessionToken=Gl.EMPTY_BYTE_STRING}getSessionToken(e){return wd.resolve(this.sessionToken)}setSessionToken(e,t){return this.sessionToken=t,wd.resolve()}}class Hg{constructor(){this.zs=new fl(Vg.js),this.Hs=new fl(Vg.Js)}isEmpty(){return this.zs.isEmpty()}addReference(e,t){const n=new Vg(e,t);this.zs=this.zs.add(n),this.Hs=this.Hs.add(n)}Ys(e,t){e.forEach(e=>this.addReference(e,t))}removeReference(e,t){this.Zs(new Vg(e,t))}Xs(e,t){e.forEach(e=>this.removeReference(e,t))}e_(e){const t=new Al(new yl([])),n=new Vg(t,e),s=new Vg(t,e+1),r=[];return this.Hs.forEachInRange([n,s],e=>{this.Zs(e),r.push(e.key)}),r}t_(){this.zs.forEach(e=>this.Zs(e))}Zs(e){this.zs=this.zs.delete(e),this.Hs=this.Hs.delete(e)}n_(e){const t=new Al(new yl([])),n=new Vg(t,e),s=new Vg(t,e+1);let r=hp();return this.Hs.forEachInRange([n,s],e=>{r=r.add(e.key)}),r}containsKey(e){const t=new Vg(e,0),n=this.zs.firstAfterOrEqual(t);return null!==n&&e.isEqual(n.key)}}class Vg{constructor(e,t){this.key=e,this.r_=t}static js(e,t){return Al.comparator(e.key,t.key)||al(e.r_,t.r_)}static Js(e,t){return al(e.r_,t.r_)||Al.comparator(e.key,t.key)}}class jg{constructor(e,t){this.indexManager=e,this.referenceDelegate=t,this.mutationQueue=[],this.Gr=1,this.i_=new fl(Vg.js)}checkEmpty(e){return wd.resolve(0===this.mutationQueue.length)}addMutationBatch(e,t,n,s){const r=this.Gr;this.Gr++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];const i=new _g(r,t,n,s);this.mutationQueue.push(i);for(const t of s)this.i_=this.i_.add(new Vg(t.key,r)),this.indexManager.addToCollectionParentIndex(e,t.key.path.popLast());return wd.resolve(i)}lookupMutationBatch(e,t){return wd.resolve(this.s_(t))}getNextMutationBatchAfterBatchId(e,t){const n=t+1,s=this.__(n),r=s<0?0:s;return wd.resolve(this.mutationQueue.length>r?this.mutationQueue[r]:null)}getHighestUnacknowledgedBatchId(){return wd.resolve(0===this.mutationQueue.length?-1:this.Gr-1)}getAllMutationBatches(e){return wd.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(e,t){const n=new Vg(t,0),s=new Vg(t,Number.POSITIVE_INFINITY),r=[];return this.i_.forEachInRange([n,s],e=>{const t=this.s_(e.r_);r.push(t)}),wd.resolve(r)}getAllMutationBatchesAffectingDocumentKeys(e,t){let n=new fl(al);return t.forEach(e=>{const t=new Vg(e,0),s=new Vg(e,Number.POSITIVE_INFINITY);this.i_.forEachInRange([t,s],e=>{n=n.add(e.r_)})}),wd.resolve(this.o_(n))}getAllMutationBatchesAffectingQuery(e,t){const n=t.path,s=n.length+1;let r=n;Al.isDocumentKey(r)||(r=r.child(""));const i=new Vg(new Al(r),0);let a=new fl(al);return this.i_.forEachWhile(e=>{const t=e.key.path;return!!n.isPrefixOf(t)&&(t.length===s&&(a=a.add(e.r_)),!0)},i),wd.resolve(this.o_(a))}o_(e){const t=[];return e.forEach(e=>{const n=this.s_(e);null!==n&&t.push(n)}),t}removeMutationBatch(e,t){nl(0===this.a_(t.batchId,"removed"),55003),this.mutationQueue.shift();let n=this.i_;return wd.forEach(t.mutations,s=>{const r=new Vg(s.key,t.batchId);return n=n.delete(r),this.referenceDelegate.markPotentiallyOrphaned(e,s.key)}).next(()=>{this.i_=n})}Hr(e){}containsKey(e,t){const n=new Vg(t,0),s=this.i_.firstAfterOrEqual(n);return wd.resolve(t.isEqual(s&&s.key))}performConsistencyCheck(e){return this.mutationQueue.length,wd.resolve()}a_(e,t){return this.__(e)}__(e){return 0===this.mutationQueue.length?0:e-this.mutationQueue[0].batchId}s_(e){const t=this.__(e);return t<0||t>=this.mutationQueue.length?null:this.mutationQueue[t]}}class $g{constructor(e){this.u_=e,this.docs=new hl(Al.comparator),this.size=0}setIndexManager(e){this.indexManager=e}addEntry(e,t){const n=t.key,s=this.docs.get(n),r=s?s.size:0,i=this.u_(t);return this.docs=this.docs.insert(n,{document:t.mutableCopy(),size:i}),this.size+=i-r,this.indexManager.addToCollectionParentIndex(e,n.path.popLast())}removeEntry(e){const t=this.docs.get(e);t&&(this.docs=this.docs.remove(e),this.size-=t.size)}getEntry(e,t){const n=this.docs.get(t);return wd.resolve(n?n.document.mutableCopy():xh.newInvalidDocument(t))}getEntries(e,t){let n=sp();return t.forEach(e=>{const t=this.docs.get(e);n=n.insert(e,t?t.document.mutableCopy():xh.newInvalidDocument(e))}),wd.resolve(n)}getAllEntries(e){let t=sp();return this.docs.forEach((e,n)=>{t=t.insert(e,n.document)}),wd.resolve(t)}getDocumentsMatchingQuery(e,t,n,s){let r,i;gg(t)?(r=yl.fromString(vf(t)),i=e=>kg(t,e)):(r=t.path,i=e=>Qh(t,e));let a=sp();const o=new Al(r.child("__id-9223372036854775808__")),B=this.docs.getIteratorFrom(o);for(;B.hasNext();){const{key:e,value:{document:t}}=B.getNext();if(!r.isPrefixOf(e.path))break;e.path.length>r.length+1||Mh(Fh(t),n)<=0||(s.has(t.key)||i(t))&&(a=a.insert(t.key,t.mutableCopy()))}return wd.resolve(a)}getAllFromCollectionGroup(e,t,n,s){el(9500)}c_(e,t){return wd.forEach(this.docs,e=>t(e))}newChangeBuffer(e){return new Jg(this)}getSize(e){return wd.resolve(this.size)}}class Jg extends xg{constructor(e){super(),this.$s=e}applyChanges(e){const t=[];return this.changes.forEach((n,s)=>{s.isValidDocument()?t.push(this.$s.addEntry(e,s)):this.$s.removeEntry(n)}),wd.waitFor(t)}getFromCache(e,t){return this.$s.getEntry(e,t)}getAllFromCache(e,t){return this.$s.getEntries(e,t)}}class qg{constructor(e){this.persistence=e,this.l_=new tp(e=>yg(e),Dg),this.lastRemoteSnapshotVersion=Lh.min(),this.highestTargetId=0,this.E_=0,this.h_=new Hg,this.targetCount=0,this.T_=Rg.ws()}forEachTarget(e,t){return this.l_.forEach((e,n)=>t(n)),wd.resolve()}getLastRemoteSnapshotVersion(e){return wd.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(e){return wd.resolve(this.E_)}allocateTargetId(e){return this.highestTargetId=this.T_.next(),wd.resolve(this.highestTargetId)}setTargetsMetadata(e,t,n){return n&&(this.lastRemoteSnapshotVersion=n),t>this.E_&&(this.E_=t),wd.resolve()}Ds(e){this.l_.set(e.target,e);const t=e.targetId;t>this.highestTargetId&&(this.T_=new Rg(t),this.highestTargetId=t),e.sequenceNumber>this.E_&&(this.E_=e.sequenceNumber)}addTargetData(e,t){return this.Ds(t),this.targetCount+=1,wd.resolve()}updateTargetData(e,t){return this.Ds(t),wd.resolve()}removeTargetData(e,t){return this.l_.delete(t.target),this.h_.e_(t.targetId),this.targetCount-=1,wd.resolve()}removeTargets(e,t,n){let s=0;const r=[];return this.l_.forEach((i,a)=>{a.sequenceNumber<=t&&null===n.get(a.targetId)&&(this.l_.delete(i),r.push(this.removeMatchingKeysForTargetId(e,a.targetId)),s++)}),wd.waitFor(r).next(()=>s)}getTargetCount(e){return wd.resolve(this.targetCount)}getTargetData(e,t){const n=this.l_.get(t)||null;return wd.resolve(n)}addMatchingKeys(e,t,n){return this.h_.Ys(t,n),wd.resolve()}removeMatchingKeys(e,t,n){this.h_.Xs(t,n);const s=this.persistence.referenceDelegate,r=[];return s&&t.forEach(t=>{r.push(s.markPotentiallyOrphaned(e,t))}),wd.waitFor(r)}removeMatchingKeysForTargetId(e,t){return this.h_.e_(t),wd.resolve()}getMatchingKeysForTargetId(e,t){const n=this.h_.n_(t);return wd.resolve(n)}containsKey(e,t){return wd.resolve(this.h_.containsKey(t))}}class zg{constructor(e,t){this.P_={},this.overlays={},this.I_=new Cd(0),this.R_=!1,this.R_=!0,this.A_=new Ug,this.referenceDelegate=e(this),this.V_=new qg(this),this.indexManager=new Sg,this.remoteDocumentCache=function(e){return new $g(e)}(e=>this.referenceDelegate.d_(e)),this.serializer=new Ag(t),this.f_=new Mg(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.R_=!1,Promise.resolve()}get started(){return this.R_}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(e){return this.indexManager}getDocumentOverlayCache(e){let t=this.overlays[e.toKey()];return t||(t=new Gg,this.overlays[e.toKey()]=t),t}getMutationQueue(e,t){let n=this.P_[e.toKey()];return n||(n=new jg(t,this.referenceDelegate),this.P_[e.toKey()]=n),n}getGlobalsCache(){return this.A_}getTargetCache(){return this.V_}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.f_}runTransaction(e,t,n){Wc("MemoryPersistence","Starting transaction:",e);const s=new Kg(this.I_.next());return this.referenceDelegate.m_(),n(s).next(e=>this.referenceDelegate.p_(s).next(()=>e)).toPromise().then(e=>(s.raiseOnCommittedEvent(),e))}g_(e,t){return wd.or(Object.values(this.P_).map(n=>()=>n.containsKey(e,t)))}}class Kg extends gd{constructor(e){super(),this.currentSequenceNumber=e}}class Qg{constructor(e){this.persistence=e,this.y_=new Hg,this.w_=null}static b_(e){return new Qg(e)}get S_(){if(this.w_)return this.w_;throw el(60996)}addReference(e,t,n){return this.y_.addReference(n,t),this.S_.delete(n.toString()),wd.resolve()}removeReference(e,t,n){return this.y_.removeReference(n,t),this.S_.add(n.toString()),wd.resolve()}markPotentiallyOrphaned(e,t){return this.S_.add(t.toString()),wd.resolve()}removeTarget(e,t){this.y_.e_(t.targetId).forEach(e=>this.S_.add(e.toString()));const n=this.persistence.getTargetCache();return n.getMatchingKeysForTargetId(e,t.targetId).next(e=>{e.forEach(e=>this.S_.add(e.toString()))}).next(()=>n.removeTargetData(e,t))}m_(){this.w_=new Set}p_(e){const t=this.persistence.getRemoteDocumentCache().newChangeBuffer();return wd.forEach(this.S_,n=>{const s=Al.fromPath(n);return this.v_(e,s).next(e=>{e||t.removeEntry(s,Lh.min())})}).next(()=>(this.w_=null,t.apply(e)))}updateLimboDocument(e,t){return this.v_(e,t).next(e=>{e?this.S_.delete(t.toString()):this.S_.add(t.toString())})}d_(e){return 0}v_(e,t){return wd.or([()=>wd.resolve(this.y_.containsKey(t)),()=>this.persistence.getTargetCache().containsKey(e,t),()=>this.persistence.g_(e,t)])}}class Wg{constructor(e,t){this.persistence=e,this.D_=new tp(e=>function(e){let t="";for(let n=0;n<e.length;n++)t.length>0&&(t=Ig(t)),t=vg(e.get(n),t);return Ig(t)}(e.path),(e,t)=>e.isEqual(t)),this.garbageCollector=function(e,t){return new vd(e,t)}(this,t)}static b_(e,t){return new Wg(e,t)}m_(){}p_(e){return wd.resolve()}forEachTarget(e,t){return this.persistence.getTargetCache().forEachTarget(e,t)}ir(e){const t=this.Cs(e);return this.persistence.getTargetCache().getTargetCount(e).next(e=>t.next(t=>e+t))}Cs(e){let t=0;return this.sr(e,e=>{t++}).next(()=>t)}sr(e,t){return wd.forEach(this.D_,(n,s)=>this.Os(e,n,s).next(e=>e?wd.resolve():t(s)))}removeTargets(e,t,n){return this.persistence.getTargetCache().removeTargets(e,t,n)}removeOrphanedDocuments(e,t){let n=0;const s=this.persistence.getRemoteDocumentCache(),r=s.newChangeBuffer();return s.c_(e,s=>this.Os(e,s,t).next(e=>{e||(n++,r.removeEntry(s,Lh.min()))})).next(()=>r.apply(e)).next(()=>n)}markPotentiallyOrphaned(e,t){return this.D_.set(t,e.currentSequenceNumber),wd.resolve()}removeTarget(e,t){const n=t.withSequenceNumber(e.currentSequenceNumber);return this.persistence.getTargetCache().updateTargetData(e,n)}addReference(e,t,n){return this.D_.set(n,e.currentSequenceNumber),wd.resolve()}removeReference(e,t,n){return this.D_.set(n,e.currentSequenceNumber),wd.resolve()}updateLimboDocument(e,t){return this.D_.set(t,e.currentSequenceNumber),wd.resolve()}d_(e){let t=e.key.toString().length;return e.isFoundDocument()&&(t+=wu(e.data.value)),t}Os(e,t,n){return wd.or([()=>this.persistence.g_(e,t),()=>this.persistence.getTargetCache().containsKey(e,t),()=>{const e=this.D_.get(t);return wd.resolve(void 0!==e&&e>n)}])}getCacheSize(e){return this.persistence.getRemoteDocumentCache().getSize(e)}}class Yg{constructor(e,t,n,s){this.targetId=e,this.fromCache=t,this.Vo=n,this.fo=s}static mo(e,t){let n=hp(),s=hp();for(const e of t.docChanges)switch(e.type){case 0:n=n.add(e.doc.key);break;case 1:s=s.add(e.doc.key)}return new Yg(e,t.fromCache,n,s)}}function Xg(e,t){return Al.comparator(e.key,t.key)}class Zg{constructor(){this._documentReadCount=0}get documentReadCount(){return this._documentReadCount}incrementDocumentReadCount(e){this._documentReadCount+=e}}class em{constructor(){this.po=!1,this.yo=!1,this.wo=100,this.bo=Gn()?8:function(e){const t=e.match(/Android ([\d.]+)/i),n=t?t[1].split(".").slice(0,2).join("."):"-1";return Number(n)}(Pn())>0?6:4}initialize(e,t){this.So=e,this.indexManager=t,this.po=!0}getDocumentsMatchingQuery(e,t,n,s){const r={result:null};return this.vo(e,t).next(e=>{r.result=e}).next(()=>{if(!r.result)return this.Do(e,t,s,n).next(e=>{r.result=e})}).next(()=>{if(r.result)return;const n=new Zg;return this.xo(e,t,n).next(s=>{if(r.result=s,this.yo)return this.Co(e,t,n,s.size)})}).next(()=>r.result)}Co(e,t,n,s){return gg(t)?wd.resolve():n.documentReadCount<this.wo?(Qc()<=as.DEBUG&&Wc("QueryEngine","SDK will not create cache indexes for query:",Kh(t),"since it only creates cache indexes for collection contains","more than or equal to",this.wo,"documents"),wd.resolve()):(Qc()<=as.DEBUG&&Wc("QueryEngine","Query:",Kh(t),"scans",n.documentReadCount,"local documents and returns",s,"documents as results."),n.documentReadCount>this.bo*s?(Qc()<=as.DEBUG&&Wc("QueryEngine","The SDK decides to create cache indexes for query:",Kh(t),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(e,qh(t))):wd.resolve())}vo(e,t){if(gg(t))return wd.resolve(null);let n=t;if($h(n))return wd.resolve(null);let s=qh(n);return this.indexManager.getIndexType(e,s).next(t=>0===t?null:(null!==n.limit&&1===t&&(n=zh(n,null,"F"),s=qh(n)),this.indexManager.getDocumentsMatchingTarget(e,s).next(t=>{const r=hp(...t);return this.So.getDocuments(e,r).next(t=>this.indexManager.getMinOffset(e,s).next(s=>{const i=this.Fo(n,t);return this.Oo(n,i,r,s.readTime)?this.vo(e,zh(n,null,"F")):this.Mo(e,i,n,s)}))})))}Do(e,t,n,s){return(gg(t)?function(e){for(const t of e.stages){if(t instanceof gf||t instanceof mf)return!1;if(t instanceof Cf){if(t.condition instanceof sf&&"exists"===t.condition._expr.name&&t.condition._expr.params[0]instanceof Yd&&t.condition._expr.params[0].fieldName===wl)continue;return!1}}return!0}(t):$h(t))||s.isEqual(Lh.min())?wd.resolve(null):this.So.getDocuments(e,n).next(r=>{const i=this.Fo(t,r);return this.Oo(t,i,n,s)?wd.resolve(null):(Qc()<=as.DEBUG&&Wc("QueryEngine","Re-using previous result from %s to execute query: %s",s.toString(),mg(t)),this.Mo(e,i,t,function(e,t){const n=e.toTimestamp().seconds,s=e.toTimestamp().nanoseconds+1,r=Lh.fromTimestamp(1e9===s?new Pl(n+1,0):new Pl(n,s));return new Ph(r,Al.empty(),t)}(s,-1)).next(e=>e))})}Fo(e,t){let n,s;return gg(e)?(n=new fl(Xg),s=t=>kg(e,t)):(n=new fl(Wh(e)),s=t=>Qh(e,t)),t.forEach((e,t)=>{s(t)&&(n=n.add(t))}),n}Oo(e,t,n,s){if(gg(e))return function(e){return e.stages.some(e=>e instanceof gf||e instanceof mf)}(e);if(null===e.limit)return!1;if(n.size!==t.size)return!0;const r="F"===e.limitType?t.last():t.first();return!!r&&(r.hasPendingWrites||r.version.compareTo(s)>0)}xo(e,t,n){return Qc()<=as.DEBUG&&Wc("QueryEngine","Using full collection scan to execute query:",mg(t)),this.So.getDocumentsMatchingQuery(e,t,Ph.min(),n)}Mo(e,t,n,s){return this.So.getDocumentsMatchingQuery(e,n,s).next(e=>(t.forEach(t=>{e=e.insert(t.key,t)}),e))}}class tm{constructor(e,t,n,s){this.persistence=e,this.No=t,this.serializer=s,this.Lo=new hl(al),this.Bo=new tp(e=>yg(e),Dg),this.Uo=new Map,this.ko=e.getRemoteDocumentCache(),this.V_=e.getTargetCache(),this.f_=e.getBundleCache(),this.qo(n)}qo(e){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(e),this.indexManager=this.persistence.getIndexManager(e),this.mutationQueue=this.persistence.getMutationQueue(e,this.indexManager),this.localDocuments=new Pg(this.ko,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.ko.setIndexManager(this.indexManager),this.No.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",t=>e.collect(t,this.Lo))}}async function nm(e,t){const n=sl(e);return await n.persistence.runTransaction("Handle user change","readonly",e=>{let s;return n.mutationQueue.getAllMutationBatches(e).next(r=>(s=r,n.qo(t),n.mutationQueue.getAllMutationBatches(e))).next(t=>{const r=[],i=[];let a=hp();for(const e of s){r.push(e.batchId);for(const t of e.mutations)a=a.add(t.key)}for(const e of t){i.push(e.batchId);for(const t of e.mutations)a=a.add(t.key)}return n.localDocuments.getDocuments(e,a).next(e=>({$o:e,removedBatchIds:r,addedBatchIds:i}))})})}function sm(e,t){const n=sl(e);return n.persistence.runTransaction("Get next mutation batch","readonly",e=>(void 0===t&&(t=-1),n.mutationQueue.getNextMutationBatchAfterBatchId(e,t)))}class rm{constructor(e,t){this.asyncQueue=e,this.onlineStateHandler=t,this.state="Unknown",this.Yo=0,this.Zo=null,this.Xo=!0}ea(){0===this.Yo&&(this.ta("Unknown"),this.Zo=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,()=>(this.Zo=null,this.na("Backend didn't respond within 10 seconds."),this.ta("Offline"),Promise.resolve())))}ra(e){"Online"===this.state?this.ta("Unknown"):(this.Yo++,this.Yo>=1&&(this.ia(),this.na(`Connection failed 1 times. Most recent error: ${e.toString()}`),this.ta("Offline")))}set(e){this.ia(),this.Yo=0,"Online"===e&&(this.Xo=!1),this.ta(e)}ta(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))}na(e){const t=`Could not reach Cloud Firestore backend. ${e}\nThis 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.Xo?(Yc(t),this.Xo=!1):Wc("OnlineStateTracker",t)}ia(){null!==this.Zo&&(this.Zo.cancel(),this.Zo=null)}}const im="RemoteStore";class am{constructor(e,t,n,s,r){this.localStore=e,this.datastore=t,this.asyncQueue=n,this.remoteSyncer={},this.sa=[],this._a=new Map,this.oa=new Map,this.aa=new Map,this.ua=new Rg(1e3),this.ca=new Rg(1001),this.la=new Set,this.Ea=[],this.ha=r,this.ha.Qe(e=>{n.enqueueAndForget(async()=>{cm(this)&&(Wc(im,"Restarting streams for network reachability change."),await async function(e){const t=sl(e);t.la.add(4),await Bm(t),t.Ta.set("Unknown"),t.la.delete(4),await om(t)}(this))})}),this.Ta=new rm(n,s)}}async function om(e){if(cm(e))for(const t of e.Ea)await t(!0)}async function Bm(e){for(const t of e.Ea)await t(!1)}function cm(e){return 0===sl(e).la.size}async function lm(e,t,n){if(!Ed(t))throw t;e.la.add(1),await Bm(e),e.Ta.set("Offline"),n||(n=()=>function(e){const t=sl(e);return t.persistence.runTransaction("Get last remote snapshot version","readonly",e=>t.V_.getLastRemoteSnapshotVersion(e))}(e.localStore)),e.asyncQueue.enqueueRetryable(async()=>{Wc(im,"Retrying IndexedDB access"),await n(),e.la.delete(1),await om(e)})}function um(e,t){return t().catch(n=>lm(e,n,t))}async function hm(e){const t=sl(e),n=Dm(t);let s=t.sa.length>0?t.sa[t.sa.length-1].batchId:-1;for(;pm(t);)try{const e=await sm(t.localStore,s);if(null===e){0===t.sa.length&&n.en();break}s=e.batchId,dm(t,e)}catch(e){await lm(t,e)}fm(t)&&Cm(t)}function pm(e){return cm(e)&&e.sa.length<10}function dm(e,t){e.sa.push(t);const n=Dm(e);n.Yt()&&n.Rn&&n.An(t.mutations)}function fm(e){return cm(e)&&!Dm(e).Jt()&&e.sa.length>0}function Cm(e){Dm(e).start()}async function gm(e){Dm(e).fn()}async function mm(e){const t=Dm(e);for(const n of e.sa)t.An(n.mutations)}async function wm(e,t,n){const s=e.sa.shift(),r=bg.from(s,t,n);await um(e,()=>e.remoteSyncer.applySuccessfulWrite(r)),await hm(e)}async function Em(e,t){t&&Dm(e).Rn&&await async function(e,t){if(function(e){return function(e){switch(e){case gl.OK:return el(64938);case gl.CANCELLED:case gl.UNKNOWN:case gl.DEADLINE_EXCEEDED:case gl.RESOURCE_EXHAUSTED:case gl.INTERNAL:case gl.UNAVAILABLE:case gl.UNAUTHENTICATED:return!1;case gl.INVALID_ARGUMENT:case gl.NOT_FOUND:case gl.ALREADY_EXISTS:case gl.PERMISSION_DENIED:case gl.FAILED_PRECONDITION:case gl.ABORTED:case gl.OUT_OF_RANGE:case gl.UNIMPLEMENTED:case gl.DATA_LOSS:return!0;default:return el(15467,{code:e})}}(e)&&e!==gl.ABORTED}(t.code)){const n=e.sa.shift();Dm(e).Xt(),await um(e,()=>e.remoteSyncer.rejectFailedWrite(n.batchId,t)),await hm(e)}}(e,t),fm(e)&&Cm(e)}async function ym(e,t){const n=sl(e);n.asyncQueue.verifyOperationInProgress(),Wc(im,"RemoteStore received new credentials");const s=cm(n);n.la.add(3),await Bm(n),s&&n.Ta.set("Unknown"),await n.remoteSyncer.handleCredentialChange(t),n.la.delete(3),await om(n)}function Dm(e){return e.Ra||(e.Ra=function(e,t,n){const s=sl(e);return s.pn(),new cd(t,s.connection,s.authCredentials,s.appCheckCredentials,s.serializer,n)}(e.datastore,e.asyncQueue,{ct:()=>Promise.resolve(),Et:gm.bind(null,e),Tt:Em.bind(null,e),Vn:mm.bind(null,e),dn:wm.bind(null,e)}),e.Ea.push(async t=>{t?(e.Ra.Xt(),await hm(e)):(await e.Ra.stop(),e.sa.length>0&&(Wc(im,`Stopping write stream with ${e.sa.length} pending writes`),e.sa=[]))})),e.Ra}class _m{constructor(e,t,n,s,r){this.asyncQueue=e,this.timerId=t,this.targetTimeMs=n,this.op=s,this.removalCallback=r,this.deferred=new Mp,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(e=>{})}get promise(){return this.deferred.promise}static createAndSchedule(e,t,n,s,r){const i=Date.now()+n,a=new _m(e,t,i,s,r);return a.start(n),a}start(e){this.timerHandle=setTimeout(()=>this.handleDelayElapsed(),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){null!==this.timerHandle&&(this.clearTimeout(),this.deferred.reject(new ml(gl.CANCELLED,"Operation cancelled"+(e?": "+e:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget(()=>null!==this.timerHandle?(this.clearTimeout(),this.op().then(e=>this.deferred.resolve(e))):Promise.resolve())}clearTimeout(){null!==this.timerHandle&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}}function bm(e,t){if(Yc("AsyncQueue",`${t}: ${e}`),Ed(e))return new ml(gl.UNAVAILABLE,`${t}: ${e}`);throw e}class vm{constructor(){this.activeTargetIds=pp}Ba(e){this.activeTargetIds=this.activeTargetIds.add(e)}Ua(e){this.activeTargetIds=this.activeTargetIds.delete(e)}La(){const e={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(e)}}class Im{constructor(){this.fu=new vm,this.mu={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,t,n){}addLocalQueryTarget(e,t=!0){return t&&this.fu.Ba(e),this.mu[e]||"not-current"}updateQueryState(e,t,n){this.mu[e]=t}removeLocalQueryTarget(e){this.fu.Ua(e)}isLocalQueryTarget(e){return this.fu.activeTargetIds.has(e)}clearQueryState(e){delete this.mu[e]}getAllActiveQueryTargets(){return this.fu.activeTargetIds}isActiveQueryTarget(e){return this.fu.activeTargetIds.has(e)}start(){return this.fu=new vm,Promise.resolve()}handleUserChange(e,t,n){}setOnlineState(e){}shutdown(){}writeSequenceNumber(e){}notifyBundleLoaded(e){}}function Tm(){return"undefined"!=typeof document?document:null}class Am{constructor(){this.queries=Om(),this.onlineState="Unknown",this.Du=new Set}terminate(){!function(e,t){const n=sl(e),s=n.queries;n.queries=Om(),s.forEach((e,n)=>{for(const e of n.bu)e.onError(t)})}(this,new ml(gl.ABORTED,"Firestore shutting down"))}}function Om(){return new tp(e=>wg(e),Eg)}var Sm;!function(e){e.Default="default",e.Cache="cache"}(Sm||(Sm={}));class Nm{constructor(e,t,n,s,r,i){this.localStore=e,this.remoteStore=t,this.eventManager=n,this.sharedClientState=s,this.currentUser=r,this.maxConcurrentLimboResolutions=i,this.hc={},this.Tc=new tp(e=>wg(e),Eg),this.Pc=new Map,this.Ic=new Set,this.Rc=new hl(Al.comparator),this.Ac=new Map,this.Vc=new Hg,this.dc={},this.fc=new Map,this.mc=Rg.bs(),this.onlineState="Unknown",this.gc=void 0}get isPrimaryClient(){return!0===this.gc}}async function Rm(e,t,n){const s=function(e){const t=sl(e);return t.remoteStore.remoteSyncer.applySuccessfulWrite=Lm.bind(null,t),t.remoteStore.remoteSyncer.rejectFailedWrite=xm.bind(null,t),t}(e);try{const e=await function(e,t){const n=sl(e),s=Pl.now(),r=t.reduce((e,t)=>e.add(t.key),hp());let i,a;return n.persistence.runTransaction("Locally write mutations","readwrite",e=>{let o=sp(),B=hp();return n.ko.getEntries(e,r).next(e=>{o=e,o.forEach((e,t)=>{t.isValidDocument()||(B=B.add(e))})}).next(()=>n.localDocuments.getOverlayedDocuments(e,o)).next(r=>{i=r;const a=[];for(const e of t){const t=rh(e,i.get(e.key).overlayedDocument);null!=t&&a.push(new oh(e.key,t,Nu(t.value.mapValue),Xu.exists(!0)))}return n.mutationQueue.addMutationBatch(e,s,a,t)}).next(t=>{a=t;const s=t.applyToLocalDocumentSet(i,B);return n.documentOverlayCache.saveOverlays(e,t.batchId,s)})}).then(()=>({batchId:a.batchId,changes:ap(i)}))}(s.localStore,t);s.sharedClientState.addPendingMutation(e.batchId),function(e,t,n){let s=e.dc[e.currentUser.toKey()];s||(s=new hl(al)),s=s.insert(t,n),e.dc[e.currentUser.toKey()]=s}(s,e.batchId,n),await Mm(s,e.changes),await hm(s.remoteStore)}catch(e){const t=bm(e,"Failed to persist write");n.reject(t)}}function km(e,t,n){const s=sl(e);if(s.isPrimaryClient&&0===n||!s.isPrimaryClient&&1===n){const e=[];s.Tc.forEach((n,s)=>{const r=s.view.xu(t);r.snapshot&&e.push(r.snapshot)}),function(e,t){const n=sl(e);n.onlineState=t;let s=!1;n.queries.forEach((e,n)=>{for(const e of n.bu)e.xu(t)&&(s=!0)}),s&&function(e){e.Du.forEach(e=>{e.next()})}(n)}(s.eventManager,t),e.length&&s.hc.Tn(e),s.onlineState=t,s.isPrimaryClient&&s.sharedClientState.setOnlineState(t)}}async function Lm(e,t){const n=sl(e),s=t.batch.batchId;try{const e=await function(e,t){const n=sl(e);return n.persistence.runTransaction("Acknowledge batch","readwrite-primary",e=>{const s=t.batch.keys(),r=n.ko.newChangeBuffer({trackRemovals:!0});return function(e,t,n,s){const r=n.batch,i=r.keys();let a=wd.resolve();return i.forEach(e=>{a=a.next(()=>s.getEntry(t,e)).next(t=>{const i=n.docVersions.get(e);nl(null!==i,48541),t.version.compareTo(i)<0&&(r.applyToRemoteDocument(t,n),t.isValidDocument()&&(t.setReadTime(n.commitVersion),s.addEntry(t)))})}),a.next(()=>e.mutationQueue.removeMutationBatch(t,r))}(n,e,t,r).next(()=>r.apply(e)).next(()=>n.mutationQueue.performConsistencyCheck(e)).next(()=>n.documentOverlayCache.removeOverlaysForBatchId(e,s,t.batch.batchId)).next(()=>n.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(e,function(e){let t=hp();for(let n=0;n<e.mutationResults.length;++n)e.mutationResults[n].transformResults.length>0&&(t=t.add(e.batch.mutations[n].key));return t}(t))).next(()=>n.localDocuments.getDocuments(e,s))})}(n.localStore,t);Pm(n,s,null),Fm(n,s),n.sharedClientState.updateMutationState(s,"acknowledged"),await Mm(n,e)}catch(e){await md(e)}}async function xm(e,t,n){const s=sl(e);try{const e=await function(e,t){const n=sl(e);return n.persistence.runTransaction("Reject batch","readwrite-primary",e=>{let s;return n.mutationQueue.lookupMutationBatch(e,t).next(t=>(nl(null!==t,37113),s=t.keys(),n.mutationQueue.removeMutationBatch(e,t))).next(()=>n.mutationQueue.performConsistencyCheck(e)).next(()=>n.documentOverlayCache.removeOverlaysForBatchId(e,s,t)).next(()=>n.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(e,s)).next(()=>n.localDocuments.getDocuments(e,s))})}(s.localStore,t);Pm(s,t,n),Fm(s,t),s.sharedClientState.updateMutationState(t,"rejected",n),await Mm(s,e)}catch(n){await md(n)}}function Fm(e,t){(e.fc.get(t)||[]).forEach(e=>{e.resolve()}),e.fc.delete(t)}function Pm(e,t,n){const s=sl(e);let r=s.dc[s.currentUser.toKey()];if(r){const e=r.get(t);e&&(n?e.reject(n):e.resolve(),r=r.remove(t)),s.dc[s.currentUser.toKey()]=r}}async function Mm(e,t,n){const s=sl(e),r=[],i=[],a=[];s.Tc.isEmpty()||(s.Tc.forEach((e,o)=>{a.push(s.yc(o,t,n).then(e=>{if((e||n)&&s.isPrimaryClient){const t=e?!e.fromCache:n?.targetChanges.get(o.targetId)?.current;s.sharedClientState.updateQueryState(o.targetId,t?"current":"not-current")}if(e){r.push(e);const t=Yg.mo(o.targetId,e);i.push(t)}}))}),await Promise.all(a),s.hc.Tn(r),await async function(e,t){const n=sl(e);try{await n.persistence.runTransaction("notifyLocalViewChanges","readwrite",e=>wd.forEach(t,t=>wd.forEach(t.Vo,s=>n.persistence.referenceDelegate.addReference(e,t.targetId,s)).next(()=>wd.forEach(t.fo,s=>n.persistence.referenceDelegate.removeReference(e,t.targetId,s)))))}catch(e){if(!Ed(e))throw e;Wc("LocalStore","Failed to update sequence numbers: "+e)}for(const e of t){const t=e.targetId;if(!e.fromCache){const e=n.Lo.get(t),s=e.snapshotVersion,r=e.withLastLimboFreeSnapshotVersion(s);n.Lo=n.Lo.insert(t,r)}}}(s.localStore,i))}async function Gm(e,t){const n=sl(e);if(!n.currentUser.isEqual(t)){Wc("SyncEngine","User change. New user:",t.toKey());const e=await nm(n.localStore,t);n.currentUser=t,function(e,t){e.fc.forEach(e=>{e.forEach(e=>{e.reject(new ml(gl.CANCELLED,t))})}),e.fc.clear()}(n,"'waitForPendingWrites' promise is rejected due to a user change."),n.sharedClientState.handleUserChange(t,e.removedBatchIds,e.addedBatchIds),await Mm(n,e.$o)}}class Um{constructor(){this.kind="memory",this.synchronizeTabs=!1}async initialize(e){this.serializer=Rp(e.databaseInfo.databaseId),this.sharedClientState=this.vc(e),this.persistence=this.Dc(e),await this.persistence.start(),this.localStore=this.xc(e),this.gcScheduler=this.Cc(e,this.localStore),this.indexBackfillerScheduler=this.Fc(e,this.localStore)}Cc(e,t){return null}Fc(e,t){return null}xc(e){return function(e,t,n,s){return new tm(e,t,n,s)}(this.persistence,new em,e.initialUser,this.serializer)}Dc(e){return new zg(Qg.b_,this.serializer)}vc(e){return new Im}async terminate(){this.gcScheduler?.stop(),this.indexBackfillerScheduler?.stop(),this.sharedClientState.shutdown(),await this.persistence.shutdown()}}Um.provider={build:()=>new Um};class Hm extends Um{constructor(e){super(),this.cacheSizeBytes=e}Cc(e,t){nl(this.persistence.referenceDelegate instanceof Wg,46915);const n=this.persistence.referenceDelegate.garbageCollector;return new bd(n,e.asyncQueue,t)}Dc(e){const t=void 0!==this.cacheSizeBytes?fd.withCacheSize(this.cacheSizeBytes):fd.DEFAULT;return new zg(e=>Wg.b_(e,t),this.serializer)}}class Vm{async initialize(e,t){this.localStore||(this.localStore=e.localStore,this.sharedClientState=e.sharedClientState,this.datastore=this.createDatastore(t),this.remoteStore=this.createRemoteStore(t),this.eventManager=this.createEventManager(t),this.syncEngine=this.createSyncEngine(t,!e.synchronizeTabs),this.sharedClientState.onlineStateHandler=e=>km(this.syncEngine,e,1),this.remoteStore.remoteSyncer.handleCredentialChange=Gm.bind(null,this.syncEngine),await async function(e,t){const n=sl(e);t?(n.la.delete(2),await om(n)):t||(n.la.add(2),await Bm(n),n.Ta.set("Unknown"))}(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(e){return new Am}createDatastore(e){const t=Rp(e.databaseInfo.databaseId),n=function(e){return new id(e)}(e.databaseInfo);return function(e,t,n,s){return new ud(e,t,n,s)}(e.authCredentials,e.appCheckCredentials,n,t)}createRemoteStore(e){return function(e,t,n,s,r){return new am(e,t,n,s,r)}(this.localStore,this.datastore,e.asyncQueue,e=>km(this.syncEngine,e,0),Wp.Ye()?new Wp:new Kp)}createSyncEngine(e,t){return function(e,t,n,s,r,i,a){const o=new Nm(e,t,n,s,r,i);return a&&(o.gc=!0),o}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,e.initialUser,e.maxConcurrentLimboResolutions,t)}async terminate(){await async function(e){const t=sl(e);Wc(im,"RemoteStore shutting down."),t.la.add(5),await Bm(t),t.ha.shutdown(),t.Ta.set("Unknown")}(this.remoteStore),this.datastore?.terminate(),this.eventManager?.terminate()}}Vm.provider={build:()=>new Vm};const jm="FirestoreClient";class $m{constructor(e,t,n,s,r){this.authCredentials=e,this.appCheckCredentials=t,this.asyncQueue=n,this._databaseInfo=s,this.user=Pp.UNAUTHENTICATED,this.clientId=il.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this._uninitializedComponentsProvider=r,this.authCredentials.start(n,async e=>{Wc(jm,"Received user=",e.uid),await this.authCredentialListener(e),this.user=e}),this.appCheckCredentials.start(n,e=>(Wc(jm,"Received new app check token=",e),this.appCheckCredentialListener(e,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 Mp;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted(async()=>{try{this._onlineComponents&&await this._onlineComponents.terminate(),this._offlineComponents&&await this._offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),e.resolve()}catch(t){const n=bm(t,"Failed to shutdown persistence");e.reject(n)}}),e.promise}}async function Jm(e,t){e.asyncQueue.verifyOperationInProgress(),Wc(jm,"Initializing OfflineComponentProvider");const n=e.configuration;await t.initialize(n);let s=n.initialUser;e.setCredentialChangeListener(async e=>{s.isEqual(e)||(await nm(t.localStore,e),s=e)}),t.persistence.setDatabaseDeletedListener(()=>e.terminate()),e._offlineComponents=t}async function qm(e,t){e.asyncQueue.verifyOperationInProgress();const n=await async function(e){if(!e._offlineComponents)if(e._uninitializedComponentsProvider){Wc(jm,"Using user provided OfflineComponentProvider");try{await Jm(e,e._uninitializedComponentsProvider._offline)}catch(t){const n=t;if(!function(e){return"FirebaseError"===e.name?e.code===gl.FAILED_PRECONDITION||e.code===gl.UNIMPLEMENTED:!("undefined"!=typeof DOMException&&e instanceof DOMException)||22===e.code||20===e.code||11===e.code}(n))throw n;Xc("Error using user provided cache. Falling back to memory cache: "+n),await Jm(e,new Um)}}else Wc(jm,"Using default OfflineComponentProvider"),await Jm(e,new Hm(void 0));return e._offlineComponents}(e);Wc(jm,"Initializing OnlineComponentProvider"),await t.initialize(n,e.configuration),e.setCredentialChangeListener(e=>ym(t.remoteStore,e)),e.setAppCheckTokenChangeListener((e,n)=>ym(t.remoteStore,n)),e._onlineComponents=t}function zm(e){return async function(e){return e._onlineComponents||(e._uninitializedComponentsProvider?(Wc(jm,"Using user provided OnlineComponentProvider"),await qm(e,e._uninitializedComponentsProvider._online)):(Wc(jm,"Using default OnlineComponentProvider"),await qm(e,new Vm))),e._onlineComponents}(e).then(e=>e.syncEngine)}let Km=class{constructor(e,t,n,s,r){this._firestore=e,this._userDataWriter=t,this._key=n,this._document=s,this._converter=r}get id(){return this._key.path.lastSegment()}get ref(){return new Rd(this._firestore,this._converter,this._key)}exists(){return null!==this._document}data(){if(this._document){if(this._converter){const e=new Qm(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(e)}return this._userDataWriter.convertValue(this._document.data.value)}}_fieldsProto(){return this._document?.data.clone().value.mapValue.fields??void 0}get(e){if(this._document){const t=this._document.data.field(Gd("DocumentSnapshot.get",e));if(null!==t)return this._userDataWriter.convertValue(t)}}},Qm=class extends Km{data(){return super.data()}};const Wm="AsyncQueue";class Ym{constructor(e=Promise.resolve()){this.$c=[],this.Kc=!1,this.Qc=[],this.Wc=null,this.Gc=!1,this.zc=!1,this.jc=[],this.Ht=new ad(this,"async_queue_retry"),this.Hc=()=>{const e=Tm();e&&Wc(Wm,"Visibility state changed to "+e.visibilityState),this.Ht.$t()},this.Jc=e;const t=Tm();t&&"function"==typeof t.addEventListener&&t.addEventListener("visibilitychange",this.Hc)}get isShuttingDown(){return this.Kc}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.Yc(),this.Zc(e)}enterRestrictedMode(e){if(!this.Kc){this.Kc=!0,this.zc=e||!1;const t=Tm();t&&"function"==typeof t.removeEventListener&&t.removeEventListener("visibilitychange",this.Hc)}}enqueue(e){if(this.Yc(),this.Kc)return new Promise(()=>{});const t=new Mp;return this.Zc(()=>this.Kc&&this.zc?Promise.resolve():(e().then(t.resolve,t.reject),t.promise)).then(()=>t.promise)}enqueueRetryable(e){this.enqueueAndForget(()=>(this.$c.push(e),this.Xc()))}async Xc(){if(0!==this.$c.length){try{await this.$c[0](),this.$c.shift(),this.Ht.reset()}catch(e){if(!Ed(e))throw e;Wc(Wm,"Operation failed with retryable error: "+e)}this.$c.length>0&&this.Ht.kt(()=>this.Xc())}}Zc(e){const t=this.Jc.then(()=>(this.Gc=!0,e().catch(e=>{throw this.Wc=e,this.Gc=!1,Yc("INTERNAL UNHANDLED ERROR: ",Xm(e)),e}).then(e=>(this.Gc=!1,e))));return this.Jc=t,t}enqueueAfterDelay(e,t,n){this.Yc(),this.jc.indexOf(e)>-1&&(t=0);const s=_m.createAndSchedule(this,e,t,n,e=>this.el(e));return this.Qc.push(s),s}Yc(){this.Wc&&el(47125,{tl:Xm(this.Wc)})}verifyOperationInProgress(){}async nl(){let e;do{e=this.Jc,await e}while(e!==this.Jc)}rl(e){for(const t of this.Qc)if(t.timerId===e)return!0;return!1}il(e){return this.nl().then(()=>{this.Qc.sort((e,t)=>e.targetTimeMs-t.targetTimeMs);for(const t of this.Qc)if(t.skipDelay(),"all"!==e&&t.timerId===e)break;return this.nl()})}sl(e){this.jc.push(e)}el(e){const t=this.Qc.indexOf(e);this.Qc.splice(t,1)}}function Xm(e){let t=e.message||"";return e.stack&&(t=e.stack.includes(e.message)?e.stack:e.message+"\n"+e.stack),t}class Zm extends Od{constructor(e,t,n,s){super(e,t,n,s),this.type="firestore",this._queue=new Ym,this._persistenceKey=s?.name||"[DEFAULT]"}async _terminate(){if(this._firestoreClient){const e=this._firestoreClient.terminate();this._queue=new Ym(e),this._firestoreClient=void 0,await e}}}function ew(e){if(e._terminated)throw new ml(gl.FAILED_PRECONDITION,"The client has already been terminated.");return e._firestoreClient||function(e){const t=e._freezeSettings(),n=function(e,t,n,s,r){return new Yl(e,t,n,r.host,r.ssl,r.experimentalForceLongPolling,r.experimentalAutoDetectLongPolling,zp(r.experimentalLongPollingOptions),r.useFetchStreams,r.isUsingEmulator,s,r._customHeaders,r.grpcFlowControlWindow)}(e._databaseId,e._app?.options.appId||"",e._persistenceKey,e._app?.options.apiKey,t);e._componentsProvider||t.localCache?._offlineComponentProvider&&t.localCache?._onlineComponentProvider&&(e._componentsProvider={_offline:t.localCache._offlineComponentProvider,_online:t.localCache._onlineComponentProvider}),e._firestoreClient=new $m(e._authCredentials,e._appCheckCredentials,e._queue,n,e._componentsProvider&&function(e){const t=e?._online.build();return{_offline:e?._offline.build(t),_online:t}}(e._componentsProvider))}(e),e._firestoreClient}class tw{constructor(e,t){this.hasPendingWrites=e,this.fromCache=t}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}}class nw extends Km{constructor(e,t,n,s,r,i){super(e,t,n,s,i),this._firestore=e,this._firestoreImpl=e,this.metadata=r}exists(){return super.exists()}data(e={}){if(this._document){if(this._converter){const t=new sw(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(t,e)}return this._userDataWriter.convertValue(this._document.data.value,e.serverTimestamps)}}get(e,t={}){if(this._document){const n=this._document.data.field(Gd("DocumentSnapshot.get",e));if(null!==n)return this._userDataWriter.convertValue(n,t.serverTimestamps)}}toJSON(){if(this.metadata.hasPendingWrites)throw new ml(gl.FAILED_PRECONDITION,"DocumentSnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");const e=this._document,t={};return t.type=nw._jsonSchemaVersion,t.bundle="",t.bundleSource="DocumentSnapshot",t.bundleName=this._key.toString(),e&&e.isValidDocument()&&e.isFoundDocument()?(this._userDataWriter.convertObjectMap(e.data.value.mapValue.fields,"previous"),t.bundle=(this._firestore,this.ref.path,"NOT SUPPORTED"),t):t}}nw._jsonSchemaVersion="firestore/documentSnapshot/1.0",nw._jsonSchema={type:kl("string",nw._jsonSchemaVersion),bundleSource:kl("string","DocumentSnapshot"),bundleName:kl("string"),bundle:kl("string")};class sw extends nw{data(e={}){return super.data(e)}}class rw{constructor(e,t,n,s){this._firestore=e,this._userDataWriter=t,this._snapshot=s,this.metadata=new tw(s.hasPendingWrites,s.fromCache),this.query=n}get docs(){const e=[];return this.forEach(t=>e.push(t)),e}get size(){return this._snapshot.docs.size}get empty(){return 0===this.size}forEach(e,t){this._snapshot.docs.forEach(n=>{e.call(t,new sw(this._firestore,this._userDataWriter,n.key,n,new tw(this._snapshot.mutatedKeys.has(n.key),this._snapshot.fromCache),this.query.converter))})}docChanges(e={}){const t=!!e.includeMetadataChanges;if(t&&this._snapshot.excludesMetadataChanges)throw new ml(gl.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===t||(this._cachedChanges=function(e,t){if(e._snapshot.oldDocs.isEmpty()){let t=0;return e._snapshot.docChanges.map(n=>{gg(e._snapshot.query)?function(e){const t=function(e){for(let t=e.stages.length-1;t>=0;t--){const n=e.stages[t];if(n instanceof Ef)return n.orderings}throw new Error("Pipeline must contain at least one Sort stage")}(e)}(e._snapshot.query):Wh(e.query._query);const s=new sw(e._firestore,e._userDataWriter,n.doc.key,n.doc,new tw(e._snapshot.mutatedKeys.has(n.doc.key),e._snapshot.fromCache),e.query.converter);return n.doc,{type:"added",doc:s,oldIndex:-1,newIndex:t++}})}{let n=e._snapshot.oldDocs;return e._snapshot.docChanges.filter(e=>t||3!==e.type).map(t=>{const s=new sw(e._firestore,e._userDataWriter,t.doc.key,t.doc,new tw(e._snapshot.mutatedKeys.has(t.doc.key),e._snapshot.fromCache),e.query.converter);let r=-1,i=-1;return 0!==t.type&&(r=n.indexOf(t.doc.key),n=n.delete(t.doc.key)),1!==t.type&&(n=n.add(t.doc),i=n.indexOf(t.doc.key)),{type:iw(t.type),doc:s,oldIndex:r,newIndex:i}})}}(this,t),this._cachedChangesIncludeMetadataChanges=t),this._cachedChanges}toJSON(){if(this.metadata.hasPendingWrites)throw new ml(gl.FAILED_PRECONDITION,"QuerySnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");const e={};e.type=rw._jsonSchemaVersion,e.bundleSource="QuerySnapshot",e.bundleName=il.newId(),this._firestore._databaseId.database,this._firestore._databaseId.projectId;const t=[],n=[],s=[];return this.docs.forEach(e=>{null!==e._document&&(t.push(e._document),n.push(this._userDataWriter.convertObjectMap(e._document.data.value.mapValue.fields,"previous")),s.push(e.ref.path))}),e.bundle=(this._firestore,this.query._query,e.bundleName,"NOT SUPPORTED"),e}}function iw(e){switch(e){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return el(61501,{type:e})}}function aw(e){return function(e,t){const n=ew(e);return function(e,t){const n=new Mp;return e.asyncQueue.enqueueAndForget(async()=>Rm(await zm(e),t,n)),n.promise}(n,t)}(Rl(e.firestore,Zm),[new uh(e._key,Xu.none())])}rw._jsonSchemaVersion="firestore/querySnapshot/1.0",rw._jsonSchema={type:kl("string",rw._jsonSchemaVersion),bundleSource:kl("string","QuerySnapshot"),bundleName:kl("string"),bundle:kl("string")};const ow="@firebase/firestore",Bw="4.17.2";!function(e,t=!0){(function(e){zc=e})(Cr),ur(new ns("firestore",(e,{instanceIdentifier:n,options:s})=>{const r=e.getProvider("app").getImmediate(),i=new Zm(new Vp(e.getProvider("auth-internal")),new qp(r,e.getProvider("app-check-internal")),eu(r,n),r);return s={useFetchStreams:t,...s},i._setSettings(s),i},"PUBLIC").setMultipleInstances(!0)),wr(ow,Bw,e),wr(ow,Bw,"esm2020")}();const cw="firebasestorage.googleapis.com",lw="storageBucket";class uw extends jn{constructor(e,t,n=0){super(dw(e),`Firebase Storage: ${t} (${dw(e)})`),this.status_=n,this.customData={serverResponse:null},this._baseMessage=this.message,Object.setPrototypeOf(this,uw.prototype)}get status(){return this.status_}set status(e){this.status_=e}_codeEquals(e){return dw(e)===this.code}get serverResponse(){return this.customData.serverResponse}set serverResponse(e){this.customData.serverResponse=e,this.customData.serverResponse?this.message=`${this._baseMessage}\n${this.customData.serverResponse}`:this.message=this._baseMessage}}var hw,pw;function dw(e){return"storage/"+e}function fw(){return new uw(hw.UNKNOWN,"An unknown error occurred, please check the error payload for server response.")}function Cw(){return new uw(hw.RETRY_LIMIT_EXCEEDED,"Max retry time for operation exceeded, please try again.")}function gw(){return new uw(hw.CANCELED,"User canceled the upload/download.")}function mw(){return new uw(hw.CANNOT_SLICE_BLOB,"Cannot slice blob for upload. Please retry the upload.")}function ww(e){return new uw(hw.INVALID_ARGUMENT,e)}function Ew(){return new uw(hw.APP_DELETED,"The Firebase app was deleted.")}function yw(e,t){return new uw(hw.INVALID_FORMAT,"String does not match format '"+e+"': "+t)}function Dw(e){throw new uw(hw.INTERNAL_ERROR,"Internal error: "+e)}!function(e){e.UNKNOWN="unknown",e.OBJECT_NOT_FOUND="object-not-found",e.BUCKET_NOT_FOUND="bucket-not-found",e.PROJECT_NOT_FOUND="project-not-found",e.QUOTA_EXCEEDED="quota-exceeded",e.UNAUTHENTICATED="unauthenticated",e.UNAUTHORIZED="unauthorized",e.UNAUTHORIZED_APP="unauthorized-app",e.RETRY_LIMIT_EXCEEDED="retry-limit-exceeded",e.INVALID_CHECKSUM="invalid-checksum",e.CANCELED="canceled",e.INVALID_EVENT_NAME="invalid-event-name",e.INVALID_URL="invalid-url",e.INVALID_DEFAULT_BUCKET="invalid-default-bucket",e.NO_DEFAULT_BUCKET="no-default-bucket",e.CANNOT_SLICE_BLOB="cannot-slice-blob",e.SERVER_FILE_WRONG_SIZE="server-file-wrong-size",e.NO_DOWNLOAD_URL="no-download-url",e.INVALID_ARGUMENT="invalid-argument",e.INVALID_ARGUMENT_COUNT="invalid-argument-count",e.APP_DELETED="app-deleted",e.INVALID_ROOT_OPERATION="invalid-root-operation",e.INVALID_FORMAT="invalid-format",e.INTERNAL_ERROR="internal-error",e.UNSUPPORTED_ENVIRONMENT="unsupported-environment"}(hw||(hw={}));class _w{constructor(e,t){this.bucket=e,this.path_=t}get path(){return this.path_}get isRoot(){return 0===this.path.length}fullServerUrl(){const e=encodeURIComponent;return"/b/"+e(this.bucket)+"/o/"+e(this.path)}bucketOnlyServerUrl(){return"/b/"+encodeURIComponent(this.bucket)+"/o"}static makeFromBucketSpec(e,t){let n;try{n=_w.makeFromUrl(e,t)}catch(t){return new _w(e,"")}if(""===n.path)return n;throw s=e,new uw(hw.INVALID_DEFAULT_BUCKET,"Invalid default bucket '"+s+"'.");var s}static makeFromUrl(e,t){let n=null;const s="([A-Za-z0-9.\\-_]+)";const r=new RegExp("^gs://"+s+"(/(.*))?$","i");function i(e){e.path_=decodeURIComponent(e.path)}const a=t.replace(/[.]/g,"\\."),o=[{regex:r,indices:{bucket:1,path:3},postModify:function(e){"/"===e.path.charAt(e.path.length-1)&&(e.path_=e.path_.slice(0,-1))}},{regex:new RegExp(`^https?://${a}/v[A-Za-z0-9_]+/b/${s}/o(/([^?#]*).*)?$`,"i"),indices:{bucket:1,path:3},postModify:i},{regex:new RegExp(`^https?://${t===cw?"(?:storage.googleapis.com|storage.cloud.google.com)":t}/${s}/([^?#]*)`,"i"),indices:{bucket:1,path:2},postModify:i}];for(let t=0;t<o.length;t++){const s=o[t],r=s.regex.exec(e);if(r){const e=r[s.indices.bucket];let t=r[s.indices.path];t||(t=""),n=new _w(e,t),s.postModify(n);break}}if(null==n)throw function(e){return new uw(hw.INVALID_URL,"Invalid URL '"+e+"'.")}(e);return n}}class bw{constructor(e){this.promise_=Promise.reject(e)}getPromise(){return this.promise_}cancel(e=!1){}}function vw(e){return"string"==typeof e||e instanceof String}function Iw(e){return Tw()&&e instanceof Blob}function Tw(){return"undefined"!=typeof Blob}function Aw(e,t,n,s){if(s<t)throw ww(`Invalid value for '${e}'. Expected ${t} or greater.`);if(s>n)throw ww(`Invalid value for '${e}'. Expected ${n} or less.`)}function Ow(e,t,n){let s=t;return null==n&&(s=`https://${t}`),`${n}://${s}/v0${e}`}function Sw(e){const t=encodeURIComponent;let n="?";for(const s in e)if(e.hasOwnProperty(s)){n=n+(t(s)+"="+t(e[s]))+"&"}return n=n.slice(0,-1),n}function Nw(e,t){const n=e>=500&&e<600,s=-1!==[408,429].indexOf(e),r=-1!==t.indexOf(e);return n||s||r}!function(e){e[e.NO_ERROR=0]="NO_ERROR",e[e.NETWORK_ERROR=1]="NETWORK_ERROR",e[e.ABORT=2]="ABORT"}(pw||(pw={}));class Rw{constructor(e,t,n,s,r,i,a,o,B,c,l,u=!0,h=!1){this.url_=e,this.method_=t,this.headers_=n,this.body_=s,this.successCodes_=r,this.additionalRetryCodes_=i,this.callback_=a,this.errorCallback_=o,this.timeout_=B,this.progressCallback_=c,this.connectionFactory_=l,this.retry=u,this.isUsingEmulator=h,this.pendingConnection_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.promise_=new Promise((e,t)=>{this.resolve_=e,this.reject_=t,this.start_()})}start_(){const e=(e,t)=>{if(t)return void e(!1,new kw(!1,null,!0));const n=this.connectionFactory_();this.pendingConnection_=n;const s=e=>{const t=e.loaded,n=e.lengthComputable?e.total:-1;null!==this.progressCallback_&&this.progressCallback_(t,n)};null!==this.progressCallback_&&n.addUploadProgressListener(s),n.send(this.url_,this.method_,this.isUsingEmulator,this.body_,this.headers_).then(()=>{null!==this.progressCallback_&&n.removeUploadProgressListener(s),this.pendingConnection_=null;const t=n.getErrorCode()===pw.NO_ERROR,r=n.getStatus();if(!t||Nw(r,this.additionalRetryCodes_)&&this.retry){const t=n.getErrorCode()===pw.ABORT;return void e(!1,new kw(!1,null,t))}const i=-1!==this.successCodes_.indexOf(r);e(!0,new kw(i,n))})},t=(e,t)=>{const n=this.resolve_,s=this.reject_,r=t.connection;if(t.wasSuccessCode)try{const e=this.callback_(r,r.getResponse());!function(e){return void 0!==e}(e)?n():n(e)}catch(e){s(e)}else if(null!==r){const e=fw();e.serverResponse=r.getErrorText(),this.errorCallback_?s(this.errorCallback_(r,e)):s(e)}else if(t.canceled){s(this.appDelete_?Ew():gw())}else{s(Cw())}};this.canceled_?t(0,new kw(!1,null,!0)):this.backoffId_=function(e,t,n){let s=1,r=null,i=null,a=!1,o=0;function B(){return 2===o}let c=!1;function l(...e){c||(c=!0,t.apply(null,e))}function u(t){r=setTimeout(()=>{r=null,e(p,B())},t)}function h(){i&&clearTimeout(i)}function p(e,...t){if(c)return void h();if(e)return h(),void l.call(null,e,...t);if(B()||a)return h(),void l.call(null,e,...t);let n;s<64&&(s*=2),1===o?(o=2,n=0):n=1e3*(s+Math.random()),u(n)}let d=!1;function f(e){d||(d=!0,h(),c||(null!==r?(e||(o=2),clearTimeout(r),u(0)):e||(o=1)))}return u(0),i=setTimeout(()=>{a=!0,f(!0)},n),f}(e,t,this.timeout_)}getPromise(){return this.promise_}cancel(e){this.canceled_=!0,this.appDelete_=e||!1,null!==this.backoffId_&&(0,this.backoffId_)(!1),null!==this.pendingConnection_&&this.pendingConnection_.abort()}}class kw{constructor(e,t,n){this.wasSuccessCode=e,this.connection=t,this.canceled=!!n}}function Lw(){return"undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:void 0}function xw(...e){const t=Lw();if(void 0!==t){const n=new t;for(let t=0;t<e.length;t++)n.append(e[t]);return n.getBlob()}if(Tw())return new Blob(e);throw new uw(hw.UNSUPPORTED_ENVIRONMENT,"This browser doesn't seem to support creating Blobs")}function Fw(e){if("undefined"==typeof atob)throw t="base-64",new uw(hw.UNSUPPORTED_ENVIRONMENT,`${t} is missing. Make sure to install the required polyfills. See https://firebase.google.com/docs/web/environments-js-sdk#polyfills for more information.`);var t;return atob(e)}const Pw="raw",Mw="base64",Gw="base64url",Uw="data_url";class Hw{constructor(e,t){this.data=e,this.contentType=t||null}}function Vw(e,t){switch(e){case Pw:return new Hw(jw(t));case Mw:case Gw:return new Hw($w(e,t));case Uw:return new Hw(function(e){const t=new Jw(e);return t.base64?$w(Mw,t.rest):function(e){let t;try{t=decodeURIComponent(e)}catch(e){throw yw(Uw,"Malformed data URL.")}return jw(t)}(t.rest)}(t),new Jw(t).contentType)}throw fw()}function jw(e){const t=[];for(let n=0;n<e.length;n++){let s=e.charCodeAt(n);if(s<=127)t.push(s);else if(s<=2047)t.push(192|s>>6,128|63&s);else if(55296==(64512&s)){if(n<e.length-1&&56320==(64512&e.charCodeAt(n+1))){s=65536|(1023&s)<<10|1023&e.charCodeAt(++n),t.push(240|s>>18,128|s>>12&63,128|s>>6&63,128|63&s)}else t.push(239,191,189)}else 56320==(64512&s)?t.push(239,191,189):t.push(224|s>>12,128|s>>6&63,128|63&s)}return new Uint8Array(t)}function $w(e,t){switch(e){case Mw:{const n=-1!==t.indexOf("-"),s=-1!==t.indexOf("_");if(n||s){throw yw(e,"Invalid character '"+(n?"-":"_")+"' found: is it base64url encoded?")}break}case Gw:{const n=-1!==t.indexOf("+"),s=-1!==t.indexOf("/");if(n||s){throw yw(e,"Invalid character '"+(n?"+":"/")+"' found: is it base64 encoded?")}t=t.replace(/-/g,"+").replace(/_/g,"/");break}}let n;try{n=Fw(t)}catch(t){if(t.message.includes("polyfill"))throw t;throw yw(e,"Invalid character found")}const s=new Uint8Array(n.length);for(let e=0;e<n.length;e++)s[e]=n.charCodeAt(e);return s}class Jw{constructor(e){this.base64=!1,this.contentType=null;const t=e.match(/^data:([^,]+)?,/);if(null===t)throw yw(Uw,"Must be formatted 'data:[<mediatype>][;base64],<data>");const n=t[1]||null;null!=n&&(this.base64=function(e,t){const n=e.length>=t.length;if(!n)return!1;return e.substring(e.length-t.length)===t}(n,";base64"),this.contentType=this.base64?n.substring(0,n.length-7):n),this.rest=e.substring(e.indexOf(",")+1)}}class qw{constructor(e,t){let n=0,s="";Iw(e)?(this.data_=e,n=e.size,s=e.type):e instanceof ArrayBuffer?(t?this.data_=new Uint8Array(e):(this.data_=new Uint8Array(e.byteLength),this.data_.set(new Uint8Array(e))),n=this.data_.length):e instanceof Uint8Array&&(t?this.data_=e:(this.data_=new Uint8Array(e.length),this.data_.set(e)),n=e.length),this.size_=n,this.type_=s}size(){return this.size_}type(){return this.type_}slice(e,t){if(Iw(this.data_)){const n=function(e,t,n){return e.webkitSlice?e.webkitSlice(t,n):e.mozSlice?e.mozSlice(t,n):e.slice?e.slice(t,n):null}(this.data_,e,t);return null===n?null:new qw(n)}{const n=new Uint8Array(this.data_.buffer,e,t-e);return new qw(n,!0)}}static getBlob(...e){if(Tw()){const t=e.map(e=>e instanceof qw?e.data_:e);return new qw(xw.apply(null,t))}{const t=e.map(e=>vw(e)?Vw(Pw,e).data:e.data_);let n=0;t.forEach(e=>{n+=e.byteLength});const s=new Uint8Array(n);let r=0;return t.forEach(e=>{for(let t=0;t<e.length;t++)s[r++]=e[t]}),new qw(s,!0)}}uploadData(){return this.data_}}function zw(e){let t;try{t=JSON.parse(e)}catch(e){return null}return function(e){return"object"==typeof e&&!Array.isArray(e)}(t)?t:null}function Kw(e){const t=e.lastIndexOf("/",e.length-2);return-1===t?e:e.slice(t+1)}function Qw(e,t){return t}class Ww{constructor(e,t,n,s){this.server=e,this.local=t||e,this.writable=!!n,this.xform=s||Qw}}let Yw=null;function Xw(){if(Yw)return Yw;const e=[];e.push(new Ww("bucket")),e.push(new Ww("generation")),e.push(new Ww("metageneration")),e.push(new Ww("name","fullPath",!0));const t=new Ww("name");t.xform=function(e,t){return function(e){return!vw(e)||e.length<2?e:Kw(e)}(t)},e.push(t);const n=new Ww("size");return n.xform=function(e,t){return void 0!==t?Number(t):t},e.push(n),e.push(new Ww("timeCreated")),e.push(new Ww("updated")),e.push(new Ww("md5Hash",null,!0)),e.push(new Ww("cacheControl",null,!0)),e.push(new Ww("contentDisposition",null,!0)),e.push(new Ww("contentEncoding",null,!0)),e.push(new Ww("contentLanguage",null,!0)),e.push(new Ww("contentType",null,!0)),e.push(new Ww("metadata","customMetadata",!0)),Yw=e,Yw}function Zw(e,t,n){const s={type:"file"},r=n.length;for(let e=0;e<r;e++){const r=n[e];s[r.local]=r.xform(s,t[r.server])}return function(e,t){Object.defineProperty(e,"ref",{get:function(){const n=e.bucket,s=e.fullPath,r=new _w(n,s);return t._makeStorageReference(r)}})}(s,e),s}function eE(e,t,n){const s=zw(t);if(null===s)return null;return Zw(e,s,n)}function tE(e,t){const n={},s=t.length;for(let r=0;r<s;r++){const s=t[r];s.writable&&(n[s.server]=e[s.local])}return JSON.stringify(n)}const nE="prefixes",sE="items";function rE(e,t,n){const s=zw(n);if(null===s)return null;return function(e,t,n){const s={prefixes:[],items:[],nextPageToken:n.nextPageToken};if(n[nE])for(const r of n[nE]){const n=r.replace(/\/$/,""),i=e._makeStorageReference(new _w(t,n));s.prefixes.push(i)}if(n[sE])for(const r of n[sE]){const n=e._makeStorageReference(new _w(t,r.name));s.items.push(n)}return s}(e,t,s)}class iE{constructor(e,t,n,s){this.url=e,this.method=t,this.handler=n,this.timeout=s,this.urlParams={},this.headers={},this.body=null,this.errorHandler=null,this.progressCallback=null,this.successCodes=[200],this.additionalRetryCodes=[]}}function aE(e){if(!e)throw fw()}function oE(e,t){return function(n,s){const r=eE(e,s,t);return aE(null!==r),r}}function BE(e,t){return function(n,s){const r=eE(e,s,t);return aE(null!==r),function(e,t,n,s){const r=zw(t);if(null===r)return null;if(!vw(r.downloadTokens))return null;const i=r.downloadTokens;if(0===i.length)return null;const a=encodeURIComponent;return i.split(",").map(t=>{const r=e.bucket,i=e.fullPath;return Ow("/b/"+a(r)+"/o/"+a(i),n,s)+Sw({alt:"media",token:t})})[0]}(r,s,e.host,e._protocol)}}function cE(e){return function(t,n){let s;var r,i;return 401===t.getStatus()?s=t.getErrorText().includes("Firebase App Check token is invalid")?new uw(hw.UNAUTHORIZED_APP,"This app does not have permission to access Firebase Storage on this project."):new uw(hw.UNAUTHENTICATED,"User is not authenticated, please authenticate using Firebase Authentication and try again."):402===t.getStatus()?(i=e.bucket,s=new uw(hw.QUOTA_EXCEEDED,"Quota for bucket '"+i+"' exceeded, please view quota on https://firebase.google.com/pricing/.")):403===t.getStatus()?(r=e.path,s=new uw(hw.UNAUTHORIZED,"User does not have permission to access '"+r+"'.")):s=n,s.status=t.getStatus(),s.serverResponse=n.serverResponse,s}}function lE(e){const t=cE(e);return function(n,s){let r=t(n,s);var i;return 404===n.getStatus()&&(i=e.path,r=new uw(hw.OBJECT_NOT_FOUND,"Object '"+i+"' does not exist.")),r.serverResponse=s.serverResponse,r}}function uE(e,t,n,s,r){const i={};t.isRoot?i.prefix="":i.prefix=t.path+"/",n.length>0&&(i.delimiter=n),s&&(i.pageToken=s),r&&(i.maxResults=r);const a=Ow(t.bucketOnlyServerUrl(),e.host,e._protocol),o=e.maxOperationRetryTime,B=new iE(a,"GET",function(e,t){return function(n,s){const r=rE(e,t,s);return aE(null!==r),r}}(e,t.bucket),o);return B.urlParams=i,B.errorHandler=cE(t),B}function hE(e,t,n){const s=Object.assign({},n);return s.fullPath=e.path,s.size=t.size(),s.contentType||(s.contentType=function(e,t){return e&&e.contentType||t&&t.type()||"application/octet-stream"}(null,t)),s}class pE{constructor(e,t,n,s){this.current=e,this.total=t,this.finalized=!!n,this.metadata=s||null}}function dE(e,t){let n=null;try{n=e.getResponseHeader("X-Goog-Upload-Status")}catch(e){aE(!1)}return aE(!!n&&-1!==(t||["active"]).indexOf(n)),n}const fE=262144;function CE(e,t,n,s,r,i,a,o){const B=new pE(0,0);if(a?(B.current=a.current,B.total=a.total):(B.current=0,B.total=s.size()),s.size()!==B.total)throw new uw(hw.SERVER_FILE_WRONG_SIZE,"Server recorded incorrect upload file size, please retry the upload.");const c=B.total-B.current;let l=c;r>0&&(l=Math.min(l,r));const u=B.current,h=u+l;let p="";p=0===l?"finalize":c===l?"upload, finalize":"upload";const d={"X-Goog-Upload-Command":p,"X-Goog-Upload-Offset":`${B.current}`},f=s.slice(u,h);if(null===f)throw mw();const C=t.maxUploadRetryTime,g=new iE(n,"POST",function(e,n){const r=dE(e,["active","final"]),a=B.current+l,o=s.size();let c;return c="final"===r?oE(t,i)(e,n):null,new pE(a,o,"final"===r,c)},C);return g.headers=d,g.body=f.uploadData(),g.progressCallback=o||null,g.errorHandler=cE(e),g}const gE="running",mE="paused",wE="success",EE="canceled",yE="error";function DE(e){switch(e){case"running":case"pausing":case"canceling":return gE;case"paused":return mE;case"success":return wE;case"canceled":return EE;default:return yE}}class _E{constructor(e,t,n){const s=function(e){return"function"==typeof e}(e)||null!=t||null!=n;if(s)this.next=e,this.error=t??void 0,this.complete=n??void 0;else{const t=e;this.next=t.next,this.error=t.error,this.complete=t.complete}}}function bE(e){return(...t)=>{Promise.resolve().then(()=>e(...t))}}class vE{constructor(){this.sent_=!1,this.xhr_=new XMLHttpRequest,this.initXhr(),this.errorCode_=pw.NO_ERROR,this.sendPromise_=new Promise(e=>{this.xhr_.addEventListener("abort",()=>{this.errorCode_=pw.ABORT,e()}),this.xhr_.addEventListener("error",()=>{this.errorCode_=pw.NETWORK_ERROR,e()}),this.xhr_.addEventListener("load",()=>{e()})})}send(e,t,n,s,r){if(this.sent_)throw Dw("cannot .send() more than once");if(es(e)&&n&&(this.xhr_.withCredentials=!0),this.sent_=!0,this.xhr_.open(t,e,!0),void 0!==r)for(const e in r)r.hasOwnProperty(e)&&this.xhr_.setRequestHeader(e,r[e].toString());return void 0!==s?this.xhr_.send(s):this.xhr_.send(),this.sendPromise_}getErrorCode(){if(!this.sent_)throw Dw("cannot .getErrorCode() before sending");return this.errorCode_}getStatus(){if(!this.sent_)throw Dw("cannot .getStatus() before sending");try{return this.xhr_.status}catch(e){return-1}}getResponse(){if(!this.sent_)throw Dw("cannot .getResponse() before sending");return this.xhr_.response}getErrorText(){if(!this.sent_)throw Dw("cannot .getErrorText() before sending");return this.xhr_.statusText}abort(){this.xhr_.abort()}getResponseHeader(e){return this.xhr_.getResponseHeader(e)}addUploadProgressListener(e){null!=this.xhr_.upload&&this.xhr_.upload.addEventListener("progress",e)}removeUploadProgressListener(e){null!=this.xhr_.upload&&this.xhr_.upload.removeEventListener("progress",e)}}class IE extends vE{initXhr(){this.xhr_.responseType="text"}}function TE(){return new IE}class AE{isExponentialBackoffExpired(){return this.sleepTime>this.maxSleepTime}constructor(e,t,n=null){this._transferred=0,this._needToFetchStatus=!1,this._needToFetchMetadata=!1,this._observers=[],this._error=void 0,this._uploadUrl=void 0,this._request=void 0,this._chunkMultiplier=1,this._resolve=void 0,this._reject=void 0,this._ref=e,this._blob=t,this._metadata=n,this._mappings=Xw(),this._resumable=this._shouldDoResumable(this._blob),this._state="running",this._errorHandler=e=>{if(this._request=void 0,this._chunkMultiplier=1,e._codeEquals(hw.CANCELED))this._needToFetchStatus=!0,this.completeTransitions_();else{const t=this.isExponentialBackoffExpired();if(Nw(e.status,[])){if(!t)return this.sleepTime=Math.max(2*this.sleepTime,1e3),this._needToFetchStatus=!0,void this.completeTransitions_();e=Cw()}this._error=e,this._transition("error")}},this._metadataErrorHandler=e=>{this._request=void 0,e._codeEquals(hw.CANCELED)?this.completeTransitions_():(this._error=e,this._transition("error"))},this.sleepTime=0,this.maxSleepTime=this._ref.storage.maxUploadRetryTime,this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t,this._start()}),this._promise.then(null,()=>{})}_makeProgressCallback(){const e=this._transferred;return t=>this._updateProgress(e+t)}_shouldDoResumable(e){return e.size()>262144}_start(){"running"===this._state&&void 0===this._request&&(this._resumable?void 0===this._uploadUrl?this._createResumable():this._needToFetchStatus?this._fetchStatus():this._needToFetchMetadata?this._fetchMetadata():this.pendingTimeout=setTimeout(()=>{this.pendingTimeout=void 0,this._continueUpload()},this.sleepTime):this._oneShotUpload())}_resolveToken(e){Promise.all([this._ref.storage._getAuthToken(),this._ref.storage._getAppCheckToken()]).then(([t,n])=>{switch(this._state){case"running":e(t,n);break;case"canceling":this._transition("canceled");break;case"pausing":this._transition("paused")}})}_createResumable(){this._resolveToken((e,t)=>{const n=function(e,t,n,s,r){const i=t.bucketOnlyServerUrl(),a=hE(t,s,r),o={name:a.fullPath},B=Ow(i,e.host,e._protocol),c={"X-Goog-Upload-Protocol":"resumable","X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":`${s.size()}`,"X-Goog-Upload-Header-Content-Type":a.contentType,"Content-Type":"application/json; charset=utf-8"},l=tE(a,n),u=e.maxUploadRetryTime,h=new iE(B,"POST",function(e){let t;dE(e);try{t=e.getResponseHeader("X-Goog-Upload-URL")}catch(e){aE(!1)}return aE(vw(t)),t},u);return h.urlParams=o,h.headers=c,h.body=l,h.errorHandler=cE(t),h}(this._ref.storage,this._ref._location,this._mappings,this._blob,this._metadata),s=this._ref.storage._makeRequest(n,TE,e,t);this._request=s,s.getPromise().then(e=>{this._request=void 0,this._uploadUrl=e,this._needToFetchStatus=!1,this.completeTransitions_()},this._errorHandler)})}_fetchStatus(){const e=this._uploadUrl;this._resolveToken((t,n)=>{const s=function(e,t,n,s){const r=e.maxUploadRetryTime,i=new iE(n,"POST",function(e){const t=dE(e,["active","final"]);let n=null;try{n=e.getResponseHeader("X-Goog-Upload-Size-Received")}catch(e){aE(!1)}n||aE(!1);const r=Number(n);return aE(!isNaN(r)),new pE(r,s.size(),"final"===t)},r);return i.headers={"X-Goog-Upload-Command":"query"},i.errorHandler=cE(t),i}(this._ref.storage,this._ref._location,e,this._blob),r=this._ref.storage._makeRequest(s,TE,t,n);this._request=r,r.getPromise().then(e=>{this._request=void 0,this._updateProgress(e.current),this._needToFetchStatus=!1,e.finalized&&(this._needToFetchMetadata=!0),this.completeTransitions_()},this._errorHandler)})}_continueUpload(){const e=fE*this._chunkMultiplier,t=new pE(this._transferred,this._blob.size()),n=this._uploadUrl;this._resolveToken((s,r)=>{let i;try{i=CE(this._ref._location,this._ref.storage,n,this._blob,e,this._mappings,t,this._makeProgressCallback())}catch(e){return this._error=e,void this._transition("error")}const a=this._ref.storage._makeRequest(i,TE,s,r,!1);this._request=a,a.getPromise().then(e=>{this._increaseMultiplier(),this._request=void 0,this._updateProgress(e.current),e.finalized?(this._metadata=e.metadata,this._transition("success")):this.completeTransitions_()},this._errorHandler)})}_increaseMultiplier(){2*(fE*this._chunkMultiplier)<33554432&&(this._chunkMultiplier*=2)}_fetchMetadata(){this._resolveToken((e,t)=>{const n=function(e,t,n){const s=Ow(t.fullServerUrl(),e.host,e._protocol),r=e.maxOperationRetryTime,i=new iE(s,"GET",oE(e,n),r);return i.errorHandler=lE(t),i}(this._ref.storage,this._ref._location,this._mappings),s=this._ref.storage._makeRequest(n,TE,e,t);this._request=s,s.getPromise().then(e=>{this._request=void 0,this._metadata=e,this._transition("success")},this._metadataErrorHandler)})}_oneShotUpload(){this._resolveToken((e,t)=>{const n=function(e,t,n,s,r){const i=t.bucketOnlyServerUrl(),a={"X-Goog-Upload-Protocol":"multipart"},o=function(){let e="";for(let t=0;t<2;t++)e+=Math.random().toString().slice(2);return e}();a["Content-Type"]="multipart/related; boundary="+o;const B=hE(t,s,r),c="--"+o+"\r\nContent-Type: application/json; charset=utf-8\r\n\r\n"+tE(B,n)+"\r\n--"+o+"\r\nContent-Type: "+B.contentType+"\r\n\r\n",l="\r\n--"+o+"--",u=qw.getBlob(c,s,l);if(null===u)throw mw();const h={name:B.fullPath},p=Ow(i,e.host,e._protocol),d=e.maxUploadRetryTime,f=new iE(p,"POST",oE(e,n),d);return f.urlParams=h,f.headers=a,f.body=u.uploadData(),f.errorHandler=cE(t),f}(this._ref.storage,this._ref._location,this._mappings,this._blob,this._metadata),s=this._ref.storage._makeRequest(n,TE,e,t);this._request=s,s.getPromise().then(e=>{this._request=void 0,this._metadata=e,this._updateProgress(this._blob.size()),this._transition("success")},this._errorHandler)})}_updateProgress(e){const t=this._transferred;this._transferred=e,this._transferred!==t&&this._notifyObservers()}_transition(e){if(this._state!==e)switch(e){case"canceling":case"pausing":this._state=e,void 0!==this._request?this._request.cancel():this.pendingTimeout&&(clearTimeout(this.pendingTimeout),this.pendingTimeout=void 0,this.completeTransitions_());break;case"running":const t="paused"===this._state;this._state=e,t&&(this._notifyObservers(),this._start());break;case"paused":case"error":case"success":this._state=e,this._notifyObservers();break;case"canceled":this._error=gw(),this._state=e,this._notifyObservers()}}completeTransitions_(){switch(this._state){case"pausing":this._transition("paused");break;case"canceling":this._transition("canceled");break;case"running":this._start()}}get snapshot(){const e=DE(this._state);return{bytesTransferred:this._transferred,totalBytes:this._blob.size(),state:e,metadata:this._metadata,task:this,ref:this._ref}}on(e,t,n,s){const r=new _E(t||void 0,n||void 0,s||void 0);return this._addObserver(r),()=>{this._removeObserver(r)}}then(e,t){return this._promise.then(e,t)}catch(e){return this.then(null,e)}_addObserver(e){this._observers.push(e),this._notifyObserver(e)}_removeObserver(e){const t=this._observers.indexOf(e);-1!==t&&this._observers.splice(t,1)}_notifyObservers(){this._finishPromise();this._observers.slice().forEach(e=>{this._notifyObserver(e)})}_finishPromise(){if(void 0!==this._resolve){let e=!0;switch(DE(this._state)){case wE:bE(this._resolve.bind(null,this.snapshot))();break;case EE:case yE:bE(this._reject.bind(null,this._error))();break;default:e=!1}e&&(this._resolve=void 0,this._reject=void 0)}}_notifyObserver(e){switch(DE(this._state)){case gE:case mE:e.next&&bE(e.next.bind(e,this.snapshot))();break;case wE:e.complete&&bE(e.complete.bind(e))();break;default:e.error&&bE(e.error.bind(e,this._error))()}}resume(){const e="paused"===this._state||"pausing"===this._state;return e&&this._transition("running"),e}pause(){const e="running"===this._state;return e&&this._transition("pausing"),e}cancel(){const e="running"===this._state||"pausing"===this._state;return e&&this._transition("canceling"),e}}class OE{constructor(e,t){this._service=e,this._location=t instanceof _w?t:_w.makeFromUrl(t,e.host)}toString(){return"gs://"+this._location.bucket+"/"+this._location.path}_newRef(e,t){return new OE(e,t)}get root(){const e=new _w(this._location.bucket,"");return this._newRef(this._service,e)}get bucket(){return this._location.bucket}get fullPath(){return this._location.path}get name(){return Kw(this._location.path)}get storage(){return this._service}get parent(){const e=function(e){if(0===e.length)return null;const t=e.lastIndexOf("/");return-1===t?"":e.slice(0,t)}(this._location.path);if(null===e)return null;const t=new _w(this._location.bucket,e);return new OE(this._service,t)}_throwIfRoot(e){if(""===this._location.path)throw function(e){return new uw(hw.INVALID_ROOT_OPERATION,"The operation '"+e+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}(e)}}function SE(e){const t={prefixes:[],items:[]};return NE(e,t).then(()=>t)}async function NE(e,t,n){const s={pageToken:n},r=await function(e,t){null!=t&&"number"==typeof t.maxResults&&Aw("options.maxResults",1,1e3,t.maxResults);const n=t||{},s=uE(e.storage,e._location,"/",n.pageToken,n.maxResults);return e.storage.makeRequestWithTokens(s,TE)}(e,s);t.prefixes.push(...r.prefixes),t.items.push(...r.items),null!=r.nextPageToken&&await NE(e,t,r.nextPageToken)}function RE(e){e._throwIfRoot("getDownloadURL");const t=function(e,t,n){const s=Ow(t.fullServerUrl(),e.host,e._protocol),r=e.maxOperationRetryTime,i=new iE(s,"GET",BE(e,n),r);return i.errorHandler=lE(t),i}(e.storage,e._location,Xw());return e.storage.makeRequestWithTokens(t,TE).then(e=>{if(null===e)throw new uw(hw.NO_DOWNLOAD_URL,"The given file does not have any download URLs.");return e})}function kE(e){e._throwIfRoot("deleteObject");const t=function(e,t){const n=Ow(t.fullServerUrl(),e.host,e._protocol),s=e.maxOperationRetryTime,r=new iE(n,"DELETE",function(e,t){},s);return r.successCodes=[200,204],r.errorHandler=lE(t),r}(e.storage,e._location);return e.storage.makeRequestWithTokens(t,TE)}function LE(e,t){if(e instanceof PE){const n=e;if(null==n._bucket)throw new uw(hw.NO_DEFAULT_BUCKET,"No default bucket found. Did you set the '"+lw+"' property when initializing the app?");const s=new OE(n,n._bucket);return null!=t?LE(s,t):s}return void 0!==t?function(e,t){const n=function(e,t){const n=t.split("/").filter(e=>e.length>0).join("/");return 0===e.length?n:e+"/"+n}(e._location.path,t),s=new _w(e._location.bucket,n);return new OE(e.storage,s)}(e,t):e}function xE(e,t){if(t&&/^[A-Za-z]+:\/\//.test(t)){if(e instanceof PE)return new OE(e,t);throw ww("To use ref(service, url), the first argument must be a Storage instance.")}return LE(e,t)}function FE(e,t){const n=t?.[lw];return null==n?null:_w.makeFromBucketSpec(n,e)}class PE{constructor(e,t,n,s,r,i=!1){this.app=e,this._authProvider=t,this._appCheckProvider=n,this._url=s,this._firebaseVersion=r,this._isUsingEmulator=i,this._bucket=null,this._host=cw,this._protocol="https",this._appId=null,this._deleted=!1,this._maxOperationRetryTime=12e4,this._maxUploadRetryTime=6e5,this._requests=new Set,this._bucket=null!=s?_w.makeFromBucketSpec(s,this._host):FE(this._host,this.app.options)}get host(){return this._host}set host(e){this._host=e,null!=this._url?this._bucket=_w.makeFromBucketSpec(this._url,e):this._bucket=FE(e,this.app.options)}get maxUploadRetryTime(){return this._maxUploadRetryTime}set maxUploadRetryTime(e){Aw("time",0,Number.POSITIVE_INFINITY,e),this._maxUploadRetryTime=e}get maxOperationRetryTime(){return this._maxOperationRetryTime}set maxOperationRetryTime(e){Aw("time",0,Number.POSITIVE_INFINITY,e),this._maxOperationRetryTime=e}async _getAuthToken(){if(this._overrideAuthToken)return this._overrideAuthToken;const e=this._authProvider.getImmediate({optional:!0});if(e){const t=await e.getToken();if(null!==t)return t.accessToken}return null}async _getAppCheckToken(){if(pr(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const e=this._appCheckProvider.getImmediate({optional:!0});if(e){return(await e.getToken()).token}return null}_delete(){return this._deleted||(this._deleted=!0,this._requests.forEach(e=>e.cancel()),this._requests.clear()),Promise.resolve()}_makeStorageReference(e){return new OE(this,e)}_makeRequest(e,t,n,s,r=!0){if(this._deleted)return new bw(Ew());{const i=function(e,t,n,s,r,i,a=!0,o=!1){const B=Sw(e.urlParams),c=e.url+B,l=Object.assign({},e.headers);return function(e,t){t&&(e["X-Firebase-GMPID"]=t)}(l,t),function(e,t){null!==t&&t.length>0&&(e.Authorization="Firebase "+t)}(l,n),function(e,t){e["X-Firebase-Storage-Version"]="webjs/"+(t??"AppManager")}(l,i),function(e,t){null!==t&&(e["X-Firebase-AppCheck"]=t)}(l,s),new Rw(c,e.method,l,e.body,e.successCodes,e.additionalRetryCodes,e.handler,e.errorHandler,e.timeout,e.progressCallback,r,a,o)}(e,this._appId,n,s,t,this._firebaseVersion,r,this._isUsingEmulator);return this._requests.add(i),i.getPromise().then(()=>this._requests.delete(i),()=>this._requests.delete(i)),i}}async makeRequestWithTokens(e,t){const[n,s]=await Promise.all([this._getAuthToken(),this._getAppCheckToken()]);return this._makeRequest(e,t,n,s).getPromise()}}const ME="@firebase/storage",GE="0.14.5",UE="storage";function HE(e,t,n){return function(e,t,n){return e._throwIfRoot("uploadBytesResumable"),new AE(e,new qw(t),n)}(e=Zn(e),t,n)}function VE(e){return SE(e=Zn(e))}function jE(e){return kE(e=Zn(e))}function $E(e,t){return xE(e=Zn(e),t)}function JE(e=mr(),t){const n=hr(e=Zn(e),UE).getImmediate({identifier:t}),s=Rn("storage");return s&&function(e,t,n,s={}){!function(e,t,n,s={}){e.host=`${t}:${n}`;const r=es(t);r&&ts(`https://${e.host}/b`),e._isUsingEmulator=!0,e._protocol=r?"https":"http";const{mockUserToken:i}=s;i&&(e._overrideAuthToken="string"==typeof i?i:Fn(i,e.app.options.projectId))}(e,t,n,s)}(n,...s),n}function qE(e,{instanceIdentifier:t}){const n=e.getProvider("app").getImmediate(),s=e.getProvider("auth-internal"),r=e.getProvider("app-check-internal");return new PE(n,s,r,t,Cr)}ur(new ns(UE,qE,"PUBLIC").setMultipleInstances(!0)),wr(ME,GE,""),wr(ME,GE,"esm2020");let zE,KE,QE,WE,YE={},XE=null,ZE=!1;const ey=[];let ty;function ny(){return ty}function sy(){return ZE}function ry(e){ZE?e():ey.push(e)}function iy(){const e="undefined"==typeof process?void 0:process.env,t=e?.FIREBASE_CONFIG;if(!t)return null;const n=JSON.parse(t);return n&&n.apiKey?n:null}function ay(e){if(e&&Object.prototype.hasOwnProperty.call(e,"actionCodeSettings")&&(ty=e.actionCodeSettings),ZE){if(e?.app&&e.app!==zE)throw new Error("pwa-auth: Firebase app is already set");return zE}if(e?.app)zE=e.app,YE=zE.options;else{const t=e?.config??iy();if(!t)throw new Error("pwa-auth: pass initialize({ config }) or set window.process.env.FIREBASE_CONFIG");YE=t,zE=gr(YE)}return KE=function(e){const t="object"==typeof e?e:mr(),n="string"==typeof e?e:Xl,s=hr(t,"firestore").getImmediate({identifier:n});if(!s._initialized){const e=Rn("firestore");e&&Sd(s,...e)}return s}(zE),QE=JE(zE),WE=Qo(zE),XE=WE.currentUser,ZE=!0,ey.splice(0).forEach(e=>e()),zE}const oy=iy();oy&&ay({config:oy});const By={bubbles:!0,composed:!0};function cy(e){return e?{uid:e.uid,displayName:e.displayName,email:e.email,photoURL:e.photoURL,emailVerified:!0===e.emailVerified}:null}function ly(e,t){window.dispatchEvent(new CustomEvent(e,{...By,detail:t}))}function uy(e){if("object"==typeof e&&null!==e&&"code"in e){const t=String(e.code);return{code:t,message:e instanceof Error?e.message:t}}return{code:"pwa/unknown",message:e instanceof Error?e.message:"Authentication failed"}}const hy=new Set(["auth/popup-closed-by-user","auth/cancelled-popup-request","auth/user-cancelled"]);let py=null,dy=!1;function fy(){const e=py;return py=null,e}function Cy(){return new ga}async function gy(e){if(function(e){return/Android|iPhone|iPad|iPod/i.test(e)}("undefined"==typeof navigator?"":navigator.userAgent))return await go(WE,Cy()),"redirect";try{return await async function(e,t,n){if(pr(e.app))return Promise.reject(Pr(e,"operation-not-supported-in-this-environment"));const s=$i(e);Ur(e,t,da);const r=so(s,n);return new lo(s,"signInViaPopup",t,r).executeNotNull()}(WE,Cy()),"ok"}catch(e){const t=uy(e).code;if(hy.has(t))return"quiet";if("auth/popup-blocked"===t)return await go(WE,Cy()),"redirect";throw e}}function my(){dy||(dy=!0,ry(()=>{(async function(e,t){return await $i(e)._initializationPromise,mo(e,t,!1)})(WE).catch(e=>{!function(e){py=uy(e)}(e)})}))}const wy="pwa-auth-changed",Ey="pwa-login",yy="pwa-logout",Dy="pwa-signup",_y="pwa-account-deleted",by="pwa-profile-updated",vy="pwa-email-changed",Iy="pwa-password-changed",Ty="pwa-reset-sent",Ay="pwa-drawer-toggle",Oy="pwa-settings",Sy="pwa-auth-error",Ny="pwa-verification-sent",Ry="pwa-email-verified",ky={authChanged:wy,login:Ey,logout:yy,signup:Dy,accountDeleted:_y,profileUpdated:by,emailChanged:vy,passwordChanged:Iy,resetSent:Ty,drawerToggle:Ay,settings:Oy,authError:Sy,verificationSent:Ny,emailVerified:Ry},Ly=128,xy="At least 8 characters. A passphrase works well.",Fy="Use at least 8 characters.",Py="Use at most 128 characters.",My="Passwords don't match.";function Gy(e){return e.length<8?{code:"pwa/short-password",message:Fy}:e.length>Ly?{code:"pwa/long-password",message:Py}:null}const Uy={"auth/invalid-email":"Enter a valid email address.","auth/user-not-found":"No account uses that email.","auth/wrong-password":"That password is wrong.","auth/invalid-credential":"That email or password is wrong.","auth/invalid-login-credentials":"That email or password is wrong.","auth/user-token-expired":"This account is no longer available.","auth/invalid-user-token":"This account is no longer available.","auth/user-disabled":"This account is disabled.","auth/email-already-in-use":"An account already uses that email.","auth/account-exists-with-different-credential":"That email already has an account. Sign in with email and password.","auth/weak-password":Fy,"auth/too-many-requests":"Too many tries. Wait and try again.","auth/network-request-failed":"Network problem. Try again.","auth/requires-recent-login":"Sign in again, then retry.","pwa/missing-email":"Enter an email address.","pwa/invalid-email":"Enter a valid email address.","pwa/missing-password":"Enter a password.","pwa/short-password":Fy,"pwa/long-password":Py,"pwa/current-password":"Enter your current password.","pwa/password-mismatch":My,"pwa/weak-password":Fy,"pwa/signed-out":"Sign in first.","pwa/missing-file":"Choose a photo first.","pwa/not-ready":"Sign-in is not ready yet.","pwa/unknown":"Something went wrong. Try again."};function Hy(e){const t=uy(e);return Uy[t.code]??"Something went wrong. Try again."}const Vy=i`
160
217
 
161
218
  .action-button:focus { outline: 0; }
162
219
 
@@ -211,6 +268,45 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
211
268
  margin: auto;
212
269
  }
213
270
 
271
+ .google {
272
+ display: inline-flex;
273
+ align-items: center;
274
+ justify-content: center;
275
+ gap: 10px;
276
+ box-sizing: border-box;
277
+ width: 100%;
278
+ min-height: var(--pwa_tap, 44px);
279
+ margin: 0 0 8px;
280
+ padding: 10px 18px;
281
+ border-radius: 10px;
282
+ border: 1px solid #747775;
283
+ background: #fff;
284
+ color: #1f1f1f;
285
+ font: inherit;
286
+ font-weight: 600;
287
+ font-size: 16px;
288
+ line-height: 1.2;
289
+ cursor: pointer;
290
+ }
291
+
292
+ .google:focus { outline: 0; }
293
+
294
+ .google:focus-visible {
295
+ outline: 2px solid #1f1f1f;
296
+ outline-offset: 2px;
297
+ }
298
+
299
+ .google:disabled {
300
+ cursor: default;
301
+ opacity: 0.72;
302
+ }
303
+
304
+ .google .g {
305
+ width: 18px;
306
+ height: 18px;
307
+ flex: 0 0 auto;
308
+ }
309
+
214
310
  .submit:hover { background-color: #214f34; }
215
311
 
216
312
  .submit {
@@ -225,7 +321,7 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
225
321
  cursor: pointer;
226
322
  }
227
323
 
228
- `,Ny=i`
324
+ `,jy=i`
229
325
 
230
326
  label {
231
327
  display: grid;
@@ -247,7 +343,7 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
247
343
  line-height: 1.4;
248
344
  }
249
345
 
250
- `,Ry=i`
346
+ `,$y=i`
251
347
 
252
348
  input[type=text],
253
349
  input[type=email],
@@ -269,7 +365,7 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
269
365
 
270
366
  input.invalid { background-color: #ffdddd; }
271
367
 
272
- `,ky=i`
368
+ `,Jy=i`
273
369
 
274
370
  .new {
275
371
  border: 0;
@@ -312,7 +408,7 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
312
408
  opacity: 0.72;
313
409
  }
314
410
 
315
- `,Ly=i`
411
+ `,qy=i`
316
412
 
317
413
  .status {
318
414
  margin: 0 16px 8px;
@@ -342,7 +438,7 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
342
438
  align-items: center;
343
439
  }
344
440
 
345
- `;function xy(e,t,n){return H`
441
+ `;function zy(e,t,n){return H`
346
442
  <p
347
443
  id="${e}"
348
444
  part="status"
@@ -350,13 +446,13 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
350
446
  role="status"
351
447
  aria-live="polite"
352
448
  aria-atomic="true">${t}</p>
353
- `}const Fy=i`
449
+ `}const Ky=i`
354
450
 
355
451
  :host {
356
452
  --pwa_tap: 44px;
357
453
  }
358
454
 
359
- `;function Py(e,t){return H`
455
+ `;function Qy(e,t){return H`
360
456
  <button
361
457
  type="button"
362
458
  class="reveal"
@@ -364,7 +460,24 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
364
460
  aria-pressed="${e?"true":"false"}"
365
461
  aria-label="${e?"Hide password":"Show password"}"
366
462
  @click="${t}">${e?"Hide":"Show"}</button>
367
- `}let My="";const Gy=new Set;function Uy(e){const t=e.trim();t!==My&&(My=t,t&&Gy.forEach(e=>e()))}function Hy(){return My}var Vy=function(e,t,n,s){var r,i=arguments.length,a=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,s);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},jy=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};let $y=class extends ie{constructor(){super(),this.source="",this.email="",this.password="",this.status="",this.tone="",this.busy=!1,this.resetBusy=!1,this.showPassword=!1,this.signIn=async(e,t)=>{this.busy=!0,this.tone="",this.status="";try{const n=wy((await Oa(JE,e,t)).user);n&&Ey(ry,{user:n})}catch(e){this.show(yy(e))}finally{this.busy=!1}},this.forgot=async()=>{if(this.busy||this.resetBusy)return;this.readFields();const e=this.email.trim();if(e.length<4)this.show({code:"pwa/missing-email",message:"Enter an email address."});else if(/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)){this.resetBusy=!0,this.tone="",this.status="";try{await Ta(JE,e),this.sent(e)}catch(t){"auth/user-not-found"===yy(t).code?this.sent(e):this.show(yy(t))}finally{this.resetBusy=!1}}else this.show({code:"pwa/invalid-email",message:"Enter a valid email address."})}}static get styles(){return[Dn,Ny,Ry,Sy,ky,Ly,Fy,i`
463
+ `}const Wy=H`
464
+ <svg class="g" viewBox="0 0 48 48" aria-hidden="true">
465
+ <path fill="#EA4335" d="M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z"></path>
466
+ <path fill="#4285F4" d="M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z"></path>
467
+ <path fill="#FBBC05" d="M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z"></path>
468
+ <path fill="#34A853" d="M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z"></path>
469
+ </svg>
470
+ `;function Yy(e,t){return H`
471
+ <button
472
+ type="button"
473
+ part="google"
474
+ class="google"
475
+ ?disabled="${e}"
476
+ @click="${t}">
477
+ ${Wy}
478
+ Continue with Google
479
+ </button>
480
+ `}let Xy="";const Zy=new Set;function eD(e){const t=e.trim();t!==Xy&&(Xy=t,t&&Zy.forEach(e=>e()))}function tD(){return Xy}var nD=function(e,t,n,s){var r,i=arguments.length,a=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,s);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},sD=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};let rD=class extends ie{constructor(){super(),this.source="",this.hideGoogle=!1,this.email="",this.password="",this.status="",this.tone="",this.busy=!1,this.resetBusy=!1,this.showPassword=!1,this.signIn=async(e,t)=>{this.busy=!0,this.tone="",this.status="";try{const n=cy((await Sa(WE,e,t)).user);n&&ly(Ey,{user:n})}catch(e){this.show(uy(e))}finally{this.busy=!1}},this.forgot=async()=>{if(this.busy||this.resetBusy)return;this.readFields();const e=this.email.trim();if(e.length<4)this.show({code:"pwa/missing-email",message:"Enter an email address."});else if(/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)){this.resetBusy=!0,this.tone="",this.status="";try{await Oa(WE,e),this.sent(e)}catch(t){"auth/user-not-found"===uy(t).code?this.sent(e):this.show(uy(t))}finally{this.resetBusy=!1}}else this.show({code:"pwa/invalid-email",message:"Enter a valid email address."})}}connectedCallback(){super.connectedCallback(),this.adoptRedirect()}updated(){this.adoptRedirect()}adoptRedirect(){if(!this.classList.contains("opened"))return;const e=fy();e&&this.show(e)}static get styles(){return[_n,jy,$y,Vy,Jy,qy,Ky,i`
368
481
 
369
482
  :host {
370
483
  background-color: var(--section_background_color, #fffdf8);
@@ -427,7 +540,7 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
427
540
  @input= "${this.handlePassword}"
428
541
  @change= "${this.handlePassword}">
429
542
 
430
- ${Py(this.showPassword,()=>{this.showPassword=!this.showPassword})}
543
+ ${Qy(this.showPassword,()=>{this.showPassword=!this.showPassword})}
431
544
 
432
545
  </span>
433
546
 
@@ -437,7 +550,9 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
437
550
 
438
551
  <li>
439
552
 
440
- ${xy(n,this.status,this.tone)}
553
+ ${zy(n,this.status,this.tone)}
554
+
555
+ ${this.hideGoogle?"":Yy(this.busy||this.resetBusy,()=>{this.google()})}
441
556
 
442
557
  <button
443
558
  type= "submit"
@@ -465,7 +580,7 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
465
580
 
466
581
  </form>
467
582
 
468
- `}change(){gn.dispatch(Yt(this.source))}show(e,t=!0){this.tone=t?"error":"",this.status=Ay(e),t&&Ey(dy,e)}handleEmail(e){const t=e.target;this.email=t.value,Uy(this.email)}handlePassword(e){const t=e.target;this.password=t.value}readFields(){const e=this.renderRoot.querySelector('input[type="email"]'),t=this.renderRoot.querySelector('input[name="password"]');this.email=e?.value??"",this.password=t?.value??"",Uy(this.email)}_handleSubmit(e){e.preventDefault(),this.login()}async login(){this.busy||(this.readFields(),this.email.length<4?this.show({code:"pwa/missing-email",message:"Enter an email address."}):this.password?await this.signIn(this.email,this.password):this.show({code:"pwa/missing-password",message:"Enter a password."}))}sent(e){this.tone="",this.status="If an account uses that email, a reset link is on its way.",Ey(uy,{email:e})}};Vy([le({type:String}),jy("design:type",Object)],$y.prototype,"source",void 0),Vy([ue(),jy("design:type",Object)],$y.prototype,"email",void 0),Vy([ue(),jy("design:type",Object)],$y.prototype,"password",void 0),Vy([ue(),jy("design:type",Object)],$y.prototype,"status",void 0),Vy([ue(),jy("design:type",Object)],$y.prototype,"tone",void 0),Vy([ue(),jy("design:type",Object)],$y.prototype,"busy",void 0),Vy([ue(),jy("design:type",Object)],$y.prototype,"resetBusy",void 0),Vy([ue(),jy("design:type",Object)],$y.prototype,"showPassword",void 0),$y=Vy([oe("form-login"),jy("design:paramtypes",[])],$y);const Jy="@firebase/installations",qy="0.6.24",zy=1e4,Ky=`w:${qy}`,Qy="FIS_v2",Wy=36e5,Yy=new jn("installations","Installations",{"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."});function Xy(e){return e instanceof Vn&&e.code.includes("request-failed")}function Zy({projectId:e}){return`https://firebaseinstallations.googleapis.com/v1/projects/${e}/installations`}function eD(e){return{token:e.token,requestStatus:2,expiresIn:(t=e.expiresIn,Number(t.replace("s","000"))),creationTime:Date.now()};var t}async function tD(e,t){const n=(await t.json()).error;return Yy.create("request-failed",{requestName:e,serverCode:n.code,serverMessage:n.message,serverStatus:n.status})}function nD({apiKey:e}){return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":e})}function sD(e,{refreshToken:t}){const n=nD(e);return n.append("Authorization",function(e){return`${Qy} ${e}`}(t)),n}async function rD(e){const t=await e();return t.status>=500&&t.status<600?e():t}function iD(e){return new Promise(t=>{setTimeout(t,e)})}const aD=/^[cdef][\w-]{21}$/;function oD(){try{const e=new Uint8Array(17);(self.crypto||self.msCrypto).getRandomValues(e),e[0]=112+e[0]%16;const t=function(e){const t=(n=e,btoa(String.fromCharCode(...n)).replace(/\+/g,"-").replace(/\//g,"_"));var n;return t.substr(0,22)}(e);return aD.test(t)?t:""}catch{return""}}function BD(e){return`${e.appName}!${e.appId}`}const cD=new Map;function lD(e,t){const n=BD(e);uD(n,t),function(e,t){const n=function(){!hD&&"BroadcastChannel"in self&&(hD=new BroadcastChannel("[Firebase] FID Change"),hD.onmessage=e=>{uD(e.data.key,e.data.fid)});return hD}();n&&n.postMessage({key:e,fid:t});0===cD.size&&hD&&(hD.close(),hD=null)}(n,t)}function uD(e,t){const n=cD.get(e);if(n)for(const e of n)e(t)}let hD=null;const pD="firebase-installations-store";let dD=null;function fD(){return dD||(dD=_s("firebase-installations-database",1,{upgrade:(e,t)=>{if(0===t)e.createObjectStore(pD)}})),dD}async function CD(e,t){const n=BD(e),s=(await fD()).transaction(pD,"readwrite"),r=s.objectStore(pD),i=await r.get(n);return await r.put(t,n),await s.done,i&&i.fid===t.fid||lD(e,t.fid),t}async function gD(e){const t=BD(e),n=(await fD()).transaction(pD,"readwrite");await n.objectStore(pD).delete(t),await n.done}async function mD(e,t){const n=BD(e),s=(await fD()).transaction(pD,"readwrite"),r=s.objectStore(pD),i=await r.get(n),a=t(i);return void 0===a?await r.delete(n):await r.put(a,n),await s.done,!a||i&&i.fid===a.fid||lD(e,a.fid),a}async function wD(e){let t;const n=await mD(e.appConfig,n=>{const s=function(e){const t=e||{fid:oD(),registrationStatus:0};return DD(t)}(n),r=function(e,t){if(0===t.registrationStatus){if(!navigator.onLine){return{installationEntry:t,registrationPromise:Promise.reject(Yy.create("app-offline"))}}const n={fid:t.fid,registrationStatus:1,registrationTime:Date.now()},s=async function(e,t){try{const n=await async function({appConfig:e,heartbeatServiceProvider:t},{fid:n}){const s=Zy(e),r=nD(e),i=t.getImmediate({optional:!0});if(i){const e=await i.getHeartbeatsHeader();e&&r.append("x-firebase-client",e)}const a={fid:n,authVersion:Qy,appId:e.appId,sdkVersion:Ky},o={method:"POST",headers:r,body:JSON.stringify(a)},B=await rD(()=>fetch(s,o));if(B.ok){const e=await B.json();return{fid:e.fid||n,registrationStatus:2,refreshToken:e.refreshToken,authToken:eD(e.authToken)}}throw await tD("Create Installation",B)}(e,t);return CD(e.appConfig,n)}catch(n){throw Xy(n)&&409===n.customData.serverCode?await gD(e.appConfig):await CD(e.appConfig,{fid:t.fid,registrationStatus:0}),n}}(e,n);return{installationEntry:n,registrationPromise:s}}return 1===t.registrationStatus?{installationEntry:t,registrationPromise:ED(e)}:{installationEntry:t}}(e,s);return t=r.registrationPromise,r.installationEntry});return""===n.fid?{installationEntry:await t}:{installationEntry:n,registrationPromise:t}}async function ED(e){let t=await yD(e.appConfig);for(;1===t.registrationStatus;)await iD(100),t=await yD(e.appConfig);if(0===t.registrationStatus){const{installationEntry:t,registrationPromise:n}=await wD(e);return n||t}return t}function yD(e){return mD(e,e=>{if(!e)throw Yy.create("installation-not-found");return DD(e)})}function DD(e){return 1===(t=e).registrationStatus&&t.registrationTime+zy<Date.now()?{fid:e.fid,registrationStatus:0}:e;var t}async function _D({appConfig:e,heartbeatServiceProvider:t},n){const s=function(e,{fid:t}){return`${Zy(e)}/${t}/authTokens:generate`}(e,n),r=sD(e,n),i=t.getImmediate({optional:!0});if(i){const e=await i.getHeartbeatsHeader();e&&r.append("x-firebase-client",e)}const a={installation:{sdkVersion:Ky,appId:e.appId}},o={method:"POST",headers:r,body:JSON.stringify(a)},B=await rD(()=>fetch(s,o));if(B.ok){return eD(await B.json())}throw await tD("Generate Auth Token",B)}async function bD(e,t=!1){let n;const s=await mD(e.appConfig,s=>{if(!ID(s))throw Yy.create("not-registered");const r=s.authToken;if(!t&&function(e){return 2===e.requestStatus&&!function(e){const t=Date.now();return t<e.creationTime||e.creationTime+e.expiresIn<t+Wy}(e)}(r))return s;if(1===r.requestStatus)return n=async function(e,t){let n=await vD(e.appConfig);for(;1===n.authToken.requestStatus;)await iD(100),n=await vD(e.appConfig);const s=n.authToken;return 0===s.requestStatus?bD(e,t):s}(e,t),s;{if(!navigator.onLine)throw Yy.create("app-offline");const t=function(e){const t={requestStatus:1,requestTime:Date.now()};return{...e,authToken:t}}(s);return n=async function(e,t){try{const n=await _D(e,t),s={...t,authToken:n};return await CD(e.appConfig,s),n}catch(n){if(!Xy(n)||401!==n.customData.serverCode&&404!==n.customData.serverCode){const n={...t,authToken:{requestStatus:0}};await CD(e.appConfig,n)}else await gD(e.appConfig);throw n}}(e,t),t}});return n?await n:s.authToken}function vD(e){return mD(e,e=>{if(!ID(e))throw Yy.create("not-registered");const t=e.authToken;return 1===(n=t).requestStatus&&n.requestTime+zy<Date.now()?{...e,authToken:{requestStatus:0}}:e;var n})}function ID(e){return void 0!==e&&2===e.registrationStatus}async function TD(e,t=!1){const n=e;await async function(e){const{registrationPromise:t}=await wD(e);t&&await t}(n);return(await bD(n,t)).token}function OD(e){return Yy.create("missing-app-config-values",{valueName:e})}const AD="installations",SD=e=>{const t=ur(e.getProvider("app").getImmediate(),AD).getImmediate();return{getId:()=>async function(e){const t=e,{installationEntry:n,registrationPromise:s}=await wD(t);return s?s.catch(console.error):bD(t).catch(console.error),n.fid}(t),getToken:e=>TD(t,e)}};lr(new ts(AD,e=>{const t=e.getProvider("app").getImmediate(),n=function(e){if(!e||!e.options)throw OD("App Configuration");if(!e.name)throw OD("App Name");const t=["projectId","apiKey","appId"];for(const n of t)if(!e.options[n])throw OD(n);return{appName:e.name,projectId:e.options.projectId,apiKey:e.options.apiKey,appId:e.options.appId}}(t);return{app:t,appConfig:n,heartbeatServiceProvider:ur(t,"heartbeat"),_delete:()=>Promise.resolve()}},"PUBLIC")),lr(new ts("installations-internal",SD,"PRIVATE")),mr(Jy,qy),mr(Jy,qy,"esm2020");const ND="analytics",RD="https://www.googletagmanager.com/gtag/js",kD=new ls("@firebase/analytics"),LD=new jn("analytics","Analytics",{"already-exists":"A Firebase Analytics instance with the appId {$id} already exists. Only one Firebase Analytics instance can be created for each appId.","already-initialized":"initializeAnalytics() cannot be called again with different options than those it was initially called with. It can be called again with the same options to return the existing instance, or getAnalytics() can be used to get a reference to the already-initialized instance.","already-initialized-settings":"Firebase Analytics has already been initialized.settings() must be called before initializing any Analytics instanceor it will have no effect.","interop-component-reg-failed":"Firebase Analytics Interop Component failed to instantiate: {$reason}","invalid-analytics-context":"Firebase Analytics is not supported in this environment. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments. Details: {$errorInfo}","indexeddb-unavailable":"IndexedDB unavailable or restricted in this environment. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments. Details: {$errorInfo}","fetch-throttle":"The config fetch request timed out while in an exponential backoff state. Unix timestamp in milliseconds when fetch request throttling ends: {$throttleEndTimeMillis}.","config-fetch-failed":"Dynamic config fetch failed: [{$httpStatus}] {$responseMessage}","no-api-key":'The "apiKey" field is empty in the local Firebase config. Firebase Analytics requires this field tocontain a valid API key.',"no-app-id":'The "appId" field is empty in the local Firebase config. Firebase Analytics requires this field tocontain a valid app ID.',"no-client-id":'The "client_id" field is empty.',"invalid-gtag-resource":"Trusted Types detected an invalid gtag resource: {$gtagURL}."});function xD(e){if(!e.startsWith(RD)){const t=LD.create("invalid-gtag-resource",{gtagURL:e});return kD.warn(t.message),""}return e}function FD(e){return Promise.all(e.map(e=>e.catch(e=>e)))}function PD(e,t){const n=function(e,t){let n;return window.trustedTypes&&(n=window.trustedTypes.createPolicy(e,t)),n}("firebase-js-sdk-policy",{createScriptURL:xD}),s=document.createElement("script"),r=`${RD}?l=${e}&id=${t}`;s.src=n?n?.createScriptURL(r):r,s.async=!0,document.head.appendChild(s)}function MD(e,t,n,s){return async function(r,...i){try{if("event"===r){const[s,r]=i;await async function(e,t,n,s,r){try{let i=[];if(r&&r.send_to){let e=r.send_to;Array.isArray(e)||(e=[e]);const s=await FD(n);for(const n of e){const e=s.find(e=>e.measurementId===n),r=e&&t[e.appId];if(!r){i=[];break}i.push(r)}}0===i.length&&(i=Object.values(t)),await Promise.all(i),e("event",s,r||{})}catch(e){kD.error(e)}}(e,t,n,s,r)}else if("config"===r){const[r,a]=i;await async function(e,t,n,s,r,i){const a=s[r];try{if(a)await t[a];else{const e=(await FD(n)).find(e=>e.measurementId===r);e&&await t[e.appId]}}catch(e){kD.error(e)}e("config",r,i)}(e,t,n,s,r,a)}else if("consent"===r){const[t,n]=i;e("consent",t,n)}else if("get"===r){const[t,n,s]=i;e("get",t,n,s)}else if("set"===r){const[t]=i;e("set",t)}else e(r,...i)}catch(e){kD.error(e)}}}const GD=new class{constructor(e={},t=1e3){this.throttleMetadata=e,this.intervalMillis=t}getThrottleMetadata(e){return this.throttleMetadata[e]}setThrottleMetadata(e,t){this.throttleMetadata[e]=t}deleteThrottleMetadata(e){delete this.throttleMetadata[e]}};function UD(e){return new Headers({Accept:"application/json","x-goog-api-key":e})}async function HD(e,t=GD,n){const{appId:s,apiKey:r,measurementId:i}=e.options;if(!s)throw LD.create("no-app-id");if(!r){if(i)return{measurementId:i,appId:s};throw LD.create("no-api-key")}const a=t.getThrottleMetadata(s)||{backoffCount:0,throttleEndTimeMillis:Date.now()},o=new jD;return setTimeout(async()=>{o.abort()},6e4),VD({appId:s,apiKey:r,measurementId:i},a,o,t)}async function VD(e,{throttleEndTimeMillis:t,backoffCount:n},s,r=GD){const{appId:i,measurementId:a}=e;try{await function(e,t){return new Promise((n,s)=>{const r=Math.max(t-Date.now(),0),i=setTimeout(n,r);e.addEventListener(()=>{clearTimeout(i),s(LD.create("fetch-throttle",{throttleEndTimeMillis:t}))})})}(s,t)}catch(e){if(a)return kD.warn(`Timed out fetching this Firebase app's measurement ID from the server. Falling back to the measurement ID ${a} provided in the "measurementId" field in the local Firebase config. [${e?.message}]`),{appId:i,measurementId:a};throw e}try{const t=await async function(e){const{appId:t,apiKey:n}=e,s={method:"GET",headers:UD(n)},r="https://firebase.googleapis.com/v1alpha/projects/-/apps/{app-id}/webConfig".replace("{app-id}",t),i=await fetch(r,s);if(200!==i.status&&304!==i.status){let e="";try{const t=await i.json();t.error?.message&&(e=t.error.message)}catch(e){}throw LD.create("config-fetch-failed",{httpStatus:i.status,responseMessage:e})}return i.json()}(e);return r.deleteThrottleMetadata(i),t}catch(t){const o=t;if(!function(e){if(!(e instanceof Vn&&e.customData))return!1;const t=Number(e.customData.httpStatus);return 429===t||500===t||503===t||504===t}(o)){if(r.deleteThrottleMetadata(i),a)return kD.warn(`Failed to fetch this Firebase app's measurement ID from the server. Falling back to the measurement ID ${a} provided in the "measurementId" field in the local Firebase config. [${o?.message}]`),{appId:i,measurementId:a};throw t}const B=503===Number(o?.customData?.httpStatus)?Yn(n,r.intervalMillis,30):Yn(n,r.intervalMillis),c={throttleEndTimeMillis:Date.now()+B,backoffCount:n+1};return r.setThrottleMetadata(i,c),kD.debug(`Calling attemptFetch again in ${B} millis`),VD(e,c,s,r)}}class jD{constructor(){this.listeners=[]}addEventListener(e){this.listeners.push(e)}abort(){this.listeners.forEach(e=>e())}}async function $D(e,t,n,s,r,i,a){const o=HD(e);o.then(t=>{n[t.measurementId]=t.appId,e.options.measurementId&&t.measurementId!==e.options.measurementId&&kD.warn(`The measurement ID in the local Firebase config (${e.options.measurementId}) does not match the measurement ID fetched from the server (${t.measurementId}). To ensure analytics events are always sent to the correct Analytics property, update the measurement ID field in the local config or remove it from the local config.`)}).catch(e=>kD.error(e)),t.push(o);const B=async function(){if(!Gn())return kD.warn(LD.create("indexeddb-unavailable",{errorInfo:"IndexedDB is not available in this environment."}).message),!1;try{await Un()}catch(e){return kD.warn(LD.create("indexeddb-unavailable",{errorInfo:e?.toString()}).message),!1}return!0}().then(e=>e?s.getId():void 0),[c,l]=await Promise.all([o,B]);(function(e){const t=window.document.getElementsByTagName("script");for(const n of Object.values(t))if(n.src&&n.src.includes(RD)&&n.src.includes(e))return n;return null})(i)||PD(i,c.measurementId),r("js",new Date);const u=a?.config??{};return u.origin="firebase",u.update=!0,null!=l&&(u.firebase_id=l),r("config",c.measurementId,u),c.measurementId}class JD{constructor(e){this.app=e}_delete(){return delete qD[this.app.options.appId],Promise.resolve()}}let qD={},zD=[];const KD={};let QD,WD,YD="dataLayer",XD=!1;function ZD(e,t,n){!function(){const e=[];if(Pn()&&e.push("This is a browser extension environment."),Hn()||e.push("Cookies are not available."),e.length>0){const t=e.map((e,t)=>`(${t+1}) ${e}`).join(" "),n=LD.create("invalid-analytics-context",{errorInfo:t});kD.warn(n.message)}}();const s=e.options.appId;if(!s)throw LD.create("no-app-id");if(!e.options.apiKey){if(!e.options.measurementId)throw LD.create("no-api-key");kD.warn(`The "apiKey" field is empty in the local Firebase config. This is needed to fetch the latest measurement ID for this Firebase app. Falling back to the measurement ID ${e.options.measurementId} provided in the "measurementId" field in the local Firebase config.`)}if(null!=qD[s])throw LD.create("already-exists",{id:s});if(!XD){!function(e){let t=[];Array.isArray(window[e])?t=window[e]:window[e]=t}(YD);const{wrappedGtag:e,gtagCore:t}=function(e,t,n,s,r){let i=function(...e){window[s].push(arguments)};return window[r]&&"function"==typeof window[r]&&(i=window[r]),window[r]=MD(i,e,t,n),{gtagCore:i,wrappedGtag:window[r]}}(qD,zD,KD,YD,"gtag");WD=e,QD=t,XD=!0}qD[s]=$D(e,zD,KD,t,QD,YD,n);return new JD(e)}function e_(e=gr()){const t=ur(e=Xn(e),ND);return t.isInitialized()?t.getImmediate():function(e,t={}){const n=ur(e,ND);if(n.isInitialized()){const e=n.getImmediate();if($n(t,n.getOptions()))return e;throw LD.create("already-initialized")}const s=n.initialize({options:t});return s}(e)}function t_(e,t,n){e=Xn(e),async function(e,t,n,s){if(s&&s.global){const t={};for(const e of Object.keys(n))t[`user_properties.${e}`]=n[e];return e("set",t),Promise.resolve()}e("config",await t,{update:!0,user_properties:n})}(WD,qD[e.app.options.appId],t,n).catch(e=>kD.error(e))}function n_(e,t,n,s){e=Xn(e),async function(e,t,n,s,r){if(r&&r.global)e("event",n,s);else{const r=await t;e("event",n,{...s,send_to:r})}}(WD,qD[e.app.options.appId],t,n,s).catch(e=>kD.error(e))}const s_="@firebase/analytics",r_="0.10.25";lr(new ts(ND,(e,{options:t})=>ZD(e.getProvider("app").getImmediate(),e.getProvider("installations-internal").getImmediate(),t),"PUBLIC")),lr(new ts("analytics-internal",function(e){try{const t=e.getProvider(ND).getImmediate();return{logEvent:(e,n,s)=>n_(t,e,n,s),setUserProperties:(e,n)=>t_(t,e,n)}}catch(e){throw LD.create("interop-component-reg-failed",{reason:e})}},"PRIVATE")),mr(s_,r_),mr(s_,r_,"esm2020");let i_,a_=null;function o_(){const e=a_;return a_=null,e}function B_(e){a_=e,Ey(dy,e)}let c_=Promise.resolve();const l_=()=>{gn.dispatch(rn())};ZE(()=>{$o(VE).useDeviceLanguage(),c_=(async()=>{await async function(){if(Pn())return!1;if(!Hn())return!1;if(!Gn())return!1;try{return await Un()}catch(e){return!1}}()&&(i_=e_(VE))})(),ka(JE,e=>{Ey(sy,{user:wy(e)}),e?(gn.dispatch(tn(!0)),gn.dispatch(rn()),gn.dispatch(ln(e.uid)),gn.dispatch(un(e.displayName??"")),gn.dispatch(pn(e.email||"")),gn.dispatch(dn(e.photoURL||"")),gn.dispatch(cn(!0===e.emailVerified)),gn.dispatch(en(e.displayName??"")),gn.dispatch(Zt(e.photoURL||""))):(gn.dispatch(tn(!1)),gn.dispatch(ln("")),gn.dispatch(un("")),gn.dispatch(pn("")),gn.dispatch(dn("")),gn.dispatch(cn(!1)),gn.dispatch(en("")),gn.dispatch(Zt("")))})});const u_=async e=>{const t=JE.currentUser;if(!t||!t.email)return B_({code:"pwa/signed-out",message:"Sign in first."}),!1;try{const n=ua.credential(t.email,e);return await async function(e,t){return _a(Xn(e),t)}(t,n),!0}catch(e){return B_(yy(e)),!1}},h_=async()=>{if(!XE()){const e={code:"pwa/not-ready",message:"Sign-in is not ready yet."};throw Ey(dy,e),new Error(e.message)}try{await function(e){return Xn(e).signOut()}(JE),Ey(iy,{user:null})}catch(e){throw Ey(dy,yy(e)),e}},p_=async()=>{await c_,i_&&n_(i_,"create_account")},d_=async()=>{await c_,i_&&n_(i_,"delete_account")},f_=async(e,t)=>{await tw(Ad(jE,e,t))};let C_="",g_=!1,m_=!1;function w_(e){if(!e)return C_="",g_=!1,!1;const t=!0===e.emailVerified;return e.uid!==C_?(C_=e.uid,g_=t,!1):!g_&&t?(g_=!0,!0):(g_=t,!1)}function E_(e){gn.dispatch(cn(!0));const t=wy({...e,emailVerified:!0});t&&Ey(Cy,{user:t})}async function y_(e){if(!XE())return!1;const t=JE.currentUser;if(!t)return w_(null),!1;try{await t.reload()}catch(n){return e&&Ey(dy,yy(n)),!0===t.emailVerified}return gn.dispatch(cn(!0===t.emailVerified)),w_(t)&&E_(t),!0===t.emailVerified}function D_(){y_(!1)}function __(){"visible"===document.visibilityState&&y_(!1)}function b_(e,t){const n={code:e,message:t};throw Ey(dy,n),Object.assign(new Error(t),n)}async function v_(){XE()||b_("pwa/not-ready","Sign-in is not ready yet.");const e=JE.currentUser;if(e||b_("pwa/signed-out","Sign in first."),e.email||b_("pwa/missing-email","Enter an email address."),e.emailVerified)return!1;const t=YE();try{t?await Aa(e,t):await Aa(e)}catch(e){throw Ey(dy,yy(e)),e}return Ey(fy,{email:e.email}),!0}async function I_(){return y_(!0)}m_||(m_=!0,ZE(()=>{ka(JE,e=>{e&&w_(e)&&E_(e),e||w_(null)}),"undefined"!=typeof window&&(window.addEventListener("focus",D_),document.addEventListener("visibilitychange",__))}));const T_=i`
583
+ `}change(){gn.dispatch(Yt(this.source))}async google(){if(!this.busy&&!this.resetBusy){this.busy=!0,this.tone="",this.status="";try{await gy()}catch(e){this.show(uy(e))}finally{this.busy=!1}}}show(e,t=!0){this.tone=t?"error":"",this.status=Hy(e),t&&ly(Sy,e)}handleEmail(e){const t=e.target;this.email=t.value,eD(this.email)}handlePassword(e){const t=e.target;this.password=t.value}readFields(){const e=this.renderRoot.querySelector('input[type="email"]'),t=this.renderRoot.querySelector('input[name="password"]');this.email=e?.value??"",this.password=t?.value??"",eD(this.email)}_handleSubmit(e){e.preventDefault(),this.login()}async login(){this.busy||(this.readFields(),this.email.length<4?this.show({code:"pwa/missing-email",message:"Enter an email address."}):this.password?await this.signIn(this.email,this.password):this.show({code:"pwa/missing-password",message:"Enter a password."}))}sent(e){this.tone="",this.status="If an account uses that email, a reset link is on its way.",ly(Ty,{email:e})}};nD([le({type:String}),sD("design:type",Object)],rD.prototype,"source",void 0),nD([le({type:Boolean,attribute:"hide-google",reflect:!0}),sD("design:type",Object)],rD.prototype,"hideGoogle",void 0),nD([ue(),sD("design:type",Object)],rD.prototype,"email",void 0),nD([ue(),sD("design:type",Object)],rD.prototype,"password",void 0),nD([ue(),sD("design:type",Object)],rD.prototype,"status",void 0),nD([ue(),sD("design:type",Object)],rD.prototype,"tone",void 0),nD([ue(),sD("design:type",Object)],rD.prototype,"busy",void 0),nD([ue(),sD("design:type",Object)],rD.prototype,"resetBusy",void 0),nD([ue(),sD("design:type",Object)],rD.prototype,"showPassword",void 0),rD=nD([oe("form-login"),sD("design:paramtypes",[])],rD);const iD="@firebase/installations",aD="0.6.24",oD=1e4,BD=`w:${aD}`,cD="FIS_v2",lD=36e5,uD=new $n("installations","Installations",{"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."});function hD(e){return e instanceof jn&&e.code.includes("request-failed")}function pD({projectId:e}){return`https://firebaseinstallations.googleapis.com/v1/projects/${e}/installations`}function dD(e){return{token:e.token,requestStatus:2,expiresIn:(t=e.expiresIn,Number(t.replace("s","000"))),creationTime:Date.now()};var t}async function fD(e,t){const n=(await t.json()).error;return uD.create("request-failed",{requestName:e,serverCode:n.code,serverMessage:n.message,serverStatus:n.status})}function CD({apiKey:e}){return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":e})}function gD(e,{refreshToken:t}){const n=CD(e);return n.append("Authorization",function(e){return`${cD} ${e}`}(t)),n}async function mD(e){const t=await e();return t.status>=500&&t.status<600?e():t}function wD(e){return new Promise(t=>{setTimeout(t,e)})}const ED=/^[cdef][\w-]{21}$/;function yD(){try{const e=new Uint8Array(17);(self.crypto||self.msCrypto).getRandomValues(e),e[0]=112+e[0]%16;const t=function(e){const t=(n=e,btoa(String.fromCharCode(...n)).replace(/\+/g,"-").replace(/\//g,"_"));var n;return t.substr(0,22)}(e);return ED.test(t)?t:""}catch{return""}}function DD(e){return`${e.appName}!${e.appId}`}const _D=new Map;function bD(e,t){const n=DD(e);vD(n,t),function(e,t){const n=function(){!ID&&"BroadcastChannel"in self&&(ID=new BroadcastChannel("[Firebase] FID Change"),ID.onmessage=e=>{vD(e.data.key,e.data.fid)});return ID}();n&&n.postMessage({key:e,fid:t});0===_D.size&&ID&&(ID.close(),ID=null)}(n,t)}function vD(e,t){const n=_D.get(e);if(n)for(const e of n)e(t)}let ID=null;const TD="firebase-installations-store";let AD=null;function OD(){return AD||(AD=bs("firebase-installations-database",1,{upgrade:(e,t)=>{if(0===t)e.createObjectStore(TD)}})),AD}async function SD(e,t){const n=DD(e),s=(await OD()).transaction(TD,"readwrite"),r=s.objectStore(TD),i=await r.get(n);return await r.put(t,n),await s.done,i&&i.fid===t.fid||bD(e,t.fid),t}async function ND(e){const t=DD(e),n=(await OD()).transaction(TD,"readwrite");await n.objectStore(TD).delete(t),await n.done}async function RD(e,t){const n=DD(e),s=(await OD()).transaction(TD,"readwrite"),r=s.objectStore(TD),i=await r.get(n),a=t(i);return void 0===a?await r.delete(n):await r.put(a,n),await s.done,!a||i&&i.fid===a.fid||bD(e,a.fid),a}async function kD(e){let t;const n=await RD(e.appConfig,n=>{const s=function(e){const t=e||{fid:yD(),registrationStatus:0};return FD(t)}(n),r=function(e,t){if(0===t.registrationStatus){if(!navigator.onLine){return{installationEntry:t,registrationPromise:Promise.reject(uD.create("app-offline"))}}const n={fid:t.fid,registrationStatus:1,registrationTime:Date.now()},s=async function(e,t){try{const n=await async function({appConfig:e,heartbeatServiceProvider:t},{fid:n}){const s=pD(e),r=CD(e),i=t.getImmediate({optional:!0});if(i){const e=await i.getHeartbeatsHeader();e&&r.append("x-firebase-client",e)}const a={fid:n,authVersion:cD,appId:e.appId,sdkVersion:BD},o={method:"POST",headers:r,body:JSON.stringify(a)},B=await mD(()=>fetch(s,o));if(B.ok){const e=await B.json();return{fid:e.fid||n,registrationStatus:2,refreshToken:e.refreshToken,authToken:dD(e.authToken)}}throw await fD("Create Installation",B)}(e,t);return SD(e.appConfig,n)}catch(n){throw hD(n)&&409===n.customData.serverCode?await ND(e.appConfig):await SD(e.appConfig,{fid:t.fid,registrationStatus:0}),n}}(e,n);return{installationEntry:n,registrationPromise:s}}return 1===t.registrationStatus?{installationEntry:t,registrationPromise:LD(e)}:{installationEntry:t}}(e,s);return t=r.registrationPromise,r.installationEntry});return""===n.fid?{installationEntry:await t}:{installationEntry:n,registrationPromise:t}}async function LD(e){let t=await xD(e.appConfig);for(;1===t.registrationStatus;)await wD(100),t=await xD(e.appConfig);if(0===t.registrationStatus){const{installationEntry:t,registrationPromise:n}=await kD(e);return n||t}return t}function xD(e){return RD(e,e=>{if(!e)throw uD.create("installation-not-found");return FD(e)})}function FD(e){return 1===(t=e).registrationStatus&&t.registrationTime+oD<Date.now()?{fid:e.fid,registrationStatus:0}:e;var t}async function PD({appConfig:e,heartbeatServiceProvider:t},n){const s=function(e,{fid:t}){return`${pD(e)}/${t}/authTokens:generate`}(e,n),r=gD(e,n),i=t.getImmediate({optional:!0});if(i){const e=await i.getHeartbeatsHeader();e&&r.append("x-firebase-client",e)}const a={installation:{sdkVersion:BD,appId:e.appId}},o={method:"POST",headers:r,body:JSON.stringify(a)},B=await mD(()=>fetch(s,o));if(B.ok){return dD(await B.json())}throw await fD("Generate Auth Token",B)}async function MD(e,t=!1){let n;const s=await RD(e.appConfig,s=>{if(!UD(s))throw uD.create("not-registered");const r=s.authToken;if(!t&&function(e){return 2===e.requestStatus&&!function(e){const t=Date.now();return t<e.creationTime||e.creationTime+e.expiresIn<t+lD}(e)}(r))return s;if(1===r.requestStatus)return n=async function(e,t){let n=await GD(e.appConfig);for(;1===n.authToken.requestStatus;)await wD(100),n=await GD(e.appConfig);const s=n.authToken;return 0===s.requestStatus?MD(e,t):s}(e,t),s;{if(!navigator.onLine)throw uD.create("app-offline");const t=function(e){const t={requestStatus:1,requestTime:Date.now()};return{...e,authToken:t}}(s);return n=async function(e,t){try{const n=await PD(e,t),s={...t,authToken:n};return await SD(e.appConfig,s),n}catch(n){if(!hD(n)||401!==n.customData.serverCode&&404!==n.customData.serverCode){const n={...t,authToken:{requestStatus:0}};await SD(e.appConfig,n)}else await ND(e.appConfig);throw n}}(e,t),t}});return n?await n:s.authToken}function GD(e){return RD(e,e=>{if(!UD(e))throw uD.create("not-registered");const t=e.authToken;return 1===(n=t).requestStatus&&n.requestTime+oD<Date.now()?{...e,authToken:{requestStatus:0}}:e;var n})}function UD(e){return void 0!==e&&2===e.registrationStatus}async function HD(e,t=!1){const n=e;await async function(e){const{registrationPromise:t}=await kD(e);t&&await t}(n);return(await MD(n,t)).token}function VD(e){return uD.create("missing-app-config-values",{valueName:e})}const jD="installations",$D=e=>{const t=hr(e.getProvider("app").getImmediate(),jD).getImmediate();return{getId:()=>async function(e){const t=e,{installationEntry:n,registrationPromise:s}=await kD(t);return s?s.catch(console.error):MD(t).catch(console.error),n.fid}(t),getToken:e=>HD(t,e)}};ur(new ns(jD,e=>{const t=e.getProvider("app").getImmediate(),n=function(e){if(!e||!e.options)throw VD("App Configuration");if(!e.name)throw VD("App Name");const t=["projectId","apiKey","appId"];for(const n of t)if(!e.options[n])throw VD(n);return{appName:e.name,projectId:e.options.projectId,apiKey:e.options.apiKey,appId:e.options.appId}}(t);return{app:t,appConfig:n,heartbeatServiceProvider:hr(t,"heartbeat"),_delete:()=>Promise.resolve()}},"PUBLIC")),ur(new ns("installations-internal",$D,"PRIVATE")),wr(iD,aD),wr(iD,aD,"esm2020");const JD="analytics",qD="https://www.googletagmanager.com/gtag/js",zD=new us("@firebase/analytics"),KD=new $n("analytics","Analytics",{"already-exists":"A Firebase Analytics instance with the appId {$id} already exists. Only one Firebase Analytics instance can be created for each appId.","already-initialized":"initializeAnalytics() cannot be called again with different options than those it was initially called with. It can be called again with the same options to return the existing instance, or getAnalytics() can be used to get a reference to the already-initialized instance.","already-initialized-settings":"Firebase Analytics has already been initialized.settings() must be called before initializing any Analytics instanceor it will have no effect.","interop-component-reg-failed":"Firebase Analytics Interop Component failed to instantiate: {$reason}","invalid-analytics-context":"Firebase Analytics is not supported in this environment. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments. Details: {$errorInfo}","indexeddb-unavailable":"IndexedDB unavailable or restricted in this environment. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments. Details: {$errorInfo}","fetch-throttle":"The config fetch request timed out while in an exponential backoff state. Unix timestamp in milliseconds when fetch request throttling ends: {$throttleEndTimeMillis}.","config-fetch-failed":"Dynamic config fetch failed: [{$httpStatus}] {$responseMessage}","no-api-key":'The "apiKey" field is empty in the local Firebase config. Firebase Analytics requires this field tocontain a valid API key.',"no-app-id":'The "appId" field is empty in the local Firebase config. Firebase Analytics requires this field tocontain a valid app ID.',"no-client-id":'The "client_id" field is empty.',"invalid-gtag-resource":"Trusted Types detected an invalid gtag resource: {$gtagURL}."});function QD(e){if(!e.startsWith(qD)){const t=KD.create("invalid-gtag-resource",{gtagURL:e});return zD.warn(t.message),""}return e}function WD(e){return Promise.all(e.map(e=>e.catch(e=>e)))}function YD(e,t){const n=function(e,t){let n;return window.trustedTypes&&(n=window.trustedTypes.createPolicy(e,t)),n}("firebase-js-sdk-policy",{createScriptURL:QD}),s=document.createElement("script"),r=`${qD}?l=${e}&id=${t}`;s.src=n?n?.createScriptURL(r):r,s.async=!0,document.head.appendChild(s)}function XD(e,t,n,s){return async function(r,...i){try{if("event"===r){const[s,r]=i;await async function(e,t,n,s,r){try{let i=[];if(r&&r.send_to){let e=r.send_to;Array.isArray(e)||(e=[e]);const s=await WD(n);for(const n of e){const e=s.find(e=>e.measurementId===n),r=e&&t[e.appId];if(!r){i=[];break}i.push(r)}}0===i.length&&(i=Object.values(t)),await Promise.all(i),e("event",s,r||{})}catch(e){zD.error(e)}}(e,t,n,s,r)}else if("config"===r){const[r,a]=i;await async function(e,t,n,s,r,i){const a=s[r];try{if(a)await t[a];else{const e=(await WD(n)).find(e=>e.measurementId===r);e&&await t[e.appId]}}catch(e){zD.error(e)}e("config",r,i)}(e,t,n,s,r,a)}else if("consent"===r){const[t,n]=i;e("consent",t,n)}else if("get"===r){const[t,n,s]=i;e("get",t,n,s)}else if("set"===r){const[t]=i;e("set",t)}else e(r,...i)}catch(e){zD.error(e)}}}const ZD=new class{constructor(e={},t=1e3){this.throttleMetadata=e,this.intervalMillis=t}getThrottleMetadata(e){return this.throttleMetadata[e]}setThrottleMetadata(e,t){this.throttleMetadata[e]=t}deleteThrottleMetadata(e){delete this.throttleMetadata[e]}};function e_(e){return new Headers({Accept:"application/json","x-goog-api-key":e})}async function t_(e,t=ZD,n){const{appId:s,apiKey:r,measurementId:i}=e.options;if(!s)throw KD.create("no-app-id");if(!r){if(i)return{measurementId:i,appId:s};throw KD.create("no-api-key")}const a=t.getThrottleMetadata(s)||{backoffCount:0,throttleEndTimeMillis:Date.now()},o=new s_;return setTimeout(async()=>{o.abort()},6e4),n_({appId:s,apiKey:r,measurementId:i},a,o,t)}async function n_(e,{throttleEndTimeMillis:t,backoffCount:n},s,r=ZD){const{appId:i,measurementId:a}=e;try{await function(e,t){return new Promise((n,s)=>{const r=Math.max(t-Date.now(),0),i=setTimeout(n,r);e.addEventListener(()=>{clearTimeout(i),s(KD.create("fetch-throttle",{throttleEndTimeMillis:t}))})})}(s,t)}catch(e){if(a)return zD.warn(`Timed out fetching this Firebase app's measurement ID from the server. Falling back to the measurement ID ${a} provided in the "measurementId" field in the local Firebase config. [${e?.message}]`),{appId:i,measurementId:a};throw e}try{const t=await async function(e){const{appId:t,apiKey:n}=e,s={method:"GET",headers:e_(n)},r="https://firebase.googleapis.com/v1alpha/projects/-/apps/{app-id}/webConfig".replace("{app-id}",t),i=await fetch(r,s);if(200!==i.status&&304!==i.status){let e="";try{const t=await i.json();t.error?.message&&(e=t.error.message)}catch(e){}throw KD.create("config-fetch-failed",{httpStatus:i.status,responseMessage:e})}return i.json()}(e);return r.deleteThrottleMetadata(i),t}catch(t){const o=t;if(!function(e){if(!(e instanceof jn&&e.customData))return!1;const t=Number(e.customData.httpStatus);return 429===t||500===t||503===t||504===t}(o)){if(r.deleteThrottleMetadata(i),a)return zD.warn(`Failed to fetch this Firebase app's measurement ID from the server. Falling back to the measurement ID ${a} provided in the "measurementId" field in the local Firebase config. [${o?.message}]`),{appId:i,measurementId:a};throw t}const B=503===Number(o?.customData?.httpStatus)?Xn(n,r.intervalMillis,30):Xn(n,r.intervalMillis),c={throttleEndTimeMillis:Date.now()+B,backoffCount:n+1};return r.setThrottleMetadata(i,c),zD.debug(`Calling attemptFetch again in ${B} millis`),n_(e,c,s,r)}}class s_{constructor(){this.listeners=[]}addEventListener(e){this.listeners.push(e)}abort(){this.listeners.forEach(e=>e())}}async function r_(e,t,n,s,r,i,a){const o=t_(e);o.then(t=>{n[t.measurementId]=t.appId,e.options.measurementId&&t.measurementId!==e.options.measurementId&&zD.warn(`The measurement ID in the local Firebase config (${e.options.measurementId}) does not match the measurement ID fetched from the server (${t.measurementId}). To ensure analytics events are always sent to the correct Analytics property, update the measurement ID field in the local config or remove it from the local config.`)}).catch(e=>zD.error(e)),t.push(o);const B=async function(){if(!Un())return zD.warn(KD.create("indexeddb-unavailable",{errorInfo:"IndexedDB is not available in this environment."}).message),!1;try{await Hn()}catch(e){return zD.warn(KD.create("indexeddb-unavailable",{errorInfo:e?.toString()}).message),!1}return!0}().then(e=>e?s.getId():void 0),[c,l]=await Promise.all([o,B]);(function(e){const t=window.document.getElementsByTagName("script");for(const n of Object.values(t))if(n.src&&n.src.includes(qD)&&n.src.includes(e))return n;return null})(i)||YD(i,c.measurementId),r("js",new Date);const u=a?.config??{};return u.origin="firebase",u.update=!0,null!=l&&(u.firebase_id=l),r("config",c.measurementId,u),c.measurementId}class i_{constructor(e){this.app=e}_delete(){return delete a_[this.app.options.appId],Promise.resolve()}}let a_={},o_=[];const B_={};let c_,l_,u_="dataLayer",h_=!1;function p_(e,t,n){!function(){const e=[];if(Mn()&&e.push("This is a browser extension environment."),Vn()||e.push("Cookies are not available."),e.length>0){const t=e.map((e,t)=>`(${t+1}) ${e}`).join(" "),n=KD.create("invalid-analytics-context",{errorInfo:t});zD.warn(n.message)}}();const s=e.options.appId;if(!s)throw KD.create("no-app-id");if(!e.options.apiKey){if(!e.options.measurementId)throw KD.create("no-api-key");zD.warn(`The "apiKey" field is empty in the local Firebase config. This is needed to fetch the latest measurement ID for this Firebase app. Falling back to the measurement ID ${e.options.measurementId} provided in the "measurementId" field in the local Firebase config.`)}if(null!=a_[s])throw KD.create("already-exists",{id:s});if(!h_){!function(e){let t=[];Array.isArray(window[e])?t=window[e]:window[e]=t}(u_);const{wrappedGtag:e,gtagCore:t}=function(e,t,n,s,r){let i=function(...e){window[s].push(arguments)};return window[r]&&"function"==typeof window[r]&&(i=window[r]),window[r]=XD(i,e,t,n),{gtagCore:i,wrappedGtag:window[r]}}(a_,o_,B_,u_,"gtag");l_=e,c_=t,h_=!0}a_[s]=r_(e,o_,B_,t,c_,u_,n);return new i_(e)}function d_(e=mr()){const t=hr(e=Zn(e),JD);return t.isInitialized()?t.getImmediate():function(e,t={}){const n=hr(e,JD);if(n.isInitialized()){const e=n.getImmediate();if(Jn(t,n.getOptions()))return e;throw KD.create("already-initialized")}const s=n.initialize({options:t});return s}(e)}function f_(e,t,n){e=Zn(e),async function(e,t,n,s){if(s&&s.global){const t={};for(const e of Object.keys(n))t[`user_properties.${e}`]=n[e];return e("set",t),Promise.resolve()}e("config",await t,{update:!0,user_properties:n})}(l_,a_[e.app.options.appId],t,n).catch(e=>zD.error(e))}function C_(e,t,n,s){e=Zn(e),async function(e,t,n,s,r){if(r&&r.global)e("event",n,s);else{const r=await t;e("event",n,{...s,send_to:r})}}(l_,a_[e.app.options.appId],t,n,s).catch(e=>zD.error(e))}const g_="@firebase/analytics",m_="0.10.25";ur(new ns(JD,(e,{options:t})=>p_(e.getProvider("app").getImmediate(),e.getProvider("installations-internal").getImmediate(),t),"PUBLIC")),ur(new ns("analytics-internal",function(e){try{const t=e.getProvider(JD).getImmediate();return{logEvent:(e,n,s)=>C_(t,e,n,s),setUserProperties:(e,n)=>f_(t,e,n)}}catch(e){throw KD.create("interop-component-reg-failed",{reason:e})}},"PRIVATE")),wr(g_,m_),wr(g_,m_,"esm2020");let w_,E_=null;function y_(){const e=E_;return E_=null,e}function D_(e){E_=e,ly(Sy,e)}let __=Promise.resolve();const b_=()=>{gn.dispatch(rn())};ry(()=>{my(),Qo(zE).useDeviceLanguage(),__=(async()=>{await async function(){if(Mn())return!1;if(!Vn())return!1;if(!Un())return!1;try{return await Hn()}catch(e){return!1}}()&&(w_=d_(zE))})(),xa(WE,e=>{ly(wy,{user:cy(e)}),e?(gn.dispatch(tn(!0)),gn.dispatch(rn()),gn.dispatch(ln(e.uid)),gn.dispatch(un(e.displayName??"")),gn.dispatch(pn(e.email||"")),gn.dispatch(dn(e.photoURL||"")),gn.dispatch(cn(!0===e.emailVerified)),gn.dispatch(en(e.displayName??"")),gn.dispatch(Zt(e.photoURL||""))):(gn.dispatch(tn(!1)),gn.dispatch(ln("")),gn.dispatch(un("")),gn.dispatch(pn("")),gn.dispatch(dn("")),gn.dispatch(cn(!1)),gn.dispatch(en("")),gn.dispatch(Zt("")))})});const v_=async e=>{const t=WE.currentUser;if(!t||!t.email)return D_({code:"pwa/signed-out",message:"Sign in first."}),!1;try{const n=pa.credential(t.email,e);return await async function(e,t){return va(Zn(e),t)}(t,n),!0}catch(e){return D_(uy(e)),!1}},I_=async()=>{if(!sy()){const e={code:"pwa/not-ready",message:"Sign-in is not ready yet."};throw ly(Sy,e),new Error(e.message)}try{await function(e){return Zn(e).signOut()}(WE),ly(yy,{user:null})}catch(e){throw ly(Sy,uy(e)),e}},T_=async()=>{await __,w_&&C_(w_,"create_account")},A_=async()=>{await __,w_&&C_(w_,"delete_account")},O_=async(e,t)=>{await aw(Ld(KE,e,t))};let S_="",N_=!1,R_=!1;function k_(e){if(!e)return S_="",N_=!1,!1;const t=!0===e.emailVerified;return e.uid!==S_?(S_=e.uid,N_=t,!1):!N_&&t?(N_=!0,!0):(N_=t,!1)}function L_(e){gn.dispatch(cn(!0));const t=cy({...e,emailVerified:!0});t&&ly(Ry,{user:t})}async function x_(e){if(!sy())return!1;const t=WE.currentUser;if(!t)return k_(null),!1;try{await t.reload()}catch(n){return e&&ly(Sy,uy(n)),!0===t.emailVerified}return gn.dispatch(cn(!0===t.emailVerified)),k_(t)&&L_(t),!0===t.emailVerified}function F_(){x_(!1)}function P_(){"visible"===document.visibilityState&&x_(!1)}function M_(e,t){const n={code:e,message:t};throw ly(Sy,n),Object.assign(new Error(t),n)}async function G_(){sy()||M_("pwa/not-ready","Sign-in is not ready yet.");const e=WE.currentUser;if(e||M_("pwa/signed-out","Sign in first."),e.email||M_("pwa/missing-email","Enter an email address."),e.emailVerified)return!1;const t=ny();try{t?await Na(e,t):await Na(e)}catch(e){throw ly(Sy,uy(e)),e}return ly(Ny,{email:e.email}),!0}async function U_(){return x_(!0)}R_||(R_=!0,ry(()=>{xa(WE,e=>{e&&k_(e)&&L_(e),e||k_(null)}),"undefined"!=typeof window&&(window.addEventListener("focus",F_),document.addEventListener("visibilitychange",P_))}));const H_=i`
469
584
 
470
585
  .notice {
471
586
  margin: 4px 16px 8px;
@@ -482,7 +597,7 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
482
597
  line-height: 1.45;
483
598
  }
484
599
 
485
- `;let O_="";const A_=new Set;function S_(){return O_}function N_(e){return A_.add(e),()=>{A_.delete(e)}}var R_=function(e,t,n,s){var r,i=arguments.length,a=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,s);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},k_=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};let L_=class extends ie{constructor(){super(),this.source="",this.email="",this.password="",this.status="",this.tone="",this.busy=!1,this.showPassword=!1,this.notice="",this.newAccount=async(e,t)=>{this.busy=!0,this.tone="",this.status="";try{const n=await async function(e,t,n){if(hr(e.app))return Promise.reject(Mr(e));const s=Vi(e),r=Xi(s,{returnSecureToken:!0,email:t,password:n,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",ma),i=await r.catch(t=>{throw"auth/password-does-not-meet-requirements"===t.code&&Ia(e),t}),a=await wa._fromIdTokenResponse(s,"signIn",i);return await s._updateCurrentUser(a.user),a}(JE,e,t);await p_();const s=wy(n.user);s&&Ey(ay,{user:s});try{await v_(),this.notice="Check your inbox for the verification email. You can still sign in.",function(e){O_=e,A_.forEach(e=>e())}(e)}catch(e){this.tone="error",this.status=Ay(e)}}catch(e){this.show(yy(e))}finally{this.busy=!1}}}static get styles(){return[Dn,Ny,Ry,Sy,ky,Ly,T_,Fy,i`
600
+ `;let V_="";const j_=new Set;function $_(){return V_}function J_(e){return j_.add(e),()=>{j_.delete(e)}}var q_=function(e,t,n,s){var r,i=arguments.length,a=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,s);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},z_=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};let K_=class extends ie{constructor(){super(),this.source="",this.hideGoogle=!1,this.email="",this.password="",this.status="",this.tone="",this.busy=!1,this.showPassword=!1,this.notice="",this.newAccount=async(e,t)=>{this.busy=!0,this.tone="",this.status="";try{const n=await async function(e,t,n){if(pr(e.app))return Promise.reject(Gr(e));const s=$i(e),r=ea(s,{returnSecureToken:!0,email:t,password:n,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",Ea),i=await r.catch(t=>{throw"auth/password-does-not-meet-requirements"===t.code&&Aa(e),t}),a=await ya._fromIdTokenResponse(s,"signIn",i);return await s._updateCurrentUser(a.user),a}(WE,e,t);await T_();const s=cy(n.user);s&&ly(Dy,{user:s});try{await G_(),this.notice="Check your inbox for the verification email. You can still sign in.",function(e){V_=e,j_.forEach(e=>e())}(e)}catch(e){this.tone="error",this.status=Hy(e)}}catch(e){this.show(uy(e))}finally{this.busy=!1}}}connectedCallback(){super.connectedCallback(),this.adoptRedirect()}updated(){this.adoptRedirect()}adoptRedirect(){if(!this.classList.contains("opened"))return;const e=fy();e&&this.show(e)}static get styles(){return[_n,jy,$y,Vy,Jy,qy,H_,Ky,i`
486
601
 
487
602
  :host {
488
603
  background-color: var(--section_background_color, #fffdf8);
@@ -541,17 +656,17 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
541
656
  type= "${this.showPassword?"text":"password"}"
542
657
  autocomplete= "new-password"
543
658
  minlength= "${8}"
544
- maxlength= "${Dy}"
659
+ maxlength= "${Ly}"
545
660
  aria-invalid= "${"error"===this.tone?"true":"false"}"
546
661
  aria-describedby="${n} ${s}"
547
662
  @input= "${this.handlePassword}"
548
663
  @change= "${this.handlePassword}">
549
664
 
550
- ${Py(this.showPassword,()=>{this.showPassword=!this.showPassword})}
665
+ ${Qy(this.showPassword,()=>{this.showPassword=!this.showPassword})}
551
666
 
552
667
  </span>
553
668
 
554
- <p id="${n}" class="hint" part="hint">${_y}</p>
669
+ <p id="${n}" class="hint" part="hint">${xy}</p>
555
670
 
556
671
  </label>
557
672
 
@@ -559,7 +674,9 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
559
674
 
560
675
  <li>
561
676
 
562
- ${xy(s,this.status,this.tone)}
677
+ ${zy(s,this.status,this.tone)}
678
+
679
+ ${this.hideGoogle?"":Yy(this.busy,()=>{this.google()})}
563
680
 
564
681
  <button
565
682
  type= "submit"
@@ -584,12 +701,12 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
584
701
 
585
702
  </form>
586
703
 
587
- `}change(){gn.dispatch(Yt(this.source))}show(e){this.tone="error",this.status=Ay(e),Ey(dy,e)}readFields(){const e=this.renderRoot.querySelector('input[type="email"]'),t=this.renderRoot.querySelector('input[name="new-password"]');this.email=e?.value??"",this.password=t?.value??""}_handleSubmit(e){e.preventDefault(),this.signUp()}handleEmail(e){const t=e.target;this.email=t.value}handlePassword(e){const t=e.target;this.password=t.value}async signUp(){if(this.busy)return;if(this.readFields(),this.email.length<4)return void this.show({code:"pwa/missing-email",message:"Enter an email address."});const e=Ty(this.password);e?this.show(e):await this.newAccount(this.email,this.password)}};function x_(e){if(XE())return;const t=e.getAttribute("firebase-config");if(t)try{ty({config:JSON.parse(t)})}catch(e){Ey(dy,yy(e))}}function F_(e,t){const n=e.trim();if(n){return n.split(/\s+/).slice(0,2).map(e=>e.charAt(0)).join("").toUpperCase()}const s=t.trim();return s?s.charAt(0).toUpperCase():""}function P_(e,t){const n=e.trim();if(n)return n;const s=t.trim();return s||"Account"}R_([le({type:String}),k_("design:type",Object)],L_.prototype,"source",void 0),R_([ue(),k_("design:type",Object)],L_.prototype,"email",void 0),R_([ue(),k_("design:type",Object)],L_.prototype,"password",void 0),R_([ue(),k_("design:type",Object)],L_.prototype,"status",void 0),R_([ue(),k_("design:type",Object)],L_.prototype,"tone",void 0),R_([ue(),k_("design:type",Object)],L_.prototype,"busy",void 0),R_([ue(),k_("design:type",Object)],L_.prototype,"showPassword",void 0),R_([ue(),k_("design:type",Object)],L_.prototype,"notice",void 0),L_=R_([oe("form-signup"),k_("design:paramtypes",[])],L_);var M_=function(e,t,n,s){var r,i=arguments.length,a=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,s);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},G_=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};let U_=class extends(he(gn)(ie)){constructor(){super(),this.subscribe=!1,this._name="",this._email="",this._verified=!1,this._notice="",this._log=!1,this._sign=!1,this.stopNotice=null}connectedCallback(){x_(this),super.connectedCallback(),this._notice=S_(),this.stopNotice=N_(()=>{this._notice=S_()})}disconnectedCallback(){this.stopNotice?.(),this.stopNotice=null,super.disconnectedCallback()}stateChanged(e){this._name=e.backend.name,this._email=e.backend.email,this._verified=Boolean(e.backend?.verified),this._log=e.frontend.login,this._sign=e.frontend.registerTwo}static get styles(){return[mn,wn,En,Dn,yn,Fy,T_]}render(){return H`
704
+ `}change(){gn.dispatch(Yt(this.source))}async google(){if(!this.busy){this.busy=!0,this.tone="",this.status="";try{await gy()}catch(e){this.show(uy(e))}finally{this.busy=!1}}}show(e){this.tone="error",this.status=Hy(e),ly(Sy,e)}readFields(){const e=this.renderRoot.querySelector('input[type="email"]'),t=this.renderRoot.querySelector('input[name="new-password"]');this.email=e?.value??"",this.password=t?.value??""}_handleSubmit(e){e.preventDefault(),this.signUp()}handleEmail(e){const t=e.target;this.email=t.value}handlePassword(e){const t=e.target;this.password=t.value}async signUp(){if(this.busy)return;if(this.readFields(),this.email.length<4)return void this.show({code:"pwa/missing-email",message:"Enter an email address."});const e=Gy(this.password);e?this.show(e):await this.newAccount(this.email,this.password)}};function Q_(e){if(sy())return;const t=e.getAttribute("firebase-config");if(t)try{ay({config:JSON.parse(t)})}catch(e){ly(Sy,uy(e))}}function W_(e,t){const n=e.trim();if(n){return n.split(/\s+/).slice(0,2).map(e=>e.charAt(0)).join("").toUpperCase()}const s=t.trim();return s?s.charAt(0).toUpperCase():""}function Y_(e,t){const n=e.trim();if(n)return n;const s=t.trim();return s||"Account"}q_([le({type:String}),z_("design:type",Object)],K_.prototype,"source",void 0),q_([le({type:Boolean,attribute:"hide-google",reflect:!0}),z_("design:type",Object)],K_.prototype,"hideGoogle",void 0),q_([ue(),z_("design:type",Object)],K_.prototype,"email",void 0),q_([ue(),z_("design:type",Object)],K_.prototype,"password",void 0),q_([ue(),z_("design:type",Object)],K_.prototype,"status",void 0),q_([ue(),z_("design:type",Object)],K_.prototype,"tone",void 0),q_([ue(),z_("design:type",Object)],K_.prototype,"busy",void 0),q_([ue(),z_("design:type",Object)],K_.prototype,"showPassword",void 0),q_([ue(),z_("design:type",Object)],K_.prototype,"notice",void 0),K_=q_([oe("form-signup"),z_("design:paramtypes",[])],K_);var X_=function(e,t,n,s){var r,i=arguments.length,a=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,s);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Z_=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};let eb=class extends(he(gn)(ie)){constructor(){super(),this.subscribe=!1,this.hideGoogle=!1,this._name="",this._email="",this._verified=!1,this._notice="",this._log=!1,this._sign=!1,this.stopNotice=null}connectedCallback(){Q_(this),super.connectedCallback(),this._notice=$_(),this.stopNotice=J_(()=>{this._notice=$_()})}disconnectedCallback(){this.stopNotice?.(),this.stopNotice=null,super.disconnectedCallback()}stateChanged(e){this._name=e.backend.name,this._email=e.backend.email,this._verified=Boolean(e.backend?.verified),this._log=e.frontend.login,this._sign=e.frontend.registerTwo}static get styles(){return[En,yn,Dn,_n,mn,Ky,H_]}render(){return H`
588
705
 
589
706
  <section class="service" part="panel">
590
707
 
591
708
  <header part="header">
592
- <h3 part="title">${this._log?P_(this._name,this._email):this._sign===this.subscribe?"Login":"Subscribe"}</h3>
709
+ <h3 part="title">${this._log?Y_(this._name,this._email):this._sign===this.subscribe?"Login":"Subscribe"}</h3>
593
710
  </header>
594
711
 
595
712
  <!-- Logged-out State -->
@@ -603,14 +720,16 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
603
720
  <!-- Required - subscribe chooses the open form -->
604
721
  <form-login
605
722
  source= "page"
606
- exportparts= "email: login-email, password: login-password, submit: login-submit, switch: login-switch, forgot: login-forgot, status: login-status, reveal: login-reveal"
723
+ ?hide-google= "${this.hideGoogle}"
724
+ exportparts= "email: login-email, password: login-password, submit: login-submit, switch: login-switch, forgot: login-forgot, status: login-status, reveal: login-reveal, google: login-google"
607
725
  ?inert= "${this._sign!==this.subscribe}"
608
726
  class= "content ${this._sign===this.subscribe?"opened":"closed"} "></form-login>
609
727
 
610
728
  <!-- Sign-up State -->
611
729
  <form-signup
612
730
  source= "page"
613
- exportparts= "email: signup-email, password: signup-password, submit: signup-submit, switch: signup-switch, status: signup-status, reveal: signup-reveal, notice: signup-notice"
731
+ ?hide-google= "${this.hideGoogle}"
732
+ exportparts= "email: signup-email, password: signup-password, submit: signup-submit, switch: signup-switch, status: signup-status, reveal: signup-reveal, notice: signup-notice, google: signup-google"
614
733
  ?inert= "${this._sign===this.subscribe}"
615
734
  class= "content ${!this._sign===this.subscribe?"opened":"closed"}"></form-signup>
616
735
 
@@ -634,19 +753,16 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
634
753
 
635
754
  </section>
636
755
 
637
- `}};M_([le({type:Boolean,attribute:!0,reflect:!0}),G_("design:type",Object)],U_.prototype,"subscribe",void 0),M_([ue(),G_("design:type",Object)],U_.prototype,"_name",void 0),M_([ue(),G_("design:type",Object)],U_.prototype,"_email",void 0),M_([ue(),G_("design:type",Object)],U_.prototype,"_verified",void 0),M_([ue(),G_("design:type",Object)],U_.prototype,"_notice",void 0),M_([ue(),G_("design:type",Object)],U_.prototype,"_log",void 0),M_([ue(),G_("design:type",Object)],U_.prototype,"_sign",void 0),U_=M_([oe("user-login"),G_("design:paramtypes",[])],U_);const H_=H`<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"></path></svg>`,V_=i`
756
+ `}};X_([le({type:Boolean,attribute:!0,reflect:!0}),Z_("design:type",Object)],eb.prototype,"subscribe",void 0),X_([le({type:Boolean,attribute:"hide-google",reflect:!0}),Z_("design:type",Object)],eb.prototype,"hideGoogle",void 0),X_([ue(),Z_("design:type",Object)],eb.prototype,"_name",void 0),X_([ue(),Z_("design:type",Object)],eb.prototype,"_email",void 0),X_([ue(),Z_("design:type",Object)],eb.prototype,"_verified",void 0),X_([ue(),Z_("design:type",Object)],eb.prototype,"_notice",void 0),X_([ue(),Z_("design:type",Object)],eb.prototype,"_log",void 0),X_([ue(),Z_("design:type",Object)],eb.prototype,"_sign",void 0),eb=X_([oe("user-login"),Z_("design:paramtypes",[])],eb);const tb=H`<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"></path></svg>`,nb=i`
638
757
 
639
758
  .spec[on] { display: grid; }
640
759
  .spec { display: none; }
641
760
 
642
- `,j_=i`
761
+ `,sb=i`
643
762
 
644
763
  :host {
645
- /* Optional - --pwa_slide_time: 1.4s. Optional - --pwa_slide_ease: ease-in-out. */
646
764
  position: var(--pwa_drawer_position, absolute);
647
765
  z-index: 4;
648
- max-height: 0px;
649
- transition: max-height var(--pwa_slide_time, 1.4s) var(--pwa_slide_ease, ease-in-out);
650
766
  overflow: hidden;
651
767
  height: auto;
652
768
  width: 100%;
@@ -663,10 +779,8 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
663
779
  left: 0;
664
780
  right: 0;
665
781
  z-index: 5;
666
- max-height: 100%;
667
782
  background-color: var(--pwa_drawer_background_color, #fffdf8);
668
783
  box-shadow: 0 18px 40px rgba(28, 36, 48, 0.16);
669
- transition: max-height var(--pwa_slide_time, 1.4s) var(--pwa_slide_ease, ease-in-out);
670
784
  }
671
785
 
672
786
  .userDrawer > .spec > .wrapper {
@@ -687,16 +801,9 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
687
801
  /* top: 0;
688
802
  left: 0;
689
803
  right: 0; */
690
- transition-duration: var(--pwa_slide_time, 1.4s);
691
- transition-timing-function: var(--pwa_slide_ease, ease-in-out);
692
804
  overflow: hidden;
693
805
  box-sizing: border-box;
694
806
  height: auto;
695
- /*
696
- transition-property: visibility, max-height;
697
- animation-name: animay;
698
- animation-duration: 1.4s;
699
- */
700
807
  border-bottom: var(--pwa_drawer_border, 0);
701
808
  z-index: var(--pwa_drawer_z-index, 3);
702
809
  background-color: var(--pwa_drawer_background_color, #fffdf8);
@@ -704,43 +811,7 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
704
811
  border-radius: var(--pwa_drawer_border-radius, 0 0 18px 18px);
705
812
  }
706
813
 
707
- .in {
708
- max-height: 0px;
709
- visibility: hidden;
710
- /* Required - hide only after the drawer has finished closing */
711
- transition:
712
- max-height var(--pwa_slide_time, 1.4s) var(--pwa_slide_ease, ease-in-out),
713
- visibility 0s linear var(--pwa_slide_time, 1.4s),
714
- transform var(--pwa_slide_time, 1.4s) var(--pwa_slide_ease, ease-in-out);
715
- }
716
-
717
- .spec-in {
718
- transform: translate3d(0, -100%, 0);
719
- transition: transform calc(var(--pwa_slide_time, 1.4s) * 1.071) var(--pwa_slide_ease, ease-in-out);
720
- z-index: -1;
721
- }
722
-
723
- .out {
724
- max-height: 100%;
725
- visibility: visible;
726
- transition:
727
- max-height var(--pwa_slide_time, 1.4s) var(--pwa_slide_ease, ease-in-out),
728
- visibility 0s linear 0s,
729
- transform var(--pwa_slide_time, 1.4s) var(--pwa_slide_ease, ease-in-out);
730
- }
731
-
732
- .spec-out {
733
- transform: translate3d(0, 0, 0);
734
- /* Required - forms follow the drawer. 1.4 * 1.571 is about 2.2s */
735
- transition: transform calc(var(--pwa_slide_time, 1.4s) * 1.571) var(--pwa_slide_ease, ease-in-out);
736
- z-index: -1;
737
- }
738
-
739
- @media (prefers-reduced-motion: reduce) {
740
- :host { --pwa_slide_time: 0s; }
741
- }
742
-
743
- `,$_=i`
814
+ `,rb=i`
744
815
 
745
816
  .exit {
746
817
  display: grid;
@@ -798,7 +869,7 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
798
869
 
799
870
 
800
871
 
801
- `,J_=i`
872
+ `,ib=i`
802
873
 
803
874
  a {
804
875
  font-size: 0.95rem;
@@ -807,7 +878,7 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
807
878
  text-decoration: none;
808
879
  }
809
880
 
810
- `,q_=i`
881
+ `,ab=i`
811
882
 
812
883
  .setLog > a,
813
884
  .setLog > button.settings {
@@ -844,13 +915,13 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
844
915
  }
845
916
 
846
917
 
847
- `;function z_(e){const t=[],n=e=>{e.querySelectorAll("button, a[href], input, select, textarea").forEach(e=>{e.hasAttribute("disabled")||e.tabIndex<0||function(e){let t=e;for(;t;){if(t instanceof HTMLElement){if(t.classList.contains("closed"))return!0;if(t.classList.contains("spec")&&!t.hasAttribute("on"))return!0}if(t instanceof Element&&t.assignedSlot&&t.assignedSlot!==t){t=t.assignedSlot;continue}if(t.parentElement){t=t.parentElement;continue}const e=t.getRootNode();if(!(e instanceof ShadowRoot))break;t=e.host}return!1}(e)||t.push(e)}),e.querySelectorAll("*").forEach(e=>{e.shadowRoot&&n(e.shadowRoot)})};return e.shadowRoot&&n(e.shadowRoot),n(e),t.filter((e,n)=>t.indexOf(e)===n)}function K_(){let e=document.activeElement;for(;e?.shadowRoot?.activeElement instanceof HTMLElement;)e=e.shadowRoot.activeElement;return e}const Q_=H`
918
+ `;function ob(e){const t=[],n=e=>{e.querySelectorAll("button, a[href], input, select, textarea").forEach(e=>{e.hasAttribute("disabled")||e.tabIndex<0||function(e){let t=e;for(;t;){if(t instanceof HTMLElement){if(t.classList.contains("closed"))return!0;if(t.classList.contains("spec")&&!t.hasAttribute("on"))return!0}if(t instanceof Element&&t.assignedSlot&&t.assignedSlot!==t){t=t.assignedSlot;continue}if(t.parentElement){t=t.parentElement;continue}const e=t.getRootNode();if(!(e instanceof ShadowRoot))break;t=e.host}return!1}(e)||t.push(e)}),e.querySelectorAll("*").forEach(e=>{e.shadowRoot&&n(e.shadowRoot)})};return e.shadowRoot&&n(e.shadowRoot),n(e),t.filter((e,n)=>t.indexOf(e)===n)}function Bb(){let e=document.activeElement;for(;e?.shadowRoot?.activeElement instanceof HTMLElement;)e=e.shadowRoot.activeElement;return e}const cb=H`
848
919
  <span class="verified" part="verified" role="img" aria-label="Email verified">
849
920
  <svg viewBox="0 0 24 24" aria-hidden="true">
850
921
  <path d="M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"></path>
851
922
  </svg>
852
923
  </span>
853
- `,W_=i`
924
+ `,lb=i`
854
925
 
855
926
  .verified {
856
927
  display: inline-grid;
@@ -885,7 +956,7 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
885
956
  min-width: 0;
886
957
  }
887
958
 
888
- `;var Y_=function(e,t,n,s){var r,i=arguments.length,a=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,s);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},X_=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};class Z_ extends(he(gn)(ie)){constructor(){super(),this.login=!1,this.verified=!1,this.email="",this.status="",this.tone="",this.busy=!1,this.cooldown=0,this.timer=0,this.resend=async e=>{if(e.preventDefault(),!(this.busy||this.cooldown>0||this.verified)){this.busy=!0,this.tone="",this.status="";try{await v_()&&this.showSent()}catch(e){this.showFirebase(e)}finally{this.busy=!1}}}}disconnectedCallback(){this.clearWait(),super.disconnectedCallback()}stateChanged(e){this.login=Boolean(e.frontend?.login),this.verified=Boolean(e.backend?.verified),this.email=e.backend?.email??"",this.hidden=!this.login,this.verified&&this.clearWait()}static get styles(){return[Sy,Fy,W_,i`
959
+ `;var ub=function(e,t,n,s){var r,i=arguments.length,a=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,s);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},hb=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};class pb extends(he(gn)(ie)){constructor(){super(),this.login=!1,this.verified=!1,this.email="",this.status="",this.tone="",this.busy=!1,this.cooldown=0,this.timer=0,this.resend=async e=>{if(e.preventDefault(),!(this.busy||this.cooldown>0||this.verified)){this.busy=!0,this.tone="",this.status="";try{await G_()&&this.showSent()}catch(e){this.showFirebase(e)}finally{this.busy=!1}}}}disconnectedCallback(){this.clearWait(),super.disconnectedCallback()}stateChanged(e){this.login=Boolean(e.frontend?.login),this.verified=Boolean(e.backend?.verified),this.email=e.backend?.email??"",this.hidden=!this.login,this.verified&&this.clearWait()}static get styles(){return[Vy,Ky,lb,i`
889
960
 
890
961
  :host { display: block; }
891
962
 
@@ -966,7 +1037,7 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
966
1037
  <div class="notice ok" part="notice">
967
1038
  <p class="row">
968
1039
  <span class="mail">${this.email}</span>
969
- ${Q_}
1040
+ ${cb}
970
1041
  </p>
971
1042
  </div>
972
1043
  `;return H`
@@ -1001,7 +1072,7 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
1001
1072
  </form>
1002
1073
 
1003
1074
  </div>
1004
- `}showSent(){this.tone="",this.status="Check your inbox for the verification email.",this.cooldown=45,this.armCooldown(),this.updateComplete.then(()=>{this.focusStatus()})}showFirebase(e){this.tone="error",this.status=Ay(e),this.updateComplete.then(()=>{this.focusStatus()})}focusStatus(){const e=this.renderRoot.querySelector("#pwa-verify-status");e?.focus()}clearWait(){window.clearInterval(this.timer),this.timer=0,this.cooldown=0}armCooldown(){window.clearInterval(this.timer),this.timer=window.setInterval(()=>{if(this.cooldown<=1)return this.cooldown=0,window.clearInterval(this.timer),void(this.timer=0);this.cooldown-=1},1e3)}}Y_([ue(),X_("design:type",Object)],Z_.prototype,"login",void 0),Y_([ue(),X_("design:type",Object)],Z_.prototype,"verified",void 0),Y_([ue(),X_("design:type",Object)],Z_.prototype,"email",void 0),Y_([ue(),X_("design:type",Object)],Z_.prototype,"status",void 0),Y_([ue(),X_("design:type",Object)],Z_.prototype,"tone",void 0),Y_([ue(),X_("design:type",Object)],Z_.prototype,"busy",void 0),Y_([ue(),X_("design:type",Object)],Z_.prototype,"cooldown",void 0),customElements.define("email-verify",Z_);var eb=function(e,t,n,s){var r,i=arguments.length,a=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,s);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},tb=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};let nb=class extends(he(gn)(ie)){constructor(){super(),this.url="",this.drawer=!1,this.subscribe=!1,this.name="",this.email="",this.verified=!1,this.notice="",this.user=!1,this.signup=!1,this.wasOpen=!1,this.sawOpen=!1,this.returnFocus=null,this.stopNotice=null,this.onKey=e=>{if(!this.drawer)return;if("Escape"===e.key)return e.preventDefault(),void gn.dispatch(rn());if("Tab"!==e.key)return;const t=z_(this);if(!t.length)return;const n=t[0],s=t[t.length-1],r=K_(),i=!!r&&t.includes(r);e.shiftKey?i&&r!==n||(e.preventDefault(),s.focus()):i&&r!==s||(e.preventDefault(),n.focus())},this.onLightClick=e=>{if(e.defaultPrevented)return;const t=e.target;if(!(t instanceof Element))return;const n=t.closest("a, button");n instanceof HTMLElement&&this.contains(n)&&(this.shadowRoot?.contains(n)||gn.dispatch(rn()))},this.onSettings=e=>{const t=this.destination();if(!this.dispatchEvent(new CustomEvent(py,{bubbles:!0,composed:!0,cancelable:!0,detail:{url:t}})))return void e.preventDefault();if(gn.dispatch(rn()),t)return;e.preventDefault();const n=document.querySelector("user-settings");n instanceof HTMLElement&&n.scrollIntoView({block:"nearest"})}}connectedCallback(){x_(this),super.connectedCallback(),this.addEventListener("keydown",this.onKey),this.addEventListener("click",this.onLightClick),this.notice=S_(),this.stopNotice=N_(()=>{this.notice=S_()})}disconnectedCallback(){this.removeEventListener("keydown",this.onKey),this.removeEventListener("click",this.onLightClick),this.stopNotice?.(),this.stopNotice=null,super.disconnectedCallback()}stateChanged(e){const t=e.frontend.drawer;this.name=e.backend.name,this.email=e.backend.email,this.verified=Boolean(e.backend?.verified),this.drawer=t,this.user=e.frontend.login,this.signup=e.frontend.registerOne;(this.sawOpen?t!==this.wasOpen:t)&&function(e,t,n){e.dispatchEvent(new CustomEvent(t,{...my,detail:n}))}(this,hy,{open:t}),this.wasOpen=t,this.sawOpen=!0}updated(e){if(e.has("drawer")){if(this.drawer){const e=K_();return this.returnFocus=e&&!this.contains(e)?e:this.returnFocus,this.shadowRoot?.querySelector(".close")?.focus(),void y_(!1)}this.returnFocus?.focus(),this.returnFocus=null}}firstUpdated(){this.shadowRoot.querySelector(".close").addEventListener("click",()=>{gn.dispatch(rn())}),this.shadowRoot.querySelector(".leave").addEventListener("click",async()=>{if(this.user)try{await h_()}catch{return}gn.dispatch(rn())});this.shadowRoot.querySelectorAll("a").forEach(e=>{e.addEventListener("click",()=>{gn.dispatch(rn())})})}static get styles(){return[V_,yn,j_,$_,J_,q_,Dn,Fy,T_,W_,i`
1075
+ `}showSent(){this.tone="",this.status="Check your inbox for the verification email.",this.cooldown=45,this.armCooldown(),this.updateComplete.then(()=>{this.focusStatus()})}showFirebase(e){this.tone="error",this.status=Hy(e),this.updateComplete.then(()=>{this.focusStatus()})}focusStatus(){const e=this.renderRoot.querySelector("#pwa-verify-status");e?.focus()}clearWait(){window.clearInterval(this.timer),this.timer=0,this.cooldown=0}armCooldown(){window.clearInterval(this.timer),this.timer=window.setInterval(()=>{if(this.cooldown<=1)return this.cooldown=0,window.clearInterval(this.timer),void(this.timer=0);this.cooldown-=1},1e3)}}ub([ue(),hb("design:type",Object)],pb.prototype,"login",void 0),ub([ue(),hb("design:type",Object)],pb.prototype,"verified",void 0),ub([ue(),hb("design:type",Object)],pb.prototype,"email",void 0),ub([ue(),hb("design:type",Object)],pb.prototype,"status",void 0),ub([ue(),hb("design:type",Object)],pb.prototype,"tone",void 0),ub([ue(),hb("design:type",Object)],pb.prototype,"busy",void 0),ub([ue(),hb("design:type",Object)],pb.prototype,"cooldown",void 0),customElements.define("email-verify",pb);var db=function(e,t,n,s){var r,i=arguments.length,a=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,s);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},fb=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};let Cb=class extends(he(gn)(ie)){constructor(){super(),this.url="",this.drawer=!1,this.subscribe=!1,this.hideGoogle=!1,this.name="",this.email="",this.verified=!1,this.notice="",this.user=!1,this.signup=!1,this.wasOpen=!1,this.sawOpen=!1,this.returnFocus=null,this.stopNotice=null,this.onKey=e=>{if(!this.drawer)return;if("Escape"===e.key)return e.preventDefault(),void gn.dispatch(rn());if("Tab"!==e.key)return;const t=ob(this);if(!t.length)return;const n=t[0],s=t[t.length-1],r=Bb(),i=!!r&&t.includes(r);e.shiftKey?i&&r!==n||(e.preventDefault(),s.focus()):i&&r!==s||(e.preventDefault(),n.focus())},this.onLightClick=e=>{if(e.defaultPrevented)return;const t=e.target;if(!(t instanceof Element))return;const n=t.closest("a, button");n instanceof HTMLElement&&this.contains(n)&&(this.shadowRoot?.contains(n)||gn.dispatch(rn()))},this.onSettings=e=>{const t=this.destination();if(!this.dispatchEvent(new CustomEvent(Oy,{bubbles:!0,composed:!0,cancelable:!0,detail:{url:t}})))return void e.preventDefault();if(gn.dispatch(rn()),t)return;e.preventDefault();const n=document.querySelector("user-settings");n instanceof HTMLElement&&n.scrollIntoView({block:"nearest"})}}connectedCallback(){Q_(this),super.connectedCallback(),this.addEventListener("keydown",this.onKey),this.addEventListener("click",this.onLightClick),this.notice=$_(),this.stopNotice=J_(()=>{this.notice=$_()})}disconnectedCallback(){this.removeEventListener("keydown",this.onKey),this.removeEventListener("click",this.onLightClick),this.stopNotice?.(),this.stopNotice=null,super.disconnectedCallback()}stateChanged(e){const t=e.frontend.drawer;this.name=e.backend.name,this.email=e.backend.email,this.verified=Boolean(e.backend?.verified),this.drawer=t,this.user=e.frontend.login,this.signup=e.frontend.registerOne;(this.sawOpen?t!==this.wasOpen:t)&&function(e,t,n){e.dispatchEvent(new CustomEvent(t,{...By,detail:n}))}(this,Ay,{open:t}),this.wasOpen=t,this.sawOpen=!0}updated(e){if(e.has("drawer")){if(this.drawer){const e=Bb();return this.returnFocus=e&&!this.contains(e)?e:this.returnFocus,this.shadowRoot?.querySelector(".close")?.focus(),void x_(!1)}this.returnFocus?.focus(),this.returnFocus=null}}firstUpdated(){this.shadowRoot.querySelector(".close").addEventListener("click",()=>{gn.dispatch(rn())}),this.shadowRoot.querySelector(".leave").addEventListener("click",async()=>{if(this.user)try{await I_()}catch{return}gn.dispatch(rn())});this.shadowRoot.querySelectorAll("a").forEach(e=>{e.addEventListener("click",()=>{gn.dispatch(rn())})})}static get styles(){return[nb,mn,wn,sb,rb,ib,ab,_n,Ky,H_,lb,i`
1005
1076
  .exit > h3 {
1006
1077
  display: flex;
1007
1078
  align-items: center;
@@ -1065,10 +1136,10 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
1065
1136
  <header class="exit" part="header">
1066
1137
  <div></div>
1067
1138
  <h3 id="pwa-drawer-title" part="title">
1068
- <span class="who">${!1===this.user?this.signup===this.subscribe?"Login":"Subscribe":P_(this.name,this.email)}</span>
1069
- ${this.user?this.verified?Q_:H`<span class="unverified" part="unverified">Not verified</span>`:""}
1139
+ <span class="who">${!1===this.user?this.signup===this.subscribe?"Login":"Subscribe":Y_(this.name,this.email)}</span>
1140
+ ${this.user?this.verified?cb:H`<span class="unverified" part="unverified">Not verified</span>`:""}
1070
1141
  </h3>
1071
- <button class="close" part="close" type="button" aria-label="Close">${H_}</button>
1142
+ <button class="close" part="close" type="button" aria-label="Close">${tb}</button>
1072
1143
  </header>
1073
1144
 
1074
1145
  <!-- Logged-out State -->
@@ -1082,7 +1153,8 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
1082
1153
  <!-- Log-in State -->
1083
1154
  <form-login
1084
1155
  source="drawer"
1085
- exportparts="email: login-email, password: login-password, submit: login-submit, switch: login-switch, forgot: login-forgot, status: login-status, reveal: login-reveal"
1156
+ ?hide-google="${this.hideGoogle}"
1157
+ exportparts="email: login-email, password: login-password, submit: login-submit, switch: login-switch, forgot: login-forgot, status: login-status, reveal: login-reveal, google: login-google"
1086
1158
  ?inert="${this.signup!==this.subscribe}"
1087
1159
  class="content ${this.signup===this.subscribe?"opened":"closed"} ">
1088
1160
  </form-login>
@@ -1090,7 +1162,8 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
1090
1162
  <!-- Sign-up State -->
1091
1163
  <form-signup
1092
1164
  source="drawer"
1093
- exportparts="email: signup-email, password: signup-password, submit: signup-submit, switch: signup-switch, status: signup-status, reveal: signup-reveal, notice: signup-notice"
1165
+ ?hide-google="${this.hideGoogle}"
1166
+ exportparts="email: signup-email, password: signup-password, submit: signup-submit, switch: signup-switch, status: signup-status, reveal: signup-reveal, notice: signup-notice, google: signup-google"
1094
1167
  ?inert="${this.signup===this.subscribe}"
1095
1168
  class="content ${!this.signup===this.subscribe?"opened":"closed"} ">
1096
1169
  </form-signup>
@@ -1124,7 +1197,7 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
1124
1197
 
1125
1198
  </section>
1126
1199
 
1127
- `}destination(){return(this.url||"").trim()}settingsControl(){const e=this.destination();return e?H`<a href="${e}" part="settings" @click="${this.onSettings}">Settings</a>`:H`<button type="button" class="settings" part="settings" @click="${this.onSettings}">Settings</button>`}};eb([le({type:String,reflect:!0}),tb("design:type",Object)],nb.prototype,"url",void 0),eb([le({type:Boolean,attribute:!0,reflect:!0}),tb("design:type",Object)],nb.prototype,"drawer",void 0),eb([le({type:Boolean,attribute:!0,reflect:!0}),tb("design:type",Object)],nb.prototype,"subscribe",void 0),eb([ue(),tb("design:type",Object)],nb.prototype,"name",void 0),eb([ue(),tb("design:type",Object)],nb.prototype,"email",void 0),eb([ue(),tb("design:type",Object)],nb.prototype,"verified",void 0),eb([ue(),tb("design:type",Object)],nb.prototype,"notice",void 0),eb([ue(),tb("design:type",Object)],nb.prototype,"user",void 0),eb([ue(),tb("design:type",Object)],nb.prototype,"signup",void 0),nb=eb([oe("user-drawer"),tb("design:paramtypes",[])],nb);const sb=i`
1200
+ `}destination(){return(this.url||"").trim()}settingsControl(){const e=this.destination();return e?H`<a href="${e}" part="settings" @click="${this.onSettings}">Settings</a>`:H`<button type="button" class="settings" part="settings" @click="${this.onSettings}">Settings</button>`}};db([le({type:String,reflect:!0}),fb("design:type",Object)],Cb.prototype,"url",void 0),db([le({type:Boolean,attribute:!0,reflect:!0}),fb("design:type",Object)],Cb.prototype,"drawer",void 0),db([le({type:Boolean,attribute:!0,reflect:!0}),fb("design:type",Object)],Cb.prototype,"subscribe",void 0),db([le({type:Boolean,attribute:"hide-google",reflect:!0}),fb("design:type",Object)],Cb.prototype,"hideGoogle",void 0),db([ue(),fb("design:type",Object)],Cb.prototype,"name",void 0),db([ue(),fb("design:type",Object)],Cb.prototype,"email",void 0),db([ue(),fb("design:type",Object)],Cb.prototype,"verified",void 0),db([ue(),fb("design:type",Object)],Cb.prototype,"notice",void 0),db([ue(),fb("design:type",Object)],Cb.prototype,"user",void 0),db([ue(),fb("design:type",Object)],Cb.prototype,"signup",void 0),Cb=db([oe("user-drawer"),fb("design:paramtypes",[])],Cb);const gb=i`
1128
1201
 
1129
1202
  nav {
1130
1203
  overflow: hidden;
@@ -1202,7 +1275,7 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
1202
1275
  padding: 20px 16px 4px;
1203
1276
  }
1204
1277
 
1205
- `;var rb=function(e,t,n,s){var r,i=arguments.length,a=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,s);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},ib=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};class ab extends(he(gn)(ie)){constructor(){super(),this.photo="",this.emptyArtwork="",this.login=!1,this.person="",this.mail="",this.progress=0,this.error="",this.status="",this.tone="",this.busy=!1,this.saveImage=e=>{const t=e.target,n=t?.files?.[0],s=JE.currentUser;if(this.error="",this.tone="",!s)return void this.fail({code:"pwa/signed-out",message:"Sign in first."});if(!n)return void this.fail({code:"pwa/missing-file",message:"Choose a photo first."});this.busy=!0,this.progress=0,this.status="Uploading…";const r=FE(GE($E,"pwa-auth/"+s.uid+"/"+n.name),n,{cacheControl:"public,max-age=300",contentType:n.type||"application/octet-stream"});r.on("state_changed",e=>{const t=e.totalBytes>0?e.bytesTransferred/e.totalBytes*100:0;this.progress=isFinite(t)?t:0,"paused"===e.state?this.status="Upload is paused":this.status=`Uploading… ${Math.round(this.progress)}%`},e=>{this.busy=!1,this.progress=0,this.fail(e)},async()=>{try{const e=await function(e){return TE(e=Xn(e))}(r.snapshot.ref),t=JE.currentUser;if(!t)return void this.fail({code:"pwa/signed-out",message:"Sign in first."});await Na(t,{photoURL:e}),gn.dispatch(dn(e)),gn.dispatch(Zt(e)),this.photo=e,this.progress=100,this.tone="",this.error="",this.status="Photo saved.",Ey(By,{uid:t.uid,displayName:t.displayName,photoURL:e})}catch(e){this.fail(e)}finally{this.busy=!1}})}}stateChanged(e){this.login=e.frontend.login,this.photo=e.backend.photoURL,this.person=e.backend.name,this.mail=e.backend.email}static get styles(){return[Ny,Ly,i`
1278
+ `;var mb=function(e,t,n,s){var r,i=arguments.length,a=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,s);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},wb=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};class Eb extends(he(gn)(ie)){constructor(){super(),this.photo="",this.emptyArtwork="",this.login=!1,this.person="",this.mail="",this.progress=0,this.error="",this.status="",this.tone="",this.busy=!1,this.saveImage=e=>{const t=e.target,n=t?.files?.[0],s=WE.currentUser;if(this.error="",this.tone="",!s)return void this.fail({code:"pwa/signed-out",message:"Sign in first."});if(!n)return void this.fail({code:"pwa/missing-file",message:"Choose a photo first."});this.busy=!0,this.progress=0,this.status="Uploading…";const r=HE($E(QE,"pwa-auth/"+s.uid+"/"+n.name),n,{cacheControl:"public,max-age=300",contentType:n.type||"application/octet-stream"});r.on("state_changed",e=>{const t=e.totalBytes>0?e.bytesTransferred/e.totalBytes*100:0;this.progress=isFinite(t)?t:0,"paused"===e.state?this.status="Upload is paused":this.status=`Uploading… ${Math.round(this.progress)}%`},e=>{this.busy=!1,this.progress=0,this.fail(e)},async()=>{try{const e=await function(e){return RE(e=Zn(e))}(r.snapshot.ref),t=WE.currentUser;if(!t)return void this.fail({code:"pwa/signed-out",message:"Sign in first."});await ka(t,{photoURL:e}),gn.dispatch(dn(e)),gn.dispatch(Zt(e)),this.photo=e,this.progress=100,this.tone="",this.error="",this.status="Photo saved.",ly(by,{uid:t.uid,displayName:t.displayName,photoURL:e})}catch(e){this.fail(e)}finally{this.busy=!1}})}}stateChanged(e){this.login=e.frontend.login,this.photo=e.backend.photoURL,this.person=e.backend.name,this.mail=e.backend.email}static get styles(){return[jy,qy,i`
1206
1279
 
1207
1280
  :host {
1208
1281
  box-sizing: border-box;
@@ -1246,7 +1319,7 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
1246
1319
  background: var(--pwa_nav_on_background, #f3efe6);
1247
1320
  }
1248
1321
 
1249
- `]}letters(){return F_(this.person,this.mail)}render(){const e=this.letters(),t="string"==typeof this.photo?this.photo:"";return H`
1322
+ `]}letters(){return W_(this.person,this.mail)}render(){const e=this.letters(),t="string"==typeof this.photo?this.photo:"";return H`
1250
1323
  <label
1251
1324
  style="
1252
1325
  display: grid;
@@ -1303,8 +1376,8 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
1303
1376
 
1304
1377
  </label>
1305
1378
 
1306
- ${xy("pwa-photo-status",this.error||this.status,this.tone)}
1307
- `}fail(e){const t="object"==typeof e&&null!==e&&"code"in e&&"message"in e&&!(e instanceof Error)?e:yy(e);this.tone="error",this.error=Ay(t),this.status="",Ey(dy,t)}}rb([le(),ib("design:type",Object)],ab.prototype,"photo",void 0),rb([le({type:String,reflect:!0}),ib("design:type",Object)],ab.prototype,"emptyArtwork",void 0),rb([ue(),ib("design:type",Boolean)],ab.prototype,"login",void 0),rb([ue(),ib("design:type",Object)],ab.prototype,"person",void 0),rb([ue(),ib("design:type",Object)],ab.prototype,"mail",void 0),rb([ue(),ib("design:type",Number)],ab.prototype,"progress",void 0),rb([ue(),ib("design:type",String)],ab.prototype,"error",void 0),rb([ue(),ib("design:type",String)],ab.prototype,"status",void 0),rb([ue(),ib("design:type",String)],ab.prototype,"tone",void 0),rb([ue(),ib("design:type",Object)],ab.prototype,"busy",void 0),customElements.define("contact-photo",ab);var ob=function(e,t,n,s){var r,i=arguments.length,a=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,s);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Bb=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};class cb extends(he(gn)(ie)){constructor(){super(),this.login=!1,this.draft="",this.busy=!1,this.status="",this.tone="",this.dirty=!1,this.default=e=>{e.preventDefault(),this.alertProfile()},this.alertProfile=async()=>{if(this.busy)return;const e=this.renderRoot.querySelector("#pwa-name"),t=(e?.value??this.draft).trim(),n=JE.currentUser;if(n){this.busy=!0,this.tone="",this.status="";try{await Na(n,{displayName:t}),this.dirty=!1,this.draft=t,gn.dispatch(un(t)),gn.dispatch(en(t)),this.status="Name saved.",Ey(By,{uid:n.uid,displayName:t,photoURL:n.photoURL})}catch(e){this.show(yy(e))}finally{this.busy=!1}}else this.show({code:"pwa/signed-out",message:"Sign in first."})}}stateChanged(e){const t=Boolean(e.frontend?.login);t!==this.login&&(this.dirty=!1),this.login=t,this.dirty||(this.draft=e.backend?.name??"")}static get styles(){return[Ny,Ry,Sy,Ly,i`
1379
+ ${zy("pwa-photo-status",this.error||this.status,this.tone)}
1380
+ `}fail(e){const t="object"==typeof e&&null!==e&&"code"in e&&"message"in e&&!(e instanceof Error)?e:uy(e);this.tone="error",this.error=Hy(t),this.status="",ly(Sy,t)}}mb([le(),wb("design:type",Object)],Eb.prototype,"photo",void 0),mb([le({type:String,reflect:!0}),wb("design:type",Object)],Eb.prototype,"emptyArtwork",void 0),mb([ue(),wb("design:type",Boolean)],Eb.prototype,"login",void 0),mb([ue(),wb("design:type",Object)],Eb.prototype,"person",void 0),mb([ue(),wb("design:type",Object)],Eb.prototype,"mail",void 0),mb([ue(),wb("design:type",Number)],Eb.prototype,"progress",void 0),mb([ue(),wb("design:type",String)],Eb.prototype,"error",void 0),mb([ue(),wb("design:type",String)],Eb.prototype,"status",void 0),mb([ue(),wb("design:type",String)],Eb.prototype,"tone",void 0),mb([ue(),wb("design:type",Object)],Eb.prototype,"busy",void 0),customElements.define("contact-photo",Eb);var yb=function(e,t,n,s){var r,i=arguments.length,a=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,s);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Db=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};class _b extends(he(gn)(ie)){constructor(){super(),this.login=!1,this.draft="",this.busy=!1,this.status="",this.tone="",this.dirty=!1,this.default=e=>{e.preventDefault(),this.alertProfile()},this.alertProfile=async()=>{if(this.busy)return;const e=this.renderRoot.querySelector("#pwa-name"),t=(e?.value??this.draft).trim(),n=WE.currentUser;if(n){this.busy=!0,this.tone="",this.status="";try{await ka(n,{displayName:t}),this.dirty=!1,this.draft=t,gn.dispatch(un(t)),gn.dispatch(en(t)),this.status="Name saved.",ly(by,{uid:n.uid,displayName:t,photoURL:n.photoURL})}catch(e){this.show(uy(e))}finally{this.busy=!1}}else this.show({code:"pwa/signed-out",message:"Sign in first."})}}stateChanged(e){const t=Boolean(e.frontend?.login);t!==this.login&&(this.dirty=!1),this.login=t,this.dirty||(this.draft=e.backend?.name??"")}static get styles(){return[jy,$y,Vy,qy,i`
1308
1381
 
1309
1382
  :host, form { display: grid; align-content: start; }
1310
1383
 
@@ -1330,7 +1403,7 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
1330
1403
 
1331
1404
  </label>
1332
1405
 
1333
- ${xy("pwa-name-status",this.status,this.tone)}
1406
+ ${zy("pwa-name-status",this.status,this.tone)}
1334
1407
 
1335
1408
  <button
1336
1409
  class="action-button save"
@@ -1341,7 +1414,7 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
1341
1414
 
1342
1415
  </form>
1343
1416
 
1344
- `}handleInput(e){const t=e.target;this.dirty=!0,this.draft=t.value}show(e){this.tone="error",this.status=Ay(e),Ey(dy,e)}}ob([ue(),Bb("design:type",Object)],cb.prototype,"login",void 0),ob([ue(),Bb("design:type",Object)],cb.prototype,"draft",void 0),ob([ue(),Bb("design:type",Object)],cb.prototype,"busy",void 0),ob([ue(),Bb("design:type",Object)],cb.prototype,"status",void 0),ob([ue(),Bb("design:type",Object)],cb.prototype,"tone",void 0),customElements.define("input-name",cb);const lb="userEmailChanged";var ub=function(e,t,n,s){var r,i=arguments.length,a=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,s);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},hb=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};class pb extends(he(gn)(ie)){constructor(){super(),this.email="",this.login=!1,this.mail="",this.busy=!1,this.status="",this.tone="",this.showPassword=!1,this.saveEmail=async e=>{if(e.preventDefault(),this.busy)return;const t=JE.currentUser;if(!t)return void this.show({code:"pwa/signed-out",message:"Sign in first."});const n=this.shadowRoot?.querySelector("#pwa-current-email-password")?.value??"",s=this.shadowRoot?.querySelector("#pwa-email");if(!s)return;if(n.length<6)return void this.show({code:"pwa/current-password",message:"Enter your current password."});this.busy=!0,this.tone="",this.status="";if(!await u_(n)){const e=o_();return this.tone="error",this.status=Ay(e??{code:"pwa/unknown",message:"Something went wrong. Try again."}),void(this.busy=!1)}try{const e=YE();e?await Sa(t,s.value,e):await Sa(t,s.value);const n={email:s.value};if(Ey(cy,n),function(e){window.dispatchEvent(new CustomEvent(lb,{detail:e,bubbles:!0,composed:!0}))}(n),this.tone="",this.status="Check your inbox to confirm the new address.",!t.emailVerified)try{await v_()}catch{}}catch(e){const t=yy(e);this.tone="error",this.status=Ay(e),Ey(dy,t)}finally{this.busy=!1}}}stateChanged(e){this.login=e.frontend.login,this.mail=e.backend.email}handleEmail(e){const t=e.target;this.mail=t.value}static get styles(){return[Ny,Ry,Sy,ky,Ly,i`
1417
+ `}handleInput(e){const t=e.target;this.dirty=!0,this.draft=t.value}show(e){this.tone="error",this.status=Hy(e),ly(Sy,e)}}yb([ue(),Db("design:type",Object)],_b.prototype,"login",void 0),yb([ue(),Db("design:type",Object)],_b.prototype,"draft",void 0),yb([ue(),Db("design:type",Object)],_b.prototype,"busy",void 0),yb([ue(),Db("design:type",Object)],_b.prototype,"status",void 0),yb([ue(),Db("design:type",Object)],_b.prototype,"tone",void 0),customElements.define("input-name",_b);const bb="userEmailChanged";var vb=function(e,t,n,s){var r,i=arguments.length,a=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,s);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Ib=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};class Tb extends(he(gn)(ie)){constructor(){super(),this.email="",this.login=!1,this.mail="",this.busy=!1,this.status="",this.tone="",this.showPassword=!1,this.saveEmail=async e=>{if(e.preventDefault(),this.busy)return;const t=WE.currentUser;if(!t)return void this.show({code:"pwa/signed-out",message:"Sign in first."});const n=this.shadowRoot?.querySelector("#pwa-current-email-password")?.value??"",s=this.shadowRoot?.querySelector("#pwa-email");if(!s)return;if(n.length<6)return void this.show({code:"pwa/current-password",message:"Enter your current password."});this.busy=!0,this.tone="",this.status="";if(!await v_(n)){const e=y_();return this.tone="error",this.status=Hy(e??{code:"pwa/unknown",message:"Something went wrong. Try again."}),void(this.busy=!1)}try{const e=ny();e?await Ra(t,s.value,e):await Ra(t,s.value);const n={email:s.value};if(ly(vy,n),function(e){window.dispatchEvent(new CustomEvent(bb,{detail:e,bubbles:!0,composed:!0}))}(n),this.tone="",this.status="Check your inbox to confirm the new address.",!t.emailVerified)try{await G_()}catch{}}catch(e){const t=uy(e);this.tone="error",this.status=Hy(e),ly(Sy,t)}finally{this.busy=!1}}}stateChanged(e){this.login=e.frontend.login,this.mail=e.backend.email}handleEmail(e){const t=e.target;this.mail=t.value}static get styles(){return[jy,$y,Vy,Jy,qy,i`
1345
1418
 
1346
1419
  :host, form { display: grid; align-content: start; }
1347
1420
 
@@ -1363,7 +1436,7 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
1363
1436
  autocomplete = "current-password"
1364
1437
  aria-describedby = "pwa-email-status"/>
1365
1438
 
1366
- ${Py(this.showPassword,()=>{this.showPassword=!this.showPassword})}
1439
+ ${Qy(this.showPassword,()=>{this.showPassword=!this.showPassword})}
1367
1440
 
1368
1441
  </span>
1369
1442
 
@@ -1387,7 +1460,7 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
1387
1460
 
1388
1461
  </label>
1389
1462
 
1390
- ${xy("pwa-email-status",this.status,this.tone)}
1463
+ ${zy("pwa-email-status",this.status,this.tone)}
1391
1464
 
1392
1465
  <button
1393
1466
  type = "submit"
@@ -1398,7 +1471,7 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
1398
1471
 
1399
1472
  </form>
1400
1473
 
1401
- `}show(e){this.tone="error",this.status=Ay(e),Ey(dy,e)}}ub([le({type:String,reflect:!0}),hb("design:type",Object)],pb.prototype,"email",void 0),ub([ue(),hb("design:type",Boolean)],pb.prototype,"login",void 0),ub([ue(),hb("design:type",String)],pb.prototype,"mail",void 0),ub([ue(),hb("design:type",Object)],pb.prototype,"busy",void 0),ub([ue(),hb("design:type",Object)],pb.prototype,"status",void 0),ub([ue(),hb("design:type",Object)],pb.prototype,"tone",void 0),ub([ue(),hb("design:type",Object)],pb.prototype,"showPassword",void 0),customElements.define("contact-email",pb);var db=function(e,t,n,s){var r,i=arguments.length,a=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,s);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},fb=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};class Cb extends(he(gn)(ie)){constructor(){super(),this.message="",this.tone="",this.password="",this.login=!1,this.busy=!1,this.showCurrent=!1,this.showNext=!1,this.showVerify=!1,this.default=e=>{e.preventDefault(),this.alertPassword()},this.updatePass=async(e,t)=>{const n=JE.currentUser;if(!n)return void this.show({code:"pwa/signed-out",message:"Sign in first."});this.busy=!0,this.tone="",this.message="";if(!await u_(e)){const e=o_();return this.tone="error",this.message=Ay(e??{code:"pwa/unknown",message:"Something went wrong. Try again."}),void(this.busy=!1)}try{await Ra(n,t),this.tone="",this.message="Password saved.",Ey(ly,{uid:n.uid})}catch(e){const t=yy(e);this.tone="error",this.message=Ay(e),Ey(dy,t)}finally{this.busy=!1}}}stateChanged(e){this.login=e.frontend.login}handleInputChange(e){const t=e.target;this.password=t.value}static get styles(){return[Ny,Ry,Sy,ky,Ly,i`
1474
+ `}show(e){this.tone="error",this.status=Hy(e),ly(Sy,e)}}vb([le({type:String,reflect:!0}),Ib("design:type",Object)],Tb.prototype,"email",void 0),vb([ue(),Ib("design:type",Boolean)],Tb.prototype,"login",void 0),vb([ue(),Ib("design:type",String)],Tb.prototype,"mail",void 0),vb([ue(),Ib("design:type",Object)],Tb.prototype,"busy",void 0),vb([ue(),Ib("design:type",Object)],Tb.prototype,"status",void 0),vb([ue(),Ib("design:type",Object)],Tb.prototype,"tone",void 0),vb([ue(),Ib("design:type",Object)],Tb.prototype,"showPassword",void 0),customElements.define("contact-email",Tb);var Ab=function(e,t,n,s){var r,i=arguments.length,a=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,s);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Ob=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};class Sb extends(he(gn)(ie)){constructor(){super(),this.message="",this.tone="",this.password="",this.login=!1,this.busy=!1,this.showCurrent=!1,this.showNext=!1,this.showVerify=!1,this.default=e=>{e.preventDefault(),this.alertPassword()},this.updatePass=async(e,t)=>{const n=WE.currentUser;if(!n)return void this.show({code:"pwa/signed-out",message:"Sign in first."});this.busy=!0,this.tone="",this.message="";if(!await v_(e)){const e=y_();return this.tone="error",this.message=Hy(e??{code:"pwa/unknown",message:"Something went wrong. Try again."}),void(this.busy=!1)}try{await La(n,t),this.tone="",this.message="Password saved.",ly(Iy,{uid:n.uid})}catch(e){const t=uy(e);this.tone="error",this.message=Hy(e),ly(Sy,t)}finally{this.busy=!1}}}stateChanged(e){this.login=e.frontend.login}handleInputChange(e){const t=e.target;this.password=t.value}static get styles(){return[jy,$y,Vy,Jy,qy,i`
1402
1475
 
1403
1476
  :host{
1404
1477
  display: grid;
@@ -1427,7 +1500,7 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
1427
1500
  autocomplete = "current-password"
1428
1501
  aria-describedby = "pwa-password-status">
1429
1502
 
1430
- ${Py(this.showCurrent,()=>{this.showCurrent=!this.showCurrent})}
1503
+ ${Qy(this.showCurrent,()=>{this.showCurrent=!this.showCurrent})}
1431
1504
 
1432
1505
  </span>
1433
1506
 
@@ -1448,16 +1521,16 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
1448
1521
  type = "${this.showNext?"text":"password"}"
1449
1522
  autocomplete = "new-password"
1450
1523
  minlength = "${8}"
1451
- maxlength = "${Dy}"
1524
+ maxlength = "${Ly}"
1452
1525
  .value = "${this.password}"
1453
1526
  @input = "${this.handleInputChange}"
1454
1527
  aria-describedby = "pwa-new-password-hint pwa-password-status">
1455
1528
 
1456
- ${Py(this.showNext,()=>{this.showNext=!this.showNext})}
1529
+ ${Qy(this.showNext,()=>{this.showNext=!this.showNext})}
1457
1530
 
1458
1531
  </span>
1459
1532
 
1460
- <p id="pwa-new-password-hint" class="hint" part="hint">${_y}</p>
1533
+ <p id="pwa-new-password-hint" class="hint" part="hint">${xy}</p>
1461
1534
 
1462
1535
  </label>
1463
1536
 
@@ -1476,10 +1549,10 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
1476
1549
  type = "${this.showVerify?"text":"password"}"
1477
1550
  autocomplete = "new-password"
1478
1551
  minlength = "${8}"
1479
- maxlength = "${Dy}"
1552
+ maxlength = "${Ly}"
1480
1553
  aria-describedby = "pwa-password-status">
1481
1554
 
1482
- ${Py(this.showVerify,()=>{this.showVerify=!this.showVerify})}
1555
+ ${Qy(this.showVerify,()=>{this.showVerify=!this.showVerify})}
1483
1556
 
1484
1557
  </span>
1485
1558
 
@@ -1487,7 +1560,7 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
1487
1560
 
1488
1561
  </div>
1489
1562
 
1490
- ${xy("pwa-password-status",this.message,this.tone)}
1563
+ ${zy("pwa-password-status",this.message,this.tone)}
1491
1564
 
1492
1565
  <button
1493
1566
  type="submit"
@@ -1498,7 +1571,7 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
1498
1571
 
1499
1572
  </form>
1500
1573
 
1501
- `}show(e){this.tone="error",this.message=Ay(e),Ey(dy,e)}async alertPassword(){if(this.busy)return;const e=this.shadowRoot.querySelector("#pwa-current-password").value,t=this.shadowRoot.querySelector("#pwa-new-password").value,n=this.shadowRoot.querySelector("#pwa-verify-password").value;if(this.password=t,e.length<6)return void this.show({code:"pwa/current-password",message:"Enter your current password."});const s=Ty(this.password);s?this.show(s):this.password===n?JE.currentUser?await this.updatePass(e,this.password):this.show({code:"pwa/signed-out",message:"Sign in first."}):this.show({code:"pwa/password-mismatch",message:Iy})}}db([ue(),fb("design:type",String)],Cb.prototype,"message",void 0),db([ue(),fb("design:type",String)],Cb.prototype,"tone",void 0),db([ue(),fb("design:type",String)],Cb.prototype,"password",void 0),db([ue(),fb("design:type",Boolean)],Cb.prototype,"login",void 0),db([ue(),fb("design:type",Boolean)],Cb.prototype,"busy",void 0),db([ue(),fb("design:type",Object)],Cb.prototype,"showCurrent",void 0),db([ue(),fb("design:type",Object)],Cb.prototype,"showNext",void 0),db([ue(),fb("design:type",Object)],Cb.prototype,"showVerify",void 0),customElements.define("input-password",Cb);var gb=function(e,t,n,s){var r,i=arguments.length,a=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,s);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},mb=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};class wb extends(he(gn)(ie)){constructor(){super(),this.login=!1,this.email="",this.busy=!1,this.status="",this.tone="",this.showPassword=!1,this.alertDelete=()=>{if(this.busy)return;if(!JE.currentUser)return void this.show({code:"pwa/signed-out",message:"Sign in first."});const e=this.shadowRoot.querySelector("#pwa-delete-password").value;if(e.length<6)return void this.show({code:"pwa/current-password",message:"Enter your current password."});1==confirm("Delete Account?")&&this.officialDelete(e)},this.officialDelete=async e=>{this.busy=!0,this.tone="",this.status="";if(!await u_(e)){const e=o_();return this.tone="error",this.status=Ay(e??{code:"pwa/unknown",message:"Something went wrong. Try again."}),void(this.busy=!1)}const t=JE.currentUser;if(!t)return this.show({code:"pwa/signed-out",message:"Sign in first."}),void(this.busy=!1);try{const e=t.uid;await(async e=>{const t=GE($E,"pwa-auth/"+e),n=await PE(t);await Promise.all(n.items.map(e=>ME(e)));for(const e of n.prefixes){const t=await PE(e);await Promise.all(t.items.map(e=>ME(e)))}})(e),await d_(),await t.delete(),Ey(oy,{uid:e})}catch(e){const t=yy(e);this.tone="error",this.status=Ay(e),Ey(dy,t)}finally{this.busy=!1}}}stateChanged(e){this.login=e.frontend.login,this.email=e.backend.email}static get styles(){return[Sy,Ny,Ry,ky,Ly,i`
1574
+ `}show(e){this.tone="error",this.message=Hy(e),ly(Sy,e)}async alertPassword(){if(this.busy)return;const e=this.shadowRoot.querySelector("#pwa-current-password").value,t=this.shadowRoot.querySelector("#pwa-new-password").value,n=this.shadowRoot.querySelector("#pwa-verify-password").value;if(this.password=t,e.length<6)return void this.show({code:"pwa/current-password",message:"Enter your current password."});const s=Gy(this.password);s?this.show(s):this.password===n?WE.currentUser?await this.updatePass(e,this.password):this.show({code:"pwa/signed-out",message:"Sign in first."}):this.show({code:"pwa/password-mismatch",message:My})}}Ab([ue(),Ob("design:type",String)],Sb.prototype,"message",void 0),Ab([ue(),Ob("design:type",String)],Sb.prototype,"tone",void 0),Ab([ue(),Ob("design:type",String)],Sb.prototype,"password",void 0),Ab([ue(),Ob("design:type",Boolean)],Sb.prototype,"login",void 0),Ab([ue(),Ob("design:type",Boolean)],Sb.prototype,"busy",void 0),Ab([ue(),Ob("design:type",Object)],Sb.prototype,"showCurrent",void 0),Ab([ue(),Ob("design:type",Object)],Sb.prototype,"showNext",void 0),Ab([ue(),Ob("design:type",Object)],Sb.prototype,"showVerify",void 0),customElements.define("input-password",Sb);var Nb=function(e,t,n,s){var r,i=arguments.length,a=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,s);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Rb=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};class kb extends(he(gn)(ie)){constructor(){super(),this.login=!1,this.email="",this.busy=!1,this.status="",this.tone="",this.showPassword=!1,this.alertDelete=()=>{if(this.busy)return;if(!WE.currentUser)return void this.show({code:"pwa/signed-out",message:"Sign in first."});const e=this.shadowRoot.querySelector("#pwa-delete-password").value;if(e.length<6)return void this.show({code:"pwa/current-password",message:"Enter your current password."});1==confirm("Delete Account?")&&this.officialDelete(e)},this.officialDelete=async e=>{this.busy=!0,this.tone="",this.status="";if(!await v_(e)){const e=y_();return this.tone="error",this.status=Hy(e??{code:"pwa/unknown",message:"Something went wrong. Try again."}),void(this.busy=!1)}const t=WE.currentUser;if(!t)return this.show({code:"pwa/signed-out",message:"Sign in first."}),void(this.busy=!1);try{const e=t.uid;await(async e=>{const t=$E(QE,"pwa-auth/"+e),n=await VE(t);await Promise.all(n.items.map(e=>jE(e)));for(const e of n.prefixes){const t=await VE(e);await Promise.all(t.items.map(e=>jE(e)))}})(e),await A_(),await t.delete(),ly(_y,{uid:e})}catch(e){const t=uy(e);this.tone="error",this.status=Hy(e),ly(Sy,t)}finally{this.busy=!1}}}stateChanged(e){this.login=e.frontend.login,this.email=e.backend.email}static get styles(){return[Vy,jy,$y,Jy,qy,i`
1502
1575
 
1503
1576
  :host {
1504
1577
  display: grid;
@@ -1528,13 +1601,13 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
1528
1601
  autocomplete="current-password"
1529
1602
  aria-describedby="pwa-delete-status"/>
1530
1603
 
1531
- ${Py(this.showPassword,()=>{this.showPassword=!this.showPassword})}
1604
+ ${Qy(this.showPassword,()=>{this.showPassword=!this.showPassword})}
1532
1605
 
1533
1606
  </span>
1534
1607
 
1535
1608
  </label>
1536
1609
 
1537
- ${xy("pwa-delete-status",this.status,this.tone)}
1610
+ ${zy("pwa-delete-status",this.status,this.tone)}
1538
1611
 
1539
1612
  <button
1540
1613
  type="button"
@@ -1544,7 +1617,7 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
1544
1617
  ?disabled="${!1===this.login||this.busy}"
1545
1618
  @click="${this.alertDelete}">${this.busy?"Deleting…":"Delete"}</button>
1546
1619
 
1547
- `}show(e){this.tone="error",this.status=Ay(e),Ey(dy,e)}}gb([ue(),mb("design:type",Boolean)],wb.prototype,"login",void 0),gb([ue(),mb("design:type",String)],wb.prototype,"email",void 0),gb([ue(),mb("design:type",Object)],wb.prototype,"busy",void 0),gb([ue(),mb("design:type",Object)],wb.prototype,"status",void 0),gb([ue(),mb("design:type",Object)],wb.prototype,"tone",void 0),gb([ue(),mb("design:type",Object)],wb.prototype,"showPassword",void 0),customElements.define("delete-user",wb);var Eb=function(e,t,n,s){var r,i=arguments.length,a=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,s);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},yb=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};let Db=class extends(he(gn)(ie)){constructor(){super(),this.empty="",this.profileTopic="",this.name="",this.email="",this.login=!1,this.onSubmit=e=>{e.preventDefault()}}connectedCallback(){x_(this),super.connectedCallback(),this.addEventListener("submit",this.onSubmit)}disconnectedCallback(){this.removeEventListener("submit",this.onSubmit),super.disconnectedCallback()}onTabKey(e){if("ArrowRight"!==e.key&&"ArrowLeft"!==e.key)return;const t=["profile","verification","password","delete"],n=t.indexOf(this.profileTopic),s=t[(n+("ArrowRight"===e.key?1:-1)+t.length)%t.length];gn.dispatch(Xt(s)),this.updateComplete.then(()=>{this.shadowRoot?.querySelector(`button[value="${s}"]`)?.focus()})}stateChanged(e){this.profileTopic=e.frontend.settings,this.login=Boolean(e.frontend?.login),this.name=e.backend.name,this.email=e.backend.email}static get styles(){return[sb,Dn,yn,Fy,i`
1620
+ `}show(e){this.tone="error",this.status=Hy(e),ly(Sy,e)}}Nb([ue(),Rb("design:type",Boolean)],kb.prototype,"login",void 0),Nb([ue(),Rb("design:type",String)],kb.prototype,"email",void 0),Nb([ue(),Rb("design:type",Object)],kb.prototype,"busy",void 0),Nb([ue(),Rb("design:type",Object)],kb.prototype,"status",void 0),Nb([ue(),Rb("design:type",Object)],kb.prototype,"tone",void 0),Nb([ue(),Rb("design:type",Object)],kb.prototype,"showPassword",void 0),customElements.define("delete-user",kb);var Lb=function(e,t,n,s){var r,i=arguments.length,a=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,s);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},xb=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};let Fb=class extends(he(gn)(ie)){constructor(){super(),this.empty="",this.profileTopic="",this.name="",this.email="",this.login=!1,this.onSubmit=e=>{e.preventDefault()}}connectedCallback(){Q_(this),super.connectedCallback(),this.addEventListener("submit",this.onSubmit)}disconnectedCallback(){this.removeEventListener("submit",this.onSubmit),super.disconnectedCallback()}onTabKey(e){if("ArrowRight"!==e.key&&"ArrowLeft"!==e.key)return;const t=["profile","verification","password","delete"],n=t.indexOf(this.profileTopic),s=t[(n+("ArrowRight"===e.key?1:-1)+t.length)%t.length];gn.dispatch(Xt(s)),this.updateComplete.then(()=>{this.shadowRoot?.querySelector(`button[value="${s}"]`)?.focus()})}stateChanged(e){this.profileTopic=e.frontend.settings,this.login=Boolean(e.frontend?.login),this.name=e.backend.name,this.email=e.backend.email}static get styles(){return[gb,_n,mn,Ky,i`
1548
1621
 
1549
1622
  :host {
1550
1623
  display: grid;
@@ -1577,7 +1650,7 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
1577
1650
 
1578
1651
  `]}openTab(e){gn.dispatch(Xt(e))}render(){if(!this.login)return H`
1579
1652
  <p class="signed-out" part="signed-out" role="status">Sign in to change the photo, name, email, or password.</p>
1580
- `;const e=P_(this.name,this.email);return H`
1653
+ `;const e=Y_(this.name,this.email);return H`
1581
1654
 
1582
1655
  <!-- Page Menu -->
1583
1656
  <nav aria-label="Account" @keydown="${this.onTabKey}">
@@ -1714,7 +1787,7 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
1714
1787
  </div>
1715
1788
  </div>
1716
1789
 
1717
- `}};Eb([le({type:String,reflect:!0}),yb("design:type",Object)],Db.prototype,"empty",void 0),Eb([ue(),yb("design:type",Object)],Db.prototype,"profileTopic",void 0),Eb([ue(),yb("design:type",Object)],Db.prototype,"name",void 0),Eb([ue(),yb("design:type",Object)],Db.prototype,"email",void 0),Eb([ue(),yb("design:type",Object)],Db.prototype,"login",void 0),Db=Eb([oe("user-settings"),yb("design:paramtypes",[])],Db);const _b=i`
1790
+ `}};Lb([le({type:String,reflect:!0}),xb("design:type",Object)],Fb.prototype,"empty",void 0),Lb([ue(),xb("design:type",Object)],Fb.prototype,"profileTopic",void 0),Lb([ue(),xb("design:type",Object)],Fb.prototype,"name",void 0),Lb([ue(),xb("design:type",Object)],Fb.prototype,"email",void 0),Lb([ue(),xb("design:type",Object)],Fb.prototype,"login",void 0),Fb=Lb([oe("user-settings"),xb("design:paramtypes",[])],Fb);const Pb=i`
1718
1791
 
1719
1792
  .icon, .login {
1720
1793
  cursor: pointer;
@@ -1777,7 +1850,7 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
1777
1850
  letter-spacing: 0.04em;
1778
1851
  }
1779
1852
 
1780
- `;var bb=function(e,t,n,s){var r,i=arguments.length,a=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,s);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},vb=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};let Ib=class extends(he(gn)(ie)){constructor(){super(),this.subscribe=!1,this.empty="",this._user=!1,this._photoURL="",this._name="",this._email=""}connectedCallback(){x_(this),super.connectedCallback()}firstUpdated(){this.shadowRoot.querySelector(".toggles").addEventListener("click",()=>{gn.dispatch(nn())})}stateChanged(e){this._user=e.frontend.login,this._photoURL=e.backend.photoURL,this._name=e.backend.name,this._email=e.backend.email}static get styles(){return[_b,i`:host { border-radius: 10px; }`]}render(){return H`
1853
+ `;var Mb=function(e,t,n,s){var r,i=arguments.length,a=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,s);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Gb=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};let Ub=class extends(he(gn)(ie)){constructor(){super(),this.subscribe=!1,this.empty="",this._user=!1,this._photoURL="",this._name="",this._email=""}connectedCallback(){Q_(this),super.connectedCallback()}firstUpdated(){this.shadowRoot.querySelector(".toggles").addEventListener("click",()=>{gn.dispatch(nn())})}stateChanged(e){this._user=e.frontend.login,this._photoURL=e.backend.photoURL,this._name=e.backend.name,this._email=e.backend.email}static get styles(){return[Pb,i`:host { border-radius: 10px; }`]}render(){return H`
1781
1854
 
1782
1855
  <!-- two classes: icon / login -->
1783
1856
  <button
@@ -1790,7 +1863,7 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
1790
1863
 
1791
1864
  </button>
1792
1865
 
1793
- `}face(){if(this._photoURL)return H`<img class="userImage" part="photo" alt="" src="${this._photoURL}">`;const e=F_(this._name,this._email);return e?H`<span class="initials" part="initials" aria-hidden="true">${e}</span>`:this.empty?H`<img class="userImage" part="photo" alt="" src="${this.empty}">`:H`<span class="initials" part="initials" aria-hidden="true">?</span>`}};bb([le({type:Boolean,reflect:!0}),vb("design:type",Object)],Ib.prototype,"subscribe",void 0),bb([le({type:String,reflect:!0}),vb("design:type",Object)],Ib.prototype,"empty",void 0),bb([ue(),vb("design:type",Object)],Ib.prototype,"_user",void 0),bb([ue(),vb("design:type",Object)],Ib.prototype,"_photoURL",void 0),bb([ue(),vb("design:type",Object)],Ib.prototype,"_name",void 0),bb([ue(),vb("design:type",Object)],Ib.prototype,"_email",void 0),Ib=bb([oe("user-icon"),vb("design:paramtypes",[])],Ib);var Tb=function(e,t,n,s){var r,i=arguments.length,a=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,s);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Ob=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};class Ab extends ie{constructor(){super(),this.active=!1}shouldUpdate(){return this.active}}function Sb(){gn.dispatch(sn())}function Nb(){gn.dispatch(rn())}function Rb(){gn.dispatch(nn())}Tb([le({type:Boolean}),Ob("design:type",Boolean)],Ab.prototype,"active",void 0);var kb=function(e,t,n,s){var r,i=arguments.length,a=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,s);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Lb=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};let xb=class extends Ab{constructor(){super(),this.userEmail="",this.status="",this.tone="",this.invalid=!1,this.busy=!1,this.cooldown=0,this.touched=!1,this.timer=0,this.stopDraft=null,this.resetPassword=async e=>{if(e.preventDefault(),this.busy||this.cooldown>0)return;const t=this.renderRoot.querySelector(".email");this.userEmail=(t?t.value:this.userEmail).trim(),t&&t.value!==this.userEmail&&(t.value=this.userEmail);const n=(s=this.userEmail).length<4?{code:"pwa/missing-email",message:"Enter an email address."}:/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s)?null:{code:"pwa/invalid-email",message:"Enter a valid email address."};var s;if(n)this.showError(n,"email");else{this.busy=!0,this.tone="",this.status="";try{await Ta(JE,this.userEmail),this.showSent()}catch(e){!function(e){return"auth/user-not-found"===yy(e).code}(e)?this.showFirebase(e):this.showSent()}finally{this.busy=!1}}},this.backToSignIn=()=>{const e=document.querySelector("user-drawer");if(e){const t=e.hasAttribute("subscribe");return Boolean(gn.getState().frontend?.registerOne)!==t&&gn.dispatch(Yt("drawer")),void Sb()}const t=document.querySelector("user-login");if(!t)return;const n=t.hasAttribute("subscribe");Boolean(gn.getState().frontend?.registerTwo)!==n&&gn.dispatch(Yt("page")),t.scrollIntoView({block:"nearest"})}}static{this.styles=[Ny,Ry,Sy,ky,i`
1866
+ `}face(){if(this._photoURL)return H`<img class="userImage" part="photo" alt="" src="${this._photoURL}">`;const e=W_(this._name,this._email);return e?H`<span class="initials" part="initials" aria-hidden="true">${e}</span>`:this.empty?H`<img class="userImage" part="photo" alt="" src="${this.empty}">`:H`<span class="initials" part="initials" aria-hidden="true">?</span>`}};Mb([le({type:Boolean,reflect:!0}),Gb("design:type",Object)],Ub.prototype,"subscribe",void 0),Mb([le({type:String,reflect:!0}),Gb("design:type",Object)],Ub.prototype,"empty",void 0),Mb([ue(),Gb("design:type",Object)],Ub.prototype,"_user",void 0),Mb([ue(),Gb("design:type",Object)],Ub.prototype,"_photoURL",void 0),Mb([ue(),Gb("design:type",Object)],Ub.prototype,"_name",void 0),Mb([ue(),Gb("design:type",Object)],Ub.prototype,"_email",void 0),Ub=Mb([oe("user-icon"),Gb("design:paramtypes",[])],Ub);var Hb=function(e,t,n,s){var r,i=arguments.length,a=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,s);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Vb=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};class jb extends ie{constructor(){super(),this.active=!1}shouldUpdate(){return this.active}}function $b(){gn.dispatch(sn())}function Jb(){gn.dispatch(rn())}function qb(){gn.dispatch(nn())}Hb([le({type:Boolean}),Vb("design:type",Boolean)],jb.prototype,"active",void 0);var zb=function(e,t,n,s){var r,i=arguments.length,a=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,s);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Kb=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};let Qb=class extends jb{constructor(){super(),this.userEmail="",this.status="",this.tone="",this.invalid=!1,this.busy=!1,this.cooldown=0,this.touched=!1,this.timer=0,this.stopDraft=null,this.resetPassword=async e=>{if(e.preventDefault(),this.busy||this.cooldown>0)return;const t=this.renderRoot.querySelector(".email");this.userEmail=(t?t.value:this.userEmail).trim(),t&&t.value!==this.userEmail&&(t.value=this.userEmail);const n=(s=this.userEmail).length<4?{code:"pwa/missing-email",message:"Enter an email address."}:/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s)?null:{code:"pwa/invalid-email",message:"Enter a valid email address."};var s;if(n)this.showError(n,"email");else{this.busy=!0,this.tone="",this.status="";try{await Oa(WE,this.userEmail),this.showSent()}catch(e){!function(e){return"auth/user-not-found"===uy(e).code}(e)?this.showFirebase(e):this.showSent()}finally{this.busy=!1}}},this.backToSignIn=()=>{const e=document.querySelector("user-drawer");if(e){const t=e.hasAttribute("subscribe");return Boolean(gn.getState().frontend?.registerOne)!==t&&gn.dispatch(Yt("drawer")),void $b()}const t=document.querySelector("user-login");if(!t)return;const n=t.hasAttribute("subscribe");Boolean(gn.getState().frontend?.registerTwo)!==n&&gn.dispatch(Yt("page")),t.scrollIntoView({block:"nearest"})}}static{this.styles=[jy,$y,Vy,Jy,i`
1794
1867
  :host { display: block; }
1795
1868
 
1796
1869
  /* Required - live region stays in the tree. Idle layout stays put. */
@@ -1832,7 +1905,7 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
1832
1905
  width: 100%;
1833
1906
  box-sizing: border-box;
1834
1907
  }
1835
- `]}connectedCallback(){var e;super.connectedCallback(),this.stopDraft=(e=()=>{this.prefill()},Gy.add(e),()=>{Gy.delete(e)}),this.prefill()}disconnectedCallback(){window.clearInterval(this.timer),this.timer=0,this.stopDraft?.(),this.stopDraft=null,super.disconnectedCallback()}updated(){this.paintEmail()}prefill(){if(this.touched)return;const e=Hy();e&&e!==this.userEmail&&(this.userEmail=e,this.paintEmail())}paintEmail(){if(this.touched)return;const e=this.renderRoot.querySelector(".email");e&&!e.value&&this.userEmail&&(e.value=this.userEmail)}handleEmail(e){const t=e.target;this.touched=!0,this.userEmail=t.value,this.invalid&&(this.invalid=!1)}buttonLabel(){return this.busy?"Sending…":this.cooldown>0?`Send again in ${this.cooldown}s`:"Send reset email"}render(){const e="pwa-reset-status";return H`
1908
+ `]}connectedCallback(){var e;super.connectedCallback(),this.stopDraft=(e=()=>{this.prefill()},Zy.add(e),()=>{Zy.delete(e)}),this.prefill()}disconnectedCallback(){window.clearInterval(this.timer),this.timer=0,this.stopDraft?.(),this.stopDraft=null,super.disconnectedCallback()}updated(){this.paintEmail()}prefill(){if(this.touched)return;const e=tD();e&&e!==this.userEmail&&(this.userEmail=e,this.paintEmail())}paintEmail(){if(this.touched)return;const e=this.renderRoot.querySelector(".email");e&&!e.value&&this.userEmail&&(e.value=this.userEmail)}handleEmail(e){const t=e.target;this.touched=!0,this.userEmail=t.value,this.invalid&&(this.invalid=!1)}buttonLabel(){return this.busy?"Sending…":this.cooldown>0?`Send again in ${this.cooldown}s`:"Send reset email"}render(){const e="pwa-reset-status";return H`
1836
1909
 
1837
1910
  <form
1838
1911
  class="resetPass"
@@ -1882,4 +1955,4 @@ const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
1882
1955
 
1883
1956
  </form>
1884
1957
 
1885
- `}showSent(){this.tone="",this.status="If an account uses that email, a reset link is on its way.",this.invalid=!1,this.cooldown=45,this.armCooldown(),Ey(uy,{email:this.userEmail}),this.updateComplete.then(()=>{this.focusStatus()})}showError(e,t){this.tone="error",this.status=Ay(e),this.invalid="email"===t,Ey(dy,e),this.updateComplete.then(()=>{this.focusAfter(t)})}showFirebase(e){const t=yy(e);this.tone="error",this.status=Ay(e),this.invalid="auth/invalid-email"===t.code,Ey(dy,t),this.updateComplete.then(()=>{this.focusAfter(this.invalid?"email":"status")})}focusAfter(e){"email"===e?this.focusEmail():this.focusStatus()}focusEmail(){const e=this.renderRoot.querySelector(".email");e?.focus()}focusStatus(){const e=this.renderRoot.querySelector("#pwa-reset-status");e?.focus()}armCooldown(){window.clearInterval(this.timer),this.timer=window.setInterval(()=>{if(this.cooldown<=1)return this.cooldown=0,window.clearInterval(this.timer),void(this.timer=0);this.cooldown-=1},1e3)}};function Fb(){return XE()?wy(JE.currentUser):null}function Pb(e){let t,n=!1;return ZE(()=>{n||(t=ka(JE,t=>{e(wy(t))}))}),()=>{n=!0,t&&t()}}kb([ue(),Lb("design:type",String)],xb.prototype,"userEmail",void 0),kb([ue(),Lb("design:type",String)],xb.prototype,"status",void 0),kb([ue(),Lb("design:type",String)],xb.prototype,"tone",void 0),kb([ue(),Lb("design:type",Boolean)],xb.prototype,"invalid",void 0),kb([ue(),Lb("design:type",Boolean)],xb.prototype,"busy",void 0),kb([ue(),Lb("design:type",Number)],xb.prototype,"cooldown",void 0),xb=kb([oe("email-reset"),Lb("design:paramtypes",[])],xb);export{xb as EmailReset,nb as UserDrawer,Ib as UserIcon,U_ as UserLogin,Db as UserSettings,VE as application,JE as auth,Nb as closeDrawer,jE as db,f_ as deleteDocument,gy as eventName,qE as firebaseConfig,Fb as getCurrentUser,ty as initialize,I_ as isEmailVerified,p_ as logAccount,d_ as logAccountDelete,h_ as logOut,Pb as onUserChanged,Sb as openDrawer,oy as pwaAccountDeleted,sy as pwaAuthChanged,dy as pwaAuthError,l_ as pwaDrawerToggle,hy as pwaDrawerToggleName,cy as pwaEmailChanged,Cy as pwaEmailVerified,ry as pwaLogin,iy as pwaLogout,ly as pwaPasswordChanged,By as pwaProfileUpdated,uy as pwaResetSent,py as pwaSettings,ay as pwaSignup,fy as pwaVerificationSent,u_ as reauthenticate,v_ as sendVerification,$E as storage,Rb as toggleDrawer,zE as user,lb as userEmailChanged};
1958
+ `}showSent(){this.tone="",this.status="If an account uses that email, a reset link is on its way.",this.invalid=!1,this.cooldown=45,this.armCooldown(),ly(Ty,{email:this.userEmail}),this.updateComplete.then(()=>{this.focusStatus()})}showError(e,t){this.tone="error",this.status=Hy(e),this.invalid="email"===t,ly(Sy,e),this.updateComplete.then(()=>{this.focusAfter(t)})}showFirebase(e){const t=uy(e);this.tone="error",this.status=Hy(e),this.invalid="auth/invalid-email"===t.code,ly(Sy,t),this.updateComplete.then(()=>{this.focusAfter(this.invalid?"email":"status")})}focusAfter(e){"email"===e?this.focusEmail():this.focusStatus()}focusEmail(){const e=this.renderRoot.querySelector(".email");e?.focus()}focusStatus(){const e=this.renderRoot.querySelector("#pwa-reset-status");e?.focus()}armCooldown(){window.clearInterval(this.timer),this.timer=window.setInterval(()=>{if(this.cooldown<=1)return this.cooldown=0,window.clearInterval(this.timer),void(this.timer=0);this.cooldown-=1},1e3)}};function Wb(){return sy()?cy(WE.currentUser):null}function Yb(e){let t,n=!1;return ry(()=>{n||(t=xa(WE,t=>{e(cy(t))}))}),()=>{n=!0,t&&t()}}zb([ue(),Kb("design:type",String)],Qb.prototype,"userEmail",void 0),zb([ue(),Kb("design:type",String)],Qb.prototype,"status",void 0),zb([ue(),Kb("design:type",String)],Qb.prototype,"tone",void 0),zb([ue(),Kb("design:type",Boolean)],Qb.prototype,"invalid",void 0),zb([ue(),Kb("design:type",Boolean)],Qb.prototype,"busy",void 0),zb([ue(),Kb("design:type",Number)],Qb.prototype,"cooldown",void 0),Qb=zb([oe("email-reset"),Kb("design:paramtypes",[])],Qb);export{Qb as EmailReset,Cb as UserDrawer,Ub as UserIcon,eb as UserLogin,Fb as UserSettings,zE as application,WE as auth,Jb as closeDrawer,KE as db,O_ as deleteDocument,ky as eventName,YE as firebaseConfig,Wb as getCurrentUser,ay as initialize,U_ as isEmailVerified,T_ as logAccount,A_ as logAccountDelete,I_ as logOut,Yb as onUserChanged,$b as openDrawer,_y as pwaAccountDeleted,wy as pwaAuthChanged,Sy as pwaAuthError,b_ as pwaDrawerToggle,Ay as pwaDrawerToggleName,vy as pwaEmailChanged,Ry as pwaEmailVerified,Ey as pwaLogin,yy as pwaLogout,Iy as pwaPasswordChanged,by as pwaProfileUpdated,Ty as pwaResetSent,Oy as pwaSettings,Dy as pwaSignup,Ny as pwaVerificationSent,v_ as reauthenticate,G_ as sendVerification,QE as storage,qb as toggleDrawer,XE as user,bb as userEmailChanged};