var D2=Object.defineProperty,T2=Object.defineProperties;var x2=Object.getOwnPropertyDescriptors;var Yd=Object.getOwnPropertySymbols;var OS=Object.prototype.hasOwnProperty,PS=Object.prototype.propertyIsEnumerable;var NS=(n,e,t)=>e in n?D2(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,A=(n,e)=>{for(var t in e||={})OS.call(e,t)&&NS(n,t,e[t]);if(Yd)for(var t of Yd(e))PS.call(e,t)&&NS(n,t,e[t]);return n},G=(n,e)=>T2(n,x2(e));var LS=(n,e)=>{var t={};for(var i in n)OS.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&Yd)for(var i of Yd(n))e.indexOf(i)<0&&PS.call(n,i)&&(t[i]=n[i]);return t};var xv;function Kd(){return xv}function hi(n){let e=xv;return xv=n,e}var FS=Symbol("NotFound");function Qs(n){return n===FS||n?.name==="\u0275NotFound"}var kt=null,Qd=!1,Av=1,A2=null,Nt=Symbol("SIGNAL");function ie(n){let e=kt;return kt=n,e}function ef(){return kt}var Zs={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 Xs(n){if(Qd)throw new Error("");if(kt===null)return;kt.consumerOnSignalRead(n);let e=kt.producersTail;if(e!==void 0&&e.producer===n)return;let t,i=kt.recomputing;if(i&&(t=e!==void 0?e.nextProducer:kt.producers,t!==void 0&&t.producer===n)){kt.producersTail=t,t.lastReadVersion=n.version;return}let r=n.consumersTail;if(r!==void 0&&r.consumer===kt&&(!i||R2(r,kt)))return;let o=ea(kt),s={producer:n,consumer:kt,nextProducer:t,prevConsumer:r,lastReadVersion:n.version,nextConsumer:void 0};kt.producersTail=s,e!==void 0?e.nextProducer=s:kt.producers=s,o&&US(n,s)}function VS(){Av++}function tf(n){if(!(ea(n)&&!n.dirty)&&!(!n.dirty&&n.lastCleanEpoch===Av)){if(!n.producerMustRecompute(n)&&!ul(n)){Jd(n);return}n.producerRecomputeValue(n),Jd(n)}}function Mv(n){if(n.consumers===void 0)return;let e=Qd;Qd=!0;try{for(let t=n.consumers;t!==void 0;t=t.nextConsumer){let i=t.consumer;i.dirty||M2(i)}}finally{Qd=e}}function Rv(){return kt?.consumerAllowSignalWrites!==!1}function M2(n){n.dirty=!0,Mv(n),n.consumerMarkedDirty?.(n)}function Jd(n){n.dirty=!1,n.lastCleanEpoch=Av}function Js(n){return n&&jS(n),ie(n)}function jS(n){n.producersTail=void 0,n.recomputing=!0}function ll(n,e){ie(e),n&&BS(n)}function BS(n){n.recomputing=!1;let e=n.producersTail,t=e!==void 0?e.nextProducer:n.producers;if(t!==void 0){if(ea(n))do t=kv(t);while(t!==void 0);e!==void 0?e.nextProducer=void 0:n.producers=void 0}}function ul(n){for(let e=n.producers;e!==void 0;e=e.nextProducer){let t=e.producer,i=e.lastReadVersion;if(i!==t.version||(tf(t),i!==t.version))return!0}return!1}function dl(n){if(ea(n)){let e=n.producers;for(;e!==void 0;)e=kv(e)}n.producers=void 0,n.producersTail=void 0,n.consumers=void 0,n.consumersTail=void 0}function US(n,e){let t=n.consumersTail,i=ea(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,!i)for(let r=n.producers;r!==void 0;r=r.nextProducer)US(r.producer,r)}function kv(n){let e=n.producer,t=n.nextProducer,i=n.nextConsumer,r=n.prevConsumer;if(n.nextConsumer=void 0,n.prevConsumer=void 0,i!==void 0?i.prevConsumer=r:e.consumersTail=r,r!==void 0)r.nextConsumer=i;else if(e.consumers=i,!ea(e)){let o=e.producers;for(;o!==void 0;)o=kv(o)}return t}function ea(n){return n.consumerIsAlwaysLive||n.consumers!==void 0}function nf(n){A2?.(n)}function R2(n,e){let t=e.producersTail;if(t!==void 0){let i=e.producers;do{if(i===n)return!0;if(i===t)break;i=i.nextProducer}while(i!==void 0)}return!1}function rf(n,e){return Object.is(n,e)}function of(n,e){let t=Object.create(k2);t.computation=n,e!==void 0&&(t.equal=e);let i=()=>{if(tf(t),Xs(t),t.value===cl)throw t.error;return t.value};return i[Nt]=t,nf(t),i}var Zd=Symbol("UNSET"),Xd=Symbol("COMPUTING"),cl=Symbol("ERRORED"),k2=G(A({},Zs),{value:Zd,dirty:!0,error:null,equal:rf,kind:"computed",producerMustRecompute(n){return n.value===Zd||n.value===Xd},producerRecomputeValue(n){if(n.value===Xd)throw new Error("");let e=n.value;n.value=Xd;let t=Js(n),i,r=!1;try{i=n.computation(),ie(null),r=e!==Zd&&e!==cl&&i!==cl&&n.equal(e,i)}catch(o){i=cl,n.error=o}finally{ll(n,t)}if(r){n.value=e;return}n.value=i,n.version++}});function N2(){throw new Error}var HS=N2;function $S(n){HS(n)}function Nv(n){HS=n}var O2=null;function Ov(n,e){let t=Object.create(sf);t.value=n,e!==void 0&&(t.equal=e);let i=()=>zS(t);return i[Nt]=t,nf(t),[i,s=>ta(t,s),s=>Pv(t,s)]}function zS(n){return Xs(n),n.value}function ta(n,e){Rv()||$S(n),n.equal(n.value,e)||(n.value=e,P2(n))}function Pv(n,e){Rv()||$S(n),ta(n,e(n.value))}var sf=G(A({},Zs),{equal:rf,value:void 0,kind:"signal"});function P2(n){n.version++,VS(),Mv(n),O2?.(n)}function q(n){return typeof n=="function"}function na(n){let t=n(i=>{Error.call(i),i.stack=new Error().stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var af=na(n=>function(t){n(this),this.message=t?`${t.length} errors occurred during unsubscription: ${t.map((i,r)=>`${r+1}) ${i.toString()}`).join(` `)}`:"",this.name="UnsubscriptionError",this.errors=t});function ko(n,e){if(n){let t=n.indexOf(e);0<=t&&n.splice(t,1)}}var Xe=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:i}=this;if(q(i))try{i()}catch(o){e=o instanceof af?o.errors:[o]}let{_finalizers:r}=this;if(r){this._finalizers=null;for(let o of r)try{WS(o)}catch(s){e=e??[],s instanceof af?e=[...e,...s.errors]:e.push(s)}}if(e)throw new af(e)}}add(e){var t;if(e&&e!==this)if(this.closed)WS(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)&&ko(t,e)}remove(e){let{_finalizers:t}=this;t&&ko(t,e),e instanceof n&&e._removeParent(this)}};Xe.EMPTY=(()=>{let n=new Xe;return n.closed=!0,n})();var Lv=Xe.EMPTY;function cf(n){return n instanceof Xe||n&&"closed"in n&&q(n.remove)&&q(n.add)&&q(n.unsubscribe)}function WS(n){q(n)?n():n.unsubscribe()}var Wn={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var ia={setTimeout(n,e,...t){let{delegate:i}=ia;return i?.setTimeout?i.setTimeout(n,e,...t):setTimeout(n,e,...t)},clearTimeout(n){let{delegate:e}=ia;return(e?.clearTimeout||clearTimeout)(n)},delegate:void 0};function lf(n){ia.setTimeout(()=>{let{onUnhandledError:e}=Wn;if(e)e(n);else throw n})}function No(){}var qS=Fv("C",void 0,void 0);function GS(n){return Fv("E",void 0,n)}function YS(n){return Fv("N",n,void 0)}function Fv(n,e,t){return{kind:n,value:e,error:t}}var Oo=null;function ra(n){if(Wn.useDeprecatedSynchronousErrorHandling){let e=!Oo;if(e&&(Oo={errorThrown:!1,error:null}),n(),e){let{errorThrown:t,error:i}=Oo;if(Oo=null,t)throw i}}else n()}function KS(n){Wn.useDeprecatedSynchronousErrorHandling&&Oo&&(Oo.errorThrown=!0,Oo.error=n)}var Po=class extends Xe{constructor(e){super(),this.isStopped=!1,e?(this.destination=e,cf(e)&&e.add(this)):this.destination=V2}static create(e,t,i){return new oa(e,t,i)}next(e){this.isStopped?jv(YS(e),this):this._next(e)}error(e){this.isStopped?jv(GS(e),this):(this.isStopped=!0,this._error(e))}complete(){this.isStopped?jv(qS,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()}}},L2=Function.prototype.bind;function Vv(n,e){return L2.call(n,e)}var Bv=class{constructor(e){this.partialObserver=e}next(e){let{partialObserver:t}=this;if(t.next)try{t.next(e)}catch(i){uf(i)}}error(e){let{partialObserver:t}=this;if(t.error)try{t.error(e)}catch(i){uf(i)}else uf(e)}complete(){let{partialObserver:e}=this;if(e.complete)try{e.complete()}catch(t){uf(t)}}},oa=class extends Po{constructor(e,t,i){super();let r;if(q(e)||!e)r={next:e??void 0,error:t??void 0,complete:i??void 0};else{let o;this&&Wn.useDeprecatedNextContext?(o=Object.create(e),o.unsubscribe=()=>this.unsubscribe(),r={next:e.next&&Vv(e.next,o),error:e.error&&Vv(e.error,o),complete:e.complete&&Vv(e.complete,o)}):r=e}this.destination=new Bv(r)}};function uf(n){Wn.useDeprecatedSynchronousErrorHandling?KS(n):lf(n)}function F2(n){throw n}function jv(n,e){let{onStoppedNotification:t}=Wn;t&&ia.setTimeout(()=>t(n,e))}var V2={closed:!0,next:No,error:F2,complete:No};var sa=typeof Symbol=="function"&&Symbol.observable||"@@observable";function zt(n){return n}function Uv(...n){return Hv(n)}function Hv(n){return n.length===0?zt:n.length===1?n[0]:function(t){return n.reduce((i,r)=>r(i),t)}}var Y=(()=>{class n{constructor(t){t&&(this._subscribe=t)}lift(t){let i=new n;return i.source=this,i.operator=t,i}subscribe(t,i,r){let o=B2(t)?t:new oa(t,i,r);return ra(()=>{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(i){t.error(i)}}forEach(t,i){return i=QS(i),new i((r,o)=>{let s=new oa({next:a=>{try{t(a)}catch(c){o(c),s.unsubscribe()}},error:o,complete:r});this.subscribe(s)})}_subscribe(t){var i;return(i=this.source)===null||i===void 0?void 0:i.subscribe(t)}[sa](){return this}pipe(...t){return Hv(t)(this)}toPromise(t){return t=QS(t),new t((i,r)=>{let o;this.subscribe(s=>o=s,s=>r(s),()=>i(o))})}}return n.create=e=>new n(e),n})();function QS(n){var e;return(e=n??Wn.Promise)!==null&&e!==void 0?e:Promise}function j2(n){return n&&q(n.next)&&q(n.error)&&q(n.complete)}function B2(n){return n&&n instanceof Po||j2(n)&&cf(n)}function $v(n){return q(n?.lift)}function re(n){return e=>{if($v(e))return e.lift(function(t){try{return n(t,this)}catch(i){this.error(i)}});throw new TypeError("Unable to lift unknown Observable type")}}function J(n,e,t,i,r){return new zv(n,e,t,i,r)}var zv=class extends Po{constructor(e,t,i,r,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=r?function(a){try{r(a)}catch(c){e.error(c)}finally{this.unsubscribe()}}:super._error,this._complete=i?function(){try{i()}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 aa(){return re((n,e)=>{let t=null;n._refCount++;let i=J(e,void 0,void 0,void 0,()=>{if(!n||n._refCount<=0||0<--n._refCount){t=null;return}let r=n._connection,o=t;t=null,r&&(!o||r===o)&&r.unsubscribe(),e.unsubscribe()});n.subscribe(i),i.closed||(t=n.connect())})}var ca=class extends Y{constructor(e,t){super(),this.source=e,this.subjectFactory=t,this._subject=null,this._refCount=0,this._connection=null,$v(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 Xe;let t=this.getSubject();e.add(this.source.subscribe(J(t,void 0,()=>{this._teardown(),t.complete()},i=>{this._teardown(),t.error(i)},()=>this._teardown()))),e.closed&&(this._connection=null,e=Xe.EMPTY)}return e}refCount(){return aa()(this)}};var ZS=na(n=>function(){n(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});var Ge=(()=>{class n extends Y{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(t){let i=new df(this,this);return i.operator=t,i}_throwIfClosed(){if(this.closed)throw new ZS}next(t){ra(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(let i of this.currentObservers)i.next(t)}})}error(t){ra(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=t;let{observers:i}=this;for(;i.length;)i.shift().error(t)}})}complete(){ra(()=>{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:i,isStopped:r,observers:o}=this;return i||r?Lv:(this.currentObservers=null,o.push(t),new Xe(()=>{this.currentObservers=null,ko(o,t)}))}_checkFinalizedStatuses(t){let{hasError:i,thrownError:r,isStopped:o}=this;i?t.error(r):o&&t.complete()}asObservable(){let t=new Y;return t.source=this,t}}return n.create=(e,t)=>new df(e,t),n})(),df=class extends Ge{constructor(e,t){super(),this.destination=e,this.source=t}next(e){var t,i;(i=(t=this.destination)===null||t===void 0?void 0:t.next)===null||i===void 0||i.call(t,e)}error(e){var t,i;(i=(t=this.destination)===null||t===void 0?void 0:t.error)===null||i===void 0||i.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,i;return(i=(t=this.source)===null||t===void 0?void 0:t.subscribe(e))!==null&&i!==void 0?i:Lv}};var wt=class extends Ge{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:i}=this;if(e)throw t;return this._throwIfClosed(),i}next(e){super.next(this._value=e)}};var Wv={now(){return(Wv.delegate||Date).now()},delegate:void 0};var ff=class extends Xe{constructor(e,t){super()}schedule(e,t=0){return this}};var fl={setInterval(n,e,...t){let{delegate:i}=fl;return i?.setInterval?i.setInterval(n,e,...t):setInterval(n,e,...t)},clearInterval(n){let{delegate:e}=fl;return(e?.clearInterval||clearInterval)(n)},delegate:void 0};var la=class extends ff{constructor(e,t){super(e,t),this.scheduler=e,this.work=t,this.pending=!1}schedule(e,t=0){var i;if(this.closed)return this;this.state=e;let r=this.id,o=this.scheduler;return r!=null&&(this.id=this.recycleAsyncId(o,r,t)),this.pending=!0,this.delay=t,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(o,this.id,t),this}requestAsyncId(e,t,i=0){return fl.setInterval(e.flush.bind(e,this),i)}recycleAsyncId(e,t,i=0){if(i!=null&&this.delay===i&&this.pending===!1)return t;t!=null&&fl.clearInterval(t)}execute(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;let i=this._execute(e,t);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(e,t){let i=!1,r;try{this.work(e)}catch(o){i=!0,r=o||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),r}unsubscribe(){if(!this.closed){let{id:e,scheduler:t}=this,{actions:i}=t;this.work=this.state=this.scheduler=null,this.pending=!1,ko(i,this),e!=null&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null,super.unsubscribe()}}};var ua=class n{constructor(e,t=n.now){this.schedulerActionCtor=e,this.now=t}schedule(e,t=0,i){return new this.schedulerActionCtor(this,e).schedule(i,t)}};ua.now=Wv.now;var da=class extends ua{constructor(e,t=ua.now){super(e,t),this.actions=[],this._active=!1}flush(e){let{actions:t}=this;if(this._active){t.push(e);return}let i;this._active=!0;do if(i=e.execute(e.state,e.delay))break;while(e=t.shift());if(this._active=!1,i){for(;e=t.shift();)e.unsubscribe();throw i}}};var pi=new da(la),qv=pi;var hf=class extends la{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,i=0){return i!=null&&i>0||i==null&&this.delay>0?super.requestAsyncId(e,t,i):(e.flush(this),0)}};var pf=class extends da{};var Gv=new pf(hf);var Ot=new Y(n=>n.complete());function mf(n){return n&&q(n.schedule)}function Yv(n){return n[n.length-1]}function gf(n){return q(Yv(n))?n.pop():void 0}function mi(n){return mf(Yv(n))?n.pop():void 0}function XS(n,e){return typeof Yv(n)=="number"?n.pop():e}function Kv(n,e){var t={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(n);r=n.length&&(n=void 0),{value:n&&n[i++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Lo(n){return this instanceof Lo?(this.v=n,this):new Lo(n)}function tD(n,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=t.apply(n,e||[]),r,o=[];return r=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",s),r[Symbol.asyncIterator]=function(){return this},r;function s(h){return function(g){return Promise.resolve(g).then(h,d)}}function a(h,g){i[h]&&(r[h]=function(y){return new Promise(function(_,b){o.push([h,y,_,b])>1||c(h,y)})},g&&(r[h]=g(r[h])))}function c(h,g){try{l(i[h](g))}catch(y){f(o[0][3],y)}}function l(h){h.value instanceof Lo?Promise.resolve(h.value.v).then(u,d):f(o[0][2],h)}function u(h){c("next",h)}function d(h){c("throw",h)}function f(h,g){h(g),o.shift(),o.length&&c(o[0][0],o[0][1])}}function nD(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 JS=="function"?JS(n):n[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(o){t[o]=n[o]&&function(s){return new Promise(function(a,c){s=n[o](s),r(a,c,s.done,s.value)})}}function r(o,s,a,c){Promise.resolve(c).then(function(l){o({value:l,done:a})},s)}}var fa=n=>n&&typeof n.length=="number"&&typeof n!="function";function vf(n){return q(n?.then)}function yf(n){return q(n[sa])}function _f(n){return Symbol.asyncIterator&&q(n?.[Symbol.asyncIterator])}function bf(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 U2(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Ef=U2();function wf(n){return q(n?.[Ef])}function Cf(n){return tD(this,arguments,function*(){let t=n.getReader();try{for(;;){let{value:i,done:r}=yield Lo(t.read());if(r)return yield Lo(void 0);yield yield Lo(i)}}finally{t.releaseLock()}})}function If(n){return q(n?.getReader)}function Re(n){if(n instanceof Y)return n;if(n!=null){if(yf(n))return H2(n);if(fa(n))return $2(n);if(vf(n))return z2(n);if(_f(n))return iD(n);if(wf(n))return W2(n);if(If(n))return q2(n)}throw bf(n)}function H2(n){return new Y(e=>{let t=n[sa]();if(q(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function $2(n){return new Y(e=>{for(let t=0;t{n.then(t=>{e.closed||(e.next(t),e.complete())},t=>e.error(t)).then(null,lf)})}function W2(n){return new Y(e=>{for(let t of n)if(e.next(t),e.closed)return;e.complete()})}function iD(n){return new Y(e=>{G2(n,e).catch(t=>e.error(t))})}function q2(n){return iD(Cf(n))}function G2(n,e){var t,i,r,o;return eD(this,void 0,void 0,function*(){try{for(t=nD(n);i=yield t.next(),!i.done;){let s=i.value;if(e.next(s),e.closed)return}}catch(s){r={error:s}}finally{try{i&&!i.done&&(o=t.return)&&(yield o.call(t))}finally{if(r)throw r.error}}e.complete()})}function nn(n,e,t,i=0,r=!1){let o=e.schedule(function(){t(),r?n.add(this.schedule(null,i)):this.unsubscribe()},i);if(n.add(o),!r)return o}function Tr(n,e=0){return re((t,i)=>{t.subscribe(J(i,r=>nn(i,n,()=>i.next(r),e),()=>nn(i,n,()=>i.complete(),e),r=>nn(i,n,()=>i.error(r),e)))})}function xr(n,e=0){return re((t,i)=>{i.add(n.schedule(()=>t.subscribe(i),e))})}function rD(n,e){return Re(n).pipe(xr(e),Tr(e))}function oD(n,e){return Re(n).pipe(xr(e),Tr(e))}function sD(n,e){return new Y(t=>{let i=0;return e.schedule(function(){i===n.length?t.complete():(t.next(n[i++]),t.closed||this.schedule())})})}function aD(n,e){return new Y(t=>{let i;return nn(t,e,()=>{i=n[Ef](),nn(t,e,()=>{let r,o;try{({value:r,done:o}=i.next())}catch(s){t.error(s);return}o?t.complete():t.next(r)},0,!0)}),()=>q(i?.return)&&i.return()})}function Sf(n,e){if(!n)throw new Error("Iterable cannot be null");return new Y(t=>{nn(t,e,()=>{let i=n[Symbol.asyncIterator]();nn(t,e,()=>{i.next().then(r=>{r.done?t.complete():t.next(r.value)})},0,!0)})})}function cD(n,e){return Sf(Cf(n),e)}function lD(n,e){if(n!=null){if(yf(n))return rD(n,e);if(fa(n))return sD(n,e);if(vf(n))return oD(n,e);if(_f(n))return Sf(n,e);if(wf(n))return aD(n,e);if(If(n))return cD(n,e)}throw bf(n)}function ke(n,e){return e?lD(n,e):Re(n)}function H(...n){let e=mi(n);return ke(n,e)}function ha(n,e){let t=q(n)?n:()=>n,i=r=>r.error(t());return new Y(e?r=>e.schedule(i,0,r):i)}function Qv(n){return!!n&&(n instanceof Y||q(n.lift)&&q(n.subscribe))}var Gi=na(n=>function(){n(this),this.name="EmptyError",this.message="no elements in sequence"});function uD(n){return n instanceof Date&&!isNaN(n)}function z(n,e){return re((t,i)=>{let r=0;t.subscribe(J(i,o=>{i.next(n.call(e,o,r++))}))})}var{isArray:Y2}=Array;function K2(n,e){return Y2(e)?n(...e):n(e)}function pa(n){return z(e=>K2(n,e))}var{isArray:Q2}=Array,{getPrototypeOf:Z2,prototype:X2,keys:J2}=Object;function Df(n){if(n.length===1){let e=n[0];if(Q2(e))return{args:e,keys:null};if(eV(e)){let t=J2(e);return{args:t.map(i=>e[i]),keys:t}}}return{args:n,keys:null}}function eV(n){return n&&typeof n=="object"&&Z2(n)===X2}function Tf(n,e){return n.reduce((t,i,r)=>(t[i]=e[r],t),{})}function ma(...n){let e=mi(n),t=gf(n),{args:i,keys:r}=Df(n);if(i.length===0)return ke([],e);let o=new Y(tV(i,e,r?s=>Tf(r,s):zt));return t?o.pipe(pa(t)):o}function tV(n,e,t=zt){return i=>{dD(e,()=>{let{length:r}=n,o=new Array(r),s=r,a=r;for(let c=0;c{let l=ke(n[c],e),u=!1;l.subscribe(J(i,d=>{o[c]=d,u||(u=!0,a--),a||i.next(t(o.slice()))},()=>{--s||i.complete()}))},i)},i)}}function dD(n,e,t){n?nn(t,n,e):e()}function fD(n,e,t,i,r,o,s,a){let c=[],l=0,u=0,d=!1,f=()=>{d&&!c.length&&!l&&e.complete()},h=y=>l{o&&e.next(y),l++;let _=!1;Re(t(y,u++)).subscribe(J(e,b=>{r?.(b),o?h(b):e.next(b)},()=>{_=!0},void 0,()=>{if(_)try{for(l--;c.length&&lg(b)):g(b)}f()}catch(b){e.error(b)}}))};return n.subscribe(J(e,h,()=>{d=!0,f()})),()=>{a?.()}}function $e(n,e,t=1/0){return q(e)?$e((i,r)=>z((o,s)=>e(i,o,r,s))(Re(n(i,r))),t):(typeof e=="number"&&(t=e),re((i,r)=>fD(i,r,n,t)))}function Ar(n=1/0){return $e(zt,n)}function hD(){return Ar(1)}function Mr(...n){return hD()(ke(n,mi(n)))}function hl(n){return new Y(e=>{Re(n()).subscribe(e)})}function Zv(...n){let e=gf(n),{args:t,keys:i}=Df(n),r=new Y(o=>{let{length:s}=t;if(!s){o.complete();return}let a=new Array(s),c=s,l=s;for(let u=0;u{d||(d=!0,l--),a[u]=f},()=>c--,void 0,()=>{(!c||!d)&&(l||o.next(i?Tf(i,a):a),o.complete())}))}});return e?r.pipe(pa(e)):r}var nV=["addListener","removeListener"],iV=["addEventListener","removeEventListener"],rV=["on","off"];function Yi(n,e,t,i){if(q(t)&&(i=t,t=void 0),i)return Yi(n,e,t).pipe(pa(i));let[r,o]=aV(n)?iV.map(s=>a=>n[s](e,a,t)):oV(n)?nV.map(pD(n,e)):sV(n)?rV.map(pD(n,e)):[];if(!r&&fa(n))return $e(s=>Yi(s,e,t))(Re(n));if(!r)throw new TypeError("Invalid event target");return new Y(s=>{let a=(...c)=>s.next(1o(a)})}function pD(n,e){return t=>i=>n[t](e,i)}function oV(n){return q(n.addListener)&&q(n.removeListener)}function sV(n){return q(n.on)&&q(n.off)}function aV(n){return q(n.addEventListener)&&q(n.removeEventListener)}function ga(n=0,e,t=qv){let i=-1;return e!=null&&(mf(e)?t=e:i=e),new Y(r=>{let o=uD(n)?+n-t.now():n;o<0&&(o=0);let s=0;return t.schedule(function(){r.closed||(r.next(s++),0<=i?this.schedule(void 0,i):r.complete())},o)})}function Xv(n=0,e=pi){return n<0&&(n=0),ga(n,n,e)}function pl(...n){let e=mi(n),t=XS(n,1/0),i=n;return i.length?i.length===1?Re(i[0]):Ar(t)(ke(i,e)):Ot}function mn(n,e){return re((t,i)=>{let r=0;t.subscribe(J(i,o=>n.call(e,o,r++)&&i.next(o)))})}function xn(n){return re((e,t)=>{let i=null,r=!1,o;i=e.subscribe(J(t,void 0,void 0,s=>{o=Re(n(s,xn(n)(e))),i?(i.unsubscribe(),i=null,o.subscribe(t)):r=!0})),r&&(i.unsubscribe(),i=null,o.subscribe(t))})}function mD(n,e,t,i,r){return(o,s)=>{let a=t,c=e,l=0;o.subscribe(J(s,u=>{let d=l++;c=a?n(c,u,d):(a=!0,u),i&&s.next(c)},r&&(()=>{a&&s.next(c),s.complete()})))}}function Fo(n,e){return q(e)?$e(n,e,1):$e(n,1)}function Rr(n){return re((e,t)=>{let i=!1;e.subscribe(J(t,r=>{i=!0,t.next(r)},()=>{i||t.next(n),t.complete()}))})}function Wt(n){return n<=0?()=>Ot:re((e,t)=>{let i=0;e.subscribe(J(t,r=>{++i<=n&&(t.next(r),n<=i&&t.complete())}))})}function gD(){return re((n,e)=>{n.subscribe(J(e,No))})}function vD(n){return z(()=>n)}function Jv(n,e){return e?t=>Mr(e.pipe(Wt(1),gD()),t.pipe(Jv(n))):$e((t,i)=>Re(n(t,i)).pipe(Wt(1),vD(t)))}function ey(n,e=pi){let t=ga(n,e);return Jv(()=>t)}function ty(n,e=zt){return n=n??cV,re((t,i)=>{let r,o=!0;t.subscribe(J(i,s=>{let a=e(s);(o||!n(r,a))&&(o=!1,r=a,i.next(s))}))})}function cV(n,e){return n===e}function xf(n=lV){return re((e,t)=>{let i=!1;e.subscribe(J(t,r=>{i=!0,t.next(r)},()=>i?t.complete():t.error(n())))})}function lV(){return new Gi}function ml(n){return re((e,t)=>{try{e.subscribe(t)}finally{t.add(n)}})}function Ki(n,e){let t=arguments.length>=2;return i=>i.pipe(n?mn((r,o)=>n(r,o,i)):zt,Wt(1),t?Rr(e):xf(()=>new Gi))}function va(n){return n<=0?()=>Ot:re((e,t)=>{let i=[];e.subscribe(J(t,r=>{i.push(r),n{for(let r of i)t.next(r);t.complete()},void 0,()=>{i=null}))})}function ny(n,e){let t=arguments.length>=2;return i=>i.pipe(n?mn((r,o)=>n(r,o,i)):zt,va(1),t?Rr(e):xf(()=>new Gi))}function gl(n,e){return re(mD(n,e,arguments.length>=2,!0))}function iy(...n){let e=mi(n);return re((t,i)=>{(e?Mr(n,t,e):Mr(n,t)).subscribe(i)})}function Pt(n,e){return re((t,i)=>{let r=null,o=0,s=!1,a=()=>s&&!r&&i.complete();t.subscribe(J(i,c=>{r?.unsubscribe();let l=0,u=o++;Re(n(c,u)).subscribe(r=J(i,d=>i.next(e?e(c,d,u,l++):d),()=>{r=null,a()}))},()=>{s=!0,a()}))})}function Qi(n){return re((e,t)=>{Re(n).subscribe(J(t,()=>t.complete(),No)),!t.closed&&e.subscribe(t)})}function mt(n,e,t){let i=q(n)||e||t?{next:n,error:e,complete:t}:n;return i?re((r,o)=>{var s;(s=i.subscribe)===null||s===void 0||s.call(i);let a=!0;r.subscribe(J(o,c=>{var l;(l=i.next)===null||l===void 0||l.call(i,c),o.next(c)},()=>{var c;a=!1,(c=i.complete)===null||c===void 0||c.call(i),o.complete()},c=>{var l;a=!1,(l=i.error)===null||l===void 0||l.call(i,c),o.error(c)},()=>{var c,l;a&&((c=i.unsubscribe)===null||c===void 0||c.call(i)),(l=i.finalize)===null||l===void 0||l.call(i)}))}):zt}function yD(n,e){return re((t,i)=>{let{leading:r=!0,trailing:o=!1}=e??{},s=!1,a=null,c=null,l=!1,u=()=>{c?.unsubscribe(),c=null,o&&(h(),l&&i.complete())},d=()=>{c=null,l&&i.complete()},f=g=>c=Re(n(g)).subscribe(J(i,u,d)),h=()=>{if(s){s=!1;let g=a;a=null,i.next(g),!l&&f(g)}};t.subscribe(J(i,g=>{s=!0,a=g,!(c&&!c.closed)&&(r?h():f(g))},()=>{l=!0,!(o&&s&&c&&!c.closed)&&i.complete()}))})}function ry(n,e=pi,t){let i=ga(n,e);return yD(()=>i,t)}function _D(n){let e=ie(null);try{return n()}finally{ie(e)}}var Xi=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(".")}},vy=new Xi("20.3.16");var kf="https://angular.dev/best-practices/security#preventing-cross-site-scripting-xss",V=class extends Error{code;constructor(e,t){super(Gn(e,t)),this.code=e}};function uV(n){return`NG0${Math.abs(n)}`}function Gn(n,e){return`${uV(n)}${e?": "+e:""}`}var Or=globalThis;function we(n){for(let e in n)if(n[e]===we)return e;throw Error("")}function wD(n,e){for(let t in e)e.hasOwnProperty(t)&&!n.hasOwnProperty(t)&&(n[t]=e[t])}function Ji(n){if(typeof n=="string")return n;if(Array.isArray(n))return`[${n.map(Ji).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 i=t.indexOf(` `);return i>=0?t.slice(0,i):t}function Nf(n,e){return n?e?`${n} ${e}`:n:e||""}var dV=we({__forward_ref__:we});function vi(n){return n.__forward_ref__=vi,n.toString=function(){return Ji(this())},n}function Ct(n){return yy(n)?n():n}function yy(n){return typeof n=="function"&&n.hasOwnProperty(dV)&&n.__forward_ref__===vi}function L(n){return{token:n.token,providedIn:n.providedIn||null,factory:n.factory,value:void 0}}function yi(n){return{providers:n.providers||[],imports:n.imports||[]}}function bl(n){return fV(n,Of)}function _y(n){return bl(n)!==null}function fV(n,e){return n.hasOwnProperty(e)&&n[e]||null}function hV(n){let e=n?.[Of]??null;return e||null}function sy(n){return n&&n.hasOwnProperty(Mf)?n[Mf]:null}var Of=we({\u0275prov:we}),Mf=we({\u0275inj:we}),P=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=L({token:this,providedIn:t.providedIn||"root",factory:t.factory}))}get multi(){return this}toString(){return`InjectionToken ${this._desc}`}};function by(n){return n&&!!n.\u0275providers}var Ey=we({\u0275cmp:we}),wy=we({\u0275dir:we}),Cy=we({\u0275pipe:we}),Iy=we({\u0275mod:we}),yl=we({\u0275fac:we}),Ho=we({__NG_ELEMENT_ID__:we}),bD=we({__NG_ENV_ID__:we});function $o(n){return typeof n=="string"?n:n==null?"":String(n)}function CD(n){return typeof n=="function"?n.name||n.toString():typeof n=="object"&&n!=null&&typeof n.type=="function"?n.type.name||n.type.toString():$o(n)}var ID=we({ngErrorCode:we}),pV=we({ngErrorMessage:we}),mV=we({ngTokenPath:we});function Sy(n,e){return SD("",-200,e)}function Pf(n,e){throw new V(-201,!1)}function SD(n,e,t){let i=new V(e,n);return i[ID]=e,i[pV]=n,t&&(i[mV]=t),i}function gV(n){return n[ID]}var ay;function DD(){return ay}function qt(n){let e=ay;return ay=n,e}function Dy(n,e,t){let i=bl(n);if(i&&i.providedIn=="root")return i.value===void 0?i.value=i.factory():i.value;if(t&8)return null;if(e!==void 0)return e;Pf(n,"Injector")}var vV={},Vo=vV,cy="__NG_DI_FLAG__",ly=class{injector;constructor(e){this.injector=e}retrieve(e,t){let i=jo(t)||0;try{return this.injector.get(e,i&8?null:Vo,i)}catch(r){if(Qs(r))return r;throw r}}};function yV(n,e=0){let t=Kd();if(t===void 0)throw new V(-203,!1);if(t===null)return Dy(n,void 0,e);{let i=_V(e),r=t.retrieve(n,i);if(Qs(r)){if(i.optional)return null;throw r}return r}}function $(n,e=0){return(DD()||yV)(Ct(n),e)}function C(n,e){return $(n,jo(e))}function jo(n){return typeof n>"u"||typeof n=="number"?n:0|(n.optional&&8)|(n.host&&1)|(n.self&&2)|(n.skipSelf&&4)}function _V(n){return{optional:!!(n&8),host:!!(n&1),self:!!(n&2),skipSelf:!!(n&4)}}function uy(n){let e=[];for(let t=0;tArray.isArray(t)?Lf(t,e):e(t))}function Ty(n,e,t){e>=n.length?n.push(t):n.splice(e,0,t)}function El(n,e){return e>=n.length-1?n.pop():n.splice(e,1)[0]}function MD(n,e,t,i){let r=n.length;if(r==e)n.push(t,i);else if(r===1)n.push(i,n[0]),n[0]=t;else{for(r--,n.push(n[r-1],n[r]);r>e;){let o=r-2;n[r]=n[o],r--}n[e]=t,n[e+1]=i}}function Ff(n,e,t){let i=_a(n,e);return i>=0?n[i|1]=t:(i=~i,MD(n,i,e,t)),i}function Vf(n,e){let t=_a(n,e);if(t>=0)return n[t|1]}function _a(n,e){return EV(n,e,1)}function EV(n,e,t){let i=0,r=n.length>>t;for(;r!==i;){let o=i+(r-i>>1),s=n[o<e?r=o:i=o+1}return~(r<{t.push(s)};return Lf(e,s=>{let a=s;Rf(a,o,[],i)&&(r||=[],r.push(a))}),r!==void 0&&ND(r,o),t}function ND(n,e){for(let t=0;t{e(o,i)})}}function Rf(n,e,t,i){if(n=Ct(n),!n)return!1;let r=null,o=sy(n),s=!o&&er(n);if(!o&&!s){let c=n.ngModule;if(o=sy(c),o)r=c;else return!1}else{if(s&&!s.standalone)return!1;r=n}let a=i.has(r);if(s){if(a)return!1;if(i.add(r),s.dependencies){let c=typeof s.dependencies=="function"?s.dependencies():s.dependencies;for(let l of c)Rf(l,e,t,i)}}else if(o){if(o.imports!=null&&!a){i.add(r);let l;try{Lf(o.imports,u=>{Rf(u,e,t,i)&&(l||=[],l.push(u))})}finally{}l!==void 0&&ND(l,e)}if(!a){let l=kr(r)||(()=>new r);e({provide:r,useFactory:l,deps:Gt},r),e({provide:Ay,useValue:r,multi:!0},r),e({provide:An,useValue:()=>$(r),multi:!0},r)}let c=o.providers;if(c!=null&&!a){let l=n;ky(c,u=>{e(u,l)})}}else return!1;return r!==n&&n.providers!==void 0}function ky(n,e){for(let t of n)by(t)&&(t=t.\u0275providers),Array.isArray(t)?ky(t,e):e(t)}var wV=we({provide:String,useValue:we});function OD(n){return n!==null&&typeof n=="object"&&wV in n}function CV(n){return!!(n&&n.useExisting)}function IV(n){return!!(n&&n.useFactory)}function Bo(n){return typeof n=="function"}function PD(n){return!!n.useClass}var wl=new P(""),Af={},ED={},oy;function Cl(){return oy===void 0&&(oy=new _l),oy}var it=class{},Uo=class extends it{parent;source;scopes;records=new Map;_ngOnDestroyHooks=new Set;_onDestroyHooks=[];get destroyed(){return this._destroyed}_destroyed=!1;injectorDefTypes;constructor(e,t,i,r){super(),this.parent=t,this.source=i,this.scopes=r,fy(e,s=>this.processProvider(s)),this.records.set(xy,ya(void 0,this)),r.has("environment")&&this.records.set(it,ya(void 0,this));let o=this.records.get(wl);o!=null&&typeof o.value=="string"&&this.scopes.add(o.value),this.injectorDefTypes=new Set(this.get(Ay,Gt,{self:!0}))}retrieve(e,t){let i=jo(t)||0;try{return this.get(e,Vo,i)}catch(r){if(Qs(r))return r;throw r}}destroy(){vl(this),this._destroyed=!0;let e=ie(null);try{for(let i of this._ngOnDestroyHooks)i.ngOnDestroy();let t=this._onDestroyHooks;this._onDestroyHooks=[];for(let i of t)i()}finally{this.records.clear(),this._ngOnDestroyHooks.clear(),this.injectorDefTypes.clear(),ie(e)}}onDestroy(e){return vl(this),this._onDestroyHooks.push(e),()=>this.removeOnDestroy(e)}runInContext(e){vl(this);let t=hi(this),i=qt(void 0),r;try{return e()}finally{hi(t),qt(i)}}get(e,t=Vo,i){if(vl(this),e.hasOwnProperty(bD))return e[bD](this);let r=jo(i),o,s=hi(this),a=qt(void 0);try{if(!(r&4)){let l=this.records.get(e);if(l===void 0){let u=AV(e)&&bl(e);u&&this.injectableDefInScope(u)?l=ya(dy(e),Af):l=null,this.records.set(e,l)}if(l!=null)return this.hydrate(e,l,r)}let c=r&2?Cl():this.parent;return t=r&8&&t===Vo?null:t,c.get(e,t)}catch(c){let l=gV(c);throw l===-200||l===-201?new V(l,null):c}finally{qt(a),hi(s)}}resolveInjectorInitializers(){let e=ie(null),t=hi(this),i=qt(void 0),r;try{let o=this.get(An,Gt,{self:!0});for(let s of o)s()}finally{hi(t),qt(i),ie(e)}}toString(){let e=[],t=this.records;for(let i of t.keys())e.push(Ji(i));return`R3Injector[${e.join(", ")}]`}processProvider(e){e=Ct(e);let t=Bo(e)?e:Ct(e&&e.provide),i=DV(e);if(!Bo(e)&&e.multi===!0){let r=this.records.get(t);r||(r=ya(void 0,Af,!0),r.factory=()=>uy(r.multi),this.records.set(t,r)),t=e,r.multi.push(e)}this.records.set(t,i)}hydrate(e,t,i){let r=ie(null);try{if(t.value===ED)throw Sy(Ji(e));return t.value===Af&&(t.value=ED,t.value=t.factory(void 0,i)),typeof t.value=="object"&&t.value&&xV(t.value)&&this._ngOnDestroyHooks.add(t.value),t.value}finally{ie(r)}}injectableDefInScope(e){if(!e.providedIn)return!1;let t=Ct(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 dy(n){let e=bl(n),t=e!==null?e.factory:kr(n);if(t!==null)return t;if(n instanceof P)throw new V(204,!1);if(n instanceof Function)return SV(n);throw new V(204,!1)}function SV(n){if(n.length>0)throw new V(204,!1);let t=hV(n);return t!==null?()=>t.factory(n):()=>new n}function DV(n){if(OD(n))return ya(void 0,n.useValue);{let e=Ny(n);return ya(e,Af)}}function Ny(n,e,t){let i;if(Bo(n)){let r=Ct(n);return kr(r)||dy(r)}else if(OD(n))i=()=>Ct(n.useValue);else if(IV(n))i=()=>n.useFactory(...uy(n.deps||[]));else if(CV(n))i=(r,o)=>$(Ct(n.useExisting),o!==void 0&&o&8?8:void 0);else{let r=Ct(n&&(n.useClass||n.provide));if(TV(n))i=()=>new r(...uy(n.deps));else return kr(r)||dy(r)}return i}function vl(n){if(n.destroyed)throw new V(205,!1)}function ya(n,e,t=!1){return{factory:n,value:e,multi:t?[]:void 0}}function TV(n){return!!n.deps}function xV(n){return n!==null&&typeof n=="object"&&typeof n.ngOnDestroy=="function"}function AV(n){return typeof n=="function"||typeof n=="object"&&n.ngMetadataName==="InjectionToken"}function fy(n,e){for(let t of n)Array.isArray(t)?fy(t,e):t&&by(t)?fy(t.\u0275providers,e):e(t)}function at(n,e){let t;n instanceof Uo?(vl(n),t=n):t=new ly(n);let i,r=hi(t),o=qt(void 0);try{return e()}finally{hi(r),qt(o)}}function LD(){return DD()!==void 0||Kd()!=null}var Yt=0,U=1,Q=2,rt=3,Mn=4,Rn=5,gn=6,ba=7,Lt=8,kn=9,_i=10,Ce=11,Ea=12,Oy=13,zo=14,rn=15,Lr=16,Wo=17,bi=18,Il=19,Py=20,Zi=21,Uf=22,Sl=23,vn=24,qo=25,Dl=26,Be=27,FD=1,Yn=6,Ei=7,Tl=8,Go=9,Ft=10;function yn(n){return Array.isArray(n)&&typeof n[FD]=="object"}function _n(n){return Array.isArray(n)&&n[FD]===!0}function Ly(n){return(n.flags&4)!==0}function tr(n){return n.componentOffset>-1}function xl(n){return(n.flags&1)===1}function wi(n){return!!n.template}function Yo(n){return(n[Q]&512)!==0}function Fr(n){return(n[Q]&256)===256}var VD="svg",jD="math";function bn(n){for(;Array.isArray(n);)n=n[Yt];return n}function Fy(n,e){return bn(e[n])}function Nn(n,e){return bn(e[n.index])}function wa(n,e){return n.data[e]}function BD(n,e){return n[e]}function Vy(n,e,t,i){t>=n.data.length&&(n.data[t]=null,n.blueprint[t]=null),e[t]=i}function On(n,e){let t=e[n];return yn(t)?t:t[Yt]}function UD(n){return(n[Q]&4)===4}function Hf(n){return(n[Q]&128)===128}function HD(n){return _n(n[rt])}function Ko(n,e){return e==null?null:n[e]}function jy(n){n[Wo]=0}function By(n){n[Q]&1024||(n[Q]|=1024,Hf(n)&&Ca(n))}function $D(n,e){for(;n>0;)e=e[zo],n--;return e}function Al(n){return!!(n[Q]&9216||n[vn]?.dirty)}function $f(n){n[_i].changeDetectionScheduler?.notify(8),n[Q]&64&&(n[Q]|=1024),Al(n)&&Ca(n)}function Ca(n){n[_i].changeDetectionScheduler?.notify(0);let e=Nr(n);for(;e!==null&&!(e[Q]&8192||(e[Q]|=8192,!Hf(e)));)e=Nr(e)}function Uy(n,e){if(Fr(n))throw new V(911,!1);n[Zi]===null&&(n[Zi]=[]),n[Zi].push(e)}function zD(n,e){if(n[Zi]===null)return;let t=n[Zi].indexOf(e);t!==-1&&n[Zi].splice(t,1)}function Nr(n){let e=n[rt];return _n(e)?e[rt]:e}function Hy(n){return n[ba]??=[]}function $y(n){return n.cleanup??=[]}function WD(n,e,t,i){let r=Hy(e);r.push(t),n.firstCreatePass&&$y(n).push(i,r.length-1)}var oe={lFrame:rT(null),bindingsEnabled:!0,skipHydrationRootTNode:null};var hy=!1;function qD(){return oe.lFrame.elementDepthCount}function GD(){oe.lFrame.elementDepthCount++}function zy(){oe.lFrame.elementDepthCount--}function Wy(){return oe.bindingsEnabled}function qy(){return oe.skipHydrationRootTNode!==null}function Gy(n){return oe.skipHydrationRootTNode===n}function YD(n){oe.skipHydrationRootTNode=n}function Yy(){oe.skipHydrationRootTNode=null}function ae(){return oe.lFrame.lView}function gt(){return oe.lFrame.tView}function ze(n){return oe.lFrame.contextLView=n,n[Lt]}function We(n){return oe.lFrame.contextLView=null,n}function vt(){let n=Ky();for(;n!==null&&n.type===64;)n=n.parent;return n}function Ky(){return oe.lFrame.currentTNode}function KD(){let n=oe.lFrame,e=n.currentTNode;return n.isParent?e:e.parent}function Ia(n,e){let t=oe.lFrame;t.currentTNode=n,t.isParent=e}function Qy(){return oe.lFrame.isParent}function QD(){oe.lFrame.isParent=!1}function Zy(){return hy}function Xy(n){let e=hy;return hy=n,e}function zf(){let n=oe.lFrame,e=n.bindingRootIndex;return e===-1&&(e=n.bindingRootIndex=n.tView.bindingStartIndex),e}function ZD(){return oe.lFrame.bindingIndex}function XD(n){return oe.lFrame.bindingIndex=n}function Ml(){return oe.lFrame.bindingIndex++}function Wf(n){let e=oe.lFrame,t=e.bindingIndex;return e.bindingIndex=e.bindingIndex+n,t}function JD(){return oe.lFrame.inI18n}function eT(n,e){let t=oe.lFrame;t.bindingIndex=t.bindingRootIndex=n,qf(e)}function tT(){return oe.lFrame.currentDirectiveIndex}function qf(n){oe.lFrame.currentDirectiveIndex=n}function nT(n){let e=oe.lFrame.currentDirectiveIndex;return e===-1?null:n[e]}function Jy(){return oe.lFrame.currentQueryIndex}function Gf(n){oe.lFrame.currentQueryIndex=n}function MV(n){let e=n[U];return e.type===2?e.declTNode:e.type===1?n[Rn]:null}function e_(n,e,t){if(t&4){let r=e,o=n;for(;r=r.parent,r===null&&!(t&1);)if(r=MV(o),r===null||(o=o[zo],r.type&10))break;if(r===null)return!1;e=r,n=o}let i=oe.lFrame=iT();return i.currentTNode=e,i.lView=n,!0}function Yf(n){let e=iT(),t=n[U];oe.lFrame=e,e.currentTNode=t.firstChild,e.lView=n,e.tView=t,e.contextLView=n,e.bindingIndex=t.bindingStartIndex,e.inI18n=!1}function iT(){let n=oe.lFrame,e=n===null?null:n.child;return e===null?rT(n):e}function rT(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 oT(){let n=oe.lFrame;return oe.lFrame=n.parent,n.currentTNode=null,n.lView=null,n}var t_=oT;function Kf(){let n=oT();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 sT(n){return(oe.lFrame.contextLView=$D(n,oe.lFrame.contextLView))[Lt]}function nr(){return oe.lFrame.selectedIndex}function Vr(n){oe.lFrame.selectedIndex=n}function Qf(){let n=oe.lFrame;return wa(n.tView,n.selectedIndex)}function n_(){return oe.lFrame.currentNamespace}var aT=!0;function Zf(){return aT}function ir(n){aT=n}function py(n,e=null,t=null,i){let r=i_(n,e,t,i);return r.resolveInjectorInitializers(),r}function i_(n,e=null,t=null,i,r=new Set){let o=[t||Gt,kD(n)];return i=i||(typeof n=="object"?void 0:Ji(n)),new Uo(o,e||Cl(),i||null,r)}var Ye=class n{static THROW_IF_NOT_FOUND=Vo;static NULL=new _l;static create(e,t){if(Array.isArray(e))return py({name:""},t,e,"");{let i=e.name??"";return py({name:i},e.parent,e.providers,i)}}static \u0275prov=L({token:n,providedIn:"any",factory:()=>$(xy)});static __NG_ELEMENT_ID__=-1},Pe=new P(""),Pn=(()=>{class n{static __NG_ELEMENT_ID__=RV;static __NG_ENV_ID__=t=>t}return n})(),my=class extends Pn{_lView;constructor(e){super(),this._lView=e}get destroyed(){return Fr(this._lView)}onDestroy(e){let t=this._lView;return Uy(t,e),()=>zD(t,e)}};function RV(){return new my(ae())}var qn=class{_console=console;handleError(e){this._console.error("ERROR",e)}},Vt=new P("",{providedIn:"root",factory:()=>{let n=C(it),e;return t=>{n.destroyed&&!e?setTimeout(()=>{throw t}):(e??=n.get(qn),e.handleError(t))}}}),cT={provide:An,useValue:()=>void C(qn),multi:!0},kV=new P("",{providedIn:"root",factory:()=>{let n=C(Pe).defaultView;if(!n)return;let e=C(Vt),t=o=>{e(o.reason),o.preventDefault()},i=o=>{o.error?e(o.error):e(new Error(o.message,{cause:o})),o.preventDefault()},r=()=>{n.addEventListener("unhandledrejection",t),n.addEventListener("error",i)};typeof Zone<"u"?Zone.root.run(r):r(),C(Pn).onDestroy(()=>{n.removeEventListener("error",i),n.removeEventListener("unhandledrejection",t)})}});function r_(){return It([RD(()=>void C(kV))])}function o_(n){return typeof n=="function"&&n[Nt]!==void 0}function on(n,e){let[t,i,r]=Ov(n,e?.equal),o=t,s=o[Nt];return o.set=i,o.update=r,o.asReadonly=lT.bind(o),o}function lT(){let n=this[Nt];if(n.readonlyFn===void 0){let e=()=>this();e[Nt]=n,n.readonlyFn=e}return n.readonlyFn}function s_(n){return o_(n)&&typeof n.set=="function"}var Xf=(()=>{class n{view;node;constructor(t,i){this.view=t,this.node=i}static __NG_ELEMENT_ID__=NV}return n})();function NV(){return new Xf(ae(),vt())}var gi=class{},Sa=new P("",{providedIn:"root",factory:()=>!1});var a_=new P(""),Jf=new P(""),Kn=(()=>{class n{taskId=0;pendingTasks=new Set;destroyed=!1;pendingTask=new wt(!1);get hasPendingTasks(){return this.destroyed?!1:this.pendingTask.value}get hasPendingTasksObservable(){return this.destroyed?new Y(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=L({token:n,providedIn:"root",factory:()=>new n})}return n})(),jr=(()=>{class n{internalPendingTasks=C(Kn);scheduler=C(gi);errorHandler=C(Vt);add(){let t=this.internalPendingTasks.add();return()=>{this.internalPendingTasks.has(t)&&(this.scheduler.notify(11),this.internalPendingTasks.remove(t))}}run(t){let i=this.add();t().catch(this.errorHandler).finally(i)}static \u0275prov=L({token:n,providedIn:"root",factory:()=>new n})}return n})();function Rl(...n){}var c_=(()=>{class n{static \u0275prov=L({token:n,providedIn:"root",factory:()=>new gy})}return n})(),gy=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,i=this.queues.get(t);i.has(e)&&(i.delete(e),e.dirty&&this.dirtyEffectCount--)}enqueue(e){let t=e.zone;this.queues.has(t)||this.queues.set(t,new Set);let i=this.queues.get(t);i.has(e)||i.add(e)}flush(){for(;this.dirtyEffectCount>0;){let e=!1;for(let[t,i]of this.queues)t===null?e||=this.flushQueue(i):e||=t.run(()=>this.flushQueue(i));e||(this.dirtyEffectCount=0)}}flushQueue(e){let t=!1;for(let i of e)i.dirty&&(this.dirtyEffectCount--,t=!0,i.run());return t}};var eh={JSACTION:"jsaction"};function Pa(n){return{toString:n}.toString()}var th="__parameters__";function UV(n){return function(...t){if(n){let i=n(...t);for(let r in i)this[r]=i[r]}}}function HV(n,e,t){return Pa(()=>{let i=UV(e);function r(...o){if(this instanceof r)return i.apply(this,o),this;let s=new r(...o);return a.annotation=s,a;function a(c,l,u){let d=c.hasOwnProperty(th)?c[th]:Object.defineProperty(c,th,{value:[]})[th];for(;d.length<=u;)d.push(null);return(d[u]=d[u]||[]).push(s),c}}return r.prototype.ngMetadataName=n,r.annotationCls=r,r})}var sn=TD(HV("Optional"),8);function $V(n){return typeof n=="function"}var dh=class{previousValue;currentValue;firstChange;constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}isFirstChange(){return this.firstChange}};function GT(n,e,t,i){e!==null?e.applyValueToInputSignal(e,i):n[t]=i}var Xn=(()=>{let n=()=>YT;return n.ngInherit=!0,n})();function YT(n){return n.type.prototype.ngOnChanges&&(n.setInput=WV),zV}function zV(){let n=QT(this),e=n?.current;if(e){let t=n.previous;if(t===Pr)n.previous=e;else for(let i in e)t[i]=e[i];n.current=null,this.ngOnChanges(e)}}function WV(n,e,t,i,r){let o=this.declaredInputs[i],s=QT(n)||qV(n,{previous:Pr,current:null}),a=s.current||(s.current={}),c=s.previous,l=c[o];a[o]=new dh(l&&l.currentValue,t,c===Pr),GT(n,e,r,t)}var KT="__ngSimpleChanges__";function QT(n){return n[KT]||null}function qV(n,e){return n[KT]=e}var uT=[];var be=function(n,e=null,t){for(let i=0;i=i)break}else e[c]<0&&(n[Wo]+=65536),(a>14>16&&(n[Q]&3)===e&&(n[Q]+=16384,dT(a,o)):dT(a,o)}var Ta=-1,Xo=class{factory;name;injectImpl;resolving=!1;canSeeViewProviders;multi;componentProviders;index;providerFactory;constructor(e,t,i,r){this.factory=e,this.name=r,this.canSeeViewProviders=t,this.injectImpl=i}};function KV(n){return(n.flags&8)!==0}function QV(n){return(n.flags&16)!==0}function ZV(n,e,t){let i=0;for(;ie){s=o-1;break}}}for(;o>16}function hh(n,e){let t=JV(n),i=e;for(;t>0;)i=i[zo],t--;return i}var w_=!0;function ph(n){let e=w_;return w_=n,e}var ej=256,tx=ej-1,nx=5,tj=0,Ci={};function nj(n,e,t){let i;typeof t=="string"?i=t.charCodeAt(0)||0:t.hasOwnProperty(Ho)&&(i=t[Ho]),i==null&&(i=t[Ho]=tj++);let r=i&tx,o=1<>nx)]|=o}function mh(n,e){let t=ix(n,e);if(t!==-1)return t;let i=e[U];i.firstCreatePass&&(n.injectorIndex=e.length,u_(i.data,n),u_(e,null),u_(i.blueprint,null));let r=K_(n,e),o=n.injectorIndex;if(ex(r)){let s=fh(r),a=hh(r,e),c=a[U].data;for(let l=0;l<8;l++)e[o+l]=a[s+l]|c[s+l]}return e[o+8]=r,o}function u_(n,e){n.push(0,0,0,0,0,0,0,0,e)}function ix(n,e){return n.injectorIndex===-1||n.parent&&n.parent.injectorIndex===n.injectorIndex||e[n.injectorIndex+8]===null?-1:n.injectorIndex}function K_(n,e){if(n.parent&&n.parent.injectorIndex!==-1)return n.parent.injectorIndex;let t=0,i=null,r=e;for(;r!==null;){if(i=cx(r),i===null)return Ta;if(t++,r=r[zo],i.injectorIndex!==-1)return i.injectorIndex|t<<16}return Ta}function C_(n,e,t){nj(n,e,t)}function ij(n,e){if(e==="class")return n.classes;if(e==="style")return n.styles;let t=n.attrs;if(t){let i=t.length,r=0;for(;r>20,d=i?a:a+u,f=r?a+u:l;for(let h=d;h=c&&g.type===t)return h}if(r){let h=s[c];if(h&&wi(h)&&h.type===t)return c}return null}function Ol(n,e,t,i,r){let o=n[t],s=e.data;if(o instanceof Xo){let a=o;if(a.resolving){let h=CD(s[t]);throw Sy(h)}let c=ph(a.canSeeViewProviders);a.resolving=!0;let l=s[t].type||s[t],u,d=a.injectImpl?qt(a.injectImpl):null,f=e_(n,i,0);try{o=n[t]=a.factory(void 0,r,s,n,i),e.firstCreatePass&&t>=i.directiveStart&&GV(t,s[t],e)}finally{d!==null&&qt(d),ph(c),a.resolving=!1,t_()}}return o}function oj(n){if(typeof n=="string")return n.charCodeAt(0)||0;let e=n.hasOwnProperty(Ho)?n[Ho]:void 0;return typeof e=="number"?e>=0?e&tx:sj:e}function hT(n,e,t){let i=1<>nx)]&i)}function pT(n,e){return!(n&2)&&!(n&1&&e)}var Zo=class{_tNode;_lView;constructor(e,t){this._tNode=e,this._lView=t}get(e,t,i){return sx(this._tNode,this._lView,e,jo(i),t)}};function sj(){return new Zo(vt(),ae())}function La(n){return Pa(()=>{let e=n.prototype.constructor,t=e[yl]||I_(e),i=Object.prototype,r=Object.getPrototypeOf(n.prototype).constructor;for(;r&&r!==i;){let o=r[yl]||I_(r);if(o&&o!==t)return o;r=Object.getPrototypeOf(r)}return o=>new o})}function I_(n){return yy(n)?()=>{let e=I_(Ct(n));return e&&e()}:kr(n)}function aj(n,e,t,i,r){let o=n,s=e;for(;o!==null&&s!==null&&s[Q]&2048&&!Yo(s);){let a=ax(o,s,t,i|2,Ci);if(a!==Ci)return a;let c=o.parent;if(!c){let l=s[Py];if(l){let u=l.get(t,Ci,i);if(u!==Ci)return u}c=cx(s),s=s[zo]}o=c}return r}function cx(n){let e=n[U],t=e.type;return t===2?e.declTNode:t===1?n[Rn]:null}function Bl(n){return ij(vt(),n)}function cj(){return Fa(vt(),ae())}function Fa(n,e){return new an(Nn(n,e))}var an=(()=>{class n{nativeElement;constructor(t){this.nativeElement=t}static __NG_ELEMENT_ID__=cj}return n})();function lj(n){return n instanceof an?n.nativeElement:n}function uj(){return this._results[Symbol.iterator]()}var gh=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 Ge}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 i=AD(e);(this._changesDetected=!xD(this._results,i,t))&&(this._results=i,this.length=i.length,this.last=i[this.length-1],this.first=i[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]=uj},lx="ngSkipHydration",dj="ngskiphydration";function ux(n){let e=n.mergedAttrs;if(e===null)return!1;for(let t=0;tmj}),mj="ng",kh=new P(""),ns=new P("",{providedIn:"platform",factory:()=>"unknown"});var Nh=new P("",{providedIn:"root",factory:()=>Ul().body?.querySelector("[ngCspNonce]")?.getAttribute("ngCspNonce")||null});function gj(){let n=new is;return n.store=vj(Ul(),C(Si)),n}var is=(()=>{class n{static \u0275prov=L({token:n,providedIn:"root",factory:gj});store={};onSerializeCallbacks={};get(t,i){return this.store[t]!==void 0?this.store[t]:i}set(t,i){this.store[t]=i}remove(t){delete this.store[t]}hasKey(t){return this.store.hasOwnProperty(t)}get isEmpty(){return Object.keys(this.store).length===0}onSerialize(t,i){this.onSerializeCallbacks[t]=i}toJson(){for(let t in this.onSerializeCallbacks)if(this.onSerializeCallbacks.hasOwnProperty(t))try{this.store[t]=this.onSerializeCallbacks[t]()}catch(i){console.warn("Exception in onSerialize callback: ",i)}return JSON.stringify(this.store).replace(/Dx});var tb=new P(""),Tx=!1,xx=new P(""),nb=new P("",{providedIn:"root",factory:()=>new Map});var $l="ngb";var Ax=(n,e,t)=>{let i=n,r=i.__jsaction_fns??new Map,o=r.get(e)??[];o.push(t),r.set(e,o),i.__jsaction_fns=r},Mx=(n,e)=>{let t=n,i=t.getAttribute($l)??"",r=e.get(i)??new Set;r.has(t)||r.add(t),e.set(i,r)};var Rx=n=>{n.removeAttribute(eh.JSACTION),n.removeAttribute($l),n.__jsaction_fns=void 0},kx=new P("",{providedIn:"root",factory:()=>({})});function ib(n,e){let t=e?.__jsaction_fns?.get(n.type);if(!(!t||!e?.isConnected))for(let i of t)i(n)}var T_=new Map;function Nx(n,e){return T_.set(n,e),()=>T_.delete(n)}var gT=!1,Ox=(n,e,t,i)=>{};function bj(n,e,t,i){Ox(n,e,t,i)}function Px(){gT||(Ox=(n,e,t,i)=>{let r=n[kn].get(Si);T_.get(r)?.(e,t,i)},gT=!0)}var Ph=new P("");function Lh(n){return(n.flags&32)===32}var Ej="__nghData__",rb=Ej,wj="__nghDeferData__",Lx=wj;var ch="ngh",Fx="nghm",Vx=()=>null;function Cj(n,e,t=!1){let i=n.getAttribute(ch);if(i==null)return null;let[r,o]=i.split("|");if(i=t?o:r,!i)return null;let s=o?`|${o}`:"",a=t?r:s,c={};if(i!==""){let u=e.get(is,null,{optional:!0});u!==null&&(c=u.get(rb,[])[Number(i)])}let l={data:c,firstChild:n.firstChild??null};return t&&(l.firstChild=n,Fh(l,0,n.nextSibling)),a?n.setAttribute(ch,a):n.removeAttribute(ch),l}function jx(){Vx=Cj}function Bx(n,e,t=!1){return Vx(n,e,t)}function Ux(n){let e=n._lView;return e[U].type===2?null:(Yo(e)&&(e=e[Be]),e)}function Ij(n){return n.textContent?.replace(/\s/gm,"")}function Sj(n){let e=Ul(),t=e.createNodeIterator(n,NodeFilter.SHOW_COMMENT,{acceptNode(o){let s=Ij(o);return s==="ngetn"||s==="ngtns"?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}}),i,r=[];for(;i=t.nextNode();)r.push(i);for(let o of r)o.textContent==="ngetn"?o.replaceWith(e.createTextNode("")):o.remove()}function Fh(n,e,t){n.segmentHeads??={},n.segmentHeads[e]=t}function x_(n,e){return n.segmentHeads?.[e]??null}function Hx(n){return n.get(xx,!1,{optional:!0})}function Dj(n,e){let t=n.data,i=t[_x]?.[e]??null;return i===null&&t[Oh]?.[e]&&(i=ob(n,e)),i}function $x(n,e){return n.data[Oh]?.[e]??null}function ob(n,e){let t=$x(n,e)??[],i=0;for(let r of t)i+=r[Pl]*(r[X_]??1);return i}function Tj(n){if(typeof n.disconnectedNodes>"u"){let e=n.data[J_];n.disconnectedNodes=e?new Set(e):null}return n.disconnectedNodes}function zx(n,e){if(typeof n.disconnectedNodes>"u"){let t=n.data[J_];n.disconnectedNodes=t?new Set(t):null}return!!Tj(n)?.has(e)}function Vh(n,e){let t=n[gn];return t!==null&&!qy()&&!Lh(e)&&!zx(t,e.index-Be)}function xj(n,e){let t=e.get(Ph),r=e.get(is).get(Lx,{}),o=!1,s=n,a=null,c=[];for(;!o&&s;){o=t.has(s);let l=t.hydrating.get(s);if(a===null&&l!=null){a=l.promise;break}c.unshift(s),s=r[s][Sx]}return{parentBlockPromise:a,hydrationQueue:c}}function d_(n){return!!n&&n.nodeType===Node.COMMENT_NODE&&n.textContent?.trim()===Fx}function vT(n){for(;n&&n.nodeType===Node.TEXT_NODE;)n=n.previousSibling;return n}function Wx(n){for(let i of n.body.childNodes)if(d_(i))return;let e=vT(n.body.previousSibling);if(d_(e))return;let t=vT(n.head.lastChild);if(!d_(t))throw new V(-507,!1)}function qx(n,e){let t=n.contentQueries;if(t!==null){let i=ie(null);try{for(let r=0;rn,createScript:n=>n,createScriptURL:n=>n})}catch{}return nh}function Mj(n){return Aj()?.createScriptURL(n)||n}var ih;function Rj(){if(ih===void 0&&(ih=null,Or.trustedTypes))try{ih=Or.trustedTypes.createPolicy("angular#unsafe-bypass",{createHTML:n=>n,createScript:n=>n,createScriptURL:n=>n})}catch{}return ih}function yT(n){return Rj()?.createScriptURL(n)||n}var yh=class{changingThisBreaksApplicationSecurity;constructor(e){this.changingThisBreaksApplicationSecurity=e}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see ${kf})`}};function rs(n){return n instanceof yh?n.changingThisBreaksApplicationSecurity:n}function jh(n,e){let t=Yx(n);if(t!=null&&t!==e){if(t==="ResourceURL"&&e==="URL")return!0;throw new Error(`Required a safe ${e}, got a ${t} (see ${kf})`)}return t===e}function Yx(n){return n instanceof yh&&n.getTypeName()||null}var kj=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:\/?#]*(?:[\/?#]|$))/i;function sb(n){return n=String(n),n.match(kj)?n:"unsafe:"+n}var Nj=/^>|^->||--!>|)/g,Pj="\u200B$1\u200B";function Lj(n){return n.replace(Nj,e=>e.replace(Oj,Pj))}function Kx(n,e){return n.createText(e)}function Fj(n,e,t){n.setValue(e,t)}function Qx(n,e){return n.createComment(Lj(e))}function ab(n,e,t){return n.createElement(e,t)}function _h(n,e,t,i,r){n.insertBefore(e,t,i,r)}function Zx(n,e,t){n.appendChild(e,t)}function _T(n,e,t,i,r){i!==null?_h(n,e,t,i,r):Zx(n,e,t)}function cb(n,e,t,i){n.removeChild(null,e,t,i)}function Xx(n){n.textContent=""}function Vj(n,e,t){n.setAttribute(e,"style",t)}function jj(n,e,t){t===""?n.removeAttribute(e,"class"):n.setAttribute(e,"class",t)}function Jx(n,e,t){let{mergedAttrs:i,classes:r,styles:o}=t;i!==null&&ZV(n,e,i),r!==null&&jj(n,e,r),o!==null&&Vj(n,e,o)}var zl=(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})(zl||{});function jt(n){let e=tA();return e?e.sanitize(zl.URL,n)||"":jh(n,"URL")?rs(n):sb($o(n))}function eA(n){let e=tA();if(e)return yT(e.sanitize(zl.RESOURCE_URL,n)||"");if(jh(n,"ResourceURL"))return yT(rs(n));throw new V(904,!1)}function lb(n){return Mj(n[0])}var Bj=new Set(["embed","frame","iframe","media","script"]),Uj=new Set(["base","link","script"]);function Hj(n,e){return e==="src"&&Bj.has(n)||e==="href"&&Uj.has(n)||e==="xlink:href"&&n==="script"?eA:jt}function ub(n,e,t){return Hj(e,t)(n)}function tA(){let n=ae();return n&&n[_i].sanitizer}function db(n){return n.ownerDocument}function nA(n){return n.ownerDocument.body}function iA(n){return n instanceof Function?n():n}function $j(n,e,t){let i=n.length;for(;;){let r=n.indexOf(e,t);if(r===-1)return r;if(r===0||n.charCodeAt(r-1)<=32){let o=e.length;if(r+o===i||n.charCodeAt(r+o)<=32)return r}t=r+1}}var rA="ng-template";function zj(n,e,t,i){let r=0;if(i){for(;r-1){let o;for(;++ro?d="":d=r[u+1].toLowerCase(),i&2&&l!==d){if(Qn(i))return!1;s=!0}}}}return Qn(i)||s}function Qn(n){return(n&1)===0}function Gj(n,e,t,i){if(e===null)return-1;let r=0;if(i||!t){let o=!1;for(;r-1)for(t++;t0?'="'+a+'"':"")+"]"}else i&8?r+="."+s:i&4&&(r+=" "+s);else r!==""&&!Qn(s)&&(e+=bT(o,r),r=""),i=s,o=o||!Qn(i);t++}return r!==""&&(e+=bT(o,r)),e}function Xj(n){return n.map(Zj).join(",")}function Jj(n){let e=[],t=[],i=1,r=2;for(;inull),s=i;if(e&&typeof e=="object"){let c=e;r=c.next?.bind(c),o=c.error?.bind(c),s=c.complete?.bind(c)}this.__isAsync&&(o=this.wrapInTimeout(o),r&&(r=this.wrapInTimeout(r)),s&&(s=this.wrapInTimeout(s)));let a=super.subscribe({next:r,error:o,complete:s});return e instanceof Xe&&e.add(a),a}wrapInTimeout(e){return t=>{let i=this.pendingTasks?.add();setTimeout(()=>{try{e(t)}finally{i!==void 0&&this.pendingTasks?.remove(i)}})}}},Ke=R_;function lA(n){let e,t;function i(){n=Rl;try{t!==void 0&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(t),e!==void 0&&clearTimeout(e)}catch{}}return e=setTimeout(()=>{n(),i()}),typeof requestAnimationFrame=="function"&&(t=requestAnimationFrame(()=>{n(),i()})),()=>i()}function wT(n){return queueMicrotask(()=>n()),()=>{n=Rl}}var vb="isAngularZone",bh=vb+"_ID",rB=0,pe=class n{hasPendingMacrotasks=!1;hasPendingMicrotasks=!1;isStable=!0;onUnstable=new Ke(!1);onMicrotaskEmpty=new Ke(!1);onStable=new Ke(!1);onError=new Ke(!1);constructor(e){let{enableLongStackTrace:t=!1,shouldCoalesceEventChangeDetection:i=!1,shouldCoalesceRunChangeDetection:r=!1,scheduleInRootZone:o=cA}=e;if(typeof Zone>"u")throw new V(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=!r&&i,s.shouldCoalesceRunChangeDetection=r,s.callbackScheduled=!1,s.scheduleInRootZone=o,aB(s)}static isInAngularZone(){return typeof Zone<"u"&&Zone.current.get(vb)===!0}static assertInAngularZone(){if(!n.isInAngularZone())throw new V(909,!1)}static assertNotInAngularZone(){if(n.isInAngularZone())throw new V(909,!1)}run(e,t,i){return this._inner.run(e,t,i)}runTask(e,t,i,r){let o=this._inner,s=o.scheduleEventTask("NgZoneEvent: "+r,e,oB,Rl,Rl);try{return o.runTask(s,t,i)}finally{o.cancelTask(s)}}runGuarded(e,t,i){return this._inner.runGuarded(e,t,i)}runOutsideAngular(e){return this._outer.run(e)}},oB={};function yb(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 sB(n){if(n.isCheckStableRunning||n.callbackScheduled)return;n.callbackScheduled=!0;function e(){lA(()=>{n.callbackScheduled=!1,k_(n),n.isCheckStableRunning=!0,yb(n),n.isCheckStableRunning=!1})}n.scheduleInRootZone?Zone.root.run(()=>{e()}):n._outer.run(()=>{e()}),k_(n)}function aB(n){let e=()=>{sB(n)},t=rB++;n._inner=n._inner.fork({name:"angular",properties:{[vb]:!0,[bh]:t,[bh+t]:!0},onInvokeTask:(i,r,o,s,a,c)=>{if(cB(c))return i.invokeTask(o,s,a,c);try{return CT(n),i.invokeTask(o,s,a,c)}finally{(n.shouldCoalesceEventChangeDetection&&s.type==="eventTask"||n.shouldCoalesceRunChangeDetection)&&e(),IT(n)}},onInvoke:(i,r,o,s,a,c,l)=>{try{return CT(n),i.invoke(o,s,a,c,l)}finally{n.shouldCoalesceRunChangeDetection&&!n.callbackScheduled&&!lB(c)&&e(),IT(n)}},onHasTask:(i,r,o,s)=>{i.hasTask(o,s),r===o&&(s.change=="microTask"?(n._hasPendingMicrotasks=s.microTask,k_(n),yb(n)):s.change=="macroTask"&&(n.hasPendingMacrotasks=s.macroTask))},onHandleError:(i,r,o,s)=>(i.handleError(o,s),n.runOutsideAngular(()=>n.onError.emit(s)),!1)})}function k_(n){n._hasPendingMicrotasks||(n.shouldCoalesceEventChangeDetection||n.shouldCoalesceRunChangeDetection)&&n.callbackScheduled===!0?n.hasPendingMicrotasks=!0:n.hasPendingMicrotasks=!1}function CT(n){n._nesting++,n.isStable&&(n.isStable=!1,n.onUnstable.emit(null))}function IT(n){n._nesting--,yb(n)}var Ll=class{hasPendingMicrotasks=!1;hasPendingMacrotasks=!1;isStable=!0;onUnstable=new Ke;onMicrotaskEmpty=new Ke;onStable=new Ke;onError=new Ke;run(e,t,i){return e.apply(t,i)}runGuarded(e,t,i){return e.apply(t,i)}runOutsideAngular(e){return e()}runTask(e,t,i,r){return e.apply(t,i)}};function cB(n){return uA(n,"__ignore_ng_zone__")}function lB(n){return uA(n,"__scheduler_tick__")}function uA(n,e){return!Array.isArray(n)||n.length!==1?!1:n[0]?.data?.[e]===!0}var _b=(()=>{class n{impl=null;execute(){this.impl?.execute()}static \u0275prov=L({token:n,providedIn:"root",factory:()=>new n})}return n})(),dA=[0,1,2,3],fA=(()=>{class n{ngZone=C(pe);scheduler=C(gi);errorHandler=C(qn,{optional:!0});sequences=new Set;deferredRegistrations=new Set;executing=!1;constructor(){C(os,{optional:!0})}execute(){let t=this.sequences.size>0;t&&be(16),this.executing=!0;for(let i of dA)for(let r of this.sequences)if(!(r.erroredOrDestroyed||!r.hooks[i]))try{r.pipelinedValue=this.ngZone.runOutsideAngular(()=>this.maybeTrace(()=>{let o=r.hooks[i];return o(r.pipelinedValue)},r.snapshot))}catch(o){r.erroredOrDestroyed=!0,this.errorHandler?.handleError(o)}this.executing=!1;for(let i of this.sequences)i.afterRun(),i.once&&(this.sequences.delete(i),i.destroy());for(let i of this.deferredRegistrations)this.sequences.add(i);this.deferredRegistrations.size>0&&this.scheduler.notify(7),this.deferredRegistrations.clear(),t&&be(17)}register(t){let{view:i}=t;i!==void 0?((i[qo]??=[]).push(t),Ca(i),i[Q]|=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,i){return i?i.run(Uh.AFTER_NEXT_RENDER,t):t()}static \u0275prov=L({token:n,providedIn:"root",factory:()=>new n})}return n})(),Eh=class{impl;hooks;view;once;snapshot;erroredOrDestroyed=!1;pipelinedValue=void 0;unregisterOnDestroy;constructor(e,t,i,r,o,s=null){this.impl=e,this.hooks=t,this.view=i,this.once=r,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?.[qo];e&&(this.view[qo]=e.filter(t=>t!==this))}};function Hh(n,e){let t=e?.injector??C(Ye);return Di("NgAfterNextRender"),dB(n,t,e,!0)}function uB(n){return n instanceof Function?[void 0,void 0,n,void 0]:[n.earlyRead,n.write,n.mixedReadWrite,n.read]}function dB(n,e,t,i){let r=e.get(_b);r.impl??=e.get(fA);let o=e.get(os,null,{optional:!0}),s=t?.manualCleanup!==!0?e.get(Pn):null,a=e.get(Xf,null,{optional:!0}),c=new Eh(r.impl,uB(n),a?.view,i,s,o?.snapshot(null));return r.impl.register(c),c}var fB=new P("",{providedIn:"root",factory:()=>({queue:new Set,isScheduled:!1,scheduler:null})});function hA(n,e,t){let i=n.get(fB);if(Array.isArray(e))for(let r of e)i.queue.add(r),t?.detachedLeaveAnimationFns?.push(r);else i.queue.add(e),t?.detachedLeaveAnimationFns?.push(e);i.scheduler&&i.scheduler(n)}function hB(n,e){for(let[t,i]of e)hA(n,i.animateFns)}function ST(n,e,t,i){let r=n?.[Dl]?.enter;e!==null&&r&&r.has(t.index)&&hB(i,r)}function Da(n,e,t,i,r,o,s,a){if(r!=null){let c,l=!1;_n(r)?c=r:yn(r)&&(l=!0,r=r[Yt]);let u=bn(r);n===0&&i!==null?(ST(a,i,o,t),s==null?Zx(e,i,u):_h(e,i,u,s||null,!0)):n===1&&i!==null?(ST(a,i,o,t),_h(e,i,u,s||null,!0)):n===2?DT(a,o,t,d=>{cb(e,u,l,d)}):n===3&&DT(a,o,t,()=>{e.destroyNode(u)}),c!=null&&DB(e,n,t,c,o,i,s)}}function pB(n,e){pA(n,e),e[Yt]=null,e[Rn]=null}function mB(n,e,t,i,r,o){i[Yt]=r,i[Rn]=e,$h(n,i,t,1,r,o)}function pA(n,e){e[_i].changeDetectionScheduler?.notify(9),$h(n,e,e[Ce],2,null,null)}function gB(n){let e=n[Ea];if(!e)return f_(n[U],n);for(;e;){let t=null;if(yn(e))t=e[Ea];else{let i=e[Ft];i&&(t=i)}if(!t){for(;e&&!e[Mn]&&e!==n;)yn(e)&&f_(e[U],e),e=e[rt];e===null&&(e=n),yn(e)&&f_(e[U],e),t=e&&e[Mn]}e=t}}function bb(n,e){let t=n[Go],i=t.indexOf(e);t.splice(i,1)}function Eb(n,e){if(Fr(e))return;let t=e[Ce];t.destroyNode&&$h(n,e,t,3,null,null),gB(e)}function f_(n,e){if(Fr(e))return;let t=ie(null);try{e[Q]&=-129,e[Q]|=256,e[vn]&&dl(e[vn]),_B(n,e),yB(n,e),e[U].type===1&&e[Ce].destroy();let i=e[Lr];if(i!==null&&_n(e[rt])){i!==e[rt]&&bb(i,e);let r=e[bi];r!==null&&r.detachView(n)}S_(e)}finally{ie(t)}}function DT(n,e,t,i){let r=n?.[Dl];if(r==null||r.leave==null||!r.leave.has(e.index))return i(!1);n&&ka.add(n),hA(t,()=>{if(r.leave&&r.leave.has(e.index)){let s=r.leave.get(e.index),a=[];if(s){for(let c=0;c{n[Dl].running=void 0,ka.delete(n),e(!0)});return}e(!1)}function yB(n,e){let t=n.cleanup,i=e[ba];if(t!==null)for(let s=0;s=0?i[a]():i[-a].unsubscribe(),s+=2}else{let a=i[t[s+1]];t[s].call(a)}i!==null&&(e[ba]=null);let r=e[Zi];if(r!==null){e[Zi]=null;for(let s=0;sBe&&aA(n,e,Be,!1),be(s?2:0,r,t),t(i,r)}finally{Vr(o),be(s?3:1,r,t)}}function Ib(n,e,t){OB(n,e,t),(t.flags&64)===64&&PB(n,e,t)}function Sb(n,e,t=Nn){let i=e.localNames;if(i!==null){let r=e.index+1;for(let o=0;onull;function MB(n){dx(n)?Xx(n):Sj(n)}function yA(){vA=MB}function RB(n){return n==="class"?"className":n==="for"?"htmlFor":n==="formaction"?"formAction":n==="innerHtml"?"innerHTML":n==="readonly"?"readOnly":n==="tabindex"?"tabIndex":n}function _A(n,e,t,i,r,o){let s=e[U];if(Tb(n,s,e,t,i)){tr(n)&&NB(e,n.index);return}n.type&3&&(t=RB(t)),kB(n,e,t,i,r,o)}function kB(n,e,t,i,r,o){if(n.type&3){let s=Nn(n,e);i=o!=null?o(i,n.value||"",t):i,r.setProperty(s,t,i)}else n.type&12}function NB(n,e){let t=On(e,n);t[Q]&16||(t[Q]|=64)}function OB(n,e,t){let i=t.directiveStart,r=t.directiveEnd;tr(t)&&nB(e,t,n.data[i+t.componentOffset]),n.firstCreatePass||mh(t,e);let o=t.initialInputs;for(let s=i;s{Ca(n.lView)},consumerOnSignalRead(){this.lView[vn]=this}});function GB(n){let e=n[vn]??Object.create(YB);return e.lView=n,e}var YB=G(A({},Zs),{consumerIsAlwaysLive:!0,kind:"template",consumerMarkedDirty:n=>{let e=Nr(n.lView);for(;e&&!TA(e[U]);)e=Nr(e);e&&By(e)},consumerOnSignalRead(){this.lView[vn]=this}});function TA(n){return n.type!==2}function xA(n){if(n[Sl]===null)return;let e=!0;for(;e;){let t=!1;for(let i of n[Sl])i.dirty&&(t=!0,i.zone===null||Zone.current===i.zone?i.run():i.zone.run(()=>i.run()));e=t&&!!(n[Q]&8192)}}var KB=100;function AA(n,e=0){let i=n[_i].rendererFactory,r=!1;r||i.begin?.();try{QB(n,e)}finally{r||i.end?.()}}function QB(n,e){let t=Zy();try{Xy(!0),P_(n,e);let i=0;for(;Al(n);){if(i===KB)throw new V(103,!1);i++,P_(n,1)}}finally{Xy(t)}}function ZB(n,e,t,i){if(Fr(e))return;let r=e[Q],o=!1,s=!1;Yf(e);let a=!0,c=null,l=null;o||(TA(n)?(l=$B(e),c=Js(l)):ef()===null?(a=!1,l=GB(e),c=Js(l)):e[vn]&&(dl(e[vn]),e[vn]=null));try{jy(e),XD(n.bindingStartIndex),t!==null&&gA(n,e,t,2,i);let u=(r&3)===3;if(!o)if(u){let h=n.preOrderCheckHooks;h!==null&&oh(e,h,null)}else{let h=n.preOrderHooks;h!==null&&sh(e,h,0,null),l_(e,0)}if(s||XB(e),xA(e),MA(e,0),n.contentQueries!==null&&qx(n,e),!o)if(u){let h=n.contentCheckHooks;h!==null&&oh(e,h)}else{let h=n.contentHooks;h!==null&&sh(e,h,1),l_(e,1)}eU(n,e);let d=n.components;d!==null&&kA(e,d,0);let f=n.viewQuery;if(f!==null&&A_(2,f,i),!o)if(u){let h=n.viewCheckHooks;h!==null&&oh(e,h)}else{let h=n.viewHooks;h!==null&&sh(e,h,2),l_(e,2)}if(n.firstUpdatePass===!0&&(n.firstUpdatePass=!1),e[Uf]){for(let h of e[Uf])h();e[Uf]=null}o||(SA(e),e[Q]&=-73)}catch(u){throw o||Ca(e),u}finally{l!==null&&(ll(l,c),a&&WB(l)),Kf()}}function MA(n,e){for(let t=px(n);t!==null;t=mx(t))for(let i=Ft;i0&&(n[t-1][Mn]=i[Mn]);let o=El(n,Ft+e);pB(i[U],i);let s=o[bi];s!==null&&s.detachView(o[U]),i[rt]=null,i[Mn]=null,i[Q]&=-129}return i}function nU(n,e,t,i){let r=Ft+i,o=t.length;i>0&&(t[r-1][Mn]=e),i-1&&(wh(e,i),El(t,i))}this._attachedToViewContainer=!1}Eb(this._lView[U],this._lView)}onDestroy(e){Uy(this._lView,e)}markForCheck(){zh(this._cdRefInjectingView||this._lView,4)}detach(){this._lView[Q]&=-129}reattach(){$f(this._lView),this._lView[Q]|=128}detectChanges(){this._lView[Q]|=1024,AA(this._lView)}checkNoChanges(){}attachToViewContainerRef(){if(this._appRef)throw new V(902,!1);this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null;let e=Yo(this._lView),t=this._lView[Lr];t!==null&&!e&&bb(t,this._lView),pA(this._lView[U],this._lView)}attachToAppRef(e){if(this._attachedToViewContainer)throw new V(902,!1);this._appRef=e;let t=Yo(this._lView),i=this._lView[Lr];i!==null&&!t&&PA(i,this._lView),$f(this._lView)}};var Ur=(()=>{class n{_declarationLView;_declarationTContainer;elementRef;static __NG_ELEMENT_ID__=iU;constructor(t,i,r){this._declarationLView=t,this._declarationTContainer=i,this.elementRef=r}get ssrId(){return this._declarationTContainer.tView?.ssrId||null}createEmbeddedView(t,i){return this.createEmbeddedViewImpl(t,i)}createEmbeddedViewImpl(t,i,r){let o=CA(this._declarationLView,this._declarationTContainer,t,{embeddedViewInjector:i,dehydratedView:r});return new Br(o)}}return n})();function iU(){return Ab(vt(),ae())}function Ab(n,e){return n.type&4?new Ur(e,n,Fa(n,e)):null}function Wh(n,e,t,i,r){let o=n.data[e];if(o===null)o=rU(n,e,t,i,r),JD()&&(o.flags|=32);else if(o.type&64){o.type=t,o.value=i,o.attrs=r;let s=KD();o.injectorIndex=s===null?-1:s.injectorIndex}return Ia(o,!0),o}function rU(n,e,t,i,r){let o=Ky(),s=Qy(),a=s?o:o&&o.parent,c=n.data[e]=sU(n,a,t,e,i,r);return oU(n,c,o,s),c}function oU(n,e,t,i){n.firstChild===null&&(n.firstChild=e),t!==null&&(i?t.child==null&&e.parent!==null&&(t.child=e):t.next===null&&(t.next=e,e.prev=t))}function sU(n,e,t,i,r,o){let s=e?e.injectorIndex:-1,a=0;return qy()&&(a|=128),{type:t,index:i,insertBeforeIndex:null,injectorIndex:s,directiveStart:-1,directiveEnd:-1,directiveStylingLast:-1,componentOffset:-1,propertyBindings:null,flags:a,providerIndexes:0,value:r,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 aU=new RegExp(`^(\\d+)*(${yx}|${vx})*(.*)`);function cU(n){let e=n.match(aU),[t,i,r,o]=e,s=i?parseInt(i,10):r,a=[];for(let[c,l,u]of o.matchAll(/(f|n)(\d*)/g)){let d=parseInt(u,10)||1;a.push(l,d)}return[s,...a]}function lU(n){return!n.prev&&n.parent?.type===8}function h_(n){return n.index-Be}function uU(n,e){let t=n.i18nNodes;if(t)return t.get(e)}function qh(n,e,t,i){let r=h_(i),o=uU(n,r);if(o===void 0){let s=n.data[wx];if(s?.[r])o=fU(s[r],t);else if(e.firstChild===i)o=n.firstChild;else{let a=i.prev===null,c=i.prev??i.parent;if(lU(i)){let l=h_(i.parent);o=x_(n,l)}else{let l=Nn(c,t);if(a)o=l.firstChild;else{let u=h_(c),d=x_(n,u);if(c.type===2&&d){let h=ob(n,u)+1;o=Gh(h,d)}else o=l.nextSibling}}}}return o}function Gh(n,e){let t=e;for(let i=0;i0&&(o.firstChild=n,n=Gh(i[Pl],n)),t.push(o)}return[n,t]}var VA=()=>null,_U=()=>null;function jA(){VA=bU,_U=EU}function bU(n,e){return BA(n,e)?n[Yn].shift():(Mb(n),null)}function L_(n,e){return VA(n,e)}function EU(n,e,t){if(e.tView.ssrId===null)return null;let i=L_(n,e.tView.ssrId);return t[U].firstUpdatePass&&i===null&&wU(t,e),i}function wU(n,e){let t=e;for(;t;){if(xT(n,t))return;if((t.flags&256)===256)break;t=t.prev}for(t=e.next;t&&(t.flags&512)===512;){if(xT(n,t))return;t=t.next}}function BA(n,e){let t=n[Yn];return!e||t===null||t.length===0?!1:t[0].data[Ex]===e}function xT(n,e){let t=e.tView?.ssrId;if(t==null)return!1;let i=n[e.index];return _n(i)&&BA(i,t)?(Mb(i),!0):!1}var UA=class{},Kh=class{},F_=class{resolveComponentFactory(e){throw new V(917,!1)}},Wl=class{static NULL=new F_},Jo=class{},Ti=(()=>{class n{destroyNode=null;static __NG_ELEMENT_ID__=()=>CU()}return n})();function CU(){let n=ae(),e=vt(),t=On(e.index,n);return(yn(t)?t:n)[Ce]}var HA=(()=>{class n{static \u0275prov=L({token:n,providedIn:"root",factory:()=>null})}return n})();var lh={},xa=class{injector;parentInjector;constructor(e,t){this.injector=e,this.parentInjector=t}get(e,t,i){let r=this.injector.get(e,lh,i);return r!==lh||t===lh?r:this.parentInjector.get(e,t,i)}};function Ih(n,e,t){let i=t?n.styles:null,r=t?n.classes:null,o=0;if(e!==null)for(let s=0;s0&&(t.directiveToIndex=new Map);for(let f=0;f0;){let t=n[--e];if(typeof t=="number"&&t<0)return t}return 0}function RU(n,e,t){if(t){if(e.exportAs)for(let i=0;ii(bn(y[n.index])):n.index;QA(g,e,t,o,a,h,!1)}}return l}function FU(n){return n.startsWith("animation")||n.startsWith("transition")}function VU(n,e,t,i){let r=n.cleanup;if(r!=null)for(let o=0;oc?a[c]:null}typeof s=="string"&&(o+=2)}return null}function QA(n,e,t,i,r,o,s){let a=e.firstCreatePass?$y(e):null,c=Hy(t),l=c.length;c.push(r,o),a&&a.push(i,n,l,(l+1)*(s?-1:1))}function NT(n,e,t,i,r,o){let s=e[t],a=e[U],l=a.data[t].outputs[i],d=s[l].subscribe(o);QA(n.index,a,e,r,o,d,!0)}var V_=Symbol("BINDING");var Sh=class extends Wl{ngModule;constructor(e){super(),this.ngModule=e}resolveComponentFactory(e){let t=er(e);return new Na(t,this.ngModule)}};function jU(n){return Object.keys(n).map(e=>{let[t,i,r]=n[e],o={propName:t,templateName:e,isSignal:(i&Bh.SignalBased)!==0};return r&&(o.transform=r),o})}function BU(n){return Object.keys(n).map(e=>({propName:n[e],templateName:e}))}function UU(n,e,t){let i=e instanceof it?e:e?.injector;return i&&n.getStandaloneInjector!==null&&(i=n.getStandaloneInjector(i)||i),i?new xa(t,i):t}function HU(n){let e=n.get(Jo,null);if(e===null)throw new V(407,!1);let t=n.get(HA,null),i=n.get(gi,null);return{rendererFactory:e,sanitizer:t,changeDetectionScheduler:i,ngReflect:!1}}function $U(n,e){let t=ZA(n);return ab(e,t,t==="svg"?VD:t==="math"?jD:null)}function ZA(n){return(n.selectors[0][0]||"div").toLowerCase()}var Na=class extends Kh{componentDef;ngModule;selector;componentType;ngContentSelectors;isBoundToModule;cachedInputs=null;cachedOutputs=null;get inputs(){return this.cachedInputs??=jU(this.componentDef.inputs),this.cachedInputs}get outputs(){return this.cachedOutputs??=BU(this.componentDef.outputs),this.cachedOutputs}constructor(e,t){super(),this.componentDef=e,this.ngModule=t,this.componentType=e.type,this.selector=Xj(e.selectors),this.ngContentSelectors=e.ngContentSelectors??[],this.isBoundToModule=!!t}create(e,t,i,r,o,s){be(22);let a=ie(null);try{let c=this.componentDef,l=zU(i,c,s,o),u=UU(c,r||this.ngModule,e),d=HU(u),f=d.rendererFactory.createRenderer(null,c),h=i?xB(f,i,c.encapsulation,u):$U(c,f),g=s?.some(OT)||o?.some(b=>typeof b!="function"&&b.bindings.some(OT)),y=pb(null,l,null,512|oA(c),null,null,d,f,u,null,Bx(h,u,!0));y[Be]=h,Yf(y);let _=null;try{let b=WA(Be,y,2,"#host",()=>l.directiveRegistry,!0,0);Jx(f,h,b),Ra(h,y),Ib(l,y,b),Gx(l,b,y),qA(l,b),t!==void 0&&qU(b,this.ngContentSelectors,t),_=On(b.index,y),y[Lt]=_[Lt],xb(l,y,null)}catch(b){throw _!==null&&S_(_),S_(y),b}finally{be(23),Kf()}return new Dh(this.componentType,y,!!g)}finally{ie(a)}}};function zU(n,e,t,i){let r=n?["ng-version","20.3.16"]:Jj(e.selectors[0]),o=null,s=null,a=0;if(t)for(let u of t)a+=u[V_].requiredVars,u.create&&(u.targetIdx=0,(o??=[]).push(u)),u.update&&(u.targetIdx=0,(s??=[]).push(u));if(i)for(let u=0;u{if(t&1&&n)for(let i of n)i.create();if(t&2&&e)for(let i of e)i.update()}}function OT(n){let e=n[V_].kind;return e==="input"||e==="twoWay"}var Dh=class extends UA{_rootLView;_hasInputBindings;instance;hostView;changeDetectorRef;componentType;location;previousInputValues=null;_tNode;constructor(e,t,i){super(),this._rootLView=t,this._hasInputBindings=i,this._tNode=wa(t[U],Be),this.location=Fa(this._tNode,t),this.instance=On(this._tNode.index,t)[Lt],this.hostView=this.changeDetectorRef=new Br(t,void 0),this.componentType=e}setInput(e,t){this._hasInputBindings;let i=this._tNode;if(this.previousInputValues??=new Map,this.previousInputValues.has(e)&&Object.is(this.previousInputValues.get(e),t))return;let r=this._rootLView,o=Tb(i,r[U],r,e,t);this.previousInputValues.set(e,t);let s=On(i.index,r);zh(s,1)}get injector(){return new Zo(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(e){this.hostView.onDestroy(e)}};function qU(n,e,t){let i=n.projection=[];for(let r=0;r{class n{static __NG_ELEMENT_ID__=GU}return n})();function GU(){let n=vt();return JA(n,ae())}var YU=sr,XA=class extends YU{_lContainer;_hostTNode;_hostLView;constructor(e,t,i){super(),this._lContainer=e,this._hostTNode=t,this._hostLView=i}get element(){return Fa(this._hostTNode,this._hostLView)}get injector(){return new Zo(this._hostTNode,this._hostLView)}get parentInjector(){let e=K_(this._hostTNode,this._hostLView);if(ex(e)){let t=hh(e,this._hostLView),i=fh(e),r=t[U].data[i+8];return new Zo(r,t)}else return new Zo(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(e){let t=PT(this._lContainer);return t!==null&&t[e]||null}get length(){return this._lContainer.length-Ft}createEmbeddedView(e,t,i){let r,o;typeof i=="number"?r=i:i!=null&&(r=i.index,o=i.injector);let s=L_(this._lContainer,e.ssrId),a=e.createEmbeddedViewImpl(t||{},o,s);return this.insertImpl(a,r,O_(this._hostTNode,s)),a}createComponent(e,t,i,r,o,s,a){let c=e&&!$V(e),l;if(c)l=t;else{let _=t||{};l=_.index,i=_.injector,r=_.projectableNodes,o=_.environmentInjector||_.ngModuleRef,s=_.directives,a=_.bindings}let u=c?e:new Na(er(e)),d=i||this.parentInjector;if(!o&&u.ngModule==null){let b=(c?d:this.parentInjector).get(it,null);b&&(o=b)}let f=er(u.componentType??{}),h=L_(this._lContainer,f?.id??null),g=h?.firstChild??null,y=u.create(d,r,g,o,s,a);return this.insertImpl(y.hostView,l,O_(this._hostTNode,h)),y}insert(e,t){return this.insertImpl(e,t,!0)}insertImpl(e,t,i){let r=e._lView;if(HD(r)){let a=this.indexOf(e);if(a!==-1)this.detach(a);else{let c=r[rt],l=new XA(c,c[Rn],c[rt]);l.detach(l.indexOf(e))}}let o=this._adjustIndex(t),s=this._lContainer;return OA(s,r,o,i),e.attachToViewContainerRef(),Ty(m_(s),o,e),e}move(e,t){return this.insert(e,t)}indexOf(e){let t=PT(this._lContainer);return t!==null?t.indexOf(e):-1}remove(e){let t=this._adjustIndex(e,-1),i=wh(this._lContainer,t);i&&(El(m_(this._lContainer),t),Eb(i[U],i))}detach(e){let t=this._adjustIndex(e,-1),i=wh(this._lContainer,t);return i&&El(m_(this._lContainer),t)!=null?new Br(i):null}_adjustIndex(e,t=0){return e??this.length+t}};function PT(n){return n[Tl]}function m_(n){return n[Tl]||(n[Tl]=[])}function JA(n,e){let t,i=e[n.index];return _n(i)?t=i:(t=NA(i,e,null,n),e[n.index]=t,mb(e,t)),eM(t,e,n,i),new XA(t,n,e)}function KU(n,e){let t=n[Ce],i=t.createComment(""),r=Nn(e,n),o=t.parentNode(r);return _h(t,o,i,t.nextSibling(r),!1),i}var eM=tM,Ob=()=>!1;function QU(n,e,t){return Ob(n,e,t)}function tM(n,e,t,i){if(n[Ei])return;let r;t.type&8?r=bn(i):r=KU(e,t),n[Ei]=r}function ZU(n,e,t){if(n[Ei]&&n[Yn])return!0;let i=t[gn],r=e.index-Be;if(!i||fx(e)||zx(i,r))return!1;let s=x_(i,r),a=i.data[Oh]?.[r],[c,l]=yU(s,a);return n[Ei]=c,n[Yn]=l,!0}function XU(n,e,t,i){Ob(n,t,e)||tM(n,e,t,i)}function nM(){eM=XU,Ob=ZU}var j_=class n{queryList;matches=null;constructor(e){this.queryList=e}clone(){return new n(this.queryList)}setDirty(){this.queryList.setDirty()}},B_=class n{queries;constructor(e=[]){this.queries=e}createEmbeddedView(e){let t=e.queries;if(t!==null){let i=e.contentQueries!==null?e.contentQueries[0]:t.length,r=[];for(let o=0;o0)i.push(s[a/2]);else{let l=o[a+1],u=e[-c];for(let d=Ft;de.trim())}function oM(n,e,t){n.queries===null&&(n.queries=new U_),n.queries.track(new H_(e,t))}function aH(n,e){let t=n.contentQueries||(n.contentQueries=[]),i=t.length?t[t.length-1]:-1;e!==i&&t.push(n.queries.length-1,e)}function Pb(n,e){return n.queries.getByIndex(e)}function cH(n,e){let t=n[U],i=Pb(t,e);return i.crossesNgTemplate?$_(t,n,e,[]):iM(t,n,i,e)}var es=class{},Qh=class{};var xh=class extends es{ngModuleType;_parent;_bootstrapComponents=[];_r3Injector;instance;destroyCbs=[];componentFactoryResolver=new Sh(this);constructor(e,t,i,r=!0){super(),this.ngModuleType=e,this._parent=t;let o=My(e);this._bootstrapComponents=iA(o.bootstrap),this._r3Injector=i_(e,t,[{provide:es,useValue:this},{provide:Wl,useValue:this.componentFactoryResolver},...i],Ji(e),new Set(["environment"])),r&&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)}},Ah=class extends Qh{moduleType;constructor(e){super(),this.moduleType=e}create(e){return new xh(this.moduleType,e,[])}};var Vl=class extends es{injector;componentFactoryResolver=new Sh(this);instance=null;constructor(e){super();let t=new Uo([...e.providers,{provide:es,useValue:this},{provide:Wl,useValue:this.componentFactoryResolver}],e.parent||Cl(),e.debugName,new Set(["environment"]));this.injector=t,e.runEnvironmentInitializers&&t.resolveInjectorInitializers()}destroy(){this.injector.destroy()}onDestroy(e){this.injector.onDestroy(e)}};function Va(n,e,t=null){return new Vl({providers:n,parent:e,debugName:t,runEnvironmentInitializers:!0}).injector}var lH=(()=>{class n{_injector;cachedInjectors=new Map;constructor(t){this._injector=t}getOrCreateStandaloneInjector(t){if(!t.standalone)return null;if(!this.cachedInjectors.has(t)){let i=Bf(!1,t.type),r=i.length>0?Va([i],this._injector,`Standalone[${t.type.name}]`):null;this.cachedInjectors.set(t,r)}return this.cachedInjectors.get(t)}ngOnDestroy(){try{for(let t of this.cachedInjectors.values())t!==null&&t.destroy()}finally{this.cachedInjectors.clear()}}static \u0275prov=L({token:n,providedIn:"environment",factory:()=>new n($(it))})}return n})();function se(n){return Pa(()=>{let e=sM(n),t=G(A({},e),{decls:n.decls,vars:n.vars,template:n.template,consts:n.consts||null,ngContentSelectors:n.ngContentSelectors,onPush:n.changeDetection===Q_.OnPush,directiveDefs:null,pipeDefs:null,dependencies:e.standalone&&n.dependencies||null,getStandaloneInjector:e.standalone?r=>r.get(lH).getOrCreateStandaloneInjector(t):null,getExternalStyles:null,signals:n.signals??!1,data:n.data||{},encapsulation:n.encapsulation||rr.Emulated,styles:n.styles||Gt,_:null,schemas:n.schemas||null,tView:null,id:""});e.standalone&&Di("NgStandalone"),aM(t);let i=n.dependencies;return t.directiveDefs=LT(i,uH),t.pipeDefs=LT(i,Ry),t.id=hH(t),t})}function uH(n){return er(n)||jf(n)}function ar(n){return Pa(()=>({type:n.type,bootstrap:n.bootstrap||Gt,declarations:n.declarations||Gt,imports:n.imports||Gt,exports:n.exports||Gt,transitiveCompileScopes:null,schemas:n.schemas||null,id:n.id||null}))}function dH(n,e){if(n==null)return Pr;let t={};for(let i in n)if(n.hasOwnProperty(i)){let r=n[i],o,s,a,c;Array.isArray(r)?(a=r[0],o=r[1],s=r[2]??o,c=r[3]||null):(o=r,s=r,a=Bh.None,c=null),t[o]=[i,a,c],e[o]=s}return t}function fH(n){if(n==null)return Pr;let e={};for(let t in n)n.hasOwnProperty(t)&&(e[n[t]]=t);return e}function ot(n){return Pa(()=>{let e=sM(n);return aM(e),e})}function Lb(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 sM(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||Pr,exportAs:n.exportAs||null,standalone:n.standalone??!0,signals:n.signals===!0,selectors:n.selectors||Gt,viewQuery:n.viewQuery||null,features:n.features||null,setInput:null,resolveHostDirectives:null,hostDirectives:null,inputs:dH(n.inputs,e),outputs:fH(n.outputs),debugInfo:null}}function aM(n){n.features?.forEach(e=>e(n))}function LT(n,e){return n?()=>{let t=typeof n=="function"?n():n,i=[];for(let r of t){let o=e(r);o!==null&&i.push(o)}return i}:null}function hH(n){let e=0,t=typeof n.consts=="function"?"":n.consts,i=[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 i.join("|"))e=Math.imul(31,e)+o.charCodeAt(0)<<0;return e+=2147483648,"c"+e}function pH(n){return Object.getPrototypeOf(n.prototype).constructor}function Jn(n){let e=pH(n.type),t=!0,i=[n];for(;e;){let r;if(wi(n))r=e.\u0275cmp||e.\u0275dir;else{if(e.\u0275cmp)throw new V(903,!1);r=e.\u0275dir}if(r){if(t){i.push(r);let s=n;s.inputs=g_(n.inputs),s.declaredInputs=g_(n.declaredInputs),s.outputs=g_(n.outputs);let a=r.hostBindings;a&&_H(n,a);let c=r.viewQuery,l=r.contentQueries;if(c&&vH(n,c),l&&yH(n,l),mH(n,r),wD(n.outputs,r.outputs),wi(r)&&r.data.animation){let u=n.data;u.animation=(u.animation||[]).concat(r.data.animation)}}let o=r.features;if(o)for(let s=0;s=0;i--){let r=n[i];r.hostVars=e+=r.hostVars,r.hostAttrs=Ma(r.hostAttrs,t=Ma(t,r.hostAttrs))}}function g_(n){return n===Pr?{}:n===Gt?[]:n}function vH(n,e){let t=n.viewQuery;t?n.viewQuery=(i,r)=>{e(i,r),t(i,r)}:n.viewQuery=e}function yH(n,e){let t=n.contentQueries;t?n.contentQueries=(i,r,o)=>{e(i,r,o),t(i,r,o)}:n.contentQueries=e}function _H(n,e){let t=n.hostBindings;t?n.hostBindings=(i,r)=>{e(i,r),t(i,r)}:n.hostBindings=e}function bH(n,e,t,i,r,o,s,a){if(t.firstCreatePass){n.mergedAttrs=Ma(n.mergedAttrs,n.attrs);let u=n.tView=hb(2,n,r,o,s,t.directiveRegistry,t.pipeRegistry,null,t.schemas,t.consts,null);t.queries!==null&&(t.queries.template(t,n),u.queries=t.queries.embeddedTView(n))}a&&(n.flags|=a),Ia(n,!1);let c=cM(t,e,n,i);Zf()&&wb(t,e,c,n),Ra(c,e);let l=NA(c,e,c,n);e[i+Be]=l,mb(e,l),QU(l,n,e)}function EH(n,e,t,i,r,o,s,a,c,l,u){let d=t+Be,f;return e.firstCreatePass?(f=Wh(e,d,4,s||null,a||null),Wy()&&$A(e,n,f,Ko(e.consts,l),bA),ZT(e,f)):f=e.data[d],bH(f,n,e,t,i,r,o,c),xl(f)&&Ib(e,n,f),l!=null&&Sb(n,f,u),f}function B(n,e,t,i,r,o,s,a){let c=ae(),l=gt(),u=Ko(l.consts,o);return EH(c,l,n,e,t,i,r,u,void 0,s,a),B}var cM=lM;function lM(n,e,t,i){return ir(!0),e[Ce].createComment("")}function wH(n,e,t,i){let r=!Vh(e,t);ir(r);let o=e[gn]?.data[bx]?.[i]??null;if(o!==null&&t.tView!==null&&t.tView.ssrId===null&&(t.tView.ssrId=o),r)return lM(n,e);let s=e[gn],a=qh(s,n,e,t);Fh(s,i,a);let c=ob(s,i);return Gh(c,a)}function uM(){cM=wH}var En=(function(n){return n[n.NOT_STARTED=0]="NOT_STARTED",n[n.IN_PROGRESS=1]="IN_PROGRESS",n[n.COMPLETE=2]="COMPLETE",n[n.FAILED=3]="FAILED",n})(En||{}),FT=0,CH=1,ct=(function(n){return n[n.Placeholder=0]="Placeholder",n[n.Loading=1]="Loading",n[n.Complete=2]="Complete",n[n.Error=3]="Error",n})(ct||{});var IH=0,ql=1;var SH=4,DH=5;var TH=7,Aa=8,xH=9,Fb=(function(n){return n[n.Manual=0]="Manual",n[n.Playthrough=1]="Playthrough",n})(Fb||{});function uh(n,e){let t=MH(n),i=e[t];if(i!==null){for(let r of i)r();e[t]=null}}function AH(n){uh(1,n),uh(0,n),uh(2,n)}function MH(n){let e=SH;return n===1?e=DH:n===2&&(e=xH),e}function dM(n){return n+1}function ja(n,e){let t=n[U],i=dM(e.index);return n[i]}function Gl(n,e){let t=dM(e.index);return n.data[t]}function RH(n,e,t){let i=e[U],r=Gl(i,t);switch(n){case ct.Complete:return r.primaryTmplIndex;case ct.Loading:return r.loadingTmplIndex;case ct.Error:return r.errorTmplIndex;case ct.Placeholder:return r.placeholderTmplIndex;default:return null}}function VT(n,e){return e===ct.Placeholder?n.placeholderBlockConfig?.[FT]??null:e===ct.Loading?n.loadingBlockConfig?.[FT]??null:null}function kH(n){return n.loadingBlockConfig?.[CH]??null}function jT(n,e){if(!n||n.length===0)return e;let t=new Set(n);for(let i of e)t.add(i);return n.length===t.size?n:Array.from(t)}function NH(n,e){let t=e.primaryTmplIndex+Be;return wa(n,t)}var OH=(()=>{class n{cachedInjectors=new Map;getOrCreateInjector(t,i,r,o){if(!this.cachedInjectors.has(t)){let s=r.length>0?Va(r,i,o):null;this.cachedInjectors.set(t,s)}return this.cachedInjectors.get(t)}ngOnDestroy(){try{for(let t of this.cachedInjectors.values())t!==null&&t.destroy()}finally{this.cachedInjectors.clear()}}static \u0275prov=L({token:n,providedIn:"environment",factory:()=>new n})}return n})();var fM=new P("");function v_(n,e,t){return n.get(OH).getOrCreateInjector(e,n,t,"")}function PH(n,e,t){if(n instanceof xa){let r=n.injector,o=n.parentInjector,s=v_(o,e,t);return new xa(r,s)}let i=n.get(it);if(i!==n){let r=v_(i,e,t);return new xa(n,r)}return v_(n,e,t)}function Qo(n,e,t,i=!1){let r=t[rt],o=r[U];if(Fr(r))return;let s=ja(r,e),a=s[ql],c=s[TH];if(!(c!==null&&nr.data[Ix]===e[ql])??-1;return{dehydratedView:t>-1?n[Yn][t]:null,dehydratedViewIx:t}}function FH(n,e,t,i,r){be(20);let o=RH(n,r,i);if(o!==null){e[ql]=n;let s=r[U],a=o+Be,c=wa(s,a),l=0;tU(t,l);let u;if(n===ct.Complete){let g=Gl(s,i),y=g.providers;y&&y.length>0&&(u=PH(r[kn],g,y))}let{dehydratedView:d,dehydratedViewIx:f}=LH(t,e),h=CA(r,c,null,{injector:u,dehydratedView:d});if(OA(t,h,l,O_(c,d)),zh(h,2),f>-1&&t[Yn]?.splice(f,1),(n===ct.Complete||n===ct.Error)&&Array.isArray(e[Aa])){for(let g of e[Aa])g();e[Aa]=null}}be(21)}function BT(n,e){return n{n.loadingState===En.COMPLETE?Qo(ct.Complete,e,t):n.loadingState===En.FAILED&&Qo(ct.Error,e,t)})}var VH=null;var Zh=(()=>{class n{log(t){console.log(t)}warn(t){console.warn(t)}static \u0275fac=function(i){return new(i||n)};static \u0275prov=L({token:n,factory:n.\u0275fac,providedIn:"platform"})}return n})();var Vb=new P("");function cr(n){return!!n&&typeof n.then=="function"}function Xh(n){return!!n&&typeof n.subscribe=="function"}var hM=new P("");var jb=(()=>{class n{resolve;reject;initialized=!1;done=!1;donePromise=new Promise((t,i)=>{this.resolve=t,this.reject=i});appInits=C(hM,{optional:!0})??[];injector=C(Ye);constructor(){}runInitializers(){if(this.initialized)return;let t=[];for(let r of this.appInits){let o=at(this.injector,r);if(cr(o))t.push(o);else if(Xh(o)){let s=new Promise((a,c)=>{o.subscribe({complete:a,error:c})});t.push(s)}}let i=()=>{this.done=!0,this.resolve()};Promise.all(t).then(()=>{i()}).catch(r=>{this.reject(r)}),t.length===0&&i(),this.initialized=!0}static \u0275fac=function(i){return new(i||n)};static \u0275prov=L({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),Hr=new P("");function pM(){Nv(()=>{let n="";throw new V(600,n)})}function mM(n){return n.isBoundToModule}var jH=10;var Kt=(()=>{class n{_runningTick=!1;_destroyed=!1;_destroyListeners=[];_views=[];internalErrorHandler=C(Vt);afterRenderManager=C(_b);zonelessEnabled=C(Sa);rootEffectScheduler=C(c_);dirtyFlags=0;tracingSnapshot=null;allTestViews=new Set;autoDetectTestViews=new Set;includeAllTestViews=!1;afterTick=new Ge;get allViews(){return[...(this.includeAllTestViews?this.allTestViews:this.autoDetectTestViews).keys(),...this._views]}get destroyed(){return this._destroyed}componentTypes=[];components=[];internalPendingTask=C(Kn);get isStable(){return this.internalPendingTask.hasPendingTasksObservable.pipe(z(t=>!t))}constructor(){C(os,{optional:!0})}whenStable(){let t;return new Promise(i=>{t=this.isStable.subscribe({next:r=>{r&&i()}})}).finally(()=>{t.unsubscribe()})}_injector=C(it);_rendererFactory=null;get injector(){return this._injector}bootstrap(t,i){return this.bootstrapImpl(t,i)}bootstrapImpl(t,i,r=Ye.NULL){return this._injector.get(pe).run(()=>{be(10);let s=t instanceof Kh;if(!this._injector.get(jb).done){let g="";throw new V(405,g)}let c;s?c=t:c=this._injector.get(Wl).resolveComponentFactory(t),this.componentTypes.push(c.componentType);let l=mM(c)?void 0:this._injector.get(es),u=i||c.selector,d=c.create(r,[],u,l),f=d.location.nativeElement,h=d.injector.get(Vb,null);return h?.registerApplication(f),d.onDestroy(()=>{this.detachView(d.hostView),Nl(this.components,d),h?.unregisterApplication(f)}),this._loadComponent(d),be(11,d),d})}tick(){this.zonelessEnabled||(this.dirtyFlags|=1),this._tick()}_tick(){be(12),this.tracingSnapshot!==null?this.tracingSnapshot.run(Uh.CHANGE_DETECTION,this.tickImpl):this.tickImpl()}tickImpl=()=>{if(this._runningTick)throw new V(101,!1);let t=ie(null);try{this._runningTick=!0,this.synchronize()}finally{this._runningTick=!1,this.tracingSnapshot?.dispose(),this.tracingSnapshot=null,ie(t),this.afterTick.next(),be(13)}};synchronize(){this._rendererFactory===null&&!this._injector.destroyed&&(this._rendererFactory=this._injector.get(Jo,null,{optional:!0}));let t=0;for(;this.dirtyFlags!==0&&t++Al(t))){this.dirtyFlags|=2;return}else this.dirtyFlags&=-8}attachView(t){let i=t;this._views.push(i),i.attachToAppRef(this)}detachView(t){let i=t;Nl(this._views,i),i.detachFromAppRef()}_loadComponent(t){this.attachView(t.hostView);try{this.tick()}catch(r){this.internalErrorHandler(r)}this.components.push(t),this._injector.get(Hr,[]).forEach(r=>r(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),()=>Nl(this._destroyListeners,t)}destroy(){if(this._destroyed)throw new V(406,!1);let t=this._injector;t.destroy&&!t.destroyed&&t.destroy()}get viewCount(){return this._views.length}static \u0275fac=function(i){return new(i||n)};static \u0275prov=L({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function Nl(n,e){let t=n.indexOf(e);t>-1&&n.splice(t,1)}function BH(){let n,e;return{promise:new Promise((i,r)=>{n=i,e=r}),resolve:n,reject:e}}function gM(n,e,t){let i=e[kn],r=e[U];if(n.loadingState!==En.NOT_STARTED)return n.loadingPromise??Promise.resolve();let o=ja(e,t),s=NH(r,n);n.loadingState=En.IN_PROGRESS,uh(1,o);let a=n.dependencyResolverFn,c=i.get(jr).add();return a?(n.loadingPromise=Promise.allSettled(a()).then(l=>{let u=!1,d=[],f=[];for(let h of l)if(h.status==="fulfilled"){let g=h.value,y=er(g)||jf(g);if(y)d.push(y);else{let _=Ry(g);_&&f.push(_)}}else{u=!0;break}if(u){if(n.loadingState=En.FAILED,n.errorTmplIndex===null){let g=new V(-750,!1);Db(e,g)}}else{n.loadingState=En.COMPLETE;let h=s.tView;if(d.length>0){h.directiveRegistry=jT(h.directiveRegistry,d);let g=d.map(_=>_.type),y=Bf(!1,...g);n.providers=y}f.length>0&&(h.pipeRegistry=jT(h.pipeRegistry,f))}}),n.loadingPromise.finally(()=>{n.loadingPromise=null,c()})):(n.loadingPromise=Promise.resolve().then(()=>{n.loadingPromise=null,n.loadingState=En.COMPLETE,c()}),n.loadingPromise)}function UH(n,e){return e[kn].get(fM,null,{optional:!0})?.behavior!==Fb.Manual}function HH(n,e,t){let i=e[U],r=e[t.index];if(!UH(n,e))return;let o=ja(e,t),s=Gl(i,t);switch(AH(o),s.loadingState){case En.NOT_STARTED:Qo(ct.Loading,t,r),gM(s,e,t),s.loadingState===En.IN_PROGRESS&&UT(s,t,r);break;case En.IN_PROGRESS:Qo(ct.Loading,t,r),UT(s,t,r);break;case En.COMPLETE:Qo(ct.Complete,t,r);break;case En.FAILED:Qo(ct.Error,t,r);break;default:}}async function vM(n,e,t){let i=n.get(Ph);if(i.hydrating.has(e))return;let{parentBlockPromise:o,hydrationQueue:s}=xj(e,n);if(s.length===0)return;o!==null&&s.shift(),WH(i,s),o!==null&&await o;let a=s[0];i.has(a)?await HT(n,s,t):i.awaitParentBlock(a,async()=>await HT(n,s,t))}async function HT(n,e,t){let i=n.get(Ph),r=i.hydrating,o=n.get(Kn),s=o.add();for(let c=0;c-1?t.get(e[i]):null;r&&Yh(r.lContainer)}function $T(n,e){let t=e.hydrating;for(let i in n)t.get(i)?.reject();e.cleanup(n)}function WH(n,e){for(let t of e)n.hydrating.set(t,BH())}function qH(n){return new Promise(e=>Hh(e,{injector:n}))}async function GH(n){let{tNode:e,lView:t}=n,i=ja(t,e);return new Promise(r=>{YH(i,r),HH(2,t,e)})}function YH(n,e){Array.isArray(n[Aa])||(n[Aa]=[]),n[Aa].push(e)}function Qt(n,e,t,i){let r=ae(),o=Ml();if(or(r,o,e)){let s=gt(),a=Qf();FB(a,r,n,e,t,i)}return Qt}var Ele=typeof document<"u"&&typeof document?.documentElement?.getAnimations=="function";function x(n,e,t){let i=ae(),r=Ml();if(or(i,r,e)){let o=gt(),s=Qf();_A(s,i,n,e,i[Ce],t)}return x}function z_(n,e,t,i,r){Tb(e,n,t,r?"class":"style",i)}function p(n,e,t,i){let r=ae(),o=r[U],s=n+Be,a=o.firstCreatePass?WA(s,r,2,e,bA,Wy(),t,i):o.data[s];if(EA(a,r,n,e,Bb),xl(a)){let c=r[U];Ib(c,r,a),Gx(c,a,r)}return i!=null&&Sb(r,a),p}function m(){let n=gt(),e=vt(),t=wA(e);return n.firstCreatePass&&qA(n,t),Gy(t)&&Yy(),zy(),t.classesWithoutHost!=null&&KV(t)&&z_(n,t,ae(),t.classesWithoutHost,!0),t.stylesWithoutHost!=null&&QV(t)&&z_(n,t,ae(),t.stylesWithoutHost,!1),m}function k(n,e,t,i){return p(n,e,t,i),m(),k}function Ie(n,e,t,i){let r=ae(),o=r[U],s=n+Be,a=o.firstCreatePass?NU(s,o,2,e,t,i):o.data[s];return EA(a,r,n,e,Bb),i!=null&&Sb(r,a),Ie}function Se(){let n=vt(),e=wA(n);return Gy(e)&&Yy(),zy(),Se}var Bb=(n,e,t,i,r)=>(ir(!0),ab(e[Ce],i,n_()));function KH(n,e,t,i,r){let o=!Vh(e,t);if(ir(o),o)return ab(e[Ce],i,n_());let s=e[gn],a=qh(s,n,e,t);return $x(s,r)&&Fh(s,r,a.nextSibling),s&&(ux(t)||dx(a))&&tr(t)&&(YD(t),Xx(a)),a}function yM(){Bb=KH}var QH=(n,e,t,i,r)=>(ir(!0),Qx(e[Ce],""));function ZH(n,e,t,i,r){let o,s=!Vh(e,t);if(ir(s),s)return Qx(e[Ce],"");let a=e[gn],c=qh(a,n,e,t),l=Dj(a,r);return Fh(a,r,c),o=Gh(l,c),o}function _M(){QH=ZH}function Ln(){return ae()}var Yl="en-US";var XH=Yl;function bM(n){typeof n=="string"&&(XH=n.toLowerCase().replace(/_/g,"-"))}function ve(n,e,t){let i=ae(),r=gt(),o=vt();return EM(r,i,i[Ce],o,n,e,t),ve}function EM(n,e,t,i,r,o,s){let a=!0,c=null;if((i.type&3||s)&&(c??=p_(i,e,o),LU(i,n,e,s,t,r,o,c)&&(a=!1)),a){let l=i.outputs?.[r],u=i.hostDirectiveOutputs?.[r];if(u&&u.length)for(let d=0;d>17&32767}function JH(n){return(n&2)==2}function e$(n,e){return n&131071|e<<17}function W_(n){return n|2}function Oa(n){return(n&131068)>>2}function y_(n,e){return n&-131069|e<<2}function t$(n){return(n&1)===1}function q_(n){return n|1}function n$(n,e,t,i,r,o){let s=o?e.classBindings:e.styleBindings,a=ts(s),c=Oa(s);n[i]=t;let l=!1,u;if(Array.isArray(t)){let d=t;u=d[1],(u===null||_a(d,u)>0)&&(l=!0)}else u=t;if(r)if(c!==0){let f=ts(n[a+1]);n[i+1]=rh(f,a),f!==0&&(n[f+1]=y_(n[f+1],i)),n[a+1]=e$(n[a+1],i)}else n[i+1]=rh(a,0),a!==0&&(n[a+1]=y_(n[a+1],i)),a=i;else n[i+1]=rh(c,0),a===0?a=i:n[c+1]=y_(n[c+1],i),c=i;l&&(n[i+1]=W_(n[i+1])),zT(n,u,i,!0),zT(n,u,i,!1),i$(e,u,n,i,o),s=rh(a,c),o?e.classBindings=s:e.styleBindings=s}function i$(n,e,t,i,r){let o=r?n.residualClasses:n.residualStyles;o!=null&&typeof e=="string"&&_a(o,e)>=0&&(t[i+1]=q_(t[i+1]))}function zT(n,e,t,i){let r=n[t+1],o=e===null,s=i?ts(r):Oa(r),a=!1;for(;s!==0&&(a===!1||o);){let c=n[s],l=n[s+1];r$(c,e)&&(a=!0,n[s+1]=i?q_(l):W_(l)),s=i?ts(l):Oa(l)}a&&(n[t+1]=i?W_(r):q_(r))}function r$(n,e){return n===null||e==null||(Array.isArray(n)?n[1]:n)===e?!0:Array.isArray(n)&&typeof e=="string"?_a(n,e)>=0:!1}var Zn={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function o$(n){return n.substring(Zn.key,Zn.keyEnd)}function s$(n){return a$(n),wM(n,CM(n,0,Zn.textEnd))}function wM(n,e){let t=Zn.textEnd;return t===e?-1:(e=Zn.keyEnd=c$(n,Zn.key=e,t),CM(n,e,t))}function a$(n){Zn.key=0,Zn.keyEnd=0,Zn.value=0,Zn.valueEnd=0,Zn.textEnd=n.length}function CM(n,e,t){for(;e32;)e++;return e}function Bt(n,e){return u$(n,e,null,!0),Bt}function Ba(n){d$(v$,l$,n,!0)}function l$(n,e){for(let t=s$(e);t>=0;t=wM(e,t))Ff(n,o$(e),!0)}function u$(n,e,t,i){let r=ae(),o=gt(),s=Wf(2);if(o.firstUpdatePass&&SM(o,n,s,i),e!==cn&&or(r,s,e)){let a=o.data[nr()];DM(o,a,r,r[Ce],n,r[s+1]=_$(e,t),i,s)}}function d$(n,e,t,i){let r=gt(),o=Wf(2);r.firstUpdatePass&&SM(r,null,o,i);let s=ae();if(t!==cn&&or(s,o,t)){let a=r.data[nr()];if(TM(a,i)&&!IM(r,o)){let c=i?a.classesWithoutHost:a.stylesWithoutHost;c!==null&&(t=Nf(c,t||"")),z_(r,a,s,t,i)}else y$(r,a,s,s[Ce],s[o+1],s[o+1]=g$(n,e,t),i,o)}}function IM(n,e){return e>=n.expandoStartIndex}function SM(n,e,t,i){let r=n.data;if(r[t+1]===null){let o=r[nr()],s=IM(n,t);TM(o,i)&&e===null&&!s&&(e=!1),e=f$(r,o,e,i),n$(r,o,e,t,s,i)}}function f$(n,e,t,i){let r=nT(n),o=i?e.residualClasses:e.residualStyles;if(r===null)(i?e.classBindings:e.styleBindings)===0&&(t=__(null,n,e,t,i),t=jl(t,e.attrs,i),o=null);else{let s=e.directiveStylingLast;if(s===-1||n[s]!==r)if(t=__(r,n,e,t,i),o===null){let c=h$(n,e,i);c!==void 0&&Array.isArray(c)&&(c=__(null,n,e,c[1],i),c=jl(c,e.attrs,i),p$(n,e,i,c))}else o=m$(n,e,i)}return o!==void 0&&(i?e.residualClasses=o:e.residualStyles=o),t}function h$(n,e,t){let i=t?e.classBindings:e.styleBindings;if(Oa(i)!==0)return n[ts(i)]}function p$(n,e,t,i){let r=t?e.classBindings:e.styleBindings;n[ts(r)]=i}function m$(n,e,t){let i,r=e.directiveEnd;for(let o=1+e.directiveStylingLast;o0;){let c=n[r],l=Array.isArray(c),u=l?c[1]:c,d=u===null,f=t[r+1];f===cn&&(f=d?Gt:void 0);let h=d?Vf(f,i):u===i?f:void 0;if(l&&!Mh(h)&&(h=Vf(c,i)),Mh(h)&&(a=h,s))return a;let g=n[r+1];r=s?ts(g):Oa(g)}if(e!==null){let c=o?e.residualClasses:e.residualStyles;c!=null&&(a=Vf(c,i))}return a}function Mh(n){return n!==void 0}function _$(n,e){return n==null||n===""||(typeof e=="string"?n=n+e:typeof n=="object"&&(n=Ji(rs(n)))),n}function TM(n,e){return(n.flags&(e?8:16))!==0}function v(n,e=""){let t=ae(),i=gt(),r=n+Be,o=i.firstCreatePass?Wh(i,r,1,e,null):i.data[r],s=xM(i,t,o,e,n);t[r]=s,Zf()&&wb(i,t,s,o),Ia(o,!1)}var xM=(n,e,t,i,r)=>(ir(!0),Kx(e[Ce],i));function b$(n,e,t,i,r){let o=!Vh(e,t);if(ir(o),o)return Kx(e[Ce],i);let s=e[gn];return qh(s,n,e,t)}function AM(){xM=b$}function E$(n,e,t,i=""){return or(n,Ml(),t)?e+$o(t)+i:cn}function w$(n,e,t,i,r,o=""){let s=ZD(),a=PU(n,s,t,r);return Wf(2),a?e+$o(t)+i+$o(r)+o:cn}function O(n){return ye("",n),O}function ye(n,e,t){let i=ae(),r=E$(i,n,e,t);return r!==cn&&MM(i,nr(),r),ye}function Ua(n,e,t,i,r){let o=ae(),s=w$(o,n,e,t,i,r);return s!==cn&&MM(o,nr(),s),Ua}function MM(n,e,t){let i=Fy(e,n);Fj(n[Ce],i,t)}function ss(n,e,t){s_(e)&&(e=e());let i=ae(),r=Ml();if(or(i,r,e)){let o=gt(),s=Qf();_A(s,i,n,e,i[Ce],t)}return ss}function Ha(n,e){let t=s_(n);return t&&n.set(e),t}function as(n,e){let t=ae(),i=gt(),r=vt();return EM(i,t,t[Ce],r,n,e),as}function C$(n,e,t){let i=gt();if(i.firstCreatePass){let r=wi(n);G_(t,i.data,i.blueprint,r,!0),G_(e,i.data,i.blueprint,r,!1)}}function G_(n,e,t,i,r){if(n=Ct(n),Array.isArray(n))for(let o=0;o>20;if(Bo(n)||!n.multi){let h=new Xo(l,r,N,null),g=E_(c,e,r?u:u+f,d);g===-1?(C_(mh(a,s),o,c),b_(o,n,e.length),e.push(c),a.directiveStart++,a.directiveEnd++,r&&(a.providerIndexes+=1048576),t.push(h),s.push(h)):(t[g]=h,s[g]=h)}else{let h=E_(c,e,u+f,d),g=E_(c,e,u,u+f),y=h>=0&&t[h],_=g>=0&&t[g];if(r&&!_||!r&&!y){C_(mh(a,s),o,c);let b=D$(r?S$:I$,t.length,r,i,l,n);!r&&_&&(t[g].providerFactory=b),b_(o,n,e.length,0),e.push(c),a.directiveStart++,a.directiveEnd++,r&&(a.providerIndexes+=1048576),t.push(b),s.push(b)}else{let b=RM(t[r?g:h],l,!r&&i);b_(o,n,h>-1?h:g,b)}!r&&i&&_&&t[g].componentProviders++}}}function b_(n,e,t,i){let r=Bo(e),o=PD(e);if(r||o){let c=(o?Ct(e.useClass):e).prototype.ngOnDestroy;if(c){let l=n.destroyHooks||(n.destroyHooks=[]);if(!r&&e.multi){let u=l.indexOf(t);u===-1?l.push(t,[i,c]):l[u+1].push(i,c)}else l.push(t,c)}}}function RM(n,e,t){return t&&n.componentProviders++,n.multi.push(e)-1}function E_(n,e,t,i){for(let r=t;r{t.providersResolver=(i,r)=>C$(i,r?r(n):n,e)}}function $a(n,e,t){let i=zf()+n,r=ae();return r[i]===cn?KA(r,i,t?e.call(t):e()):OU(r,i)}function ls(n,e,t,i){return kM(ae(),zf(),n,e,t,i)}function T$(n,e){let t=n[e];return t===cn?void 0:t}function kM(n,e,t,i,r,o){let s=e+t;return or(n,s,r)?KA(n,s+1,o?i.call(o,r):i(r)):T$(n,s+1)}function za(n,e){let t=gt(),i,r=n+Be;t.firstCreatePass?(i=x$(e,t.pipeRegistry),t.data[r]=i,i.onDestroy&&(t.destroyHooks??=[]).push(r,i.onDestroy)):i=t.data[r];let o=i.factory||(i.factory=kr(i.type,!0)),s,a=qt(N);try{let c=ph(!1),l=o();return ph(c),Vy(t,ae(),r,l),l}finally{qt(a)}}function x$(n,e){if(e)for(let t=e.length-1;t>=0;t--){let i=e[t];if(n===i.name)return i}}function Wa(n,e,t){let i=n+Be,r=ae(),o=BD(r,i);return A$(r,i)?kM(r,zf(),e,o.transform,t,o):o.transform(t)}function A$(n,e){return n[U].data[e].pure}var Rh=class{ngModuleFactory;componentFactories;constructor(e,t){this.ngModuleFactory=e,this.componentFactories=t}},Hb=(()=>{class n{compileModuleSync(t){return new Ah(t)}compileModuleAsync(t){return Promise.resolve(this.compileModuleSync(t))}compileModuleAndAllComponentsSync(t){let i=this.compileModuleSync(t),r=My(t),o=iA(r.declarations).reduce((s,a)=>{let c=er(a);return c&&s.push(new Na(c)),s},[]);return new Rh(i,o)}compileModuleAndAllComponentsAsync(t){return Promise.resolve(this.compileModuleAndAllComponentsSync(t))}clearCache(){}clearCacheFor(t){}getModuleId(t){}static \u0275fac=function(i){return new(i||n)};static \u0275prov=L({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var M$=(()=>{class n{zone=C(pe);changeDetectionScheduler=C(gi);applicationRef=C(Kt);applicationErrorHandler=C(Vt);_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(i){return new(i||n)};static \u0275prov=L({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function NM({ngZoneFactory:n,ignoreChangesOutsideZone:e,scheduleInRootZone:t}){return n??=()=>new pe(G(A({},OM()),{scheduleInRootZone:t})),[{provide:pe,useFactory:n},{provide:An,multi:!0,useFactory:()=>{let i=C(M$,{optional:!0});return()=>i.initialize()}},{provide:An,multi:!0,useFactory:()=>{let i=C(R$);return()=>{i.initialize()}}},e===!0?{provide:a_,useValue:!0}:[],{provide:Jf,useValue:t??cA},{provide:Vt,useFactory:()=>{let i=C(pe),r=C(it),o;return s=>{i.runOutsideAngular(()=>{r.destroyed&&!o?setTimeout(()=>{throw s}):(o??=r.get(qn),o.handleError(s))})}}}]}function OM(n){return{enableLongStackTrace:!1,shouldCoalesceEventChangeDetection:n?.eventCoalescing??!1,shouldCoalesceRunChangeDetection:n?.runCoalescing??!1}}var R$=(()=>{class n{subscription=new Xe;initialized=!1;zone=C(pe);pendingTasks=C(Kn);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(()=>{pe.assertNotInAngularZone(),queueMicrotask(()=>{t!==null&&!this.zone.hasPendingMacrotasks&&!this.zone.hasPendingMicrotasks&&(this.pendingTasks.remove(t),t=null)})}))}),this.subscription.add(this.zone.onUnstable.subscribe(()=>{pe.assertInAngularZone(),t??=this.pendingTasks.add()}))}ngOnDestroy(){this.subscription.unsubscribe()}static \u0275fac=function(i){return new(i||n)};static \u0275prov=L({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var $b=(()=>{class n{applicationErrorHandler=C(Vt);appRef=C(Kt);taskService=C(Kn);ngZone=C(pe);zonelessEnabled=C(Sa);tracing=C(os,{optional:!0});disableScheduling=C(a_,{optional:!0})??!1;zoneIsDefined=typeof Zone<"u"&&!!Zone.root.run;schedulerTickApplyArgs=[{data:{__scheduler_tick__:!0}}];subscriptions=new Xe;angularZoneId=this.zoneIsDefined?this.ngZone._inner?.get(bh):null;scheduleInRootZone=!this.zonelessEnabled&&this.zoneIsDefined&&(C(Jf,{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 Ll||!this.zoneIsDefined)}notify(t){if(!this.zonelessEnabled&&t===5)return;let i=!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,i=!0;break}case 12:{this.appRef.dirtyFlags|=16,i=!0;break}case 13:{this.appRef.dirtyFlags|=2,i=!0;break}case 11:{i=!0;break}case 9:case 8:case 7:case 10:default:this.appRef.dirtyFlags|=8}if(this.appRef.tracingSnapshot=this.tracing?.snapshot(this.appRef.tracingSnapshot)??null,!this.shouldScheduleTick(i))return;let r=this.useMicrotaskScheduler?wT:lA;this.pendingRenderTaskId=this.taskService.add(),this.scheduleInRootZone?this.cancelScheduledCallback=Zone.root.run(()=>r(()=>this.tick())):this.cancelScheduledCallback=this.ngZone.runOutsideAngular(()=>r(()=>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(bh+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(i){this.taskService.remove(t),this.applicationErrorHandler(i)}finally{this.cleanup()}this.useMicrotaskScheduler=!0,wT(()=>{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(i){return new(i||n)};static \u0275prov=L({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function zb(){return Di("NgZoneless"),It([{provide:gi,useExisting:$b},{provide:pe,useClass:Ll},{provide:Sa,useValue:!0},{provide:Jf,useValue:!1},[]])}function k$(){return typeof $localize<"u"&&$localize.locale||Yl}var Jh=new P("",{providedIn:"root",factory:()=>C(Jh,{optional:!0,skipSelf:!0})||k$()});function st(n){return _D(n)}function $r(n,e){return of(n,e?.equal)}var PM=class{[Nt];constructor(e){this[Nt]=e}destroy(){this[Nt].destroy()}};var Kb={JSACTION:"__jsaction",OWNER:"__owner"},jM={};function N$(n){return n[Kb.JSACTION]}function LM(n,e){n[Kb.JSACTION]=e}function O$(n){return jM[n]}function P$(n,e){jM[n]=e}var W={AUXCLICK:"auxclick",CHANGE:"change",CLICK:"click",CLICKMOD:"clickmod",CLICKONLY:"clickonly",DBLCLICK:"dblclick",FOCUS:"focus",FOCUSIN:"focusin",BLUR:"blur",FOCUSOUT:"focusout",SUBMIT:"submit",KEYDOWN:"keydown",KEYPRESS:"keypress",KEYUP:"keyup",MOUSEUP:"mouseup",MOUSEDOWN:"mousedown",MOUSEOVER:"mouseover",MOUSEOUT:"mouseout",MOUSEENTER:"mouseenter",MOUSELEAVE:"mouseleave",MOUSEMOVE:"mousemove",POINTERUP:"pointerup",POINTERDOWN:"pointerdown",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERMOVE:"pointermove",POINTERCANCEL:"pointercancel",GOTPOINTERCAPTURE:"gotpointercapture",LOSTPOINTERCAPTURE:"lostpointercapture",ERROR:"error",LOAD:"load",UNLOAD:"unload",TOUCHSTART:"touchstart",TOUCHEND:"touchend",TOUCHMOVE:"touchmove",INPUT:"input",SCROLL:"scroll",TOGGLE:"toggle",CUSTOM:"_custom"},L$=[W.MOUSEENTER,W.MOUSELEAVE,"pointerenter","pointerleave"],Ple=[W.CLICK,W.DBLCLICK,W.FOCUSIN,W.FOCUSOUT,W.KEYDOWN,W.KEYUP,W.KEYPRESS,W.MOUSEOVER,W.MOUSEOUT,W.SUBMIT,W.TOUCHSTART,W.TOUCHEND,W.TOUCHMOVE,"touchcancel","auxclick","change","compositionstart","compositionupdate","compositionend","beforeinput","input","select","copy","cut","paste","mousedown","mouseup","wheel","contextmenu","dragover","dragenter","dragleave","drop","dragstart","dragend","pointerdown","pointermove","pointerup","pointercancel","pointerover","pointerout","gotpointercapture","lostpointercapture","ended","loadedmetadata","pagehide","pageshow","visibilitychange","beforematch"],F$=[W.FOCUS,W.BLUR,W.ERROR,W.LOAD,W.TOGGLE],Qb=n=>F$.indexOf(n)>=0;function V$(n){return n===W.MOUSEENTER?W.MOUSEOVER:n===W.MOUSELEAVE?W.MOUSEOUT:n===W.POINTERENTER?W.POINTEROVER:n===W.POINTERLEAVE?W.POINTEROUT:n}function j$(n,e,t,i){let r=!1;Qb(e)&&(r=!0);let o=typeof i=="boolean"?{capture:r,passive:i}:r;return n.addEventListener(e,t,o),{eventType:e,handler:t,capture:r,passive:i}}function B$(n,e){if(n.removeEventListener){let t=typeof e.passive=="boolean"?{capture:e.capture}:e.capture;n.removeEventListener(e.eventType,e.handler,t)}else n.detachEvent&&n.detachEvent(`on${e.eventType}`,e.handler)}function U$(n){n.preventDefault?n.preventDefault():n.returnValue=!1}var FM=typeof navigator<"u"&&/Macintosh/.test(navigator.userAgent);function H$(n){return n.which===2||n.which==null&&n.button===4}function $$(n){return FM&&n.metaKey||!FM&&n.ctrlKey||H$(n)||n.shiftKey}function z$(n,e,t){let i=n.relatedTarget;return(n.type===W.MOUSEOVER&&e===W.MOUSEENTER||n.type===W.MOUSEOUT&&e===W.MOUSELEAVE||n.type===W.POINTEROVER&&e===W.POINTERENTER||n.type===W.POINTEROUT&&e===W.POINTERLEAVE)&&(!i||i!==t&&!t.contains(i))}function W$(n,e){let t={};for(let i in n){if(i==="srcElement"||i==="target")continue;let r=i,o=n[r];typeof o!="function"&&(t[r]=o)}return n.type===W.MOUSEOVER?t.type=W.MOUSEENTER:n.type===W.MOUSEOUT?t.type=W.MOUSELEAVE:n.type===W.POINTEROVER?t.type=W.POINTERENTER:t.type=W.POINTERLEAVE,t.target=t.srcElement=e,t.bubbles=!1,t._originalEvent=n,t}var q$=typeof navigator<"u"&&/iPhone|iPad|iPod/.test(navigator.userAgent),ip=class{element;handlerInfos=[];constructor(e){this.element=e}addEventListener(e,t,i){q$&&(this.element.style.cursor="pointer"),this.handlerInfos.push(j$(this.element,e,t(this.element),i))}cleanUp(){for(let e=0;e{this.eventReplayScheduled=!1,this.eventReplayer(this.replayEventInfoWrappers)}))}};function n3(n,e){return n.tagName==="A"&&(e.getEventType()===W.CLICK||e.getEventType()===W.CLICKMOD)}var QM=Symbol.for("propagationStopped"),Xb={REPLAY:101};var i3="`preventDefault` called during event replay.";var r3="`composedPath` called during event replay.",rp=class{dispatchDelegate;clickModSupport;actionResolver;dispatcher;constructor(e,t=!0){this.dispatchDelegate=e,this.clickModSupport=t,this.actionResolver=new Gb({clickModSupport:t}),this.dispatcher=new Yb(i=>{this.dispatchToDelegate(i)},{actionResolver:this.actionResolver})}dispatch(e){this.dispatcher.dispatch(e)}dispatchToDelegate(e){for(e.getIsReplay()&&a3(e),o3(e);e.getAction();){if(c3(e),Qb(e.getEventType())&&e.getAction().element!==e.getTargetElement()||(this.dispatchDelegate(e.getEvent(),e.getAction().name),s3(e)))return;this.actionResolver.resolveParentAction(e.eventInfo)}}};function o3(n){let e=n.getEvent(),t=n.getEvent().stopPropagation.bind(e),i=()=>{e[QM]=!0,t()};us(e,"stopPropagation",i),us(e,"stopImmediatePropagation",i)}function s3(n){return!!n.getEvent()[QM]}function a3(n){let e=n.getEvent(),t=n.getTargetElement(),i=e.preventDefault.bind(e);us(e,"target",t),us(e,"eventPhase",Xb.REPLAY),us(e,"preventDefault",()=>{throw i(),new Error(i3+"")}),us(e,"composedPath",()=>{throw new Error(r3+"")})}function c3(n){let e=n.getEvent(),t=n.getAction()?.element;t&&us(e,"currentTarget",t,{configurable:!0})}function us(n,e,t,{configurable:i=!1}={}){Object.defineProperty(n,e,{value:t,configurable:i})}function ZM(n,e){n.ecrd(t=>{e.dispatch(t)},KM.I_AM_THE_JSACTION_FRAMEWORK)}function l3(n){return n?.q??[]}function u3(n){n&&(VM(n.c,n.et,n.h),VM(n.c,n.etc,n.h,!0))}function VM(n,e,t,i){for(let r=0;r{class n{static MOUSE_SPECIAL_SUPPORT=d3;containerManager;eventHandlers={};browserEventTypeToExtraEventTypes={};dispatcher=null;queuedEventInfos=[];constructor(t){this.containerManager=t}handleEvent(t,i,r){let o=X$(t,i,i.target,r,Date.now());this.handleEventInfo(o)}handleEventInfo(t){if(!this.dispatcher){WM(t,!0),this.queuedEventInfos?.push(t);return}this.dispatcher(t)}addEvent(t,i,r){if(t in this.eventHandlers||!this.containerManager||!n.MOUSE_SPECIAL_SUPPORT&&L$.indexOf(t)>=0)return;let o=(a,c,l)=>{this.handleEvent(a,c,l)};this.eventHandlers[t]=o;let s=V$(i||t);if(s!==t){let a=this.browserEventTypeToExtraEventTypes[s]||[];a.push(t),this.browserEventTypeToExtraEventTypes[s]=a}this.containerManager.addEventListener(s,a=>c=>{o(t,c,a)},r)}replayEarlyEvents(t=window._ejsa){t&&(this.replayEarlyEventInfos(t.q),u3(t),delete window._ejsa)}replayEarlyEventInfos(t){for(let i=0;iBl(this.attributeName);toString(){return`HostAttributeToken ${this.attributeName}`}},V3=new P("");V3.__NG_ELEMENT_ID__=n=>{let e=vt();if(e===null)throw new V(204,!1);if(e.type&2)return e.value;if(n&8)return null;throw new V(204,!1)};function eR(n,e){return lR(n,e)}function j3(n){return lR(cR,n)}var uR=(eR.required=j3,eR);var eE=new P(""),B3=new P("");function Kl(n){return!n.moduleRef}function U3(n){let e=Kl(n)?n.r3Injector:n.moduleRef.injector,t=e.get(pe);return t.run(()=>{Kl(n)?n.r3Injector.resolveInjectorInitializers():n.moduleRef.resolveInjectorInitializers();let i=e.get(Vt),r;if(t.runOutsideAngular(()=>{r=t.onError.subscribe({next:i})}),Kl(n)){let o=()=>e.destroy(),s=n.platformInjector.get(eE);s.add(o),e.onDestroy(()=>{r.unsubscribe(),s.delete(o)})}else{let o=()=>n.moduleRef.destroy(),s=n.platformInjector.get(eE);s.add(o),n.moduleRef.onDestroy(()=>{Nl(n.allPlatformModules,n.moduleRef),r.unsubscribe(),s.delete(o)})}return $3(i,t,()=>{let o=e.get(Kn),s=o.add(),a=e.get(jb);return a.runInitializers(),a.donePromise.then(()=>{let c=e.get(Jh,Yl);if(bM(c||Yl),!e.get(B3,!0))return Kl(n)?e.get(Kt):(n.allPlatformModules.push(n.moduleRef),n.moduleRef);if(Kl(n)){let u=e.get(Kt);return n.rootComponent!==void 0&&u.bootstrap(n.rootComponent),u}else return H3?.(n.moduleRef,n.allPlatformModules),n.moduleRef}).finally(()=>void o.remove(s))})})}var H3;function $3(n,e,t){try{let i=t();return cr(i)?i.catch(r=>{throw e.runOutsideAngular(()=>n(r)),r}):i}catch(i){throw e.runOutsideAngular(()=>n(i)),i}}var sp=null;function z3(n=[],e){return Ye.create({name:e,providers:[{provide:wl,useValue:"platform"},{provide:eE,useValue:new Set([()=>sp=null])},...n]})}function W3(n=[]){if(sp)return sp;let e=z3(n);return sp=e,pM(),q3(e),e}function q3(n){let e=n.get(kh,null);at(n,()=>{e?.forEach(t=>t())})}function oE(){return!1}var lr=(()=>{class n{static __NG_ELEMENT_ID__=G3}return n})();function G3(n){return Y3(vt(),ae(),(n&16)===16)}function Y3(n,e,t){if(tr(n)&&!t){let i=On(n.index,e);return new Br(i,i)}else if(n.type&175){let i=e[rn];return new Br(i,e)}return null}var tE=class{constructor(){}supports(e){return Nb(e)}create(e){return new nE(e)}},K3=(n,e)=>e,nE=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||K3}forEachItem(e){let t;for(t=this._itHead;t!==null;t=t._next)e(t)}forEachOperation(e){let t=this._itHead,i=this._removalsHead,r=0,o=null;for(;t||i;){let s=!i||t&&t.currentIndex{s=this._trackByFn(r,a),t===null||!Object.is(t.trackById,s)?(t=this._mismatch(t,a,s,r),i=!0):(i&&(t=this._verifyReinsertion(t,a,s,r)),Object.is(t.item,a)||this._addIdentityChange(t,a)),t=t._next,r++}),this.length=r;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,i,r){let o;return e===null?o=this._itTail:(o=e._prev,this._remove(e)),e=this._unlinkedRecords===null?null:this._unlinkedRecords.get(i,null),e!==null?(Object.is(e.item,t)||this._addIdentityChange(e,t),this._reinsertAfter(e,o,r)):(e=this._linkedRecords===null?null:this._linkedRecords.get(i,r),e!==null?(Object.is(e.item,t)||this._addIdentityChange(e,t),this._moveAfter(e,o,r)):e=this._addAfter(new iE(t,i),o,r)),e}_verifyReinsertion(e,t,i,r){let o=this._unlinkedRecords===null?null:this._unlinkedRecords.get(i,null);return o!==null?e=this._reinsertAfter(o,e._prev,r):e.currentIndex!=r&&(e.currentIndex=r,this._addToMoves(e,r)),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,i){this._unlinkedRecords!==null&&this._unlinkedRecords.remove(e);let r=e._prevRemoved,o=e._nextRemoved;return r===null?this._removalsHead=o:r._nextRemoved=o,o===null?this._removalsTail=r:o._prevRemoved=r,this._insertAfter(e,t,i),this._addToMoves(e,i),e}_moveAfter(e,t,i){return this._unlink(e),this._insertAfter(e,t,i),this._addToMoves(e,i),e}_addAfter(e,t,i){return this._insertAfter(e,t,i),this._additionsTail===null?this._additionsTail=this._additionsHead=e:this._additionsTail=this._additionsTail._nextAdded=e,e}_insertAfter(e,t,i){let r=t===null?this._itHead:t._next;return e._next=r,e._prev=t,r===null?this._itTail=e:r._prev=e,t===null?this._itHead=e:t._next=e,this._linkedRecords===null&&(this._linkedRecords=new lp),this._linkedRecords.put(e),e.currentIndex=i,e}_remove(e){return this._addToRemovals(this._unlink(e))}_unlink(e){this._linkedRecords!==null&&this._linkedRecords.remove(e);let t=e._prev,i=e._next;return t===null?this._itHead=i:t._next=i,i===null?this._itTail=t:i._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 lp),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}},iE=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}},rE=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 i;for(i=this._head;i!==null;i=i._nextDup)if((t===null||t<=i.currentIndex)&&Object.is(i.trackById,e))return i;return null}remove(e){let t=e._prevDup,i=e._nextDup;return t===null?this._head=i:t._nextDup=i,i===null?this._tail=t:i._prevDup=t,this._head===null}},lp=class{map=new Map;put(e){let t=e.trackById,i=this.map.get(t);i||(i=new rE,this.map.set(t,i)),i.add(e)}get(e,t){let i=e,r=this.map.get(i);return r?r.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 tR(n,e,t){let i=n.previousIndex;if(i===null)return i;let r=0;return t&&i{class n{factories;static \u0275prov=L({token:n,providedIn:"root",factory:nR});constructor(t){this.factories=t}static create(t,i){if(i!=null){let r=i.factories.slice();t=t.concat(r)}return new n(t)}static extend(t){return{provide:n,useFactory:()=>{let i=C(n,{optional:!0,skipSelf:!0});return n.create(t,i||nR())}}}find(t){let i=this.factories.find(r=>r.supports(t));if(i!=null)return i;throw new V(901,!1)}}return n})();function dR(n){let{rootComponent:e,appProviders:t,platformProviders:i,platformRef:r}=n;be(8);try{let o=r?.injector??W3(i),s=[NM({}),{provide:gi,useExisting:$b},cT,...t||[]],a=new Vl({providers:s,parent:o,debugName:"",runEnvironmentInitializers:!1});return U3({r3Injector:a.injector,platformInjector:o,rootComponent:e})}catch(o){return Promise.reject(o)}finally{be(9)}}var op=new WeakSet,iR="",ap=[];function rR(n){return n.get(tb,Tx)}function fR(){let n=[{provide:tb,useFactory:()=>{let e=!0;{let t=C(Si);e=!!window._ejsas?.[t]}return e&&Di("NgEventReplay"),e}}];return n.push({provide:An,useValue:()=>{let e=C(Kt),{injector:t}=e;if(!op.has(e)){let i=C(nb);if(rR(t)){Px();let r=t.get(Si),o=Nx(r,(s,a,c)=>{s.nodeType===Node.ELEMENT_NODE&&(Ax(s,a,c),Mx(s,i))});e.onDestroy(o)}}},multi:!0},{provide:Hr,useFactory:()=>{let e=C(Kt),{injector:t}=e;return()=>{if(!rR(t)||op.has(e))return;op.add(e);let i=t.get(Si);e.onDestroy(()=>{op.delete(e),Jb(i)}),e.whenStable().then(()=>{if(e.destroyed)return;let r=t.get(kx);Q3(r,t);let o=t.get(nb);o.get(iR)?.forEach(Rx),o.delete(iR);let s=r.instance;Hx(t)?e.onDestroy(()=>s.cleanUp()):s.cleanUp()})}},multi:!0}),n}var Q3=(n,e)=>{let t=e.get(Si),i=window._ejsas[t],r=n.instance=new XM(new ip(i.c));for(let a of i.et)r.addEvent(a);for(let a of i.etc)r.addEvent(a);let o=JM(t);r.replayEarlyEventInfos(o),Jb(t);let s=new rp(a=>{Z3(e,a,a.currentTarget)});ZM(r,s)};function Z3(n,e,t){let i=(t&&t.getAttribute($l))??"";/d\d+/.test(i)?X3(i,n,e,t):e.eventPhase===Xb.REPLAY&&ib(e,t)}function X3(n,e,t,i){ap.push({event:t,currentTarget:i}),vM(e,n,J3)}function J3(n){let e=[...ap],t=new Set(n);ap=[];for(let{event:i,currentTarget:r}of e){let o=r.getAttribute($l);t.has(o)?ib(i,r):ap.push({event:i,currentTarget:r})}}var oR=!1;function e4(){oR||(oR=!0,jx(),yM(),AM(),_M(),uM(),nM(),jA(),yA())}function t4(n){return n.whenStable()}function hR(){let n=[{provide:Hl,useFactory:()=>{let e=!0;return e=!!C(is,{optional:!0})?.get(rb,null),e&&Di("NgHydration"),e}},{provide:An,useValue:()=>{LA(!1),C(Hl)&&(Wx(Ul()),e4())},multi:!0}];return n.push({provide:eb,useFactory:()=>C(Hl)},{provide:Hr,useFactory:()=>{if(C(Hl)){let e=C(Kt);return()=>{t4(e).then(()=>{e.destroyed||Rb(e)})}}return()=>{}},multi:!0}),It(n)}function ds(n){return typeof n=="boolean"?n:n!=null&&n!=="false"}var gR=null;function wn(){return gR}function aE(n){gR??=n}var Ql=class{},cE=(()=>{class n{historyGo(t){throw new Error("")}static \u0275fac=function(i){return new(i||n)};static \u0275prov=L({token:n,factory:()=>C(vR),providedIn:"platform"})}return n})();var vR=(()=>{class n extends cE{_location;_history;_doc=C(Pe);constructor(){super(),this._location=window.location,this._history=window.history}getBaseHrefFromDOM(){return wn().getBaseHref(this._doc)}onPopState(t){let i=wn().getGlobalEventTarget(this._doc,"window");return i.addEventListener("popstate",t,!1),()=>i.removeEventListener("popstate",t)}onHashChange(t){let i=wn().getGlobalEventTarget(this._doc,"window");return i.addEventListener("hashchange",t,!1),()=>i.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,i,r){this._history.pushState(t,i,r)}replaceState(t,i,r){this._history.replaceState(t,i,r)}forward(){this._history.forward()}back(){this._history.back()}historyGo(t=0){this._history.go(t)}getState(){return this._history.state}static \u0275fac=function(i){return new(i||n)};static \u0275prov=L({token:n,factory:()=>new n,providedIn:"platform"})}return n})();function yR(n,e){return n?e?n.endsWith("/")?e.startsWith("/")?n+e.slice(1):n+e:e.startsWith("/")?n+e:`${n}/${e}`:n:e}function pR(n){let e=n.search(/#|\?|$/);return n[e-1]==="/"?n.slice(0,e-1)+n.slice(e):n}function Wr(n){return n&&n[0]!=="?"?`?${n}`:n}var fs=(()=>{class n{historyGo(t){throw new Error("")}static \u0275fac=function(i){return new(i||n)};static \u0275prov=L({token:n,factory:()=>C(lE),providedIn:"root"})}return n})(),_R=new P(""),lE=(()=>{class n extends fs{_platformLocation;_baseHref;_removeListenerFns=[];constructor(t,i){super(),this._platformLocation=t,this._baseHref=i??this._platformLocation.getBaseHrefFromDOM()??C(Pe).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 yR(this._baseHref,t)}path(t=!1){let i=this._platformLocation.pathname+Wr(this._platformLocation.search),r=this._platformLocation.hash;return r&&t?`${i}${r}`:i}pushState(t,i,r,o){let s=this.prepareExternalUrl(r+Wr(o));this._platformLocation.pushState(t,i,s)}replaceState(t,i,r,o){let s=this.prepareExternalUrl(r+Wr(o));this._platformLocation.replaceState(t,i,s)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(t=0){this._platformLocation.historyGo?.(t)}static \u0275fac=function(i){return new(i||n)($(cE),$(_R,8))};static \u0275prov=L({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),hs=(()=>{class n{_subject=new Ge;_basePath;_locationStrategy;_urlChangeListeners=[];_urlChangeSubscription=null;constructor(t){this._locationStrategy=t;let i=this._locationStrategy.getBaseHref();this._basePath=r4(pR(mR(i))),this._locationStrategy.onPopState(r=>{this._subject.next({url:this.path(!0),pop:!0,state:r.state,type:r.type})})}ngOnDestroy(){this._urlChangeSubscription?.unsubscribe(),this._urlChangeListeners=[]}path(t=!1){return this.normalize(this._locationStrategy.path(t))}getState(){return this._locationStrategy.getState()}isCurrentPathEqualTo(t,i=""){return this.path()==this.normalize(t+Wr(i))}normalize(t){return n.stripTrailingSlash(i4(this._basePath,mR(t)))}prepareExternalUrl(t){return t&&t[0]!=="/"&&(t="/"+t),this._locationStrategy.prepareExternalUrl(t)}go(t,i="",r=null){this._locationStrategy.pushState(r,"",t,i),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+Wr(i)),r)}replaceState(t,i="",r=null){this._locationStrategy.replaceState(r,"",t,i),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+Wr(i)),r)}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(i=>{this._notifyUrlChangeListeners(i.url,i.state)}),()=>{let i=this._urlChangeListeners.indexOf(t);this._urlChangeListeners.splice(i,1),this._urlChangeListeners.length===0&&(this._urlChangeSubscription?.unsubscribe(),this._urlChangeSubscription=null)}}_notifyUrlChangeListeners(t="",i){this._urlChangeListeners.forEach(r=>r(t,i))}subscribe(t,i,r){return this._subject.subscribe({next:t,error:i??void 0,complete:r??void 0})}static normalizeQueryParams=Wr;static joinWithSlash=yR;static stripTrailingSlash=pR;static \u0275fac=function(i){return new(i||n)($(fs))};static \u0275prov=L({token:n,factory:()=>n4(),providedIn:"root"})}return n})();function n4(){return new hs($(fs))}function i4(n,e){if(!n||!e.startsWith(n))return e;let t=e.substring(n.length);return t===""||["/",";","?","#"].includes(t[0])?t:e}function mR(n){return n.replace(/\/index.html$/,"")}function r4(n){if(new RegExp("^(https?:)?//").test(n)){let[,t]=n.split(/\/\/[^\/]+/);return t}return n}var uE=/\s+/,bR=[],ur=(()=>{class n{_ngEl;_renderer;initialClasses=bR;rawClass;stateMap=new Map;constructor(t,i){this._ngEl=t,this._renderer=i}set klass(t){this.initialClasses=t!=null?t.trim().split(uE):bR}set ngClass(t){this.rawClass=typeof t=="string"?t.trim().split(uE):t}ngDoCheck(){for(let i of this.initialClasses)this._updateState(i,!0);let t=this.rawClass;if(Array.isArray(t)||t instanceof Set)for(let i of t)this._updateState(i,!0);else if(t!=null)for(let i of Object.keys(t))this._updateState(i,!!t[i]);this._applyStateDiff()}_updateState(t,i){let r=this.stateMap.get(t);r!==void 0?(r.enabled!==i&&(r.changed=!0,r.enabled=i),r.touched=!0):this.stateMap.set(t,{enabled:i,changed:!0,touched:!0})}_applyStateDiff(){for(let t of this.stateMap){let i=t[0],r=t[1];r.changed?(this._toggleClass(i,r.enabled),r.changed=!1):r.touched||(r.enabled&&this._toggleClass(i,!1),this.stateMap.delete(i)),r.touched=!1}}_toggleClass(t,i){t=t.trim(),t.length>0&&t.split(uE).forEach(r=>{i?this._renderer.addClass(this._ngEl.nativeElement,r):this._renderer.removeClass(this._ngEl.nativeElement,r)})}static \u0275fac=function(i){return new(i||n)(N(an),N(Ti))};static \u0275dir=ot({type:n,selectors:[["","ngClass",""]],inputs:{klass:[0,"class","klass"],ngClass:"ngClass"}})}return n})();var up=class{$implicit;ngForOf;index;count;constructor(e,t,i,r){this.$implicit=e,this.ngForOf=t,this.index=i,this.count=r}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}},Le=(()=>{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,i,r){this._viewContainer=t,this._template=i,this._differs=r}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 i=this._viewContainer;t.forEachOperation((r,o,s)=>{if(r.previousIndex==null)i.createEmbeddedView(this._template,new up(r.item,this._ngForOf,-1,-1),s===null?void 0:s);else if(s==null)i.remove(o===null?void 0:o);else if(o!==null){let a=i.get(o);i.move(a,s),ER(a,r)}});for(let r=0,o=i.length;r{let o=i.get(r.currentIndex);ER(o,r)})}static ngTemplateContextGuard(t,i){return!0}static \u0275fac=function(i){return new(i||n)(N(sr),N(Ur),N(sE))};static \u0275dir=ot({type:n,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"}})}return n})();function ER(n,e){n.context.$implicit=e.item}var ei=(()=>{class n{_viewContainer;_context=new dp;_thenTemplateRef=null;_elseTemplateRef=null;_thenViewRef=null;_elseViewRef=null;constructor(t,i){this._viewContainer=t,this._thenTemplateRef=i}set ngIf(t){this._context.$implicit=this._context.ngIf=t,this._updateView()}set ngIfThen(t){wR(t,!1),this._thenTemplateRef=t,this._thenViewRef=null,this._updateView()}set ngIfElse(t){wR(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,i){return!0}static \u0275fac=function(i){return new(i||n)(N(sr),N(Ur))};static \u0275dir=ot({type:n,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}})}return n})(),dp=class{$implicit=null;ngIf=null};function wR(n,e){if(n&&!n.createEmbeddedView)throw new V(2020,!1)}function o4(n,e){return new V(2100,!1)}var dE=class{createSubscription(e,t,i){return st(()=>e.subscribe({next:t,error:i}))}dispose(e){st(()=>e.unsubscribe())}},fE=class{createSubscription(e,t,i){return e.then(r=>t?.(r),r=>i?.(r)),{unsubscribe:()=>{t=null,i=null}}}dispose(e){e.unsubscribe()}},s4=new fE,a4=new dE,hE=(()=>{class n{_ref;_latestValue=null;markForCheckOnValueUpdate=!0;_subscription=null;_obj=null;_strategy=null;applicationErrorHandler=C(Vt);constructor(t){this._ref=t}ngOnDestroy(){this._subscription&&this._dispose(),this._ref=null}transform(t){if(!this._obj){if(t)try{this.markForCheckOnValueUpdate=!1,this._subscribe(t)}finally{this.markForCheckOnValueUpdate=!0}return this._latestValue}return t!==this._obj?(this._dispose(),this.transform(t)):this._latestValue}_subscribe(t){this._obj=t,this._strategy=this._selectStrategy(t),this._subscription=this._strategy.createSubscription(t,i=>this._updateLatestValue(t,i),i=>this.applicationErrorHandler(i))}_selectStrategy(t){if(cr(t))return s4;if(Xh(t))return a4;throw o4(n,t)}_dispose(){this._strategy.dispose(this._subscription),this._latestValue=null,this._subscription=null,this._obj=null}_updateLatestValue(t,i){t===this._obj&&(this._latestValue=i,this.markForCheckOnValueUpdate&&this._ref?.markForCheck())}static \u0275fac=function(i){return new(i||n)(N(lr,16))};static \u0275pipe=Lb({name:"async",type:n,pure:!1})}return n})();function pE(n,e){e=encodeURIComponent(e);for(let t of n.split(";")){let i=t.indexOf("="),[r,o]=i==-1?[t,""]:[t.slice(0,i),t.slice(i+1)];if(r.trim()===e)return decodeURIComponent(o)}return null}var Zl=class{};var CR="browser";var IR=(()=>{class n{static \u0275prov=L({token:n,providedIn:"root",factory:()=>new mE(C(Pe),window)})}return n})(),mE=class{document;window;offset=()=>[0,0];constructor(e,t){this.document=e,this.window=t}setOffset(e){Array.isArray(e)?this.offset=()=>e:this.offset=e}getScrollPosition(){return[this.window.scrollX,this.window.scrollY]}scrollToPosition(e,t){this.window.scrollTo(G(A({},t),{left:e[0],top:e[1]}))}scrollToAnchor(e,t){let i=d4(this.document,e);i&&(this.scrollToElement(i,t),i.focus())}setHistoryScrollRestoration(e){try{this.window.history.scrollRestoration=e}catch{console.warn(Gn(2400,!1))}}scrollToElement(e,t){let i=e.getBoundingClientRect(),r=i.left+this.window.pageXOffset,o=i.top+this.window.pageYOffset,s=this.offset();this.window.scrollTo(G(A({},t),{left:r-s[0],top:o-s[1]}))}};function d4(n,e){let t=n.getElementById(e)||n.getElementsByName(e)[0];if(t)return t;if(typeof n.createTreeWalker=="function"&&n.body&&typeof n.body.attachShadow=="function"){let i=n.createTreeWalker(n.body,NodeFilter.SHOW_ELEMENT),r=i.currentNode;for(;r;){let o=r.shadowRoot;if(o){let s=o.getElementById(e)||o.querySelector(`[name="${e}"]`);if(s)return s}r=i.nextNode()}}return null}var Xl=class{_doc;constructor(e){this._doc=e}manager},fp=(()=>{class n extends Xl{constructor(t){super(t)}supports(t){return!0}addEventListener(t,i,r,o){return t.addEventListener(i,r,o),()=>this.removeEventListener(t,i,r,o)}removeEventListener(t,i,r,o){return t.removeEventListener(i,r,o)}static \u0275fac=function(i){return new(i||n)($(Pe))};static \u0275prov=L({token:n,factory:n.\u0275fac})}return n})(),pp=new P(""),bE=(()=>{class n{_zone;_plugins;_eventNameToPlugin=new Map;constructor(t,i){this._zone=i,t.forEach(s=>{s.manager=this});let r=t.filter(s=>!(s instanceof fp));this._plugins=r.slice().reverse();let o=t.find(s=>s instanceof fp);o&&this._plugins.push(o)}addEventListener(t,i,r,o){return this._findPluginFor(i).addEventListener(t,i,r,o)}getZone(){return this._zone}_findPluginFor(t){let i=this._eventNameToPlugin.get(t);if(i)return i;if(i=this._plugins.find(o=>o.supports(t)),!i)throw new V(5101,!1);return this._eventNameToPlugin.set(t,i),i}static \u0275fac=function(i){return new(i||n)($(pp),$(pe))};static \u0275prov=L({token:n,factory:n.\u0275fac})}return n})(),gE="ng-app-id";function SR(n){for(let e of n)e.remove()}function DR(n,e){let t=e.createElement("style");return t.textContent=n,t}function h4(n,e,t,i){let r=n.head?.querySelectorAll(`style[${gE}="${e}"],link[${gE}="${e}"]`);if(r)for(let o of r)o.removeAttribute(gE),o instanceof HTMLLinkElement?i.set(o.href.slice(o.href.lastIndexOf("/")+1),{usage:0,elements:[o]}):o.textContent&&t.set(o.textContent,{usage:0,elements:[o]})}function yE(n,e){let t=e.createElement("link");return t.setAttribute("rel","stylesheet"),t.setAttribute("href",n),t}var EE=(()=>{class n{doc;appId;nonce;inline=new Map;external=new Map;hosts=new Set;constructor(t,i,r,o={}){this.doc=t,this.appId=i,this.nonce=r,h4(t,i,this.inline,this.external),this.hosts.add(t.head)}addStyles(t,i){for(let r of t)this.addUsage(r,this.inline,DR);i?.forEach(r=>this.addUsage(r,this.external,yE))}removeStyles(t,i){for(let r of t)this.removeUsage(r,this.inline);i?.forEach(r=>this.removeUsage(r,this.external))}addUsage(t,i,r){let o=i.get(t);o?o.usage++:i.set(t,{usage:1,elements:[...this.hosts].map(s=>this.addElement(s,r(t,this.doc)))})}removeUsage(t,i){let r=i.get(t);r&&(r.usage--,r.usage<=0&&(SR(r.elements),i.delete(t)))}ngOnDestroy(){for(let[,{elements:t}]of[...this.inline,...this.external])SR(t);this.hosts.clear()}addHost(t){this.hosts.add(t);for(let[i,{elements:r}]of this.inline)r.push(this.addElement(t,DR(i,this.doc)));for(let[i,{elements:r}]of this.external)r.push(this.addElement(t,yE(i,this.doc)))}removeHost(t){this.hosts.delete(t)}addElement(t,i){return this.nonce&&i.setAttribute("nonce",this.nonce),t.appendChild(i)}static \u0275fac=function(i){return new(i||n)($(Pe),$(Si),$(Nh,8),$(ns))};static \u0275prov=L({token:n,factory:n.\u0275fac})}return n})(),vE={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"},wE=/%COMP%/g;var xR="%COMP%",p4=`_nghost-${xR}`,m4=`_ngcontent-${xR}`,g4=!0,v4=new P("",{providedIn:"root",factory:()=>g4});function y4(n){return m4.replace(wE,n)}function _4(n){return p4.replace(wE,n)}function AR(n,e){return e.map(t=>t.replace(wE,n))}var CE=(()=>{class n{eventManager;sharedStylesHost;appId;removeStylesOnCompDestroy;doc;ngZone;nonce;tracingService;rendererByCompId=new Map;defaultRenderer;platformIsServer;constructor(t,i,r,o,s,a,c=null,l=null){this.eventManager=t,this.sharedStylesHost=i,this.appId=r,this.removeStylesOnCompDestroy=o,this.doc=s,this.ngZone=a,this.nonce=c,this.tracingService=l,this.platformIsServer=!1,this.defaultRenderer=new Jl(t,s,a,this.platformIsServer,this.tracingService)}createRenderer(t,i){if(!t||!i)return this.defaultRenderer;let r=this.getOrCreateRenderer(t,i);return r instanceof hp?r.applyToHost(t):r instanceof eu&&r.applyStyles(),r}getOrCreateRenderer(t,i){let r=this.rendererByCompId,o=r.get(i.id);if(!o){let s=this.doc,a=this.ngZone,c=this.eventManager,l=this.sharedStylesHost,u=this.removeStylesOnCompDestroy,d=this.platformIsServer,f=this.tracingService;switch(i.encapsulation){case rr.Emulated:o=new hp(c,l,i,this.appId,u,s,a,d,f);break;case rr.ShadowDom:return new _E(c,l,t,i,s,a,this.nonce,d,f);default:o=new eu(c,l,i,u,s,a,d,f);break}r.set(i.id,o)}return o}ngOnDestroy(){this.rendererByCompId.clear()}componentReplaced(t){this.rendererByCompId.delete(t)}static \u0275fac=function(i){return new(i||n)($(bE),$(EE),$(Si),$(v4),$(Pe),$(pe),$(Nh),$(os,8))};static \u0275prov=L({token:n,factory:n.\u0275fac})}return n})(),Jl=class{eventManager;doc;ngZone;platformIsServer;tracingService;data=Object.create(null);throwOnSyntheticProps=!0;constructor(e,t,i,r,o){this.eventManager=e,this.doc=t,this.ngZone=i,this.platformIsServer=r,this.tracingService=o}destroy(){}destroyNode=null;createElement(e,t){return t?this.doc.createElementNS(vE[t]||t,e):this.doc.createElement(e)}createComment(e){return this.doc.createComment(e)}createText(e){return this.doc.createTextNode(e)}appendChild(e,t){(TR(e)?e.content:e).appendChild(t)}insertBefore(e,t,i){e&&(TR(e)?e.content:e).insertBefore(t,i)}removeChild(e,t){t.remove()}selectRootElement(e,t){let i=typeof e=="string"?this.doc.querySelector(e):e;if(!i)throw new V(-5104,!1);return t||(i.textContent=""),i}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}setAttribute(e,t,i,r){if(r){t=r+":"+t;let o=vE[r];o?e.setAttributeNS(o,t,i):e.setAttribute(t,i)}else e.setAttribute(t,i)}removeAttribute(e,t,i){if(i){let r=vE[i];r?e.removeAttributeNS(r,t):e.removeAttribute(`${i}:${t}`)}else e.removeAttribute(t)}addClass(e,t){e.classList.add(t)}removeClass(e,t){e.classList.remove(t)}setStyle(e,t,i,r){r&(Ii.DashCase|Ii.Important)?e.style.setProperty(t,i,r&Ii.Important?"important":""):e.style[t]=i}removeStyle(e,t,i){i&Ii.DashCase?e.style.removeProperty(t):e.style[t]=""}setProperty(e,t,i){e!=null&&(e[t]=i)}setValue(e,t){e.nodeValue=t}listen(e,t,i,r){if(typeof e=="string"&&(e=wn().getGlobalEventTarget(this.doc,e),!e))throw new V(5102,!1);let o=this.decoratePreventDefault(i);return this.tracingService?.wrapEventListener&&(o=this.tracingService.wrapEventListener(e,t,o)),this.eventManager.addEventListener(e,t,o,r)}decoratePreventDefault(e){return t=>{if(t==="__ngUnwrap__")return e;e(t)===!1&&t.preventDefault()}}};function TR(n){return n.tagName==="TEMPLATE"&&n.content!==void 0}var _E=class extends Jl{sharedStylesHost;hostEl;shadowRoot;constructor(e,t,i,r,o,s,a,c,l){super(e,o,s,c,l),this.sharedStylesHost=t,this.hostEl=i,this.shadowRoot=i.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);let u=r.styles;u=AR(r.id,u);for(let f of u){let h=document.createElement("style");a&&h.setAttribute("nonce",a),h.textContent=f,this.shadowRoot.appendChild(h)}let d=r.getExternalStyles?.();if(d)for(let f of d){let h=yE(f,o);a&&h.setAttribute("nonce",a),this.shadowRoot.appendChild(h)}}nodeOrShadowRoot(e){return e===this.hostEl?this.shadowRoot:e}appendChild(e,t){return super.appendChild(this.nodeOrShadowRoot(e),t)}insertBefore(e,t,i){return super.insertBefore(this.nodeOrShadowRoot(e),t,i)}removeChild(e,t){return super.removeChild(null,t)}parentNode(e){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(e)))}destroy(){this.sharedStylesHost.removeHost(this.shadowRoot)}},eu=class extends Jl{sharedStylesHost;removeStylesOnCompDestroy;styles;styleUrls;constructor(e,t,i,r,o,s,a,c,l){super(e,o,s,a,c),this.sharedStylesHost=t,this.removeStylesOnCompDestroy=r;let u=i.styles;this.styles=l?AR(l,u):u,this.styleUrls=i.getExternalStyles?.(l)}applyStyles(){this.sharedStylesHost.addStyles(this.styles,this.styleUrls)}destroy(){this.removeStylesOnCompDestroy&&ka.size===0&&this.sharedStylesHost.removeStyles(this.styles,this.styleUrls)}},hp=class extends eu{contentAttr;hostAttr;constructor(e,t,i,r,o,s,a,c,l){let u=r+"-"+i.id;super(e,t,i,o,s,a,c,l,u),this.contentAttr=y4(u),this.hostAttr=_4(u)}applyToHost(e){this.applyStyles(),this.setAttribute(e,this.hostAttr,"")}createElement(e,t){let i=super.createElement(e,t);return super.setAttribute(i,this.contentAttr,""),i}};var mp=class n extends Ql{supportsDOMEvents=!0;static makeCurrent(){aE(new n)}onAndCancel(e,t,i,r){return e.addEventListener(t,i,r),()=>{e.removeEventListener(t,i,r)}}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=b4();return t==null?null:E4(t)}resetBaseElement(){tu=null}getUserAgent(){return window.navigator.userAgent}getCookie(e){return pE(document.cookie,e)}},tu=null;function b4(){return tu=tu||document.head.querySelector("base"),tu?tu.getAttribute("href"):null}function E4(n){return new URL(n,document.baseURI).pathname}var w4=(()=>{class n{build(){return new XMLHttpRequest}static \u0275fac=function(i){return new(i||n)};static \u0275prov=L({token:n,factory:n.\u0275fac})}return n})(),MR=["alt","control","meta","shift"],C4={"\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"},I4={alt:n=>n.altKey,control:n=>n.ctrlKey,meta:n=>n.metaKey,shift:n=>n.shiftKey},RR=(()=>{class n extends Xl{constructor(t){super(t)}supports(t){return n.parseEventName(t)!=null}addEventListener(t,i,r,o){let s=n.parseEventName(i),a=n.eventCallback(s.fullKey,r,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>wn().onAndCancel(t,s.domEventName,a,o))}static parseEventName(t){let i=t.toLowerCase().split("."),r=i.shift();if(i.length===0||!(r==="keydown"||r==="keyup"))return null;let o=n._normalizeKey(i.pop()),s="",a=i.indexOf("code");if(a>-1&&(i.splice(a,1),s="code."),MR.forEach(l=>{let u=i.indexOf(l);u>-1&&(i.splice(u,1),s+=l+".")}),s+=o,i.length!=0||o.length===0)return null;let c={};return c.domEventName=r,c.fullKey=s,c}static matchEventFullKeyCode(t,i){let r=C4[t.key]||t.key,o="";return i.indexOf("code.")>-1&&(r=t.code,o="code."),r==null||!r?!1:(r=r.toLowerCase(),r===" "?r="space":r==="."&&(r="dot"),MR.forEach(s=>{if(s!==r){let a=I4[s];a(t)&&(o+=s+".")}}),o+=r,o===i)}static eventCallback(t,i,r){return o=>{n.matchEventFullKeyCode(o,t)&&r.runGuarded(()=>i(o))}}static _normalizeKey(t){return t==="esc"?"escape":t}static \u0275fac=function(i){return new(i||n)($(Pe))};static \u0275prov=L({token:n,factory:n.\u0275fac})}return n})();function IE(n,e,t){let i=A({rootComponent:n,platformRef:t?.platformRef},S4(e));return dR(i)}function S4(n){return{appProviders:[...M4,...n?.providers??[]],platformProviders:A4}}function D4(){mp.makeCurrent()}function T4(){return new qn}function x4(){return Z_(document),document}var A4=[{provide:ns,useValue:CR},{provide:kh,useValue:D4,multi:!0},{provide:Pe,useFactory:x4}];var M4=[{provide:wl,useValue:"root"},{provide:qn,useFactory:T4},{provide:pp,useClass:fp,multi:!0,deps:[Pe]},{provide:pp,useClass:RR,multi:!0,deps:[Pe]},CE,EE,bE,{provide:Jo,useExisting:CE},{provide:Zl,useClass:w4},[]];var nu=class n{headers;normalizedNames=new Map;lazyInit;lazyUpdate=null;constructor(e){e?typeof e=="string"?this.lazyInit=()=>{this.headers=new Map,e.split(` `).forEach(t=>{let i=t.indexOf(":");if(i>0){let r=t.slice(0,i),o=t.slice(i+1).trim();this.addHeaderEntry(r,o)}})}:typeof Headers<"u"&&e instanceof Headers?(this.headers=new Map,e.forEach((t,i)=>{this.addHeaderEntry(i,t)})):this.lazyInit=()=>{this.headers=new Map,Object.entries(e).forEach(([t,i])=>{this.setHeaderEntries(t,i)})}: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(),Array.from(e.headers.keys()).forEach(t=>{this.headers.set(t,e.headers.get(t)),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 i=e.value;if(typeof i=="string"&&(i=[i]),i.length===0)return;this.maybeSetNormalizedName(e.name,t);let r=(e.op==="a"?this.headers.get(t):void 0)||[];r.push(...i),this.headers.set(t,r);break;case"d":let o=e.value;if(!o)this.headers.delete(t),this.normalizedNames.delete(t);else{let s=this.headers.get(t);if(!s)return;s=s.filter(a=>o.indexOf(a)===-1),s.length===0?(this.headers.delete(t),this.normalizedNames.delete(t)):this.headers.set(t,s)}break}}addHeaderEntry(e,t){let i=e.toLowerCase();this.maybeSetNormalizedName(e,i),this.headers.has(i)?this.headers.get(i).push(t):this.headers.set(i,[t])}setHeaderEntries(e,t){let i=(Array.isArray(t)?t:[t]).map(o=>o.toString()),r=e.toLowerCase();this.headers.set(r,i),this.maybeSetNormalizedName(e,r)}forEach(e){this.init(),Array.from(this.normalizedNames.keys()).forEach(t=>e(this.normalizedNames.get(t),this.headers.get(t)))}};var R4="X-Request-URL",k4="text/plain",N4="application/json",Bge=`${N4}, ${k4}, */*`;var DE=(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})(DE||{}),SE=class{headers;status;statusText;url;ok;type;redirected;constructor(e,t=200,i="OK"){this.headers=e.headers||new nu,this.status=e.status!==void 0?e.status:t,this.statusText=e.statusText||i,this.url=e.url||null,this.redirected=e.redirected,this.ok=this.status>=200&&this.status<300}};var gp=class n extends SE{body;constructor(e={}){super(e),this.body=e.body!==void 0?e.body:null}type=DE.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})}};var kR=new P("");var Uge=RegExp(`^${R4}:`,"m");var O4=new P(""),P4="b",L4="h",F4="s",V4="st",j4="u",B4="rt",TE=new P(""),U4=["GET","HEAD"];function H4(n,e){let h=C(TE),{isCacheActive:t}=h,i=LS(h,["isCacheActive"]),{transferCache:r,method:o}=n;if(!t||r===!1||o==="POST"&&!i.includePostRequests&&!r||o!=="POST"&&!U4.includes(o)||!i.includeRequestsWithAuthHeaders&&$4(n)||i.filter?.(n)===!1)return e(n);let s=C(is);if(C(O4,{optional:!0}))throw new V(2803,!1);let c=n.url,l=z4(n,c),u=s.get(l,null),d=i.includeHeaders;if(typeof r=="object"&&r.includeHeaders&&(d=r.includeHeaders),u){let{[P4]:g,[B4]:y,[L4]:_,[F4]:b,[V4]:w,[j4]:I}=u,D=g;switch(y){case"arraybuffer":D=new TextEncoder().encode(g).buffer;break;case"blob":D=new Blob([g]);break}let S=new nu(_);return H(new gp({body:D,headers:S,status:b,statusText:w,url:I}))}return e(n)}function $4(n){return n.headers.has("authorization")||n.headers.has("proxy-authorization")}function NR(n){return[...n.keys()].sort().map(e=>`${e}=${n.getAll(e)}`).join("&")}function z4(n,e){let{params:t,method:i,responseType:r}=n,o=NR(t),s=n.serializeBody();s instanceof URLSearchParams?s=NR(s):typeof s!="string"&&(s="");let a=[i,r,e,s,o].join("|"),c=W4(a);return c}function W4(n){let e=0;for(let t of n)e=Math.imul(31,e)+t.charCodeAt(0)<<0;return e+=2147483648,e.toString()}function OR(n){return[{provide:TE,useFactory:()=>(Di("NgHttpTransferCache"),A({isCacheActive:!0},n))},{provide:kR,useValue:H4,multi:!0},{provide:Hr,multi:!0,useFactory:()=>{let e=C(Kt),t=C(TE);return()=>{e.whenStable().then(()=>{t.isCacheActive=!1})}}}]}var PR=(()=>{class n{_doc;_dom;constructor(t){this._doc=t,this._dom=wn()}addTag(t,i=!1){return t?this._getOrCreateElement(t,i):null}addTags(t,i=!1){return t?t.reduce((r,o)=>(o&&r.push(this._getOrCreateElement(o,i)),r),[]):[]}getTag(t){return t&&this._doc.querySelector(`meta[${t}]`)||null}getTags(t){if(!t)return[];let i=this._doc.querySelectorAll(`meta[${t}]`);return i?[].slice.call(i):[]}updateTag(t,i){if(!t)return null;i=i||this._parseSelector(t);let r=this.getTag(i);return r?this._setMetaElementAttributes(t,r):this._getOrCreateElement(t,!0)}removeTag(t){this.removeTagElement(this.getTag(t))}removeTagElement(t){t&&this._dom.remove(t)}_getOrCreateElement(t,i=!1){if(!i){let s=this._parseSelector(t),a=this.getTags(s).filter(c=>this._containsAttributes(t,c))[0];if(a!==void 0)return a}let r=this._dom.createElement("meta");return this._setMetaElementAttributes(t,r),this._doc.getElementsByTagName("head")[0].appendChild(r),r}_setMetaElementAttributes(t,i){return Object.keys(t).forEach(r=>i.setAttribute(this._getMetaKeyMap(r),t[r])),i}_parseSelector(t){let i=t.name?"name":"property";return`${i}="${t[i]}"`}_containsAttributes(t,i){return Object.keys(t).every(r=>i.getAttribute(this._getMetaKeyMap(r))===t[r])}_getMetaKeyMap(t){return q4[t]||t}static \u0275fac=function(i){return new(i||n)($(Pe))};static \u0275prov=L({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),q4={httpEquiv:"http-equiv"},yp=(()=>{class n{_doc;constructor(t){this._doc=t}getTitle(){return this._doc.title}setTitle(t){this._doc.title=t||""}static \u0275fac=function(i){return new(i||n)($(Pe))};static \u0275prov=L({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var vp=(function(n){return n[n.NoHttpTransferCache=0]="NoHttpTransferCache",n[n.HttpTransferCacheOptions=1]="HttpTransferCacheOptions",n[n.I18nSupport=2]="I18nSupport",n[n.EventReplay=3]="EventReplay",n[n.IncrementalHydration=4]="IncrementalHydration",n})(vp||{});function G4(n,e=[],t={}){return{\u0275kind:n,\u0275providers:e}}function LR(){return G4(vp.EventReplay,fR())}function FR(...n){let e=[],t=new Set;for(let{\u0275providers:r,\u0275kind:o}of n)t.add(o),r.length&&e.push(r);let i=t.has(vp.HttpTransferCacheOptions);return It([[],[],hR(),t.has(vp.NoHttpTransferCache)||i?[]:OR({}),e])}var X="primary",mu=Symbol("RouteTitle"),kE=class{params;constructor(e){this.params=e||{}}has(e){return Object.prototype.hasOwnProperty.call(this.params,e)}get(e){if(this.has(e)){let t=this.params[e];return Array.isArray(t)?t[0]:t}return null}getAll(e){if(this.has(e)){let t=this.params[e];return Array.isArray(t)?t:[t]}return[]}get keys(){return Object.keys(this.params)}};function gs(n){return new kE(n)}function qR(n,e,t){let i=t.path.split("/");if(i.length>n.length||t.pathMatch==="full"&&(e.hasChildren()||i.lengthi[o]===r)}else return n===e}function YR(n){return n.length>0?n[n.length-1]:null}function dr(n){return Qv(n)?n:cr(n)?ke(Promise.resolve(n)):H(n)}var K4={exact:QR,subset:ZR},KR={exact:Q4,subset:Z4,ignored:()=>!0};function jR(n,e,t){return K4[t.paths](n.root,e.root,t.matrixParams)&&KR[t.queryParams](n.queryParams,e.queryParams)&&!(t.fragment==="exact"&&n.fragment!==e.fragment)}function Q4(n,e){return xi(n,e)}function QR(n,e,t){if(!ps(n.segments,e.segments)||!Ep(n.segments,e.segments,t)||n.numberOfChildren!==e.numberOfChildren)return!1;for(let i in e.children)if(!n.children[i]||!QR(n.children[i],e.children[i],t))return!1;return!0}function Z4(n,e){return Object.keys(e).length<=Object.keys(n).length&&Object.keys(e).every(t=>GR(n[t],e[t]))}function ZR(n,e,t){return XR(n,e,e.segments,t)}function XR(n,e,t,i){if(n.segments.length>t.length){let r=n.segments.slice(0,t.length);return!(!ps(r,t)||e.hasChildren()||!Ep(r,t,i))}else if(n.segments.length===t.length){if(!ps(n.segments,t)||!Ep(n.segments,t,i))return!1;for(let r in e.children)if(!n.children[r]||!ZR(n.children[r],e.children[r],i))return!1;return!0}else{let r=t.slice(0,n.segments.length),o=t.slice(n.segments.length);return!ps(n.segments,r)||!Ep(n.segments,r,i)||!n.children[X]?!1:XR(n.children[X],e,o,i)}}function Ep(n,e,t){return e.every((i,r)=>KR[t](n[r].parameters,i.parameters))}var Mi=class{root;queryParams;fragment;_queryParamMap;constructor(e=new Ee([],{}),t={},i=null){this.root=e,this.queryParams=t,this.fragment=i}get queryParamMap(){return this._queryParamMap??=gs(this.queryParams),this._queryParamMap}toString(){return ez.serialize(this)}},Ee=class{segments;children;parent=null;constructor(e,t){this.segments=e,this.children=t,Object.values(t).forEach(i=>i.parent=this)}hasChildren(){return this.numberOfChildren>0}get numberOfChildren(){return Object.keys(this.children).length}toString(){return wp(this)}},qr=class{path;parameters;_parameterMap;constructor(e,t){this.path=e,this.parameters=t}get parameterMap(){return this._parameterMap??=gs(this.parameters),this._parameterMap}toString(){return ek(this)}};function X4(n,e){return ps(n,e)&&n.every((t,i)=>xi(t.parameters,e[i].parameters))}function ps(n,e){return n.length!==e.length?!1:n.every((t,i)=>t.path===e[i].path)}function J4(n,e){let t=[];return Object.entries(n.children).forEach(([i,r])=>{i===X&&(t=t.concat(e(r,i)))}),Object.entries(n.children).forEach(([i,r])=>{i!==X&&(t=t.concat(e(r,i)))}),t}var ic=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275prov=L({token:n,factory:()=>new vs,providedIn:"root"})}return n})(),vs=class{parse(e){let t=new PE(e);return new Mi(t.parseRootSegment(),t.parseQueryParams(),t.parseFragment())}serialize(e){let t=`/${iu(e.root,!0)}`,i=iz(e.queryParams),r=typeof e.fragment=="string"?`#${tz(e.fragment)}`:"";return`${t}${i}${r}`}},ez=new vs;function wp(n){return n.segments.map(e=>ek(e)).join("/")}function iu(n,e){if(!n.hasChildren())return wp(n);if(e){let t=n.children[X]?iu(n.children[X],!1):"",i=[];return Object.entries(n.children).forEach(([r,o])=>{r!==X&&i.push(`${r}:${iu(o,!1)}`)}),i.length>0?`${t}(${i.join("//")})`:t}else{let t=J4(n,(i,r)=>r===X?[iu(n.children[X],!1)]:[`${r}:${iu(i,!1)}`]);return Object.keys(n.children).length===1&&n.children[X]!=null?`${wp(n)}/${t[0]}`:`${wp(n)}/(${t.join("//")})`}}function JR(n){return encodeURIComponent(n).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function _p(n){return JR(n).replace(/%3B/gi,";")}function tz(n){return encodeURI(n)}function OE(n){return JR(n).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function Cp(n){return decodeURIComponent(n)}function BR(n){return Cp(n.replace(/\+/g,"%20"))}function ek(n){return`${OE(n.path)}${nz(n.parameters)}`}function nz(n){return Object.entries(n).map(([e,t])=>`;${OE(e)}=${OE(t)}`).join("")}function iz(n){let e=Object.entries(n).map(([t,i])=>Array.isArray(i)?i.map(r=>`${_p(t)}=${_p(r)}`).join("&"):`${_p(t)}=${_p(i)}`).filter(t=>t);return e.length?`?${e.join("&")}`:""}var rz=/^[^\/()?;#]+/;function xE(n){let e=n.match(rz);return e?e[0]:""}var oz=/^[^\/()?;=#]+/;function sz(n){let e=n.match(oz);return e?e[0]:""}var az=/^[^=?&#]+/;function cz(n){let e=n.match(az);return e?e[0]:""}var lz=/^[^&#]+/;function uz(n){let e=n.match(lz);return e?e[0]:""}var PE=class{url;remaining;constructor(e){this.url=e,this.remaining=e}parseRootSegment(){return this.consumeOptional("/"),this.remaining===""||this.peekStartsWith("?")||this.peekStartsWith("#")?new Ee([],{}):new Ee([],this.parseChildren())}parseQueryParams(){let e={};if(this.consumeOptional("?"))do this.parseQueryParam(e);while(this.consumeOptional("&"));return e}parseFragment(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null}parseChildren(){if(this.remaining==="")return{};this.consumeOptional("/");let e=[];for(this.peekStartsWith("(")||e.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),e.push(this.parseSegment());let t={};this.peekStartsWith("/(")&&(this.capture("/"),t=this.parseParens(!0));let i={};return this.peekStartsWith("(")&&(i=this.parseParens(!1)),(e.length>0||Object.keys(t).length>0)&&(i[X]=new Ee(e,t)),i}parseSegment(){let e=xE(this.remaining);if(e===""&&this.peekStartsWith(";"))throw new V(4009,!1);return this.capture(e),new qr(Cp(e),this.parseMatrixParams())}parseMatrixParams(){let e={};for(;this.consumeOptional(";");)this.parseParam(e);return e}parseParam(e){let t=sz(this.remaining);if(!t)return;this.capture(t);let i="";if(this.consumeOptional("=")){let r=xE(this.remaining);r&&(i=r,this.capture(i))}e[Cp(t)]=Cp(i)}parseQueryParam(e){let t=cz(this.remaining);if(!t)return;this.capture(t);let i="";if(this.consumeOptional("=")){let s=uz(this.remaining);s&&(i=s,this.capture(i))}let r=BR(t),o=BR(i);if(e.hasOwnProperty(r)){let s=e[r];Array.isArray(s)||(s=[s],e[r]=s),s.push(o)}else e[r]=o}parseParens(e){let t={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){let i=xE(this.remaining),r=this.remaining[i.length];if(r!=="/"&&r!==")"&&r!==";")throw new V(4010,!1);let o;i.indexOf(":")>-1?(o=i.slice(0,i.indexOf(":")),this.capture(o),this.capture(":")):e&&(o=X);let s=this.parseChildren();t[o??X]=Object.keys(s).length===1&&s[X]?s[X]:new Ee([],s),this.consumeOptional("//")}return t}peekStartsWith(e){return this.remaining.startsWith(e)}consumeOptional(e){return this.peekStartsWith(e)?(this.remaining=this.remaining.substring(e.length),!0):!1}capture(e){if(!this.consumeOptional(e))throw new V(4011,!1)}};function tk(n){return n.segments.length>0?new Ee([],{[X]:n}):n}function nk(n){let e={};for(let[i,r]of Object.entries(n.children)){let o=nk(r);if(i===X&&o.segments.length===0&&o.hasChildren())for(let[s,a]of Object.entries(o.children))e[s]=a;else(o.segments.length>0||o.hasChildren())&&(e[i]=o)}let t=new Ee(n.segments,e);return dz(t)}function dz(n){if(n.numberOfChildren===1&&n.children[X]){let e=n.children[X];return new Ee(n.segments.concat(e.segments),e.children)}return n}function Gr(n){return n instanceof Mi}function ik(n,e,t=null,i=null){let r=rk(n);return ok(r,e,t,i)}function rk(n){let e;function t(o){let s={};for(let c of o.children){let l=t(c);s[c.outlet]=l}let a=new Ee(o.url,s);return o===n&&(e=a),a}let i=t(n.root),r=tk(i);return e??r}function ok(n,e,t,i){let r=n;for(;r.parent;)r=r.parent;if(e.length===0)return AE(r,r,r,t,i);let o=fz(e);if(o.toRoot())return AE(r,r,new Ee([],{}),t,i);let s=hz(o,r,n),a=s.processChildren?ou(s.segmentGroup,s.index,o.commands):ak(s.segmentGroup,s.index,o.commands);return AE(r,s.segmentGroup,a,t,i)}function Ip(n){return typeof n=="object"&&n!=null&&!n.outlets&&!n.segmentPath}function au(n){return typeof n=="object"&&n!=null&&n.outlets}function AE(n,e,t,i,r){let o={};i&&Object.entries(i).forEach(([c,l])=>{o[c]=Array.isArray(l)?l.map(u=>`${u}`):`${l}`});let s;n===e?s=t:s=sk(n,e,t);let a=tk(nk(s));return new Mi(a,o,r)}function sk(n,e,t){let i={};return Object.entries(n.children).forEach(([r,o])=>{o===e?i[r]=t:i[r]=sk(o,e,t)}),new Ee(n.segments,i)}var Sp=class{isAbsolute;numberOfDoubleDots;commands;constructor(e,t,i){if(this.isAbsolute=e,this.numberOfDoubleDots=t,this.commands=i,e&&i.length>0&&Ip(i[0]))throw new V(4003,!1);let r=i.find(au);if(r&&r!==YR(i))throw new V(4004,!1)}toRoot(){return this.isAbsolute&&this.commands.length===1&&this.commands[0]=="/"}};function fz(n){if(typeof n[0]=="string"&&n.length===1&&n[0]==="/")return new Sp(!0,0,n);let e=0,t=!1,i=n.reduce((r,o,s)=>{if(typeof o=="object"&&o!=null){if(o.outlets){let a={};return Object.entries(o.outlets).forEach(([c,l])=>{a[c]=typeof l=="string"?l.split("/"):l}),[...r,{outlets:a}]}if(o.segmentPath)return[...r,o.segmentPath]}return typeof o!="string"?[...r,o]:s===0?(o.split("/").forEach((a,c)=>{c==0&&a==="."||(c==0&&a===""?t=!0:a===".."?e++:a!=""&&r.push(a))}),r):[...r,o]},[]);return new Sp(t,e,i)}var Ya=class{segmentGroup;processChildren;index;constructor(e,t,i){this.segmentGroup=e,this.processChildren=t,this.index=i}};function hz(n,e,t){if(n.isAbsolute)return new Ya(e,!0,0);if(!t)return new Ya(e,!1,NaN);if(t.parent===null)return new Ya(t,!0,0);let i=Ip(n.commands[0])?0:1,r=t.segments.length-1+i;return pz(t,r,n.numberOfDoubleDots)}function pz(n,e,t){let i=n,r=e,o=t;for(;o>r;){if(o-=r,i=i.parent,!i)throw new V(4005,!1);r=i.segments.length}return new Ya(i,!1,r-o)}function mz(n){return au(n[0])?n[0].outlets:{[X]:n}}function ak(n,e,t){if(n??=new Ee([],{}),n.segments.length===0&&n.hasChildren())return ou(n,e,t);let i=gz(n,e,t),r=t.slice(i.commandIndex);if(i.match&&i.pathIndexo!==X)&&n.children[X]&&n.numberOfChildren===1&&n.children[X].segments.length===0){let o=ou(n.children[X],e,t);return new Ee(n.segments,o.children)}return Object.entries(i).forEach(([o,s])=>{typeof s=="string"&&(s=[s]),s!==null&&(r[o]=ak(n.children[o],e,s))}),Object.entries(n.children).forEach(([o,s])=>{i[o]===void 0&&(r[o]=s)}),new Ee(n.segments,r)}}function gz(n,e,t){let i=0,r=e,o={match:!1,pathIndex:0,commandIndex:0};for(;r=t.length)return o;let s=n.segments[r],a=t[i];if(au(a))break;let c=`${a}`,l=i0&&c===void 0)break;if(c&&l&&typeof l=="object"&&l.outlets===void 0){if(!HR(c,l,s))return o;i+=2}else{if(!HR(c,{},s))return o;i++}r++}return{match:!0,pathIndex:r,commandIndex:i}}function LE(n,e,t){let i=n.segments.slice(0,e),r=0;for(;r{typeof i=="string"&&(i=[i]),i!==null&&(e[t]=LE(new Ee([],{}),0,i))}),e}function UR(n){let e={};return Object.entries(n).forEach(([t,i])=>e[t]=`${i}`),e}function HR(n,e,t){return n==t.path&&xi(e,t.parameters)}var Ka="imperative",ht=(function(n){return n[n.NavigationStart=0]="NavigationStart",n[n.NavigationEnd=1]="NavigationEnd",n[n.NavigationCancel=2]="NavigationCancel",n[n.NavigationError=3]="NavigationError",n[n.RoutesRecognized=4]="RoutesRecognized",n[n.ResolveStart=5]="ResolveStart",n[n.ResolveEnd=6]="ResolveEnd",n[n.GuardsCheckStart=7]="GuardsCheckStart",n[n.GuardsCheckEnd=8]="GuardsCheckEnd",n[n.RouteConfigLoadStart=9]="RouteConfigLoadStart",n[n.RouteConfigLoadEnd=10]="RouteConfigLoadEnd",n[n.ChildActivationStart=11]="ChildActivationStart",n[n.ChildActivationEnd=12]="ChildActivationEnd",n[n.ActivationStart=13]="ActivationStart",n[n.ActivationEnd=14]="ActivationEnd",n[n.Scroll=15]="Scroll",n[n.NavigationSkipped=16]="NavigationSkipped",n})(ht||{}),In=class{id;url;constructor(e,t){this.id=e,this.url=t}},Yr=class extends In{type=ht.NavigationStart;navigationTrigger;restoredState;constructor(e,t,i="imperative",r=null){super(e,t),this.navigationTrigger=i,this.restoredState=r}toString(){return`NavigationStart(id: ${this.id}, url: '${this.url}')`}},Vn=class extends In{urlAfterRedirects;type=ht.NavigationEnd;constructor(e,t,i){super(e,t),this.urlAfterRedirects=i}toString(){return`NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}')`}},Zt=(function(n){return n[n.Redirect=0]="Redirect",n[n.SupersededByNewNavigation=1]="SupersededByNewNavigation",n[n.NoDataFromResolver=2]="NoDataFromResolver",n[n.GuardRejected=3]="GuardRejected",n[n.Aborted=4]="Aborted",n})(Zt||{}),Za=(function(n){return n[n.IgnoredSameUrlNavigation=0]="IgnoredSameUrlNavigation",n[n.IgnoredByUrlHandlingStrategy=1]="IgnoredByUrlHandlingStrategy",n})(Za||{}),Ai=class extends In{reason;code;type=ht.NavigationCancel;constructor(e,t,i,r){super(e,t),this.reason=i,this.code=r}toString(){return`NavigationCancel(id: ${this.id}, url: '${this.url}')`}},Ri=class extends In{reason;code;type=ht.NavigationSkipped;constructor(e,t,i,r){super(e,t),this.reason=i,this.code=r}},Xa=class extends In{error;target;type=ht.NavigationError;constructor(e,t,i,r){super(e,t),this.error=i,this.target=r}toString(){return`NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`}},cu=class extends In{urlAfterRedirects;state;type=ht.RoutesRecognized;constructor(e,t,i,r){super(e,t),this.urlAfterRedirects=i,this.state=r}toString(){return`RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}},Dp=class extends In{urlAfterRedirects;state;type=ht.GuardsCheckStart;constructor(e,t,i,r){super(e,t),this.urlAfterRedirects=i,this.state=r}toString(){return`GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}},Tp=class extends In{urlAfterRedirects;state;shouldActivate;type=ht.GuardsCheckEnd;constructor(e,t,i,r,o){super(e,t),this.urlAfterRedirects=i,this.state=r,this.shouldActivate=o}toString(){return`GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`}},xp=class extends In{urlAfterRedirects;state;type=ht.ResolveStart;constructor(e,t,i,r){super(e,t),this.urlAfterRedirects=i,this.state=r}toString(){return`ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}},Ap=class extends In{urlAfterRedirects;state;type=ht.ResolveEnd;constructor(e,t,i,r){super(e,t),this.urlAfterRedirects=i,this.state=r}toString(){return`ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}},Mp=class{route;type=ht.RouteConfigLoadStart;constructor(e){this.route=e}toString(){return`RouteConfigLoadStart(path: ${this.route.path})`}},Rp=class{route;type=ht.RouteConfigLoadEnd;constructor(e){this.route=e}toString(){return`RouteConfigLoadEnd(path: ${this.route.path})`}},kp=class{snapshot;type=ht.ChildActivationStart;constructor(e){this.snapshot=e}toString(){return`ChildActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}},Np=class{snapshot;type=ht.ChildActivationEnd;constructor(e){this.snapshot=e}toString(){return`ChildActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}},Op=class{snapshot;type=ht.ActivationStart;constructor(e){this.snapshot=e}toString(){return`ActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}},Pp=class{snapshot;type=ht.ActivationEnd;constructor(e){this.snapshot=e}toString(){return`ActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}},Ja=class{routerEvent;position;anchor;type=ht.Scroll;constructor(e,t,i){this.routerEvent=e,this.position=t,this.anchor=i}toString(){let e=this.position?`${this.position[0]}, ${this.position[1]}`:null;return`Scroll(anchor: '${this.anchor}', position: '${e}')`}},lu=class{},ec=class{url;navigationBehaviorOptions;constructor(e,t){this.url=e,this.navigationBehaviorOptions=t}};function yz(n){return!(n instanceof lu)&&!(n instanceof ec)}function _z(n,e){return n.providers&&!n._injector&&(n._injector=Va(n.providers,e,`Route: ${n.path}`)),n._injector??e}function ti(n){return n.outlet||X}function bz(n,e){let t=n.filter(i=>ti(i)===e);return t.push(...n.filter(i=>ti(i)!==e)),t}function rc(n){if(!n)return null;if(n.routeConfig?._injector)return n.routeConfig._injector;for(let e=n.parent;e;e=e.parent){let t=e.routeConfig;if(t?._loadedInjector)return t._loadedInjector;if(t?._injector)return t._injector}return null}var Lp=class{rootInjector;outlet=null;route=null;children;attachRef=null;get injector(){return rc(this.route?.snapshot)??this.rootInjector}constructor(e){this.rootInjector=e,this.children=new oc(this.rootInjector)}},oc=(()=>{class n{rootInjector;contexts=new Map;constructor(t){this.rootInjector=t}onChildOutletCreated(t,i){let r=this.getOrCreateContext(t);r.outlet=i,this.contexts.set(t,r)}onChildOutletDestroyed(t){let i=this.getContext(t);i&&(i.outlet=null,i.attachRef=null)}onOutletDeactivated(){let t=this.contexts;return this.contexts=new Map,t}onOutletReAttached(t){this.contexts=t}getOrCreateContext(t){let i=this.getContext(t);return i||(i=new Lp(this.rootInjector),this.contexts.set(t,i)),i}getContext(t){return this.contexts.get(t)||null}static \u0275fac=function(i){return new(i||n)($(it))};static \u0275prov=L({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),Fp=class{_root;constructor(e){this._root=e}get root(){return this._root.value}parent(e){let t=this.pathFromRoot(e);return t.length>1?t[t.length-2]:null}children(e){let t=FE(e,this._root);return t?t.children.map(i=>i.value):[]}firstChild(e){let t=FE(e,this._root);return t&&t.children.length>0?t.children[0].value:null}siblings(e){let t=VE(e,this._root);return t.length<2?[]:t[t.length-2].children.map(r=>r.value).filter(r=>r!==e)}pathFromRoot(e){return VE(e,this._root).map(t=>t.value)}};function FE(n,e){if(n===e.value)return e;for(let t of e.children){let i=FE(n,t);if(i)return i}return null}function VE(n,e){if(n===e.value)return[e];for(let t of e.children){let i=VE(n,t);if(i.length)return i.unshift(e),i}return[]}var Cn=class{value;children;constructor(e,t){this.value=e,this.children=t}toString(){return`TreeNode(${this.value})`}};function Ga(n){let e={};return n&&n.children.forEach(t=>e[t.value.outlet]=t),e}var uu=class extends Fp{snapshot;constructor(e,t){super(e),this.snapshot=t,qE(this,e)}toString(){return this.snapshot.toString()}};function ck(n){let e=Ez(n),t=new wt([new qr("",{})]),i=new wt({}),r=new wt({}),o=new wt({}),s=new wt(""),a=new ni(t,i,o,s,r,X,n,e.root);return a.snapshot=e.root,new uu(new Cn(a,[]),e)}function Ez(n){let e={},t={},i={},o=new ms([],e,i,"",t,X,n,null,{});return new du("",new Cn(o,[]))}var ni=class{urlSubject;paramsSubject;queryParamsSubject;fragmentSubject;dataSubject;outlet;component;snapshot;_futureSnapshot;_routerState;_paramMap;_queryParamMap;title;url;params;queryParams;fragment;data;constructor(e,t,i,r,o,s,a,c){this.urlSubject=e,this.paramsSubject=t,this.queryParamsSubject=i,this.fragmentSubject=r,this.dataSubject=o,this.outlet=s,this.component=a,this._futureSnapshot=c,this.title=this.dataSubject?.pipe(z(l=>l[mu]))??H(void 0),this.url=e,this.params=t,this.queryParams=i,this.fragment=r,this.data=o}get routeConfig(){return this._futureSnapshot.routeConfig}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap??=this.params.pipe(z(e=>gs(e))),this._paramMap}get queryParamMap(){return this._queryParamMap??=this.queryParams.pipe(z(e=>gs(e))),this._queryParamMap}toString(){return this.snapshot?this.snapshot.toString():`Future(${this._futureSnapshot})`}};function Vp(n,e,t="emptyOnly"){let i,{routeConfig:r}=n;return e!==null&&(t==="always"||r?.path===""||!e.component&&!e.routeConfig?.loadComponent)?i={params:A(A({},e.params),n.params),data:A(A({},e.data),n.data),resolve:A(A(A(A({},n.data),e.data),r?.data),n._resolvedData)}:i={params:A({},n.params),data:A({},n.data),resolve:A(A({},n.data),n._resolvedData??{})},r&&uk(r)&&(i.resolve[mu]=r.title),i}var ms=class{url;params;queryParams;fragment;data;outlet;component;routeConfig;_resolve;_resolvedData;_routerState;_paramMap;_queryParamMap;get title(){return this.data?.[mu]}constructor(e,t,i,r,o,s,a,c,l){this.url=e,this.params=t,this.queryParams=i,this.fragment=r,this.data=o,this.outlet=s,this.component=a,this.routeConfig=c,this._resolve=l}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap??=gs(this.params),this._paramMap}get queryParamMap(){return this._queryParamMap??=gs(this.queryParams),this._queryParamMap}toString(){let e=this.url.map(i=>i.toString()).join("/"),t=this.routeConfig?this.routeConfig.path:"";return`Route(url:'${e}', path:'${t}')`}},du=class extends Fp{url;constructor(e,t){super(t),this.url=e,qE(this,t)}toString(){return lk(this._root)}};function qE(n,e){e.value._routerState=n,e.children.forEach(t=>qE(n,t))}function lk(n){let e=n.children.length>0?` { ${n.children.map(lk).join(", ")} } `:"";return`${n.value}${e}`}function ME(n){if(n.snapshot){let e=n.snapshot,t=n._futureSnapshot;n.snapshot=t,xi(e.queryParams,t.queryParams)||n.queryParamsSubject.next(t.queryParams),e.fragment!==t.fragment&&n.fragmentSubject.next(t.fragment),xi(e.params,t.params)||n.paramsSubject.next(t.params),Y4(e.url,t.url)||n.urlSubject.next(t.url),xi(e.data,t.data)||n.dataSubject.next(t.data)}else n.snapshot=n._futureSnapshot,n.dataSubject.next(n._futureSnapshot.data)}function jE(n,e){let t=xi(n.params,e.params)&&X4(n.url,e.url),i=!n.parent!=!e.parent;return t&&!i&&(!n.parent||jE(n.parent,e.parent))}function uk(n){return typeof n.title=="string"||n.title===null}var dk=new P(""),gu=(()=>{class n{activated=null;get activatedComponentRef(){return this.activated}_activatedRoute=null;name=X;activateEvents=new Ke;deactivateEvents=new Ke;attachEvents=new Ke;detachEvents=new Ke;routerOutletData=uR();parentContexts=C(oc);location=C(sr);changeDetector=C(lr);inputBinder=C(Hp,{optional:!0});supportsBindingToComponentInputs=!0;ngOnChanges(t){if(t.name){let{firstChange:i,previousValue:r}=t.name;if(i)return;this.isTrackedInParentContexts(r)&&(this.deactivate(),this.parentContexts.onChildOutletDestroyed(r)),this.initializeOutletWithName()}}ngOnDestroy(){this.isTrackedInParentContexts(this.name)&&this.parentContexts.onChildOutletDestroyed(this.name),this.inputBinder?.unsubscribeFromRouteData(this)}isTrackedInParentContexts(t){return this.parentContexts.getContext(t)?.outlet===this}ngOnInit(){this.initializeOutletWithName()}initializeOutletWithName(){if(this.parentContexts.onChildOutletCreated(this.name,this),this.activated)return;let t=this.parentContexts.getContext(this.name);t?.route&&(t.attachRef?this.attach(t.attachRef,t.route):this.activateWith(t.route,t.injector))}get isActivated(){return!!this.activated}get component(){if(!this.activated)throw new V(4012,!1);return this.activated.instance}get activatedRoute(){if(!this.activated)throw new V(4012,!1);return this._activatedRoute}get activatedRouteData(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}}detach(){if(!this.activated)throw new V(4012,!1);this.location.detach();let t=this.activated;return this.activated=null,this._activatedRoute=null,this.detachEvents.emit(t.instance),t}attach(t,i){this.activated=t,this._activatedRoute=i,this.location.insert(t.hostView),this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.attachEvents.emit(t.instance)}deactivate(){if(this.activated){let t=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(t)}}activateWith(t,i){if(this.isActivated)throw new V(4013,!1);this._activatedRoute=t;let r=this.location,s=t.snapshot.component,a=this.parentContexts.getOrCreateContext(this.name).children,c=new BE(t,a,r.injector,this.routerOutletData);this.activated=r.createComponent(s,{index:r.length,injector:c,environmentInjector:i}),this.changeDetector.markForCheck(),this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.activateEvents.emit(this.activated.instance)}static \u0275fac=function(i){return new(i||n)};static \u0275dir=ot({type:n,selectors:[["router-outlet"]],inputs:{name:"name",routerOutletData:[1,"routerOutletData"]},outputs:{activateEvents:"activate",deactivateEvents:"deactivate",attachEvents:"attach",detachEvents:"detach"},exportAs:["outlet"],features:[Xn]})}return n})(),BE=class{route;childContexts;parent;outletData;constructor(e,t,i,r){this.route=e,this.childContexts=t,this.parent=i,this.outletData=r}get(e,t){return e===ni?this.route:e===oc?this.childContexts:e===dk?this.outletData:this.parent.get(e,t)}},Hp=new P("");var GE=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275cmp=se({type:n,selectors:[["ng-component"]],exportAs:["emptyRouterOutlet"],decls:1,vars:0,template:function(i,r){i&1&&k(0,"router-outlet")},dependencies:[gu],encapsulation:2})}return n})();function YE(n){let e=n.children&&n.children.map(YE),t=e?G(A({},n),{children:e}):A({},n);return!t.component&&!t.loadComponent&&(e||t.loadChildren)&&t.outlet&&t.outlet!==X&&(t.component=GE),t}function wz(n,e,t){let i=fu(n,e._root,t?t._root:void 0);return new uu(i,e)}function fu(n,e,t){if(t&&n.shouldReuseRoute(e.value,t.value.snapshot)){let i=t.value;i._futureSnapshot=e.value;let r=Cz(n,e,t);return new Cn(i,r)}else{if(n.shouldAttach(e.value)){let o=n.retrieve(e.value);if(o!==null){let s=o.route;return s.value._futureSnapshot=e.value,s.children=e.children.map(a=>fu(n,a)),s}}let i=Iz(e.value),r=e.children.map(o=>fu(n,o));return new Cn(i,r)}}function Cz(n,e,t){return e.children.map(i=>{for(let r of t.children)if(n.shouldReuseRoute(i.value,r.value.snapshot))return fu(n,i,r);return fu(n,i)})}function Iz(n){return new ni(new wt(n.url),new wt(n.params),new wt(n.queryParams),new wt(n.fragment),new wt(n.data),n.outlet,n.component,n)}var tc=class{redirectTo;navigationBehaviorOptions;constructor(e,t){this.redirectTo=e,this.navigationBehaviorOptions=t}},fk="ngNavigationCancelingError";function jp(n,e){let{redirectTo:t,navigationBehaviorOptions:i}=Gr(e)?{redirectTo:e,navigationBehaviorOptions:void 0}:e,r=hk(!1,Zt.Redirect);return r.url=t,r.navigationBehaviorOptions=i,r}function hk(n,e){let t=new Error(`NavigationCancelingError: ${n||""}`);return t[fk]=!0,t.cancellationCode=e,t}function Sz(n){return pk(n)&&Gr(n.url)}function pk(n){return!!n&&n[fk]}var Dz=(n,e,t,i)=>z(r=>(new UE(e,r.targetRouterState,r.currentRouterState,t,i).activate(n),r)),UE=class{routeReuseStrategy;futureState;currState;forwardEvent;inputBindingEnabled;constructor(e,t,i,r,o){this.routeReuseStrategy=e,this.futureState=t,this.currState=i,this.forwardEvent=r,this.inputBindingEnabled=o}activate(e){let t=this.futureState._root,i=this.currState?this.currState._root:null;this.deactivateChildRoutes(t,i,e),ME(this.futureState.root),this.activateChildRoutes(t,i,e)}deactivateChildRoutes(e,t,i){let r=Ga(t);e.children.forEach(o=>{let s=o.value.outlet;this.deactivateRoutes(o,r[s],i),delete r[s]}),Object.values(r).forEach(o=>{this.deactivateRouteAndItsChildren(o,i)})}deactivateRoutes(e,t,i){let r=e.value,o=t?t.value:null;if(r===o)if(r.component){let s=i.getContext(r.outlet);s&&this.deactivateChildRoutes(e,t,s.children)}else this.deactivateChildRoutes(e,t,i);else o&&this.deactivateRouteAndItsChildren(t,i)}deactivateRouteAndItsChildren(e,t){e.value.component&&this.routeReuseStrategy.shouldDetach(e.value.snapshot)?this.detachAndStoreRouteSubtree(e,t):this.deactivateRouteAndOutlet(e,t)}detachAndStoreRouteSubtree(e,t){let i=t.getContext(e.value.outlet),r=i&&e.value.component?i.children:t,o=Ga(e);for(let s of Object.values(o))this.deactivateRouteAndItsChildren(s,r);if(i&&i.outlet){let s=i.outlet.detach(),a=i.children.onOutletDeactivated();this.routeReuseStrategy.store(e.value.snapshot,{componentRef:s,route:e,contexts:a})}}deactivateRouteAndOutlet(e,t){let i=t.getContext(e.value.outlet),r=i&&e.value.component?i.children:t,o=Ga(e);for(let s of Object.values(o))this.deactivateRouteAndItsChildren(s,r);i&&(i.outlet&&(i.outlet.deactivate(),i.children.onOutletDeactivated()),i.attachRef=null,i.route=null)}activateChildRoutes(e,t,i){let r=Ga(t);e.children.forEach(o=>{this.activateRoutes(o,r[o.value.outlet],i),this.forwardEvent(new Pp(o.value.snapshot))}),e.children.length&&this.forwardEvent(new Np(e.value.snapshot))}activateRoutes(e,t,i){let r=e.value,o=t?t.value:null;if(ME(r),r===o)if(r.component){let s=i.getOrCreateContext(r.outlet);this.activateChildRoutes(e,t,s.children)}else this.activateChildRoutes(e,t,i);else if(r.component){let s=i.getOrCreateContext(r.outlet);if(this.routeReuseStrategy.shouldAttach(r.snapshot)){let a=this.routeReuseStrategy.retrieve(r.snapshot);this.routeReuseStrategy.store(r.snapshot,null),s.children.onOutletReAttached(a.contexts),s.attachRef=a.componentRef,s.route=a.route.value,s.outlet&&s.outlet.attach(a.componentRef,a.route.value),ME(a.route.value),this.activateChildRoutes(e,null,s.children)}else s.attachRef=null,s.route=r,s.outlet&&s.outlet.activateWith(r,s.injector),this.activateChildRoutes(e,null,s.children)}else this.activateChildRoutes(e,null,i)}},Bp=class{path;route;constructor(e){this.path=e,this.route=this.path[this.path.length-1]}},Qa=class{component;route;constructor(e,t){this.component=e,this.route=t}};function Tz(n,e,t){let i=n._root,r=e?e._root:null;return ru(i,r,t,[i.value])}function xz(n){let e=n.routeConfig?n.routeConfig.canActivateChild:null;return!e||e.length===0?null:{node:n,guards:e}}function sc(n,e){let t=Symbol(),i=e.get(n,t);return i===t?typeof n=="function"&&!_y(n)?n:e.get(n):i}function ru(n,e,t,i,r={canDeactivateChecks:[],canActivateChecks:[]}){let o=Ga(e);return n.children.forEach(s=>{Az(s,o[s.value.outlet],t,i.concat([s.value]),r),delete o[s.value.outlet]}),Object.entries(o).forEach(([s,a])=>su(a,t.getContext(s),r)),r}function Az(n,e,t,i,r={canDeactivateChecks:[],canActivateChecks:[]}){let o=n.value,s=e?e.value:null,a=t?t.getContext(n.value.outlet):null;if(s&&o.routeConfig===s.routeConfig){let c=Mz(s,o,o.routeConfig.runGuardsAndResolvers);c?r.canActivateChecks.push(new Bp(i)):(o.data=s.data,o._resolvedData=s._resolvedData),o.component?ru(n,e,a?a.children:null,i,r):ru(n,e,t,i,r),c&&a&&a.outlet&&a.outlet.isActivated&&r.canDeactivateChecks.push(new Qa(a.outlet.component,s))}else s&&su(e,a,r),r.canActivateChecks.push(new Bp(i)),o.component?ru(n,null,a?a.children:null,i,r):ru(n,null,t,i,r);return r}function Mz(n,e,t){if(typeof t=="function")return t(n,e);switch(t){case"pathParamsChange":return!ps(n.url,e.url);case"pathParamsOrQueryParamsChange":return!ps(n.url,e.url)||!xi(n.queryParams,e.queryParams);case"always":return!0;case"paramsOrQueryParamsChange":return!jE(n,e)||!xi(n.queryParams,e.queryParams);case"paramsChange":default:return!jE(n,e)}}function su(n,e,t){let i=Ga(n),r=n.value;Object.entries(i).forEach(([o,s])=>{r.component?e?su(s,e.children.getContext(o),t):su(s,null,t):su(s,e,t)}),r.component?e&&e.outlet&&e.outlet.isActivated?t.canDeactivateChecks.push(new Qa(e.outlet.component,r)):t.canDeactivateChecks.push(new Qa(null,r)):t.canDeactivateChecks.push(new Qa(null,r))}function vu(n){return typeof n=="function"}function Rz(n){return typeof n=="boolean"}function kz(n){return n&&vu(n.canLoad)}function Nz(n){return n&&vu(n.canActivate)}function Oz(n){return n&&vu(n.canActivateChild)}function Pz(n){return n&&vu(n.canDeactivate)}function Lz(n){return n&&vu(n.canMatch)}function mk(n){return n instanceof Gi||n?.name==="EmptyError"}var bp=Symbol("INITIAL_VALUE");function nc(){return Pt(n=>ma(n.map(e=>e.pipe(Wt(1),iy(bp)))).pipe(z(e=>{for(let t of e)if(t!==!0){if(t===bp)return bp;if(t===!1||Fz(t))return t}return!0}),mn(e=>e!==bp),Wt(1)))}function Fz(n){return Gr(n)||n instanceof tc}function Vz(n,e){return $e(t=>{let{targetSnapshot:i,currentSnapshot:r,guards:{canActivateChecks:o,canDeactivateChecks:s}}=t;return s.length===0&&o.length===0?H(G(A({},t),{guardsResult:!0})):jz(s,i,r,n).pipe($e(a=>a&&Rz(a)?Bz(i,o,n,e):H(a)),z(a=>G(A({},t),{guardsResult:a})))})}function jz(n,e,t,i){return ke(n).pipe($e(r=>Wz(r.component,r.route,t,e,i)),Ki(r=>r!==!0,!0))}function Bz(n,e,t,i){return ke(e).pipe(Fo(r=>Mr(Hz(r.route.parent,i),Uz(r.route,i),zz(n,r.path,t),$z(n,r.route,t))),Ki(r=>r!==!0,!0))}function Uz(n,e){return n!==null&&e&&e(new Op(n)),H(!0)}function Hz(n,e){return n!==null&&e&&e(new kp(n)),H(!0)}function $z(n,e,t){let i=e.routeConfig?e.routeConfig.canActivate:null;if(!i||i.length===0)return H(!0);let r=i.map(o=>hl(()=>{let s=rc(e)??t,a=sc(o,s),c=Nz(a)?a.canActivate(e,n):at(s,()=>a(e,n));return dr(c).pipe(Ki())}));return H(r).pipe(nc())}function zz(n,e,t){let i=e[e.length-1],o=e.slice(0,e.length-1).reverse().map(s=>xz(s)).filter(s=>s!==null).map(s=>hl(()=>{let a=s.guards.map(c=>{let l=rc(s.node)??t,u=sc(c,l),d=Oz(u)?u.canActivateChild(i,n):at(l,()=>u(i,n));return dr(d).pipe(Ki())});return H(a).pipe(nc())}));return H(o).pipe(nc())}function Wz(n,e,t,i,r){let o=e&&e.routeConfig?e.routeConfig.canDeactivate:null;if(!o||o.length===0)return H(!0);let s=o.map(a=>{let c=rc(e)??r,l=sc(a,c),u=Pz(l)?l.canDeactivate(n,e,t,i):at(c,()=>l(n,e,t,i));return dr(u).pipe(Ki())});return H(s).pipe(nc())}function qz(n,e,t,i){let r=e.canLoad;if(r===void 0||r.length===0)return H(!0);let o=r.map(s=>{let a=sc(s,n),c=kz(a)?a.canLoad(e,t):at(n,()=>a(e,t));return dr(c)});return H(o).pipe(nc(),gk(i))}function gk(n){return Uv(mt(e=>{if(typeof e!="boolean")throw jp(n,e)}),z(e=>e===!0))}function Gz(n,e,t,i){let r=e.canMatch;if(!r||r.length===0)return H(!0);let o=r.map(s=>{let a=sc(s,n),c=Lz(a)?a.canMatch(e,t):at(n,()=>a(e,t));return dr(c)});return H(o).pipe(nc(),gk(i))}var hu=class{segmentGroup;constructor(e){this.segmentGroup=e||null}},pu=class extends Error{urlTree;constructor(e){super(),this.urlTree=e}};function qa(n){return ha(new hu(n))}function Yz(n){return ha(new V(4e3,!1))}function Kz(n){return ha(hk(!1,Zt.GuardRejected))}var HE=class{urlSerializer;urlTree;constructor(e,t){this.urlSerializer=e,this.urlTree=t}lineralizeSegments(e,t){let i=[],r=t.root;for(;;){if(i=i.concat(r.segments),r.numberOfChildren===0)return H(i);if(r.numberOfChildren>1||!r.children[X])return Yz(`${e.redirectTo}`);r=r.children[X]}}applyRedirectCommands(e,t,i,r,o){return Qz(t,r,o).pipe(z(s=>{if(s instanceof Mi)throw new pu(s);let a=this.applyRedirectCreateUrlTree(s,this.urlSerializer.parse(s),e,i);if(s[0]==="/")throw new pu(a);return a}))}applyRedirectCreateUrlTree(e,t,i,r){let o=this.createSegmentGroup(e,t.root,i,r);return new Mi(o,this.createQueryParams(t.queryParams,this.urlTree.queryParams),t.fragment)}createQueryParams(e,t){let i={};return Object.entries(e).forEach(([r,o])=>{if(typeof o=="string"&&o[0]===":"){let a=o.substring(1);i[r]=t[a]}else i[r]=o}),i}createSegmentGroup(e,t,i,r){let o=this.createSegments(e,t.segments,i,r),s={};return Object.entries(t.children).forEach(([a,c])=>{s[a]=this.createSegmentGroup(e,c,i,r)}),new Ee(o,s)}createSegments(e,t,i,r){return t.map(o=>o.path[0]===":"?this.findPosParam(e,o,r):this.findOrReturn(o,i))}findPosParam(e,t,i){let r=i[t.path.substring(1)];if(!r)throw new V(4001,!1);return r}findOrReturn(e,t){let i=0;for(let r of t){if(r.path===e.path)return t.splice(i),r;i++}return e}};function Qz(n,e,t){if(typeof n=="string")return H(n);let i=n,{queryParams:r,fragment:o,routeConfig:s,url:a,outlet:c,params:l,data:u,title:d}=e;return dr(at(t,()=>i({params:l,data:u,queryParams:r,fragment:o,routeConfig:s,url:a,outlet:c,title:d})))}var $E={matched:!1,consumedSegments:[],remainingSegments:[],parameters:{},positionalParamSegments:{}};function Zz(n,e,t,i,r){let o=vk(n,e,t);return o.matched?(i=_z(e,i),Gz(i,e,t,r).pipe(z(s=>s===!0?o:A({},$E)))):H(o)}function vk(n,e,t){if(e.path==="**")return Xz(t);if(e.path==="")return e.pathMatch==="full"&&(n.hasChildren()||t.length>0)?A({},$E):{matched:!0,consumedSegments:[],remainingSegments:t,parameters:{},positionalParamSegments:{}};let r=(e.matcher||qR)(t,n,e);if(!r)return A({},$E);let o={};Object.entries(r.posParams??{}).forEach(([a,c])=>{o[a]=c.path});let s=r.consumed.length>0?A(A({},o),r.consumed[r.consumed.length-1].parameters):o;return{matched:!0,consumedSegments:r.consumed,remainingSegments:t.slice(r.consumed.length),parameters:s,positionalParamSegments:r.posParams??{}}}function Xz(n){return{matched:!0,parameters:n.length>0?YR(n).parameters:{},consumedSegments:n,remainingSegments:[],positionalParamSegments:{}}}function $R(n,e,t,i){return t.length>0&&tW(n,t,i)?{segmentGroup:new Ee(e,eW(i,new Ee(t,n.children))),slicedSegments:[]}:t.length===0&&nW(n,t,i)?{segmentGroup:new Ee(n.segments,Jz(n,t,i,n.children)),slicedSegments:t}:{segmentGroup:new Ee(n.segments,n.children),slicedSegments:t}}function Jz(n,e,t,i){let r={};for(let o of t)if($p(n,e,o)&&!i[ti(o)]){let s=new Ee([],{});r[ti(o)]=s}return A(A({},i),r)}function eW(n,e){let t={};t[X]=e;for(let i of n)if(i.path===""&&ti(i)!==X){let r=new Ee([],{});t[ti(i)]=r}return t}function tW(n,e,t){return t.some(i=>$p(n,e,i)&&ti(i)!==X)}function nW(n,e,t){return t.some(i=>$p(n,e,i))}function $p(n,e,t){return(n.hasChildren()||e.length>0)&&t.pathMatch==="full"?!1:t.path===""}function iW(n,e,t){return e.length===0&&!n.children[t]}var zE=class{};function rW(n,e,t,i,r,o,s="emptyOnly"){return new WE(n,e,t,i,r,s,o).recognize()}var oW=31,WE=class{injector;configLoader;rootComponentType;config;urlTree;paramsInheritanceStrategy;urlSerializer;applyRedirects;absoluteRedirectCount=0;allowRedirects=!0;constructor(e,t,i,r,o,s,a){this.injector=e,this.configLoader=t,this.rootComponentType=i,this.config=r,this.urlTree=o,this.paramsInheritanceStrategy=s,this.urlSerializer=a,this.applyRedirects=new HE(this.urlSerializer,this.urlTree)}noMatchError(e){return new V(4002,`'${e.segmentGroup}'`)}recognize(){let e=$R(this.urlTree.root,[],[],this.config).segmentGroup;return this.match(e).pipe(z(({children:t,rootSnapshot:i})=>{let r=new Cn(i,t),o=new du("",r),s=ik(i,[],this.urlTree.queryParams,this.urlTree.fragment);return s.queryParams=this.urlTree.queryParams,o.url=this.urlSerializer.serialize(s),{state:o,tree:s}}))}match(e){let t=new ms([],Object.freeze({}),Object.freeze(A({},this.urlTree.queryParams)),this.urlTree.fragment,Object.freeze({}),X,this.rootComponentType,null,{});return this.processSegmentGroup(this.injector,this.config,e,X,t).pipe(z(i=>({children:i,rootSnapshot:t})),xn(i=>{if(i instanceof pu)return this.urlTree=i.urlTree,this.match(i.urlTree.root);throw i instanceof hu?this.noMatchError(i):i}))}processSegmentGroup(e,t,i,r,o){return i.segments.length===0&&i.hasChildren()?this.processChildren(e,t,i,o):this.processSegment(e,t,i,i.segments,r,!0,o).pipe(z(s=>s instanceof Cn?[s]:[]))}processChildren(e,t,i,r){let o=[];for(let s of Object.keys(i.children))s==="primary"?o.unshift(s):o.push(s);return ke(o).pipe(Fo(s=>{let a=i.children[s],c=bz(t,s);return this.processSegmentGroup(e,c,a,s,r)}),gl((s,a)=>(s.push(...a),s)),Rr(null),ny(),$e(s=>{if(s===null)return qa(i);let a=yk(s);return sW(a),H(a)}))}processSegment(e,t,i,r,o,s,a){return ke(t).pipe(Fo(c=>this.processSegmentAgainstRoute(c._injector??e,t,c,i,r,o,s,a).pipe(xn(l=>{if(l instanceof hu)return H(null);throw l}))),Ki(c=>!!c),xn(c=>{if(mk(c))return iW(i,r,o)?H(new zE):qa(i);throw c}))}processSegmentAgainstRoute(e,t,i,r,o,s,a,c){return ti(i)!==s&&(s===X||!$p(r,o,i))?qa(r):i.redirectTo===void 0?this.matchSegmentAgainstRoute(e,r,i,o,s,c):this.allowRedirects&&a?this.expandSegmentAgainstRouteUsingRedirect(e,r,t,i,o,s,c):qa(r)}expandSegmentAgainstRouteUsingRedirect(e,t,i,r,o,s,a){let{matched:c,parameters:l,consumedSegments:u,positionalParamSegments:d,remainingSegments:f}=vk(t,r,o);if(!c)return qa(t);typeof r.redirectTo=="string"&&r.redirectTo[0]==="/"&&(this.absoluteRedirectCount++,this.absoluteRedirectCount>oW&&(this.allowRedirects=!1));let h=new ms(o,l,Object.freeze(A({},this.urlTree.queryParams)),this.urlTree.fragment,zR(r),ti(r),r.component??r._loadedComponent??null,r,WR(r)),g=Vp(h,a,this.paramsInheritanceStrategy);return h.params=Object.freeze(g.params),h.data=Object.freeze(g.data),this.applyRedirects.applyRedirectCommands(u,r.redirectTo,d,h,e).pipe(Pt(_=>this.applyRedirects.lineralizeSegments(r,_)),$e(_=>this.processSegment(e,i,t,_.concat(f),s,!1,a)))}matchSegmentAgainstRoute(e,t,i,r,o,s){let a=Zz(t,i,r,e,this.urlSerializer);return i.path==="**"&&(t.children={}),a.pipe(Pt(c=>c.matched?(e=i._injector??e,this.getChildConfig(e,i,r).pipe(Pt(({routes:l})=>{let u=i._loadedInjector??e,{parameters:d,consumedSegments:f,remainingSegments:h}=c,g=new ms(f,d,Object.freeze(A({},this.urlTree.queryParams)),this.urlTree.fragment,zR(i),ti(i),i.component??i._loadedComponent??null,i,WR(i)),y=Vp(g,s,this.paramsInheritanceStrategy);g.params=Object.freeze(y.params),g.data=Object.freeze(y.data);let{segmentGroup:_,slicedSegments:b}=$R(t,f,h,l);if(b.length===0&&_.hasChildren())return this.processChildren(u,l,_,g).pipe(z(I=>new Cn(g,I)));if(l.length===0&&b.length===0)return H(new Cn(g,[]));let w=ti(i)===o;return this.processSegment(u,l,_,b,w?X:o,!0,g).pipe(z(I=>new Cn(g,I instanceof Cn?[I]:[])))}))):qa(t)))}getChildConfig(e,t,i){return t.children?H({routes:t.children,injector:e}):t.loadChildren?t._loadedRoutes!==void 0?H({routes:t._loadedRoutes,injector:t._loadedInjector}):qz(e,t,i,this.urlSerializer).pipe($e(r=>r?this.configLoader.loadChildren(e,t).pipe(mt(o=>{t._loadedRoutes=o.routes,t._loadedInjector=o.injector})):Kz(t))):H({routes:[],injector:e})}};function sW(n){n.sort((e,t)=>e.value.outlet===X?-1:t.value.outlet===X?1:e.value.outlet.localeCompare(t.value.outlet))}function aW(n){let e=n.value.routeConfig;return e&&e.path===""}function yk(n){let e=[],t=new Set;for(let i of n){if(!aW(i)){e.push(i);continue}let r=e.find(o=>i.value.routeConfig===o.value.routeConfig);r!==void 0?(r.children.push(...i.children),t.add(r)):e.push(i)}for(let i of t){let r=yk(i.children);e.push(new Cn(i.value,r))}return e.filter(i=>!t.has(i))}function zR(n){return n.data||{}}function WR(n){return n.resolve||{}}function cW(n,e,t,i,r,o){return $e(s=>rW(n,e,t,i,s.extractedUrl,r,o).pipe(z(({state:a,tree:c})=>G(A({},s),{targetSnapshot:a,urlAfterRedirects:c}))))}function lW(n,e){return $e(t=>{let{targetSnapshot:i,guards:{canActivateChecks:r}}=t;if(!r.length)return H(t);let o=new Set(r.map(c=>c.route)),s=new Set;for(let c of o)if(!s.has(c))for(let l of _k(c))s.add(l);let a=0;return ke(s).pipe(Fo(c=>o.has(c)?uW(c,i,n,e):(c.data=Vp(c,c.parent,n).resolve,H(void 0))),mt(()=>a++),va(1),$e(c=>a===s.size?H(t):Ot))})}function _k(n){let e=n.children.map(t=>_k(t)).flat();return[n,...e]}function uW(n,e,t,i){let r=n.routeConfig,o=n._resolve;return r?.title!==void 0&&!uk(r)&&(o[mu]=r.title),hl(()=>(n.data=Vp(n,n.parent,t).resolve,dW(o,n,e,i).pipe(z(s=>(n._resolvedData=s,n.data=A(A({},n.data),s),null)))))}function dW(n,e,t,i){let r=NE(n);if(r.length===0)return H({});let o={};return ke(r).pipe($e(s=>fW(n[s],e,t,i).pipe(Ki(),mt(a=>{if(a instanceof tc)throw jp(new vs,a);o[s]=a}))),va(1),z(()=>o),xn(s=>mk(s)?Ot:ha(s)))}function fW(n,e,t,i){let r=rc(e)??i,o=sc(n,r),s=o.resolve?o.resolve(e,t):at(r,()=>o(e,t));return dr(s)}function RE(n){return Pt(e=>{let t=n(e);return t?ke(t).pipe(z(()=>e)):H(e)})}var KE=(()=>{class n{buildTitle(t){let i,r=t.root;for(;r!==void 0;)i=this.getResolvedTitleForRoute(r)??i,r=r.children.find(o=>o.outlet===X);return i}getResolvedTitleForRoute(t){return t.data[mu]}static \u0275fac=function(i){return new(i||n)};static \u0275prov=L({token:n,factory:()=>C(bk),providedIn:"root"})}return n})(),bk=(()=>{class n extends KE{title;constructor(t){super(),this.title=t}updateTitle(t){let i=this.buildTitle(t);i!==void 0&&this.title.setTitle(i)}static \u0275fac=function(i){return new(i||n)($(yp))};static \u0275prov=L({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),ac=new P("",{providedIn:"root",factory:()=>({})}),yu=new P(""),Ek=(()=>{class n{componentLoaders=new WeakMap;childrenLoaders=new WeakMap;onLoadStartListener;onLoadEndListener;compiler=C(Hb);loadComponent(t,i){if(this.componentLoaders.get(i))return this.componentLoaders.get(i);if(i._loadedComponent)return H(i._loadedComponent);this.onLoadStartListener&&this.onLoadStartListener(i);let r=dr(at(t,()=>i.loadComponent())).pipe(z(Ck),Pt(Ik),mt(s=>{this.onLoadEndListener&&this.onLoadEndListener(i),i._loadedComponent=s}),ml(()=>{this.componentLoaders.delete(i)})),o=new ca(r,()=>new Ge).pipe(aa());return this.componentLoaders.set(i,o),o}loadChildren(t,i){if(this.childrenLoaders.get(i))return this.childrenLoaders.get(i);if(i._loadedRoutes)return H({routes:i._loadedRoutes,injector:i._loadedInjector});this.onLoadStartListener&&this.onLoadStartListener(i);let o=wk(i,this.compiler,t,this.onLoadEndListener).pipe(ml(()=>{this.childrenLoaders.delete(i)})),s=new ca(o,()=>new Ge).pipe(aa());return this.childrenLoaders.set(i,s),s}static \u0275fac=function(i){return new(i||n)};static \u0275prov=L({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function wk(n,e,t,i){return dr(at(t,()=>n.loadChildren())).pipe(z(Ck),Pt(Ik),$e(r=>r instanceof Qh||Array.isArray(r)?H(r):ke(e.compileModuleAsync(r))),z(r=>{i&&i(n);let o,s,a=!1;return Array.isArray(r)?(s=r,a=!0):(o=r.create(t).injector,s=o.get(yu,[],{optional:!0,self:!0}).flat()),{routes:s.map(YE),injector:o}}))}function hW(n){return n&&typeof n=="object"&&"default"in n}function Ck(n){return hW(n)?n.default:n}function Ik(n){return H(n)}var zp=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275prov=L({token:n,factory:()=>C(pW),providedIn:"root"})}return n})(),pW=(()=>{class n{shouldProcessUrl(t){return!0}extract(t){return t}merge(t,i){return t}static \u0275fac=function(i){return new(i||n)};static \u0275prov=L({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),Sk=new P("");var Dk=new P(""),QE=(()=>{class n{currentNavigation=on(null,{equal:()=>!1});currentTransition=null;lastSuccessfulNavigation=null;events=new Ge;transitionAbortWithErrorSubject=new Ge;configLoader=C(Ek);environmentInjector=C(it);destroyRef=C(Pn);urlSerializer=C(ic);rootContexts=C(oc);location=C(hs);inputBindingEnabled=C(Hp,{optional:!0})!==null;titleStrategy=C(KE);options=C(ac,{optional:!0})||{};paramsInheritanceStrategy=this.options.paramsInheritanceStrategy||"emptyOnly";urlHandlingStrategy=C(zp);createViewTransition=C(Sk,{optional:!0});navigationErrorHandler=C(Dk,{optional:!0});navigationId=0;get hasRequestedNavigation(){return this.navigationId!==0}transitions;afterPreactivation=()=>H(void 0);rootComponentType=null;destroyed=!1;constructor(){let t=r=>this.events.next(new Mp(r)),i=r=>this.events.next(new Rp(r));this.configLoader.onLoadEndListener=i,this.configLoader.onLoadStartListener=t,this.destroyRef.onDestroy(()=>{this.destroyed=!0})}complete(){this.transitions?.complete()}handleNavigationRequest(t){let i=++this.navigationId;st(()=>{this.transitions?.next(G(A({},t),{extractedUrl:this.urlHandlingStrategy.extract(t.rawUrl),targetSnapshot:null,targetRouterState:null,guards:{canActivateChecks:[],canDeactivateChecks:[]},guardsResult:null,abortController:new AbortController,id:i}))})}setupNavigations(t){return this.transitions=new wt(null),this.transitions.pipe(mn(i=>i!==null),Pt(i=>{let r=!1;return H(i).pipe(Pt(o=>{if(this.navigationId>i.id)return this.cancelNavigationTransition(i,"",Zt.SupersededByNewNavigation),Ot;this.currentTransition=i,this.currentNavigation.set({id:o.id,initialUrl:o.rawUrl,extractedUrl:o.extractedUrl,targetBrowserUrl:typeof o.extras.browserUrl=="string"?this.urlSerializer.parse(o.extras.browserUrl):o.extras.browserUrl,trigger:o.source,extras:o.extras,previousNavigation:this.lastSuccessfulNavigation?G(A({},this.lastSuccessfulNavigation),{previousNavigation:null}):null,abort:()=>o.abortController.abort()});let s=!t.navigated||this.isUpdatingInternalState()||this.isUpdatedBrowserUrl(),a=o.extras.onSameUrlNavigation??t.onSameUrlNavigation;if(!s&&a!=="reload")return this.events.next(new Ri(o.id,this.urlSerializer.serialize(o.rawUrl),"",Za.IgnoredSameUrlNavigation)),o.resolve(!1),Ot;if(this.urlHandlingStrategy.shouldProcessUrl(o.rawUrl))return H(o).pipe(Pt(c=>(this.events.next(new Yr(c.id,this.urlSerializer.serialize(c.extractedUrl),c.source,c.restoredState)),c.id!==this.navigationId?Ot:Promise.resolve(c))),cW(this.environmentInjector,this.configLoader,this.rootComponentType,t.config,this.urlSerializer,this.paramsInheritanceStrategy),mt(c=>{i.targetSnapshot=c.targetSnapshot,i.urlAfterRedirects=c.urlAfterRedirects,this.currentNavigation.update(u=>(u.finalUrl=c.urlAfterRedirects,u));let l=new cu(c.id,this.urlSerializer.serialize(c.extractedUrl),this.urlSerializer.serialize(c.urlAfterRedirects),c.targetSnapshot);this.events.next(l)}));if(s&&this.urlHandlingStrategy.shouldProcessUrl(o.currentRawUrl)){let{id:c,extractedUrl:l,source:u,restoredState:d,extras:f}=o,h=new Yr(c,this.urlSerializer.serialize(l),u,d);this.events.next(h);let g=ck(this.rootComponentType).snapshot;return this.currentTransition=i=G(A({},o),{targetSnapshot:g,urlAfterRedirects:l,extras:G(A({},f),{skipLocationChange:!1,replaceUrl:!1})}),this.currentNavigation.update(y=>(y.finalUrl=l,y)),H(i)}else return this.events.next(new Ri(o.id,this.urlSerializer.serialize(o.extractedUrl),"",Za.IgnoredByUrlHandlingStrategy)),o.resolve(!1),Ot}),mt(o=>{let s=new Dp(o.id,this.urlSerializer.serialize(o.extractedUrl),this.urlSerializer.serialize(o.urlAfterRedirects),o.targetSnapshot);this.events.next(s)}),z(o=>(this.currentTransition=i=G(A({},o),{guards:Tz(o.targetSnapshot,o.currentSnapshot,this.rootContexts)}),i)),Vz(this.environmentInjector,o=>this.events.next(o)),mt(o=>{if(i.guardsResult=o.guardsResult,o.guardsResult&&typeof o.guardsResult!="boolean")throw jp(this.urlSerializer,o.guardsResult);let s=new Tp(o.id,this.urlSerializer.serialize(o.extractedUrl),this.urlSerializer.serialize(o.urlAfterRedirects),o.targetSnapshot,!!o.guardsResult);this.events.next(s)}),mn(o=>o.guardsResult?!0:(this.cancelNavigationTransition(o,"",Zt.GuardRejected),!1)),RE(o=>{if(o.guards.canActivateChecks.length!==0)return H(o).pipe(mt(s=>{let a=new xp(s.id,this.urlSerializer.serialize(s.extractedUrl),this.urlSerializer.serialize(s.urlAfterRedirects),s.targetSnapshot);this.events.next(a)}),Pt(s=>{let a=!1;return H(s).pipe(lW(this.paramsInheritanceStrategy,this.environmentInjector),mt({next:()=>a=!0,complete:()=>{a||this.cancelNavigationTransition(s,"",Zt.NoDataFromResolver)}}))}),mt(s=>{let a=new Ap(s.id,this.urlSerializer.serialize(s.extractedUrl),this.urlSerializer.serialize(s.urlAfterRedirects),s.targetSnapshot);this.events.next(a)}))}),RE(o=>{let s=a=>{let c=[];if(a.routeConfig?.loadComponent){let l=rc(a)??this.environmentInjector;c.push(this.configLoader.loadComponent(l,a.routeConfig).pipe(mt(u=>{a.component=u}),z(()=>{})))}for(let l of a.children)c.push(...s(l));return c};return ma(s(o.targetSnapshot.root)).pipe(Rr(null),Wt(1))}),RE(()=>this.afterPreactivation()),Pt(()=>{let{currentSnapshot:o,targetSnapshot:s}=i,a=this.createViewTransition?.(this.environmentInjector,o.root,s.root);return a?ke(a).pipe(z(()=>i)):H(i)}),z(o=>{let s=wz(t.routeReuseStrategy,o.targetSnapshot,o.currentRouterState);return this.currentTransition=i=G(A({},o),{targetRouterState:s}),this.currentNavigation.update(a=>(a.targetRouterState=s,a)),i}),mt(()=>{this.events.next(new lu)}),Dz(this.rootContexts,t.routeReuseStrategy,o=>this.events.next(o),this.inputBindingEnabled),Wt(1),Qi(new Y(o=>{let s=i.abortController.signal,a=()=>o.next();return s.addEventListener("abort",a),()=>s.removeEventListener("abort",a)}).pipe(mn(()=>!r&&!i.targetRouterState),mt(()=>{this.cancelNavigationTransition(i,i.abortController.signal.reason+"",Zt.Aborted)}))),mt({next:o=>{r=!0,this.lastSuccessfulNavigation=st(this.currentNavigation),this.events.next(new Vn(o.id,this.urlSerializer.serialize(o.extractedUrl),this.urlSerializer.serialize(o.urlAfterRedirects))),this.titleStrategy?.updateTitle(o.targetRouterState.snapshot),o.resolve(!0)},complete:()=>{r=!0}}),Qi(this.transitionAbortWithErrorSubject.pipe(mt(o=>{throw o}))),ml(()=>{r||this.cancelNavigationTransition(i,"",Zt.SupersededByNewNavigation),this.currentTransition?.id===i.id&&(this.currentNavigation.set(null),this.currentTransition=null)}),xn(o=>{if(this.destroyed)return i.resolve(!1),Ot;if(r=!0,pk(o))this.events.next(new Ai(i.id,this.urlSerializer.serialize(i.extractedUrl),o.message,o.cancellationCode)),Sz(o)?this.events.next(new ec(o.url,o.navigationBehaviorOptions)):i.resolve(!1);else{let s=new Xa(i.id,this.urlSerializer.serialize(i.extractedUrl),o,i.targetSnapshot??void 0);try{let a=at(this.environmentInjector,()=>this.navigationErrorHandler?.(s));if(a instanceof tc){let{message:c,cancellationCode:l}=jp(this.urlSerializer,a);this.events.next(new Ai(i.id,this.urlSerializer.serialize(i.extractedUrl),c,l)),this.events.next(new ec(a.redirectTo,a.navigationBehaviorOptions))}else throw this.events.next(s),o}catch(a){this.options.resolveNavigationPromiseOnError?i.resolve(!1):i.reject(a)}}return Ot}))}))}cancelNavigationTransition(t,i,r){let o=new Ai(t.id,this.urlSerializer.serialize(t.extractedUrl),i,r);this.events.next(o),t.resolve(!1)}isUpdatingInternalState(){return this.currentTransition?.extractedUrl.toString()!==this.currentTransition?.currentUrlTree.toString()}isUpdatedBrowserUrl(){let t=this.urlHandlingStrategy.extract(this.urlSerializer.parse(this.location.path(!0))),i=st(this.currentNavigation),r=i?.targetBrowserUrl??i?.extractedUrl;return t.toString()!==r?.toString()&&!i?.extras.skipLocationChange}static \u0275fac=function(i){return new(i||n)};static \u0275prov=L({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function mW(n){return n!==Ka}var Tk=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275prov=L({token:n,factory:()=>C(gW),providedIn:"root"})}return n})(),Up=class{shouldDetach(e){return!1}store(e,t){}shouldAttach(e){return!1}retrieve(e){return null}shouldReuseRoute(e,t){return e.routeConfig===t.routeConfig}},gW=(()=>{class n extends Up{static \u0275fac=(()=>{let t;return function(r){return(t||(t=La(n)))(r||n)}})();static \u0275prov=L({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),xk=(()=>{class n{urlSerializer=C(ic);options=C(ac,{optional:!0})||{};canceledNavigationResolution=this.options.canceledNavigationResolution||"replace";location=C(hs);urlHandlingStrategy=C(zp);urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred";currentUrlTree=new Mi;getCurrentUrlTree(){return this.currentUrlTree}rawUrlTree=this.currentUrlTree;getRawUrlTree(){return this.rawUrlTree}createBrowserPath({finalUrl:t,initialUrl:i,targetBrowserUrl:r}){let o=t!==void 0?this.urlHandlingStrategy.merge(t,i):i,s=r??o;return s instanceof Mi?this.urlSerializer.serialize(s):s}commitTransition({targetRouterState:t,finalUrl:i,initialUrl:r}){i&&t?(this.currentUrlTree=i,this.rawUrlTree=this.urlHandlingStrategy.merge(i,r),this.routerState=t):this.rawUrlTree=r}routerState=ck(null);getRouterState(){return this.routerState}stateMemento=this.createStateMemento();updateStateMemento(){this.stateMemento=this.createStateMemento()}createStateMemento(){return{rawUrlTree:this.rawUrlTree,currentUrlTree:this.currentUrlTree,routerState:this.routerState}}resetInternalState({finalUrl:t}){this.routerState=this.stateMemento.routerState,this.currentUrlTree=this.stateMemento.currentUrlTree,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,t??this.rawUrlTree)}static \u0275fac=function(i){return new(i||n)};static \u0275prov=L({token:n,factory:()=>C(vW),providedIn:"root"})}return n})(),vW=(()=>{class n extends xk{currentPageId=0;lastSuccessfulId=-1;restoredState(){return this.location.getState()}get browserPageId(){return this.canceledNavigationResolution!=="computed"?this.currentPageId:this.restoredState()?.\u0275routerPageId??this.currentPageId}registerNonRouterCurrentEntryChangeListener(t){return this.location.subscribe(i=>{i.type==="popstate"&&setTimeout(()=>{t(i.url,i.state,"popstate")})})}handleRouterEvent(t,i){t instanceof Yr?this.updateStateMemento():t instanceof Ri?this.commitTransition(i):t instanceof cu?this.urlUpdateStrategy==="eager"&&(i.extras.skipLocationChange||this.setBrowserUrl(this.createBrowserPath(i),i)):t instanceof lu?(this.commitTransition(i),this.urlUpdateStrategy==="deferred"&&!i.extras.skipLocationChange&&this.setBrowserUrl(this.createBrowserPath(i),i)):t instanceof Ai&&t.code!==Zt.SupersededByNewNavigation&&t.code!==Zt.Redirect?this.restoreHistory(i):t instanceof Xa?this.restoreHistory(i,!0):t instanceof Vn&&(this.lastSuccessfulId=t.id,this.currentPageId=this.browserPageId)}setBrowserUrl(t,{extras:i,id:r}){let{replaceUrl:o,state:s}=i;if(this.location.isCurrentPathEqualTo(t)||o){let a=this.browserPageId,c=A(A({},s),this.generateNgRouterState(r,a));this.location.replaceState(t,"",c)}else{let a=A(A({},s),this.generateNgRouterState(r,this.browserPageId+1));this.location.go(t,"",a)}}restoreHistory(t,i=!1){if(this.canceledNavigationResolution==="computed"){let r=this.browserPageId,o=this.currentPageId-r;o!==0?this.location.historyGo(o):this.getCurrentUrlTree()===t.finalUrl&&o===0&&(this.resetInternalState(t),this.resetUrlToCurrentUrlTree())}else this.canceledNavigationResolution==="replace"&&(i&&this.resetInternalState(t),this.resetUrlToCurrentUrlTree())}resetUrlToCurrentUrlTree(){this.location.replaceState(this.urlSerializer.serialize(this.getRawUrlTree()),"",this.generateNgRouterState(this.lastSuccessfulId,this.currentPageId))}generateNgRouterState(t,i){return this.canceledNavigationResolution==="computed"?{navigationId:t,\u0275routerPageId:i}:{navigationId:t}}static \u0275fac=(()=>{let t;return function(r){return(t||(t=La(n)))(r||n)}})();static \u0275prov=L({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function ZE(n,e){n.events.pipe(mn(t=>t instanceof Vn||t instanceof Ai||t instanceof Xa||t instanceof Ri),z(t=>t instanceof Vn||t instanceof Ri?0:(t instanceof Ai?t.code===Zt.Redirect||t.code===Zt.SupersededByNewNavigation:!1)?2:1),mn(t=>t!==2),Wt(1)).subscribe(()=>{e()})}var yW={paths:"exact",fragment:"ignored",matrixParams:"ignored",queryParams:"exact"},_W={paths:"subset",fragment:"ignored",matrixParams:"ignored",queryParams:"subset"},_t=(()=>{class n{get currentUrlTree(){return this.stateManager.getCurrentUrlTree()}get rawUrlTree(){return this.stateManager.getRawUrlTree()}disposed=!1;nonRouterCurrentEntryChangeSubscription;console=C(Zh);stateManager=C(xk);options=C(ac,{optional:!0})||{};pendingTasks=C(Kn);urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred";navigationTransitions=C(QE);urlSerializer=C(ic);location=C(hs);urlHandlingStrategy=C(zp);injector=C(it);_events=new Ge;get events(){return this._events}get routerState(){return this.stateManager.getRouterState()}navigated=!1;routeReuseStrategy=C(Tk);onSameUrlNavigation=this.options.onSameUrlNavigation||"ignore";config=C(yu,{optional:!0})?.flat()??[];componentInputBindingEnabled=!!C(Hp,{optional:!0});currentNavigation=this.navigationTransitions.currentNavigation.asReadonly();constructor(){this.resetConfig(this.config),this.navigationTransitions.setupNavigations(this).subscribe({error:t=>{this.console.warn(t)}}),this.subscribeToNavigationEvents()}eventsSubscription=new Xe;subscribeToNavigationEvents(){let t=this.navigationTransitions.events.subscribe(i=>{try{let r=this.navigationTransitions.currentTransition,o=st(this.navigationTransitions.currentNavigation);if(r!==null&&o!==null){if(this.stateManager.handleRouterEvent(i,o),i instanceof Ai&&i.code!==Zt.Redirect&&i.code!==Zt.SupersededByNewNavigation)this.navigated=!0;else if(i instanceof Vn)this.navigated=!0;else if(i instanceof ec){let s=i.navigationBehaviorOptions,a=this.urlHandlingStrategy.merge(i.url,r.currentRawUrl),c=A({browserUrl:r.extras.browserUrl,info:r.extras.info,skipLocationChange:r.extras.skipLocationChange,replaceUrl:r.extras.replaceUrl||this.urlUpdateStrategy==="eager"||mW(r.source)},s);this.scheduleNavigation(a,Ka,null,c,{resolve:r.resolve,reject:r.reject,promise:r.promise})}}yz(i)&&this._events.next(i)}catch(r){this.navigationTransitions.transitionAbortWithErrorSubject.next(r)}});this.eventsSubscription.add(t)}resetRootComponentType(t){this.routerState.root.component=t,this.navigationTransitions.rootComponentType=t}initialNavigation(){this.setUpLocationChangeListener(),this.navigationTransitions.hasRequestedNavigation||this.navigateToSyncWithBrowser(this.location.path(!0),Ka,this.stateManager.restoredState())}setUpLocationChangeListener(){this.nonRouterCurrentEntryChangeSubscription??=this.stateManager.registerNonRouterCurrentEntryChangeListener((t,i,r)=>{this.navigateToSyncWithBrowser(t,r,i)})}navigateToSyncWithBrowser(t,i,r){let o={replaceUrl:!0},s=r?.navigationId?r:null;if(r){let c=A({},r);delete c.navigationId,delete c.\u0275routerPageId,Object.keys(c).length!==0&&(o.state=c)}let a=this.parseUrl(t);this.scheduleNavigation(a,i,s,o).catch(c=>{this.disposed||this.injector.get(Vt)(c)})}get url(){return this.serializeUrl(this.currentUrlTree)}getCurrentNavigation(){return st(this.navigationTransitions.currentNavigation)}get lastSuccessfulNavigation(){return this.navigationTransitions.lastSuccessfulNavigation}resetConfig(t){this.config=t.map(YE),this.navigated=!1}ngOnDestroy(){this.dispose()}dispose(){this._events.unsubscribe(),this.navigationTransitions.complete(),this.nonRouterCurrentEntryChangeSubscription&&(this.nonRouterCurrentEntryChangeSubscription.unsubscribe(),this.nonRouterCurrentEntryChangeSubscription=void 0),this.disposed=!0,this.eventsSubscription.unsubscribe()}createUrlTree(t,i={}){let{relativeTo:r,queryParams:o,fragment:s,queryParamsHandling:a,preserveFragment:c}=i,l=c?this.currentUrlTree.fragment:s,u=null;switch(a??this.options.defaultQueryParamsHandling){case"merge":u=A(A({},this.currentUrlTree.queryParams),o);break;case"preserve":u=this.currentUrlTree.queryParams;break;default:u=o||null}u!==null&&(u=this.removeEmptyProps(u));let d;try{let f=r?r.snapshot:this.routerState.snapshot.root;d=rk(f)}catch{(typeof t[0]!="string"||t[0][0]!=="/")&&(t=[]),d=this.currentUrlTree.root}return ok(d,t,u,l??null)}navigateByUrl(t,i={skipLocationChange:!1}){let r=Gr(t)?t:this.parseUrl(t),o=this.urlHandlingStrategy.merge(r,this.rawUrlTree);return this.scheduleNavigation(o,Ka,null,i)}navigate(t,i={skipLocationChange:!1}){return bW(t),this.navigateByUrl(this.createUrlTree(t,i),i)}serializeUrl(t){return this.urlSerializer.serialize(t)}parseUrl(t){try{return this.urlSerializer.parse(t)}catch{return this.console.warn(Gn(4018,!1)),this.urlSerializer.parse("/")}}isActive(t,i){let r;if(i===!0?r=A({},yW):i===!1?r=A({},_W):r=i,Gr(t))return jR(this.currentUrlTree,t,r);let o=this.parseUrl(t);return jR(this.currentUrlTree,o,r)}removeEmptyProps(t){return Object.entries(t).reduce((i,[r,o])=>(o!=null&&(i[r]=o),i),{})}scheduleNavigation(t,i,r,o,s){if(this.disposed)return Promise.resolve(!1);let a,c,l;s?(a=s.resolve,c=s.reject,l=s.promise):l=new Promise((d,f)=>{a=d,c=f});let u=this.pendingTasks.add();return ZE(this,()=>{queueMicrotask(()=>this.pendingTasks.remove(u))}),this.navigationTransitions.handleNavigationRequest({source:i,restoredState:r,currentUrlTree:this.currentUrlTree,currentRawUrl:this.currentUrlTree,rawUrl:t,extras:o,resolve:a,reject:c,promise:l,currentSnapshot:this.routerState.snapshot,currentRouterState:this.routerState}),l.catch(d=>Promise.reject(d))}static \u0275fac=function(i){return new(i||n)};static \u0275prov=L({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function bW(n){for(let e=0;e{class n{router;route;tabIndexAttribute;renderer;el;locationStrategy;reactiveHref=on(null);get href(){return st(this.reactiveHref)}set href(t){this.reactiveHref.set(t)}target;queryParams;fragment;queryParamsHandling;state;info;relativeTo;isAnchorElement;subscription;onChanges=new Ge;applicationErrorHandler=C(Vt);options=C(ac,{optional:!0});constructor(t,i,r,o,s,a){this.router=t,this.route=i,this.tabIndexAttribute=r,this.renderer=o,this.el=s,this.locationStrategy=a,this.reactiveHref.set(C(new cp("href"),{optional:!0}));let c=s.nativeElement.tagName?.toLowerCase();this.isAnchorElement=c==="a"||c==="area"||!!(typeof customElements=="object"&&customElements.get(c)?.observedAttributes?.includes?.("href")),this.isAnchorElement?this.setTabIndexIfNotOnNativeEl("0"):this.subscribeToNavigationEventsIfNecessary()}subscribeToNavigationEventsIfNecessary(){if(this.subscription!==void 0||!this.isAnchorElement)return;let t=this.preserveFragment,i=r=>r==="merge"||r==="preserve";t||=i(this.queryParamsHandling),t||=!this.queryParamsHandling&&!i(this.options?.defaultQueryParamsHandling),t&&(this.subscription=this.router.events.subscribe(r=>{r instanceof Vn&&this.updateHref()}))}preserveFragment=!1;skipLocationChange=!1;replaceUrl=!1;setTabIndexIfNotOnNativeEl(t){this.tabIndexAttribute!=null||this.isAnchorElement||this.applyAttributeValue("tabindex",t)}ngOnChanges(t){this.isAnchorElement&&(this.updateHref(),this.subscribeToNavigationEventsIfNecessary()),this.onChanges.next(this)}routerLinkInput=null;set routerLink(t){t==null?(this.routerLinkInput=null,this.setTabIndexIfNotOnNativeEl(null)):(Gr(t)?this.routerLinkInput=t:this.routerLinkInput=Array.isArray(t)?t:[t],this.setTabIndexIfNotOnNativeEl("0"))}onClick(t,i,r,o,s){let a=this.urlTree;if(a===null||this.isAnchorElement&&(t!==0||i||r||o||s||typeof this.target=="string"&&this.target!="_self"))return!0;let c={skipLocationChange:this.skipLocationChange,replaceUrl:this.replaceUrl,state:this.state,info:this.info};return this.router.navigateByUrl(a,c)?.catch(l=>{this.applicationErrorHandler(l)}),!this.isAnchorElement}ngOnDestroy(){this.subscription?.unsubscribe()}updateHref(){let t=this.urlTree;this.reactiveHref.set(t!==null&&this.locationStrategy?this.locationStrategy?.prepareExternalUrl(this.router.serializeUrl(t))??"":null)}applyAttributeValue(t,i){let r=this.renderer,o=this.el.nativeElement;i!==null?r.setAttribute(o,t,i):r.removeAttribute(o,t)}get urlTree(){return this.routerLinkInput===null?null:Gr(this.routerLinkInput)?this.routerLinkInput:this.router.createUrlTree(this.routerLinkInput,{relativeTo:this.relativeTo!==void 0?this.relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,queryParamsHandling:this.queryParamsHandling,preserveFragment:this.preserveFragment})}static \u0275fac=function(i){return new(i||n)(N(_t),N(ni),Bl("tabindex"),N(Ti),N(an),N(fs))};static \u0275dir=ot({type:n,selectors:[["","routerLink",""]],hostVars:2,hostBindings:function(i,r){i&1&&ve("click",function(s){return r.onClick(s.button,s.ctrlKey,s.shiftKey,s.altKey,s.metaKey)}),i&2&&Qt("href",r.reactiveHref(),ub)("target",r.target)},inputs:{target:"target",queryParams:"queryParams",fragment:"fragment",queryParamsHandling:"queryParamsHandling",state:"state",info:"info",relativeTo:"relativeTo",preserveFragment:[2,"preserveFragment","preserveFragment",ds],skipLocationChange:[2,"skipLocationChange","skipLocationChange",ds],replaceUrl:[2,"replaceUrl","replaceUrl",ds],routerLink:"routerLink"},features:[Xn]})}return n})(),XE=(()=>{class n{router;element;renderer;cdr;link;links;classes=[];routerEventsSubscription;linkInputChangesSubscription;_isActive=!1;get isActive(){return this._isActive}routerLinkActiveOptions={exact:!1};ariaCurrentWhenActive;isActiveChange=new Ke;constructor(t,i,r,o,s){this.router=t,this.element=i,this.renderer=r,this.cdr=o,this.link=s,this.routerEventsSubscription=t.events.subscribe(a=>{a instanceof Vn&&this.update()})}ngAfterContentInit(){H(this.links.changes,H(null)).pipe(Ar()).subscribe(t=>{this.update(),this.subscribeToEachLinkOnChanges()})}subscribeToEachLinkOnChanges(){this.linkInputChangesSubscription?.unsubscribe();let t=[...this.links.toArray(),this.link].filter(i=>!!i).map(i=>i.onChanges);this.linkInputChangesSubscription=ke(t).pipe(Ar()).subscribe(i=>{this._isActive!==this.isLinkActive(this.router)(i)&&this.update()})}set routerLinkActive(t){let i=Array.isArray(t)?t:t.split(" ");this.classes=i.filter(r=>!!r)}ngOnChanges(t){this.update()}ngOnDestroy(){this.routerEventsSubscription.unsubscribe(),this.linkInputChangesSubscription?.unsubscribe()}update(){!this.links||!this.router.navigated||queueMicrotask(()=>{let t=this.hasActiveLinks();this.classes.forEach(i=>{t?this.renderer.addClass(this.element.nativeElement,i):this.renderer.removeClass(this.element.nativeElement,i)}),t&&this.ariaCurrentWhenActive!==void 0?this.renderer.setAttribute(this.element.nativeElement,"aria-current",this.ariaCurrentWhenActive.toString()):this.renderer.removeAttribute(this.element.nativeElement,"aria-current"),this._isActive!==t&&(this._isActive=t,this.cdr.markForCheck(),this.isActiveChange.emit(t))})}isLinkActive(t){let i=EW(this.routerLinkActiveOptions)?this.routerLinkActiveOptions:this.routerLinkActiveOptions.exact||!1;return r=>{let o=r.urlTree;return o?t.isActive(o,i):!1}}hasActiveLinks(){let t=this.isLinkActive(this.router);return this.link&&t(this.link)||this.links.some(t)}static \u0275fac=function(i){return new(i||n)(N(_t),N(an),N(Ti),N(lr),N(qe,8))};static \u0275dir=ot({type:n,selectors:[["","routerLinkActive",""]],contentQueries:function(i,r,o){if(i&1&&Ub(o,qe,5),i&2){let s;ln(s=un())&&(r.links=s)}},inputs:{routerLinkActiveOptions:"routerLinkActiveOptions",ariaCurrentWhenActive:"ariaCurrentWhenActive",routerLinkActive:"routerLinkActive"},outputs:{isActiveChange:"isActiveChange"},exportAs:["routerLinkActive"],features:[Xn]})}return n})();function EW(n){return!!n.paths}var Ak=new P(""),wW=(()=>{class n{urlSerializer;transitions;viewportScroller;zone;options;routerEventsSubscription;scrollEventsSubscription;lastId=0;lastSource=Ka;restoredId=0;store={};constructor(t,i,r,o,s={}){this.urlSerializer=t,this.transitions=i,this.viewportScroller=r,this.zone=o,this.options=s,s.scrollPositionRestoration||="disabled",s.anchorScrolling||="disabled"}init(){this.options.scrollPositionRestoration!=="disabled"&&this.viewportScroller.setHistoryScrollRestoration("manual"),this.routerEventsSubscription=this.createScrollEvents(),this.scrollEventsSubscription=this.consumeScrollEvents()}createScrollEvents(){return this.transitions.events.subscribe(t=>{t instanceof Yr?(this.store[this.lastId]=this.viewportScroller.getScrollPosition(),this.lastSource=t.navigationTrigger,this.restoredId=t.restoredState?t.restoredState.navigationId:0):t instanceof Vn?(this.lastId=t.id,this.scheduleScrollEvent(t,this.urlSerializer.parse(t.urlAfterRedirects).fragment)):t instanceof Ri&&t.code===Za.IgnoredSameUrlNavigation&&(this.lastSource=void 0,this.restoredId=0,this.scheduleScrollEvent(t,this.urlSerializer.parse(t.url).fragment))})}consumeScrollEvents(){return this.transitions.events.subscribe(t=>{if(!(t instanceof Ja))return;let i={behavior:"instant"};t.position?this.options.scrollPositionRestoration==="top"?this.viewportScroller.scrollToPosition([0,0],i):this.options.scrollPositionRestoration==="enabled"&&this.viewportScroller.scrollToPosition(t.position,i):t.anchor&&this.options.anchorScrolling==="enabled"?this.viewportScroller.scrollToAnchor(t.anchor):this.options.scrollPositionRestoration!=="disabled"&&this.viewportScroller.scrollToPosition([0,0])})}scheduleScrollEvent(t,i){this.zone.runOutsideAngular(async()=>{await new Promise(r=>{setTimeout(r),typeof requestAnimationFrame<"u"&&requestAnimationFrame(r)}),this.zone.run(()=>{this.transitions.events.next(new Ja(t,this.lastSource==="popstate"?this.store[this.restoredId]:null,i))})})}ngOnDestroy(){this.routerEventsSubscription?.unsubscribe(),this.scrollEventsSubscription?.unsubscribe()}static \u0275fac=function(i){kb()};static \u0275prov=L({token:n,factory:n.\u0275fac})}return n})();function JE(n,...e){return It([{provide:yu,multi:!0,useValue:n},[],{provide:ni,useFactory:CW,deps:[_t]},{provide:Hr,multi:!0,useFactory:SW},e.map(t=>t.\u0275providers)])}function CW(n){return n.routerState.root}function IW(n,e){return{\u0275kind:n,\u0275providers:e}}function e0(n={}){return IW(4,[{provide:Ak,useFactory:()=>{let t=C(IR),i=C(pe),r=C(QE),o=C(ic);return new wW(o,r,t,i,n)}}])}function SW(){let n=C(Ye);return e=>{let t=n.get(Kt);if(e!==t.components[0])return;let i=n.get(_t),r=n.get(DW);n.get(TW)===1&&i.initialNavigation(),n.get(xW,null,{optional:!0})?.setUpPreloading(),n.get(Ak,null,{optional:!0})?.init(),i.resetRootComponentType(t.componentTypes[0]),r.closed||(r.next(),r.complete(),r.unsubscribe())}}var DW=new P("",{factory:()=>new Ge}),TW=new P("",{providedIn:"root",factory:()=>1});var xW=new P("");var Mk=()=>{};var i0={NODE_CLIENT:!1,NODE_ADMIN:!1,SDK_VERSION:"${JSCORE_VERSION}"};var M=function(n,e){if(!n)throw ys(e)},ys=function(n){return new Error("Firebase Database ("+i0.SDK_VERSION+") INTERNAL ASSERT FAILED: "+n)};var Nk=function(n){let e=[],t=0;for(let i=0;i>6|192,e[t++]=r&63|128):(r&64512)===55296&&i+1>18|240,e[t++]=r>>12&63|128,e[t++]=r>>6&63|128,e[t++]=r&63|128):(e[t++]=r>>12|224,e[t++]=r>>6&63|128,e[t++]=r&63|128)}return e},AW=function(n){let e=[],t=0,i=0;for(;t191&&r<224){let o=n[t++];e[i++]=String.fromCharCode((r&31)<<6|o&63)}else if(r>239&&r<365){let o=n[t++],s=n[t++],a=n[t++],c=((r&7)<<18|(o&63)<<12|(s&63)<<6|a&63)-65536;e[i++]=String.fromCharCode(55296+(c>>10)),e[i++]=String.fromCharCode(56320+(c&1023))}else{let o=n[t++],s=n[t++];e[i++]=String.fromCharCode((r&15)<<12|(o&63)<<6|s&63)}}return e.join("")},uc={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_,i=[];for(let r=0;r>2,d=(o&3)<<4|a>>4,f=(a&15)<<2|l>>6,h=l&63;c||(h=64,s||(f=64)),i.push(t[u],t[d],t[f],t[h])}return i.join("")},encodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(n):this.encodeByteArray(Nk(n),e)},decodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(n):AW(this.decodeStringToByteArray(n,e))},decodeStringToByteArray(n,e){this.init_();let t=e?this.charToByteMapWebSafe_:this.charToByteMap_,i=[];for(let r=0;r>4;if(i.push(f),l!==64){let h=a<<4&240|l>>2;if(i.push(h),d!==64){let g=l<<6&192|d;i.push(g)}}}return i},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let n=0;n=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(n)]=n,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(n)]=n)}}},r0=class extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}},s0=function(n){let e=Nk(n);return uc.encodeByteArray(e,!0)},bu=function(n){return s0(n).replace(/\./g,"")},cc=function(n){try{return uc.decodeString(n,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};function Ok(n){return Pk(void 0,n)}function Pk(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)||!MW(t)||(n[t]=Pk(n[t],e[t]));return n}function MW(n){return n!=="__proto__"}function Lk(){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 RW=()=>Lk().__FIREBASE_DEFAULTS__,kW=()=>{if(typeof process>"u"||typeof process.env>"u")return;let n=process.env.__FIREBASE_DEFAULTS__;if(n)return JSON.parse(n)},NW=()=>{if(typeof document>"u")return;let n;try{n=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}let e=n&&cc(n[1]);return e&&JSON.parse(e)},a0=()=>{try{return Mk()||RW()||kW()||NW()}catch(n){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${n}`);return}},c0=n=>{var e,t;return(t=(e=a0())===null||e===void 0?void 0:e.emulatorHosts)===null||t===void 0?void 0:t[n]},Fk=n=>{let e=c0(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 i=parseInt(e.substring(t+1),10);return e[0]==="["?[e.substring(1,t-1),i]:[e.substring(0,t),i]},l0=()=>{var n;return(n=a0())===null||n===void 0?void 0:n.config},u0=n=>{var e;return(e=a0())===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,i)=>{t?this.reject(t):this.resolve(i),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(t):e(t,i))}}};function Kr(n){try{return(n.startsWith("http://")||n.startsWith("https://")?new URL(n).hostname:n).endsWith(".cloudworkstations.dev")}catch{return!1}}async function qp(n){return(await fetch(n,{credentials:"include"})).ok}function Vk(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"},i=e||"demo-project",r=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/${i}`,aud:i,iat:r,exp:r+3600,auth_time:r,sub:o,user_id:o,firebase:{sign_in_provider:"custom",identities:{}}},n);return[bu(JSON.stringify(t)),bu(JSON.stringify(s)),""].join(".")}var _u={};function OW(){let n={prod:[],emulator:[]};for(let e of Object.keys(_u))_u[e]?n.emulator.push(e):n.prod.push(e);return n}function PW(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 Rk=!1;function Gp(n,e){if(typeof window>"u"||typeof document>"u"||!Kr(window.location.host)||_u[n]===e||_u[n]||Rk)return;_u[n]=e;function t(f){return`__firebase__banner__${f}`}let i="__firebase__banner",o=OW().prod.length>0;function s(){let f=document.getElementById(i);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,h){f.setAttribute("width","24"),f.setAttribute("id",h),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=()=>{Rk=!0,s()},f}function u(f,h){f.setAttribute("id",h),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 d(){let f=PW(i),h=t("text"),g=document.getElementById(h)||document.createElement("span"),y=t("learnmore"),_=document.getElementById(y)||document.createElement("a"),b=t("preprendIcon"),w=document.getElementById(b)||document.createElementNS("http://www.w3.org/2000/svg","svg");if(f.created){let I=f.element;a(I),u(_,y);let D=l();c(w,b),I.append(w,g,_,D),document.body.appendChild(I)}o?(g.innerText="Preview backend disconnected.",w.innerHTML=` `):(w.innerHTML=` `,g.innerText="Preview backend running in this workspace."),g.setAttribute("id",h)}document.readyState==="loading"?window.addEventListener("DOMContentLoaded",d):d()}function Ut(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function Eu(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(Ut())}function jk(){return typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"}function Bk(){let n=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof n=="object"&&n.id!==void 0}function Yp(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function Uk(){let n=Ut();return n.indexOf("MSIE ")>=0||n.indexOf("Trident/")>=0}function ki(){return i0.NODE_CLIENT===!0||i0.NODE_ADMIN===!0}function Kp(){try{return typeof indexedDB=="object"}catch{return!1}}function Hk(){return new Promise((n,e)=>{try{let t=!0,i="validate-browser-context-for-indexeddb-analytics-module",r=self.indexedDB.open(i);r.onsuccess=()=>{r.result.close(),t||self.indexedDB.deleteDatabase(i),n(!0)},r.onupgradeneeded=()=>{t=!1},r.onerror=()=>{var o;e(((o=r.error)===null||o===void 0?void 0:o.message)||"")}}catch(t){e(t)}})}var LW="FirebaseError",ii=class n extends Error{constructor(e,t,i){super(t),this.code=e,this.customData=i,this.name=LW,Object.setPrototypeOf(this,n.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,ri.prototype.create)}},ri=class{constructor(e,t,i){this.service=e,this.serviceName=t,this.errors=i}create(e,...t){let i=t[0]||{},r=`${this.service}/${e}`,o=this.errors[e],s=o?FW(o,i):"Error",a=`${this.serviceName}: ${s} (${r}).`;return new ii(r,a,i)}};function FW(n,e){return n.replace(VW,(t,i)=>{let r=e[i];return r!=null?String(r):`<${i}?>`})}var VW=/\{\$([^}]+)}/g;function lc(n){return JSON.parse(n)}function lt(n){return JSON.stringify(n)}var $k=function(n){let e={},t={},i={},r="";try{let o=n.split(".");e=lc(cc(o[0])||""),t=lc(cc(o[1])||""),r=o[2],i=t.d||{},delete t.d}catch{}return{header:e,claims:t,data:i,signature:r}};var zk=function(n){let e=$k(n),t=e.claims;return!!t&&typeof t=="object"&&t.hasOwnProperty("iat")},Wk=function(n){let e=$k(n).claims;return typeof e=="object"&&e.admin===!0};function jn(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function Qr(n,e){if(Object.prototype.hasOwnProperty.call(n,e))return n[e]}function wu(n){for(let e in n)if(Object.prototype.hasOwnProperty.call(n,e))return!1;return!0}function Cu(n,e,t){let i={};for(let r in n)Object.prototype.hasOwnProperty.call(n,r)&&(i[r]=e.call(t,n[r],r,n));return i}function Ni(n,e){if(n===e)return!0;let t=Object.keys(n),i=Object.keys(e);for(let r of t){if(!i.includes(r))return!1;let o=n[r],s=e[r];if(kk(o)&&kk(s)){if(!Ni(o,s))return!1}else if(o!==s)return!1}for(let r of i)if(!t.includes(r))return!1;return!0}function kk(n){return n!==null&&typeof n=="object"}function _s(n){let e=[];for(let[t,i]of Object.entries(n))Array.isArray(i)?i.forEach(r=>{e.push(encodeURIComponent(t)+"="+encodeURIComponent(r))}):e.push(encodeURIComponent(t)+"="+encodeURIComponent(i));return e.length?"&"+e.join("&"):""}function dc(n){let e={};return n.replace(/^\?/,"").split("&").forEach(i=>{if(i){let[r,o]=i.split("=");e[decodeURIComponent(r)]=decodeURIComponent(o)}}),e}function fc(n){let e=n.indexOf("?");if(!e)return"";let t=n.indexOf("#",e);return n.substring(e,t>0?t:void 0)}var Wp=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>>31)&4294967295}let r=this.chain_[0],o=this.chain_[1],s=this.chain_[2],a=this.chain_[3],c=this.chain_[4],l,u;for(let d=0;d<80;d++){d<40?d<20?(l=a^o&(s^a),u=1518500249):(l=o^s^a,u=1859775393):d<60?(l=o&s|a&(o|s),u=2400959708):(l=o^s^a,u=3395469782);let f=(r<<5|r>>>27)+l+c+u+i[d]&4294967295;c=a,a=s,s=(o<<30|o>>>2)&4294967295,o=r,r=f}this.chain_[0]=this.chain_[0]+r&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 i=t-this.blockSize,r=0,o=this.buf_,s=this.inbuf_;for(;r=56;r--)this.buf_[r]=t&255,t/=256;this.compress_(this.buf_);let i=0;for(let r=0;r<5;r++)for(let o=24;o>=0;o-=8)e[i]=this.chain_[r]>>o&255,++i;return e}};function qk(n,e){let t=new o0(n,e);return t.subscribe.bind(t)}var o0=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(i=>{this.error(i)})}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,i){let r;if(e===void 0&&t===void 0&&i===void 0)throw new Error("Missing Observer.");jW(e,["next","error","complete"])?r=e:r={next:e,error:t,complete:i},r.next===void 0&&(r.next=n0),r.error===void 0&&(r.error=n0),r.complete===void 0&&(r.complete=n0);let o=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?r.error(this.finalError):r.complete()}catch{}}),this.observers.push(r),o}unsubscribeOne(e){this.observers===void 0||this.observers[e]===void 0||(delete this.observers[e],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t{if(this.observers!==void 0&&this.observers[e]!==void 0)try{t(this.observers[e])}catch(i){typeof console<"u"&&console.error&&console.error(i)}})}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 jW(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 n0(){}function Iu(n,e){return`${n} failed: ${e} argument `}var Gk=function(n){let e=[],t=0;for(let i=0;i=55296&&r<=56319){let o=r-55296;i++,M(i>6|192,e[t++]=r&63|128):r<65536?(e[t++]=r>>12|224,e[t++]=r>>6&63|128,e[t++]=r&63|128):(e[t++]=r>>18|240,e[t++]=r>>12&63|128,e[t++]=r>>6&63|128,e[t++]=r&63|128)}return e},Su=function(n){let e=0;for(let t=0;t=55296&&i<=56319?(e+=4,t++):e+=3}return e};var _ye=14400*1e3;function ut(n){return n&&n._delegate?n._delegate:n}var Xt=class{constructor(e,t,i){this.name=e,this.instanceFactory=t,this.type=i,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 bs="[DEFAULT]";var Qp=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 i=new Sn;if(this.instancesDeferred.set(t,i),this.isInitialized(t)||this.shouldAutoInitialize())try{let r=this.getOrInitializeService({instanceIdentifier:t});r&&i.resolve(r)}catch{}}return this.instancesDeferred.get(t).promise}getImmediate(e){var t;let i=this.normalizeInstanceIdentifier(e?.identifier),r=(t=e?.optional)!==null&&t!==void 0?t:!1;if(this.isInitialized(i)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:i})}catch(o){if(r)return null;throw o}else{if(r)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,!!this.shouldAutoInitialize()){if(UW(e))try{this.getOrInitializeService({instanceIdentifier:bs})}catch{}for(let[t,i]of this.instancesDeferred.entries()){let r=this.normalizeInstanceIdentifier(t);try{let o=this.getOrInitializeService({instanceIdentifier:r});i.resolve(o)}catch{}}}}clearInstance(e=bs){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){let e=Array.from(this.instances.values());await Promise.all([...e.filter(t=>"INTERNAL"in t).map(t=>t.INTERNAL.delete()),...e.filter(t=>"_delete"in t).map(t=>t._delete())])}isComponentSet(){return this.component!=null}isInitialized(e=bs){return this.instances.has(e)}getOptions(e=bs){return this.instancesOptions.get(e)||{}}initialize(e={}){let{options:t={}}=e,i=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(i))throw Error(`${this.name}(${i}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);let r=this.getOrInitializeService({instanceIdentifier:i,options:t});for(let[o,s]of this.instancesDeferred.entries()){let a=this.normalizeInstanceIdentifier(o);i===a&&s.resolve(r)}return r}onInit(e,t){var i;let r=this.normalizeInstanceIdentifier(t),o=(i=this.onInitCallbacks.get(r))!==null&&i!==void 0?i:new Set;o.add(e),this.onInitCallbacks.set(r,o);let s=this.instances.get(r);return s&&e(s,r),()=>{o.delete(e)}}invokeOnInitCallbacks(e,t){let i=this.onInitCallbacks.get(t);if(i)for(let r of i)try{r(e,t)}catch{}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let i=this.instances.get(e);if(!i&&this.component&&(i=this.component.instanceFactory(this.container,{instanceIdentifier:BW(e),options:t}),this.instances.set(e,i),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(i,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,i)}catch{}return i||null}normalizeInstanceIdentifier(e=bs){return this.component?this.component.multipleInstances?e:bs:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}};function BW(n){return n===bs?void 0:n}function UW(n){return n.instantiationMode==="EAGER"}var Du=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 Qp(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}};var HW=[],Ae=(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})(Ae||{}),$W={debug:Ae.DEBUG,verbose:Ae.VERBOSE,info:Ae.INFO,warn:Ae.WARN,error:Ae.ERROR,silent:Ae.SILENT},zW=Ae.INFO,WW={[Ae.DEBUG]:"log",[Ae.VERBOSE]:"log",[Ae.INFO]:"info",[Ae.WARN]:"warn",[Ae.ERROR]:"error"},qW=(n,e,...t)=>{if(ee.some(t=>n instanceof t),Yk,Kk;function YW(){return Yk||(Yk=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function KW(){return Kk||(Kk=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}var Qk=new WeakMap,f0=new WeakMap,Zk=new WeakMap,d0=new WeakMap,p0=new WeakMap;function QW(n){let e=new Promise((t,i)=>{let r=()=>{n.removeEventListener("success",o),n.removeEventListener("error",s)},o=()=>{t(Pi(n.result)),r()},s=()=>{i(n.error),r()};n.addEventListener("success",o),n.addEventListener("error",s)});return e.then(t=>{t instanceof IDBCursor&&Qk.set(t,n)}).catch(()=>{}),p0.set(e,n),e}function ZW(n){if(f0.has(n))return;let e=new Promise((t,i)=>{let r=()=>{n.removeEventListener("complete",o),n.removeEventListener("error",s),n.removeEventListener("abort",s)},o=()=>{t(),r()},s=()=>{i(n.error||new DOMException("AbortError","AbortError")),r()};n.addEventListener("complete",o),n.addEventListener("error",s),n.addEventListener("abort",s)});f0.set(n,e)}var h0={get(n,e,t){if(n instanceof IDBTransaction){if(e==="done")return f0.get(n);if(e==="objectStoreNames")return n.objectStoreNames||Zk.get(n);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return Pi(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 Xk(n){h0=n(h0)}function XW(n){return n===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...t){let i=n.call(Zp(this),e,...t);return Zk.set(i,e.sort?e.sort():[e]),Pi(i)}:KW().includes(n)?function(...e){return n.apply(Zp(this),e),Pi(Qk.get(this))}:function(...e){return Pi(n.apply(Zp(this),e))}}function JW(n){return typeof n=="function"?XW(n):(n instanceof IDBTransaction&&ZW(n),GW(n,YW())?new Proxy(n,h0):n)}function Pi(n){if(n instanceof IDBRequest)return QW(n);if(d0.has(n))return d0.get(n);let e=JW(n);return e!==n&&(d0.set(n,e),p0.set(e,n)),e}var Zp=n=>p0.get(n);function e1(n,e,{blocked:t,upgrade:i,blocking:r,terminated:o}={}){let s=indexedDB.open(n,e),a=Pi(s);return i&&s.addEventListener("upgradeneeded",c=>{i(Pi(s.result),c.oldVersion,c.newVersion,Pi(s.transaction),c)}),t&&s.addEventListener("blocked",c=>t(c.oldVersion,c.newVersion,c)),a.then(c=>{o&&c.addEventListener("close",()=>o()),r&&c.addEventListener("versionchange",l=>r(l.oldVersion,l.newVersion,l))}).catch(()=>{}),a}var e5=["get","getKey","getAll","getAllKeys","count"],t5=["put","add","delete","clear"],m0=new Map;function Jk(n,e){if(!(n instanceof IDBDatabase&&!(e in n)&&typeof e=="string"))return;if(m0.get(e))return m0.get(e);let t=e.replace(/FromIndex$/,""),i=e!==t,r=t5.includes(t);if(!(t in(i?IDBIndex:IDBObjectStore).prototype)||!(r||e5.includes(t)))return;let o=async function(s,...a){let c=this.transaction(s,r?"readwrite":"readonly"),l=c.store;return i&&(l=l.index(a.shift())),(await Promise.all([l[t](...a),r&&c.done]))[0]};return m0.set(e,o),o}Xk(n=>G(A({},n),{get:(e,t,i)=>Jk(e,t)||n.get(e,t,i),has:(e,t)=>!!Jk(e,t)||n.has(e,t)}));var v0=class{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(t=>{if(n5(t)){let i=t.getImmediate();return`${i.library}/${i.version}`}else return null}).filter(t=>t).join(" ")}};function n5(n){let e=n.getComponent();return e?.type==="VERSION"}var y0="@firebase/app",t1="0.13.2";var fr=new Oi("@firebase/app"),i5="@firebase/app-compat",r5="@firebase/analytics-compat",o5="@firebase/analytics",s5="@firebase/app-check-compat",a5="@firebase/app-check",c5="@firebase/auth",l5="@firebase/auth-compat",u5="@firebase/database",d5="@firebase/data-connect",f5="@firebase/database-compat",h5="@firebase/functions",p5="@firebase/functions-compat",m5="@firebase/installations",g5="@firebase/installations-compat",v5="@firebase/messaging",y5="@firebase/messaging-compat",_5="@firebase/performance",b5="@firebase/performance-compat",E5="@firebase/remote-config",w5="@firebase/remote-config-compat",C5="@firebase/storage",I5="@firebase/storage-compat",S5="@firebase/firestore",D5="@firebase/ai",T5="@firebase/firestore-compat",x5="firebase",A5="11.10.0";var _0="[DEFAULT]",M5={[y0]:"fire-core",[i5]:"fire-core-compat",[o5]:"fire-analytics",[r5]:"fire-analytics-compat",[a5]:"fire-app-check",[s5]:"fire-app-check-compat",[c5]:"fire-auth",[l5]:"fire-auth-compat",[u5]:"fire-rtdb",[d5]:"fire-data-connect",[f5]:"fire-rtdb-compat",[h5]:"fire-fn",[p5]:"fire-fn-compat",[m5]:"fire-iid",[g5]:"fire-iid-compat",[v5]:"fire-fcm",[y5]:"fire-fcm-compat",[_5]:"fire-perf",[b5]:"fire-perf-compat",[E5]:"fire-rc",[w5]:"fire-rc-compat",[C5]:"fire-gcs",[I5]:"fire-gcs-compat",[S5]:"fire-fst",[T5]:"fire-fst-compat",[D5]:"fire-vertex","fire-js":"fire-js",[x5]:"fire-js-all"};var Tu=new Map,R5=new Map,b0=new Map;function n1(n,e){try{n.container.addComponent(e)}catch(t){fr.debug(`Component ${e.name} failed to register with FirebaseApp ${n.name}`,t)}}function oi(n){let e=n.name;if(b0.has(e))return fr.debug(`There were multiple attempts to register component ${e}.`),!1;b0.set(e,n);for(let t of Tu.values())n1(t,n);for(let t of R5.values())n1(t,n);return!0}function hc(n,e){let t=n.container.getProvider("heartbeat").getImmediate({optional:!0});return t&&t.triggerHeartbeat(),n.container.getProvider(e)}function Dn(n){return n==null?!1:n.settings!==void 0}var k5={"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."},Zr=new ri("app","Firebase",k5);var E0=class{constructor(e,t,i){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=i,this.container.addComponent(new Xt("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 Zr.create("app-deleted",{appName:this._name})}};var Xr=A5;function I0(n,e={}){let t=n;typeof e!="object"&&(e={name:e});let i=Object.assign({name:_0,automaticDataCollectionEnabled:!0},e),r=i.name;if(typeof r!="string"||!r)throw Zr.create("bad-app-name",{appName:String(r)});if(t||(t=l0()),!t)throw Zr.create("no-options");let o=Tu.get(r);if(o){if(Ni(t,o.options)&&Ni(i,o.config))return o;throw Zr.create("duplicate-app",{appName:r})}let s=new Du(r);for(let c of b0.values())s.addComponent(c);let a=new E0(t,i,s);return Tu.set(r,a),a}function Es(n=_0){let e=Tu.get(n);if(!e&&n===_0&&l0())return I0();if(!e)throw Zr.create("no-app",{appName:n});return e}function Xp(){return Array.from(Tu.values())}function Je(n,e,t){var i;let r=(i=M5[n])!==null&&i!==void 0?i:n;t&&(r+=`-${t}`);let o=r.match(/\s|\//),s=e.match(/\s|\//);if(o||s){let a=[`Unable to register library "${r}" with version "${e}":`];o&&a.push(`library name "${r}" contains illegal characters (whitespace or "/")`),o&&s&&a.push("and"),s&&a.push(`version name "${e}" contains illegal characters (whitespace or "/")`),fr.warn(a.join(" "));return}oi(new Xt(`${r}-version`,()=>({library:r,version:e}),"VERSION"))}var N5="firebase-heartbeat-database",O5=1,xu="firebase-heartbeat-store",g0=null;function s1(){return g0||(g0=e1(N5,O5,{upgrade:(n,e)=>{switch(e){case 0:try{n.createObjectStore(xu)}catch(t){console.warn(t)}}}}).catch(n=>{throw Zr.create("idb-open",{originalErrorMessage:n.message})})),g0}async function P5(n){try{let t=(await s1()).transaction(xu),i=await t.objectStore(xu).get(a1(n));return await t.done,i}catch(e){if(e instanceof ii)fr.warn(e.message);else{let t=Zr.create("idb-get",{originalErrorMessage:e?.message});fr.warn(t.message)}}}async function i1(n,e){try{let i=(await s1()).transaction(xu,"readwrite");await i.objectStore(xu).put(e,a1(n)),await i.done}catch(t){if(t instanceof ii)fr.warn(t.message);else{let i=Zr.create("idb-set",{originalErrorMessage:t?.message});fr.warn(i.message)}}}function a1(n){return`${n.name}!${n.options.appId}`}var L5=1024,F5=30,w0=class{constructor(e){this.container=e,this._heartbeatsCache=null;let t=this.container.getProvider("app").getImmediate();this._storage=new C0(t),this._heartbeatsCachePromise=this._storage.read().then(i=>(this._heartbeatsCache=i,i))}async triggerHeartbeat(){var e,t;try{let r=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),o=r1();if(((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null&&(this._heartbeatsCache=await 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:r}),this._heartbeatsCache.heartbeats.length>F5){let s=j5(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(s,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(i){fr.warn(i)}}async getHeartbeatsHeader(){var e;try{if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";let t=r1(),{heartbeatsToSend:i,unsentEntries:r}=V5(this._heartbeatsCache.heartbeats),o=bu(JSON.stringify({version:2,heartbeats:i}));return this._heartbeatsCache.lastSentHeartbeatDate=t,r.length>0?(this._heartbeatsCache.heartbeats=r,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),o}catch(t){return fr.warn(t),""}}};function r1(){return new Date().toISOString().substring(0,10)}function V5(n,e=L5){let t=[],i=n.slice();for(let r of n){let o=t.find(s=>s.agent===r.agent);if(o){if(o.dates.push(r.date),o1(t)>e){o.dates.pop();break}}else if(t.push({agent:r.agent,dates:[r.date]}),o1(t)>e){t.pop();break}i=i.slice(1)}return{heartbeatsToSend:t,unsentEntries:i}}var C0=class{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return Kp()?Hk().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){let t=await P5(this.app);return t?.heartbeats?t:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(e){var t;if(await this._canUseIndexedDBPromise){let r=await this.read();return i1(this.app,{lastSentHeartbeatDate:(t=e.lastSentHeartbeatDate)!==null&&t!==void 0?t:r.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){var t;if(await this._canUseIndexedDBPromise){let r=await this.read();return i1(this.app,{lastSentHeartbeatDate:(t=e.lastSentHeartbeatDate)!==null&&t!==void 0?t:r.lastSentHeartbeatDate,heartbeats:[...r.heartbeats,...e.heartbeats]})}else return}};function o1(n){return bu(JSON.stringify({version:2,heartbeats:n})).length}function j5(n){if(n.length===0)return-1;let e=0,t=n[0].date;for(let i=1;inew v0(e),"PRIVATE")),oi(new Xt("heartbeat",e=>new w0(e),"PRIVATE")),Je(y0,t1,n),Je(y0,t1,"esm2017"),Je("fire-js","")}B5("");var U5="firebase",H5="11.10.0";Je(U5,H5,"app");function c1(n){n===void 0&&(n=C(Ye));let e=n.get(jr);return t=>new Y(i=>{let r=e.add(),o=!1;function s(){o||(r(),o=!0)}let a=t.subscribe({next:c=>{i.next(c),s()},complete:()=>{i.complete(),s()},error:c=>{i.error(c),s()}});return a.add(()=>{i.unsubscribe(),s()}),a})}var Jr=new Xi("ANGULARFIRE2_VERSION");function Au(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 mc=(n,e)=>{let t=e?[e]:Xp(),i=[];return t.forEach(r=>{r.container.getProvider(n).instances.forEach(s=>{i.includes(s)||i.push(s)})}),i},pc=(function(n){return n[n.SILENT=0]="SILENT",n[n.WARN=1]="WARN",n[n.VERBOSE=2]="VERBOSE",n})(pc||{}),l1=oE()&&typeof Zone<"u"?pc.WARN:pc.SILENT;var Jp=class{zone;delegate;constructor(e,t=Gv){this.zone=e,this.delegate=t}now(){return this.delegate.now()}schedule(e,t,i){let r=this.zone,o=function(s){r?r.runGuarded(()=>{e.apply(this,[s])}):e.apply(this,[s])};return this.delegate.schedule(o,t,i)}},eo=(()=>{class n{outsideAngular;insideAngular;constructor(){let t=C(pe);this.outsideAngular=t.runOutsideAngular(()=>new Jp(typeof Zone>"u"?void 0:Zone.current)),this.insideAngular=t.run(()=>new Jp(typeof Zone>"u"?void 0:Zone.current,pi))}static \u0275fac=function(i){return new(i||n)};static \u0275prov=L({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),u1=!1;function $5(n,e){!u1&&(l1>pc.SILENT||oE())&&(u1=!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")),l1>=e&&console.warn(`Firebase API called outside injection context: ${n.name}`)}function z5(n){let e=C(pe,{optional:!0});return e?e.runOutsideAngular(()=>n()):n()}function ws(n){let e=C(pe,{optional:!0});return e?e.run(()=>n()):n()}var W5=(n,e,t)=>(...i)=>(e&&setTimeout(e,0),at(t,()=>ws(()=>n.apply(void 0,i)))),St=(n,e,t)=>(t||=e?pc.WARN:pc.VERBOSE,function(){let i,r=arguments,o,s,a;try{o=C(eo),s=C(jr),a=C(it)}catch{return $5(n,t),n.apply(this,r)}for(let l=0;ls.add())),r[l]=W5(r[l],i,a));let c=z5(()=>n.apply(this,r));return e?c instanceof Y?c.pipe(xr(o.outsideAngular),Tr(o.insideAngular),c1(a)):c instanceof Promise?ws(()=>{let l=s.add();return new Promise((u,d)=>{c.then(f=>at(a,()=>ws(()=>u(f))),f=>at(a,()=>ws(()=>d(f)))).finally(l)})}):typeof c=="function"&&i?function(){return setTimeout(i,0),c.apply(this,arguments)}:ws(()=>c):c instanceof Y?c.pipe(xr(o.outsideAngular),Tr(o.insideAngular)):ws(()=>c)});var hr=class{constructor(e){return e}},Cs=class{constructor(){return Xp()}};function q5(n){return n&&n.length===1?n[0]:new hr(Es())}var S0=new P("angularfire2._apps"),G5={provide:hr,useFactory:q5,deps:[[new sn,S0]]},Y5={provide:Cs,deps:[[new sn,S0]]};function K5(n){return(e,t)=>{let i=t.get(ns);Je("angularfire",Jr.full,"core"),Je("angularfire",Jr.full,"app"),Je("angular",vy.full,i.toString());let r=e.runOutsideAngular(()=>n(t));return new hr(r)}}function d1(n,...e){return It([G5,Y5,{provide:S0,useFactory:K5(n),multi:!0,deps:[pe,Ye,eo,...e]}])}var f1=St(I0,!0);var Q5=new Map,Z5={activated:!1,tokenObservers:[]},X5={initialized:!1,enabled:!1};function si(n){return Q5.get(n)||Object.assign({},Z5)}function g1(){return X5}var J5="https://content-firebaseappcheck.googleapis.com/v1";var e8="exchangeDebugToken",h1={OFFSET_DURATION:300*1e3,RETRIAL_MIN_WAIT:30*1e3,RETRIAL_MAX_WAIT:960*1e3},__e=1440*60*1e3;var x0=class{constructor(e,t,i,r,o){if(this.operation=e,this.retryPolicy=t,this.getWaitDuration=i,this.lowerBound=r,this.upperBound=o,this.pending=null,this.nextErrorWaitInterval=r,r>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}async process(e){this.stop();try{this.pending=new Sn,this.pending.promise.catch(t=>{}),await t8(this.getNextRun(e)),this.pending.resolve(),await this.pending.promise,this.pending=new Sn,this.pending.promise.catch(t=>{}),await this.operation(),this.pending.resolve(),await 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 t8(n){return new Promise(e=>{setTimeout(e,n)})}var n8={"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}"},to=new ri("appCheck","AppCheck",n8);function v1(n){if(!si(n).activated)throw to.create("use-before-activation",{appName:n.name})}async function y1({url:n,body:e},t){let i={"Content-Type":"application/json"},r=t.getImmediate({optional:!0});if(r){let d=await r.getHeartbeatsHeader();d&&(i["X-Firebase-Client"]=d)}let o={method:"POST",body:JSON.stringify(e),headers:i},s;try{s=await fetch(n,o)}catch(d){throw to.create("fetch-network-error",{originalErrorMessage:d?.message})}if(s.status!==200)throw to.create("fetch-status-error",{httpStatus:s.status});let a;try{a=await s.json()}catch(d){throw to.create("fetch-parse-error",{originalErrorMessage:d?.message})}let c=a.ttl.match(/^([\d.]+)(s)$/);if(!c||!c[2]||isNaN(Number(c[1])))throw to.create("fetch-parse-error",{originalErrorMessage:`ttl field (timeToLive) is not in standard Protobuf Duration format: ${a.ttl}`});let l=Number(c[1])*1e3,u=Date.now();return{token:a.token,expireTimeMillis:u+l,issuedAtTimeMillis:u}}function _1(n,e){let{projectId:t,appId:i,apiKey:r}=n.options;return{url:`${J5}/projects/${t}/apps/${i}:${e8}?key=${r}`,body:{debug_token:e}}}var i8="firebase-app-check-database",r8=1,A0="firebase-app-check-store";var em=null;function o8(){return em||(em=new Promise((n,e)=>{try{let t=indexedDB.open(i8,r8);t.onsuccess=i=>{n(i.target.result)},t.onerror=i=>{var r;e(to.create("storage-open",{originalErrorMessage:(r=i.target.error)===null||r===void 0?void 0:r.message}))},t.onupgradeneeded=i=>{let r=i.target.result;switch(i.oldVersion){case 0:r.createObjectStore(A0,{keyPath:"compositeKey"})}}}catch(t){e(to.create("storage-open",{originalErrorMessage:t?.message}))}}),em)}function s8(n,e){return a8(c8(n),e)}async function a8(n,e){let i=(await o8()).transaction(A0,"readwrite"),o=i.objectStore(A0).put({compositeKey:n,value:e});return new Promise((s,a)=>{o.onsuccess=c=>{s()},i.onerror=c=>{var l;a(to.create("storage-set",{originalErrorMessage:(l=c.target.error)===null||l===void 0?void 0:l.message}))}})}function c8(n){return`${n.options.appId}-${n.name}`}var Mu=new Oi("@firebase/app-check");function D0(n,e){return Kp()?s8(n,e).catch(t=>{Mu.warn(`Failed to write token to IndexedDB. Error: ${t}`)}):Promise.resolve()}function b1(){return g1().enabled}async function E1(){let n=g1();if(n.enabled&&n.token)return n.token.promise;throw Error(` Can't get debug token in production mode. `)}var l8={error:"UNKNOWN_ERROR"};function u8(n){return uc.encodeString(JSON.stringify(n),!1)}async function M0(n,e=!1,t=!1){let i=n.app;v1(i);let r=si(i),o=r.token,s;if(o&&!Ru(o)&&(r.token=void 0,o=void 0),!o){let l=await r.cachedTokenPromise;l&&(Ru(l)?o=l:await D0(i,void 0))}if(!e&&o&&Ru(o))return{token:o.token};let a=!1;if(b1())try{r.exchangeTokenPromise||(r.exchangeTokenPromise=y1(_1(i,await E1()),n.heartbeatServiceProvider).finally(()=>{r.exchangeTokenPromise=void 0}),a=!0);let l=await r.exchangeTokenPromise;return await D0(i,l),r.token=l,{token:l.token}}catch(l){return l.code==="appCheck/throttled"||l.code==="appCheck/initial-throttle"?Mu.warn(l.message):t&&Mu.error(l),T0(l)}try{r.exchangeTokenPromise||(r.exchangeTokenPromise=r.provider.getToken().finally(()=>{r.exchangeTokenPromise=void 0}),a=!0),o=await si(i).exchangeTokenPromise}catch(l){l.code==="appCheck/throttled"||l.code==="appCheck/initial-throttle"?Mu.warn(l.message):t&&Mu.error(l),s=l}let c;return o?s?Ru(o)?c={token:o.token,internalError:s}:c=T0(s):(c={token:o.token},r.token=o,await D0(i,o)):c=T0(s),a&&p8(i,c),c}async function d8(n){let e=n.app;v1(e);let{provider:t}=si(e);if(b1()){let i=await E1(),{token:r}=await y1(_1(e,i),n.heartbeatServiceProvider);return{token:r}}else{let{token:i}=await t.getToken();return{token:i}}}function f8(n,e,t,i){let{app:r}=n,o=si(r),s={next:t,error:i,type:e};if(o.tokenObservers=[...o.tokenObservers,s],o.token&&Ru(o.token)){let a=o.token;Promise.resolve().then(()=>{t({token:a.token}),p1(n)}).catch(()=>{})}o.cachedTokenPromise.then(()=>p1(n))}function w1(n,e){let t=si(n),i=t.tokenObservers.filter(r=>r.next!==e);i.length===0&&t.tokenRefresher&&t.tokenRefresher.isRunning()&&t.tokenRefresher.stop(),t.tokenObservers=i}function p1(n){let{app:e}=n,t=si(e),i=t.tokenRefresher;i||(i=h8(n),t.tokenRefresher=i),!i.isRunning()&&t.isTokenAutoRefreshEnabled&&i.start()}function h8(n){let{app:e}=n;return new x0(async()=>{let t=si(e),i;if(t.token?i=await M0(n,!0):i=await M0(n),i.error)throw i.error;if(i.internalError)throw i.internalError},()=>!0,()=>{let t=si(e);if(t.token){let i=t.token.issuedAtTimeMillis+(t.token.expireTimeMillis-t.token.issuedAtTimeMillis)*.5+3e5,r=t.token.expireTimeMillis-300*1e3;return i=Math.min(i,r),Math.max(0,i-Date.now())}else return 0},h1.RETRIAL_MIN_WAIT,h1.RETRIAL_MAX_WAIT)}function p8(n,e){let t=si(n).tokenObservers;for(let i of t)try{i.type==="EXTERNAL"&&e.error!=null?i.error(e.error):i.next(e)}catch{}}function Ru(n){return n.expireTimeMillis-Date.now()>0}function T0(n){return{token:u8(l8),error:n}}var R0=class{constructor(e,t){this.app=e,this.heartbeatServiceProvider=t}_delete(){let{tokenObservers:e}=si(this.app);for(let t of e)w1(this.app,t.next);return Promise.resolve()}};function m8(n,e){return new R0(n,e)}function g8(n){return{getToken:e=>M0(n,e),getLimitedUseToken:()=>d8(n),addTokenListener:e=>f8(n,"INTERNAL",e),removeTokenListener:e=>w1(n.app,e)}}var v8="@firebase/app-check",y8="0.10.1";var _8="app-check",m1="app-check-internal";function b8(){oi(new Xt(_8,n=>{let e=n.getProvider("app").getImmediate(),t=n.getProvider("heartbeat");return m8(e,t)},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((n,e,t)=>{n.getProvider(m1).initialize()})),oi(new Xt(m1,n=>{let e=n.getProvider("app-check").getImmediate();return g8(e)},"PUBLIC").setInstantiationMode("EXPLICIT")),Je(v8,y8)}b8();var E8="app-check";var gc=class{constructor(){return mc(E8)}};var w8=["localhost","0.0.0.0","127.0.0.1"],R_e=typeof window<"u"&&w8.includes(window.location.hostname);function j1(){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 B1=j1,U1=new ri("auth","Firebase",j1());var sm=new Oi("@firebase/auth");function C8(n,...e){sm.logLevel<=Ae.WARN&&sm.warn(`Auth (${Xr}): ${n}`,...e)}function nm(n,...e){sm.logLevel<=Ae.ERROR&&sm.error(`Auth (${Xr}): ${n}`,...e)}function Fi(n,...e){throw tw(n,...e)}function Is(n,...e){return tw(n,...e)}function H1(n,e,t){let i=Object.assign(Object.assign({},B1()),{[e]:t});return new ri("auth","Firebase",i).create(e,{appName:n.name})}function ro(n){return H1(n,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function tw(n,...e){if(typeof n!="string"){let t=e[0],i=[...e.slice(1)];return i[0]&&(i[0].appName=n.name),n._errorFactory.create(t,...i)}return U1.create(n,...e)}function K(n,e,...t){if(!n)throw tw(e,...t)}function pr(n){let e="INTERNAL ASSERTION FAILED: "+n;throw nm(e),new Error(e)}function oo(n,e){n||pr(e)}function P0(){var n;return typeof self<"u"&&((n=self.location)===null||n===void 0?void 0:n.href)||""}function I8(){return C1()==="http:"||C1()==="https:"}function C1(){var n;return typeof self<"u"&&((n=self.location)===null||n===void 0?void 0:n.protocol)||null}function S8(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(I8()||Bk()||"connection"in navigator)?navigator.onLine:!0}function D8(){if(typeof navigator>"u")return null;let n=navigator;return n.languages&&n.languages[0]||n.language||null}var Ss=class{constructor(e,t){this.shortDelay=e,this.longDelay=t,oo(t>e,"Short delay should be less than long delay!"),this.isMobile=Eu()||Yp()}get(){return S8()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}};function nw(n,e){oo(n.emulator,"Emulator should always be set here");let{url:t}=n.emulator;return e?`${t}${e.startsWith("/")?e.slice(1):e}`:t}var am=class{static initialize(e,t,i){this.fetchImpl=e,t&&(this.headersImpl=t),i&&(this.responseImpl=i)}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;pr("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;pr("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;pr("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}};var T8={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 x8=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],A8=new Ss(3e4,6e4);function Ts(n,e){return n.tenantId&&!e.tenantId?Object.assign(Object.assign({},e),{tenantId:n.tenantId}):e}async function so(n,e,t,i,r={}){return $1(n,r,async()=>{let o={},s={};i&&(e==="GET"?s=i:o={body:JSON.stringify(i)});let a=_s(Object.assign({key:n.config.apiKey},s)).slice(1),c=await n._getAdditionalHeaders();c["Content-Type"]="application/json",n.languageCode&&(c["X-Firebase-Locale"]=n.languageCode);let l=Object.assign({method:e,headers:c},o);return jk()||(l.referrerPolicy="no-referrer"),n.emulatorConfig&&Kr(n.emulatorConfig.host)&&(l.credentials="include"),am.fetch()(await z1(n,n.config.apiHost,t,a),l)})}async function $1(n,e,t){n._canInitEmulator=!1;let i=Object.assign(Object.assign({},T8),e);try{let r=new L0(n),o=await Promise.race([t(),r.promise]);r.clearNetworkTimeout();let s=await o.json();if("needConfirmation"in s)throw tm(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 tm(n,"credential-already-in-use",s);if(c==="EMAIL_EXISTS")throw tm(n,"email-already-in-use",s);if(c==="USER_DISABLED")throw tm(n,"user-disabled",s);let u=i[c]||c.toLowerCase().replace(/[_\s]+/g,"-");if(l)throw H1(n,u,l);Fi(n,u)}}catch(r){if(r instanceof ii)throw r;Fi(n,"network-request-failed",{message:String(r)})}}async function ym(n,e,t,i,r={}){let o=await so(n,e,t,i,r);return"mfaPendingCredential"in o&&Fi(n,"multi-factor-auth-required",{_serverResponse:o}),o}async function z1(n,e,t,i){let r=`${e}${t}?${i}`,o=n,s=o.config.emulator?nw(n.config,r):`${n.config.apiScheme}://${r}`;return x8.includes(t)&&(await o._persistenceManagerAvailable,o._getPersistenceType()==="COOKIE")?o._getPersistence()._getFinalTarget(s).toString():s}function M8(n){switch(n){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}var L0=class{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((t,i)=>{this.timer=setTimeout(()=>i(Is(this.auth,"network-request-failed")),A8.get())})}};function tm(n,e,t){let i={appName:n.name};t.email&&(i.email=t.email),t.phoneNumber&&(i.phoneNumber=t.phoneNumber);let r=Is(n,e,i);return r.customData._tokenResponse=t,r}function I1(n){return n!==void 0&&n.enterprise!==void 0}var F0=class{constructor(e){if(this.siteKey="",this.recaptchaEnforcementState=[],e.recaptchaKey===void 0)throw new Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.recaptchaEnforcementState=e.recaptchaEnforcementState}getProviderEnforcementState(e){if(!this.recaptchaEnforcementState||this.recaptchaEnforcementState.length===0)return null;for(let t of this.recaptchaEnforcementState)if(t.provider&&t.provider===e)return M8(t.enforcementState);return null}isProviderEnabled(e){return this.getProviderEnforcementState(e)==="ENFORCE"||this.getProviderEnforcementState(e)==="AUDIT"}isAnyProviderEnabled(){return this.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")||this.isProviderEnabled("PHONE_PROVIDER")}};async function R8(n,e){return so(n,"GET","/v2/recaptchaConfig",Ts(n,e))}async function k8(n,e){return so(n,"POST","/v1/accounts:delete",e)}async function cm(n,e){return so(n,"POST","/v1/accounts:lookup",e)}function Nu(n){if(n)try{let e=new Date(Number(n));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}async function iw(n,e=!1){let t=ut(n),i=await t.getIdToken(e),r=rw(i);K(r&&r.exp&&r.auth_time&&r.iat,t.auth,"internal-error");let o=typeof r.firebase=="object"?r.firebase:void 0,s=o?.sign_in_provider;return{claims:r,token:i,authTime:Nu(k0(r.auth_time)),issuedAtTime:Nu(k0(r.iat)),expirationTime:Nu(k0(r.exp)),signInProvider:s||null,signInSecondFactor:o?.sign_in_second_factor||null}}function k0(n){return Number(n)*1e3}function rw(n){let[e,t,i]=n.split(".");if(e===void 0||t===void 0||i===void 0)return nm("JWT malformed, contained fewer than 3 sections"),null;try{let r=cc(t);return r?JSON.parse(r):(nm("Failed to decode base64 JWT payload"),null)}catch(r){return nm("Caught error parsing JWT payload as JSON",r?.toString()),null}}function S1(n){let e=rw(n);return K(e,"internal-error"),K(typeof e.exp<"u","internal-error"),K(typeof e.iat<"u","internal-error"),Number(e.exp)-Number(e.iat)}async function Pu(n,e,t=!1){if(t)return e;try{return await e}catch(i){throw i instanceof ii&&N8(i)&&n.auth.currentUser===n&&await n.auth.signOut(),i}}function N8({code:n}){return n==="auth/user-disabled"||n==="auth/user-token-expired"}var V0=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 i=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),i}else{this.errorBackoff=3e4;let r=((t=this.user.stsTokenManager.expirationTime)!==null&&t!==void 0?t:0)-Date.now()-3e5;return Math.max(0,r)}}schedule(e=!1){if(!this.isRunning)return;let t=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},t)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){e?.code==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}};var Lu=class{constructor(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}_initializeTime(){this.lastSignInTime=Nu(this.lastLoginAt),this.creationTime=Nu(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}};async function lm(n){var e;let t=n.auth,i=await n.getIdToken(),r=await Pu(n,cm(t,{idToken:i}));K(r?.users.length,t,"internal-error");let o=r.users[0];n._notifyReloadListener(o);let s=!((e=o.providerUserInfo)===null||e===void 0)&&e.length?W1(o.providerUserInfo):[],a=O8(n.providerData,s),c=n.isAnonymous,l=!(n.email&&o.passwordHash)&&!a?.length,u=c?l:!1,d={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 Lu(o.createdAt,o.lastLoginAt),isAnonymous:u};Object.assign(n,d)}async function ow(n){let e=ut(n);await lm(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}function O8(n,e){return[...n.filter(i=>!e.some(r=>r.providerId===i.providerId)),...e]}function W1(n){return n.map(e=>{var{providerId:t}=e,i=Kv(e,["providerId"]);return{providerId:t,uid:i.rawId||"",displayName:i.displayName||null,email:i.email||null,phoneNumber:i.phoneNumber||null,photoURL:i.photoUrl||null}})}async function P8(n,e){let t=await $1(n,{},async()=>{let i=_s({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:r,apiKey:o}=n.config,s=await z1(n,r,"/v1/token",`key=${o}`),a=await n._getAdditionalHeaders();a["Content-Type"]="application/x-www-form-urlencoded";let c={method:"POST",headers:a,body:i};return n.emulatorConfig&&Kr(n.emulatorConfig.host)&&(c.credentials="include"),am.fetch()(s,c)});return{accessToken:t.access_token,expiresIn:t.expires_in,refreshToken:t.refresh_token}}async function L8(n,e){return so(n,"POST","/v2/accounts:revokeToken",Ts(n,e))}var Ou=class n{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){K(e.idToken,"internal-error"),K(typeof e.idToken<"u","internal-error"),K(typeof e.refreshToken<"u","internal-error");let t="expiresIn"in e&&typeof e.expiresIn<"u"?Number(e.expiresIn):S1(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}updateFromIdToken(e){K(e.length!==0,"internal-error");let t=S1(e);this.updateTokensAndExpiration(e,null,t)}async getToken(e,t=!1){return!t&&this.accessToken&&!this.isExpired?this.accessToken:(K(this.refreshToken,e,"user-token-expired"),this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null)}clearRefreshToken(){this.refreshToken=null}async refresh(e,t){let{accessToken:i,refreshToken:r,expiresIn:o}=await P8(e,t);this.updateTokensAndExpiration(i,r,Number(o))}updateTokensAndExpiration(e,t,i){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+i*1e3}static fromJSON(e,t){let{refreshToken:i,accessToken:r,expirationTime:o}=t,s=new n;return i&&(K(typeof i=="string","internal-error",{appName:e}),s.refreshToken=i),r&&(K(typeof r=="string","internal-error",{appName:e}),s.accessToken=r),o&&(K(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 pr("not implemented")}};function no(n,e){K(typeof n=="string"||typeof n>"u","internal-error",{appName:e})}var io=class n{constructor(e){var{uid:t,auth:i,stsTokenManager:r}=e,o=Kv(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new V0(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=i,this.stsTokenManager=r,this.accessToken=r.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 Lu(o.createdAt||void 0,o.lastLoginAt||void 0)}async getIdToken(e){let t=await Pu(this,this.stsTokenManager.getToken(this.auth,e));return K(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return iw(this,e)}reload(){return ow(this)}_assign(e){this!==e&&(K(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){K(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,t=!1){let i=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),i=!0),t&&await lm(this),await this.auth._persistUserIfCurrent(this),i&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(Dn(this.auth.app))return Promise.reject(ro(this.auth));let e=await this.getIdToken();return await Pu(this,k8(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 i,r,o,s,a,c,l,u;let d=(i=t.displayName)!==null&&i!==void 0?i:void 0,f=(r=t.email)!==null&&r!==void 0?r:void 0,h=(o=t.phoneNumber)!==null&&o!==void 0?o:void 0,g=(s=t.photoURL)!==null&&s!==void 0?s:void 0,y=(a=t.tenantId)!==null&&a!==void 0?a:void 0,_=(c=t._redirectEventId)!==null&&c!==void 0?c:void 0,b=(l=t.createdAt)!==null&&l!==void 0?l:void 0,w=(u=t.lastLoginAt)!==null&&u!==void 0?u:void 0,{uid:I,emailVerified:D,isAnonymous:S,providerData:T,stsTokenManager:F}=t;K(I&&F,e,"internal-error");let R=Ou.fromJSON(this.name,F);K(typeof I=="string",e,"internal-error"),no(d,e.name),no(f,e.name),K(typeof D=="boolean",e,"internal-error"),K(typeof S=="boolean",e,"internal-error"),no(h,e.name),no(g,e.name),no(y,e.name),no(_,e.name),no(b,e.name),no(w,e.name);let j=new n({uid:I,auth:e,email:f,emailVerified:D,displayName:d,isAnonymous:S,photoURL:g,phoneNumber:h,tenantId:y,stsTokenManager:R,createdAt:b,lastLoginAt:w});return T&&Array.isArray(T)&&(j.providerData=T.map(te=>Object.assign({},te))),_&&(j._redirectEventId=_),j}static async _fromIdTokenResponse(e,t,i=!1){let r=new Ou;r.updateFromServerResponse(t);let o=new n({uid:t.localId,auth:e,stsTokenManager:r,isAnonymous:i});return await lm(o),o}static async _fromGetAccountInfoResponse(e,t,i){let r=t.users[0];K(r.localId!==void 0,"internal-error");let o=r.providerUserInfo!==void 0?W1(r.providerUserInfo):[],s=!(r.email&&r.passwordHash)&&!o?.length,a=new Ou;a.updateFromIdToken(i);let c=new n({uid:r.localId,auth:e,stsTokenManager:a,isAnonymous:s}),l={uid:r.localId,displayName:r.displayName||null,photoURL:r.photoUrl||null,email:r.email||null,emailVerified:r.emailVerified||!1,phoneNumber:r.phoneNumber||null,tenantId:r.tenantId||null,providerData:o,metadata:new Lu(r.createdAt,r.lastLoginAt),isAnonymous:!(r.email&&r.passwordHash)&&!o?.length};return Object.assign(c,l),c}};var D1=new Map;function mr(n){oo(n instanceof Function,"Expected a class definition");let e=D1.get(n);return e?(oo(e instanceof n,"Instance stored in cache mismatched with class"),e):(e=new n,D1.set(n,e),e)}var F8=(()=>{class n{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(t,i){this.storage[t]=i}async _get(t){let i=this.storage[t];return i===void 0?null:i}async _remove(t){delete this.storage[t]}_addListener(t,i){}_removeListener(t,i){}}return n.type="NONE",n})(),j0=F8;function im(n,e,t){return`firebase:${n}:${e}:${t}`}var um=class n{constructor(e,t,i){this.persistence=e,this.auth=t,this.userKey=i;let{config:r,name:o}=this.auth;this.fullUserKey=im(this.userKey,r.apiKey,o),this.fullPersistenceKey=im("persistence",r.apiKey,o),this.boundEventHandler=t._onStorageEvent.bind(t),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){let e=await this.persistence._get(this.fullUserKey);if(!e)return null;if(typeof e=="string"){let t=await cm(this.auth,{idToken:e}).catch(()=>{});return t?io._fromGetAccountInfoResponse(this.auth,t,e):null}return io._fromJSON(this.auth,e)}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;let t=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=e,t)return this.setCurrentUser(t)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,t,i="authUser"){if(!t.length)return new n(mr(j0),e,i);let r=(await Promise.all(t.map(async l=>{if(await l._isAvailable())return l}))).filter(l=>l),o=r[0]||mr(j0),s=im(i,e.config.apiKey,e.name),a=null;for(let l of t)try{let u=await l._get(s);if(u){let d;if(typeof u=="string"){let f=await cm(e,{idToken:u}).catch(()=>{});if(!f)break;d=await io._fromGetAccountInfoResponse(e,f,u)}else d=io._fromJSON(e,u);l!==o&&(a=d),o=l;break}}catch{}let c=r.filter(l=>l._shouldAllowMigration);return!o._shouldAllowMigration||!c.length?new n(o,e,i):(o=c[0],a&&await o._set(s,a.toJSON()),await Promise.all(t.map(async l=>{if(l!==o)try{await l._remove(s)}catch{}})),new n(o,e,i))}};function T1(n){let e=n.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(K1(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(q1(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(Z1(e))return"Blackberry";if(X1(e))return"Webos";if(G1(e))return"Safari";if((e.includes("chrome/")||Y1(e))&&!e.includes("edge/"))return"Chrome";if(Q1(e))return"Android";{let t=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,i=n.match(t);if(i?.length===2)return i[1]}return"Other"}function q1(n=Ut()){return/firefox\//i.test(n)}function G1(n=Ut()){let e=n.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function Y1(n=Ut()){return/crios\//i.test(n)}function K1(n=Ut()){return/iemobile/i.test(n)}function Q1(n=Ut()){return/android/i.test(n)}function Z1(n=Ut()){return/blackberry/i.test(n)}function X1(n=Ut()){return/webos/i.test(n)}function sw(n=Ut()){return/iphone|ipad|ipod/i.test(n)||/macintosh/i.test(n)&&/mobile/i.test(n)}function V8(n=Ut()){var e;return sw(n)&&!!(!((e=window.navigator)===null||e===void 0)&&e.standalone)}function j8(){return Uk()&&document.documentMode===10}function J1(n=Ut()){return sw(n)||Q1(n)||X1(n)||Z1(n)||/windows phone/i.test(n)||K1(n)}function eN(n,e=[]){let t;switch(n){case"Browser":t=T1(Ut());break;case"Worker":t=`${T1(Ut())}-${n}`;break;default:t=n}let i=e.length?e.join(","):"FirebaseCore-web";return`${t}/JsCore/${Xr}/${i}`}var B0=class{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,t){let i=o=>new Promise((s,a)=>{try{let c=e(o);s(c)}catch(c){a(c)}});i.onAbort=t,this.queue.push(i);let r=this.queue.length-1;return()=>{this.queue[r]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;let t=[];try{for(let i of this.queue)await i(e),i.onAbort&&t.push(i.onAbort)}catch(i){t.reverse();for(let r of t)try{r()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:i?.message})}}};async function B8(n,e={}){return so(n,"GET","/v2/passwordPolicy",Ts(n,e))}var U8=6,U0=class{constructor(e){var t,i,r,o;let s=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=(t=s.minPasswordLength)!==null&&t!==void 0?t:U8,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=(r=(i=e.allowedNonAlphanumericCharacters)===null||i===void 0?void 0:i.join(""))!==null&&r!==void 0?r:"",this.forceUpgradeOnSignin=(o=e.forceUpgradeOnSignin)!==null&&o!==void 0?o:!1,this.schemaVersion=e.schemaVersion}validatePassword(e){var t,i,r,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=(i=c.meetsMaxPasswordLength)!==null&&i!==void 0?i:!0),c.isValid&&(c.isValid=(r=c.containsLowercaseLetter)!==null&&r!==void 0?r:!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 i=this.customStrengthOptions.minPasswordLength,r=this.customStrengthOptions.maxPasswordLength;i&&(t.meetsMinPasswordLength=e.length>=i),r&&(t.meetsMaxPasswordLength=e.length<=r)}validatePasswordCharacterOptions(e,t){this.updatePasswordCharacterOptionsStatuses(t,!1,!1,!1,!1);let i;for(let r=0;r="a"&&i<="z",i>="A"&&i<="Z",i>="0"&&i<="9",this.allowedNonAlphanumericCharacters.includes(i))}updatePasswordCharacterOptionsStatuses(e,t,i,r,o){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=t)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=i)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=r)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=o))}};var H0=class{constructor(e,t,i,r){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=i,this.config=r,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new dm(this),this.idTokenSubscription=new dm(this),this.beforeStateQueue=new B0(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=U1,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=r.sdkClientVersion,this._persistenceManagerAvailable=new Promise(o=>this._resolvePersistenceManagerAvailable=o)}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=mr(t)),this._initializationPromise=this.queue(async()=>{var i,r,o;if(!this._deleted&&(this.persistenceManager=await um.create(this,e),(i=this._resolvePersistenceManagerAvailable)===null||i===void 0||i.call(this),!this._deleted)){if(!((r=this._popupRedirectResolver)===null||r===void 0)&&r._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(t),this.lastNotifiedUid=((o=this.currentUser)===null||o===void 0?void 0:o.uid)||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;let e=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!e)){if(this.currentUser&&e&&this.currentUser.uid===e.uid){this._currentUser._assign(e),await this.currentUser.getIdToken();return}await this._updateCurrentUser(e,!0)}}async initializeCurrentUserFromIdToken(e){try{let t=await cm(this,{idToken:e}),i=await io._fromGetAccountInfoResponse(this,t,e);await this.directlySetCurrentUser(i)}catch(t){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",t),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){var t;if(Dn(this.app)){let s=this.app.settings.authIdToken;return s?new Promise(a=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(s).then(a,a))}):this.directlySetCurrentUser(null)}let i=await this.assertedPersistence.getCurrentUser(),r=i,o=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();let s=(t=this.redirectUser)===null||t===void 0?void 0:t._redirectEventId,a=r?._redirectEventId,c=await this.tryRedirectSignIn(e);(!s||s===a)&&c?.user&&(r=c.user,o=!0)}if(!r)return this.directlySetCurrentUser(null);if(!r._redirectEventId){if(o)try{await this.beforeStateQueue.runMiddleware(r)}catch(s){r=i,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(s))}return r?this.reloadAndSetCurrentUserOrClear(r):this.directlySetCurrentUser(null)}return K(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===r._redirectEventId?this.directlySetCurrentUser(r):this.reloadAndSetCurrentUserOrClear(r)}async tryRedirectSignIn(e){let t=null;try{t=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch{await this._setRedirectUser(null)}return t}async reloadAndSetCurrentUserOrClear(e){try{await lm(e)}catch(t){if(t?.code!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=D8()}async _delete(){this._deleted=!0}async updateCurrentUser(e){if(Dn(this.app))return Promise.reject(ro(this));let t=e?ut(e):null;return t&&K(t.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(t&&t._clone(this))}async _updateCurrentUser(e,t=!1){if(!this._deleted)return e&&K(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),t||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return Dn(this.app)?Promise.reject(ro(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return Dn(this.app)?Promise.reject(ro(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(mr(e))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await 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]}async _updatePasswordPolicy(){let e=await B8(this),t=new U0(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 ri("auth","Firebase",e())}onAuthStateChanged(e,t,i){return this.registerStateListener(this.authStateSubscription,e,t,i)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,i){return this.registerStateListener(this.idTokenSubscription,e,t,i)}authStateReady(){return new Promise((e,t)=>{if(this.currentUser)e();else{let i=this.onAuthStateChanged(()=>{i(),e()},t)}})}async revokeAccessToken(e){if(this.currentUser){let t=await this.currentUser.getIdToken(),i={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:t};this.tenantId!=null&&(i.tenantId=this.tenantId),await L8(this,i)}}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(e=this._currentUser)===null||e===void 0?void 0:e.toJSON()}}async _setRedirectUser(e,t){let i=await this.getOrInitRedirectPersistenceManager(t);return e===null?i.removeCurrentUser():i.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){let t=e&&mr(e)||this._popupRedirectResolver;K(t,this,"argument-error"),this.redirectPersistenceManager=await um.create(this,[mr(t._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var t,i;return this._isInitialized&&await this.queue(async()=>{}),((t=this._currentUser)===null||t===void 0?void 0:t._redirectEventId)===e?this._currentUser:((i=this.redirectUser)===null||i===void 0?void 0:i._redirectEventId)===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(e))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var e,t;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);let i=(t=(e=this.currentUser)===null||e===void 0?void 0:e.uid)!==null&&t!==void 0?t:null;this.lastNotifiedUid!==i&&(this.lastNotifiedUid=i,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,i,r){if(this._deleted)return()=>{};let o=typeof t=="function"?t:t.next.bind(t),s=!1,a=this._isInitialized?Promise.resolve():this._initializationPromise;if(K(a,this,"internal-error"),a.then(()=>{s||o(this.currentUser)}),typeof t=="function"){let c=e.addObserver(t,i,r);return()=>{s=!0,c()}}else{let c=e.addObserver(t);return()=>{s=!0,c()}}}async directlySetCurrentUser(e){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?await this.assertedPersistence.setCurrentUser(e):await this.assertedPersistence.removeCurrentUser()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return K(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=eN(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var e;let t={"X-Client-Version":this.clientVersion};this.app.options.appId&&(t["X-Firebase-gmpid"]=this.app.options.appId);let i=await((e=this.heartbeatServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getHeartbeatsHeader());i&&(t["X-Firebase-Client"]=i);let r=await this._getAppCheckToken();return r&&(t["X-Firebase-AppCheck"]=r),t}async _getAppCheckToken(){var e;if(Dn(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;let t=await((e=this.appCheckServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getToken());return t?.error&&C8(`Error while retrieving App Check token: ${t.error}`),t?.token}};function vc(n){return ut(n)}var dm=class{constructor(e){this.auth=e,this.observer=null,this.addObserver=qk(t=>this.observer=t)}get next(){return K(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}};var _m={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function H8(n){_m=n}function tN(n){return _m.loadJS(n)}function $8(){return _m.recaptchaEnterpriseScript}function z8(){return _m.gapiScript}function nN(n){return`__${n}${Math.floor(Math.random()*1e6)}`}var $0=class{constructor(){this.enterprise=new z0}ready(e){e()}execute(e,t){return Promise.resolve("token")}render(e,t){return""}},z0=class{ready(e){e()}execute(e,t){return Promise.resolve("token")}render(e,t){return""}};var W8="recaptcha-enterprise",iN="NO_RECAPTCHA",W0=class{constructor(e){this.type=W8,this.auth=vc(e)}async verify(e="verify",t=!1){async function i(o){if(!t){if(o.tenantId==null&&o._agentRecaptchaConfig!=null)return o._agentRecaptchaConfig.siteKey;if(o.tenantId!=null&&o._tenantRecaptchaConfigs[o.tenantId]!==void 0)return o._tenantRecaptchaConfigs[o.tenantId].siteKey}return new Promise(async(s,a)=>{R8(o,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(c=>{if(c.recaptchaKey===void 0)a(new Error("recaptcha Enterprise site key undefined"));else{let l=new F0(c);return o.tenantId==null?o._agentRecaptchaConfig=l:o._tenantRecaptchaConfigs[o.tenantId]=l,s(l.siteKey)}}).catch(c=>{a(c)})})}function r(o,s,a){let c=window.grecaptcha;I1(c)?c.enterprise.ready(()=>{c.enterprise.execute(o,{action:e}).then(l=>{s(l)}).catch(()=>{s(iN)})}):a(Error("No reCAPTCHA enterprise script loaded."))}return this.auth.settings.appVerificationDisabledForTesting?new $0().execute("siteKey",{action:"verify"}):new Promise((o,s)=>{i(this.auth).then(a=>{if(!t&&I1(window.grecaptcha))r(a,o,s);else{if(typeof window>"u"){s(new Error("RecaptchaVerifier is only supported in browser"));return}let c=$8();c.length!==0&&(c+=a),tN(c).then(()=>{r(a,o,s)}).catch(l=>{s(l)})}}).catch(a=>{s(a)})})}};async function ku(n,e,t,i=!1,r=!1){let o=new W0(n),s;if(r)s=iN;else try{s=await o.verify(t)}catch{s=await o.verify(t,!0)}let a=Object.assign({},e);if(t==="mfaSmsEnrollment"||t==="mfaSmsSignIn"){if("phoneEnrollmentInfo"in a){let c=a.phoneEnrollmentInfo.phoneNumber,l=a.phoneEnrollmentInfo.recaptchaToken;Object.assign(a,{phoneEnrollmentInfo:{phoneNumber:c,recaptchaToken:l,captchaResponse:s,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}else if("phoneSignInInfo"in a){let c=a.phoneSignInInfo.recaptchaToken;Object.assign(a,{phoneSignInInfo:{recaptchaToken:c,captchaResponse:s,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}return a}return i?Object.assign(a,{captchaResp:s}):Object.assign(a,{captchaResponse:s}),Object.assign(a,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(a,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),a}async function x1(n,e,t,i,r){var o,s;if(r==="EMAIL_PASSWORD_PROVIDER")if(!((o=n._getRecaptchaConfig())===null||o===void 0)&&o.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")){let a=await ku(n,e,t,t==="getOobCode");return i(n,a)}else return i(n,e).catch(async a=>{if(a.code==="auth/missing-recaptcha-token"){console.log(`${t} is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow.`);let c=await ku(n,e,t,t==="getOobCode");return i(n,c)}else return Promise.reject(a)});else if(r==="PHONE_PROVIDER")if(!((s=n._getRecaptchaConfig())===null||s===void 0)&&s.isProviderEnabled("PHONE_PROVIDER")){let a=await ku(n,e,t);return i(n,a).catch(async c=>{var l;if(((l=n._getRecaptchaConfig())===null||l===void 0?void 0:l.getProviderEnforcementState("PHONE_PROVIDER"))==="AUDIT"&&(c.code==="auth/missing-recaptcha-token"||c.code==="auth/invalid-app-credential")){console.log(`Failed to verify with reCAPTCHA Enterprise. Automatically triggering the reCAPTCHA v2 flow to complete the ${t} flow.`);let u=await ku(n,e,t,!1,!0);return i(n,u)}return Promise.reject(c)})}else{let a=await ku(n,e,t,!1,!0);return i(n,a)}else return Promise.reject(r+" provider is not supported.")}function aw(n,e){let t=hc(n,"auth");if(t.isInitialized()){let r=t.getImmediate(),o=t.getOptions();if(Ni(o,e??{}))return r;Fi(r,"already-initialized")}return t.initialize({options:e})}function q8(n,e){let t=e?.persistence||[],i=(Array.isArray(t)?t:[t]).map(mr);e?.errorMap&&n._updateErrorMap(e.errorMap),n._initializeWithPersistence(i,e?.popupRedirectResolver)}function cw(n,e,t){let i=vc(n);K(/^https?:\/\//.test(e),i,"invalid-emulator-scheme");let r=!!t?.disableWarnings,o=rN(e),{host:s,port:a}=G8(e),c=a===null?"":`:${a}`,l={url:`${o}//${s}${c}/`},u=Object.freeze({host:s,port:a,protocol:o.replace(":",""),options:Object.freeze({disableWarnings:r})});if(!i._canInitEmulator){K(i.config.emulator&&i.emulatorConfig,i,"emulator-config-failed"),K(Ni(l,i.config.emulator)&&Ni(u,i.emulatorConfig),i,"emulator-config-failed");return}i.config.emulator=l,i.emulatorConfig=u,i.settings.appVerificationDisabledForTesting=!0,Kr(s)?(qp(`${o}//${s}${c}`),Gp("Auth",!0)):r||Y8()}function rN(n){let e=n.indexOf(":");return e<0?"":n.substr(0,e+1)}function G8(n){let e=rN(n),t=/(\/\/)?([^?#/]+)/.exec(n.substr(e.length));if(!t)return{host:"",port:null};let i=t[2].split("@").pop()||"",r=/^(\[[^\]]+\])(:|$)/.exec(i);if(r){let o=r[1];return{host:o,port:A1(i.substr(o.length+1))}}else{let[o,s]=i.split(":");return{host:o,port:A1(s)}}}function A1(n){if(!n)return null;let e=Number(n);return isNaN(e)?null:e}function Y8(){function n(){let e=document.createElement("p"),t=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",t.position="fixed",t.width="100%",t.backgroundColor="#ffffff",t.border=".1em solid #000000",t.color="#b50000",t.bottom="0px",t.left="0px",t.margin="0px",t.zIndex="10000",t.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",n):n())}var Fu=class{constructor(e,t){this.providerId=e,this.signInMethod=t}toJSON(){return pr("not implemented")}_getIdTokenResponse(e){return pr("not implemented")}_linkToIdToken(e,t){return pr("not implemented")}_getReauthenticationResolver(e){return pr("not implemented")}};async function K8(n,e){return so(n,"POST","/v1/accounts:signUp",e)}async function Q8(n,e){return ym(n,"POST","/v1/accounts:signInWithPassword",Ts(n,e))}async function Z8(n,e){return ym(n,"POST","/v1/accounts:signInWithEmailLink",Ts(n,e))}async function X8(n,e){return ym(n,"POST","/v1/accounts:signInWithEmailLink",Ts(n,e))}var Vu=class n extends Fu{constructor(e,t,i,r=null){super("password",i),this._email=e,this._password=t,this._tenantId=r}static _fromEmailAndPassword(e,t){return new n(e,t,"password")}static _fromEmailAndCode(e,t,i=null){return new n(e,t,"emailLink",i)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){let t=typeof e=="string"?JSON.parse(e):e;if(t?.email&&t?.password){if(t.signInMethod==="password")return this._fromEmailAndPassword(t.email,t.password);if(t.signInMethod==="emailLink")return this._fromEmailAndCode(t.email,t.password,t.tenantId)}return null}async _getIdTokenResponse(e){switch(this.signInMethod){case"password":let t={returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return x1(e,t,"signInWithPassword",Q8,"EMAIL_PASSWORD_PROVIDER");case"emailLink":return Z8(e,{email:this._email,oobCode:this._password});default:Fi(e,"internal-error")}}async _linkToIdToken(e,t){switch(this.signInMethod){case"password":let i={idToken:t,returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return x1(e,i,"signUpPassword",K8,"EMAIL_PASSWORD_PROVIDER");case"emailLink":return X8(e,{idToken:t,email:this._email,oobCode:this._password});default:Fi(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}};async function N0(n,e){return ym(n,"POST","/v1/accounts:signInWithIdp",Ts(n,e))}function J8(n){switch(n){case"recoverEmail":return"RECOVER_EMAIL";case"resetPassword":return"PASSWORD_RESET";case"signIn":return"EMAIL_SIGNIN";case"verifyEmail":return"VERIFY_EMAIL";case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL";case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION";default:return null}}function e6(n){let e=dc(fc(n)).link,t=e?dc(fc(e)).deep_link_id:null,i=dc(fc(n)).deep_link_id;return(i?dc(fc(i)).link:null)||i||t||e||n}var fm=class n{constructor(e){var t,i,r,o,s,a;let c=dc(fc(e)),l=(t=c.apiKey)!==null&&t!==void 0?t:null,u=(i=c.oobCode)!==null&&i!==void 0?i:null,d=J8((r=c.mode)!==null&&r!==void 0?r:null);K(l&&u&&d,"argument-error"),this.apiKey=l,this.operation=d,this.code=u,this.continueUrl=(o=c.continueUrl)!==null&&o!==void 0?o:null,this.languageCode=(s=c.lang)!==null&&s!==void 0?s:null,this.tenantId=(a=c.tenantId)!==null&&a!==void 0?a:null}static parseLink(e){let t=e6(e);try{return new n(t)}catch{return null}}};var oN=(()=>{class n{constructor(){this.providerId=n.PROVIDER_ID}static credential(t,i){return Vu._fromEmailAndPassword(t,i)}static credentialWithLink(t,i){let r=fm.parseLink(i);return K(r,"argument-error"),Vu._fromEmailAndCode(t,r.code,r.tenantId)}}n.PROVIDER_ID="password",n.EMAIL_PASSWORD_SIGN_IN_METHOD="password",n.EMAIL_LINK_SIGN_IN_METHOD="emailLink";return n})(),hm=class{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}};var q0=class extends hm{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}};var ju=class n{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,t,i,r=!1){let o=await io._fromIdTokenResponse(e,i,r),s=M1(i);return new n({user:o,providerId:s,_tokenResponse:i,operationType:t})}static async _forOperation(e,t,i){await e._updateTokensIfNecessary(i,!0);let r=M1(i);return new n({user:e,providerId:r,_tokenResponse:i,operationType:t})}};function M1(n){return n.providerId?n.providerId:"phoneNumber"in n?"phone":null}var G0=class n extends ii{constructor(e,t,i,r){var o;super(t.code,t.message),this.operationType=i,this.user=r,Object.setPrototypeOf(this,n.prototype),this.customData={appName:e.name,tenantId:(o=e.tenantId)!==null&&o!==void 0?o:void 0,_serverResponse:t.customData._serverResponse,operationType:i}}static _fromErrorAndOperation(e,t,i,r){return new n(e,t,i,r)}};function sN(n,e,t,i){return(e==="reauthenticate"?t._getReauthenticationResolver(n):t._getIdTokenResponse(n)).catch(o=>{throw o.code==="auth/multi-factor-auth-required"?G0._fromErrorAndOperation(n,o,e,i):o})}async function t6(n,e,t=!1){let i=await Pu(n,e._linkToIdToken(n.auth,await n.getIdToken()),t);return ju._forOperation(n,"link",i)}async function n6(n,e,t=!1){let{auth:i}=n;if(Dn(i.app))return Promise.reject(ro(i));let r="reauthenticate";try{let o=await Pu(n,sN(i,r,e,n),t);K(o.idToken,i,"internal-error");let s=rw(o.idToken);K(s,i,"internal-error");let{sub:a}=s;return K(n.uid===a,i,"user-mismatch"),ju._forOperation(n,r,o)}catch(o){throw o?.code==="auth/user-not-found"&&Fi(i,"user-mismatch"),o}}async function aN(n,e,t=!1){if(Dn(n.app))return Promise.reject(ro(n));let i="signIn",r=await sN(n,i,e),o=await ju._fromIdTokenResponse(n,i,r);return t||await n._updateCurrentUser(o.user),o}async function lw(n,e){return aN(vc(n),e)}async function i6(n){let e=vc(n);e._getPasswordPolicyInternal()&&await e._updatePasswordPolicy()}function uw(n,e,t){return Dn(n.app)?Promise.reject(ro(n)):lw(ut(n),oN.credential(e,t)).catch(async i=>{throw i.code==="auth/password-does-not-meet-requirements"&&i6(n),i})}function bm(n,e,t,i){return ut(n).onIdTokenChanged(e,t,i)}function dw(n,e,t){return ut(n).beforeAuthStateChanged(e,t)}function Em(n,e,t,i){return ut(n).onAuthStateChanged(e,t,i)}function fw(n){return ut(n).signOut()}var pm="__sak";var mm=class{constructor(e,t){this.storageRetriever=e,this.type=t}_isAvailable(){try{return this.storage?(this.storage.setItem(pm,"1"),this.storage.removeItem(pm),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 r6=1e3,o6=10,s6=(()=>{class n extends mm{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(t,i)=>this.onStorageEvent(t,i),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=J1(),this._shouldAllowMigration=!0}forAllChangedKeys(t){for(let i of Object.keys(this.listeners)){let r=this.storage.getItem(i),o=this.localCache[i];r!==o&&t(i,o,r)}}onStorageEvent(t,i=!1){if(!t.key){this.forAllChangedKeys((a,c,l)=>{this.notifyListeners(a,l)});return}let r=t.key;i?this.detachListener():this.stopPolling();let o=()=>{let a=this.storage.getItem(r);!i&&this.localCache[r]===a||this.notifyListeners(r,a)},s=this.storage.getItem(r);j8()&&s!==t.newValue&&t.newValue!==t.oldValue?setTimeout(o,o6):o()}notifyListeners(t,i){this.localCache[t]=i;let r=this.listeners[t];if(r)for(let o of Array.from(r))o(i&&JSON.parse(i))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((t,i,r)=>{this.onStorageEvent(new StorageEvent("storage",{key:t,oldValue:i,newValue:r}),!0)})},r6)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(t,i){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(i)}_removeListener(t,i){this.listeners[t]&&(this.listeners[t].delete(i),this.listeners[t].size===0&&delete this.listeners[t]),Object.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(t,i){await super._set(t,i),this.localCache[t]=JSON.stringify(i)}async _get(t){let i=await super._get(t);return this.localCache[t]=JSON.stringify(i),i}async _remove(t){await super._remove(t),delete this.localCache[t]}}return n.type="LOCAL",n})(),cN=s6;var a6=(()=>{class n extends mm{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(t,i){}_removeListener(t,i){}}return n.type="SESSION",n})(),hw=a6;function c6(n){return Promise.all(n.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(t){return{fulfilled:!1,reason:t}}}))}var l6=(()=>{class n{constructor(t){this.eventTarget=t,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(t){let i=this.receivers.find(o=>o.isListeningto(t));if(i)return i;let r=new n(t);return this.receivers.push(r),r}isListeningto(t){return this.eventTarget===t}async handleEvent(t){let i=t,{eventId:r,eventType:o,data:s}=i.data,a=this.handlersMap[o];if(!a?.size)return;i.ports[0].postMessage({status:"ack",eventId:r,eventType:o});let c=Array.from(a).map(async u=>u(i.origin,s)),l=await c6(c);i.ports[0].postMessage({status:"done",eventId:r,eventType:o,response:l})}_subscribe(t,i){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[t]||(this.handlersMap[t]=new Set),this.handlersMap[t].add(i)}_unsubscribe(t,i){this.handlersMap[t]&&i&&this.handlersMap[t].delete(i),(!i||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 lN(n="",e=10){let t="";for(let i=0;i{let l=lN("",20);r.port1.start();let u=setTimeout(()=>{c(new Error("unsupported_event"))},i);s={messageChannel:r,onMessage(d){let f=d;if(f.data.eventId===l)switch(f.data.status){case"ack":clearTimeout(u),o=setTimeout(()=>{c(new Error("timeout"))},3e3);break;case"done":clearTimeout(o),a(f.data.response);break;default:clearTimeout(u),clearTimeout(o),c(new Error("invalid_response"));break}}},this.handlers.add(s),r.port1.addEventListener("message",s.onMessage),this.target.postMessage({eventType:e,eventId:l,data:t},[r.port2])}).finally(()=>{s&&this.removeMessageHandler(s)})}};function Li(){return window}function u6(n){Li().location.href=n}function uN(){return typeof Li().WorkerGlobalScope<"u"&&typeof Li().importScripts=="function"}async function d6(){if(!navigator?.serviceWorker)return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function f6(){var n;return((n=navigator?.serviceWorker)===null||n===void 0?void 0:n.controller)||null}function h6(){return uN()?self:null}var dN="firebaseLocalStorageDb",p6=1,gm="firebaseLocalStorage",fN="fbase_key",Ds=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 wm(n,e){return n.transaction([gm],e?"readwrite":"readonly").objectStore(gm)}function m6(){let n=indexedDB.deleteDatabase(dN);return new Ds(n).toPromise()}function K0(){let n=indexedDB.open(dN,p6);return new Promise((e,t)=>{n.addEventListener("error",()=>{t(n.error)}),n.addEventListener("upgradeneeded",()=>{let i=n.result;try{i.createObjectStore(gm,{keyPath:fN})}catch(r){t(r)}}),n.addEventListener("success",async()=>{let i=n.result;i.objectStoreNames.contains(gm)?e(i):(i.close(),await m6(),e(await K0()))})})}async function R1(n,e,t){let i=wm(n,!0).put({[fN]:e,value:t});return new Ds(i).toPromise()}async function g6(n,e){let t=wm(n,!1).get(e),i=await new Ds(t).toPromise();return i===void 0?null:i.value}function k1(n,e){let t=wm(n,!0).delete(e);return new Ds(t).toPromise()}var v6=800,y6=3,_6=(()=>{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(()=>{},()=>{})}async _openDb(){return this.db?this.db:(this.db=await K0(),this.db)}async _withRetries(t){let i=0;for(;;)try{let r=await this._openDb();return await t(r)}catch(r){if(i++>y6)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return uN()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=l6._getInstance(h6()),this.receiver._subscribe("keyChanged",async(t,i)=>({keyProcessed:(await this._poll()).includes(i.key)})),this.receiver._subscribe("ping",async(t,i)=>["keyChanged"])}async initializeSender(){var t,i;if(this.activeServiceWorker=await d6(),!this.activeServiceWorker)return;this.sender=new Y0(this.activeServiceWorker);let r=await this.sender._send("ping",{},800);r&&!((t=r[0])===null||t===void 0)&&t.fulfilled&&!((i=r[0])===null||i===void 0)&&i.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(t){if(!(!this.sender||!this.activeServiceWorker||f6()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:t},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;let t=await K0();return await R1(t,pm,"1"),await k1(t,pm),!0}catch{}return!1}async _withPendingWrite(t){this.pendingWrites++;try{await t()}finally{this.pendingWrites--}}async _set(t,i){return this._withPendingWrite(async()=>(await this._withRetries(r=>R1(r,t,i)),this.localCache[t]=i,this.notifyServiceWorker(t)))}async _get(t){let i=await this._withRetries(r=>g6(r,t));return this.localCache[t]=i,i}async _remove(t){return this._withPendingWrite(async()=>(await this._withRetries(i=>k1(i,t)),delete this.localCache[t],this.notifyServiceWorker(t)))}async _poll(){let t=await this._withRetries(o=>{let s=wm(o,!1).getAll();return new Ds(s).toPromise()});if(!t)return[];if(this.pendingWrites!==0)return[];let i=[],r=new Set;if(t.length!==0)for(let{fbase_key:o,value:s}of t)r.add(o),JSON.stringify(this.localCache[o])!==JSON.stringify(s)&&(this.notifyListeners(o,s),i.push(o));for(let o of Object.keys(this.localCache))this.localCache[o]&&!r.has(o)&&(this.notifyListeners(o,null),i.push(o));return i}notifyListeners(t,i){this.localCache[t]=i;let r=this.listeners[t];if(r)for(let o of Array.from(r))o(i)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),v6)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(t,i){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[t]||(this.listeners[t]=new Set,this._get(t)),this.listeners[t].add(i)}_removeListener(t,i){this.listeners[t]&&(this.listeners[t].delete(i),this.listeners[t].size===0&&delete this.listeners[t]),Object.keys(this.listeners).length===0&&this.stopPolling()}}return n.type="LOCAL",n})(),hN=_6;var j_e=nN("rcb"),B_e=new Ss(3e4,6e4);function b6(n,e){return e?mr(e):(K(n._popupRedirectResolver,n,"argument-error"),n._popupRedirectResolver)}var Bu=class extends Fu{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return N0(e,this._buildIdpRequest())}_linkToIdToken(e,t){return N0(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return N0(e,this._buildIdpRequest())}_buildIdpRequest(e){let t={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(t.idToken=e),t}};function E6(n){return aN(n.auth,new Bu(n),n.bypassAuthState)}function w6(n){let{auth:e,user:t}=n;return K(t,e,"internal-error"),n6(t,new Bu(n),n.bypassAuthState)}async function C6(n){let{auth:e,user:t}=n;return K(t,e,"internal-error"),t6(t,new Bu(n),n.bypassAuthState)}var Q0=class{constructor(e,t,i,r,o=!1){this.auth=e,this.resolver=i,this.user=r,this.bypassAuthState=o,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(t)?t:[t]}execute(){return new Promise(async(e,t)=>{this.pendingPromise={resolve:e,reject:t};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(i){this.reject(i)}})}async onAuthEvent(e){let{urlResponse:t,sessionId:i,postBody:r,tenantId:o,error:s,type:a}=e;if(s){this.reject(s);return}let c={auth:this.auth,requestUri:t,sessionId:i,tenantId:o||void 0,postBody:r||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(a)(c))}catch(l){this.reject(l)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return E6;case"linkViaPopup":case"linkViaRedirect":return C6;case"reauthViaPopup":case"reauthViaRedirect":return w6;default:Fi(this.auth,"internal-error")}}resolve(e){oo(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){oo(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}};var U_e=new Ss(2e3,1e4);var I6="pendingRedirect",rm=new Map,Z0=class extends Q0{constructor(e,t,i=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,i),this.eventId=null}async execute(){let e=rm.get(this.auth._key());if(!e){try{let i=await S6(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(i)}catch(t){e=()=>Promise.reject(t)}rm.set(this.auth._key(),e)}return this.bypassAuthState||rm.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if(e.type==="signInViaRedirect")return super.onAuthEvent(e);if(e.type==="unknown"){this.resolve(null);return}if(e.eventId){let t=await this.auth._redirectUserForId(e.eventId);if(t)return this.user=t,super.onAuthEvent(e);this.resolve(null)}}async onExecution(){}cleanUp(){}};async function S6(n,e){let t=x6(e),i=T6(n);if(!await i._isAvailable())return!1;let r=await i._get(t)==="true";return await i._remove(t),r}function D6(n,e){rm.set(n._key(),e)}function T6(n){return mr(n._redirectPersistence)}function x6(n){return im(I6,n.config.apiKey,n.name)}async function A6(n,e,t=!1){if(Dn(n.app))return Promise.reject(ro(n));let i=vc(n),r=b6(i,e),s=await new Z0(i,r,t).execute();return s&&!t&&(delete s.user._redirectEventId,await i._persistUserIfCurrent(s.user),await i._setRedirectUser(null,e)),s}var M6=600*1e3,X0=class{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let t=!1;return this.consumers.forEach(i=>{this.isEventForConsumer(e,i)&&(t=!0,this.sendToConsumer(e,i),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!R6(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){var i;if(e.error&&!pN(e)){let r=((i=e.error.code)===null||i===void 0?void 0:i.split("auth/")[1])||"internal-error";t.onError(Is(this.auth,r))}else t.onAuthEvent(e)}isEventForConsumer(e,t){let i=t.eventId===null||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&i}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=M6&&this.cachedEventUids.clear(),this.cachedEventUids.has(N1(e))}saveEventToCache(e){this.cachedEventUids.add(N1(e)),this.lastProcessedEventTime=Date.now()}};function N1(n){return[n.type,n.eventId,n.sessionId,n.tenantId].filter(e=>e).join("-")}function pN({type:n,error:e}){return n==="unknown"&&e?.code==="auth/no-auth-event"}function R6(n){switch(n.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return pN(n);default:return!1}}async function k6(n,e={}){return so(n,"GET","/v1/projects",e)}var N6=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,O6=/^https?/;async function P6(n){if(n.config.emulator)return;let{authorizedDomains:e}=await k6(n);for(let t of e)try{if(L6(t))return}catch{}Fi(n,"unauthorized-domain")}function L6(n){let e=P0(),{protocol:t,hostname:i}=new URL(e);if(n.startsWith("chrome-extension://")){let s=new URL(n);return s.hostname===""&&i===""?t==="chrome-extension:"&&n.replace("chrome-extension://","")===e.replace("chrome-extension://",""):t==="chrome-extension:"&&s.hostname===i}if(!O6.test(t))return!1;if(N6.test(n))return i===n;let r=n.replace(/\./g,"\\.");return new RegExp("^(.+\\."+r+"|"+r+")$","i").test(i)}var F6=new Ss(3e4,6e4);function O1(){let n=Li().___jsl;if(n?.H){for(let e of Object.keys(n.H))if(n.H[e].r=n.H[e].r||[],n.H[e].L=n.H[e].L||[],n.H[e].r=[...n.H[e].L],n.CP)for(let t=0;t{var i,r,o;function s(){O1(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{O1(),t(Is(n,"network-request-failed"))},timeout:F6.get()})}if(!((r=(i=Li().gapi)===null||i===void 0?void 0:i.iframes)===null||r===void 0)&&r.Iframe)e(gapi.iframes.getContext());else if(!((o=Li().gapi)===null||o===void 0)&&o.load)s();else{let a=nN("iframefcb");return Li()[a]=()=>{gapi.load?s():t(Is(n,"network-request-failed"))},tN(`${z8()}?onload=${a}`).catch(c=>t(c))}}).catch(e=>{throw om=null,e})}var om=null;function j6(n){return om=om||V6(n),om}var B6=new Ss(5e3,15e3),U6="__/auth/iframe",H6="emulator/auth/iframe",$6={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},z6=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function W6(n){let e=n.config;K(e.authDomain,n,"auth-domain-config-required");let t=e.emulator?nw(e,H6):`https://${n.config.authDomain}/${U6}`,i={apiKey:e.apiKey,appName:n.name,v:Xr},r=z6.get(n.config.apiHost);r&&(i.eid=r);let o=n._getFrameworks();return o.length&&(i.fw=o.join(",")),`${t}?${_s(i).slice(1)}`}async function q6(n){let e=await j6(n),t=Li().gapi;return K(t,n,"internal-error"),e.open({where:document.body,url:W6(n),messageHandlersFilter:t.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:$6,dontclear:!0},i=>new Promise(async(r,o)=>{await i.restyle({setHideOnLeave:!1});let s=Is(n,"network-request-failed"),a=Li().setTimeout(()=>{o(s)},B6.get());function c(){Li().clearTimeout(a),r(i)}i.ping(c).then(c,()=>{o(s)})}))}var G6={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},Y6=500,K6=600,Q6="_blank",Z6="http://localhost",vm=class{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}};function X6(n,e,t,i=Y6,r=K6){let o=Math.max((window.screen.availHeight-r)/2,0).toString(),s=Math.max((window.screen.availWidth-i)/2,0).toString(),a="",c=Object.assign(Object.assign({},G6),{width:i.toString(),height:r.toString(),top:o,left:s}),l=Ut().toLowerCase();t&&(a=Y1(l)?Q6:t),q1(l)&&(e=e||Z6,c.scrollbars="yes");let u=Object.entries(c).reduce((f,[h,g])=>`${f}${h}=${g},`,"");if(V8(l)&&a!=="_self")return J6(e||"",a),new vm(null);let d=window.open(e||"",a,u);K(d,n,"popup-blocked");try{d.focus()}catch{}return new vm(d)}function J6(n,e){let t=document.createElement("a");t.href=n,t.target=e;let i=document.createEvent("MouseEvent");i.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),t.dispatchEvent(i)}var eq="__/auth/handler",tq="emulator/auth/handler",nq=encodeURIComponent("fac");async function P1(n,e,t,i,r,o){K(n.config.authDomain,n,"auth-domain-config-required"),K(n.config.apiKey,n,"invalid-api-key");let s={apiKey:n.config.apiKey,appName:n.name,authType:t,redirectUrl:i,v:Xr,eventId:r};if(e instanceof hm){e.setDefaultLanguage(n.languageCode),s.providerId=e.providerId||"",wu(e.getCustomParameters())||(s.customParameters=JSON.stringify(e.getCustomParameters()));for(let[u,d]of Object.entries(o||{}))s[u]=d}if(e instanceof q0){let u=e.getScopes().filter(d=>d!=="");u.length>0&&(s.scopes=u.join(","))}n.tenantId&&(s.tid=n.tenantId);let a=s;for(let u of Object.keys(a))a[u]===void 0&&delete a[u];let c=await n._getAppCheckToken(),l=c?`#${nq}=${encodeURIComponent(c)}`:"";return`${iq(n)}?${_s(a).slice(1)}${l}`}function iq({config:n}){return n.emulator?nw(n,tq):`https://${n.authDomain}/${eq}`}var O0="webStorageSupport",J0=class{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=hw,this._completeRedirectFn=A6,this._overrideRedirectResult=D6}async _openPopup(e,t,i,r){var o;oo((o=this.eventManagers[e._key()])===null||o===void 0?void 0:o.manager,"_initialize() not called before _openPopup()");let s=await P1(e,t,i,P0(),r);return X6(e,s,lN())}async _openRedirect(e,t,i,r){await this._originValidation(e);let o=await P1(e,t,i,P0(),r);return u6(o),new Promise(()=>{})}_initialize(e){let t=e._key();if(this.eventManagers[t]){let{manager:r,promise:o}=this.eventManagers[t];return r?Promise.resolve(r):(oo(o,"If manager is not set, promise should be"),o)}let i=this.initAndGetManager(e);return this.eventManagers[t]={promise:i},i.catch(()=>{delete this.eventManagers[t]}),i}async initAndGetManager(e){let t=await q6(e),i=new X0(e);return t.register("authEvent",r=>(K(r?.authEvent,e,"invalid-auth-event"),{status:i.onEvent(r.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:i},this.iframes[e._key()]=t,i}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send(O0,{type:O0},r=>{var o;let s=(o=r?.[0])===null||o===void 0?void 0:o[O0];s!==void 0&&t(!!s),Fi(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){let t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=P6(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return J1()||G1()||sw()}},mN=J0;var L1="@firebase/auth",F1="1.10.8";var ew=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}async getToken(e){return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{accessToken:await this.auth.currentUser.getIdToken(e)}:null}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;let t=this.auth.onIdTokenChanged(i=>{e(i?.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(){K(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}};function rq(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 oq(n){oi(new Xt("auth",(e,{options:t})=>{let i=e.getProvider("app").getImmediate(),r=e.getProvider("heartbeat"),o=e.getProvider("app-check-internal"),{apiKey:s,authDomain:a}=i.options;K(s&&!s.includes(":"),"invalid-api-key",{appName:i.name});let c={apiKey:s,authDomain:a,clientPlatform:n,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:eN(n)},l=new H0(i,r,o,c);return q8(l,t),l},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,i)=>{e.getProvider("auth-internal").initialize()})),oi(new Xt("auth-internal",e=>{let t=vc(e.getProvider("auth").getImmediate());return(i=>new ew(i))(t)},"PRIVATE").setInstantiationMode("EXPLICIT")),Je(L1,F1,rq(n)),Je(L1,F1,"esm2017")}var sq=300,aq=u0("authIdTokenMaxAge")||sq,V1=null,cq=n=>async e=>{let t=e&&await e.getIdTokenResult(),i=t&&(new Date().getTime()-Date.parse(t.issuedAtTime))/1e3;if(i&&i>aq)return;let r=t?.token;V1!==r&&(V1=r,await fetch(n,{method:r?"POST":"DELETE",headers:r?{Authorization:`Bearer ${r}`}:{}}))};function pw(n=Es()){let e=hc(n,"auth");if(e.isInitialized())return e.getImmediate();let t=aw(n,{popupRedirectResolver:mN,persistence:[hN,cN,hw]}),i=u0("authTokenSyncURL");if(i&&typeof isSecureContext=="boolean"&&isSecureContext){let o=new URL(i,location.origin);if(location.origin===o.origin){let s=cq(o.toString());dw(t,s,()=>s(t.currentUser)),bm(t,a=>s(a))}}let r=c0("auth");return r&&cw(t,`http://${r}`),t}function lq(){var n,e;return(e=(n=document.getElementsByTagName("head"))===null||n===void 0?void 0:n[0])!==null&&e!==void 0?e:document}H8({loadJS(n){return new Promise((e,t)=>{let i=document.createElement("script");i.setAttribute("src",n),i.onload=e,i.onerror=r=>{let o=Is("internal-error");o.customData=r,t(o)},i.type="text/javascript",i.charset="UTF-8",lq().appendChild(i)})},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="});oq("Browser");function vN(n){return new Y(function(e){var t=Em(n,e.next.bind(e),e.error.bind(e),e.complete.bind(e));return{unsubscribe:t}})}var yN="auth",xs=class{constructor(e){return e}},Uu=class{constructor(){return mc(yN)}};var mw=new P("angularfire2.auth-instances");function Zq(n,e){let t=Au(yN,n,e);return t&&new xs(t)}function Xq(n){return(e,t)=>{let i=e.runOutsideAngular(()=>n(t));return new xs(i)}}var Jq={provide:Uu,deps:[[new sn,mw]]},eG={provide:xs,useFactory:Zq,deps:[[new sn,mw],hr]};function _N(n,...e){return Je("angularfire",Jr.full,"auth"),It([eG,Jq,{provide:mw,useFactory:Xq(n),multi:!0,deps:[pe,Ye,eo,Cs,[new sn,gc],...e]}])}var bN=St(vN,!0);var EN=St(pw,!0);var wN=St(uw,!0,2);var CN=St(fw,!0,2);var IN="@firebase/database",SN="1.0.20";var _C="";function nG(n){_C=n}var Cw=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),lt(t))}get(e){let t=this.domStorage_.getItem(this.prefixedName_(e));return t==null?null:lc(t)}remove(e){this.domStorage_.removeItem(this.prefixedName_(e))}prefixedName_(e){return this.prefix_+e}toString(){return this.domStorage_.toString()}};var Iw=class{constructor(){this.cache_={},this.isInMemoryStorage=!0}set(e,t){t==null?delete this.cache_[e]:this.cache_[e]=t}get(e){return jn(this.cache_,e)?this.cache_[e]:null}remove(e){delete this.cache_[e]}};var nO=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 Cw(e)}}catch{}return new Iw},Ms=nO("localStorage"),Sw=nO("sessionStorage");var bc=new Oi("@firebase/database"),iO=(function(){let n=1;return function(){return n++}})(),rO=function(n){let e=Gk(n),t=new Wp;t.update(e);let i=t.digest();return uc.encodeByteArray(i)},cd=function(...n){let e="";for(let t=0;t{document.readyState==="complete"&&t()}),window.attachEvent("onload",t))}},wc="[MIN_NAME]",ks="[MAX_NAME]",Ps=function(n,e){if(n===e)return 0;if(n===wc||e===ks)return-1;if(e===wc||n===ks)return 1;{let t=TN(n),i=TN(e);return t!==null?i!==null?t-i===0?n.length-e.length:t-i:-1:i!==null?1:nt?i.push(n.substring(r,t)):i.push(n.substring(r,r+e));return i};function Tt(n,e){for(let t in n)n.hasOwnProperty(t)&&e(t,n[t])}var sO=function(n){M(!bC(n),"Invalid JSON number");let e=11,t=52,i=(1<=Math.pow(2,1-i)?(a=Math.min(Math.floor(Math.log(n)/Math.LN2),i),o=a+i,s=Math.round(n*Math.pow(2,t-a)-Math.pow(2,t))):(o=0,s=Math.round(n/Math.pow(2,1-i-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(r?1:0),l.reverse();let u=l.join(""),d="";for(c=0;c<64;c+=8){let f=parseInt(u.substr(c,8),2).toString(16);f.length===1&&(f="0"+f),d=d+f}return d.toLowerCase()},aG=function(){return!!(typeof window=="object"&&window.chrome&&window.chrome.extension&&!/^chrome/.test(window.location.href))},cG=function(){return typeof Windows=="object"&&typeof Windows.UI=="object"};function lG(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 i=new Error(n+" at "+e._path.toString()+": "+t);return i.code=n.toUpperCase(),i}var uG=new RegExp("^-?(0*)\\d{1,10}$"),dG=-2147483648,fG=2147483647,TN=function(n){if(uG.test(n)){let e=Number(n);if(e>=dG&&e<=fG)return e}return null},Rc=function(n){try{n()}catch(e){setTimeout(()=>{let t=e.stack||"";throw en("Exception was thrown by user callback.",t),e},Math.floor(0))}},hG=function(){return(typeof window=="object"&&window.navigator&&window.navigator.userAgent||"").search(/googlebot|google webmaster tools|bingbot|yahoo! slurp|baiduspider|yandexbot|duckduckbot/i)>=0},Gu=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 Tw=class{constructor(e,t){this.appCheckProvider=t,this.appName=e.name,Dn(e)&&e.settings.appCheckToken&&(this.serverAppAppCheckToken=e.settings.appCheckToken),this.appCheck=t?.getImmediate({optional:!0}),this.appCheck||t?.get().then(i=>this.appCheck=i)}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,i)=>{setTimeout(()=>{this.appCheck?this.getToken(e).then(t,i):t(null)},0)})}addTokenChangeListener(e){var t;(t=this.appCheckProvider)===null||t===void 0||t.get().then(i=>i.addTokenListener(e))}notifyForInvalidToken(){en(`Provided AppCheck credentials for the app named "${this.appName}" are invalid. This usually indicates your app was not initialized correctly.`)}};var xw=class{constructor(e,t,i){this.appName_=e,this.firebaseOptions_=t,this.authProvider_=i,this.auth_=null,this.auth_=i.getImmediate({optional:!0}),this.auth_||i.onInit(r=>this.auth_=r)}getToken(e){return this.auth_?this.auth_.getToken(e).catch(t=>t&&t.code==="auth/token-not-initialized"?(Dt("Got auth/token-not-initialized error. Treating as null token."),null):Promise.reject(t)):new Promise((t,i)=>{setTimeout(()=>{this.auth_?this.getToken(e).then(t,i):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/.',en(e)}},Yu=(()=>{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})(),Im="5",aO="v",cO="s",lO="r",uO="f",dO=/(console\.firebase|firebase-console-\w+\.corp|firebase\.corp)\.google\.com/,fO="ls",hO="p",Aw="ac",pO="websocket",mO="long_polling";var Sm=class{constructor(e,t,i,r,o=!1,s="",a=!1,c=!1,l=null){this.secure=t,this.namespace=i,this.webSocketOnly=r,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=Ms.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()&&Ms.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 pG(n){return n.host!==n.internalHost||n.isCustomHost()||n.includeNamespaceInQueryParams}function gO(n,e,t){M(typeof e=="string","typeof type must == string"),M(typeof t=="object","typeof params must == object");let i;if(e===pO)i=(n.secure?"wss://":"ws://")+n.internalHost+"/.ws?";else if(e===mO)i=(n.secure?"https://":"http://")+n.internalHost+"/.lp?";else throw new Error("Unknown connection type: "+e);pG(n)&&(t.ns=n.namespace);let r=[];return Tt(t,(o,s)=>{r.push(o+"="+s)}),i+r.join("&")}var Mw=class{constructor(){this.counters_={}}incrementCounter(e,t=1){jn(this.counters_,e)||(this.counters_[e]=0),this.counters_[e]+=t}get(){return Ok(this.counters_)}};var gw={},vw={};function wC(n){let e=n.toString();return gw[e]||(gw[e]=new Mw),gw[e]}function mG(n,e){let t=n.toString();return vw[t]||(vw[t]=e()),vw[t]}var Rw=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.onMessage_(i[r])});if(this.currentResponseNum===this.closeAfterResponse){this.onClose&&(this.onClose(),this.onClose=null);break}this.currentResponseNum++}}};var xN="start",gG="close",vG="pLPCommand",yG="pRTLPCB",vO="id",yO="pw",_O="ser",_G="cb",bG="seg",EG="ts",wG="d",CG="dframe",bO=1870,EO=30,IG=bO-EO,SG=25e3,DG=3e4,kw=class n{constructor(e,t,i,r,o,s,a){this.connId=e,this.repoInfo=t,this.applicationId=i,this.appCheckToken=r,this.authToken=o,this.transportSessionId=s,this.lastSessionId=a,this.bytesSent=0,this.bytesReceived=0,this.everConnected_=!1,this.log_=ld(e),this.stats_=wC(t),this.urlFn=c=>(this.appCheckToken&&(c[Aw]=this.appCheckToken),gO(t,mO,c))}open(e,t){this.curSegmentNum=0,this.onDisconnect_=t,this.myPacketOrderer=new Rw(e),this.isClosed_=!1,this.connectTimeoutTimer_=setTimeout(()=>{this.log_("Timed out trying to connect."),this.onClosed_(),this.connectTimeoutTimer_=null},Math.floor(DG)),oG(()=>{if(this.isClosed_)return;this.scriptTagHolder=new Nw((...o)=>{let[s,a,c,l,u]=o;if(this.incrementIncomingBytes_(o),!!this.scriptTagHolder)if(this.connectTimeoutTimer_&&(clearTimeout(this.connectTimeoutTimer_),this.connectTimeoutTimer_=null),this.everConnected_=!0,s===xN)this.id=a,this.password=c;else if(s===gG)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 i={};i[xN]="t",i[_O]=Math.floor(Math.random()*1e8),this.scriptTagHolder.uniqueCallbackIdentifier&&(i[_G]=this.scriptTagHolder.uniqueCallbackIdentifier),i[aO]=Im,this.transportSessionId&&(i[cO]=this.transportSessionId),this.lastSessionId&&(i[fO]=this.lastSessionId),this.applicationId&&(i[hO]=this.applicationId),this.appCheckToken&&(i[Aw]=this.appCheckToken),typeof location<"u"&&location.hostname&&dO.test(location.hostname)&&(i[lO]=uO);let r=this.urlFn(i);this.log_("Connecting via long-poll to "+r),this.scriptTagHolder.addTag(r,()=>{})})}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 ki()?!1:n.forceAllow_?!0:!n.forceDisallow_&&typeof document<"u"&&document.createElement!=null&&!aG()&&!cG()}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=lt(e);this.bytesSent+=t.length,this.stats_.incrementCounter("bytes_sent",t.length);let i=s0(t),r=oO(i,IG);for(let o=0;odocument.domain="'+document.domain+'";<\/script>');let s=""+o+"";try{this.myIFrame.doc.open(),this.myIFrame.doc.write(s),this.myIFrame.doc.close()}catch(a){Dt("frame writing exception"),a.stack&&Dt(a.stack),Dt(a)}}}static createIFrame_(){let e=document.createElement("iframe");if(e.style.display="none",document.body){document.body.appendChild(e);try{e.contentWindow.document||Dt("No IE domain setting required")}catch{let i=document.domain;e.src="javascript:void((function(){document.open();document.domain='"+i+"';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[vO]=this.myID,e[yO]=this.myPW,e[_O]=this.currentSerial;let t=this.urlFn(e),i="",r=0;for(;this.pendingSegs.length>0&&this.pendingSegs[0].d.length+EO+i.length<=bO;){let s=this.pendingSegs.shift();i=i+"&"+bG+r+"="+s.seg+"&"+EG+r+"="+s.ts+"&"+wG+r+"="+s.d,r++}return t=t+i,this.addLongPollTag_(t,this.currentSerial),!0}else return!1}enqueueSegment(e,t,i){this.pendingSegs.push({seg:e,ts:t,d:i}),this.alive&&this.newRequest_()}addLongPollTag_(e,t){this.outstandingRequests.add(t);let i=()=>{this.outstandingRequests.delete(t),this.newRequest_()},r=setTimeout(i,Math.floor(SG)),o=()=>{clearTimeout(r),i()};this.addTag(e,o)}addTag(e,t){ki()?this.doNodeLongPoll(e,t):setTimeout(()=>{try{if(!this.sendNewPolls)return;let i=this.myIFrame.doc.createElement("script");i.type="text/javascript",i.async=!0,i.src=e,i.onload=i.onreadystatechange=function(){let r=i.readyState;(!r||r==="loaded"||r==="complete")&&(i.onload=i.onreadystatechange=null,i.parentNode&&i.parentNode.removeChild(i),t())},i.onerror=()=>{Dt("Long-poll script failed to load: "+e),this.sendNewPolls=!1,this.close()},this.myIFrame.doc.body.appendChild(i)}catch{}},Math.floor(1))}};var TG=16384,xG=45e3,Dm=null;typeof MozWebSocket<"u"?Dm=MozWebSocket:typeof WebSocket<"u"&&(Dm=WebSocket);var $u=(()=>{class n{constructor(t,i,r,o,s,a,c){this.connId=t,this.applicationId=r,this.appCheckToken=o,this.authToken=s,this.keepaliveTimer=null,this.frames=null,this.totalFrames=0,this.bytesSent=0,this.bytesReceived=0,this.log_=ld(this.connId),this.stats_=wC(i),this.connURL=n.connectionURL_(i,a,c,o,r),this.nodeAdmin=i.nodeAdmin}static connectionURL_(t,i,r,o,s){let a={};return a[aO]=Im,!ki()&&typeof location<"u"&&location.hostname&&dO.test(location.hostname)&&(a[lO]=uO),i&&(a[cO]=i),r&&(a[fO]=r),o&&(a[Aw]=o),s&&(a[hO]=s),gO(t,pO,a)}open(t,i){this.onDisconnect=i,this.onMessage=t,this.log_("Websocket connecting to "+this.connURL),this.everConnected_=!1,Ms.set("previous_websocket_failure",!0);try{let r;if(ki()){let o=this.nodeAdmin?"AdminNode":"Node";r={headers:{"User-Agent":`Firebase/${Im}/${_C}/${process.platform}/${o}`,"X-Firebase-GMPID":this.applicationId||""}},this.authToken&&(r.headers.Authorization=`Bearer ${this.authToken}`),this.appCheckToken&&(r.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&&(r.proxy={origin:a})}this.mySock=new Dm(this.connURL,[],r)}catch(r){this.log_("Error instantiating WebSocket.");let o=r.message||r.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=r=>{this.handleIncomingFrame(r)},this.mySock.onerror=r=>{this.log_("WebSocket error. Closing connection.");let o=r.message||r.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 i=/Android ([0-9]{0,}\.[0-9]{0,})/,r=navigator.userAgent.match(i);r&&r.length>1&&parseFloat(r[1])<4.4&&(t=!0)}return!t&&Dm!==null&&!n.forceDisallow_}static previouslyFailed(){return Ms.isInMemoryStorage||Ms.get("previous_websocket_failure")===!0}markConnectionHealthy(){Ms.remove("previous_websocket_failure")}appendFrame_(t){if(this.frames.push(t),this.frames.length===this.totalFrames){let i=this.frames.join("");this.frames=null;let r=lc(i);this.onMessage(r)}}handleNewFrameCount_(t){this.totalFrames=t,this.frames=[]}extractFrameCount_(t){if(M(this.frames===null,"We already have a frame buffer"),t.length<=6){let i=Number(t);if(!isNaN(i))return this.handleNewFrameCount_(i),null}return this.handleNewFrameCount_(1),t}handleIncomingFrame(t){if(this.mySock===null)return;let i=t.data;if(this.bytesReceived+=i.length,this.stats_.incrementCounter("bytes_received",i.length),this.resetKeepAlive(),this.frames!==null)this.appendFrame_(i);else{let r=this.extractFrameCount_(i);r!==null&&this.appendFrame_(r)}}send(t){this.resetKeepAlive();let i=lt(t);this.bytesSent+=i.length,this.stats_.incrementCounter("bytes_sent",i.length);let r=oO(i,TG);r.length>1&&this.sendString_(String(r.length));for(let o=0;o{this.mySock&&this.sendString_("0"),this.resetKeepAlive()},Math.floor(xG))}sendString_(t){try{this.mySock.send(t)}catch(i){this.log_("Exception thrown from WebSocket.send():",i.message||i.data,"Closing connection."),setTimeout(this.onClosed_.bind(this),0)}}}n.responsesRequiredToBeHealthy=2,n.healthyTimeout=3e4;return n})(),AG=(()=>{class n{static get ALL_TRANSPORTS(){return[kw,$u]}static get IS_TRANSPORT_INITIALIZED(){return this.globalTransportInitialized_}constructor(t){this.initTransports_(t)}initTransports_(t){let i=$u&&$u.isAvailable(),r=i&&!$u.previouslyFailed();if(t.webSocketOnly&&(i||en("wss:// URL used, but browser isn't known to support websockets. Trying anyway."),r=!0),r)this.transports_=[$u];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})(),MG=6e4,RG=5e3,kG=10*1024,NG=100*1024,yw="t",AN="d",OG="s",MN="r",PG="e",RN="o",kN="a",NN="n",ON="p",LG="h",Ow=class{constructor(e,t,i,r,o,s,a,c,l,u){this.id=e,this.repoInfo_=t,this.applicationId_=i,this.appCheckToken_=r,this.authToken_=o,this.onMessage_=s,this.onReady_=a,this.onDisconnect_=c,this.onKill_=l,this.lastSessionId=u,this.connectionCount=0,this.pendingDataMessages=[],this.state_=0,this.log_=ld("c:"+this.id+":"),this.transportManager_=new AG(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_),i=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,i)},Math.floor(0));let r=e.healthyTimeout||0;r>0&&(this.healthyTimeout_=Gu(()=>{this.healthyTimeout_=null,this.isHealthy_||(this.conn_&&this.conn_.bytesReceived>NG?(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>kG?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(r)))}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(yw in e){let t=e[yw];t===kN?this.upgradeIfSecondaryHealthy_():t===MN?(this.log_("Got a reset on secondary, closing it"),this.secondaryConn_.close(),(this.tx_===this.secondaryConn_||this.rx_===this.secondaryConn_)&&this.close()):t===RN&&(this.log_("got pong on secondary."),this.secondaryResponsesRequired_--,this.upgradeIfSecondaryHealthy_())}}onSecondaryMessageReceived_(e){let t=Hu("t",e),i=Hu("d",e);if(t==="c")this.onSecondaryControl_(i);else if(t==="d")this.pendingDataMessages.push(i);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:ON,d:{}}}))}proceedWithUpgrade_(){this.secondaryConn_.start(),this.log_("sending client ack on secondary"),this.secondaryConn_.send({t:"c",d:{t:kN,d:{}}}),this.log_("Ending transmission on primary"),this.conn_.send({t:"c",d:{t:NN,d:{}}}),this.tx_=this.secondaryConn_,this.tryCleanupConnection()}onPrimaryMessageReceived_(e){let t=Hu("t",e),i=Hu("d",e);t==="c"?this.onControl_(i):t==="d"&&this.onDataMessage_(i)}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=Hu(yw,e);if(AN in e){let i=e[AN];if(t===LG){let r=Object.assign({},i);this.repoInfo_.isUsingEmulator&&(r.h=this.repoInfo_.host),this.onHandshake_(r)}else if(t===NN){this.log_("recvd end transmission on primary"),this.rx_=this.secondaryConn_;for(let r=0;r{this.secondaryConn_&&(this.log_("Timed out trying to upgrade."),this.secondaryConn_.close())},Math.floor(MG))}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):Gu(()=>{this.sendPingOnPrimaryIfNecessary_()},Math.floor(RG))}sendPingOnPrimaryIfNecessary_(){!this.isHealthy_&&this.state_===1&&(this.log_("sending ping on primary."),this.sendData_({t:"c",d:{t:ON,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()&&(Ms.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 Tm=class{put(e,t,i,r){}merge(e,t,i,r){}refreshAuthToken(e){}refreshAppCheckToken(e){}onDisconnectPut(e,t,i){}onDisconnectMerge(e,t,i){}onDisconnectCancel(e,t){}reportStats(e){}};var xm=class{constructor(e){this.allowedEvents_=e,this.listeners_={},M(Array.isArray(e)&&e.length>0,"Requires a non-empty array")}trigger(e,...t){if(Array.isArray(this.listeners_[e])){let i=[...this.listeners_[e]];for(let r=0;rt===e),"Unknown event: "+e)}};var Am=class n extends xm{static getInstance(){return new n}constructor(){super(["online"]),this.online_=!0,typeof window<"u"&&typeof window.addEventListener<"u"&&!Eu()&&(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 M(e==="online","Unknown event type: "+e),[this.online_]}currentlyOnline(){return this.online_}};var PN=32,LN=768,De=class{constructor(e,t){if(t===void 0){this.pieces_=e.split("/");let i=0;for(let r=0;r0&&(this.pieces_[i]=this.pieces_[r],i++);this.pieces_.length=i,this.pieceNum_=0}else this.pieces_=e,this.pieceNum_=t}toString(){let e="";for(let t=this.pieceNum_;t=n.pieces_.length?null:n.pieces_[n.pieceNum_]}function uo(n){return n.pieces_.length-n.pieceNum_}function Fe(n){let e=n.pieceNum_;return e=n.pieces_.length)return null;let e=[];for(let t=n.pieceNum_;t0&&t.push(i[r])}return new De(t,0)}function de(n){return n.pieceNum_>=n.pieces_.length}function Jt(n,e){let t=ce(n),i=ce(e);if(t===null)return e;if(t===i)return Jt(Fe(n),Fe(e));throw new Error("INTERNAL ERROR: innerPath ("+e+") is not within outerPath ("+n+")")}function VG(n,e){let t=Xu(n,0),i=Xu(e,0);for(let r=0;ruo(e))return!1;for(;t0&&(n.byteLength_+=1),n.parts_.push(e),n.byteLength_+=Su(e),CO(n)}function BG(n){let e=n.parts_.pop();n.byteLength_-=Su(e),n.parts_.length>0&&(n.byteLength_-=1)}function CO(n){if(n.byteLength_>LN)throw new Error(n.errorPrefix_+"has a key path longer than "+LN+" bytes ("+n.byteLength_+").");if(n.parts_.length>PN)throw new Error(n.errorPrefix_+"path specified exceeds the maximum depth that can be written ("+PN+") or object contains a cycle "+As(n))}function As(n){return n.parts_.length===0?"":"in property '"+n.parts_.join(".")+"'"}var Lw=class n extends xm{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 i=!document[e];i!==this.visible_&&(this.visible_=i,this.trigger("visible",i))},!1)}getInitialEvent(e){return M(e==="visible","Unknown event type: "+e),[this.visible_]}};var zu=1e3,UG=300*1e3,FN=30*1e3,HG=1.3,$G=3e4,zG="server_kill",VN=3,SC=(()=>{class n extends Tm{constructor(t,i,r,o,s,a,c,l){if(super(),this.repoInfo_=t,this.applicationId_=i,this.onDataUpdate_=r,this.onConnectStatus_=o,this.onServerInfoUpdate_=s,this.authTokenProvider_=a,this.appCheckTokenProvider_=c,this.authOverride_=l,this.id=n.nextPersistentConnectionId_++,this.log_=ld("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_=zu,this.maxReconnectDelay_=UG,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&&!ki())throw new Error("Auth override specified in options, but not supported on non Node.js platforms");Lw.getInstance().on("visible",this.onVisible_,this),t.host.indexOf("fblocal")===-1&&Am.getInstance().on("online",this.onOnline_,this)}sendRequest(t,i,r){let o=++this.requestNumber_,s={r:o,a:t,b:i};this.log_(lt(s)),M(this.connected_,"sendRequest call when we're not connected not allowed."),this.realtime_.sendRequest(s),r&&(this.requestCBHash_[o]=r)}get(t){this.initConnection_();let i=new Sn,o={action:"g",request:{p:t._path.toString(),q:t._queryObject},onComplete:a=>{let c=a.d;a.s==="ok"?i.resolve(c):i.reject(c)}};this.outstandingGets_.push(o),this.outstandingGetCount_++;let s=this.outstandingGets_.length-1;return this.connected_&&this.sendGet_(s),i.promise}listen(t,i,r,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),M(t._queryParams.isDefault()||!t._queryParams.loadsAllData(),"listen() called for non-default but complete query"),M(!this.listens.get(a).has(s),"listen() called twice for same path/queryId.");let c={onComplete:o,hashFn:i,query:t,tag:r};this.listens.get(a).set(s,c),this.connected_&&this.sendListen_(c)}sendGet_(t){let i=this.outstandingGets_[t];this.sendRequest("g",i.request,r=>{delete this.outstandingGets_[t],this.outstandingGetCount_--,this.outstandingGetCount_===0&&(this.outstandingGets_=[]),i.onComplete&&i.onComplete(r)})}sendListen_(t){let i=t.query,r=i._path.toString(),o=i._queryIdentifier;this.log_("Listen on "+r+" for "+o);let s={p:r},a="q";t.tag&&(s.q=i._queryObject,s.t=t.tag),s.h=t.hashFn(),this.sendRequest(a,s,c=>{let l=c.d,u=c.s;n.warnOnListenWarnings_(l,i),(this.listens.get(r)&&this.listens.get(r).get(o))===t&&(this.log_("listen response",c),u!=="ok"&&this.removeListen_(r,o),t.onComplete&&t.onComplete(u,l))})}static warnOnListenWarnings_(t,i){if(t&&typeof t=="object"&&jn(t,"w")){let r=Qr(t,"w");if(Array.isArray(r)&&~r.indexOf("no_index")){let o='".indexOn": "'+i._queryParams.getIndex().toString()+'"',s=i._path.toString();en(`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||Wk(t))&&(this.log_("Admin auth credential detected. Reducing max reconnect time."),this.maxReconnectDelay_=FN)}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_,i=zk(t)?"auth":"gauth",r={cred:t};this.authOverride_===null?r.noauth=!0:typeof this.authOverride_=="object"&&(r.authvar=this.authOverride_),this.sendRequest(i,r,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 i=t.s,r=t.d||"error";i==="ok"?this.invalidAppCheckTokenCount_=0:this.onAppCheckRevoked_(i,r)})}unlisten(t,i){let r=t._path.toString(),o=t._queryIdentifier;this.log_("Unlisten called for "+r+" "+o),M(t._queryParams.isDefault()||!t._queryParams.loadsAllData(),"unlisten() called for non-default but complete query"),this.removeListen_(r,o)&&this.connected_&&this.sendUnlisten_(r,o,t._queryObject,i)}sendUnlisten_(t,i,r,o){this.log_("Unlisten on "+t+" for "+i);let s={p:t},a="n";o&&(s.q=r,s.t=o),this.sendRequest(a,s)}onDisconnectPut(t,i,r){this.initConnection_(),this.connected_?this.sendOnDisconnect_("o",t,i,r):this.onDisconnectRequestQueue_.push({pathString:t,action:"o",data:i,onComplete:r})}onDisconnectMerge(t,i,r){this.initConnection_(),this.connected_?this.sendOnDisconnect_("om",t,i,r):this.onDisconnectRequestQueue_.push({pathString:t,action:"om",data:i,onComplete:r})}onDisconnectCancel(t,i){this.initConnection_(),this.connected_?this.sendOnDisconnect_("oc",t,null,i):this.onDisconnectRequestQueue_.push({pathString:t,action:"oc",data:null,onComplete:i})}sendOnDisconnect_(t,i,r,o){let s={p:i,d:r};this.log_("onDisconnect "+t,s),this.sendRequest(t,s,a=>{o&&setTimeout(()=>{o(a.s,a.d)},Math.floor(0))})}put(t,i,r,o){this.putInternal("p",t,i,r,o)}merge(t,i,r,o){this.putInternal("m",t,i,r,o)}putInternal(t,i,r,o,s){this.initConnection_();let a={p:i,d:r};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: "+i)}sendPut_(t){let i=this.outstandingPuts_[t].action,r=this.outstandingPuts_[t].request,o=this.outstandingPuts_[t].onComplete;this.outstandingPuts_[t].queued=this.connected_,this.sendRequest(i,r,s=>{this.log_(i+" 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 i={c:t};this.log_("reportStats",i),this.sendRequest("s",i,r=>{if(r.s!=="ok"){let s=r.d;this.log_("reportStats","Error sending stats: "+s)}})}}onDataMessage_(t){if("r"in t){this.log_("from server: "+lt(t));let i=t.r,r=this.requestCBHash_[i];r&&(delete this.requestCBHash_[i],r(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,i){this.log_("handleServerMessage",t,i),t==="d"?this.onDataUpdate_(i.p,i.d,!1,i.t):t==="m"?this.onDataUpdate_(i.p,i.d,!0,i.t):t==="c"?this.onListenRevoked_(i.p,i.q):t==="ac"?this.onAuthRevoked_(i.s,i.d):t==="apc"?this.onAppCheckRevoked_(i.s,i.d):t==="sd"?this.onSecurityDebugPacket_(i):Dw("Unrecognized action received from server: "+lt(t)+` Are you using the latest client?`)}onReady_(t,i){this.log_("connection ready"),this.connected_=!0,this.lastConnectionEstablishedTime_=new Date().getTime(),this.handleTimestamp_(t),this.lastSessionId=i,this.firstConnection_&&this.sendConnectStats_(),this.restoreState_(),this.firstConnection_=!1,this.onConnectStatus_(!0)}scheduleConnect_(t){M(!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_=zu,this.realtime_||this.scheduleConnect_(0)),this.visible_=t}onOnline_(t){t?(this.log_("Browser went online."),this.reconnectDelay_=zu,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_>$G&&(this.reconnectDelay_=zu),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_),i=Math.max(0,this.reconnectDelay_-t);i=Math.random()*i,this.log_("Trying to reconnect in "+i+"ms"),this.scheduleConnect_(i),this.reconnectDelay_=Math.min(this.maxReconnectDelay_,this.reconnectDelay_*HG)}this.onConnectStatus_(!1)}async establishConnection_(){if(this.shouldReconnect_()){this.log_("Making a connection attempt"),this.lastConnectionAttemptTime_=new Date().getTime(),this.lastConnectionEstablishedTime_=null;let t=this.onDataMessage_.bind(this),i=this.onReady_.bind(this),r=this.onRealtimeDisconnect_.bind(this),o=this.id+":"+n.nextConnectionId_++,s=this.lastSessionId,a=!1,c=null,l=function(){c?c.close():(a=!0,r())},u=function(f){M(c,"sendRequest call when we're not connected not allowed."),c.sendRequest(f)};this.realtime_={close:l,sendRequest:u};let d=this.forceTokenRefresh_;this.forceTokenRefresh_=!1;try{let[f,h]=await Promise.all([this.authTokenProvider_.getToken(d),this.appCheckTokenProvider_.getToken(d)]);a?Dt("getToken() completed but was canceled"):(Dt("getToken() completed. Creating connection."),this.authToken_=f&&f.accessToken,this.appCheckToken_=h&&h.token,c=new Ow(o,this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,t,i,r,g=>{en(g+" ("+this.repoInfo_.toString()+")"),this.interrupt(zG)},s))}catch(f){this.log_("Failed to get token: "+f),a||(this.repoInfo_.nodeAdmin&&en(f),l())}}}interrupt(t){Dt("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){Dt("Resuming connection for reason: "+t),delete this.interruptReasons_[t],wu(this.interruptReasons_)&&(this.reconnectDelay_=zu,this.realtime_||this.scheduleConnect_(0))}handleTimestamp_(t){let i=t-new Date().getTime();this.onServerInfoUpdate_({serverTimeOffset:i})}cancelSentTransactions_(){for(let t=0;tEC(s)).join("$"):r="default";let o=this.removeListen_(t,r);o&&o.onComplete&&o.onComplete("permission_denied")}removeListen_(t,i){let r=new De(t).toString(),o;if(this.listens.has(r)){let s=this.listens.get(r);o=s.get(i),s.delete(i),s.size===0&&this.listens.delete(r)}else o=void 0;return o}onAuthRevoked_(t,i){Dt("Auth token revoked: "+t+"/"+i),this.authToken_=null,this.forceTokenRefresh_=!0,this.realtime_.close(),(t==="invalid_token"||t==="permission_denied")&&(this.invalidAuthTokenCount_++,this.invalidAuthTokenCount_>=VN&&(this.reconnectDelay_=FN,this.authTokenProvider_.notifyForInvalidToken()))}onAppCheckRevoked_(t,i){Dt("App check token revoked: "+t+"/"+i),this.appCheckToken_=null,this.forceTokenRefresh_=!0,(t==="invalid_token"||t==="permission_denied")&&(this.invalidAppCheckTokenCount_++,this.invalidAppCheckTokenCount_>=VN&&this.appCheckTokenProvider_.notifyForInvalidToken())}onSecurityDebugPacket_(t){this.securityDebugCallback_?this.securityDebugCallback_(t):"msg"in t&&console.log("FIREBASE: "+t.msg.replace(` `,` FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(let t of this.listens.values())for(let i of t.values())this.sendListen_(i);for(let t=0;t0}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}}},ai=(()=>{class n{constructor(t,i,r,o,s){this.key=t,this.value=i,this.color=r??n.RED,this.left=o??Un.EMPTY_NODE,this.right=s??Un.EMPTY_NODE}copy(t,i,r,o,s){return new n(t??this.key,i??this.value,r??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,i,r){let o=this,s=r(t,o.key);return s<0?o=o.copy(null,null,null,o.left.insert(t,i,r),null):s===0?o=o.copy(null,i,null,null,null):o=o.copy(null,null,null,null,o.right.insert(t,i,r)),o.fixUp_()}removeMin_(){if(this.left.isEmpty())return Un.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,i){let r,o;if(r=this,i(t,r.key)<0)!r.left.isEmpty()&&!r.left.isRed_()&&!r.left.left.isRed_()&&(r=r.moveRedLeft_()),r=r.copy(null,null,null,r.left.remove(t,i),null);else{if(r.left.isRed_()&&(r=r.rotateRight_()),!r.right.isEmpty()&&!r.right.isRed_()&&!r.right.left.isRed_()&&(r=r.moveRedRight_()),i(t,r.key)===0){if(r.right.isEmpty())return Un.EMPTY_NODE;o=r.right.min_(),r=r.copy(o.key,o.value,null,null,r.right.removeMin_())}r=r.copy(null,null,null,null,r.right.remove(t,i))}return r.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),i=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,t,i)}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})(),Fw=class{copy(e,t,i,r,o){return this}insert(e,t,i){return new ai(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}},Un=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,ai.BLACK,null,null))}remove(e){return new n(this.comparator_,this.root_.remove(e,this.comparator_).copy(null,null,ai.BLACK,null,null))}get(e){let t,i=this.root_;for(;!i.isEmpty();){if(t=this.comparator_(e,i.key),t===0)return i.value;t<0?i=i.left:t>0&&(i=i.right)}return null}getPredecessorKey(e){let t,i=this.root_,r=null;for(;!i.isEmpty();)if(t=this.comparator_(e,i.key),t===0){if(i.left.isEmpty())return r?r.key:null;for(i=i.left;!i.right.isEmpty();)i=i.right;return i.key}else t<0?i=i.left:t>0&&(r=i,i=i.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 _c(this.root_,null,this.comparator_,!1,e)}getIteratorFrom(e,t){return new _c(this.root_,e,this.comparator_,!1,t)}getReverseIteratorFrom(e,t){return new _c(this.root_,e,this.comparator_,!0,t)}getReverseIterator(e){return new _c(this.root_,null,this.comparator_,!0,e)}};Un.EMPTY_NODE=new Fw;function WG(n,e){return Ps(n.name,e.name)}function DC(n,e){return Ps(n,e)}var Vw;function qG(n){Vw=n}var IO=function(n){return typeof n=="number"?"number:"+sO(n):"string:"+n},SO=function(n){if(n.isLeafNode()){let e=n.val();M(typeof e=="string"||typeof e=="number"||typeof e=="object"&&jn(e,".sv"),"Priority must be a string or number.")}else M(n===Vw||n.isEmpty(),"priority of unexpected type.");M(n===Vw||n.getPriority().isEmpty(),"Priority nodes can't have a priority of their own.")};var jN,Ic=(()=>{class n{static set __childrenNodeConstructor(t){jN=t}static get __childrenNodeConstructor(){return jN}constructor(t,i=n.__childrenNodeConstructor.EMPTY_NODE){this.value_=t,this.priorityNode_=i,this.lazyHash_=null,M(this.value_!==void 0&&this.value_!==null,"LeafNode shouldn't be created with null/undefined value."),SO(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 de(t)?this:ce(t)===".priority"?this.priorityNode_:n.__childrenNodeConstructor.EMPTY_NODE}hasChild(){return!1}getPredecessorChildName(t,i){return null}updateImmediateChild(t,i){return t===".priority"?this.updatePriority(i):i.isEmpty()&&t!==".priority"?this:n.__childrenNodeConstructor.EMPTY_NODE.updateImmediateChild(t,i).updatePriority(this.priorityNode_)}updateChild(t,i){let r=ce(t);return r===null?i:i.isEmpty()&&r!==".priority"?this:(M(r!==".priority"||uo(t)===1,".priority must be the last token in a path"),this.updateImmediateChild(r,n.__childrenNodeConstructor.EMPTY_NODE.updateChild(Fe(t),i)))}isEmpty(){return!1}numChildren(){return 0}forEachChild(t,i){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:"+IO(this.priorityNode_.val())+":");let i=typeof this.value_;t+=i+":",i==="number"?t+=sO(this.value_):t+=this.value_,this.lazyHash_=rO(t)}return this.lazyHash_}getValue(){return this.value_}compareTo(t){return t===n.__childrenNodeConstructor.EMPTY_NODE?1:t instanceof n.__childrenNodeConstructor?-1:(M(t.isLeafNode(),"Unknown node type"),this.compareToLeafNode_(t))}compareToLeafNode_(t){let i=typeof t.value_,r=typeof this.value_,o=n.VALUE_TYPE_ORDER.indexOf(i),s=n.VALUE_TYPE_ORDER.indexOf(r);return M(o>=0,"Unknown leaf type: "+i),M(s>=0,"Unknown leaf type: "+r),o===s?r==="object"?0:this.value_parseInt(Math.log(o)/KG,10),i=o=>parseInt(Array(o+1).join("1"),2);this.count=t(e+1),this.current_=this.count-1;let r=i(this.count);this.bits_=e+1&r}nextBitIsOne(){let e=!(this.bits_&1<{let s=Qr(this.indexSet_,o);if(M(s,"Missing index implementation for "+o),r===yc)if(s.isDefinedOn(e.node)){let a=[],c=t.getIterator(le.Wrap),l=c.getNext();for(;l;)l.name!==e.name&&a.push(l),l=c.getNext();return a.push(e),Rm(a,s.getCompare())}else return yc;else{let a=t.get(e.name),c=r;return a&&(c=c.remove(new le(e.name,a))),c.insert(e,e.node)}});return new n(i,this.indexSet_)}removeFromIndexes(e,t){let i=Cu(this.indexes_,r=>{if(r===yc)return r;{let o=t.get(e.name);return o?r.remove(new le(e.name,o)):r}});return new n(i,this.indexSet_)}};var Wu,ee=(()=>{class n{static get EMPTY_NODE(){return Wu||(Wu=new n(new Un(DC),null,Sc.Default))}constructor(t,i,r){this.children_=t,this.priorityNode_=i,this.indexMap_=r,this.lazyHash_=null,this.priorityNode_&&SO(this.priorityNode_),this.children_.isEmpty()&&M(!this.priorityNode_||this.priorityNode_.isEmpty(),"An empty node cannot have a priority")}isLeafNode(){return!1}getPriority(){return this.priorityNode_||Wu}updatePriority(t){return this.children_.isEmpty()?this:new n(this.children_,t,this.indexMap_)}getImmediateChild(t){if(t===".priority")return this.getPriority();{let i=this.children_.get(t);return i===null?Wu:i}}getChild(t){let i=ce(t);return i===null?this:this.getImmediateChild(i).getChild(Fe(t))}hasChild(t){return this.children_.get(t)!==null}updateImmediateChild(t,i){if(M(i,"We should always be passing snapshot nodes"),t===".priority")return this.updatePriority(i);{let r=new le(t,i),o,s;i.isEmpty()?(o=this.children_.remove(t),s=this.indexMap_.removeFromIndexes(r,this.children_)):(o=this.children_.insert(t,i),s=this.indexMap_.addToIndexes(r,this.children_));let a=o.isEmpty()?Wu:this.priorityNode_;return new n(o,a,s)}}updateChild(t,i){let r=ce(t);if(r===null)return i;{M(ce(t)!==".priority"||uo(t)===1,".priority must be the last token in a path");let o=this.getImmediateChild(r).updateChild(Fe(t),i);return this.updateImmediateChild(r,o)}}isEmpty(){return this.children_.isEmpty()}numChildren(){return this.children_.count()}val(t){if(this.isEmpty())return null;let i={},r=0,o=0,s=!0;if(this.forEachChild(Qe,(a,c)=>{i[a]=c.val(t),r++,s&&n.INTEGER_REGEXP_.test(a)?o=Math.max(o,Number(a)):s=!1}),!t&&s&&o<2*r){let a=[];for(let c in i)a[c]=i[c];return a}else return t&&!this.getPriority().isEmpty()&&(i[".priority"]=this.getPriority().val()),i}hash(){if(this.lazyHash_===null){let t="";this.getPriority().isEmpty()||(t+="priority:"+IO(this.getPriority().val())+":"),this.forEachChild(Qe,(i,r)=>{let o=r.hash();o!==""&&(t+=":"+i+":"+o)}),this.lazyHash_=t===""?"":rO(t)}return this.lazyHash_}getPredecessorChildName(t,i,r){let o=this.resolveIndex_(r);if(o){let s=o.getPredecessorKey(new le(t,i));return s?s.name:null}else return this.children_.getPredecessorKey(t)}getFirstChildName(t){let i=this.resolveIndex_(t);if(i){let r=i.minKey();return r&&r.name}else return this.children_.minKey()}getFirstChild(t){let i=this.getFirstChildName(t);return i?new le(i,this.children_.get(i)):null}getLastChildName(t){let i=this.resolveIndex_(t);if(i){let r=i.maxKey();return r&&r.name}else return this.children_.maxKey()}getLastChild(t){let i=this.getLastChildName(t);return i?new le(i,this.children_.get(i)):null}forEachChild(t,i){let r=this.resolveIndex_(t);return r?r.inorderTraversal(o=>i(o.name,o.node)):this.children_.inorderTraversal(i)}getIterator(t){return this.getIteratorFrom(t.minPost(),t)}getIteratorFrom(t,i){let r=this.resolveIndex_(i);if(r)return r.getIteratorFrom(t,o=>o);{let o=this.children_.getIteratorFrom(t.name,le.Wrap),s=o.peek();for(;s!=null&&i.compare(s,t)<0;)o.getNext(),s=o.peek();return o}}getReverseIterator(t){return this.getReverseIteratorFrom(t.maxPost(),t)}getReverseIteratorFrom(t,i){let r=this.resolveIndex_(i);if(r)return r.getReverseIteratorFrom(t,o=>o);{let o=this.children_.getReverseIteratorFrom(t.name,le.Wrap),s=o.peek();for(;s!=null&&i.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===ud?-1:0}withIndex(t){if(t===Ec||this.indexMap_.hasIndex(t))return this;{let i=this.indexMap_.addIndex(t,this.children_);return new n(this.children_,this.priorityNode_,i)}}isIndexed(t){return t===Ec||this.indexMap_.hasIndex(t)}equals(t){if(t===this)return!0;if(t.isLeafNode())return!1;{let i=t;if(this.getPriority().equals(i.getPriority()))if(this.children_.count()===i.children_.count()){let r=this.getIterator(Qe),o=i.getIterator(Qe),s=r.getNext(),a=o.getNext();for(;s&&a;){if(s.name!==a.name||!s.node.equals(a.node))return!1;s=r.getNext(),a=o.getNext()}return s===null&&a===null}else return!1;else return!1}}resolveIndex_(t){return t===Ec?null:this.indexMap_.get(t.toString())}}return n.INTEGER_REGEXP_=/^(0|[1-9]\d*)$/,n})(),Uw=class extends ee{constructor(){super(new Un(DC),ee.EMPTY_NODE,Sc.Default)}compareTo(e){return e===this?0:1}equals(e){return e===this}getPriority(){return this}getImmediateChild(e){return ee.EMPTY_NODE}isEmpty(){return!1}},ud=new Uw;Object.defineProperties(le,{MIN:{value:new le(wc,ee.EMPTY_NODE)},MAX:{value:new le(ks,ud)}});Mm.__EMPTY_NODE=ee.EMPTY_NODE;Ic.__childrenNodeConstructor=ee;qG(ud);YG(ud);var QG=!0;function dt(n,e=null){if(n===null)return ee.EMPTY_NODE;if(typeof n=="object"&&".priority"in n&&(e=n[".priority"]),M(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 Ic(t,dt(e))}if(!(n instanceof Array)&&QG){let t=[],i=!1;if(Tt(n,(s,a)=>{if(s.substring(0,1)!=="."){let c=dt(a);c.isEmpty()||(i=i||!c.getPriority().isEmpty(),t.push(new le(s,c)))}}),t.length===0)return ee.EMPTY_NODE;let o=Rm(t,WG,s=>s.name,DC);if(i){let s=Rm(t,Qe.getCompare());return new ee(o,dt(e),new Sc({".priority":s},{".priority":Qe}))}else return new ee(o,dt(e),Sc.Default)}else{let t=ee.EMPTY_NODE;return Tt(n,(i,r)=>{if(jn(n,i)&&i.substring(0,1)!=="."){let o=dt(r);(o.isLeafNode()||!o.isEmpty())&&(t=t.updateImmediateChild(i,o))}}),t.updatePriority(dt(e))}}GG(dt);var Hw=class extends Cc{constructor(e){super(),this.indexPath_=e,M(!de(e)&&ce(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 i=this.extractChild(e.node),r=this.extractChild(t.node),o=i.compareTo(r);return o===0?Ps(e.name,t.name):o}makePost(e,t){let i=dt(e),r=ee.EMPTY_NODE.updateChild(this.indexPath_,i);return new le(t,r)}maxPost(){let e=ee.EMPTY_NODE.updateChild(this.indexPath_,ud);return new le(ks,e)}toString(){return Xu(this.indexPath_,0).join("/")}};var $w=class extends Cc{compare(e,t){let i=e.node.compareTo(t.node);return i===0?Ps(e.name,t.name):i}isDefinedOn(e){return!0}indexedValueChanged(e,t){return!e.equals(t)}minPost(){return le.MIN}maxPost(){return le.MAX}makePost(e,t){let i=dt(e);return new le(t,i)}toString(){return".value"}},ZG=new $w;function xO(n){return{type:"value",snapshotNode:n}}function Dc(n,e){return{type:"child_added",snapshotNode:e,childName:n}}function Ju(n,e){return{type:"child_removed",snapshotNode:e,childName:n}}function ed(n,e,t){return{type:"child_changed",snapshotNode:e,childName:n,oldSnap:t}}function XG(n,e){return{type:"child_moved",snapshotNode:e,childName:n}}var td=class{constructor(e){this.index_=e}updateChild(e,t,i,r,o,s){M(e.isIndexed(this.index_),"A node must be indexed if only a child is updated");let a=e.getImmediateChild(t);return a.getChild(r).equals(i.getChild(r))&&a.isEmpty()===i.isEmpty()||(s!=null&&(i.isEmpty()?e.hasChild(t)?s.trackChildChange(Ju(t,a)):M(e.isLeafNode(),"A child remove without an old child only makes sense on a leaf node"):a.isEmpty()?s.trackChildChange(Dc(t,i)):s.trackChildChange(ed(t,i,a))),e.isLeafNode()&&i.isEmpty())?e:e.updateImmediateChild(t,i).withIndex(this.index_)}updateFullNode(e,t,i){return i!=null&&(e.isLeafNode()||e.forEachChild(Qe,(r,o)=>{t.hasChild(r)||i.trackChildChange(Ju(r,o))}),t.isLeafNode()||t.forEachChild(Qe,(r,o)=>{if(e.hasChild(r)){let s=e.getImmediateChild(r);s.equals(o)||i.trackChildChange(ed(r,o,s))}else i.trackChildChange(Dc(r,o))})),t.withIndex(this.index_)}updatePriority(e,t){return e.isEmpty()?ee.EMPTY_NODE:e.updatePriority(t)}filtersNodes(){return!1}getIndexedFilter(){return this}getIndex(){return this.index_}};var km=class n{constructor(e){this.indexedFilter_=new td(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,i=this.endIsInclusive_?this.index_.compare(e,this.getEndPost())<=0:this.index_.compare(e,this.getEndPost())<0;return t&&i}updateChild(e,t,i,r,o,s){return this.matches(new le(t,i))||(i=ee.EMPTY_NODE),this.indexedFilter_.updateChild(e,t,i,r,o,s)}updateFullNode(e,t,i){t.isLeafNode()&&(t=ee.EMPTY_NODE);let r=t.withIndex(this.index_);r=r.updatePriority(ee.EMPTY_NODE);let o=this;return t.forEachChild(Qe,(s,a)=>{o.matches(new le(s,a))||(r=r.updateImmediateChild(s,ee.EMPTY_NODE))}),this.indexedFilter_.updateFullNode(e,r,i)}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 zw=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 i=this.index_.compare(this.rangedFilter_.getStartPost(),t);return this.startIsInclusive_?i<=0:i<0},this.withinEndPost=t=>{let i=this.index_.compare(t,this.rangedFilter_.getEndPost());return this.endIsInclusive_?i<=0:i<0},this.rangedFilter_=new km(e),this.index_=e.getIndex(),this.limit_=e.getLimit(),this.reverse_=!e.isViewFromLeft(),this.startIsInclusive_=!e.startAfterSet_,this.endIsInclusive_=!e.endBeforeSet_}updateChild(e,t,i,r,o,s){return this.rangedFilter_.matches(new le(t,i))||(i=ee.EMPTY_NODE),e.getImmediateChild(t).equals(i)?e:e.numChildren()d(h,f)}else s=this.index_.getCompare();let a=e;M(a.numChildren()===this.limit_,"");let c=new le(t,i),l=this.reverse_?a.getFirstChild(this.index_):a.getLastChild(this.index_),u=this.rangedFilter_.matches(c);if(a.hasChild(t)){let d=a.getImmediateChild(t),f=r.getChildAfterChild(this.index_,l,this.reverse_);for(;f!=null&&(f.name===t||a.hasChild(f.name));)f=r.getChildAfterChild(this.index_,f,this.reverse_);let h=f==null?1:s(f,c);if(u&&!i.isEmpty()&&h>=0)return o?.trackChildChange(ed(t,i,d)),a.updateImmediateChild(t,i);{o?.trackChildChange(Ju(t,d));let y=a.updateImmediateChild(t,ee.EMPTY_NODE);return f!=null&&this.rangedFilter_.matches(f)?(o?.trackChildChange(Dc(f.name,f.node)),y.updateImmediateChild(f.name,f.node)):y}}else return i.isEmpty()?e:u&&s(l,c)>=0?(o!=null&&(o.trackChildChange(Ju(l.name,l.node)),o.trackChildChange(Dc(t,i))),a.updateImmediateChild(t,i).updateImmediateChild(l.name,ee.EMPTY_NODE)):e}};var Ww=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_=Qe}hasStart(){return this.startSet_}isViewFromLeft(){return this.viewFrom_===""?this.startSet_:this.viewFrom_==="l"}getIndexStartValue(){return M(this.startSet_,"Only valid if start has been set"),this.indexStartValue_}getIndexStartName(){return M(this.startSet_,"Only valid if start has been set"),this.startNameSet_?this.indexStartName_:wc}hasEnd(){return this.endSet_}getIndexEndValue(){return M(this.endSet_,"Only valid if end has been set"),this.indexEndValue_}getIndexEndName(){return M(this.endSet_,"Only valid if end has been set"),this.endNameSet_?this.indexEndName_:ks}hasLimit(){return this.limitSet_}hasAnchoredLimit(){return this.limitSet_&&this.viewFrom_!==""}getLimit(){return M(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_===Qe}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 JG(n){return n.loadsAllData()?new td(n.getIndex()):n.hasLimit()?new zw(n):new km(n)}function BN(n){let e={};if(n.isDefault())return e;let t;if(n.index_===Qe?t="$priority":n.index_===ZG?t="$value":n.index_===Ec?t="$key":(M(n.index_ instanceof Hw,"Unrecognized index type!"),t=n.index_.toString()),e.orderBy=lt(t),n.startSet_){let i=n.startAfterSet_?"startAfter":"startAt";e[i]=lt(n.indexStartValue_),n.startNameSet_&&(e[i]+=","+lt(n.indexStartName_))}if(n.endSet_){let i=n.endBeforeSet_?"endBefore":"endAt";e[i]=lt(n.indexEndValue_),n.endNameSet_&&(e[i]+=","+lt(n.indexEndName_))}return n.limitSet_&&(n.isViewFromLeft()?e.limitToFirst=n.limit_:e.limitToLast=n.limit_),e}function UN(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_!==Qe&&(e.i=n.index_.toString()),e}var qw=class n extends Tm{reportStats(e){throw new Error("Method not implemented.")}static getListenId_(e,t){return t!==void 0?"tag$"+t:(M(e._queryParams.isDefault(),"should have a tag if it's not a default query."),e._path.toString())}constructor(e,t,i,r){super(),this.repoInfo_=e,this.onDataUpdate_=t,this.authTokenProvider_=i,this.appCheckTokenProvider_=r,this.log_=ld("p:rest:"),this.listens_={}}listen(e,t,i,r){let o=e._path.toString();this.log_("Listen called for "+o+" "+e._queryIdentifier);let s=n.getListenId_(e,i),a={};this.listens_[s]=a;let c=BN(e._queryParams);this.restRequest_(o+".json",c,(l,u)=>{let d=u;if(l===404&&(d=null,l=null),l===null&&this.onDataUpdate_(o,d,!1,i),Qr(this.listens_,s)===a){let f;l?l===401?f="permission_denied":f="rest_error:"+l:f="ok",r(f,null)}})}unlisten(e,t){let i=n.getListenId_(e,t);delete this.listens_[i]}get(e){let t=BN(e._queryParams),i=e._path.toString(),r=new Sn;return this.restRequest_(i+".json",t,(o,s)=>{let a=s;o===404&&(a=null,o=null),o===null?(this.onDataUpdate_(i,a,!1,null),r.resolve(a)):r.reject(new Error(a))}),r.promise}refreshAuthToken(e){}restRequest_(e,t={},i){return t.format="export",Promise.all([this.authTokenProvider_.getToken(!1),this.appCheckTokenProvider_.getToken(!1)]).then(([r,o])=>{r&&r.accessToken&&(t.auth=r.accessToken),o&&o.token&&(t.ac=o.token);let s=(this.repoInfo_.secure?"https://":"http://")+this.repoInfo_.host+e+"?ns="+this.repoInfo_.namespace+_s(t);this.log_("Sending REST request for "+s);let a=new XMLHttpRequest;a.onreadystatechange=()=>{if(i&&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=lc(a.responseText)}catch{en("Failed to parse JSON response for "+s+": "+a.responseText)}i(null,c)}else a.status!==401&&a.status!==404&&en("Got unsuccessful REST response for "+s+" Status: "+a.status),i(a.status);i=null}},a.open("GET",s,!0),a.send()})}};var Gw=class{constructor(){this.rootNode_=ee.EMPTY_NODE}getNode(e){return this.rootNode_.getChild(e)}updateSnapshot(e,t){this.rootNode_=this.rootNode_.updateChild(e,t)}};function Nm(){return{value:null,children:new Map}}function AO(n,e,t){if(de(e))n.value=t,n.children.clear();else if(n.value!==null)n.value=n.value.updateChild(e,t);else{let i=ce(e);n.children.has(i)||n.children.set(i,Nm());let r=n.children.get(i);e=Fe(e),AO(r,e,t)}}function Yw(n,e,t){n.value!==null?t(e,n.value):e7(n,(i,r)=>{let o=new De(e.toString()+"/"+i);Yw(r,o,t)})}function e7(n,e){n.children.forEach((t,i)=>{e(i,t)})}var Kw=class{constructor(e){this.collection_=e,this.last_=null}get(){let e=this.collection_.get(),t=Object.assign({},e);return this.last_&&Tt(this.last_,(i,r)=>{t[i]=t[i]-r}),this.last_=e,t}};var HN=10*1e3,t7=30*1e3,n7=300*1e3,Qw=class{constructor(e,t){this.server_=t,this.statsToReport_={},this.statsListener_=new Kw(e);let i=HN+(t7-HN)*Math.random();Gu(this.reportStats_.bind(this),Math.floor(i))}reportStats_(){let e=this.statsListener_.get(),t={},i=!1;Tt(e,(r,o)=>{o>0&&jn(this.statsToReport_,r)&&(t[r]=o,i=!0)}),i&&this.server_.reportStats(t),Gu(this.reportStats_.bind(this),Math.floor(Math.random()*2*n7))}};var Vi=(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})(Vi||{});function TC(){return{fromUser:!0,fromServer:!1,queryId:null,tagged:!1}}function xC(){return{fromUser:!1,fromServer:!0,queryId:null,tagged:!1}}function AC(n){return{fromUser:!1,fromServer:!0,queryId:n,tagged:!0}}var Zw=class n{constructor(e,t,i){this.path=e,this.affectedTree=t,this.revert=i,this.type=Vi.ACK_USER_WRITE,this.source=TC()}operationForChild(e){if(de(this.path)){if(this.affectedTree.value!=null)return M(this.affectedTree.children.isEmpty(),"affectedTree should not have overlapping affected paths."),this;{let t=this.affectedTree.subtree(new De(e));return new n(_e(),t,this.revert)}}else return M(ce(this.path)===e,"operationForChild called for unrelated child."),new n(Fe(this.path),this.affectedTree,this.revert)}};var Om=class n{constructor(e,t){this.source=e,this.path=t,this.type=Vi.LISTEN_COMPLETE}operationForChild(e){return de(this.path)?new n(this.source,_e()):new n(this.source,Fe(this.path))}};var Tc=class n{constructor(e,t,i){this.source=e,this.path=t,this.snap=i,this.type=Vi.OVERWRITE}operationForChild(e){return de(this.path)?new n(this.source,_e(),this.snap.getImmediateChild(e)):new n(this.source,Fe(this.path),this.snap)}};var nd=class n{constructor(e,t,i){this.source=e,this.path=t,this.children=i,this.type=Vi.MERGE}operationForChild(e){if(de(this.path)){let t=this.children.subtree(new De(e));return t.isEmpty()?null:t.value?new Tc(this.source,_e(),t.value):new n(this.source,_e(),t)}else return M(ce(this.path)===e,"Can't get a merge for a child not on the path of the operation"),new n(this.source,Fe(this.path),this.children)}toString(){return"Operation("+this.path+": "+this.source.toString()+" merge: "+this.children.toString()+")"}};var ji=class{constructor(e,t,i){this.node_=e,this.fullyInitialized_=t,this.filtered_=i}isFullyInitialized(){return this.fullyInitialized_}isFiltered(){return this.filtered_}isCompleteForPath(e){if(de(e))return this.isFullyInitialized()&&!this.filtered_;let t=ce(e);return this.isCompleteForChild(t)}isCompleteForChild(e){return this.isFullyInitialized()&&!this.filtered_||this.node_.hasChild(e)}getNode(){return this.node_}};var Xw=class{constructor(e){this.query_=e,this.index_=this.query_._queryParams.getIndex()}};function i7(n,e,t,i){let r=[],o=[];return e.forEach(s=>{s.type==="child_changed"&&n.index_.indexedValueChanged(s.oldSnap,s.snapshotNode)&&o.push(XG(s.childName,s.snapshotNode))}),qu(n,r,"child_removed",e,i,t),qu(n,r,"child_added",e,i,t),qu(n,r,"child_moved",o,i,t),qu(n,r,"child_changed",e,i,t),qu(n,r,"value",e,i,t),r}function qu(n,e,t,i,r,o){let s=i.filter(a=>a.type===t);s.sort((a,c)=>o7(n,a,c)),s.forEach(a=>{let c=r7(n,a,o);r.forEach(l=>{l.respondsTo(a.type)&&e.push(l.createEvent(c,n.query_))})})}function r7(n,e,t){return e.type==="value"||e.type==="child_removed"||(e.prevName=t.getPredecessorChildName(e.childName,e.snapshotNode,n.index_)),e}function o7(n,e,t){if(e.childName==null||t.childName==null)throw ys("Should only compare child_ events.");let i=new le(e.childName,e.snapshotNode),r=new le(t.childName,t.snapshotNode);return n.index_.compare(i,r)}function Gm(n,e){return{eventCache:n,serverCache:e}}function Ku(n,e,t,i){return Gm(new ji(e,t,i),n.serverCache)}function MO(n,e,t,i){return Gm(n.eventCache,new ji(e,t,i))}function Pm(n){return n.eventCache.isFullyInitialized()?n.eventCache.getNode():null}function Ns(n){return n.serverCache.isFullyInitialized()?n.serverCache.getNode():null}var bw,s7=()=>(bw||(bw=new Un(sG)),bw),tn=class n{static fromObject(e){let t=new n(null);return Tt(e,(i,r)=>{t=t.set(new De(i),r)}),t}constructor(e,t=s7()){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:_e(),value:this.value};if(de(e))return null;{let i=ce(e),r=this.children.get(i);if(r!==null){let o=r.findRootMostMatchingPathAndValue(Fe(e),t);return o!=null?{path:et(new De(i),o.path),value:o.value}:null}else return null}}findRootMostValueAndPath(e){return this.findRootMostMatchingPathAndValue(e,()=>!0)}subtree(e){if(de(e))return this;{let t=ce(e),i=this.children.get(t);return i!==null?i.subtree(Fe(e)):new n(null)}}set(e,t){if(de(e))return new n(t,this.children);{let i=ce(e),o=(this.children.get(i)||new n(null)).set(Fe(e),t),s=this.children.insert(i,o);return new n(this.value,s)}}remove(e){if(de(e))return this.children.isEmpty()?new n(null):new n(null,this.children);{let t=ce(e),i=this.children.get(t);if(i){let r=i.remove(Fe(e)),o;return r.isEmpty()?o=this.children.remove(t):o=this.children.insert(t,r),this.value===null&&o.isEmpty()?new n(null):new n(this.value,o)}else return this}}get(e){if(de(e))return this.value;{let t=ce(e),i=this.children.get(t);return i?i.get(Fe(e)):null}}setTree(e,t){if(de(e))return t;{let i=ce(e),o=(this.children.get(i)||new n(null)).setTree(Fe(e),t),s;return o.isEmpty()?s=this.children.remove(i):s=this.children.insert(i,o),new n(this.value,s)}}fold(e){return this.fold_(_e(),e)}fold_(e,t){let i={};return this.children.inorderTraversal((r,o)=>{i[r]=o.fold_(et(e,r),t)}),t(e,this.value,i)}findOnPath(e,t){return this.findOnPath_(e,_e(),t)}findOnPath_(e,t,i){let r=this.value?i(t,this.value):!1;if(r)return r;if(de(e))return null;{let o=ce(e),s=this.children.get(o);return s?s.findOnPath_(Fe(e),et(t,o),i):null}}foreachOnPath(e,t){return this.foreachOnPath_(e,_e(),t)}foreachOnPath_(e,t,i){if(de(e))return this;{this.value&&i(t,this.value);let r=ce(e),o=this.children.get(r);return o?o.foreachOnPath_(Fe(e),et(t,r),i):new n(null)}}foreach(e){this.foreach_(_e(),e)}foreach_(e,t){this.children.inorderTraversal((i,r)=>{r.foreach_(et(e,i),t)}),this.value&&t(e,this.value)}foreachChild(e){this.children.inorderTraversal((t,i)=>{i.value&&e(t,i.value)})}};var ci=class n{constructor(e){this.writeTree_=e}static empty(){return new n(new tn(null))}};function Qu(n,e,t){if(de(e))return new ci(new tn(t));{let i=n.writeTree_.findRootMostValueAndPath(e);if(i!=null){let r=i.path,o=i.value,s=Jt(r,e);return o=o.updateChild(s,t),new ci(n.writeTree_.set(r,o))}else{let r=new tn(t),o=n.writeTree_.setTree(e,r);return new ci(o)}}}function Jw(n,e,t){let i=n;return Tt(t,(r,o)=>{i=Qu(i,et(e,r),o)}),i}function $N(n,e){if(de(e))return ci.empty();{let t=n.writeTree_.setTree(e,new tn(null));return new ci(t)}}function eC(n,e){return Ls(n,e)!=null}function Ls(n,e){let t=n.writeTree_.findRootMostValueAndPath(e);return t!=null?n.writeTree_.get(t.path).getChild(Jt(t.path,e)):null}function zN(n){let e=[],t=n.writeTree_.value;return t!=null?t.isLeafNode()||t.forEachChild(Qe,(i,r)=>{e.push(new le(i,r))}):n.writeTree_.children.inorderTraversal((i,r)=>{r.value!=null&&e.push(new le(i,r.value))}),e}function co(n,e){if(de(e))return n;{let t=Ls(n,e);return t!=null?new ci(new tn(t)):new ci(n.writeTree_.subtree(e))}}function tC(n){return n.writeTree_.isEmpty()}function xc(n,e){return RO(_e(),n.writeTree_,e)}function RO(n,e,t){if(e.value!=null)return t.updateChild(n,e.value);{let i=null;return e.children.inorderTraversal((r,o)=>{r===".priority"?(M(o.value!==null,"Priority writes must always be leaf nodes"),i=o.value):t=RO(et(n,r),o,t)}),!t.getChild(n).isEmpty()&&i!==null&&(t=t.updateChild(et(n,".priority"),i)),t}}function Ym(n,e){return PO(e,n)}function a7(n,e,t,i,r){M(i>n.lastWriteId,"Stacking an older write on top of newer ones"),r===void 0&&(r=!0),n.allWrites.push({path:e,snap:t,writeId:i,visible:r}),r&&(n.visibleWrites=Qu(n.visibleWrites,e,t)),n.lastWriteId=i}function c7(n,e,t,i){M(i>n.lastWriteId,"Stacking an older merge on top of newer ones"),n.allWrites.push({path:e,children:t,writeId:i,visible:!0}),n.visibleWrites=Jw(n.visibleWrites,e,t),n.lastWriteId=i}function l7(n,e){for(let t=0;ta.writeId===e);M(t>=0,"removeWrite called with nonexistent writeId.");let i=n.allWrites[t];n.allWrites.splice(t,1);let r=i.visible,o=!1,s=n.allWrites.length-1;for(;r&&s>=0;){let a=n.allWrites[s];a.visible&&(s>=t&&d7(a,i.path)?r=!1:Bn(i.path,a.path)&&(o=!0)),s--}if(r){if(o)return f7(n),!0;if(i.snap)n.visibleWrites=$N(n.visibleWrites,i.path);else{let a=i.children;Tt(a,c=>{n.visibleWrites=$N(n.visibleWrites,et(i.path,c))})}return!0}else return!1}function d7(n,e){if(n.snap)return Bn(n.path,e);for(let t in n.children)if(n.children.hasOwnProperty(t)&&Bn(et(n.path,t),e))return!0;return!1}function f7(n){n.visibleWrites=kO(n.allWrites,h7,_e()),n.allWrites.length>0?n.lastWriteId=n.allWrites[n.allWrites.length-1].writeId:n.lastWriteId=-1}function h7(n){return n.visible}function kO(n,e,t){let i=ci.empty();for(let r=0;r{i=i.updateImmediateChild(o,s)}),i;if(t){let o=co(n.visibleWrites,e);return t.forEachChild(Qe,(s,a)=>{let c=xc(co(o,new De(s)),a);i=i.updateImmediateChild(s,c)}),zN(o).forEach(s=>{i=i.updateImmediateChild(s.name,s.node)}),i}else{let o=co(n.visibleWrites,e);return zN(o).forEach(s=>{i=i.updateImmediateChild(s.name,s.node)}),i}}function m7(n,e,t,i,r){M(i||r,"Either existingEventSnap or existingServerSnap must exist");let o=et(e,t);if(eC(n.visibleWrites,o))return null;{let s=co(n.visibleWrites,o);return tC(s)?r.getChild(t):xc(s,r.getChild(t))}}function g7(n,e,t,i){let r=et(e,t),o=Ls(n.visibleWrites,r);if(o!=null)return o;if(i.isCompleteForChild(t)){let s=co(n.visibleWrites,r);return xc(s,i.getNode().getImmediateChild(t))}else return null}function v7(n,e){return Ls(n.visibleWrites,e)}function y7(n,e,t,i,r,o,s){let a,c=co(n.visibleWrites,e),l=Ls(c,_e());if(l!=null)a=l;else if(t!=null)a=xc(c,t);else return[];if(a=a.withIndex(s),!a.isEmpty()&&!a.isLeafNode()){let u=[],d=s.getCompare(),f=o?a.getReverseIteratorFrom(i,s):a.getIteratorFrom(i,s),h=f.getNext();for(;h&&u.length0||!n.eventCache.isFullyInitialized()||r&&!i.getNode().equals(o)||!i.getNode().getPriority().equals(o.getPriority()))&&t.push(xO(Pm(e)))}}function FO(n,e,t,i,r,o){let s=e.eventCache;if(Fm(i,t)!=null)return e;{let a,c;if(de(t))if(M(e.serverCache.isFullyInitialized(),"If change path is empty, we must have complete server data"),e.serverCache.isFiltered()){let l=Ns(e),u=l instanceof ee?l:ee.EMPTY_NODE,d=MC(i,u);a=n.filter.updateFullNode(e.eventCache.getNode(),d,o)}else{let l=Lm(i,Ns(e));a=n.filter.updateFullNode(e.eventCache.getNode(),l,o)}else{let l=ce(t);if(l===".priority"){M(uo(t)===1,"Can't have a priority with additional path components");let u=s.getNode();c=e.serverCache.getNode();let d=WN(i,t,u,c);d!=null?a=n.filter.updatePriority(u,d):a=s.getNode()}else{let u=Fe(t),d;if(s.isCompleteForChild(l)){c=e.serverCache.getNode();let f=WN(i,t,s.getNode(),c);f!=null?d=s.getNode().getImmediateChild(l).updateChild(u,f):d=s.getNode().getImmediateChild(l)}else d=RC(i,l,e.serverCache);d!=null?a=n.filter.updateChild(s.getNode(),l,d,u,r,o):a=s.getNode()}}return Ku(e,a,s.isFullyInitialized()||de(t),n.filter.filtersNodes())}}function Vm(n,e,t,i,r,o,s,a){let c=e.serverCache,l,u=s?n.filter:n.filter.getIndexedFilter();if(de(t))l=u.updateFullNode(c.getNode(),i,null);else if(u.filtersNodes()&&!c.isFiltered()){let h=c.getNode().updateChild(t,i);l=u.updateFullNode(c.getNode(),h,null)}else{let h=ce(t);if(!c.isCompleteForPath(t)&&uo(t)>1)return e;let g=Fe(t),_=c.getNode().getImmediateChild(h).updateChild(g,i);h===".priority"?l=u.updatePriority(c.getNode(),_):l=u.updateChild(c.getNode(),h,_,g,LO,null)}let d=MO(e,l,c.isFullyInitialized()||de(t),u.filtersNodes()),f=new id(r,d,o);return FO(n,d,t,r,f,a)}function rC(n,e,t,i,r,o,s){let a=e.eventCache,c,l,u=new id(r,e,o);if(de(t))l=n.filter.updateFullNode(e.eventCache.getNode(),i,s),c=Ku(e,l,!0,n.filter.filtersNodes());else{let d=ce(t);if(d===".priority")l=n.filter.updatePriority(e.eventCache.getNode(),i),c=Ku(e,l,a.isFullyInitialized(),a.isFiltered());else{let f=Fe(t),h=a.getNode().getImmediateChild(d),g;if(de(f))g=i;else{let y=u.getCompleteChild(d);y!=null?CC(f)===".priority"&&y.getChild(wO(f)).isEmpty()?g=y:g=y.updateChild(f,i):g=ee.EMPTY_NODE}if(h.equals(g))c=e;else{let y=n.filter.updateChild(a.getNode(),d,g,f,u,s);c=Ku(e,y,a.isFullyInitialized(),n.filter.filtersNodes())}}}return c}function qN(n,e){return n.eventCache.isCompleteForChild(e)}function S7(n,e,t,i,r,o,s){let a=e;return i.foreach((c,l)=>{let u=et(t,c);qN(e,ce(u))&&(a=rC(n,a,u,l,r,o,s))}),i.foreach((c,l)=>{let u=et(t,c);qN(e,ce(u))||(a=rC(n,a,u,l,r,o,s))}),a}function GN(n,e,t){return t.foreach((i,r)=>{e=e.updateChild(i,r)}),e}function oC(n,e,t,i,r,o,s,a){if(e.serverCache.getNode().isEmpty()&&!e.serverCache.isFullyInitialized())return e;let c=e,l;de(t)?l=i:l=new tn(null).setTree(t,i);let u=e.serverCache.getNode();return l.children.inorderTraversal((d,f)=>{if(u.hasChild(d)){let h=e.serverCache.getNode().getImmediateChild(d),g=GN(n,h,f);c=Vm(n,c,new De(d),g,r,o,s,a)}}),l.children.inorderTraversal((d,f)=>{let h=!e.serverCache.isCompleteForChild(d)&&f.value===null;if(!u.hasChild(d)&&!h){let g=e.serverCache.getNode().getImmediateChild(d),y=GN(n,g,f);c=Vm(n,c,new De(d),y,r,o,s,a)}}),c}function D7(n,e,t,i,r,o,s){if(Fm(r,t)!=null)return e;let a=e.serverCache.isFiltered(),c=e.serverCache;if(i.value!=null){if(de(t)&&c.isFullyInitialized()||c.isCompleteForPath(t))return Vm(n,e,t,c.getNode().getChild(t),r,o,a,s);if(de(t)){let l=new tn(null);return c.getNode().forEachChild(Ec,(u,d)=>{l=l.set(new De(u),d)}),oC(n,e,t,l,r,o,a,s)}else return e}else{let l=new tn(null);return i.foreach((u,d)=>{let f=et(t,u);c.isCompleteForPath(f)&&(l=l.set(u,c.getNode().getChild(f)))}),oC(n,e,t,l,r,o,a,s)}}function T7(n,e,t,i,r){let o=e.serverCache,s=MO(e,o.getNode(),o.isFullyInitialized()||de(t),o.isFiltered());return FO(n,s,t,i,LO,r)}function x7(n,e,t,i,r,o){let s;if(Fm(i,t)!=null)return e;{let a=new id(i,e,r),c=e.eventCache.getNode(),l;if(de(t)||ce(t)===".priority"){let u;if(e.serverCache.isFullyInitialized())u=Lm(i,Ns(e));else{let d=e.serverCache.getNode();M(d instanceof ee,"serverChildren would be complete if leaf node"),u=MC(i,d)}u=u,l=n.filter.updateFullNode(c,u,o)}else{let u=ce(t),d=RC(i,u,e.serverCache);d==null&&e.serverCache.isCompleteForChild(u)&&(d=c.getImmediateChild(u)),d!=null?l=n.filter.updateChild(c,u,d,Fe(t),a,o):e.eventCache.getNode().hasChild(u)?l=n.filter.updateChild(c,u,ee.EMPTY_NODE,Fe(t),a,o):l=c,l.isEmpty()&&e.serverCache.isFullyInitialized()&&(s=Lm(i,Ns(e)),s.isLeafNode()&&(l=n.filter.updateFullNode(l,s,o)))}return s=e.serverCache.isFullyInitialized()||Fm(i,_e())!=null,Ku(e,l,s,n.filter.filtersNodes())}}var sC=class{constructor(e,t){this.query_=e,this.eventRegistrations_=[];let i=this.query_._queryParams,r=new td(i.getIndex()),o=JG(i);this.processor_=E7(o);let s=t.serverCache,a=t.eventCache,c=r.updateFullNode(ee.EMPTY_NODE,s.getNode(),null),l=o.updateFullNode(ee.EMPTY_NODE,a.getNode(),null),u=new ji(c,s.isFullyInitialized(),r.filtersNodes()),d=new ji(l,a.isFullyInitialized(),o.filtersNodes());this.viewCache_=Gm(d,u),this.eventGenerator_=new Xw(this.query_)}get query(){return this.query_}};function A7(n){return n.viewCache_.serverCache.getNode()}function M7(n){return Pm(n.viewCache_)}function R7(n,e){let t=Ns(n.viewCache_);return t&&(n.query._queryParams.loadsAllData()||!de(e)&&!t.getImmediateChild(ce(e)).isEmpty())?t.getChild(e):null}function YN(n){return n.eventRegistrations_.length===0}function k7(n,e){n.eventRegistrations_.push(e)}function KN(n,e,t){let i=[];if(t){M(e==null,"A cancel should cancel all event registrations.");let r=n.query._path;n.eventRegistrations_.forEach(o=>{let s=o.createCancelEvent(t,r);s&&i.push(s)})}if(e){let r=[];for(let o=0;o{i.push(Dc(o,s))}),t.isFullyInitialized()&&i.push(xO(t.getNode())),VO(n,i,t.getNode(),e)}function VO(n,e,t,i){let r=i?[i]:n.eventRegistrations_;return i7(n.eventGenerator_,e,t,r)}var jm,Bm=class{constructor(){this.views=new Map}};function O7(n){M(!jm,"__referenceConstructor has already been defined"),jm=n}function P7(){return M(jm,"Reference.ts has not been loaded"),jm}function L7(n){return n.views.size===0}function kC(n,e,t,i){let r=e.source.queryId;if(r!==null){let o=n.views.get(r);return M(o!=null,"SyncTree gave us an op for an invalid query."),QN(o,e,t,i)}else{let o=[];for(let s of n.views.values())o=o.concat(QN(s,e,t,i));return o}}function jO(n,e,t,i,r){let o=e._queryIdentifier,s=n.views.get(o);if(!s){let a=Lm(t,r?i:null),c=!1;a?c=!0:i instanceof ee?(a=MC(t,i),c=!1):(a=ee.EMPTY_NODE,c=!1);let l=Gm(new ji(a,c,!1),new ji(i,r,!1));return new sC(e,l)}return s}function F7(n,e,t,i,r,o){let s=jO(n,e,i,r,o);return n.views.has(e._queryIdentifier)||n.views.set(e._queryIdentifier,s),k7(s,t),N7(s,t)}function V7(n,e,t,i){let r=e._queryIdentifier,o=[],s=[],a=fo(n);if(r==="default")for(let[c,l]of n.views.entries())s=s.concat(KN(l,t,i)),YN(l)&&(n.views.delete(c),l.query._queryParams.loadsAllData()||o.push(l.query));else{let c=n.views.get(r);c&&(s=s.concat(KN(c,t,i)),YN(c)&&(n.views.delete(r),c.query._queryParams.loadsAllData()||o.push(c.query)))}return a&&!fo(n)&&o.push(new(P7())(e._repo,e._path)),{removed:o,events:s}}function BO(n){let e=[];for(let t of n.views.values())t.query._queryParams.loadsAllData()||e.push(t);return e}function lo(n,e){let t=null;for(let i of n.views.values())t=t||R7(i,e);return t}function UO(n,e){if(e._queryParams.loadsAllData())return Km(n);{let i=e._queryIdentifier;return n.views.get(i)}}function HO(n,e){return UO(n,e)!=null}function fo(n){return Km(n)!=null}function Km(n){for(let e of n.views.values())if(e.query._queryParams.loadsAllData())return e;return null}var Um;function j7(n){M(!Um,"__referenceConstructor has already been defined"),Um=n}function B7(){return M(Um,"Reference.ts has not been loaded"),Um}var U7=1,Hm=class{constructor(e){this.listenProvider_=e,this.syncPointTree_=new tn(null),this.pendingWriteTree_=_7(),this.tagToQueryMap=new Map,this.queryToTagMap=new Map}};function NC(n,e,t,i,r){return a7(n.pendingWriteTree_,e,t,i,r),r?kc(n,new Tc(TC(),e,t)):[]}function H7(n,e,t,i){c7(n.pendingWriteTree_,e,t,i);let r=tn.fromObject(t);return kc(n,new nd(TC(),e,r))}function ao(n,e,t=!1){let i=l7(n.pendingWriteTree_,e);if(u7(n.pendingWriteTree_,e)){let o=new tn(null);return i.snap!=null?o=o.set(_e(),!0):Tt(i.children,s=>{o=o.set(new De(s),!0)}),kc(n,new Zw(i.path,o,t))}else return[]}function dd(n,e,t){return kc(n,new Tc(xC(),e,t))}function $7(n,e,t){let i=tn.fromObject(t);return kc(n,new nd(xC(),e,i))}function z7(n,e){return kc(n,new Om(xC(),e))}function W7(n,e,t){let i=OC(n,t);if(i){let r=PC(i),o=r.path,s=r.queryId,a=Jt(o,e),c=new Om(AC(s),a);return LC(n,o,c)}else return[]}function $m(n,e,t,i,r=!1){let o=e._path,s=n.syncPointTree_.get(o),a=[];if(s&&(e._queryIdentifier==="default"||HO(s,e))){let c=V7(s,e,t,i);L7(s)&&(n.syncPointTree_=n.syncPointTree_.remove(o));let l=c.removed;if(a=c.events,!r){let u=l.findIndex(f=>f._queryParams.loadsAllData())!==-1,d=n.syncPointTree_.findOnPath(o,(f,h)=>fo(h));if(u&&!d){let f=n.syncPointTree_.subtree(o);if(!f.isEmpty()){let h=Y7(f);for(let g=0;g0&&!i&&(u?n.listenProvider_.stopListening(Zu(e),null):l.forEach(f=>{let h=n.queryToTagMap.get(Zm(f));n.listenProvider_.stopListening(Zu(f),h)}))}K7(n,l)}return a}function $O(n,e,t,i){let r=OC(n,i);if(r!=null){let o=PC(r),s=o.path,a=o.queryId,c=Jt(s,e),l=new Tc(AC(a),c,t);return LC(n,s,l)}else return[]}function q7(n,e,t,i){let r=OC(n,i);if(r){let o=PC(r),s=o.path,a=o.queryId,c=Jt(s,e),l=tn.fromObject(t),u=new nd(AC(a),c,l);return LC(n,s,u)}else return[]}function aC(n,e,t,i=!1){let r=e._path,o=null,s=!1;n.syncPointTree_.foreachOnPath(r,(f,h)=>{let g=Jt(f,r);o=o||lo(h,g),s=s||fo(h)});let a=n.syncPointTree_.get(r);a?(s=s||fo(a),o=o||lo(a,_e())):(a=new Bm,n.syncPointTree_=n.syncPointTree_.set(r,a));let c;o!=null?c=!0:(c=!1,o=ee.EMPTY_NODE,n.syncPointTree_.subtree(r).foreachChild((h,g)=>{let y=lo(g,_e());y&&(o=o.updateImmediateChild(h,y))}));let l=HO(a,e);if(!l&&!e._queryParams.loadsAllData()){let f=Zm(e);M(!n.queryToTagMap.has(f),"View does not exist, but we have a tag");let h=Q7();n.queryToTagMap.set(f,h),n.tagToQueryMap.set(h,f)}let u=Ym(n.pendingWriteTree_,r),d=F7(a,e,t,u,o,c);if(!l&&!s&&!i){let f=UO(a,e);d=d.concat(Z7(n,e,f))}return d}function Qm(n,e,t){let r=n.pendingWriteTree_,o=n.syncPointTree_.findOnPath(e,(s,a)=>{let c=Jt(s,e),l=lo(a,c);if(l)return l});return NO(r,e,o,t,!0)}function G7(n,e){let t=e._path,i=null;n.syncPointTree_.foreachOnPath(t,(l,u)=>{let d=Jt(l,t);i=i||lo(u,d)});let r=n.syncPointTree_.get(t);r?i=i||lo(r,_e()):(r=new Bm,n.syncPointTree_=n.syncPointTree_.set(t,r));let o=i!=null,s=o?new ji(i,!0,!1):null,a=Ym(n.pendingWriteTree_,e._path),c=jO(r,e,a,o?s.getNode():ee.EMPTY_NODE,o);return M7(c)}function kc(n,e){return zO(e,n.syncPointTree_,null,Ym(n.pendingWriteTree_,_e()))}function zO(n,e,t,i){if(de(n.path))return WO(n,e,t,i);{let r=e.get(_e());t==null&&r!=null&&(t=lo(r,_e()));let o=[],s=ce(n.path),a=n.operationForChild(s),c=e.children.get(s);if(c&&a){let l=t?t.getImmediateChild(s):null,u=OO(i,s);o=o.concat(zO(a,c,l,u))}return r&&(o=o.concat(kC(r,n,i,t))),o}}function WO(n,e,t,i){let r=e.get(_e());t==null&&r!=null&&(t=lo(r,_e()));let o=[];return e.children.inorderTraversal((s,a)=>{let c=t?t.getImmediateChild(s):null,l=OO(i,s),u=n.operationForChild(s);u&&(o=o.concat(WO(u,a,c,l)))}),r&&(o=o.concat(kC(r,n,i,t))),o}function qO(n,e){let t=e.query,i=rd(n,t);return{hashFn:()=>(A7(e)||ee.EMPTY_NODE).hash(),onComplete:r=>{if(r==="ok")return i?W7(n,t._path,i):z7(n,t._path);{let o=lG(r,t);return $m(n,t,null,o)}}}}function rd(n,e){let t=Zm(e);return n.queryToTagMap.get(t)}function Zm(n){return n._path.toString()+"$"+n._queryIdentifier}function OC(n,e){return n.tagToQueryMap.get(e)}function PC(n){let e=n.indexOf("$");return M(e!==-1&&e{if(t&&fo(t))return[Km(t)];{let r=[];return t&&(r=BO(t)),Tt(i,(o,s)=>{r=r.concat(s)}),r}})}function Zu(n){return n._queryParams.loadsAllData()&&!n._queryParams.isDefault()?new(B7())(n._repo,n._path):n}function K7(n,e){for(let t=0;t{if(!de(l)&&u&&fo(u))return[Km(u).query];{let f=[];return u&&(f=f.concat(BO(u).map(h=>h.query))),Tt(d,(h,g)=>{f=f.concat(g)}),f}});for(let l=0;l{let l=VC(c,e.getImmediateChild(a),t);l!==c&&(o=o.updateImmediateChild(a,l))}),o}}var od=class{constructor(e="",t=null,i={children:{},childCount:0}){this.name=e,this.parent=t,this.node=i}};function Xm(n,e){let t=e instanceof De?e:new De(e),i=n,r=ce(t);for(;r!==null;){let o=Qr(i.node.children,r)||{children:{},childCount:0};i=new od(r,i,o),t=Fe(t),r=ce(t)}return i}function Fs(n){return n.node.value}function jC(n,e){n.node.value=e,uC(n)}function YO(n){return n.node.childCount>0}function t9(n){return Fs(n)===void 0&&!YO(n)}function Jm(n,e){Tt(n.node.children,(t,i)=>{e(new od(t,n,i))})}function KO(n,e,t,i){t&&!i&&e(n),Jm(n,r=>{KO(r,e,!0,i)}),t&&i&&e(n)}function n9(n,e,t){let i=t?n:n.parent;for(;i!==null;){if(e(i))return!0;i=i.parent}return!1}function fd(n){return new De(n.parent===null?n.name:fd(n.parent)+"/"+n.name)}function uC(n){n.parent!==null&&i9(n.parent,n.name,n)}function i9(n,e,t){let i=t9(t),r=jn(n.node.children,e);i&&r?(delete n.node.children[e],n.node.childCount--,uC(n)):!i&&!r&&(n.node.children[e]=t.node,n.node.childCount++,uC(n))}var r9=/[\[\].#$\/\u0000-\u001F\u007F]/,o9=/[\[\].#$\u0000-\u001F\u007F]/,Ew=10*1024*1024,BC=function(n){return typeof n=="string"&&n.length!==0&&!r9.test(n)},QO=function(n){return typeof n=="string"&&n.length!==0&&!o9.test(n)},s9=function(n){return n&&(n=n.replace(/^\/*\.info(\/|$)/,"/")),QO(n)},ZO=function(n){return n===null||typeof n=="string"||typeof n=="number"&&!bC(n)||n&&typeof n=="object"&&jn(n,".sv")},XO=function(n,e,t,i){i&&e===void 0||hd(Iu(n,"value"),e,t)},hd=function(n,e,t){let i=t instanceof De?new Pw(t,n):t;if(e===void 0)throw new Error(n+"contains undefined "+As(i));if(typeof e=="function")throw new Error(n+"contains a function "+As(i)+" with contents = "+e.toString());if(bC(e))throw new Error(n+"contains "+e.toString()+" "+As(i));if(typeof e=="string"&&e.length>Ew/3&&Su(e)>Ew)throw new Error(n+"contains a string greater than "+Ew+" utf8 bytes "+As(i)+" ('"+e.substring(0,50)+"...')");if(e&&typeof e=="object"){let r=!1,o=!1;if(Tt(e,(s,a)=>{if(s===".value")r=!0;else if(s!==".priority"&&s!==".sv"&&(o=!0,!BC(s)))throw new Error(n+" contains an invalid key ("+s+") "+As(i)+`. Keys must be non-empty strings and can't contain ".", "#", "$", "/", "[", or "]"`);jG(i,s),hd(n,a,i),BG(i)}),r&&o)throw new Error(n+' contains ".value" child '+As(i)+" in addition to actual children.")}},a9=function(n,e){let t,i;for(t=0;t{let c=new De(s);if(hd(r,a,et(t,c)),CC(c)===".priority"&&!ZO(a))throw new Error(r+"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)}),a9(r,o)};var JO=function(n,e,t,i){if(!(i&&t===void 0)&&!QO(t))throw new Error(Iu(n,e)+'was an invalid path = "'+t+`". Paths must be non-empty strings and can't contain ".", "#", "$", "[", or "]"`)},l9=function(n,e,t,i){t&&(t=t.replace(/^\/*\.info(\/|$)/,"/")),JO(n,e,t,i)},UC=function(n,e){if(ce(e)===".info")throw new Error(n+" failed = Can't modify data under /.info/")},u9=function(n,e){let t=e.path.toString();if(typeof e.repoInfo.host!="string"||e.repoInfo.host.length===0||!BC(e.repoInfo.namespace)&&e.repoInfo.host.split(":")[0]!=="localhost"||t.length!==0&&!s9(t))throw new Error(Iu(n,"url")+`must be a valid firebase URL and the path can't contain ".", "#", "$", "[", or "]".`)};var dC=class{constructor(){this.eventLists_=[],this.recursionDepth_=0}};function eg(n,e){let t=null;for(let i=0;iIC(i,e))}function Tn(n,e,t){eg(n,t),tP(n,i=>Bn(i,e)||Bn(e,i))}function tP(n,e){n.recursionDepth_++;let t=!0;for(let i=0;i{XN(n,i,r,o,s)},n.authTokenProvider_,n.appCheckProvider_),setTimeout(()=>JN(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{lt(t)}catch(i){throw new Error("Invalid authOverride provided: "+i)}}n.persistentConnection_=new SC(n.repoInfo_,e,(i,r,o,s)=>{XN(n,i,r,o,s)},i=>{JN(n,i)},i=>{m9(n,i)},n.authTokenProvider_,n.appCheckProvider_,t),n.server_=n.persistentConnection_}n.authTokenProvider_.addTokenChangeListener(i=>{n.server_.refreshAuthToken(i)}),n.appCheckProvider_.addTokenChangeListener(i=>{n.server_.refreshAppCheckToken(i.token)}),n.statsReporter_=mG(n.repoInfo_,()=>new Qw(n.stats_,n.server_)),n.infoData_=new Gw,n.infoSyncTree_=new Hm({startListening:(i,r,o,s)=>{let a=[],c=n.infoData_.getNode(i._path);return c.isEmpty()||(a=dd(n.infoSyncTree_,i._path,c),setTimeout(()=>{s("ok")},0)),a},stopListening:()=>{}}),HC(n,"connected",!1),n.serverSyncTree_=new Hm({startListening:(i,r,o,s)=>(n.server_.listen(i,o,r,(a,c)=>{let l=s(a,c);Tn(n.eventQueue_,i._path,l)}),[]),stopListening:(i,r)=>{n.server_.unlisten(i,r)}})}function nP(n){let t=n.infoData_.getNode(new De(".info/serverTimeOffset")).val()||0;return new Date().getTime()+t}function pd(n){return X7({timestamp:nP(n)})}function XN(n,e,t,i,r){n.dataUpdateCount++;let o=new De(e);t=n.interceptServerDataCallback_?n.interceptServerDataCallback_(e,t):t;let s=[];if(r)if(i){let c=Cu(t,l=>dt(l));s=q7(n.serverSyncTree_,o,c,r)}else{let c=dt(t);s=$O(n.serverSyncTree_,o,c,r)}else if(i){let c=Cu(t,l=>dt(l));s=$7(n.serverSyncTree_,o,c)}else{let c=dt(t);s=dd(n.serverSyncTree_,o,c)}let a=o;s.length>0&&(a=Ac(n,o)),Tn(n.eventQueue_,a,s)}function JN(n,e){HC(n,"connected",e),e===!1&&_9(n)}function m9(n,e){Tt(e,(t,i)=>{HC(n,t,i)})}function HC(n,e,t){let i=new De("/.info/"+e),r=dt(t);n.infoData_.updateSnapshot(i,r);let o=dd(n.infoSyncTree_,i,r);Tn(n.eventQueue_,i,o)}function tg(n){return n.nextWriteId_++}function g9(n,e,t){let i=G7(n.serverSyncTree_,e);return i!=null?Promise.resolve(i):n.server_.get(e).then(r=>{let o=dt(r).withIndex(e._queryParams.getIndex());aC(n.serverSyncTree_,e,t,!0);let s;if(e._queryParams.loadsAllData())s=dd(n.serverSyncTree_,e._path,o);else{let a=rd(n.serverSyncTree_,e);s=$O(n.serverSyncTree_,e._path,o,a)}return Tn(n.eventQueue_,e._path,s),$m(n.serverSyncTree_,e,t,null,!0),o},r=>(Nc(n,"get for query "+lt(e)+" failed: "+r),Promise.reject(new Error(r))))}function v9(n,e,t,i,r){Nc(n,"set",{path:e.toString(),value:t,priority:i});let o=pd(n),s=dt(t,i),a=Qm(n.serverSyncTree_,e),c=FC(s,a,o),l=tg(n),u=NC(n.serverSyncTree_,e,c,l,!0);eg(n.eventQueue_,u),n.server_.put(e.toString(),s.val(!0),(f,h)=>{let g=f==="ok";g||en("set at "+e+" failed: "+f);let y=ao(n.serverSyncTree_,l,!g);Tn(n.eventQueue_,e,y),pC(n,r,f,h)});let d=zC(n,e);Ac(n,d),Tn(n.eventQueue_,d,[])}function y9(n,e,t,i){Nc(n,"update",{path:e.toString(),value:t});let r=!0,o=pd(n),s={};if(Tt(t,(a,c)=>{r=!1,s[a]=GO(et(e,a),dt(c),n.serverSyncTree_,o)}),r)Dt("update() called with empty data. Don't do anything."),pC(n,i,"ok",void 0);else{let a=tg(n),c=H7(n.serverSyncTree_,e,s,a);eg(n.eventQueue_,c),n.server_.merge(e.toString(),t,(l,u)=>{let d=l==="ok";d||en("update at "+e+" failed: "+l);let f=ao(n.serverSyncTree_,a,!d),h=f.length>0?Ac(n,e):e;Tn(n.eventQueue_,h,f),pC(n,i,l,u)}),Tt(t,l=>{let u=zC(n,et(e,l));Ac(n,u)}),Tn(n.eventQueue_,e,[])}}function _9(n){Nc(n,"onDisconnectEvents");let e=pd(n),t=Nm();Yw(n.onDisconnect_,_e(),(r,o)=>{let s=GO(r,o,n.serverSyncTree_,e);AO(t,r,s)});let i=[];Yw(t,_e(),(r,o)=>{i=i.concat(dd(n.serverSyncTree_,r,o));let s=zC(n,r);Ac(n,s)}),n.onDisconnect_=Nm(),Tn(n.eventQueue_,_e(),i)}function b9(n,e,t){let i;ce(e._path)===".info"?i=aC(n.infoSyncTree_,e,t):i=aC(n.serverSyncTree_,e,t),eP(n.eventQueue_,e._path,i)}function hC(n,e,t){let i;ce(e._path)===".info"?i=$m(n.infoSyncTree_,e,t):i=$m(n.serverSyncTree_,e,t),eP(n.eventQueue_,e._path,i)}function E9(n){n.persistentConnection_&&n.persistentConnection_.interrupt(f9)}function Nc(n,...e){let t="";n.persistentConnection_&&(t=n.persistentConnection_.id+":"),Dt(t,...e)}function pC(n,e,t,i){e&&Rc(()=>{if(t==="ok")e(null);else{let r=(t||"error").toUpperCase(),o=r;i&&(o+=": "+i);let s=new Error(o);s.code=r,e(s)}})}function w9(n,e,t,i,r,o){Nc(n,"transaction on "+e);let s={path:e,update:t,onComplete:i,status:null,order:iO(),applyLocally:o,retryCount:0,unwatcher:r,abortReason:null,currentWriteId:null,currentInputSnapshot:null,currentOutputSnapshotRaw:null,currentOutputSnapshotResolved:null},a=$C(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{hd("transaction failed: Data returned ",c,s.path),s.status=0;let l=Xm(n.transactionQueueTree_,e),u=Fs(l)||[];u.push(s),jC(l,u);let d;typeof c=="object"&&c!==null&&jn(c,".priority")?(d=Qr(c,".priority"),M(ZO(d),"Invalid priority returned by transaction. Priority must be a valid string, finite number, server value, or null.")):d=(Qm(n.serverSyncTree_,e)||ee.EMPTY_NODE).getPriority().val();let f=pd(n),h=dt(c,d),g=FC(h,a,f);s.currentOutputSnapshotRaw=h,s.currentOutputSnapshotResolved=g,s.currentWriteId=tg(n);let y=NC(n.serverSyncTree_,e,g,s.currentWriteId,s.applyLocally);Tn(n.eventQueue_,e,y),ng(n,n.transactionQueueTree_)}}function $C(n,e,t){return Qm(n.serverSyncTree_,e,t)||ee.EMPTY_NODE}function ng(n,e=n.transactionQueueTree_){if(e||ig(n,e),Fs(e)){let t=rP(n,e);M(t.length>0,"Sending zero length transaction queue"),t.every(r=>r.status===0)&&C9(n,fd(e),t)}else YO(e)&&Jm(e,t=>{ng(n,t)})}function C9(n,e,t){let i=t.map(l=>l.currentWriteId),r=$C(n,e,i),o=r,s=r.hash();for(let l=0;l{Nc(n,"transaction put response",{path:c.toString(),status:l});let u=[];if(l==="ok"){let d=[];for(let f=0;ft[f].onComplete(null,!0,t[f].currentOutputSnapshotResolved)),t[f].unwatcher();ig(n,Xm(n.transactionQueueTree_,e)),ng(n,n.transactionQueueTree_),Tn(n.eventQueue_,e,u);for(let f=0;fa.status===0).map(a=>a.currentWriteId);for(let a=0;a=h9)u=!0,d="maxretry",r=r.concat(ao(n.serverSyncTree_,c.currentWriteId,!0));else{let f=$C(n,c.path,s);c.currentInputSnapshot=f;let h=e[a].update(f.val());if(h!==void 0){hd("transaction failed: Data returned ",h,c.path);let g=dt(h);typeof h=="object"&&h!=null&&jn(h,".priority")||(g=g.updatePriority(f.getPriority()));let _=c.currentWriteId,b=pd(n),w=FC(g,f,b);c.currentOutputSnapshotRaw=g,c.currentOutputSnapshotResolved=w,c.currentWriteId=tg(n),s.splice(s.indexOf(_),1),r=r.concat(NC(n.serverSyncTree_,c.path,w,c.currentWriteId,c.applyLocally)),r=r.concat(ao(n.serverSyncTree_,_,!0))}else u=!0,d="nodata",r=r.concat(ao(n.serverSyncTree_,c.currentWriteId,!0))}Tn(n.eventQueue_,t,r),r=[],u&&(e[a].status=2,(function(f){setTimeout(f,Math.floor(0))})(e[a].unwatcher),e[a].onComplete&&(d==="nodata"?i.push(()=>e[a].onComplete(null,!1,e[a].currentInputSnapshot)):i.push(()=>e[a].onComplete(new Error(d),!1,null))))}ig(n,n.transactionQueueTree_);for(let a=0;ai.order-r.order),t}function oP(n,e,t){let i=Fs(e);if(i)for(let r=0;r{oP(n,r,t)})}function ig(n,e){let t=Fs(e);if(t){let i=0;for(let r=0;r0?t:void 0)}Jm(e,i=>{ig(n,i)})}function zC(n,e){let t=fd(iP(n,e)),i=Xm(n.transactionQueueTree_,e);return n9(i,r=>{ww(n,r)}),ww(n,i),KO(i,r=>{ww(n,r)}),t}function ww(n,e){let t=Fs(e);if(t){let i=[],r=[],o=-1;for(let s=0;s0){let r=t[i];try{r=decodeURIComponent(r.replace(/\+/g," "))}catch{}e+="/"+r}return e}function D9(n){let e={};n.charAt(0)==="?"&&(n=n.substring(1));for(let t of n.split("&")){if(t.length===0)continue;let i=t.split("=");i.length===2?e[decodeURIComponent(i[0])]=decodeURIComponent(i[1]):en(`Invalid query segment '${t}' in query '${n}'`)}return e}var eO=function(n,e){let t=T9(n),i=t.namespace;t.domain==="firebase.com"&&gr(t.host+" is no longer supported. Please use .firebaseio.com instead"),(!i||i==="undefined")&&t.domain!=="localhost"&&gr("Cannot parse Firebase url. Please use https://.firebaseio.com"),t.secure||rG();let r=t.scheme==="ws"||t.scheme==="wss";return{repoInfo:new Sm(t.host,t.secure,i,r,e,"",i!==t.subdomain),path:new De(t.pathString)}},T9=function(n){let e="",t="",i="",r="",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 u=n.indexOf("/");u===-1&&(u=n.length);let d=n.indexOf("?");d===-1&&(d=n.length),e=n.substring(0,Math.min(u,d)),u=0?(s=a==="https"||a==="wss",c=parseInt(e.substring(l+1),10)):l=e.length;let h=e.slice(0,l);if(h.toLowerCase()==="localhost")t="localhost";else if(h.split(".").length<=2)t=h;else{let g=e.indexOf(".");i=e.substring(0,g).toLowerCase(),t=e.substring(g+1),o=i}"ns"in f&&(o=f.ns)}return{host:e,port:c,domain:t,subdomain:i,secure:s,scheme:a,pathString:r,namespace:o}};var tO="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz",x9=(function(){let n=0,e=[];return function(t){let i=t===n;n=t;let r,o=new Array(8);for(r=7;r>=0;r--)o[r]=tO.charAt(t%64),t=Math.floor(t/64);M(t===0,"Cannot push at time == 0");let s=o.join("");if(i){for(r=11;r>=0&&e[r]===63;r--)e[r]=0;e[r]++}else for(r=0;r<12;r++)e[r]=Math.floor(Math.random()*64);for(r=0;r<12;r++)s+=tO.charAt(e[r]);return M(s.length===20,"nextPushId: Length should be 20."),s}})();var zm=class{constructor(e,t,i,r){this.eventType=e,this.eventRegistration=t,this.snapshot=i,this.prevName=r}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+":"+lt(this.snapshot.exportVal())}},Wm=class{constructor(e,t,i){this.eventRegistration=e,this.error=t,this.path=i}getPath(){return this.path}getEventType(){return"cancel"}getEventRunner(){return this.eventRegistration.getEventRunner(this)}toString(){return this.path.toString()+":cancel"}};var sd=class{constructor(e,t){this.snapshotCallback=e,this.cancelCallback=t}onValue(e,t){this.snapshotCallback.call(null,e,t)}onCancel(e){return M(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 mC=class n{constructor(e,t,i,r){this._repo=e,this._path=t,this._queryParams=i,this._orderByCalled=r}get key(){return de(this._path)?null:CC(this._path)}get ref(){return new li(this._repo,this._path)}get _queryIdentifier(){let e=UN(this._queryParams),t=EC(e);return t==="{}"?"default":t}get _queryObject(){return UN(this._queryParams)}isEqual(e){if(e=ut(e),!(e instanceof n))return!1;let t=this._repo===e._repo,i=IC(this._path,e._path),r=this._queryIdentifier===e._queryIdentifier;return t&&i&&r}toJSON(){return this.toString()}toString(){return this._repo.toString()+FG(this._path)}};var li=class n extends mC{constructor(e,t){super(e,t,new Ww,!1)}get parent(){let e=wO(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}},Mc=class n{constructor(e,t,i){this._node=e,this.ref=t,this._index=i}get priority(){return this._node.getPriority().val()}get key(){return this.ref.key}get size(){return this._node.numChildren()}child(e){let t=new De(e),i=Os(this.ref,e);return new n(this._node.getChild(t),i,Qe)}exists(){return!this._node.isEmpty()}exportVal(){return this._node.val(!0)}forEach(e){return this._node.isLeafNode()?!1:!!this._node.forEachChild(this._index,(i,r)=>e(new n(r,Os(this.ref,i),Qe)))}hasChild(e){let t=new De(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 sP(n,e){return n=ut(n),n._checkNotDeleted("ref"),e!==void 0?Os(n._root,e):n._root}function Os(n,e){return n=ut(n),ce(n._path)===null?l9("child","path",e,!1):JO("child","path",e,!1),new li(n._repo,et(n._path,e))}function aP(n,e){n=ut(n),UC("push",n._path),XO("push",e,n._path,!0);let t=nP(n._repo),i=x9(t),r=Os(n,i),o=Os(n,i),s;return e!=null?s=WC(o,e).then(()=>o):s=Promise.resolve(o),r.then=s.then.bind(s),r.catch=s.then.bind(s,void 0),r}function WC(n,e){n=ut(n),UC("set",n._path),XO("set",e,n._path,!1);let t=new Sn;return v9(n._repo,n._path,e,null,t.wrapCallback(()=>{})),t.promise}function cP(n,e){c9("update",e,n._path,!1);let t=new Sn;return y9(n._repo,n._path,e,t.wrapCallback(()=>{})),t.promise}function qC(n){n=ut(n);let e=new sd(()=>{}),t=new ad(e);return g9(n._repo,n,t).then(i=>new Mc(i,new li(n._repo,n._path),n._queryParams.getIndex()))}var ad=class n{constructor(e){this.callbackContext=e}respondsTo(e){return e==="value"}createEvent(e,t){let i=t._queryParams.getIndex();return new zm("value",this,new Mc(e.snapshotNode,new li(t._repo,t._path),i))}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 Wm(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}},qm=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 Wm(this,e,t):null}createEvent(e,t){M(e.childName!=null,"Child events should have a childName.");let i=Os(new li(t._repo,t._path),e.childName),r=t._queryParams.getIndex();return new zm(e.type,this,new Mc(e.snapshotNode,i,r),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 md(n,e,t,i,r){let o;if(typeof i=="object"&&(o=void 0,r=i),typeof i=="function"&&(o=i),r&&r.onlyOnce){let c=t,l=(u,d)=>{hC(n._repo,n,a),c(u,d)};l.userCallback=t.userCallback,l.context=t.context,t=l}let s=new sd(t,o||void 0),a=e==="value"?new ad(s):new qm(e,s);return b9(n._repo,n,a),()=>hC(n._repo,n,a)}function rg(n,e,t,i){return md(n,"value",e,t,i)}function GC(n,e,t,i){return md(n,"child_added",e,t,i)}function YC(n,e,t,i){return md(n,"child_changed",e,t,i)}function KC(n,e,t,i){return md(n,"child_moved",e,t,i)}function QC(n,e,t,i){return md(n,"child_removed",e,t,i)}function ZC(n,e,t){let i=null,r=t?new sd(t):null;e==="value"?i=new ad(r):e&&(i=new qm(e,r)),hC(n._repo,n,i)}O7(li);j7(li);var A9="FIREBASE_DATABASE_EMULATOR_HOST",gC={},M9=!1;function R9(n,e,t,i){let r=e.lastIndexOf(":"),o=e.substring(0,r),s=Kr(o);n.repoInfo_=new Sm(e,s,n.repoInfo_.namespace,n.repoInfo_.webSocketOnly,n.repoInfo_.nodeAdmin,n.repoInfo_.persistenceKey,n.repoInfo_.includeNamespaceInQueryParams,!0,t),i&&(n.authTokenProvider_=i)}function k9(n,e,t,i,r){let o=i||n.options.databaseURL;o===void 0&&(n.options.projectId||gr("Can't determine Firebase Database URL. Be sure to include a Project ID when calling firebase.initializeApp()."),Dt("Using default host for project ",n.options.projectId),o=`${n.options.projectId}-default-rtdb.firebaseio.com`);let s=eO(o,r),a=s.repoInfo,c,l;typeof process<"u"&&process.env&&(l=process.env[A9]),l?(c=!0,o=`http://${l}?ns=${a.namespace}`,s=eO(o,r),a=s.repoInfo):c=!s.repoInfo.secure;let u=r&&c?new Yu(Yu.OWNER):new xw(n.name,n.options,e);u9("Invalid Firebase Database URL",s),de(s.path)||gr("Database URL must point to the root of a Firebase Database (not including a child path).");let d=O9(a,n,u,new Tw(n,t));return new vC(d,n)}function N9(n,e){let t=gC[e];(!t||t[n.key]!==n)&&gr(`Database ${e}(${n.repoInfo_}) has already been deleted.`),E9(n),delete t[n.key]}function O9(n,e,t,i){let r=gC[e.name];r||(r={},gC[e.name]=r);let o=r[n.toURLString()];return o&&gr("Database initialized multiple times. Please make sure the format of the database URL matches with each database() call."),o=new fC(n,M9,t,i),r[n.toURLString()]=o,o}var vC=class{constructor(e,t){this._repoInternal=e,this.app=t,this.type="database",this._instanceStarted=!1}get _repo(){return this._instanceStarted||(p9(this._repoInternal,this.app.options.appId,this.app.options.databaseAuthVariableOverride),this._instanceStarted=!0),this._repoInternal}get _root(){return this._rootInternal||(this._rootInternal=new li(this._repo,_e())),this._rootInternal}_delete(){return this._rootInternal!==null&&(N9(this._repo,this.app.name),this._repoInternal=null,this._rootInternal=null),Promise.resolve()}_checkNotDeleted(e){this._rootInternal===null&&gr("Cannot call "+e+" on a deleted database.")}};function lP(n=Es(),e){let t=hc(n,"database").getImmediate({identifier:e});if(!t._instanceStarted){let i=Fk("database");i&&uP(t,...i)}return t}function uP(n,e,t,i={}){n=ut(n),n._checkNotDeleted("useEmulator");let r=`${e}:${t}`,o=n._repoInternal;if(n._instanceStarted){if(r===n._repoInternal.repoInfo_.host&&Ni(i,o.repoInfo_.emulatorOptions))return;gr("connectDatabaseEmulator() cannot initialize or alter the emulator configuration after the database instance has started.")}let s;if(o.repoInfo_.nodeAdmin)i.mockUserToken&&gr('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 Yu(Yu.OWNER);else if(i.mockUserToken){let a=typeof i.mockUserToken=="string"?i.mockUserToken:Vk(i.mockUserToken,n.app.options.projectId);s=new Yu(a)}Kr(e)&&(qp(e),Gp("Database",!0)),R9(o,r,i,s)}function P9(n){nG(Xr),oi(new Xt("database",(e,{instanceIdentifier:t})=>{let i=e.getProvider("app").getImmediate(),r=e.getProvider("auth-internal"),o=e.getProvider("app-check-internal");return k9(i,r,o,t)},"PUBLIC").setMultipleInstances(!0)),Je(IN,SN,n),Je(IN,SN,"esm2017")}var L9={".sv":"timestamp"};function dP(){return L9}var yC=class{constructor(e,t){this.committed=e,this.snapshot=t}toJSON(){return{committed:this.committed,snapshot:this.snapshot.toJSON()}}};function fP(n,e,t){var i;if(n=ut(n),UC("Reference.transaction",n._path),n.key===".length"||n.key===".keys")throw"Reference.transaction failed: "+n.key+" is a read-only object.";let r=(i=t?.applyLocally)!==null&&i!==void 0?i:!0,o=new Sn,s=(c,l,u)=>{let d=null;c?o.reject(c):(d=new Mc(u,new li(n._repo,n._path),Qe),o.resolve(new yC(l,d)))},a=rg(n,()=>{});return w9(n._repo,n._path,e,s,a,r),o.promise}SC.prototype.simpleListen=function(n,e){this.sendRequest("q",{p:n},e)};SC.prototype.echo=function(n,e){this.sendRequest("echo",{d:n},e)};P9();var Vs,bt=(function(n){return n.added="child_added",n.removed="child_removed",n.changed="child_changed",n.moved="child_moved",n.value="value",n})(bt||{}),F9=Object.freeze((Vs={},Vs[bt.added]=GC,Vs[bt.removed]=QC,Vs[bt.changed]=YC,Vs[bt.moved]=KC,Vs[bt.value]=rg,Vs));function JC(n,e){return new Y(function(t){var i=F9[e](n,function(r,o){t.next({snapshot:r,prevKey:o,event:e})},t.error.bind(t));return{unsubscribe:function(){ZC(n,e,i)}}}).pipe(ey(0))}var og=function(){return og=Object.assign||function(e){for(var t,i=1,r=arguments.length;i-1){var l=n[s-1];(l&&l.snapshot.key||null)!==i&&(n=n.filter(function(d){return d.snapshot.key!==t.key}),n.splice(a,0,e))}else{if(i==null)return XC([e],n,!0);n=n.slice(),n.splice(a,0,e)}return n;case bt.removed:return n.filter(function(d){return d.snapshot.key!==t.key});case bt.changed:return n.map(function(d){return d.snapshot.key===o?e:d});case bt.moved:if(s>-1){var u=n.splice(s,1)[0];return n=n.slice(),n.splice(a,0,u),n}return n;default:return n}}var vr=class{constructor(e){return e}},vP="database",tI=class{constructor(){return mc(vP)}};var nI=new P("angularfire2.database-instances");function H9(n,e){let t=Au(vP,n,e);return t&&new vr(t)}function $9(n){return(e,t)=>{let i=e.runOutsideAngular(()=>n(t));return new vr(i)}}var z9={provide:tI,deps:[[new sn,nI]]},W9={provide:vr,useFactory:H9,deps:[[new sn,nI],hr]};function yP(n,...e){return Je("angularfire",Jr.full,"rtdb"),It([W9,z9,{provide:nI,useFactory:$9(n),multi:!0,deps:[pe,Ye,eo,Cs,[new sn,Uu],[new sn,gc],...e]}])}var _P=St(mP,!0);var iI=St(hP,!0);var bP=St(lP,!0);var EP=St(aP,!0,2);var yr=St(sP,!0,2);var rI=St(fP,!0),wP=St(WC,!0,2);var CP=St(cP,!0,2);var SP=["Eco-friendly stay with panoramic Himalayan views","Curated Ladakhi cuisine and organic garden dining","Guided cultural walks and stargazing terraces","Premium comfort with modern amenities"],ho=[{name:"Alpine Deluxe Room",size:"320 sq ft",view:"Mountain and monastery view",price:"From \u20B97,500 / night",amenities:["King bed","Heated floors","Smart TV","Tea lounge"],features:["Soundproof windows","Organic linen","Private balcony"],image:"assets/room-eco-inn.jpg"},{name:"Heritage Suite",size:"480 sq ft",view:"Valley view",price:"From \u20B911,500 / night",amenities:["King bed","Lounge area","Bathtub","Curated minibar"],features:["Handcrafted decor","Private lounge","Butler on request"],image:"assets/view-room.jpg"}],Oc=[{title:"High-Altitude Dining",description:"Farm-to-table Ladakhi flavors with views of the Indus Valley.",icon:"bi-cup-hot-fill"},{title:"Stargazing Deck",description:"Crystal clear night skies with curated astronomy sessions.",icon:"bi-stars"},{title:"Cultural Immersion",description:"Monastery visits, artisan workshops, and village trails.",icon:"bi-geo-alt-fill"},{title:"Wellness & Yoga",description:"Morning flows, mountain air meditation, and spa rituals.",icon:"bi-brightness-high-fill"}],DP=[{title:"Rooted in Ladakh",description:"Local materials, artisans, and traditions shape every space."},{title:"Eco-led living",description:"Thoughtful energy use, low waste practices, and mindful hospitality."},{title:"Modern comfort",description:"Warm interiors, smart amenities, and quiet spaces to recharge."}],TP=[{title:"Eco practices",detail:"Low-waste, low-plastic operations",icon:"bi-recycle"},{title:"Local partnerships",detail:"Guides, artisans, and farmers from Leh",icon:"bi-people-fill"},{title:"Guest favorite",detail:"Consistently rated 4.9+ by guests",icon:"bi-award-fill"}],xP=[{name:"Booking.com",url:"https://www.booking.com/",note:"Official listing"},{name:"Airbnb",url:"https://www.airbnb.com/",note:"Official listing"},{name:"MakeMyTrip",url:"https://www.makemytrip.com/",note:"Official listing"}],sg=[{name:"Ananya Sharma",location:"Mumbai",rating:"5.0",quote:"The views are unreal and the service feels personal. The concierge helped us plan monasteries and dining."},{name:"Tsering Dolma",location:"Leh",rating:"4.9",quote:"A beautiful eco-friendly stay with peaceful rooms and warm hospitality. We loved the stargazing deck."},{name:"Rohan Mehta",location:"Delhi",rating:"5.0",quote:"Modern rooms, calm ambience, and a great breakfast. The team arranged our Nubra day trip smoothly."}],Pc=[{question:"What is the check-in and check-out time at Himalayan Eco Inn?",answer:"Check-in is from 2:00 PM and check-out is by 11:00 AM. Early check-in and late check-out can be arranged on request, subject to availability."},{question:"Do you provide airport transfers from Kushok Bakula Rimpochhe Airport?",answer:"Yes, we offer airport transfers from Leh Airport (IXL) on request. Please inform us of your flight details at least 24 hours in advance."},{question:"Is the property suitable for families with children?",answer:"Yes, Himalayan Eco Inn is family-friendly. We have spacious rooms, tailored activities for kids, and a warm, welcoming environment for all ages."},{question:"How do you support eco-friendly stays in Ladakh?",answer:"We focus on local sourcing from Ladakhi farmers and artisans, reduced single-use plastic, solar energy use, and water conservation practices rooted in Leh's environment."},{question:"What is the best time to visit Leh Ladakh?",answer:"The best time to visit Leh, Ladakh is from April to October. Summers (June\u2013August) offer warm weather and access to Nubra Valley, Pangong Lake, and Zanskar. May and September are ideal for fewer crowds and pleasant temperatures."},{question:"How do I get to Leh Ladakh?",answer:"Leh is accessible by air via Kushok Bakula Rimpochhe Airport (IXL) with daily flights from Delhi, Mumbai, and other cities. The Manali\u2013Leh and Srinagar\u2013Leh highways open seasonally (May\u2013October). We can assist with route planning."},{question:"Do I need permits to visit Ladakh?",answer:"Indian nationals do not require inner-line permits for Leh city. Permits are required for protected areas like Nubra Valley, Pangong Lake, Tso Moriri, and Dah-Hanu. Foreign nationals need an Inner Line Permit (ILP) for restricted areas. Our concierge can assist with permit arrangements."},{question:"What is the altitude of Leh and should I worry about altitude sickness?",answer:"Leh is situated at approximately 3,524 meters (11,562 ft) above sea level. We recommend resting for the first 24\u201348 hours, staying well hydrated, and avoiding strenuous activity. Our staff provides acclimatization guidance and can arrange medical assistance if needed."},{question:"What tours and travel packages are available near Himalayan Eco Inn?",answer:"Our concierge curates day trips and multi-day tours to Pangong Lake, Nubra Valley, Zanskar, Hemis, Thiksey Monastery, Shey Palace, Magnetic Hill, and more. We work with licensed Ladakhi drivers and guides to ensure a safe, enriching experience."},{question:"Can I book a Ladakh tour package from Himalayan Eco Inn?",answer:"Yes. We offer customised Ladakh travel packages including monastery circuits, high-altitude lake tours, village walks, and cultural experiences. Contact our concierge to design your personal itinerary."},{question:"What rooms are available at Himalayan Eco Inn?",answer:"We offer Alpine Deluxe Rooms (from \u20B97,500/night) with mountain and monastery views, and Heritage Suites (from \u20B911,500/night) with valley views and a private lounge. All rooms include eco-friendly amenities and modern comforts."},{question:"Is Wi-Fi available at the hotel?",answer:"Yes, high-speed Wi-Fi is available in all rooms and common areas. It is complimentary for all guests."},{question:"Do you offer vegetarian or Ladakhi cuisine at the hotel?",answer:"Yes, our dining lounge serves traditional Ladakhi dishes, seasonal organic produce from local farms, and a wide selection of vegetarian and vegan options. We can accommodate dietary preferences with advance notice."},{question:"How far is Himalayan Eco Inn from Shanti Stupa?",answer:"Himalayan Eco Inn is approximately 1.5 km from Shanti Stupa \u2014 around a 5-minute drive. Leh Palace and the main market are also within easy reach, making it a convenient base for exploring Leh."},{question:"Is Himalayan Eco Inn a good base for Leh sightseeing?",answer:"Yes. Our location in Upper Tukcha, Leh puts you within easy reach of Leh Palace, Shanti Stupa, Namgyal Tsemo Monastery, the main bazaar, and departure points for Nubra, Pangong, and Zanskar trips."},{question:"What is the cancellation policy?",answer:"Cancellations made 48 hours or more before check-in receive a full refund. Late cancellations or no-shows are subject to a one-night charge. Please contact us directly for group or long-stay bookings."}],Lc=[{title:"Mountain View Lounge",image:"assets/eco-inne-view.jpg"},{title:"Eco Inn Exterior",image:"assets/eco-inne-hotel.jpg"},{title:"Signature View",image:"assets/hotel-eco-inn.jpg"},{title:"Dining Experience",image:"assets/eco-inn-dine.jpg"},{title:"Cozy Room",image:"assets/eco-inn-room.jpg"},{title:"Winter Views",image:"assets/winter-view.jpg"},{title:"Summer Vibes",image:"assets/new-hotel.jpeg"},{title:"Chill Out Zone",image:"assets/out.jpeg"}],ag=[{name:"Thiksey Monastery",category:"Monastery",distance:"18 km",summary:"Iconic hilltop monastery known for sunrise views and serene courtyards.",tip:"Visit early for softer light and fewer crowds.",mapUrl:"https://www.google.com/maps?q=Thiksey%20Monastery%20Leh%20Ladakh"},{name:"Shey Palace & Monastery",category:"Monastery",distance:"15 km",summary:"Historic palace ruins with panoramic valley views and a giant Buddha statue.",tip:"Pair with a sunset drive back to Leh.",mapUrl:"https://www.google.com/maps?q=Shey%20Palace%20Leh%20Ladakh"},{name:"Shanti Stupa",category:"Viewpoint",distance:"5 km",summary:"White-domed stupa with sweeping views of Leh town and the mountains.",tip:"Best at sunrise or blue hour.",mapUrl:"https://www.google.com/maps?q=Shanti%20Stupa%20Leh%20Ladakh"},{name:"Magnetic Hill",category:"Viewpoint",distance:"27 km",summary:"A fun optical illusion point along the Leh-Kargil highway.",tip:"Combine with Gurudwara Pathar Sahib.",mapUrl:"https://www.google.com/maps?q=Magnetic%20Hill%20Leh%20Ladakh"},{name:"Stok Village",category:"Village",distance:"14 km",summary:"Traditional Ladakhi homes, palace museum, and craft souvenirs.",tip:"Ask us for a curated village walk.",mapUrl:"https://www.google.com/maps?q=Stok%20Village%20Leh%20Ladakh"},{name:"Lamayuru Cafe (Leh)",category:"Restaurant",distance:"3 km",summary:"Popular local cafe for Tibetan-Mughlai comfort food and tea.",tip:"Try momos and butter tea.",mapUrl:"https://www.google.com/maps?q=Lamayuru%20Cafe%20Leh%20Ladakh"}];var cg={production:!0,firebase:{apiKey:"AIzaSyCClolwAhBL5K3CN5BtPvuCGWQUuZVX0d4",authDomain:"eco-lounge.firebaseapp.com",databaseURL:"https://eco-lounge-default-rtdb.firebaseio.com",projectId:"eco-lounge",storageBucket:"eco-lounge.firebasestorage.app",messagingSenderId:"342972911604",appId:"1:342972911604:web:619df3e0b0e1697a00f3a1",measurementId:"G-1MJ0WZQ8HQ"},baseUrl:"https://himalayanecoinn.com"};var Te=class n{constructor(e,t,i,r){this.title=e;this.meta=t;this.router=i;this.document=r}baseUrl=cg.baseUrl??"https://himalayanecoinn.com";siteKeywords="Ladakh, Leh, Ladakh tours, Leh tours, Ladakh hotel, Ladakh tourism, hotel in Leh Ladakh";update(e){this.title.setTitle(e.title),this.meta.updateTag({name:"description",content:e.description});let t=[e.keywords,this.siteKeywords].filter(Boolean).join(", ");this.meta.updateTag({name:"keywords",content:t}),e.robots&&this.meta.updateTag({name:"robots",content:e.robots}),this.meta.updateTag({property:"og:title",content:e.title}),this.meta.updateTag({property:"og:description",content:e.description}),this.meta.updateTag({name:"twitter:title",content:e.title}),this.meta.updateTag({name:"twitter:description",content:e.description});let i=this.document?.location?.href??"",r=e.url??(i&&!i.includes("localhost")?i:`${this.baseUrl}${this.getPath()}`);r&&(this.meta.updateTag({property:"og:url",content:r}),this.setLinkTag("canonical",r)),e.image&&(this.meta.updateTag({property:"og:image",content:e.image}),this.meta.updateTag({name:"twitter:image",content:e.image}))}getPath(){let e=this.router.url.split("?")[0];return e.startsWith("/")?e:`/${e}`}injectBreadcrumb(e){if(!this.document?.head)return;let t=this.document.head.querySelector("script#breadcrumb-jsonld");t&&t.remove();let i=this.document.createElement("script");i.id="breadcrumb-jsonld",i.type="application/ld+json",i.text=JSON.stringify({"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:e.map((r,o)=>({"@type":"ListItem",position:o+1,name:r.name,item:r.url}))}),this.document.head.appendChild(i)}setLinkTag(e,t){if(!this.document?.head)return;let i=this.document.head.querySelector(`link[rel="${e}"]`);i||(i=this.document.createElement("link"),i.setAttribute("rel",e),this.document.head.appendChild(i)),i.setAttribute("href",t)}static \u0275fac=function(t){return new(t||n)($(yp),$(PR),$(_t),$(Pe))};static \u0275prov=L({token:n,factory:n.\u0275fac,providedIn:"root"})};var q9=["experienceScroll"],G9=n=>["bi",n];function Y9(n,e){if(n&1&&(p(0,"div",56),k(1,"i",57),p(2,"span"),v(3),m()()),n&2){let t=e.$implicit;E(3),O(t)}}function K9(n,e){if(n&1&&(p(0,"div",58),k(1,"div",59),p(2,"div")(3,"h5"),v(4),m(),p(5,"p",60),v(6),m()()()),n&2){let t=e.$implicit;E(4),O(t.title),E(2),O(t.description)}}function Q9(n,e){if(n&1&&(p(0,"div",61)(1,"div",62)(2,"div",63),k(3,"i",64),m(),p(4,"h5"),v(5),m(),p(6,"p",65),v(7),m()()()),n&2){let t=e.$implicit;E(3),x("ngClass",ls(3,G9,t.icon)),E(2),O(t.title),E(2),O(t.description)}}function Z9(n,e){if(n&1&&(p(0,"li"),k(1,"i",57),v(2),m()),n&2){let t=e.$implicit;E(2),ye("",t," ")}}function X9(n,e){if(n&1&&(p(0,"div",66)(1,"div",67),k(2,"img",68),p(3,"div",69)(4,"div",70)(5,"div")(6,"h5"),v(7),m(),p(8,"p",71),v(9),m()(),p(10,"span",72),v(11),m()(),p(12,"ul",73),B(13,Z9,3,1,"li",74),m(),p(14,"a",75),v(15,"View Details"),m()()()()),n&2){let t=e.$implicit;E(2),x("src",t.image,jt)("alt",t.name),E(5),O(t.name),E(2),Ua("",t.view," \u2022 ",t.size),E(2),O(t.price),E(2),x("ngForOf",t.amenities)}}function J9(n,e){if(n&1&&(p(0,"div",76)(1,"div",77),k(2,"img",68),p(3,"div",69)(4,"h6"),v(5),m()()()()),n&2){let t=e.$implicit;E(2),x("src",t.image,jt)("alt",t.title),E(3),O(t.title)}}function eY(n,e){if(n&1&&(p(0,"div",66)(1,"div",78)(2,"div",79)(3,"h6"),v(4),m(),p(5,"span",80),v(6),m()(),p(7,"p",71),v(8),m(),p(9,"p",81),v(10),m()()()),n&2){let t=e.$implicit;E(4),O(t.name),E(2),O(t.rating),E(2),O(t.location),E(2),ye("\u201C",t.quote,"\u201D")}}function tY(n,e){if(n&1&&(p(0,"div",82)(1,"h2",83)(2,"button",84),v(3),m()(),p(4,"div",85)(5,"div",86),v(6),m()()()),n&2){let t=e.$implicit,i=e.index;E(),x("id","faqHeading"+i),E(),Qt("data-bs-target","#faqCollapse"+i)("aria-controls","faqCollapse"+i),E(),ye(" ",t.question," "),E(),x("id","faqCollapse"+i),Qt("aria-labelledby","faqHeading"+i),E(2),ye(" ",t.answer," ")}}function nY(n,e){if(n&1&&(p(0,"div",87)(1,"div",88),k(2,"i",89),m(),p(3,"div")(4,"h6"),v(5),m(),p(6,"p",60),v(7),m()()()),n&2){let t=e.$implicit;E(2),x("ngClass",t.icon),E(3),O(t.title),E(2),O(t.detail)}}function iY(n,e){if(n&1&&(p(0,"a",90)(1,"div")(2,"h6"),v(3),m(),p(4,"p",60),v(5),m()(),p(6,"span",91),v(7,"Visit"),m()()),n&2){let t=e.$implicit;x("href",t.url,jt),E(3),O(t.name),E(2),O(t.note)}}var lg=class n{constructor(e){this.seo=e;this.seo.update({title:"Himalayan Eco Inn | Luxury Hotel in Leh Ladakh",description:"Himalayan Eco Inn is a luxury hotel and homestay-style retreat in Leh, Ladakh with elegant rooms and curated experiences.",keywords:"hotel in Leh Ladakh, homestay in Leh, Himalayan Eco Inn, luxury rooms in Ladakh, eco hotel Leh, Leh hotel booking, Ladakh tours, Leh tour packages, Leh sightseeing tours",image:"https://himalayanecoinn.com/assets/hotel-eco-inn.jpg"})}highlights=SP;rooms=ho;experienceList=Oc;testimonialList=sg;faqList=Pc;galleryPreview=Lc.slice(0,4);timeline=DP;badges=TP;partners=xP;experienceScroll;animationId;cleanupFns=[];autoScrollActive=!1;pauseUntil=0;ngAfterViewInit(){this.startAutoScroll()}ngOnDestroy(){this.stopAutoScroll()}startAutoScroll(){if(typeof window>"u"||this.autoScrollActive)return;let e=this.experienceScroll?.nativeElement;if(!e||window.innerWidth>=992)return;this.autoScrollActive=!0;let t=performance.now(),i=s=>{let a=s-t;t=s,Date.now()>=this.pauseUntil&&(e.scrollLeft+=a*.05,e.scrollLeft+e.clientWidth>=e.scrollWidth-2&&(e.scrollLeft=0)),this.animationId=requestAnimationFrame(i)};this.animationId=requestAnimationFrame(i);let r=()=>{this.pauseUntil=Date.now()+2500};e.addEventListener("touchstart",r,{passive:!0}),e.addEventListener("pointerdown",r),e.addEventListener("wheel",r,{passive:!0}),this.cleanupFns.push(()=>e.removeEventListener("touchstart",r)),this.cleanupFns.push(()=>e.removeEventListener("pointerdown",r)),this.cleanupFns.push(()=>e.removeEventListener("wheel",r));let o=()=>{window.innerWidth>=992?this.stopAutoScroll():this.autoScrollActive||this.startAutoScroll()};window.addEventListener("resize",o),this.cleanupFns.push(()=>window.removeEventListener("resize",o))}stopAutoScroll(){this.animationId&&(cancelAnimationFrame(this.animationId),this.animationId=void 0),this.autoScrollActive=!1,this.cleanupFns.forEach(e=>e()),this.cleanupFns=[]}static \u0275fac=function(t){return new(t||n)(N(Te))};static \u0275cmp=se({type:n,selectors:[["app-home"]],viewQuery:function(t,i){if(t&1&&Fn(q9,5),t&2){let r;ln(r=un())&&(i.experienceScroll=r.first)}},decls:163,vars:9,consts:[["experienceScroll",""],[1,"hero-section"],[1,"container"],[1,"row","align-items-center","g-4"],[1,"col-lg-6"],[1,"eyebrow"],[1,"text-white"],[1,"lead"],[1,"hero-actions"],["routerLink","/experience",1,"btn","btn-primary","btn-lg"],["routerLink","/rooms",1,"btn","btn-outline-light","btn-lg"],[1,"hero-highlights"],["class","highlight-card",4,"ngFor","ngForOf"],[1,"hero-media"],["id","heroCarousel","data-bs-ride","carousel",1,"carousel","slide"],[1,"carousel-inner"],[1,"carousel-item","active"],["src","assets/eco-inne-hotel.jpg","alt","Himalayan Eco Inn exterior"],[1,"carousel-item"],["src","assets/eco-inn-dine.jpg","alt","Himalayan Eco Inn suite"],["src","assets/eco-inn-room.jpg","alt","Himalayan Eco Inn landscape"],["type","button","data-bs-target","#heroCarousel","data-bs-slide","prev",1,"carousel-control-prev"],["aria-hidden","true",1,"carousel-control-prev-icon"],[1,"visually-hidden"],["type","button","data-bs-target","#heroCarousel","data-bs-slide","next",1,"carousel-control-next"],["aria-hidden","true",1,"carousel-control-next-icon"],[1,"hero-badge"],[1,"section-spacing"],[1,"col-lg-8"],[1,"section-heading"],["routerLink","/rooms",1,"btn","btn-outline-primary"],["routerLink","/contact",1,"btn","btn-primary"],[1,"col-lg-4"],["src","assets/room-eco-inn.jpg","alt","Himalayan Eco Inn hotel in Leh Ladakh",1,"img-fluid","rounded-4","shadow"],[1,"timeline-grid"],["class","timeline-card",4,"ngFor","ngForOf"],[1,"row","g-4","experience-scroll"],["class","col-10 col-sm-7 col-md-6 col-lg-3 experience-item",4,"ngFor","ngForOf"],[1,"section-spacing","bg-soft"],[1,"row","g-4"],["class","col-md-6 col-lg-4",4,"ngFor","ngForOf"],["class","col-md-6 col-lg-3",4,"ngFor","ngForOf"],[1,"mt-4"],["routerLink","/gallery",1,"btn","btn-outline-primary"],["routerLink","/reviews",1,"btn","btn-outline-primary"],["id","homeFaq",1,"accordion"],["class","accordion-item",4,"ngFor","ngForOf"],["routerLink","/faq",1,"btn","btn-outline-primary"],[1,"trust-grid"],["class","trust-card",4,"ngFor","ngForOf"],[1,"partner-grid"],["class","partner-card","target","_blank","rel","noopener",3,"href",4,"ngFor","ngForOf"],[1,"partner-disclaimer","text-muted","mb-0"],[1,"section-spacing","bg-cta"],[1,"cta-card"],["routerLink","/contact",1,"btn","btn-light","btn-lg"],[1,"highlight-card"],[1,"bi","bi-check-circle-fill"],[1,"timeline-card"],[1,"timeline-dot"],[1,"text-muted","mb-0"],[1,"col-10","col-sm-7","col-md-6","col-lg-3","experience-item"],[1,"card","p-2","experience-card","h-100"],[1,"icon-wrap"],[3,"ngClass"],[1,"text-muted"],[1,"col-md-6","col-lg-4"],[1,"card","room-card","h-100"],[3,"src","alt"],[1,"card-body"],[1,"d-flex","align-items-start","justify-content-between","gap-2"],[1,"text-muted","mb-2"],[1,"price-tag"],[1,"list-unstyled","amenity-list"],[4,"ngFor","ngForOf"],["routerLink","/rooms",1,"btn","btn-outline-primary","w-100"],[1,"col-md-6","col-lg-3"],[1,"card","gallery-card","h-100"],[1,"card","testimonial-card","h-100"],[1,"d-flex","align-items-center","justify-content-between"],[1,"badge","bg-primary-subtle","text-primary"],[1,"quote"],[1,"accordion-item"],[1,"accordion-header",3,"id"],["type","button","data-bs-toggle","collapse",1,"accordion-button"],["data-bs-parent","#homeFaq",1,"accordion-collapse","collapse",3,"id"],[1,"accordion-body","text-muted"],[1,"trust-card"],[1,"trust-icon"],[1,"bi",3,"ngClass"],["target","_blank","rel","noopener",1,"partner-card",3,"href"],[1,"partner-cta"]],template:function(t,i){t&1&&(p(0,"section",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"span",5),v(5,"Leh, Ladakh"),m(),p(6,"h1",6),v(7,"Elevate your stay in the heart of the Himalayas."),m(),p(8,"p",7),v(9," Himalayan Eco Inn blends eco-conscious luxury with curated Himalayan experiences, crafted for comfort, calm, and discovery. "),m(),p(10,"div",8)(11,"a",9),v(12,"Explore Experiences"),m(),p(13,"a",10),v(14,"View Rooms"),m()(),p(15,"div",11),B(16,Y9,4,1,"div",12),m()(),p(17,"div",4)(18,"div",13)(19,"div",14)(20,"div",15)(21,"div",16),k(22,"img",17),m(),p(23,"div",18),k(24,"img",19),m(),p(25,"div",18),k(26,"img",20),m()(),p(27,"button",21),k(28,"span",22),p(29,"span",23),v(30,"Previous"),m()(),p(31,"button",24),k(32,"span",25),p(33,"span",23),v(34,"Next"),m()()(),p(35,"div",26)(36,"strong"),v(37,"4.9"),m(),p(38,"span"),v(39,"Guest Rating"),m()()()()()()(),p(40,"section",27)(41,"div",2)(42,"div",3)(43,"div",28)(44,"div",29)(45,"span",5),v(46,"Leh Ladakh Stay"),m(),p(47,"h2"),v(48,"Luxury hotel and homestay-style comfort in Leh, Ladakh."),m(),p(49,"p"),v(50," Himalayan Eco Inn is a boutique hotel in Leh designed for travelers searching for serene rooms, warm hospitality, and memorable Himalayan views. Whether you call it a hotel, room stay, or a homestay in Ladakh, our team curates every detail for a restful mountain escape. "),m(),p(51,"div",8)(52,"a",30),v(53,"Explore Rooms"),m(),p(54,"a",31),v(55,"Book Your Stay"),m()()()(),p(56,"div",32),k(57,"img",33),m()()()(),p(58,"section",27)(59,"div",2)(60,"div",29)(61,"span",5),v(62,"Our Story"),m(),p(63,"h2"),v(64,"Rooted in Ladakh, refined for modern comfort."),m(),p(65,"p"),v(66,"Every detail blends local heritage with calm, contemporary design."),m()(),p(67,"div",34),B(68,K9,7,2,"div",35),m()()(),p(69,"section",27)(70,"div",2)(71,"div",29)(72,"span",5),v(73,"Experience"),m(),p(74,"h2"),v(75,"Immersive moments designed for modern explorers."),m(),p(76,"p"),v(77,"From local cuisine to stargazing nights, every detail tells a Ladakhi story."),m()(),p(78,"div",36,0),B(80,Q9,8,5,"div",37),m()()(),p(81,"section",38)(82,"div",2)(83,"div",29)(84,"span",5),v(85,"Rooms & Suites"),m(),p(86,"h2"),v(87,"Comfortable spaces with Himalayan calm."),m(),p(88,"p"),v(89,"Thoughtfully designed rooms with eco materials and modern amenities."),m()(),p(90,"div",39),B(91,X9,16,7,"div",40),m()()(),p(92,"section",38)(93,"div",2)(94,"div",29)(95,"span",5),v(96,"Gallery"),m(),p(97,"h2"),v(98,"Scenes from Himalayan Eco Inn."),m(),p(99,"p"),v(100,"Explore the calm interiors, dining spaces, and mountain views."),m()(),p(101,"div",39),B(102,J9,6,3,"div",41),m(),p(103,"div",42)(104,"a",43),v(105,"View full gallery"),m()()()(),p(106,"section",27)(107,"div",2)(108,"div",29)(109,"span",5),v(110,"Guest Reviews"),m(),p(111,"h2"),v(112,"What our guests are saying."),m(),p(113,"p"),v(114,"Real stories from travelers who stayed with us in Leh."),m()(),p(115,"div",39),B(116,eY,11,4,"div",40),m(),p(117,"div",42)(118,"a",44),v(119,"Read more reviews"),m()()()(),p(120,"section",38)(121,"div",2)(122,"div",29)(123,"span",5),v(124,"FAQ"),m(),p(125,"h2"),v(126,"Answers to common questions."),m(),p(127,"p"),v(128,"Quick details on bookings, stay policies, and services."),m()(),p(129,"div",45),B(130,tY,7,7,"div",46),m(),p(131,"div",42)(132,"a",47),v(133,"View all FAQs"),m()()()(),p(134,"section",27)(135,"div",2)(136,"div",48),B(137,nY,8,3,"div",49),m()()(),p(138,"section",38)(139,"div",2)(140,"div",29)(141,"span",5),v(142,"Book on Partners"),m(),p(143,"h2"),v(144,"Prefer a trusted marketplace?"),m(),p(145,"p"),v(146,"Use our official listings below. You will be redirected to partner sites."),m()(),p(147,"div",50),B(148,iY,8,3,"a",51),m(),p(149,"p",52),v(150," Disclaimer: Booking is subject to partner terms and availability. We do not control external pricing. "),m()()(),p(151,"section",53)(152,"div",2)(153,"div",54)(154,"div")(155,"span",5),v(156,"Stay With Us"),m(),p(157,"h2"),v(158,"Plan your eco-luxury escape in Ladakh."),m(),p(159,"p"),v(160,"Connect with our concierge to design a stay that matches your pace."),m()(),p(161,"a",55),v(162,"Contact Concierge"),m()()()()),t&2&&(E(16),x("ngForOf",i.highlights),E(52),x("ngForOf",i.timeline),E(12),x("ngForOf",i.experienceList),E(11),x("ngForOf",i.rooms),E(11),x("ngForOf",i.galleryPreview),E(14),x("ngForOf",i.testimonialList),E(14),x("ngForOf",i.faqList),E(7),x("ngForOf",i.badges),E(11),x("ngForOf",i.partners))},dependencies:[ur,Le,qe],styles:[".hero-section[_ngcontent-%COMP%]{background:radial-gradient(circle at top,rgba(73,106,180,.15),transparent 55%),linear-gradient(120deg,#0f1a2b,#142c47 40%,#1d3a53);color:#f7f8fb;padding:5rem 0 4rem}.hero-section[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{font-size:clamp(2.6rem,4vw,3.8rem)}.hero-section[_ngcontent-%COMP%] .lead[_ngcontent-%COMP%]{color:#ffffffbf}.hero-actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:1rem;margin:2rem 0}.hero-highlights[_ngcontent-%COMP%]{display:grid;gap:.75rem}.highlight-card[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem;background:#ffffff14;border-radius:.75rem;padding:.75rem 1rem}.hero-media[_ngcontent-%COMP%]{position:relative;border-radius:1.5rem;overflow:hidden;box-shadow:0 24px 60px #0c162873}.hero-media[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:cover;min-height:420px}.hero-media[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{min-height:420px}.hero-media[_ngcontent-%COMP%] .carousel-control-prev[_ngcontent-%COMP%], .hero-media[_ngcontent-%COMP%] .carousel-control-next[_ngcontent-%COMP%]{width:15%}.hero-badge[_ngcontent-%COMP%]{position:absolute;bottom:1.5rem;right:1.5rem;background:#fff;color:#0f1a2b;padding:.75rem 1rem;border-radius:.75rem;display:flex;flex-direction:column;align-items:center;font-weight:600}.experience-scroll[_ngcontent-%COMP%]{flex-wrap:nowrap}@media (max-width: 991px){.experience-scroll[_ngcontent-%COMP%]{overflow-x:auto;padding-bottom:1rem;scrollbar-width:none;scroll-snap-type:x mandatory}.experience-scroll[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}.experience-item[_ngcontent-%COMP%]{flex:0 0 auto;scroll-snap-align:start}}.experience-card[_ngcontent-%COMP%]{box-shadow:0 12px 30px #0f1a2b1f}.experience-card[_ngcontent-%COMP%] .icon-wrap[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;background:#15294614;display:grid;place-items:center;color:var(--primary);margin-bottom:1rem}.timeline-grid[_ngcontent-%COMP%]{display:grid;gap:1rem}.timeline-card[_ngcontent-%COMP%]{display:flex;gap:1rem;align-items:flex-start;padding:1.25rem 1.5rem;border-radius:1.25rem;background:#fff;box-shadow:0 12px 30px #0f1a2b14;position:relative}.timeline-dot[_ngcontent-%COMP%]{width:12px;height:12px;border-radius:50%;background:var(--primary);margin-top:.4rem;flex:0 0 auto;box-shadow:0 0 0 6px #1c3d5a1f}.trust-grid[_ngcontent-%COMP%]{display:grid;gap:1rem;grid-template-columns:repeat(auto-fit,minmax(220px,1fr))}.trust-card[_ngcontent-%COMP%]{display:flex;gap:.75rem;align-items:center;padding:1rem 1.25rem;border-radius:1.25rem;background:#fff;box-shadow:0 12px 26px #0f1a2b14}.trust-icon[_ngcontent-%COMP%]{width:44px;height:44px;border-radius:14px;background:#1c3d5a1a;color:var(--primary);display:grid;place-items:center;flex:0 0 auto}.partner-grid[_ngcontent-%COMP%]{display:grid;gap:1rem;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));margin-bottom:1rem}.partner-card[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1rem 1.25rem;border-radius:1.25rem;background:#fff;text-decoration:none;color:inherit;box-shadow:0 12px 26px #0f1a2b14;transition:transform .2s ease,box-shadow .2s ease}.partner-card[_ngcontent-%COMP%]:hover{transform:translateY(-2px);box-shadow:0 16px 30px #0f1a2b1f}.partner-cta[_ngcontent-%COMP%]{font-weight:600;color:var(--primary)}.partner-disclaimer[_ngcontent-%COMP%]{font-size:.9rem}"]})};function rY(n,e){if(n&1&&(p(0,"div",23)(1,"div",24),k(2,"i",25),m(),p(3,"h6"),v(4),m(),p(5,"p",8),v(6),m()()),n&2){let t=e.$implicit;E(2),x("ngClass",t.icon),E(2),O(t.title),E(2),O(t.description)}}function oY(n,e){if(n&1&&(p(0,"div",26)(1,"div",27)(2,"div",28)(3,"div",29),k(4,"i",25),m(),p(5,"h5"),v(6),m(),p(7,"p",30),v(8),m()()()()),n&2){let t=e.$implicit;E(4),x("ngClass",t.icon),E(2),O(t.title),E(2),O(t.description)}}function sY(n,e){if(n&1&&(p(0,"div",31)(1,"div",32),k(2,"i",25),m(),p(3,"div")(4,"h6"),v(5),m(),p(6,"p",30),v(7),m()()()),n&2){let t=e.$implicit;E(2),x("ngClass",t.icon),E(3),O(t.label),E(2),O(t.detail)}}var ug=class n{constructor(e){this.seo=e;this.seo.update({title:"About Himalayan Eco Inn | Leh Ladakh",description:"Discover Himalayan Eco Inn, a boutique hotel and homestay-style stay in Leh, Ladakh blending modern comfort with Ladakhi heritage.",keywords:"about Himalayan Eco Inn, Leh Ladakh boutique hotel, homestay in Ladakh, eco luxury hotel Leh"}),this.seo.injectBreadcrumb([{name:"Home",url:"https://himalayanecoinn.com/"},{name:"About",url:"https://himalayanecoinn.com/about"}])}values=[{title:"Eco-first hospitality",description:"Solar energy, water stewardship, and thoughtful local sourcing.",icon:"bi-leaf-fill"},{title:"Cultural connection",description:"Partnerships with Ladakhi artisans, guides, and storytellers.",icon:"bi-people-fill"},{title:"Modern comfort",description:"Luxury amenities designed for rest, recharge, and productivity.",icon:"bi-stars"}];signatureMoments=[{title:"Arrival ritual",description:"Warm Ladakhi welcome tea, local aromas, and a calm check-in flow.",icon:"bi-cup-hot-fill"},{title:"Mountain mornings",description:"Yoga, fresh breakfast spreads, and slow views over the valley.",icon:"bi-sunrise-fill"},{title:"Evening wind-down",description:"Soft lighting, stargazing deck, and curated dinner menus.",icon:"bi-moon-stars-fill"}];highlights=[{label:"Design",detail:"Local stone, warm wood, and Himalayan textures.",icon:"bi-bricks"},{label:"Cuisine",detail:"Seasonal Ladakhi plates and organic garden dining.",icon:"bi-egg-fried"},{label:"Wellness",detail:"Spa rituals, meditation decks, and slow living.",icon:"bi-heart-pulse-fill"},{label:"Concierge",detail:"Custom itineraries with local guides and drivers.",icon:"bi-compass-fill"}];static \u0275fac=function(t){return new(t||n)(N(Te))};static \u0275cmp=se({type:n,selectors:[["app-about"]],decls:70,vars:3,consts:[[1,"page-hero"],[1,"container"],[1,"eyebrow"],[1,"lead"],[1,"section-spacing"],[1,"row","align-items-center","g-4"],[1,"col-lg-6"],["src","assets/eco-inne-hotel.jpg","alt","Himalayan Eco Inn exterior",1,"img-fluid","rounded-4","shadow-soft"],[1,"text-muted"],[1,"value-grid"],["class","value-card",4,"ngFor","ngForOf"],[1,"section-heading"],[1,"row","g-4"],["class","col-md-6 col-lg-4",4,"ngFor","ngForOf"],[1,"section-spacing","bg-soft"],[1,"row","g-4","align-items-center"],[1,"col-lg-5"],[1,"list-unstyled","detail-list"],[1,"bi","bi-check-circle-fill"],[1,"col-lg-7"],[1,"stats-card"],[1,"highlight-grid"],["class","highlight-card",4,"ngFor","ngForOf"],[1,"value-card"],[1,"value-icon"],[1,"bi",3,"ngClass"],[1,"col-md-6","col-lg-4"],[1,"card","moment-card","h-100"],[1,"card-body"],[1,"moment-icon"],[1,"text-muted","mb-0"],[1,"highlight-card"],[1,"highlight-icon"]],template:function(t,i){t&1&&(p(0,"section",0)(1,"div",1)(2,"span",2),v(3,"About Us"),m(),p(4,"h1"),v(5,"Himalayan Eco Inn is a serene retreat in Leh."),m(),p(6,"p",3),v(7," Rooted in Ladakh's heritage and guided by sustainable luxury, we create warm, contemporary stays that celebrate the mountains. "),m(),p(8,"p"),v(9," As a boutique hotel in Leh, Himalayan Eco Inn offers a homestay-style experience with curated service, modern rooms, and the tranquility of Ladakh. "),m()()(),p(10,"section",4)(11,"div",1)(12,"div",5)(13,"div",6),k(14,"img",7),m(),p(15,"div",6)(16,"h2"),v(17,"Designed with nature, crafted for comfort."),m(),p(18,"p",8),v(19," Our boutique hotel blends local materials with modern design to create a peaceful sanctuary. From panoramic lounges to curated culinary journeys, every element is built for mindful hospitality. "),m(),p(20,"div",9),B(21,rY,7,3,"div",10),m()()()()(),p(22,"section",4)(23,"div",1)(24,"div",11)(25,"span",2),v(26,"Signature Moments"),m(),p(27,"h2"),v(28,"Thoughtful details that make every stay memorable."),m(),p(29,"p"),v(30,"We curate a seamless rhythm across mornings, afternoons, and evenings."),m()(),p(31,"div",12),B(32,oY,9,3,"div",13),m()()(),p(33,"section",14)(34,"div",1)(35,"div",15)(36,"div",16)(37,"h3"),v(38,"Why guests love us"),m(),p(39,"p",8),v(40," A seamless blend of local warmth, eco-conscious practices, and contemporary service. We offer personalized itineraries, curated cuisine, and panoramic views across Leh valley. "),m(),p(41,"ul",17)(42,"li"),k(43,"i",18),v(44," 24/7 concierge & travel assistance"),m(),p(45,"li"),k(46,"i",18),v(47," High-speed Wi-Fi and workspace"),m(),p(48,"li"),k(49,"i",18),v(50," Organic breakfast & dining lounge"),m()()(),p(51,"div",19)(52,"div",20)(53,"div")(54,"h2"),v(55,"15"),m(),p(56,"span"),v(57,"Premium rooms & suites"),m()(),p(58,"div")(59,"h2"),v(60,"1500m"),m(),p(61,"span"),v(62,"To Shanti Stupa view deck"),m()(),p(63,"div")(64,"h2"),v(65,"12+"),m(),p(66,"span"),v(67,"Curated experiences"),m()()(),p(68,"div",21),B(69,sY,8,3,"div",22),m()()()()()),t&2&&(E(21),x("ngForOf",i.values),E(11),x("ngForOf",i.signatureMoments),E(37),x("ngForOf",i.highlights))},dependencies:[ur,Le],styles:[".value-grid[_ngcontent-%COMP%]{display:grid;gap:1rem;margin-top:1.5rem}.value-card[_ngcontent-%COMP%]{padding:1rem 1.25rem;border-radius:1rem;background:#fff;box-shadow:0 12px 30px #0f1a2b14}.value-icon[_ngcontent-%COMP%]{width:44px;height:44px;border-radius:12px;background:#1c3d5a1a;color:var(--primary);display:grid;place-items:center;margin-bottom:.75rem}.detail-list[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-bottom:.75rem}.stats-card[_ngcontent-%COMP%]{background:#0f1a2b;color:#fff;border-radius:1.5rem;padding:2.5rem;display:grid;gap:1.5rem;grid-template-columns:repeat(auto-fit,minmax(180px,1fr))}.stats-card[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0}.moment-card[_ngcontent-%COMP%]{border:none;box-shadow:0 14px 34px #0f1a2b1a}.moment-icon[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:14px;background:#1c3d5a1f;color:var(--primary);display:grid;place-items:center;margin-bottom:1rem}.highlight-grid[_ngcontent-%COMP%]{display:grid;gap:1rem;margin-top:1.5rem}.highlight-card[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.75rem;padding:1rem 1.25rem;border-radius:1rem;background:#fff;box-shadow:0 12px 26px #0f1a2b14}.highlight-icon[_ngcontent-%COMP%]{width:40px;height:40px;border-radius:12px;background:#1c3d5a1a;color:var(--primary);display:grid;place-items:center;flex:0 0 auto}.stats-card[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{color:wheat}"]})};var aY=["experienceScroll"],cY=n=>["bi",n];function lY(n,e){if(n&1&&(p(0,"div",12)(1,"div",13)(2,"div",14),k(3,"i",15),m(),p(4,"h5"),v(5),m(),p(6,"p",16),v(7),m()()()),n&2){let t=e.$implicit;E(3),x("ngClass",ls(3,cY,t.icon)),E(2),O(t.title),E(2),O(t.description)}}function uY(n,e){if(n&1&&(p(0,"div",17)(1,"div",18),k(2,"img",19),p(3,"div",20)(4,"h5"),v(5),m(),p(6,"p",16),v(7),m()()()()),n&2){let t=e.$implicit;E(2),x("src",t.image,jt)("alt",t.title),E(3),O(t.title),E(2),O(t.description)}}var dg=class n{constructor(e){this.seo=e;this.seo.update({title:"Experience Ladakh | Himalayan Eco Inn",description:"Explore dining, wellness, cultural walks, and outdoor adventures curated by Himalayan Eco Inn in Leh, Ladakh.",keywords:"Ladakh experiences, Leh dining, Himalayan Eco Inn activities, hotel in Leh Ladakh, Ladakh homestay, Ladakh tours, Leh sightseeing tours"}),this.seo.injectBreadcrumb([{name:"Home",url:"https://himalayanecoinn.com/"},{name:"Experience",url:"https://himalayanecoinn.com/experience"}])}experienceList=Oc;experienceScroll;animationId;cleanupFns=[];autoScrollActive=!1;pauseUntil=0;categories=[{title:"Dining Experience",description:"Chef-led Ladakhi cuisine, organic garden harvests, and sunset dining.",image:"assets/ec-inn-view.jpg"},{title:"Rooms & Suites",description:"Warm textures, modern technology, and Himalayan-inspired interiors.",image:"assets/view-room.jpg"},{title:"Outdoor Experiences",description:"Guided trails, monastery visits, and panoramic rooftop moments.",image:"assets/view-co-inn.jpg"}];ngAfterViewInit(){this.startAutoScroll()}ngOnDestroy(){this.stopAutoScroll()}startAutoScroll(){if(typeof window>"u"||this.autoScrollActive)return;let e=this.experienceScroll?.nativeElement;if(!e||window.innerWidth>=992)return;this.autoScrollActive=!0;let t=performance.now(),i=s=>{let a=s-t;t=s,Date.now()>=this.pauseUntil&&(e.scrollLeft+=a*.05,e.scrollLeft+e.clientWidth>=e.scrollWidth-2&&(e.scrollLeft=0)),this.animationId=requestAnimationFrame(i)};this.animationId=requestAnimationFrame(i);let r=()=>{this.pauseUntil=Date.now()+2500};e.addEventListener("touchstart",r,{passive:!0}),e.addEventListener("pointerdown",r),e.addEventListener("wheel",r,{passive:!0}),this.cleanupFns.push(()=>e.removeEventListener("touchstart",r)),this.cleanupFns.push(()=>e.removeEventListener("pointerdown",r)),this.cleanupFns.push(()=>e.removeEventListener("wheel",r));let o=()=>{window.innerWidth>=992?this.stopAutoScroll():this.autoScrollActive||this.startAutoScroll()};window.addEventListener("resize",o),this.cleanupFns.push(()=>window.removeEventListener("resize",o))}stopAutoScroll(){this.animationId&&(cancelAnimationFrame(this.animationId),this.animationId=void 0),this.autoScrollActive=!1,this.cleanupFns.forEach(e=>e()),this.cleanupFns=[]}static \u0275fac=function(t){return new(t||n)(N(Te))};static \u0275cmp=se({type:n,selectors:[["app-experience"]],viewQuery:function(t,i){if(t&1&&Fn(aY,5),t&2){let r;ln(r=un())&&(i.experienceScroll=r.first)}},decls:31,vars:2,consts:[["experienceScroll",""],[1,"page-hero"],[1,"container"],[1,"eyebrow"],[1,"lead"],[1,"section-spacing"],[1,"section-heading"],[1,"row","g-4","experience-scroll"],["class","col-10 col-sm-7 col-md-6 col-lg-3 experience-item",4,"ngFor","ngForOf"],[1,"section-spacing","bg-soft"],[1,"row","g-4"],["class","col-lg-4",4,"ngFor","ngForOf"],[1,"col-10","col-sm-7","col-md-6","col-lg-3","experience-item"],[1,"card","p-2","experience-card","h-100"],[1,"icon-wrap"],[3,"ngClass"],[1,"text-muted"],[1,"col-lg-4"],[1,"card","experience-detail","h-100"],[3,"src","alt"],[1,"card-body"]],template:function(t,i){t&1&&(p(0,"section",1)(1,"div",2)(2,"span",3),v(3,"Experience"),m(),p(4,"h1"),v(5,"Crafted moments inspired by Ladakh."),m(),p(6,"p",4),v(7," From soulful dining to outdoor adventures, explore curated experiences that bring the Himalayas closer. "),m()()(),p(8,"section",5)(9,"div",2)(10,"div",6)(11,"span",3),v(12,"Signature Experiences"),m(),p(13,"h2"),v(14,"Handpicked moments across Leh and the Himalayas."),m(),p(15,"p"),v(16,"Balanced itineraries that blend culture, wellness, and outdoor adventure."),m()(),p(17,"div",7,0),B(19,lY,8,5,"div",8),m()()(),p(20,"section",9)(21,"div",2)(22,"div",6)(23,"span",3),v(24,"Curated Journeys"),m(),p(25,"h2"),v(26,"Choose a theme that matches your travel style."),m(),p(27,"p"),v(28,"From culinary discoveries to scenic drives, every journey feels personal."),m()(),p(29,"div",10),B(30,uY,8,4,"div",11),m()()()),t&2&&(E(19),x("ngForOf",i.experienceList),E(11),x("ngForOf",i.categories))},dependencies:[ur,Le],styles:[".experience-card[_ngcontent-%COMP%] .icon-wrap[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:12px;background:#15294614;display:grid;place-items:center;color:var(--primary);margin-bottom:1rem}.experience-card[_ngcontent-%COMP%]{box-shadow:0 12px 30px #0f1a2b1f}.experience-scroll[_ngcontent-%COMP%]{flex-wrap:nowrap}@media (max-width: 991px){.experience-scroll[_ngcontent-%COMP%]{overflow-x:auto;padding-bottom:1rem;scrollbar-width:none;scroll-snap-type:x mandatory}.experience-scroll[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}.experience-item[_ngcontent-%COMP%]{flex:0 0 auto;scroll-snap-align:start}}.experience-detail[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:100%;height:220px;object-fit:cover}"]})};function dY(n,e){if(n&1&&(p(0,"li"),k(1,"i",23),v(2),m()),n&2){let t=e.$implicit;E(2),ye("",t," ")}}function fY(n,e){if(n&1&&(p(0,"li"),k(1,"i",24),v(2),m()),n&2){let t=e.$implicit;E(2),ye("",t," ")}}function hY(n,e){if(n&1&&(p(0,"div",16)(1,"div",17),k(2,"img",18),p(3,"div",19)(4,"h5"),v(5),m(),p(6,"p",20),v(7),m(),p(8,"span",21),v(9),m(),p(10,"h6",22),v(11,"Amenities"),m(),p(12,"ul",13),B(13,dY,3,1,"li",14),m(),p(14,"h6"),v(15,"Room features"),m(),p(16,"ul",13),B(17,fY,3,1,"li",14),m()()()()),n&2){let t=e.$implicit;E(2),x("src",t.image,jt)("alt",t.name),E(3),O(t.name),E(2),Ua("",t.view," \u2022 ",t.size),E(2),O(t.price),E(4),x("ngForOf",t.amenities),E(4),x("ngForOf",t.features)}}function pY(n,e){if(n&1&&(p(0,"li"),k(1,"i",23),v(2),m()),n&2){let t=e.$implicit;E(2),ye("",t," ")}}var fg=class n{constructor(e){this.seo=e;this.seo.update({title:"Rooms & Amenities | Himalayan Eco Inn",description:"Discover Himalayan Eco Inn rooms in Leh, Ladakh with mountain views, modern amenities, and homestay-style comfort.",keywords:"hotel rooms in Leh, Ladakh rooms and suites, homestay rooms Ladakh, Himalayan Eco Inn amenities, Leh hotel rooms, Ladakh hotel rooms, Ladakh tour stay packages"}),this.seo.injectBreadcrumb([{name:"Home",url:"https://himalayanecoinn.com/"},{name:"Rooms",url:"https://himalayanecoinn.com/rooms"}])}rooms=ho;amenities=["Heated flooring and climate control","Organic bath amenities","High-speed Wi-Fi and smart TV","24/7 concierge assistance","Eco-friendly toiletries and linen"];static \u0275fac=function(t){return new(t||n)(N(Te))};static \u0275cmp=se({type:n,selectors:[["app-rooms"]],decls:43,vars:2,consts:[[1,"page-hero"],[1,"container"],[1,"eyebrow"],[1,"lead"],["routerLink","/contact"],[1,"section-spacing"],[1,"section-heading"],[1,"row","g-4"],["class","col-lg-4",4,"ngFor","ngForOf"],[1,"section-spacing","bg-soft"],[1,"row","g-4","align-items-center"],[1,"col-lg-6"],[1,"text-muted"],[1,"list-unstyled","amenity-list"],[4,"ngFor","ngForOf"],["src","assets/eco-inne-view-room.jpg","alt","Room interior Himalayan Eco Inn",1,"img-fluid","rounded-4","shadow-soft"],[1,"col-lg-4"],[1,"card","room-card","h-100"],[3,"src","alt"],[1,"card-body"],[1,"text-muted","mb-2"],[1,"price-tag"],[1,"mt-3"],[1,"bi","bi-check-circle-fill"],[1,"bi","bi-star-fill"]],template:function(t,i){t&1&&(p(0,"section",0)(1,"div",1)(2,"span",2),v(3,"Rooms & Amenities"),m(),p(4,"h1"),v(5,"Comfortable spaces with Himalayan serenity."),m(),p(6,"p",3),v(7," Choose from spacious rooms and suites designed for rest, rejuvenation, and breathtaking views. "),m(),p(8,"p"),v(9," Looking for hotel rooms in Leh or a peaceful homestay in Ladakh? Our rooms combine boutique hospitality with modern comforts for a calm stay in the heart of Leh. "),p(10,"a",4),v(11,"Contact us"),m(),v(12," to book your dates. "),m()()(),p(13,"section",5)(14,"div",1)(15,"div",6)(16,"span",2),v(17,"Suites & Rooms"),m(),p(18,"h2"),v(19,"Modern interiors inspired by Ladakhi warmth."),m(),p(20,"p"),v(21,"Every room balances airy layouts, smart amenities, and serene mountain views."),m()(),p(22,"div",7),B(23,hY,18,8,"div",8),m()()(),p(24,"section",9)(25,"div",1)(26,"div",6)(27,"span",2),v(28,"In-Room Comfort"),m(),p(29,"h2"),v(30,"Signature amenities in every category."),m(),p(31,"p"),v(32,"Enjoy thoughtful essentials designed to support rest, work, and relaxation."),m()(),p(33,"div",10)(34,"div",11)(35,"h2"),v(36,"Standard amenities for every stay"),m(),p(37,"p",12),v(38," We maintain consistent comfort, premium essentials, and eco-friendly details across every room category. "),m(),p(39,"ul",13),B(40,pY,3,1,"li",14),m()(),p(41,"div",11),k(42,"img",15),m()()()()),t&2&&(E(23),x("ngForOf",i.rooms),E(17),x("ngForOf",i.amenities))},dependencies:[Le],encapsulation:2})};var FP=(()=>{class n{_renderer;_elementRef;onChange=t=>{};onTouched=()=>{};constructor(t,i){this._renderer=t,this._elementRef=i}setProperty(t,i){this._renderer.setProperty(this._elementRef.nativeElement,t,i)}registerOnTouched(t){this.onTouched=t}registerOnChange(t){this.onChange=t}setDisabledState(t){this.setProperty("disabled",t)}static \u0275fac=function(i){return new(i||n)(N(Ti),N(an))};static \u0275dir=ot({type:n})}return n})(),mY=(()=>{class n extends FP{static \u0275fac=(()=>{let t;return function(r){return(t||(t=La(n)))(r||n)}})();static \u0275dir=ot({type:n,features:[Jn]})}return n})(),cI=new P("");var gY={provide:cI,useExisting:vi(()=>Bi),multi:!0};function vY(){let n=wn()?wn().getUserAgent():"";return/android (\d+)/.test(n.toLowerCase())}var yY=new P(""),Bi=(()=>{class n extends FP{_compositionMode;_composing=!1;constructor(t,i,r){super(t,i),this._compositionMode=r,this._compositionMode==null&&(this._compositionMode=!vY())}writeValue(t){let i=t??"";this.setProperty("value",i)}_handleInput(t){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(t)}_compositionStart(){this._composing=!0}_compositionEnd(t){this._composing=!1,this._compositionMode&&this.onChange(t)}static \u0275fac=function(i){return new(i||n)(N(Ti),N(an),N(yY,8))};static \u0275dir=ot({type:n,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(i,r){i&1&&ve("input",function(s){return r._handleInput(s.target.value)})("blur",function(){return r.onTouched()})("compositionstart",function(){return r._compositionStart()})("compositionend",function(s){return r._compositionEnd(s.target.value)})},standalone:!1,features:[cs([gY]),Jn]})}return n})();function lI(n){return n==null||uI(n)===0}function uI(n){return n==null?null:Array.isArray(n)||typeof n=="string"?n.length:n instanceof Set?n.size:null}var wg=new P(""),Cg=new P(""),_Y=/^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Ht=class{static min(e){return bY(e)}static max(e){return EY(e)}static required(e){return wY(e)}static requiredTrue(e){return CY(e)}static email(e){return IY(e)}static minLength(e){return SY(e)}static maxLength(e){return DY(e)}static pattern(e){return TY(e)}static nullValidator(e){return VP()}static compose(e){return zP(e)}static composeAsync(e){return WP(e)}};function bY(n){return e=>{if(e.value==null||n==null)return null;let t=parseFloat(e.value);return!isNaN(t)&&t{if(e.value==null||n==null)return null;let t=parseFloat(e.value);return!isNaN(t)&&t>n?{max:{max:n,actual:e.value}}:null}}function wY(n){return lI(n.value)?{required:!0}:null}function CY(n){return n.value===!0?null:{required:!0}}function IY(n){return lI(n.value)||_Y.test(n.value)?null:{email:!0}}function SY(n){return e=>{let t=e.value?.length??uI(e.value);return t===null||t===0?null:t{let t=e.value?.length??uI(e.value);return t!==null&&t>n?{maxlength:{requiredLength:n,actualLength:t}}:null}}function TY(n){if(!n)return VP;let e,t;return typeof n=="string"?(t="",n.charAt(0)!=="^"&&(t+="^"),t+=n,n.charAt(n.length-1)!=="$"&&(t+="$"),e=new RegExp(t)):(t=n.toString(),e=n),i=>{if(lI(i.value))return null;let r=i.value;return e.test(r)?null:{pattern:{requiredPattern:t,actualValue:r}}}}function VP(n){return null}function jP(n){return n!=null}function BP(n){return cr(n)?ke(n):n}function UP(n){let e={};return n.forEach(t=>{e=t!=null?A(A({},e),t):e}),Object.keys(e).length===0?null:e}function HP(n,e){return e.map(t=>t(n))}function xY(n){return!n.validate}function $P(n){return n.map(e=>xY(e)?e:t=>e.validate(t))}function zP(n){if(!n)return null;let e=n.filter(jP);return e.length==0?null:function(t){return UP(HP(t,e))}}function dI(n){return n!=null?zP($P(n)):null}function WP(n){if(!n)return null;let e=n.filter(jP);return e.length==0?null:function(t){let i=HP(t,e).map(BP);return Zv(i).pipe(z(UP))}}function fI(n){return n!=null?WP($P(n)):null}function AP(n,e){return n===null?[e]:Array.isArray(n)?[...n,e]:[n,e]}function qP(n){return n._rawValidators}function GP(n){return n._rawAsyncValidators}function oI(n){return n?Array.isArray(n)?n:[n]:[]}function pg(n,e){return Array.isArray(n)?n.includes(e):n===e}function MP(n,e){let t=oI(e);return oI(n).forEach(r=>{pg(t,r)||t.push(r)}),t}function RP(n,e){return oI(e).filter(t=>!pg(n,t))}var mg=class{get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators=[];_rawAsyncValidators=[];_setValidators(e){this._rawValidators=e||[],this._composedValidatorFn=dI(this._rawValidators)}_setAsyncValidators(e){this._rawAsyncValidators=e||[],this._composedAsyncValidatorFn=fI(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_onDestroyCallbacks=[];_registerOnDestroy(e){this._onDestroyCallbacks.push(e)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(e=>e()),this._onDestroyCallbacks=[]}reset(e=void 0){this.control&&this.control.reset(e)}hasError(e,t){return this.control?this.control.hasError(e,t):!1}getError(e,t){return this.control?this.control.getError(e,t):null}},_r=class extends mg{name;get formDirective(){return null}get path(){return null}},js=class extends mg{_parent=null;name=null;valueAccessor=null},gg=class{_cd;constructor(e){this._cd=e}get isTouched(){return this._cd?.control?._touched?.(),!!this._cd?.control?.touched}get isUntouched(){return!!this._cd?.control?.untouched}get isPristine(){return this._cd?.control?._pristine?.(),!!this._cd?.control?.pristine}get isDirty(){return!!this._cd?.control?.dirty}get isValid(){return this._cd?.control?._status?.(),!!this._cd?.control?.valid}get isInvalid(){return!!this._cd?.control?.invalid}get isPending(){return!!this._cd?.control?.pending}get isSubmitted(){return this._cd?._submitted?.(),!!this._cd?.submitted}},AY={"[class.ng-untouched]":"isUntouched","[class.ng-touched]":"isTouched","[class.ng-pristine]":"isPristine","[class.ng-dirty]":"isDirty","[class.ng-valid]":"isValid","[class.ng-invalid]":"isInvalid","[class.ng-pending]":"isPending"},o0e=G(A({},AY),{"[class.ng-submitted]":"isSubmitted"}),mo=(()=>{class n extends gg{constructor(t){super(t)}static \u0275fac=function(i){return new(i||n)(N(js,2))};static \u0275dir=ot({type:n,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(i,r){i&2&&Bt("ng-untouched",r.isUntouched)("ng-touched",r.isTouched)("ng-pristine",r.isPristine)("ng-dirty",r.isDirty)("ng-valid",r.isValid)("ng-invalid",r.isInvalid)("ng-pending",r.isPending)},standalone:!1,features:[Jn]})}return n})(),Uc=(()=>{class n extends gg{constructor(t){super(t)}static \u0275fac=function(i){return new(i||n)(N(_r,10))};static \u0275dir=ot({type:n,selectors:[["","formGroupName",""],["","formArrayName",""],["","ngModelGroup",""],["","formGroup",""],["form",3,"ngNoForm",""],["","ngForm",""]],hostVars:16,hostBindings:function(i,r){i&2&&Bt("ng-untouched",r.isUntouched)("ng-touched",r.isTouched)("ng-pristine",r.isPristine)("ng-dirty",r.isDirty)("ng-valid",r.isValid)("ng-invalid",r.isInvalid)("ng-pending",r.isPending)("ng-submitted",r.isSubmitted)},standalone:!1,features:[Jn]})}return n})();var gd="VALID",hg="INVALID",Fc="PENDING",vd="DISABLED",po=class{},vg=class extends po{value;source;constructor(e,t){super(),this.value=e,this.source=t}},_d=class extends po{pristine;source;constructor(e,t){super(),this.pristine=e,this.source=t}},bd=class extends po{touched;source;constructor(e,t){super(),this.touched=e,this.source=t}},Vc=class extends po{status;source;constructor(e,t){super(),this.status=e,this.source=t}},yg=class extends po{source;constructor(e){super(),this.source=e}},wd=class extends po{source;constructor(e){super(),this.source=e}};function hI(n){return(Ig(n)?n.validators:n)||null}function MY(n){return Array.isArray(n)?dI(n):n||null}function pI(n,e){return(Ig(e)?e.asyncValidators:n)||null}function RY(n){return Array.isArray(n)?fI(n):n||null}function Ig(n){return n!=null&&!Array.isArray(n)&&typeof n=="object"}function YP(n,e,t){let i=n.controls;if(!(e?Object.keys(i):i).length)throw new V(1e3,"");if(!i[t])throw new V(1001,"")}function KP(n,e,t){n._forEachChild((i,r)=>{if(t[r]===void 0)throw new V(1002,"")})}var jc=class{_pendingDirty=!1;_hasOwnPendingAsyncValidator=null;_pendingTouched=!1;_onCollectionChange=()=>{};_updateOn;_parent=null;_asyncValidationSubscription;_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators;_rawAsyncValidators;value;constructor(e,t){this._assignValidators(e),this._assignAsyncValidators(t)}get validator(){return this._composedValidatorFn}set validator(e){this._rawValidators=this._composedValidatorFn=e}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(e){this._rawAsyncValidators=this._composedAsyncValidatorFn=e}get parent(){return this._parent}get status(){return st(this.statusReactive)}set status(e){st(()=>this.statusReactive.set(e))}_status=$r(()=>this.statusReactive());statusReactive=on(void 0);get valid(){return this.status===gd}get invalid(){return this.status===hg}get pending(){return this.status==Fc}get disabled(){return this.status===vd}get enabled(){return this.status!==vd}errors;get pristine(){return st(this.pristineReactive)}set pristine(e){st(()=>this.pristineReactive.set(e))}_pristine=$r(()=>this.pristineReactive());pristineReactive=on(!0);get dirty(){return!this.pristine}get touched(){return st(this.touchedReactive)}set touched(e){st(()=>this.touchedReactive.set(e))}_touched=$r(()=>this.touchedReactive());touchedReactive=on(!1);get untouched(){return!this.touched}_events=new Ge;events=this._events.asObservable();valueChanges;statusChanges;get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(e){this._assignValidators(e)}setAsyncValidators(e){this._assignAsyncValidators(e)}addValidators(e){this.setValidators(MP(e,this._rawValidators))}addAsyncValidators(e){this.setAsyncValidators(MP(e,this._rawAsyncValidators))}removeValidators(e){this.setValidators(RP(e,this._rawValidators))}removeAsyncValidators(e){this.setAsyncValidators(RP(e,this._rawAsyncValidators))}hasValidator(e){return pg(this._rawValidators,e)}hasAsyncValidator(e){return pg(this._rawAsyncValidators,e)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(e={}){let t=this.touched===!1;this.touched=!0;let i=e.sourceControl??this;this._parent&&!e.onlySelf&&this._parent.markAsTouched(G(A({},e),{sourceControl:i})),t&&e.emitEvent!==!1&&this._events.next(new bd(!0,i))}markAllAsDirty(e={}){this.markAsDirty({onlySelf:!0,emitEvent:e.emitEvent,sourceControl:this}),this._forEachChild(t=>t.markAllAsDirty(e))}markAllAsTouched(e={}){this.markAsTouched({onlySelf:!0,emitEvent:e.emitEvent,sourceControl:this}),this._forEachChild(t=>t.markAllAsTouched(e))}markAsUntouched(e={}){let t=this.touched===!0;this.touched=!1,this._pendingTouched=!1;let i=e.sourceControl??this;this._forEachChild(r=>{r.markAsUntouched({onlySelf:!0,emitEvent:e.emitEvent,sourceControl:i})}),this._parent&&!e.onlySelf&&this._parent._updateTouched(e,i),t&&e.emitEvent!==!1&&this._events.next(new bd(!1,i))}markAsDirty(e={}){let t=this.pristine===!0;this.pristine=!1;let i=e.sourceControl??this;this._parent&&!e.onlySelf&&this._parent.markAsDirty(G(A({},e),{sourceControl:i})),t&&e.emitEvent!==!1&&this._events.next(new _d(!1,i))}markAsPristine(e={}){let t=this.pristine===!1;this.pristine=!0,this._pendingDirty=!1;let i=e.sourceControl??this;this._forEachChild(r=>{r.markAsPristine({onlySelf:!0,emitEvent:e.emitEvent})}),this._parent&&!e.onlySelf&&this._parent._updatePristine(e,i),t&&e.emitEvent!==!1&&this._events.next(new _d(!0,i))}markAsPending(e={}){this.status=Fc;let t=e.sourceControl??this;e.emitEvent!==!1&&(this._events.next(new Vc(this.status,t)),this.statusChanges.emit(this.status)),this._parent&&!e.onlySelf&&this._parent.markAsPending(G(A({},e),{sourceControl:t}))}disable(e={}){let t=this._parentMarkedDirty(e.onlySelf);this.status=vd,this.errors=null,this._forEachChild(r=>{r.disable(G(A({},e),{onlySelf:!0}))}),this._updateValue();let i=e.sourceControl??this;e.emitEvent!==!1&&(this._events.next(new vg(this.value,i)),this._events.next(new Vc(this.status,i)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(G(A({},e),{skipPristineCheck:t}),this),this._onDisabledChange.forEach(r=>r(!0))}enable(e={}){let t=this._parentMarkedDirty(e.onlySelf);this.status=gd,this._forEachChild(i=>{i.enable(G(A({},e),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent}),this._updateAncestors(G(A({},e),{skipPristineCheck:t}),this),this._onDisabledChange.forEach(i=>i(!1))}_updateAncestors(e,t){this._parent&&!e.onlySelf&&(this._parent.updateValueAndValidity(e),e.skipPristineCheck||this._parent._updatePristine({},t),this._parent._updateTouched({},t))}setParent(e){this._parent=e}getRawValue(){return this.value}updateValueAndValidity(e={}){if(this._setInitialStatus(),this._updateValue(),this.enabled){let i=this._cancelExistingSubscription();this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===gd||this.status===Fc)&&this._runAsyncValidator(i,e.emitEvent)}let t=e.sourceControl??this;e.emitEvent!==!1&&(this._events.next(new vg(this.value,t)),this._events.next(new Vc(this.status,t)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!e.onlySelf&&this._parent.updateValueAndValidity(G(A({},e),{sourceControl:t}))}_updateTreeValidity(e={emitEvent:!0}){this._forEachChild(t=>t._updateTreeValidity(e)),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?vd:gd}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(e,t){if(this.asyncValidator){this.status=Fc,this._hasOwnPendingAsyncValidator={emitEvent:t!==!1,shouldHaveEmitted:e!==!1};let i=BP(this.asyncValidator(this));this._asyncValidationSubscription=i.subscribe(r=>{this._hasOwnPendingAsyncValidator=null,this.setErrors(r,{emitEvent:t,shouldHaveEmitted:e})})}}_cancelExistingSubscription(){if(this._asyncValidationSubscription){this._asyncValidationSubscription.unsubscribe();let e=(this._hasOwnPendingAsyncValidator?.emitEvent||this._hasOwnPendingAsyncValidator?.shouldHaveEmitted)??!1;return this._hasOwnPendingAsyncValidator=null,e}return!1}setErrors(e,t={}){this.errors=e,this._updateControlsErrors(t.emitEvent!==!1,this,t.shouldHaveEmitted)}get(e){let t=e;return t==null||(Array.isArray(t)||(t=t.split(".")),t.length===0)?null:t.reduce((i,r)=>i&&i._find(r),this)}getError(e,t){let i=t?this.get(t):this;return i&&i.errors?i.errors[e]:null}hasError(e,t){return!!this.getError(e,t)}get root(){let e=this;for(;e._parent;)e=e._parent;return e}_updateControlsErrors(e,t,i){this.status=this._calculateStatus(),e&&this.statusChanges.emit(this.status),(e||i)&&this._events.next(new Vc(this.status,t)),this._parent&&this._parent._updateControlsErrors(e,t,i)}_initObservables(){this.valueChanges=new Ke,this.statusChanges=new Ke}_calculateStatus(){return this._allControlsDisabled()?vd:this.errors?hg:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(Fc)?Fc:this._anyControlsHaveStatus(hg)?hg:gd}_anyControlsHaveStatus(e){return this._anyControls(t=>t.status===e)}_anyControlsDirty(){return this._anyControls(e=>e.dirty)}_anyControlsTouched(){return this._anyControls(e=>e.touched)}_updatePristine(e,t){let i=!this._anyControlsDirty(),r=this.pristine!==i;this.pristine=i,this._parent&&!e.onlySelf&&this._parent._updatePristine(e,t),r&&this._events.next(new _d(this.pristine,t))}_updateTouched(e={},t){this.touched=this._anyControlsTouched(),this._events.next(new bd(this.touched,t)),this._parent&&!e.onlySelf&&this._parent._updateTouched(e,t)}_onDisabledChange=[];_registerOnCollectionChange(e){this._onCollectionChange=e}_setUpdateStrategy(e){Ig(e)&&e.updateOn!=null&&(this._updateOn=e.updateOn)}_parentMarkedDirty(e){let t=this._parent&&this._parent.dirty;return!e&&!!t&&!this._parent._anyControlsDirty()}_find(e){return null}_assignValidators(e){this._rawValidators=Array.isArray(e)?e.slice():e,this._composedValidatorFn=MY(this._rawValidators)}_assignAsyncValidators(e){this._rawAsyncValidators=Array.isArray(e)?e.slice():e,this._composedAsyncValidatorFn=RY(this._rawAsyncValidators)}},Bc=class extends jc{constructor(e,t,i){super(hI(t),pI(i,t)),this.controls=e,this._initObservables(),this._setUpdateStrategy(t),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}controls;registerControl(e,t){return this.controls[e]?this.controls[e]:(this.controls[e]=t,t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange),t)}addControl(e,t,i={}){this.registerControl(e,t),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}removeControl(e,t={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],this.updateValueAndValidity({emitEvent:t.emitEvent}),this._onCollectionChange()}setControl(e,t,i={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],t&&this.registerControl(e,t),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}contains(e){return this.controls.hasOwnProperty(e)&&this.controls[e].enabled}setValue(e,t={}){KP(this,!0,e),Object.keys(e).forEach(i=>{YP(this,!0,i),this.controls[i].setValue(e[i],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}patchValue(e,t={}){e!=null&&(Object.keys(e).forEach(i=>{let r=this.controls[i];r&&r.patchValue(e[i],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t))}reset(e={},t={}){this._forEachChild((i,r)=>{i.reset(e?e[r]:null,{onlySelf:!0,emitEvent:t.emitEvent})}),this._updatePristine(t,this),this._updateTouched(t,this),this.updateValueAndValidity(t),t?.emitEvent!==!1&&this._events.next(new wd(this))}getRawValue(){return this._reduceChildren({},(e,t,i)=>(e[i]=t.getRawValue(),e))}_syncPendingControls(){let e=this._reduceChildren(!1,(t,i)=>i._syncPendingControls()?!0:t);return e&&this.updateValueAndValidity({onlySelf:!0}),e}_forEachChild(e){Object.keys(this.controls).forEach(t=>{let i=this.controls[t];i&&e(i,t)})}_setUpControls(){this._forEachChild(e=>{e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(e){for(let[t,i]of Object.entries(this.controls))if(this.contains(t)&&e(i))return!0;return!1}_reduceValue(){let e={};return this._reduceChildren(e,(t,i,r)=>((i.enabled||this.disabled)&&(t[r]=i.value),t))}_reduceChildren(e,t){let i=e;return this._forEachChild((r,o)=>{i=t(i,r,o)}),i}_allControlsDisabled(){for(let e of Object.keys(this.controls))if(this.controls[e].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_find(e){return this.controls.hasOwnProperty(e)?this.controls[e]:null}};var sI=class extends Bc{};var Cd=new P("",{providedIn:"root",factory:()=>Sg}),Sg="always";function QP(n,e){return[...e.path,n]}function _g(n,e,t=Sg){mI(n,e),e.valueAccessor.writeValue(n.value),(n.disabled||t==="always")&&e.valueAccessor.setDisabledState?.(n.disabled),NY(n,e),PY(n,e),OY(n,e),kY(n,e)}function kP(n,e,t=!0){let i=()=>{};e.valueAccessor&&(e.valueAccessor.registerOnChange(i),e.valueAccessor.registerOnTouched(i)),Eg(n,e),n&&(e._invokeOnDestroyCallbacks(),n._registerOnCollectionChange(()=>{}))}function bg(n,e){n.forEach(t=>{t.registerOnValidatorChange&&t.registerOnValidatorChange(e)})}function kY(n,e){if(e.valueAccessor.setDisabledState){let t=i=>{e.valueAccessor.setDisabledState(i)};n.registerOnDisabledChange(t),e._registerOnDestroy(()=>{n._unregisterOnDisabledChange(t)})}}function mI(n,e){let t=qP(n);e.validator!==null?n.setValidators(AP(t,e.validator)):typeof t=="function"&&n.setValidators([t]);let i=GP(n);e.asyncValidator!==null?n.setAsyncValidators(AP(i,e.asyncValidator)):typeof i=="function"&&n.setAsyncValidators([i]);let r=()=>n.updateValueAndValidity();bg(e._rawValidators,r),bg(e._rawAsyncValidators,r)}function Eg(n,e){let t=!1;if(n!==null){if(e.validator!==null){let r=qP(n);if(Array.isArray(r)&&r.length>0){let o=r.filter(s=>s!==e.validator);o.length!==r.length&&(t=!0,n.setValidators(o))}}if(e.asyncValidator!==null){let r=GP(n);if(Array.isArray(r)&&r.length>0){let o=r.filter(s=>s!==e.asyncValidator);o.length!==r.length&&(t=!0,n.setAsyncValidators(o))}}}let i=()=>{};return bg(e._rawValidators,i),bg(e._rawAsyncValidators,i),t}function NY(n,e){e.valueAccessor.registerOnChange(t=>{n._pendingValue=t,n._pendingChange=!0,n._pendingDirty=!0,n.updateOn==="change"&&ZP(n,e)})}function OY(n,e){e.valueAccessor.registerOnTouched(()=>{n._pendingTouched=!0,n.updateOn==="blur"&&n._pendingChange&&ZP(n,e),n.updateOn!=="submit"&&n.markAsTouched()})}function ZP(n,e){n._pendingDirty&&n.markAsDirty(),n.setValue(n._pendingValue,{emitModelToViewChange:!1}),e.viewToModelUpdate(n._pendingValue),n._pendingChange=!1}function PY(n,e){let t=(i,r)=>{e.valueAccessor.writeValue(i),r&&e.viewToModelUpdate(i)};n.registerOnChange(t),e._registerOnDestroy(()=>{n._unregisterOnChange(t)})}function XP(n,e){n==null,mI(n,e)}function LY(n,e){return Eg(n,e)}function JP(n,e){if(!n.hasOwnProperty("model"))return!1;let t=n.model;return t.isFirstChange()?!0:!Object.is(e,t.currentValue)}function FY(n){return Object.getPrototypeOf(n.constructor)===mY}function eL(n,e){n._syncPendingControls(),e.forEach(t=>{let i=t.control;i.updateOn==="submit"&&i._pendingChange&&(t.viewToModelUpdate(i._pendingValue),i._pendingChange=!1)})}function tL(n,e){if(!e)return null;Array.isArray(e);let t,i,r;return e.forEach(o=>{o.constructor===Bi?t=o:FY(o)?i=o:r=o}),r||i||t||null}function VY(n,e){let t=n.indexOf(e);t>-1&&n.splice(t,1)}var jY={provide:_r,useExisting:vi(()=>gI)},yd=Promise.resolve(),gI=(()=>{class n extends _r{callSetDisabledState;get submitted(){return st(this.submittedReactive)}_submitted=$r(()=>this.submittedReactive());submittedReactive=on(!1);_directives=new Set;form;ngSubmit=new Ke;options;constructor(t,i,r){super(),this.callSetDisabledState=r,this.form=new Bc({},dI(t),fI(i))}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(t){yd.then(()=>{let i=this._findContainer(t.path);t.control=i.registerControl(t.name,t.control),_g(t.control,t,this.callSetDisabledState),t.control.updateValueAndValidity({emitEvent:!1}),this._directives.add(t)})}getControl(t){return this.form.get(t.path)}removeControl(t){yd.then(()=>{let i=this._findContainer(t.path);i&&i.removeControl(t.name),this._directives.delete(t)})}addFormGroup(t){yd.then(()=>{let i=this._findContainer(t.path),r=new Bc({});XP(r,t),i.registerControl(t.name,r),r.updateValueAndValidity({emitEvent:!1})})}removeFormGroup(t){yd.then(()=>{let i=this._findContainer(t.path);i&&i.removeControl(t.name)})}getFormGroup(t){return this.form.get(t.path)}updateModel(t,i){yd.then(()=>{this.form.get(t.path).setValue(i)})}setValue(t){this.control.setValue(t)}onSubmit(t){return this.submittedReactive.set(!0),eL(this.form,this._directives),this.ngSubmit.emit(t),this.form._events.next(new yg(this.control)),t?.target?.method==="dialog"}onReset(){this.resetForm()}resetForm(t=void 0){this.form.reset(t),this.submittedReactive.set(!1)}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.form._updateOn=this.options.updateOn)}_findContainer(t){return t.pop(),t.length?this.form.get(t):this.form}static \u0275fac=function(i){return new(i||n)(N(wg,10),N(Cg,10),N(Cd,8))};static \u0275dir=ot({type:n,selectors:[["form",3,"ngNoForm","",3,"formGroup",""],["ng-form"],["","ngForm",""]],hostBindings:function(i,r){i&1&&ve("submit",function(s){return r.onSubmit(s)})("reset",function(){return r.onReset()})},inputs:{options:[0,"ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],standalone:!1,features:[cs([jY]),Jn]})}return n})();function NP(n,e){let t=n.indexOf(e);t>-1&&n.splice(t,1)}function OP(n){return typeof n=="object"&&n!==null&&Object.keys(n).length===2&&"value"in n&&"disabled"in n}var Ed=class extends jc{defaultValue=null;_onChange=[];_pendingValue;_pendingChange=!1;constructor(e=null,t,i){super(hI(t),pI(i,t)),this._applyFormState(e),this._setUpdateStrategy(t),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator}),Ig(t)&&(t.nonNullable||t.initialValueIsDefault)&&(OP(e)?this.defaultValue=e.value:this.defaultValue=e)}setValue(e,t={}){this.value=this._pendingValue=e,this._onChange.length&&t.emitModelToViewChange!==!1&&this._onChange.forEach(i=>i(this.value,t.emitViewToModelChange!==!1)),this.updateValueAndValidity(t)}patchValue(e,t={}){this.setValue(e,t)}reset(e=this.defaultValue,t={}){this._applyFormState(e),this.markAsPristine(t),this.markAsUntouched(t),this.setValue(this.value,t),this._pendingChange=!1,t?.emitEvent!==!1&&this._events.next(new wd(this))}_updateValue(){}_anyControls(e){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(e){this._onChange.push(e)}_unregisterOnChange(e){NP(this._onChange,e)}registerOnDisabledChange(e){this._onDisabledChange.push(e)}_unregisterOnDisabledChange(e){NP(this._onDisabledChange,e)}_forEachChild(e){}_syncPendingControls(){return this.updateOn==="submit"&&(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),this._pendingChange)?(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),!0):!1}_applyFormState(e){OP(e)?(this.value=this._pendingValue=e.value,e.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=e}};var BY=n=>n instanceof Ed;var UY={provide:js,useExisting:vi(()=>Id)},PP=Promise.resolve(),Id=(()=>{class n extends js{_changeDetectorRef;callSetDisabledState;control=new Ed;static ngAcceptInputType_isDisabled;_registered=!1;viewModel;name="";isDisabled;model;options;update=new Ke;constructor(t,i,r,o,s,a){super(),this._changeDetectorRef=s,this.callSetDisabledState=a,this._parent=t,this._setValidators(i),this._setAsyncValidators(r),this.valueAccessor=tL(this,o)}ngOnChanges(t){if(this._checkForErrors(),!this._registered||"name"in t){if(this._registered&&(this._checkName(),this.formDirective)){let i=t.name.previousValue;this.formDirective.removeControl({name:i,path:this._getPath(i)})}this._setUpControl()}"isDisabled"in t&&this._updateDisabled(t),JP(t,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}get path(){return this._getPath(this.name)}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(t){this.viewModel=t,this.update.emit(t)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!!(this.options&&this.options.standalone)}_setUpStandalone(){_g(this.control,this,this.callSetDisabledState),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._checkName()}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),!this._isStandalone()&&this.name}_updateValue(t){PP.then(()=>{this.control.setValue(t,{emitViewToModelChange:!1}),this._changeDetectorRef?.markForCheck()})}_updateDisabled(t){let i=t.isDisabled.currentValue,r=i!==0&&ds(i);PP.then(()=>{r&&!this.control.disabled?this.control.disable():!r&&this.control.disabled&&this.control.enable(),this._changeDetectorRef?.markForCheck()})}_getPath(t){return this._parent?QP(t,this._parent):[t]}static \u0275fac=function(i){return new(i||n)(N(_r,9),N(wg,10),N(Cg,10),N(cI,10),N(lr,8),N(Cd,8))};static \u0275dir=ot({type:n,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:[0,"disabled","isDisabled"],model:[0,"ngModel","model"],options:[0,"ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],standalone:!1,features:[cs([UY]),Jn,Xn]})}return n})();var Hc=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275dir=ot({type:n,selectors:[["form",3,"ngNoForm","",3,"ngNativeValidate",""]],hostAttrs:["novalidate",""],standalone:!1})}return n})();var nL=new P("");var HY={provide:_r,useExisting:vi(()=>Sd)},Sd=(()=>{class n extends _r{callSetDisabledState;get submitted(){return st(this._submittedReactive)}set submitted(t){this._submittedReactive.set(t)}_submitted=$r(()=>this._submittedReactive());_submittedReactive=on(!1);_oldForm;_onCollectionChange=()=>this._updateDomValue();directives=[];form=null;ngSubmit=new Ke;constructor(t,i,r){super(),this.callSetDisabledState=r,this._setValidators(t),this._setAsyncValidators(i)}ngOnChanges(t){t.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations(),this._oldForm=this.form)}ngOnDestroy(){this.form&&(Eg(this.form,this),this.form._onCollectionChange===this._onCollectionChange&&this.form._registerOnCollectionChange(()=>{}))}get formDirective(){return this}get control(){return this.form}get path(){return[]}addControl(t){let i=this.form.get(t.path);return _g(i,t,this.callSetDisabledState),i.updateValueAndValidity({emitEvent:!1}),this.directives.push(t),i}getControl(t){return this.form.get(t.path)}removeControl(t){kP(t.control||null,t,!1),VY(this.directives,t)}addFormGroup(t){this._setUpFormContainer(t)}removeFormGroup(t){this._cleanUpFormContainer(t)}getFormGroup(t){return this.form.get(t.path)}addFormArray(t){this._setUpFormContainer(t)}removeFormArray(t){this._cleanUpFormContainer(t)}getFormArray(t){return this.form.get(t.path)}updateModel(t,i){this.form.get(t.path).setValue(i)}onSubmit(t){return this._submittedReactive.set(!0),eL(this.form,this.directives),this.ngSubmit.emit(t),this.form._events.next(new yg(this.control)),t?.target?.method==="dialog"}onReset(){this.resetForm()}resetForm(t=void 0,i={}){this.form.reset(t,i),this._submittedReactive.set(!1)}_updateDomValue(){this.directives.forEach(t=>{let i=t.control,r=this.form.get(t.path);i!==r&&(kP(i||null,t),BY(r)&&(_g(r,t,this.callSetDisabledState),t.control=r))}),this.form._updateTreeValidity({emitEvent:!1})}_setUpFormContainer(t){let i=this.form.get(t.path);XP(i,t),i.updateValueAndValidity({emitEvent:!1})}_cleanUpFormContainer(t){if(this.form){let i=this.form.get(t.path);i&&LY(i,t)&&i.updateValueAndValidity({emitEvent:!1})}}_updateRegistrations(){this.form._registerOnCollectionChange(this._onCollectionChange),this._oldForm&&this._oldForm._registerOnCollectionChange(()=>{})}_updateValidators(){mI(this.form,this),this._oldForm&&Eg(this._oldForm,this)}static \u0275fac=function(i){return new(i||n)(N(wg,10),N(Cg,10),N(Cd,8))};static \u0275dir=ot({type:n,selectors:[["","formGroup",""]],hostBindings:function(i,r){i&1&&ve("submit",function(s){return r.onSubmit(s)})("reset",function(){return r.onReset()})},inputs:{form:[0,"formGroup","form"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],standalone:!1,features:[cs([HY]),Jn,Xn]})}return n})();var $Y={provide:js,useExisting:vi(()=>Dd)},Dd=(()=>{class n extends js{_ngModelWarningConfig;_added=!1;viewModel;control;name=null;set isDisabled(t){}model;update=new Ke;static _ngModelWarningSentOnce=!1;_ngModelWarningSent=!1;constructor(t,i,r,o,s){super(),this._ngModelWarningConfig=s,this._parent=t,this._setValidators(i),this._setAsyncValidators(r),this.valueAccessor=tL(this,o)}ngOnChanges(t){this._added||this._setUpControl(),JP(t,this.viewModel)&&(this.viewModel=this.model,this.formDirective.updateModel(this,this.model))}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}viewToModelUpdate(t){this.viewModel=t,this.update.emit(t)}get path(){return QP(this.name==null?this.name:this.name.toString(),this._parent)}get formDirective(){return this._parent?this._parent.formDirective:null}_setUpControl(){this.control=this.formDirective.addControl(this),this._added=!0}static \u0275fac=function(i){return new(i||n)(N(_r,13),N(wg,10),N(Cg,10),N(cI,10),N(nL,8))};static \u0275dir=ot({type:n,selectors:[["","formControlName",""]],inputs:{name:[0,"formControlName","name"],isDisabled:[0,"disabled","isDisabled"],model:[0,"ngModel","model"]},outputs:{update:"ngModelChange"},standalone:!1,features:[cs([$Y]),Jn,Xn]})}return n})();var iL=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=ar({type:n});static \u0275inj=yi({})}return n})(),aI=class extends jc{constructor(e,t,i){super(hI(t),pI(i,t)),this.controls=e,this._initObservables(),this._setUpdateStrategy(t),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}controls;at(e){return this.controls[this._adjustIndex(e)]}push(e,t={}){Array.isArray(e)?e.forEach(i=>{this.controls.push(i),this._registerControl(i)}):(this.controls.push(e),this._registerControl(e)),this.updateValueAndValidity({emitEvent:t.emitEvent}),this._onCollectionChange()}insert(e,t,i={}){this.controls.splice(e,0,t),this._registerControl(t),this.updateValueAndValidity({emitEvent:i.emitEvent})}removeAt(e,t={}){let i=this._adjustIndex(e);i<0&&(i=0),this.controls[i]&&this.controls[i]._registerOnCollectionChange(()=>{}),this.controls.splice(i,1),this.updateValueAndValidity({emitEvent:t.emitEvent})}setControl(e,t,i={}){let r=this._adjustIndex(e);r<0&&(r=0),this.controls[r]&&this.controls[r]._registerOnCollectionChange(()=>{}),this.controls.splice(r,1),t&&(this.controls.splice(r,0,t),this._registerControl(t)),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}get length(){return this.controls.length}setValue(e,t={}){KP(this,!1,e),e.forEach((i,r)=>{YP(this,!1,r),this.at(r).setValue(i,{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}patchValue(e,t={}){e!=null&&(e.forEach((i,r)=>{this.at(r)&&this.at(r).patchValue(i,{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t))}reset(e=[],t={}){this._forEachChild((i,r)=>{i.reset(e[r],{onlySelf:!0,emitEvent:t.emitEvent})}),this._updatePristine(t,this),this._updateTouched(t,this),this.updateValueAndValidity(t),t?.emitEvent!==!1&&this._events.next(new wd(this))}getRawValue(){return this.controls.map(e=>e.getRawValue())}clear(e={}){this.controls.length<1||(this._forEachChild(t=>t._registerOnCollectionChange(()=>{})),this.controls.splice(0),this.updateValueAndValidity({emitEvent:e.emitEvent}))}_adjustIndex(e){return e<0?e+this.length:e}_syncPendingControls(){let e=this.controls.reduce((t,i)=>i._syncPendingControls()?!0:t,!1);return e&&this.updateValueAndValidity({onlySelf:!0}),e}_forEachChild(e){this.controls.forEach((t,i)=>{e(t,i)})}_updateValue(){this.value=this.controls.filter(e=>e.enabled||this.disabled).map(e=>e.value)}_anyControls(e){return this.controls.some(t=>t.enabled&&e(t))}_setUpControls(){this._forEachChild(e=>this._registerControl(e))}_allControlsDisabled(){for(let e of this.controls)if(e.enabled)return!1;return this.controls.length>0||this.disabled}_registerControl(e){e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)}_find(e){return this.at(e)??null}};function LP(n){return!!n&&(n.asyncValidators!==void 0||n.validators!==void 0||n.updateOn!==void 0)}var Dg=(()=>{class n{useNonNullable=!1;get nonNullable(){let t=new n;return t.useNonNullable=!0,t}group(t,i=null){let r=this._reduceControls(t),o={};return LP(i)?o=i:i!==null&&(o.validators=i.validator,o.asyncValidators=i.asyncValidator),new Bc(r,o)}record(t,i=null){let r=this._reduceControls(t);return new sI(r,i)}control(t,i,r){let o={};return this.useNonNullable?(LP(i)?o=i:(o.validators=i,o.asyncValidators=r),new Ed(t,G(A({},o),{nonNullable:!0}))):new Ed(t,i,r)}array(t,i,r){let o=t.map(s=>this._createControl(s));return new aI(o,i,r)}_reduceControls(t){let i={};return Object.keys(t).forEach(r=>{i[r]=this._createControl(t[r])}),i}_createControl(t){if(t instanceof Ed)return t;if(t instanceof jc)return t;if(Array.isArray(t)){let i=t[0],r=t.length>1?t[1]:null,o=t.length>2?t[2]:null;return this.control(i,r,o)}else return this.control(t)}static \u0275fac=function(i){return new(i||n)};static \u0275prov=L({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var Tg=(()=>{class n{static withConfig(t){return{ngModule:n,providers:[{provide:Cd,useValue:t.callSetDisabledState??Sg}]}}static \u0275fac=function(i){return new(i||n)};static \u0275mod=ar({type:n});static \u0275inj=yi({imports:[iL]})}return n})(),xg=(()=>{class n{static withConfig(t){return{ngModule:n,providers:[{provide:nL,useValue:t.warnOnNgModelWithFormControl??"always"},{provide:Cd,useValue:t.callSetDisabledState??Sg}]}}static \u0275fac=function(i){return new(i||n)};static \u0275mod=ar({type:n});static \u0275inj=yi({imports:[iL]})}return n})();var $c=class n{constructor(e){this.database=e}submitMessage(e){let t=yr(this.database,"contacts"),i=EP(t);return wP(i,G(A({},e),{status:"new",createdAt:dP()}))}getMessages(){let e=yr(this.database,"contacts");return _P(e,{keyField:"id"}).pipe(z(t=>[...t].sort((i,r)=>(Number(r.createdAt)||0)-(Number(i.createdAt)||0))))}markReviewed(e){return CP(yr(this.database,`contacts/${e}`),{status:"reviewed"})}static \u0275fac=function(t){return new(t||n)($(vr))};static \u0275prov=L({token:n,factory:n.\u0275fac,providedIn:"root"})};function zY(n,e){n&1&&(p(0,"small",33),v(1," Please enter your name. "),m())}function WY(n,e){n&1&&(p(0,"span"),v(1,"Email is required."),m())}function qY(n,e){n&1&&(p(0,"span"),v(1,"Please enter a valid email."),m())}function GY(n,e){if(n&1&&(p(0,"small",33),B(1,WY,2,0,"span",34)(2,qY,2,0,"span",34),m()),n&2){let t,i,r=Ne();E(),x("ngIf",(t=r.contactForm.get("email"))==null||t.errors==null?null:t.errors.required),E(),x("ngIf",(i=r.contactForm.get("email"))==null||i.errors==null?null:i.errors.email)}}function YY(n,e){n&1&&(p(0,"span"),v(1,"Phone number is required."),m())}function KY(n,e){n&1&&(p(0,"span"),v(1," Please enter a valid phone number. "),m())}function QY(n,e){if(n&1&&(p(0,"small",33),B(1,YY,2,0,"span",34)(2,KY,2,0,"span",34),m()),n&2){let t,i,r=Ne();E(),x("ngIf",(t=r.contactForm.get("phone"))==null||t.errors==null?null:t.errors.required),E(),x("ngIf",(i=r.contactForm.get("phone"))==null||i.errors==null?null:i.errors.pattern)}}function ZY(n,e){n&1&&(p(0,"small",33),v(1," Please add a short message. "),m())}function XY(n,e){n&1&&(p(0,"span",35),v(1," Thank you! Our team will reach out shortly. "),m())}function JY(n,e){if(n&1&&(p(0,"span",33),v(1),m()),n&2){let t=Ne();E(),O(t.errorMessage)}}function eK(n,e){if(n&1&&(p(0,"a",36),k(1,"img",37),p(2,"div")(3,"h6"),v(4),m(),p(5,"p",8),v(6),m()()()),n&2){let t=e.$implicit;E(),x("src",t.image,jt)("alt",t.name),E(3),O(t.name),E(2),O(t.view)}}var Mg=class n{fb=C(Dg);contactService=C($c);seo=C(Te);submitted=!1;isLoading=!1;errorMessage="";successMessage=!1;recommendedRooms=ho.slice(0,2);contactForm=this.fb.nonNullable.group({name:["",[Ht.required,Ht.minLength(2)]],email:["",[Ht.required,Ht.email]],phone:["",[Ht.required,Ht.pattern(/^\+?[0-9][0-9\s-]{7,14}$/)]],dates:[""],message:["",[Ht.required,Ht.minLength(10)]]});constructor(){this.seo.update({title:"Contact Himalayan Eco Inn | Leh Ladakh",description:"Contact Himalayan Eco Inn to book hotel rooms or a homestay-style stay in Leh, Ladakh.",keywords:"contact Himalayan Eco Inn, Leh hotel booking, Ladakh room booking, homestay in Leh, Ladakh concierge, Ladakh tours, Leh tour bookings"}),this.seo.injectBreadcrumb([{name:"Home",url:"https://himalayanecoinn.com/"},{name:"Contact",url:"https://himalayanecoinn.com/contact"}])}async submit(){if(this.submitted=!0,this.errorMessage="",this.successMessage=!1,this.contactForm.markAllAsTouched(),this.contactForm.invalid){this.errorMessage="Please fill all required fields.";return}this.isLoading=!0;try{await this.contactService.submitMessage(this.contactForm.getRawValue()),this.contactForm.reset(),this.submitted=!1,this.successMessage=!0}catch(e){let t=e.code??"";t.includes("permission-denied")?this.errorMessage="Permission denied. Check database rules.":t.includes("network-request-failed")?this.errorMessage="Network error. Please try again.":this.errorMessage="Something went wrong. Please try again."}finally{this.isLoading=!1}}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=se({type:n,selectors:[["app-contact"]],decls:82,vars:10,consts:[[1,"page-hero"],[1,"container"],[1,"eyebrow"],[1,"lead"],[1,"section-spacing"],[1,"row","g-4"],[1,"col-lg-5"],[1,"contact-card","mb-4"],[1,"text-muted"],[1,"contact-info"],[1,"col-lg-7"],[1,"card","contact-form",3,"ngSubmit","formGroup"],[1,"row","g-3"],[1,"col-md-6"],[1,"form-label"],["type","text","formControlName","name","placeholder","Your name",1,"form-control"],["class","text-danger",4,"ngIf"],["type","email","formControlName","email","placeholder","you@email.com",1,"form-control"],["type","tel","formControlName","phone","placeholder","+91 60060 24435","inputmode","tel",1,"form-control"],["type","text","formControlName","dates","placeholder","April 10 - April 15",1,"form-control"],[1,"col-12"],["rows","4","formControlName","message","placeholder","Tell us about your travel plans",1,"form-control"],[1,"mt-3","d-flex","align-items-center","gap-3"],["type","submit",1,"btn","btn-primary",3,"disabled"],["class","text-success",4,"ngIf"],[1,"row","g-4","mt-4","justify-content-between","align-items-center","align-items-stretch"],[1,"map-card","col-12","col-md-7"],[1,"map-frame"],["title","Himalayan Eco Inn map","src",lb`https://www.google.com/maps?q=Himalayan%20Eco%20Inn%20Leh%20Ladakh&output=embed`,"loading","lazy","referrerpolicy","no-referrer-when-downgrade"],["href","https://maps.app.goo.gl/5tjZZ9pU2761GAq68","target","_blank","rel","noopener",1,"btn","btn-outline-primary","mt-3"],[1,"recommendation-card","col-12","col-md-4"],[1,"recommendation-list"],["class","recommendation-item","routerLink","/rooms",4,"ngFor","ngForOf"],[1,"text-danger"],[4,"ngIf"],[1,"text-success"],["routerLink","/rooms",1,"recommendation-item"],[3,"src","alt"]],template:function(t,i){if(t&1&&(p(0,"section",0)(1,"div",1)(2,"span",2),v(3,"Contact"),m(),p(4,"h1"),v(5,"Plan your stay with our concierge team."),m(),p(6,"p",3),v(7," Share your travel dates, preferences, and questions. We will curate the perfect Himalayan experience for you. "),m()()(),p(8,"section",4)(9,"div",1)(10,"div",5)(11,"div",6)(12,"div",7)(13,"h4"),v(14,"Reach us directly"),m(),p(15,"p",8),v(16," Our team is ready to assist with stays, transportation, and customized itineraries. "),m(),p(17,"div",9)(18,"div")(19,"span"),v(20,"Phone"),m(),p(21,"strong"),v(22,"+91 60060 24435"),m()(),p(23,"div")(24,"span"),v(25,"Email"),m(),p(26,"strong"),v(27,"info@himalayanecoinn.com "),m()(),p(28,"div")(29,"span"),v(30,"Address"),m(),p(31,"strong"),v(32,"Upper Tukcha Rd, near GH road, Leh, Ladakh 194101"),m()()()()(),p(33,"div",10)(34,"form",11),ve("ngSubmit",function(){return i.submit()}),p(35,"h4"),v(36,"Send a request"),m(),p(37,"div",12)(38,"div",13)(39,"label",14),v(40,"Full Name"),m(),k(41,"input",15),B(42,zY,2,0,"small",16),m(),p(43,"div",13)(44,"label",14),v(45,"Email Address"),m(),k(46,"input",17),B(47,GY,3,2,"small",16),m(),p(48,"div",13)(49,"label",14),v(50,"Phone Number"),m(),k(51,"input",18),B(52,QY,3,2,"small",16),m(),p(53,"div",13)(54,"label",14),v(55,"Preferred Dates"),m(),k(56,"input",19),m(),p(57,"div",20)(58,"label",14),v(59,"Message"),m(),k(60,"textarea",21),B(61,ZY,2,0,"small",16),m()(),p(62,"div",22)(63,"button",23),v(64),m(),B(65,XY,2,0,"span",24)(66,JY,2,1,"span",16),m()()()(),p(67,"div",25)(68,"div",26)(69,"h5"),v(70,"Find us on the map"),m(),p(71,"p",8),v(72,"Leh, Ladakh \u2022 Himalayan Eco Inn"),m(),p(73,"div",27),k(74,"iframe",28),m(),p(75,"a",29),v(76," Open in Google Maps "),m()(),p(77,"div",30)(78,"h5"),v(79,"Recommended rooms"),m(),p(80,"div",31),B(81,eK,7,4,"a",32),m()()()()()),t&2){let r,o,s,a;E(34),x("formGroup",i.contactForm),E(8),x("ngIf",i.submitted&&((r=i.contactForm.get("name"))==null?null:r.invalid)),E(5),x("ngIf",i.submitted&&((o=i.contactForm.get("email"))==null?null:o.invalid)),E(5),x("ngIf",i.submitted&&((s=i.contactForm.get("phone"))==null?null:s.invalid)),E(9),x("ngIf",i.submitted&&((a=i.contactForm.get("message"))==null?null:a.invalid)),E(2),x("disabled",i.isLoading),E(),ye(" ",i.isLoading?"Sending...":"Submit Request"," "),E(),x("ngIf",i.successMessage),E(),x("ngIf",i.errorMessage),E(15),x("ngForOf",i.recommendedRooms)}},dependencies:[xg,Hc,Bi,mo,Uc,Sd,Dd,ei,Le,qe],styles:[".contact-card[_ngcontent-%COMP%], .contact-form[_ngcontent-%COMP%]{border-radius:1.5rem;padding:2rem;box-shadow:0 12px 30px #0f1a2b14}.contact-card[_ngcontent-%COMP%]{background:#0f1a2b;color:#fff}.contact-card[_ngcontent-%COMP%] .text-muted[_ngcontent-%COMP%]{color:#ffffffa6!important}.contact-info[_ngcontent-%COMP%]{display:grid;gap:1.25rem;margin-top:1.5rem}.contact-info[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:block;font-size:.75rem;letter-spacing:.08em;text-transform:uppercase;color:#fff9}.contact-info[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-size:.95rem}.map-card[_ngcontent-%COMP%]{border-radius:1.5rem;padding:1.5rem;box-shadow:0 12px 30px #0f1a2b14;background:#fff}.map-frame[_ngcontent-%COMP%]{width:100%;border-radius:1rem;overflow:hidden;aspect-ratio:4/3;background:#eef1f6}.map-frame[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{border:0;width:100%;height:100%}.recommendation-card[_ngcontent-%COMP%]{border-radius:1.5rem;padding:1.5rem;box-shadow:0 12px 30px #0f1a2b14;background:#fff}.recommendation-list[_ngcontent-%COMP%]{display:grid;gap:1rem;margin-top:1rem}.recommendation-item[_ngcontent-%COMP%]{display:flex;gap:.75rem;text-decoration:none;color:inherit;padding:.75rem;border-radius:1rem;border:1px solid rgba(15,26,43,.08);transition:transform .2s ease,box-shadow .2s ease}.recommendation-item[_ngcontent-%COMP%]:hover{transform:translateY(-2px);box-shadow:0 10px 24px #0f1a2b1f}.recommendation-item[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:72px;height:72px;border-radius:.75rem;object-fit:cover}.recommendation-item[_ngcontent-%COMP%] h6[_ngcontent-%COMP%]{margin:0}.recommendation-item[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:.25rem 0 0;font-size:.85rem}"]})};var go=class n{constructor(e){this.auth=e;this.user$=bN(this.auth)}user$;login(e,t){return wN(this.auth,e,t)}logout(){return CN(this.auth)}isAuthenticated(){return this.user$.pipe(z(e=>!!e))}static \u0275fac=function(t){return new(t||n)($(xs))};static \u0275prov=L({token:n,factory:n.\u0275fac,providedIn:"root"})};var vI="hei_admin_session_expiry",vo=class n{timeoutMs=900*1e3;start(){this.setExpiry(Date.now()+this.timeoutMs)}touch(){this.getExpiry()&&this.setExpiry(Date.now()+this.timeoutMs)}clear(){localStorage.removeItem(vI)}isExpired(){let e=this.getExpiry();return e?Date.now()>e:!0}getExpiry(){let e=localStorage.getItem(vI);if(!e)return null;let t=Number(e);return Number.isFinite(t)?t:null}setExpiry(e){localStorage.setItem(vI,String(e))}static \u0275fac=function(t){return new(t||n)};static \u0275prov=L({token:n,factory:n.\u0275fac,providedIn:"root"})};function tK(n,e){n&1&&(p(0,"small",15),v(1," Enter a valid email address. "),m())}function nK(n,e){n&1&&(p(0,"small",15),v(1," Password should be at least 6 characters. "),m())}function iK(n,e){if(n&1&&(p(0,"p",16),v(1),m()),n&2){let t=Ne();E(),O(t.errorMessage)}}var Rg=class n{fb=C(Dg);authService=C(go);router=C(_t);seo=C(Te);sessionService=C(vo);submitted=!1;isLoading=!1;errorMessage="";loginForm=this.fb.nonNullable.group({email:["",[Ht.required,Ht.email]],password:["",[Ht.required,Ht.minLength(6)]]});constructor(){this.seo.update({title:"Admin Login | Himalayan Eco Inn",description:"Admin access for Himalayan Eco Inn contact inquiries.",robots:"noindex, nofollow"}),this.authService.isAuthenticated().pipe(Wt(1)).subscribe(e=>{e&&!this.sessionService.isExpired()&&this.router.navigate(["/admin"])})}async submit(){if(this.submitted=!0,this.errorMessage="",this.loginForm.markAllAsTouched(),this.loginForm.invalid){this.errorMessage="Please enter a valid email and password.";return}this.isLoading=!0;try{let{email:e,password:t}=this.loginForm.getRawValue();await this.withTimeout(this.authService.login(e,t),12e3),this.sessionService.start(),await this.router.navigate(["/admin"])}catch(e){this.errorMessage=this.getAuthErrorMessage(e)}finally{this.isLoading=!1}}getAuthErrorMessage(e){let t=e.code??"";return t.includes("invalid-email")?"Please enter a valid email address.":t.includes("invalid-credential")||t.includes("wrong-password")?"Invalid email or password.":t.includes("user-not-found")?"No account found for this email.":t.includes("too-many-requests")?"Too many attempts. Please try again later.":t.includes("network-request-failed")?"Network error. Check your connection and try again.":e.message==="timeout"?"Login is taking too long. Please try again.":"Login failed. Please check credentials or Firebase settings."}withTimeout(e,t){return new Promise((i,r)=>{let o=setTimeout(()=>r(new Error("timeout")),t);e.then(s=>{clearTimeout(o),i(s)}).catch(s=>{clearTimeout(o),r(s)})})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=se({type:n,selectors:[["app-admin-login"]],decls:28,vars:6,consts:[[1,"page-hero","hero-slim"],[1,"container"],[1,"eyebrow"],[1,"lead"],[1,"section-spacing"],[1,"row","justify-content-center"],[1,"col-lg-6"],[1,"card","admin-card",3,"ngSubmit","formGroup"],[1,"mb-3"],[1,"form-label"],["type","email","formControlName","email",1,"form-control"],["class","text-danger",4,"ngIf"],["type","password","formControlName","password",1,"form-control"],["type","submit",1,"btn","btn-primary","w-100",3,"disabled"],["class","text-danger mt-3 mb-0",4,"ngIf"],[1,"text-danger"],[1,"text-danger","mt-3","mb-0"]],template:function(t,i){if(t&1&&(p(0,"section",0)(1,"div",1)(2,"span",2),v(3,"Admin"),m(),p(4,"h1"),v(5,"Admin access login"),m(),p(6,"p",3),v(7,"Sign in to manage guest inquiries and requests."),m()()(),p(8,"section",4)(9,"div",1)(10,"div",5)(11,"div",6)(12,"form",7),ve("ngSubmit",function(){return i.submit()}),p(13,"h4"),v(14,"Admin Login"),m(),p(15,"div",8)(16,"label",9),v(17,"Email"),m(),k(18,"input",10),B(19,tK,2,0,"small",11),m(),p(20,"div",8)(21,"label",9),v(22,"Password"),m(),k(23,"input",12),B(24,nK,2,0,"small",11),m(),p(25,"button",13),v(26),m(),B(27,iK,2,1,"p",14),m()()()()()),t&2){let r,o;E(12),x("formGroup",i.loginForm),E(7),x("ngIf",i.submitted&&((r=i.loginForm.get("email"))==null?null:r.invalid)),E(5),x("ngIf",i.submitted&&((o=i.loginForm.get("password"))==null?null:o.invalid)),E(),x("disabled",i.isLoading),E(),ye(" ",i.isLoading?"Signing in...":"Login"," "),E(),x("ngIf",i.errorMessage)}},dependencies:[xg,Hc,Bi,mo,Uc,Sd,Dd,ei],styles:[".admin-card[_ngcontent-%COMP%]{border-radius:1.5rem;padding:2.5rem;box-shadow:0 12px 30px #0f1a2b14}"]})};var rL="hei_visit_logged",zc=class n{constructor(e){this.database=e}trackVisit(){if(typeof sessionStorage>"u"||sessionStorage.getItem(rL))return;sessionStorage.setItem(rL,"true");let e=yr(this.database,"analytics/visits/total");rI(e,r=>(Number(r)||0)+1);let t=new Date().toISOString().slice(0,10),i=yr(this.database,`analytics/visits/daily/${t}`);rI(i,r=>(Number(r)||0)+1)}getTotalVisits(){return iI(yr(this.database,"analytics/visits/total")).pipe(z(e=>Number(e)||0))}getDailyVisits(){return iI(yr(this.database,"analytics/visits/daily")).pipe(z(e=>e??{}))}static \u0275fac=function(t){return new(t||n)($(vr))};static \u0275prov=L({token:n,factory:n.\u0275fac,providedIn:"root"})};function Ad(n){return n+.5|0}var yo=(n,e,t)=>Math.max(Math.min(n,t),e);function Td(n){return yo(Ad(n*2.55),0,255)}function _o(n){return yo(Ad(n*255),0,255)}function br(n){return yo(Ad(n/2.55)/100,0,1)}function oL(n){return yo(Ad(n*100),0,100)}var Hn={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},_I=[..."0123456789ABCDEF"],rK=n=>_I[n&15],oK=n=>_I[(n&240)>>4]+_I[n&15],kg=n=>(n&240)>>4===(n&15),sK=n=>kg(n.r)&&kg(n.g)&&kg(n.b)&&kg(n.a);function aK(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&Hn[n[1]]*17,g:255&Hn[n[2]]*17,b:255&Hn[n[3]]*17,a:e===5?Hn[n[4]]*17:255}:(e===7||e===9)&&(t={r:Hn[n[1]]<<4|Hn[n[2]],g:Hn[n[3]]<<4|Hn[n[4]],b:Hn[n[5]]<<4|Hn[n[6]],a:e===9?Hn[n[7]]<<4|Hn[n[8]]:255})),t}var cK=(n,e)=>n<255?e(n):"";function lK(n){var e=sK(n)?rK:oK;return n?"#"+e(n.r)+e(n.g)+e(n.b)+cK(n.a,e):void 0}var uK=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function lL(n,e,t){let i=e*Math.min(t,1-t),r=(o,s=(o+n/30)%12)=>t-i*Math.max(Math.min(s-3,9-s,1),-1);return[r(0),r(8),r(4)]}function dK(n,e,t){let i=(r,o=(r+n/60)%6)=>t-t*e*Math.max(Math.min(o,4-o,1),0);return[i(5),i(3),i(1)]}function fK(n,e,t){let i=lL(n,1,.5),r;for(e+t>1&&(r=1/(e+t),e*=r,t*=r),r=0;r<3;r++)i[r]*=1-e-t,i[r]+=e;return i}function hK(n,e,t,i,r){return n===r?(e-t)/i+(e.5?u/(2-o-s):u/(o+s),c=hK(t,i,r,u,o),c=c*60+.5),[c|0,l||0,a]}function EI(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(_o)}function wI(n,e,t){return EI(lL,n,e,t)}function pK(n,e,t){return EI(fK,n,e,t)}function mK(n,e,t){return EI(dK,n,e,t)}function uL(n){return(n%360+360)%360}function gK(n){let e=uK.exec(n),t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Td(+e[5]):_o(+e[5]));let r=uL(+e[2]),o=+e[3]/100,s=+e[4]/100;return e[1]==="hwb"?i=pK(r,o,s):e[1]==="hsv"?i=mK(r,o,s):i=wI(r,o,s),{r:i[0],g:i[1],b:i[2],a:t}}function vK(n,e){var t=bI(n);t[0]=uL(t[0]+e),t=wI(t),n.r=t[0],n.g=t[1],n.b=t[2]}function yK(n){if(!n)return;let e=bI(n),t=e[0],i=oL(e[1]),r=oL(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${r}%, ${br(n.a)})`:`hsl(${t}, ${i}%, ${r}%)`}var sL={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},aL={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function _K(){let n={},e=Object.keys(aL),t=Object.keys(sL),i,r,o,s,a;for(i=0;i>16&255,o>>8&255,o&255]}return n}var Ng;function bK(n){Ng||(Ng=_K(),Ng.transparent=[0,0,0,0]);let e=Ng[n.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}var EK=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function wK(n){let e=EK.exec(n),t=255,i,r,o;if(e){if(e[7]!==i){let s=+e[7];t=e[8]?Td(s):yo(s*255,0,255)}return i=+e[1],r=+e[3],o=+e[5],i=255&(e[2]?Td(i):yo(i,0,255)),r=255&(e[4]?Td(r):yo(r,0,255)),o=255&(e[6]?Td(o):yo(o,0,255)),{r:i,g:r,b:o,a:t}}}function CK(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${br(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}var yI=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,Wc=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function IK(n,e,t){let i=Wc(br(n.r)),r=Wc(br(n.g)),o=Wc(br(n.b));return{r:_o(yI(i+t*(Wc(br(e.r))-i))),g:_o(yI(r+t*(Wc(br(e.g))-r))),b:_o(yI(o+t*(Wc(br(e.b))-o))),a:n.a+t*(e.a-n.a)}}function Og(n,e,t){if(n){let i=bI(n);i[e]=Math.max(0,Math.min(i[e]+i[e]*t,e===0?360:1)),i=wI(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function dL(n,e){return n&&Object.assign(e||{},n)}function cL(n){var e={r:0,g:0,b:0,a:255};return Array.isArray(n)?n.length>=3&&(e={r:n[0],g:n[1],b:n[2],a:255},n.length>3&&(e.a=_o(n[3]))):(e=dL(n,{r:0,g:0,b:0,a:1}),e.a=_o(e.a)),e}function SK(n){return n.charAt(0)==="r"?wK(n):gK(n)}var xd=class n{constructor(e){if(e instanceof n)return e;let t=typeof e,i;t==="object"?i=cL(e):t==="string"&&(i=aK(e)||bK(e)||SK(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var e=dL(this._rgb);return e&&(e.a=br(e.a)),e}set rgb(e){this._rgb=cL(e)}rgbString(){return this._valid?CK(this._rgb):void 0}hexString(){return this._valid?lK(this._rgb):void 0}hslString(){return this._valid?yK(this._rgb):void 0}mix(e,t){if(e){let i=this.rgb,r=e.rgb,o,s=t===o?.5:t,a=2*s-1,c=i.a-r.a,l=((a*c===-1?a:(a+c)/(1+a*c))+1)/2;o=1-l,i.r=255&l*i.r+o*r.r+.5,i.g=255&l*i.g+o*r.g+.5,i.b=255&l*i.b+o*r.b+.5,i.a=s*i.a+(1-s)*r.a,this.rgb=i}return this}interpolate(e,t){return e&&(this._rgb=IK(this._rgb,e._rgb,t)),this}clone(){return new n(this.rgb)}alpha(e){return this._rgb.a=_o(e),this}clearer(e){let t=this._rgb;return t.a*=1-e,this}greyscale(){let e=this._rgb,t=Ad(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=t,this}opaquer(e){let t=this._rgb;return t.a*=1+e,this}negate(){let e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return Og(this._rgb,2,e),this}darken(e){return Og(this._rgb,2,-e),this}saturate(e){return Og(this._rgb,1,e),this}desaturate(e){return Og(this._rgb,1,-e),this}rotate(e){return vK(this._rgb,e),this}};function $i(){}var wL=(()=>{let n=0;return()=>n++})();function ue(n){return n==null}function Ve(n){if(Array.isArray&&Array.isArray(n))return!0;let e=Object.prototype.toString.call(n);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function fe(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function Ze(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function dn(n,e){return Ze(n)?n:e}function Z(n,e){return typeof n>"u"?e:n}var CL=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/e,DI=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function Oe(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function xe(n,e,t,i){let r,o,s;if(Ve(n))if(o=n.length,i)for(r=o-1;r>=0;r--)e.call(t,n[r],r);else for(r=0;rn,x:n=>n.x,y:n=>n.y};function xK(n){let e=n.split("."),t=[],i="";for(let r of e)i+=r,i.endsWith("\\")?i=i.slice(0,-1)+".":(t.push(i),i="");return t}function AK(n){let e=xK(n);return t=>{for(let i of e){if(i==="")break;t=t&&t[i]}return t}}function Cr(n,e){return(fL[e]||(fL[e]=AK(e)))(n)}function Hg(n){return n.charAt(0).toUpperCase()+n.slice(1)}var Qc=n=>typeof n<"u",Er=n=>typeof n=="function",TI=(n,e)=>{if(n.size!==e.size)return!1;for(let t of n)if(!e.has(t))return!1;return!0};function SL(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}var ge=Math.PI,je=2*ge,MK=je+ge,jg=Number.POSITIVE_INFINITY,RK=ge/180,tt=ge/2,Bs=ge/4,hL=ge*2/3,wr=Math.log10,di=Math.sign;function Zc(n,e,t){return Math.abs(n-e)r-o).pop(),e}function kK(n){return typeof n=="symbol"||typeof n=="object"&&n!==null&&!(Symbol.toPrimitive in n||"toString"in n||"valueOf"in n)}function $s(n){return!kK(n)&&!isNaN(parseFloat(n))&&isFinite(n)}function TL(n,e){let t=Math.round(n);return t-e<=n&&t+e>=n}function AI(n,e,t){let i,r,o;for(i=0,r=n.length;ic&&l=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function zg(n,e,t){t=t||(s=>n[s]1;)o=r+i>>1,t(o)?r=o:i=o;return{lo:r,hi:i}}var Ui=(n,e,t,i)=>zg(n,t,i?r=>{let o=n[r][e];return on[r][e]zg(n,t,i=>n[i][e]>=t);function ML(n,e,t){let i=0,r=n.length;for(;ii&&n[r-1]>t;)r--;return i>0||r{let i="_onData"+Hg(t),r=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...o){let s=r.apply(this,o);return n._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...o)}),s}})})}function kI(n,e){let t=n._chartjs;if(!t)return;let i=t.listeners,r=i.indexOf(e);r!==-1&&i.splice(r,1),!(i.length>0)&&(RL.forEach(o=>{delete n[o]}),delete n._chartjs)}function NI(n){let e=new Set(n);return e.size===n.length?n:Array.from(e)}var OI=(function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame})();function PI(n,e){let t=[],i=!1;return function(...r){t=r,i||(i=!0,OI.call(window,()=>{i=!1,n.apply(e,t)}))}}function NL(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}var Wg=n=>n==="start"?"left":n==="end"?"right":"center",At=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2,OL=(n,e,t,i)=>n===(i?"left":"right")?t:n==="center"?(e+t)/2:e;function LI(n,e,t){let i=e.length,r=0,o=i;if(n._sorted){let{iScale:s,vScale:a,_parsed:c}=n,l=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null,u=s.axis,{min:d,max:f,minDefined:h,maxDefined:g}=s.getUserBounds();if(h){if(r=Math.min(Ui(c,u,d).lo,t?i:Ui(e,u,s.getPixelForValue(d)).lo),l){let y=c.slice(0,r+1).reverse().findIndex(_=>!ue(_[a.axis]));r-=Math.max(0,y)}r=pt(r,0,i-1)}if(g){let y=Math.max(Ui(c,s.axis,f,!0).hi+1,t?0:Ui(e,u,s.getPixelForValue(f),!0).hi+1);if(l){let _=c.slice(y-1).findIndex(b=>!ue(b[a.axis]));y+=Math.max(0,_)}o=pt(y,r,i)-r}else o=i-r}return{start:r,count:o}}function FI(n){let{xScale:e,yScale:t,_scaleRanges:i}=n,r={xmin:e.min,xmax:e.max,ymin:t.min,ymax:t.max};if(!i)return n._scaleRanges=r,!0;let o=i.xmin!==e.min||i.xmax!==e.max||i.ymin!==t.min||i.ymax!==t.max;return Object.assign(i,r),o}var Pg=n=>n===0||n===1,pL=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*je/t)),mL=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*je/t)+1,qc={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*tt)+1,easeOutSine:n=>Math.sin(n*tt),easeInOutSine:n=>-.5*(Math.cos(ge*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>Pg(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>Pg(n)?n:pL(n,.075,.3),easeOutElastic:n=>Pg(n)?n:mL(n,.075,.3),easeInOutElastic(n){return Pg(n)?n:n<.5?.5*pL(n*2,.1125,.45):.5+.5*mL(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let e=1.70158;return(n/=.5)<1?.5*(n*n*(((e*=1.525)+1)*n-e)):.5*((n-=2)*n*(((e*=1.525)+1)*n+e)+2)},easeInBounce:n=>1-qc.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?qc.easeInBounce(n*2)*.5:qc.easeOutBounce(n*2-1)*.5+.5};function VI(n){if(n&&typeof n=="object"){let e=n.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function jI(n){return VI(n)?n:new xd(n)}function CI(n){return VI(n)?n:new xd(n).saturate(.5).darken(.1).hexString()}var OK=["x","y","borderWidth","radius","tension"],PK=["color","borderColor","backgroundColor"];function LK(n){n.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),n.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),n.set("animations",{colors:{type:"color",properties:PK},numbers:{type:"number",properties:OK}}),n.describe("animations",{_fallback:"animation"}),n.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>e|0}}}})}function FK(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}var gL=new Map;function VK(n,e){e=e||{};let t=n+JSON.stringify(e),i=gL.get(t);return i||(i=new Intl.NumberFormat(n,e),gL.set(t,i)),i}function Jc(n,e,t){return VK(e,t).format(n)}var PL={values(n){return Ve(n)?n:""+n},numeric(n,e,t){if(n===0)return"0";let i=this.chart.options.locale,r,o=n;if(t.length>1){let l=Math.max(Math.abs(t[0].value),Math.abs(t[t.length-1].value));(l<1e-4||l>1e15)&&(r="scientific"),o=jK(n,t)}let s=wr(Math.abs(o)),a=isNaN(s)?1:Math.max(Math.min(-1*Math.floor(s),20),0),c={notation:r,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(c,this.options.ticks.format),Jc(n,i,c)},logarithmic(n,e,t){if(n===0)return"0";let i=t[e].significand||n/Math.pow(10,Math.floor(wr(n)));return[1,2,3,5,10,15].includes(i)||e>.8*t.length?PL.numeric.call(this,n,e,t):""}};function jK(n,e){let t=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(t)>=1&&n!==Math.floor(n)&&(t=n-Math.floor(n)),t}var Nd={formatters:PL};function BK(n){n.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Nd.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}var wo=Object.create(null),qg=Object.create(null);function Md(n,e){if(!e)return n;let t=e.split(".");for(let i=0,r=t.length;ii.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,r)=>CI(r.backgroundColor),this.hoverBorderColor=(i,r)=>CI(r.borderColor),this.hoverColor=(i,r)=>CI(r.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(t)}set(e,t){return II(this,e,t)}get(e){return Md(this,e)}describe(e,t){return II(qg,e,t)}override(e,t){return II(wo,e,t)}route(e,t,i,r){let o=Md(this,e),s=Md(this,i),a="_"+t;Object.defineProperties(o,{[a]:{value:o[t],writable:!0},[t]:{enumerable:!0,get(){let c=this[a],l=s[r];return fe(c)?Object.assign({},l,c):Z(c,l)},set(c){this[a]=c}}})}apply(e){e.forEach(t=>t(this))}},Ue=new SI({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[LK,FK,BK]);function UK(n){return!n||ue(n.size)||ue(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function Rd(n,e,t,i,r){let o=e[r];return o||(o=e[r]=n.measureText(r).width,t.push(r)),o>i&&(i=o),i}function LL(n,e,t,i){i=i||{};let r=i.data=i.data||{},o=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(r=i.data={},o=i.garbageCollect=[],i.font=e),n.save(),n.font=e;let s=0,a=t.length,c,l,u,d,f;for(c=0;ct.length){for(c=0;c0&&n.stroke()}}function Hi(n,e,t){return t=t||.5,!e||n&&n.x>e.left-t&&n.xe.top-t&&n.y0&&o.strokeColor!=="",c,l;for(n.save(),n.font=r.string,HK(n,o),c=0;c+n||0;function Yg(n,e){let t={},i=fe(e),r=i?Object.keys(e):e,o=fe(n)?i?s=>Z(n[s],n[e[s]]):s=>n[s]:()=>n;for(let s of r)t[s]=YK(o(s));return t}function HI(n){return Yg(n,{top:"y",right:"x",bottom:"y",left:"x"})}function So(n){return Yg(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Mt(n){let e=HI(n);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function ft(n,e){n=n||{},e=e||Ue.font;let t=Z(n.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let i=Z(n.style,e.style);i&&!(""+i).match(qK)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);let r={family:Z(n.family,e.family),lineHeight:GK(Z(n.lineHeight,e.lineHeight),t),size:t,style:i,weight:Z(n.weight,e.weight),string:""};return r.string=UK(r),r}function tl(n,e,t,i){let r=!0,o,s,a;for(o=0,s=n.length;ot&&a===0?0:a+c;return{min:s(i,-Math.abs(o)),max:s(r,o)}}function Ir(n,e){return Object.assign(Object.create(n),e)}function Kg(n,e=[""],t,i,r=()=>n[0]){let o=t||n;typeof i>"u"&&(i=HL("_fallback",n));let s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:o,_fallback:i,_getTarget:r,override:a=>Kg([a,...n],e,o,i)};return new Proxy(s,{deleteProperty(a,c){return delete a[c],delete a._keys,delete n[0][c],!0},get(a,c){return BL(a,c,()=>nQ(c,e,n,a))},getOwnPropertyDescriptor(a,c){return Reflect.getOwnPropertyDescriptor(a._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(a,c){return yL(a).includes(c)},ownKeys(a){return yL(a)},set(a,c,l){let u=a._storage||(a._storage=r());return a[c]=u[c]=l,delete a._keys,!0}})}function Hs(n,e,t,i){let r={_cacheable:!1,_proxy:n,_context:e,_subProxy:t,_stack:new Set,_descriptors:$I(n,i),setContext:o=>Hs(n,o,t,i),override:o=>Hs(n.override(o),e,t,i)};return new Proxy(r,{deleteProperty(o,s){return delete o[s],delete n[s],!0},get(o,s,a){return BL(o,s,()=>QK(o,s,a))},getOwnPropertyDescriptor(o,s){return o._descriptors.allKeys?Reflect.has(n,s)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,s)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(o,s){return Reflect.has(n,s)},ownKeys(){return Reflect.ownKeys(n)},set(o,s,a){return n[s]=a,delete o[s],!0}})}function $I(n,e={scriptable:!0,indexable:!0}){let{_scriptable:t=e.scriptable,_indexable:i=e.indexable,_allKeys:r=e.allKeys}=n;return{allKeys:r,scriptable:t,indexable:i,isScriptable:Er(t)?t:()=>t,isIndexable:Er(i)?i:()=>i}}var KK=(n,e)=>n?n+Hg(e):e,zI=(n,e)=>fe(e)&&n!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function BL(n,e,t){if(Object.prototype.hasOwnProperty.call(n,e)||e==="constructor")return n[e];let i=t();return n[e]=i,i}function QK(n,e,t){let{_proxy:i,_context:r,_subProxy:o,_descriptors:s}=n,a=i[e];return Er(a)&&s.isScriptable(e)&&(a=ZK(e,a,n,t)),Ve(a)&&a.length&&(a=XK(e,a,n,s.isIndexable)),zI(e,a)&&(a=Hs(a,r,o&&o[e],s)),a}function ZK(n,e,t,i){let{_proxy:r,_context:o,_subProxy:s,_stack:a}=t;if(a.has(n))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+n);a.add(n);let c=e(o,s||i);return a.delete(n),zI(n,c)&&(c=WI(r._scopes,r,n,c)),c}function XK(n,e,t,i){let{_proxy:r,_context:o,_subProxy:s,_descriptors:a}=t;if(typeof o.index<"u"&&i(n))return e[o.index%e.length];if(fe(e[0])){let c=e,l=r._scopes.filter(u=>u!==c);e=[];for(let u of c){let d=WI(l,r,n,u);e.push(Hs(d,o,s&&s[n],a))}}return e}function UL(n,e,t){return Er(n)?n(e,t):n}var JK=(n,e)=>n===!0?e:typeof n=="string"?Cr(e,n):void 0;function eQ(n,e,t,i,r){for(let o of e){let s=JK(t,o);if(s){n.add(s);let a=UL(s._fallback,t,r);if(typeof a<"u"&&a!==t&&a!==i)return a}else if(s===!1&&typeof i<"u"&&t!==i)return null}return!1}function WI(n,e,t,i){let r=e._rootScopes,o=UL(e._fallback,t,i),s=[...n,...r],a=new Set;a.add(i);let c=vL(a,s,t,o||t,i);return c===null||typeof o<"u"&&o!==t&&(c=vL(a,s,o,c,i),c===null)?!1:Kg(Array.from(a),[""],r,o,()=>tQ(e,t,i))}function vL(n,e,t,i,r){for(;t;)t=eQ(n,e,t,i,r);return t}function tQ(n,e,t){let i=n._getTarget();e in i||(i[e]={});let r=i[e];return Ve(r)&&fe(t)?t:r||{}}function nQ(n,e,t,i){let r;for(let o of e)if(r=HL(KK(o,n),t),typeof r<"u")return zI(n,r)?WI(t,i,n,r):r}function HL(n,e){for(let t of e){if(!t)continue;let i=t[n];if(typeof i<"u")return i}}function yL(n){let e=n._keys;return e||(e=n._keys=iQ(n._scopes)),e}function iQ(n){let e=new Set;for(let t of n)for(let i of Object.keys(t).filter(r=>!r.startsWith("_")))e.add(i);return Array.from(e)}function qI(n,e,t,i){let{iScale:r}=n,{key:o="r"}=this._parsing,s=new Array(i),a,c,l,u;for(a=0,c=i;aen==="x"?"y":"x";function oQ(n,e,t,i){let r=n.skip?e:n,o=e,s=t.skip?e:t,a=Bg(o,r),c=Bg(s,o),l=a/(a+c),u=c/(a+c);l=isNaN(l)?0:l,u=isNaN(u)?0:u;let d=i*l,f=i*u;return{previous:{x:o.x-d*(s.x-r.x),y:o.y-d*(s.y-r.y)},next:{x:o.x+f*(s.x-r.x),y:o.y+f*(s.y-r.y)}}}function sQ(n,e,t){let i=n.length,r,o,s,a,c,l=Yc(n,0);for(let u=0;u!l.skip)),e.cubicInterpolationMode==="monotone")cQ(n,r);else{let l=i?n[n.length-1]:n[0];for(o=0,s=n.length;on.ownerDocument.defaultView.getComputedStyle(n,null);function uQ(n,e){return Xg(n).getPropertyValue(e)}var dQ=["top","right","bottom","left"];function Us(n,e,t){let i={};t=t?"-"+t:"";for(let r=0;r<4;r++){let o=dQ[r];i[o]=parseFloat(n[e+"-"+o+t])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}var fQ=(n,e,t)=>(n>0||e>0)&&(!t||!t.shadowRoot);function hQ(n,e){let t=n.touches,i=t&&t.length?t[0]:n,{offsetX:r,offsetY:o}=i,s=!1,a,c;if(fQ(r,o,n.target))a=r,c=o;else{let l=e.getBoundingClientRect();a=i.clientX-l.left,c=i.clientY-l.top,s=!0}return{x:a,y:c,box:s}}function Do(n,e){if("native"in n)return n;let{canvas:t,currentDevicePixelRatio:i}=e,r=Xg(t),o=r.boxSizing==="border-box",s=Us(r,"padding"),a=Us(r,"border","width"),{x:c,y:l,box:u}=hQ(n,t),d=s.left+(u&&a.left),f=s.top+(u&&a.top),{width:h,height:g}=e;return o&&(h-=s.width+a.width,g-=s.height+a.height),{x:Math.round((c-d)/h*t.width/i),y:Math.round((l-f)/g*t.height/i)}}function pQ(n,e,t){let i,r;if(e===void 0||t===void 0){let o=n&&Zg(n);if(!o)e=n.clientWidth,t=n.clientHeight;else{let s=o.getBoundingClientRect(),a=Xg(o),c=Us(a,"border","width"),l=Us(a,"padding");e=s.width-l.width-c.width,t=s.height-l.height-c.height,i=Ug(a.maxWidth,o,"clientWidth"),r=Ug(a.maxHeight,o,"clientHeight")}}return{width:e,height:t,maxWidth:i||jg,maxHeight:r||jg}}var Eo=n=>Math.round(n*10)/10;function WL(n,e,t,i){let r=Xg(n),o=Us(r,"margin"),s=Ug(r.maxWidth,n,"clientWidth")||jg,a=Ug(r.maxHeight,n,"clientHeight")||jg,c=pQ(n,e,t),{width:l,height:u}=c;if(r.boxSizing==="content-box"){let f=Us(r,"border","width"),h=Us(r,"padding");l-=h.width+f.width,u-=h.height+f.height}return l=Math.max(0,l-o.width),u=Math.max(0,i?l/i:u-o.height),l=Eo(Math.min(l,s,c.maxWidth)),u=Eo(Math.min(u,a,c.maxHeight)),l&&!u&&(u=Eo(l/2)),(e!==void 0||t!==void 0)&&i&&c.height&&u>c.height&&(u=c.height,l=Eo(Math.floor(u*i))),{width:l,height:u}}function GI(n,e,t){let i=e||1,r=Eo(n.height*i),o=Eo(n.width*i);n.height=Eo(n.height),n.width=Eo(n.width);let s=n.canvas;return s.style&&(t||!s.style.height&&!s.style.width)&&(s.style.height=`${n.height}px`,s.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||s.height!==r||s.width!==o?(n.currentDevicePixelRatio=i,s.height=r,s.width=o,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}var qL=(function(){let n=!1;try{let e={get passive(){return n=!0,!1}};Qg()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return n})();function YI(n,e){let t=uQ(n,e),i=t&&t.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function bo(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:n.y+t*(e.y-n.y)}}function GL(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:i==="middle"?t<.5?n.y:e.y:i==="after"?t<1?n.y:e.y:t>0?e.y:n.y}}function YL(n,e,t,i){let r={x:n.cp2x,y:n.cp2y},o={x:e.cp1x,y:e.cp1y},s=bo(n,r,t),a=bo(r,o,t),c=bo(o,e,t),l=bo(s,a,t),u=bo(a,c,t);return bo(l,u,t)}var mQ=function(n,e){return{x(t){return n+n+e-t},setWidth(t){e=t},textAlign(t){return t==="center"?t:t==="right"?"left":"right"},xPlus(t,i){return t-i},leftForLtr(t,i){return t-i}}},gQ=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,e){return n+e},leftForLtr(n,e){return n}}};function zs(n,e,t){return n?mQ(e,t):gQ()}function KI(n,e){let t,i;(e==="ltr"||e==="rtl")&&(t=n.canvas.style,i=[t.getPropertyValue("direction"),t.getPropertyPriority("direction")],t.setProperty("direction",e,"important"),n.prevTextDirection=i)}function QI(n,e){e!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",e[0],e[1]))}function KL(n){return n==="angle"?{between:Xc,compare:NK,normalize:xt}:{between:zi,compare:(e,t)=>e-t,normalize:e=>e}}function _L({start:n,end:e,count:t,loop:i,style:r}){return{start:n%t,end:e%t,loop:i&&(e-n+1)%t===0,style:r}}function vQ(n,e,t){let{property:i,start:r,end:o}=t,{between:s,normalize:a}=KL(i),c=e.length,{start:l,end:u,loop:d}=n,f,h;if(d){for(l+=c,u+=c,f=0,h=c;fc(r,I,b)&&a(r,I)!==0,S=()=>a(o,b)===0||c(o,I,b),T=()=>y||D(),F=()=>!y||S();for(let R=u,j=u;R<=d;++R)w=e[R%s],!w.skip&&(b=l(w[i]),b!==I&&(y=c(b,r,o),_===null&&T()&&(_=a(b,r)===0?R:j),_!==null&&F()&&(g.push(_L({start:_,end:R,loop:f,count:s,style:h})),_=null),j=R,I=b));return _!==null&&g.push(_L({start:_,end:d,loop:f,count:s,style:h})),g}function XI(n,e){let t=[],i=n.segments;for(let r=0;rr&&n[o%e].skip;)o--;return o%=e,{start:r,end:o}}function _Q(n,e,t,i){let r=n.length,o=[],s=e,a=n[e],c;for(c=e+1;c<=t;++c){let l=n[c%r];l.skip||l.stop?a.skip||(i=!1,o.push({start:e%r,end:(c-1)%r,loop:i}),e=s=l.stop?c:null):(s=c,a.skip&&(e=c)),a=l}return s!==null&&o.push({start:e%r,end:s%r,loop:i}),o}function QL(n,e){let t=n.points,i=n.options.spanGaps,r=t.length;if(!r)return[];let o=!!n._loop,{start:s,end:a}=yQ(t,r,o,i);if(i===!0)return bL(n,[{start:s,end:a,loop:o}],t,e);let c=aa({chart:e,initial:t.initial,numSteps:s,currentStep:Math.min(i-t.start,s)}))}_refresh(){this._request||(this._running=!0,this._request=OI.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,r)=>{if(!i.running||!i.items.length)return;let o=i.items,s=o.length-1,a=!1,c;for(;s>=0;--s)c=o[s],c._active?(c._total>i.duration&&(i.duration=c._total),c.tick(e),a=!0):(o[s]=o[o.length-1],o.pop());a&&(r.draw(),this._notify(r,i,e,"progress")),o.length||(i.running=!1,this._notify(r,i,e,"complete"),i.initial=!1),t+=o.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){let t=this._charts,i=t.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,i)),i}listen(e,t,i){this._getAnims(e).listeners[t].push(i)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){let t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((i,r)=>Math.max(i,r._duration),0),this._refresh())}running(e){if(!this._running)return!1;let t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){let t=this._charts.get(e);if(!t||!t.items.length)return;let i=t.items,r=i.length-1;for(;r>=0;--r)i[r].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}},Sr=new dS,ZL="transparent",CQ={boolean(n,e,t){return t>.5?e:n},color(n,e,t){let i=jI(n||ZL),r=i.valid&&jI(e||ZL);return r&&r.valid?r.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}},fS=class{constructor(e,t,i,r){let o=t[i];r=tl([e.to,r,o,e.from]);let s=tl([e.from,o,r]);this._active=!0,this._fn=e.fn||CQ[e.type||typeof s],this._easing=qc[e.easing]||qc.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=s,this._to=r,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);let r=this._target[this._prop],o=i-this._start,s=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(s,e.duration)),this._total+=o,this._loop=!!e.loop,this._to=tl([e.to,t,r,e.from]),this._from=tl([e.from,r,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){let t=e-this._start,i=this._duration,r=this._prop,o=this._from,s=this._loop,a=this._to,c;if(this._active=o!==a&&(s||t1?2-c:c,c=this._easing(Math.min(1,Math.max(0,c))),this._target[r]=this._fn(o,a,c)}wait(){let e=this._promises||(this._promises=[]);return new Promise((t,i)=>{e.push({res:t,rej:i})})}_notify(e){let t=e?"res":"rej",i=this._promises||[];for(let r=0;r{let o=e[r];if(!fe(o))return;let s={};for(let a of t)s[a]=o[a];(Ve(o.properties)&&o.properties||[r]).forEach(a=>{(a===r||!i.has(a))&&i.set(a,s)})})}_animateOptions(e,t){let i=t.options,r=SQ(e,i);if(!r)return[];let o=this._createAnimations(r,i);return i.$shared&&IQ(e.options.$animations,i).then(()=>{e.options=i},()=>{}),o}_createAnimations(e,t){let i=this._properties,r=[],o=e.$animations||(e.$animations={}),s=Object.keys(t),a=Date.now(),c;for(c=s.length-1;c>=0;--c){let l=s[c];if(l.charAt(0)==="$")continue;if(l==="options"){r.push(...this._animateOptions(e,t));continue}let u=t[l],d=o[l],f=i.get(l);if(d)if(f&&d.active()){d.update(f,u,a);continue}else d.cancel();if(!f||!f.duration){e[l]=u;continue}o[l]=d=new fS(f,e,l,u),r.push(d)}return r}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}let i=this._createAnimations(e,t);if(i.length)return Sr.add(this._chart,i),!0}};function IQ(n,e){let t=[],i=Object.keys(e);for(let r=0;r0||!t&&o<0)return r.index}return null}function tF(n,e){let{chart:t,_cachedMeta:i}=n,r=t._stacks||(t._stacks={}),{iScale:o,vScale:s,index:a}=i,c=o.axis,l=s.axis,u=AQ(o,s,i),d=e.length,f;for(let h=0;ht[i].axis===e).shift()}function kQ(n,e){return Ir(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function NQ(n,e,t){return Ir(n,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function Ld(n,e){let t=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){e=e||n._parsed;for(let r of e){let o=r._stacks;if(!o||o[i]===void 0||o[i][t]===void 0)return;delete o[i][t],o[i]._visualValues!==void 0&&o[i]._visualValues[t]!==void 0&&delete o[i]._visualValues[t]}}}var nS=n=>n==="reset"||n==="none",nF=(n,e)=>e?n:Object.assign({},n),OQ=(n,e,t)=>n&&!e.hidden&&e._stacked&&{keys:ZF(t,!0),values:null},xo=(()=>{class n{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,i){this.chart=t,this._ctx=t.ctx,this.index=i,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){let t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=eS(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&Ld(this._cachedMeta),this.index=t}linkScales(){let t=this.chart,i=this._cachedMeta,r=this.getDataset(),o=(f,h,g,y)=>f==="x"?h:f==="r"?y:g,s=i.xAxisID=Z(r.xAxisID,tS(t,"x")),a=i.yAxisID=Z(r.yAxisID,tS(t,"y")),c=i.rAxisID=Z(r.rAxisID,tS(t,"r")),l=i.indexAxis,u=i.iAxisID=o(l,s,a,c),d=i.vAxisID=o(l,a,s,c);i.xScale=this.getScaleForId(s),i.yScale=this.getScaleForId(a),i.rScale=this.getScaleForId(c),i.iScale=this.getScaleForId(u),i.vScale=this.getScaleForId(d)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){let i=this._cachedMeta;return t===i.iScale?i.vScale:i.iScale}reset(){this._update("reset")}_destroy(){let t=this._cachedMeta;this._data&&kI(this._data,this),t._stacked&&Ld(t)}_dataCheck(){let t=this.getDataset(),i=t.data||(t.data=[]),r=this._data;if(fe(i)){let o=this._cachedMeta;this._data=xQ(i,o)}else if(r!==i){if(r){kI(r,this);let o=this._cachedMeta;Ld(o),o._parsed=[]}i&&Object.isExtensible(i)&&kL(i,this),this._syncList=[],this._data=i}}addElements(){let t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){let i=this._cachedMeta,r=this.getDataset(),o=!1;this._dataCheck();let s=i._stacked;i._stacked=eS(i.vScale,i),i.stack!==r.stack&&(o=!0,Ld(i),i.stack=r.stack),this._resyncElements(t),(o||s!==i._stacked)&&(tF(this,i._parsed),i._stacked=eS(i.vScale,i))}configure(){let t=this.chart.config,i=t.datasetScopeKeys(this._type),r=t.getOptionScopes(this.getDataset(),i,!0);this.options=t.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,i){let{_cachedMeta:r,_data:o}=this,{iScale:s,_stacked:a}=r,c=s.axis,l=t===0&&i===o.length?!0:r._sorted,u=t>0&&r._parsed[t-1],d,f,h;if(this._parsing===!1)r._parsed=o,r._sorted=!0,h=o;else{Ve(o[t])?h=this.parseArrayData(r,o,t,i):fe(o[t])?h=this.parseObjectData(r,o,t,i):h=this.parsePrimitiveData(r,o,t,i);let g=()=>f[c]===null||u&&f[c]_||f<_}for(h=0;h=0;--h)if(!y()){this.updateRangeFromParsed(u,t,g,l);break}}return u}getAllParsedValues(t){let i=this._cachedMeta._parsed,r=[],o,s,a;for(o=0,s=i.length;o=0&&tthis.getContext(r,o,i),_=u.resolveNamedOptions(h,g,y,f);return _.$shared&&(_.$shared=l,s[a]=Object.freeze(nF(_,l))),_}_resolveAnimations(t,i,r){let o=this.chart,s=this._cachedDataOpts,a=`animation-${i}`,c=s[a];if(c)return c;let l;if(o.options.animation!==!1){let d=this.chart.config,f=d.datasetAnimationScopeKeys(this._type,i),h=d.getOptionScopes(this.getDataset(),f);l=d.createResolver(h,this.getContext(t,r,i))}let u=new av(o,l&&l.animations);return l&&l._cacheable&&(s[a]=Object.freeze(u)),u}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,i){return!i||nS(t)||this.chart._animationsDisabled}_getSharedOptions(t,i){let r=this.resolveDataElementOptions(t,i),o=this._sharedOptions,s=this.getSharedOptions(r),a=this.includeOptions(i,s)||s!==o;return this.updateSharedOptions(s,i,r),{sharedOptions:s,includeOptions:a}}updateElement(t,i,r,o){nS(o)?Object.assign(t,r):this._resolveAnimations(i,o).update(t,r)}updateSharedOptions(t,i,r){t&&!nS(i)&&this._resolveAnimations(void 0,i).update(t,r)}_setStyle(t,i,r,o){t.active=o;let s=this.getStyle(i,o);this._resolveAnimations(i,r,o).update(t,{options:!o&&this.getSharedOptions(s)||s})}removeHoverStyle(t,i,r){this._setStyle(t,r,"active",!1)}setHoverStyle(t,i,r){this._setStyle(t,r,"active",!0)}_removeDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){let i=this._data,r=this._cachedMeta.data;for(let[c,l,u]of this._syncList)this[c](l,u);this._syncList=[];let o=r.length,s=i.length,a=Math.min(s,o);a&&this.parse(0,a),s>o?this._insertElements(o,s-o,t):s{for(u.length+=i,c=u.length-1;c>=a;c--)u[c]=u[c-i]};for(l(s),c=t;cr-o))}return n._cache.$bar}function LQ(n){let e=n.iScale,t=PQ(e,n.type),i=e._length,r,o,s,a,c=()=>{s===32767||s===-32768||(Qc(a)&&(i=Math.min(i,Math.abs(s-a)||i)),a=s)};for(r=0,o=t.length;r0?r[n-1]:null,a=nMath.abs(a)&&(c=a,l=s),e[t.axis]=l,e._custom={barStart:c,barEnd:l,start:r,end:o,min:s,max:a}}function XF(n,e,t,i){return Ve(n)?jQ(n,e,t,i):e[t.axis]=t.parse(n,i),e}function iF(n,e,t,i){let r=n.iScale,o=n.vScale,s=r.getLabels(),a=r===o,c=[],l,u,d,f;for(l=t,u=t+i;l=t?1:-1)}function UQ(n){let e,t,i,r,o;return n.horizontal?(e=n.base>n.x,t="left",i="right"):(e=n.base{class n extends xo{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,i,r,o){return iF(t,i,r,o)}parseArrayData(t,i,r,o){return iF(t,i,r,o)}parseObjectData(t,i,r,o){let{iScale:s,vScale:a}=t,{xAxisKey:c="x",yAxisKey:l="y"}=this._parsing,u=s.axis==="x"?c:l,d=a.axis==="x"?c:l,f=[],h,g,y,_;for(h=r,g=r+o;hd.controller.options.grouped),s=r.options.stacked,a=[],c=this._cachedMeta.controller.getParsed(i),l=c&&c[r.axis],u=d=>{let f=d._parsed.find(g=>g[r.axis]===l),h=f&&f[d.vScale.axis];if(ue(h)||isNaN(h))return!0};for(let d of o)if(!(i!==void 0&&u(d))&&((s===!1||a.indexOf(d.stack)===-1||s===void 0&&d.stack===void 0)&&a.push(d.stack),d.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){let t=this.chart.scales,i=this.chart.options.indexAxis;return Object.keys(t).filter(r=>t[r].axis===i).shift()}_getAxis(){let t={},i=this.getFirstScaleIdForIndexAxis();for(let r of this.chart.data.datasets)t[Z(this.chart.options.indexAxis==="x"?r.xAxisID:r.yAxisID,i)]=!0;return Object.keys(t)}_getStackIndex(t,i,r){let o=this._getStacks(t,r),s=i!==void 0?o.indexOf(i):-1;return s===-1?o.length-1:s}_getRuler(){let t=this.options,i=this._cachedMeta,r=i.iScale,o=[],s,a;for(s=0,a=i.data.length;s{class n extends xo{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,i,r,o){let s=super.parsePrimitiveData(t,i,r,o);for(let a=0;a=0;--r)i=Math.max(i,t[r].size(this.resolveDataElementOptions(r))/2);return i>0&&i}getLabelAndValue(t){let i=this._cachedMeta,r=this.chart.data.labels||[],{xScale:o,yScale:s}=i,a=this.getParsed(t),c=o.getLabelForValue(a.x),l=s.getLabelForValue(a.y),u=a._custom;return{label:r[t]||"",value:"("+c+", "+l+(u?", "+u:"")+")"}}update(t){let i=this._cachedMeta.data;this.updateElements(i,0,i.length,t)}updateElements(t,i,r,o){let s=o==="reset",{iScale:a,vScale:c}=this._cachedMeta,{sharedOptions:l,includeOptions:u}=this._getSharedOptions(i,o),d=a.axis,f=c.axis;for(let h=i;hXc(I,a,c,!0)?1:Math.max(D,D*t,S,S*t),g=(I,D,S)=>Xc(I,a,c,!0)?-1:Math.min(D,D*t,S,S*t),y=h(0,l,d),_=h(tt,u,f),b=g(ge,l,d),w=g(ge+tt,u,f);i=(y-b)/2,r=(_-w)/2,o=-(y+b)/2,s=-(_+w)/2}return{ratioX:i,ratioY:r,offsetX:o,offsetY:s}}var kS=(()=>{class n extends xo{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let i=t.data,{labels:{pointStyle:r,textAlign:o,color:s,useBorderRadius:a,borderRadius:c}}=t.legend.options;return i.labels.length&&i.datasets.length?i.labels.map((l,u)=>{let f=t.getDatasetMeta(0).controller.getStyle(u);return{text:l,fillStyle:f.backgroundColor,fontColor:s,hidden:!t.getDataVisibility(u),lineDash:f.borderDash,lineDashOffset:f.borderDashOffset,lineJoin:f.borderJoinStyle,lineWidth:f.borderWidth,strokeStyle:f.borderColor,textAlign:o,pointStyle:r,borderRadius:a&&(c||f.borderRadius),index:u}}):[]}},onClick(t,i,r){r.chart.toggleDataVisibility(i.index),r.chart.update()}}}};constructor(t,i){super(t,i),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,i){let r=this.getDataset().data,o=this._cachedMeta;if(this._parsing===!1)o._parsed=r;else{let s=l=>+r[l];if(fe(r[t])){let{key:l="value"}=this._parsing;s=u=>+Cr(r[u],l)}let a,c;for(a=t,c=t+i;a0&&!isNaN(t)?je*(Math.abs(t)/i):0}getLabelAndValue(t){let i=this._cachedMeta,r=this.chart,o=r.data.labels||[],s=Jc(i._parsed[t],r.options.locale);return{label:o[t]||"",value:s}}getMaxBorderWidth(t){let i=0,r=this.chart,o,s,a,c,l;if(!t){for(o=0,s=r.data.datasets.length;o{class n extends xo{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){let i=this._cachedMeta,{dataset:r,data:o=[],_dataset:s}=i,a=this.chart._animationsDisabled,{start:c,count:l}=LI(i,o,a);this._drawStart=c,this._drawCount=l,FI(i)&&(c=0,l=o.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!s._decimated,r.points=o;let u=this.resolveDatasetElementOptions(t);this.options.showLine||(u.borderWidth=0),u.segment=this.options.segment,this.updateElement(r,void 0,{animated:!a,options:u},t),this.updateElements(o,c,l,t)}updateElements(t,i,r,o){let s=o==="reset",{iScale:a,vScale:c,_stacked:l,_dataset:u}=this._cachedMeta,{sharedOptions:d,includeOptions:f}=this._getSharedOptions(i,o),h=a.axis,g=c.axis,{spanGaps:y,segment:_}=this.options,b=$s(y)?y:Number.POSITIVE_INFINITY,w=this.chart._animationsDisabled||s||o==="none",I=i+r,D=t.length,S=i>0&&this.getParsed(i-1);for(let T=0;T=I){R.skip=!0;continue}let j=this.getParsed(T),te=ue(j[g]),ne=R[h]=a.getPixelForValue(j[h],T),he=R[g]=s||te?c.getBasePixel():c.getPixelForValue(l?this.applyStack(c,j,l):j[g],T);R.skip=isNaN(ne)||isNaN(he)||te,R.stop=T>0&&Math.abs(j[h]-S[h])>b,_&&(R.parsed=j,R.raw=u.data[T]),f&&(R.options=d||this.resolveDataElementOptions(T,F.active?"active":o)),w||this.updateElement(F,T,R,o),S=j}}getMaxOverflow(){let t=this._cachedMeta,i=t.dataset,r=i.options&&i.options.borderWidth||0,o=t.data||[];if(!o.length)return r;let s=o[0].size(this.resolveDataElementOptions(0)),a=o[o.length-1].size(this.resolveDataElementOptions(o.length-1));return Math.max(r,s,a)/2}draw(){let t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}return n})(),JF=(()=>{class n extends xo{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let i=t.data;if(i.labels.length&&i.datasets.length){let{labels:{pointStyle:r,color:o}}=t.legend.options;return i.labels.map((s,a)=>{let l=t.getDatasetMeta(0).controller.getStyle(a);return{text:s,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:o,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,i,r){r.chart.toggleDataVisibility(i.index),r.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,i){super(t,i),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){let i=this._cachedMeta,r=this.chart,o=r.data.labels||[],s=Jc(i._parsed[t].r,r.options.locale);return{label:o[t]||"",value:s}}parseObjectData(t,i,r,o){return qI.bind(this)(t,i,r,o)}update(t){let i=this._cachedMeta.data;this._updateRadius(),this.updateElements(i,0,i.length,t)}getMinMax(){let t=this._cachedMeta,i={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((r,o)=>{let s=this.getParsed(o).r;!isNaN(s)&&this.chart.getDataVisibility(o)&&(si.max&&(i.max=s))}),i}_updateRadius(){let t=this.chart,i=t.chartArea,r=t.options,o=Math.min(i.right-i.left,i.bottom-i.top),s=Math.max(o/2,0),a=Math.max(r.cutoutPercentage?s/100*r.cutoutPercentage:1,0),c=(s-a)/t.getVisibleDatasetCount();this.outerRadius=s-c*this.index,this.innerRadius=this.outerRadius-c}updateElements(t,i,r,o){let s=o==="reset",a=this.chart,l=a.options.animation,u=this._cachedMeta.rScale,d=u.xCenter,f=u.yCenter,h=u.getIndexAngle(0)-.5*ge,g=h,y,_=360/this.countVisibleElements();for(y=0;y{!isNaN(this.getParsed(o).r)&&this.chart.getDataVisibility(o)&&i++}),i}_computeAngle(t,i,r){return this.chart.getDataVisibility(t)?$n(this.resolveDataElementOptions(t,i).angle||r):0}}return n})(),KQ=(()=>{class n extends kS{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}return n})(),QQ=(()=>{class n extends xo{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){let i=this._cachedMeta.vScale,r=this.getParsed(t);return{label:i.getLabels()[t],value:""+i.getLabelForValue(r[i.axis])}}parseObjectData(t,i,r,o){return qI.bind(this)(t,i,r,o)}update(t){let i=this._cachedMeta,r=i.dataset,o=i.data||[],s=i.iScale.getLabels();if(r.points=o,t!=="resize"){let a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);let c={_loop:!0,_fullLoop:s.length===o.length,options:a};this.updateElement(r,void 0,c,t)}this.updateElements(o,0,o.length,t)}updateElements(t,i,r,o){let s=this._cachedMeta.rScale,a=o==="reset";for(let c=i;c{class n extends xo{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(t){let i=this._cachedMeta,r=this.chart.data.labels||[],{xScale:o,yScale:s}=i,a=this.getParsed(t),c=o.getLabelForValue(a.x),l=s.getLabelForValue(a.y);return{label:r[t]||"",value:"("+c+", "+l+")"}}update(t){let i=this._cachedMeta,{data:r=[]}=i,o=this.chart._animationsDisabled,{start:s,count:a}=LI(i,r,o);if(this._drawStart=s,this._drawCount=a,FI(i)&&(s=0,a=r.length),this.options.showLine){this.datasetElementType||this.addElements();let{dataset:c,_dataset:l}=i;c._chart=this.chart,c._datasetIndex=this.index,c._decimated=!!l._decimated,c.points=r;let u=this.resolveDatasetElementOptions(t);u.segment=this.options.segment,this.updateElement(c,void 0,{animated:!o,options:u},t)}else this.datasetElementType&&(delete i.dataset,this.datasetElementType=!1);this.updateElements(r,s,a,t)}addElements(){let{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,i,r,o){let s=o==="reset",{iScale:a,vScale:c,_stacked:l,_dataset:u}=this._cachedMeta,d=this.resolveDataElementOptions(i,o),f=this.getSharedOptions(d),h=this.includeOptions(o,f),g=a.axis,y=c.axis,{spanGaps:_,segment:b}=this.options,w=$s(_)?_:Number.POSITIVE_INFINITY,I=this.chart._animationsDisabled||s||o==="none",D=i>0&&this.getParsed(i-1);for(let S=i;S0&&Math.abs(F[g]-D[g])>w,b&&(R.parsed=F,R.raw=u.data[S]),h&&(R.options=f||this.resolveDataElementOptions(S,T.active?"active":o)),I||this.updateElement(T,S,R,o),D=F}this.updateSharedOptions(f,o,d)}getMaxOverflow(){let t=this._cachedMeta,i=t.data||[];if(!this.options.showLine){let c=0;for(let l=i.length-1;l>=0;--l)c=Math.max(c,i[l].size(this.resolveDataElementOptions(l))/2);return c>0&&c}let r=t.dataset,o=r.options&&r.options.borderWidth||0;if(!i.length)return o;let s=i[0].size(this.resolveDataElementOptions(0)),a=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(o,s,a)/2}}return n})(),XQ=Object.freeze({__proto__:null,BarController:WQ,BubbleController:qQ,DoughnutController:kS,LineController:YQ,PieController:KQ,PolarAreaController:JF,RadarController:QQ,ScatterController:ZQ});function Ws(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}var hS=class n{static override(e){Object.assign(n.prototype,e)}options;constructor(e){this.options=e||{}}init(){}formats(){return Ws()}parse(){return Ws()}format(){return Ws()}add(){return Ws()}diff(){return Ws()}startOf(){return Ws()}endOf(){return Ws()}},JQ={_date:hS};function eZ(n,e,t,i){let{controller:r,data:o,_sorted:s}=n,a=r._cachedMeta.iScale,c=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null;if(a&&e===a.axis&&e!=="r"&&s&&o.length){let l=a._reversePixels?AL:Ui;if(i){if(r._sharedOptions){let u=o[0],d=typeof u.getRange=="function"&&u.getRange(e);if(d){let f=l(o,e,t-d),h=l(o,e,t+d);return{lo:f.lo,hi:h.hi}}}}else{let u=l(o,e,t);if(c){let{vScale:d}=r._cachedMeta,{_parsed:f}=n,h=f.slice(0,u.lo+1).reverse().findIndex(y=>!ue(y[d.axis]));u.lo-=Math.max(0,h);let g=f.slice(u.hi).findIndex(y=>!ue(y[d.axis]));u.hi+=Math.max(0,g)}return u}}return{lo:0,hi:o.length-1}}function qd(n,e,t,i,r){let o=n.getSortedVisibleDatasetMetas(),s=t[e];for(let a=0,c=o.length;a{c[s]&&c[s](e[t],r)&&(o.push({element:c,datasetIndex:l,index:u}),a=a||c.inRange(e.x,e.y,r))}),i&&!a?[]:o}var rZ={evaluateInteractionItems:qd,modes:{index(n,e,t,i){let r=Do(e,n),o=t.axis||"x",s=t.includeInvisible||!1,a=t.intersect?rS(n,r,o,i,s):oS(n,r,o,!1,i,s),c=[];return a.length?(n.getSortedVisibleDatasetMetas().forEach(l=>{let u=a[0].index,d=l.data[u];d&&!d.skip&&c.push({element:d,datasetIndex:l.index,index:u})}),c):[]},dataset(n,e,t,i){let r=Do(e,n),o=t.axis||"xy",s=t.includeInvisible||!1,a=t.intersect?rS(n,r,o,i,s):oS(n,r,o,!1,i,s);if(a.length>0){let c=a[0].datasetIndex,l=n.getDatasetMeta(c).data;a=[];for(let u=0;ut.pos===e)}function aF(n,e){return n.filter(t=>e2.indexOf(t.pos)===-1&&t.box.axis===e)}function Vd(n,e){return n.sort((t,i)=>{let r=e?i:t,o=e?t:i;return r.weight===o.weight?r.index-o.index:r.weight-o.weight})}function oZ(n){let e=[],t,i,r,o,s,a;for(t=0,i=(n||[]).length;tl.box.fullSize),!0),i=Vd(Fd(e,"left"),!0),r=Vd(Fd(e,"right")),o=Vd(Fd(e,"top"),!0),s=Vd(Fd(e,"bottom")),a=aF(e,"x"),c=aF(e,"y");return{fullSize:t,leftAndTop:i.concat(o),rightAndBottom:r.concat(c).concat(s).concat(a),chartArea:Fd(e,"chartArea"),vertical:i.concat(r).concat(c),horizontal:o.concat(s).concat(a)}}function cF(n,e,t,i){return Math.max(n[t],e[t])+Math.max(n[i],e[i])}function t2(n,e){n.top=Math.max(n.top,e.top),n.left=Math.max(n.left,e.left),n.bottom=Math.max(n.bottom,e.bottom),n.right=Math.max(n.right,e.right)}function lZ(n,e,t,i){let{pos:r,box:o}=t,s=n.maxPadding;if(!fe(r)){t.size&&(n[r]-=t.size);let d=i[t.stack]||{size:0,count:1};d.size=Math.max(d.size,t.horizontal?o.height:o.width),t.size=d.size/d.count,n[r]+=t.size}o.getPadding&&t2(s,o.getPadding());let a=Math.max(0,e.outerWidth-cF(s,n,"left","right")),c=Math.max(0,e.outerHeight-cF(s,n,"top","bottom")),l=a!==n.w,u=c!==n.h;return n.w=a,n.h=c,t.horizontal?{same:l,other:u}:{same:u,other:l}}function uZ(n){let e=n.maxPadding;function t(i){let r=Math.max(e[i]-n[i],0);return n[i]+=r,r}n.y+=t("top"),n.x+=t("left"),t("right"),t("bottom")}function dZ(n,e){let t=e.maxPadding;function i(r){let o={left:0,top:0,right:0,bottom:0};return r.forEach(s=>{o[s]=Math.max(e[s],t[s])}),o}return i(n?["left","right"]:["top","bottom"])}function Ud(n,e,t,i){let r=[],o,s,a,c,l,u;for(o=0,s=n.length,l=0;o{typeof y.beforeLayout=="function"&&y.beforeLayout()});let u=c.reduce((y,_)=>_.box.options&&_.box.options.display===!1?y:y+1,0)||1,d=Object.freeze({outerWidth:e,outerHeight:t,padding:r,availableWidth:o,availableHeight:s,vBoxMaxWidth:o/2/u,hBoxMaxHeight:s/2}),f=Object.assign({},r);t2(f,Mt(i));let h=Object.assign({maxPadding:f,w:o,h:s,x:r.left,y:r.top},r),g=aZ(c.concat(l),d);Ud(a.fullSize,h,d,g),Ud(c,h,d,g),Ud(l,h,d,g)&&Ud(c,h,d,g),uZ(h),lF(a.leftAndTop,h,d,g),h.x+=h.w,h.y+=h.h,lF(a.rightAndBottom,h,d,g),n.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},xe(a.chartArea,y=>{let _=y.box;Object.assign(_,n.chartArea),_.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}},cv=class{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,i){}removeEventListener(e,t,i){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,i,r){return t=Math.max(0,t||e.width),i=i||e.height,{width:t,height:Math.max(0,r?Math.floor(t/r):i)}}isAttached(e){return!0}updateConfig(e){}},pS=class extends cv{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}},ov="$chartjs",fZ={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},uF=n=>n===null||n==="";function hZ(n,e){let t=n.style,i=n.getAttribute("height"),r=n.getAttribute("width");if(n[ov]={initial:{height:i,width:r,style:{display:t.display,height:t.height,width:t.width}}},t.display=t.display||"block",t.boxSizing=t.boxSizing||"border-box",uF(r)){let o=YI(n,"width");o!==void 0&&(n.width=o)}if(uF(i))if(n.style.height==="")n.height=n.width/(e||2);else{let o=YI(n,"height");o!==void 0&&(n.height=o)}return n}var n2=qL?{passive:!0}:!1;function pZ(n,e,t){n&&n.addEventListener(e,t,n2)}function mZ(n,e,t){n&&n.canvas&&n.canvas.removeEventListener(e,t,n2)}function gZ(n,e){let t=fZ[n.type]||n.type,{x:i,y:r}=Do(n,e);return{type:t,chart:e,native:n,x:i!==void 0?i:null,y:r!==void 0?r:null}}function lv(n,e){for(let t of n)if(t===e||t.contains(e))return!0}function vZ(n,e,t){let i=n.canvas,r=new MutationObserver(o=>{let s=!1;for(let a of o)s=s||lv(a.addedNodes,i),s=s&&!lv(a.removedNodes,i);s&&t()});return r.observe(document,{childList:!0,subtree:!0}),r}function yZ(n,e,t){let i=n.canvas,r=new MutationObserver(o=>{let s=!1;for(let a of o)s=s||lv(a.removedNodes,i),s=s&&!lv(a.addedNodes,i);s&&t()});return r.observe(document,{childList:!0,subtree:!0}),r}var $d=new Map,dF=0;function i2(){let n=window.devicePixelRatio;n!==dF&&(dF=n,$d.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function _Z(n,e){$d.size||window.addEventListener("resize",i2),$d.set(n,e)}function bZ(n){$d.delete(n),$d.size||window.removeEventListener("resize",i2)}function EZ(n,e,t){let i=n.canvas,r=i&&Zg(i);if(!r)return;let o=PI((a,c)=>{let l=r.clientWidth;t(a,c),l{let c=a[0],l=c.contentRect.width,u=c.contentRect.height;l===0&&u===0||o(l,u)});return s.observe(r),_Z(n,o),s}function sS(n,e,t){t&&t.disconnect(),e==="resize"&&bZ(n)}function wZ(n,e,t){let i=n.canvas,r=PI(o=>{n.ctx!==null&&t(gZ(o,n))},n);return pZ(i,e,r),r}var mS=class extends cv{acquireContext(e,t){let i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(hZ(e,t),i):null}releaseContext(e){let t=e.canvas;if(!t[ov])return!1;let i=t[ov].initial;["height","width"].forEach(o=>{let s=i[o];ue(s)?t.removeAttribute(o):t.setAttribute(o,s)});let r=i.style||{};return Object.keys(r).forEach(o=>{t.style[o]=r[o]}),t.width=t.width,delete t[ov],!0}addEventListener(e,t,i){this.removeEventListener(e,t);let r=e.$proxies||(e.$proxies={}),s={attach:vZ,detach:yZ,resize:EZ}[t]||wZ;r[t]=s(e,t,i)}removeEventListener(e,t){let i=e.$proxies||(e.$proxies={}),r=i[t];if(!r)return;({attach:sS,detach:sS,resize:sS}[t]||mZ)(e,t,r),i[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,r){return WL(e,t,i,r)}isAttached(e){let t=e&&Zg(e);return!!(t&&t.isConnected)}};function CZ(n){return!Qg()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?pS:mS}var fi=class{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(e){let{x:t,y:i}=this.getProps(["x","y"],e);return{x:t,y:i}}hasValue(){return $s(this.x)&&$s(this.y)}getProps(e,t){let i=this.$animations;if(!t||!i)return this;let r={};return e.forEach(o=>{r[o]=i[o]&&i[o].active()?i[o]._to:this[o]}),r}};function IZ(n,e){let t=n.options.ticks,i=SZ(n),r=Math.min(t.maxTicksLimit||i,i),o=t.major.enabled?TZ(e):[],s=o.length,a=o[0],c=o[s-1],l=[];if(s>r)return xZ(e,l,o,s/r),l;let u=DZ(o,e,r);if(s>0){let d,f,h=s>1?Math.round((c-a)/(s-1)):null;for(ev(e,l,u,ue(h)?0:a-h,a),d=0,f=s-1;dr)return c}return Math.max(r,1)}function TZ(n){let e=[],t,i;for(t=0,i=n.length;tn==="left"?"right":n==="right"?"left":n,fF=(n,e,t)=>e==="top"||e==="left"?n[e]+t:n[e]-t,hF=(n,e)=>Math.min(e||n,n);function pF(n,e){let t=[],i=n.length/e,r=n.length,o=0;for(;os+a)))return c}function kZ(n,e){xe(n,t=>{let i=t.gc,r=i.length/2,o;if(r>e){for(o=0;oi?i:t,i=r&&t>i?t:i,{min:dn(t,dn(i,t)),max:dn(i,dn(t,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Oe(this.options.beforeUpdate,[this])}update(e,t,i){let{beginAtZero:r,grace:o,ticks:s}=this.options,a=s.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=jL(this,o,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let c=a=o||i<=1||!this.isHorizontal()){this.labelRotation=r;return}let u=this._getLabelSizes(),d=u.widest.width,f=u.highest.height,h=pt(this.chart.width-d,0,this.maxWidth);a=e.offset?this.maxWidth/i:h/(i-1),d+6>a&&(a=h/(i-(e.offset?.5:1)),c=this.maxHeight-jd(e.grid)-t.padding-mF(e.title,this.chart.options.font),l=Math.sqrt(d*d+f*f),s=$g(Math.min(Math.asin(pt((u.highest.height+6)/a,-1,1)),Math.asin(pt(c/l,-1,1))-Math.asin(pt(f/l,-1,1)))),s=Math.max(r,Math.min(o,s))),this.labelRotation=s}afterCalculateLabelRotation(){Oe(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Oe(this.options.beforeFit,[this])}fit(){let e={width:0,height:0},{chart:t,options:{ticks:i,title:r,grid:o}}=this,s=this._isVisible(),a=this.isHorizontal();if(s){let c=mF(r,t.options.font);if(a?(e.width=this.maxWidth,e.height=jd(o)+c):(e.height=this.maxHeight,e.width=jd(o)+c),i.display&&this.ticks.length){let{first:l,last:u,widest:d,highest:f}=this._getLabelSizes(),h=i.padding*2,g=$n(this.labelRotation),y=Math.cos(g),_=Math.sin(g);if(a){let b=i.mirror?0:_*d.width+y*f.height;e.height=Math.min(this.maxHeight,e.height+b+h)}else{let b=i.mirror?0:y*d.width+_*f.height;e.width=Math.min(this.maxWidth,e.width+b+h)}this._calculatePadding(l,u,_,y)}}this._handleMargins(),a?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,i,r){let{ticks:{align:o,padding:s},position:a}=this.options,c=this.labelRotation!==0,l=a!=="top"&&this.axis==="x";if(this.isHorizontal()){let u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1),f=0,h=0;c?l?(f=r*e.width,h=i*t.height):(f=i*e.height,h=r*t.width):o==="start"?h=t.width:o==="end"?f=e.width:o!=="inner"&&(f=e.width/2,h=t.width/2),this.paddingLeft=Math.max((f-u+s)*this.width/(this.width-u),0),this.paddingRight=Math.max((h-d+s)*this.width/(this.width-d),0)}else{let u=t.height/2,d=e.height/2;o==="start"?(u=0,d=e.height):o==="end"&&(u=t.height,d=0),this.paddingTop=u+s,this.paddingBottom=d+s}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Oe(this.options.afterFit,[this])}isHorizontal(){let{axis:e,position:t}=this.options;return t==="top"||t==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,i;for(t=0,i=e.length;t({width:s[j]||0,height:a[j]||0});return{first:R(0),last:R(t-1),widest:R(T),highest:R(F),widths:s,heights:a}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){let t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);let t=this._startPixel+e*this._length;return xL(this._alignToPixels?Co(this.chart,t,0):t)}getDecimalForPixel(e){let t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){let t=this.ticks||[];if(e>=0&&ea*r?a/i:c/r:c*r0}_computeGridLineItems(e){let t=this.axis,i=this.chart,r=this.options,{grid:o,position:s,border:a}=r,c=o.offset,l=this.isHorizontal(),d=this.ticks.length+(c?1:0),f=jd(o),h=[],g=a.setContext(this.getContext()),y=g.display?g.width:0,_=y/2,b=function(He){return Co(i,He,y)},w,I,D,S,T,F,R,j,te,ne,he,Et;if(s==="top")w=b(this.bottom),F=this.bottom-f,j=w-_,ne=b(e.top)+_,Et=e.bottom;else if(s==="bottom")w=b(this.top),ne=e.top,Et=b(e.bottom)-_,F=w+_,j=this.top+f;else if(s==="left")w=b(this.right),T=this.right-f,R=w-_,te=b(e.left)+_,he=e.right;else if(s==="right")w=b(this.left),te=e.left,he=b(e.right)-_,T=w+_,R=this.left+f;else if(t==="x"){if(s==="center")w=b((e.top+e.bottom)/2+.5);else if(fe(s)){let He=Object.keys(s)[0],nt=s[He];w=b(this.chart.scales[He].getPixelForValue(nt))}ne=e.top,Et=e.bottom,F=w+_,j=F+f}else if(t==="y"){if(s==="center")w=b((e.left+e.right)/2);else if(fe(s)){let He=Object.keys(s)[0],nt=s[He];w=b(this.chart.scales[He].getPixelForValue(nt))}T=w-_,R=T-f,te=e.left,he=e.right}let pn=Z(r.ticks.maxTicksLimit,d),Me=Math.max(1,Math.ceil(d/pn));for(I=0;I0&&(Ro-=Mo/2);break}Gd={left:Ro,top:al,width:Mo+Ks.width,height:sl+Ks.height,color:Me.backdropColor}}_.push({label:D,font:j,textOffset:he,options:{rotation:y,color:nt,strokeColor:zn,strokeWidth:Rt,textAlign:Ys,textBaseline:Et,translation:[S,T],backdrop:Gd}})}return _}_getXAxisLabelAlignment(){let{position:e,ticks:t}=this.options;if(-$n(this.labelRotation))return e==="top"?"left":"right";let r="center";return t.align==="start"?r="left":t.align==="end"?r="right":t.align==="inner"&&(r="inner"),r}_getYAxisLabelAlignment(e){let{position:t,ticks:{crossAlign:i,mirror:r,padding:o}}=this.options,s=this._getLabelSizes(),a=e+o,c=s.widest.width,l,u;return t==="left"?r?(u=this.right+o,i==="near"?l="left":i==="center"?(l="center",u+=c/2):(l="right",u+=c)):(u=this.right-a,i==="near"?l="right":i==="center"?(l="center",u-=c/2):(l="left",u=this.left)):t==="right"?r?(u=this.left+o,i==="near"?l="right":i==="center"?(l="center",u-=c/2):(l="left",u-=c)):(u=this.left+a,i==="near"?l="left":i==="center"?(l="center",u+=c/2):(l="right",u=this.right)):l="right",{textAlign:l,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;let e=this.chart,t=this.options.position;if(t==="left"||t==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(t==="top"||t==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){let{ctx:e,options:{backgroundColor:t},left:i,top:r,width:o,height:s}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(i,r,o,s),e.restore())}getLineWidthForValue(e){let t=this.options.grid;if(!this._isVisible()||!t.display)return 0;let r=this.ticks.findIndex(o=>o.value===e);return r>=0?t.setContext(this.getContext(r)).lineWidth:0}drawGrid(e){let t=this.options.grid,i=this.ctx,r=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e)),o,s,a=(c,l,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(c.x,c.y),i.lineTo(l.x,l.y),i.stroke(),i.restore())};if(t.display)for(o=0,s=r.length;o{this.draw(o)}}]:[{z:i,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:t,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(e){let t=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",r=[],o,s;for(o=0,s=t.length;o{let i=t.split("."),r=i.pop(),o=[n].concat(i).join("."),s=e[t].split("."),a=s.pop(),c=s.join(".");Ue.route(o,r,c,a)})}function jZ(n){return"id"in n&&"defaults"in n}var gS=class{constructor(){this.controllers=new il(xo,"datasets",!0),this.elements=new il(fi,"elements"),this.plugins=new il(Object,"plugins"),this.scales=new il(Gs,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,t,i){[...t].forEach(r=>{let o=i||this._getRegistryForType(r);i||o.isForType(r)||o===this.plugins&&r.id?this._exec(e,o,r):xe(r,s=>{let a=i||this._getRegistryForType(s);this._exec(e,a,s)})})}_exec(e,t,i){let r=Hg(e);Oe(i["before"+r],[],i),t[e](i),Oe(i["after"+r],[],i)}_getRegistryForType(e){for(let t=0;to.filter(a=>!s.some(c=>a.plugin.id===c.plugin.id));this._notify(r(t,i),e,"stop"),this._notify(r(i,t),e,"start")}};function BZ(n){let e={},t=[],i=Object.keys(qi.plugins.items);for(let o=0;o1&&gF(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function vF(n,e,t){if(t[e+"AxisID"]===n)return{axis:e}}function GZ(n,e){if(e.data&&e.data.datasets){let t=e.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(t.length)return vF(n,"x",t[0])||vF(n,"y",t[0])}return{}}function YZ(n,e){let t=wo[n.type]||{scales:{}},i=e.scales||{},r=yS(n.type,e),o=Object.create(null);return Object.keys(i).forEach(s=>{let a=i[s];if(!fe(a))return console.error(`Invalid scale configuration for scale: ${s}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${s}`);let c=_S(s,a,GZ(s,n),Ue.scales[a.type]),l=WZ(c,r),u=t.scales||{};o[s]=Kc(Object.create(null),[{axis:c},a,u[c],u[l]])}),n.data.datasets.forEach(s=>{let a=s.type||n.type,c=s.indexAxis||yS(a,e),u=(wo[a]||{}).scales||{};Object.keys(u).forEach(d=>{let f=zZ(d,c),h=s[f+"AxisID"]||f;o[h]=o[h]||Object.create(null),Kc(o[h],[{axis:f},i[h],u[d]])})}),Object.keys(o).forEach(s=>{let a=o[s];Kc(a,[Ue.scales[a.type],Ue.scale])}),o}function r2(n){let e=n.options||(n.options={});e.plugins=Z(e.plugins,{}),e.scales=YZ(n,e)}function o2(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function KZ(n){return n=n||{},n.data=o2(n.data),r2(n),n}var yF=new Map,s2=new Set;function tv(n,e){let t=yF.get(n);return t||(t=e(),yF.set(n,t),s2.add(t)),t}var Bd=(n,e,t)=>{let i=Cr(e,t);i!==void 0&&n.add(i)},bS=class{constructor(e){this._config=KZ(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=o2(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){let e=this._config;this.clearCache(),r2(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return tv(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return tv(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return tv(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){let t=e.id,i=this.type;return tv(`${i}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){let i=this._scopeCache,r=i.get(e);return(!r||t)&&(r=new Map,i.set(e,r)),r}getOptionScopes(e,t,i){let{options:r,type:o}=this,s=this._cachedScopes(e,i),a=s.get(t);if(a)return a;let c=new Set;t.forEach(u=>{e&&(c.add(e),u.forEach(d=>Bd(c,e,d))),u.forEach(d=>Bd(c,r,d)),u.forEach(d=>Bd(c,wo[o]||{},d)),u.forEach(d=>Bd(c,Ue,d)),u.forEach(d=>Bd(c,qg,d))});let l=Array.from(c);return l.length===0&&l.push(Object.create(null)),s2.has(t)&&s.set(t,l),l}chartOptionScopes(){let{options:e,type:t}=this;return[e,wo[t]||{},Ue.datasets[t]||{},{type:t},Ue,qg]}resolveNamedOptions(e,t,i,r=[""]){let o={$shared:!0},{resolver:s,subPrefixes:a}=_F(this._resolverCache,e,r),c=s;if(ZZ(s,t)){o.$shared=!1,i=Er(i)?i():i;let l=this.createResolver(e,i,a);c=Hs(s,i,l)}for(let l of t)o[l]=c[l];return o}createResolver(e,t,i=[""],r){let{resolver:o}=_F(this._resolverCache,e,i);return fe(t)?Hs(o,t,void 0,r):o}};function _F(n,e,t){let i=n.get(e);i||(i=new Map,n.set(e,i));let r=t.join(),o=i.get(r);return o||(o={resolver:Kg(e,t),subPrefixes:t.filter(a=>!a.toLowerCase().includes("hover"))},i.set(r,o)),o}var QZ=n=>fe(n)&&Object.getOwnPropertyNames(n).some(e=>Er(n[e]));function ZZ(n,e){let{isScriptable:t,isIndexable:i}=$I(n);for(let r of e){let o=t(r),s=i(r),a=(s||o)&&n[r];if(o&&(Er(a)||QZ(a))||s&&Ve(a))return!0}return!1}var XZ="4.5.1",JZ=["top","bottom","left","right","chartArea"];function bF(n,e){return n==="top"||n==="bottom"||JZ.indexOf(n)===-1&&e==="x"}function EF(n,e){return function(t,i){return t[n]===i[n]?t[e]-i[e]:t[n]-i[n]}}function wF(n){let e=n.chart,t=e.options.animation;e.notifyPlugins("afterRender"),Oe(t&&t.onComplete,[n],e)}function eX(n){let e=n.chart,t=e.options.animation;Oe(t&&t.onProgress,[n],e)}function a2(n){return Qg()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}var sv={},CF=n=>{let e=a2(n);return Object.values(sv).filter(t=>t.canvas===e).pop()};function tX(n,e,t){let i=Object.keys(n);for(let r of i){let o=+r;if(o>=e){let s=n[r];delete n[r],(t>0||o>e)&&(n[o+t]=s)}}}function nX(n,e,t,i){return!t||n.type==="mouseout"?null:i?e:n}var Ao=(()=>{class n{static defaults=Ue;static instances=sv;static overrides=wo;static registry=qi;static version=XZ;static getChart=CF;static register(...t){qi.add(...t),IF()}static unregister(...t){qi.remove(...t),IF()}constructor(t,i){let r=this.config=new bS(i),o=a2(t),s=CF(o);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");let a=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||CZ(o)),this.platform.updateConfig(r);let c=this.platform.acquireContext(o,a.aspectRatio),l=c&&c.canvas,u=l&&l.height,d=l&&l.width;if(this.id=wL(),this.ctx=c,this.canvas=l,this.width=d,this.height=u,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new vS,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=NL(f=>this.update(f),a.resizeDelay||0),this._dataChanges=[],sv[this.id]=this,!c||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Sr.listen(this,"complete",wF),Sr.listen(this,"progress",eX),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:t,maintainAspectRatio:i},width:r,height:o,_aspectRatio:s}=this;return ue(t)?i&&s?s:o?r/o:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return qi}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():GI(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return BI(this.canvas,this.ctx),this}stop(){return Sr.stop(this),this}resize(t,i){Sr.running(this)?this._resizeBeforeDraw={width:t,height:i}:this._resize(t,i)}_resize(t,i){let r=this.options,o=this.canvas,s=r.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(o,t,i,s),c=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,GI(this,c,!0)&&(this.notifyPlugins("resize",{size:a}),Oe(r.onResize,[this,a],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){let i=this.options.scales||{};xe(i,(r,o)=>{r.id=o})}buildOrUpdateScales(){let t=this.options,i=t.scales,r=this.scales,o=Object.keys(r).reduce((a,c)=>(a[c]=!1,a),{}),s=[];i&&(s=s.concat(Object.keys(i).map(a=>{let c=i[a],l=_S(a,c),u=l==="r",d=l==="x";return{options:c,dposition:u?"chartArea":d?"bottom":"left",dtype:u?"radialLinear":d?"category":"linear"}}))),xe(s,a=>{let c=a.options,l=c.id,u=_S(l,c),d=Z(c.type,a.dtype);(c.position===void 0||bF(c.position,u)!==bF(a.dposition))&&(c.position=a.dposition),o[l]=!0;let f=null;if(l in r&&r[l].type===d)f=r[l];else{let h=qi.getScale(d);f=new h({id:l,type:d,ctx:this.ctx,chart:this}),r[f.id]=f}f.init(c,t)}),xe(o,(a,c)=>{a||delete r[c]}),xe(r,a=>{$t.configure(this,a,a.options),$t.addBox(this,a)})}_updateMetasets(){let t=this._metasets,i=this.data.datasets.length,r=t.length;if(t.sort((o,s)=>o.index-s.index),r>i){for(let o=i;oi.length&&delete this._stacks,t.forEach((r,o)=>{i.filter(s=>s===r._dataset).length===0&&this._destroyDatasetMeta(o)})}buildOrUpdateControllers(){let t=[],i=this.data.datasets,r,o;for(this._removeUnreferencedMetasets(),r=0,o=i.length;r{this.getDatasetMeta(i).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){let i=this.config;i.update();let r=this._options=i.createResolver(i.chartOptionScopes(),this.getContext()),o=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;let s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let u=0,d=this.data.datasets.length;u{u.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(EF("z","_idx"));let{_active:c,_lastEvent:l}=this;l?this._eventHandler(l,!0):c.length&&this._updateHoverStyles(c,c,!0),this.render()}_updateScales(){xe(this.scales,t=>{$t.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let t=this.options,i=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!TI(i,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:t}=this,i=this._getUniformDataChanges()||[];for(let{method:r,start:o,count:s}of i){let a=r==="_removeElements"?-s:s;tX(t,o,a)}}_getUniformDataChanges(){let t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];let i=this.data.datasets.length,r=s=>new Set(t.filter(a=>a[0]===s).map((a,c)=>c+","+a.splice(1).join(","))),o=r(0);for(let s=1;ss.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;$t.update(this,this.width,this.height,t);let i=this.chartArea,r=i.width<=0||i.height<=0;this._layers=[],xe(this.boxes,o=>{r&&o.position==="chartArea"||(o.configure&&o.configure(),this._layers.push(...o._layers()))},this),this._layers.forEach((o,s)=>{o._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let i=0,r=this.data.datasets.length;i=0;--i)this._drawDataset(t[i]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){let i=this.ctx,r={meta:t,index:t.index,cancelable:!0},o=JI(this,t);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(o&&Od(i,o),t.controller.draw(),o&&Pd(i),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return Hi(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,i,r,o){let s=rZ.modes[i];return typeof s=="function"?s(this,t,r,o):[]}getDatasetMeta(t){let i=this.data.datasets[t],r=this._metasets,o=r.filter(s=>s&&s._dataset===i).pop();return o||(o={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:i&&i.order||0,index:t,_dataset:i,_parsed:[],_sorted:!1},r.push(o)),o}getContext(){return this.$context||(this.$context=Ir(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){let i=this.data.datasets[t];if(!i)return!1;let r=this.getDatasetMeta(t);return typeof r.hidden=="boolean"?!r.hidden:!i.hidden}setDatasetVisibility(t,i){let r=this.getDatasetMeta(t);r.hidden=!i}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,i,r){let o=r?"show":"hide",s=this.getDatasetMeta(t),a=s.controller._resolveAnimations(void 0,o);Qc(i)?(s.data[i].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),a.update(s,{visible:r}),this.update(c=>c.datasetIndex===t?o:void 0))}hide(t,i){this._updateVisibility(t,i,!1)}show(t,i){this._updateVisibility(t,i,!0)}_destroyDatasetMeta(t){let i=this._metasets[t];i&&i.controller&&i.controller._destroy(),delete this._metasets[t]}_stop(){let t,i;for(this.stop(),Sr.remove(this),t=0,i=this.data.datasets.length;t{i.addEventListener(this,s,a),t[s]=a},o=(s,a,c)=>{s.offsetX=a,s.offsetY=c,this._eventHandler(s)};xe(this.options.events,s=>r(s,o))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});let t=this._responsiveListeners,i=this.platform,r=(l,u)=>{i.addEventListener(this,l,u),t[l]=u},o=(l,u)=>{t[l]&&(i.removeEventListener(this,l,u),delete t[l])},s=(l,u)=>{this.canvas&&this.resize(l,u)},a,c=()=>{o("attach",c),this.attached=!0,this.resize(),r("resize",s),r("detach",a)};a=()=>{this.attached=!1,o("resize",s),this._stop(),this._resize(0,0),r("attach",c)},i.isAttached(this.canvas)?c():a()}unbindEvents(){xe(this._listeners,(t,i)=>{this.platform.removeEventListener(this,i,t)}),this._listeners={},xe(this._responsiveListeners,(t,i)=>{this.platform.removeEventListener(this,i,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,i,r){let o=r?"set":"remove",s,a,c,l;for(i==="dataset"&&(s=this.getDatasetMeta(t[0].datasetIndex),s.controller["_"+o+"DatasetHoverStyle"]()),c=0,l=t.length;c{let c=this.getDatasetMeta(s);if(!c)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:c.data[a],index:a}});!kd(r,i)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,i))}notifyPlugins(t,i,r){return this._plugins.notify(this,t,i,r)}isPluginEnabled(t){return this._plugins._cache.filter(i=>i.plugin.id===t).length===1}_updateHoverStyles(t,i,r){let o=this.options.hover,s=(l,u)=>l.filter(d=>!u.some(f=>d.datasetIndex===f.datasetIndex&&d.index===f.index)),a=s(i,t),c=r?t:s(t,i);a.length&&this.updateHoverStyle(a,o.mode,!1),c.length&&o.mode&&this.updateHoverStyle(c,o.mode,!0)}_eventHandler(t,i){let r={event:t,replay:i,cancelable:!0,inChartArea:this.isPointInArea(t)},o=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,o)===!1)return;let s=this._handleEvent(t,i,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,o),(s||r.changed)&&this.render(),this}_handleEvent(t,i,r){let{_active:o=[],options:s}=this,a=i,c=this._getActiveElements(t,o,r,a),l=SL(t),u=nX(t,this._lastEvent,r,l);r&&(this._lastEvent=null,Oe(s.onHover,[t,c,this],this),l&&Oe(s.onClick,[t,c,this],this));let d=!kd(c,o);return(d||i)&&(this._active=c,this._updateHoverStyles(c,o,i)),this._lastEvent=u,d}_getActiveElements(t,i,r,o){if(t.type==="mouseout")return[];if(!r)return i;let s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,o)}}return n})();function IF(){return xe(Ao.instances,n=>n._plugins.invalidate())}function iX(n,e,t){let{startAngle:i,x:r,y:o,outerRadius:s,innerRadius:a,options:c}=e,{borderWidth:l,borderJoinStyle:u}=c,d=Math.min(l/s,xt(i-t));if(n.beginPath(),n.arc(r,o,s-l/2,i+d/2,t-d/2),a>0){let f=Math.min(l/a,xt(i-t));n.arc(r,o,a+l/2,t-f/2,i+f/2,!0)}else{let f=Math.min(l/2,s*xt(i-t));if(u==="round")n.arc(r,o,f,t-ge/2,i+ge/2,!0);else if(u==="bevel"){let h=2*f*f,g=-h*Math.cos(t+ge/2)+r,y=-h*Math.sin(t+ge/2)+o,_=h*Math.cos(i+ge/2)+r,b=h*Math.sin(i+ge/2)+o;n.lineTo(g,y),n.lineTo(_,b)}}n.closePath(),n.moveTo(0,0),n.rect(0,0,n.canvas.width,n.canvas.height),n.clip("evenodd")}function rX(n,e,t){let{startAngle:i,pixelMargin:r,x:o,y:s,outerRadius:a,innerRadius:c}=e,l=r/a;n.beginPath(),n.arc(o,s,a,i-l,t+l),c>r?(l=r/c,n.arc(o,s,c,t+l,i-l,!0)):n.arc(o,s,r,t+tt,i-tt),n.closePath(),n.clip()}function oX(n){return Yg(n,["outerStart","outerEnd","innerStart","innerEnd"])}function sX(n,e,t,i){let r=oX(n.options.borderRadius),o=(t-e)/2,s=Math.min(o,i*e/2),a=c=>{let l=(t-Math.min(o,c))*i/2;return pt(c,0,Math.min(o,l))};return{outerStart:a(r.outerStart),outerEnd:a(r.outerEnd),innerStart:pt(r.innerStart,0,s),innerEnd:pt(r.innerEnd,0,s)}}function nl(n,e,t,i){return{x:t+n*Math.cos(e),y:i+n*Math.sin(e)}}function uv(n,e,t,i,r,o){let{x:s,y:a,startAngle:c,pixelMargin:l,innerRadius:u}=e,d=Math.max(e.outerRadius+i+t-l,0),f=u>0?u+i+t+l:0,h=0,g=r-c;if(i){let Me=u>0?u-i:0,He=d>0?d-i:0,nt=(Me+He)/2,zn=nt!==0?g*nt/(nt+i):g;h=(g-zn)/2}let y=Math.max(.001,g*d-t/ge)/d,_=(g-y)/2,b=c+_+h,w=r-_-h,{outerStart:I,outerEnd:D,innerStart:S,innerEnd:T}=sX(e,f,d,w-b),F=d-I,R=d-D,j=b+I/F,te=w-D/R,ne=f+S,he=f+T,Et=b+S/ne,pn=w-T/he;if(n.beginPath(),o){let Me=(j+te)/2;if(n.arc(s,a,d,j,Me),n.arc(s,a,d,Me,te),D>0){let Rt=nl(R,te,s,a);n.arc(Rt.x,Rt.y,D,te,w+tt)}let He=nl(he,w,s,a);if(n.lineTo(He.x,He.y),T>0){let Rt=nl(he,pn,s,a);n.arc(Rt.x,Rt.y,T,w+tt,pn+Math.PI)}let nt=(w-T/f+(b+S/f))/2;if(n.arc(s,a,f,w-T/f,nt,!0),n.arc(s,a,f,nt,b+S/f,!0),S>0){let Rt=nl(ne,Et,s,a);n.arc(Rt.x,Rt.y,S,Et+Math.PI,b-tt)}let zn=nl(F,b,s,a);if(n.lineTo(zn.x,zn.y),I>0){let Rt=nl(F,j,s,a);n.arc(Rt.x,Rt.y,I,b-tt,j)}}else{n.moveTo(s,a);let Me=Math.cos(j)*d+s,He=Math.sin(j)*d+a;n.lineTo(Me,He);let nt=Math.cos(te)*d+s,zn=Math.sin(te)*d+a;n.lineTo(nt,zn)}n.closePath()}function aX(n,e,t,i,r){let{fullCircles:o,startAngle:s,circumference:a}=e,c=e.endAngle;if(o){uv(n,e,t,i,c,r);for(let l=0;l=ge&&h===0&&u!=="miter"&&iX(n,e,y),o||(uv(n,e,t,i,y,r),n.stroke())}var ES=class extends fi{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:e=>e!=="borderDash"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(e){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,t,i){let r=this.getProps(["x","y"],i),{angle:o,distance:s}=RI(r,{x:e,y:t}),{startAngle:a,endAngle:c,innerRadius:l,outerRadius:u,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),f=(this.options.spacing+this.options.borderWidth)/2,h=Z(d,c-a),g=Xc(o,a,c)&&a!==c,y=h>=je||g,_=zi(s,l+f,u+f);return y&&_}getCenterPoint(e){let{x:t,y:i,startAngle:r,endAngle:o,innerRadius:s,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:c,spacing:l}=this.options,u=(r+o)/2,d=(s+a+l+c)/2;return{x:t+Math.cos(u)*d,y:i+Math.sin(u)*d}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){let{options:t,circumference:i}=this,r=(t.offset||0)/4,o=(t.spacing||0)/2,s=t.circular;if(this.pixelMargin=t.borderAlign==="inner"?.33:0,this.fullCircles=i>je?Math.floor(i/je):0,i===0||this.innerRadius<0||this.outerRadius<0)return;e.save();let a=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(a)*r,Math.sin(a)*r);let c=1-Math.sin(Math.min(ge,i||0)),l=r*c;e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor,aX(e,this,l,o,s),cX(e,this,l,o,s),e.restore()}};function c2(n,e,t=e){n.lineCap=Z(t.borderCapStyle,e.borderCapStyle),n.setLineDash(Z(t.borderDash,e.borderDash)),n.lineDashOffset=Z(t.borderDashOffset,e.borderDashOffset),n.lineJoin=Z(t.borderJoinStyle,e.borderJoinStyle),n.lineWidth=Z(t.borderWidth,e.borderWidth),n.strokeStyle=Z(t.borderColor,e.borderColor)}function lX(n,e,t){n.lineTo(t.x,t.y)}function uX(n){return n.stepped?FL:n.tension||n.cubicInterpolationMode==="monotone"?VL:lX}function l2(n,e,t={}){let i=n.length,{start:r=0,end:o=i-1}=t,{start:s,end:a}=e,c=Math.max(r,s),l=Math.min(o,a),u=ra&&o>a;return{count:i,start:c,loop:e.loop,ilen:l(s+(l?a-D:D))%o,I=()=>{y!==_&&(n.lineTo(u,_),n.lineTo(u,y),n.lineTo(u,b))};for(c&&(h=r[w(0)],n.moveTo(h.x,h.y)),f=0;f<=a;++f){if(h=r[w(f)],h.skip)continue;let D=h.x,S=h.y,T=D|0;T===g?(S_&&(_=S),u=(d*u+D)/++d):(I(),n.lineTo(D,S),g=T,d=0,y=_=S),b=S}I()}function wS(n){let e=n.options,t=e.borderDash&&e.borderDash.length;return!n._decimated&&!n._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?fX:dX}function hX(n){return n.stepped?GL:n.tension||n.cubicInterpolationMode==="monotone"?YL:bo}function pX(n,e,t,i){let r=e._path;r||(r=e._path=new Path2D,e.path(r,t,i)&&r.closePath()),c2(n,e.options),n.stroke(r)}function mX(n,e,t,i){let{segments:r,options:o}=e,s=wS(e);for(let a of r)c2(n,o,a.style),n.beginPath(),s(n,e,a,{start:t,end:t+i-1})&&n.closePath(),n.stroke()}var gX=typeof Path2D=="function";function vX(n,e,t,i){gX&&!e.options.segment?pX(n,e,t,i):mX(n,e,t,i)}var hv=(()=>{class n extends fi{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,i){let r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){let o=r.spanGaps?this._loop:this._fullLoop;zL(this._points,r,t,o,i),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=QL(this,this.options.segment))}first(){let t=this.segments,i=this.points;return t.length&&i[t[0].start]}last(){let t=this.segments,i=this.points,r=t.length;return r&&i[t[r-1].end]}interpolate(t,i){let r=this.options,o=t[i],s=this.points,a=XI(this,{property:i,start:o,end:o});if(!a.length)return;let c=[],l=hX(r),u,d;for(u=0,d=a.length;u{class n extends fi{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,i,r){let o=this.options,{x:s,y:a}=this.getProps(["x","y"],r);return Math.pow(t-s,2)+Math.pow(i-a,2)n.replace("rgb(","rgba(").replace(")",", 0.5)"));function d2(n){return IS[n%IS.length]}function f2(n){return DF[n%DF.length]}function SX(n,e){return n.borderColor=d2(e),n.backgroundColor=f2(e),++e}function DX(n,e){return n.backgroundColor=n.data.map(()=>d2(e++)),e}function TX(n,e){return n.backgroundColor=n.data.map(()=>f2(e++)),e}function xX(n){let e=0;return(t,i)=>{let r=n.getDatasetMeta(i).controller;r instanceof kS?e=DX(t,e):r instanceof JF?e=TX(t,e):r&&(e=SX(t,e))}}function TF(n){let e;for(e in n)if(n[e].borderColor||n[e].backgroundColor)return!0;return!1}function AX(n){return n&&(n.borderColor||n.backgroundColor)}function MX(){return Ue.borderColor!=="rgba(0,0,0,0.1)"||Ue.backgroundColor!=="rgba(0,0,0,0.1)"}var RX={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,e,t){if(!t.enabled)return;let{data:{datasets:i},options:r}=n.config,{elements:o}=r,s=TF(i)||AX(r)||o&&TF(o)||MX();if(!t.forceOverride&&s)return;let a=xX(n);i.forEach(a)}};function kX(n,e,t,i,r){let o=r.samples||i;if(o>=t)return n.slice(e,e+t);let s=[],a=(t-2)/(o-2),c=0,l=e+t-1,u=e,d,f,h,g,y;for(s[c++]=n[u],d=0;dh&&(h=g,f=n[w],y=w);s[c++]=f,u=y}return s[c++]=n[l],s}function NX(n,e,t,i){let r=0,o=0,s,a,c,l,u,d,f,h,g,y,_=[],b=e+t-1,w=n[e].x,D=n[b].x-w;for(s=e;sy&&(y=l,f=s),r=(o*r+a.x)/++o;else{let T=s-1;if(!ue(d)&&!ue(f)){let F=Math.min(d,f),R=Math.max(d,f);F!==h&&F!==T&&_.push(G(A({},n[F]),{x:r})),R!==h&&R!==T&&_.push(G(A({},n[R]),{x:r}))}s>0&&T!==h&&_.push(n[T]),_.push(a),u=S,o=0,g=y=l,d=f=h=s}}return _}function h2(n){if(n._decimated){let e=n._data;delete n._decimated,delete n._data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,writable:!0,value:e})}}function xF(n){n.data.datasets.forEach(e=>{h2(e)})}function OX(n,e){let t=e.length,i=0,r,{iScale:o}=n,{min:s,max:a,minDefined:c,maxDefined:l}=o.getUserBounds();return c&&(i=pt(Ui(e,o.axis,s).lo,0,t-1)),l?r=pt(Ui(e,o.axis,a).hi+1,i,t)-i:r=t-i,{start:i,count:r}}var PX={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,e,t)=>{if(!t.enabled){xF(n);return}let i=n.width;n.data.datasets.forEach((r,o)=>{let{_data:s,indexAxis:a}=r,c=n.getDatasetMeta(o),l=s||r.data;if(tl([a,n.options.indexAxis])==="y"||!c.controller.supportsDecimation)return;let u=n.scales[c.xAxisID];if(u.type!=="linear"&&u.type!=="time"||n.options.parsing)return;let{start:d,count:f}=OX(c,l),h=t.threshold||4*i;if(f<=h){h2(r);return}ue(s)&&(r._data=l,delete r.data,Object.defineProperty(r,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(y){this._data=y}}));let g;switch(t.algorithm){case"lttb":g=kX(l,d,f,i,t);break;case"min-max":g=NX(l,d,f,i);break;default:throw new Error(`Unsupported decimation algorithm '${t.algorithm}'`)}r._decimated=g})},destroy(n){xF(n)}};function LX(n,e,t){let i=n.segments,r=n.points,o=e.points,s=[];for(let a of i){let{start:c,end:l}=a;l=pv(c,l,r);let u=SS(t,r[c],r[l],a.loop);if(!e.segments){s.push({source:a,target:u,start:r[c],end:r[l]});continue}let d=XI(e,u);for(let f of d){let h=SS(t,o[f.start],o[f.end],f.loop),g=ZI(a,r,h);for(let y of g)s.push({source:y,target:f,start:{[t]:AF(u,h,"start",Math.max)},end:{[t]:AF(u,h,"end",Math.min)}})}}return s}function SS(n,e,t,i){if(i)return;let r=e[n],o=t[n];return n==="angle"&&(r=xt(r),o=xt(o)),{property:n,start:r,end:o}}function FX(n,e){let{x:t=null,y:i=null}=n||{},r=e.points,o=[];return e.segments.forEach(({start:s,end:a})=>{a=pv(s,a,r);let c=r[s],l=r[a];i!==null?(o.push({x:c.x,y:i}),o.push({x:l.x,y:i})):t!==null&&(o.push({x:t,y:c.y}),o.push({x:t,y:l.y}))}),o}function pv(n,e,t){for(;e>n;e--){let i=t[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function AF(n,e,t,i){return n&&e?i(n[t],e[t]):n?n[t]:e?e[t]:0}function p2(n,e){let t=[],i=!1;return Ve(n)?(i=!0,t=n):t=FX(n,e),t.length?new hv({points:t,options:{tension:0},_loop:i,_fullLoop:i}):null}function MF(n){return n&&n.fill!==!1}function VX(n,e,t){let r=n[e].fill,o=[e],s;if(!t)return r;for(;r!==!1&&o.indexOf(r)===-1;){if(!Ze(r))return r;if(s=n[r],!s)return!1;if(s.visible)return r;o.push(r),r=s.fill}return!1}function jX(n,e,t){let i=$X(n);if(fe(i))return isNaN(i.value)?!1:i;let r=parseFloat(i);return Ze(r)&&Math.floor(r)===r?BX(i[0],e,r,t):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function BX(n,e,t,i){return(n==="-"||n==="+")&&(t=e+t),t===e||t<0||t>=i?!1:t}function UX(n,e){let t=null;return n==="start"?t=e.bottom:n==="end"?t=e.top:fe(n)?t=e.getPixelForValue(n.value):e.getBasePixel&&(t=e.getBasePixel()),t}function HX(n,e,t){let i;return n==="start"?i=t:n==="end"?i=e.options.reverse?e.min:e.max:fe(n)?i=n.value:i=e.getBaseValue(),i}function $X(n){let e=n.options,t=e.fill,i=Z(t&&t.target,t);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function zX(n){let{scale:e,index:t,line:i}=n,r=[],o=i.segments,s=i.points,a=WX(e,t);a.push(p2({x:null,y:e.bottom},i));for(let c=0;c=0;--s){let a=r[s].$filler;a&&(a.line.updateControlPoints(o,a.axis),i&&a.fill&&lS(n.ctx,a,o))}},beforeDatasetsDraw(n,e,t){if(t.drawTime!=="beforeDatasetsDraw")return;let i=n.getSortedVisibleDatasetMetas();for(let r=i.length-1;r>=0;--r){let o=i[r].$filler;MF(o)&&lS(n.ctx,o,n.chartArea)}},beforeDatasetDraw(n,e,t){let i=e.meta.$filler;!MF(i)||t.drawTime!=="beforeDatasetDraw"||lS(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}},OF=(n,e)=>{let{boxHeight:t=e,boxWidth:i=e}=n;return n.usePointStyle&&(t=Math.min(t,e),i=n.pointStyleWidth||Math.min(i,e)),{boxWidth:i,boxHeight:t,itemHeight:Math.max(e,t)}},nJ=(n,e)=>n!==null&&e!==null&&n.datasetIndex===e.datasetIndex&&n.index===e.index,fv=class extends fi{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,t,i){this.maxWidth=e,this.maxHeight=t,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){let e=this.options.labels||{},t=Oe(e.generateLabels,[this.chart],this)||[];e.filter&&(t=t.filter(i=>e.filter(i,this.chart.data))),e.sort&&(t=t.sort((i,r)=>e.sort(i,r,this.chart.data))),this.options.reverse&&t.reverse(),this.legendItems=t}fit(){let{options:e,ctx:t}=this;if(!e.display){this.width=this.height=0;return}let i=e.labels,r=ft(i.font),o=r.size,s=this._computeTitleHeight(),{boxWidth:a,itemHeight:c}=OF(i,o),l,u;t.font=r.string,this.isHorizontal()?(l=this.maxWidth,u=this._fitRows(s,o,a,c)+10):(u=this.maxHeight,l=this._fitCols(s,r,a,c)+10),this.width=Math.min(l,e.maxWidth||this.maxWidth),this.height=Math.min(u,e.maxHeight||this.maxHeight)}_fitRows(e,t,i,r){let{ctx:o,maxWidth:s,options:{labels:{padding:a}}}=this,c=this.legendHitBoxes=[],l=this.lineWidths=[0],u=r+a,d=e;o.textAlign="left",o.textBaseline="middle";let f=-1,h=-u;return this.legendItems.forEach((g,y)=>{let _=i+t/2+o.measureText(g.text).width;(y===0||l[l.length-1]+_+2*a>s)&&(d+=u,l[l.length-(y>0?0:1)]=0,h+=u,f++),c[y]={left:0,top:h,row:f,width:_,height:r},l[l.length-1]+=_+a}),d}_fitCols(e,t,i,r){let{ctx:o,maxHeight:s,options:{labels:{padding:a}}}=this,c=this.legendHitBoxes=[],l=this.columnSizes=[],u=s-e,d=a,f=0,h=0,g=0,y=0;return this.legendItems.forEach((_,b)=>{let{itemWidth:w,itemHeight:I}=iJ(i,t,o,_,r);b>0&&h+I+2*a>u&&(d+=f+a,l.push({width:f,height:h}),g+=f+a,y++,f=h=0),c[b]={left:g,top:h,col:y,width:w,height:I},f=Math.max(f,w),h+=I+a}),d+=f,l.push({width:f,height:h}),d}adjustHitBoxes(){if(!this.options.display)return;let e=this._computeTitleHeight(),{legendHitBoxes:t,options:{align:i,labels:{padding:r},rtl:o}}=this,s=zs(o,this.left,this.width);if(this.isHorizontal()){let a=0,c=At(i,this.left+r,this.right-this.lineWidths[a]);for(let l of t)a!==l.row&&(a=l.row,c=At(i,this.left+r,this.right-this.lineWidths[a])),l.top+=this.top+e+r,l.left=s.leftForLtr(s.x(c),l.width),c+=l.width+r}else{let a=0,c=At(i,this.top+e+r,this.bottom-this.columnSizes[a].height);for(let l of t)l.col!==a&&(a=l.col,c=At(i,this.top+e+r,this.bottom-this.columnSizes[a].height)),l.top=c,l.left+=this.left+r,l.left=s.leftForLtr(s.x(l.left),l.width),c+=l.height+r}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){let e=this.ctx;Od(e,this),this._draw(),Pd(e)}}_draw(){let{options:e,columnSizes:t,lineWidths:i,ctx:r}=this,{align:o,labels:s}=e,a=Ue.color,c=zs(e.rtl,this.left,this.width),l=ft(s.font),{padding:u}=s,d=l.size,f=d/2,h;this.drawTitle(),r.textAlign=c.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=l.string;let{boxWidth:g,boxHeight:y,itemHeight:_}=OF(s,d),b=function(T,F,R){if(isNaN(g)||g<=0||isNaN(y)||y<0)return;r.save();let j=Z(R.lineWidth,1);if(r.fillStyle=Z(R.fillStyle,a),r.lineCap=Z(R.lineCap,"butt"),r.lineDashOffset=Z(R.lineDashOffset,0),r.lineJoin=Z(R.lineJoin,"miter"),r.lineWidth=j,r.strokeStyle=Z(R.strokeStyle,a),r.setLineDash(Z(R.lineDash,[])),s.usePointStyle){let te={radius:y*Math.SQRT2/2,pointStyle:R.pointStyle,rotation:R.rotation,borderWidth:j},ne=c.xPlus(T,g/2),he=F+f;UI(r,te,ne,he,s.pointStyleWidth&&g)}else{let te=F+Math.max((d-y)/2,0),ne=c.leftForLtr(T,g),he=So(R.borderRadius);r.beginPath(),Object.values(he).some(Et=>Et!==0)?el(r,{x:ne,y:te,w:g,h:y,radius:he}):r.rect(ne,te,g,y),r.fill(),j!==0&&r.stroke()}r.restore()},w=function(T,F,R){Io(r,R.text,T,F+_/2,l,{strikethrough:R.hidden,textAlign:c.textAlign(R.textAlign)})},I=this.isHorizontal(),D=this._computeTitleHeight();I?h={x:At(o,this.left+u,this.right-i[0]),y:this.top+u+D,line:0}:h={x:this.left+u,y:At(o,this.top+D+u,this.bottom-t[0].height),line:0},KI(this.ctx,e.textDirection);let S=_+u;this.legendItems.forEach((T,F)=>{r.strokeStyle=T.fontColor,r.fillStyle=T.fontColor;let R=r.measureText(T.text).width,j=c.textAlign(T.textAlign||(T.textAlign=s.textAlign)),te=g+f+R,ne=h.x,he=h.y;c.setWidth(this.width),I?F>0&&ne+te+u>this.right&&(he=h.y+=S,h.line++,ne=h.x=At(o,this.left+u,this.right-i[h.line])):F>0&&he+S>this.bottom&&(ne=h.x=ne+t[h.line].width+u,h.line++,he=h.y=At(o,this.top+D+u,this.bottom-t[h.line].height));let Et=c.x(ne);if(b(Et,he,T),ne=OL(j,ne+g+f,I?ne+te:this.right,e.rtl),w(c.x(ne),he,T),I)h.x+=te+u;else if(typeof T.text!="string"){let pn=l.lineHeight;h.y+=m2(T,pn)+u}else h.y+=S}),QI(this.ctx,e.textDirection)}drawTitle(){let e=this.options,t=e.title,i=ft(t.font),r=Mt(t.padding);if(!t.display)return;let o=zs(e.rtl,this.left,this.width),s=this.ctx,a=t.position,c=i.size/2,l=r.top+c,u,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+l,d=At(e.align,d,this.right-f);else{let g=this.columnSizes.reduce((y,_)=>Math.max(y,_.height),0);u=l+At(e.align,this.top,this.bottom-g-e.labels.padding-this._computeTitleHeight())}let h=At(a,d,d+f);s.textAlign=o.textAlign(Wg(a)),s.textBaseline="middle",s.strokeStyle=t.color,s.fillStyle=t.color,s.font=i.string,Io(s,t.text,h,u,i)}_computeTitleHeight(){let e=this.options.title,t=ft(e.font),i=Mt(e.padding);return e.display?t.lineHeight+i.height:0}_getLegendItemAt(e,t){let i,r,o;if(zi(e,this.left,this.right)&&zi(t,this.top,this.bottom)){for(o=this.legendHitBoxes,i=0;io.length>s.length?o:s)),e+t.size/2+i.measureText(r).width}function oJ(n,e,t){let i=n;return typeof e.text!="string"&&(i=m2(e,t)),i}function m2(n,e){let t=n.text?n.text.length:0;return e*t}function sJ(n,e){return!!((n==="mousemove"||n==="mouseout")&&(e.onHover||e.onLeave)||e.onClick&&(n==="click"||n==="mouseup"))}var aJ={id:"legend",_element:fv,start(n,e,t){let i=n.legend=new fv({ctx:n.ctx,options:t,chart:n});$t.configure(n,i,t),$t.addBox(n,i)},stop(n){$t.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,e,t){let i=n.legend;$t.configure(n,i,t),i.options=t},afterUpdate(n){let e=n.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(n,e){e.replay||n.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(n,e,t){let i=e.datasetIndex,r=t.chart;r.isDatasetVisible(i)?(r.hide(i),e.hidden=!0):(r.show(i),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:n=>n.chart.options.color,boxWidth:40,padding:10,generateLabels(n){let e=n.data.datasets,{labels:{usePointStyle:t,pointStyle:i,textAlign:r,color:o,useBorderRadius:s,borderRadius:a}}=n.legend.options;return n._getSortedDatasetMetas().map(c=>{let l=c.controller.getStyle(t?0:void 0),u=Mt(l.borderWidth);return{text:e[c.index].label,fillStyle:l.backgroundColor,fontColor:o,hidden:!c.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:l.borderColor,pointStyle:i||l.pointStyle,rotation:l.rotation,textAlign:r||l.textAlign,borderRadius:s&&(a||l.borderRadius),datasetIndex:c.index}},this)}},title:{color:n=>n.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:n=>!n.startsWith("on"),labels:{_scriptable:n=>!["generateLabels","filter","sort"].includes(n)}}},zd=class extends fi{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,t){let i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=e,this.height=this.bottom=t;let r=Ve(i.text)?i.text.length:1;this._padding=Mt(i.padding);let o=r*ft(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){let e=this.options.position;return e==="top"||e==="bottom"}_drawArgs(e){let{top:t,left:i,bottom:r,right:o,options:s}=this,a=s.align,c=0,l,u,d;return this.isHorizontal()?(u=At(a,i,o),d=t+e,l=o-i):(s.position==="left"?(u=i+e,d=At(a,r,t),c=ge*-.5):(u=o-e,d=At(a,t,r),c=ge*.5),l=r-t),{titleX:u,titleY:d,maxWidth:l,rotation:c}}draw(){let e=this.ctx,t=this.options;if(!t.display)return;let i=ft(t.font),o=i.lineHeight/2+this._padding.top,{titleX:s,titleY:a,maxWidth:c,rotation:l}=this._drawArgs(o);Io(e,t.text,0,0,i,{color:t.color,maxWidth:c,rotation:l,textAlign:Wg(t.align),textBaseline:"middle",translation:[s,a]})}};function cJ(n,e){let t=new zd({ctx:n.ctx,options:e,chart:n});$t.configure(n,t,e),$t.addBox(n,t),n.titleBlock=t}var lJ={id:"title",_element:zd,start(n,e,t){cJ(n,t)},stop(n){let e=n.titleBlock;$t.removeBox(n,e),delete n.titleBlock},beforeUpdate(n,e,t){let i=n.titleBlock;$t.configure(n,i,t),i.options=t},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}},nv=new WeakMap,uJ={id:"subtitle",start(n,e,t){let i=new zd({ctx:n.ctx,options:t,chart:n});$t.configure(n,i,t),$t.addBox(n,i),nv.set(n,i)},stop(n){$t.removeBox(n,nv.get(n)),nv.delete(n)},beforeUpdate(n,e,t){let i=nv.get(n);$t.configure(n,i,t),i.options=t},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}},Hd={average(n){if(!n.length)return!1;let e,t,i=new Set,r=0,o=0;for(e=0,t=n.length;ea+c)/i.size,y:r/o}},nearest(n,e){if(!n.length)return!1;let t=e.x,i=e.y,r=Number.POSITIVE_INFINITY,o,s,a;for(o=0,s=n.length;o-1?n.split(` `):n}function dJ(n,e){let{element:t,datasetIndex:i,index:r}=e,o=n.getDatasetMeta(i).controller,{label:s,value:a}=o.getLabelAndValue(r);return{chart:n,label:s,parsed:o.getParsed(r),raw:n.data.datasets[i].data[r],formattedValue:a,dataset:o.getDataset(),dataIndex:r,datasetIndex:i,element:t}}function PF(n,e){let t=n.chart.ctx,{body:i,footer:r,title:o}=n,{boxWidth:s,boxHeight:a}=e,c=ft(e.bodyFont),l=ft(e.titleFont),u=ft(e.footerFont),d=o.length,f=r.length,h=i.length,g=Mt(e.padding),y=g.height,_=0,b=i.reduce((D,S)=>D+S.before.length+S.lines.length+S.after.length,0);if(b+=n.beforeBody.length+n.afterBody.length,d&&(y+=d*l.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),b){let D=e.displayColors?Math.max(a,c.lineHeight):c.lineHeight;y+=h*D+(b-h)*c.lineHeight+(b-1)*e.bodySpacing}f&&(y+=e.footerMarginTop+f*u.lineHeight+(f-1)*e.footerSpacing);let w=0,I=function(D){_=Math.max(_,t.measureText(D).width+w)};return t.save(),t.font=l.string,xe(n.title,I),t.font=c.string,xe(n.beforeBody.concat(n.afterBody),I),w=e.displayColors?s+2+e.boxPadding:0,xe(i,D=>{xe(D.before,I),xe(D.lines,I),xe(D.after,I)}),w=0,t.font=u.string,xe(n.footer,I),t.restore(),_+=g.width,{width:_,height:y}}function fJ(n,e){let{y:t,height:i}=e;return tn.height-i/2?"bottom":"center"}function hJ(n,e,t,i){let{x:r,width:o}=i,s=t.caretSize+t.caretPadding;if(n==="left"&&r+o+s>e.width||n==="right"&&r-o-s<0)return!0}function pJ(n,e,t,i){let{x:r,width:o}=t,{width:s,chartArea:{left:a,right:c}}=n,l="center";return i==="center"?l=r<=(a+c)/2?"left":"right":r<=o/2?l="left":r>=s-o/2&&(l="right"),hJ(l,n,e,t)&&(l="center"),l}function LF(n,e,t){let i=t.yAlign||e.yAlign||fJ(n,t);return{xAlign:t.xAlign||e.xAlign||pJ(n,e,t,i),yAlign:i}}function mJ(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function gJ(n,e,t){let{y:i,height:r}=n;return e==="top"?i+=t:e==="bottom"?i-=r+t:i-=r/2,i}function FF(n,e,t,i){let{caretSize:r,caretPadding:o,cornerRadius:s}=n,{xAlign:a,yAlign:c}=t,l=r+o,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:h}=So(s),g=mJ(e,a),y=gJ(e,c,l);return c==="center"?a==="left"?g+=l:a==="right"&&(g-=l):a==="left"?g-=Math.max(u,f)+r:a==="right"&&(g+=Math.max(d,h)+r),{x:pt(g,0,i.width-e.width),y:pt(y,0,i.height-e.height)}}function iv(n,e,t){let i=Mt(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function VF(n){return Wi([],Dr(n))}function vJ(n,e,t){return Ir(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function jF(n,e){let t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}var g2={beforeTitle:$i,title(n){if(n.length>0){let e=n[0],t=e.chart.data.labels,i=t?t.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndex"u"?g2[e].call(t,i):r}var BF=(()=>{class n extends fi{static positioners=Hd;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){let t=this._cachedAnimations;if(t)return t;let i=this.chart,r=this.options.setContext(this.getContext()),o=r.enabled&&i.options.animation&&r.animations,s=new av(this.chart,o);return o._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=vJ(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,i){let{callbacks:r}=i,o=fn(r,"beforeTitle",this,t),s=fn(r,"title",this,t),a=fn(r,"afterTitle",this,t),c=[];return c=Wi(c,Dr(o)),c=Wi(c,Dr(s)),c=Wi(c,Dr(a)),c}getBeforeBody(t,i){return VF(fn(i.callbacks,"beforeBody",this,t))}getBody(t,i){let{callbacks:r}=i,o=[];return xe(t,s=>{let a={before:[],lines:[],after:[]},c=jF(r,s);Wi(a.before,Dr(fn(c,"beforeLabel",this,s))),Wi(a.lines,fn(c,"label",this,s)),Wi(a.after,Dr(fn(c,"afterLabel",this,s))),o.push(a)}),o}getAfterBody(t,i){return VF(fn(i.callbacks,"afterBody",this,t))}getFooter(t,i){let{callbacks:r}=i,o=fn(r,"beforeFooter",this,t),s=fn(r,"footer",this,t),a=fn(r,"afterFooter",this,t),c=[];return c=Wi(c,Dr(o)),c=Wi(c,Dr(s)),c=Wi(c,Dr(a)),c}_createItems(t){let i=this._active,r=this.chart.data,o=[],s=[],a=[],c=[],l,u;for(l=0,u=i.length;lt.filter(d,f,h,r))),t.itemSort&&(c=c.sort((d,f)=>t.itemSort(d,f,r))),xe(c,d=>{let f=jF(t.callbacks,d);o.push(fn(f,"labelColor",this,d)),s.push(fn(f,"labelPointStyle",this,d)),a.push(fn(f,"labelTextColor",this,d))}),this.labelColors=o,this.labelPointStyles=s,this.labelTextColors=a,this.dataPoints=c,c}update(t,i){let r=this.options.setContext(this.getContext()),o=this._active,s,a=[];if(!o.length)this.opacity!==0&&(s={opacity:0});else{let c=Hd[r.position].call(this,o,this._eventPosition);a=this._createItems(r),this.title=this.getTitle(a,r),this.beforeBody=this.getBeforeBody(a,r),this.body=this.getBody(a,r),this.afterBody=this.getAfterBody(a,r),this.footer=this.getFooter(a,r);let l=this._size=PF(this,r),u=Object.assign({},c,l),d=LF(this.chart,r,u),f=FF(r,u,d,this.chart);this.xAlign=d.xAlign,this.yAlign=d.yAlign,s={opacity:1,x:f.x,y:f.y,width:l.width,height:l.height,caretX:c.x,caretY:c.y}}this._tooltipItems=a,this.$context=void 0,s&&this._resolveAnimations().update(this,s),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:i})}drawCaret(t,i,r,o){let s=this.getCaretPosition(t,r,o);i.lineTo(s.x1,s.y1),i.lineTo(s.x2,s.y2),i.lineTo(s.x3,s.y3)}getCaretPosition(t,i,r){let{xAlign:o,yAlign:s}=this,{caretSize:a,cornerRadius:c}=r,{topLeft:l,topRight:u,bottomLeft:d,bottomRight:f}=So(c),{x:h,y:g}=t,{width:y,height:_}=i,b,w,I,D,S,T;return s==="center"?(S=g+_/2,o==="left"?(b=h,w=b-a,D=S+a,T=S-a):(b=h+y,w=b+a,D=S-a,T=S+a),I=b):(o==="left"?w=h+Math.max(l,d)+a:o==="right"?w=h+y-Math.max(u,f)-a:w=this.caretX,s==="top"?(D=g,S=D-a,b=w-a,I=w+a):(D=g+_,S=D+a,b=w+a,I=w-a),T=D),{x1:b,x2:w,x3:I,y1:D,y2:S,y3:T}}drawTitle(t,i,r){let o=this.title,s=o.length,a,c,l;if(s){let u=zs(r.rtl,this.x,this.width);for(t.x=iv(this,r.titleAlign,r),i.textAlign=u.textAlign(r.titleAlign),i.textBaseline="middle",a=ft(r.titleFont),c=r.titleSpacing,i.fillStyle=r.titleColor,i.font=a.string,l=0;lI!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,el(t,{x:_,y,w:u,h:l,radius:w}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),el(t,{x:b,y:y+1,w:u-2,h:l-2,radius:w}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(_,y,u,l),t.strokeRect(_,y,u,l),t.fillStyle=a.backgroundColor,t.fillRect(b,y+1,u-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,i,r){let{body:o}=this,{bodySpacing:s,bodyAlign:a,displayColors:c,boxHeight:l,boxWidth:u,boxPadding:d}=r,f=ft(r.bodyFont),h=f.lineHeight,g=0,y=zs(r.rtl,this.x,this.width),_=function(j){i.fillText(j,y.x(t.x+g),t.y+h/2),t.y+=h+s},b=y.textAlign(a),w,I,D,S,T,F,R;for(i.textAlign=a,i.textBaseline="middle",i.font=f.string,t.x=iv(this,b,r),i.fillStyle=r.bodyColor,xe(this.beforeBody,_),g=c&&b!=="right"?a==="center"?u/2+d:u+2+d:0,S=0,F=o.length;S0&&i.stroke()}_updateAnimationTarget(t){let i=this.chart,r=this.$animations,o=r&&r.x,s=r&&r.y;if(o||s){let a=Hd[t.position].call(this,this._active,this._eventPosition);if(!a)return;let c=this._size=PF(this,t),l=Object.assign({},a,this._size),u=LF(i,t,l),d=FF(t,l,u,i);(o._to!==d.x||s._to!==d.y)&&(this.xAlign=u.xAlign,this.yAlign=u.yAlign,this.width=c.width,this.height=c.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,d))}}_willRender(){return!!this.opacity}draw(t){let i=this.options.setContext(this.getContext()),r=this.opacity;if(!r)return;this._updateAnimationTarget(i);let o={width:this.width,height:this.height},s={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;let a=Mt(i.padding),c=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;i.enabled&&c&&(t.save(),t.globalAlpha=r,this.drawBackground(s,t,o,i),KI(t,i.textDirection),s.y+=a.top,this.drawTitle(s,t,i),this.drawBody(s,t,i),this.drawFooter(s,t,i),QI(t,i.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,i){let r=this._active,o=t.map(({datasetIndex:c,index:l})=>{let u=this.chart.getDatasetMeta(c);if(!u)throw new Error("Cannot find a dataset at index "+c);return{datasetIndex:c,element:u.data[l],index:l}}),s=!kd(r,o),a=this._positionChanged(o,i);(s||a)&&(this._active=o,this._eventPosition=i,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,i,r=!0){if(i&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let o=this.options,s=this._active||[],a=this._getActiveElements(t,s,i,r),c=this._positionChanged(a,t),l=i||!kd(a,s)||c;return l&&(this._active=a,(o.enabled||o.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,i))),l}_getActiveElements(t,i,r,o){let s=this.options;if(t.type==="mouseout")return[];if(!o)return i.filter(c=>this.chart.data.datasets[c.datasetIndex]&&this.chart.getDatasetMeta(c.datasetIndex).controller.getParsed(c.index)!==void 0);let a=this.chart.getElementsAtEventForMode(t,s.mode,s,r);return s.reverse&&a.reverse(),a}_positionChanged(t,i){let{caretX:r,caretY:o,options:s}=this,a=Hd[s.position].call(this,t,i);return a!==!1&&(r!==a.x||o!==a.y)}}return n})(),yJ={id:"tooltip",_element:BF,positioners:Hd,afterInit(n,e,t){t&&(n.tooltip=new BF({chart:n,options:t}))},beforeUpdate(n,e,t){n.tooltip&&n.tooltip.initialize(t)},reset(n,e,t){n.tooltip&&n.tooltip.initialize(t)},afterDraw(n){let e=n.tooltip;if(e&&e._willRender()){let t={tooltip:e};if(n.notifyPlugins("beforeTooltipDraw",G(A({},t),{cancelable:!0}))===!1)return;e.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",t)}},afterEvent(n,e){if(n.tooltip){let t=e.replay;n.tooltip.handleEvent(e.event,t,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,e)=>e.bodyFont.size,boxWidth:(n,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:g2},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},_J=Object.freeze({__proto__:null,Colors:RX,Decimation:PX,Filler:tJ,Legend:aJ,SubTitle:uJ,Title:lJ,Tooltip:yJ}),bJ=(n,e,t,i)=>(typeof e=="string"?(t=n.push(e)-1,i.unshift({index:t,label:e})):isNaN(e)&&(t=null),t);function EJ(n,e,t,i){let r=n.indexOf(e);if(r===-1)return bJ(n,e,t,i);let o=n.lastIndexOf(e);return r!==o?t:r}var wJ=(n,e)=>n===null?null:pt(Math.round(n),0,e);function UF(n){let e=this.getLabels();return n>=0&&n{class n extends Gs{static id="category";static defaults={ticks:{callback:UF}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){let i=this._addedLabels;if(i.length){let r=this.getLabels();for(let{index:o,label:s}of i)r[o]===s&&r.splice(o,1);this._addedLabels=[]}super.init(t)}parse(t,i){if(ue(t))return null;let r=this.getLabels();return i=isFinite(i)&&r[i]===t?i:EJ(r,t,Z(i,t),this._addedLabels),wJ(i,r.length-1)}determineDataLimits(){let{minDefined:t,maxDefined:i}=this.getUserBounds(),{min:r,max:o}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),i||(o=this.getLabels().length-1)),this.min=r,this.max=o}buildTicks(){let t=this.min,i=this.max,r=this.options.offset,o=[],s=this.getLabels();s=t===0&&i===s.length-1?s:s.slice(t,i+1),this._valueRange=Math.max(s.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let a=t;a<=i;a++)o.push({value:a});return o}getLabelForValue(t){return UF.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){let i=this.ticks;return t<0||t>i.length-1?null:this.getPixelForValue(i[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}return n})();function IJ(n,e){let t=[],{bounds:r,step:o,min:s,max:a,precision:c,count:l,maxTicks:u,maxDigits:d,includeBounds:f}=n,h=o||1,g=u-1,{min:y,max:_}=e,b=!ue(s),w=!ue(a),I=!ue(l),D=(_-y)/(d+1),S=xI((_-y)/g/h)*h,T,F,R,j;if(S<1e-14&&!b&&!w)return[{value:y},{value:_}];j=Math.ceil(_/S)-Math.floor(y/S),j>g&&(S=xI(j*S/g/h)*h),ue(c)||(T=Math.pow(10,c),S=Math.ceil(S*T)/T),r==="ticks"?(F=Math.floor(y/S)*S,R=Math.ceil(_/S)*S):(F=y,R=_),b&&w&&o&&TL((a-s)/o,S/1e3)?(j=Math.round(Math.min((a-s)/S,u)),S=(a-s)/j,F=s,R=a):I?(F=b?s:F,R=w?a:R,j=l-1,S=(R-F)/j):(j=(R-F)/S,Zc(j,Math.round(j),S/1e3)?j=Math.round(j):j=Math.ceil(j));let te=Math.max(MI(S),MI(F));T=Math.pow(10,ue(c)?te:c),F=Math.round(F*T)/T,R=Math.round(R*T)/T;let ne=0;for(b&&(f&&F!==s?(t.push({value:s}),Fa)break;t.push({value:he})}return w&&f&&R!==a?t.length&&Zc(t[t.length-1].value,a,HF(a,D,n))?t[t.length-1].value=a:t.push({value:a}):(!w||R===a)&&t.push({value:R}),t}function HF(n,e,{horizontal:t,minRotation:i}){let r=$n(i),o=(t?Math.sin(r):Math.cos(r))||.001,s=.75*e*(""+n).length;return Math.min(e/o,s)}var rl=class extends Gs{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return ue(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){let{beginAtZero:e}=this.options,{minDefined:t,maxDefined:i}=this.getUserBounds(),{min:r,max:o}=this,s=c=>r=t?r:c,a=c=>o=i?o:c;if(e){let c=di(r),l=di(o);c<0&&l<0?a(0):c>0&&l>0&&s(0)}if(r===o){let c=o===0?1:Math.abs(o*.05);a(o+c),e||s(r-c)}this.min=r,this.max=o}getTickLimit(){let e=this.options.ticks,{maxTicksLimit:t,stepSize:i}=e,r;return i?(r=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,r>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${r} ticks. Limiting to 1000.`),r=1e3)):(r=this.computeTickLimit(),t=t||11),t&&(r=Math.min(t,r)),r}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){let e=this.options,t=e.ticks,i=this.getTickLimit();i=Math.max(2,i);let r={maxTicks:i,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},o=this._range||this,s=IJ(r,o);return e.bounds==="ticks"&&AI(s,this,"value"),e.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){let e=this.ticks,t=this.min,i=this.max;if(super.configure(),this.options.offset&&e.length){let r=(i-t)/Math.max(e.length-1,1)/2;t-=r,i+=r}this._startValue=t,this._endValue=i,this._valueRange=i-t}getLabelForValue(e){return Jc(e,this.chart.options.locale,this.options.ticks.format)}},DS=class extends rl{static id="linear";static defaults={ticks:{callback:Nd.formatters.numeric}};determineDataLimits(){let{min:e,max:t}=this.getMinMax(!0);this.min=Ze(e)?e:0,this.max=Ze(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){let e=this.isHorizontal(),t=e?this.width:this.height,i=$n(this.options.ticks.minRotation),r=(e?Math.sin(i):Math.cos(i))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,o.lineHeight/r))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}},Wd=n=>Math.floor(wr(n)),qs=(n,e)=>Math.pow(10,Wd(n)+e);function $F(n){return n/Math.pow(10,Wd(n))===1}function zF(n,e,t){let i=Math.pow(10,t),r=Math.floor(n/i);return Math.ceil(e/i)-r}function SJ(n,e){let t=e-n,i=Wd(t);for(;zF(n,e,i)>10;)i++;for(;zF(n,e,i)<10;)i--;return Math.min(i,Wd(n))}function DJ(n,{min:e,max:t}){e=dn(n.min,e);let i=[],r=Wd(e),o=SJ(e,t),s=o<0?Math.pow(10,Math.abs(o)):1,a=Math.pow(10,o),c=r>o?Math.pow(10,r):0,l=Math.round((e-c)*s)/s,u=Math.floor((e-c)/a/10)*a*10,d=Math.floor((l-u)/Math.pow(10,o)),f=dn(n.min,Math.round((c+u+d*Math.pow(10,o))*s)/s);for(;f=10?d=d<15?15:20:d++,d>=20&&(o++,d=2,s=o>=0?1:s),f=Math.round((c+u+d*Math.pow(10,o))*s)/s;let h=dn(n.max,f);return i.push({value:h,major:$F(h),significand:d}),i}var TS=class extends Gs{static id="logarithmic";static defaults={ticks:{callback:Nd.formatters.logarithmic,major:{enabled:!0}}};constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){let i=rl.prototype.parse.apply(this,[e,t]);if(i===0){this._zero=!0;return}return Ze(i)&&i>0?i:null}determineDataLimits(){let{min:e,max:t}=this.getMinMax(!0);this.min=Ze(e)?Math.max(0,e):null,this.max=Ze(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Ze(this._userMin)&&(this.min=e===qs(this.min,0)?qs(this.min,-1):qs(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:e,maxDefined:t}=this.getUserBounds(),i=this.min,r=this.max,o=a=>i=e?i:a,s=a=>r=t?r:a;i===r&&(i<=0?(o(1),s(10)):(o(qs(i,-1)),s(qs(r,1)))),i<=0&&o(qs(r,-1)),r<=0&&s(qs(i,1)),this.min=i,this.max=r}buildTicks(){let e=this.options,t={min:this._userMin,max:this._userMax},i=DJ(t,this);return e.bounds==="ticks"&&AI(i,this,"value"),e.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(e){return e===void 0?"0":Jc(e,this.chart.options.locale,this.options.ticks.format)}configure(){let e=this.min;super.configure(),this._startValue=wr(e),this._valueRange=wr(this.max)-wr(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(wr(e)-this._startValue)/this._valueRange)}getValueForPixel(e){let t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}};function xS(n){let e=n.ticks;if(e.display&&n.display){let t=Mt(e.backdropPadding);return Z(e.font&&e.font.size,Ue.font.size)+t.height}return 0}function TJ(n,e,t){return t=Ve(t)?t:[t],{w:LL(n,e.string,t),h:t.length*e.lineHeight}}function WF(n,e,t,i,r){return n===i||n===r?{start:e-t/2,end:e+t/2}:nr?{start:e-t,end:e}:{start:e,end:e+t}}function xJ(n){let e={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},t=Object.assign({},e),i=[],r=[],o=n._pointLabels.length,s=n.options.pointLabels,a=s.centerPointLabels?ge/o:0;for(let c=0;ce.r&&(a=(i.end-e.r)/o,n.r=Math.max(n.r,e.r+a)),r.starte.b&&(c=(r.end-e.b)/s,n.b=Math.max(n.b,e.b+c))}function MJ(n,e,t){let i=n.drawingArea,{extra:r,additionalAngle:o,padding:s,size:a}=t,c=n.getPointPosition(e,i+r+s,o),l=Math.round($g(xt(c.angle+tt))),u=PJ(c.y,a.h,l),d=NJ(l),f=OJ(c.x,a.w,d);return{visible:!0,x:c.x,y:u,textAlign:d,left:f,top:u,right:f+a.w,bottom:u+a.h}}function RJ(n,e){if(!e)return!0;let{left:t,top:i,right:r,bottom:o}=n;return!(Hi({x:t,y:i},e)||Hi({x:t,y:o},e)||Hi({x:r,y:i},e)||Hi({x:r,y:o},e))}function kJ(n,e,t){let i=[],r=n._pointLabels.length,o=n.options,{centerPointLabels:s,display:a}=o.pointLabels,c={extra:xS(o)/2,additionalAngle:s?ge/r:0},l;for(let u=0;u270||t<90)&&(n-=e),n}function LJ(n,e,t){let{left:i,top:r,right:o,bottom:s}=t,{backdropColor:a}=e;if(!ue(a)){let c=So(e.borderRadius),l=Mt(e.backdropPadding);n.fillStyle=a;let u=i-l.left,d=r-l.top,f=o-i+l.width,h=s-r+l.height;Object.values(c).some(g=>g!==0)?(n.beginPath(),el(n,{x:u,y:d,w:f,h,radius:c}),n.fill()):n.fillRect(u,d,f,h)}}function FJ(n,e){let{ctx:t,options:{pointLabels:i}}=n;for(let r=e-1;r>=0;r--){let o=n._pointLabelItems[r];if(!o.visible)continue;let s=i.setContext(n.getPointLabelContext(r));LJ(t,s,o);let a=ft(s.font),{x:c,y:l,textAlign:u}=o;Io(t,n._pointLabels[r],c,l+a.lineHeight/2,a,{color:s.color,textAlign:u,textBaseline:"middle"})}}function v2(n,e,t,i){let{ctx:r}=n;if(t)r.arc(n.xCenter,n.yCenter,e,0,je);else{let o=n.getPointPosition(0,e);r.moveTo(o.x,o.y);for(let s=1;s{let r=Oe(this.options.pointLabels.callback,[t,i],this);return r||r===0?r:""}).filter((t,i)=>this.chart.getDataVisibility(i))}fit(){let e=this.options;e.display&&e.pointLabels.display?xJ(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,i,r){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((i-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,i,r))}getIndexAngle(e){let t=je/(this._pointLabels.length||1),i=this.options.startAngle||0;return xt(e*t+$n(i))}getDistanceFromCenterForValue(e){if(ue(e))return NaN;let t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(ue(e))return NaN;let t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){let t=this._pointLabels||[];if(e>=0&&e{if(d!==0||d===0&&this.min<0){c=this.getDistanceFromCenterForValue(u.value);let f=this.getContext(d),h=r.setContext(f),g=o.setContext(f);VJ(this,h,c,s,g)}}),i.display){for(e.save(),a=s-1;a>=0;a--){let u=i.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:f}=u;!f||!d||(e.lineWidth=f,e.strokeStyle=d,e.setLineDash(u.borderDash),e.lineDashOffset=u.borderDashOffset,c=this.getDistanceFromCenterForValue(t.reverse?this.min:this.max),l=this.getPointPosition(a,c),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(l.x,l.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){let e=this.ctx,t=this.options,i=t.ticks;if(!i.display)return;let r=this.getIndexAngle(0),o,s;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(r),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((a,c)=>{if(c===0&&this.min>=0&&!t.reverse)return;let l=i.setContext(this.getContext(c)),u=ft(l.font);if(o=this.getDistanceFromCenterForValue(this.ticks[c].value),l.showLabelBackdrop){e.font=u.string,s=e.measureText(a.label).width,e.fillStyle=l.backdropColor;let d=Mt(l.backdropPadding);e.fillRect(-s/2-d.left,-o-u.size/2-d.top,s+d.width,u.size+d.height)}Io(e,a.label,0,-o,u,{color:l.color,strokeColor:l.textStrokeColor,strokeWidth:l.textStrokeWidth})}),e.restore()}drawTitle(){}},mv={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},hn=Object.keys(mv);function qF(n,e){return n-e}function GF(n,e){if(ue(e))return null;let t=n._adapter,{parser:i,round:r,isoWeekday:o}=n._parseOpts,s=e;return typeof i=="function"&&(s=i(s)),Ze(s)||(s=typeof i=="string"?t.parse(s,i):t.parse(s)),s===null?null:(r&&(s=r==="week"&&($s(o)||o===!0)?t.startOf(s,"isoWeek",o):t.startOf(s,r)),+s)}function YF(n,e,t,i){let r=hn.length;for(let o=hn.indexOf(n);o=hn.indexOf(t);o--){let s=hn[o];if(mv[s].common&&n._adapter.diff(r,i,s)>=e-1)return s}return hn[t?hn.indexOf(t):0]}function UJ(n){for(let e=hn.indexOf(n)+1,t=hn.length;e=e?t[i]:t[r];n[o]=!0}}function HJ(n,e,t,i){let r=n._adapter,o=+r.startOf(e[0].value,i),s=e[e.length-1].value,a,c;for(a=o;a<=s;a=+r.add(a,1,i))c=t[a],c>=0&&(e[c].major=!0);return e}function QF(n,e,t){let i=[],r={},o=e.length,s,a;for(s=0;s{class n extends Gs{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,i={}){let r=t.time||(t.time={}),o=this._adapter=new JQ._date(t.adapters.date);o.init(i),Kc(r.displayFormats,o.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(t),this._normalized=i.normalized}parse(t,i){return t===void 0?null:GF(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){let t=this.options,i=this._adapter,r=t.time.unit||"day",{min:o,max:s,minDefined:a,maxDefined:c}=this.getUserBounds();function l(u){!a&&!isNaN(u.min)&&(o=Math.min(o,u.min)),!c&&!isNaN(u.max)&&(s=Math.max(s,u.max))}(!a||!c)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),o=Ze(o)&&!isNaN(o)?o:+i.startOf(Date.now(),r),s=Ze(s)&&!isNaN(s)?s:+i.endOf(Date.now(),r)+1,this.min=Math.min(o,s-1),this.max=Math.max(o+1,s)}_getLabelBounds(){let t=this.getLabelTimestamps(),i=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(i=t[0],r=t[t.length-1]),{min:i,max:r}}buildTicks(){let t=this.options,i=t.time,r=t.ticks,o=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&o.length&&(this.min=this._userMin||o[0],this.max=this._userMax||o[o.length-1]);let s=this.min,a=this.max,c=ML(o,s,a);return this._unit=i.unit||(r.autoSkip?YF(i.minUnit,this.min,this.max,this._getLabelCapacity(s)):BJ(this,c.length,i.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:UJ(this._unit),this.initOffsets(o),t.reverse&&c.reverse(),QF(this,c,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let i=0,r=0,o,s;this.options.offset&&t.length&&(o=this.getDecimalForValue(t[0]),t.length===1?i=1-o:i=(this.getDecimalForValue(t[1])-o)/2,s=this.getDecimalForValue(t[t.length-1]),t.length===1?r=s:r=(s-this.getDecimalForValue(t[t.length-2]))/2);let a=t.length<3?.5:.25;i=pt(i,0,a),r=pt(r,0,a),this._offsets={start:i,end:r,factor:1/(i+1+r)}}_generate(){let t=this._adapter,i=this.min,r=this.max,o=this.options,s=o.time,a=s.unit||YF(s.minUnit,i,r,this._getLabelCapacity(i)),c=Z(o.ticks.stepSize,1),l=a==="week"?s.isoWeekday:!1,u=$s(l)||l===!0,d={},f=i,h,g;if(u&&(f=+t.startOf(f,"isoWeek",l)),f=+t.startOf(f,u?"day":a),t.diff(r,i,a)>1e5*c)throw new Error(i+" and "+r+" are too far apart with stepSize of "+c+" "+a);let y=o.ticks.source==="data"&&this.getDataTimestamps();for(h=f,g=0;h+_)}getLabelForValue(t){let i=this._adapter,r=this.options.time;return r.tooltipFormat?i.format(t,r.tooltipFormat):i.format(t,r.displayFormats.datetime)}format(t,i){let o=this.options.time.displayFormats,s=this._unit,a=i||o[s];return this._adapter.format(t,a)}_tickFormatFunction(t,i,r,o){let s=this.options,a=s.ticks.callback;if(a)return Oe(a,[t,i,r],this);let c=s.time.displayFormats,l=this._unit,u=this._majorUnit,d=l&&c[l],f=u&&c[u],h=r[i],g=u&&f&&h&&h.major;return this._adapter.format(t,o||(g?f:d))}generateTickLabels(t){let i,r,o;for(i=0,r=t.length;i0?c:1}getDataTimestamps(){let t=this._cache.data||[],i,r;if(t.length)return t;let o=this.getMatchingVisibleMetas();if(this._normalized&&o.length)return this._cache.data=o[0].controller.getAllParsedValues(this);for(i=0,r=o.length;i=n[i].pos&&e<=n[r].pos&&({lo:i,hi:r}=Ui(n,"pos",e)),{pos:o,time:a}=n[i],{pos:s,time:c}=n[r]):(e>=n[i].time&&e<=n[r].time&&({lo:i,hi:r}=Ui(n,"time",e)),{time:o,pos:a}=n[i],{time:s,pos:c}=n[r]);let l=s-o;return l?a+(c-a)*(e-o)/l:a}var RS=class extends MS{static id="timeseries";static defaults=MS.defaults;constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=rv(t,this.min),this._tableRange=rv(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){let{min:t,max:i}=this,r=[],o=[],s,a,c,l,u;for(s=0,a=e.length;s=t&&l<=i&&r.push(l);if(r.length<2)return[{time:t,pos:0},{time:i,pos:1}];for(s=0,a=r.length;sr-o)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;let t=this.getDataTimestamps(),i=this.getLabelTimestamps();return t.length&&i.length?e=this.normalize(t.concat(i)):e=t.length?t:i,e=this._cache.all=e,e}getDecimalForValue(e){return(rv(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){let t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return rv(this._table,i*this._tableRange+this._minPos,!0)}},$J=Object.freeze({__proto__:null,CategoryScale:CJ,LinearScale:DS,LogarithmicScale:TS,RadialLinearScale:AS,TimeScale:MS,TimeSeriesScale:RS}),y2=[XQ,IX,_J,$J];Ao.register(...y2);var zJ=["visitsChart"],WJ=["contactsChart"],qJ=["statusChart"],GJ=["weekdayChart"],YJ=()=>[];function KJ(n,e){if(n&1&&(p(0,"div",23)(1,"div",24)(2,"span"),v(3,"Total"),m(),p(4,"strong"),v(5),m()(),p(6,"div",24)(7,"span"),v(8,"Total Visits"),m(),p(9,"strong"),v(10),za(11,"async"),m()(),p(12,"div",24)(13,"span"),v(14,"New"),m(),p(15,"strong"),v(16),m()(),p(17,"div",24)(18,"span"),v(19,"Reviewed"),m(),p(20,"strong"),v(21),m()()()),n&2){let t=e.ngIf,i=Ne();E(5),O(t.length),E(5),O(Wa(11,4,i.totalVisits$)??0),E(6),O(i.getStatusCount(t,"new")),E(5),O(i.getStatusCount(t,"reviewed"))}}function QJ(n,e){if(n&1&&(p(0,"div",25),v(1),m()),n&2){let t=Ne().$implicit;E(),ye("Dates: ",t.dates)}}function ZJ(n,e){if(n&1){let t=Ln();p(0,"tr")(1,"td")(2,"strong"),v(3),m(),p(4,"div",25),v(5),m()(),p(6,"td")(7,"div"),v(8),m(),B(9,QJ,2,1,"div",26),m(),p(10,"td",27),v(11),m(),p(12,"td"),v(13),m(),p(14,"td")(15,"span",28),v(16),m()(),p(17,"td")(18,"button",29),ve("click",function(){let r=ze(t).$implicit,o=Ne();return We(o.markReviewed(r))}),v(19," Mark Reviewed "),m()()()}if(n&2){let t=e.$implicit,i=Ne();Bt("d-none",i.filter!=="all"&&t.status!==i.filter),E(3),O(t.name),E(2),O(t.email),E(3),O(t.phone),E(),x("ngIf",t.dates),E(2),O(t.message),E(2),O(i.formatDate(t.createdAt)),E(2),Bt("bg-warning-subtle",t.status==="new")("text-warning",t.status==="new")("bg-success-subtle",t.status==="reviewed")("text-success",t.status==="reviewed"),E(),ye(" ",t.status??"new"," "),E(2),x("disabled",t.status==="reviewed")}}function XJ(n,e){n&1&&(p(0,"div",30),v(1," No messages yet. New inquiries will appear here. "),m())}var gv=class n{contactService=C($c);authService=C(go);router=C(_t);seo=C(Te);analytics=C(zc);sessionService=C(vo);destroy$=new Ge;visitsChart;contactsChart;statusChart;weekdayChart;visitsChartInstance;contactsChartInstance;statusChartInstance;weekdayChartInstance;messages$=this.contactService.getMessages();totalVisits$=this.analytics.getTotalVisits();dailyVisits$=this.analytics.getDailyVisits();filter="all";constructor(){this.seo.update({title:"Admin Dashboard | Himalayan Eco Inn",description:"Manage guest inquiries from Himalayan Eco Inn website.",robots:"noindex, nofollow"})}setFilter(e){this.filter=e}async markReviewed(e){e.id&&await this.contactService.markReviewed(e.id)}getStatusCount(e,t){return e.filter(i=>i.status===t).length}ngAfterViewInit(){this.startSessionWatcher(),this.attachActivityListeners(),this.initCharts()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),this.visitsChartInstance?.destroy(),this.contactsChartInstance?.destroy(),this.statusChartInstance?.destroy(),this.weekdayChartInstance?.destroy()}formatDate(e){if(!e)return"\u2014";if(typeof e=="number")return new Date(e).toLocaleString();let t=e.toDate?.();return t?t.toLocaleString():e instanceof Date?e.toLocaleString():String(e)}async logout(){this.sessionService.clear(),await this.authService.logout(),await this.router.navigate(["/admin/login"])}startSessionWatcher(){Xv(1e4).pipe(Qi(this.destroy$)).subscribe(async()=>{this.sessionService.isExpired()&&await this.logout()})}attachActivityListeners(){pl(Yi(document,"click"),Yi(document,"keydown"),Yi(document,"mousemove"),Yi(document,"scroll"),Yi(document,"touchstart")).pipe(ry(1e3),Qi(this.destroy$)).subscribe(()=>this.sessionService.touch())}initCharts(){ma([this.dailyVisits$,this.messages$]).pipe(Qi(this.destroy$)).subscribe(([e,t])=>{let i=this.lastSevenDays(),r=i.map(l=>e[l]??0),o=i.map(l=>t.filter(u=>this.toDateKey(u.createdAt)===l).length),s=this.getStatusCount(t,"new"),a=this.getStatusCount(t,"reviewed"),c=this.weekdayBuckets(t);this.updateVisitsChart(i,r),this.updateContactsChart(i,o),this.updateStatusChart([s,a]),this.updateWeekdayChart(c)})}updateVisitsChart(e,t){if(this.visitsChart?.nativeElement){if(!this.visitsChartInstance){this.visitsChartInstance=new Ao(this.visitsChart.nativeElement,{type:"line",data:{labels:e,datasets:[{label:"Website visits",data:t,borderColor:"#1c3d5a",backgroundColor:"rgba(28, 61, 90, 0.15)",fill:!0,tension:.35}]},options:{responsive:!0,plugins:{legend:{display:!1}}}});return}this.visitsChartInstance.data.labels=e,this.visitsChartInstance.data.datasets[0].data=t,this.visitsChartInstance.update()}}updateContactsChart(e,t){if(this.contactsChart?.nativeElement){if(!this.contactsChartInstance){this.contactsChartInstance=new Ao(this.contactsChart.nativeElement,{type:"bar",data:{labels:e,datasets:[{label:"Contact requests",data:t,backgroundColor:"rgba(53, 109, 133, 0.6)"}]},options:{responsive:!0,plugins:{legend:{display:!1}}}});return}this.contactsChartInstance.data.labels=e,this.contactsChartInstance.data.datasets[0].data=t,this.contactsChartInstance.update()}}updateStatusChart(e){if(this.statusChart?.nativeElement){if(!this.statusChartInstance){this.statusChartInstance=new Ao(this.statusChart.nativeElement,{type:"doughnut",data:{labels:["New","Reviewed"],datasets:[{data:e,backgroundColor:["rgba(255, 193, 7, 0.75)","rgba(25, 135, 84, 0.75)"],borderWidth:0}]},options:{responsive:!0,plugins:{legend:{position:"bottom"}}}});return}this.statusChartInstance.data.datasets[0].data=e,this.statusChartInstance.update()}}updateWeekdayChart(e){if(!this.weekdayChart?.nativeElement)return;let t=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];if(!this.weekdayChartInstance){this.weekdayChartInstance=new Ao(this.weekdayChart.nativeElement,{type:"bar",data:{labels:t,datasets:[{label:"Contacts",data:e,backgroundColor:"rgba(28, 61, 90, 0.6)"}]},options:{responsive:!0,plugins:{legend:{display:!1}}}});return}this.weekdayChartInstance.data.labels=t,this.weekdayChartInstance.data.datasets[0].data=e,this.weekdayChartInstance.update()}lastSevenDays(){let e=[],t=new Date;for(let i=6;i>=0;i-=1){let r=new Date(t);r.setDate(t.getDate()-i),e.push(r.toISOString().slice(0,10))}return e}toDateKey(e){return typeof e=="number"?new Date(e).toISOString().slice(0,10):""}weekdayBuckets(e){let t=Array.from({length:7}).map(()=>0);return e.forEach(i=>{if(typeof i.createdAt!="number")return;let r=new Date(i.createdAt).getDay();t[r]+=1}),t}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=se({type:n,selectors:[["app-admin-dashboard"]],viewQuery:function(t,i){if(t&1&&(Fn(zJ,5),Fn(WJ,5),Fn(qJ,5),Fn(GJ,5)),t&2){let r;ln(r=un())&&(i.visitsChart=r.first),ln(r=un())&&(i.contactsChart=r.first),ln(r=un())&&(i.statusChart=r.first),ln(r=un())&&(i.weekdayChart=r.first)}},decls:69,vars:16,consts:[["visitsChart",""],["contactsChart",""],["statusChart",""],["weekdayChart",""],[1,"page-hero","hero-slim"],[1,"container","d-flex","flex-column","flex-lg-row","justify-content-between","gap-3"],[1,"eyebrow"],[1,"lead"],[1,"btn","btn-primary","align-self-start",3,"click"],[1,"section-spacing"],[1,"container"],["class","stats-grid",4,"ngIf"],[1,"row","g-4","mb-4"],[1,"col-lg-6"],[1,"card","chart-card","h-100"],[1,"col-lg-4"],[1,"filter-bar"],[1,"btn","btn-sm",3,"click"],[1,"card","admin-table"],[1,"table-responsive"],[1,"table","align-middle","mb-0"],[3,"d-none",4,"ngFor","ngForOf"],["class","empty-state",4,"ngIf"],[1,"stats-grid"],[1,"stat-card"],[1,"text-muted","small"],["class","text-muted small",4,"ngIf"],[1,"message-cell"],[1,"badge"],[1,"btn","btn-sm","btn-outline-primary",3,"click","disabled"],[1,"empty-state"]],template:function(t,i){if(t&1){let r=Ln();p(0,"section",4)(1,"div",5)(2,"div")(3,"span",6),v(4,"Admin Dashboard"),m(),p(5,"h1"),v(6,"Contact inquiries"),m(),p(7,"p",7),v(8,"Review and manage guest messages from the website."),m()(),p(9,"button",8),ve("click",function(){return ze(r),We(i.logout())}),v(10,"Logout"),m()()(),p(11,"section",9)(12,"div",10),B(13,KJ,22,6,"div",11),za(14,"async"),p(15,"div",12)(16,"div",13)(17,"div",14)(18,"h6"),v(19,"Website visits (last 7 days)"),m(),k(20,"canvas",null,0),m()(),p(22,"div",13)(23,"div",14)(24,"h6"),v(25,"Contact requests (last 7 days)"),m(),k(26,"canvas",null,1),m()()(),p(28,"div",12)(29,"div",15)(30,"div",14)(31,"h6"),v(32,"Contact status"),m(),k(33,"canvas",null,2),m()(),p(35,"div",15)(36,"div",14)(37,"h6"),v(38,"Contacts by weekday"),m(),k(39,"canvas",null,3),m()()(),p(41,"div",16)(42,"button",17),ve("click",function(){return ze(r),We(i.setFilter("all"))}),v(43," All "),m(),p(44,"button",17),ve("click",function(){return ze(r),We(i.setFilter("new"))}),v(45," New "),m(),p(46,"button",17),ve("click",function(){return ze(r),We(i.setFilter("reviewed"))}),v(47," Reviewed "),m()(),p(48,"div",18)(49,"div",19)(50,"table",20)(51,"thead")(52,"tr")(53,"th"),v(54,"Guest"),m(),p(55,"th"),v(56,"Contact"),m(),p(57,"th"),v(58,"Message"),m(),p(59,"th"),v(60,"Submitted"),m(),p(61,"th"),v(62,"Status"),m(),k(63,"th"),m()(),p(64,"tbody"),B(65,ZJ,20,18,"tr",21),za(66,"async"),m()(),B(67,XJ,2,0,"div",22),za(68,"async"),m()()()()}if(t&2){let r;E(13),x("ngIf",Wa(14,9,i.messages$)),E(29),Bt("btn-primary",i.filter==="all"),E(2),Bt("btn-primary",i.filter==="new"),E(2),Bt("btn-primary",i.filter==="reviewed"),E(19),x("ngForOf",Wa(66,11,i.messages$)??$a(15,YJ)),E(2),x("ngIf",((r=Wa(68,13,i.messages$))==null?null:r.length)===0)}},dependencies:[Le,ei,hE],styles:[".admin-table[_ngcontent-%COMP%]{border-radius:1.5rem;padding:1rem;box-shadow:0 12px 30px #0f1a2b14}.filter-bar[_ngcontent-%COMP%]{display:flex;gap:.75rem;margin-bottom:1.5rem}.stats-grid[_ngcontent-%COMP%]{display:grid;gap:1rem;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));margin-bottom:2rem}.stat-card[_ngcontent-%COMP%]{background:#fff;border-radius:1rem;padding:1.25rem;box-shadow:0 10px 24px #0f1a2b14;display:flex;flex-direction:column;gap:.4rem}.chart-card[_ngcontent-%COMP%]{border-radius:1.5rem;padding:1.5rem;box-shadow:0 12px 30px #0f1a2b14}.chart-card[_ngcontent-%COMP%] h6[_ngcontent-%COMP%]{margin-bottom:1rem}.message-cell[_ngcontent-%COMP%]{max-width:320px}.empty-state[_ngcontent-%COMP%]{padding:2rem;text-align:center;color:var(--text-muted)}"]})};var vv=class n{constructor(e){this.seo=e;this.seo.update({title:"Privacy Policy | Himalayan Eco Inn",description:"Read how Himalayan Eco Inn collects, uses, and protects your personal information.",keywords:"Himalayan Eco Inn privacy policy, Leh Ladakh hotel privacy, data protection"}),this.seo.injectBreadcrumb([{name:"Home",url:"https://himalayanecoinn.com/"},{name:"Privacy Policy",url:"https://himalayanecoinn.com/privacy-policy"}])}static \u0275fac=function(t){return new(t||n)(N(Te))};static \u0275cmp=se({type:n,selectors:[["app-privacy-policy"]],decls:30,vars:0,consts:[[1,"page-hero"],[1,"container"],[1,"eyebrow"],[1,"lead"],[1,"section-spacing"],[1,"container","content-card"],[1,"text-muted"]],template:function(t,i){t&1&&(Ie(0,"section",0)(1,"div",1)(2,"span",2),v(3,"Privacy Policy"),Se(),Ie(4,"h1"),v(5,"Your privacy matters to Himalayan Eco Inn."),Se(),Ie(6,"p",3),v(7," This policy explains what we collect, how we use it, and how we keep your information safe. "),Se()()(),Ie(8,"section",4)(9,"div",5)(10,"h4"),v(11,"Information we collect"),Se(),Ie(12,"p",6),v(13," We collect information you provide when submitting a contact form or booking inquiry, such as name, email, phone number, travel dates, and message details. "),Se(),Ie(14,"h4"),v(15,"How we use your information"),Se(),Ie(16,"p",6),v(17," We use your information to respond to inquiries, personalize your stay, provide requested services, and improve guest experiences. "),Se(),Ie(18,"h4"),v(19,"Data storage"),Se(),Ie(20,"p",6),v(21," Contact requests are stored securely in our database and accessed only by authorized staff. We do not sell or share your personal data with third parties. "),Se(),Ie(22,"h4"),v(23,"Cookies and analytics"),Se(),Ie(24,"p",6),v(25," We use basic analytics to understand website performance. This data is aggregated and does not identify individual users. "),Se(),Ie(26,"h4"),v(27,"Your rights"),Se(),Ie(28,"p",6),v(29," You can request access, correction, or deletion of your personal data by contacting us at stay@himalayanecoinn.com. "),Se()()())},styles:[".content-card[_ngcontent-%COMP%]{background:#fff;border-radius:1.5rem;padding:2.5rem;box-shadow:0 12px 30px #0f1a2b14}.content-card[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{margin-top:1.5rem}.content-card[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]:first-child{margin-top:0}"]})};var yv=class n{constructor(e){this.seo=e;this.seo.update({title:"Terms & Conditions | Himalayan Eco Inn",description:"Review the booking and stay terms for Himalayan Eco Inn.",keywords:"Himalayan Eco Inn terms, Leh Ladakh hotel policies, room booking terms"}),this.seo.injectBreadcrumb([{name:"Home",url:"https://himalayanecoinn.com/"},{name:"Terms & Conditions",url:"https://himalayanecoinn.com/terms"}])}static \u0275fac=function(t){return new(t||n)(N(Te))};static \u0275cmp=se({type:n,selectors:[["app-terms"]],decls:30,vars:0,consts:[[1,"page-hero"],[1,"container"],[1,"eyebrow"],[1,"lead"],[1,"section-spacing"],[1,"container","content-card"],[1,"text-muted"]],template:function(t,i){t&1&&(Ie(0,"section",0)(1,"div",1)(2,"span",2),v(3,"Terms & Conditions"),Se(),Ie(4,"h1"),v(5,"Stay terms for Himalayan Eco Inn."),Se(),Ie(6,"p",3),v(7," Please review the terms that apply to bookings, cancellations, and guest policies. "),Se()()(),Ie(8,"section",4)(9,"div",5)(10,"h4"),v(11,"Bookings"),Se(),Ie(12,"p",6),v(13," Reservations are confirmed upon advance payment or as agreed with the concierge team. Rates are subject to seasonal availability and local taxes. "),Se(),Ie(14,"h4"),v(15,"Check-in and check-out"),Se(),Ie(16,"p",6),v(17," Standard check-in is 2:00 PM and check-out is 11:00 AM. Early check-in or late check-out depends on availability. "),Se(),Ie(18,"h4"),v(19,"Cancellations"),Se(),Ie(20,"p",6),v(21," Cancellation policies vary by season and booking type. Please confirm terms at the time of booking. "),Se(),Ie(22,"h4"),v(23,"Guest conduct"),Se(),Ie(24,"p",6),v(25," We encourage respectful and responsible behavior to maintain a safe and peaceful environment for all guests. "),Se(),Ie(26,"h4"),v(27,"Liability"),Se(),Ie(28,"p",6),v(29," Himalayan Eco Inn is not responsible for loss of personal belongings. Guests are advised to use in-room safes or request assistance from the front desk. "),Se()()())},styles:[".content-card[_ngcontent-%COMP%]{background:#fff;border-radius:1.5rem;padding:2.5rem;box-shadow:0 12px 30px #0f1a2b14}.content-card[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{margin-top:1.5rem}.content-card[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]:first-child{margin-top:0}"]})};function JJ(n,e){if(n&1&&(p(0,"div",12)(1,"div",13),k(2,"img",14),p(3,"div",15)(4,"h6"),v(5),m()()()()),n&2){let t=e.$implicit;E(2),x("src",t.image,jt)("alt",t.title),E(3),O(t.title)}}var _v=class n{constructor(e){this.seo=e;this.seo.update({title:"Gallery | Himalayan Eco Inn",description:"Explore Himalayan Eco Inn through curated photos of rooms, dining spaces, and Himalayan views in Leh, Ladakh.",keywords:"Himalayan Eco Inn gallery, Leh Ladakh hotel photos, rooms and dining, homestay in Leh"}),this.seo.injectBreadcrumb([{name:"Home",url:"https://himalayanecoinn.com/"},{name:"Gallery",url:"https://himalayanecoinn.com/gallery"}])}items=Lc;static \u0275fac=function(t){return new(t||n)(N(Te))};static \u0275cmp=se({type:n,selectors:[["app-gallery"]],decls:31,vars:1,consts:[[1,"page-hero","hero-slim"],[1,"container"],[1,"eyebrow"],[1,"lead"],[1,"section-spacing"],[1,"section-heading"],[1,"row","g-4"],["class","col-sm-6 col-lg-4",4,"ngFor","ngForOf"],[1,"section-spacing","bg-soft"],[1,"cta-card"],[1,"eyebrow","text-white"],["routerLink","/contact",1,"btn","btn-light","btn-lg"],[1,"col-sm-6","col-lg-4"],[1,"card","gallery-card","h-100"],[3,"src","alt"],[1,"card-body"]],template:function(t,i){t&1&&(p(0,"section",0)(1,"div",1)(2,"span",2),v(3,"Gallery"),m(),p(4,"h1"),v(5,"Moments from Himalayan Eco Inn."),m(),p(6,"p",3),v(7," A glimpse into our spaces, mountain vistas, and the thoughtful details that define every stay. "),m()()(),p(8,"section",4)(9,"div",1)(10,"div",5)(11,"span",2),v(12,"Signature Spaces"),m(),p(13,"h2"),v(14,"Designed for calm, light, and Ladakhi views."),m(),p(15,"p"),v(16,"Each corner is curated for comfort, with sustainable finishes and warm Himalayan tones."),m()(),p(17,"div",6),B(18,JJ,6,3,"div",7),m()()(),p(19,"section",8)(20,"div",1)(21,"div",9)(22,"div")(23,"span",10),v(24,"Plan Your Stay"),m(),p(25,"h2"),v(26,"Make the mountains your home base."),m(),p(27,"p"),v(28,"Reach out for curated itineraries, seasonal offers, and personalized experiences."),m()(),p(29,"a",11),v(30,"Connect with us"),m()()()()),t&2&&(E(18),x("ngForOf",i.items))},dependencies:[Le,qe],styles:[".gallery-card[_ngcontent-%COMP%]{overflow:hidden;box-shadow:0 14px 30px #0f1a2b1f}.gallery-card[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{height:240px;object-fit:cover;transition:transform .4s ease}.gallery-card[_ngcontent-%COMP%]:hover img[_ngcontent-%COMP%]{transform:scale(1.04)}"]})};function eee(n,e){if(n&1&&(p(0,"div",13)(1,"h2",14)(2,"button",15),v(3),m()(),p(4,"div",16)(5,"div",17),v(6),m()()()),n&2){let t=e.$implicit,i=e.index;E(),x("id","faqHeading"+i),E(),Qt("data-bs-target","#faqCollapse"+i)("aria-controls","faqCollapse"+i),E(),ye(" ",t.question," "),E(),x("id","faqCollapse"+i),Qt("aria-labelledby","faqHeading"+i),E(2),ye(" ",t.answer," ")}}function tee(n,e){if(n&1&&(p(0,"div",18)(1,"div",19)(2,"div",20)(3,"h5"),v(4),m(),p(5,"p",21),v(6),m()()()()),n&2){let t=e.$implicit;E(4),O(t.title),E(2),O(t.description)}}var bv=class n{constructor(e,t){this.seo=e;this.doc=t;this.seo.update({title:"FAQ \u2013 Ladakh Hotel, Tour & Stay Questions | Himalayan Eco Inn",description:"Answers to common questions about staying at Himalayan Eco Inn in Leh, Ladakh \u2013 altitude sickness, permits, best time to visit, tour packages, rooms, and booking policies.",keywords:"Ladakh hotel FAQ, Leh hotel questions, best time to visit Ladakh, Ladakh permits, altitude sickness Leh, Ladakh tour packages, hotel in Leh booking, Himalayan Eco Inn FAQ"}),this.injectFaqSchema(),this.injectBreadcrumb()}faqList=Pc;travelTips=[{title:"Best travel window",description:"April to October offers clear skies, festivals, and easy access to scenic routes. June\u2013August is peak season."},{title:"Altitude comfort",description:"Leh sits at 3,524m. Hydrate well, rest on arrival day, and enjoy gentle acclimatization walks around the property."},{title:"What to pack",description:"Layered clothing, UV-protection sunscreen, sunglasses, a reusable bottle, and comfortable walking shoes."},{title:"Permits for restricted areas",description:"Permits are needed for Nubra Valley, Pangong Lake, and Tso Moriri. Our concierge arranges them for you."}];injectFaqSchema(){let e=this.doc.getElementById("faq-jsonld");e&&e.remove();let t=this.doc.createElement("script");t.id="faq-jsonld",t.type="application/ld+json",t.text=JSON.stringify({"@context":"https://schema.org","@type":"FAQPage",mainEntity:this.faqList.map(i=>({"@type":"Question",name:i.question,acceptedAnswer:{"@type":"Answer",text:i.answer}}))}),this.doc.head.appendChild(t)}injectBreadcrumb(){let e=this.doc.getElementById("faq-breadcrumb-jsonld");e&&e.remove();let t=this.doc.createElement("script");t.id="faq-breadcrumb-jsonld",t.type="application/ld+json",t.text=JSON.stringify({"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Home",item:"https://himalayanecoinn.com/"},{"@type":"ListItem",position:2,name:"FAQ",item:"https://himalayanecoinn.com/faq"}]}),this.doc.head.appendChild(t)}static \u0275fac=function(t){return new(t||n)(N(Te),N(Pe))};static \u0275cmp=se({type:n,selectors:[["app-faq"]],decls:33,vars:2,consts:[[1,"page-hero","hero-slim"],[1,"container"],[1,"eyebrow"],[1,"lead"],[1,"section-spacing"],[1,"section-heading"],["id","faqList",1,"accordion"],["class","accordion-item",4,"ngFor","ngForOf"],[1,"section-spacing","bg-soft"],[1,"row","g-4"],["class","col-md-6 col-lg-4",4,"ngFor","ngForOf"],[1,"mt-4"],["routerLink","/contact",1,"btn","btn-primary"],[1,"accordion-item"],[1,"accordion-header",3,"id"],["type","button","data-bs-toggle","collapse",1,"accordion-button"],["data-bs-parent","#faqList",1,"accordion-collapse","collapse",3,"id"],[1,"accordion-body","text-muted"],[1,"col-md-6","col-lg-4"],[1,"card","tip-card","h-100"],[1,"card-body"],[1,"text-muted","mb-0"]],template:function(t,i){t&1&&(p(0,"section",0)(1,"div",1)(2,"span",2),v(3,"FAQ"),m(),p(4,"h1"),v(5,"Quick answers for a seamless stay."),m(),p(6,"p",3),v(7," Everything you need to know about bookings, services, and travel planning in Leh. "),m()()(),p(8,"section",4)(9,"div",1)(10,"div",5)(11,"span",2),v(12,"Stay Essentials"),m(),p(13,"h2"),v(14,"Planning details made easy."),m(),p(15,"p"),v(16,"Reach out anytime if your question is not covered here."),m()(),p(17,"div",6),B(18,eee,7,7,"div",7),m()()(),p(19,"section",8)(20,"div",1)(21,"div",5)(22,"span",2),v(23,"Travel Tips"),m(),p(24,"h2"),v(25,"Helpful guidance for your Ladakh journey."),m(),p(26,"p"),v(27,"Plan ahead and make the most of your mountain escape."),m()(),p(28,"div",9),B(29,tee,7,2,"div",10),m(),p(30,"div",11)(31,"a",12),v(32,"Ask our concierge"),m()()()()),t&2&&(E(18),x("ngForOf",i.faqList),E(11),x("ngForOf",i.travelTips))},dependencies:[Le,qe],styles:[".tip-card[_ngcontent-%COMP%]{box-shadow:0 12px 28px #0f1a2b1a}.tip-card[_ngcontent-%COMP%] h5[_ngcontent-%COMP%]{text-transform:capitalize}"]})};function nee(n,e){if(n&1&&(p(0,"div",11)(1,"div",12)(2,"div",13)(3,"h5"),v(4),m(),p(5,"p",14),v(6),m()()()()),n&2){let t=e.$implicit;E(4),O(t.title),E(2),O(t.detail)}}function iee(n,e){if(n&1&&(p(0,"div",11)(1,"div",15)(2,"div",16)(3,"h6"),v(4),m(),p(5,"span",17),v(6),m()(),p(7,"p",18),v(8),m(),p(9,"p",19),v(10),m()()()),n&2){let t=e.$implicit;E(4),O(t.name),E(2),O(t.rating),E(2),O(t.location),E(2),ye("\u201C",t.quote,"\u201D")}}var Ev=class n{constructor(e){this.seo=e;this.seo.update({title:"Guest Reviews | Himalayan Eco Inn",description:"Read guest reviews and stories from hotel stays at Himalayan Eco Inn in Leh, Ladakh.",keywords:"Himalayan Eco Inn reviews, Leh Ladakh guest reviews, hotel testimonials, homestay in Leh"}),this.seo.injectBreadcrumb([{name:"Home",url:"https://himalayanecoinn.com/"},{name:"Reviews",url:"https://himalayanecoinn.com/reviews"}])}reviews=sg;highlights=[{title:"4.9 average rating",detail:"Across recent guest stays and curated surveys."},{title:"Warm Ladakhi hospitality",detail:"Friendly concierge support and local expertise."},{title:"Comfort-first rooms",detail:"Quiet layouts, thoughtful amenities, and cozy lighting."}];static \u0275fac=function(t){return new(t||n)(N(Te))};static \u0275cmp=se({type:n,selectors:[["app-reviews"]],decls:33,vars:2,consts:[[1,"page-hero","hero-slim"],[1,"container"],[1,"eyebrow"],[1,"lead"],[1,"section-spacing"],[1,"section-heading"],[1,"row","g-4"],["class","col-md-6 col-lg-4",4,"ngFor","ngForOf"],[1,"section-spacing","bg-soft"],[1,"mt-4"],["routerLink","/contact",1,"btn","btn-primary"],[1,"col-md-6","col-lg-4"],[1,"card","review-highlight","h-100"],[1,"card-body"],[1,"text-muted","mb-0"],[1,"card","testimonial-card","h-100"],[1,"d-flex","align-items-center","justify-content-between"],[1,"badge","bg-primary-subtle","text-primary"],[1,"text-muted","mb-2"],[1,"quote"]],template:function(t,i){t&1&&(p(0,"section",0)(1,"div",1)(2,"span",2),v(3,"Guest Reviews"),m(),p(4,"h1"),v(5,"Real stories from Himalayan Eco Inn."),m(),p(6,"p",3),v(7," Hear directly from travelers who experienced Ladakh with us. "),m()()(),p(8,"section",4)(9,"div",1)(10,"div",5)(11,"span",2),v(12,"Highlights"),m(),p(13,"h2"),v(14,"Why guests keep coming back."),m(),p(15,"p"),v(16,"Consistent service and calm spaces define the Himalayan Eco Inn experience."),m()(),p(17,"div",6),B(18,nee,7,2,"div",7),m()()(),p(19,"section",8)(20,"div",1)(21,"div",5)(22,"span",2),v(23,"Guest Voices"),m(),p(24,"h2"),v(25,"Comfort, culture, and curated moments."),m(),p(26,"p"),v(27,"Here is what our guests loved the most about their stay."),m()(),p(28,"div",6),B(29,iee,11,4,"div",7),m(),p(30,"div",9)(31,"a",10),v(32,"Plan your stay"),m()()()()),t&2&&(E(18),x("ngForOf",i.highlights),E(11),x("ngForOf",i.reviews))},dependencies:[Le,qe],styles:[".review-highlight[_ngcontent-%COMP%]{box-shadow:0 14px 32px #0f1a2b1f}"]})};var ree=n=>({"active-filter":n});function oee(n,e){if(n&1){let t=Ln();p(0,"button",14),ve("click",function(){let r=ze(t).$implicit,o=Ne();return We(o.setCategory(r))}),v(1),m()}if(n&2){let t=e.$implicit,i=Ne();x("ngClass",ls(2,ree,i.activeCategory===t)),E(),ye(" ",t," ")}}function see(n,e){if(n&1&&(p(0,"div",15)(1,"div",16)(2,"div",17)(3,"div",18)(4,"div")(5,"h5"),v(6),m(),p(7,"span",19),v(8),m()(),p(9,"span",20),v(10),m()(),p(11,"p",21),v(12),m(),p(13,"div",22),k(14,"i",23),p(15,"span"),v(16),m()(),p(17,"div",24)(18,"a",25),v(19," Open in Google Maps "),m()()()()()),n&2){let t=e.$implicit;E(6),O(t.name),E(2),O(t.category),E(2),O(t.distance),E(2),O(t.summary),E(4),O(t.tip),E(2),x("href",t.mapUrl,jt)}}var wv=class n{constructor(e){this.seo=e;this.seo.update({title:"Nearby Places | Himalayan Eco Inn",description:"Discover nearby monasteries, viewpoints, villages, and restaurants around Himalayan Eco Inn in Leh, Ladakh.",keywords:"Leh nearby places, Ladakh monasteries, Leh restaurants, things to do in Leh, Ladakh hotel location"}),this.seo.injectBreadcrumb([{name:"Home",url:"https://himalayanecoinn.com/"},{name:"Nearby Places",url:"https://himalayanecoinn.com/nearby"}])}places=ag;categories=["All","Monastery","Viewpoint","Village","Restaurant"];activeCategory="All";setCategory(e){this.activeCategory=e}get filteredPlaces(){return this.activeCategory==="All"?this.places:this.places.filter(e=>e.category===this.activeCategory)}static \u0275fac=function(t){return new(t||n)(N(Te))};static \u0275cmp=se({type:n,selectors:[["app-nearby"]],decls:33,vars:2,consts:[[1,"page-hero","hero-slim"],[1,"container"],[1,"eyebrow"],[1,"lead"],[1,"section-spacing"],[1,"section-heading"],[1,"filter-row"],["class","btn btn-outline-primary btn-sm",3,"ngClass","click",4,"ngFor","ngForOf"],[1,"row","g-4"],["class","col-md-6 col-lg-4",4,"ngFor","ngForOf"],[1,"section-spacing","bg-soft"],[1,"cta-card"],[1,"eyebrow","text-white"],["routerLink","/contact",1,"btn","btn-light","btn-lg"],[1,"btn","btn-outline-primary","btn-sm",3,"click","ngClass"],[1,"col-md-6","col-lg-4"],[1,"card","place-card","h-100"],[1,"card-body"],[1,"d-flex","align-items-start","justify-content-between","gap-3"],[1,"badge","bg-primary-subtle","text-primary"],[1,"distance"],[1,"text-muted","mb-3"],[1,"tip"],[1,"bi","bi-lightbulb-fill"],[1,"mt-3"],["target","_blank","rel","noopener",1,"btn","btn-outline-primary","btn-sm",3,"href"]],template:function(t,i){t&1&&(p(0,"section",0)(1,"div",1)(2,"span",2),v(3,"Nearby Places"),m(),p(4,"h1"),v(5,"Explore Leh and Ladakh around Himalayan Eco Inn."),m(),p(6,"p",3),v(7," From monasteries to cozy restaurants, discover handpicked spots to enrich your stay. "),m()()(),p(8,"section",4)(9,"div",1)(10,"div",5)(11,"span",2),v(12,"Local Favorites"),m(),p(13,"h2"),v(14,"Curated picks for culture, views, and local flavors."),m(),p(15,"p"),v(16,"Ask our concierge to arrange transport, guides, or custom itineraries."),m()(),p(17,"div",6),B(18,oee,2,4,"button",7),m(),p(19,"div",8),B(20,see,20,6,"div",9),m()()(),p(21,"section",10)(22,"div",1)(23,"div",11)(24,"div")(25,"span",12),v(26,"Plan a Day Out"),m(),p(27,"h2"),v(28,"Let us tailor a sightseeing plan for you."),m(),p(29,"p"),v(30,"Tell us your interests and we will map a perfect local itinerary."),m()(),p(31,"a",13),v(32,"Request a local guide"),m()()()()),t&2&&(E(18),x("ngForOf",i.categories),E(2),x("ngForOf",i.filteredPlaces))},dependencies:[ur,Le,qe],styles:[".filter-row[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.75rem;margin-bottom:2rem}.filter-row[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{border-radius:999px}.filter-row[_ngcontent-%COMP%] .active-filter[_ngcontent-%COMP%]{background:var(--primary);color:#fff;border-color:var(--primary)}.place-card[_ngcontent-%COMP%]{box-shadow:0 14px 32px #0f1a2b1f}.place-card[_ngcontent-%COMP%] .distance[_ngcontent-%COMP%]{font-weight:600;color:var(--primary)}.place-card[_ngcontent-%COMP%] .tip[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;color:var(--text-muted)}.place-card[_ngcontent-%COMP%] .tip[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:var(--primary)}"]})};var Cv=class n{static \u0275fac=function(t){return new(t||n)};static \u0275cmp=se({type:n,selectors:[["app-not-found"]],decls:10,vars:0,consts:[[1,"page-hero","hero-slim"],[1,"container","text-center"],[1,"eyebrow"],[1,"lead"],["routerLink","/",1,"btn","btn-primary"]],template:function(t,i){t&1&&(p(0,"section",0)(1,"div",1)(2,"span",2),v(3,"404"),m(),p(4,"h1"),v(5,"Page not found"),m(),p(6,"p",3),v(7,"The page you are looking for does not exist."),m(),p(8,"a",4),v(9,"Back to home"),m()()())},dependencies:[qe],styles:[".page-hero[_ngcontent-%COMP%]{min-height:60vh;display:flex;align-items:center}"]})};var aee=[{title:"Home",description:"Himalayan Eco Inn \u2013 Luxury hotel and homestay in Leh, Ladakh",url:"/",category:"Page",icon:"bi-house-fill"},{title:"About Us",description:"Our story, values, and eco-philosophy in Leh, Ladakh",url:"/about",category:"Page",icon:"bi-info-circle-fill"},{title:"Experiences",description:"Stargazing, cultural walks, wellness, and high-altitude dining",url:"/experience",category:"Page",icon:"bi-stars"},{title:"Rooms & Suites",description:"Elegant mountain-view rooms with modern amenities",url:"/rooms",category:"Page",icon:"bi-door-open-fill"},{title:"Gallery",description:"Photos of the hotel, rooms, dining, and Ladakh views",url:"/gallery",category:"Page",icon:"bi-images"},{title:"Reviews",description:"Guest reviews and testimonials for Himalayan Eco Inn",url:"/reviews",category:"Page",icon:"bi-chat-quote-fill"},{title:"FAQ",description:"Frequently asked questions about stay, booking, and services",url:"/faq",category:"Page",icon:"bi-question-circle-fill"},{title:"Nearby Places",description:"Monasteries, viewpoints, and restaurants near the hotel",url:"/nearby",category:"Page",icon:"bi-map-fill"},{title:"Contact & Book",description:"Contact us to book a room or get a custom itinerary",url:"/contact",category:"Page",icon:"bi-envelope-fill"}];function _2(n){return n.toLowerCase().replace(/[^a-z0-9\s]/g,"")}function b2(n,e){let t=_2(n),i=_2(e);return i.includes(t)?2:t.split(/\s+/).filter(Boolean).reduce((o,s)=>o+(i.includes(s)?1:0),0)}var ol=class n{corpus=[...aee,...ho.map(e=>({title:e.name,description:`${e.price} \xB7 ${e.view} \xB7 ${e.size}`,url:"/rooms",category:"Room",icon:"bi-building"})),...Oc.map(e=>({title:e.title,description:e.description,url:"/experience",category:"Experience",icon:e.icon??"bi-stars"})),...Pc.map(e=>({title:e.question,description:e.answer,url:"/faq",category:"FAQ",icon:"bi-question-circle-fill"})),...ag.map(e=>({title:e.name,description:`${e.category} \xB7 ${e.distance} away \u2013 ${e.summary}`,url:"/nearby",category:"Nearby",icon:"bi-geo-alt-fill"})),...Lc.map(e=>({title:e.title,description:"Photo from Himalayan Eco Inn gallery",url:"/gallery",category:"Gallery",icon:"bi-image"}))];search(e,t=20){if(!e||e.trim().length<2)return[];let i=e.trim();return this.corpus.map(r=>({item:r,s:b2(i,r.title)*3+b2(i,r.description)})).filter(r=>r.s>0).sort((r,o)=>o.s-r.s).slice(0,t).map(r=>r.item)}getSuggestions(e){return this.search(e,6)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=L({token:n,factory:n.\u0275fac,providedIn:"root"})};function cee(n,e){n&1&&(p(0,"div",11),k(1,"i",12),p(2,"p",13),v(3,"Start typing to explore Himalayan Eco Inn."),m()())}function lee(n,e){if(n&1&&(p(0,"div",11),k(1,"i",14),p(2,"p",13),v(3,"No results found for "),p(4,"strong"),v(5),m(),v(6,". Try another keyword."),m(),p(7,"a",15),v(8,"Contact Us"),m()()),n&2){let t=Ne();E(5),ye('"',t.query,'"')}}function uee(n,e){if(n&1&&(p(0,"a",23)(1,"div",24),k(2,"i",25),m(),p(3,"div",26)(4,"h3",27),v(5),m(),p(6,"p",28),v(7),m()(),k(8,"i",29),m()),n&2){let t=e.$implicit;x("routerLink",t.url),E(2),Ba(t.icon),E(3),O(t.title),E(2),O(t.description)}}function dee(n,e){if(n&1&&(p(0,"div",18)(1,"h2",19),k(2,"i",20),v(3),m(),p(4,"div",21),B(5,uee,9,5,"a",22),m()()),n&2){let t=e.$implicit,i=Ne(2);E(3),ye(" ",t," "),E(2),x("ngForOf",i.resultsByCategory(t))}}function fee(n,e){if(n&1&&(p(0,"div")(1,"p",16)(2,"strong"),v(3),m(),v(4),p(5,"em"),v(6),m(),v(7,'" '),m(),B(8,dee,6,2,"div",17),m()),n&2){let t=Ne();E(3),O(t.results.length),E(),ye(" result",t.results.length===1?"":"s",' for "'),E(2),O(t.query),E(2),x("ngForOf",t.categories)}}var Iv=class n{constructor(e,t,i,r){this.route=e;this.router=t;this.searchService=i;this.seo=r}query="";results=[];searched=!1;ngOnInit(){this.route.queryParamMap.subscribe(e=>{let t=e.get("q")??"";this.query=t,t.trim().length>=2?(this.results=this.searchService.search(t),this.searched=!0,this.seo.update({title:`Search: "${t}" | Himalayan Eco Inn`,description:`Search results for "${t}" on Himalayan Eco Inn \u2013 Leh, Ladakh.`,robots:"noindex, follow"})):(this.results=[],this.searched=!1,this.seo.update({title:"Search | Himalayan Eco Inn",description:"Search rooms, experiences, and more at Himalayan Eco Inn, Leh Ladakh.",robots:"noindex, follow"}))})}onSubmit(){this.query.trim().length>=2&&this.router.navigate(["/search"],{queryParams:{q:this.query.trim()}})}get categories(){return[...new Set(this.results.map(e=>e.category))]}resultsByCategory(e){return this.results.filter(t=>t.category===e)}static \u0275fac=function(t){return new(t||n)(N(ni),N(_t),N(ol),N(Te))};static \u0275cmp=se({type:n,selectors:[["app-search"]],decls:16,vars:4,consts:[[1,"search-page"],[1,"container"],[1,"search-header"],[1,"text-muted"],[1,"search-form",3,"ngSubmit"],[1,"search-input-wrap"],[1,"bi","bi-search","search-icon"],["id","site-search-input","type","search","name","q","placeholder","e.g. deluxe room, stargazing, monastery...","autocomplete","off","autofocus","",1,"search-input",3,"ngModelChange","ngModel"],["type","submit",1,"btn","btn-primary","search-btn"],["class","search-empty",4,"ngIf"],[4,"ngIf"],[1,"search-empty"],[1,"bi","bi-compass","display-4","text-muted"],[1,"mt-3","text-muted"],[1,"bi","bi-search","display-4","text-muted"],["routerLink","/contact",1,"btn","btn-outline-primary","mt-2"],[1,"results-count"],["class","result-group",4,"ngFor","ngForOf"],[1,"result-group"],[1,"result-category-label"],[1,"bi","bi-tag-fill"],[1,"result-cards"],["class","result-card",3,"routerLink",4,"ngFor","ngForOf"],[1,"result-card",3,"routerLink"],[1,"result-icon"],[1,"bi"],[1,"result-body"],[1,"result-title"],[1,"result-desc"],[1,"bi","bi-arrow-right","result-arrow"]],template:function(t,i){t&1&&(p(0,"section",0)(1,"div",1)(2,"div",2)(3,"h1"),v(4,"Search Himalayan Eco Inn"),m(),p(5,"p",3),v(6,"Find rooms, experiences, nearby places, FAQs and more."),m()(),p(7,"form",4),ve("ngSubmit",function(){return i.onSubmit()}),p(8,"div",5),k(9,"i",6),p(10,"input",7),as("ngModelChange",function(o){return Ha(i.query,o)||(i.query=o),o}),m(),p(11,"button",8),v(12,"Search"),m()()(),B(13,cee,4,0,"div",9)(14,lee,9,1,"div",9)(15,fee,9,4,"div",10),m()()),t&2&&(E(10),ss("ngModel",i.query),E(3),x("ngIf",!i.searched),E(),x("ngIf",i.searched&&i.results.length===0),E(),x("ngIf",i.results.length>0))},dependencies:[Le,ei,qe,Tg,Hc,Bi,mo,Uc,Id,gI],styles:[".search-page[_ngcontent-%COMP%]{min-height:70vh;padding:3rem 0 5rem}.search-header[_ngcontent-%COMP%]{margin-bottom:2rem;text-align:center}.search-header[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{font-size:clamp(1.6rem,4vw,2.4rem);font-weight:700;color:var(--text-base)}.search-header[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font-size:1rem;margin-top:.35rem}.search-form[_ngcontent-%COMP%]{max-width:680px;margin:0 auto 2.5rem}.search-input-wrap[_ngcontent-%COMP%]{display:flex;align-items:center;gap:0;background:#fff;border:1.5px solid #e0e4ef;border-radius:2rem;padding:.4rem .4rem .4rem 1.1rem;box-shadow:0 4px 18px #00000012;transition:border-color .2s}.search-input-wrap[_ngcontent-%COMP%]:focus-within{border-color:var(--primary);box-shadow:0 4px 18px rgba(var(--primary-rgb, 74, 111, 165),.18)}.search-icon[_ngcontent-%COMP%]{font-size:1.05rem;color:var(--text-muted);flex-shrink:0;margin-right:.5rem}.search-input[_ngcontent-%COMP%]{flex:1;border:none;outline:none;background:transparent;font-size:1rem;color:var(--text-base);padding:.3rem 0}.search-input[_ngcontent-%COMP%]::placeholder{color:var(--text-muted)}.search-input[_ngcontent-%COMP%]::-webkit-search-cancel-button{cursor:pointer}.search-btn[_ngcontent-%COMP%]{border-radius:1.5rem;padding:.45rem 1.2rem;font-size:.9rem;flex-shrink:0}.search-empty[_ngcontent-%COMP%]{text-align:center;padding:3rem 1rem;opacity:.7}.results-count[_ngcontent-%COMP%]{font-size:.9rem;color:var(--text-muted);margin-bottom:1.5rem}.results-count[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--text-base)}.result-group[_ngcontent-%COMP%]{margin-bottom:2.5rem}.result-category-label[_ngcontent-%COMP%]{font-size:.75rem;font-weight:700;text-transform:uppercase;letter-spacing:.1em;color:var(--primary);margin-bottom:.75rem;display:flex;align-items:center;gap:.4rem}.result-category-label[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:.75rem}.result-cards[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.6rem}.result-card[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;padding:.9rem 1.1rem;background:#fff;border:1px solid #e8ecf5;border-radius:1rem;text-decoration:none;color:var(--text-base);transition:box-shadow .2s,border-color .2s,transform .15s}.result-card[_ngcontent-%COMP%]:hover{border-color:var(--primary);box-shadow:0 4px 20px #00000014;transform:translateY(-1px);color:var(--text-base)}.result-icon[_ngcontent-%COMP%]{width:2.4rem;height:2.4rem;border-radius:.65rem;background:var(--bg-soft, #f4f6fb);display:flex;align-items:center;justify-content:center;flex-shrink:0;font-size:1rem;color:var(--primary)}.result-body[_ngcontent-%COMP%]{flex:1;min-width:0}.result-title[_ngcontent-%COMP%]{font-size:.95rem;font-weight:600;margin:0 0 .15rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.result-desc[_ngcontent-%COMP%]{font-size:.8rem;color:var(--text-muted);margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.result-arrow[_ngcontent-%COMP%]{color:var(--text-muted);font-size:.9rem;flex-shrink:0;transition:transform .2s}.result-card[_ngcontent-%COMP%]:hover .result-arrow[_ngcontent-%COMP%]{transform:translate(3px);color:var(--primary)}"]})};var w2=()=>{let n=C(go),e=C(_t),t=C(vo);return n.isAuthenticated().pipe(z(i=>{let r=t.isExpired();return(!i||r)&&(r&&t.clear(),e.navigate(["/admin/login"])),i&&!r}),xn(()=>(e.navigate(["/admin/login"]),H(!1))))};var C2=[{path:"",component:lg,title:"Himalayan Eco Inn | Luxury Hotel in Leh Ladakh"},{path:"about",component:ug,title:"About Himalayan Eco Inn"},{path:"experience",component:dg,title:"Experience | Himalayan Eco Inn"},{path:"rooms",component:fg,title:"Rooms & Amenities | Himalayan Eco Inn"},{path:"contact",component:Mg,title:"Contact | Himalayan Eco Inn"},{path:"gallery",component:_v,title:"Gallery | Himalayan Eco Inn"},{path:"faq",component:bv,title:"FAQ | Himalayan Eco Inn"},{path:"reviews",component:Ev,title:"Guest Reviews | Himalayan Eco Inn"},{path:"nearby",component:wv,title:"Nearby Places | Himalayan Eco Inn"},{path:"privacy-policy",component:vv,title:"Privacy Policy | Himalayan Eco Inn"},{path:"terms",component:yv,title:"Terms & Conditions | Himalayan Eco Inn"},{path:"search",component:Iv,title:"Search | Himalayan Eco Inn"},{path:"admin/login",component:Rg,title:"Admin Login | Himalayan Eco Inn"},{path:"admin",component:gv,canActivate:[w2],title:"Admin Dashboard | Himalayan Eco Inn"},{path:"**",component:Cv,title:"Page Not Found | Himalayan Eco Inn"}];var I2={providers:[r_(),zb(),JE(C2,e0({scrollPositionRestoration:"top",anchorScrolling:"enabled"})),d1(()=>f1(cg.firebase)),_N(()=>EN()),yP(()=>bP()),FR(LR())]};var hee=["searchInputRef"],S2=()=>({exact:!0});function pee(n,e){if(n&1){let t=Ln();p(0,"li",52),ve("mousedown",function(){let r=ze(t).$implicit,o=Ne(2);return We(o.selectSuggestion(r))}),p(1,"span",53),k(2,"i",8),m(),p(3,"span",54)(4,"span",55),v(5),m(),p(6,"span",56),v(7),m()()()}if(n&2){let t=e.$implicit,i=e.index,r=Ne(2);Bt("active",i===r.activeSuggestionIndex),Qt("aria-selected",i===r.activeSuggestionIndex),E(2),Ba(t.icon),E(3),O(t.title),E(2),O(t.category)}}function mee(n,e){if(n&1){let t=Ln();p(0,"ul",48),B(1,pee,8,7,"li",49),p(2,"li",50),ve("mousedown",function(){ze(t);let r=Ne();return We(r.submitSearch())}),k(3,"i",51),v(4,' See all results for "'),p(5,"em"),v(6),m(),v(7,'" '),m()()}if(n&2){let t=Ne();E(),x("ngForOf",t.suggestions),E(5),O(t.searchQuery)}}function gee(n,e){if(n&1){let t=Ln();p(0,"li",52),ve("mousedown",function(){let r=ze(t).$implicit,o=Ne(2);return We(o.selectSuggestion(r))}),p(1,"span",53),k(2,"i",8),m(),p(3,"span",54)(4,"span",55),v(5),m(),p(6,"span",56),v(7),m()()()}if(n&2){let t=e.$implicit,i=e.index,r=Ne(2);Bt("active",i===r.activeSuggestionIndex),E(2),Ba(t.icon),E(3),O(t.title),E(2),O(t.category)}}function vee(n,e){if(n&1){let t=Ln();p(0,"ul",57),B(1,gee,8,6,"li",49),p(2,"li",50),ve("mousedown",function(){ze(t);let r=Ne();return We(r.submitSearch())}),k(3,"i",51),v(4,' All results for "'),p(5,"em"),v(6),m(),v(7,'" '),m()()}if(n&2){let t=Ne();E(),x("ngForOf",t.suggestions),E(5),O(t.searchQuery)}}var Sv=class n{constructor(e,t){this.searchService=e;this.router=t}searchQuery="";suggestions=[];showSuggestions=!1;activeSuggestionIndex=-1;searchOpen=!1;searchInputRef;onSearchInput(){let e=this.searchQuery.trim();e.length>=2?(this.suggestions=this.searchService.getSuggestions(e),this.showSuggestions=this.suggestions.length>0):(this.suggestions=[],this.showSuggestions=!1),this.activeSuggestionIndex=-1}onSearchKeydown(e){if(!this.showSuggestions){e.key==="Enter"&&this.submitSearch();return}switch(e.key){case"ArrowDown":e.preventDefault(),this.activeSuggestionIndex=Math.min(this.activeSuggestionIndex+1,this.suggestions.length-1);break;case"ArrowUp":e.preventDefault(),this.activeSuggestionIndex=Math.max(this.activeSuggestionIndex-1,-1);break;case"Enter":e.preventDefault(),this.activeSuggestionIndex>=0?this.selectSuggestion(this.suggestions[this.activeSuggestionIndex]):this.submitSearch();break;case"Escape":this.closeSuggestions();break}}selectSuggestion(e){this.closeSuggestions(),this.searchQuery="",this.router.navigate([e.url])}submitSearch(){let e=this.searchQuery.trim();e.length>=2&&(this.closeSuggestions(),this.searchQuery="",this.searchOpen=!1,this.router.navigate(["/search"],{queryParams:{q:e}}))}toggleMobileSearch(){this.searchOpen=!this.searchOpen,this.searchOpen?setTimeout(()=>this.searchInputRef?.nativeElement?.focus(),50):(this.searchQuery="",this.closeSuggestions())}closeSuggestions(){this.showSuggestions=!1,this.activeSuggestionIndex=-1}onDocClick(e){e.target.closest(".navbar-search-wrap")||this.closeSuggestions()}static \u0275fac=function(t){return new(t||n)(N(ol),N(_t))};static \u0275cmp=se({type:n,selectors:[["app-navbar"]],viewQuery:function(t,i){if(t&1&&Fn(hee,5),t&2){let r;ln(r=un())&&(i.searchInputRef=r.first)}},hostBindings:function(t,i){t&1&&ve("click",function(o){return i.onDocClick(o)},db)},decls:84,vars:16,consts:[["searchInputRef",""],[1,"navbar","navbar-expand-lg","bg-white","navbar-shadow","sticky-top"],[1,"container"],["routerLink","/",1,"navbar-brand","d-flex","align-items-center","gap-2"],[1,"brand-mark"],[1,"brand-text"],[1,"d-flex","align-items-center","gap-2","d-lg-none","ms-auto"],["type","button","aria-label","Toggle search","id","mobile-search-toggle",1,"icon-btn",3,"click"],[1,"bi"],["type","button","data-bs-toggle","offcanvas","data-bs-target","#mobileNav","aria-controls","mobileNav","aria-label","Toggle navigation",1,"navbar-toggler"],[1,"navbar-toggler-icon"],["id","mainNav",1,"collapse","navbar-collapse"],[1,"navbar-nav","ms-auto","mb-2","mb-lg-0","align-items-lg-center","gap-lg-1"],[1,"nav-item"],["routerLink","/","routerLinkActive","active",1,"nav-link",3,"routerLinkActiveOptions"],["routerLink","/about","routerLinkActive","active",1,"nav-link"],["routerLink","/experience","routerLinkActive","active",1,"nav-link"],["routerLink","/rooms","routerLinkActive","active",1,"nav-link"],["routerLink","/gallery","routerLinkActive","active",1,"nav-link"],["role","search",1,"nav-item","navbar-search-wrap","ms-lg-2"],[1,"search-box"],[1,"bi","bi-search","search-prefix-icon"],["id","navbar-search","type","search","placeholder","Search\u2026","autocomplete","off","aria-label","Search site","aria-autocomplete","list","aria-controls","search-suggestions",1,"search-field",3,"ngModelChange","input","keydown","focus","ngModel"],["id","search-suggestions","class","suggestions-dropdown","role","listbox",4,"ngIf"],[1,"nav-item","ms-lg-1"],["routerLink","/contact",1,"btn","btn-primary","btn-sm","px-4"],["role","search",1,"mobile-search-bar"],[1,"navbar-search-wrap","mobile-search-inner"],[1,"bi","bi-search","mobile-s-icon"],["id","mobile-navbar-search","type","search","placeholder","Search rooms, experiences, FAQs\u2026","autocomplete","off","aria-label","Search site",1,"mobile-search-field",3,"ngModelChange","input","keydown","ngModel"],["type","button",1,"btn","btn-primary","btn-sm",3,"click"],["class","suggestions-dropdown mobile-suggestions","role","listbox",4,"ngIf"],["tabindex","-1","id","mobileNav","aria-labelledby","mobileNavLabel",1,"offcanvas","offcanvas-start","mobile-offcanvas"],[1,"offcanvas-header"],["id","mobileNavLabel",1,"offcanvas-title"],["type","button","data-bs-dismiss","offcanvas","aria-label","Close",1,"btn-close"],[1,"offcanvas-body"],[1,"navbar-nav","gap-2"],["routerLink","/","routerLinkActive","active","data-bs-dismiss","offcanvas",1,"nav-link",3,"routerLinkActiveOptions"],["routerLink","/about","routerLinkActive","active","data-bs-dismiss","offcanvas",1,"nav-link"],["routerLink","/experience","routerLinkActive","active","data-bs-dismiss","offcanvas",1,"nav-link"],["routerLink","/rooms","routerLinkActive","active","data-bs-dismiss","offcanvas",1,"nav-link"],["routerLink","/gallery","routerLinkActive","active","data-bs-dismiss","offcanvas",1,"nav-link"],["routerLink","/reviews","routerLinkActive","active","data-bs-dismiss","offcanvas",1,"nav-link"],["routerLink","/faq","routerLinkActive","active","data-bs-dismiss","offcanvas",1,"nav-link"],["routerLink","/contact","routerLinkActive","active","data-bs-dismiss","offcanvas",1,"nav-link"],[1,"nav-item","mt-2"],["routerLink","/contact","data-bs-dismiss","offcanvas",1,"btn","btn-primary","w-100"],["id","search-suggestions","role","listbox",1,"suggestions-dropdown"],["class","suggestion-item","role","option",3,"active","mousedown",4,"ngFor","ngForOf"],[1,"suggestion-footer",3,"mousedown"],[1,"bi","bi-search"],["role","option",1,"suggestion-item",3,"mousedown"],[1,"suggestion-icon"],[1,"suggestion-body"],[1,"suggestion-title"],[1,"suggestion-cat"],["role","listbox",1,"suggestions-dropdown","mobile-suggestions"]],template:function(t,i){if(t&1){let r=Ln();p(0,"nav",1)(1,"div",2)(2,"a",3)(3,"span",4),v(4,"HEI"),m(),p(5,"span",5)(6,"strong"),v(7,"Himalayan Eco Inn"),m(),p(8,"small"),v(9,"Leh, Ladakh"),m()()(),p(10,"div",6)(11,"button",7),ve("click",function(){return ze(r),We(i.toggleMobileSearch())}),k(12,"i",8),m(),p(13,"button",9),k(14,"span",10),m()(),p(15,"div",11)(16,"ul",12)(17,"li",13)(18,"a",14),v(19,"Home"),m()(),p(20,"li",13)(21,"a",15),v(22,"About"),m()(),p(23,"li",13)(24,"a",16),v(25,"Experience"),m()(),p(26,"li",13)(27,"a",17),v(28,"Rooms"),m()(),p(29,"li",13)(30,"a",18),v(31,"Gallery"),m()(),p(32,"li",19)(33,"div",20),k(34,"i",21),p(35,"input",22,0),as("ngModelChange",function(s){return ze(r),Ha(i.searchQuery,s)||(i.searchQuery=s),We(s)}),ve("input",function(){return ze(r),We(i.onSearchInput())})("keydown",function(s){return ze(r),We(i.onSearchKeydown(s))})("focus",function(){return ze(r),We(i.onSearchInput())}),m(),B(37,mee,8,2,"ul",23),m()(),p(38,"li",24)(39,"a",25),v(40,"Book Now"),m()()()()()(),p(41,"div",26)(42,"div",2)(43,"div",27),k(44,"i",28),p(45,"input",29,0),as("ngModelChange",function(s){return ze(r),Ha(i.searchQuery,s)||(i.searchQuery=s),We(s)}),ve("input",function(){return ze(r),We(i.onSearchInput())})("keydown",function(s){return ze(r),We(i.onSearchKeydown(s))}),m(),p(47,"button",30),ve("click",function(){return ze(r),We(i.submitSearch())}),v(48,"Go"),m()(),B(49,vee,8,2,"ul",31),m()(),p(50,"div",32)(51,"div",33)(52,"h5",34),v(53,"Himalayan Eco Inn"),m(),k(54,"button",35),m(),p(55,"div",36)(56,"ul",37)(57,"li",13)(58,"a",38),v(59,"Home"),m()(),p(60,"li",13)(61,"a",39),v(62,"About"),m()(),p(63,"li",13)(64,"a",40),v(65,"Experience"),m()(),p(66,"li",13)(67,"a",41),v(68,"Rooms"),m()(),p(69,"li",13)(70,"a",42),v(71,"Gallery"),m()(),p(72,"li",13)(73,"a",43),v(74,"Reviews"),m()(),p(75,"li",13)(76,"a",44),v(77,"FAQ"),m()(),p(78,"li",13)(79,"a",45),v(80,"Contact"),m()(),p(81,"li",46)(82,"a",47),v(83,"Book Now"),m()()()()()}t&2&&(E(11),Qt("aria-expanded",i.searchOpen),E(),Bt("bi-search",!i.searchOpen)("bi-x-lg",i.searchOpen),E(6),x("routerLinkActiveOptions",$a(14,S2)),E(17),ss("ngModel",i.searchQuery),Qt("aria-expanded",i.showSuggestions),E(2),x("ngIf",i.showSuggestions),E(4),Bt("open",i.searchOpen),E(4),ss("ngModel",i.searchQuery),E(4),x("ngIf",i.showSuggestions&&i.searchOpen),E(9),x("routerLinkActiveOptions",$a(15,S2)))},dependencies:[qe,XE,Tg,Bi,mo,Id,Le,ei],styles:['@charset "UTF-8";.navbar-shadow[_ngcontent-%COMP%]{box-shadow:0 12px 30px #15182214}.navbar-brand[_ngcontent-%COMP%] .brand-mark[_ngcontent-%COMP%]{background:var(--primary-gradient);color:#fff;font-weight:700;font-size:.85rem;padding:.35rem .5rem;border-radius:.55rem;letter-spacing:.08em}.navbar-brand[_ngcontent-%COMP%] .brand-text[_ngcontent-%COMP%]{display:flex;flex-direction:column;line-height:1.1;font-size:.95rem}.navbar-brand[_ngcontent-%COMP%] .brand-text[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{color:var(--text-muted);font-size:.7rem;letter-spacing:.08em;text-transform:uppercase}.nav-link[_ngcontent-%COMP%]{font-weight:500;color:var(--text-base);padding:.4rem .6rem!important}.nav-link.active[_ngcontent-%COMP%], .nav-link[_ngcontent-%COMP%]:hover{color:var(--primary)}.icon-btn[_ngcontent-%COMP%]{background:none;border:none;padding:.35rem .5rem;font-size:1.15rem;color:var(--text-base);cursor:pointer;line-height:1;transition:color .2s}.icon-btn[_ngcontent-%COMP%]:hover{color:var(--primary)}.search-box[_ngcontent-%COMP%]{position:relative;display:flex;align-items:center}.search-prefix-icon[_ngcontent-%COMP%]{position:absolute;left:.7rem;top:50%;transform:translateY(-50%);color:var(--text-muted);font-size:.85rem;pointer-events:none;z-index:1}.search-field[_ngcontent-%COMP%]{width:180px;padding:.38rem .75rem .38rem 2.1rem;border:1.5px solid #e0e4ef;border-radius:2rem;font-size:.85rem;background:#f8f9fc;color:var(--text-base);outline:none;transition:width .3s ease,border-color .2s,box-shadow .2s}.search-field[_ngcontent-%COMP%]:focus{width:240px;border-color:var(--primary);background:#fff;box-shadow:0 2px 12px #00000014}.search-field[_ngcontent-%COMP%]::placeholder{color:var(--text-muted)}.search-field[_ngcontent-%COMP%]::-webkit-search-cancel-button{cursor:pointer}.suggestions-dropdown[_ngcontent-%COMP%]{position:absolute;top:calc(100% + .5rem);left:0;right:0;min-width:320px;background:#fff;border:1px solid #e0e4ef;border-radius:1rem;box-shadow:0 12px 40px #0000001f;list-style:none;margin:0;padding:.4rem 0;z-index:1100;overflow:hidden;animation:_ngcontent-%COMP%_dropIn .15s ease}@keyframes _ngcontent-%COMP%_dropIn{0%{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:translateY(0)}}.suggestion-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem;padding:.6rem 1rem;cursor:pointer;transition:background .15s}.suggestion-item[_ngcontent-%COMP%]:hover, .suggestion-item.active[_ngcontent-%COMP%]{background:#f4f6fb}.suggestion-icon[_ngcontent-%COMP%]{width:2rem;height:2rem;border-radius:.5rem;background:var(--bg-soft, #eef0f8);display:flex;align-items:center;justify-content:center;font-size:.9rem;color:var(--primary);flex-shrink:0}.suggestion-body[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-width:0;flex:1}.suggestion-title[_ngcontent-%COMP%]{font-size:.875rem;font-weight:600;color:var(--text-base);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.suggestion-cat[_ngcontent-%COMP%]{font-size:.72rem;color:var(--text-muted);text-transform:uppercase;letter-spacing:.06em}.suggestion-footer[_ngcontent-%COMP%]{padding:.55rem 1rem;font-size:.8rem;color:var(--primary);font-weight:600;cursor:pointer;border-top:1px solid #f0f2f8;transition:background .15s}.suggestion-footer[_ngcontent-%COMP%]:hover{background:#f4f6fb}.suggestion-footer[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{margin-right:.3rem}.suggestion-footer[_ngcontent-%COMP%] em[_ngcontent-%COMP%]{font-style:italic}.mobile-search-bar[_ngcontent-%COMP%]{background:#fff;border-bottom:1px solid #e8ecf5;max-height:0;overflow:hidden;transition:max-height .28s ease,padding .28s ease}.mobile-search-bar.open[_ngcontent-%COMP%]{max-height:600px;overflow:visible;padding:.6rem 0}.mobile-search-inner[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;background:#f4f6fb;border-radius:2rem;padding:.35rem .5rem .35rem 1rem}.mobile-s-icon[_ngcontent-%COMP%]{color:var(--text-muted);font-size:.9rem;flex-shrink:0}.mobile-search-field[_ngcontent-%COMP%]{flex:1;border:none;background:transparent;outline:none;font-size:.92rem;color:var(--text-base);padding:.2rem 0}.mobile-search-field[_ngcontent-%COMP%]::placeholder{color:var(--text-muted)}.mobile-suggestions[_ngcontent-%COMP%]{position:relative;top:auto;left:auto;right:auto;margin-top:.5rem;min-width:0;width:100%;border-radius:.75rem;box-shadow:0 8px 28px #00000021;animation:_ngcontent-%COMP%_dropIn .15s ease;z-index:1200}.mobile-offcanvas[_ngcontent-%COMP%]{width:min(82vw,320px)}.mobile-offcanvas[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]{font-weight:600}']})};var Dv=class n{year=new Date().getFullYear();static \u0275fac=function(t){return new(t||n)};static \u0275cmp=se({type:n,selectors:[["app-footer"]],decls:70,vars:1,consts:[[1,"footer-section"],[1,"container"],[1,"row","g-4"],[1,"col-lg-4"],[1,""],[1,"footer-social"],["href","#","aria-label","Instagram",1,"btn","btn-outline-light","btn-sm"],[1,"bi","bi-instagram"],["href","#","aria-label","Facebook",1,"btn","btn-outline-light","btn-sm"],[1,"bi","bi-facebook"],["href","#","aria-label","YouTube",1,"btn","btn-outline-light","btn-sm"],[1,"bi","bi-youtube"],[1,"col-6","col-lg-2"],[1,"list-unstyled","footer-links"],["routerLink","/about"],["routerLink","/rooms"],["routerLink","/experience"],["routerLink","/gallery"],["routerLink","/reviews"],["routerLink","/nearby"],["routerLink","/contact"],["routerLink","/faq"],["routerLink","/admin/login"],["routerLink","/privacy-policy"],["routerLink","/terms"],[1,"mb-1"],[1,"mb-0"],[1,"footer-bottom"]],template:function(t,i){t&1&&(p(0,"footer",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"h5"),v(5,"Himalayan Eco Inn"),m(),p(6,"p",4),v(7," A modern eco-luxury retreat in Leh, Ladakh. Designed for comfort, curated experiences, and sustainable hospitality. "),m(),p(8,"div",5)(9,"a",6),k(10,"i",7),m(),p(11,"a",8),k(12,"i",9),m(),p(13,"a",10),k(14,"i",11),m()()(),p(15,"div",12)(16,"h6"),v(17,"Explore"),m(),p(18,"ul",13)(19,"li")(20,"a",14),v(21,"About"),m()(),p(22,"li")(23,"a",15),v(24,"Rooms"),m()(),p(25,"li")(26,"a",16),v(27,"Experience"),m()(),p(28,"li")(29,"a",17),v(30,"Gallery"),m()(),p(31,"li")(32,"a",18),v(33,"Reviews"),m()(),p(34,"li")(35,"a",19),v(36,"Nearby Places"),m()()()(),p(37,"div",12)(38,"h6"),v(39,"Support"),m(),p(40,"ul",13)(41,"li")(42,"a",20),v(43,"Contact"),m()(),p(44,"li")(45,"a",21),v(46,"FAQ"),m()(),p(47,"li")(48,"a",22),v(49,"Admin Login"),m()(),p(50,"li")(51,"a",23),v(52,"Privacy Policy"),m()(),p(53,"li")(54,"a",24),v(55,"Terms"),m()()()(),p(56,"div",3)(57,"h6"),v(58,"Visit Us"),m(),p(59,"p",25),v(60,"Upper Tukcha Rd, near GH road, Leh, Ladakh 194101"),m(),p(61,"p",25),v(62,"+91 60060 24435"),m(),p(63,"p",26),v(64,"info@himalayanecoinn.com "),m()()(),p(65,"div",27)(66,"span"),v(67),m(),p(68,"span"),v(69,"Crafted for modern Himalayan hospitality"),m()()()()),t&2&&(E(67),ye("\xA9 ",i.year," Himalayan Eco Inn. All rights reserved."))},dependencies:[qe],styles:[".footer-section[_ngcontent-%COMP%]{background:#101722;color:#eef1f6;padding:4rem 0 2.5rem}.footer-section[_ngcontent-%COMP%] h5[_ngcontent-%COMP%], .footer-section[_ngcontent-%COMP%] h6[_ngcontent-%COMP%]{color:#fff}.footer-links[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:#c8d2e1;text-decoration:none}.footer-links[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{color:#fff}.footer-social[_ngcontent-%COMP%]{display:flex;gap:.5rem}.footer-bottom[_ngcontent-%COMP%]{border-top:1px solid rgba(255,255,255,.1);margin-top:2rem;padding-top:1.5rem;display:flex;flex-wrap:wrap;gap:.75rem;justify-content:space-between;color:#c8d2e1;font-size:.9rem}"]})};var Tv=class n{analytics=C(zc);constructor(){this.analytics.trackVisit()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=se({type:n,selectors:[["app-root"]],decls:6,vars:0,consts:[[1,"app-main"],["href","https://wa.me/916006024435","target","_blank","rel","noopener","aria-label","Chat on WhatsApp",1,"whatsapp-float"],[1,"bi","bi-whatsapp"]],template:function(t,i){t&1&&(k(0,"app-navbar"),p(1,"main",0),k(2,"router-outlet"),m(),k(3,"app-footer"),p(4,"a",1),k(5,"i",2),m())},dependencies:[gu,Sv,Dv],styles:["[_nghost-%COMP%]{display:block}.app-main[_ngcontent-%COMP%]{min-height:calc(100vh - 280px)}"]})};IE(Tv,I2).catch(n=>console.error(n));