@veltdev/sdk-dev 6.0.16-beta.2 → 6.0.17-beta.1
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.
- package/app/models/element/comment-element.model.d.ts +25 -0
- package/app/utils/constants.d.ts +7 -0
- package/{chunk-B4EISH54.js → chunk-2BXOD5Z7.js} +1 -1
- package/{chunk-HH27EWNV.js → chunk-44HAZKIE.js} +1 -1
- package/{chunk-FIYAS5RZ.js → chunk-5H4ODM5U.js} +1 -1
- package/chunk-5ZUX3AU3.js +1 -0
- package/{chunk-FJHRFYBF.js → chunk-6P3LPEPY.js} +1 -1
- package/chunk-A52PJCIA.js +1 -0
- package/{chunk-FLG6IUZD.js → chunk-AWSU4IMS.js} +1 -1
- package/chunk-B3U3OLF6.js +1 -0
- package/{chunk-ZN23VJH6.js → chunk-BB2UXAYE.js} +1 -1
- package/chunk-BTNNHMUJ.js +1 -0
- package/{chunk-JQ3GRMVD.js → chunk-CYAQOX2W.js} +1 -1
- package/{chunk-PFV36FS7.js → chunk-D24LAR5L.js} +1 -1
- package/{chunk-EGQZQCED.js → chunk-DFQFM4NV.js} +1 -1
- package/chunk-EPQLN2EE.js +1 -0
- package/{chunk-A62VJBMY.js → chunk-F5REFWTQ.js} +1 -1
- package/{chunk-LGB3WFUS.js → chunk-FEA5HRMI.js} +1 -1
- package/{chunk-LINJVWIK.js → chunk-FFTR7QJM.js} +1 -1
- package/{chunk-3GL6L6AA.js → chunk-FPEVLQAP.js} +1 -1
- package/{chunk-LMJKLKZS.js → chunk-HEFEC6O6.js} +1 -1
- package/{chunk-KCXSN3AD.js → chunk-IUD3QEEM.js} +1 -1
- package/{chunk-43P5XTFO.js → chunk-KHL24R7O.js} +1 -1
- package/{chunk-A72J7VDJ.js → chunk-LEIUFK3K.js} +1 -1
- package/{chunk-Q2STT7I7.js → chunk-MVVXZ2D6.js} +1 -1
- package/{chunk-237JSFRJ.js → chunk-ND3RYLBW.js} +1 -1
- package/{chunk-JOYODGJA.js → chunk-NSGBIR4C.js} +2 -2
- package/{chunk-SAAIFSMJ.js → chunk-OLHFUO6O.js} +1 -1
- package/{chunk-IUNHXKOF.js → chunk-QZ5UHEP2.js} +1 -1
- package/{chunk-RH5WO2RE.js → chunk-RGBU7P5H.js} +1 -1
- package/{chunk-W7PJF42O.js → chunk-SKNIB72F.js} +1 -1
- package/chunk-SMANT45B.js +1 -0
- package/chunk-TAGMM5ED.js +174 -0
- package/{chunk-UPZJGZEA.js → chunk-UCURXRPI.js} +1 -1
- package/{chunk-5BRMV46T.js → chunk-VECW5ME3.js} +1 -1
- package/{chunk-BIBYXCCB.js → chunk-XZD6KKXD.js} +1 -1
- package/{chunk-QBDEEORD.js → chunk-ZPO5AK7X.js} +1 -1
- package/package.json +1 -1
- package/velt-activity-log.js +1 -1
- package/velt-area.js +1 -1
- package/velt-arrow.js +2 -2
- package/velt-comment.js +6 -6
- package/velt-crdt.js +1 -1
- package/velt-cursor.js +2 -2
- package/velt-huddle.js +1 -1
- package/velt-live-state-sync.js +1 -1
- package/velt-notification.js +1 -1
- package/velt-portable.js +1 -1
- package/velt-presence.js +1 -1
- package/velt-reaction.js +1 -1
- package/velt-recorder.js +1 -1
- package/velt-rewriter.js +2 -2
- package/velt-selection.js +1 -1
- package/velt-tag.js +1 -1
- package/velt-user-invite.js +1 -1
- package/velt-user-request.js +1 -1
- package/velt-video-player.js +1 -1
- package/velt-views.js +2 -2
- package/velt.js +3 -3
- package/chunk-4YGTWPQM.js +0 -1
- package/chunk-EHCSU2UD.js +0 -1
- package/chunk-JBXGN5OD.js +0 -174
- package/chunk-RM7T2HN5.js +0 -1
- package/chunk-XSD5BXME.js +0 -1
- package/chunk-YW3ZLQ3I.js +0 -1
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
var E6=Object.create;var ym=Object.defineProperty,_6=Object.defineProperties,T6=Object.getOwnPropertyDescriptor,I6=Object.getOwnPropertyDescriptors,y6=Object.getOwnPropertyNames,Im=Object.getOwnPropertySymbols,DM=Object.getPrototypeOf,Lv=Object.prototype.hasOwnProperty,RM=Object.prototype.propertyIsEnumerable,v6=Reflect.get;var CM=(n,e,t)=>e in n?ym(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,$=(n,e)=>{for(var t in e||={})Lv.call(e,t)&&CM(n,t,e[t]);if(Im)for(var t of Im(e))RM.call(e,t)&&CM(n,t,e[t]);return n},ye=(n,e)=>_6(n,I6(e));var S6=(n,e)=>{var t={};for(var r in n)Lv.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&Im)for(var r of Im(n))e.indexOf(r)<0&&RM.call(n,r)&&(t[r]=n[r]);return t};var sae=(n,e)=>()=>{try{return e||n((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}},aae=(n,e)=>{for(var t in e)ym(n,t,{get:e[t],enumerable:!0})},A6=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of y6(e))!Lv.call(n,i)&&i!==t&&ym(n,i,{get:()=>e[i],enumerable:!(r=T6(e,i))||r.enumerable});return n};var cae=(n,e,t)=>(t=n!=null?E6(DM(n)):{},A6(e||!n||!n.__esModule?ym(t,"default",{value:n,enumerable:!0}):t,n));var xa=(n,e,t)=>v6(DM(n),t,e);var I=(n,e,t)=>new Promise((r,i)=>{var o=c=>{try{a(t.next(c))}catch(l){i(l)}},s=c=>{try{a(t.throw(c))}catch(l){i(l)}},a=c=>c.done?r(c.value):Promise.resolve(c.value).then(o,s);a((t=t.apply(n,e)).next())});function Ee(n){return typeof n=="function"}function Pv(n){return Ee(n?.lift)}function me(n){return e=>{if(Pv(e))return e.lift(function(t){try{return n(t,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function ss(n){let t=n(r=>{Error.call(r),r.stack=new Error().stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var vm=ss(n=>function(t){n(this),this.message=t?`${t.length} errors occurred during unsubscription:
|
|
2
|
+
${t.map((r,i)=>`${i+1}) ${r.toString()}`).join(`
|
|
3
|
+
`)}`:"",this.name="UnsubscriptionError",this.errors=t});function ka(n,e){if(n){let t=n.indexOf(e);0<=t&&n.splice(t,1)}}var pt=class n{constructor(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let e;if(!this.closed){this.closed=!0;let{_parentage:t}=this;if(t)if(this._parentage=null,Array.isArray(t))for(let o of t)o.remove(this);else t.remove(this);let{initialTeardown:r}=this;if(Ee(r))try{r()}catch(o){e=o instanceof vm?o.errors:[o]}let{_finalizers:i}=this;if(i){this._finalizers=null;for(let o of i)try{NM(o)}catch(s){e=e??[],s instanceof vm?e=[...e,...s.errors]:e.push(s)}}if(e)throw new vm(e)}}add(e){var t;if(e&&e!==this)if(this.closed)NM(e);else{if(e instanceof n){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(e)}}_hasParent(e){let{_parentage:t}=this;return t===e||Array.isArray(t)&&t.includes(e)}_addParent(e){let{_parentage:t}=this;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e}_removeParent(e){let{_parentage:t}=this;t===e?this._parentage=null:Array.isArray(t)&&ka(t,e)}remove(e){let{_finalizers:t}=this;t&&ka(t,e),e instanceof n&&e._removeParent(this)}};pt.EMPTY=(()=>{let n=new pt;return n.closed=!0,n})();var xv=pt.EMPTY;function Sm(n){return n instanceof pt||n&&"closed"in n&&Ee(n.remove)&&Ee(n.add)&&Ee(n.unsubscribe)}function NM(n){Ee(n)?n():n.unsubscribe()}var Wr={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var nu={setTimeout(n,e,...t){let{delegate:r}=nu;return r?.setTimeout?r.setTimeout(n,e,...t):setTimeout(n,e,...t)},clearTimeout(n){let{delegate:e}=nu;return(e?.clearTimeout||clearTimeout)(n)},delegate:void 0};function Am(n){nu.setTimeout(()=>{let{onUnhandledError:e}=Wr;if(e)e(n);else throw n})}function zr(){}var wM=kv("C",void 0,void 0);function bM(n){return kv("E",void 0,n)}function OM(n){return kv("N",n,void 0)}function kv(n,e,t){return{kind:n,value:e,error:t}}var Fa=null;function ru(n){if(Wr.useDeprecatedSynchronousErrorHandling){let e=!Fa;if(e&&(Fa={errorThrown:!1,error:null}),n(),e){let{errorThrown:t,error:r}=Fa;if(Fa=null,t)throw r}}else n()}function MM(n){Wr.useDeprecatedSynchronousErrorHandling&&Fa&&(Fa.errorThrown=!0,Fa.error=n)}var Ua=class extends pt{constructor(e){super(),this.isStopped=!1,e?(this.destination=e,Sm(e)&&e.add(this)):this.destination=R6}static create(e,t,r){return new qr(e,t,r)}next(e){this.isStopped?Uv(OM(e),this):this._next(e)}error(e){this.isStopped?Uv(bM(e),this):(this.isStopped=!0,this._error(e))}complete(){this.isStopped?Uv(wM,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(e){this.destination.next(e)}_error(e){try{this.destination.error(e)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}},C6=Function.prototype.bind;function Fv(n,e){return C6.call(n,e)}var Vv=class{constructor(e){this.partialObserver=e}next(e){let{partialObserver:t}=this;if(t.next)try{t.next(e)}catch(r){Cm(r)}}error(e){let{partialObserver:t}=this;if(t.error)try{t.error(e)}catch(r){Cm(r)}else Cm(e)}complete(){let{partialObserver:e}=this;if(e.complete)try{e.complete()}catch(t){Cm(t)}}},qr=class extends Ua{constructor(e,t,r){super();let i;if(Ee(e)||!e)i={next:e??void 0,error:t??void 0,complete:r??void 0};else{let o;this&&Wr.useDeprecatedNextContext?(o=Object.create(e),o.unsubscribe=()=>this.unsubscribe(),i={next:e.next&&Fv(e.next,o),error:e.error&&Fv(e.error,o),complete:e.complete&&Fv(e.complete,o)}):i=e}this.destination=new Vv(i)}};function Cm(n){Wr.useDeprecatedSynchronousErrorHandling?MM(n):Am(n)}function D6(n){throw n}function Uv(n,e){let{onStoppedNotification:t}=Wr;t&&nu.setTimeout(()=>t(n,e))}var R6={closed:!0,next:zr,error:D6,complete:zr};function he(n,e,t,r,i){return new Bv(n,e,t,r,i)}var Bv=class extends Ua{constructor(e,t,r,i,o,s){super(e),this.onFinalize=o,this.shouldUnsubscribe=s,this._next=t?function(a){try{t(a)}catch(c){e.error(c)}}:super._next,this._error=i?function(a){try{i(a)}catch(c){e.error(c)}finally{this.unsubscribe()}}:super._error,this._complete=r?function(){try{r()}catch(a){e.error(a)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){let{closed:t}=this;super.unsubscribe(),!t&&((e=this.onFinalize)===null||e===void 0||e.call(this))}}};function pn(n,e){return me((t,r)=>{let i=0;t.subscribe(he(r,o=>n.call(e,o,i++)&&r.next(o)))})}var iu=typeof Symbol=="function"&&Symbol.observable||"@@observable";function Kr(n){return n}function LM(n){return n.length===0?Kr:n.length===1?n[0]:function(t){return n.reduce((r,i)=>i(r),t)}}var fe=(()=>{class n{constructor(t){t&&(this._subscribe=t)}lift(t){let r=new n;return r.source=this,r.operator=t,r}subscribe(t,r,i){let o=w6(t)?t:new qr(t,r,i);return ru(()=>{let{operator:s,source:a}=this;o.add(s?s.call(o,a):a?this._subscribe(o):this._trySubscribe(o))}),o}_trySubscribe(t){try{return this._subscribe(t)}catch(r){t.error(r)}}forEach(t,r){return r=PM(r),new r((i,o)=>{let s=new qr({next:a=>{try{t(a)}catch(c){o(c),s.unsubscribe()}},error:o,complete:i});this.subscribe(s)})}_subscribe(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)}[iu](){return this}pipe(...t){return LM(t)(this)}toPromise(t){return t=PM(t),new t((r,i)=>{let o;this.subscribe(s=>o=s,s=>i(s),()=>r(o))})}}return n.create=e=>new n(e),n})();function PM(n){var e;return(e=n??Wr.Promise)!==null&&e!==void 0?e:Promise}function N6(n){return n&&Ee(n.next)&&Ee(n.error)&&Ee(n.complete)}function w6(n){return n&&n instanceof Ua||N6(n)&&Sm(n)}var Va=new fe(n=>n.complete());function gn(n){return n<=0?()=>Va:me((e,t)=>{let r=0;e.subscribe(he(t,i=>{++r<=n&&(t.next(i),n<=r&&t.complete())}))})}function Gv(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t}function kM(n,e,t,r){function i(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(d){try{l(r.next(d))}catch(h){s(h)}}function c(d){try{l(r.throw(d))}catch(h){s(h)}}function l(d){d.done?o(d.value):i(d.value).then(a,c)}l((r=r.apply(n,e||[])).next())})}function xM(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],r=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ba(n){return this instanceof Ba?(this.v=n,this):new Ba(n)}function FM(n,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=t.apply(n,e||[]),i,o=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",s),i[Symbol.asyncIterator]=function(){return this},i;function s(g){return function(E){return Promise.resolve(E).then(g,h)}}function a(g,E){r[g]&&(i[g]=function(v){return new Promise(function(S,P){o.push([g,v,S,P])>1||c(g,v)})},E&&(i[g]=E(i[g])))}function c(g,E){try{l(r[g](E))}catch(v){f(o[0][3],v)}}function l(g){g.value instanceof Ba?Promise.resolve(g.value.v).then(d,h):f(o[0][2],g)}function d(g){c("next",g)}function h(g){c("throw",g)}function f(g,E){g(E),o.shift(),o.length&&c(o[0][0],o[0][1])}}function UM(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],t;return e?e.call(n):(n=typeof xM=="function"?xM(n):n[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(o){t[o]=n[o]&&function(s){return new Promise(function(a,c){s=n[o](s),i(a,c,s.done,s.value)})}}function i(o,s,a,c){Promise.resolve(c).then(function(l){o({value:l,done:a})},s)}}var ou=n=>n&&typeof n.length=="number"&&typeof n!="function";function Dm(n){return Ee(n?.then)}function Rm(n){return Ee(n[iu])}function Nm(n){return Symbol.asyncIterator&&Ee(n?.[Symbol.asyncIterator])}function wm(n){return new TypeError(`You provided ${n!==null&&typeof n=="object"?"an invalid object":`'${n}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}function b6(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var bm=b6();function Om(n){return Ee(n?.[bm])}function Mm(n){return FM(this,arguments,function*(){let t=n.getReader();try{for(;;){let{value:r,done:i}=yield Ba(t.read());if(i)return yield Ba(void 0);yield yield Ba(r)}}finally{t.releaseLock()}})}function Lm(n){return Ee(n?.getReader)}function Ce(n){if(n instanceof fe)return n;if(n!=null){if(Rm(n))return O6(n);if(ou(n))return M6(n);if(Dm(n))return L6(n);if(Nm(n))return VM(n);if(Om(n))return P6(n);if(Lm(n))return x6(n)}throw wm(n)}function O6(n){return new fe(e=>{let t=n[iu]();if(Ee(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function M6(n){return new fe(e=>{for(let t=0;t<n.length&&!e.closed;t++)e.next(n[t]);e.complete()})}function L6(n){return new fe(e=>{n.then(t=>{e.closed||(e.next(t),e.complete())},t=>e.error(t)).then(null,Am)})}function P6(n){return new fe(e=>{for(let t of n)if(e.next(t),e.closed)return;e.complete()})}function VM(n){return new fe(e=>{k6(n,e).catch(t=>e.error(t))})}function x6(n){return VM(Mm(n))}function k6(n,e){var t,r,i,o;return kM(this,void 0,void 0,function*(){try{for(t=UM(n);r=yield t.next(),!r.done;){let s=r.value;if(e.next(s),e.closed)return}}catch(s){i={error:s}}finally{try{r&&!r.done&&(o=t.return)&&(yield o.call(t))}finally{if(i)throw i.error}}e.complete()})}function BM(n){return me((e,t)=>{let r=!1,i=null,o=null,s=!1,a=()=>{if(o?.unsubscribe(),o=null,r){r=!1;let l=i;i=null,t.next(l)}s&&t.complete()},c=()=>{o=null,s&&t.complete()};e.subscribe(he(t,l=>{r=!0,i=l,o||Ce(n(l)).subscribe(o=he(t,a,c))},()=>{s=!0,(!r||!o||o.closed)&&t.complete()}))})}var Pm=class extends pt{constructor(e,t){super()}schedule(e,t=0){return this}};var Wh={setInterval(n,e,...t){let{delegate:r}=Wh;return r?.setInterval?r.setInterval(n,e,...t):setInterval(n,e,...t)},clearInterval(n){let{delegate:e}=Wh;return(e?.clearInterval||clearInterval)(n)},delegate:void 0};var vi=class extends Pm{constructor(e,t){super(e,t),this.scheduler=e,this.work=t,this.pending=!1}schedule(e,t=0){var r;if(this.closed)return this;this.state=e;let i=this.id,o=this.scheduler;return i!=null&&(this.id=this.recycleAsyncId(o,i,t)),this.pending=!0,this.delay=t,this.id=(r=this.id)!==null&&r!==void 0?r:this.requestAsyncId(o,this.id,t),this}requestAsyncId(e,t,r=0){return Wh.setInterval(e.flush.bind(e,this),r)}recycleAsyncId(e,t,r=0){if(r!=null&&this.delay===r&&this.pending===!1)return t;t!=null&&Wh.clearInterval(t)}execute(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;let r=this._execute(e,t);if(r)return r;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(e,t){let r=!1,i;try{this.work(e)}catch(o){r=!0,i=o||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),i}unsubscribe(){if(!this.closed){let{id:e,scheduler:t}=this,{actions:r}=t;this.work=this.state=this.scheduler=null,this.pending=!1,ka(r,this),e!=null&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null,super.unsubscribe()}}};var Ga={now(){return(Ga.delegate||Date).now()},delegate:void 0};var su=class n{constructor(e,t=n.now){this.schedulerActionCtor=e,this.now=t}schedule(e,t=0,r){return new this.schedulerActionCtor(this,e).schedule(r,t)}};su.now=Ga.now;var Si=class extends su{constructor(e,t=su.now){super(e,t),this.actions=[],this._active=!1}flush(e){let{actions:t}=this;if(this._active){t.push(e);return}let r;this._active=!0;do if(r=e.execute(e.state,e.delay))break;while(e=t.shift());if(this._active=!1,r){for(;e=t.shift();)e.unsubscribe();throw r}}};var vn=new Si(vi),jv=vn;function xm(n){return n&&Ee(n.schedule)}function km(n){return n instanceof Date&&!isNaN(n)}function Eo(n=0,e,t=jv){let r=-1;return e!=null&&(xm(e)?t=e:r=e),new fe(i=>{let o=km(n)?+n-t.now():n;o<0&&(o=0);let s=0;return t.schedule(function(){i.closed||(i.next(s++),0<=r?this.schedule(void 0,r):i.complete())},o)})}function F6(n,e=vn){return BM(()=>Eo(n,e))}function Hv(n){return n[n.length-1]}function Fm(n){return Ee(Hv(n))?n.pop():void 0}function Ai(n){return xm(Hv(n))?n.pop():void 0}function GM(n,e){return typeof Hv(n)=="number"?n.pop():e}function Sn(n,e,t,r=0,i=!1){let o=e.schedule(function(){t(),i?n.add(this.schedule(null,r)):this.unsubscribe()},r);if(n.add(o),!i)return o}function $v(n){return me((e,t)=>{let r=null,i=!1,o;r=e.subscribe(he(t,void 0,void 0,s=>{o=Ce(n(s,$v(n)(e))),r?(r.unsubscribe(),r=null,o.subscribe(t)):i=!0})),i&&(r.unsubscribe(),r=null,o.subscribe(t))})}var{isArray:U6}=Array,{getPrototypeOf:V6,prototype:B6,keys:G6}=Object;function Um(n){if(n.length===1){let e=n[0];if(U6(e))return{args:e,keys:null};if(j6(e)){let t=G6(e);return{args:t.map(r=>e[r]),keys:t}}}return{args:n,keys:null}}function j6(n){return n&&typeof n=="object"&&V6(n)===B6}function as(n,e=0){return me((t,r)=>{t.subscribe(he(r,i=>Sn(r,n,()=>r.next(i),e),()=>Sn(r,n,()=>r.complete(),e),i=>Sn(r,n,()=>r.error(i),e)))})}function cs(n,e=0){return me((t,r)=>{r.add(n.schedule(()=>t.subscribe(r),e))})}function jM(n,e){return Ce(n).pipe(cs(e),as(e))}function HM(n,e){return Ce(n).pipe(cs(e),as(e))}function $M(n,e){return new fe(t=>{let r=0;return e.schedule(function(){r===n.length?t.complete():(t.next(n[r++]),t.closed||this.schedule())})})}function WM(n,e){return new fe(t=>{let r;return Sn(t,e,()=>{r=n[bm](),Sn(t,e,()=>{let i,o;try{({value:i,done:o}=r.next())}catch(s){t.error(s);return}o?t.complete():t.next(i)},0,!0)}),()=>Ee(r?.return)&&r.return()})}function Vm(n,e){if(!n)throw new Error("Iterable cannot be null");return new fe(t=>{Sn(t,e,()=>{let r=n[Symbol.asyncIterator]();Sn(t,e,()=>{r.next().then(i=>{i.done?t.complete():t.next(i.value)})},0,!0)})})}function zM(n,e){return Vm(Mm(n),e)}function qM(n,e){if(n!=null){if(Rm(n))return jM(n,e);if(ou(n))return $M(n,e);if(Dm(n))return HM(n,e);if(Nm(n))return Vm(n,e);if(Om(n))return WM(n,e);if(Lm(n))return zM(n,e)}throw wm(n)}function sr(n,e){return e?qM(n,e):Ce(n)}function De(n,e){return me((t,r)=>{let i=0;t.subscribe(he(r,o=>{r.next(n.call(e,o,i++))}))})}var{isArray:H6}=Array;function $6(n,e){return H6(e)?n(...e):n(e)}function au(n){return De(e=>$6(n,e))}function Bm(n,e){return n.reduce((t,r,i)=>(t[r]=e[i],t),{})}function ja(...n){let e=Ai(n),t=Fm(n),{args:r,keys:i}=Um(n);if(r.length===0)return sr([],e);let o=new fe(W6(r,e,i?s=>Bm(i,s):Kr));return t?o.pipe(au(t)):o}function W6(n,e,t=Kr){return r=>{KM(e,()=>{let{length:i}=n,o=new Array(i),s=i,a=i;for(let c=0;c<i;c++)KM(e,()=>{let l=sr(n[c],e),d=!1;l.subscribe(he(r,h=>{o[c]=h,d||(d=!0,a--),a||r.next(t(o.slice()))},()=>{--s||r.complete()}))},r)},r)}}function KM(n,e,t){n?Sn(t,n,e):e()}function YM(n,e,t,r,i,o,s,a){let c=[],l=0,d=0,h=!1,f=()=>{h&&!c.length&&!l&&e.complete()},g=v=>l<r?E(v):c.push(v),E=v=>{o&&e.next(v),l++;let S=!1;Ce(t(v,d++)).subscribe(he(e,P=>{i?.(P),o?g(P):e.next(P)},()=>{S=!0},void 0,()=>{if(S)try{for(l--;c.length&&l<r;){let P=c.shift();s?Sn(e,s,()=>E(P)):E(P)}f()}catch(P){e.error(P)}}))};return n.subscribe(he(e,g,()=>{h=!0,f()})),()=>{a?.()}}function Ci(n,e,t=1/0){return Ee(e)?Ci((r,i)=>De((o,s)=>e(r,o,i,s))(Ce(n(r,i))),t):(typeof e=="number"&&(t=e),me((r,i)=>YM(r,i,n,t)))}function XM(n,e,t,r,i){return(o,s)=>{let a=t,c=e,l=0;o.subscribe(he(s,d=>{let h=l++;c=a?n(c,d,h):(a=!0,d),r&&s.next(c)},i&&(()=>{a&&s.next(c),s.complete()})))}}function Gm(n=1/0){return Ci(Kr,n)}function QM(){return Gm(1)}function Wv(n,e){return Ee(e)?Ci(n,e,1):Ci(n,1)}var JM=ss(n=>function(){n(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});var Ct=(()=>{class n extends fe{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(t){let r=new jm(this,this);return r.operator=t,r}_throwIfClosed(){if(this.closed)throw new JM}next(t){ru(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(let r of this.currentObservers)r.next(t)}})}error(t){ru(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=t;let{observers:r}=this;for(;r.length;)r.shift().error(t)}})}complete(){ru(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;let{observers:t}=this;for(;t.length;)t.shift().complete()}})}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var t;return((t=this.observers)===null||t===void 0?void 0:t.length)>0}_trySubscribe(t){return this._throwIfClosed(),super._trySubscribe(t)}_subscribe(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)}_innerSubscribe(t){let{hasError:r,isStopped:i,observers:o}=this;return r||i?xv:(this.currentObservers=null,o.push(t),new pt(()=>{this.currentObservers=null,ka(o,t)}))}_checkFinalizedStatuses(t){let{hasError:r,thrownError:i,isStopped:o}=this;r?t.error(i):o&&t.complete()}asObservable(){let t=new fe;return t.source=this,t}}return n.create=(e,t)=>new jm(e,t),n})(),jm=class extends Ct{constructor(e,t){super(),this.destination=e,this.source=t}next(e){var t,r;(r=(t=this.destination)===null||t===void 0?void 0:t.next)===null||r===void 0||r.call(t,e)}error(e){var t,r;(r=(t=this.destination)===null||t===void 0?void 0:t.error)===null||r===void 0||r.call(t,e)}complete(){var e,t;(t=(e=this.destination)===null||e===void 0?void 0:e.complete)===null||t===void 0||t.call(e)}_subscribe(e){var t,r;return(r=(t=this.source)===null||t===void 0?void 0:t.subscribe(e))!==null&&r!==void 0?r:xv}};function z6(n){return me((e,t)=>{let r=!1,i=null,o=null,s=()=>{if(o?.unsubscribe(),o=null,r){r=!1;let a=i;i=null,t.next(a)}};e.subscribe(he(t,a=>{o?.unsubscribe(),r=!0,i=a,o=he(t,s,zr),Ce(n(a)).subscribe(o)},()=>{s(),t.complete()},void 0,()=>{i=o=null}))})}function Hm(n,e=vn){return me((t,r)=>{let i=null,o=null,s=null,a=()=>{if(i){i.unsubscribe(),i=null;let l=o;o=null,r.next(l)}};function c(){let l=s+n,d=e.now();if(d<l){i=this.schedule(void 0,l-d),r.add(i);return}a()}t.subscribe(he(r,l=>{o=l,s=e.now(),i||(i=e.schedule(c,n),r.add(i))},()=>{a(),r.complete()},void 0,()=>{o=i=null}))})}function ls(...n){return QM()(sr(n,Ai(n)))}function ZM(){return me((n,e)=>{n.subscribe(he(e,zr))})}function eL(n){return De(()=>n)}function zv(n,e){return e?t=>ls(e.pipe(gn(1),ZM()),t.pipe(zv(n))):Ci((t,r)=>Ce(n(t,r)).pipe(gn(1),eL(t)))}function qv(n,e=vn){let t=Eo(n,e);return zv(()=>t)}function ct(...n){let e=Ai(n);return sr(n,e)}function _o(n,e=Kr){return n=n??q6,me((t,r)=>{let i,o=!0;t.subscribe(he(r,s=>{let a=e(s);(o||!n(i,a))&&(o=!1,i=a,r.next(s))}))})}function q6(n,e){return n===e}var tL=ss(n=>function(){n(this),this.name="EmptyError",this.message="no elements in sequence"});function zh(n){return me((e,t)=>{try{e.subscribe(t)}finally{t.add(n)}})}function nL(){return me((n,e)=>{let t=null;n._refCount++;let r=he(e,void 0,void 0,void 0,()=>{if(!n||n._refCount<=0||0<--n._refCount){t=null;return}let i=n._connection,o=t;t=null,i&&(!o||i===o)&&i.unsubscribe(),e.unsubscribe()});n.subscribe(r),r.closed||(t=n.connect())})}var Kv=class extends fe{constructor(e,t){super(),this.source=e,this.subjectFactory=t,this._subject=null,this._refCount=0,this._connection=null,Pv(e)&&(this.lift=e.lift)}_subscribe(e){return this.getSubject().subscribe(e)}getSubject(){let e=this._subject;return(!e||e.isStopped)&&(this._subject=this.subjectFactory()),this._subject}_teardown(){this._refCount=0;let{_connection:e}=this;this._subject=this._connection=null,e?.unsubscribe()}connect(){let e=this._connection;if(!e){e=this._connection=new pt;let t=this.getSubject();e.add(this.source.subscribe(he(t,void 0,()=>{this._teardown(),t.complete()},r=>{this._teardown(),t.error(r)},()=>this._teardown()))),e.closed&&(this._connection=null,e=pt.EMPTY)}return e}refCount(){return nL()(this)}};function Ha(){return me((n,e)=>{let t,r=!1;n.subscribe(he(e,i=>{let o=t;t=i,r&&e.next([o,i]),r=!0}))})}var ie=class extends Ct{constructor(e){super(),this._value=e}get value(){return this.getValue()}_subscribe(e){let t=super._subscribe(e);return!t.closed&&e.next(this._value),t}getValue(){let{hasError:e,thrownError:t,_value:r}=this;if(e)throw t;return this._throwIfClosed(),r}next(e){super.next(this._value=e)}};var $a=class extends Ct{constructor(e=1/0,t=1/0,r=Ga){super(),this._bufferSize=e,this._windowTime=t,this._timestampProvider=r,this._buffer=[],this._infiniteTimeWindow=!0,this._infiniteTimeWindow=t===1/0,this._bufferSize=Math.max(1,e),this._windowTime=Math.max(1,t)}next(e){let{isStopped:t,_buffer:r,_infiniteTimeWindow:i,_timestampProvider:o,_windowTime:s}=this;t||(r.push(e),!i&&r.push(o.now()+s)),this._trimBuffer(),super.next(e)}_subscribe(e){this._throwIfClosed(),this._trimBuffer();let t=this._innerSubscribe(e),{_infiniteTimeWindow:r,_buffer:i}=this,o=i.slice();for(let s=0;s<o.length&&!e.closed;s+=r?1:2)e.next(o[s]);return this._checkFinalizedStatuses(e),t}_trimBuffer(){let{_bufferSize:e,_timestampProvider:t,_buffer:r,_infiniteTimeWindow:i}=this,o=(i?1:2)*e;if(e<1/0&&o<r.length&&r.splice(0,r.length-o),!i){let s=t.now(),a=0;for(let c=1;c<r.length&&r[c]<=s;c+=2)a=c;a&&r.splice(0,a+1)}}};function K6(n=0,e=vn){return n<0&&(n=0),Eo(n,n,e)}function $m(n,e){return me(XM(n,e,arguments.length>=2,!0))}function Xv(n={}){let{connector:e=()=>new Ct,resetOnError:t=!0,resetOnComplete:r=!0,resetOnRefCountZero:i=!0}=n;return o=>{let s,a,c,l=0,d=!1,h=!1,f=()=>{a?.unsubscribe(),a=void 0},g=()=>{f(),s=c=void 0,d=h=!1},E=()=>{let v=s;g(),v?.unsubscribe()};return me((v,S)=>{l++,!h&&!d&&f();let P=c=c??e();S.add(()=>{l--,l===0&&!h&&!d&&(a=Yv(E,i))}),P.subscribe(S),!s&&l>0&&(s=new qr({next:V=>P.next(V),error:V=>{h=!0,f(),a=Yv(g,t,V),P.error(V)},complete:()=>{d=!0,f(),a=Yv(g,r),P.complete()}}),Ce(v).subscribe(s))})(o)}}function Yv(n,e,...t){if(e===!0){n();return}if(e===!1)return;let r=new qr({next:()=>{r.unsubscribe(),n()}});return Ce(e(...t)).subscribe(r)}function Y6(n,e,t){let r,i=!1;return n&&typeof n=="object"?{bufferSize:r=1/0,windowTime:e=1/0,refCount:i=!1,scheduler:t}=n:r=n??1/0,Xv({connector:()=>new $a(r,e,t),resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:i})}function Qv(n){return pn((e,t)=>n<=t)}function X6(n){return me((e,t)=>{let r=!1,i=he(t,()=>{i?.unsubscribe(),r=!0},zr);Ce(n).subscribe(i),e.subscribe(he(t,o=>r&&t.next(o)))})}function Wa(...n){let e=Ai(n);return me((t,r)=>{(e?ls(n,t,e):ls(n,t)).subscribe(r)})}function br(n,e){return me((t,r)=>{let i=null,o=0,s=!1,a=()=>s&&!i&&r.complete();t.subscribe(he(r,c=>{i?.unsubscribe();let l=0,d=o++;Ce(n(c,d)).subscribe(i=he(r,h=>r.next(e?e(c,h,d,l++):h),()=>{i=null,a()}))},()=>{s=!0,a()}))})}function us(n){return me((e,t)=>{Ce(n).subscribe(he(t,()=>t.complete(),zr)),!t.closed&&e.subscribe(t)})}function Q6(n,e=!1){return me((t,r)=>{let i=0;t.subscribe(he(r,o=>{let s=n(o,i++);(s||e)&&r.next(o),!s&&r.complete()}))})}function Wm(n,e,t){let r=Ee(n)||e||t?{next:n,error:e,complete:t}:n;return r?me((i,o)=>{var s;(s=r.subscribe)===null||s===void 0||s.call(r);let a=!0;i.subscribe(he(o,c=>{var l;(l=r.next)===null||l===void 0||l.call(r,c),o.next(c)},()=>{var c;a=!1,(c=r.complete)===null||c===void 0||c.call(r),o.complete()},c=>{var l;a=!1,(l=r.error)===null||l===void 0||l.call(r,c),o.error(c)},()=>{var c,l;a&&((c=r.unsubscribe)===null||c===void 0||c.call(r)),(l=r.finalize)===null||l===void 0||l.call(r)}))}):Kr}function rL(n,e){return me((t,r)=>{let{leading:i=!0,trailing:o=!1}=e??{},s=!1,a=null,c=null,l=!1,d=()=>{c?.unsubscribe(),c=null,o&&(g(),l&&r.complete())},h=()=>{c=null,l&&r.complete()},f=E=>c=Ce(n(E)).subscribe(he(r,d,h)),g=()=>{if(s){s=!1;let E=a;a=null,r.next(E),!l&&f(E)}};t.subscribe(he(r,E=>{s=!0,a=E,!(c&&!c.closed)&&(i?g():f(E))},()=>{l=!0,!(o&&s&&c&&!c.closed)&&r.complete()}))})}function J6(n,e=vn,t){let r=Eo(n,e);return rL(()=>r,t)}var Z6=ss(n=>function(t=null){n(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=t});function e4(n,e){let{first:t,each:r,with:i=t4,scheduler:o=e??vn,meta:s=null}=km(n)?{first:n}:typeof n=="number"?{each:n}:n;if(t==null&&r==null)throw new TypeError("No timeout provided.");return me((a,c)=>{let l,d,h=null,f=0,g=E=>{d=Sn(c,o,()=>{try{l.unsubscribe(),Ce(i({meta:s,lastValue:h,seen:f})).subscribe(c)}catch(v){c.error(v)}},E)};l=a.subscribe(he(c,E=>{d?.unsubscribe(),f++,c.next(h=E),r>0&&g(r)},void 0,void 0,()=>{d?.closed||d?.unsubscribe(),h=null})),!f&&g(t!=null?typeof t=="number"?t:+t-o.now():r)})}function t4(n){throw new Z6(n)}function n4(n=Ga){return De(e=>({value:e,timestamp:n.now()}))}var Jv;function zm(){return Jv}function Di(n){let e=Jv;return Jv=n,e}var iL=Symbol("NotFound");function cu(n){return n===iL||n?.name==="\u0275NotFound"}var An=null,qm=!1,Zv=1,r4=null,nn=Symbol("SIGNAL");function _e(n){let e=An;return An=n,e}function Qm(){return An}var za={version:0,lastCleanEpoch:0,dirty:!1,producers:void 0,producersTail:void 0,consumers:void 0,consumersTail:void 0,recomputing:!1,consumerAllowSignalWrites:!1,consumerIsAlwaysLive:!1,kind:"unknown",producerMustRecompute:()=>!1,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{}};function lu(n){if(qm)throw new Error("");if(An===null)return;An.consumerOnSignalRead(n);let e=An.producersTail;if(e!==void 0&&e.producer===n)return;let t,r=An.recomputing;if(r&&(t=e!==void 0?e.nextProducer:An.producers,t!==void 0&&t.producer===n)){An.producersTail=t,t.lastReadVersion=n.version;return}let i=n.consumersTail;if(i!==void 0&&i.consumer===An&&(!r||o4(i,An)))return;let o=hu(An),s={producer:n,consumer:An,nextProducer:t,prevConsumer:i,lastReadVersion:n.version,nextConsumer:void 0};An.producersTail=s,e!==void 0?e.nextProducer=s:An.producers=s,o&&cL(n,s)}function oL(){Zv++}function Jm(n){if(!(hu(n)&&!n.dirty)&&!(!n.dirty&&n.lastCleanEpoch===Zv)){if(!n.producerMustRecompute(n)&&!du(n)){Xm(n);return}n.producerRecomputeValue(n),Xm(n)}}function eS(n){if(n.consumers===void 0)return;let e=qm;qm=!0;try{for(let t=n.consumers;t!==void 0;t=t.nextConsumer){let r=t.consumer;r.dirty||i4(r)}}finally{qm=e}}function tS(){return An?.consumerAllowSignalWrites!==!1}function i4(n){n.dirty=!0,eS(n),n.consumerMarkedDirty?.(n)}function Xm(n){n.dirty=!1,n.lastCleanEpoch=Zv}function qa(n){return n&&sL(n),_e(n)}function sL(n){n.producersTail=void 0,n.recomputing=!0}function uu(n,e){_e(e),n&&aL(n)}function aL(n){n.recomputing=!1;let e=n.producersTail,t=e!==void 0?e.nextProducer:n.producers;if(t!==void 0){if(hu(n))do t=nS(t);while(t!==void 0);e!==void 0?e.nextProducer=void 0:n.producers=void 0}}function du(n){for(let e=n.producers;e!==void 0;e=e.nextProducer){let t=e.producer,r=e.lastReadVersion;if(r!==t.version||(Jm(t),r!==t.version))return!0}return!1}function Ka(n){if(hu(n)){let e=n.producers;for(;e!==void 0;)e=nS(e)}n.producers=void 0,n.producersTail=void 0,n.consumers=void 0,n.consumersTail=void 0}function cL(n,e){let t=n.consumersTail,r=hu(n);if(t!==void 0?(e.nextConsumer=t.nextConsumer,t.nextConsumer=e):(e.nextConsumer=void 0,n.consumers=e),e.prevConsumer=t,n.consumersTail=e,!r)for(let i=n.producers;i!==void 0;i=i.nextProducer)cL(i.producer,i)}function nS(n){let e=n.producer,t=n.nextProducer,r=n.nextConsumer,i=n.prevConsumer;if(n.nextConsumer=void 0,n.prevConsumer=void 0,r!==void 0?r.prevConsumer=i:e.consumersTail=i,i!==void 0)i.nextConsumer=r;else if(e.consumers=r,!hu(e)){let o=e.producers;for(;o!==void 0;)o=nS(o)}return t}function hu(n){return n.consumerIsAlwaysLive||n.consumers!==void 0}function Zm(n){r4?.(n)}function o4(n,e){let t=e.producersTail;if(t!==void 0){let r=e.producers;do{if(r===n)return!0;if(r===t)break;r=r.nextProducer}while(r!==void 0)}return!1}function eE(n,e){return Object.is(n,e)}function Kh(n,e){let t=Object.create(s4);t.computation=n,e!==void 0&&(t.equal=e);let r=()=>{if(Jm(t),lu(t),t.value===qh)throw t.error;return t.value};return r[nn]=t,Zm(t),r}var Km=Symbol("UNSET"),Ym=Symbol("COMPUTING"),qh=Symbol("ERRORED"),s4=ye($({},za),{value:Km,dirty:!0,error:null,equal:eE,kind:"computed",producerMustRecompute(n){return n.value===Km||n.value===Ym},producerRecomputeValue(n){if(n.value===Ym)throw new Error("");let e=n.value;n.value=Ym;let t=qa(n),r,i=!1;try{r=n.computation(),_e(null),i=e!==Km&&e!==qh&&r!==qh&&n.equal(e,r)}catch(o){r=qh,n.error=o}finally{uu(n,t)}if(i){n.value=e;return}n.value=r,n.version++}});function a4(){throw new Error}var lL=a4;function uL(n){lL(n)}function rS(n){lL=n}var c4=null;function iS(n,e){let t=Object.create(tE);t.value=n,e!==void 0&&(t.equal=e);let r=()=>dL(t);return r[nn]=t,Zm(t),[r,s=>fu(t,s),s=>oS(t,s)]}function dL(n){return lu(n),n.value}function fu(n,e){tS()||uL(n),n.equal(n.value,e)||(n.value=e,l4(n))}function oS(n,e){tS()||uL(n),fu(n,e(n.value))}var tE=ye($({},za),{equal:eE,value:void 0,kind:"signal"});function l4(n){n.version++,oL(),eS(n),c4?.(n)}var pu={schedule(n){let e=requestAnimationFrame,t=cancelAnimationFrame,{delegate:r}=pu;r&&(e=r.requestAnimationFrame,t=r.cancelAnimationFrame);let i=e(o=>{t=void 0,n(o)});return new pt(()=>t?.(i))},requestAnimationFrame(...n){let{delegate:e}=pu;return(e?.requestAnimationFrame||requestAnimationFrame)(...n)},cancelAnimationFrame(...n){let{delegate:e}=pu;return(e?.cancelAnimationFrame||cancelAnimationFrame)(...n)},delegate:void 0};var u4=1,sS,aS={};function hL(n){return n in aS?(delete aS[n],!0):!1}var fL={setImmediate(n){let e=u4++;return aS[e]=!0,sS||(sS=Promise.resolve()),sS.then(()=>hL(e)&&n()),e},clearImmediate(n){hL(n)}};var{setImmediate:d4,clearImmediate:h4}=fL,Yh={setImmediate(...n){let{delegate:e}=Yh;return(e?.setImmediate||d4)(...n)},clearImmediate(n){let{delegate:e}=Yh;return(e?.clearImmediate||h4)(n)},delegate:void 0};var nE=class extends vi{constructor(e,t){super(e,t),this.scheduler=e,this.work=t}requestAsyncId(e,t,r=0){return r!==null&&r>0?super.requestAsyncId(e,t,r):(e.actions.push(this),e._scheduled||(e._scheduled=Yh.setImmediate(e.flush.bind(e,void 0))))}recycleAsyncId(e,t,r=0){var i;if(r!=null?r>0:this.delay>0)return super.recycleAsyncId(e,t,r);let{actions:o}=e;t!=null&&((i=o[o.length-1])===null||i===void 0?void 0:i.id)!==t&&(Yh.clearImmediate(t),e._scheduled===t&&(e._scheduled=void 0))}};var rE=class extends Si{flush(e){this._active=!0;let t=this._scheduled;this._scheduled=void 0;let{actions:r}=this,i;e=e||r.shift();do if(i=e.execute(e.state,e.delay))break;while((e=r[0])&&e.id===t&&r.shift());if(this._active=!1,i){for(;(e=r[0])&&e.id===t&&r.shift();)e.unsubscribe();throw i}}};var f4=new rE(nE);var iE=class extends vi{constructor(e,t){super(e,t),this.scheduler=e,this.work=t}schedule(e,t=0){return t>0?super.schedule(e,t):(this.delay=t,this.state=e,this.scheduler.flush(this),this)}execute(e,t){return t>0||this.closed?super.execute(e,t):this._execute(e,t)}requestAsyncId(e,t,r=0){return r!=null&&r>0||r==null&&this.delay>0?super.requestAsyncId(e,t,r):(e.flush(this),0)}};var oE=class extends Si{};var cS=new oE(iE);var sE=class extends vi{constructor(e,t){super(e,t),this.scheduler=e,this.work=t}requestAsyncId(e,t,r=0){return r!==null&&r>0?super.requestAsyncId(e,t,r):(e.actions.push(this),e._scheduled||(e._scheduled=pu.requestAnimationFrame(()=>e.flush(void 0))))}recycleAsyncId(e,t,r=0){var i;if(r!=null?r>0:this.delay>0)return super.recycleAsyncId(e,t,r);let{actions:o}=e;t!=null&&t===e._scheduled&&((i=o[o.length-1])===null||i===void 0?void 0:i.id)!==t&&(pu.cancelAnimationFrame(t),e._scheduled=void 0)}};var aE=class extends Si{flush(e){this._active=!0;let t;e?t=e.id:(t=this._scheduled,this._scheduled=void 0);let{actions:r}=this,i;e=e||r.shift();do if(i=e.execute(e.state,e.delay))break;while((e=r[0])&&e.id===t&&r.shift());if(this._active=!1,i){for(;(e=r[0])&&e.id===t&&r.shift();)e.unsubscribe();throw i}}};var p4=new aE(sE);function g4(n){return!!n&&(n instanceof fe||Ee(n.lift)&&Ee(n.subscribe))}function m4(n,e){let t=typeof e=="object";return new Promise((r,i)=>{let o=new qr({next:s=>{r(s),o.unsubscribe()},error:i,complete:()=>{t?r(e.defaultValue):i(new tL)}});n.subscribe(o)})}function Xh(n){return new fe(e=>{Ce(n()).subscribe(e)})}function E4(...n){let e=Fm(n),{args:t,keys:r}=Um(n),i=new fe(o=>{let{length:s}=t;if(!s){o.complete();return}let a=new Array(s),c=s,l=s;for(let d=0;d<s;d++){let h=!1;Ce(t[d]).subscribe(he(o,f=>{h||(h=!0,l--),a[d]=f},()=>c--,void 0,()=>{(!c||!h)&&(l||o.next(r?Bm(r,a):a),o.complete())}))}});return e?i.pipe(au(e)):i}var _4=["addListener","removeListener"],T4=["addEventListener","removeEventListener"],I4=["on","off"];function Ri(n,e,t,r){if(Ee(t)&&(r=t,t=void 0),r)return Ri(n,e,t).pipe(au(r));let[i,o]=S4(n)?T4.map(s=>a=>n[s](e,a,t)):y4(n)?_4.map(pL(n,e)):v4(n)?I4.map(pL(n,e)):[];if(!i&&ou(n))return Ci(s=>Ri(s,e,t))(Ce(n));if(!i)throw new TypeError("Invalid event target");return new fe(s=>{let a=(...c)=>s.next(1<c.length?c:c[0]);return i(a),()=>o(a)})}function pL(n,e){return t=>r=>n[t](e,r)}function y4(n){return Ee(n.addListener)&&Ee(n.removeListener)}function v4(n){return Ee(n.on)&&Ee(n.off)}function S4(n){return Ee(n.addEventListener)&&Ee(n.removeEventListener)}function A4(n,e,t){return Xh(()=>n()?e:t)}function ds(...n){let e=Ai(n),t=GM(n,1/0),r=n;return r.length?r.length===1?Ce(r[0]):Gm(t)(sr(r,e)):Va}function gL(n){let e=_e(null);try{return n()}finally{_e(e)}}var mL=ye($({},za),{consumerIsAlwaysLive:!0,consumerAllowSignalWrites:!0,dirty:!0,kind:"effect"});function EL(n){if(n.dirty=!1,n.version>0&&!du(n))return;n.version++;let e=qa(n);try{n.cleanup(),n.fn()}finally{uu(n,e)}}var Xa=class{full;major;minor;patch;constructor(e){this.full=e;let t=e.split(".");this.major=t[0],this.minor=t[1],this.patch=t.slice(2).join(".")}},IS=new Xa("20.3.31");var hE="https://angular.dev/best-practices/security#preventing-cross-site-scripting-xss",J=class extends Error{code;constructor(e,t){super(gs(e,t)),this.code=e}};function C4(n){return`NG0${Math.abs(n)}`}function gs(n,e){return`${C4(n)}${e?": "+e:""}`}var Lt=globalThis;function $e(n){for(let e in n)if(n[e]===$e)return e;throw Error("")}function IL(n,e){for(let t in e)e.hasOwnProperty(t)&&!n.hasOwnProperty(t)&&(n[t]=e[t])}function Io(n){if(typeof n=="string")return n;if(Array.isArray(n))return`[${n.map(Io).join(", ")}]`;if(n==null)return""+n;let e=n.overriddenName||n.name;if(e)return`${e}`;let t=n.toString();if(t==null)return""+t;let r=t.indexOf(`
|
|
4
|
+
`);return r>=0?t.slice(0,r):t}function fE(n,e){return n?e?`${n} ${e}`:n:e||""}var D4=$e({__forward_ref__:$e});function pE(n){return n.__forward_ref__=pE,n.toString=function(){return Io(this())},n}function jt(n){return yS(n)?n():n}function yS(n){return typeof n=="function"&&n.hasOwnProperty(D4)&&n.__forward_ref__===pE}function Q(n){return{token:n.token,providedIn:n.providedIn||null,factory:n.factory,value:void 0}}function yo(n){return{providers:n.providers||[],imports:n.imports||[]}}function gE(n){return R4(n,mE)}function R4(n,e){return n.hasOwnProperty(e)&&n[e]||null}function N4(n){let e=n?.[mE]??null;return e||null}function uS(n){return n&&n.hasOwnProperty(uE)?n[uE]:null}var mE=$e({\u0275prov:$e}),uE=$e({\u0275inj:$e}),z=class{_desc;ngMetadataName="InjectionToken";\u0275prov;constructor(e,t){this._desc=e,this.\u0275prov=void 0,typeof t=="number"?this.__NG_ELEMENT_ID__=t:t!==void 0&&(this.\u0275prov=Q({token:this,providedIn:t.providedIn||"root",factory:t.factory}))}get multi(){return this}toString(){return`InjectionToken ${this._desc}`}};function vS(n){return n&&!!n.\u0275providers}var SS=$e({\u0275cmp:$e}),AS=$e({\u0275dir:$e}),CS=$e({\u0275pipe:$e}),DS=$e({\u0275mod:$e}),Jh=$e({\u0275fac:$e}),ec=$e({__NG_ELEMENT_ID__:$e}),_L=$e({__NG_ENV_ID__:$e});function cr(n){return typeof n=="string"?n:n==null?"":String(n)}function yL(n){return typeof n=="function"?n.name||n.toString():typeof n=="object"&&n!=null&&typeof n.type=="function"?n.type.name||n.type.toString():cr(n)}var vL=$e({ngErrorCode:$e}),w4=$e({ngErrorMessage:$e}),b4=$e({ngTokenPath:$e});function RS(n,e){return SL("",-200,e)}function EE(n,e){throw new J(-201,!1)}function SL(n,e,t){let r=new J(e,n);return r[vL]=e,r[w4]=n,t&&(r[b4]=t),r}function O4(n){return n[vL]}var dS;function AL(){return dS}function Un(n){let e=dS;return dS=n,e}function NS(n,e,t){let r=gE(n);if(r&&r.providedIn=="root")return r.value===void 0?r.value=r.factory():r.value;if(t&8)return null;if(e!==void 0)return e;EE(n,"Injector")}var M4={},Ya=M4,hS="__NG_DI_FLAG__",fS=class{injector;constructor(e){this.injector=e}retrieve(e,t){let r=Qa(t)||0;try{return this.injector.get(e,r&8?null:Ya,r)}catch(i){if(cu(i))return i;throw i}}};function L4(n,e=0){let t=zm();if(t===void 0)throw new J(-203,!1);if(t===null)return NS(n,void 0,e);{let r=P4(e),i=t.retrieve(n,r);if(cu(i)){if(r.optional)return null;throw i}return i}}function H(n,e=0){return(AL()||L4)(jt(n),e)}function Y(n,e){return H(n,Qa(e))}function Qa(n){return typeof n>"u"||typeof n=="number"?n:0|(n.optional&&8)|(n.host&&1)|(n.self&&2)|(n.skipSelf&&4)}function P4(n){return{optional:!!(n&8),host:!!(n&1),self:!!(n&2),skipSelf:!!(n&4)}}function pS(n){let e=[];for(let t=0;t<n.length;t++){let r=jt(n[t]);if(Array.isArray(r)){if(r.length===0)throw new J(900,!1);let i,o=0;for(let s=0;s<r.length;s++){let a=r[s],c=x4(a);typeof c=="number"?c===-1?i=a.token:o|=c:i=a}e.push(H(i,o))}else e.push(H(r))}return e}function wS(n,e){return n[hS]=e,n.prototype[hS]=e,n}function x4(n){return n[hS]}function fs(n,e){let t=n.hasOwnProperty(Jh);return t?n[Jh]:null}function CL(n,e,t){if(n.length!==e.length)return!1;for(let r=0;r<n.length;r++){let i=n[r],o=e[r];if(t&&(i=t(i),o=t(o)),o!==i)return!1}return!0}function DL(n){return n.flat(Number.POSITIVE_INFINITY)}function _E(n,e){n.forEach(t=>Array.isArray(t)?_E(t,e):e(t))}function bS(n,e,t){e>=n.length?n.push(t):n.splice(e,0,t)}function nf(n,e){return e>=n.length-1?n.pop():n.splice(e,1)[0]}function RL(n,e){let t=[];for(let r=0;r<n;r++)t.push(e);return t}function NL(n,e,t,r){let i=n.length;if(i==e)n.push(t,r);else if(i===1)n.push(r,n[0]),n[0]=t;else{for(i--,n.push(n[i-1],n[i]);i>e;){let o=i-2;n[i]=n[o],i--}n[e]=t,n[e+1]=r}}function rf(n,e,t){let r=mu(n,e);return r>=0?n[r|1]=t:(r=~r,NL(n,r,e,t)),r}function TE(n,e){let t=mu(n,e);if(t>=0)return n[t|1]}function mu(n,e){return k4(n,e,1)}function k4(n,e,t){let r=0,i=n.length>>t;for(;i!==r;){let o=r+(i-r>>1),s=n[o<<t];if(e===s)return o<<t;s>e?i=o:r=o+1}return~(i<<t)}var Yr={},Cn=[],ms=new z(""),OS=new z("",-1),MS=new z(""),Zh=class{get(e,t=Ya){if(t===Ya){let i=SL("",-201);throw i.name="\u0275NotFound",i}return t}};function wL(n){return n[DS]||null}function Es(n){return n[SS]||null}function IE(n){return n[AS]||null}function LS(n){return n[CS]||null}function qn(n){return{\u0275providers:n}}function bL(...n){return{\u0275providers:PS(!0,n),\u0275fromNgModule:!0}}function PS(n,...e){let t=[],r=new Set,i,o=s=>{t.push(s)};return _E(e,s=>{let a=s;dE(a,o,[],r)&&(i||=[],i.push(a))}),i!==void 0&&OL(i,o),t}function OL(n,e){for(let t=0;t<n.length;t++){let{ngModule:r,providers:i}=n[t];xS(i,o=>{e(o,r)})}}function dE(n,e,t,r){if(n=jt(n),!n)return!1;let i=null,o=uS(n),s=!o&&Es(n);if(!o&&!s){let c=n.ngModule;if(o=uS(c),o)i=c;else return!1}else{if(s&&!s.standalone)return!1;i=n}let a=r.has(i);if(s){if(a)return!1;if(r.add(i),s.dependencies){let c=typeof s.dependencies=="function"?s.dependencies():s.dependencies;for(let l of c)dE(l,e,t,r)}}else if(o){if(o.imports!=null&&!a){r.add(i);let l;_E(o.imports,d=>{dE(d,e,t,r)&&(l||=[],l.push(d))}),l!==void 0&&OL(l,e)}if(!a){let l=fs(i)||(()=>new i);e({provide:i,useFactory:l,deps:Cn},i),e({provide:MS,useValue:i,multi:!0},i),e({provide:ms,useValue:()=>H(i),multi:!0},i)}let c=o.providers;if(c!=null&&!a){let l=n;xS(c,d=>{e(d,l)})}}else return!1;return i!==n&&n.providers!==void 0}function xS(n,e){for(let t of n)vS(t)&&(t=t.\u0275providers),Array.isArray(t)?xS(t,e):e(t)}var F4=$e({provide:String,useValue:$e});function ML(n){return n!==null&&typeof n=="object"&&F4 in n}function U4(n){return!!(n&&n.useExisting)}function V4(n){return!!(n&&n.useFactory)}function Ja(n){return typeof n=="function"}function LL(n){return!!n.useClass}var of=new z(""),cE={},TL={},lS;function Eu(){return lS===void 0&&(lS=new Zh),lS}var Dn=class{},Za=class extends Dn{parent;source;scopes;records=new Map;_ngOnDestroyHooks=new Set;_onDestroyHooks=[];get destroyed(){return this._destroyed}_destroyed=!1;injectorDefTypes;constructor(e,t,r,i){super(),this.parent=t,this.source=r,this.scopes=i,mS(e,s=>this.processProvider(s)),this.records.set(OS,gu(void 0,this)),i.has("environment")&&this.records.set(Dn,gu(void 0,this));let o=this.records.get(of);o!=null&&typeof o.value=="string"&&this.scopes.add(o.value),this.injectorDefTypes=new Set(this.get(MS,Cn,{self:!0}))}retrieve(e,t){let r=Qa(t)||0;try{return this.get(e,Ya,r)}catch(i){if(cu(i))return i;throw i}}destroy(){Qh(this),this._destroyed=!0;let e=_e(null);try{for(let r of this._ngOnDestroyHooks)r.ngOnDestroy();let t=this._onDestroyHooks;this._onDestroyHooks=[];for(let r of t)r()}finally{this.records.clear(),this._ngOnDestroyHooks.clear(),this.injectorDefTypes.clear(),_e(e)}}onDestroy(e){return Qh(this),this._onDestroyHooks.push(e),()=>this.removeOnDestroy(e)}runInContext(e){Qh(this);let t=Di(this),r=Un(void 0),i;try{return e()}finally{Di(t),Un(r)}}get(e,t=Ya,r){if(Qh(this),e.hasOwnProperty(_L))return e[_L](this);let i=Qa(r),o,s=Di(this),a=Un(void 0);try{if(!(i&4)){let l=this.records.get(e);if(l===void 0){let d=$4(e)&&gE(e);d&&this.injectableDefInScope(d)?l=gu(gS(e),cE):l=null,this.records.set(e,l)}if(l!=null)return this.hydrate(e,l,i)}let c=i&2?Eu():this.parent;return t=i&8&&t===Ya?null:t,c.get(e,t)}catch(c){let l=O4(c);throw l===-200||l===-201?new J(l,null):c}finally{Un(a),Di(s)}}resolveInjectorInitializers(){let e=_e(null),t=Di(this),r=Un(void 0),i;try{let o=this.get(ms,Cn,{self:!0});for(let s of o)s()}finally{Di(t),Un(r),_e(e)}}toString(){let e=[],t=this.records;for(let r of t.keys())e.push(Io(r));return`R3Injector[${e.join(", ")}]`}processProvider(e){e=jt(e);let t=Ja(e)?e:jt(e&&e.provide),r=G4(e);if(!Ja(e)&&e.multi===!0){let i=this.records.get(t);i||(i=gu(void 0,cE,!0),i.factory=()=>pS(i.multi),this.records.set(t,i)),t=e,i.multi.push(e)}this.records.set(t,r)}hydrate(e,t,r){let i=_e(null);try{if(t.value===TL)throw RS(Io(e));return t.value===cE&&(t.value=TL,t.value=t.factory(void 0,r)),typeof t.value=="object"&&t.value&&H4(t.value)&&this._ngOnDestroyHooks.add(t.value),t.value}finally{_e(i)}}injectableDefInScope(e){if(!e.providedIn)return!1;let t=jt(e.providedIn);return typeof t=="string"?t==="any"||this.scopes.has(t):this.injectorDefTypes.has(t)}removeOnDestroy(e){let t=this._onDestroyHooks.indexOf(e);t!==-1&&this._onDestroyHooks.splice(t,1)}};function gS(n){let e=gE(n),t=e!==null?e.factory:fs(n);if(t!==null)return t;if(n instanceof z)throw new J(204,!1);if(n instanceof Function)return B4(n);throw new J(204,!1)}function B4(n){if(n.length>0)throw new J(204,!1);let t=N4(n);return t!==null?()=>t.factory(n):()=>new n}function G4(n){if(ML(n))return gu(void 0,n.useValue);{let e=kS(n);return gu(e,cE)}}function kS(n,e,t){let r;if(Ja(n)){let i=jt(n);return fs(i)||gS(i)}else if(ML(n))r=()=>jt(n.useValue);else if(V4(n))r=()=>n.useFactory(...pS(n.deps||[]));else if(U4(n))r=(i,o)=>H(jt(n.useExisting),o!==void 0&&o&8?8:void 0);else{let i=jt(n&&(n.useClass||n.provide));if(j4(n))r=()=>new i(...pS(n.deps));else return fs(i)||gS(i)}return r}function Qh(n){if(n.destroyed)throw new J(205,!1)}function gu(n,e,t=!1){return{factory:n,value:e,multi:t?[]:void 0}}function j4(n){return!!n.deps}function H4(n){return n!==null&&typeof n=="object"&&typeof n.ngOnDestroy=="function"}function $4(n){return typeof n=="function"||typeof n=="object"&&n.ngMetadataName==="InjectionToken"}function mS(n,e){for(let t of n)Array.isArray(t)?mS(t,e):t&&vS(t)?mS(t.\u0275providers,e):e(t)}function Ni(n,e){let t;n instanceof Za?(Qh(n),t=n):t=new fS(n);let r,i=Di(t),o=Un(void 0);try{return e()}finally{Di(i),Un(o)}}function FS(){return AL()!==void 0||zm()!=null}var Xr=0,pe=1,Te=2,Ht=3,Mr=4,Vn=5,tc=6,_u=7,Dt=8,vo=9,wi=10,ze=11,Tu=12,US=13,nc=14,Rn=15,_s=16,rc=17,bi=18,sf=19,VS=20,To=21,yE=22,So=23,lr=24,ic=25,oc=26,qe=27,PL=1,BS=6,Ts=7,af=8,sc=9,Rt=10;function Oi(n){return Array.isArray(n)&&typeof n[PL]=="object"}function Qr(n){return Array.isArray(n)&&n[PL]===!0}function GS(n){return(n.flags&4)!==0}function Ao(n){return n.componentOffset>-1}function Iu(n){return(n.flags&1)===1}function Jr(n){return!!n.template}function yu(n){return(n[Te]&512)!==0}function ac(n){return(n[Te]&256)===256}var yt=(function(n){return n[n.NONE=0]="NONE",n[n.HTML=1]="HTML",n[n.STYLE=2]="STYLE",n[n.SCRIPT=3]="SCRIPT",n[n.URL=4]="URL",n[n.RESOURCE_URL=5]="RESOURCE_URL",n[n.ATTRIBUTE_NO_BINDING=6]="ATTRIBUTE_NO_BINDING",n})(yt||{}),lE,ef="svg",jS="math";function xL(){return lE||(lE={},hs(yt.HTML,void 0,[["iframe",["srcdoc"]],["*",["innerHTML","outerHTML"]]]),hs(yt.STYLE,void 0,[["*",["style"]]]),hs(yt.URL,void 0,[["*",["formAction"]],["area",["href"]],["a",["href","xlink:href"]],["form",["action"]],["img",["src"]],["video",["src"]]]),hs(yt.URL,jS,[["*",["href","xlink:href"]],["annotation",["href","xlink:href"]],["annotation-xml",["href","xlink:href"]],["maction",["href","xlink:href"]],["malignmark",["href","xlink:href"]],["math",["href","xlink:href"]],["mroot",["href","xlink:href"]],["msqrt",["href","xlink:href"]],["merror",["href","xlink:href"]],["mfrac",["href","xlink:href"]],["mglyph",["href","xlink:href"]],["msub",["href","xlink:href"]],["msup",["href","xlink:href"]],["msubsup",["href","xlink:href"]],["mmultiscripts",["href","xlink:href"]],["mprescripts",["href","xlink:href"]],["mi",["href","xlink:href"]],["mn",["href","xlink:href"]],["mo",["href","xlink:href"]],["mpadded",["href","xlink:href"]],["mphantom",["href","xlink:href"]],["mrow",["href","xlink:href"]],["ms",["href","xlink:href"]],["mspace",["href","xlink:href"]],["mstyle",["href","xlink:href"]],["mtable",["href","xlink:href"]],["mtd",["href","xlink:href"]],["mtr",["href","xlink:href"]],["mtext",["href","xlink:href"]],["mover",["href","xlink:href"]],["munder",["href","xlink:href"]],["munderover",["href","xlink:href"]],["semantics",["href","xlink:href"]],["none",["href","xlink:href"]]]),hs(yt.RESOURCE_URL,void 0,[["base",["href"]],["embed",["src"]],["frame",["src"]],["iframe",["src"]],["link",["href"]],["object",["codebase","data"]]]),hs(yt.URL,ef,[["a",["href","xlink:href"]]]),hs(yt.ATTRIBUTE_NO_BINDING,ef,[["animate",["attributeName","values","to","from"]],["set",["to","attributeName"]],["animateMotion",["attributeName"]],["animateTransform",["attributeName"]]]),hs(yt.ATTRIBUTE_NO_BINDING,void 0,[["unknown",["attributeName","values","to","from","sandbox","allow","allowFullscreen","referrerPolicy","csp","fetchPriority"]],["iframe",["sandbox","allow","allowFullscreen","referrerPolicy","csp","fetchPriority"]]])),lE}function hs(n,e,t){for(let[r,i]of t){let o=e&&r!=="unknown"?`:${e}:${r}`:r;o=o.toLowerCase();for(let s of i)lE[`${o}|${s.toLowerCase()}`]=n}}function kL(n,e,t){let r=xL(),i=n.toLowerCase(),o=e.toLowerCase(),s=t&&i!=="*"&&i!=="unknown"?r[`:${t}:${i}|${o}`]:void 0,a=t?r[`:${t}:*|${o}`]:void 0;return s??a??r[`${i}|${o}`]??r[`*|${o}`]??yt.NONE}function Lr(n){for(;Array.isArray(n);)n=n[Xr];return n}function HS(n,e){return Lr(e[n])}function ur(n,e){return Lr(e[n.index])}function cf(n,e){return n.data[e]}function cc(n,e){return n[e]}function lf(n,e,t,r){t>=n.data.length&&(n.data[t]=null,n.blueprint[t]=null),e[t]=r}function Pr(n,e){let t=e[n];return Oi(t)?t:t[Xr]}function FL(n){return(n[Te]&4)===4}function vE(n){return(n[Te]&128)===128}function UL(n){return Qr(n[Ht])}function dr(n,e){return e==null?null:n[e]}function $S(n){n[rc]=0}function SE(n){n[Te]&1024||(n[Te]|=1024,vE(n)&&Is(n))}function VL(n,e){for(;n>0;)e=e[nc],n--;return e}function vu(n){return!!(n[Te]&9216||n[lr]?.dirty)}function AE(n){n[wi].changeDetectionScheduler?.notify(8),n[Te]&64&&(n[Te]|=1024),vu(n)&&Is(n)}function Is(n){n[wi].changeDetectionScheduler?.notify(0);let e=ps(n);for(;e!==null&&!(e[Te]&8192||(e[Te]|=8192,!vE(e)));)e=ps(e)}function WS(n,e){if(ac(n))throw new J(911,!1);n[To]===null&&(n[To]=[]),n[To].push(e)}function BL(n,e){if(n[To]===null)return;let t=n[To].indexOf(e);t!==-1&&n[To].splice(t,1)}function ps(n){let e=n[Ht];return Qr(e)?e[Ht]:e}function zS(n){return n[_u]??=[]}function qS(n){return n.cleanup??=[]}function GL(n,e,t,r){let i=zS(e);i.push(t),n.firstCreatePass&&qS(n).push(r,i.length-1)}var Se={lFrame:ZL(null),bindingsEnabled:!0,skipHydrationRootTNode:null};var ES=!1;function jL(){return Se.lFrame.elementDepthCount}function HL(){Se.lFrame.elementDepthCount++}function KS(){Se.lFrame.elementDepthCount--}function CE(){return Se.bindingsEnabled}function YS(){return Se.skipHydrationRootTNode!==null}function XS(n){return Se.skipHydrationRootTNode===n}function QS(){Se.skipHydrationRootTNode=null}function ne(){return Se.lFrame.lView}function Ke(){return Se.lFrame.tView}function $L(n){return Se.lFrame.contextLView=n,n[Dt]}function WL(n){return Se.lFrame.contextLView=null,n}function $t(){let n=JS();for(;n!==null&&n.type===64;)n=n.parent;return n}function JS(){return Se.lFrame.currentTNode}function zL(){let n=Se.lFrame,e=n.currentTNode;return n.isParent?e:e.parent}function lc(n,e){let t=Se.lFrame;t.currentTNode=n,t.isParent=e}function ZS(){return Se.lFrame.isParent}function eA(){Se.lFrame.isParent=!1}function tA(){return Se.lFrame.contextLView}function nA(){return ES}function Su(n){let e=ES;return ES=n,e}function Bn(){let n=Se.lFrame,e=n.bindingRootIndex;return e===-1&&(e=n.bindingRootIndex=n.tView.bindingStartIndex),e}function rA(){return Se.lFrame.bindingIndex}function qL(n){return Se.lFrame.bindingIndex=n}function Mi(){return Se.lFrame.bindingIndex++}function uf(n){let e=Se.lFrame,t=e.bindingIndex;return e.bindingIndex=e.bindingIndex+n,t}function KL(){return Se.lFrame.inI18n}function YL(n,e){let t=Se.lFrame;t.bindingIndex=t.bindingRootIndex=n,DE(e)}function XL(){return Se.lFrame.currentDirectiveIndex}function DE(n){Se.lFrame.currentDirectiveIndex=n}function QL(n){let e=Se.lFrame.currentDirectiveIndex;return e===-1?null:n[e]}function RE(){return Se.lFrame.currentQueryIndex}function df(n){Se.lFrame.currentQueryIndex=n}function W4(n){let e=n[pe];return e.type===2?e.declTNode:e.type===1?n[Vn]:null}function iA(n,e,t){if(t&4){let i=e,o=n;for(;i=i.parent,i===null&&!(t&1);)if(i=W4(o),i===null||(o=o[nc],i.type&10))break;if(i===null)return!1;e=i,n=o}let r=Se.lFrame=JL();return r.currentTNode=e,r.lView=n,!0}function NE(n){let e=JL(),t=n[pe];Se.lFrame=e,e.currentTNode=t.firstChild,e.lView=n,e.tView=t,e.contextLView=n,e.bindingIndex=t.bindingStartIndex,e.inI18n=!1}function JL(){let n=Se.lFrame,e=n===null?null:n.child;return e===null?ZL(n):e}function ZL(n){let e={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:n,child:null,inI18n:!1};return n!==null&&(n.child=e),e}function eP(){let n=Se.lFrame;return Se.lFrame=n.parent,n.currentTNode=null,n.lView=null,n}var oA=eP;function wE(){let n=eP();n.isParent=!0,n.tView=null,n.selectedIndex=-1,n.contextLView=null,n.elementDepthCount=0,n.currentDirectiveIndex=-1,n.currentNamespace=null,n.bindingRootIndex=-1,n.bindingIndex=-1,n.currentQueryIndex=0}function tP(n){return(Se.lFrame.contextLView=VL(n,Se.lFrame.contextLView))[Dt]}function hr(){return Se.lFrame.selectedIndex}function ys(n){Se.lFrame.selectedIndex=n}function uc(){let n=Se.lFrame;return cf(n.tView,n.selectedIndex)}function nP(){Se.lFrame.currentNamespace=ef}function rP(){z4()}function z4(){Se.lFrame.currentNamespace=null}function sA(){return Se.lFrame.currentNamespace}var iP=!0;function bE(){return iP}function hf(n){iP=n}function _S(n,e=null,t=null,r){let i=aA(n,e,t,r);return i.resolveInjectorInitializers(),i}function aA(n,e=null,t=null,r,i=new Set){let o=[t||Cn,bL(n)];return r=r||(typeof n=="object"?void 0:Io(n)),new Za(o,e||Eu(),r||null,i)}var We=class n{static THROW_IF_NOT_FOUND=Ya;static NULL=new Zh;static create(e,t){if(Array.isArray(e))return _S({name:""},t,e,"");{let r=e.name??"";return _S({name:r},e.parent,e.providers,r)}}static \u0275prov=Q({token:n,providedIn:"any",factory:()=>H(OS)});static __NG_ELEMENT_ID__=-1},rn=new z(""),Gn=(()=>{class n{static __NG_ELEMENT_ID__=q4;static __NG_ENV_ID__=t=>t}return n})(),tf=class extends Gn{_lView;constructor(e){super(),this._lView=e}get destroyed(){return ac(this._lView)}onDestroy(e){let t=this._lView;return WS(t,e),()=>BL(t,e)}};function q4(){return new tf(ne())}var ar=class{_console=console;handleError(e){this._console.error("ERROR",e)}},Li=new z("",{providedIn:"root",factory:()=>{let n=Y(Dn),e;return t=>{n.destroyed&&!e?setTimeout(()=>{throw t}):(e??=n.get(ar),e.handleError(t))}}}),oP={provide:ms,useValue:()=>{Y(ar)},multi:!0};function Pi(n){return typeof n=="function"&&n[nn]!==void 0}function dc(n,e){let[t,r,i]=iS(n,e?.equal),o=t,s=o[nn];return o.set=r,o.update=i,o.asReadonly=cA.bind(o),o}function cA(){let n=this[nn];if(n.readonlyFn===void 0){let e=()=>this();e[nn]=n,n.readonlyFn=e}return n.readonlyFn}function lA(n){return Pi(n)&&typeof n.set=="function"}var Au=(()=>{class n{view;node;constructor(t,r){this.view=t,this.node=r}static __NG_ELEMENT_ID__=K4}return n})();function K4(){return new Au(ne(),$t())}var Or=class{},Cu=new z("",{providedIn:"root",factory:()=>!1});var uA=new z(""),OE=new z(""),vs=(()=>{class n{taskId=0;pendingTasks=new Set;destroyed=!1;pendingTask=new ie(!1);get hasPendingTasks(){return this.destroyed?!1:this.pendingTask.value}get hasPendingTasksObservable(){return this.destroyed?new fe(t=>{t.next(!1),t.complete()}):this.pendingTask}add(){!this.hasPendingTasks&&!this.destroyed&&this.pendingTask.next(!0);let t=this.taskId++;return this.pendingTasks.add(t),t}has(t){return this.pendingTasks.has(t)}remove(t){this.pendingTasks.delete(t),this.pendingTasks.size===0&&this.hasPendingTasks&&this.pendingTask.next(!1)}ngOnDestroy(){this.pendingTasks.clear(),this.hasPendingTasks&&this.pendingTask.next(!1),this.destroyed=!0,this.pendingTask.unsubscribe()}static \u0275prov=Q({token:n,providedIn:"root",factory:()=>new n})}return n})(),xi=(()=>{class n{internalPendingTasks=Y(vs);scheduler=Y(Or);errorHandler=Y(Li);add(){let t=this.internalPendingTasks.add();return()=>{this.internalPendingTasks.has(t)&&(this.scheduler.notify(11),this.internalPendingTasks.remove(t))}}run(t){let r=this.add();t().catch(this.errorHandler).finally(r)}static \u0275prov=Q({token:n,providedIn:"root",factory:()=>new n})}return n})();function hc(...n){}var ff=(()=>{class n{static \u0275prov=Q({token:n,providedIn:"root",factory:()=>new TS})}return n})(),TS=class{dirtyEffectCount=0;queues=new Map;add(e){this.enqueue(e),this.schedule(e)}schedule(e){e.dirty&&this.dirtyEffectCount++}remove(e){let t=e.zone,r=this.queues.get(t);r.has(e)&&(r.delete(e),e.dirty&&this.dirtyEffectCount--)}enqueue(e){let t=e.zone;this.queues.has(t)||this.queues.set(t,new Set);let r=this.queues.get(t);r.has(e)||r.add(e)}flush(){for(;this.dirtyEffectCount>0;){let e=!1;for(let[t,r]of this.queues)t===null?e||=this.flushQueue(r):e||=t.run(()=>this.flushQueue(r));e||(this.dirtyEffectCount=0)}}flushQueue(e){let t=!1;for(let r of e)r.dirty&&(this.dirtyEffectCount--,t=!0,r.run());return t}};function Vu(n){return{toString:n}.toString()}var ME="__parameters__";function tz(n){return function(...t){if(n){let r=n(...t);for(let i in r)this[i]=r[i]}}}function jP(n,e,t){return Vu(()=>{let r=tz(e);function i(...o){if(this instanceof i)return r.apply(this,o),this;let s=new i(...o);return a.annotation=s,a;function a(c,l,d){let h=c.hasOwnProperty(ME)?c[ME]:Object.defineProperty(c,ME,{value:[]})[ME];for(;h.length<=d;)h.push(null);return(h[d]=h[d]||[]).push(s),c}}return i.prototype.ngMetadataName=n,i.annotationCls=i,i})}var nz=wS(jP("Inject",n=>({token:n})),-1),zt=wS(jP("Optional"),8);function HP(n){let e=Lt.ng;if(e&&e.\u0275compilerFacade)return e.\u0275compilerFacade;throw new Error("JIT compiler unavailable")}function rz(n){return typeof n=="function"}var $E=class{previousValue;currentValue;firstChange;constructor(e,t,r){this.previousValue=e,this.currentValue=t,this.firstChange=r}isFirstChange(){return this.firstChange}};function $P(n,e,t,r){e!==null?e.applyValueToInputSignal(e,r):n[t]=r}var aC=(()=>{let n=()=>WP;return n.ngInherit=!0,n})();function WP(n){return n.type.prototype.ngOnChanges&&(n.setInput=oz),iz}function iz(){let n=qP(this),e=n?.current;if(e){let t=n.previous;if(t===Yr)n.previous=e;else for(let r in e)t[r]=e[r];n.current=null,this.ngOnChanges(e)}}function oz(n,e,t,r,i){let o=this.declaredInputs[r],s=qP(n)||sz(n,{previous:Yr,current:null}),a=s.current||(s.current={}),c=s.previous,l=c[o];a[o]=new $E(l&&l.currentValue,t,c===Yr),$P(n,e,i,t)}var zP="__ngSimpleChanges__";function qP(n){return n[zP]||null}function sz(n,e){return n[zP]=e}var sP=[];var it=function(n,e=null,t){for(let r=0;r<sP.length;r++){let i=sP[r];i(n,e,t)}};function az(n,e,t){let{ngOnChanges:r,ngOnInit:i,ngDoCheck:o}=e.type.prototype;if(r){let s=WP(e);(t.preOrderHooks??=[]).push(n,s),(t.preOrderCheckHooks??=[]).push(n,s)}i&&(t.preOrderHooks??=[]).push(0-n,i),o&&((t.preOrderHooks??=[]).push(n,o),(t.preOrderCheckHooks??=[]).push(n,o))}function KP(n,e){for(let t=e.directiveStart,r=e.directiveEnd;t<r;t++){let o=n.data[t].type.prototype,{ngAfterContentInit:s,ngAfterContentChecked:a,ngAfterViewInit:c,ngAfterViewChecked:l,ngOnDestroy:d}=o;s&&(n.contentHooks??=[]).push(-t,s),a&&((n.contentHooks??=[]).push(t,a),(n.contentCheckHooks??=[]).push(t,a)),c&&(n.viewHooks??=[]).push(-t,c),l&&((n.viewHooks??=[]).push(t,l),(n.viewCheckHooks??=[]).push(t,l)),d!=null&&(n.destroyHooks??=[]).push(t,d)}}function VE(n,e,t){YP(n,e,3,t)}function BE(n,e,t,r){(n[Te]&3)===t&&YP(n,e,t,r)}function dA(n,e){let t=n[Te];(t&3)===e&&(t&=16383,t+=1,n[Te]=t)}function YP(n,e,t,r){let i=r!==void 0?n[rc]&65535:0,o=r??-1,s=e.length-1,a=0;for(let c=i;c<s;c++)if(typeof e[c+1]=="number"){if(a=e[c],r!=null&&a>=r)break}else e[c]<0&&(n[rc]+=65536),(a<o||o==-1)&&(cz(n,t,e,c),n[rc]=(n[rc]&4294901760)+c+2),c++}function aP(n,e){it(4,n,e);let t=_e(null);try{e.call(n)}finally{_e(t),it(5,n,e)}}function cz(n,e,t,r){let i=t[r]<0,o=t[r+1],s=i?-t[r]:t[r],a=n[s];i?n[Te]>>14<n[rc]>>16&&(n[Te]&3)===e&&(n[Te]+=16384,aP(a,o)):aP(a,o)}var Ru=-1,pc=class{factory;name;injectImpl;resolving=!1;canSeeViewProviders;multi;componentProviders;index;providerFactory;constructor(e,t,r,i){this.factory=e,this.name=i,this.canSeeViewProviders=t,this.injectImpl=r}};function lz(n){return(n.flags&8)!==0}function uz(n){return(n.flags&16)!==0}function dz(n,e,t){let r=0;for(;r<t.length;){let i=t[r];if(typeof i=="number"){if(i!==0)break;r++;let o=t[r++],s=t[r++],a=t[r++];n.setAttribute(e,s,a,o)}else{let o=i,s=t[++r];fz(o)?n.setProperty(e,o,s):n.setAttribute(e,o,s),r++}}return r}function hz(n){return n===3||n===4||n===6}function fz(n){return n.charCodeAt(0)===64}function Nu(n,e){if(!(e===null||e.length===0))if(n===null||n.length===0)n=e.slice();else{let t=-1;for(let r=0;r<e.length;r++){let i=e[r];typeof i=="number"?t=i:t===0||(t===-1||t===2?cP(n,t,i,null,e[++r]):cP(n,t,i,null,null))}}return n}function cP(n,e,t,r,i){let o=0,s=n.length;if(e===-1)s=-1;else for(;o<n.length;){let a=n[o++];if(typeof a=="number"){if(a===e){s=-1;break}else if(a>e){s=o-1;break}}}for(;o<n.length;){let a=n[o];if(typeof a=="number")break;if(a===t){i!==null&&(n[o+1]=i);return}o++,i!==null&&o++}s!==-1&&(n.splice(s,0,e),o=s+1),n.splice(o++,0,t),i!==null&&n.splice(o++,0,i)}function XP(n){return n!==Ru}function WE(n){return n&32767}function pz(n){return n>>16}function zE(n,e){let t=pz(n),r=e;for(;t>0;)r=r[nc],t--;return r}var vA=!0;function qE(n){let e=vA;return vA=n,e}var gz=256,QP=gz-1,JP=5,mz=0,ki={};function Ez(n,e,t){let r;typeof t=="string"?r=t.charCodeAt(0)||0:t.hasOwnProperty(ec)&&(r=t[ec]),r==null&&(r=t[ec]=mz++);let i=r&QP,o=1<<i;e.data[n+(i>>JP)]|=o}function KE(n,e){let t=ZP(n,e);if(t!==-1)return t;let r=e[pe];r.firstCreatePass&&(n.injectorIndex=e.length,hA(r.data,n),hA(e,null),hA(r.blueprint,null));let i=cC(n,e),o=n.injectorIndex;if(XP(i)){let s=WE(i),a=zE(i,e),c=a[pe].data;for(let l=0;l<8;l++)e[o+l]=a[s+l]|c[s+l]}return e[o+8]=i,o}function hA(n,e){n.push(0,0,0,0,0,0,0,0,e)}function ZP(n,e){return n.injectorIndex===-1||n.parent&&n.parent.injectorIndex===n.injectorIndex||e[n.injectorIndex+8]===null?-1:n.injectorIndex}function cC(n,e){if(n.parent&&n.parent.injectorIndex!==-1)return n.parent.injectorIndex;let t=0,r=null,i=e;for(;i!==null;){if(r=ix(i),r===null)return Ru;if(t++,i=i[nc],r.injectorIndex!==-1)return r.injectorIndex|t<<16}return Ru}function SA(n,e,t){Ez(n,e,t)}function ex(n,e,t){if(t&8||n!==void 0)return n;EE(e,"NodeInjector")}function tx(n,e,t,r){if(t&8&&r===void 0&&(r=null),(t&3)===0){let i=n[vo],o=Un(void 0);try{return i?i.get(e,r,t&8):NS(e,r,t&8)}finally{Un(o)}}return ex(r,e,t)}function nx(n,e,t,r=0,i){if(n!==null){if(e[Te]&2048&&!(r&2)){let s=vz(n,e,t,r,ki);if(s!==ki)return s}let o=rx(n,e,t,r,ki);if(o!==ki)return o}return tx(e,t,r,i)}function rx(n,e,t,r,i){let o=Tz(t);if(typeof o=="function"){if(!iA(e,n,r))return r&1?ex(i,t,r):tx(e,t,r,i);try{let s;if(s=o(r),s==null&&!(r&8))EE(t);else return s}finally{oA()}}else if(typeof o=="number"){let s=null,a=ZP(n,e),c=Ru,l=r&1?e[Rn][Vn]:null;for((a===-1||r&4)&&(c=a===-1?cC(n,e):e[a+8],c===Ru||!uP(r,!1)?a=-1:(s=e[pe],a=WE(c),e=zE(c,e)));a!==-1;){let d=e[pe];if(lP(o,a,d.data)){let h=_z(a,e,t,s,r,l);if(h!==ki)return h}c=e[a+8],c!==Ru&&uP(r,e[pe].data[a+8]===l)&&lP(o,a,e)?(s=d,a=WE(c),e=zE(c,e)):a=-1}}return i}function _z(n,e,t,r,i,o){let s=e[pe],a=s.data[n+8],c=r==null?Ao(a)&&vA:r!=s&&(a.type&3)!==0,l=i&1&&o===a,d=GE(a,s,t,c,l);return d!==null?mf(e,s,d,a,i):ki}function GE(n,e,t,r,i){let o=n.providerIndexes,s=e.data,a=o&1048575,c=n.directiveStart,l=n.directiveEnd,d=o>>20,h=r?a:a+d,f=i?a+d:l;for(let g=h;g<f;g++){let E=s[g];if(g<c&&t===E||g>=c&&E.type===t)return g}if(i){let g=s[c];if(g&&Jr(g)&&g.type===t)return c}return null}function mf(n,e,t,r,i){let o=n[t],s=e.data;if(o instanceof pc){let a=o;if(a.resolving){let g=yL(s[t]);throw RS(g)}let c=qE(a.canSeeViewProviders);a.resolving=!0;let l=s[t].type||s[t],d,h=a.injectImpl?Un(a.injectImpl):null,f=iA(n,r,0);try{o=n[t]=a.factory(void 0,i,s,n,r),e.firstCreatePass&&t>=r.directiveStart&&az(t,s[t],e)}finally{h!==null&&Un(h),qE(c),a.resolving=!1,oA()}}return o}function Tz(n){if(typeof n=="string")return n.charCodeAt(0)||0;let e=n.hasOwnProperty(ec)?n[ec]:void 0;return typeof e=="number"?e>=0?e&QP:Iz:e}function lP(n,e,t){let r=1<<n;return!!(t[e+(n>>JP)]&r)}function uP(n,e){return!(n&2)&&!(n&1&&e)}var fc=class{_tNode;_lView;constructor(e,t){this._tNode=e,this._lView=t}get(e,t,r){return nx(this._tNode,this._lView,e,Qa(r),t)}};function Iz(){return new fc($t(),ne())}function yz(n){return Vu(()=>{let e=n.prototype.constructor,t=e[Jh]||AA(e),r=Object.prototype,i=Object.getPrototypeOf(n.prototype).constructor;for(;i&&i!==r;){let o=i[Jh]||AA(i);if(o&&o!==t)return o;i=Object.getPrototypeOf(i)}return o=>new o})}function AA(n){return yS(n)?()=>{let e=AA(jt(n));return e&&e()}:fs(n)}function vz(n,e,t,r,i){let o=n,s=e;for(;o!==null&&s!==null&&s[Te]&2048&&!yu(s);){let a=rx(o,s,t,r|2,ki);if(a!==ki)return a;let c=o.parent;if(!c){let l=s[VS];if(l){let d=l.get(t,ki,r);if(d!==ki)return d}c=ix(s),s=s[nc]}o=c}return i}function ix(n){let e=n[pe],t=e.type;return t===2?e.declTNode:t===1?n[Vn]:null}function Sz(){return Bu($t(),ne())}function Bu(n,e){return new As(ur(n,e))}var As=(()=>{class n{nativeElement;constructor(t){this.nativeElement=t}static __NG_ELEMENT_ID__=Sz}return n})();function ox(n){return n instanceof As?n.nativeElement:n}function Az(){return this._results[Symbol.iterator]()}var YE=class{_emitDistinctChangesOnly;dirty=!0;_onDirty=void 0;_results=[];_changesDetected=!1;_changes=void 0;length=0;first=void 0;last=void 0;get changes(){return this._changes??=new Ct}constructor(e=!1){this._emitDistinctChangesOnly=e}get(e){return this._results[e]}map(e){return this._results.map(e)}filter(e){return this._results.filter(e)}find(e){return this._results.find(e)}reduce(e,t){return this._results.reduce(e,t)}forEach(e){this._results.forEach(e)}some(e){return this._results.some(e)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(e,t){this.dirty=!1;let r=DL(e);(this._changesDetected=!CL(this._results,r,t))&&(this._results=r,this.length=r.length,this.last=r[this.length-1],this.first=r[0])}notifyOnChanges(){this._changes!==void 0&&(this._changesDetected||!this._emitDistinctChangesOnly)&&this._changes.next(this)}onDirty(e){this._onDirty=e}setDirty(){this.dirty=!0,this._onDirty?.()}destroy(){this._changes!==void 0&&(this._changes.complete(),this._changes.unsubscribe())}[Symbol.iterator]=Az};function sx(n){return(n.flags&128)===128}var lC=(function(n){return n[n.OnPush=0]="OnPush",n[n.Default=1]="Default",n})(lC||{}),ax=new Map,Cz=0;function Dz(){return Cz++}function Rz(n){ax.set(n[sf],n)}function CA(n){ax.delete(n[sf])}var dP="__ngContext__";function wu(n,e){Oi(e)?(n[dP]=e[sf],Rz(e)):n[dP]=e}function cx(n){return ux(n[Tu])}function lx(n){return ux(n[Mr])}function ux(n){for(;n!==null&&!Qr(n);)n=n[Mr];return n}var DA;function uC(n){DA=n}function dC(){if(DA!==void 0)return DA;if(typeof document<"u")return document;throw new J(210,!1)}var d_=new z("",{providedIn:"root",factory:()=>Nz}),Nz="ng",h_=new z(""),wo=new z("",{providedIn:"platform",factory:()=>"unknown"});var wz=new z(""),Gu=new z("",{providedIn:"root",factory:()=>dC().body?.querySelector("[ngCspNonce]")?.getAttribute("ngCspNonce")||null});var bz="h",Oz="b";var dx="r";var hx="di";var fx=!1,px=new z("",{providedIn:"root",factory:()=>fx});var Mz=(n,e,t,r)=>{};function Lz(n,e,t,r){Mz(n,e,t,r)}function f_(n){return(n.flags&32)===32}var Pz=()=>null;function gx(n,e,t=!1){return Pz(n,e,t)}function mx(n,e){let t=n.contentQueries;if(t!==null){let r=_e(null);try{for(let i=0;i<t.length;i+=2){let o=t[i],s=t[i+1];if(s!==-1){let a=n.data[s];df(o),a.contentQueries(2,e[s],s)}}}finally{_e(r)}}}function RA(n,e,t){df(0);let r=_e(null);try{e(n,t)}finally{_e(r)}}function hC(n,e,t){if(GS(e)){let r=_e(null);try{let i=e.directiveStart,o=e.directiveEnd;for(let s=i;s<o;s++){let a=n.data[s];if(a.contentQueries){let c=t[s];a.contentQueries(1,c,s)}}}finally{_e(r)}}}var Do=(function(n){return n[n.Emulated=0]="Emulated",n[n.None=2]="None",n[n.ShadowDom=3]="ShadowDom",n})(Do||{});var xz="svg",kz="math",Fz={"http://www.w3.org/2000/svg":xz,"http://www.w3.org/1998/Math/MathML":kz},LE;function Uz(){if(LE===void 0&&(LE=null,Lt.trustedTypes))try{LE=Lt.trustedTypes.createPolicy("angular",{createHTML:n=>n,createScript:n=>n,createScriptURL:n=>n})}catch{}return LE}function p_(n){return Uz()?.createHTML(n)||n}var PE;function Vz(){if(PE===void 0&&(PE=null,Lt.trustedTypes))try{PE=Lt.trustedTypes.createPolicy("angular#unsafe-bypass",{createHTML:n=>n,createScript:n=>n,createScriptURL:n=>n})}catch{}return PE}function hP(n){return Vz()?.createHTML(n)||n}var Ro=class{changingThisBreaksApplicationSecurity;constructor(e){this.changingThisBreaksApplicationSecurity=e}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see ${hE})`}},NA=class extends Ro{getTypeName(){return"HTML"}},wA=class extends Ro{getTypeName(){return"Style"}},bA=class extends Ro{getTypeName(){return"Script"}},OA=class extends Ro{getTypeName(){return"URL"}},MA=class extends Ro{getTypeName(){return"ResourceURL"}};function fr(n){return n instanceof Ro?n.changingThisBreaksApplicationSecurity:n}function Ui(n,e){let t=Ex(n);if(t!=null&&t!==e){if(t==="ResourceURL"&&e==="URL")return!0;throw new Error(`Required a safe ${e}, got a ${t} (see ${hE})`)}return t===e}function Ex(n){return n instanceof Ro&&n.getTypeName()||null}function fC(n){return new NA(n)}function pC(n){return new wA(n)}function gC(n){return new bA(n)}function mC(n){return new OA(n)}function EC(n){return new MA(n)}function Bz(n){let e=new PA(n);return Gz()?new LA(e):e}var LA=class{inertDocumentHelper;constructor(e){this.inertDocumentHelper=e}getInertBodyElement(e){e="<body><remove></remove>"+e;try{let t=new window.DOMParser().parseFromString(p_(e),"text/html").body;return t===null?this.inertDocumentHelper.getInertBodyElement(e):(t.firstChild?.remove(),t)}catch{return null}}},PA=class{defaultDoc;inertDocument;constructor(e){this.defaultDoc=e,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert")}getInertBodyElement(e){let t=this.inertDocument.createElement("template");return t.innerHTML=p_(e),t}};function Gz(){try{return!!new window.DOMParser().parseFromString(p_(""),"text/html")}catch{return!1}}var jz=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:\/?#]*(?:[\/?#]|$))/i;function If(n){return n=String(n),n.match(jz)?n:"unsafe:"+n}function bo(n){let e={};for(let t of n.split(","))e[t]=!0;return e}function yf(...n){let e={};for(let t of n)for(let r in t)t.hasOwnProperty(r)&&(e[r]=!0);return e}var _x=bo("area,br,col,hr,img,wbr"),Tx=bo("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),Ix=bo("rp,rt"),Hz=yf(Ix,Tx),$z=yf(Tx,bo("address,article,aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul")),Wz=yf(Ix,bo("a,abbr,acronym,audio,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video")),fP=yf(_x,$z,Wz,Hz),yx=bo("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),zz=bo("abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,scope,scrolling,shape,size,sizes,span,srclang,srcset,start,summary,tabindex,target,title,translate,type,usemap,valign,value,vspace,width"),qz=bo("aria-activedescendant,aria-atomic,aria-autocomplete,aria-busy,aria-checked,aria-colcount,aria-colindex,aria-colspan,aria-controls,aria-current,aria-describedby,aria-details,aria-disabled,aria-dropeffect,aria-errormessage,aria-expanded,aria-flowto,aria-grabbed,aria-haspopup,aria-hidden,aria-invalid,aria-keyshortcuts,aria-label,aria-labelledby,aria-level,aria-live,aria-modal,aria-multiline,aria-multiselectable,aria-orientation,aria-owns,aria-placeholder,aria-posinset,aria-pressed,aria-readonly,aria-relevant,aria-required,aria-roledescription,aria-rowcount,aria-rowindex,aria-rowspan,aria-selected,aria-setsize,aria-sort,aria-valuemax,aria-valuemin,aria-valuenow,aria-valuetext"),Kz=yf(yx,zz,qz),Yz=bo("script,style,template"),xA=class{sanitizedSomething=!1;buf=[];sanitizeChildren(e){let t=e.firstChild,r=!0,i=[];for(;t;){if(t.nodeType===Node.ELEMENT_NODE?r=this.startElement(t):t.nodeType===Node.TEXT_NODE?this.chars(t.nodeValue):this.sanitizedSomething=!0,r&&t.firstChild){i.push(t),t=Jz(t);continue}for(;t;){t.nodeType===Node.ELEMENT_NODE&&this.endElement(t);let o=Qz(t);if(o){t=o;break}t=i.pop()}}return this.buf.join("")}startElement(e){let t=pP(e).toLowerCase();if(!fP.hasOwnProperty(t))return this.sanitizedSomething=!0,!Yz.hasOwnProperty(t);this.buf.push("<"),this.buf.push(t);let r=e.attributes;for(let i=0;i<r.length;i++){let o=r.item(i),s=o.name,a=s.toLowerCase();if(!Kz.hasOwnProperty(a)){this.sanitizedSomething=!0;continue}let c=o.value;yx[a]&&(c=If(c)),this.buf.push(" ",s,'="',gP(c),'"')}return this.buf.push(">"),!0}endElement(e){let t=pP(e).toLowerCase();fP.hasOwnProperty(t)&&!_x.hasOwnProperty(t)&&(this.buf.push("</"),this.buf.push(t),this.buf.push(">"))}chars(e){this.buf.push(gP(e))}};function Xz(n,e){return(n.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY)!==Node.DOCUMENT_POSITION_CONTAINED_BY}function Qz(n){let e=n.nextSibling;if(e&&n!==e.previousSibling)throw vx(e);return e}function Jz(n){let e=n.firstChild;if(e&&Xz(n,e))throw vx(e);return e}function pP(n){let e=n.nodeName;return typeof e=="string"?e:"FORM"}function vx(n){return new Error(`Failed to sanitize html because the element is clobbered: ${n.outerHTML}`)}var Zz=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,e8=/([^\#-~ |!])/g;function gP(n){return n.replace(/&/g,"&").replace(Zz,function(e){let t=e.charCodeAt(0),r=e.charCodeAt(1);return"&#"+((t-55296)*1024+(r-56320)+65536)+";"}).replace(e8,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(/</g,"<").replace(/>/g,">")}var xE;function g_(n,e){let t=null;try{xE=xE||Bz(n);let r=e?String(e):"";t=xE.getInertBodyElement(r);let i=5,o=r;do{if(i===0)throw new Error("Failed to sanitize html because the input is unstable");i--,r=o,o=t.innerHTML,t=xE.getInertBodyElement(r)}while(r!==o);let a=new xA().sanitizeChildren(mP(t)||t);return p_(a)}finally{if(t){let r=mP(t)||t;for(;r.firstChild;)r.firstChild.remove()}}}function mP(n){return"content"in n&&t8(n)?n.content:null}function t8(n){return n.nodeType===Node.ELEMENT_NODE&&n.nodeName==="TEMPLATE"}var n8=/^>|^->|<!--|-->|--!>|<!-$/g,r8=/(<|>)/g,i8="\u200B$1\u200B";function o8(n){return n.replace(n8,e=>e.replace(r8,i8))}function s8(n,e){return n.createText(e)}function a8(n,e,t){n.setValue(e,t)}function c8(n,e){return n.createComment(o8(e))}function Sx(n,e,t){return n.createElement(e,t)}function XE(n,e,t,r,i){n.insertBefore(e,t,r,i)}function Ax(n,e,t){n.appendChild(e,t)}function EP(n,e,t,r,i){r!==null?XE(n,e,t,r,i):Ax(n,e,t)}function Cx(n,e,t,r){n.removeChild(null,e,t,r)}function l8(n,e,t){n.setAttribute(e,"style",t)}function u8(n,e,t){t===""?n.removeAttribute(e,"class"):n.setAttribute(e,"class",t)}function Dx(n,e,t){let{mergedAttrs:r,classes:i,styles:o}=t;r!==null&&dz(n,e,r),i!==null&&u8(n,e,i),o!==null&&l8(n,e,o)}function d8(n,e=!0){if(n[0]!=":")return[null,n];let t=n.indexOf(":",1);if(t===-1){if(e)throw new Error(`Unsupported format "${n}" expecting ":namespace:name"`);return[null,n]}return[n.slice(1,t),n.slice(t+1)]}function h8(n,e,t){if(e!==void 0&&t!==void 0&&g8(e,t)!==yt.HTML)return n;let r=_C();return r?hP(r.sanitize(yt.HTML,n)||""):Ui(n,"HTML")?hP(fr(n)):g_(dC(),cr(n))}function f8(n){let e=_C();return e?e.sanitize(yt.STYLE,n)||"":Ui(n,"Style")?fr(n):cr(n)}function p8(n){let e=_C();return e?e.sanitize(yt.URL,n)||"":Ui(n,"URL")?fr(n):If(cr(n))}function _C(){let n=ne();return n&&n[wi].sanitizer}function g8(n,e){let[t,r]=m8(n);return kL(r,e,t)}function m8(n){n=n.toLowerCase();let e=d8(n,!1);if(e[0])return e;let r=hr()===-1?null:uc(),i=r?.namespace;if(n==="#host"&&r?.type===2){let o=ur(r,ne());if(o.tagName&&(n=o.tagName.toLowerCase()),i==null){let s=o.namespaceURI;i=s&&Fz[s]}}return[i,n]}function E8(n){return n.ownerDocument.defaultView}function _8(n){return n.ownerDocument}function T8(n){return n instanceof Function?n():n}function I8(n,e,t){let r=n.length;for(;;){let i=n.indexOf(e,t);if(i===-1)return i;if(i===0||n.charCodeAt(i-1)<=32){let o=e.length;if(i+o===r||n.charCodeAt(i+o)<=32)return i}t=i+1}}var Rx="ng-template";function y8(n,e,t,r){let i=0;if(r){for(;i<e.length&&typeof e[i]=="string";i+=2)if(e[i]==="class"&&I8(e[i+1].toLowerCase(),t,0)!==-1)return!0}else if(TC(n))return!1;if(i=e.indexOf(1,i),i>-1){let o;for(;++i<e.length&&typeof(o=e[i])=="string";)if(o.toLowerCase()===t)return!0}return!1}function TC(n){return n.type===4&&n.value!==Rx}function v8(n,e,t){let r=n.type===4&&!t?Rx:n.value;return e===r}function S8(n,e,t){let r=4,i=n.attrs,o=i!==null?D8(i):0,s=!1;for(let a=0;a<e.length;a++){let c=e[a];if(typeof c=="number"){if(!s&&!Zr(r)&&!Zr(c))return!1;if(s&&Zr(c))continue;s=!1,r=c|r&1;continue}if(!s)if(r&4){if(r=2|r&1,c!==""&&!v8(n,c,t)||c===""&&e.length===1){if(Zr(r))return!1;s=!0}}else if(r&8){if(i===null||!y8(n,i,c,t)){if(Zr(r))return!1;s=!0}}else{let l=e[++a],d=A8(c,i,TC(n),t);if(d===-1){if(Zr(r))return!1;s=!0;continue}if(l!==""){let h;if(d>o?h="":h=i[d+1].toLowerCase(),r&2&&l!==h){if(Zr(r))return!1;s=!0}}}}return Zr(r)||s}function Zr(n){return(n&1)===0}function A8(n,e,t,r){if(e===null)return-1;let i=0;if(r||!t){let o=!1;for(;i<e.length;){let s=e[i];if(s===n)return i;if(s===3||s===6)o=!0;else if(s===1||s===2){let a=e[++i];for(;typeof a=="string";)a=e[++i];continue}else{if(s===4)break;if(s===0){i+=4;continue}}i+=o?1:2}return-1}else return R8(e,n)}function Nx(n,e,t=!1){for(let r=0;r<e.length;r++)if(S8(n,e[r],t))return!0;return!1}function C8(n){let e=n.attrs;if(e!=null){let t=e.indexOf(5);if((t&1)===0)return e[t+1]}return null}function D8(n){for(let e=0;e<n.length;e++){let t=n[e];if(hz(t))return e}return n.length}function R8(n,e){let t=n.indexOf(4);if(t>-1)for(t++;t<n.length;){let r=n[t];if(typeof r=="number")return-1;if(r===e)return t;t++}return-1}function N8(n,e){e:for(let t=0;t<e.length;t++){let r=e[t];if(n.length===r.length){for(let i=0;i<n.length;i++)if(n[i]!==r[i])continue e;return!0}}return!1}function _P(n,e){return n?":not("+e.trim()+")":e}function w8(n){let e=n[0],t=1,r=2,i="",o=!1;for(;t<n.length;){let s=n[t];if(typeof s=="string")if(r&2){let a=n[++t];i+="["+s+(a.length>0?'="'+a+'"':"")+"]"}else r&8?i+="."+s:r&4&&(i+=" "+s);else i!==""&&!Zr(s)&&(e+=_P(o,i),i=""),r=s,o=o||!Zr(r);t++}return i!==""&&(e+=_P(o,i)),e}function b8(n){return n.map(w8).join(",")}function O8(n){let e=[],t=[],r=1,i=2;for(;r<n.length;){let o=n[r];if(typeof o=="string")i===2?o!==""&&e.push(o,n[++r]):i===8&&t.push(o);else{if(!Zr(i))break;i=o}r++}return t.length&&e.push(1,...t),e}var on={};function IC(n,e,t,r,i,o,s,a,c,l,d){let h=qe+r,f=h+i,g=M8(h,f),E=typeof l=="function"?l():l;return g[pe]={type:n,blueprint:g,template:t,queries:null,viewQuery:a,declTNode:e,data:g.slice().fill(null,h),bindingStartIndex:h,expandoStartIndex:f,hostBindingOpCodes:null,firstCreatePass:!0,firstUpdatePass:!0,staticViewQueries:!1,staticContentQueries:!1,preOrderHooks:null,preOrderCheckHooks:null,contentHooks:null,contentCheckHooks:null,viewHooks:null,viewCheckHooks:null,destroyHooks:null,cleanup:null,contentQueries:null,components:null,directiveRegistry:typeof o=="function"?o():o,pipeRegistry:typeof s=="function"?s():s,firstChild:null,schemas:c,consts:E,incompleteFirstPass:!1,ssrId:d}}function M8(n,e){let t=[];for(let r=0;r<e;r++)t.push(r<n?null:on);return t}function L8(n){let e=n.tView;return e===null||e.incompleteFirstPass?n.tView=IC(1,null,n.template,n.decls,n.vars,n.directiveDefs,n.pipeDefs,n.viewQuery,n.schemas,n.consts,n.id):e}function yC(n,e,t,r,i,o,s,a,c,l,d){let h=e.blueprint.slice();return h[Xr]=i,h[Te]=r|4|128|8|64|1024,(l!==null||n&&n[Te]&2048)&&(h[Te]|=2048),$S(h),h[Ht]=h[nc]=n,h[Dt]=t,h[wi]=s||n&&n[wi],h[ze]=a||n&&n[ze],h[vo]=c||n&&n[vo]||null,h[Vn]=o,h[sf]=Dz(),h[tc]=d,h[VS]=l,h[Rn]=e.type==2?n[Rn]:h,h}function P8(n,e,t){let r=ur(e,n),i=L8(t),o=n[wi].rendererFactory,s=vC(n,yC(n,i,null,wx(t),r,e,null,o.createRenderer(r,t),null,null,null));return n[e.index]=s}function wx(n){let e=16;return n.signals?e=4096:n.onPush&&(e=64),e}function bx(n,e,t,r){if(t===0)return-1;let i=e.length;for(let o=0;o<t;o++)e.push(r),n.blueprint.push(r),n.data.push(null);return i}function vC(n,e){return n[Tu]?n[US][Mr]=e:n[Tu]=e,n[US]=e,e}function x8(n=1){Ox(Ke(),ne(),hr()+n,!1)}function Ox(n,e,t,r){if(!r)if((e[Te]&3)===3){let o=n.preOrderCheckHooks;o!==null&&VE(e,o,t)}else{let o=n.preOrderHooks;o!==null&&BE(e,o,0,t)}ys(t)}var m_=(function(n){return n[n.None=0]="None",n[n.SignalBased=1]="SignalBased",n[n.HasDecoratorInputTransform=2]="HasDecoratorInputTransform",n})(m_||{});function kA(n,e,t,r){let i=_e(null);try{let[o,s,a]=n.inputs[t],c=null;(s&m_.SignalBased)!==0&&(c=e[o][nn]),c!==null&&c.transformFn!==void 0?r=c.transformFn(r):a!==null&&(r=a.call(e,r)),n.setInput!==null?n.setInput(e,c,r,t,o):$P(e,c,o,r)}finally{_e(i)}}var ei=(function(n){return n[n.Important=1]="Important",n[n.DashCase=2]="DashCase",n})(ei||{}),k8;function SC(n,e){return k8(n,e)}var gc=new Set,E_=(function(n){return n[n.CHANGE_DETECTION=0]="CHANGE_DETECTION",n[n.AFTER_NEXT_RENDER=1]="AFTER_NEXT_RENDER",n})(E_||{}),_c=new z(""),TP=new Set;function Oo(n){TP.has(n)||(TP.add(n),performance?.mark?.("mark_feature_usage",{detail:{feature:n}}))}var Mx=!1,FA=class extends Ct{__isAsync;destroyRef=void 0;pendingTasks=void 0;constructor(e=!1){super(),this.__isAsync=e,FS()&&(this.destroyRef=Y(Gn,{optional:!0})??void 0,this.pendingTasks=Y(vs,{optional:!0})??void 0)}emit(e){let t=_e(null);try{super.next(e)}finally{_e(t)}}subscribe(e,t,r){let i=e,o=t||(()=>null),s=r;if(e&&typeof e=="object"){let c=e;i=c.next?.bind(c),o=c.error?.bind(c),s=c.complete?.bind(c)}this.__isAsync&&(o=this.wrapInTimeout(o),i&&(i=this.wrapInTimeout(i)),s&&(s=this.wrapInTimeout(s)));let a=super.subscribe({next:i,error:o,complete:s});return e instanceof pt&&e.add(a),a}wrapInTimeout(e){return t=>{let r=this.pendingTasks?.add();setTimeout(()=>{try{e(t)}finally{r!==void 0&&this.pendingTasks?.remove(r)}})}}},Co=FA;function Lx(n){let e,t;function r(){n=hc;try{t!==void 0&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(t),e!==void 0&&clearTimeout(e)}catch{}}return e=setTimeout(()=>{n(),r()}),typeof requestAnimationFrame=="function"&&(t=requestAnimationFrame(()=>{n(),r()})),()=>r()}function IP(n){return queueMicrotask(()=>n()),()=>{n=hc}}var AC="isAngularZone",QE=AC+"_ID",F8=0,Ae=class n{hasPendingMacrotasks=!1;hasPendingMicrotasks=!1;isStable=!0;onUnstable=new Co(!1);onMicrotaskEmpty=new Co(!1);onStable=new Co(!1);onError=new Co(!1);constructor(e){let{enableLongStackTrace:t=!1,shouldCoalesceEventChangeDetection:r=!1,shouldCoalesceRunChangeDetection:i=!1,scheduleInRootZone:o=Mx}=e;if(typeof Zone>"u")throw new J(908,!1);Zone.assertZonePatched();let s=this;s._nesting=0,s._outer=s._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(s._inner=s._inner.fork(new Zone.TaskTrackingZoneSpec)),t&&Zone.longStackTraceZoneSpec&&(s._inner=s._inner.fork(Zone.longStackTraceZoneSpec)),s.shouldCoalesceEventChangeDetection=!i&&r,s.shouldCoalesceRunChangeDetection=i,s.callbackScheduled=!1,s.scheduleInRootZone=o,B8(s)}static isInAngularZone(){return typeof Zone<"u"&&Zone.current.get(AC)===!0}static assertInAngularZone(){if(!n.isInAngularZone())throw new J(909,!1)}static assertNotInAngularZone(){if(n.isInAngularZone())throw new J(909,!1)}run(e,t,r){return this._inner.run(e,t,r)}runTask(e,t,r,i){let o=this._inner,s=o.scheduleEventTask("NgZoneEvent: "+i,e,U8,hc,hc);try{return o.runTask(s,t,r)}finally{o.cancelTask(s)}}runGuarded(e,t,r){return this._inner.runGuarded(e,t,r)}runOutsideAngular(e){return this._outer.run(e)}},U8={};function CC(n){if(n._nesting==0&&!n.hasPendingMicrotasks&&!n.isStable)try{n._nesting++,n.onMicrotaskEmpty.emit(null)}finally{if(n._nesting--,!n.hasPendingMicrotasks)try{n.runOutsideAngular(()=>n.onStable.emit(null))}finally{n.isStable=!0}}}function V8(n){if(n.isCheckStableRunning||n.callbackScheduled)return;n.callbackScheduled=!0;function e(){Lx(()=>{n.callbackScheduled=!1,UA(n),n.isCheckStableRunning=!0,CC(n),n.isCheckStableRunning=!1})}n.scheduleInRootZone?Zone.root.run(()=>{e()}):n._outer.run(()=>{e()}),UA(n)}function B8(n){let e=()=>{V8(n)},t=F8++;n._inner=n._inner.fork({name:"angular",properties:{[AC]:!0,[QE]:t,[QE+t]:!0},onInvokeTask:(r,i,o,s,a,c)=>{if(G8(c))return r.invokeTask(o,s,a,c);try{return yP(n),r.invokeTask(o,s,a,c)}finally{(n.shouldCoalesceEventChangeDetection&&s.type==="eventTask"||n.shouldCoalesceRunChangeDetection)&&e(),vP(n)}},onInvoke:(r,i,o,s,a,c,l)=>{try{return yP(n),r.invoke(o,s,a,c,l)}finally{n.shouldCoalesceRunChangeDetection&&!n.callbackScheduled&&!j8(c)&&e(),vP(n)}},onHasTask:(r,i,o,s)=>{r.hasTask(o,s),i===o&&(s.change=="microTask"?(n._hasPendingMicrotasks=s.microTask,UA(n),CC(n)):s.change=="macroTask"&&(n.hasPendingMacrotasks=s.macroTask))},onHandleError:(r,i,o,s)=>(r.handleError(o,s),n.runOutsideAngular(()=>n.onError.emit(s)),!1)})}function UA(n){n._hasPendingMicrotasks||(n.shouldCoalesceEventChangeDetection||n.shouldCoalesceRunChangeDetection)&&n.callbackScheduled===!0?n.hasPendingMicrotasks=!0:n.hasPendingMicrotasks=!1}function yP(n){n._nesting++,n.isStable&&(n.isStable=!1,n.onUnstable.emit(null))}function vP(n){n._nesting--,CC(n)}var bu=class{hasPendingMicrotasks=!1;hasPendingMacrotasks=!1;isStable=!0;onUnstable=new Co;onMicrotaskEmpty=new Co;onStable=new Co;onError=new Co;run(e,t,r){return e.apply(t,r)}runGuarded(e,t,r){return e.apply(t,r)}runOutsideAngular(e){return e()}runTask(e,t,r,i){return e.apply(t,r)}};function G8(n){return Px(n,"__ignore_ng_zone__")}function j8(n){return Px(n,"__scheduler_tick__")}function Px(n,e){return!Array.isArray(n)||n.length!==1?!1:n[0]?.data?.[e]===!0}function xx(n="zone.js",e){return n==="noop"?new bu:n==="zone.js"?new Ae(e):n}var DC=(()=>{class n{impl=null;execute(){this.impl?.execute()}static \u0275prov=Q({token:n,providedIn:"root",factory:()=>new n})}return n})(),kx=[0,1,2,3],Fx=(()=>{class n{ngZone=Y(Ae);scheduler=Y(Or);errorHandler=Y(ar,{optional:!0});sequences=new Set;deferredRegistrations=new Set;executing=!1;constructor(){Y(_c,{optional:!0})}execute(){let t=this.sequences.size>0;t&&it(16),this.executing=!0;for(let r of kx)for(let i of this.sequences)if(!(i.erroredOrDestroyed||!i.hooks[r]))try{i.pipelinedValue=this.ngZone.runOutsideAngular(()=>this.maybeTrace(()=>{let o=i.hooks[r];return o(i.pipelinedValue)},i.snapshot))}catch(o){i.erroredOrDestroyed=!0,this.errorHandler?.handleError(o)}this.executing=!1;for(let r of this.sequences)r.afterRun(),r.once&&(this.sequences.delete(r),r.destroy());for(let r of this.deferredRegistrations)this.sequences.add(r);this.deferredRegistrations.size>0&&this.scheduler.notify(7),this.deferredRegistrations.clear(),t&&it(17)}register(t){let{view:r}=t;r!==void 0?((r[ic]??=[]).push(t),Is(r),r[Te]|=8192):this.executing?this.deferredRegistrations.add(t):this.addSequence(t)}addSequence(t){this.sequences.add(t),this.scheduler.notify(7)}unregister(t){this.executing&&this.sequences.has(t)?(t.erroredOrDestroyed=!0,t.pipelinedValue=void 0,t.once=!0):(this.sequences.delete(t),this.deferredRegistrations.delete(t))}maybeTrace(t,r){return r?r.run(E_.AFTER_NEXT_RENDER,t):t()}static \u0275prov=Q({token:n,providedIn:"root",factory:()=>new n})}return n})(),JE=class{impl;hooks;view;once;snapshot;erroredOrDestroyed=!1;pipelinedValue=void 0;unregisterOnDestroy;constructor(e,t,r,i,o,s=null){this.impl=e,this.hooks=t,this.view=r,this.once=i,this.snapshot=s,this.unregisterOnDestroy=o?.onDestroy(()=>this.destroy())}afterRun(){this.erroredOrDestroyed=!1,this.pipelinedValue=void 0,this.snapshot?.dispose(),this.snapshot=null}destroy(){this.impl.unregister(this),this.unregisterOnDestroy?.();let e=this.view?.[ic];e&&(this.view[ic]=e.filter(t=>t!==this))}};function H8(n,e){let t=e?.injector??Y(We);return Oo("NgAfterNextRender"),W8(n,t,e,!0)}function $8(n){return n instanceof Function?[void 0,void 0,n,void 0]:[n.earlyRead,n.write,n.mixedReadWrite,n.read]}function W8(n,e,t,r){let i=e.get(DC);i.impl??=e.get(Fx);let o=e.get(_c,null,{optional:!0}),s=t?.manualCleanup!==!0?e.get(Gn):null,a=e.get(Au,null,{optional:!0}),c=new JE(i.impl,$8(n),a?.view,r,s,o?.snapshot(null));return i.impl.register(c),c}var Ux=new z("",{providedIn:"root",factory:()=>({queue:new Set,isScheduled:!1,scheduler:null})});function Vx(n,e,t){let r=n.get(Ux);if(Array.isArray(e))for(let i of e)r.queue.add(i),t?.detachedLeaveAnimationFns?.push(i);else r.queue.add(e),t?.detachedLeaveAnimationFns?.push(e);r.scheduler&&r.scheduler(n)}function z8(n,e){let t=n.get(Ux);if(e.detachedLeaveAnimationFns){for(let r of e.detachedLeaveAnimationFns)t.queue.delete(r);e.detachedLeaveAnimationFns=void 0}}function q8(n,e){for(let[t,r]of e)Vx(n,r.animateFns)}function SP(n,e,t,r){let i=n?.[oc]?.enter;e!==null&&i&&i.has(t.index)&&q8(r,i)}function Du(n,e,t,r,i,o,s,a){if(i!=null){let c,l=!1;Qr(i)?c=i:Oi(i)&&(l=!0,i=i[Xr]);let d=Lr(i);n===0&&r!==null?(SP(a,r,o,t),s==null?Ax(e,r,d):XE(e,r,d,s||null,!0)):n===1&&r!==null?(SP(a,r,o,t),XE(e,r,d,s||null,!0)):n===2?AP(a,o,t,h=>{Cx(e,d,l,h)}):n===3&&AP(a,o,t,()=>{e.destroyNode(d)}),c!=null&&i5(e,n,t,c,o,r,s)}}function K8(n,e){Bx(n,e),e[Xr]=null,e[Vn]=null}function Y8(n,e,t,r,i,o){r[Xr]=i,r[Vn]=e,T_(n,r,t,1,i,o)}function Bx(n,e){e[wi].changeDetectionScheduler?.notify(9),T_(n,e,e[ze],2,null,null)}function X8(n){let e=n[Tu];if(!e)return fA(n[pe],n);for(;e;){let t=null;if(Oi(e))t=e[Tu];else{let r=e[Rt];r&&(t=r)}if(!t){for(;e&&!e[Mr]&&e!==n;)Oi(e)&&fA(e[pe],e),e=e[Ht];e===null&&(e=n),Oi(e)&&fA(e[pe],e),t=e&&e[Mr]}e=t}}function RC(n,e){let t=n[sc],r=t.indexOf(e);t.splice(r,1)}function __(n,e){if(ac(e))return;let t=e[ze];t.destroyNode&&T_(n,e,t,3,null,null),X8(e)}function fA(n,e){if(ac(e))return;let t=_e(null);try{e[Te]&=-129,e[Te]|=256,e[lr]&&Ka(e[lr]),Z8(n,e),J8(n,e),e[pe].type===1&&e[ze].destroy();let r=e[_s];if(r!==null&&Qr(e[Ht])){r!==e[Ht]&&RC(r,e);let i=e[bi];i!==null&&i.detachView(n)}CA(e)}finally{_e(t)}}function AP(n,e,t,r){let i=n?.[oc];if(i==null||i.leave==null||!i.leave.has(e.index))return r(!1);n&&gc.add(n),Vx(t,()=>{if(i.leave&&i.leave.has(e.index)){let s=i.leave.get(e.index),a=[];if(s){for(let c=0;c<s.animateFns.length;c++){let l=s.animateFns[c],{promise:d}=l();a.push(d)}i.detachedLeaveAnimationFns=void 0}i.running=Promise.allSettled(a),Q8(n,r)}else n&&gc.delete(n),r(!1)},i)}function Q8(n,e){let t=n[oc]?.running;if(t){t.then(()=>{n[oc].running=void 0,gc.delete(n),e(!0)});return}e(!1)}function J8(n,e){let t=n.cleanup,r=e[_u];if(t!==null)for(let s=0;s<t.length-1;s+=2)if(typeof t[s]=="string"){let a=t[s+3];a>=0?r[a]():r[-a].unsubscribe(),s+=2}else{let a=r[t[s+1]];t[s].call(a)}r!==null&&(e[_u]=null);let i=e[To];if(i!==null){e[To]=null;for(let s=0;s<i.length;s++){let a=i[s];a()}}let o=e[So];if(o!==null){e[So]=null;for(let s of o)s.destroy()}}function Z8(n,e){let t;if(n!=null&&(t=n.destroyHooks)!=null)for(let r=0;r<t.length;r+=2){let i=e[t[r]];if(!(i instanceof pc)){let o=t[r+1];if(Array.isArray(o))for(let s=0;s<o.length;s+=2){let a=i[o[s]],c=o[s+1];it(4,a,c);try{c.call(a)}finally{it(5,a,c)}}else{it(4,i,o);try{o.call(i)}finally{it(5,i,o)}}}}}function Gx(n,e,t){return e5(n,e.parent,t)}function e5(n,e,t){let r=e;for(;r!==null&&r.type&168;)e=r,r=e.parent;if(r===null)return t[Xr];if(Ao(r)){let{encapsulation:i}=n.data[r.directiveStart+r.componentOffset];if(i===Do.None||i===Do.Emulated)return null}return ur(r,t)}function jx(n,e,t){return n5(n,e,t)}function t5(n,e,t){return n.type&40?ur(n,t):null}var n5=t5,CP;function NC(n,e,t,r){let i=Gx(n,r,e),o=e[ze],s=r.parent||e[Vn],a=jx(s,r,e);if(i!=null)if(Array.isArray(t))for(let c=0;c<t.length;c++)EP(o,i,t[c],a,!1);else EP(o,i,t,a,!1);CP!==void 0&&CP(o,r,e,t,i)}function pf(n,e){if(e!==null){let t=e.type;if(t&3)return ur(e,n);if(t&4)return VA(-1,n[e.index]);if(t&8){let r=e.child;if(r!==null)return pf(n,r);{let i=n[e.index];return Qr(i)?VA(-1,i):Lr(i)}}else{if(t&128)return pf(n,e.next);if(t&32)return SC(e,n)()||Lr(n[e.index]);{let r=Hx(n,e);if(r!==null){if(Array.isArray(r))return r[0];let i=ps(n[Rn]);return pf(i,r)}else return pf(n,e.next)}}}return null}function Hx(n,e){if(e!==null){let r=n[Rn][Vn],i=e.projection;return r.projection[i]}return null}function VA(n,e){let t=Rt+n+1;if(t<e.length){let r=e[t],i=r[pe].firstChild;if(i!==null)return pf(r,i)}return e[Ts]}function wC(n,e,t,r,i,o,s){for(;t!=null;){let a=r[vo];if(t.type===128){t=t.next;continue}let c=r[t.index],l=t.type;if(s&&e===0&&(c&&wu(Lr(c),r),t.flags|=2),!f_(t))if(l&8)wC(n,e,t.child,r,i,o,!1),Du(e,n,a,i,c,t,o,r);else if(l&32){let d=SC(t,r),h;for(;h=d();)Du(e,n,a,i,h,t,o,r);Du(e,n,a,i,c,t,o,r)}else l&16?$x(n,e,r,t,i,o):Du(e,n,a,i,c,t,o,r);t=s?t.projectionNext:t.next}}function T_(n,e,t,r,i,o){wC(t,r,n.firstChild,e,i,o,!1)}function r5(n,e,t){let r=e[ze],i=Gx(n,t,e),o=t.parent||e[Vn],s=jx(o,t,e);$x(r,0,e,t,i,s)}function $x(n,e,t,r,i,o){let s=t[Rn],c=s[Vn].projection[r.projection];if(Array.isArray(c))for(let l=0;l<c.length;l++){let d=c[l];Du(e,n,t[vo],i,d,r,o,t)}else{let l=c,d=s[Ht];sx(r)&&(l.flags|=128),wC(n,e,l,d,i,o,!0)}}function i5(n,e,t,r,i,o,s){let a=r[Ts],c=Lr(r);a!==c&&Du(e,n,t,o,a,i,s);for(let l=Rt;l<r.length;l++){let d=r[l];T_(d[pe],d,n,e,o,a)}}function o5(n,e,t,r,i){if(e)i?n.addClass(t,r):n.removeClass(t,r);else{let o=r.indexOf("-")===-1?void 0:ei.DashCase;i==null?n.removeStyle(t,r,o):(typeof i=="string"&&i.endsWith("!important")&&(i=i.slice(0,-10),o|=ei.Important),n.setStyle(t,r,i,o))}}function Wx(n,e,t,r,i){let o=hr(),s=r&2;try{ys(-1),s&&e.length>qe&&Ox(n,e,qe,!1),it(s?2:0,i,t),t(r,i)}finally{ys(o),it(s?3:1,i,t)}}function I_(n,e,t){u5(n,e,t),(t.flags&64)===64&&d5(n,e,t)}function vf(n,e,t=ur){let r=e.localNames;if(r!==null){let i=e.index+1;for(let o=0;o<r.length;o+=2){let s=r[o+1],a=s===-1?t(e,n):n[s];n[i++]=a}}}function s5(n,e,t,r){let o=r.get(px,fx)||t===Do.ShadowDom,s=n.selectRootElement(e,o);return a5(s),s}function a5(n){c5(n)}var c5=()=>null;function l5(n){return n==="class"?"className":n==="for"?"htmlFor":n==="formaction"?"formAction":n==="innerHtml"?"innerHTML":n==="readonly"?"readOnly":n==="tabindex"?"tabIndex":n}function zx(n,e,t,r,i,o){let s=e[pe];if(y_(n,s,e,t,r)){Ao(n)&&Kx(e,n.index);return}n.type&3&&(t=l5(t)),qx(n,e,t,r,i,o)}function qx(n,e,t,r,i,o){if(n.type&3){let s=ur(n,e);r=o!=null?o(r,n.value||"",t):r,i.setProperty(s,t,r)}else n.type&12}function Kx(n,e){let t=Pr(e,n);t[Te]&16||(t[Te]|=64)}function u5(n,e,t){let r=t.directiveStart,i=t.directiveEnd;Ao(t)&&P8(e,t,n.data[r+t.componentOffset]),n.firstCreatePass||KE(t,e);let o=t.initialInputs;for(let s=r;s<i;s++){let a=n.data[s],c=mf(e,n,s,t);if(wu(c,e),o!==null&&p5(e,s-r,c,a,t,o),Jr(a)){let l=Pr(t.index,e);l[Dt]=mf(e,n,s,t)}}}function d5(n,e,t){let r=t.directiveStart,i=t.directiveEnd,o=t.index,s=XL();try{ys(o);for(let a=r;a<i;a++){let c=n.data[a],l=e[a];DE(a),(c.hostBindings!==null||c.hostVars!==0||c.hostAttrs!==null)&&h5(c,l)}}finally{ys(-1),DE(s)}}function h5(n,e){n.hostBindings!==null&&n.hostBindings(1,e)}function bC(n,e){let t=n.directiveRegistry,r=null;if(t)for(let i=0;i<t.length;i++){let o=t[i];Nx(e,o.selectors,!1)&&(r??=[],Jr(o)?r.unshift(o):r.push(o))}return r}function f5(n,e,t,r,i,o){let s=ur(n,e);Yx(e[ze],s,o,n.value,t,r,i)}function Yx(n,e,t,r,i,o,s){if(o==null)n.removeAttribute(e,i,t);else{let a=s==null?cr(o):s(o,r||"",i);n.setAttribute(e,i,a,t)}}function p5(n,e,t,r,i,o){let s=o[e];if(s!==null)for(let a=0;a<s.length;a+=2){let c=s[a],l=s[a+1];kA(r,t,c,l)}}function OC(n,e,t,r,i){let o=qe+t,s=e[pe],a=i(s,e,n,r,t);e[o]=a,lc(n,!0);let c=n.type===2;return c?(Dx(e[ze],a,n),(jL()===0||Iu(n))&&wu(a,e),HL()):wu(a,e),bE()&&(!c||!f_(n))&&NC(s,e,a,n),n}function MC(n){let e=n;return ZS()?eA():(e=e.parent,lc(e,!1)),e}function g5(n,e){let t=n[vo];if(!t)return;let r;try{r=t.get(Li,null)}catch{r=null}r?.(e)}function y_(n,e,t,r,i){let o=n.inputs?.[r],s=n.hostDirectiveInputs?.[r],a=!1;if(s)for(let c=0;c<s.length;c+=2){let l=s[c],d=s[c+1],h=e.data[l];kA(h,t[l],d,i),a=!0}if(o)for(let c of o){let l=t[c],d=e.data[c];kA(d,l,r,i),a=!0}return a}function m5(n,e){let t=Pr(e,n),r=t[pe];E5(r,t);let i=t[Xr];i!==null&&t[tc]===null&&(t[tc]=gx(i,t[vo])),it(18),LC(r,t,t[Dt]),it(19,t[Dt])}function E5(n,e){for(let t=e.length;t<n.blueprint.length;t++)e.push(n.blueprint[t])}function LC(n,e,t){NE(e);try{let r=n.viewQuery;r!==null&&RA(1,r,t);let i=n.template;i!==null&&Wx(n,e,i,1,t),n.firstCreatePass&&(n.firstCreatePass=!1),e[bi]?.finishViewCreation(n),n.staticContentQueries&&mx(n,e),n.staticViewQueries&&RA(2,n.viewQuery,t);let o=n.components;o!==null&&_5(e,o)}catch(r){throw n.firstCreatePass&&(n.incompleteFirstPass=!0,n.firstCreatePass=!1),r}finally{e[Te]&=-5,wE()}}function _5(n,e){for(let t=0;t<e.length;t++)m5(n,e[t])}function Sf(n,e,t,r){let i=_e(null);try{let o=e.tView,a=n[Te]&4096?4096:16,c=yC(n,o,t,a,null,e,null,null,r?.injector??null,r?.embeddedViewInjector??null,r?.dehydratedView??null),l=n[e.index];c[_s]=l;let d=n[bi];return d!==null&&(c[bi]=d.createEmbeddedView(o)),LC(o,c,t),c}finally{_e(i)}}function Ou(n,e){return!e||e.firstChild===null||sx(n)}function Ef(n,e,t,r,i=!1){for(;t!==null;){if(t.type===128){t=i?t.projectionNext:t.next;continue}let o=e[t.index];o!==null&&r.push(Lr(o)),Qr(o)&&Xx(o,r);let s=t.type;if(s&8)Ef(n,e,t.child,r);else if(s&32){let a=SC(t,e),c;for(;c=a();)r.push(c)}else if(s&16){let a=Hx(e,t);if(Array.isArray(a))r.push(...a);else{let c=ps(e[Rn]);Ef(c[pe],c,a,r,!0)}}t=i?t.projectionNext:t.next}return r}function Xx(n,e){for(let t=Rt;t<n.length;t++){let r=n[t],i=r[pe].firstChild;i!==null&&Ef(r[pe],r,i,e)}n[Ts]!==n[Xr]&&e.push(n[Ts])}function Qx(n){if(n[ic]!==null){for(let e of n[ic])e.impl.addSequence(e);n[ic].length=0}}var Jx=[];function T5(n){return n[lr]??I5(n)}function I5(n){let e=Jx.pop()??Object.create(v5);return e.lView=n,e}function y5(n){n.lView[lr]!==n&&(n.lView=null,Jx.push(n))}var v5=ye($({},za),{consumerIsAlwaysLive:!0,kind:"template",consumerMarkedDirty:n=>{Is(n.lView)},consumerOnSignalRead(){this.lView[lr]=this}});function S5(n){let e=n[lr]??Object.create(A5);return e.lView=n,e}var A5=ye($({},za),{consumerIsAlwaysLive:!0,kind:"template",consumerMarkedDirty:n=>{let e=ps(n.lView);for(;e&&!Zx(e[pe]);)e=ps(e);e&&SE(e)},consumerOnSignalRead(){this.lView[lr]=this}});function Zx(n){return n.type!==2}function ek(n){if(n[So]===null)return;let e=!0;for(;e;){let t=!1;for(let r of n[So])r.dirty&&(t=!0,r.zone===null||Zone.current===r.zone?r.run():r.zone.run(()=>r.run()));e=t&&!!(n[Te]&8192)}}var C5=100;function tk(n,e=0){let r=n[wi].rendererFactory,i=!1;i||r.begin?.();try{D5(n,e)}finally{i||r.end?.()}}function D5(n,e){let t=nA();try{Su(!0),BA(n,e);let r=0;for(;vu(n);){if(r===C5)throw new J(103,!1);r++,BA(n,1)}}finally{Su(t)}}function R5(n,e,t,r){if(ac(e))return;let i=e[Te],o=!1,s=!1;NE(e);let a=!0,c=null,l=null;o||(Zx(n)?(l=T5(e),c=qa(l)):Qm()===null?(a=!1,l=S5(e),c=qa(l)):e[lr]&&(Ka(e[lr]),e[lr]=null));try{$S(e),qL(n.bindingStartIndex),t!==null&&Wx(n,e,t,2,r);let d=(i&3)===3;if(!o)if(d){let g=n.preOrderCheckHooks;g!==null&&VE(e,g,null)}else{let g=n.preOrderHooks;g!==null&&BE(e,g,0,null),dA(e,0)}if(s||N5(e),ek(e),nk(e,0),n.contentQueries!==null&&mx(n,e),!o)if(d){let g=n.contentCheckHooks;g!==null&&VE(e,g)}else{let g=n.contentHooks;g!==null&&BE(e,g,1),dA(e,1)}b5(n,e);let h=n.components;h!==null&&ik(e,h,0);let f=n.viewQuery;if(f!==null&&RA(2,f,r),!o)if(d){let g=n.viewCheckHooks;g!==null&&VE(e,g)}else{let g=n.viewHooks;g!==null&&BE(e,g,2),dA(e,2)}if(n.firstUpdatePass===!0&&(n.firstUpdatePass=!1),e[yE]){for(let g of e[yE])g();e[yE]=null}o||(Qx(e),e[Te]&=-73)}catch(d){throw o||Is(e),d}finally{l!==null&&(uu(l,c),a&&y5(l)),wE()}}function nk(n,e){for(let t=cx(n);t!==null;t=lx(t))for(let r=Rt;r<t.length;r++){let i=t[r];rk(i,e)}}function N5(n){for(let e=cx(n);e!==null;e=lx(e)){if(!(e[Te]&2))continue;let t=e[sc];for(let r=0;r<t.length;r++){let i=t[r];SE(i)}}}function w5(n,e,t){it(18);let r=Pr(e,n);rk(r,t),it(19,r[Dt])}function rk(n,e){vE(n)&&BA(n,e)}function BA(n,e){let r=n[pe],i=n[Te],o=n[lr],s=!!(e===0&&i&16);if(s||=!!(i&64&&e===0),s||=!!(i&1024),s||=!!(o?.dirty&&du(o)),s||=!1,o&&(o.dirty=!1),n[Te]&=-9217,s)R5(r,n,r.template,n[Dt]);else if(i&8192){let a=_e(null);try{ek(n),nk(n,1);let c=r.components;c!==null&&ik(n,c,1),Qx(n)}finally{_e(a)}}}function ik(n,e,t){for(let r=0;r<e.length;r++)w5(n,e[r],t)}function b5(n,e){let t=n.hostBindingOpCodes;if(t!==null)try{for(let r=0;r<t.length;r++){let i=t[r];if(i<0)ys(~i);else{let o=i,s=t[++r],a=t[++r];YL(s,o);let c=e[o];it(24,c),a(2,c),it(25,c)}}}finally{ys(-1)}}function PC(n,e){let t=nA()?64:1088;for(n[wi].changeDetectionScheduler?.notify(e);n;){n[Te]|=t;let r=ps(n);if(yu(n)&&!r)return n;n=r}return null}function ok(n,e,t,r){return[n,!0,0,e,null,r,null,t,null,null]}function sk(n,e){let t=Rt+e;if(t<n.length)return n[t]}function Af(n,e,t,r=!0){let i=e[pe];if(O5(i,e,n,t),r){let s=VA(t,n),a=e[ze],c=a.parentNode(n[Ts]);c!==null&&Y8(i,n[Vn],a,e,c,s)}let o=e[tc];o!==null&&o.firstChild!==null&&(o.firstChild=null)}function ak(n,e){let t=_f(n,e);return t!==void 0&&__(t[pe],t),t}function _f(n,e){if(n.length<=Rt)return;let t=Rt+e,r=n[t];if(r){let i=r[_s];i!==null&&i!==n&&RC(i,r),e>0&&(n[t-1][Mr]=r[Mr]);let o=nf(n,Rt+e);K8(r[pe],r);let s=o[bi];s!==null&&s.detachView(o[pe]),r[Ht]=null,r[Mr]=null,r[Te]&=-129}return r}function O5(n,e,t,r){let i=Rt+r,o=t.length;r>0&&(t[i-1][Mr]=e),r<o-Rt?(e[Mr]=t[i],bS(t,Rt+r,e)):(t.push(e),e[Mr]=null),e[Ht]=t;let s=e[_s];s!==null&&t!==s&&ck(s,e);let a=e[bi];a!==null&&a.insertView(n),AE(e),e[Te]|=128}function ck(n,e){let t=n[sc],r=e[Ht];if(Oi(r))n[Te]|=2;else{let i=r[Ht][Rn];e[Rn]!==i&&(n[Te]|=2)}t===null?n[sc]=[e]:t.push(e)}var Ss=class{_lView;_cdRefInjectingView;_appRef=null;_attachedToViewContainer=!1;exhaustive;get rootNodes(){let e=this._lView,t=e[pe];return Ef(t,e,t.firstChild,[])}constructor(e,t){this._lView=e,this._cdRefInjectingView=t}get context(){return this._lView[Dt]}set context(e){this._lView[Dt]=e}get destroyed(){return ac(this._lView)}destroy(){if(this._appRef)this._appRef.detachView(this);else if(this._attachedToViewContainer){let e=this._lView[Ht];if(Qr(e)){let t=e[af],r=t?t.indexOf(this):-1;r>-1&&(_f(e,r),nf(t,r))}this._attachedToViewContainer=!1}__(this._lView[pe],this._lView)}onDestroy(e){WS(this._lView,e)}markForCheck(){PC(this._cdRefInjectingView||this._lView,4)}detach(){this._lView[Te]&=-129}reattach(){AE(this._lView),this._lView[Te]|=128}detectChanges(){this._lView[Te]|=1024,tk(this._lView)}checkNoChanges(){}attachToViewContainerRef(){if(this._appRef)throw new J(902,!1);this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null;let e=yu(this._lView),t=this._lView[_s];t!==null&&!e&&RC(t,this._lView),Bx(this._lView[pe],this._lView)}attachToAppRef(e){if(this._attachedToViewContainer)throw new J(902,!1);this._appRef=e;let t=yu(this._lView),r=this._lView[_s];r!==null&&!t&&ck(r,this._lView),AE(this._lView)}};function M5(n){return vu(n._lView)||!!(n._lView[Te]&64)}function L5(n){SE(n._lView)}var Fi=(()=>{class n{_declarationLView;_declarationTContainer;elementRef;static __NG_ELEMENT_ID__=P5;constructor(t,r,i){this._declarationLView=t,this._declarationTContainer=r,this.elementRef=i}get ssrId(){return this._declarationTContainer.tView?.ssrId||null}createEmbeddedView(t,r){return this.createEmbeddedViewImpl(t,r)}createEmbeddedViewImpl(t,r,i){let o=Sf(this._declarationLView,this._declarationTContainer,t,{embeddedViewInjector:r,dehydratedView:i});return new Ss(o)}}return n})();function P5(){return v_($t(),ne())}function v_(n,e){return n.type&4?new Fi(e,n,Bu(n,e)):null}function Tc(n,e,t,r,i){let o=n.data[e];if(o===null)o=x5(n,e,t,r,i),KL()&&(o.flags|=32);else if(o.type&64){o.type=t,o.value=r,o.attrs=i;let s=zL();o.injectorIndex=s===null?-1:s.injectorIndex}return lc(o,!0),o}function x5(n,e,t,r,i){let o=JS(),s=ZS(),a=s?o:o&&o.parent,c=n.data[e]=F5(n,a,t,e,r,i);return k5(n,c,o,s),c}function k5(n,e,t,r){n.firstChild===null&&(n.firstChild=e),t!==null&&(r?t.child==null&&e.parent!==null&&(t.child=e):t.next===null&&(t.next=e,e.prev=t))}function F5(n,e,t,r,i,o){let s=e?e.injectorIndex:-1,a=0;return YS()&&(a|=128),{type:t,index:r,insertBeforeIndex:null,injectorIndex:s,directiveStart:-1,directiveEnd:-1,directiveStylingLast:-1,componentOffset:-1,propertyBindings:null,flags:a,providerIndexes:0,value:i,namespace:sA(),attrs:o,mergedAttrs:null,localNames:null,initialInputs:null,inputs:null,hostDirectiveInputs:null,outputs:null,hostDirectiveOutputs:null,directiveToIndex:null,tView:null,next:null,prev:null,projectionNext:null,child:null,parent:e,projection:null,styles:null,stylesWithoutHost:null,residualStyles:void 0,classes:null,classesWithoutHost:null,residualClasses:void 0,classBindings:0,styleBindings:0}}var EEe=new RegExp(`^(\\d+)*(${Oz}|${bz})*(.*)`);function U5(n){let e=n[BS]??[],r=n[Ht][ze],i=[];for(let o of e)o.data[hx]!==void 0?i.push(o):V5(o,r);n[BS]=i}function V5(n,e){let t=0,r=n.firstChild;if(r){let i=n.data[dx];for(;t<i;){let o=r.nextSibling;Cx(e,r,!1),r=o,t++}}}var B5=()=>null,G5=()=>null;function ZE(n,e){return B5(n,e)}function lk(n,e,t){return G5(n,e,t)}var uk=class{},S_=class{},GA=class{resolveComponentFactory(e){throw new J(917,!1)}},Cf=class{static NULL=new GA},No=class{},A_=(()=>{class n{destroyNode=null;static __NG_ELEMENT_ID__=()=>j5()}return n})();function j5(){let n=ne(),e=$t(),t=Pr(e.index,n);return(Oi(t)?t:n)[ze]}var dk=(()=>{class n{static \u0275prov=Q({token:n,providedIn:"root",factory:()=>null})}return n})();var jE={},jA=class{injector;parentInjector;constructor(e,t){this.injector=e,this.parentInjector=t}get(e,t,r){let i=this.injector.get(e,jE,r);return i!==jE||t===jE?i:this.parentInjector.get(e,t,r)}};function e_(n,e,t){let r=t?n.styles:null,i=t?n.classes:null,o=0;if(e!==null)for(let s=0;s<e.length;s++){let a=e[s];if(typeof a=="number")o=a;else if(o==1)i=fE(i,a);else if(o==2){let c=a,l=e[++s];r=fE(r,c+": "+l+";")}}t?n.styles=r:n.stylesWithoutHost=r,t?n.classes=i:n.classesWithoutHost=i}function ot(n,e=0){let t=ne();if(t===null)return H(n,e);let r=$t();return nx(r,t,jt(n),e)}function H5(){let n="invalid";throw new Error(n)}function hk(n,e,t,r,i){let o=r===null?null:{"":-1},s=i(n,t);if(s!==null){let a=s,c=null,l=null;for(let d of s)if(d.resolveHostDirectives!==null){[a,c,l]=d.resolveHostDirectives(s);break}z5(n,e,t,a,o,c,l)}o!==null&&r!==null&&$5(t,r,o)}function $5(n,e,t){let r=n.localNames=[];for(let i=0;i<e.length;i+=2){let o=t[e[i+1]];if(o==null)throw new J(-301,!1);r.push(e[i],o)}}function W5(n,e,t){e.componentOffset=t,(n.components??=[]).push(e.index)}function z5(n,e,t,r,i,o,s){let a=r.length,c=!1;for(let f=0;f<a;f++){let g=r[f];!c&&Jr(g)&&(c=!0,W5(n,t,f)),SA(KE(t,e),n,g.type)}J5(t,n.data.length,a);for(let f=0;f<a;f++){let g=r[f];g.providersResolver&&g.providersResolver(g)}let l=!1,d=!1,h=bx(n,e,a,null);a>0&&(t.directiveToIndex=new Map);for(let f=0;f<a;f++){let g=r[f];if(t.mergedAttrs=Nu(t.mergedAttrs,g.hostAttrs),K5(n,t,e,h,g),Q5(h,g,i),s!==null&&s.has(g)){let[v,S]=s.get(g);t.directiveToIndex.set(g.type,[h,v+t.directiveStart,S+t.directiveStart])}else(o===null||!o.has(g))&&t.directiveToIndex.set(g.type,h);g.contentQueries!==null&&(t.flags|=4),(g.hostBindings!==null||g.hostAttrs!==null||g.hostVars!==0)&&(t.flags|=64);let E=g.type.prototype;!l&&(E.ngOnChanges||E.ngOnInit||E.ngDoCheck)&&((n.preOrderHooks??=[]).push(t.index),l=!0),!d&&(E.ngOnChanges||E.ngDoCheck)&&((n.preOrderCheckHooks??=[]).push(t.index),d=!0),h++}q5(n,t,o)}function q5(n,e,t){for(let r=e.directiveStart;r<e.directiveEnd;r++){let i=n.data[r];if(t===null||!t.has(i))DP(0,e,i,r),DP(1,e,i,r),NP(e,r,!1);else{let o=t.get(i);RP(0,e,o,r),RP(1,e,o,r),NP(e,r,!0)}}}function DP(n,e,t,r){let i=n===0?t.inputs:t.outputs;for(let o in i)if(i.hasOwnProperty(o)){let s;n===0?s=e.inputs??={}:s=e.outputs??={},s[o]??=[],s[o].push(r),fk(e,o)}}function RP(n,e,t,r){let i=n===0?t.inputs:t.outputs;for(let o in i)if(i.hasOwnProperty(o)){let s=i[o],a;n===0?a=e.hostDirectiveInputs??={}:a=e.hostDirectiveOutputs??={},a[s]??=[],a[s].push(r,o),fk(e,s)}}function fk(n,e){e==="class"?n.flags|=8:e==="style"&&(n.flags|=16)}function NP(n,e,t){let{attrs:r,inputs:i,hostDirectiveInputs:o}=n;if(r===null||!t&&i===null||t&&o===null||TC(n)){n.initialInputs??=[],n.initialInputs.push(null);return}let s=null,a=0;for(;a<r.length;){let c=r[a];if(c===0){a+=4;continue}else if(c===5){a+=2;continue}else if(typeof c=="number")break;if(!t&&i.hasOwnProperty(c)){let l=i[c];for(let d of l)if(d===e){s??=[],s.push(c,r[a+1]);break}}else if(t&&o.hasOwnProperty(c)){let l=o[c];for(let d=0;d<l.length;d+=2)if(l[d]===e){s??=[],s.push(l[d+1],r[a+1]);break}}a+=2}n.initialInputs??=[],n.initialInputs.push(s)}function K5(n,e,t,r,i){n.data[r]=i;let o=i.factory||(i.factory=fs(i.type,!0)),s=new pc(o,Jr(i),ot,null);n.blueprint[r]=s,t[r]=s,Y5(n,e,r,bx(n,t,i.hostVars,on),i)}function Y5(n,e,t,r,i){let o=i.hostBindings;if(o){let s=n.hostBindingOpCodes;s===null&&(s=n.hostBindingOpCodes=[]);let a=~e.index;X5(s)!=a&&s.push(a),s.push(t,r,o)}}function X5(n){let e=n.length;for(;e>0;){let t=n[--e];if(typeof t=="number"&&t<0)return t}return 0}function Q5(n,e,t){if(t){if(e.exportAs)for(let r=0;r<e.exportAs.length;r++)t[e.exportAs[r]]=n;Jr(e)&&(t[""]=n)}}function J5(n,e,t){n.flags|=1,n.directiveStart=e,n.directiveEnd=e+t,n.providerIndexes=e}function xC(n,e,t,r,i,o,s,a){let c=e[pe],l=c.consts,d=dr(l,s),h=Tc(c,n,t,r,d);return o&&hk(c,e,h,dr(l,a),i),h.mergedAttrs=Nu(h.mergedAttrs,h.attrs),h.attrs!==null&&e_(h,h.attrs,!1),h.mergedAttrs!==null&&e_(h,h.mergedAttrs,!0),c.queries!==null&&c.queries.elementStart(c,h),h}function kC(n,e){KP(n,e),GS(e)&&n.queries.elementEnd(e)}function Z5(n,e,t,r,i,o){let s=e.consts,a=dr(s,i),c=Tc(e,n,t,r,a);if(c.mergedAttrs=Nu(c.mergedAttrs,c.attrs),o!=null){let l=dr(s,o);c.localNames=[];for(let d=0;d<l.length;d+=2)c.localNames.push(l[d],-1)}return c.attrs!==null&&e_(c,c.attrs,!1),c.mergedAttrs!==null&&e_(c,c.mergedAttrs,!0),e.queries!==null&&e.queries.elementStart(e,c),c}function FC(n){return C_(n)?Array.isArray(n)||!(n instanceof Map)&&Symbol.iterator in n:!1}function pk(n,e){if(Array.isArray(n))for(let t=0;t<n.length;t++)e(n[t]);else{let t=n[Symbol.iterator](),r;for(;!(r=t.next()).done;)e(r.value)}}function C_(n){return n!==null&&(typeof n=="function"||typeof n=="object")}function Vi(n,e,t){return n[e]=t}function Df(n,e){return n[e]}function mn(n,e,t){if(t===on)return!1;let r=n[e];return Object.is(r,t)?!1:(n[e]=t,!0)}function Mu(n,e,t,r){let i=mn(n,e,t);return mn(n,e+1,r)||i}function UC(n,e,t,r,i){let o=Mu(n,e,t,r);return mn(n,e+2,i)||o}function Lu(n,e,t,r,i,o){let s=Mu(n,e,t,r);return Mu(n,e+2,i,o)||s}function HE(n,e,t){return function r(i){let o=Ao(n)?Pr(n.index,e):e;PC(o,5);let s=e[Dt],a=wP(e,s,t,i),c=r.__ngNextListenerFn__;for(;c;)a=wP(e,s,c,i)&&a,c=c.__ngNextListenerFn__;return a}}function wP(n,e,t,r){let i=_e(null);try{return it(6,e,t),t(r)!==!1}catch(o){return g5(n,o),!1}finally{it(7,e,t),_e(i)}}function gk(n,e,t,r,i,o,s,a){let c=Iu(n),l=!1,d=null;if(!r&&c&&(d=tq(e,t,o,n.index)),d!==null){let h=d.__ngLastListenerFn__||d;h.__ngNextListenerFn__=s,d.__ngLastListenerFn__=s,l=!0}else{let h=ur(n,t),f=r?r(h):h;Lz(t,f,o,a);let g=i.listen(f,o,a);if(!eq(o)){let E=r?v=>r(Lr(v[n.index])):n.index;mk(E,e,t,o,a,g,!1)}}return l}function eq(n){return n.startsWith("animation")||n.startsWith("transition")}function tq(n,e,t,r){let i=n.cleanup;if(i!=null)for(let o=0;o<i.length-1;o+=2){let s=i[o];if(s===t&&i[o+1]===r){let a=e[_u],c=i[o+2];return a&&a.length>c?a[c]:null}typeof s=="string"&&(o+=2)}return null}function mk(n,e,t,r,i,o,s){let a=e.firstCreatePass?qS(e):null,c=zS(t),l=c.length;c.push(i,o),a&&a.push(r,n,l,(l+1)*(s?-1:1))}function bP(n,e,t,r,i,o){let s=e[t],a=e[pe],l=a.data[t].outputs[r],h=s[l].subscribe(o);mk(n.index,a,e,i,o,h,!0)}var HA=Symbol("BINDING");var t_=class extends Cf{ngModule;constructor(e){super(),this.ngModule=e}resolveComponentFactory(e){let t=Es(e);return new Pu(t,this.ngModule)}};function nq(n){return Object.keys(n).map(e=>{let[t,r,i]=n[e],o={propName:t,templateName:e,isSignal:(r&m_.SignalBased)!==0};return i&&(o.transform=i),o})}function rq(n){return Object.keys(n).map(e=>({propName:n[e],templateName:e}))}function iq(n,e,t){let r=e instanceof Dn?e:e?.injector;return r&&n.getStandaloneInjector!==null&&(r=n.getStandaloneInjector(r)||r),r?new jA(t,r):t}function oq(n){let e=n.get(No,null);if(e===null)throw new J(407,!1);let t=n.get(dk,null),r=n.get(Or,null);return{rendererFactory:e,sanitizer:t,changeDetectionScheduler:r,ngReflect:!1}}function sq(n,e){let t=Ek(n);return Sx(e,t,t==="svg"?ef:t==="math"?jS:null)}function aq(n){if(n?.toLowerCase()==="script")throw new J(905,!1)}function Ek(n){return(n.selectors[0][0]||"div").toLowerCase()}var Pu=class extends S_{componentDef;ngModule;selector;componentType;ngContentSelectors;isBoundToModule;cachedInputs=null;cachedOutputs=null;get inputs(){return this.cachedInputs??=nq(this.componentDef.inputs),this.cachedInputs}get outputs(){return this.cachedOutputs??=rq(this.componentDef.outputs),this.cachedOutputs}constructor(e,t){super(),this.componentDef=e,this.ngModule=t,this.componentType=e.type,this.selector=b8(e.selectors),this.ngContentSelectors=e.ngContentSelectors??[],this.isBoundToModule=!!t}create(e,t,r,i,o,s){it(22);let a=_e(null);try{let c=this.componentDef,l=cq(r,c,s,o),d=iq(c,i||this.ngModule,e),h=oq(d),f=h.rendererFactory.createRenderer(null,c),g=r?s5(f,r,c.encapsulation,d):sq(c,f);aq(g?.tagName);let E=s?.some(OP)||o?.some(P=>typeof P!="function"&&P.bindings.some(OP)),v=yC(null,l,null,512|wx(c),null,null,h,f,d,null,gx(g,d,!0));v[qe]=g,NE(v);let S=null;try{let P=xC(qe,v,2,"#host",()=>l.directiveRegistry,!0,0);Dx(f,g,P),wu(g,v),I_(l,v,P),hC(l,P,v),kC(l,P),t!==void 0&&uq(P,this.ngContentSelectors,t),S=Pr(P.index,v),v[Dt]=S[Dt],LC(l,v,null)}catch(P){throw S!==null&&CA(S),CA(v),P}finally{it(23),wE()}return new n_(this.componentType,v,!!E)}finally{_e(a)}}};function cq(n,e,t,r){let i=n?["ng-version","20.3.31"]:O8(e.selectors[0]),o=null,s=null,a=0;if(t)for(let d of t)a+=d[HA].requiredVars,d.create&&(d.targetIdx=0,(o??=[]).push(d)),d.update&&(d.targetIdx=0,(s??=[]).push(d));if(r)for(let d=0;d<r.length;d++){let h=r[d];if(typeof h!="function")for(let f of h.bindings){a+=f[HA].requiredVars;let g=d+1;f.create&&(f.targetIdx=g,(o??=[]).push(f)),f.update&&(f.targetIdx=g,(s??=[]).push(f))}}let c=[e];if(r)for(let d of r){let h=typeof d=="function"?d:d.type,f=IE(h);c.push(f)}return IC(0,null,lq(o,s),1,a,c,null,null,null,[i],null)}function lq(n,e){return!n&&!e?null:t=>{if(t&1&&n)for(let r of n)r.create();if(t&2&&e)for(let r of e)r.update()}}function OP(n){let e=n[HA].kind;return e==="input"||e==="twoWay"}var n_=class extends uk{_rootLView;_hasInputBindings;instance;hostView;changeDetectorRef;componentType;location;previousInputValues=null;_tNode;constructor(e,t,r){super(),this._rootLView=t,this._hasInputBindings=r,this._tNode=cf(t[pe],qe),this.location=Bu(this._tNode,t),this.instance=Pr(this._tNode.index,t)[Dt],this.hostView=this.changeDetectorRef=new Ss(t,void 0),this.componentType=e}setInput(e,t){this._hasInputBindings;let r=this._tNode;if(this.previousInputValues??=new Map,this.previousInputValues.has(e)&&Object.is(this.previousInputValues.get(e),t))return;let i=this._rootLView,o=y_(r,i[pe],i,e,t);this.previousInputValues.set(e,t);let s=Pr(r.index,i);PC(s,1)}get injector(){return new fc(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(e){this.hostView.onDestroy(e)}};function uq(n,e,t){let r=n.projection=[];for(let i=0;i<e.length;i++){let o=t[i];r.push(o!=null&&o.length?Array.from(o):null)}}var Bi=(()=>{class n{static __NG_ELEMENT_ID__=dq}return n})();function dq(){let n=$t();return Tk(n,ne())}var hq=Bi,_k=class extends hq{_lContainer;_hostTNode;_hostLView;constructor(e,t,r){super(),this._lContainer=e,this._hostTNode=t,this._hostLView=r}get element(){return Bu(this._hostTNode,this._hostLView)}get injector(){return new fc(this._hostTNode,this._hostLView)}get parentInjector(){let e=cC(this._hostTNode,this._hostLView);if(XP(e)){let t=zE(e,this._hostLView),r=WE(e),i=t[pe].data[r+8];return new fc(i,t)}else return new fc(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(e){let t=MP(this._lContainer);return t!==null&&t[e]||null}get length(){return this._lContainer.length-Rt}createEmbeddedView(e,t,r){let i,o;typeof r=="number"?i=r:r!=null&&(i=r.index,o=r.injector);let s=ZE(this._lContainer,e.ssrId),a=e.createEmbeddedViewImpl(t||{},o,s);return this.insertImpl(a,i,Ou(this._hostTNode,s)),a}createComponent(e,t,r,i,o,s,a){let c=e&&!rz(e),l;if(c)l=t;else{let S=t||{};l=S.index,r=S.injector,i=S.projectableNodes,o=S.environmentInjector||S.ngModuleRef,s=S.directives,a=S.bindings}let d=c?e:new Pu(Es(e)),h=r||this.parentInjector;if(!o&&d.ngModule==null){let P=(c?h:this.parentInjector).get(Dn,null);P&&(o=P)}let f=Es(d.componentType??{}),g=ZE(this._lContainer,f?.id??null),E=g?.firstChild??null,v=d.create(h,i,E,o,s,a);return this.insertImpl(v.hostView,l,Ou(this._hostTNode,g)),v}insert(e,t){return this.insertImpl(e,t,!0)}insertImpl(e,t,r){let i=e._lView;if(UL(i)){let a=this.indexOf(e);if(a!==-1)this.detach(a);else{let c=i[Ht],l=new _k(c,c[Vn],c[Ht]);l.detach(l.indexOf(e))}}let o=this._adjustIndex(t),s=this._lContainer;return Af(s,i,o,r),e.attachToViewContainerRef(),bS(pA(s),o,e),e}move(e,t){return this.insert(e,t)}indexOf(e){let t=MP(this._lContainer);return t!==null?t.indexOf(e):-1}remove(e){let t=this._adjustIndex(e,-1),r=_f(this._lContainer,t);r&&(nf(pA(this._lContainer),t),__(r[pe],r))}detach(e){let t=this._adjustIndex(e,-1),r=_f(this._lContainer,t);return r&&nf(pA(this._lContainer),t)!=null?new Ss(r):null}_adjustIndex(e,t=0){return e??this.length+t}};function MP(n){return n[af]}function pA(n){return n[af]||(n[af]=[])}function Tk(n,e){let t,r=e[n.index];return Qr(r)?t=r:(t=ok(r,e,null,n),e[n.index]=t,vC(e,t)),pq(t,e,n,r),new _k(t,n,e)}function fq(n,e){let t=n[ze],r=t.createComment(""),i=ur(e,n),o=t.parentNode(i);return XE(t,o,r,t.nextSibling(i),!1),r}var pq=Eq,gq=()=>!1;function mq(n,e,t){return gq(n,e,t)}function Eq(n,e,t,r){if(n[Ts])return;let i;t.type&8?i=Lr(r):i=fq(e,t),n[Ts]=i}var $A=class n{queryList;matches=null;constructor(e){this.queryList=e}clone(){return new n(this.queryList)}setDirty(){this.queryList.setDirty()}},WA=class n{queries;constructor(e=[]){this.queries=e}createEmbeddedView(e){let t=e.queries;if(t!==null){let r=e.contentQueries!==null?e.contentQueries[0]:t.length,i=[];for(let o=0;o<r;o++){let s=t.getByIndex(o),a=this.queries[s.indexInDeclarationView];i.push(a.clone())}return new n(i)}return null}insertView(e){this.dirtyQueriesWithMatches(e)}detachView(e){this.dirtyQueriesWithMatches(e)}finishViewCreation(e){this.dirtyQueriesWithMatches(e)}dirtyQueriesWithMatches(e){for(let t=0;t<this.queries.length;t++)BC(e,t).matches!==null&&this.queries[t].setDirty()}},r_=class{flags;read;predicate;constructor(e,t,r=null){this.flags=t,this.read=r,typeof e=="string"?this.predicate=Sq(e):this.predicate=e}},zA=class n{queries;constructor(e=[]){this.queries=e}elementStart(e,t){for(let r=0;r<this.queries.length;r++)this.queries[r].elementStart(e,t)}elementEnd(e){for(let t=0;t<this.queries.length;t++)this.queries[t].elementEnd(e)}embeddedTView(e){let t=null;for(let r=0;r<this.length;r++){let i=t!==null?t.length:0,o=this.getByIndex(r).embeddedTView(e,i);o&&(o.indexInDeclarationView=r,t!==null?t.push(o):t=[o])}return t!==null?new n(t):null}template(e,t){for(let r=0;r<this.queries.length;r++)this.queries[r].template(e,t)}getByIndex(e){return this.queries[e]}get length(){return this.queries.length}track(e){this.queries.push(e)}},qA=class n{metadata;matches=null;indexInDeclarationView=-1;crossesNgTemplate=!1;_declarationNodeIndex;_appliesToNextNode=!0;constructor(e,t=-1){this.metadata=e,this._declarationNodeIndex=t}elementStart(e,t){this.isApplyingToNode(t)&&this.matchTNode(e,t)}elementEnd(e){this._declarationNodeIndex===e.index&&(this._appliesToNextNode=!1)}template(e,t){this.elementStart(e,t)}embeddedTView(e,t){return this.isApplyingToNode(e)?(this.crossesNgTemplate=!0,this.addMatch(-e.index,t),new n(this.metadata)):null}isApplyingToNode(e){if(this._appliesToNextNode&&(this.metadata.flags&1)!==1){let t=this._declarationNodeIndex,r=e.parent;for(;r!==null&&r.type&8&&r.index!==t;)r=r.parent;return t===(r!==null?r.index:-1)}return this._appliesToNextNode}matchTNode(e,t){let r=this.metadata.predicate;if(Array.isArray(r))for(let i=0;i<r.length;i++){let o=r[i];this.matchTNodeWithReadOption(e,t,_q(t,o)),this.matchTNodeWithReadOption(e,t,GE(t,e,o,!1,!1))}else r===Fi?t.type&4&&this.matchTNodeWithReadOption(e,t,-1):this.matchTNodeWithReadOption(e,t,GE(t,e,r,!1,!1))}matchTNodeWithReadOption(e,t,r){if(r!==null){let i=this.metadata.read;if(i!==null)if(i===As||i===Bi||i===Fi&&t.type&4)this.addMatch(t.index,-2);else{let o=GE(t,e,i,!1,!1);o!==null&&this.addMatch(t.index,o)}else this.addMatch(t.index,r)}}addMatch(e,t){this.matches===null?this.matches=[e,t]:this.matches.push(e,t)}};function _q(n,e){let t=n.localNames;if(t!==null){for(let r=0;r<t.length;r+=2)if(t[r]===e)return t[r+1]}return null}function Tq(n,e){return n.type&11?Bu(n,e):n.type&4?v_(n,e):null}function Iq(n,e,t,r){return t===-1?Tq(e,n):t===-2?yq(n,e,r):mf(n,n[pe],t,e)}function yq(n,e,t){if(t===As)return Bu(e,n);if(t===Fi)return v_(e,n);if(t===Bi)return Tk(e,n)}function Ik(n,e,t,r){let i=e[bi].queries[r];if(i.matches===null){let o=n.data,s=t.matches,a=[];for(let c=0;s!==null&&c<s.length;c+=2){let l=s[c];if(l<0)a.push(null);else{let d=o[l];a.push(Iq(e,d,s[c+1],t.metadata.read))}}i.matches=a}return i.matches}function KA(n,e,t,r){let i=n.queries.getByIndex(t),o=i.matches;if(o!==null){let s=Ik(n,e,i,t);for(let a=0;a<o.length;a+=2){let c=o[a];if(c>0)r.push(s[a/2]);else{let l=o[a+1],d=e[-c];for(let h=Rt;h<d.length;h++){let f=d[h];f[_s]===f[Ht]&&KA(f[pe],f,l,r)}if(d[sc]!==null){let h=d[sc];for(let f=0;f<h.length;f++){let g=h[f];KA(g[pe],g,l,r)}}}}}return r}function VC(n,e){return n[bi].queries[e].queryList}function yk(n,e,t){let r=new YE((t&4)===4);return GL(n,e,r,r.destroy),(e[bi]??=new WA).queries.push(new $A(r))-1}function vk(n,e,t){let r=Ke();return r.firstCreatePass&&(Sk(r,new r_(n,e,t),-1),(e&2)===2&&(r.staticViewQueries=!0)),yk(r,ne(),e)}function vq(n,e,t,r){let i=Ke();if(i.firstCreatePass){let o=$t();Sk(i,new r_(e,t,r),o.index),Aq(i,n),(t&2)===2&&(i.staticContentQueries=!0)}return yk(i,ne(),t)}function Sq(n){return n.split(",").map(e=>e.trim())}function Sk(n,e,t){n.queries===null&&(n.queries=new zA),n.queries.track(new qA(e,t))}function Aq(n,e){let t=n.contentQueries||(n.contentQueries=[]),r=t.length?t[t.length-1]:-1;e!==r&&t.push(n.queries.length-1,e)}function BC(n,e){return n.queries.getByIndex(e)}function Ak(n,e){let t=n[pe],r=BC(t,e);return r.crossesNgTemplate?KA(t,n,e,[]):Ik(t,n,r,e)}function Ck(n,e,t){let r,i=Kh(()=>{r._dirtyCounter();let o=Dq(r,n);if(e&&o===void 0)throw new J(-951,!1);return o});return r=i[nn],r._dirtyCounter=dc(0),r._flatValue=void 0,i}function Dk(n){return Ck(!0,!1,n)}function Rk(n){return Ck(!0,!0,n)}function Cq(n,e){let t=n[nn];t._lView=ne(),t._queryIndex=e,t._queryList=VC(t._lView,e),t._queryList.onDirty(()=>t._dirtyCounter.update(r=>r+1))}function Dq(n,e){let t=n._lView,r=n._queryIndex;if(t===void 0||r===void 0||t[Te]&4)return e?void 0:Cn;let i=VC(t,r),o=Ak(t,r);return i.reset(o,ox),e?i.first:i._changesDetected||n._flatValue===void 0?n._flatValue=i.toArray():n._flatValue}function Nk(n){let e=[],t=new Map;function r(i){let o=t.get(i);if(!o){let s=n(i);t.set(i,o=s.then(a=>Nq(i,a)))}return o}return i_.forEach((i,o)=>{let s=[];i.templateUrl&&s.push(r(i.templateUrl).then(l=>{i.template=l}));let a=typeof i.styles=="string"?[i.styles]:i.styles||[];if(i.styles=a,i.styleUrl&&i.styleUrls?.length)throw new Error("@Component cannot define both `styleUrl` and `styleUrls`. Use `styleUrl` if the component has one stylesheet, or `styleUrls` if it has multiple");if(i.styleUrls?.length){let l=i.styles.length,d=i.styleUrls;i.styleUrls.forEach((h,f)=>{a.push(""),s.push(r(h).then(g=>{a[l+f]=g,d.splice(d.indexOf(h),1),d.length==0&&(i.styleUrls=void 0)}))})}else i.styleUrl&&s.push(r(i.styleUrl).then(l=>{a.push(l),i.styleUrl=void 0}));let c=Promise.all(s).then(()=>wq(o));e.push(c)}),wk(),Promise.all(e).then(()=>{})}var i_=new Map,Rq=new Set;function wk(){let n=i_;return i_=new Map,n}function bk(){return i_.size===0}function Nq(n,e){return typeof e=="string"?e:e.status!==void 0&&e.status!==200?Promise.reject(new J(918,!1)):e.text()}function wq(n){Rq.delete(n)}var mc=class{},Ok=class{};function Mk(n,e){return new xu(n,e??null,[])}var xu=class extends mc{ngModuleType;_parent;_bootstrapComponents=[];_r3Injector;instance;destroyCbs=[];componentFactoryResolver=new t_(this);constructor(e,t,r,i=!0){super(),this.ngModuleType=e,this._parent=t;let o=wL(e);this._bootstrapComponents=T8(o.bootstrap),this._r3Injector=aA(e,t,[{provide:mc,useValue:this},{provide:Cf,useValue:this.componentFactoryResolver},...r],Io(e),new Set(["environment"])),i&&this.resolveInjectorInitializers()}resolveInjectorInitializers(){this._r3Injector.resolveInjectorInitializers(),this.instance=this._r3Injector.get(this.ngModuleType)}get injector(){return this._r3Injector}destroy(){let e=this._r3Injector;!e.destroyed&&e.destroy(),this.destroyCbs.forEach(t=>t()),this.destroyCbs=null}onDestroy(e){this.destroyCbs.push(e)}},o_=class extends Ok{moduleType;constructor(e){super(),this.moduleType=e}create(e){return new xu(this.moduleType,e,[])}};function Lk(n,e,t){return new xu(n,e,t,!1)}var s_=class extends mc{injector;componentFactoryResolver=new t_(this);instance=null;constructor(e){super();let t=new Za([...e.providers,{provide:mc,useValue:this},{provide:Cf,useValue:this.componentFactoryResolver}],e.parent||Eu(),e.debugName,new Set(["environment"]));this.injector=t,e.runEnvironmentInitializers&&t.resolveInjectorInitializers()}destroy(){this.injector.destroy()}onDestroy(e){this.injector.onDestroy(e)}};function Pk(n,e,t=null){return new s_({providers:n,parent:e,debugName:t,runEnvironmentInitializers:!0}).injector}var bq=(()=>{class n{_injector;cachedInjectors=new Map;constructor(t){this._injector=t}getOrCreateStandaloneInjector(t){if(!t.standalone)return null;if(!this.cachedInjectors.has(t)){let r=PS(!1,t.type),i=r.length>0?Pk([r],this._injector,`Standalone[${t.type.name}]`):null;this.cachedInjectors.set(t,i)}return this.cachedInjectors.get(t)}ngOnDestroy(){try{for(let t of this.cachedInjectors.values())t!==null&&t.destroy()}finally{this.cachedInjectors.clear()}}static \u0275prov=Q({token:n,providedIn:"environment",factory:()=>new n(H(Dn))})}return n})();function Oq(n){return Vu(()=>{let e=kk(n),t=ye($({},e),{decls:n.decls,vars:n.vars,template:n.template,consts:n.consts||null,ngContentSelectors:n.ngContentSelectors,onPush:n.changeDetection===lC.OnPush,directiveDefs:null,pipeDefs:null,dependencies:e.standalone&&n.dependencies||null,getStandaloneInjector:e.standalone?i=>i.get(bq).getOrCreateStandaloneInjector(t):null,getExternalStyles:null,signals:n.signals??!1,data:n.data||{},encapsulation:n.encapsulation||Do.Emulated,styles:n.styles||Cn,_:null,schemas:n.schemas||null,tView:null,id:""});e.standalone&&Oo("NgStandalone"),Fk(t);let r=n.dependencies;return t.directiveDefs=a_(r,xk),t.pipeDefs=a_(r,LS),t.id=Pq(t),t})}function xk(n){return Es(n)||IE(n)}function Cs(n){return Vu(()=>({type:n.type,bootstrap:n.bootstrap||Cn,declarations:n.declarations||Cn,imports:n.imports||Cn,exports:n.exports||Cn,transitiveCompileScopes:null,schemas:n.schemas||null,id:n.id||null}))}function Mq(n,e){if(n==null)return Yr;let t={};for(let r in n)if(n.hasOwnProperty(r)){let i=n[r],o,s,a,c;Array.isArray(i)?(a=i[0],o=i[1],s=i[2]??o,c=i[3]||null):(o=i,s=i,a=m_.None,c=null),t[o]=[r,a,c],e[o]=s}return t}function Lq(n){if(n==null)return Yr;let e={};for(let t in n)n.hasOwnProperty(t)&&(e[n[t]]=t);return e}function Gi(n){return Vu(()=>{let e=kk(n);return Fk(e),e})}function Rf(n){return{type:n.type,name:n.name,factory:null,pure:n.pure!==!1,standalone:n.standalone??!0,onDestroy:n.type.prototype.ngOnDestroy||null}}function kk(n){let e={};return{type:n.type,providersResolver:null,factory:null,hostBindings:n.hostBindings||null,hostVars:n.hostVars||0,hostAttrs:n.hostAttrs||null,contentQueries:n.contentQueries||null,declaredInputs:e,inputConfig:n.inputs||Yr,exportAs:n.exportAs||null,standalone:n.standalone??!0,signals:n.signals===!0,selectors:n.selectors||Cn,viewQuery:n.viewQuery||null,features:n.features||null,setInput:null,resolveHostDirectives:null,hostDirectives:null,inputs:Mq(n.inputs,e),outputs:Lq(n.outputs),debugInfo:null}}function Fk(n){n.features?.forEach(e=>e(n))}function a_(n,e){return n?()=>{let t=typeof n=="function"?n():n,r=[];for(let i of t){let o=e(i);o!==null&&r.push(o)}return r}:null}function Pq(n){let e=0,t=typeof n.consts=="function"?"":n.consts,r=[n.selectors,n.ngContentSelectors,n.hostVars,n.hostAttrs,t,n.vars,n.decls,n.encapsulation,n.standalone,n.signals,n.exportAs,JSON.stringify(n.inputs),JSON.stringify(n.outputs),Object.getOwnPropertyNames(n.type.prototype),!!n.contentQueries,!!n.viewQuery];for(let o of r.join("|"))e=Math.imul(31,e)+o.charCodeAt(0)<<0;return e+=2147483648,"c"+e}function xq(n){return Object.getPrototypeOf(n.prototype).constructor}function Uk(n){let e=xq(n.type),t=!0,r=[n];for(;e;){let i;if(Jr(n))i=e.\u0275cmp||e.\u0275dir;else{if(e.\u0275cmp)throw new J(903,!1);i=e.\u0275dir}if(i){if(t){r.push(i);let s=n;s.inputs=gA(n.inputs),s.declaredInputs=gA(n.declaredInputs),s.outputs=gA(n.outputs);let a=i.hostBindings;a&&Bq(n,a);let c=i.viewQuery,l=i.contentQueries;if(c&&Uq(n,c),l&&Vq(n,l),kq(n,i),IL(n.outputs,i.outputs),Jr(i)&&i.data.animation){let d=n.data;d.animation=(d.animation||[]).concat(i.data.animation)}}let o=i.features;if(o)for(let s=0;s<o.length;s++){let a=o[s];a&&a.ngInherit&&a(n),a===Uk&&(t=!1)}}e=Object.getPrototypeOf(e)}Fq(r)}function kq(n,e){for(let t in e.inputs){if(!e.inputs.hasOwnProperty(t)||n.inputs.hasOwnProperty(t))continue;let r=e.inputs[t];r!==void 0&&(n.inputs[t]=r,n.declaredInputs[t]=e.declaredInputs[t])}}function Fq(n){let e=0,t=null;for(let r=n.length-1;r>=0;r--){let i=n[r];i.hostVars=e+=i.hostVars,i.hostAttrs=Nu(i.hostAttrs,t=Nu(t,i.hostAttrs))}}function gA(n){return n===Yr?{}:n===Cn?[]:n}function Uq(n,e){let t=n.viewQuery;t?n.viewQuery=(r,i)=>{e(r,i),t(r,i)}:n.viewQuery=e}function Vq(n,e){let t=n.contentQueries;t?n.contentQueries=(r,i,o)=>{e(r,i,o),t(r,i,o)}:n.contentQueries=e}function Bq(n,e){let t=n.hostBindings;t?n.hostBindings=(r,i)=>{e(r,i),t(r,i)}:n.hostBindings=e}function Gq(n){let e=t=>{let r=Array.isArray(n);t.hostDirectives===null?(t.resolveHostDirectives=jq,t.hostDirectives=r?n.map(YA):[n]):r?t.hostDirectives.unshift(...n.map(YA)):t.hostDirectives.unshift(n)};return e.ngInherit=!0,e}function jq(n){let e=[],t=!1,r=null,i=null;for(let o=0;o<n.length;o++){let s=n[o];if(s.hostDirectives!==null){let a=e.length;r??=new Map,i??=new Map,Vk(s,e,r),i.set(s,[a,e.length-1])}o===0&&Jr(s)&&(t=!0,e.push(s))}for(let o=t?1:0;o<n.length;o++)e.push(n[o]);return[e,r,i]}function Vk(n,e,t){if(n.hostDirectives!==null)for(let r of n.hostDirectives)if(typeof r=="function"){let i=r();for(let o of i)LP(YA(o),e,t)}else LP(r,e,t)}function LP(n,e,t){let r=IE(n.directive);Hq(r.declaredInputs,n.inputs),Vk(r,e,t),t.set(r,n),e.push(r)}function YA(n){return typeof n=="function"?{directive:jt(n),inputs:Yr,outputs:Yr}:{directive:jt(n.directive),inputs:PP(n.inputs),outputs:PP(n.outputs)}}function PP(n){if(n===void 0||n.length===0)return Yr;let e={};for(let t=0;t<n.length;t+=2)e[n[t]]=n[t+1];return e}function Hq(n,e){for(let t in e)if(e.hasOwnProperty(t)){let r=e[t],i=n[t];n[r]=i}}function Bk(n,e,t,r,i,o,s,a){if(t.firstCreatePass){n.mergedAttrs=Nu(n.mergedAttrs,n.attrs);let d=n.tView=IC(2,n,i,o,s,t.directiveRegistry,t.pipeRegistry,null,t.schemas,t.consts,null);t.queries!==null&&(t.queries.template(t,n),d.queries=t.queries.embeddedTView(n))}a&&(n.flags|=a),lc(n,!1);let c=Wq(t,e,n,r);bE()&&NC(t,e,c,n),wu(c,e);let l=ok(c,e,c,n);e[r+qe]=l,vC(e,l),mq(l,n,e)}function $q(n,e,t,r,i,o,s,a,c,l,d){let h=t+qe,f;return e.firstCreatePass?(f=Tc(e,h,4,s||null,a||null),CE()&&hk(e,n,f,dr(e.consts,l),bC),KP(e,f)):f=e.data[h],Bk(f,n,e,t,r,i,o,c),Iu(f)&&I_(e,n,f),l!=null&&vf(n,f,d),f}function ku(n,e,t,r,i,o,s,a,c,l,d){let h=t+qe,f;if(e.firstCreatePass){if(f=Tc(e,h,4,s||null,a||null),l!=null){let g=dr(e.consts,l);f.localNames=[];for(let E=0;E<g.length;E+=2)f.localNames.push(g[E],-1)}}else f=e.data[h];return Bk(f,n,e,t,r,i,o,c),l!=null&&vf(n,f,d),f}function Gk(n,e,t,r,i,o,s,a){let c=ne(),l=Ke(),d=dr(l.consts,o);return $q(c,l,n,e,t,r,i,d,void 0,s,a),Gk}function jk(n,e,t,r,i,o,s,a){let c=ne(),l=Ke(),d=dr(l.consts,o);return ku(c,l,n,e,t,r,i,d,void 0,s,a),jk}var Wq=zq;function zq(n,e,t,r){return hf(!0),e[ze].createComment("")}var D_=new z(""),ju=new z(""),Nf=(()=>{class n{_ngZone;registry;_isZoneStable=!0;_callbacks=[];_taskTrackingZone=null;_destroyRef;constructor(t,r,i){this._ngZone=t,this.registry=r,FS()&&(this._destroyRef=Y(Gn,{optional:!0})??void 0),GC||(Hk(i),i.addToWindow(r)),this._watchAngularEvents(),t.run(()=>{this._taskTrackingZone=typeof Zone>"u"?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){let t=this._ngZone.onUnstable.subscribe({next:()=>{this._isZoneStable=!1}}),r=this._ngZone.runOutsideAngular(()=>this._ngZone.onStable.subscribe({next:()=>{Ae.assertNotInAngularZone(),queueMicrotask(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}}));this._destroyRef?.onDestroy(()=>{t.unsubscribe(),r.unsubscribe()})}isStable(){return this._isZoneStable&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())queueMicrotask(()=>{for(;this._callbacks.length!==0;){let t=this._callbacks.pop();clearTimeout(t.timeoutId),t.doneCb()}});else{let t=this.getPendingTasks();this._callbacks=this._callbacks.filter(r=>r.updateCb&&r.updateCb(t)?(clearTimeout(r.timeoutId),!1):!0)}}getPendingTasks(){return this._taskTrackingZone?this._taskTrackingZone.macroTasks.map(t=>({source:t.source,creationLocation:t.creationLocation,data:t.data})):[]}addCallback(t,r,i){let o=-1;r&&r>0&&(o=setTimeout(()=>{this._callbacks=this._callbacks.filter(s=>s.timeoutId!==o),t()},r)),this._callbacks.push({doneCb:t,timeoutId:o,updateCb:i})}whenStable(t,r,i){if(i&&!this._taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/plugins/task-tracking" loaded?');this.addCallback(t,r,i),this._runCallbacksIfReady()}registerApplication(t){this.registry.registerApplication(t,this)}unregisterApplication(t){this.registry.unregisterApplication(t)}findProviders(t,r,i){return[]}static \u0275fac=function(r){return new(r||n)(H(Ae),H(wf),H(ju))};static \u0275prov=Q({token:n,factory:n.\u0275fac})}return n})(),wf=(()=>{class n{_applications=new Map;registerApplication(t,r){this._applications.set(t,r)}unregisterApplication(t){this._applications.delete(t)}unregisterAllApplications(){this._applications.clear()}getTestability(t){return this._applications.get(t)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(t,r=!0){return GC?.findTestabilityInTree(this,t,r)??null}static \u0275fac=function(r){return new(r||n)};static \u0275prov=Q({token:n,factory:n.\u0275fac,providedIn:"platform"})}return n})();function Hk(n){GC=n}var GC;function R_(n){return!!n&&typeof n.then=="function"}function jC(n){return!!n&&typeof n.subscribe=="function"}var $k=new z("");var HC=(()=>{class n{resolve;reject;initialized=!1;done=!1;donePromise=new Promise((t,r)=>{this.resolve=t,this.reject=r});appInits=Y($k,{optional:!0})??[];injector=Y(We);constructor(){}runInitializers(){if(this.initialized)return;let t=[];for(let i of this.appInits){let o=Ni(this.injector,i);if(R_(o))t.push(o);else if(jC(o)){let s=new Promise((a,c)=>{o.subscribe({complete:a,error:c})});t.push(s)}}let r=()=>{this.done=!0,this.resolve()};Promise.all(t).then(()=>{r()}).catch(i=>{this.reject(i)}),t.length===0&&r(),this.initialized=!0}static \u0275fac=function(r){return new(r||n)};static \u0275prov=Q({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),Wk=new z("");function zk(){rS(()=>{let n="";throw new J(600,n)})}function qk(n){return n.isBoundToModule}var qq=10;function $C(n,e){return Array.isArray(e)?e.reduce($C,n):$($({},n),e)}var Ds=(()=>{class n{_runningTick=!1;_destroyed=!1;_destroyListeners=[];_views=[];internalErrorHandler=Y(Li);afterRenderManager=Y(DC);zonelessEnabled=Y(Cu);rootEffectScheduler=Y(ff);dirtyFlags=0;tracingSnapshot=null;allTestViews=new Set;autoDetectTestViews=new Set;includeAllTestViews=!1;afterTick=new Ct;get allViews(){return[...(this.includeAllTestViews?this.allTestViews:this.autoDetectTestViews).keys(),...this._views]}get destroyed(){return this._destroyed}componentTypes=[];components=[];internalPendingTask=Y(vs);get isStable(){return this.internalPendingTask.hasPendingTasksObservable.pipe(De(t=>!t))}constructor(){Y(_c,{optional:!0})}whenStable(){let t;return new Promise(r=>{t=this.isStable.subscribe({next:i=>{i&&r()}})}).finally(()=>{t.unsubscribe()})}_injector=Y(Dn);_rendererFactory=null;get injector(){return this._injector}bootstrap(t,r){return this.bootstrapImpl(t,r)}bootstrapImpl(t,r,i=We.NULL){return this._injector.get(Ae).run(()=>{it(10);let s=t instanceof S_;if(!this._injector.get(HC).done){let E="";throw new J(405,E)}let c;s?c=t:c=this._injector.get(Cf).resolveComponentFactory(t),this.componentTypes.push(c.componentType);let l=qk(c)?void 0:this._injector.get(mc),d=r||c.selector,h=c.create(i,[],d,l),f=h.location.nativeElement,g=h.injector.get(D_,null);return g?.registerApplication(f),h.onDestroy(()=>{this.detachView(h.hostView),gf(this.components,h),g?.unregisterApplication(f)}),this._loadComponent(h),it(11,h),h})}tick(){this.zonelessEnabled||(this.dirtyFlags|=1),this._tick()}_tick(){it(12),this.tracingSnapshot!==null?this.tracingSnapshot.run(E_.CHANGE_DETECTION,this.tickImpl):this.tickImpl()}tickImpl=()=>{if(this._runningTick)throw new J(101,!1);let t=_e(null);try{this._runningTick=!0,this.synchronize()}finally{this._runningTick=!1,this.tracingSnapshot?.dispose(),this.tracingSnapshot=null,_e(t),this.afterTick.next(),it(13)}};synchronize(){this._rendererFactory===null&&!this._injector.destroyed&&(this._rendererFactory=this._injector.get(No,null,{optional:!0}));let t=0;for(;this.dirtyFlags!==0&&t++<qq;)it(14),this.synchronizeOnce(),it(15)}synchronizeOnce(){this.dirtyFlags&16&&(this.dirtyFlags&=-17,this.rootEffectScheduler.flush());let t=!1;if(this.dirtyFlags&7){let r=!!(this.dirtyFlags&1);this.dirtyFlags&=-8,this.dirtyFlags|=8;for(let{_lView:i}of this.allViews){if(!r&&!vu(i))continue;let o=r&&!this.zonelessEnabled?0:1;tk(i,o),t=!0}if(this.dirtyFlags&=-5,this.syncDirtyFlagsWithViews(),this.dirtyFlags&23)return}t||(this._rendererFactory?.begin?.(),this._rendererFactory?.end?.()),this.dirtyFlags&8&&(this.dirtyFlags&=-9,this.afterRenderManager.execute()),this.syncDirtyFlagsWithViews()}syncDirtyFlagsWithViews(){if(this.allViews.some(({_lView:t})=>vu(t))){this.dirtyFlags|=2;return}else this.dirtyFlags&=-8}attachView(t){let r=t;this._views.push(r),r.attachToAppRef(this)}detachView(t){let r=t;gf(this._views,r),r.detachFromAppRef()}_loadComponent(t){this.attachView(t.hostView);try{this.tick()}catch(i){this.internalErrorHandler(i)}this.components.push(t),this._injector.get(Wk,[]).forEach(i=>i(t))}ngOnDestroy(){if(!this._destroyed)try{this._destroyListeners.forEach(t=>t()),this._views.slice().forEach(t=>t.destroy())}finally{this._destroyed=!0,this._views=[],this._destroyListeners=[]}}onDestroy(t){return this._destroyListeners.push(t),()=>gf(this._destroyListeners,t)}destroy(){if(this._destroyed)throw new J(406,!1);let t=this._injector;t.destroy&&!t.destroyed&&t.destroy()}get viewCount(){return this._views.length}static \u0275fac=function(r){return new(r||n)};static \u0275prov=Q({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function gf(n,e){let t=n.indexOf(e);t>-1&&n.splice(t,1)}function Kk(n,e){let t=ne(),r=Mi();if(mn(t,r,e)){let i=Ke(),o=uc();if(y_(o,i,t,n,e))Ao(o)&&Kx(t,o.index);else{let a=ur(o,t);Yx(t[ze],a,null,o.value,n,e,null)}}return Kk}function Yk(n,e,t,r){let i=ne(),o=Mi();if(mn(i,o,e)){let s=Ke(),a=uc();f5(a,i,n,e,t,r)}return Yk}var AEe=typeof document<"u"&&typeof document?.documentElement?.getAnimations=="function";function Kq(){return ne()[Rn][Dt]}var XA=class{destroy(e){}updateValue(e,t){}swap(e,t){let r=Math.min(e,t),i=Math.max(e,t),o=this.detach(i);if(i-r>1){let s=this.detach(r);this.attach(r,o),this.attach(i,s)}else this.attach(r,o)}move(e,t){this.attach(t,this.detach(e))}};function mA(n,e,t,r,i){return n===t&&Object.is(e,r)?1:Object.is(i(n,e),i(t,r))?-1:0}function Yq(n,e,t){let r,i,o=0,s=n.length-1,a=void 0;if(Array.isArray(e)){let c=e.length-1;for(;o<=s&&o<=c;){let l=n.at(o),d=e[o],h=mA(o,l,o,d,t);if(h!==0){h<0&&n.updateValue(o,d),o++;continue}let f=n.at(s),g=e[c],E=mA(s,f,c,g,t);if(E!==0){E<0&&n.updateValue(s,g),s--,c--;continue}let v=t(o,l),S=t(s,f),P=t(o,d);if(Object.is(P,S)){let V=t(c,g);Object.is(V,v)?(n.swap(o,s),n.updateValue(s,g),c--,s--):n.move(s,o),n.updateValue(o,d),o++;continue}if(r??=new c_,i??=kP(n,o,s,t),QA(n,r,o,P))n.updateValue(o,d),o++,s++;else if(i.has(P))r.set(v,n.detach(o)),s--;else{let V=n.create(o,e[o]);n.attach(o,V),o++,s++}}for(;o<=c;)xP(n,r,t,o,e[o]),o++}else if(e!=null){let c=e[Symbol.iterator](),l=c.next();for(;!l.done&&o<=s;){let d=n.at(o),h=l.value,f=mA(o,d,o,h,t);if(f!==0)f<0&&n.updateValue(o,h),o++,l=c.next();else{r??=new c_,i??=kP(n,o,s,t);let g=t(o,h);if(QA(n,r,o,g))n.updateValue(o,h),o++,s++,l=c.next();else if(!i.has(g))n.attach(o,n.create(o,h)),o++,s++,l=c.next();else{let E=t(o,d);r.set(E,n.detach(o)),s--}}}for(;!l.done;)xP(n,r,t,n.length,l.value),l=c.next()}for(;o<=s;)n.destroy(n.detach(s--));r?.forEach(c=>{n.destroy(c)})}function QA(n,e,t,r){return e!==void 0&&e.has(r)?(n.attach(t,e.get(r)),e.delete(r),!0):!1}function xP(n,e,t,r,i){if(QA(n,e,r,t(r,i)))n.updateValue(r,i);else{let o=n.create(r,i);n.attach(r,o)}}function kP(n,e,t,r){let i=new Set;for(let o=e;o<=t;o++)i.add(r(o,n.at(o)));return i}var c_=class{kvMap=new Map;_vMap=void 0;has(e){return this.kvMap.has(e)}delete(e){if(!this.has(e))return!1;let t=this.kvMap.get(e);return this._vMap!==void 0&&this._vMap.has(t)?(this.kvMap.set(e,this._vMap.get(t)),this._vMap.delete(t)):this.kvMap.delete(e),!0}get(e){return this.kvMap.get(e)}set(e,t){if(this.kvMap.has(e)){let r=this.kvMap.get(e);this._vMap===void 0&&(this._vMap=new Map);let i=this._vMap;for(;i.has(r);)r=i.get(r);i.set(r,t)}else this.kvMap.set(e,t)}forEach(e){for(let[t,r]of this.kvMap)if(e(r,t),this._vMap!==void 0){let i=this._vMap;for(;i.has(r);)r=i.get(r),e(r,t)}}};function Xq(n,e,t,r,i,o,s,a){Oo("NgControlFlow");let c=ne(),l=Ke(),d=dr(l.consts,o);return ku(c,l,n,e,t,r,i,d,256,s,a),WC}function WC(n,e,t,r,i,o,s,a){Oo("NgControlFlow");let c=ne(),l=Ke(),d=dr(l.consts,o);return ku(c,l,n,e,t,r,i,d,512,s,a),WC}function Qq(n,e){Oo("NgControlFlow");let t=ne(),r=Mi(),i=t[r]!==on?t[r]:-1,o=i!==-1?l_(t,qe+i):void 0,s=0;if(mn(t,r,n)){let a=_e(null);try{if(o!==void 0&&ak(o,s),n!==-1){let c=qe+n,l=l_(t,c),d=tC(t[pe],c),h=lk(l,d,t),f=Sf(t,d,e,{dehydratedView:h});Af(l,f,s,Ou(d,h))}}finally{_e(a)}}else if(o!==void 0){let a=sk(o,s);a!==void 0&&(a[Dt]=e)}}var JA=class{lContainer;$implicit;$index;constructor(e,t,r){this.lContainer=e,this.$implicit=t,this.$index=r}get $count(){return this.lContainer.length-Rt}};function Jq(n){return n}function Zq(n,e){return e}var ZA=class{hasEmptyBlock;trackByFn;liveCollection;constructor(e,t,r){this.hasEmptyBlock=e,this.trackByFn=t,this.liveCollection=r}};function e9(n,e,t,r,i,o,s,a,c,l,d,h,f){Oo("NgControlFlow");let g=ne(),E=Ke(),v=c!==void 0,S=ne(),P=a?s.bind(S[Rn][Dt]):s,V=new ZA(v,P);S[qe+n]=V,ku(g,E,n+1,e,t,r,i,dr(E.consts,o),256),v&&ku(g,E,n+2,c,l,d,h,dr(E.consts,f),512)}var eC=class extends XA{lContainer;hostLView;templateTNode;operationsCounter=void 0;needsIndexUpdate=!1;constructor(e,t,r){super(),this.lContainer=e,this.hostLView=t,this.templateTNode=r}get length(){return this.lContainer.length-Rt}at(e){return this.getLView(e)[Dt].$implicit}attach(e,t){let r=t[tc];this.needsIndexUpdate||=e!==this.length,Af(this.lContainer,t,e,Ou(this.templateTNode,r)),n9(this.lContainer,e)}detach(e){return this.needsIndexUpdate||=e!==this.length-1,r9(this.lContainer,e),i9(this.lContainer,e)}create(e,t){let r=ZE(this.lContainer,this.templateTNode.tView.ssrId),i=Sf(this.hostLView,this.templateTNode,new JA(this.lContainer,t,e),{dehydratedView:r});return this.operationsCounter?.recordCreate(),i}destroy(e){__(e[pe],e),this.operationsCounter?.recordDestroy()}updateValue(e,t){this.getLView(e)[Dt].$implicit=t}reset(){this.needsIndexUpdate=!1,this.operationsCounter?.reset()}updateIndexes(){if(this.needsIndexUpdate)for(let e=0;e<this.length;e++)this.getLView(e)[Dt].$index=e}getLView(e){return o9(this.lContainer,e)}};function t9(n){let e=_e(null),t=hr();try{let r=ne(),i=r[pe],o=r[t],s=t+1,a=l_(r,s);if(o.liveCollection===void 0){let l=tC(i,s);o.liveCollection=new eC(a,r,l)}else o.liveCollection.reset();let c=o.liveCollection;if(Yq(c,n,o.trackByFn),c.updateIndexes(),o.hasEmptyBlock){let l=Mi(),d=c.length===0;if(mn(r,l,d)){let h=t+2,f=l_(r,h);if(d){let g=tC(i,h),E=lk(f,g,r),v=Sf(r,g,void 0,{dehydratedView:E});Af(f,v,0,Ou(g,E))}else i.firstUpdatePass&&U5(f),ak(f,0)}}}finally{_e(e)}}function l_(n,e){return n[e]}function n9(n,e){if(n.length<=Rt)return;let t=Rt+e,r=n[t],i=r?r[oc]:void 0;if(r&&i&&i.detachedLeaveAnimationFns&&i.detachedLeaveAnimationFns.length>0){let o=r[vo];z8(o,i),gc.delete(r),i.detachedLeaveAnimationFns=void 0}}function r9(n,e){if(n.length<=Rt)return;let t=Rt+e,r=n[t],i=r?r[oc]:void 0;i&&i.leave&&i.leave.size>0&&(i.detachedLeaveAnimationFns=[])}function i9(n,e){return _f(n,e)}function o9(n,e){return sk(n,e)}function tC(n,e){return cf(n,e)}function Xk(n,e,t){let r=ne(),i=Mi();if(mn(r,i,e)){let o=Ke(),s=uc();zx(s,r,n,e,r[ze],t)}return Xk}function nC(n,e,t,r,i){y_(e,n,t,i?"class":"style",r)}function zC(n,e,t,r){let i=ne(),o=i[pe],s=n+qe,a=o.firstCreatePass?xC(s,i,2,e,bC,CE(),t,r):o.data[s];if(OC(a,i,n,e,Zk),Iu(a)){let c=i[pe];I_(c,i,a),hC(c,a,i)}return r!=null&&vf(i,a),zC}function qC(){let n=Ke(),e=$t(),t=MC(e);return n.firstCreatePass&&kC(n,t),XS(t)&&QS(),KS(),t.classesWithoutHost!=null&&lz(t)&&nC(n,t,ne(),t.classesWithoutHost,!0),t.stylesWithoutHost!=null&&uz(t)&&nC(n,t,ne(),t.stylesWithoutHost,!1),qC}function Qk(n,e,t,r){return zC(n,e,t,r),qC(),Qk}function KC(n,e,t,r){let i=ne(),o=i[pe],s=n+qe,a=o.firstCreatePass?Z5(s,o,2,e,t,r):o.data[s];return OC(a,i,n,e,Zk),r!=null&&vf(i,a),KC}function YC(){let n=$t(),e=MC(n);return XS(e)&&QS(),KS(),YC}function Jk(n,e,t,r){return KC(n,e,t,r),YC(),Jk}var Zk=(n,e,t,r,i)=>(hf(!0),Sx(e[ze],r,sA()));function XC(n,e,t){let r=ne(),i=r[pe],o=n+qe,s=i.firstCreatePass?xC(o,r,8,"ng-container",bC,CE(),e,t):i.data[o];if(OC(s,r,n,"ng-container",s9),Iu(s)){let a=r[pe];I_(a,r,s),hC(a,s,r)}return t!=null&&vf(r,s),XC}function QC(){let n=Ke(),e=$t(),t=MC(e);return n.firstCreatePass&&kC(n,t),QC}function e1(n,e,t){return XC(n,e,t),QC(),e1}var s9=(n,e,t,r,i)=>(hf(!0),c8(e[ze],""));function a9(){return ne()}function t1(n,e,t){let r=ne(),i=Mi();if(mn(r,i,e)){let o=Ke(),s=uc();qx(s,r,n,e,r[ze],t)}return t1}var kE=void 0;function c9(n){let e=Math.floor(Math.abs(n)),t=n.toString().replace(/^[^.]*\.?/,"").length;return e===1&&t===0?1:5}var l9=["en",[["a","p"],["AM","PM"]],[["AM","PM"]],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],kE,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],kE,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",kE,"{1} 'at' {0}",kE],[".",",",";","%","+","-","E","\xD7","\u2030","\u221E","NaN",":"],["#,##0.###","#,##0%","\xA4#,##0.00","#E0"],"USD","$","US Dollar",{},"ltr",c9],EA={};function pr(n){let e=u9(n),t=FP(e);if(t)return t;let r=e.split("-")[0];if(t=FP(r),t)return t;if(r==="en")return l9;throw new J(701,!1)}function FP(n){if(!(n in EA)){let e=Lt.ng&&Lt.ng.common&&Lt.ng.common.locales&&Lt.ng.common.locales[n];return e!==void 0&&(EA[n]=e),e}return EA[n]}var bt=(function(n){return n[n.LocaleId=0]="LocaleId",n[n.DayPeriodsFormat=1]="DayPeriodsFormat",n[n.DayPeriodsStandalone=2]="DayPeriodsStandalone",n[n.DaysFormat=3]="DaysFormat",n[n.DaysStandalone=4]="DaysStandalone",n[n.MonthsFormat=5]="MonthsFormat",n[n.MonthsStandalone=6]="MonthsStandalone",n[n.Eras=7]="Eras",n[n.FirstDayOfWeek=8]="FirstDayOfWeek",n[n.WeekendRange=9]="WeekendRange",n[n.DateFormat=10]="DateFormat",n[n.TimeFormat=11]="TimeFormat",n[n.DateTimeFormat=12]="DateTimeFormat",n[n.NumberSymbols=13]="NumberSymbols",n[n.NumberFormats=14]="NumberFormats",n[n.CurrencyCode=15]="CurrencyCode",n[n.CurrencySymbol=16]="CurrencySymbol",n[n.CurrencyName=17]="CurrencyName",n[n.Currencies=18]="Currencies",n[n.Directionality=19]="Directionality",n[n.PluralCase=20]="PluralCase",n[n.ExtraData=21]="ExtraData",n})(bt||{});function u9(n){return n.toLowerCase().replace(/_/g,"-")}var bf="en-US";var d9=bf;function n1(n){typeof n=="string"&&(d9=n.toLowerCase().replace(/_/g,"-"))}function r1(n,e,t){let r=ne(),i=Ke(),o=$t();return o1(i,r,r[ze],o,n,e,t),r1}function i1(n,e,t){let r=ne(),i=Ke(),o=$t();return(o.type&3||t)&&gk(o,i,r,t,r[ze],n,e,HE(o,r,e)),i1}function o1(n,e,t,r,i,o,s){let a=!0,c=null;if((r.type&3||s)&&(c??=HE(r,e,o),gk(r,n,e,s,t,i,o,c)&&(a=!1)),a){let l=r.outputs?.[i],d=r.hostDirectiveOutputs?.[i];if(d&&d.length)for(let h=0;h<d.length;h+=2){let f=d[h],g=d[h+1];c??=HE(r,e,o),bP(r,e,f,g,i,c)}if(l&&l.length)for(let h of l)c??=HE(r,e,o),bP(r,e,h,i,i,c)}}function h9(n=1){return tP(n)}function f9(n,e){let t=null,r=C8(n);for(let i=0;i<e.length;i++){let o=e[i];if(o==="*"){t=i;continue}if(r===null?Nx(n,o,!0):N8(r,o))return i}return t}function p9(n){let e=ne()[Rn][Vn];if(!e.projection){let t=n?n.length:1,r=e.projection=RL(t,null),i=r.slice(),o=e.child;for(;o!==null;){if(o.type!==128){let s=n?f9(o,n):0;s!==null&&(i[s]?i[s].projectionNext=o:r[s]=o,i[s]=o)}o=o.next}}}function g9(n,e=0,t,r,i,o){let s=ne(),a=Ke(),c=r?n+1:null;c!==null&&ku(s,a,c,r,i,o,null,t);let l=Tc(a,qe+n,16,null,t||null);l.projection===null&&(l.projection=e),eA();let h=!s[tc]||YS();s[Rn][Vn].projection[l.projection]===null&&c!==null?m9(s,a,c):h&&!f_(l)&&r5(a,s,l)}function m9(n,e,t){let r=qe+t,i=e.data[r],o=n[r],s=ZE(o,i.tView.ssrId),a=Sf(n,i,void 0,{dehydratedView:s});Af(o,a,0,Ou(i,s))}function E9(n,e,t,r){vq(n,e,t,r)}function _9(n,e,t){vk(n,e,t)}function T9(n){let e=ne(),t=Ke(),r=RE();df(r+1);let i=BC(t,r);if(n.dirty&&FL(e)===((i.metadata.flags&2)===2)){if(i.matches===null)n.reset([]);else{let o=Ak(e,r);n.reset(o,ox),n.notifyOnChanges()}return!0}return!1}function I9(){return VC(ne(),RE())}function y9(n,e,t,r){Cq(n,vk(e,t,r))}function v9(n=1){df(RE()+n)}function S9(n){let e=tA();return cc(e,qe+n)}function FE(n,e){return n<<17|e<<2}function Ec(n){return n>>17&32767}function A9(n){return(n&2)==2}function C9(n,e){return n&131071|e<<17}function rC(n){return n|2}function Fu(n){return(n&131068)>>2}function _A(n,e){return n&-131069|e<<2}function D9(n){return(n&1)===1}function iC(n){return n|1}function R9(n,e,t,r,i,o){let s=o?e.classBindings:e.styleBindings,a=Ec(s),c=Fu(s);n[r]=t;let l=!1,d;if(Array.isArray(t)){let h=t;d=h[1],(d===null||mu(h,d)>0)&&(l=!0)}else d=t;if(i)if(c!==0){let f=Ec(n[a+1]);n[r+1]=FE(f,a),f!==0&&(n[f+1]=_A(n[f+1],r)),n[a+1]=C9(n[a+1],r)}else n[r+1]=FE(a,0),a!==0&&(n[a+1]=_A(n[a+1],r)),a=r;else n[r+1]=FE(c,0),a===0?a=r:n[c+1]=_A(n[c+1],r),c=r;l&&(n[r+1]=rC(n[r+1])),UP(n,d,r,!0),UP(n,d,r,!1),N9(e,d,n,r,o),s=FE(a,c),o?e.classBindings=s:e.styleBindings=s}function N9(n,e,t,r,i){let o=i?n.residualClasses:n.residualStyles;o!=null&&typeof e=="string"&&mu(o,e)>=0&&(t[r+1]=iC(t[r+1]))}function UP(n,e,t,r){let i=n[t+1],o=e===null,s=r?Ec(i):Fu(i),a=!1;for(;s!==0&&(a===!1||o);){let c=n[s],l=n[s+1];w9(c,e)&&(a=!0,n[s+1]=r?iC(l):rC(l)),s=r?Ec(l):Fu(l)}a&&(n[t+1]=r?rC(i):iC(i))}function w9(n,e){return n===null||e==null||(Array.isArray(n)?n[1]:n)===e?!0:Array.isArray(n)&&typeof e=="string"?mu(n,e)>=0:!1}var Wt={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function s1(n){return n.substring(Wt.key,Wt.keyEnd)}function b9(n){return n.substring(Wt.value,Wt.valueEnd)}function O9(n){return l1(n),a1(n,Uu(n,0,Wt.textEnd))}function a1(n,e){let t=Wt.textEnd;return t===e?-1:(e=Wt.keyEnd=L9(n,Wt.key=e,t),Uu(n,e,t))}function M9(n){return l1(n),c1(n,Uu(n,0,Wt.textEnd))}function c1(n,e){let t=Wt.textEnd,r=Wt.key=Uu(n,e,t);return t===r?-1:(r=Wt.keyEnd=P9(n,r,t),r=VP(n,r,t,58),r=Wt.value=Uu(n,r,t),r=Wt.valueEnd=x9(n,r,t),VP(n,r,t,59))}function l1(n){Wt.key=0,Wt.keyEnd=0,Wt.value=0,Wt.valueEnd=0,Wt.textEnd=n.length}function Uu(n,e,t){for(;e<t&&n.charCodeAt(e)<=32;)e++;return e}function L9(n,e,t){for(;e<t&&n.charCodeAt(e)>32;)e++;return e}function P9(n,e,t){let r;for(;e<t&&((r=n.charCodeAt(e))===45||r===95||(r&-33)>=65&&(r&-33)<=90||r>=48&&r<=57);)e++;return e}function VP(n,e,t,r){return e=Uu(n,e,t),e<t&&e++,e}function x9(n,e,t){let r=-1,i=-1,o=-1,s=e,a=s;for(;s<t;){let c=n.charCodeAt(s++);if(c===59)return a;c===34||c===39?a=s=BP(n,c,s,t):e===s-4&&o===85&&i===82&&r===76&&c===40?a=s=BP(n,41,s,t):c>32&&(a=s),o=i,i=r,r=c&-33}return a}function BP(n,e,t,r){let i=-1,o=t;for(;o<r;){let s=n.charCodeAt(o++);if(s==e&&i!==92)return o;s==92&&i===92?i=0:i=s}throw new Error}function u1(n,e,t){return h1(n,e,t,!1),u1}function d1(n,e){return h1(n,e,null,!0),d1}function k9(n){f1(m1,F9,n,!1)}function F9(n,e){for(let t=M9(e);t>=0;t=c1(e,t))m1(n,s1(e),b9(e))}function U9(n){f1(W9,V9,n,!0)}function V9(n,e){for(let t=O9(e);t>=0;t=a1(e,t))rf(n,s1(e),!0)}function h1(n,e,t,r){let i=ne(),o=Ke(),s=uf(2);if(o.firstUpdatePass&&g1(o,n,s,r),e!==on&&mn(i,s,e)){let a=o.data[hr()];E1(o,a,i,i[ze],n,i[s+1]=q9(e,t),r,s)}}function f1(n,e,t,r){let i=Ke(),o=uf(2);i.firstUpdatePass&&g1(i,null,o,r);let s=ne();if(t!==on&&mn(s,o,t)){let a=i.data[hr()];if(_1(a,r)&&!p1(i,o)){let c=r?a.classesWithoutHost:a.stylesWithoutHost;c!==null&&(t=fE(c,t||"")),nC(i,a,s,t,r)}else z9(i,a,s,s[ze],s[o+1],s[o+1]=$9(n,e,t),r,o)}}function p1(n,e){return e>=n.expandoStartIndex}function g1(n,e,t,r){let i=n.data;if(i[t+1]===null){let o=i[hr()],s=p1(n,t);_1(o,r)&&e===null&&!s&&(e=!1),e=B9(i,o,e,r),R9(i,o,e,t,s,r)}}function B9(n,e,t,r){let i=QL(n),o=r?e.residualClasses:e.residualStyles;if(i===null)(r?e.classBindings:e.styleBindings)===0&&(t=TA(null,n,e,t,r),t=Tf(t,e.attrs,r),o=null);else{let s=e.directiveStylingLast;if(s===-1||n[s]!==i)if(t=TA(i,n,e,t,r),o===null){let c=G9(n,e,r);c!==void 0&&Array.isArray(c)&&(c=TA(null,n,e,c[1],r),c=Tf(c,e.attrs,r),j9(n,e,r,c))}else o=H9(n,e,r)}return o!==void 0&&(r?e.residualClasses=o:e.residualStyles=o),t}function G9(n,e,t){let r=t?e.classBindings:e.styleBindings;if(Fu(r)!==0)return n[Ec(r)]}function j9(n,e,t,r){let i=t?e.classBindings:e.styleBindings;n[Ec(i)]=r}function H9(n,e,t){let r,i=e.directiveEnd;for(let o=1+e.directiveStylingLast;o<i;o++){let s=n[o].hostAttrs;r=Tf(r,s,t)}return Tf(r,e.attrs,t)}function TA(n,e,t,r,i){let o=null,s=t.directiveEnd,a=t.directiveStylingLast;for(a===-1?a=t.directiveStart:a++;a<s&&(o=e[a],r=Tf(r,o.hostAttrs,i),o!==n);)a++;return n!==null&&(t.directiveStylingLast=a),r}function Tf(n,e,t){let r=t?1:2,i=-1;if(e!==null)for(let o=0;o<e.length;o++){let s=e[o];typeof s=="number"?i=s:i===r&&(Array.isArray(n)||(n=n===void 0?[]:["",n]),rf(n,s,t?!0:e[++o]))}return n===void 0?null:n}function $9(n,e,t){if(t==null||t==="")return Cn;let r=[],i=fr(t);if(Array.isArray(i))for(let o=0;o<i.length;o++)n(r,i[o],!0);else if(typeof i=="object")for(let o in i)i.hasOwnProperty(o)&&n(r,o,i[o]);else typeof i=="string"&&e(r,i);return r}function m1(n,e,t){rf(n,e,fr(t))}function W9(n,e,t){let r=String(e);r!==""&&!r.includes(" ")&&rf(n,r,t)}function z9(n,e,t,r,i,o,s,a){i===on&&(i=Cn);let c=0,l=0,d=0<i.length?i[0]:null,h=0<o.length?o[0]:null;for(;d!==null||h!==null;){let f=c<i.length?i[c+1]:void 0,g=l<o.length?o[l+1]:void 0,E=null,v;d===h?(c+=2,l+=2,f!==g&&(E=h,v=g)):h===null||d!==null&&d<h?(c+=2,E=d):(l+=2,E=h,v=g),E!==null&&E1(n,e,t,r,E,v,s,a),d=c<i.length?i[c]:null,h=l<o.length?o[l]:null}}function E1(n,e,t,r,i,o,s,a){if(!(e.type&3))return;let c=n.data,l=c[a+1],d=D9(l)?GP(c,e,t,i,Fu(l),s):void 0;if(!u_(d)){u_(o)||A9(l)&&(o=GP(c,null,t,i,a,s));let h=HS(hr(),t);o5(r,s,h,i,o)}}function GP(n,e,t,r,i,o){let s=e===null,a;for(;i>0;){let c=n[i],l=Array.isArray(c),d=l?c[1]:c,h=d===null,f=t[i+1];f===on&&(f=h?Cn:void 0);let g=h?TE(f,r):d===r?f:void 0;if(l&&!u_(g)&&(g=TE(c,r)),u_(g)&&(a=g,s))return a;let E=n[i+1];i=s?Ec(E):Fu(E)}if(e!==null){let c=o?e.residualClasses:e.residualStyles;c!=null&&(a=TE(c,r))}return a}function u_(n){return n!==void 0}function q9(n,e){return n==null||n===""||(typeof e=="string"?n=n+e:typeof n=="object"&&(n=Io(fr(n)))),n}function _1(n,e){return(n.flags&(e?8:16))!==0}function K9(n,e=""){let t=ne(),r=Ke(),i=n+qe,o=r.firstCreatePass?Tc(r,i,1,e,null):r.data[i],s=Y9(r,t,o,e,n);t[i]=s,bE()&&NC(r,t,s,o),lc(o,!1)}var Y9=(n,e,t,r,i)=>(hf(!0),s8(e[ze],r));function T1(n,e,t,r=""){return mn(n,Mi(),t)?e+cr(t)+r:on}function X9(n,e,t,r,i,o=""){let s=rA(),a=Mu(n,s,t,i);return uf(2),a?e+cr(t)+r+cr(i)+o:on}function Q9(n,e,t,r,i,o,s,a=""){let c=rA(),l=UC(n,c,t,i,s);return uf(3),l?e+cr(t)+r+cr(i)+o+cr(s)+a:on}function I1(n){return JC("",n),I1}function JC(n,e,t){let r=ne(),i=T1(r,n,e,t);return i!==on&&ZC(r,hr(),i),JC}function y1(n,e,t,r,i){let o=ne(),s=X9(o,n,e,t,r,i);return s!==on&&ZC(o,hr(),s),y1}function v1(n,e,t,r,i,o,s){let a=ne(),c=Q9(a,n,e,t,r,i,o,s);return c!==on&&ZC(a,hr(),c),v1}function ZC(n,e,t){let r=HS(e,n);a8(n[ze],r,t)}function S1(n,e,t){lA(e)&&(e=e());let r=ne(),i=Mi();if(mn(r,i,e)){let o=Ke(),s=uc();zx(s,r,n,e,r[ze],t)}return S1}function J9(n,e){let t=lA(n);return t&&n.set(e),t}function A1(n,e){let t=ne(),r=Ke(),i=$t();return o1(r,t,t[ze],i,n,e),A1}var C1={};function D1(n){let e=Ke(),t=ne(),r=n+qe,i=Tc(e,r,128,null,null);return lc(i,!1),lf(e,t,r,C1),D1}function Z9(n){Oo("NgLet");let e=Ke(),t=ne(),r=hr();return lf(e,t,r,n),n}function eK(n){let e=tA(),t=cc(e,qe+n);if(t===C1)throw new J(314,!1);return t}function tK(n){return mn(ne(),Mi(),n)?cr(n):on}function nK(n,e,t=""){return T1(ne(),n,e,t)}function rK(n,e,t){let r=Ke();if(r.firstCreatePass){let i=Jr(n);oC(t,r.data,r.blueprint,i,!0),oC(e,r.data,r.blueprint,i,!1)}}function oC(n,e,t,r,i){if(n=jt(n),Array.isArray(n))for(let o=0;o<n.length;o++)oC(n[o],e,t,r,i);else{let o=Ke(),s=ne(),a=$t(),c=Ja(n)?n:jt(n.provide),l=kS(n),d=a.providerIndexes&1048575,h=a.directiveStart,f=a.providerIndexes>>20;if(Ja(n)||!n.multi){let g=new pc(l,i,ot,null),E=yA(c,e,i?d:d+f,h);E===-1?(SA(KE(a,s),o,c),IA(o,n,e.length),e.push(c),a.directiveStart++,a.directiveEnd++,i&&(a.providerIndexes+=1048576),t.push(g),s.push(g)):(t[E]=g,s[E]=g)}else{let g=yA(c,e,d+f,h),E=yA(c,e,d,d+f),v=g>=0&&t[g],S=E>=0&&t[E];if(i&&!S||!i&&!v){SA(KE(a,s),o,c);let P=sK(i?oK:iK,t.length,i,r,l,n);!i&&S&&(t[E].providerFactory=P),IA(o,n,e.length,0),e.push(c),a.directiveStart++,a.directiveEnd++,i&&(a.providerIndexes+=1048576),t.push(P),s.push(P)}else{let P=R1(t[i?E:g],l,!i&&r);IA(o,n,g>-1?g:E,P)}!i&&r&&S&&t[E].componentProviders++}}}function IA(n,e,t,r){let i=Ja(e),o=LL(e);if(i||o){let c=(o?jt(e.useClass):e).prototype.ngOnDestroy;if(c){let l=n.destroyHooks||(n.destroyHooks=[]);if(!i&&e.multi){let d=l.indexOf(t);d===-1?l.push(t,[r,c]):l[d+1].push(r,c)}else l.push(t,c)}}}function R1(n,e,t){return t&&n.componentProviders++,n.multi.push(e)-1}function yA(n,e,t,r){for(let i=t;i<r;i++)if(e[i]===n)return i;return-1}function iK(n,e,t,r,i){return sC(this.multi,[])}function oK(n,e,t,r,i){let o=this.multi,s;if(this.providerFactory){let a=this.providerFactory.componentProviders,c=mf(r,r[pe],this.providerFactory.index,i);s=c.slice(0,a),sC(o,s);for(let l=a;l<c.length;l++)s.push(c[l])}else s=[],sC(o,s);return s}function sC(n,e){for(let t=0;t<n.length;t++){let r=n[t];e.push(r())}return e}function sK(n,e,t,r,i,o){let s=new pc(n,t,ot,null);return s.multi=[],s.index=e,s.componentProviders=0,R1(s,i,r&&!t),s}function aK(n,e=[]){return t=>{t.providersResolver=(r,i)=>rK(r,i?i(n):n,e)}}function cK(n,e,t){let r=n.\u0275cmp;r.directiveDefs=a_(e,xk),r.pipeDefs=a_(t,LS)}function lK(n,e,t){let r=Bn()+n,i=ne();return i[r]===on?Vi(i,r,t?e.call(t):e()):Df(i,r)}function uK(n,e,t,r){return N1(ne(),Bn(),n,e,t,r)}function dK(n,e,t,r,i){return w1(ne(),Bn(),n,e,t,r,i)}function hK(n,e,t,r,i,o){return b1(ne(),Bn(),n,e,t,r,i,o)}function fK(n,e,t,r,i,o,s){return TK(ne(),Bn(),n,e,t,r,i,o,s)}function pK(n,e,t,r,i,o,s,a){let c=Bn()+n,l=ne(),d=Lu(l,c,t,r,i,o);return mn(l,c+4,s)||d?Vi(l,c+5,a?e.call(a,t,r,i,o,s):e(t,r,i,o,s)):Df(l,c+5)}function gK(n,e,t,r,i,o,s,a,c){let l=Bn()+n,d=ne(),h=Lu(d,l,t,r,i,o);return Mu(d,l+4,s,a)||h?Vi(d,l+6,c?e.call(c,t,r,i,o,s,a):e(t,r,i,o,s,a)):Df(d,l+6)}function mK(n,e,t,r,i,o,s,a,c,l){let d=Bn()+n,h=ne(),f=Lu(h,d,t,r,i,o);return UC(h,d+4,s,a,c)||f?Vi(h,d+7,l?e.call(l,t,r,i,o,s,a,c):e(t,r,i,o,s,a,c)):Df(h,d+7)}function EK(n,e,t,r,i,o,s,a,c,l,d){let h=Bn()+n,f=ne(),g=Lu(f,h,t,r,i,o);return Lu(f,h+4,s,a,c,l)||g?Vi(f,h+8,d?e.call(d,t,r,i,o,s,a,c,l):e(t,r,i,o,s,a,c,l)):Df(f,h+8)}function _K(n,e,t,r){return O1(ne(),Bn(),n,e,t,r)}function Of(n,e){let t=n[e];return t===on?void 0:t}function N1(n,e,t,r,i,o){let s=e+t;return mn(n,s,i)?Vi(n,s+1,o?r.call(o,i):r(i)):Of(n,s+1)}function w1(n,e,t,r,i,o,s){let a=e+t;return Mu(n,a,i,o)?Vi(n,a+2,s?r.call(s,i,o):r(i,o)):Of(n,a+2)}function b1(n,e,t,r,i,o,s,a){let c=e+t;return UC(n,c,i,o,s)?Vi(n,c+3,a?r.call(a,i,o,s):r(i,o,s)):Of(n,c+3)}function TK(n,e,t,r,i,o,s,a,c){let l=e+t;return Lu(n,l,i,o,s,a)?Vi(n,l+4,c?r.call(c,i,o,s,a):r(i,o,s,a)):Of(n,l+4)}function O1(n,e,t,r,i,o){let s=e+t,a=!1;for(let c=0;c<i.length;c++)mn(n,s++,i[c])&&(a=!0);return a?Vi(n,s,r.apply(o,i)):Of(n,s)}function IK(n,e){let t=Ke(),r,i=n+qe;t.firstCreatePass?(r=yK(e,t.pipeRegistry),t.data[i]=r,r.onDestroy&&(t.destroyHooks??=[]).push(i,r.onDestroy)):r=t.data[i];let o=r.factory||(r.factory=fs(r.type,!0)),s,a=Un(ot);try{let c=qE(!1),l=o();return qE(c),lf(t,ne(),i,l),l}finally{Un(a)}}function yK(n,e){if(e)for(let t=e.length-1;t>=0;t--){let r=e[t];if(n===r.name)return r}}function vK(n,e,t){let r=n+qe,i=ne(),o=cc(i,r);return N_(i,r)?N1(i,Bn(),e,o.transform,t,o):o.transform(t)}function SK(n,e,t,r){let i=n+qe,o=ne(),s=cc(o,i);return N_(o,i)?w1(o,Bn(),e,s.transform,t,r,s):s.transform(t,r)}function AK(n,e,t,r,i){let o=n+qe,s=ne(),a=cc(s,o);return N_(s,o)?b1(s,Bn(),e,a.transform,t,r,i,a):a.transform(t,r,i)}function CK(n,e,t){let r=n+qe,i=ne(),o=cc(i,r);return N_(i,r)?O1(i,Bn(),e,o.transform,t,o):o.transform.apply(o,t)}function N_(n,e){return n[pe].data[e].pure}function DK(n,e){return v_(n,e)}var UE=null;function M1(n){UE!==null&&(n.defaultEncapsulation!==UE.defaultEncapsulation||n.preserveWhitespaces!==UE.preserveWhitespaces)||(UE=n)}var L1=new z("");var RK=(()=>{class n{zone=Y(Ae);changeDetectionScheduler=Y(Or);applicationRef=Y(Ds);applicationErrorHandler=Y(Li);_onMicrotaskEmptySubscription;initialize(){this._onMicrotaskEmptySubscription||(this._onMicrotaskEmptySubscription=this.zone.onMicrotaskEmpty.subscribe({next:()=>{this.changeDetectionScheduler.runningTick||this.zone.run(()=>{try{this.applicationRef.dirtyFlags|=1,this.applicationRef._tick()}catch(t){this.applicationErrorHandler(t)}})}}))}ngOnDestroy(){this._onMicrotaskEmptySubscription?.unsubscribe()}static \u0275fac=function(r){return new(r||n)};static \u0275prov=Q({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function P1({ngZoneFactory:n,ignoreChangesOutsideZone:e,scheduleInRootZone:t}){return n??=()=>new Ae(ye($({},eD()),{scheduleInRootZone:t})),[{provide:Ae,useFactory:n},{provide:ms,multi:!0,useFactory:()=>{let r=Y(RK,{optional:!0});return()=>r.initialize()}},{provide:ms,multi:!0,useFactory:()=>{let r=Y(NK);return()=>{r.initialize()}}},e===!0?{provide:uA,useValue:!0}:[],{provide:OE,useValue:t??Mx},{provide:Li,useFactory:()=>{let r=Y(Ae),i=Y(Dn),o;return s=>{r.runOutsideAngular(()=>{i.destroyed&&!o?setTimeout(()=>{throw s}):(o??=i.get(ar),o.handleError(s))})}}}]}function eD(n){return{enableLongStackTrace:!1,shouldCoalesceEventChangeDetection:n?.eventCoalescing??!1,shouldCoalesceRunChangeDetection:n?.runCoalescing??!1}}var NK=(()=>{class n{subscription=new pt;initialized=!1;zone=Y(Ae);pendingTasks=Y(vs);initialize(){if(this.initialized)return;this.initialized=!0;let t=null;!this.zone.isStable&&!this.zone.hasPendingMacrotasks&&!this.zone.hasPendingMicrotasks&&(t=this.pendingTasks.add()),this.zone.runOutsideAngular(()=>{this.subscription.add(this.zone.onStable.subscribe(()=>{Ae.assertNotInAngularZone(),queueMicrotask(()=>{t!==null&&!this.zone.hasPendingMacrotasks&&!this.zone.hasPendingMicrotasks&&(this.pendingTasks.remove(t),t=null)})}))}),this.subscription.add(this.zone.onUnstable.subscribe(()=>{Ae.assertInAngularZone(),t??=this.pendingTasks.add()}))}ngOnDestroy(){this.subscription.unsubscribe()}static \u0275fac=function(r){return new(r||n)};static \u0275prov=Q({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var tD=(()=>{class n{applicationErrorHandler=Y(Li);appRef=Y(Ds);taskService=Y(vs);ngZone=Y(Ae);zonelessEnabled=Y(Cu);tracing=Y(_c,{optional:!0});disableScheduling=Y(uA,{optional:!0})??!1;zoneIsDefined=typeof Zone<"u"&&!!Zone.root.run;schedulerTickApplyArgs=[{data:{__scheduler_tick__:!0}}];subscriptions=new pt;angularZoneId=this.zoneIsDefined?this.ngZone._inner?.get(QE):null;scheduleInRootZone=!this.zonelessEnabled&&this.zoneIsDefined&&(Y(OE,{optional:!0})??!1);cancelScheduledCallback=null;useMicrotaskScheduler=!1;runningTick=!1;pendingRenderTaskId=null;constructor(){this.subscriptions.add(this.appRef.afterTick.subscribe(()=>{this.runningTick||this.cleanup()})),this.subscriptions.add(this.ngZone.onUnstable.subscribe(()=>{this.runningTick||this.cleanup()})),this.disableScheduling||=!this.zonelessEnabled&&(this.ngZone instanceof bu||!this.zoneIsDefined)}notify(t){if(!this.zonelessEnabled&&t===5)return;let r=!1;switch(t){case 0:{this.appRef.dirtyFlags|=2;break}case 3:case 2:case 4:case 5:case 1:{this.appRef.dirtyFlags|=4;break}case 6:{this.appRef.dirtyFlags|=2,r=!0;break}case 12:{this.appRef.dirtyFlags|=16,r=!0;break}case 13:{this.appRef.dirtyFlags|=2,r=!0;break}case 11:{r=!0;break}default:this.appRef.dirtyFlags|=8}if(this.appRef.tracingSnapshot=this.tracing?.snapshot(this.appRef.tracingSnapshot)??null,!this.shouldScheduleTick(r))return;let i=this.useMicrotaskScheduler?IP:Lx;this.pendingRenderTaskId=this.taskService.add(),this.scheduleInRootZone?this.cancelScheduledCallback=Zone.root.run(()=>i(()=>this.tick())):this.cancelScheduledCallback=this.ngZone.runOutsideAngular(()=>i(()=>this.tick()))}shouldScheduleTick(t){return!(this.disableScheduling&&!t||this.appRef.destroyed||this.pendingRenderTaskId!==null||this.runningTick||this.appRef._runningTick||!this.zonelessEnabled&&this.zoneIsDefined&&Zone.current.get(QE+this.angularZoneId))}tick(){if(this.runningTick||this.appRef.destroyed)return;if(this.appRef.dirtyFlags===0){this.cleanup();return}!this.zonelessEnabled&&this.appRef.dirtyFlags&7&&(this.appRef.dirtyFlags|=1);let t=this.taskService.add();try{this.ngZone.run(()=>{this.runningTick=!0,this.appRef._tick()},void 0,this.schedulerTickApplyArgs)}catch(r){this.taskService.remove(t),this.applicationErrorHandler(r)}finally{this.cleanup()}this.useMicrotaskScheduler=!0,IP(()=>{this.useMicrotaskScheduler=!1,this.taskService.remove(t)})}ngOnDestroy(){this.subscriptions.unsubscribe(),this.cleanup()}cleanup(){if(this.runningTick=!1,this.cancelScheduledCallback?.(),this.cancelScheduledCallback=null,this.pendingRenderTaskId!==null){let t=this.pendingRenderTaskId;this.pendingRenderTaskId=null,this.taskService.remove(t)}}static \u0275fac=function(r){return new(r||n)};static \u0275prov=Q({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function wK(){return Oo("NgZoneless"),qn([{provide:Or,useExisting:tD},{provide:Ae,useClass:bu},{provide:Cu,useValue:!0},{provide:OE,useValue:!1},[]])}function bK(){return typeof $localize<"u"&&$localize.locale||bf}var Mf=new z("",{providedIn:"root",factory:()=>Y(Mf,{optional:!0,skipSelf:!0})||bK()});var w_=class{destroyed=!1;listeners=null;errorHandler=Y(ar,{optional:!0});destroyRef=Y(Gn);constructor(){this.destroyRef.onDestroy(()=>{this.destroyed=!0,this.listeners=null})}subscribe(e){if(this.destroyed)throw new J(953,!1);return(this.listeners??=[]).push(e),{unsubscribe:()=>{let t=this.listeners?.indexOf(e);t!==void 0&&t!==-1&&this.listeners?.splice(t,1)}}}emit(e){if(this.destroyed){console.warn(gs(953,!1));return}if(this.listeners===null)return;let t=_e(null);try{for(let r of this.listeners)try{r(e)}catch(i){this.errorHandler?.handleError(i)}}finally{_e(t)}}};function Lf(n){return gL(n)}function Pf(n,e){return Kh(n,e?.equal)}var nD=class{[nn];constructor(e){this[nn]=e}destroy(){this[nn].destroy()}};function rD(n,e){let t=e?.injector??Y(We),r=e?.manualCleanup!==!0?t.get(Gn):null,i,o=t.get(Au,null,{optional:!0}),s=t.get(Or);return o!==null?(i=LK(o.view,s,n),r instanceof tf&&r._lView===o.view&&(r=null)):i=PK(n,t.get(ff),s),i.injector=t,r!==null&&(i.onDestroyFn=r.onDestroy(()=>i.destroy())),new nD(i)}var x1=ye($({},mL),{cleanupFns:void 0,zone:null,onDestroyFn:hc,run(){let n=Su(!1);try{EL(this)}finally{Su(n)}},cleanup(){if(!this.cleanupFns?.length)return;let n=_e(null);try{for(;this.cleanupFns.length;)this.cleanupFns.pop()()}finally{this.cleanupFns=[],_e(n)}}}),OK=ye($({},x1),{consumerMarkedDirty(){this.scheduler.schedule(this),this.notifier.notify(12)},destroy(){Ka(this),this.onDestroyFn(),this.cleanup(),this.scheduler.remove(this)}}),MK=ye($({},x1),{consumerMarkedDirty(){this.view[Te]|=8192,Is(this.view),this.notifier.notify(13)},destroy(){Ka(this),this.onDestroyFn(),this.cleanup(),this.view[So]?.delete(this)}});function LK(n,e,t){let r=Object.create(MK);return r.view=n,r.zone=typeof Zone<"u"?Zone.current:null,r.notifier=e,r.fn=k1(r,t),n[So]??=new Set,n[So].add(r),r.consumerMarkedDirty(r),r}function PK(n,e,t){let r=Object.create(OK);return r.fn=k1(r,n),r.scheduler=e,r.notifier=t,r.zone=typeof Zone<"u"?Zone.current:null,r.scheduler.add(r),r.notifier.notify(12),r}function k1(n,e){return()=>{e(t=>(n.cleanupFns??=[]).push(t))}}var $1=Symbol("InputSignalNode#UNSET"),zK=ye($({},tE),{transformFn:void 0,applyValueToInputSignal(n,e){fu(n,e)}});function W1(n,e){let t=Object.create(zK);t.value=n,t.transformFn=e?.transform;function r(){if(lu(t),t.value===$1){let i=null;throw new J(-950,i)}return t.value}return r[nn]=t,r}var qK=new z("");qK.__NG_ELEMENT_ID__=n=>{let e=$t();if(e===null)throw new J(204,!1);if(e.type&2)return e.value;if(n&8)return null;throw new J(204,!1)};function Uve(n){return new w_}function F1(n,e){return W1(n,e)}function KK(n){return W1($1,n)}var Vve=(F1.required=KK,F1);function U1(n,e){return Dk(e)}function YK(n,e){return Rk(e)}var Bve=(U1.required=YK,U1);function XK(n,e,t){let r=new o_(t);return Promise.resolve(r)}function V1(n){for(let e=n.length-1;e>=0;e--)if(n[e]!==void 0)return n[e]}var b_=new z(""),QK=new z("");function xf(n){return!n.moduleRef}function JK(n){let e=xf(n)?n.r3Injector:n.moduleRef.injector,t=e.get(Ae);return t.run(()=>{xf(n)?n.r3Injector.resolveInjectorInitializers():n.moduleRef.resolveInjectorInitializers();let r=e.get(Li),i;if(t.runOutsideAngular(()=>{i=t.onError.subscribe({next:r})}),xf(n)){let o=()=>e.destroy(),s=n.platformInjector.get(b_);s.add(o),e.onDestroy(()=>{i.unsubscribe(),s.delete(o)})}else{let o=()=>n.moduleRef.destroy(),s=n.platformInjector.get(b_);s.add(o),n.moduleRef.onDestroy(()=>{gf(n.allPlatformModules,n.moduleRef),i.unsubscribe(),s.delete(o)})}return eY(r,t,()=>{let o=e.get(vs),s=o.add(),a=e.get(HC);return a.runInitializers(),a.donePromise.then(()=>{let c=e.get(Mf,bf);if(n1(c||bf),!e.get(QK,!0))return xf(n)?e.get(Ds):(n.allPlatformModules.push(n.moduleRef),n.moduleRef);if(xf(n)){let d=e.get(Ds);return n.rootComponent!==void 0&&d.bootstrap(n.rootComponent),d}else return z1?.(n.moduleRef,n.allPlatformModules),n.moduleRef}).finally(()=>{o.remove(s)})})})}var z1;function B1(){z1=ZK}function ZK(n,e){let t=n.injector.get(Ds);if(n._bootstrapComponents.length>0)n._bootstrapComponents.forEach(r=>t.bootstrap(r));else if(n.instance.ngDoBootstrap)n.instance.ngDoBootstrap(t);else throw new J(-403,!1);e.push(n)}function eY(n,e,t){try{let r=t();return R_(r)?r.catch(i=>{throw e.runOutsideAngular(()=>n(i)),i}):r}catch(r){throw e.runOutsideAngular(()=>n(r)),r}}var q1=(()=>{class n{_injector;_modules=[];_destroyListeners=[];_destroyed=!1;constructor(t){this._injector=t}bootstrapModuleFactory(t,r){let i=r?.scheduleInRootZone,o=()=>xx(r?.ngZone,ye($({},eD({eventCoalescing:r?.ngZoneEventCoalescing,runCoalescing:r?.ngZoneRunCoalescing})),{scheduleInRootZone:i})),s=r?.ignoreChangesOutsideZone,a=[P1({ngZoneFactory:o,ignoreChangesOutsideZone:s}),{provide:Or,useExisting:tD},oP],c=Lk(t.moduleType,this.injector,a);return B1(),JK({moduleRef:c,allPlatformModules:this._modules,platformInjector:this.injector})}bootstrapModule(t,r=[]){let i=$C({},r);return B1(),XK(this.injector,i,t).then(o=>this.bootstrapModuleFactory(o,i))}onDestroy(t){this._destroyListeners.push(t)}get injector(){return this._injector}destroy(){if(this._destroyed)throw new J(404,!1);this._modules.slice().forEach(r=>r.destroy()),this._destroyListeners.forEach(r=>r());let t=this._injector.get(b_,null);t&&(t.forEach(r=>r()),t.clear()),this._destroyed=!0}get destroyed(){return this._destroyed}static \u0275fac=function(r){return new(r||n)(H(We))};static \u0275prov=Q({token:n,factory:n.\u0275fac,providedIn:"platform"})}return n})(),dD=null;function tY(n){if(fD())throw new J(400,!1);zk(),dD=n;let e=n.get(q1);return iY(n),e}function hD(n,e,t=[]){let r=`Platform: ${e}`,i=new z(r);return(o=[])=>{let s=fD();if(!s){let a=[...t,...o,{provide:i,useValue:!0}];s=n?.(a)??tY(nY(a,r))}return rY(i)}}function nY(n=[],e){return We.create({name:e,providers:[{provide:of,useValue:"platform"},{provide:b_,useValue:new Set([()=>dD=null])},...n]})}function rY(n){let e=fD();if(!e)throw new J(-401,!1);return e}function fD(){return dD?.get(q1)??null}function iY(n){let e=n.get(h_,null);Ni(n,()=>{e?.forEach(t=>t())})}function pD(){return!1}var oY=(()=>{class n{static __NG_ELEMENT_ID__=sY}return n})();function sY(n){return aY($t(),ne(),(n&16)===16)}function aY(n,e,t){if(Ao(n)&&!t){let r=Pr(n.index,e);return new Ss(r,r)}else if(n.type&175){let r=e[Rn];return new Ss(r,e)}return null}var iD=class{constructor(){}supports(e){return FC(e)}create(e){return new oD(e)}},cY=(n,e)=>e,oD=class{length=0;collection;_linkedRecords=null;_unlinkedRecords=null;_previousItHead=null;_itHead=null;_itTail=null;_additionsHead=null;_additionsTail=null;_movesHead=null;_movesTail=null;_removalsHead=null;_removalsTail=null;_identityChangesHead=null;_identityChangesTail=null;_trackByFn;constructor(e){this._trackByFn=e||cY}forEachItem(e){let t;for(t=this._itHead;t!==null;t=t._next)e(t)}forEachOperation(e){let t=this._itHead,r=this._removalsHead,i=0,o=null;for(;t||r;){let s=!r||t&&t.currentIndex<G1(r,i,o)?t:r,a=G1(s,i,o),c=s.currentIndex;if(s===r)i--,r=r._nextRemoved;else if(t=t._next,s.previousIndex==null)i++;else{o||(o=[]);let l=a-i,d=c-i;if(l!=d){for(let f=0;f<l;f++){let g=f<o.length?o[f]:o[f]=0,E=g+f;d<=E&&E<l&&(o[f]=g+1)}let h=s.previousIndex;o[h]=d-l}}a!==c&&e(s,a,c)}}forEachPreviousItem(e){let t;for(t=this._previousItHead;t!==null;t=t._nextPrevious)e(t)}forEachAddedItem(e){let t;for(t=this._additionsHead;t!==null;t=t._nextAdded)e(t)}forEachMovedItem(e){let t;for(t=this._movesHead;t!==null;t=t._nextMoved)e(t)}forEachRemovedItem(e){let t;for(t=this._removalsHead;t!==null;t=t._nextRemoved)e(t)}forEachIdentityChange(e){let t;for(t=this._identityChangesHead;t!==null;t=t._nextIdentityChange)e(t)}diff(e){if(e==null&&(e=[]),!FC(e))throw new J(900,!1);return this.check(e)?this:null}onDestroy(){}check(e){this._reset();let t=this._itHead,r=!1,i,o,s;if(Array.isArray(e)){this.length=e.length;for(let a=0;a<this.length;a++)o=e[a],s=this._trackByFn(a,o),t===null||!Object.is(t.trackById,s)?(t=this._mismatch(t,o,s,a),r=!0):(r&&(t=this._verifyReinsertion(t,o,s,a)),Object.is(t.item,o)||this._addIdentityChange(t,o)),t=t._next}else i=0,pk(e,a=>{s=this._trackByFn(i,a),t===null||!Object.is(t.trackById,s)?(t=this._mismatch(t,a,s,i),r=!0):(r&&(t=this._verifyReinsertion(t,a,s,i)),Object.is(t.item,a)||this._addIdentityChange(t,a)),t=t._next,i++}),this.length=i;return this._truncate(t),this.collection=e,this.isDirty}get isDirty(){return this._additionsHead!==null||this._movesHead!==null||this._removalsHead!==null||this._identityChangesHead!==null}_reset(){if(this.isDirty){let e;for(e=this._previousItHead=this._itHead;e!==null;e=e._next)e._nextPrevious=e._next;for(e=this._additionsHead;e!==null;e=e._nextAdded)e.previousIndex=e.currentIndex;for(this._additionsHead=this._additionsTail=null,e=this._movesHead;e!==null;e=e._nextMoved)e.previousIndex=e.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(e,t,r,i){let o;return e===null?o=this._itTail:(o=e._prev,this._remove(e)),e=this._unlinkedRecords===null?null:this._unlinkedRecords.get(r,null),e!==null?(Object.is(e.item,t)||this._addIdentityChange(e,t),this._reinsertAfter(e,o,i)):(e=this._linkedRecords===null?null:this._linkedRecords.get(r,i),e!==null?(Object.is(e.item,t)||this._addIdentityChange(e,t),this._moveAfter(e,o,i)):e=this._addAfter(new sD(t,r),o,i)),e}_verifyReinsertion(e,t,r,i){let o=this._unlinkedRecords===null?null:this._unlinkedRecords.get(r,null);return o!==null?e=this._reinsertAfter(o,e._prev,i):e.currentIndex!=i&&(e.currentIndex=i,this._addToMoves(e,i)),e}_truncate(e){for(;e!==null;){let t=e._next;this._addToRemovals(this._unlink(e)),e=t}this._unlinkedRecords!==null&&this._unlinkedRecords.clear(),this._additionsTail!==null&&(this._additionsTail._nextAdded=null),this._movesTail!==null&&(this._movesTail._nextMoved=null),this._itTail!==null&&(this._itTail._next=null),this._removalsTail!==null&&(this._removalsTail._nextRemoved=null),this._identityChangesTail!==null&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(e,t,r){this._unlinkedRecords!==null&&this._unlinkedRecords.remove(e);let i=e._prevRemoved,o=e._nextRemoved;return i===null?this._removalsHead=o:i._nextRemoved=o,o===null?this._removalsTail=i:o._prevRemoved=i,this._insertAfter(e,t,r),this._addToMoves(e,r),e}_moveAfter(e,t,r){return this._unlink(e),this._insertAfter(e,t,r),this._addToMoves(e,r),e}_addAfter(e,t,r){return this._insertAfter(e,t,r),this._additionsTail===null?this._additionsTail=this._additionsHead=e:this._additionsTail=this._additionsTail._nextAdded=e,e}_insertAfter(e,t,r){let i=t===null?this._itHead:t._next;return e._next=i,e._prev=t,i===null?this._itTail=e:i._prev=e,t===null?this._itHead=e:t._next=e,this._linkedRecords===null&&(this._linkedRecords=new O_),this._linkedRecords.put(e),e.currentIndex=r,e}_remove(e){return this._addToRemovals(this._unlink(e))}_unlink(e){this._linkedRecords!==null&&this._linkedRecords.remove(e);let t=e._prev,r=e._next;return t===null?this._itHead=r:t._next=r,r===null?this._itTail=t:r._prev=t,e}_addToMoves(e,t){return e.previousIndex===t||(this._movesTail===null?this._movesTail=this._movesHead=e:this._movesTail=this._movesTail._nextMoved=e),e}_addToRemovals(e){return this._unlinkedRecords===null&&(this._unlinkedRecords=new O_),this._unlinkedRecords.put(e),e.currentIndex=null,e._nextRemoved=null,this._removalsTail===null?(this._removalsTail=this._removalsHead=e,e._prevRemoved=null):(e._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=e),e}_addIdentityChange(e,t){return e.item=t,this._identityChangesTail===null?this._identityChangesTail=this._identityChangesHead=e:this._identityChangesTail=this._identityChangesTail._nextIdentityChange=e,e}},sD=class{item;trackById;currentIndex=null;previousIndex=null;_nextPrevious=null;_prev=null;_next=null;_prevDup=null;_nextDup=null;_prevRemoved=null;_nextRemoved=null;_nextAdded=null;_nextMoved=null;_nextIdentityChange=null;constructor(e,t){this.item=e,this.trackById=t}},aD=class{_head=null;_tail=null;add(e){this._head===null?(this._head=this._tail=e,e._nextDup=null,e._prevDup=null):(this._tail._nextDup=e,e._prevDup=this._tail,e._nextDup=null,this._tail=e)}get(e,t){let r;for(r=this._head;r!==null;r=r._nextDup)if((t===null||t<=r.currentIndex)&&Object.is(r.trackById,e))return r;return null}remove(e){let t=e._prevDup,r=e._nextDup;return t===null?this._head=r:t._nextDup=r,r===null?this._tail=t:r._prevDup=t,this._head===null}},O_=class{map=new Map;put(e){let t=e.trackById,r=this.map.get(t);r||(r=new aD,this.map.set(t,r)),r.add(e)}get(e,t){let r=e,i=this.map.get(r);return i?i.get(e,t):null}remove(e){let t=e.trackById;return this.map.get(t).remove(e)&&this.map.delete(t),e}get isEmpty(){return this.map.size===0}clear(){this.map.clear()}};function G1(n,e,t){let r=n.previousIndex;if(r===null)return r;let i=0;return t&&r<t.length&&(i=t[r]),r+e+i}var cD=class{constructor(){}supports(e){return e instanceof Map||C_(e)}create(){return new lD}},lD=class{_records=new Map;_mapHead=null;_appendAfter=null;_previousMapHead=null;_changesHead=null;_changesTail=null;_additionsHead=null;_additionsTail=null;_removalsHead=null;_removalsTail=null;get isDirty(){return this._additionsHead!==null||this._changesHead!==null||this._removalsHead!==null}forEachItem(e){let t;for(t=this._mapHead;t!==null;t=t._next)e(t)}forEachPreviousItem(e){let t;for(t=this._previousMapHead;t!==null;t=t._nextPrevious)e(t)}forEachChangedItem(e){let t;for(t=this._changesHead;t!==null;t=t._nextChanged)e(t)}forEachAddedItem(e){let t;for(t=this._additionsHead;t!==null;t=t._nextAdded)e(t)}forEachRemovedItem(e){let t;for(t=this._removalsHead;t!==null;t=t._nextRemoved)e(t)}diff(e){if(!e)e=new Map;else if(!(e instanceof Map||C_(e)))throw new J(900,!1);return this.check(e)?this:null}onDestroy(){}check(e){this._reset();let t=this._mapHead;if(this._appendAfter=null,this._forEach(e,(r,i)=>{if(t&&t.key===i)this._maybeAddToChanges(t,r),this._appendAfter=t,t=t._next;else{let o=this._getOrCreateRecordForKey(i,r);t=this._insertBeforeOrAppend(t,o)}}),t){t._prev&&(t._prev._next=null),this._removalsHead=t;for(let r=t;r!==null;r=r._nextRemoved)r===this._mapHead&&(this._mapHead=null),this._records.delete(r.key),r._nextRemoved=r._next,r.previousValue=r.currentValue,r.currentValue=null,r._prev=null,r._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty}_insertBeforeOrAppend(e,t){if(e){let r=e._prev;return t._next=e,t._prev=r,e._prev=t,r&&(r._next=t),e===this._mapHead&&(this._mapHead=t),this._appendAfter=e,e}return this._appendAfter?(this._appendAfter._next=t,t._prev=this._appendAfter):this._mapHead=t,this._appendAfter=t,null}_getOrCreateRecordForKey(e,t){if(this._records.has(e)){let i=this._records.get(e);this._maybeAddToChanges(i,t);let o=i._prev,s=i._next;return o&&(o._next=s),s&&(s._prev=o),i._next=null,i._prev=null,i}let r=new uD(e);return this._records.set(e,r),r.currentValue=t,this._addToAdditions(r),r}_reset(){if(this.isDirty){let e;for(this._previousMapHead=this._mapHead,e=this._previousMapHead;e!==null;e=e._next)e._nextPrevious=e._next;for(e=this._changesHead;e!==null;e=e._nextChanged)e.previousValue=e.currentValue;for(e=this._additionsHead;e!=null;e=e._nextAdded)e.previousValue=e.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}}_maybeAddToChanges(e,t){Object.is(t,e.currentValue)||(e.previousValue=e.currentValue,e.currentValue=t,this._addToChanges(e))}_addToAdditions(e){this._additionsHead===null?this._additionsHead=this._additionsTail=e:(this._additionsTail._nextAdded=e,this._additionsTail=e)}_addToChanges(e){this._changesHead===null?this._changesHead=this._changesTail=e:(this._changesTail._nextChanged=e,this._changesTail=e)}_forEach(e,t){e instanceof Map?e.forEach(t):Object.keys(e).forEach(r=>t(e[r],r))}},uD=class{key;previousValue=null;currentValue=null;_nextPrevious=null;_next=null;_prev=null;_nextAdded=null;_nextRemoved=null;_nextChanged=null;constructor(e){this.key=e}};function j1(){return new gD([new iD])}var gD=(()=>{class n{factories;static \u0275prov=Q({token:n,providedIn:"root",factory:j1});constructor(t){this.factories=t}static create(t,r){if(r!=null){let i=r.factories.slice();t=t.concat(i)}return new n(t)}static extend(t){return{provide:n,useFactory:()=>{let r=Y(n,{optional:!0,skipSelf:!0});return n.create(t,r||j1())}}}find(t){let r=this.factories.find(i=>i.supports(t));if(r!=null)return r;throw new J(901,!1)}}return n})();function H1(){return new M_([new cD])}var M_=(()=>{class n{static \u0275prov=Q({token:n,providedIn:"root",factory:H1});factories;constructor(t){this.factories=t}static create(t,r){if(r){let i=r.factories.slice();t=t.concat(i)}return new n(t)}static extend(t){return{provide:n,useFactory:()=>{let r=Y(n,{optional:!0,skipSelf:!0});return n.create(t,r||H1())}}}find(t){let r=this.factories.find(i=>i.supports(t));if(r)return r;throw new J(901,!1)}}return n})();var K1=hD(null,"core",[]),Y1=(()=>{class n{constructor(t){}static \u0275fac=function(r){return new(r||n)(H(Ds))};static \u0275mod=Cs({type:n});static \u0275inj=yo({})}return n})();function Gve(n){return typeof n=="boolean"?n:n!=null&&n!=="false"}function jve(n,e=NaN){return!isNaN(parseFloat(n))&&!isNaN(Number(n))?Number(n):e}function Hve(n,e){let t=Es(n),r=e.elementInjector||Eu();return new Pu(t).create(r,e.projectableNodes,e.hostElement,e.environmentInjector,e.directives,e.bindings)}var J1=null;function ji(){return J1}function mD(n){J1??=n}var kf=class{},ED=(()=>{class n{historyGo(t){throw new Error("")}static \u0275fac=function(r){return new(r||n)};static \u0275prov=Q({token:n,factory:()=>Y(Z1),providedIn:"platform"})}return n})();var Z1=(()=>{class n extends ED{_location;_history;_doc=Y(rn);constructor(){super(),this._location=window.location,this._history=window.history}getBaseHrefFromDOM(){return ji().getBaseHref(this._doc)}onPopState(t){let r=ji().getGlobalEventTarget(this._doc,"window");return r.addEventListener("popstate",t,!1),()=>r.removeEventListener("popstate",t)}onHashChange(t){let r=ji().getGlobalEventTarget(this._doc,"window");return r.addEventListener("hashchange",t,!1),()=>r.removeEventListener("hashchange",t)}get href(){return this._location.href}get protocol(){return this._location.protocol}get hostname(){return this._location.hostname}get port(){return this._location.port}get pathname(){return this._location.pathname}get search(){return this._location.search}get hash(){return this._location.hash}set pathname(t){this._location.pathname=t}pushState(t,r,i){this._history.pushState(t,r,i)}replaceState(t,r,i){this._history.replaceState(t,r,i)}forward(){this._history.forward()}back(){this._history.back()}historyGo(t=0){this._history.go(t)}getState(){return this._history.state}static \u0275fac=function(r){return new(r||n)};static \u0275prov=Q({token:n,factory:()=>new n,providedIn:"platform"})}return n})();function eF(n,e){return n?e?n.endsWith("/")?e.startsWith("/")?n+e.slice(1):n+e:e.startsWith("/")?n+e:`${n}/${e}`:n:e}function X1(n){let e=n.search(/#|\?|$/);return n[e-1]==="/"?n.slice(0,e-1)+n.slice(e):n}function Rs(n){return n&&n[0]!=="?"?`?${n}`:n}var L_=(()=>{class n{historyGo(t){throw new Error("")}static \u0275fac=function(r){return new(r||n)};static \u0275prov=Q({token:n,factory:()=>Y(nF),providedIn:"root"})}return n})(),tF=new z(""),nF=(()=>{class n extends L_{_platformLocation;_baseHref;_removeListenerFns=[];constructor(t,r){super(),this._platformLocation=t,this._baseHref=r??this._platformLocation.getBaseHrefFromDOM()??Y(rn).location?.origin??""}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(t){this._removeListenerFns.push(this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t))}getBaseHref(){return this._baseHref}prepareExternalUrl(t){return eF(this._baseHref,t)}path(t=!1){let r=this._platformLocation.pathname+Rs(this._platformLocation.search),i=this._platformLocation.hash;return i&&t?`${r}${i}`:r}pushState(t,r,i,o){let s=this.prepareExternalUrl(i+Rs(o));this._platformLocation.pushState(t,r,s)}replaceState(t,r,i,o){let s=this.prepareExternalUrl(i+Rs(o));this._platformLocation.replaceState(t,r,s)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(t=0){this._platformLocation.historyGo?.(t)}static \u0275fac=function(r){return new(r||n)(H(ED),H(tF,8))};static \u0275prov=Q({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),rF=(()=>{class n{_subject=new Ct;_basePath;_locationStrategy;_urlChangeListeners=[];_urlChangeSubscription=null;constructor(t){this._locationStrategy=t;let r=this._locationStrategy.getBaseHref();this._basePath=dY(X1(Q1(r))),this._locationStrategy.onPopState(i=>{this._subject.next({url:this.path(!0),pop:!0,state:i.state,type:i.type})})}ngOnDestroy(){this._urlChangeSubscription?.unsubscribe(),this._urlChangeListeners=[]}path(t=!1){return this.normalize(this._locationStrategy.path(t))}getState(){return this._locationStrategy.getState()}isCurrentPathEqualTo(t,r=""){return this.path()==this.normalize(t+Rs(r))}normalize(t){return n.stripTrailingSlash(uY(this._basePath,Q1(t)))}prepareExternalUrl(t){return t&&t[0]!=="/"&&(t="/"+t),this._locationStrategy.prepareExternalUrl(t)}go(t,r="",i=null){this._locationStrategy.pushState(i,"",t,r),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+Rs(r)),i)}replaceState(t,r="",i=null){this._locationStrategy.replaceState(i,"",t,r),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+Rs(r)),i)}forward(){this._locationStrategy.forward()}back(){this._locationStrategy.back()}historyGo(t=0){this._locationStrategy.historyGo?.(t)}onUrlChange(t){return this._urlChangeListeners.push(t),this._urlChangeSubscription??=this.subscribe(r=>{this._notifyUrlChangeListeners(r.url,r.state)}),()=>{let r=this._urlChangeListeners.indexOf(t);this._urlChangeListeners.splice(r,1),this._urlChangeListeners.length===0&&(this._urlChangeSubscription?.unsubscribe(),this._urlChangeSubscription=null)}}_notifyUrlChangeListeners(t="",r){this._urlChangeListeners.forEach(i=>i(t,r))}subscribe(t,r,i){return this._subject.subscribe({next:t,error:r??void 0,complete:i??void 0})}static normalizeQueryParams=Rs;static joinWithSlash=eF;static stripTrailingSlash=X1;static \u0275fac=function(r){return new(r||n)(H(L_))};static \u0275prov=Q({token:n,factory:()=>lY(),providedIn:"root"})}return n})();function lY(){return new rF(H(L_))}function uY(n,e){if(!n||!e.startsWith(n))return e;let t=e.substring(n.length);return t===""||["/",";","?","#"].includes(t[0])?t:e}function Q1(n){return n.replace(/\/index.html$/,"")}function dY(n){if(new RegExp("^(https?:)?//").test(n)){let[,t]=n.split(/\/\/[^\/]+/);return t}return n}var Nn=(function(n){return n[n.Format=0]="Format",n[n.Standalone=1]="Standalone",n})(Nn||{}),et=(function(n){return n[n.Narrow=0]="Narrow",n[n.Abbreviated=1]="Abbreviated",n[n.Wide=2]="Wide",n[n.Short=3]="Short",n})(et||{}),Kn=(function(n){return n[n.Short=0]="Short",n[n.Medium=1]="Medium",n[n.Long=2]="Long",n[n.Full=3]="Full",n})(Kn||{}),Lo={Decimal:0,Group:1,List:2,PercentSign:3,PlusSign:4,MinusSign:5,Exponential:6,SuperscriptingExponent:7,PerMille:8,Infinity:9,NaN:10,TimeSeparator:11,CurrencyDecimal:12,CurrencyGroup:13};function lF(n){return pr(n)[bt.LocaleId]}function uF(n,e,t){let r=pr(n),i=[r[bt.DayPeriodsFormat],r[bt.DayPeriodsStandalone]],o=xr(i,e);return xr(o,t)}function dF(n,e,t){let r=pr(n),i=[r[bt.DaysFormat],r[bt.DaysStandalone]],o=xr(i,e);return xr(o,t)}function hF(n,e,t){let r=pr(n),i=[r[bt.MonthsFormat],r[bt.MonthsStandalone]],o=xr(i,e);return xr(o,t)}function fF(n,e){let r=pr(n)[bt.Eras];return xr(r,e)}function Ff(n,e){let t=pr(n);return xr(t[bt.DateFormat],e)}function Uf(n,e){let t=pr(n);return xr(t[bt.TimeFormat],e)}function Vf(n,e){let r=pr(n)[bt.DateTimeFormat];return xr(r,e)}function Bf(n,e){let t=pr(n),r=t[bt.NumberSymbols][e];if(typeof r>"u"){if(e===Lo.CurrencyDecimal)return t[bt.NumberSymbols][Lo.Decimal];if(e===Lo.CurrencyGroup)return t[bt.NumberSymbols][Lo.Group]}return r}function pF(n){if(!n[bt.ExtraData])throw new J(2303,!1)}function gF(n){let e=pr(n);return pF(e),(e[bt.ExtraData][2]||[]).map(r=>typeof r=="string"?_D(r):[_D(r[0]),_D(r[1])])}function mF(n,e,t){let r=pr(n);pF(r);let i=[r[bt.ExtraData][0],r[bt.ExtraData][1]],o=xr(i,e)||[];return xr(o,t)||[]}function xr(n,e){for(let t=e;t>-1;t--)if(typeof n[t]<"u")return n[t];throw new J(2304,!1)}function _D(n){let[e,t]=n.split(":");return{hours:+e,minutes:+t}}var hY=/^(\d{4,})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/,P_={},fY=/((?:[^BEGHLMOSWYZabcdhmswyz']+)|(?:'(?:[^']|'')*')|(?:G{1,5}|y{1,4}|Y{1,4}|M{1,5}|L{1,5}|w{1,2}|W{1}|d{1,2}|E{1,6}|c{1,6}|a{1,5}|b{1,5}|B{1,5}|h{1,2}|H{1,2}|m{1,2}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|O{1,4}))([\s\S]*)/,pY=256;function EF(n,e,t,r){let i=AY(n);gY(e),e=Mo(t,e)||e;let s=[],a;for(;e;)if(a=fY.exec(e),a){s=s.concat(a.slice(1));let d=s.pop();if(!d)break;e=d}else{s.push(e);break}let c=i.getTimezoneOffset();r&&(c=TF(r,c),i=SY(i,r));let l="";return s.forEach(d=>{let h=yY(d);l+=h?h(i,t,c):d==="''"?"'":d.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),l}function gY(n){if(n.length>pY)throw new J(2300,!1)}function V_(n,e,t){let r=new Date(0);return r.setFullYear(n,e,t),r.setHours(0,0,0),r}function Mo(n,e){let t=lF(n);if(P_[t]??={},P_[t][e])return P_[t][e];let r="";switch(e){case"shortDate":r=Ff(n,Kn.Short);break;case"mediumDate":r=Ff(n,Kn.Medium);break;case"longDate":r=Ff(n,Kn.Long);break;case"fullDate":r=Ff(n,Kn.Full);break;case"shortTime":r=Uf(n,Kn.Short);break;case"mediumTime":r=Uf(n,Kn.Medium);break;case"longTime":r=Uf(n,Kn.Long);break;case"fullTime":r=Uf(n,Kn.Full);break;case"short":let i=Mo(n,"shortTime"),o=Mo(n,"shortDate");r=x_(Vf(n,Kn.Short),[i,o]);break;case"medium":let s=Mo(n,"mediumTime"),a=Mo(n,"mediumDate");r=x_(Vf(n,Kn.Medium),[s,a]);break;case"long":let c=Mo(n,"longTime"),l=Mo(n,"longDate");r=x_(Vf(n,Kn.Long),[c,l]);break;case"full":let d=Mo(n,"fullTime"),h=Mo(n,"fullDate");r=x_(Vf(n,Kn.Full),[d,h]);break}return r&&(P_[t][e]=r),r}function x_(n,e){return e&&(n=n.replace(/\{([^}]+)}/g,function(t,r){return e!=null&&r in e?e[r]:t})),n}function ti(n,e,t="-",r,i){let o="";(n<0||i&&n<=0)&&(i?n=-n+1:(n=-n,o=t));let s=String(n);for(;s.length<e;)s="0"+s;return r&&(s=s.slice(s.length-e)),o+s}function mY(n,e){return ti(n,3).substring(0,e)}function Pt(n,e,t=0,r=!1,i=!1){return function(o,s){let a=EY(n,o);if((t>0||a>-t)&&(a+=t),n===3)a===0&&t===-12&&(a=12);else if(n===6)return mY(a,e);let c=Bf(s,Lo.MinusSign);return ti(a,e,c,r,i)}}function EY(n,e){switch(n){case 0:return e.getFullYear();case 1:return e.getMonth();case 2:return e.getDate();case 3:return e.getHours();case 4:return e.getMinutes();case 5:return e.getSeconds();case 6:return e.getMilliseconds();case 7:return e.getDay();default:throw new J(2301,!1)}}function lt(n,e,t=Nn.Format,r=!1){return function(i,o){return _Y(i,o,n,e,t,r)}}function _Y(n,e,t,r,i,o){switch(t){case 2:return hF(e,i,r)[n.getMonth()];case 1:return dF(e,i,r)[n.getDay()];case 0:let s=n.getHours(),a=n.getMinutes();if(o){let l=gF(e),d=mF(e,i,r),h=l.findIndex(f=>{if(Array.isArray(f)){let[g,E]=f,v=s>=g.hours&&a>=g.minutes,S=s<E.hours||s===E.hours&&a<E.minutes;if(g.hours<E.hours){if(v&&S)return!0}else if(v||S)return!0}else if(f.hours===s&&f.minutes===a)return!0;return!1});if(h!==-1)return d[h]}return uF(e,i,r)[s<12?0:1];case 3:return fF(e,r)[n.getFullYear()<=0?0:1];default:let c=t;throw new J(2302,!1)}}function k_(n){return function(e,t,r){let i=-1*r,o=Bf(t,Lo.MinusSign),s=i>0?Math.floor(i/60):Math.ceil(i/60);switch(n){case 0:return(i>=0?"+":"")+ti(s,2,o)+ti(Math.abs(i%60),2,o);case 1:return"GMT"+(i>=0?"+":"")+ti(s,1,o);case 2:return"GMT"+(i>=0?"+":"")+ti(s,2,o)+":"+ti(Math.abs(i%60),2,o);case 3:return r===0?"Z":(i>=0?"+":"")+ti(s,2,o)+":"+ti(Math.abs(i%60),2,o);default:throw new J(2310,!1)}}}var TY=0,U_=4;function IY(n){let e=V_(n,TY,1).getDay();return V_(n,0,1+(e<=U_?U_:U_+7)-e)}function _F(n){let e=n.getDay(),t=e===0?-3:U_-e;return V_(n.getFullYear(),n.getMonth(),n.getDate()+t)}function TD(n,e=!1){return function(t,r){let i;if(e){let o=new Date(t.getFullYear(),t.getMonth(),1).getDay()-1,s=t.getDate();i=1+Math.floor((s+o)/7)}else{let o=_F(t),s=IY(o.getFullYear()),a=o.getTime()-s.getTime();i=1+Math.round(a/6048e5)}return ti(i,n,Bf(r,Lo.MinusSign))}}function F_(n,e=!1){return function(t,r){let o=_F(t).getFullYear();return ti(o,n,Bf(r,Lo.MinusSign),e)}}var ID={};function yY(n){if(ID[n])return ID[n];let e;switch(n){case"G":case"GG":case"GGG":e=lt(3,et.Abbreviated);break;case"GGGG":e=lt(3,et.Wide);break;case"GGGGG":e=lt(3,et.Narrow);break;case"y":e=Pt(0,1,0,!1,!0);break;case"yy":e=Pt(0,2,0,!0,!0);break;case"yyy":e=Pt(0,3,0,!1,!0);break;case"yyyy":e=Pt(0,4,0,!1,!0);break;case"Y":e=F_(1);break;case"YY":e=F_(2,!0);break;case"YYY":e=F_(3);break;case"YYYY":e=F_(4);break;case"M":case"L":e=Pt(1,1,1);break;case"MM":case"LL":e=Pt(1,2,1);break;case"MMM":e=lt(2,et.Abbreviated);break;case"MMMM":e=lt(2,et.Wide);break;case"MMMMM":e=lt(2,et.Narrow);break;case"LLL":e=lt(2,et.Abbreviated,Nn.Standalone);break;case"LLLL":e=lt(2,et.Wide,Nn.Standalone);break;case"LLLLL":e=lt(2,et.Narrow,Nn.Standalone);break;case"w":e=TD(1);break;case"ww":e=TD(2);break;case"W":e=TD(1,!0);break;case"d":e=Pt(2,1);break;case"dd":e=Pt(2,2);break;case"c":case"cc":e=Pt(7,1);break;case"ccc":e=lt(1,et.Abbreviated,Nn.Standalone);break;case"cccc":e=lt(1,et.Wide,Nn.Standalone);break;case"ccccc":e=lt(1,et.Narrow,Nn.Standalone);break;case"cccccc":e=lt(1,et.Short,Nn.Standalone);break;case"E":case"EE":case"EEE":e=lt(1,et.Abbreviated);break;case"EEEE":e=lt(1,et.Wide);break;case"EEEEE":e=lt(1,et.Narrow);break;case"EEEEEE":e=lt(1,et.Short);break;case"a":case"aa":case"aaa":e=lt(0,et.Abbreviated);break;case"aaaa":e=lt(0,et.Wide);break;case"aaaaa":e=lt(0,et.Narrow);break;case"b":case"bb":case"bbb":e=lt(0,et.Abbreviated,Nn.Standalone,!0);break;case"bbbb":e=lt(0,et.Wide,Nn.Standalone,!0);break;case"bbbbb":e=lt(0,et.Narrow,Nn.Standalone,!0);break;case"B":case"BB":case"BBB":e=lt(0,et.Abbreviated,Nn.Format,!0);break;case"BBBB":e=lt(0,et.Wide,Nn.Format,!0);break;case"BBBBB":e=lt(0,et.Narrow,Nn.Format,!0);break;case"h":e=Pt(3,1,-12);break;case"hh":e=Pt(3,2,-12);break;case"H":e=Pt(3,1);break;case"HH":e=Pt(3,2);break;case"m":e=Pt(4,1);break;case"mm":e=Pt(4,2);break;case"s":e=Pt(5,1);break;case"ss":e=Pt(5,2);break;case"S":e=Pt(6,1);break;case"SS":e=Pt(6,2);break;case"SSS":e=Pt(6,3);break;case"Z":case"ZZ":case"ZZZ":e=k_(0);break;case"ZZZZZ":e=k_(3);break;case"O":case"OO":case"OOO":case"z":case"zz":case"zzz":e=k_(1);break;case"OOOO":case"ZZZZ":case"zzzz":e=k_(2);break;default:return null}return ID[n]=e,e}function TF(n,e){n=n.replace(/:/g,"");let t=Date.parse("Jan 01, 1970 00:00:00 "+n)/6e4;return isNaN(t)?e:t}function vY(n,e){return n=new Date(n.getTime()),n.setMinutes(n.getMinutes()+e),n}function SY(n,e,t){let i=n.getTimezoneOffset(),o=TF(e,i);return vY(n,-1*(o-i))}function AY(n){if(iF(n))return n;if(typeof n=="number"&&!isNaN(n))return new Date(n);if(typeof n=="string"){if(n=n.trim(),/^(\d{4}(-\d{1,2}(-\d{1,2})?)?)$/.test(n)){let[i,o=1,s=1]=n.split("-").map(a=>+a);return V_(i,o-1,s)}let t=parseFloat(n);if(!isNaN(n-t))return new Date(t);let r;if(r=n.match(hY))return CY(r)}let e=new Date(n);if(!iF(e))throw new J(2311,!1);return e}function CY(n){let e=new Date(0),t=0,r=0,i=n[8]?e.setUTCFullYear:e.setFullYear,o=n[8]?e.setUTCHours:e.setHours;n[9]&&(t=Number(n[9]+n[10]),r=Number(n[9]+n[11])),i.call(e,Number(n[1]),Number(n[2])-1,Number(n[3]));let s=Number(n[4]||0)-t,a=Number(n[5]||0)-r,c=Number(n[6]||0),l=Math.floor(parseFloat("0."+(n[7]||0))*1e3);return o.call(e,s,a,c,l),e}function iF(n){return n instanceof Date&&!isNaN(n.valueOf())}var yD=/\s+/,oF=[],DY=(()=>{class n{_ngEl;_renderer;initialClasses=oF;rawClass;stateMap=new Map;constructor(t,r){this._ngEl=t,this._renderer=r}set klass(t){this.initialClasses=t!=null?t.trim().split(yD):oF}set ngClass(t){this.rawClass=typeof t=="string"?t.trim().split(yD):t}ngDoCheck(){for(let r of this.initialClasses)this._updateState(r,!0);let t=this.rawClass;if(Array.isArray(t)||t instanceof Set)for(let r of t)this._updateState(r,!0);else if(t!=null)for(let r of Object.keys(t))this._updateState(r,!!t[r]);this._applyStateDiff()}_updateState(t,r){let i=this.stateMap.get(t);i!==void 0?(i.enabled!==r&&(i.changed=!0,i.enabled=r),i.touched=!0):this.stateMap.set(t,{enabled:r,changed:!0,touched:!0})}_applyStateDiff(){for(let t of this.stateMap){let r=t[0],i=t[1];i.changed?(this._toggleClass(r,i.enabled),i.changed=!1):i.touched||(i.enabled&&this._toggleClass(r,!1),this.stateMap.delete(r)),i.touched=!1}}_toggleClass(t,r){t=t.trim(),t.length>0&&t.split(yD).forEach(i=>{r?this._renderer.addClass(this._ngEl.nativeElement,i):this._renderer.removeClass(this._ngEl.nativeElement,i)})}static \u0275fac=function(r){return new(r||n)(ot(As),ot(A_))};static \u0275dir=Gi({type:n,selectors:[["","ngClass",""]],inputs:{klass:[0,"class","klass"],ngClass:"ngClass"}})}return n})();var B_=class{$implicit;ngForOf;index;count;constructor(e,t,r,i){this.$implicit=e,this.ngForOf=t,this.index=r,this.count=i}get first(){return this.index===0}get last(){return this.index===this.count-1}get even(){return this.index%2===0}get odd(){return!this.even}},IF=(()=>{class n{_viewContainer;_template;_differs;set ngForOf(t){this._ngForOf=t,this._ngForOfDirty=!0}set ngForTrackBy(t){this._trackByFn=t}get ngForTrackBy(){return this._trackByFn}_ngForOf=null;_ngForOfDirty=!0;_differ=null;_trackByFn;constructor(t,r,i){this._viewContainer=t,this._template=r,this._differs=i}set ngForTemplate(t){t&&(this._template=t)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;let t=this._ngForOf;!this._differ&&t&&(this._differ=this._differs.find(t).create(this.ngForTrackBy))}if(this._differ){let t=this._differ.diff(this._ngForOf);t&&this._applyChanges(t)}}_applyChanges(t){let r=this._viewContainer;t.forEachOperation((i,o,s)=>{if(i.previousIndex==null)r.createEmbeddedView(this._template,new B_(i.item,this._ngForOf,-1,-1),s===null?void 0:s);else if(s==null)r.remove(o===null?void 0:o);else if(o!==null){let a=r.get(o);r.move(a,s),sF(a,i)}});for(let i=0,o=r.length;i<o;i++){let a=r.get(i).context;a.index=i,a.count=o,a.ngForOf=this._ngForOf}t.forEachIdentityChange(i=>{let o=r.get(i.currentIndex);sF(o,i)})}static ngTemplateContextGuard(t,r){return!0}static \u0275fac=function(r){return new(r||n)(ot(Bi),ot(Fi),ot(gD))};static \u0275dir=Gi({type:n,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"}})}return n})();function sF(n,e){n.context.$implicit=e.item}var RY=(()=>{class n{_viewContainer;_context=new G_;_thenTemplateRef=null;_elseTemplateRef=null;_thenViewRef=null;_elseViewRef=null;constructor(t,r){this._viewContainer=t,this._thenTemplateRef=r}set ngIf(t){this._context.$implicit=this._context.ngIf=t,this._updateView()}set ngIfThen(t){aF(t,!1),this._thenTemplateRef=t,this._thenViewRef=null,this._updateView()}set ngIfElse(t){aF(t,!1),this._elseTemplateRef=t,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngIfUseIfTypeGuard;static ngTemplateGuard_ngIf;static ngTemplateContextGuard(t,r){return!0}static \u0275fac=function(r){return new(r||n)(ot(Bi),ot(Fi))};static \u0275dir=Gi({type:n,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}})}return n})(),G_=class{$implicit=null;ngIf=null};function aF(n,e){if(n&&!n.createEmbeddedView)throw new J(2020,!1)}var j_=class{_viewContainerRef;_templateRef;_created=!1;constructor(e,t){this._viewContainerRef=e,this._templateRef=t}create(){this._created=!0,this._viewContainerRef.createEmbeddedView(this._templateRef)}destroy(){this._created=!1,this._viewContainerRef.clear()}enforceState(e){e&&!this._created?this.create():!e&&this._created&&this.destroy()}},vD=(()=>{class n{_defaultViews=[];_defaultUsed=!1;_caseCount=0;_lastCaseCheckIndex=0;_lastCasesMatched=!1;_ngSwitch;set ngSwitch(t){this._ngSwitch=t,this._caseCount===0&&this._updateDefaultCases(!0)}_addCase(){return this._caseCount++}_addDefault(t){this._defaultViews.push(t)}_matchCase(t){let r=t===this._ngSwitch;return this._lastCasesMatched||=r,this._lastCaseCheckIndex++,this._lastCaseCheckIndex===this._caseCount&&(this._updateDefaultCases(!this._lastCasesMatched),this._lastCaseCheckIndex=0,this._lastCasesMatched=!1),r}_updateDefaultCases(t){if(this._defaultViews.length>0&&t!==this._defaultUsed){this._defaultUsed=t;for(let r of this._defaultViews)r.enforceState(t)}}static \u0275fac=function(r){return new(r||n)};static \u0275dir=Gi({type:n,selectors:[["","ngSwitch",""]],inputs:{ngSwitch:"ngSwitch"}})}return n})(),NY=(()=>{class n{ngSwitch;_view;ngSwitchCase;constructor(t,r,i){this.ngSwitch=i,i._addCase(),this._view=new j_(t,r)}ngDoCheck(){this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase))}static \u0275fac=function(r){return new(r||n)(ot(Bi),ot(Fi),ot(vD,9))};static \u0275dir=Gi({type:n,selectors:[["","ngSwitchCase",""]],inputs:{ngSwitchCase:"ngSwitchCase"}})}return n})(),wY=(()=>{class n{constructor(t,r,i){i._addDefault(new j_(t,r))}static \u0275fac=function(r){return new(r||n)(ot(Bi),ot(Fi),ot(vD,9))};static \u0275dir=Gi({type:n,selectors:[["","ngSwitchDefault",""]]})}return n})();var bY=(()=>{class n{_ngEl;_differs;_renderer;_ngStyle=null;_differ=null;constructor(t,r,i){this._ngEl=t,this._differs=r,this._renderer=i}set ngStyle(t){this._ngStyle=t,!this._differ&&t&&(this._differ=this._differs.find(t).create())}ngDoCheck(){if(this._differ){let t=this._differ.diff(this._ngStyle);t&&this._applyChanges(t)}}_setStyle(t,r){let[i,o]=t.split("."),s=i.indexOf("-")===-1?void 0:ei.DashCase;r!=null?this._renderer.setStyle(this._ngEl.nativeElement,i,o?`${r}${o}`:r,s):this._renderer.removeStyle(this._ngEl.nativeElement,i,s)}_applyChanges(t){t.forEachRemovedItem(r=>this._setStyle(r.key,null)),t.forEachAddedItem(r=>this._setStyle(r.key,r.currentValue)),t.forEachChangedItem(r=>this._setStyle(r.key,r.currentValue))}static \u0275fac=function(r){return new(r||n)(ot(As),ot(M_),ot(A_))};static \u0275dir=Gi({type:n,selectors:[["","ngStyle",""]],inputs:{ngStyle:"ngStyle"}})}return n})(),OY=(()=>{class n{_viewContainerRef;_viewRef=null;ngTemplateOutletContext=null;ngTemplateOutlet=null;ngTemplateOutletInjector=null;constructor(t){this._viewContainerRef=t}ngOnChanges(t){if(this._shouldRecreateView(t)){let r=this._viewContainerRef;if(this._viewRef&&r.remove(r.indexOf(this._viewRef)),!this.ngTemplateOutlet){this._viewRef=null;return}let i=this._createContextForwardProxy();this._viewRef=r.createEmbeddedView(this.ngTemplateOutlet,i,{injector:this.ngTemplateOutletInjector??void 0})}}_shouldRecreateView(t){return!!t.ngTemplateOutlet||!!t.ngTemplateOutletInjector}_createContextForwardProxy(){return new Proxy({},{set:(t,r,i)=>this.ngTemplateOutletContext?Reflect.set(this.ngTemplateOutletContext,r,i):!1,get:(t,r,i)=>{if(this.ngTemplateOutletContext)return Reflect.get(this.ngTemplateOutletContext,r,i)}})}static \u0275fac=function(r){return new(r||n)(ot(Bi))};static \u0275dir=Gi({type:n,selectors:[["","ngTemplateOutlet",""]],inputs:{ngTemplateOutletContext:"ngTemplateOutletContext",ngTemplateOutlet:"ngTemplateOutlet",ngTemplateOutletInjector:"ngTemplateOutletInjector"},features:[aC]})}return n})();function yF(n,e){return new J(2100,!1)}var MY=/(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])\S*/g,LY=(()=>{class n{transform(t){if(t==null)return null;if(typeof t!="string")throw yF(n,t);return t.replace(MY,r=>r[0].toUpperCase()+r.slice(1).toLowerCase())}static \u0275fac=function(r){return new(r||n)};static \u0275pipe=Rf({name:"titlecase",type:n,pure:!0})}return n})();var PY="mediumDate",vF=new z(""),SF=new z(""),xY=(()=>{class n{locale;defaultTimezone;defaultOptions;constructor(t,r,i){this.locale=t,this.defaultTimezone=r,this.defaultOptions=i}transform(t,r,i,o){if(t==null||t===""||t!==t)return null;try{let s=r??this.defaultOptions?.dateFormat??PY,a=i??this.defaultOptions?.timezone??this.defaultTimezone??void 0;return EF(t,s,o||this.locale,a)}catch(s){throw yF(n,s.message)}}static \u0275fac=function(r){return new(r||n)(ot(Mf,16),ot(vF,24),ot(SF,24))};static \u0275pipe=Rf({name:"date",type:n,pure:!0})}return n})();function kY(n,e){return{key:n,value:e}}var FY=(()=>{class n{differs;constructor(t){this.differs=t}differ;keyValues=[];compareFn=cF;transform(t,r=cF){if(!t||!(t instanceof Map)&&typeof t!="object")return null;this.differ??=this.differs.find(t).create();let i=this.differ.diff(t),o=r!==this.compareFn;return i&&(this.keyValues=[],i.forEachItem(s=>{this.keyValues.push(kY(s.key,s.currentValue))})),(i||o)&&(r&&this.keyValues.sort(r),this.compareFn=r),this.keyValues}static \u0275fac=function(r){return new(r||n)(ot(M_,16))};static \u0275pipe=Rf({name:"keyvalue",type:n,pure:!1})}return n})();function cF(n,e){let t=n.key,r=e.key;if(t===r)return 0;if(t==null)return 1;if(r==null)return-1;if(typeof t=="string"&&typeof r=="string")return t<r?-1:1;if(typeof t=="number"&&typeof r=="number")return t-r;if(typeof t=="boolean"&&typeof r=="boolean")return t<r?-1:1;let i=String(t),o=String(r);return i==o?0:i<o?-1:1}var SD=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=Cs({type:n});static \u0275inj=yo({})}return n})();function Gf(n,e){e=encodeURIComponent(e);for(let t of n.split(";")){let r=t.indexOf("="),[i,o]=r==-1?[t,""]:[t.slice(0,r),t.slice(r+1)];if(i.trim()===e)return decodeURIComponent(o)}return null}var Ic=class{};var AD="browser";function AF(n){return n===AD}var jf=class{_doc;constructor(e){this._doc=e}manager},Hf=(()=>{class n extends jf{constructor(t){super(t)}supports(t){return!0}addEventListener(t,r,i,o){return t.addEventListener(r,i,o),()=>this.removeEventListener(t,r,i,o)}removeEventListener(t,r,i,o){return t.removeEventListener(r,i,o)}static \u0275fac=function(r){return new(r||n)(H(rn))};static \u0275prov=Q({token:n,factory:n.\u0275fac})}return n})(),$_=new z(""),W_=(()=>{class n{_zone;_plugins;_eventNameToPlugin=new Map;constructor(t,r){this._zone=r,t.forEach(s=>{s.manager=this});let i=t.filter(s=>!(s instanceof Hf));this._plugins=i.slice().reverse();let o=t.find(s=>s instanceof Hf);o&&this._plugins.push(o)}addEventListener(t,r,i,o){return this._findPluginFor(r).addEventListener(t,r,i,o)}getZone(){return this._zone}_findPluginFor(t){let r=this._eventNameToPlugin.get(t);if(r)return r;if(r=this._plugins.find(o=>o.supports(t)),!r)throw new J(5101,!1);return this._eventNameToPlugin.set(t,r),r}static \u0275fac=function(r){return new(r||n)(H($_),H(Ae))};static \u0275prov=Q({token:n,factory:n.\u0275fac})}return n})(),CD="ng-app-id";function CF(n){for(let e of n)e.remove()}function DF(n,e){let t=e.createElement("style");return t.textContent=n,t}function UY(n,e,t,r){let i=n.head?.querySelectorAll(`style[${CD}="${e}"],link[${CD}="${e}"]`);if(i)for(let o of i)o.removeAttribute(CD),o instanceof HTMLLinkElement?r.set(o.href.slice(o.href.lastIndexOf("/")+1),{usage:0,elements:[o]}):o.textContent&&t.set(o.textContent,{usage:0,elements:[o]})}function RD(n,e){let t=e.createElement("link");return t.setAttribute("rel","stylesheet"),t.setAttribute("href",n),t}var z_=(()=>{class n{doc;appId;nonce;inline=new Map;external=new Map;hosts=new Set;constructor(t,r,i,o={}){this.doc=t,this.appId=r,this.nonce=i,UY(t,r,this.inline,this.external),this.hosts.add(t.head)}addStyles(t,r){for(let i of t)this.addUsage(i,this.inline,DF);r?.forEach(i=>this.addUsage(i,this.external,RD))}removeStyles(t,r){for(let i of t)this.removeUsage(i,this.inline);r?.forEach(i=>this.removeUsage(i,this.external))}addUsage(t,r,i){let o=r.get(t);o?o.usage++:r.set(t,{usage:1,elements:[...this.hosts].map(s=>this.addElement(s,i(t,this.doc)))})}removeUsage(t,r){let i=r.get(t);i&&(i.usage--,i.usage<=0&&(CF(i.elements),r.delete(t)))}ngOnDestroy(){for(let[,{elements:t}]of[...this.inline,...this.external])CF(t);this.hosts.clear()}addHost(t){this.hosts.add(t);for(let[r,{elements:i}]of this.inline)i.push(this.addElement(t,DF(r,this.doc)));for(let[r,{elements:i}]of this.external)i.push(this.addElement(t,RD(r,this.doc)))}removeHost(t){this.hosts.delete(t)}addElement(t,r){return this.nonce&&r.setAttribute("nonce",this.nonce),t.appendChild(r)}static \u0275fac=function(r){return new(r||n)(H(rn),H(d_),H(Gu,8),H(wo))};static \u0275prov=Q({token:n,factory:n.\u0275fac})}return n})(),DD={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/",math:"http://www.w3.org/1998/Math/MathML"},wD=/%COMP%/g;var NF="%COMP%",VY=`_nghost-${NF}`,BY=`_ngcontent-${NF}`,GY=!0,wF=new z("",{providedIn:"root",factory:()=>GY});function jY(n){return BY.replace(wD,n)}function HY(n){return VY.replace(wD,n)}function bF(n,e){return e.map(t=>t.replace(wD,n))}var q_=(()=>{class n{eventManager;sharedStylesHost;appId;removeStylesOnCompDestroy;doc;ngZone;nonce;tracingService;rendererByCompId=new Map;defaultRenderer;platformIsServer;constructor(t,r,i,o,s,a,c=null,l=null){this.eventManager=t,this.sharedStylesHost=r,this.appId=i,this.removeStylesOnCompDestroy=o,this.doc=s,this.ngZone=a,this.nonce=c,this.tracingService=l,this.platformIsServer=!1,this.defaultRenderer=new $f(t,s,a,this.platformIsServer,this.tracingService)}createRenderer(t,r){if(!t||!r)return this.defaultRenderer;let i=this.getOrCreateRenderer(t,r);return i instanceof H_?i.applyToHost(t):i instanceof Wf&&i.applyStyles(),i}getOrCreateRenderer(t,r){let i=this.rendererByCompId,o=i.get(r.id);if(!o){let s=this.doc,a=this.ngZone,c=this.eventManager,l=this.sharedStylesHost,d=this.removeStylesOnCompDestroy,h=this.platformIsServer,f=this.tracingService;switch(r.encapsulation){case Do.Emulated:o=new H_(c,l,r,this.appId,d,s,a,h,f);break;case Do.ShadowDom:return new ND(c,l,t,r,s,a,this.nonce,h,f);default:o=new Wf(c,l,r,d,s,a,h,f);break}i.set(r.id,o)}return o}ngOnDestroy(){this.rendererByCompId.clear()}componentReplaced(t){this.rendererByCompId.delete(t)}static \u0275fac=function(r){return new(r||n)(H(W_),H(z_),H(d_),H(wF),H(rn),H(Ae),H(Gu),H(_c,8))};static \u0275prov=Q({token:n,factory:n.\u0275fac})}return n})(),$f=class{eventManager;doc;ngZone;platformIsServer;tracingService;data=Object.create(null);throwOnSyntheticProps=!0;constructor(e,t,r,i,o){this.eventManager=e,this.doc=t,this.ngZone=r,this.platformIsServer=i,this.tracingService=o}destroy(){}destroyNode=null;createElement(e,t){return t?this.doc.createElementNS(DD[t]||t,e):this.doc.createElement(e)}createComment(e){return this.doc.createComment(e)}createText(e){return this.doc.createTextNode(e)}appendChild(e,t){(RF(e)?e.content:e).appendChild(t)}insertBefore(e,t,r){e&&(RF(e)?e.content:e).insertBefore(t,r)}removeChild(e,t){t.remove()}selectRootElement(e,t){let r=typeof e=="string"?this.doc.querySelector(e):e;if(!r)throw new J(-5104,!1);return t||(r.textContent=""),r}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}setAttribute(e,t,r,i){if(i){t=i+":"+t;let o=DD[i];o?e.setAttributeNS(o,t,r):e.setAttribute(t,r)}else e.setAttribute(t,r)}removeAttribute(e,t,r){if(r){let i=DD[r];i?e.removeAttributeNS(i,t):e.removeAttribute(`${r}:${t}`)}else e.removeAttribute(t)}addClass(e,t){e.classList.add(t)}removeClass(e,t){e.classList.remove(t)}setStyle(e,t,r,i){i&(ei.DashCase|ei.Important)?e.style.setProperty(t,r,i&ei.Important?"important":""):e.style[t]=r}removeStyle(e,t,r){r&ei.DashCase?e.style.removeProperty(t):e.style[t]=""}setProperty(e,t,r){e!=null&&(e[t]=r)}setValue(e,t){e.nodeValue=t}listen(e,t,r,i){if(typeof e=="string"&&(e=ji().getGlobalEventTarget(this.doc,e),!e))throw new J(5102,!1);let o=this.decoratePreventDefault(r);return this.tracingService?.wrapEventListener&&(o=this.tracingService.wrapEventListener(e,t,o)),this.eventManager.addEventListener(e,t,o,i)}decoratePreventDefault(e){return t=>{if(t==="__ngUnwrap__")return e;e(t)===!1&&t.preventDefault()}}};function RF(n){return n.tagName==="TEMPLATE"&&n.content!==void 0}var ND=class extends $f{sharedStylesHost;hostEl;shadowRoot;constructor(e,t,r,i,o,s,a,c,l){super(e,o,s,c,l),this.sharedStylesHost=t,this.hostEl=r,this.shadowRoot=r.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);let d=i.styles;d=bF(i.id,d);for(let f of d){let g=document.createElement("style");a&&g.setAttribute("nonce",a),g.textContent=f,this.shadowRoot.appendChild(g)}let h=i.getExternalStyles?.();if(h)for(let f of h){let g=RD(f,o);a&&g.setAttribute("nonce",a),this.shadowRoot.appendChild(g)}}nodeOrShadowRoot(e){return e===this.hostEl?this.shadowRoot:e}appendChild(e,t){return super.appendChild(this.nodeOrShadowRoot(e),t)}insertBefore(e,t,r){return super.insertBefore(this.nodeOrShadowRoot(e),t,r)}removeChild(e,t){return super.removeChild(null,t)}parentNode(e){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(e)))}destroy(){this.sharedStylesHost.removeHost(this.shadowRoot)}},Wf=class extends $f{sharedStylesHost;removeStylesOnCompDestroy;styles;styleUrls;constructor(e,t,r,i,o,s,a,c,l){super(e,o,s,a,c),this.sharedStylesHost=t,this.removeStylesOnCompDestroy=i;let d=r.styles;this.styles=l?bF(l,d):d,this.styleUrls=r.getExternalStyles?.(l)}applyStyles(){this.sharedStylesHost.addStyles(this.styles,this.styleUrls)}destroy(){this.removeStylesOnCompDestroy&&gc.size===0&&this.sharedStylesHost.removeStyles(this.styles,this.styleUrls)}},H_=class extends Wf{contentAttr;hostAttr;constructor(e,t,r,i,o,s,a,c,l){let d=i+"-"+r.id;super(e,t,r,o,s,a,c,l,d),this.contentAttr=jY(d),this.hostAttr=HY(d)}applyToHost(e){this.applyStyles(),this.setAttribute(e,this.hostAttr,"")}createElement(e,t){let r=super.createElement(e,t);return super.setAttribute(r,this.contentAttr,""),r}};var K_=class n extends kf{supportsDOMEvents=!0;static makeCurrent(){mD(new n)}onAndCancel(e,t,r,i){return e.addEventListener(t,r,i),()=>{e.removeEventListener(t,r,i)}}dispatchEvent(e,t){e.dispatchEvent(t)}remove(e){e.remove()}createElement(e,t){return t=t||this.getDefaultDocument(),t.createElement(e)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(e){return e.nodeType===Node.ELEMENT_NODE}isShadowRoot(e){return e instanceof DocumentFragment}getGlobalEventTarget(e,t){return t==="window"?window:t==="document"?e:t==="body"?e.body:null}getBaseHref(e){let t=$Y();return t==null?null:WY(t)}resetBaseElement(){zf=null}getUserAgent(){return window.navigator.userAgent}getCookie(e){return Gf(document.cookie,e)}},zf=null;function $Y(){return zf=zf||document.head.querySelector("base"),zf?zf.getAttribute("href"):null}function WY(n){return new URL(n,document.baseURI).pathname}var Y_=class{addToWindow(e){Lt.getAngularTestability=(r,i=!0)=>{let o=e.findTestabilityInTree(r,i);if(o==null)throw new J(5103,!1);return o},Lt.getAllAngularTestabilities=()=>e.getAllTestabilities(),Lt.getAllAngularRootElements=()=>e.getAllRootElements();let t=r=>{let i=Lt.getAllAngularTestabilities(),o=i.length,s=function(){o--,o==0&&r()};i.forEach(a=>{a.whenStable(s)})};Lt.frameworkStabilizers||(Lt.frameworkStabilizers=[]),Lt.frameworkStabilizers.push(t)}findTestabilityInTree(e,t,r){if(t==null)return null;let i=e.getTestability(t);return i??(r?ji().isShadowRoot(t)?this.findTestabilityInTree(e,t.host,!0):this.findTestabilityInTree(e,t.parentElement,!0):null)}},zY=(()=>{class n{build(){return new XMLHttpRequest}static \u0275fac=function(r){return new(r||n)};static \u0275prov=Q({token:n,factory:n.\u0275fac})}return n})(),OF=["alt","control","meta","shift"],qY={"\b":"Backspace"," ":"Tab","\x7F":"Delete","\x1B":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},KY={alt:n=>n.altKey,control:n=>n.ctrlKey,meta:n=>n.metaKey,shift:n=>n.shiftKey},MF=(()=>{class n extends jf{constructor(t){super(t)}supports(t){return n.parseEventName(t)!=null}addEventListener(t,r,i,o){let s=n.parseEventName(r),a=n.eventCallback(s.fullKey,i,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>ji().onAndCancel(t,s.domEventName,a,o))}static parseEventName(t){let r=t.toLowerCase().split("."),i=r.shift();if(r.length===0||!(i==="keydown"||i==="keyup"))return null;let o=n._normalizeKey(r.pop()),s="",a=r.indexOf("code");if(a>-1&&(r.splice(a,1),s="code."),OF.forEach(l=>{let d=r.indexOf(l);d>-1&&(r.splice(d,1),s+=l+".")}),s+=o,r.length!=0||o.length===0)return null;let c={};return c.domEventName=i,c.fullKey=s,c}static matchEventFullKeyCode(t,r){let i=qY[t.key]||t.key,o="";return r.indexOf("code.")>-1&&(i=t.code,o="code."),i==null||!i?!1:(i=i.toLowerCase(),i===" "?i="space":i==="."&&(i="dot"),OF.forEach(s=>{if(s!==i){let a=KY[s];a(t)&&(o+=s+".")}}),o+=i,o===r)}static eventCallback(t,r,i){return o=>{n.matchEventFullKeyCode(o,t)&&i.runGuarded(()=>r(o))}}static _normalizeKey(t){return t==="esc"?"escape":t}static \u0275fac=function(r){return new(r||n)(H(rn))};static \u0275prov=Q({token:n,factory:n.\u0275fac})}return n})();function YY(){K_.makeCurrent()}function XY(){return new ar}function QY(){return uC(document),document}var JY=[{provide:wo,useValue:AD},{provide:h_,useValue:YY,multi:!0},{provide:rn,useFactory:QY}],ZY=hD(K1,"browser",JY);var e7=[{provide:ju,useClass:Y_},{provide:D_,useClass:Nf,deps:[Ae,wf,ju]},{provide:Nf,useClass:Nf,deps:[Ae,wf,ju]}],t7=[{provide:of,useValue:"root"},{provide:ar,useFactory:XY},{provide:$_,useClass:Hf,multi:!0,deps:[rn]},{provide:$_,useClass:MF,multi:!0,deps:[rn]},q_,z_,W_,{provide:No,useExisting:q_},{provide:Ic,useClass:zY},[]],n7=(()=>{class n{constructor(){}static \u0275fac=function(r){return new(r||n)};static \u0275mod=Cs({type:n});static \u0275inj=yo({providers:[...t7,...e7],imports:[SD,Y1]})}return n})();var vc=class{},qf=class{},Ns=class n{headers;normalizedNames=new Map;lazyInit;lazyUpdate=null;constructor(e){e?typeof e=="string"?this.lazyInit=()=>{this.headers=new Map,e.split(`
|
|
5
|
+
`).forEach(t=>{let r=t.indexOf(":");if(r>0){let i=t.slice(0,r),o=t.slice(r+1).trim();this.addHeaderEntry(i,o)}})}:typeof Headers<"u"&&e instanceof Headers?(this.headers=new Map,e.forEach((t,r)=>{this.addHeaderEntry(r,t)})):this.lazyInit=()=>{this.headers=new Map,Object.entries(e).forEach(([t,r])=>{this.setHeaderEntries(t,r)})}:this.headers=new Map}has(e){return this.init(),this.headers.has(e.toLowerCase())}get(e){this.init();let t=this.headers.get(e.toLowerCase());return t&&t.length>0?t[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(e){return this.init(),this.headers.get(e.toLowerCase())||null}append(e,t){return this.clone({name:e,value:t,op:"a"})}set(e,t){return this.clone({name:e,value:t,op:"s"})}delete(e,t){return this.clone({name:e,value:t,op:"d"})}maybeSetNormalizedName(e,t){this.normalizedNames.has(t)||this.normalizedNames.set(t,e)}init(){this.lazyInit&&(this.lazyInit instanceof n?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(e=>this.applyUpdate(e)),this.lazyUpdate=null))}copyFrom(e){e.init();for(let[t,r]of e.headers.entries())this.headers.set(t,r),this.normalizedNames.set(t,e.normalizedNames.get(t))}clone(e){let t=new n;return t.lazyInit=this.lazyInit&&this.lazyInit instanceof n?this.lazyInit:this,t.lazyUpdate=(this.lazyUpdate||[]).concat([e]),t}applyUpdate(e){let t=e.name.toLowerCase();switch(e.op){case"a":case"s":let r=e.value;if(typeof r=="string"&&(r=[r]),r.length===0)return;this.maybeSetNormalizedName(e.name,t);let i=e.op==="a"?(this.headers.get(t)||[]).slice():[];i.push(...r),this.headers.set(t,i);break;case"d":let o=e.value;if(o===void 0)this.headers.delete(t),this.normalizedNames.delete(t);else{let s=Array.isArray(o)?o:[o],a=this.headers.get(t);if(!a)return;a=a.filter(c=>s.indexOf(c)===-1),a.length===0?(this.headers.delete(t),this.normalizedNames.delete(t)):this.headers.set(t,a)}break}}addHeaderEntry(e,t){let r=e.toLowerCase();this.maybeSetNormalizedName(e,r),this.headers.has(r)?this.headers.get(r).push(t):this.headers.set(r,[t])}setHeaderEntries(e,t){let r=(Array.isArray(t)?t:[t]).map(o=>o.toString()),i=e.toLowerCase();this.headers.set(i,r),this.maybeSetNormalizedName(e,i)}forEach(e){this.init(),Array.from(this.normalizedNames.keys()).forEach(t=>e(this.normalizedNames.get(t),this.headers.get(t)))}};var Q_=class{encodeKey(e){return LF(e)}encodeValue(e){return LF(e)}decodeKey(e){return decodeURIComponent(e)}decodeValue(e){return decodeURIComponent(e)}};function r7(n,e){let t=new Map;return n.length>0&&n.replace(/^\?/,"").split("&").forEach(i=>{let o=i.indexOf("="),[s,a]=o==-1?[e.decodeKey(i),""]:[e.decodeKey(i.slice(0,o)),e.decodeValue(i.slice(o+1))],c=t.get(s)||[];c.push(a),t.set(s,c)}),t}var i7=/%(\d[a-f0-9])/gi,o7={40:"@","3A":":",24:"$","2C":",","3B":";","3D":"=","3F":"?","2F":"/"};function LF(n){return encodeURIComponent(n).replace(i7,(e,t)=>o7[t]??e)}function X_(n){return`${n}`}var Po=class n{map;encoder;updates=null;cloneFrom=null;constructor(e={}){if(this.encoder=e.encoder||new Q_,e.fromString){if(e.fromObject)throw new J(2805,!1);this.map=r7(e.fromString,this.encoder)}else e.fromObject?(this.map=new Map,Object.keys(e.fromObject).forEach(t=>{let r=e.fromObject[t],i=Array.isArray(r)?r.map(X_):[X_(r)];this.map.set(t,i)})):this.map=null}has(e){return this.init(),this.map.has(e)}get(e){this.init();let t=this.map.get(e);return t?t[0]:null}getAll(e){return this.init(),this.map.get(e)||null}keys(){return this.init(),Array.from(this.map.keys())}append(e,t){return this.clone({param:e,value:t,op:"a"})}appendAll(e){let t=[];return Object.keys(e).forEach(r=>{let i=e[r];Array.isArray(i)?i.forEach(o=>{t.push({param:r,value:o,op:"a"})}):t.push({param:r,value:i,op:"a"})}),this.clone(t)}set(e,t){return this.clone({param:e,value:t,op:"s"})}delete(e,t){return this.clone({param:e,value:t,op:"d"})}toString(){return this.init(),this.keys().map(e=>{let t=this.encoder.encodeKey(e);return this.map.get(e).map(r=>t+"="+this.encoder.encodeValue(r)).join("&")}).filter(e=>e!=="").join("&")}clone(e){let t=new n({encoder:this.encoder});return t.cloneFrom=this.cloneFrom||this,t.updates=(this.updates||[]).concat(e),t}init(){if(this.map===null&&(this.map=new Map),this.cloneFrom!==null){this.cloneFrom.init();for(let[e,t]of this.cloneFrom.map.entries())this.map.set(e,t);this.updates.forEach(e=>{switch(e.op){case"a":case"s":let t=e.op==="a"?(this.map.get(e.param)||[]).slice():[];t.push(X_(e.value)),this.map.set(e.param,t);break;case"d":if(e.value!==void 0){let r=(this.map.get(e.param)||[]).slice(),i=r.indexOf(X_(e.value));i!==-1&&r.splice(i,1),r.length>0?this.map.set(e.param,r):this.map.delete(e.param)}else{this.map.delete(e.param);break}}}),this.cloneFrom=this.updates=null}}};var J_=class{map=new Map;set(e,t){return this.map.set(e,t),this}get(e){return this.map.has(e)||this.map.set(e,e.defaultValue()),this.map.get(e)}delete(e){return this.map.delete(e),this}has(e){return this.map.has(e)}keys(){return this.map.keys()}};function s7(n){switch(n){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}function PF(n){return typeof ArrayBuffer<"u"&&n instanceof ArrayBuffer}function xF(n){return typeof Blob<"u"&&n instanceof Blob}function kF(n){return typeof FormData<"u"&&n instanceof FormData}function a7(n){return typeof URLSearchParams<"u"&&n instanceof URLSearchParams}var FF="Content-Type",UF="Accept",BF="X-Request-URL",GF="text/plain",jF="application/json",c7=`${jF}, ${GF}, */*`,Hu=class n{url;body=null;headers;context;reportProgress=!1;withCredentials=!1;credentials;keepalive=!1;cache;priority;mode;redirect;referrer;integrity;responseType="json";method;params;urlWithParams;transferCache;timeout;constructor(e,t,r,i){this.url=t,this.method=e.toUpperCase();let o;if(s7(this.method)||i?(this.body=r!==void 0?r:null,o=i):o=r,o){if(this.reportProgress=!!o.reportProgress,this.withCredentials=!!o.withCredentials,this.keepalive=!!o.keepalive,o.responseType&&(this.responseType=o.responseType),o.headers&&(this.headers=o.headers),o.context&&(this.context=o.context),o.params&&(this.params=o.params),o.priority&&(this.priority=o.priority),o.cache&&(this.cache=o.cache),o.credentials&&(this.credentials=o.credentials),typeof o.timeout=="number"){if(o.timeout<1||!Number.isInteger(o.timeout))throw new J(2822,"");this.timeout=o.timeout}o.mode&&(this.mode=o.mode),o.redirect&&(this.redirect=o.redirect),o.integrity&&(this.integrity=o.integrity),o.referrer!==void 0&&(this.referrer=o.referrer),this.transferCache=o.transferCache}if(this.headers??=new Ns,this.context??=new J_,!this.params)this.params=new Po,this.urlWithParams=t;else{let s=this.params.toString();if(s.length===0)this.urlWithParams=t;else{let a=t.indexOf("?"),c=a===-1?"?":a<t.length-1?"&":"";this.urlWithParams=t+c+s}}}serializeBody(){return this.body===null?null:typeof this.body=="string"||PF(this.body)||xF(this.body)||kF(this.body)||a7(this.body)?this.body:this.body instanceof Po?this.body.toString():typeof this.body=="object"||typeof this.body=="boolean"||Array.isArray(this.body)?JSON.stringify(this.body):this.body.toString()}detectContentTypeHeader(){return this.body===null||kF(this.body)?null:xF(this.body)?this.body.type||null:PF(this.body)?null:typeof this.body=="string"?GF:this.body instanceof Po?"application/x-www-form-urlencoded;charset=UTF-8":typeof this.body=="object"||typeof this.body=="number"||typeof this.body=="boolean"?jF:null}clone(e={}){let t=e.method||this.method,r=e.url||this.url,i=e.responseType||this.responseType,o=e.keepalive??this.keepalive,s=e.priority||this.priority,a=e.cache||this.cache,c=e.mode||this.mode,l=e.redirect||this.redirect,d=e.credentials||this.credentials,h=e.referrer??this.referrer,f=e.integrity||this.integrity,g=e.transferCache??this.transferCache,E=e.timeout??this.timeout,v=e.body!==void 0?e.body:this.body,S=e.withCredentials??this.withCredentials,P=e.reportProgress??this.reportProgress,V=e.headers||this.headers,K=e.params||this.params,oe=e.context??this.context;return e.setHeaders!==void 0&&(V=Object.keys(e.setHeaders).reduce((ge,te)=>ge.set(te,e.setHeaders[te]),V)),e.setParams&&(K=Object.keys(e.setParams).reduce((ge,te)=>ge.set(te,e.setParams[te]),K)),new n(t,r,v,{params:K,headers:V,context:oe,reportProgress:P,responseType:i,withCredentials:S,transferCache:g,keepalive:o,cache:a,priority:s,timeout:E,mode:c,redirect:l,credentials:d,referrer:h,integrity:f})}},yc=(function(n){return n[n.Sent=0]="Sent",n[n.UploadProgress=1]="UploadProgress",n[n.ResponseHeader=2]="ResponseHeader",n[n.DownloadProgress=3]="DownloadProgress",n[n.Response=4]="Response",n[n.User=5]="User",n})(yc||{}),Wu=class{headers;status;statusText;url;ok;type;redirected;constructor(e,t=200,r="OK"){this.headers=e.headers||new Ns,this.status=e.status!==void 0?e.status:t,this.statusText=e.statusText||r,this.url=e.url||null,this.redirected=e.redirected,this.ok=this.status>=200&&this.status<300}},Z_=class n extends Wu{constructor(e={}){super(e)}type=yc.ResponseHeader;clone(e={}){return new n({headers:e.headers||this.headers,status:e.status!==void 0?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0})}},Kf=class n extends Wu{body;constructor(e={}){super(e),this.body=e.body!==void 0?e.body:null}type=yc.Response;clone(e={}){return new n({body:e.body!==void 0?e.body:this.body,headers:e.headers||this.headers,status:e.status!==void 0?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0,redirected:e.redirected??this.redirected})}},$u=class extends Wu{name="HttpErrorResponse";message;error;ok=!1;constructor(e){super(e,0,"Unknown Error"),this.status>=200&&this.status<300?this.message=`Http failure during parsing for ${e.url||"(unknown url)"}`:this.message=`Http failure response for ${e.url||"(unknown url)"}: ${e.status} ${e.statusText}`,this.error=e.error||null}},l7=200,u7=204;function bD(n,e){return{body:e,headers:n.headers,context:n.context,observe:n.observe,params:n.params,reportProgress:n.reportProgress,responseType:n.responseType,withCredentials:n.withCredentials,credentials:n.credentials,transferCache:n.transferCache,timeout:n.timeout,keepalive:n.keepalive,priority:n.priority,cache:n.cache,mode:n.mode,redirect:n.redirect,integrity:n.integrity,referrer:n.referrer}}var HF=(()=>{class n{handler;constructor(t){this.handler=t}request(t,r,i={}){let o;if(t instanceof Hu)o=t;else{let c;i.headers instanceof Ns?c=i.headers:c=new Ns(i.headers);let l;i.params&&(i.params instanceof Po?l=i.params:l=new Po({fromObject:i.params})),o=new Hu(t,r,i.body!==void 0?i.body:null,{headers:c,context:i.context,params:l,reportProgress:i.reportProgress,responseType:i.responseType||"json",withCredentials:i.withCredentials,transferCache:i.transferCache,keepalive:i.keepalive,priority:i.priority,cache:i.cache,mode:i.mode,redirect:i.redirect,credentials:i.credentials,referrer:i.referrer,integrity:i.integrity,timeout:i.timeout})}let s=ct(o).pipe(Wv(c=>this.handler.handle(c)));if(t instanceof Hu||i.observe==="events")return s;let a=s.pipe(pn(c=>c instanceof Kf));switch(i.observe||"body"){case"body":switch(o.responseType){case"arraybuffer":return a.pipe(De(c=>{if(c.body!==null&&!(c.body instanceof ArrayBuffer))throw new J(2806,!1);return c.body}));case"blob":return a.pipe(De(c=>{if(c.body!==null&&!(c.body instanceof Blob))throw new J(2807,!1);return c.body}));case"text":return a.pipe(De(c=>{if(c.body!==null&&typeof c.body!="string")throw new J(2808,!1);return c.body}));default:return a.pipe(De(c=>c.body))}case"response":return a;default:throw new J(2809,!1)}}delete(t,r={}){return this.request("DELETE",t,r)}get(t,r={}){return this.request("GET",t,r)}head(t,r={}){return this.request("HEAD",t,r)}jsonp(t,r){return this.request("JSONP",t,{params:new Po().append(r,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(t,r={}){return this.request("OPTIONS",t,r)}patch(t,r,i={}){return this.request("PATCH",t,bD(i,r))}post(t,r,i={}){return this.request("POST",t,bD(i,r))}put(t,r,i={}){return this.request("PUT",t,bD(i,r))}static \u0275fac=function(r){return new(r||n)(H(vc))};static \u0275prov=Q({token:n,factory:n.\u0275fac})}return n})();var d7=new z("");function $F(n,e){return e(n)}function h7(n,e){return(t,r)=>e.intercept(t,{handle:i=>n(i,r)})}function f7(n,e,t){return(r,i)=>Ni(t,()=>e(r,o=>n(o,i)))}var WF=new z(""),MD=new z(""),zF=new z(""),LD=new z("",{providedIn:"root",factory:()=>!0});function p7(){let n=null;return(e,t)=>{n===null&&(n=(Y(WF,{optional:!0})??[]).reduceRight(h7,$F));let r=Y(xi);if(Y(LD)){let o=r.add();return n(e,t).pipe(zh(o))}else return n(e,t)}}var eT=(()=>{class n extends vc{backend;injector;chain=null;pendingTasks=Y(xi);contributeToStability=Y(LD);constructor(t,r){super(),this.backend=t,this.injector=r}handle(t){if(this.chain===null){let r=this.injector.get(vc,null,{skipSelf:!0}),i=r!==null&&this.backend===r,o=this.injector.get(zF,[],i?{self:!0}:void 0),s=Array.from(new Set([...this.injector.get(MD),...o]));this.chain=s.reduceRight((a,c)=>f7(a,c,this.injector),$F)}if(this.contributeToStability){let r=this.pendingTasks.add();return this.chain(t,i=>this.backend.handle(i)).pipe(zh(r))}else return this.chain(t,r=>this.backend.handle(r))}static \u0275fac=function(r){return new(r||n)(H(qf),H(Dn))};static \u0275prov=Q({token:n,factory:n.\u0275fac})}return n})();var g7=/^\)\]\}',?\n/,m7=RegExp(`^${BF}:`,"m");function E7(n){return"responseURL"in n&&n.responseURL?n.responseURL:m7.test(n.getAllResponseHeaders())?n.getResponseHeader(BF):null}var OD=(()=>{class n{xhrFactory;constructor(t){this.xhrFactory=t}handle(t){if(t.method==="JSONP")throw new J(-2800,!1);let r=this.xhrFactory;return ct(null).pipe(br(()=>new fe(o=>{let s=r.build();if(s.open(t.method,t.urlWithParams),t.withCredentials&&(s.withCredentials=!0),t.headers.forEach((S,P)=>s.setRequestHeader(S,P.join(","))),t.headers.has(UF)||s.setRequestHeader(UF,c7),!t.headers.has(FF)){let S=t.detectContentTypeHeader();S!==null&&s.setRequestHeader(FF,S)}if(t.timeout&&(s.timeout=t.timeout),t.responseType){let S=t.responseType.toLowerCase();s.responseType=S!=="json"?S:"text"}let a=t.serializeBody(),c=null,l=()=>{if(c!==null)return c;let S=s.statusText||"OK",P=new Ns(s.getAllResponseHeaders()),V=E7(s)||t.url;return c=new Z_({headers:P,status:s.status,statusText:S,url:V}),c},d=()=>{let{headers:S,status:P,statusText:V,url:K}=l(),oe=null;P!==u7&&(oe=typeof s.response>"u"?s.responseText:s.response),P===0&&(P=oe?l7:0);let ge=P>=200&&P<300;if(t.responseType==="json"&&typeof oe=="string"){let te=oe;oe=oe.replace(g7,"");try{oe=oe!==""?JSON.parse(oe):null}catch(C){oe=te,ge&&(ge=!1,oe={error:C,text:oe})}}ge?(o.next(new Kf({body:oe,headers:S,status:P,statusText:V,url:K||void 0})),o.complete()):o.error(new $u({error:oe,headers:S,status:P,statusText:V,url:K||void 0}))},h=S=>{let{url:P}=l(),V=new $u({error:S,status:s.status||0,statusText:s.statusText||"Unknown Error",url:P||void 0});o.error(V)},f=h;t.timeout&&(f=S=>{let{url:P}=l(),V=new $u({error:new DOMException("Request timed out","TimeoutError"),status:s.status||0,statusText:s.statusText||"Request timeout",url:P||void 0});o.error(V)});let g=!1,E=S=>{g||(o.next(l()),g=!0);let P={type:yc.DownloadProgress,loaded:S.loaded};S.lengthComputable&&(P.total=S.total),t.responseType==="text"&&s.responseText&&(P.partialText=s.responseText),o.next(P)},v=S=>{let P={type:yc.UploadProgress,loaded:S.loaded};S.lengthComputable&&(P.total=S.total),o.next(P)};return s.addEventListener("load",d),s.addEventListener("error",h),s.addEventListener("timeout",f),s.addEventListener("abort",h),t.reportProgress&&(s.addEventListener("progress",E),a!==null&&s.upload&&s.upload.addEventListener("progress",v)),s.send(a),o.next({type:yc.Sent}),()=>{s.removeEventListener("error",h),s.removeEventListener("abort",h),s.removeEventListener("load",d),s.removeEventListener("timeout",f),t.reportProgress&&(s.removeEventListener("progress",E),a!==null&&s.upload&&s.upload.removeEventListener("progress",v)),s.readyState!==s.DONE&&s.abort()}})))}static \u0275fac=function(r){return new(r||n)(H(Ic))};static \u0275prov=Q({token:n,factory:n.\u0275fac})}return n})(),qF=new z(""),_7="XSRF-TOKEN",T7=new z("",{providedIn:"root",factory:()=>_7}),I7="X-XSRF-TOKEN",y7=new z("",{providedIn:"root",factory:()=>I7}),Yf=class{},v7=(()=>{class n{doc;cookieName;lastCookieString="";lastToken=null;parseCount=0;constructor(t,r){this.doc=t,this.cookieName=r}getToken(){let t=this.doc.cookie||"";return t!==this.lastCookieString&&(this.parseCount++,this.lastToken=Gf(t,this.cookieName),this.lastCookieString=t),this.lastToken}static \u0275fac=function(r){return new(r||n)(H(rn),H(T7))};static \u0275prov=Q({token:n,factory:n.\u0275fac})}return n})(),S7=/^(?:https?:)?\/\//i;function A7(n,e){if(!Y(qF)||n.method==="GET"||n.method==="HEAD"||S7.test(n.url))return e(n);let t=Y(Yf).getToken(),r=Y(y7);return t!=null&&!n.headers.has(r)&&(n=n.clone({headers:n.headers.set(r,t)})),e(n)}var PD=(function(n){return n[n.Interceptors=0]="Interceptors",n[n.LegacyInterceptors=1]="LegacyInterceptors",n[n.CustomXsrfConfiguration=2]="CustomXsrfConfiguration",n[n.NoXsrfProtection=3]="NoXsrfProtection",n[n.JsonpSupport=4]="JsonpSupport",n[n.RequestsMadeViaParent=5]="RequestsMadeViaParent",n[n.Fetch=6]="Fetch",n})(PD||{});function C7(n,e){return{\u0275kind:n,\u0275providers:e}}function D7(...n){let e=[HF,OD,eT,{provide:vc,useExisting:eT},{provide:qf,useFactory:()=>Y(d7,{optional:!0})??Y(OD)},{provide:MD,useValue:A7,multi:!0},{provide:qF,useValue:!0},{provide:Yf,useClass:v7}];for(let t of n)e.push(...t.\u0275providers);return qn(e)}var VF=new z("");function R7(){return C7(PD.LegacyInterceptors,[{provide:VF,useFactory:p7},{provide:MD,useExisting:VF,multi:!0}])}var xD=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275prov=Q({token:n,factory:function(r){let i=null;return r?i=new(r||n):i=H(N7),i},providedIn:"root"})}return n})(),N7=(()=>{class n extends xD{_doc;constructor(t){super(),this._doc=t}sanitize(t,r){if(r==null)return null;switch(t){case yt.NONE:return r;case yt.HTML:return Ui(r,"HTML")?fr(r):g_(this._doc,String(r)).toString();case yt.STYLE:return Ui(r,"Style")?fr(r):r;case yt.SCRIPT:if(Ui(r,"Script"))return fr(r);throw new J(5200,!1);case yt.URL:return Ui(r,"URL")?fr(r):If(String(r));case yt.RESOURCE_URL:if(Ui(r,"ResourceURL"))return fr(r);throw new J(5201,!1);default:throw new J(5202,!1)}}bypassSecurityTrustHtml(t){return fC(t)}bypassSecurityTrustStyle(t){return pC(t)}bypassSecurityTrustScript(t){return gC(t)}bypassSecurityTrustUrl(t){return mC(t)}bypassSecurityTrustResourceUrl(t){return EC(t)}static \u0275fac=function(r){return new(r||n)(H(rn))};static \u0275prov=Q({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var qt={production:!1,staging:!0,firebaseLogLevel:"error",firebaseConfig:{apiKey:"AIzaSyAzcW2n1JhY_zhkXmuFcwe550AkwmYeJ0w",authDomain:"snipply-sdk-staging.firebaseapp.com",projectId:"snipply-sdk-staging",storageBucket:"snipply-sdk-staging.appspot.com",messagingSenderId:"877538579326",appId:"1:877538579326:web:f793f73f2b7dc770c4992f"},firebaseNotificationsDatabaseURL:"https://snipply-sdk-staging-notifications.firebaseio.com",segmentAnalyticsWriteKey:"ndJ0KZs5LkL6jny5a43FXXQkTF5bgPFt",useEmulators:!1,debugMode:!1,cloudFunction:{sa:"https://us-central1-snipply-sdk-staging.cloudfunctions.net/sa",getIceServers:"https://us-central1-snipply-sdk-staging.cloudfunctions.net/geticeservers",validateClient:"https://us-central1-snipply-sdk-staging.cloudfunctions.net/validateclient",convertRecording:"https://us-central1-snipply-sdk-staging.cloudfunctions.net/convertrecordingv2",chatgptCompletion:"https://us-central1-snipply-sdk-staging.cloudfunctions.net/chatgptcompletion",rewriterAskAi:"https://staging.velt.dev/v2/rewriter/ask-ai",whisperTranscription:"https://us-central1-snipply-sdk-staging.cloudfunctions.net/whispertranscription",getPlanDetails:"https://us-central1-snipply-sdk-staging.cloudfunctions.net/getplandetails",getAllowedDocuments:"https://us-central1-snipply-sdk-staging.cloudfunctions.net/getalloweddocuments",getNotificationsForDocuments:"https://us-central1-snipply-sdk-staging.cloudfunctions.net/getnotificationsfordocuments",videoBackend:"https://us-central1-snipply-sdk-staging.cloudfunctions.net/videobackend",processRecording:"https://us-central1-snipply-sdk-staging.cloudfunctions.net/processrecording",sdkProxy:"https://staging.velt.dev/v2/core/a",screenshot:"https://staging.velt.dev/v2/screenshots/capture",usCentral1:{setEncryptedData:"https://us-central1-snipply-sdk-staging.cloudfunctions.net/setencrypteddata"},asiaSouthEast1:{setEncryptedData:"https://asia-southeast1-snipply-sdk-staging.cloudfunctions.net/setencrypteddataau"},europeWest1:{setEncryptedData:"https://europe-west1-snipply-sdk-staging.cloudfunctions.net/setencrypteddataeu"},asiaNorthEast1:{setEncryptedData:"https://asia-northeast1-snipply-sdk-staging.cloudfunctions.net/setencrypteddatajp"},australiaSouthEast1:{setEncryptedData:"https://australia-southeast1-snipply-sdk-staging.cloudfunctions.net/setencrypteddataau1"}}};var wn=class wn{static showLogs(){try{return qt.debugMode||!!sessionStorage.getItem("debugMode")||!!sessionStorage.getItem("forceDebugMode")}catch(e){return wn.catch("Error in showLogs: ",e),!1}}};wn.log=wn.showLogs()?console.log:()=>{},wn.warn=wn.showLogs()?console.warn:()=>{},wn.error=wn.showLogs()?console.error:()=>{},wn.debug=wn.showLogs()?console.debug:()=>{},wn.info=wn.showLogs()?console.info:()=>{},wn.logsEnabled=!0,wn.catch=(e,t)=>{try{wn.logsEnabled&&(t!==void 0?console.warn("Velt: ",e,t):console.warn("Velt: ",e))}catch{}};var M=wn;var uCe={NEWLY_ADDED:"newlyAdded",ADDED:"added",UPDATED:"updated",DELETED:"deleted",APPROVED:"approved",ASSIGNED:"assigned",STATUS_CHANGED:"statusChanged",PRIORITY_CHANGED:"priorityChanged",ACCESS_MODE_CHANGED:"accessModeChanged",CUSTOM_LIST_CHANGED:"customListChanged",ACCEPTED:"accepted",REJECTED:"rejected",REACTION_ADDED:"reactionAdded",REACTION_DELETED:"reactionDeleted",SUBSCRIBED:"subscribed",UNSUBSCRIBED:"unsubscribed",SUGGESTION_ACCEPTED:"suggestionAccepted",SUGGESTION_REJECTED:"suggestionRejected"},dCe={COMMENT_ANNOTATION_ADD:"comment_annotation.add",COMMENT_ANNOTATION_DELETE:"comment_annotation.delete",COMMENT_ADD:"comment.add",COMMENT_DELETE:"comment.delete",COMMENT_UPDATE:"comment.update",REACTION_ADD:"reaction.add",REACTION_DELETE:"reaction.delete",ATTACHMENT_ADD:"attachment.add",ATTACHMENT_DELETE:"attachment.delete",RECORDER_ANNOTATION_ADD:"recorder_annotation.add",RECORDER_ANNOTATION_UPDATE:"recorder_annotation.update",RECORDER_ANNOTATION_DELETE:"recorder_annotation.delete",ACTIVITY_SAVE:"activity.save"},hCe={STATUS_CHANGE:"comment_annotation.status_change",PRIORITY_CHANGE:"comment_annotation.priority_change",ASSIGN:"comment_annotation.assign",ACCESS_MODE_CHANGE:"comment_annotation.access_mode_change",CUSTOM_LIST_CHANGE:"comment_annotation.custom_list_change",APPROVE:"comment_annotation.approve",ACCEPT:"comment.accept",REJECT:"comment.reject",SUGGESTION_ACCEPT:"comment_annotation.suggestion_accept",SUGGESTION_REJECT:"comment_annotation.suggestion_reject",REACTION_ADD:"comment.reaction_add",REACTION_DELETE:"comment.reaction_delete",SUBSCRIBE:"comment_annotation.subscribe",UNSUBSCRIBE:"comment_annotation.unsubscribe"},fCe={ADD_COMMENT_ANNOTATION:"addCommentAnnotation",ADD_COMMENT_ANNOTATION_DRAFT:"addCommentAnnotationDraft",DELETE_COMMENT_ANNOTATION:"deleteCommentAnnotation",APPROVE_COMMENT_ANNOTATION:"approveCommentAnnotation",ACCEPT_COMMENT_ANNOTATION:"acceptCommentAnnotation",REJECT_COMMENT_ANNOTATION:"rejectCommentAnnotation",SUBSCRIBE_COMMENT_ANNOTATION:"subscribeCommentAnnotation",UNSUBSCRIBE_COMMENT_ANNOTATION:"unsubscribeCommentAnnotation",ASSIGN_USER:"assignUser",UPDATE_STATUS:"updateStatus",UPDATE_PRIORITY:"updatePriority",UPDATE_ACCESS:"updateAccess",RESOLVE_COMMENT:"resolveComment",ADD_COMMENT:"addComment",ADD_COMMENT_DRAFT:"addCommentDraft",UPDATE_COMMENT:"updateComment",DELETE_COMMENT:"deleteComment",ADD_ATTACHMENT:"addAttachment",DELETE_ATTACHMENT:"deleteAttachment",DELETE_RECORDING:"deleteRecording",COPY_LINK:"copyLink",ADD_REACTION:"addReaction",DELETE_REACTION:"deleteReaction",TOGGLE_REACTION:"toggleReaction",COMMENT_SIDEBAR_DATA_INIT:"commentSidebarDataInit",COMMENT_SIDEBAR_DATA_UPDATE:"commentSidebarDataUpdate",AUTOCOMPLETE_SEARCH:"autocompleteSearch",COMPOSER_CLICKED:"composerClicked",COMPOSER_TEXT_CHANGE:"composerTextChange",LINK_CLICKED:"linkClicked",COMMENT_PIN_CLICKED:"commentPinClicked",COMMENT_BUBBLE_CLICKED:"commentBubbleClicked",COMMENT_TOOL_CLICK:"commentToolClick",COMMENT_TOOL_CLICKED:"commentToolClicked",SIDEBAR_BUTTON_CLICK:"sidebarButtonClick",SIDEBAR_BUTTON_CLICKED:"sidebarButtonClicked",SIDEBAR_OPEN:"sidebarOpen",SIDEBAR_CLOSE:"sidebarClose",FULLSCREEN_CLICK:"fullscreenClick",COMMENT_CLICK:"commentClick",COMMENT_NAVIGATION_BUTTON_CLICK:"commentNavigationButtonClick",ATTACHMENT_DOWNLOAD_CLICKED:"attachmentDownloadClicked",COMMENT_SAVED:"commentSaved",COMMENT_SAVE_TRIGGERED:"commentSaveTriggered",VISIBILITY_OPTION_CLICKED:"visibilityOptionClicked",SUGGESTION_ACCEPTED:"suggestionAccepted",SUGGESTION_REJECTED:"suggestionRejected",COMMENT_ACTION_CLICKED:"commentActionClicked"},pCe={TRANSCRIPTION_DONE:"transcriptionDone",RECORDING_DONE:"recordingDone",RECORDING_EDIT_DONE:"recordingEditDone",DELETE_RECORDING:"deleteRecording",ERROR:"error",RECORDING_SAVE_INITIATED:"recordingSaveInitiated",RECORDING_STARTED:"recordingStarted",RECORDING_PAUSED:"recordingPaused",RECORDING_RESUMED:"recordingResumed",RECORDING_CANCELLED:"recordingCancelled",RECORDING_STOPPED:"recordingStopped",RECORDING_DONE_LOCAL:"recordingDoneLocal"},gCe={TEXT_SELECTED:"textSelected"},mCe={SUGGESTION_CREATED:"suggestionCreated",SUGGESTION_APPROVED:"suggestionApproved",SUGGESTION_REJECTED:"suggestionRejected",SUGGESTION_STALE:"suggestionStale",TARGET_EDIT_START:"targetEditStart",TARGET_EDIT_COMMIT:"targetEditCommit"},Hi={PERMISSION_PROVIDER:"permissionProvider",USER_RESOLVER:"userResolver",COMMENT_RESOLVER:"commentResolver",ATTACHMENT_RESOLVER:"attachmentResolver",REACTION_RESOLVER:"reactionResolver",RECORDER_RESOLVER:"recorderResolver",NOTIFICATION_RESOLVER:"notificationResolver",ACTIVITY_RESOLVER:"activityResolver",VELT_BUTTON_CLICK:"veltButtonClick",USER_UPDATE:"userUpdate",INIT_UPDATE:"initUpdate",DOCUMENT_INIT:"documentInit",ERROR:"error"},ECe={ACCESS_REQUESTED:"accessRequested",ACCESS_REQUEST_CANCELED:"accessRequestCanceled",ACCESS_ACCEPTED:"accessAccepted",ACCESS_REJECTED:"accessRejected",EDITOR_ASSIGNED:"editorAssigned",VIEWER_ASSIGNED:"viewerAssigned",EDITOR_ON_DIFFERENT_TAB_DETECTED:"editorOnDifferentTabDetected"},_Ce={MULTIPLE_USERS_ONLINE:"multipleUsersOnline",USER_STATE_CHANGE:"userStateChange"},TCe={SETTINGS_UPDATED:"settingsUpdated"},ICe={UPDATE_DATA:"updateData"},b7=(function(n){return n.ADDED="added",n.UPDATED="updated",n.DELETED="deleted",n.APPROVED="approved",n.RESOLVED="resolved",n})(b7||{}),O7=(function(n){return n.INVITE="invite",n.REMOVE="remove",n})(O7||{}),M7=(function(n){return n.CREATED="created",n.JOINED="joined",n})(M7||{}),L7=(function(n){return n.UPDATE_DATA="updateData",n})(L7||{}),P7=(function(n){return n.ADDED="added",n.UPDATED="updated",n.DELETED="deleted",n.APPROVED="approved",n.RESOLVED="resolved",n})(P7||{}),x7=(function(n){return n.ADDED="added",n.UPDATED="updated",n.DELETED="deleted",n})(x7||{}),yCe={ADDED:"added",UPDATED:"updated",DELETED:"deleted"},k7=(function(n){return n.FIRST_VIEWED="firstViewed",n})(k7||{}),kD=(function(n){return n.AREA="area",n.ARROW="arrow",n.AUDIO_HUDDLE="audioHuddle",n.COMMENT="comment",n.MULTI_THREAD="multiThread",n.CURSOR="cursor",n.HUDDLE="huddle",n.LIVE_STATE_SYNC="liveStateSync",n.PRESENCE="presence",n.TAG="tag",n.RECORDER="recorder",n.REWRITER="rewriter",n.LIVE_SELECTION="liveSelection",n.NOTIFICATION="notification",n.REACTION="reaction",n.ACTIVITY="activity",n.VIEWS="views",n.USER_INVITE="userInvite",n.USER_REQUEST="userRequest",n.VIDEO_PLAYER="videoPlayer",n.CRDT="crdt",n})(kD||{}),F7=(function(n){return n.AREA="area",n.ARROW="arrow",n.AUDIO_HUDDLE="audioHuddle",n.COMMENT="comment",n.MULTI_THREAD="multiThread",n.CURSOR="cursor",n.HUDDLE="huddle",n.LIVE_STATE_SYNC="liveStateSync",n.PRESENCE="presence",n.TAG="tag",n.RECORDER="recorder",n.REWRITER="rewriter",n.LIVE_SELECTION="liveSelection",n.NOTIFICATION="notification",n.REACTION="reaction",n.AREA_COMMENT="areaComment",n.INLINE_COMMENT="inlineComment",n.COMMENT_SIDEBAR="commentSidebar",n})(F7||{}),gr=(function(n){return n.DESKTOP="Desktop",n.MOBILE="Mobile",n.TABLET="Tablet",n.MONITOR="Monitor",n.UNKNOWN="Unknown",n})(gr||{}),zu=(function(n){return n.PORTRAIT="portrait",n.LANDSCAPE="landscape",n.UNKNOWN="unknown",n})(zu||{}),tT=(function(n){return n.Portrait="(orientation: portrait)",n.Landscape="(orientation: landscape)",n})(tT||{}),U7=(function(n){return n.DIFFERENT_DEVICE="differentDevice",n.ELEMENT_DELETED="elementDeleted",n})(U7||{}),qu=(function(n){return n.ADMIN="Admin",n.COMMENTER="Commenter",n})(qu||{}),bn={PUBLIC:"public",RESTRICTED:"restricted",ORGANIZATION_PRIVATE:"organizationPrivate"},V7=(function(n){return n.DEFAULT="default",n.DYNAMIC_ID="dynamicId",n})(V7||{}),nT={PUBLIC:"public",PRIVATE:"private"},B7=(function(n){return n.MINIMAL="minimal",n.VERBOSE="verbose",n})(B7||{}),G7=(function(n){return n.DEFAULT="default",n.EXPANDED="expanded",n})(G7||{}),j7=(function(n){return n.TOTAL="total",n.UNREAD="unread",n})(j7||{}),vCe={ONLINE:"online",OFFLINE:"offline",PENDING_INIT:"pendingInit",PENDING_DATA:"pendingData"},SCe={ALL:"all",ORGANIZATION:"organization",ORGANIZATION_USER_GROUP:"organizationUserGroup",DOCUMENT:"document",FOLDER:"folder"},ACe={AND:"and",OR:"or"},H7=(function(n){return n.RESTRICTED_SELF="restrictedSelf",n.RESTRICTED_SELECTED_PEOPLE="restrictedSelectedPeople",n.ORGANIZATION_PRIVATE="organizationPrivate",n.PUBLIC="public",n})(H7||{});var U=class U{};U.SNIPPYLY_HOST_URL_PROD="https://snippyly.com",U.SNIPPYLY_HOST_URL_STAGING="https://snippyly-staging.web.app",U.USER_TYPE_ANONYMOUS="anonymous",U.USER_TYPE_SIGNED_IN="signedIn",U.LOCALSTORAGE_DATA_ID="snippylytempdata",U.NO_ORGANIZATION_ID="veltNoOrganization",U.DEFAULT_QUERY_HASH="default",U.LISTENER_BATCH_SIZE=5,U.LISTENER_CONTEXT_BATCH_SIZE=25,U.FIRESTORE_MAX_DISJUNCTIONS=30,U.FIRESTORE_IN_QUERY_LIMIT=30,U.DEFAULT_VELT_CONTEXT="default:velt",U.VISIBILITY_SELF_PREFIX="__velt_private_self:",U.VISIBILITY_ORG_PREFIX="organizationPrivate:",U.FIREBASE_PARTIAL_PATH_ORGANIZATIONS="organizations",U.FIREBASE_PARTIAL_PATH_FOLDERS="folders",U.FIREBASE_PARTIAL_PATH_DOCS="docs",U.FIREBASE_PARTIAL_PATH_DOCUMENT_CONFIGURATIONS="documentConfigurations",U.FIREBASE_PARTIAL_PATH_PRESENCE="presence",U.FIREBASE_PARTIAL_PATH_ORGANIZATION_USERS="orgIamUsers",U.FIREBASE_PARTIAL_PATH_CENTRAL_USERS="users",U.FIREBASE_PARTIAL_PATH_FOLDER_USERS="folderIamUsers",U.FIREBASE_PARTIAL_PATH_DOCUMENT_USERS="docIamUsers",U.FIREBASE_PARTIAL_PATH_CURSOR="cursor",U.FIREBASE_PARTIAL_PATH_ARROW="arrow",U.FIREBASE_PARTIAL_PATH_AREA="area",U.FIREBASE_PARTIAL_PATH_COMMENT="comment",U.FIREBASE_PARTIAL_PATH_LOCATION="location",U.FIREBASE_PARTIAL_PATH_MULTI_THREAD="multiThread",U.FIREBASE_PARTIAL_PATH_TAG="tag",U.FIREBASE_PARTIAL_PATH_SELECTION="selection",U.FIREBASE_PARTIAL_PATH_AUDIO_HUDDLE="audioHuddle",U.FIREBASE_PARTIAL_PATH_HUDDLE="huddle",U.FIREBASE_PARTIAL_PATH_CONTACTS="contacts",U.FIREBASE_PARTIAL_PATH_GROUPS="groups",U.FIREBASE_PARTIAL_PATH_NOTIFICATION_DOCS="notificationsDocs",U.FIREBASE_PARTIAL_PATH_NOTIFICATION_USERS="notificationsUsers",U.FIREBASE_PARTIAL_PATH_DOC_NOTIFICATION="notificationsDocs__notification",U.FIREBASE_PARTIAL_PATH_USER_NOTIFICATION="notificationsUsers__notification",U.FIREBASE_PARTIAL_PATH_USER_NOTIFICATION_INDEX="userNotificationIndex",U.FIREBASE_PARTIAL_PATH_GLOBAL="global",U.FIREBASE_PARTIAL_PATH_LOGINS="logins",U.FIREBASE_PARTIAL_PATH_METADATA="metadata",U.FIREBASE_PARTIAL_PATH_ORGANIZATION_METADATA="metadata",U.FIREBASE_PARTIAL_PATH_ORGANIZATION_GROUPS="groups",U.FIREBASE_PARTIAL_PATH_LOCATIONS="locations",U.FIREBASE_PARTIAL_PATH_RECORDER="recorder",U.FIREBASE_PARTIAL_PATH_FOLLOW_ALONG="flock",U.FIREBASE_PARTIAL_PATH_SYNC_VIDEO_PLAYER="syncVideoPlayer",U.FIREBASE_PARTIAL_PATH_LIVE_STATE="liveState",U.FIREBASE_PARTIAL_PATH_IAM="iam",U.FIREBASE_PARTIAL_PATH_REACTION="reaction",U.FIREBASE_PARTIAL_PATH_CRDT="crdt",U.FIREBASE_PARTIAL_PATH_VIEWS="views",U.FIREBASE_PARTIAL_PATH_NOTIFICATION_VIEWS="notificationViews",U.FIREBASE_PARTIAL_PATH_DOCUMENT_VIEWS="documentViews",U.FIREBASE_PARTIAL_PATH_LOCATION_VIEWS="locationViews",U.FIREBASE_PARTIAL_PATH_NOTIFICATIONS="notifications",U.FIREBASE_PARTIAL_PATH_ORGANIZATION_NOTIFICATIONS="notifications",U.FIREBASE_PARTIAL_PATH_LAST_NOTIFICATION_TIMESTAMP="lastNotificationTimestamp",U.FIREBASE_PARTIAL_PATH_ACTIVITIES="activities",U.FIREBASE_PARTIAL_PATH_LAST_ACTIVITY_TIMESTAMP="lastActivityTimestamp",U.FIREBASE_PARTIAL_PATH_HEARTBEAT="heartbeat",U.FIREBASE_PARTIAL_PATH_HEARTBEAT_BY_DOCUMENT="heartbeatByDocument",U.FIREBASE_PARTIAL_PATH_USERS="users",U.FIREBASE_PARTIAL_PATH_PERMISSIONS_USERS="permissions",U.FIREBASE_PARTIAL_PATH_USER_REQUESTS="userRequests",U.FIREBASE_PARTIAL_PATH_FEEDBACK="feedback",U.FIREBASE_PARTIAL_PATH_BUGS="bugs",U.FIREBASE_PARTIAL_PATH_CONTACT_US="contactUs",U.FIREBASE_PARTIAL_PATH_CUSTOMER_METADATA="metadata",U.PRESENCE_STATUS_ONLINE="online",U.PRESENCE_STATUS_OFFLINE="offline",U.PRESENCE_STATUS_AWAY="away",U.IMG_URL_NOT_FOUND="https://snippyly.com/assets/icons/anon-user.svg",U.IMG_CLASS_NOT_FOUND="presence-avatar-image-small",U.AVATAR_COLOR_LIST=["#a259fe","#9746ff","#19bcfe","#FE8947","#2c83fc","#0dcf82","#ffcb00","#ff7162","#FFD600","#A5A7FE","#67DBF4","#FDA192"],U.TEXT_COLOR_MAP={"#a259fe":"#ffffff","#9746ff":"#ffffff","#19bcfe":"#ffffff","#FE8947":"#ffffff","#2c83fc":"#ffffff","#0dcf82":"#141416","#ffcb00":"#141416","#ff7162":"#ffffff","#FFD600":"#141416","#A5A7FE":"#141416","#67DBF4":"#141416","#FDA192":"#141416"},U.UNREAD_COMMENTS_CHECK_FROM_DATE="2024-02-05",U.DEFAULT_ANNOTATION_COLOR="#a259fe",U.REGEX_EMAIL=/(\+|@)+([a-zA-Z0-9._+-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+)/gi,U.REGEX_URL=/((([A-Za-z]{3,9}:(?:\/\/)?)(?:[\-;:&=\+\$,\w]+@)?[A-Za-z0-9\.\-]+|(?:www\.|[\-;:&=\+\$,\w]+@)[A-Za-z0-9\.\-]+)(?::[0-9]+)?((?:\/[\+~%\/\.\w\-_]*)?\??(?:[\-\+=&;%@\.\w_0-9]*)#?(?:[\.\!\/\\\w0-9=]*))?)/gi,U.REGEX_URL_FOR_USER_NAME=/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/gi,U.REGEX_SPECIAL_CHARS=/[`!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~]/,U.SNIPPYLY_HIGHLIGHT="snippyly-highlight",U.SNIPPYLY_HIGHLIGHT_PREVIEW="snippyly-highlight-preview",U.SNIPPYLY_HIGHLIGHT_USER="snippyly-highlight-user",U.SNIPPYLY_HIGHLIGHT_USER_NAME="snippyly-highlight-user-name",U.SNIPPYLY_HIGHLIGHT_USER_TEXT="snippyly-highlight-user-text",U.VELT_LIVE_SELECTION_ON_ELEMENT="velt-live-selection-on-element",U.VELT_LIVE_SELECTION_ON_ELEMENT_DEFAULT="velt-live-selection-on-element-default",U.VELT_LIVE_SELECTION_ON_TEXT="velt-live-selection-on-text",U.VELT_LIVE_SELECTION_ON_TEXT_DEFAULT="velt-live-selection-on-text-default",U.VELT_IGNORE_CHANGE_DETECTION="velt-ignore-change-detection",U.VELT_CUSTOM_CSS="velt-custom-css",U.TAGS={SNIPPYLY_ROOT:"snippyly-root",SNIPPYLY_PRESENCE:"snippyly-presence",SNIPPYLY_CURSOR:"snippyly-cursor",SNIPPYLY_COMMENT_TOOL:"snippyly-comment-tool",SNIPPYLY_COMMENTS:"snippyly-comments",SNIPPYLY_TAG_TOOL:"snippyly-tag-tool",SNIPPYLY_TAGS:"snippyly-tags",SNIPPYLY_RECORDER_NOTES:"snippyly-recorder-notes",SNIPPYLY_RECORDER_CONTROL_PANEL:"snippyly-recorder-control-panel",SNIPPYLY_RECORDER_CONTROL_PANEL_INTERNAL:"snippyly-recorder-control-panel-internal",SNIPPYLY_RECORDER_PLAYER:"snippyly-recorder-player",SNIPPYLY_TEXT_HIGHLIGHT:"snippyly-text-highlight",SNIPPYLY_COMMENT_TEXT_PORTAL:"snippyly-comment-text-portal",SNIPPYLY_COMMENT_TEXT:"snippyly-comment-text",SNIPPYLY_COMMENTS_SIDEBAR:"snippyly-comments-sidebar",SNIPPYLY_COMMENT_BUBBLE:"snippyly-comment-bubble",SNIPPYLY_HIGHLIGHT_USER_TEXT:"snippyly-highlight-user-text",SNIPPYLY_AUDIO_HUDDLE:"snippyly-audio-huddle",SNIPPYLY_VIDEO_HUDDLE:"snippyly-video-huddle",SNIPPYLY_HUDDLE:"snippyly-huddle",SNIPPYLY_HUDDLE_TOOL:"snippyly-huddle-tool",SNIPPYLY_RECORDER_TOOL:"snippyly-recorder-tool",SNIPPYLY_PLUGIN:"snippyly-plugin",SNIPPYLY_MENU:"snippyly-menu",SNIPPYLY_COMMENT_DIALOG:"snippyly-comment-dialog",SNIPPYLY_SIDEBAR_BUTTON:"snippyly-sidebar-button",SNIPPYLY_REWRITER:"snippyly-rewriter",SNIPPYLY_USER_INVITE_TOOL:"snippyly-user-invite-tool",SNIPPYLY_USER_REQUEST_TOOL:"snippyly-user-request-tool",SNIPPYLY_USER_AVATAR:"snippyly-user-avatar",SNIPPYLY_ARROW_TOOL:"snippyly-arrow-tool",SNIPPYLY_ARROWS:"snippyly-arrows",SNIPPYLY_AREA_TOOL:"snippyly-area-tool",SNIPPYLY_AREAS:"snippyly-areas",VELT_ROOT:"velt-root",VELT_PRESENCE:"velt-presence",VELT_CURSOR:"velt-cursor",VELT_COMMENT_TOOL:"velt-comment-tool",VELT_COMMENTS:"velt-comments",VELT_TAG_TOOL:"velt-tag-tool",VELT_TAGS:"velt-tags",VELT_RECORDER_NOTES:"velt-recorder-notes",VELT_RECORDER_CONTROL_PANEL:"velt-recorder-control-panel",VELT_RECORDER_CONTROL_PANEL_EMBED:"velt-recorder-control-panel-embed",SNIPPYLY_RECORDER_CONTROL_PANEL_EMBED:"snippyly-recorder-control-panel-embed",VELT_RECORDER_PLAYER:"velt-recorder-player",VELT_RECORDER_PLAYER_EMBED:"velt-recorder-player-embed",SNIPPYLY_RECORDER_PLAYER_EMBED:"snippyly-recorder-player-embed",VELT_VIDEO_EDITOR:"velt-video-editor",VELT_TEXT_HIGHLIGHT:"velt-text-highlight",VELT_COMMENT_TEXT_PORTAL:"velt-comment-text-portal",VELT_COMMENTS_SIDEBAR:"velt-comments-sidebar",VELT_COMMENTS_SIDEBAR_V2:"velt-comments-sidebar-v2",VELT_COMMENT_SIDEBAR_SKELETON_V2:"velt-comment-sidebar-skeleton-v2",VELT_COMMENT_SIDEBAR_PANEL_V2:"velt-comment-sidebar-panel-v2",VELT_COMMENT_SIDEBAR_LIST_V2:"velt-comment-sidebar-list-v2",VELT_COMMENT_SIDEBAR_LIST_ITEM_V2:"velt-comment-sidebar-list-item-v2",VELT_COMMENT_SIDEBAR_FILTER_DROPDOWN_CONTENT_LIST_V2:"velt-comment-sidebar-filter-dropdown-content-list-v2",VELT_COMMENT_SIDEBAR_FILTER_DROPDOWN_CONTENT_LIST_CATEGORY_V2:"velt-comment-sidebar-filter-dropdown-content-list-category-v2",VELT_COMMENT_SIDEBAR_FILTER_DROPDOWN_CONTENT_LIST_CATEGORY_LABEL_V2:"velt-comment-sidebar-filter-dropdown-content-list-category-label-v2",VELT_COMMENT_SIDEBAR_FILTER_DROPDOWN_CONTENT_LIST_CATEGORY_CONTENT_V2:"velt-comment-sidebar-filter-dropdown-content-list-category-content-v2",VELT_COMMENT_SIDEBAR_FILTER_DROPDOWN_CONTENT_LIST_ITEM_V2:"velt-comment-sidebar-filter-dropdown-content-list-item-v2",VELT_COMMENT_SIDEBAR_FILTER_DROPDOWN_CONTENT_LIST_ITEM_INDICATOR_V2:"velt-comment-sidebar-filter-dropdown-content-list-item-indicator-v2",VELT_COMMENT_SIDEBAR_FILTER_DROPDOWN_CONTENT_LIST_ITEM_LABEL_V2:"velt-comment-sidebar-filter-dropdown-content-list-item-label-v2",VELT_COMMENT_SIDEBAR_FILTER_DROPDOWN_CONTENT_LIST_ITEM_COUNT_V2:"velt-comment-sidebar-filter-dropdown-content-list-item-count-v2",VELT_COMMENT_SIDEBAR_FILTER_DROPDOWN_V2:"velt-comment-sidebar-filter-dropdown-v2",VELT_COMMENT_SIDEBAR_FILTER_DROPDOWN_TRIGGER_V2:"velt-comment-sidebar-filter-dropdown-trigger-v2",VELT_COMMENT_SIDEBAR_FILTER_DROPDOWN_CONTENT_V2:"velt-comment-sidebar-filter-dropdown-content-v2",VELT_COMMENT_SIDEBAR_FILTER_BUTTON_V2:"velt-comment-sidebar-filter-button-v2",VELT_COMMENT_SIDEBAR_FILTER_BUTTON_V2_APPLIED_ICON:"velt-comment-sidebar-filter-button-v2-applied-icon",VELT_COMMENT_SIDEBAR_FILTER_CONTAINER_V2:"velt-comment-sidebar-filter-container-v2",VELT_COMMENT_SIDEBAR_FILTER_CONTAINER_V2_SECTION:"velt-comment-sidebar-filter-container-v2-section",VELT_COMMENT_SIDEBAR_FILTER_CONTAINER_V2_SECTION_FIELD:"velt-comment-sidebar-filter-container-v2-section-field",VELT_COMMENT_SIDEBAR_FILTER_CONTAINER_V2_SECTION_LIST:"velt-comment-sidebar-filter-container-v2-section-list",VELT_COMMENT_SIDEBAR_FILTER_CONTAINER_V2_SECTION_LABEL:"velt-comment-sidebar-filter-container-v2-section-label",VELT_COMMENT_SIDEBAR_FILTER_CONTAINER_V2_SECTION_CONTROL:"velt-comment-sidebar-filter-container-v2-section-control",VELT_COMMENT_SIDEBAR_FILTER_CONTAINER_V2_SECTION_OPTION_LIST:"velt-comment-sidebar-filter-container-v2-section-option-list",VELT_COMMENT_SIDEBAR_FILTER_CONTAINER_V2_SECTION_OPTION:"velt-comment-sidebar-filter-container-v2-section-option",VELT_COMMENT_SIDEBAR_FILTER_CONTAINER_V2_SECTION_OPTION_CHECKBOX:"velt-comment-sidebar-filter-container-v2-section-option-checkbox",VELT_COMMENT_SIDEBAR_FILTER_CONTAINER_V2_SECTION_CONTROL_VALUE:"velt-comment-sidebar-filter-container-v2-section-control-value",VELT_COMMENT_SIDEBAR_FILTER_CONTAINER_V2_SECTION_CONTROL_CHIP:"velt-comment-sidebar-filter-container-v2-section-control-chip",VELT_COMMENT_SIDEBAR_FILTER_CONTAINER_V2_SECTION_CONTROL_CHIP_LIST:"velt-comment-sidebar-filter-container-v2-section-control-chip-list",VELT_COMMENT_SIDEBAR_FILTER_CONTAINER_V2_SECTION_CONTROL_SEARCH:"velt-comment-sidebar-filter-container-v2-section-control-search",VELT_COMMENT_SIDEBAR_FILTER_CONTAINER_V2_SECTION_CONTROL_CHEVRON:"velt-comment-sidebar-filter-container-v2-section-control-chevron",VELT_COMMENT_SIDEBAR_FILTER_CONTAINER_V2_SECTION_OPTION_NAME:"velt-comment-sidebar-filter-container-v2-section-option-name",VELT_COMMENT_SIDEBAR_FILTER_CONTAINER_V2_SECTION_OPTION_COUNT:"velt-comment-sidebar-filter-container-v2-section-option-count",VELT_COMMENT_SIDEBAR_FILTER_CONTAINER_V2_TITLE:"velt-comment-sidebar-filter-container-v2-title",VELT_COMMENT_SIDEBAR_FILTER_CONTAINER_V2_CLOSE_BUTTON:"velt-comment-sidebar-filter-container-v2-close-button",VELT_COMMENT_SIDEBAR_FILTER_CONTAINER_V2_GROUP_BY:"velt-comment-sidebar-filter-container-v2-group-by",VELT_COMMENT_SIDEBAR_FILTER_CONTAINER_V2_RESET_BUTTON:"velt-comment-sidebar-filter-container-v2-reset-button",VELT_COMMENT_SIDEBAR_FILTER_CONTAINER_V2_APPLY_BUTTON:"velt-comment-sidebar-filter-container-v2-apply-button",VELT_COMMENT_SIDEBAR_SEARCH_V2:"velt-comment-sidebar-search-v2",VELT_COMMENT_SIDEBAR_SEARCH_V2_ICON:"velt-comment-sidebar-search-v2-icon",VELT_COMMENT_SIDEBAR_SEARCH_V2_INPUT:"velt-comment-sidebar-search-v2-input",VELT_COMMENT_SIDEBAR_FULLSCREEN_BUTTON_V2:"velt-comment-sidebar-fullscreen-button-v2",VELT_COMMENT_SIDEBAR_LIST_GROUP_HEADER_V2:"velt-comment-sidebar-list-group-header-v2",VELT_COMMENT_SIDEBAR_LIST_GROUP_HEADER_V2_LABEL:"velt-comment-sidebar-list-group-header-v2-label",VELT_COMMENT_SIDEBAR_LIST_GROUP_HEADER_V2_COUNT:"velt-comment-sidebar-list-group-header-v2-count",VELT_COMMENT_SIDEBAR_LIST_GROUP_HEADER_V2_SEPARATOR:"velt-comment-sidebar-list-group-header-v2-separator",VELT_COMMENT_SIDEBAR_LIST_GROUP_HEADER_V2_CHEVRON:"velt-comment-sidebar-list-group-header-v2-chevron",VELT_COMMENT_SIDEBAR_HEADER_V2:"velt-comment-sidebar-header-v2",VELT_COMMENT_SIDEBAR_CLOSE_BUTTON_V2:"velt-comment-sidebar-close-button-v2",VELT_COMMENT_SIDEBAR_EMPTY_PLACEHOLDER_V2:"velt-comment-sidebar-empty-placeholder-v2",VELT_COMMENT_SIDEBAR_RESET_FILTER_BUTTON_V2:"velt-comment-sidebar-reset-filter-button-v2",VELT_COMMENT_SIDEBAR_PAGE_MODE_COMPOSER_V2:"velt-comment-sidebar-page-mode-composer-v2",VELT_COMMENT_SIDEBAR_FOCUSED_THREAD_V2:"velt-comment-sidebar-focused-thread-v2",VELT_COMMENT_SIDEBAR_FOCUSED_THREAD_BACK_BUTTON_V2:"velt-comment-sidebar-focused-thread-back-button-v2",VELT_COMMENT_SIDEBAR_FOCUSED_THREAD_DIALOG_CONTAINER_V2:"velt-comment-sidebar-focused-thread-dialog-container-v2",VELT_COMMENT_BUBBLE:"velt-comment-bubble",VELT_COMMENT_BUBBLE_AVATAR:"velt-comment-bubble-avatar",VELT_COMMENT_BUBBLE_COMMENTS_COUNT:"velt-comment-bubble-comments-count",VELT_COMMENT_BUBBLE_UNREAD_ICON:"velt-comment-bubble-unread-icon",VELT_COMMENT_THREAD:"velt-comment-thread",VELT_COMMENT_PIN:"velt-comment-pin",VELT_COMMENT_PIN_EMBED:"velt-comment-pin-embed",SNIPPYLY_COMMENT_PIN_EMBED:"snippyly-comment-pin-embed",VELT_COMMENT_PIN_NUMBER:"velt-comment-pin-number",VELT_COMMENT_PIN_INDEX:"velt-comment-pin-index",VELT_COMMENT_PIN_TRIANGLE:"velt-comment-pin-triangle",VELT_COMMENT_PIN_PRIVATE_COMMENT_INDICATOR:"velt-comment-pin-private-comment-indicator",VELT_COMMENT_PIN_GHOST_COMMENT_INDICATOR:"velt-comment-pin-ghost-comment-indicator",VELT_COMMENT_PIN_UNREAD_COMMENT_INDICATOR:"velt-comment-pin-unread-comment-indicator",VELT_SIDEBAR_BUTTON_ICON:"velt-sidebar-button-icon",VELT_SIDEBAR_BUTTON_COMMENTS_COUNT:"velt-sidebar-button-comments-count",VELT_SIDEBAR_BUTTON_UNREAD_ICON:"velt-sidebar-button-unread-icon",VELT_COMMENT_TEXT:"velt-comment-text",VELT_CHART_COMMENT:"velt-chart-comment",VELT_CANVAS_COMMENT:"velt-canvas-comment",VELT_INLINE_COMMENTS_SECTION:"velt-inline-comments-section",VELT_INLINE_COMMENTS_SECTION_SKELETON:"velt-inline-comments-section-skeleton",VELT_INLINE_COMMENTS_SECTION_PANEL:"velt-inline-comments-section-panel",VELT_INLINE_COMMENTS_SECTION_LIST:"velt-inline-comments-section-list",VELT_INLINE_COMMENTS_SECTION_COMPOSER_CONTAINER:"velt-inline-comments-section-composer-container",VELT_INLINE_COMMENTS_SECTION_COMMENT_COUNT:"velt-inline-comments-section-comment-count",VELT_INLINE_COMMENTS_SECTION_SORTING_DROPDOWN:"velt-inline-comments-section-sorting-dropdown",VELT_INLINE_COMMENTS_SECTION_SORTING_DROPDOWN_TRIGGER:"velt-inline-comments-section-sorting-dropdown-trigger",VELT_INLINE_COMMENTS_SECTION_SORTING_DROPDOWN_TRIGGER_NAME:"velt-inline-comments-section-sorting-dropdown-trigger-name",VELT_INLINE_COMMENTS_SECTION_SORTING_DROPDOWN_TRIGGER_ICON:"velt-inline-comments-section-sorting-dropdown-trigger-icon",VELT_INLINE_COMMENTS_SECTION_SORTING_DROPDOWN_CONTENT:"velt-inline-comments-section-sorting-dropdown-content",VELT_INLINE_COMMENTS_SECTION_SORTING_DROPDOWN_CONTENT_ITEM:"velt-inline-comments-section-sorting-dropdown-content-item",VELT_INLINE_COMMENTS_SECTION_SORTING_DROPDOWN_CONTENT_ITEM_ICON:"velt-inline-comments-section-sorting-dropdown-content-item-icon",VELT_INLINE_COMMENTS_SECTION_SORTING_DROPDOWN_CONTENT_ITEM_TICK:"velt-inline-comments-section-sorting-dropdown-content-item-tick",VELT_INLINE_COMMENTS_SECTION_SORTING_DROPDOWN_CONTENT_ITEM_NAME:"velt-inline-comments-section-sorting-dropdown-content-item-name",VELT_INLINE_COMMENTS_SECTION_FILTER_DROPDOWN:"velt-inline-comments-section-filter-dropdown",VELT_INLINE_COMMENTS_SECTION_FILTER_DROPDOWN_TRIGGER:"velt-inline-comments-section-filter-dropdown-trigger",VELT_INLINE_COMMENTS_SECTION_FILTER_DROPDOWN_TRIGGER_NAME:"velt-inline-comments-section-filter-dropdown-trigger-name",VELT_INLINE_COMMENTS_SECTION_FILTER_DROPDOWN_TRIGGER_ARROW:"velt-inline-comments-section-filter-dropdown-trigger-arrow",VELT_INLINE_COMMENTS_SECTION_FILTER_DROPDOWN_CONTENT:"velt-inline-comments-section-filter-dropdown-content",VELT_INLINE_COMMENTS_SECTION_FILTER_DROPDOWN_CONTENT_LIST:"velt-inline-comments-section-filter-dropdown-content-list",VELT_INLINE_COMMENTS_SECTION_FILTER_DROPDOWN_CONTENT_LIST_ITEM:"velt-inline-comments-section-filter-dropdown-content-list-item",VELT_INLINE_COMMENTS_SECTION_FILTER_DROPDOWN_CONTENT_LIST_ITEM_CHECKBOX:"velt-inline-comments-section-filter-dropdown-content-list-item-checkbox",VELT_INLINE_COMMENTS_SECTION_FILTER_DROPDOWN_CONTENT_LIST_ITEM_LABEL:"velt-inline-comments-section-filter-dropdown-content-list-item-label",VELT_INLINE_COMMENTS_SECTION_FILTER_DROPDOWN_CONTENT_APPLY_BUTTON:"velt-inline-comments-section-filter-dropdown-content-apply-button",VELT_COMMENTS_MINIMAP:"velt-comments-minimap",VELT_HIGHLIGHT_USER_TEXT:"velt-highlight-user-text",VELT_AUDIO_HUDDLE:"velt-audio-huddle",VELT_VIDEO_HUDDLE:"velt-video-huddle",VELT_HUDDLE:"velt-huddle",VELT_HUDDLE_TOOL:"velt-huddle-tool",VELT_RECORDER_TOOL:"velt-recorder-tool",SUPERFLOW_TOOLBAR:"superflow-toolbar",VELT_MENU:"velt-menu",VELT_COMMENT_DIALOG:"velt-comment-dialog-internal",VELT_SIDEBAR_BUTTON:"velt-sidebar-button",VELT_COMMENTS_SIDEBAR_BUTTON:"velt-comments-sidebar-button",VELT_REWRITER:"velt-rewriter",VELT_USER_INVITE_TOOL:"velt-user-invite-tool",VELT_USER_REQUEST_TOOL:"velt-user-request-tool",VELT_USER_AVATAR:"velt-user-avatar",VELT_ARROW_TOOL:"velt-arrow-tool",VELT_ARROWS:"velt-arrows",VELT_AREA_TOOL:"velt-area-tool",VELT_AREAS:"velt-areas",VELT_INLINE_COMMENT:"velt-inline-comment",VELT_VIDEO_PLAYER:"velt-video-player",VELT_VIDEO_COMMENTS_TIMELINE:"velt-comment-player-timeline",VELT_REACTION_TOOL:"velt-reaction-tool",SNIPPYLY_REACTION_TOOL:"snippyly-reaction-tool",VELT_REACTION_PIN:"velt-reaction-pin",SNIPPYLY_REACTION_PIN:"snippyly-reaction-pin",VELT_INLINE_REACTIONS_SECTION:"velt-inline-reactions-section",SNIPPYLY_INLINE_REACTIONS_SECTION:"snippyly-inline-reactions-section",VELT_VIEW_ANALYTICS:"velt-view-analytics",VELT_NOTIFICATIONS_TOOL:"velt-notifications-tool",VELT_NOTIFICATIONS_TOOL_ICON:"velt-notifications-tool-icon",VELT_NOTIFICATIONS_TOOL_UNREAD_ICON:"velt-notifications-tool-unread-icon",VELT_NOTIFICATIONS_TOOL_LABEL:"velt-notifications-tool-label",VELT_NOTIFICATIONS_TOOL_UNREAD_COUNT:"velt-notifications-tool-unread-count",VELT_NOTIFICATIONS_PANEL:"velt-notifications-panel",VELT_NOTIFICATIONS_PANEL_TITLE:"velt-notifications-panel-title",VELT_NOTIFICATIONS_PANEL_TITLE_TEXT:"velt-notifications-panel-title-text",VELT_NOTIFICATIONS_PANEL_HEADER:"velt-notifications-panel-header",VELT_NOTIFICATIONS_PANEL_HEADER_TAB_FOR_YOU:"velt-notifications-panel-header-tab-for-you",VELT_NOTIFICATIONS_PANEL_HEADER_TAB_PEOPLE:"velt-notifications-panel-header-tab-people",VELT_NOTIFICATIONS_PANEL_HEADER_TAB_DOCUMENTS:"velt-notifications-panel-header-tab-documents",VELT_NOTIFICATIONS_PANEL_HEADER_TAB_ALL:"velt-notifications-panel-header-tab-all",VELT_NOTIFICATIONS_PANEL_CONTENT:"velt-notifications-panel-content",VELT_NOTIFICATIONS_PANEL_CONTENT_FOR_YOU:"velt-notifications-panel-content-for-you",VELT_NOTIFICATIONS_PANEL_CONTENT_ALL:"velt-notifications-panel-content-all",VELT_NOTIFICATIONS_PANEL_CONTENT_PEOPLE:"velt-notifications-panel-content-people",VELT_NOTIFICATIONS_PANEL_CONTENT_DOCUMENTS:"velt-notifications-panel-content-documents",VELT_NOTIFICATIONS_PANEL_CONTENT_LIST:"velt-notifications-panel-content-list",VELT_NOTIFICATIONS_PANEL_CONTENT_LIST_ITEM:"velt-notifications-panel-content-list-item",VELT_NOTIFICATIONS_PANEL_CONTENT_LIST_ITEM_AVATAR:"velt-notifications-panel-content-list-item-avatar",VELT_NOTIFICATIONS_PANEL_CONTENT_LIST_ITEM_UNREAD:"velt-notifications-panel-content-list-item-unread",VELT_NOTIFICATIONS_PANEL_CONTENT_LIST_ITEM_HEADLINE:"velt-notifications-panel-content-list-item-headline",VELT_NOTIFICATIONS_PANEL_CONTENT_LIST_ITEM_BODY:"velt-notifications-panel-content-list-item-body",VELT_NOTIFICATIONS_PANEL_CONTENT_LIST_ITEM_FILE_NAME:"velt-notifications-panel-content-list-item-file-name",VELT_NOTIFICATIONS_PANEL_CONTENT_LIST_ITEM_TIME:"velt-notifications-panel-content-list-item-time",VELT_NOTIFICATIONS_PANEL_CONTENT_ALL_LIST:"velt-notifications-panel-content-all-list",VELT_NOTIFICATIONS_PANEL_CONTENT_ALL_LIST_ITEM:"velt-notifications-panel-content-all-list-item",VELT_NOTIFICATIONS_PANEL_CONTENT_ALL_LIST_ITEM_LABEL:"velt-notifications-panel-content-all-list-item-label",VELT_NOTIFICATIONS_PANEL_CONTENT_ALL_LIST_ITEM_CONTENT:"velt-notifications-panel-content-all-list-item-content",VELT_NOTIFICATIONS_PANEL_CONTENT_PEOPLE_LIST:"velt-notifications-panel-content-people-list",VELT_NOTIFICATIONS_PANEL_CONTENT_PEOPLE_LIST_ITEM:"velt-notifications-panel-content-people-list-item",VELT_NOTIFICATIONS_PANEL_CONTENT_PEOPLE_LIST_ITEM_AVATAR:"velt-notifications-panel-content-people-list-item-avatar",VELT_NOTIFICATIONS_PANEL_CONTENT_PEOPLE_LIST_ITEM_NAME:"velt-notifications-panel-content-people-list-item-name",VELT_NOTIFICATIONS_PANEL_CONTENT_PEOPLE_LIST_ITEM_COUNT:"velt-notifications-panel-content-people-list-item-count",VELT_NOTIFICATIONS_PANEL_CONTENT_PEOPLE_LIST_ITEM_CONTENT:"velt-notifications-panel-content-people-list-item-content",VELT_NOTIFICATIONS_PANEL_CONTENT_DOCUMENTS_LIST:"velt-notifications-panel-content-documents-list",VELT_NOTIFICATIONS_PANEL_CONTENT_DOCUMENTS_LIST_ITEM:"velt-notifications-panel-content-documents-list-item",VELT_NOTIFICATIONS_PANEL_CONTENT_DOCUMENTS_LIST_ITEM_NAME:"velt-notifications-panel-content-documents-list-item-name",VELT_NOTIFICATIONS_PANEL_CONTENT_DOCUMENTS_LIST_ITEM_COUNT:"velt-notifications-panel-content-documents-list-item-count",VELT_NOTIFICATIONS_PANEL_CONTENT_DOCUMENTS_LIST_ITEM_CONTENT:"velt-notifications-panel-content-documents-list-item-content",VELT_NOTIFICATIONS_PANEL_CONTENT_DOCUMENTS_LIST_ITEM_UNREAD:"velt-notifications-panel-content-documents-list-item-unread",VELT_NOTIFICATIONS_PANEL_CONTENT_LOAD_MORE:"velt-notifications-panel-content-load-more",VELT_NOTIFICATIONS_PANEL_CONTENT_ALL_READ_CONTAINER:"velt-notifications-panel-content-all-read-container",VELT_NOTIFICATIONS_PANEL_CLOSE_BUTTON:"velt-notifications-panel-close-button",VELT_NOTIFICATIONS_PANEL_READ_ALL_BUTTON:"velt-notifications-panel-read-all-button",VELT_NOTIFICATIONS_PANEL_VIEW_ALL_BUTTON:"velt-notifications-panel-view-all-button",VELT_NOTIFICATIONS_PANEL_SKELETON:"velt-notifications-panel-skeleton",VELT_NOTIFICATIONS_PANEL_SETTINGS_BUTTON:"velt-notifications-panel-settings-button",VELT_NOTIFICATIONS_PANEL_SETTINGS:"velt-notifications-panel-settings",VELT_NOTIFICATIONS_PANEL_SETTINGS_HEADER:"velt-notifications-panel-settings-header",VELT_NOTIFICATIONS_PANEL_SETTINGS_HEADER_TITLE:"velt-notifications-panel-settings-header-title",VELT_NOTIFICATIONS_PANEL_SETTINGS_TITLE:"velt-notifications-panel-settings-title",VELT_NOTIFICATIONS_PANEL_SETTINGS_DESCRIPTION:"velt-notifications-panel-settings-description",VELT_NOTIFICATIONS_PANEL_SETTINGS_LIST:"velt-notifications-panel-settings-list",VELT_NOTIFICATIONS_PANEL_SETTINGS_MUTE_ALL_TITLE:"velt-notifications-panel-settings-mute-all-title",VELT_NOTIFICATIONS_PANEL_SETTINGS_MUTE_ALL_DESCRIPTION:"velt-notifications-panel-settings-mute-all-description",VELT_NOTIFICATIONS_PANEL_SETTINGS_MUTE_ALL_TOGGLE:"velt-notifications-panel-settings-mute-all-toggle",VELT_NOTIFICATIONS_PANEL_SETTINGS_ACCORDION:"velt-notifications-panel-settings-accordion",VELT_NOTIFICATIONS_PANEL_SETTINGS_ACCORDION_TRIGGER:"velt-notifications-panel-settings-accordion-trigger",VELT_NOTIFICATIONS_PANEL_SETTINGS_ACCORDION_TRIGGER_LABEL:"velt-notifications-panel-settings-accordion-trigger-label",VELT_NOTIFICATIONS_PANEL_SETTINGS_ACCORDION_TRIGGER_ICON:"velt-notifications-panel-settings-accordion-trigger-icon",VELT_NOTIFICATIONS_PANEL_SETTINGS_ACCORDION_TRIGGER_SELECTED_VALUE:"velt-notifications-panel-settings-accordion-trigger-selected-value",VELT_NOTIFICATIONS_PANEL_SETTINGS_ACCORDION_CONTENT:"velt-notifications-panel-settings-accordion-content",VELT_NOTIFICATIONS_PANEL_SETTINGS_ACCORDION_CONTENT_ITEM:"velt-notifications-panel-settings-accordion-content-item",VELT_NOTIFICATIONS_PANEL_SETTINGS_ACCORDION_CONTENT_ITEM_LABEL:"velt-notifications-panel-settings-accordion-content-item-label",VELT_NOTIFICATIONS_PANEL_SETTINGS_ACCORDION_CONTENT_ITEM_ICON:"velt-notifications-panel-settings-accordion-content-item-icon",VELT_NOTIFICATIONS_PANEL_SETTINGS_BACK_BUTTON:"velt-notifications-panel-settings-back-button",VELT_NOTIFICATIONS_PANEL_SETTINGS_FOOTER:"velt-notifications-panel-settings-footer",VELT_NOTIFICATIONS_HISTORY_PANEL:"velt-notifications-history-panel",VELT_WIREFRAME:"velt-wireframe",VELT_AUTOCOMPLETE:"velt-autocomplete",VELT_AUTOCOMPLETE_PANEL:"velt-autocomplete-panel",VELT_AUTOCOMPLETE_OPTION:"velt-autocomplete-option",VELT_AUTOCOMPLETE_OPTION_ICON:"velt-autocomplete-option-icon",VELT_AUTOCOMPLETE_OPTION_NAME:"velt-autocomplete-option-name",VELT_AUTOCOMPLETE_OPTION_DESCRIPTION:"velt-autocomplete-option-description",VELT_AUTOCOMPLETE_OPTION_ERROR_ICON:"velt-autocomplete-option-error-icon",VELT_AUTOCOMPLETE_GROUP_OPTION:"velt-autocomplete-group-option",VELT_AUTOCOMPLETE_TOOL:"velt-autocomplete-tool",VELT_AUTOCOMPLETE_EMPTY:"velt-autocomplete-empty",VELT_AUTOCOMPLETE_CHIP:"velt-autocomplete-chip",VELT_AUTOCOMPLETE_CHIP_TOOLTIP:"velt-autocomplete-chip-tooltip",VELT_AUTOCOMPLETE_CHIP_TOOLTIP_ICON:"velt-autocomplete-chip-tooltip-icon",VELT_AUTOCOMPLETE_CHIP_TOOLTIP_NAME:"velt-autocomplete-chip-tooltip-name",VELT_AUTOCOMPLETE_CHIP_TOOLTIP_DESCRIPTION:"velt-autocomplete-chip-tooltip-description",VELT_AUTOCOMPLETE_CONTEXT_WRAPPER:"velt-autocomplete-context-wrapper",VELT_ACTIVITY_LOG:"velt-activity-log",VELT_ACTIVITY_LOG_HEADER:"velt-activity-log-header",VELT_ACTIVITY_LOG_HEADER_TITLE:"velt-activity-log-header-title",VELT_ACTIVITY_LOG_HEADER_CLOSE_BUTTON:"velt-activity-log-header-close-button",VELT_ACTIVITY_LOG_HEADER_FILTER:"velt-activity-log-header-filter",VELT_ACTIVITY_LOG_HEADER_FILTER_TRIGGER:"velt-activity-log-header-filter-trigger",VELT_ACTIVITY_LOG_HEADER_FILTER_TRIGGER_LABEL:"velt-activity-log-header-filter-trigger-label",VELT_ACTIVITY_LOG_HEADER_FILTER_TRIGGER_ICON:"velt-activity-log-header-filter-trigger-icon",VELT_ACTIVITY_LOG_HEADER_FILTER_CONTENT:"velt-activity-log-header-filter-content",VELT_ACTIVITY_LOG_HEADER_FILTER_CONTENT_ITEM:"velt-activity-log-header-filter-content-item",VELT_ACTIVITY_LOG_HEADER_FILTER_CONTENT_ITEM_LABEL:"velt-activity-log-header-filter-content-item-label",VELT_ACTIVITY_LOG_HEADER_FILTER_CONTENT_ITEM_ICON:"velt-activity-log-header-filter-content-item-icon",VELT_ACTIVITY_LOG_LOADING:"velt-activity-log-loading",VELT_ACTIVITY_LOG_LIST:"velt-activity-log-list",VELT_ACTIVITY_LOG_LIST_DATE_GROUP:"velt-activity-log-list-date-group",VELT_ACTIVITY_LOG_LIST_DATE_GROUP_LABEL:"velt-activity-log-list-date-group-label",VELT_ACTIVITY_LOG_LIST_ITEM:"velt-activity-log-list-item",VELT_ACTIVITY_LOG_LIST_ITEM_ICON:"velt-activity-log-list-item-icon",VELT_ACTIVITY_LOG_LIST_ITEM_AVATAR:"velt-activity-log-list-item-avatar",VELT_ACTIVITY_LOG_LIST_ITEM_CONTENT:"velt-activity-log-list-item-content",VELT_ACTIVITY_LOG_LIST_ITEM_CONTENT_USER:"velt-activity-log-list-item-content-user",VELT_ACTIVITY_LOG_LIST_ITEM_CONTENT_ACTION:"velt-activity-log-list-item-content-action",VELT_ACTIVITY_LOG_LIST_ITEM_CONTENT_TARGET:"velt-activity-log-list-item-content-target",VELT_ACTIVITY_LOG_LIST_ITEM_CONTENT_DETAIL:"velt-activity-log-list-item-content-detail",VELT_ACTIVITY_LOG_LIST_ITEM_TIME:"velt-activity-log-list-item-time",VELT_ACTIVITY_LOG_LIST_SHOW_MORE:"velt-activity-log-list-show-more",VELT_ACTIVITY_LOG_EMPTY:"velt-activity-log-empty",VELT_ACTIVITY_LOG_CONTEXT_WRAPPER:"velt-activity-log-context-wrapper",VELT_COMMENT_DIALOG_VISIBILITY_BANNER:"velt-comment-dialog-visibility-banner",VELT_COMMENT_DIALOG_VISIBILITY_BANNER_ICON:"velt-comment-dialog-visibility-banner-icon",VELT_COMMENT_DIALOG_VISIBILITY_BANNER_TEXT:"velt-comment-dialog-visibility-banner-text",VELT_COMMENT_DIALOG_VISIBILITY_BANNER_DROPDOWN:"velt-comment-dialog-visibility-banner-dropdown",VELT_COMMENT_DIALOG_VISIBILITY_BANNER_DROPDOWN_TRIGGER:"velt-comment-dialog-visibility-banner-dropdown-trigger",VELT_COMMENT_DIALOG_VISIBILITY_BANNER_DROPDOWN_TRIGGER_LABEL:"velt-comment-dialog-visibility-banner-dropdown-trigger-label",VELT_COMMENT_DIALOG_VISIBILITY_BANNER_DROPDOWN_TRIGGER_AVATAR_LIST:"velt-comment-dialog-visibility-banner-dropdown-trigger-avatar-list",VELT_COMMENT_DIALOG_VISIBILITY_BANNER_DROPDOWN_TRIGGER_AVATAR_LIST_ITEM:"velt-comment-dialog-visibility-banner-dropdown-trigger-avatar-list-item",VELT_COMMENT_DIALOG_VISIBILITY_BANNER_DROPDOWN_TRIGGER_AVATAR_LIST_REMAINING_COUNT:"velt-comment-dialog-visibility-banner-dropdown-trigger-avatar-list-remaining-count",VELT_COMMENT_DIALOG_VISIBILITY_BANNER_DROPDOWN_TRIGGER_ICON:"velt-comment-dialog-visibility-banner-dropdown-trigger-icon",VELT_COMMENT_DIALOG_VISIBILITY_BANNER_DROPDOWN_CONTENT:"velt-comment-dialog-visibility-banner-dropdown-content",VELT_COMMENT_DIALOG_VISIBILITY_BANNER_DROPDOWN_CONTENT_ITEM:"velt-comment-dialog-visibility-banner-dropdown-content-item",VELT_COMMENT_DIALOG_VISIBILITY_BANNER_DROPDOWN_CONTENT_ITEM_ICON:"velt-comment-dialog-visibility-banner-dropdown-content-item-icon",VELT_COMMENT_DIALOG_VISIBILITY_BANNER_DROPDOWN_CONTENT_ITEM_LABEL:"velt-comment-dialog-visibility-banner-dropdown-content-item-label",VELT_COMMENT_DIALOG_VISIBILITY_BANNER_DROPDOWN_CONTENT_USER_PICKER:"velt-comment-dialog-visibility-banner-dropdown-content-user-picker",VELT_COMMENT_DIALOG_VISIBILITY_BANNER_DROPDOWN_CONTENT_ORG_PICKER:"velt-comment-dialog-visibility-banner-dropdown-content-org-picker",VELT_COMMENT_COMPOSER:"velt-comment-composer",VELT_SKELETON_LOADER:"velt-skeleton-loader",VELT_SHADOW_DOM_INTERNAL:"velt-shadow-dom-internal",VELT_SINGLE_EDITOR_MODE_PANEL:"velt-single-editor-mode-panel",VELT_MULTI_THREAD_COMMENT_DIALOG:"velt-multi-thread-comment-dialog",VELT_MULTI_THREAD_COMMENT_DIALOG_LIST:"velt-multi-thread-comment-dialog-list",VELT_MULTI_THREAD_COMMENT_DIALOG_PANEL:"velt-multi-thread-comment-dialog-panel",VELT_MULTI_THREAD_COMMENT_DIALOG_COMPOSER_CONTAINER:"velt-multi-thread-comment-dialog-composer-container",VELT_MULTI_THREAD_COMMENT_DIALOG_COMMENT_COUNT:"velt-multi-thread-comment-dialog-comment-count",VELT_MULTI_THREAD_COMMENT_DIALOG_EMPTY_PLACEHOLDER:"velt-multi-thread-comment-dialog-empty-placeholder",VELT_MULTI_THREAD_COMMENT_DIALOG_CLOSE_BUTTON:"velt-multi-thread-comment-dialog-close-button",VELT_MULTI_THREAD_COMMENT_DIALOG_NEW_THREAD_BUTTON:"velt-multi-thread-comment-dialog-new-thread-button",VELT_MULTI_THREAD_COMMENT_DIALOG_RESET_FILTER_BUTTON:"velt-multi-thread-comment-dialog-reset-filter-button",VELT_MULTI_THREAD_COMMENT_DIALOG_MINIMAL_FILTER_DROPDOWN:"velt-multi-thread-comment-dialog-minimal-filter-dropdown",VELT_MULTI_THREAD_COMMENT_DIALOG_MINIMAL_FILTER_DROPDOWN_TRIGGER:"velt-multi-thread-comment-dialog-minimal-filter-dropdown-trigger",VELT_MULTI_THREAD_COMMENT_DIALOG_MINIMAL_FILTER_DROPDOWN_CONTENT:"velt-multi-thread-comment-dialog-minimal-filter-dropdown-content",VELT_MULTI_THREAD_COMMENT_DIALOG_MINIMAL_FILTER_DROPDOWN_CONTENT_FILTER_ALL:"velt-multi-thread-comment-dialog-minimal-filter-dropdown-content-filter-all",VELT_MULTI_THREAD_COMMENT_DIALOG_MINIMAL_FILTER_DROPDOWN_CONTENT_FILTER_READ:"velt-multi-thread-comment-dialog-minimal-filter-dropdown-content-filter-read",VELT_MULTI_THREAD_COMMENT_DIALOG_MINIMAL_FILTER_DROPDOWN_CONTENT_FILTER_RESOLVED:"velt-multi-thread-comment-dialog-minimal-filter-dropdown-content-filter-resolved",VELT_MULTI_THREAD_COMMENT_DIALOG_MINIMAL_FILTER_DROPDOWN_CONTENT_FILTER_UNREAD:"velt-multi-thread-comment-dialog-minimal-filter-dropdown-content-filter-unread",VELT_MULTI_THREAD_COMMENT_DIALOG_MINIMAL_FILTER_DROPDOWN_CONTENT_SELECTED_ICON:"velt-multi-thread-comment-dialog-minimal-filter-dropdown-content-selected-icon",VELT_MULTI_THREAD_COMMENT_DIALOG_MINIMAL_FILTER_DROPDOWN_CONTENT_SORT_DATE:"velt-multi-thread-comment-dialog-minimal-filter-dropdown-content-sort-date",VELT_MULTI_THREAD_COMMENT_DIALOG_MINIMAL_FILTER_DROPDOWN_CONTENT_SORT_UNREAD:"velt-multi-thread-comment-dialog-minimal-filter-dropdown-content-sort-unread",VELT_MULTI_THREAD_COMMENT_DIALOG_MINIMAL_ACTIONS_DROPDOWN:"velt-multi-thread-comment-dialog-minimal-actions-dropdown",VELT_MULTI_THREAD_COMMENT_DIALOG_MINIMAL_ACTIONS_DROPDOWN_TRIGGER:"velt-multi-thread-comment-dialog-minimal-actions-dropdown-trigger",VELT_MULTI_THREAD_COMMENT_DIALOG_MINIMAL_ACTIONS_DROPDOWN_CONTENT:"velt-multi-thread-comment-dialog-minimal-actions-dropdown-content",VELT_MULTI_THREAD_COMMENT_DIALOG_MINIMAL_ACTIONS_DROPDOWN_CONTENT_MARK_ALL_READ:"velt-multi-thread-comment-dialog-minimal-actions-dropdown-content-mark-all-read",VELT_MULTI_THREAD_COMMENT_DIALOG_MINIMAL_ACTIONS_DROPDOWN_CONTENT_MARK_ALL_RESOLVED:"velt-multi-thread-comment-dialog-minimal-actions-dropdown-content-mark-all-resolved",VELT_TEXT_COMMENT:"velt-text-comment",VELT_TEXT_COMMENT_TOOL:"velt-text-comment-tool",VELT_TEXT_COMMENT_TOOLBAR:"velt-text-comment-toolbar",VELT_TEXT_COMMENT_TOOLBAR_COMMENT_ANNOTATION:"velt-text-comment-toolbar-comment-annotation",VELT_TEXT_COMMENT_TOOLBAR_DIVIDER:"velt-text-comment-toolbar-divider",VELT_TEXT_COMMENT_TOOLBAR_COPYWRITER:"velt-text-comment-toolbar-copywriter",VELT_TEXT_COMMENT_TOOLBAR_GENERIC:"velt-text-comment-toolbar-generic"},U.ATTRIBUTES={VELT_COMMENT_CONTAINER:"data-velt-comment-container",VELT_TARGET_COMMENT_ELEMENT_ID:"data-velt-target-comment-element-id",VELT_COMMENT_TYPE:"data-velt-comment-type",TARGET_INLINE_COMMENT_ELEMENT_ID:"target-inline-comment-element-id",TARGET_COMMENT_ELEMENT_ID:"target-comment-element-id",TARGET_ELEMENT_ID:"target-element-id",VELT_ID:"data-velt-id",VELT_ELEMENT:"data-velt-element",VELT_SCREEN_RECORDER_PANEL:"data-velt-screen-recorder-panel",VELT_SOURCE_ID:"data-velt-source-id",VELT_ANNOTATION_ID:"data-velt-annotation-id",VELT_ANNOTATION_IDS:"data-velt-annotation-ids",VELT_COMMENT_PIN_HOST:"data-velt-comment-pin-host",VELT_COMMENT_PIN_HOST_STATIC:"data-velt-comment-pin-host-static",VELT_COMMENT_DISABLED:"data-velt-comment-disabled",VELT_MANUAL_COMMENT_CONTAINER:"data-velt-manual-comment-container",VELT_COMMENT_PIN_ACTIVE:"data-velt-comment-pin-active",VELT_INLINE_COMMENT_SECTION_CONFIG:"data-velt-inline-comment-section-config",VELT_TARGET_INLINE_COMMENT_ELEMENT_ID:"data-velt-target-inline-comment-element-id",VELT_TAG_PIN_HOST:"data-velt-tag-pin-host",VELT_TAG_PIN_HOST_STATIC:"data-velt-tag-pin-host-static",VELT_TAG_DISABLED:"data-velt-tag-disabled",VELT_RECORDER_PIN_HOST:"data-velt-recorder-pin-host",VELT_RECORDER_PIN_HOST_STATIC:"data-velt-recorder-pin-host-static",VELT_RECORDER_DISABLED:"data-velt-recorder-disabled",VELT_ANNOTATION_DRAFT:"data-velt-annotation-draft",VELT_ANNOTATION_EDIT_COMMENT:"data-velt-annotation-edit-comment",VELT_DOCUMENT_ID:"data-velt-document-id",VELT_LOCATION:"data-velt-location",VELT_LOCATION_ID:"data-velt-location-id",VELT_THEME:"data-velt-theme",VELT_IGNORE:"data-velt-ignore",EMBED_MODE:"embed-mode",DEFAULT_CURSOR:"default-cursor",VELT_HUDDLE_ON_CURSOR_MODE:"data-velt-huddle-on-cursor-mode",VELT_SELECTION_ENABLED:"data-live-selection-enabled",VELT_LIVE_SELECTION_ENABLED:"data-velt-live-selection-enabled",VELT_LIVE_SELECTION_USER_INDICATOR_POSITION:"data-velt-live-selection-user-indicator-position",VELT_LIVE_SELECTION_USER_INDICATOR_TYPE:"data-velt-live-selection-user-indicator-type",VELT_SELECTION_CONFIG:"data-live-selection-config",VELT_POPOVER_MODE:"data-velt-popover-mode",VELT_ELEMENT_CACHE_ID:"data-velt-cache-id",VELT_ARROW_PIN_HOST:"data-velt-arrow-pin-host",VELT_ARROW_PIN_HOST_STATIC:"data-velt-arrow-pin-host-static",VELT_ARROW_DISABLED:"data-velt-arrow-disabled",VELT_AREA_PIN_HOST:"data-velt-area-pin-host",VELT_AREA_PIN_HOST_STATIC:"data-velt-area-pin-host-static",VELT_AREA_DISABLED:"data-velt-area-disabled",VELT_AREA_PIN_ACTIVE:"data-velt-area-pin-active",VELT_SUGGESTION_TARGET:"data-velt-suggestion-target",VELT_ONGOING_RECORDING:"data-velt-ongoing-recording",VELT_COMMENT_RECORDING:"data-velt-comment-recording",SYNC_VIDEO_PLAYER_ID:"data-sync-video-player-id",SYNC_VIDEO_PLAYER:"data-sync-video-player",VELT_INLINE_COMMENT_ID:"inline-comment-id",VELT_PDF_VIEWER:"data-velt-pdf-viewer",VELT_SYNC_STATE:"data-velt-sync-state",VELT_SYNC_ACCESS:"data-velt-sync-access",VELT_SYNC_ACCESS_AUTO:"data-velt-sync-access-auto",VELT_SYNC_ACCESS_DISABLED:"data-velt-sync-access-disabled",VELT_SINGLE_EDITOR_MODE_CONTAINER:"data-velt-single-editor-mode-container",VELT_IFRAME_CONTAINER:"data-velt-iframe-container",VELT_IFRAME_CONTAINER_STATIC:"data-velt-iframe-container-static",VELT_IS_FIRST_COMPONENT:"data-velt-is-first-component",VELT_DOWNLOAD_BUTTON:"velt-download-button",VELT_COMMENT_DIALOG_PORTAL_INTERNAL:"velt-comment-dialog-portal-internal",ANNOTATION_ID:"annotation-id",MULTI_THREAD_ANNOTATION_ID:"multi-thread-annotation-id",SLATE_EDITOR:"data-slate-editor"},U.INJECTION_STYLE_PROPS={VELT_AVATAR_COLOR:"data-velt-avatar-color",VELT_COMMENT_PRIORITY_COLOR:"data-velt-priority-color"},U.BODY_CLASSES={VELT_PIN_DRAGGING:"velt-pin-dragging"},U.INJECTION_ATTRIBUTES={VELT_AVATAR_IMG:"data-velt-avatar-img",VELT_COMMENT_LENGTH:"data-velt-comment-thread-length"},U.SESSION_STORAGE={SNIPPYLY_AUTO_SELECT_ANNOTATION_ID:"snippylyAutoSelectAnnotationId",SNIPPYLY_SELECTED_ANNOTATION_ID:"snippylySelectedAnnotationId",SNIPPYLY_COMMENT_SIDEBAR_FILTERS:"snippylyCommentSidebarFilters",SNIPPYLY_COMMENT_SIDEBAR_GROUP_BY:"snippylyCommentSidebarGroupBy",SNIPPYLY_COMMENT_DIALOG_AUTO_POPULATE_TEXT:"snippylyCommentDialogAutoPopulateText",SNIPPYLY_HUDDLE_DATA:"snippylyHuddleData",VELT_TAB_ID:"veltTabId",VELT_COMMENT_SIDEBAR_FILTERS_RESET:"veltCommentSidebarFiltersReset",VELT_COMMENT_SIDEBAR_CUSTOM_ACTIONS_STATE:"veltCommentSidebarCustomActionsState",VELT_CURSOR_MULTIPLE_USERS_DETECTED:"veltCursorMultipleUsersDetected",VELT_PRESENCE_MULTIPLE_USERS_DETECTED:"veltPresenceMultipleUsersDetected",VELT_PRESENCE_MULTIPLE_USERS_ONLINE:"veltPresenceMultipleUsersOnline",VELT_CUSTOM_PRIORITY_MAP:"veltCustomPriorityMap",VELT_CUSTOM_STATUS_MAP:"veltCustomStatusMap",VELT_CUSTOM_CATEGORY_MAP:"veltCustomCategoryMap"},U.LOCAL_STORAGE={SNIPPYLY_DEFAULT_MEDIA_SOURCE_OPTIONS:"snippylyDefaultMediaSourceOptions",SNIPPYLY_QUEUED_COMMENT:"snippylyQueuedComment",VELT_USER:"_vu",VELT_IDENTIFY_USER:"_viu",VELT_USER_FORCE_RE_LOGGED_IN:"_vurli",VELT_VERSION:"_vv",VELT_ADVANCED_QUERIES:"_vadq",VELT_COMMENT_VIEWS_MIGRATED:"_vcvm",VELT_AUTH_PROXY_HOST:"_vaph",VELT_PORTABLE_SESSION:"_vps",VELT_PORTABLE_SIGNED_OUT:"_vpso"},U.NON_NESTABLE_ELEMENTS={img:!0,video:!0,audio:!0,input:!0,meter:!0,progress:!0,select:!0,textarea:!0,svg:!0,"lottie-player":!0,"ng-lottie":!0,canvas:!0,hr:!0,iframe:!0},U.INGNORE_MUTATION_OBSERVER_CHANGE_TAGS={svg:!0},U.SELECTION_ENABLED_ELEMENTS={input:!0,textarea:!0,select:!0,button:!0},U.URL_PARAMS={REVIEW_MODE:"review",REVIEW_DOC_ID:"sreviewId",SNIPPYLY_USER:"snippyly-user",COMMENT_ID:"scommentId",TAG_ID:"stagId",RECORDER_ID:"srecorderId",PROJECT_INSTALL:"sprojectInstall"},U.VELT_BASE_REM_UNIT="--velt-base-rem-unit",U.VELT_VIEWPORT_WIDTH="--legacy-velt-viewport-width",U.VELT_VIEWPORT_HEIGHT="--legacy-velt-viewport-height",U.VELT_SELECTION_COLOR="--velt-selection-color",U.VELT_MIN_ARROW_LENGTH=100,U.VELT_ARROW_VIEWPORT_PADDING=20,U.LIVE_STATE_REQUEST_EDITOR_ACCESS_WAIT_TIME=5,U.CURSOR={COMMENT_PIN:"url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZpZXdCb3g9IjAgMCAxOCAxOCIgZmlsbD0iIzYyNURGNSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPG1hc2sgaWQ9InBhdGgtMS1pbnNpZGUtMV8yMDMyXzIzNjgxIiBmaWxsPSJ3aGl0ZSI+CjxwYXRoIGQ9Ik0wLjM1Mjk0MSAxOEMwLjE1ODAxNyAxOCAtNi45MDcxNWUtMDkgMTcuODQyIC0xLjU0Mjc1ZS0wOCAxNy42NDcxTC0zLjkzNDAyZS0wNyA5Qy02LjEwNjczZS0wNyA0LjAyOTQ0IDQuMDI5NDQgLTEuNzYxMzJlLTA3IDkgLTMuOTM0MDJlLTA3Vi0zLjkzNDAyZS0wN0MxMy45NzA2IC02LjEwNjczZS0wNyAxOCA0LjAyOTQ0IDE4IDlWOUMxOCAxMy45NzA2IDEzLjk3MDYgMTggOSAxOEwwLjM1Mjk0MSAxOFoiLz4KPC9tYXNrPgo8cGF0aCBkPSJNMC4zNTI5NDEgMThDMC4xNTgwMTcgMTggLTYuOTA3MTVlLTA5IDE3Ljg0MiAtMS41NDI3NWUtMDggMTcuNjQ3MUwtMy45MzQwMmUtMDcgOUMtNi4xMDY3M2UtMDcgNC4wMjk0NCA0LjAyOTQ0IC0xLjc2MTMyZS0wNyA5IC0zLjkzNDAyZS0wN1YtMy45MzQwMmUtMDdDMTMuOTcwNiAtNi4xMDY3M2UtMDcgMTggNC4wMjk0NCAxOCA5VjlDMTggMTMuOTcwNiAxMy45NzA2IDE4IDkgMThMMC4zNTI5NDEgMThaIiBmaWxsPSIjMTQxNDE2Ii8+CjxwYXRoIGQ9Ik0wLjM1Mjk0MSAxOEMwLjE1ODAxNyAxOCAtNi45MDcxNWUtMDkgMTcuODQyIC0xLjU0Mjc1ZS0wOCAxNy42NDcxTC0zLjkzNDAyZS0wNyA5Qy02LjEwNjczZS0wNyA0LjAyOTQ0IDQuMDI5NDQgLTEuNzYxMzJlLTA3IDkgLTMuOTM0MDJlLTA3Vi0zLjkzNDAyZS0wN0MxMy45NzA2IC02LjEwNjczZS0wNyAxOCA0LjAyOTQ0IDE4IDlWOUMxOCAxMy45NzA2IDEzLjk3MDYgMTggOSAxOEwwLjM1Mjk0MSAxOFoiIHN0cm9rZT0id2hpdGUiIHN0cm9rZS13aWR0aD0iMiIgbWFzaz0idXJsKCNwYXRoLTEtaW5zaWRlLTFfMjAzMl8yMzY4MSkiLz4KPC9zdmc+Cg==') 0 31, auto",TAG_PIN:"url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB2aWV3Qm94PSIwIDAgMzIgMzIiIHdpZHRoPSIzMiIgaGVpZ2h0PSIzMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczpieD0iaHR0cHM6Ly9ib3h5LXN2Zy5jb20iPgogIDxlbGxpcHNlIHN0eWxlPSJzdHJva2U6IHJnYigwLCAwLCAwKTsgZmlsbDogcmdiKDE2MiwgODksIDI1NCk7IHBhaW50LW9yZGVyOiBmaWxsOyBzdHJva2Utd2lkdGg6IDBweDsiIGN4PSIxNiIgY3k9IjE2IiByeD0iMTYiIHJ5PSIxNiIvPgogIDxwYXRoIGQ9Ik0gOS4zMzMgMjIgQyA5LjMzMyAyMiA4IDIyIDggMjAuNjY3IEMgOCAxOS4zMzMgOS4zMzMgMTUuMzMzIDE2IDE1LjMzMyBDIDIyLjY2NyAxNS4zMzMgMjQgMTkuMzMzIDI0IDIwLjY2NyBDIDI0IDIyIDIyLjY2NyAyMiAyMi42NjcgMjIgTCA5LjMzMyAyMiBaIE0gMTYgMTQgQyAxOS4wNzkgMTQgMjEuMDA0IDEwLjY2NyAxOS40NjQgOCBDIDE4Ljc1IDYuNzYyIDE3LjQyOSA2IDE2IDYgQyAxMi45MjEgNiAxMC45OTYgOS4zMzMgMTIuNTM2IDEyIEMgMTMuMjUgMTMuMjM3IDE0LjU3MSAxNCAxNiAxNCBaIiBzdHlsZT0iZmlsbDogcmdiKDI1NSwgMjU1LCAyNTUpOyIgYng6b3JpZ2luPSIwLjUgMC41Ii8+Cjwvc3ZnPg==') 16 16, auto",ARROW_PIN:"url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTUiIHZpZXdCb3g9IjAgMCAxNiAxNSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMy44MDU0IDEwLjAyMDdDMTQuNTQxMiA5Ljk5MTMxIDE1LjExMzggOS4zNzA5OCAxNS4wODQzIDguNjM1MThMMTQuODMwNiAyLjI4OTM5QzE0LjgwMjggMS41OTQ4NiAxNC4yNDYxIDEuMDM4MTkgMTMuNTUxNiAxLjAxMDQxTDcuMjA1NzEgMC43NTY1MzdDNi40Njk5MiAwLjcyNzEwMiA1Ljg0OTU4IDEuMjk5NzIgNS44MjAxNSAyLjAzNTUxQzUuNzkwNzEgMi43NzEzIDYuMzYzMzMgMy4zOTE2NCA3LjA5OTEyIDMuNDIxMDdMMTAuNDAyMSAzLjU1MzIxTDEuMjQxNzcgMTIuNzEzNkMwLjcyMTA2NyAxMy4yMzQzIDAuNzIxMDY3IDE0LjA3ODUgMS4yNDE3NyAxNC41OTkyQzEuNzYyNDYgMTUuMTE5OSAyLjYwNjY4IDE1LjExOTkgMy4xMjczOCAxNC41OTkyTDEyLjI4NzcgNS40Mzg4NkwxMi40MTk4IDguNzQxNzVDMTIuNDQ5MiA5LjQ3NzU0IDEzLjA2OTYgMTAuMDUwMiAxMy44MDU0IDEwLjAyMDdaIiBmaWxsPSIjOEY5NUIyIi8+Cjwvc3ZnPgo=) 15 0, auto",AREA_PIN:"url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTUiIHZpZXdCb3g9IjAgMCAxNiAxNSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMy44MDU0IDEwLjAyMDdDMTQuNTQxMiA5Ljk5MTMxIDE1LjExMzggOS4zNzA5OCAxNS4wODQzIDguNjM1MThMMTQuODMwNiAyLjI4OTM5QzE0LjgwMjggMS41OTQ4NiAxNC4yNDYxIDEuMDM4MTkgMTMuNTUxNiAxLjAxMDQxTDcuMjA1NzEgMC43NTY1MzdDNi40Njk5MiAwLjcyNzEwMiA1Ljg0OTU4IDEuMjk5NzIgNS44MjAxNSAyLjAzNTUxQzUuNzkwNzEgMi43NzEzIDYuMzYzMzMgMy4zOTE2NCA3LjA5OTEyIDMuNDIxMDdMMTAuNDAyMSAzLjU1MzIxTDEuMjQxNzcgMTIuNzEzNkMwLjcyMTA2NyAxMy4yMzQzIDAuNzIxMDY3IDE0LjA3ODUgMS4yNDE3NyAxNC41OTkyQzEuNzYyNDYgMTUuMTE5OSAyLjYwNjY4IDE1LjExOTkgMy4xMjczOCAxNC41OTkyTDEyLjI4NzcgNS40Mzg4NkwxMi40MTk4IDguNzQxNzVDMTIuNDQ5MiA5LjQ3NzU0IDEzLjA2OTYgMTAuMDUwMiAxMy44MDU0IDEwLjAyMDdaIiBmaWxsPSIjOEY5NUIyIi8+Cjwvc3ZnPgo=) 16 0, auto"},U.VIDEO_POSTER_DEFAULT_IMAGE="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAADIAQMAAABoEU4WAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAGUExURQAAAAEAAKSl0/gAAAAxSURBVFjD7dBBDQAgCABARjKjGZUofi0Ac+4uwkUAAAAAAMCIpYD/bQVNSsEtFfCaA8vLAaMbkVUtAAAAAElFTkSuQmCC",U.HUDDLE_TYPE_CONFIGS={audio:{audio:!0,video:!1,presentation:!1},video:{audio:!0,video:!0,presentation:!1},presentation:{audio:!1,video:!1,presentation:!0}},U.RecorderModes={VIDEO:"video",AUDIO:"audio",SCREEN:"screen",ALL:"all"},U.CommentAnnotationStatusMap={OPEN:{id:"OPEN",name:"Open",color:"var(--velt-accent, #625DF5)",lightColor:"var(--velt-accent-light, #E7E8FA)",type:"default",svg:`
|
|
6
|
+
<svg
|
|
7
|
+
width="16"
|
|
8
|
+
height="16"
|
|
9
|
+
viewBox="0 0 16 16"
|
|
10
|
+
fill="none"
|
|
11
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
12
|
+
>
|
|
13
|
+
<path
|
|
14
|
+
fill-rule="evenodd"
|
|
15
|
+
clip-rule="evenodd"
|
|
16
|
+
d="M8.00016 13.3333C10.9457 13.3333 13.3335 10.9455 13.3335 8.00001C13.3335 5.05449 10.9457 2.66668 8.00016 2.66668C5.05464 2.66668 2.66683 5.05449 2.66683 8.00001C2.66683 10.9455 5.05464 13.3333 8.00016 13.3333ZM8.00016 14.6667C11.6821 14.6667 14.6668 11.6819 14.6668 8.00001C14.6668 4.31811 11.6821 1.33334 8.00016 1.33334C4.31826 1.33334 1.3335 4.31811 1.3335 8.00001C1.3335 11.6819 4.31826 14.6667 8.00016 14.6667Z"
|
|
17
|
+
fill="currentColor"
|
|
18
|
+
/>
|
|
19
|
+
</svg>
|
|
20
|
+
`},IN_PROGRESS:{id:"IN_PROGRESS",name:"In Progress",color:"var(--velt-warning, #ECB000)",lightColor:"var(--velt-warning-light, #FEFCEA)",type:"ongoing",svg:`
|
|
21
|
+
<svg
|
|
22
|
+
width="16"
|
|
23
|
+
height="16"
|
|
24
|
+
viewBox="0 0 16 16"
|
|
25
|
+
fill="none"
|
|
26
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
27
|
+
>
|
|
28
|
+
<path
|
|
29
|
+
fill-rule="evenodd"
|
|
30
|
+
clip-rule="evenodd"
|
|
31
|
+
d="M8.00016 13.3333C10.9457 13.3333 13.3335 10.9455 13.3335 8.00001C13.3335 5.05449 10.9457 2.66668 8.00016 2.66668C5.05464 2.66668 2.66683 5.05449 2.66683 8.00001C2.66683 10.9455 5.05464 13.3333 8.00016 13.3333ZM8.00016 14.6667C11.6821 14.6667 14.6668 11.6819 14.6668 8.00001C14.6668 4.31811 11.6821 1.33334 8.00016 1.33334C4.31826 1.33334 1.3335 4.31811 1.3335 8.00001C1.3335 11.6819 4.31826 14.6667 8.00016 14.6667Z"
|
|
32
|
+
fill="currentColor"
|
|
33
|
+
/>
|
|
34
|
+
<path
|
|
35
|
+
fill-rule="evenodd"
|
|
36
|
+
clip-rule="evenodd"
|
|
37
|
+
d="M8.00016 4C8.36835 4 8.66683 4.29848 8.66683 4.66667V7.72386L10.1382 9.19526C10.3986 9.45561 10.3986 9.87772 10.1382 10.1381C9.87788 10.3984 9.45577 10.3984 9.19542 10.1381L7.52876 8.4714C7.40373 8.34638 7.3335 8.17681 7.3335 8V4.66667C7.3335 4.29848 7.63197 4 8.00016 4Z"
|
|
38
|
+
fill="currentColor"
|
|
39
|
+
/>
|
|
40
|
+
</svg>
|
|
41
|
+
`},RESOLVED:{id:"RESOLVED",name:"Resolved",color:"var(--velt-success, #00C48C)",lightColor:"var(--velt-success-light, #E7FAF2)",type:"terminal",svg:`
|
|
42
|
+
<svg
|
|
43
|
+
width="17"
|
|
44
|
+
height="16"
|
|
45
|
+
viewBox="0 0 17 16"
|
|
46
|
+
fill="none"
|
|
47
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
48
|
+
>
|
|
49
|
+
<path
|
|
50
|
+
fill-rule="evenodd"
|
|
51
|
+
clip-rule="evenodd"
|
|
52
|
+
d="M8.50016 13.3333C11.4457 13.3333 13.8335 10.9455 13.8335 8.00001C13.8335 5.05449 11.4457 2.66668 8.50016 2.66668C5.55464 2.66668 3.16683 5.05449 3.16683 8.00001C3.16683 10.9455 5.55464 13.3333 8.50016 13.3333ZM8.50016 14.6667C12.1821 14.6667 15.1668 11.6819 15.1668 8.00001C15.1668 4.31811 12.1821 1.33334 8.50016 1.33334C4.81826 1.33334 1.8335 4.31811 1.8335 8.00001C1.8335 11.6819 4.81826 14.6667 8.50016 14.6667Z"
|
|
53
|
+
fill="currentColor"
|
|
54
|
+
/>
|
|
55
|
+
<path
|
|
56
|
+
d="M5.8335 8L7.8335 10L11.8335 6"
|
|
57
|
+
class="checkmark"
|
|
58
|
+
stroke="currentColor"
|
|
59
|
+
stroke-width="1.2"
|
|
60
|
+
stroke-miterlimit="10"
|
|
61
|
+
stroke-linecap="round"
|
|
62
|
+
stroke-linejoin="round"
|
|
63
|
+
/>
|
|
64
|
+
</svg>
|
|
65
|
+
`}},U.CommentAcceptStatus={id:"ACCEPTED",name:"Accepted",color:"var(--velt-success, #00C48C)",lightColor:"var(--velt-success-light, #E7FAF2)",type:"terminal",svg:`
|
|
66
|
+
<svg
|
|
67
|
+
width="17"
|
|
68
|
+
height="16"
|
|
69
|
+
viewBox="0 0 17 16"
|
|
70
|
+
fill="none"
|
|
71
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
72
|
+
>
|
|
73
|
+
<path
|
|
74
|
+
fill-rule="evenodd"
|
|
75
|
+
clip-rule="evenodd"
|
|
76
|
+
d="M8.50016 13.3333C11.4457 13.3333 13.8335 10.9455 13.8335 8.00001C13.8335 5.05449 11.4457 2.66668 8.50016 2.66668C5.55464 2.66668 3.16683 5.05449 3.16683 8.00001C3.16683 10.9455 5.55464 13.3333 8.50016 13.3333ZM8.50016 14.6667C12.1821 14.6667 15.1668 11.6819 15.1668 8.00001C15.1668 4.31811 12.1821 1.33334 8.50016 1.33334C4.81826 1.33334 1.8335 4.31811 1.8335 8.00001C1.8335 11.6819 4.81826 14.6667 8.50016 14.6667Z"
|
|
77
|
+
fill="currentColor"
|
|
78
|
+
/>
|
|
79
|
+
<path
|
|
80
|
+
d="M5.8335 8L7.8335 10L11.8335 6"
|
|
81
|
+
class="checkmark"
|
|
82
|
+
stroke="currentColor"
|
|
83
|
+
stroke-width="1.2"
|
|
84
|
+
stroke-miterlimit="10"
|
|
85
|
+
stroke-linecap="round"
|
|
86
|
+
stroke-linejoin="round"
|
|
87
|
+
/>
|
|
88
|
+
</svg>
|
|
89
|
+
`},U.CommentRejectStatus={id:"REJECTED",name:"Rejected",color:"var(--velt-error, #ff0000)",lightColor:"var(--velt-error-light, #f7e7e7)",type:"terminal",svg:`
|
|
90
|
+
<svg
|
|
91
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
92
|
+
width="16" height="16"
|
|
93
|
+
fill="currentColor"
|
|
94
|
+
class="bi bi-x-circle"
|
|
95
|
+
viewBox="0 0 16 16"
|
|
96
|
+
>
|
|
97
|
+
<path
|
|
98
|
+
d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"
|
|
99
|
+
/>
|
|
100
|
+
<path
|
|
101
|
+
d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z"
|
|
102
|
+
/>
|
|
103
|
+
</svg>
|
|
104
|
+
`},U.CommentAnnotationPriorityMap={P0:{id:"P0",name:"P0",color:"var(--velt-error, #FF7162)",lightColor:"var(--velt-error-light, #F7E7E7)",svg:`<svg width="20" height="21" viewBox="0 0 20 21" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
105
|
+
<g>
|
|
106
|
+
<path d="M3.33301 1.33333C3.33301 0.873096 3.7061 0.5 4.16634 0.5C4.62658 0.5 4.99967 0.873096 4.99967 1.33333V19.6667C4.99967 20.1269 4.62658 20.5 4.16634 20.5C3.7061 20.5 3.33301 20.1269 3.33301 19.6667V1.33333Z" fill="currentColor"/>
|
|
107
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.3086 12.167H3.33301V2.16699H8.33301C9.42152 2.16699 10.3476 2.86267 10.6908 3.83366H14.803C16.0419 3.83366 16.8477 5.13751 16.2937 6.24568L14.9997 8.83366L16.2937 11.4216C16.8477 12.5298 16.0419 13.8337 14.803 13.8337H11.6663C10.5778 13.8337 9.65179 13.138 9.3086 12.167ZM4.99967 3.83366H8.33301C8.79324 3.83366 9.16634 4.20675 9.16634 4.66699V10.5003H4.99967V3.83366ZM10.833 11.3337C10.833 11.7939 11.2061 12.167 11.6663 12.167H14.803L13.1363 8.83366L14.803 5.50033H10.833V11.3337Z" fill="currentColor"/>
|
|
108
|
+
</g>
|
|
109
|
+
</svg>`},P1:{id:"P1",name:"P1",color:"var(--velt-warning, #ECB000)",lightColor:"var(--velt-warning-light, #FEFCEA)",svg:`<svg width="20" height="21" viewBox="0 0 20 21" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
110
|
+
<g>
|
|
111
|
+
<path d="M3.33301 1.33333C3.33301 0.873096 3.7061 0.5 4.16634 0.5C4.62658 0.5 4.99967 0.873096 4.99967 1.33333V19.6667C4.99967 20.1269 4.62658 20.5 4.16634 20.5C3.7061 20.5 3.33301 20.1269 3.33301 19.6667V1.33333Z" fill="currentColor"/>
|
|
112
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.3086 12.167H3.33301V2.16699H8.33301C9.42152 2.16699 10.3476 2.86267 10.6908 3.83366H14.803C16.0419 3.83366 16.8477 5.13751 16.2937 6.24568L14.9997 8.83366L16.2937 11.4216C16.8477 12.5298 16.0419 13.8337 14.803 13.8337H11.6663C10.5778 13.8337 9.65179 13.138 9.3086 12.167ZM4.99967 3.83366H8.33301C8.79324 3.83366 9.16634 4.20675 9.16634 4.66699V10.5003H4.99967V3.83366ZM10.833 11.3337C10.833 11.7939 11.2061 12.167 11.6663 12.167H14.803L13.1363 8.83366L14.803 5.50033H10.833V11.3337Z" fill="currentColor"/>
|
|
113
|
+
</g>
|
|
114
|
+
</svg>`},P2:{id:"P2",name:"P2",color:"var(--velt-text-7, #777E91)",lightColor:"var(--velt-background-1, #F3F3F5)",svg:`<svg width="20" height="21" viewBox="0 0 20 21" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
115
|
+
<g>
|
|
116
|
+
<path d="M3.33301 1.33333C3.33301 0.873096 3.7061 0.5 4.16634 0.5C4.62658 0.5 4.99967 0.873096 4.99967 1.33333V19.6667C4.99967 20.1269 4.62658 20.5 4.16634 20.5C3.7061 20.5 3.33301 20.1269 3.33301 19.6667V1.33333Z" fill="currentColor"/>
|
|
117
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.3086 12.167H3.33301V2.16699H8.33301C9.42152 2.16699 10.3476 2.86267 10.6908 3.83366H14.803C16.0419 3.83366 16.8477 5.13751 16.2937 6.24568L14.9997 8.83366L16.2937 11.4216C16.8477 12.5298 16.0419 13.8337 14.803 13.8337H11.6663C10.5778 13.8337 9.65179 13.138 9.3086 12.167ZM4.99967 3.83366H8.33301C8.79324 3.83366 9.16634 4.20675 9.16634 4.66699V10.5003H4.99967V3.83366ZM10.833 11.3337C10.833 11.7939 11.2061 12.167 11.6663 12.167H14.803L13.1363 8.83366L14.803 5.50033H10.833V11.3337Z" fill="currentColor"/>
|
|
118
|
+
</g>
|
|
119
|
+
</svg>`}},U.WorkspaceRoles=[{id:qu.COMMENTER?.toLowerCase(),name:qu.COMMENTER,description:"Can comment on this project",permissions:[]},{id:qu.ADMIN?.toLowerCase(),name:qu.ADMIN,description:"Can comment on all projects and has access to the portal",permissions:[]}],U.DocumentAccessTypeMap={[bn.PUBLIC]:{id:bn.PUBLIC,name:bn.PUBLIC,description:"Anyone with link can view"},[bn.RESTRICTED]:{id:bn.RESTRICTED,name:bn.RESTRICTED,description:"Only people with access can view"}},U.DocumentAccessTypeMapSF={[bn.PUBLIC]:{id:bn.PUBLIC,name:bn.PUBLIC,description:"Anyone with the link can comment after logging in."},[bn.RESTRICTED]:{id:bn.RESTRICTED,name:bn.RESTRICTED,description:"Only people added to this project can comment."}},U.CommentCategoryMap={bug:{id:"bug",name:"Bug",color:"#FF7162"},feedback:{id:"feedback",name:"Feedback",color:"#00C48C"},question:{id:"question",name:"Question",color:"#FFD166"}},U.OVERLAY_POSITIONS=[{originX:"end",originY:"top",overlayX:"start",overlayY:"top"},{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"},{originX:"center",originY:"bottom",overlayX:"center",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom"},{originX:"center",originY:"top",overlayX:"center",overlayY:"bottom"},{originX:"start",originY:"top",overlayX:"end",overlayY:"top"},{originX:"start",originY:"bottom",overlayX:"end",overlayY:"bottom"},{originX:"start",originY:"center",overlayX:"end",overlayY:"center"},{originX:"end",originY:"bottom",overlayX:"start",overlayY:"bottom"},{originX:"end",originY:"center",overlayX:"start",overlayY:"center"}],U.OVERLAY_POSITIONS_FOR_POPOVER_MODE=[{originX:"end",originY:"top",overlayX:"start",overlayY:"top"},{originX:"end",originY:"center",overlayX:"start",overlayY:"center"},{originX:"end",originY:"bottom",overlayX:"start",overlayY:"bottom"},{originX:"start",originY:"top",overlayX:"end",overlayY:"top"},{originX:"start",originY:"center",overlayX:"end",overlayY:"center"},{originX:"start",originY:"bottom",overlayX:"end",overlayY:"bottom"}],U.VIDEO_EDITOR={ZOOM_IN_DURATION:500,ZOOM_OUT_DURATION:500,DEFAULT_ZOOM_FACTOR:1.5,MAX_ZOOM_FACTOR:3,ZOOM_FACTOR_OPTIONS:[{value:2,label:"2x"},{value:1.7,label:"1.7x"},{value:1.5,label:"1.5x"},{value:1.2,label:"1.2x"}],MIN_DRAG_AREA_MULTIPLIER:.015,PREFERRED_SECTION_DURATION_MULTIPLIER:.15,SELECTION_MIN_DRAG_DISTANCE:2,MIN_DURATION_THRESHOLD:.01,TIME_BUFFER:.1,SHORT_VIDEO_THRESHOLD:3,SMALL_VIDEO_THRESHOLD:5,MILLISECOND_PRECISION_MULTIPLIER:1e3,TENTH_SECOND_PRECISION_MULTIPLIER:10,DEBOUNCE_DELAY:200,DECIMAL_PRECISION:2,MAX_MARKER_COUNT:10,MARKER_INTERVAL:5,FAST_TIMEOUT:50,STANDARD_TIMEOUT:100,RECTANGLE_POSITIONING:{FULL_PERCENT:100,HALF_PERCENT:50,QUARTER_PERCENT:25},EASING:{QUAD_IN_OUT_MULTIPLIER:2,QUAD_IN_OUT_POWER:2,HALF_THRESHOLD:.5},PERCENTAGE:{HALF:50,FULL:100},MILLISECONDS_TO_SECONDS:1e3};var F=U;var wCe=new z("arrow-utils"),bCe=new z("notification-service"),OCe=new z("notifications-actions"),MCe=new z("notification-utils"),LCe=new z("cursor-service"),PCe=new z("cursor-utils"),xCe=new z("presence-service"),kCe=new z("presence-actions"),FCe=new z("presence-utils"),UCe=new z("huddle-service"),VCe=new z("huddle-utils"),BCe=new z("recorder-service"),rT=new z("recorder-annotation-service"),GCe=new z("recorder-actions"),jCe=new z("recorder-utils"),HCe=new z("recorder-pin-portal"),iT=new z("comment-service"),$Ce=new z("comment-actions"),WCe=new z("comment-dialog-core"),zCe=new z("comment-dialog-action"),qCe=new z("comment-text-service"),KCe=new z("comment-text-portal"),YCe=new z("comment-pin-portal"),XCe=new z("comment-views"),oT=new z("reaction-service"),QCe=new z("rewriter-service"),JCe=new z("rewriter-actions"),sT=new z("area-service"),KF=new z("activity-service"),YF=new z("views-service"),XF=new z("crdt-service"),QF=new z("live-state-service");var aT=(()=>{let e=class e{constructor(){this.subjects=new Map,M.log("%c[WB] Creating CLASS: ServiceBook","color: blue;")}set(r,i){try{M.log(`%c[WB] ServiceBook.set: ${r.toString()}`,"color: green;"),this.getOrCreateSubject(r).next(i)}catch(o){M.catch("Error in ServiceBook set: ",o)}}get(r){return this.subjects.get(r)?.value??null}observe(r){return this.getOrCreateSubject(r).asObservable()}getOrCreateSubject(r){let i=this.subjects.get(r);return i||(i=new ie(null),this.subjects.set(r,i)),i}};e.\u0275fac=function(i){return new(i||e)},e.\u0275prov=Q({token:e,factory:e.\u0275fac,providedIn:"root"});let n=e;return n})();var Nt=(()=>{let e=class e{};e.Events={Core:{IDENTIFY:"identify",SDK_VALIDATE_CLIENT_TRIGGERED:"sdkValidateClientTriggered",SDK_VALIDATE_CLIENT_SUCCESS:"sdkValidateClientSuccess",SDK_VALIDATE_CLIENT_FAILED:"sdkValidateClientFailed",SDK_USER_AUTH_SUCCESS:"sdkUserAuthSuccess",SDK_USER_AUTH_FAILED:"sdkUserAuthFailed",SDK_USER_SIGN_OUT:"sdkUserSignOut",SDK_PLAN_EXPIRED:"sdkPlanExpired",SDK_ERROR:"error",SDK_UNCAUGHT_ERROR:"uncaughtError",SDK_SESSION_RE_LOGIN_TRIGGERED:"sdkSessionReLoginTriggered",SDK_SESSION_TOKEN_EXPIRED:"sdkSessionTokenExpired",SDK_SESSION_RE_LOGIN_COUNT_EXCEEDED:"sdkSessionReLoginCountExceeded",SDK_JWT_EXPIRED_RETRY_EXCEEDED:"sdkJwtExpiredRetryExceeded",SDK_EVENT_RATE_LIMIT_EXCEEDED:"sdkEventRateLimitExceeded",SET_PERMISSION_PROVIDER_TRIGGERED:"setPermissionProviderTriggered",SIGN_OUT_USER_TRIGGERED:"signOutUserTriggered",SET_DOCUMENTS_TRIGGERED:"setDocumentsTriggered",SET_ROOT_LOCATION_TRIGGERED:"setRootLocationTriggered",SET_ROOT_DOCUMENT_TRIGGERED:"setRootDocumentTriggered",UNSET_DOCUMENTS_TRIGGERED:"unsetDocumentsTriggered",FETCH_DOCUMENTS_TRIGGERED:"fetchDocumentsTriggered",UPDATE_DOCUMENTS_TRIGGERED:"updateDocumentsTriggered",UPDATE_LOCATIONS_TRIGGERED:"updateLocationsTriggered",FETCH_FOLDERS_TRIGGERED:"fetchFoldersTriggered",SET_USER_DATA_PROVIDER_TRIGGERED:"setUserDataProviderTriggered",SET_ANONYMOUS_USER_DATA_PROVIDER_TRIGGERED:"setAnonymousUserDataProviderTriggered",SET_DATA_PROVIDERS_TRIGGERED:"setDataProvidersTriggered",SET_ENCRYPTION_PROVIDER_TRIGGERED:"setEncryptionProviderTriggered",SET_VELT_AUTH_PROVIDER_TRIGGERED:"setVeltAuthProviderTriggered",GET_DOCUMENT_ID_TRIGGERED:"getDocumentIdTriggered",SET_LOCATIONS_TRIGGERED:"setLocationsTriggered",SET_SCROLLABLE_ELEMENTS_IDS_TRIGGERED:"setScrollableElementsIdsTriggered",REMOVE_LOCATIONS_TRIGGERED:"removeLocationsTriggered",UNSET_LOCATIONS_TRIGGERED:"unsetLocationsTriggered",EXCLUDE_LOCATION_IDS_TRIGGERED:"excludeLocationIdsTriggered",UPDATE_CONTACT_LIST_TRIGGERED:"updateContactListTriggered",UPDATE_ORG_LIST_TRIGGERED:"updateOrgListTriggered",REMOVE_SCROLLABLE_ELEMENTS_IDS_TRIGGERED:"removeScrollableElementsIdsTriggered",GET_PRESENCE_ELEMENT_TRIGGERED:"getPresenceElementTriggered",GET_CURSOR_ELEMENT_TRIGGERED:"getCursorElementTriggered",GET_COMMENT_ELEMENT_TRIGGERED:"getCommentElementTriggered",GET_TAG_ELEMENT_TRIGGERED:"getTagElementTriggered",GET_SELECTION_ELEMENT_TRIGGERED:"getSelectionElementTriggered",GET_RECORDER_ELEMENT_TRIGGERED:"getRecorderElementTriggered",GET_CONTACT_ELEMENT_TRIGGERED:"getContactElementTriggered",GET_REWRITER_ELEMENT_TRIGGERED:"getRewriterElementTriggered",GET_HUDDLE_ELEMENT_TRIGGERED:"getHuddleElementTriggered",GET_LIVE_STATE_SYNC_ELEMENT_TRIGGERED:"getLiveStateSyncElementTriggered",GET_ARROW_ELEMENT_TRIGGERED:"getArrowElementTriggered",GET_VIEWS_ELEMENT_TRIGGERED:"getViewsElementTriggered",GET_NOTIFICATION_ELEMENT_TRIGGERED:"getNotificationElementTriggered",GET_AUTOCOMPLETE_ELEMENT_TRIGGERED:"getAutocompleteElementTriggered",GET_DOC_ELEMENT_TRIGGERED:"getDocElementTriggered",GET_AREA_ELEMENT_TRIGGERED:"getAreaElementTriggered",GET_REACTION_ELEMENT_TRIGGERED:"getReactionElementTriggered",GET_METADATA_TRIGGERED:"getMetadataTriggered",FETCH_DEBUG_INFO_TRIGGERED:"fetchDebugInfoTriggered",GET_DEBUG_INFO_TRIGGERED:"getDebugInfoTriggered",DISABLE_FEATURES_TRIGGERED:"disableFeaturesTriggered",SET_DARK_MODE_TRIGGERED:"setDarkModeTriggered",SET_UNSTYLED_MODE_TRIGGERED:"setUnstyledModeTriggered",ENABLE_LOGS_TRIGGERED:"enableLogsTriggered",DISABLE_LOGS_TRIGGERED:"disableLogsTriggered",IS_USER_ALLOWED_TRIGGERED:"isUserAllowedTriggered",GET_USER_TRIGGERED:"getUserTriggered",GET_CURRENT_USER_TRIGGERED:"getCurrentUserTriggered",GET_HEARTBEAT_TRIGGERED:"getHeartbeatTriggered",GET_USER_ROLE_TRIGGERED:"getUserRoleTriggered",GET_USER_PERMISSIONS_TRIGGERED:"getUserPermissionsTriggered",GET_CURRENT_USER_PERMISSIONS_TRIGGERED:"getCurrentUserPermissionsTriggered",GET_FEATURES_ACCESS_LEVEL_IAM_TRIGGERED:"getFeaturesAccessLevelIamTriggered",IS_PLAN_EXPIRED_TRIGGERED:"isPlanExpiredTriggered",GET_CUSTOMER_METADATA_TRIGGERED:"getCustomerMetadataTriggered",GET_DOCUMENT_METADATA_TRIGGERED:"getDocumentMetadataTriggered",REMOVE_VELT_CONTENT_TRIGGERED:"removeVeltContentTriggered",INJECT_CUSTOM_CSS_TRIGGERED:"injectCustomCssTriggered",SET_LANGUAGE_TRIGGERED:"setLanguageTriggered",SET_TRANSLATIONS_TRIGGERED:"setTranslationsTriggered",ENABLE_AUTO_TRANSLATION_TRIGGERED:"enableAutoTranslationTriggered",DISABLE_AUTO_TRANSLATION_TRIGGERED:"disableAutoTranslationTriggered",SF_TRIGGERED:"sfTriggered",SET_UI_STATE_TRIGGERED:"setUiStateTriggered",GET_UI_STATE_TRIGGERED:"getUiStateTriggered",ENABLE_SAFE_EVAL_TRIGGERED:"enableSafeEvalTriggered",DISABLE_SAFE_EVAL_TRIGGERED:"disableSafeEvalTriggered",ENABLE_FIRESTORE_PERSISTENT_CACHE_TRIGGERED:"enableFirestorePersistentCacheTriggered",DISABLE_FIRESTORE_PERSISTENT_CACHE_TRIGGERED:"disableFirestorePersistentCacheTriggered",RESET_VELT_BUTTON_STATE_TRIGGERED:"resetVeltButtonStateTriggered"},PermissionProvider:{RESOURCE_ACCESS_REQUEST_FORMED:"resourceAccessRequestFormed",RESOURCE_ACCESS_REQUEST_TRIGGERED:"resourceAccessRequestTriggered",REVOKE_ACCESS_ON_DOCUMENT_UNSET_TRIGGERED:"revokeAccessOnDocumentUnsetTriggered",REVOKE_ACCESS_ON_DOCUMENT_UNSET_FORMED:"revokeAccessOnDocumentUnsetFormed",REVOKE_ACCESS_ON_DOCUMENT_UNSET_RESULT:"revokeAccessOnDocumentUnsetResult",REVOKE_ACCESS_ON_USER_LOGOUT_TRIGGERED:"revokeAccessOnUserLogoutTriggered",REVOKE_ACCESS_ON_USER_LOGOUT_FORMED:"revokeAccessOnUserLogoutFormed",REVOKE_ACCESS_ON_USER_LOGOUT_RESULT:"revokeAccessOnUserLogoutResult",RESOURCE_ACCESS_RESULT:"resourceAccessResult",RESOURCE_ACCESS_ERROR:"resourceAccessError",RESOURCE_ACCESS_RESULT_FROM_CACHE:"resourceAccessResultFromCache",REVOKE_ACCESS_ON_DOCUMENT_UNSET_ERROR:"revokeAccessOnDocumentUnsetError",REVOKE_ACCESS_ON_USER_LOGOUT_ERROR:"revokeAccessOnUserLogoutError"},Resolver:{COMMENT_RESOLVER_GET:"comment_resolver_get",COMMENT_RESOLVER_SAVE:"comment_resolver_save",COMMENT_RESOLVER_DELETE:"comment_resolver_delete",COMMENT_RESOLUTION_REQUEST_FORMED:"commentResolutionRequestFormed",COMMENT_RESOLUTION_REQUEST_TRIGGERED:"commentResolutionRequestTriggered",COMMENT_RESOLUTION_RESULT:"commentResolutionResult",COMMENT_RESOLUTION_ERROR:"commentResolutionError",COMMENT_RESOLUTION_RESULT_FROM_CACHE:"commentResolutionResultFromCache",COMMENT_SAVE_REQUEST_FORMED:"commentSaveRequestFormed",COMMENT_SAVE_REQUEST_TRIGGERED:"commentSaveRequestTriggered",COMMENT_SAVE_RESULT:"commentSaveResult",COMMENT_SAVE_ERROR:"commentSaveError",COMMENT_DELETE_REQUEST_FORMED:"commentDeleteRequestFormed",COMMENT_DELETE_REQUEST_TRIGGERED:"commentDeleteRequestTriggered",COMMENT_DELETE_RESULT:"commentDeleteResult",COMMENT_DELETE_ERROR:"commentDeleteError",REACTION_RESOLVER_GET:"reaction_resolver_get",REACTION_RESOLVER_SAVE:"reaction_resolver_save",REACTION_RESOLVER_DELETE:"reaction_resolver_delete",REACTION_RESOLUTION_REQUEST_FORMED:"reactionResolutionRequestFormed",REACTION_RESOLUTION_REQUEST_TRIGGERED:"reactionResolutionRequestTriggered",REACTION_RESOLUTION_RESULT:"reactionResolutionResult",REACTION_RESOLUTION_ERROR:"reactionResolutionError",REACTION_RESOLUTION_RESULT_FROM_CACHE:"reactionResolutionResultFromCache",REACTION_SAVE_REQUEST_FORMED:"reactionSaveRequestFormed",REACTION_SAVE_REQUEST_TRIGGERED:"reactionSaveRequestTriggered",REACTION_SAVE_RESULT:"reactionSaveResult",REACTION_SAVE_ERROR:"reactionSaveError",REACTION_DELETE_REQUEST_FORMED:"reactionDeleteRequestFormed",REACTION_DELETE_REQUEST_TRIGGERED:"reactionDeleteRequestTriggered",REACTION_DELETE_RESULT:"reactionDeleteResult",REACTION_DELETE_ERROR:"reactionDeleteError",NOTIFICATION_RESOLVER_GET:"notification_resolver_get",NOTIFICATION_RESOLVER_DELETE:"notification_resolver_delete",NOTIFICATION_RESOLUTION_REQUEST_FORMED:"notificationResolutionRequestFormed",NOTIFICATION_RESOLUTION_REQUEST_TRIGGERED:"notificationResolutionRequestTriggered",NOTIFICATION_RESOLUTION_RESULT:"notificationResolutionResult",NOTIFICATION_RESOLUTION_ERROR:"notificationResolutionError",NOTIFICATION_DELETE_REQUEST_FORMED:"notificationDeleteRequestFormed",NOTIFICATION_DELETE_REQUEST_TRIGGERED:"notificationDeleteRequestTriggered",NOTIFICATION_DELETE_RESULT:"notificationDeleteResult",NOTIFICATION_DELETE_ERROR:"notificationDeleteError",USER_RESOLVER_GET:"user_resolver_get",USER_RESOLUTION_REQUEST_FORMED:"userResolutionRequestFormed",USER_RESOLUTION_REQUEST_TRIGGERED:"userResolutionRequestTriggered",USER_RESOLUTION_RESULT:"userResolutionResult",USER_RESOLUTION_ERROR:"userResolutionError",USER_RESOLUTION_RESULT_FROM_CACHE:"userResolutionResultFromCache",EMAIL_USER_ID_RESOLUTION_REQUEST_FORMED:"emailUserIdResolutionRequestFormed",EMAIL_USER_ID_RESOLUTION_REQUEST_TRIGGERED:"emailUserIdResolutionRequestTriggered",EMAIL_USER_ID_RESOLUTION_RESULT:"emailUserIdResolutionResult",EMAIL_USER_ID_RESOLUTION_ERROR:"emailUserIdResolutionError",ATTACHMENT_RESOLVER_SAVE:"attachment_resolver_save",ATTACHMENT_RESOLVER_DELETE:"attachment_resolver_delete",ATTACHMENT_SAVE_REQUEST_FORMED:"attachmentSaveRequestFormed",ATTACHMENT_SAVE_REQUEST_TRIGGERED:"attachmentSaveRequestTriggered",ATTACHMENT_SAVE_RESULT:"attachmentSaveResult",ATTACHMENT_SAVE_ERROR:"attachmentSaveError",ATTACHMENT_DELETE_REQUEST_FORMED:"attachmentDeleteRequestFormed",ATTACHMENT_DELETE_REQUEST_TRIGGERED:"attachmentDeleteRequestTriggered",ATTACHMENT_DELETE_RESULT:"attachmentDeleteResult",ATTACHMENT_DELETE_ERROR:"attachmentDeleteError",RECORDER_RESOLVER_GET:"recorder_resolver_get",RECORDER_RESOLVER_SAVE:"recorder_resolver_save",RECORDER_RESOLVER_DELETE:"recorder_resolver_delete",RECORDER_RESOLUTION_REQUEST_FORMED:"recorderResolutionRequestFormed",RECORDER_RESOLUTION_REQUEST_TRIGGERED:"recorderResolutionRequestTriggered",RECORDER_RESOLUTION_RESULT:"recorderResolutionResult",RECORDER_RESOLUTION_ERROR:"recorderResolutionError",RECORDER_RESOLUTION_RESULT_FROM_CACHE:"recorderResolutionResultFromCache",RECORDER_SAVE_REQUEST_FORMED:"recorderSaveRequestFormed",RECORDER_SAVE_REQUEST_TRIGGERED:"recorderSaveRequestTriggered",RECORDER_SAVE_RESULT:"recorderSaveResult",RECORDER_SAVE_ERROR:"recorderSaveError",RECORDER_DELETE_REQUEST_FORMED:"recorderDeleteRequestFormed",RECORDER_DELETE_REQUEST_TRIGGERED:"recorderDeleteRequestTriggered",RECORDER_DELETE_RESULT:"recorderDeleteResult",RECORDER_DELETE_ERROR:"recorderDeleteError",ACTIVITY_RESOLVER_GET:"activity_resolver_get",ACTIVITY_RESOLVER_SAVE:"activity_resolver_save",ACTIVITY_RESOLUTION_REQUEST_FORMED:"activityResolutionRequestFormed",ACTIVITY_RESOLUTION_REQUEST_TRIGGERED:"activityResolutionRequestTriggered",ACTIVITY_RESOLUTION_RESULT:"activityResolutionResult",ACTIVITY_RESOLUTION_ERROR:"activityResolutionError",ACTIVITY_RESOLUTION_RESULT_FROM_CACHE:"activityResolutionResultFromCache",ACTIVITY_SAVE_REQUEST_FORMED:"activitySaveRequestFormed",ACTIVITY_SAVE_REQUEST_TRIGGERED:"activitySaveRequestTriggered",ACTIVITY_SAVE_RESULT:"activitySaveResult",ACTIVITY_SAVE_ERROR:"activitySaveError"},Autocomplete:{CREATE_TRIGGERED:"createTriggered",ON_AUTOCOMPLETE_CHIP_CLICK_TRIGGERED:"onAutocompleteChipClickTriggered"},Comments:{COMMENT_TOOL_CLICKED:"commentToolClicked",COMMENT_DRAFT_ADDED:"commentDraftAdded",COMMENT_ADD_CONTEXT_TRIGGERED:"commentAddContextTriggered",COMMENT_UPDATE_CONTEXT_TRIGGERED:"commentUpdateContextTriggered",COMMENT_UPDATE_CONTEXT_SUCCESS:"commentUpdateContextSuccess",COMMENT_UPDATE_CONTEXT_FAILED:"commentUpdateContextFailed",COMMENT_ADDED:"commentAdded",COMMENT_READ:"commentRead",COMMENT_STATUS_CHANGED:"commentStatusChanged",COMMENT_PRIORITY_CHANGED:"commentPriorityChanged",COMMENT_CUSTOM_CHIPS_CHANGED:"commentCustomChipsChanged",COMMENT_APPROVED:"commentApproved",COMMENT_ACCEPTED:"commentAccepted",COMMENT_REJECTED:"commentRejected",COMMENT_ASSIGNED:"commentAssigned",COMMENT_DELETE_TRIGGERED:"commentDeleteTriggered",COMMENT_DELETED:"commentDeleted",COMMENT_THREAD_DELETED:"commentThreadDeleted",COMMENT_LINK_COPIED:"commentLinkCopied",COMMENT_EDIT_BUTTON_CLICKED:"commentEditButtonClicked",COMMENT_EDITED:"commentEdited",COMMENT_SIDEBAR_OPENED:"commentSidebarOpened",COMMENT_SIDEBAR_CLOSED:"commentSidebarClosed",COMMENT_SIDEBAR_TOGGLED:"commentSidebarToggled",COMMENT_TAG_BUTTON_CLICKED:"commentTagButtonClicked",COMMENT_TAG_ADDED:"commentTagAdded",COMMENT_PIN_DRAGGED:"commentPinDragged",COMMENT_ADD_MODE_ENABLED:"commentAddModeEnabled",COMMENT_ADD_MODE_DISABLED:"commentAddModeDisabled",COMMENT_TEXT_MODE_ENABLED:"commentTextModeEnabled",COMMENT_TEXT_MODE_DISABLED:"commentTextModeDisabled",COMMENT_POPOVER_MODE_ENABLED:"commentPopoverModeEnabled",COMMENT_POPOVER_MODE_DISABLED:"commentPopoverModeDisabled",COMMENT_STREAM_MODE_ENABLED:"commentStreamModeEnabled",COMMENT_STREAM_MODE_DISABLED:"commentStreamModeDisabled",COMMENT_SIDEBAR_EMBED_MODE_ENABLED:"commentSidebarEmbedModeEnabled",COMMENT_SIDEBAR_FLOATING_MODE_ENABLED:"commentSidebarFloatingModeEnabled",COMMENT_ATTACHMENT_SET_ALLOWED_FILE_TYPES_TRIGGERED:"commentAttachmentSetAllowedFileTypesTriggered",ENABLE_FORCE_CLOSE_ALL_ON_ESC_TRIGGERED:"enableForceCloseAllOnEscTriggered",DISABLE_FORCE_CLOSE_ALL_ON_ESC_TRIGGERED:"disableForceCloseAllOnEscTriggered",COMMENT_ATTACHMENT_BUTTON_CLICKED:"commentAttachmentButtonClicked",COMMENT_ATTACHMENT_ADDED:"commentAttachmentAdded",COMMENT_ATTACHMENT_DOWNLOADED:"commentAttachmentDownloaded",COMMENT_ATTACHMENT_DELETED:"commentAttachmentDeleted",COMMENT_ATTACHMENT_SIZE_EXCEEDED:"commentAttachmentSizeExceeded",COMMENT_SUBMIT_TRIGGERED:"commentSubmitTriggered",COMMENT_APPROVE_BUTTON_CLICKED:"commentApproveButtonClicked",COMMENT_ACCEPT_BUTTON_CLICKED:"commentAcceptButtonClicked",COMMENT_REJECT_BUTTON_CLICKED:"commentRejectButtonClicked",SUGGESTION_ACCEPTED:"suggestionAccepted",SUGGESTION_REJECTED:"suggestionRejected",COMMENT_SIGN_IN_BUTTON_CLICKED:"commentSignInButtonClicked",COMMENT_UPGRADE_BUTTON_CLICKED:"commentUpgradeButtonClicked",COMMENT_RECORDING_TOOL_CLICKED:"commentRecordingToolClicked",COMMENT_RECORDING_ADDED:"commentRecordingAdded",COMMENT_RECORDING_DELETED:"commentRecordingDeleted",COMMENT_MORE_REPLY_OPTION_CLICKED:"commentMoreReplyOptionClicked",COMMENT_PRIVATE_COMMENT_MODE_ENABLED:"commentPrivateCommentModeEnabled",COMMENT_PRIVATE_COMMENT_MODE_DISABLED:"commentPrivateCommentModeDisabled",COMMENT_ACCESS_MODE_CHANGED:"commentAccessModeChanged",SET_COMPOSER_FILE_ATTACHMENTS_TRIGGERED:"setComposerFileAttachmentsTriggered",GET_ALL_COMMENT_ANNOTATIONS_TRIGGERED_INTERNAL:"getAllCommentAnnotationsTriggered_internal",GET_ALL_COMMENT_ANNOTATIONS_TRIGGERED:"getAllCommentAnnotationsTriggered",DELETE_SELECTED_COMMENT_TRIGGERED:"deleteSelectedCommentTriggered",ENABLE_TEXT_COMMENTS_TRIGGERED:"enableTextCommentsTriggered",DISABLE_TEXT_COMMENTS_TRIGGERED:"disableTextCommentsTriggered",ALLOWED_ELEMENT_IDS_TRIGGERED:"allowedElementIdsTriggered",ALLOWED_ELEMENT_CLASS_NAMES_TRIGGERED:"allowedElementClassNamesTriggered",ALLOWED_ELEMENT_QUERY_SELECTORS_TRIGGERED:"allowedElementQuerySelectorsTriggered",ENABLE_FLOATING_COMMENT_DIALOG_TRIGGERED:"enableFloatingCommentDialogTriggered",DISABLE_FLOATING_COMMENT_DIALOG_TRIGGERED:"disableFloatingCommentDialogTriggered",ATTACH_COMMENT_TRIGGERED:"attachCommentTriggered",OPEN_COMMENT_SIDEBAR_TRIGGERED:"openCommentSidebarTriggered",CLOSE_COMMENT_SIDEBAR_TRIGGERED:"closeCommentSidebarTriggered",TOGGLE_COMMENT_SIDEBAR_TRIGGERED:"toggleCommentSidebarTriggered",SET_ASSIGN_TO_TYPE_TRIGGERED:"setAssignToTypeTriggered",ENABLE_CONTEXT_IN_PAGE_MODE_COMPOSER_TRIGGERED:"enableContextInPageModeComposerTriggered",DISABLE_CONTEXT_IN_PAGE_MODE_COMPOSER_TRIGGERED:"disableContextInPageModeComposerTriggered",CLEAR_PAGE_MODE_COMPOSER_CONTEXT_TRIGGERED:"clearPageModeComposerContextTriggered",SET_CONTEXT_IN_PAGE_MODE_COMPOSER_TRIGGERED:"setContextInPageModeComposerTriggered",FOCUS_PAGE_MODE_COMPOSER_TRIGGERED:"focusPageModeComposerTriggered",ENABLE_MODERATOR_MODE_TRIGGERED:"enableModeratorModeTriggered",DISABLE_MODERATOR_MODE_TRIGGERED:"disableModeratorModeTriggered",ENABLE_STREAM_MODE_TRIGGERED:"enableStreamModeTriggered",DISABLE_STREAM_MODE_TRIGGERED:"disableStreamModeTriggered",ENABLE_SIGN_IN_BUTTON_TRIGGERED:"enableSignInButtonTriggered",DISABLE_SIGN_IN_BUTTON_TRIGGERED:"disableSignInButtonTriggered",ENABLE_UPGRADE_BUTTON_TRIGGERED:"enableUpgradeButtonTriggered",DISABLE_UPGRADE_BUTTON_TRIGGERED:"disableUpgradeButtonTriggered",ON_COMMENT_MODE_CHANGE_TRIGGERED:"onCommentModeChangeTriggered",ENABLE_ATTACHMENTS_TRIGGERED:"enableAttachmentsTriggered",DISABLE_ATTACHMENTS_TRIGGERED:"disableAttachmentsTriggered",ENABLE_ATTACHMENT_DOWNLOAD_TRIGGERED:"enableAttachmentDownloadTriggered",DISABLE_ATTACHMENT_DOWNLOAD_TRIGGERED:"disableAttachmentDownloadTriggered",IS_USER_GLOBAL_CONTACT_TRIGGERED:"isUserGlobalContactTriggered",ENABLE_DEVICE_INFO_TRIGGERED:"enableDeviceInfoTriggered",DISABLE_DEVICE_INFO_TRIGGERED:"disableDeviceInfoTriggered",ENABLE_COMMENT_MODE_TRIGGERED:"enableCommentModeTriggered",DISABLE_COMMENT_MODE_TRIGGERED:"disableCommentModeTriggered",ENABLE_PERSISTENT_COMMENT_MODE_TRIGGERED:"enablePersistentCommentModeTriggered",DISABLE_PERSISTENT_COMMENT_MODE_TRIGGERED:"disablePersistentCommentModeTriggered",SHOW_COMMENT_INDEX_TRIGGERED:"showCommentIndexTriggered",ENABLE_COMMENT_INDEX_TRIGGERED:"enableCommentIndexTriggered",DISABLE_COMMENT_INDEX_TRIGGERED:"disableCommentIndexTriggered",ENABLE_POPOVER_MODE_TRIGGERED:"enablePopoverModeTriggered",DISABLE_POPOVER_MODE_TRIGGERED:"disablePopoverModeTriggered",ENABLE_POPOVER_TRIANGLE_COMPONENT_TRIGGERED:"enablePopoverTriangleComponentTriggered",DISABLE_POPOVER_TRIANGLE_COMPONENT_TRIGGERED:"disablePopoverTriangleComponentTriggered",ENABLE_DIALOG_ON_HOVER_TRIGGERED:"enableDialogOnHoverTriggered",DISABLE_DIALOG_ON_HOVER_TRIGGERED:"disableDialogOnHoverTriggered",ENABLE_DIALOG_ON_TARGET_ELEMENT_CLICK_TRIGGERED:"enableDialogOnTargetElementClickTriggered",DISABLE_DIALOG_ON_TARGET_ELEMENT_CLICK_TRIGGERED:"disableDialogOnTargetElementClickTriggered",ENABLE_PRIORITY_TRIGGERED:"enablePriorityTriggered",DISABLE_PRIORITY_TRIGGERED:"disablePriorityTriggered",ENABLE_STATUS_TRIGGERED:"enableStatusTriggered",DISABLE_STATUS_TRIGGERED:"disableStatusTriggered",ENABLE_VISIBILITY_OPTIONS_TRIGGERED:"enableVisibilityOptionsTriggered",DISABLE_VISIBILITY_OPTIONS_TRIGGERED:"disableVisibilityOptionsTriggered",ENABLE_RESOLVE_BUTTON_TRIGGERED:"enableResolveButtonTriggered",DISABLE_RESOLVE_BUTTON_TRIGGERED:"disableResolveButtonTriggered",ENABLE_GHOST_COMMENTS_TRIGGERED:"enableGhostCommentsTriggered",DISABLE_GHOST_COMMENTS_TRIGGERED:"disableGhostCommentsTriggered",ENABLE_GHOST_COMMENTS_INDICATOR_TRIGGERED:"enableGhostCommentsIndicatorTriggered",DISABLE_GHOST_COMMENTS_INDICATOR_TRIGGERED:"disableGhostCommentsIndicatorTriggered",SET_CUSTOM_STATUS_TRIGGERED:"setCustomStatusTriggered",SET_CUSTOM_PRIORITY_TRIGGERED:"setCustomPriorityTriggered",SET_CUSTOM_CATEGORY_TRIGGERED:"setCustomCategoryTriggered",ENABLE_INBOX_MODE_TRIGGERED:"enableInboxModeTriggered",DISABLE_INBOX_MODE_TRIGGERED:"disableInboxModeTriggered",ENABLE_AUTO_CATEGORIZE_TRIGGERED:"enableAutoCategorizeTriggered",DISABLE_AUTO_CATEGORIZE_TRIGGERED:"disableAutoCategorizeTriggered",ENABLE_DARK_MODE_TRIGGERED:"enableDarkModeTriggered",DISABLE_DARK_MODE_TRIGGERED:"disableDarkModeTriggered",SET_CONTEXT_PROVIDER_TRIGGERED:"setContextProviderTriggered",ENABLE_SUGGESTION_MODE_TRIGGERED:"enableSuggestionModeTriggered",DISABLE_SUGGESTION_MODE_TRIGGERED:"disableSuggestionModeTriggered",ENABLE_MOBILE_MODE_TRIGGERED:"enableMobileModeTriggered",DISABLE_MOBILE_MODE_TRIGGERED:"disableMobileModeTriggered",ENABLE_INLINE_COMMENT_MODE_TRIGGERED:"enableInlineCommentModeTriggered",DISABLE_INLINE_COMMENT_MODE_TRIGGERED:"disableInlineCommentModeTriggered",ENABLE_MINIMAP_TRIGGERED:"enableMinimapTriggered",DISABLE_MINIMAP_TRIGGERED:"disableMinimapTriggered",SHOW_COMMENTS_ON_DOM_TRIGGERED:"showCommentsOnDomTriggered",HIDE_COMMENTS_ON_DOM_TRIGGERED:"hideCommentsOnDomTriggered",ENABLE_COMMENT_TOOL_TRIGGERED:"enableCommentToolTriggered",DISABLE_COMMENT_TOOL_TRIGGERED:"disableCommentToolTriggered",SET_TOTAL_MEDIA_LENGTH_TRIGGERED:"setTotalMediaLengthTriggered",ON_COMMENT_ADD_TRIGGERED:"onCommentAddTriggered",ON_COMMENT_UPDATE_TRIGGERED:"onCommentUpdateTriggered",ADD_COMMENT_ON_SELECTED_TEXT_TRIGGERED:"addCommentOnSelectedTextTriggered",ENABLE_SIDEBAR_URL_NAVIGATION_TRIGGERED:"enableSidebarUrlNavigationTriggered",DISABLE_SIDEBAR_URL_NAVIGATION_TRIGGERED:"disableSidebarUrlNavigationTriggered",SET_D_STRATEGY_TRIGGERED:"setDStrategyTriggered",ENABLE_SIDEBAR_BUTTON_ON_COMMENT_DIALOG_TRIGGERED:"enableSidebarButtonOnCommentDialogTriggered",DISABLE_SIDEBAR_BUTTON_ON_COMMENT_DIALOG_TRIGGERED:"disableSidebarButtonOnCommentDialogTriggered",ON_SIDEBAR_BUTTON_ON_COMMENT_DIALOG_CLICK_TRIGGERED:"onSidebarButtonOnCommentDialogClickTriggered",ENABLE_REACTIONS_TRIGGERED:"enableReactionsTriggered",DISABLE_REACTIONS_TRIGGERED:"disableReactionsTriggered",ENABLE_ANONYMOUS_EMAIL_TRIGGERED:"enableAnonymousEmailTriggered",DISABLE_ANONYMOUS_EMAIL_TRIGGERED:"disableAnonymousEmailTriggered",SET_RECORDINGS_TRIGGERED:"setRecordingsTriggered",ADD_COMMENT_ON_ELEMENT_TRIGGERED:"addCommentOnElementTriggered",ENABLE_PRIVATE_COMMENT_MODE_TRIGGERED:"enablePrivateCommentModeTriggered",DISABLE_PRIVATE_COMMENT_MODE_TRIGGERED:"disablePrivateCommentModeTriggered",ENABLE_PRIVATE_MODE_TRIGGERED:"enablePrivateModeTriggered",DISABLE_PRIVATE_MODE_TRIGGERED:"disablePrivateModeTriggered",ENABLE_SCROLL_TO_COMMENT_TRIGGERED:"enableScrollToCommentTriggered",DISABLE_SCROLL_TO_COMMENT_TRIGGERED:"disableScrollToCommentTriggered",ENABLE_USER_MENTIONS_TRIGGERED:"enableUserMentionsTriggered",DISABLE_USER_MENTIONS_TRIGGERED:"disableUserMentionsTriggered",SET_COMMENT_SIDEBAR_FILTERS_TRIGGERED:"setCommentSidebarFiltersTriggered",SET_SYSTEM_FILTERS_OPERATOR_TRIGGERED:"setSystemFiltersOperatorTriggered",ENABLE_COMMENT_PIN_HIGHLIGHTER_TRIGGERED:"enableCommentPinHighlighterTriggered",DISABLE_COMMENT_PIN_HIGHLIGHTER_TRIGGERED:"disableCommentPinHighlighterTriggered",ENABLE_DELETE_ON_BACKSPACE_TRIGGERED:"enableDeleteOnBackspaceTriggered",DISABLE_DELETE_ON_BACKSPACE_TRIGGERED:"disableDeleteOnBackspaceTriggered",ENABLE_HOTKEY_TRIGGERED:"enableHotkeyTriggered",DISABLE_HOTKEY_TRIGGERED:"disableHotkeyTriggered",ENABLE_DEVICE_INDICATOR_ON_COMMENT_PINS_TRIGGERED:"enableDeviceIndicatorOnCommentPinsTriggered",DISABLE_DEVICE_INDICATOR_ON_COMMENT_PINS_TRIGGERED:"disableDeviceIndicatorOnCommentPinsTriggered",GET_ELEMENT_REF_BY_ANNOTATION_ID_TRIGGERED:"getElementRefByAnnotationIdTriggered",SCROLL_TO_COMMENT_BY_ANNOTATION_ID_TRIGGERED:"scrollToCommentByAnnotationIdTriggered",SELECT_COMMENT_BY_ANNOTATION_ID_TRIGGERED:"selectCommentByAnnotationIdTriggered",ENABLE_RECORDING_SUMMARY_TRIGGERED:"enableRecordingSummaryTriggered",DISABLE_RECORDING_SUMMARY_TRIGGERED:"disableRecordingSummaryTriggered",ENABLE_RECORDING_TRANSCRIPTION_TRIGGERED:"enableRecordingTranscriptionTriggered",DISABLE_RECORDING_TRANSCRIPTION_TRIGGERED:"disableRecordingTranscriptionTriggered",ENABLE_RECORDING_COUNTDOWN_TRIGGERED:"enableRecordingCountdownTriggered",DISABLE_RECORDING_COUNTDOWN_TRIGGERED:"disableRecordingCountdownTriggered",SET_UNREAD_INDICATOR_MODE_TRIGGERED:"setUnreadIndicatorModeTriggered",ENABLE_ENTER_KEY_TO_SUBMIT_TRIGGERED:"enableEnterKeyToSubmitTriggered",DISABLE_ENTER_KEY_TO_SUBMIT_TRIGGERED:"disableEnterKeyToSubmitTriggered",ENABLE_PIN_SHADOW_DOM_TRIGGERED:"enablePinShadowDOMTriggered",DISABLE_PIN_SHADOW_DOM_TRIGGERED:"disablePinShadowDOMTriggered",ENABLE_DIALOG_SHADOW_DOM_TRIGGERED:"enableDialogShadowDOMTriggered",DISABLE_DIALOG_SHADOW_DOM_TRIGGERED:"disableDialogShadowDOMTriggered",ENABLE_SIDEBAR_SHADOW_DOM_TRIGGERED:"enableSidebarShadowDOMTriggered",DISABLE_SIDEBAR_SHADOW_DOM_TRIGGERED:"disableSidebarShadowDOMTriggered",ENABLE_CHANGE_DETECTION_IN_COMMENT_MODE_TRIGGERED:"enableChangeDetectionInCommentModeTriggered",DISABLE_CHANGE_DETECTION_IN_COMMENT_MODE_TRIGGERED:"disableChangeDetectionInCommentModeTriggered",SHOW_RESOLVED_COMMENTS_ON_DOM_TRIGGERED:"showResolvedCommentsOnDomTriggered",HIDE_RESOLVED_COMMENTS_ON_DOM_TRIGGERED:"hideResolvedCommentsOnDomTriggered",SET_CUSTOM_REACTIONS_TRIGGERED:"setCustomReactionsTriggered",ON_COMMENT_SELECTION_CHANGE_TRIGGERED:"onCommentSelectionChangeTriggered",GET_UNREAD_COMMENT_COUNT_BY_ANNOTATION_ID_TRIGGERED:"getUnreadCommentCountByAnnotationIdTriggered",GET_UNREAD_COMMENT_ANNOTATION_COUNT_ON_CURRENT_DOCUMENT_TRIGGERED:"getUnreadCommentAnnotationCountOnCurrentDocumentTriggered",GET_UNREAD_COMMENT_COUNT_ON_CURRENT_DOCUMENT_TRIGGERED:"getUnreadCommentCountOnCurrentDocumentTriggered",GET_UNREAD_COMMENT_ANNOTATION_COUNT_BY_LOCATION_ID_TRIGGERED:"getUnreadCommentAnnotationCountByLocationIdTriggered",GET_UNREAD_COMMENT_COUNT_BY_LOCATION_ID_TRIGGERED:"getUnreadCommentCountByLocationIdTriggered",UPDATE_COMMENT_DIALOG_POSITION_TRIGGERED:"updateCommentDialogPositionTriggered",ENABLE_AREA_COMMENT_TRIGGERED:"enableAreaCommentTriggered",DISABLE_AREA_COMMENT_TRIGGERED:"disableAreaCommentTriggered",SET_PIN_CURSOR_IMAGE_TRIGGERED:"setPinCursorImageTriggered",ADD_MANUAL_COMMENT_TRIGGERED:"addManualCommentTriggered",CREATE_CUSTOM_LIST_DATA_ON_ANNOTATION_TRIGGERED:"createCustomListDataOnAnnotationTriggered",CREATE_CUSTOM_LIST_DATA_ON_COMMENT_TRIGGERED:"createCustomListDataOnCommentTriggered",EXCLUDE_LOCATION_IDS_FROM_SIDEBAR_TRIGGERED:"excludeLocationIdsFromSidebarTriggered",ENABLE_BUBBLE_ON_PIN_TRIGGERED:"enableBubbleOnPinTriggered",DISABLE_BUBBLE_ON_PIN_TRIGGERED:"disableBubbleOnPinTriggered",ENABLE_BUBBLE_ON_PIN_HOVER_TRIGGERED:"enableBubbleOnPinHoverTriggered",DISABLE_BUBBLE_ON_PIN_HOVER_TRIGGERED:"disableBubbleOnPinHoverTriggered",ENABLE_PIN_DRAG_TRIGGERED:"enablePinDragTriggered",DISABLE_PIN_DRAG_TRIGGERED:"disablePinDragTriggered",ENABLE_MULTI_THREAD_MODE_TRIGGERED:"enableMultiThreadModeTriggered",DISABLE_MULTI_THREAD_MODE_TRIGGERED:"disableMultiThreadModeTriggered",ENABLE_MULTI_THREAD_TRIGGERED:"enableMultiThreadTriggered",DISABLE_MULTI_THREAD_TRIGGERED:"disableMultiThreadTriggered",ENABLE_GROUP_MATCHED_COMMENTS_TRIGGERED:"enableGroupMatchedCommentsTriggered",DISABLE_GROUP_MATCHED_COMMENTS_TRIGGERED:"disableGroupMatchedCommentsTriggered",ENABLE_RESTRICT_TEXT_SEARCH_TO_ANCHOR_TRIGGERED:"enableRestrictTextSearchToAnchorTriggered",DISABLE_RESTRICT_TEXT_SEARCH_TO_ANCHOR_TRIGGERED:"disableRestrictTextSearchToAnchorTriggered",UPDATE_CONTEXT_TRIGGERED:"updateContextTriggered",UPDATE_VISIBILITY_TRIGGERED:"updateVisibilityTriggered",GET_SELECTED_COMMENTS_TRIGGERED:"getSelectedCommentsTriggered",ENABLE_DELETE_REPLY_CONFIRMATION_TRIGGERED:"enableDeleteReplyConfirmationTriggered",DISABLE_DELETE_REPLY_CONFIRMATION_TRIGGERED:"disableDeleteReplyConfirmationTriggered",ON_COPY_LINK_TRIGGERED:"onCopyLinkTriggered",GET_COMMENT_ANNOTATION_BY_ID_TRIGGERED:"getCommentAnnotationByIdTriggered",ENABLE_COLLAPSED_COMMENTS_TRIGGERED:"enableCollapsedCommentsTriggered",DISABLE_COLLAPSED_COMMENTS_TRIGGERED:"disableCollapsedCommentsTriggered",SET_COMMENT_SIDEBAR_DATA_TRIGGERED:"setCommentSidebarDataTriggered",ON_COMMENT_SIDEBAR_INIT_TRIGGERED:"onCommentSidebarInitTriggered",ON_COMMENT_SIDEBAR_DATA_TRIGGERED:"onCommentSidebarDataTriggered",SET_COMMENT_SIDEBAR_DEFAULT_CUSTOM_ACTIONS_TRIGGERED:"setCommentSidebarDefaultCustomActionsTriggered",ENABLE_SIDEBAR_CUSTOM_ACTIONS_TRIGGERED:"enableSidebarCustomActionsTriggered",DISABLE_SIDEBAR_CUSTOM_ACTIONS_TRIGGERED:"disableSidebarCustomActionsTriggered",ENABLE_QUERY_PARAMS_COMMENTS_TRIGGERED:"enableQueryParamsCommentsTriggered",DISABLE_QUERY_PARAMS_COMMENTS_TRIGGERED:"disableQueryParamsCommentsTriggered",ENABLE_RESOLVE_STATUS_ACCESS_ADMIN_ONLY_TRIGGERED:"enableResolveStatusAccessAdminOnlyTriggered",DISABLE_RESOLVE_STATUS_ACCESS_ADMIN_ONLY_TRIGGERED:"disableResolveStatusAccessAdminOnlyTriggered",ENABLE_LINK_CALLBACK_TRIGGERED:"enableLinkCallbackTriggered",DISABLE_LINK_CALLBACK_TRIGGERED:"disableLinkCallbackTriggered",ENABLE_SEEN_BY_USERS_TRIGGERED:"enableSeenByUsersTriggered",DISABLE_SEEN_BY_USERS_TRIGGERED:"disableSeenByUsersTriggered",ENABLE_SHORT_USER_NAME_TRIGGERED:"enableShortUserNameTriggered",DISABLE_SHORT_USER_NAME_TRIGGERED:"disableShortUserNameTriggered",ENABLE_READ_ONLY_TRIGGERED:"enableReadOnlyTriggered",DISABLE_READ_ONLY_TRIGGERED:"disableReadOnlyTriggered",ADD_COMMENT_ANNOTATION_TRIGGERED:"addCommentAnnotationTriggered",APPROVE_COMMENT_ANNOTATION_TRIGGERED:"approveCommentAnnotationTriggered",ACCEPT_COMMENT_ANNOTATION_TRIGGERED:"acceptCommentAnnotationTriggered",REJECT_COMMENT_ANNOTATION_TRIGGERED:"rejectCommentAnnotationTriggered",ACCEPT_SUGGESTION_TRIGGERED:"acceptSuggestionTriggered",REJECT_SUGGESTION_TRIGGERED:"rejectSuggestionTriggered",SUBSCRIBE_COMMENT_ANNOTATION_TRIGGERED:"subscribeCommentAnnotationTriggered",UNSUBSCRIBE_COMMENT_ANNOTATION_TRIGGERED:"unsubscribeCommentAnnotationTriggered",DELETE_COMMENT_ANNOTATION_TRIGGERED:"deleteCommentAnnotationTriggered",GET_COMMENT_ANNOTATIONS_TRIGGERED:"getCommentAnnotationsTriggered",GET_COMMENT_ANNOTATIONS_COUNT_TRIGGERED:"getCommentAnnotationsCountTriggered",ASSIGN_USER_TRIGGERED:"assignUserTriggered",UPDATE_PRIORITY_TRIGGERED:"updatePriorityTriggered",UPDATE_STATUS_TRIGGERED:"updateStatusTriggered",UPDATE_ACCESS_TRIGGERED:"updateAccessTriggered",RESOLVE_COMMENT_ANNOTATION_TRIGGERED:"resolveCommentAnnotationTriggered",GET_LINK_TRIGGERED:"getLinkTriggered",COPY_LINK_TRIGGERED:"copyLinkTriggered",ADD_COMMENT_TRIGGERED:"addCommentTriggered",UPDATE_COMMENT_TRIGGERED:"updateCommentTriggered",DELETE_COMMENT_TRIGGERED:"deleteCommentTriggered",GET_COMMENT_TRIGGERED:"getCommentTriggered",MARK_AS_READ_TRIGGERED:"markAsReadTriggered",MARK_AS_UNREAD_TRIGGERED:"markAsUnreadTriggered",ENABLE_SCREENSHOT_TRIGGERED:"enableScreenshotTriggered",DISABLE_SCREENSHOT_TRIGGERED:"disableScreenshotTriggered",ENABLE_PAGINATED_CONTACT_LIST_TRIGGERED:"enablePaginatedContactListTriggered",DISABLE_PAGINATED_CONTACT_LIST_TRIGGERED:"disablePaginatedContactListTriggered",SUBMIT_COMMENT_TRIGGERED:"submitCommentTriggered",CLEAR_COMPOSER_TRIGGERED:"clearComposerTriggered",GET_COMPOSER_DATA_TRIGGERED:"getComposerDataTriggered",ENABLE_FORMAT_OPTIONS_TRIGGERED:"enableFormatOptionsTriggered",DISABLE_FORMAT_OPTIONS_TRIGGERED:"disableFormatOptionsTriggered",SET_FORMAT_CONFIG_TRIGGERED:"setFormatConfigTriggered",ADD_ATTACHMENT_TRIGGERED:"addAttachmentTriggered",DELETE_ATTACHMENT_TRIGGERED:"deleteAttachmentTriggered",GET_ATTACHMENT_TRIGGERED:"getAttachmentTriggered",DELETE_RECORDING_TRIGGERED:"deleteRecordingTriggered",GET_RECORDING_TRIGGERED:"getRecordingTriggered",REACTION_ADDED:"reactionAdded",REACTION_DELETED:"reactionDeleted",ADD_REACTION_TRIGGERED:"addReactionTriggered",DELETE_REACTION_TRIGGERED:"deleteReactionTriggered",TOGGLE_REACTION_TRIGGERED:"toggleReactionTriggered",ENABLE_CUSTOM_AUTOCOMPLETE_SEARCH_TRIGGERED:"enableCustomAutocompleteSearchTriggered",DISABLE_CUSTOM_AUTOCOMPLETE_SEARCH_TRIGGERED:"disableCustomAutocompleteSearchTriggered",FETCH_COMMENT_ANNOTATIONS_TRIGGERED:"fetchCommentAnnotationsTriggered",SET_TRANSFORM_CONTEXT_TRIGGERED:"setTransformContextTriggered",ENABLE_SVG_AS_IMG_TRIGGERED:"enableSvgAsImgTriggered",DISABLE_SVG_AS_IMG_TRIGGERED:"disableSvgAsImgTriggered",ENABLE_FULL_EXPANDED_TRIGGERED:"enableFullExpandedTriggered",DISABLE_FULL_EXPANDED_TRIGGERED:"disableFullExpandedTriggered",ENABLE_COMMENT_TO_NEAREST_ALLOWED_ELEMENT_TRIGGERED:"enableCommentToNearestAllowedElementTriggered",DISABLE_COMMENT_TO_NEAREST_ALLOWED_ELEMENT_TRIGGERED:"disableCommentToNearestAllowedElementTriggered",ENABLE_DRAFT_MODE_TRIGGERED:"enableDraftModeTriggered",DISABLE_DRAFT_MODE_TRIGGERED:"disableDraftModeTriggered",ENABLE_DRAFT_CONFIRMATION_TRIGGERED:"enableDraftConfirmationTriggered",DISABLE_DRAFT_CONFIRMATION_TRIGGERED:"disableDraftConfirmationTriggered",ENABLE_ID_SCOPED_ANCHORING_TRIGGERED:"enableIdScopedAnchoringTriggered",DISABLE_ID_SCOPED_ANCHORING_TRIGGERED:"disableIdScopedAnchoringTriggered",ENABLE_FILTER_COMMENTS_ON_DOM_TRIGGERED:"enableFilterCommentsOnDomTriggered",DISABLE_FILTER_COMMENTS_ON_DOM_TRIGGERED:"disableFilterCommentsOnDomTriggered",ENABLE_REPLY_AVATARS_TRIGGERED:"enableReplyAvatarsTriggered",DISABLE_REPLY_AVATARS_TRIGGERED:"disableReplyAvatarsTriggered",SET_MAX_REPLY_AVATARS_TRIGGERED:"setMaxReplyAvatarsTriggered",SET_SIDEBAR_BUTTON_COUNT_TYPE_TRIGGERED:"setSidebarButtonCountTypeTriggered",ENABLE_FILTER_GHOST_COMMENTS_IN_SIDEBAR_TRIGGERED:"enableFilterGhostCommentsInSidebarTriggered",DISABLE_FILTER_GHOST_COMMENTS_IN_SIDEBAR_TRIGGERED:"disableFilterGhostCommentsInSidebarTriggered",ENABLE_FULL_SCREEN_IN_SIDEBAR_TRIGGERED:"enableFullScreenInSidebarTriggered",DISABLE_FULL_SCREEN_IN_SIDEBAR_TRIGGERED:"disableFullScreenInSidebarTriggered"},Recording:{RECORDING_TOOL_CLICKED:"recordingToolClicked",RECORDING_ADDED:"recordingAdded",RECORDING_PANEL_SAVE_BUTTON_CLICKED:"recordingPanelSaveButtonClicked",RECORDING_PANEL_CANCEL_BUTTON_CLICKED:"recordingPanelCancelButtonClicked",RECORDING_PANEL_PAUSE_BUTTON_CLICKED:"recordingPanelPauseButtonClicked",RECORDING_PANEL_RESUME_BUTTON_CLICKED:"recordingPanelResumeButtonClicked",RECORDING_PANEL_VIDEO_ON_BUTTON_CLICKED:"recordingPanelVideoOnButtonClicked",RECORDING_PANEL_VIDEO_OFF_BUTTON_CLICKED:"recordingPanelVideoOffButtonClicked",RECORDING_PANEL_AUDIO_ON_BUTTON_CLICKED:"recordingPanelAudioOnButtonClicked",RECORDING_PANEL_AUDIO_OFF_BUTTON_CLICKED:"recordingPanelAudioOffButtonClicked",RECORDING_PANEL_START_BUTTON_CLICKED:"recordingPanelStartButtonClicked",RECORDING_PANEL_PIP_BUTTON_CLICKED:"recordingPanelPipButtonClicked",RECORDING_PLAYED:"recordingPlayed",RECORDING_PAUSED:"recordingPaused",RECORDING_DELETE_TRIGGERED:"recordingDeleteTriggered",RECORDING_DELETED:"recordingDeleted",RECORDING_DRAGGED:"recordingDragged",RECORDING_DRAFT_DRAGGED:"recordingDraftDragged",TRANSCRIPTION_CLICKED:"transcriptionClicked",SUBTITLES_CLICKED:"subtitlesClicked",VIEW_TRANSCRIPTION_SUMMARY_CLICKED:"viewTranscriptionSummaryClicked",TRANSCRIPTION_SUMMARY_COPIED:"transcriptionSummaryCopied",TRANSCRIPTION_TIMESTAMP_CLICKED:"transcriptionTimestampClicked",TRANSCRIPTION_PANEL_DRAGGED:"transcriptionPanelDragged",SUBTITLES_PANEL_DRAGGED:"subtitlesPanelDragged",ENABLE_PLAYBACK_ON_PREVIEW_CLICK_TRIGGERED:"enablePlaybackOnPreviewClickTriggered",DISABLE_PLAYBACK_ON_PREVIEW_CLICK_TRIGGERED:"disablePlaybackOnPreviewClickTriggered",REQUEST_SCREEN_PERMISSION_TRIGGERED:"requestScreenPermissionTriggered",INIT_RECORDING_TRIGGERED:"initRecordingTriggered",ON_RECORDED_DATA_TRIGGERED:"onRecordedDataTriggered",ENABLE_DARK_MODE_TRIGGERED:"enableDarkModeTriggered",DISABLE_DARK_MODE_TRIGGERED:"disableDarkModeTriggered",ENABLE_RECORDING_COUNTDOWN_TRIGGERED:"enableRecordingCountdownTriggered",DISABLE_RECORDING_COUNTDOWN_TRIGGERED:"disableRecordingCountdownTriggered",GET_RECORDING_DATA_BY_RECORDER_ID_TRIGGERED:"getRecordingDataByRecorderIdTriggered",GET_RECORDINGS_TRIGGERED:"getRecordingsTriggered",ENABLE_RECORDING_TRANSCRIPTION_TRIGGERED:"enableRecordingTranscriptionTriggered",DISABLE_RECORDING_TRANSCRIPTION_TRIGGERED:"disableRecordingTranscriptionTriggered",GET_RECORDING_DATA_TRIGGERED:"getRecordingDataTriggered",FETCH_RECORDINGS_TRIGGERED:"fetchRecordingsTriggered",DELETE_RECORDING_TRIGGERED:"deleteRecordingTriggered",ENABLE_VIDEO_EDITOR_TRIGGERED:"enableVideoEditorTriggered",DISABLE_VIDEO_EDITOR_TRIGGERED:"disableVideoEditorTriggered",SET_RECORDING_QUALITY_CONSTRAINTS_TRIGGERED:"setRecordingQualityConstraintsTriggered",SET_RECORDING_ENCODING_OPTIONS_TRIGGERED:"setRecordingEncodingOptionsTriggered",DOWNLOAD_LATEST_VIDEO_TRIGGERED:"downloadLatestVideoTriggered",ENABLE_RECORDING_MIC_TRIGGERED:"enableRecordingMicTriggered",DISABLE_RECORDING_MIC_TRIGGERED:"disableRecordingMicTriggered",ENABLE_RETAKE_ON_VIDEO_EDITOR_TRIGGERED:"enableRetakeOnVideoEditorTriggered",DISABLE_RETAKE_ON_VIDEO_EDITOR_TRIGGERED:"disableRetakeOnVideoEditorTriggered",ASK_DEVICE_PERMISSION_TRIGGERED:"askDevicePermissionTriggered",ENABLE_ONBOARDING_TOOLTIP_TRIGGERED:"enableOnboardingTooltipTriggered",DISABLE_ONBOARDING_TOOLTIP_TRIGGERED:"disableOnboardingTooltipTriggered",SET_MAX_LENGTH_TRIGGERED:"setMaxLengthTriggered",OPEN_PICTURE_IN_PICTURE_TRIGGERED:"openPictureInPictureTriggered",EXIT_PICTURE_IN_PICTURE_TRIGGERED:"exitPictureInPictureTriggered",ENABLE_PICTURE_IN_PICTURE_TRIGGERED:"enablePictureInPictureTriggered",DISABLE_PICTURE_IN_PICTURE_TRIGGERED:"disablePictureInPictureTriggered"},Huddle:{HUDDLE_TOOL_CLICKED:"huddleToolClicked",HUDDLE_CREATED:"huddleCreated",HUDDLE_JOIN_BUTTON_CLICKED:"huddleJoinButtonClicked",HUDDLE_JOINED:"huddleJoined",HUDDLE_LEFT:"huddleLeft",HUDDLE_AUDIO_BUTTON_CLICKED:"huddleAudioButtonClicked",HUDDLE_AUDIO_MUTED:"huddleAudioMuted",HUDDLE_AUDIO_UNMUTED:"huddleAudioUnmuted",HUDDLE_VIDEO_BUTTON_CLICKED:"huddleVideoButtonClicked",HUDDLE_VIDEO_TURNED_ON:"huddleVideoTurnedOn",HUDDLE_VIDEO_TURNED_OFF:"huddleVideoTurnedOff",HUDDLE_SCREENSHARING_BUTTON_CLICKED:"huddleScreensharingButtonClicked",HUDDLE_SCREENSHARING_STARTED:"huddleScreensharingStarted",HUDDLE_SCREENSHARING_STOPPED:"huddleScreensharingStopped",ENABLE_HUDDLE_ON_CURSOR_MODE_TRIGGERED:"enableHuddleOnCursorModeTriggered",DISABLE_HUDDLE_ON_CURSOR_MODE_TRIGGERED:"disableHuddleOnCursorModeTriggered",ENABLE_CHAT_TRIGGERED:"enableChatTriggered",DISABLE_CHAT_TRIGGERED:"disableChatTriggered",ENABLE_FLOCK_MODE_ON_AVATAR_CLICK_TRIGGERED:"enableFlockModeOnAvatarClickTriggered",DISABLE_FLOCK_MODE_ON_AVATAR_CLICK_TRIGGERED:"disableFlockModeOnAvatarClickTriggered"},Presence:{PRESENCE_MULTIPLE_USERS_DETECTED:"presenceMultipleUsersDetected",PRESENCE_USER_STATUS_CHANGED:"presenceUserStatusChanged",PRESENCE_USER_CLICKED:"presenceUserClicked",PRESENCE_SET_CUSTOM_INACTIVITY_TIMER:"presenceSetCustomInactivityTimer",PRESENCE_SET_CUSTOM_OFFLINE_INACTIVITY_TIMER:"presenceSetCustomOfflineInactivityTimer",PRESENCE_SET_CUSTOM_MAX_USERS:"presenceSetCustomMaxUsers",MULTIPLE_USERS_ONLINE:"multipleUsersOnline",ON_USER_STATE_CHANGE:"onUserStateChange",GET_PRESENCE_DATA_TRIGGERED:"getPresenceDataTriggered",GET_ONLINE_USERS_ON_CURRENT_DOCUMENT_TRIGGERED:"getOnlineUsersOnCurrentDocumentTriggered",SET_INACTIVITY_TIME_TRIGGERED:"setInactivityTimeTriggered",ENABLE_FLOCK_MODE_TRIGGERED:"enableFlockModeTriggered",DISABLE_FLOCK_MODE_TRIGGERED:"disableFlockModeTriggered",START_FOLLOWING_USER_TRIGGERED:"startFollowingUserTriggered",STOP_FOLLOWING_USER_TRIGGERED:"stopFollowingUserTriggered",ENABLE_SELF_TRIGGERED:"enableSelfTriggered",DISABLE_SELF_TRIGGERED:"disableSelfTriggered",ADD_USER_TRIGGERED:"addUserTriggered",REMOVE_USER_TRIGGERED:"removeUserTriggered"},Cursor:{CURSOR_MULTIPLE_USERS_DETECTED:"cursorMultipleUsersDetected",CURSOR_SET_CUSTOM_INACTIVITY_TIMER:"cursorSetCustomInactivityTimer",GET_LIVE_CURSORS_ON_CURRENT_DOCUMENT_TRIGGERED:"getLiveCursorsOnCurrentDocumentTriggered",SET_INACTIVITY_TIME_TRIGGERED:"setInactivityTimeTriggered",ALLOWED_ELEMENT_IDS_TRIGGERED:"allowedElementIdsTriggered"},Selection:{SELECTION_CREATED_WHEN_MULTIPLE_USERS_DETECTED:"selectionCreatedWhenMultipleUsersDetected",SELECTION_SET_CUSTOM_INACTIVITY_TIMER:"selectionSetCustomInactivityTimer",ENABLE_LIVE_SELECTION_TRIGGERED:"enableLiveSelectionTriggered",DISABLE_LIVE_SELECTION_TRIGGERED:"disableLiveSelectionTriggered",ENABLE_USER_INDICATOR_TRIGGERED:"enableUserIndicatorTriggered",DISABLE_USER_INDICATOR_TRIGGERED:"disableUserIndicatorTriggered",SET_USER_INDICATOR_POSITION_TRIGGERED:"setUserIndicatorPositionTriggered",SET_USER_INDICATOR_TYPE_TRIGGERED:"setUserIndicatorTypeTriggered",ENABLE_DEFAULT_ELEMENTS_TRACKING_TRIGGERED:"enableDefaultElementsTrackingTriggered",DISABLE_DEFAULT_ELEMENTS_TRACKING_TRIGGERED:"disableDefaultElementsTrackingTriggered",ENABLE_DEFAULT_STYLING_TRIGGERED:"enableDefaultStylingTriggered",DISABLE_DEFAULT_STYLING_TRIGGERED:"disableDefaultStylingTriggered",GET_LIVE_SELECTION_DATA_TRIGGERED:"getLiveSelectionDataTriggered",SET_INACTIVITY_TIME_TRIGGERED:"setInactivityTimeTriggered"},LiveStateSync:{SET_USER_AS_EDITOR_TRIGGERED:"setUserAsEditorTriggered",SET_USER_AS_EDITOR_ERROR:"setUserAsEditorError",REQUEST_EDITOR_ACCESS_TRIGGERED:"requestEditorAccessTriggered",ACCEPT_EDITOR_ACCESS_REQUEST_TRIGGERED:"acceptEditorAccessRequestTriggered",REJECT_EDITOR_ACCESS_REQUEST_TRIGGERED:"rejectEditorAccessRequestTriggered",CANCEL_EDITOR_ACCESS_REQUEST_TRIGGERED:"cancelEditorAccessRequestTriggered",EDIT_CURRENT_TAB_TRIGGERED:"editCurrentTabTriggered",SEM_ACCESS_REQUESTED:"semAccessRequested",SEM_ACCESS_REQUEST_CANCELED:"semAccessRequestCanceled",SEM_ACCESS_ACCEPTED:"semAccessAccepted",SEM_ACCESS_REJECTED:"semAccessRejected",SEM_EDITOR_ASSIGNED:"semEditorAssigned",SEM_VIEWER_ASSIGNED:"semViewerAssigned",SEM_EDITOR_ON_DIFFERENT_TAB_DETECTED:"semEditorOnDifferentTabDetected",SEM_MAKE_EDITOR_TRIGGERED:"semMakeEditorTriggered",SEM_MAKE_READER_TRIGGERED:"semMakeReaderTriggered",SEM_SINGLE_EDITOR_LIVE_STATE_DATA_STATS:"semSingleEditorLiveStateDataStats",SEM_SINGLE_EDITOR_LIVE_STATE_EMPTY_DATA_STATS:"semSingleEditorLiveStateEmptyDataStats",SEM_SINGLE_EDITOR_DETERMINE_EDITOR_STATUS:"semSingleEditorDetermineEditorStatus",SEM_SINGLE_EDITOR_LIVE_STATE_DATA_MISMATCH:"semSingleEditorLiveStateDataMismatch",SEM_SINGLE_EDITOR_DATA_MISMATCH_WITH_EXTERNAL:"semSingleEditorLiveStateDataMismatchWithExternal",SEM_USER_EDITOR_STATS:"semUserEditorStats",REMOVE_EDITOR_ACCESS:"removeEditorAccess",REMOVE_EDITOR_ACCESS_ERROR:"removeEditorAccessError",SEM_SINGLE_EDITOR_LIVE_STATE_DATA_ON_MAKE_EDITOR:"semSingleEditorLiveStateDataOnMakeEditor",SEM_SINGLE_EDITOR_LIVE_STATE_DATA_ON_MAKE_READER:"semSingleEditorLiveStateDataOnMakeReader",GET_LIVE_STATE_DATA_TRIGGERED:"getLiveStateDataTriggered",FETCH_LIVE_STATE_DATA_TRIGGERED:"fetchLiveStateDataTriggered",ENABLE_SINGLE_EDITOR_MODE_TRIGGERED:"enableSingleEditorModeTriggered",DISABLE_SINGLE_EDITOR_MODE_TRIGGERED:"disableSingleEditorModeTriggered",IS_USER_EDITOR_TRIGGERED:"isUserEditorTriggered",GET_EDITOR_TRIGGERED:"getEditorTriggered",RESET_USER_ACCESS_TRIGGERED:"resetUserAccessTriggered",SINGLE_EDITOR_MODE_CONTAINER_IDS_TRIGGERED:"singleEditorModeContainerIdsTriggered",ENABLE_AUTO_SYNC_STATE_TRIGGERED:"enableAutoSyncStateTriggered",DISABLE_AUTO_SYNC_STATE_TRIGGERED:"disableAutoSyncStateTriggered",IS_EDITOR_ACCESS_REQUESTED_TRIGGERED:"isEditorAccessRequestedTriggered",EDITOR_ACCESS_REQUESTED_BY_TRIGGERED:"editorAccessRequestedByTriggered",EDITOR_ACCESS_TRANSFER_ON_TIMEOUT_TRIGGERED:"editorAccessTransferOnTimeoutTriggered",SET_EDITOR_ACCESS_TIMEOUT_TRIGGERED:"setEditorAccessTimeoutTriggered",ENABLE_EDITOR_ACCESS_TRANSFER_ON_TIMEOUT_TRIGGERED:"enableEditorAccessTransferOnTimeoutTriggered",DISABLE_EDITOR_ACCESS_TRANSFER_ON_TIMEOUT_TRIGGERED:"disableEditorAccessTransferOnTimeoutTriggered",ENABLE_DEFAULT_SINGLE_EDITOR_UI_TRIGGERED:"enableDefaultSingleEditorUiTriggered",DISABLE_DEFAULT_SINGLE_EDITOR_UI_TRIGGERED:"disableDefaultSingleEditorUiTriggered",GET_EDITOR_ACCESS_TIMER_TRIGGERED:"getEditorAccessTimerTriggered",ON_SERVER_CONNECTION_STATE_CHANGE_TRIGGERED:"onServerConnectionStateChangeTriggered",UPDATE_USER_PRESENCE_TRIGGERED:"updateUserPresenceTriggered",ENABLE_HEARTBEAT_TRIGGERED:"enableHeartbeatTriggered",DISABLE_HEARTBEAT_TRIGGERED:"disableHeartbeatTriggered"},Tag:{TAG_TOOL_CLICKED:"tagToolClicked",TAG_DRAFT_ADDED:"tagDraftAdded",TAG_ADDED:"tagAdded",TAG_READ:"tagRead",TAG_RESOLVED:"tagResolved",TAG_DRAGGED:"tagDragged",TAG_LINK_COPIED:"tagLinkCopied",TAG_ADD_MODE_ENABLED:"tagAddModeEnabled",TAG_ADD_MODE_DISABLED:"tagAddModeDisabled",TAG_DELETE_TRIGGERED:"tagDeleteTriggered",TAG_DELETED:"tagDeleted",GET_ALL_TAG_ANNOTATIONS_TRIGGERED:"getAllTagAnnotationsTriggered",DELETE_TAG_TRIGGERED:"deleteTagTriggered",ALLOWED_ELEMENT_IDS_TRIGGERED:"allowedElementIdsTriggered",ATTACH_TAG_TRIGGERED:"attachTagTriggered",ADD_TAG_MODE_CHANGE_TRIGGERED:"addTagModeChangeTriggered"},Rewriter:{REWRITER_ENABLED:"rewriterEnabled",REWRITER_MIN_CHARACTER_NOT_MET:"rewriterMinCharacterNotMet",REWRITER_MAX_CHARACTER_NOT_MET:"rewriterMaxCharacterNotMet",REWRITE_BUTTON_CLICKED:"rewriteButtonClicked",REWRITE_PROMPT_BUTTON_CLICKED:"rewritePromptButtonClicked",REWRITE_REFRESH_BUTTON_CLICKED:"rewriteRefreshButtonClicked",REWRITE_OPTION_SELECTED:"rewriteOptionSelected",REWRITE_TASK_CREATED:"rewriteTaskCreated",REWRITE_DIALOG_DRAGGED:"rewriteDialogDragged",REWRITE_SHOW_ORIGINAL_TEXT_CLICKED:"rewriteShowOriginalTextClicked",REWRITE_CLOSE_BUTTON_CLICKED:"rewriteCloseButtonClicked",REWRITE_PROMPT_SUBMITTED:"rewritePromptSubmitted",ENABLE_REWRITER_TRIGGERED:"enableRewriterTriggered",DISABLE_REWRITER_TRIGGERED:"disableRewriterTriggered",ON_TEXT_SELECTED_SUBSCRIBED:"onTextSelectedSubscribed",ASK_AI_TRIGGERED:"askAiTriggered",REPLACE_TEXT_TRIGGERED:"replaceTextTriggered",ADD_COMMENT_FROM_AI_TRIGGERED:"addCommentFromAITriggered"},Feedback:{FEEDBACK_BUTTON_CLICKED:"feedbackButtonClicked",FEEDBACK_SUBMITTED:"feedbackSubmitted"},Contact:{UPDATE_CONTACT_LIST_TRIGGERED:"updateContactListTriggered",UPDATE_ORG_LIST_TRIGGERED:"updateOrgListTriggered",IS_USER_GLOBAL_CONTACT_TRIGGERED:"isUserGlobalContactTriggered",ON_CONTACT_SELECTED_TRIGGERED:"onContactSelectedTriggered",ENABLE_AT_HERE_TRIGGERED:"enableAtHereTriggered",DISABLE_AT_HERE_TRIGGERED:"disableAtHereTriggered",SET_AT_HERE_LABEL_TRIGGERED:"setAtHereLabelTriggered",SET_AT_HERE_DESCRIPTION_TRIGGERED:"setAtHereDescriptionTriggered",UPDATE_CONTACT_LIST_SCOPE_FOR_ORGANIZATION_USERS_TRIGGERED:"updateContactListScopeForOrganizationUsersTriggered",GET_CONTACT_LIST_TRIGGERED:"getContactListTriggered"},ContactUs:{CONTACT_BUTTON_CLICKED:"contactButtonClicked",CONTACT_SUBMITTED:"contactSubmitted"},Bug:{BUG_BUTTON_CLICKED:"bugButtonClicked",BUG_SUBMITTED:"bugSubmitted"},ShareDialog:{SHARE_BUTTON_CLICKED:"shareButtonClicked",DOCUMENT_ACCESS_CHANGED:"documentAccessChanged",DOCUMENT_USER_ACCESS_ADDED:"documentUserAccessAdded",DOCUMENT_USER_ACCESS_REMOVED:"documentUserAccessRemoved",SHARE_LINK_COPIED:"shareLinkCopied"},InviteDialog:{USER_INVITED:"userInvited",INVITE_LINK_COPIED:"inviteLinkCopied"},Iam:{USER_ACCESS_DENIED:"userAccessDenied"},Arrow:{ARROW_TOOL_CLICKED:"arrowToolClicked",ARROW_DRAFT_ADDED:"arrowDraftAdded",ARROW_ADDED:"arrowAdded",ARROW_READ:"arrowRead",ARROW_RESOLVED:"arrowResolved",ARROW_DRAGGED:"arrowDragged",ARROW_LINK_COPIED:"arrowLinkCopied",ARROW_ADD_MODE_ENABLED:"arrowAddModeEnabled",ARROW_ADD_MODE_DISABLED:"arrowAddModeDisabled",ARROW_DELETE_TRIGGERED:"arrowDeleteTriggered",ARROW_DELETED:"arrowDeleted",ALLOWED_ELEMENT_IDS_TRIGGERED:"allowedElementIdsTriggered"},Area:{AREA_TOOL_CLICKED:"areaToolClicked",AREA_ADDED:"areaAdded",AREA_DRAGGED:"areaDragged",AREA_LINK_COPIED:"areaLinkCopied",AREA_ADD_MODE_ENABLED:"areaAddModeEnabled",AREA_ADD_MODE_DISABLED:"areaAddModeDisabled",AREA_DELETE_TRIGGERED:"areaDeleteTriggered",AREA_DELETED:"areaDeleted",ENABLE_AREA_COMMENT_TRIGGERED:"enableAreaCommentTriggered",DISABLE_AREA_COMMENT_TRIGGERED:"disableAreaCommentTriggered"},Doc:{DOCUMENT_ID_SET_TRIGGERED:"documentIdSetTriggered",SET_DOCUMENTS_SUCCESS:"setDocumentsSuccess",SET_LOCATIONS_SUCCESS:"setLocationsSuccess",REMOVE_LOCATIONS_SUCCESS:"removeLocationsSuccess",UNSET_LOCATIONS_SUCCESS:"unsetLocationsSuccess",DOCUMENT_SET_TRIGGERED:"documentSetTriggered",UNSET_DOCUMENTS_TRIGGERED:"unsetDocumentsTriggered",UNSET_DOCUMENTS_SUCCESS:"unsetDocumentsSuccess",DOCUMENTS_SET_TRIGGERED:"documentsSetTriggered",GET_DOCUMENT_METADATA_TRIGGERED:"getDocumentMetadataTriggered"},Reactions:{ENABLE_DARK_MODE_TRIGGERED:"enableDarkModeTriggered",DISABLE_DARK_MODE_TRIGGERED:"disableDarkModeTriggered",SET_CUSTOM_REACTIONS_TRIGGERED:"setCustomReactionsTriggered"},Views:{GET_UNIQUE_VIEWS_BY_USER_TRIGGERED:"getUniqueViewsByUserTriggered",GET_UNIQUE_VIEWS_BY_DATE_TRIGGERED:"getUniqueViewsByDateTriggered"},Notifications:{NOTIFICATION_HISTORY_PANEL_OPENED:"notificationHistoryPanelOpened",ENABLE_SETTINGS_AT_ORGANIZATION_LEVEL_TRIGGERED:"enableSettingsAtOrganizationLevelTriggered",DISABLE_SETTINGS_AT_ORGANIZATION_LEVEL_TRIGGERED:"disableSettingsAtOrganizationLevelTriggered",NOTIFICATION_HISTORY_PANEL_CLOSED:"notificationHistoryPanelClosed",NOTIFICATION_HISTORY_PANEL_TOGGLED:"notificationHistoryPanelToggled",NOTIFICATION_MARK_ALL_AS_READ_CLICKED:"notificationMarkAllAsReadClicked",NOTIFICATION_CLICKED:"notificationClicked",NOTIFICATION_TAB_CLICKED:"notificationTabClicked",NOTIFICATION_READ:"notificationRead",GET_NOTIFICATIONS_FOR_YOU$_TRIGGERED_INTERNAL:"getNotificationsForYou$Triggered_internal",GET_NOTIFICATIONS_BY_DOCUMENT_ID$_TRIGGERED_INTERNAL:"getNotificationsByDocumentId$Triggered_internal",GET_ALL_NOTIFICATIONS$_TRIGGERED_INTERNAL:"getAllNotifications$Triggered_internal",GET_NOTIFICATIONS$_TRIGGERED_INTERNAL:"getNotifications$Triggered_internal",OPEN_HISTORY_PANEL_TRIGGERED:"openHistoryPanelTriggered",CLOSE_HISTORY_PANEL_TRIGGERED:"closeHistoryPanelTriggered",TOGGLE_HISTORY_PANEL_TRIGGERED:"toggleHistoryPanelTriggered",GET_NOTIFICATIONS_DATA_TRIGGERED:"getNotificationsDataTriggered",SET_MAX_DAYS_TRIGGERED:"setMaxDaysTriggered",SET_TAB_CONFIG_TRIGGERED:"setTabConfigTriggered",ENABLE_READ_NOTIFICATIONS_ON_FOR_YOU_TAB_TRIGGERED:"enableReadNotificationsOnForYouTabTriggered",DISABLE_READ_NOTIFICATIONS_ON_FOR_YOU_TAB_TRIGGERED:"disableReadNotificationsOnForYouTabTriggered",SET_ALL_NOTIFICATIONS_AS_READ_TRIGGERED:"setAllNotificationsAsReadTriggered",GET_UNREAD_NOTIFICATIONS_COUNT_TRIGGERED:"getUnreadNotificationsCountTriggered",MARK_NOTIFICATION_AS_READ_BY_ID_TRIGGERED:"markNotificationAsReadByIdTriggered",SET_SETTINGS_TRIGGERED:"setSettingsTriggered",GET_SETTINGS_TRIGGERED:"getSettingsTriggered",MUTE_ALL_NOTIFICATIONS_TRIGGERED:"muteAllNotificationsTriggered",ENABLE_SETTINGS_TRIGGERED:"enableSettingsTriggered",ENABLE_SELF_NOTIFICATIONS_TRIGGERED:"enableSelfNotificationsTriggered",DISABLE_SELF_NOTIFICATIONS_TRIGGERED:"disableSelfNotificationsTriggered",ENABLE_USER_SCOPED_NOTIFICATIONS_TRIGGERED:"enableUserScopedNotificationsTriggered",DISABLE_USER_SCOPED_NOTIFICATIONS_TRIGGERED:"disableUserScopedNotificationsTriggered",DISABLE_SETTINGS_TRIGGERED:"disableSettingsTriggered",SET_SETTINGS_INITIAL_CONFIG_TRIGGERED:"setSettingsInitialConfigTriggered",OPEN_NOTIFICATIONS_PANEL_TRIGGERED:"openNotificationsPanelTriggered",CLOSE_NOTIFICATIONS_PANEL_TRIGGERED:"closeNotificationsPanelTriggered",ENABLE_CURRENT_DOCUMENT_ONLY_TRIGGERED:"enableCurrentDocumentOnlyTriggered",DISABLE_CURRENT_DOCUMENT_ONLY_TRIGGERED:"disableCurrentDocumentOnlyTriggered"},Crdt:{CRDT_DATA_UPDATED:"crdtDataUpdated"},Suggestions:{ENABLE_SUGGESTION_MODE_TRIGGERED:"suggestionsEnableSuggestionModeTriggered",DISABLE_SUGGESTION_MODE_TRIGGERED:"suggestionsDisableSuggestionModeTriggered",IS_SUGGESTION_MODE_ENABLED_TRIGGERED:"suggestionsIsSuggestionModeEnabledTriggered",IS_SUGGESTION_MODE_ENABLED_STREAM_TRIGGERED:"suggestionsIsSuggestionModeEnabledStreamTriggered",REGISTER_TARGET_TRIGGERED:"suggestionsRegisterTargetTriggered",UNREGISTER_TARGET_TRIGGERED:"suggestionsUnregisterTargetTriggered",START_SUGGESTION_TRIGGERED:"suggestionsStartSuggestionTriggered",COMMIT_SUGGESTION_TRIGGERED:"suggestionsCommitSuggestionTriggered",GET_SUGGESTIONS_TRIGGERED:"suggestionsGetSuggestionsTriggered",GET_SUGGESTIONS_STREAM_TRIGGERED:"suggestionsGetSuggestionsStreamTriggered",GET_PENDING_SUGGESTION_TRIGGERED:"suggestionsGetPendingSuggestionTriggered",GET_PENDING_SUGGESTION_STREAM_TRIGGERED:"suggestionsGetPendingSuggestionStreamTriggered",ON_TRIGGERED:"suggestionsOnTriggered"}};let n=e;return n})(),ZF=[Nt.Events.Rewriter.REWRITER_ENABLED];var eU=class{constructor(){this.attachmentId=Math.floor(1e5+Math.random()*9e5)}};var sDe={ANNOTATION_ADD:"comment_annotation.add",ANNOTATION_DELETE:"comment_annotation.delete",COMMENT_ADD:"comment.add",COMMENT_UPDATE:"comment.update",COMMENT_DELETE:"comment.delete",STATUS_CHANGE:"comment_annotation.status_change",PRIORITY_CHANGE:"comment_annotation.priority_change",ASSIGN:"comment_annotation.assign",ACCESS_MODE_CHANGE:"comment_annotation.access_mode_change",CUSTOM_LIST_CHANGE:"comment_annotation.custom_list_change",APPROVE:"comment_annotation.approve",ACCEPT:"comment.accept",REJECT:"comment.reject",SUGGESTION_ACCEPT:"comment_annotation.suggestion_accept",SUGGESTION_REJECT:"comment_annotation.suggestion_reject",REACTION_ADD:"comment.reaction_add",REACTION_DELETE:"comment.reaction_delete",SUBSCRIBE:"comment_annotation.subscribe",UNSUBSCRIBE:"comment_annotation.unsubscribe"},aDe={RECORDING_ADD:"recording.add",RECORDING_DELETE:"recording.delete"},cDe={REACTION_ADD:"reaction.add",REACTION_DELETE:"reaction.delete"},lDe={EDITOR_EDIT:"crdt.editor_edit"};var Ku=class{};var FD,cT=new Map,tU,lT=n=>n!=null?String(n):void 0,$7=n=>{if(n.url)try{let e=new URL(n.url);n.baseUrl===void 0&&(n.baseUrl=e.origin),n.path===void 0&&(n.path=e.pathname),n.queryParams===void 0&&(n.queryParams=e.search)}catch{}},fDe=n=>{tU=n},pDe=(n,e)=>{try{if(!n||typeof n!="object")return;let t=JSON.parse(JSON.stringify(n));$7(t);let r=lT(e);r?cT.set(r,t):FD=t}catch(t){M.catch("Error in setClientPageInfo: ",t)}},gDe=n=>{try{let e=lT(n);e?cT.delete(e):FD=void 0}catch(e){M.catch("Error in clearClientPageInfo: ",e)}},uT=n=>{try{let e=lT(n)??lT(tU?.());return e&&cT.has(e)?cT.get(e):FD}catch(e){M.catch("Error in getClientPageInfo: ",e);return}};var UD;try{UD=typeof Intl<"u"&&Intl.v8BreakIterator}catch{UD=!1}var nU=(()=>{class n{_platformId=Y(wo);isBrowser=this._platformId?AF(this._platformId):typeof document=="object"&&!!document;EDGE=this.isBrowser&&/(edge)/i.test(navigator.userAgent);TRIDENT=this.isBrowser&&/(msie|trident)/i.test(navigator.userAgent);BLINK=this.isBrowser&&!!(window.chrome||UD)&&typeof CSS<"u"&&!this.EDGE&&!this.TRIDENT;WEBKIT=this.isBrowser&&/AppleWebKit/i.test(navigator.userAgent)&&!this.BLINK&&!this.EDGE&&!this.TRIDENT;IOS=this.isBrowser&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!("MSStream"in window);FIREFOX=this.isBrowser&&/(firefox|minefield)/i.test(navigator.userAgent);ANDROID=this.isBrowser&&/android/i.test(navigator.userAgent)&&!this.TRIDENT;SAFARI=this.isBrowser&&/safari/i.test(navigator.userAgent)&&this.WEBKIT;constructor(){}static \u0275fac=function(r){return new(r||n)};static \u0275prov=Q({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function VD(n){return Array.isArray(n)?n:[n]}var rU=new Set,Sc,oU=(()=>{class n{_platform=Y(nU);_nonce=Y(Gu,{optional:!0});_matchMedia;constructor(){this._matchMedia=this._platform.isBrowser&&window.matchMedia?window.matchMedia.bind(window):z7}matchMedia(t){return(this._platform.WEBKIT||this._platform.BLINK)&&W7(t,this._nonce),this._matchMedia(t)}static \u0275fac=function(r){return new(r||n)};static \u0275prov=Q({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function W7(n,e){if(!rU.has(n))try{Sc||(Sc=document.createElement("style"),e&&Sc.setAttribute("nonce",e),Sc.setAttribute("type","text/css"),document.head.appendChild(Sc)),Sc.sheet&&(Sc.sheet.insertRule(`@media ${n} {body{ }}`,0),rU.add(n))}catch(t){console.error(t)}}function z7(n){return{matches:n==="all"||n==="",media:n,addListener:()=>{},removeListener:()=>{}}}var q7=(()=>{class n{_mediaMatcher=Y(oU);_zone=Y(Ae);_queries=new Map;_destroySubject=new Ct;constructor(){}ngOnDestroy(){this._destroySubject.next(),this._destroySubject.complete()}isMatched(t){return iU(VD(t)).some(i=>this._registerQuery(i).mql.matches)}observe(t){let i=iU(VD(t)).map(s=>this._registerQuery(s).observable),o=ja(i);return o=ls(o.pipe(gn(1)),o.pipe(Qv(1),Hm(0))),o.pipe(De(s=>{let a={matches:!1,breakpoints:{}};return s.forEach(({matches:c,query:l})=>{a.matches=a.matches||c,a.breakpoints[l]=c}),a}))}_registerQuery(t){if(this._queries.has(t))return this._queries.get(t);let r=this._mediaMatcher.matchMedia(t),o={observable:new fe(s=>{let a=c=>this._zone.run(()=>s.next(c));return r.addListener(a),()=>{r.removeListener(a)}}).pipe(Wa(r),De(({matches:s})=>({query:t,matches:s})),us(this._destroySubject)),mql:r};return this._queries.set(t,o),o}static \u0275fac=function(r){return new(r||n)};static \u0275prov=Q({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function iU(n){return n.map(e=>e.split(",")).reduce((e,t)=>e.concat(t)).map(e=>e.trim())}var Qf={XSmall:"(max-width: 599.98px)",Small:"(min-width: 600px) and (max-width: 959.98px)",Medium:"(min-width: 960px) and (max-width: 1279.98px)",Large:"(min-width: 1280px) and (max-width: 1919.98px)",XLarge:"(min-width: 1920px)",Handset:"(max-width: 599.98px) and (orientation: portrait), (max-width: 959.98px) and (orientation: landscape)",Tablet:"(min-width: 600px) and (max-width: 839.98px) and (orientation: portrait), (min-width: 960px) and (max-width: 1279.98px) and (orientation: landscape)",Web:"(min-width: 840px) and (orientation: portrait), (min-width: 1280px) and (orientation: landscape)",HandsetPortrait:"(max-width: 599.98px) and (orientation: portrait)",TabletPortrait:"(min-width: 600px) and (max-width: 839.98px) and (orientation: portrait)",WebPortrait:"(min-width: 840px) and (orientation: portrait)",HandsetLandscape:"(max-width: 959.98px) and (orientation: landscape)",TabletLandscape:"(min-width: 960px) and (max-width: 1279.98px) and (orientation: landscape)",WebLandscape:"(min-width: 1280px) and (orientation: landscape)"};var kr=(()=>{let e=class e{constructor(){try{this.userAgent=navigator.userAgent,this.browserName=this.getBrowserName(),this.browserVersion=this.getBrowserVersion(),this.deviceType=this.getDeviceType(),this.orientation=this.getOrientation(),this.osName=this.getOSName(),this.osVersion=this.getOSVersion(),this.screenWidth=this.getScreenWidth(),this.screenHeight=this.getScreenHeight()}catch{}}getBrowserName(){try{return(navigator.userAgent.indexOf("Opera")||navigator.userAgent.indexOf("OPR"))!=-1?"Opera":navigator.userAgent.indexOf("Chrome")!=-1?"Chrome":navigator.userAgent.indexOf("Safari")!=-1?"Safari":navigator.userAgent.indexOf("Firefox")!=-1?"Firefox":navigator.userAgent.indexOf("MSIE")!=-1||document?.documentMode?"IE":"Unknown"}catch{return"Unknown"}}getDeviceType(){try{return e.Breakpoints[Qf.Handset]?gr.MOBILE:e.Breakpoints[Qf.Tablet]?gr.TABLET:e.Breakpoints[Qf.XLarge]?gr.MONITOR:e.Breakpoints[Qf.Web]?gr.DESKTOP:gr.UNKNOWN}catch{return gr.UNKNOWN}}getOrientation(){try{return e.Orientations[tT.Portrait]?zu.PORTRAIT:e.Orientations[tT.Landscape]?zu.LANDSCAPE:zu.UNKNOWN}catch{return zu.UNKNOWN}}getOSName(){try{return navigator.userAgent.indexOf("Windows")!=-1?"Windows":navigator.userAgent.indexOf("Macintosh")!=-1?"Macintosh":navigator.userAgent.indexOf("Linux")!=-1?"Linux":"Unknown"}catch{return"Unknown"}}getOSVersion(){try{let s=navigator?.userAgent,a="Unknown";if(s.indexOf("Windows")!==-1)s.indexOf("Windows NT 5.1")!==-1?a="Windows XP":s.indexOf("Windows NT 6.0")!==-1?a="Windows Vista":s.indexOf("Windows NT 6.1")!==-1?a="Windows 7":s.indexOf("Windows NT 6.2")!==-1?a="Windows 8":s.indexOf("Windows NT 6.3")!==-1?a="Windows 8.1":s.indexOf("Windows NT 10.0")!==-1&&(a="Windows 10");else if(s.indexOf("Mac OS X")!==-1)a=s.match(/Mac OS X ([0-9_.]+)/)[1],a=a.replace(/_/g,".");else if(s.indexOf("iOS")!==-1)a=s.match(/OS ([0-9_.]+) like Mac OS X/)[1],a=a.replace(/_/g,".");else if(s.indexOf("Firefox")!==-1){var r=/\(([^)]+)\)/,i=r.exec(s)[1],o=i.split("; ");a=o[2]}return a||"Unknown"}catch{return"Unknown"}}getBrowserVersion(){try{return this.browserName=="Opera"?this.getOperaVersion():this.browserName=="Chrome"?this.getChromeVersion():this.browserName=="Safari"?this.getSafariVersion():this.browserName=="Firefox"?this.getFirefoxVersion():this.browserName=="IE"?this.getIEVersion():"Unknown"}catch{return"Unknown"}}getOperaVersion(){try{var r=navigator.userAgent.match(/(?:Opera|OPR)\/(\d+)/);return r?r[1]:"Unknown"}catch{return"Unknown"}}getChromeVersion(){try{var r=navigator.userAgent.match(/(?:Chrome|Chromium)\/(\d+)/);return r?r[1]:"Unknown"}catch{return"Unknown"}}getSafariVersion(){try{var r=navigator.userAgent.match(/Version\/(\d+)/);return r?r[1]:"Unknown"}catch{return"Unknown"}}getFirefoxVersion(){try{var r=navigator.userAgent.match(/Firefox\/(\d+)/);return r?r[1]:"Unknown"}catch{return"Unknown"}}getIEVersion(){try{var r=navigator.userAgent.match(/MSIE (\d+)/);return r?r[1]:"Unknown"}catch{return"Unknown"}}getScreenWidth(){try{return window.screen.width}catch{return 0}}getScreenHeight(){try{return window.screen.height}catch{return 0}}getDeviceInfo(){try{return this.userAgent=navigator.userAgent,this.browserName=this.getBrowserName(),this.browserVersion=this.getBrowserVersion(),this.deviceType=this.getDeviceType(),this.orientation=this.getOrientation(),this.osName=this.getOSName(),this.osVersion=this.getOSVersion(),this.screenWidth=this.getScreenWidth(),this.screenHeight=this.getScreenHeight(),JSON.parse(JSON.stringify(this))}catch{return{browserName:"Unknown",browserVersion:"Unknown",deviceType:"Unknown",osName:"Unknown",osVersion:"Unknown",screenWidth:0,screenHeight:0,userAgent:"Unknown"}}}};e.Breakpoints={},e.Orientations={};let n=e;return n})();var mt=class{constructor(e=!0){this.deviceInfo=new kr().getDeviceInfo();try{if(e){let t=uT();t&&Object.assign(this,t)}}catch{}}};var sU=class{constructor(){this.targetElements=[],this.type="area",this.props=new Ku,this.pageInfo=new mt,this.targetAnnotations=[]}};var aU=class{constructor(){this.type="arrow",this.props=new Ku,this.pageInfo=new mt}};var $De={COPY_LINK:"copy-link",DELETE:"delete"},WDe={COPY_LINK:"Copy link",LINK_COPIED:"Link copied!",DELETE_THREAD:"Delete thread"};var cU=class{constructor(){this.comments=[],this.commentCategories=[],this.type="comment",this.status=F.CommentAnnotationStatusMap.OPEN,this.pageInfo=new mt,this.iam=new BD,this.customList=[],this.subscribedUsers={},this.unsubscribedUsers={},this.subscribedGroups={}}};var BD=class{constructor(){this.accessMode=nT.PUBLIC}};var lU=class{constructor(){this.commentId=Math.floor(1e5+Math.random()*9e5),this.type="text",this.to=[],this.status="added",this.attachments=[],this.recorders=[],this.reactionAnnotationIds=[],this.taggedUserContacts=[],this.customList=[],this.toOrganizationUserGroup=[],this.reactionAnnotations=[]}};var dT=class{constructor(){this.urlAllowList=[],this.featureAllowList=[],this.userPlanAllowList=[],this.userIdAllowList=[],this.userGroupIdAllowList=[],this.debugMode=!1,this.usePrefersColorScheme=!1,this.advancedQueriesDisabled=!1,this.globalStyles=!0}},uU=["core","rest-api","recorder-media","ai","agents","huddle-webrtc","integrations-workflow","superflow","billing-stripe","migrations","legacy-v1","velt-internal"];var GD=(function(n){return n.RESOLVE_USERS="resolveUsers",n.FORMAT_RESPONSE="formatResponse",n.MERGE_USER_WITH_PROVIDED_USER_DATA="mergeUserWithProvidedUserData",n.GET_TEMPORARY_USERS="getTemporaryUsers",n.SET_SINGLE_EDITOR_MODE_LIVE_STATE_DATA_FOR_DIFFERENT_USER_PRESENT_ON_TAB="setSingleEditorModeLiveStateDataForDifferentUserPresentOnTab",n.RESOLVE_AND_MERGE_SINGLE_EDITOR_LIVE_STATE_DATA_WITH_USER="resolveAndMergeSingleEditorLiveStateDataWithUser",n.GET_SINGLE_EDITOR_MODE_DATA="getSingleEditorModeData",n.RESOLVE_USERS_FROM_HUDDLE_MESSAGES="resolveUsersFromHuddleMessages",n.RESOLVE_USER_IDS_BY_EMAIL="resolveUserIdsByEmail",n})(GD||{}),hT=(function(n){return n.IDENTIFY="identify/authProvider",n.GET_TEMPORARY_USERS="getTemporaryUsers",n.GET_USERS="getUsers",n.GET_HUDDLE_USERS="getHuddleUsers",n.GET_SINGLE_EDITOR_USERS="getSingleEditorUsers",n})(hT||{}),K7=(function(n){return n.RESOLVE_COMMENT_ANNOTATIONS="resolveCommentAnnotations",n.SAVE_COMMENT_ANNOTATION="saveCommentAnnotation",n.DELETE_COMMENT_ANNOTATION="deleteCommentAnnotation",n.FORMAT_RESPONSE="formatResponse",n.INIT_DOCUMENTS="initDocuments",n.SET_DATA="setData",n.UPDATE_DATA="updateData",n.DELETE_DATA="deleteData",n})(K7||{}),Y7=(function(n){return n.SAVE_ATTACHMENT="saveAttachment",n.DELETE_ATTACHMENT="deleteAttachment",n.UPLOAD_TO_RESOLVER="uploadToResolver",n})(Y7||{}),X7=(function(n){return n.RESOLVE_REACTION_ANNOTATIONS="resolveReactionAnnotations",n.SAVE_REACTION_ANNOTATION="saveReactionAnnotation",n.DELETE_REACTION_ANNOTATION="deleteReactionAnnotation",n.FORMAT_RESPONSE="formatResponse",n.INIT_DOCUMENTS="initDocuments",n.SET_DATA="setData",n.UPDATE_DATA="updateData",n.DELETE_DATA="deleteData",n})(X7||{}),dU;dU||(dU={});var Q7=(function(n){return n.SET_DOCUMENTS="setDocuments",n.GET_COMMENT_ANNOTATIONS="getCommentAnnotations",n.GET_NOTIFICATIONS="getNotifications",n})(Q7||{}),hU;hU||(hU={});var J7=(function(n){return n.SET_DOCUMENTS="setDocuments",n.GET_REACTION_ANNOTATIONS="getReactionAnnotations",n})(J7||{}),Z7=(function(n){return n.RESOLVE_RECORDER_ANNOTATIONS="resolveRecorderAnnotations",n.SAVE_RECORDER_ANNOTATION="saveRecorderAnnotation",n.DELETE_RECORDER_ANNOTATION="deleteRecorderAnnotation",n.FORMAT_RESPONSE="formatResponse",n.INIT_DOCUMENTS="initDocuments",n.SET_DATA="setData",n.UPDATE_DATA="updateData",n.DELETE_DATA="deleteData",n})(Z7||{}),eX=(function(n){return n.GET_RECORDER_ANNOTATIONS="getRecorderAnnotations",n})(eX||{}),tX=(function(n){return n.RESOLVE_NOTIFICATIONS="resolveNotifications",n.DELETE_NOTIFICATION="deleteNotification",n.DELETE_DATA="deleteData",n.FORMAT_RESPONSE="formatResponse",n})(tX||{}),nX=(function(n){return n.GET_NOTIFICATIONS="getNotifications",n})(nX||{}),rX=(function(n){return n.RESOLVE_ACTIVITIES="resolveActivities",n.SAVE_ACTIVITY="saveActivity",n.FORMAT_RESPONSE="formatResponse",n})(rX||{}),iX=(function(n){return n.GET_ACTIVITIES="getActivities",n})(iX||{}),oX=(function(n){return n.SET_DOCUMENTS="setDocuments",n.SET_ROOT_DOCUMENT="setRootDocument",n.SET_DOCUMENT_ID="setDocumentId",n.UNSET_DOCUMENT_ID="unsetDocumentId",n.UNSET_DOCUMENTS="unsetDocuments",n.SET_LOCATION="setLocation",n.SET_LOCATIONS="setLocations",n.SET_ROOT_LOCATION="setRootLocation",n.ADD_LOCATION="addLocation",n.REMOVE_LOCATION="removeLocation",n.REMOVE_LOCATIONS="removeLocations",n.UNSET_LOCATION_IDS="unsetLocationIds",n.REMOVE_LOCATIONS_SUCCESS="removeLocationsSuccess",n})(oX||{});var fU=class{constructor(){this.pageInfo=new mt}};var pU=class{constructor(){this.documentAccessType=bn.PUBLIC,this.accessType=bn.PUBLIC,this.disabled=!1,this.features={},this.users={}}};var gU=class{};var mU=class{};var EU=class{};var $i=class{constructor(){this.contacts=[]}};var mRe={DOCUMENT_UNSET:"document_unset",USER_LOGOUT:"user_logout"},fT={SET_DOCUMENTS:"setDocuments",IDENTIFY:"identify",GET_NOTIFICATIONS:"getNotifications",SET_NOTIFICATIONS:"setNotifications",REVOKE_ACCESS_ON_USER_LOGOUT:"revokeAccessOnUserLogout",REVOKE_ACCESS_ON_DOCUMENT_UNSET:"revokeAccessOnDocumentUnset"},_U={FOLDER:"folder",DOCUMENT:"document",ORGANIZATION:"organization",CONTEXT:"context"};var TU=class{constructor(){this.id=Math.floor(1e5+Math.random()*9e5)}};var IU=class{constructor(){this.singleTabEditor=!0}};var yU=class{constructor(){this.state="idle"}};var Ac=class{};var vU=class{};var SU=class{constructor(){this.type="multiThread"}};var AU=class{constructor(){this.pageInfo=new mt}};var CU=class{constructor(){this.type="audio"}},DU=class{constructor(){this.type="audio"}},RU=class{constructor(){this.getThumbnailTag=e=>`
|
|
120
|
+
<a href="${this.videoPlayerUrl}" target="_blank">
|
|
121
|
+
<img src="${e||this.thumbnailWithPlayIconUrl||this.thumbnailUrl}" />
|
|
122
|
+
</a>
|
|
123
|
+
`}};var NU=class{constructor(){this.type="recorder",this.recordingType="audio",this.mode="floating",this.attachment=null,this.attachments=[],this.pageInfo=new mt}};var wU=class{constructor(){this.type="rewriter",this.rewriterType="copywriter",this.pageInfo=new mt}};var Jf=class{constructor(){this.screenWidth=0,this.screenHeight=0,this.screenScrollHeight=0}};var bU=class{constructor(){this.pageInfo=new mt}},JRe={Start:"start",End:"end"},ZRe={Avatar:"avatar",Label:"label"};var OU=class{constructor(){this.sources=[],this.playerState=new jD}},jD=class{constructor(){this.volume=1}};var MU=class{constructor(){this.to=[],this.resolved=!1,this.type="tag",this.pageInfo=new mt}};var LU=class{constructor(){this.visibility="private"}};var xU=class{constructor(){this.reactions=[],this.type="reaction",this.pageInfo=new mt,this.isReactionResolverUsed=!1}};var kU=class{};var MNe={EDITOR:"editor",VIEWER:"viewer"},LNe={DOES_NOT_EXIST:"does_not_exist",PERMISSION_DENIED:"permission_denied",SOMETHING_WENT_WRONG:"something_went_wrong"};var sX=(function(n){return n.INTERNAL="internal",n.EXTERNAL="external",n})(sX||{}),aX=(function(n){return n.UPDATE_DATA="updateData",n})(aX||{});var En=class n{constructor(){this._dataLength=0,this._bufferLength=0,this._state=new Int32Array(4),this._buffer=new ArrayBuffer(68),this._buffer8=new Uint8Array(this._buffer,0,68),this._buffer32=new Uint32Array(this._buffer,0,17),this.start()}static hashStr(e,t=!1){return this.onePassHasher.start().appendStr(e).end(t)}static hashAsciiStr(e,t=!1){return this.onePassHasher.start().appendAsciiStr(e).end(t)}static _hex(e){let t=n.hexChars,r=n.hexOut,i,o,s,a;for(a=0;a<4;a+=1)for(o=a*8,i=e[a],s=0;s<8;s+=2)r[o+1+s]=t.charAt(i&15),i>>>=4,r[o+0+s]=t.charAt(i&15),i>>>=4;return r.join("")}static _md5cycle(e,t){let r=e[0],i=e[1],o=e[2],s=e[3];r+=(i&o|~i&s)+t[0]-680876936|0,r=(r<<7|r>>>25)+i|0,s+=(r&i|~r&o)+t[1]-389564586|0,s=(s<<12|s>>>20)+r|0,o+=(s&r|~s&i)+t[2]+606105819|0,o=(o<<17|o>>>15)+s|0,i+=(o&s|~o&r)+t[3]-1044525330|0,i=(i<<22|i>>>10)+o|0,r+=(i&o|~i&s)+t[4]-176418897|0,r=(r<<7|r>>>25)+i|0,s+=(r&i|~r&o)+t[5]+1200080426|0,s=(s<<12|s>>>20)+r|0,o+=(s&r|~s&i)+t[6]-1473231341|0,o=(o<<17|o>>>15)+s|0,i+=(o&s|~o&r)+t[7]-45705983|0,i=(i<<22|i>>>10)+o|0,r+=(i&o|~i&s)+t[8]+1770035416|0,r=(r<<7|r>>>25)+i|0,s+=(r&i|~r&o)+t[9]-1958414417|0,s=(s<<12|s>>>20)+r|0,o+=(s&r|~s&i)+t[10]-42063|0,o=(o<<17|o>>>15)+s|0,i+=(o&s|~o&r)+t[11]-1990404162|0,i=(i<<22|i>>>10)+o|0,r+=(i&o|~i&s)+t[12]+1804603682|0,r=(r<<7|r>>>25)+i|0,s+=(r&i|~r&o)+t[13]-40341101|0,s=(s<<12|s>>>20)+r|0,o+=(s&r|~s&i)+t[14]-1502002290|0,o=(o<<17|o>>>15)+s|0,i+=(o&s|~o&r)+t[15]+1236535329|0,i=(i<<22|i>>>10)+o|0,r+=(i&s|o&~s)+t[1]-165796510|0,r=(r<<5|r>>>27)+i|0,s+=(r&o|i&~o)+t[6]-1069501632|0,s=(s<<9|s>>>23)+r|0,o+=(s&i|r&~i)+t[11]+643717713|0,o=(o<<14|o>>>18)+s|0,i+=(o&r|s&~r)+t[0]-373897302|0,i=(i<<20|i>>>12)+o|0,r+=(i&s|o&~s)+t[5]-701558691|0,r=(r<<5|r>>>27)+i|0,s+=(r&o|i&~o)+t[10]+38016083|0,s=(s<<9|s>>>23)+r|0,o+=(s&i|r&~i)+t[15]-660478335|0,o=(o<<14|o>>>18)+s|0,i+=(o&r|s&~r)+t[4]-405537848|0,i=(i<<20|i>>>12)+o|0,r+=(i&s|o&~s)+t[9]+568446438|0,r=(r<<5|r>>>27)+i|0,s+=(r&o|i&~o)+t[14]-1019803690|0,s=(s<<9|s>>>23)+r|0,o+=(s&i|r&~i)+t[3]-187363961|0,o=(o<<14|o>>>18)+s|0,i+=(o&r|s&~r)+t[8]+1163531501|0,i=(i<<20|i>>>12)+o|0,r+=(i&s|o&~s)+t[13]-1444681467|0,r=(r<<5|r>>>27)+i|0,s+=(r&o|i&~o)+t[2]-51403784|0,s=(s<<9|s>>>23)+r|0,o+=(s&i|r&~i)+t[7]+1735328473|0,o=(o<<14|o>>>18)+s|0,i+=(o&r|s&~r)+t[12]-1926607734|0,i=(i<<20|i>>>12)+o|0,r+=(i^o^s)+t[5]-378558|0,r=(r<<4|r>>>28)+i|0,s+=(r^i^o)+t[8]-2022574463|0,s=(s<<11|s>>>21)+r|0,o+=(s^r^i)+t[11]+1839030562|0,o=(o<<16|o>>>16)+s|0,i+=(o^s^r)+t[14]-35309556|0,i=(i<<23|i>>>9)+o|0,r+=(i^o^s)+t[1]-1530992060|0,r=(r<<4|r>>>28)+i|0,s+=(r^i^o)+t[4]+1272893353|0,s=(s<<11|s>>>21)+r|0,o+=(s^r^i)+t[7]-155497632|0,o=(o<<16|o>>>16)+s|0,i+=(o^s^r)+t[10]-1094730640|0,i=(i<<23|i>>>9)+o|0,r+=(i^o^s)+t[13]+681279174|0,r=(r<<4|r>>>28)+i|0,s+=(r^i^o)+t[0]-358537222|0,s=(s<<11|s>>>21)+r|0,o+=(s^r^i)+t[3]-722521979|0,o=(o<<16|o>>>16)+s|0,i+=(o^s^r)+t[6]+76029189|0,i=(i<<23|i>>>9)+o|0,r+=(i^o^s)+t[9]-640364487|0,r=(r<<4|r>>>28)+i|0,s+=(r^i^o)+t[12]-421815835|0,s=(s<<11|s>>>21)+r|0,o+=(s^r^i)+t[15]+530742520|0,o=(o<<16|o>>>16)+s|0,i+=(o^s^r)+t[2]-995338651|0,i=(i<<23|i>>>9)+o|0,r+=(o^(i|~s))+t[0]-198630844|0,r=(r<<6|r>>>26)+i|0,s+=(i^(r|~o))+t[7]+1126891415|0,s=(s<<10|s>>>22)+r|0,o+=(r^(s|~i))+t[14]-1416354905|0,o=(o<<15|o>>>17)+s|0,i+=(s^(o|~r))+t[5]-57434055|0,i=(i<<21|i>>>11)+o|0,r+=(o^(i|~s))+t[12]+1700485571|0,r=(r<<6|r>>>26)+i|0,s+=(i^(r|~o))+t[3]-1894986606|0,s=(s<<10|s>>>22)+r|0,o+=(r^(s|~i))+t[10]-1051523|0,o=(o<<15|o>>>17)+s|0,i+=(s^(o|~r))+t[1]-2054922799|0,i=(i<<21|i>>>11)+o|0,r+=(o^(i|~s))+t[8]+1873313359|0,r=(r<<6|r>>>26)+i|0,s+=(i^(r|~o))+t[15]-30611744|0,s=(s<<10|s>>>22)+r|0,o+=(r^(s|~i))+t[6]-1560198380|0,o=(o<<15|o>>>17)+s|0,i+=(s^(o|~r))+t[13]+1309151649|0,i=(i<<21|i>>>11)+o|0,r+=(o^(i|~s))+t[4]-145523070|0,r=(r<<6|r>>>26)+i|0,s+=(i^(r|~o))+t[11]-1120210379|0,s=(s<<10|s>>>22)+r|0,o+=(r^(s|~i))+t[2]+718787259|0,o=(o<<15|o>>>17)+s|0,i+=(s^(o|~r))+t[9]-343485551|0,i=(i<<21|i>>>11)+o|0,e[0]=r+e[0]|0,e[1]=i+e[1]|0,e[2]=o+e[2]|0,e[3]=s+e[3]|0}start(){return this._dataLength=0,this._bufferLength=0,this._state.set(n.stateIdentity),this}appendStr(e){let t=this._buffer8,r=this._buffer32,i=this._bufferLength,o,s;for(s=0;s<e.length;s+=1){if(o=e.charCodeAt(s),o<128)t[i++]=o;else if(o<2048)t[i++]=(o>>>6)+192,t[i++]=o&63|128;else if(o<55296||o>56319)t[i++]=(o>>>12)+224,t[i++]=o>>>6&63|128,t[i++]=o&63|128;else{if(o=(o-55296)*1024+(e.charCodeAt(++s)-56320)+65536,o>1114111)throw new Error("Unicode standard supports code points up to U+10FFFF");t[i++]=(o>>>18)+240,t[i++]=o>>>12&63|128,t[i++]=o>>>6&63|128,t[i++]=o&63|128}i>=64&&(this._dataLength+=64,n._md5cycle(this._state,r),i-=64,r[0]=r[16])}return this._bufferLength=i,this}appendAsciiStr(e){let t=this._buffer8,r=this._buffer32,i=this._bufferLength,o,s=0;for(;;){for(o=Math.min(e.length-s,64-i);o--;)t[i++]=e.charCodeAt(s++);if(i<64)break;this._dataLength+=64,n._md5cycle(this._state,r),i=0}return this._bufferLength=i,this}appendByteArray(e){let t=this._buffer8,r=this._buffer32,i=this._bufferLength,o,s=0;for(;;){for(o=Math.min(e.length-s,64-i);o--;)t[i++]=e[s++];if(i<64)break;this._dataLength+=64,n._md5cycle(this._state,r),i=0}return this._bufferLength=i,this}getState(){let e=this._state;return{buffer:String.fromCharCode.apply(null,Array.from(this._buffer8)),buflen:this._bufferLength,length:this._dataLength,state:[e[0],e[1],e[2],e[3]]}}setState(e){let t=e.buffer,r=e.state,i=this._state,o;for(this._dataLength=e.length,this._bufferLength=e.buflen,i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3],o=0;o<t.length;o+=1)this._buffer8[o]=t.charCodeAt(o)}end(e=!1){let t=this._bufferLength,r=this._buffer8,i=this._buffer32,o=(t>>2)+1;this._dataLength+=t;let s=this._dataLength*8;if(r[t]=128,r[t+1]=r[t+2]=r[t+3]=0,i.set(n.buffer32Identity.subarray(o),o),t>55&&(n._md5cycle(this._state,i),i.set(n.buffer32Identity)),s<=4294967295)i[14]=s;else{let a=s.toString(16).match(/(.*?)(.{0,8})$/);if(a===null)return;let c=parseInt(a[2],16),l=parseInt(a[1],16)||0;i[14]=c,i[15]=l}return n._md5cycle(this._state,i),e?this._state:n._hex(this._state)}};En.stateIdentity=new Int32Array([1732584193,-271733879,-1732584194,271733878]);En.buffer32Identity=new Int32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);En.hexChars="0123456789abcdef";En.hexOut=[];En.onePassHasher=new En;if(En.hashStr("hello")!=="5d41402abc4b2a76b9719d911017c592")throw new Error("Md5 self test failed.");var FU=["annotationId","annotationNumber","visibilityConfig","actions","comments","commentCategories","from","color","resolved","inProgress","lastUpdated","createdAt","positionX","positionY","screenWidth","screenHeight","screenScrollHeight","screenScrollTop","taggedElementPath","taggedElementRect","targetElement","targetElementId","position","documentParamsId","documentParams","locationId","location","type","commentType","sourceType","metadata","targetTextRange","selectAllContent","approved","status","statusUpdatedByUserId","annotationIndex","pageInfo","assignedTo","priority","ghostComment","areaAnnotationId","context","contextId","iam","isPageAnnotation","targetInlineCommentElementId","inlineCommentSectionConfig","customList","subscribedUsers","unsubscribedUsers","subscribedGroups","resolvedByUserId","resolvedByUser","multiThreadAnnotationId","isDraft","sourceId","views","viewedByUserIds","viewedBy","unread","suggestion","agent","involvedUserIds","mentionedUserIds"];var UU=["commentId","context","type","isCommentTextAvailable","isCommentResolverUsed","replaceContentHtml","replaceContentText","commentVoiceUrl","from","to","lastUpdated","createdAt","status","attachments","recorders","reactionAnnotationIds","taggedUserContacts","customList","toOrganizationUserGroup","isDraft","editedAt","isEdited","reactionAnnotations","sourceType","agent","metadata","actions","progress"];var VU=["annotationId","context","commentAnnotationId","reactions","lastUpdated","targetElement","targetElementId","position","locationId","location","type","annotationIndex","pageInfo","from","isReactionResolverUsed","iconUrl","iconEmoji","metadata","involvedUserIds"];var BU=["context","annotationId","commentAnnotationId","from","color","lastUpdated","positionX","positionY","screenWidth","screenHeight","screenScrollHeight","screenScrollTop","recorderedElementPath","recorderedElementRect","targetElement","position","locationId","location","type","recordingType","mode","approved","attachment","attachments","annotationIndex","pageInfo","recordedTime","waveformData","displayName","metadata","latestVersion","recordingEditVersions","chunkUrls","isRecorderResolverUsed","isUrlAvailable"];var Fbe=["id","featureType","actionType","eventType","actionUser","timestamp","metadata","targetEntityId","targetSubEntityId","changes","entityData","entityTargetData","displayMessageTemplate","displayMessageTemplateData","displayMessage","actionIcon","immutable","isActivityResolverUsed"];var GU=["userId"];var jU=["commonAncestorContainer","commonAncestorContainerFXpath","commonAncestorContainerCFXpath","commonAncestorContainerAnchor","occurrence"],HU=["attachmentId","isAttachmentResolverUsed","name","bucketPath","size","type","url","thumbnail","thumbnailWithPlayIconUrl","metadata","mimeType","previewImages"],$U=["attachmentId","isAttachmentResolverUsed","bucketPath","size","type","thumbnail","thumbnailWithPlayIconUrl","metadata","mimeType","previewImages"];var WU=["id","tag","type","thumbnailUrl","thumbnailWithPlayIconUrl","videoUrl","audioUrl","videoPlayerUrl","chunkUrls"];var Rc="velt://self-hosted-disabled/",Nc=n=>typeof n=="string"&&n.startsWith(Rc),iV=(n,e)=>{try{if(Nc(n))return n;let t=new URL(n),r=t.hostname.split("."),i=r.length>=3?r[0]:"",o=n.replace(t.host,e);if(i){let s=o.includes("?")?"&":"?";o+=`${s}ns=${i}`}return o}catch(t){return M.catch("Error in getProxiedDatabaseUrl: ",t),n}},Kbe=n=>{try{let e=localStorage.getItem(F.LOCAL_STORAGE.VELT_AUTH_PROXY_HOST);if(!e)return;let t=atob(e),r=n?.config;t&&r&&(r.apiHost=t,r.tokenApiHost=t)}catch(e){M.catch("Error in applyCachedAuthProxyHost: ",e)}},Dc=(n,e=0)=>{try{let t=3735928559^e,r=1103547991^e;for(let i=0,o;i<n.length;i++)o=n.charCodeAt(i),t=Math.imul(t^o,2654435761),r=Math.imul(r^o,1597334677);return t=Math.imul(t^t>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507)^Math.imul(t^t>>>13,3266489909),4294967296*(2097151&r)+(t>>>0)}catch(t){return M.catch("Error in cyrb53: ",t),0}},cX=()=>{try{return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,n=>(+n^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+n/4).toString(16))}catch(n){return M.catch("Error in uuidv4: ",n),""}},xo=n=>{try{return En.hashStr(n)}catch(e){return M.catch("Error in hashStr: ",e),n}},oV=n=>{try{return!n||n.trim().length===0?void 0:En.hashStr(n)}catch(e){M.catch("Error in hashForAnchor: ",e);return}},Ybe=n=>Dc(n).toString(),Xbe=n=>xo(n),sV=n=>xo(n).toString(),Qbe=n=>xo(n).toString(),Jbe=(n,e)=>{try{let t=n.userIds?.length?[...n.userIds]:[];return t.includes(e)||t.push(e),ye($({},n),{userIds:t})}catch(t){return M.catch("Error in ensureUserIdInVisibility: ",t),n}},Zbe=n=>{try{if(!n)return!1;if(n.iam?.accessMode===nT.PRIVATE)return!0;let e=n.visibilityConfig?.type;return e==="restricted"||e==="organizationPrivate"}catch(e){return M.catch("Error in isAnnotationPrivate: ",e),!1}},eOe=(n,e)=>{let t=[];switch(n.type){case"public":return t.push(F.DEFAULT_VELT_CONTEXT),t;case"organizationPrivate":{let r=[...n.organizationId?[n.organizationId]:[],...n.organizationIds??[]].filter((i,o,s)=>!!i&&s.indexOf(i)===o);if(!r.length)throw new Error("organizationId is required for organizationPrivate visibility type");r.forEach(i=>{let o=sV(i);t.push(`${F.VISIBILITY_ORG_PREFIX}${o}`)});break}case"restricted":{if(!n.userIds?.length)throw new Error("userIds is required for restricted visibility type");n.userIds.filter((i,o,s)=>!!i&&s.indexOf(i)===o).forEach(i=>{let o=xo(i).toString();t.push(`${F.VISIBILITY_SELF_PREFIX}${o}`)});break}default:throw new Error(`Invalid visibility type: ${n.type}`)}if(e){let r=`${F.VISIBILITY_SELF_PREFIX}${xo(e).toString()}`;t.includes(r)||t.push(r)}return t},tOe=(n,e)=>{let t={type:n.type};try{if(n.type==="public")return t;n.organizationId&&(t.organizationId=n.organizationId),n.organizationIds?.length&&(t.organizationIds=n.organizationIds);let r=[...n.userIds??[],...e?[e]:[]].filter((i,o,s)=>!!i&&s.indexOf(i)===o);r.length&&(t.userIds=r)}catch(r){M.catch("Error in buildStoredVisibilityConfig: ",r)}return t},nOe=n=>{let e=[F.DEFAULT_VELT_CONTEXT];try{n?.userId&&e.push(`${F.VISIBILITY_SELF_PREFIX}${xo(n.userId).toString()}`),n?.clientOrganizationId?e.push(`${F.VISIBILITY_ORG_PREFIX}${sV(n.clientOrganizationId)}`):n?.fallbackServerOrganizationId&&e.push(`${F.VISIBILITY_ORG_PREFIX}${n.fallbackServerOrganizationId}`)}catch(t){M.catch("Error in buildViewerVisibilityTokens: ",t)}return e},rOe=(n,e)=>{try{if(!n?.length)return n??[];let t=new Set(e?.tokens??[]);return n.filter(r=>{try{let i=r?.context?.accessFields,o=cV(i),s=r?.visibilityConfig?.type,a=s==="organizationPrivate"||s==="restricted",c=o.length>0&&!i?.includes(F.DEFAULT_VELT_CONTEXT);return!!(!a&&!c||!i?.length||e?.userId&&r?.from?.userId===e.userId||o.some(l=>t.has(l))||e?.userId&&r?.visibilityConfig?.userIds?.includes(e.userId))}catch(i){return M.catch("Error filtering annotation visibility: ",i),!0}})}catch(t){return M.catch("Error in filterAnnotationsVisibleToUser: ",t),n}},aV=n=>{try{return typeof n=="string"&&(n.startsWith(F.VISIBILITY_SELF_PREFIX)||n.startsWith(F.VISIBILITY_ORG_PREFIX))}catch(e){return M.catch("Error in isVisibilityAccessToken: ",e),!1}},cV=n=>{try{return(n||[]).filter(e=>aV(e))}catch(e){return M.catch("Error in extractVisibilityAccessTokens: ",e),[]}},iOe=n=>{try{return!!n&&typeof n=="object"&&Object.keys(n).some(e=>!(e==="default"&&n[e]==="velt"))}catch(e){return M.catch("Error in isCustomerContextAccess: ",e),!1}},oOe=(n,e)=>{try{let t=Array.isArray(e)?e:[],r=t.length>0&&!t.includes(F.DEFAULT_VELT_CONTEXT),i=n;if(r&&n?.access&&typeof n.access=="object"&&n.access.default==="velt"){let s=$({},n.access);delete s.default,i=ye($({},n),{access:s})}let o=LX(i);return r&&(o=o.filter(s=>s!==F.DEFAULT_VELT_CONTEXT)),r?[...new Set([...t,...o])]:o}catch(t){return M.catch("Error in mergeAccessFieldTokenFamilies: ",t),Array.isArray(e)?e:[]}},lX=n=>{try{if(!n)return null;let e=n?.context?.accessFields??[];if(!e?.length)return null;let t=cV(e),r=n?.visibilityConfig?.type,i=r==="restricted"||r==="organizationPrivate",o=t.length>0&&!e.includes(F.DEFAULT_VELT_CONTEXT);if(!i&&!o)return null;let s=t.some(h=>h.startsWith(F.VISIBILITY_ORG_PREFIX)),c={type:i?r:s?"organizationPrivate":"restricted",accessTokens:t},l=n?.visibilityConfig?.userIds;l?.length&&(c.userIds=[...l]);let d=[...n?.visibilityConfig?.organizationId?[n.visibilityConfig.organizationId]:[],...n?.visibilityConfig?.organizationIds??[]].filter((h,f,g)=>!!h&&g.indexOf(h)===f);return d.length&&(c.organizationIds=d),c}catch(e){M.catch("Error in buildNotificationVisibilityStamp: ",e);try{let t=n?.visibilityConfig?.type;if(t==="restricted"||t==="organizationPrivate")return{type:t,accessTokens:[]}}catch{}return null}},sOe=(n,e)=>{try{if(!e?.length)return[];let t=lX(n);if(!t||t.type!=="restricted")return[];let r=new Set([...t.userIds??[],...n?.from?.userId?[n.from.userId]:[]]),i=new Set(t.accessTokens??[]);return e.filter(o=>!o||r.has(o)?!1:!i.has(`${F.VISIBILITY_SELF_PREFIX}${xo(o).toString()}`))}catch(t){return M.catch("Error in getVisibilityDeniedUserIds: ",t),[]}},aOe=(n,e)=>{try{if(!n?.length)return n??[];let t=new Set([F.DEFAULT_VELT_CONTEXT,...e||[]]);return n.filter(r=>{try{let i=r?.context?.accessFields;if(!i?.length)return!0;let o=i.filter(s=>!aV(s));return o.length?o.some(s=>t.has(s)):!0}catch(i){return M.catch("Error filtering annotation doc-context match: ",i),!0}})}catch(t){return M.catch("Error in filterAnnotationsMatchingDocContext: ",t),n}},cOe=(n,e)=>{try{if(!n?.length)return n??[];let t=e?.statusIds?.filter(a=>a!=null),r=e?.locationIds?.filter(a=>a!=null),i=t?.length?new Set(t):null,o=r?.length?new Set(r):null,s=e?.veltFolderId||null;return!i&&!o&&!s?n:n.filter(a=>{try{return!(i&&!i.has(a?.status?.id)||s&&a?.metadata?.veltFolderId!==s||o&&!o.has(a?.location?.id))}catch(c){return M.catch("Error filtering annotation query scope: ",c),!0}})}catch(t){return M.catch("Error in filterAnnotationsMatchingQueryScope: ",t),n}},lOe=n=>{try{if(n)return typeof n=="string"?En.hashStr(n):Array.isArray(n)?En.hashStr(n.join("-")):"";{let e=cX();return En.hashStr(e)}}catch(e){return M.catch("Error in getMultiThreadAnnotationId: ",e),""}},lV=(n,e,t)=>{try{if(n&&e){if(n.featureAllowList&&n.featureAllowList.length&&!n.featureAllowList.includes(t)||n.userIdAllowList&&n.userIdAllowList.length&&!n.userIdAllowList.includes(e.userId)||n.userGroupIdAllowList&&n.userGroupIdAllowList.length&&!n.userGroupIdAllowList.includes(e.groupId||"")||n.userPlanAllowList&&n.userPlanAllowList.length&&!n.userPlanAllowList.includes(e.plan||""))return!1;if(n.urlAllowList){let r=window.location.href;if(n.urlAllowList.length&&!n.urlAllowList.filter(i=>r.includes(i)).length)return!1}return!0}return!1}catch(r){return M.catch("Error in isFeatureAllowed: ",r),!1}},Xu=()=>{try{let n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e="";for(let t=0;t<20;t++)e+=n.charAt(Math.floor(Math.random()*n.length));return e}catch(n){return M.catch("Error in utils generateId: ",n),""}},uOe=n=>{try{let e=0;if(n){let t=new Date().getTime();e=Math.abs(t-n)}return e}catch(e){return M.catch("Error in utils getFirebaseTimeDiffInMins: ",e),0}};var uV=()=>{try{return qt.debugMode||!!sessionStorage.getItem("debugMode")||!!sessionStorage.getItem("forceDebugMode")}catch(n){return M.catch("Error in showLogs: ",n),!1}},dV=()=>{try{return!!sessionStorage.getItem("debugContextMode")}catch(n){return M.catch("Error in showContextLogs: ",n),!1}},hV=n=>{try{return typeof n!="object"?Object.assign({},...Object.keys(n).sort().map(e=>({[e]:n[e]&&typeof n[e]=="object"?hV(n[e]):n[e]}))):n}catch(e){return M.catch("Error in sortObjectByKeys: ",e),n}},HD=n=>{try{return n!==null&&typeof n=="object"&&!Array.isArray(n)}catch{return!1}},zU=n=>{try{return HD(n)?Object.fromEntries(Object.entries(n).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>[e,HD(t)?zU(t):Array.isArray(t)?t.map(r=>HD(r)?zU(r):r):t])):n}catch{return n}},qU=(n,e)=>{try{return typeof e!="object"||e===null?n===e:typeof n!="object"||n===null?!1:Array.isArray(e)?Array.isArray(n)?e.every(t=>n.some(r=>qU(r,t))):!1:Object.keys(e).every(t=>Object.prototype.hasOwnProperty.call(n,t)?qU(n[t],e[t]):!1)}catch{return!1}},uX=(n,e,t)=>I(null,null,function*(){try{let r=yield fX(e),i=new Uint8Array(new TextEncoder().encode(t)).slice(0,16),o=new TextEncoder().encode(n),s=yield window.crypto.subtle.encrypt({name:"AES-CBC",iv:i},r,o);return btoa(String.fromCharCode(...new Uint8Array(s)))}catch(r){return M.catch("Error in encrypt: ",r),n}}),dX=(n,e,t)=>I(null,null,function*(){try{let r=yield hX(e),i=new Uint8Array(new TextEncoder().encode(t)).slice(0,16),o=new Uint8Array(atob(n).split("").map(a=>a.charCodeAt(0))),s=yield window.crypto.subtle.decrypt({name:"AES-CBC",iv:i},r,o);return new TextDecoder().decode(s)}catch(r){return M.catch("Error in decrypt: ",r),n}}),hX=n=>I(null,null,function*(){try{let e=new TextEncoder().encode(n),t=new Uint8Array(32);return t.fill(0),t.set(e.slice(0,32)),yield window.crypto.subtle.importKey("raw",t,"AES-CBC",!1,["decrypt"])}catch(e){throw M.catch("Error in importDecryptKey:",e),e}}),_T=(n,e)=>I(null,null,function*(){try{let t="Velt"+e;return yield uX(JSON.stringify(n),t,xo(t))}catch(t){return M.catch("Error in encryptData: ",t),n}}),Qu=(n,e)=>I(null,null,function*(){try{let t="Velt"+e,r=yield dX(n,t,xo(t));return JSON.parse(r)}catch(t){return M.catch("Error in decryptData: ",t),null}}),dOe=n=>{try{switch(n?.region){case"asiaSouthEast1":return"asiaSouthEast1";case"asiaNorthEast1":return"asiaNorthEast1";case"europeWest1":return"europeWest1";case"australiaSouthEast1":return"australiaSouthEast1";default:return"usCentral1"}}catch(e){return M.catch("Error in getRegion: ",e),"usCentral1"}},fX=n=>I(null,null,function*(){try{let e=new TextEncoder().encode(n),t=new Uint8Array(32);return t.fill(0),t.set(e.slice(0,32)),yield window.crypto.subtle.importKey("raw",t,"AES-CBC",!1,["encrypt"])}catch(e){throw M.catch("Error in importKey:",e),e}}),hOe=n=>{try{if(n&&typeof n=="object"){let e=hV(n);return Dc(JSON.stringify(e))}else return null}catch(e){return M.catch("Error in utils generateLocationId: ",e),null}},Wi=(n,e=[])=>(n?.tagName?.toLowerCase().indexOf("velt-")>=0&&![F.TAGS.VELT_VIDEO_PLAYER.toLowerCase()].includes(n?.tagName?.toLowerCase())||n?.tagName?.toLowerCase().indexOf("snippyly-")>=0||n?.className?.split&&(n?.className?.split(" ")?.indexOf("snippyly-overlay-panel")>=0||n?.className?.split(" ")?.indexOf("cdk-overlay-container")>=0))&&!e?.includes(n?.tagName?.toLowerCase())?!0:n?.parentNode&&Wi(n?.parentNode,e),fOe=(n,e=[])=>{try{let t=typeof n.composedPath=="function"?n.composedPath():[],r=t.length>0?t:[n?.target];for(let i of r){let o=i;if(!(!o||typeof o.tagName!="string")&&Wi(o,e))return!0}}catch(t){M.catch("Error in utils isSnippylyEventTarget: ",t)}return!1},Ju=n=>{try{return!!document?.body?.contains(n)}catch(e){return M.catch("Error in utils isElementInsideBody: ",e),!1}};var pX=(n,e)=>{try{return Object.prototype.toString.call(n)===Object.prototype.toString.call(e)?Object.prototype.toString.call(n)==="[object Object]"||Object.prototype.toString.call(n)==="[object Array]"?Object.keys(n).length!==Object.keys(e).length?!1:Object.keys(n).every(t=>pX(n[t],e[t])):n===e:!1}catch(t){return M.catch("Error in utils deepCompare: ",t),!1}},pOe=(n,e,t=1)=>{try{if(e){let r=KU(e.textContent,n,t);if(r>=0){let i=e.querySelector("script")!==null,o=(e?.ownerDocument).createNodeIterator(e,NodeFilter.SHOW_TEXT,i?{acceptNode:g=>g.parentElement?.tagName==="SCRIPT"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}:null),s,a=[];for(;s=o.nextNode();)a.push(s);let c=r;if(i){let g=a.reduce((v,S)=>v+(S.textContent||""),""),E=KU(g,n,t);if(E<0)return[];c=E}let l=[],d=n.length,h=c+d,f=0;for(let g=0;g<a.length;g++){let E=a[g],v=f;if(f+=E.textContent?.length,f>=c&&!l.length?l.push({textNode:E,startOffset:c-v}):f>=c&&f<h&&l.push({textNode:E}),f>=h){if(l.length===1&&l[0].textNode===E){l.push({textNode:E,endOffset:c-v+n.length});break}let S=d;l.forEach(P=>{S-=P.textNode.textContent?.length-(P.startOffset||0)}),l.push({textNode:E,endOffset:S});break}}return l}}return[]}catch(r){return M.catch("Error in utils calculateNodes: ",r),[]}},KU=(n,e,t=1)=>{try{if(n?.includes(e)){let r=n.split(e,t);return r.length===t?r.join(e).length:-1}else return-1}catch(r){return M.catch("Error in utils getTextPosition: ",r),-1}},zD=(n,e,t,r,i)=>{try{let o=new Range;o.setStart(n,e),o.setEnd(t,r);let s=o.commonAncestorContainer,c=(s.nodeType===Node.ELEMENT_NODE?s:s.parentElement)?.querySelector("script")!==null,l;if(c){let h=o.cloneContents();h.querySelectorAll("script").forEach(f=>f.remove()),l=h.textContent||""}else l=o.toString();let d=0;if(n.nodeType===Node.TEXT_NODE){let h=n,f="";if(h)for(;h=h.previousSibling;)if(c){if(h.nodeType===Node.ELEMENT_NODE&&h.tagName==="SCRIPT")continue;if(h.nodeType===Node.ELEMENT_NODE){let g=h;if(g.querySelector("script")){let E=g.cloneNode(!0);E.querySelectorAll("script").forEach(v=>v.remove()),f=(E.textContent||"")+f}else f=(h.textContent||"")+f}else h.parentElement?.tagName!=="SCRIPT"&&(f=(h.textContent||"")+f)}else f=(h.textContent||"")+f;if(f){let g=new RegExp(YU(i),"g");d=(f.match(g)||[]).length}}if(l){let h=new RegExp(YU(i),"g");return(l.match(h)||[]).length+d}else return d}catch(o){return M.catch("Error in utils getSelectedTextOccurrenceInRange: ",o),0}},YU=n=>{try{return n&&typeof n=="string"?n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"):n}catch(e){return M.catch("Error in utils escapeRegExp: ",e),n}},gX=n=>{try{return n==null?null:n.scrollHeight>n.clientHeight?n:gX(n?.parentNode)}catch(e){return M.catch("Error in utils getScrollableParent: ",e),null}},gT=n=>{try{return n==null?[]:n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth?[n,...gT(n?.parentNode)]:gT(n?.parentNode)}catch(e){return M.catch("Error in utils getScrollableParents: ",e),[]}};function gOe(n){try{if(!n)return[];let e=gT(n),t=n;for(;t;){let r=t.getRootNode();if(r instanceof ShadowRoot)e.push(...gT(r.host)),t=r.host;else break}return e}catch(e){return M.catch("Error in utils getScrollableParentsCrossingShadowBoundary: ",e),[]}}var mOe=(n,e)=>{try{if(n&&e){let t=n.getBoundingClientRect(),r=e.getBoundingClientRect(),i=t.top-r.top+(e.tagName?.toLowerCase()==="html"?0:e.scrollTop),o=t.left-r.left;return{top:i,left:o}}else return null}catch(t){return M.catch("Error in utils getRelativeTopLeftPosition: ",t),null}},fV=(n,e)=>`${Dc(n+"_"+e)}`,pV=n=>{try{let e=uT(n),t=new mt(!1);return e&&Object.assign(t,e),t.url=e?.url??window.location.href,t.path=e?.path??window.location.pathname,t.queryParams=e?.queryParams??window.location.search,t.baseUrl=e?.baseUrl??window.location.origin,t.title=e?.title??document.title,t}catch(e){M.catch("Error in utils getPageInfo: ",e);return}},mX=n=>{try{return n?n?.hasAttribute&&n?.hasAttribute(F.ATTRIBUTES.VELT_COMMENT_DISABLED)?!0:mX(n?.parentElement):!1}catch(e){return M.catch("Error in utils isCommentDisabledOnElement: ",e),!1}},ep=".ProseMirror[contenteditable]",XU=new Set,Zu=(n,e)=>{try{if(XU.has(n))return;XU.add(n),M.catch(`Error in utils ${n} (treated as "not editor content"): `,e)}catch{}};var Cc=n=>{try{return!n||!n.isConnected?!1:!!(n.nodeType===Node.ELEMENT_NODE?n:n.parentElement)?.closest?.(ep)}catch(e){return Zu("isNodeInsideRichTextEditor",e),!1}},QU=n=>{if(!n||!n.isConnected)return null;let e=null,t=n.nodeType===Node.ELEMENT_NODE?n:n.parentElement;for(;t=t?.closest?.(ep)??null;)e=t,t=t.parentElement;return e},EX=n=>{try{return!!n?.querySelector?.(ep)}catch(e){return Zu("containsRichTextEditor",e),!1}},gV=(n,e)=>{let t=e.ownerDocument.createRange();return t.selectNodeContents(e),n.compareBoundaryPoints(Range.START_TO_START,t)>0&&t.setStart(n.startContainer,n.startOffset),n.compareBoundaryPoints(Range.END_TO_END,t)<0&&t.setEnd(n.endContainer,n.endOffset),t},_X=(n,e)=>{let t=n;for(;t&&t!==e;){if(t.nextSibling)return t.nextSibling;t=t.parentNode}return null},TX=(n,e)=>{let t=gV(n,e);if(t.collapsed)return!1;let{startContainer:r,startOffset:i,endContainer:o,endOffset:s}=t,a=d=>{let h=d===r?i:0;return(d===o?s:d.length)>h},c=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT),l;for(r.nodeType===Node.TEXT_NODE?l=r:(l=r.childNodes[i]??_X(r,e),l&&l.nodeType!==Node.TEXT_NODE&&(c.currentNode=l,l=c.nextNode()));l;){if(t.comparePoint(l,0)>0)return!1;if(a(l))return!0;c.currentNode=l,l=c.nextNode()}return!1},mV=n=>{let e=new Set,t=QU(n.startContainer),r=QU(n.endContainer);t&&e.add(t),r&&e.add(r);let i=n.commonAncestorContainer,s=(i?.nodeType===Node.TEXT_NODE?i.parentElement:i)?.querySelectorAll?.(ep)??[];for(let a=0;a<s.length;a++)n.intersectsNode(s[a])&&e.add(s[a]);return e},JU=(n,e)=>{let t=e.parentNode;if(!t)return!1;let r=Array.prototype.indexOf.call(t.childNodes,e);return n.comparePoint(t,r)===0&&n.comparePoint(t,r+1)===0},IX=n=>{try{if(!n||n.collapsed)return!1;for(let e of mV(n))if(TX(n,e))return!0;return!1}catch(e){return Zu("doesRangeTouchRichTextEditor",e),!1}},EOe=n=>{try{if(!n||n.collapsed)return!1;if(IX(n))return!0;for(let e of mV(n)){if(JU(n,e))return!0;let t=gV(n,e);if(t.collapsed)continue;let r=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT);for(;r.nextNode();)if(JU(t,r.currentNode))return!0}return!1}catch(e){return Zu("doesRangeIntersectRichTextEditorNode",e),!1}},yX=n=>{try{if(!n||Cc(n))return;if(!EX(n)){n.normalize();return}Array.from(n.childNodes).forEach(e=>{e.nodeType===Node.ELEMENT_NODE&&!e.matches(ep)&&yX(e)})}catch(e){Zu("normalizeOutsideRichTextEditors",e)}},_Oe=n=>{try{let e=Cc(n.startContainer),t=Cc(n.endContainer);if(!e&&!t)return!0;let r=n.commonAncestorContainer,i=r.nodeType===Node.ELEMENT_NODE?r:r.parentNode;if(!i)return!1;let o=(i.ownerDocument||document).createTreeWalker(i,NodeFilter.SHOW_TEXT),s=null,a=null;for(;o.nextNode();){let c=o.currentNode;c.length&&n.intersectsNode(c)&&!Cc(c)&&(s=s||c,a=c)}return!s||!a?!1:(e&&n.setStart(s,0),t&&n.setEnd(a,a.length),!0)}catch(e){return Zu("moveRangeBoundariesOutOfRichTextEditors",e),!1}},vX=n=>{try{return n?n?.hasAttribute&&n?.hasAttribute(F.ATTRIBUTES.VELT_TAG_DISABLED)?!0:vX(n?.parentElement):!1}catch(e){return M.catch("Error in utils isTagDisabledOnElement: ",e),!1}},SX=n=>{try{return n?n?.hasAttribute&&n?.hasAttribute(F.ATTRIBUTES.VELT_ARROW_DISABLED)?!0:SX(n?.parentElement):!1}catch(e){return M.catch("Error in utils isArrowDisabledOnElement: ",e),!1}},AX=n=>{try{return n?n?.hasAttribute&&n?.hasAttribute(F.ATTRIBUTES.VELT_AREA_DISABLED)?!0:AX(n?.parentElement):!1}catch(e){return M.catch("Error in utils isAreaDisabledOnElement: ",e),!1}},CX=n=>{try{return n?n?.hasAttribute&&n?.hasAttribute(F.ATTRIBUTES.VELT_RECORDER_DISABLED)?!0:CX(n?.parentElement):!1}catch(e){return M.catch("Error in utils isRecorderDisabledOnElement: ",e),!1}};var wc=()=>{try{return window?.Snippyly?.version}catch(n){return M.catch("Error in utils getSdkVersion: ",n),null}},TOe=n=>{try{return Object.fromEntries(Object.entries(n).filter(([e,t])=>t!==void 0))}catch(e){return M.catch("Error in utils removeUndefinedKeys: ",e),n}},IOe=n=>{try{let e=new URL(n);return Object.values(F.URL_PARAMS).forEach(t=>{e.searchParams.delete(t)}),e.href}catch(e){return M.catch("Error in utils excludeSnippylyParamsFromUrl: ",e),n}},yOe=n=>{try{navigator.clipboard.writeText(n)}catch(e){M.catch("Error in copyToClipboard: ",e)}},$D=n=>{try{let e=EV(n);return e&&typeof e=="string"&&e.includes("/svg")&&(e=e.split("/svg")[0]+"/*[name()='svg']"),e}catch(e){M.catch("Error in utils getXPath:",e)}},EV=n=>{try{if(n){if(typeof n=="string")return document.evaluate(n,document,null,0,null);if(!n||n.nodeType!=1)return"";if(n.id&&n?.tagName?.toLowerCase()!=="svg"&&document.querySelectorAll(`[id='${n.id}']`)?.length===1)return"//*[@id='"+n.id+"']";let e=[].filter.call(n.parentNode?.children?n.parentNode?.children:[],function(t){return t.tagName==n.tagName});return EV(n.parentNode)+"/"+n.tagName.toLowerCase()+(e.length>1?"["+([].indexOf.call(e,n)+1)+"]":"")}}catch(e){M.catch("Error in utils calculateXPath:",e)}},vOe=n=>{try{let e=[];return n.forEach(t=>{let r={};r.commonAncestorContainer=DX(t.commonAncestorContainer),r.text=t.toString(),r.occurrence=zD(t.commonAncestorContainer,0,t.startContainer,t.startOffset,t.toString())+1,e.push(r)}),e}catch{return[]}},DX=n=>{try{if(n.nodeType===Node.TEXT_NODE){let e=1,t=n.previousSibling;for(;t;)t.nodeType===Node.TEXT_NODE&&e++,t=t.previousSibling;return $D(n.parentElement)}else return $D(n)}catch(e){return M.catch("Error in utils getXPathForText: ",e),$D(n)}},RX=(n,e)=>{try{return n?n?.hasAttribute&&(e&&n.hasAttribute("contenteditable")||n?.getAttribute(F.ATTRIBUTES.VELT_LIVE_SELECTION_ENABLED)==="true")?n:RX(n?.parentElement,e):null}catch(t){return M.catch("Error in utils getSelectionEnabledElement: ",t),null}},SOe=n=>{try{let e,t=[],r=document.createTreeWalker(n,NodeFilter.SHOW_TEXT,null);for(;e=r.nextNode();)t.push(e);return t}catch(e){return M.catch("Error in utils getTextNodesInsideElement: ",e),[]}},AOe=n=>{try{return n<576||n>=576&&n<767?"Mobile":n>=768&&n<992?"Tablet":n>=992&&n<1520?"Desktop":"Monitor"}catch(e){return M.catch("Error in utils getDeviceTypeFromDeviceWidth: ",e),""}},_V=n=>new Promise(e=>setTimeout(e,n)),COe=(n,e=0)=>new Promise((t,r)=>{let i=document.createElement("video"),o=navigator.userAgent.includes("Firefox");o&&(i.preload="auto"),i.setAttribute("src",URL.createObjectURL(n)),i.load(),i.addEventListener("error",s=>{r("error when loading video file: "+s)}),i.addEventListener("loadedmetadata",()=>{let s=()=>{if(i.duration<e){r("video is too short.");return}setTimeout(()=>{i.currentTime=e},200),i.addEventListener("seeked",()=>{let a=document.createElement("canvas");a.width=i.videoWidth,a.height=i.videoHeight;let c=a.getContext("2d");c.drawImage(i,0,0,a.width,a.height),c.canvas.toBlob(l=>{i.remove(),t(l)},"image/jpeg",.75)})};if(o&&i.duration>0&&i.duration<10&&n.size>1e6){setTimeout(()=>{i.duration<e&&(e=Math.max(.1,i.duration/2)),s()},1e3);return}s()})}),DOe=n=>{try{return new Promise((e,t)=>{let r=new FileReader;r.onloadend=()=>e(r.result),r.readAsDataURL(n)})}catch(e){return M.catch("Error in utils blobToBase64: ",e),Promise.resolve("")}},ROe=(n,e="image/jpeg")=>{try{let t=atob(n.split(",")[1]),r=new ArrayBuffer(t.length),i=new Uint8Array(r);for(let o=0;o<t.length;o++)i[o]=t.charCodeAt(o);return new Blob([r],{type:e})}catch(t){return M.catch("Error in utils base64ToBlob: ",t),null}},NOe=(n,e,t=20)=>new Promise((r,i)=>{let o=new Image;o.crossOrigin="Anonymous",o.onload=()=>{let s=o.width,a=o.height,c=600,l=a/s*c,d="http://www.w3.org/2000/svg",h=document.createElementNS(d,"svg");h.setAttribute("xmlns",d),h.setAttribute("width",c.toString()),h.setAttribute("height",l.toString()),h.setAttribute("viewBox",`0 0 ${c} ${l}`);let f=document.createElementNS(d,"circle"),g=document.createElementNS(d,"polygon"),E=16,v=E+16,S=c/2,P=l/2;if(f.setAttribute("cx",S.toString()),f.setAttribute("cy",P.toString()),f.setAttribute("r",v.toString()),f.setAttribute("fill","lightgrey"),g.setAttribute("points",`${S-E/2},${P-E} ${S-E/2},${P+E} ${S+E},${P}`),g.setAttribute("fill","#ffffff"),h.appendChild(f),h.appendChild(g),e){let C=e.length*16-10,y=16*1.5,A=(c-C)/2,R=l-y-10,N=document.createElementNS(d,"rect");N.setAttribute("x",A.toString()),N.setAttribute("y",R.toString()),N.setAttribute("width",C.toString()),N.setAttribute("height",y.toString()),N.setAttribute("fill","#353945b3"),N.setAttribute("rx","12"),h.appendChild(N);let O=document.createElementNS(d,"text");O.textContent=e,O.setAttribute("x",(c/2).toString()),O.setAttribute("y",(R+16).toString()),O.setAttribute("font-size","16"),O.setAttribute("text-anchor","middle"),O.setAttribute("fill","white"),h.appendChild(O)}let V=new XMLSerializer().serializeToString(h),K=new Image,oe=new Blob([V],{type:"image/svg+xml;charset=utf-8"}),ge=URL.createObjectURL(oe);K.onload=()=>{let te=document.createElement("canvas");te.width=c,te.height=l;let C=te.getContext("2d");C.beginPath(),C.moveTo(t,0),C.lineTo(c-t,0),C.quadraticCurveTo(c,0,c,t),C.lineTo(c,l-t),C.quadraticCurveTo(c,l,c-t,l),C.lineTo(t,l),C.quadraticCurveTo(0,l,0,l-t),C.lineTo(0,t),C.quadraticCurveTo(0,0,t,0),C.closePath(),C.clip(),C.drawImage(o,0,0,c,l),C.drawImage(K,0,0,c,l);let y=te.toDataURL("image/png");r(y)},K.onerror=i,K.src=ge},o.onerror=i,o.src=n});var wOe=n=>{try{return n?.replace(/[\n\t\u200D]/g,"")?.split(/\s+/)?.filter(r=>r?.trim()?.length)||[]}catch(e){return M.catch("Error in utils getWords: ",e),[]}},bOe=(n,e=[])=>{try{let t=e.map(r=>`[${r}="${n}"]`).join(",");return document.querySelector(t)}catch(t){return M.catch("Error in utils getElementByAttributes: ",t),null}},OOe=(n,e=[])=>{try{let t=e.map(r=>`[${r}="${n}"]`).join(",");return document.querySelectorAll(t)}catch(t){return M.catch("Error in utils getElementsByAttributes: ",t),[]}},pT=n=>{try{let e=Math.floor(n/3600),t=Math.floor((n-e*3600)/60),r=Math.floor(n-e*3600-t*60);return e&&e<10&&(e="0"+e),t<10&&(t="0"+t),r<10&&(r="0"+r),(e?e+":":"")+t+":"+r}catch{return""}},NX=10,MOe=n=>{try{if(typeof n!="number"||!isFinite(n))return 0;let e=1e3/NX;return Math.round(n*e)/e}catch{return n}},LOe=n=>{try{if(!n||typeof n!="object")return;let e={videoPlayerId:n.videoPlayerId,currentMediaPosition:n.currentMediaPosition,locationName:n.locationName};return n.version?.id&&n.version?.name&&(e.version={id:n.version.id,name:n.version.name}),e}catch{return}},POe=(n,e=10)=>{try{if(!n||!n.currentTime)throw new Error("Invalid video element reference provided");let t=n.currentTime,r=Math.floor(t/e)*e,i=r+e;return{startSlot:pT(r),endSlot:pT(i),timeSlot:pT(r)+" - "+pT(i)}}catch{return null}},wX=n=>{try{return n?typeof ShadowRoot<"u"&&n instanceof ShadowRoot?!0:Object.prototype.toString.call(n)==="[object ShadowRoot]":!1}catch{return!1}},TV=n=>{let e=[];try{let t=n;for(;t;){let r=t?.getRootNode?.();if(!r||r===t||!wX(r))break;e.push(r),t=r.host}}catch(t){M.catch("Error in utils getShadowRootsForElement: ",t)}return e},WD=(n,e)=>{try{let t=r=>!!r&&(r===n||n.contains(r));return t(e.startContainer)&&t(e.endContainer)}catch{return!1}},ZU=new Set,IV=(n,e)=>{try{let t=`${n}|${e}`;if(ZU.has(t))return;ZU.add(t),M.catch(`Caret resolution failed in ${n} (${e}). Mentions and text replacement may not work in this browser.`)}catch{}};var qD=n=>{try{if(!n)return{status:"failed",reason:"no-element"};let e=TV(n),t=window.getSelection(),r=!1,i=e[0];if(i&&typeof i.getSelection=="function"){let o=i.getSelection();if(o?.rangeCount){r=!0;let s=o.getRangeAt(0);if(WD(n,s))return{status:"resolved",range:s,selection:o}}}if(e.length&&typeof t?.getComposedRanges=="function")try{let s=t.getComposedRanges({shadowRoots:e})?.[0];if(s&&(r=!0,WD(n,s))){let a=document.createRange();return a.setStart(s.startContainer,s.startOffset),a.setEnd(s.endContainer,s.endOffset),{status:"resolved",range:a,selection:t}}}catch{}if(t?.rangeCount){r=!0;let o=t.getRangeAt(0);if(WD(n,o))return{status:"resolved",range:o,selection:t}}return r?{status:"failed",reason:"caret-not-resolvable-in-element"}:{status:"no-caret"}}catch(e){return M.catch("Error in utils resolveCaretRangeInElement: ",e),{status:"failed",reason:"threw"}}},xOe=n=>{try{let e=qD(n);if(e.status==="resolved"&&e.selection)return e.selection;let t=TV(n)[0];return t&&typeof t.getSelection=="function"?t.getSelection():window.getSelection()}catch(e){return M.catch("Error in utils getSelectionForElement: ",e),window.getSelection()}},eV=(n,e)=>{try{return!n||!e?!1:typeof n.setBaseAndExtent=="function"?(n.setBaseAndExtent(e.startContainer,e.startOffset,e.startContainer,e.startOffset),!0):(n.removeAllRanges(),n.addRange(e),!0)}catch(t){return M.catch("Error in utils setCaretToRangeStart: ",t),!1}},kOe=(n,e=["@"])=>{try{let t="",r=qD(n);if(r.status==="failed")return IV("getWordAtCursor",r.reason),"";if(r.status==="resolved"){let i=r.range,o=i.endOffset,s=i?.commonAncestorContainer?.textContent;s?t=bX(s,o,e):t=""}return t}catch(t){return M.catch("Error in utils getWordAtCursor: ",t),""}};var bX=(n,e,t=["@"])=>{try{let r=-1,i=!1;for(let o of t){let s=n.lastIndexOf(o,e),a=s>0?n.lastIndexOf(o,s-1):-1;if(s>r){let c=mT(n,s,e),l=ET(n,s,e);if(c||l){if(a!==-1){let d=mT(n,a,s),h=ET(n,a,s);!d&&!h&&(r=a,i=!0)}}else r=s,i=!0}}return r!==-1&&i?n.substring(r,e):""}catch(r){return M.catch("Error in utils getStringFromLastAtSymbol: ",r),""}},mT=(n,e,t)=>{try{if(e===0)return!1;let r=n.charAt(e-1);return!(r===" "||r==="\xA0"||r===`
|
|
124
|
+
`||r===" "||[",",":",";"].includes(r))}catch(r){return M.catch("Error in utils isHotkeyDisabledForAutocomplete: ",r),!1}},ET=(n,e,t)=>{try{return!!n.substring(e+1,t).startsWith(" ")}catch(r){return M.catch("Error in utils isHotkeyFollowedBySpace: ",r),!1}},FOe=(n,e,t=["@"])=>{try{let r=qD(n);if(r.status==="failed"){IV("replaceWordAtCursor",r.reason);return}if(r.status==="resolved"){let i=r.selection,o=r.range,s=o.startOffset,a=o?.commonAncestorContainer?.textContent;if(a){let c=-1;for(let l of t){let d=a.lastIndexOf(l,s),h=d>0?a.lastIndexOf(l,d-1):-1;if(d>c){let f=mT(a,d,s),g=ET(a,d,s);if(f||g){if(h!==-1){let E=mT(a,h,d),v=ET(a,h,d);!E&&!v&&(c=h)}}else c=d}}if(c!==-1){let l=a.substring(0,c),d=a.substring(o.endOffset),h=document.createElement("span");h.textContent=e,h.style.color="var(--velt-accent)";let f=e.startsWith("@")?e.substring(1):e;h.classList.add("velt-mention"),h.classList.add(f.includes("@")?"velt-mention--email":"velt-mention--name");let g=Date.now()+"_"+Math.random().toString(36).substr(2,9);h.setAttribute("data-recently-added",g),setTimeout(()=>{h.hasAttribute("data-recently-added")&&h.removeAttribute("data-recently-added")},5e3);let E=o.commonAncestorContainer;if(E.nodeType===Node.TEXT_NODE){let v=E.parentNode;if(v){let S=document.createTextNode(l),P=document.createTextNode(d);v.replaceChild(P,E),v.insertBefore(h,P),v.insertBefore(S,h);try{let V=document.createRange();V.setStartAfter(h),V.collapse(!0),eV(i,V)}catch(V){M.catch("Error positioning cursor after span:",V);try{let K=document.createRange();K.selectNodeContents(n),K.collapse(!1),eV(i,K)}catch(K){M.catch("Error with fallback cursor positioning:",K)}}}}}}}}catch(r){M.catch("Error in utils replaceWordAtCursor: ",r)}},UOe=()=>{try{let e=window.getSelection()?.getRangeAt(0),t=e?.commonAncestorContainer,r=e?.startContainer,i=e?.endContainer,o=[];o.push(t),o.push(r),o.push(i);let s=!1;for(let a of o)if(a&&Wi(a,[F.TAGS.SNIPPYLY_TEXT_HIGHLIGHT,F.TAGS.SNIPPYLY_COMMENT_TEXT_PORTAL,F.TAGS.SNIPPYLY_HIGHLIGHT_USER_TEXT,F.TAGS.SNIPPYLY_COMMENT_TEXT])){s=!0;break}return s}catch(n){return M.catch("Error in utils isTextSelectionIncludesSnippylyElement: ",n),!1}},yV=(n,e,t)=>{try{let r=document.querySelector(`[id=${n}]`);if(r)r.name=e,r.content=t;else{let i=document.createElement("meta");i.id=n,i.name=e,i.content=t,document.getElementsByTagName("head")[0].appendChild(i)}}catch{}},vV=n=>{try{if(n){let e=document.querySelector(`[id=${n}]`);e&&e.remove()}}catch{}},SV=()=>{try{let e=new Date().getTimezoneOffset(),t=Math.floor(Math.abs(e)/60),r=Math.abs(e)%60;return`UTC${e>0?"-":"+"}${t?.toString()?.padStart(2,"0")}:${r?.toString()?.padStart(2,"0")}`}catch(n){return M.catch("Error in utils getTimezone: ",n),""}},VOe=()=>{try{let n=[];return document.querySelectorAll("*").forEach(t=>{(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth||["auto","scroll"].includes(getComputedStyle(t).overflow))&&n.push(t)}),n}catch(n){return M.catch("Error in utils getScrollableElements: ",n),[]}},AV=(n,e)=>Math.sqrt((n.x-e.x)**2+(n.y-e.y)**2),BOe=(n,e={x:window.innerWidth/2,y:window.innerHeight/2})=>{try{let t=n;for(;t.children.length>0;){let r=null,i=Number.MAX_SAFE_INTEGER;for(let o=0;o<t.children.length;o++){let s=t.children[o],a=s.getBoundingClientRect(),c={x:a.left+a.width/2,y:a.top+a.height/2},l=AV(c,e);(a.top>=0||a.bottom<=window.innerHeight)&&a.width>0&&a.height>0&&l<=i&&(r=s,i=l)}if(r===null)break;t=r}return t}catch(t){return M.catch("Error in utils getInnermostElement: ",t),null}},GOe=n=>{try{let{offsetWidth:e,offsetHeight:t,scrollTop:r}=n,i=n,o={x:e/2,y:r+t/2};for(;i.children.length>0;){let s=null,a=Number.MAX_SAFE_INTEGER;for(let c=0;c<i.children.length;c++){let l=i.children[c],d={x:l.offsetLeft+l.offsetWidth/2,y:l.offsetTop+l.offsetHeight/2},h=AV(d,o);l.offsetTop>=0&&l.offsetWidth>0&&l.offsetHeight>0&&h<=a&&(s=l,a=h)}if(s===null)break;i=s}return i}catch(e){return M.catch("Error in utils getNestedInnermostElement: ",e),null}},jOe=()=>{try{let n=window.innerWidth/2,e=window.innerHeight/2,t=document.elementFromPoint(n,e);for(;t&&t.tagName==="BODY";)e+=2,t=document.elementFromPoint(n,e);return t}catch(n){return M.catch("Error in utils getCenteredBackgroundElement: ",n),null}},HOe=(n,e,t=!1)=>{try{let r=n.getBoundingClientRect(),i=e.getBoundingClientRect(),o=e.offsetTop;t&&(o=o-r.height/2+i.height/2),n.scrollTo({top:o,behavior:"smooth"})}catch(r){M.catch("Error in utils nestedScrollIntoView: ",r)}},$Oe=(n,e=!0)=>{try{let t=document.body.getBoundingClientRect(),r=n.getBoundingClientRect(),i=r.top-t.top,o=window.innerHeight,s=i;e&&(s=s-o/2+r.height/2),window.scrollTo({top:s,behavior:"smooth"})}catch(t){M.catch("Error in utils scrollIntoView: ",t)}},WOe=(n=!1)=>{try{let e=!0;return n&&(e=/\sChrome\/[\d.]+ Mobile\s/.test(navigator.userAgent)),"ontouchstart"in window||navigator.maxTouchPoints>0||e}catch(e){return M.catch("Error in utils isTouchDevice: ",e),!1}},zOe=(n,e,t)=>{try{return(1-t)*n+t*e}catch(r){M.catch("Error in utils lerp: ",r)}return 0},qOe=(n,e)=>{try{if(n===void 0)return n;if(n=n.replace("#",""),n.length===6){let t=parseInt(n,16),r=(t>>16)+e;r>255&&(r=255),r<0&&(r=0);let i=(t&255)+e;i>255&&(i=255),i<0&&(i=0);let o=(t>>8&255)+e;return o>255&&(o=255),o<0&&(o=0),`#${(i|o<<8|r<<16).toString(16)}`}else return n}catch(t){M.catch("Error in utils multiplyColor: ",t)}return n},KOe=n=>{try{return n in F.TEXT_COLOR_MAP?F.TEXT_COLOR_MAP[n]:"#141416"}catch(e){return M.catch("Error in generateUserColor:",e),"#141416"}},YOe=()=>{try{let n=localStorage.getItem(F.LOCAL_STORAGE.SNIPPYLY_DEFAULT_MEDIA_SOURCE_OPTIONS);if(n)return JSON.parse(n)}catch(n){return M.catch("Error in getDefaultMediaStreamOptions:",n),{}}},XOe=(n,e)=>{try{let t=e*(Math.PI/180),r=Math.cos(t);return r?n/r:n}catch(t){return M.catch("Error in calculateHypotenuse:",t),0}},QOe=(n,e,t=!0)=>{try{let r=[],i=t?n:n.parentNode;for(;i;)r.push(i),i=i.parentNode;let o=t?e:e.parentNode;for(;o;){if(r.indexOf(o)!==-1)return o;o=o.parentNode}return null}catch(r){return M.catch("Error in utils findCommonParent: ",r),null}},JOe=(n,e,t,r,i=!1)=>{try{let o,s;if(i){let a=t,c=r;if(a===c)o=n,s=e;else{let l=0,d=0,h=a;for(;h&&h!==c;)l+=h.offsetLeft,d+=h.offsetTop,h=h.parentElement;o=l+n,s=d+e}}else{let a=t.getBoundingClientRect(),c=r.getBoundingClientRect(),l=a.left+n,d=a.top+e;o=l-c.left,s=d-c.top}return{x:o,y:s}}catch(o){return M.catch("Error in utils calculateParentCoordinates: ",o),{x:n,y:e}}},ZOe=n=>{try{let e={height:0,width:0};if(typeof n?.getBBox=="function"){let t=n?.getBBox(),r=n?.getBoundingClientRect();e.height=parseFloat(r?.height||t.height||0),e.width=parseFloat(r?.width||t.width||0)}else{let t=window.getComputedStyle(n);if(e.height=n?.clientHeight||parseFloat(t.getPropertyValue("height"))||0,e.width=n?.clientWidth||parseFloat(t.getPropertyValue("width"))||0,n?.getBoundingClientRect&&typeof n?.getBoundingClientRect=="function"){let r=n?.getBoundingClientRect();e?.height||(e.height=r?.height||n?.clientHeight||n?.offsetHeight||0),e?.width||(e.width=r?.width||n?.clientWidth||n?.offsetWidth||0)}}return e}catch(e){return M.catch("Error in utils getElementDimensions: ",e),{height:0,width:0}}},e0e=n=>{try{let e=n;for(;e;){if(window?.getComputedStyle(e)?.getPropertyValue("background-clip")=="text")return!0;e=e?.parentElement}return!1}catch(e){return M.catch("Error in utils hasParentWithBackgroundClip: ",e),!1}},t0e=n=>{try{let e=["attachment","attachments","chunkUrls","transcription","color","position","positionX","positionY","resolved","inProgress","screenWidth","screenHeight","screenScrollHeight","screenScrollTop","taggedElementPath","taggedElementRect","targetElement","documentParamsId","documentParams","ghostComment","areaAnnotationId","iam","commentSource"],t=JSON.parse(JSON.stringify(n)),r={};return Object.keys(t).forEach(i=>{e.includes(i)||(r[i]=t[i])}),JSON.parse(JSON.stringify(r))}catch(e){return M.catch("Error in utils getRecorderAnnotationForClient: ",e),null}},n0e=n=>n===null||typeof n>"u",r0e=(n,e)=>{try{return!!n?.closest(`[${e}]`)}catch(t){return M.catch("Error in utils hasParentWithAttribute: ",t),!1}},OX=(n,e=!0)=>{try{let t=[];if(!n||!(n instanceof HTMLElement))return[];e&&t.push(n);for(let r=0;r<n.children.length;r++){let i=n.children[r];t=t.concat(OX(i))}return t}catch(t){return M.catch("Error in utils getAllNestedChildren: ",t),[]}},i0e=()=>{try{return document.visibilityState==="hidden"?!1:document.hasFocus()}catch(n){return M.catch("Error in utils isTabActive: ",n),!1}},o0e=n=>{try{let e="",t=n?.getAttribute("src");if(t)e=`${Dc(t)}`;else{let r=n?.querySelectorAll("source");if(r&&r.length>0){let o=r[0]?.getAttribute("src");o&&(e=`${Dc(o)}`)}}return e}catch{return""}},s0e=n=>{try{return!(n&&(n?.children?.length>0||n?.textContent?.trim()?.length>0))}catch(e){return M.catch("Error in utils isTemplateEmpty: ",e),!0}},tV=(n,e)=>{try{if(!n||!e)return;let t=[],r="",i=0;for(let c=0;c<e.length;c++){let l=e[c];l==="["?(i++,i===1&&r&&(t.push(r),r=""),r+=l):l==="]"?(i--,r+=l,i===0&&(t.push(r),r="")):l==="."&&i===0?r&&(t.push(r),r=""):r+=l}r&&t.push(r);let o,s=$({},n),a=t.reduce((c,l)=>{if(c==null)return;Pi(c)&&(o=c,c=c());let d=l.match(/^\[([^\[\]]+|(\[[^\[\]]*\]))\]$/);if(d){let f=d[1];if(/^\d+$/.test(f)){let g=parseInt(f,10);return Array.isArray(c)?c[g]:void 0}if(f.startsWith("'")&&f.endsWith("'")||f.startsWith('"')&&f.endsWith('"')){let g=f.slice(1,-1);return c[g]}if(f.includes(".")||f.includes("[")){let g=tV(s,f);Pi(g)&&(g=g());let E=g?.toString()||"";return c[E]}if(s[f]!==void 0){let g=s[f];return Pi(g)&&(g=g()),c[g]}return c[f]}let h=l;return(l.startsWith("'")&&l.endsWith("'")||l.startsWith('"')&&l.endsWith('"'))&&(h=l.slice(1,-1)),h==="length"&&Array.isArray(c)?c.length:c[h]},n);return o?Pf(()=>{try{let c=$({},n);return t.reduce((l,d)=>{if(l==null)return;Pi(l)&&(l=l());let h=d.match(/^\[([^\[\]]+|(\[[^\[\]]*\]))\]$/);if(h){let g=h[1];if(/^\d+$/.test(g)){let E=parseInt(g,10);return Array.isArray(l)?l[E]:void 0}if(g.startsWith("'")&&g.endsWith("'")||g.startsWith('"')&&g.endsWith('"')){let E=g.slice(1,-1);return l[E]}if(g.includes(".")||g.includes("[")){let E=tV(c,g);Pi(E)&&(E=E());let v=E?.toString()||"";return l[v]}if(c[g]!==void 0){let E=c[g];return Pi(E)&&(E=E()),l[E]}return l[g]}let f=d;return(d.startsWith("'")&&d.endsWith("'")||d.startsWith('"')&&d.endsWith('"'))&&(f=d.slice(1,-1)),l[f]},n)}catch{return""}}):a}catch{return""}},a0e=(n,e)=>{try{return!!(n?.locationId&&(n.locationId===e?.locationId||e?.location?.id===String(n.locationId))||n?.location?.id&&(n.location.id===e?.location?.id||n.location.id===String(e?.locationId)))}catch(t){return M.catch("Error in utils isLocationSame: ",t),!1}},c0e=()=>{try{let n=document.activeElement,e=new Set,t=10,r=0;for(;n&&n.shadowRoot&&!(e.has(n)||(e.add(n),n=n.shadowRoot.activeElement,r++,r>t)););return n}catch(n){return M.catch("Error in utils getActiveElement: ",n),null}},tp=(n,e)=>{try{return typeof n=="object"&&typeof e=="object"?JSON.stringify(n)===JSON.stringify(e):n===e}catch{return!1}},MX=(n,e=0)=>{try{let t=JSON.parse(JSON.stringify(n));return n?.clientDocumentId&&(t.documentId=n.clientDocumentId),n?.clientOrganizationId&&(t.organizationId=n.clientOrganizationId),n?.documentMetadata&&e<5&&(t.documentMetadata=MX(n.documentMetadata,e+1)),delete t?.clientDocumentId,delete t?.clientOrganizationId,delete t?.veltFolderId,delete t?.parentVeltFolderId,delete t?.pageInfo,t}catch{return n}},l0e=n=>{try{if(!n.some(s=>s?.value?.data))return{};let e=null,t=n.reduce((s,a)=>Math.max(s,a.timestamp),0),r=n.find(s=>s.timestamp===t);if(!r)return{};r?.value?.operation?.type==="removed"&&(e=r?.value?.operation);let o=n.map(s=>s.value).reduce((s,a)=>({data:$($({},s?.data??{}),a?.data??{})}),{});return o.operation=e,o}catch{return{}}},u0e=(n,e,t)=>I(null,null,function*(){try{let r=0;for(;r<=(t.retryCount||0);)try{let i=yield n();if(!i)return{success:!1,statusCode:400,message:`${e} failed: No response received`};if(i.statusCode===void 0)return{success:!1,statusCode:400,message:`${e} failed: Response missing statusCode`};if(i.statusCode!==200){if(r++,r>(t.retryCount||0))return{success:!1,statusCode:i.statusCode,message:`${e} failed after ${r} attempts with status code ${i.statusCode}`};t.retryDelay&&(yield new Promise(o=>setTimeout(o,t.retryDelay)));continue}return i}catch(i){if(r++,r>(t.retryCount||0))return{success:!1,statusCode:500,message:`${e} failed with error: ${i instanceof Error?i.message:"Unknown error"}`};t.retryDelay&&(yield new Promise(o=>setTimeout(o,t.retryDelay)))}return{success:!1,statusCode:500,message:`${e} failed: Maximum retry attempts exceeded`}}catch(r){return{success:!1,statusCode:500,message:`${e} failed with unexpected error: ${r instanceof Error?r.message:"Unknown error"}`}}}),d0e=(n,e,t,r,i)=>I(null,null,function*(){try{let o=typeof e=="function"?yield e():e||{},a=$($({},{"Content-Type":"application/json"}),o),c=yield fetch(n,$({method:"POST",headers:a,body:JSON.stringify(t)},i?{credentials:i}:{}));if(!c.ok)return M.catch(`Error in makeConfigBasedRequest: ${c.status} ${c.statusText}`),r?{data:{},success:!1,statusCode:c.status}:{success:!1,statusCode:c.status};let l=yield c.json();return r?{data:l?.data??{},success:!0,statusCode:200}:{success:!0,statusCode:200}}catch(o){return M.catch("Error in makeConfigBasedRequest:",o),r?{data:{},success:!1,statusCode:500}:{success:!1,statusCode:500}}}),h0e=n=>{try{return!n||!n?.access?[]:Object.keys(n.access).sort().map(i=>n.access?.[i]?.map(o=>`${i}:${o}`)??[]).reduce((i,o)=>i.flatMap(s=>o.map(a=>[...s,a])),[[]]).map(i=>i.join("_"))}catch(e){return M.catch("Error in utils generateProcessedContext: ",e),[]}},LX=n=>{try{if(!n||!n?.access)return[];let e=Object.keys(n.access).sort(),r=(o=>{let s=[],a=Math.pow(2,o.length);for(let c=1;c<a;c++){let l=[];for(let d=0;d<o.length;d++)c&1<<d&&l.push(o[d]);s.push(l)}return s})(e),i=[];for(let o of r){let s=o.map(a=>{let c=n.access?.[a];return c==null?null:`${a}:${c}`}).filter(a=>a!==null);s.length>0&&i.push(s.join("_"))}return[...new Set(i)]}catch(e){return M.catch("Error in utils generateAllContextCombos: ",e),[]}},f0e=({input:n})=>{try{if(!n||!n?.access)return[];let e=n?.access,t=Object.keys(e).sort(),r=[];for(let o of t){let s=e[o];s!=null&&Array.isArray(s)&&s.length>0&&r.push({key:o,values:s})}return r.length===0?[]:r.reduce((o,{key:s,values:a})=>o.length===0?a.map(c=>[{key:s,value:c}]):o.flatMap(c=>a.map(l=>[...c,{key:s,value:l}])),[]).map(o=>{let s={};return o.forEach(({key:a,value:c})=>{s[a]=c}),{access:s}})}catch(e){return M.catch("Error in utils expandContextArraysToSingleValues: ",e),[]}},p0e=({input:n})=>{try{if(!n||n.length===0)return{access:{}};let e=new Set;n.forEach(r=>{r?.access&&Object.keys(r.access).forEach(i=>e.add(i))});let t={};for(let r of Array.from(e).sort()){let i=new Set;n.forEach(o=>{if(o?.access){let s=o.access[r];s!=null&&i.add(s)}}),t[r]=i.size>0?Array.from(i).sort():null}return{access:t}}catch(e){return M.catch("Error in utils combineContextsToArrays: ",e),{access:{}}}},CV=i=>I(null,[i],function*({data:n,getSdkProxy:e,userId:t,methodName:r}){try{let o="sdkproxyencryptionanddecryptiononsdk"+(t??""),s=yield PX({data:n,key:o}),a=(yield e({veltData:s}))?.data?.data?.veltData||{};return yield Qu(a,o)}catch(o){return M.catch("Error in utils sdkProxyEncryptDecrypt: "+(r??""),o),n}}),PX=t=>I(null,[t],function*({data:n,key:e}){try{return yield _T(n,e)}catch{return n}}),KD=(n,e)=>I(null,null,function*(){try{let t=0;for(;t<=(e.retryCount||0);)try{let r=yield n();if(!r)throw new Error("No response received");return r}catch{if(t++,t>=(e.retryCount||0))return null;e.retryDelay&&(yield new Promise(i=>setTimeout(i,e.retryDelay)))}return null}catch{return null}}),YD=n=>{try{if(n&&typeof n=="object"){let e=JSON.parse(JSON.stringify(n));return e?.clientOrganizationId&&(e.organizationId=e.clientOrganizationId,delete e.clientOrganizationId),e?.clientGroupId&&(e.groupId=e.clientGroupId,delete e.clientGroupId),e?.userSnippylyId&&delete e.userSnippylyId,delete e?.email_lowercase,delete e?.name_lowercase,e}else return null}catch(e){return M.catch("Error in utils getUserForClient: ",e),null}},ed=({url:n,apiProxyDomain:e})=>{try{if(Nc(n))return n;if(e){let t=new URL(n);t.origin&&(n=n.replace(t.origin,e))}return n}catch(t){return M.catch("Error in utils getResolvedApiUrl: ",t),n}},g0e=(n,e)=>{try{if(!n||!(n instanceof Element))return!1;let t,r;if(e&&typeof e.x=="number"&&typeof e.y=="number")t=e.x,r=e.y;else{let o=n.getBoundingClientRect();t=o.left+o.width/2,r=o.top+o.height/2}let i=document.elementFromPoint(t,r);return!(!i||i===n||n.contains(i))}catch{return!1}};function nV(n,e){if(n==null||typeof n!="object"||Array.isArray(n))return n;let t={};for(let r of e)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t}function rV(n){return n!=null&&typeof n=="object"&&!Array.isArray(n)}function Yu(n,e){switch(e.kind){case"type":return nV(n,e.safeKeys);case"array":return Array.isArray(n)?n.map(t=>Yu(t,e.item)):n;case"record":{if(!rV(n))return n;let t={};for(let r of Object.keys(n))t[r]=Yu(n[r],e.value);return t}case"object":{if(!rV(n))return n;let t=e.selfKeys?nV(n,e.selfKeys):$({},n);for(let r of Object.keys(e.fields))Object.prototype.hasOwnProperty.call(t,r)&&(t[r]=Yu(t[r],e.fields[r]));return t}default:return n}}var Yn={kind:"type",safeKeys:GU},xX={kind:"type",safeKeys:jU},kX={kind:"type",safeKeys:WU},FX={kind:"type",safeKeys:$U},Zf={kind:"type",safeKeys:HU};function UX(n){return{kind:"object",selfKeys:UU,fields:{from:Yn,to:{kind:"array",item:Yn},attachments:{kind:"array",item:n},recorders:{kind:"array",item:kX},taggedUserContacts:{kind:"array",item:{kind:"object",fields:{contact:Yn}}}}}}function DV(n){return{kind:"object",selfKeys:FU,fields:{from:Yn,assignedTo:Yn,resolvedByUser:Yn,viewedBy:{kind:"array",item:Yn},subscribedUsers:{kind:"record",value:{kind:"object",fields:{user:Yn}}},unsubscribedUsers:{kind:"record",value:{kind:"object",fields:{user:Yn}}},suggestion:{kind:"object",fields:{resolvedBy:Yn}},targetTextRange:xX,comments:{kind:"array",item:UX(n)}}}}var VX=DV(FX),BX=DV(Zf),GX={kind:"object",selfKeys:VU,fields:{from:Yn,reactions:{kind:"array",item:{kind:"object",fields:{from:Yn}}}}},jX={kind:"object",selfKeys:BU,fields:{from:Yn,attachment:Zf,attachments:{kind:"array",item:Zf},recordingEditVersions:{kind:"record",value:{kind:"object",fields:{from:Yn,attachment:Zf,attachments:{kind:"array",item:Zf}}}}}};function m0e(n,e){let t=e?.stripAttachmentFiles?VX:BX;return Yu(n,t)}function E0e(n){return Yu(n,GX)}function _0e(n){return Yu(n,jX)}var RV=()=>{};var QD={NODE_CLIENT:!1,NODE_ADMIN:!1,SDK_VERSION:"${JSCORE_VERSION}"};var q=function(n,e){if(!n)throw bc(e)},bc=function(n){return new Error("Firebase Database ("+QD.SDK_VERSION+") INTERNAL ASSERT FAILED: "+n)};var bV=function(n){let e=[],t=0;for(let r=0;r<n.length;r++){let i=n.charCodeAt(r);i<128?e[t++]=i:i<2048?(e[t++]=i>>6|192,e[t++]=i&63|128):(i&64512)===55296&&r+1<n.length&&(n.charCodeAt(r+1)&64512)===56320?(i=65536+((i&1023)<<10)+(n.charCodeAt(++r)&1023),e[t++]=i>>18|240,e[t++]=i>>12&63|128,e[t++]=i>>6&63|128,e[t++]=i&63|128):(e[t++]=i>>12|224,e[t++]=i>>6&63|128,e[t++]=i&63|128)}return e},HX=function(n){let e=[],t=0,r=0;for(;t<n.length;){let i=n[t++];if(i<128)e[r++]=String.fromCharCode(i);else if(i>191&&i<224){let o=n[t++];e[r++]=String.fromCharCode((i&31)<<6|o&63)}else if(i>239&&i<365){let o=n[t++],s=n[t++],a=n[t++],c=((i&7)<<18|(o&63)<<12|(s&63)<<6|a&63)-65536;e[r++]=String.fromCharCode(55296+(c>>10)),e[r++]=String.fromCharCode(56320+(c&1023))}else{let o=n[t++],s=n[t++];e[r++]=String.fromCharCode((i&15)<<12|(o&63)<<6|s&63)}}return e.join("")},rd={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(n,e){if(!Array.isArray(n))throw Error("encodeByteArray takes an array as a parameter");this.init_();let t=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let i=0;i<n.length;i+=3){let o=n[i],s=i+1<n.length,a=s?n[i+1]:0,c=i+2<n.length,l=c?n[i+2]:0,d=o>>2,h=(o&3)<<4|a>>4,f=(a&15)<<2|l>>6,g=l&63;c||(g=64,s||(f=64)),r.push(t[d],t[h],t[f],t[g])}return r.join("")},encodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(n):this.encodeByteArray(bV(n),e)},decodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(n):HX(this.decodeStringToByteArray(n,e))},decodeStringToByteArray(n,e){this.init_();let t=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let i=0;i<n.length;){let o=t[n.charAt(i++)],a=i<n.length?t[n.charAt(i)]:0;++i;let l=i<n.length?t[n.charAt(i)]:64;++i;let h=i<n.length?t[n.charAt(i)]:64;if(++i,o==null||a==null||l==null||h==null)throw new JD;let f=o<<2|a>>4;if(r.push(f),l!==64){let g=a<<4&240|l>>2;if(r.push(g),h!==64){let E=l<<6&192|h;r.push(E)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let n=0;n<this.ENCODED_VALS.length;n++)this.byteToCharMap_[n]=this.ENCODED_VALS.charAt(n),this.charToByteMap_[this.byteToCharMap_[n]]=n,this.byteToCharMapWebSafe_[n]=this.ENCODED_VALS_WEBSAFE.charAt(n),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[n]]=n,n>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(n)]=n,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(n)]=n)}}},JD=class extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}},eR=function(n){let e=bV(n);return rd.encodeByteArray(e,!0)},rp=function(n){return eR(n).replace(/\./g,"")},td=function(n){try{return rd.decodeString(n,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};function OV(n){return MV(void 0,n)}function MV(n,e){if(!(e instanceof Object))return e;switch(e.constructor){case Date:let t=e;return new Date(t.getTime());case Object:n===void 0&&(n={});break;case Array:n=[];break;default:return e}for(let t in e)!e.hasOwnProperty(t)||!$X(t)||(n[t]=MV(n[t],e[t]));return n}function $X(n){return n!=="__proto__"}function IT(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}var WX=()=>IT().__FIREBASE_DEFAULTS__,zX=()=>{if(typeof process>"u"||typeof process.env>"u")return;let n=process.env.__FIREBASE_DEFAULTS__;if(n)return JSON.parse(n)},qX=()=>{if(typeof document>"u")return;let n;try{n=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}let e=n&&td(n[1]);return e&&JSON.parse(e)},yT=()=>{try{return RV()||WX()||zX()||qX()}catch(n){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${n}`);return}},LV=n=>{var e,t;return(t=(e=yT())===null||e===void 0?void 0:e.emulatorHosts)===null||t===void 0?void 0:t[n]},id=n=>{let e=LV(n);if(!e)return;let t=e.lastIndexOf(":");if(t<=0||t+1===e.length)throw new Error(`Invalid host ${e} with no separate hostname and port!`);let r=parseInt(e.substring(t+1),10);return e[0]==="["?[e.substring(1,t-1),r]:[e.substring(0,t),r]},tR=()=>{var n;return(n=yT())===null||n===void 0?void 0:n.config},PV=n=>{var e;return(e=yT())===null||e===void 0?void 0:e[`_${n}`]};var sn=class{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(e){return(t,r)=>{t?this.reject(t):this.resolve(r),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(t):e(t,r))}}};function mr(n){try{return(n.startsWith("http://")||n.startsWith("https://")?new URL(n).hostname:n).endsWith(".cloudworkstations.dev")}catch{return!1}}function ws(n){return I(this,null,function*(){return(yield fetch(n,{credentials:"include"})).ok})}function vT(n,e){if(n.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');let t={alg:"none",type:"JWT"},r=e||"demo-project",i=n.iat||0,o=n.sub||n.user_id;if(!o)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");let s=Object.assign({iss:`https://securetoken.google.com/${r}`,aud:r,iat:i,exp:i+3600,auth_time:i,sub:o,user_id:o,firebase:{sign_in_provider:"custom",identities:{}}},n);return[rp(JSON.stringify(t)),rp(JSON.stringify(s)),""].join(".")}var np={};function KX(){let n={prod:[],emulator:[]};for(let e of Object.keys(np))np[e]?n.emulator.push(e):n.prod.push(e);return n}function YX(n){let e=document.getElementById(n),t=!1;return e||(e=document.createElement("div"),e.setAttribute("id",n),t=!0),{created:t,element:e}}var NV=!1;function Oc(n,e){if(typeof window>"u"||typeof document>"u"||!mr(window.location.host)||np[n]===e||np[n]||NV)return;np[n]=e;function t(f){return`__firebase__banner__${f}`}let r="__firebase__banner",o=KX().prod.length>0;function s(){let f=document.getElementById(r);f&&f.remove()}function a(f){f.style.display="flex",f.style.background="#7faaf0",f.style.position="fixed",f.style.bottom="5px",f.style.left="5px",f.style.padding=".5em",f.style.borderRadius="5px",f.style.alignItems="center"}function c(f,g){f.setAttribute("width","24"),f.setAttribute("id",g),f.setAttribute("height","24"),f.setAttribute("viewBox","0 0 24 24"),f.setAttribute("fill","none"),f.style.marginLeft="-6px"}function l(){let f=document.createElement("span");return f.style.cursor="pointer",f.style.marginLeft="16px",f.style.fontSize="24px",f.innerHTML=" ×",f.onclick=()=>{NV=!0,s()},f}function d(f,g){f.setAttribute("id",g),f.innerText="Learn more",f.href="https://firebase.google.com/docs/studio/preview-apps#preview-backend",f.setAttribute("target","__blank"),f.style.paddingLeft="5px",f.style.textDecoration="underline"}function h(){let f=YX(r),g=t("text"),E=document.getElementById(g)||document.createElement("span"),v=t("learnmore"),S=document.getElementById(v)||document.createElement("a"),P=t("preprendIcon"),V=document.getElementById(P)||document.createElementNS("http://www.w3.org/2000/svg","svg");if(f.created){let K=f.element;a(K),d(S,v);let oe=l();c(V,P),K.append(V,E,S,oe),document.body.appendChild(K)}o?(E.innerText="Preview backend disconnected.",V.innerHTML=`<g clip-path="url(#clip0_6013_33858)">
|
|
125
|
+
<path d="M4.8 17.6L12 5.6L19.2 17.6H4.8ZM6.91667 16.4H17.0833L12 7.93333L6.91667 16.4ZM12 15.6C12.1667 15.6 12.3056 15.5444 12.4167 15.4333C12.5389 15.3111 12.6 15.1667 12.6 15C12.6 14.8333 12.5389 14.6944 12.4167 14.5833C12.3056 14.4611 12.1667 14.4 12 14.4C11.8333 14.4 11.6889 14.4611 11.5667 14.5833C11.4556 14.6944 11.4 14.8333 11.4 15C11.4 15.1667 11.4556 15.3111 11.5667 15.4333C11.6889 15.5444 11.8333 15.6 12 15.6ZM11.4 13.6H12.6V10.4H11.4V13.6Z" fill="#212121"/>
|
|
126
|
+
</g>
|
|
127
|
+
<defs>
|
|
128
|
+
<clipPath id="clip0_6013_33858">
|
|
129
|
+
<rect width="24" height="24" fill="white"/>
|
|
130
|
+
</clipPath>
|
|
131
|
+
</defs>`):(V.innerHTML=`<g clip-path="url(#clip0_6083_34804)">
|
|
132
|
+
<path d="M11.4 15.2H12.6V11.2H11.4V15.2ZM12 10C12.1667 10 12.3056 9.94444 12.4167 9.83333C12.5389 9.71111 12.6 9.56667 12.6 9.4C12.6 9.23333 12.5389 9.09444 12.4167 8.98333C12.3056 8.86111 12.1667 8.8 12 8.8C11.8333 8.8 11.6889 8.86111 11.5667 8.98333C11.4556 9.09444 11.4 9.23333 11.4 9.4C11.4 9.56667 11.4556 9.71111 11.5667 9.83333C11.6889 9.94444 11.8333 10 12 10ZM12 18.4C11.1222 18.4 10.2944 18.2333 9.51667 17.9C8.73889 17.5667 8.05556 17.1111 7.46667 16.5333C6.88889 15.9444 6.43333 15.2611 6.1 14.4833C5.76667 13.7056 5.6 12.8778 5.6 12C5.6 11.1111 5.76667 10.2833 6.1 9.51667C6.43333 8.73889 6.88889 8.06111 7.46667 7.48333C8.05556 6.89444 8.73889 6.43333 9.51667 6.1C10.2944 5.76667 11.1222 5.6 12 5.6C12.8889 5.6 13.7167 5.76667 14.4833 6.1C15.2611 6.43333 15.9389 6.89444 16.5167 7.48333C17.1056 8.06111 17.5667 8.73889 17.9 9.51667C18.2333 10.2833 18.4 11.1111 18.4 12C18.4 12.8778 18.2333 13.7056 17.9 14.4833C17.5667 15.2611 17.1056 15.9444 16.5167 16.5333C15.9389 17.1111 15.2611 17.5667 14.4833 17.9C13.7167 18.2333 12.8889 18.4 12 18.4ZM12 17.2C13.4444 17.2 14.6722 16.6944 15.6833 15.6833C16.6944 14.6722 17.2 13.4444 17.2 12C17.2 10.5556 16.6944 9.32778 15.6833 8.31667C14.6722 7.30555 13.4444 6.8 12 6.8C10.5556 6.8 9.32778 7.30555 8.31667 8.31667C7.30556 9.32778 6.8 10.5556 6.8 12C6.8 13.4444 7.30556 14.6722 8.31667 15.6833C9.32778 16.6944 10.5556 17.2 12 17.2Z" fill="#212121"/>
|
|
133
|
+
</g>
|
|
134
|
+
<defs>
|
|
135
|
+
<clipPath id="clip0_6083_34804">
|
|
136
|
+
<rect width="24" height="24" fill="white"/>
|
|
137
|
+
</clipPath>
|
|
138
|
+
</defs>`,E.innerText="Preview backend running in this workspace."),E.setAttribute("id",g)}document.readyState==="loading"?window.addEventListener("DOMContentLoaded",h):h()}function Kt(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function ip(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(Kt())}function xV(){var n;let e=(n=yT())===null||n===void 0?void 0:n.forceEnvironment;if(e==="node")return!0;if(e==="browser")return!1;try{return Object.prototype.toString.call(global.process)==="[object process]"}catch{return!1}}function kV(){return typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"}function FV(){let n=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof n=="object"&&n.id!==void 0}function ST(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function UV(){let n=Kt();return n.indexOf("MSIE ")>=0||n.indexOf("Trident/")>=0}function zi(){return QD.NODE_CLIENT===!0||QD.NODE_ADMIN===!0}function nR(){return!xV()&&!!navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function rR(){return!xV()&&!!navigator.userAgent&&(navigator.userAgent.includes("Safari")||navigator.userAgent.includes("WebKit"))&&!navigator.userAgent.includes("Chrome")}function od(){try{return typeof indexedDB=="object"}catch{return!1}}function VV(){return new Promise((n,e)=>{try{let t=!0,r="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(r);i.onsuccess=()=>{i.result.close(),t||self.indexedDB.deleteDatabase(r),n(!0)},i.onupgradeneeded=()=>{t=!1},i.onerror=()=>{var o;e(((o=i.error)===null||o===void 0?void 0:o.message)||"")}}catch(t){e(t)}})}var XX="FirebaseError",Xn=class n extends Error{constructor(e,t,r){super(t),this.code=e,this.customData=r,this.name=XX,Object.setPrototypeOf(this,n.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,ni.prototype.create)}},ni=class{constructor(e,t,r){this.service=e,this.serviceName=t,this.errors=r}create(e,...t){let r=t[0]||{},i=`${this.service}/${e}`,o=this.errors[e],s=o?QX(o,r):"Error",a=`${this.serviceName}: ${s} (${i}).`;return new Xn(i,a,r)}};function QX(n,e){return n.replace(JX,(t,r)=>{let i=e[r];return i!=null?String(i):`<${r}?>`})}var JX=/\{\$([^}]+)}/g;function nd(n){return JSON.parse(n)}function xt(n){return JSON.stringify(n)}var BV=function(n){let e={},t={},r={},i="";try{let o=n.split(".");e=nd(td(o[0])||""),t=nd(td(o[1])||""),i=o[2],r=t.d||{},delete t.d}catch{}return{header:e,claims:t,data:r,signature:i}};var GV=function(n){let e=BV(n),t=e.claims;return!!t&&typeof t=="object"&&t.hasOwnProperty("iat")},jV=function(n){let e=BV(n).claims;return typeof e=="object"&&e.admin===!0};function Fr(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function bs(n,e){if(Object.prototype.hasOwnProperty.call(n,e))return n[e]}function op(n){for(let e in n)if(Object.prototype.hasOwnProperty.call(n,e))return!1;return!0}function sp(n,e,t){let r={};for(let i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=e.call(t,n[i],i,n));return r}function ri(n,e){if(n===e)return!0;let t=Object.keys(n),r=Object.keys(e);for(let i of t){if(!r.includes(i))return!1;let o=n[i],s=e[i];if(wV(o)&&wV(s)){if(!ri(o,s))return!1}else if(o!==s)return!1}for(let i of r)if(!t.includes(i))return!1;return!0}function wV(n){return n!==null&&typeof n=="object"}function ap(n){let e=[];for(let[t,r]of Object.entries(n))Array.isArray(r)?r.forEach(i=>{e.push(encodeURIComponent(t)+"="+encodeURIComponent(i))}):e.push(encodeURIComponent(t)+"="+encodeURIComponent(r));return e.length?"&"+e.join("&"):""}var TT=class{constructor(){this.chain_=[],this.buf_=[],this.W_=[],this.pad_=[],this.inbuf_=0,this.total_=0,this.blockSize=512/8,this.pad_[0]=128;for(let e=1;e<this.blockSize;++e)this.pad_[e]=0;this.reset()}reset(){this.chain_[0]=1732584193,this.chain_[1]=4023233417,this.chain_[2]=2562383102,this.chain_[3]=271733878,this.chain_[4]=3285377520,this.inbuf_=0,this.total_=0}compress_(e,t){t||(t=0);let r=this.W_;if(typeof e=="string")for(let h=0;h<16;h++)r[h]=e.charCodeAt(t)<<24|e.charCodeAt(t+1)<<16|e.charCodeAt(t+2)<<8|e.charCodeAt(t+3),t+=4;else for(let h=0;h<16;h++)r[h]=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3],t+=4;for(let h=16;h<80;h++){let f=r[h-3]^r[h-8]^r[h-14]^r[h-16];r[h]=(f<<1|f>>>31)&4294967295}let i=this.chain_[0],o=this.chain_[1],s=this.chain_[2],a=this.chain_[3],c=this.chain_[4],l,d;for(let h=0;h<80;h++){h<40?h<20?(l=a^o&(s^a),d=1518500249):(l=o^s^a,d=1859775393):h<60?(l=o&s|a&(o|s),d=2400959708):(l=o^s^a,d=3395469782);let f=(i<<5|i>>>27)+l+c+d+r[h]&4294967295;c=a,a=s,s=(o<<30|o>>>2)&4294967295,o=i,i=f}this.chain_[0]=this.chain_[0]+i&4294967295,this.chain_[1]=this.chain_[1]+o&4294967295,this.chain_[2]=this.chain_[2]+s&4294967295,this.chain_[3]=this.chain_[3]+a&4294967295,this.chain_[4]=this.chain_[4]+c&4294967295}update(e,t){if(e==null)return;t===void 0&&(t=e.length);let r=t-this.blockSize,i=0,o=this.buf_,s=this.inbuf_;for(;i<t;){if(s===0)for(;i<=r;)this.compress_(e,i),i+=this.blockSize;if(typeof e=="string"){for(;i<t;)if(o[s]=e.charCodeAt(i),++s,++i,s===this.blockSize){this.compress_(o),s=0;break}}else for(;i<t;)if(o[s]=e[i],++s,++i,s===this.blockSize){this.compress_(o),s=0;break}}this.inbuf_=s,this.total_+=t}digest(){let e=[],t=this.total_*8;this.inbuf_<56?this.update(this.pad_,56-this.inbuf_):this.update(this.pad_,this.blockSize-(this.inbuf_-56));for(let i=this.blockSize-1;i>=56;i--)this.buf_[i]=t&255,t/=256;this.compress_(this.buf_);let r=0;for(let i=0;i<5;i++)for(let o=24;o>=0;o-=8)e[r]=this.chain_[i]>>o&255,++r;return e}};function HV(n,e){let t=new ZD(n,e);return t.subscribe.bind(t)}var ZD=class{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(()=>{e(this)}).catch(r=>{this.error(r)})}next(e){this.forEachObserver(t=>{t.next(e)})}error(e){this.forEachObserver(t=>{t.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,t,r){let i;if(e===void 0&&t===void 0&&r===void 0)throw new Error("Missing Observer.");ZX(e,["next","error","complete"])?i=e:i={next:e,error:t,complete:r},i.next===void 0&&(i.next=XD),i.error===void 0&&(i.error=XD),i.complete===void 0&&(i.complete=XD);let o=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?i.error(this.finalError):i.complete()}catch{}}),this.observers.push(i),o}unsubscribeOne(e){this.observers===void 0||this.observers[e]===void 0||(delete this.observers[e],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t<this.observers.length;t++)this.sendOne(t,e)}sendOne(e,t){this.task.then(()=>{if(this.observers!==void 0&&this.observers[e]!==void 0)try{t(this.observers[e])}catch(r){typeof console<"u"&&console.error&&console.error(r)}})}close(e){this.finalized||(this.finalized=!0,e!==void 0&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}};function ZX(n,e){if(typeof n!="object"||n===null)return!1;for(let t of e)if(t in n&&typeof n[t]=="function")return!0;return!1}function XD(){}function Os(n,e){return`${n} failed: ${e} argument `}var $V=function(n){let e=[],t=0;for(let r=0;r<n.length;r++){let i=n.charCodeAt(r);if(i>=55296&&i<=56319){let o=i-55296;r++,q(r<n.length,"Surrogate pair missing trail surrogate.");let s=n.charCodeAt(r)-56320;i=65536+(o<<10)+s}i<128?e[t++]=i:i<2048?(e[t++]=i>>6|192,e[t++]=i&63|128):i<65536?(e[t++]=i>>12|224,e[t++]=i>>6&63|128,e[t++]=i&63|128):(e[t++]=i>>18|240,e[t++]=i>>12&63|128,e[t++]=i>>6&63|128,e[t++]=i&63|128)}return e},cp=function(n){let e=0;for(let t=0;t<n.length;t++){let r=n.charCodeAt(t);r<128?e++:r<2048?e+=2:r>=55296&&r<=56319?(e+=4,t++):e+=3}return e};var S0e=14400*1e3;function Me(n){return n&&n._delegate?n._delegate:n}var Yt=class{constructor(e,t,r){this.name=e,this.instanceFactory=t,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}};var Mc="[DEFAULT]";var AT=class{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){let t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){let r=new sn;if(this.instancesDeferred.set(t,r),this.isInitialized(t)||this.shouldAutoInitialize())try{let i=this.getOrInitializeService({instanceIdentifier:t});i&&r.resolve(i)}catch{}}return this.instancesDeferred.get(t).promise}getImmediate(e){var t;let r=this.normalizeInstanceIdentifier(e?.identifier),i=(t=e?.optional)!==null&&t!==void 0?t:!1;if(this.isInitialized(r)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:r})}catch(o){if(i)return null;throw o}else{if(i)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,!!this.shouldAutoInitialize()){if(tQ(e))try{this.getOrInitializeService({instanceIdentifier:Mc})}catch{}for(let[t,r]of this.instancesDeferred.entries()){let i=this.normalizeInstanceIdentifier(t);try{let o=this.getOrInitializeService({instanceIdentifier:i});r.resolve(o)}catch{}}}}clearInstance(e=Mc){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}delete(){return I(this,null,function*(){let e=Array.from(this.instances.values());yield Promise.all([...e.filter(t=>"INTERNAL"in t).map(t=>t.INTERNAL.delete()),...e.filter(t=>"_delete"in t).map(t=>t._delete())])})}isComponentSet(){return this.component!=null}isInitialized(e=Mc){return this.instances.has(e)}getOptions(e=Mc){return this.instancesOptions.get(e)||{}}initialize(e={}){let{options:t={}}=e,r=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(r))throw Error(`${this.name}(${r}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);let i=this.getOrInitializeService({instanceIdentifier:r,options:t});for(let[o,s]of this.instancesDeferred.entries()){let a=this.normalizeInstanceIdentifier(o);r===a&&s.resolve(i)}return i}onInit(e,t){var r;let i=this.normalizeInstanceIdentifier(t),o=(r=this.onInitCallbacks.get(i))!==null&&r!==void 0?r:new Set;o.add(e),this.onInitCallbacks.set(i,o);let s=this.instances.get(i);return s&&e(s,i),()=>{o.delete(e)}}invokeOnInitCallbacks(e,t){let r=this.onInitCallbacks.get(t);if(r)for(let i of r)try{i(e,t)}catch{}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let r=this.instances.get(e);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:eQ(e),options:t}),this.instances.set(e,r),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(r,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,r)}catch{}return r||null}normalizeInstanceIdentifier(e=Mc){return this.component?this.component.multipleInstances?e:Mc:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}};function eQ(n){return n===Mc?void 0:n}function tQ(n){return n.instantiationMode==="EAGER"}var lp=class{constructor(e){this.name=e,this.providers=new Map}addComponent(e){let 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);let t=new AT(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}};var WV=[],Re=(function(n){return n[n.DEBUG=0]="DEBUG",n[n.VERBOSE=1]="VERBOSE",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.SILENT=5]="SILENT",n})(Re||{}),nQ={debug:Re.DEBUG,verbose:Re.VERBOSE,info:Re.INFO,warn:Re.WARN,error:Re.ERROR,silent:Re.SILENT},rQ=Re.INFO,iQ={[Re.DEBUG]:"log",[Re.VERBOSE]:"log",[Re.INFO]:"info",[Re.WARN]:"warn",[Re.ERROR]:"error"},oQ=(n,e,...t)=>{if(e<n.logLevel)return;let r=new Date().toISOString(),i=iQ[e];if(i)console[i](`[${r}] ${n.name}:`,...t);else throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`)},Ur=class{constructor(e){this.name=e,this._logLevel=rQ,this._logHandler=oQ,this._userLogHandler=null,WV.push(this)}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in Re))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel=typeof e=="string"?nQ[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if(typeof e!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,Re.DEBUG,...e),this._logHandler(this,Re.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,Re.VERBOSE,...e),this._logHandler(this,Re.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,Re.INFO,...e),this._logHandler(this,Re.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,Re.WARN,...e),this._logHandler(this,Re.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,Re.ERROR,...e),this._logHandler(this,Re.ERROR,...e)}};function zV(n){WV.forEach(e=>{e.setLogLevel(n)})}var sQ=(n,e)=>e.some(t=>n instanceof t),qV,KV;function aQ(){return qV||(qV=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function cQ(){return KV||(KV=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}var YV=new WeakMap,oR=new WeakMap,XV=new WeakMap,iR=new WeakMap,aR=new WeakMap;function lQ(n){let e=new Promise((t,r)=>{let i=()=>{n.removeEventListener("success",o),n.removeEventListener("error",s)},o=()=>{t(qi(n.result)),i()},s=()=>{r(n.error),i()};n.addEventListener("success",o),n.addEventListener("error",s)});return e.then(t=>{t instanceof IDBCursor&&YV.set(t,n)}).catch(()=>{}),aR.set(e,n),e}function uQ(n){if(oR.has(n))return;let e=new Promise((t,r)=>{let i=()=>{n.removeEventListener("complete",o),n.removeEventListener("error",s),n.removeEventListener("abort",s)},o=()=>{t(),i()},s=()=>{r(n.error||new DOMException("AbortError","AbortError")),i()};n.addEventListener("complete",o),n.addEventListener("error",s),n.addEventListener("abort",s)});oR.set(n,e)}var sR={get(n,e,t){if(n instanceof IDBTransaction){if(e==="done")return oR.get(n);if(e==="objectStoreNames")return n.objectStoreNames||XV.get(n);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return qi(n[e])},set(n,e,t){return n[e]=t,!0},has(n,e){return n instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in n}};function QV(n){sR=n(sR)}function dQ(n){return n===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...t){let r=n.call(CT(this),e,...t);return XV.set(r,e.sort?e.sort():[e]),qi(r)}:cQ().includes(n)?function(...e){return n.apply(CT(this),e),qi(YV.get(this))}:function(...e){return qi(n.apply(CT(this),e))}}function hQ(n){return typeof n=="function"?dQ(n):(n instanceof IDBTransaction&&uQ(n),sQ(n,aQ())?new Proxy(n,sR):n)}function qi(n){if(n instanceof IDBRequest)return lQ(n);if(iR.has(n))return iR.get(n);let e=hQ(n);return e!==n&&(iR.set(n,e),aR.set(e,n)),e}var CT=n=>aR.get(n);function ZV(n,e,{blocked:t,upgrade:r,blocking:i,terminated:o}={}){let s=indexedDB.open(n,e),a=qi(s);return r&&s.addEventListener("upgradeneeded",c=>{r(qi(s.result),c.oldVersion,c.newVersion,qi(s.transaction),c)}),t&&s.addEventListener("blocked",c=>t(c.oldVersion,c.newVersion,c)),a.then(c=>{o&&c.addEventListener("close",()=>o()),i&&c.addEventListener("versionchange",l=>i(l.oldVersion,l.newVersion,l))}).catch(()=>{}),a}var fQ=["get","getKey","getAll","getAllKeys","count"],pQ=["put","add","delete","clear"],cR=new Map;function JV(n,e){if(!(n instanceof IDBDatabase&&!(e in n)&&typeof e=="string"))return;if(cR.get(e))return cR.get(e);let t=e.replace(/FromIndex$/,""),r=e!==t,i=pQ.includes(t);if(!(t in(r?IDBIndex:IDBObjectStore).prototype)||!(i||fQ.includes(t)))return;let o=function(s,...a){return I(this,null,function*(){let c=this.transaction(s,i?"readwrite":"readonly"),l=c.store;return r&&(l=l.index(a.shift())),(yield Promise.all([l[t](...a),i&&c.done]))[0]})};return cR.set(e,o),o}QV(n=>ye($({},n),{get:(e,t,r)=>JV(e,t)||n.get(e,t,r),has:(e,t)=>!!JV(e,t)||n.has(e,t)}));var uR=class{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(t=>{if(gQ(t)){let r=t.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(t=>t).join(" ")}};function gQ(n){let e=n.getComponent();return e?.type==="VERSION"}var dR="@firebase/app",eB="0.13.2";var ko=new Ur("@firebase/app"),mQ="@firebase/app-compat",EQ="@firebase/analytics-compat",_Q="@firebase/analytics",TQ="@firebase/app-check-compat",IQ="@firebase/app-check",yQ="@firebase/auth",vQ="@firebase/auth-compat",SQ="@firebase/database",AQ="@firebase/data-connect",CQ="@firebase/database-compat",DQ="@firebase/functions",RQ="@firebase/functions-compat",NQ="@firebase/installations",wQ="@firebase/installations-compat",bQ="@firebase/messaging",OQ="@firebase/messaging-compat",MQ="@firebase/performance",LQ="@firebase/performance-compat",PQ="@firebase/remote-config",xQ="@firebase/remote-config-compat",kQ="@firebase/storage",FQ="@firebase/storage-compat",UQ="@firebase/firestore",VQ="@firebase/ai",BQ="@firebase/firestore-compat",GQ="firebase",jQ="11.10.0";var hR="[DEFAULT]",HQ={[dR]:"fire-core",[mQ]:"fire-core-compat",[_Q]:"fire-analytics",[EQ]:"fire-analytics-compat",[IQ]:"fire-app-check",[TQ]:"fire-app-check-compat",[yQ]:"fire-auth",[vQ]:"fire-auth-compat",[SQ]:"fire-rtdb",[AQ]:"fire-data-connect",[CQ]:"fire-rtdb-compat",[DQ]:"fire-fn",[RQ]:"fire-fn-compat",[NQ]:"fire-iid",[wQ]:"fire-iid-compat",[bQ]:"fire-fcm",[OQ]:"fire-fcm-compat",[MQ]:"fire-perf",[LQ]:"fire-perf-compat",[PQ]:"fire-rc",[xQ]:"fire-rc-compat",[kQ]:"fire-gcs",[FQ]:"fire-gcs-compat",[UQ]:"fire-fst",[BQ]:"fire-fst-compat",[VQ]:"fire-vertex","fire-js":"fire-js",[GQ]:"fire-js-all"};var up=new Map,$Q=new Map,fR=new Map;function tB(n,e){try{n.container.addComponent(e)}catch(t){ko.debug(`Component ${e.name} failed to register with FirebaseApp ${n.name}`,t)}}function jn(n){let e=n.name;if(fR.has(e))return ko.debug(`There were multiple attempts to register component ${e}.`),!1;fR.set(e,n);for(let t of up.values())tB(t,n);for(let t of $Q.values())tB(t,n);return!0}function Ki(n,e){let t=n.container.getProvider("heartbeat").getImmediate({optional:!0});return t&&t.triggerHeartbeat(),n.container.getProvider(e)}function Qn(n){return n==null?!1:n.settings!==void 0}var WQ={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."},Ms=new ni("app","Firebase",WQ);var pR=class{constructor(e,t,r){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new Yt("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 Ms.create("app-deleted",{appName:this._name})}};var Ls=jQ;function ER(n,e={}){let t=n;typeof e!="object"&&(e={name:e});let r=Object.assign({name:hR,automaticDataCollectionEnabled:!0},e),i=r.name;if(typeof i!="string"||!i)throw Ms.create("bad-app-name",{appName:String(i)});if(t||(t=tR()),!t)throw Ms.create("no-options");let o=up.get(i);if(o){if(ri(t,o.options)&&ri(r,o.config))return o;throw Ms.create("duplicate-app",{appName:i})}let s=new lp(i);for(let c of fR.values())s.addComponent(c);let a=new pR(t,r,s);return up.set(i,a),a}function Jn(n=hR){let e=up.get(n);if(!e&&n===hR&&tR())return ER();if(!e)throw Ms.create("no-app",{appName:n});return e}function DT(){return Array.from(up.values())}function Be(n,e,t){var r;let i=(r=HQ[n])!==null&&r!==void 0?r:n;t&&(i+=`-${t}`);let o=i.match(/\s|\//),s=e.match(/\s|\//);if(o||s){let a=[`Unable to register library "${i}" with version "${e}":`];o&&a.push(`library name "${i}" contains illegal characters (whitespace or "/")`),o&&s&&a.push("and"),s&&a.push(`version name "${e}" contains illegal characters (whitespace or "/")`),ko.warn(a.join(" "));return}jn(new Yt(`${i}-version`,()=>({library:i,version:e}),"VERSION"))}function zQ(n){zV(n)}var qQ="firebase-heartbeat-database",KQ=1,dp="firebase-heartbeat-store",lR=null;function oB(){return lR||(lR=ZV(qQ,KQ,{upgrade:(n,e)=>{switch(e){case 0:try{n.createObjectStore(dp)}catch(t){console.warn(t)}}}}).catch(n=>{throw Ms.create("idb-open",{originalErrorMessage:n.message})})),lR}function YQ(n){return I(this,null,function*(){try{let t=(yield oB()).transaction(dp),r=yield t.objectStore(dp).get(sB(n));return yield t.done,r}catch(e){if(e instanceof Xn)ko.warn(e.message);else{let t=Ms.create("idb-get",{originalErrorMessage:e?.message});ko.warn(t.message)}}})}function nB(n,e){return I(this,null,function*(){try{let r=(yield oB()).transaction(dp,"readwrite");yield r.objectStore(dp).put(e,sB(n)),yield r.done}catch(t){if(t instanceof Xn)ko.warn(t.message);else{let r=Ms.create("idb-set",{originalErrorMessage:t?.message});ko.warn(r.message)}}})}function sB(n){return`${n.name}!${n.options.appId}`}var XQ=1024,QQ=30,gR=class{constructor(e){this.container=e,this._heartbeatsCache=null;let t=this.container.getProvider("app").getImmediate();this._storage=new mR(t),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}triggerHeartbeat(){return I(this,null,function*(){var e,t;try{let i=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),o=rB();if(((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null&&(this._heartbeatsCache=yield this._heartbeatsCachePromise,((t=this._heartbeatsCache)===null||t===void 0?void 0:t.heartbeats)==null)||this._heartbeatsCache.lastSentHeartbeatDate===o||this._heartbeatsCache.heartbeats.some(s=>s.date===o))return;if(this._heartbeatsCache.heartbeats.push({date:o,agent:i}),this._heartbeatsCache.heartbeats.length>QQ){let s=ZQ(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(s,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(r){ko.warn(r)}})}getHeartbeatsHeader(){return I(this,null,function*(){var e;try{if(this._heartbeatsCache===null&&(yield this._heartbeatsCachePromise),((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";let t=rB(),{heartbeatsToSend:r,unsentEntries:i}=JQ(this._heartbeatsCache.heartbeats),o=rp(JSON.stringify({version:2,heartbeats:r}));return this._heartbeatsCache.lastSentHeartbeatDate=t,i.length>0?(this._heartbeatsCache.heartbeats=i,yield this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),o}catch(t){return ko.warn(t),""}})}};function rB(){return new Date().toISOString().substring(0,10)}function JQ(n,e=XQ){let t=[],r=n.slice();for(let i of n){let o=t.find(s=>s.agent===i.agent);if(o){if(o.dates.push(i.date),iB(t)>e){o.dates.pop();break}}else if(t.push({agent:i.agent,dates:[i.date]}),iB(t)>e){t.pop();break}r=r.slice(1)}return{heartbeatsToSend:t,unsentEntries:r}}var mR=class{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}runIndexedDBEnvironmentCheck(){return I(this,null,function*(){return od()?VV().then(()=>!0).catch(()=>!1):!1})}read(){return I(this,null,function*(){if(yield this._canUseIndexedDBPromise){let t=yield YQ(this.app);return t?.heartbeats?t:{heartbeats:[]}}else return{heartbeats:[]}})}overwrite(e){return I(this,null,function*(){var t;if(yield this._canUseIndexedDBPromise){let i=yield this.read();return nB(this.app,{lastSentHeartbeatDate:(t=e.lastSentHeartbeatDate)!==null&&t!==void 0?t:i.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return})}add(e){return I(this,null,function*(){var t;if(yield this._canUseIndexedDBPromise){let i=yield this.read();return nB(this.app,{lastSentHeartbeatDate:(t=e.lastSentHeartbeatDate)!==null&&t!==void 0?t:i.lastSentHeartbeatDate,heartbeats:[...i.heartbeats,...e.heartbeats]})}else return})}};function iB(n){return rp(JSON.stringify({version:2,heartbeats:n})).length}function ZQ(n){if(n.length===0)return-1;let e=0,t=n[0].date;for(let r=1;r<n.length;r++)n[r].date<t&&(t=n[r].date,e=r);return e}function eJ(n){jn(new Yt("platform-logger",e=>new uR(e),"PRIVATE")),jn(new Yt("heartbeat",e=>new gR(e),"PRIVATE")),Be(dR,eB,n),Be(dR,eB,"esm2017"),Be("fire-js","")}eJ("");var tJ="firebase",nJ="11.10.0";Be(tJ,nJ,"app");function eMe(n){n||(n=Y(Gn));let e=new fe(t=>{if(n.destroyed){t.next();return}return n.onDestroy(t.next.bind(t))});return t=>t.pipe(us(e))}function tMe(n,e){let t=e?.injector??Y(We),r=new $a(1),i=rD(()=>{let o;try{o=n()}catch(s){Lf(()=>r.error(s));return}Lf(()=>r.next(o))},{injector:t,manualCleanup:!0});return t.get(Gn).onDestroy(()=>{i.destroy(),r.complete()}),r.asObservable()}function nMe(n,e){let r=!e?.manualCleanup?e?.injector?.get(Gn)??Y(Gn):null,i=rJ(e?.equal),o;e?.requireSync?o=dc({kind:0},{equal:i}):o=dc({kind:1,value:e?.initialValue},{equal:i});let s,a=n.subscribe({next:c=>o.set({kind:1,value:c}),error:c=>{o.set({kind:2,error:c}),s?.()},complete:()=>{s?.()}});if(e?.requireSync&&o().kind===0)throw new J(601,!1);return s=r?.onDestroy(a.unsubscribe.bind(a)),Pf(()=>{let c=o();switch(c.kind){case 1:return c.value;case 2:throw c.error;case 0:throw new J(601,!1)}},{equal:e?.equal})}function rJ(n=Object.is){return(e,t)=>e.kind===1&&t.kind===1&&n(e.value,t.value)}function aB(n){n===void 0&&(n=Y(We));let e=n.get(xi);return t=>new fe(r=>{let i=e.add(),o=!1;function s(){o||(i(),o=!0)}let a=t.subscribe({next:c=>{r.next(c),s()},complete:()=>{r.complete(),s()},error:c=>{r.error(c),s()}});return a.add(()=>{r.unsubscribe(),s()}),a})}var ii=new Xa("ANGULARFIRE2_VERSION");function Ps(n,e,t){if(e){if(e.length===1)return e[0];let o=e.filter(s=>s.app===t);if(o.length===1)return o[0]}return t.container.getProvider(n).getImmediate({optional:!0})}var Fo=(n,e)=>{let t=e?[e]:DT(),r=[];return t.forEach(i=>{i.container.getProvider(n).instances.forEach(s=>{r.includes(s)||r.push(s)})}),r},sd=(function(n){return n[n.SILENT=0]="SILENT",n[n.WARN=1]="WARN",n[n.VERBOSE=2]="VERBOSE",n})(sd||{}),cB=pD()&&typeof Zone<"u"?sd.WARN:sd.SILENT;var RT=class{zone;delegate;constructor(e,t=cS){this.zone=e,this.delegate=t}now(){return this.delegate.now()}schedule(e,t,r){let i=this.zone,o=function(s){i?i.runGuarded(()=>{e.apply(this,[s])}):e.apply(this,[s])};return this.delegate.schedule(o,t,r)}},oi=(()=>{class n{outsideAngular;insideAngular;constructor(){let t=Y(Ae);this.outsideAngular=t.runOutsideAngular(()=>new RT(typeof Zone>"u"?void 0:Zone.current)),this.insideAngular=t.run(()=>new RT(typeof Zone>"u"?void 0:Zone.current,vn))}static \u0275fac=function(r){return new(r||n)};static \u0275prov=Q({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),lB=!1;function iJ(n,e){!lB&&(cB>sd.SILENT||pD())&&(lB=!0,console.warn("Calling Firebase APIs outside of an Injection context may destabilize your application leading to subtle change-detection and hydration bugs. Find more at https://github.com/angular/angularfire/blob/main/docs/zones.md")),cB>=e&&console.warn(`Firebase API called outside injection context: ${n.name}`)}function oJ(n){let e=Y(Ae,{optional:!0});return e?e.runOutsideAngular(()=>n()):n()}function Lc(n){let e=Y(Ae,{optional:!0});return e?e.run(()=>n()):n()}var sJ=(n,e,t)=>(...r)=>(e&&setTimeout(e,0),Ni(t,()=>Lc(()=>n.apply(void 0,r)))),ue=(n,e,t)=>(t||=e?sd.WARN:sd.VERBOSE,function(){let r,i=arguments,o,s,a;try{o=Y(oi),s=Y(xi),a=Y(Dn)}catch{return iJ(n,t),n.apply(this,i)}for(let l=0;l<arguments.length;l++)typeof i[l]=="function"&&(e&&(r||=Lc(()=>s.add())),i[l]=sJ(i[l],r,a));let c=oJ(()=>n.apply(this,i));return e?c instanceof fe?c.pipe(cs(o.outsideAngular),as(o.insideAngular),aB(a)):c instanceof Promise?Lc(()=>{let l=s.add();return new Promise((d,h)=>{c.then(f=>Ni(a,()=>Lc(()=>d(f))),f=>Ni(a,()=>Lc(()=>h(f)))).finally(l)})}):typeof c=="function"&&r?function(){return setTimeout(r,0),c.apply(this,arguments)}:Lc(()=>c):c instanceof fe?c.pipe(cs(o.outsideAngular),as(o.insideAngular)):Lc(()=>c)});var si=class{constructor(e){return e}},Uo=class{constructor(){return DT()}};function aJ(n){return n&&n.length===1?n[0]:new si(Jn())}var _R=new z("angularfire2._apps"),cJ={provide:si,useFactory:aJ,deps:[[new zt,_R]]},lJ={provide:Uo,deps:[[new zt,_R]]};function uJ(n){return(e,t)=>{let r=t.get(wo);Be("angularfire",ii.full,"core"),Be("angularfire",ii.full,"app"),Be("angular",IS.full,r.toString());let i=e.runOutsideAngular(()=>n(t));return new si(i)}}function IMe(n,...e){return qn([cJ,lJ,{provide:_R,useFactory:uJ(n),multi:!0,deps:[Ae,We,oi,...e]}])}var yMe=ue(Jn,!0);var vMe=ue(ER,!0);var dJ=new Map,hJ={activated:!1,tokenObservers:[]},fJ={initialized:!1,enabled:!1};function ai(n){return dJ.get(n)||Object.assign({},hJ)}function fB(){return fJ}var pJ="https://content-firebaseappcheck.googleapis.com/v1";var gJ="exchangeDebugToken",uB={OFFSET_DURATION:300*1e3,RETRIAL_MIN_WAIT:30*1e3,RETRIAL_MAX_WAIT:960*1e3},OMe=1440*60*1e3;var yR=class{constructor(e,t,r,i,o){if(this.operation=e,this.retryPolicy=t,this.getWaitDuration=r,this.lowerBound=i,this.upperBound=o,this.pending=null,this.nextErrorWaitInterval=i,i>o)throw new Error("Proactive refresh lower bound greater than upper bound!")}start(){this.nextErrorWaitInterval=this.lowerBound,this.process(!0).catch(()=>{})}stop(){this.pending&&(this.pending.reject("cancelled"),this.pending=null)}isRunning(){return!!this.pending}process(e){return I(this,null,function*(){this.stop();try{this.pending=new sn,this.pending.promise.catch(t=>{}),yield mJ(this.getNextRun(e)),this.pending.resolve(),yield this.pending.promise,this.pending=new sn,this.pending.promise.catch(t=>{}),yield this.operation(),this.pending.resolve(),yield this.pending.promise,this.process(!0).catch(()=>{})}catch(t){this.retryPolicy(t)?this.process(!1).catch(()=>{}):this.stop()}})}getNextRun(e){if(e)return this.nextErrorWaitInterval=this.lowerBound,this.getWaitDuration();{let t=this.nextErrorWaitInterval;return this.nextErrorWaitInterval*=2,this.nextErrorWaitInterval>this.upperBound&&(this.nextErrorWaitInterval=this.upperBound),t}}};function mJ(n){return new Promise(e=>{setTimeout(e,n)})}var EJ={"already-initialized":"You have already called initializeAppCheck() for FirebaseApp {$appName} with different options. To avoid this error, call initializeAppCheck() with the same options as when it was originally called. This will return the already initialized instance.","use-before-activation":"App Check is being used before initializeAppCheck() is called for FirebaseApp {$appName}. Call initializeAppCheck() before instantiating other Firebase services.","fetch-network-error":"Fetch failed to connect to a network. Check Internet connection. Original error: {$originalErrorMessage}.","fetch-parse-error":"Fetch client could not parse response. Original error: {$originalErrorMessage}.","fetch-status-error":"Fetch server returned an HTTP error status. HTTP status: {$httpStatus}.","storage-open":"Error thrown when opening storage. Original error: {$originalErrorMessage}.","storage-get":"Error thrown when reading from storage. Original error: {$originalErrorMessage}.","storage-set":"Error thrown when writing to storage. Original error: {$originalErrorMessage}.","recaptcha-error":"ReCAPTCHA error.","initial-throttle":"{$httpStatus} error. Attempts allowed again after {$time}",throttled:"Requests throttled due to previous {$httpStatus} error. Attempts allowed again after {$time}"},xs=new ni("appCheck","AppCheck",EJ);function pB(n){if(!ai(n).activated)throw xs.create("use-before-activation",{appName:n.name})}function gB(r,i){return I(this,arguments,function*({url:n,body:e},t){let o={"Content-Type":"application/json"},s=t.getImmediate({optional:!0});if(s){let g=yield s.getHeartbeatsHeader();g&&(o["X-Firebase-Client"]=g)}let a={method:"POST",body:JSON.stringify(e),headers:o},c;try{c=yield fetch(n,a)}catch(g){throw xs.create("fetch-network-error",{originalErrorMessage:g?.message})}if(c.status!==200)throw xs.create("fetch-status-error",{httpStatus:c.status});let l;try{l=yield c.json()}catch(g){throw xs.create("fetch-parse-error",{originalErrorMessage:g?.message})}let d=l.ttl.match(/^([\d.]+)(s)$/);if(!d||!d[2]||isNaN(Number(d[1])))throw xs.create("fetch-parse-error",{originalErrorMessage:`ttl field (timeToLive) is not in standard Protobuf Duration format: ${l.ttl}`});let h=Number(d[1])*1e3,f=Date.now();return{token:l.token,expireTimeMillis:f+h,issuedAtTimeMillis:f}})}function mB(n,e){let{projectId:t,appId:r,apiKey:i}=n.options;return{url:`${pJ}/projects/${t}/apps/${r}:${gJ}?key=${i}`,body:{debug_token:e}}}var _J="firebase-app-check-database",TJ=1,vR="firebase-app-check-store";var NT=null;function IJ(){return NT||(NT=new Promise((n,e)=>{try{let t=indexedDB.open(_J,TJ);t.onsuccess=r=>{n(r.target.result)},t.onerror=r=>{var i;e(xs.create("storage-open",{originalErrorMessage:(i=r.target.error)===null||i===void 0?void 0:i.message}))},t.onupgradeneeded=r=>{let i=r.target.result;r.oldVersion===0&&i.createObjectStore(vR,{keyPath:"compositeKey"})}}catch(t){e(xs.create("storage-open",{originalErrorMessage:t?.message}))}}),NT)}function yJ(n,e){return vJ(SJ(n),e)}function vJ(n,e){return I(this,null,function*(){let r=(yield IJ()).transaction(vR,"readwrite"),o=r.objectStore(vR).put({compositeKey:n,value:e});return new Promise((s,a)=>{o.onsuccess=c=>{s()},r.onerror=c=>{var l;a(xs.create("storage-set",{originalErrorMessage:(l=c.target.error)===null||l===void 0?void 0:l.message}))}})})}function SJ(n){return`${n.options.appId}-${n.name}`}var hp=new Ur("@firebase/app-check");function TR(n,e){return od()?yJ(n,e).catch(t=>{hp.warn(`Failed to write token to IndexedDB. Error: ${t}`)}):Promise.resolve()}function EB(){return fB().enabled}function _B(){return I(this,null,function*(){let n=fB();if(n.enabled&&n.token)return n.token.promise;throw Error(`
|
|
139
|
+
Can't get debug token in production mode.
|
|
140
|
+
`)})}var AJ={error:"UNKNOWN_ERROR"};function CJ(n){return rd.encodeString(JSON.stringify(n),!1)}function SR(n,e=!1,t=!1){return I(this,null,function*(){let r=n.app;pB(r);let i=ai(r),o=i.token,s;if(o&&!fp(o)&&(i.token=void 0,o=void 0),!o){let l=yield i.cachedTokenPromise;l&&(fp(l)?o=l:yield TR(r,void 0))}if(!e&&o&&fp(o))return{token:o.token};let a=!1;if(EB())try{i.exchangeTokenPromise||(i.exchangeTokenPromise=gB(mB(r,yield _B()),n.heartbeatServiceProvider).finally(()=>{i.exchangeTokenPromise=void 0}),a=!0);let l=yield i.exchangeTokenPromise;return yield TR(r,l),i.token=l,{token:l.token}}catch(l){return l.code==="appCheck/throttled"||l.code==="appCheck/initial-throttle"?hp.warn(l.message):t&&hp.error(l),IR(l)}try{i.exchangeTokenPromise||(i.exchangeTokenPromise=i.provider.getToken().finally(()=>{i.exchangeTokenPromise=void 0}),a=!0),o=yield ai(r).exchangeTokenPromise}catch(l){l.code==="appCheck/throttled"||l.code==="appCheck/initial-throttle"?hp.warn(l.message):t&&hp.error(l),s=l}let c;return o?s?fp(o)?c={token:o.token,internalError:s}:c=IR(s):(c={token:o.token},i.token=o,yield TR(r,o)):c=IR(s),a&&wJ(r,c),c})}function DJ(n){return I(this,null,function*(){let e=n.app;pB(e);let{provider:t}=ai(e);if(EB()){let r=yield _B(),{token:i}=yield gB(mB(e,r),n.heartbeatServiceProvider);return{token:i}}else{let{token:r}=yield t.getToken();return{token:r}}})}function RJ(n,e,t,r){let{app:i}=n,o=ai(i),s={next:t,error:r,type:e};if(o.tokenObservers=[...o.tokenObservers,s],o.token&&fp(o.token)){let a=o.token;Promise.resolve().then(()=>{t({token:a.token}),dB(n)}).catch(()=>{})}o.cachedTokenPromise.then(()=>dB(n))}function TB(n,e){let t=ai(n),r=t.tokenObservers.filter(i=>i.next!==e);r.length===0&&t.tokenRefresher&&t.tokenRefresher.isRunning()&&t.tokenRefresher.stop(),t.tokenObservers=r}function dB(n){let{app:e}=n,t=ai(e),r=t.tokenRefresher;r||(r=NJ(n),t.tokenRefresher=r),!r.isRunning()&&t.isTokenAutoRefreshEnabled&&r.start()}function NJ(n){let{app:e}=n;return new yR(()=>I(null,null,function*(){let t=ai(e),r;if(t.token?r=yield SR(n,!0):r=yield SR(n),r.error)throw r.error;if(r.internalError)throw r.internalError}),()=>!0,()=>{let t=ai(e);if(t.token){let r=t.token.issuedAtTimeMillis+(t.token.expireTimeMillis-t.token.issuedAtTimeMillis)*.5+3e5,i=t.token.expireTimeMillis-300*1e3;return r=Math.min(r,i),Math.max(0,r-Date.now())}else return 0},uB.RETRIAL_MIN_WAIT,uB.RETRIAL_MAX_WAIT)}function wJ(n,e){let t=ai(n).tokenObservers;for(let r of t)try{r.type==="EXTERNAL"&&e.error!=null?r.error(e.error):r.next(e)}catch{}}function fp(n){return n.expireTimeMillis-Date.now()>0}function IR(n){return{token:CJ(AJ),error:n}}var AR=class{constructor(e,t){this.app=e,this.heartbeatServiceProvider=t}_delete(){let{tokenObservers:e}=ai(this.app);for(let t of e)TB(this.app,t.next);return Promise.resolve()}};function bJ(n,e){return new AR(n,e)}function OJ(n){return{getToken:e=>SR(n,e),getLimitedUseToken:()=>DJ(n),addTokenListener:e=>RJ(n,"INTERNAL",e),removeTokenListener:e=>TB(n.app,e)}}var MJ="@firebase/app-check",LJ="0.10.1";var PJ="app-check",hB="app-check-internal";function xJ(){jn(new Yt(PJ,n=>{let e=n.getProvider("app").getImmediate(),t=n.getProvider("heartbeat");return bJ(e,t)},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((n,e,t)=>{n.getProvider(hB).initialize()})),jn(new Yt(hB,n=>{let e=n.getProvider("app-check").getImmediate();return OJ(e)},"PUBLIC").setInstantiationMode("EXPLICIT")),Be(MJ,LJ)}xJ();var kJ="app-check";var ks=class{constructor(){return Fo(kJ)}};var FJ=["localhost","0.0.0.0","127.0.0.1"],$Me=typeof window<"u"&&FJ.includes(window.location.hostname);function bB(){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."}}var OB=bB,MB=new ni("auth","Firebase",bB());var OT=new Ur("@firebase/auth");function UJ(n,...e){OT.logLevel<=Re.WARN&&OT.warn(`Auth (${Ls}): ${n}`,...e)}function bT(n,...e){OT.logLevel<=Re.ERROR&&OT.error(`Auth (${Ls}): ${n}`,...e)}function MT(n,...e){throw VR(n,...e)}function UR(n,...e){return VR(n,...e)}function LB(n,e,t){let r=Object.assign(Object.assign({},OB()),{[e]:t});return new ni("auth","Firebase",r).create(e,{appName:n.name})}function pp(n){return LB(n,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function VR(n,...e){if(typeof n!="string"){let t=e[0],r=[...e.slice(1)];return r[0]&&(r[0].appName=n.name),n._errorFactory.create(t,...r)}return MB.create(n,...e)}function Ge(n,e,...t){if(!n)throw VR(e,...t)}function gp(n){let e="INTERNAL ASSERTION FAILED: "+n;throw bT(e),new Error(e)}function LT(n,e){n||gp(e)}function VJ(){return IB()==="http:"||IB()==="https:"}function IB(){var n;return typeof self<"u"&&((n=self.location)===null||n===void 0?void 0:n.protocol)||null}function BJ(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(VJ()||FV()||"connection"in navigator)?navigator.onLine:!0}function GJ(){if(typeof navigator>"u")return null;let n=navigator;return n.languages&&n.languages[0]||n.language||null}var xc=class{constructor(e,t){this.shortDelay=e,this.longDelay=t,LT(t>e,"Short delay should be less than long delay!"),this.isMobile=ip()||ST()}get(){return BJ()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}};function jJ(n,e){LT(n.emulator,"Emulator should always be set here");let{url:t}=n.emulator;return e?`${t}${e.startsWith("/")?e.slice(1):e}`:t}var PT=class{static initialize(e,t,r){this.fetchImpl=e,t&&(this.headersImpl=t),r&&(this.responseImpl=r)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self<"u"&&"fetch"in self)return self.fetch;if(typeof globalThis<"u"&&globalThis.fetch)return globalThis.fetch;if(typeof fetch<"u")return fetch;gp("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){if(this.headersImpl)return this.headersImpl;if(typeof self<"u"&&"Headers"in self)return self.Headers;if(typeof globalThis<"u"&&globalThis.Headers)return globalThis.Headers;if(typeof Headers<"u")return Headers;gp("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){if(this.responseImpl)return this.responseImpl;if(typeof self<"u"&&"Response"in self)return self.Response;if(typeof globalThis<"u"&&globalThis.Response)return globalThis.Response;if(typeof Response<"u")return Response;gp("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}};var HJ={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"};var $J=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],WJ=new xc(3e4,6e4);function BR(n,e){return n.tenantId&&!e.tenantId?Object.assign(Object.assign({},e),{tenantId:n.tenantId}):e}function Tp(o,s,a,c){return I(this,arguments,function*(n,e,t,r,i={}){return PB(n,i,()=>I(null,null,function*(){let l={},d={};r&&(e==="GET"?d=r:l={body:JSON.stringify(r)});let h=ap(Object.assign({key:n.config.apiKey},d)).slice(1),f=yield n._getAdditionalHeaders();f["Content-Type"]="application/json",n.languageCode&&(f["X-Firebase-Locale"]=n.languageCode);let g=Object.assign({method:e,headers:f},l);return kV()||(g.referrerPolicy="no-referrer"),n.emulatorConfig&&mr(n.emulatorConfig.host)&&(g.credentials="include"),PT.fetch()(yield xB(n,n.config.apiHost,t,h),g)}))})}function PB(n,e,t){return I(this,null,function*(){n._canInitEmulator=!1;let r=Object.assign(Object.assign({},HJ),e);try{let i=new RR(n),o=yield Promise.race([t(),i.promise]);i.clearNetworkTimeout();let s=yield o.json();if("needConfirmation"in s)throw wT(n,"account-exists-with-different-credential",s);if(o.ok&&!("errorMessage"in s))return s;{let a=o.ok?s.errorMessage:s.error.message,[c,l]=a.split(" : ");if(c==="FEDERATED_USER_ID_ALREADY_LINKED")throw wT(n,"credential-already-in-use",s);if(c==="EMAIL_EXISTS")throw wT(n,"email-already-in-use",s);if(c==="USER_DISABLED")throw wT(n,"user-disabled",s);let d=r[c]||c.toLowerCase().replace(/[_\s]+/g,"-");if(l)throw LB(n,d,l);MT(n,d)}}catch(i){if(i instanceof Xn)throw i;MT(n,"network-request-failed",{message:String(i)})}})}function zJ(o,s,a,c){return I(this,arguments,function*(n,e,t,r,i={}){let l=yield Tp(n,e,t,r,i);return"mfaPendingCredential"in l&&MT(n,"multi-factor-auth-required",{_serverResponse:l}),l})}function xB(n,e,t,r){return I(this,null,function*(){let i=`${e}${t}?${r}`,o=n,s=o.config.emulator?jJ(n.config,i):`${n.config.apiScheme}://${i}`;return $J.includes(t)&&(yield o._persistenceManagerAvailable,o._getPersistenceType()==="COOKIE")?o._getPersistence()._getFinalTarget(s).toString():s})}var RR=class{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((t,r)=>{this.timer=setTimeout(()=>r(UR(this.auth,"network-request-failed")),WJ.get())})}};function wT(n,e,t){let r={appName:n.name};t.email&&(r.email=t.email),t.phoneNumber&&(r.phoneNumber=t.phoneNumber);let i=UR(n,e,r);return i.customData._tokenResponse=t,i}function qJ(n,e){return I(this,null,function*(){return Tp(n,"POST","/v1/accounts:delete",e)})}function xT(n,e){return I(this,null,function*(){return Tp(n,"POST","/v1/accounts:lookup",e)})}function mp(n){if(n)try{let e=new Date(Number(n));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}function jT(n,e=!1){return I(this,null,function*(){let t=Me(n),r=yield t.getIdToken(e),i=kB(r);Ge(i&&i.exp&&i.auth_time&&i.iat,t.auth,"internal-error");let o=typeof i.firebase=="object"?i.firebase:void 0,s=o?.sign_in_provider;return{claims:i,token:r,authTime:mp(CR(i.auth_time)),issuedAtTime:mp(CR(i.iat)),expirationTime:mp(CR(i.exp)),signInProvider:s||null,signInSecondFactor:o?.sign_in_second_factor||null}})}function CR(n){return Number(n)*1e3}function kB(n){let[e,t,r]=n.split(".");if(e===void 0||t===void 0||r===void 0)return bT("JWT malformed, contained fewer than 3 sections"),null;try{let i=td(t);return i?JSON.parse(i):(bT("Failed to decode base64 JWT payload"),null)}catch(i){return bT("Caught error parsing JWT payload as JSON",i?.toString()),null}}function yB(n){let e=kB(n);return Ge(e,"internal-error"),Ge(typeof e.exp<"u","internal-error"),Ge(typeof e.iat<"u","internal-error"),Number(e.exp)-Number(e.iat)}function NR(n,e,t=!1){return I(this,null,function*(){if(t)return e;try{return yield e}catch(r){throw r instanceof Xn&&KJ(r)&&n.auth.currentUser===n&&(yield n.auth.signOut()),r}})}function KJ({code:n}){return n==="auth/user-disabled"||n==="auth/user-token-expired"}var wR=class{constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,this.timerId!==null&&clearTimeout(this.timerId))}getInterval(e){var t;if(e){let r=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),r}else{this.errorBackoff=3e4;let i=((t=this.user.stsTokenManager.expirationTime)!==null&&t!==void 0?t:0)-Date.now()-3e5;return Math.max(0,i)}}schedule(e=!1){if(!this.isRunning)return;let t=this.getInterval(e);this.timerId=setTimeout(()=>I(this,null,function*(){yield this.iteration()}),t)}iteration(){return I(this,null,function*(){try{yield this.user.getIdToken(!0)}catch(e){e?.code==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()})}};var _p=class{constructor(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}_initializeTime(){this.lastSignInTime=mp(this.lastLoginAt),this.creationTime=mp(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}};function kT(n){return I(this,null,function*(){var e;let t=n.auth,r=yield n.getIdToken(),i=yield NR(n,xT(t,{idToken:r}));Ge(i?.users.length,t,"internal-error");let o=i.users[0];n._notifyReloadListener(o);let s=!((e=o.providerUserInfo)===null||e===void 0)&&e.length?FB(o.providerUserInfo):[],a=YJ(n.providerData,s),c=n.isAnonymous,l=!(n.email&&o.passwordHash)&&!a?.length,d=c?l:!1,h={uid:o.localId,displayName:o.displayName||null,photoURL:o.photoUrl||null,email:o.email||null,emailVerified:o.emailVerified||!1,phoneNumber:o.phoneNumber||null,tenantId:o.tenantId||null,providerData:a,metadata:new _p(o.createdAt,o.lastLoginAt),isAnonymous:d};Object.assign(n,h)})}function GR(n){return I(this,null,function*(){let e=Me(n);yield kT(e),yield e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)})}function YJ(n,e){return[...n.filter(r=>!e.some(i=>i.providerId===r.providerId)),...e]}function FB(n){return n.map(e=>{var{providerId:t}=e,r=Gv(e,["providerId"]);return{providerId:t,uid:r.rawId||"",displayName:r.displayName||null,email:r.email||null,phoneNumber:r.phoneNumber||null,photoURL:r.photoUrl||null}})}function XJ(n,e){return I(this,null,function*(){let t=yield PB(n,{},()=>I(null,null,function*(){let r=ap({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:i,apiKey:o}=n.config,s=yield xB(n,i,"/v1/token",`key=${o}`),a=yield n._getAdditionalHeaders();a["Content-Type"]="application/x-www-form-urlencoded";let c={method:"POST",headers:a,body:r};return n.emulatorConfig&&mr(n.emulatorConfig.host)&&(c.credentials="include"),PT.fetch()(s,c)}));return{accessToken:t.access_token,expiresIn:t.expires_in,refreshToken:t.refresh_token}})}function QJ(n,e){return I(this,null,function*(){return Tp(n,"POST","/v2/accounts:revokeToken",BR(n,e))})}var Ep=class n{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){Ge(e.idToken,"internal-error"),Ge(typeof e.idToken<"u","internal-error"),Ge(typeof e.refreshToken<"u","internal-error");let t="expiresIn"in e&&typeof e.expiresIn<"u"?Number(e.expiresIn):yB(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}updateFromIdToken(e){Ge(e.length!==0,"internal-error");let t=yB(e);this.updateTokensAndExpiration(e,null,t)}getToken(e,t=!1){return I(this,null,function*(){return!t&&this.accessToken&&!this.isExpired?this.accessToken:(Ge(this.refreshToken,e,"user-token-expired"),this.refreshToken?(yield this.refresh(e,this.refreshToken),this.accessToken):null)})}clearRefreshToken(){this.refreshToken=null}refresh(e,t){return I(this,null,function*(){let{accessToken:r,refreshToken:i,expiresIn:o}=yield XJ(e,t);this.updateTokensAndExpiration(r,i,Number(o))})}updateTokensAndExpiration(e,t,r){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+r*1e3}static fromJSON(e,t){let{refreshToken:r,accessToken:i,expirationTime:o}=t,s=new n;return r&&(Ge(typeof r=="string","internal-error",{appName:e}),s.refreshToken=r),i&&(Ge(typeof i=="string","internal-error",{appName:e}),s.accessToken=i),o&&(Ge(typeof o=="number","internal-error",{appName:e}),s.expirationTime=o),s}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 n,this.toJSON())}_performRefresh(){return gp("not implemented")}};function Fs(n,e){Ge(typeof n=="string"||typeof n>"u","internal-error",{appName:e})}var Us=class n{constructor(e){var{uid:t,auth:r,stsTokenManager:i}=e,o=Gv(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new wR(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=r,this.stsTokenManager=i,this.accessToken=i.accessToken,this.displayName=o.displayName||null,this.email=o.email||null,this.emailVerified=o.emailVerified||!1,this.phoneNumber=o.phoneNumber||null,this.photoURL=o.photoURL||null,this.isAnonymous=o.isAnonymous||!1,this.tenantId=o.tenantId||null,this.providerData=o.providerData?[...o.providerData]:[],this.metadata=new _p(o.createdAt||void 0,o.lastLoginAt||void 0)}getIdToken(e){return I(this,null,function*(){let t=yield NR(this,this.stsTokenManager.getToken(this.auth,e));return Ge(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,yield this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t})}getIdTokenResult(e){return jT(this,e)}reload(){return GR(this)}_assign(e){this!==e&&(Ge(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(t=>Object.assign({},t)),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){let t=new n(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}));return t.metadata._copy(this.metadata),t}_onReload(e){Ge(!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()}_updateTokensIfNecessary(e,t=!1){return I(this,null,function*(){let r=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),r=!0),t&&(yield kT(this)),yield this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)})}delete(){return I(this,null,function*(){if(Qn(this.auth.app))return Promise.reject(pp(this.auth));let e=yield this.getIdToken();return yield NR(this,qJ(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()})}toJSON(){return Object.assign(Object.assign({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>Object.assign({},e)),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{apiKey:this.auth.config.apiKey,appName:this.auth.name})}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,t){var r,i,o,s,a,c,l,d;let h=(r=t.displayName)!==null&&r!==void 0?r:void 0,f=(i=t.email)!==null&&i!==void 0?i:void 0,g=(o=t.phoneNumber)!==null&&o!==void 0?o:void 0,E=(s=t.photoURL)!==null&&s!==void 0?s:void 0,v=(a=t.tenantId)!==null&&a!==void 0?a:void 0,S=(c=t._redirectEventId)!==null&&c!==void 0?c:void 0,P=(l=t.createdAt)!==null&&l!==void 0?l:void 0,V=(d=t.lastLoginAt)!==null&&d!==void 0?d:void 0,{uid:K,emailVerified:oe,isAnonymous:ge,providerData:te,stsTokenManager:C}=t;Ge(K&&C,e,"internal-error");let y=Ep.fromJSON(this.name,C);Ge(typeof K=="string",e,"internal-error"),Fs(h,e.name),Fs(f,e.name),Ge(typeof oe=="boolean",e,"internal-error"),Ge(typeof ge=="boolean",e,"internal-error"),Fs(g,e.name),Fs(E,e.name),Fs(v,e.name),Fs(S,e.name),Fs(P,e.name),Fs(V,e.name);let A=new n({uid:K,auth:e,email:f,emailVerified:oe,displayName:h,isAnonymous:ge,photoURL:E,phoneNumber:g,tenantId:v,stsTokenManager:y,createdAt:P,lastLoginAt:V});return te&&Array.isArray(te)&&(A.providerData=te.map(R=>Object.assign({},R))),S&&(A._redirectEventId=S),A}static _fromIdTokenResponse(e,t,r=!1){return I(this,null,function*(){let i=new Ep;i.updateFromServerResponse(t);let o=new n({uid:t.localId,auth:e,stsTokenManager:i,isAnonymous:r});return yield kT(o),o})}static _fromGetAccountInfoResponse(e,t,r){return I(this,null,function*(){let i=t.users[0];Ge(i.localId!==void 0,"internal-error");let o=i.providerUserInfo!==void 0?FB(i.providerUserInfo):[],s=!(i.email&&i.passwordHash)&&!o?.length,a=new Ep;a.updateFromIdToken(r);let c=new n({uid:i.localId,auth:e,stsTokenManager:a,isAnonymous:s}),l={uid:i.localId,displayName:i.displayName||null,photoURL:i.photoUrl||null,email:i.email||null,emailVerified:i.emailVerified||!1,phoneNumber:i.phoneNumber||null,tenantId:i.tenantId||null,providerData:o,metadata:new _p(i.createdAt,i.lastLoginAt),isAnonymous:!(i.email&&i.passwordHash)&&!o?.length};return Object.assign(c,l),c})}};var vB=new Map;function Pc(n){LT(n instanceof Function,"Expected a class definition");let e=vB.get(n);return e?(LT(e instanceof n,"Instance stored in cache mismatched with class"),e):(e=new n,vB.set(n,e),e)}var JJ=(()=>{class n{constructor(){this.type="NONE",this.storage={}}_isAvailable(){return I(this,null,function*(){return!0})}_set(t,r){return I(this,null,function*(){this.storage[t]=r})}_get(t){return I(this,null,function*(){let r=this.storage[t];return r===void 0?null:r})}_remove(t){return I(this,null,function*(){delete this.storage[t]})}_addListener(t,r){}_removeListener(t,r){}}return n.type="NONE",n})(),bR=JJ;function DR(n,e,t){return`firebase:${n}:${e}:${t}`}var FT=class n{constructor(e,t,r){this.persistence=e,this.auth=t,this.userKey=r;let{config:i,name:o}=this.auth;this.fullUserKey=DR(this.userKey,i.apiKey,o),this.fullPersistenceKey=DR("persistence",i.apiKey,o),this.boundEventHandler=t._onStorageEvent.bind(t),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}getCurrentUser(){return I(this,null,function*(){let e=yield this.persistence._get(this.fullUserKey);if(!e)return null;if(typeof e=="string"){let t=yield xT(this.auth,{idToken:e}).catch(()=>{});return t?Us._fromGetAccountInfoResponse(this.auth,t,e):null}return Us._fromJSON(this.auth,e)})}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}setPersistence(e){return I(this,null,function*(){if(this.persistence===e)return;let t=yield this.getCurrentUser();if(yield this.removeCurrentUser(),this.persistence=e,t)return this.setCurrentUser(t)})}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static create(e,t,r="authUser"){return I(this,null,function*(){if(!t.length)return new n(Pc(bR),e,r);let i=(yield Promise.all(t.map(l=>I(null,null,function*(){if(yield l._isAvailable())return l})))).filter(l=>l),o=i[0]||Pc(bR),s=DR(r,e.config.apiKey,e.name),a=null;for(let l of t)try{let d=yield l._get(s);if(d){let h;if(typeof d=="string"){let f=yield xT(e,{idToken:d}).catch(()=>{});if(!f)break;h=yield Us._fromGetAccountInfoResponse(e,f,d)}else h=Us._fromJSON(e,d);l!==o&&(a=h),o=l;break}}catch{}let c=i.filter(l=>l._shouldAllowMigration);return!o._shouldAllowMigration||!c.length?new n(o,e,r):(o=c[0],a&&(yield o._set(s,a.toJSON())),yield Promise.all(t.map(l=>I(null,null,function*(){if(l!==o)try{yield l._remove(s)}catch{}}))),new n(o,e,r))})}};function SB(n){let e=n.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(UB(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(ZJ(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(BB(e))return"Blackberry";if(GB(e))return"Webos";if(eZ(e))return"Safari";if((e.includes("chrome/")||tZ(e))&&!e.includes("edge/"))return"Chrome";if(VB(e))return"Android";{let t=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,r=n.match(t);if(r?.length===2)return r[1]}return"Other"}function ZJ(n=Kt()){return/firefox\//i.test(n)}function eZ(n=Kt()){let e=n.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function tZ(n=Kt()){return/crios\//i.test(n)}function UB(n=Kt()){return/iemobile/i.test(n)}function VB(n=Kt()){return/android/i.test(n)}function BB(n=Kt()){return/blackberry/i.test(n)}function GB(n=Kt()){return/webos/i.test(n)}function nZ(n=Kt()){return/iphone|ipad|ipod/i.test(n)||/macintosh/i.test(n)&&/mobile/i.test(n)}function rZ(){return UV()&&document.documentMode===10}function iZ(n=Kt()){return nZ(n)||VB(n)||GB(n)||BB(n)||/windows phone/i.test(n)||UB(n)}function jB(n,e=[]){let t;switch(n){case"Browser":t=SB(Kt());break;case"Worker":t=`${SB(Kt())}-${n}`;break;default:t=n}let r=e.length?e.join(","):"FirebaseCore-web";return`${t}/JsCore/${Ls}/${r}`}var OR=class{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,t){let r=o=>new Promise((s,a)=>{try{let c=e(o);s(c)}catch(c){a(c)}});r.onAbort=t,this.queue.push(r);let i=this.queue.length-1;return()=>{this.queue[i]=()=>Promise.resolve()}}runMiddleware(e){return I(this,null,function*(){if(this.auth.currentUser===e)return;let t=[];try{for(let r of this.queue)yield r(e),r.onAbort&&t.push(r.onAbort)}catch(r){t.reverse();for(let i of t)try{i()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:r?.message})}})}};function oZ(t){return I(this,arguments,function*(n,e={}){return Tp(n,"GET","/v2/passwordPolicy",BR(n,e))})}var sZ=6,MR=class{constructor(e){var t,r,i,o;let s=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=(t=s.minPasswordLength)!==null&&t!==void 0?t:sZ,s.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=s.maxPasswordLength),s.containsLowercaseCharacter!==void 0&&(this.customStrengthOptions.containsLowercaseLetter=s.containsLowercaseCharacter),s.containsUppercaseCharacter!==void 0&&(this.customStrengthOptions.containsUppercaseLetter=s.containsUppercaseCharacter),s.containsNumericCharacter!==void 0&&(this.customStrengthOptions.containsNumericCharacter=s.containsNumericCharacter),s.containsNonAlphanumericCharacter!==void 0&&(this.customStrengthOptions.containsNonAlphanumericCharacter=s.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,this.enforcementState==="ENFORCEMENT_STATE_UNSPECIFIED"&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=(i=(r=e.allowedNonAlphanumericCharacters)===null||r===void 0?void 0:r.join(""))!==null&&i!==void 0?i:"",this.forceUpgradeOnSignin=(o=e.forceUpgradeOnSignin)!==null&&o!==void 0?o:!1,this.schemaVersion=e.schemaVersion}validatePassword(e){var t,r,i,o,s,a;let c={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,c),this.validatePasswordCharacterOptions(e,c),c.isValid&&(c.isValid=(t=c.meetsMinPasswordLength)!==null&&t!==void 0?t:!0),c.isValid&&(c.isValid=(r=c.meetsMaxPasswordLength)!==null&&r!==void 0?r:!0),c.isValid&&(c.isValid=(i=c.containsLowercaseLetter)!==null&&i!==void 0?i:!0),c.isValid&&(c.isValid=(o=c.containsUppercaseLetter)!==null&&o!==void 0?o:!0),c.isValid&&(c.isValid=(s=c.containsNumericCharacter)!==null&&s!==void 0?s:!0),c.isValid&&(c.isValid=(a=c.containsNonAlphanumericCharacter)!==null&&a!==void 0?a:!0),c}validatePasswordLengthOptions(e,t){let r=this.customStrengthOptions.minPasswordLength,i=this.customStrengthOptions.maxPasswordLength;r&&(t.meetsMinPasswordLength=e.length>=r),i&&(t.meetsMaxPasswordLength=e.length<=i)}validatePasswordCharacterOptions(e,t){this.updatePasswordCharacterOptionsStatuses(t,!1,!1,!1,!1);let r;for(let i=0;i<e.length;i++)r=e.charAt(i),this.updatePasswordCharacterOptionsStatuses(t,r>="a"&&r<="z",r>="A"&&r<="Z",r>="0"&&r<="9",this.allowedNonAlphanumericCharacters.includes(r))}updatePasswordCharacterOptionsStatuses(e,t,r,i,o){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=t)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=r)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=i)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=o))}};var LR=class{constructor(e,t,r,i){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=r,this.config=i,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new UT(this),this.idTokenSubscription=new UT(this),this.beforeStateQueue=new OR(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=MB,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=i.sdkClientVersion,this._persistenceManagerAvailable=new Promise(o=>this._resolvePersistenceManagerAvailable=o)}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=Pc(t)),this._initializationPromise=this.queue(()=>I(this,null,function*(){var r,i,o;if(!this._deleted&&(this.persistenceManager=yield FT.create(this,e),(r=this._resolvePersistenceManagerAvailable)===null||r===void 0||r.call(this),!this._deleted)){if(!((i=this._popupRedirectResolver)===null||i===void 0)&&i._shouldInitProactively)try{yield this._popupRedirectResolver._initialize(this)}catch{}yield this.initializeCurrentUser(t),this.lastNotifiedUid=((o=this.currentUser)===null||o===void 0?void 0:o.uid)||null,!this._deleted&&(this._isInitialized=!0)}})),this._initializationPromise}_onStorageEvent(){return I(this,null,function*(){if(this._deleted)return;let e=yield this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!e)){if(this.currentUser&&e&&this.currentUser.uid===e.uid){this._currentUser._assign(e),yield this.currentUser.getIdToken();return}yield this._updateCurrentUser(e,!0)}})}initializeCurrentUserFromIdToken(e){return I(this,null,function*(){try{let t=yield xT(this,{idToken:e}),r=yield Us._fromGetAccountInfoResponse(this,t,e);yield this.directlySetCurrentUser(r)}catch(t){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",t),yield this.directlySetCurrentUser(null)}})}initializeCurrentUser(e){return I(this,null,function*(){var t;if(Qn(this.app)){let s=this.app.settings.authIdToken;return s?new Promise(a=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(s).then(a,a))}):this.directlySetCurrentUser(null)}let r=yield this.assertedPersistence.getCurrentUser(),i=r,o=!1;if(e&&this.config.authDomain){yield this.getOrInitRedirectPersistenceManager();let s=(t=this.redirectUser)===null||t===void 0?void 0:t._redirectEventId,a=i?._redirectEventId,c=yield this.tryRedirectSignIn(e);(!s||s===a)&&c?.user&&(i=c.user,o=!0)}if(!i)return this.directlySetCurrentUser(null);if(!i._redirectEventId){if(o)try{yield this.beforeStateQueue.runMiddleware(i)}catch(s){i=r,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(s))}return i?this.reloadAndSetCurrentUserOrClear(i):this.directlySetCurrentUser(null)}return Ge(this._popupRedirectResolver,this,"argument-error"),yield this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===i._redirectEventId?this.directlySetCurrentUser(i):this.reloadAndSetCurrentUserOrClear(i)})}tryRedirectSignIn(e){return I(this,null,function*(){let t=null;try{t=yield this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch{yield this._setRedirectUser(null)}return t})}reloadAndSetCurrentUserOrClear(e){return I(this,null,function*(){try{yield kT(e)}catch(t){if(t?.code!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)})}useDeviceLanguage(){this.languageCode=GJ()}_delete(){return I(this,null,function*(){this._deleted=!0})}updateCurrentUser(e){return I(this,null,function*(){if(Qn(this.app))return Promise.reject(pp(this));let t=e?Me(e):null;return t&&Ge(t.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(t&&t._clone(this))})}_updateCurrentUser(e,t=!1){return I(this,null,function*(){if(!this._deleted)return e&&Ge(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),t||(yield this.beforeStateQueue.runMiddleware(e)),this.queue(()=>I(this,null,function*(){yield this.directlySetCurrentUser(e),this.notifyAuthListeners()}))})}signOut(){return I(this,null,function*(){return Qn(this.app)?Promise.reject(pp(this)):(yield this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&(yield this._setRedirectUser(null)),this._updateCurrentUser(null,!0))})}setPersistence(e){return Qn(this.app)?Promise.reject(pp(this)):this.queue(()=>I(this,null,function*(){yield this.assertedPersistence.setPersistence(Pc(e))}))}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}validatePassword(e){return I(this,null,function*(){this._getPasswordPolicyInternal()||(yield this._updatePasswordPolicy());let t=this._getPasswordPolicyInternal();return t.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):t.validatePassword(e)})}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}_updatePasswordPolicy(){return I(this,null,function*(){let e=yield oZ(this),t=new MR(e);this.tenantId===null?this._projectPasswordPolicy=t:this._tenantPasswordPolicies[this.tenantId]=t})}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(e){this._errorFactory=new ni("auth","Firebase",e())}onAuthStateChanged(e,t,r){return this.registerStateListener(this.authStateSubscription,e,t,r)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,r){return this.registerStateListener(this.idTokenSubscription,e,t,r)}authStateReady(){return new Promise((e,t)=>{if(this.currentUser)e();else{let r=this.onAuthStateChanged(()=>{r(),e()},t)}})}revokeAccessToken(e){return I(this,null,function*(){if(this.currentUser){let t=yield this.currentUser.getIdToken(),r={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:t};this.tenantId!=null&&(r.tenantId=this.tenantId),yield QJ(this,r)}})}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(e=this._currentUser)===null||e===void 0?void 0:e.toJSON()}}_setRedirectUser(e,t){return I(this,null,function*(){let r=yield this.getOrInitRedirectPersistenceManager(t);return e===null?r.removeCurrentUser():r.setCurrentUser(e)})}getOrInitRedirectPersistenceManager(e){return I(this,null,function*(){if(!this.redirectPersistenceManager){let t=e&&Pc(e)||this._popupRedirectResolver;Ge(t,this,"argument-error"),this.redirectPersistenceManager=yield FT.create(this,[Pc(t._redirectPersistence)],"redirectUser"),this.redirectUser=yield this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager})}_redirectUserForId(e){return I(this,null,function*(){var t,r;return this._isInitialized&&(yield this.queue(()=>I(this,null,function*(){}))),((t=this._currentUser)===null||t===void 0?void 0:t._redirectEventId)===e?this._currentUser:((r=this.redirectUser)===null||r===void 0?void 0:r._redirectEventId)===e?this.redirectUser:null})}_persistUserIfCurrent(e){return I(this,null,function*(){if(e===this.currentUser)return this.queue(()=>I(this,null,function*(){return this.directlySetCurrentUser(e)}))})}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var e,t;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);let r=(t=(e=this.currentUser)===null||e===void 0?void 0:e.uid)!==null&&t!==void 0?t:null;this.lastNotifiedUid!==r&&(this.lastNotifiedUid=r,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,r,i){if(this._deleted)return()=>{};let o=typeof t=="function"?t:t.next.bind(t),s=!1,a=this._isInitialized?Promise.resolve():this._initializationPromise;if(Ge(a,this,"internal-error"),a.then(()=>{s||o(this.currentUser)}),typeof t=="function"){let c=e.addObserver(t,r,i);return()=>{s=!0,c()}}else{let c=e.addObserver(t);return()=>{s=!0,c()}}}directlySetCurrentUser(e){return I(this,null,function*(){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?yield this.assertedPersistence.setCurrentUser(e):yield this.assertedPersistence.removeCurrentUser()})}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return Ge(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=jB(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}_getAdditionalHeaders(){return I(this,null,function*(){var e;let t={"X-Client-Version":this.clientVersion};this.app.options.appId&&(t["X-Firebase-gmpid"]=this.app.options.appId);let r=yield(e=this.heartbeatServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getHeartbeatsHeader();r&&(t["X-Firebase-Client"]=r);let i=yield this._getAppCheckToken();return i&&(t["X-Firebase-AppCheck"]=i),t})}_getAppCheckToken(){return I(this,null,function*(){var e;if(Qn(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;let t=yield(e=this.appCheckServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getToken();return t?.error&&UJ(`Error while retrieving App Check token: ${t.error}`),t?.token})}};function HB(n){return Me(n)}var UT=class{constructor(e){this.auth=e,this.observer=null,this.addObserver=HV(t=>this.observer=t)}get next(){return Ge(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}};var aZ={loadJS(){return I(this,null,function*(){throw new Error("Unable to load external scripts")})},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function cZ(n){aZ=n}function lZ(n){return`__${n}${Math.floor(Math.random()*1e6)}`}function jR(n,e){let t=Ki(n,"auth");if(t.isInitialized()){let i=t.getImmediate(),o=t.getOptions();if(ri(o,e??{}))return i;MT(i,"already-initialized")}return t.initialize({options:e})}function uZ(n,e){let t=e?.persistence||[],r=(Array.isArray(t)?t:[t]).map(Pc);e?.errorMap&&n._updateErrorMap(e.errorMap),n._initializeWithPersistence(r,e?.popupRedirectResolver)}var PR=class n{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static _fromIdTokenResponse(e,t,r,i=!1){return I(this,null,function*(){let o=yield Us._fromIdTokenResponse(e,r,i),s=AB(r);return new n({user:o,providerId:s,_tokenResponse:r,operationType:t})})}static _forOperation(e,t,r){return I(this,null,function*(){yield e._updateTokensIfNecessary(r,!0);let i=AB(r);return new n({user:e,providerId:i,_tokenResponse:r,operationType:t})})}};function AB(n){return n.providerId?n.providerId:"phoneNumber"in n?"phone":null}function dZ(n,e){return I(this,null,function*(){return zJ(n,"POST","/v1/accounts:signInWithCustomToken",BR(n,e))})}function HR(n,e){return I(this,null,function*(){if(Qn(n.app))return Promise.reject(pp(n));let t=HB(n),r=yield dZ(t,{token:e,returnSecureToken:!0}),i=yield PR._fromIdTokenResponse(t,"signIn",r);return yield t._updateCurrentUser(i.user),i})}function HT(n,e,t,r){return Me(n).onAuthStateChanged(e,t,r)}function $R(n){return Me(n).signOut()}var VT="__sak";var BT=class{constructor(e,t){this.storageRetriever=e,this.type=t}_isAvailable(){try{return this.storage?(this.storage.setItem(VT,"1"),this.storage.removeItem(VT),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){let 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()}};var hZ=1e3,fZ=10,pZ=(()=>{class n extends BT{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(t,r)=>this.onStorageEvent(t,r),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=iZ(),this._shouldAllowMigration=!0}forAllChangedKeys(t){for(let r of Object.keys(this.listeners)){let i=this.storage.getItem(r),o=this.localCache[r];i!==o&&t(r,o,i)}}onStorageEvent(t,r=!1){if(!t.key){this.forAllChangedKeys((a,c,l)=>{this.notifyListeners(a,l)});return}let i=t.key;r?this.detachListener():this.stopPolling();let o=()=>{let a=this.storage.getItem(i);!r&&this.localCache[i]===a||this.notifyListeners(i,a)},s=this.storage.getItem(i);rZ()&&s!==t.newValue&&t.newValue!==t.oldValue?setTimeout(o,fZ):o()}notifyListeners(t,r){this.localCache[t]=r;let i=this.listeners[t];if(i)for(let o of Array.from(i))o(r&&JSON.parse(r))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((t,r,i)=>{this.onStorageEvent(new StorageEvent("storage",{key:t,oldValue:r,newValue:i}),!0)})},hZ)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(t,r){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[t]||(this.listeners[t]=new Set,this.localCache[t]=this.storage.getItem(t)),this.listeners[t].add(r)}_removeListener(t,r){this.listeners[t]&&(this.listeners[t].delete(r),this.listeners[t].size===0&&delete this.listeners[t]),Object.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}_set(t,r){return I(this,null,function*(){yield xa(n.prototype,this,"_set").call(this,t,r),this.localCache[t]=JSON.stringify(r)})}_get(t){return I(this,null,function*(){let r=yield xa(n.prototype,this,"_get").call(this,t);return this.localCache[t]=JSON.stringify(r),r})}_remove(t){return I(this,null,function*(){yield xa(n.prototype,this,"_remove").call(this,t),delete this.localCache[t]})}}return n.type="LOCAL",n})(),gZ=pZ;var mZ=(()=>{class n extends BT{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(t,r){}_removeListener(t,r){}}return n.type="SESSION",n})(),EZ=mZ;function _Z(n){return Promise.all(n.map(e=>I(null,null,function*(){try{return{fulfilled:!0,value:yield e}}catch(t){return{fulfilled:!1,reason:t}}})))}var TZ=(()=>{class n{constructor(t){this.eventTarget=t,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(t){let r=this.receivers.find(o=>o.isListeningto(t));if(r)return r;let i=new n(t);return this.receivers.push(i),i}isListeningto(t){return this.eventTarget===t}handleEvent(t){return I(this,null,function*(){let r=t,{eventId:i,eventType:o,data:s}=r.data,a=this.handlersMap[o];if(!a?.size)return;r.ports[0].postMessage({status:"ack",eventId:i,eventType:o});let c=Array.from(a).map(d=>I(this,null,function*(){return d(r.origin,s)})),l=yield _Z(c);r.ports[0].postMessage({status:"done",eventId:i,eventType:o,response:l})})}_subscribe(t,r){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[t]||(this.handlersMap[t]=new Set),this.handlersMap[t].add(r)}_unsubscribe(t,r){this.handlersMap[t]&&r&&this.handlersMap[t].delete(r),(!r||this.handlersMap[t].size===0)&&delete this.handlersMap[t],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}n.receivers=[];return n})();function IZ(n="",e=10){let t="";for(let r=0;r<e;r++)t+=Math.floor(Math.random()*10);return n+t}var xR=class{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)}_send(e,t,r=50){return I(this,null,function*(){let i=typeof MessageChannel<"u"?new MessageChannel:null;if(!i)throw new Error("connection_unavailable");let o,s;return new Promise((a,c)=>{let l=IZ("",20);i.port1.start();let d=setTimeout(()=>{c(new Error("unsupported_event"))},r);s={messageChannel:i,onMessage(h){let f=h;if(f.data.eventId===l)switch(f.data.status){case"ack":clearTimeout(d),o=setTimeout(()=>{c(new Error("timeout"))},3e3);break;case"done":clearTimeout(o),a(f.data.response);break;default:clearTimeout(d),clearTimeout(o),c(new Error("invalid_response"));break}}},this.handlers.add(s),i.port1.addEventListener("message",s.onMessage),this.target.postMessage({eventType:e,eventId:l,data:t},[i.port2])}).finally(()=>{s&&this.removeMessageHandler(s)})})}};function CB(){return window}function $B(){return typeof CB().WorkerGlobalScope<"u"&&typeof CB().importScripts=="function"}function yZ(){return I(this,null,function*(){if(!navigator?.serviceWorker)return null;try{return(yield navigator.serviceWorker.ready).active}catch{return null}})}function vZ(){var n;return((n=navigator?.serviceWorker)===null||n===void 0?void 0:n.controller)||null}function SZ(){return $B()?self:null}var WB="firebaseLocalStorageDb",AZ=1,GT="firebaseLocalStorage",zB="fbase_key",kc=class{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 $T(n,e){return n.transaction([GT],e?"readwrite":"readonly").objectStore(GT)}function CZ(){let n=indexedDB.deleteDatabase(WB);return new kc(n).toPromise()}function kR(){let n=indexedDB.open(WB,AZ);return new Promise((e,t)=>{n.addEventListener("error",()=>{t(n.error)}),n.addEventListener("upgradeneeded",()=>{let r=n.result;try{r.createObjectStore(GT,{keyPath:zB})}catch(i){t(i)}}),n.addEventListener("success",()=>I(null,null,function*(){let r=n.result;r.objectStoreNames.contains(GT)?e(r):(r.close(),yield CZ(),e(yield kR()))}))})}function DB(n,e,t){return I(this,null,function*(){let r=$T(n,!0).put({[zB]:e,value:t});return new kc(r).toPromise()})}function DZ(n,e){return I(this,null,function*(){let t=$T(n,!1).get(e),r=yield new kc(t).toPromise();return r===void 0?null:r.value})}function RB(n,e){let t=$T(n,!0).delete(e);return new kc(t).toPromise()}var RZ=800,NZ=3,wZ=(()=>{class n{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}_openDb(){return I(this,null,function*(){return this.db?this.db:(this.db=yield kR(),this.db)})}_withRetries(t){return I(this,null,function*(){let r=0;for(;;)try{let i=yield this._openDb();return yield t(i)}catch(i){if(r++>NZ)throw i;this.db&&(this.db.close(),this.db=void 0)}})}initializeServiceWorkerMessaging(){return I(this,null,function*(){return $B()?this.initializeReceiver():this.initializeSender()})}initializeReceiver(){return I(this,null,function*(){this.receiver=TZ._getInstance(SZ()),this.receiver._subscribe("keyChanged",(t,r)=>I(this,null,function*(){return{keyProcessed:(yield this._poll()).includes(r.key)}})),this.receiver._subscribe("ping",(t,r)=>I(this,null,function*(){return["keyChanged"]}))})}initializeSender(){return I(this,null,function*(){var t,r;if(this.activeServiceWorker=yield yZ(),!this.activeServiceWorker)return;this.sender=new xR(this.activeServiceWorker);let i=yield this.sender._send("ping",{},800);i&&!((t=i[0])===null||t===void 0)&&t.fulfilled&&!((r=i[0])===null||r===void 0)&&r.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)})}notifyServiceWorker(t){return I(this,null,function*(){if(!(!this.sender||!this.activeServiceWorker||vZ()!==this.activeServiceWorker))try{yield this.sender._send("keyChanged",{key:t},this.serviceWorkerReceiverAvailable?800:50)}catch{}})}_isAvailable(){return I(this,null,function*(){try{if(!indexedDB)return!1;let t=yield kR();return yield DB(t,VT,"1"),yield RB(t,VT),!0}catch{}return!1})}_withPendingWrite(t){return I(this,null,function*(){this.pendingWrites++;try{yield t()}finally{this.pendingWrites--}})}_set(t,r){return I(this,null,function*(){return this._withPendingWrite(()=>I(this,null,function*(){return yield this._withRetries(i=>DB(i,t,r)),this.localCache[t]=r,this.notifyServiceWorker(t)}))})}_get(t){return I(this,null,function*(){let r=yield this._withRetries(i=>DZ(i,t));return this.localCache[t]=r,r})}_remove(t){return I(this,null,function*(){return this._withPendingWrite(()=>I(this,null,function*(){return yield this._withRetries(r=>RB(r,t)),delete this.localCache[t],this.notifyServiceWorker(t)}))})}_poll(){return I(this,null,function*(){let t=yield this._withRetries(o=>{let s=$T(o,!1).getAll();return new kc(s).toPromise()});if(!t)return[];if(this.pendingWrites!==0)return[];let r=[],i=new Set;if(t.length!==0)for(let{fbase_key:o,value:s}of t)i.add(o),JSON.stringify(this.localCache[o])!==JSON.stringify(s)&&(this.notifyListeners(o,s),r.push(o));for(let o of Object.keys(this.localCache))this.localCache[o]&&!i.has(o)&&(this.notifyListeners(o,null),r.push(o));return r})}notifyListeners(t,r){this.localCache[t]=r;let i=this.listeners[t];if(i)for(let o of Array.from(i))o(r)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>I(this,null,function*(){return this._poll()}),RZ)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(t,r){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[t]||(this.listeners[t]=new Set,this._get(t)),this.listeners[t].add(r)}_removeListener(t,r){this.listeners[t]&&(this.listeners[t].delete(r),this.listeners[t].size===0&&delete this.listeners[t]),Object.keys(this.listeners).length===0&&this.stopPolling()}}return n.type="LOCAL",n})(),bZ=wZ;var eLe=lZ("rcb"),tLe=new xc(3e4,6e4);var nLe=new xc(2e3,1e4);var rLe=600*1e3;var iLe=new xc(3e4,6e4);var oLe=new xc(5e3,15e3);var sLe=encodeURIComponent("fac");var NB="@firebase/auth",wB="1.10.8";var FR=class{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),((e=this.auth.currentUser)===null||e===void 0?void 0:e.uid)||null}getToken(e){return I(this,null,function*(){return this.assertAuthConfigured(),yield this.auth._initializationPromise,this.auth.currentUser?{accessToken:yield this.auth.currentUser.getIdToken(e)}:null})}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;let t=this.auth.onIdTokenChanged(r=>{e(r?.stsTokenManager.accessToken||null)});this.internalListeners.set(e,t),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();let t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}assertAuthConfigured(){Ge(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}};function OZ(n){switch(n){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}function MZ(n){jn(new Yt("auth",(e,{options:t})=>{let r=e.getProvider("app").getImmediate(),i=e.getProvider("heartbeat"),o=e.getProvider("app-check-internal"),{apiKey:s,authDomain:a}=r.options;Ge(s&&!s.includes(":"),"invalid-api-key",{appName:r.name});let c={apiKey:s,authDomain:a,clientPlatform:n,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:jB(n)},l=new LR(r,i,o,c);return uZ(l,t),l},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,r)=>{e.getProvider("auth-internal").initialize()})),jn(new Yt("auth-internal",e=>{let t=HB(e.getProvider("auth").getImmediate());return(r=>new FR(r))(t)},"PRIVATE").setInstantiationMode("EXPLICIT")),Be(NB,wB,OZ(n)),Be(NB,wB,"esm2017")}var LZ=300,aLe=PV("authIdTokenMaxAge")||LZ;function PZ(){var n,e;return(e=(n=document.getElementsByTagName("head"))===null||n===void 0?void 0:n[0])!==null&&e!==void 0?e:document}cZ({loadJS(n){return new Promise((e,t)=>{let r=document.createElement("script");r.setAttribute("src",n),r.onload=e,r.onerror=i=>{let o=UR("internal-error");o.customData=i,t(o)},r.type="text/javascript",r.charset="UTF-8",PZ().appendChild(r)})},gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="});MZ("Browser");function YB(n){return new fe(function(e){var t=HT(n,e.next.bind(e),e.error.bind(e),e.complete.bind(e));return{unsubscribe:t}})}var XB="auth",Fc=class{constructor(e){return e}},Uc=class{constructor(){return Fo(XB)}};var WR=new z("angularfire2.auth-instances");function Dee(n,e){let t=Ps(XB,n,e);return t&&new Fc(t)}function Ree(n){return(e,t)=>{let r=e.runOutsideAngular(()=>n(t));return new Fc(r)}}var Nee={provide:Uc,deps:[[new zt,WR]]},wee={provide:Fc,useFactory:Dee,deps:[[new zt,WR],si]};function iPe(n,...e){return Be("angularfire",ii.full,"auth"),qn([wee,Nee,{provide:WR,useFactory:Ree(n),multi:!0,deps:[Ae,We,oi,Uo,[new zt,ks],...e]}])}var ad=ue(YB,!0);var Ip=ue(jT,!0);var oPe=ue(jR,!0);var QB=ue(HR,!0,2);var JB=ue($R,!0,2);var Oee="type.googleapis.com/google.protobuf.Int64Value",Mee="type.googleapis.com/google.protobuf.UInt64Value";function nG(n,e){let t={};for(let r in n)n.hasOwnProperty(r)&&(t[r]=e(n[r]));return t}function WT(n){if(n==null)return null;if(n instanceof Number&&(n=n.valueOf()),typeof n=="number"&&isFinite(n)||n===!0||n===!1||Object.prototype.toString.call(n)==="[object String]")return n;if(n instanceof Date)return n.toISOString();if(Array.isArray(n))return n.map(e=>WT(e));if(typeof n=="function"||typeof n=="object")return nG(n,e=>WT(e));throw new Error("Data cannot be encoded in JSON: "+n)}function cd(n){if(n==null)return n;if(n["@type"])switch(n["@type"]){case Oee:case Mee:{let e=Number(n.value);if(isNaN(e))throw new Error("Data cannot be decoded from JSON: "+n);return e}default:throw new Error("Data cannot be decoded from JSON: "+n)}return Array.isArray(n)?n.map(e=>cd(e)):typeof n=="function"||typeof n=="object"?nG(n,e=>cd(e)):n}var YR="functions";var ZB={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"},Zn=class n extends Xn{constructor(e,t,r){super(`${YR}/${e}`,t||""),this.details=r,Object.setPrototypeOf(this,n.prototype)}};function Lee(n){if(n>=200&&n<300)return"ok";switch(n){case 0:return"internal";case 400:return"invalid-argument";case 401:return"unauthenticated";case 403:return"permission-denied";case 404:return"not-found";case 409:return"aborted";case 429:return"resource-exhausted";case 499:return"cancelled";case 500:return"internal";case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline-exceeded"}return"unknown"}function zT(n,e){let t=Lee(n),r=t,i;try{let o=e&&e.error;if(o){let s=o.status;if(typeof s=="string"){if(!ZB[s])return new Zn("internal","internal");t=ZB[s],r=s}let a=o.message;typeof a=="string"&&(r=a),i=o.details,i!==void 0&&(i=cd(i))}}catch{}return t==="ok"?null:new Zn(t,r,i)}var zR=class{constructor(e,t,r,i){this.app=e,this.auth=null,this.messaging=null,this.appCheck=null,this.serverAppAppCheckToken=null,Qn(e)&&e.settings.appCheckToken&&(this.serverAppAppCheckToken=e.settings.appCheckToken),this.auth=t.getImmediate({optional:!0}),this.messaging=r.getImmediate({optional:!0}),this.auth||t.get().then(o=>this.auth=o,()=>{}),this.messaging||r.get().then(o=>this.messaging=o,()=>{}),this.appCheck||i?.get().then(o=>this.appCheck=o,()=>{})}getAuthToken(){return I(this,null,function*(){if(this.auth)try{let e=yield this.auth.getToken();return e?.accessToken}catch{return}})}getMessagingToken(){return I(this,null,function*(){if(!(!this.messaging||!("Notification"in self)||Notification.permission!=="granted"))try{return yield this.messaging.getToken()}catch{return}})}getAppCheckToken(e){return I(this,null,function*(){if(this.serverAppAppCheckToken)return this.serverAppAppCheckToken;if(this.appCheck){let t=e?yield this.appCheck.getLimitedUseToken():yield this.appCheck.getToken();return t.error?null:t.token}return null})}getContext(e){return I(this,null,function*(){let t=yield this.getAuthToken(),r=yield this.getMessagingToken(),i=yield this.getAppCheckToken(e);return{authToken:t,messagingToken:r,appCheckToken:i}})}};var qR="us-central1",Pee=/^data: (.*?)(?:\n|$)/;function xee(n){let e=null;return{promise:new Promise((t,r)=>{e=setTimeout(()=>{r(new Zn("deadline-exceeded","deadline-exceeded"))},n)}),cancel:()=>{e&&clearTimeout(e)}}}var KR=class{constructor(e,t,r,i,o=qR,s=(...a)=>fetch(...a)){this.app=e,this.fetchImpl=s,this.emulatorOrigin=null,this.contextProvider=new zR(e,t,r,i),this.cancelAllRequests=new Promise(a=>{this.deleteService=()=>Promise.resolve(a())});try{let a=new URL(o);this.customDomain=a.origin+(a.pathname==="/"?"":a.pathname),this.region=qR}catch{this.customDomain=null,this.region=o}}_delete(){return this.deleteService()}_url(e){let t=this.app.options.projectId;return this.emulatorOrigin!==null?`${this.emulatorOrigin}/${t}/${this.region}/${e}`:this.customDomain!==null?`${this.customDomain}/${e}`:`https://${this.region}-${t}.cloudfunctions.net/${e}`}};function kee(n,e,t){let r=mr(e);n.emulatorOrigin=`http${r?"s":""}://${e}:${t}`,r&&(ws(n.emulatorOrigin),Oc("Functions",!0))}function Fee(n,e,t){let r=i=>Vee(n,e,i,t||{});return r.stream=(i,o)=>Bee(n,e,i,o||{}),r}function Uee(n,e,t,r){return I(this,null,function*(){t["Content-Type"]="application/json";let i;try{i=yield r(n,{method:"POST",body:JSON.stringify(e),headers:t})}catch{return{status:0,json:null}}let o=null;try{o=yield i.json()}catch{}return{status:i.status,json:o}})}function rG(n,e){return I(this,null,function*(){let t={},r=yield n.contextProvider.getContext(e.limitedUseAppCheckTokens);return r.authToken&&(t.Authorization="Bearer "+r.authToken),r.messagingToken&&(t["Firebase-Instance-ID-Token"]=r.messagingToken),r.appCheckToken!==null&&(t["X-Firebase-AppCheck"]=r.appCheckToken),t})}function Vee(n,e,t,r){return I(this,null,function*(){t=WT(t);let i={data:t},o=yield rG(n,r),s=r.timeout||7e4,a=xee(s),c=yield Promise.race([Uee(e,i,o,n.fetchImpl),a.promise,n.cancelAllRequests]);if(a.cancel(),!c)throw new Zn("cancelled","Firebase Functions instance was deleted.");let l=zT(c.status,c.json);if(l)throw l;if(!c.json)throw new Zn("internal","Response is not valid JSON object.");let d=c.json.data;if(typeof d>"u"&&(d=c.json.result),typeof d>"u")throw new Zn("internal","Response is missing data field.");return{data:cd(d)}})}function Bee(n,e,t,r){return I(this,null,function*(){var i;t=WT(t);let o={data:t},s=yield rG(n,r);s["Content-Type"]="application/json",s.Accept="text/event-stream";let a;try{a=yield n.fetchImpl(e,{method:"POST",body:JSON.stringify(o),headers:s,signal:r?.signal})}catch(g){if(g instanceof Error&&g.name==="AbortError"){let v=new Zn("cancelled","Request was cancelled.");return{data:Promise.reject(v),stream:{[Symbol.asyncIterator](){return{next(){return Promise.reject(v)}}}}}}let E=zT(0,null);return{data:Promise.reject(E),stream:{[Symbol.asyncIterator](){return{next(){return Promise.reject(E)}}}}}}let c,l,d=new Promise((g,E)=>{c=g,l=E});(i=r?.signal)===null||i===void 0||i.addEventListener("abort",()=>{let g=new Zn("cancelled","Request was cancelled.");l(g)});let h=a.body.getReader(),f=Gee(h,c,l,r?.signal);return{stream:{[Symbol.asyncIterator](){let g=f.getReader();return{next(){return I(this,null,function*(){let{value:v,done:S}=yield g.read();return{value:v,done:S}})},return(){return I(this,null,function*(){return yield g.cancel(),{done:!0,value:void 0}})}}}},data:d}})}function Gee(n,e,t,r){let i=(s,a)=>{let c=s.match(Pee);if(!c)return;let l=c[1];try{let d=JSON.parse(l);if("result"in d){e(cd(d.result));return}if("message"in d){a.enqueue(cd(d.message));return}if("error"in d){let h=zT(0,d);a.error(h),t(h);return}}catch(d){if(d instanceof Zn){a.error(d),t(d);return}}},o=new TextDecoder;return new ReadableStream({start(s){let a="";return c();function c(){return I(this,null,function*(){if(r?.aborted){let l=new Zn("cancelled","Request was cancelled");return s.error(l),t(l),Promise.resolve()}try{let{value:l,done:d}=yield n.read();if(d){a.trim()&&i(a.trim(),s),s.close();return}if(r?.aborted){let f=new Zn("cancelled","Request was cancelled");s.error(f),t(f),yield n.cancel();return}a+=o.decode(l,{stream:!0});let h=a.split(`
|
|
141
|
+
`);a=h.pop()||"";for(let f of h)f.trim()&&i(f.trim(),s);return c()}catch(l){let d=l instanceof Zn?l:zT(0,null);s.error(d),t(d)}})}},cancel(){return n.cancel()}})}var eG="@firebase/functions",tG="0.12.9";var jee="auth-internal",Hee="app-check-internal",$ee="messaging-internal";function Wee(n){let e=(t,{instanceIdentifier:r})=>{let i=t.getProvider("app").getImmediate(),o=t.getProvider(jee),s=t.getProvider($ee),a=t.getProvider(Hee);return new KR(i,o,s,a,r)};jn(new Yt(YR,e,"PUBLIC").setMultipleInstances(!0)),Be(eG,tG,n),Be(eG,tG,"esm2017")}function iG(n=Jn(),e=qR){let r=Ki(Me(n),YR).getImmediate({identifier:e}),i=id("functions");return i&&XR(r,...i),r}function XR(n,e,t){kee(Me(n),e,t)}function oG(n,e,t){return Fee(Me(n),e,t)}Wee();var Vo=class{constructor(e){return e}},sG="functions",QR=class{constructor(){return Fo(sG)}};var JR=new z("angularfire2.functions-instances");function zee(n,e){let t=Ps(sG,n,e);return t&&new Vo(t)}function qee(n){return(e,t)=>{let r=e.runOutsideAngular(()=>n(t));return new Vo(r)}}var Kee={provide:QR,deps:[[new zt,JR]]},Yee={provide:Vo,useFactory:zee,deps:[[new zt,JR],si]};function SPe(n,...e){return Be("angularfire",ii.full,"fn"),qn([Yee,Kee,{provide:JR,useFactory:qee(n),multi:!0,deps:[Ae,We,oi,Uo,[new zt,Uc],[new zt,ks],...e]}])}var APe=ue(XR,!0),CPe=ue(iG,!0);var aG=ue(oG,!0);var lG={httpsCallableFromURL:aG};function ld(n,e,t){return t?lG.httpsCallableFromURL(n,e,t):lG.httpsCallableFromURL(n,e)}var Xi=(()=>{let e=class e{constructor(r,i){this.loggingService=r,this.analyticsService=i,this.config$=new ie(null),this.disableLogsConfig$=new ie({warnings:!0,suppressAll:!1}),this.apiKey$=new ie(""),this.baseFeatureAllowList=[],this.sf$=new ie(!1),this.sdkType$=new ie("core"),this.logsEnabled$=new ie(!0),this.safeEval$=new ie(!1),this.firestorePersistentCacheEnabled$=new ie(!1),this.encryptionProvider$=new ie(null);try{this.analyticsService.setConfigService(this),this.sdkType$.subscribe(o=>{this.analyticsService.updateDefaultProperties({sdkType:o})},o=>{this.loggingService.catch("Error in ConfigService sdkType$: ",o)}),this.logsEnabled$.subscribe(o=>{o?this.loggingService.enableLogs():this.loggingService.disableLogs(),M.logsEnabled=o},o=>{this.loggingService.catch("Error in ConfigService logsEnabled$: ",o)})}catch(o){this.loggingService.catch("Error in ConfigService constructor: ",o)}}initConfig(r){try{r.featureAllowList?.length||(r.featureAllowList=Object.values(kD)),this.baseFeatureAllowList=r.featureAllowList?.slice();try{r.proxyConfig?.authHost?localStorage.setItem(F.LOCAL_STORAGE.VELT_AUTH_PROXY_HOST,btoa(r.proxyConfig.authHost)):localStorage.removeItem(F.LOCAL_STORAGE.VELT_AUTH_PROXY_HOST)}catch{}this.config$.next(r)}catch(i){this.loggingService.catch("Error in ConfigService initConfig: ",i)}}setApiKey(r){this.apiKey$.next(r)}getApiKey(){return this.apiKey$.value}getApiKey$(){return this.apiKey$.asObservable()}getConfig(){return this.config$.value}getConfig$(){return this.config$.asObservable()}disableFeatures(r){try{let i=this.config$.value;i&&(r?.length?i.featureAllowList=this.baseFeatureAllowList.filter(o=>!r.includes(o)):i.featureAllowList=this.baseFeatureAllowList.slice()),this.config$.next(i)}catch(i){this.loggingService.catch("Error in ConfigService disableFeatures: ",i)}}enableFeatures(r){try{if(!r?.length)return;let i=this.config$.value;if(!i)return;let o=i.featureAllowList??[],s=r.filter(a=>!o.includes(a));if(s.length===0)return;i.featureAllowList=[...o,...s],this.baseFeatureAllowList=[...this.baseFeatureAllowList,...s.filter(a=>!this.baseFeatureAllowList.includes(a))],this.config$.next(i)}catch(i){this.loggingService.catch("Error in ConfigService enableFeatures: ",i)}}setSF(r){try{this.sf$.next(r),this.analyticsService.setSF(r)}catch(i){this.loggingService.catch("Error in ConfigService setSF: ",i)}}getSF(){try{return this.sf$.value}catch(r){return this.loggingService.catch("Error in ConfigService getSF: ",r),!1}}getSF$(){try{return this.sf$.asObservable().pipe(_o(tp))}catch(r){return this.loggingService.catch("Error in ConfigService getSF$: ",r),ct(!1)}}setSdkType(r){try{this.sdkType$.next(r)}catch(i){this.loggingService.catch("Error in ConfigService setSdkType: ",i)}}getSdkType(){try{return this.sdkType$.value}catch(r){return this.loggingService.catch("Error in ConfigService getSdkType: ",r),"core"}}getSdkType$(){try{return this.sdkType$.asObservable()}catch(r){return this.loggingService.catch("Error in ConfigService getSdkType$: ",r),ct("core")}}enableLogs(){try{if(this.logsEnabled$.value===!0)return;this.logsEnabled$.next(!0)}catch(r){this.loggingService.catch("Error in ConfigService enableLogs: ",r)}}disableLogs(r){try{r&&this.disableLogsConfig$.next({warnings:r.warnings??!0,suppressAll:r.suppressAll??!1}),r?.warnings!==!1&&this.logsEnabled$.next(!1)}catch(i){this.loggingService.catch("Error in ConfigService disableLogs: ",i)}}getDisableLogsConfig(){return this.disableLogsConfig$.value}getDisableLogsConfig$(){return this.disableLogsConfig$.asObservable()}getProxyConfig(){try{return this.config$.value?.proxyConfig}catch(r){this.loggingService.catch("Error in ConfigService getProxyConfig: ",r);return}}getAuthProxyHost(){try{let r=this.config$.value?.proxyConfig?.authHost;if(r)return r;let i=localStorage.getItem(F.LOCAL_STORAGE.VELT_AUTH_PROXY_HOST);return i?atob(i):void 0}catch(r){this.loggingService.catch("Error in ConfigService getAuthProxyHost: ",r);return}}getApiHost(){try{return this.getProxyConfig()?.apiHost||this.config$.value?.apiProxyDomain}catch(r){this.loggingService.catch("Error in ConfigService getApiHost: ",r);return}}getApiProxyDomain(){return this.getApiHost()}getSelfHostedConfig(){try{return this.config$.value?.selfHosted}catch(r){this.loggingService.catch("Error in ConfigService getSelfHostedConfig: ",r);return}}getEnablePortableBackend(){try{return this.config$.value?.selfHosted?.enablePortableBackend===!0}catch(r){return this.loggingService.catch("Error in ConfigService getEnablePortableBackend: ",r),!1}}enableSafeEval(){try{this.safeEval$.next(!0)}catch(r){this.loggingService.catch("Error in ConfigService enableSafeEval: ",r)}}disableSafeEval(){try{this.safeEval$.next(!1)}catch(r){this.loggingService.catch("Error in ConfigService disableSafeEval: ",r)}}getSafeEval(){try{return this.safeEval$.value}catch(r){return this.loggingService.catch("Error in ConfigService getSafeEval: ",r),!1}}getSafeEval$(){try{return this.safeEval$.asObservable()}catch(r){return this.loggingService.catch("Error in ConfigService getSafeEval$: ",r),ct(!1)}}enableFirestorePersistentCache(){try{this.firestorePersistentCacheEnabled$.next(!0)}catch(r){this.loggingService.catch("Error in ConfigService enableFirestorePersistentCache: ",r)}}disableFirestorePersistentCache(){try{this.firestorePersistentCacheEnabled$.next(!1)}catch(r){this.loggingService.catch("Error in ConfigService disableFirestorePersistentCache: ",r)}}isFirestorePersistentCacheEnabled(){try{return this.firestorePersistentCacheEnabled$.value}catch(r){return this.loggingService.catch("Error in ConfigService isFirestorePersistentCacheEnabled: ",r),!1}}getFirestorePersistentCacheEnabled$(){try{return this.firestorePersistentCacheEnabled$.asObservable()}catch(r){return this.loggingService.catch("Error in ConfigService getFirestorePersistentCacheEnabled$: ",r),ct(!1)}}setEncryptionProvider(r){try{this.loggingService.log("%c[WB] Calling FUNCTION: setEncryptionProvider","color: green;"),this.encryptionProvider$.next(r)}catch(i){this.loggingService.catch("Error in ConfigService setEncryptionProvider: ",i)}}getEncryptionProvider(){try{return this.encryptionProvider$.value}catch(r){return this.loggingService.catch("Error in ConfigService getEncryptionProvider: ",r),null}}getEncryptionProvider$(){try{return this.encryptionProvider$.asObservable()}catch(r){return this.loggingService.catch("Error in ConfigService getEncryptionProvider$: ",r),ct(null)}}};e.\u0275fac=function(i){return new(i||e)(H(wt),H(Vs))},e.\u0275prov=Q({token:e,factory:e.\u0275fac,providedIn:"root"});let n=e;return n})();var Vc={fetch:(n,e)=>fetch(n,e),timeoutMs:12e5,renewalTimeoutMs:3e4,renewalOfflineTimeoutMs:5e3,isOnline:()=>typeof navigator>"u"||navigator.onLine!==!1};function eN(){try{return Vc.isOnline()?Vc.renewalTimeoutMs:Vc.renewalOfflineTimeoutMs}catch{return Vc.renewalTimeoutMs}}var PPe=Vc.timeoutMs,uG=Symbol("identify-timed-out");function Bc(n){if(!n)return!1;try{let e=new URL(n);return e.protocol==="https:"?!0:e.protocol==="http:"&&["localhost","127.0.0.1","[::1]"].includes(e.hostname)}catch{return!1}}function dG(n){return`${n.replace(/\/+$/,"")}/identify`}function Xee(n,e="identify"){let t="Could not reach the self-hosted backend for "+e+" ("+n+"). If the SDK is running cross-origin, a likely cause is the gateway's CORS origin allowlist not including this origin (fail-closed deny-by-default) \u2014 verify the operator configured it. This is distinct from a server-side denial, which carries a specific error code.";return{error:t,code:"network_error",message:t,source:"identify"}}function hG(n){return I(this,null,function*(){let e={apiKey:n.apiKey,originDomain:typeof window<"u"?window.location.origin:"",version:n.version,user:n.user};return n.authToken!=null&&(e.authToken=n.authToken),fG({url:n.url,body:e,timeoutMs:n.timeoutMs??Vc.timeoutMs,label:"identify"})})}function fG(n){return I(this,null,function*(){let e,t=n.timeoutMs,r=typeof AbortController<"u"?new AbortController:null,i,o=new Promise(a=>{i=setTimeout(()=>{try{r?.abort()}catch{}a(uG)},t)}),s=()=>I(null,null,function*(){let a=yield Vc.fetch(n.url,$({method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n.body)},r?{signal:r.signal}:{}));try{return{body:yield a.json()}}catch{return{detail:`unreadable response (HTTP ${a.status}, non-JSON body)`}}});try{let a=yield Promise.race([s(),o]);if(a===uG)e=`no answer within ${t} ms (request timed out and was aborted)`;else{if("body"in a)return a.body;e=a.detail}}catch(a){e=`fetch failed: ${a?.message??a}`}finally{i!==void 0&&clearTimeout(i)}return console.error(`Velt [selfHosted.portableBackendUrl]: ${n.label} ${e} \u2014 ${n.url}`),Xee(e,n.label)})}var tN="refresh_token_invalid",nN=new Set(["domain_not_whitelisted","identify_not_configured","invalid-argument"]);function pG(n,e){return`${n.replace(/\/+$/,"")}/${e}`}function gG(n){let e={apiKey:n.apiKey,refreshToken:n.refreshToken};return fG({url:n.url,body:e,timeoutMs:n.timeoutMs,label:"identify/refresh"})}var Bo={validateClient:{endpointClass:"core",module:"core"},sdkProxy:{endpointClass:"core",module:"core"},getNotificationsForDocuments:{endpointClass:"core",module:"core"},getPlanDetails:{endpointClass:"advisory",module:"core"},sa:{endpointClass:"telemetry",module:"core"},getIceServers:{endpointClass:"optional",module:"huddle-webrtc"},chatgptCompletion:{endpointClass:"optional",module:"ai"},rewriterAskAi:{endpointClass:"optional",module:"ai"},whisperTranscription:{endpointClass:"optional",module:"recorder-media"},getAllowedDocuments:{endpointClass:"optional",module:"core"},videoBackend:{endpointClass:"optional",module:"recorder-media"},convertRecording:{endpointClass:"optional",module:"recorder-media"},processRecording:{endpointClass:"optional",module:"recorder-media"},screenshot:{endpointClass:"optional",module:"recorder-media"},setEncryptedData:{endpointClass:"core",module:"core"},firebaseNotificationsDatabaseURL:{endpointClass:"core",module:"core"},firebaseConfig:{endpointClass:"core",module:"core"}},Qee=Object.keys(Bo).filter(n=>n!=="setEncryptedData"&&n!=="firebaseNotificationsDatabaseURL"&&n!=="firebaseConfig"&&Bo[n].endpointClass==="core"),Jee=["notifications","analytics-telemetry","console"],mG=new Set;function Zee(n){try{let e=n.filter(o=>!uU.includes(o));if(!e.length)return;let t=[...e].sort().join(",");if(mG.has(t))return;mG.add(t);let r=e.filter(o=>Jee.includes(o)),i=`Velt [selfHosted.deploymentProfile]: unknown module id(s) ignored: ${e.join(", ")}. Unknown ids enable nothing (fail-closed).`;r.length&&(i+=` Note: ${r.join(", ")} `+(r.length>1?"were":"was")+" absorbed into 'core' by the 2026-07-10 manifest restructure \u2014 the endpoints they used to gate (notifications hub, getNotificationsForDocuments, sa telemetry, console CFs) now follow 'core' and are ENABLED whenever core is. If you relied on omitting one of these ids to disable those endpoints, that opt-out no longer applies \u2014 regenerate your velt-deployment-profile.json."),console.warn(i)}catch{}}function Gc(n,e){let t=n?.deploymentProfile;return!Array.isArray(t)||t.length===0?!0:(Zee(t),t.includes(e))}var EG={usCentral1:"us-central1",europeWest1:"europe-west1",asiaSouthEast1:"asia-southeast1",australiaSouthEast1:"australia-southeast1",asiaNorthEast1:"asia-northeast1"};function ete(n,e){let t=n?.dataRegions;if(!Array.isArray(t)||e==="usCentral1")return e;let r=EG[e];return r&&t.includes(r)?e:"usCentral1"}function tte(n){let e=n.cloudFunction;if(e?.setEncryptedData)return!0;let t=n.dataRegions;if(!Array.isArray(t))return Object.values(e?.regions??{}).some(i=>!!i?.setEncryptedData);let r=i=>!!e?.regions?.[i]?.setEncryptedData;return r("usCentral1")?Object.entries(EG).filter(([i,o])=>i!=="usCentral1"&&t.includes(o)).every(([i])=>r(i)):!1}var nte="__VELT_PRE_BOOTSTRAP_SELF_HOSTED__";function rte(n){let e=n?.firebaseConfig;return e?$($({},qt.firebaseConfig),e):qt.firebaseConfig}function HPe(){try{if(typeof window>"u")return;let n=window[nte];return n&&typeof n=="object"?n:void 0}catch{return}}var KT=(()=>{let e=class e{constructor(r){this.injector=r,this.strictCoreValidationReported=!1,this.portableUnservedProxyReported=!1,this.portableWithoutStrictReported=!1,this.portableIdentifyFlagMisconfigReported=!1,this.portableIdentifyInsecureUrlReported=!1}get configService(){return this._configService??=this.injector.get(Xi)}get loggingService(){return this._loggingService??=this.injector.get(wt)}getSelfHosted(){try{let r=this.configService.getSelfHostedConfig();return this.reportPortableWithoutStrictOnce(r),r}catch(r){this.loggingService.catch("Error in EndpointsService getSelfHosted: ",r);return}}resolveStrictMiss(r,i){return this.reportStrictCoreMisconfigurationOnce(r),`${Rc}${i}`}resolveProfileDisabled(r,i){return`${Rc}module.${r}/${i}`}isPortableBackendConfigured(r){let i=r?.portableBackendUrl;return r?.enablePortableBackend===!0&&!!i&&Bc(i)}reportPortableWithoutStrictOnce(r){if(!this.portableWithoutStrictReported&&!(!this.isPortableBackendConfigured(r)||r?.strict)){this.portableWithoutStrictReported=!0;try{console.warn("Velt [selfHosted.portableBackendUrl]: portable backend configured WITHOUT `strict: true`. Velt-hosted endpoints (analytics `sa`, `sdkProxy`) still egress to Velt cloud, so this deployment is NOT air-gapped. The Tier B recipe pairs them: { enablePortableBackend: true, portableBackendUrl, strict: true }.")}catch{}}}reportStrictCoreMisconfigurationOnce(r){if(!this.strictCoreValidationReported&&!this.isPortableBackendConfigured(r)){this.strictCoreValidationReported=!0;try{let i=this.getMissingStrictCoreEndpoints(r);i.length&&console.error(`Velt [selfHosted.strict]: missing CORE endpoint config: ${i.join(", ")}. The SDK cannot function without these in strict self-hosted mode \u2014 there is no fallback to Velt infrastructure. Provide them via config.selfHosted, or unset \`strict\` for hybrid mode.`)}catch(i){this.loggingService.catch("Error in EndpointsService reportStrictCoreMisconfigurationOnce: ",i,void 0,!0)}}}getMissingStrictCoreEndpoints(r){let i=[];for(let o of Qee)Gc(r,Bo[o].module)&&(r.cloudFunction?.[o]||i.push(`cloudFunction.${o}`));return Gc(r,Bo.setEncryptedData.module)&&!tte(r)&&i.push("cloudFunction.setEncryptedData"),Gc(r,Bo.firebaseNotificationsDatabaseURL.module)&&!r.firebaseNotificationsDatabaseURL&&i.push("firebaseNotificationsDatabaseURL"),Gc(r,Bo.firebaseConfig.module)&&!r.firebaseConfig&&i.push("firebaseConfig"),i}getCloudFunctionUrl(r){let i=this.getSelfHosted(),o=Bo[r].module;if(!Gc(i,o))return this.resolveProfileDisabled(o,`cloudFunction.${r}`);let s=i?.cloudFunction?.[r];return s||(i?.strict?(r==="sdkProxy"&&this.reportPortableUnservedProxyOnce(i),this.resolveStrictMiss(i,`cloudFunction.${r}`)):qt.cloudFunction?.[r])}reportPortableUnservedProxyOnce(r){if(!this.portableUnservedProxyReported&&this.isPortableBackendConfigured(r)){this.portableUnservedProxyReported=!0;try{console.warn("Velt [Tier B]: a Velt-hosted `sdkProxy` call was blocked (strict self-hosting \u2014 zero egress, no fallback). The portable gateway does not serve this operation class, so any feature that still calls it is unavailable on this deployment: today that is the AI rewriter (rewriterAskAi); a routed operation reaches it only if its portable activation wait expired. This warning fires once per session, on the first blocked call.")}catch{}}}getPortableIdentifyUrl(){try{let r=this.getSelfHosted(),i=r?.portableBackendUrl;return i?r?.enablePortableBackend!==!0?(this.portableIdentifyFlagMisconfigReported||(this.portableIdentifyFlagMisconfigReported=!0,console.error("Velt [selfHosted.portableBackendUrl]: set without `enablePortableBackend: true` \u2014 ignored. Identify will use the Velt-hosted endpoint. Set both options to route identify to your self-hosted backend.")),null):Bc(i)?dG(i):(this.portableIdentifyInsecureUrlReported||(this.portableIdentifyInsecureUrlReported=!0,console.error(`Velt [selfHosted.portableBackendUrl]: insecure URL "${i}" \u2014 https:// is required (plain http:// is allowed for loopback hosts only). Identify is DISABLED (fail-closed): the SDK will not fall back to Velt infrastructure for a Tier B deployment.`)),`${Rc}portableBackendUrl/identify`):null}catch(r){return this.loggingService.catch("Error in EndpointsService getPortableIdentifyUrl: ",r),null}}getFirebaseConfig(){let r=this.getSelfHosted();return!r?.firebaseConfig&&r?.strict&&this.reportStrictCoreMisconfigurationOnce(r),rte(r)}getNotificationsDbUrl(){let r=this.getSelfHosted(),i=Bo.firebaseNotificationsDatabaseURL.module;if(!Gc(r,i))return this.resolveProfileDisabled(i,"firebaseNotificationsDatabaseURL");let o=r?.firebaseNotificationsDatabaseURL;return o||(r?.strict?this.resolveStrictMiss(r,"firebaseNotificationsDatabaseURL"):qt.firebaseNotificationsDatabaseURL)}getSetEncryptedDataUrl(r){let i=this.getSelfHosted(),o=Bo.setEncryptedData.module;if(!Gc(i,o))return this.resolveProfileDisabled(o,`cloudFunction.setEncryptedData (region: ${r})`);r=ete(i,r);let s=i?.cloudFunction;if(s?.setEncryptedData)return s.setEncryptedData;let a=s?.regions?.[r]?.setEncryptedData;return a||(i?.strict?this.resolveStrictMiss(i,`cloudFunction.setEncryptedData (region: ${r})`):qt.cloudFunction?.[r]?.setEncryptedData)}};e.\u0275fac=function(i){return new(i||e)(H(We))},e.\u0275prov=Q({token:e,factory:e.\u0275fac,providedIn:"root"});let n=e;return n})();var Vs=(()=>{let e=class e{constructor(r,i){this.functions=r,this.serviceBook=i,this.endpointsService=Y(KT),this.sf=!1,this.defaultProperties={},this.draftEvents=[],this.liveStateSyncEvents=Object.values(Nt.Events.LiveStateSync||{}),this.eventRateLimitCache={},this.EVENT_LIMIT=50,this.TIME_WINDOW_MS=60*1e3,this.analyticsQueue=[],this.selfHostedAnalyticsSkipReported=!1,this.batchTimer=null,this.BATCH_WINDOW_MS=5*1e3,this.MAX_BATCH_SIZE=50,this.liveStateService=null;try{this.updateDefaultProperties({sdkVersion:wc()}),window?.location?.href&&(this.defaultProperties.pageUrl=window.location.href),this.serviceBook.observe(iT).subscribe(o=>{this.commentService=o??void 0}),this.serviceBook.observe(oT).subscribe(o=>{this.reactionService=o??void 0}),this.serviceBook.observe(sT).subscribe(o=>{this.areaService=o??void 0}),this.serviceBook.observe(QF).subscribe(o=>{this.liveStateService=o??null})}catch(o){M.catch("Error in AnalyticsService constructor: ",o)}}updateDefaultProperties(r={}){this.defaultProperties=$($({},this.defaultProperties),r)}setInstalledFeature(r){try{this.defaultProperties?.installedFeatures||(this.defaultProperties.installedFeatures=[]),this.defaultProperties.installedFeatures.includes(r)||this.defaultProperties.installedFeatures.push(r)}catch(i){M.catch("Error in AnalyticsService setInstalledFeature: ",i)}}setFeatureConfig({feature:r,config:i}){try{this.defaultProperties.featureConfigs||(this.defaultProperties.featureConfigs={}),this.defaultProperties.featureConfigs[r]||(this.defaultProperties.featureConfigs[r]={}),this.defaultProperties.featureConfigs[r]=$($({},this.defaultProperties.featureConfigs[r]),i)}catch(o){M.catch("Error in AnalyticsService setFeatureConfig: ",o)}}setSF(r){try{this.sf=r}catch(i){M.catch("Error in AnalyticsService setSF: ",i)}}setAuthService(r){try{this.authService=r}catch(i){M.catch("Error in AnalyticsService setAuthService: ",i)}}setCommentService(r){try{this.commentService=r}catch(i){M.catch("Error in AnalyticsService setCommentService: ",i)}}setConfigService(r){try{this.configService=r}catch(i){M.catch("Error in AnalyticsService setConfigService: ",i)}}setDomService(r){try{this.domService=r}catch(i){M.catch("Error in AnalyticsService setDomService: ",i)}}setUserService(r){try{this.userService=r}catch(i){M.catch("Error in AnalyticsService setUserService: ",i)}}identifyUser(r,i,o={}){try{this.userId=r;let s=typeof i=="object"?JSON.parse(JSON.stringify(i)):i;this.userService?.externalUserDataProviderAvailable()&&s?.userId&&(s={userId:s.userId}),this.user=s;let a=this.defaultProperties?this.defaultProperties.apiKey:null;if(qt.production||qt.staging){let c=Date.now(),l={userId:r,clientUserId:this.user?.userId,traits:ye($({},s),{apiKey:a,forceReset:o?.forceReset,eventTimestamp:c}),properties:ye($({},this.defaultProperties),{eventTimestamp:c}),sf:this.sf,context:this.getContext(),eventTimestamp:c};this.setAnalytics("identify",l)}if(this.userId&&this.draftEvents?.length){let c=this.draftEvents?.slice();this.draftEvents=[],c?.forEach(l=>{l.type==="track"&&l?.data?.eventName&&this.trackEvent(l.data.eventName,l.data.properties,l.data.mergeDefaultProperties,l.data.userId,l.data.clientUserId)})}}catch(s){M.catch("Error in AnalyticsService identifyUser: ",s)}}trackPage(r,i="",o={}){try{if((qt.production||qt.staging)&&this.userId){let s={userId:this.userId,clientUserId:this.user?.userId,name:r,properties:o,sf:this.sf,context:this.getContext()};this.setAnalytics("page",s)}}catch(s){M.catch("Error in AnalyticsService trackPage: ",s)}}trackEvent(c){return I(this,arguments,function*(r,i={},o=!0,s,a){try{if(this.sf&&ZF.includes(r))return Promise.resolve();if(qt.production||qt.staging)if(this.userId||s){if(this.eventRateLimitCache[r]?.blockedForSession)return Promise.resolve();let l=Date.now();if(this.eventRateLimitCache[r]&&l-this.eventRateLimitCache[r].timestamp<this.TIME_WINDOW_MS){if(this.eventRateLimitCache[r].count>=this.EVENT_LIMIT){if(!this.eventRateLimitCache[r].rateLimitExceededEventTriggered){this.eventRateLimitCache[r].rateLimitExceededEventTriggered=!0,this.eventRateLimitCache[r].blockedForSession=!0;let d=$({eventName:r},i||{});this.triggerTrackEvent(Nt.Events.Core.SDK_EVENT_RATE_LIMIT_EXCEEDED,d,o,s,a)}return Promise.resolve()}this.eventRateLimitCache[r].count++}else this.eventRateLimitCache[r]={count:1,timestamp:l,rateLimitExceededEventTriggered:!1,blockedForSession:!1};return this.triggerTrackEvent(r,i,o,s,a)}else return i?.eventTimestamp||(i.eventTimestamp=Date.now()),this.draftEvents.push({type:"track",data:{eventName:r,properties:i,mergeDefaultProperties:o,userId:s,clientUserId:a}}),Promise.resolve();return Promise.resolve()}catch(l){return M.catch("Error in AnalyticsService trackEvent: ",l),Promise.resolve()}})}triggerTrackEvent(c){return I(this,arguments,function*(r,i={},o=!0,s,a){try{o&&(i||(i={}),i=$($({},i),this.defaultProperties));let l;if(i?.annotationId){let h=i.annotationId;if(!l&&this.commentService){let f=this.commentService.getAnnotationById(h);f?.metadata&&(l=f.metadata),f?.targetElementId&&(i.targetElementId=f.targetElementId);let g=this.commentService.getMultiThreadAnnotationById(h);g?.metadata&&(l=g.metadata),g?.targetElementId&&(i.targetElementId=g.targetElementId)}if(!l){let f=this.serviceBook.get(rT)?.getAnnotationById(h);f?.metadata&&(l=f.metadata)}if(!l&&this.reactionService){let f=this.reactionService.getAnnotationById(h);f?.metadata&&(l=f.metadata),f?.targetElementId&&(i.targetElementId=f.targetElementId)}if(!l&&this.areaService){let f=this.areaService.getAnnotationById(h);f?.metadata&&(l=f.metadata)}}if(l&&typeof l=="object"&&(i=$($({},i),l)),i&&typeof i=="object"&&(i=ye($({},i),{userId:this.userId||s,clientUserId:this.user?.userId||a}),i?.eventTimestamp||(i.eventTimestamp=Date.now()),i?.sessionTabId||(i.sessionTabId=this.domService?.getTabId()),this.liveStateSyncEvents.includes(r))){let h=this.liveStateService?.getSemStats();h&&!i?.semStats&&(i.semStats=h)}let d={userId:this.userId||s,clientUserId:this.user?.userId||a,event:r,properties:i,sf:this.sf,context:this.getContext(),eventTimestamp:i?.eventTimestamp};return this.setAnalytics("track",d)}catch(l){return M.catch("Error in AnalyticsService triggerTrackEvent: ",l),Promise.resolve()}})}setAnalytics(r,i){return I(this,null,function*(){try{return navigator.onLine?new Promise((s,a)=>{this.analyticsQueue.push({type:r,body:i,resolve:s,reject:a}),this.analyticsQueue.length>=this.MAX_BATCH_SIZE?this.flushAnalyticsQueue():this.scheduleBatchFlush()}).catch(()=>{}):void 0}catch(o){return M.catch("Error in AnalyticsService setAnalytics: ",o),Promise.resolve()}})}scheduleBatchFlush(){try{this.batchTimer||(this.batchTimer=setTimeout(()=>{this.batchTimer=null,this.flushAnalyticsQueue()},this.BATCH_WINDOW_MS))}catch(r){M.catch("Error in AnalyticsService scheduleBatchFlush: ",r)}}flushAnalyticsQueue(){return I(this,null,function*(){try{if(this.batchTimer&&(clearTimeout(this.batchTimer),this.batchTimer=null),this.analyticsQueue.length===0||!navigator.onLine)return;let r=[...this.analyticsQueue];this.analyticsQueue=[];try{let i=ed({url:this.endpointsService.getCloudFunctionUrl("sa"),apiProxyDomain:this.configService?.getApiProxyDomain()});if(Nc(i)){this.selfHostedAnalyticsSkipReported||(this.selfHostedAnalyticsSkipReported=!0,M.log("Velt [selfHosted]: analytics telemetry is disabled on this deployment (the `sa` endpoint resolves to the inert self-hosted sentinel). Events are dropped locally with zero egress.")),r.forEach(a=>{try{a.resolve&&a.resolve()}catch(c){M.warn("Error resolving analytics promise: ",c)}});return}let o=ld(this.functions,i,{timeout:1200*1e3}),s=r.map(a=>({type:a.type,data:a.body}));try{yield o({type:"batch",data:s}),r.forEach(a=>{try{a.resolve&&a.resolve()}catch(c){M.warn("Error resolving analytics promise: ",c)}})}catch(a){M.warn("Error in AnalyticsService batch flush: ",a),r.forEach(c=>{try{c.reject&&c.reject(a)}catch(l){M.warn("Error rejecting analytics promise: ",l)}})}}catch(i){M.catch("Error in AnalyticsService flushAnalyticsQueue: ",i),r.forEach(o=>{try{o.reject&&o.reject(i)}catch(s){M.warn("Error rejecting analytics promise: ",s)}})}}catch(r){M.catch("Error in AnalyticsService flushAnalyticsQueue: ",r)}})}trackAuthenticatedEvent(r,i={},o=!0){try{this.authService?.getUser$&&typeof this.authService?.getUser$()?.subscribe=="function"&&(this.authService.getUser()?this.trackEvent(r,i,o):((!i||typeof i!="object")&&(i={}),i?.eventTimestamp||(i.eventTimestamp=Date.now()),this.authService?.getUser$()?.pipe(pn(s=>!!s),gn(1))?.subscribe(()=>{this.trackEvent(r,i,o)})))}catch(s){M.catch("Error in AnalyticsService trackAuthenticatedEvent: ",s)}}getContext(){try{let r={},i=pV();return r.os={name:i?.deviceInfo?.osName,version:i?.deviceInfo?.osVersion},r.page={path:i?.path,title:i?.title,url:i?.url},r.screen={height:i?.deviceInfo?.screenHeight,width:i?.deviceInfo?.screenWidth},r.app={name:i?.deviceInfo?.browserName,version:i?.deviceInfo?.browserVersion},r.device={type:i?.deviceInfo?.deviceType},r.timezone=SV(),r.userAgent=i?.deviceInfo?.userAgent,r}catch(r){M.catch("Error in AnalyticsService getContext: ",r)}}};e.\u0275fac=function(i){return new(i||e)(H(Vo),H(aT))},e.\u0275prov=Q({token:e,factory:e.\u0275fac,providedIn:"root"});let n=e;return n})();var wt=(()=>{let e=class e{get debugMode(){return uV()}get debugContextMode(){return dV()}get logsEnabled(){return this.logsEnabled$.value}constructor(r){this.analyticsService=r,this.logsEnabled$=new ie(!0),this.log("%c[WB] Creating SERVICE LoggingService","color: blue;")}enableLogs(){try{if(this.logsEnabled$.value===!0)return;this.logsEnabled$.next(!0)}catch(r){this.catch("Error in LoggingService enableLogs: ",r)}}disableLogs(){try{if(this.logsEnabled$.value===!1)return;this.logsEnabled$.next(!1)}catch(r){this.catch("Error in LoggingService disableLogs: ",r)}}log(r,...i){this.debugMode&&console.log(r,...i)}logContext(r,...i){this.debugContextMode&&console.log(r,...i)}warn(r,...i){this.debugMode&&console.warn(r,...i)}error(r,...i){this.debugMode&&console.error(r,...i)}debug(r,...i){this.debugMode&&console.debug(r,...i)}info(r,...i){this.debugMode&&console.info(r,...i)}catch(r,i,o,s=!1){try{let a=i?.message;this.logsEnabled$.value&&(a?.toLowerCase()?.includes("permission denied")||a?.toLowerCase()?.includes("permission_denied")||(i!==void 0?console.warn("Velt: ",r,i):console.warn("Velt: ",r))),s||this.analyticsService.trackEvent(Nt.Events.Core.SDK_ERROR,$({sourceMethod:r,message:(i?.message?i?.message:i)||r,clientUserId:this.analyticsService?.user?.userId,snippylyUserId:this.analyticsService?.user?.userSnippylyId,source:"sdk"},o||{}))}catch{}}};e.\u0275fac=function(i){return new(i||e)(H(Vs))},e.\u0275prov=Q({token:e,factory:e.\u0275fac,providedIn:"root"});let n=e;return n})();function ud(n){try{if(typeof n!="string"||!n)return null;let e=n.split(".");if(e.length<2)return null;let t=e[1].replace(/-/g,"+").replace(/_/g,"/");t+="=".repeat((4-t.length%4)%4);let i=JSON.parse(atob(t))?.exp;return typeof i!="number"||!Number.isFinite(i)||i<=0?null:i*1e3}catch{return null}}function rN(n,e){try{if(n===null||!Number.isFinite(e))return null;let t=n-e;if(t<=0)return null;if(t<=5e3)return 1e3;let r=Math.min(Math.max(t*.2,3e4),3e5);return Math.max(t-r,1e3)}catch{return null}}var _G=3e4;function iN(n,e){let t=rN(n,e);return t===null?_G:Math.min(t,_G)}function TG(n,e){let t=ud(n);return t===null?!0:t-e<=0}var YT=[],IG=new Set,Bs={pings:0,pongs:0,lastPongAtMs:0};function lxe(n){try{n==="ping"?Bs.pings++:(Bs.pongs++,Bs.lastPongAtMs=Date.now())}catch{}}function On(n,e){try{for(YT.push({t:Date.now(),kind:n,detail:e});YT.length>60;)YT.shift()}catch{}}function yG(n){return!Number.isFinite(n)||n<0?"?":n<1e3?`${Math.round(n)}ms`:n<6e4?`${Math.round(n/1e3)}s`:`${Math.floor(n/6e4)}m${String(Math.round(n%6e4/1e3)).padStart(2,"0")}s`}function uxe(n,e,t){try{let r=t??n;if(IG.has(r))return;IG.add(r);let i=Date.now(),o=YT.map(a=>` -${yG(i-a.t).padStart(7)} ${a.kind}${a.detail?" "+a.detail:""}`),s=Bs.pings?` Heartbeat: ${Bs.pings} sent, ${Bs.pongs} answered${Bs.lastPongAtMs?`, last answer ${yG(i-Bs.lastPongAtMs)} ago`:", NONE answered"}
|
|
142
|
+
`:` Heartbeat: never ran
|
|
143
|
+
`;console.warn(`Velt [portable backend] SESSION DIAGNOSTIC \u2014 ${n}
|
|
144
|
+
`+(e?` ${e}
|
|
145
|
+
`:"")+s+` Recent session events (most recent last, times relative to now):
|
|
146
|
+
`+(o.length?o.join(`
|
|
147
|
+
`):" (no events recorded)")+`
|
|
148
|
+
This block prints once per distinct problem. If a realtime feature looks stuck, copy it into the issue \u2014 it contains no credentials.`)}catch{}}var ite={fetch:(n,e)=>fetch(n,e)},ote=5e3;function ste(n){return`${n.replace(/\/+$/,"")}/operations/getProjectConfig`}function ate(n,e){return I(this,null,function*(){let t=typeof AbortController<"u"?new AbortController:null,r,i=new Promise(o=>{r=setTimeout(()=>{try{t?.abort()}catch{}o(null)},ote)});try{return yield Promise.race([ite.fetch(n,t?ye($({},e),{signal:t.signal}):e),i])}finally{r!==void 0&&clearTimeout(r)}})}function vG(n){return I(this,null,function*(){let{apiEndpoint:e,token:t}=n;if(!e||!t)return null;if(!Bc(e))return console.error(`Velt [portable backend]: refusing to send the session token to an insecure apiEndpoint (${e}). Project config was not read; https is required (http is allowed on loopback only).`),null;try{let r=yield ate(ste(e),{method:"POST",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json"},body:JSON.stringify({})});if(!r)return null;let i=yield r.json();return!i||i.ok!==!0||!i.data?null:{isPrivateCommentsEnabled:i.data.isPrivateCommentsEnabled===!0,activityConfig:i.data.activityConfig??null}}catch{return null}})}var cte=["unauthenticated","permission-denied","not-found","invalid-argument","failed-precondition","resource-exhausted"],SG=[...cte,"unimplemented"];function AG(n){return!!n&&n.backend==="portable"&&typeof n.wsEndpoint=="string"&&typeof n.apiEndpoint=="string"}var mxe="getaccess-any-user",Exe="ordered-deltas";var XT={import:()=>import("./velt-portable.js")},Er=null,yp=!1;function CG(n){if(Er)Er=Er.then(()=>XT.import().then(e=>{yp=!0,e.default(n)})).catch(e=>{M.catch("Error re-establishing portable session after re-identify: ",e)});else{let e=XT.import().then(t=>{yp=!0,t.default(n)}).catch(t=>{Er===e&&(Er=null),yp=!1,console.warn("Velt [portable backend]: failed to load the portable transport chunk (velt-portable.js). Portable features are disabled for this page load.",t)});Er=e}return Er}function DG(){Er&&(Er=Er.then(()=>yp?XT.import().then(n=>{n.teardownPortableBackend()}):void 0).catch(n=>{M.catch("Error tearing down portable backend session: ",n)}))}function RG(){Er&&(Er=Er.then(()=>yp?XT.import().then(n=>{n.checkPortableBackendLiveness?.()}):void 0).catch(n=>{M.catch("Error checking portable backend liveness: ",n)}))}var NG=(()=>{let e=class e{constructor(r){this.loggingService=r,this.initLocalStorageData()}initLocalStorageData(){this.loggingService.log("%c[WB] Calling FUNCTION: initLocalStorageData","color: green;"),this.getLocalStorageData(),this.getSessionStorageData()}getLocalStorageData(){this.loggingService.log("%c[WB] Calling FUNCTION: getLocalStorageData","color: green;");try{let r=localStorage?.getItem(F.LOCALSTORAGE_DATA_ID);if(r)return JSON.parse(r);{let i=new Ac;return this.setLocalStorageData(i),i}}catch(r){return this.loggingService.catch("Error in getLocalStorageData:",r),new Ac}}setLocalStorageData(r){this.loggingService.log("%c[WB] Calling FUNCTION: setLocalStorageData","color: green;");try{if(r){let i=JSON.stringify(r);localStorage?.setItem(F.LOCALSTORAGE_DATA_ID,i)}}catch(i){this.loggingService.catch("Error in setLocalStorageData:",i)}}deleteLocalStorageData(){this.loggingService.log("%c[WB] Calling FUNCTION: deleteLocalStorageData","color: green;"),localStorage?.removeItem(F.LOCALSTORAGE_DATA_ID)}getSessionStorageData(){this.loggingService.log("%c[WB] Calling FUNCTION: getSessionStorageData","color: green;");try{let r=sessionStorage?.getItem(F.LOCALSTORAGE_DATA_ID);if(r)return JSON.parse(r);{let i=new Ac;return this.setSessionStorageData(i),i}}catch(r){return this.loggingService.catch("Error in getSessionStorageData:",r),new Ac}}setSessionStorageData(r){this.loggingService.log("%c[WB] Calling FUNCTION: setSessionStorageData","color: green;");try{if(r){let i=JSON.stringify(r);sessionStorage?.setItem(F.LOCALSTORAGE_DATA_ID,i)}}catch(i){this.loggingService.catch("Error in setSessionStorageData:",i)}}deleteSessionStorageData(){this.loggingService.log("%c[WB] Calling FUNCTION: deleteSessionStorageData","color: green;");try{sessionStorage?.removeItem(F.LOCALSTORAGE_DATA_ID)}catch(r){this.loggingService.catch("Error in deleteSessionStorageData:",r)}}};e.\u0275fac=function(i){return new(i||e)(H(wt))},e.\u0275prov=Q({token:e,factory:e.\u0275fac,providedIn:"root"});let n=e;return n})();var wG=(()=>{let e=class e{constructor(r,i){this.localStorageService=r,this.loggingService=i,this.avatarList=[{userId:"1",name:"Bear",photoUrl:"https://snippyly.com/assets/avatars/avatar-bear.svg",type:"anonymous"},{userId:"2",name:"Beaver",photoUrl:"https://snippyly.com/assets/avatars/avatar-beaver.svg",type:"anonymous"},{userId:"3",name:"Bunny",photoUrl:"https://snippyly.com/assets/avatars/avatar-bunny.svg",type:"anonymous"},{userId:"4",name:"Cat",photoUrl:"https://snippyly.com/assets/avatars/avatar-cat.svg",type:"anonymous"},{userId:"5",name:"Cow",photoUrl:"https://snippyly.com/assets/avatars/avatar-cow.svg",type:"anonymous"},{userId:"6",name:"Dinosaur",photoUrl:"https://snippyly.com/assets/avatars/avatar-dinosaur.svg",type:"anonymous"},{userId:"7",name:"Elephant",photoUrl:"https://snippyly.com/assets/avatars/avatar-elephant.svg",type:"anonymous"},{userId:"8",name:"Monkey",photoUrl:"https://snippyly.com/assets/avatars/avatar-monkey.svg",type:"anonymous"},{userId:"9",name:"Hedgehog",photoUrl:"https://snippyly.com/assets/avatars/avatar-hedgehog.svg",type:"anonymous"},{userId:"10",name:"Hippo",photoUrl:"https://snippyly.com/assets/avatars/avatar-hippo.svg",type:"anonymous"},{userId:"11",name:"Horse",photoUrl:"https://snippyly.com/assets/avatars/avatar-horse.svg",type:"anonymous"},{userId:"12",name:"Kitten",photoUrl:"https://snippyly.com/assets/avatars/avatar-kitten.svg",type:"anonymous"},{userId:"13",name:"Octopus",photoUrl:"https://snippyly.com/assets/avatars/avatar-octopus.svg",type:"anonymous"},{userId:"14",name:"Oink",photoUrl:"https://snippyly.com/assets/avatars/avatar-oink.svg",type:"anonymous"},{userId:"15",name:"Panda",photoUrl:"https://snippyly.com/assets/avatars/avatar-panda.svg",type:"anonymous"},{userId:"16",name:"Penguin",photoUrl:"https://snippyly.com/assets/avatars/avatar-penguin.svg",type:"anonymous"},{userId:"17",name:"Rabbit",photoUrl:"https://snippyly.com/assets/avatars/avatar-rabbit.svg",type:"anonymous"},{userId:"18",name:"Tiger",photoUrl:"https://snippyly.com/assets/avatars/avatar-tiger.svg",type:"anonymous"}],this.loggingService.log("%c[WB] Creating SERVICE AvatarService","color: blue;")}getSessionAvatar(){this.loggingService.log("%c[WB] Calling FUNCTION: getSessionAvatar","color: green;");try{let r=new $i,i=this.localStorageService.getSessionStorageData();if(i.snippylyAvatar)r=i.snippylyAvatar;else{let o=this.generateUserAvatar();i.snippylyAvatar=o,this.localStorageService.setSessionStorageData(i)}return r}catch(r){return this.loggingService.catch("Error in getSessionAvatar:",r),new $i}}generateUserAvatar(){this.loggingService.log("%c[WB] Calling FUNCTION: generateUserAvatar","color: green;");try{let r=Math.floor(Math.random()*this.avatarList.length),i=this.avatarList[r];return i.color=this.generateUserColor(),i}catch(r){return this.loggingService.catch("Error in generateUserAvatar:",r),this.avatarList[0]}}generateUserColor(r){this.loggingService.log("%c[WB] Calling FUNCTION: generateUserColor","color: green;");try{if(r)return F.AVATAR_COLOR_LIST[r%F.AVATAR_COLOR_LIST.length];let i=Math.floor(Math.random()*F.AVATAR_COLOR_LIST.length);return F.AVATAR_COLOR_LIST[i]}catch(i){return this.loggingService.catch("Error in generateUserColor:",i),""}}generateUserImage(){this.loggingService.log("%c[WB] Calling FUNCTION: generateUserImage","color: green;");try{return this.getSessionAvatar().photoUrl}catch(r){return this.loggingService.catch("Error in generateUserImage:",r),""}}};e.\u0275fac=function(i){return new(i||e)(H(NG),H(wt))},e.\u0275prov=Q({token:e,factory:e.\u0275fac,providedIn:"root"});let n=e;return n})();var bG=(()=>{let e=class e{constructor(r){this.loggingService=r,this.actionSubjects=new Map,this.subscriptions=[]}triggerAction(r,i){try{this.actionSubjects.has(r)||this.actionSubjects.set(r,new Ct),this.actionSubjects.get(r)?.next(i)}catch(o){this.loggingService.catch("Error in CoreActionsService triggerAction: ",o)}}onAction(r){try{this.actionSubjects.has(r)||this.actionSubjects.set(r,new Ct);let i=this.actionSubjects.get(r);return i?i.asObservable():ct(null)}catch(i){return this.loggingService.catch("Error in CoreActionsService onAction: ",i),ct(null)}}};e.\u0275fac=function(i){return new(i||e)(H(wt))},e.\u0275prov=Q({token:e,factory:e.\u0275fac,providedIn:"root"});let n=e;return n})();function OG(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function hte(n){if(Array.isArray(n))return n}function fte(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,s,a=[],c=!0,l=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(c=(r=o.call(t)).done)&&(a.push(r.value),a.length!==e);c=!0);}catch(d){l=!0,i=d}finally{try{if(!c&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(l)throw i}}return a}}function pte(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
149
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gte(n,e){return hte(n)||fte(n,e)||mte(n,e)||pte()}function mte(n,e){if(n){if(typeof n=="string")return OG(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?OG(n,e):void 0}}var zG=Object.entries,MG=Object.setPrototypeOf,Ete=Object.isFrozen,_te=Object.getPrototypeOf,Tte=Object.getOwnPropertyDescriptor,Xt=Object.freeze,an=Object.seal,dd=Object.create,qG=typeof Reflect<"u"&&Reflect,dN=qG.apply,hN=qG.construct;Xt||(Xt=function(e){return e});an||(an=function(e){return e});dN||(dN=function(e,t){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];return e.apply(t,i)});hN||(hN=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return new e(...r)});var Hc=kt(Array.prototype.forEach),Ite=kt(Array.prototype.lastIndexOf),LG=kt(Array.prototype.pop),vp=kt(Array.prototype.push),yte=kt(Array.prototype.splice),hd=Array.isArray,Cp=kt(String.prototype.toLowerCase),oN=kt(String.prototype.toString),PG=kt(String.prototype.match),Sp=kt(String.prototype.replace),xG=kt(String.prototype.indexOf),vte=kt(String.prototype.trim),Ste=kt(Number.prototype.toString),Ate=kt(Boolean.prototype.toString),kG=typeof BigInt>"u"?null:kt(BigInt.prototype.toString),FG=typeof Symbol>"u"?null:kt(Symbol.prototype.toString),er=kt(Object.prototype.hasOwnProperty),Ap=kt(Object.prototype.toString),Mn=kt(RegExp.prototype.test),jc=Cte(TypeError);function kt(n){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return dN(n,e,r)}}function Cte(n){return function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return hN(n,t)}}function xe(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Cp;if(MG&&MG(n,null),!hd(e))return n;let r=e.length;for(;r--;){let i=e[r];if(typeof i=="string"){let o=t(i);o!==i&&(Ete(e)||(e[r]=o),i=o)}n[i]=!0}return n}function Dte(n){for(let e=0;e<n.length;e++)er(n,e)||(n[e]=null);return n}function Tr(n){let e=dd(null);for(let r of zG(n)){var t=gte(r,2);let i=t[0],o=t[1];er(n,i)&&(hd(o)?e[i]=Dte(o):o&&typeof o=="object"&&o.constructor===Object?e[i]=Tr(o):e[i]=o)}return e}function Rte(n){switch(typeof n){case"string":return n;case"number":return Ste(n);case"boolean":return Ate(n);case"bigint":return kG?kG(n):"0";case"symbol":return FG?FG(n):"Symbol()";case"undefined":return Ap(n);case"function":case"object":{if(n===null)return Ap(n);let e=n,t=Vr(e,"toString");if(typeof t=="function"){let r=t(e);return typeof r=="string"?r:Ap(r)}return Ap(n)}default:return Ap(n)}}function Vr(n,e){for(;n!==null;){let r=Tte(n,e);if(r){if(r.get)return kt(r.get);if(typeof r.value=="function")return kt(r.value)}n=_te(n)}function t(){return null}return t}function Nte(n){try{return Mn(n,""),!0}catch{return!1}}var UG=Xt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),sN=Xt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),aN=Xt(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),wte=Xt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),cN=Xt(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),bte=Xt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),VG=Xt(["#text"]),BG=Xt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),lN=Xt(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),GG=Xt(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),QT=Xt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Ote=an(/{{[\w\W]*|^[\w\W]*}}/g),Mte=an(/<%[\w\W]*|^[\w\W]*%>/g),Lte=an(/\${[\w\W]*/g),Pte=an(/^data-[\-\w.\u00B7-\uFFFF]+$/),xte=an(/^aria-[\-\w]+$/),jG=an(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),kte=an(/^(?:\w+script|data):/i),Fte=an(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ute=an(/^html$/i),Vte=an(/^[a-z][.\w]*(-[.\w]+)+$/i),HG=an(/<[/\w!]/g),$G=an(/<[/\w]/g),Bte=an(/<\/no(script|embed|frames)/i),Gte=an(/\/>/i),_r={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},KG=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],jte=Xt(xe({},KG)),Hte=(function(){let n={};return Hc(KG,e=>{n[e]=an(new RegExp("</"+e+"(?=[\\t\\n\\f\\r />])","i"))}),Xt(n)})(),$te=function(){return typeof window>"u"?null:window},Wte=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null,i="data-tt-policy-suffix";t&&t.hasAttribute(i)&&(r=t.getAttribute(i));let o="dompurify"+(r?"#"+r:"");try{return e.createPolicy(o,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},WG=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Gs=function(e,t,r,i){return er(e,t)&&hd(e[t])?xe(i.base?Tr(i.base):{},e[t],i.transform):r},uN=function(e,t,r){let i=er(e,t)?e[t]:void 0;return i&&typeof i=="object"?Tr(i):r()};function YG(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:$te(),e=W=>YG(W);if(e.version="3.4.15",e.removed=[],!n||!n.document||n.document.nodeType!==_r.document||!n.Element)return e.isSupported=!1,e;let t=n.document,r=t,i=r.currentScript;n.DocumentFragment;let o=n.HTMLTemplateElement,s=n.Node,a=n.Element,c=n.NodeFilter,l=n.NamedNodeMap;l===void 0&&(n.NamedNodeMap||n.MozNamedAttrMap),n.HTMLFormElement;let d=n.DOMParser,h=n.trustedTypes,f=a.prototype,g=Vr(f,"cloneNode"),E=Vr(f,"remove"),v=Vr(f,"removeAttributeNode"),S=Vr(f,"nextSibling"),P=Vr(f,"childNodes"),V=Vr(f,"parentNode"),K=Vr(f,"shadowRoot"),oe=Vr(f,"attributes"),ge=s&&s.prototype?Vr(s.prototype,"nodeType"):null,te=s&&s.prototype?Vr(s.prototype,"nodeName"):null,C=s&&s.prototype?Vr(s.prototype,"ownerDocument"):null,y=function(T){return ge?ge(T):T.nodeType},A=function(T){return te?te(T):T.nodeName};if(typeof o=="function"){let W=t.createElement("template");W.content&&W.content.ownerDocument&&(t=W.content.ownerDocument)}let R,N="",O,D=!1,Fn=0,Xo=function(){if(Fn>0)throw jc('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},Qo=function(T){Xo(),Fn++;try{return R.createHTML(T)}finally{Fn--}},Ia=function(T){Xo(),Fn++;try{return R.createScriptURL(T)}finally{Fn--}},ya=function(){return D||(O=Wte(h,i),D=!0),O},Jo=t,Ol=Jo.implementation,rm=Jo.createNodeIterator,mi=Jo.createDocumentFragment,tn=Jo.getElementsByTagName,yv=r.importNode,je=WG();e.isSupported=typeof zG=="function"&&typeof V=="function"&&Ol&&Ol.createHTMLDocument!==void 0;let vv=Ote,va=Mte,Sv=Lte,Av=Pte,Ml=xte,Ll=kte,Pl=Fte,Ah=Vte,xl=jG,Qe=null,kl=xe({},[...UG,...sN,...aN,...cN,...VG]),nt=null,Ch=xe({},[...BG,...lN,...GG,...QT]),ir=Object.seal(dd(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Zo=null,Fl=null,Hr=Object.seal(dd(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),im=!0,Sa=!0,Ul=!1,Vl=!0,ut=!1,Tt=!0,Rr=!1,Bl=!1,Aa=null,Gl=null,so=!1,ao=!1,Ca=!1,es=!1,om=!0,sm=!1,jl="user-content-",Hl=!0,$l=!1,Nr={},Ei=null,Wl=xe({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]),_i=null,Dh=xe({},["audio","video","img","source","image","track"]),Da=null,Rh=xe({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ti="http://www.w3.org/1998/Math/MathML",Ra="http://www.w3.org/2000/svg",at="http://www.w3.org/1999/xhtml",co=at,lo=!1,uo=null,Cv=xe({},[Ti,Ra,at],oN),am=Xt(["mi","mo","mn","ms","mtext"]),Ii=xe({},am),cm=Xt(["annotation-xml"]),Nh=xe({},cm),zl=xe({},["title","style","font","a","script"]),ts=null,wh=["application/xhtml+xml","text/html"],ql="text/html",He=null,ho=null,lm=t.createElement("form"),Kl=function(T){return T instanceof RegExp||T instanceof Function},Na=function(){let T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ho&&ho===T)return;(!T||typeof T!="object")&&(T={}),T=Tr(T),ts=wh.indexOf(T.PARSER_MEDIA_TYPE)===-1?ql:T.PARSER_MEDIA_TYPE,He=ts==="application/xhtml+xml"?oN:Cp,Qe=Gs(T,"ALLOWED_TAGS",kl,{transform:He}),nt=Gs(T,"ALLOWED_ATTR",Ch,{transform:He}),uo=Gs(T,"ALLOWED_NAMESPACES",Cv,{transform:oN}),Da=Gs(T,"ADD_URI_SAFE_ATTR",Rh,{transform:He,base:Rh}),_i=Gs(T,"ADD_DATA_URI_TAGS",Dh,{transform:He,base:Dh}),Ei=Gs(T,"FORBID_CONTENTS",Wl,{transform:He}),Zo=Gs(T,"FORBID_TAGS",Tr({}),{transform:He}),Fl=Gs(T,"FORBID_ATTR",Tr({}),{transform:He}),Nr=er(T,"USE_PROFILES")?T.USE_PROFILES&&typeof T.USE_PROFILES=="object"?Tr(T.USE_PROFILES):T.USE_PROFILES:!1,im=T.ALLOW_ARIA_ATTR!==!1,Sa=T.ALLOW_DATA_ATTR!==!1,Ul=T.ALLOW_UNKNOWN_PROTOCOLS||!1,Vl=T.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ut=T.SAFE_FOR_TEMPLATES||!1,Tt=T.SAFE_FOR_XML!==!1,Rr=T.WHOLE_DOCUMENT||!1,ao=T.RETURN_DOM||!1,Ca=T.RETURN_DOM_FRAGMENT||!1,es=T.RETURN_TRUSTED_TYPE||!1,so=T.FORCE_BODY||!1,om=T.SANITIZE_DOM!==!1,sm=T.SANITIZE_NAMED_PROPS||!1,Hl=T.KEEP_CONTENT!==!1,$l=T.IN_PLACE||!1,xl=Nte(T.ALLOWED_URI_REGEXP)?T.ALLOWED_URI_REGEXP:jG,co=typeof T.NAMESPACE=="string"?T.NAMESPACE:at,Ii=uN(T,"MATHML_TEXT_INTEGRATION_POINTS",()=>xe({},am)),Nh=uN(T,"HTML_INTEGRATION_POINTS",()=>xe({},cm));let w=uN(T,"CUSTOM_ELEMENT_HANDLING",()=>dd(null));if(ir=dd(null),er(w,"tagNameCheck")&&Kl(w.tagNameCheck)&&(ir.tagNameCheck=w.tagNameCheck),er(w,"attributeNameCheck")&&Kl(w.attributeNameCheck)&&(ir.attributeNameCheck=w.attributeNameCheck),er(w,"allowCustomizedBuiltInElements")&&typeof w.allowCustomizedBuiltInElements=="boolean"&&(ir.allowCustomizedBuiltInElements=w.allowCustomizedBuiltInElements),an(ir),ut&&(Sa=!1),Ca&&(ao=!0),Nr&&(Qe=xe({},VG),nt=dd(null),Nr.html===!0&&(xe(Qe,UG),xe(nt,BG)),Nr.svg===!0&&(xe(Qe,sN),xe(nt,lN),xe(nt,QT)),Nr.svgFilters===!0&&(xe(Qe,aN),xe(nt,lN),xe(nt,QT)),Nr.mathMl===!0&&(xe(Qe,cN),xe(nt,GG),xe(nt,QT))),Hr.tagCheck=null,Hr.attributeCheck=null,er(T,"ADD_TAGS")&&(typeof T.ADD_TAGS=="function"?Hr.tagCheck=T.ADD_TAGS:hd(T.ADD_TAGS)&&(Qe===kl&&(Qe=Tr(Qe)),xe(Qe,T.ADD_TAGS,He))),er(T,"ADD_ATTR")&&(typeof T.ADD_ATTR=="function"?Hr.attributeCheck=T.ADD_ATTR:hd(T.ADD_ATTR)&&(nt===Ch&&(nt=Tr(nt)),xe(nt,T.ADD_ATTR,He))),er(T,"ADD_FORBID_CONTENTS")&&hd(T.ADD_FORBID_CONTENTS)&&(Ei===Wl&&(Ei=Tr(Ei)),xe(Ei,T.ADD_FORBID_CONTENTS,He)),Hl&&(Qe["#text"]=!0),Rr&&xe(Qe,["html","head","body"]),Qe.table&&(xe(Qe,["tbody"]),delete Zo.tbody),T.TRUSTED_TYPES_POLICY){if(typeof T.TRUSTED_TYPES_POLICY.createHTML!="function")throw jc('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof T.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw jc('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');let B=R;R=T.TRUSTED_TYPES_POLICY;try{N=Qo("")}catch(ee){throw R=B,ee}}else T.TRUSTED_TYPES_POLICY===null?(R=void 0,N=""):(R===void 0&&(R=ya()),R&&typeof N=="string"&&(N=Qo("")));Xt&&Xt(T),ho=T},bh=xe({},[...sN,...aN,...wte]),Oh=xe({},[...cN,...bte]),Dv=function(T,w,B){return w.namespaceURI===at?T==="svg":w.namespaceURI===Ti?T==="svg"&&(B==="annotation-xml"||Ii[B]):!!bh[T]},Yl=function(T,w,B){return w.namespaceURI===at?T==="math":w.namespaceURI===Ra?T==="math"&&Nh[B]:!!Oh[T]},um=function(T,w,B){return w.namespaceURI===Ra&&!Nh[B]||w.namespaceURI===Ti&&!Ii[B]?!1:!Oh[T]&&(zl[T]||!bh[T])},Mh=function(T){let w=V(T);(!w||!w.tagName)&&(w={namespaceURI:co,tagName:"template"});let B=Cp(T.tagName),ee=Cp(w.tagName);return uo[T.namespaceURI]?T.namespaceURI===Ra?Dv(B,w,ee):T.namespaceURI===Ti?Yl(B,w,ee):T.namespaceURI===at?um(B,w,ee):!!(ts==="application/xhtml+xml"&&uo[T.namespaceURI]):!1},Wn=function(T){vp(e.removed,{element:T});try{V(T).removeChild(T)}catch{if(E(T),!V(T))throw jc("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},yi=function(T,w,B){try{v(T,w)}catch{try{T.removeAttribute(B)}catch{}}},ns=function(T){wa(T);let w=P(T);if(w){let ee=[];Hc(w,ce=>{vp(ee,ce)}),Hc(ee,ce=>{try{E(ce)}catch{}})}let B=oe(T);if(B)for(let ee=B.length-1;ee>=0;--ee){let ce=B[ee],de=ce&&ce.name;typeof de=="string"&&yi(T,ce,de)}},fo=function(T,w,B){if(!B)try{B=w.getAttributeNode(T)}catch{B=null}vp(e.removed,{attribute:B||null,from:w});try{B?v(w,B):w.removeAttribute(T)}catch{try{w.removeAttribute(T)}catch{}}if(T==="is")if(ao||Ca)try{Wn(w)}catch{}else try{w.setAttribute(T,"")}catch{}},dm=function(T){let w=oe(T);if(w)for(let B=w.length-1;B>=0;--B){let ee=w[B],ce=ee&&ee.name;typeof ce!="string"||nt[He(ce)]||yi(T,ee,ce)}},wa=function(T){let w=[T];for(;w.length>0;){let B=w.pop();y(B)===_r.element&&dm(B);let ce=P(B);if(ce)for(let de=ce.length-1;de>=0;--de)w.push(ce[de])}},Lh=function(T,w){return Tt?T==="patchsrc"?!0:T==="for"&&w!=="label"&&w!=="output":!1},Ph=function(T){if(!Tt)return;let w=[T];for(;w.length>0;){let B=w.pop(),ee=y(B);if(ee===_r.processingInstruction||ee===_r.comment&&Mn($G,B.data)){try{E(B)}catch{}continue}if(ee===_r.element){let de=B,Ze=He(A(B));try{de.hasAttribute&&de.hasAttribute("patchsrc")&&de.removeAttribute("patchsrc"),de.hasAttribute&&de.hasAttribute("for")&&Lh("for",Ze)&&de.removeAttribute("for")}catch{}}let ce=P(B);if(ce)for(let de=ce.length-1;de>=0;--de)w.push(ce[de])}},Xl=function(T){let w=null,B=null;if(so)T="<remove></remove>"+T;else{let de=PG(T,/^[\r\n\t ]+/);B=de&&de[0]}ts==="application/xhtml+xml"&&co===at&&(T='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+T+"</body></html>");let ee=R?Qo(T):T;if(co===at)try{w=new d().parseFromString(ee,ts)}catch{}if(!w||!w.documentElement){w=Ol.createDocument(co,"template",null);try{w.documentElement.innerHTML=lo?N:ee}catch{}}let ce=w.body||w.documentElement;return T&&B&&ce.insertBefore(t.createTextNode(B),ce.childNodes[0]||null),co===at?tn.call(w,Rr?"html":"body")[0]:Rr?w.documentElement:ce},xh=function(T){let w=C?C(T):T.ownerDocument;return rm.call(w||T,T,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},ba=function(T){return T=Sp(T,vv," "),T=Sp(T,va," "),T=Sp(T,Sv," "),T},kh=function(T){var w;T.normalize();let B=C?C(T):T.ownerDocument,ee=rm.call(B||T,T,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),ce=ee.nextNode();for(;ce;)ce.data=ba(ce.data),ce=ee.nextNode();let de=(w=T.querySelectorAll)===null||w===void 0?void 0:w.call(T,"template");de&&Hc(de,Ze=>{po(Ze.content)&&kh(Ze.content)})},Ql=function(T){let w=te?te(T):null;return typeof w!="string"||He(w)!=="form"?!1:typeof T.nodeName!="string"||typeof T.textContent!="string"||typeof T.removeChild!="function"||T.attributes!==oe(T)||typeof T.removeAttribute!="function"||typeof T.removeAttributeNode!="function"||typeof T.getAttributeNode!="function"||typeof T.setAttribute!="function"||typeof T.namespaceURI!="string"||typeof T.insertBefore!="function"||typeof T.hasChildNodes!="function"||T.nodeType!==ge(T)||T.childNodes!==P(T)},po=function(T){if(!ge||typeof T!="object"||T===null)return!1;try{return ge(T)===_r.documentFragment}catch{return!1}},rs=function(T){if(!ge||typeof T!="object"||T===null)return!1;try{return typeof ge(T)=="number"}catch{return!1}};function wr(W,T,w){W.length!==0&&Hc(W,B=>{B.call(e,T,w,ho)})}let go=function(T,w){return!!(Tt&&T.hasChildNodes()&&!rs(T.firstElementChild)&&Mn(HG,T.textContent)&&Mn(HG,T.innerHTML)||Tt&&T.namespaceURI===at&&jte[w]&&(rs(T.firstElementChild)||typeof T.textContent=="string"&&Mn(Hte[w],T.textContent))||T.nodeType===_r.processingInstruction||Tt&&T.nodeType===_r.comment&&Mn($G,T.data))},zn=function(T,w){if(T instanceof RegExp)return Mn(T,w);if(T instanceof Function){for(var B=arguments.length,ee=new Array(B>2?B-2:0),ce=2;ce<B;ce++)ee[ce-2]=arguments[ce];return!!T(w,...ee)}return!1},Jl=function(T,w,B){if(!Zo[w]&&is(w)&&zn(ir.tagNameCheck,w))return!1;if(Hl&&!Ei[w]){let ee=V(T),ce=P(T);if(ce&&ee){let de=ce.length;for(let Ze=de-1;Ze>=0;--Ze){let dt=T===B?g(ce[Ze],!0):ce[Ze];ee.insertBefore(dt,S(T))}}}return Wn(T),!0},Oa=function(T,w,B,ee){return T.length===0?w:w===B||w===ee?Tr(w):w},Fh=function(T,w){return T===w||V(T)!==null?!1:($l&&wa(T),!0)},Je=function(T,w){if(wr(je.beforeSanitizeElements,T,null),Fh(T,w))return!0;if(Ql(T))return Wn(T),!0;let B=He(A(T));if(Qe=Oa(je.uponSanitizeElement,Qe,kl,Aa),wr(je.uponSanitizeElement,T,{tagName:B,allowedTags:Qe}),Fh(T,w))return!0;if(go(T,B))return Wn(T),!0;if(Zo[B]||!(Hr.tagCheck instanceof Function&&Hr.tagCheck(B))&&!Qe[B]){let ce=Jl(T,B,w);return ce===!1&&wr(je.afterSanitizeElements,T,null),ce}if(y(T)===_r.element&&!Mh(T)||(B==="noscript"||B==="noembed"||B==="noframes")&&Mn(Bte,T.innerHTML))return Wn(T),!0;if(ut&&T.nodeType===_r.text){let ce=ba(T.textContent);T.textContent!==ce&&(vp(e.removed,{element:T.cloneNode()}),T.textContent=ce)}return wr(je.afterSanitizeElements,T,null),!1},Ma=function(T,w,B){if(Fl[w]||Lh(w,T)||om&&(w==="id"||w==="name")&&(B in t||B in lm))return!1;let ee=nt[w]||Hr.attributeCheck instanceof Function&&Hr.attributeCheck(w,T);return Sa&&Mn(Av,w)||im&&Mn(Ml,w)?!0:ee?Da[w]||Mn(xl,Sp(B,Pl,""))||(w==="src"||w==="xlink:href"||w==="href")&&T!=="script"&&xG(B,"data:")===0&&_i[T]||Ul&&!Mn(Ll,Sp(B,Pl,""))?!0:!B:is(T)&&zn(ir.tagNameCheck,T)&&zn(ir.attributeNameCheck,w,T)||w==="is"&&ir.allowCustomizedBuiltInElements&&zn(ir.tagNameCheck,B)},La=xe({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),is=function(T){return!La[Cp(T)]&&Mn(Ah,T)},Rv=function(T,w,B,ee){if(R&&typeof h=="object"&&typeof h.getAttributeType=="function"&&!B)switch(h.getAttributeType(T,w)){case"TrustedHTML":return Qo(ee);case"TrustedScriptURL":return Ia(ee)}return ee},hm=function(T,w,B,ee){try{return B?T.setAttributeNS(B,w,ee):T.setAttribute(w,ee),Ql(T)?(Wn(T),!1):!0}catch{return fo(w,T),!1}},fm=function(T){wr(je.beforeSanitizeAttributes,T,null);let w=T.attributes;if(!w||Ql(T))return;nt=Oa(je.uponSanitizeAttribute,nt,Ch,Gl);let B={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:nt,forceKeepAttr:void 0},ee=w.length,ce=He(T.nodeName);for(;ee--;){let de=w[ee],Ze=de.name,dt=de.namespaceURI,Tn=de.value,It=He(Ze),Vh=Tn,hn=Ze==="value"?Vh:vte(Vh),os=!1;if(B.attrName=It,B.attrValue=hn,B.keepAttr=!0,B.forceKeepAttr=void 0,wr(je.uponSanitizeAttribute,T,B),hn=B.attrValue,sm&&(It==="id"||It==="name")&&xG(hn,jl)!==0&&(fo(Ze,T,de),hn=jl+hn,os=!0),Tt&&Mn(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,hn)){fo(Ze,T,de);continue}if(It==="attributename"&&PG(hn,"href")){fo(Ze,T,de);continue}if(!B.forceKeepAttr){if(!B.keepAttr){fo(Ze,T,de);continue}if(!Vl&&Mn(Gte,hn)){fo(Ze,T,de);continue}if(ut&&(hn=ba(hn)),!Ma(ce,It,hn)){fo(Ze,T,de);continue}hn=Rv(ce,It,dt,hn),hn!==Vh&&hm(T,Ze,dt,hn)&&os&&LG(e.removed)}}wr(je.afterSanitizeAttributes,T,null)},Zl=function(T){let w=null,B=xh(T);for(wr(je.beforeSanitizeShadowDOM,T,null);w=B.nextNode();)if(wr(je.uponSanitizeShadowNode,w,null),Je(w,T),fm(w),po(w.content)&&Zl(w.content),y(w)===_r.element){let ee=K(w);po(ee)&&(Uh(ee),Zl(ee))}wr(je.afterSanitizeShadowDOM,T,null)},Uh=function(T){let w=[{node:T,shadow:null}];for(;w.length>0;){let B=w.pop();if(B.shadow){Zl(B.shadow);continue}let ee=B.node,de=y(ee)===_r.element,Ze=P(ee);if(Ze)for(let dt=Ze.length-1;dt>=0;--dt)w.push({node:Ze[dt],shadow:null});if(de){let dt=te?te(ee):null;if(typeof dt=="string"&&He(dt)==="template"){let Tn=ee.content;po(Tn)&&w.push({node:Tn,shadow:null})}}if(de){let dt=K(ee);po(dt)&&w.push({node:null,shadow:dt},{node:dt,shadow:null})}}};return e.sanitize=function(W){let T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},w=null,B=null,ee=null,ce=null;if(lo=!W,lo&&(W="<!-->"),typeof W!="string"&&!rs(W)&&(W=Rte(W),typeof W!="string"))throw jc("dirty is not a string, aborting");if(!e.isSupported)return W;Bl?(Qe=Aa,nt=Gl):Na(T),(je.uponSanitizeElement.length>0||je.uponSanitizeAttribute.length>0)&&(Qe=Tr(Qe)),je.uponSanitizeAttribute.length>0&&(nt=Tr(nt)),e.removed=[];let de=$l&&typeof W!="string"&&rs(W);if(de){Ph(W);let Tn=A(W);if(typeof Tn=="string"){let It=He(Tn);if(!Qe[It]||Zo[It])throw ns(W),jc("root node is forbidden and cannot be sanitized in-place")}if(Ql(W))throw ns(W),jc("root node is clobbered and cannot be sanitized in-place");try{Uh(W)}catch(It){throw ns(W),It}}else if(rs(W))w=Xl("<!---->"),B=w.ownerDocument.importNode(W,!0),B.nodeType===_r.element&&B.nodeName==="BODY"||B.nodeName==="HTML"?w=B:w.appendChild(B),Uh(w);else{if(!ao&&!ut&&!Rr&&W.indexOf("<")===-1)return R&&es?Qo(W):W;if(w=Xl(W),!w)return ao?null:es?N:""}w&&so&&Wn(w.firstChild);let Ze=de?W:w;try{let Tn=xh(Ze);for(;ee=Tn.nextNode();)Je(ee,Ze),fm(ee),po(ee.content)&&Zl(ee.content)}catch(Tn){throw de&&(ns(W),Hc(e.removed,It=>{It.element&&wa(It.element)})),Tn}if(de)return Hc(e.removed,Tn=>{Tn.element&&wa(Tn.element)}),ut&&kh(W),W;if(ao){if(ut&&kh(w),Ca)for(ce=mi.call(w.ownerDocument);w.firstChild;)ce.appendChild(w.firstChild);else ce=w;return(nt.shadowroot||nt.shadowrootmode)&&(ce=yv.call(r,ce,!0)),ce}let dt=Rr?w.outerHTML:w.innerHTML;return Rr&&Qe["!doctype"]&&w.ownerDocument&&w.ownerDocument.doctype&&w.ownerDocument.doctype.name&&Mn(Ute,w.ownerDocument.doctype.name)&&(dt="<!DOCTYPE "+w.ownerDocument.doctype.name+`>
|
|
150
|
+
`+dt),ut&&(dt=ba(dt)),R&&es?Qo(dt):dt},e.setConfig=function(){let W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Na(W),Bl=!0,Aa=Qe,Gl=nt},e.clearConfig=function(){ho=null,Bl=!1,Aa=null,Gl=null,R=O,N=""},e.isValidAttribute=function(W,T,w){ho||Na({});let B=He(W),ee=He(T);return Ma(B,ee,w)},e.addHook=function(W,T){typeof T=="function"&&er(je,W)&&vp(je[W],T)},e.removeHook=function(W,T){if(er(je,W)){if(T!==void 0){let w=Ite(je[W],T);return w===-1?void 0:yte(je[W],w,1)[0]}return LG(je[W])}},e.removeHooks=function(W){er(je,W)&&(je[W]=[])},e.removeAllHooks=function(){je=WG()},e}var JT=YG();var zte=/^\/\/\*\[@id='([^']+)'\]/;function fN(n){try{if(typeof n!="string")return null;let e=zte.exec(n);if(!e)return null;let t=e[1],r=n.slice(e[0].length);if(!r)return{rootId:t,segments:[]};if(!r.startsWith("/"))return null;let i=[],o="",s=0,a=null;for(let c=1;c<r.length;c++){let l=r[c];if(a){l===a&&(a=null),o+=l;continue}if(l==="'"||l==='"')a=l;else if(l==="[")s++;else if(l==="]")s--;else if(l==="/"&&s===0){if(!o)return null;i.push(o),o="";continue}o+=l}return!o||a||s!==0?null:(i.push(o),{rootId:t,segments:i})}catch{return null}}var qte=[/:r[0-9a-z]+:/i,/_r_[0-9a-z]+_/i,/«r[0-9a-z]+»/i,/^radix-/i];function XG(n){try{return n?qte.some(e=>e.test(n)):!1}catch{return!1}}var QG={ADD_TAGS:["velt-skeleton-loader"],ADD_ATTR:["border-radius","target"]},JG=(()=>{let e=class e{constructor(r,i,o,s){this.analyticsService=r,this.rendererFactory2=i,this.loggingService=o,this.sanitizer=s,this.smoothScrollShieldHandler=null,this.smoothScrollShieldLoadListener=null,this.isVideoEditorHandlingDelete=!1,this.pageScrollHeight=0,this.enableRectSelectionSubject$=new ie(!1),this.enableRectSelection$=this.enableRectSelectionSubject$.asObservable(),this.scrollableElementsIds$=new ie([]),this.mousedown=!1,this.windowMouseDown$=new Ct,this.windowPointerMove$=new ie(null),this.windowPointerUp$=new ie(null),this.documentSelectionChange$=new ie(null),this.windowClick$=new ie(null),this.windowScroll$=new ie(null),this.windowResize$=new ie(null),this.windowKeyupBackspace$=new ie(null),this.windowKeyupDelete$=new ie(null),this.windowKeyupEsc$=new ie(null),this.windowPopState$=new ie(null),this.documentClick$=new ie(null),this.documentClickSubject$=new Ct,this.documentFocus$=new ie(null),this.windowKeydownShift$=new ie(null),this.windowKeyupShift$=new ie(null),this.mutation$=new ie(null),this.childListMutation$=new ie(null),this.networkStatus$=new ie(!1),this.xpathCache=new Map,this.xpathCacheId=new Map,this.selectedAnnotationsMap$=new ie({}),this.selectedAnnotationsLocationMap$=new ie({}),this.selectedAnnotationsContextIdMap$=new ie({}),this.recordingInProgress$=new ie({}),this.deleteAnnotations$=new ie([]),this.pinHighlighterClass$=new ie(null),this.dialogOpenedInSidebar$=new ie(!1),this.textHighlighterClass$=new ie(null),this.commentPinHighlighter$=new ie(!1),this.deviceInfo$=new ie(new kr),this.customCss$=new ie(null),this.mutationObserver=null,this.animationFilterEnabled=!1,this.animationLibraryDetected=null,this.staticAnimationCache=new WeakMap,this.ANIMATION_LIBRARY_SELECTOR=["[data-gsap]",".gsap-marker-start",".gsap-marker-end","[data-gsap-id]",".swiper-slide",".swiper-wrapper",".swiper-pagination",".swiper-pagination-bullet","[data-aos]"].join(", "),this.previousMousePosition={pageX:0,pageY:0,clientX:0,clientY:0},this.currentMousePosition={pageX:0,pageY:0,clientX:0,clientY:0,element:{xpath:"",topPercentage:0,leftPercentage:0}},this.nodeMap={},this.unlistenElementScroll={},this.tabId=null,this.dynamicIdPatterns=[/^yui_[a-z0-9_]+$/i],this.excludeClassList=["show-pin-cursor"],this.filterSnippylyNodes=a=>{try{let c=[];return a.forEach(l=>{if(!Wi(l))if(l instanceof HTMLElement){if(l.className.includes("cdk-overlay-container")||l.className.includes("cdk-overlay-connected-position-bounding-box"))return;if(l.className.includes("cdk-overlay")){let d=!1;l.childNodes.forEach(h=>{Wi(h)&&(d=!0)}),d||c.push(l)}else c.push(l)}else c.push(l)}),c}catch(c){return this.loggingService.catch("Error in DomService filterSnippylyNodes: ",c),[]}},this.loggingService.log("%c[WB] Creating CLASS: DomService","color: blue;");try{this.analyticsService.setDomService(this),this.renderer=this.rendererFactory2.createRenderer(null,null);let a=this.calculateScreenSize();this.currentScreenSize$=new ie(a),this.currentMousePosition$=new ie(this.currentMousePosition),this.detectNetworkStatusChange(),this.getScrollableElementsIds$().pipe(Ha(),Wm(([c,l])=>{try{let d=l.filter(f=>!c.includes(f)),h=c.filter(f=>!l.includes(f));h.length&&h.map(g=>document.getElementById(g)).filter(g=>g).forEach(g=>{this.unlistenElementScroll&&this.unlistenElementScroll[g.id]&&this.unlistenElementScroll[g.id]()}),d.length&&d.map(g=>document.getElementById(g)).filter(g=>g).forEach(g=>{this.unlistenElementScroll[g.id]=this.renderer.listen(g,"scroll",E=>{let v=this.calculateScreenSize();this.currentScreenSize$.next(v)})})}catch(d){this.loggingService.catch("Error in DomService getScrollableElementsIds subscription: ",d)}})).subscribe(()=>{},c=>{this.loggingService.catch("Error in DomService getScrollableElementsIds subscription: ",c)}),this.getSelectedAnnotationsMap$().subscribe(c=>{Object.keys(c||{})?.length?yV("snippylyUserScalableNo","viewport","width=device-width, user-scalable=no"):vV("snippylyUserScalableNo")},c=>{this.loggingService.catch("Error in DomService getSelectedAnnotationsMap$ subscription: ",c)})}catch(a){this.loggingService.catch("Error in DomService constructor: ",a)}}setDocService(r){try{this.docService=r,this.subscribeToDomEvents()}catch(i){this.loggingService.catch("Error in DomService setDocService: ",i)}}setDynamicIdPatterns(r){try{let i=r.map(o=>typeof o=="string"?new RegExp(o):o).filter(Boolean);i.length&&(this.dynamicIdPatterns=i)}catch(i){this.loggingService.catch("Error in DomService setDynamicIdPatterns: ",i)}}isLikelyDynamicId(r){try{return r?this.dynamicIdPatterns.some(i=>i.test(r)):!1}catch{return!1}}isGeneratedId(r){return this.isLikelyDynamicId(r)||XG(r)}getStableAttributes(r){try{let i={};if(!r.getAttributeNames)return i;let o=new Set(["id","class","style"]);return r.getAttributeNames().forEach(a=>{if(o.has(a)||a.includes("snippyly")||a.includes("velt"))return;let c=r.getAttribute(a);c&&c.length<=256&&(i[a]=c)}),i}catch{return{}}}buildStableElementSelector(r,i){try{if(Object.keys(i).length===0)return;let s=[r.tagName?.toLowerCase()],a=["data-","aria-","role","name","title","type"];return Object.keys(i).sort((l,d)=>{let h=a.findIndex(g=>l.startsWith(g)),f=a.findIndex(g=>d.startsWith(g));return(h===-1?99:h)-(f===-1?99:f)}).slice(0,4).forEach(l=>{let d=CSS.escape(i[l]);s.push(`[${l}="${d}"]`)}),s.join("")}catch{return}}getVisibleText(r,i=400){try{let o=document.createTreeWalker(r,NodeFilter.SHOW_TEXT,null),s="",a,c=0;for(;(a=o.nextNode())&&s.length<i;){let l=(a.textContent||"").replace(/\s+/g," ").trim();if(l&&(s+=(s?" ":"")+l),c++,c>100)break}return s.slice(0,i)}catch{return""}}hashText(r){try{return oV(r)}catch{return}}generateRobustXPath(r,i){try{let o=i?.maxDepth||10,s=i?.useAbsolutePath||!1,a=[],c=r,l=0;for(;c&&c!==document.documentElement&&l<o;){let g=this.buildRobustXPathSegment(c);if(g&&(a.unshift(g),this.isStrongAnchorSegment(g)))break;c=c.parentElement,l++}if(a.length===0)return;let h=(s?"/":"//")+a.join("/");return a.some(g=>g.includes("[@")||g.includes("[contains(@class"))?h:void 0}catch{return}}buildRobustXPathSegment(r){try{let i=r.tagName.toLowerCase(),o=r.id;if(o&&!this.isLikelyDynamicId(o)&&document.querySelectorAll(`[id="${CSS.escape(o)}"]`).length===1)return`*[@id=${this.escapeXPathValue(o)}]`;let s=["data-region","data-instanceid","data-action","data-key","data-block","data-activityid"];for(let g of s){let E=r.getAttribute(g);if(E)return`${i}[@${g}=${this.escapeXPathValue(E)}]`}let a=Array.from(r.attributes).filter(g=>g.name.startsWith("data-")&&!g.name.includes("snippyly")&&!g.name.includes("velt")&&g.value.length<100).sort((g,E)=>g.value.length-E.value.length);if(a.length>0){let g=a[0];return`${i}[@${g.name}=${this.escapeXPathValue(g.value)}]`}let c=r.getAttribute("role");if(c)return`${i}[@role=${this.escapeXPathValue(c)}]`;let l=r.getAttribute("aria-label");if(l&&l.length<50)return`${i}[@aria-label=${this.escapeXPathValue(l)}]`;let d=r.getAttribute("name");if(d)return`${i}[@name=${this.escapeXPathValue(d)}]`;let h=r.getAttribute("type");if(h)return`${i}[@type=${this.escapeXPathValue(h)}]`;let f=Array.from(r.classList||[]).filter(g=>g.length>0&&g.length<40&&!g.includes("yui")&&!g.includes("velt")&&!g.includes("snippyly")&&!this.excludeClassList.includes(g)).slice(0,2);if(f.length>0){let g=f.map(E=>`contains(@class, ${this.escapeXPathValue(E)})`).join(" and ");return`${i}[${g}]`}if(r.parentElement){let g=Array.from(r.parentElement.children).filter(E=>E.tagName===r.tagName);if(g.length>1){let E=g.indexOf(r)+1;return`${i}[${E}]`}}return i}catch{return}}isStrongAnchorSegment(r){try{return!!(r.includes("[@id=")||["main","navigation","banner","contentinfo","complementary","search"].some(s=>r.includes(`[@role='${s}']`))||["data-region","data-instanceid","data-activityid"].some(s=>r.includes(`[@${s}=`)))}catch{return!1}}escapeXPathValue(r,i=!0){try{return r.includes("'")?r.includes('"')?`concat(${r.split("'").map(a=>`'${a}'`).join(`,"'",`)})`:i?`"${r}"`:r:i?`'${r}'`:r}catch{try{return`concat(${r.split("'").map(c=>`'${c}'`).join(`,"'",`)})`}catch{return i?`'${r}'`:r}}}getElementFromRobustXPath(r){try{return document.evaluate(r,document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue}catch{return null}}getAllElementsFromRobustXPath(r){try{let i=document.evaluate(r,document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null),o=[];for(let s=0;s<i.snapshotLength;s++){let a=i.snapshotItem(s);a instanceof Element&&o.push(a)}return o}catch{return[]}}generateAnchorRecord(r,i){try{let o=this.generateAnchorRecordForElement(r,i),s=null;if(r.parentElement&&r.parentElement instanceof HTMLElement&&Ju(r.parentElement)&&r.parentElement!==document.body&&(s=r.parentElement),o&&s){let a=this.generateAnchorRecordForElement(s,i);a&&(o.parent=a)}return o}catch(o){return this.loggingService.catch("Error in DomService generateAnchorRecord: ",o),null}}generateAnchorRecordForElement(r,i){try{if(!r)return null;let o=r,s=o.tagName?.toUpperCase();if(!s)return null;let a=o.id&&!this.isLikelyDynamicId(o.id)?o.id:void 0,c=this.getStableAttributes(o),l=this.buildStableElementSelector(o,c),d=this.getVisibleText(o),h=this.hashText(d||""),f=this.generateRobustXPath(o),g=this.getXPath(o,!1,!1,void 0,{ignoreGeneratedIds:i?.ignoreGeneratedIds}),E=this.getXPath(o,!0),v=this.getXPath(o,!0,!0);return{version:"1.0",id:a,tagName:s,elementSelector:l,robustXPath:f||void 0,xPath:g||void 0,fXPath:E||void 0,cfXPath:v||void 0,contentHash:h?{value:h,algorithm:"md5",source:"textContent"}:void 0,createdAt:Date.now()}}catch(o){return this.loggingService.catch("Error in DomService generateAnchorRecordForElement: ",o),null}}resolveAnchorRecord(r){try{let i=[],o=null,s=(h,f,g=0)=>{let E=[],v=g;if(E.push({method:f,score:g}),r.tagName&&h.tagName?.toUpperCase()===r.tagName&&(v+=10,E.push({method:"tagName-match",score:10})),r.contentHash?.value){let S=this.getVisibleText(h);this.hashText(S)===r.contentHash.value&&(v+=30,E.push({method:"contentHash-match",score:30}))}i.push({el:h,score:v,by:f,scoreBreakdown:E})};if(r.id){let h=document.querySelectorAll(`#${CSS.escape(r.id)}`);if(h.length===1)return{element:h[0],matchedBy:"id",score:90};h.length>1&&h.forEach(f=>s(f,"id-duplicate",70))}if(r.elementSelector){let h=document.querySelectorAll(r.elementSelector);if(h.length===1)return{element:h[0],matchedBy:"element-selector",score:80};h.forEach(f=>s(f,"element-selector-duplicate",60))}r.robustXPath&&this.getAllElementsFromRobustXPath(r.robustXPath).slice(0,20).forEach(E=>s(E,"robustXPath",50)),r?.parent&&(o=this.resolveAnchorRecord(r.parent),o.element&&o.element.querySelectorAll(r.tagName?.toLowerCase()||"*").forEach(f=>s(f,"parent+tag",40)));let a=(h,f,g)=>{if(!h)return;let E=this.getElementFromXPath(h);E&&s(E,f||"xpath",g||30)};if(a(r.xPath,"xPath",30),a(r.cfXPath,"cfXPath",30),a(r.fXPath,"fXPath",30),r.contentHash?.value&&i.length===0){let f=g=>{let E=0;for(let v=0;v<g.length&&E<400;v++){let S=g[v];if(E++,!this.isElementVisible(S))continue;let P=this.getVisibleText(S),V=this.hashText(P);V&&V===r.contentHash?.value&&s(S,"contentHash",15)}};if(o?.element&&o?.element instanceof Element){let g=o?.element?.querySelectorAll("*");f(g)}}if(!i.length)return{element:null};i.sort((h,f)=>f.score-h.score);let c=i[0].score,l=i.filter(h=>h.score===c);if(l.length>1){let h=[{path:r.xPath,label:"xPath"},{path:r.cfXPath,label:"cfXPath"},{path:r.fXPath,label:"fXPath"}];for(let f of h)if(f.path){let g=this.getElementFromXPath(f.path);if(g){let E=l.find(v=>v.el===g);if(E)return{element:E.el,matchedBy:`${E.by}+position`,score:E.score,scoreBreakdown:E.scoreBreakdown}}}}let d=i[0];return{element:d.el,matchedBy:d.by,score:d.score,scoreBreakdown:d.scoreBreakdown}}catch(i){return this.loggingService.catch("Error in DomService resolveAnchorRecord: ",i),{element:null}}}subscribeToDomEvents(){try{this.docService?.getDocumentPaths$().pipe(De(r=>{r?(this.onWindowResize(),this.onWindowScroll(),this.onPointerDown(),this.onWindowClick(),this.onWindowKeyupBackspace(),this.onWindowKeyupDelete(),this.onWindowKeyupEsc(),this.onWindowPopState(),this.onWindowKeydownShift(),this.onWindowKeyupShift(),this.addPointerMoveListener(),this.addPointerUpListener(),this.addSelectionChangeListener(),this.onDocumentFocus(),this.setupSmoothScrollShield()):(this.unsubscribeFromWindowResize(),this.unsubscribeFromWindowScroll(),this.unsubscribeFromPointerDown(),this.unsubscribeFromWindowClick(),this.unsubscribeFromWindowKeyupBackspace(),this.unsubscribeFromWindowKeyupDelete(),this.unsubscribeFromWindowKeyupEsc(),this.unsubscribeFromWindowPopState(),this.unsubscribeFromWindowKeydownShift(),this.unsubscribeFromWindowKeyupShift(),this.unsubscribeFromPointerMoveListener(),this.unsubscribeFromPointerUpListener(),this.unsubscribeFromSelectionChangeListener(),this.unsubscribeFromDocumentFocus(),this.unsetMutationObserver(),this.teardownSmoothScrollShield())})).subscribe(),this.onDocumentClick()}catch(r){this.loggingService.catch("Error in DomService subscribeToDomEvents: ",r)}}setScrollableElementsIds(r){try{r&&r.length&&this.scrollableElementsIds$.next(Array.from(new Set(r)))}catch(i){this.loggingService.catch("Error in DomService setScrollableElementsIds: ",i)}}getScrollableElementsIds$(){return this.loggingService.log("%c[WB] Calling FUNCTION: getScrollableElementsIds$","color: green;"),this.scrollableElementsIds$.asObservable()}removeScrollableElementsIds(){this.scrollableElementsIds$.next([])}setMutationObserver(r){try{this.mutationObserver||(this.loggingService.log("%c[WB] Calling DomService FUNCTION: setMutationObserver","color: green;"),this.loggingService.log("%c[WB] setMutationObserver from: "+r,"color: green;"),this.animationFilterEnabled=this.detectAnimationLibraries(),this.loggingService.log("%c[WB] Animation filter:","color: green;",this.animationFilterEnabled?"ENABLED (library detected)":"DISABLED (no library)"),this.mutationObserver=new MutationObserver(i=>{try{if(i?.find(s=>s?.attributeName===F.VELT_IGNORE_CHANGE_DETECTION))return;let o=i.filter(s=>s.type==="childList").filter(s=>{let a=s.target;return s.removedNodes.forEach(c=>{let l=c;if(typeof l.getAttribute=="function"){let d=l.getAttribute(F.ATTRIBUTES.VELT_ELEMENT_CACHE_ID);if(d!==null&&d!==""){let h=this.xpathCacheId.get(d);h!==void 0&&(this.xpathCacheId.delete(d),this.xpathCache.delete(h))}}}),Wi(a)?!1:!!(this.filterSnippylyNodes(s.addedNodes).length||this.filterSnippylyNodes(s.removedNodes).length)});this.animationFilterEnabled?this.childListMutation$.next(o.filter(s=>!this.isAnimatingElement(s.target))):this.childListMutation$.next(o),o.push(...i.filter(s=>s.type==="attributes").filter(s=>!Wi(s.target)).filter(s=>this.filterSnippylyNodes([s.target]).length).filter(s=>{if(s){let a=s.target;return a?.classList?.contains("snippyly-sidebar-panel")?!1:a?!a.getAttribute(F.VELT_IGNORE_CHANGE_DETECTION):!0}return!0})),o=o.filter(s=>{let a=!0;return Object.keys(F.INGNORE_MUTATION_OBSERVER_CHANGE_TAGS).forEach(c=>{s.target?.closest(c)&&(a=!1)}),a}),o=o.filter(s=>s.target&&Ju(s.target)),this.animationFilterEnabled&&(o=o.filter(s=>!this.isAnimatingElement(s.target))),o.length&&this.mutation$.next(o)}catch(o){this.loggingService.catch("Error in DomService change detection: ",o)}}),this.mutationObserver.observe(document.body,{childList:!0,subtree:!0,attributes:!0}))}catch(i){this.loggingService.catch("Error in DomService change detection: ",i)}}detectAnimationLibraries(){try{if(this.animationLibraryDetected!==null)return this.animationLibraryDetected;let r=window;return r.gsap||r.TweenMax||r.TweenLite||r.TimelineMax||r.TimelineLite?(this.loggingService.log("%c[WB] Detected animation library: GSAP","color: green;"),this.animationLibraryDetected=!0,!0):r.Swiper?(this.loggingService.log("%c[WB] Detected animation library: Swiper","color: green;"),this.animationLibraryDetected=!0,!0):r.AOS?(this.loggingService.log("%c[WB] Detected animation library: AOS","color: green;"),this.animationLibraryDetected=!0,!0):r.anime?(this.loggingService.log("%c[WB] Detected animation library: Anime.js","color: green;"),this.animationLibraryDetected=!0,!0):r.lottie||r.Lottie||r.bodymovin?(this.loggingService.log("%c[WB] Detected animation library: Lottie","color: green;"),this.animationLibraryDetected=!0,!0):document.querySelector("[data-framer-component-type]")?(this.loggingService.log("%c[WB] Detected animation library: Framer Motion","color: green;"),this.animationLibraryDetected=!0,!0):document.querySelector(this.ANIMATION_LIBRARY_SELECTOR)?(this.loggingService.log("%c[WB] Detected animation library: DOM markers","color: green;"),this.animationLibraryDetected=!0,!0):(this.loggingService.log("%c[WB] No animation library detected","color: green;"),this.animationLibraryDetected=!1,!1)}catch{return this.animationLibraryDetected=!1,!1}}isAnimatingElement(r){try{if(!r||typeof r.closest!="function")return!1;let i=window;if(i.gsap&&typeof i.gsap.isTweening=="function"){if(i.gsap.isTweening(r))return!0;if(typeof i.gsap.getTweensOf=="function")try{if(i.gsap.getTweensOf(r).length>0)return!0}catch{}}else if(i.TweenMax&&typeof i.TweenMax.isTweening=="function"){if(i.TweenMax.isTweening(r))return!0;if(typeof i.TweenMax.getTweensOf=="function")try{if(i.TweenMax.getTweensOf(r).length>0)return!0}catch{}}let o=r.style?.cssText||"";if(o){let l=o.includes("transform")||o.includes("translate3d")||o.includes("translate(")||o.includes("scale3d")||o.includes("rotate"),d=o.includes("will-change")&&o.includes("transform"),h=o.includes("transform-style")&&o.includes("preserve-3d");if(l&&(d||h))return!0}if(r.style&&(r.style.animation!==""&&r.style.animation!=="none"||r.style.transition!==""&&r.style.transition!=="none")||r.classList?.contains("animate")||r.classList?.contains("animating")||r.classList?.contains("animated")||r.classList?.contains("animation"))return!0;let s=this.staticAnimationCache.get(r);if(s!==void 0)return s;let a=!1,c=r.className||"";return typeof c=="string"&&(c.includes("slider")&&(c.includes("bullet")||c.includes("pagination"))&&(a=!0),c.includes("swiper-pagination")&&(a=!0)),!a&&(r.hasAttribute("data-aos")||r.hasAttribute("data-motion"))&&(a=!0),!a&&r.closest(this.ANIMATION_LIBRARY_SELECTOR)&&(a=!0),this.staticAnimationCache.set(r,a),a}catch{return!1}}unsetMutationObserver(){try{this.mutationObserver&&(this.mutationObserver.disconnect(),this.mutationObserver=null,this.staticAnimationCache=new WeakMap,this.animationLibraryDetected=null,this.animationFilterEnabled=!1)}catch(r){this.loggingService.catch("Error in DomService unsetMutationObserver: ",r)}}detectNetworkStatusChange(){this.loggingService.log("%c[WB] Calling FUNCTION: detectNetworkStatusChange","color: green;");try{ds(Ri(window,"offline").pipe(De(()=>!1)),Ri(window,"online").pipe(De(()=>!0)),new fe(r=>{r.next(navigator.onLine),r.complete()})).subscribe(r=>{this.networkStatus$.next(r)})}catch(r){this.loggingService.catch("Error in DomService detectNetworkStatusChange: ",r)}}onWindowResize(){this.loggingService.log("%c[WB] Calling FUNCTION: onWindowResize","color: green;");try{this.unsubscribeFromWindowResize(),this.unlistenWindowResize=this.renderer.listen("window","resize",r=>{this.windowResize$.next(r);let i=this.calculateScreenSize();this.deviceInfo$.next(new kr),this.currentScreenSize$.next(i)})}catch(r){this.loggingService.catch("Error in DomService onWindowResize: ",r)}}unsubscribeFromWindowResize(){try{this.unlistenWindowResize&&typeof this.unlistenWindowResize=="function"&&(this.unlistenWindowResize(),this.unlistenWindowResize=null)}catch(r){this.loggingService.catch("Error in DomService unsubscribeFromWindowResize: ",r)}}onWindowScroll(){this.loggingService.log("%c[WB] Calling FUNCTION: onWindowScroll","color: green;");try{this.unsubscribeFromWindowScroll(),this.unlistenWindowScroll=this.renderer.listen("window","scroll",r=>{this.windowScroll$.next(r);let i=this.calculateScreenSize();this.currentScreenSize$.next(i)})}catch(r){this.loggingService.catch("Error in DomService onWindowScroll: ",r)}}unsubscribeFromWindowScroll(){try{this.unlistenWindowScroll&&typeof this.unlistenWindowScroll=="function"&&(this.unlistenWindowScroll(),this.unlistenWindowScroll=null)}catch(r){this.loggingService.catch("Error in DomService unsubscribeFromWindowScroll: ",r)}}setupSmoothScrollShield(){this.loggingService.log("%c[WB] Calling FUNCTION: setupSmoothScrollShield","color: green;");try{if(typeof window>"u"||typeof document>"u"||this.smoothScrollShieldHandler)return;if(this.isSmoothScrollLibPresent()){this.attachSmoothScrollShield();return}if(document.readyState!=="complete"&&!this.smoothScrollShieldLoadListener){let r=()=>{this.smoothScrollShieldLoadListener=null;try{if(this.smoothScrollShieldHandler)return;this.isSmoothScrollLibPresent()&&this.attachSmoothScrollShield()}catch(i){this.loggingService.catch("Error in DomService smooth-scroll shield load re-check: ",i)}};window.addEventListener("load",r,{once:!0}),this.smoothScrollShieldLoadListener=()=>window.removeEventListener("load",r)}}catch(r){this.loggingService.catch("Error in DomService setupSmoothScrollShield: ",r)}}isSmoothScrollLibPresent(){try{if(typeof window>"u"||typeof document>"u")return!1;if(window.ET_SmoothScroll)return!0;let i=document.body;return!!(i&&i.classList&&i.classList.contains("et_smooth_scroll"))}catch(r){return this.loggingService.catch("Error in DomService isSmoothScrollLibPresent: ",r),!1}}attachSmoothScrollShield(){if(this.smoothScrollShieldHandler)return;let r=/^(VELT-|SUPERFLOW-|SNIPPYLY-)/,i=s=>{try{let a=typeof s.composedPath=="function"?s.composedPath():[];for(let c=0;c<a.length;c++){let l=a[c];if(!(!l||l.nodeType!==1)&&l.tagName&&r.test(l.tagName)){s.stopImmediatePropagation();return}}}catch(a){this.loggingService.catch("Error in DomService smoothScrollShield handler: ",a)}};this.smoothScrollShieldHandler=i;let o={capture:!0,passive:!0};window.addEventListener("wheel",i,o),window.addEventListener("mousewheel",i,o),window.addEventListener("touchmove",i,o),this.unlistenWindowWheelShield=()=>window.removeEventListener("wheel",i,o),this.unlistenWindowMouseWheelShield=()=>window.removeEventListener("mousewheel",i,o),this.unlistenWindowTouchMoveShield=()=>window.removeEventListener("touchmove",i,o)}teardownSmoothScrollShield(){this.loggingService.log("%c[WB] Calling FUNCTION: teardownSmoothScrollShield","color: green;");try{try{this.smoothScrollShieldLoadListener&&typeof this.smoothScrollShieldLoadListener=="function"&&(this.smoothScrollShieldLoadListener(),this.smoothScrollShieldLoadListener=null)}catch(r){this.loggingService.catch("Error in DomService teardownSmoothScrollShield (load): ",r)}try{this.unlistenWindowWheelShield&&typeof this.unlistenWindowWheelShield=="function"&&(this.unlistenWindowWheelShield(),this.unlistenWindowWheelShield=null)}catch(r){this.loggingService.catch("Error in DomService teardownSmoothScrollShield (wheel): ",r)}try{this.unlistenWindowMouseWheelShield&&typeof this.unlistenWindowMouseWheelShield=="function"&&(this.unlistenWindowMouseWheelShield(),this.unlistenWindowMouseWheelShield=null)}catch(r){this.loggingService.catch("Error in DomService teardownSmoothScrollShield (mousewheel): ",r)}try{this.unlistenWindowTouchMoveShield&&typeof this.unlistenWindowTouchMoveShield=="function"&&(this.unlistenWindowTouchMoveShield(),this.unlistenWindowTouchMoveShield=null)}catch(r){this.loggingService.catch("Error in DomService teardownSmoothScrollShield (touchmove): ",r)}this.smoothScrollShieldHandler=null}catch(r){this.loggingService.catch("Error in DomService teardownSmoothScrollShield: ",r)}}onPointerDown(){this.loggingService.log("%c[WB] Calling FUNCTION: onPointerDown","color: green;");try{this.unsubscribeFromPointerDown(),this.unlistenPointerDown=this.renderer.listen("window","pointerdown",r=>{this.mousedown=!0,this.windowMouseDown$.next(r),this.setPointerPosition(r)})}catch(r){this.loggingService.catch("Error in DomService onPointerDown: ",r)}}unsubscribeFromPointerDown(){try{this.unlistenPointerDown&&typeof this.unlistenPointerDown=="function"&&(this.unlistenPointerDown(),this.unlistenPointerDown=null)}catch(r){this.loggingService.catch("Error in DomService unsubscribeFromPointerDown: ",r)}}onWindowClick(){this.loggingService.log("%c[WB] Calling FUNCTION: onWindowKeyupBackspace","color: green;");try{this.unsubscribeFromWindowClick(),this.unlistenWindowClick=this.renderer.listen("window","click",r=>{this.windowClick$.next(r)})}catch(r){this.loggingService.catch("Error in DomService onWindowClick: ",r)}}unsubscribeFromWindowClick(){try{this.unlistenWindowClick&&typeof this.unlistenWindowClick=="function"&&(this.unlistenWindowClick(),this.unlistenWindowClick=null)}catch(r){this.loggingService.catch("Error in DomService unsubscribeFromWindowClick: ",r)}}onWindowKeyupBackspace(){this.loggingService.log("%c[WB] Calling FUNCTION: onWindowKeyupBackspace","color: green;");try{this.unsubscribeFromWindowKeyupBackspace(),this.unlistenWindowKeyupBackspace=this.renderer.listen("window","keyup.backspace",r=>{this.isVideoEditorHandlingDelete||this.windowKeyupBackspace$.next(r)})}catch(r){this.loggingService.catch("Error in DomService onWindowKeyupBackspace: ",r)}}unsubscribeFromWindowKeyupBackspace(){try{this.unlistenWindowKeyupBackspace&&typeof this.unlistenWindowKeyupBackspace=="function"&&(this.unlistenWindowKeyupBackspace(),this.unlistenWindowKeyupBackspace=null)}catch(r){this.loggingService.catch("Error in DomService unsubscribeFromWindowKeyupBackspace: ",r)}}onWindowKeyupDelete(){this.loggingService.log("%c[WB] Calling FUNCTION: onWindowKeyupDelete","color: green;");try{this.unsubscribeFromWindowKeyupDelete(),this.unlistenWindowKeyupDelete=this.renderer.listen("window","keyup.delete",r=>{this.isVideoEditorHandlingDelete||this.windowKeyupDelete$.next(r)})}catch(r){this.loggingService.catch("Error in DomService onWindowKeyupDelete: ",r)}}unsubscribeFromWindowKeyupDelete(){try{this.unlistenWindowKeyupDelete&&typeof this.unlistenWindowKeyupDelete=="function"&&(this.unlistenWindowKeyupDelete(),this.unlistenWindowKeyupDelete=null)}catch(r){this.loggingService.catch("Error in DomService unsubscribeFromWindowKeyupDelete: ",r)}}onWindowKeyupEsc(){this.loggingService.log("%c[WB] Calling FUNCTION: onWindowKeyupEsc","color: green;");try{this.unsubscribeFromWindowKeyupEsc(),this.unlistenWindowKeyupEsc=this.renderer.listen("window","keyup.esc",r=>{this.windowKeyupEsc$.next(r)})}catch(r){this.loggingService.catch("Error in DomService onWindowKeyupEsc: ",r)}}unsubscribeFromWindowKeyupEsc(){try{this.unlistenWindowKeyupEsc&&typeof this.unlistenWindowKeyupEsc=="function"&&(this.unlistenWindowKeyupEsc(),this.unlistenWindowKeyupEsc=null)}catch(r){this.loggingService.catch("Error in DomService unsubscribeFromWindowKeyupEsc: ",r)}}onWindowPopState(){this.loggingService.log("%c[WB] Calling FUNCTION: onWindowPopState","color: green;");try{this.unsubscribeFromWindowPopState(),this.unlistenWindowPopState=this.renderer.listen("window","popstate",r=>{this.windowPopState$.next(r)})}catch(r){this.loggingService.catch("Error in DomService onWindowPopState: ",r)}}unsubscribeFromWindowPopState(){try{this.unlistenWindowPopState&&typeof this.unlistenWindowPopState=="function"&&(this.unlistenWindowPopState(),this.unlistenWindowPopState=null)}catch(r){this.loggingService.catch("Error in DomService unsubscribeFromWindowPopState: ",r)}}onDocumentClick(){this.loggingService.log("%c[WB] Calling FUNCTION: onDocumentClick","color: green;");try{this.unsubscribeFromDocumentClick(),this.documentClickListener=r=>{r?.target?.tagName?.toLowerCase()!==F.TAGS.SUPERFLOW_TOOLBAR&&(this.documentClick$.next(r),this.documentClickSubject$.next(r))},document.addEventListener("click",this.documentClickListener,!0)}catch(r){this.loggingService.catch("Error in DomService onDocumentClick: ",r)}}unsubscribeFromDocumentClick(){try{this.documentClickListener&&typeof this.documentClickListener=="function"&&(document.removeEventListener("click",this.documentClickListener,!0),this.documentClickListener=null)}catch(r){this.loggingService.catch("Error in DomService unsubscribeFromDocumentClick: ",r)}}onDocumentFocus(){this.loggingService.log("%c[WB] Calling FUNCTION: onDocumentFocus","color: green;");try{this.unsubscribeFromDocumentFocus(),this.documentFocusListener=r=>{this.documentFocus$.next(r)},document.addEventListener("focus",this.documentFocusListener,!0)}catch(r){this.loggingService.catch("Error in DomService onDocumentFocus: ",r)}}unsubscribeFromDocumentFocus(){try{this.documentFocusListener&&typeof this.documentFocusListener=="function"&&(document.removeEventListener("focus",this.documentFocusListener,!0),this.documentFocusListener=null)}catch(r){this.loggingService.catch("Error in DomService unsubscribeFromDocumentFocus: ",r)}}onWindowKeydownShift(){this.loggingService.log("%c[WB] Calling FUNCTION: onWindowKeydownShift","color: green;");try{this.unsubscribeFromWindowKeydownShift(),this.unlistenWindowKeydownShift=this.renderer.listen("window","keydown.shift",r=>{this.windowKeydownShift$.next(r),this.windowKeyupShift$.next(null)})}catch(r){this.loggingService.catch("Error in DomService onWindowKeydownShift: ",r)}}unsubscribeFromWindowKeydownShift(){try{this.unlistenWindowKeydownShift&&typeof this.unlistenWindowKeydownShift=="function"&&(this.unlistenWindowKeydownShift(),this.unlistenWindowKeydownShift=null)}catch(r){this.loggingService.catch("Error in DomService unsubscribeFromWindowKeydownShift: ",r)}}onWindowKeyupShift(){this.loggingService.log("%c[WB] Calling FUNCTION: onWindowKeyupShift","color: green;");try{this.unsubscribeFromWindowKeyupShift(),this.unlistenWindowKeyupShift=this.renderer.listen("window","keyup.shift",r=>{this.windowKeyupShift$.next(r),this.windowKeydownShift$.next(null)})}catch(r){this.loggingService.catch("Error in DomService onWindowKeyupShift: ",r)}}unsubscribeFromWindowKeyupShift(){try{this.unlistenWindowKeyupShift&&typeof this.unlistenWindowKeyupShift=="function"&&(this.unlistenWindowKeyupShift(),this.unlistenWindowKeyupShift=null)}catch(r){this.loggingService.catch("Error in DomService unsubscribeFromWindowKeyupShift: ",r)}}onWindowKeydown$(){this.loggingService.log("%c[WB] Calling FUNCTION: onWindowKeydown$","color: green;");try{return Ri(window,"keydown")}catch(r){return this.loggingService.catch("Error in DomService onWindowKeydown$: ",r),Va}}addPointerMoveListener(){this.loggingService.log("%c[WB] Calling FUNCTION: addPointerMoveListener","color: green;");try{this.unsubscribeFromPointerMoveListener(),this.unlistenPointerMoveListener=this.renderer.listen("document","pointermove",r=>{this.windowPointerMove$.next(r),this.mouseMoveEvent=r})}catch(r){this.loggingService.catch("Error in DomService addPointerMoveListener: ",r)}}unsubscribeFromPointerMoveListener(){try{this.unlistenPointerMoveListener&&typeof this.unlistenPointerMoveListener=="function"&&(this.unlistenPointerMoveListener(),this.unlistenPointerMoveListener=null)}catch(r){this.loggingService.catch("Error in DomService unsubscribeFromPointerMoveListener: ",r)}}addPointerUpListener(){this.loggingService.log("%c[WB] Calling FUNCTION: addPointerUpListener","color: green;");try{this.unsubscribeFromPointerUpListener(),this.unlistenPointerUpListener=this.renderer.listen("document","pointerup",r=>{this.windowPointerUp$.next(r)})}catch(r){this.loggingService.catch("Error in DomService addPointerUpListener: ",r)}}unsubscribeFromPointerUpListener(){try{this.unlistenPointerUpListener&&typeof this.unlistenPointerUpListener=="function"&&(this.unlistenPointerUpListener(),this.unlistenPointerUpListener=null)}catch(r){this.loggingService.catch("Error in DomService unsubscribeFromPointerUpListener: ",r)}}addSelectionChangeListener(){this.loggingService.log("%c[WB] Calling FUNCTION: addPointerUpListener","color: green;");try{this.unsubscribeFromSelectionChangeListener(),this.unlistenSelectionChangeListener=this.renderer.listen("document","selectionchange",r=>{this.documentSelectionChange$.next(r)})}catch(r){this.loggingService.catch("Error in DomService addPointerUpListener: ",r)}}unsubscribeFromSelectionChangeListener(){try{this.unlistenSelectionChangeListener&&typeof this.unlistenSelectionChangeListener=="function"&&(this.unlistenSelectionChangeListener(),this.unlistenSelectionChangeListener=null)}catch(r){this.loggingService.catch("Error in DomService unsubscribeFromSelectionChangeListener: ",r)}}updateCurrentMousePosition(r){try{if(this.currentMousePosition.pageX=r.pageX,this.currentMousePosition.pageY=r.pageY,this.currentMousePosition.clientX=r.clientX,this.currentMousePosition.clientY=r.clientY,r.target){let i=this.getXPath(r.target),o=r.target;if(i?.includes("name()='svg'")){let h=this.getXPath(i);h&&(o=h.iterateNext()||r.target)}let s=o.getBoundingClientRect(),a=r.clientX-s.x,c=r.clientY-s.y,l=a*100/(s.width||1),d=c*100/(s.height||1);this.currentMousePosition.element={xpath:i,topPercentage:d,leftPercentage:l}}else this.currentMousePosition.element=null;this.currentMousePosition$.next(this.currentMousePosition)}catch(i){this.loggingService.catch("Error in DomService updateCurrentMousePosition: ",i)}}getTargetElementForCursorPosition(r,i=!0,o=!1,s=!0,a,c=!0,l,d){try{let h=r,f=h?.touches?.length?h.touches[0]?.clientX:h?.clientX,g=h?.touches?.length?h.touches[0]?.clientY:h?.clientY;l&&(f=l.clientX,g=l.clientY);let E=this.getBackgroundElement(f,g,i,o);if(E&&a&&typeof a=="function"&&(E=a(E)),E){let v=this.getXPath(E,!1,!1,void 0,d),S=this.getXPath(E,!0),P=E.getBoundingClientRect(),V=f-P.x,K=g-P.y,oe=V*100/(P.width||1),ge=K*100/(P.height||1),te={xpath:v,fXpath:S,leftPercentage:oe,topPercentage:ge};if(s){let C=this.getXPath(E,!0,!0);te.cfXpath=C}if(c){let C=this.generateAnchorRecord(E,d);C&&(te.anchor=C)}return te}else return null}catch(h){return this.loggingService.catch("Error in DomService getTargetElementForCommentPinAnnotation: ",h),null}}getBackgroundElement(r,i,o=!0,s=!1){try{let a=document.elementsFromPoint(r,i),c=[];a.forEach(d=>{Wi(d)?c=[]:Ju(d)&&c.push(d)}),s&&(c=c.filter(d=>this.isElementVisibleOnScreen(d)));let l=0;return o||c?.forEach((d,h)=>{d.tagName.toLowerCase()==="svg"&&(l=h)}),c[l]}catch(a){return this.loggingService.catch("Error in DomService getBackgroundElement: ",a),null}}getBackgroundVeltElement(r,i){try{let o=document.elementsFromPoint(r,i),s=[];return o.forEach(a=>{Wi(a)&&Ju(a)&&s.push(a)}),s[0]}catch(o){return this.loggingService.catch("Error in DomService getBackgroundSnippylyElement: ",o),null}}setPointerPosition(r){this.loggingService.log("%c[WB] Calling FUNCTION: setPointerPosition","color: green;");try{this.previousMousePosition.pageX=r.pageX,this.previousMousePosition.pageY=r.pageY,this.currentMousePosition.pageX=r.pageX,this.currentMousePosition.pageY=r.pageY}catch(i){this.loggingService.catch("Error in DomService setPointerPosition: ",i)}}getCurrentWindowSize$(r){return this.loggingService.log("%c[WB] Calling FUNCTION: getCurrentWindowSize","color: green;"),this.currentScreenSize$.asObservable()}getCurrentMousePosition$(){return this.loggingService.log("%c[WB] Calling FUNCTION: getCurrentMousePosition","color: green;"),this.currentMousePosition$.asObservable()}getCurrentWindowSizeValue(){return this.loggingService.log("%c[WB] Calling FUNCTION: getCurrentWindowSizeValue","color: green;"),this.currentScreenSize$.value}getTopLeftPosition(){this.loggingService.log("%c[WB] Calling FUNCTION: getTopLeftPosition","color: green;");try{let r=document?.body?.getBoundingClientRect()||document?.documentElement?.getBoundingClientRect(),i=this.currentMousePosition?.pageX||r.x+200,o=Math.min(i,r.width/2),s=Math.abs(r.y),a=r.y-20;return s>50&&(a=Math.abs(r.y)+180),this.loggingService.log(r),this.loggingService.log(o),this.loggingService.log(a),{topPositionX:o,topPositionY:a}}catch(r){return this.loggingService.catch("Error in DomService getTopLeftPosition: ",r),{topPositionX:0,topPositionY:0}}}toggleSelection(){this.enableRectSelectionSubject$.next(!this.enableRectSelectionSubject$.value)}enableSelection(){this.enableRectSelectionSubject$.next(!0)}disableSelection(){this.enableRectSelectionSubject$.next(!1)}setPinHighlighterClass(r){this.pinHighlighterClass$.next(r)}setTextHighlighterClass(r){this.textHighlighterClass$.next(r)}getTextHighlighterClass(){return this.textHighlighterClass$.asObservable()}enableCommentPinHighlighter(){this.commentPinHighlighter$.next(!0)}disableCommentPinHighlighter(){this.commentPinHighlighter$.next(!1)}getCommentPinHighlighter$(){return this.commentPinHighlighter$.asObservable()}getCommentPinHighlighter(){return this.commentPinHighlighter$?.value}highlightElement(r,i,o){if(r&&!Cc(r)){if(!o&&this.getCommentPinHighlighter()&&(this.pinHighlighterClass$.value?this.addClassToElement(r,this.pinHighlighterClass$.value):this.addClassToElement(r,F.SNIPPYLY_HIGHLIGHT)),i&&!r.hasAttribute(F.ATTRIBUTES.DEFAULT_CURSOR)){let s=r.style.getPropertyValue("cursor"),a=r.style.getPropertyPriority("cursor"),c=s?{defaultCursorValue:s,defaultCursorPriority:a}:"";r.setAttribute(F.ATTRIBUTES.DEFAULT_CURSOR,c?JSON.stringify(c):""),r.style.setProperty("cursor",i,"important")}r.setAttribute(F.SNIPPYLY_HIGHLIGHT,"true"),r.setAttribute(F.VELT_IGNORE_CHANGE_DETECTION,"true")}}removeHighlightFromElement(r){if(r&&(this.pinHighlighterClass$.value&&this.removeClassFromElement(r,this.pinHighlighterClass$.value),this.removeClassFromElement(r,F.SNIPPYLY_HIGHLIGHT),r.removeAttribute(F.SNIPPYLY_HIGHLIGHT),r.removeAttribute(F.VELT_IGNORE_CHANGE_DETECTION),r.hasAttribute(F.ATTRIBUTES.DEFAULT_CURSOR))){try{if(r.style.removeProperty("cursor"),r.getAttribute(F.ATTRIBUTES.DEFAULT_CURSOR)){let i=JSON.parse(r.getAttribute(F.ATTRIBUTES.DEFAULT_CURSOR));r.style.setProperty("cursor",i.defaultCursorValue,i.defaultCursorPriority)}}catch{}r.removeAttribute(F.ATTRIBUTES.DEFAULT_CURSOR)}}highlightUserElement(r,i,o,s=!1){try{r&&(this.addClassToElement(r,F.VELT_LIVE_SELECTION_ON_ELEMENT),s&&this.addClassToElement(r,F.VELT_LIVE_SELECTION_ON_ELEMENT_DEFAULT),r.setAttribute(F.SNIPPYLY_HIGHLIGHT,"true"),r.setAttribute(F.VELT_IGNORE_CHANGE_DETECTION,"true"),i&&!r.style.getPropertyValue(F.VELT_SELECTION_COLOR)&&r.style.setProperty(F.VELT_SELECTION_COLOR,i),o&&r.setAttribute(F.SNIPPYLY_HIGHLIGHT_USER_NAME,o))}catch(a){this.loggingService.catch("Error in DomService highlightUserElement: ",a)}}removeHighlightUserFromElement(r){try{r&&(this.removeClassFromElement(r,F.VELT_LIVE_SELECTION_ON_ELEMENT),this.removeClassFromElement(r,F.VELT_LIVE_SELECTION_ON_ELEMENT_DEFAULT),r.removeAttribute(F.SNIPPYLY_HIGHLIGHT),r.removeAttribute(F.VELT_IGNORE_CHANGE_DETECTION),r.removeAttribute(F.VELT_SELECTION_COLOR),r.removeAttribute(F.SNIPPYLY_HIGHLIGHT_USER_NAME),r.style.removeProperty(F.VELT_SELECTION_COLOR))}catch(i){this.loggingService.catch("Error in DomService removeHighlightUserFromElement: ",i)}}previewHighlightElement(r){r&&r.setAttribute(F.SNIPPYLY_HIGHLIGHT_PREVIEW,"true")}removePreviewHighlightFromElement(r){r&&r.removeAttribute(F.SNIPPYLY_HIGHLIGHT_PREVIEW)}getXPath(r,i=!1,o=!1,s,a){try{let c=this.calculateXPath(r,i,o,s,a);if(c&&typeof c=="string"&&c.includes("/svg")){let l=c.split("/"),d=!1;l.forEach((h,f)=>{h.includes("svg")&&(d=!0),d&&(l[f]="svg:"+h)}),c=l.join("/")}return c}catch(c){this.loggingService.catch("Error in DomService getXPath:",c)}}namespaceResolver(r){return r==="svg"?"http://www.w3.org/2000/svg":null}calculateXPath(r,i,o,s,a){try{if(r){if(typeof r=="string")return document.evaluate(r,s||document,this.namespaceResolver,XPathResult.ANY_TYPE,null);if(!r||r.nodeType!=1)return"";if(r.id&&document.querySelectorAll(`[id='${r.id}']`)?.length===1&&!i&&!(a?.ignoreGeneratedIds&&this.isGeneratedId(r.id)))return"//*[@id='"+r.id+"']";if(o&&r.className&&r.className.split){let l=r.className?.split(" ")?.filter(d=>!d?.includes("snippyly")&&!d?.includes("velt")&&!["show-pin-cursor"].includes(d))[0];if(l){let d=this.calculateXPath(r.parentNode,i,o,s,a)+"/"+r.tagName.toLowerCase(),h=Array.from(r.parentNode?.children||[]).filter(f=>f.nodeType===1&&f.tagName===r.tagName?f.className?.split(" ")?.filter(E=>E?.includes("snippyly")||E?.includes("velt")||["show-pin-cursor"].includes(E))[0]===l:!1);if(h.length>1){let f=h.indexOf(r)+1;d+=`[contains(concat(' ', normalize-space(@class), ' '), ' ${l} ')][${f}]`}else d+=`[contains(concat(' ', normalize-space(@class), ' '), ' ${l} ')]`;return d}}let c=[].filter.call(r.parentNode?.children?r.parentNode?.children:[],function(l){return l.tagName==r.tagName});return this.calculateXPath(r.parentNode,i,o,void 0,a)+"/"+r.tagName.toLowerCase()+(c.length>1?"["+([].indexOf.call(c,r)+1)+"]":"")}}catch(c){this.loggingService.catch("Error in DomService calculateXPath:",c)}}getElementFromXPath(r,i=document){try{if(this.xpathCache.has(r)){let s=this.xpathCache.get(r);if(s!==void 0&&document.contains(s))return s;this.xpathCache.delete(r)}let o=this.getXPath(r,!1,!1,i);if(o){let s=o?.iterateNext();if(s!==null&&typeof s.setAttribute=="function"&&!Cc(s)){let a=Xu();s.setAttribute(F.ATTRIBUTES.VELT_ELEMENT_CACHE_ID,a),this.xpathCacheId.set(a,r)}return this.xpathCache.set(r,s),s}return null}catch(o){return this.loggingService.catch("Error in DomService getElementFromXPath:",o),null}}getElementFromTargetElement(r){try{let i=null;if(r?.anchor){let o=this.resolveAnchorRecord(r.anchor);o?.element&&(i=o.element)}else r?.xpath?i=this.getElementFromXPath(r.xpath):r?.cfXpath?i=this.getElementFromXPath(r.cfXpath):r?.fXpath&&(i=this.getElementFromXPath(r.fXpath));return i}catch(i){return this.loggingService.catch("Error in DomService getElementFromTargetElement:",i),null}}resolveIdScopedTarget(r){try{let i=r?.anchor?.xPath||r?.xpath,o=fN(i);if(!i||!o||this.isGeneratedId(o.rootId))return{applicable:!1,element:null};let s=this.getUniqueElementById(o.rootId);if(!s||!this.isElementVisible(s)||!Ju(s))return{applicable:!0,element:null};let a=d=>!!d&&s.contains(d)&&this.isElementVisible(d),c=this.getElementFromXPath(i);if(a(c))return{applicable:!0,element:c,matchedBy:"exact"};let l=r?.anchor?.robustXPath;if(l&&fN(l)?.rootId===o.rootId){let d=this.getElementFromRobustXPath(l);if(a(d))return{applicable:!0,element:d,matchedBy:"robust"}}return{applicable:!0,element:s,matchedBy:"root"}}catch(i){return this.loggingService.catch("Error in DomService resolveIdScopedTarget: ",i),{applicable:!1,element:null}}}getUniqueElementById(r){try{let i=document.querySelectorAll(`[id="${CSS.escape(r)}"]`);return i.length===1?i[0]:null}catch{return null}}getElementFromTargetTextRange(r){try{let i=null;if(r?.commonAncestorContainerAnchor){let o=this.resolveAnchorRecord(r.commonAncestorContainerAnchor);o?.element&&(i=o.element)}else r?.commonAncestorContainer&&(i=this.getElementFromXPath(r.commonAncestorContainer));return i}catch(i){return this.loggingService.catch("Error in DomService getElementFromTargetTextRange:",i),null}}calculateScreenSize(){this.loggingService.log("%c[WB] Calling FUNCTION: onWindowResize","color: green;");try{let r=[document?.body?.clientHeight||0,document?.documentElement?.clientHeight||0,window?.innerHeight||0],i=[document?.body?.clientWidth||0,document?.documentElement?.clientWidth||0,window?.innerWidth||0];this.calculatePageScrollHeight(),this.loggingService.log(this.pageScrollHeight),this.loggingService.log(this.nodeMap),this.highestNode=this.nodeMap[this.pageScrollHeight];let o=new Jf;return o.screenWidth=Math.max(...i),o.screenHeight=Math.max(...r),o.screenScrollHeight=this.pageScrollHeight,o}catch(r){return this.loggingService.catch("Error in DomService calculateScreenSize:",r),new Jf}}calculatePageScrollHeight(){this.loggingService.log("%c[WB] Calling FUNCTION: calculatePageScrollHeight","color: green;");try{this.pageScrollHeight=0,this.findLongestNode(document?.documentElement?.childNodes)}catch(r){this.loggingService.catch("Error in DomService calculatePageScrollHeight: ",r)}}removeSnippylyContent(r){this.loggingService.log("%c[WB] Calling FUNCTION: removeSnippylyContent","color: green;");try{let o=new DOMParser().parseFromString(r,"text/html");o.querySelectorAll("[data-snippyly-cache-id]").forEach(f=>{f.removeAttribute("data-snippyly-cache-id")}),o.querySelectorAll("[data-velt-cache-id]").forEach(f=>{f.removeAttribute("data-velt-cache-id")}),o.querySelectorAll(".comment-text-highlight").forEach(f=>{f?.parentNode?.insertBefore(document.createTextNode(f?.textContent),f),f.remove()});let l=document.createNodeIterator(o,NodeFilter.SHOW_COMMENT),d;for(;d=l.nextNode();)d?.remove();return this.mergeAdjacentTextNodes(o.body),this.sanitizeHtml(o.body.innerHTML)}catch(i){return this.loggingService.catch("Error in DomService removeSnippylyContent: ",i),r}}mergeAdjacentTextNodes(r){try{let i=r.firstChild;for(;i;){if(i.nodeType===Node.TEXT_NODE){let o=i.nextSibling;for(;o&&o.nodeType===Node.TEXT_NODE;)i.textContent+=o.textContent,o.remove(),o=i.nextSibling}i=i.nextSibling}}catch(i){this.loggingService.catch("Error in DomService mergeAdjacentTextNodes: ",i)}}findLongestNode(r){try{for(let i=r.length-1;i>=0;i--){if(r[i]?.scrollHeight&&r[i]?.clientHeight){let o=Math.max(r[i]?.scrollHeight,r[i]?.clientHeight);this.pageScrollHeight=Math.max(o,this.pageScrollHeight),this.nodeMap[o]=r[i]}r[i]?.childNodes?.length&&this.findLongestNode(r[i]?.childNodes)}}catch(i){this.loggingService.catch("Error in DomService findLongestNode: ",i)}}resetSelectedAnnotationsMap(r=!0,i){try{let o=Array.from(document.querySelectorAll(`[${F.ATTRIBUTES.VELT_ANNOTATION_DRAFT}]`)),s=this.getDraftCommentAnnotationDialogs()||[];o.push(...s),o=Array.from(new Set(o));let a=o.map(h=>h.classList.contains("velt-annotation-draft-checked")?(h.classList.remove("velt-annotation-draft-checked"),null):(this.removeClassFromElement(h,"velt-comment-dialog-shake"),setTimeout(()=>{this.addClassToElement(h,"velt-comment-dialog-shake"),h.getAttribute(F.ATTRIBUTES.VELT_ANNOTATION_EDIT_COMMENT)||h.classList.contains("velt-annotation-draft-checked")||this.addClassToElement(h,"velt-annotation-draft-checked")},100),h.getAttribute(F.ATTRIBUTES.VELT_ANNOTATION_DRAFT))).filter(h=>h),c=Object.keys(this.getRecordingInProgress()||{});a=[...a,...c];let l=this.selectedAnnotationsMap$.value;if(r&&this.selectedAnnotationsMap$.value&&Object.keys(this.selectedAnnotationsMap$.value).length){let h=[];Object.keys(l).forEach(f=>{if(l[f]?.type==="tag"){let g=l[f];g?.to?.length||a.includes(f)||h.push(g)}else l[f]?.comments?.length||a.includes(f)||h.push(l[f])}),this.deleteAnnotations$.next(h),this.deleteAnnotations$.next([])}let d={};Object.keys(l).forEach(h=>{a.includes(h)&&(d[h]=l[h]),i&&(i==="comment"?["comment","videoPin"].includes(l[h]?.type)||(d[h]=l[h]):l[h]?.type!==i&&(d[h]=l[h]))}),Object.keys(d).forEach(h=>{let f=d[h]?.multiThreadAnnotationId;f&&!d[f]&&(d[f]={annotationId:f,type:"multiThread"})}),JSON.stringify(this.selectedAnnotationsMap$.value)!==JSON.stringify(d)&&this.selectedAnnotationsMap$.next(d),this.setDialogOpenedInSidebar(!1)}catch(o){this.loggingService.catch("Error in DomService resetSelectedAnnotationsMap: ",o)}}setRecordingInProgress(r,i){try{if(i)this.recordingInProgress$.next(ye($({},this.recordingInProgress$.value),{[r]:i}));else{let o=this.recordingInProgress$.value;delete o[r],this.recordingInProgress$.next(o)}}catch(o){this.loggingService.catch("Error in DomService setRecordingInProgress: ",o)}}resetRecordingInProgress(){try{this.recordingInProgress$.next({})}catch(r){this.loggingService.catch("Error in DomService resetRecordingInProgress: ",r)}}getRecordingInProgress(){try{return this.recordingInProgress$.value}catch(r){return this.loggingService.catch("Error in DomService getRecordingInProgress: ",r),{}}}getDraftCommentAnnotationDialogs(){try{let r=[],i=Array.from(document.querySelectorAll(`${F.TAGS.SNIPPYLY_COMMENT_DIALOG}`)),o=Array.from(document.querySelectorAll(`${F.TAGS.VELT_COMMENT_DIALOG}`));return[...i,...o].forEach(a=>{if(a?.shadowRoot){let c=a.shadowRoot.querySelector(`[${F.ATTRIBUTES.VELT_ANNOTATION_DRAFT}]`);c&&r.push(c)}else{let c=a.querySelector(`${F.TAGS.VELT_SHADOW_DOM_INTERNAL}`);if(c?.shadowRoot){let l=c.shadowRoot?.querySelector(`[${F.ATTRIBUTES.VELT_ANNOTATION_DRAFT}]`);l&&r.push(l)}else{let l=a.querySelector(`[${F.ATTRIBUTES.VELT_ANNOTATION_DRAFT}]`);l&&r.push(l)}}}),r}catch(r){return this.loggingService.catch("Error in DomService getDraftCommentAnnotationDialogs: ",r),[]}}getSelectedAnnotationsMap(r){try{let i=this.selectedAnnotationsMap$.value;if(r){let o={};return Object.keys(i).forEach(s=>{r==="comment"?["comment","videoPin"].includes(i[s].type)&&(o[s]=i[s]):i[s].type===r&&(o[s]=i[s])}),o}else return i}catch(i){return this.loggingService.catch("Error in DomService getSelectedAnnotationsMap: ",i),{}}}getSelectedAnnotationsMap$(r){return this.selectedAnnotationsMap$.asObservable().pipe(De(i=>{if(r){let o={};return Object.keys(i).forEach(s=>{i[s].type===r&&(o[s]=i[s])}),o}else return i}))}getSelectedComments$(){return this.selectedAnnotationsMap$.asObservable().pipe(De(r=>Object.values(r)))}getSelectedAnnotationsLocationMap(){try{return this.selectedAnnotationsLocationMap$.value}catch(r){return this.loggingService.catch("Error in DomService getSelectedAnnotationsLocationMap: ",r),{}}}getSelectedAnnotationsLocationMap$(){return this.selectedAnnotationsLocationMap$.asObservable()}getSelectedAnnotationsContextIdMap(){try{return this.selectedAnnotationsContextIdMap$.value}catch(r){return this.loggingService.catch("Error in DomService getSelectedAnnotationsContextIdMap: ",r),{}}}getSelectedAnnotationsContextIdMap$(){return this.selectedAnnotationsContextIdMap$.asObservable()}toggleAnnotationSelection(r,i,o,s=!1,a,c){try{o==="sidebarShowReplies"?this.setDialogOpenedInSidebar(!0):this.setDialogOpenedInSidebar(!1);let l=JSON.parse(JSON.stringify(this.selectedAnnotationsMap$.value||{})),d=JSON.parse(JSON.stringify(this.selectedAnnotationsLocationMap$.value||{})),h=JSON.parse(JSON.stringify(this.selectedAnnotationsContextIdMap$.value||{}));l[r.annotationId]&&!s?delete l[r.annotationId]:((!this.windowKeydownShift$.value||s)&&(l={}),l[r.annotationId]=r,d[r.annotationId]=i,c&&(h[r.annotationId]=c),a=r?.multiThreadAnnotationId||a,a&&(l[a]={annotationId:a,type:"multiThread"},d[a]=i,c&&(h[a]=c))),this.selectedAnnotationsMap$.next(l),Object.keys(d).forEach(f=>{l[f]||delete d[f]}),this.selectedAnnotationsLocationMap$.next(d),Object.keys(h).forEach(f=>{l[f]||delete h[f]}),this.selectedAnnotationsContextIdMap$.next(h)}catch(l){this.loggingService.catch("Error in DomService toggleAnnotationSelection: ",l)}}setSelectedAnnotationLocation(r,i){try{let o=JSON.parse(JSON.stringify(this.getSelectedAnnotationsLocationMap()||{}));o?.[r]!==i&&(o[r]=i,this.selectedAnnotationsLocationMap$.next(o))}catch(o){this.loggingService.catch("Error in DomService setSelectedAnnotationLocation: ",o)}}updateSelectedAnnotationInMap(r){try{let i=this.selectedAnnotationsMap$.value;r.forEach(o=>{i[o.annotationId]&&(i[o.annotationId]=o)}),this.selectedAnnotationsMap$.next(i)}catch(i){this.loggingService.catch("Error in DomService updateSelectedAnnotationInMap: ",i)}}getDeleteCommmentAnnotations$(){try{return this.deleteAnnotations$.asObservable()}catch(r){return this.loggingService.catch("Error in DomService getDeleteCommmentAnnotations$: ",r),ct([])}}getHighestNode(){return this.loggingService.log("%c[WB] Calling FUNCTION: getHighestNode","color: green;"),this.highestNode}onWindowMouseDown$(){return this.windowMouseDown$.asObservable()}onWindowPointerMove$(){return this.windowPointerMove$.asObservable()}onWindowPointerMove(){return this.windowPointerMove$.value}onWindowPointerUp$(){return this.windowPointerUp$.asObservable()}onSelectionChange$(){return this.documentSelectionChange$.asObservable()}onWindowClick$(){return this.windowClick$.asObservable()}onWindowScroll$(){return this.windowScroll$.asObservable()}onWindowResize$(){return this.windowResize$.asObservable()}onWindowKeyupBackspace$(){return this.windowKeyupBackspace$.asObservable()}onWindowKeyupDelete$(){return this.windowKeyupDelete$.asObservable()}onWindowKeyupEsc$(){return this.windowKeyupEsc$.asObservable()}onWindowPopState$(){return this.windowPopState$.asObservable()}onDocumentClick$(){return this.documentClick$.asObservable()}getLastDocumentClick(){return this.documentClick$.value}onDocumentClickSubject$(){return this.documentClickSubject$.asObservable()}onDocumentFocus$(){return this.documentFocus$.asObservable()}onDomChange$(r){try{return this.mutationObserver||this.setMutationObserver(r),this.mutation$.asObservable()}catch(i){return this.loggingService.catch("Error in DomService onDomChange$: ",i),ct([])}}getChildListMutation$(){return this.childListMutation$.asObservable()}onNetworkStatusChange$(){return this.networkStatus$.asObservable()}getNetworkStatus(){return this.networkStatus$.value}getElementOffset(r,i){try{let o={offsetTop:0,offsetLeft:0},s=r;if(s===i){let a=window.getComputedStyle(r);a.position==="static"&&a.transformStyle!="preserve-3d"&&a.transform=="none"&&(o.offsetLeft=r?.offsetLeft||0,o.offsetTop=r?.offsetTop||0)}if(s!==i)if(r?.closest("svg"))for(;s&&s!==i;){let c=window.getComputedStyle(s);if(s.tagName.toLowerCase()==="svg"||s instanceof SVGElement){let l=s.parentElement;if(l){let d=l.getBoundingClientRect(),h=s.getBoundingClientRect();o.offsetLeft+=h.left-d.left,o.offsetTop+=h.top-d.top}}else c.position==="static"?c.transformStyle!="preserve-3d"&&c.transform=="none"&&(o.offsetLeft+=s?.offsetLeft||0,o.offsetTop+=s?.offsetTop||0):(o.offsetLeft+=s.offsetLeft,o.offsetTop+=s.offsetTop);if(s=s.parentElement,r instanceof SVGElement&&s===i){let l=window.getComputedStyle(s);l.position==="static"&&l.transformStyle!="preserve-3d"&&l.transform=="none"&&(o.offsetLeft+=s?.offsetLeft||0,o.offsetTop+=s?.offsetTop||0)}}else{let c=window.getComputedStyle(s);c.position==="static"?c.transformStyle!="preserve-3d"&&c.transform=="none"&&(o.offsetLeft+=s?.offsetLeft||0,o.offsetTop+=s?.offsetTop||0):(o.offsetLeft+=s.offsetLeft,o.offsetTop+=s.offsetTop)}return o}catch(o){return this.loggingService.catch("Error in DomService getElementOffset: ",o),{offsetTop:0,offsetLeft:0}}}isElementVisible(r){try{if(typeof r?.getBoundingClientRect=="function"){let{width:i,height:o,top:s,bottom:a}=r?.getBoundingClientRect();return i>0||o>0||s<window.innerHeight&&a>0}else return!1}catch(i){return this.loggingService.catch("Error in DomService isElementVisible: ",i),!1}}isElementVisibleOnScreen(r){try{if(r){if(!(r instanceof Element))return!1;let i=r,o=window.getComputedStyle(i);return!(o.display==="none"||o.visibility==="hidden"||parseFloat(o.opacity)===0)}return!1}catch(i){return this.loggingService.catch("Error in DomService isElementVisibleOnScreen: ",i),!1}}getClickAndDragPointsObservable(){return new fe(r=>{let i=Ri(document,"mousedown").pipe(De(l=>({type:l.type,x:l.clientX+window.scrollX,y:l.clientY+window.scrollY,event:l}))),o=Ri(document,"mousemove").pipe(De(l=>({type:l.type,x:l.clientX+window.scrollX,y:l.clientY+window.scrollY,event:l}))),s=Ri(document,"mouseup").pipe(De(l=>({type:l.type,x:l.clientX+window.scrollX,y:l.clientY+window.scrollY,event:l}))),c=i.pipe(br(l=>o.pipe(Ha(),De(([d,h])=>({startPoint:l,prevPoint:d,curPoint:h})),us(s)))).subscribe(r);return()=>c.unsubscribe()})}drawRectangle(r,i){let o=document.querySelector(".rectangle");o||(o=document.createElement("div"),this.addClassToElement(o,"rectangle"),o.setAttribute(F.ATTRIBUTES.VELT_COMMENT_DISABLED,"true"),o.setAttribute(F.VELT_IGNORE_CHANGE_DETECTION,"true"),document.body.appendChild(o));let s=Math.abs(i.x-r.x),a=Math.abs(i.y-r.y),c=Math.min(r.x,i.x),l=Math.min(r.y,i.y);return o.style.width=`${s}px`,o.style.height=`${a}px`,o.style.left=`${c}px`,o.style.top=`${l}px`,o.style.position="absolute",o.style.border="2px dashed #f00",o.style.pointerEvents="none",o.style.zIndex="2147483577",o}getRange(){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: getRange","color: green;"),window.getSelection()?.toString()){let r=window.getSelection();if(r?.rangeCount)return r.getRangeAt(0)}return null}catch(r){return this.loggingService.catch("Error in DomService getRange: ",r),null}}clearTextSelection(){try{this.loggingService.log("%c[WB] Calling FUNCTION: clearTextSelection","color: green;"),window.getSelection&&(window.getSelection()?.empty?window.getSelection()?.empty():window.getSelection()?.removeAllRanges&&window.getSelection()?.removeAllRanges())}catch(r){this.loggingService.catch("Error in DomService clearTextSelection: ",r)}}getTargetTextRangeFromSelectionRange(r){try{let i={},o=r.commonAncestorContainer;o?.nodeType===Node.TEXT_NODE&&(o=o.parentElement);let s=document.body;if(o){let c=this.getTextXPath(o);this.isXpathWithId(c)&&(s=o)}let a=this.getAdditionalLocationContainer(o);if(a&&(s=a),i.commonAncestorContainer=this.getTextXPath(s),i.commonAncestorContainer){let c=this.getElementFromXPath(i.commonAncestorContainer);if(c){i.commonAncestorContainerFXpath=this.getXPath(c,!0),i.commonAncestorContainerCFXpath=this.getXPath(c,!0,!0);let l=this.generateAnchorRecord(c);l&&(i.commonAncestorContainerAnchor=l)}}return i.text=r.toString(),i.occurrence=zD(s,0,r.startContainer,r.startOffset,r.toString())+1,i}catch(i){this.loggingService.catch("Error in DomService getTargetTextRangeFromSelectionRange: ",i);return}}getTextXPath(r){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: getTextXPath","color: green;"),r.nodeType===Node.TEXT_NODE){let i=1,o=r.previousSibling;for(;o;)o.nodeType===Node.TEXT_NODE&&i++,o=o.previousSibling;return this.getXPath(r.parentElement)}else return this.getXPath(r)}catch(i){this.loggingService.catch("Error in DomService getTextXPath: ",i);return}}getHostElement(r){try{if(F.NON_NESTABLE_ELEMENTS[r?.tagName?.toLowerCase()]){let o=r?.closest("picture");return o?o?.parentElement:r.parentElement}let i=r.closest("svg");return i?i?.parentElement:r}catch(i){return this.loggingService.catch("Error in DomService getHostElement: ",i),r}}isElementInsideAdditionalLocationContainer(r){try{return!!r?.closest(`[${F.ATTRIBUTES.VELT_LOCATION}], [${F.ATTRIBUTES.VELT_LOCATION_ID}]`)}catch(i){return this.loggingService.catch("Error in DomService isElementInsideAdditionalLocationContainer: ",i),!1}}getAdditionalLocationContainer(r){try{return r?.closest(`[${F.ATTRIBUTES.VELT_LOCATION}], [${F.ATTRIBUTES.VELT_LOCATION_ID}]`)||null}catch(i){return this.loggingService.catch("Error in DomService getAdditionalLocationContainer: ",i),null}}isXpathWithId(r){try{return typeof r=="string"?!!r?.includes("[@id="):!1}catch(i){return this.loggingService.catch("Error in DomService isXpathWithId: ",i),!1}}getListedElements({elementIds:r,elementClassNames:i,elementQuerySelectors:o}){try{let s=[];if(r?.length)for(let a=0;a<r.length;a++){let c=document.getElementById(r[a]);c&&s.push(c)}if(i?.length)for(let a=0;a<i.length;a++){let c=document.getElementsByClassName(i[a]);for(let l=0;l<c.length;l++){let d=c[l];d&&d instanceof HTMLElement&&s.push(d)}}if(o?.length)for(let a=0;a<o.length;a++){let c=document.querySelectorAll(o[a]);for(let l=0;l<c.length;l++){let d=c[l];d&&d instanceof HTMLElement&&s.push(d)}}return s}catch(s){return this.loggingService.catch("Error in DomService getListedElements: ",s),[]}}isElementInsideListedElementIds(r,i){try{if(i?.length){for(let o=0;o<i.length;o++){let s=document.getElementById(i[o]);if(s&&s.contains(r))return!0}return!1}return!0}catch(o){return this.loggingService.catch("Error in DomService isElementInsideListedElementIds: ",o),!1}}isElementInsideListedElementClassNames(r,i){try{if(i?.length){for(let o=0;o<i.length;o++){let s=document.getElementsByClassName(i[o]);for(let a=0;a<s.length;a++)if(s[a].contains(r))return!0}return!1}return!0}catch(o){return this.loggingService.catch("Error in DomService isElementInsideListedElementClassNames: ",o),!1}}isElementInsideListedElementQuerySelectors(r,i){try{if(i?.length){for(let o=0;o<i.length;o++){let s=document.querySelectorAll(i[o]);for(let a=0;a<s.length;a++)if(s[a].contains(r))return!0}return!1}return!0}catch(o){return this.loggingService.catch("Error in DomService isElementInsideListedElementQuerySelectors: ",o),!1}}addClassToElement(r,i){try{this.loggingService.log("%c[WB] Calling FUNCTION: addClassToElement","color: green;"),r&&(r.classList?.contains(i)||r.classList?.add(i))}catch(o){this.loggingService.catch("Error in DomService addClassToElement: ",o)}}removeClassFromElement(r,i){try{this.loggingService.log("%c[WB] Calling FUNCTION: removeClassFromElement","color: green;"),r&&r.classList?.contains(i)&&r.classList?.remove(i)}catch(o){this.loggingService.catch("Error in DomService removeClassFromElement: ",o)}}isElementInsideParentWithAttribute(r,i,o){try{let s=r;for(;s&&s!==document.body;){if(s?.getAttribute&&s?.getAttribute(i)===o)return!0;s=s.parentElement}return!1}catch(s){return this.loggingService.catch("Error in DomService isElementInsideParentWithAttribute: ",s),!1}}setVideoEditorHandlingDelete(r){try{this.isVideoEditorHandlingDelete=r}catch(i){this.loggingService.catch("Error in DomService setVideoEditorHandlingDelete: ",i)}}isVideoEditorHandlingDeleteKey(){try{return this.isVideoEditorHandlingDelete}catch(r){return this.loggingService.catch("Error in DomService isVideoEditorHandlingDeleteKey: ",r),!1}}setCustomCss(r){try{this.loggingService.log("%c[WB] Calling FUNCTION: setCustomCss","color: green;"),this.customCss$.next(r)}catch(i){this.loggingService.catch("Error in DomService setCustomCss: ",i)}}getCustomCss$(){try{return this.loggingService.log("%c[WB] Calling FUNCTION: getCustomCss$","color: green;"),this.customCss$.asObservable()}catch(r){return this.loggingService.catch("Error in DomService getCustomCss$: ",r),ct(null)}}injectCustomCss(r){try{this.loggingService.log("%c[WB] Calling FUNCTION: injectCustomCss","color: green;");let i=this.customCss$.value;if(i){let o=r?.shadowRoot?.querySelector(`[${F.VELT_CUSTOM_CSS}]`);if(o&&o.remove(),i?.type==="link"){let s=document.createElement("link");s.href=i?.value,s.rel="stylesheet",s.setAttribute(F.VELT_CUSTOM_CSS,"true"),r?.shadowRoot?.appendChild(s)}else{let s=document.createElement("style");s.innerHTML=this.sanitizeHtml(i?.value),s.setAttribute(F.VELT_CUSTOM_CSS,"true"),r?.shadowRoot?.appendChild(s)}}}catch(i){this.loggingService.catch("Error in DomService injectCustomCss: ",i)}}subscribeInjectCustomCss(r){try{return this.customCss$.subscribe(()=>{this.injectCustomCss(r?.nativeElement)})}catch(i){return this.loggingService.catch("Error in DomService subscribeInjectCustomCss: ",i),new pt}}trimCommentHtml(r){try{let i=document.createElement("div");i.innerHTML=r,this.removeEmptyElements(i);let o=i.innerHTML;return o=o.replace(e.MULTIPLE_NBSP_REGEX," ").replace(e.TRIM_NBSP_REGEX,"").trim(),o}catch(i){return this.loggingService.catch("Error in DomService trimCommentHtml: ",i),r}}removeEmptyElements(r){try{let s=function(a){return o.test(a.innerHTML)};var i=s;let o=/^\s*(<br\s*\/?>)?\s*$/;for(;r.firstChild&&s(r.firstChild);)r.removeChild(r.firstChild);for(;r.lastChild&&s(r.lastChild);)r.removeChild(r.lastChild)}catch(o){this.loggingService.catch("Error in DomService removeEmptyElements: ",o)}}normalizeWhitespace(r){try{r.childNodes.forEach(i=>{i.nodeType===Node.TEXT_NODE?i.nodeValue=i.nodeValue?.replace(/\s+/g," ").trim()??"":i.nodeType===Node.ELEMENT_NODE&&this.normalizeWhitespace(i)})}catch(i){this.loggingService.catch("Error in DomService normalizeWhitespace: ",i)}}sanitizeHtml(r){try{return this.loggingService.log("%c[WB] Calling FUNCTION: sanitizeHtml","color: green;"),JT.sanitize(r,QG)}catch(i){return this.loggingService.catch("Error in DomService sanitizeHtml: ",i),""}}sanitizeHtmlForPaste(r){try{let i=this.convertStylesToTags(r);return JT.sanitize(i,{ALLOWED_TAGS:["b","strong","i","em","u","a","br"],ALLOWED_ATTR:["href","target","rel"]})}catch(i){return this.loggingService.catch("Error in DomService sanitizeHtmlForPaste: ",i),""}}convertStylesToTags(r){try{let i=document.createElement("div");return i.innerHTML=r,this.convertBlockElementsToBr(i),this.processNodeStyles(i),i.innerHTML}catch(i){return this.loggingService.catch("Error in DomService convertStylesToTags: ",i),r}}convertBlockElementsToBr(r){try{let i=["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE","SECTION","ARTICLE","HEADER","FOOTER"],o;for(;(o=r.querySelector(i.join(",")))!==null;){let s=o.parentNode;if(!s)break;for(;o.firstChild;)s.insertBefore(o.firstChild,o);o.nextSibling&&s.insertBefore(document.createElement("br"),o),s.removeChild(o)}}catch(i){this.loggingService.catch("Error in DomService convertBlockElementsToBr: ",i)}}processNodeStyles(r){try{let i=Array.from(r.childNodes);for(let o of i)if(o.nodeType===Node.ELEMENT_NODE){this.processNodeStyles(o);let s=o,a=s.style,c=o,l=a?.fontWeight;if(l==="bold"||l==="700"||l==="800"||l==="900"){let d=s.tagName?.toLowerCase();if(d!=="b"&&d!=="strong"){let h=document.createElement("b");c.parentNode.insertBefore(h,c),h.appendChild(c),c=h}}if(a?.fontStyle==="italic"){let d=s.tagName?.toLowerCase();if(d!=="i"&&d!=="em"){let h=document.createElement("i");c.parentNode.insertBefore(h,c),h.appendChild(c),c=h}}if((a?.textDecorationLine?.includes("underline")||a?.textDecoration?.includes("underline"))&&s.tagName?.toLowerCase()!=="u"){let h=document.createElement("u");c.parentNode.insertBefore(h,c),h.appendChild(c),c=h}}}catch(i){this.loggingService.catch("Error in DomService processNodeStyles: ",i)}}sanitizeSvg(r){try{return JT.sanitize(r,QG)}catch(i){return this.loggingService.catch("Error in DomService sanitizeSvg: ",i),r}}setDeviceInfo(){try{this.loggingService.log("%c[WB] Calling FUNCTION: setDeviceInfo","color: green;");let r=new kr;this.deviceInfo$.next(r)}catch(r){this.loggingService.catch("Error in DomService setDeviceInfo: ",r)}}getDeviceInfo$(){try{return this.loggingService.log("%c[WB] Calling FUNCTION: getDeviceInfo$","color: green;"),this.deviceInfo$.asObservable()}catch(r){return this.loggingService.catch("Error in DomService getDeviceInfo$: ",r),ct(new kr)}}getTabId(){try{let r=sessionStorage.getItem(F.SESSION_STORAGE.VELT_TAB_ID);!r&&this.tabId&&(r=this.tabId,sessionStorage.setItem(F.SESSION_STORAGE.VELT_TAB_ID,r)),!this.tabId&&r&&(this.tabId=r);let i=this.getTabIdFromWindowName();return(!r||r!==i)&&(r=Xu(),this.tabId=r,sessionStorage.setItem(F.SESSION_STORAGE.VELT_TAB_ID,r),this.setTabIdToWindowName(r)),r}catch(r){return this.loggingService.catch("Error in DomService getTabId: ",r),null}}getTabIdFromWindowName(){try{return window.name}catch(r){return this.loggingService.catch("Error in DomService getTabIdFromWindowName: ",r),null}}setTabIdToWindowName(r){try{window.name=r}catch(i){this.loggingService.catch("Error in DomService setTabIdToWindowName: ",i)}}getDeviceInfo(){try{return this.loggingService.log("%c[WB] Calling FUNCTION: getDeviceInfo","color: green;"),this.deviceInfo$.value}catch(r){return this.loggingService.catch("Error in DomService getDeviceInfo: ",r),new kr}}isMobileDevice(){try{return new kr().getDeviceType()===gr.MOBILE}catch(r){return this.loggingService.catch("Error in DomService isMobileDevice: ",r),!1}}isTabletDevice(){try{return new kr().getDeviceType()===gr.TABLET}catch(r){return this.loggingService.catch("Error in DomService isTabletDevice: ",r),!1}}isDesktopDevice(){try{return new kr().getDeviceType()===gr.DESKTOP}catch(r){return this.loggingService.catch("Error in DomService isDesktopDevice: ",r),!1}}deepCloneElement(r){try{var i=document.createElement(r?.tagName);return Array.from(r.attributes).forEach(o=>{i.setAttribute(o.nodeName,o.nodeValue)}),r.childNodes.forEach(o=>{o.nodeType===Node.ELEMENT_NODE?i.appendChild(this.deepCloneElement(o)):o.nodeType===Node.TEXT_NODE&&i.appendChild(document.createTextNode(o.nodeValue))}),i}catch(o){return this.loggingService.catch("Error in DomService deepCloneElement: ",o),r}}setRandomNumberToElementRecursive(r){try{if(!r)return;let i=Math.random().toString(36).substring(7);r&&r.setAttribute&&typeof r.setAttribute=="function"&&(r.getAttribute("velt-wireframe-id")||r.setAttribute("velt-wireframe-id",i)),Array.from(r.children).forEach(s=>{this.setRandomNumberToElementRecursive(s)})}catch(i){this.loggingService.catch("Error in DomService setRandomNumberToElementRecursive: ",i)}}setDialogOpenedInSidebar(r){this.dialogOpenedInSidebar$.next(r)}getDialogOpenedInSidebar(){return this.dialogOpenedInSidebar$.asObservable()}removeWireframeSuffixFromTags(r){if(!r)return;Array.from(r.children).forEach(o=>{if(this.removeWireframeSuffixFromTags(o),o.tagName.toLowerCase().endsWith("-wireframe")){let s=o.tagName.toLowerCase().replace("-wireframe",""),a=document.createElement(s);for(Array.from(o.attributes).forEach(c=>{a.setAttribute(c.name,c.value)});o.firstChild;)a.appendChild(o.firstChild);o.parentNode.replaceChild(a,o)}})}isMonitorDevice(){try{return new kr().getDeviceType()===gr.MONITOR}catch(r){return this.loggingService.catch("Error in DomService isMonitorDevice: ",r),!1}}isElementOriginallyStatic(r){try{return window.getComputedStyle(r).position==="static"||r.hasAttribute(F.ATTRIBUTES.VELT_COMMENT_PIN_HOST_STATIC)||r.hasAttribute(F.ATTRIBUTES.VELT_AREA_PIN_HOST_STATIC)||r.hasAttribute(F.ATTRIBUTES.VELT_TAG_PIN_HOST_STATIC)||r.hasAttribute(F.ATTRIBUTES.VELT_RECORDER_PIN_HOST_STATIC)||r.hasAttribute(F.ATTRIBUTES.VELT_ARROW_PIN_HOST_STATIC)}catch(i){return this.loggingService.catch("Error in DomService isElementOriginallyStatic: ",i),!1}}};e.MULTIPLE_NBSP_REGEX=/(?: \s*){2,}/g,e.TRIM_NBSP_REGEX=/^(?: \s*)+|(?: \s*)+$/g,e.\u0275fac=function(i){return new(i||e)(H(Vs),H(No),H(wt),H(xD))},e.\u0275prov=Q({token:e,factory:e.\u0275fac,providedIn:"root"});let n=e;return n})();function $c(n){let e=n?.refreshToken;return typeof e=="string"&&e.length>0?e:void 0}var pN=Symbol("velt-auth-state-pending");function Xte(n,e){let t=$($({},n),e||{});return t.userId=n.userId,t.userSnippylyId=n.userSnippylyId,t.type=n.type,t.organizationId=n.organizationId,t.clientOrganizationId=n.clientOrganizationId,t.groupId=n.groupId,t.clientGroupId=n.clientGroupId,t.contacts=n.contacts,t.plan=n.plan,t.isAdmin=n.isAdmin,t.isReadOnly=n.isReadOnly,t.isAnonymous=n.isAnonymous,t.isGuest=n.isGuest,t.color=e?.color||n.color,t.textColor=e?.textColor||n.textColor,t.initial=e?.initial||t.name?.charAt(0).toUpperCase()||t.email?.charAt(0).toUpperCase()||n.initial,t?.photoUrl===void 0&&(t.photoUrl=null),t}function ZG(n,e){if(!e.length)return!0;if(n.length!==e.length)return!1;let t=new Set(n);return e.every(r=>t.has(r))}var Ot=class Ot{constructor(e,t,r,i,o,s,a,c,l){this.afAuth=e,this.configService=t,this.avatarService=r,this.coreActionsService=i,this.domService=o,this.functions=s,this.analyticsService=a,this.loggingService=c,this.serviceBook=l,this.endpointsService=Y(KT),this.portableBackend$=new ie(null),this.portableAuthUser$=new ie(null),this.user$=new ie(null),this.userOptions$=new ie(null),this.userContacts$=new ie(null),this.userOrganization$=new ie(null),this.isPrivateCommentsEnabled$=new ie(!1),this.providedUser=new $i,this.portableRefreshTimer=null,this.portableToken=null,this.portableRefreshInFlightEpoch=null,this.portableRefreshFailures=0,this.portableVisibilityHandler=null,this.loggedInUserResolveRetryDelaysMs=[2e3,8e3,3e4],this.loggedInUserResolveRetryInFlightUserId=null,this.firebaseConfig$=new ie(null),this.advancedQueries$=new ie(null),this.planDetails$=new ie(null),this.signOutPreviousUser$=new ie(null),this.preSignOutFunctions=new Map,this.autoLoginCalled=!1,this.portableAutoLoginCalled=!1,this.portableAutoLoginInFlight=Promise.resolve(),this.portableSessionEpoch=0,this.portableSignOutOwnsEpochBump=!1,this.pendingPortableRestore=null,this.portableSessionIdentity=null,this.reportedPortableRefreshCodes=new Set,this.portableRestoredWithoutAuthToken=!1,this.autoLoginRequired=!0,this.config=null,this.getPlanDetailsCalled=!1,this.forceReLoggedIn=!1,this.lastLoggedInUserData=null,this.sessionReLoginCount=0,this.SESSION_RE_LOGIN_COUNT_LIMIT=10,this.sessionReLoginSubscription=null,this.onRetrySubscription=null,this.authProviderListenerGeneration=0,this.TOKEN_EXPIRED_ERROR_COUNT_LIMIT=3,this.tokenExpiredErrorCount=0,this.cachedActivityConfig=null,this.viewsService=null,this.crdtService=null,this.portableSavedSessionRaw=null,this.portableRenewalStopped=null,this.portableSessionStartedAt=0,this.portablePersistInFlight=Promise.resolve(),this.loggingService.log("%c[WB] Creating CLASS: AuthService","color: blue;"),this.serviceBook.observe(iT).subscribe(d=>{this.commentService=d??void 0}),this.serviceBook.observe(oT).subscribe(d=>{this.reactionService=d??void 0}),this.serviceBook.observe(sT).subscribe(d=>{this.areaService=d??void 0}),this.serviceBook.observe(KF).subscribe(d=>{this.activityService=d??void 0,d&&this.cachedActivityConfig&&d.setActivityFeatureConfig(this.cachedActivityConfig)}),this.serviceBook.observe(YF).subscribe(d=>{this.viewsService=d??null}),this.serviceBook.observe(XF).subscribe(d=>{this.crdtService=d??null});try{try{let d=this.configService.getAuthProxyHost();if(d){let h=this.afAuth?.config;h&&(h.apiHost=d,h.tokenApiHost=d)}}catch{}this.analyticsService.setAuthService(this),this.configService.getConfig$().subscribe(d=>{this.config=d}),this.forceReLoggedIn=localStorage.getItem(F.LOCAL_STORAGE.VELT_USER_FORCE_RE_LOGGED_IN)==="true",this.sessionReLoginSubscription=ad(this.afAuth).pipe(Wa(this.afAuth.currentUser),Ha(),br(([d,h])=>this.domService.onNetworkStatusChange$().pipe(pn(f=>f),gn(1),De(()=>({previousUser:d,currentUser:h}))))).subscribe(f=>I(this,[f],function*({previousUser:d,currentUser:h}){if(!h&&d){let g=d?.stsTokenManager?.expirationTime,E=new Date().getTime(),v=g-E;E>g&&(this.analyticsService.trackEvent(Nt.Events.Core.SDK_SESSION_TOKEN_EXPIRED,{apiKey:this.apiKey,user:this.user$.value,lastLoggedInUserData:this.lastLoggedInUserData,timeLeft:v,forceReset:this.userOptions$.value?.forceReset,sessionReLoginCount:this.sessionReLoginCount},!0,this.user$.value?.userSnippylyId),this.user$.value&&d?.uid===this.user$.value?.userSnippylyId&&this.lastLoggedInUserData?.user?.userSnippylyId===this.user$.value?.userSnippylyId&&(this.sessionReLoginCount>this.SESSION_RE_LOGIN_COUNT_LIMIT?(this.analyticsService.trackEvent(Nt.Events.Core.SDK_SESSION_RE_LOGIN_COUNT_EXCEEDED,{apiKey:this.apiKey,clientUserId:this.lastLoggedInUserData.user.userId,snippylyUserId:this.lastLoggedInUserData.user.userSnippylyId,timeLeft:v,forceReset:this.userOptions$.value?.forceReset,sessionReLoginCount:this.sessionReLoginCount},!0,this.user$.value?.userSnippylyId),this.sessionReLoginSubscription?.unsubscribe()):(this.sessionReLoginCount++,this.analyticsService.trackEvent(Nt.Events.Core.SDK_SESSION_RE_LOGIN_TRIGGERED,{apiKey:this.apiKey,clientUserId:this.lastLoggedInUserData.user.userId,snippylyUserId:this.lastLoggedInUserData.user.userSnippylyId,user:this.getUserWithoutContacts(this.lastLoggedInUserData.user),timeLeft:v,forceReset:this.userOptions$.value?.forceReset,sessionReLoginCount:this.sessionReLoginCount},!0,this.lastLoggedInUserData.user.userSnippylyId),this.lastLoggedInUserData.user=yield this.updateUserWithColorAndTextColor(this.lastLoggedInUserData.user),this.initializeClient(this.lastLoggedInUserData.user,this.lastLoggedInUserData.userOptions,this.lastLoggedInUserData.initializeClientToken,this.lastLoggedInUserData.autoLogin,"internal-sessionReLogin"))))}}),d=>{this.loggingService.catch("Error in AuthService sessionReLoginSubscription: ",d)}),this.getUser$().pipe(_o(tp)).subscribe(d=>{let h=YD(d);this.coreActionsService.triggerAction(Hi.USER_UPDATE,h),this.coreActionsService.triggerAction(Hi.INIT_UPDATE,{event:Hi.USER_UPDATE,payload:{user:h}})})}catch(d){this.loggingService.catch("Error in AuthService constructor: ",d)}}setApiKey(e,t){this.loggingService.log("%c[WB] Calling FUNCTION: setApiKey","color: green;",e);try{if(this.apiKey){this.loggingService.log("API key is already set");return}this.apiKey=e,this.configService.setApiKey(this.apiKey),t||(t=new dT),this.configService.initConfig(t);let r=this.configService.getProxyConfig();if(r?.authHost)try{let i=this.afAuth?.config;i&&(i.apiHost=r.authHost,i.tokenApiHost=r.authHost)}catch(i){this.loggingService.catch("Error setting auth proxy config: ",i)}else try{let i=this.afAuth?.config;i&&i.apiHost!=="identitytoolkit.googleapis.com"&&(i.apiHost="identitytoolkit.googleapis.com",i.tokenApiHost="securetoken.googleapis.com")}catch(i){this.loggingService.catch("Error resetting auth proxy config: ",i)}t.debugMode?sessionStorage.setItem("debugMode","true"):sessionStorage.removeItem("debugMode"),this.autoLoginCalled||ad(this.afAuth).pipe(gn(1)).subscribe(i=>I(this,null,function*(){if(this.autoLoginCalled=!0,i){let o=yield Ip(i,!0).catch(s=>null);if(o){let{user:s}=o?.claims;this.autoLoginRequired&&(s=yield this.updateUserWithColorAndTextColor(s),this.initializeClient(s,this.buildAutoLoginOptions(),new Date().getTime(),!0,"internal-autoLogin"))}}})),!this.portableAutoLoginCalled&&this.configService.getEnablePortableBackend()===!0&&(this.portableAutoLoginCalled=!0,this.portableAutoLoginInFlight=this.autoLoginPortableSession())}catch(r){this.loggingService.catch("Error in setApiKey: ",r)}}setUsersService(e){try{this.loggingService.log("%c[WB] Calling FUNCTION: setUsersService","color: green;"),this.usersService=e}catch(t){this.loggingService.catch("Error in setUsersService: ",t)}}setUserPermissionService(e){try{this.loggingService.log("%c[WB] Calling FUNCTION: setUserPermissionService","color: green;"),this.userPermissionService=e}catch(t){this.loggingService.catch("Error in setUserPermissionService: ",t)}}setDocService(e){try{this.loggingService.log("%c[WB] Calling FUNCTION: setDocService","color: green;"),this.docService=e}catch(t){this.loggingService.catch("Error in setDocService: ",t)}}setContactService(e){try{this.loggingService.log("%c[WB] Calling FUNCTION: setContactService","color: green;"),this.contactService=e}catch(t){this.loggingService.catch("Error in setContactService: ",t)}}setIamService(e){try{this.loggingService.log("%c[WB] Calling FUNCTION: setIamService","color: green;"),this.iamService=e}catch(t){this.loggingService.catch("Error in setIamService: ",t)}}setCommentService(e){try{this.loggingService.log("%c[WB] Calling FUNCTION: setCommentService","color: green;"),this.commentService=e}catch(t){this.loggingService.catch("Error in setCommentService: ",t)}}setCommonDbService(e){try{this.loggingService.log("%c[WB] Calling FUNCTION: setCommonDbService","color: green;"),this.commonDbService=e}catch(t){this.loggingService.catch("Error in setCommonDbService: ",t)}}validateOrganizationId(e){if(this.isVersionGreaterThanOrEqualTo4()&&!e?.organizationId)if(this.analyticsService.trackEvent(Nt.Events.Core.SDK_VALIDATE_CLIENT_FAILED,{apiKey:this.apiKey,clientUserId:e.userId,snippylyUserId:e.userSnippylyId,message:"Organization Id is not set",forceReset:this.userOptions$.value?.forceReset,user:this.getUserWithoutContacts(e)},!0,e.userSnippylyId),this.configService.getSF())this.loggingService.catch("OrganizationId is not set in Identify method",void 0,void 0,!0);else throw new Error("OrganizationId is not set in Identify method")}setVeltAuthProvider(e){return I(this,null,function*(){this.loggingService.log("%c[WB] Calling FUNCTION: setVeltAuthProvider","color: green;");try{this.onRetrySubscription?.unsubscribe(),this.authProviderListenerGeneration++;let t=null;if(!e.user)return null;e.generateToken&&typeof e.generateToken=="function"&&(t=yield e.generateToken());let r=yield KD(()=>window.Velt.identify(e.user,$($({},e.options||{}),t&&{authToken:t}),{fromProvider:!0}).catch(i=>(e.onError&&typeof e.onError=="function"&&e.onError(i),Promise.reject(i))),e.retryConfig||{retryCount:0,retryDelay:0});return r&&e.generateToken&&typeof e.generateToken=="function"&&(this.onRetrySubscription=this.coreActionsService.onAction(Hi.ERROR).pipe(pn(i=>i.code==="token_expired"),gn(10)).subscribe(i=>I(this,null,function*(){if(i.code==="token_expired"){let o=this.authProviderListenerGeneration,s=()=>o===this.authProviderListenerGeneration,a=this.docService?.getDocumentIds()?.map(g=>({id:g.clientDocumentId}))??[],c=this.docService?.getOptionsFromDocumentPaths()??void 0,l=[],d=this.docService?.getLocation();d&&l.push(d.location);let h=this.docService?.getLocations();if(h&&Object.values(h).forEach(g=>{l.push(g.location)}),(yield KD(()=>I(this,null,function*(){try{let g=yield e.generateToken?.();return s()&&g?window.Velt.identify(e.user,$($({},e.options||{}),g&&{authToken:g}),{fromProvider:!0}):!0}catch{return!1}}),e.retryConfig||{retryCount:0,retryDelay:0}))&&s()){let g=this.docService?.getDocumentIds()?.map(S=>S.clientDocumentId)??[];ZG(a.map(S=>S.id),g)&&(yield this.docService?.setDocuments({documents:a,options:c,source:"internal"}));let E=[],v=this.docService?.getLocation();v?.location?.id&&E.push(v.location.id),Object.values(this.docService?.getLocations()??{}).forEach(S=>{S?.location?.id&&E.push(S.location.id)}),ZG(l.map(S=>S?.id).filter(Boolean),E)&&(yield this.docService?.setLocations({locations:l,source:"internal",options:{appendLocation:!d}}))}}}))),r}catch(t){return this.loggingService.catch("Error in setVeltAuthProvider: ",t),null}})}setUserToStorage(e){return I(this,null,function*(){try{if(e){let t=yield _T(e,e?.userId??"");localStorage.setItem(F.LOCAL_STORAGE.VELT_IDENTIFY_USER,t)}}catch(t){this.loggingService.catch("Error in setUserToStorage: ",t)}})}getUserFromStorage(e){return I(this,null,function*(){try{let t=localStorage.getItem(F.LOCAL_STORAGE.VELT_IDENTIFY_USER);return t?yield Qu(t,e?.userId??""):null}catch(t){return this.loggingService.catch("Error in getUserFromStorage: ",t),null}})}setIsPrivateCommentsEnabled(e){try{this.isPrivateCommentsEnabled$.next(e)}catch(t){this.loggingService.catch("Error in setIsPrivateCommentsEnabled: ",t)}}getIsPrivateCommentsEnabled(){return this.isPrivateCommentsEnabled$.value}getIsPrivateCommentsEnabled$(){return this.isPrivateCommentsEnabled$.asObservable()}updateUserWithColorAndTextColor(e){return I(this,null,function*(){try{let t=JSON.parse(JSON.stringify(e??{})),r=yield this.getUserFromStorage(t);return!r||Object.keys(r).length===0?(delete t?.color,delete t?.textColor,t):(r?.color&&(t.color=r?.color),r?.textColor&&(t.textColor=r?.textColor),t)}catch(t){return this.loggingService.catch("Error in updateUserWithColorAndTextColor: ",t),e}})}updateUserIfRequired(e){return I(this,null,function*(){this.loggingService.log("%c[WB] Calling FUNCTION: updateUserIfRequired","color: green;");try{let t=yield this.getUserFromStorage(e),r={};e.color&&e.color!==t?.color&&(r.color=e.color),e.textColor&&e.textColor!==t?.textColor&&(r.textColor=e.textColor),Object.keys(r).length>0&&e.clientOrganizationId&&this.docService?.addUserInfoToOrganization({organizationId:e.clientOrganizationId,user:ye($({},r),{userId:e.userId})})}catch(t){this.loggingService.catch("Error in updateUserIfRequired: ",t)}})}initializeClient(e,t,r,i,o){return I(this,null,function*(){try{if(this.autoLoginRequired=!1,this.userOptions$.next(t),this.initializeClientToken)this.pendingUserLogin=e,this.pendingUserLoginSource=o;else{e.userSnippylyId=fV(this.configService.getApiKey(),e.userId),this.pendingUserLogin=void 0,this.pendingUserLoginSource=void 0,this.initializeClientToken=r;let s=this.portableSessionEpoch,a=yield ad(this.afAuth).pipe(gn(1)).toPromise().catch(h=>null),c=!0;this.providedUser=JSON.parse(JSON.stringify(e));let l=!a&&i?this.takePendingPortableRestore(e,t):null,d=l?.envelope??null;if(d){if(this.loggingService.log("%c[WB] Calling FUNCTION: restorePortableSession","color: green;"),this.validateOrganizationId(e),!(yield this.applyIdentifyResponse(e,d.res,i,t?.authToken)))return;c=!1,this.trackAutoAuthSuccess(e,o)}else if(!a&&i&&o==="internal-autoLogin"&&this.configService?.getEnablePortableBackend()===!0)return l?.overtaken?(On("session.restore-discarded"),this.loggingService.log("Velt [portable backend]: discarding a reload restore that a sign-out or a new identify overtook."),this.clearPersistedPortableSessionIfUnchanged(l.raw)):(this.loggingService.log("Velt [portable backend]: nothing restorable on reload; waiting for identify()."),this.clearPersistedPortableSession()),this.initializeClientToken=0,this.checkForPendingLogin(),null;if(a){let h=yield Ip(a,!0).catch(v=>null);if(!h)return;let{user:f,firebaseConfig:g,advancedQueries:E}=h.claims;a?.uid!==e?.userSnippylyId||e?.groupId!==f?.groupId||e?.organizationId!==f?.organizationId||t?.forceReset||!i&&e?.organizationId&&!this.forceReLoggedIn||this.forceReLoginRequiredForAdvancedQueries(e)||this.forceReLoginRequiredForRegion(e,g)||this.forceReLoginRequiredForCommentViews(e)?(localStorage.setItem(F.LOCAL_STORAGE.VELT_USER_FORCE_RE_LOGGED_IN,"true"),localStorage.setItem(F.LOCAL_STORAGE.VELT_COMMENT_VIEWS_MIGRATED,"true"),this.forceReLoggedIn=!0,yield this.signOutUser("internal"),s=this.portableSessionEpoch):(this.loggingService.log("%c[WB] Calling FUNCTION: reinitializeCurrentUser","color: green;"),this.loggingService.log("Keeping user"),yield this.updateUserIfRequired(e),this.validateOrganizationId(e),this.setFirebaseConfig(g),this.setAdvancedQueries(E),f&&(this.providedUser.isAdmin=!!f.isAdmin),this.initializeSignedInUser(a,i,e),c=!1,this.trackAutoAuthSuccess(e,o))}if(c){this.analyticsService.trackEvent(Nt.Events.Core.SDK_VALIDATE_CLIENT_TRIGGERED,{apiKey:this.apiKey,clientUserId:e.userId,snippylyUserId:e.userSnippylyId,forceReset:this.userOptions$.value?.forceReset,user:this.getUserWithoutContacts(e),source:o},!0,e.userSnippylyId,e.userId);let h=yield this.requestIdentify(e,t?.authToken);if(h.error){if(this.analyticsService.trackEvent(Nt.Events.Core.SDK_VALIDATE_CLIENT_FAILED,ye($({apiKey:this.apiKey,clientUserId:e.userId,snippylyUserId:e.userSnippylyId,message:h.error,forceReset:this.userOptions$.value?.forceReset,user:this.getUserWithoutContacts(e)},h),{source:o}),!0,e.userSnippylyId,e.userId),h.error&&typeof h.error=="string")if(this.isTokenExpiredIdentifyError(h))this.emitIdentifyTokenExpiredError(h,e,o);else{let g=h;this.coreActionsService.triggerAction(Hi.ERROR,g)}throw h}else this.tokenExpiredErrorCount=0;if(this.shouldHandlePortableBackend(h)&&s!==this.portableSessionEpoch)return this.loggingService.log("Velt [portable backend]: discarding an identify response that a sign-out overtook."),this.initializeClientToken=0,this.checkForPendingLogin(),null;if(this.analyticsService.trackEvent(Nt.Events.Core.SDK_VALIDATE_CLIENT_SUCCESS,{apiKey:this.apiKey,clientUserId:e.userId,snippylyUserId:e.userSnippylyId,forceReset:this.userOptions$.value?.forceReset,user:this.getUserWithoutContacts(e),source:o},!0,e.userSnippylyId,e.userId),this.validateOrganizationId(e),!(yield this.applyIdentifyResponse(e,h,i,t?.authToken)))return}this.initializeClientToken=0,this.lastLoggedInUserData={user:e,userOptions:t,initializeClientToken:r,autoLogin:i},this.checkForPendingLogin()}return e}catch(s){return this.initializeClientToken=0,this.checkForPendingLogin(),this.loggingService.catch("Error in initializeClient: ",s),t?.throwError?Promise.reject(s):Promise.resolve(null)}})}isVersionGreaterThanOrEqualTo4(){try{let e=wc();return(e?parseInt(e.split(".")?.[0]||"0"):0)>=4}catch(e){return this.loggingService.catch("Error in isVersionGreaterThanOrEqualTo4: ",e),!1}}isVersion4Point5(){try{let e=wc();if(e){let t=e.split("."),r=parseInt(t[0]||"0"),i=parseInt(t[1]||"0"),o=parseInt(t[2]||"0");if(r>=4&&i>=5)return r===4&&i===5&&o===0?!e.toLowerCase().includes("beta"):!0}return!1}catch(e){return this.loggingService.catch("Error in isVersion4Point5: ",e),!1}}forceReLoginRequiredForAdvancedQueries(e){try{let t=this.isVersionGreaterThanOrEqualTo4(),r=!1;try{let i=localStorage.getItem(F.LOCAL_STORAGE.VELT_ADVANCED_QUERIES);i&&(r=JSON.parse(i)?.advancedQueriesEnabled)}catch(i){this.loggingService.catch("Error in forceReLoginRequiredForAdvancedQueries: ",i)}return!!(t&&e.organizationId&&!r)}catch(t){return this.loggingService.catch("Error in forceReLoginRequiredForAdvancedQueries: ",t),!1}}forceReLoginRequiredForCommentViews(e){try{let t=this.isVersion4Point5(),r=!1;try{let i=localStorage.getItem(F.LOCAL_STORAGE.VELT_COMMENT_VIEWS_MIGRATED);i&&(r=JSON.parse(i))}catch(i){this.loggingService.catch("Error in forceReLoginRequiredForCommentViews: ",i)}return!!(t&&e.organizationId&&!r)}catch(t){return this.loggingService.catch("Error in forceReLoginRequiredForCommentViews: ",t),!1}}forceReLoginRequiredForRegion(e,t){try{return!!(this.isVersionGreaterThanOrEqualTo4()&&e.organizationId&&!t?.region)}catch(r){return this.loggingService.catch("Error in forceReLoginRequiredForRegion: ",r),!1}}checkForPendingLogin(){this.pendingUserLogin&&this.initializeClient(this.pendingUserLogin,this.userOptions$?.value||{},new Date().getTime(),void 0,this.pendingUserLoginSource)}setFirebaseConfig(e){this.loggingService.log("%c[WB] Calling FUNCTION: setFirebaseConfig","color: green;");try{this.firebaseConfig$.value||this.firebaseConfig$.next({firebaseOptions:$($({},this.endpointsService.getFirebaseConfig()),e)})}catch(t){this.loggingService.catch("Error in setFirebaseConfig: ",t)}}requestIdentify(e,t,r){return I(this,null,function*(){let i=wc(),o=this.endpointsService.getPortableIdentifyUrl();return o?hG($({url:o,apiKey:this.apiKey,user:e,version:i,authToken:t},r?.renewal?{timeoutMs:eN()}:{})):(yield ld(this.functions,ed({url:this.endpointsService.getCloudFunctionUrl("validateClient"),apiProxyDomain:this.configService?.getApiProxyDomain()}),{timeout:1200*1e3})({apiKey:this.apiKey,user:e,version:i,authToken:t}))?.data})}requestPortableRefresh(e){return I(this,null,function*(){let t=this.endpointsService.getPortableIdentifyUrl();if(!t||Nc(t)){let i="the portable identify URL is not configured; the renewal credential was not sent";return{error:i,code:"network_error",message:i,source:"identify"}}let r=yield gG({url:pG(t,"refresh"),apiKey:this.apiKey,refreshToken:e,timeoutMs:eN()});return r&&typeof r=="object"&&typeof r.token=="string"&&r.token&&r.backend==null&&!r.error&&!r.code?ye($({},r),{backend:"portable"}):r})}readSharedPortableRefreshToken(e){return I(this,null,function*(){try{let t=this.readStoredPortableSessionRaw();if(!t||t===this.portableSavedSessionRaw)return;let r=yield Qu(t,this.apiKey??"");return r?.v!==1||r?.apiKey!==this.apiKey||r?.user?.userId!==e||(r?.portableBackendUrl??null)!==(this.configService?.getSelfHostedConfig?.()?.portableBackendUrl??null)?void 0:$c(r?.res)}catch{return}})}reportPortableRefreshMisconfigured(e){try{let t=String(e?.code??"unknown");if(this.reportedPortableRefreshCodes.has(t))return;this.reportedPortableRefreshCodes.add(t);let r=e?.message?` (${e.message})`:"";console.error(t==="invalid-argument"?`Velt [portable backend]: the gateway rejected the session renewal as malformed: invalid-argument${r}. The SDK and gateway versions disagree on /identify/refresh; renewal is stopped for this session.`:`Velt [portable backend]: the gateway refused the session renewal: ${t}${r}. A deployment setting is wrong (the allowed origins, or the identify configuration for this API key). Renewal is stopped for this session; after the setting is fixed, a reload renews from the saved session.`)}catch{}}emitIdentifyTokenExpiredError(e,t,r){if(this.tokenExpiredErrorCount++,this.tokenExpiredErrorCount<=this.TOKEN_EXPIRED_ERROR_COUNT_LIMIT){let i={code:"token_expired",message:"Token expired",error:e?.error,source:e?.source};this.coreActionsService.triggerAction(Hi.ERROR,i)}else{let i={code:"too_many_retries",message:"Token expired. Too many retries.",error:e?.error,source:e?.source};this.coreActionsService.triggerAction(Hi.ERROR,i),this.analyticsService.trackEvent(Nt.Events.Core.SDK_JWT_EXPIRED_RETRY_EXCEEDED,{apiKey:this.apiKey,clientUserId:t.userId,snippylyUserId:t.userSnippylyId,forceReset:this.userOptions$.value?.forceReset,source:r},!0,t.userSnippylyId,t.userId)}}isTokenExpiredIdentifyError(e){try{return e?.code==="token_expired"||!!e?.error?.toLowerCase?.()?.includes("token expired")}catch{return!1}}shouldHandlePortableBackend(e){try{return this.configService?.getEnablePortableBackend()===!0&&AG(e)}catch(t){return this.loggingService.catch("Error in shouldHandlePortableBackend: ",t),!1}}applyIdentifyResponse(e,t,r,i){return I(this,null,function*(){if(this.shouldHandlePortableBackend(t)){this.portableSessionEpoch++;let o=this.portableSessionEpoch,s=$c(t),a=s?this.endpointsService.getPortableIdentifyUrl()??void 0:void 0;if(this.portableSessionIdentity=$({user:e,authToken:i,epoch:o},s?{refreshToken:s,refreshTokenIssuer:a}:{}),this.portableSessionStartedAt=Date.now(),r||(this.portableRestoredWithoutAuthToken=!1),this.handlePortableBackendResponse(t),yield this.applyPortableProjectConfig(t),o!==this.portableSessionEpoch)return On("session.adopt-discarded"),this.loggingService.log("Velt [portable backend]: discarding a portable sign-in that a sign-out or a new identify overtook."),!0;this.initializePortableSignedInUser(e,t)}else if(t.firebaseConfig){this.clearPortableBackendState(),this.setFirebaseConfig(t.firebaseConfig),yield this.signInWithCustomToken(e,t.token),this.loggingService.log("new signed in user",this.afAuth.currentUser);let o=yield Ip(this.afAuth.currentUser,!0).catch(c=>null);if(!o)return!1;let{user:s,advancedQueries:a}=o.claims;this.setAdvancedQueries(a),this.providedUser.isAdmin=!!s?.isAdmin,this.initializeSignedInUser(this.afAuth.currentUser,r,e)}return!0})}applyPortableProjectConfig(e){return I(this,null,function*(){try{let t=yield vG({apiEndpoint:e?.apiEndpoint,token:e?.token});if(!t)return;this.setIsPrivateCommentsEnabled(t.isPrivateCommentsEnabled);let r=t.activityConfig??{immutable:!1,isEnabled:!1};this.cachedActivityConfig=r,this.activityService?.setActivityFeatureConfig(r)}catch(t){this.loggingService.catch("Error in applyPortableProjectConfig: ",t)}})}handlePortableBackendResponse(e){try{this.loggingService.log("%c[WB] Calling FUNCTION: handlePortableBackendResponse","color: green;"),this.portableBackend$.next({backend:e?.backend,wsEndpoint:e?.wsEndpoint,apiEndpoint:e?.apiEndpoint}),CG({backend:e?.backend,token:e?.token??null,wsEndpoint:e?.wsEndpoint,apiEndpoint:e?.apiEndpoint}),this.schedulePortableTokenRefresh(e?.token??null)}catch(t){this.loggingService.catch("Error in handlePortableBackendResponse: ",t)}}schedulePortableTokenRefresh(e){try{if(this.clearPortableTokenRefresh(),this.portableToken=e,!e)return;this.portableRefreshFailures=0;let t=rN(ud(e),Date.now());if(t!==null?this.portableRefreshTimer=setTimeout(()=>this.refreshPortableToken("expiry"),t):this.loggingService.log("Velt [portable backend]: no proactive token refresh scheduled (token expiry unreadable or already past)."),typeof document<"u"&&typeof document.addEventListener=="function"){this.portableVisibilityHandler=r=>{try{let i=TG(this.portableToken,Date.now());if(On(`page.${r?.type??"lifecycle"}`,`visibility=${typeof document<"u"?document.visibilityState:"?"} credentialExpired=${i}`),r?.type==="pageshow"&&r.persisted===!1)return;i&&this.refreshPortableToken("focus"),RG()}catch{}};for(let r of Ot.PORTABLE_DOCUMENT_LIFECYCLE_EVENTS)document.addEventListener(r,this.portableVisibilityHandler);typeof window<"u"&&typeof window.addEventListener=="function"&&window.addEventListener("pageshow",this.portableVisibilityHandler)}}catch(t){this.loggingService.catch("Error scheduling portable token refresh: ",t)}}readStoredPortableSessionRaw(){try{return localStorage.getItem(F.LOCAL_STORAGE.VELT_PORTABLE_SESSION)}catch{return}}portableSavedSessionVerdict(e){return I(this,null,function*(){try{let t;try{t=localStorage.getItem(F.LOCAL_STORAGE.VELT_PORTABLE_SESSION)}catch{return"persist"}if(!t){let i=this.readPortableSignOutAt();return i!==null&&i>=this.portableSessionStartedAt?"stop":"persist"}if(t===this.portableSavedSessionRaw)return"persist";let r=null;try{r=yield Qu(t,this.apiKey??"")}catch{r=null}return r?.v!==1||r?.apiKey!==this.apiKey||!r?.user?.userId?"renew-only":r.user.userId===e?"persist":"stop"}catch(t){return this.loggingService.catch("Error in AuthService portableSavedSessionVerdict: ",t),"persist"}})}recordPortableSignOut(){try{if(!this.apiKey)return;let e={};try{let t=JSON.parse(localStorage.getItem(F.LOCAL_STORAGE.VELT_PORTABLE_SIGNED_OUT)??"{}");t&&typeof t=="object"&&!Array.isArray(t)&&(e=t)}catch{e={}}e[this.apiKey]=Date.now(),localStorage.setItem(F.LOCAL_STORAGE.VELT_PORTABLE_SIGNED_OUT,JSON.stringify(e))}catch{}}schedulePortableSavedSessionRecheck(e,t){try{let r=ud(this.portableToken);if(r===null||r<=Date.now()||e!==this.portableSessionEpoch)return;this.portableRefreshTimer&&clearTimeout(this.portableRefreshTimer),this.portableRefreshTimer=setTimeout(()=>this.refreshPortableToken(t),iN(r,Date.now()))}catch(r){this.loggingService.catch("Error scheduling the portable saved-session re-check: ",r)}}reaskAppForTokenIfDue(e){try{let t=this.portableRenewalStopped;if(!t||t.reason!==Ot.PORTABLE_TOKEN_EXPIRED_REASON||Date.now()-(t.askedAt??0)<Ot.PORTABLE_TOKEN_EXPIRED_REASK_MS||this.tokenExpiredErrorCount>this.TOKEN_EXPIRED_ERROR_COUNT_LIMIT)return;t.askedAt=Date.now(),On("credential.token-expired-reasked"),this.emitIdentifyTokenExpiredError(t.res,e,"internal-portableRefresh")}catch(t){this.loggingService.catch("Error re-asking the app for a token: ",t)}}readPortableSignOutAt(){try{let e=JSON.parse(localStorage.getItem(F.LOCAL_STORAGE.VELT_PORTABLE_SIGNED_OUT)??"null"),t=e&&this.apiKey?e[this.apiKey]:void 0;return typeof t=="number"&&Number.isFinite(t)?t:null}catch{return null}}clearPortableTokenRefresh(){try{if(this.portableRefreshTimer&&(clearTimeout(this.portableRefreshTimer),this.portableRefreshTimer=null),this.portableVisibilityHandler&&typeof document<"u")for(let e of Ot.PORTABLE_DOCUMENT_LIFECYCLE_EVENTS)document.removeEventListener(e,this.portableVisibilityHandler);this.portableVisibilityHandler&&typeof window<"u"&&typeof window.removeEventListener=="function"&&window.removeEventListener("pageshow",this.portableVisibilityHandler),this.portableVisibilityHandler=null}catch{}}refreshPortableToken(e){return I(this,null,function*(){let t=this.portableSessionEpoch;if(this.portableRefreshInFlightEpoch!==t){this.portableRefreshInFlightEpoch=t;try{let r=this.portableSessionIdentity,i=r?.user;if(!r||r.epoch!==t||!i?.userId||!this.portableBackend$.value)return;if(this.portableRenewalStopped?.epoch===t){On("credential.refresh-skipped",`${this.portableRenewalStopped.reason}; waiting for identify()`),this.reaskAppForTokenIfDue(i);return}if((yield this.portableSavedSessionVerdict(i.userId))==="stop"){On("credential.refresh-skipped","saved session gone or replaced by another page"),this.loggingService.log("Velt [portable backend]: not renewing the credential \u2014 another page signed out or switched users."),this.schedulePortableSavedSessionRecheck(t,e);return}if(t!==this.portableSessionEpoch)return;let o=yield this.readSharedPortableRefreshToken(i.userId);if(t!==this.portableSessionEpoch)return;let s=this.endpointsService.getPortableIdentifyUrl()??void 0;o&&s&&this.portableSessionIdentity&&o!==this.portableSessionIdentity.refreshToken&&(On("credential.shared-adopted"),this.portableSessionIdentity=ye($({},this.portableSessionIdentity),{refreshToken:o,refreshTokenIssuer:s}));let a=this.portableSessionIdentity??r,c=a.refreshToken&&a.refreshTokenIssuer===s?a.refreshToken:void 0;this.loggingService.log(`Velt [portable backend]: refreshing the gateway credential (${e}${c?", renewal credential":""}).`),On("credential.refresh-requested",`reason=${e}${c?" via=refresh":""}`);let l=c?yield this.requestPortableRefresh(c):yield this.requestIdentify(i,r.authToken,{renewal:!0});if(t!==this.portableSessionEpoch){On("credential.refresh-discarded",`reason=${e}`),this.loggingService.log("Velt [portable backend]: discarding a credential refresh that a sign-out or a new identify overtook.");return}if(!this.shouldHandlePortableBackend(l)||!l?.token){if(c&&l?.code===tN){On("credential.refresh-credential-invalid",`reason=${e}`),this.portableRenewalStopped={epoch:t,reason:Ot.PORTABLE_TOKEN_EXPIRED_REASON,askedAt:Date.now(),res:l},this.portableRefreshTimer&&(clearTimeout(this.portableRefreshTimer),this.portableRefreshTimer=null),this.portableSavedSessionRaw&&this.clearPersistedPortableSessionIfUnchanged(this.portableSavedSessionRaw),this.emitIdentifyTokenExpiredError(l,i,"internal-portableRefresh");return}if(c&&nN.has(l?.code)){On("credential.refresh-misconfigured",`code=${l?.code}`),this.portableRenewalStopped={epoch:t,reason:`renewal refused: ${l?.code}`},this.portableRefreshTimer&&(clearTimeout(this.portableRefreshTimer),this.portableRefreshTimer=null),this.reportPortableRefreshMisconfigured(l);return}if(!c&&this.portableRestoredWithoutAuthToken&&l?.code!=="network_error"){On("credential.restore-renew-refused"),this.loggingService.log("Velt [portable backend]: the restored session could not renew its credential without identify(); it ends at token expiry unless the app identifies."),this.clearPersistedPortableSession(),Ot.PORTABLE_RESTORE_RENEW_FINAL_CODES.has(l?.code)&&(this.portableRenewalStopped={epoch:t,reason:"restored session has no authToken"}),this.portableRefreshTimer&&(clearTimeout(this.portableRefreshTimer),this.portableRefreshTimer=null);return}if(this.isTokenExpiredIdentifyError(l)){On("credential.refresh-token-expired",`reason=${e}`),this.portableRenewalStopped={epoch:t,reason:Ot.PORTABLE_TOKEN_EXPIRED_REASON,askedAt:Date.now(),res:l},this.portableRefreshTimer&&(clearTimeout(this.portableRefreshTimer),this.portableRefreshTimer=null),this.emitIdentifyTokenExpiredError(l,i,"internal-portableRefresh");return}if(this.portableRefreshFailures++,this.portableRefreshFailures>=Ot.PORTABLE_MAX_REFRESH_FAILURES){this.reportPortableRefreshExhausted(l);return}let f=iN(ud(this.portableToken),Date.now());this.portableRefreshTimer=setTimeout(()=>this.refreshPortableToken(e),f);return}On("credential.refreshed"),this.handlePortableBackendResponse(l);let d=$c(l)??c;d&&this.portableSessionIdentity?.epoch===t&&(this.portableSessionIdentity=ye($({},this.portableSessionIdentity),{refreshToken:d,refreshTokenIssuer:s}));let h=this.readStoredPortableSessionRaw();(yield this.portableSavedSessionVerdict(i.userId))==="persist"&&t===this.portableSessionEpoch&&this.persistPortableSession(i,d?ye($({},l),{refreshToken:d}):l,{expectStoredRaw:h})}catch(r){this.loggingService.catch("Error refreshing portable token: ",r)}finally{this.portableRefreshInFlightEpoch===t&&(this.portableRefreshInFlightEpoch=null)}}})}reportPortableRefreshExhausted(e){try{console.warn(`Velt [portable backend]: could not renew the gateway credential after ${Ot.PORTABLE_MAX_REFRESH_FAILURES} attempts${e?.error?` (${e.error})`:""}. The realtime session will stop working when the current token expires, and a fresh identify() is required to recover. Check that the gateway's /identify endpoint is reachable and still accepts this user.`)}catch{}}initializePortableSignedInUser(e,t){try{if(this.loggingService.log("%c[WB] Calling FUNCTION: initializePortableSignedInUser","color: green;"),!t?.token){this.portableAuthUser$.value&&(this.resetServicesCache(),this.user$.next(null),this.clearPortableBackendState());return}let r=new $i;r.type="signedIn",r=$($({},r),e),r.color=r.color||this.getUserAvatarColor(r.userId),r.textColor=r.textColor||this.getUserTextColor(r.userId),r.initial=r.initial||r.name?.charAt(0).toUpperCase()||r.email?.charAt(0).toUpperCase(),this.setUserToStorage(r),this.persistPortableSession(r,t);let i=Object.assign({},r);delete i.contacts,this.analyticsService.identifyUser(r.userSnippylyId,i,{forceReset:this.userOptions$.value?.forceReset}),this.user$.next(r),this.portableAuthUser$.next({uid:r.userSnippylyId})}catch(r){this.loggingService.catch("Error in initializePortableSignedInUser: ",r)}}clearPortableBackendState(){try{if(this.portableSignOutOwnsEpochBump||this.portableSessionEpoch++,this.pendingPortableRestore=null,this.portableSessionIdentity=null,(this.portableAutoLoginCalled||this.configService?.getEnablePortableBackend()===!0)&&this.clearPersistedPortableSession(),!this.portableBackend$.value&&!this.portableAuthUser$.value)return;this.clearPortableTokenRefresh(),this.portableToken=null,this.portableRefreshFailures=0,this.portableBackend$.next(null),this.portableAuthUser$.next(null),this.user$.next(null),DG()}catch(e){this.loggingService.catch("Error clearing portable backend state: ",e)}}trackAutoAuthSuccess(e,t){this.analyticsService.trackEvent(Nt.Events.Core.SDK_USER_AUTH_SUCCESS,{apiKey:this.apiKey,clientUserId:e.userId,snippylyUserId:e.userSnippylyId,authType:"auto",forceReset:this.userOptions$.value?.forceReset,user:this.getUserWithoutContacts(e),source:t})}buildAutoLoginOptions(){return this.userOptions$?.value?ye($({},this.userOptions$.value),{replaceContacts:!1,replaceGroupContacts:!1,replacePrivateContacts:!1}):{}}persistPortableSession(e,t,r){let i=this.portableSessionEpoch;return this.portablePersistInFlight=this.portablePersistInFlight.then(()=>this.writePortableSessionEnvelope(e,t,i,r?.expectStoredRaw)).catch(()=>{}),this.portablePersistInFlight}writePortableSessionEnvelope(e,t,r,i){return I(this,null,function*(){try{if(!t?.token||!e?.userId||!this.apiKey)return;let o=this.user$.value;if(o?.userSnippylyId&&e.userSnippylyId&&o.userSnippylyId!==e.userSnippylyId)return;let s=this.getUserWithoutContacts(e);if(!s)return;let a={v:1,apiKey:this.apiKey,portableBackendUrl:this.configService?.getSelfHostedConfig?.()?.portableBackendUrl??null,user:s,res:$({backend:t.backend,wsEndpoint:t.wsEndpoint,apiEndpoint:t.apiEndpoint,token:t.token},$c(t)?{refreshToken:$c(t)}:{})},c=yield _T(a,this.apiKey);if(r!==this.portableSessionEpoch){this.loggingService.log("Velt [portable backend]: dropping a session envelope write that a sign-out or a new identify overtook.");return}if(i!==void 0&&localStorage.getItem(F.LOCAL_STORAGE.VELT_PORTABLE_SESSION)!==i){this.loggingService.log("Velt [portable backend]: not re-persisting a refreshed credential \u2014 another page changed the saved session meanwhile.");return}let l=this.readPortableSignOutAt();if(l!==null&&l>this.portableSessionStartedAt){this.loggingService.log("Velt [portable backend]: not persisting the session \u2014 another page signed out after it began.");return}typeof c=="string"&&!c.startsWith("{")&&c!==JSON.stringify(a)&&(localStorage.setItem(F.LOCAL_STORAGE.VELT_PORTABLE_SESSION,c),this.portableSavedSessionRaw=c)}catch(o){this.loggingService.catch("Error in writePortableSessionEnvelope: ",o)}})}readPersistedPortableSession(){return I(this,null,function*(){try{let e=localStorage.getItem(F.LOCAL_STORAGE.VELT_PORTABLE_SESSION);if(!e)return null;let t=yield Qu(e,this.apiKey??"");return t?t.v!==1||t.apiKey!==this.apiKey||!t.user?.userId||!t.res?.token?(this.clearPersistedPortableSession(),null):(this.portableSavedSessionRaw=e,{envelope:t,raw:e}):null}catch(e){return this.loggingService.catch("Error in readPersistedPortableSession: ",e),null}})}clearPersistedPortableSession(){this.portableSavedSessionRaw=null;try{localStorage.removeItem(F.LOCAL_STORAGE.VELT_PORTABLE_SESSION)}catch{}}clearPersistedPortableSessionIfUnchanged(e){try{e&&localStorage.getItem(F.LOCAL_STORAGE.VELT_PORTABLE_SESSION)===e&&this.clearPersistedPortableSession()}catch{}}isPortableTokenNearExpiry(e){let t=ud(e);return t===null||t-Date.now()<=3e4}isPortableRestoreConfigured(){try{let e=this.endpointsService?.getPortableIdentifyUrl?.();return this.configService?.getEnablePortableBackend()===!0&&!!e&&!Nc(e)}catch{return!1}}isRestorablePortableSession(e,t,r){try{if(!this.isPortableRestoreConfigured()||r?.forceReset||e.portableBackendUrl!==(this.configService?.getSelfHostedConfig?.()?.portableBackendUrl??null)||!Bc(e.res?.apiEndpoint)||e.user?.userSnippylyId!==t?.userSnippylyId)return!1;let i=this.user$.value;return i?.userSnippylyId&&i.userSnippylyId!==e.user.userSnippylyId||this.isPortableTokenNearExpiry(e.res.token)?!1:this.shouldHandlePortableBackend(e.res)}catch(i){return this.loggingService.catch("Error in isRestorablePortableSession: ",i),!1}}takePendingPortableRestore(e,t){let r=this.pendingPortableRestore;return this.pendingPortableRestore=null,r?r.epoch!==this.portableSessionEpoch?{envelope:null,overtaken:!0,raw:r.raw}:{envelope:this.isRestorablePortableSession(r.envelope,e,t)?r.envelope:null,overtaken:!1,raw:r.raw}:null}autoLoginPortableSession(){return I(this,null,function*(){let e=this.portableSessionEpoch,t=()=>e!==this.portableSessionEpoch||!this.autoLoginRequired;try{let r=yield this.readPersistedPortableSession(),i=r?.envelope;if(!r||!i||t())return;if(!this.isPortableRestoreConfigured()){this.clearPersistedPortableSession();return}if(i.portableBackendUrl!==(this.configService?.getSelfHostedConfig?.()?.portableBackendUrl??null)){this.loggingService.log("Velt [portable backend]: the persisted session belongs to a different gateway; dropped."),this.clearPersistedPortableSession();return}let o=i;if(this.isPortableTokenNearExpiry(i.res.token)){let s=$c(i.res);On("credential.restore-renew",s?"via=refresh":void 0);let a=s?yield this.requestPortableRefresh(s):yield this.requestIdentify(i.user,void 0,{renewal:!0});if(t())return;if(!this.shouldHandlePortableBackend(a)||!a?.token){if(a?.code==="network_error"){this.loggingService.log("Velt [portable backend]: could not reach the gateway to renew the persisted session; keeping it for the next attempt.");return}if(s&&nN.has(a?.code)&&this.reportPortableRefreshMisconfigured(a),s&&a?.code!==tN){this.loggingService.log(`Velt [portable backend]: the persisted session's renewal was refused for now (${a?.code??"no code"}); keeping it for the next attempt.`);return}this.loggingService.log("Velt [portable backend]: the persisted session could not be renewed on reload; waiting for identify()."),this.clearPersistedPortableSessionIfUnchanged(r.raw);return}let c=$c(a)??s;o=ye($({},i),{res:$({backend:a.backend,wsEndpoint:a.wsEndpoint,apiEndpoint:a.apiEndpoint,token:a.token},c?{refreshToken:c}:{})})}if(t())return;this.pendingPortableRestore={envelope:o,epoch:e,raw:r.raw},this.portableRestoredWithoutAuthToken=!0,yield this.initializeClient($({},o.user),this.buildAutoLoginOptions(),new Date().getTime(),!0,"internal-autoLogin")}catch(r){this.loggingService.catch("Error in autoLoginPortableSession: ",r)}finally{this.pendingPortableRestore=null}})}getPortableBackend(){return this.portableBackend$.value}getFirebaseConfig$(){return this.loggingService.log("%c[WB] Calling FUNCTION: getFirebaseConfig","color: green;"),this.firebaseConfig$.asObservable()}getFirebaseConfig(){return this.loggingService.log("%c[WB] Calling FUNCTION: getFirebaseConfig","color: green;"),this.firebaseConfig$.value}setAdvancedQueries(e){this.loggingService.log("%c[WB] Calling FUNCTION: setAdvancedQueries","color: green;");try{e&&typeof e=="object"&&localStorage.setItem(F.LOCAL_STORAGE.VELT_ADVANCED_QUERIES,JSON.stringify(e)),this.advancedQueries$.next(e)}catch(t){this.loggingService.catch("Error in setAdvancedQueries: ",t)}}getAdvancedQueries$(){return this.loggingService.log("%c[WB] Calling FUNCTION: getAdvancedQueries$","color: green;"),this.advancedQueries$.asObservable()}getAdvancedQueries(){return this.loggingService.log("%c[WB] Calling FUNCTION: getAdvancedQueries","color: green;"),this.advancedQueries$.value}getAdvancedQueriesEnabled(e){try{return!this.configService.getConfig()?.advancedQueriesDisabled&&(e||!!this.getAdvancedQueries()?.advancedQueriesEnabled)}catch(t){return this.loggingService.catch("Error in getAdvancedQueriesEnabled: ",t),!1}}signOutPreviousUser(){return this.signOutPreviousUser$.asObservable()}getUser(){return this.loggingService.log("%c[WB] Calling FUNCTION: getUser","color: green;"),this.afAuth?.currentUser||this.portableAuthUser$.value?this.user$.value:null}getProvidedOrCurrentUserId(){try{return this.providedUser?.userId??this.user$.value?.userId??void 0}catch(e){this.loggingService.catch("Error in getProvidedOrCurrentUserId: ",e);return}}scheduleLoggedInUserResolveRetry(e,t){return I(this,null,function*(){try{if(!e||this.loggedInUserResolveRetryInFlightUserId===e)return;this.loggedInUserResolveRetryInFlightUserId=e;let r=this.loggedInUserResolveRetryDelaysMs;for(let i=0;i<r.length;i++){if(yield new Promise(a=>setTimeout(a,r[i])),(this.providedUser?.userId??this.user$.value?.userId)!==e)return;let o=yield this.usersService?.resolveUsers({userIds:[e],organizationId:t,skipUserCheck:!0,forceResolve:!0,moduleName:hT.IDENTIFY});if((this.providedUser?.userId??this.user$.value?.userId)!==e)return;let s=o?.[e];if(s&&this.applyLateResolvedLoggedInUser(e,s))return}this.loggingService.catch(`User resolver did not return the logged-in user after ${r.length} retry attempts \u2014 comments created by this author will have no resolved profile until the resolver returns them`,{userId:e,organizationId:t,attempts:r.length})}catch(r){this.loggingService.catch("Error in scheduleLoggedInUserResolveRetry: ",r)}finally{this.loggedInUserResolveRetryInFlightUserId===e&&(this.loggedInUserResolveRetryInFlightUserId=null)}})}applyLateResolvedLoggedInUser(e,t){try{let r=this.user$.value;if(!r||r.userId!==e)return!1;if(!this.afAuth?.currentUser)return!0;let i=Xte(r,t);return this.setUserToStorage(i),this.user$.next(i),!0}catch(r){return this.loggingService.catch("Error in applyLateResolvedLoggedInUser: ",r),!1}}combinedAuthBearer$(){let e=!1;return ja([ad(this.afAuth).pipe(Wa(pN)),this.portableAuthUser$]).pipe(pn(([t,r])=>(r!==null&&(e=!0),!!(t!==pN||r!==null||e))),De(([t,r])=>(t===pN?null:t)??r))}getUser$(){return this.loggingService.log("%c[WB] Calling FUNCTION: getUser$","color: green;"),this.combinedAuthBearer$().pipe(br(e=>e?this.user$.asObservable():ct(null)),_o(tp))}getAuthUser(){return this.loggingService.log("%c[WB] Calling FUNCTION: getAuthUser","color: green;"),this.afAuth?.currentUser}getAuthState$(){return this.combinedAuthBearer$()}getIdTokenResultForUser(e,t){return Ip(e,t)}getUserOptions(){return this.loggingService.log("%c[WB] Calling FUNCTION: getUserOptions","color: green;"),this.userOptions$.value}getUserOptions$(){return this.loggingService.log("%c[WB] Calling FUNCTION: getUserOptions$","color: green;"),this.userOptions$.asObservable()}updateUser(e){this.loggingService.log("%c[WB] Calling FUNCTION: updateUser","color: green;");try{let t=this.user$.value;if(e.userId&&e.userId!==t?.userId||e?.groupId&&e?.groupId!==t?.groupId||e?.organizationId&&e?.organizationId!==t?.organizationId)this.providedUser=e,this.initializeClient(e,this.userOptions$?.value||{},new Date().getTime(),void 0,"internal-updateUser");else if(this.providedUser=$($({},this.providedUser),e),t){let r=$($({},t),e);this.updateUserInternally(r)}}catch(t){this.loggingService.catch("Error in updateUser: ",t)}}signInWithCustomToken(e,t,r="manual"){this.loggingService.log("%c[WB] Calling FUNCTION: signInWithCustomToken","color: green;");try{return QB(this.afAuth,t).then(i=>(this.analyticsService.trackEvent(Nt.Events.Core.SDK_USER_AUTH_SUCCESS,{apiKey:this.apiKey,clientUserId:e.userId,snippylyUserId:e.userSnippylyId,authType:r,forceReset:this.userOptions$.value?.forceReset,user:this.getUserWithoutContacts(e)}),i)).catch(i=>(this.analyticsService.trackEvent(Nt.Events.Core.SDK_USER_AUTH_FAILED,{apiKey:this.apiKey,clientUserId:e.userId,snippylyUserId:e.userSnippylyId,authType:r,forceReset:this.userOptions$.value?.forceReset,message:i.message,user:this.getUserWithoutContacts(e)}),i))}catch(i){return this.loggingService.catch("Error in signInWithCustomToken: ",i),Promise.reject(i)}}clearCache(){this.loggingService.log("%c[WB] Calling FUNCTION: clearCache","color: green;");try{this.activityService?.resetActivityFeatureConfig()}catch(e){this.loggingService.catch("Error in clearCache: ",e)}}resetServicesCache(){this.loggingService.log("%c[WB] Calling FUNCTION: resetServicesCache in AuthService","color: green;");try{this.crdtService?.flushAllEditorActivities(),this.clearCache(),this.commonDbService?.unsubscribeFromObservables(),this.activityService?.destroy(),this.docService?.clearCacheOnUserCascade(),this.contactService?.clearCache(),this.iamService?.clearCache(),this.areaService?.clearCache(),this.commentService?.clearCache(),this.reactionService?.clearCache(),this.serviceBook.get(rT)?.clearCache(),this.viewsService?.clearCache()}catch(e){this.loggingService.catch("Error in resetServicesCache: ",e)}}initializeSignedInUser(e,t,r){this.loggingService.log("%c[WB] Calling FUNCTION: initializeSignedInUser","color: green;");try{let i=new $i;i.userSnippylyId=e.uid,i.type="signedIn",r&&(i=$($({},i),r)),this.setUserToStorage(i),this.mergeUserWithProvidedUserData(i,t)}catch(i){this.loggingService.catch("Error in initializeSignedInUser: ",i)}}mergeUserWithProvidedUserData(e,t){return I(this,null,function*(){this.loggingService.log("%c[WB] Calling FUNCTION: mergeUserWithProvidedUserData","color: green;");try{e.userId=this.providedUser?.userId||e.userId;let r=null;if(this.usersService?.externalUserDataProviderAvailable()){let i=Xu(),o=hT.IDENTIFY,s=this.providedUser?.clientOrganizationId||e.clientOrganizationId;this.coreActionsService.triggerAction(Hi.USER_RESOLVER,{event:Nt.Events.Resolver.USER_RESOLUTION_REQUEST_FORMED,timestamp:new Date().getTime(),uniqueId:i,methodName:GD.MERGE_USER_WITH_PROVIDED_USER_DATA,moduleName:o,source:"internal",payload:{userIds:[e.userId],organizationId:s}});let a=yield this.usersService.resolveUsers({userIds:[e.userId],organizationId:s,skipUserCheck:!0,uniqueId:i,moduleName:o});a&&a[e.userId]?r=JSON.parse(JSON.stringify(a[e.userId]||{})):this.scheduleLoggedInUserResolveRetry(e.userId,s),e=$($({},e),r||{})}e.name=r?r?.name:this.providedUser?.name||e.name,e.clientUserName=r?r?.clientUserName:this.providedUser?.clientUserName||e.clientUserName,e.photoUrl=r?r?.photoUrl:this.providedUser?.photoUrl||e.photoUrl,e?.photoUrl===void 0&&(e.photoUrl=null),e.email=r?r?.email:this.providedUser?.email||e.email,e.color=r?.color||this.providedUser?.color||this.getUserAvatarColor(e.userId),e.textColor=r?.textColor||this.providedUser?.textColor||this.getUserTextColor(e.userId),e.initial=r?.initial||this.providedUser?.initial||e.initial||e.name?.charAt(0).toUpperCase()||e.email?.charAt(0).toUpperCase(),e.contacts=this.providedUser?.contacts||e.contacts,e.plan=this.providedUser?.plan||e.plan,e.groupId=this.providedUser?.groupId||e.groupId,e.clientGroupId=this.providedUser?.clientGroupId||e.clientGroupId,e.clientOrganizationId=this.providedUser?.clientOrganizationId||e.clientOrganizationId,e.organizationId=this.providedUser?.organizationId||e.organizationId,e.isAdmin=this.providedUser?.isAdmin,e.isReadOnly=this.providedUser?.isReadOnly,e.isAnonymous=this.providedUser?.isAnonymous,e.isGuest=this.providedUser?.isGuest,this.updateUserInternally(e)}catch(r){this.loggingService.catch("Error in mergeUserWithProvidedUserData: ",r)}})}updateUserInternally(e){return I(this,null,function*(){this.loggingService.log("%c[WB] Calling FUNCTION: updateUserInternally","color: green;");try{let t=Object.assign({},e);delete t.contacts,this.analyticsService.identifyUser(e.userSnippylyId,t,{forceReset:this.userOptions$.value?.forceReset}),this.getPlanDetailsCalled||this.getPlanDetailsFromDb();let r=ld(this.functions,ed({url:this.endpointsService.getCloudFunctionUrl("sdkProxy"),apiProxyDomain:this.configService?.getApiProxyDomain()})),i=CV({methodName:"updateUserInternally",data:{type:"getProjectConfig"},getSdkProxy:r,userId:e?.userId??""}),o=Promise.resolve();if(this.userPermissionService?.isPermissionProviderAvailable()&&e.clientOrganizationId){let c=[{userId:e.userId,resource:{id:e.clientOrganizationId,type:_U.ORGANIZATION,source:fT.IDENTIFY,organizationId:e.clientOrganizationId}}],l=Xu();this.coreActionsService.triggerAction(Hi.PERMISSION_PROVIDER,{event:Nt.Events.PermissionProvider.RESOURCE_ACCESS_REQUEST_FORMED,methodName:fT.IDENTIFY,uniqueId:l,timestamp:new Date().getTime(),source:"internal",payload:{requests:c}}),o=this.userPermissionService?.onResourceAccessRequired({requests:c,uniqueId:l,userId:e.userId,methodName:fT.IDENTIFY,fromCache:!1})??Promise.resolve()}let[s,a]=yield Promise.allSettled([i,o]);if(s.status==="fulfilled"){this.setIsPrivateCommentsEnabled(!!s.value?.data?.isPrivateCommentsEnabled);let c=s.value?.data?.activityConfig??{immutable:!1,isEnabled:!1};this.cachedActivityConfig=c,this.activityService?.setActivityFeatureConfig(c)}else this.loggingService.warn("Failed to fetch project config:",s.reason);this.afAuth.currentUser?(this.user$.next(e),this.updateUserToFirebase(e)):this.portableAuthUser$.value&&this.user$.next(e)}catch(t){this.loggingService.catch("Error in updateUserInternally: ",t)}})}updateUserToFirebase(e){this.loggingService.log("%c[WB] Calling FUNCTION: updateUserToFirebase","color: green;");try{let t=JSON.parse(JSON.stringify(e)),r=ye($({},t),{lastUpdated:new Date})}catch(t){this.loggingService.catch("Error in updateUserToFirebase: ",t)}}getPlanDetailsFromDb(){return I(this,null,function*(){try{this.getPlanDetailsCalled=!0;let t=yield ld(this.functions,ed({url:this.endpointsService.getCloudFunctionUrl("getPlanDetails"),apiProxyDomain:this.configService?.getApiProxyDomain()}),{timeout:1200*1e3})({apiKey:this.configService.getApiKey(),sdkVersion:wc(),sdkType:this.configService.getSdkType()});return t?.data?.isPlanExpired&&(this.analyticsService.trackEvent(Nt.Events.Core.SDK_PLAN_EXPIRED),this.configService.getSF()||console.warn("Velt SDK plan has expired.")),this.planDetails$.next(t?.data||{planInfo:null,isPlanExpired:!1}),t}catch(e){return this.loggingService.catch("Error in getPlanDetailsFromDb: ",e),this.planDetails$.next({planInfo:null,isPlanExpired:!1}),Promise.resolve(null)}})}isPlanExpired$(){return this.planDetails$.pipe(pn(e=>!!e),De(e=>!!e?.isPlanExpired))}isPlanExpired(){return this.planDetails$.getValue()?.isPlanExpired}addPreSignOutFuction(e,t){try{this.preSignOutFunctions.set(e,t)}catch(r){this.loggingService.catch("Error in addPreSignOutFuction: ",r)}}setUserOrganization(e){try{this.loggingService.log("%c[WB] Calling FUNCTION: setUserOrganization","color: green;");let t=JSON.parse(JSON.stringify(this.userOrganization$.value||{}));this.getUser()?.organizationId===e?.organizationId?(t.metadata=e,this.userOrganization$.next(t)):this.userOrganization$.next(null)}catch(t){this.loggingService.catch("Error in setUserOrganization: ",t)}}setOrganizationUserGroups(e){try{this.loggingService.log("%c[WB] Calling FUNCTION: setUserOrganizationGroups","color: green;");let t=JSON.parse(JSON.stringify(this.userOrganization$.value||{}));this.getUser()?.organizationId===t?.metadata?.organizationId&&(t.groups=e,this.userOrganization$.next(t))}catch(t){this.loggingService.catch("Error in setUserOrganizationGroups: ",t)}}getUserOrganization$(){return this.loggingService.log("%c[WB] Calling FUNCTION: getUserOrganization$","color: green;"),this.getUser$().pipe(br(e=>e?this.userOrganization$.asObservable().pipe(De(t=>t?.metadata?.organizationId===e.organizationId?t:null)):ct(null)))}signOutUser(e="internal"){return I(this,null,function*(){try{this.userPermissionService?.invalidateAllPermissionsState(),this.portableSessionEpoch++,this.portableSignOutOwnsEpochBump=!0,this.pendingPortableRestore=null,this.portableSessionIdentity=null,(this.portableAutoLoginCalled||this.configService?.getEnablePortableBackend()===!0)&&(this.clearPersistedPortableSession(),this.recordPortableSignOut()),e==="external"&&(this.onRetrySubscription?.unsubscribe(),this.authProviderListenerGeneration++),this.userPermissionService?.revokeAccessOnUserLogout(),this.analyticsService.trackEvent(Nt.Events.Core.SDK_USER_SIGN_OUT,{apiKey:this.apiKey,clientUserId:this.user$?.value?.userId,snippylyUserId:this.user$?.value?.userSnippylyId,message:e==="external"?"User Sign out":"System Sign out",user:this.user$?.value?this.getUserWithoutContacts(this.user$?.value):null,forceReset:this.userOptions$.value?.forceReset,source:e});let t=yield ad(this.afAuth).pipe(gn(1)).toPromise().catch(r=>null);if(t){this.resetServicesCache(),this.user$.next(null),this.clearPortableBackendState();for(let[r,i]of this.preSignOutFunctions)try{yield i(t)}catch(o){this.loggingService.catch(`Error in signOutUser ${r} function: `,o)}return this.user$.next(null),yield _V(1e3),JB(this.afAuth).catch(r=>{this.loggingService.catch("Error in signOutUser:",r)})}else return(this.portableAuthUser$.value||this.portableBackend$.value)&&(this.resetServicesCache(),this.user$.next(null),this.clearPortableBackendState()),Promise.resolve()}catch(t){this.loggingService.catch("Error in signOutUser: ",t)}finally{this.portableSignOutOwnsEpochBump=!1}})}isFeatureAllowed(e){return lV(this.config,this.user$.value,e)}getUserWithoutContacts(e){try{if(e){let t=JSON.parse(JSON.stringify(e));return delete t.contacts,t}else return null}catch(t){return this.loggingService.catch("Error in getUserWithoutContacts: ",t),null}}getUserForClient(e){try{return YD(e)}catch(t){return this.loggingService.catch("Error in getUserForClient: ",t),null}}getUserAvatarColor(e){try{return e?this.avatarService.generateUserColor(Dc(e)):"#625DF5"}catch{return"#625DF5"}}getUserTextColor(e){try{return"#FFFFFF"}catch{return"#FFFFFF"}}setOptionalPropertiesToUsers(e){try{e.forEach(t=>{try{t?.color||(t.color=this.getUserAvatarColor(t?.userId)),t?.textColor||(t.textColor=this.getUserTextColor(t?.userId)),!t?.initial&&(t?.name||t?.email)&&(t.initial=t.name?.charAt(0).toUpperCase()||t.email?.charAt(0).toUpperCase())}catch{}})}catch{}}};Ot.PORTABLE_MAX_REFRESH_FAILURES=3,Ot.PORTABLE_DOCUMENT_LIFECYCLE_EVENTS=["visibilitychange","resume"],Ot.PORTABLE_TOKEN_EXPIRED_REASK_MS=6e4,Ot.PORTABLE_TOKEN_EXPIRED_REASON="customer token expired",Ot.PORTABLE_RESTORE_RENEW_FINAL_CODES=new Set(["missing_jwt_token","unauthenticated","permission-denied"]),Ot.\u0275fac=function(t){return new(t||Ot)(H(Fc),H(Xi),H(wG),H(bG),H(JG),H(Vo),H(Vs),H(wt),H(aT))},Ot.\u0275prov=Q({token:Ot,factory:Ot.\u0275fac,providedIn:"root"});var js=Ot;var t2="@firebase/database",n2="1.0.20";var Iw="";function Qte(n){Iw=n}var vN=class{constructor(e){this.domStorage_=e,this.prefix_="firebase:"}set(e,t){t==null?this.domStorage_.removeItem(this.prefixedName_(e)):this.domStorage_.setItem(this.prefixedName_(e),xt(t))}get(e){let t=this.domStorage_.getItem(this.prefixedName_(e));return t==null?null:nd(t)}remove(e){this.domStorage_.removeItem(this.prefixedName_(e))}prefixedName_(e){return this.prefix_+e}toString(){return this.domStorage_.toString()}};var SN=class{constructor(){this.cache_={},this.isInMemoryStorage=!0}set(e,t){t==null?delete this.cache_[e]:this.cache_[e]=t}get(e){return Fr(this.cache_,e)?this.cache_[e]:null}remove(e){delete this.cache_[e]}};var P2=function(n){try{if(typeof window<"u"&&typeof window[n]<"u"){let e=window[n];return e.setItem("firebase:sentinel","cache"),e.removeItem("firebase:sentinel"),new vN(e)}}catch{}return new SN},zc=P2("localStorage"),AN=P2("sessionStorage");var md=new Ur("@firebase/database"),x2=(function(){let n=1;return function(){return n++}})(),k2=function(n){let e=$V(n),t=new TT;t.update(e);let r=t.digest();return rd.encodeByteArray(r)},qp=function(...n){let e="";for(let t=0;t<n.length;t++){let r=n[t];Array.isArray(r)||r&&typeof r=="object"&&typeof r.length=="number"?e+=qp.apply(null,r):typeof r=="object"?e+=xt(r):e+=r,e+=" "}return e},qc=null,r2=!0,Jte=function(n,e){q(!e||n===!0||n===!1,"Can't turn on custom loggers persistently."),n===!0?(md.logLevel=Re.VERBOSE,qc=md.log.bind(md),e&&AN.set("logging_enabled",!0)):typeof n=="function"?qc=n:(qc=null,AN.remove("logging_enabled"))},cn=function(...n){if(r2===!0&&(r2=!1,qc===null&&AN.get("logging_enabled")===!0&&Jte(!0)),qc){let e=qp.apply(null,n);qc(e)}},Kp=function(n){return function(...e){cn(n,...e)}},CN=function(...n){let e="FIREBASE INTERNAL ERROR: "+qp(...n);md.error(e)},Go=function(...n){let e=`FIREBASE FATAL ERROR: ${qp(...n)}`;throw md.error(e),new Error(e)},Ln=function(...n){let e="FIREBASE WARNING: "+qp(...n);md.warn(e)},Zte=function(){typeof window<"u"&&window.location&&window.location.protocol&&window.location.protocol.indexOf("https:")!==-1&&Ln("Insecure Firebase access from a secure page. Please use https in calls to new Firebase().")},CI=function(n){return typeof n=="number"&&(n!==n||n===Number.POSITIVE_INFINITY||n===Number.NEGATIVE_INFINITY)},ene=function(n){if(zi()||document.readyState==="complete")n();else{let e=!1,t=function(){if(!document.body){setTimeout(t,Math.floor(10));return}e||(e=!0,n())};document.addEventListener?(document.addEventListener("DOMContentLoaded",t,!1),window.addEventListener("load",t,!1)):document.attachEvent&&(document.attachEvent("onreadystatechange",()=>{document.readyState==="complete"&&t()}),window.attachEvent("onload",t))}},Yc="[MIN_NAME]",qs="[MAX_NAME]",tl=function(n,e){if(n===e)return 0;if(n===Yc||e===qs)return-1;if(e===Yc||n===qs)return 1;{let t=i2(n),r=i2(e);return t!==null?r!==null?t-r===0?n.length-e.length:t-r:-1:r!==null?1:n<e?-1:1}},tne=function(n,e){return n===e?0:n<e?-1:1},Dp=function(n,e){if(e&&n in e)return e[n];throw new Error("Missing required key ("+n+") in object: "+xt(e))},yw=function(n){if(typeof n!="object"||n===null)return xt(n);let e=[];for(let r in n)e.push(r);e.sort();let t="{";for(let r=0;r<e.length;r++)r!==0&&(t+=","),t+=xt(e[r]),t+=":",t+=yw(n[e[r]]);return t+="}",t},F2=function(n,e){let t=n.length;if(t<=e)return[n];let r=[];for(let i=0;i<t;i+=e)i+e>t?r.push(n.substring(i,t)):r.push(n.substring(i,i+e));return r};function ln(n,e){for(let t in n)n.hasOwnProperty(t)&&e(t,n[t])}var U2=function(n){q(!CI(n),"Invalid JSON number");let e=11,t=52,r=(1<<e-1)-1,i,o,s,a,c;n===0?(o=0,s=0,i=1/n===-1/0?1:0):(i=n<0,n=Math.abs(n),n>=Math.pow(2,1-r)?(a=Math.min(Math.floor(Math.log(n)/Math.LN2),r),o=a+r,s=Math.round(n*Math.pow(2,t-a)-Math.pow(2,t))):(o=0,s=Math.round(n/Math.pow(2,1-r-t))));let l=[];for(c=t;c;c-=1)l.push(s%2?1:0),s=Math.floor(s/2);for(c=e;c;c-=1)l.push(o%2?1:0),o=Math.floor(o/2);l.push(i?1:0),l.reverse();let d=l.join(""),h="";for(c=0;c<64;c+=8){let f=parseInt(d.substr(c,8),2).toString(16);f.length===1&&(f="0"+f),h=h+f}return h.toLowerCase()},nne=function(){return!!(typeof window=="object"&&window.chrome&&window.chrome.extension&&!/^chrome/.test(window.location.href))},rne=function(){return typeof Windows=="object"&&typeof Windows.UI=="object"};function ine(n,e){let t="Unknown Error";n==="too_big"?t="The data requested exceeds the maximum size that can be accessed with a single request.":n==="permission_denied"?t="Client doesn't have permission to access the desired data.":n==="unavailable"&&(t="The service is unavailable");let r=new Error(n+" at "+e._path.toString()+": "+t);return r.code=n.toUpperCase(),r}var one=new RegExp("^-?(0*)\\d{1,10}$"),sne=-2147483648,ane=2147483647,i2=function(n){if(one.test(n)){let e=Number(n);if(e>=sne&&e<=ane)return e}return null},Cd=function(n){try{n()}catch(e){setTimeout(()=>{let t=e.stack||"";throw Ln("Exception was thrown by user callback.",t),e},Math.floor(0))}},cne=function(){return(typeof window=="object"&&window.navigator&&window.navigator.userAgent||"").search(/googlebot|google webmaster tools|bingbot|yahoo! slurp|baiduspider|yandexbot|duckduckbot/i)>=0},bp=function(n,e){let t=setTimeout(n,e);return typeof t=="number"&&typeof Deno<"u"&&Deno.unrefTimer?Deno.unrefTimer(t):typeof t=="object"&&t.unref&&t.unref(),t};var DN=class{constructor(e,t){this.appCheckProvider=t,this.appName=e.name,Qn(e)&&e.settings.appCheckToken&&(this.serverAppAppCheckToken=e.settings.appCheckToken),this.appCheck=t?.getImmediate({optional:!0}),this.appCheck||t?.get().then(r=>this.appCheck=r)}getToken(e){if(this.serverAppAppCheckToken){if(e)throw new Error("Attempted reuse of `FirebaseServerApp.appCheckToken` after previous usage failed.");return Promise.resolve({token:this.serverAppAppCheckToken})}return this.appCheck?this.appCheck.getToken(e):new Promise((t,r)=>{setTimeout(()=>{this.appCheck?this.getToken(e).then(t,r):t(null)},0)})}addTokenChangeListener(e){var t;(t=this.appCheckProvider)===null||t===void 0||t.get().then(r=>r.addTokenListener(e))}notifyForInvalidToken(){Ln(`Provided AppCheck credentials for the app named "${this.appName}" are invalid. This usually indicates your app was not initialized correctly.`)}};var RN=class{constructor(e,t,r){this.appName_=e,this.firebaseOptions_=t,this.authProvider_=r,this.auth_=null,this.auth_=r.getImmediate({optional:!0}),this.auth_||r.onInit(i=>this.auth_=i)}getToken(e){return this.auth_?this.auth_.getToken(e).catch(t=>t&&t.code==="auth/token-not-initialized"?(cn("Got auth/token-not-initialized error. Treating as null token."),null):Promise.reject(t)):new Promise((t,r)=>{setTimeout(()=>{this.auth_?this.getToken(e).then(t,r):t(null)},0)})}addTokenChangeListener(e){this.auth_?this.auth_.addAuthTokenListener(e):this.authProvider_.get().then(t=>t.addAuthTokenListener(e))}removeTokenChangeListener(e){this.authProvider_.get().then(t=>t.removeAuthTokenListener(e))}notifyForInvalidToken(){let e='Provided authentication credentials for the app named "'+this.appName_+'" are invalid. This usually indicates your app was not initialized correctly. ';"credential"in this.firebaseOptions_?e+='Make sure the "credential" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':"serviceAccount"in this.firebaseOptions_?e+='Make sure the "serviceAccount" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':e+='Make sure the "apiKey" and "databaseURL" properties provided to initializeApp() match the values provided for your app at https://console.firebase.google.com/.',Ln(e)}},Op=(()=>{class n{constructor(t){this.accessToken=t}getToken(t){return Promise.resolve({accessToken:this.accessToken})}addTokenChangeListener(t){t(this.accessToken)}removeTokenChangeListener(t){}notifyForInvalidToken(){}}n.OWNER="owner";return n})(),eI="5",V2="v",B2="s",G2="r",j2="f",H2=/(console\.firebase|firebase-console-\w+\.corp|firebase\.corp)\.google\.com/,$2="ls",W2="p",NN="ac",z2="websocket",q2="long_polling";var tI=class{constructor(e,t,r,i,o=!1,s="",a=!1,c=!1,l=null){this.secure=t,this.namespace=r,this.webSocketOnly=i,this.nodeAdmin=o,this.persistenceKey=s,this.includeNamespaceInQueryParams=a,this.isUsingEmulator=c,this.emulatorOptions=l,this._host=e.toLowerCase(),this._domain=this._host.substr(this._host.indexOf(".")+1),this.internalHost=zc.get("host:"+e)||this._host}isCacheableHost(){return this.internalHost.substr(0,2)==="s-"}isCustomHost(){return this._domain!=="firebaseio.com"&&this._domain!=="firebaseio-demo.com"}get host(){return this._host}set host(e){e!==this.internalHost&&(this.internalHost=e,this.isCacheableHost()&&zc.set("host:"+this._host,this.internalHost))}toString(){let e=this.toURLString();return this.persistenceKey&&(e+="<"+this.persistenceKey+">"),e}toURLString(){let e=this.secure?"https://":"http://",t=this.includeNamespaceInQueryParams?`?ns=${this.namespace}`:"";return`${e}${this.host}/${t}`}};function lne(n){return n.host!==n.internalHost||n.isCustomHost()||n.includeNamespaceInQueryParams}function K2(n,e,t){q(typeof e=="string","typeof type must == string"),q(typeof t=="object","typeof params must == object");let r;if(e===z2)r=(n.secure?"wss://":"ws://")+n.internalHost+"/.ws?";else if(e===q2)r=(n.secure?"https://":"http://")+n.internalHost+"/.lp?";else throw new Error("Unknown connection type: "+e);lne(n)&&(t.ns=n.namespace);let i=[];return ln(t,(o,s)=>{i.push(o+"="+s)}),r+i.join("&")}var wN=class{constructor(){this.counters_={}}incrementCounter(e,t=1){Fr(this.counters_,e)||(this.counters_[e]=0),this.counters_[e]+=t}get(){return OV(this.counters_)}};var gN={},mN={};function vw(n){let e=n.toString();return gN[e]||(gN[e]=new wN),gN[e]}function une(n,e){let t=n.toString();return mN[t]||(mN[t]=e()),mN[t]}var bN=class{constructor(e){this.onMessage_=e,this.pendingResponses=[],this.currentResponseNum=0,this.closeAfterResponse=-1,this.onClose=null}closeAfter(e,t){this.closeAfterResponse=e,this.onClose=t,this.closeAfterResponse<this.currentResponseNum&&(this.onClose(),this.onClose=null)}handleResponse(e,t){for(this.pendingResponses[e]=t;this.pendingResponses[this.currentResponseNum];){let r=this.pendingResponses[this.currentResponseNum];delete this.pendingResponses[this.currentResponseNum];for(let i=0;i<r.length;++i)r[i]&&Cd(()=>{this.onMessage_(r[i])});if(this.currentResponseNum===this.closeAfterResponse){this.onClose&&(this.onClose(),this.onClose=null);break}this.currentResponseNum++}}};var o2="start",dne="close",hne="pLPCommand",fne="pRTLPCB",Y2="id",X2="pw",Q2="ser",pne="cb",gne="seg",mne="ts",Ene="d",_ne="dframe",J2=1870,Z2=30,Tne=J2-Z2,Ine=25e3,yne=3e4,nI=class n{constructor(e,t,r,i,o,s,a){this.connId=e,this.repoInfo=t,this.applicationId=r,this.appCheckToken=i,this.authToken=o,this.transportSessionId=s,this.lastSessionId=a,this.bytesSent=0,this.bytesReceived=0,this.everConnected_=!1,this.log_=Kp(e),this.stats_=vw(t),this.urlFn=c=>(this.appCheckToken&&(c[NN]=this.appCheckToken),K2(t,q2,c))}open(e,t){this.curSegmentNum=0,this.onDisconnect_=t,this.myPacketOrderer=new bN(e),this.isClosed_=!1,this.connectTimeoutTimer_=setTimeout(()=>{this.log_("Timed out trying to connect."),this.onClosed_(),this.connectTimeoutTimer_=null},Math.floor(yne)),ene(()=>{if(this.isClosed_)return;this.scriptTagHolder=new ON((...o)=>{let[s,a,c,l,d]=o;if(this.incrementIncomingBytes_(o),!!this.scriptTagHolder)if(this.connectTimeoutTimer_&&(clearTimeout(this.connectTimeoutTimer_),this.connectTimeoutTimer_=null),this.everConnected_=!0,s===o2)this.id=a,this.password=c;else if(s===dne)a?(this.scriptTagHolder.sendNewPolls=!1,this.myPacketOrderer.closeAfter(a,()=>{this.onClosed_()})):this.onClosed_();else throw new Error("Unrecognized command received: "+s)},(...o)=>{let[s,a]=o;this.incrementIncomingBytes_(o),this.myPacketOrderer.handleResponse(s,a)},()=>{this.onClosed_()},this.urlFn);let r={};r[o2]="t",r[Q2]=Math.floor(Math.random()*1e8),this.scriptTagHolder.uniqueCallbackIdentifier&&(r[pne]=this.scriptTagHolder.uniqueCallbackIdentifier),r[V2]=eI,this.transportSessionId&&(r[B2]=this.transportSessionId),this.lastSessionId&&(r[$2]=this.lastSessionId),this.applicationId&&(r[W2]=this.applicationId),this.appCheckToken&&(r[NN]=this.appCheckToken),typeof location<"u"&&location.hostname&&H2.test(location.hostname)&&(r[G2]=j2);let i=this.urlFn(r);this.log_("Connecting via long-poll to "+i),this.scriptTagHolder.addTag(i,()=>{})})}start(){this.scriptTagHolder.startLongPoll(this.id,this.password),this.addDisconnectPingFrame(this.id,this.password)}static forceAllow(){n.forceAllow_=!0}static forceDisallow(){n.forceDisallow_=!0}static isAvailable(){return zi()?!1:n.forceAllow_?!0:!n.forceDisallow_&&typeof document<"u"&&document.createElement!=null&&!nne()&&!rne()}markConnectionHealthy(){}shutdown_(){this.isClosed_=!0,this.scriptTagHolder&&(this.scriptTagHolder.close(),this.scriptTagHolder=null),this.myDisconnFrame&&(document.body.removeChild(this.myDisconnFrame),this.myDisconnFrame=null),this.connectTimeoutTimer_&&(clearTimeout(this.connectTimeoutTimer_),this.connectTimeoutTimer_=null)}onClosed_(){this.isClosed_||(this.log_("Longpoll is closing itself"),this.shutdown_(),this.onDisconnect_&&(this.onDisconnect_(this.everConnected_),this.onDisconnect_=null))}close(){this.isClosed_||(this.log_("Longpoll is being closed."),this.shutdown_())}send(e){let t=xt(e);this.bytesSent+=t.length,this.stats_.incrementCounter("bytes_sent",t.length);let r=eR(t),i=F2(r,Tne);for(let o=0;o<i.length;o++)this.scriptTagHolder.enqueueSegment(this.curSegmentNum,i.length,i[o]),this.curSegmentNum++}addDisconnectPingFrame(e,t){if(zi())return;this.myDisconnFrame=document.createElement("iframe");let r={};r[_ne]="t",r[Y2]=e,r[X2]=t,this.myDisconnFrame.src=this.urlFn(r),this.myDisconnFrame.style.display="none",document.body.appendChild(this.myDisconnFrame)}incrementIncomingBytes_(e){let t=xt(e).length;this.bytesReceived+=t,this.stats_.incrementCounter("bytes_received",t)}},ON=class n{constructor(e,t,r,i){if(this.onDisconnect=r,this.urlFn=i,this.outstandingRequests=new Set,this.pendingSegs=[],this.currentSerial=Math.floor(Math.random()*1e8),this.sendNewPolls=!0,zi())this.commandCB=e,this.onMessageCB=t;else{this.uniqueCallbackIdentifier=x2(),window[hne+this.uniqueCallbackIdentifier]=e,window[fne+this.uniqueCallbackIdentifier]=t,this.myIFrame=n.createIFrame_();let o="";this.myIFrame.src&&this.myIFrame.src.substr(0,11)==="javascript:"&&(o='<script>document.domain="'+document.domain+'";<\/script>');let s="<html><body>"+o+"</body></html>";try{this.myIFrame.doc.open(),this.myIFrame.doc.write(s),this.myIFrame.doc.close()}catch(a){cn("frame writing exception"),a.stack&&cn(a.stack),cn(a)}}}static createIFrame_(){let e=document.createElement("iframe");if(e.style.display="none",document.body){document.body.appendChild(e);try{e.contentWindow.document||cn("No IE domain setting required")}catch{let r=document.domain;e.src="javascript:void((function(){document.open();document.domain='"+r+"';document.close();})())"}}else throw"Document body has not initialized. Wait to initialize Firebase until after the document is ready.";return e.contentDocument?e.doc=e.contentDocument:e.contentWindow?e.doc=e.contentWindow.document:e.document&&(e.doc=e.document),e}close(){this.alive=!1,this.myIFrame&&(this.myIFrame.doc.body.textContent="",setTimeout(()=>{this.myIFrame!==null&&(document.body.removeChild(this.myIFrame),this.myIFrame=null)},Math.floor(0)));let e=this.onDisconnect;e&&(this.onDisconnect=null,e())}startLongPoll(e,t){for(this.myID=e,this.myPW=t,this.alive=!0;this.newRequest_(););}newRequest_(){if(this.alive&&this.sendNewPolls&&this.outstandingRequests.size<(this.pendingSegs.length>0?2:1)){this.currentSerial++;let e={};e[Y2]=this.myID,e[X2]=this.myPW,e[Q2]=this.currentSerial;let t=this.urlFn(e),r="",i=0;for(;this.pendingSegs.length>0&&this.pendingSegs[0].d.length+Z2+r.length<=J2;){let s=this.pendingSegs.shift();r=r+"&"+gne+i+"="+s.seg+"&"+mne+i+"="+s.ts+"&"+Ene+i+"="+s.d,i++}return t=t+r,this.addLongPollTag_(t,this.currentSerial),!0}else return!1}enqueueSegment(e,t,r){this.pendingSegs.push({seg:e,ts:t,d:r}),this.alive&&this.newRequest_()}addLongPollTag_(e,t){this.outstandingRequests.add(t);let r=()=>{this.outstandingRequests.delete(t),this.newRequest_()},i=setTimeout(r,Math.floor(Ine)),o=()=>{clearTimeout(i),r()};this.addTag(e,o)}addTag(e,t){zi()?this.doNodeLongPoll(e,t):setTimeout(()=>{try{if(!this.sendNewPolls)return;let r=this.myIFrame.doc.createElement("script");r.type="text/javascript",r.async=!0,r.src=e,r.onload=r.onreadystatechange=function(){let i=r.readyState;(!i||i==="loaded"||i==="complete")&&(r.onload=r.onreadystatechange=null,r.parentNode&&r.parentNode.removeChild(r),t())},r.onerror=()=>{cn("Long-poll script failed to load: "+e),this.sendNewPolls=!1,this.close()},this.myIFrame.doc.body.appendChild(r)}catch{}},Math.floor(1))}};var vne=16384,Sne=45e3,rI=null;typeof MozWebSocket<"u"?rI=MozWebSocket:typeof WebSocket<"u"&&(rI=WebSocket);var pd=(()=>{class n{constructor(t,r,i,o,s,a,c){this.connId=t,this.applicationId=i,this.appCheckToken=o,this.authToken=s,this.keepaliveTimer=null,this.frames=null,this.totalFrames=0,this.bytesSent=0,this.bytesReceived=0,this.log_=Kp(this.connId),this.stats_=vw(r),this.connURL=n.connectionURL_(r,a,c,o,i),this.nodeAdmin=r.nodeAdmin}static connectionURL_(t,r,i,o,s){let a={};return a[V2]=eI,!zi()&&typeof location<"u"&&location.hostname&&H2.test(location.hostname)&&(a[G2]=j2),r&&(a[B2]=r),i&&(a[$2]=i),o&&(a[NN]=o),s&&(a[W2]=s),K2(t,z2,a)}open(t,r){this.onDisconnect=r,this.onMessage=t,this.log_("Websocket connecting to "+this.connURL),this.everConnected_=!1,zc.set("previous_websocket_failure",!0);try{let i;if(zi()){let o=this.nodeAdmin?"AdminNode":"Node";i={headers:{"User-Agent":`Firebase/${eI}/${Iw}/${process.platform}/${o}`,"X-Firebase-GMPID":this.applicationId||""}},this.authToken&&(i.headers.Authorization=`Bearer ${this.authToken}`),this.appCheckToken&&(i.headers["X-Firebase-AppCheck"]=this.appCheckToken);let s=process.env,a=this.connURL.indexOf("wss://")===0?s.HTTPS_PROXY||s.https_proxy:s.HTTP_PROXY||s.http_proxy;a&&(i.proxy={origin:a})}this.mySock=new rI(this.connURL,[],i)}catch(i){this.log_("Error instantiating WebSocket.");let o=i.message||i.data;o&&this.log_(o),this.onClosed_();return}this.mySock.onopen=()=>{this.log_("Websocket connected."),this.everConnected_=!0},this.mySock.onclose=()=>{this.log_("Websocket connection was disconnected."),this.mySock=null,this.onClosed_()},this.mySock.onmessage=i=>{this.handleIncomingFrame(i)},this.mySock.onerror=i=>{this.log_("WebSocket error. Closing connection.");let o=i.message||i.data;o&&this.log_(o),this.onClosed_()}}start(){}static forceDisallow(){n.forceDisallow_=!0}static isAvailable(){let t=!1;if(typeof navigator<"u"&&navigator.userAgent){let r=/Android ([0-9]{0,}\.[0-9]{0,})/,i=navigator.userAgent.match(r);i&&i.length>1&&parseFloat(i[1])<4.4&&(t=!0)}return!t&&rI!==null&&!n.forceDisallow_}static previouslyFailed(){return zc.isInMemoryStorage||zc.get("previous_websocket_failure")===!0}markConnectionHealthy(){zc.remove("previous_websocket_failure")}appendFrame_(t){if(this.frames.push(t),this.frames.length===this.totalFrames){let r=this.frames.join("");this.frames=null;let i=nd(r);this.onMessage(i)}}handleNewFrameCount_(t){this.totalFrames=t,this.frames=[]}extractFrameCount_(t){if(q(this.frames===null,"We already have a frame buffer"),t.length<=6){let r=Number(t);if(!isNaN(r))return this.handleNewFrameCount_(r),null}return this.handleNewFrameCount_(1),t}handleIncomingFrame(t){if(this.mySock===null)return;let r=t.data;if(this.bytesReceived+=r.length,this.stats_.incrementCounter("bytes_received",r.length),this.resetKeepAlive(),this.frames!==null)this.appendFrame_(r);else{let i=this.extractFrameCount_(r);i!==null&&this.appendFrame_(i)}}send(t){this.resetKeepAlive();let r=xt(t);this.bytesSent+=r.length,this.stats_.incrementCounter("bytes_sent",r.length);let i=F2(r,vne);i.length>1&&this.sendString_(String(i.length));for(let o=0;o<i.length;o++)this.sendString_(i[o])}shutdown_(){this.isClosed_=!0,this.keepaliveTimer&&(clearInterval(this.keepaliveTimer),this.keepaliveTimer=null),this.mySock&&(this.mySock.close(),this.mySock=null)}onClosed_(){this.isClosed_||(this.log_("WebSocket is closing itself"),this.shutdown_(),this.onDisconnect&&(this.onDisconnect(this.everConnected_),this.onDisconnect=null))}close(){this.isClosed_||(this.log_("WebSocket is being closed"),this.shutdown_())}resetKeepAlive(){clearInterval(this.keepaliveTimer),this.keepaliveTimer=setInterval(()=>{this.mySock&&this.sendString_("0"),this.resetKeepAlive()},Math.floor(Sne))}sendString_(t){try{this.mySock.send(t)}catch(r){this.log_("Exception thrown from WebSocket.send():",r.message||r.data,"Closing connection."),setTimeout(this.onClosed_.bind(this),0)}}}n.responsesRequiredToBeHealthy=2,n.healthyTimeout=3e4;return n})(),ej=(()=>{class n{static get ALL_TRANSPORTS(){return[nI,pd]}static get IS_TRANSPORT_INITIALIZED(){return this.globalTransportInitialized_}constructor(t){this.initTransports_(t)}initTransports_(t){let r=pd&&pd.isAvailable(),i=r&&!pd.previouslyFailed();if(t.webSocketOnly&&(r||Ln("wss:// URL used, but browser isn't known to support websockets. Trying anyway."),i=!0),i)this.transports_=[pd];else{let o=this.transports_=[];for(let s of n.ALL_TRANSPORTS)s&&s.isAvailable()&&o.push(s);n.globalTransportInitialized_=!0}}initialTransport(){if(this.transports_.length>0)return this.transports_[0];throw new Error("No transports available")}upgradeTransport(){return this.transports_.length>1?this.transports_[1]:null}}n.globalTransportInitialized_=!1;return n})(),Ane=6e4,Cne=5e3,Dne=10*1024,Rne=100*1024,EN="t",s2="d",Nne="s",a2="r",wne="e",c2="o",l2="a",u2="n",d2="p",bne="h",MN=class{constructor(e,t,r,i,o,s,a,c,l,d){this.id=e,this.repoInfo_=t,this.applicationId_=r,this.appCheckToken_=i,this.authToken_=o,this.onMessage_=s,this.onReady_=a,this.onDisconnect_=c,this.onKill_=l,this.lastSessionId=d,this.connectionCount=0,this.pendingDataMessages=[],this.state_=0,this.log_=Kp("c:"+this.id+":"),this.transportManager_=new ej(t),this.log_("Connection created"),this.start_()}start_(){let e=this.transportManager_.initialTransport();this.conn_=new e(this.nextTransportId_(),this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,null,this.lastSessionId),this.primaryResponsesRequired_=e.responsesRequiredToBeHealthy||0;let t=this.connReceiver_(this.conn_),r=this.disconnReceiver_(this.conn_);this.tx_=this.conn_,this.rx_=this.conn_,this.secondaryConn_=null,this.isHealthy_=!1,setTimeout(()=>{this.conn_&&this.conn_.open(t,r)},Math.floor(0));let i=e.healthyTimeout||0;i>0&&(this.healthyTimeout_=bp(()=>{this.healthyTimeout_=null,this.isHealthy_||(this.conn_&&this.conn_.bytesReceived>Rne?(this.log_("Connection exceeded healthy timeout but has received "+this.conn_.bytesReceived+" bytes. Marking connection healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()):this.conn_&&this.conn_.bytesSent>Dne?this.log_("Connection exceeded healthy timeout but has sent "+this.conn_.bytesSent+" bytes. Leaving connection alive."):(this.log_("Closing unhealthy connection after timeout."),this.close()))},Math.floor(i)))}nextTransportId_(){return"c:"+this.id+":"+this.connectionCount++}disconnReceiver_(e){return t=>{e===this.conn_?this.onConnectionLost_(t):e===this.secondaryConn_?(this.log_("Secondary connection lost."),this.onSecondaryConnectionLost_()):this.log_("closing an old connection")}}connReceiver_(e){return t=>{this.state_!==2&&(e===this.rx_?this.onPrimaryMessageReceived_(t):e===this.secondaryConn_?this.onSecondaryMessageReceived_(t):this.log_("message on old connection"))}}sendRequest(e){let t={t:"d",d:e};this.sendData_(t)}tryCleanupConnection(){this.tx_===this.secondaryConn_&&this.rx_===this.secondaryConn_&&(this.log_("cleaning up and promoting a connection: "+this.secondaryConn_.connId),this.conn_=this.secondaryConn_,this.secondaryConn_=null)}onSecondaryControl_(e){if(EN in e){let t=e[EN];t===l2?this.upgradeIfSecondaryHealthy_():t===a2?(this.log_("Got a reset on secondary, closing it"),this.secondaryConn_.close(),(this.tx_===this.secondaryConn_||this.rx_===this.secondaryConn_)&&this.close()):t===c2&&(this.log_("got pong on secondary."),this.secondaryResponsesRequired_--,this.upgradeIfSecondaryHealthy_())}}onSecondaryMessageReceived_(e){let t=Dp("t",e),r=Dp("d",e);if(t==="c")this.onSecondaryControl_(r);else if(t==="d")this.pendingDataMessages.push(r);else throw new Error("Unknown protocol layer: "+t)}upgradeIfSecondaryHealthy_(){this.secondaryResponsesRequired_<=0?(this.log_("Secondary connection is healthy."),this.isHealthy_=!0,this.secondaryConn_.markConnectionHealthy(),this.proceedWithUpgrade_()):(this.log_("sending ping on secondary."),this.secondaryConn_.send({t:"c",d:{t:d2,d:{}}}))}proceedWithUpgrade_(){this.secondaryConn_.start(),this.log_("sending client ack on secondary"),this.secondaryConn_.send({t:"c",d:{t:l2,d:{}}}),this.log_("Ending transmission on primary"),this.conn_.send({t:"c",d:{t:u2,d:{}}}),this.tx_=this.secondaryConn_,this.tryCleanupConnection()}onPrimaryMessageReceived_(e){let t=Dp("t",e),r=Dp("d",e);t==="c"?this.onControl_(r):t==="d"&&this.onDataMessage_(r)}onDataMessage_(e){this.onPrimaryResponse_(),this.onMessage_(e)}onPrimaryResponse_(){this.isHealthy_||(this.primaryResponsesRequired_--,this.primaryResponsesRequired_<=0&&(this.log_("Primary connection is healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()))}onControl_(e){let t=Dp(EN,e);if(s2 in e){let r=e[s2];if(t===bne){let i=Object.assign({},r);this.repoInfo_.isUsingEmulator&&(i.h=this.repoInfo_.host),this.onHandshake_(i)}else if(t===u2){this.log_("recvd end transmission on primary"),this.rx_=this.secondaryConn_;for(let i=0;i<this.pendingDataMessages.length;++i)this.onDataMessage_(this.pendingDataMessages[i]);this.pendingDataMessages=[],this.tryCleanupConnection()}else t===Nne?this.onConnectionShutdown_(r):t===a2?this.onReset_(r):t===wne?CN("Server Error: "+r):t===c2?(this.log_("got pong on primary."),this.onPrimaryResponse_(),this.sendPingOnPrimaryIfNecessary_()):CN("Unknown control packet command: "+t)}}onHandshake_(e){let t=e.ts,r=e.v,i=e.h;this.sessionId=e.s,this.repoInfo_.host=i,this.state_===0&&(this.conn_.start(),this.onConnectionEstablished_(this.conn_,t),eI!==r&&Ln("Protocol version mismatch detected"),this.tryStartUpgrade_())}tryStartUpgrade_(){let e=this.transportManager_.upgradeTransport();e&&this.startUpgrade_(e)}startUpgrade_(e){this.secondaryConn_=new e(this.nextTransportId_(),this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,this.sessionId),this.secondaryResponsesRequired_=e.responsesRequiredToBeHealthy||0;let t=this.connReceiver_(this.secondaryConn_),r=this.disconnReceiver_(this.secondaryConn_);this.secondaryConn_.open(t,r),bp(()=>{this.secondaryConn_&&(this.log_("Timed out trying to upgrade."),this.secondaryConn_.close())},Math.floor(Ane))}onReset_(e){this.log_("Reset packet received. New host: "+e),this.repoInfo_.host=e,this.state_===1?this.close():(this.closeConnections_(),this.start_())}onConnectionEstablished_(e,t){this.log_("Realtime connection established."),this.conn_=e,this.state_=1,this.onReady_&&(this.onReady_(t,this.sessionId),this.onReady_=null),this.primaryResponsesRequired_===0?(this.log_("Primary connection is healthy."),this.isHealthy_=!0):bp(()=>{this.sendPingOnPrimaryIfNecessary_()},Math.floor(Cne))}sendPingOnPrimaryIfNecessary_(){!this.isHealthy_&&this.state_===1&&(this.log_("sending ping on primary."),this.sendData_({t:"c",d:{t:d2,d:{}}}))}onSecondaryConnectionLost_(){let e=this.secondaryConn_;this.secondaryConn_=null,(this.tx_===e||this.rx_===e)&&this.close()}onConnectionLost_(e){this.conn_=null,!e&&this.state_===0?(this.log_("Realtime connection failed."),this.repoInfo_.isCacheableHost()&&(zc.remove("host:"+this.repoInfo_.host),this.repoInfo_.internalHost=this.repoInfo_.host)):this.state_===1&&this.log_("Realtime connection lost."),this.close()}onConnectionShutdown_(e){this.log_("Connection shutdown command received. Shutting down..."),this.onKill_&&(this.onKill_(e),this.onKill_=null),this.onDisconnect_=null,this.close()}sendData_(e){if(this.state_!==1)throw"Connection is not connected";this.tx_.send(e)}close(){this.state_!==2&&(this.log_("Closing realtime connection."),this.state_=2,this.closeConnections_(),this.onDisconnect_&&(this.onDisconnect_(),this.onDisconnect_=null))}closeConnections_(){this.log_("Shutting down all connections"),this.conn_&&(this.conn_.close(),this.conn_=null),this.secondaryConn_&&(this.secondaryConn_.close(),this.secondaryConn_=null),this.healthyTimeout_&&(clearTimeout(this.healthyTimeout_),this.healthyTimeout_=null)}};var iI=class{put(e,t,r,i){}merge(e,t,r,i){}refreshAuthToken(e){}refreshAppCheckToken(e){}onDisconnectPut(e,t,r){}onDisconnectMerge(e,t,r){}onDisconnectCancel(e,t){}reportStats(e){}};var oI=class{constructor(e){this.allowedEvents_=e,this.listeners_={},q(Array.isArray(e)&&e.length>0,"Requires a non-empty array")}trigger(e,...t){if(Array.isArray(this.listeners_[e])){let r=[...this.listeners_[e]];for(let i=0;i<r.length;i++)r[i].callback.apply(r[i].context,t)}}on(e,t,r){this.validateEventType_(e),this.listeners_[e]=this.listeners_[e]||[],this.listeners_[e].push({callback:t,context:r});let i=this.getInitialEvent(e);i&&t.apply(r,i)}off(e,t,r){this.validateEventType_(e);let i=this.listeners_[e]||[];for(let o=0;o<i.length;o++)if(i[o].callback===t&&(!r||r===i[o].context)){i.splice(o,1);return}}validateEventType_(e){q(this.allowedEvents_.find(t=>t===e),"Unknown event: "+e)}};var sI=class n extends oI{static getInstance(){return new n}constructor(){super(["online"]),this.online_=!0,typeof window<"u"&&typeof window.addEventListener<"u"&&!ip()&&(window.addEventListener("online",()=>{this.online_||(this.online_=!0,this.trigger("online",!0))},!1),window.addEventListener("offline",()=>{this.online_&&(this.online_=!1,this.trigger("online",!1))},!1))}getInitialEvent(e){return q(e==="online","Unknown event type: "+e),[this.online_]}currentlyOnline(){return this.online_}};var h2=32,f2=768,Ve=class{constructor(e,t){if(t===void 0){this.pieces_=e.split("/");let r=0;for(let i=0;i<this.pieces_.length;i++)this.pieces_[i].length>0&&(this.pieces_[r]=this.pieces_[i],r++);this.pieces_.length=r,this.pieceNum_=0}else this.pieces_=e,this.pieceNum_=t}toString(){let e="";for(let t=this.pieceNum_;t<this.pieces_.length;t++)this.pieces_[t]!==""&&(e+="/"+this.pieces_[t]);return e||"/"}};function Ue(){return new Ve("")}function Ne(n){return n.pieceNum_>=n.pieces_.length?null:n.pieces_[n.pieceNum_]}function Ks(n){return n.pieces_.length-n.pieceNum_}function st(n){let e=n.pieceNum_;return e<n.pieces_.length&&e++,new Ve(n.pieces_,e)}function Sw(n){return n.pieceNum_<n.pieces_.length?n.pieces_[n.pieces_.length-1]:null}function One(n){let e="";for(let t=n.pieceNum_;t<n.pieces_.length;t++)n.pieces_[t]!==""&&(e+="/"+encodeURIComponent(String(n.pieces_[t])));return e||"/"}function xp(n,e=0){return n.pieces_.slice(n.pieceNum_+e)}function tj(n){if(n.pieceNum_>=n.pieces_.length)return null;let e=[];for(let t=n.pieceNum_;t<n.pieces_.length-1;t++)e.push(n.pieces_[t]);return new Ve(e,0)}function St(n,e){let t=[];for(let r=n.pieceNum_;r<n.pieces_.length;r++)t.push(n.pieces_[r]);if(e instanceof Ve)for(let r=e.pieceNum_;r<e.pieces_.length;r++)t.push(e.pieces_[r]);else{let r=e.split("/");for(let i=0;i<r.length;i++)r[i].length>0&&t.push(r[i])}return new Ve(t,0)}function we(n){return n.pieceNum_>=n.pieces_.length}function Hn(n,e){let t=Ne(n),r=Ne(e);if(t===null)return e;if(t===r)return Hn(st(n),st(e));throw new Error("INTERNAL ERROR: innerPath ("+e+") is not within outerPath ("+n+")")}function Mne(n,e){let t=xp(n,0),r=xp(e,0);for(let i=0;i<t.length&&i<r.length;i++){let o=tl(t[i],r[i]);if(o!==0)return o}return t.length===r.length?0:t.length<r.length?-1:1}function Aw(n,e){if(Ks(n)!==Ks(e))return!1;for(let t=n.pieceNum_,r=e.pieceNum_;t<=n.pieces_.length;t++,r++)if(n.pieces_[t]!==e.pieces_[r])return!1;return!0}function Br(n,e){let t=n.pieceNum_,r=e.pieceNum_;if(Ks(n)>Ks(e))return!1;for(;t<n.pieces_.length;){if(n.pieces_[t]!==e.pieces_[r])return!1;++t,++r}return!0}var LN=class{constructor(e,t){this.errorPrefix_=t,this.parts_=xp(e,0),this.byteLength_=Math.max(1,this.parts_.length);for(let r=0;r<this.parts_.length;r++)this.byteLength_+=cp(this.parts_[r]);nj(this)}};function Lne(n,e){n.parts_.length>0&&(n.byteLength_+=1),n.parts_.push(e),n.byteLength_+=cp(e),nj(n)}function Pne(n){let e=n.parts_.pop();n.byteLength_-=cp(e),n.parts_.length>0&&(n.byteLength_-=1)}function nj(n){if(n.byteLength_>f2)throw new Error(n.errorPrefix_+"has a key path longer than "+f2+" bytes ("+n.byteLength_+").");if(n.parts_.length>h2)throw new Error(n.errorPrefix_+"path specified exceeds the maximum depth that can be written ("+h2+") or object contains a cycle "+Wc(n))}function Wc(n){return n.parts_.length===0?"":"in property '"+n.parts_.join(".")+"'"}var PN=class n extends oI{static getInstance(){return new n}constructor(){super(["visible"]);let e,t;typeof document<"u"&&typeof document.addEventListener<"u"&&(typeof document.hidden<"u"?(t="visibilitychange",e="hidden"):typeof document.mozHidden<"u"?(t="mozvisibilitychange",e="mozHidden"):typeof document.msHidden<"u"?(t="msvisibilitychange",e="msHidden"):typeof document.webkitHidden<"u"&&(t="webkitvisibilitychange",e="webkitHidden")),this.visible_=!0,t&&document.addEventListener(t,()=>{let r=!document[e];r!==this.visible_&&(this.visible_=r,this.trigger("visible",r))},!1)}getInitialEvent(e){return q(e==="visible","Unknown event type: "+e),[this.visible_]}};var Rp=1e3,xne=300*1e3,p2=30*1e3,kne=1.3,Fne=3e4,Une="server_kill",g2=3,Cw=(()=>{class n extends iI{constructor(t,r,i,o,s,a,c,l){if(super(),this.repoInfo_=t,this.applicationId_=r,this.onDataUpdate_=i,this.onConnectStatus_=o,this.onServerInfoUpdate_=s,this.authTokenProvider_=a,this.appCheckTokenProvider_=c,this.authOverride_=l,this.id=n.nextPersistentConnectionId_++,this.log_=Kp("p:"+this.id+":"),this.interruptReasons_={},this.listens=new Map,this.outstandingPuts_=[],this.outstandingGets_=[],this.outstandingPutCount_=0,this.outstandingGetCount_=0,this.onDisconnectRequestQueue_=[],this.connected_=!1,this.reconnectDelay_=Rp,this.maxReconnectDelay_=xne,this.securityDebugCallback_=null,this.lastSessionId=null,this.establishConnectionTimer_=null,this.visible_=!1,this.requestCBHash_={},this.requestNumber_=0,this.realtime_=null,this.authToken_=null,this.appCheckToken_=null,this.forceTokenRefresh_=!1,this.invalidAuthTokenCount_=0,this.invalidAppCheckTokenCount_=0,this.firstConnection_=!0,this.lastConnectionAttemptTime_=null,this.lastConnectionEstablishedTime_=null,l&&!zi())throw new Error("Auth override specified in options, but not supported on non Node.js platforms");PN.getInstance().on("visible",this.onVisible_,this),t.host.indexOf("fblocal")===-1&&sI.getInstance().on("online",this.onOnline_,this)}sendRequest(t,r,i){let o=++this.requestNumber_,s={r:o,a:t,b:r};this.log_(xt(s)),q(this.connected_,"sendRequest call when we're not connected not allowed."),this.realtime_.sendRequest(s),i&&(this.requestCBHash_[o]=i)}get(t){this.initConnection_();let r=new sn,o={action:"g",request:{p:t._path.toString(),q:t._queryObject},onComplete:a=>{let c=a.d;a.s==="ok"?r.resolve(c):r.reject(c)}};this.outstandingGets_.push(o),this.outstandingGetCount_++;let s=this.outstandingGets_.length-1;return this.connected_&&this.sendGet_(s),r.promise}listen(t,r,i,o){this.initConnection_();let s=t._queryIdentifier,a=t._path.toString();this.log_("Listen called for "+a+" "+s),this.listens.has(a)||this.listens.set(a,new Map),q(t._queryParams.isDefault()||!t._queryParams.loadsAllData(),"listen() called for non-default but complete query"),q(!this.listens.get(a).has(s),"listen() called twice for same path/queryId.");let c={onComplete:o,hashFn:r,query:t,tag:i};this.listens.get(a).set(s,c),this.connected_&&this.sendListen_(c)}sendGet_(t){let r=this.outstandingGets_[t];this.sendRequest("g",r.request,i=>{delete this.outstandingGets_[t],this.outstandingGetCount_--,this.outstandingGetCount_===0&&(this.outstandingGets_=[]),r.onComplete&&r.onComplete(i)})}sendListen_(t){let r=t.query,i=r._path.toString(),o=r._queryIdentifier;this.log_("Listen on "+i+" for "+o);let s={p:i},a="q";t.tag&&(s.q=r._queryObject,s.t=t.tag),s.h=t.hashFn(),this.sendRequest(a,s,c=>{let l=c.d,d=c.s;n.warnOnListenWarnings_(l,r),(this.listens.get(i)&&this.listens.get(i).get(o))===t&&(this.log_("listen response",c),d!=="ok"&&this.removeListen_(i,o),t.onComplete&&t.onComplete(d,l))})}static warnOnListenWarnings_(t,r){if(t&&typeof t=="object"&&Fr(t,"w")){let i=bs(t,"w");if(Array.isArray(i)&&~i.indexOf("no_index")){let o='".indexOn": "'+r._queryParams.getIndex().toString()+'"',s=r._path.toString();Ln(`Using an unspecified index. Your data will be downloaded and filtered on the client. Consider adding ${o} at ${s} to your security rules for better performance.`)}}}refreshAuthToken(t){this.authToken_=t,this.log_("Auth token refreshed"),this.authToken_?this.tryAuth():this.connected_&&this.sendRequest("unauth",{},()=>{}),this.reduceReconnectDelayIfAdminCredential_(t)}reduceReconnectDelayIfAdminCredential_(t){(t&&t.length===40||jV(t))&&(this.log_("Admin auth credential detected. Reducing max reconnect time."),this.maxReconnectDelay_=p2)}refreshAppCheckToken(t){this.appCheckToken_=t,this.log_("App check token refreshed"),this.appCheckToken_?this.tryAppCheck():this.connected_&&this.sendRequest("unappeck",{},()=>{})}tryAuth(){if(this.connected_&&this.authToken_){let t=this.authToken_,r=GV(t)?"auth":"gauth",i={cred:t};this.authOverride_===null?i.noauth=!0:typeof this.authOverride_=="object"&&(i.authvar=this.authOverride_),this.sendRequest(r,i,o=>{let s=o.s,a=o.d||"error";this.authToken_===t&&(s==="ok"?this.invalidAuthTokenCount_=0:this.onAuthRevoked_(s,a))})}}tryAppCheck(){this.connected_&&this.appCheckToken_&&this.sendRequest("appcheck",{token:this.appCheckToken_},t=>{let r=t.s,i=t.d||"error";r==="ok"?this.invalidAppCheckTokenCount_=0:this.onAppCheckRevoked_(r,i)})}unlisten(t,r){let i=t._path.toString(),o=t._queryIdentifier;this.log_("Unlisten called for "+i+" "+o),q(t._queryParams.isDefault()||!t._queryParams.loadsAllData(),"unlisten() called for non-default but complete query"),this.removeListen_(i,o)&&this.connected_&&this.sendUnlisten_(i,o,t._queryObject,r)}sendUnlisten_(t,r,i,o){this.log_("Unlisten on "+t+" for "+r);let s={p:t},a="n";o&&(s.q=i,s.t=o),this.sendRequest(a,s)}onDisconnectPut(t,r,i){this.initConnection_(),this.connected_?this.sendOnDisconnect_("o",t,r,i):this.onDisconnectRequestQueue_.push({pathString:t,action:"o",data:r,onComplete:i})}onDisconnectMerge(t,r,i){this.initConnection_(),this.connected_?this.sendOnDisconnect_("om",t,r,i):this.onDisconnectRequestQueue_.push({pathString:t,action:"om",data:r,onComplete:i})}onDisconnectCancel(t,r){this.initConnection_(),this.connected_?this.sendOnDisconnect_("oc",t,null,r):this.onDisconnectRequestQueue_.push({pathString:t,action:"oc",data:null,onComplete:r})}sendOnDisconnect_(t,r,i,o){let s={p:r,d:i};this.log_("onDisconnect "+t,s),this.sendRequest(t,s,a=>{o&&setTimeout(()=>{o(a.s,a.d)},Math.floor(0))})}put(t,r,i,o){this.putInternal("p",t,r,i,o)}merge(t,r,i,o){this.putInternal("m",t,r,i,o)}putInternal(t,r,i,o,s){this.initConnection_();let a={p:r,d:i};s!==void 0&&(a.h=s),this.outstandingPuts_.push({action:t,request:a,onComplete:o}),this.outstandingPutCount_++;let c=this.outstandingPuts_.length-1;this.connected_?this.sendPut_(c):this.log_("Buffering put: "+r)}sendPut_(t){let r=this.outstandingPuts_[t].action,i=this.outstandingPuts_[t].request,o=this.outstandingPuts_[t].onComplete;this.outstandingPuts_[t].queued=this.connected_,this.sendRequest(r,i,s=>{this.log_(r+" response",s),delete this.outstandingPuts_[t],this.outstandingPutCount_--,this.outstandingPutCount_===0&&(this.outstandingPuts_=[]),o&&o(s.s,s.d)})}reportStats(t){if(this.connected_){let r={c:t};this.log_("reportStats",r),this.sendRequest("s",r,i=>{if(i.s!=="ok"){let s=i.d;this.log_("reportStats","Error sending stats: "+s)}})}}onDataMessage_(t){if("r"in t){this.log_("from server: "+xt(t));let r=t.r,i=this.requestCBHash_[r];i&&(delete this.requestCBHash_[r],i(t.b))}else{if("error"in t)throw"A server-side error has occurred: "+t.error;"a"in t&&this.onDataPush_(t.a,t.b)}}onDataPush_(t,r){this.log_("handleServerMessage",t,r),t==="d"?this.onDataUpdate_(r.p,r.d,!1,r.t):t==="m"?this.onDataUpdate_(r.p,r.d,!0,r.t):t==="c"?this.onListenRevoked_(r.p,r.q):t==="ac"?this.onAuthRevoked_(r.s,r.d):t==="apc"?this.onAppCheckRevoked_(r.s,r.d):t==="sd"?this.onSecurityDebugPacket_(r):CN("Unrecognized action received from server: "+xt(t)+`
|
|
151
|
+
Are you using the latest client?`)}onReady_(t,r){this.log_("connection ready"),this.connected_=!0,this.lastConnectionEstablishedTime_=new Date().getTime(),this.handleTimestamp_(t),this.lastSessionId=r,this.firstConnection_&&this.sendConnectStats_(),this.restoreState_(),this.firstConnection_=!1,this.onConnectStatus_(!0)}scheduleConnect_(t){q(!this.realtime_,"Scheduling a connect when we're already connected/ing?"),this.establishConnectionTimer_&&clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=setTimeout(()=>{this.establishConnectionTimer_=null,this.establishConnection_()},Math.floor(t))}initConnection_(){!this.realtime_&&this.firstConnection_&&this.scheduleConnect_(0)}onVisible_(t){t&&!this.visible_&&this.reconnectDelay_===this.maxReconnectDelay_&&(this.log_("Window became visible. Reducing delay."),this.reconnectDelay_=Rp,this.realtime_||this.scheduleConnect_(0)),this.visible_=t}onOnline_(t){t?(this.log_("Browser went online."),this.reconnectDelay_=Rp,this.realtime_||this.scheduleConnect_(0)):(this.log_("Browser went offline. Killing connection."),this.realtime_&&this.realtime_.close())}onRealtimeDisconnect_(){if(this.log_("data client disconnected"),this.connected_=!1,this.realtime_=null,this.cancelSentTransactions_(),this.requestCBHash_={},this.shouldReconnect_()){this.visible_?this.lastConnectionEstablishedTime_&&(new Date().getTime()-this.lastConnectionEstablishedTime_>Fne&&(this.reconnectDelay_=Rp),this.lastConnectionEstablishedTime_=null):(this.log_("Window isn't visible. Delaying reconnect."),this.reconnectDelay_=this.maxReconnectDelay_,this.lastConnectionAttemptTime_=new Date().getTime());let t=Math.max(0,new Date().getTime()-this.lastConnectionAttemptTime_),r=Math.max(0,this.reconnectDelay_-t);r=Math.random()*r,this.log_("Trying to reconnect in "+r+"ms"),this.scheduleConnect_(r),this.reconnectDelay_=Math.min(this.maxReconnectDelay_,this.reconnectDelay_*kne)}this.onConnectStatus_(!1)}establishConnection_(){return I(this,null,function*(){if(this.shouldReconnect_()){this.log_("Making a connection attempt"),this.lastConnectionAttemptTime_=new Date().getTime(),this.lastConnectionEstablishedTime_=null;let t=this.onDataMessage_.bind(this),r=this.onReady_.bind(this),i=this.onRealtimeDisconnect_.bind(this),o=this.id+":"+n.nextConnectionId_++,s=this.lastSessionId,a=!1,c=null,l=function(){c?c.close():(a=!0,i())},d=function(f){q(c,"sendRequest call when we're not connected not allowed."),c.sendRequest(f)};this.realtime_={close:l,sendRequest:d};let h=this.forceTokenRefresh_;this.forceTokenRefresh_=!1;try{let[f,g]=yield Promise.all([this.authTokenProvider_.getToken(h),this.appCheckTokenProvider_.getToken(h)]);a?cn("getToken() completed but was canceled"):(cn("getToken() completed. Creating connection."),this.authToken_=f&&f.accessToken,this.appCheckToken_=g&&g.token,c=new MN(o,this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,t,r,i,E=>{Ln(E+" ("+this.repoInfo_.toString()+")"),this.interrupt(Une)},s))}catch(f){this.log_("Failed to get token: "+f),a||(this.repoInfo_.nodeAdmin&&Ln(f),l())}}})}interrupt(t){cn("Interrupting connection for reason: "+t),this.interruptReasons_[t]=!0,this.realtime_?this.realtime_.close():(this.establishConnectionTimer_&&(clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=null),this.connected_&&this.onRealtimeDisconnect_())}resume(t){cn("Resuming connection for reason: "+t),delete this.interruptReasons_[t],op(this.interruptReasons_)&&(this.reconnectDelay_=Rp,this.realtime_||this.scheduleConnect_(0))}handleTimestamp_(t){let r=t-new Date().getTime();this.onServerInfoUpdate_({serverTimeOffset:r})}cancelSentTransactions_(){for(let t=0;t<this.outstandingPuts_.length;t++){let r=this.outstandingPuts_[t];r&&"h"in r.request&&r.queued&&(r.onComplete&&r.onComplete("disconnect"),delete this.outstandingPuts_[t],this.outstandingPutCount_--)}this.outstandingPutCount_===0&&(this.outstandingPuts_=[])}onListenRevoked_(t,r){let i;r?i=r.map(s=>yw(s)).join("$"):i="default";let o=this.removeListen_(t,i);o&&o.onComplete&&o.onComplete("permission_denied")}removeListen_(t,r){let i=new Ve(t).toString(),o;if(this.listens.has(i)){let s=this.listens.get(i);o=s.get(r),s.delete(r),s.size===0&&this.listens.delete(i)}else o=void 0;return o}onAuthRevoked_(t,r){cn("Auth token revoked: "+t+"/"+r),this.authToken_=null,this.forceTokenRefresh_=!0,this.realtime_.close(),(t==="invalid_token"||t==="permission_denied")&&(this.invalidAuthTokenCount_++,this.invalidAuthTokenCount_>=g2&&(this.reconnectDelay_=p2,this.authTokenProvider_.notifyForInvalidToken()))}onAppCheckRevoked_(t,r){cn("App check token revoked: "+t+"/"+r),this.appCheckToken_=null,this.forceTokenRefresh_=!0,(t==="invalid_token"||t==="permission_denied")&&(this.invalidAppCheckTokenCount_++,this.invalidAppCheckTokenCount_>=g2&&this.appCheckTokenProvider_.notifyForInvalidToken())}onSecurityDebugPacket_(t){this.securityDebugCallback_?this.securityDebugCallback_(t):"msg"in t&&console.log("FIREBASE: "+t.msg.replace(`
|
|
152
|
+
`,`
|
|
153
|
+
FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(let t of this.listens.values())for(let r of t.values())this.sendListen_(r);for(let t=0;t<this.outstandingPuts_.length;t++)this.outstandingPuts_[t]&&this.sendPut_(t);for(;this.onDisconnectRequestQueue_.length;){let t=this.onDisconnectRequestQueue_.shift();this.sendOnDisconnect_(t.action,t.pathString,t.data,t.onComplete)}for(let t=0;t<this.outstandingGets_.length;t++)this.outstandingGets_[t]&&this.sendGet_(t)}sendConnectStats_(){let t={},r="js";zi()&&(this.repoInfo_.nodeAdmin?r="admin_node":r="node"),t["sdk."+r+"."+Iw.replace(/\./g,"-")]=1,ip()?t["framework.cordova"]=1:ST()&&(t["framework.reactnative"]=1),this.reportStats(t)}shouldReconnect_(){let t=sI.getInstance().currentlyOnline();return op(this.interruptReasons_)&&t}}n.nextPersistentConnectionId_=0,n.nextConnectionId_=0;return n})(),Oe=class n{constructor(e,t){this.name=e,this.node=t}static Wrap(e,t){return new n(e,t)}};var Ed=class{getCompare(){return this.compare.bind(this)}indexedValueChanged(e,t){let r=new Oe(Yc,e),i=new Oe(Yc,t);return this.compare(r,i)!==0}minPost(){return Oe.MIN}};var ZT,aI=class extends Ed{static get __EMPTY_NODE(){return ZT}static set __EMPTY_NODE(e){ZT=e}compare(e,t){return tl(e.name,t.name)}isDefinedOn(e){throw bc("KeyIndex.isDefinedOn not expected to be called.")}indexedValueChanged(e,t){return!1}minPost(){return Oe.MIN}maxPost(){return new Oe(qs,ZT)}makePost(e,t){return q(typeof e=="string","KeyIndex indexValue must always be a string."),new Oe(e,ZT)}toString(){return".key"}},Kc=new aI;var gd=class{constructor(e,t,r,i,o=null){this.isReverse_=i,this.resultGenerator_=o,this.nodeStack_=[];let s=1;for(;!e.isEmpty();)if(e=e,s=t?r(e.key,t):1,i&&(s*=-1),s<0)this.isReverse_?e=e.left:e=e.right;else if(s===0){this.nodeStack_.push(e);break}else this.nodeStack_.push(e),this.isReverse_?e=e.right:e=e.left}getNext(){if(this.nodeStack_.length===0)return null;let e=this.nodeStack_.pop(),t;if(this.resultGenerator_?t=this.resultGenerator_(e.key,e.value):t={key:e.key,value:e.value},this.isReverse_)for(e=e.left;!e.isEmpty();)this.nodeStack_.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack_.push(e),e=e.left;return t}hasNext(){return this.nodeStack_.length>0}peek(){if(this.nodeStack_.length===0)return null;let e=this.nodeStack_[this.nodeStack_.length-1];return this.resultGenerator_?this.resultGenerator_(e.key,e.value):{key:e.key,value:e.value}}},ci=(()=>{class n{constructor(t,r,i,o,s){this.key=t,this.value=r,this.color=i??n.RED,this.left=o??Gr.EMPTY_NODE,this.right=s??Gr.EMPTY_NODE}copy(t,r,i,o,s){return new n(t??this.key,r??this.value,i??this.color,o??this.left,s??this.right)}count(){return this.left.count()+1+this.right.count()}isEmpty(){return!1}inorderTraversal(t){return this.left.inorderTraversal(t)||!!t(this.key,this.value)||this.right.inorderTraversal(t)}reverseTraversal(t){return this.right.reverseTraversal(t)||t(this.key,this.value)||this.left.reverseTraversal(t)}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(t,r,i){let o=this,s=i(t,o.key);return s<0?o=o.copy(null,null,null,o.left.insert(t,r,i),null):s===0?o=o.copy(null,r,null,null,null):o=o.copy(null,null,null,null,o.right.insert(t,r,i)),o.fixUp_()}removeMin_(){if(this.left.isEmpty())return Gr.EMPTY_NODE;let t=this;return!t.left.isRed_()&&!t.left.left.isRed_()&&(t=t.moveRedLeft_()),t=t.copy(null,null,null,t.left.removeMin_(),null),t.fixUp_()}remove(t,r){let i,o;if(i=this,r(t,i.key)<0)!i.left.isEmpty()&&!i.left.isRed_()&&!i.left.left.isRed_()&&(i=i.moveRedLeft_()),i=i.copy(null,null,null,i.left.remove(t,r),null);else{if(i.left.isRed_()&&(i=i.rotateRight_()),!i.right.isEmpty()&&!i.right.isRed_()&&!i.right.left.isRed_()&&(i=i.moveRedRight_()),r(t,i.key)===0){if(i.right.isEmpty())return Gr.EMPTY_NODE;o=i.right.min_(),i=i.copy(o.key,o.value,null,null,i.right.removeMin_())}i=i.copy(null,null,null,null,i.right.remove(t,r))}return i.fixUp_()}isRed_(){return this.color}fixUp_(){let t=this;return t.right.isRed_()&&!t.left.isRed_()&&(t=t.rotateLeft_()),t.left.isRed_()&&t.left.left.isRed_()&&(t=t.rotateRight_()),t.left.isRed_()&&t.right.isRed_()&&(t=t.colorFlip_()),t}moveRedLeft_(){let t=this.colorFlip_();return t.right.left.isRed_()&&(t=t.copy(null,null,null,null,t.right.rotateRight_()),t=t.rotateLeft_(),t=t.colorFlip_()),t}moveRedRight_(){let t=this.colorFlip_();return t.left.left.isRed_()&&(t=t.rotateRight_(),t=t.colorFlip_()),t}rotateLeft_(){let t=this.copy(null,null,n.RED,null,this.right.left);return this.right.copy(null,null,this.color,t,null)}rotateRight_(){let t=this.copy(null,null,n.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,t)}colorFlip_(){let t=this.left.copy(null,null,!this.left.color,null,null),r=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,t,r)}checkMaxDepth_(){let t=this.check_();return Math.pow(2,t)<=this.count()+1}check_(){if(this.isRed_()&&this.left.isRed_())throw new Error("Red node has red child("+this.key+","+this.value+")");if(this.right.isRed_())throw new Error("Right child of ("+this.key+","+this.value+") is red");let t=this.left.check_();if(t!==this.right.check_())throw new Error("Black depths differ");return t+(this.isRed_()?0:1)}}return n.RED=!0,n.BLACK=!1,n})(),xN=class{copy(e,t,r,i,o){return this}insert(e,t,r){return new ci(e,t,null)}remove(e,t){return this}count(){return 0}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}check_(){return 0}isRed_(){return!1}},Gr=class n{constructor(e,t=n.EMPTY_NODE){this.comparator_=e,this.root_=t}insert(e,t){return new n(this.comparator_,this.root_.insert(e,t,this.comparator_).copy(null,null,ci.BLACK,null,null))}remove(e){return new n(this.comparator_,this.root_.remove(e,this.comparator_).copy(null,null,ci.BLACK,null,null))}get(e){let t,r=this.root_;for(;!r.isEmpty();){if(t=this.comparator_(e,r.key),t===0)return r.value;t<0?r=r.left:t>0&&(r=r.right)}return null}getPredecessorKey(e){let t,r=this.root_,i=null;for(;!r.isEmpty();)if(t=this.comparator_(e,r.key),t===0){if(r.left.isEmpty())return i?i.key:null;for(r=r.left;!r.right.isEmpty();)r=r.right;return r.key}else t<0?r=r.left:t>0&&(i=r,r=r.right);throw new Error("Attempted to find predecessor key for a nonexistent key. What gives?")}isEmpty(){return this.root_.isEmpty()}count(){return this.root_.count()}minKey(){return this.root_.minKey()}maxKey(){return this.root_.maxKey()}inorderTraversal(e){return this.root_.inorderTraversal(e)}reverseTraversal(e){return this.root_.reverseTraversal(e)}getIterator(e){return new gd(this.root_,null,this.comparator_,!1,e)}getIteratorFrom(e,t){return new gd(this.root_,e,this.comparator_,!1,t)}getReverseIteratorFrom(e,t){return new gd(this.root_,e,this.comparator_,!0,t)}getReverseIterator(e){return new gd(this.root_,null,this.comparator_,!0,e)}};Gr.EMPTY_NODE=new xN;function Vne(n,e){return tl(n.name,e.name)}function Dw(n,e){return tl(n,e)}var kN;function Bne(n){kN=n}var rj=function(n){return typeof n=="number"?"number:"+U2(n):"string:"+n},ij=function(n){if(n.isLeafNode()){let e=n.val();q(typeof e=="string"||typeof e=="number"||typeof e=="object"&&Fr(e,".sv"),"Priority must be a string or number.")}else q(n===kN||n.isEmpty(),"priority of unexpected type.");q(n===kN||n.getPriority().isEmpty(),"Priority nodes can't have a priority of their own.")};var m2,_d=(()=>{class n{static set __childrenNodeConstructor(t){m2=t}static get __childrenNodeConstructor(){return m2}constructor(t,r=n.__childrenNodeConstructor.EMPTY_NODE){this.value_=t,this.priorityNode_=r,this.lazyHash_=null,q(this.value_!==void 0&&this.value_!==null,"LeafNode shouldn't be created with null/undefined value."),ij(this.priorityNode_)}isLeafNode(){return!0}getPriority(){return this.priorityNode_}updatePriority(t){return new n(this.value_,t)}getImmediateChild(t){return t===".priority"?this.priorityNode_:n.__childrenNodeConstructor.EMPTY_NODE}getChild(t){return we(t)?this:Ne(t)===".priority"?this.priorityNode_:n.__childrenNodeConstructor.EMPTY_NODE}hasChild(){return!1}getPredecessorChildName(t,r){return null}updateImmediateChild(t,r){return t===".priority"?this.updatePriority(r):r.isEmpty()&&t!==".priority"?this:n.__childrenNodeConstructor.EMPTY_NODE.updateImmediateChild(t,r).updatePriority(this.priorityNode_)}updateChild(t,r){let i=Ne(t);return i===null?r:r.isEmpty()&&i!==".priority"?this:(q(i!==".priority"||Ks(t)===1,".priority must be the last token in a path"),this.updateImmediateChild(i,n.__childrenNodeConstructor.EMPTY_NODE.updateChild(st(t),r)))}isEmpty(){return!1}numChildren(){return 0}forEachChild(t,r){return!1}val(t){return t&&!this.getPriority().isEmpty()?{".value":this.getValue(),".priority":this.getPriority().val()}:this.getValue()}hash(){if(this.lazyHash_===null){let t="";this.priorityNode_.isEmpty()||(t+="priority:"+rj(this.priorityNode_.val())+":");let r=typeof this.value_;t+=r+":",r==="number"?t+=U2(this.value_):t+=this.value_,this.lazyHash_=k2(t)}return this.lazyHash_}getValue(){return this.value_}compareTo(t){return t===n.__childrenNodeConstructor.EMPTY_NODE?1:t instanceof n.__childrenNodeConstructor?-1:(q(t.isLeafNode(),"Unknown node type"),this.compareToLeafNode_(t))}compareToLeafNode_(t){let r=typeof t.value_,i=typeof this.value_,o=n.VALUE_TYPE_ORDER.indexOf(r),s=n.VALUE_TYPE_ORDER.indexOf(i);return q(o>=0,"Unknown leaf type: "+r),q(s>=0,"Unknown leaf type: "+i),o===s?i==="object"?0:this.value_<t.value_?-1:this.value_===t.value_?0:1:s-o}withIndex(){return this}isIndexed(){return!0}equals(t){if(t===this)return!0;if(t.isLeafNode()){let r=t;return this.value_===r.value_&&this.priorityNode_.equals(r.priorityNode_)}else return!1}}n.VALUE_TYPE_ORDER=["object","boolean","number","string"];return n})(),oj,sj;function Gne(n){oj=n}function jne(n){sj=n}var FN=class extends Ed{compare(e,t){let r=e.node.getPriority(),i=t.node.getPriority(),o=r.compareTo(i);return o===0?tl(e.name,t.name):o}isDefinedOn(e){return!e.getPriority().isEmpty()}indexedValueChanged(e,t){return!e.getPriority().equals(t.getPriority())}minPost(){return Oe.MIN}maxPost(){return new Oe(qs,new _d("[PRIORITY-POST]",sj))}makePost(e,t){let r=oj(e);return new Oe(t,new _d("[PRIORITY-POST]",r))}toString(){return".priority"}},ht=new FN;var Hne=Math.log(2),UN=class{constructor(e){let t=o=>parseInt(Math.log(o)/Hne,10),r=o=>parseInt(Array(o+1).join("1"),2);this.count=t(e+1),this.current_=this.count-1;let i=r(this.count);this.bits_=e+1&i}nextBitIsOne(){let e=!(this.bits_&1<<this.current_);return this.current_--,e}},cI=function(n,e,t,r){n.sort(e);let i=function(c,l){let d=l-c,h,f;if(d===0)return null;if(d===1)return h=n[c],f=t?t(h):h,new ci(f,h.node,ci.BLACK,null,null);{let g=parseInt(d/2,10)+c,E=i(c,g),v=i(g+1,l);return h=n[g],f=t?t(h):h,new ci(f,h.node,ci.BLACK,E,v)}},o=function(c){let l=null,d=null,h=n.length,f=function(E,v){let S=h-E,P=h;h-=E;let V=i(S+1,P),K=n[S],oe=t?t(K):K;g(new ci(oe,K.node,v,null,V))},g=function(E){l?(l.left=E,l=E):(d=E,l=E)};for(let E=0;E<c.count;++E){let v=c.nextBitIsOne(),S=Math.pow(2,c.count-(E+1));v?f(S,ci.BLACK):(f(S,ci.BLACK),f(S,ci.RED))}return d},s=new UN(n.length),a=o(s);return new Gr(r||e,a)};var _N,fd={},Td=class n{static get Default(){return q(fd&&ht,"ChildrenNode.ts has not been loaded"),_N=_N||new n({".priority":fd},{".priority":ht}),_N}constructor(e,t){this.indexes_=e,this.indexSet_=t}get(e){let t=bs(this.indexes_,e);if(!t)throw new Error("No index defined for "+e);return t instanceof Gr?t:null}hasIndex(e){return Fr(this.indexSet_,e.toString())}addIndex(e,t){q(e!==Kc,"KeyIndex always exists and isn't meant to be added to the IndexMap.");let r=[],i=!1,o=t.getIterator(Oe.Wrap),s=o.getNext();for(;s;)i=i||e.isDefinedOn(s.node),r.push(s),s=o.getNext();let a;i?a=cI(r,e.getCompare()):a=fd;let c=e.toString(),l=Object.assign({},this.indexSet_);l[c]=e;let d=Object.assign({},this.indexes_);return d[c]=a,new n(d,l)}addToIndexes(e,t){let r=sp(this.indexes_,(i,o)=>{let s=bs(this.indexSet_,o);if(q(s,"Missing index implementation for "+o),i===fd)if(s.isDefinedOn(e.node)){let a=[],c=t.getIterator(Oe.Wrap),l=c.getNext();for(;l;)l.name!==e.name&&a.push(l),l=c.getNext();return a.push(e),cI(a,s.getCompare())}else return fd;else{let a=t.get(e.name),c=i;return a&&(c=c.remove(new Oe(e.name,a))),c.insert(e,e.node)}});return new n(r,this.indexSet_)}removeFromIndexes(e,t){let r=sp(this.indexes_,i=>{if(i===fd)return i;{let o=t.get(e.name);return o?i.remove(new Oe(e.name,o)):i}});return new n(r,this.indexSet_)}};var Np,ve=(()=>{class n{static get EMPTY_NODE(){return Np||(Np=new n(new Gr(Dw),null,Td.Default))}constructor(t,r,i){this.children_=t,this.priorityNode_=r,this.indexMap_=i,this.lazyHash_=null,this.priorityNode_&&ij(this.priorityNode_),this.children_.isEmpty()&&q(!this.priorityNode_||this.priorityNode_.isEmpty(),"An empty node cannot have a priority")}isLeafNode(){return!1}getPriority(){return this.priorityNode_||Np}updatePriority(t){return this.children_.isEmpty()?this:new n(this.children_,t,this.indexMap_)}getImmediateChild(t){if(t===".priority")return this.getPriority();{let r=this.children_.get(t);return r===null?Np:r}}getChild(t){let r=Ne(t);return r===null?this:this.getImmediateChild(r).getChild(st(t))}hasChild(t){return this.children_.get(t)!==null}updateImmediateChild(t,r){if(q(r,"We should always be passing snapshot nodes"),t===".priority")return this.updatePriority(r);{let i=new Oe(t,r),o,s;r.isEmpty()?(o=this.children_.remove(t),s=this.indexMap_.removeFromIndexes(i,this.children_)):(o=this.children_.insert(t,r),s=this.indexMap_.addToIndexes(i,this.children_));let a=o.isEmpty()?Np:this.priorityNode_;return new n(o,a,s)}}updateChild(t,r){let i=Ne(t);if(i===null)return r;{q(Ne(t)!==".priority"||Ks(t)===1,".priority must be the last token in a path");let o=this.getImmediateChild(i).updateChild(st(t),r);return this.updateImmediateChild(i,o)}}isEmpty(){return this.children_.isEmpty()}numChildren(){return this.children_.count()}val(t){if(this.isEmpty())return null;let r={},i=0,o=0,s=!0;if(this.forEachChild(ht,(a,c)=>{r[a]=c.val(t),i++,s&&n.INTEGER_REGEXP_.test(a)?o=Math.max(o,Number(a)):s=!1}),!t&&s&&o<2*i){let a=[];for(let c in r)a[c]=r[c];return a}else return t&&!this.getPriority().isEmpty()&&(r[".priority"]=this.getPriority().val()),r}hash(){if(this.lazyHash_===null){let t="";this.getPriority().isEmpty()||(t+="priority:"+rj(this.getPriority().val())+":"),this.forEachChild(ht,(r,i)=>{let o=i.hash();o!==""&&(t+=":"+r+":"+o)}),this.lazyHash_=t===""?"":k2(t)}return this.lazyHash_}getPredecessorChildName(t,r,i){let o=this.resolveIndex_(i);if(o){let s=o.getPredecessorKey(new Oe(t,r));return s?s.name:null}else return this.children_.getPredecessorKey(t)}getFirstChildName(t){let r=this.resolveIndex_(t);if(r){let i=r.minKey();return i&&i.name}else return this.children_.minKey()}getFirstChild(t){let r=this.getFirstChildName(t);return r?new Oe(r,this.children_.get(r)):null}getLastChildName(t){let r=this.resolveIndex_(t);if(r){let i=r.maxKey();return i&&i.name}else return this.children_.maxKey()}getLastChild(t){let r=this.getLastChildName(t);return r?new Oe(r,this.children_.get(r)):null}forEachChild(t,r){let i=this.resolveIndex_(t);return i?i.inorderTraversal(o=>r(o.name,o.node)):this.children_.inorderTraversal(r)}getIterator(t){return this.getIteratorFrom(t.minPost(),t)}getIteratorFrom(t,r){let i=this.resolveIndex_(r);if(i)return i.getIteratorFrom(t,o=>o);{let o=this.children_.getIteratorFrom(t.name,Oe.Wrap),s=o.peek();for(;s!=null&&r.compare(s,t)<0;)o.getNext(),s=o.peek();return o}}getReverseIterator(t){return this.getReverseIteratorFrom(t.maxPost(),t)}getReverseIteratorFrom(t,r){let i=this.resolveIndex_(r);if(i)return i.getReverseIteratorFrom(t,o=>o);{let o=this.children_.getReverseIteratorFrom(t.name,Oe.Wrap),s=o.peek();for(;s!=null&&r.compare(s,t)>0;)o.getNext(),s=o.peek();return o}}compareTo(t){return this.isEmpty()?t.isEmpty()?0:-1:t.isLeafNode()||t.isEmpty()?1:t===Yp?-1:0}withIndex(t){if(t===Kc||this.indexMap_.hasIndex(t))return this;{let r=this.indexMap_.addIndex(t,this.children_);return new n(this.children_,this.priorityNode_,r)}}isIndexed(t){return t===Kc||this.indexMap_.hasIndex(t)}equals(t){if(t===this)return!0;if(t.isLeafNode())return!1;{let r=t;if(this.getPriority().equals(r.getPriority()))if(this.children_.count()===r.children_.count()){let i=this.getIterator(ht),o=r.getIterator(ht),s=i.getNext(),a=o.getNext();for(;s&&a;){if(s.name!==a.name||!s.node.equals(a.node))return!1;s=i.getNext(),a=o.getNext()}return s===null&&a===null}else return!1;else return!1}}resolveIndex_(t){return t===Kc?null:this.indexMap_.get(t.toString())}}return n.INTEGER_REGEXP_=/^(0|[1-9]\d*)$/,n})(),VN=class extends ve{constructor(){super(new Gr(Dw),ve.EMPTY_NODE,Td.Default)}compareTo(e){return e===this?0:1}equals(e){return e===this}getPriority(){return this}getImmediateChild(e){return ve.EMPTY_NODE}isEmpty(){return!1}},Yp=new VN;Object.defineProperties(Oe,{MIN:{value:new Oe(Yc,ve.EMPTY_NODE)},MAX:{value:new Oe(qs,Yp)}});aI.__EMPTY_NODE=ve.EMPTY_NODE;_d.__childrenNodeConstructor=ve;Bne(Yp);jne(Yp);var $ne=!0;function vt(n,e=null){if(n===null)return ve.EMPTY_NODE;if(typeof n=="object"&&".priority"in n&&(e=n[".priority"]),q(e===null||typeof e=="string"||typeof e=="number"||typeof e=="object"&&".sv"in e,"Invalid priority type found: "+typeof e),typeof n=="object"&&".value"in n&&n[".value"]!==null&&(n=n[".value"]),typeof n!="object"||".sv"in n){let t=n;return new _d(t,vt(e))}if(!(n instanceof Array)&&$ne){let t=[],r=!1;if(ln(n,(s,a)=>{if(s.substring(0,1)!=="."){let c=vt(a);c.isEmpty()||(r=r||!c.getPriority().isEmpty(),t.push(new Oe(s,c)))}}),t.length===0)return ve.EMPTY_NODE;let o=cI(t,Vne,s=>s.name,Dw);if(r){let s=cI(t,ht.getCompare());return new ve(o,vt(e),new Td({".priority":s},{".priority":ht}))}else return new ve(o,vt(e),Td.Default)}else{let t=ve.EMPTY_NODE;return ln(n,(r,i)=>{if(Fr(n,r)&&r.substring(0,1)!=="."){let o=vt(i);(o.isLeafNode()||!o.isEmpty())&&(t=t.updateImmediateChild(r,o))}}),t.updatePriority(vt(e))}}Gne(vt);var kp=class extends Ed{constructor(e){super(),this.indexPath_=e,q(!we(e)&&Ne(e)!==".priority","Can't create PathIndex with empty path or .priority key")}extractChild(e){return e.getChild(this.indexPath_)}isDefinedOn(e){return!e.getChild(this.indexPath_).isEmpty()}compare(e,t){let r=this.extractChild(e.node),i=this.extractChild(t.node),o=r.compareTo(i);return o===0?tl(e.name,t.name):o}makePost(e,t){let r=vt(e),i=ve.EMPTY_NODE.updateChild(this.indexPath_,r);return new Oe(t,i)}maxPost(){let e=ve.EMPTY_NODE.updateChild(this.indexPath_,Yp);return new Oe(qs,e)}toString(){return xp(this.indexPath_,0).join("/")}};var BN=class extends Ed{compare(e,t){let r=e.node.compareTo(t.node);return r===0?tl(e.name,t.name):r}isDefinedOn(e){return!0}indexedValueChanged(e,t){return!e.equals(t)}minPost(){return Oe.MIN}maxPost(){return Oe.MAX}makePost(e,t){let r=vt(e);return new Oe(t,r)}toString(){return".value"}},aj=new BN;function cj(n){return{type:"value",snapshotNode:n}}function Id(n,e){return{type:"child_added",snapshotNode:e,childName:n}}function Fp(n,e){return{type:"child_removed",snapshotNode:e,childName:n}}function Up(n,e,t){return{type:"child_changed",snapshotNode:e,childName:n,oldSnap:t}}function Wne(n,e){return{type:"child_moved",snapshotNode:e,childName:n}}var Vp=class{constructor(e){this.index_=e}updateChild(e,t,r,i,o,s){q(e.isIndexed(this.index_),"A node must be indexed if only a child is updated");let a=e.getImmediateChild(t);return a.getChild(i).equals(r.getChild(i))&&a.isEmpty()===r.isEmpty()||(s!=null&&(r.isEmpty()?e.hasChild(t)?s.trackChildChange(Fp(t,a)):q(e.isLeafNode(),"A child remove without an old child only makes sense on a leaf node"):a.isEmpty()?s.trackChildChange(Id(t,r)):s.trackChildChange(Up(t,r,a))),e.isLeafNode()&&r.isEmpty())?e:e.updateImmediateChild(t,r).withIndex(this.index_)}updateFullNode(e,t,r){return r!=null&&(e.isLeafNode()||e.forEachChild(ht,(i,o)=>{t.hasChild(i)||r.trackChildChange(Fp(i,o))}),t.isLeafNode()||t.forEachChild(ht,(i,o)=>{if(e.hasChild(i)){let s=e.getImmediateChild(i);s.equals(o)||r.trackChildChange(Up(i,o,s))}else r.trackChildChange(Id(i,o))})),t.withIndex(this.index_)}updatePriority(e,t){return e.isEmpty()?ve.EMPTY_NODE:e.updatePriority(t)}filtersNodes(){return!1}getIndexedFilter(){return this}getIndex(){return this.index_}};var lI=class n{constructor(e){this.indexedFilter_=new Vp(e.getIndex()),this.index_=e.getIndex(),this.startPost_=n.getStartPost_(e),this.endPost_=n.getEndPost_(e),this.startIsInclusive_=!e.startAfterSet_,this.endIsInclusive_=!e.endBeforeSet_}getStartPost(){return this.startPost_}getEndPost(){return this.endPost_}matches(e){let t=this.startIsInclusive_?this.index_.compare(this.getStartPost(),e)<=0:this.index_.compare(this.getStartPost(),e)<0,r=this.endIsInclusive_?this.index_.compare(e,this.getEndPost())<=0:this.index_.compare(e,this.getEndPost())<0;return t&&r}updateChild(e,t,r,i,o,s){return this.matches(new Oe(t,r))||(r=ve.EMPTY_NODE),this.indexedFilter_.updateChild(e,t,r,i,o,s)}updateFullNode(e,t,r){t.isLeafNode()&&(t=ve.EMPTY_NODE);let i=t.withIndex(this.index_);i=i.updatePriority(ve.EMPTY_NODE);let o=this;return t.forEachChild(ht,(s,a)=>{o.matches(new Oe(s,a))||(i=i.updateImmediateChild(s,ve.EMPTY_NODE))}),this.indexedFilter_.updateFullNode(e,i,r)}updatePriority(e,t){return e}filtersNodes(){return!0}getIndexedFilter(){return this.indexedFilter_}getIndex(){return this.index_}static getStartPost_(e){if(e.hasStart()){let t=e.getIndexStartName();return e.getIndex().makePost(e.getIndexStartValue(),t)}else return e.getIndex().minPost()}static getEndPost_(e){if(e.hasEnd()){let t=e.getIndexEndName();return e.getIndex().makePost(e.getIndexEndValue(),t)}else return e.getIndex().maxPost()}};var GN=class{constructor(e){this.withinDirectionalStart=t=>this.reverse_?this.withinEndPost(t):this.withinStartPost(t),this.withinDirectionalEnd=t=>this.reverse_?this.withinStartPost(t):this.withinEndPost(t),this.withinStartPost=t=>{let r=this.index_.compare(this.rangedFilter_.getStartPost(),t);return this.startIsInclusive_?r<=0:r<0},this.withinEndPost=t=>{let r=this.index_.compare(t,this.rangedFilter_.getEndPost());return this.endIsInclusive_?r<=0:r<0},this.rangedFilter_=new lI(e),this.index_=e.getIndex(),this.limit_=e.getLimit(),this.reverse_=!e.isViewFromLeft(),this.startIsInclusive_=!e.startAfterSet_,this.endIsInclusive_=!e.endBeforeSet_}updateChild(e,t,r,i,o,s){return this.rangedFilter_.matches(new Oe(t,r))||(r=ve.EMPTY_NODE),e.getImmediateChild(t).equals(r)?e:e.numChildren()<this.limit_?this.rangedFilter_.getIndexedFilter().updateChild(e,t,r,i,o,s):this.fullLimitUpdateChild_(e,t,r,o,s)}updateFullNode(e,t,r){let i;if(t.isLeafNode()||t.isEmpty())i=ve.EMPTY_NODE.withIndex(this.index_);else if(this.limit_*2<t.numChildren()&&t.isIndexed(this.index_)){i=ve.EMPTY_NODE.withIndex(this.index_);let o;this.reverse_?o=t.getReverseIteratorFrom(this.rangedFilter_.getEndPost(),this.index_):o=t.getIteratorFrom(this.rangedFilter_.getStartPost(),this.index_);let s=0;for(;o.hasNext()&&s<this.limit_;){let a=o.getNext();if(this.withinDirectionalStart(a))if(this.withinDirectionalEnd(a))i=i.updateImmediateChild(a.name,a.node),s++;else break;else continue}}else{i=t.withIndex(this.index_),i=i.updatePriority(ve.EMPTY_NODE);let o;this.reverse_?o=i.getReverseIterator(this.index_):o=i.getIterator(this.index_);let s=0;for(;o.hasNext();){let a=o.getNext();s<this.limit_&&this.withinDirectionalStart(a)&&this.withinDirectionalEnd(a)?s++:i=i.updateImmediateChild(a.name,ve.EMPTY_NODE)}}return this.rangedFilter_.getIndexedFilter().updateFullNode(e,i,r)}updatePriority(e,t){return e}filtersNodes(){return!0}getIndexedFilter(){return this.rangedFilter_.getIndexedFilter()}getIndex(){return this.index_}fullLimitUpdateChild_(e,t,r,i,o){let s;if(this.reverse_){let h=this.index_.getCompare();s=(f,g)=>h(g,f)}else s=this.index_.getCompare();let a=e;q(a.numChildren()===this.limit_,"");let c=new Oe(t,r),l=this.reverse_?a.getFirstChild(this.index_):a.getLastChild(this.index_),d=this.rangedFilter_.matches(c);if(a.hasChild(t)){let h=a.getImmediateChild(t),f=i.getChildAfterChild(this.index_,l,this.reverse_);for(;f!=null&&(f.name===t||a.hasChild(f.name));)f=i.getChildAfterChild(this.index_,f,this.reverse_);let g=f==null?1:s(f,c);if(d&&!r.isEmpty()&&g>=0)return o?.trackChildChange(Up(t,r,h)),a.updateImmediateChild(t,r);{o?.trackChildChange(Fp(t,h));let v=a.updateImmediateChild(t,ve.EMPTY_NODE);return f!=null&&this.rangedFilter_.matches(f)?(o?.trackChildChange(Id(f.name,f.node)),v.updateImmediateChild(f.name,f.node)):v}}else return r.isEmpty()?e:d&&s(l,c)>=0?(o!=null&&(o.trackChildChange(Fp(l.name,l.node)),o.trackChildChange(Id(t,r))),a.updateImmediateChild(t,r).updateImmediateChild(l.name,ve.EMPTY_NODE)):e}};var jN=class n{constructor(){this.limitSet_=!1,this.startSet_=!1,this.startNameSet_=!1,this.startAfterSet_=!1,this.endSet_=!1,this.endNameSet_=!1,this.endBeforeSet_=!1,this.limit_=0,this.viewFrom_="",this.indexStartValue_=null,this.indexStartName_="",this.indexEndValue_=null,this.indexEndName_="",this.index_=ht}hasStart(){return this.startSet_}isViewFromLeft(){return this.viewFrom_===""?this.startSet_:this.viewFrom_==="l"}getIndexStartValue(){return q(this.startSet_,"Only valid if start has been set"),this.indexStartValue_}getIndexStartName(){return q(this.startSet_,"Only valid if start has been set"),this.startNameSet_?this.indexStartName_:Yc}hasEnd(){return this.endSet_}getIndexEndValue(){return q(this.endSet_,"Only valid if end has been set"),this.indexEndValue_}getIndexEndName(){return q(this.endSet_,"Only valid if end has been set"),this.endNameSet_?this.indexEndName_:qs}hasLimit(){return this.limitSet_}hasAnchoredLimit(){return this.limitSet_&&this.viewFrom_!==""}getLimit(){return q(this.limitSet_,"Only valid if limit has been set"),this.limit_}getIndex(){return this.index_}loadsAllData(){return!(this.startSet_||this.endSet_||this.limitSet_)}isDefault(){return this.loadsAllData()&&this.index_===ht}copy(){let e=new n;return e.limitSet_=this.limitSet_,e.limit_=this.limit_,e.startSet_=this.startSet_,e.startAfterSet_=this.startAfterSet_,e.indexStartValue_=this.indexStartValue_,e.startNameSet_=this.startNameSet_,e.indexStartName_=this.indexStartName_,e.endSet_=this.endSet_,e.endBeforeSet_=this.endBeforeSet_,e.indexEndValue_=this.indexEndValue_,e.endNameSet_=this.endNameSet_,e.indexEndName_=this.indexEndName_,e.index_=this.index_,e.viewFrom_=this.viewFrom_,e}};function zne(n){return n.loadsAllData()?new Vp(n.getIndex()):n.hasLimit()?new GN(n):new lI(n)}function qne(n,e){let t=n.copy();return t.limitSet_=!0,t.limit_=e,t.viewFrom_="r",t}function Kne(n,e,t){let r=n.copy();return r.startSet_=!0,e===void 0&&(e=null),r.indexStartValue_=e,t!=null?(r.startNameSet_=!0,r.indexStartName_=t):(r.startNameSet_=!1,r.indexStartName_=""),r}function Yne(n,e,t){let r=n.copy();return r.endSet_=!0,e===void 0&&(e=null),r.indexEndValue_=e,t!==void 0?(r.endNameSet_=!0,r.indexEndName_=t):(r.endNameSet_=!1,r.indexEndName_=""),r}function Xne(n,e){let t=n.copy();return t.index_=e,t}function E2(n){let e={};if(n.isDefault())return e;let t;if(n.index_===ht?t="$priority":n.index_===aj?t="$value":n.index_===Kc?t="$key":(q(n.index_ instanceof kp,"Unrecognized index type!"),t=n.index_.toString()),e.orderBy=xt(t),n.startSet_){let r=n.startAfterSet_?"startAfter":"startAt";e[r]=xt(n.indexStartValue_),n.startNameSet_&&(e[r]+=","+xt(n.indexStartName_))}if(n.endSet_){let r=n.endBeforeSet_?"endBefore":"endAt";e[r]=xt(n.indexEndValue_),n.endNameSet_&&(e[r]+=","+xt(n.indexEndName_))}return n.limitSet_&&(n.isViewFromLeft()?e.limitToFirst=n.limit_:e.limitToLast=n.limit_),e}function _2(n){let e={};if(n.startSet_&&(e.sp=n.indexStartValue_,n.startNameSet_&&(e.sn=n.indexStartName_),e.sin=!n.startAfterSet_),n.endSet_&&(e.ep=n.indexEndValue_,n.endNameSet_&&(e.en=n.indexEndName_),e.ein=!n.endBeforeSet_),n.limitSet_){e.l=n.limit_;let t=n.viewFrom_;t===""&&(n.isViewFromLeft()?t="l":t="r"),e.vf=t}return n.index_!==ht&&(e.i=n.index_.toString()),e}var HN=class n extends iI{reportStats(e){throw new Error("Method not implemented.")}static getListenId_(e,t){return t!==void 0?"tag$"+t:(q(e._queryParams.isDefault(),"should have a tag if it's not a default query."),e._path.toString())}constructor(e,t,r,i){super(),this.repoInfo_=e,this.onDataUpdate_=t,this.authTokenProvider_=r,this.appCheckTokenProvider_=i,this.log_=Kp("p:rest:"),this.listens_={}}listen(e,t,r,i){let o=e._path.toString();this.log_("Listen called for "+o+" "+e._queryIdentifier);let s=n.getListenId_(e,r),a={};this.listens_[s]=a;let c=E2(e._queryParams);this.restRequest_(o+".json",c,(l,d)=>{let h=d;if(l===404&&(h=null,l=null),l===null&&this.onDataUpdate_(o,h,!1,r),bs(this.listens_,s)===a){let f;l?l===401?f="permission_denied":f="rest_error:"+l:f="ok",i(f,null)}})}unlisten(e,t){let r=n.getListenId_(e,t);delete this.listens_[r]}get(e){let t=E2(e._queryParams),r=e._path.toString(),i=new sn;return this.restRequest_(r+".json",t,(o,s)=>{let a=s;o===404&&(a=null,o=null),o===null?(this.onDataUpdate_(r,a,!1,null),i.resolve(a)):i.reject(new Error(a))}),i.promise}refreshAuthToken(e){}restRequest_(e,t={},r){return t.format="export",Promise.all([this.authTokenProvider_.getToken(!1),this.appCheckTokenProvider_.getToken(!1)]).then(([i,o])=>{i&&i.accessToken&&(t.auth=i.accessToken),o&&o.token&&(t.ac=o.token);let s=(this.repoInfo_.secure?"https://":"http://")+this.repoInfo_.host+e+"?ns="+this.repoInfo_.namespace+ap(t);this.log_("Sending REST request for "+s);let a=new XMLHttpRequest;a.onreadystatechange=()=>{if(r&&a.readyState===4){this.log_("REST Response for "+s+" received. status:",a.status,"response:",a.responseText);let c=null;if(a.status>=200&&a.status<300){try{c=nd(a.responseText)}catch{Ln("Failed to parse JSON response for "+s+": "+a.responseText)}r(null,c)}else a.status!==401&&a.status!==404&&Ln("Got unsuccessful REST response for "+s+" Status: "+a.status),r(a.status);r=null}},a.open("GET",s,!0),a.send()})}};var $N=class{constructor(){this.rootNode_=ve.EMPTY_NODE}getNode(e){return this.rootNode_.getChild(e)}updateSnapshot(e,t){this.rootNode_=this.rootNode_.updateChild(e,t)}};function uI(){return{value:null,children:new Map}}function Dd(n,e,t){if(we(e))n.value=t,n.children.clear();else if(n.value!==null)n.value=n.value.updateChild(e,t);else{let r=Ne(e);n.children.has(r)||n.children.set(r,uI());let i=n.children.get(r);e=st(e),Dd(i,e,t)}}function WN(n,e){if(we(e))return n.value=null,n.children.clear(),!0;if(n.value!==null){if(n.value.isLeafNode())return!1;{let t=n.value;return n.value=null,t.forEachChild(ht,(r,i)=>{Dd(n,new Ve(r),i)}),WN(n,e)}}else if(n.children.size>0){let t=Ne(e);return e=st(e),n.children.has(t)&&WN(n.children.get(t),e)&&n.children.delete(t),n.children.size===0}else return!0}function zN(n,e,t){n.value!==null?t(e,n.value):Qne(n,(r,i)=>{let o=new Ve(e.toString()+"/"+r);zN(i,o,t)})}function Qne(n,e){n.children.forEach((t,r)=>{e(r,t)})}var qN=class{constructor(e){this.collection_=e,this.last_=null}get(){let e=this.collection_.get(),t=Object.assign({},e);return this.last_&&ln(this.last_,(r,i)=>{t[r]=t[r]-i}),this.last_=e,t}};var T2=10*1e3,Jne=30*1e3,Zne=300*1e3,KN=class{constructor(e,t){this.server_=t,this.statsToReport_={},this.statsListener_=new qN(e);let r=T2+(Jne-T2)*Math.random();bp(this.reportStats_.bind(this),Math.floor(r))}reportStats_(){let e=this.statsListener_.get(),t={},r=!1;ln(e,(i,o)=>{o>0&&Fr(this.statsToReport_,i)&&(t[i]=o,r=!0)}),r&&this.server_.reportStats(t),bp(this.reportStats_.bind(this),Math.floor(Math.random()*2*Zne))}};var Qi=(function(n){return n[n.OVERWRITE=0]="OVERWRITE",n[n.MERGE=1]="MERGE",n[n.ACK_USER_WRITE=2]="ACK_USER_WRITE",n[n.LISTEN_COMPLETE=3]="LISTEN_COMPLETE",n})(Qi||{});function Rw(){return{fromUser:!0,fromServer:!1,queryId:null,tagged:!1}}function Nw(){return{fromUser:!1,fromServer:!0,queryId:null,tagged:!1}}function ww(n){return{fromUser:!1,fromServer:!0,queryId:n,tagged:!0}}var YN=class n{constructor(e,t,r){this.path=e,this.affectedTree=t,this.revert=r,this.type=Qi.ACK_USER_WRITE,this.source=Rw()}operationForChild(e){if(we(this.path)){if(this.affectedTree.value!=null)return q(this.affectedTree.children.isEmpty(),"affectedTree should not have overlapping affected paths."),this;{let t=this.affectedTree.subtree(new Ve(e));return new n(Ue(),t,this.revert)}}else return q(Ne(this.path)===e,"operationForChild called for unrelated child."),new n(st(this.path),this.affectedTree,this.revert)}};var dI=class n{constructor(e,t){this.source=e,this.path=t,this.type=Qi.LISTEN_COMPLETE}operationForChild(e){return we(this.path)?new n(this.source,Ue()):new n(this.source,st(this.path))}};var yd=class n{constructor(e,t,r){this.source=e,this.path=t,this.snap=r,this.type=Qi.OVERWRITE}operationForChild(e){return we(this.path)?new n(this.source,Ue(),this.snap.getImmediateChild(e)):new n(this.source,st(this.path),this.snap)}};var Bp=class n{constructor(e,t,r){this.source=e,this.path=t,this.children=r,this.type=Qi.MERGE}operationForChild(e){if(we(this.path)){let t=this.children.subtree(new Ve(e));return t.isEmpty()?null:t.value?new yd(this.source,Ue(),t.value):new n(this.source,Ue(),t)}else return q(Ne(this.path)===e,"Can't get a merge for a child not on the path of the operation"),new n(this.source,st(this.path),this.children)}toString(){return"Operation("+this.path+": "+this.source.toString()+" merge: "+this.children.toString()+")"}};var Ji=class{constructor(e,t,r){this.node_=e,this.fullyInitialized_=t,this.filtered_=r}isFullyInitialized(){return this.fullyInitialized_}isFiltered(){return this.filtered_}isCompleteForPath(e){if(we(e))return this.isFullyInitialized()&&!this.filtered_;let t=Ne(e);return this.isCompleteForChild(t)}isCompleteForChild(e){return this.isFullyInitialized()&&!this.filtered_||this.node_.hasChild(e)}getNode(){return this.node_}};var XN=class{constructor(e){this.query_=e,this.index_=this.query_._queryParams.getIndex()}};function ere(n,e,t,r){let i=[],o=[];return e.forEach(s=>{s.type==="child_changed"&&n.index_.indexedValueChanged(s.oldSnap,s.snapshotNode)&&o.push(Wne(s.childName,s.snapshotNode))}),wp(n,i,"child_removed",e,r,t),wp(n,i,"child_added",e,r,t),wp(n,i,"child_moved",o,r,t),wp(n,i,"child_changed",e,r,t),wp(n,i,"value",e,r,t),i}function wp(n,e,t,r,i,o){let s=r.filter(a=>a.type===t);s.sort((a,c)=>nre(n,a,c)),s.forEach(a=>{let c=tre(n,a,o);i.forEach(l=>{l.respondsTo(a.type)&&e.push(l.createEvent(c,n.query_))})})}function tre(n,e,t){return e.type==="value"||e.type==="child_removed"||(e.prevName=t.getPredecessorChildName(e.childName,e.snapshotNode,n.index_)),e}function nre(n,e,t){if(e.childName==null||t.childName==null)throw bc("Should only compare child_ events.");let r=new Oe(e.childName,e.snapshotNode),i=new Oe(t.childName,t.snapshotNode);return n.index_.compare(r,i)}function DI(n,e){return{eventCache:n,serverCache:e}}function Mp(n,e,t,r){return DI(new Ji(e,t,r),n.serverCache)}function lj(n,e,t,r){return DI(n.eventCache,new Ji(e,t,r))}function hI(n){return n.eventCache.isFullyInitialized()?n.eventCache.getNode():null}function Xc(n){return n.serverCache.isFullyInitialized()?n.serverCache.getNode():null}var TN,rre=()=>(TN||(TN=new Gr(tne)),TN),$n=class n{static fromObject(e){let t=new n(null);return ln(e,(r,i)=>{t=t.set(new Ve(r),i)}),t}constructor(e,t=rre()){this.value=e,this.children=t}isEmpty(){return this.value===null&&this.children.isEmpty()}findRootMostMatchingPathAndValue(e,t){if(this.value!=null&&t(this.value))return{path:Ue(),value:this.value};if(we(e))return null;{let r=Ne(e),i=this.children.get(r);if(i!==null){let o=i.findRootMostMatchingPathAndValue(st(e),t);return o!=null?{path:St(new Ve(r),o.path),value:o.value}:null}else return null}}findRootMostValueAndPath(e){return this.findRootMostMatchingPathAndValue(e,()=>!0)}subtree(e){if(we(e))return this;{let t=Ne(e),r=this.children.get(t);return r!==null?r.subtree(st(e)):new n(null)}}set(e,t){if(we(e))return new n(t,this.children);{let r=Ne(e),o=(this.children.get(r)||new n(null)).set(st(e),t),s=this.children.insert(r,o);return new n(this.value,s)}}remove(e){if(we(e))return this.children.isEmpty()?new n(null):new n(null,this.children);{let t=Ne(e),r=this.children.get(t);if(r){let i=r.remove(st(e)),o;return i.isEmpty()?o=this.children.remove(t):o=this.children.insert(t,i),this.value===null&&o.isEmpty()?new n(null):new n(this.value,o)}else return this}}get(e){if(we(e))return this.value;{let t=Ne(e),r=this.children.get(t);return r?r.get(st(e)):null}}setTree(e,t){if(we(e))return t;{let r=Ne(e),o=(this.children.get(r)||new n(null)).setTree(st(e),t),s;return o.isEmpty()?s=this.children.remove(r):s=this.children.insert(r,o),new n(this.value,s)}}fold(e){return this.fold_(Ue(),e)}fold_(e,t){let r={};return this.children.inorderTraversal((i,o)=>{r[i]=o.fold_(St(e,i),t)}),t(e,this.value,r)}findOnPath(e,t){return this.findOnPath_(e,Ue(),t)}findOnPath_(e,t,r){let i=this.value?r(t,this.value):!1;if(i)return i;if(we(e))return null;{let o=Ne(e),s=this.children.get(o);return s?s.findOnPath_(st(e),St(t,o),r):null}}foreachOnPath(e,t){return this.foreachOnPath_(e,Ue(),t)}foreachOnPath_(e,t,r){if(we(e))return this;{this.value&&r(t,this.value);let i=Ne(e),o=this.children.get(i);return o?o.foreachOnPath_(st(e),St(t,i),r):new n(null)}}foreach(e){this.foreach_(Ue(),e)}foreach_(e,t){this.children.inorderTraversal((r,i)=>{i.foreach_(St(e,r),t)}),this.value&&t(e,this.value)}foreachChild(e){this.children.inorderTraversal((t,r)=>{r.value&&e(t,r.value)})}};var li=class n{constructor(e){this.writeTree_=e}static empty(){return new n(new $n(null))}};function Lp(n,e,t){if(we(e))return new li(new $n(t));{let r=n.writeTree_.findRootMostValueAndPath(e);if(r!=null){let i=r.path,o=r.value,s=Hn(i,e);return o=o.updateChild(s,t),new li(n.writeTree_.set(i,o))}else{let i=new $n(t),o=n.writeTree_.setTree(e,i);return new li(o)}}}function QN(n,e,t){let r=n;return ln(t,(i,o)=>{r=Lp(r,St(e,i),o)}),r}function I2(n,e){if(we(e))return li.empty();{let t=n.writeTree_.setTree(e,new $n(null));return new li(t)}}function JN(n,e){return nl(n,e)!=null}function nl(n,e){let t=n.writeTree_.findRootMostValueAndPath(e);return t!=null?n.writeTree_.get(t.path).getChild(Hn(t.path,e)):null}function y2(n){let e=[],t=n.writeTree_.value;return t!=null?t.isLeafNode()||t.forEachChild(ht,(r,i)=>{e.push(new Oe(r,i))}):n.writeTree_.children.inorderTraversal((r,i)=>{i.value!=null&&e.push(new Oe(r,i.value))}),e}function Ws(n,e){if(we(e))return n;{let t=nl(n,e);return t!=null?new li(new $n(t)):new li(n.writeTree_.subtree(e))}}function ZN(n){return n.writeTree_.isEmpty()}function vd(n,e){return uj(Ue(),n.writeTree_,e)}function uj(n,e,t){if(e.value!=null)return t.updateChild(n,e.value);{let r=null;return e.children.inorderTraversal((i,o)=>{i===".priority"?(q(o.value!==null,"Priority writes must always be leaf nodes"),r=o.value):t=uj(St(n,i),o,t)}),!t.getChild(n).isEmpty()&&r!==null&&(t=t.updateChild(St(n,".priority"),r)),t}}function RI(n,e){return pj(e,n)}function ire(n,e,t,r,i){q(r>n.lastWriteId,"Stacking an older write on top of newer ones"),i===void 0&&(i=!0),n.allWrites.push({path:e,snap:t,writeId:r,visible:i}),i&&(n.visibleWrites=Lp(n.visibleWrites,e,t)),n.lastWriteId=r}function ore(n,e,t,r){q(r>n.lastWriteId,"Stacking an older merge on top of newer ones"),n.allWrites.push({path:e,children:t,writeId:r,visible:!0}),n.visibleWrites=QN(n.visibleWrites,e,t),n.lastWriteId=r}function sre(n,e){for(let t=0;t<n.allWrites.length;t++){let r=n.allWrites[t];if(r.writeId===e)return r}return null}function are(n,e){let t=n.allWrites.findIndex(a=>a.writeId===e);q(t>=0,"removeWrite called with nonexistent writeId.");let r=n.allWrites[t];n.allWrites.splice(t,1);let i=r.visible,o=!1,s=n.allWrites.length-1;for(;i&&s>=0;){let a=n.allWrites[s];a.visible&&(s>=t&&cre(a,r.path)?i=!1:Br(r.path,a.path)&&(o=!0)),s--}if(i){if(o)return lre(n),!0;if(r.snap)n.visibleWrites=I2(n.visibleWrites,r.path);else{let a=r.children;ln(a,c=>{n.visibleWrites=I2(n.visibleWrites,St(r.path,c))})}return!0}else return!1}function cre(n,e){if(n.snap)return Br(n.path,e);for(let t in n.children)if(n.children.hasOwnProperty(t)&&Br(St(n.path,t),e))return!0;return!1}function lre(n){n.visibleWrites=dj(n.allWrites,ure,Ue()),n.allWrites.length>0?n.lastWriteId=n.allWrites[n.allWrites.length-1].writeId:n.lastWriteId=-1}function ure(n){return n.visible}function dj(n,e,t){let r=li.empty();for(let i=0;i<n.length;++i){let o=n[i];if(e(o)){let s=o.path,a;if(o.snap)Br(t,s)?(a=Hn(t,s),r=Lp(r,a,o.snap)):Br(s,t)&&(a=Hn(s,t),r=Lp(r,Ue(),o.snap.getChild(a)));else if(o.children){if(Br(t,s))a=Hn(t,s),r=QN(r,a,o.children);else if(Br(s,t))if(a=Hn(s,t),we(a))r=QN(r,Ue(),o.children);else{let c=bs(o.children,Ne(a));if(c){let l=c.getChild(st(a));r=Lp(r,Ue(),l)}}}else throw bc("WriteRecord should have .snap or .children")}}return r}function hj(n,e,t,r,i){if(!r&&!i){let o=nl(n.visibleWrites,e);if(o!=null)return o;{let s=Ws(n.visibleWrites,e);if(ZN(s))return t;if(t==null&&!JN(s,Ue()))return null;{let a=t||ve.EMPTY_NODE;return vd(s,a)}}}else{let o=Ws(n.visibleWrites,e);if(!i&&ZN(o))return t;if(!i&&t==null&&!JN(o,Ue()))return null;{let s=function(l){return(l.visible||i)&&(!r||!~r.indexOf(l.writeId))&&(Br(l.path,e)||Br(e,l.path))},a=dj(n.allWrites,s,e),c=t||ve.EMPTY_NODE;return vd(a,c)}}}function dre(n,e,t){let r=ve.EMPTY_NODE,i=nl(n.visibleWrites,e);if(i)return i.isLeafNode()||i.forEachChild(ht,(o,s)=>{r=r.updateImmediateChild(o,s)}),r;if(t){let o=Ws(n.visibleWrites,e);return t.forEachChild(ht,(s,a)=>{let c=vd(Ws(o,new Ve(s)),a);r=r.updateImmediateChild(s,c)}),y2(o).forEach(s=>{r=r.updateImmediateChild(s.name,s.node)}),r}else{let o=Ws(n.visibleWrites,e);return y2(o).forEach(s=>{r=r.updateImmediateChild(s.name,s.node)}),r}}function hre(n,e,t,r,i){q(r||i,"Either existingEventSnap or existingServerSnap must exist");let o=St(e,t);if(JN(n.visibleWrites,o))return null;{let s=Ws(n.visibleWrites,o);return ZN(s)?i.getChild(t):vd(s,i.getChild(t))}}function fre(n,e,t,r){let i=St(e,t),o=nl(n.visibleWrites,i);if(o!=null)return o;if(r.isCompleteForChild(t)){let s=Ws(n.visibleWrites,i);return vd(s,r.getNode().getImmediateChild(t))}else return null}function pre(n,e){return nl(n.visibleWrites,e)}function gre(n,e,t,r,i,o,s){let a,c=Ws(n.visibleWrites,e),l=nl(c,Ue());if(l!=null)a=l;else if(t!=null)a=vd(c,t);else return[];if(a=a.withIndex(s),!a.isEmpty()&&!a.isLeafNode()){let d=[],h=s.getCompare(),f=o?a.getReverseIteratorFrom(r,s):a.getIteratorFrom(r,s),g=f.getNext();for(;g&&d.length<i;)h(g,r)!==0&&d.push(g),g=f.getNext();return d}else return[]}function mre(){return{visibleWrites:li.empty(),allWrites:[],lastWriteId:-1}}function fI(n,e,t,r){return hj(n.writeTree,n.treePath,e,t,r)}function bw(n,e){return dre(n.writeTree,n.treePath,e)}function v2(n,e,t,r){return hre(n.writeTree,n.treePath,e,t,r)}function pI(n,e){return pre(n.writeTree,St(n.treePath,e))}function Ere(n,e,t,r,i,o){return gre(n.writeTree,n.treePath,e,t,r,i,o)}function Ow(n,e,t){return fre(n.writeTree,n.treePath,e,t)}function fj(n,e){return pj(St(n.treePath,e),n.writeTree)}function pj(n,e){return{treePath:n,writeTree:e}}var ew=class{constructor(){this.changeMap=new Map}trackChildChange(e){let t=e.type,r=e.childName;q(t==="child_added"||t==="child_changed"||t==="child_removed","Only child changes supported for tracking"),q(r!==".priority","Only non-priority child changes can be tracked.");let i=this.changeMap.get(r);if(i){let o=i.type;if(t==="child_added"&&o==="child_removed")this.changeMap.set(r,Up(r,e.snapshotNode,i.snapshotNode));else if(t==="child_removed"&&o==="child_added")this.changeMap.delete(r);else if(t==="child_removed"&&o==="child_changed")this.changeMap.set(r,Fp(r,i.oldSnap));else if(t==="child_changed"&&o==="child_added")this.changeMap.set(r,Id(r,e.snapshotNode));else if(t==="child_changed"&&o==="child_changed")this.changeMap.set(r,Up(r,e.snapshotNode,i.oldSnap));else throw bc("Illegal combination of changes: "+e+" occurred after "+i)}else this.changeMap.set(r,e)}getChanges(){return Array.from(this.changeMap.values())}};var tw=class{getCompleteChild(e){return null}getChildAfterChild(e,t,r){return null}},gj=new tw,Gp=class{constructor(e,t,r=null){this.writes_=e,this.viewCache_=t,this.optCompleteServerCache_=r}getCompleteChild(e){let t=this.viewCache_.eventCache;if(t.isCompleteForChild(e))return t.getNode().getImmediateChild(e);{let r=this.optCompleteServerCache_!=null?new Ji(this.optCompleteServerCache_,!0,!1):this.viewCache_.serverCache;return Ow(this.writes_,e,r)}}getChildAfterChild(e,t,r){let i=this.optCompleteServerCache_!=null?this.optCompleteServerCache_:Xc(this.viewCache_),o=Ere(this.writes_,i,t,1,r,e);return o.length===0?null:o[0]}};function _re(n){return{filter:n}}function Tre(n,e){q(e.eventCache.getNode().isIndexed(n.filter.getIndex()),"Event snap not indexed"),q(e.serverCache.getNode().isIndexed(n.filter.getIndex()),"Server snap not indexed")}function Ire(n,e,t,r,i){let o=new ew,s,a;if(t.type===Qi.OVERWRITE){let l=t;l.source.fromUser?s=nw(n,e,l.path,l.snap,r,i,o):(q(l.source.fromServer,"Unknown source."),a=l.source.tagged||e.serverCache.isFiltered()&&!we(l.path),s=gI(n,e,l.path,l.snap,r,i,a,o))}else if(t.type===Qi.MERGE){let l=t;l.source.fromUser?s=vre(n,e,l.path,l.children,r,i,o):(q(l.source.fromServer,"Unknown source."),a=l.source.tagged||e.serverCache.isFiltered(),s=rw(n,e,l.path,l.children,r,i,a,o))}else if(t.type===Qi.ACK_USER_WRITE){let l=t;l.revert?s=Cre(n,e,l.path,r,i,o):s=Sre(n,e,l.path,l.affectedTree,r,i,o)}else if(t.type===Qi.LISTEN_COMPLETE)s=Are(n,e,t.path,r,o);else throw bc("Unknown operation type: "+t.type);let c=o.getChanges();return yre(e,s,c),{viewCache:s,changes:c}}function yre(n,e,t){let r=e.eventCache;if(r.isFullyInitialized()){let i=r.getNode().isLeafNode()||r.getNode().isEmpty(),o=hI(n);(t.length>0||!n.eventCache.isFullyInitialized()||i&&!r.getNode().equals(o)||!r.getNode().getPriority().equals(o.getPriority()))&&t.push(cj(hI(e)))}}function mj(n,e,t,r,i,o){let s=e.eventCache;if(pI(r,t)!=null)return e;{let a,c;if(we(t))if(q(e.serverCache.isFullyInitialized(),"If change path is empty, we must have complete server data"),e.serverCache.isFiltered()){let l=Xc(e),d=l instanceof ve?l:ve.EMPTY_NODE,h=bw(r,d);a=n.filter.updateFullNode(e.eventCache.getNode(),h,o)}else{let l=fI(r,Xc(e));a=n.filter.updateFullNode(e.eventCache.getNode(),l,o)}else{let l=Ne(t);if(l===".priority"){q(Ks(t)===1,"Can't have a priority with additional path components");let d=s.getNode();c=e.serverCache.getNode();let h=v2(r,t,d,c);h!=null?a=n.filter.updatePriority(d,h):a=s.getNode()}else{let d=st(t),h;if(s.isCompleteForChild(l)){c=e.serverCache.getNode();let f=v2(r,t,s.getNode(),c);f!=null?h=s.getNode().getImmediateChild(l).updateChild(d,f):h=s.getNode().getImmediateChild(l)}else h=Ow(r,l,e.serverCache);h!=null?a=n.filter.updateChild(s.getNode(),l,h,d,i,o):a=s.getNode()}}return Mp(e,a,s.isFullyInitialized()||we(t),n.filter.filtersNodes())}}function gI(n,e,t,r,i,o,s,a){let c=e.serverCache,l,d=s?n.filter:n.filter.getIndexedFilter();if(we(t))l=d.updateFullNode(c.getNode(),r,null);else if(d.filtersNodes()&&!c.isFiltered()){let g=c.getNode().updateChild(t,r);l=d.updateFullNode(c.getNode(),g,null)}else{let g=Ne(t);if(!c.isCompleteForPath(t)&&Ks(t)>1)return e;let E=st(t),S=c.getNode().getImmediateChild(g).updateChild(E,r);g===".priority"?l=d.updatePriority(c.getNode(),S):l=d.updateChild(c.getNode(),g,S,E,gj,null)}let h=lj(e,l,c.isFullyInitialized()||we(t),d.filtersNodes()),f=new Gp(i,h,o);return mj(n,h,t,i,f,a)}function nw(n,e,t,r,i,o,s){let a=e.eventCache,c,l,d=new Gp(i,e,o);if(we(t))l=n.filter.updateFullNode(e.eventCache.getNode(),r,s),c=Mp(e,l,!0,n.filter.filtersNodes());else{let h=Ne(t);if(h===".priority")l=n.filter.updatePriority(e.eventCache.getNode(),r),c=Mp(e,l,a.isFullyInitialized(),a.isFiltered());else{let f=st(t),g=a.getNode().getImmediateChild(h),E;if(we(f))E=r;else{let v=d.getCompleteChild(h);v!=null?Sw(f)===".priority"&&v.getChild(tj(f)).isEmpty()?E=v:E=v.updateChild(f,r):E=ve.EMPTY_NODE}if(g.equals(E))c=e;else{let v=n.filter.updateChild(a.getNode(),h,E,f,d,s);c=Mp(e,v,a.isFullyInitialized(),n.filter.filtersNodes())}}}return c}function S2(n,e){return n.eventCache.isCompleteForChild(e)}function vre(n,e,t,r,i,o,s){let a=e;return r.foreach((c,l)=>{let d=St(t,c);S2(e,Ne(d))&&(a=nw(n,a,d,l,i,o,s))}),r.foreach((c,l)=>{let d=St(t,c);S2(e,Ne(d))||(a=nw(n,a,d,l,i,o,s))}),a}function A2(n,e,t){return t.foreach((r,i)=>{e=e.updateChild(r,i)}),e}function rw(n,e,t,r,i,o,s,a){if(e.serverCache.getNode().isEmpty()&&!e.serverCache.isFullyInitialized())return e;let c=e,l;we(t)?l=r:l=new $n(null).setTree(t,r);let d=e.serverCache.getNode();return l.children.inorderTraversal((h,f)=>{if(d.hasChild(h)){let g=e.serverCache.getNode().getImmediateChild(h),E=A2(n,g,f);c=gI(n,c,new Ve(h),E,i,o,s,a)}}),l.children.inorderTraversal((h,f)=>{let g=!e.serverCache.isCompleteForChild(h)&&f.value===null;if(!d.hasChild(h)&&!g){let E=e.serverCache.getNode().getImmediateChild(h),v=A2(n,E,f);c=gI(n,c,new Ve(h),v,i,o,s,a)}}),c}function Sre(n,e,t,r,i,o,s){if(pI(i,t)!=null)return e;let a=e.serverCache.isFiltered(),c=e.serverCache;if(r.value!=null){if(we(t)&&c.isFullyInitialized()||c.isCompleteForPath(t))return gI(n,e,t,c.getNode().getChild(t),i,o,a,s);if(we(t)){let l=new $n(null);return c.getNode().forEachChild(Kc,(d,h)=>{l=l.set(new Ve(d),h)}),rw(n,e,t,l,i,o,a,s)}else return e}else{let l=new $n(null);return r.foreach((d,h)=>{let f=St(t,d);c.isCompleteForPath(f)&&(l=l.set(d,c.getNode().getChild(f)))}),rw(n,e,t,l,i,o,a,s)}}function Are(n,e,t,r,i){let o=e.serverCache,s=lj(e,o.getNode(),o.isFullyInitialized()||we(t),o.isFiltered());return mj(n,s,t,r,gj,i)}function Cre(n,e,t,r,i,o){let s;if(pI(r,t)!=null)return e;{let a=new Gp(r,e,i),c=e.eventCache.getNode(),l;if(we(t)||Ne(t)===".priority"){let d;if(e.serverCache.isFullyInitialized())d=fI(r,Xc(e));else{let h=e.serverCache.getNode();q(h instanceof ve,"serverChildren would be complete if leaf node"),d=bw(r,h)}d=d,l=n.filter.updateFullNode(c,d,o)}else{let d=Ne(t),h=Ow(r,d,e.serverCache);h==null&&e.serverCache.isCompleteForChild(d)&&(h=c.getImmediateChild(d)),h!=null?l=n.filter.updateChild(c,d,h,st(t),a,o):e.eventCache.getNode().hasChild(d)?l=n.filter.updateChild(c,d,ve.EMPTY_NODE,st(t),a,o):l=c,l.isEmpty()&&e.serverCache.isFullyInitialized()&&(s=fI(r,Xc(e)),s.isLeafNode()&&(l=n.filter.updateFullNode(l,s,o)))}return s=e.serverCache.isFullyInitialized()||pI(r,Ue())!=null,Mp(e,l,s,n.filter.filtersNodes())}}var iw=class{constructor(e,t){this.query_=e,this.eventRegistrations_=[];let r=this.query_._queryParams,i=new Vp(r.getIndex()),o=zne(r);this.processor_=_re(o);let s=t.serverCache,a=t.eventCache,c=i.updateFullNode(ve.EMPTY_NODE,s.getNode(),null),l=o.updateFullNode(ve.EMPTY_NODE,a.getNode(),null),d=new Ji(c,s.isFullyInitialized(),i.filtersNodes()),h=new Ji(l,a.isFullyInitialized(),o.filtersNodes());this.viewCache_=DI(h,d),this.eventGenerator_=new XN(this.query_)}get query(){return this.query_}};function Dre(n){return n.viewCache_.serverCache.getNode()}function Rre(n){return hI(n.viewCache_)}function Nre(n,e){let t=Xc(n.viewCache_);return t&&(n.query._queryParams.loadsAllData()||!we(e)&&!t.getImmediateChild(Ne(e)).isEmpty())?t.getChild(e):null}function C2(n){return n.eventRegistrations_.length===0}function wre(n,e){n.eventRegistrations_.push(e)}function D2(n,e,t){let r=[];if(t){q(e==null,"A cancel should cancel all event registrations.");let i=n.query._path;n.eventRegistrations_.forEach(o=>{let s=o.createCancelEvent(t,i);s&&r.push(s)})}if(e){let i=[];for(let o=0;o<n.eventRegistrations_.length;++o){let s=n.eventRegistrations_[o];if(!s.matches(e))i.push(s);else if(e.hasAnyCallback()){i=i.concat(n.eventRegistrations_.slice(o+1));break}}n.eventRegistrations_=i}else n.eventRegistrations_=[];return r}function R2(n,e,t,r){e.type===Qi.MERGE&&e.source.queryId!==null&&(q(Xc(n.viewCache_),"We should always have a full cache before handling merges"),q(hI(n.viewCache_),"Missing event cache, even though we have a server cache"));let i=n.viewCache_,o=Ire(n.processor_,i,e,t,r);return Tre(n.processor_,o.viewCache),q(o.viewCache.serverCache.isFullyInitialized()||!i.serverCache.isFullyInitialized(),"Once a server snap is complete, it should never go back"),n.viewCache_=o.viewCache,Ej(n,o.changes,o.viewCache.eventCache.getNode(),null)}function bre(n,e){let t=n.viewCache_.eventCache,r=[];return t.getNode().isLeafNode()||t.getNode().forEachChild(ht,(o,s)=>{r.push(Id(o,s))}),t.isFullyInitialized()&&r.push(cj(t.getNode())),Ej(n,r,t.getNode(),e)}function Ej(n,e,t,r){let i=r?[r]:n.eventRegistrations_;return ere(n.eventGenerator_,e,t,i)}var mI,EI=class{constructor(){this.views=new Map}};function Ore(n){q(!mI,"__referenceConstructor has already been defined"),mI=n}function Mre(){return q(mI,"Reference.ts has not been loaded"),mI}function Lre(n){return n.views.size===0}function Mw(n,e,t,r){let i=e.source.queryId;if(i!==null){let o=n.views.get(i);return q(o!=null,"SyncTree gave us an op for an invalid query."),R2(o,e,t,r)}else{let o=[];for(let s of n.views.values())o=o.concat(R2(s,e,t,r));return o}}function _j(n,e,t,r,i){let o=e._queryIdentifier,s=n.views.get(o);if(!s){let a=fI(t,i?r:null),c=!1;a?c=!0:r instanceof ve?(a=bw(t,r),c=!1):(a=ve.EMPTY_NODE,c=!1);let l=DI(new Ji(a,c,!1),new Ji(r,i,!1));return new iw(e,l)}return s}function Pre(n,e,t,r,i,o){let s=_j(n,e,r,i,o);return n.views.has(e._queryIdentifier)||n.views.set(e._queryIdentifier,s),wre(s,t),bre(s,t)}function xre(n,e,t,r){let i=e._queryIdentifier,o=[],s=[],a=Ys(n);if(i==="default")for(let[c,l]of n.views.entries())s=s.concat(D2(l,t,r)),C2(l)&&(n.views.delete(c),l.query._queryParams.loadsAllData()||o.push(l.query));else{let c=n.views.get(i);c&&(s=s.concat(D2(c,t,r)),C2(c)&&(n.views.delete(i),c.query._queryParams.loadsAllData()||o.push(c.query)))}return a&&!Ys(n)&&o.push(new(Mre())(e._repo,e._path)),{removed:o,events:s}}function Tj(n){let e=[];for(let t of n.views.values())t.query._queryParams.loadsAllData()||e.push(t);return e}function zs(n,e){let t=null;for(let r of n.views.values())t=t||Nre(r,e);return t}function Ij(n,e){if(e._queryParams.loadsAllData())return NI(n);{let r=e._queryIdentifier;return n.views.get(r)}}function yj(n,e){return Ij(n,e)!=null}function Ys(n){return NI(n)!=null}function NI(n){for(let e of n.views.values())if(e.query._queryParams.loadsAllData())return e;return null}var _I;function kre(n){q(!_I,"__referenceConstructor has already been defined"),_I=n}function Fre(){return q(_I,"Reference.ts has not been loaded"),_I}var Ure=1,TI=class{constructor(e){this.listenProvider_=e,this.syncPointTree_=new $n(null),this.pendingWriteTree_=mre(),this.tagToQueryMap=new Map,this.queryToTagMap=new Map}};function Lw(n,e,t,r,i){return ire(n.pendingWriteTree_,e,t,r,i),i?Rd(n,new yd(Rw(),e,t)):[]}function Vre(n,e,t,r){ore(n.pendingWriteTree_,e,t,r);let i=$n.fromObject(t);return Rd(n,new Bp(Rw(),e,i))}function Hs(n,e,t=!1){let r=sre(n.pendingWriteTree_,e);if(are(n.pendingWriteTree_,e)){let o=new $n(null);return r.snap!=null?o=o.set(Ue(),!0):ln(r.children,s=>{o=o.set(new Ve(s),!0)}),Rd(n,new YN(r.path,o,t))}else return[]}function Xp(n,e,t){return Rd(n,new yd(Nw(),e,t))}function Bre(n,e,t){let r=$n.fromObject(t);return Rd(n,new Bp(Nw(),e,r))}function Gre(n,e){return Rd(n,new dI(Nw(),e))}function jre(n,e,t){let r=Pw(n,t);if(r){let i=xw(r),o=i.path,s=i.queryId,a=Hn(o,e),c=new dI(ww(s),a);return kw(n,o,c)}else return[]}function II(n,e,t,r,i=!1){let o=e._path,s=n.syncPointTree_.get(o),a=[];if(s&&(e._queryIdentifier==="default"||yj(s,e))){let c=xre(s,e,t,r);Lre(s)&&(n.syncPointTree_=n.syncPointTree_.remove(o));let l=c.removed;if(a=c.events,!i){let d=l.findIndex(f=>f._queryParams.loadsAllData())!==-1,h=n.syncPointTree_.findOnPath(o,(f,g)=>Ys(g));if(d&&!h){let f=n.syncPointTree_.subtree(o);if(!f.isEmpty()){let g=Wre(f);for(let E=0;E<g.length;++E){let v=g[E],S=v.query,P=Cj(n,v);n.listenProvider_.startListening(Pp(S),jp(n,S),P.hashFn,P.onComplete)}}}!h&&l.length>0&&!r&&(d?n.listenProvider_.stopListening(Pp(e),null):l.forEach(f=>{let g=n.queryToTagMap.get(bI(f));n.listenProvider_.stopListening(Pp(f),g)}))}zre(n,l)}return a}function vj(n,e,t,r){let i=Pw(n,r);if(i!=null){let o=xw(i),s=o.path,a=o.queryId,c=Hn(s,e),l=new yd(ww(a),c,t);return kw(n,s,l)}else return[]}function Hre(n,e,t,r){let i=Pw(n,r);if(i){let o=xw(i),s=o.path,a=o.queryId,c=Hn(s,e),l=$n.fromObject(t),d=new Bp(ww(a),c,l);return kw(n,s,d)}else return[]}function ow(n,e,t,r=!1){let i=e._path,o=null,s=!1;n.syncPointTree_.foreachOnPath(i,(f,g)=>{let E=Hn(f,i);o=o||zs(g,E),s=s||Ys(g)});let a=n.syncPointTree_.get(i);a?(s=s||Ys(a),o=o||zs(a,Ue())):(a=new EI,n.syncPointTree_=n.syncPointTree_.set(i,a));let c;o!=null?c=!0:(c=!1,o=ve.EMPTY_NODE,n.syncPointTree_.subtree(i).foreachChild((g,E)=>{let v=zs(E,Ue());v&&(o=o.updateImmediateChild(g,v))}));let l=yj(a,e);if(!l&&!e._queryParams.loadsAllData()){let f=bI(e);q(!n.queryToTagMap.has(f),"View does not exist, but we have a tag");let g=qre();n.queryToTagMap.set(f,g),n.tagToQueryMap.set(g,f)}let d=RI(n.pendingWriteTree_,i),h=Pre(a,e,t,d,o,c);if(!l&&!s&&!r){let f=Ij(a,e);h=h.concat(Kre(n,e,f))}return h}function wI(n,e,t){let i=n.pendingWriteTree_,o=n.syncPointTree_.findOnPath(e,(s,a)=>{let c=Hn(s,e),l=zs(a,c);if(l)return l});return hj(i,e,o,t,!0)}function $re(n,e){let t=e._path,r=null;n.syncPointTree_.foreachOnPath(t,(l,d)=>{let h=Hn(l,t);r=r||zs(d,h)});let i=n.syncPointTree_.get(t);i?r=r||zs(i,Ue()):(i=new EI,n.syncPointTree_=n.syncPointTree_.set(t,i));let o=r!=null,s=o?new Ji(r,!0,!1):null,a=RI(n.pendingWriteTree_,e._path),c=_j(i,e,a,o?s.getNode():ve.EMPTY_NODE,o);return Rre(c)}function Rd(n,e){return Sj(e,n.syncPointTree_,null,RI(n.pendingWriteTree_,Ue()))}function Sj(n,e,t,r){if(we(n.path))return Aj(n,e,t,r);{let i=e.get(Ue());t==null&&i!=null&&(t=zs(i,Ue()));let o=[],s=Ne(n.path),a=n.operationForChild(s),c=e.children.get(s);if(c&&a){let l=t?t.getImmediateChild(s):null,d=fj(r,s);o=o.concat(Sj(a,c,l,d))}return i&&(o=o.concat(Mw(i,n,r,t))),o}}function Aj(n,e,t,r){let i=e.get(Ue());t==null&&i!=null&&(t=zs(i,Ue()));let o=[];return e.children.inorderTraversal((s,a)=>{let c=t?t.getImmediateChild(s):null,l=fj(r,s),d=n.operationForChild(s);d&&(o=o.concat(Aj(d,a,c,l)))}),i&&(o=o.concat(Mw(i,n,r,t))),o}function Cj(n,e){let t=e.query,r=jp(n,t);return{hashFn:()=>(Dre(e)||ve.EMPTY_NODE).hash(),onComplete:i=>{if(i==="ok")return r?jre(n,t._path,r):Gre(n,t._path);{let o=ine(i,t);return II(n,t,null,o)}}}}function jp(n,e){let t=bI(e);return n.queryToTagMap.get(t)}function bI(n){return n._path.toString()+"$"+n._queryIdentifier}function Pw(n,e){return n.tagToQueryMap.get(e)}function xw(n){let e=n.indexOf("$");return q(e!==-1&&e<n.length-1,"Bad queryKey."),{queryId:n.substr(e+1),path:new Ve(n.substr(0,e))}}function kw(n,e,t){let r=n.syncPointTree_.get(e);q(r,"Missing sync point for query tag that we're tracking");let i=RI(n.pendingWriteTree_,e);return Mw(r,t,i,null)}function Wre(n){return n.fold((e,t,r)=>{if(t&&Ys(t))return[NI(t)];{let i=[];return t&&(i=Tj(t)),ln(r,(o,s)=>{i=i.concat(s)}),i}})}function Pp(n){return n._queryParams.loadsAllData()&&!n._queryParams.isDefault()?new(Fre())(n._repo,n._path):n}function zre(n,e){for(let t=0;t<e.length;++t){let r=e[t];if(!r._queryParams.loadsAllData()){let i=bI(r),o=n.queryToTagMap.get(i);n.queryToTagMap.delete(i),n.tagToQueryMap.delete(o)}}}function qre(){return Ure++}function Kre(n,e,t){let r=e._path,i=jp(n,e),o=Cj(n,t),s=n.listenProvider_.startListening(Pp(e),i,o.hashFn,o.onComplete),a=n.syncPointTree_.subtree(r);if(i)q(!Ys(a.value),"If we're adding a query, it shouldn't be shadowed");else{let c=a.fold((l,d,h)=>{if(!we(l)&&d&&Ys(d))return[NI(d).query];{let f=[];return d&&(f=f.concat(Tj(d).map(g=>g.query))),ln(h,(g,E)=>{f=f.concat(E)}),f}});for(let l=0;l<c.length;++l){let d=c[l];n.listenProvider_.stopListening(Pp(d),jp(n,d))}}return s}var sw=class n{constructor(e){this.node_=e}getImmediateChild(e){let t=this.node_.getImmediateChild(e);return new n(t)}node(){return this.node_}},aw=class n{constructor(e,t){this.syncTree_=e,this.path_=t}getImmediateChild(e){let t=St(this.path_,e);return new n(this.syncTree_,t)}node(){return wI(this.syncTree_,this.path_)}},Yre=function(n){return n=n||{},n.timestamp=n.timestamp||new Date().getTime(),n},N2=function(n,e,t){if(!n||typeof n!="object")return n;if(q(".sv"in n,"Unexpected leaf node or priority contents"),typeof n[".sv"]=="string")return Xre(n[".sv"],e,t);if(typeof n[".sv"]=="object")return Qre(n[".sv"],e);q(!1,"Unexpected server value: "+JSON.stringify(n,null,2))},Xre=function(n,e,t){if(n==="timestamp")return t.timestamp;q(!1,"Unexpected server value: "+n)},Qre=function(n,e,t){n.hasOwnProperty("increment")||q(!1,"Unexpected server value: "+JSON.stringify(n,null,2));let r=n.increment;typeof r!="number"&&q(!1,"Unexpected increment value: "+r);let i=e.node();if(q(i!==null&&typeof i<"u","Expected ChildrenNode.EMPTY_NODE for nulls"),!i.isLeafNode())return r;let s=i.getValue();return typeof s!="number"?r:s+r},Dj=function(n,e,t,r){return Uw(e,new aw(t,n),r)},Fw=function(n,e,t){return Uw(n,new sw(e),t)};function Uw(n,e,t){let r=n.getPriority().val(),i=N2(r,e.getImmediateChild(".priority"),t),o;if(n.isLeafNode()){let s=n,a=N2(s.getValue(),e,t);return a!==s.getValue()||i!==s.getPriority().val()?new _d(a,vt(i)):n}else{let s=n;return o=s,i!==s.getPriority().val()&&(o=o.updatePriority(new _d(i))),s.forEachChild(ht,(a,c)=>{let l=Uw(c,e.getImmediateChild(a),t);l!==c&&(o=o.updateImmediateChild(a,l))}),o}}var Hp=class{constructor(e="",t=null,r={children:{},childCount:0}){this.name=e,this.parent=t,this.node=r}};function OI(n,e){let t=e instanceof Ve?e:new Ve(e),r=n,i=Ne(t);for(;i!==null;){let o=bs(r.node.children,i)||{children:{},childCount:0};r=new Hp(i,r,o),t=st(t),i=Ne(t)}return r}function rl(n){return n.node.value}function Vw(n,e){n.node.value=e,cw(n)}function Rj(n){return n.node.childCount>0}function Jre(n){return rl(n)===void 0&&!Rj(n)}function MI(n,e){ln(n.node.children,(t,r)=>{e(new Hp(t,n,r))})}function Nj(n,e,t,r){t&&!r&&e(n),MI(n,i=>{Nj(i,e,!0,r)}),t&&r&&e(n)}function Zre(n,e,t){let r=t?n:n.parent;for(;r!==null;){if(e(r))return!0;r=r.parent}return!1}function Qp(n){return new Ve(n.parent===null?n.name:Qp(n.parent)+"/"+n.name)}function cw(n){n.parent!==null&&eie(n.parent,n.name,n)}function eie(n,e,t){let r=Jre(t),i=Fr(n.node.children,e);r&&i?(delete n.node.children[e],n.node.childCount--,cw(n)):!r&&!i&&(n.node.children[e]=t.node,n.node.childCount++,cw(n))}var tie=/[\[\].#$\/\u0000-\u001F\u007F]/,nie=/[\[\].#$\u0000-\u001F\u007F]/,IN=10*1024*1024,LI=function(n){return typeof n=="string"&&n.length!==0&&!tie.test(n)},wj=function(n){return typeof n=="string"&&n.length!==0&&!nie.test(n)},rie=function(n){return n&&(n=n.replace(/^\/*\.info(\/|$)/,"/")),wj(n)},$p=function(n){return n===null||typeof n=="string"||typeof n=="number"&&!CI(n)||n&&typeof n=="object"&&Fr(n,".sv")},Qc=function(n,e,t,r){r&&e===void 0||Jp(Os(n,"value"),e,t)},Jp=function(n,e,t){let r=t instanceof Ve?new LN(t,n):t;if(e===void 0)throw new Error(n+"contains undefined "+Wc(r));if(typeof e=="function")throw new Error(n+"contains a function "+Wc(r)+" with contents = "+e.toString());if(CI(e))throw new Error(n+"contains "+e.toString()+" "+Wc(r));if(typeof e=="string"&&e.length>IN/3&&cp(e)>IN)throw new Error(n+"contains a string greater than "+IN+" utf8 bytes "+Wc(r)+" ('"+e.substring(0,50)+"...')");if(e&&typeof e=="object"){let i=!1,o=!1;if(ln(e,(s,a)=>{if(s===".value")i=!0;else if(s!==".priority"&&s!==".sv"&&(o=!0,!LI(s)))throw new Error(n+" contains an invalid key ("+s+") "+Wc(r)+`. Keys must be non-empty strings and can't contain ".", "#", "$", "/", "[", or "]"`);Lne(r,s),Jp(n,a,r),Pne(r)}),i&&o)throw new Error(n+' contains ".value" child '+Wc(r)+" in addition to actual children.")}},iie=function(n,e){let t,r;for(t=0;t<e.length;t++){r=e[t];let o=xp(r);for(let s=0;s<o.length;s++)if(!(o[s]===".priority"&&s===o.length-1)){if(!LI(o[s]))throw new Error(n+"contains an invalid key ("+o[s]+") in path "+r.toString()+`. Keys must be non-empty strings and can't contain ".", "#", "$", "/", "[", or "]"`)}}e.sort(Mne);let i=null;for(t=0;t<e.length;t++){if(r=e[t],i!==null&&Br(i,r))throw new Error(n+"contains a path "+i.toString()+" that is ancestor of another path "+r.toString());i=r}},bj=function(n,e,t,r){if(r&&e===void 0)return;let i=Os(n,"values");if(!(e&&typeof e=="object")||Array.isArray(e))throw new Error(i+" must be an object containing the children to replace.");let o=[];ln(e,(s,a)=>{let c=new Ve(s);if(Jp(i,a,St(t,c)),Sw(c)===".priority"&&!$p(a))throw new Error(i+"contains an invalid value for '"+c.toString()+"', which must be a valid Firebase priority (a string, finite number, server value, or null).");o.push(c)}),iie(i,o)},oie=function(n,e,t){if(!(t&&e===void 0)){if(CI(e))throw new Error(Os(n,"priority")+"is "+e.toString()+", but must be a valid Firebase priority (a string, finite number, server value, or null).");if(!$p(e))throw new Error(Os(n,"priority")+"must be a valid Firebase priority (a string, finite number, server value, or null).")}},Oj=function(n,e,t,r){if(!(r&&t===void 0)&&!LI(t))throw new Error(Os(n,e)+'was an invalid key = "'+t+`". Firebase keys must be non-empty strings and can't contain ".", "#", "$", "/", "[", or "]").`)},Bw=function(n,e,t,r){if(!(r&&t===void 0)&&!wj(t))throw new Error(Os(n,e)+'was an invalid path = "'+t+`". Paths must be non-empty strings and can't contain ".", "#", "$", "[", or "]"`)},sie=function(n,e,t,r){t&&(t=t.replace(/^\/*\.info(\/|$)/,"/")),Bw(n,e,t,r)},$s=function(n,e){if(Ne(e)===".info")throw new Error(n+" failed = Can't modify data under /.info/")},aie=function(n,e){let t=e.path.toString();if(typeof e.repoInfo.host!="string"||e.repoInfo.host.length===0||!LI(e.repoInfo.namespace)&&e.repoInfo.host.split(":")[0]!=="localhost"||t.length!==0&&!rie(t))throw new Error(Os(n,"url")+`must be a valid firebase URL and the path can't contain ".", "#", "$", "[", or "]".`)};var lw=class{constructor(){this.eventLists_=[],this.recursionDepth_=0}};function PI(n,e){let t=null;for(let r=0;r<e.length;r++){let i=e[r],o=i.getPath();t!==null&&!Aw(o,t.path)&&(n.eventLists_.push(t),t=null),t===null&&(t={events:[],path:o}),t.events.push(i)}t&&n.eventLists_.push(t)}function Mj(n,e,t){PI(n,t),Lj(n,r=>Aw(r,e))}function Ir(n,e,t){PI(n,t),Lj(n,r=>Br(r,e)||Br(e,r))}function Lj(n,e){n.recursionDepth_++;let t=!0;for(let r=0;r<n.eventLists_.length;r++){let i=n.eventLists_[r];if(i){let o=i.path;e(o)?(cie(n.eventLists_[r]),n.eventLists_[r]=null):t=!1}}t&&(n.eventLists_=[]),n.recursionDepth_--}function cie(n){for(let e=0;e<n.events.length;e++){let t=n.events[e];if(t!==null){n.events[e]=null;let r=t.getEventRunner();qc&&cn("event: "+t.toString()),Cd(r)}}}var lie="repo_interrupt",uie=25,uw=class{constructor(e,t,r,i){this.repoInfo_=e,this.forceRestClient_=t,this.authTokenProvider_=r,this.appCheckProvider_=i,this.dataUpdateCount=0,this.statsListener_=null,this.eventQueue_=new lw,this.nextWriteId_=1,this.interceptServerDataCallback_=null,this.onDisconnect_=uI(),this.transactionQueueTree_=new Hp,this.persistentConnection_=null,this.key=this.repoInfo_.toURLString()}toString(){return(this.repoInfo_.secure?"https://":"http://")+this.repoInfo_.host}};function die(n,e,t){if(n.stats_=vw(n.repoInfo_),n.forceRestClient_||cne())n.server_=new HN(n.repoInfo_,(r,i,o,s)=>{w2(n,r,i,o,s)},n.authTokenProvider_,n.appCheckProvider_),setTimeout(()=>b2(n,!0),0);else{if(typeof t<"u"&&t!==null){if(typeof t!="object")throw new Error("Only objects are supported for option databaseAuthVariableOverride");try{xt(t)}catch(r){throw new Error("Invalid authOverride provided: "+r)}}n.persistentConnection_=new Cw(n.repoInfo_,e,(r,i,o,s)=>{w2(n,r,i,o,s)},r=>{b2(n,r)},r=>{hie(n,r)},n.authTokenProvider_,n.appCheckProvider_,t),n.server_=n.persistentConnection_}n.authTokenProvider_.addTokenChangeListener(r=>{n.server_.refreshAuthToken(r)}),n.appCheckProvider_.addTokenChangeListener(r=>{n.server_.refreshAppCheckToken(r.token)}),n.statsReporter_=une(n.repoInfo_,()=>new KN(n.stats_,n.server_)),n.infoData_=new $N,n.infoSyncTree_=new TI({startListening:(r,i,o,s)=>{let a=[],c=n.infoData_.getNode(r._path);return c.isEmpty()||(a=Xp(n.infoSyncTree_,r._path,c),setTimeout(()=>{s("ok")},0)),a},stopListening:()=>{}}),Gw(n,"connected",!1),n.serverSyncTree_=new TI({startListening:(r,i,o,s)=>(n.server_.listen(r,o,i,(a,c)=>{let l=s(a,c);Ir(n.eventQueue_,r._path,l)}),[]),stopListening:(r,i)=>{n.server_.unlisten(r,i)}})}function Pj(n){let t=n.infoData_.getNode(new Ve(".info/serverTimeOffset")).val()||0;return new Date().getTime()+t}function Zp(n){return Yre({timestamp:Pj(n)})}function w2(n,e,t,r,i){n.dataUpdateCount++;let o=new Ve(e);t=n.interceptServerDataCallback_?n.interceptServerDataCallback_(e,t):t;let s=[];if(i)if(r){let c=sp(t,l=>vt(l));s=Hre(n.serverSyncTree_,o,c,i)}else{let c=vt(t);s=vj(n.serverSyncTree_,o,c,i)}else if(r){let c=sp(t,l=>vt(l));s=Bre(n.serverSyncTree_,o,c)}else{let c=vt(t);s=Xp(n.serverSyncTree_,o,c)}let a=o;s.length>0&&(a=Sd(n,o)),Ir(n.eventQueue_,a,s)}function b2(n,e){Gw(n,"connected",e),e===!1&&mie(n)}function hie(n,e){ln(e,(t,r)=>{Gw(n,t,r)})}function Gw(n,e,t){let r=new Ve("/.info/"+e),i=vt(t);n.infoData_.updateSnapshot(r,i);let o=Xp(n.infoSyncTree_,r,i);Ir(n.eventQueue_,r,o)}function xI(n){return n.nextWriteId_++}function fie(n,e,t){let r=$re(n.serverSyncTree_,e);return r!=null?Promise.resolve(r):n.server_.get(e).then(i=>{let o=vt(i).withIndex(e._queryParams.getIndex());ow(n.serverSyncTree_,e,t,!0);let s;if(e._queryParams.loadsAllData())s=Xp(n.serverSyncTree_,e._path,o);else{let a=jp(n.serverSyncTree_,e);s=vj(n.serverSyncTree_,e._path,o,a)}return Ir(n.eventQueue_,e._path,s),II(n.serverSyncTree_,e,t,null,!0),o},i=>(Nd(n,"get for query "+xt(e)+" failed: "+i),Promise.reject(new Error(i))))}function pie(n,e,t,r,i){Nd(n,"set",{path:e.toString(),value:t,priority:r});let o=Zp(n),s=vt(t,r),a=wI(n.serverSyncTree_,e),c=Fw(s,a,o),l=xI(n),d=Lw(n.serverSyncTree_,e,c,l,!0);PI(n.eventQueue_,d),n.server_.put(e.toString(),s.val(!0),(f,g)=>{let E=f==="ok";E||Ln("set at "+e+" failed: "+f);let v=Hs(n.serverSyncTree_,l,!E);Ir(n.eventQueue_,e,v),Xs(n,i,f,g)});let h=Hw(n,e);Sd(n,h),Ir(n.eventQueue_,h,[])}function gie(n,e,t,r){Nd(n,"update",{path:e.toString(),value:t});let i=!0,o=Zp(n),s={};if(ln(t,(a,c)=>{i=!1,s[a]=Dj(St(e,a),vt(c),n.serverSyncTree_,o)}),i)cn("update() called with empty data. Don't do anything."),Xs(n,r,"ok",void 0);else{let a=xI(n),c=Vre(n.serverSyncTree_,e,s,a);PI(n.eventQueue_,c),n.server_.merge(e.toString(),t,(l,d)=>{let h=l==="ok";h||Ln("update at "+e+" failed: "+l);let f=Hs(n.serverSyncTree_,a,!h),g=f.length>0?Sd(n,e):e;Ir(n.eventQueue_,g,f),Xs(n,r,l,d)}),ln(t,l=>{let d=Hw(n,St(e,l));Sd(n,d)}),Ir(n.eventQueue_,e,[])}}function mie(n){Nd(n,"onDisconnectEvents");let e=Zp(n),t=uI();zN(n.onDisconnect_,Ue(),(i,o)=>{let s=Dj(i,o,n.serverSyncTree_,e);Dd(t,i,s)});let r=[];zN(t,Ue(),(i,o)=>{r=r.concat(Xp(n.serverSyncTree_,i,o));let s=Hw(n,i);Sd(n,s)}),n.onDisconnect_=uI(),Ir(n.eventQueue_,Ue(),r)}function Eie(n,e,t){n.server_.onDisconnectCancel(e.toString(),(r,i)=>{r==="ok"&&WN(n.onDisconnect_,e),Xs(n,t,r,i)})}function O2(n,e,t,r){let i=vt(t);n.server_.onDisconnectPut(e.toString(),i.val(!0),(o,s)=>{o==="ok"&&Dd(n.onDisconnect_,e,i),Xs(n,r,o,s)})}function _ie(n,e,t,r,i){let o=vt(t,r);n.server_.onDisconnectPut(e.toString(),o.val(!0),(s,a)=>{s==="ok"&&Dd(n.onDisconnect_,e,o),Xs(n,i,s,a)})}function Tie(n,e,t,r){if(op(t)){cn("onDisconnect().update() called with empty data. Don't do anything."),Xs(n,r,"ok",void 0);return}n.server_.onDisconnectMerge(e.toString(),t,(i,o)=>{i==="ok"&&ln(t,(s,a)=>{let c=vt(a);Dd(n.onDisconnect_,St(e,s),c)}),Xs(n,r,i,o)})}function Iie(n,e,t){let r;Ne(e._path)===".info"?r=ow(n.infoSyncTree_,e,t):r=ow(n.serverSyncTree_,e,t),Mj(n.eventQueue_,e._path,r)}function dw(n,e,t){let r;Ne(e._path)===".info"?r=II(n.infoSyncTree_,e,t):r=II(n.serverSyncTree_,e,t),Mj(n.eventQueue_,e._path,r)}function yie(n){n.persistentConnection_&&n.persistentConnection_.interrupt(lie)}function Nd(n,...e){let t="";n.persistentConnection_&&(t=n.persistentConnection_.id+":"),cn(t,...e)}function Xs(n,e,t,r){e&&Cd(()=>{if(t==="ok")e(null);else{let i=(t||"error").toUpperCase(),o=i;r&&(o+=": "+r);let s=new Error(o);s.code=i,e(s)}})}function vie(n,e,t,r,i,o){Nd(n,"transaction on "+e);let s={path:e,update:t,onComplete:r,status:null,order:x2(),applyLocally:o,retryCount:0,unwatcher:i,abortReason:null,currentWriteId:null,currentInputSnapshot:null,currentOutputSnapshotRaw:null,currentOutputSnapshotResolved:null},a=jw(n,e,void 0);s.currentInputSnapshot=a;let c=s.update(a.val());if(c===void 0)s.unwatcher(),s.currentOutputSnapshotRaw=null,s.currentOutputSnapshotResolved=null,s.onComplete&&s.onComplete(null,!1,s.currentInputSnapshot);else{Jp("transaction failed: Data returned ",c,s.path),s.status=0;let l=OI(n.transactionQueueTree_,e),d=rl(l)||[];d.push(s),Vw(l,d);let h;typeof c=="object"&&c!==null&&Fr(c,".priority")?(h=bs(c,".priority"),q($p(h),"Invalid priority returned by transaction. Priority must be a valid string, finite number, server value, or null.")):h=(wI(n.serverSyncTree_,e)||ve.EMPTY_NODE).getPriority().val();let f=Zp(n),g=vt(c,h),E=Fw(g,a,f);s.currentOutputSnapshotRaw=g,s.currentOutputSnapshotResolved=E,s.currentWriteId=xI(n);let v=Lw(n.serverSyncTree_,e,E,s.currentWriteId,s.applyLocally);Ir(n.eventQueue_,e,v),kI(n,n.transactionQueueTree_)}}function jw(n,e,t){return wI(n.serverSyncTree_,e,t)||ve.EMPTY_NODE}function kI(n,e=n.transactionQueueTree_){if(e||FI(n,e),rl(e)){let t=kj(n,e);q(t.length>0,"Sending zero length transaction queue"),t.every(i=>i.status===0)&&Sie(n,Qp(e),t)}else Rj(e)&&MI(e,t=>{kI(n,t)})}function Sie(n,e,t){let r=t.map(l=>l.currentWriteId),i=jw(n,e,r),o=i,s=i.hash();for(let l=0;l<t.length;l++){let d=t[l];q(d.status===0,"tryToSendTransactionQueue_: items in queue should all be run."),d.status=1,d.retryCount++;let h=Hn(e,d.path);o=o.updateChild(h,d.currentOutputSnapshotRaw)}let a=o.val(!0),c=e;n.server_.put(c.toString(),a,l=>{Nd(n,"transaction put response",{path:c.toString(),status:l});let d=[];if(l==="ok"){let h=[];for(let f=0;f<t.length;f++)t[f].status=2,d=d.concat(Hs(n.serverSyncTree_,t[f].currentWriteId)),t[f].onComplete&&h.push(()=>t[f].onComplete(null,!0,t[f].currentOutputSnapshotResolved)),t[f].unwatcher();FI(n,OI(n.transactionQueueTree_,e)),kI(n,n.transactionQueueTree_),Ir(n.eventQueue_,e,d);for(let f=0;f<h.length;f++)Cd(h[f])}else{if(l==="datastale")for(let h=0;h<t.length;h++)t[h].status===3?t[h].status=4:t[h].status=0;else{Ln("transaction at "+c.toString()+" failed: "+l);for(let h=0;h<t.length;h++)t[h].status=4,t[h].abortReason=l}Sd(n,e)}},s)}function Sd(n,e){let t=xj(n,e),r=Qp(t),i=kj(n,t);return Aie(n,i,r),r}function Aie(n,e,t){if(e.length===0)return;let r=[],i=[],s=e.filter(a=>a.status===0).map(a=>a.currentWriteId);for(let a=0;a<e.length;a++){let c=e[a],l=Hn(t,c.path),d=!1,h;if(q(l!==null,"rerunTransactionsUnderNode_: relativePath should not be null."),c.status===4)d=!0,h=c.abortReason,i=i.concat(Hs(n.serverSyncTree_,c.currentWriteId,!0));else if(c.status===0)if(c.retryCount>=uie)d=!0,h="maxretry",i=i.concat(Hs(n.serverSyncTree_,c.currentWriteId,!0));else{let f=jw(n,c.path,s);c.currentInputSnapshot=f;let g=e[a].update(f.val());if(g!==void 0){Jp("transaction failed: Data returned ",g,c.path);let E=vt(g);typeof g=="object"&&g!=null&&Fr(g,".priority")||(E=E.updatePriority(f.getPriority()));let S=c.currentWriteId,P=Zp(n),V=Fw(E,f,P);c.currentOutputSnapshotRaw=E,c.currentOutputSnapshotResolved=V,c.currentWriteId=xI(n),s.splice(s.indexOf(S),1),i=i.concat(Lw(n.serverSyncTree_,c.path,V,c.currentWriteId,c.applyLocally)),i=i.concat(Hs(n.serverSyncTree_,S,!0))}else d=!0,h="nodata",i=i.concat(Hs(n.serverSyncTree_,c.currentWriteId,!0))}Ir(n.eventQueue_,t,i),i=[],d&&(e[a].status=2,(function(f){setTimeout(f,Math.floor(0))})(e[a].unwatcher),e[a].onComplete&&(h==="nodata"?r.push(()=>e[a].onComplete(null,!1,e[a].currentInputSnapshot)):r.push(()=>e[a].onComplete(new Error(h),!1,null))))}FI(n,n.transactionQueueTree_);for(let a=0;a<r.length;a++)Cd(r[a]);kI(n,n.transactionQueueTree_)}function xj(n,e){let t,r=n.transactionQueueTree_;for(t=Ne(e);t!==null&&rl(r)===void 0;)r=OI(r,t),e=st(e),t=Ne(e);return r}function kj(n,e){let t=[];return Fj(n,e,t),t.sort((r,i)=>r.order-i.order),t}function Fj(n,e,t){let r=rl(e);if(r)for(let i=0;i<r.length;i++)t.push(r[i]);MI(e,i=>{Fj(n,i,t)})}function FI(n,e){let t=rl(e);if(t){let r=0;for(let i=0;i<t.length;i++)t[i].status!==2&&(t[r]=t[i],r++);t.length=r,Vw(e,t.length>0?t:void 0)}MI(e,r=>{FI(n,r)})}function Hw(n,e){let t=Qp(xj(n,e)),r=OI(n.transactionQueueTree_,e);return Zre(r,i=>{yN(n,i)}),yN(n,r),Nj(r,i=>{yN(n,i)}),t}function yN(n,e){let t=rl(e);if(t){let r=[],i=[],o=-1;for(let s=0;s<t.length;s++)t[s].status===3||(t[s].status===1?(q(o===s-1,"All SENT items should be at beginning of queue."),o=s,t[s].status=3,t[s].abortReason="set"):(q(t[s].status===0,"Unexpected transaction status in abort"),t[s].unwatcher(),i=i.concat(Hs(n.serverSyncTree_,t[s].currentWriteId,!0)),t[s].onComplete&&r.push(t[s].onComplete.bind(null,new Error("set"),!1,null))));o===-1?Vw(e,void 0):t.length=o+1,Ir(n.eventQueue_,Qp(e),i);for(let s=0;s<r.length;s++)Cd(r[s])}}function Cie(n){let e="",t=n.split("/");for(let r=0;r<t.length;r++)if(t[r].length>0){let i=t[r];try{i=decodeURIComponent(i.replace(/\+/g," "))}catch{}e+="/"+i}return e}function Die(n){let e={};n.charAt(0)==="?"&&(n=n.substring(1));for(let t of n.split("&")){if(t.length===0)continue;let r=t.split("=");r.length===2?e[decodeURIComponent(r[0])]=decodeURIComponent(r[1]):Ln(`Invalid query segment '${t}' in query '${n}'`)}return e}var M2=function(n,e){let t=Rie(n),r=t.namespace;t.domain==="firebase.com"&&Go(t.host+" is no longer supported. Please use <YOUR FIREBASE>.firebaseio.com instead"),(!r||r==="undefined")&&t.domain!=="localhost"&&Go("Cannot parse Firebase url. Please use https://<YOUR FIREBASE>.firebaseio.com"),t.secure||Zte();let i=t.scheme==="ws"||t.scheme==="wss";return{repoInfo:new tI(t.host,t.secure,r,i,e,"",r!==t.subdomain),path:new Ve(t.pathString)}},Rie=function(n){let e="",t="",r="",i="",o="",s=!0,a="https",c=443;if(typeof n=="string"){let l=n.indexOf("//");l>=0&&(a=n.substring(0,l-1),n=n.substring(l+2));let d=n.indexOf("/");d===-1&&(d=n.length);let h=n.indexOf("?");h===-1&&(h=n.length),e=n.substring(0,Math.min(d,h)),d<h&&(i=Cie(n.substring(d,h)));let f=Die(n.substring(Math.min(n.length,h)));l=e.indexOf(":"),l>=0?(s=a==="https"||a==="wss",c=parseInt(e.substring(l+1),10)):l=e.length;let g=e.slice(0,l);if(g.toLowerCase()==="localhost")t="localhost";else if(g.split(".").length<=2)t=g;else{let E=e.indexOf(".");r=e.substring(0,E).toLowerCase(),t=e.substring(E+1),o=r}"ns"in f&&(o=f.ns)}return{host:e,port:c,domain:t,subdomain:r,secure:s,scheme:a,pathString:i,namespace:o}};var L2="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz",Nie=(function(){let n=0,e=[];return function(t){let r=t===n;n=t;let i,o=new Array(8);for(i=7;i>=0;i--)o[i]=L2.charAt(t%64),t=Math.floor(t/64);q(t===0,"Cannot push at time == 0");let s=o.join("");if(r){for(i=11;i>=0&&e[i]===63;i--)e[i]=0;e[i]++}else for(i=0;i<12;i++)e[i]=Math.floor(Math.random()*64);for(i=0;i<12;i++)s+=L2.charAt(e[i]);return q(s.length===20,"nextPushId: Length should be 20."),s}})();var yI=class{constructor(e,t,r,i){this.eventType=e,this.eventRegistration=t,this.snapshot=r,this.prevName=i}getPath(){let e=this.snapshot.ref;return this.eventType==="value"?e._path:e.parent._path}getEventType(){return this.eventType}getEventRunner(){return this.eventRegistration.getEventRunner(this)}toString(){return this.getPath().toString()+":"+this.eventType+":"+xt(this.snapshot.exportVal())}},vI=class{constructor(e,t,r){this.eventRegistration=e,this.error=t,this.path=r}getPath(){return this.path}getEventType(){return"cancel"}getEventRunner(){return this.eventRegistration.getEventRunner(this)}toString(){return this.path.toString()+":cancel"}};var Wp=class{constructor(e,t){this.snapshotCallback=e,this.cancelCallback=t}onValue(e,t){this.snapshotCallback.call(null,e,t)}onCancel(e){return q(this.hasCancelCallback,"Raising a cancel event on a listener with no cancel callback"),this.cancelCallback.call(null,e)}get hasCancelCallback(){return!!this.cancelCallback}matches(e){return this.snapshotCallback===e.snapshotCallback||this.snapshotCallback.userCallback!==void 0&&this.snapshotCallback.userCallback===e.snapshotCallback.userCallback&&this.snapshotCallback.context===e.snapshotCallback.context}};var hw=class{constructor(e,t){this._repo=e,this._path=t}cancel(){let e=new sn;return Eie(this._repo,this._path,e.wrapCallback(()=>{})),e.promise}remove(){$s("OnDisconnect.remove",this._path);let e=new sn;return O2(this._repo,this._path,null,e.wrapCallback(()=>{})),e.promise}set(e){$s("OnDisconnect.set",this._path),Qc("OnDisconnect.set",e,this._path,!1);let t=new sn;return O2(this._repo,this._path,e,t.wrapCallback(()=>{})),t.promise}setWithPriority(e,t){$s("OnDisconnect.setWithPriority",this._path),Qc("OnDisconnect.setWithPriority",e,this._path,!1),oie("OnDisconnect.setWithPriority",t,!1);let r=new sn;return _ie(this._repo,this._path,e,t,r.wrapCallback(()=>{})),r.promise}update(e){$s("OnDisconnect.update",this._path),bj("OnDisconnect.update",e,this._path,!1);let t=new sn;return Tie(this._repo,this._path,e,t.wrapCallback(()=>{})),t.promise}};var Jc=class n{constructor(e,t,r,i){this._repo=e,this._path=t,this._queryParams=r,this._orderByCalled=i}get key(){return we(this._path)?null:Sw(this._path)}get ref(){return new ui(this._repo,this._path)}get _queryIdentifier(){let e=_2(this._queryParams),t=yw(e);return t==="{}"?"default":t}get _queryObject(){return _2(this._queryParams)}isEqual(e){if(e=Me(e),!(e instanceof n))return!1;let t=this._repo===e._repo,r=Aw(this._path,e._path),i=this._queryIdentifier===e._queryIdentifier;return t&&r&&i}toJSON(){return this.toString()}toString(){return this._repo.toString()+One(this._path)}};function wie(n,e){if(n._orderByCalled===!0)throw new Error(e+": You can't combine multiple orderBy calls.")}function $w(n){let e=null,t=null;if(n.hasStart()&&(e=n.getIndexStartValue()),n.hasEnd()&&(t=n.getIndexEndValue()),n.getIndex()===Kc){let r="Query: When ordering by key, you may only pass one argument to startAt(), endAt(), or equalTo().",i="Query: When ordering by key, the argument passed to startAt(), startAfter(), endAt(), endBefore(), or equalTo() must be a string.";if(n.hasStart()){if(n.getIndexStartName()!==Yc)throw new Error(r);if(typeof e!="string")throw new Error(i)}if(n.hasEnd()){if(n.getIndexEndName()!==qs)throw new Error(r);if(typeof t!="string")throw new Error(i)}}else if(n.getIndex()===ht){if(e!=null&&!$p(e)||t!=null&&!$p(t))throw new Error("Query: When ordering by priority, the first argument passed to startAt(), startAfter() endAt(), endBefore(), or equalTo() must be a valid priority value (null, a number, or a string).")}else if(q(n.getIndex()instanceof kp||n.getIndex()===aj,"unknown index type."),e!=null&&typeof e=="object"||t!=null&&typeof t=="object")throw new Error("Query: First argument passed to startAt(), startAfter(), endAt(), endBefore(), or equalTo() cannot be an object.")}function Uj(n){if(n.hasStart()&&n.hasEnd()&&n.hasLimit()&&!n.hasAnchoredLimit())throw new Error("Query: Can't combine startAt(), startAfter(), endAt(), endBefore(), and limit(). Use limitToFirst() or limitToLast() instead.")}var ui=class n extends Jc{constructor(e,t){super(e,t,new jN,!1)}get parent(){let e=tj(this._path);return e===null?null:new n(this._repo,e)}get root(){let e=this;for(;e.parent!==null;)e=e.parent;return e}},Ad=class n{constructor(e,t,r){this._node=e,this.ref=t,this._index=r}get priority(){return this._node.getPriority().val()}get key(){return this.ref.key}get size(){return this._node.numChildren()}child(e){let t=new Ve(e),r=Zc(this.ref,e);return new n(this._node.getChild(t),r,ht)}exists(){return!this._node.isEmpty()}exportVal(){return this._node.val(!0)}forEach(e){return this._node.isLeafNode()?!1:!!this._node.forEachChild(this._index,(r,i)=>e(new n(i,Zc(this.ref,r),ht)))}hasChild(e){let t=new Ve(e);return!this._node.getChild(t).isEmpty()}hasChildren(){return this._node.isLeafNode()?!1:!this._node.isEmpty()}toJSON(){return this.exportVal()}val(){return this._node.val()}};function Vj(n,e){return n=Me(n),n._checkNotDeleted("ref"),e!==void 0?Zc(n._root,e):n._root}function Zc(n,e){return n=Me(n),Ne(n._path)===null?sie("child","path",e,!1):Bw("child","path",e,!1),new ui(n._repo,St(n._path,e))}function Bj(n){return n=Me(n),new hw(n._repo,n._path)}function Gj(n,e){n=Me(n),$s("push",n._path),Qc("push",e,n._path,!0);let t=Pj(n._repo),r=Nie(t),i=Zc(n,r),o=Zc(n,r),s;return e!=null?s=UI(o,e).then(()=>o):s=Promise.resolve(o),i.then=s.then.bind(s),i.catch=s.then.bind(s,void 0),i}function jj(n){return $s("remove",n._path),UI(n,null)}function UI(n,e){n=Me(n),$s("set",n._path),Qc("set",e,n._path,!1);let t=new sn;return pie(n._repo,n._path,e,null,t.wrapCallback(()=>{})),t.promise}function Hj(n,e){bj("update",e,n._path,!1);let t=new sn;return gie(n._repo,n._path,e,t.wrapCallback(()=>{})),t.promise}function VI(n){n=Me(n);let e=new Wp(()=>{}),t=new zp(e);return fie(n._repo,n,t).then(r=>new Ad(r,new ui(n._repo,n._path),n._queryParams.getIndex()))}var zp=class n{constructor(e){this.callbackContext=e}respondsTo(e){return e==="value"}createEvent(e,t){let r=t._queryParams.getIndex();return new yI("value",this,new Ad(e.snapshotNode,new ui(t._repo,t._path),r))}getEventRunner(e){return e.getEventType()==="cancel"?()=>this.callbackContext.onCancel(e.error):()=>this.callbackContext.onValue(e.snapshot,null)}createCancelEvent(e,t){return this.callbackContext.hasCancelCallback?new vI(this,e,t):null}matches(e){return e instanceof n?!e.callbackContext||!this.callbackContext?!0:e.callbackContext.matches(this.callbackContext):!1}hasAnyCallback(){return this.callbackContext!==null}},SI=class n{constructor(e,t){this.eventType=e,this.callbackContext=t}respondsTo(e){let t=e==="children_added"?"child_added":e;return t=t==="children_removed"?"child_removed":t,this.eventType===t}createCancelEvent(e,t){return this.callbackContext.hasCancelCallback?new vI(this,e,t):null}createEvent(e,t){q(e.childName!=null,"Child events should have a childName.");let r=Zc(new ui(t._repo,t._path),e.childName),i=t._queryParams.getIndex();return new yI(e.type,this,new Ad(e.snapshotNode,r,i),e.prevName)}getEventRunner(e){return e.getEventType()==="cancel"?()=>this.callbackContext.onCancel(e.error):()=>this.callbackContext.onValue(e.snapshot,e.prevName)}matches(e){return e instanceof n?this.eventType===e.eventType&&(!this.callbackContext||!e.callbackContext||this.callbackContext.matches(e.callbackContext)):!1}hasAnyCallback(){return!!this.callbackContext}};function eg(n,e,t,r,i){let o;if(typeof r=="object"&&(o=void 0,i=r),typeof r=="function"&&(o=r),i&&i.onlyOnce){let c=t,l=(d,h)=>{dw(n._repo,n,a),c(d,h)};l.userCallback=t.userCallback,l.context=t.context,t=l}let s=new Wp(t,o||void 0),a=e==="value"?new zp(s):new SI(e,s);return Iie(n._repo,n,a),()=>dw(n._repo,n,a)}function tg(n,e,t,r){return eg(n,"value",e,t,r)}function BI(n,e,t,r){return eg(n,"child_added",e,t,r)}function GI(n,e,t,r){return eg(n,"child_changed",e,t,r)}function Ww(n,e,t,r){return eg(n,"child_moved",e,t,r)}function jI(n,e,t,r){return eg(n,"child_removed",e,t,r)}function HI(n,e,t){let r=null,i=t?new Wp(t):null;e==="value"?r=new zp(i):e&&(r=new SI(e,i)),dw(n._repo,n,r)}var el=class{},fw=class extends el{constructor(e,t){super(),this._value=e,this._key=t,this.type="endAt"}_apply(e){Qc("endAt",this._value,e._path,!0);let t=Yne(e._queryParams,this._value,this._key);if(Uj(t),$w(t),e._queryParams.hasEnd())throw new Error("endAt: Starting point was already set (by another call to endAt, endBefore or equalTo).");return new Jc(e._repo,e._path,t,e._orderByCalled)}};var AI=class extends el{constructor(e,t){super(),this._value=e,this._key=t,this.type="startAt"}_apply(e){Qc("startAt",this._value,e._path,!0);let t=Kne(e._queryParams,this._value,this._key);if(Uj(t),$w(t),e._queryParams.hasStart())throw new Error("startAt: Starting point was already set (by another call to startAt, startBefore or equalTo).");return new Jc(e._repo,e._path,t,e._orderByCalled)}};function $j(n=null,e){return Oj("startAt","key",e,!0),new AI(n,e)}var pw=class extends el{constructor(e){super(),this._limit=e,this.type="limitToLast"}_apply(e){if(e._queryParams.hasLimit())throw new Error("limitToLast: Limit was already set (by another call to limitToFirst or limitToLast).");return new Jc(e._repo,e._path,qne(e._queryParams,this._limit),e._orderByCalled)}};function Wj(n){if(typeof n!="number"||Math.floor(n)!==n||n<=0)throw new Error("limitToLast: First argument must be a positive integer.");return new pw(n)}var gw=class extends el{constructor(e){super(),this._path=e,this.type="orderByChild"}_apply(e){wie(e,"orderByChild");let t=new Ve(this._path);if(we(t))throw new Error("orderByChild: cannot pass in empty path. Use orderByValue() instead.");let r=new kp(t),i=Xne(e._queryParams,r);return $w(i),new Jc(e._repo,e._path,i,!0)}};function zj(n){if(n==="$key")throw new Error('orderByChild: "$key" is invalid. Use orderByKey() instead.');if(n==="$priority")throw new Error('orderByChild: "$priority" is invalid. Use orderByPriority() instead.');if(n==="$value")throw new Error('orderByChild: "$value" is invalid. Use orderByValue() instead.');return Bw("orderByChild","path",n,!1),new gw(n)}var mw=class extends el{constructor(e,t){super(),this._value=e,this._key=t,this.type="equalTo"}_apply(e){if(Qc("equalTo",this._value,e._path,!1),e._queryParams.hasStart())throw new Error("equalTo: Starting point was already set (by another call to startAt/startAfter or equalTo).");if(e._queryParams.hasEnd())throw new Error("equalTo: Ending point was already set (by another call to endAt/endBefore or equalTo).");return new fw(this._value,this._key)._apply(new AI(this._value,this._key)._apply(e))}};function qj(n,e){return Oj("equalTo","key",e,!0),new mw(n,e)}function Kj(n,...e){let t=Me(n);for(let r of e)t=r._apply(t);return t}Ore(ui);kre(ui);var bie="FIREBASE_DATABASE_EMULATOR_HOST",Ew={},Oie=!1;function Mie(n,e,t,r){let i=e.lastIndexOf(":"),o=e.substring(0,i),s=mr(o);n.repoInfo_=new tI(e,s,n.repoInfo_.namespace,n.repoInfo_.webSocketOnly,n.repoInfo_.nodeAdmin,n.repoInfo_.persistenceKey,n.repoInfo_.includeNamespaceInQueryParams,!0,t),r&&(n.authTokenProvider_=r)}function Lie(n,e,t,r,i){let o=r||n.options.databaseURL;o===void 0&&(n.options.projectId||Go("Can't determine Firebase Database URL. Be sure to include a Project ID when calling firebase.initializeApp()."),cn("Using default host for project ",n.options.projectId),o=`${n.options.projectId}-default-rtdb.firebaseio.com`);let s=M2(o,i),a=s.repoInfo,c,l;typeof process<"u"&&process.env&&(l=process.env[bie]),l?(c=!0,o=`http://${l}?ns=${a.namespace}`,s=M2(o,i),a=s.repoInfo):c=!s.repoInfo.secure;let d=i&&c?new Op(Op.OWNER):new RN(n.name,n.options,e);aie("Invalid Firebase Database URL",s),we(s.path)||Go("Database URL must point to the root of a Firebase Database (not including a child path).");let h=xie(a,n,d,new DN(n,t));return new _w(h,n)}function Pie(n,e){let t=Ew[e];(!t||t[n.key]!==n)&&Go(`Database ${e}(${n.repoInfo_}) has already been deleted.`),yie(n),delete t[n.key]}function xie(n,e,t,r){let i=Ew[e.name];i||(i={},Ew[e.name]=i);let o=i[n.toURLString()];return o&&Go("Database initialized multiple times. Please make sure the format of the database URL matches with each database() call."),o=new uw(n,Oie,t,r),i[n.toURLString()]=o,o}var _w=class{constructor(e,t){this._repoInternal=e,this.app=t,this.type="database",this._instanceStarted=!1}get _repo(){return this._instanceStarted||(die(this._repoInternal,this.app.options.appId,this.app.options.databaseAuthVariableOverride),this._instanceStarted=!0),this._repoInternal}get _root(){return this._rootInternal||(this._rootInternal=new ui(this._repo,Ue())),this._rootInternal}_delete(){return this._rootInternal!==null&&(Pie(this._repo,this.app.name),this._repoInternal=null,this._rootInternal=null),Promise.resolve()}_checkNotDeleted(e){this._rootInternal===null&&Go("Cannot call "+e+" on a deleted database.")}};function kie(){ej.IS_TRANSPORT_INITIALIZED&&Ln("Transport has already been initialized. Please call this function before calling ref or setting up a listener")}function zw(){kie(),pd.forceDisallow(),nI.forceAllow()}function wd(n=Jn(),e){let t=Ki(n,"database").getImmediate({identifier:e});if(!t._instanceStarted){let r=id("database");r&&Yj(t,...r)}return t}function Yj(n,e,t,r={}){n=Me(n),n._checkNotDeleted("useEmulator");let i=`${e}:${t}`,o=n._repoInternal;if(n._instanceStarted){if(i===n._repoInternal.repoInfo_.host&&ri(r,o.repoInfo_.emulatorOptions))return;Go("connectDatabaseEmulator() cannot initialize or alter the emulator configuration after the database instance has started.")}let s;if(o.repoInfo_.nodeAdmin)r.mockUserToken&&Go('mockUserToken is not supported by the Admin SDK. For client access with mock users, please use the "firebase" package instead of "firebase-admin".'),s=new Op(Op.OWNER);else if(r.mockUserToken){let a=typeof r.mockUserToken=="string"?r.mockUserToken:vT(r.mockUserToken,n.app.options.projectId);s=new Op(a)}mr(e)&&(ws(e),Oc("Database",!0)),Mie(o,i,r,s)}function Fie(n){Qte(Ls),jn(new Yt("database",(e,{instanceIdentifier:t})=>{let r=e.getProvider("app").getImmediate(),i=e.getProvider("auth-internal"),o=e.getProvider("app-check-internal");return Lie(r,i,o,t)},"PUBLIC").setMultipleInstances(!0)),Be(t2,n2,n),Be(t2,n2,"esm2017")}var Tw=class{constructor(e,t){this.committed=e,this.snapshot=t}toJSON(){return{committed:this.committed,snapshot:this.snapshot.toJSON()}}};function Xj(n,e,t){var r;if(n=Me(n),$s("Reference.transaction",n._path),n.key===".length"||n.key===".keys")throw"Reference.transaction failed: "+n.key+" is a read-only object.";let i=(r=t?.applyLocally)!==null&&r!==void 0?r:!0,o=new sn,s=(c,l,d)=>{let h=null;c?o.reject(c):(h=new Ad(d,new ui(n._repo,n._path),ht),o.resolve(new Tw(l,h)))},a=tg(n,()=>{});return vie(n._repo,n._path,e,s,a,i),o.promise}Cw.prototype.simpleListen=function(n,e){this.sendRequest("q",{p:n},e)};Cw.prototype.echo=function(n,e){this.sendRequest("echo",{d:n},e)};Fie();var il,un=(function(n){return n.added="child_added",n.removed="child_removed",n.changed="child_changed",n.moved="child_moved",n.value="value",n})(un||{}),Uie=Object.freeze((il={},il[un.added]=BI,il[un.removed]=jI,il[un.changed]=GI,il[un.moved]=Ww,il[un.value]=tg,il));function WI(n,e){return new fe(function(t){var r=Uie[e](n,function(i,o){t.next({snapshot:i,prevKey:o,event:e})},t.error.bind(t));return{unsubscribe:function(){HI(n,e,r)}}}).pipe(qv(0))}var $I=function(){return $I=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++){t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},$I.apply(this,arguments)};function qw(n,e,t){if(t||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return n.concat(o||Array.prototype.slice.call(e))}function Qj(n){return(n==null||n.length===0)&&(n=[un.added,un.removed,un.changed,un.moved]),n}function Jj(n,e){return e===void 0&&(e={}),WI(n,un.value).pipe(De(function(t){return Kw(t,e)}))}function Kw(n,e){var t;e===void 0&&(e={});var r=n.snapshot.val();return!n.snapshot.exists()||typeof r!="object"?r:$I($I({},r),e.keyField?(t={},t[e.keyField]=n.snapshot.key,t):null)}function Zj(n,e){e===void 0&&(e={});var t=Qj(e.events),r=t.map(function(i){return WI(n,i)});return ds.apply(void 0,r)}function Vie(n){return sr(VI(n)).pipe(De(function(e){var t=un.value;return{snapshot:e,prevKey:null,event:t}}))}function eH(n,e){e===void 0&&(e={});var t=Qj(e.events);return Vie(n).pipe(br(function(r){var i=[ct(r)];return t.forEach(function(o){i.push(WI(n,o))}),ds.apply(void 0,i).pipe($m(Gie,[]))}),_o())}function tH(n,e){return e===void 0&&(e={}),eH(n).pipe(De(function(t){return t.map(function(r){return Kw(r,e)})}))}function nH(n,e){for(var t=n.length,r=0;r<t;r++)if(n[r].snapshot.key===e)return r;return-1}function Bie(n,e){if(e==null)return 0;var t=nH(n,e);return t===-1?n.length:t+1}function Gie(n,e){var t=e.snapshot,r=e.prevKey,i=e.event,o=t.key,s=nH(n,o),a=Bie(n,r||void 0);switch(i){case un.value:if(e.snapshot&&e.snapshot.exists()){var c=null;e.snapshot.forEach(function(h){var f={snapshot:h,event:un.value,prevKey:c};return c=h.key,n=qw(qw([],n,!0),[f],!1),!1})}return n;case un.added:if(s>-1){var l=n[s-1];(l&&l.snapshot.key||null)!==r&&(n=n.filter(function(h){return h.snapshot.key!==t.key}),n.splice(a,0,e))}else{if(r==null)return qw([e],n,!0);n=n.slice(),n.splice(a,0,e)}return n;case un.removed:return n.filter(function(h){return h.snapshot.key!==t.key});case un.changed:return n.map(function(h){return h.snapshot.key===o?e:h});case un.moved:if(s>-1){var d=n.splice(s,1)[0];return n=n.slice(),n.splice(a,0,d),n}return n;default:return n}}var ng=class{constructor(e){return e}},rH="database",Yw=class{constructor(){return Fo(rH)}};var Xw=new z("angularfire2.database-instances");function jie(n,e){let t=Ps(rH,n,e);return t&&new ng(t)}function Hie(n){return(e,t)=>{let r=e.runOutsideAngular(()=>n(t));return new ng(r)}}var $ie={provide:Yw,deps:[[new zt,Xw]]},Wie={provide:ng,useFactory:jie,deps:[[new zt,Xw],si]};function Wke(n,...e){return Be("angularfire",ii.full,"rtdb"),qn([Wie,$ie,{provide:Xw,useFactory:Hie(n),multi:!0,deps:[Ae,We,oi,Uo,[new zt,Uc],[new zt,ks],...e]}])}var iH=ue(tH,!0);var oH=ue(Jj,!0),sH=ue(Zj,!0);var zke=ue(qj,!0,2);var rg=ue(VI,!0),qke=ue(wd,!0);var Kke=ue(Wj,!0,2),aH=ue(HI,!0),cH=ue(BI,!0),lH=ue(GI,!0);var uH=ue(jI,!0),dH=ue(Bj,!0),Qw=ue(tg,!0),Yke=ue(zj,!0,2);var hH=ue(Gj,!0,2),fH=ue(Kj,!0,2),bd=ue(Vj,!0,2);var pH=ue(jj,!0,2),gH=ue(Xj,!0),mH=ue(UI,!0,2);var Xke=ue($j,!0,2),EH=ue(Hj,!0,2);var _H=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},TH={};var jo,Jw;(function(){var n;function e(C,y){function A(){}A.prototype=y.prototype,C.D=y.prototype,C.prototype=new A,C.prototype.constructor=C,C.C=function(R,N,O){for(var D=Array(arguments.length-2),Fn=2;Fn<arguments.length;Fn++)D[Fn-2]=arguments[Fn];return y.prototype[N].apply(R,D)}}function t(){this.blockSize=-1}function r(){this.blockSize=-1,this.blockSize=64,this.g=Array(4),this.B=Array(this.blockSize),this.o=this.h=0,this.s()}e(r,t),r.prototype.s=function(){this.g[0]=1732584193,this.g[1]=4023233417,this.g[2]=2562383102,this.g[3]=271733878,this.o=this.h=0};function i(C,y,A){A||(A=0);var R=Array(16);if(typeof y=="string")for(var N=0;16>N;++N)R[N]=y.charCodeAt(A++)|y.charCodeAt(A++)<<8|y.charCodeAt(A++)<<16|y.charCodeAt(A++)<<24;else for(N=0;16>N;++N)R[N]=y[A++]|y[A++]<<8|y[A++]<<16|y[A++]<<24;y=C.g[0],A=C.g[1],N=C.g[2];var O=C.g[3],D=y+(O^A&(N^O))+R[0]+3614090360&4294967295;y=A+(D<<7&4294967295|D>>>25),D=O+(N^y&(A^N))+R[1]+3905402710&4294967295,O=y+(D<<12&4294967295|D>>>20),D=N+(A^O&(y^A))+R[2]+606105819&4294967295,N=O+(D<<17&4294967295|D>>>15),D=A+(y^N&(O^y))+R[3]+3250441966&4294967295,A=N+(D<<22&4294967295|D>>>10),D=y+(O^A&(N^O))+R[4]+4118548399&4294967295,y=A+(D<<7&4294967295|D>>>25),D=O+(N^y&(A^N))+R[5]+1200080426&4294967295,O=y+(D<<12&4294967295|D>>>20),D=N+(A^O&(y^A))+R[6]+2821735955&4294967295,N=O+(D<<17&4294967295|D>>>15),D=A+(y^N&(O^y))+R[7]+4249261313&4294967295,A=N+(D<<22&4294967295|D>>>10),D=y+(O^A&(N^O))+R[8]+1770035416&4294967295,y=A+(D<<7&4294967295|D>>>25),D=O+(N^y&(A^N))+R[9]+2336552879&4294967295,O=y+(D<<12&4294967295|D>>>20),D=N+(A^O&(y^A))+R[10]+4294925233&4294967295,N=O+(D<<17&4294967295|D>>>15),D=A+(y^N&(O^y))+R[11]+2304563134&4294967295,A=N+(D<<22&4294967295|D>>>10),D=y+(O^A&(N^O))+R[12]+1804603682&4294967295,y=A+(D<<7&4294967295|D>>>25),D=O+(N^y&(A^N))+R[13]+4254626195&4294967295,O=y+(D<<12&4294967295|D>>>20),D=N+(A^O&(y^A))+R[14]+2792965006&4294967295,N=O+(D<<17&4294967295|D>>>15),D=A+(y^N&(O^y))+R[15]+1236535329&4294967295,A=N+(D<<22&4294967295|D>>>10),D=y+(N^O&(A^N))+R[1]+4129170786&4294967295,y=A+(D<<5&4294967295|D>>>27),D=O+(A^N&(y^A))+R[6]+3225465664&4294967295,O=y+(D<<9&4294967295|D>>>23),D=N+(y^A&(O^y))+R[11]+643717713&4294967295,N=O+(D<<14&4294967295|D>>>18),D=A+(O^y&(N^O))+R[0]+3921069994&4294967295,A=N+(D<<20&4294967295|D>>>12),D=y+(N^O&(A^N))+R[5]+3593408605&4294967295,y=A+(D<<5&4294967295|D>>>27),D=O+(A^N&(y^A))+R[10]+38016083&4294967295,O=y+(D<<9&4294967295|D>>>23),D=N+(y^A&(O^y))+R[15]+3634488961&4294967295,N=O+(D<<14&4294967295|D>>>18),D=A+(O^y&(N^O))+R[4]+3889429448&4294967295,A=N+(D<<20&4294967295|D>>>12),D=y+(N^O&(A^N))+R[9]+568446438&4294967295,y=A+(D<<5&4294967295|D>>>27),D=O+(A^N&(y^A))+R[14]+3275163606&4294967295,O=y+(D<<9&4294967295|D>>>23),D=N+(y^A&(O^y))+R[3]+4107603335&4294967295,N=O+(D<<14&4294967295|D>>>18),D=A+(O^y&(N^O))+R[8]+1163531501&4294967295,A=N+(D<<20&4294967295|D>>>12),D=y+(N^O&(A^N))+R[13]+2850285829&4294967295,y=A+(D<<5&4294967295|D>>>27),D=O+(A^N&(y^A))+R[2]+4243563512&4294967295,O=y+(D<<9&4294967295|D>>>23),D=N+(y^A&(O^y))+R[7]+1735328473&4294967295,N=O+(D<<14&4294967295|D>>>18),D=A+(O^y&(N^O))+R[12]+2368359562&4294967295,A=N+(D<<20&4294967295|D>>>12),D=y+(A^N^O)+R[5]+4294588738&4294967295,y=A+(D<<4&4294967295|D>>>28),D=O+(y^A^N)+R[8]+2272392833&4294967295,O=y+(D<<11&4294967295|D>>>21),D=N+(O^y^A)+R[11]+1839030562&4294967295,N=O+(D<<16&4294967295|D>>>16),D=A+(N^O^y)+R[14]+4259657740&4294967295,A=N+(D<<23&4294967295|D>>>9),D=y+(A^N^O)+R[1]+2763975236&4294967295,y=A+(D<<4&4294967295|D>>>28),D=O+(y^A^N)+R[4]+1272893353&4294967295,O=y+(D<<11&4294967295|D>>>21),D=N+(O^y^A)+R[7]+4139469664&4294967295,N=O+(D<<16&4294967295|D>>>16),D=A+(N^O^y)+R[10]+3200236656&4294967295,A=N+(D<<23&4294967295|D>>>9),D=y+(A^N^O)+R[13]+681279174&4294967295,y=A+(D<<4&4294967295|D>>>28),D=O+(y^A^N)+R[0]+3936430074&4294967295,O=y+(D<<11&4294967295|D>>>21),D=N+(O^y^A)+R[3]+3572445317&4294967295,N=O+(D<<16&4294967295|D>>>16),D=A+(N^O^y)+R[6]+76029189&4294967295,A=N+(D<<23&4294967295|D>>>9),D=y+(A^N^O)+R[9]+3654602809&4294967295,y=A+(D<<4&4294967295|D>>>28),D=O+(y^A^N)+R[12]+3873151461&4294967295,O=y+(D<<11&4294967295|D>>>21),D=N+(O^y^A)+R[15]+530742520&4294967295,N=O+(D<<16&4294967295|D>>>16),D=A+(N^O^y)+R[2]+3299628645&4294967295,A=N+(D<<23&4294967295|D>>>9),D=y+(N^(A|~O))+R[0]+4096336452&4294967295,y=A+(D<<6&4294967295|D>>>26),D=O+(A^(y|~N))+R[7]+1126891415&4294967295,O=y+(D<<10&4294967295|D>>>22),D=N+(y^(O|~A))+R[14]+2878612391&4294967295,N=O+(D<<15&4294967295|D>>>17),D=A+(O^(N|~y))+R[5]+4237533241&4294967295,A=N+(D<<21&4294967295|D>>>11),D=y+(N^(A|~O))+R[12]+1700485571&4294967295,y=A+(D<<6&4294967295|D>>>26),D=O+(A^(y|~N))+R[3]+2399980690&4294967295,O=y+(D<<10&4294967295|D>>>22),D=N+(y^(O|~A))+R[10]+4293915773&4294967295,N=O+(D<<15&4294967295|D>>>17),D=A+(O^(N|~y))+R[1]+2240044497&4294967295,A=N+(D<<21&4294967295|D>>>11),D=y+(N^(A|~O))+R[8]+1873313359&4294967295,y=A+(D<<6&4294967295|D>>>26),D=O+(A^(y|~N))+R[15]+4264355552&4294967295,O=y+(D<<10&4294967295|D>>>22),D=N+(y^(O|~A))+R[6]+2734768916&4294967295,N=O+(D<<15&4294967295|D>>>17),D=A+(O^(N|~y))+R[13]+1309151649&4294967295,A=N+(D<<21&4294967295|D>>>11),D=y+(N^(A|~O))+R[4]+4149444226&4294967295,y=A+(D<<6&4294967295|D>>>26),D=O+(A^(y|~N))+R[11]+3174756917&4294967295,O=y+(D<<10&4294967295|D>>>22),D=N+(y^(O|~A))+R[2]+718787259&4294967295,N=O+(D<<15&4294967295|D>>>17),D=A+(O^(N|~y))+R[9]+3951481745&4294967295,C.g[0]=C.g[0]+y&4294967295,C.g[1]=C.g[1]+(N+(D<<21&4294967295|D>>>11))&4294967295,C.g[2]=C.g[2]+N&4294967295,C.g[3]=C.g[3]+O&4294967295}r.prototype.u=function(C,y){y===void 0&&(y=C.length);for(var A=y-this.blockSize,R=this.B,N=this.h,O=0;O<y;){if(N==0)for(;O<=A;)i(this,C,O),O+=this.blockSize;if(typeof C=="string"){for(;O<y;)if(R[N++]=C.charCodeAt(O++),N==this.blockSize){i(this,R),N=0;break}}else for(;O<y;)if(R[N++]=C[O++],N==this.blockSize){i(this,R),N=0;break}}this.h=N,this.o+=y},r.prototype.v=function(){var C=Array((56>this.h?this.blockSize:2*this.blockSize)-this.h);C[0]=128;for(var y=1;y<C.length-8;++y)C[y]=0;var A=8*this.o;for(y=C.length-8;y<C.length;++y)C[y]=A&255,A/=256;for(this.u(C),C=Array(16),y=A=0;4>y;++y)for(var R=0;32>R;R+=8)C[A++]=this.g[y]>>>R&255;return C};function o(C,y){var A=a;return Object.prototype.hasOwnProperty.call(A,C)?A[C]:A[C]=y(C)}function s(C,y){this.h=y;for(var A=[],R=!0,N=C.length-1;0<=N;N--){var O=C[N]|0;R&&O==y||(A[N]=O,R=!1)}this.g=A}var a={};function c(C){return-128<=C&&128>C?o(C,function(y){return new s([y|0],0>y?-1:0)}):new s([C|0],0>C?-1:0)}function l(C){if(isNaN(C)||!isFinite(C))return h;if(0>C)return S(l(-C));for(var y=[],A=1,R=0;C>=A;R++)y[R]=C/A|0,A*=4294967296;return new s(y,0)}function d(C,y){if(C.length==0)throw Error("number format error: empty string");if(y=y||10,2>y||36<y)throw Error("radix out of range: "+y);if(C.charAt(0)=="-")return S(d(C.substring(1),y));if(0<=C.indexOf("-"))throw Error('number format error: interior "-" character');for(var A=l(Math.pow(y,8)),R=h,N=0;N<C.length;N+=8){var O=Math.min(8,C.length-N),D=parseInt(C.substring(N,N+O),y);8>O?(O=l(Math.pow(y,O)),R=R.j(O).add(l(D))):(R=R.j(A),R=R.add(l(D)))}return R}var h=c(0),f=c(1),g=c(16777216);n=s.prototype,n.m=function(){if(v(this))return-S(this).m();for(var C=0,y=1,A=0;A<this.g.length;A++){var R=this.i(A);C+=(0<=R?R:4294967296+R)*y,y*=4294967296}return C},n.toString=function(C){if(C=C||10,2>C||36<C)throw Error("radix out of range: "+C);if(E(this))return"0";if(v(this))return"-"+S(this).toString(C);for(var y=l(Math.pow(C,6)),A=this,R="";;){var N=oe(A,y).g;A=P(A,N.j(y));var O=((0<A.g.length?A.g[0]:A.h)>>>0).toString(C);if(A=N,E(A))return O+R;for(;6>O.length;)O="0"+O;R=O+R}},n.i=function(C){return 0>C?0:C<this.g.length?this.g[C]:this.h};function E(C){if(C.h!=0)return!1;for(var y=0;y<C.g.length;y++)if(C.g[y]!=0)return!1;return!0}function v(C){return C.h==-1}n.l=function(C){return C=P(this,C),v(C)?-1:E(C)?0:1};function S(C){for(var y=C.g.length,A=[],R=0;R<y;R++)A[R]=~C.g[R];return new s(A,~C.h).add(f)}n.abs=function(){return v(this)?S(this):this},n.add=function(C){for(var y=Math.max(this.g.length,C.g.length),A=[],R=0,N=0;N<=y;N++){var O=R+(this.i(N)&65535)+(C.i(N)&65535),D=(O>>>16)+(this.i(N)>>>16)+(C.i(N)>>>16);R=D>>>16,O&=65535,D&=65535,A[N]=D<<16|O}return new s(A,A[A.length-1]&-2147483648?-1:0)};function P(C,y){return C.add(S(y))}n.j=function(C){if(E(this)||E(C))return h;if(v(this))return v(C)?S(this).j(S(C)):S(S(this).j(C));if(v(C))return S(this.j(S(C)));if(0>this.l(g)&&0>C.l(g))return l(this.m()*C.m());for(var y=this.g.length+C.g.length,A=[],R=0;R<2*y;R++)A[R]=0;for(R=0;R<this.g.length;R++)for(var N=0;N<C.g.length;N++){var O=this.i(R)>>>16,D=this.i(R)&65535,Fn=C.i(N)>>>16,Xo=C.i(N)&65535;A[2*R+2*N]+=D*Xo,V(A,2*R+2*N),A[2*R+2*N+1]+=O*Xo,V(A,2*R+2*N+1),A[2*R+2*N+1]+=D*Fn,V(A,2*R+2*N+1),A[2*R+2*N+2]+=O*Fn,V(A,2*R+2*N+2)}for(R=0;R<y;R++)A[R]=A[2*R+1]<<16|A[2*R];for(R=y;R<2*y;R++)A[R]=0;return new s(A,0)};function V(C,y){for(;(C[y]&65535)!=C[y];)C[y+1]+=C[y]>>>16,C[y]&=65535,y++}function K(C,y){this.g=C,this.h=y}function oe(C,y){if(E(y))throw Error("division by zero");if(E(C))return new K(h,h);if(v(C))return y=oe(S(C),y),new K(S(y.g),S(y.h));if(v(y))return y=oe(C,S(y)),new K(S(y.g),y.h);if(30<C.g.length){if(v(C)||v(y))throw Error("slowDivide_ only works with positive integers.");for(var A=f,R=y;0>=R.l(C);)A=ge(A),R=ge(R);var N=te(A,1),O=te(R,1);for(R=te(R,2),A=te(A,2);!E(R);){var D=O.add(R);0>=D.l(C)&&(N=N.add(A),O=D),R=te(R,1),A=te(A,1)}return y=P(C,N.j(y)),new K(N,y)}for(N=h;0<=C.l(y);){for(A=Math.max(1,Math.floor(C.m()/y.m())),R=Math.ceil(Math.log(A)/Math.LN2),R=48>=R?1:Math.pow(2,R-48),O=l(A),D=O.j(y);v(D)||0<D.l(C);)A-=R,O=l(A),D=O.j(y);E(O)&&(O=f),N=N.add(O),C=P(C,D)}return new K(N,C)}n.A=function(C){return oe(this,C).h},n.and=function(C){for(var y=Math.max(this.g.length,C.g.length),A=[],R=0;R<y;R++)A[R]=this.i(R)&C.i(R);return new s(A,this.h&C.h)},n.or=function(C){for(var y=Math.max(this.g.length,C.g.length),A=[],R=0;R<y;R++)A[R]=this.i(R)|C.i(R);return new s(A,this.h|C.h)},n.xor=function(C){for(var y=Math.max(this.g.length,C.g.length),A=[],R=0;R<y;R++)A[R]=this.i(R)^C.i(R);return new s(A,this.h^C.h)};function ge(C){for(var y=C.g.length+1,A=[],R=0;R<y;R++)A[R]=C.i(R)<<1|C.i(R-1)>>>31;return new s(A,C.h)}function te(C,y){var A=y>>5;y%=32;for(var R=C.g.length-A,N=[],O=0;O<R;O++)N[O]=0<y?C.i(O+A)>>>y|C.i(O+A+1)<<32-y:C.i(O+A);return new s(N,C.h)}r.prototype.digest=r.prototype.v,r.prototype.reset=r.prototype.s,r.prototype.update=r.prototype.u,Jw=TH.Md5=r,s.prototype.add=s.prototype.add,s.prototype.multiply=s.prototype.j,s.prototype.modulo=s.prototype.A,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=l,s.fromString=d,jo=TH.Integer=s}).apply(typeof _H<"u"?_H:typeof self<"u"?self:typeof window<"u"?window:{});var zI=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ho={};var Zw,zie,Od,eb,ig,qI,tb,nb,rb;(function(){var n,e=typeof Object.defineProperties=="function"?Object.defineProperty:function(u,p,m){return u==Array.prototype||u==Object.prototype||(u[p]=m.value),u};function t(u){u=[typeof globalThis=="object"&&globalThis,u,typeof window=="object"&&window,typeof self=="object"&&self,typeof zI=="object"&&zI];for(var p=0;p<u.length;++p){var m=u[p];if(m&&m.Math==Math)return m}throw Error("Cannot find global object")}var r=t(this);function i(u,p){if(p)e:{var m=r;u=u.split(".");for(var _=0;_<u.length-1;_++){var b=u[_];if(!(b in m))break e;m=m[b]}u=u[u.length-1],_=m[u],p=p(_),p!=_&&p!=null&&e(m,u,{configurable:!0,writable:!0,value:p})}}function o(u,p){u instanceof String&&(u+="");var m=0,_=!1,b={next:function(){if(!_&&m<u.length){var k=m++;return{value:p(k,u[k]),done:!1}}return _=!0,{done:!0,value:void 0}}};return b[Symbol.iterator]=function(){return b},b}i("Array.prototype.values",function(u){return u||function(){return o(this,function(p,m){return m})}});var s=s||{},a=this||self;function c(u){var p=typeof u;return p=p!="object"?p:u?Array.isArray(u)?"array":p:"null",p=="array"||p=="object"&&typeof u.length=="number"}function l(u){var p=typeof u;return p=="object"&&u!=null||p=="function"}function d(u,p,m){return u.call.apply(u.bind,arguments)}function h(u,p,m){if(!u)throw Error();if(2<arguments.length){var _=Array.prototype.slice.call(arguments,2);return function(){var b=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(b,_),u.apply(p,b)}}return function(){return u.apply(p,arguments)}}function f(u,p,m){return f=Function.prototype.bind&&Function.prototype.bind.toString().indexOf("native code")!=-1?d:h,f.apply(null,arguments)}function g(u,p){var m=Array.prototype.slice.call(arguments,1);return function(){var _=m.slice();return _.push.apply(_,arguments),u.apply(this,_)}}function E(u,p){function m(){}m.prototype=p.prototype,u.aa=p.prototype,u.prototype=new m,u.prototype.constructor=u,u.Qb=function(_,b,k){for(var X=Array(arguments.length-2),rt=2;rt<arguments.length;rt++)X[rt-2]=arguments[rt];return p.prototype[b].apply(_,X)}}function v(u){let p=u.length;if(0<p){let m=Array(p);for(let _=0;_<p;_++)m[_]=u[_];return m}return[]}function S(u,p){for(let m=1;m<arguments.length;m++){let _=arguments[m];if(c(_)){let b=u.length||0,k=_.length||0;u.length=b+k;for(let X=0;X<k;X++)u[b+X]=_[X]}else u.push(_)}}class P{constructor(p,m){this.i=p,this.j=m,this.h=0,this.g=null}get(){let p;return 0<this.h?(this.h--,p=this.g,this.g=p.next,p.next=null):p=this.i(),p}}function V(u){return/^[\s\xa0]*$/.test(u)}function K(){var u=a.navigator;return u&&(u=u.userAgent)?u:""}function oe(u){return oe[" "](u),u}oe[" "]=function(){};var ge=K().indexOf("Gecko")!=-1&&!(K().toLowerCase().indexOf("webkit")!=-1&&K().indexOf("Edge")==-1)&&!(K().indexOf("Trident")!=-1||K().indexOf("MSIE")!=-1)&&K().indexOf("Edge")==-1;function te(u,p,m){for(let _ in u)p.call(m,u[_],_,u)}function C(u,p){for(let m in u)p.call(void 0,u[m],m,u)}function y(u){let p={};for(let m in u)p[m]=u[m];return p}let A="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function R(u,p){let m,_;for(let b=1;b<arguments.length;b++){_=arguments[b];for(m in _)u[m]=_[m];for(let k=0;k<A.length;k++)m=A[k],Object.prototype.hasOwnProperty.call(_,m)&&(u[m]=_[m])}}function N(u){var p=1;u=u.split(":");let m=[];for(;0<p&&u.length;)m.push(u.shift()),p--;return u.length&&m.push(u.join(":")),m}function O(u){a.setTimeout(()=>{throw u},0)}function D(){var u=Jo;let p=null;return u.g&&(p=u.g,u.g=u.g.next,u.g||(u.h=null),p.next=null),p}class Fn{constructor(){this.h=this.g=null}add(p,m){let _=Xo.get();_.set(p,m),this.h?this.h.next=_:this.g=_,this.h=_}}var Xo=new P(()=>new Qo,u=>u.reset());class Qo{constructor(){this.next=this.g=this.h=null}set(p,m){this.h=p,this.g=m,this.next=null}reset(){this.next=this.g=this.h=null}}let Ia,ya=!1,Jo=new Fn,Ol=()=>{let u=a.Promise.resolve(void 0);Ia=()=>{u.then(rm)}};var rm=()=>{for(var u;u=D();){try{u.h.call(u.g)}catch(m){O(m)}var p=Xo;p.j(u),100>p.h&&(p.h++,u.next=p.g,p.g=u)}ya=!1};function mi(){this.s=this.s,this.C=this.C}mi.prototype.s=!1,mi.prototype.ma=function(){this.s||(this.s=!0,this.N())},mi.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()};function tn(u,p){this.type=u,this.g=this.target=p,this.defaultPrevented=!1}tn.prototype.h=function(){this.defaultPrevented=!0};var yv=(function(){if(!a.addEventListener||!Object.defineProperty)return!1;var u=!1,p=Object.defineProperty({},"passive",{get:function(){u=!0}});try{let m=()=>{};a.addEventListener("test",m,p),a.removeEventListener("test",m,p)}catch{}return u})();function je(u,p){if(tn.call(this,u?u.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,u){var m=this.type=u.type,_=u.changedTouches&&u.changedTouches.length?u.changedTouches[0]:null;if(this.target=u.target||u.srcElement,this.g=p,p=u.relatedTarget){if(ge){e:{try{oe(p.nodeName);var b=!0;break e}catch{}b=!1}b||(p=null)}}else m=="mouseover"?p=u.fromElement:m=="mouseout"&&(p=u.toElement);this.relatedTarget=p,_?(this.clientX=_.clientX!==void 0?_.clientX:_.pageX,this.clientY=_.clientY!==void 0?_.clientY:_.pageY,this.screenX=_.screenX||0,this.screenY=_.screenY||0):(this.clientX=u.clientX!==void 0?u.clientX:u.pageX,this.clientY=u.clientY!==void 0?u.clientY:u.pageY,this.screenX=u.screenX||0,this.screenY=u.screenY||0),this.button=u.button,this.key=u.key||"",this.ctrlKey=u.ctrlKey,this.altKey=u.altKey,this.shiftKey=u.shiftKey,this.metaKey=u.metaKey,this.pointerId=u.pointerId||0,this.pointerType=typeof u.pointerType=="string"?u.pointerType:vv[u.pointerType]||"",this.state=u.state,this.i=u,u.defaultPrevented&&je.aa.h.call(this)}}E(je,tn);var vv={2:"touch",3:"pen",4:"mouse"};je.prototype.h=function(){je.aa.h.call(this);var u=this.i;u.preventDefault?u.preventDefault():u.returnValue=!1};var va="closure_listenable_"+(1e6*Math.random()|0),Sv=0;function Av(u,p,m,_,b){this.listener=u,this.proxy=null,this.src=p,this.type=m,this.capture=!!_,this.ha=b,this.key=++Sv,this.da=this.fa=!1}function Ml(u){u.da=!0,u.listener=null,u.proxy=null,u.src=null,u.ha=null}function Ll(u){this.src=u,this.g={},this.h=0}Ll.prototype.add=function(u,p,m,_,b){var k=u.toString();u=this.g[k],u||(u=this.g[k]=[],this.h++);var X=Ah(u,p,_,b);return-1<X?(p=u[X],m||(p.fa=!1)):(p=new Av(p,this.src,k,!!_,b),p.fa=m,u.push(p)),p};function Pl(u,p){var m=p.type;if(m in u.g){var _=u.g[m],b=Array.prototype.indexOf.call(_,p,void 0),k;(k=0<=b)&&Array.prototype.splice.call(_,b,1),k&&(Ml(p),u.g[m].length==0&&(delete u.g[m],u.h--))}}function Ah(u,p,m,_){for(var b=0;b<u.length;++b){var k=u[b];if(!k.da&&k.listener==p&&k.capture==!!m&&k.ha==_)return b}return-1}var xl="closure_lm_"+(1e6*Math.random()|0),Qe={};function kl(u,p,m,_,b){if(_&&_.once)return ir(u,p,m,_,b);if(Array.isArray(p)){for(var k=0;k<p.length;k++)kl(u,p[k],m,_,b);return null}return m=Vl(m),u&&u[va]?u.K(p,m,l(_)?!!_.capture:!!_,b):nt(u,p,m,!1,_,b)}function nt(u,p,m,_,b,k){if(!p)throw Error("Invalid event type");var X=l(b)?!!b.capture:!!b,rt=Sa(u);if(rt||(u[xl]=rt=new Ll(u)),m=rt.add(p,m,_,X,k),m.proxy)return m;if(_=Ch(),m.proxy=_,_.src=u,_.listener=m,u.addEventListener)yv||(b=X),b===void 0&&(b=!1),u.addEventListener(p.toString(),_,b);else if(u.attachEvent)u.attachEvent(Hr(p.toString()),_);else if(u.addListener&&u.removeListener)u.addListener(_);else throw Error("addEventListener and attachEvent are unavailable.");return m}function Ch(){function u(m){return p.call(u.src,u.listener,m)}let p=im;return u}function ir(u,p,m,_,b){if(Array.isArray(p)){for(var k=0;k<p.length;k++)ir(u,p[k],m,_,b);return null}return m=Vl(m),u&&u[va]?u.L(p,m,l(_)?!!_.capture:!!_,b):nt(u,p,m,!0,_,b)}function Zo(u,p,m,_,b){if(Array.isArray(p))for(var k=0;k<p.length;k++)Zo(u,p[k],m,_,b);else _=l(_)?!!_.capture:!!_,m=Vl(m),u&&u[va]?(u=u.i,p=String(p).toString(),p in u.g&&(k=u.g[p],m=Ah(k,m,_,b),-1<m&&(Ml(k[m]),Array.prototype.splice.call(k,m,1),k.length==0&&(delete u.g[p],u.h--)))):u&&(u=Sa(u))&&(p=u.g[p.toString()],u=-1,p&&(u=Ah(p,m,_,b)),(m=-1<u?p[u]:null)&&Fl(m))}function Fl(u){if(typeof u!="number"&&u&&!u.da){var p=u.src;if(p&&p[va])Pl(p.i,u);else{var m=u.type,_=u.proxy;p.removeEventListener?p.removeEventListener(m,_,u.capture):p.detachEvent?p.detachEvent(Hr(m),_):p.addListener&&p.removeListener&&p.removeListener(_),(m=Sa(p))?(Pl(m,u),m.h==0&&(m.src=null,p[xl]=null)):Ml(u)}}}function Hr(u){return u in Qe?Qe[u]:Qe[u]="on"+u}function im(u,p){if(u.da)u=!0;else{p=new je(p,this);var m=u.listener,_=u.ha||u.src;u.fa&&Fl(u),u=m.call(_,p)}return u}function Sa(u){return u=u[xl],u instanceof Ll?u:null}var Ul="__closure_events_fn_"+(1e9*Math.random()>>>0);function Vl(u){return typeof u=="function"?u:(u[Ul]||(u[Ul]=function(p){return u.handleEvent(p)}),u[Ul])}function ut(){mi.call(this),this.i=new Ll(this),this.M=this,this.F=null}E(ut,mi),ut.prototype[va]=!0,ut.prototype.removeEventListener=function(u,p,m,_){Zo(this,u,p,m,_)};function Tt(u,p){var m,_=u.F;if(_)for(m=[];_;_=_.F)m.push(_);if(u=u.M,_=p.type||p,typeof p=="string")p=new tn(p,u);else if(p instanceof tn)p.target=p.target||u;else{var b=p;p=new tn(_,u),R(p,b)}if(b=!0,m)for(var k=m.length-1;0<=k;k--){var X=p.g=m[k];b=Rr(X,_,!0,p)&&b}if(X=p.g=u,b=Rr(X,_,!0,p)&&b,b=Rr(X,_,!1,p)&&b,m)for(k=0;k<m.length;k++)X=p.g=m[k],b=Rr(X,_,!1,p)&&b}ut.prototype.N=function(){if(ut.aa.N.call(this),this.i){var u=this.i,p;for(p in u.g){for(var m=u.g[p],_=0;_<m.length;_++)Ml(m[_]);delete u.g[p],u.h--}}this.F=null},ut.prototype.K=function(u,p,m,_){return this.i.add(String(u),p,!1,m,_)},ut.prototype.L=function(u,p,m,_){return this.i.add(String(u),p,!0,m,_)};function Rr(u,p,m,_){if(p=u.i.g[String(p)],!p)return!0;p=p.concat();for(var b=!0,k=0;k<p.length;++k){var X=p[k];if(X&&!X.da&&X.capture==m){var rt=X.listener,fn=X.ha||X.src;X.fa&&Pl(u.i,X),b=rt.call(fn,_)!==!1&&b}}return b&&!_.defaultPrevented}function Bl(u,p,m){if(typeof u=="function")m&&(u=f(u,m));else if(u&&typeof u.handleEvent=="function")u=f(u.handleEvent,u);else throw Error("Invalid listener argument");return 2147483647<Number(p)?-1:a.setTimeout(u,p||0)}function Aa(u){u.g=Bl(()=>{u.g=null,u.i&&(u.i=!1,Aa(u))},u.l);let p=u.h;u.h=null,u.m.apply(null,p)}class Gl extends mi{constructor(p,m){super(),this.m=p,this.l=m,this.h=null,this.i=!1,this.g=null}j(p){this.h=arguments,this.g?this.i=!0:Aa(this)}N(){super.N(),this.g&&(a.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function so(u){mi.call(this),this.h=u,this.g={}}E(so,mi);var ao=[];function Ca(u){te(u.g,function(p,m){this.g.hasOwnProperty(m)&&Fl(p)},u),u.g={}}so.prototype.N=function(){so.aa.N.call(this),Ca(this)},so.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var es=a.JSON.stringify,om=a.JSON.parse,sm=class{stringify(u){return a.JSON.stringify(u,void 0)}parse(u){return a.JSON.parse(u,void 0)}};function jl(){}jl.prototype.h=null;function Hl(u){return u.h||(u.h=u.i())}function $l(){}var Nr={OPEN:"a",kb:"b",Ja:"c",wb:"d"};function Ei(){tn.call(this,"d")}E(Ei,tn);function Wl(){tn.call(this,"c")}E(Wl,tn);var _i={},Dh=null;function Da(){return Dh=Dh||new ut}_i.La="serverreachability";function Rh(u){tn.call(this,_i.La,u)}E(Rh,tn);function Ti(u){let p=Da();Tt(p,new Rh(p))}_i.STAT_EVENT="statevent";function Ra(u,p){tn.call(this,_i.STAT_EVENT,u),this.stat=p}E(Ra,tn);function at(u){let p=Da();Tt(p,new Ra(p,u))}_i.Ma="timingevent";function co(u,p){tn.call(this,_i.Ma,u),this.size=p}E(co,tn);function lo(u,p){if(typeof u!="function")throw Error("Fn must not be null and must be a function");return a.setTimeout(function(){u()},p)}function uo(){this.g=!0}uo.prototype.xa=function(){this.g=!1};function Cv(u,p,m,_,b,k){u.info(function(){if(u.g)if(k)for(var X="",rt=k.split("&"),fn=0;fn<rt.length;fn++){var Fe=rt[fn].split("=");if(1<Fe.length){var In=Fe[0];Fe=Fe[1];var yn=In.split("_");X=2<=yn.length&&yn[1]=="type"?X+(In+"="+Fe+"&"):X+(In+"=redacted&")}}else X=null;else X=k;return"XMLHTTP REQ ("+_+") [attempt "+b+"]: "+p+`
|
|
154
|
+
`+m+`
|
|
155
|
+
`+X})}function am(u,p,m,_,b,k,X){u.info(function(){return"XMLHTTP RESP ("+_+") [ attempt "+b+"]: "+p+`
|
|
156
|
+
`+m+`
|
|
157
|
+
`+k+" "+X})}function Ii(u,p,m,_){u.info(function(){return"XMLHTTP TEXT ("+p+"): "+Nh(u,m)+(_?" "+_:"")})}function cm(u,p){u.info(function(){return"TIMEOUT: "+p})}uo.prototype.info=function(){};function Nh(u,p){if(!u.g)return p;if(!p)return null;try{var m=JSON.parse(p);if(m){for(u=0;u<m.length;u++)if(Array.isArray(m[u])){var _=m[u];if(!(2>_.length)){var b=_[1];if(Array.isArray(b)&&!(1>b.length)){var k=b[0];if(k!="noop"&&k!="stop"&&k!="close")for(var X=1;X<b.length;X++)b[X]=""}}}}return es(m)}catch{return p}}var zl={NO_ERROR:0,gb:1,tb:2,sb:3,nb:4,rb:5,ub:6,Ia:7,TIMEOUT:8,xb:9},ts={lb:"complete",Hb:"success",Ja:"error",Ia:"abort",zb:"ready",Ab:"readystatechange",TIMEOUT:"timeout",vb:"incrementaldata",yb:"progress",ob:"downloadprogress",Pb:"uploadprogress"},wh;function ql(){}E(ql,jl),ql.prototype.g=function(){return new XMLHttpRequest},ql.prototype.i=function(){return{}},wh=new ql;function He(u,p,m,_){this.j=u,this.i=p,this.l=m,this.R=_||1,this.U=new so(this),this.I=45e3,this.H=null,this.o=!1,this.m=this.A=this.v=this.L=this.F=this.S=this.B=null,this.D=[],this.g=null,this.C=0,this.s=this.u=null,this.X=-1,this.J=!1,this.O=0,this.M=null,this.W=this.K=this.T=this.P=!1,this.h=new ho}function ho(){this.i=null,this.g="",this.h=!1}var lm={},Kl={};function Na(u,p,m){u.L=1,u.v=Ma(zn(p)),u.m=m,u.P=!0,bh(u,null)}function bh(u,p){u.F=Date.now(),Yl(u),u.A=zn(u.v);var m=u.A,_=u.R;Array.isArray(_)||(_=[String(_)]),ce(m.i,"t",_),u.C=0,m=u.j.J,u.h=new ho,u.g=yM(u.j,m?p:null,!u.m),0<u.O&&(u.M=new Gl(f(u.Y,u,u.g),u.O)),p=u.U,m=u.g,_=u.ca;var b="readystatechange";Array.isArray(b)||(b&&(ao[0]=b.toString()),b=ao);for(var k=0;k<b.length;k++){var X=kl(m,b[k],_||p.handleEvent,!1,p.h||p);if(!X)break;p.g[X.key]=X}p=u.H?y(u.H):{},u.m?(u.u||(u.u="POST"),p["Content-Type"]="application/x-www-form-urlencoded",u.g.ea(u.A,u.u,u.m,p)):(u.u="GET",u.g.ea(u.A,u.u,null,p)),Ti(),Cv(u.i,u.u,u.A,u.l,u.R,u.m)}He.prototype.ca=function(u){u=u.target;let p=this.M;p&&mo(u)==3?p.j():this.Y(u)},He.prototype.Y=function(u){try{if(u==this.g)e:{let yn=mo(this.g);var p=this.g.Ba();let tu=this.g.Z();if(!(3>yn)&&(yn!=3||this.g&&(this.h.h||this.g.oa()||uM(this.g)))){this.J||yn!=4||p==7||(p==8||0>=tu?Ti(3):Ti(2)),Mh(this);var m=this.g.Z();this.X=m;t:if(Oh(this)){var _=uM(this.g);u="";var b=_.length,k=mo(this.g)==4;if(!this.h.i){if(typeof TextDecoder>"u"){yi(this),Wn(this);var X="";break t}this.h.i=new a.TextDecoder}for(p=0;p<b;p++)this.h.h=!0,u+=this.h.i.decode(_[p],{stream:!(k&&p==b-1)});_.length=0,this.h.g+=u,this.C=0,X=this.h.g}else X=this.g.oa();if(this.o=m==200,am(this.i,this.u,this.A,this.l,this.R,yn,m),this.o){if(this.T&&!this.K){t:{if(this.g){var rt,fn=this.g;if((rt=fn.g?fn.g.getResponseHeader("X-HTTP-Initial-Response"):null)&&!V(rt)){var Fe=rt;break t}}Fe=null}if(m=Fe)Ii(this.i,this.l,m,"Initial handshake response via X-HTTP-Initial-Response"),this.K=!0,ns(this,m);else{this.o=!1,this.s=3,at(12),yi(this),Wn(this);break e}}if(this.P){m=!0;let $r;for(;!this.J&&this.C<X.length;)if($r=Dv(this,X),$r==Kl){yn==4&&(this.s=4,at(14),m=!1),Ii(this.i,this.l,null,"[Incomplete Response]");break}else if($r==lm){this.s=4,at(15),Ii(this.i,this.l,X,"[Invalid Chunk]"),m=!1;break}else Ii(this.i,this.l,$r,null),ns(this,$r);if(Oh(this)&&this.C!=0&&(this.h.g=this.h.g.slice(this.C),this.C=0),yn!=4||X.length!=0||this.h.h||(this.s=1,at(16),m=!1),this.o=this.o&&m,!m)Ii(this.i,this.l,X,"[Invalid Chunked Response]"),yi(this),Wn(this);else if(0<X.length&&!this.W){this.W=!0;var In=this.j;In.g==this&&In.ba&&!In.M&&(In.j.info("Great, no buffering proxy detected. Bytes received: "+X.length),Ov(In),In.M=!0,at(11))}}else Ii(this.i,this.l,X,null),ns(this,X);yn==4&&yi(this),this.o&&!this.J&&(yn==4?EM(this.j,this):(this.o=!1,Yl(this)))}else g6(this.g),m==400&&0<X.indexOf("Unknown SID")?(this.s=3,at(12)):(this.s=0,at(13)),yi(this),Wn(this)}}}catch{}};function Oh(u){return u.g?u.u=="GET"&&u.L!=2&&u.j.Ca:!1}function Dv(u,p){var m=u.C,_=p.indexOf(`
|
|
158
|
+
`,m);return _==-1?Kl:(m=Number(p.substring(m,_)),isNaN(m)?lm:(_+=1,_+m>p.length?Kl:(p=p.slice(_,_+m),u.C=_+m,p)))}He.prototype.cancel=function(){this.J=!0,yi(this)};function Yl(u){u.S=Date.now()+u.I,um(u,u.I)}function um(u,p){if(u.B!=null)throw Error("WatchDog timer not null");u.B=lo(f(u.ba,u),p)}function Mh(u){u.B&&(a.clearTimeout(u.B),u.B=null)}He.prototype.ba=function(){this.B=null;let u=Date.now();0<=u-this.S?(cm(this.i,this.A),this.L!=2&&(Ti(),at(17)),yi(this),this.s=2,Wn(this)):um(this,this.S-u)};function Wn(u){u.j.G==0||u.J||EM(u.j,u)}function yi(u){Mh(u);var p=u.M;p&&typeof p.ma=="function"&&p.ma(),u.M=null,Ca(u.U),u.g&&(p=u.g,u.g=null,p.abort(),p.ma())}function ns(u,p){try{var m=u.j;if(m.G!=0&&(m.g==u||Ph(m.h,u))){if(!u.K&&Ph(m.h,u)&&m.G==3){try{var _=m.Da.g.parse(p)}catch{_=null}if(Array.isArray(_)&&_.length==3){var b=_;if(b[0]==0){e:if(!m.u){if(m.g)if(m.g.F+3e3<u.F)Em(m),gm(m);else break e;bv(m),at(18)}}else m.za=b[1],0<m.za-m.T&&37500>b[2]&&m.F&&m.v==0&&!m.C&&(m.C=lo(f(m.Za,m),6e3));if(1>=Lh(m.h)&&m.ca){try{m.ca()}catch{}m.ca=void 0}}else Pa(m,11)}else if((u.K||m.g==u)&&Em(m),!V(p))for(b=m.Da.g.parse(p),p=0;p<b.length;p++){let Fe=b[p];if(m.T=Fe[0],Fe=Fe[1],m.G==2)if(Fe[0]=="c"){m.K=Fe[1],m.ia=Fe[2];let In=Fe[3];In!=null&&(m.la=In,m.j.info("VER="+m.la));let yn=Fe[4];yn!=null&&(m.Aa=yn,m.j.info("SVER="+m.Aa));let tu=Fe[5];tu!=null&&typeof tu=="number"&&0<tu&&(_=1.5*tu,m.L=_,m.j.info("backChannelRequestTimeoutMs_="+_)),_=m;let $r=u.g;if($r){let Tm=$r.g?$r.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(Tm){var k=_.h;k.g||Tm.indexOf("spdy")==-1&&Tm.indexOf("quic")==-1&&Tm.indexOf("h2")==-1||(k.j=k.l,k.g=new Set,k.h&&(Xl(k,k.h),k.h=null))}if(_.D){let Mv=$r.g?$r.g.getResponseHeader("X-HTTP-Session-Id"):null;Mv&&(_.ya=Mv,Je(_.I,_.D,Mv))}}m.G=3,m.l&&m.l.ua(),m.ba&&(m.R=Date.now()-u.F,m.j.info("Handshake RTT: "+m.R+"ms")),_=m;var X=u;if(_.qa=IM(_,_.J?_.ia:null,_.W),X.K){xh(_.h,X);var rt=X,fn=_.L;fn&&(rt.I=fn),rt.B&&(Mh(rt),Yl(rt)),_.g=X}else gM(_);0<m.i.length&&mm(m)}else Fe[0]!="stop"&&Fe[0]!="close"||Pa(m,7);else m.G==3&&(Fe[0]=="stop"||Fe[0]=="close"?Fe[0]=="stop"?Pa(m,7):wv(m):Fe[0]!="noop"&&m.l&&m.l.ta(Fe),m.v=0)}}Ti(4)}catch{}}var fo=class{constructor(u,p){this.g=u,this.map=p}};function dm(u){this.l=u||10,a.PerformanceNavigationTiming?(u=a.performance.getEntriesByType("navigation"),u=0<u.length&&(u[0].nextHopProtocol=="hq"||u[0].nextHopProtocol=="h2")):u=!!(a.chrome&&a.chrome.loadTimes&&a.chrome.loadTimes()&&a.chrome.loadTimes().wasFetchedViaSpdy),this.j=u?this.l:1,this.g=null,1<this.j&&(this.g=new Set),this.h=null,this.i=[]}function wa(u){return u.h?!0:u.g?u.g.size>=u.j:!1}function Lh(u){return u.h?1:u.g?u.g.size:0}function Ph(u,p){return u.h?u.h==p:u.g?u.g.has(p):!1}function Xl(u,p){u.g?u.g.add(p):u.h=p}function xh(u,p){u.h&&u.h==p?u.h=null:u.g&&u.g.has(p)&&u.g.delete(p)}dm.prototype.cancel=function(){if(this.i=ba(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&this.g.size!==0){for(let u of this.g.values())u.cancel();this.g.clear()}};function ba(u){if(u.h!=null)return u.i.concat(u.h.D);if(u.g!=null&&u.g.size!==0){let p=u.i;for(let m of u.g.values())p=p.concat(m.D);return p}return v(u.i)}function kh(u){if(u.V&&typeof u.V=="function")return u.V();if(typeof Map<"u"&&u instanceof Map||typeof Set<"u"&&u instanceof Set)return Array.from(u.values());if(typeof u=="string")return u.split("");if(c(u)){for(var p=[],m=u.length,_=0;_<m;_++)p.push(u[_]);return p}p=[],m=0;for(_ in u)p[m++]=u[_];return p}function Ql(u){if(u.na&&typeof u.na=="function")return u.na();if(!u.V||typeof u.V!="function"){if(typeof Map<"u"&&u instanceof Map)return Array.from(u.keys());if(!(typeof Set<"u"&&u instanceof Set)){if(c(u)||typeof u=="string"){var p=[];u=u.length;for(var m=0;m<u;m++)p.push(m);return p}p=[],m=0;for(let _ in u)p[m++]=_;return p}}}function po(u,p){if(u.forEach&&typeof u.forEach=="function")u.forEach(p,void 0);else if(c(u)||typeof u=="string")Array.prototype.forEach.call(u,p,void 0);else for(var m=Ql(u),_=kh(u),b=_.length,k=0;k<b;k++)p.call(void 0,_[k],m&&m[k],u)}var rs=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function wr(u,p){if(u){u=u.split("&");for(var m=0;m<u.length;m++){var _=u[m].indexOf("="),b=null;if(0<=_){var k=u[m].substring(0,_);b=u[m].substring(_+1)}else k=u[m];p(k,b?decodeURIComponent(b.replace(/\+/g," ")):"")}}}function go(u){if(this.g=this.o=this.j="",this.s=null,this.m=this.l="",this.h=!1,u instanceof go){this.h=u.h,Jl(this,u.j),this.o=u.o,this.g=u.g,Oa(this,u.s),this.l=u.l;var p=u.i,m=new T;m.i=p.i,p.g&&(m.g=new Map(p.g),m.h=p.h),Fh(this,m),this.m=u.m}else u&&(p=String(u).match(rs))?(this.h=!1,Jl(this,p[1]||"",!0),this.o=La(p[2]||""),this.g=La(p[3]||"",!0),Oa(this,p[4]),this.l=La(p[5]||"",!0),Fh(this,p[6]||"",!0),this.m=La(p[7]||"")):(this.h=!1,this.i=new T(null,this.h))}go.prototype.toString=function(){var u=[],p=this.j;p&&u.push(is(p,hm,!0),":");var m=this.g;return(m||p=="file")&&(u.push("//"),(p=this.o)&&u.push(is(p,hm,!0),"@"),u.push(encodeURIComponent(String(m)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),m=this.s,m!=null&&u.push(":",String(m))),(m=this.l)&&(this.g&&m.charAt(0)!="/"&&u.push("/"),u.push(is(m,m.charAt(0)=="/"?Zl:fm,!0))),(m=this.i.toString())&&u.push("?",m),(m=this.m)&&u.push("#",is(m,W)),u.join("")};function zn(u){return new go(u)}function Jl(u,p,m){u.j=m?La(p,!0):p,u.j&&(u.j=u.j.replace(/:$/,""))}function Oa(u,p){if(p){if(p=Number(p),isNaN(p)||0>p)throw Error("Bad port number "+p);u.s=p}else u.s=null}function Fh(u,p,m){p instanceof T?(u.i=p,Ze(u.i,u.h)):(m||(p=is(p,Uh)),u.i=new T(p,u.h))}function Je(u,p,m){u.i.set(p,m)}function Ma(u){return Je(u,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),u}function La(u,p){return u?p?decodeURI(u.replace(/%25/g,"%2525")):decodeURIComponent(u):""}function is(u,p,m){return typeof u=="string"?(u=encodeURI(u).replace(p,Rv),m&&(u=u.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),u):null}function Rv(u){return u=u.charCodeAt(0),"%"+(u>>4&15).toString(16)+(u&15).toString(16)}var hm=/[#\/\?@]/g,fm=/[#\?:]/g,Zl=/[#\?]/g,Uh=/[#\?@]/g,W=/#/g;function T(u,p){this.h=this.g=null,this.i=u||null,this.j=!!p}function w(u){u.g||(u.g=new Map,u.h=0,u.i&&wr(u.i,function(p,m){u.add(decodeURIComponent(p.replace(/\+/g," ")),m)}))}n=T.prototype,n.add=function(u,p){w(this),this.i=null,u=de(this,u);var m=this.g.get(u);return m||this.g.set(u,m=[]),m.push(p),this.h+=1,this};function B(u,p){w(u),p=de(u,p),u.g.has(p)&&(u.i=null,u.h-=u.g.get(p).length,u.g.delete(p))}function ee(u,p){return w(u),p=de(u,p),u.g.has(p)}n.forEach=function(u,p){w(this),this.g.forEach(function(m,_){m.forEach(function(b){u.call(p,b,_,this)},this)},this)},n.na=function(){w(this);let u=Array.from(this.g.values()),p=Array.from(this.g.keys()),m=[];for(let _=0;_<p.length;_++){let b=u[_];for(let k=0;k<b.length;k++)m.push(p[_])}return m},n.V=function(u){w(this);let p=[];if(typeof u=="string")ee(this,u)&&(p=p.concat(this.g.get(de(this,u))));else{u=Array.from(this.g.values());for(let m=0;m<u.length;m++)p=p.concat(u[m])}return p},n.set=function(u,p){return w(this),this.i=null,u=de(this,u),ee(this,u)&&(this.h-=this.g.get(u).length),this.g.set(u,[p]),this.h+=1,this},n.get=function(u,p){return u?(u=this.V(u),0<u.length?String(u[0]):p):p};function ce(u,p,m){B(u,p),0<m.length&&(u.i=null,u.g.set(de(u,p),v(m)),u.h+=m.length)}n.toString=function(){if(this.i)return this.i;if(!this.g)return"";let u=[],p=Array.from(this.g.keys());for(var m=0;m<p.length;m++){var _=p[m];let k=encodeURIComponent(String(_)),X=this.V(_);for(_=0;_<X.length;_++){var b=k;X[_]!==""&&(b+="="+encodeURIComponent(String(X[_]))),u.push(b)}}return this.i=u.join("&")};function de(u,p){return p=String(p),u.j&&(p=p.toLowerCase()),p}function Ze(u,p){p&&!u.j&&(w(u),u.i=null,u.g.forEach(function(m,_){var b=_.toLowerCase();_!=b&&(B(this,_),ce(this,b,m))},u)),u.j=p}function dt(u,p){let m=new uo;if(a.Image){let _=new Image;_.onload=g(It,m,"TestLoadImage: loaded",!0,p,_),_.onerror=g(It,m,"TestLoadImage: error",!1,p,_),_.onabort=g(It,m,"TestLoadImage: abort",!1,p,_),_.ontimeout=g(It,m,"TestLoadImage: timeout",!1,p,_),a.setTimeout(function(){_.ontimeout&&_.ontimeout()},1e4),_.src=u}else p(!1)}function Tn(u,p){let m=new uo,_=new AbortController,b=setTimeout(()=>{_.abort(),It(m,"TestPingServer: timeout",!1,p)},1e4);fetch(u,{signal:_.signal}).then(k=>{clearTimeout(b),k.ok?It(m,"TestPingServer: ok",!0,p):It(m,"TestPingServer: server error",!1,p)}).catch(()=>{clearTimeout(b),It(m,"TestPingServer: error",!1,p)})}function It(u,p,m,_,b){try{b&&(b.onload=null,b.onerror=null,b.onabort=null,b.ontimeout=null),_(m)}catch{}}function Vh(){this.g=new sm}function hn(u,p,m){let _=m||"";try{po(u,function(b,k){let X=b;l(b)&&(X=es(b)),p.push(_+k+"="+encodeURIComponent(X))})}catch(b){throw p.push(_+"type="+encodeURIComponent("_badmap")),b}}function os(u){this.l=u.Ub||null,this.j=u.eb||!1}E(os,jl),os.prototype.g=function(){return new Bh(this.l,this.j)},os.prototype.i=(function(u){return function(){return u}})({});function Bh(u,p){ut.call(this),this.D=u,this.o=p,this.m=void 0,this.status=this.readyState=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.u=new Headers,this.h=null,this.B="GET",this.A="",this.g=!1,this.v=this.j=this.l=null}E(Bh,ut),n=Bh.prototype,n.open=function(u,p){if(this.readyState!=0)throw this.abort(),Error("Error reopening a connection");this.B=u,this.A=p,this.readyState=1,jh(this)},n.send=function(u){if(this.readyState!=1)throw this.abort(),Error("need to call open() first. ");this.g=!0;let p={headers:this.u,method:this.B,credentials:this.m,cache:void 0};u&&(p.body=u),(this.D||a).fetch(new Request(this.A,p)).then(this.Sa.bind(this),this.ga.bind(this))},n.abort=function(){this.response=this.responseText="",this.u=new Headers,this.status=0,this.j&&this.j.cancel("Request was aborted.").catch(()=>{}),1<=this.readyState&&this.g&&this.readyState!=4&&(this.g=!1,Gh(this)),this.readyState=0},n.Sa=function(u){if(this.g&&(this.l=u,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=u.headers,this.readyState=2,jh(this)),this.g&&(this.readyState=3,jh(this),this.g)))if(this.responseType==="arraybuffer")u.arrayBuffer().then(this.Qa.bind(this),this.ga.bind(this));else if(typeof a.ReadableStream<"u"&&"body"in u){if(this.j=u.body.getReader(),this.o){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.v=new TextDecoder;iM(this)}else u.text().then(this.Ra.bind(this),this.ga.bind(this))};function iM(u){u.j.read().then(u.Pa.bind(u)).catch(u.ga.bind(u))}n.Pa=function(u){if(this.g){if(this.o&&u.value)this.response.push(u.value);else if(!this.o){var p=u.value?u.value:new Uint8Array(0);(p=this.v.decode(p,{stream:!u.done}))&&(this.response=this.responseText+=p)}u.done?Gh(this):jh(this),this.readyState==3&&iM(this)}},n.Ra=function(u){this.g&&(this.response=this.responseText=u,Gh(this))},n.Qa=function(u){this.g&&(this.response=u,Gh(this))},n.ga=function(){this.g&&Gh(this)};function Gh(u){u.readyState=4,u.l=null,u.j=null,u.v=null,jh(u)}n.setRequestHeader=function(u,p){this.u.append(u,p)},n.getResponseHeader=function(u){return this.h&&this.h.get(u.toLowerCase())||""},n.getAllResponseHeaders=function(){if(!this.h)return"";let u=[],p=this.h.entries();for(var m=p.next();!m.done;)m=m.value,u.push(m[0]+": "+m[1]),m=p.next();return u.join(`\r
|
|
159
|
+
`)};function jh(u){u.onreadystatechange&&u.onreadystatechange.call(u)}Object.defineProperty(Bh.prototype,"withCredentials",{get:function(){return this.m==="include"},set:function(u){this.m=u?"include":"same-origin"}});function oM(u){let p="";return te(u,function(m,_){p+=_,p+=":",p+=m,p+=`\r
|
|
160
|
+
`}),p}function Nv(u,p,m){e:{for(_ in m){var _=!1;break e}_=!0}_||(m=oM(m),typeof u=="string"?m!=null&&encodeURIComponent(String(m)):Je(u,p,m))}function At(u){ut.call(this),this.headers=new Map,this.o=u||null,this.h=!1,this.v=this.g=null,this.D="",this.m=0,this.l="",this.j=this.B=this.u=this.A=!1,this.I=null,this.H="",this.J=!1}E(At,ut);var f6=/^https?$/i,p6=["POST","PUT"];n=At.prototype,n.Ha=function(u){this.J=u},n.ea=function(u,p,m,_){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+u);p=p?p.toUpperCase():"GET",this.D=u,this.l="",this.m=0,this.A=!1,this.h=!0,this.g=this.o?this.o.g():wh.g(),this.v=this.o?Hl(this.o):Hl(wh),this.g.onreadystatechange=f(this.Ea,this);try{this.B=!0,this.g.open(p,String(u),!0),this.B=!1}catch(k){sM(this,k);return}if(u=m||"",m=new Map(this.headers),_)if(Object.getPrototypeOf(_)===Object.prototype)for(var b in _)m.set(b,_[b]);else if(typeof _.keys=="function"&&typeof _.get=="function")for(let k of _.keys())m.set(k,_.get(k));else throw Error("Unknown input type for opt_headers: "+String(_));_=Array.from(m.keys()).find(k=>k.toLowerCase()=="content-type"),b=a.FormData&&u instanceof a.FormData,!(0<=Array.prototype.indexOf.call(p6,p,void 0))||_||b||m.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(let[k,X]of m)this.g.setRequestHeader(k,X);this.H&&(this.g.responseType=this.H),"withCredentials"in this.g&&this.g.withCredentials!==this.J&&(this.g.withCredentials=this.J);try{lM(this),this.u=!0,this.g.send(u),this.u=!1}catch(k){sM(this,k)}};function sM(u,p){u.h=!1,u.g&&(u.j=!0,u.g.abort(),u.j=!1),u.l=p,u.m=5,aM(u),pm(u)}function aM(u){u.A||(u.A=!0,Tt(u,"complete"),Tt(u,"error"))}n.abort=function(u){this.g&&this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1,this.m=u||7,Tt(this,"complete"),Tt(this,"abort"),pm(this))},n.N=function(){this.g&&(this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1),pm(this,!0)),At.aa.N.call(this)},n.Ea=function(){this.s||(this.B||this.u||this.j?cM(this):this.bb())},n.bb=function(){cM(this)};function cM(u){if(u.h&&typeof s<"u"&&(!u.v[1]||mo(u)!=4||u.Z()!=2)){if(u.u&&mo(u)==4)Bl(u.Ea,0,u);else if(Tt(u,"readystatechange"),mo(u)==4){u.h=!1;try{let X=u.Z();e:switch(X){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var p=!0;break e;default:p=!1}var m;if(!(m=p)){var _;if(_=X===0){var b=String(u.D).match(rs)[1]||null;!b&&a.self&&a.self.location&&(b=a.self.location.protocol.slice(0,-1)),_=!f6.test(b?b.toLowerCase():"")}m=_}if(m)Tt(u,"complete"),Tt(u,"success");else{u.m=6;try{var k=2<mo(u)?u.g.statusText:""}catch{k=""}u.l=k+" ["+u.Z()+"]",aM(u)}}finally{pm(u)}}}}function pm(u,p){if(u.g){lM(u);let m=u.g,_=u.v[0]?()=>{}:null;u.g=null,u.v=null,p||Tt(u,"ready");try{m.onreadystatechange=_}catch{}}}function lM(u){u.I&&(a.clearTimeout(u.I),u.I=null)}n.isActive=function(){return!!this.g};function mo(u){return u.g?u.g.readyState:0}n.Z=function(){try{return 2<mo(this)?this.g.status:-1}catch{return-1}},n.oa=function(){try{return this.g?this.g.responseText:""}catch{return""}},n.Oa=function(u){if(this.g){var p=this.g.responseText;return u&&p.indexOf(u)==0&&(p=p.substring(u.length)),om(p)}};function uM(u){try{if(!u.g)return null;if("response"in u.g)return u.g.response;switch(u.H){case"":case"text":return u.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in u.g)return u.g.mozResponseArrayBuffer}return null}catch{return null}}function g6(u){let p={};u=(u.g&&2<=mo(u)&&u.g.getAllResponseHeaders()||"").split(`\r
|
|
161
|
+
`);for(let _=0;_<u.length;_++){if(V(u[_]))continue;var m=N(u[_]);let b=m[0];if(m=m[1],typeof m!="string")continue;m=m.trim();let k=p[b]||[];p[b]=k,k.push(m)}C(p,function(_){return _.join(", ")})}n.Ba=function(){return this.m},n.Ka=function(){return typeof this.l=="string"?this.l:String(this.l)};function Hh(u,p,m){return m&&m.internalChannelParams&&m.internalChannelParams[u]||p}function dM(u){this.Aa=0,this.i=[],this.j=new uo,this.ia=this.qa=this.I=this.W=this.g=this.ya=this.D=this.H=this.m=this.S=this.o=null,this.Ya=this.U=0,this.Va=Hh("failFast",!1,u),this.F=this.C=this.u=this.s=this.l=null,this.X=!0,this.za=this.T=-1,this.Y=this.v=this.B=0,this.Ta=Hh("baseRetryDelayMs",5e3,u),this.cb=Hh("retryDelaySeedMs",1e4,u),this.Wa=Hh("forwardChannelMaxRetries",2,u),this.wa=Hh("forwardChannelRequestTimeoutMs",2e4,u),this.pa=u&&u.xmlHttpFactory||void 0,this.Xa=u&&u.Tb||void 0,this.Ca=u&&u.useFetchStreams||!1,this.L=void 0,this.J=u&&u.supportsCrossDomainXhr||!1,this.K="",this.h=new dm(u&&u.concurrentRequestLimit),this.Da=new Vh,this.P=u&&u.fastHandshake||!1,this.O=u&&u.encodeInitMessageHeaders||!1,this.P&&this.O&&(this.O=!1),this.Ua=u&&u.Rb||!1,u&&u.xa&&this.j.xa(),u&&u.forceLongPolling&&(this.X=!1),this.ba=!this.P&&this.X&&u&&u.detectBufferingProxy||!1,this.ja=void 0,u&&u.longPollingTimeout&&0<u.longPollingTimeout&&(this.ja=u.longPollingTimeout),this.ca=void 0,this.R=0,this.M=!1,this.ka=this.A=null}n=dM.prototype,n.la=8,n.G=1,n.connect=function(u,p,m,_){at(0),this.W=u,this.H=p||{},m&&_!==void 0&&(this.H.OSID=m,this.H.OAID=_),this.F=this.X,this.I=IM(this,null,this.W),mm(this)};function wv(u){if(hM(u),u.G==3){var p=u.U++,m=zn(u.I);if(Je(m,"SID",u.K),Je(m,"RID",p),Je(m,"TYPE","terminate"),$h(u,m),p=new He(u,u.j,p),p.L=2,p.v=Ma(zn(m)),m=!1,a.navigator&&a.navigator.sendBeacon)try{m=a.navigator.sendBeacon(p.v.toString(),"")}catch{}!m&&a.Image&&(new Image().src=p.v,m=!0),m||(p.g=yM(p.j,null),p.g.ea(p.v)),p.F=Date.now(),Yl(p)}TM(u)}function gm(u){u.g&&(Ov(u),u.g.cancel(),u.g=null)}function hM(u){gm(u),u.u&&(a.clearTimeout(u.u),u.u=null),Em(u),u.h.cancel(),u.s&&(typeof u.s=="number"&&a.clearTimeout(u.s),u.s=null)}function mm(u){if(!wa(u.h)&&!u.s){u.s=!0;var p=u.Ga;Ia||Ol(),ya||(Ia(),ya=!0),Jo.add(p,u),u.B=0}}function m6(u,p){return Lh(u.h)>=u.h.j-(u.s?1:0)?!1:u.s?(u.i=p.D.concat(u.i),!0):u.G==1||u.G==2||u.B>=(u.Va?0:u.Wa)?!1:(u.s=lo(f(u.Ga,u,p),_M(u,u.B)),u.B++,!0)}n.Ga=function(u){if(this.s)if(this.s=null,this.G==1){if(!u){this.U=Math.floor(1e5*Math.random()),u=this.U++;let b=new He(this,this.j,u),k=this.o;if(this.S&&(k?(k=y(k),R(k,this.S)):k=this.S),this.m!==null||this.O||(b.H=k,k=null),this.P)e:{for(var p=0,m=0;m<this.i.length;m++){t:{var _=this.i[m];if("__data__"in _.map&&(_=_.map.__data__,typeof _=="string")){_=_.length;break t}_=void 0}if(_===void 0)break;if(p+=_,4096<p){p=m;break e}if(p===4096||m===this.i.length-1){p=m+1;break e}}p=1e3}else p=1e3;p=pM(this,b,p),m=zn(this.I),Je(m,"RID",u),Je(m,"CVER",22),this.D&&Je(m,"X-HTTP-Session-Id",this.D),$h(this,m),k&&(this.O?p="headers="+encodeURIComponent(String(oM(k)))+"&"+p:this.m&&Nv(m,this.m,k)),Xl(this.h,b),this.Ua&&Je(m,"TYPE","init"),this.P?(Je(m,"$req",p),Je(m,"SID","null"),b.T=!0,Na(b,m,null)):Na(b,m,p),this.G=2}}else this.G==3&&(u?fM(this,u):this.i.length==0||wa(this.h)||fM(this))};function fM(u,p){var m;p?m=p.l:m=u.U++;let _=zn(u.I);Je(_,"SID",u.K),Je(_,"RID",m),Je(_,"AID",u.T),$h(u,_),u.m&&u.o&&Nv(_,u.m,u.o),m=new He(u,u.j,m,u.B+1),u.m===null&&(m.H=u.o),p&&(u.i=p.D.concat(u.i)),p=pM(u,m,1e3),m.I=Math.round(.5*u.wa)+Math.round(.5*u.wa*Math.random()),Xl(u.h,m),Na(m,_,p)}function $h(u,p){u.H&&te(u.H,function(m,_){Je(p,_,m)}),u.l&&po({},function(m,_){Je(p,_,m)})}function pM(u,p,m){m=Math.min(u.i.length,m);var _=u.l?f(u.l.Na,u.l,u):null;e:{var b=u.i;let k=-1;for(;;){let X=["count="+m];k==-1?0<m?(k=b[0].g,X.push("ofs="+k)):k=0:X.push("ofs="+k);let rt=!0;for(let fn=0;fn<m;fn++){let Fe=b[fn].g,In=b[fn].map;if(Fe-=k,0>Fe)k=Math.max(0,b[fn].g-100),rt=!1;else try{hn(In,X,"req"+Fe+"_")}catch{_&&_(In)}}if(rt){_=X.join("&");break e}}}return u=u.i.splice(0,m),p.D=u,_}function gM(u){if(!u.g&&!u.u){u.Y=1;var p=u.Fa;Ia||Ol(),ya||(Ia(),ya=!0),Jo.add(p,u),u.v=0}}function bv(u){return u.g||u.u||3<=u.v?!1:(u.Y++,u.u=lo(f(u.Fa,u),_M(u,u.v)),u.v++,!0)}n.Fa=function(){if(this.u=null,mM(this),this.ba&&!(this.M||this.g==null||0>=this.R)){var u=2*this.R;this.j.info("BP detection timer enabled: "+u),this.A=lo(f(this.ab,this),u)}},n.ab=function(){this.A&&(this.A=null,this.j.info("BP detection timeout reached."),this.j.info("Buffering proxy detected and switch to long-polling!"),this.F=!1,this.M=!0,at(10),gm(this),mM(this))};function Ov(u){u.A!=null&&(a.clearTimeout(u.A),u.A=null)}function mM(u){u.g=new He(u,u.j,"rpc",u.Y),u.m===null&&(u.g.H=u.o),u.g.O=0;var p=zn(u.qa);Je(p,"RID","rpc"),Je(p,"SID",u.K),Je(p,"AID",u.T),Je(p,"CI",u.F?"0":"1"),!u.F&&u.ja&&Je(p,"TO",u.ja),Je(p,"TYPE","xmlhttp"),$h(u,p),u.m&&u.o&&Nv(p,u.m,u.o),u.L&&(u.g.I=u.L);var m=u.g;u=u.ia,m.L=1,m.v=Ma(zn(p)),m.m=null,m.P=!0,bh(m,u)}n.Za=function(){this.C!=null&&(this.C=null,gm(this),bv(this),at(19))};function Em(u){u.C!=null&&(a.clearTimeout(u.C),u.C=null)}function EM(u,p){var m=null;if(u.g==p){Em(u),Ov(u),u.g=null;var _=2}else if(Ph(u.h,p))m=p.D,xh(u.h,p),_=1;else return;if(u.G!=0){if(p.o)if(_==1){m=p.m?p.m.length:0,p=Date.now()-p.F;var b=u.B;_=Da(),Tt(_,new co(_,m)),mm(u)}else gM(u);else if(b=p.s,b==3||b==0&&0<p.X||!(_==1&&m6(u,p)||_==2&&bv(u)))switch(m&&0<m.length&&(p=u.h,p.i=p.i.concat(m)),b){case 1:Pa(u,5);break;case 4:Pa(u,10);break;case 3:Pa(u,6);break;default:Pa(u,2)}}}function _M(u,p){let m=u.Ta+Math.floor(Math.random()*u.cb);return u.isActive()||(m*=2),m*p}function Pa(u,p){if(u.j.info("Error code "+p),p==2){var m=f(u.fb,u),_=u.Xa;let b=!_;_=new go(_||"//www.google.com/images/cleardot.gif"),a.location&&a.location.protocol=="http"||Jl(_,"https"),Ma(_),b?dt(_.toString(),m):Tn(_.toString(),m)}else at(2);u.G=0,u.l&&u.l.sa(p),TM(u),hM(u)}n.fb=function(u){u?(this.j.info("Successfully pinged google.com"),at(2)):(this.j.info("Failed to ping google.com"),at(1))};function TM(u){if(u.G=0,u.ka=[],u.l){let p=ba(u.h);(p.length!=0||u.i.length!=0)&&(S(u.ka,p),S(u.ka,u.i),u.h.i.length=0,v(u.i),u.i.length=0),u.l.ra()}}function IM(u,p,m){var _=m instanceof go?zn(m):new go(m);if(_.g!="")p&&(_.g=p+"."+_.g),Oa(_,_.s);else{var b=a.location;_=b.protocol,p=p?p+"."+b.hostname:b.hostname,b=+b.port;var k=new go(null);_&&Jl(k,_),p&&(k.g=p),b&&Oa(k,b),m&&(k.l=m),_=k}return m=u.D,p=u.ya,m&&p&&Je(_,m,p),Je(_,"VER",u.la),$h(u,_),_}function yM(u,p,m){if(p&&!u.J)throw Error("Can't create secondary domain capable XhrIo object.");return p=u.Ca&&!u.pa?new At(new os({eb:m})):new At(u.pa),p.Ha(u.J),p}n.isActive=function(){return!!this.l&&this.l.isActive(this)};function vM(){}n=vM.prototype,n.ua=function(){},n.ta=function(){},n.sa=function(){},n.ra=function(){},n.isActive=function(){return!0},n.Na=function(){};function _m(){}_m.prototype.g=function(u,p){return new or(u,p)};function or(u,p){ut.call(this),this.g=new dM(p),this.l=u,this.h=p&&p.messageUrlParams||null,u=p&&p.messageHeaders||null,p&&p.clientProtocolHeaderRequired&&(u?u["X-Client-Protocol"]="webchannel":u={"X-Client-Protocol":"webchannel"}),this.g.o=u,u=p&&p.initMessageHeaders||null,p&&p.messageContentType&&(u?u["X-WebChannel-Content-Type"]=p.messageContentType:u={"X-WebChannel-Content-Type":p.messageContentType}),p&&p.va&&(u?u["X-WebChannel-Client-Profile"]=p.va:u={"X-WebChannel-Client-Profile":p.va}),this.g.S=u,(u=p&&p.Sb)&&!V(u)&&(this.g.m=u),this.v=p&&p.supportsCrossDomainXhr||!1,this.u=p&&p.sendRawJson||!1,(p=p&&p.httpSessionIdParam)&&!V(p)&&(this.g.D=p,u=this.h,u!==null&&p in u&&(u=this.h,p in u&&delete u[p])),this.j=new eu(this)}E(or,ut),or.prototype.m=function(){this.g.l=this.j,this.v&&(this.g.J=!0),this.g.connect(this.l,this.h||void 0)},or.prototype.close=function(){wv(this.g)},or.prototype.o=function(u){var p=this.g;if(typeof u=="string"){var m={};m.__data__=u,u=m}else this.u&&(m={},m.__data__=es(u),u=m);p.i.push(new fo(p.Ya++,u)),p.G==3&&mm(p)},or.prototype.N=function(){this.g.l=null,delete this.j,wv(this.g),delete this.g,or.aa.N.call(this)};function SM(u){Ei.call(this),u.__headers__&&(this.headers=u.__headers__,this.statusCode=u.__status__,delete u.__headers__,delete u.__status__);var p=u.__sm__;if(p){e:{for(let m in p){u=m;break e}u=void 0}(this.i=u)&&(u=this.i,p=p!==null&&u in p?p[u]:void 0),this.data=p}else this.data=u}E(SM,Ei);function AM(){Wl.call(this),this.status=1}E(AM,Wl);function eu(u){this.g=u}E(eu,vM),eu.prototype.ua=function(){Tt(this.g,"a")},eu.prototype.ta=function(u){Tt(this.g,new SM(u))},eu.prototype.sa=function(u){Tt(this.g,new AM)},eu.prototype.ra=function(){Tt(this.g,"b")},_m.prototype.createWebChannel=_m.prototype.g,or.prototype.send=or.prototype.o,or.prototype.open=or.prototype.m,or.prototype.close=or.prototype.close,rb=Ho.createWebChannelTransport=function(){return new _m},nb=Ho.getStatEventTarget=function(){return Da()},tb=Ho.Event=_i,qI=Ho.Stat={mb:0,pb:1,qb:2,Jb:3,Ob:4,Lb:5,Mb:6,Kb:7,Ib:8,Nb:9,PROXY:10,NOPROXY:11,Gb:12,Cb:13,Db:14,Bb:15,Eb:16,Fb:17,ib:18,hb:19,jb:20},zl.NO_ERROR=0,zl.TIMEOUT=8,zl.HTTP_ERROR=6,ig=Ho.ErrorCode=zl,ts.COMPLETE="complete",eb=Ho.EventType=ts,$l.EventType=Nr,Nr.OPEN="a",Nr.CLOSE="b",Nr.ERROR="c",Nr.MESSAGE="d",ut.prototype.listen=ut.prototype.K,Od=Ho.WebChannel=$l,zie=Ho.FetchXmlHttpFactory=os,At.prototype.listenOnce=At.prototype.L,At.prototype.getLastError=At.prototype.Ka,At.prototype.getLastErrorCode=At.prototype.Ba,At.prototype.getStatus=At.prototype.Z,At.prototype.getResponseJson=At.prototype.Oa,At.prototype.getResponseText=At.prototype.oa,At.prototype.send=At.prototype.ea,At.prototype.setWithCredentials=At.prototype.Ha,Zw=Ho.XhrIo=At}).apply(typeof zI<"u"?zI:typeof self<"u"?self:typeof window<"u"?window:{});var IH="@firebase/firestore",yH="4.8.0";var Vt=class{constructor(e){this.uid=e}isAuthenticated(){return this.uid!=null}toKey(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"}isEqual(e){return e.uid===this.uid}};Vt.UNAUTHENTICATED=new Vt(null),Vt.GOOGLE_CREDENTIALS=new Vt("google-credentials-uid"),Vt.FIRST_PARTY=new Vt("first-party-uid"),Vt.MOCK_USER=new Vt("mock-user");var Eh="11.10.0";var ca=new Ur("@firebase/firestore");function Ud(){return ca.logLevel}function _0(n){ca.setLogLevel(n)}function j(n,...e){if(ca.logLevel<=Re.DEBUG){let t=e.map(T0);ca.debug(`Firestore (${Eh}): ${n}`,...t)}}function Mt(n,...e){if(ca.logLevel<=Re.ERROR){let t=e.map(T0);ca.error(`Firestore (${Eh}): ${n}`,...t)}}function qo(n,...e){if(ca.logLevel<=Re.WARN){let t=e.map(T0);ca.warn(`Firestore (${Eh}): ${n}`,...t)}}function T0(n){if(typeof n=="string")return n;try{return(function(t){return JSON.stringify(t)})(n)}catch{return n}}function re(n,e,t){let r="Unexpected state";typeof e=="string"?r=e:t=e,k$(n,r,t)}function k$(n,e,t){let r=`FIRESTORE (${Eh}) INTERNAL ASSERTION FAILED: ${e} (ID: ${n.toString(16)})`;if(t!==void 0)try{r+=" CONTEXT: "+JSON.stringify(t)}catch{r+=" CONTEXT: "+t}throw Mt(r),new Error(r)}function ae(n,e,t,r){let i="Unexpected state";typeof t=="string"?i=t:r=t,n||k$(e,i,r)}function se(n,e){return n}var x={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"},G=class extends Xn{constructor(e,t){super(e,t),this.code=e,this.message=t,this.toString=()=>`${this.name}: [code=${this.code}]: ${this.message}`}};var nr=class{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}};var ay=class{constructor(e,t){this.user=t,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${e}`)}},db=class{getToken(){return Promise.resolve(null)}invalidateToken(){}start(e,t){e.enqueueRetryable(()=>t(Vt.UNAUTHENTICATED))}shutdown(){}},hb=class{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}},fb=class{constructor(e){this.t=e,this.currentUser=Vt.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(e,t){ae(this.o===void 0,42304);let r=this.i,i=c=>this.i!==r?(r=this.i,t(c)):Promise.resolve(),o=new nr;this.o=()=>{this.i++,this.currentUser=this.u(),o.resolve(),o=new nr,e.enqueueRetryable(()=>i(this.currentUser))};let s=()=>{let c=o;e.enqueueRetryable(()=>I(this,null,function*(){yield c.promise,yield i(this.currentUser)}))},a=c=>{j("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=c,this.o&&(this.auth.addAuthTokenListener(this.o),s())};this.t.onInit(c=>a(c)),setTimeout(()=>{if(!this.auth){let c=this.t.getImmediate({optional:!0});c?a(c):(j("FirebaseAuthCredentialsProvider","Auth not yet detected"),o.resolve(),o=new nr)}},0),s()}getToken(){let e=this.i,t=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(t).then(r=>this.i!==e?(j("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):r?(ae(typeof r.accessToken=="string",31837,{l:r}),new ay(r.accessToken,this.currentUser)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.o&&this.auth.removeAuthTokenListener(this.o),this.o=void 0}u(){let e=this.auth&&this.auth.getUid();return ae(e===null||typeof e=="string",2055,{h:e}),new Vt(e)}},pb=class{constructor(e,t,r){this.P=e,this.T=t,this.I=r,this.type="FirstParty",this.user=Vt.FIRST_PARTY,this.A=new Map}R(){return this.I?this.I():null}get headers(){this.A.set("X-Goog-AuthUser",this.P);let e=this.R();return e&&this.A.set("Authorization",e),this.T&&this.A.set("X-Goog-Iam-Authorization-Token",this.T),this.A}},gb=class{constructor(e,t,r){this.P=e,this.T=t,this.I=r}getToken(){return Promise.resolve(new pb(this.P,this.T,this.I))}start(e,t){e.enqueueRetryable(()=>t(Vt.FIRST_PARTY))}shutdown(){}invalidateToken(){}},cy=class{constructor(e){this.value=e,this.type="AppCheck",this.headers=new Map,e&&e.length>0&&this.headers.set("x-firebase-appcheck",this.value)}},mb=class{constructor(e,t){this.V=t,this.forceRefresh=!1,this.appCheck=null,this.m=null,this.p=null,Qn(e)&&e.settings.appCheckToken&&(this.p=e.settings.appCheckToken)}start(e,t){ae(this.o===void 0,3512);let r=o=>{o.error!=null&&j("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${o.error.message}`);let s=o.token!==this.m;return this.m=o.token,j("FirebaseAppCheckTokenProvider",`Received ${s?"new":"existing"} token.`),s?t(o.token):Promise.resolve()};this.o=o=>{e.enqueueRetryable(()=>r(o))};let i=o=>{j("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=o,this.o&&this.appCheck.addTokenListener(this.o)};this.V.onInit(o=>i(o)),setTimeout(()=>{if(!this.appCheck){let o=this.V.getImmediate({optional:!0});o?i(o):j("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}},0)}getToken(){if(this.p)return Promise.resolve(new cy(this.p));let e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then(t=>t?(ae(typeof t.token=="string",44558,{tokenResult:t}),this.m=t.token,new cy(t.token)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.o&&this.appCheck.removeTokenListener(this.o),this.o=void 0}};function qie(n){let e=typeof self<"u"&&(self.crypto||self.msCrypto),t=new Uint8Array(n);if(e&&typeof e.getRandomValues=="function")e.getRandomValues(t);else for(let r=0;r<n;r++)t[r]=Math.floor(256*Math.random());return t}function F$(){return new TextEncoder}var Ig=class{static newId(){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",t=62*Math.floor(4.129032258064516),r="";for(;r.length<20;){let i=qie(40);for(let o=0;o<i.length;++o)r.length<20&&i[o]<t&&(r+=e.charAt(i[o]%62))}return r}};function Ie(n,e){return n<e?-1:n>e?1:0}function Eb(n,e){let t=0;for(;t<n.length&&t<e.length;){let r=n.codePointAt(t),i=e.codePointAt(t);if(r!==i){if(r<128&&i<128)return Ie(r,i);{let o=F$(),s=Kie(o.encode(vH(n,t)),o.encode(vH(e,t)));return s!==0?s:Ie(r,i)}}t+=r>65535?2:1}return Ie(n.length,e.length)}function vH(n,e){return n.codePointAt(e)>65535?n.substring(e,e+2):n.substring(e,e+1)}function Kie(n,e){for(let t=0;t<n.length&&t<e.length;++t)if(n[t]!==e[t])return Ie(n[t],e[t]);return Ie(n.length,e.length)}function qd(n,e,t){return n.length===e.length&&n.every((r,i)=>t(r,e[i]))}function U$(n){return n+"\0"}var SH="__name__",ly=class n{constructor(e,t,r){t===void 0?t=0:t>e.length&&re(637,{offset:t,range:e.length}),r===void 0?r=e.length-t:r>e.length-t&&re(1746,{length:r,range:e.length-t}),this.segments=e,this.offset=t,this.len=r}get length(){return this.len}isEqual(e){return n.comparator(this,e)===0}child(e){let t=this.segments.slice(this.offset,this.limit());return e instanceof n?e.forEach(r=>{t.push(r)}):t.push(e),this.construct(t)}limit(){return this.offset+this.length}popFirst(e){return e=e===void 0?1:e,this.construct(this.segments,this.offset+e,this.length-e)}popLast(){return this.construct(this.segments,this.offset,this.length-1)}firstSegment(){return this.segments[this.offset]}lastSegment(){return this.get(this.length-1)}get(e){return this.segments[this.offset+e]}isEmpty(){return this.length===0}isPrefixOf(e){if(e.length<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,r=this.limit();t<r;t++)e(this.segments[t])}toArray(){return this.segments.slice(this.offset,this.limit())}static comparator(e,t){let r=Math.min(e.length,t.length);for(let i=0;i<r;i++){let o=n.compareSegments(e.get(i),t.get(i));if(o!==0)return o}return Ie(e.length,t.length)}static compareSegments(e,t){let r=n.isNumericId(e),i=n.isNumericId(t);return r&&!i?-1:!r&&i?1:r&&i?n.extractNumericId(e).compare(n.extractNumericId(t)):Eb(e,t)}static isNumericId(e){return e.startsWith("__id")&&e.endsWith("__")}static extractNumericId(e){return jo.fromString(e.substring(4,e.length-2))}},ke=class n extends ly{construct(e,t,r){return new n(e,t,r)}canonicalString(){return this.toArray().join("/")}toString(){return this.canonicalString()}toUriEncodedString(){return this.toArray().map(encodeURIComponent).join("/")}static fromString(...e){let t=[];for(let r of e){if(r.indexOf("//")>=0)throw new G(x.INVALID_ARGUMENT,`Invalid segment (${r}). Paths must not contain // in them.`);t.push(...r.split("/").filter(i=>i.length>0))}return new n(t)}static emptyPath(){return new n([])}},Yie=/^[_a-zA-Z][_a-zA-Z0-9]*$/,Qt=class n extends ly{construct(e,t,r){return new n(e,t,r)}static isValidIdentifier(e){return Yie.test(e)}canonicalString(){return this.toArray().map(e=>(e=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),n.isValidIdentifier(e)||(e="`"+e+"`"),e)).join(".")}toString(){return this.canonicalString()}isKeyField(){return this.length===1&&this.get(0)===SH}static keyField(){return new n([SH])}static fromServerFormat(e){let t=[],r="",i=0,o=()=>{if(r.length===0)throw new G(x.INVALID_ARGUMENT,`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);t.push(r),r=""},s=!1;for(;i<e.length;){let a=e[i];if(a==="\\"){if(i+1===e.length)throw new G(x.INVALID_ARGUMENT,"Path has trailing escape character: "+e);let c=e[i+1];if(c!=="\\"&&c!=="."&&c!=="`")throw new G(x.INVALID_ARGUMENT,"Path has invalid escape sequence: "+e);r+=c,i+=2}else a==="`"?(s=!s,i++):a!=="."||s?(r+=a,i++):(o(),i++)}if(o(),s)throw new G(x.INVALID_ARGUMENT,"Unterminated ` in path: "+e);return new n(t)}static emptyPath(){return new n([])}};var Z=class n{constructor(e){this.path=e}static fromPath(e){return new n(ke.fromString(e))}static fromName(e){return new n(ke.fromString(e).popFirst(5))}static empty(){return new n(ke.emptyPath())}get collectionGroup(){return this.path.popLast().lastSegment()}hasCollectionId(e){return this.path.length>=2&&this.path.get(this.path.length-2)===e}getCollectionGroup(){return this.path.get(this.path.length-2)}getCollectionPath(){return this.path.popLast()}isEqual(e){return e!==null&&ke.comparator(this.path,e.path)===0}toString(){return this.path.toString()}static comparator(e,t){return ke.comparator(e.path,t.path)}static isDocumentKey(e){return e.length%2==0}static fromSegments(e){return new n(new ke(e.slice()))}};function I0(n,e,t){if(!t)throw new G(x.INVALID_ARGUMENT,`Function ${n}() cannot be called with an empty ${e}.`)}function Xie(n,e,t,r){if(e===!0&&r===!0)throw new G(x.INVALID_ARGUMENT,`${n} and ${t} cannot be used together.`)}function AH(n){if(!Z.isDocumentKey(n))throw new G(x.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${n} has ${n.length}.`)}function CH(n){if(Z.isDocumentKey(n))throw new G(x.INVALID_ARGUMENT,`Invalid collection reference. Collection references must have an odd number of segments, but ${n} has ${n.length}.`)}function V$(n){return typeof n=="object"&&n!==null&&(Object.getPrototypeOf(n)===Object.prototype||Object.getPrototypeOf(n)===null)}function rv(n){if(n===void 0)return"undefined";if(n===null)return"null";if(typeof n=="string")return n.length>20&&(n=`${n.substring(0,20)}...`),JSON.stringify(n);if(typeof n=="number"||typeof n=="boolean")return""+n;if(typeof n=="object"){if(n instanceof Array)return"an array";{let e=(function(r){return r.constructor?r.constructor.name:null})(n);return e?`a custom ${e} object`:"an object"}}return typeof n=="function"?"a function":re(12329,{type:typeof n})}function rr(n,e){if("_delegate"in n&&(n=n._delegate),!(n instanceof e)){if(e.name===n.constructor.name)throw new G(x.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{let t=rv(n);throw new G(x.INVALID_ARGUMENT,`Expected type '${e.name}', but it was: ${t}`)}}return n}function Qie(n,e){if(e<=0)throw new G(x.INVALID_ARGUMENT,`Function ${n}() requires a positive number, but it was: ${e}.`)}function Bt(n,e){let t={typeString:n};return e&&(t.value=e),t}function Kg(n,e){if(!V$(n))throw new G(x.INVALID_ARGUMENT,"JSON must be an object");let t;for(let r in e)if(e[r]){let i=e[r].typeString,o="value"in e[r]?{value:e[r].value}:void 0;if(!(r in n)){t=`JSON missing required field: '${r}'`;break}let s=n[r];if(i&&typeof s!==i){t=`JSON field '${r}' must be a ${i}.`;break}if(o!==void 0&&s!==o.value){t=`Expected '${r}' field to equal '${o.value}'`;break}}if(t)throw new G(x.INVALID_ARGUMENT,t);return!0}var DH=-62135596800,RH=1e6,_t=class n{static now(){return n.fromMillis(Date.now())}static fromDate(e){return n.fromMillis(e.getTime())}static fromMillis(e){let t=Math.floor(e/1e3),r=Math.floor((e-1e3*t)*RH);return new n(t,r)}constructor(e,t){if(this.seconds=e,this.nanoseconds=t,t<0)throw new G(x.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(t>=1e9)throw new G(x.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(e<DH)throw new G(x.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e);if(e>=253402300800)throw new G(x.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/RH}_compareTo(e){return this.seconds===e.seconds?Ie(this.nanoseconds,e.nanoseconds):Ie(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:n._jsonSchemaVersion,seconds:this.seconds,nanoseconds:this.nanoseconds}}static fromJSON(e){if(Kg(e,n._jsonSchema))return new n(e.seconds,e.nanoseconds)}valueOf(){let e=this.seconds-DH;return String(e).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}};_t._jsonSchemaVersion="firestore/timestamp/1.0",_t._jsonSchema={type:Bt("string",_t._jsonSchemaVersion),seconds:Bt("number"),nanoseconds:Bt("number")};var le=class n{static fromTimestamp(e){return new n(e)}static min(){return new n(new _t(0,0))}static max(){return new n(new _t(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}};var Kd=-1,Yd=class{constructor(e,t,r,i){this.indexId=e,this.collectionGroup=t,this.fields=r,this.indexState=i}};function _b(n){return n.fields.find(e=>e.kind===2)}function sl(n){return n.fields.filter(e=>e.kind!==2)}Yd.UNKNOWN_ID=-1;var Hd=class{constructor(e,t){this.fieldPath=e,this.kind=t}};var yg=class n{constructor(e,t){this.sequenceNumber=e,this.offset=t}static empty(){return new n(0,jr.min())}};function B$(n,e){let t=n.toTimestamp().seconds,r=n.toTimestamp().nanoseconds+1,i=le.fromTimestamp(r===1e9?new _t(t+1,0):new _t(t,r));return new jr(i,Z.empty(),e)}function G$(n){return new jr(n.readTime,n.key,Kd)}var jr=class n{constructor(e,t,r){this.readTime=e,this.documentKey=t,this.largestBatchId=r}static min(){return new n(le.min(),Z.empty(),Kd)}static max(){return new n(le.max(),Z.empty(),Kd)}};function y0(n,e){let t=n.readTime.compareTo(e.readTime);return t!==0?t:(t=Z.comparator(n.documentKey,e.documentKey),t!==0?t:Ie(n.largestBatchId,e.largestBatchId))}var j$="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.",uy=class{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(e){this.onCommittedListeners.push(e)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach(e=>e())}};function ma(n){return I(this,null,function*(){if(n.code!==x.FAILED_PRECONDITION||n.message!==j$)throw n;j("LocalStore","Unexpectedly lost primary lease")})}var L=class n{constructor(e){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e(t=>{this.isDone=!0,this.result=t,this.nextCallback&&this.nextCallback(t)},t=>{this.isDone=!0,this.error=t,this.catchCallback&&this.catchCallback(t)})}catch(e){return this.next(void 0,e)}next(e,t){return this.callbackAttached&&re(59440),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(t,this.error):this.wrapSuccess(e,this.result):new n((r,i)=>{this.nextCallback=o=>{this.wrapSuccess(e,o).next(r,i)},this.catchCallback=o=>{this.wrapFailure(t,o).next(r,i)}})}toPromise(){return new Promise((e,t)=>{this.next(e,t)})}wrapUserFunction(e){try{let t=e();return t instanceof n?t:n.resolve(t)}catch(t){return n.reject(t)}}wrapSuccess(e,t){return e?this.wrapUserFunction(()=>e(t)):n.resolve(t)}wrapFailure(e,t){return e?this.wrapUserFunction(()=>e(t)):n.reject(t)}static resolve(e){return new n((t,r)=>{t(e)})}static reject(e){return new n((t,r)=>{r(e)})}static waitFor(e){return new n((t,r)=>{let i=0,o=0,s=!1;e.forEach(a=>{++i,a.next(()=>{++o,s&&o===i&&t()},c=>r(c))}),s=!0,o===i&&t()})}static or(e){let t=n.resolve(!1);for(let r of e)t=t.next(i=>i?n.resolve(i):r());return t}static forEach(e,t){let r=[];return e.forEach((i,o)=>{r.push(t.call(this,i,o))}),this.waitFor(r)}static mapArray(e,t){return new n((r,i)=>{let o=e.length,s=new Array(o),a=0;for(let c=0;c<o;c++){let l=c;t(e[l]).next(d=>{s[l]=d,++a,a===o&&r(s)},d=>i(d))}})}static doWhile(e,t){return new n((r,i)=>{let o=()=>{e()===!0?t().next(()=>{o()},i):r()};o()})}};var yr="SimpleDb",dy=class n{static open(e,t,r,i){try{return new n(t,e.transaction(i,r))}catch(o){throw new pl(t,o)}}constructor(e,t){this.action=e,this.transaction=t,this.aborted=!1,this.S=new nr,this.transaction.oncomplete=()=>{this.S.resolve()},this.transaction.onabort=()=>{t.error?this.S.reject(new pl(e,t.error)):this.S.resolve()},this.transaction.onerror=r=>{let i=v0(r.target.error);this.S.reject(new pl(e,i))}}get D(){return this.S.promise}abort(e){e&&this.S.reject(e),this.aborted||(j(yr,"Aborting transaction:",e?e.message:"Client-initiated abort"),this.aborted=!0,this.transaction.abort())}v(){let e=this.transaction;this.aborted||typeof e.commit!="function"||e.commit()}store(e){let t=this.transaction.objectStore(e);return new Ib(t)}},Xd=class n{static delete(e){return j(yr,"Removing database:",e),cl(IT().indexedDB.deleteDatabase(e)).toPromise()}static C(){if(!od())return!1;if(n.F())return!0;let e=Kt(),t=n.M(e),r=0<t&&t<10,i=H$(e),o=0<i&&i<4.5;return!(e.indexOf("MSIE ")>0||e.indexOf("Trident/")>0||e.indexOf("Edge/")>0||r||o)}static F(){var e;return typeof process<"u"&&((e=process.__PRIVATE_env)===null||e===void 0?void 0:e.O)==="YES"}static N(e,t){return e.store(t)}static M(e){let t=e.match(/i(?:phone|pad|pod) os ([\d_]+)/i),r=t?t[1].split("_").slice(0,2).join("."):"-1";return Number(r)}constructor(e,t,r){this.name=e,this.version=t,this.B=r,this.L=null,n.M(Kt())===12.2&&Mt("Firestore persistence suffers from a bug in iOS 12.2 Safari that may cause your app to stop working. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.")}k(e){return I(this,null,function*(){return this.db||(j(yr,"Opening database:",this.name),this.db=yield new Promise((t,r)=>{let i=indexedDB.open(this.name,this.version);i.onsuccess=o=>{let s=o.target.result;t(s)},i.onblocked=()=>{r(new pl(e,"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed."))},i.onerror=o=>{let s=o.target.error;s.name==="VersionError"?r(new G(x.FAILED_PRECONDITION,"A newer version of the Firestore SDK was previously used and so the persisted data is not compatible with the version of the SDK you are now using. The SDK will operate with persistence disabled. If you need persistence, please re-upgrade to a newer version of the SDK or else clear the persisted IndexedDB data for your app to start fresh.")):s.name==="InvalidStateError"?r(new G(x.FAILED_PRECONDITION,"Unable to open an IndexedDB connection. This could be due to running in a private browsing session on a browser whose private browsing sessions do not support IndexedDB: "+s)):r(new pl(e,s))},i.onupgradeneeded=o=>{j(yr,'Database "'+this.name+'" requires upgrade from version:',o.oldVersion);let s=o.target.result;if(this.L!==null&&this.L!==o.oldVersion)throw new Error(`refusing to open IndexedDB database due to potential corruption of the IndexedDB database data; this corruption could be caused by clicking the "clear site data" button in a web browser; try reloading the web page to re-initialize the IndexedDB database: lastClosedDbVersion=${this.L}, event.oldVersion=${o.oldVersion}, event.newVersion=${o.newVersion}, db.version=${s.version}`);this.B.q(s,i.transaction,o.oldVersion,this.version).next(()=>{j(yr,"Database upgrade to version "+this.version+" complete")})}}),this.db.addEventListener("close",t=>{let r=t.target;this.L=r.version},{passive:!0})),this.db.addEventListener("versionchange",t=>{var r;t.newVersion===null&&(qo('Received "versionchange" event with newVersion===null; notifying the registered DatabaseDeletedListener, if any'),(r=this.databaseDeletedListener)===null||r===void 0||r.call(this))},{passive:!0}),this.db})}setDatabaseDeletedListener(e){if(this.databaseDeletedListener)throw new Error("setDatabaseDeletedListener() may only be called once, and it has already been called");this.databaseDeletedListener=e}runTransaction(e,t,r,i){return I(this,null,function*(){let o=t==="readonly",s=0;for(;;){++s;try{this.db=yield this.k(e);let a=dy.open(this.db,e,o?"readonly":"readwrite",r),c=i(a).next(l=>(a.v(),l)).catch(l=>(a.abort(l),L.reject(l))).toPromise();return c.catch(()=>{}),yield a.D,c}catch(a){let c=a,l=c.name!=="FirebaseError"&&s<3;if(j(yr,"Transaction failed with error:",c.message,"Retrying:",l),this.close(),!l)return Promise.reject(c)}}})}close(){this.db&&this.db.close(),this.db=void 0}};function H$(n){let e=n.match(/Android ([\d.]+)/i),t=e?e[1].split(".").slice(0,2).join("."):"-1";return Number(t)}var Tb=class{constructor(e){this.$=e,this.U=!1,this.K=null}get isDone(){return this.U}get W(){return this.K}set cursor(e){this.$=e}done(){this.U=!0}G(e){this.K=e}delete(){return cl(this.$.delete())}},pl=class extends G{constructor(e,t){super(x.UNAVAILABLE,`IndexedDB transaction '${e}' failed: ${t}`),this.name="IndexedDbTransactionError"}};function Ea(n){return n.name==="IndexedDbTransactionError"}var Ib=class{constructor(e){this.store=e}put(e,t){let r;return t!==void 0?(j(yr,"PUT",this.store.name,e,t),r=this.store.put(t,e)):(j(yr,"PUT",this.store.name,"<auto-key>",e),r=this.store.put(e)),cl(r)}add(e){return j(yr,"ADD",this.store.name,e,e),cl(this.store.add(e))}get(e){return cl(this.store.get(e)).next(t=>(t===void 0&&(t=null),j(yr,"GET",this.store.name,e,t),t))}delete(e){return j(yr,"DELETE",this.store.name,e),cl(this.store.delete(e))}count(){return j(yr,"COUNT",this.store.name),cl(this.store.count())}j(e,t){let r=this.options(e,t),i=r.index?this.store.index(r.index):this.store;if(typeof i.getAll=="function"){let o=i.getAll(r.range);return new L((s,a)=>{o.onerror=c=>{a(c.target.error)},o.onsuccess=c=>{s(c.target.result)}})}{let o=this.cursor(r),s=[];return this.J(o,(a,c)=>{s.push(c)}).next(()=>s)}}H(e,t){let r=this.store.getAll(e,t===null?void 0:t);return new L((i,o)=>{r.onerror=s=>{o(s.target.error)},r.onsuccess=s=>{i(s.target.result)}})}Y(e,t){j(yr,"DELETE ALL",this.store.name);let r=this.options(e,t);r.Z=!1;let i=this.cursor(r);return this.J(i,(o,s,a)=>a.delete())}X(e,t){let r;t?r=e:(r={},t=e);let i=this.cursor(r);return this.J(i,t)}ee(e){let t=this.cursor({});return new L((r,i)=>{t.onerror=o=>{let s=v0(o.target.error);i(s)},t.onsuccess=o=>{let s=o.target.result;s?e(s.primaryKey,s.value).next(a=>{a?s.continue():r()}):r()}})}J(e,t){let r=[];return new L((i,o)=>{e.onerror=s=>{o(s.target.error)},e.onsuccess=s=>{let a=s.target.result;if(!a)return void i();let c=new Tb(a),l=t(a.primaryKey,a.value,c);if(l instanceof L){let d=l.catch(h=>(c.done(),L.reject(h)));r.push(d)}c.isDone?i():c.W===null?a.continue():a.continue(c.W)}}).next(()=>L.waitFor(r))}options(e,t){let r;return e!==void 0&&(typeof e=="string"?r=e:t=e),{index:r,range:t}}cursor(e){let t="next";if(e.reverse&&(t="prev"),e.index){let r=this.store.index(e.index);return e.Z?r.openKeyCursor(e.range,t):r.openCursor(e.range,t)}return this.store.openCursor(e.range,t)}};function cl(n){return new L((e,t)=>{n.onsuccess=r=>{let i=r.target.result;e(i)},n.onerror=r=>{let i=v0(r.target.error);t(i)}})}var NH=!1;function v0(n){let e=Xd.M(Kt());if(e>=12.2&&e<13){let t="An internal error was encountered in the Indexed Database server";if(n.message.indexOf(t)>=0){let r=new G("internal",`IOS_INDEXEDDB_BUG1: IndexedDb has thrown '${t}'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.`);return NH||(NH=!0,setTimeout(()=>{throw r},0)),r}}return n}var hg="IndexBackfiller",yb=class{constructor(e,t){this.asyncQueue=e,this.te=t,this.task=null}start(){this.ne(15e3)}stop(){this.task&&(this.task.cancel(),this.task=null)}get started(){return this.task!==null}ne(e){j(hg,`Scheduled in ${e}ms`),this.task=this.asyncQueue.enqueueAfterDelay("index_backfill",e,()=>I(this,null,function*(){this.task=null;try{let t=yield this.te.re();j(hg,`Documents written: ${t}`)}catch(t){Ea(t)?j(hg,"Ignoring IndexedDB error during index backfill: ",t):yield ma(t)}yield this.ne(6e4)}))}},vb=class{constructor(e,t){this.localStore=e,this.persistence=t}re(e=50){return I(this,null,function*(){return this.persistence.runTransaction("Backfill Indexes","readwrite-primary",t=>this.ie(t,e))})}ie(e,t){let r=new Set,i=t,o=!0;return L.doWhile(()=>o===!0&&i>0,()=>this.localStore.indexManager.getNextCollectionGroupToUpdate(e).next(s=>{if(s!==null&&!r.has(s))return j(hg,`Processing collection: ${s}`),this.se(e,s,i).next(a=>{i-=a,r.add(s)});o=!1})).next(()=>t-i)}se(e,t,r){return this.localStore.indexManager.getMinOffsetFromCollectionGroup(e,t).next(i=>this.localStore.localDocuments.getNextDocuments(e,t,i,r).next(o=>{let s=o.changes;return this.localStore.indexManager.updateIndexEntries(e,s).next(()=>this.oe(i,o)).next(a=>(j(hg,`Updating offset: ${a}`),this.localStore.indexManager.updateCollectionGroup(e,t,a))).next(()=>s.size)}))}oe(e,t){let r=e;return t.changes.forEach((i,o)=>{let s=G$(o);y0(s,r)>0&&(r=s)}),new jr(r.readTime,r.documentKey,Math.max(t.batchId,e.largestBatchId))}};var vr=(()=>{class n{constructor(t,r){this.previousValue=t,r&&(r.sequenceNumberHandler=i=>this._e(i),this.ae=i=>r.writeSequenceNumber(i))}_e(t){return this.previousValue=Math.max(t,this.previousValue),this.previousValue}next(){let t=++this.previousValue;return this.ae&&this.ae(t),t}}n.ue=-1;return n})(),gl=-1;function Yg(n){return n==null}function vg(n){return n===0&&1/n==-1/0}function $$(n){return typeof n=="number"&&Number.isInteger(n)&&!vg(n)&&n<=Number.MAX_SAFE_INTEGER&&n>=Number.MIN_SAFE_INTEGER}var hy="";function kn(n){let e="";for(let t=0;t<n.length;t++)e.length>0&&(e=wH(e)),e=Jie(n.get(t),e);return wH(e)}function Jie(n,e){let t=e,r=n.length;for(let i=0;i<r;i++){let o=n.charAt(i);switch(o){case"\0":t+="";break;case hy:t+="";break;default:t+=o}}return t}function wH(n){return n+hy+""}function eo(n){let e=n.length;if(ae(e>=2,64408,{path:n}),e===2)return ae(n.charAt(0)===hy&&n.charAt(1)==="",56145,{path:n}),ke.emptyPath();let t=e-2,r=[],i="";for(let o=0;o<e;){let s=n.indexOf(hy,o);switch((s<0||s>t)&&re(50515,{path:n}),n.charAt(s+1)){case"":let a=n.substring(o,s),c;i.length===0?c=a:(i+=a,c=i,i=""),r.push(c);break;case"":i+=n.substring(o,s),i+="\0";break;case"":i+=n.substring(o,s+1);break;default:re(61167,{path:n})}o=s+2}return new ke(r)}var al="remoteDocuments",Xg="owner",Md="owner",Sg="mutationQueues",Zie="userId",di="mutations",bH="batchId",hl="userMutationsIndex",OH=["userId","batchId"];function ZI(n,e){return[n,kn(e)]}function W$(n,e,t){return[n,kn(e),t]}var eoe={},Qd="documentMutations",fy="remoteDocumentsV14",toe=["prefixPath","collectionGroup","readTime","documentId"],ey="documentKeyIndex",noe=["prefixPath","collectionGroup","documentId"],z$="collectionGroupIndex",roe=["collectionGroup","readTime","prefixPath","documentId"],Ag="remoteDocumentGlobal",Sb="remoteDocumentGlobalKey",Jd="targets",q$="queryTargetsIndex",ioe=["canonicalId","targetId"],Zd="targetDocuments",ooe=["targetId","path"],S0="documentTargetsIndex",soe=["path","targetId"],py="targetGlobalKey",ml="targetGlobal",Cg="collectionParents",aoe=["collectionId","parent"],eh="clientMetadata",coe="clientId",iv="bundles",loe="bundleId",ov="namedQueries",uoe="name",A0="indexConfiguration",doe="indexId",Ab="collectionGroupIndex",hoe="collectionGroup",fg="indexState",foe=["indexId","uid"],K$="sequenceNumberIndex",poe=["uid","sequenceNumber"],pg="indexEntries",goe=["indexId","uid","arrayValue","directionalValue","orderedDocumentKey","documentKey"],Y$="documentKeyIndex",moe=["indexId","uid","orderedDocumentKey"],sv="documentOverlays",Eoe=["userId","collectionPath","documentId"],Cb="collectionPathOverlayIndex",_oe=["userId","collectionPath","largestBatchId"],X$="collectionGroupOverlayIndex",Toe=["userId","collectionGroup","largestBatchId"],C0="globals",Ioe="name",Q$=[Sg,di,Qd,al,Jd,Xg,ml,Zd,eh,Ag,Cg,iv,ov],yoe=[...Q$,sv],J$=[Sg,di,Qd,fy,Jd,Xg,ml,Zd,eh,Ag,Cg,iv,ov,sv],Z$=J$,D0=[...Z$,A0,fg,pg],voe=D0,e3=[...D0,C0],Soe=e3;var Dg=class extends uy{constructor(e,t){super(),this.ce=e,this.currentSequenceNumber=t}};function en(n,e){let t=se(n);return Xd.N(t.ce,e)}function MH(n){let e=0;for(let t in n)Object.prototype.hasOwnProperty.call(n,t)&&e++;return e}function _a(n,e){for(let t in n)Object.prototype.hasOwnProperty.call(n,t)&&e(t,n[t])}function Aoe(n,e){let t=[];for(let r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.push(e(n[r],r,n));return t}function t3(n){for(let e in n)if(Object.prototype.hasOwnProperty.call(n,e))return!1;return!0}var ft=class n{constructor(e,t){this.comparator=e,this.root=t||no.EMPTY}insert(e,t){return new n(this.comparator,this.root.insert(e,t,this.comparator).copy(null,null,no.BLACK,null,null))}remove(e){return new n(this.comparator,this.root.remove(e,this.comparator).copy(null,null,no.BLACK,null,null))}get(e){let t=this.root;for(;!t.isEmpty();){let r=this.comparator(e,t.key);if(r===0)return t.value;r<0?t=t.left:r>0&&(t=t.right)}return null}indexOf(e){let t=0,r=this.root;for(;!r.isEmpty();){let i=this.comparator(e,r.key);if(i===0)return t+r.left.size;i<0?r=r.left:(t+=r.left.size+1,r=r.right)}return-1}isEmpty(){return this.root.isEmpty()}get size(){return this.root.size}minKey(){return this.root.minKey()}maxKey(){return this.root.maxKey()}inorderTraversal(e){return this.root.inorderTraversal(e)}forEach(e){this.inorderTraversal((t,r)=>(e(t,r),!1))}toString(){let e=[];return this.inorderTraversal((t,r)=>(e.push(`${t}:${r}`),!1)),`{${e.join(", ")}}`}reverseTraversal(e){return this.root.reverseTraversal(e)}getIterator(){return new jd(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new jd(this.root,e,this.comparator,!1)}getReverseIterator(){return new jd(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new jd(this.root,e,this.comparator,!0)}},jd=class{constructor(e,t,r,i){this.isReverse=i,this.nodeStack=[];let o=1;for(;!e.isEmpty();)if(o=t?r(e.key,t):1,t&&i&&(o*=-1),o<0)e=this.isReverse?e.left:e.right;else{if(o===0){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}getNext(){let e=this.nodeStack.pop(),t={key:e.key,value:e.value};if(this.isReverse)for(e=e.left;!e.isEmpty();)this.nodeStack.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack.push(e),e=e.left;return t}hasNext(){return this.nodeStack.length>0}peek(){if(this.nodeStack.length===0)return null;let e=this.nodeStack[this.nodeStack.length-1];return{key:e.key,value:e.value}}},no=class n{constructor(e,t,r,i,o){this.key=e,this.value=t,this.color=r??n.RED,this.left=i??n.EMPTY,this.right=o??n.EMPTY,this.size=this.left.size+1+this.right.size}copy(e,t,r,i,o){return new n(e??this.key,t??this.value,r??this.color,i??this.left,o??this.right)}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min(){return this.left.isEmpty()?this:this.left.min()}minKey(){return this.min().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,t,r){let i=this,o=r(e,i.key);return i=o<0?i.copy(null,null,null,i.left.insert(e,t,r),null):o===0?i.copy(null,t,null,null,null):i.copy(null,null,null,null,i.right.insert(e,t,r)),i.fixUp()}removeMin(){if(this.left.isEmpty())return n.EMPTY;let e=this;return e.left.isRed()||e.left.left.isRed()||(e=e.moveRedLeft()),e=e.copy(null,null,null,e.left.removeMin(),null),e.fixUp()}remove(e,t){let r,i=this;if(t(e,i.key)<0)i.left.isEmpty()||i.left.isRed()||i.left.left.isRed()||(i=i.moveRedLeft()),i=i.copy(null,null,null,i.left.remove(e,t),null);else{if(i.left.isRed()&&(i=i.rotateRight()),i.right.isEmpty()||i.right.isRed()||i.right.left.isRed()||(i=i.moveRedRight()),t(e,i.key)===0){if(i.right.isEmpty())return n.EMPTY;r=i.right.min(),i=i.copy(r.key,r.value,null,null,i.right.removeMin())}i=i.copy(null,null,null,null,i.right.remove(e,t))}return i.fixUp()}isRed(){return this.color}fixUp(){let e=this;return e.right.isRed()&&!e.left.isRed()&&(e=e.rotateLeft()),e.left.isRed()&&e.left.left.isRed()&&(e=e.rotateRight()),e.left.isRed()&&e.right.isRed()&&(e=e.colorFlip()),e}moveRedLeft(){let e=this.colorFlip();return e.right.left.isRed()&&(e=e.copy(null,null,null,null,e.right.rotateRight()),e=e.rotateLeft(),e=e.colorFlip()),e}moveRedRight(){let e=this.colorFlip();return e.left.left.isRed()&&(e=e.rotateRight(),e=e.colorFlip()),e}rotateLeft(){let e=this.copy(null,null,n.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight(){let e=this.copy(null,null,n.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip(){let 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(){let e=this.check();return Math.pow(2,e)<=this.size+1}check(){if(this.isRed()&&this.left.isRed())throw re(43730,{key:this.key,value:this.value});if(this.right.isRed())throw re(14113,{key:this.key,value:this.value});let e=this.left.check();if(e!==this.right.check())throw re(27949);return e+(this.isRed()?0:1)}};no.EMPTY=null,no.RED=!0,no.BLACK=!1;no.EMPTY=new class{constructor(){this.size=0}get key(){throw re(57766)}get value(){throw re(16141)}get color(){throw re(16727)}get left(){throw re(29726)}get right(){throw re(36894)}copy(e,t,r,i,o){return this}insert(e,t,r){return new no(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}};var tt=class n{constructor(e){this.comparator=e,this.data=new ft(this.comparator)}has(e){return this.data.get(e)!==null}first(){return this.data.minKey()}last(){return this.data.maxKey()}get size(){return this.data.size}indexOf(e){return this.data.indexOf(e)}forEach(e){this.data.inorderTraversal((t,r)=>(e(t),!1))}forEachInRange(e,t){let r=this.data.getIteratorFrom(e[0]);for(;r.hasNext();){let i=r.getNext();if(this.comparator(i.key,e[1])>=0)return;t(i.key)}}forEachWhile(e,t){let r;for(r=t!==void 0?this.data.getIteratorFrom(t):this.data.getIterator();r.hasNext();)if(!e(r.getNext().key))return}firstAfterOrEqual(e){let t=this.data.getIteratorFrom(e);return t.hasNext()?t.getNext().key:null}getIterator(){return new gy(this.data.getIterator())}getIteratorFrom(e){return new gy(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(r=>{t=t.add(r)}),t}isEqual(e){if(!(e instanceof n)||this.size!==e.size)return!1;let t=this.data.getIterator(),r=e.data.getIterator();for(;t.hasNext();){let i=t.getNext().key,o=r.getNext().key;if(this.comparator(i,o)!==0)return!1}return!0}toArray(){let e=[];return this.forEach(t=>{e.push(t)}),e}toString(){let e=[];return this.forEach(t=>e.push(t)),"SortedSet("+e.toString()+")"}copy(e){let t=new n(this.comparator);return t.data=e,t}},gy=class{constructor(e){this.iter=e}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}};function Ld(n){return n.hasNext()?n.getNext():void 0}var Sr=class n{constructor(e){this.fields=e,e.sort(Qt.comparator)}static empty(){return new n([])}unionWith(e){let t=new tt(Qt.comparator);for(let r of this.fields)t=t.add(r);for(let r of e)t=t.add(r);return new n(t.toArray())}covers(e){for(let t of this.fields)if(t.isPrefixOf(e))return!0;return!1}isEqual(e){return qd(this.fields,e.fields,(t,r)=>t.isEqual(r))}};var my=class extends Error{constructor(){super(...arguments),this.name="Base64DecodeError"}};var Gt=class n{constructor(e){this.binaryString=e}static fromBase64String(e){let t=(function(i){try{return atob(i)}catch(o){throw typeof DOMException<"u"&&o instanceof DOMException?new my("Invalid base64 string: "+o):o}})(e);return new n(t)}static fromUint8Array(e){let t=(function(i){let o="";for(let s=0;s<i.length;++s)o+=String.fromCharCode(i[s]);return o})(e);return new n(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(t){return btoa(t)})(this.binaryString)}toUint8Array(){return(function(t){let r=new Uint8Array(t.length);for(let i=0;i<t.length;i++)r[i]=t.charCodeAt(i);return r})(this.binaryString)}approximateByteSize(){return 2*this.binaryString.length}compareTo(e){return Ie(this.binaryString,e.binaryString)}isEqual(e){return this.binaryString===e.binaryString}};Gt.EMPTY_BYTE_STRING=new Gt("");var Coe=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function Ko(n){if(ae(!!n,39018),typeof n=="string"){let e=0,t=Coe.exec(n);if(ae(!!t,46558,{timestamp:n}),t[1]){let i=t[1];i=(i+"000000000").substr(0,9),e=Number(i)}let r=new Date(n);return{seconds:Math.floor(r.getTime()/1e3),nanos:e}}return{seconds:Et(n.seconds),nanos:Et(n.nanos)}}function Et(n){return typeof n=="number"?n:typeof n=="string"?Number(n):0}function Yo(n){return typeof n=="string"?Gt.fromBase64String(n):Gt.fromUint8Array(n)}var n3="server_timestamp",r3="__type__",i3="__previous_value__",o3="__local_write_time__";function av(n){var e,t;return((t=(((e=n?.mapValue)===null||e===void 0?void 0:e.fields)||{})[r3])===null||t===void 0?void 0:t.stringValue)===n3}function cv(n){let e=n.mapValue.fields[i3];return av(e)?cv(e):e}function Rg(n){let e=Ko(n.mapValue.fields[o3].timestampValue);return new _t(e.seconds,e.nanos)}var Db=class{constructor(e,t,r,i,o,s,a,c,l,d){this.databaseId=e,this.appId=t,this.persistenceKey=r,this.host=i,this.ssl=o,this.forceLongPolling=s,this.autoDetectLongPolling=a,this.longPollingOptions=c,this.useFetchStreams=l,this.isUsingEmulator=d}},Ng="(default)",th=class n{constructor(e,t){this.projectId=e,this.database=t||Ng}static empty(){return new n("","")}get isDefaultDatabase(){return this.database===Ng}isEqual(e){return e instanceof n&&e.projectId===this.projectId&&e.database===this.database}};var R0="__type__",s3="__max__",na={mapValue:{fields:{__type__:{stringValue:s3}}}},N0="__vector__",nh="value",ty={nullValue:"NULL_VALUE"};function la(n){return"nullValue"in n?0:"booleanValue"in n?1:"integerValue"in n||"doubleValue"in n?2:"timestampValue"in n?3:"stringValue"in n?5:"bytesValue"in n?6:"referenceValue"in n?7:"geoPointValue"in n?8:"arrayValue"in n?9:"mapValue"in n?av(n)?4:a3(n)?9007199254740991:lv(n)?10:11:re(28295,{value:n})}function ro(n,e){if(n===e)return!0;let t=la(n);if(t!==la(e))return!1;switch(t){case 0:case 9007199254740991:return!0;case 1:return n.booleanValue===e.booleanValue;case 4:return Rg(n).isEqual(Rg(e));case 3:return(function(i,o){if(typeof i.timestampValue=="string"&&typeof o.timestampValue=="string"&&i.timestampValue.length===o.timestampValue.length)return i.timestampValue===o.timestampValue;let s=Ko(i.timestampValue),a=Ko(o.timestampValue);return s.seconds===a.seconds&&s.nanos===a.nanos})(n,e);case 5:return n.stringValue===e.stringValue;case 6:return(function(i,o){return Yo(i.bytesValue).isEqual(Yo(o.bytesValue))})(n,e);case 7:return n.referenceValue===e.referenceValue;case 8:return(function(i,o){return Et(i.geoPointValue.latitude)===Et(o.geoPointValue.latitude)&&Et(i.geoPointValue.longitude)===Et(o.geoPointValue.longitude)})(n,e);case 2:return(function(i,o){if("integerValue"in i&&"integerValue"in o)return Et(i.integerValue)===Et(o.integerValue);if("doubleValue"in i&&"doubleValue"in o){let s=Et(i.doubleValue),a=Et(o.doubleValue);return s===a?vg(s)===vg(a):isNaN(s)&&isNaN(a)}return!1})(n,e);case 9:return qd(n.arrayValue.values||[],e.arrayValue.values||[],ro);case 10:case 11:return(function(i,o){let s=i.mapValue.fields||{},a=o.mapValue.fields||{};if(MH(s)!==MH(a))return!1;for(let c in s)if(s.hasOwnProperty(c)&&(a[c]===void 0||!ro(s[c],a[c])))return!1;return!0})(n,e);default:return re(52216,{left:n})}}function wg(n,e){return(n.values||[]).find(t=>ro(t,e))!==void 0}function ua(n,e){if(n===e)return 0;let t=la(n),r=la(e);if(t!==r)return Ie(t,r);switch(t){case 0:case 9007199254740991:return 0;case 1:return Ie(n.booleanValue,e.booleanValue);case 2:return(function(o,s){let a=Et(o.integerValue||o.doubleValue),c=Et(s.integerValue||s.doubleValue);return a<c?-1:a>c?1:a===c?0:isNaN(a)?isNaN(c)?0:-1:1})(n,e);case 3:return LH(n.timestampValue,e.timestampValue);case 4:return LH(Rg(n),Rg(e));case 5:return Eb(n.stringValue,e.stringValue);case 6:return(function(o,s){let a=Yo(o),c=Yo(s);return a.compareTo(c)})(n.bytesValue,e.bytesValue);case 7:return(function(o,s){let a=o.split("/"),c=s.split("/");for(let l=0;l<a.length&&l<c.length;l++){let d=Ie(a[l],c[l]);if(d!==0)return d}return Ie(a.length,c.length)})(n.referenceValue,e.referenceValue);case 8:return(function(o,s){let a=Ie(Et(o.latitude),Et(s.latitude));return a!==0?a:Ie(Et(o.longitude),Et(s.longitude))})(n.geoPointValue,e.geoPointValue);case 9:return PH(n.arrayValue,e.arrayValue);case 10:return(function(o,s){var a,c,l,d;let h=o.fields||{},f=s.fields||{},g=(a=h[nh])===null||a===void 0?void 0:a.arrayValue,E=(c=f[nh])===null||c===void 0?void 0:c.arrayValue,v=Ie(((l=g?.values)===null||l===void 0?void 0:l.length)||0,((d=E?.values)===null||d===void 0?void 0:d.length)||0);return v!==0?v:PH(g,E)})(n.mapValue,e.mapValue);case 11:return(function(o,s){if(o===na.mapValue&&s===na.mapValue)return 0;if(o===na.mapValue)return 1;if(s===na.mapValue)return-1;let a=o.fields||{},c=Object.keys(a),l=s.fields||{},d=Object.keys(l);c.sort(),d.sort();for(let h=0;h<c.length&&h<d.length;++h){let f=Eb(c[h],d[h]);if(f!==0)return f;let g=ua(a[c[h]],l[d[h]]);if(g!==0)return g}return Ie(c.length,d.length)})(n.mapValue,e.mapValue);default:throw re(23264,{le:t})}}function LH(n,e){if(typeof n=="string"&&typeof e=="string"&&n.length===e.length)return Ie(n,e);let t=Ko(n),r=Ko(e),i=Ie(t.seconds,r.seconds);return i!==0?i:Ie(t.nanos,r.nanos)}function PH(n,e){let t=n.values||[],r=e.values||[];for(let i=0;i<t.length&&i<r.length;++i){let o=ua(t[i],r[i]);if(o)return o}return Ie(t.length,r.length)}function rh(n){return Rb(n)}function Rb(n){return"nullValue"in n?"null":"booleanValue"in n?""+n.booleanValue:"integerValue"in n?""+n.integerValue:"doubleValue"in n?""+n.doubleValue:"timestampValue"in n?(function(t){let r=Ko(t);return`time(${r.seconds},${r.nanos})`})(n.timestampValue):"stringValue"in n?n.stringValue:"bytesValue"in n?(function(t){return Yo(t).toBase64()})(n.bytesValue):"referenceValue"in n?(function(t){return Z.fromName(t).toString()})(n.referenceValue):"geoPointValue"in n?(function(t){return`geo(${t.latitude},${t.longitude})`})(n.geoPointValue):"arrayValue"in n?(function(t){let r="[",i=!0;for(let o of t.values||[])i?i=!1:r+=",",r+=Rb(o);return r+"]"})(n.arrayValue):"mapValue"in n?(function(t){let r=Object.keys(t.fields||{}).sort(),i="{",o=!0;for(let s of r)o?o=!1:i+=",",i+=`${s}:${Rb(t.fields[s])}`;return i+"}"})(n.mapValue):re(61005,{value:n})}function ny(n){switch(la(n)){case 0:case 1:return 4;case 2:return 8;case 3:case 8:return 16;case 4:let e=cv(n);return e?16+ny(e):16;case 5:return 2*n.stringValue.length;case 6:return Yo(n.bytesValue).approximateByteSize();case 7:return n.referenceValue.length;case 9:return(function(r){return(r.values||[]).reduce((i,o)=>i+ny(o),0)})(n.arrayValue);case 10:case 11:return(function(r){let i=0;return _a(r.fields,(o,s)=>{i+=o.length+ny(s)}),i})(n.mapValue);default:throw re(13486,{value:n})}}function _l(n,e){return{referenceValue:`projects/${n.projectId}/databases/${n.database}/documents/${e.path.canonicalString()}`}}function Nb(n){return!!n&&"integerValue"in n}function bg(n){return!!n&&"arrayValue"in n}function xH(n){return!!n&&"nullValue"in n}function kH(n){return!!n&&"doubleValue"in n&&isNaN(Number(n.doubleValue))}function ry(n){return!!n&&"mapValue"in n}function lv(n){var e,t;return((t=(((e=n?.mapValue)===null||e===void 0?void 0:e.fields)||{})[R0])===null||t===void 0?void 0:t.stringValue)===N0}function gg(n){if(n.geoPointValue)return{geoPointValue:Object.assign({},n.geoPointValue)};if(n.timestampValue&&typeof n.timestampValue=="object")return{timestampValue:Object.assign({},n.timestampValue)};if(n.mapValue){let e={mapValue:{fields:{}}};return _a(n.mapValue.fields,(t,r)=>e.mapValue.fields[t]=gg(r)),e}if(n.arrayValue){let e={arrayValue:{values:[]}};for(let t=0;t<(n.arrayValue.values||[]).length;++t)e.arrayValue.values[t]=gg(n.arrayValue.values[t]);return e}return Object.assign({},n)}function a3(n){return(((n.mapValue||{}).fields||{}).__type__||{}).stringValue===s3}var c3={mapValue:{fields:{[R0]:{stringValue:N0},[nh]:{arrayValue:{}}}}};function Doe(n){return"nullValue"in n?ty:"booleanValue"in n?{booleanValue:!1}:"integerValue"in n||"doubleValue"in n?{doubleValue:NaN}:"timestampValue"in n?{timestampValue:{seconds:Number.MIN_SAFE_INTEGER}}:"stringValue"in n?{stringValue:""}:"bytesValue"in n?{bytesValue:""}:"referenceValue"in n?_l(th.empty(),Z.empty()):"geoPointValue"in n?{geoPointValue:{latitude:-90,longitude:-180}}:"arrayValue"in n?{arrayValue:{}}:"mapValue"in n?lv(n)?c3:{mapValue:{}}:re(35942,{value:n})}function Roe(n){return"nullValue"in n?{booleanValue:!1}:"booleanValue"in n?{doubleValue:NaN}:"integerValue"in n||"doubleValue"in n?{timestampValue:{seconds:Number.MIN_SAFE_INTEGER}}:"timestampValue"in n?{stringValue:""}:"stringValue"in n?{bytesValue:""}:"bytesValue"in n?_l(th.empty(),Z.empty()):"referenceValue"in n?{geoPointValue:{latitude:-90,longitude:-180}}:"geoPointValue"in n?{arrayValue:{}}:"arrayValue"in n?c3:"mapValue"in n?lv(n)?{mapValue:{}}:na:re(61959,{value:n})}function FH(n,e){let t=ua(n.value,e.value);return t!==0?t:n.inclusive&&!e.inclusive?-1:!n.inclusive&&e.inclusive?1:0}function UH(n,e){let t=ua(n.value,e.value);return t!==0?t:n.inclusive&&!e.inclusive?1:!n.inclusive&&e.inclusive?-1:0}var xn=class n{constructor(e){this.value=e}static empty(){return new n({mapValue:{}})}field(e){if(e.isEmpty())return this.value;{let t=this.value;for(let r=0;r<e.length-1;++r)if(t=(t.mapValue.fields||{})[e.get(r)],!ry(t))return null;return t=(t.mapValue.fields||{})[e.lastSegment()],t||null}}set(e,t){this.getFieldsMap(e.popLast())[e.lastSegment()]=gg(t)}setAll(e){let t=Qt.emptyPath(),r={},i=[];e.forEach((s,a)=>{if(!t.isImmediateParentOf(a)){let c=this.getFieldsMap(t);this.applyChanges(c,r,i),r={},i=[],t=a.popLast()}s?r[a.lastSegment()]=gg(s):i.push(a.lastSegment())});let o=this.getFieldsMap(t);this.applyChanges(o,r,i)}delete(e){let t=this.field(e.popLast());ry(t)&&t.mapValue.fields&&delete t.mapValue.fields[e.lastSegment()]}isEqual(e){return ro(this.value,e.value)}getFieldsMap(e){let t=this.value;t.mapValue.fields||(t.mapValue={fields:{}});for(let r=0;r<e.length;++r){let i=t.mapValue.fields[e.get(r)];ry(i)&&i.mapValue.fields||(i={mapValue:{fields:{}}},t.mapValue.fields[e.get(r)]=i),t=i}return t.mapValue.fields}applyChanges(e,t,r){_a(t,(i,o)=>e[i]=o);for(let i of r)delete e[i]}clone(){return new n(gg(this.value))}};function l3(n){let e=[];return _a(n.fields,(t,r)=>{let i=new Qt([t]);if(ry(r)){let o=l3(r.mapValue).fields;if(o.length===0)e.push(i);else for(let s of o)e.push(i.child(s))}else e.push(i)}),new Sr(e)}var Jt=class n{constructor(e,t,r,i,o,s,a){this.key=e,this.documentType=t,this.version=r,this.readTime=i,this.createTime=o,this.data=s,this.documentState=a}static newInvalidDocument(e){return new n(e,0,le.min(),le.min(),le.min(),xn.empty(),0)}static newFoundDocument(e,t,r,i){return new n(e,1,t,le.min(),r,i,0)}static newNoDocument(e,t){return new n(e,2,t,le.min(),le.min(),xn.empty(),0)}static newUnknownDocument(e,t){return new n(e,3,t,le.min(),le.min(),xn.empty(),2)}convertToFoundDocument(e,t){return!this.createTime.isEqual(le.min())||this.documentType!==2&&this.documentType!==0||(this.createTime=e),this.version=e,this.documentType=1,this.data=t,this.documentState=0,this}convertToNoDocument(e){return this.version=e,this.documentType=2,this.data=xn.empty(),this.documentState=0,this}convertToUnknownDocument(e){return this.version=e,this.documentType=3,this.data=xn.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this.version=le.min(),this}setReadTime(e){return this.readTime=e,this}get hasLocalMutations(){return this.documentState===1}get hasCommittedMutations(){return this.documentState===2}get hasPendingWrites(){return this.hasLocalMutations||this.hasCommittedMutations}isValidDocument(){return this.documentType!==0}isFoundDocument(){return this.documentType===1}isNoDocument(){return this.documentType===2}isUnknownDocument(){return this.documentType===3}isEqual(e){return e instanceof n&&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 n(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}})`}};var io=class{constructor(e,t){this.position=e,this.inclusive=t}};function VH(n,e,t){let r=0;for(let i=0;i<n.position.length;i++){let o=e[i],s=n.position[i];if(o.field.isKeyField()?r=Z.comparator(Z.fromName(s.referenceValue),t.key):r=ua(s,t.data.field(o.field)),o.dir==="desc"&&(r*=-1),r!==0)break}return r}function BH(n,e){if(n===null)return e===null;if(e===null||n.inclusive!==e.inclusive||n.position.length!==e.position.length)return!1;for(let t=0;t<n.position.length;t++)if(!ro(n.position[t],e.position[t]))return!1;return!0}var Tl=class{constructor(e,t="asc"){this.field=e,this.dir=t}};function Noe(n,e){return n.dir===e.dir&&n.field.isEqual(e.field)}var Ey=class{},Le=class n extends Ey{constructor(e,t,r){super(),this.field=e,this.op=t,this.value=r}static create(e,t,r){return e.isKeyField()?t==="in"||t==="not-in"?this.createKeyFieldInFilter(e,t,r):new Ob(e,t,r):t==="array-contains"?new Pb(e,r):t==="in"?new _y(e,r):t==="not-in"?new xb(e,r):t==="array-contains-any"?new kb(e,r):new n(e,t,r)}static createKeyFieldInFilter(e,t,r){return t==="in"?new Mb(e,r):new Lb(e,r)}matches(e){let t=e.data.field(this.field);return this.op==="!="?t!==null&&t.nullValue===void 0&&this.matchesComparison(ua(t,this.value)):t!==null&&la(this.value)===la(t)&&this.matchesComparison(ua(t,this.value))}matchesComparison(e){switch(this.op){case"<":return e<0;case"<=":return e<=0;case"==":return e===0;case"!=":return e!==0;case">":return e>0;case">=":return e>=0;default:return re(47266,{operator:this.op})}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}},Ye=class n extends Ey{constructor(e,t){super(),this.filters=e,this.op=t,this.he=null}static create(e,t){return new n(e,t)}matches(e){return ih(this)?this.filters.find(t=>!t.matches(e))===void 0:this.filters.find(t=>t.matches(e))!==void 0}getFlattenedFilters(){return this.he!==null||(this.he=this.filters.reduce((e,t)=>e.concat(t.getFlattenedFilters()),[])),this.he}getFilters(){return Object.assign([],this.filters)}};function ih(n){return n.op==="and"}function wb(n){return n.op==="or"}function w0(n){return u3(n)&&ih(n)}function u3(n){for(let e of n.filters)if(e instanceof Ye)return!1;return!0}function bb(n){if(n instanceof Le)return n.field.canonicalString()+n.op.toString()+rh(n.value);if(w0(n))return n.filters.map(e=>bb(e)).join(",");{let e=n.filters.map(t=>bb(t)).join(",");return`${n.op}(${e})`}}function d3(n,e){return n instanceof Le?(function(r,i){return i instanceof Le&&r.op===i.op&&r.field.isEqual(i.field)&&ro(r.value,i.value)})(n,e):n instanceof Ye?(function(r,i){return i instanceof Ye&&r.op===i.op&&r.filters.length===i.filters.length?r.filters.reduce((o,s,a)=>o&&d3(s,i.filters[a]),!0):!1})(n,e):void re(19439)}function h3(n,e){let t=n.filters.concat(e);return Ye.create(t,n.op)}function f3(n){return n instanceof Le?(function(t){return`${t.field.canonicalString()} ${t.op} ${rh(t.value)}`})(n):n instanceof Ye?(function(t){return t.op.toString()+" {"+t.getFilters().map(f3).join(" ,")+"}"})(n):"Filter"}var Ob=class extends Le{constructor(e,t,r){super(e,t,r),this.key=Z.fromName(r.referenceValue)}matches(e){let t=Z.comparator(e.key,this.key);return this.matchesComparison(t)}},Mb=class extends Le{constructor(e,t){super(e,"in",t),this.keys=p3("in",t)}matches(e){return this.keys.some(t=>t.isEqual(e.key))}},Lb=class extends Le{constructor(e,t){super(e,"not-in",t),this.keys=p3("not-in",t)}matches(e){return!this.keys.some(t=>t.isEqual(e.key))}};function p3(n,e){var t;return(((t=e.arrayValue)===null||t===void 0?void 0:t.values)||[]).map(r=>Z.fromName(r.referenceValue))}var Pb=class extends Le{constructor(e,t){super(e,"array-contains",t)}matches(e){let t=e.data.field(this.field);return bg(t)&&wg(t.arrayValue,this.value)}},_y=class extends Le{constructor(e,t){super(e,"in",t)}matches(e){let t=e.data.field(this.field);return t!==null&&wg(this.value.arrayValue,t)}},xb=class extends Le{constructor(e,t){super(e,"not-in",t)}matches(e){if(wg(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;let t=e.data.field(this.field);return t!==null&&t.nullValue===void 0&&!wg(this.value.arrayValue,t)}},kb=class extends Le{constructor(e,t){super(e,"array-contains-any",t)}matches(e){let t=e.data.field(this.field);return!(!bg(t)||!t.arrayValue.values)&&t.arrayValue.values.some(r=>wg(this.value.arrayValue,r))}};var Fb=class{constructor(e,t=null,r=[],i=[],o=null,s=null,a=null){this.path=e,this.collectionGroup=t,this.orderBy=r,this.filters=i,this.limit=o,this.startAt=s,this.endAt=a,this.Pe=null}};function Ub(n,e=null,t=[],r=[],i=null,o=null,s=null){return new Fb(n,e,t,r,i,o,s)}function Il(n){let e=se(n);if(e.Pe===null){let t=e.path.canonicalString();e.collectionGroup!==null&&(t+="|cg:"+e.collectionGroup),t+="|f:",t+=e.filters.map(r=>bb(r)).join(","),t+="|ob:",t+=e.orderBy.map(r=>(function(o){return o.field.canonicalString()+o.dir})(r)).join(","),Yg(e.limit)||(t+="|l:",t+=e.limit),e.startAt&&(t+="|lb:",t+=e.startAt.inclusive?"b:":"a:",t+=e.startAt.position.map(r=>rh(r)).join(",")),e.endAt&&(t+="|ub:",t+=e.endAt.inclusive?"a:":"b:",t+=e.endAt.position.map(r=>rh(r)).join(",")),e.Pe=t}return e.Pe}function Qg(n,e){if(n.limit!==e.limit||n.orderBy.length!==e.orderBy.length)return!1;for(let t=0;t<n.orderBy.length;t++)if(!Noe(n.orderBy[t],e.orderBy[t]))return!1;if(n.filters.length!==e.filters.length)return!1;for(let t=0;t<n.filters.length;t++)if(!d3(n.filters[t],e.filters[t]))return!1;return n.collectionGroup===e.collectionGroup&&!!n.path.isEqual(e.path)&&!!BH(n.startAt,e.startAt)&&BH(n.endAt,e.endAt)}function Ty(n){return Z.isDocumentKey(n.path)&&n.collectionGroup===null&&n.filters.length===0}function Iy(n,e){return n.filters.filter(t=>t instanceof Le&&t.field.isEqual(e))}function GH(n,e,t){let r=ty,i=!0;for(let o of Iy(n,e)){let s=ty,a=!0;switch(o.op){case"<":case"<=":s=Doe(o.value);break;case"==":case"in":case">=":s=o.value;break;case">":s=o.value,a=!1;break;case"!=":case"not-in":s=ty}FH({value:r,inclusive:i},{value:s,inclusive:a})<0&&(r=s,i=a)}if(t!==null){for(let o=0;o<n.orderBy.length;++o)if(n.orderBy[o].field.isEqual(e)){let s=t.position[o];FH({value:r,inclusive:i},{value:s,inclusive:t.inclusive})<0&&(r=s,i=t.inclusive);break}}return{value:r,inclusive:i}}function jH(n,e,t){let r=na,i=!0;for(let o of Iy(n,e)){let s=na,a=!0;switch(o.op){case">=":case">":s=Roe(o.value),a=!1;break;case"==":case"in":case"<=":s=o.value;break;case"<":s=o.value,a=!1;break;case"!=":case"not-in":s=na}UH({value:r,inclusive:i},{value:s,inclusive:a})>0&&(r=s,i=a)}if(t!==null){for(let o=0;o<n.orderBy.length;++o)if(n.orderBy[o].field.isEqual(e)){let s=t.position[o];UH({value:r,inclusive:i},{value:s,inclusive:t.inclusive})>0&&(r=s,i=t.inclusive);break}}return{value:r,inclusive:i}}var oo=class{constructor(e,t=null,r=[],i=[],o=null,s="F",a=null,c=null){this.path=e,this.collectionGroup=t,this.explicitOrderBy=r,this.filters=i,this.limit=o,this.limitType=s,this.startAt=a,this.endAt=c,this.Te=null,this.Ie=null,this.de=null,this.startAt,this.endAt}};function g3(n,e,t,r,i,o,s,a){return new oo(n,e,t,r,i,o,s,a)}function Jg(n){return new oo(n)}function HH(n){return n.filters.length===0&&n.limit===null&&n.startAt==null&&n.endAt==null&&(n.explicitOrderBy.length===0||n.explicitOrderBy.length===1&&n.explicitOrderBy[0].field.isKeyField())}function b0(n){return n.collectionGroup!==null}function $d(n){let e=se(n);if(e.Te===null){e.Te=[];let t=new Set;for(let o of e.explicitOrderBy)e.Te.push(o),t.add(o.field.canonicalString());let r=e.explicitOrderBy.length>0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";(function(s){let a=new tt(Qt.comparator);return s.filters.forEach(c=>{c.getFlattenedFilters().forEach(l=>{l.isInequality()&&(a=a.add(l.field))})}),a})(e).forEach(o=>{t.has(o.canonicalString())||o.isKeyField()||e.Te.push(new Tl(o,r))}),t.has(Qt.keyField().canonicalString())||e.Te.push(new Tl(Qt.keyField(),r))}return e.Te}function Cr(n){let e=se(n);return e.Ie||(e.Ie=m3(e,$d(n))),e.Ie}function woe(n){let e=se(n);return e.de||(e.de=m3(e,n.explicitOrderBy)),e.de}function m3(n,e){if(n.limitType==="F")return Ub(n.path,n.collectionGroup,e,n.filters,n.limit,n.startAt,n.endAt);{e=e.map(i=>{let o=i.dir==="desc"?"asc":"desc";return new Tl(i.field,o)});let t=n.endAt?new io(n.endAt.position,n.endAt.inclusive):null,r=n.startAt?new io(n.startAt.position,n.startAt.inclusive):null;return Ub(n.path,n.collectionGroup,e,n.filters,n.limit,t,r)}}function Vb(n,e){let t=n.filters.concat([e]);return new oo(n.path,n.collectionGroup,n.explicitOrderBy.slice(),t,n.limit,n.limitType,n.startAt,n.endAt)}function yy(n,e,t){return new oo(n.path,n.collectionGroup,n.explicitOrderBy.slice(),n.filters.slice(),e,t,n.startAt,n.endAt)}function uv(n,e){return Qg(Cr(n),Cr(e))&&n.limitType===e.limitType}function E3(n){return`${Il(Cr(n))}|lt:${n.limitType}`}function Vd(n){return`Query(target=${(function(t){let r=t.path.canonicalString();return t.collectionGroup!==null&&(r+=" collectionGroup="+t.collectionGroup),t.filters.length>0&&(r+=`, filters: [${t.filters.map(i=>f3(i)).join(", ")}]`),Yg(t.limit)||(r+=", limit: "+t.limit),t.orderBy.length>0&&(r+=`, orderBy: [${t.orderBy.map(i=>(function(s){return`${s.field.canonicalString()} (${s.dir})`})(i)).join(", ")}]`),t.startAt&&(r+=", startAt: ",r+=t.startAt.inclusive?"b:":"a:",r+=t.startAt.position.map(i=>rh(i)).join(",")),t.endAt&&(r+=", endAt: ",r+=t.endAt.inclusive?"a:":"b:",r+=t.endAt.position.map(i=>rh(i)).join(",")),`Target(${r})`})(Cr(n))}; limitType=${n.limitType})`}function Zg(n,e){return e.isFoundDocument()&&(function(r,i){let o=i.key.path;return r.collectionGroup!==null?i.key.hasCollectionId(r.collectionGroup)&&r.path.isPrefixOf(o):Z.isDocumentKey(r.path)?r.path.isEqual(o):r.path.isImmediateParentOf(o)})(n,e)&&(function(r,i){for(let o of $d(r))if(!o.field.isKeyField()&&i.data.field(o.field)===null)return!1;return!0})(n,e)&&(function(r,i){for(let o of r.filters)if(!o.matches(i))return!1;return!0})(n,e)&&(function(r,i){return!(r.startAt&&!(function(s,a,c){let l=VH(s,a,c);return s.inclusive?l<=0:l<0})(r.startAt,$d(r),i)||r.endAt&&!(function(s,a,c){let l=VH(s,a,c);return s.inclusive?l>=0:l>0})(r.endAt,$d(r),i))})(n,e)}function _3(n){return n.collectionGroup||(n.path.length%2==1?n.path.lastSegment():n.path.get(n.path.length-2))}function T3(n){return(e,t)=>{let r=!1;for(let i of $d(n)){let o=boe(i,e,t);if(o!==0)return o;r=r||i.field.isKeyField()}return 0}}function boe(n,e,t){let r=n.field.isKeyField()?Z.comparator(e.key,t.key):(function(o,s,a){let c=s.data.field(o),l=a.data.field(o);return c!==null&&l!==null?ua(c,l):re(42886)})(n.field,e,t);switch(n.dir){case"asc":return r;case"desc":return-1*r;default:return re(19790,{direction:n.dir})}}var hi=class{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.innerSize=0}get(e){let t=this.mapKeyFn(e),r=this.inner[t];if(r!==void 0){for(let[i,o]of r)if(this.equalsFn(i,e))return o}}has(e){return this.get(e)!==void 0}set(e,t){let r=this.mapKeyFn(e),i=this.inner[r];if(i===void 0)return this.inner[r]=[[e,t]],void this.innerSize++;for(let o=0;o<i.length;o++)if(this.equalsFn(i[o][0],e))return void(i[o]=[e,t]);i.push([e,t]),this.innerSize++}delete(e){let t=this.mapKeyFn(e),r=this.inner[t];if(r===void 0)return!1;for(let i=0;i<r.length;i++)if(this.equalsFn(r[i][0],e))return r.length===1?delete this.inner[t]:r.splice(i,1),this.innerSize--,!0;return!1}forEach(e){_a(this.inner,(t,r)=>{for(let[i,o]of r)e(i,o)})}isEmpty(){return t3(this.inner)}size(){return this.innerSize}};var Ooe=new ft(Z.comparator);function Ar(){return Ooe}var I3=new ft(Z.comparator);function lg(...n){let e=I3;for(let t of n)e=e.insert(t.key,t);return e}function y3(n){let e=I3;return n.forEach((t,r)=>e=e.insert(t,r.overlayedDocument)),e}function to(){return mg()}function v3(){return mg()}function mg(){return new hi(n=>n.toString(),(n,e)=>n.isEqual(e))}var Moe=new ft(Z.comparator),Loe=new tt(Z.comparator);function be(...n){let e=Loe;for(let t of n)e=e.add(t);return e}var Poe=new tt(Ie);function O0(){return Poe}function M0(n,e){if(n.useProto3Json){if(isNaN(e))return{doubleValue:"NaN"};if(e===1/0)return{doubleValue:"Infinity"};if(e===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:vg(e)?"-0":e}}function S3(n){return{integerValue:""+n}}function xoe(n,e){return $$(e)?S3(e):M0(n,e)}var oh=class{constructor(){this._=void 0}};function koe(n,e,t){return n instanceof yl?(function(i,o){let s={fields:{[r3]:{stringValue:n3},[o3]:{timestampValue:{seconds:i.seconds,nanos:i.nanoseconds}}}};return o&&av(o)&&(o=cv(o)),o&&(s.fields[i3]=o),{mapValue:s}})(t,e):n instanceof da?C3(n,e):n instanceof ha?D3(n,e):(function(i,o){let s=A3(i,o),a=$H(s)+$H(i.Ee);return Nb(s)&&Nb(i.Ee)?S3(a):M0(i.serializer,a)})(n,e)}function Foe(n,e,t){return n instanceof da?C3(n,e):n instanceof ha?D3(n,e):t}function A3(n,e){return n instanceof vl?(function(r){return Nb(r)||(function(o){return!!o&&"doubleValue"in o})(r)})(e)?e:{integerValue:0}:null}var yl=class extends oh{},da=class extends oh{constructor(e){super(),this.elements=e}};function C3(n,e){let t=R3(e);for(let r of n.elements)t.some(i=>ro(i,r))||t.push(r);return{arrayValue:{values:t}}}var ha=class extends oh{constructor(e){super(),this.elements=e}};function D3(n,e){let t=R3(e);for(let r of n.elements)t=t.filter(i=>!ro(i,r));return{arrayValue:{values:t}}}var vl=class extends oh{constructor(e,t){super(),this.serializer=e,this.Ee=t}};function $H(n){return Et(n.integerValue||n.doubleValue)}function R3(n){return bg(n)&&n.arrayValue.values?n.arrayValue.values.slice():[]}var Bb=class{constructor(e,t){this.field=e,this.transform=t}};function Uoe(n,e){return n.field.isEqual(e.field)&&(function(r,i){return r instanceof da&&i instanceof da||r instanceof ha&&i instanceof ha?qd(r.elements,i.elements,ro):r instanceof vl&&i instanceof vl?ro(r.Ee,i.Ee):r instanceof yl&&i instanceof yl})(n.transform,e.transform)}var Gb=class{constructor(e,t){this.version=e,this.transformResults=t}},_n=class n{constructor(e,t){this.updateTime=e,this.exists=t}static none(){return new n}static exists(e){return new n(void 0,e)}static updateTime(e){return new n(e)}get isNone(){return this.updateTime===void 0&&this.exists===void 0}isEqual(e){return this.exists===e.exists&&(this.updateTime?!!e.updateTime&&this.updateTime.isEqual(e.updateTime):!e.updateTime)}};function iy(n,e){return n.updateTime!==void 0?e.isFoundDocument()&&e.version.isEqual(n.updateTime):n.exists===void 0||n.exists===e.isFoundDocument()}var sh=class{};function N3(n,e){if(!n.hasLocalMutations||e&&e.fields.length===0)return null;if(e===null)return n.isNoDocument()?new Sl(n.key,_n.none()):new fa(n.key,n.data,_n.none());{let t=n.data,r=xn.empty(),i=new tt(Qt.comparator);for(let o of e.fields)if(!i.has(o)){let s=t.field(o);s===null&&o.length>1&&(o=o.popLast(),s=t.field(o)),s===null?r.delete(o):r.set(o,s),i=i.add(o)}return new fi(n.key,r,new Sr(i.toArray()),_n.none())}}function Voe(n,e,t){n instanceof fa?(function(i,o,s){let a=i.value.clone(),c=zH(i.fieldTransforms,o,s.transformResults);a.setAll(c),o.convertToFoundDocument(s.version,a).setHasCommittedMutations()})(n,e,t):n instanceof fi?(function(i,o,s){if(!iy(i.precondition,o))return void o.convertToUnknownDocument(s.version);let a=zH(i.fieldTransforms,o,s.transformResults),c=o.data;c.setAll(w3(i)),c.setAll(a),o.convertToFoundDocument(s.version,c).setHasCommittedMutations()})(n,e,t):(function(i,o,s){o.convertToNoDocument(s.version).setHasCommittedMutations()})(0,e,t)}function Eg(n,e,t,r){return n instanceof fa?(function(o,s,a,c){if(!iy(o.precondition,s))return a;let l=o.value.clone(),d=qH(o.fieldTransforms,c,s);return l.setAll(d),s.convertToFoundDocument(s.version,l).setHasLocalMutations(),null})(n,e,t,r):n instanceof fi?(function(o,s,a,c){if(!iy(o.precondition,s))return a;let l=qH(o.fieldTransforms,c,s),d=s.data;return d.setAll(w3(o)),d.setAll(l),s.convertToFoundDocument(s.version,d).setHasLocalMutations(),a===null?null:a.unionWith(o.fieldMask.fields).unionWith(o.fieldTransforms.map(h=>h.field))})(n,e,t,r):(function(o,s,a){return iy(o.precondition,s)?(s.convertToNoDocument(s.version).setHasLocalMutations(),null):a})(n,e,t)}function Boe(n,e){let t=null;for(let r of n.fieldTransforms){let i=e.data.field(r.field),o=A3(r.transform,i||null);o!=null&&(t===null&&(t=xn.empty()),t.set(r.field,o))}return t||null}function WH(n,e){return n.type===e.type&&!!n.key.isEqual(e.key)&&!!n.precondition.isEqual(e.precondition)&&!!(function(r,i){return r===void 0&&i===void 0||!(!r||!i)&&qd(r,i,(o,s)=>Uoe(o,s))})(n.fieldTransforms,e.fieldTransforms)&&(n.type===0?n.value.isEqual(e.value):n.type!==1||n.data.isEqual(e.data)&&n.fieldMask.isEqual(e.fieldMask))}var fa=class extends sh{constructor(e,t,r,i=[]){super(),this.key=e,this.value=t,this.precondition=r,this.fieldTransforms=i,this.type=0}getFieldMask(){return null}},fi=class extends sh{constructor(e,t,r,i,o=[]){super(),this.key=e,this.data=t,this.fieldMask=r,this.precondition=i,this.fieldTransforms=o,this.type=1}getFieldMask(){return this.fieldMask}};function w3(n){let e=new Map;return n.fieldMask.fields.forEach(t=>{if(!t.isEmpty()){let r=n.data.field(t);e.set(t,r)}}),e}function zH(n,e,t){let r=new Map;ae(n.length===t.length,32656,{Ae:t.length,Re:n.length});for(let i=0;i<t.length;i++){let o=n[i],s=o.transform,a=e.data.field(o.field);r.set(o.field,Foe(s,a,t[i]))}return r}function qH(n,e,t){let r=new Map;for(let i of n){let o=i.transform,s=t.data.field(i.field);r.set(i.field,koe(o,s,e))}return r}var Sl=class extends sh{constructor(e,t){super(),this.key=e,this.precondition=t,this.type=2,this.fieldTransforms=[]}getFieldMask(){return null}},Og=class extends sh{constructor(e,t){super(),this.key=e,this.precondition=t,this.type=3,this.fieldTransforms=[]}getFieldMask(){return null}};var Mg=class{constructor(e,t,r,i){this.batchId=e,this.localWriteTime=t,this.baseMutations=r,this.mutations=i}applyToRemoteDocument(e,t){let r=t.mutationResults;for(let i=0;i<this.mutations.length;i++){let o=this.mutations[i];o.key.isEqual(e.key)&&Voe(o,e,r[i])}}applyToLocalView(e,t){for(let r of this.baseMutations)r.key.isEqual(e.key)&&(t=Eg(r,e,t,this.localWriteTime));for(let r of this.mutations)r.key.isEqual(e.key)&&(t=Eg(r,e,t,this.localWriteTime));return t}applyToLocalDocumentSet(e,t){let r=v3();return this.mutations.forEach(i=>{let o=e.get(i.key),s=o.overlayedDocument,a=this.applyToLocalView(s,o.mutatedFields);a=t.has(i.key)?null:a;let c=N3(s,a);c!==null&&r.set(i.key,c),s.isValidDocument()||s.convertToNoDocument(le.min())}),r}keys(){return this.mutations.reduce((e,t)=>e.add(t.key),be())}isEqual(e){return this.batchId===e.batchId&&qd(this.mutations,e.mutations,(t,r)=>WH(t,r))&&qd(this.baseMutations,e.baseMutations,(t,r)=>WH(t,r))}},jb=class n{constructor(e,t,r,i){this.batch=e,this.commitVersion=t,this.mutationResults=r,this.docVersions=i}static from(e,t,r){ae(e.mutations.length===r.length,58842,{Ve:e.mutations.length,me:r.length});let i=(function(){return Moe})(),o=e.mutations;for(let s=0;s<o.length;s++)i=i.insert(o[s].key,r[s].version);return new n(e,t,r,i)}};var Lg=class{constructor(e,t){this.largestBatchId=e,this.mutation=t}getKey(){return this.mutation.key}isEqual(e){return e!==null&&this.mutation===e.mutation}toString(){return`Overlay{
|
|
162
|
+
largestBatchId: ${this.largestBatchId},
|
|
163
|
+
mutation: ${this.mutation.toString()}
|
|
164
|
+
}`}};var Hb=class{constructor(e,t,r){this.alias=e,this.aggregateType=t,this.fieldPath=r}};var $b=class{constructor(e,t){this.count=e,this.unchangedNames=t}};var Ft,Pe;function b3(n){switch(n){case x.OK:return re(64938);case x.CANCELLED:case x.UNKNOWN:case x.DEADLINE_EXCEEDED:case x.RESOURCE_EXHAUSTED:case x.INTERNAL:case x.UNAVAILABLE:case x.UNAUTHENTICATED:return!1;case x.INVALID_ARGUMENT:case x.NOT_FOUND:case x.ALREADY_EXISTS:case x.PERMISSION_DENIED:case x.FAILED_PRECONDITION:case x.ABORTED:case x.OUT_OF_RANGE:case x.UNIMPLEMENTED:case x.DATA_LOSS:return!0;default:return re(15467,{code:n})}}function O3(n){if(n===void 0)return Mt("GRPC error has no .code"),x.UNKNOWN;switch(n){case Ft.OK:return x.OK;case Ft.CANCELLED:return x.CANCELLED;case Ft.UNKNOWN:return x.UNKNOWN;case Ft.DEADLINE_EXCEEDED:return x.DEADLINE_EXCEEDED;case Ft.RESOURCE_EXHAUSTED:return x.RESOURCE_EXHAUSTED;case Ft.INTERNAL:return x.INTERNAL;case Ft.UNAVAILABLE:return x.UNAVAILABLE;case Ft.UNAUTHENTICATED:return x.UNAUTHENTICATED;case Ft.INVALID_ARGUMENT:return x.INVALID_ARGUMENT;case Ft.NOT_FOUND:return x.NOT_FOUND;case Ft.ALREADY_EXISTS:return x.ALREADY_EXISTS;case Ft.PERMISSION_DENIED:return x.PERMISSION_DENIED;case Ft.FAILED_PRECONDITION:return x.FAILED_PRECONDITION;case Ft.ABORTED:return x.ABORTED;case Ft.OUT_OF_RANGE:return x.OUT_OF_RANGE;case Ft.UNIMPLEMENTED:return x.UNIMPLEMENTED;case Ft.DATA_LOSS:return x.DATA_LOSS;default:return re(39323,{code:n})}}(Pe=Ft||(Ft={}))[Pe.OK=0]="OK",Pe[Pe.CANCELLED=1]="CANCELLED",Pe[Pe.UNKNOWN=2]="UNKNOWN",Pe[Pe.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",Pe[Pe.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",Pe[Pe.NOT_FOUND=5]="NOT_FOUND",Pe[Pe.ALREADY_EXISTS=6]="ALREADY_EXISTS",Pe[Pe.PERMISSION_DENIED=7]="PERMISSION_DENIED",Pe[Pe.UNAUTHENTICATED=16]="UNAUTHENTICATED",Pe[Pe.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",Pe[Pe.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",Pe[Pe.ABORTED=10]="ABORTED",Pe[Pe.OUT_OF_RANGE=11]="OUT_OF_RANGE",Pe[Pe.UNIMPLEMENTED=12]="UNIMPLEMENTED",Pe[Pe.INTERNAL=13]="INTERNAL",Pe[Pe.UNAVAILABLE=14]="UNAVAILABLE",Pe[Pe.DATA_LOSS=15]="DATA_LOSS";var KH=null;var Goe=new jo([4294967295,4294967295],0);function YH(n){let e=F$().encode(n),t=new Jw;return t.update(e),new Uint8Array(t.digest())}function XH(n){let e=new DataView(n.buffer),t=e.getUint32(0,!0),r=e.getUint32(4,!0),i=e.getUint32(8,!0),o=e.getUint32(12,!0);return[new jo([t,r],0),new jo([i,o],0)]}var Wb=class n{constructor(e,t,r){if(this.bitmap=e,this.padding=t,this.hashCount=r,t<0||t>=8)throw new fl(`Invalid padding: ${t}`);if(r<0)throw new fl(`Invalid hash count: ${r}`);if(e.length>0&&this.hashCount===0)throw new fl(`Invalid hash count: ${r}`);if(e.length===0&&t!==0)throw new fl(`Invalid padding when bitmap length is 0: ${t}`);this.fe=8*e.length-t,this.ge=jo.fromNumber(this.fe)}pe(e,t,r){let i=e.add(t.multiply(jo.fromNumber(r)));return i.compare(Goe)===1&&(i=new jo([i.getBits(0),i.getBits(1)],0)),i.modulo(this.ge).toNumber()}ye(e){return!!(this.bitmap[Math.floor(e/8)]&1<<e%8)}mightContain(e){if(this.fe===0)return!1;let t=YH(e),[r,i]=XH(t);for(let o=0;o<this.hashCount;o++){let s=this.pe(r,i,o);if(!this.ye(s))return!1}return!0}static create(e,t,r){let i=e%8==0?0:8-e%8,o=new Uint8Array(Math.ceil(e/8)),s=new n(o,i,t);return r.forEach(a=>s.insert(a)),s}insert(e){if(this.fe===0)return;let t=YH(e),[r,i]=XH(t);for(let o=0;o<this.hashCount;o++){let s=this.pe(r,i,o);this.we(s)}}we(e){let t=Math.floor(e/8),r=e%8;this.bitmap[t]|=1<<r}},fl=class extends Error{constructor(){super(...arguments),this.name="BloomFilterError"}};var Pg=class n{constructor(e,t,r,i,o){this.snapshotVersion=e,this.targetChanges=t,this.targetMismatches=r,this.documentUpdates=i,this.resolvedLimboDocuments=o}static createSynthesizedRemoteEventForCurrentChange(e,t,r){let i=new Map;return i.set(e,xg.createSynthesizedTargetChangeForCurrentChange(e,t,r)),new n(le.min(),i,new ft(Ie),Ar(),be())}},xg=class n{constructor(e,t,r,i,o){this.resumeToken=e,this.current=t,this.addedDocuments=r,this.modifiedDocuments=i,this.removedDocuments=o}static createSynthesizedTargetChangeForCurrentChange(e,t,r){return new n(r,t,be(),be(),be())}};var Wd=class{constructor(e,t,r,i){this.Se=e,this.removedTargetIds=t,this.key=r,this.be=i}},vy=class{constructor(e,t){this.targetId=e,this.De=t}},Sy=class{constructor(e,t,r=Gt.EMPTY_BYTE_STRING,i=null){this.state=e,this.targetIds=t,this.resumeToken=r,this.cause=i}},Ay=class{constructor(){this.ve=0,this.Ce=QH(),this.Fe=Gt.EMPTY_BYTE_STRING,this.Me=!1,this.xe=!0}get current(){return this.Me}get resumeToken(){return this.Fe}get Oe(){return this.ve!==0}get Ne(){return this.xe}Be(e){e.approximateByteSize()>0&&(this.xe=!0,this.Fe=e)}Le(){let e=be(),t=be(),r=be();return this.Ce.forEach((i,o)=>{switch(o){case 0:e=e.add(i);break;case 2:t=t.add(i);break;case 1:r=r.add(i);break;default:re(38017,{changeType:o})}}),new xg(this.Fe,this.Me,e,t,r)}ke(){this.xe=!1,this.Ce=QH()}qe(e,t){this.xe=!0,this.Ce=this.Ce.insert(e,t)}Qe(e){this.xe=!0,this.Ce=this.Ce.remove(e)}$e(){this.ve+=1}Ue(){this.ve-=1,ae(this.ve>=0,3241,{ve:this.ve})}Ke(){this.xe=!0,this.Me=!0}},zb=class{constructor(e){this.We=e,this.Ge=new Map,this.ze=Ar(),this.je=KI(),this.Je=KI(),this.He=new ft(Ie)}Ye(e){for(let t of e.Se)e.be&&e.be.isFoundDocument()?this.Ze(t,e.be):this.Xe(t,e.key,e.be);for(let t of e.removedTargetIds)this.Xe(t,e.key,e.be)}et(e){this.forEachTarget(e,t=>{let r=this.tt(t);switch(e.state){case 0:this.nt(t)&&r.Be(e.resumeToken);break;case 1:r.Ue(),r.Oe||r.ke(),r.Be(e.resumeToken);break;case 2:r.Ue(),r.Oe||this.removeTarget(t);break;case 3:this.nt(t)&&(r.Ke(),r.Be(e.resumeToken));break;case 4:this.nt(t)&&(this.rt(t),r.Be(e.resumeToken));break;default:re(56790,{state:e.state})}})}forEachTarget(e,t){e.targetIds.length>0?e.targetIds.forEach(t):this.Ge.forEach((r,i)=>{this.nt(i)&&t(i)})}it(e){let t=e.targetId,r=e.De.count,i=this.st(t);if(i){let o=i.target;if(Ty(o))if(r===0){let s=new Z(o.path);this.Xe(t,s,Jt.newNoDocument(s,le.min()))}else ae(r===1,20013,{expectedCount:r});else{let s=this.ot(t);if(s!==r){let a=this._t(e),c=a?this.ut(a,e,s):1;if(c!==0){this.rt(t);let l=c===2?"TargetPurposeExistenceFilterMismatchBloom":"TargetPurposeExistenceFilterMismatch";this.He=this.He.insert(t,l)}KH?.ct((function(d,h,f,g,E){var v,S,P,V,K,oe;let ge={localCacheCount:d,existenceFilterCount:h.count,databaseId:f.database,projectId:f.projectId},te=h.unchangedNames;return te&&(ge.bloomFilter={applied:E===0,hashCount:(v=te?.hashCount)!==null&&v!==void 0?v:0,bitmapLength:(V=(P=(S=te?.bits)===null||S===void 0?void 0:S.bitmap)===null||P===void 0?void 0:P.length)!==null&&V!==void 0?V:0,padding:(oe=(K=te?.bits)===null||K===void 0?void 0:K.padding)!==null&&oe!==void 0?oe:0,mightContain:C=>{var y;return(y=g?.mightContain(C))!==null&&y!==void 0&&y}}),ge})(s,e.De,this.We.lt(),a,c))}}}}_t(e){let t=e.De.unchangedNames;if(!t||!t.bits)return null;let{bits:{bitmap:r="",padding:i=0},hashCount:o=0}=t,s,a;try{s=Yo(r).toUint8Array()}catch(c){if(c instanceof my)return qo("Decoding the base64 bloom filter in existence filter failed ("+c.message+"); ignoring the bloom filter and falling back to full re-query."),null;throw c}try{a=new Wb(s,i,o)}catch(c){return qo(c instanceof fl?"BloomFilter error: ":"Applying bloom filter failed: ",c),null}return a.fe===0?null:a}ut(e,t,r){return t.De.count===r-this.ht(e,t.targetId)?0:2}ht(e,t){let r=this.We.getRemoteKeysForTarget(t),i=0;return r.forEach(o=>{let s=this.We.lt(),a=`projects/${s.projectId}/databases/${s.database}/documents/${o.path.canonicalString()}`;e.mightContain(a)||(this.Xe(t,o,null),i++)}),i}Pt(e){let t=new Map;this.Ge.forEach((o,s)=>{let a=this.st(s);if(a){if(o.current&&Ty(a.target)){let c=new Z(a.target.path);this.Tt(c).has(s)||this.It(s,c)||this.Xe(s,c,Jt.newNoDocument(c,e))}o.Ne&&(t.set(s,o.Le()),o.ke())}});let r=be();this.Je.forEach((o,s)=>{let a=!0;s.forEachWhile(c=>{let l=this.st(c);return!l||l.purpose==="TargetPurposeLimboResolution"||(a=!1,!1)}),a&&(r=r.add(o))}),this.ze.forEach((o,s)=>s.setReadTime(e));let i=new Pg(e,t,this.He,this.ze,r);return this.ze=Ar(),this.je=KI(),this.Je=KI(),this.He=new ft(Ie),i}Ze(e,t){if(!this.nt(e))return;let r=this.It(e,t.key)?2:0;this.tt(e).qe(t.key,r),this.ze=this.ze.insert(t.key,t),this.je=this.je.insert(t.key,this.Tt(t.key).add(e)),this.Je=this.Je.insert(t.key,this.dt(t.key).add(e))}Xe(e,t,r){if(!this.nt(e))return;let i=this.tt(e);this.It(e,t)?i.qe(t,1):i.Qe(t),this.Je=this.Je.insert(t,this.dt(t).delete(e)),this.Je=this.Je.insert(t,this.dt(t).add(e)),r&&(this.ze=this.ze.insert(t,r))}removeTarget(e){this.Ge.delete(e)}ot(e){let t=this.tt(e).Le();return this.We.getRemoteKeysForTarget(e).size+t.addedDocuments.size-t.removedDocuments.size}$e(e){this.tt(e).$e()}tt(e){let t=this.Ge.get(e);return t||(t=new Ay,this.Ge.set(e,t)),t}dt(e){let t=this.Je.get(e);return t||(t=new tt(Ie),this.Je=this.Je.insert(e,t)),t}Tt(e){let t=this.je.get(e);return t||(t=new tt(Ie),this.je=this.je.insert(e,t)),t}nt(e){let t=this.st(e)!==null;return t||j("WatchChangeAggregator","Detected inactive target",e),t}st(e){let t=this.Ge.get(e);return t&&t.Oe?null:this.We.Et(e)}rt(e){this.Ge.set(e,new Ay),this.We.getRemoteKeysForTarget(e).forEach(t=>{this.Xe(e,t,null)})}It(e,t){return this.We.getRemoteKeysForTarget(e).has(t)}};function KI(){return new ft(Z.comparator)}function QH(){return new ft(Z.comparator)}var joe={asc:"ASCENDING",desc:"DESCENDING"},Hoe={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"},$oe={and:"AND",or:"OR"},qb=class{constructor(e,t){this.databaseId=e,this.useProto3Json=t}};function Kb(n,e){return n.useProto3Json||Yg(e)?e:{value:e}}function ah(n,e){return n.useProto3Json?`${new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+e.nanoseconds).slice(-9)}Z`:{seconds:""+e.seconds,nanos:e.nanoseconds}}function M3(n,e){return n.useProto3Json?e.toBase64():e.toUint8Array()}function Woe(n,e){return ah(n,e.toTimestamp())}function dn(n){return ae(!!n,49232),le.fromTimestamp((function(t){let r=Ko(t);return new _t(r.seconds,r.nanos)})(n))}function L0(n,e){return Yb(n,e).canonicalString()}function Yb(n,e){let t=(function(i){return new ke(["projects",i.projectId,"databases",i.database])})(n).child("documents");return e===void 0?t:t.child(e)}function L3(n){let e=ke.fromString(n);return ae(G3(e),10190,{key:e.toString()}),e}function kg(n,e){return L0(n.databaseId,e.path)}function Wo(n,e){let t=L3(e);if(t.get(1)!==n.databaseId.projectId)throw new G(x.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+t.get(1)+" vs "+n.databaseId.projectId);if(t.get(3)!==n.databaseId.database)throw new G(x.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+t.get(3)+" vs "+n.databaseId.database);return new Z(k3(t))}function P3(n,e){return L0(n.databaseId,e)}function x3(n){let e=L3(n);return e.length===4?ke.emptyPath():k3(e)}function Xb(n){return new ke(["projects",n.databaseId.projectId,"databases",n.databaseId.database]).canonicalString()}function k3(n){return ae(n.length>4&&n.get(4)==="documents",29091,{key:n.toString()}),n.popFirst(5)}function JH(n,e,t){return{name:kg(n,e),fields:t.value.mapValue.fields}}function zoe(n,e,t){let r=Wo(n,e.name),i=dn(e.updateTime),o=e.createTime?dn(e.createTime):le.min(),s=new xn({mapValue:{fields:e.fields}}),a=Jt.newFoundDocument(r,i,o,s);return t&&a.setHasCommittedMutations(),t?a.setHasCommittedMutations():a}function qoe(n,e){return"found"in e?(function(r,i){ae(!!i.found,43571),i.found.name,i.found.updateTime;let o=Wo(r,i.found.name),s=dn(i.found.updateTime),a=i.found.createTime?dn(i.found.createTime):le.min(),c=new xn({mapValue:{fields:i.found.fields}});return Jt.newFoundDocument(o,s,a,c)})(n,e):"missing"in e?(function(r,i){ae(!!i.missing,3894),ae(!!i.readTime,22933);let o=Wo(r,i.missing),s=dn(i.readTime);return Jt.newNoDocument(o,s)})(n,e):re(7234,{result:e})}function Koe(n,e){let t;if("targetChange"in e){e.targetChange;let r=(function(l){return l==="NO_CHANGE"?0:l==="ADD"?1:l==="REMOVE"?2:l==="CURRENT"?3:l==="RESET"?4:re(39313,{state:l})})(e.targetChange.targetChangeType||"NO_CHANGE"),i=e.targetChange.targetIds||[],o=(function(l,d){return l.useProto3Json?(ae(d===void 0||typeof d=="string",58123),Gt.fromBase64String(d||"")):(ae(d===void 0||d instanceof Buffer||d instanceof Uint8Array,16193),Gt.fromUint8Array(d||new Uint8Array))})(n,e.targetChange.resumeToken),s=e.targetChange.cause,a=s&&(function(l){let d=l.code===void 0?x.UNKNOWN:O3(l.code);return new G(d,l.message||"")})(s);t=new Sy(r,i,o,a||null)}else if("documentChange"in e){e.documentChange;let r=e.documentChange;r.document,r.document.name,r.document.updateTime;let i=Wo(n,r.document.name),o=dn(r.document.updateTime),s=r.document.createTime?dn(r.document.createTime):le.min(),a=new xn({mapValue:{fields:r.document.fields}}),c=Jt.newFoundDocument(i,o,s,a),l=r.targetIds||[],d=r.removedTargetIds||[];t=new Wd(l,d,c.key,c)}else if("documentDelete"in e){e.documentDelete;let r=e.documentDelete;r.document;let i=Wo(n,r.document),o=r.readTime?dn(r.readTime):le.min(),s=Jt.newNoDocument(i,o),a=r.removedTargetIds||[];t=new Wd([],a,s.key,s)}else if("documentRemove"in e){e.documentRemove;let r=e.documentRemove;r.document;let i=Wo(n,r.document),o=r.removedTargetIds||[];t=new Wd([],o,i,null)}else{if(!("filter"in e))return re(11601,{At:e});{e.filter;let r=e.filter;r.targetId;let{count:i=0,unchangedNames:o}=r,s=new $b(i,o),a=r.targetId;t=new vy(a,s)}}return t}function Fg(n,e){let t;if(e instanceof fa)t={update:JH(n,e.key,e.value)};else if(e instanceof Sl)t={delete:kg(n,e.key)};else if(e instanceof fi)t={update:JH(n,e.key,e.data),updateMask:tse(e.fieldMask)};else{if(!(e instanceof Og))return re(16599,{Rt:e.type});t={verify:kg(n,e.key)}}return e.fieldTransforms.length>0&&(t.updateTransforms=e.fieldTransforms.map(r=>(function(o,s){let a=s.transform;if(a instanceof yl)return{fieldPath:s.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(a instanceof da)return{fieldPath:s.field.canonicalString(),appendMissingElements:{values:a.elements}};if(a instanceof ha)return{fieldPath:s.field.canonicalString(),removeAllFromArray:{values:a.elements}};if(a instanceof vl)return{fieldPath:s.field.canonicalString(),increment:a.Ee};throw re(20930,{transform:s.transform})})(0,r))),e.precondition.isNone||(t.currentDocument=(function(i,o){return o.updateTime!==void 0?{updateTime:Woe(i,o.updateTime)}:o.exists!==void 0?{exists:o.exists}:re(27497)})(n,e.precondition)),t}function Qb(n,e){let t=e.currentDocument?(function(o){return o.updateTime!==void 0?_n.updateTime(dn(o.updateTime)):o.exists!==void 0?_n.exists(o.exists):_n.none()})(e.currentDocument):_n.none(),r=e.updateTransforms?e.updateTransforms.map(i=>(function(s,a){let c=null;if("setToServerValue"in a)ae(a.setToServerValue==="REQUEST_TIME",16630,{proto:a}),c=new yl;else if("appendMissingElements"in a){let d=a.appendMissingElements.values||[];c=new da(d)}else if("removeAllFromArray"in a){let d=a.removeAllFromArray.values||[];c=new ha(d)}else"increment"in a?c=new vl(s,a.increment):re(16584,{proto:a});let l=Qt.fromServerFormat(a.fieldPath);return new Bb(l,c)})(n,i)):[];if(e.update){e.update.name;let i=Wo(n,e.update.name),o=new xn({mapValue:{fields:e.update.fields}});if(e.updateMask){let s=(function(c){let l=c.fieldPaths||[];return new Sr(l.map(d=>Qt.fromServerFormat(d)))})(e.updateMask);return new fi(i,o,s,t,r)}return new fa(i,o,t,r)}if(e.delete){let i=Wo(n,e.delete);return new Sl(i,t)}if(e.verify){let i=Wo(n,e.verify);return new Og(i,t)}return re(1463,{proto:e})}function Yoe(n,e){return n&&n.length>0?(ae(e!==void 0,14353),n.map(t=>(function(i,o){let s=i.updateTime?dn(i.updateTime):dn(o);return s.isEqual(le.min())&&(s=dn(o)),new Gb(s,i.transformResults||[])})(t,e))):[]}function F3(n,e){return{documents:[P3(n,e.path)]}}function P0(n,e){let t={structuredQuery:{}},r=e.path,i;e.collectionGroup!==null?(i=r,t.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(i=r.popLast(),t.structuredQuery.from=[{collectionId:r.lastSegment()}]),t.parent=P3(n,i);let o=(function(l){if(l.length!==0)return B3(Ye.create(l,"and"))})(e.filters);o&&(t.structuredQuery.where=o);let s=(function(l){if(l.length!==0)return l.map(d=>(function(f){return{field:ea(f.field),direction:Joe(f.dir)}})(d))})(e.orderBy);s&&(t.structuredQuery.orderBy=s);let a=Kb(n,e.limit);return a!==null&&(t.structuredQuery.limit=a),e.startAt&&(t.structuredQuery.startAt=(function(l){return{before:l.inclusive,values:l.position}})(e.startAt)),e.endAt&&(t.structuredQuery.endAt=(function(l){return{before:!l.inclusive,values:l.position}})(e.endAt)),{Vt:t,parent:i}}function Xoe(n,e,t,r){let{Vt:i,parent:o}=P0(n,e),s={},a=[],c=0;return t.forEach(l=>{let d=r?l.alias:"aggregate_"+c++;s[d]=l.alias,l.aggregateType==="count"?a.push({alias:d,count:{}}):l.aggregateType==="avg"?a.push({alias:d,avg:{field:ea(l.fieldPath)}}):l.aggregateType==="sum"&&a.push({alias:d,sum:{field:ea(l.fieldPath)}})}),{request:{structuredAggregationQuery:{aggregations:a,structuredQuery:i.structuredQuery},parent:i.parent},ft:s,parent:o}}function U3(n){let e=x3(n.parent),t=n.structuredQuery,r=t.from?t.from.length:0,i=null;if(r>0){ae(r===1,65062);let d=t.from[0];d.allDescendants?i=d.collectionId:e=e.child(d.collectionId)}let o=[];t.where&&(o=(function(h){let f=V3(h);return f instanceof Ye&&w0(f)?f.getFilters():[f]})(t.where));let s=[];t.orderBy&&(s=(function(h){return h.map(f=>(function(E){return new Tl(Bd(E.field),(function(S){switch(S){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}})(E.direction))})(f))})(t.orderBy));let a=null;t.limit&&(a=(function(h){let f;return f=typeof h=="object"?h.value:h,Yg(f)?null:f})(t.limit));let c=null;t.startAt&&(c=(function(h){let f=!!h.before,g=h.values||[];return new io(g,f)})(t.startAt));let l=null;return t.endAt&&(l=(function(h){let f=!h.before,g=h.values||[];return new io(g,f)})(t.endAt)),g3(e,i,s,o,a,"F",c,l)}function Qoe(n,e){let t=(function(i){switch(i){case"TargetPurposeListen":return null;case"TargetPurposeExistenceFilterMismatch":return"existence-filter-mismatch";case"TargetPurposeExistenceFilterMismatchBloom":return"existence-filter-mismatch-bloom";case"TargetPurposeLimboResolution":return"limbo-document";default:return re(28987,{purpose:i})}})(e.purpose);return t==null?null:{"goog-listen-tags":t}}function V3(n){return n.unaryFilter!==void 0?(function(t){switch(t.unaryFilter.op){case"IS_NAN":let r=Bd(t.unaryFilter.field);return Le.create(r,"==",{doubleValue:NaN});case"IS_NULL":let i=Bd(t.unaryFilter.field);return Le.create(i,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":let o=Bd(t.unaryFilter.field);return Le.create(o,"!=",{doubleValue:NaN});case"IS_NOT_NULL":let s=Bd(t.unaryFilter.field);return Le.create(s,"!=",{nullValue:"NULL_VALUE"});case"OPERATOR_UNSPECIFIED":return re(61313);default:return re(60726)}})(n):n.fieldFilter!==void 0?(function(t){return Le.create(Bd(t.fieldFilter.field),(function(i){switch(i){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";case"OPERATOR_UNSPECIFIED":return re(58110);default:return re(50506)}})(t.fieldFilter.op),t.fieldFilter.value)})(n):n.compositeFilter!==void 0?(function(t){return Ye.create(t.compositeFilter.filters.map(r=>V3(r)),(function(i){switch(i){case"AND":return"and";case"OR":return"or";default:return re(1026)}})(t.compositeFilter.op))})(n):re(30097,{filter:n})}function Joe(n){return joe[n]}function Zoe(n){return Hoe[n]}function ese(n){return $oe[n]}function ea(n){return{fieldPath:n.canonicalString()}}function Bd(n){return Qt.fromServerFormat(n.fieldPath)}function B3(n){return n instanceof Le?(function(t){if(t.op==="=="){if(kH(t.value))return{unaryFilter:{field:ea(t.field),op:"IS_NAN"}};if(xH(t.value))return{unaryFilter:{field:ea(t.field),op:"IS_NULL"}}}else if(t.op==="!="){if(kH(t.value))return{unaryFilter:{field:ea(t.field),op:"IS_NOT_NAN"}};if(xH(t.value))return{unaryFilter:{field:ea(t.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:ea(t.field),op:Zoe(t.op),value:t.value}}})(n):n instanceof Ye?(function(t){let r=t.getFilters().map(i=>B3(i));return r.length===1?r[0]:{compositeFilter:{op:ese(t.op),filters:r}}})(n):re(54877,{filter:n})}function tse(n){let e=[];return n.fields.forEach(t=>e.push(t.canonicalString())),{fieldPaths:e}}function G3(n){return n.length>=4&&n.get(0)==="projects"&&n.get(2)==="databases"}var ch=class n{constructor(e,t,r,i,o=le.min(),s=le.min(),a=Gt.EMPTY_BYTE_STRING,c=null){this.target=e,this.targetId=t,this.purpose=r,this.sequenceNumber=i,this.snapshotVersion=o,this.lastLimboFreeSnapshotVersion=s,this.resumeToken=a,this.expectedCount=c}withSequenceNumber(e){return new n(this.target,this.targetId,this.purpose,e,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,this.expectedCount)}withResumeToken(e,t){return new n(this.target,this.targetId,this.purpose,this.sequenceNumber,t,this.lastLimboFreeSnapshotVersion,e,null)}withExpectedCount(e){return new n(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,e)}withLastLimboFreeSnapshotVersion(e){return new n(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,e,this.resumeToken,this.expectedCount)}};var Cy=class{constructor(e){this.gt=e}};function nse(n,e){let t;if(e.document)t=zoe(n.gt,e.document,!!e.hasCommittedMutations);else if(e.noDocument){let r=Z.fromSegments(e.noDocument.path),i=Cl(e.noDocument.readTime);t=Jt.newNoDocument(r,i),e.hasCommittedMutations&&t.setHasCommittedMutations()}else{if(!e.unknownDocument)return re(56709);{let r=Z.fromSegments(e.unknownDocument.path),i=Cl(e.unknownDocument.version);t=Jt.newUnknownDocument(r,i)}}return e.readTime&&t.setReadTime((function(i){let o=new _t(i[0],i[1]);return le.fromTimestamp(o)})(e.readTime)),t}function ZH(n,e){let t=e.key,r={prefixPath:t.getCollectionPath().popLast().toArray(),collectionGroup:t.collectionGroup,documentId:t.path.lastSegment(),readTime:Dy(e.readTime),hasCommittedMutations:e.hasCommittedMutations};if(e.isFoundDocument())r.document=(function(o,s){return{name:kg(o,s.key),fields:s.data.value.mapValue.fields,updateTime:ah(o,s.version.toTimestamp()),createTime:ah(o,s.createTime.toTimestamp())}})(n.gt,e);else if(e.isNoDocument())r.noDocument={path:t.path.toArray(),readTime:Al(e.version)};else{if(!e.isUnknownDocument())return re(57904,{document:e});r.unknownDocument={path:t.path.toArray(),version:Al(e.version)}}return r}function Dy(n){let e=n.toTimestamp();return[e.seconds,e.nanoseconds]}function Al(n){let e=n.toTimestamp();return{seconds:e.seconds,nanoseconds:e.nanoseconds}}function Cl(n){let e=new _t(n.seconds,n.nanoseconds);return le.fromTimestamp(e)}function ll(n,e){let t=(e.baseMutations||[]).map(o=>Qb(n.gt,o));for(let o=0;o<e.mutations.length-1;++o){let s=e.mutations[o];if(o+1<e.mutations.length&&e.mutations[o+1].transform!==void 0){let a=e.mutations[o+1];s.updateTransforms=a.transform.fieldTransforms,e.mutations.splice(o+1,1),++o}}let r=e.mutations.map(o=>Qb(n.gt,o)),i=_t.fromMillis(e.localWriteTimeMs);return new Mg(e.batchId,i,t,r)}function ug(n){let e=Cl(n.readTime),t=n.lastLimboFreeSnapshotVersion!==void 0?Cl(n.lastLimboFreeSnapshotVersion):le.min(),r;return r=(function(o){return o.documents!==void 0})(n.query)?(function(o){let s=o.documents.length;return ae(s===1,1966,{count:s}),Cr(Jg(x3(o.documents[0])))})(n.query):(function(o){return Cr(U3(o))})(n.query),new ch(r,n.targetId,"TargetPurposeListen",n.lastListenSequenceNumber,e,t,Gt.fromBase64String(n.resumeToken))}function j3(n,e){let t=Al(e.snapshotVersion),r=Al(e.lastLimboFreeSnapshotVersion),i;i=Ty(e.target)?F3(n.gt,e.target):P0(n.gt,e.target).Vt;let o=e.resumeToken.toBase64();return{targetId:e.targetId,canonicalId:Il(e.target),readTime:t,resumeToken:o,lastListenSequenceNumber:e.sequenceNumber,lastLimboFreeSnapshotVersion:r,query:i}}function H3(n){let e=U3({parent:n.parent,structuredQuery:n.structuredQuery});return n.limitType==="LAST"?yy(e,e.limit,"L"):e}function ib(n,e){return new Lg(e.largestBatchId,Qb(n.gt,e.overlayMutation))}function e$(n,e){let t=e.path.lastSegment();return[n,kn(e.path.popLast()),t]}function t$(n,e,t,r){return{indexId:n,uid:e,sequenceNumber:t,readTime:Al(r.readTime),documentKey:kn(r.documentKey.path),largestBatchId:r.largestBatchId}}var Jb=class{getBundleMetadata(e,t){return n$(e).get(t).next(r=>{if(r)return(function(o){return{id:o.bundleId,createTime:Cl(o.createTime),version:o.version}})(r)})}saveBundleMetadata(e,t){return n$(e).put((function(i){return{bundleId:i.id,createTime:Al(dn(i.createTime)),version:i.version}})(t))}getNamedQuery(e,t){return r$(e).get(t).next(r=>{if(r)return(function(o){return{name:o.name,query:H3(o.bundledQuery),readTime:Cl(o.readTime)}})(r)})}saveNamedQuery(e,t){return r$(e).put((function(i){return{name:i.name,readTime:Al(dn(i.readTime)),bundledQuery:i.bundledQuery}})(t))}};function n$(n){return en(n,iv)}function r$(n){return en(n,ov)}var Ry=class n{constructor(e,t){this.serializer=e,this.userId=t}static yt(e,t){let r=t.uid||"";return new n(e,r)}getOverlay(e,t){return og(e).get(e$(this.userId,t)).next(r=>r?ib(this.serializer,r):null)}getOverlays(e,t){let r=to();return L.forEach(t,i=>this.getOverlay(e,i).next(o=>{o!==null&&r.set(i,o)})).next(()=>r)}saveOverlays(e,t,r){let i=[];return r.forEach((o,s)=>{let a=new Lg(t,s);i.push(this.wt(e,a))}),L.waitFor(i)}removeOverlaysForBatchId(e,t,r){let i=new Set;t.forEach(s=>i.add(kn(s.getCollectionPath())));let o=[];return i.forEach(s=>{let a=IDBKeyRange.bound([this.userId,s,r],[this.userId,s,r+1],!1,!0);o.push(og(e).Y(Cb,a))}),L.waitFor(o)}getOverlaysForCollection(e,t,r){let i=to(),o=kn(t),s=IDBKeyRange.bound([this.userId,o,r],[this.userId,o,Number.POSITIVE_INFINITY],!0);return og(e).j(Cb,s).next(a=>{for(let c of a){let l=ib(this.serializer,c);i.set(l.getKey(),l)}return i})}getOverlaysForCollectionGroup(e,t,r,i){let o=to(),s,a=IDBKeyRange.bound([this.userId,t,r],[this.userId,t,Number.POSITIVE_INFINITY],!0);return og(e).X({index:X$,range:a},(c,l,d)=>{let h=ib(this.serializer,l);o.size()<i||h.largestBatchId===s?(o.set(h.getKey(),h),s=h.largestBatchId):d.done()}).next(()=>o)}wt(e,t){return og(e).put((function(i,o,s){let[a,c,l]=e$(o,s.mutation.key);return{userId:o,collectionPath:c,documentId:l,collectionGroup:s.mutation.key.getCollectionGroup(),largestBatchId:s.largestBatchId,overlayMutation:Fg(i.gt,s.mutation)}})(this.serializer,this.userId,t))}};function og(n){return en(n,sv)}var Zb=class{St(e){return en(e,C0)}getSessionToken(e){return this.St(e).get("sessionToken").next(t=>{let r=t?.value;return r?Gt.fromUint8Array(r):Gt.EMPTY_BYTE_STRING})}setSessionToken(e,t){return this.St(e).put({name:"sessionToken",value:t.toUint8Array()})}};var $o=class{constructor(){}bt(e,t){this.Dt(e,t),t.vt()}Dt(e,t){if("nullValue"in e)this.Ct(t,5);else if("booleanValue"in e)this.Ct(t,10),t.Ft(e.booleanValue?1:0);else if("integerValue"in e)this.Ct(t,15),t.Ft(Et(e.integerValue));else if("doubleValue"in e){let r=Et(e.doubleValue);isNaN(r)?this.Ct(t,13):(this.Ct(t,15),vg(r)?t.Ft(0):t.Ft(r))}else if("timestampValue"in e){let r=e.timestampValue;this.Ct(t,20),typeof r=="string"&&(r=Ko(r)),t.Mt(`${r.seconds||""}`),t.Ft(r.nanos||0)}else if("stringValue"in e)this.xt(e.stringValue,t),this.Ot(t);else if("bytesValue"in e)this.Ct(t,30),t.Nt(Yo(e.bytesValue)),this.Ot(t);else if("referenceValue"in e)this.Bt(e.referenceValue,t);else if("geoPointValue"in e){let r=e.geoPointValue;this.Ct(t,45),t.Ft(r.latitude||0),t.Ft(r.longitude||0)}else"mapValue"in e?a3(e)?this.Ct(t,Number.MAX_SAFE_INTEGER):lv(e)?this.Lt(e.mapValue,t):(this.kt(e.mapValue,t),this.Ot(t)):"arrayValue"in e?(this.qt(e.arrayValue,t),this.Ot(t)):re(19022,{Qt:e})}xt(e,t){this.Ct(t,25),this.$t(e,t)}$t(e,t){t.Mt(e)}kt(e,t){let r=e.fields||{};this.Ct(t,55);for(let i of Object.keys(r))this.xt(i,t),this.Dt(r[i],t)}Lt(e,t){var r,i;let o=e.fields||{};this.Ct(t,53);let s=nh,a=((i=(r=o[s].arrayValue)===null||r===void 0?void 0:r.values)===null||i===void 0?void 0:i.length)||0;this.Ct(t,15),t.Ft(Et(a)),this.xt(s,t),this.Dt(o[s],t)}qt(e,t){let r=e.values||[];this.Ct(t,50);for(let i of r)this.Dt(i,t)}Bt(e,t){this.Ct(t,37),Z.fromName(e).path.forEach(r=>{this.Ct(t,60),this.$t(r,t)})}Ct(e,t){e.Ft(t)}Ot(e){e.Ft(2)}};$o.Ut=new $o;var Pd=255;function rse(n){if(n===0)return 8;let e=0;return n>>4||(e+=4,n<<=4),n>>6||(e+=2,n<<=2),n>>7||(e+=1),e}function i$(n){let e=64-(function(r){let i=0;for(let o=0;o<8;++o){let s=rse(255&r[o]);if(i+=s,s!==8)break}return i})(n);return Math.ceil(e/8)}var eO=class{constructor(){this.buffer=new Uint8Array(1024),this.position=0}Kt(e){let t=e[Symbol.iterator](),r=t.next();for(;!r.done;)this.Wt(r.value),r=t.next();this.Gt()}zt(e){let t=e[Symbol.iterator](),r=t.next();for(;!r.done;)this.jt(r.value),r=t.next();this.Jt()}Ht(e){for(let t of e){let r=t.charCodeAt(0);if(r<128)this.Wt(r);else if(r<2048)this.Wt(960|r>>>6),this.Wt(128|63&r);else if(t<"\uD800"||"\uDBFF"<t)this.Wt(480|r>>>12),this.Wt(128|63&r>>>6),this.Wt(128|63&r);else{let i=t.codePointAt(0);this.Wt(240|i>>>18),this.Wt(128|63&i>>>12),this.Wt(128|63&i>>>6),this.Wt(128|63&i)}}this.Gt()}Yt(e){for(let t of e){let r=t.charCodeAt(0);if(r<128)this.jt(r);else if(r<2048)this.jt(960|r>>>6),this.jt(128|63&r);else if(t<"\uD800"||"\uDBFF"<t)this.jt(480|r>>>12),this.jt(128|63&r>>>6),this.jt(128|63&r);else{let i=t.codePointAt(0);this.jt(240|i>>>18),this.jt(128|63&i>>>12),this.jt(128|63&i>>>6),this.jt(128|63&i)}}this.Jt()}Zt(e){let t=this.Xt(e),r=i$(t);this.en(1+r),this.buffer[this.position++]=255&r;for(let i=t.length-r;i<t.length;++i)this.buffer[this.position++]=255&t[i]}tn(e){let t=this.Xt(e),r=i$(t);this.en(1+r),this.buffer[this.position++]=~(255&r);for(let i=t.length-r;i<t.length;++i)this.buffer[this.position++]=~(255&t[i])}nn(){this.rn(Pd),this.rn(255)}sn(){this._n(Pd),this._n(255)}reset(){this.position=0}seed(e){this.en(e.length),this.buffer.set(e,this.position),this.position+=e.length}an(){return this.buffer.slice(0,this.position)}Xt(e){let t=(function(o){let s=new DataView(new ArrayBuffer(8));return s.setFloat64(0,o,!1),new Uint8Array(s.buffer)})(e),r=!!(128&t[0]);t[0]^=r?255:128;for(let i=1;i<t.length;++i)t[i]^=r?255:0;return t}Wt(e){let t=255&e;t===0?(this.rn(0),this.rn(255)):t===Pd?(this.rn(Pd),this.rn(0)):this.rn(t)}jt(e){let t=255&e;t===0?(this._n(0),this._n(255)):t===Pd?(this._n(Pd),this._n(0)):this._n(e)}Gt(){this.rn(0),this.rn(1)}Jt(){this._n(0),this._n(1)}rn(e){this.en(1),this.buffer[this.position++]=e}_n(e){this.en(1),this.buffer[this.position++]=~e}en(e){let t=e+this.position;if(t<=this.buffer.length)return;let r=2*this.buffer.length;r<t&&(r=t);let i=new Uint8Array(r);i.set(this.buffer),this.buffer=i}},tO=class{constructor(e){this.un=e}Nt(e){this.un.Kt(e)}Mt(e){this.un.Ht(e)}Ft(e){this.un.Zt(e)}vt(){this.un.nn()}},nO=class{constructor(e){this.un=e}Nt(e){this.un.zt(e)}Mt(e){this.un.Yt(e)}Ft(e){this.un.tn(e)}vt(){this.un.sn()}},ul=class{constructor(){this.un=new eO,this.cn=new tO(this.un),this.ln=new nO(this.un)}seed(e){this.un.seed(e)}hn(e){return e===0?this.cn:this.ln}an(){return this.un.an()}reset(){this.un.reset()}};var dl=class n{constructor(e,t,r,i){this.Pn=e,this.Tn=t,this.In=r,this.dn=i}En(){let e=this.dn.length,t=e===0||this.dn[e-1]===255?e+1:e,r=new Uint8Array(t);return r.set(this.dn,0),t!==e?r.set([0],this.dn.length):++r[r.length-1],new n(this.Pn,this.Tn,this.In,r)}An(e,t,r){return{indexId:this.Pn,uid:e,arrayValue:oy(this.In),directionalValue:oy(this.dn),orderedDocumentKey:oy(t),documentKey:r.path.toArray()}}Rn(e,t,r){let i=this.An(e,t,r);return[i.indexId,i.uid,i.arrayValue,i.directionalValue,i.orderedDocumentKey,i.documentKey]}};function Qs(n,e){let t=n.Pn-e.Pn;return t!==0?t:(t=o$(n.In,e.In),t!==0?t:(t=o$(n.dn,e.dn),t!==0?t:Z.comparator(n.Tn,e.Tn)))}function o$(n,e){for(let t=0;t<n.length&&t<e.length;++t){let r=n[t]-e[t];if(r!==0)return r}return n.length-e.length}function oy(n){return rR()?(function(t){let r="";for(let i=0;i<t.length;i++)r+=String.fromCharCode(t[i]);return r})(n):n}function s$(n){return typeof n!="string"?n:(function(t){let r=new Uint8Array(t.length);for(let i=0;i<t.length;i++)r[i]=t.charCodeAt(i);return r})(n)}var Ny=class{constructor(e){this.Vn=new tt((t,r)=>Qt.comparator(t.field,r.field)),this.collectionId=e.collectionGroup!=null?e.collectionGroup:e.path.lastSegment(),this.mn=e.orderBy,this.fn=[];for(let t of e.filters){let r=t;r.isInequality()?this.Vn=this.Vn.add(r):this.fn.push(r)}}get gn(){return this.Vn.size>1}pn(e){if(ae(e.collectionGroup===this.collectionId,49279),this.gn)return!1;let t=_b(e);if(t!==void 0&&!this.yn(t))return!1;let r=sl(e),i=new Set,o=0,s=0;for(;o<r.length&&this.yn(r[o]);++o)i=i.add(r[o].fieldPath.canonicalString());if(o===r.length)return!0;if(this.Vn.size>0){let a=this.Vn.getIterator().getNext();if(!i.has(a.field.canonicalString())){let c=r[o];if(!this.wn(a,c)||!this.Sn(this.mn[s++],c))return!1}++o}for(;o<r.length;++o){let a=r[o];if(s>=this.mn.length||!this.Sn(this.mn[s++],a))return!1}return!0}bn(){if(this.gn)return null;let e=new tt(Qt.comparator),t=[];for(let r of this.fn)if(!r.field.isKeyField())if(r.op==="array-contains"||r.op==="array-contains-any")t.push(new Hd(r.field,2));else{if(e.has(r.field))continue;e=e.add(r.field),t.push(new Hd(r.field,0))}for(let r of this.mn)r.field.isKeyField()||e.has(r.field)||(e=e.add(r.field),t.push(new Hd(r.field,r.dir==="asc"?0:1)));return new Yd(Yd.UNKNOWN_ID,this.collectionId,t,yg.empty())}yn(e){for(let t of this.fn)if(this.wn(t,e))return!0;return!1}wn(e,t){if(e===void 0||!e.field.isEqual(t.fieldPath))return!1;let r=e.op==="array-contains"||e.op==="array-contains-any";return t.kind===2===r}Sn(e,t){return!!e.field.isEqual(t.fieldPath)&&(t.kind===0&&e.dir==="asc"||t.kind===1&&e.dir==="desc")}};function $3(n){var e,t;if(ae(n instanceof Le||n instanceof Ye,20012),n instanceof Le){if(n instanceof _y){let i=((t=(e=n.value.arrayValue)===null||e===void 0?void 0:e.values)===null||t===void 0?void 0:t.map(o=>Le.create(n.field,"==",o)))||[];return Ye.create(i,"or")}return n}let r=n.filters.map(i=>$3(i));return Ye.create(r,n.op)}function ise(n){if(n.getFilters().length===0)return[];let e=oO($3(n));return ae(W3(e),7391),rO(e)||iO(e)?[e]:e.getFilters()}function rO(n){return n instanceof Le}function iO(n){return n instanceof Ye&&w0(n)}function W3(n){return rO(n)||iO(n)||(function(t){if(t instanceof Ye&&wb(t)){for(let r of t.getFilters())if(!rO(r)&&!iO(r))return!1;return!0}return!1})(n)}function oO(n){if(ae(n instanceof Le||n instanceof Ye,34018),n instanceof Le)return n;if(n.filters.length===1)return oO(n.filters[0]);let e=n.filters.map(r=>oO(r)),t=Ye.create(e,n.op);return t=wy(t),W3(t)?t:(ae(t instanceof Ye,64498),ae(ih(t),40251),ae(t.filters.length>1,57927),t.filters.reduce((r,i)=>x0(r,i)))}function x0(n,e){let t;return ae(n instanceof Le||n instanceof Ye,38388),ae(e instanceof Le||e instanceof Ye,25473),t=n instanceof Le?e instanceof Le?(function(i,o){return Ye.create([i,o],"and")})(n,e):a$(n,e):e instanceof Le?a$(e,n):(function(i,o){if(ae(i.filters.length>0&&o.filters.length>0,48005),ih(i)&&ih(o))return h3(i,o.getFilters());let s=wb(i)?i:o,a=wb(i)?o:i,c=s.filters.map(l=>x0(l,a));return Ye.create(c,"or")})(n,e),wy(t)}function a$(n,e){if(ih(e))return h3(e,n.getFilters());{let t=e.filters.map(r=>x0(n,r));return Ye.create(t,"or")}}function wy(n){if(ae(n instanceof Le||n instanceof Ye,11850),n instanceof Le)return n;let e=n.getFilters();if(e.length===1)return wy(e[0]);if(u3(n))return n;let t=e.map(i=>wy(i)),r=[];return t.forEach(i=>{i instanceof Le?r.push(i):i instanceof Ye&&(i.op===n.op?r.push(...i.filters):r.push(i))}),r.length===1?r[0]:Ye.create(r,n.op)}var sO=class{constructor(){this.Dn=new Ug}addToCollectionParentIndex(e,t){return this.Dn.add(t),L.resolve()}getCollectionParents(e,t){return L.resolve(this.Dn.getEntries(t))}addFieldIndex(e,t){return L.resolve()}deleteFieldIndex(e,t){return L.resolve()}deleteAllFieldIndexes(e){return L.resolve()}createTargetIndexes(e,t){return L.resolve()}getDocumentsMatchingTarget(e,t){return L.resolve(null)}getIndexType(e,t){return L.resolve(0)}getFieldIndexes(e,t){return L.resolve([])}getNextCollectionGroupToUpdate(e){return L.resolve(null)}getMinOffset(e,t){return L.resolve(jr.min())}getMinOffsetFromCollectionGroup(e,t){return L.resolve(jr.min())}updateCollectionGroup(e,t,r){return L.resolve()}updateIndexEntries(e,t){return L.resolve()}},Ug=class{constructor(){this.index={}}add(e){let t=e.lastSegment(),r=e.popLast(),i=this.index[t]||new tt(ke.comparator),o=!i.has(r);return this.index[t]=i.add(r),o}has(e){let t=e.lastSegment(),r=e.popLast(),i=this.index[t];return i&&i.has(r)}getEntries(e){return(this.index[e]||new tt(ke.comparator)).toArray()}};var c$="IndexedDbIndexManager",YI=new Uint8Array(0),aO=class{constructor(e,t){this.databaseId=t,this.vn=new Ug,this.Cn=new hi(r=>Il(r),(r,i)=>Qg(r,i)),this.uid=e.uid||""}addToCollectionParentIndex(e,t){if(!this.vn.has(t)){let r=t.lastSegment(),i=t.popLast();e.addOnCommittedListener(()=>{this.vn.add(t)});let o={collectionId:r,parent:kn(i)};return l$(e).put(o)}return L.resolve()}getCollectionParents(e,t){let r=[],i=IDBKeyRange.bound([t,""],[U$(t),""],!1,!0);return l$(e).j(i).next(o=>{for(let s of o){if(s.collectionId!==t)break;r.push(eo(s.parent))}return r})}addFieldIndex(e,t){let r=sg(e),i=(function(a){return{indexId:a.indexId,collectionGroup:a.collectionGroup,fields:a.fields.map(c=>[c.fieldPath.canonicalString(),c.kind])}})(t);delete i.indexId;let o=r.add(i);if(t.indexState){let s=kd(e);return o.next(a=>{s.put(t$(a,this.uid,t.indexState.sequenceNumber,t.indexState.offset))})}return o.next()}deleteFieldIndex(e,t){let r=sg(e),i=kd(e),o=xd(e);return r.delete(t.indexId).next(()=>i.delete(IDBKeyRange.bound([t.indexId],[t.indexId+1],!1,!0))).next(()=>o.delete(IDBKeyRange.bound([t.indexId],[t.indexId+1],!1,!0)))}deleteAllFieldIndexes(e){let t=sg(e),r=xd(e),i=kd(e);return t.Y().next(()=>r.Y()).next(()=>i.Y())}createTargetIndexes(e,t){return L.forEach(this.Fn(t),r=>this.getIndexType(e,r).next(i=>{if(i===0||i===1){let o=new Ny(r).bn();if(o!=null)return this.addFieldIndex(e,o)}}))}getDocumentsMatchingTarget(e,t){let r=xd(e),i=!0,o=new Map;return L.forEach(this.Fn(t),s=>this.Mn(e,s).next(a=>{i&&(i=!!a),o.set(s,a)})).next(()=>{if(i){let s=be(),a=[];return L.forEach(o,(c,l)=>{j(c$,`Using index ${(function(K){return`id=${K.indexId}|cg=${K.collectionGroup}|f=${K.fields.map(oe=>`${oe.fieldPath}:${oe.kind}`).join(",")}`})(c)} to execute ${Il(t)}`);let d=(function(K,oe){let ge=_b(oe);if(ge===void 0)return null;for(let te of Iy(K,ge.fieldPath))switch(te.op){case"array-contains-any":return te.value.arrayValue.values||[];case"array-contains":return[te.value]}return null})(l,c),h=(function(K,oe){let ge=new Map;for(let te of sl(oe))for(let C of Iy(K,te.fieldPath))switch(C.op){case"==":case"in":ge.set(te.fieldPath.canonicalString(),C.value);break;case"not-in":case"!=":return ge.set(te.fieldPath.canonicalString(),C.value),Array.from(ge.values())}return null})(l,c),f=(function(K,oe){let ge=[],te=!0;for(let C of sl(oe)){let y=C.kind===0?GH(K,C.fieldPath,K.startAt):jH(K,C.fieldPath,K.startAt);ge.push(y.value),te&&(te=y.inclusive)}return new io(ge,te)})(l,c),g=(function(K,oe){let ge=[],te=!0;for(let C of sl(oe)){let y=C.kind===0?jH(K,C.fieldPath,K.endAt):GH(K,C.fieldPath,K.endAt);ge.push(y.value),te&&(te=y.inclusive)}return new io(ge,te)})(l,c),E=this.xn(c,l,f),v=this.xn(c,l,g),S=this.On(c,l,h),P=this.Nn(c.indexId,d,E,f.inclusive,v,g.inclusive,S);return L.forEach(P,V=>r.H(V,t.limit).next(K=>{K.forEach(oe=>{let ge=Z.fromSegments(oe.documentKey);s.has(ge)||(s=s.add(ge),a.push(ge))})}))}).next(()=>a)}return L.resolve(null)})}Fn(e){let t=this.Cn.get(e);return t||(e.filters.length===0?t=[e]:t=ise(Ye.create(e.filters,"and")).map(r=>Ub(e.path,e.collectionGroup,e.orderBy,r.getFilters(),e.limit,e.startAt,e.endAt)),this.Cn.set(e,t),t)}Nn(e,t,r,i,o,s,a){let c=(t!=null?t.length:1)*Math.max(r.length,o.length),l=c/(t!=null?t.length:1),d=[];for(let h=0;h<c;++h){let f=t?this.Bn(t[h/l]):YI,g=this.Ln(e,f,r[h%l],i),E=this.kn(e,f,o[h%l],s),v=a.map(S=>this.Ln(e,f,S,!0));d.push(...this.createRange(g,E,v))}return d}Ln(e,t,r,i){let o=new dl(e,Z.empty(),t,r);return i?o:o.En()}kn(e,t,r,i){let o=new dl(e,Z.empty(),t,r);return i?o.En():o}Mn(e,t){let r=new Ny(t),i=t.collectionGroup!=null?t.collectionGroup:t.path.lastSegment();return this.getFieldIndexes(e,i).next(o=>{let s=null;for(let a of o)r.pn(a)&&(!s||a.fields.length>s.fields.length)&&(s=a);return s})}getIndexType(e,t){let r=2,i=this.Fn(t);return L.forEach(i,o=>this.Mn(e,o).next(s=>{s?r!==0&&s.fields.length<(function(c){let l=new tt(Qt.comparator),d=!1;for(let h of c.filters)for(let f of h.getFlattenedFilters())f.field.isKeyField()||(f.op==="array-contains"||f.op==="array-contains-any"?d=!0:l=l.add(f.field));for(let h of c.orderBy)h.field.isKeyField()||(l=l.add(h.field));return l.size+(d?1:0)})(o)&&(r=1):r=0})).next(()=>(function(s){return s.limit!==null})(t)&&i.length>1&&r===2?1:r)}qn(e,t){let r=new ul;for(let i of sl(e)){let o=t.data.field(i.fieldPath);if(o==null)return null;let s=r.hn(i.kind);$o.Ut.bt(o,s)}return r.an()}Bn(e){let t=new ul;return $o.Ut.bt(e,t.hn(0)),t.an()}Qn(e,t){let r=new ul;return $o.Ut.bt(_l(this.databaseId,t),r.hn((function(o){let s=sl(o);return s.length===0?0:s[s.length-1].kind})(e))),r.an()}On(e,t,r){if(r===null)return[];let i=[];i.push(new ul);let o=0;for(let s of sl(e)){let a=r[o++];for(let c of i)if(this.$n(t,s.fieldPath)&&bg(a))i=this.Un(i,s,a);else{let l=c.hn(s.kind);$o.Ut.bt(a,l)}}return this.Kn(i)}xn(e,t,r){return this.On(e,t,r.position)}Kn(e){let t=[];for(let r=0;r<e.length;++r)t[r]=e[r].an();return t}Un(e,t,r){let i=[...e],o=[];for(let s of r.arrayValue.values||[])for(let a of i){let c=new ul;c.seed(a.an()),$o.Ut.bt(s,c.hn(t.kind)),o.push(c)}return o}$n(e,t){return!!e.filters.find(r=>r instanceof Le&&r.field.isEqual(t)&&(r.op==="in"||r.op==="not-in"))}getFieldIndexes(e,t){let r=sg(e),i=kd(e);return(t?r.j(Ab,IDBKeyRange.bound(t,t)):r.j()).next(o=>{let s=[];return L.forEach(o,a=>i.get([a.indexId,this.uid]).next(c=>{s.push((function(d,h){let f=h?new yg(h.sequenceNumber,new jr(Cl(h.readTime),new Z(eo(h.documentKey)),h.largestBatchId)):yg.empty(),g=d.fields.map(([E,v])=>new Hd(Qt.fromServerFormat(E),v));return new Yd(d.indexId,d.collectionGroup,g,f)})(a,c))})).next(()=>s)})}getNextCollectionGroupToUpdate(e){return this.getFieldIndexes(e).next(t=>t.length===0?null:(t.sort((r,i)=>{let o=r.indexState.sequenceNumber-i.indexState.sequenceNumber;return o!==0?o:Ie(r.collectionGroup,i.collectionGroup)}),t[0].collectionGroup))}updateCollectionGroup(e,t,r){let i=sg(e),o=kd(e);return this.Wn(e).next(s=>i.j(Ab,IDBKeyRange.bound(t,t)).next(a=>L.forEach(a,c=>o.put(t$(c.indexId,this.uid,s,r)))))}updateIndexEntries(e,t){let r=new Map;return L.forEach(t,(i,o)=>{let s=r.get(i.collectionGroup);return(s?L.resolve(s):this.getFieldIndexes(e,i.collectionGroup)).next(a=>(r.set(i.collectionGroup,a),L.forEach(a,c=>this.Gn(e,i,c).next(l=>{let d=this.zn(o,c);return l.isEqual(d)?L.resolve():this.jn(e,o,c,l,d)}))))})}Jn(e,t,r,i){return xd(e).put(i.An(this.uid,this.Qn(r,t.key),t.key))}Hn(e,t,r,i){return xd(e).delete(i.Rn(this.uid,this.Qn(r,t.key),t.key))}Gn(e,t,r){let i=xd(e),o=new tt(Qs);return i.X({index:Y$,range:IDBKeyRange.only([r.indexId,this.uid,oy(this.Qn(r,t))])},(s,a)=>{o=o.add(new dl(r.indexId,t,s$(a.arrayValue),s$(a.directionalValue)))}).next(()=>o)}zn(e,t){let r=new tt(Qs),i=this.qn(t,e);if(i==null)return r;let o=_b(t);if(o!=null){let s=e.data.field(o.fieldPath);if(bg(s))for(let a of s.arrayValue.values||[])r=r.add(new dl(t.indexId,e.key,this.Bn(a),i))}else r=r.add(new dl(t.indexId,e.key,YI,i));return r}jn(e,t,r,i,o){j(c$,"Updating index entries for document '%s'",t.key);let s=[];return(function(c,l,d,h,f){let g=c.getIterator(),E=l.getIterator(),v=Ld(g),S=Ld(E);for(;v||S;){let P=!1,V=!1;if(v&&S){let K=d(v,S);K<0?V=!0:K>0&&(P=!0)}else v!=null?V=!0:P=!0;P?(h(S),S=Ld(E)):V?(f(v),v=Ld(g)):(v=Ld(g),S=Ld(E))}})(i,o,Qs,a=>{s.push(this.Jn(e,t,r,a))},a=>{s.push(this.Hn(e,t,r,a))}),L.waitFor(s)}Wn(e){let t=1;return kd(e).X({index:K$,reverse:!0,range:IDBKeyRange.upperBound([this.uid,Number.MAX_SAFE_INTEGER])},(r,i,o)=>{o.done(),t=i.sequenceNumber+1}).next(()=>t)}createRange(e,t,r){r=r.sort((s,a)=>Qs(s,a)).filter((s,a,c)=>!a||Qs(s,c[a-1])!==0);let i=[];i.push(e);for(let s of r){let a=Qs(s,e),c=Qs(s,t);if(a===0)i[0]=e.En();else if(a>0&&c<0)i.push(s),i.push(s.En());else if(c>0)break}i.push(t);let o=[];for(let s=0;s<i.length;s+=2){if(this.Yn(i[s],i[s+1]))return[];let a=i[s].Rn(this.uid,YI,Z.empty()),c=i[s+1].Rn(this.uid,YI,Z.empty());o.push(IDBKeyRange.bound(a,c))}return o}Yn(e,t){return Qs(e,t)>0}getMinOffsetFromCollectionGroup(e,t){return this.getFieldIndexes(e,t).next(u$)}getMinOffset(e,t){return L.mapArray(this.Fn(t),r=>this.Mn(e,r).next(i=>i||re(44426))).next(u$)}};function l$(n){return en(n,Cg)}function xd(n){return en(n,pg)}function sg(n){return en(n,A0)}function kd(n){return en(n,fg)}function u$(n){ae(n.length!==0,28825);let e=n[0].indexState.offset,t=e.largestBatchId;for(let r=1;r<n.length;r++){let i=n[r].indexState.offset;y0(i,e)<0&&(e=i),t<i.largestBatchId&&(t=i.largestBatchId)}return new jr(e.readTime,e.documentKey,t)}var d$={didRun:!1,sequenceNumbersCollected:0,targetsRemoved:0,documentsRemoved:0},z3=41943040,tr=class n{static withCacheSize(e){return new n(e,n.DEFAULT_COLLECTION_PERCENTILE,n.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)}constructor(e,t,r){this.cacheSizeCollectionThreshold=e,this.percentileToCollect=t,this.maximumSequenceNumbersToCollect=r}};function q3(n,e,t){let r=n.store(di),i=n.store(Qd),o=[],s=IDBKeyRange.only(t.batchId),a=0,c=r.X({range:s},(d,h,f)=>(a++,f.delete()));o.push(c.next(()=>{ae(a===1,47070,{batchId:t.batchId})}));let l=[];for(let d of t.mutations){let h=W$(e,d.key.path,t.batchId);o.push(i.delete(h)),l.push(d.key)}return L.waitFor(o).next(()=>l)}function by(n){if(!n)return 0;let e;if(n.document)e=n.document;else if(n.unknownDocument)e=n.unknownDocument;else{if(!n.noDocument)throw re(14731);e=n.noDocument}return JSON.stringify(e).length}tr.DEFAULT_COLLECTION_PERCENTILE=10,tr.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,tr.DEFAULT=new tr(z3,tr.DEFAULT_COLLECTION_PERCENTILE,tr.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),tr.DISABLED=new tr(-1,0,0);var Oy=class n{constructor(e,t,r,i){this.userId=e,this.serializer=t,this.indexManager=r,this.referenceDelegate=i,this.Zn={}}static yt(e,t,r,i){ae(e.uid!=="",64387);let o=e.isAuthenticated()?e.uid:"";return new n(o,t,r,i)}checkEmpty(e){let t=!0,r=IDBKeyRange.bound([this.userId,Number.NEGATIVE_INFINITY],[this.userId,Number.POSITIVE_INFINITY]);return Js(e).X({index:hl,range:r},(i,o,s)=>{t=!1,s.done()}).next(()=>t)}addMutationBatch(e,t,r,i){let o=Gd(e),s=Js(e);return s.add({}).next(a=>{ae(typeof a=="number",49019);let c=new Mg(a,t,r,i),l=(function(g,E,v){let S=v.baseMutations.map(V=>Fg(g.gt,V)),P=v.mutations.map(V=>Fg(g.gt,V));return{userId:E,batchId:v.batchId,localWriteTimeMs:v.localWriteTime.toMillis(),baseMutations:S,mutations:P}})(this.serializer,this.userId,c),d=[],h=new tt((f,g)=>Ie(f.canonicalString(),g.canonicalString()));for(let f of i){let g=W$(this.userId,f.key.path,a);h=h.add(f.key.path.popLast()),d.push(s.put(l)),d.push(o.put(g,eoe))}return h.forEach(f=>{d.push(this.indexManager.addToCollectionParentIndex(e,f))}),e.addOnCommittedListener(()=>{this.Zn[a]=c.keys()}),L.waitFor(d).next(()=>c)})}lookupMutationBatch(e,t){return Js(e).get(t).next(r=>r?(ae(r.userId===this.userId,48,"Unexpected user for mutation batch",{userId:r.userId,batchId:t}),ll(this.serializer,r)):null)}Xn(e,t){return this.Zn[t]?L.resolve(this.Zn[t]):this.lookupMutationBatch(e,t).next(r=>{if(r){let i=r.keys();return this.Zn[t]=i,i}return null})}getNextMutationBatchAfterBatchId(e,t){let r=t+1,i=IDBKeyRange.lowerBound([this.userId,r]),o=null;return Js(e).X({index:hl,range:i},(s,a,c)=>{a.userId===this.userId&&(ae(a.batchId>=r,47524,{er:r}),o=ll(this.serializer,a)),c.done()}).next(()=>o)}getHighestUnacknowledgedBatchId(e){let t=IDBKeyRange.upperBound([this.userId,Number.POSITIVE_INFINITY]),r=gl;return Js(e).X({index:hl,range:t,reverse:!0},(i,o,s)=>{r=o.batchId,s.done()}).next(()=>r)}getAllMutationBatches(e){let t=IDBKeyRange.bound([this.userId,gl],[this.userId,Number.POSITIVE_INFINITY]);return Js(e).j(hl,t).next(r=>r.map(i=>ll(this.serializer,i)))}getAllMutationBatchesAffectingDocumentKey(e,t){let r=ZI(this.userId,t.path),i=IDBKeyRange.lowerBound(r),o=[];return Gd(e).X({range:i},(s,a,c)=>{let[l,d,h]=s,f=eo(d);if(l===this.userId&&t.path.isEqual(f))return Js(e).get(h).next(g=>{if(!g)throw re(61480,{tr:s,batchId:h});ae(g.userId===this.userId,10503,"Unexpected user for mutation batch",{userId:g.userId,batchId:h}),o.push(ll(this.serializer,g))});c.done()}).next(()=>o)}getAllMutationBatchesAffectingDocumentKeys(e,t){let r=new tt(Ie),i=[];return t.forEach(o=>{let s=ZI(this.userId,o.path),a=IDBKeyRange.lowerBound(s),c=Gd(e).X({range:a},(l,d,h)=>{let[f,g,E]=l,v=eo(g);f===this.userId&&o.path.isEqual(v)?r=r.add(E):h.done()});i.push(c)}),L.waitFor(i).next(()=>this.nr(e,r))}getAllMutationBatchesAffectingQuery(e,t){let r=t.path,i=r.length+1,o=ZI(this.userId,r),s=IDBKeyRange.lowerBound(o),a=new tt(Ie);return Gd(e).X({range:s},(c,l,d)=>{let[h,f,g]=c,E=eo(f);h===this.userId&&r.isPrefixOf(E)?E.length===i&&(a=a.add(g)):d.done()}).next(()=>this.nr(e,a))}nr(e,t){let r=[],i=[];return t.forEach(o=>{i.push(Js(e).get(o).next(s=>{if(s===null)throw re(35274,{batchId:o});ae(s.userId===this.userId,9748,"Unexpected user for mutation batch",{userId:s.userId,batchId:o}),r.push(ll(this.serializer,s))}))}),L.waitFor(i).next(()=>r)}removeMutationBatch(e,t){return q3(e.ce,this.userId,t).next(r=>(e.addOnCommittedListener(()=>{this.rr(t.batchId)}),L.forEach(r,i=>this.referenceDelegate.markPotentiallyOrphaned(e,i))))}rr(e){delete this.Zn[e]}performConsistencyCheck(e){return this.checkEmpty(e).next(t=>{if(!t)return L.resolve();let r=IDBKeyRange.lowerBound((function(s){return[s]})(this.userId)),i=[];return Gd(e).X({range:r},(o,s,a)=>{if(o[0]===this.userId){let c=eo(o[1]);i.push(c)}else a.done()}).next(()=>{ae(i.length===0,56720,{ir:i.map(o=>o.canonicalString())})})})}containsKey(e,t){return K3(e,this.userId,t)}sr(e){return Y3(e).get(this.userId).next(t=>t||{userId:this.userId,lastAcknowledgedBatchId:gl,lastStreamToken:""})}};function K3(n,e,t){let r=ZI(e,t.path),i=r[1],o=IDBKeyRange.lowerBound(r),s=!1;return Gd(n).X({range:o,Z:!0},(a,c,l)=>{let[d,h,f]=a;d===e&&h===i&&(s=!0),l.done()}).next(()=>s)}function Js(n){return en(n,di)}function Gd(n){return en(n,Qd)}function Y3(n){return en(n,Sg)}var lh=class n{constructor(e){this._r=e}next(){return this._r+=2,this._r}static ar(){return new n(0)}static ur(){return new n(-1)}};var cO=class{constructor(e,t){this.referenceDelegate=e,this.serializer=t}allocateTargetId(e){return this.cr(e).next(t=>{let r=new lh(t.highestTargetId);return t.highestTargetId=r.next(),this.lr(e,t).next(()=>t.highestTargetId)})}getLastRemoteSnapshotVersion(e){return this.cr(e).next(t=>le.fromTimestamp(new _t(t.lastRemoteSnapshotVersion.seconds,t.lastRemoteSnapshotVersion.nanoseconds)))}getHighestSequenceNumber(e){return this.cr(e).next(t=>t.highestListenSequenceNumber)}setTargetsMetadata(e,t,r){return this.cr(e).next(i=>(i.highestListenSequenceNumber=t,r&&(i.lastRemoteSnapshotVersion=r.toTimestamp()),t>i.highestListenSequenceNumber&&(i.highestListenSequenceNumber=t),this.lr(e,i)))}addTargetData(e,t){return this.hr(e,t).next(()=>this.cr(e).next(r=>(r.targetCount+=1,this.Pr(t,r),this.lr(e,r))))}updateTargetData(e,t){return this.hr(e,t)}removeTargetData(e,t){return this.removeMatchingKeysForTargetId(e,t.targetId).next(()=>Fd(e).delete(t.targetId)).next(()=>this.cr(e)).next(r=>(ae(r.targetCount>0,8065),r.targetCount-=1,this.lr(e,r)))}removeTargets(e,t,r){let i=0,o=[];return Fd(e).X((s,a)=>{let c=ug(a);c.sequenceNumber<=t&&r.get(c.targetId)===null&&(i++,o.push(this.removeTargetData(e,c)))}).next(()=>L.waitFor(o)).next(()=>i)}forEachTarget(e,t){return Fd(e).X((r,i)=>{let o=ug(i);t(o)})}cr(e){return h$(e).get(py).next(t=>(ae(t!==null,2888),t))}lr(e,t){return h$(e).put(py,t)}hr(e,t){return Fd(e).put(j3(this.serializer,t))}Pr(e,t){let r=!1;return e.targetId>t.highestTargetId&&(t.highestTargetId=e.targetId,r=!0),e.sequenceNumber>t.highestListenSequenceNumber&&(t.highestListenSequenceNumber=e.sequenceNumber,r=!0),r}getTargetCount(e){return this.cr(e).next(t=>t.targetCount)}getTargetData(e,t){let r=Il(t),i=IDBKeyRange.bound([r,Number.NEGATIVE_INFINITY],[r,Number.POSITIVE_INFINITY]),o=null;return Fd(e).X({range:i,index:q$},(s,a,c)=>{let l=ug(a);Qg(t,l.target)&&(o=l,c.done())}).next(()=>o)}addMatchingKeys(e,t,r){let i=[],o=ta(e);return t.forEach(s=>{let a=kn(s.path);i.push(o.put({targetId:r,path:a})),i.push(this.referenceDelegate.addReference(e,r,s))}),L.waitFor(i)}removeMatchingKeys(e,t,r){let i=ta(e);return L.forEach(t,o=>{let s=kn(o.path);return L.waitFor([i.delete([r,s]),this.referenceDelegate.removeReference(e,r,o)])})}removeMatchingKeysForTargetId(e,t){let r=ta(e),i=IDBKeyRange.bound([t],[t+1],!1,!0);return r.delete(i)}getMatchingKeysForTargetId(e,t){let r=IDBKeyRange.bound([t],[t+1],!1,!0),i=ta(e),o=be();return i.X({range:r,Z:!0},(s,a,c)=>{let l=eo(s[1]),d=new Z(l);o=o.add(d)}).next(()=>o)}containsKey(e,t){let r=kn(t.path),i=IDBKeyRange.bound([r],[U$(r)],!1,!0),o=0;return ta(e).X({index:S0,Z:!0,range:i},([s,a],c,l)=>{s!==0&&(o++,l.done())}).next(()=>o>0)}Et(e,t){return Fd(e).get(t).next(r=>r?ug(r):null)}};function Fd(n){return en(n,Jd)}function h$(n){return en(n,ml)}function ta(n){return en(n,Zd)}var f$="LruGarbageCollector",X3=1048576;function p$([n,e],[t,r]){let i=Ie(n,t);return i===0?Ie(e,r):i}var lO=class{constructor(e){this.Tr=e,this.buffer=new tt(p$),this.Ir=0}dr(){return++this.Ir}Er(e){let t=[e,this.dr()];if(this.buffer.size<this.Tr)this.buffer=this.buffer.add(t);else{let r=this.buffer.last();p$(t,r)<0&&(this.buffer=this.buffer.delete(r).add(t))}}get maxValue(){return this.buffer.last()[0]}},My=class{constructor(e,t,r){this.garbageCollector=e,this.asyncQueue=t,this.localStore=r,this.Ar=null}start(){this.garbageCollector.params.cacheSizeCollectionThreshold!==-1&&this.Rr(6e4)}stop(){this.Ar&&(this.Ar.cancel(),this.Ar=null)}get started(){return this.Ar!==null}Rr(e){j(f$,`Garbage collection scheduled in ${e}ms`),this.Ar=this.asyncQueue.enqueueAfterDelay("lru_garbage_collection",e,()=>I(this,null,function*(){this.Ar=null;try{yield this.localStore.collectGarbage(this.garbageCollector)}catch(t){Ea(t)?j(f$,"Ignoring IndexedDB error during garbage collection: ",t):yield ma(t)}yield this.Rr(3e5)}))}},uO=class{constructor(e,t){this.Vr=e,this.params=t}calculateTargetCount(e,t){return this.Vr.mr(e).next(r=>Math.floor(t/100*r))}nthSequenceNumber(e,t){if(t===0)return L.resolve(vr.ue);let r=new lO(t);return this.Vr.forEachTarget(e,i=>r.Er(i.sequenceNumber)).next(()=>this.Vr.gr(e,i=>r.Er(i))).next(()=>r.maxValue)}removeTargets(e,t,r){return this.Vr.removeTargets(e,t,r)}removeOrphanedDocuments(e,t){return this.Vr.removeOrphanedDocuments(e,t)}collect(e,t){return this.params.cacheSizeCollectionThreshold===-1?(j("LruGarbageCollector","Garbage collection skipped; disabled"),L.resolve(d$)):this.getCacheSize(e).next(r=>r<this.params.cacheSizeCollectionThreshold?(j("LruGarbageCollector",`Garbage collection skipped; Cache size ${r} is lower than threshold ${this.params.cacheSizeCollectionThreshold}`),d$):this.pr(e,t))}getCacheSize(e){return this.Vr.getCacheSize(e)}pr(e,t){let r,i,o,s,a,c,l,d=Date.now();return this.calculateTargetCount(e,this.params.percentileToCollect).next(h=>(h>this.params.maximumSequenceNumbersToCollect?(j("LruGarbageCollector",`Capping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${h}`),i=this.params.maximumSequenceNumbersToCollect):i=h,s=Date.now(),this.nthSequenceNumber(e,i))).next(h=>(r=h,a=Date.now(),this.removeTargets(e,r,t))).next(h=>(o=h,c=Date.now(),this.removeOrphanedDocuments(e,r))).next(h=>(l=Date.now(),Ud()<=Re.DEBUG&&j("LruGarbageCollector",`LRU Garbage Collection
|
|
165
|
+
Counted targets in ${s-d}ms
|
|
166
|
+
Determined least recently used ${i} in `+(a-s)+`ms
|
|
167
|
+
Removed ${o} targets in `+(c-a)+`ms
|
|
168
|
+
Removed ${h} documents in `+(l-c)+`ms
|
|
169
|
+
Total Duration: ${l-d}ms`),L.resolve({didRun:!0,sequenceNumbersCollected:i,targetsRemoved:o,documentsRemoved:h})))}};function Q3(n,e){return new uO(n,e)}var dO=class{constructor(e,t){this.db=e,this.garbageCollector=Q3(this,t)}mr(e){let t=this.yr(e);return this.db.getTargetCache().getTargetCount(e).next(r=>t.next(i=>r+i))}yr(e){let t=0;return this.gr(e,r=>{t++}).next(()=>t)}forEachTarget(e,t){return this.db.getTargetCache().forEachTarget(e,t)}gr(e,t){return this.wr(e,(r,i)=>t(i))}addReference(e,t,r){return XI(e,r)}removeReference(e,t,r){return XI(e,r)}removeTargets(e,t,r){return this.db.getTargetCache().removeTargets(e,t,r)}markPotentiallyOrphaned(e,t){return XI(e,t)}Sr(e,t){return(function(i,o){let s=!1;return Y3(i).ee(a=>K3(i,a,o).next(c=>(c&&(s=!0),L.resolve(!c)))).next(()=>s)})(e,t)}removeOrphanedDocuments(e,t){let r=this.db.getRemoteDocumentCache().newChangeBuffer(),i=[],o=0;return this.wr(e,(s,a)=>{if(a<=t){let c=this.Sr(e,s).next(l=>{if(!l)return o++,r.getEntry(e,s).next(()=>(r.removeEntry(s,le.min()),ta(e).delete((function(h){return[0,kn(h.path)]})(s))))});i.push(c)}}).next(()=>L.waitFor(i)).next(()=>r.apply(e)).next(()=>o)}removeTarget(e,t){let r=t.withSequenceNumber(e.currentSequenceNumber);return this.db.getTargetCache().updateTargetData(e,r)}updateLimboDocument(e,t){return XI(e,t)}wr(e,t){let r=ta(e),i,o=vr.ue;return r.X({index:S0},([s,a],{path:c,sequenceNumber:l})=>{s===0?(o!==vr.ue&&t(new Z(eo(i)),o),o=l,i=c):o=vr.ue}).next(()=>{o!==vr.ue&&t(new Z(eo(i)),o)})}getCacheSize(e){return this.db.getRemoteDocumentCache().getSize(e)}};function XI(n,e){return ta(n).put((function(r,i){return{targetId:0,path:kn(r.path),sequenceNumber:i}})(e,n.currentSequenceNumber))}var Ly=class{constructor(){this.changes=new hi(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,Jt.newInvalidDocument(e).setReadTime(t))}getEntry(e,t){this.assertNotApplied();let r=this.changes.get(t);return r!==void 0?L.resolve(r):this.getFromCache(e,t)}getEntries(e,t){return this.getAllFromCache(e,t)}apply(e){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(e)}assertNotApplied(){}};var hO=class{constructor(e){this.serializer=e}setIndexManager(e){this.indexManager=e}addEntry(e,t,r){return ol(e).put(r)}removeEntry(e,t,r){return ol(e).delete((function(o,s){let a=o.path.toArray();return[a.slice(0,a.length-2),a[a.length-2],Dy(s),a[a.length-1]]})(t,r))}updateMetadata(e,t){return this.getMetadata(e).next(r=>(r.byteSize+=t,this.br(e,r)))}getEntry(e,t){let r=Jt.newInvalidDocument(t);return ol(e).X({index:ey,range:IDBKeyRange.only(ag(t))},(i,o)=>{r=this.Dr(t,o)}).next(()=>r)}vr(e,t){let r={size:0,document:Jt.newInvalidDocument(t)};return ol(e).X({index:ey,range:IDBKeyRange.only(ag(t))},(i,o)=>{r={document:this.Dr(t,o),size:by(o)}}).next(()=>r)}getEntries(e,t){let r=Ar();return this.Cr(e,t,(i,o)=>{let s=this.Dr(i,o);r=r.insert(i,s)}).next(()=>r)}Fr(e,t){let r=Ar(),i=new ft(Z.comparator);return this.Cr(e,t,(o,s)=>{let a=this.Dr(o,s);r=r.insert(o,a),i=i.insert(o,by(s))}).next(()=>({documents:r,Mr:i}))}Cr(e,t,r){if(t.isEmpty())return L.resolve();let i=new tt(E$);t.forEach(c=>i=i.add(c));let o=IDBKeyRange.bound(ag(i.first()),ag(i.last())),s=i.getIterator(),a=s.getNext();return ol(e).X({index:ey,range:o},(c,l,d)=>{let h=Z.fromSegments([...l.prefixPath,l.collectionGroup,l.documentId]);for(;a&&E$(a,h)<0;)r(a,null),a=s.getNext();a&&a.isEqual(h)&&(r(a,l),a=s.hasNext()?s.getNext():null),a?d.G(ag(a)):d.done()}).next(()=>{for(;a;)r(a,null),a=s.hasNext()?s.getNext():null})}getDocumentsMatchingQuery(e,t,r,i,o){let s=t.path,a=[s.popLast().toArray(),s.lastSegment(),Dy(r.readTime),r.documentKey.path.isEmpty()?"":r.documentKey.path.lastSegment()],c=[s.popLast().toArray(),s.lastSegment(),[Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],""];return ol(e).j(IDBKeyRange.bound(a,c,!0)).next(l=>{o?.incrementDocumentReadCount(l.length);let d=Ar();for(let h of l){let f=this.Dr(Z.fromSegments(h.prefixPath.concat(h.collectionGroup,h.documentId)),h);f.isFoundDocument()&&(Zg(t,f)||i.has(f.key))&&(d=d.insert(f.key,f))}return d})}getAllFromCollectionGroup(e,t,r,i){let o=Ar(),s=m$(t,r),a=m$(t,jr.max());return ol(e).X({index:z$,range:IDBKeyRange.bound(s,a,!0)},(c,l,d)=>{let h=this.Dr(Z.fromSegments(l.prefixPath.concat(l.collectionGroup,l.documentId)),l);o=o.insert(h.key,h),o.size===i&&d.done()}).next(()=>o)}newChangeBuffer(e){return new fO(this,!!e&&e.trackRemovals)}getSize(e){return this.getMetadata(e).next(t=>t.byteSize)}getMetadata(e){return g$(e).get(Sb).next(t=>(ae(!!t,20021),t))}br(e,t){return g$(e).put(Sb,t)}Dr(e,t){if(t){let r=nse(this.serializer,t);if(!(r.isNoDocument()&&r.version.isEqual(le.min())))return r}return Jt.newInvalidDocument(e)}};function J3(n){return new hO(n)}var fO=class extends Ly{constructor(e,t){super(),this.Or=e,this.trackRemovals=t,this.Nr=new hi(r=>r.toString(),(r,i)=>r.isEqual(i))}applyChanges(e){let t=[],r=0,i=new tt((o,s)=>Ie(o.canonicalString(),s.canonicalString()));return this.changes.forEach((o,s)=>{let a=this.Nr.get(o);if(t.push(this.Or.removeEntry(e,o,a.readTime)),s.isValidDocument()){let c=ZH(this.Or.serializer,s);i=i.add(o.path.popLast());let l=by(c);r+=l-a.size,t.push(this.Or.addEntry(e,o,c))}else if(r-=a.size,this.trackRemovals){let c=ZH(this.Or.serializer,s.convertToNoDocument(le.min()));t.push(this.Or.addEntry(e,o,c))}}),i.forEach(o=>{t.push(this.Or.indexManager.addToCollectionParentIndex(e,o))}),t.push(this.Or.updateMetadata(e,r)),L.waitFor(t)}getFromCache(e,t){return this.Or.vr(e,t).next(r=>(this.Nr.set(t,{size:r.size,readTime:r.document.readTime}),r.document))}getAllFromCache(e,t){return this.Or.Fr(e,t).next(({documents:r,Mr:i})=>(i.forEach((o,s)=>{this.Nr.set(o,{size:s,readTime:r.get(o).readTime})}),r))}};function g$(n){return en(n,Ag)}function ol(n){return en(n,fy)}function ag(n){let e=n.path.toArray();return[e.slice(0,e.length-2),e[e.length-2],e[e.length-1]]}function m$(n,e){let t=e.documentKey.path.toArray();return[n,Dy(e.readTime),t.slice(0,t.length-2),t.length>0?t[t.length-1]:""]}function E$(n,e){let t=n.path.toArray(),r=e.path.toArray(),i=0;for(let o=0;o<t.length-2&&o<r.length-2;++o)if(i=Ie(t[o],r[o]),i)return i;return i=Ie(t.length,r.length),i||(i=Ie(t[t.length-2],r[r.length-2]),i||Ie(t[t.length-1],r[r.length-1]))}var pO=class{constructor(e,t){this.overlayedDocument=e,this.mutatedFields=t}};var Py=class{constructor(e,t,r,i){this.remoteDocumentCache=e,this.mutationQueue=t,this.documentOverlayCache=r,this.indexManager=i}getDocument(e,t){let r=null;return this.documentOverlayCache.getOverlay(e,t).next(i=>(r=i,this.remoteDocumentCache.getEntry(e,t))).next(i=>(r!==null&&Eg(r.mutation,i,Sr.empty(),_t.now()),i))}getDocuments(e,t){return this.remoteDocumentCache.getEntries(e,t).next(r=>this.getLocalViewOfDocuments(e,r,be()).next(()=>r))}getLocalViewOfDocuments(e,t,r=be()){let i=to();return this.populateOverlays(e,i,t).next(()=>this.computeViews(e,t,i,r).next(o=>{let s=lg();return o.forEach((a,c)=>{s=s.insert(a,c.overlayedDocument)}),s}))}getOverlayedDocuments(e,t){let r=to();return this.populateOverlays(e,r,t).next(()=>this.computeViews(e,t,r,be()))}populateOverlays(e,t,r){let i=[];return r.forEach(o=>{t.has(o)||i.push(o)}),this.documentOverlayCache.getOverlays(e,i).next(o=>{o.forEach((s,a)=>{t.set(s,a)})})}computeViews(e,t,r,i){let o=Ar(),s=mg(),a=(function(){return mg()})();return t.forEach((c,l)=>{let d=r.get(l.key);i.has(l.key)&&(d===void 0||d.mutation instanceof fi)?o=o.insert(l.key,l):d!==void 0?(s.set(l.key,d.mutation.getFieldMask()),Eg(d.mutation,l,d.mutation.getFieldMask(),_t.now())):s.set(l.key,Sr.empty())}),this.recalculateAndSaveOverlays(e,o).next(c=>(c.forEach((l,d)=>s.set(l,d)),t.forEach((l,d)=>{var h;return a.set(l,new pO(d,(h=s.get(l))!==null&&h!==void 0?h:null))}),a))}recalculateAndSaveOverlays(e,t){let r=mg(),i=new ft((s,a)=>s-a),o=be();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,t).next(s=>{for(let a of s)a.keys().forEach(c=>{let l=t.get(c);if(l===null)return;let d=r.get(c)||Sr.empty();d=a.applyToLocalView(l,d),r.set(c,d);let h=(i.get(a.batchId)||be()).add(c);i=i.insert(a.batchId,h)})}).next(()=>{let s=[],a=i.getReverseIterator();for(;a.hasNext();){let c=a.getNext(),l=c.key,d=c.value,h=v3();d.forEach(f=>{if(!o.has(f)){let g=N3(t.get(f),r.get(f));g!==null&&h.set(f,g),o=o.add(f)}}),s.push(this.documentOverlayCache.saveOverlays(e,l,h))}return L.waitFor(s)}).next(()=>r)}recalculateAndSaveOverlaysForDocumentKeys(e,t){return this.remoteDocumentCache.getEntries(e,t).next(r=>this.recalculateAndSaveOverlays(e,r))}getDocumentsMatchingQuery(e,t,r,i){return(function(s){return Z.isDocumentKey(s.path)&&s.collectionGroup===null&&s.filters.length===0})(t)?this.getDocumentsMatchingDocumentQuery(e,t.path):b0(t)?this.getDocumentsMatchingCollectionGroupQuery(e,t,r,i):this.getDocumentsMatchingCollectionQuery(e,t,r,i)}getNextDocuments(e,t,r,i){return this.remoteDocumentCache.getAllFromCollectionGroup(e,t,r,i).next(o=>{let s=i-o.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(e,t,r.largestBatchId,i-o.size):L.resolve(to()),a=Kd,c=o;return s.next(l=>L.forEach(l,(d,h)=>(a<h.largestBatchId&&(a=h.largestBatchId),o.get(d)?L.resolve():this.remoteDocumentCache.getEntry(e,d).next(f=>{c=c.insert(d,f)}))).next(()=>this.populateOverlays(e,l,o)).next(()=>this.computeViews(e,c,l,be())).next(d=>({batchId:a,changes:y3(d)})))})}getDocumentsMatchingDocumentQuery(e,t){return this.getDocument(e,new Z(t)).next(r=>{let i=lg();return r.isFoundDocument()&&(i=i.insert(r.key,r)),i})}getDocumentsMatchingCollectionGroupQuery(e,t,r,i){let o=t.collectionGroup,s=lg();return this.indexManager.getCollectionParents(e,o).next(a=>L.forEach(a,c=>{let l=(function(h,f){return new oo(f,null,h.explicitOrderBy.slice(),h.filters.slice(),h.limit,h.limitType,h.startAt,h.endAt)})(t,c.child(o));return this.getDocumentsMatchingCollectionQuery(e,l,r,i).next(d=>{d.forEach((h,f)=>{s=s.insert(h,f)})})}).next(()=>s))}getDocumentsMatchingCollectionQuery(e,t,r,i){let o;return this.documentOverlayCache.getOverlaysForCollection(e,t.path,r.largestBatchId).next(s=>(o=s,this.remoteDocumentCache.getDocumentsMatchingQuery(e,t,r,o,i))).next(s=>{o.forEach((c,l)=>{let d=l.getKey();s.get(d)===null&&(s=s.insert(d,Jt.newInvalidDocument(d)))});let a=lg();return s.forEach((c,l)=>{let d=o.get(c);d!==void 0&&Eg(d.mutation,l,Sr.empty(),_t.now()),Zg(t,l)&&(a=a.insert(c,l))}),a})}};var gO=class{constructor(e){this.serializer=e,this.Br=new Map,this.Lr=new Map}getBundleMetadata(e,t){return L.resolve(this.Br.get(t))}saveBundleMetadata(e,t){return this.Br.set(t.id,(function(i){return{id:i.id,version:i.version,createTime:dn(i.createTime)}})(t)),L.resolve()}getNamedQuery(e,t){return L.resolve(this.Lr.get(t))}saveNamedQuery(e,t){return this.Lr.set(t.name,(function(i){return{name:i.name,query:H3(i.bundledQuery),readTime:dn(i.readTime)}})(t)),L.resolve()}};var mO=class{constructor(){this.overlays=new ft(Z.comparator),this.kr=new Map}getOverlay(e,t){return L.resolve(this.overlays.get(t))}getOverlays(e,t){let r=to();return L.forEach(t,i=>this.getOverlay(e,i).next(o=>{o!==null&&r.set(i,o)})).next(()=>r)}saveOverlays(e,t,r){return r.forEach((i,o)=>{this.wt(e,t,o)}),L.resolve()}removeOverlaysForBatchId(e,t,r){let i=this.kr.get(r);return i!==void 0&&(i.forEach(o=>this.overlays=this.overlays.remove(o)),this.kr.delete(r)),L.resolve()}getOverlaysForCollection(e,t,r){let i=to(),o=t.length+1,s=new Z(t.child("")),a=this.overlays.getIteratorFrom(s);for(;a.hasNext();){let c=a.getNext().value,l=c.getKey();if(!t.isPrefixOf(l.path))break;l.path.length===o&&c.largestBatchId>r&&i.set(c.getKey(),c)}return L.resolve(i)}getOverlaysForCollectionGroup(e,t,r,i){let o=new ft((l,d)=>l-d),s=this.overlays.getIterator();for(;s.hasNext();){let l=s.getNext().value;if(l.getKey().getCollectionGroup()===t&&l.largestBatchId>r){let d=o.get(l.largestBatchId);d===null&&(d=to(),o=o.insert(l.largestBatchId,d)),d.set(l.getKey(),l)}}let a=to(),c=o.getIterator();for(;c.hasNext()&&(c.getNext().value.forEach((l,d)=>a.set(l,d)),!(a.size()>=i)););return L.resolve(a)}wt(e,t,r){let i=this.overlays.get(r.key);if(i!==null){let s=this.kr.get(i.largestBatchId).delete(r.key);this.kr.set(i.largestBatchId,s)}this.overlays=this.overlays.insert(r.key,new Lg(t,r));let o=this.kr.get(t);o===void 0&&(o=be(),this.kr.set(t,o)),this.kr.set(t,o.add(r.key))}};var EO=class{constructor(){this.sessionToken=Gt.EMPTY_BYTE_STRING}getSessionToken(e){return L.resolve(this.sessionToken)}setSessionToken(e,t){return this.sessionToken=t,L.resolve()}};var Vg=class{constructor(){this.qr=new tt(Ut.Qr),this.$r=new tt(Ut.Ur)}isEmpty(){return this.qr.isEmpty()}addReference(e,t){let r=new Ut(e,t);this.qr=this.qr.add(r),this.$r=this.$r.add(r)}Kr(e,t){e.forEach(r=>this.addReference(r,t))}removeReference(e,t){this.Wr(new Ut(e,t))}Gr(e,t){e.forEach(r=>this.removeReference(r,t))}zr(e){let t=new Z(new ke([])),r=new Ut(t,e),i=new Ut(t,e+1),o=[];return this.$r.forEachInRange([r,i],s=>{this.Wr(s),o.push(s.key)}),o}jr(){this.qr.forEach(e=>this.Wr(e))}Wr(e){this.qr=this.qr.delete(e),this.$r=this.$r.delete(e)}Jr(e){let t=new Z(new ke([])),r=new Ut(t,e),i=new Ut(t,e+1),o=be();return this.$r.forEachInRange([r,i],s=>{o=o.add(s.key)}),o}containsKey(e){let t=new Ut(e,0),r=this.qr.firstAfterOrEqual(t);return r!==null&&e.isEqual(r.key)}},Ut=class{constructor(e,t){this.key=e,this.Hr=t}static Qr(e,t){return Z.comparator(e.key,t.key)||Ie(e.Hr,t.Hr)}static Ur(e,t){return Ie(e.Hr,t.Hr)||Z.comparator(e.key,t.key)}};var _O=class{constructor(e,t){this.indexManager=e,this.referenceDelegate=t,this.mutationQueue=[],this.er=1,this.Yr=new tt(Ut.Qr)}checkEmpty(e){return L.resolve(this.mutationQueue.length===0)}addMutationBatch(e,t,r,i){let o=this.er;this.er++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];let s=new Mg(o,t,r,i);this.mutationQueue.push(s);for(let a of i)this.Yr=this.Yr.add(new Ut(a.key,o)),this.indexManager.addToCollectionParentIndex(e,a.key.path.popLast());return L.resolve(s)}lookupMutationBatch(e,t){return L.resolve(this.Zr(t))}getNextMutationBatchAfterBatchId(e,t){let r=t+1,i=this.Xr(r),o=i<0?0:i;return L.resolve(this.mutationQueue.length>o?this.mutationQueue[o]:null)}getHighestUnacknowledgedBatchId(){return L.resolve(this.mutationQueue.length===0?gl:this.er-1)}getAllMutationBatches(e){return L.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(e,t){let r=new Ut(t,0),i=new Ut(t,Number.POSITIVE_INFINITY),o=[];return this.Yr.forEachInRange([r,i],s=>{let a=this.Zr(s.Hr);o.push(a)}),L.resolve(o)}getAllMutationBatchesAffectingDocumentKeys(e,t){let r=new tt(Ie);return t.forEach(i=>{let o=new Ut(i,0),s=new Ut(i,Number.POSITIVE_INFINITY);this.Yr.forEachInRange([o,s],a=>{r=r.add(a.Hr)})}),L.resolve(this.ei(r))}getAllMutationBatchesAffectingQuery(e,t){let r=t.path,i=r.length+1,o=r;Z.isDocumentKey(o)||(o=o.child(""));let s=new Ut(new Z(o),0),a=new tt(Ie);return this.Yr.forEachWhile(c=>{let l=c.key.path;return!!r.isPrefixOf(l)&&(l.length===i&&(a=a.add(c.Hr)),!0)},s),L.resolve(this.ei(a))}ei(e){let t=[];return e.forEach(r=>{let i=this.Zr(r);i!==null&&t.push(i)}),t}removeMutationBatch(e,t){ae(this.ti(t.batchId,"removed")===0,55003),this.mutationQueue.shift();let r=this.Yr;return L.forEach(t.mutations,i=>{let o=new Ut(i.key,t.batchId);return r=r.delete(o),this.referenceDelegate.markPotentiallyOrphaned(e,i.key)}).next(()=>{this.Yr=r})}rr(e){}containsKey(e,t){let r=new Ut(t,0),i=this.Yr.firstAfterOrEqual(r);return L.resolve(t.isEqual(i&&i.key))}performConsistencyCheck(e){return this.mutationQueue.length,L.resolve()}ti(e,t){return this.Xr(e)}Xr(e){return this.mutationQueue.length===0?0:e-this.mutationQueue[0].batchId}Zr(e){let t=this.Xr(e);return t<0||t>=this.mutationQueue.length?null:this.mutationQueue[t]}};var TO=class{constructor(e){this.ni=e,this.docs=(function(){return new ft(Z.comparator)})(),this.size=0}setIndexManager(e){this.indexManager=e}addEntry(e,t){let r=t.key,i=this.docs.get(r),o=i?i.size:0,s=this.ni(t);return this.docs=this.docs.insert(r,{document:t.mutableCopy(),size:s}),this.size+=s-o,this.indexManager.addToCollectionParentIndex(e,r.path.popLast())}removeEntry(e){let t=this.docs.get(e);t&&(this.docs=this.docs.remove(e),this.size-=t.size)}getEntry(e,t){let r=this.docs.get(t);return L.resolve(r?r.document.mutableCopy():Jt.newInvalidDocument(t))}getEntries(e,t){let r=Ar();return t.forEach(i=>{let o=this.docs.get(i);r=r.insert(i,o?o.document.mutableCopy():Jt.newInvalidDocument(i))}),L.resolve(r)}getDocumentsMatchingQuery(e,t,r,i){let o=Ar(),s=t.path,a=new Z(s.child("__id-9223372036854775808__")),c=this.docs.getIteratorFrom(a);for(;c.hasNext();){let{key:l,value:{document:d}}=c.getNext();if(!s.isPrefixOf(l.path))break;l.path.length>s.length+1||y0(G$(d),r)<=0||(i.has(d.key)||Zg(t,d))&&(o=o.insert(d.key,d.mutableCopy()))}return L.resolve(o)}getAllFromCollectionGroup(e,t,r,i){re(9500)}ri(e,t){return L.forEach(this.docs,r=>t(r))}newChangeBuffer(e){return new IO(this)}getSize(e){return L.resolve(this.size)}},IO=class extends Ly{constructor(e){super(),this.Or=e}applyChanges(e){let t=[];return this.changes.forEach((r,i)=>{i.isValidDocument()?t.push(this.Or.addEntry(e,i)):this.Or.removeEntry(r)}),L.waitFor(t)}getFromCache(e,t){return this.Or.getEntry(e,t)}getAllFromCache(e,t){return this.Or.getEntries(e,t)}};var yO=class{constructor(e){this.persistence=e,this.ii=new hi(t=>Il(t),Qg),this.lastRemoteSnapshotVersion=le.min(),this.highestTargetId=0,this.si=0,this.oi=new Vg,this.targetCount=0,this._i=lh.ar()}forEachTarget(e,t){return this.ii.forEach((r,i)=>t(i)),L.resolve()}getLastRemoteSnapshotVersion(e){return L.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(e){return L.resolve(this.si)}allocateTargetId(e){return this.highestTargetId=this._i.next(),L.resolve(this.highestTargetId)}setTargetsMetadata(e,t,r){return r&&(this.lastRemoteSnapshotVersion=r),t>this.si&&(this.si=t),L.resolve()}hr(e){this.ii.set(e.target,e);let t=e.targetId;t>this.highestTargetId&&(this._i=new lh(t),this.highestTargetId=t),e.sequenceNumber>this.si&&(this.si=e.sequenceNumber)}addTargetData(e,t){return this.hr(t),this.targetCount+=1,L.resolve()}updateTargetData(e,t){return this.hr(t),L.resolve()}removeTargetData(e,t){return this.ii.delete(t.target),this.oi.zr(t.targetId),this.targetCount-=1,L.resolve()}removeTargets(e,t,r){let i=0,o=[];return this.ii.forEach((s,a)=>{a.sequenceNumber<=t&&r.get(a.targetId)===null&&(this.ii.delete(s),o.push(this.removeMatchingKeysForTargetId(e,a.targetId)),i++)}),L.waitFor(o).next(()=>i)}getTargetCount(e){return L.resolve(this.targetCount)}getTargetData(e,t){let r=this.ii.get(t)||null;return L.resolve(r)}addMatchingKeys(e,t,r){return this.oi.Kr(t,r),L.resolve()}removeMatchingKeys(e,t,r){this.oi.Gr(t,r);let i=this.persistence.referenceDelegate,o=[];return i&&t.forEach(s=>{o.push(i.markPotentiallyOrphaned(e,s))}),L.waitFor(o)}removeMatchingKeysForTargetId(e,t){return this.oi.zr(t),L.resolve()}getMatchingKeysForTargetId(e,t){let r=this.oi.Jr(t);return L.resolve(r)}containsKey(e,t){return L.resolve(this.oi.containsKey(t))}};var Bg=class{constructor(e,t){this.ai={},this.overlays={},this.ui=new vr(0),this.ci=!1,this.ci=!0,this.li=new EO,this.referenceDelegate=e(this),this.hi=new yO(this),this.indexManager=new sO,this.remoteDocumentCache=(function(i){return new TO(i)})(r=>this.referenceDelegate.Pi(r)),this.serializer=new Cy(t),this.Ti=new gO(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.ci=!1,Promise.resolve()}get started(){return this.ci}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(e){return this.indexManager}getDocumentOverlayCache(e){let t=this.overlays[e.toKey()];return t||(t=new mO,this.overlays[e.toKey()]=t),t}getMutationQueue(e,t){let r=this.ai[e.toKey()];return r||(r=new _O(t,this.referenceDelegate),this.ai[e.toKey()]=r),r}getGlobalsCache(){return this.li}getTargetCache(){return this.hi}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.Ti}runTransaction(e,t,r){j("MemoryPersistence","Starting transaction:",e);let i=new vO(this.ui.next());return this.referenceDelegate.Ii(),r(i).next(o=>this.referenceDelegate.di(i).next(()=>o)).toPromise().then(o=>(i.raiseOnCommittedEvent(),o))}Ei(e,t){return L.or(Object.values(this.ai).map(r=>()=>r.containsKey(e,t)))}},vO=class extends uy{constructor(e){super(),this.currentSequenceNumber=e}},xy=class n{constructor(e){this.persistence=e,this.Ai=new Vg,this.Ri=null}static Vi(e){return new n(e)}get mi(){if(this.Ri)return this.Ri;throw re(60996)}addReference(e,t,r){return this.Ai.addReference(r,t),this.mi.delete(r.toString()),L.resolve()}removeReference(e,t,r){return this.Ai.removeReference(r,t),this.mi.add(r.toString()),L.resolve()}markPotentiallyOrphaned(e,t){return this.mi.add(t.toString()),L.resolve()}removeTarget(e,t){this.Ai.zr(t.targetId).forEach(i=>this.mi.add(i.toString()));let r=this.persistence.getTargetCache();return r.getMatchingKeysForTargetId(e,t.targetId).next(i=>{i.forEach(o=>this.mi.add(o.toString()))}).next(()=>r.removeTargetData(e,t))}Ii(){this.Ri=new Set}di(e){let t=this.persistence.getRemoteDocumentCache().newChangeBuffer();return L.forEach(this.mi,r=>{let i=Z.fromPath(r);return this.fi(e,i).next(o=>{o||t.removeEntry(i,le.min())})}).next(()=>(this.Ri=null,t.apply(e)))}updateLimboDocument(e,t){return this.fi(e,t).next(r=>{r?this.mi.delete(t.toString()):this.mi.add(t.toString())})}Pi(e){return 0}fi(e,t){return L.or([()=>L.resolve(this.Ai.containsKey(t)),()=>this.persistence.getTargetCache().containsKey(e,t),()=>this.persistence.Ei(e,t)])}},ky=class n{constructor(e,t){this.persistence=e,this.gi=new hi(r=>kn(r.path),(r,i)=>r.isEqual(i)),this.garbageCollector=Q3(this,t)}static Vi(e,t){return new n(e,t)}Ii(){}di(e){return L.resolve()}forEachTarget(e,t){return this.persistence.getTargetCache().forEachTarget(e,t)}mr(e){let t=this.yr(e);return this.persistence.getTargetCache().getTargetCount(e).next(r=>t.next(i=>r+i))}yr(e){let t=0;return this.gr(e,r=>{t++}).next(()=>t)}gr(e,t){return L.forEach(this.gi,(r,i)=>this.Sr(e,r,i).next(o=>o?L.resolve():t(i)))}removeTargets(e,t,r){return this.persistence.getTargetCache().removeTargets(e,t,r)}removeOrphanedDocuments(e,t){let r=0,i=this.persistence.getRemoteDocumentCache(),o=i.newChangeBuffer();return i.ri(e,s=>this.Sr(e,s,t).next(a=>{a||(r++,o.removeEntry(s,le.min()))})).next(()=>o.apply(e)).next(()=>r)}markPotentiallyOrphaned(e,t){return this.gi.set(t,e.currentSequenceNumber),L.resolve()}removeTarget(e,t){let r=t.withSequenceNumber(e.currentSequenceNumber);return this.persistence.getTargetCache().updateTargetData(e,r)}addReference(e,t,r){return this.gi.set(r,e.currentSequenceNumber),L.resolve()}removeReference(e,t,r){return this.gi.set(r,e.currentSequenceNumber),L.resolve()}updateLimboDocument(e,t){return this.gi.set(t,e.currentSequenceNumber),L.resolve()}Pi(e){let t=e.key.toString().length;return e.isFoundDocument()&&(t+=ny(e.data.value)),t}Sr(e,t,r){return L.or([()=>this.persistence.Ei(e,t),()=>this.persistence.getTargetCache().containsKey(e,t),()=>{let i=this.gi.get(t);return L.resolve(i!==void 0&&i>r)}])}getCacheSize(e){return this.persistence.getRemoteDocumentCache().getSize(e)}};var SO=class{constructor(e){this.serializer=e}q(e,t,r,i){let o=new dy("createOrUpgrade",t);r<1&&i>=1&&((function(c){c.createObjectStore(Xg)})(e),(function(c){c.createObjectStore(Sg,{keyPath:Zie}),c.createObjectStore(di,{keyPath:bH,autoIncrement:!0}).createIndex(hl,OH,{unique:!0}),c.createObjectStore(Qd)})(e),_$(e),(function(c){c.createObjectStore(al)})(e));let s=L.resolve();return r<3&&i>=3&&(r!==0&&((function(c){c.deleteObjectStore(Zd),c.deleteObjectStore(Jd),c.deleteObjectStore(ml)})(e),_$(e)),s=s.next(()=>(function(c){let l=c.store(ml),d={highestTargetId:0,highestListenSequenceNumber:0,lastRemoteSnapshotVersion:le.min().toTimestamp(),targetCount:0};return l.put(py,d)})(o))),r<4&&i>=4&&(r!==0&&(s=s.next(()=>(function(c,l){return l.store(di).j().next(h=>{c.deleteObjectStore(di),c.createObjectStore(di,{keyPath:bH,autoIncrement:!0}).createIndex(hl,OH,{unique:!0});let f=l.store(di),g=h.map(E=>f.put(E));return L.waitFor(g)})})(e,o))),s=s.next(()=>{(function(c){c.createObjectStore(eh,{keyPath:coe})})(e)})),r<5&&i>=5&&(s=s.next(()=>this.pi(o))),r<6&&i>=6&&(s=s.next(()=>((function(c){c.createObjectStore(Ag)})(e),this.yi(o)))),r<7&&i>=7&&(s=s.next(()=>this.wi(o))),r<8&&i>=8&&(s=s.next(()=>this.Si(e,o))),r<9&&i>=9&&(s=s.next(()=>{(function(c){c.objectStoreNames.contains("remoteDocumentChanges")&&c.deleteObjectStore("remoteDocumentChanges")})(e)})),r<10&&i>=10&&(s=s.next(()=>this.bi(o))),r<11&&i>=11&&(s=s.next(()=>{(function(c){c.createObjectStore(iv,{keyPath:loe})})(e),(function(c){c.createObjectStore(ov,{keyPath:uoe})})(e)})),r<12&&i>=12&&(s=s.next(()=>{(function(c){let l=c.createObjectStore(sv,{keyPath:Eoe});l.createIndex(Cb,_oe,{unique:!1}),l.createIndex(X$,Toe,{unique:!1})})(e)})),r<13&&i>=13&&(s=s.next(()=>(function(c){let l=c.createObjectStore(fy,{keyPath:toe});l.createIndex(ey,noe),l.createIndex(z$,roe)})(e)).next(()=>this.Di(e,o)).next(()=>e.deleteObjectStore(al))),r<14&&i>=14&&(s=s.next(()=>this.Ci(e,o))),r<15&&i>=15&&(s=s.next(()=>(function(c){c.createObjectStore(A0,{keyPath:doe,autoIncrement:!0}).createIndex(Ab,hoe,{unique:!1}),c.createObjectStore(fg,{keyPath:foe}).createIndex(K$,poe,{unique:!1}),c.createObjectStore(pg,{keyPath:goe}).createIndex(Y$,moe,{unique:!1})})(e))),r<16&&i>=16&&(s=s.next(()=>{t.objectStore(fg).clear()}).next(()=>{t.objectStore(pg).clear()})),r<17&&i>=17&&(s=s.next(()=>{(function(c){c.createObjectStore(C0,{keyPath:Ioe})})(e)})),r<18&&i>=18&&rR()&&(s=s.next(()=>{t.objectStore(fg).clear()}).next(()=>{t.objectStore(pg).clear()})),s}yi(e){let t=0;return e.store(al).X((r,i)=>{t+=by(i)}).next(()=>{let r={byteSize:t};return e.store(Ag).put(Sb,r)})}pi(e){let t=e.store(Sg),r=e.store(di);return t.j().next(i=>L.forEach(i,o=>{let s=IDBKeyRange.bound([o.userId,gl],[o.userId,o.lastAcknowledgedBatchId]);return r.j(hl,s).next(a=>L.forEach(a,c=>{ae(c.userId===o.userId,18650,"Cannot process batch from unexpected user",{batchId:c.batchId});let l=ll(this.serializer,c);return q3(e,o.userId,l).next(()=>{})}))}))}wi(e){let t=e.store(Zd),r=e.store(al);return e.store(ml).get(py).next(i=>{let o=[];return r.X((s,a)=>{let c=new ke(s),l=(function(h){return[0,kn(h)]})(c);o.push(t.get(l).next(d=>d?L.resolve():(h=>t.put({targetId:0,path:kn(h),sequenceNumber:i.highestListenSequenceNumber}))(c)))}).next(()=>L.waitFor(o))})}Si(e,t){e.createObjectStore(Cg,{keyPath:aoe});let r=t.store(Cg),i=new Ug,o=s=>{if(i.add(s)){let a=s.lastSegment(),c=s.popLast();return r.put({collectionId:a,parent:kn(c)})}};return t.store(al).X({Z:!0},(s,a)=>{let c=new ke(s);return o(c.popLast())}).next(()=>t.store(Qd).X({Z:!0},([s,a,c],l)=>{let d=eo(a);return o(d.popLast())}))}bi(e){let t=e.store(Jd);return t.X((r,i)=>{let o=ug(i),s=j3(this.serializer,o);return t.put(s)})}Di(e,t){let r=t.store(al),i=[];return r.X((o,s)=>{let a=t.store(fy),c=(function(h){return h.document?new Z(ke.fromString(h.document.name).popFirst(5)):h.noDocument?Z.fromSegments(h.noDocument.path):h.unknownDocument?Z.fromSegments(h.unknownDocument.path):re(36783)})(s).path.toArray(),l={prefixPath:c.slice(0,c.length-2),collectionGroup:c[c.length-2],documentId:c[c.length-1],readTime:s.readTime||[0,0],unknownDocument:s.unknownDocument,noDocument:s.noDocument,document:s.document,hasCommittedMutations:!!s.hasCommittedMutations};i.push(a.put(l))}).next(()=>L.waitFor(i))}Ci(e,t){let r=t.store(di),i=J3(this.serializer),o=new Bg(xy.Vi,this.serializer.gt);return r.j().next(s=>{let a=new Map;return s.forEach(c=>{var l;let d=(l=a.get(c.userId))!==null&&l!==void 0?l:be();ll(this.serializer,c).keys().forEach(h=>d=d.add(h)),a.set(c.userId,d)}),L.forEach(a,(c,l)=>{let d=new Vt(l),h=Ry.yt(this.serializer,d),f=o.getIndexManager(d),g=Oy.yt(d,this.serializer,f,o.referenceDelegate);return new Py(i,g,h,f).recalculateAndSaveOverlaysForDocumentKeys(new Dg(t,vr.ue),c).next()})})}};function _$(n){n.createObjectStore(Zd,{keyPath:ooe}).createIndex(S0,soe,{unique:!0}),n.createObjectStore(Jd,{keyPath:"targetId"}).createIndex(q$,ioe,{unique:!0}),n.createObjectStore(ml)}var Zs="IndexedDbPersistence",ob=18e5,sb=5e3,ab="Failed to obtain exclusive access to the persistence layer. To allow shared access, multi-tab synchronization has to be enabled in all tabs. If you are using `experimentalForceOwningTab:true`, make sure that only one tab has persistence enabled at any given time.",ose="main",AO=class n{constructor(e,t,r,i,o,s,a,c,l,d,h=18){if(this.allowTabSynchronization=e,this.persistenceKey=t,this.clientId=r,this.Fi=o,this.window=s,this.document=a,this.Mi=l,this.xi=d,this.Oi=h,this.ui=null,this.ci=!1,this.isPrimary=!1,this.networkEnabled=!0,this.Ni=null,this.inForeground=!1,this.Bi=null,this.Li=null,this.ki=Number.NEGATIVE_INFINITY,this.qi=f=>Promise.resolve(),!n.C())throw new G(x.UNIMPLEMENTED,"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");this.referenceDelegate=new dO(this,i),this.Qi=t+ose,this.serializer=new Cy(c),this.$i=new Xd(this.Qi,this.Oi,new SO(this.serializer)),this.li=new Zb,this.hi=new cO(this.referenceDelegate,this.serializer),this.remoteDocumentCache=J3(this.serializer),this.Ti=new Jb,this.window&&this.window.localStorage?this.Ui=this.window.localStorage:(this.Ui=null,d===!1&&Mt(Zs,"LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page."))}start(){return this.Ki().then(()=>{if(!this.isPrimary&&!this.allowTabSynchronization)throw new G(x.FAILED_PRECONDITION,ab);return this.Wi(),this.Gi(),this.zi(),this.runTransaction("getHighestListenSequenceNumber","readonly",e=>this.hi.getHighestSequenceNumber(e))}).then(e=>{this.ui=new vr(e,this.Mi)}).then(()=>{this.ci=!0}).catch(e=>(this.$i&&this.$i.close(),Promise.reject(e)))}ji(e){return this.qi=t=>I(this,null,function*(){if(this.started)return e(t)}),e(this.isPrimary)}setDatabaseDeletedListener(e){this.$i.setDatabaseDeletedListener(e)}setNetworkEnabled(e){this.networkEnabled!==e&&(this.networkEnabled=e,this.Fi.enqueueAndForget(()=>I(this,null,function*(){this.started&&(yield this.Ki())})))}Ki(){return this.runTransaction("updateClientMetadataAndTryBecomePrimary","readwrite",e=>QI(e).put({clientId:this.clientId,updateTimeMs:Date.now(),networkEnabled:this.networkEnabled,inForeground:this.inForeground}).next(()=>{if(this.isPrimary)return this.Ji(e).next(t=>{t||(this.isPrimary=!1,this.Fi.enqueueRetryable(()=>this.qi(!1)))})}).next(()=>this.Hi(e)).next(t=>this.isPrimary&&!t?this.Yi(e).next(()=>!1):!!t&&this.Zi(e).next(()=>!0))).catch(e=>{if(Ea(e))return j(Zs,"Failed to extend owner lease: ",e),this.isPrimary;if(!this.allowTabSynchronization)throw e;return j(Zs,"Releasing owner lease after error during lease refresh",e),!1}).then(e=>{this.isPrimary!==e&&this.Fi.enqueueRetryable(()=>this.qi(e)),this.isPrimary=e})}Ji(e){return cg(e).get(Md).next(t=>L.resolve(this.Xi(t)))}es(e){return QI(e).delete(this.clientId)}ts(){return I(this,null,function*(){if(this.isPrimary&&!this.ns(this.ki,ob)){this.ki=Date.now();let e=yield this.runTransaction("maybeGarbageCollectMultiClientState","readwrite-primary",t=>{let r=en(t,eh);return r.j().next(i=>{let o=this.rs(i,ob),s=i.filter(a=>o.indexOf(a)===-1);return L.forEach(s,a=>r.delete(a.clientId)).next(()=>s)})}).catch(()=>[]);if(this.Ui)for(let t of e)this.Ui.removeItem(this.ss(t.clientId))}})}zi(){this.Li=this.Fi.enqueueAfterDelay("client_metadata_refresh",4e3,()=>this.Ki().then(()=>this.ts()).then(()=>this.zi()))}Xi(e){return!!e&&e.ownerId===this.clientId}Hi(e){return this.xi?L.resolve(!0):cg(e).get(Md).next(t=>{if(t!==null&&this.ns(t.leaseTimestampMs,sb)&&!this._s(t.ownerId)){if(this.Xi(t)&&this.networkEnabled)return!0;if(!this.Xi(t)){if(!t.allowTabSynchronization)throw new G(x.FAILED_PRECONDITION,ab);return!1}}return!(!this.networkEnabled||!this.inForeground)||QI(e).j().next(r=>this.rs(r,sb).find(i=>{if(this.clientId!==i.clientId){let o=!this.networkEnabled&&i.networkEnabled,s=!this.inForeground&&i.inForeground,a=this.networkEnabled===i.networkEnabled;if(o||s&&a)return!0}return!1})===void 0)}).next(t=>(this.isPrimary!==t&&j(Zs,`Client ${t?"is":"is not"} eligible for a primary lease.`),t))}shutdown(){return I(this,null,function*(){this.ci=!1,this.us(),this.Li&&(this.Li.cancel(),this.Li=null),this.cs(),this.ls(),yield this.$i.runTransaction("shutdown","readwrite",[Xg,eh],e=>{let t=new Dg(e,vr.ue);return this.Yi(t).next(()=>this.es(t))}),this.$i.close(),this.hs()})}rs(e,t){return e.filter(r=>this.ns(r.updateTimeMs,t)&&!this._s(r.clientId))}Ps(){return this.runTransaction("getActiveClients","readonly",e=>QI(e).j().next(t=>this.rs(t,ob).map(r=>r.clientId)))}get started(){return this.ci}getGlobalsCache(){return this.li}getMutationQueue(e,t){return Oy.yt(e,this.serializer,t,this.referenceDelegate)}getTargetCache(){return this.hi}getRemoteDocumentCache(){return this.remoteDocumentCache}getIndexManager(e){return new aO(e,this.serializer.gt.databaseId)}getDocumentOverlayCache(e){return Ry.yt(this.serializer,e)}getBundleCache(){return this.Ti}runTransaction(e,t,r){j(Zs,"Starting transaction:",e);let i=t==="readonly"?"readonly":"readwrite",o=(function(c){return c===18?Soe:c===17?e3:c===16?voe:c===15?D0:c===14?Z$:c===13?J$:c===12?yoe:c===11?Q$:void re(60245)})(this.Oi),s;return this.$i.runTransaction(e,i,o,a=>(s=new Dg(a,this.ui?this.ui.next():vr.ue),t==="readwrite-primary"?this.Ji(s).next(c=>!!c||this.Hi(s)).next(c=>{if(!c)throw Mt(`Failed to obtain primary lease for action '${e}'.`),this.isPrimary=!1,this.Fi.enqueueRetryable(()=>this.qi(!1)),new G(x.FAILED_PRECONDITION,j$);return r(s)}).next(c=>this.Zi(s).next(()=>c)):this.Ts(s).next(()=>r(s)))).then(a=>(s.raiseOnCommittedEvent(),a))}Ts(e){return cg(e).get(Md).next(t=>{if(t!==null&&this.ns(t.leaseTimestampMs,sb)&&!this._s(t.ownerId)&&!this.Xi(t)&&!(this.xi||this.allowTabSynchronization&&t.allowTabSynchronization))throw new G(x.FAILED_PRECONDITION,ab)})}Zi(e){let t={ownerId:this.clientId,allowTabSynchronization:this.allowTabSynchronization,leaseTimestampMs:Date.now()};return cg(e).put(Md,t)}static C(){return Xd.C()}Yi(e){let t=cg(e);return t.get(Md).next(r=>this.Xi(r)?(j(Zs,"Releasing primary lease."),t.delete(Md)):L.resolve())}ns(e,t){let r=Date.now();return!(e<r-t)&&(!(e>r)||(Mt(`Detected an update time that is in the future: ${e} > ${r}`),!1))}Wi(){this.document!==null&&typeof this.document.addEventListener=="function"&&(this.Bi=()=>{this.Fi.enqueueAndForget(()=>(this.inForeground=this.document.visibilityState==="visible",this.Ki()))},this.document.addEventListener("visibilitychange",this.Bi),this.inForeground=this.document.visibilityState==="visible")}cs(){this.Bi&&(this.document.removeEventListener("visibilitychange",this.Bi),this.Bi=null)}Gi(){var e;typeof((e=this.window)===null||e===void 0?void 0:e.addEventListener)=="function"&&(this.Ni=()=>{this.us();let t=/(?:Version|Mobile)\/1[456]/;nR()&&(navigator.appVersion.match(t)||navigator.userAgent.match(t))&&this.Fi.enterRestrictedMode(!0),this.Fi.enqueueAndForget(()=>this.shutdown())},this.window.addEventListener("pagehide",this.Ni))}ls(){this.Ni&&(this.window.removeEventListener("pagehide",this.Ni),this.Ni=null)}_s(e){var t;try{let r=((t=this.Ui)===null||t===void 0?void 0:t.getItem(this.ss(e)))!==null;return j(Zs,`Client '${e}' ${r?"is":"is not"} zombied in LocalStorage`),r}catch(r){return Mt(Zs,"Failed to get zombied client id.",r),!1}}us(){if(this.Ui)try{this.Ui.setItem(this.ss(this.clientId),String(Date.now()))}catch(e){Mt("Failed to set zombie client id.",e)}}hs(){if(this.Ui)try{this.Ui.removeItem(this.ss(this.clientId))}catch{}}ss(e){return`firestore_zombie_${this.persistenceKey}_${e}`}};function cg(n){return en(n,Xg)}function QI(n){return en(n,eh)}function Z3(n,e){let t=n.projectId;return n.isDefaultDatabase||(t+="."+n.database),"firestore/"+e+"/"+t+"/"}var CO=class n{constructor(e,t,r,i){this.targetId=e,this.fromCache=t,this.Is=r,this.ds=i}static Es(e,t){let r=be(),i=be();for(let o of t.docChanges)switch(o.type){case 0:r=r.add(o.doc.key);break;case 1:i=i.add(o.doc.key)}return new n(e,t.fromCache,r,i)}};var DO=class{constructor(){this._documentReadCount=0}get documentReadCount(){return this._documentReadCount}incrementDocumentReadCount(e){this._documentReadCount+=e}};var Fy=class{constructor(){this.As=!1,this.Rs=!1,this.Vs=100,this.fs=(function(){return nR()?8:H$(Kt())>0?6:4})()}initialize(e,t){this.gs=e,this.indexManager=t,this.As=!0}getDocumentsMatchingQuery(e,t,r,i){let o={result:null};return this.ps(e,t).next(s=>{o.result=s}).next(()=>{if(!o.result)return this.ys(e,t,i,r).next(s=>{o.result=s})}).next(()=>{if(o.result)return;let s=new DO;return this.ws(e,t,s).next(a=>{if(o.result=a,this.Rs)return this.Ss(e,t,s,a.size)})}).next(()=>o.result)}Ss(e,t,r,i){return r.documentReadCount<this.Vs?(Ud()<=Re.DEBUG&&j("QueryEngine","SDK will not create cache indexes for query:",Vd(t),"since it only creates cache indexes for collection contains","more than or equal to",this.Vs,"documents"),L.resolve()):(Ud()<=Re.DEBUG&&j("QueryEngine","Query:",Vd(t),"scans",r.documentReadCount,"local documents and returns",i,"documents as results."),r.documentReadCount>this.fs*i?(Ud()<=Re.DEBUG&&j("QueryEngine","The SDK decides to create cache indexes for query:",Vd(t),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(e,Cr(t))):L.resolve())}ps(e,t){if(HH(t))return L.resolve(null);let r=Cr(t);return this.indexManager.getIndexType(e,r).next(i=>i===0?null:(t.limit!==null&&i===1&&(t=yy(t,null,"F"),r=Cr(t)),this.indexManager.getDocumentsMatchingTarget(e,r).next(o=>{let s=be(...o);return this.gs.getDocuments(e,s).next(a=>this.indexManager.getMinOffset(e,r).next(c=>{let l=this.bs(t,a);return this.Ds(t,l,s,c.readTime)?this.ps(e,yy(t,null,"F")):this.vs(e,l,t,c)}))})))}ys(e,t,r,i){return HH(t)||i.isEqual(le.min())?L.resolve(null):this.gs.getDocuments(e,r).next(o=>{let s=this.bs(t,o);return this.Ds(t,s,r,i)?L.resolve(null):(Ud()<=Re.DEBUG&&j("QueryEngine","Re-using previous result from %s to execute query: %s",i.toString(),Vd(t)),this.vs(e,s,t,B$(i,Kd)).next(a=>a))})}bs(e,t){let r=new tt(T3(e));return t.forEach((i,o)=>{Zg(e,o)&&(r=r.add(o))}),r}Ds(e,t,r,i){if(e.limit===null)return!1;if(r.size!==t.size)return!0;let o=e.limitType==="F"?t.last():t.first();return!!o&&(o.hasPendingWrites||o.version.compareTo(i)>0)}ws(e,t,r){return Ud()<=Re.DEBUG&&j("QueryEngine","Using full collection scan to execute query:",Vd(t)),this.gs.getDocumentsMatchingQuery(e,t,jr.min(),r)}vs(e,t,r,i){return this.gs.getDocumentsMatchingQuery(e,r,i).next(o=>(t.forEach(s=>{o=o.insert(s.key,s)}),o))}};var k0="LocalStore",sse=3e8,RO=class{constructor(e,t,r,i){this.persistence=e,this.Cs=t,this.serializer=i,this.Fs=new ft(Ie),this.Ms=new hi(o=>Il(o),Qg),this.xs=new Map,this.Os=e.getRemoteDocumentCache(),this.hi=e.getTargetCache(),this.Ti=e.getBundleCache(),this.Ns(r)}Ns(e){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(e),this.indexManager=this.persistence.getIndexManager(e),this.mutationQueue=this.persistence.getMutationQueue(e,this.indexManager),this.localDocuments=new Py(this.Os,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.Os.setIndexManager(this.indexManager),this.Cs.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",t=>e.collect(t,this.Fs))}};function eW(n,e,t,r){return new RO(n,e,t,r)}function tW(n,e){return I(this,null,function*(){let t=se(n);return yield t.persistence.runTransaction("Handle user change","readonly",r=>{let i;return t.mutationQueue.getAllMutationBatches(r).next(o=>(i=o,t.Ns(e),t.mutationQueue.getAllMutationBatches(r))).next(o=>{let s=[],a=[],c=be();for(let l of i){s.push(l.batchId);for(let d of l.mutations)c=c.add(d.key)}for(let l of o){a.push(l.batchId);for(let d of l.mutations)c=c.add(d.key)}return t.localDocuments.getDocuments(r,c).next(l=>({Bs:l,removedBatchIds:s,addedBatchIds:a}))})})})}function ase(n,e){let t=se(n);return t.persistence.runTransaction("Acknowledge batch","readwrite-primary",r=>{let i=e.batch.keys(),o=t.Os.newChangeBuffer({trackRemovals:!0});return(function(a,c,l,d){let h=l.batch,f=h.keys(),g=L.resolve();return f.forEach(E=>{g=g.next(()=>d.getEntry(c,E)).next(v=>{let S=l.docVersions.get(E);ae(S!==null,48541),v.version.compareTo(S)<0&&(h.applyToRemoteDocument(v,l),v.isValidDocument()&&(v.setReadTime(l.commitVersion),d.addEntry(v)))})}),g.next(()=>a.mutationQueue.removeMutationBatch(c,h))})(t,r,e,o).next(()=>o.apply(r)).next(()=>t.mutationQueue.performConsistencyCheck(r)).next(()=>t.documentOverlayCache.removeOverlaysForBatchId(r,i,e.batch.batchId)).next(()=>t.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(r,(function(a){let c=be();for(let l=0;l<a.mutationResults.length;++l)a.mutationResults[l].transformResults.length>0&&(c=c.add(a.batch.mutations[l].key));return c})(e))).next(()=>t.localDocuments.getDocuments(r,i))})}function nW(n){let e=se(n);return e.persistence.runTransaction("Get last remote snapshot version","readonly",t=>e.hi.getLastRemoteSnapshotVersion(t))}function cse(n,e){let t=se(n),r=e.snapshotVersion,i=t.Fs;return t.persistence.runTransaction("Apply remote event","readwrite-primary",o=>{let s=t.Os.newChangeBuffer({trackRemovals:!0});i=t.Fs;let a=[];e.targetChanges.forEach((d,h)=>{let f=i.get(h);if(!f)return;a.push(t.hi.removeMatchingKeys(o,d.removedDocuments,h).next(()=>t.hi.addMatchingKeys(o,d.addedDocuments,h)));let g=f.withSequenceNumber(o.currentSequenceNumber);e.targetMismatches.get(h)!==null?g=g.withResumeToken(Gt.EMPTY_BYTE_STRING,le.min()).withLastLimboFreeSnapshotVersion(le.min()):d.resumeToken.approximateByteSize()>0&&(g=g.withResumeToken(d.resumeToken,r)),i=i.insert(h,g),(function(v,S,P){return v.resumeToken.approximateByteSize()===0||S.snapshotVersion.toMicroseconds()-v.snapshotVersion.toMicroseconds()>=sse?!0:P.addedDocuments.size+P.modifiedDocuments.size+P.removedDocuments.size>0})(f,g,d)&&a.push(t.hi.updateTargetData(o,g))});let c=Ar(),l=be();if(e.documentUpdates.forEach(d=>{e.resolvedLimboDocuments.has(d)&&a.push(t.persistence.referenceDelegate.updateLimboDocument(o,d))}),a.push(lse(o,s,e.documentUpdates).next(d=>{c=d.Ls,l=d.ks})),!r.isEqual(le.min())){let d=t.hi.getLastRemoteSnapshotVersion(o).next(h=>t.hi.setTargetsMetadata(o,o.currentSequenceNumber,r));a.push(d)}return L.waitFor(a).next(()=>s.apply(o)).next(()=>t.localDocuments.getLocalViewOfDocuments(o,c,l)).next(()=>c)}).then(o=>(t.Fs=i,o))}function lse(n,e,t){let r=be(),i=be();return t.forEach(o=>r=r.add(o)),e.getEntries(n,r).next(o=>{let s=Ar();return t.forEach((a,c)=>{let l=o.get(a);c.isFoundDocument()!==l.isFoundDocument()&&(i=i.add(a)),c.isNoDocument()&&c.version.isEqual(le.min())?(e.removeEntry(a,c.readTime),s=s.insert(a,c)):!l.isValidDocument()||c.version.compareTo(l.version)>0||c.version.compareTo(l.version)===0&&l.hasPendingWrites?(e.addEntry(c),s=s.insert(a,c)):j(k0,"Ignoring outdated watch update for ",a,". Current version:",l.version," Watch version:",c.version)}),{Ls:s,ks:i}})}function use(n,e){let t=se(n);return t.persistence.runTransaction("Get next mutation batch","readonly",r=>(e===void 0&&(e=gl),t.mutationQueue.getNextMutationBatchAfterBatchId(r,e)))}function Uy(n,e){let t=se(n);return t.persistence.runTransaction("Allocate target","readwrite",r=>{let i;return t.hi.getTargetData(r,e).next(o=>o?(i=o,L.resolve(i)):t.hi.allocateTargetId(r).next(s=>(i=new ch(e,s,"TargetPurposeListen",r.currentSequenceNumber),t.hi.addTargetData(r,i).next(()=>i))))}).then(r=>{let i=t.Fs.get(r.targetId);return(i===null||r.snapshotVersion.compareTo(i.snapshotVersion)>0)&&(t.Fs=t.Fs.insert(r.targetId,r),t.Ms.set(e,r.targetId)),r})}function uh(n,e,t){return I(this,null,function*(){let r=se(n),i=r.Fs.get(e),o=t?"readwrite":"readwrite-primary";try{t||(yield r.persistence.runTransaction("Release target",o,s=>r.persistence.referenceDelegate.removeTarget(s,i)))}catch(s){if(!Ea(s))throw s;j(k0,`Failed to update sequence numbers for target ${e}: ${s}`)}r.Fs=r.Fs.remove(e),r.Ms.delete(i.target)})}function NO(n,e,t){let r=se(n),i=le.min(),o=be();return r.persistence.runTransaction("Execute query","readwrite",s=>(function(c,l,d){let h=se(c),f=h.Ms.get(d);return f!==void 0?L.resolve(h.Fs.get(f)):h.hi.getTargetData(l,d)})(r,s,Cr(e)).next(a=>{if(a)return i=a.lastLimboFreeSnapshotVersion,r.hi.getMatchingKeysForTargetId(s,a.targetId).next(c=>{o=c})}).next(()=>r.Cs.getDocumentsMatchingQuery(s,e,t?i:le.min(),t?o:be())).next(a=>(oW(r,_3(e),a),{documents:a,qs:o})))}function rW(n,e){let t=se(n),r=se(t.hi),i=t.Fs.get(e);return i?Promise.resolve(i.target):t.persistence.runTransaction("Get target data","readonly",o=>r.Et(o,e).next(s=>s?s.target:null))}function iW(n,e){let t=se(n),r=t.xs.get(e)||le.min();return t.persistence.runTransaction("Get new document changes","readonly",i=>t.Os.getAllFromCollectionGroup(i,e,B$(r,Kd),Number.MAX_SAFE_INTEGER)).then(i=>(oW(t,e,i),i))}function oW(n,e,t){let r=n.xs.get(e)||le.min();t.forEach((i,o)=>{o.readTime.compareTo(r)>0&&(r=o.readTime)}),n.xs.set(e,r)}var sW="firestore_clients";function T$(n,e){return`${sW}_${n}_${e}`}var aW="firestore_mutations";function I$(n,e,t){let r=`${aW}_${n}_${t}`;return e.isAuthenticated()&&(r+=`_${e.uid}`),r}var cW="firestore_targets";function cb(n,e){return`${cW}_${n}_${e}`}var Zi="SharedClientState",Vy=class n{constructor(e,t,r,i){this.user=e,this.batchId=t,this.state=r,this.error=i}static Ks(e,t,r){let i=JSON.parse(r),o,s=typeof i=="object"&&["pending","acknowledged","rejected"].indexOf(i.state)!==-1&&(i.error===void 0||typeof i.error=="object");return s&&i.error&&(s=typeof i.error.message=="string"&&typeof i.error.code=="string",s&&(o=new G(i.error.code,i.error.message))),s?new n(e,t,i.state,o):(Mt(Zi,`Failed to parse mutation state for ID '${t}': ${r}`),null)}Ws(){let e={state:this.state,updateTimeMs:Date.now()};return this.error&&(e.error={code:this.error.code,message:this.error.message}),JSON.stringify(e)}},_g=class n{constructor(e,t,r){this.targetId=e,this.state=t,this.error=r}static Ks(e,t){let r=JSON.parse(t),i,o=typeof r=="object"&&["not-current","current","rejected"].indexOf(r.state)!==-1&&(r.error===void 0||typeof r.error=="object");return o&&r.error&&(o=typeof r.error.message=="string"&&typeof r.error.code=="string",o&&(i=new G(r.error.code,r.error.message))),o?new n(e,r.state,i):(Mt(Zi,`Failed to parse target state for ID '${e}': ${t}`),null)}Ws(){let e={state:this.state,updateTimeMs:Date.now()};return this.error&&(e.error={code:this.error.code,message:this.error.message}),JSON.stringify(e)}},By=class n{constructor(e,t){this.clientId=e,this.activeTargetIds=t}static Ks(e,t){let r=JSON.parse(t),i=typeof r=="object"&&r.activeTargetIds instanceof Array,o=O0();for(let s=0;i&&s<r.activeTargetIds.length;++s)i=$$(r.activeTargetIds[s]),o=o.add(r.activeTargetIds[s]);return i?new n(e,o):(Mt(Zi,`Failed to parse client data for instance '${e}': ${t}`),null)}},wO=class n{constructor(e,t){this.clientId=e,this.onlineState=t}static Ks(e){let t=JSON.parse(e);return typeof t=="object"&&["Unknown","Online","Offline"].indexOf(t.onlineState)!==-1&&typeof t.clientId=="string"?new n(t.clientId,t.onlineState):(Mt(Zi,`Failed to parse online state: ${e}`),null)}},Gg=class{constructor(){this.activeTargetIds=O0()}Gs(e){this.activeTargetIds=this.activeTargetIds.add(e)}zs(e){this.activeTargetIds=this.activeTargetIds.delete(e)}Ws(){let e={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(e)}},Tg=class{constructor(e,t,r,i,o){this.window=e,this.Fi=t,this.persistenceKey=r,this.js=i,this.syncEngine=null,this.onlineStateHandler=null,this.sequenceNumberHandler=null,this.Js=this.Hs.bind(this),this.Ys=new ft(Ie),this.started=!1,this.Zs=[];let s=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");this.storage=this.window.localStorage,this.currentUser=o,this.Xs=T$(this.persistenceKey,this.js),this.eo=(function(c){return`firestore_sequence_number_${c}`})(this.persistenceKey),this.Ys=this.Ys.insert(this.js,new Gg),this.no=new RegExp(`^${sW}_${s}_([^_]*)$`),this.ro=new RegExp(`^${aW}_${s}_(\\d+)(?:_(.*))?$`),this.io=new RegExp(`^${cW}_${s}_(\\d+)$`),this.so=(function(c){return`firestore_online_state_${c}`})(this.persistenceKey),this.oo=(function(c){return`firestore_bundle_loaded_v2_${c}`})(this.persistenceKey),this.window.addEventListener("storage",this.Js)}static C(e){return!(!e||!e.localStorage)}start(){return I(this,null,function*(){let e=yield this.syncEngine.Ps();for(let r of e){if(r===this.js)continue;let i=this.getItem(T$(this.persistenceKey,r));if(i){let o=By.Ks(r,i);o&&(this.Ys=this.Ys.insert(o.clientId,o))}}this._o();let t=this.storage.getItem(this.so);if(t){let r=this.ao(t);r&&this.uo(r)}for(let r of this.Zs)this.Hs(r);this.Zs=[],this.window.addEventListener("pagehide",()=>this.shutdown()),this.started=!0})}writeSequenceNumber(e){this.setItem(this.eo,JSON.stringify(e))}getAllActiveQueryTargets(){return this.co(this.Ys)}isActiveQueryTarget(e){let t=!1;return this.Ys.forEach((r,i)=>{i.activeTargetIds.has(e)&&(t=!0)}),t}addPendingMutation(e){this.lo(e,"pending")}updateMutationState(e,t,r){this.lo(e,t,r),this.ho(e)}addLocalQueryTarget(e,t=!0){let r="not-current";if(this.isActiveQueryTarget(e)){let i=this.storage.getItem(cb(this.persistenceKey,e));if(i){let o=_g.Ks(e,i);o&&(r=o.state)}}return t&&this.Po.Gs(e),this._o(),r}removeLocalQueryTarget(e){this.Po.zs(e),this._o()}isLocalQueryTarget(e){return this.Po.activeTargetIds.has(e)}clearQueryState(e){this.removeItem(cb(this.persistenceKey,e))}updateQueryState(e,t,r){this.To(e,t,r)}handleUserChange(e,t,r){t.forEach(i=>{this.ho(i)}),this.currentUser=e,r.forEach(i=>{this.addPendingMutation(i)})}setOnlineState(e){this.Io(e)}notifyBundleLoaded(e){this.Eo(e)}shutdown(){this.started&&(this.window.removeEventListener("storage",this.Js),this.removeItem(this.Xs),this.started=!1)}getItem(e){let t=this.storage.getItem(e);return j(Zi,"READ",e,t),t}setItem(e,t){j(Zi,"SET",e,t),this.storage.setItem(e,t)}removeItem(e){j(Zi,"REMOVE",e),this.storage.removeItem(e)}Hs(e){let t=e;if(t.storageArea===this.storage){if(j(Zi,"EVENT",t.key,t.newValue),t.key===this.Xs)return void Mt("Received WebStorage notification for local change. Another client might have garbage-collected our state");this.Fi.enqueueRetryable(()=>I(this,null,function*(){if(this.started){if(t.key!==null){if(this.no.test(t.key)){if(t.newValue==null){let r=this.Ao(t.key);return this.Ro(r,null)}{let r=this.Vo(t.key,t.newValue);if(r)return this.Ro(r.clientId,r)}}else if(this.ro.test(t.key)){if(t.newValue!==null){let r=this.mo(t.key,t.newValue);if(r)return this.fo(r)}}else if(this.io.test(t.key)){if(t.newValue!==null){let r=this.po(t.key,t.newValue);if(r)return this.yo(r)}}else if(t.key===this.so){if(t.newValue!==null){let r=this.ao(t.newValue);if(r)return this.uo(r)}}else if(t.key===this.eo){let r=(function(o){let s=vr.ue;if(o!=null)try{let a=JSON.parse(o);ae(typeof a=="number",30636,{wo:o}),s=a}catch(a){Mt(Zi,"Failed to read sequence number from WebStorage",a)}return s})(t.newValue);r!==vr.ue&&this.sequenceNumberHandler(r)}else if(t.key===this.oo){let r=this.So(t.newValue);yield Promise.all(r.map(i=>this.syncEngine.bo(i)))}}}else this.Zs.push(t)}))}}get Po(){return this.Ys.get(this.js)}_o(){this.setItem(this.Xs,this.Po.Ws())}lo(e,t,r){let i=new Vy(this.currentUser,e,t,r),o=I$(this.persistenceKey,this.currentUser,e);this.setItem(o,i.Ws())}ho(e){let t=I$(this.persistenceKey,this.currentUser,e);this.removeItem(t)}Io(e){let t={clientId:this.js,onlineState:e};this.storage.setItem(this.so,JSON.stringify(t))}To(e,t,r){let i=cb(this.persistenceKey,e),o=new _g(e,t,r);this.setItem(i,o.Ws())}Eo(e){let t=JSON.stringify(Array.from(e));this.setItem(this.oo,t)}Ao(e){let t=this.no.exec(e);return t?t[1]:null}Vo(e,t){let r=this.Ao(e);return By.Ks(r,t)}mo(e,t){let r=this.ro.exec(e),i=Number(r[1]),o=r[2]!==void 0?r[2]:null;return Vy.Ks(new Vt(o),i,t)}po(e,t){let r=this.io.exec(e),i=Number(r[1]);return _g.Ks(i,t)}ao(e){return wO.Ks(e)}So(e){return JSON.parse(e)}fo(e){return I(this,null,function*(){if(e.user.uid===this.currentUser.uid)return this.syncEngine.Do(e.batchId,e.state,e.error);j(Zi,`Ignoring mutation for non-active user ${e.user.uid}`)})}yo(e){return this.syncEngine.vo(e.targetId,e.state,e.error)}Ro(e,t){let r=t?this.Ys.insert(e,t):this.Ys.remove(e),i=this.co(this.Ys),o=this.co(r),s=[],a=[];return o.forEach(c=>{i.has(c)||s.push(c)}),i.forEach(c=>{o.has(c)||a.push(c)}),this.syncEngine.Co(s,a).then(()=>{this.Ys=r})}uo(e){this.Ys.get(e.clientId)&&this.onlineStateHandler(e.onlineState)}co(e){let t=O0();return e.forEach((r,i)=>{t=t.unionWith(i.activeTargetIds)}),t}},Gy=class{constructor(){this.Fo=new Gg,this.Mo={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,t,r){}addLocalQueryTarget(e,t=!0){return t&&this.Fo.Gs(e),this.Mo[e]||"not-current"}updateQueryState(e,t,r){this.Mo[e]=t}removeLocalQueryTarget(e){this.Fo.zs(e)}isLocalQueryTarget(e){return this.Fo.activeTargetIds.has(e)}clearQueryState(e){delete this.Mo[e]}getAllActiveQueryTargets(){return this.Fo.activeTargetIds}isActiveQueryTarget(e){return this.Fo.activeTargetIds.has(e)}start(){return this.Fo=new Gg,Promise.resolve()}handleUserChange(e,t,r){}setOnlineState(e){}shutdown(){}writeSequenceNumber(e){}notifyBundleLoaded(e){}};var bO=class{xo(e){}shutdown(){}};var y$="ConnectivityMonitor",jy=class{constructor(){this.Oo=()=>this.No(),this.Bo=()=>this.Lo(),this.ko=[],this.qo()}xo(e){this.ko.push(e)}shutdown(){window.removeEventListener("online",this.Oo),window.removeEventListener("offline",this.Bo)}qo(){window.addEventListener("online",this.Oo),window.addEventListener("offline",this.Bo)}No(){j(y$,"Network connectivity changed: AVAILABLE");for(let e of this.ko)e(0)}Lo(){j(y$,"Network connectivity changed: UNAVAILABLE");for(let e of this.ko)e(1)}static C(){return typeof window<"u"&&window.addEventListener!==void 0&&window.removeEventListener!==void 0}};var JI=null;function OO(){return JI===null?JI=(function(){return 268435456+Math.round(2147483648*Math.random())})():JI++,"0x"+JI.toString(16)}var lb="RestConnection",dse={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregationQuery:"runAggregationQuery"},MO=class{get Qo(){return!1}constructor(e){this.databaseInfo=e,this.databaseId=e.databaseId;let t=e.ssl?"https":"http",r=encodeURIComponent(this.databaseId.projectId),i=encodeURIComponent(this.databaseId.database);this.$o=t+"://"+e.host,this.Uo=`projects/${r}/databases/${i}`,this.Ko=this.databaseId.database===Ng?`project_id=${r}`:`project_id=${r}&database_id=${i}`}Wo(e,t,r,i,o){let s=OO(),a=this.Go(e,t.toUriEncodedString());j(lb,`Sending RPC '${e}' ${s}:`,a,r);let c={"google-cloud-resource-prefix":this.Uo,"x-goog-request-params":this.Ko};this.zo(c,i,o);let{host:l}=new URL(a),d=mr(l);return this.jo(e,a,c,r,d).then(h=>(j(lb,`Received RPC '${e}' ${s}: `,h),h),h=>{throw qo(lb,`RPC '${e}' ${s} failed with error: `,h,"url: ",a,"request:",r),h})}Jo(e,t,r,i,o,s){return this.Wo(e,t,r,i,o)}zo(e,t,r){e["X-Goog-Api-Client"]=(function(){return"gl-js/ fire/"+Eh})(),e["Content-Type"]="text/plain",this.databaseInfo.appId&&(e["X-Firebase-GMPID"]=this.databaseInfo.appId),t&&t.headers.forEach((i,o)=>e[o]=i),r&&r.headers.forEach((i,o)=>e[o]=i)}Go(e,t){let r=dse[e];return`${this.$o}/v1/${t}:${r}`}terminate(){}};var LO=class{constructor(e){this.Ho=e.Ho,this.Yo=e.Yo}Zo(e){this.Xo=e}e_(e){this.t_=e}n_(e){this.r_=e}onMessage(e){this.i_=e}close(){this.Yo()}send(e){this.Ho(e)}s_(){this.Xo()}o_(){this.t_()}__(e){this.r_(e)}a_(e){this.i_(e)}};var Pn="WebChannelConnection",PO=class extends MO{constructor(e){super(e),this.u_=[],this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams,this.longPollingOptions=e.longPollingOptions}jo(e,t,r,i,o){let s=OO();return new Promise((a,c)=>{let l=new Zw;l.setWithCredentials(!0),l.listenOnce(eb.COMPLETE,()=>{try{switch(l.getLastErrorCode()){case ig.NO_ERROR:let h=l.getResponseJson();j(Pn,`XHR for RPC '${e}' ${s} received:`,JSON.stringify(h)),a(h);break;case ig.TIMEOUT:j(Pn,`RPC '${e}' ${s} timed out`),c(new G(x.DEADLINE_EXCEEDED,"Request time out"));break;case ig.HTTP_ERROR:let f=l.getStatus();if(j(Pn,`RPC '${e}' ${s} failed with status:`,f,"response text:",l.getResponseText()),f>0){let g=l.getResponseJson();Array.isArray(g)&&(g=g[0]);let E=g?.error;if(E&&E.status&&E.message){let v=(function(P){let V=P.toLowerCase().replace(/_/g,"-");return Object.values(x).indexOf(V)>=0?V:x.UNKNOWN})(E.status);c(new G(v,E.message))}else c(new G(x.UNKNOWN,"Server responded with status "+l.getStatus()))}else c(new G(x.UNAVAILABLE,"Connection failed."));break;default:re(9055,{c_:e,streamId:s,l_:l.getLastErrorCode(),h_:l.getLastError()})}}finally{j(Pn,`RPC '${e}' ${s} completed.`)}});let d=JSON.stringify(i);j(Pn,`RPC '${e}' ${s} sending request:`,i),l.send(t,"POST",d,r,15)})}P_(e,t,r){let i=OO(),o=[this.$o,"/","google.firestore.v1.Firestore","/",e,"/channel"],s=rb(),a=nb(),c={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},l=this.longPollingOptions.timeoutSeconds;l!==void 0&&(c.longPollingTimeout=Math.round(1e3*l)),this.useFetchStreams&&(c.useFetchStreams=!0),this.zo(c.initMessageHeaders,t,r),c.encodeInitMessageHeaders=!0;let d=o.join("");j(Pn,`Creating RPC '${e}' stream ${i}: ${d}`,c);let h=s.createWebChannel(d,c);this.T_(h);let f=!1,g=!1,E=new LO({Ho:S=>{g?j(Pn,`Not sending because RPC '${e}' stream ${i} is closed:`,S):(f||(j(Pn,`Opening RPC '${e}' stream ${i} transport.`),h.open(),f=!0),j(Pn,`RPC '${e}' stream ${i} sending:`,S),h.send(S))},Yo:()=>h.close()}),v=(S,P,V)=>{S.listen(P,K=>{try{V(K)}catch(oe){setTimeout(()=>{throw oe},0)}})};return v(h,Od.EventType.OPEN,()=>{g||(j(Pn,`RPC '${e}' stream ${i} transport opened.`),E.s_())}),v(h,Od.EventType.CLOSE,()=>{g||(g=!0,j(Pn,`RPC '${e}' stream ${i} transport closed`),E.__(),this.I_(h))}),v(h,Od.EventType.ERROR,S=>{g||(g=!0,qo(Pn,`RPC '${e}' stream ${i} transport errored. Name:`,S.name,"Message:",S.message),E.__(new G(x.UNAVAILABLE,"The operation could not be completed")))}),v(h,Od.EventType.MESSAGE,S=>{var P;if(!g){let V=S.data[0];ae(!!V,16349);let K=V,oe=K?.error||((P=K[0])===null||P===void 0?void 0:P.error);if(oe){j(Pn,`RPC '${e}' stream ${i} received error:`,oe);let ge=oe.status,te=(function(A){let R=Ft[A];if(R!==void 0)return O3(R)})(ge),C=oe.message;te===void 0&&(te=x.INTERNAL,C="Unknown error status: "+ge+" with message "+oe.message),g=!0,E.__(new G(te,C)),h.close()}else j(Pn,`RPC '${e}' stream ${i} received:`,V),E.a_(V)}}),v(a,tb.STAT_EVENT,S=>{S.stat===qI.PROXY?j(Pn,`RPC '${e}' stream ${i} detected buffering proxy`):S.stat===qI.NOPROXY&&j(Pn,`RPC '${e}' stream ${i} detected no buffering proxy`)}),setTimeout(()=>{E.o_()},0),E}terminate(){this.u_.forEach(e=>e.close()),this.u_=[]}T_(e){this.u_.push(e)}I_(e){this.u_=this.u_.filter(t=>t===e)}};function lW(){return typeof window<"u"?window:null}function sy(){return typeof document<"u"?document:null}function dv(n){return new qb(n,!0)}var jg=class{constructor(e,t,r=1e3,i=1.5,o=6e4){this.Fi=e,this.timerId=t,this.d_=r,this.E_=i,this.A_=o,this.R_=0,this.V_=null,this.m_=Date.now(),this.reset()}reset(){this.R_=0}f_(){this.R_=this.A_}g_(e){this.cancel();let t=Math.floor(this.R_+this.p_()),r=Math.max(0,Date.now()-this.m_),i=Math.max(0,t-r);i>0&&j("ExponentialBackoff",`Backing off for ${i} ms (base delay: ${this.R_} ms, delay with jitter: ${t} ms, last attempt: ${r} ms ago)`),this.V_=this.Fi.enqueueAfterDelay(this.timerId,i,()=>(this.m_=Date.now(),e())),this.R_*=this.E_,this.R_<this.d_&&(this.R_=this.d_),this.R_>this.A_&&(this.R_=this.A_)}y_(){this.V_!==null&&(this.V_.skipDelay(),this.V_=null)}cancel(){this.V_!==null&&(this.V_.cancel(),this.V_=null)}p_(){return(Math.random()-.5)*this.R_}};var v$="PersistentStream",Hy=class{constructor(e,t,r,i,o,s,a,c){this.Fi=e,this.w_=r,this.S_=i,this.connection=o,this.authCredentialsProvider=s,this.appCheckCredentialsProvider=a,this.listener=c,this.state=0,this.b_=0,this.D_=null,this.v_=null,this.stream=null,this.C_=0,this.F_=new jg(e,t)}M_(){return this.state===1||this.state===5||this.x_()}x_(){return this.state===2||this.state===3}start(){this.C_=0,this.state!==4?this.auth():this.O_()}stop(){return I(this,null,function*(){this.M_()&&(yield this.close(0))})}N_(){this.state=0,this.F_.reset()}B_(){this.x_()&&this.D_===null&&(this.D_=this.Fi.enqueueAfterDelay(this.w_,6e4,()=>this.L_()))}k_(e){this.q_(),this.stream.send(e)}L_(){return I(this,null,function*(){if(this.x_())return this.close(0)})}q_(){this.D_&&(this.D_.cancel(),this.D_=null)}Q_(){this.v_&&(this.v_.cancel(),this.v_=null)}close(e,t){return I(this,null,function*(){this.q_(),this.Q_(),this.F_.cancel(),this.b_++,e!==4?this.F_.reset():t&&t.code===x.RESOURCE_EXHAUSTED?(Mt(t.toString()),Mt("Using maximum backoff delay to prevent overloading the backend."),this.F_.f_()):t&&t.code===x.UNAUTHENTICATED&&this.state!==3&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),this.stream!==null&&(this.U_(),this.stream.close(),this.stream=null),this.state=e,yield this.listener.n_(t)})}U_(){}auth(){this.state=1;let e=this.K_(this.b_),t=this.b_;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then(([r,i])=>{this.b_===t&&this.W_(r,i)},r=>{e(()=>{let i=new G(x.UNKNOWN,"Fetching auth token failed: "+r.message);return this.G_(i)})})}W_(e,t){let r=this.K_(this.b_);this.stream=this.z_(e,t),this.stream.Zo(()=>{r(()=>this.listener.Zo())}),this.stream.e_(()=>{r(()=>(this.state=2,this.v_=this.Fi.enqueueAfterDelay(this.S_,1e4,()=>(this.x_()&&(this.state=3),Promise.resolve())),this.listener.e_()))}),this.stream.n_(i=>{r(()=>this.G_(i))}),this.stream.onMessage(i=>{r(()=>++this.C_==1?this.j_(i):this.onNext(i))})}O_(){this.state=5,this.F_.g_(()=>I(this,null,function*(){this.state=0,this.start()}))}G_(e){return j(v$,`close with error: ${e}`),this.stream=null,this.close(4,e)}K_(e){return t=>{this.Fi.enqueueAndForget(()=>this.b_===e?t():(j(v$,"stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve()))}}},xO=class extends Hy{constructor(e,t,r,i,o,s){super(e,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",t,r,i,s),this.serializer=o}z_(e,t){return this.connection.P_("Listen",e,t)}j_(e){return this.onNext(e)}onNext(e){this.F_.reset();let t=Koe(this.serializer,e),r=(function(o){if(!("targetChange"in o))return le.min();let s=o.targetChange;return s.targetIds&&s.targetIds.length?le.min():s.readTime?dn(s.readTime):le.min()})(e);return this.listener.J_(t,r)}H_(e){let t={};t.database=Xb(this.serializer),t.addTarget=(function(o,s){let a,c=s.target;if(a=Ty(c)?{documents:F3(o,c)}:{query:P0(o,c).Vt},a.targetId=s.targetId,s.resumeToken.approximateByteSize()>0){a.resumeToken=M3(o,s.resumeToken);let l=Kb(o,s.expectedCount);l!==null&&(a.expectedCount=l)}else if(s.snapshotVersion.compareTo(le.min())>0){a.readTime=ah(o,s.snapshotVersion.toTimestamp());let l=Kb(o,s.expectedCount);l!==null&&(a.expectedCount=l)}return a})(this.serializer,e);let r=Qoe(this.serializer,e);r&&(t.labels=r),this.k_(t)}Y_(e){let t={};t.database=Xb(this.serializer),t.removeTarget=e,this.k_(t)}},kO=class extends Hy{constructor(e,t,r,i,o,s){super(e,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",t,r,i,s),this.serializer=o}get Z_(){return this.C_>0}start(){this.lastStreamToken=void 0,super.start()}U_(){this.Z_&&this.X_([])}z_(e,t){return this.connection.P_("Write",e,t)}j_(e){return ae(!!e.streamToken,31322),this.lastStreamToken=e.streamToken,ae(!e.writeResults||e.writeResults.length===0,55816),this.listener.ea()}onNext(e){ae(!!e.streamToken,12678),this.lastStreamToken=e.streamToken,this.F_.reset();let t=Yoe(e.writeResults,e.commitTime),r=dn(e.commitTime);return this.listener.ta(r,t)}na(){let e={};e.database=Xb(this.serializer),this.k_(e)}X_(e){let t={streamToken:this.lastStreamToken,writes:e.map(r=>Fg(this.serializer,r))};this.k_(t)}};var FO=class{},UO=class extends FO{constructor(e,t,r,i){super(),this.authCredentials=e,this.appCheckCredentials=t,this.connection=r,this.serializer=i,this.ra=!1}ia(){if(this.ra)throw new G(x.FAILED_PRECONDITION,"The client has already been terminated.")}Wo(e,t,r,i){return this.ia(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([o,s])=>this.connection.Wo(e,Yb(t,r),i,o,s)).catch(o=>{throw o.name==="FirebaseError"?(o.code===x.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),o):new G(x.UNKNOWN,o.toString())})}Jo(e,t,r,i,o){return this.ia(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([s,a])=>this.connection.Jo(e,Yb(t,r),i,s,a,o)).catch(s=>{throw s.name==="FirebaseError"?(s.code===x.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),s):new G(x.UNKNOWN,s.toString())})}terminate(){this.ra=!0,this.connection.terminate()}},VO=class{constructor(e,t){this.asyncQueue=e,this.onlineStateHandler=t,this.state="Unknown",this.sa=0,this.oa=null,this._a=!0}aa(){this.sa===0&&(this.ua("Unknown"),this.oa=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,()=>(this.oa=null,this.ca("Backend didn't respond within 10 seconds."),this.ua("Offline"),Promise.resolve())))}la(e){this.state==="Online"?this.ua("Unknown"):(this.sa++,this.sa>=1&&(this.ha(),this.ca(`Connection failed 1 times. Most recent error: ${e.toString()}`),this.ua("Offline")))}set(e){this.ha(),this.sa=0,e==="Online"&&(this._a=!1),this.ua(e)}ua(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))}ca(e){let t=`Could not reach Cloud Firestore backend. ${e}
|
|
170
|
+
This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.`;this._a?(Mt(t),this._a=!1):j("OnlineStateTracker",t)}ha(){this.oa!==null&&(this.oa.cancel(),this.oa=null)}};var Dl="RemoteStore",BO=class{constructor(e,t,r,i,o){this.localStore=e,this.datastore=t,this.asyncQueue=r,this.remoteSyncer={},this.Pa=[],this.Ta=new Map,this.Ia=new Set,this.da=[],this.Ea=o,this.Ea.xo(s=>{r.enqueueAndForget(()=>I(this,null,function*(){bl(this)&&(j(Dl,"Restarting streams for network reachability change."),yield(function(c){return I(this,null,function*(){let l=se(c);l.Ia.add(4),yield em(l),l.Aa.set("Unknown"),l.Ia.delete(4),yield hv(l)})})(this))}))}),this.Aa=new VO(r,i)}};function hv(n){return I(this,null,function*(){if(bl(n))for(let e of n.da)yield e(!0)})}function em(n){return I(this,null,function*(){for(let e of n.da)yield e(!1)})}function fv(n,e){let t=se(n);t.Ta.has(e.targetId)||(t.Ta.set(e.targetId,e),V0(t)?U0(t):Th(t).x_()&&F0(t,e))}function dh(n,e){let t=se(n),r=Th(t);t.Ta.delete(e),r.x_()&&uW(t,e),t.Ta.size===0&&(r.x_()?r.B_():bl(t)&&t.Aa.set("Unknown"))}function F0(n,e){if(n.Ra.$e(e.targetId),e.resumeToken.approximateByteSize()>0||e.snapshotVersion.compareTo(le.min())>0){let t=n.remoteSyncer.getRemoteKeysForTarget(e.targetId).size;e=e.withExpectedCount(t)}Th(n).H_(e)}function uW(n,e){n.Ra.$e(e),Th(n).Y_(e)}function U0(n){n.Ra=new zb({getRemoteKeysForTarget:e=>n.remoteSyncer.getRemoteKeysForTarget(e),Et:e=>n.Ta.get(e)||null,lt:()=>n.datastore.serializer.databaseId}),Th(n).start(),n.Aa.aa()}function V0(n){return bl(n)&&!Th(n).M_()&&n.Ta.size>0}function bl(n){return se(n).Ia.size===0}function dW(n){n.Ra=void 0}function hse(n){return I(this,null,function*(){n.Aa.set("Online")})}function fse(n){return I(this,null,function*(){n.Ta.forEach((e,t)=>{F0(n,e)})})}function pse(n,e){return I(this,null,function*(){dW(n),V0(n)?(n.Aa.la(e),U0(n)):n.Aa.set("Unknown")})}function gse(n,e,t){return I(this,null,function*(){if(n.Aa.set("Online"),e instanceof Sy&&e.state===2&&e.cause)try{yield(function(i,o){return I(this,null,function*(){let s=o.cause;for(let a of o.targetIds)i.Ta.has(a)&&(yield i.remoteSyncer.rejectListen(a,s),i.Ta.delete(a),i.Ra.removeTarget(a))})})(n,e)}catch(r){j(Dl,"Failed to remove targets %s: %s ",e.targetIds.join(","),r),yield $y(n,r)}else if(e instanceof Wd?n.Ra.Ye(e):e instanceof vy?n.Ra.it(e):n.Ra.et(e),!t.isEqual(le.min()))try{let r=yield nW(n.localStore);t.compareTo(r)>=0&&(yield(function(o,s){let a=o.Ra.Pt(s);return a.targetChanges.forEach((c,l)=>{if(c.resumeToken.approximateByteSize()>0){let d=o.Ta.get(l);d&&o.Ta.set(l,d.withResumeToken(c.resumeToken,s))}}),a.targetMismatches.forEach((c,l)=>{let d=o.Ta.get(c);if(!d)return;o.Ta.set(c,d.withResumeToken(Gt.EMPTY_BYTE_STRING,d.snapshotVersion)),uW(o,c);let h=new ch(d.target,c,l,d.sequenceNumber);F0(o,h)}),o.remoteSyncer.applyRemoteEvent(a)})(n,t))}catch(r){j(Dl,"Failed to raise snapshot:",r),yield $y(n,r)}})}function $y(n,e,t){return I(this,null,function*(){if(!Ea(e))throw e;n.Ia.add(1),yield em(n),n.Aa.set("Offline"),t||(t=()=>nW(n.localStore)),n.asyncQueue.enqueueRetryable(()=>I(null,null,function*(){j(Dl,"Retrying IndexedDB access"),yield t(),n.Ia.delete(1),yield hv(n)}))})}function hW(n,e){return e().catch(t=>$y(n,t,e))}function _h(n){return I(this,null,function*(){let e=se(n),t=pa(e),r=e.Pa.length>0?e.Pa[e.Pa.length-1].batchId:gl;for(;mse(e);)try{let i=yield use(e.localStore,r);if(i===null){e.Pa.length===0&&t.B_();break}r=i.batchId,Ese(e,i)}catch(i){yield $y(e,i)}fW(e)&&pW(e)})}function mse(n){return bl(n)&&n.Pa.length<10}function Ese(n,e){n.Pa.push(e);let t=pa(n);t.x_()&&t.Z_&&t.X_(e.mutations)}function fW(n){return bl(n)&&!pa(n).M_()&&n.Pa.length>0}function pW(n){pa(n).start()}function _se(n){return I(this,null,function*(){pa(n).na()})}function Tse(n){return I(this,null,function*(){let e=pa(n);for(let t of n.Pa)e.X_(t.mutations)})}function Ise(n,e,t){return I(this,null,function*(){let r=n.Pa.shift(),i=jb.from(r,e,t);yield hW(n,()=>n.remoteSyncer.applySuccessfulWrite(i)),yield _h(n)})}function yse(n,e){return I(this,null,function*(){e&&pa(n).Z_&&(yield(function(r,i){return I(this,null,function*(){if((function(s){return b3(s)&&s!==x.ABORTED})(i.code)){let o=r.Pa.shift();pa(r).N_(),yield hW(r,()=>r.remoteSyncer.rejectFailedWrite(o.batchId,i)),yield _h(r)}})})(n,e)),fW(n)&&pW(n)})}function S$(n,e){return I(this,null,function*(){let t=se(n);t.asyncQueue.verifyOperationInProgress(),j(Dl,"RemoteStore received new credentials");let r=bl(t);t.Ia.add(3),yield em(t),r&&t.Aa.set("Unknown"),yield t.remoteSyncer.handleCredentialChange(e),t.Ia.delete(3),yield hv(t)})}function GO(n,e){return I(this,null,function*(){let t=se(n);e?(t.Ia.delete(2),yield hv(t)):e||(t.Ia.add(2),yield em(t),t.Aa.set("Unknown"))})}function Th(n){return n.Va||(n.Va=(function(t,r,i){let o=se(t);return o.ia(),new xO(r,o.connection,o.authCredentials,o.appCheckCredentials,o.serializer,i)})(n.datastore,n.asyncQueue,{Zo:hse.bind(null,n),e_:fse.bind(null,n),n_:pse.bind(null,n),J_:gse.bind(null,n)}),n.da.push(e=>I(null,null,function*(){e?(n.Va.N_(),V0(n)?U0(n):n.Aa.set("Unknown")):(yield n.Va.stop(),dW(n))}))),n.Va}function pa(n){return n.ma||(n.ma=(function(t,r,i){let o=se(t);return o.ia(),new kO(r,o.connection,o.authCredentials,o.appCheckCredentials,o.serializer,i)})(n.datastore,n.asyncQueue,{Zo:()=>Promise.resolve(),e_:_se.bind(null,n),n_:yse.bind(null,n),ea:Tse.bind(null,n),ta:Ise.bind(null,n)}),n.da.push(e=>I(null,null,function*(){e?(n.ma.N_(),yield _h(n)):(yield n.ma.stop(),n.Pa.length>0&&(j(Dl,`Stopping write stream with ${n.Pa.length} pending writes`),n.Pa=[]))}))),n.ma}var jO=class n{constructor(e,t,r,i,o){this.asyncQueue=e,this.timerId=t,this.targetTimeMs=r,this.op=i,this.removalCallback=o,this.deferred=new nr,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(s=>{})}get promise(){return this.deferred.promise}static createAndSchedule(e,t,r,i,o){let s=Date.now()+r,a=new n(e,t,s,i,o);return a.start(r),a}start(e){this.timerHandle=setTimeout(()=>this.handleDelayElapsed(),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){this.timerHandle!==null&&(this.clearTimeout(),this.deferred.reject(new G(x.CANCELLED,"Operation cancelled"+(e?": "+e:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget(()=>this.timerHandle!==null?(this.clearTimeout(),this.op().then(e=>this.deferred.resolve(e))):Promise.resolve())}clearTimeout(){this.timerHandle!==null&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}};function B0(n,e){if(Mt("AsyncQueue",`${e}: ${n}`),Ea(n))return new G(x.UNAVAILABLE,`${e}: ${n}`);throw n}var Wy=class n{static emptySet(e){return new n(e.comparator)}constructor(e){this.comparator=e?(t,r)=>e(t,r)||Z.comparator(t.key,r.key):(t,r)=>Z.comparator(t.key,r.key),this.keyedMap=lg(),this.sortedSet=new ft(this.comparator)}has(e){return this.keyedMap.get(e)!=null}get(e){return this.keyedMap.get(e)}first(){return this.sortedSet.minKey()}last(){return this.sortedSet.maxKey()}isEmpty(){return this.sortedSet.isEmpty()}indexOf(e){let t=this.keyedMap.get(e);return t?this.sortedSet.indexOf(t):-1}get size(){return this.sortedSet.size}forEach(e){this.sortedSet.inorderTraversal((t,r)=>(e(t),!1))}add(e){let t=this.delete(e.key);return t.copy(t.keyedMap.insert(e.key,e),t.sortedSet.insert(e,null))}delete(e){let t=this.get(e);return t?this.copy(this.keyedMap.remove(e),this.sortedSet.remove(t)):this}isEqual(e){if(!(e instanceof n)||this.size!==e.size)return!1;let t=this.sortedSet.getIterator(),r=e.sortedSet.getIterator();for(;t.hasNext();){let i=t.getNext().key,o=r.getNext().key;if(!i.isEqual(o))return!1}return!0}toString(){let e=[];return this.forEach(t=>{e.push(t.toString())}),e.length===0?"DocumentSet ()":`DocumentSet (
|
|
171
|
+
`+e.join(`
|
|
172
|
+
`)+`
|
|
173
|
+
)`}copy(e,t){let r=new n;return r.comparator=this.comparator,r.keyedMap=e,r.sortedSet=t,r}};var zy=class{constructor(){this.fa=new ft(Z.comparator)}track(e){let t=e.doc.key,r=this.fa.get(t);r?e.type!==0&&r.type===3?this.fa=this.fa.insert(t,e):e.type===3&&r.type!==1?this.fa=this.fa.insert(t,{type:r.type,doc:e.doc}):e.type===2&&r.type===2?this.fa=this.fa.insert(t,{type:2,doc:e.doc}):e.type===2&&r.type===0?this.fa=this.fa.insert(t,{type:0,doc:e.doc}):e.type===1&&r.type===0?this.fa=this.fa.remove(t):e.type===1&&r.type===2?this.fa=this.fa.insert(t,{type:1,doc:r.doc}):e.type===0&&r.type===1?this.fa=this.fa.insert(t,{type:2,doc:e.doc}):re(63341,{At:e,ga:r}):this.fa=this.fa.insert(t,e)}pa(){let e=[];return this.fa.inorderTraversal((t,r)=>{e.push(r)}),e}},hh=class n{constructor(e,t,r,i,o,s,a,c,l){this.query=e,this.docs=t,this.oldDocs=r,this.docChanges=i,this.mutatedKeys=o,this.fromCache=s,this.syncStateChanged=a,this.excludesMetadataChanges=c,this.hasCachedResults=l}static fromInitialDocuments(e,t,r,i,o){let s=[];return t.forEach(a=>{s.push({type:0,doc:a})}),new n(e,t,Wy.emptySet(t),s,r,i,!0,!1,o)}get hasPendingWrites(){return!this.mutatedKeys.isEmpty()}isEqual(e){if(!(this.fromCache===e.fromCache&&this.hasCachedResults===e.hasCachedResults&&this.syncStateChanged===e.syncStateChanged&&this.mutatedKeys.isEqual(e.mutatedKeys)&&uv(this.query,e.query)&&this.docs.isEqual(e.docs)&&this.oldDocs.isEqual(e.oldDocs)))return!1;let t=this.docChanges,r=e.docChanges;if(t.length!==r.length)return!1;for(let i=0;i<t.length;i++)if(t[i].type!==r[i].type||!t[i].doc.isEqual(r[i].doc))return!1;return!0}};var HO=class{constructor(){this.ya=void 0,this.wa=[]}Sa(){return this.wa.some(e=>e.ba())}},$O=class{constructor(){this.queries=A$(),this.onlineState="Unknown",this.Da=new Set}terminate(){(function(t,r){let i=se(t),o=i.queries;i.queries=A$(),o.forEach((s,a)=>{for(let c of a.wa)c.onError(r)})})(this,new G(x.ABORTED,"Firestore shutting down"))}};function A$(){return new hi(n=>E3(n),uv)}function G0(n,e){return I(this,null,function*(){let t=se(n),r=3,i=e.query,o=t.queries.get(i);o?!o.Sa()&&e.ba()&&(r=2):(o=new HO,r=e.ba()?0:1);try{switch(r){case 0:o.ya=yield t.onListen(i,!0);break;case 1:o.ya=yield t.onListen(i,!1);break;case 2:yield t.onFirstRemoteStoreListen(i)}}catch(s){let a=B0(s,`Initialization of query '${Vd(e.query)}' failed`);return void e.onError(a)}t.queries.set(i,o),o.wa.push(e),e.va(t.onlineState),o.ya&&e.Ca(o.ya)&&H0(t)})}function j0(n,e){return I(this,null,function*(){let t=se(n),r=e.query,i=3,o=t.queries.get(r);if(o){let s=o.wa.indexOf(e);s>=0&&(o.wa.splice(s,1),o.wa.length===0?i=e.ba()?0:1:!o.Sa()&&e.ba()&&(i=2))}switch(i){case 0:return t.queries.delete(r),t.onUnlisten(r,!0);case 1:return t.queries.delete(r),t.onUnlisten(r,!1);case 2:return t.onLastRemoteStoreUnlisten(r);default:return}})}function vse(n,e){let t=se(n),r=!1;for(let i of e){let o=i.query,s=t.queries.get(o);if(s){for(let a of s.wa)a.Ca(i)&&(r=!0);s.ya=i}}r&&H0(t)}function Sse(n,e,t){let r=se(n),i=r.queries.get(e);if(i)for(let o of i.wa)o.onError(t);r.queries.delete(e)}function H0(n){n.Da.forEach(e=>{e.next()})}var WO,C$;(C$=WO||(WO={})).Fa="default",C$.Cache="cache";var Hg=class{constructor(e,t,r){this.query=e,this.Ma=t,this.xa=!1,this.Oa=null,this.onlineState="Unknown",this.options=r||{}}Ca(e){if(!this.options.includeMetadataChanges){let r=[];for(let i of e.docChanges)i.type!==3&&r.push(i);e=new hh(e.query,e.docs,e.oldDocs,r,e.mutatedKeys,e.fromCache,e.syncStateChanged,!0,e.hasCachedResults)}let t=!1;return this.xa?this.Na(e)&&(this.Ma.next(e),t=!0):this.Ba(e,this.onlineState)&&(this.La(e),t=!0),this.Oa=e,t}onError(e){this.Ma.error(e)}va(e){this.onlineState=e;let t=!1;return this.Oa&&!this.xa&&this.Ba(this.Oa,e)&&(this.La(this.Oa),t=!0),t}Ba(e,t){if(!e.fromCache||!this.ba())return!0;let r=t!=="Offline";return(!this.options.ka||!r)&&(!e.docs.isEmpty()||e.hasCachedResults||t==="Offline")}Na(e){if(e.docChanges.length>0)return!0;let t=this.Oa&&this.Oa.hasPendingWrites!==e.hasPendingWrites;return!(!e.syncStateChanged&&!t)&&this.options.includeMetadataChanges===!0}La(e){e=hh.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache,e.hasCachedResults),this.xa=!0,this.Ma.next(e)}ba(){return this.options.source!==WO.Cache}};var qy=class{constructor(e){this.key=e}},Ky=class{constructor(e){this.key=e}},zO=class{constructor(e,t){this.query=e,this.Ha=t,this.Ya=null,this.hasCachedResults=!1,this.current=!1,this.Za=be(),this.mutatedKeys=be(),this.Xa=T3(e),this.eu=new Wy(this.Xa)}get tu(){return this.Ha}nu(e,t){let r=t?t.ru:new zy,i=t?t.eu:this.eu,o=t?t.mutatedKeys:this.mutatedKeys,s=i,a=!1,c=this.query.limitType==="F"&&i.size===this.query.limit?i.last():null,l=this.query.limitType==="L"&&i.size===this.query.limit?i.first():null;if(e.inorderTraversal((d,h)=>{let f=i.get(d),g=Zg(this.query,h)?h:null,E=!!f&&this.mutatedKeys.has(f.key),v=!!g&&(g.hasLocalMutations||this.mutatedKeys.has(g.key)&&g.hasCommittedMutations),S=!1;f&&g?f.data.isEqual(g.data)?E!==v&&(r.track({type:3,doc:g}),S=!0):this.iu(f,g)||(r.track({type:2,doc:g}),S=!0,(c&&this.Xa(g,c)>0||l&&this.Xa(g,l)<0)&&(a=!0)):!f&&g?(r.track({type:0,doc:g}),S=!0):f&&!g&&(r.track({type:1,doc:f}),S=!0,(c||l)&&(a=!0)),S&&(g?(s=s.add(g),o=v?o.add(d):o.delete(d)):(s=s.delete(d),o=o.delete(d)))}),this.query.limit!==null)for(;s.size>this.query.limit;){let d=this.query.limitType==="F"?s.last():s.first();s=s.delete(d.key),o=o.delete(d.key),r.track({type:1,doc:d})}return{eu:s,ru:r,Ds:a,mutatedKeys:o}}iu(e,t){return e.hasLocalMutations&&t.hasCommittedMutations&&!t.hasLocalMutations}applyChanges(e,t,r,i){let o=this.eu;this.eu=e.eu,this.mutatedKeys=e.mutatedKeys;let s=e.ru.pa();s.sort((d,h)=>(function(g,E){let v=S=>{switch(S){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return re(20277,{At:S})}};return v(g)-v(E)})(d.type,h.type)||this.Xa(d.doc,h.doc)),this.su(r),i=i!=null&&i;let a=t&&!i?this.ou():[],c=this.Za.size===0&&this.current&&!i?1:0,l=c!==this.Ya;return this.Ya=c,s.length!==0||l?{snapshot:new hh(this.query,e.eu,o,s,e.mutatedKeys,c===0,l,!1,!!r&&r.resumeToken.approximateByteSize()>0),_u:a}:{_u:a}}va(e){return this.current&&e==="Offline"?(this.current=!1,this.applyChanges({eu:this.eu,ru:new zy,mutatedKeys:this.mutatedKeys,Ds:!1},!1)):{_u:[]}}au(e){return!this.Ha.has(e)&&!!this.eu.has(e)&&!this.eu.get(e).hasLocalMutations}su(e){e&&(e.addedDocuments.forEach(t=>this.Ha=this.Ha.add(t)),e.modifiedDocuments.forEach(t=>{}),e.removedDocuments.forEach(t=>this.Ha=this.Ha.delete(t)),this.current=e.current)}ou(){if(!this.current)return[];let e=this.Za;this.Za=be(),this.eu.forEach(r=>{this.au(r.key)&&(this.Za=this.Za.add(r.key))});let t=[];return e.forEach(r=>{this.Za.has(r)||t.push(new Ky(r))}),this.Za.forEach(r=>{e.has(r)||t.push(new qy(r))}),t}uu(e){this.Ha=e.qs,this.Za=be();let t=this.nu(e.documents);return this.applyChanges(t,!0)}cu(){return hh.fromInitialDocuments(this.query,this.eu,this.mutatedKeys,this.Ya===0,this.hasCachedResults)}},Ih="SyncEngine",qO=class{constructor(e,t,r){this.query=e,this.targetId=t,this.view=r}},KO=class{constructor(e){this.key=e,this.lu=!1}},YO=class{constructor(e,t,r,i,o,s){this.localStore=e,this.remoteStore=t,this.eventManager=r,this.sharedClientState=i,this.currentUser=o,this.maxConcurrentLimboResolutions=s,this.hu={},this.Pu=new hi(a=>E3(a),uv),this.Tu=new Map,this.Iu=new Set,this.du=new ft(Z.comparator),this.Eu=new Map,this.Au=new Vg,this.Ru={},this.Vu=new Map,this.mu=lh.ur(),this.onlineState="Unknown",this.fu=void 0}get isPrimaryClient(){return this.fu===!0}};function Ase(n,e,t=!0){return I(this,null,function*(){let r=pv(n),i,o=r.Pu.get(e);return o?(r.sharedClientState.addLocalQueryTarget(o.targetId),i=o.view.cu()):i=yield gW(r,e,t,!0),i})}function Cse(n,e){return I(this,null,function*(){let t=pv(n);yield gW(t,e,!0,!1)})}function gW(n,e,t,r){return I(this,null,function*(){let i=yield Uy(n.localStore,Cr(e)),o=i.targetId,s=n.sharedClientState.addLocalQueryTarget(o,t),a;return r&&(a=yield $0(n,e,o,s==="current",i.resumeToken)),n.isPrimaryClient&&t&&fv(n.remoteStore,i),a})}function $0(n,e,t,r,i){return I(this,null,function*(){n.gu=(h,f,g)=>(function(v,S,P,V){return I(this,null,function*(){let K=S.view.nu(P);K.Ds&&(K=yield NO(v.localStore,S.query,!1).then(({documents:C})=>S.view.nu(C,K)));let oe=V&&V.targetChanges.get(S.targetId),ge=V&&V.targetMismatches.get(S.targetId)!=null,te=S.view.applyChanges(K,v.isPrimaryClient,oe,ge);return XO(v,S.targetId,te._u),te.snapshot})})(n,h,f,g);let o=yield NO(n.localStore,e,!0),s=new zO(e,o.qs),a=s.nu(o.documents),c=xg.createSynthesizedTargetChangeForCurrentChange(t,r&&n.onlineState!=="Offline",i),l=s.applyChanges(a,n.isPrimaryClient,c);XO(n,t,l._u);let d=new qO(e,t,s);return n.Pu.set(e,d),n.Tu.has(t)?n.Tu.get(t).push(e):n.Tu.set(t,[e]),l.snapshot})}function Dse(n,e,t){return I(this,null,function*(){let r=se(n),i=r.Pu.get(e),o=r.Tu.get(i.targetId);if(o.length>1)return r.Tu.set(i.targetId,o.filter(s=>!uv(s,e))),void r.Pu.delete(e);r.isPrimaryClient?(r.sharedClientState.removeLocalQueryTarget(i.targetId),r.sharedClientState.isActiveQueryTarget(i.targetId)||(yield uh(r.localStore,i.targetId,!1).then(()=>{r.sharedClientState.clearQueryState(i.targetId),t&&dh(r.remoteStore,i.targetId),fh(r,i.targetId)}).catch(ma))):(fh(r,i.targetId),yield uh(r.localStore,i.targetId,!0))})}function Rse(n,e){return I(this,null,function*(){let t=se(n),r=t.Pu.get(e),i=t.Tu.get(r.targetId);t.isPrimaryClient&&i.length===1&&(t.sharedClientState.removeLocalQueryTarget(r.targetId),dh(t.remoteStore,r.targetId))})}function Nse(n,e,t){return I(this,null,function*(){let r=K0(n);try{let i=yield(function(s,a){let c=se(s),l=_t.now(),d=a.reduce((g,E)=>g.add(E.key),be()),h,f;return c.persistence.runTransaction("Locally write mutations","readwrite",g=>{let E=Ar(),v=be();return c.Os.getEntries(g,d).next(S=>{E=S,E.forEach((P,V)=>{V.isValidDocument()||(v=v.add(P))})}).next(()=>c.localDocuments.getOverlayedDocuments(g,E)).next(S=>{h=S;let P=[];for(let V of a){let K=Boe(V,h.get(V.key).overlayedDocument);K!=null&&P.push(new fi(V.key,K,l3(K.value.mapValue),_n.exists(!0)))}return c.mutationQueue.addMutationBatch(g,l,P,a)}).next(S=>{f=S;let P=S.applyToLocalDocumentSet(h,v);return c.documentOverlayCache.saveOverlays(g,S.batchId,P)})}).then(()=>({batchId:f.batchId,changes:y3(h)}))})(r.localStore,e);r.sharedClientState.addPendingMutation(i.batchId),(function(s,a,c){let l=s.Ru[s.currentUser.toKey()];l||(l=new ft(Ie)),l=l.insert(a,c),s.Ru[s.currentUser.toKey()]=l})(r,i.batchId,t),yield Ta(r,i.changes),yield _h(r.remoteStore)}catch(i){let o=B0(i,"Failed to persist write");t.reject(o)}})}function mW(n,e){return I(this,null,function*(){let t=se(n);try{let r=yield cse(t.localStore,e);e.targetChanges.forEach((i,o)=>{let s=t.Eu.get(o);s&&(ae(i.addedDocuments.size+i.modifiedDocuments.size+i.removedDocuments.size<=1,22616),i.addedDocuments.size>0?s.lu=!0:i.modifiedDocuments.size>0?ae(s.lu,14607):i.removedDocuments.size>0&&(ae(s.lu,42227),s.lu=!1))}),yield Ta(t,r,e)}catch(r){yield ma(r)}})}function D$(n,e,t){let r=se(n);if(r.isPrimaryClient&&t===0||!r.isPrimaryClient&&t===1){let i=[];r.Pu.forEach((o,s)=>{let a=s.view.va(e);a.snapshot&&i.push(a.snapshot)}),(function(s,a){let c=se(s);c.onlineState=a;let l=!1;c.queries.forEach((d,h)=>{for(let f of h.wa)f.va(a)&&(l=!0)}),l&&H0(c)})(r.eventManager,e),i.length&&r.hu.J_(i),r.onlineState=e,r.isPrimaryClient&&r.sharedClientState.setOnlineState(e)}}function wse(n,e,t){return I(this,null,function*(){let r=se(n);r.sharedClientState.updateQueryState(e,"rejected",t);let i=r.Eu.get(e),o=i&&i.key;if(o){let s=new ft(Z.comparator);s=s.insert(o,Jt.newNoDocument(o,le.min()));let a=be().add(o),c=new Pg(le.min(),new Map,new ft(Ie),s,a);yield mW(r,c),r.du=r.du.remove(o),r.Eu.delete(e),q0(r)}else yield uh(r.localStore,e,!1).then(()=>fh(r,e,t)).catch(ma)})}function bse(n,e){return I(this,null,function*(){let t=se(n),r=e.batch.batchId;try{let i=yield ase(t.localStore,e);z0(t,r,null),W0(t,r),t.sharedClientState.updateMutationState(r,"acknowledged"),yield Ta(t,i)}catch(i){yield ma(i)}})}function Ose(n,e,t){return I(this,null,function*(){let r=se(n);try{let i=yield(function(s,a){let c=se(s);return c.persistence.runTransaction("Reject batch","readwrite-primary",l=>{let d;return c.mutationQueue.lookupMutationBatch(l,a).next(h=>(ae(h!==null,37113),d=h.keys(),c.mutationQueue.removeMutationBatch(l,h))).next(()=>c.mutationQueue.performConsistencyCheck(l)).next(()=>c.documentOverlayCache.removeOverlaysForBatchId(l,d,a)).next(()=>c.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(l,d)).next(()=>c.localDocuments.getDocuments(l,d))})})(r.localStore,e);z0(r,e,t),W0(r,e),r.sharedClientState.updateMutationState(e,"rejected",t),yield Ta(r,i)}catch(i){yield ma(i)}})}function W0(n,e){(n.Vu.get(e)||[]).forEach(t=>{t.resolve()}),n.Vu.delete(e)}function z0(n,e,t){let r=se(n),i=r.Ru[r.currentUser.toKey()];if(i){let o=i.get(e);o&&(t?o.reject(t):o.resolve(),i=i.remove(e)),r.Ru[r.currentUser.toKey()]=i}}function fh(n,e,t=null){n.sharedClientState.removeLocalQueryTarget(e);for(let r of n.Tu.get(e))n.Pu.delete(r),t&&n.hu.pu(r,t);n.Tu.delete(e),n.isPrimaryClient&&n.Au.zr(e).forEach(r=>{n.Au.containsKey(r)||EW(n,r)})}function EW(n,e){n.Iu.delete(e.path.canonicalString());let t=n.du.get(e);t!==null&&(dh(n.remoteStore,t),n.du=n.du.remove(e),n.Eu.delete(t),q0(n))}function XO(n,e,t){for(let r of t)r instanceof qy?(n.Au.addReference(r.key,e),Mse(n,r)):r instanceof Ky?(j(Ih,"Document no longer in limbo: "+r.key),n.Au.removeReference(r.key,e),n.Au.containsKey(r.key)||EW(n,r.key)):re(19791,{yu:r})}function Mse(n,e){let t=e.key,r=t.path.canonicalString();n.du.get(t)||n.Iu.has(r)||(j(Ih,"New document in limbo: "+t),n.Iu.add(r),q0(n))}function q0(n){for(;n.Iu.size>0&&n.du.size<n.maxConcurrentLimboResolutions;){let e=n.Iu.values().next().value;n.Iu.delete(e);let t=new Z(ke.fromString(e)),r=n.mu.next();n.Eu.set(r,new KO(t)),n.du=n.du.insert(t,r),fv(n.remoteStore,new ch(Cr(Jg(t.path)),r,"TargetPurposeLimboResolution",vr.ue))}}function Ta(n,e,t){return I(this,null,function*(){let r=se(n),i=[],o=[],s=[];r.Pu.isEmpty()||(r.Pu.forEach((a,c)=>{s.push(r.gu(c,e,t).then(l=>{var d;if((l||t)&&r.isPrimaryClient){let h=l?!l.fromCache:(d=t?.targetChanges.get(c.targetId))===null||d===void 0?void 0:d.current;r.sharedClientState.updateQueryState(c.targetId,h?"current":"not-current")}if(l){i.push(l);let h=CO.Es(c.targetId,l);o.push(h)}}))}),yield Promise.all(s),r.hu.J_(i),yield(function(c,l){return I(this,null,function*(){let d=se(c);try{yield d.persistence.runTransaction("notifyLocalViewChanges","readwrite",h=>L.forEach(l,f=>L.forEach(f.Is,g=>d.persistence.referenceDelegate.addReference(h,f.targetId,g)).next(()=>L.forEach(f.ds,g=>d.persistence.referenceDelegate.removeReference(h,f.targetId,g)))))}catch(h){if(!Ea(h))throw h;j(k0,"Failed to update sequence numbers: "+h)}for(let h of l){let f=h.targetId;if(!h.fromCache){let g=d.Fs.get(f),E=g.snapshotVersion,v=g.withLastLimboFreeSnapshotVersion(E);d.Fs=d.Fs.insert(f,v)}}})})(r.localStore,o))})}function Lse(n,e){return I(this,null,function*(){let t=se(n);if(!t.currentUser.isEqual(e)){j(Ih,"User change. New user:",e.toKey());let r=yield tW(t.localStore,e);t.currentUser=e,(function(o,s){o.Vu.forEach(a=>{a.forEach(c=>{c.reject(new G(x.CANCELLED,s))})}),o.Vu.clear()})(t,"'waitForPendingWrites' promise is rejected due to a user change."),t.sharedClientState.handleUserChange(e,r.removedBatchIds,r.addedBatchIds),yield Ta(t,r.Bs)}})}function Pse(n,e){let t=se(n),r=t.Eu.get(e);if(r&&r.lu)return be().add(r.key);{let i=be(),o=t.Tu.get(e);if(!o)return i;for(let s of o){let a=t.Pu.get(s);i=i.unionWith(a.view.tu)}return i}}function xse(n,e){return I(this,null,function*(){let t=se(n),r=yield NO(t.localStore,e.query,!0),i=e.view.uu(r);return t.isPrimaryClient&&XO(t,e.targetId,i._u),i})}function kse(n,e){return I(this,null,function*(){let t=se(n);return iW(t.localStore,e).then(r=>Ta(t,r))})}function Fse(n,e,t,r){return I(this,null,function*(){let i=se(n),o=yield(function(a,c){let l=se(a),d=se(l.mutationQueue);return l.persistence.runTransaction("Lookup mutation documents","readonly",h=>d.Xn(h,c).next(f=>f?l.localDocuments.getDocuments(h,f):L.resolve(null)))})(i.localStore,e);o!==null?(t==="pending"?yield _h(i.remoteStore):t==="acknowledged"||t==="rejected"?(z0(i,e,r||null),W0(i,e),(function(a,c){se(se(a).mutationQueue).rr(c)})(i.localStore,e)):re(6720,"Unknown batchState",{wu:t}),yield Ta(i,o)):j(Ih,"Cannot apply mutation batch with id: "+e)})}function Use(n,e){return I(this,null,function*(){let t=se(n);if(pv(t),K0(t),e===!0&&t.fu!==!0){let r=t.sharedClientState.getAllActiveQueryTargets(),i=yield R$(t,r.toArray());t.fu=!0,yield GO(t.remoteStore,!0);for(let o of i)fv(t.remoteStore,o)}else if(e===!1&&t.fu!==!1){let r=[],i=Promise.resolve();t.Tu.forEach((o,s)=>{t.sharedClientState.isLocalQueryTarget(s)?r.push(s):i=i.then(()=>(fh(t,s),uh(t.localStore,s,!0))),dh(t.remoteStore,s)}),yield i,yield R$(t,r),(function(s){let a=se(s);a.Eu.forEach((c,l)=>{dh(a.remoteStore,l)}),a.Au.jr(),a.Eu=new Map,a.du=new ft(Z.comparator)})(t),t.fu=!1,yield GO(t.remoteStore,!1)}})}function R$(n,e,t){return I(this,null,function*(){let r=se(n),i=[],o=[];for(let s of e){let a,c=r.Tu.get(s);if(c&&c.length!==0){a=yield Uy(r.localStore,Cr(c[0]));for(let l of c){let d=r.Pu.get(l),h=yield xse(r,d);h.snapshot&&o.push(h.snapshot)}}else{let l=yield rW(r.localStore,s);a=yield Uy(r.localStore,l),yield $0(r,_W(l),s,!1,a.resumeToken)}i.push(a)}return r.hu.J_(o),i})}function _W(n){return g3(n.path,n.collectionGroup,n.orderBy,n.filters,n.limit,"F",n.startAt,n.endAt)}function Vse(n){return(function(t){return se(se(t).persistence).Ps()})(se(n).localStore)}function Bse(n,e,t,r){return I(this,null,function*(){let i=se(n);if(i.fu)return void j(Ih,"Ignoring unexpected query state notification.");let o=i.Tu.get(e);if(o&&o.length>0)switch(t){case"current":case"not-current":{let s=yield iW(i.localStore,_3(o[0])),a=Pg.createSynthesizedRemoteEventForCurrentChange(e,t==="current",Gt.EMPTY_BYTE_STRING);yield Ta(i,s,a);break}case"rejected":yield uh(i.localStore,e,!0),fh(i,e,r);break;default:re(64155,t)}})}function Gse(n,e,t){return I(this,null,function*(){let r=pv(n);if(r.fu){for(let i of e){if(r.Tu.has(i)&&r.sharedClientState.isActiveQueryTarget(i)){j(Ih,"Adding an already active target "+i);continue}let o=yield rW(r.localStore,i),s=yield Uy(r.localStore,o);yield $0(r,_W(o),s.targetId,!1,s.resumeToken),fv(r.remoteStore,s)}for(let i of t)r.Tu.has(i)&&(yield uh(r.localStore,i,!1).then(()=>{dh(r.remoteStore,i),fh(r,i)}).catch(ma))}})}function pv(n){let e=se(n);return e.remoteStore.remoteSyncer.applyRemoteEvent=mW.bind(null,e),e.remoteStore.remoteSyncer.getRemoteKeysForTarget=Pse.bind(null,e),e.remoteStore.remoteSyncer.rejectListen=wse.bind(null,e),e.hu.J_=vse.bind(null,e.eventManager),e.hu.pu=Sse.bind(null,e.eventManager),e}function K0(n){let e=se(n);return e.remoteStore.remoteSyncer.applySuccessfulWrite=bse.bind(null,e),e.remoteStore.remoteSyncer.rejectFailedWrite=Ose.bind(null,e),e}var Y0=(()=>{class n{constructor(){this.kind="memory",this.synchronizeTabs=!1}initialize(t){return I(this,null,function*(){this.serializer=dv(t.databaseInfo.databaseId),this.sharedClientState=this.bu(t),this.persistence=this.Du(t),yield this.persistence.start(),this.localStore=this.vu(t),this.gcScheduler=this.Cu(t,this.localStore),this.indexBackfillerScheduler=this.Fu(t,this.localStore)})}Cu(t,r){return null}Fu(t,r){return null}vu(t){return eW(this.persistence,new Fy,t.initialUser,this.serializer)}Du(t){return new Bg(xy.Vi,this.serializer)}bu(t){return new Gy}terminate(){return I(this,null,function*(){var t,r;(t=this.gcScheduler)===null||t===void 0||t.stop(),(r=this.indexBackfillerScheduler)===null||r===void 0||r.stop(),this.sharedClientState.shutdown(),yield this.persistence.shutdown()})}}return n.provider={build:()=>new n},n})(),QO=class extends Y0{constructor(e){super(),this.cacheSizeBytes=e}Cu(e,t){ae(this.persistence.referenceDelegate instanceof ky,46915);let r=this.persistence.referenceDelegate.garbageCollector;return new My(r,e.asyncQueue,t)}Du(e){let t=this.cacheSizeBytes!==void 0?tr.withCacheSize(this.cacheSizeBytes):tr.DEFAULT;return new Bg(r=>ky.Vi(r,t),this.serializer)}},Yy=class n extends Y0{constructor(e,t,r){super(),this.Mu=e,this.cacheSizeBytes=t,this.forceOwnership=r,this.kind="persistent",this.synchronizeTabs=!1}initialize(e){return I(this,null,function*(){yield xa(n.prototype,this,"initialize").call(this,e),yield this.Mu.initialize(this,e),yield K0(this.Mu.syncEngine),yield _h(this.Mu.remoteStore),yield this.persistence.ji(()=>(this.gcScheduler&&!this.gcScheduler.started&&this.gcScheduler.start(),this.indexBackfillerScheduler&&!this.indexBackfillerScheduler.started&&this.indexBackfillerScheduler.start(),Promise.resolve()))})}vu(e){return eW(this.persistence,new Fy,e.initialUser,this.serializer)}Cu(e,t){let r=this.persistence.referenceDelegate.garbageCollector;return new My(r,e.asyncQueue,t)}Fu(e,t){let r=new vb(t,this.persistence);return new yb(e.asyncQueue,r)}Du(e){let t=Z3(e.databaseInfo.databaseId,e.databaseInfo.persistenceKey),r=this.cacheSizeBytes!==void 0?tr.withCacheSize(this.cacheSizeBytes):tr.DEFAULT;return new AO(this.synchronizeTabs,t,e.clientId,r,e.asyncQueue,lW(),sy(),this.serializer,this.sharedClientState,!!this.forceOwnership)}bu(e){return new Gy}},JO=class n extends Yy{constructor(e,t){super(e,t,!1),this.Mu=e,this.cacheSizeBytes=t,this.synchronizeTabs=!0}initialize(e){return I(this,null,function*(){yield xa(n.prototype,this,"initialize").call(this,e);let t=this.Mu.syncEngine;this.sharedClientState instanceof Tg&&(this.sharedClientState.syncEngine={Do:Fse.bind(null,t),vo:Bse.bind(null,t),Co:Gse.bind(null,t),Ps:Vse.bind(null,t),bo:kse.bind(null,t)},yield this.sharedClientState.start()),yield this.persistence.ji(r=>I(this,null,function*(){yield Use(this.Mu.syncEngine,r),this.gcScheduler&&(r&&!this.gcScheduler.started?this.gcScheduler.start():r||this.gcScheduler.stop()),this.indexBackfillerScheduler&&(r&&!this.indexBackfillerScheduler.started?this.indexBackfillerScheduler.start():r||this.indexBackfillerScheduler.stop())}))})}bu(e){let t=lW();if(!Tg.C(t))throw new G(x.UNIMPLEMENTED,"IndexedDB persistence is only available on platforms that support LocalStorage.");let r=Z3(e.databaseInfo.databaseId,e.databaseInfo.persistenceKey);return new Tg(t,e.asyncQueue,r,e.clientId,e.initialUser)}},X0=(()=>{class n{initialize(t,r){return I(this,null,function*(){this.localStore||(this.localStore=t.localStore,this.sharedClientState=t.sharedClientState,this.datastore=this.createDatastore(r),this.remoteStore=this.createRemoteStore(r),this.eventManager=this.createEventManager(r),this.syncEngine=this.createSyncEngine(r,!t.synchronizeTabs),this.sharedClientState.onlineStateHandler=i=>D$(this.syncEngine,i,1),this.remoteStore.remoteSyncer.handleCredentialChange=Lse.bind(null,this.syncEngine),yield GO(this.remoteStore,this.syncEngine.isPrimaryClient))})}createEventManager(t){return(function(){return new $O})()}createDatastore(t){let r=dv(t.databaseInfo.databaseId),i=(function(s){return new PO(s)})(t.databaseInfo);return(function(s,a,c,l){return new UO(s,a,c,l)})(t.authCredentials,t.appCheckCredentials,i,r)}createRemoteStore(t){return(function(i,o,s,a,c){return new BO(i,o,s,a,c)})(this.localStore,this.datastore,t.asyncQueue,r=>D$(this.syncEngine,r,0),(function(){return jy.C()?new jy:new bO})())}createSyncEngine(t,r){return(function(o,s,a,c,l,d,h){let f=new YO(o,s,a,c,l,d);return h&&(f.fu=!0),f})(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,t.initialUser,t.maxConcurrentLimboResolutions,r)}terminate(){return I(this,null,function*(){var t,r;yield(function(o){return I(this,null,function*(){let s=se(o);j(Dl,"RemoteStore shutting down."),s.Ia.add(5),yield em(s),s.Ea.shutdown(),s.Aa.set("Unknown")})})(this.remoteStore),(t=this.datastore)===null||t===void 0||t.terminate(),(r=this.eventManager)===null||r===void 0||r.terminate()})}}return n.provider={build:()=>new n},n})();var $g=class{constructor(e){this.observer=e,this.muted=!1}next(e){this.muted||this.observer.next&&this.xu(this.observer.next,e)}error(e){this.muted||(this.observer.error?this.xu(this.observer.error,e):Mt("Uncaught Error in snapshot listener:",e.toString()))}Ou(){this.muted=!0}xu(e,t){setTimeout(()=>{this.muted||e(t)},0)}};var ZO=class{constructor(e){this.datastore=e,this.readVersions=new Map,this.mutations=[],this.committed=!1,this.lastTransactionError=null,this.writtenDocs=new Set}lookup(e){return I(this,null,function*(){if(this.ensureCommitNotCalled(),this.mutations.length>0)throw this.lastTransactionError=new G(x.INVALID_ARGUMENT,"Firestore transactions require all reads to be executed before all writes."),this.lastTransactionError;let t=yield(function(i,o){return I(this,null,function*(){let s=se(i),a={documents:o.map(h=>kg(s.serializer,h))},c=yield s.Jo("BatchGetDocuments",s.serializer.databaseId,ke.emptyPath(),a,o.length),l=new Map;c.forEach(h=>{let f=qoe(s.serializer,h);l.set(f.key.toString(),f)});let d=[];return o.forEach(h=>{let f=l.get(h.toString());ae(!!f,55234,{key:h}),d.push(f)}),d})})(this.datastore,e);return t.forEach(r=>this.recordVersion(r)),t})}set(e,t){this.write(t.toMutation(e,this.precondition(e))),this.writtenDocs.add(e.toString())}update(e,t){try{this.write(t.toMutation(e,this.preconditionForUpdate(e)))}catch(r){this.lastTransactionError=r}this.writtenDocs.add(e.toString())}delete(e){this.write(new Sl(e,this.precondition(e))),this.writtenDocs.add(e.toString())}commit(){return I(this,null,function*(){if(this.ensureCommitNotCalled(),this.lastTransactionError)throw this.lastTransactionError;let e=this.readVersions;this.mutations.forEach(t=>{e.delete(t.key.toString())}),e.forEach((t,r)=>{let i=Z.fromPath(r);this.mutations.push(new Og(i,this.precondition(i)))}),yield(function(r,i){return I(this,null,function*(){let o=se(r),s={writes:i.map(a=>Fg(o.serializer,a))};yield o.Wo("Commit",o.serializer.databaseId,ke.emptyPath(),s)})})(this.datastore,this.mutations),this.committed=!0})}recordVersion(e){let t;if(e.isFoundDocument())t=e.version;else{if(!e.isNoDocument())throw re(50498,{Wu:e.constructor.name});t=le.min()}let r=this.readVersions.get(e.key.toString());if(r){if(!t.isEqual(r))throw new G(x.ABORTED,"Document version changed between two reads.")}else this.readVersions.set(e.key.toString(),t)}precondition(e){let t=this.readVersions.get(e.toString());return!this.writtenDocs.has(e.toString())&&t?t.isEqual(le.min())?_n.exists(!1):_n.updateTime(t):_n.none()}preconditionForUpdate(e){let t=this.readVersions.get(e.toString());if(!this.writtenDocs.has(e.toString())&&t){if(t.isEqual(le.min()))throw new G(x.INVALID_ARGUMENT,"Can't update a document that doesn't exist.");return _n.updateTime(t)}return _n.exists(!0)}write(e){this.ensureCommitNotCalled(),this.mutations.push(e)}ensureCommitNotCalled(){}};var e0=class{constructor(e,t,r,i,o){this.asyncQueue=e,this.datastore=t,this.options=r,this.updateFunction=i,this.deferred=o,this.Gu=r.maxAttempts,this.F_=new jg(this.asyncQueue,"transaction_retry")}zu(){this.Gu-=1,this.ju()}ju(){this.F_.g_(()=>I(this,null,function*(){let e=new ZO(this.datastore),t=this.Ju(e);t&&t.then(r=>{this.asyncQueue.enqueueAndForget(()=>e.commit().then(()=>{this.deferred.resolve(r)}).catch(i=>{this.Hu(i)}))}).catch(r=>{this.Hu(r)})}))}Ju(e){try{let t=this.updateFunction(e);return!Yg(t)&&t.catch&&t.then?t:(this.deferred.reject(Error("Transaction callback must return a Promise")),null)}catch(t){return this.deferred.reject(t),null}}Hu(e){this.Gu>0&&this.Yu(e)?(this.Gu-=1,this.asyncQueue.enqueueAndForget(()=>(this.ju(),Promise.resolve()))):this.deferred.reject(e)}Yu(e){if(e.name==="FirebaseError"){let t=e.code;return t==="aborted"||t==="failed-precondition"||t==="already-exists"||!b3(t)}return!1}};var ga="FirestoreClient",t0=class{constructor(e,t,r,i,o){this.authCredentials=e,this.appCheckCredentials=t,this.asyncQueue=r,this.databaseInfo=i,this.user=Vt.UNAUTHENTICATED,this.clientId=Ig.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this._uninitializedComponentsProvider=o,this.authCredentials.start(r,s=>I(this,null,function*(){j(ga,"Received user=",s.uid),yield this.authCredentialListener(s),this.user=s})),this.appCheckCredentials.start(r,s=>(j(ga,"Received new app check token=",s),this.appCheckCredentialListener(s,this.user)))}get configuration(){return{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,authCredentials:this.authCredentials,appCheckCredentials:this.appCheckCredentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(e){this.authCredentialListener=e}setAppCheckTokenChangeListener(e){this.appCheckCredentialListener=e}terminate(){this.asyncQueue.enterRestrictedMode();let e=new nr;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted(()=>I(this,null,function*(){try{this._onlineComponents&&(yield this._onlineComponents.terminate()),this._offlineComponents&&(yield this._offlineComponents.terminate()),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),e.resolve()}catch(t){let r=B0(t,"Failed to shutdown persistence");e.reject(r)}})),e.promise}};function ub(n,e){return I(this,null,function*(){n.asyncQueue.verifyOperationInProgress(),j(ga,"Initializing OfflineComponentProvider");let t=n.configuration;yield e.initialize(t);let r=t.initialUser;n.setCredentialChangeListener(i=>I(null,null,function*(){r.isEqual(i)||(yield tW(e.localStore,i),r=i)})),e.persistence.setDatabaseDeletedListener(()=>{qo("Terminating Firestore due to IndexedDb database deletion"),n.terminate().then(()=>{j("Terminating Firestore due to IndexedDb database deletion completed successfully")}).catch(i=>{qo("Terminating Firestore due to IndexedDb database deletion failed",i)})}),n._offlineComponents=e})}function N$(n,e){return I(this,null,function*(){n.asyncQueue.verifyOperationInProgress();let t=yield jse(n);j(ga,"Initializing OnlineComponentProvider"),yield e.initialize(t,n.configuration),n.setCredentialChangeListener(r=>S$(e.remoteStore,r)),n.setAppCheckTokenChangeListener((r,i)=>S$(e.remoteStore,i)),n._onlineComponents=e})}function jse(n){return I(this,null,function*(){if(!n._offlineComponents)if(n._uninitializedComponentsProvider){j(ga,"Using user provided OfflineComponentProvider");try{yield ub(n,n._uninitializedComponentsProvider._offline)}catch(e){let t=e;if(!(function(i){return i.name==="FirebaseError"?i.code===x.FAILED_PRECONDITION||i.code===x.UNIMPLEMENTED:!(typeof DOMException<"u"&&i instanceof DOMException)||i.code===22||i.code===20||i.code===11})(t))throw t;qo("Error using user provided cache. Falling back to memory cache: "+t),yield ub(n,new Y0)}}else j(ga,"Using default OfflineComponentProvider"),yield ub(n,new QO(void 0));return n._offlineComponents})}function Q0(n){return I(this,null,function*(){return n._onlineComponents||(n._uninitializedComponentsProvider?(j(ga,"Using user provided OnlineComponentProvider"),yield N$(n,n._uninitializedComponentsProvider._online)):(j(ga,"Using default OnlineComponentProvider"),yield N$(n,new X0))),n._onlineComponents})}function Hse(n){return Q0(n).then(e=>e.syncEngine)}function TW(n){return Q0(n).then(e=>e.datastore)}function Xy(n){return I(this,null,function*(){let e=yield Q0(n),t=e.eventManager;return t.onListen=Ase.bind(null,e.syncEngine),t.onUnlisten=Dse.bind(null,e.syncEngine),t.onFirstRemoteStoreListen=Cse.bind(null,e.syncEngine),t.onLastRemoteStoreUnlisten=Rse.bind(null,e.syncEngine),t})}function $se(n,e,t={}){let r=new nr;return n.asyncQueue.enqueueAndForget(()=>I(null,null,function*(){return(function(o,s,a,c,l){let d=new $g({next:f=>{d.Ou(),s.enqueueAndForget(()=>j0(o,h));let g=f.docs.has(a);!g&&f.fromCache?l.reject(new G(x.UNAVAILABLE,"Failed to get document because the client is offline.")):g&&f.fromCache&&c&&c.source==="server"?l.reject(new G(x.UNAVAILABLE,'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')):l.resolve(f)},error:f=>l.reject(f)}),h=new Hg(Jg(a.path),d,{includeMetadataChanges:!0,ka:!0});return G0(o,h)})(yield Xy(n),n.asyncQueue,e,t,r)})),r.promise}function Wse(n,e,t={}){let r=new nr;return n.asyncQueue.enqueueAndForget(()=>I(null,null,function*(){return(function(o,s,a,c,l){let d=new $g({next:f=>{d.Ou(),s.enqueueAndForget(()=>j0(o,h)),f.fromCache&&c.source==="server"?l.reject(new G(x.UNAVAILABLE,'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')):l.resolve(f)},error:f=>l.reject(f)}),h=new Hg(a,d,{includeMetadataChanges:!0,ka:!0});return G0(o,h)})(yield Xy(n),n.asyncQueue,e,t,r)})),r.promise}function zse(n,e,t){let r=new nr;return n.asyncQueue.enqueueAndForget(()=>I(null,null,function*(){try{let i=yield TW(n);r.resolve((function(s,a,c){return I(this,null,function*(){var l;let d=se(s),{request:h,ft:f,parent:g}=Xoe(d.serializer,woe(a),c);d.connection.Qo||delete h.parent;let E=(yield d.Jo("RunAggregationQuery",d.serializer.databaseId,g,h,1)).filter(S=>!!S.result);ae(E.length===1,64727);let v=(l=E[0].result)===null||l===void 0?void 0:l.aggregateFields;return Object.keys(v).reduce((S,P)=>(S[f[P]]=v[P],S),{})})})(i,e,t))}catch(i){r.reject(i)}})),r.promise}function IW(n){let e={};return n.timeoutSeconds!==void 0&&(e.timeoutSeconds=n.timeoutSeconds),e}var w$=new Map;var yW="firestore.googleapis.com",b$=!0,Qy=class{constructor(e){var t,r;if(e.host===void 0){if(e.ssl!==void 0)throw new G(x.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host=yW,this.ssl=b$}else this.host=e.host,this.ssl=(t=e.ssl)!==null&&t!==void 0?t:b$;if(this.isUsingEmulator=e.emulatorOptions!==void 0,this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,this.localCache=e.localCache,e.cacheSizeBytes===void 0)this.cacheSizeBytes=z3;else{if(e.cacheSizeBytes!==-1&&e.cacheSizeBytes<X3)throw new G(x.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}Xie("experimentalForceLongPolling",e.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",e.experimentalAutoDetectLongPolling),this.experimentalForceLongPolling=!!e.experimentalForceLongPolling,this.experimentalForceLongPolling?this.experimentalAutoDetectLongPolling=!1:e.experimentalAutoDetectLongPolling===void 0?this.experimentalAutoDetectLongPolling=!0:this.experimentalAutoDetectLongPolling=!!e.experimentalAutoDetectLongPolling,this.experimentalLongPollingOptions=IW((r=e.experimentalLongPollingOptions)!==null&&r!==void 0?r:{}),(function(o){if(o.timeoutSeconds!==void 0){if(isNaN(o.timeoutSeconds))throw new G(x.INVALID_ARGUMENT,`invalid long polling timeout: ${o.timeoutSeconds} (must not be NaN)`);if(o.timeoutSeconds<5)throw new G(x.INVALID_ARGUMENT,`invalid long polling timeout: ${o.timeoutSeconds} (minimum allowed value is 5)`);if(o.timeoutSeconds>30)throw new G(x.INVALID_ARGUMENT,`invalid long polling timeout: ${o.timeoutSeconds} (maximum allowed value is 30)`)}})(this.experimentalLongPollingOptions),this.useFetchStreams=!!e.useFetchStreams}isEqual(e){return this.host===e.host&&this.ssl===e.ssl&&this.credentials===e.credentials&&this.cacheSizeBytes===e.cacheSizeBytes&&this.experimentalForceLongPolling===e.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===e.experimentalAutoDetectLongPolling&&(function(r,i){return r.timeoutSeconds===i.timeoutSeconds})(this.experimentalLongPollingOptions,e.experimentalLongPollingOptions)&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams}},Rl=class{constructor(e,t,r,i){this._authCredentials=e,this._appCheckCredentials=t,this._databaseId=r,this._app=i,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new Qy({}),this._settingsFrozen=!1,this._emulatorOptions={},this._terminateTask="notTerminated"}get app(){if(!this._app)throw new G(x.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app}get _initialized(){return this._settingsFrozen}get _terminated(){return this._terminateTask!=="notTerminated"}_setSettings(e){if(this._settingsFrozen)throw new G(x.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 Qy(e),this._emulatorOptions=e.emulatorOptions||{},e.credentials!==void 0&&(this._authCredentials=(function(r){if(!r)return new db;switch(r.type){case"firstParty":return new gb(r.sessionIndex||"0",r.iamToken||null,r.authTokenFactory||null);case"provider":return r.client;default:throw new G(x.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invalid credential type")}})(e.credentials))}_getSettings(){return this._settings}_getEmulatorOptions(){return this._emulatorOptions}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return this._terminateTask==="notTerminated"&&(this._terminateTask=this._terminate()),this._terminateTask}_restart(){return I(this,null,function*(){this._terminateTask==="notTerminated"?yield this._terminate():this._terminateTask="notTerminated"})}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return(function(t){let r=w$.get(t);r&&(j("ComponentProvider","Removing Datastore"),w$.delete(t),r.terminate())})(this),Promise.resolve()}};function vW(n,e,t,r={}){var i;n=rr(n,Rl);let o=mr(e),s=n._getSettings(),a=Object.assign(Object.assign({},s),{emulatorOptions:n._getEmulatorOptions()}),c=`${e}:${t}`;o&&(ws(`https://${c}`),Oc("Firestore",!0)),s.host!==yW&&s.host!==c&&qo("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used.");let l=Object.assign(Object.assign({},s),{host:c,ssl:o,emulatorOptions:r});if(!ri(l,a)&&(n._setSettings(l),r.mockUserToken)){let d,h;if(typeof r.mockUserToken=="string")d=r.mockUserToken,h=Vt.MOCK_USER;else{d=vT(r.mockUserToken,(i=n._app)===null||i===void 0?void 0:i.options.projectId);let f=r.mockUserToken.sub||r.mockUserToken.user_id;if(!f)throw new G(x.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");h=new Vt(f)}n._authCredentials=new hb(new ay(d,h))}}var pi=class n{constructor(e,t,r){this.converter=t,this._query=r,this.type="query",this.firestore=e}withConverter(e){return new n(this.firestore,e,this._query)}},Zt=class n{constructor(e,t,r){this.converter=t,this._key=r,this.type="document",this.firestore=e}get _path(){return this._key.path}get id(){return this._key.path.lastSegment()}get path(){return this._key.path.canonicalString()}get parent(){return new ia(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new n(this.firestore,e,this._key)}toJSON(){return{type:n._jsonSchemaVersion,referencePath:this._key.toString()}}static fromJSON(e,t,r){if(Kg(t,n._jsonSchema))return new n(e,r||null,new Z(ke.fromString(t.referencePath)))}};Zt._jsonSchemaVersion="firestore/documentReference/1.0",Zt._jsonSchema={type:Bt("string",Zt._jsonSchemaVersion),referencePath:Bt("string")};var ia=class n extends pi{constructor(e,t,r){super(e,t,Jg(r)),this._path=r,this.type="collection"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){let e=this._path.popLast();return e.isEmpty()?null:new Zt(this.firestore,null,new Z(e))}withConverter(e){return new n(this.firestore,e,this._path)}};function SW(n,e,...t){if(n=Me(n),I0("collection","path",e),n instanceof Rl){let r=ke.fromString(e,...t);return CH(r),new ia(n,null,r)}{if(!(n instanceof Zt||n instanceof ia))throw new G(x.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");let r=n._path.child(ke.fromString(e,...t));return CH(r),new ia(n.firestore,null,r)}}function AW(n,e){if(n=rr(n,Rl),I0("collectionGroup","collection id",e),e.indexOf("/")>=0)throw new G(x.INVALID_ARGUMENT,`Invalid collection ID '${e}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);return new pi(n,null,(function(r){return new oo(ke.emptyPath(),r)})(e))}function CW(n,e,...t){if(n=Me(n),arguments.length===1&&(e=Ig.newId()),I0("doc","path",e),n instanceof Rl){let r=ke.fromString(e,...t);return AH(r),new Zt(n,null,new Z(r))}{if(!(n instanceof Zt||n instanceof ia))throw new G(x.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");let r=n._path.child(ke.fromString(e,...t));return AH(r),new Zt(n.firestore,n instanceof ia?n.converter:null,new Z(r))}}var O$="AsyncQueue",Jy=class{constructor(e=Promise.resolve()){this.Zu=[],this.Xu=!1,this.ec=[],this.tc=null,this.nc=!1,this.rc=!1,this.sc=[],this.F_=new jg(this,"async_queue_retry"),this.oc=()=>{let r=sy();r&&j(O$,"Visibility state changed to "+r.visibilityState),this.F_.y_()},this._c=e;let t=sy();t&&typeof t.addEventListener=="function"&&t.addEventListener("visibilitychange",this.oc)}get isShuttingDown(){return this.Xu}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.ac(),this.uc(e)}enterRestrictedMode(e){if(!this.Xu){this.Xu=!0,this.rc=e||!1;let t=sy();t&&typeof t.removeEventListener=="function"&&t.removeEventListener("visibilitychange",this.oc)}}enqueue(e){if(this.ac(),this.Xu)return new Promise(()=>{});let t=new nr;return this.uc(()=>this.Xu&&this.rc?Promise.resolve():(e().then(t.resolve,t.reject),t.promise)).then(()=>t.promise)}enqueueRetryable(e){this.enqueueAndForget(()=>(this.Zu.push(e),this.cc()))}cc(){return I(this,null,function*(){if(this.Zu.length!==0){try{yield this.Zu[0](),this.Zu.shift(),this.F_.reset()}catch(e){if(!Ea(e))throw e;j(O$,"Operation failed with retryable error: "+e)}this.Zu.length>0&&this.F_.g_(()=>this.cc())}})}uc(e){let t=this._c.then(()=>(this.nc=!0,e().catch(r=>{throw this.tc=r,this.nc=!1,Mt("INTERNAL UNHANDLED ERROR: ",M$(r)),r}).then(r=>(this.nc=!1,r))));return this._c=t,t}enqueueAfterDelay(e,t,r){this.ac(),this.sc.indexOf(e)>-1&&(t=0);let i=jO.createAndSchedule(this,e,t,r,o=>this.lc(o));return this.ec.push(i),i}ac(){this.tc&&re(47125,{hc:M$(this.tc)})}verifyOperationInProgress(){}Pc(){return I(this,null,function*(){let e;do e=this._c,yield e;while(e!==this._c)})}Tc(e){for(let t of this.ec)if(t.timerId===e)return!0;return!1}Ic(e){return this.Pc().then(()=>{this.ec.sort((t,r)=>t.targetTimeMs-r.targetTimeMs);for(let t of this.ec)if(t.skipDelay(),e!=="all"&&t.timerId===e)break;return this.Pc()})}dc(e){this.sc.push(e)}lc(e){let t=this.ec.indexOf(e);this.ec.splice(t,1)}};function M$(n){let e=n.message||"";return n.stack&&(e=n.stack.includes(n.message)?n.stack:n.message+`
|
|
174
|
+
`+n.stack),e}function L$(n){return(function(t,r){if(typeof t!="object"||t===null)return!1;let i=t;for(let o of r)if(o in i&&typeof i[o]=="function")return!0;return!1})(n,["next","error","complete"])}var gi=class extends Rl{constructor(e,t,r,i){super(e,t,r,i),this.type="firestore",this._queue=new Jy,this._persistenceKey=i?.name||"[DEFAULT]"}_terminate(){return I(this,null,function*(){if(this._firestoreClient){let e=this._firestoreClient.terminate();this._queue=new Jy(e),this._firestoreClient=void 0,yield e}})}};function gv(n,e,t){t||(t=Ng);let r=Ki(n,"firestore");if(r.isInitialized(t)){let i=r.getImmediate({identifier:t}),o=r.getOptions(t);if(ri(o,e))return i;throw new G(x.FAILED_PRECONDITION,"initializeFirestore() has already been called with different options. To avoid this error, call initializeFirestore() with the same options as when it was originally called, or call getFirestore() to return the already initialized instance.")}if(e.cacheSizeBytes!==void 0&&e.localCache!==void 0)throw new G(x.INVALID_ARGUMENT,"cache and cacheSizeBytes cannot be specified at the same time as cacheSizeBytes willbe deprecated. Instead, specify the cache size in the cache object");if(e.cacheSizeBytes!==void 0&&e.cacheSizeBytes!==-1&&e.cacheSizeBytes<X3)throw new G(x.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");return e.host&&mr(e.host)&&ws(e.host),r.initialize({options:e,instanceIdentifier:t})}function yh(n,e){let t=typeof n=="object"?n:Jn(),r=typeof n=="string"?n:e||Ng,i=Ki(t,"firestore").getImmediate({identifier:r});if(!i._initialized){let o=id("firestore");o&&vW(i,...o)}return i}function vh(n){if(n._terminated)throw new G(x.FAILED_PRECONDITION,"The client has already been terminated.");return n._firestoreClient||qse(n),n._firestoreClient}function qse(n){var e,t,r;let i=n._freezeSettings(),o=(function(a,c,l,d){return new Db(a,c,l,d.host,d.ssl,d.experimentalForceLongPolling,d.experimentalAutoDetectLongPolling,IW(d.experimentalLongPollingOptions),d.useFetchStreams,d.isUsingEmulator)})(n._databaseId,((e=n._app)===null||e===void 0?void 0:e.options.appId)||"",n._persistenceKey,i);n._componentsProvider||!((t=i.localCache)===null||t===void 0)&&t._offlineComponentProvider&&(!((r=i.localCache)===null||r===void 0)&&r._onlineComponentProvider)&&(n._componentsProvider={_offline:i.localCache._offlineComponentProvider,_online:i.localCache._onlineComponentProvider}),n._firestoreClient=new t0(n._authCredentials,n._appCheckCredentials,n._queue,o,n._componentsProvider&&(function(a){let c=a?._online.build();return{_offline:a?._offline.build(c),_online:c}})(n._componentsProvider))}var n0=class{constructor(e="count",t){this._internalFieldPath=t,this.type="AggregateField",this.aggregateType=e}},r0=class{constructor(e,t,r){this._userDataWriter=t,this._data=r,this.type="AggregateQuerySnapshot",this.query=e}data(){return this._userDataWriter.convertObjectMap(this._data)}};var zo=class n{constructor(e){this._byteString=e}static fromBase64String(e){try{return new n(Gt.fromBase64String(e))}catch(t){throw new G(x.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+t)}}static fromUint8Array(e){return new n(Gt.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:n._jsonSchemaVersion,bytes:this.toBase64()}}static fromJSON(e){if(Kg(e,n._jsonSchema))return n.fromBase64String(e.bytes)}};zo._jsonSchemaVersion="firestore/bytes/1.0",zo._jsonSchema={type:Bt("string",zo._jsonSchemaVersion),bytes:Bt("string")};var ph=class{constructor(...e){for(let t=0;t<e.length;++t)if(e[t].length===0)throw new G(x.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new Qt(e)}isEqual(e){return this._internalPath.isEqual(e._internalPath)}};var Wg=class{constructor(e){this._methodName=e}};var oa=class n{constructor(e,t){if(!isFinite(e)||e<-90||e>90)throw new G(x.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(t)||t<-180||t>180)throw new G(x.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 Ie(this._lat,e._lat)||Ie(this._long,e._long)}toJSON(){return{latitude:this._lat,longitude:this._long,type:n._jsonSchemaVersion}}static fromJSON(e){if(Kg(e,n._jsonSchema))return new n(e.latitude,e.longitude)}};oa._jsonSchemaVersion="firestore/geoPoint/1.0",oa._jsonSchema={type:Bt("string",oa._jsonSchemaVersion),latitude:Bt("number"),longitude:Bt("number")};var sa=class n{constructor(e){this._values=(e||[]).map(t=>t)}toArray(){return this._values.map(e=>e)}isEqual(e){return(function(r,i){if(r.length!==i.length)return!1;for(let o=0;o<r.length;++o)if(r[o]!==i[o])return!1;return!0})(this._values,e._values)}toJSON(){return{type:n._jsonSchemaVersion,vectorValues:this._values}}static fromJSON(e){if(Kg(e,n._jsonSchema)){if(Array.isArray(e.vectorValues)&&e.vectorValues.every(t=>typeof t=="number"))return new n(e.vectorValues);throw new G(x.INVALID_ARGUMENT,"Expected 'vectorValues' field to be a number array")}}};sa._jsonSchemaVersion="firestore/vectorValue/1.0",sa._jsonSchema={type:Bt("string",sa._jsonSchemaVersion),vectorValues:Bt("object")};var Kse=/^__.*__$/,i0=class{constructor(e,t,r){this.data=e,this.fieldMask=t,this.fieldTransforms=r}toMutation(e,t){return this.fieldMask!==null?new fi(e,this.data,this.fieldMask,t,this.fieldTransforms):new fa(e,this.data,t,this.fieldTransforms)}},Zy=class{constructor(e,t,r){this.data=e,this.fieldMask=t,this.fieldTransforms=r}toMutation(e,t){return new fi(e,this.data,this.fieldMask,t,this.fieldTransforms)}};function DW(n){switch(n){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw re(40011,{Ec:n})}}var o0=class n{constructor(e,t,r,i,o,s){this.settings=e,this.databaseId=t,this.serializer=r,this.ignoreUndefinedProperties=i,o===void 0&&this.Ac(),this.fieldTransforms=o||[],this.fieldMask=s||[]}get path(){return this.settings.path}get Ec(){return this.settings.Ec}Rc(e){return new n(Object.assign(Object.assign({},this.settings),e),this.databaseId,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}Vc(e){var t;let r=(t=this.path)===null||t===void 0?void 0:t.child(e),i=this.Rc({path:r,mc:!1});return i.fc(e),i}gc(e){var t;let r=(t=this.path)===null||t===void 0?void 0:t.child(e),i=this.Rc({path:r,mc:!1});return i.Ac(),i}yc(e){return this.Rc({path:void 0,mc:!0})}wc(e){return tv(e,this.settings.methodName,this.settings.Sc||!1,this.path,this.settings.bc)}contains(e){return this.fieldMask.find(t=>e.isPrefixOf(t))!==void 0||this.fieldTransforms.find(t=>e.isPrefixOf(t.field))!==void 0}Ac(){if(this.path)for(let e=0;e<this.path.length;e++)this.fc(this.path.get(e))}fc(e){if(e.length===0)throw this.wc("Document fields must not be empty");if(DW(this.Ec)&&Kse.test(e))throw this.wc('Document fields cannot begin and end with "__"')}},s0=class{constructor(e,t,r){this.databaseId=e,this.ignoreUndefinedProperties=t,this.serializer=r||dv(e)}Dc(e,t,r,i=!1){return new o0({Ec:e,methodName:t,bc:r,path:Qt.emptyPath(),mc:!1,Sc:i},this.databaseId,this.serializer,this.ignoreUndefinedProperties)}};function mv(n){let e=n._freezeSettings(),t=dv(n._databaseId);return new s0(n._databaseId,!!e.ignoreUndefinedProperties,t)}function RW(n,e,t,r,i,o={}){let s=n.Dc(o.merge||o.mergeFields?2:0,e,t,i);J0("Data must be an object, but it was:",s,r);let a=wW(r,s),c,l;if(o.merge)c=new Sr(s.fieldMask),l=s.fieldTransforms;else if(o.mergeFields){let d=[];for(let h of o.mergeFields){let f=a0(e,h,t);if(!s.contains(f))throw new G(x.INVALID_ARGUMENT,`Field '${f}' is specified in your field mask but missing from your input data.`);OW(d,f)||d.push(f)}c=new Sr(d),l=s.fieldTransforms.filter(h=>c.covers(h.field))}else c=null,l=s.fieldTransforms;return new i0(new xn(a),c,l)}var ev=class n extends Wg{_toFieldTransform(e){if(e.Ec!==2)throw e.Ec===1?e.wc(`${this._methodName}() can only appear at the top level of your update data`):e.wc(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);return e.fieldMask.push(e.path),null}isEqual(e){return e instanceof n}};function Yse(n,e,t,r){let i=n.Dc(1,e,t);J0("Data must be an object, but it was:",i,r);let o=[],s=xn.empty();_a(r,(c,l)=>{let d=Z0(e,c,t);l=Me(l);let h=i.gc(d);if(l instanceof ev)o.push(d);else{let f=tm(l,h);f!=null&&(o.push(d),s.set(d,f))}});let a=new Sr(o);return new Zy(s,a,i.fieldTransforms)}function Xse(n,e,t,r,i,o){let s=n.Dc(1,e,t),a=[a0(e,r,t)],c=[i];if(o.length%2!=0)throw new G(x.INVALID_ARGUMENT,`Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);for(let f=0;f<o.length;f+=2)a.push(a0(e,o[f])),c.push(o[f+1]);let l=[],d=xn.empty();for(let f=a.length-1;f>=0;--f)if(!OW(l,a[f])){let g=a[f],E=c[f];E=Me(E);let v=s.gc(g);if(E instanceof ev)l.push(g);else{let S=tm(E,v);S!=null&&(l.push(g),d.set(g,S))}}let h=new Sr(l);return new Zy(d,h,s.fieldTransforms)}function NW(n,e,t,r=!1){return tm(t,n.Dc(r?4:3,e))}function tm(n,e){if(bW(n=Me(n)))return J0("Unsupported field value:",e,n),wW(n,e);if(n instanceof Wg)return(function(r,i){if(!DW(i.Ec))throw i.wc(`${r._methodName}() can only be used with update() and set()`);if(!i.path)throw i.wc(`${r._methodName}() is not currently supported inside arrays`);let o=r._toFieldTransform(i);o&&i.fieldTransforms.push(o)})(n,e),null;if(n===void 0&&e.ignoreUndefinedProperties)return null;if(e.path&&e.fieldMask.push(e.path),n instanceof Array){if(e.settings.mc&&e.Ec!==4)throw e.wc("Nested arrays are not supported");return(function(r,i){let o=[],s=0;for(let a of r){let c=tm(a,i.yc(s));c==null&&(c={nullValue:"NULL_VALUE"}),o.push(c),s++}return{arrayValue:{values:o}}})(n,e)}return(function(r,i){if((r=Me(r))===null)return{nullValue:"NULL_VALUE"};if(typeof r=="number")return xoe(i.serializer,r);if(typeof r=="boolean")return{booleanValue:r};if(typeof r=="string")return{stringValue:r};if(r instanceof Date){let o=_t.fromDate(r);return{timestampValue:ah(i.serializer,o)}}if(r instanceof _t){let o=new _t(r.seconds,1e3*Math.floor(r.nanoseconds/1e3));return{timestampValue:ah(i.serializer,o)}}if(r instanceof oa)return{geoPointValue:{latitude:r.latitude,longitude:r.longitude}};if(r instanceof zo)return{bytesValue:M3(i.serializer,r._byteString)};if(r instanceof Zt){let o=i.databaseId,s=r.firestore._databaseId;if(!s.isEqual(o))throw i.wc(`Document reference is for database ${s.projectId}/${s.database} but should be for database ${o.projectId}/${o.database}`);return{referenceValue:L0(r.firestore._databaseId||i.databaseId,r._key.path)}}if(r instanceof sa)return(function(s,a){return{mapValue:{fields:{[R0]:{stringValue:N0},[nh]:{arrayValue:{values:s.toArray().map(l=>{if(typeof l!="number")throw a.wc("VectorValues must only contain numeric values.");return M0(a.serializer,l)})}}}}}})(r,i);throw i.wc(`Unsupported field value: ${rv(r)}`)})(n,e)}function wW(n,e){let t={};return t3(n)?e.path&&e.path.length>0&&e.fieldMask.push(e.path):_a(n,(r,i)=>{let o=tm(i,e.Vc(r));o!=null&&(t[r]=o)}),{mapValue:{fields:t}}}function bW(n){return!(typeof n!="object"||n===null||n instanceof Array||n instanceof Date||n instanceof _t||n instanceof oa||n instanceof zo||n instanceof Zt||n instanceof Wg||n instanceof sa)}function J0(n,e,t){if(!bW(t)||!V$(t)){let r=rv(t);throw r==="an object"?e.wc(n+" a custom object"):e.wc(n+" "+r)}}function a0(n,e,t){if((e=Me(e))instanceof ph)return e._internalPath;if(typeof e=="string")return Z0(n,e);throw tv("Field path arguments must be of type string or ",n,!1,void 0,t)}var Qse=new RegExp("[~\\*/\\[\\]]");function Z0(n,e,t){if(e.search(Qse)>=0)throw tv(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`,n,!1,void 0,t);try{return new ph(...e.split("."))._internalPath}catch{throw tv(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,n,!1,void 0,t)}}function tv(n,e,t,r,i){let o=r&&!r.isEmpty(),s=i!==void 0,a=`Function ${e}() called with invalid data`;t&&(a+=" (via `toFirestore()`)"),a+=". ";let c="";return(o||s)&&(c+=" (found",o&&(c+=` in field ${r}`),s&&(c+=` in document ${i}`),c+=")"),new G(x.INVALID_ARGUMENT,a+n+c)}function OW(n,e){return n.some(t=>t.isEqual(e))}var Nl=class{constructor(e,t,r,i,o){this._firestore=e,this._userDataWriter=t,this._key=r,this._document=i,this._converter=o}get id(){return this._key.path.lastSegment()}get ref(){return new Zt(this._firestore,this._converter,this._key)}exists(){return this._document!==null}data(){if(this._document){if(this._converter){let e=new c0(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(e)}return this._userDataWriter.convertValue(this._document.data.value)}}get(e){if(this._document){let t=this._document.data.field(Ev("DocumentSnapshot.get",e));if(t!==null)return this._userDataWriter.convertValue(t)}}},c0=class extends Nl{data(){return super.data()}};function Ev(n,e){return typeof e=="string"?Z0(n,e):e instanceof ph?e._internalPath:e._delegate._internalPath}function MW(n){if(n.limitType==="L"&&n.explicitOrderBy.length===0)throw new G(x.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}var zg=class{},gh=class extends zg{};function LW(n,e,...t){let r=[];e instanceof zg&&r.push(e),r=r.concat(t),(function(o){let s=o.filter(c=>c instanceof mh).length,a=o.filter(c=>c instanceof qg).length;if(s>1||s>0&&a>0)throw new G(x.INVALID_ARGUMENT,"InvalidQuery. When using composite filters, you cannot use more than one filter at the top level. Consider nesting the multiple filters within an `and(...)` statement. For example: change `query(query, where(...), or(...))` to `query(query, and(where(...), or(...)))`.")})(r);for(let i of r)n=i._apply(n);return n}var qg=class n extends gh{constructor(e,t,r){super(),this._field=e,this._op=t,this._value=r,this.type="where"}static _create(e,t,r){return new n(e,t,r)}_apply(e){let t=this._parse(e);return BW(e._query,t),new pi(e.firestore,e.converter,Vb(e._query,t))}_parse(e){let t=mv(e.firestore);return(function(o,s,a,c,l,d,h){let f;if(l.isKeyField()){if(d==="array-contains"||d==="array-contains-any")throw new G(x.INVALID_ARGUMENT,`Invalid Query. You can't perform '${d}' queries on documentId().`);if(d==="in"||d==="not-in"){x$(h,d);let E=[];for(let v of h)E.push(P$(c,o,v));f={arrayValue:{values:E}}}else f=P$(c,o,h)}else d!=="in"&&d!=="not-in"&&d!=="array-contains-any"||x$(h,d),f=NW(a,s,h,d==="in"||d==="not-in");return Le.create(l,d,f)})(e._query,"where",t,e.firestore._databaseId,this._field,this._op,this._value)}};function PW(n,e,t){let r=e,i=Ev("where",n);return qg._create(i,r,t)}var mh=class n extends zg{constructor(e,t){super(),this.type=e,this._queryConstraints=t}static _create(e,t){return new n(e,t)}_parse(e){let t=this._queryConstraints.map(r=>r._parse(e)).filter(r=>r.getFilters().length>0);return t.length===1?t[0]:Ye.create(t,this._getOperator())}_apply(e){let t=this._parse(e);return t.getFilters().length===0?e:((function(i,o){let s=i,a=o.getFlattenedFilters();for(let c of a)BW(s,c),s=Vb(s,c)})(e._query,t),new pi(e.firestore,e.converter,Vb(e._query,t)))}_getQueryConstraints(){return this._queryConstraints}_getOperator(){return this.type==="and"?"and":"or"}};function xW(...n){return n.forEach(e=>GW("or",e)),mh._create("or",n)}function kW(...n){return n.forEach(e=>GW("and",e)),mh._create("and",n)}var l0=class n extends gh{constructor(e,t){super(),this._field=e,this._direction=t,this.type="orderBy"}static _create(e,t){return new n(e,t)}_apply(e){let t=(function(i,o,s){if(i.startAt!==null)throw new G(x.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(i.endAt!==null)throw new G(x.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");return new Tl(o,s)})(e._query,this._field,this._direction);return new pi(e.firestore,e.converter,(function(i,o){let s=i.explicitOrderBy.concat([o]);return new oo(i.path,i.collectionGroup,s,i.filters.slice(),i.limit,i.limitType,i.startAt,i.endAt)})(e._query,t))}};function FW(n,e="asc"){let t=e,r=Ev("orderBy",n);return l0._create(r,t)}var u0=class n extends gh{constructor(e,t,r){super(),this.type=e,this._limit=t,this._limitType=r}static _create(e,t,r){return new n(e,t,r)}_apply(e){return new pi(e.firestore,e.converter,yy(e._query,this._limit,this._limitType))}};function UW(n){return Qie("limit",n),u0._create("limit",n,"F")}var d0=class n extends gh{constructor(e,t,r){super(),this.type=e,this._docOrFields=t,this._inclusive=r}static _create(e,t,r){return new n(e,t,r)}_apply(e){let t=Jse(e,this.type,this._docOrFields,this._inclusive);return new pi(e.firestore,e.converter,(function(i,o){return new oo(i.path,i.collectionGroup,i.explicitOrderBy.slice(),i.filters.slice(),i.limit,i.limitType,o,i.endAt)})(e._query,t))}};function VW(...n){return d0._create("startAfter",n,!1)}function Jse(n,e,t,r){if(t[0]=Me(t[0]),t[0]instanceof Nl)return(function(o,s,a,c,l){if(!c)throw new G(x.NOT_FOUND,`Can't use a DocumentSnapshot that doesn't exist for ${a}().`);let d=[];for(let h of $d(o))if(h.field.isKeyField())d.push(_l(s,c.key));else{let f=c.data.field(h.field);if(av(f))throw new G(x.INVALID_ARGUMENT,'Invalid query. You are trying to start or end a query using a document for which the field "'+h.field+'" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');if(f===null){let g=h.field.canonicalString();throw new G(x.INVALID_ARGUMENT,`Invalid query. You are trying to start or end a query using a document for which the field '${g}' (used as the orderBy) does not exist.`)}d.push(f)}return new io(d,l)})(n._query,n.firestore._databaseId,e,t[0]._document,r);{let i=mv(n.firestore);return(function(s,a,c,l,d,h){let f=s.explicitOrderBy;if(d.length>f.length)throw new G(x.INVALID_ARGUMENT,`Too many arguments provided to ${l}(). The number of arguments must be less than or equal to the number of orderBy() clauses`);let g=[];for(let E=0;E<d.length;E++){let v=d[E];if(f[E].field.isKeyField()){if(typeof v!="string")throw new G(x.INVALID_ARGUMENT,`Invalid query. Expected a string for document ID in ${l}(), but got a ${typeof v}`);if(!b0(s)&&v.indexOf("/")!==-1)throw new G(x.INVALID_ARGUMENT,`Invalid query. When querying a collection and ordering by documentId(), the value passed to ${l}() must be a plain document ID, but '${v}' contains a slash.`);let S=s.path.child(ke.fromString(v));if(!Z.isDocumentKey(S))throw new G(x.INVALID_ARGUMENT,`Invalid query. When querying a collection group and ordering by documentId(), the value passed to ${l}() must result in a valid document path, but '${S}' is not because it contains an odd number of segments.`);let P=new Z(S);g.push(_l(a,P))}else{let S=NW(c,l,v);g.push(S)}}return new io(g,h)})(n._query,n.firestore._databaseId,i,e,t,r)}}function P$(n,e,t){if(typeof(t=Me(t))=="string"){if(t==="")throw new G(x.INVALID_ARGUMENT,"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");if(!b0(e)&&t.indexOf("/")!==-1)throw new G(x.INVALID_ARGUMENT,`Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${t}' contains a '/' character.`);let r=e.path.child(ke.fromString(t));if(!Z.isDocumentKey(r))throw new G(x.INVALID_ARGUMENT,`Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${r}' is not because it has an odd number of segments (${r.length}).`);return _l(n,new Z(r))}if(t instanceof Zt)return _l(n,t._key);throw new G(x.INVALID_ARGUMENT,`Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${rv(t)}.`)}function x$(n,e){if(!Array.isArray(n)||n.length===0)throw new G(x.INVALID_ARGUMENT,`Invalid Query. A non-empty array is required for '${e.toString()}' filters.`)}function BW(n,e){let t=(function(i,o){for(let s of i)for(let a of s.getFlattenedFilters())if(o.indexOf(a.op)>=0)return a.op;return null})(n.filters,(function(i){switch(i){case"!=":return["!=","not-in"];case"array-contains-any":case"in":return["not-in"];case"not-in":return["array-contains-any","in","not-in","!="];default:return[]}})(e.op));if(t!==null)throw t===e.op?new G(x.INVALID_ARGUMENT,`Invalid query. You cannot use more than one '${e.op.toString()}' filter.`):new G(x.INVALID_ARGUMENT,`Invalid query. You cannot use '${e.op.toString()}' filters with '${t.toString()}' filters.`)}function GW(n,e){if(!(e instanceof qg||e instanceof mh))throw new G(x.INVALID_ARGUMENT,`Function ${n}() requires AppliableConstraints created with a call to 'where(...)', 'or(...)', or 'and(...)'.`)}var nv=class{convertValue(e,t="none"){switch(la(e)){case 0:return null;case 1:return e.booleanValue;case 2:return Et(e.integerValue||e.doubleValue);case 3:return this.convertTimestamp(e.timestampValue);case 4:return this.convertServerTimestamp(e,t);case 5:return e.stringValue;case 6:return this.convertBytes(Yo(e.bytesValue));case 7:return this.convertReference(e.referenceValue);case 8:return this.convertGeoPoint(e.geoPointValue);case 9:return this.convertArray(e.arrayValue,t);case 11:return this.convertObject(e.mapValue,t);case 10:return this.convertVectorValue(e.mapValue);default:throw re(62114,{value:e})}}convertObject(e,t){return this.convertObjectMap(e.fields,t)}convertObjectMap(e,t="none"){let r={};return _a(e,(i,o)=>{r[i]=this.convertValue(o,t)}),r}convertVectorValue(e){var t,r,i;let o=(i=(r=(t=e.fields)===null||t===void 0?void 0:t[nh].arrayValue)===null||r===void 0?void 0:r.values)===null||i===void 0?void 0:i.map(s=>Et(s.doubleValue));return new sa(o)}convertGeoPoint(e){return new oa(Et(e.latitude),Et(e.longitude))}convertArray(e,t){return(e.values||[]).map(r=>this.convertValue(r,t))}convertServerTimestamp(e,t){switch(t){case"previous":let r=cv(e);return r==null?null:this.convertValue(r,t);case"estimate":return this.convertTimestamp(Rg(e));default:return null}}convertTimestamp(e){let t=Ko(e);return new _t(t.seconds,t.nanos)}convertDocumentKey(e,t){let r=ke.fromString(e);ae(G3(r),9688,{name:e});let i=new th(r.get(1),r.get(3)),o=new Z(r.popFirst(5));return i.isEqual(t)||Mt(`Document ${o} contains a document reference within a different database (${i.projectId}/${i.database}) which is not supported. It will be treated as a reference in the current database (${t.projectId}/${t.database}) instead.`),o}};function jW(n,e,t){let r;return r=n?t&&(t.merge||t.mergeFields)?n.toFirestore(e,t):n.toFirestore(e):e,r}var h0=class extends nv{constructor(e){super(),this.firestore=e}convertBytes(e){return new zo(e)}convertReference(e){let t=this.convertDocumentKey(e,this.firestore._databaseId);return new Zt(this.firestore,null,t)}};function Zse(){return new n0("count")}var ra=class{constructor(e,t){this.hasPendingWrites=e,this.fromCache=t}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}},aa=class n extends Nl{constructor(e,t,r,i,o,s){super(e,t,r,i,s),this._firestore=e,this._firestoreImpl=e,this.metadata=o}exists(){return super.exists()}data(e={}){if(this._document){if(this._converter){let t=new zd(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){let r=this._document.data.field(Ev("DocumentSnapshot.get",e));if(r!==null)return this._userDataWriter.convertValue(r,t.serverTimestamps)}}toJSON(){if(this.metadata.hasPendingWrites)throw new G(x.FAILED_PRECONDITION,"DocumentSnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");let e=this._document,t={};return t.type=n._jsonSchemaVersion,t.bundle="",t.bundleSource="DocumentSnapshot",t.bundleName=this._key.toString(),!e||!e.isValidDocument()||!e.isFoundDocument()?t:(this._userDataWriter.convertObjectMap(e.data.value.mapValue.fields,"previous"),t.bundle=(this._firestore,this.ref.path,"NOT SUPPORTED"),t)}};aa._jsonSchemaVersion="firestore/documentSnapshot/1.0",aa._jsonSchema={type:Bt("string",aa._jsonSchemaVersion),bundleSource:Bt("string","DocumentSnapshot"),bundleName:Bt("string"),bundle:Bt("string")};var zd=class extends aa{data(e={}){return super.data(e)}},El=class n{constructor(e,t,r,i){this._firestore=e,this._userDataWriter=t,this._snapshot=i,this.metadata=new ra(i.hasPendingWrites,i.fromCache),this.query=r}get docs(){let e=[];return this.forEach(t=>e.push(t)),e}get size(){return this._snapshot.docs.size}get empty(){return this.size===0}forEach(e,t){this._snapshot.docs.forEach(r=>{e.call(t,new zd(this._firestore,this._userDataWriter,r.key,r,new ra(this._snapshot.mutatedKeys.has(r.key),this._snapshot.fromCache),this.query.converter))})}docChanges(e={}){let t=!!e.includeMetadataChanges;if(t&&this._snapshot.excludesMetadataChanges)throw new G(x.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(i,o){if(i._snapshot.oldDocs.isEmpty()){let s=0;return i._snapshot.docChanges.map(a=>{let c=new zd(i._firestore,i._userDataWriter,a.doc.key,a.doc,new ra(i._snapshot.mutatedKeys.has(a.doc.key),i._snapshot.fromCache),i.query.converter);return a.doc,{type:"added",doc:c,oldIndex:-1,newIndex:s++}})}{let s=i._snapshot.oldDocs;return i._snapshot.docChanges.filter(a=>o||a.type!==3).map(a=>{let c=new zd(i._firestore,i._userDataWriter,a.doc.key,a.doc,new ra(i._snapshot.mutatedKeys.has(a.doc.key),i._snapshot.fromCache),i.query.converter),l=-1,d=-1;return a.type!==0&&(l=s.indexOf(a.doc.key),s=s.delete(a.doc.key)),a.type!==1&&(s=s.add(a.doc),d=s.indexOf(a.doc.key)),{type:eae(a.type),doc:c,oldIndex:l,newIndex:d}})}})(this,t),this._cachedChangesIncludeMetadataChanges=t),this._cachedChanges}toJSON(){if(this.metadata.hasPendingWrites)throw new G(x.FAILED_PRECONDITION,"QuerySnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");let e={};e.type=n._jsonSchemaVersion,e.bundleSource="QuerySnapshot",e.bundleName=Ig.newId(),this._firestore._databaseId.database,this._firestore._databaseId.projectId;let t=[],r=[],i=[];return this.docs.forEach(o=>{o._document!==null&&(t.push(o._document),r.push(this._userDataWriter.convertObjectMap(o._document.data.value.mapValue.fields,"previous")),i.push(o.ref.path))}),e.bundle=(this._firestore,this.query._query,e.bundleName,"NOT SUPPORTED"),e}};function eae(n){switch(n){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return re(61501,{type:n})}}function HW(n){n=rr(n,Zt);let e=rr(n.firestore,gi);return $se(vh(e),n._key).then(t=>YW(e,n,t))}El._jsonSchemaVersion="firestore/querySnapshot/1.0",El._jsonSchema={type:Bt("string",El._jsonSchemaVersion),bundleSource:Bt("string","QuerySnapshot"),bundleName:Bt("string"),bundle:Bt("string")};var wl=class extends nv{constructor(e){super(),this.firestore=e}convertBytes(e){return new zo(e)}convertReference(e){let t=this.convertDocumentKey(e,this.firestore._databaseId);return new Zt(this.firestore,null,t)}};function $W(n){n=rr(n,pi);let e=rr(n.firestore,gi),t=vh(e),r=new wl(e);return MW(n._query),Wse(t,n._query).then(i=>new El(e,r,n,i))}function WW(n,e,t){n=rr(n,Zt);let r=rr(n.firestore,gi),i=jW(n.converter,e,t);return KW(r,[RW(mv(r),"setDoc",n._key,i,n.converter!==null,t).toMutation(n._key,_n.none())])}function zW(n){return KW(rr(n.firestore,gi),[new Sl(n._key,_n.none())])}function qW(n,...e){var t,r,i;n=Me(n);let o={includeMetadataChanges:!1,source:"default"},s=0;typeof e[s]!="object"||L$(e[s])||(o=e[s++]);let a={includeMetadataChanges:o.includeMetadataChanges,source:o.source};if(L$(e[s])){let h=e[s];e[s]=(t=h.next)===null||t===void 0?void 0:t.bind(h),e[s+1]=(r=h.error)===null||r===void 0?void 0:r.bind(h),e[s+2]=(i=h.complete)===null||i===void 0?void 0:i.bind(h)}let c,l,d;if(n instanceof Zt)l=rr(n.firestore,gi),d=Jg(n._key.path),c={next:h=>{e[s]&&e[s](YW(l,n,h))},error:e[s+1],complete:e[s+2]};else{let h=rr(n,pi);l=rr(h.firestore,gi),d=h._query;let f=new wl(l);c={next:g=>{e[s]&&e[s](new El(l,f,h,g))},error:e[s+1],complete:e[s+2]},MW(n._query)}return(function(f,g,E,v){let S=new $g(v),P=new Hg(g,S,E);return f.asyncQueue.enqueueAndForget(()=>I(null,null,function*(){return G0(yield Xy(f),P)})),()=>{S.Ou(),f.asyncQueue.enqueueAndForget(()=>I(null,null,function*(){return j0(yield Xy(f),P)}))}})(vh(l),d,a,c)}function KW(n,e){return(function(r,i){let o=new nr;return r.asyncQueue.enqueueAndForget(()=>I(null,null,function*(){return Nse(yield Hse(r),i,o)})),o.promise})(vh(n),e)}function YW(n,e,t){let r=t.docs.get(e._key),i=new wl(n);return new aa(n,i,e._key,r,new ra(t.hasPendingWrites,t.fromCache),e.converter)}function XW(n){return QW(n,{count:Zse()})}function QW(n,e){let t=rr(n.firestore,gi),r=vh(t),i=Aoe(e,(o,s)=>new Hb(s,o.aggregateType,o._internalFieldPath));return zse(r,n._query,i).then(o=>(function(a,c,l){let d=new wl(a);return new r0(c,d,l)})(t,n,o))}var f0=class{constructor(e){let t;this.kind="persistent",e?.tabManager?(e.tabManager._initialize(e),t=e.tabManager):(t=tae(void 0),t._initialize(e)),this._onlineComponentProvider=t._onlineComponentProvider,this._offlineComponentProvider=t._offlineComponentProvider}toJSON(){return{kind:this.kind}}};function eM(n){return new f0(n)}var p0=class{constructor(e){this.forceOwnership=e,this.kind="persistentSingleTab"}toJSON(){return{kind:this.kind}}_initialize(e){this._onlineComponentProvider=X0.provider,this._offlineComponentProvider={build:t=>new Yy(t,e?.cacheSizeBytes,this.forceOwnership)}}},g0=class{constructor(){this.kind="PersistentMultipleTab"}toJSON(){return{kind:this.kind}}_initialize(e){this._onlineComponentProvider=X0.provider,this._offlineComponentProvider={build:t=>new JO(t,e?.cacheSizeBytes)}}};function tae(n){return new p0(n?.forceOwnership)}function tM(){return new g0}var nae={maxAttempts:5};function dg(n,e){if((n=Me(n)).firestore!==e)throw new G(x.INVALID_ARGUMENT,"Provided document reference is from a different Firestore instance.");return n}var m0=class{constructor(e,t){this._firestore=e,this._transaction=t,this._dataReader=mv(e)}get(e){let t=dg(e,this._firestore),r=new h0(this._firestore);return this._transaction.lookup([t._key]).then(i=>{if(!i||i.length!==1)return re(24041);let o=i[0];if(o.isFoundDocument())return new Nl(this._firestore,r,o.key,o,t.converter);if(o.isNoDocument())return new Nl(this._firestore,r,t._key,null,t.converter);throw re(18433,{doc:o})})}set(e,t,r){let i=dg(e,this._firestore),o=jW(i.converter,t,r),s=RW(this._dataReader,"Transaction.set",i._key,o,i.converter!==null,r);return this._transaction.set(i._key,s),this}update(e,t,r,...i){let o=dg(e,this._firestore),s;return s=typeof(t=Me(t))=="string"||t instanceof ph?Xse(this._dataReader,"Transaction.update",o._key,t,r,i):Yse(this._dataReader,"Transaction.update",o._key,t),this._transaction.update(o._key,s),this}delete(e){let t=dg(e,this._firestore);return this._transaction.delete(t._key),this}};var E0=class extends m0{constructor(e,t){super(e,t),this._firestore=e}get(e){let t=dg(e,this._firestore),r=new wl(this._firestore);return super.get(e).then(i=>new aa(this._firestore,r,t._key,i._document,new ra(!1,!1),t.converter))}};function JW(n,e,t){n=rr(n,gi);let r=Object.assign(Object.assign({},nae),t);return(function(o){if(o.maxAttempts<1)throw new G(x.INVALID_ARGUMENT,"Max attempts must be at least 1")})(r),(function(o,s,a){let c=new nr;return o.asyncQueue.enqueueAndForget(()=>I(null,null,function*(){let l=yield TW(o);new e0(o.asyncQueue,l,a,s,c).zu()})),c.promise})(vh(n),i=>e(new E0(n,i)),r)}(function(e,t=!0){(function(i){Eh=i})(Ls),jn(new Yt("firestore",(r,{instanceIdentifier:i,options:o})=>{let s=r.getProvider("app").getImmediate(),a=new gi(new fb(r.getProvider("auth-internal")),new mb(s,r.getProvider("app-check-internal")),(function(l,d){if(!Object.prototype.hasOwnProperty.apply(l.options,["projectId"]))throw new G(x.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new th(l.options.projectId,d)})(s,i),s);return o=Object.assign({useFetchStreams:t},o),a._setSettings(o),a},"PUBLIC").setMultipleInstances(!0)),Be(IH,yH,e),Be(IH,yH,"esm2017")})();var eFe=ue(kW,!0,2);var _v=ue(SW,!0,2),ZW=ue(AW,!0,2);var e6=ue(zW,!0,2);var nm=ue(CW,!0,2);var t6=ue(XW,!0),nM=ue(HW,!0);var n6=ue($W,!0);var tFe=ue(UW,!0,2);var r6=ue(qW,!0);var nFe=ue(xW,!0,2),rFe=ue(FW,!0,2),i6=ue(LW,!0,2);var o6=ue(JW,!0),s6=ue(WW,!0,2);var iFe=ue(VW,!0,2);var oFe=ue(PW,!0,2);var Tv=class{static getFirestoreProdDbName(e,t){return t?.databaseURL?.includes("snippyly-plugin.firebaseio.com")||t?.databaseURL?.includes("snippyly-plugin-staging.firebaseio.com")?"sfdb":t?.storeDbId??(this.isTestingDb(t?.databaseURL??"")?"sdktest":`apikey${e.toLowerCase()}`)}static isTestingDb(e){try{return e.includes("-test")}catch(t){return M.error("Error in isTestingDb:",t),!1}}};var a6=(()=>{let e=class e{constructor(r,i,o){this.configService=r,this.authService=i,this.loggingService=o,this.firestore$=new ie(null);try{ja([this.authService.getFirebaseConfig$(),this.configService.getApiKey$(),this.configService.getFirestorePersistentCacheEnabled$()]).pipe(pn(([s,a])=>!!s&&!!a),gn(1)).subscribe(([s,a,c])=>{if(s&&a&&s?.firebaseOptions?.storeDbId){try{let h=sessionStorage?.getItem("veltFirestoreLogLevel")||qt?.firebaseLogLevel||"silent";_0(h)}catch(h){this.loggingService.catch("Error in FirestoreService setLogLevel: ",h)}let l=Tv.getFirestoreProdDbName(a,s.firebaseOptions),d=this.configService.getProxyConfig();if(d?.v2DbHost){let h={host:d.v2DbHost,ssl:!0};d.forceLongPolling?h.experimentalForceLongPolling=!0:h.experimentalAutoDetectLongPolling=!0,c&&(h.localCache=eM({tabManager:tM()}));try{this.firestore$.next(gv(Jn(),h,l))}catch(f){this.loggingService.catch("Firestore proxy: initializeFirestore failed, falling back to existing instance. Proxy settings may not be applied: ",f),this.firestore$.next(yh(l))}}else if(c)try{let h=Jn(),f=gv(h,{localCache:eM({tabManager:tM()})},l);this.firestore$.next(f)}catch{this.firestore$.next(yh(l))}else this.firestore$.next(yh(l))}},s=>{})}catch{}}getFirestore(){return this.firestore$.asObservable()}getFirestoreValue(){return this.firestore$.value}generateFirestoreDocumentId(){try{let r=this.getFirestoreValue()||yh("DocumentIdDb");if(r){let i=_v(r,"generateDocumentId");return nm(i).id}return}catch(r){this.loggingService.catch("Error in FirestoreService generateFirestoreDocumentId: ",r);return}}};e.\u0275fac=function(i){return new(i||e)(H(Xi),H(js),H(wt))},e.\u0275prov=Q({token:e,factory:e.\u0275fac,providedIn:"root"});let n=e;return n})();var Iv=(()=>{let e=class e{constructor(r,i,o){this.authService=r,this.configService=i,this.loggingService=o,this.db$=new ie(null);try{this.authService.getFirebaseConfig$().subscribe(s=>{if(s){let a=this.configService.getProxyConfig(),c=s.firebaseOptions.databaseURL;a?.v1DbHost&&c&&(c=iV(c,a.v1DbHost),a?.forceLongPolling&&zw());let l=wd(void 0,c);a?.v1DbHost&&c&&this.lockDatabaseHost(l),this.db$.next(l)}},s=>{this.loggingService.catch("Error in DatabaseService constructor: ",s)})}catch(s){this.loggingService.catch("Error in DatabaseService constructor:",s)}}getDb(){return this.db$.asObservable()}getDbValue(){return this.db$.getValue()}lockDatabaseHost(r){try{let o=r?._repo?.repoInfo_;if(o){let s=o.host;Object.defineProperty(o,"host",{get:()=>s,set:()=>{},configurable:!0}),o.internalHost=s}}catch(i){this.loggingService.catch("Error in DatabaseService lockDatabaseHost: ",i)}}};e.\u0275fac=function(i){return new(i||e)(H(js),H(Xi),H(wt))},e.\u0275prov=Q({token:e,factory:e.\u0275fac,providedIn:"root"});let n=e;return n})();var Dr={doc:nm,collection:_v,collectionGroup:ZW,query:i6,getDoc:nM,getDocs:n6,getCountFromServer:t6,setDoc:s6,deleteDoc:e6,onSnapshot:r6,runTransaction:o6},l6=(()=>{let e=class e{constructor(r,i,o){this.firestoreService=r,this.databaseService=i,this.loggingService=o}read(r){return I(this,null,function*(){if((r.store??"firestore")==="rtdb"){let a=this.databaseService.getDbValue();return a?{data:(yield rg(bd(a,r.location)))?.val()}:{data:void 0}}let o=this.firestoreService.getFirestoreValue();return o?{data:(yield nM(nm(o,r.location)))?.data()}:{data:void 0}})}runTransaction(r){return I(this,null,function*(){return r()})}firestoreDoc(r,i){return Dr.doc(r,i)}firestoreCollection(r,i){return Dr.collection(r,i)}firestoreCollectionGroup(r,i){return Dr.collectionGroup(r,i)}firestoreQuery(r,...i){return Dr.query(r,...i)}firestoreGetDoc(r){return Dr.getDoc(r)}firestoreGetDocs(r){return Dr.getDocs(r)}firestoreGetCountFromServer(r){return Dr.getCountFromServer(r)}firestoreSetDoc(r,i,o){return o?Dr.setDoc(r,i,o):Dr.setDoc(r,i)}firestoreDeleteDoc(r){return Dr.deleteDoc(r)}firestoreOnSnapshot(r,i,o){return o?Dr.onSnapshot(r,i,o):Dr.onSnapshot(r,i)}firestoreRunTransaction(r,i){return Dr.runTransaction(r,i)}addComment(r){return this.deferred("addComment")}editComment(r){return this.deferred("editComment")}addReaction(r){return this.deferred("addReaction")}editReaction(r){return this.deferred("editReaction")}deleteReaction(r){return this.deferred("deleteReaction")}recordDocumentView(r){return this.deferred("recordDocumentView")}getActivitiesForDocuments(r){return this.deferred("getActivitiesForDocuments")}getActivitiesForEntity(r){return this.deferred("getActivitiesForEntity")}deleteComment(r){return this.deferred("deleteComment")}setCommentResolved(r){return this.deferred("setCommentResolved")}setCommentMetadata(r){return this.deferred("setCommentMetadata")}bumpCommentViews(r){return this.deferred("bumpCommentViews")}markCommentThreadRead(r){return this.deferred("markCommentThreadRead")}markNotificationRead(r){return this.deferred("markNotificationRead")}addNotification(r){return this.deferred("addNotification")}deleteNotification(r){return this.deferred("deleteNotification")}updateNotification(r){return this.deferred("updateNotification")}updatePresence(r){return this.deferred("updatePresence")}grantAccess(r){return this.deferred("grantAccess")}revokeAccess(r){return this.deferred("revokeAccess")}getAccess(r){return this.deferred("getAccess")}upsertOrgUserProfile(r){return this.deferred("upsertOrgUserProfile")}upsertDocMetadata(r){return this.deferred("upsertDocMetadata")}upsertOrgMetadata(r){return this.deferred("upsertOrgMetadata")}createActivity(r){return this.deferred("createActivity")}saveCrdtVersion(r){return this.deferred("saveCrdtVersion")}getCrdtVersion(r){return this.deferred("getCrdtVersion")}listCrdtVersions(r){return this.deferred("listCrdtVersions")}getOrganizationUsers(r){return this.deferred("getOrganizationUsers")}setLocationMetadata(r){return this.deferred("setLocationMetadata")}fetchLocations(r){return this.deferred("fetchLocations")}createFolder(r){return this.deferred("createFolder")}setDocumentMetadata(r){return this.deferred("setDocumentMetadata")}getDocuments(r){return this.deferred("getDocuments")}getNotificationsForDocuments(r){return this.deferred("getNotificationsForDocuments")}getDocumentMetadataFromIds(r){return this.deferred("getDocumentMetadataFromIds")}getCrossOrgUserNotifications(r){return this.deferred("getCrossOrgUserNotifications")}deferred(r){return this.loggingService.warn(`[WB] FirebaseDbAdapter.${r} called but write-op wiring is deferred to Phase A (self-hosting Step 0). The SDK uses its existing direct write path in Step 0.`),Promise.resolve({ok:!1,code:"unimplemented",message:`FirebaseDbAdapter.${r} wiring deferred to Phase A`})}};e.\u0275fac=function(i){return new(i||e)(H(a6),H(Iv),H(wt))},e.\u0275prov=Q({token:e,factory:e.\u0275fac,providedIn:"root"});let n=e;return n})();var iae={comment:{mode:"persistent",scope:"doc"},notification:{mode:"persistent",scope:"user"},notificationIndex:{mode:"persistent",scope:"user"},crdt:{mode:"persistent",scope:"doc"},presence:{mode:"ephemeral",scope:"doc"},crdtSyncPresence:{mode:"ephemeral",scope:"doc"},crdtPresence:{mode:"ephemeral",scope:"doc"},liveState:{mode:"ephemeral",scope:"doc"},cursor:{mode:"ephemeral",scope:"doc"},huddle:{mode:"ephemeral",scope:"doc"},syncVideoPlayer:{mode:"ephemeral",scope:"doc"},heartbeat:{mode:"ephemeral",scope:"org"},flockSession:{mode:"ephemeral",scope:"doc"},selection:{mode:"ephemeral",scope:"doc"},reaction:{mode:"persistent",scope:"doc"},lastActivityTimestamp:{mode:"persistent",scope:"org"},lastNotificationTimestamp:{mode:"persistent",scope:"org"},documentViews:{mode:"persistent",scope:"doc"}};function u6(n){return iae[n]}var Xe={getDatabase:wd,ref:bd,query:fH,get:rg,set:mH,update:EH,remove:pH,push:hH,runTransaction:gH,onValue:Qw,onChildAdded:cH,onChildChanged:lH,onChildRemoved:uH,off:aH,objectVal:oH,listVal:iH,stateChanges:sH,onDisconnect:dH},d6=(()=>{let e=class e{constructor(r,i){this.databaseService=r,this.loggingService=i}getServerTimeOffset(){return I(this,null,function*(){try{let r=this.databaseService.getDbValue();if(!r)return 0;let o=(yield rg(bd(r,e.SERVER_TIME_OFFSET_PATH)))?.val();return typeof o=="number"?o:0}catch(r){return this.loggingService.catch("Error in FirebaseRealtimeAdapter getServerTimeOffset: ",r),0}})}onServerTimeOffset(r){let i=null,o=null;try{o=this.databaseService.getDb().subscribe(s=>{if(s){let a=bd(s,e.SERVER_TIME_OFFSET_PATH);i=Qw(a,c=>{try{r(c?.val())}catch(l){this.loggingService.catch("Error in FirebaseRealtimeAdapter onServerTimeOffset callback: ",l)}})}})}catch(s){this.loggingService.catch("Error in FirebaseRealtimeAdapter onServerTimeOffset: ",s)}return()=>{try{i&&(i(),i=null),o?.unsubscribe(),o=null}catch(s){this.loggingService.catch("Error tearing down FirebaseRealtimeAdapter onServerTimeOffset: ",s)}}}getChannelTag(r){return u6(r)}getDatabaseInstance(r){return r?Xe.getDatabase(void 0,r):Xe.getDatabase()}rtdbRef(r,i){return Xe.ref(r,i)}rtdbQueryRef(r,...i){return Xe.query(r,...i)}rtdbGet(r){return Xe.get(r)}rtdbSet(r,i,o){return this.getChannelTag(r),Xe.set(i,o)}rtdbUpdate(r,i,o){return this.getChannelTag(r),Xe.update(i,o)}rtdbRemove(r,i){return this.getChannelTag(r),Xe.remove(i)}rtdbPush(r,i,o){return this.getChannelTag(r),o===void 0?Xe.push(i):Xe.push(i,o)}rtdbRunTransaction(r,i,o){return this.getChannelTag(r),Xe.runTransaction(i,o)}rtdbOnValue(r,i,o,s,a){return this.getChannelTag(r),typeof s=="function"?a?Xe.onValue(i,o,s,a):Xe.onValue(i,o,s):s?Xe.onValue(i,o,s):Xe.onValue(i,o)}rtdbOnChildAdded(r,i,o,s){return this.getChannelTag(r),s?Xe.onChildAdded(i,o,s):Xe.onChildAdded(i,o)}rtdbOnChildChanged(r,i,o,s){return this.getChannelTag(r),s?Xe.onChildChanged(i,o,s):Xe.onChildChanged(i,o)}rtdbOnChildRemoved(r,i,o,s){return this.getChannelTag(r),s?Xe.onChildRemoved(i,o,s):Xe.onChildRemoved(i,o)}rtdbOff(r,i,o){Xe.off(r,i,o)}rtdbObjectVal$(r,i){return this.getChannelTag(r),Xe.objectVal(i)}rtdbListVal$(r,i){return this.getChannelTag(r),Xe.listVal(i)}rtdbStateChanges$(r,i){return this.getChannelTag(r),Xe.stateChanges(i)}rtdbOnDisconnectSet(r,i,o){return this.getChannelTag(r),Xe.onDisconnect(i).set(o)}rtdbOnDisconnectUpdate(r,i,o){return this.getChannelTag(r),Xe.onDisconnect(i).update(o)}rtdbOnDisconnectRemove(r,i){return this.getChannelTag(r),Xe.onDisconnect(i).remove()}rtdbOnDisconnectCancel(r,i){return this.getChannelTag(r),Xe.onDisconnect(i).cancel()}subscribe(r,i,o,s){return{unsubscribe:()=>{}}}publish(r,i,o){return I(this,null,function*(){return{ok:!1,code:"unimplemented",message:"RealtimeAdapter.publish wiring deferred to Phase A"}})}presence(r,i){return I(this,null,function*(){return{ok:!1,code:"unimplemented",message:"RealtimeAdapter.presence wiring deferred to Phase A"}})}onDisconnect(r,i){return I(this,null,function*(){return()=>{}})}};e.SERVER_TIME_OFFSET_PATH=".info/serverTimeOffset",e.\u0275fac=function(i){return new(i||e)(H(Iv),H(wt))},e.\u0275prov=Q({token:e,factory:e.\u0275fac,providedIn:"root"});let n=e;return n})();var Sh=null,rM=new Set;function h6(n){return rM.add(n),()=>rM.delete(n)}function xFe(n){return new Promise(e=>{let t=!1,r=null,i=()=>{if(!t){t=!0,clearTimeout(o);try{r?.()}catch{}e()}},o=setTimeout(i,n);r=h6(i),Sh&&i()})}function kFe(n){return Xh(()=>{let e=!1;try{if(n.isPortableFeedActive())return ct(null)}catch(r){e=!0,n.onError("portable check",r)}let t=new fe(r=>h6(()=>{try{(e||n.isPortableFeedActive())&&r.next(null)}catch(i){e=!0,r.next(null),n.onError("registration re-check",i)}}));return ds(n.firebaseDb$().pipe(pn(r=>!!r)),t)})}function oae(n){let e=n?.message;return typeof e=="string"&&/^NG0205(?!\d)/.test(e)}function FFe(n,e,t){try{return n()?.hasCapability?.(e)===!0}catch(r){try{t?.(r)}catch{}return!1}}function UFe(n){if(Sh=n??null,Sh)for(let e of Array.from(rM))try{e()}catch(t){M.catch("Error in portable adapter registration listener: ",t)}}var VFe=(()=>{let e=class e{constructor(r){this.injector=r}get configService(){return this._configService??=this.injector.get(Xi)}get authService(){return this._authService??=this.injector.get(js)}isPortableBackendActive(){return this.isPortableActive()}evaluatePortableGates(){try{return{chunkRegistered:!!Sh,flagOn:this.configService.getEnablePortableBackend()===!0,identifyRecorded:!!this.authService.getPortableBackend()}}catch(r){return oae(r)||M.catch("Error in AdapterSelectorService evaluatePortableGates: ",r),null}}isPortableActive(){let r=this.evaluatePortableGates();return!!r&&r.chunkRegistered&&r.flagOn&&r.identifyRecorded}isPortableBackendPending(){let r=this.evaluatePortableGates();return!!r&&!r.chunkRegistered&&r.flagOn&&r.identifyRecorded}isPortableSession(){let r=this.evaluatePortableGates();return!!r&&r.flagOn&&r.identifyRecorded}resolveDbAdapter(){return this.isPortableActive()?Sh.db:this.injector.get(l6)}resolveRealtimeAdapter(){return this.isPortableActive()?Sh.realtime:this.injector.get(d6)}};e.\u0275fac=function(i){return new(i||e)(H(We))},e.\u0275prov=Q({token:e,factory:e.\u0275fac,providedIn:"root"});let n=e;return n})();var HFe=new Set(SG);function $Fe(n){try{let e=n?.reasonCode;return typeof e!="string"||!e.trim()?"":` [reason: ${e.trim()}]`}catch{return""}}export{$ as a,ye as b,S6 as c,sae as d,aae as e,cae as f,I as g,pt as h,fe as i,Kv as j,Ct as k,ie as l,$a as m,f4 as n,p4 as o,Va as p,sr as q,ct as r,g4 as s,m4 as t,e4 as u,De as v,ja as w,Xh as x,E4 as y,Ri as z,A4 as A,Eo as B,K6 as C,ds as D,pn as E,F6 as F,$v as G,Wv as H,z6 as I,Hm as J,gn as K,qv as L,_o as M,zh as N,Ha as O,$m as P,Xv as Q,Y6 as R,Qv as S,X6 as T,Wa as U,br as V,us as W,Q6 as X,Wm as Y,J6 as Z,n4 as _,J as $,pE as aa,Q as ba,yo as ca,z as da,H as ea,Y as fa,qn as ga,Dn as ha,Ni as ia,$L as ja,WL as ka,nP as la,rP as ma,We as na,rn as oa,Gn as pa,ar as qa,Pi as ra,dc as sa,Or as ta,nz as ua,zt as va,aC as wa,yz as xa,As as ya,YE as za,d_ as Aa,wz as Ba,h8 as Ca,f8 as Da,p8 as Ea,E8 as Fa,_8 as Ga,x8 as Ha,Co as Ia,Ae as Ja,H8 as Ka,M5 as La,L5 as Ma,Fi as Na,Cf as Oa,No as Pa,A_ as Qa,ot as Ra,H5 as Sa,Bi as Ta,mc as Ua,Mk as Va,Oq as Wa,Cs as Xa,Gi as Ya,Rf as Za,Uk as _a,Gq as $a,Gk as ab,jk as bb,R_ as cb,Ds as db,Kk as eb,Yk as fb,Kq as gb,Xq as hb,Qq as ib,Jq as jb,Zq as kb,e9 as lb,t9 as mb,Xk as nb,zC as ob,qC as pb,Qk as qb,KC as rb,YC as sb,Jk as tb,XC as ub,QC as vb,e1 as wb,a9 as xb,t1 as yb,r1 as zb,i1 as Ab,h9 as Bb,p9 as Cb,g9 as Db,E9 as Eb,_9 as Fb,T9 as Gb,I9 as Hb,y9 as Ib,v9 as Jb,S9 as Kb,u1 as Lb,d1 as Mb,k9 as Nb,U9 as Ob,K9 as Pb,I1 as Qb,JC as Rb,y1 as Sb,v1 as Tb,S1 as Ub,J9 as Vb,A1 as Wb,D1 as Xb,Z9 as Yb,eK as Zb,tK as _b,nK as $b,aK as ac,cK as bc,lK as cc,uK as dc,dK as ec,hK as fc,fK as gc,pK as hc,gK as ic,mK as jc,EK as kc,_K as lc,IK as mc,vK as nc,SK as oc,AK as pc,CK as qc,DK as rc,wK as sc,Lf as tc,Pf as uc,rD as vc,Uve as wc,Vve as xc,Bve as yc,oY as zc,gD as Ac,Gve as Bc,jve as Cc,Hve as Dc,ji as Ec,rF as Fc,DY as Gc,IF as Hc,RY as Ic,vD as Jc,NY as Kc,wY as Lc,bY as Mc,OY as Nc,LY as Oc,xY as Pc,FY as Qc,SD as Rc,z_ as Sc,q_ as Tc,ZY as Uc,n7 as Vc,HF as Wc,D7 as Xc,R7 as Yc,xD as Zc,nU as _c,VD as $c,id as ad,mr as bd,ws as cd,vT as dd,Oc as ed,Xn as fd,Me as gd,Yt as hd,jn as id,Ki as jd,Qn as kd,Ls as ld,Jn as md,Be as nd,zQ as od,eMe as pd,tMe as qd,nMe as rd,ii as sd,Ps as td,Fo as ud,oi as vd,ue as wd,si as xd,Uo as yd,IMe as zd,yMe as Ad,vMe as Bd,ks as Cd,gZ as Dd,EZ as Ed,bZ as Fd,Fc as Gd,Uc as Hd,iPe as Id,oPe as Jd,Wke as Kd,zke as Ld,qke as Md,Kke as Nd,Yke as Od,Xke as Pd,Vo as Qd,SPe as Rd,APe as Sd,CPe as Td,oU as Ud,q7 as Vd,Qf as Wd,qt as Xd,M as Yd,uCe as Zd,dCe as _d,hCe as $d,fCe as ae,pCe as be,gCe as ce,mCe as de,Hi as ee,ECe as fe,_Ce as ge,TCe as he,ICe as ie,b7 as je,O7 as ke,M7 as le,L7 as me,P7 as ne,x7 as oe,yCe as pe,k7 as qe,kD as re,F7 as se,gr as te,tT as ue,U7 as ve,qu as we,bn as xe,V7 as ye,nT as ze,B7 as Ae,G7 as Be,j7 as Ce,vCe as De,SCe as Ee,ACe as Fe,H7 as Ge,F as He,eU as Ie,sDe as Je,aDe as Ke,cDe as Le,lDe as Me,Ku as Ne,fDe as Oe,pDe as Pe,gDe as Qe,kr as Re,mt as Se,sU as Te,aU as Ue,$De as Ve,WDe as We,cU as Xe,BD as Ye,lU as Ze,GD as _e,hT as $e,K7 as af,Y7 as bf,X7 as cf,Q7 as df,J7 as ef,Z7 as ff,eX as gf,tX as hf,nX as if,rX as jf,iX as kf,oX as lf,fU as mf,pU as nf,gU as of,mU as pf,EU as qf,$i as rf,mRe as sf,fT as tf,_U as uf,TU as vf,IU as wf,yU as xf,vU as yf,SU as zf,AU as Af,CU as Bf,DU as Cf,RU as Df,NU as Ef,wU as Ff,bU as Gf,JRe as Hf,ZRe as If,OU as Jf,jD as Kf,MU as Lf,LU as Mf,xU as Nf,kU as Of,MNe as Pf,LNe as Qf,sX as Rf,aX as Sf,Fbe as Tf,Nc as Uf,iV as Vf,Kbe as Wf,Dc as Xf,xo as Yf,Ybe as Zf,Xbe as _f,sV as $f,Qbe as ag,Jbe as bg,Zbe as cg,eOe as dg,tOe as eg,nOe as fg,rOe as gg,aV as hg,cV as ig,iOe as jg,oOe as kg,lX as lg,sOe as mg,aOe as ng,cOe as og,lOe as pg,lV as qg,Xu as rg,uOe as sg,uV as tg,hV as ug,zU as vg,qU as wg,uX as xg,dX as yg,_T as zg,Qu as Ag,dOe as Bg,hOe as Cg,Wi as Dg,fOe as Eg,Ju as Fg,pX as Gg,pOe as Hg,zD as Ig,YU as Jg,gX as Kg,gT as Lg,gOe as Mg,mOe as Ng,fV as Og,pV as Pg,mX as Qg,Cc as Rg,EX as Sg,IX as Tg,EOe as Ug,yX as Vg,_Oe as Wg,vX as Xg,SX as Yg,AX as Zg,CX as _g,wc as $g,TOe as ah,IOe as bh,yOe as ch,$D as dh,vOe as eh,RX as fh,SOe as gh,AOe as hh,_V as ih,COe as jh,DOe as kh,ROe as lh,NOe as mh,wOe as nh,bOe as oh,OOe as ph,pT as qh,MOe as rh,LOe as sh,POe as th,qD as uh,xOe as vh,eV as wh,kOe as xh,FOe as yh,UOe as zh,VOe as Ah,BOe as Bh,GOe as Ch,jOe as Dh,HOe as Eh,$Oe as Fh,WOe as Gh,zOe as Hh,qOe as Ih,KOe as Jh,YOe as Kh,XOe as Lh,QOe as Mh,JOe as Nh,ZOe as Oh,e0e as Ph,t0e as Qh,n0e as Rh,r0e as Sh,OX as Th,i0e as Uh,o0e as Vh,s0e as Wh,tV as Xh,a0e as Yh,c0e as Zh,tp as _h,MX as $h,l0e as ai,u0e as bi,d0e as ci,h0e as di,LX as ei,f0e as fi,p0e as gi,CV as hi,YD as ii,ed as ji,g0e as ki,nV as li,m0e as mi,E0e as ni,_0e as oi,Nt as pi,ld as qi,wCe as ri,bCe as si,OCe as ti,MCe as ui,LCe as vi,PCe as wi,xCe as xi,kCe as yi,FCe as zi,UCe as Ai,VCe as Bi,BCe as Ci,rT as Di,GCe as Ei,jCe as Fi,HCe as Gi,iT as Hi,$Ce as Ii,WCe as Ji,zCe as Ki,qCe as Li,KCe as Mi,YCe as Ni,XCe as Oi,oT as Pi,QCe as Qi,JCe as Ri,sT as Si,KF as Ti,YF as Ui,XF as Vi,QF as Wi,aT as Xi,Vs as Yi,wt as Zi,Xi as _i,Bc as $i,rte as aj,HPe as bj,KT as cj,lxe as dj,On as ej,uxe as fj,SG as gj,mxe as hj,Exe as ij,eFe as jj,tFe as kj,nFe as lj,rFe as mj,iFe as nj,oFe as oj,Tv as pj,a6 as qj,Iv as rj,l6 as sj,u6 as tj,d6 as uj,h6 as vj,xFe as wj,kFe as xj,FFe as yj,UFe as zj,VFe as Aj,$Fe as Bj,wG as Cj,bG as Dj,JT as Ej,JG as Fj,js as Gj};
|